denchclaw 3.0.0 → 3.0.2
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/apps/web/.next/standalone/apps/web/.next/BUILD_ID +1 -1
- package/apps/web/.next/standalone/apps/web/.next/app-build-manifest.json +152 -152
- package/apps/web/.next/standalone/apps/web/.next/app-path-routes-manifest.json +43 -43
- package/apps/web/.next/standalone/apps/web/.next/build-manifest.json +2 -2
- package/apps/web/.next/standalone/apps/web/.next/cache/config.json +3 -3
- package/apps/web/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
- package/apps/web/.next/standalone/apps/web/.next/required-server-files.json +1 -1
- package/apps/web/.next/standalone/apps/web/.next/routes-manifest.json +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/cron/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/proxy/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/serve/[...path]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/store/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/webhooks/[...path]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/active/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/runs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/stop/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/stop/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/stream/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/subagents/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/callback/route.js +8 -8
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/callback/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/connect/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/connect/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/connections/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/disconnect/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/status/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/toolkits/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/calendar/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/calendar/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/companies/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/enrich/[type]/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/inbox/[threadId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/inbox/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/people/[id]/activity/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/people/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/people/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/photos/proxy/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/photos/sync/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/jobs/[jobId]/runs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/jobs/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/jobs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/runs/[sessionId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/runs/search-transcript/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/feedback/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/feedback/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/channels/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/chat/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/chat/stream/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/sessions/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/sessions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/integrations/[id]/toggle/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/integrations/repair/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/integrations/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/memories/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/connections/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/connections/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/dench-cloud/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/dench-cloud/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/identity/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/identity/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/state/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/state/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/sync/progress/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/sync/start/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/sync/start/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/profiles/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/profiles/switch/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sessions/[sessionId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/settings/cloud/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/settings/cloud/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/[slug]/content/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/[slug]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/browse/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sync/poll-tick/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sync/refresh/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sync/status/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/terminal/port/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/voice/speech/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/voice/transcribe/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/voice/voices/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/[id]/messages/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/assets/[...path]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/browse/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/browse-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/context/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/copy/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/db/introspect/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/db/query/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/delete/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/delete/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/execute/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/init/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/init/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/link-preview/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/list/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/mkdir/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/move/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/actions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/actions/runs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/display-field/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/[id]/content/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/bulk-delete/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/options/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/[fieldId]/enum-rename/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/[fieldId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/reorder/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/icon/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/views/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/open-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/path-info/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/query/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/raw-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/rename/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/reports/execute/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/reports/execute/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/search-index/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/suggest-files/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/switch/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/switch/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/thumbnail/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/tree/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/upload/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/upload/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/virtual-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/watch/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/write-binary/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/page.js +2 -2
- package/apps/web/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app-paths-manifest.json +43 -43
- package/apps/web/.next/standalone/apps/web/.next/server/chunks/27488.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/chunks/63780.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/chunks/6787.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/functions-config-manifest.json +23 -23
- package/apps/web/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/apps/web/.next/standalone/apps/web/.next/static/chunks/app/{layout-8beeb8ad12058c3c.js → layout-f4f08d1ad091b70b.js} +1 -1
- package/apps/web/.next/{static/chunks/app/page-d71d1a3421cb80e9.js → standalone/apps/web/.next/static/chunks/app/page-6c87f60a52518001.js} +1 -1
- package/apps/web/.next/standalone/apps/web/server.js +1 -1
- package/apps/web/.next/standalone/extensions/dench-ai-gateway/models.ts +25 -39
- package/apps/web/.next/standalone/extensions/posthog-analytics/lib/build-env.js +1 -1
- package/apps/web/.next/standalone/package.json +1 -1
- package/apps/web/.next/static/chunks/app/{layout-8beeb8ad12058c3c.js → layout-f4f08d1ad091b70b.js} +1 -1
- package/apps/web/.next/{standalone/apps/web/.next/static/chunks/app/page-d71d1a3421cb80e9.js → static/chunks/app/page-6c87f60a52518001.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/{program-D39-8KbQ.js → program-DkbQrUbR.js} +28 -40
- package/dist/{run-main-Ca4XgjVM.js → run-main-C8K-k6-d.js} +1 -1
- package/extensions/dench-ai-gateway/models.ts +25 -39
- package/extensions/posthog-analytics/lib/build-env.js +1 -1
- package/package.json +1 -1
- /package/apps/web/.next/standalone/apps/web/.next/static/{TgoqmuhRel_KXOJpjC2fj → uNyuud6_Cxsbl9z1OjCUW}/_buildManifest.js +0 -0
- /package/apps/web/.next/standalone/apps/web/.next/static/{TgoqmuhRel_KXOJpjC2fj → uNyuud6_Cxsbl9z1OjCUW}/_ssgManifest.js +0 -0
- /package/apps/web/.next/static/{TgoqmuhRel_KXOJpjC2fj → uNyuud6_Cxsbl9z1OjCUW}/_buildManifest.js +0 -0
- /package/apps/web/.next/static/{TgoqmuhRel_KXOJpjC2fj → uNyuud6_Cxsbl9z1OjCUW}/_ssgManifest.js +0 -0
|
@@ -249,7 +249,7 @@ ${(0,m.GP)(a.startDate,"MMM d")} - ${(0,m.GP)(a.endDate,"MMM d")}`,children:[r&&
|
|
|
249
249
|
${m}`:a}if(a&&aB.current!==a.path){let b=a.isDirectory?"directory":"file";m=`[Context: workspace ${b} '${a.path}']
|
|
250
250
|
|
|
251
251
|
${m}`,aB.current=a.path}if(aE.current.set(m,d),aF.current=d,ba.current=!1,L){let a={id:`user-${Date.now()}`,role:"user",parts:[{type:"text",text:m}]};a0(b=>[...b,a]);try{let a=await fetch("/api/gateway/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionKey:L,message:m})});a.ok&&a.body&&await bg(L,[],{sessionKey:L})}catch{}}else aY({text:m});setTimeout(()=>{ah.current?.focus()},200)},[ap,a4,ak,bf,q,t,aT,a,aY,L,bg,K,af,a0]);(0,h.useEffect)(()=>{aK.current=bq},[bq]);let br=(0,h.useRef)(aZ);(0,h.useEffect)(()=>{let a="streaming"===br.current||"submitted"===br.current,b="ready"===aZ;if(br.current=aZ,a&&b&&aG.length>0){let[a,...b]=aG;for(let c of(aH(b),a.attachedFiles))c.localUrl&&URL.revokeObjectURL(c.localUrl);queueMicrotask(()=>{bq(a.text,a.mentionedFiles,a.html,a.attachedFiles)})}},[aZ,aG,bq]);let bs=(0,h.useCallback)(async a=>{if(a!==ak){aw.current?.abort(),a$(),an(!0),al(a),aU.current=a,q?.(a),az.current.clear(),aB.current=null,aH([]);try{let b=await fetch(`/api/web-sessions/${a}`);if(!b.ok){console.warn(`Session ${a} not found (${b.status}), starting fresh.`),a0([]),an(!1);return}let c=(await b.json()).messages||[],d=c.some(a=>a._streaming)?c.filter(a=>!a._streaming):c;for(let a of(aE.current.clear(),d))"user"===a.role&&a.html&&aE.current.set(a.id,a.html);let e=d.map(a=>(az.current.add(a.id),{id:a.id,role:a.role,parts:a.parts??[{type:"text",text:a.content}]}));a0(e),an(!1),await bg(a,e)}catch(a){console.error("Error loading session:",a),an(!1)}}},[ak,a0,q,a$,bg]),bt=(0,h.useCallback)(()=>{aw.current?.abort(),a$(),av(!1),al(null),aU.current=null,q?.(null),a0([]),az.current.clear(),aE.current.clear(),aB.current=null,aA.current=!1,a3.current=null,aH([]),requestAnimationFrame(()=>{ah.current?.focus()})},[a0,q,a$]);bp.current=bt,(0,h.useImperativeHandle)(ae,()=>({loadSession:bs,newSession:async()=>{bt()},sendNewMessage:async a=>{K?.(),bt();let b=a.length>60?a.slice(0,60)+"...":a,c=await bf(b);al(c),aU.current=c,q?.(c),t?.(),ba.current=!1,aY({text:a})},insertFileMention:(a,b)=>{ah.current?.insertFileMention(a,b)}}),[bs,bt,bf,q,t,K,aY]);let bu=(0,h.useCallback)(async()=>{aw.current?.abort(),av(!1);let a=aV.current,b=aU.current;if(a||b)try{await fetch("/api/chat/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a?{sessionKey:a}:{sessionId:b})})}catch{}a$()},[a$]);(0,h.useEffect)(()=>{aJ.current=bu},[bu]);let bv=(0,h.useCallback)(a=>{aH(b=>b.filter(b=>b.id!==a))},[]),bw=(0,h.useCallback)((a,b)=>{aH(c=>c.map(c=>c.id===a?{...c,text:b}:c))},[]),bx=(0,h.useCallback)(async a=>{let b=aG.find(b=>b.id===a);b&&(aH(b=>b.filter(b=>b.id!==a)),await bu(),setTimeout(()=>{bq(b.text,b.mentionedFiles,b.html,b.attachedFiles)},100))},[aG,bu,bq]),by=(0,h.useCallback)(a=>{aq(b=>{let c=b.find(b=>b.id===a);return c?.localUrl&&URL.revokeObjectURL(c.localUrl),b.filter(b=>b.id!==a)})},[]),bz=(0,h.useCallback)(()=>{aq(a=>{for(let b of a)b.localUrl&&URL.revokeObjectURL(b.localUrl);return[]})},[]),bA=(0,h.useCallback)(a=>{let b=Array.from(a),c=b.map(a=>({id:`pending-${Date.now()}-${Math.random().toString(36).slice(2)}`,name:a.name,path:"",uploading:!0,localUrl:URL.createObjectURL(a)}));aq(a=>[...a,...c]);for(let a=0;a<b.length;a++){let d=b[a],e=c[a].id,f=c[a].localUrl,g=new FormData;g.append("file",d),fetch("/api/workspace/upload",{method:"POST",body:g}).then(a=>a.ok?a.json():null).then(a=>{a?.ok&&a.path?aq(b=>b.map(b=>b.id===e?{...b,path:a.path,uploading:!1}:b)):(aq(a=>a.filter(a=>a.id!==e)),f&&URL.revokeObjectURL(f))}).catch(()=>{aq(a=>a.filter(a=>a.id!==e)),f&&URL.revokeObjectURL(f)})}},[]),bB=aX.length>0?aX[aX.length-1]:null;(0,p.Wr)(bB);let bC=(0,p.It)({loadingSession:am,isReconnecting:au,status:aZ,hasRunningSubagents:bk,lastMessage:bB}),bD=a4&&!!bC,bE=0===aX.length&&!af&&!am&&null===a1;(0,h.useEffect)(()=>{!O||ak||af||ag||am||a3.current||aX.length>0||(a3.current=bf("New Chat"))},[O,ak,af,ag,am,aX.length,bf]);let bF=(0,e.jsxs)(e.Fragment,{children:[aG.length>0&&(0,e.jsx)("div",{className:b?"px-2 pt-2":"px-3 pt-3",children:(0,e.jsxs)("div",{className:"rounded-xl border overflow-hidden",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",boxShadow:"var(--shadow-sm)"},children:[(0,e.jsxs)("div",{className:"px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-muted)",background:"var(--color-surface-hover)"},children:["Queue (",aG.length,")"]}),(0,e.jsx)("div",{className:"flex flex-col p-2",children:aG.map((a,b)=>(0,e.jsx)(v,{msg:a,idx:b,onEdit:bw,onSendNow:bx,onRemove:bv},a.id))})]})}),!af&&(0,e.jsx)(w,{files:ap,compact:b,onRemove:by,onClearAll:bz}),(0,e.jsx)(k.y,{ref:ah,onSubmit:bq,onChange:a=>aj(a),onNativeFileDrop:af?void 0:bA,placeholder:bE?"Build a workflow to automate your tasks":af?a4?"Type to queue a message...":"Type @ to mention files...":a?`Ask about ${a.isDirectory?"this folder":a.filename}...`:a4?"Type to queue a message...":ap.length>0?"Add a message or send files...":"Type @ to mention files...",disabled:am,compact:b,searchFn:P}),(0,e.jsxs)("div",{className:`flex items-center justify-between ${b?"px-2 pb-1.5":"px-3 pb-2.5"}`,children:[(0,e.jsx)("div",{className:"flex items-center gap-0.5",children:!af&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("input",{ref:ar,type:"file",multiple:!0,className:"hidden",onChange:a=>{a.target.files&&a.target.files.length>0&&bA(a.target.files),a.target.value=""}}),(0,e.jsx)("button",{type:"button",onClick:()=>ar.current?.click(),className:"p-1.5 rounded-lg hover:opacity-80 transition-opacity",style:{color:ap.length>0?"var(--color-accent)":"var(--color-text-muted)"},title:"Attach files",children:(0,e.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,e.jsx)("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})})]})}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(l.N,{compact:b,disabled:am,preferServerTranscription:a5,onTranscript:aS}),a4?(0,e.jsx)("button",{type:"button",onClick:()=>bu(),className:`${b?"w-6 h-6":"w-7 h-7"} rounded-full flex items-center justify-center`,style:{background:"var(--color-text)",color:"var(--color-bg)"},title:"Stop generating",children:(0,e.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"currentColor",children:(0,e.jsx)("rect",{width:"10",height:"10",rx:"1.5"})})}):(0,e.jsx)("button",{type:"button",onClick:()=>ah.current?.submit(),disabled:ai&&0===ap.length||am,className:`${b?"w-6 h-6":"w-7 h-7"} rounded-full flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed`,style:{background:!ai||ap.length>0?"linear-gradient(to top, #0065A2, #0075AA)":"var(--color-text-muted)",color:!ai||ap.length>0?"white":"var(--color-bg)"},title:"Send message",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"M12 19V5"}),(0,e.jsx)("path",{d:"m5 12 7-7 7 7"})]})})]})]})]}),bG=(a,c,d)=>(0,e.jsx)("div",{"data-chat-drop-target":"",className:`${b?"rounded-2xl":"rounded-3xl"} overflow-hidden border shadow-[0_0_32px_rgba(0,0,0,0.07)] transition-[outline,box-shadow,border-color] duration-150 ease-out focus-within:border-[var(--color-border-strong)]! data-drag-hover:outline-2 data-drag-hover:outline-dashed data-drag-hover:outline-(--color-accent) data-drag-hover:-outline-offset-2 data-drag-hover:shadow-[0_0_0_4px_color-mix(in_srgb,var(--color-accent)_15%,transparent),0_0_32px_rgba(0,0,0,0.07)]!`,style:{background:"color-mix(in srgb, var(--color-surface) 75%, transparent)",backdropFilter:"blur(16px) saturate(180%)",WebkitBackdropFilter:"blur(16px) saturate(180%)",borderColor:"var(--color-border)"},onDragOver:a,onDragLeave:c,onDrop:d,children:bF}),bH=a=>{(a.dataTransfer?.types.includes("application/x-file-mention")||a.dataTransfer?.types.includes("Files"))&&(a.preventDefault(),a.dataTransfer.dropEffect="copy",a.currentTarget.setAttribute("data-drag-hover",""))},bI=a=>{a.currentTarget.contains(a.relatedTarget)||a.currentTarget.removeAttribute("data-drag-hover")},bJ=a=>{a.currentTarget.removeAttribute("data-drag-hover");let b=a.dataTransfer?.getData("application/x-file-mention");if(b){a.preventDefault(),a.stopPropagation();try{let{name:a,path:c}=JSON.parse(b);a&&c&&ah.current?.insertFileMention(a,c)}catch{}return}let c=a.dataTransfer?.files;c&&c.length>0&&(a.preventDefault(),a.stopPropagation(),bA(c))};return(0,e.jsxs)("div",{className:"@container relative h-full min-h-0 flex flex-col overflow-hidden",style:{background:"var(--color-main-bg)"},children:[(0,e.jsxs)("header",{className:`pl-4 pr-2 h-10 flex shrink-0 items-center gap-2 ${af?"":"justify-between"} z-20`,children:[H&&(0,e.jsx)("div",{className:"flex items-center shrink-0",children:H}),af?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{type:"button",onClick:F,className:"p-1.5 rounded-lg flex-shrink-0",style:{color:"var(--color-text-muted)"},title:"Back to parent chat",children:(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"m12 19-7-7 7-7"}),(0,e.jsx)("path",{d:"M19 12H5"})]})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold truncate",style:{color:"var(--color-text)"},children:E||(D&&D.length>60?D.slice(0,60)+"...":D)}),(0,e.jsx)("p",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:a4?(0,e.jsx)(n.V,{name:"braille"}):"Completed"})]})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"min-w-0 flex-1",children:ak?(0,e.jsx)("h2",{className:"text-sm font-semibold truncate",style:{color:"var(--color-text)"},title:c||"Chat Session",children:c||"Chat Session"}):null}),!G&&(0,e.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[Y&&(0,e.jsx)("button",{type:"button",onClick:Y,className:"p-1.5 rounded-lg cursor-pointer transition-colors",style:{color:"var(--color-text-muted)"},title:"New chat","aria-label":"New chat",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,e.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"M5 12h14"}),(0,e.jsx)("path",{d:"M12 5v14"})]})}),ak&&A&&(0,e.jsxs)(m.rI,{children:[(0,e.jsx)(m.ty,{className:"p-1.5 rounded-lg cursor-pointer transition-colors",style:{color:"var(--color-text-muted)"},title:"More options","aria-label":"More options",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"1"}),(0,e.jsx)("circle",{cx:"5",cy:"12",r:"1"}),(0,e.jsx)("circle",{cx:"19",cy:"12",r:"1"})]})}),(0,e.jsx)(m.SQ,{align:"end",side:"bottom",children:(0,e.jsxs)(m._2,{variant:"destructive",onSelect:()=>A(ak),children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"M3 6h18"}),(0,e.jsx)("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),(0,e.jsx)("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),"Delete this chat"]})})]})]})]}),I&&(0,e.jsx)("div",{className:"flex items-center shrink-0",children:I})]}),(0,e.jsxs)("div",{ref:a9,className:"min-h-0 min-w-0 flex-1 overflow-y-auto",style:{scrollbarGutter:"stable",paddingBottom:140*!bE},children:[(0,e.jsx)("div",{className:b?"px-3":"px-6",children:am?(0,e.jsx)("div",{className:"flex items-center justify-center h-full min-h-[60vh]",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)(n.V,{name:"braille",className:"block text-2xl mx-auto mb-3",style:{color:"var(--color-text-muted)"}}),(0,e.jsx)("p",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:"Loading session..."})]})}):bE&&!as?(0,e.jsx)("div",{className:`flex items-center justify-center h-full ${b?"min-h-[40vh]":"min-h-[60vh]"}`}):bE?(0,e.jsxs)("div",{className:`flex flex-col items-center justify-center py-8 md:py-12 ${b?"min-h-[60vh]":"min-h-[75vh]"}`,children:[aQ&&(0,e.jsx)("h1",{className:"font-bookerly font-medium mb-2 md:mb-3 text-center px-4",style:{color:"var(--color-text)",fontSize:"clamp(1.5rem, 3.5cqw + 0.85rem, 3rem)",letterSpacing:"-0.03em"},children:aQ}),(0,e.jsx)("div",{className:"w-full max-w-[720px] mx-auto px-3 md:px-4",children:bG(bH,bI,bJ)}),(0,e.jsx)(i._,{compact:!!b,onPromptClick:aR})]}):null!==a1&&0===aX.length?(0,e.jsxs)("div",{className:`${b?"":"max-w-2xl mx-auto"} py-3`,children:[(0,e.jsx)("div",{className:"flex justify-end py-2",children:(0,e.jsx)("div",{className:"max-w-[85%] rounded-2xl px-4 py-2 text-sm whitespace-pre-wrap break-words",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:a1})}),(0,e.jsx)("div",{className:"py-3 min-w-0",children:(0,e.jsxs)("div",{className:"inline-flex max-w-full items-center gap-1.5 px-1 py-1.5 dench-shimmer",style:{color:"var(--color-text-muted)"},children:[(0,e.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",width:14,height:14,className:"rounded-sm"}),(0,e.jsx)("span",{className:"text-xs truncate",children:"Preparing response…"})]})})]}):0===aX.length?(0,e.jsx)("div",{className:"flex items-center justify-center h-full min-h-[60vh]",children:(0,e.jsx)("div",{className:"text-center max-w-md px-4",children:(0,e.jsx)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"Ask about this file"})})}):(0,e.jsxs)("div",{className:`${b?"":"max-w-2xl mx-auto"} py-3`,children:[aM?(0,e.jsx)("pre",{className:"text-xs whitespace-pre-wrap break-all font-mono p-4 rounded-xl",style:{color:"var(--color-text)",background:"var(--color-surface-hover)"},children:JSON.stringify(aX,null,2)}):(()=>{let a=new Set,b=[];for(let c=aX.length-1;c>=0;c--){let d=aX[c];a.has(d.id)||(a.add(d.id),b.unshift(d))}return b.map((a,c)=>(0,e.jsx)(j.c,{message:a,isStreaming:a4&&c===b.length-1,onSubagentClick:x,onFilePathClick:y,onComposioAction:z,sessionId:ak,voicePlaybackEnabled:a6,userHtmlMap:aE.current,copyable:!0},a.id))})(),bD&&(0,e.jsx)("div",{className:"py-3 min-w-0",children:(0,e.jsxs)("div",{className:"inline-flex max-w-full items-center gap-1.5 px-1 py-1.5 dench-shimmer",style:{color:"var(--color-text-muted)"},children:[(0,e.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",width:14,height:14,className:"rounded-sm"}),(0,e.jsx)("span",{className:"text-xs truncate",children:bC})]})}),(0,e.jsx)("div",{ref:ao})]})}),(a_||ax)&&(0,e.jsxs)("div",{className:"px-3 py-2 flex items-center gap-2 sticky bottom-[72px] z-10",style:{background:"color-mix(in srgb, var(--color-error) 6%, var(--color-surface))",borderColor:"color-mix(in srgb, var(--color-error) 18%, transparent)",color:"var(--color-error)"},children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,e.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,e.jsx)("p",{className:"text-xs",children:a_?.message??ax})]})]}),!bE&&(0,e.jsx)("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none z-10",style:{height:140,background:"linear-gradient(to top, var(--color-main-bg) 0%, var(--color-main-bg) 35%, color-mix(in srgb, var(--color-main-bg) 60%, transparent) 70%, transparent 100%)"}}),!bE&&(0,e.jsx)("div",{className:`${b?"px-3 py-2":"px-3 pb-3 pt-3 @md:px-6 @md:pb-5"} absolute inset-x-0 bottom-0 z-20 pointer-events-none`,children:(0,e.jsxs)("div",{className:`${b?"":"max-w-[720px] mx-auto"} pointer-events-auto relative`,children:[bc&&(0,e.jsx)("div",{className:"absolute inset-x-0 -top-10 flex justify-center pointer-events-none z-30",children:(0,e.jsx)("button",{type:"button",onClick:be,className:"pointer-events-auto w-8 h-8 rounded-full flex items-center justify-center shadow-md border transition-colors",style:{background:"var(--color-surface)",borderColor:"var(--color-border)",color:"var(--color-text-muted)"},title:"Scroll to bottom",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"M12 5v14"}),(0,e.jsx)("path",{d:"m19 12-7 7-7-7"})]})})}),bG(bH,bI,bJ)]})})]})});d()}catch(a){d(a)}})},339065:(a,b,c)=>{let d=c(764334),e=c(228123),f=c(649202),g=c(947186),h=c(884878),i=c(768956),j=c(407223),k=c(8366),l=c(111609),m=c(837519),n=c(512089),{FormulaHelpers:o}=c(828358),{Parser:p,allTokens:q}=c(69213),r=c(410490),s=c(905296);class t{constructor(a,b=!1){this.logs=[],this.isTest=b,this.utils=new s(this),a=Object.assign({functions:{},functionsNeedContext:{},onVariable:()=>null,onCell:()=>0,onRange:()=>[[0]]},a),this.onVariable=a.onVariable,this.functions=Object.assign({},l,k,j,i,h,g,d,e,f,m,a.functions,a.functionsNeedContext),this.onRange=a.onRange,this.onCell=a.onCell,this.funsNullAs0=Object.keys(e).concat(Object.keys(f)).concat(Object.keys(g)).concat(Object.keys(h)).concat(Object.keys(i)).concat(Object.keys(k)).concat(Object.keys(l)),this.funsNeedContextAndNoDataRetrieve=["ROW","ROWS","COLUMN","COLUMNS","SUMIF","INDEX","AVERAGEIF","IF"],this.funsNeedContext=[...Object.keys(a.functionsNeedContext),...this.funsNeedContextAndNoDataRetrieve,"INDEX","OFFSET","INDIRECT","IF","CHOOSE","WEBSERVICE"],this.funsPreserveRef=Object.keys(j),this.parser=new p(this,this.utils)}static get allTokens(){return q}getCell(a){return null==a.sheet&&(a.sheet=this.position?this.position.sheet:void 0),this.onCell(a)}getRange(a){return null==a.sheet&&(a.sheet=this.position?this.position.sheet:void 0),this.onRange(a)}getVariable(a){let b={ref:this.onVariable(a,this.position.sheet,this.position)};return null==b.ref?n.NAME:b}retrieveRef(a){return o.isRangeRef(a)?this.getRange(a.ref):o.isCellRef(a)?this.getCell(a.ref):a}_callFunction(a,b){0===a.indexOf("_xlfn.")&&(a=a.slice(6)),a=a.toUpperCase();let c=this.funsNullAs0.includes(a)?0:"";if(this.funsNeedContextAndNoDataRetrieve.includes(a)||(b=b.map(b=>{if(null===b)return{value:c,isArray:!1,omitted:!0};let d=this.utils.extractRefValue(b);return this.funsPreserveRef.includes(a)?{value:d.val,isArray:d.isArray,ref:b.ref}:{value:d.val,isArray:d.isArray,isRangeRef:!!o.isRangeRef(b),isCellRef:!!o.isCellRef(b)}})),this.functions[a]){let c;try{c=this.funsNeedContextAndNoDataRetrieve.includes(a)||this.funsNeedContext.includes(a)?this.functions[a](this,...b):this.functions[a](...b)}catch(a){if(a instanceof n)return a;throw a}if(void 0===c){if(this.isTest)return this.logs.includes(a)||this.logs.push(a),{value:0,ref:{}};throw n.NOT_IMPLEMENTED(a)}return c}if(this.isTest)return this.logs.includes(a)||this.logs.push(a),{value:0,ref:{}};throw n.NOT_IMPLEMENTED(a)}async callFunctionAsync(a,b){let c=[];for(let a of b)c.push(await a);let d=await this._callFunction(a,c);return o.checkFunctionResult(d)}callFunction(a,b){if(this.async)return this.callFunctionAsync(a,b);{let c=this._callFunction(a,b);return o.checkFunctionResult(c)}}supportedFunctions(){let a=[];return Object.keys(this.functions).forEach(b=>{try{let c=this.functions[b](0,0,0,0,0,0,0,0,0,0,0);if(void 0===c)return;a.push(b)}catch(c){c instanceof Error&&a.push(b)}}),a.sort()}checkFormulaResult(a,b=!1){let c=typeof a;if("number"===c){if(isNaN(a))return n.VALUE;if(!isFinite(a))return n.NUM;a+=0}else if("object"===c){if(a instanceof n)return a;if(b){if(a.ref&&(a=this.retrieveRef(a)),"object"==typeof a&&!Array.isArray(a)&&null!=a)return n.VALUE}else if(a.ref&&a.ref.row&&!a.ref.from)a=this.retrieveRef(a);else if(a.ref&&a.ref.from&&a.ref.from.col===a.ref.to.col)a=this.retrieveRef({ref:{row:a.ref.from.row,col:a.ref.from.col}});else{if(!Array.isArray(a))return n.VALUE;a=a[0][0]}}return a}parse(a,b,c=!1){let d;if(0===a.length)throw Error("Input must not be empty.");this.position=b,this.async=!1;let e=r.lex(a);this.parser.input=e.tokens;try{if(d=this.parser.formulaWithBinaryOp(),(d=this.checkFormulaResult(d,c))instanceof n)return d}catch(a){throw n.ERROR(a.message,a)}if(this.parser.errors.length>0){let b=this.parser.errors[0];throw s.formatChevrotainError(b,a)}return d}async parseAsync(a,b,c=!1){let d;if(0===a.length)throw Error("Input must not be empty.");this.position=b,this.async=!0;let e=r.lex(a);this.parser.input=e.tokens;try{if(d=await this.parser.formulaWithBinaryOp(),(d=this.checkFormulaResult(d,c))instanceof n)return d}catch(a){throw n.ERROR(a.message,a)}if(this.parser.errors.length>0){let b=this.parser.errors[0];throw s.formatChevrotainError(b,a)}return d}}a.exports={FormulaParser:t,FormulaHelpers:o}},341790:(a,b,c)=>{let d=c(512089),{FormulaHelpers:e}=c(828358),f={boolean:3,string:2,number:1};a.exports={Prefix:{unaryOp:(a,b,c)=>{let f=1;if(a.forEach(a=>{if("+"===a);else if("-"===a)f=-f;else throw Error(`Unrecognized prefix: ${a}`)}),null==b&&(b=0),1===f)return b;try{b=e.acceptNumber(b,c)}catch(a){if(a instanceof d)Array.isArray(b)&&(b=b[0][0]);else throw a}return"number"==typeof b&&isNaN(b)?d.VALUE:-b}},Postfix:{percentOp:(a,b,c)=>{try{a=e.acceptNumber(a,c)}catch(a){if(a instanceof d)return a;throw a}if("%"===b)return a/100;throw Error(`Unrecognized postfix: ${b}`)}},Infix:{compareOp:(a,b,c,d,e)=>{null==a&&(a=0),null==c&&(c=0),d&&(a=a[0][0]),e&&(c=c[0][0]);let g=typeof a,h=typeof c;if(g===h)switch(b){case"=":return a===c;case">":return a>c;case"<":return a<c;case"<>":return a!==c;case"<=":return a<=c;case">=":return a>=c}else switch(b){case"=":return!1;case">":return f[g]>f[h];case"<":return f[g]<f[h];case"<>":return!0;case"<=":return f[g]<=f[h];case">=":return f[g]>=f[h]}throw Error("Infix.compareOp: Should not reach here.")},concatOp:(a,b,c,d,e)=>(null==a&&(a=""),null==c&&(c=""),d&&(a=a[0][0]),e&&(c=c[0][0]),"boolean"==typeof a&&(a=a?"TRUE":"FALSE"),"boolean"==typeof c&&(c=c?"TRUE":"FALSE"),""+a+c),mathOp:(a,b,c,f,g)=>{null==a&&(a=0),null==c&&(c=0);try{a=e.acceptNumber(a,f),c=e.acceptNumber(c,g)}catch(a){if(a instanceof d)return a;throw a}switch(b){case"+":return a+c;case"-":return a-c;case"*":return a*c;case"/":if(0===c)return d.DIV0;return a/c;case"^":return a**c}throw Error("Infix.mathOp: Should not reach here.")}},Operators:{compareOp:["<",">","=","<>","<=",">="],concatOp:["&"],mathOp:["+","-","*","/","^"]}}},347751:(a,b,c)=>{"use strict";c.d(b,{P:()=>f});var d=c(502714),e=c(845722);function f(a,b,c){let f=(0,e.a)(a,c?.in);if(isNaN(b))return(0,d.w)(c?.in||a,NaN);if(!b)return f;let g=f.getDate(),h=(0,d.w)(c?.in||a,f.getTime());return(h.setMonth(f.getMonth()+b+1,0),g>=h.getDate())?h:(f.setFullYear(h.getFullYear(),h.getMonth(),g),f)}},348445:(a,b,c)=>{"use strict";c.d(b,{C:()=>d});let d=function(a){var b,c;if(null==a)return f;if("function"==typeof a)return e(a);if("object"==typeof a){return Array.isArray(a)?function(a){let b=[],c=-1;for(;++c<a.length;)b[c]=d(a[c]);return e(function(...a){let c=-1;for(;++c<b.length;)if(b[c].apply(this,a))return!0;return!1})}(a):(b=a,e(function(a){let c;for(c in b)if(a[c]!==b[c])return!1;return!0}))}if("string"==typeof a){return c=a,e(function(a){return a&&a.type===c})}throw Error("Expected function, string, or object as test")};function e(a){return function(b,c,d){return!!(function(a){return null!==a&&"object"==typeof a&&"type"in a}(b)&&a.call(this,b,"number"==typeof c?c:void 0,d||void 0))}}function f(){return!0}},350481:a=>{"use strict";var b=Object.prototype.hasOwnProperty,c="~";function d(){}function e(a,b,c){this.fn=a,this.context=b,this.once=c||!1}function f(a,b,d,f,g){if("function"!=typeof d)throw TypeError("The listener must be a function");var h=new e(d,f||a,g),i=c?c+b:b;return a._events[i]?a._events[i].fn?a._events[i]=[a._events[i],h]:a._events[i].push(h):(a._events[i]=h,a._eventsCount++),a}function g(a,b){0==--a._eventsCount?a._events=new d:delete a._events[b]}function h(){this._events=new d,this._eventsCount=0}Object.create&&(d.prototype=Object.create(null),new d().__proto__||(c=!1)),h.prototype.eventNames=function(){var a,d,e=[];if(0===this._eventsCount)return e;for(d in a=this._events)b.call(a,d)&&e.push(c?d.slice(1):d);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(a)):e},h.prototype.listeners=function(a){var b=c?c+a:a,d=this._events[b];if(!d)return[];if(d.fn)return[d.fn];for(var e=0,f=d.length,g=Array(f);e<f;e++)g[e]=d[e].fn;return g},h.prototype.listenerCount=function(a){var b=c?c+a:a,d=this._events[b];return d?d.fn?1:d.length:0},h.prototype.emit=function(a,b,d,e,f,g){var h=c?c+a:a;if(!this._events[h])return!1;var i,j,k=this._events[h],l=arguments.length;if(k.fn){switch(k.once&&this.removeListener(a,k.fn,void 0,!0),l){case 1:return k.fn.call(k.context),!0;case 2:return k.fn.call(k.context,b),!0;case 3:return k.fn.call(k.context,b,d),!0;case 4:return k.fn.call(k.context,b,d,e),!0;case 5:return k.fn.call(k.context,b,d,e,f),!0;case 6:return k.fn.call(k.context,b,d,e,f,g),!0}for(j=1,i=Array(l-1);j<l;j++)i[j-1]=arguments[j];k.fn.apply(k.context,i)}else{var m,n=k.length;for(j=0;j<n;j++)switch(k[j].once&&this.removeListener(a,k[j].fn,void 0,!0),l){case 1:k[j].fn.call(k[j].context);break;case 2:k[j].fn.call(k[j].context,b);break;case 3:k[j].fn.call(k[j].context,b,d);break;case 4:k[j].fn.call(k[j].context,b,d,e);break;default:if(!i)for(m=1,i=Array(l-1);m<l;m++)i[m-1]=arguments[m];k[j].fn.apply(k[j].context,i)}}return!0},h.prototype.on=function(a,b,c){return f(this,a,b,c,!1)},h.prototype.once=function(a,b,c){return f(this,a,b,c,!0)},h.prototype.removeListener=function(a,b,d,e){var f=c?c+a:a;if(!this._events[f])return this;if(!b)return g(this,f),this;var h=this._events[f];if(h.fn)h.fn!==b||e&&!h.once||d&&h.context!==d||g(this,f);else{for(var i=0,j=[],k=h.length;i<k;i++)(h[i].fn!==b||e&&!h[i].once||d&&h[i].context!==d)&&j.push(h[i]);j.length?this._events[f]=1===j.length?j[0]:j:g(this,f)}return this},h.prototype.removeAllListeners=function(a){var b;return a?(b=c?c+a:a,this._events[b]&&g(this,b)):(this._events=new d,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=c,h.EventEmitter=h,a.exports=h},350679:(a,b,c)=>{"use strict";c.d(b,{$T:()=>u,DM:()=>e,HA:()=>l,Iv:()=>s,NX:()=>n,Oh:()=>m,UV:()=>r,V2:()=>j,WV:()=>v,bd:()=>d,lZ:()=>o,mB:()=>t,ox:()=>k});let d={contentTabs:[],chatTabs:[],activeContentId:null,activeChatId:null};function e(a,b,c){switch(a){case"crm-person":return`crm-person:${c?.entryId??b}`;case"crm-company":return`crm-company:${c?.entryId??b}`;case"browse":return`browse:${c?.browsePath??b}`;default:return b}}function f(a){let b=a.id??e(a.kind,a.path,a.meta),c=a.preview??!0,d=a.pinned??!1;return{id:b,kind:a.kind,path:a.path,title:a.title,icon:a.icon,meta:a.meta,preview:!d&&c,pinned:d}}function g(a,b){return"draft"===a?`draft:${b.draftId??h()}`:("subagent"===a||"gateway"===a)&&b.sessionKey?b.sessionKey:b.sessionId?b.sessionId:`draft:${h()}`}function h(){return Math.random().toString(36).slice(2,10)}function i(a){let b=a.id??g(a.variant,{sessionId:a.sessionId,sessionKey:a.sessionKey}),c=a.preview??!0,d=a.pinned??!1;return{id:b,variant:a.variant,title:a.title,preview:!d&&c,pinned:d,sessionId:a.sessionId,sessionKey:a.sessionKey,parentSessionId:a.parentSessionId,channel:a.channel}}function j(a="New Chat"){return i({id:g("draft",{draftId:h()}),variant:"draft",title:a,preview:!0})}function k(a){return i({id:a.sessionId,variant:"session",title:a.title||"New Chat",sessionId:a.sessionId})}function l(a){return i({id:a.sessionKey,variant:"subagent",title:a.title||"Subagent",sessionKey:a.sessionKey,parentSessionId:a.parentSessionId})}function m(a){return i({id:a.sessionKey,variant:"gateway",title:a.title||"Channel Chat",sessionId:a.sessionId,sessionKey:a.sessionKey,channel:a.channel})}function n(a,b){return b||("~cron"===a?"Cron":a.startsWith("~cron/")?a.slice(6)||"Cron Job":"~skills"===a?"Skills":"~integrations"===a?"Integrations":"~cloud"===a?"Cloud":"~crm/inbox"===a?"Inbox":"~crm/calendar"===a?"Calendar":a.split("/").pop()||a)}function o(a){return a.activeContentId?a.contentTabs.find(b=>b.id===a.activeContentId)??null:null}function p(a,b){let c=f(b),d=a.contentTabs.findIndex(a=>a.id===c.id);if(-1!==d){let b=a.contentTabs;return(!c.preview&&a.contentTabs[d].preview&&((b=[...a.contentTabs])[d]={...b[d],preview:!1}),b===a.contentTabs&&a.activeContentId===c.id)?a:{...a,contentTabs:b,activeContentId:c.id}}if(c.preview){let b=function(a,b){if(b){let c=a.findIndex(a=>a.id===b&&a.preview);if(-1!==c)return c}return a.findIndex(a=>a.preview)}(a.contentTabs,a.activeContentId);if(-1!==b){let d=[...a.contentTabs];return d[b]=c,{...a,contentTabs:d,activeContentId:c.id}}}return{...a,contentTabs:[...a.contentTabs,c],activeContentId:c.id}}function q(a,b){let c=!1,d=a.contentTabs.map(a=>a.id===b&&a.preview?(c=!0,{...a,preview:!1}):a);return c?{...a,contentTabs:d}:a}function r(a){if(a.chatTabs.length>0)return a.activeChatId&&a.chatTabs.some(b=>b.id===a.activeChatId)?a:{...a,activeChatId:a.chatTabs[0].id};let b=j();return{...a,chatTabs:[b],activeChatId:b.id}}function s(a,b){let c=o(a),d={};if(c){if(d.path=c.path,b.entryModal&&(d.entry=b.entryModal),"cron-dashboard"===c.kind?("overview"!==b.cron.view&&(d.cronView=b.cron.view),"calendar"===b.cron.view&&"month"!==b.cron.calMode&&(d.cronCalMode=b.cron.calMode),("calendar"===b.cron.view||"timeline"===b.cron.view)&&b.cron.date&&(d.cronDate=b.cron.date)):"cron-job"===c.kind&&("all"!==b.cron.runFilter&&(d.cronRunFilter=b.cron.runFilter),null!=b.cron.run&&(d.cronRun=b.cron.run)),b.objectViewParams){let a=b.objectViewParams;a.viewType&&(d.viewType=a.viewType),a.view&&(d.view=a.view),a.filters&&(d.filters=a.filters),a.search&&(d.search=a.search),a.sort&&(d.sort=a.sort),null!=a.page&&(d.page=a.page),null!=a.pageSize&&(d.pageSize=a.pageSize),a.cols&&(d.cols=a.cols)}}else b.chatSessionId&&(d.chat=b.chatSessionId,b.chatSubagentKey&&(d.subagent=b.chatSubagentKey));return b.browseDir&&(d.browse=b.browseDir),b.showHidden&&(d.hidden=!0),b.terminalOpen&&(d.terminal=!0),d}function t(a){return d}function u(a,b){}function v(a,b){switch(b.type){case"openContent":return p(a,b.tab);case"closeContent":return function(a,b){let c=a.contentTabs.findIndex(a=>a.id===b);if(-1===c||a.contentTabs[c].pinned)return a;let d=a.contentTabs.filter(a=>a.id!==b),e=a.activeContentId;return e===b&&(e=0===d.length?null:c<d.length?d[c].id:d[d.length-1].id),{...a,contentTabs:d,activeContentId:e}}(a,b.id);case"closeOtherContent":var c,d,g=b.id;let h=a.contentTabs.filter(a=>a.id===g||a.pinned);return{...a,contentTabs:h,activeContentId:g};case"closeContentToRight":return function(a,b){let c=a.contentTabs.findIndex(a=>a.id===b);if(-1===c)return a;let d=a.contentTabs.filter((a,b)=>b<=c||a.pinned),e=d.some(b=>b.id===a.activeContentId);return{...a,contentTabs:d,activeContentId:e?a.activeContentId:b}}(a,b.id);case"closeAllContent":let j=a.contentTabs.filter(a=>a.pinned),k=j.some(b=>b.id===a.activeContentId);return{...a,contentTabs:j,activeContentId:k?a.activeContentId:null};case"activateContent":return c=b.id,null===c||a.contentTabs.some(a=>a.id===c)?a.activeContentId===c?a:{...a,activeContentId:c}:{...a,activeContentId:null};case"promoteContent":return q(a,b.id);case"promoteContentByPath":var l=b.path;let m=a.contentTabs.find(a=>a.path===l);return m?q(a,m.id):a;case"togglePinContent":var o=b.id;let s=!1,t=a.contentTabs.map(a=>{if(a.id!==o)return a;s=!0;let b=!a.pinned;return{...a,pinned:b,preview:!b&&a.preview}});return s?{...a,contentTabs:t}:a;case"reorderContent":return function(a,b,c){let d=a.contentTabs.findIndex(a=>a.id===b);if(-1===d||d===c)return a;let e=Math.max(0,Math.min(a.contentTabs.length-1,c)),f=[...a.contentTabs],[g]=f.splice(d,1);return f.splice(e,0,g),{...a,contentTabs:f}}(a,b.id,b.toIndex);case"renameContent":return function(a,b,c){let d=!1,e=a.contentTabs.map(a=>a.id!==b||a.title===c?a:(d=!0,{...a,title:c}));return d?{...a,contentTabs:e}:a}(a,b.id,b.title);case"openChat":return function(a,b){let c=i(b),d=a.chatTabs.findIndex(a=>a.id===c.id);if(-1===d&&"session"===c.variant&&c.sessionId&&(d=a.chatTabs.findIndex(a=>"session"===a.variant&&a.sessionId===c.sessionId)),-1!==d){let b=a.chatTabs[d],e=a.chatTabs;return(!c.preview&&b.preview&&((e=[...a.chatTabs])[d]={...e[d],preview:!1}),e===a.chatTabs&&a.activeChatId===b.id)?a:{...a,chatTabs:e,activeChatId:b.id}}return{...a,chatTabs:[...a.chatTabs,c],activeChatId:c.id}}(a,b.tab);case"closeChat":return function(a,b){let c=a.chatTabs.findIndex(a=>a.id===b);if(-1===c||a.chatTabs[c].pinned)return a;let d=a.chatTabs.filter(a=>a.id!==b),e=a.activeChatId;return e===b&&(e=0===d.length?null:c<d.length?d[c].id:d[d.length-1].id),r({...a,chatTabs:d,activeChatId:e})}(a,b.id);case"closeChatsForSession":var u=b.sessionId;let v=a.chatTabs.filter(a=>!!a.pinned||a.sessionId!==u&&a.parentSessionId!==u);if(v.length===a.chatTabs.length)return a;let w=v.some(b=>b.id===a.activeChatId)?a.activeChatId:v[v.length-1]?.id??null;return r({...a,chatTabs:v,activeChatId:w});case"activateChat":return d=b.id,null===d||a.chatTabs.some(a=>a.id===d)?a.activeChatId===d?a:{...a,activeChatId:d}:{...a,activeChatId:null};case"promoteChat":var x=b.id;let y=!1,z=a.chatTabs.map(a=>a.id===x&&a.preview?(y=!0,{...a,preview:!1}):a);return y?{...a,chatTabs:z}:a;case"togglePinChat":var A=b.id;let B=!1,C=a.chatTabs.map(a=>{if(a.id!==A)return a;B=!0;let b=!a.pinned;return{...a,pinned:b,preview:!b&&a.preview}});return B?{...a,chatTabs:C}:a;case"renameChat":return function(a,b,c){let d=!1,e=a.chatTabs.map(a=>a.id!==b||a.title===c?a:(d=!0,{...a,title:c}));return d?{...a,chatTabs:e}:a}(a,b.id,b.title);case"bindChatSession":return function(a,b,c){let d=a.chatTabs.find(a=>a.id===b);if(!d)return a;if(c){let e=a.chatTabs.find(a=>a.id!==b&&"session"===a.variant&&a.sessionId===c);if(e){let c=d.pinned?a.chatTabs:a.chatTabs.filter(a=>a.id!==b);return r({...a,chatTabs:c,activeChatId:e.id})}}let e=c??void 0;if(d.sessionId===e&&(null==c||"session"===d.variant))return a;let f={...d,sessionId:e,variant:c?"session":"draft",id:d.id},g=a.chatTabs.map(a=>a.id===b?f:a),h=a.activeChatId===b?f.id:a.activeChatId;return{...a,chatTabs:g,activeChatId:h}}(a,b.tabId,b.sessionId);case"syncChatTitles":return function(a,b,c){let d=new Map(b.map(a=>[a.id,a.title])),e=new Map(c.map(a=>[a.childSessionKey,a.label||a.task])),f=!1,g=a.chatTabs.map(a=>{if("session"===a.variant&&a.sessionId){let b=d.get(a.sessionId);if(b&&b!==a.title)return f=!0,{...a,title:b}}if("subagent"===a.variant&&a.sessionKey){let b=e.get(a.sessionKey);if(b&&b!==a.title)return f=!0,{...a,title:b}}return a});return f?{...a,chatTabs:g}:a}(a,b.sessions,b.subagents);case"ensureChatPresent":return r(a);case"applyUrl":return function(a,b,c){let d=a;if(b.entry){let a="people"===b.entry.objectName,c="company"===b.entry.objectName||"companies"===b.entry.objectName;if(a||c){let c=a?"crm-person":"crm-company",f=a?"people":"companies";return p(d,{id:e(c,f,{entryId:b.entry.entryId}),kind:c,path:f,title:a?"Person":"Company",meta:{entryId:b.entry.entryId},preview:!0})}}let g=function(a,b){if(!a.path)return"people"===a.crm?f({kind:"object",path:"people",title:"People",preview:!1}):"companies"===a.crm?f({kind:"object",path:"companies",title:"Companies",preview:!1}):"inbox"===a.crm?f({kind:"crm-inbox",path:"~crm/inbox",title:"Inbox",preview:!1}):"calendar"===a.crm?f({kind:"crm-calendar",path:"~crm/calendar",title:"Calendar",preview:!1}):null;let c=a.path;return f({kind:b.resolveKind?.(c)??("~cron"===c?"cron-dashboard":c.startsWith("~cron/")?"cron-job":"~skills"===c?"skills":"~integrations"===c?"integrations":"~cloud"===c?"cloud":"~crm/inbox"===c?"crm-inbox":"~crm/calendar"===c?"crm-calendar":"file"),path:c,title:n(c),preview:!0})}(b,c);return g?d=p(d,g):b.chat||(d={...d,activeContentId:null}),d}(a,b.url,b.shell);case"replace":return b.state}}},353136:a=>{class b{}function c(a){let b="",c=a.length-1;for(;c>=0;)b+=a.charAt(c--);return b}function d(a,b){let c="";for(;c.length<b;)c+=a;return c}function e(a,b){let c=""+a;return c.length>=b?c:d("0",b-c.length)+c}function f(a,b){let c=""+a;return c.length>=b?c:d(" ",b-c.length)+c}function g(a,b){let c=""+a;return c.length>=b?c:c+d(" ",b-c.length)}function h(a,b){let c;if(a>0x100000000||a<-0x100000000){let c;return(c=""+Math.round(a)).length>=b?c:d("0",b-c.length)+c}return(c=""+Math.round(a)).length>=b?c:d("0",b-c.length)+c}function i(a,b){return b=b||0,a.length>=7+b&&(32|a.charCodeAt(b))==103&&(32|a.charCodeAt(b+1))==101&&(32|a.charCodeAt(b+2))==110&&(32|a.charCodeAt(b+3))==101&&(32|a.charCodeAt(b+4))==114&&(32|a.charCodeAt(b+5))==97&&(32|a.charCodeAt(b+6))==108}b.version="0.10.3";let j=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],k=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function l(a){a[0]="General",a[1]="0",a[2]="0.00",a[3]="#,##0",a[4]="#,##0.00",a[9]="0%",a[10]="0.00%",a[11]="0.00E+00",a[12]="# ?/?",a[13]="# ??/??",a[14]="m/d/yy",a[15]="d-mmm-yy",a[16]="d-mmm",a[17]="mmm-yy",a[18]="h:mm AM/PM",a[19]="h:mm:ss AM/PM",a[20]="h:mm",a[21]="h:mm:ss",a[22]="m/d/yy h:mm",a[37]="#,##0 ;(#,##0)",a[38]="#,##0 ;[Red](#,##0)",a[39]="#,##0.00;(#,##0.00)",a[40]="#,##0.00;[Red](#,##0.00)",a[45]="mm:ss",a[46]="[h]:mm:ss",a[47]="mmss.0",a[48]="##0.0E+0",a[49]="@",a[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',a[65535]="General"}let m={};function n(a,b,c){let d=a<0?-1:1,e=a*d,f=0,g=1,h=0,i=1,j=0,k=0,l=Math.floor(e);for(;j<b&&(h=(l=Math.floor(e))*g+f,k=l*j+i,!(e-l<5e-8));)e=1/(e-l),f=g,g=h,i=j,j=k;if(k>b&&(j>b?(k=i,h=f):(k=j,h=g)),!c)return[0,d*h,k];let m=Math.floor(d*h/k);return[m,d*h-m*k,k]}function o(a,b,c){if(a>2958465||a<0)return null;let d=0|a,e=Math.floor(86400*(a-d)),f=0,g=[],h={D:d,T:e,u:86400*(a-d)-e,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(1e-6>Math.abs(h.u)&&(h.u=0),b&&b.date1904&&(d+=1462),h.u>.9999&&(h.u=0,86400==++e&&(h.T=e=0,++d,++h.D)),60===d)g=c?[1317,10,29]:[1900,2,29],f=3;else if(0===d)g=c?[1317,8,29]:[1900,1,0],f=6;else{d>60&&--d;let a=new Date(1900,0,1);a.setDate(a.getDate()+d-1),g=[a.getFullYear(),a.getMonth()+1,a.getDate()],f=a.getDay(),d<60&&(f=(f+6)%7),c&&(f=0)}return h.y=g[0],h.m=g[1],h.d=g[2],h.S=e%60,h.M=(e=Math.floor(e/60))%60,h.H=e=Math.floor(e/60),h.q=f,h}l(m),b.parse_date_code=o;let p=new Date(1899,11,31,0,0,0),q=p.getTime(),r=new Date(1900,2,1,0,0,0);function s(a,b){let c=a.getTime();return b?c-=1262304e5:a>=r&&(c+=864e5),(c-(q+(a.getTimezoneOffset()-p.getTimezoneOffset())*6e4))/864e5}function t(a){return a.toString(10)}b._general_int=t;let u=function(){let a=/\.(\d*[1-9])0+$/,b=/\.0*$/,c=/\.(\d*[1-9])0+/,d=/\.0*[Ee]/,e=/(E[+-])(\d)$/;function f(c){return c.indexOf(".")>-1?c.replace(b,"").replace(a,".$1"):c}return function(b){let g=Math.floor(Math.log(Math.abs(b))*Math.LOG10E),h;if(g>=-4&&g<=-1)h=b.toPrecision(10+g);else if(9>=Math.abs(g))h=function(a){let b=a<0?12:11,c=f(a.toFixed(12));return c.length<=b||(c=a.toPrecision(10)).length<=b?c:a.toExponential(5)}(b);else if(10===g)h=b.toFixed(10).substr(0,12);else{let c;(c=b.toFixed(11).replace(a,".$1")).length>(b<0?12:11)&&(c=b.toPrecision(6)),h=c}return f(function(a){for(let b=0;b!==a.length;++b)if((32|a.charCodeAt(b))==101)return a.replace(c,".$1").replace(d,"E").replace("e","E").replace(e,"$10$2");return a}(h))}}();function v(a,b){switch(typeof a){case"string":return a;case"boolean":return a?"TRUE":"FALSE";case"number":return(0|a)===a?t(a):u(a);case"undefined":return"";case"object":if(null==a)return"";if(a instanceof Date)return F(14,s(a,b&&b.date1904),b)}throw Error("unsupported value in General format: "+a)}function w(a){if(a.length<=3)return a;let b=a.length%3,c=a.substr(0,b);for(;b!==a.length;b+=3)c+=(c.length>0?",":"")+a.substr(b,3);return c}b._general_num=u,b._general=v;let x=function(){let a=/%/g,b=/# (\?+)( ?)\/( ?)(\d+)/,i=/^#*0*\.([0#]+)/,j=/\).*[0#]/,k=/\(###\) ###\\?-####/;function l(a){let b="",c;for(let d=0;d!==a.length;++d)switch(c=a.charCodeAt(d)){case 35:break;case 63:b+=" ";break;case 48:b+="0";break;default:b+=String.fromCharCode(c)}return b}function m(a,b){let c=Math.pow(10,b);return""+Math.round(a*c)/c}function o(a,b){return b<(""+Math.round((a-Math.floor(a))*Math.pow(10,b))).length?0:Math.round((a-Math.floor(a))*Math.pow(10,b))}return function(p,q,r){return(0|r)===r?function h(m,o,p){let q;if(40===m.charCodeAt(0)&&!o.match(j)){let a=o.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return p>=0?h("n",a,p):"("+h("n",a,-p)+")"}if(44===o.charCodeAt(o.length-1)){var r,s=o;let a=s.length-1;for(;44===s.charCodeAt(a-1);)--a;return x(m,s.substr(0,a),p/Math.pow(10,3*(s.length-a)))}if(-1!==o.indexOf("%")){var t=o;let b=t.replace(a,""),c=t.length-b.length;return x(m,b,p*Math.pow(10,2*c))+d("%",c)}if(-1!==o.indexOf("E"))return function a(b,c){let d,e=b.indexOf("E")-b.indexOf(".")-1;if(b.match(/^#+0.0E\+0$/)){if(0===c)return"0.0E+0";if(c<0)return"-"+a(b,-c);let f=b.indexOf(".");-1===f&&(f=b.indexOf("E"));let g=Math.floor(Math.log(c)*Math.LOG10E)%f;if(g<0&&(g+=f),!(d=(c/Math.pow(10,g)).toPrecision(e+1+(f+g)%f)).match(/[Ee]/)){let a=Math.floor(Math.log(c)*Math.LOG10E);-1===d.indexOf(".")?d=d.charAt(0)+"."+d.substr(1)+"E+"+(a-d.length+g):d+="E+"+(a-g),d=d.replace(/\+-/,"-")}d=d.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(a,b,c,d){return b+c+d.substr(0,(f+g)%f)+"."+d.substr(g)+"E"})}else d=c.toExponential(e);return b.match(/E\+00$/)&&d.match(/e[+-]\d$/)&&(d=d.substr(0,d.length-1)+"0"+d.charAt(d.length-1)),b.match(/E\-/)&&d.match(/e\+/)&&(d=d.replace(/e\+/,"e")),d.replace("e","E")}(o,p);if(36===o.charCodeAt(0))return"$"+h(m,o.substr(" "==o.charAt(1)?2:1),p);let u,v,y,z=Math.abs(p),A=p<0?"-":"";if(o.match(/^00+$/))return A+e(z,o.length);if(o.match(/^[#?]+$/))return q=""+p,0===p&&(q=""),q.length>o.length?q:l(o.substr(0,o.length-q.length))+q;if(u=o.match(b))return A+(0===z?"":""+z)+d(" ",(r=u)[1].length+2+r[4].length);if(o.match(/^#+0+$/))return A+e(z,o.length-o.indexOf("0"));if(u=o.match(i))return q=(q=(""+p).replace(/^([^\.]+)$/,"$1."+l(u[1])).replace(/\.$/,"."+l(u[1]))).replace(/\.(\d*)$/,function(a,b){return"."+b+d("0",l(u[1]).length-b.length)}),-1!==o.indexOf("0.")?q:q.replace(/^0\./,".");if(u=(o=o.replace(/^#+([0.])/,"$1")).match(/^(0*)\.(#*)$/))return A+(""+z).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,u[1].length?"0.":".");if(u=o.match(/^#{1,3},##0(\.?)$/))return A+w(""+z);if(u=o.match(/^#,##0\.([#0]*0)$/))return p<0?"-"+h(m,o,-p):w(""+p)+"."+d("0",u[1].length);if(u=o.match(/^#,#*,#0/))return h(m,o.replace(/^#,#*,/,""),p);if(u=o.match(/^([0#]+)(\\?-([0#]+))+$/))return q=c(h(m,o.replace(/[\\-]/g,""),p)),v=0,c(c(o.replace(/\\/g,"")).replace(/[0#]/g,function(a){return v<q.length?q.charAt(v++):"0"===a?"0":""}));if(o.match(k))return"("+(q=h(m,"##########",p)).substr(0,3)+") "+q.substr(3,3)+"-"+q.substr(6);let B="";if(u=o.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return y=n(z,Math.pow(10,v=Math.min(u[4].length,7))-1,!1),q=""+A," "==(B=x("n",u[1],y[1])).charAt(B.length-1)&&(B=B.substr(0,B.length-1)+"0"),q+=B+u[2]+"/"+u[3],(B=g(y[2],v)).length<u[4].length&&(B=l(u[4].substr(u[4].length-B.length))+B),q+=B;if(u=o.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return A+((y=n(z,Math.pow(10,v=Math.min(Math.max(u[1].length,u[4].length),7))-1,!0))[0]||(y[1]?"":"0"))+" "+(y[1]?f(y[1],v)+u[2]+"/"+u[3]+g(y[2],v):d(" ",2*v+1+u[2].length+u[3].length));if(u=o.match(/^[#0?]+$/))return(q=""+p,o.length<=q.length)?q:l(o.substr(0,o.length-q.length))+q;if(u=o.match(/^([#0]+)\.([#0]+)$/)){v=(q=""+p.toFixed(Math.min(u[2].length,10)).replace(/([^0])0+$/,"$1")).indexOf(".");let a=o.indexOf(".")-v,b=o.length-q.length-a;return l(o.substr(0,a)+q+o.substr(o.length-b))}if(u=o.match(/^00,000\.([#0]*0)$/))return p<0?"-"+h(m,o,-p):w(""+p).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(a){return"00,"+(a.length<3?e(0,3-a.length):"")+a})+"."+e(0,u[1].length);switch(o){case"###,###":case"##,###":case"#,###":let C=w(""+z);return"0"!==C?A+C:"";default:if(o.match(/\.[0#?]*$/))return h(m,o.slice(0,o.lastIndexOf(".")),p)+l(o.slice(o.lastIndexOf(".")))}throw Error("unsupported format |"+o+"|")}(p,q,r):function p(q,r,s){let t;if(40===q.charCodeAt(0)&&!r.match(j)){let a=r.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return s>=0?p("n",a,s):"("+p("n",a,-s)+")"}if(44===r.charCodeAt(r.length-1)){var u,v=r;let a=v.length-1;for(;44===v.charCodeAt(a-1);)--a;return x(q,v.substr(0,a),s/Math.pow(10,3*(v.length-a)))}if(-1!==r.indexOf("%")){var y=r;let b=y.replace(a,""),c=y.length-b.length;return x(q,b,s*Math.pow(10,2*c))+d("%",c)}if(-1!==r.indexOf("E"))return function a(b,c){let d,e=b.indexOf("E")-b.indexOf(".")-1;if(b.match(/^#+0.0E\+0$/)){if(0===c)return"0.0E+0";if(c<0)return"-"+a(b,-c);let f=b.indexOf(".");-1===f&&(f=b.indexOf("E"));let g=Math.floor(Math.log(c)*Math.LOG10E)%f;if(g<0&&(g+=f),-1===(d=(c/Math.pow(10,g)).toPrecision(e+1+(f+g)%f)).indexOf("e")){let a=Math.floor(Math.log(c)*Math.LOG10E);for(-1===d.indexOf(".")?d=d.charAt(0)+"."+d.substr(1)+"E+"+(a-d.length+g):d+="E+"+(a-g);"0."===d.substr(0,2);)d=(d=d.charAt(0)+d.substr(2,f)+"."+d.substr(2+f)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");d=d.replace(/\+-/,"-")}d=d.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(a,b,c,d){return b+c+d.substr(0,(f+g)%f)+"."+d.substr(g)+"E"})}else d=c.toExponential(e);return b.match(/E\+00$/)&&d.match(/e[+-]\d$/)&&(d=d.substr(0,d.length-1)+"0"+d.charAt(d.length-1)),b.match(/E\-/)&&d.match(/e\+/)&&(d=d.replace(/e\+/,"e")),d.replace("e","E")}(r,s);if(36===r.charCodeAt(0))return"$"+p(q,r.substr(" "==r.charAt(1)?2:1),s);let z,A,B,C=Math.abs(s),D=s<0?"-":"";if(r.match(/^00+$/))return D+h(C,r.length);if(r.match(/^[#?]+$/))return"0"===(t=h(s,0))&&(t=""),t.length>r.length?t:l(r.substr(0,r.length-t.length))+t;if(z=r.match(b)){var E=z;let a=parseInt(E[4],10),b=Math.round(C*a),c=Math.floor(b/a),g=b-c*a;return D+(0===c?"":""+c)+" "+(0===g?d(" ",E[1].length+1+E[4].length):f(g,E[1].length)+E[2]+"/"+E[3]+e(a,E[4].length))}if(r.match(/^#+0+$/))return D+h(C,r.length-r.indexOf("0"));if(z=r.match(i))return t=m(s,z[1].length).replace(/^([^\.]+)$/,"$1."+l(z[1])).replace(/\.$/,"."+l(z[1])).replace(/\.(\d*)$/,function(a,b){return"."+b+d("0",l(z[1]).length-b.length)}),-1!==r.indexOf("0.")?t:t.replace(/^0\./,".");if(z=(r=r.replace(/^#+([0.])/,"$1")).match(/^(0*)\.(#*)$/))return D+m(C,z[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,z[1].length?"0.":".");if(z=r.match(/^#{1,3},##0(\.?)$/))return D+w(h(C,0));if(z=r.match(/^#,##0\.([#0]*0)$/))return s<0?"-"+p(q,r,-s):w(""+(Math.floor(s)+ +((u=z[1].length)<(""+Math.round((s-Math.floor(s))*Math.pow(10,u))).length)))+"."+e(o(s,z[1].length),z[1].length);if(z=r.match(/^#,#*,#0/))return p(q,r.replace(/^#,#*,/,""),s);if(z=r.match(/^([0#]+)(\\?-([0#]+))+$/))return t=c(p(q,r.replace(/[\\-]/g,""),s)),A=0,c(c(r.replace(/\\/g,"")).replace(/[0#]/g,function(a){return A<t.length?t.charAt(A++):"0"===a?"0":""}));if(r.match(k))return"("+(t=p(q,"##########",s)).substr(0,3)+") "+t.substr(3,3)+"-"+t.substr(6);let F="";if(z=r.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return B=n(C,Math.pow(10,A=Math.min(z[4].length,7))-1,!1),t=""+D," "===(F=x("n",z[1],B[1])).charAt(F.length-1)&&(F=F.substr(0,F.length-1)+"0"),t+=F+z[2]+"/"+z[3],(F=g(B[2],A)).length<z[4].length&&(F=l(z[4].substr(z[4].length-F.length))+F),t+=F;if(z=r.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return D+((B=n(C,Math.pow(10,A=Math.min(Math.max(z[1].length,z[4].length),7))-1,!0))[0]||(B[1]?"":"0"))+" "+(B[1]?f(B[1],A)+z[2]+"/"+z[3]+g(B[2],A):d(" ",2*A+1+z[2].length+z[3].length));if(z=r.match(/^[#0?]+$/))return(t=h(s,0),r.length<=t.length)?t:l(r.substr(0,r.length-t.length))+t;if(z=r.match(/^([#0?]+)\.([#0]+)$/)){A=(t=""+s.toFixed(Math.min(z[2].length,10)).replace(/([^0])0+$/,"$1")).indexOf(".");let a=r.indexOf(".")-A,b=r.length-t.length-a;return l(r.substr(0,a)+t+r.substr(r.length-b))}if(z=r.match(/^00,000\.([#0]*0)$/))return A=o(s,z[1].length),s<0?"-"+p(q,r,-s):w(s<0x7fffffff&&s>-0x80000000?""+(s>=0?0|s:s-1|0):""+Math.floor(s)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(a){return"00,"+(a.length<3?e(0,3-a.length):"")+a})+"."+e(A,z[1].length);switch(r){case"###,##0.00":return p(q,"#,##0.00",s);case"###,###":case"##,###":case"#,###":let G=w(h(C,0));return"0"!==G?D+G:"";case"###,###.00":return p(q,"###,##0.00",s).replace(/^0\./,".");case"#,###.00":return p(q,"#,##0.00",s).replace(/^0\./,".")}throw Error("unsupported format |"+r+"|")}(p,q,r)}}();function y(a){let b=[],c=!1,d=0;for(let e=0;e<a.length;++e)switch(a.charCodeAt(e)){case 34:c=!c;break;case 95:case 42:case 92:++e;break;case 59:b[b.length]=a.substr(d,e-d),d=e+1}if(b[b.length]=a.substr(d),!0===c)throw Error("Format |"+a+"| unterminated string ");return b}b._split=y;let z=/\[[HhMmSs]*\]/;function A(a){let b=0,c="",d="";for(;b<a.length;)switch(c=a.charAt(b)){case"G":i(a,b)&&(b+=6),b++;break;case'"':for(;34!==a.charCodeAt(++b)&&b<a.length;)++b;++b;break;case"\\":case"_":b+=2;break;case"@":++b;break;case"B":case"b":if("1"===a.charAt(b+1)||"2"===a.charAt(b+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":if("A/P"===a.substr(b,3).toUpperCase()||"AM/PM"===a.substr(b,5).toUpperCase())return!0;++b;break;case"[":for(d=c;"]"!==a.charAt(b++)&&b<a.length;)d+=a.charAt(b);if(d.match(z))return!0;break;case".":case"0":case"#":for(;b<a.length&&("0#?.,E+-%".indexOf(c=a.charAt(++b))>-1||"\\"==c&&"-"==a.charAt(b+1)&&"0#".indexOf(a.charAt(b+2))>-1););break;case"?":for(;a.charAt(++b)===c;);break;case"*":++b,(" "===a.charAt(b)||"*"===a.charAt(b))&&++b;break;case"(":case")":case" ":default:++b;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;b<a.length&&"0123456789".indexOf(a.charAt(++b))>-1;);}return!1}function B(a,b,c,d){let f=[],g="",h=0,l="",m="t",n,p,q,r="H";for(;h<a.length;)switch(l=a.charAt(h)){case"G":if(!i(a,h))throw Error("unrecognized character "+l+" in "+a);f[f.length]={t:"G",v:"General"},h+=7;break;case'"':for(g="";34!==(q=a.charCodeAt(++h))&&h<a.length;)g+=String.fromCharCode(q);f[f.length]={t:"t",v:g},++h;break;case"\\":let e=a.charAt(++h),j="("===e||")"===e?e:"t";f[f.length]={t:j,v:e},++h;break;case"_":f[f.length]={t:"t",v:" "},h+=2;break;case"@":f[f.length]={t:"T",v:b},++h;break;case"B":case"b":if("1"===a.charAt(h+1)||"2"===a.charAt(h+1)){if(null==n&&null==(n=o(b,c,"2"===a.charAt(h+1))))return"";f[f.length]={t:"X",v:a.substr(h,2)},m=l,h+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":l=l.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(b<0||null==n&&null==(n=o(b,c)))return"";for(g=l;++h<a.length&&a.charAt(h).toLowerCase()===l;)g+=l;"m"===l&&"h"===m.toLowerCase()&&(l="M"),"h"===l&&(l=r),f[f.length]={t:l,v:g},m=l;break;case"A":case"a":let k={t:l,v:l};if(null==n&&(n=o(b,c)),"A/P"===a.substr(h,3).toUpperCase()?(null!=n&&(k.v=n.H>=12?"P":"A"),k.t="T",r="h",h+=3):"AM/PM"===a.substr(h,5).toUpperCase()?(null!=n&&(k.v=n.H>=12?"PM":"AM"),k.t="T",h+=5,r="h"):(k.t="t",++h),null==n&&"T"===k.t)return"";f[f.length]=k,m=l;break;case"[":for(g=l;"]"!==a.charAt(h++)&&h<a.length;)g+=a.charAt(h);if("]"!==g.slice(-1))throw'unterminated "[" block: |'+g+"|";if(g.match(z)){if(null==n&&null==(n=o(b,c)))return"";f[f.length]={t:"Z",v:g.toLowerCase()},m=g.charAt(1)}else g.indexOf("$")>-1&&(g=(g.match(/\$([^-\[\]]*)/)||[])[1]||"$",A(a)||(f[f.length]={t:"t",v:g}));break;case".":if(null!=n){for(g=l;++h<a.length&&"0"===(l=a.charAt(h));)g+=l;f[f.length]={t:"s",v:g};break}case"0":case"#":for(g=l;++h<a.length&&"0#?.,E+-%".indexOf(l=a.charAt(h))>-1||"\\"==l&&"-"==a.charAt(h+1)&&h<a.length-2&&"0#".indexOf(a.charAt(h+2))>-1;)g+=l;f[f.length]={t:"n",v:g};break;case"?":for(g=l;a.charAt(++h)===l;)g+=l;f[f.length]={t:l,v:g},m=l;break;case"*":++h,(" "===a.charAt(h)||"*"===a.charAt(h))&&++h;break;case"(":case")":f[f.length]={t:1===d||"number"==typeof b&&b<0?"t":l,v:l},++h;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(g=l;h<a.length&&"0123456789".indexOf(a.charAt(++h))>-1;)g+=a.charAt(h);f[f.length]={t:"D",v:g};break;case" ":f[f.length]={t:l,v:l},++h;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(l))throw Error("unrecognized character "+l+" in "+a);f[f.length]={t:"t",v:l},++h}let s=0,t=0,u;for(h=f.length-1,m="t";h>=0;--h)switch(f[h].t){case"h":case"H":f[h].t=r,m="h",s<1&&(s=1);break;case"s":(u=f[h].v.match(/\.0+$/))&&(t=Math.max(t,u[0].length-1)),s<3&&(s=3);case"d":case"y":case"M":case"e":m=f[h].t;break;case"m":"s"===m&&(f[h].t="M",s<2&&(s=2));break;case"X":break;case"Z":s<1&&f[h].v.match(/[Hh]/)&&(s=1),s<2&&f[h].v.match(/[Mm]/)&&(s=2),s<3&&f[h].v.match(/[Ss]/)&&(s=3)}switch(s){case 0:break;case 1:n.u>=.5&&(n.u=0,++n.S),n.S>=60&&(n.S=0,++n.M),n.M>=60&&(n.M=0,++n.H);break;case 2:n.u>=.5&&(n.u=0,++n.S),n.S>=60&&(n.S=0,++n.M)}let w="",y;for(h=0;h<f.length;++h)switch(f[h].t){case"t":case"T":case" ":case"D":break;case"X":f[h].v="",f[h].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":f[h].v=function(a,b,c,d){let f="",g=0,h=0,i=c.y,l,m=0;switch(a){case 98:i=c.y+543;case 121:switch(b.length){case 1:case 2:l=i%100,m=2;break;default:l=i%1e4,m=4}break;case 109:switch(b.length){case 1:case 2:l=c.m,m=b.length;break;case 3:return k[c.m-1][1];case 5:return k[c.m-1][0];default:return k[c.m-1][2]}break;case 100:switch(b.length){case 1:case 2:l=c.d,m=b.length;break;case 3:return j[c.q][0];default:return j[c.q][1]}break;case 104:switch(b.length){case 1:case 2:l=1+(c.H+11)%12,m=b.length;break;default:throw"bad hour format: "+b}break;case 72:switch(b.length){case 1:case 2:l=c.H,m=b.length;break;default:throw"bad hour format: "+b}break;case 77:switch(b.length){case 1:case 2:l=c.M,m=b.length;break;default:throw"bad minute format: "+b}break;case 115:if("s"!==b&&"ss"!==b&&".0"!==b&&".00"!==b&&".000"!==b)throw"bad second format: "+b;if(0===c.u&&("s"===b||"ss"===b))return e(c.S,b.length);if((g=Math.round((h=d>=2?3===d?1e3:100:1===d?10:1)*(c.S+c.u)))>=60*h&&(g=0),"s"===b)return 0===g?"0":""+g/h;if(f=e(g,2+d),"ss"===b)return f.substr(0,2);return"."+f.substr(2,b.length-1);case 90:switch(b){case"[h]":case"[hh]":l=24*c.D+c.H;break;case"[m]":case"[mm]":l=(24*c.D+c.H)*60+c.M;break;case"[s]":case"[ss]":l=((24*c.D+c.H)*60+c.M)*60+Math.round(c.S+c.u);break;default:throw"bad abstime format: "+b}m=3===b.length?1:2;break;case 101:l=i,m=1}return m>0?e(l,m):""}(f[h].t.charCodeAt(0),f[h].v,n,t),f[h].t="t";break;case"n":case"(":case"?":for(y=h+1;null!=f[y]&&("?"===(l=f[y].t)||"D"===l||(" "===l||"t"===l)&&null!=f[y+1]&&("?"===f[y+1].t||"t"===f[y+1].t&&"/"===f[y+1].v)||"("===f[h].t&&(" "===l||"n"===l||")"===l)||"t"===l&&("/"===f[y].v||" "===f[y].v&&null!=f[y+1]&&"?"===f[y+1].t));)f[h].v+=f[y].v,f[y]={v:"",t:";"},++y;w+=f[h].v,h=y-1;break;case"G":f[h].t="t",f[h].v=v(b,c)}let B="",C,D;if(w.length>0){40===w.charCodeAt(0)?(C=b<0&&45===w.charCodeAt(0)?-b:b,D=x("(",w,C)):(D=x("n",w,C=b<0&&d>1?-b:b),C<0&&f[0]&&"t"===f[0].t&&(D=D.substr(1),f[0].v="-"+f[0].v)),y=D.length-1;let a=f.length;for(h=0;h<f.length;++h)if(null!=f[h]&&"t"!==f[h].t&&f[h].v.indexOf(".")>-1){a=h;break}let c=f.length;if(a===f.length&&-1===D.indexOf("E")){for(h=f.length-1;h>=0;--h)null!=f[h]&&-1!=="n?(".indexOf(f[h].t)&&(y>=f[h].v.length-1?(y-=f[h].v.length,f[h].v=D.substr(y+1,f[h].v.length)):y<0?f[h].v="":(f[h].v=D.substr(0,y+1),y=-1),f[h].t="t",c=h);y>=0&&c<f.length&&(f[c].v=D.substr(0,y+1)+f[c].v)}else if(a!==f.length&&-1===D.indexOf("E")){for(y=D.indexOf(".")-1,h=a;h>=0;--h)if(null!=f[h]&&-1!=="n?(".indexOf(f[h].t)){for(p=f[h].v.indexOf(".")>-1&&h===a?f[h].v.indexOf(".")-1:f[h].v.length-1,B=f[h].v.substr(p+1);p>=0;--p)y>=0&&("0"===f[h].v.charAt(p)||"#"===f[h].v.charAt(p))&&(B=D.charAt(y--)+B);f[h].v=B,f[h].t="t",c=h}for(y>=0&&c<f.length&&(f[c].v=D.substr(0,y+1)+f[c].v),y=D.indexOf(".")+1,h=a;h<f.length;++h)if(null!=f[h]&&(-1!=="n?(".indexOf(f[h].t)||h===a)){for(p=f[h].v.indexOf(".")>-1&&h===a?f[h].v.indexOf(".")+1:0,B=f[h].v.substr(0,p);p<f[h].v.length;++p)y<D.length&&(B+=D.charAt(y++));f[h].v=B,f[h].t="t",c=h}}}for(h=0;h<f.length;++h)null!=f[h]&&"n(?".indexOf(f[h].t)>-1&&(C=d>1&&b<0&&h>0&&"-"===f[h-1].v?-b:b,f[h].v=x(f[h].t,f[h].v,C),f[h].t="t");let E="";for(h=0;h!==f.length;++h)null!=f[h]&&(E+=f[h].v);return E}b.is_date=A,b._eval=B;let C=/\[[=<>]/,D=/\[([=<>]*)(-?\d+\.?\d*)\]/;function E(a,b){if(null==b)return!1;let c=parseFloat(b[2]);switch(b[1]){case"=":if(a===c)return!0;break;case">":if(a>c)return!0;break;case"<":if(a<c)return!0;break;case"<>":if(a!==c)return!0;break;case">=":if(a>=c)return!0;break;case"<=":if(a<=c)return!0}return!1}function F(a,b,c){null==c&&(c={});let d="";switch(typeof a){case"string":d="m/d/yy"===a&&c.dateNF?c.dateNF:a;break;case"number":d=14===a&&c.dateNF?c.dateNF:(null!=c.table?c.table:m)[a]}if(i(d,0))return v(b,c);b instanceof Date&&(b=s(b,c.date1904));let e=function(a,b){let c=y(a),d=c.length,e=c[d-1].indexOf("@");if(d<4&&e>-1&&--d,c.length>4)throw Error("cannot find right format for |"+c.join("|")+"|");if("number"!=typeof b)return[4,4===c.length||e>-1?c[c.length-1]:"@"];switch(c.length){case 1:c=e>-1?["General","General","General",c[0]]:[c[0],c[0],c[0],"@"];break;case 2:c=e>-1?[c[0],c[0],c[0],c[1]]:[c[0],c[1],c[0],"@"];break;case 3:c=e>-1?[c[0],c[1],c[0],c[2]]:[c[0],c[1],c[2],"@"]}let f=b>0?c[0]:b<0?c[1]:c[2];if(-1===c[0].indexOf("[")&&-1===c[1].indexOf("["))return[d,f];if(null!=c[0].match(C)||null!=c[1].match(C)){let a=c[0].match(D),e=c[1].match(D);return E(b,a)?[d,c[0]]:E(b,e)?[d,c[1]]:[d,c[null!=a&&null!=e?2:1]]}return[d,f]}(d,b);if(i(e[1]))return v(b,c);if(!0===b)b="TRUE";else if(!1===b)b="FALSE";else if(""===b||null==b)return"";return B(e[1],b,c,e[0])}function G(a,b){if("number"!=typeof b){b=+b||-1;for(let c=0;c<392;++c){if(void 0===m[c]){b<0&&(b=c);continue}if(m[c]===a){b=c;break}}b<0&&(b=391)}return m[b]=a,b}b.load=G,b._table=m,b.get_table=function(){return m},b.load_table=function(a){for(let b=0;392!==b;++b)void 0!==a[b]&&G(a[b],b)},b.init_table=l,b.format=F,a.exports=b},355403:(a,b,c)=>{"use strict";c.d(b,{J:()=>e});var d=c(534487);function e(a,b,c){return(0,d.f)(a,7*b,c)}},356103:(a,b,c)=>{"use strict";c.d(b,{n4:()=>J,QO:()=>K,vR:()=>L,Or:()=>N,JU:()=>P,lb:()=>Q});var d=c(720511),e=c(381802),f=c(731626);class g{constructor(a,b){var c;this.editorView=a,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(c=b.width)?c:1,this.color=!1===b.color?void 0:b.color||"black",this.class=b.class,this.handlers=["dragover","dragend","drop","dragleave"].map(b=>{let c=a=>{this[b](a)};return a.dom.addEventListener(b,c),{name:b,handler:c}})}destroy(){this.handlers.forEach(({name:a,handler:b})=>this.editorView.dom.removeEventListener(a,b))}update(a,b){null!=this.cursorPos&&b.doc!=a.state.doc&&(this.cursorPos>a.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(a){a!=this.cursorPos&&(this.cursorPos=a,null==a?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let a,b,c=this.editorView.state.doc.resolve(this.cursorPos),d=!c.parent.inlineContent,e,f=this.editorView.dom,g=f.getBoundingClientRect(),h=g.width/f.offsetWidth,i=g.height/f.offsetHeight;if(d){let a=c.nodeBefore,b=c.nodeAfter;if(a||b){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let d=c.getBoundingClientRect(),f=a?d.bottom:d.top;a&&b&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*i;e={left:d.left,right:d.right,top:f-g,bottom:f+g}}}}if(!e){let a=this.editorView.coordsAtPos(this.cursorPos),b=this.width/2*h;e={left:a.left-b,right:a.left+b,top:a.top,bottom:a.bottom}}let j=this.editorView.dom.offsetParent;if(!this.element&&(this.element=j.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",d),this.element.classList.toggle("prosemirror-dropcursor-inline",!d),j&&(j!=document.body||"static"!=getComputedStyle(j).position)){let c=j.getBoundingClientRect(),d=c.width/j.offsetWidth,e=c.height/j.offsetHeight;a=c.left-j.scrollLeft*d,b=c.top-j.scrollTop*e}else a=-pageXOffset,b=-pageYOffset;this.element.style.left=(e.left-a)/h+"px",this.element.style.top=(e.top-b)/i+"px",this.element.style.width=(e.right-e.left)/h+"px",this.element.style.height=(e.bottom-e.top)/i+"px"}scheduleRemoval(a){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),a)}dragover(a){if(!this.editorView.editable)return;let b=this.editorView.posAtCoords({left:a.clientX,top:a.clientY}),c=b&&b.inside>=0&&this.editorView.state.doc.nodeAt(b.inside),d=c&&c.type.spec.disableDropCursor,e="function"==typeof d?d(this.editorView,b,a):d;if(b&&!e){let a=b.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let b=(0,f.Um)(this.editorView.state.doc,a,this.editorView.dragging.slice);null!=b&&(a=b)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(a){this.editorView.dom.contains(a.relatedTarget)||this.setCursor(null)}}var h=c(669661),i=c(478853),j=c(331480);class k extends e.LN{constructor(a){super(a,a)}map(a,b){let c=a.resolve(b.map(this.head));return k.valid(c)?new k(c):e.LN.near(c)}content(){return j.Ji.empty}eq(a){return a instanceof k&&a.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(a,b){if("number"!=typeof b.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new k(a.resolve(b.pos))}getBookmark(){return new l(this.anchor)}static valid(a){let b=a.parent;if(b.isTextblock||!function(a){for(let b=a.depth;b>=0;b--){let c=a.index(b),d=a.node(b);if(0==c){if(d.type.spec.isolating)return!0;continue}for(let a=d.child(c-1);;a=a.lastChild){if(0==a.childCount&&!a.inlineContent||m(a.type))return!0;if(a.inlineContent)return!1}}return!0}(a)||!function(a){for(let b=a.depth;b>=0;b--){let c=a.indexAfter(b),d=a.node(b);if(c==d.childCount){if(d.type.spec.isolating)return!0;continue}for(let a=d.child(c);;a=a.firstChild){if(0==a.childCount&&!a.inlineContent||m(a.type))return!0;if(a.inlineContent)return!1}}return!0}(a))return!1;let c=b.type.spec.allowGapCursor;if(null!=c)return c;let d=b.contentMatchAt(a.index()).defaultType;return d&&d.isTextblock}static findGapCursorFrom(a,b,c=!1){e:for(;;){if(!c&&k.valid(a))return a;let d=a.pos,f=null;for(let c=a.depth;;c--){let e=a.node(c);if(b>0?a.indexAfter(c)<e.childCount:a.index(c)>0){f=e.child(b>0?a.indexAfter(c):a.index(c)-1);break}if(0==c)return null;d+=b;let g=a.doc.resolve(d);if(k.valid(g))return g}for(;;){let g=b>0?f.firstChild:f.lastChild;if(!g){if(f.isAtom&&!f.isText&&!e.nh.isSelectable(f)){a=a.doc.resolve(d+f.nodeSize*b),c=!1;continue e}break}f=g,d+=b;let h=a.doc.resolve(d);if(k.valid(h))return h}return null}}}k.prototype.visible=!1,k.findFrom=k.findGapCursorFrom,e.LN.jsonID("gapcursor",k);class l{constructor(a){this.pos=a}map(a){return new l(a.map(this.pos))}resolve(a){let b=a.resolve(this.pos);return k.valid(b)?new k(b):e.LN.near(b)}}function m(a){return a.isAtom||a.spec.isolating||a.spec.createGapCursor}let n=(0,i.K)({ArrowLeft:o("horiz",-1),ArrowRight:o("horiz",1),ArrowUp:o("vert",-1),ArrowDown:o("vert",1)});function o(a,b){let c="vert"==a?b>0?"down":"up":b>0?"right":"left";return function(a,d,f){let g=a.selection,h=b>0?g.$to:g.$from,i=g.empty;if(g instanceof e.U3){if(!f.endOfTextblock(c)||0==h.depth)return!1;i=!1,h=a.doc.resolve(b>0?h.after():h.before())}let j=k.findGapCursorFrom(h,b,i);return!!j&&(d&&d(a.tr.setSelection(new k(j))),!0)}}function p(a,b,c){if(!a||!a.editable)return!1;let d=a.state.doc.resolve(b);if(!k.valid(d))return!1;let f=a.posAtCoords({left:c.clientX,top:c.clientY});return!(f&&f.inside>-1&&e.nh.isSelectable(a.state.doc.nodeAt(f.inside)))&&(a.dispatch(a.state.tr.setSelection(new k(d))),!0)}function q(a,b){if("insertCompositionText"!=b.inputType||!(a.state.selection instanceof k))return!1;let{$from:c}=a.state.selection,d=c.parent.contentMatchAt(c.index()).findWrapping(a.state.schema.nodes.text);if(!d)return!1;let f=j.FK.empty;for(let a=d.length-1;a>=0;a--)f=j.FK.from(d[a].createAndFill(null,f));let g=a.state.tr.replace(c.pos,c.pos,new j.Ji(f,0,0));return g.setSelection(e.U3.near(g.doc.resolve(c.pos+1))),a.dispatch(g),!1}function r(a){if(!(a.selection instanceof k))return null;let b=document.createElement("div");return b.className="ProseMirror-gapcursor",h.zF.create(a.doc,[h.NZ.widget(a.selection.head,b,{key:"gapcursor"})])}var s=function(){};s.prototype.append=function(a){return a.length?(a=s.from(a),!this.length&&a||a.length<200&&this.leafAppend(a)||this.length<200&&a.leafPrepend(this)||this.appendInner(a)):this},s.prototype.prepend=function(a){return a.length?s.from(a).append(this):this},s.prototype.appendInner=function(a){return new u(this,a)},s.prototype.slice=function(a,b){return(void 0===a&&(a=0),void 0===b&&(b=this.length),a>=b)?s.empty:this.sliceInner(Math.max(0,a),Math.min(this.length,b))},s.prototype.get=function(a){if(!(a<0)&&!(a>=this.length))return this.getInner(a)},s.prototype.forEach=function(a,b,c){void 0===b&&(b=0),void 0===c&&(c=this.length),b<=c?this.forEachInner(a,b,c,0):this.forEachInvertedInner(a,b,c,0)},s.prototype.map=function(a,b,c){void 0===b&&(b=0),void 0===c&&(c=this.length);var d=[];return this.forEach(function(b,c){return d.push(a(b,c))},b,c),d},s.from=function(a){return a instanceof s?a:a&&a.length?new t(a):s.empty};var t=function(a){function b(b){a.call(this),this.values=b}a&&(b.__proto__=a),b.prototype=Object.create(a&&a.prototype),b.prototype.constructor=b;var c={length:{configurable:!0},depth:{configurable:!0}};return b.prototype.flatten=function(){return this.values},b.prototype.sliceInner=function(a,c){return 0==a&&c==this.length?this:new b(this.values.slice(a,c))},b.prototype.getInner=function(a){return this.values[a]},b.prototype.forEachInner=function(a,b,c,d){for(var e=b;e<c;e++)if(!1===a(this.values[e],d+e))return!1},b.prototype.forEachInvertedInner=function(a,b,c,d){for(var e=b-1;e>=c;e--)if(!1===a(this.values[e],d+e))return!1},b.prototype.leafAppend=function(a){if(this.length+a.length<=200)return new b(this.values.concat(a.flatten()))},b.prototype.leafPrepend=function(a){if(this.length+a.length<=200)return new b(a.flatten().concat(this.values))},c.length.get=function(){return this.values.length},c.depth.get=function(){return 0},Object.defineProperties(b.prototype,c),b}(s);s.empty=new t([]);var u=function(a){function b(b,c){a.call(this),this.left=b,this.right=c,this.length=b.length+c.length,this.depth=Math.max(b.depth,c.depth)+1}return a&&(b.__proto__=a),b.prototype=Object.create(a&&a.prototype),b.prototype.constructor=b,b.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},b.prototype.getInner=function(a){return a<this.left.length?this.left.get(a):this.right.get(a-this.left.length)},b.prototype.forEachInner=function(a,b,c,d){var e=this.left.length;if(b<e&&!1===this.left.forEachInner(a,b,Math.min(c,e),d)||c>e&&!1===this.right.forEachInner(a,Math.max(b-e,0),Math.min(this.length,c)-e,d+e))return!1},b.prototype.forEachInvertedInner=function(a,b,c,d){var e=this.left.length;if(b>e&&!1===this.right.forEachInvertedInner(a,b-e,Math.max(c,e)-e,d+e)||c<e&&!1===this.left.forEachInvertedInner(a,Math.min(b,e),c,d))return!1},b.prototype.sliceInner=function(a,b){if(0==a&&b==this.length)return this;var c=this.left.length;return b<=c?this.left.slice(a,b):a>=c?this.right.slice(a-c,b-c):this.left.slice(a,c).append(this.right.slice(0,b-c))},b.prototype.leafAppend=function(a){var c=this.right.leafAppend(a);if(c)return new b(this.left,c)},b.prototype.leafPrepend=function(a){var c=this.left.leafPrepend(a);if(c)return new b(c,this.right)},b.prototype.appendInner=function(a){return this.left.depth>=Math.max(this.right.depth,a.depth)+1?new b(this.left,new b(this.right,a)):new b(this,a)},b}(s);class v{constructor(a,b){this.items=a,this.eventCount=b}popEvent(a,b){let c,d,e,f;if(0==this.eventCount)return null;let g=this.items.length;for(;;g--)if(this.items.get(g-1).selection){--g;break}b&&(d=(c=this.remapping(g,this.items.length)).maps.length);let h=a.tr,i=[],j=[];return this.items.forEach((a,b)=>{if(!a.step){c||(d=(c=this.remapping(g,b+1)).maps.length),d--,j.push(a);return}if(c){j.push(new w(a.map));let b=a.step.map(c.slice(d)),e;b&&h.maybeStep(b).doc&&(e=h.mapping.maps[h.mapping.maps.length-1],i.push(new w(e,void 0,void 0,i.length+j.length))),d--,e&&c.appendMap(e,d)}else h.maybeStep(a.step);if(a.selection)return e=c?a.selection.map(c.slice(d)):a.selection,f=new v(this.items.slice(0,g).append(j.reverse().concat(i)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:h,selection:e}}addTransform(a,b,c,d){var e,f;let g,h=[],i=this.eventCount,j=this.items,k=!d&&j.length?j.get(j.length-1):null;for(let c=0;c<a.steps.length;c++){let e=a.steps[c].invert(a.docs[c]),f=new w(a.mapping.maps[c],e,b),g;(g=k&&k.merge(f))&&(f=g,c?h.pop():j=j.slice(0,j.length-1)),h.push(f),b&&(i++,b=void 0),d||(k=f)}let l=i-c.depth;return l>y&&(e=j,f=l,e.forEach((a,b)=>{if(a.selection&&0==f--)return g=b,!1}),j=e.slice(g),i-=l),new v(j.append(h),i)}remapping(a,b){let c=new f.X9;return this.items.forEach((b,d)=>{let e=null!=b.mirrorOffset&&d-b.mirrorOffset>=a?c.maps.length-b.mirrorOffset:void 0;c.appendMap(b.map,e)},a,b),c}addMaps(a){return 0==this.eventCount?this:new v(this.items.append(a.map(a=>new w(a))),this.eventCount)}rebased(a,b){if(!this.eventCount)return this;let c=[],d=Math.max(0,this.items.length-b),e=a.mapping,f=a.steps.length,g=this.eventCount;this.items.forEach(a=>{a.selection&&g--},d);let h=b;this.items.forEach(b=>{let d=e.getMirror(--h);if(null==d)return;f=Math.min(f,d);let i=e.maps[d];if(b.step){let f=a.steps[d].invert(a.docs[d]),j=b.selection&&b.selection.map(e.slice(h+1,d));j&&g++,c.push(new w(i,f,j))}else c.push(new w(i))},d);let i=[];for(let a=b;a<f;a++)i.push(new w(e.maps[a]));let j=new v(this.items.slice(0,d).append(i).append(c),g);return j.emptyItemCount()>500&&(j=j.compress(this.items.length-c.length)),j}emptyItemCount(){let a=0;return this.items.forEach(b=>{!b.step&&a++}),a}compress(a=this.items.length){let b=this.remapping(0,a),c=b.maps.length,d=[],e=0;return this.items.forEach((f,g)=>{if(g>=a)d.push(f),f.selection&&e++;else if(f.step){let a=f.step.map(b.slice(c)),g=a&&a.getMap();if(c--,g&&b.appendMap(g,c),a){let h=f.selection&&f.selection.map(b.slice(c));h&&e++;let i=new w(g.invert(),a,h),j,k=d.length-1;(j=d.length&&d[k].merge(i))?d[k]=j:d.push(i)}}else f.map&&c--},this.items.length,0),new v(s.from(d.reverse()),e)}}v.empty=new v(s.empty,0);class w{constructor(a,b,c,d){this.map=a,this.step=b,this.selection=c,this.mirrorOffset=d}merge(a){if(this.step&&a.step&&!a.selection){let b=a.step.merge(this.step);if(b)return new w(b.getMap().invert(),b,this.selection)}}}class x{constructor(a,b,c,d,e){this.done=a,this.undone=b,this.prevRanges=c,this.prevTime=d,this.prevComposition=e}}let y=20;function z(a){let b=[];for(let c=a.length-1;c>=0&&0==b.length;c--)a[c].forEach((a,c,d,e)=>b.push(d,e));return b}function A(a,b){if(!a)return null;let c=[];for(let d=0;d<a.length;d+=2){let e=b.map(a[d],1),f=b.map(a[d+1],-1);e<=f&&c.push(e,f)}return c}let B=!1,C=null;function D(a){let b=a.plugins;if(C!=b){B=!1,C=b;for(let a=0;a<b.length;a++)if(b[a].spec.historyPreserveItems){B=!0;break}}return B}let E=new e.hs("history"),F=new e.hs("closeHistory");function G(a,b){return(c,d)=>{let e=E.getState(c);if(!e||0==(a?e.undone:e.done).eventCount)return!1;if(d){let f=function(a,b,c){let d=D(b),e=E.get(b).spec.config,f=(c?a.undone:a.done).popEvent(b,d);if(!f)return null;let g=f.selection.resolve(f.transform.doc),h=(c?a.done:a.undone).addTransform(f.transform,b.selection.getBookmark(),e,d),i=new x(c?h:f.remaining,c?f.remaining:h,null,0,-1);return f.transform.setSelection(g).setMeta(E,{redo:c,historyState:i})}(e,c,a);f&&d(b?f.scrollIntoView():f)}return!0}}let H=G(!1,!0),I=G(!0,!0);G(!1,!1),G(!0,!1);var J=d.YY.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:a=>a.length,wordCounter:a=>a.split(" ").filter(a=>""!==a).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=a=>{let b=(null==a?void 0:a.node)||this.editor.state.doc;if("textSize"===((null==a?void 0:a.mode)||this.options.mode)){let a=b.textBetween(0,b.content.size,void 0," ");return this.options.textCounter(a)}return b.nodeSize},this.storage.words=a=>{let b=(null==a?void 0:a.node)||this.editor.state.doc,c=b.textBetween(0,b.content.size," "," ");return this.options.wordCounter(c)}},addProseMirrorPlugins(){let a=!1;return[new e.k_({key:new e.hs("characterCount"),appendTransaction:(b,c,d)=>{if(a)return;let e=this.options.limit;if(null==e||0===e){a=!0;return}let f=this.storage.characters({node:d.doc});if(f>e){console.warn(`[CharacterCount] Initial content exceeded limit of ${e} characters. Content was automatically trimmed.`);let b=d.tr.deleteRange(0,f-e);return a=!0,b}a=!0},filterTransaction:(a,b)=>{let c=this.options.limit;if(!a.docChanged||0===c||null==c)return!0;let d=this.storage.characters({node:b.doc}),e=this.storage.characters({node:a.doc});if(e<=c||d>c&&e>c&&e<=d)return!0;if(d>c&&e>c&&e>d||!a.getMeta("paste"))return!1;let f=a.selection.$head.pos;return a.deleteRange(f-(e-c),f),!(this.storage.characters({node:a.doc})>c)}})]}}),K=d.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(a={}){return new e.k_({view:b=>new g(b,a)})}(this.options)]}});d.YY.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new e.k_({key:new e.hs("focus"),props:{decorations:({doc:a,selection:b})=>{let{isEditable:c,isFocused:d}=this.editor,{anchor:e}=b,f=[];if(!c||!d)return h.zF.create(a,[]);let g=0;"deepest"===this.options.mode&&a.descendants((a,b)=>{if(!a.isText){if(!(e>=b&&e<=b+a.nodeSize-1))return!1;g+=1}});let i=0;return a.descendants((a,b)=>!a.isText&&!!(e>=b&&e<=b+a.nodeSize-1)&&((i+=1,"deepest"===this.options.mode&&g-i>0||"shallowest"===this.options.mode&&i>1)?"deepest"===this.options.mode:void f.push(h.NZ.node(b,b+a.nodeSize,{class:this.options.className})))),h.zF.create(a,f)}}})]}});var L=d.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new e.k_({props:{decorations:r,createSelectionBetween:(a,b,c)=>b.pos==c.pos&&k.valid(c)?new k(c):null,handleClick:p,handleKeyDown:n,handleDOMEvents:{beforeinput:q}}})],extendNodeSchema(a){var b;let c={name:a.name,options:a.options,storage:a.storage};return{allowGapCursor:null!=(b=(0,d.gk)((0,d.iI)(a,"allowGapCursor",c)))?b:null}}}),M="placeholder",N=d.YY.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:M,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){let a=this.options.dataAttribute?`data-${this.options.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${M}`;return[new e.k_({key:new e.hs("placeholder"),props:{decorations:({doc:b,selection:c})=>{let e=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:f}=c,g=[];if(!e)return null;let i=this.editor.isEmpty;return b.descendants((b,c)=>{let e=f>=c&&f<=c+b.nodeSize,j=!b.isLeaf&&(0,d.Op)(b);if((e||!this.options.showOnlyCurrent)&&j){let d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);let f=h.NZ.node(c,c+b.nodeSize,{class:d.join(" "),[a]:"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:b,pos:c,hasAnchor:e}):this.options.placeholder});g.push(f)}return this.options.includeChildren}),h.zF.create(b,g)}}})]}});function O({types:a,node:b}){return b&&Array.isArray(a)&&a.includes(b.type)||(null==b?void 0:b.type)===a}d.YY.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:a,options:b}=this;return[new e.k_({key:new e.hs("selection"),props:{decorations:c=>c.selection.empty||a.isFocused||!a.isEditable||(0,d.BQ)(c.selection)||a.view.dragging?null:h.zF.create(c.doc,[h.NZ.inline(c.selection.from,c.selection.to,{class:b.className})])}})]}});var P=d.YY.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var a;let b=new e.hs(this.name),c=this.options.node||(null==(a=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:a.name)||"paragraph",d=Object.entries(this.editor.schema.nodes).map(([,a])=>a).filter(a=>(this.options.notAfter||[]).concat(c).includes(a.name));return[new e.k_({key:b,appendTransaction:(a,d,e)=>{let{doc:f,tr:g,schema:h}=e,i=b.getState(e),j=f.content.size,k=h.nodes[c];if(i)return g.insert(j,k.create())},state:{init:(a,b)=>!O({node:b.tr.doc.lastChild,types:d}),apply:(a,b)=>!a.docChanged||a.getMeta("__uniqueIDTransaction")?b:!O({node:a.doc.lastChild,types:d})}})]}}),Q=d.YY.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:a,dispatch:b})=>H(a,b),redo:()=>({state:a,dispatch:b})=>I(a,b)}),addProseMirrorPlugins(){return[function(a={}){return a={depth:a.depth||100,newGroupDelay:a.newGroupDelay||500},new e.k_({key:E,state:{init:()=>new x(v.empty,v.empty,null,0,-1),apply:(b,c,d)=>(function(a,b,c,d){let e=c.getMeta(E),f;if(e)return e.historyState;c.getMeta(F)&&(a=new x(a.done,a.undone,null,0,-1));let g=c.getMeta("appendedTransaction");if(0==c.steps.length)return a;if(g&&g.getMeta(E))if(g.getMeta(E).redo)return new x(a.done.addTransform(c,void 0,d,D(b)),a.undone,z(c.mapping.maps),a.prevTime,a.prevComposition);else return new x(a.done,a.undone.addTransform(c,void 0,d,D(b)),null,a.prevTime,a.prevComposition);if(!1===c.getMeta("addToHistory")||g&&!1===g.getMeta("addToHistory"))if(f=c.getMeta("rebased"))return new x(a.done.rebased(c,f),a.undone.rebased(c,f),A(a.prevRanges,c.mapping),a.prevTime,a.prevComposition);else return new x(a.done.addMaps(c.mapping.maps),a.undone.addMaps(c.mapping.maps),A(a.prevRanges,c.mapping),a.prevTime,a.prevComposition);{let e=c.getMeta("composition"),f=0==a.prevTime||!g&&a.prevComposition!=e&&(a.prevTime<(c.time||0)-d.newGroupDelay||!function(a,b){if(!b)return!1;if(!a.docChanged)return!0;let c=!1;return a.mapping.maps[0].forEach((a,d)=>{for(let e=0;e<b.length;e+=2)a<=b[e+1]&&d>=b[e]&&(c=!0)}),c}(c,a.prevRanges)),h=g?A(a.prevRanges,c.mapping):z(c.mapping.maps);return new x(a.done.addTransform(c,f?b.selection.getBookmark():void 0,d,D(b)),v.empty,h,c.time,null==e?a.prevComposition:e)}})(c,d,b,a)},config:a,props:{handleDOMEvents:{beforeinput(a,b){let c=b.inputType,d="historyUndo"==c?H:"historyRedo"==c?I:null;return!!d&&!!a.editable&&(b.preventDefault(),d(a.state,a.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}})},360478:(a,b,c)=>{"use strict";c.d(b,{B:()=>f});var d=c(621405),e=c(145214);let f={partial:!0,tokenize:function(a,b,c){return function(b){return(0,e.On)(b)?(0,d.N)(a,f,"linePrefix")(b):f(b)};function f(a){return null===a||(0,e.HP)(a)?b(a):c(a)}}}},379257:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"PreloadChunks",{enumerable:!0,get:function(){return h}});let d=c(736927),e=c(249855),f=c(529294),g=c(438899);function h(a){let{moduleIds:b}=a,c=f.workAsyncStorage.getStore();if(void 0===c)return null;let h=[];if(c.reactLoadableManifest&&b){let a=c.reactLoadableManifest;for(let c of b){if(!a[c])continue;let b=a[c].files;h.push(...b)}}return 0===h.length?null:(0,d.jsx)(d.Fragment,{children:h.map(a=>{let b=c.assetPrefix+"/_next/"+(0,g.encodeURIPath)(a);return a.endsWith(".css")?(0,d.jsx)("link",{precedence:"dynamic",href:b,rel:"stylesheet",as:"style"},a):((0,e.preload)(b,{as:"script",fetchPriority:"low"}),null)})})}},379551:a=>{"use strict";a.exports=require("url")},379924:(a,b,c)=>{"use strict";function d(a){if(null==a)return[];if(Array.isArray(a))return a.map(String).filter(Boolean);let b=String(a).trim();if(!b)return[];if(b.startsWith("["))try{let a=JSON.parse(b);if(Array.isArray(a))return a.map(String).filter(Boolean)}catch{}return[b]}c.d(b,{k:()=>d})},380481:a=>{"use strict";a.exports=require("node:readline")},381802:(a,b,c)=>{"use strict";c.d(b,{$t:()=>x,LN:()=>g,U3:()=>k,hs:()=>B,i5:()=>o,k_:()=>y,nh:()=>m,yn:()=>h});var d=c(331480),e=c(731626);let f=Object.create(null);class g{constructor(a,b,c){this.$anchor=a,this.$head=b,this.ranges=c||[new h(a.min(b),a.max(b))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let a=this.ranges;for(let b=0;b<a.length;b++)if(a[b].$from.pos!=a[b].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(a,b=d.Ji.empty){let c=b.content.lastChild,e=null;for(let a=0;a<b.openEnd;a++)e=c,c=c.lastChild;let f=a.steps.length,g=this.ranges;for(let h=0;h<g.length;h++){let{$from:i,$to:j}=g[h],k=a.mapping.slice(f);a.replaceRange(k.map(i.pos),k.map(j.pos),h?d.Ji.empty:b),0==h&&r(a,f,(c?c.isInline:e&&e.isTextblock)?-1:1)}}replaceWith(a,b){let c=a.steps.length,d=this.ranges;for(let e=0;e<d.length;e++){let{$from:f,$to:g}=d[e],h=a.mapping.slice(c),i=h.map(f.pos),j=h.map(g.pos);e?a.deleteRange(i,j):(a.replaceRangeWith(i,j,b),r(a,c,b.isInline?-1:1))}}static findFrom(a,b,c=!1){let d=a.parent.inlineContent?new k(a):q(a.node(0),a.parent,a.pos,a.index(),b,c);if(d)return d;for(let d=a.depth-1;d>=0;d--){let e=b<0?q(a.node(0),a.node(d),a.before(d+1),a.index(d),b,c):q(a.node(0),a.node(d),a.after(d+1),a.index(d)+1,b,c);if(e)return e}return null}static near(a,b=1){return this.findFrom(a,b)||this.findFrom(a,-b)||new o(a.node(0))}static atStart(a){return q(a,a,0,0,1)||new o(a)}static atEnd(a){return q(a,a,a.content.size,a.childCount,-1)||new o(a)}static fromJSON(a,b){if(!b||!b.type)throw RangeError("Invalid input for Selection.fromJSON");let c=f[b.type];if(!c)throw RangeError(`No selection type ${b.type} defined`);return c.fromJSON(a,b)}static jsonID(a,b){if(a in f)throw RangeError("Duplicate use of selection JSON ID "+a);return f[a]=b,b.prototype.jsonID=a,b}getBookmark(){return k.between(this.$anchor,this.$head).getBookmark()}}g.prototype.visible=!0;class h{constructor(a,b){this.$from=a,this.$to=b}}let i=!1;function j(a){i||a.parent.inlineContent||(i=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+a.parent.type.name+")"))}class k extends g{constructor(a,b=a){j(a),j(b),super(a,b)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(a,b){let c=a.resolve(b.map(this.head));if(!c.parent.inlineContent)return g.near(c);let d=a.resolve(b.map(this.anchor));return new k(d.parent.inlineContent?d:c,c)}replace(a,b=d.Ji.empty){if(super.replace(a,b),b==d.Ji.empty){let b=this.$from.marksAcross(this.$to);b&&a.ensureMarks(b)}}eq(a){return a instanceof k&&a.anchor==this.anchor&&a.head==this.head}getBookmark(){return new l(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(a,b){if("number"!=typeof b.anchor||"number"!=typeof b.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new k(a.resolve(b.anchor),a.resolve(b.head))}static create(a,b,c=b){let d=a.resolve(b);return new this(d,c==b?d:a.resolve(c))}static between(a,b,c){let d=a.pos-b.pos;if((!c||d)&&(c=d>=0?1:-1),!b.parent.inlineContent){let a=g.findFrom(b,c,!0)||g.findFrom(b,-c,!0);if(!a)return g.near(b,c);b=a.$head}return a.parent.inlineContent||(0==d?a=b:(a=(g.findFrom(a,-c,!0)||g.findFrom(a,c,!0)).$anchor).pos<b.pos!=d<0&&(a=b)),new k(a,b)}}g.jsonID("text",k);class l{constructor(a,b){this.anchor=a,this.head=b}map(a){return new l(a.map(this.anchor),a.map(this.head))}resolve(a){return k.between(a.resolve(this.anchor),a.resolve(this.head))}}class m extends g{constructor(a){let b=a.nodeAfter;super(a,a.node(0).resolve(a.pos+b.nodeSize)),this.node=b}map(a,b){let{deleted:c,pos:d}=b.mapResult(this.anchor),e=a.resolve(d);return c?g.near(e):new m(e)}content(){return new d.Ji(d.FK.from(this.node),0,0)}eq(a){return a instanceof m&&a.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new n(this.anchor)}static fromJSON(a,b){if("number"!=typeof b.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new m(a.resolve(b.anchor))}static create(a,b){return new m(a.resolve(b))}static isSelectable(a){return!a.isText&&!1!==a.type.spec.selectable}}m.prototype.visible=!1,g.jsonID("node",m);class n{constructor(a){this.anchor=a}map(a){let{deleted:b,pos:c}=a.mapResult(this.anchor);return b?new l(c,c):new n(c)}resolve(a){let b=a.resolve(this.anchor),c=b.nodeAfter;return c&&m.isSelectable(c)?new m(b):g.near(b)}}class o extends g{constructor(a){super(a.resolve(0),a.resolve(a.content.size))}replace(a,b=d.Ji.empty){if(b==d.Ji.empty){a.delete(0,a.doc.content.size);let b=g.atStart(a.doc);b.eq(a.selection)||a.setSelection(b)}else super.replace(a,b)}toJSON(){return{type:"all"}}static fromJSON(a){return new o(a)}map(a){return new o(a)}eq(a){return a instanceof o}getBookmark(){return p}}g.jsonID("all",o);let p={map(){return this},resolve:a=>new o(a)};function q(a,b,c,d,e,f=!1){if(b.inlineContent)return k.create(a,c);for(let g=d-(e>0?0:1);e>0?g<b.childCount:g>=0;g+=e){let d=b.child(g);if(d.isAtom){if(!f&&m.isSelectable(d))return m.create(a,c-(e<0?d.nodeSize:0))}else{let b=q(a,d,c+e,e<0?d.childCount:0,e,f);if(b)return b}c+=d.nodeSize*e}return null}function r(a,b,c){let d,f=a.steps.length-1;if(f<b)return;let h=a.steps[f];(h instanceof e.Ln||h instanceof e.Wg)&&(a.mapping.maps[f].forEach((a,b,c,e)=>{null==d&&(d=e)}),a.setSelection(g.near(a.doc.resolve(d),c)))}class s extends e.dL{constructor(a){super(a.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=a.selection,this.storedMarks=a.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(a){if(a.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=a,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(a){return this.storedMarks=a,this.updated|=2,this}ensureMarks(a){return d.CU.sameSet(this.storedMarks||this.selection.$from.marks(),a)||this.setStoredMarks(a),this}addStoredMark(a){return this.ensureMarks(a.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(a){return this.ensureMarks(a.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(a,b){super.addStep(a,b),this.updated=-3&this.updated,this.storedMarks=null}setTime(a){return this.time=a,this}replaceSelection(a){return this.selection.replace(this,a),this}replaceSelectionWith(a,b=!0){let c=this.selection;return b&&(a=a.mark(this.storedMarks||(c.empty?c.$from.marks():c.$from.marksAcross(c.$to)||d.CU.none))),c.replaceWith(this,a),this}deleteSelection(){return this.selection.replace(this),this}insertText(a,b,c){let d=this.doc.type.schema;if(null==b)return a?this.replaceSelectionWith(d.text(a),!0):this.deleteSelection();{if(null==c&&(c=b),!a)return this.deleteRange(b,c);let e=this.storedMarks;if(!e){let a=this.doc.resolve(b);e=c==b?a.marks():a.marksAcross(this.doc.resolve(c))}return this.replaceRangeWith(b,c,d.text(a,e)),this.selection.empty||this.selection.to!=b+a.length||this.setSelection(g.near(this.selection.$to)),this}}setMeta(a,b){return this.meta["string"==typeof a?a:a.key]=b,this}getMeta(a){return this.meta["string"==typeof a?a:a.key]}get isGeneric(){for(let a in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function t(a,b){return b&&a?a.bind(b):a}class u{constructor(a,b,c){this.name=a,this.init=t(b.init,c),this.apply=t(b.apply,c)}}let v=[new u("doc",{init:a=>a.doc||a.schema.topNodeType.createAndFill(),apply:a=>a.doc}),new u("selection",{init:(a,b)=>a.selection||g.atStart(b.doc),apply:a=>a.selection}),new u("storedMarks",{init:a=>a.storedMarks||null,apply:(a,b,c,d)=>d.selection.$cursor?a.storedMarks:null}),new u("scrollToSelection",{init:()=>0,apply:(a,b)=>a.scrolledIntoView?b+1:b})];class w{constructor(a,b){this.schema=a,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=v.slice(),b&&b.forEach(a=>{if(this.pluginsByKey[a.key])throw RangeError("Adding different instances of a keyed plugin ("+a.key+")");this.plugins.push(a),this.pluginsByKey[a.key]=a,a.spec.state&&this.fields.push(new u(a.key,a.spec.state,a))})}}class x{constructor(a){this.config=a}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(a){return this.applyTransaction(a).state}filterTransaction(a,b=-1){for(let c=0;c<this.config.plugins.length;c++)if(c!=b){let b=this.config.plugins[c];if(b.spec.filterTransaction&&!b.spec.filterTransaction.call(b,a,this))return!1}return!0}applyTransaction(a){if(!this.filterTransaction(a))return{state:this,transactions:[]};let b=[a],c=this.applyInner(a),d=null;for(;;){let e=!1;for(let f=0;f<this.config.plugins.length;f++){let g=this.config.plugins[f];if(g.spec.appendTransaction){let h=d?d[f].n:0,i=d?d[f].state:this,j=h<b.length&&g.spec.appendTransaction.call(g,h?b.slice(h):b,i,c);if(j&&c.filterTransaction(j,f)){if(j.setMeta("appendedTransaction",a),!d){d=[];for(let a=0;a<this.config.plugins.length;a++)d.push(a<f?{state:c,n:b.length}:{state:this,n:0})}b.push(j),c=c.applyInner(j),e=!0}d&&(d[f]={state:c,n:b.length})}}if(!e)return{state:c,transactions:b}}}applyInner(a){if(!a.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let b=new x(this.config),c=this.config.fields;for(let d=0;d<c.length;d++){let e=c[d];b[e.name]=e.apply(a,this[e.name],this,b)}return b}get tr(){return new s(this)}static create(a){let b=new w(a.doc?a.doc.type.schema:a.schema,a.plugins),c=new x(b);for(let d=0;d<b.fields.length;d++)c[b.fields[d].name]=b.fields[d].init(a,c);return c}reconfigure(a){let b=new w(this.schema,a.plugins),c=b.fields,d=new x(b);for(let b=0;b<c.length;b++){let e=c[b].name;d[e]=this.hasOwnProperty(e)?this[e]:c[b].init(a,d)}return d}toJSON(a){let b={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(b.storedMarks=this.storedMarks.map(a=>a.toJSON())),a&&"object"==typeof a)for(let c in a){if("doc"==c||"selection"==c)throw RangeError("The JSON fields `doc` and `selection` are reserved");let d=a[c],e=d.spec.state;e&&e.toJSON&&(b[c]=e.toJSON.call(d,this[d.key]))}return b}static fromJSON(a,b,c){if(!b)throw RangeError("Invalid input for EditorState.fromJSON");if(!a.schema)throw RangeError("Required config field 'schema' missing");let e=new w(a.schema,a.plugins),f=new x(e);return e.fields.forEach(e=>{if("doc"==e.name)f.doc=d.bP.fromJSON(a.schema,b.doc);else if("selection"==e.name)f.selection=g.fromJSON(f.doc,b.selection);else if("storedMarks"==e.name)b.storedMarks&&(f.storedMarks=b.storedMarks.map(a.schema.markFromJSON));else{if(c)for(let d in c){let g=c[d],h=g.spec.state;if(g.key==e.name&&h&&h.fromJSON&&Object.prototype.hasOwnProperty.call(b,d)){f[e.name]=h.fromJSON.call(g,a,b[d],f);return}}f[e.name]=e.init(a,f)}}),f}}class y{constructor(a){this.spec=a,this.props={},a.props&&function a(b,c,d){for(let e in b){let f=b[e];f instanceof Function?f=f.bind(c):"handleDOMEvents"==e&&(f=a(f,c,{})),d[e]=f}return d}(a.props,this,this.props),this.key=a.key?a.key.key:A("plugin")}getState(a){return a[this.key]}}let z=Object.create(null);function A(a){return a in z?a+"$"+ ++z[a]:(z[a]=0,a+"$")}class B{constructor(a="key"){this.key=A(a)}get(a){return a.config.pluginsByKey[this.key]}getState(a){return a[this.key]}}},392796:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],f=(0,d.A)("trending-up",e)},393660:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"BailoutToCSR",{enumerable:!0,get:function(){return e}});let d=c(910568);function e(a){let{reason:b,children:c}=a;throw Object.defineProperty(new d.BailoutToCSRError(b),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}},397318:(a,b,c)=>{Promise.resolve().then(c.bind(c,911604))},403893:(a,b,c)=>{"use strict";c(25741)},405545:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>i});var d=c(381802),e=c(669661),f=c(720511);function g(a){var b;let{char:c,allowSpaces:d,allowToIncludeChar:e,allowedPrefixes:g,startOfLine:h,$position:i}=a,j=d&&!e,k=(0,f.GG)(c),l=RegExp(`\\s${k}$`),m=h?"^":"",n=e?"":k,o=j?RegExp(`${m}${k}.*?(?=\\s${n}|$)`,"gm"):RegExp(`${m}(?:^)?${k}[^\\s${n}]*`,"gm"),p=(null==(b=i.nodeBefore)?void 0:b.isText)&&i.nodeBefore.text;if(!p)return null;let q=i.pos-p.length,r=Array.from(p.matchAll(o)).pop();if(!r||void 0===r.input||void 0===r.index)return null;let s=r.input.slice(Math.max(0,r.index-1),r.index),t=RegExp(`^[${null==g?void 0:g.join("")}\0]?$`).test(s);if(null!==g&&!t)return null;let u=q+r.index,v=u+r[0].length;return(j&&l.test(p.slice(v-1,v+1))&&(r[0]+=" ",v+=1),u<i.pos&&v>=i.pos)?{range:{from:u,to:v},query:r[0].slice(c.length),text:r[0]}:null}var h=new d.hs("suggestion"),i=function({pluginKey:a=h,editor:b,char:c="@",allowSpaces:f=!1,allowToIncludeChar:i=!1,allowedPrefixes:j=[" "],startOfLine:k=!1,decorationTag:l="span",decorationClass:m="suggestion",decorationContent:n="",decorationEmptyClass:o="is-empty",command:p=()=>null,items:q=()=>[],render:r=()=>({}),allow:s=()=>!0,findSuggestionMatch:t=g,shouldShow:u}){let v,w=null==r?void 0:r(),x=()=>{let a=b.state.selection.$anchor.pos,{top:c,right:d,bottom:e,left:f}=b.view.coordsAtPos(a);try{return new DOMRect(f,c,d-f,e-c)}catch{return null}},y=(c,d)=>d?()=>{let d=a.getState(b.state),e=null==d?void 0:d.decorationId,f=c.dom.querySelector(`[data-decoration-id="${e}"]`);return(null==f?void 0:f.getBoundingClientRect())||null}:x,z=new d.k_({key:a,view(){return{update:async(a,c)=>{var d,e,f,g,h,i,j;let k=null==(d=this.key)?void 0:d.getState(c),l=null==(e=this.key)?void 0:e.getState(a.state),m=k.active&&l.active&&k.range.from!==l.range.from,n=!k.active&&l.active,o=k.active&&!l.active,r=!n&&!o&&k.query!==l.query,s=n||m&&r,t=r||m,u=o||m&&r;if(!s&&!t&&!u)return;let x=u&&!s?k:l,z=a.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);v={editor:b,range:x.range,query:x.query,text:x.text,items:[],command:a=>p({editor:b,range:x.range,props:a}),decorationNode:z,clientRect:y(a,z)},s&&(null==(f=null==w?void 0:w.onBeforeStart)||f.call(w,v)),t&&(null==(g=null==w?void 0:w.onBeforeUpdate)||g.call(w,v)),(t||s)&&(v.items=await q({editor:b,query:x.query})),u&&(null==(h=null==w?void 0:w.onExit)||h.call(w,v)),t&&(null==(i=null==w?void 0:w.onUpdate)||i.call(w,v)),s&&(null==(j=null==w?void 0:w.onStart)||j.call(w,v))},destroy:()=>{var a;v&&(null==(a=null==w?void 0:w.onExit)||a.call(w,v))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(d,e,g,h){let{isEditable:l}=b,{composing:m}=b.view,{selection:n}=d,{empty:o,from:p}=n,q={...e},r=d.getMeta(a);if(r&&r.exit)return q.active=!1,q.decorationId=null,q.range={from:0,to:0},q.query=null,q.text=null,q;if(q.composing=m,l&&(o||b.view.composing)){(p<e.range.from||p>e.range.to)&&!m&&!e.composing&&(q.active=!1);let a=t({char:c,allowSpaces:f,allowToIncludeChar:i,allowedPrefixes:j,startOfLine:k,$position:n.$from}),g=`id_${Math.floor(0xffffffff*Math.random())}`;a&&s({editor:b,state:h,range:a.range,isActive:e.active})&&(!u||u({editor:b,range:a.range,query:a.query,text:a.text,transaction:d}))?(q.active=!0,q.decorationId=e.decorationId?e.decorationId:g,q.range=a.range,q.query=a.query,q.text=a.text):q.active=!1}else q.active=!1;return q.active||(q.decorationId=null,q.range={from:0,to:0},q.query=null,q.text=null),q}},props:{handleKeyDown(c,d){var e,f,g,h;let{active:i,range:j}=z.getState(c.state);if(!i)return!1;if("Escape"===d.key||"Esc"===d.key){let h=z.getState(c.state),i=null!=(e=null==v?void 0:v.decorationNode)?e:null,j=null!=i?i:(null==h?void 0:h.decorationId)?c.dom.querySelector(`[data-decoration-id="${h.decorationId}"]`):null;if(null==(f=null==w?void 0:w.onKeyDown)?void 0:f.call(w,{view:c,event:d,range:h.range}))return!0;let k={editor:b,range:h.range,query:h.query,text:h.text,items:[],command:a=>p({editor:b,range:h.range,props:a}),decorationNode:j,clientRect:j?()=>j.getBoundingClientRect()||null:null};return null==(g=null==w?void 0:w.onExit)||g.call(w,k),!function(c,d){var e;try{let d=a.getState(c.state),f=(null==d?void 0:d.decorationId)?c.dom.querySelector(`[data-decoration-id="${d.decorationId}"]`):null,g={editor:b,range:(null==d?void 0:d.range)||{from:0,to:0},query:(null==d?void 0:d.query)||null,text:(null==d?void 0:d.text)||null,items:[],command:a=>p({editor:b,range:(null==d?void 0:d.range)||{from:0,to:0},props:a}),decorationNode:f,clientRect:y(c,f)};null==(e=null==w?void 0:w.onExit)||e.call(w,g)}catch{}let f=c.state.tr.setMeta(d,{exit:!0});c.dispatch(f)}(c,a),!0}return(null==(h=null==w?void 0:w.onKeyDown)?void 0:h.call(w,{view:c,event:d,range:j}))||!1},decorations(a){let{active:b,range:c,decorationId:d,query:f}=z.getState(a);if(!b)return null;let g=!(null==f?void 0:f.length),h=[m];return g&&h.push(o),e.zF.create(a.doc,[e.NZ.inline(c.from,c.to,{nodeName:l,class:h.join(" "),"data-decoration-id":d,"data-decoration-content":n})])}}});return z}},405566:(a,b,c)=>{Promise.resolve().then(c.bind(c,486230))},407223:(a,b,c)=>{let d=c(512089),{FormulaHelpers:e,Types:f}=c(828358),g={"#NULL!":1,"#DIV/0!":2,"#VALUE!":3,"#REF!":4,"#NAME?":5,"#NUM!":6,"#N/A":7};a.exports={CELL:(a,b)=>{},"ERROR.TYPE":a=>{if((a=e.accept(a))instanceof d)return g[a.toString()];throw d.NA},INFO:()=>{},ISBLANK:a=>!!a.ref&&(null==a.value||""===a.value),ISERR:a=>(a=e.accept(a))instanceof d&&"#N/A"!==a.toString(),ISERROR:a=>(a=e.accept(a))instanceof d,ISEVEN:a=>(a=Math.trunc(a=e.accept(a,f.NUMBER)))%2==0,ISLOGICAL:a=>"boolean"==typeof(a=e.accept(a)),ISNA:a=>(a=e.accept(a))instanceof d&&"#N/A"===a.toString(),ISNONTEXT:a=>"string"!=typeof(a=e.accept(a)),ISNUMBER:a=>"number"==typeof(a=e.accept(a)),ISREF:a=>!(!a.ref||e.isCellRef(a)&&(a.ref.row>1048576||a.ref.col>16384)||e.isRangeRef(a)&&(a.ref.from.row>1048576||a.ref.from.col>16384||a.ref.to.row>1048576||a.ref.to.col>16384))&&!((a=e.accept(a))instanceof d&&"#REF!"===a.toString()),ISTEXT:a=>"string"==typeof(a=e.accept(a)),N:a=>{let b=typeof(a=e.accept(a));if("number"===b)return a;if("boolean"===b)return Number(a);if(a instanceof d)throw a;return 0},NA:()=>{throw d.NA},TYPE:a=>{if(a.ref){if(e.isRangeRef(a))return 16;else if(e.isCellRef(a)&&"string"==typeof(a=e.accept(a))&&0===a.length)return 1}let b=typeof(a=e.accept(a));if("number"===b)return 1;if("string"===b)return 2;if("boolean"===b)return 4;if(a instanceof d)return 16;if(Array.isArray(a))return 64}}},410490:(a,b,c)=>{let{createToken:d,Lexer:e}=c(704092),f=c(512089),g={},h=d({name:"WhiteSpace",pattern:/\s+/,group:e.SKIPPED}),i=d({name:"String",pattern:/"(""|[^"])*"/}),j=d({name:"SingleQuotedString",pattern:/'(''|[^'])*'/}),k=d({name:"SheetQuoted",pattern:/'((?![\\\/\[\]*?:]).)+?'!/}),l=d({name:"Function",pattern:/[A-Za-z_]+[A-Za-z_0-9.]*\(/}),m=d({name:"FormulaErrorT",pattern:/#NULL!|#DIV\/0!|#VALUE!|#NAME\?|#NUM!|#N\/A/}),n=d({name:"RefError",pattern:/#REF!/}),o=d({name:"Name",pattern:/[a-zA-Z_][a-zA-Z0-9_.?]*/}),p=d({name:"Sheet",pattern:/[A-Za-z_.\d\u007F-\uFFFF]+!/}),q=d({name:"Cell",pattern:/[$]?[A-Za-z]{1,3}[$]?[1-9][0-9]*/,longer_alt:o}),r=d({name:"Number",pattern:/[0-9]+[.]?[0-9]*([eE][+\-][0-9]+)?/}),s=d({name:"Boolean",pattern:/TRUE|FALSE/i}),t=d({name:"Column",pattern:/[$]?[A-Za-z]{1,3}/,longer_alt:o}),u=d({name:"At",pattern:/@/}),v=d({name:"Comma",pattern:/,/}),w=d({name:"Colon",pattern:/:/}),x=d({name:"Semicolon",pattern:/;/}),y=d({name:"OpenParen",pattern:/\(/}),z=d({name:"CloseParen",pattern:/\)/}),A=d({name:"OpenSquareParen",pattern:/\[/}),B=d({name:"CloseSquareParen",pattern:/]/});d({name:"exclamationMark",pattern:/!/});let C=d({name:"OpenCurlyParen",pattern:/{/}),D=d({name:"CloseCurlyParen",pattern:/}/}),E=d({name:"QuoteS",pattern:/'/}),F=d({name:"MulOp",pattern:/\*/}),G=d({name:"PlusOp",pattern:/\+/}),H=d({name:"DivOp",pattern:/\//}),I=d({name:"MinOp",pattern:/-/}),J=d({name:"ConcatOp",pattern:/&/}),K=d({name:"ExOp",pattern:/\^/}),L=d({name:"PercentOp",pattern:/%/}),M=d({name:"GtOp",pattern:/>/}),N=d({name:"EqOp",pattern:/=/}),O=d({name:"LtOp",pattern:/</}),P=d({name:"NeqOp",pattern:/<>/}),Q=[h,i,k,j,l,m,n,p,q,s,t,o,r,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,F,L,P,d({name:"GteOp",pattern:/>=/}),d({name:"LteOp",pattern:/<=/}),M,N,O],R=new e(Q,{ensureOptimizations:!0});Q.forEach(a=>{g[a.name]=a}),a.exports={tokenVocabulary:g,lex:function(a){let b=R.tokenize(a);if(b.errors.length>0){let c=b.errors[0],d=c.line,e=c.column,g="\n"+a.split("\n")[d-1]+"\n";throw c.message=(g+=Array(e-1).fill(" ").join("")+"^\n")+`Error at position ${d}:${e}
|
|
252
|
-
`+c.message,c.errorLocation={line:d,column:e},f.ERROR(c.message,c)}return b}}},410658:(a,b,c)=>{"use strict";c.d(b,{k:()=>f});var d=c(545343),e=c(845722);function f(a,b){let c=(0,d.q)(),f=b?.weekStartsOn??b?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,g=(0,e.a)(a,b?.in),h=g.getDay();return g.setDate(g.getDate()-(7*(h<f)+h-f)),g.setHours(0,0,0,0),g}},411202:(a,b,c)=>{"use strict";c.d(b,{a:()=>e});var d=c(347751);function e(a,b,c){return(0,d.P)(a,-b,c)}},413272:(a,b,c)=>{"use strict";c.d(b,{U:()=>T});var d=c(736927),e=c(115962),f=c(569607),g=c(626624),h=c(534487),i=c(355403),j=c(347751),k=c(411202);function l(a,b,c){return(0,j.P)(a,12*b,c)}var m=c(410658),n=c(545343),o=c(845722);function p(a,b){let c=(0,n.q)(),d=b?.weekStartsOn??b?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,e=(0,o.a)(a,b?.in),f=e.getDay();return e.setDate(e.getDate()+((f<d?-7:0)+6-(f-d))),e.setHours(23,59,59,999),e}function q(a,b){let c=(0,o.a)(a,b?.in);return c.setDate(1),c.setHours(0,0,0,0),c}function r(a,b){let c=(0,o.a)(a,b?.in),d=c.getMonth();return c.setFullYear(c.getFullYear(),d+1,0),c.setHours(23,59,59,999),c}var s=c(207346),t=c(712410),u=c(479466);function v(a,b,c){let[d,e]=(0,t.x)(c?.in,a,b);return+(0,u.o)(d)==+(0,u.o)(e)}var w=c(585698);function x(a,b,c){var d;let e=((0,o.a)(a)-(0,o.a)(b))/w.Cg;return(d=c?.roundingMethod,a=>{let b=(d?Math[d]:Math.trunc)(a);return 0===b?0:b})(e)}function y(a,b,c){let d=(0,o.a)(a,c?.in);return d.setTime(d.getTime()+b*w.Cg),d}function z(a,b,c){let[d,e]=(0,t.x)(c?.in,a,b);return d.getFullYear()===e.getFullYear()&&d.getMonth()===e.getMonth()}var A=c(502714);function B(a,b){var c;return v((0,A.w)(b?.in||a,a),(c=b?.in||a,(0,A.w)(c,Date.now())))}function C(a,b){return(0,o.a)(a,b?.in).getMinutes()}function D(a,b){return(0,o.a)(a,b?.in).getHours()}var E=c(999063),F=c(530858),G=c(18886),H=c(130526);function I(a){return null==a?"":"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):"object"==typeof a?JSON.stringify(a):""}function J(a){return(0,g.GP)(a,"yyyy-MM-dd")}function K(a){return a.toISOString()}function L(a,b,c){switch(b){case"day":return 1===c?(0,h.f)(a,1):(0,h.f)(a,-1,void 0);case"week":return 1===c?(0,i.J)(a,1):(0,i.J)(a,-1,void 0);case"month":return 1===c?(0,j.P)(a,1):(0,k.a)(a,1);case"year":return 1===c?l(a,1):l(a,-1,void 0)}}function M({event:a,compact:b,onClick:c,draggable:e,onDragStart:f}){let h=a.color??"var(--color-accent)";return(0,d.jsx)("button",{type:"button",draggable:e,onDragStart:f,onClick:a=>{a.stopPropagation(),c?.()},className:`text-left rounded px-1.5 truncate cursor-pointer transition-opacity hover:opacity-80 ${b?"text-[10px] py-0":"text-[11px] py-0.5"}`,style:{backgroundColor:h,color:"#fff",border:"none",width:"100%",lineHeight:b?"16px":"18px"},title:a.title,children:(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[!b&&(0,d.jsx)("span",{className:"opacity-70 shrink-0",children:(0,g.GP)(a.date,"HH:mm")}),a.faviconUrl&&(0,d.jsx)(G.A,{src:a.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.title||"Untitled"})]})})}function N({date:a,events:b,onEntryClick:c,onEntryDateChange:f}){let[i,j]=(0,e.useState)(null),k=(0,e.useRef)(null),l=q(a),n=r(a),o=(0,m.k)(l,{weekStartsOn:1}),t=p(n,{weekStartsOn:1}),w=(0,s.k)({start:o,end:t}),A=(0,e.useMemo)(()=>{let a=new Map;for(let c of b){let b=(0,g.GP)(c.date,"yyyy-MM-dd");if(a.has(b)||a.set(b,[]),a.get(b).push(c),c.endDate&&!v(c.date,c.endDate))for(let b of(0,s.k)({start:(0,h.f)(c.date,1),end:c.endDate})){let d=(0,g.GP)(b,"yyyy-MM-dd");a.has(d)||a.set(d,[]),a.get(d).push(c)}}return a},[b]),C=(0,e.useCallback)(a=>{k.current=a},[]),D=(0,e.useCallback)((a,b)=>{a.preventDefault(),j(b)},[]),E=(0,e.useCallback)((a,b)=>{a.preventDefault(),j(null);let c=k.current;if(!c||!f||v(c.date,b))return;let d=x((0,u.o)(b),(0,u.o)(c.date)),e=y(c.date,d),g={entryId:c.id,newDate:J(e)};c.endDate&&(g.newEndDate=J(y(c.endDate,d))),f(g),k.current=null},[f]),F=(0,e.useCallback)(()=>j(null),[]);return(0,d.jsxs)("div",{className:"w-full",children:[(0,d.jsx)("div",{className:"grid grid-cols-7 border-b",style:{borderColor:"var(--color-border)"},children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(a=>(0,d.jsx)("div",{className:"text-center text-[11px] font-medium py-2",style:{color:"var(--color-text-muted)"},children:a},a))}),(0,d.jsx)("div",{className:"grid grid-cols-7",children:w.map(b=>{let e=(0,g.GP)(b,"yyyy-MM-dd"),h=A.get(e)??[],j=z(b,a),k=B(b),l=i===e;return(0,d.jsxs)("div",{className:"min-h-[100px] border-b border-r p-1 transition-colors",style:{borderColor:"var(--color-border)",opacity:j?1:.4,background:l?"var(--color-accent-light, rgba(99,102,241,0.12))":k?"var(--color-surface-hover)":void 0},onDragOver:a=>D(a,e),onDragLeave:F,onDrop:a=>E(a,b),children:[(0,d.jsx)("div",{className:`text-[11px] mb-0.5 ${k?"font-bold":""}`,style:{color:k?"var(--color-accent)":"var(--color-text-muted)"},children:(0,g.GP)(b,"d")}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[h.slice(0,3).map(a=>(0,d.jsx)(M,{event:a,compact:!0,onClick:()=>c?.(a.id),draggable:!!f,onDragStart:()=>C(a)},a.id)),h.length>3&&(0,d.jsxs)("span",{className:"text-[10px] pl-1",style:{color:"var(--color-text-muted)"},children:["+",h.length-3," more"]})]})]},e)})})]})}function O({event:a,hourHeight:b,onEntryClick:c,onEntryDateChange:f}){let g=(0,e.useRef)(null),[h,i]=(0,e.useState)(null),j=(0,e.useRef)({y:0,startMinute:0,duration:0}),k=C(a.date)/60*b,l=a.endDate?Math.max(x(a.endDate,a.date),15):30,m=l/60*b,[n,o]=(0,e.useState)(0),[p,q]=(0,e.useState)(0),r=(0,e.useCallback)(b=>{f&&(b.preventDefault(),b.stopPropagation(),i("move"),j.current={y:b.clientY,startMinute:60*D(a.date)+C(a.date),duration:l},b.target.setPointerCapture(b.pointerId))},[f,a.date,l]),s=(0,e.useCallback)(a=>{f&&(a.preventDefault(),a.stopPropagation(),i("resize"),j.current={y:a.clientY,startMinute:0,duration:l},a.target.setPointerCapture(a.pointerId))},[f,l]),t=(0,e.useCallback)(a=>{if(!h)return;let b=a.clientY-j.current.y;"move"===h?o(b):q(b)},[h]),u=(0,e.useCallback)(c=>{if(!h||!f)return;let d=15*Math.round((c.clientY-j.current.y)/b*60/15);if("move"===h&&0!==d){let b=y(a.date,d),c={entryId:a.id,newDate:K(b)};a.endDate&&(c.newEndDate=K(y(a.endDate,d))),f(c)}else if("resize"===h&&0!==d){let b=y(a.endDate??y(a.date,l),d);b>a.date&&f({entryId:a.id,newDate:K(a.date),newEndDate:K(b)})}i(null),o(0),q(0)},[h,f,a,b,l]),v=k+("move"===h?n:0),w=Math.max(m+("resize"===h?p:0),15);return(0,d.jsxs)("div",{ref:g,className:"absolute left-0.5 right-0.5 rounded px-1 text-[10px] truncate select-none",style:{top:v,height:Math.min(w,6*b),backgroundColor:a.color??"var(--color-accent)",color:"#fff",lineHeight:"16px",zIndex:h?20:2,cursor:f?"move"===h?"grabbing":"grab":"pointer",opacity:h?.85:1,transition:h?"none":"top 0.15s, height 0.15s"},onPointerDown:r,onPointerMove:t,onPointerUp:u,onClick:b=>{h||(b.stopPropagation(),c?.(a.id))},title:a.title,children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[a.faviconUrl&&(0,d.jsx)(G.A,{src:a.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.title||"Untitled"})]}),f&&(0,d.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-2 cursor-ns-resize",style:{borderRadius:"0 0 4px 4px"},onPointerDown:s})]})}function P({date:a,events:b,onEntryClick:c,onEntryDateChange:f}){let i=(0,m.k)(a,{weekStartsOn:1}),j=(0,s.k)({start:i,end:(0,h.f)(i,6)}),k=Array.from({length:24},(a,b)=>b+0),l=(0,e.useMemo)(()=>{let a=new Map;for(let c of b){let b=(0,g.GP)(c.date,"yyyy-MM-dd");a.has(b)||a.set(b,[]),a.get(b).push(c)}return a},[b]);return(0,d.jsx)("div",{className:"w-full overflow-auto",style:{maxHeight:"calc(100vh - 280px)"},children:(0,d.jsxs)("div",{className:"grid",style:{gridTemplateColumns:"50px repeat(7, 1fr)"},children:[(0,d.jsx)("div",{className:"sticky top-0 z-10",style:{background:"var(--color-bg)"}}),j.map(a=>(0,d.jsxs)("div",{className:"sticky top-0 z-10 text-center py-2 border-b border-l text-[12px] font-medium",style:{borderColor:"var(--color-border)",background:"var(--color-bg)",color:B(a)?"var(--color-accent)":"var(--color-text)"},children:[(0,d.jsx)("div",{children:(0,g.GP)(a,"EEE")}),(0,d.jsx)("div",{className:`text-lg ${B(a)?"font-bold":""}`,children:(0,g.GP)(a,"d")})]},a.toISOString())),k.map(a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"text-[10px] text-right pr-2 pt-0.5",style:{color:"var(--color-text-muted)",height:60},children:(0,g.GP)(new Date(2e3,0,1,a),"ha")},`label-${a}`),j.map(b=>{let e=(0,g.GP)(b,"yyyy-MM-dd"),h=(l.get(e)??[]).filter(b=>D(b.date)===a);return(0,d.jsx)("div",{className:"border-b border-l relative",style:{borderColor:"var(--color-border)",height:60},children:h.map(a=>(0,d.jsx)(O,{event:a,hourHeight:60,onEntryClick:c,onEntryDateChange:f},a.id))},`${e}-${a}`)})]}))]})})}function Q({date:a,events:b,onEntryClick:c,onEntryDateChange:f}){let h=Array.from({length:24},(a,b)=>b+0),i=(0,e.useMemo)(()=>b.filter(b=>v(b.date,a)),[b,a]);return(0,d.jsx)("div",{className:"w-full overflow-auto",style:{maxHeight:"calc(100vh - 280px)"},children:(0,d.jsx)("div",{className:"grid",style:{gridTemplateColumns:"60px 1fr"},children:h.map(a=>{let b=i.filter(b=>D(b.date)===a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"text-[11px] text-right pr-3 pt-0.5",style:{color:"var(--color-text-muted)",height:60},children:(0,g.GP)(new Date(2e3,0,1,a),"h:mm a")},`label-${a}`),(0,d.jsx)("div",{className:"border-b border-l relative",style:{borderColor:"var(--color-border)",height:60},children:b.map(a=>(0,d.jsx)(O,{event:a,hourHeight:60,onEntryClick:c,onEntryDateChange:f},a.id))},`cell-${a}`)]})})})})}function R({date:a,events:b}){let c=(0,E.D)(a),f=function(a,b){let c=(0,o.a)(a,void 0),d=c.getFullYear();return c.setFullYear(d+1,0,0),c.setHours(23,59,59,999),c}(a),h=(0,F.i)({start:c,end:f}),i=(0,e.useMemo)(()=>{let a=new Map;for(let c of b){let b=c.date.getMonth();a.has(b)||a.set(b,[]),a.get(b).push(c)}return a},[b]);return(0,d.jsx)("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-4 p-2",children:h.map(a=>{let b=q(a),c=r(a),e=(0,m.k)(b,{weekStartsOn:1}),f=p(c,{weekStartsOn:1}),h=(0,s.k)({start:e,end:f}),j=i.get(a.getMonth())??[];return(0,d.jsxs)("div",{className:"rounded-lg border p-2",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"text-[12px] font-semibold mb-1",style:{color:"var(--color-text)"},children:(0,g.GP)(a,"MMMM")}),(0,d.jsxs)("div",{className:"grid grid-cols-7 gap-px",children:[["M","T","W","T","F","S","S"].map((a,b)=>(0,d.jsx)("div",{className:"text-[9px] text-center",style:{color:"var(--color-text-muted)"},children:a},b)),h.map(b=>{let c=z(b,a),e=B(b),f=j.some(a=>v(a.date,b));return(0,d.jsxs)("div",{className:"text-[9px] text-center py-0.5 relative",style:{color:c?e?"var(--color-accent)":"var(--color-text)":"transparent",fontWeight:e?700:400},children:[(0,g.GP)(b,"d"),f&&c&&(0,d.jsx)("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full",style:{backgroundColor:"var(--color-accent)"}})]},b.toISOString())})]}),j.length>0&&(0,d.jsxs)("div",{className:"mt-1 text-[10px]",style:{color:"var(--color-text-muted)"},children:[j.length," event",1!==j.length?"s":""]})]},a.toISOString())})})}function S({reason:a}){return(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 gap-2",children:[(0,d.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",style:{color:"var(--color-text-muted)",opacity:.4},children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),(0,d.jsx)("path",{d:"M16 2v4"}),(0,d.jsx)("path",{d:"M8 2v4"}),(0,d.jsx)("path",{d:"M3 10h18"})]}),(0,d.jsx)("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"no-date-field"===a?"No date field configured for calendar view. Open view settings to select one.":"No events to display in this range."})]})}function T({objectName:a,fields:b,entries:c,dateField:h,endDateField:i,mode:j,onModeChange:k,members:l,onEntryClick:n,onEntryDateChange:o}){let[q,r]=(0,e.useState)(()=>new Date),s=(0,e.useMemo)(()=>(function(a,b,c,d){let e=[];for(let g of a){let a=I(g[c]);if(a)try{let c,h=(0,f.H)(a);if(Number.isNaN(h.getTime()))continue;if(d){let a=I(g[d]);if(a){let b=(0,f.H)(a);Number.isNaN(b.getTime())||(c=b)}}e.push({id:I(g.entry_id??g.id),title:function(a,b){let c=b.find(a=>"text"===a.type&&/name|title/i.test(a.name))??b.find(a=>"text"===a.type);return c?I(a[c.name]):I(a.id)}(g,b),faviconUrl:(0,H.I)(g,b)?.faviconUrl,date:h,endDate:c,entry:g,color:function(a,b){let c=b.find(a=>"enum"===a.type&&a.enum_colors?.length);if(!c)return;let d=I(a[c.name]),e=c.enum_values?.indexOf(d)??-1;return e>=0?c.enum_colors[e]:void 0}(g,b)})}catch{}}return e})(c,b,h,i),[c,b,h,i]),t=(0,e.useCallback)(()=>r(a=>L(a,j,-1)),[j]),u=(0,e.useCallback)(()=>r(a=>L(a,j,1)),[j]),v=(0,e.useCallback)(()=>r(new Date),[]);return h?(0,d.jsxs)("div",{className:"w-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-3 px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-md hover:bg-[var(--color-surface-hover)] transition-colors",style:{color:"var(--color-text)"},children:(0,d.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,d.jsx)("path",{d:"m15 18-6-6 6-6"})})}),(0,d.jsx)("button",{type:"button",onClick:u,className:"p-1.5 rounded-md hover:bg-[var(--color-surface-hover)] transition-colors",style:{color:"var(--color-text)"},children:(0,d.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,d.jsx)("path",{d:"m9 18 6-6-6-6"})})}),(0,d.jsx)("button",{type:"button",onClick:v,className:"text-[12px] px-2.5 py-1 rounded-md border hover:bg-[var(--color-surface-hover)] transition-colors",style:{color:"var(--color-text)",borderColor:"var(--color-border)"},children:"Today"}),(0,d.jsx)("h3",{className:"text-sm font-semibold ml-2",style:{color:"var(--color-text)"},children:function(a,b){switch(b){case"day":return(0,g.GP)(a,"EEEE, MMMM d, yyyy");case"week":{let b=(0,m.k)(a,{weekStartsOn:1}),c=p(a,{weekStartsOn:1});return`${(0,g.GP)(b,"MMM d")} - ${(0,g.GP)(c,"MMM d, yyyy")}`}case"month":return(0,g.GP)(a,"MMMM yyyy");case"year":return(0,g.GP)(a,"yyyy")}}(q,j)})]}),(0,d.jsx)("div",{className:"flex rounded-lg border overflow-hidden",style:{borderColor:"var(--color-border)"},children:["day","week","month","year"].map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>k(a),className:"text-[11px] px-3 py-1 capitalize transition-colors",style:{background:a===j?"var(--color-accent)":"var(--color-surface)",color:a===j?"#fff":"var(--color-text-muted)",borderRight:"year"!==a?"1px solid var(--color-border)":void 0},children:a},a))})]}),(0,d.jsxs)("div",{className:"rounded-lg border overflow-hidden",style:{borderColor:"var(--color-border)",background:"var(--color-bg)"},children:["month"===j&&(0,d.jsx)(N,{date:q,events:s,onEntryClick:n,onEntryDateChange:o}),"week"===j&&(0,d.jsx)(P,{date:q,events:s,onEntryClick:n,onEntryDateChange:o}),"day"===j&&(0,d.jsx)(Q,{date:q,events:s,onEntryClick:n,onEntryDateChange:o}),"year"===j&&(0,d.jsx)(R,{date:q,events:s})]})]}):(0,d.jsx)(S,{reason:"no-date-field"})}},415182:(a,b,c)=>{"use strict";c.d(b,{R:()=>m});var d=c(736927),e=c(115962),f=c(327629),g=c(23581),h=c(843572),i=c(970093);function j({logo:a,name:b,slug:c}){let[f,g]=(0,e.useState)(!1),h=(0,i.m9)({toolkitSlug:c,toolkitName:b,initialLogo:a}),j=h.logo&&!f;return(0,d.jsx)("div",{className:"flex h-12 w-12 items-center justify-center overflow-hidden rounded-xl",style:{background:"var(--color-surface-hover)",border:"1px solid var(--color-border)"},children:j?(0,d.jsx)("img",{src:h.logo??void 0,alt:"",className:"h-8 w-8 object-contain",decoding:"async",onError:()=>g(!0)}):(0,d.jsx)("span",{className:"text-base font-semibold uppercase",style:{color:"var(--color-text-muted)"},children:b.slice(0,2)})})}function k(a){return({OAUTH2:"OAuth 2.0",OAUTH1:"OAuth 1.0",API_KEY:"API Key",BASIC:"Basic Auth",BEARER_TOKEN:"Bearer Token",JWT:"JWT",NO_AUTH:"No Auth"})[a]??a.replace(/_/g," ")}function l(a){let b=Date.parse(a);return Number.isFinite(b)?new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(b):"Connected recently"}function m({toolkit:a,connections:b,open:c,preferredAction:i,onOpenChange:m,onConnectionChange:n}){let[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w=(0,e.useRef)(!1),x=(0,e.useMemo)(()=>(0,h.eF)(b),[b]),y=(0,e.useMemo)(()=>x.filter(a=>a.is_active),[x]),z=y.length>0,A=i??(z?"connect":x.length>0?"reconnect":"connect"),B=(0,e.useCallback)(()=>{null!==v.current&&(window.clearInterval(v.current),v.current=null)},[]),C=(0,e.useCallback)(()=>{B(),u.current=null,w.current=!1},[B]),D=(0,e.useCallback)(async()=>{if(a){p(!0),t(null),C();try{let b=await fetch("/api/composio/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolkit:a.connect_slug??a.slug})}),c=await b.json();if(!b.ok)throw Error(c.error??"Failed to start connection.");let d=window.open(c.redirect_url,"_blank","popup=yes,width=560,height=720,resizable=yes,scrollbars=yes");if(!d)throw Error("Popup was blocked. Please allow popups and try again.");u.current=d,w.current=!1,d.focus?.(),v.current=window.setInterval(()=>{let b=u.current;b&&b.closed&&(B(),u.current=null,p(!1),w.current||(n({toolkit:a}),m(!1)))},500)}catch(a){p(!1),t(a instanceof Error?a.message:"Failed to connect.")}}},[C,n,m,B,a]),E=(0,e.useCallback)(async b=>{r(b),t(null);try{let c=await fetch("/api/composio/disconnect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connection_id:b})}),d=await c.json();if(!c.ok)throw Error(d.error??"Failed to disconnect.");n({toolkit:a,connected:!1})}catch(a){t(a instanceof Error?a.message:"Failed to disconnect.")}finally{r(null)}},[n]);if(!a)return null;let F=a.auth_schemes.length>0?a.auth_schemes.map(k).join(", "):null;return(0,d.jsx)(g.lG,{open:c,onOpenChange:m,children:(0,d.jsxs)(g.Cf,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-6 pt-6 pb-4",style:{borderBottom:"1px solid var(--color-border)"},children:[(0,d.jsx)(g.c7,{className:"space-y-0",children:(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)(j,{logo:a.logo,name:a.name,slug:a.slug}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)(g.L3,{className:"text-lg leading-tight",children:a.name}),a.description&&(0,d.jsx)(g.rr,{className:"mt-1 text-[13px] leading-relaxed line-clamp-2",children:a.description})]})]})}),(0,d.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[a.tools_count>0&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:[(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),a.tools_count," tool",1!==a.tools_count?"s":""]}),F&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:[(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,d.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),F]}),z&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium",style:{background:"rgba(16, 185, 129, 0.1)",color:"rgb(74 222 128)",border:"1px solid rgba(16, 185, 129, 0.2)"},children:[(0,d.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})}),y.length," connected"]})]}),a.categories.length>0&&(0,d.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:a.categories.slice(0,5).map(a=>(0,d.jsx)("span",{className:"rounded-full px-2 py-0.5 text-[11px]",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:a},a))})]}),(0,d.jsxs)("div",{className:"px-6 py-4 space-y-3 max-h-[340px] overflow-y-auto",children:[s&&(0,d.jsx)("div",{className:"rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-red-300",children:s}),x.length>0?(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Connections"}),(0,d.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[x.length," total"]})]}),x.map((a,b)=>{let c=a.is_active?"Disconnect":"Remove",e=a.is_same_account_reconnect,g="gateway_stable_id"!==a.account_identity_source;return(0,d.jsx)("div",{className:"rounded-xl border px-3 py-3",style:{borderColor:a.is_active?"rgba(16, 185, 129, 0.22)":"var(--color-border)",background:a.is_active?"rgba(16, 185, 129, 0.05)":"var(--color-surface-hover)"},children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:a.display_label}),(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:a.is_active?"rgba(16, 185, 129, 0.15)":"var(--color-background)",color:a.is_active?"rgb(74 222 128)":"var(--color-text-muted)",border:a.is_active?"1px solid rgba(16, 185, 129, 0.24)":"1px solid var(--color-border)"},children:a.normalized_status})]}),(0,d.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground",children:a.account_email||a.account_name||a.account_label?`Added ${l(a.created_at)}`:`Connection ${b+1} \xb7 Added ${l(a.created_at)}`}),(e||g)&&(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[e&&(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:"rgba(96, 165, 250, 0.12)",color:"rgb(147 197 253)",border:"1px solid rgba(96, 165, 250, 0.2)"},children:"Same account reconnected"}),g&&(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:"var(--color-background)",color:"var(--color-text-muted)",border:"1px solid var(--color-border)"},children:"Identity inferred"})]})]}),(0,d.jsx)(f.$,{variant:"outline",size:"sm",onClick:()=>void E(a.id),disabled:q===a.id,children:q===a.id?`${c}...`:c})]})},a.id)})]}):(0,d.jsxs)("div",{className:"px-3 py-5 text-center text-sm",style:{color:"#a3a3a3"},children:["No accounts connected yet. Connect your ",a.name," account to get started."]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2 px-6 py-4",style:{borderTop:"1px solid var(--color-border)"},children:[(0,d.jsx)("button",{type:"button",className:"rounded-full px-4 py-1.5 text-sm font-medium transition-all bg-stone-100 hover:bg-stone-200/50",style:{color:"#57534e"},onClick:()=>m(!1),children:"Close"}),(0,d.jsx)("button",{type:"button",className:"rounded-full px-4 py-1.5 text-sm font-medium",style:{background:"var(--color-accent)",color:"#fff"},onClick:()=>void D(),disabled:o,children:o?"Waiting for authorization...":"reconnect"===A?`Reconnect ${a.name}`:z?"Connect another account":`Connect ${a.name}`})]})]})})}},416170:(a,b,c)=>{"use strict";c.d(b,{a:()=>e});var d=c(115962);function e(a=768){let[b,c]=(0,d.useState)(!1);return b}},418398:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(250367).nA},419121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},421683:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(972182),e=c(764256),f=c(783037);b.last=function(a){if(f.isArrayLike(a))return d.last(e.toArray(a))}},422623:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(143116);b.debounce=function(a,b=0,c={}){let e;"object"!=typeof c&&(c={});let{leading:f=!1,trailing:g=!0,maxWait:h}=c,i=[,,];f&&(i[0]="leading"),g&&(i[1]="trailing");let j=null,k=d.debounce(function(...b){e=a.apply(this,b),j=null},b,{edges:i}),l=function(...b){return null!=h&&(null===j&&(j=Date.now()),Date.now()-j>=h)?(e=a.apply(this,b),j=Date.now(),k.cancel(),k.schedule(),e):(k.apply(this,b),e)};return l.cancel=k.cancel,l.flush=()=>(k.flush(),e),l}},422703:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>f});var d=c(720511),e=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,f=d.bP.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:a}){return["img",(0,d.KV)(this.options.HTMLAttributes,a)]},parseMarkdown:(a,b)=>b.createNode("image",{src:a.href,title:a.title,alt:a.text}),renderMarkdown:a=>{var b,c,d,e,f,g;let h=null!=(c=null==(b=a.attrs)?void 0:b.src)?c:"",i=null!=(e=null==(d=a.attrs)?void 0:d.alt)?e:"",j=null!=(g=null==(f=a.attrs)?void 0:f.title)?g:"";return j?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"undefined"==typeof document)return null;let{directions:a,minWidth:b,minHeight:c,alwaysPreserveAspectRatio:e}=this.options.resize;return({node:f,getPos:g,HTMLAttributes:h,editor:i})=>{let j=document.createElement("img");Object.entries(h).forEach(([a,b])=>{if(null!=b)switch(a){case"width":case"height":break;default:j.setAttribute(a,b)}}),j.src=h.src;let k=new d.Nz({element:j,editor:i,node:f,getPos:g,onResize:(a,b)=>{j.style.width=`${a}px`,j.style.height=`${b}px`},onCommit:(a,b)=>{let c=g();void 0!==c&&this.editor.chain().setNodeSelection(c).updateAttributes(this.name,{width:a,height:b}).run()},onUpdate:(a,b,c)=>a.type===f.type,options:{directions:a,min:{width:b,height:c},preserveAspectRatio:!0===e}}),l=k.dom;return l.style.visibility="hidden",l.style.pointerEvents="none",j.onload=()=>{l.style.visibility="",l.style.pointerEvents=""},k}},addCommands(){return{setImage:a=>({commands:b})=>b.insertContent({type:this.name,attrs:a})}},addInputRules(){return[(0,d.jT)({find:e,type:this.type,getAttributes:a=>{let[,,b,c,d]=a;return{src:c,alt:b,title:d}}})]}})},423721:(a,b,c)=>{"use strict";c.d(b,{dc:()=>f,VG:()=>g});var d=c(348445);let e=[],f=!1;function g(a,b,c,g){let h;"function"==typeof b&&"function"!=typeof c?(g=c,c=b):h=b;let i=(0,d.C)(h),j=g?-1:1;(function a(d,h,k){let l=d&&"object"==typeof d?d:{};if("string"==typeof l.type){let a="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(m,"name",{value:"node (\x1b[33m"+d.type+(a?"<"+a+">":"")+"\x1b[39m)"})}return m;function m(){var l;let m,n,o,p=e;if((!b||i(d,h,k[k.length-1]||void 0))&&(p=Array.isArray(l=c(d,k))?l:"number"==typeof l?[!0,l]:null==l?e:[l])[0]===f)return p;if("children"in d&&d.children&&d.children&&"skip"!==p[0])for(n=(g?d.children.length:-1)+j,o=k.concat(d);n>-1&&n<d.children.length;){if((m=a(d.children[n],n,o)())[0]===f)return m;n="number"==typeof m[1]?m[1]:n+j}return p}})(a,void 0,[])()}},423932:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],f=(0,d.A)("globe",e)},430083:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"unstable_rethrow",{enumerable:!0,get:function(){return d}});let d=c(301154).unstable_rethrow;("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},430792:(a,b,c)=>{"use strict";c.d(b,{hO:()=>i,sG:()=>h});var d=c(115962),e=c(249855),f=c(988447),g=c(736927),h=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((a,b)=>{let c=(0,f.TL)(`Primitive.${b}`),e=d.forwardRef((a,d)=>{let{asChild:e,...f}=a;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(e?c:b,{...f,ref:d})});return e.displayName=`Primitive.${b}`,{...a,[b]:e}},{});function i(a,b){a&&e.flushSync(()=>a.dispatchEvent(b))}},437503:(a,b,c)=>{"use strict";c.d(b,{X:()=>g});var d=c(736927),e=c(115962);let f=["#fda4af","#fbcfe8","#d8b4fe","#a5b4fc","#93c5fd","#7dd3fc","#67e8f9","#5eead4","#86efac","#bef264","#fde68a","#fdba74","#fca5a5"];function g({src:a,name:b,seed:c,size:g="md",className:i="",onError:j}){let[k,l]=(0,e.useState)(!1),m=function(a,b){let c=function(a){if(!a||"string"!=typeof a)return"?";let b=a.trim();if(!b)return"?";let c=b;if(b.includes("@")){let a=b.slice(0,b.indexOf("@"));a&&(c=a)}if(!(c=c.replace(/[._+-]/g," ").trim()))return"?";let d=c.split(/\s+/).filter(Boolean);if(0===d.length)return"?";if(1===d.length)return(d[0].charAt(0)||"?").toUpperCase();let e=d[0].charAt(0),f=d[d.length-1].charAt(0);return`${e}${f}`.toUpperCase()}(a);return{initials:c,background:function(a){let b=(a??"").trim();if(!b)return f[0];let c=0x811c9dc5;for(let a=0;a<b.length;a+=1)c^=b.charCodeAt(a),c=Math.imul(c,0x1000193);let d=Math.abs(c)%f.length;return f[d]}(b??a??""),foreground:"#0c0a09"}}(b??null,c??void 0),n=h[g],o=Math.max(10,Math.round(.4*n)),p=!!a&&!k;return(0,d.jsx)("span",{className:`inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 ${i}`,style:{width:n,height:n,background:p?"transparent":m.background,color:m.foreground,fontSize:o,fontWeight:600,lineHeight:1},"aria-label":b??"Avatar",children:p?(0,d.jsx)("img",{src:a??void 0,alt:b??"",width:n,height:n,decoding:"async",loading:"lazy",onError:()=>{l(!0),j?.()},style:{width:"100%",height:"100%",objectFit:"cover"}}):m.initials})}let h={sm:24,md:36,lg:48,xl:64}},438899:(a,b)=>{"use strict";function c(a){return a.split("/").map(a=>encodeURIComponent(a)).join("/")}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"encodeURIPath",{enumerable:!0,get:function(){return c}})},439384:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isObject=function(a){return null!==a&&("object"==typeof a||"function"==typeof a)}},441204:a=>{"use strict";a.exports=require("string_decoder")},442184:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],f=(0,d.A)("workflow",e)},444949:(a,b,c)=>{"use strict";c.d(b,{q:()=>f});var d=c(736927);let e=[{min:500,label:"Inner circle",color:"#6366f1",rank:4},{min:100,label:"Strong",color:"#22c55e",rank:3},{min:20,label:"Active",color:"#3b82f6",rank:2},{min:1,label:"Weak",color:"#f59e0b",rank:1},{min:0,label:"Cold",color:"#94a3b8",rank:0}];function f({score:a,size:b="md",showLabel:c=!0}){let f=function(a){let b="string"==typeof a?Number(a):a??0;if(!Number.isFinite(b)||b<0){let a=e[e.length-1];return{label:a.label,color:a.color,rank:a.rank}}for(let a of e)if(b>=a.min)return{label:a.label,color:a.color,rank:a.rank};let c=e[e.length-1];return{label:c.label,color:c.color,rank:c.rank}}(a),g="sm"===b?6:8;return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)",padding:"sm"===b?"1px 6px":"2px 8px",fontSize:"sm"===b?10:11,lineHeight:1.4},title:`Connection strength: ${f.label}`,children:[(0,d.jsx)("span",{"aria-hidden":!0,style:{width:g,height:g,borderRadius:99,background:f.color,flexShrink:0}}),c&&f.label]})}},450846:(a,b,c)=>{"use strict";c.d(b,{Kh:()=>d,Ms:()=>f,Mu:()=>v,Xc:()=>r,aW:()=>h,db:()=>g,hh:()=>u,iS:()=>t,os:()=>s,ri:()=>q});let d=["table","kanban","calendar","timeline","gallery","list"];function e(a){return"string"==typeof a&&d.includes(a)}function f(a,b,c){return a?.view_type&&e(a.view_type)?a.view_type:b&&e(b)?b:c&&e(c)?c:"table"}function g(a,b){if(!b)return a??{};if(!a)return b;let c={...b};for(let b of Object.keys(a)){let d=a[b];void 0!==d&&(c[b]=d)}return c}function h(a,b,c){switch(b){case"kanbanField":return c.find(a=>"enum"===a.type&&/status/i.test(a.name))?.name??c.find(a=>"enum"===a.type)?.name;case"calendarDateField":case"timelineStartField":return c.find(a=>"date"===a.type&&/due|start|begin/i.test(a.name))?.name??c.find(a=>"date"===a.type)?.name;case"calendarEndDateField":case"timelineEndField":return c.find(a=>"date"===a.type&&/end|finish|close/i.test(a.name))?.name;case"timelineGroupField":return c.find(a=>"enum"===a.type)?.name;case"galleryTitleField":case"listTitleField":return c.find(a=>"text"===a.type&&/name|title/i.test(a.name))?.name??c.find(a=>"text"===a.type)?.name;case"galleryCoverField":default:return;case"listSubtitleField":return c.find(a=>"text"===a.type&&!/name|title/i.test(a.name))?.name}}let i=[{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],j=[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},...i],k=[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},...i],l=[{value:"on",label:"is"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"date_between",label:"between"},{value:"relative_past",label:"in the last"},{value:"relative_next",label:"in the next"},...i],m=[{value:"is",label:"is"},{value:"is_not",label:"is not"},{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},...i],n=[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},...i],o=[{value:"has_any",label:"has any of"},{value:"has_none",label:"has none of"},{value:"has_all",label:"has all of"},...i],p=[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},...i];function q(a){switch(a){case"text":case"richtext":case"email":default:return j;case"number":return k;case"date":return l;case"enum":return m;case"boolean":return n;case"relation":case"user":return o;case"tags":return p}}function r(a){switch(a){case"text":case"richtext":case"email":case"tags":default:return"contains";case"number":return"eq";case"date":return"relative_past";case"enum":return"is";case"boolean":return"is_true";case"relation":case"user":return"has_any"}}function s(a){return"conjunction"in a&&"rules"in a}function t(a){return btoa(JSON.stringify(a))}function u(){return{id:"root",conjunction:"and",rules:[]}}function v(){return Math.random().toString(36).slice(2,9)}},452171:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(139957),e=c(266196),f=c(606461),g=c(958961),h=c(618515);function i(a,b,c,d=new Map,k){let l=k?.(a,b,c,d);if(void 0!==l)return l;if(g.isPrimitive(a))return a;if(d.has(a))return d.get(a);if(Array.isArray(a)){let b=Array(a.length);d.set(a,b);for(let e=0;e<a.length;e++)b[e]=i(a[e],e,c,d,k);return Object.hasOwn(a,"index")&&(b.index=a.index),Object.hasOwn(a,"input")&&(b.input=a.input),b}if(a instanceof Date)return new Date(a.getTime());if(a instanceof RegExp){let b=new RegExp(a.source,a.flags);return b.lastIndex=a.lastIndex,b}if(a instanceof Map){let b=new Map;for(let[e,f]of(d.set(a,b),a))b.set(e,i(f,e,c,d,k));return b}if(a instanceof Set){let b=new Set;for(let e of(d.set(a,b),a))b.add(i(e,void 0,c,d,k));return b}if("undefined"!=typeof Buffer&&Buffer.isBuffer(a))return a.subarray();if(h.isTypedArray(a)){let b=new(Object.getPrototypeOf(a)).constructor(a.length);d.set(a,b);for(let e=0;e<a.length;e++)b[e]=i(a[e],e,c,d,k);return b}if(a instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&a instanceof SharedArrayBuffer)return a.slice(0);if(a instanceof DataView){let b=new DataView(a.buffer.slice(0),a.byteOffset,a.byteLength);return d.set(a,b),j(b,a,c,d,k),b}if("undefined"!=typeof File&&a instanceof File){let b=new File([a],a.name,{type:a.type});return d.set(a,b),j(b,a,c,d,k),b}if("undefined"!=typeof Blob&&a instanceof Blob){let b=new Blob([a],{type:a.type});return d.set(a,b),j(b,a,c,d,k),b}if(a instanceof Error){let b=new a.constructor;return d.set(a,b),b.message=a.message,b.name=a.name,b.stack=a.stack,b.cause=a.cause,j(b,a,c,d,k),b}if(a instanceof Boolean){let b=new Boolean(a.valueOf());return d.set(a,b),j(b,a,c,d,k),b}if(a instanceof Number){let b=new Number(a.valueOf());return d.set(a,b),j(b,a,c,d,k),b}if(a instanceof String){let b=new String(a.valueOf());return d.set(a,b),j(b,a,c,d,k),b}if("object"==typeof a&&function(a){switch(e.getTag(a)){case f.argumentsTag:case f.arrayTag:case f.arrayBufferTag:case f.dataViewTag:case f.booleanTag:case f.dateTag:case f.float32ArrayTag:case f.float64ArrayTag:case f.int8ArrayTag:case f.int16ArrayTag:case f.int32ArrayTag:case f.mapTag:case f.numberTag:case f.objectTag:case f.regexpTag:case f.setTag:case f.stringTag:case f.symbolTag:case f.uint8ArrayTag:case f.uint8ClampedArrayTag:case f.uint16ArrayTag:case f.uint32ArrayTag:return!0;default:return!1}}(a)){let b=Object.create(Object.getPrototypeOf(a));return d.set(a,b),j(b,a,c,d,k),b}return a}function j(a,b,c=a,e,f){let g=[...Object.keys(b),...d.getSymbols(b)];for(let d=0;d<g.length;d++){let h=g[d],j=Object.getOwnPropertyDescriptor(a,h);(null==j||j.writable)&&(a[h]=i(b[h],h,c,e,f))}}b.cloneDeepWith=function(a,b){return i(a,void 0,a,new Map,b)},b.cloneDeepWithImpl=i,b.copyProperties=j},455511:a=>{"use strict";a.exports=require("crypto")},461821:(a,b,c)=>{"use strict";c.d(b,{A:()=>f,z:()=>e});var d=c(720511),e=d.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:a=>!!a.includes("underline")&&{}}],renderHTML({HTMLAttributes:a}){return["u",(0,d.KV)(this.options.HTMLAttributes,a),0]},parseMarkdown(a,b){return b.applyMark(this.name||"underline",b.parseInline(a.tokens||[]))},renderMarkdown:(a,b)=>`++${b.renderChildren(a)}++`,markdownTokenizer:{name:"underline",level:"inline",start:a=>a.indexOf("++"),tokenize(a,b,c){let d=/^(\+\+)([\s\S]+?)(\+\+)/.exec(a);if(!d)return;let e=d[2].trim();return{type:"underline",raw:d[0],text:e,tokens:c.inlineTokens(e)}}},addCommands(){return{setUnderline:()=>({commands:a})=>a.setMark(this.name),toggleUnderline:()=>({commands:a})=>a.toggleMark(this.name),unsetUnderline:()=>({commands:a})=>a.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),f=e},463912:(a,b,c)=>{"use strict";c.d(b,{j:()=>k});var d=c(736927),e=c(115962);function f(a){if(a<=0)return"now";let b=Math.ceil(a/1e3);if(b<60)return`${b}s`;let c=Math.floor(b/60),d=b%60;if(c<60)return d>0?`${c}m ${d}s`:`${c}m`;let e=Math.floor(c/60),f=c%60;return f>0?`${e}h ${f}m`:`${e}h`}function g(a){return a<1e3?`${a}ms`:a<6e4?`${(a/1e3).toFixed(1)}s`:`${Math.floor(a/6e4)}m ${Math.floor(a%6e4/1e3)}s`}function h(a){switch(a){case"ok":return"var(--color-success, #22c55e)";case"running":return"var(--color-accent)";case"error":return"var(--color-error, #ef4444)";case"disabled":default:return"var(--color-text-muted)";case"skipped":return"var(--color-warning, #f59e0b)"}}function i(a){let[b,c]=(0,e.useState)(Date.now());return a?f(a-b):null}let j=[{id:"overview",label:"Overview"},{id:"calendar",label:"Calendar"},{id:"insights",label:"Insights"}];function k({onSelectJob:a,onSendCommand:b,activeView:c="overview",onViewChange:f,calendarMode:g="month",onCalendarModeChange:h,calendarDate:k,onCalendarDateChange:m}){let[n,o]=(0,e.useState)([]),[p,q]=(0,e.useState)({intervalMs:18e5,nextDueEstimateMs:null}),[r,t]=(0,e.useState)({enabled:!1,nextWakeAtMs:null}),[u,v]=(0,e.useState)(!0),[w,y]=(0,e.useState)([]);(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cron/jobs"),b=await a.json();o(b.jobs??[]),q(b.heartbeat??{intervalMs:18e5,nextDueEstimateMs:null}),t(b.cronStatus??{enabled:!1,nextWakeAtMs:null});let c=(b.jobs??[]).map(a=>a.id).map(async a=>{try{let b=await fetch(`/api/cron/jobs/${encodeURIComponent(a)}/runs?limit=50`);return(await b.json()).entries??[]}catch{return[]}}),d=await Promise.all(c);y(d.flat().toSorted((a,b)=>b.ts-a.ts))}catch{}finally{v(!1)}},[]);let z=i(p.nextDueEstimateMs),A=i(r.nextWakeAtMs);if(u)return(0,d.jsx)("div",{className:"flex items-center justify-center h-full p-8",children:(0,d.jsx)("div",{className:"w-6 h-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})});let B=n.filter(a=>a.enabled),C=n.filter(a=>!a.enabled);return(0,d.jsxs)("div",{className:"p-6 max-w-5xl mx-auto",children:[(0,d.jsx)("div",{className:"flex items-end justify-between mb-6",children:(0,d.jsxs)("div",{children:[(0,d.jsx)("h1",{className:"font-instrument text-3xl tracking-tight mb-1",style:{color:"var(--color-text)"},children:"Cron"}),(0,d.jsxs)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:[B.length," active job",1!==B.length?"s":"",C.length>0&&` / ${C.length} disabled`]})]})}),(0,d.jsx)("div",{className:"flex items-center gap-1 mb-6 rounded-xl p-1",style:{background:"var(--color-surface-hover)"},children:j.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>f?.(a.id),className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-all cursor-pointer",style:{background:c===a.id?"var(--color-surface)":"transparent",color:c===a.id?"var(--color-text)":"var(--color-text-muted)",boxShadow:c===a.id?"var(--shadow-sm)":"none"},children:a.label},a.id))}),"overview"===c&&(0,d.jsx)(l,{jobs:n,enabledJobs:B,disabledJobs:C,heartbeatCountdown:z,heartbeat:p,cronWakeCountdown:A,onSelectJob:a,onSendCommand:b}),"calendar"===c&&(0,d.jsx)(s,{jobs:n,allRuns:w,mode:g,onModeChange:h,dateAnchor:k,onDateChange:m,onSelectJob:a}),"insights"===c&&(0,d.jsx)(x,{jobs:n,allRuns:w,onSelectJob:a})]})}function l({jobs:a,enabledJobs:b,disabledJobs:c,heartbeatCountdown:e,heartbeat:g,cronWakeCountdown:h,onSelectJob:i,onSendCommand:j}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:[(0,d.jsx)(z,{title:"Heartbeat",icon:(0,d.jsx)(D,{}),value:e?`in ${e}`:"unknown",subtitle:`Interval: ${f(g.intervalMs)}`}),(0,d.jsx)(z,{title:"Cron Scheduler",icon:(0,d.jsx)(E,{}),value:h?`next in ${h}`:0===a.length?"no jobs":"idle",subtitle:`${b.length} active / ${a.length} total jobs`}),(0,d.jsx)(z,{title:"Active Runs",icon:(0,d.jsx)(F,{}),value:`${a.filter(a=>a.state.runningAtMs).length}`,subtitle:(()=>{let b=a.filter(a=>a.state.runningAtMs),c=a.filter(a=>"error"===a.state.lastStatus).length;return b.length>0?b.map(a=>a.name).join(", "):c>0?`${c} with errors`:"All clear"})()})]}),(0,d.jsx)(A,{jobs:b}),(0,d.jsx)(B,{jobs:[...b,...c],onSelectJob:i,onSendCommand:j})]})}function m(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function n(a){let b=m(a);return b.setDate(b.getDate()-b.getDay()),b}function o(a,b){let c=m(a);return c.setDate(c.getDate()+b),c}function p(a){return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`}function q(a,b,c){let d=new Set;for(let e of a.split(",")){let a=e.match(/^(.+)\/(\d+)$/),f=a?parseInt(a[2],10):1,g=a?a[1]:e;if("*"===g)for(let a=b;a<=c;a+=f)d.add(a);else if(g.includes("-")){let[a,b]=g.split("-").map(Number);for(let c=a;c<=b;c+=f)d.add(c)}else d.add(parseInt(g,10))}return[...d].filter(a=>a>=b&&a<=c).sort((a,b)=>a-b)}function r({ev:a,onSelectJob:b}){let c=new Date(a.at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if("scheduled"===a.kind)return(0,d.jsxs)("button",{type:"button",onClick:()=>b(a.job.id),className:"w-full text-left text-[10px] px-1.5 py-0.5 rounded truncate cursor-pointer",style:{background:"color-mix(in srgb, var(--color-accent) 15%, transparent)",color:"var(--color-accent)"},title:`Scheduled: ${a.job.name} at ${c}`,children:[c," ",a.job.name]});let e="ok"===a.run.status?"var(--color-success, #22c55e)":"error"===a.run.status?"var(--color-error, #ef4444)":"var(--color-text-muted)";return(0,d.jsxs)("button",{type:"button",onClick:()=>a.job&&b(a.job.id),className:"w-full text-left text-[10px] px-1.5 py-0.5 rounded truncate flex items-center gap-1 cursor-pointer",style:{background:`color-mix(in srgb, ${e} 10%, transparent)`,color:e},title:`${a.run.status??"finished"}: ${a.job?.name??a.run.jobId} at ${c}`,children:[(0,d.jsx)("span",{className:"w-1 h-1 rounded-full flex-shrink-0",style:{background:e}}),(0,d.jsxs)("span",{className:"truncate",children:[c," ",a.job?.name??a.run.jobId.slice(0,8)]})]})}function s({jobs:a,allRuns:b,mode:c="month",onModeChange:f,dateAnchor:g,onDateChange:h,onSelectJob:i}){let j=function(a){if(!a)return null;let b=a.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(b)return new Date(Number(b[1]),Number(b[2])-1,Number(b[3]));let c=new Date(a);return Number.isNaN(c.getTime())?null:m(c)}(g)??m(new Date),k=a=>{let b="month"===c?function(a,b){let c=new Date(a.getFullYear(),a.getMonth(),1);c.setMonth(c.getMonth()+b);let d=new Date(c.getFullYear(),c.getMonth()+1,0).getDate();return c.setDate(Math.min(a.getDate(),d)),c}(j,a):"week"===c?o(j,7*a):"day"===c?o(j,a):function(a,b){let c=new Date(a.getFullYear()+b,a.getMonth(),1),d=new Date(c.getFullYear(),c.getMonth()+1,0).getDate();return c.setDate(Math.min(a.getDate(),d)),c}(j,a);h?.(p(b))},l=(0,e.useMemo)(()=>{let b=new Map;for(let c of a)b.set(c.id,c);return b},[a]),{rangeFrom:r,rangeTo:s}=(0,e.useMemo)(()=>{let a=j.getFullYear(),b=j.getMonth();if("day"===c){let c=new Date(a,b,j.getDate());return{rangeFrom:c.getTime(),rangeTo:o(c,1).getTime()}}if("week"===c){let a=n(j);return{rangeFrom:a.getTime(),rangeTo:o(a,7).getTime()}}if("year"===c)return{rangeFrom:new Date(a,0,1).getTime(),rangeTo:new Date(a+1,0,1).getTime()};let d=n(new Date(a,b,1));return{rangeFrom:d.getTime(),rangeTo:o(d,42).getTime()}},[j,c]),x=(0,e.useMemo)(()=>(function(a,b,c,d,e){let f=new Map,g=Date.now();for(let b of a){let a=b.runAtMs??b.ts;if(a<d||a>=e)continue;let g=p(new Date(a)),h=f.get(g)??[];h.push({kind:"run",run:b,job:c.get(b.jobId),at:a}),f.set(g,h)}for(let a of b)if(a.enabled)for(let b of function(a,b,c){if(!a.enabled)return[];let d=a.schedule;switch(d.kind){case"at":{let a=new Date(d.at).getTime();return a>=b&&a<c?[a]:[]}case"every":{let e=d.everyMs;if(e<=0)return[];let f=d.anchorMs??a.createdAtMs??b,g=[],h=f;if(h<b){let a=Math.floor((b-h)/e);h+=a*e}for(;h<c&&g.length<5e3;)h>=b&&g.push(h),h+=e;return g}case"cron":return function(a,b,c,d){let e=a.trim().split(/\s+/);if(e.length<5)return[];let f=q(e[0],0,59),g=q(e[1],0,23),h=q(e[2],1,31),i=q(e[3],1,12),j=q(e[4],0,6),k="*"===e[2],l="*"===e[4],m=[],n=new Date(b);n.setSeconds(0,0);let o=0;for(;n.getTime()<c&&o++<5e4;){if(!i.includes(n.getMonth()+1)){n.setMonth(n.getMonth()+1,1),n.setHours(0,0,0,0);continue}let a=k||h.includes(n.getDate()),d=l||j.includes(n.getDay());if(!(k&&l||(k||l?a&&d:a||d))){n.setDate(n.getDate()+1),n.setHours(0,0,0,0);continue}for(let a of g)for(let d of f){let e=new Date(n.getFullYear(),n.getMonth(),n.getDate(),a,d,0,0).getTime();e>=b&&e<c&&m.push(e)}n.setDate(n.getDate()+1),n.setHours(0,0,0,0)}return m}(d.expr,b,c,d.tz);default:return[]}}(a,d,e)){if(b<g)continue;let c=p(new Date(b)),d=f.get(c)??[];d.push({kind:"scheduled",job:a,at:b}),f.set(c,d)}for(let a of f.values())a.sort((a,b)=>{if(a.at!==b.at)return a.at-b.at;let c="run"===a.kind?a.job?.name??a.run.jobId:a.job.name,d="run"===b.kind?b.job?.name??b.run.jobId:b.job.name;return c.localeCompare(d)});return f})(b,a,l,r,s),[b,a,l,r,s]),y=(0,e.useMemo)(()=>{if("day"===c)return j.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"});if("week"===c){let a=n(j),b=new Date(a);return(b.setDate(b.getDate()+6),a.getMonth()===b.getMonth())?`${a.toLocaleDateString(void 0,{month:"long"})} ${a.getDate()}–${b.getDate()}, ${a.getFullYear()}`:`${a.toLocaleDateString(void 0,{month:"short",day:"numeric"})} – ${b.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}`}return"year"===c?String(j.getFullYear()):j.toLocaleDateString(void 0,{month:"long",year:"numeric"})},[j,c]),z=p(new Date);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>k(-1),className:"p-1.5 rounded-lg cursor-pointer",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"m15 18-6-6 6-6"})})}),(0,d.jsx)("h2",{className:"text-lg font-semibold",style:{color:"var(--color-text)"},children:y}),(0,d.jsx)("button",{type:"button",onClick:()=>k(1),className:"p-1.5 rounded-lg cursor-pointer",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"m9 18 6-6-6-6"})})}),(0,d.jsx)("button",{type:"button",onClick:()=>h?.(p(new Date)),className:"text-xs px-2.5 py-1 rounded-lg ml-2 cursor-pointer",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:"Today"})]}),(0,d.jsx)("div",{className:"flex items-center gap-1 rounded-lg p-0.5",style:{background:"var(--color-surface-hover)"},children:["day","week","month","year"].map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>f?.(a),className:"px-3 py-1 rounded-md text-xs font-medium cursor-pointer",style:{background:c===a?"var(--color-surface)":"transparent",color:c===a?"var(--color-text)":"var(--color-text-muted)"},children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),"day"===c&&(0,d.jsx)(t,{anchor:j,eventsByDay:x,todayStr:z,onSelectJob:i}),"week"===c&&(0,d.jsx)(u,{anchor:j,eventsByDay:x,todayStr:z,onSelectJob:i,onDateChange:h,onModeChange:f}),"month"===c&&(0,d.jsx)(v,{anchor:j,eventsByDay:x,todayStr:z,onSelectJob:i}),"year"===c&&(0,d.jsx)(w,{anchor:j,eventsByDay:x,todayStr:z,onDateChange:h,onModeChange:f})]})}function t({anchor:a,eventsByDay:b,todayStr:c,onSelectJob:f}){let g=p(a),h=b.get(g)??[],i=g===c,j=Array.from({length:24},(a,b)=>b),k=(0,e.useMemo)(()=>{let a=new Map;for(let b of h){let c=new Date(b.at).getHours(),d=a.get(c)??[];d.push(b),a.set(c,d)}return a},[h]);return(0,d.jsx)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:j.map(a=>{let b=k.get(a)??[],c=new Date().getHours(),e=i&&a===c;return(0,d.jsxs)("div",{className:"flex",style:{borderBottom:a<23?"1px solid var(--color-border)":void 0,background:e?"color-mix(in srgb, var(--color-accent) 4%, transparent)":void 0},children:[(0,d.jsx)("div",{className:"w-16 flex-shrink-0 px-3 py-2 text-right text-[11px] font-medium",style:{color:"var(--color-text-muted)",borderRight:"1px solid var(--color-border)"},children:0===a?"12 AM":a<12?`${a} AM`:12===a?"12 PM":`${a-12} PM`}),(0,d.jsx)("div",{className:"flex-1 min-h-[36px] px-2 py-1 flex flex-wrap gap-1 items-start",children:b.map((a,b)=>(0,d.jsx)(r,{ev:a,onSelectJob:f},b))})]},a)})})}function u({anchor:a,eventsByDay:b,todayStr:c,onSelectJob:e,onDateChange:f,onModeChange:g}){let h=n(a),i=Array.from({length:7},(a,b)=>{let c=new Date(h);return c.setDate(c.getDate()+b),c});return(0,d.jsxs)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"grid grid-cols-7",style:{borderBottom:"1px solid var(--color-border)"},children:i.map(a=>{let b=p(a),e=b===c;return(0,d.jsxs)("button",{type:"button",onClick:()=>{f?.(b),g?.("day")},className:"px-2 py-2 text-center cursor-pointer",style:{borderRight:6>a.getDay()?"1px solid var(--color-border)":void 0},children:[(0,d.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:a.toLocaleDateString(void 0,{weekday:"short"})}),(0,d.jsx)("div",{className:"text-sm font-semibold",style:{color:e?"var(--color-accent)":"var(--color-text)"},children:a.getDate()})]},b)})}),(0,d.jsx)("div",{className:"grid grid-cols-7",children:i.map(a=>{let f=p(a),g=b.get(f)??[],h=f===c;return(0,d.jsx)("div",{className:"min-h-[200px] p-1.5",style:{borderRight:6>a.getDay()?"1px solid var(--color-border)":void 0,background:h?"color-mix(in srgb, var(--color-accent) 4%, transparent)":void 0},children:(0,d.jsxs)("div",{className:"space-y-0.5",children:[g.slice(0,8).map((a,b)=>(0,d.jsx)(r,{ev:a,onSelectJob:e},b)),g.length>8&&(0,d.jsxs)("div",{className:"text-[9px] px-1",style:{color:"var(--color-text-muted)"},children:["+",g.length-8," more"]})]})},f)})})]})}function v({anchor:a,eventsByDay:b,todayStr:c,onSelectJob:f}){let g=(0,e.useMemo)(()=>{let b=n(new Date(a.getFullYear(),a.getMonth(),1)),c=[];for(let a=0;a<6;a++){let d=[];for(let c=0;c<7;c++){let e=new Date(b);e.setDate(e.getDate()+7*a+c),d.push(e)}c.push(d)}return c},[a]);return(0,d.jsxs)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"grid grid-cols-7",style:{borderBottom:"1px solid var(--color-border)"},children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(a=>(0,d.jsx)("div",{className:"px-2 py-2 text-center text-[11px] font-medium uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:a},a))}),g.map((e,g)=>(0,d.jsx)("div",{className:"grid grid-cols-7",style:{borderBottom:g<5?"1px solid var(--color-border)":void 0},children:e.map(e=>{let g=p(e),h=b.get(g)??[],i=e.getMonth()===a.getMonth(),j=g===c;return(0,d.jsxs)("div",{className:"min-h-[80px] p-1.5",style:{borderRight:6>e.getDay()?"1px solid var(--color-border)":void 0,opacity:i?1:.4,background:j?"color-mix(in srgb, var(--color-accent) 5%, transparent)":void 0},children:[(0,d.jsx)("div",{className:"text-xs font-medium mb-1",style:{color:j?"var(--color-accent)":"var(--color-text-muted)"},children:e.getDate()}),(0,d.jsxs)("div",{className:"space-y-0.5",children:[h.slice(0,3).map((a,b)=>(0,d.jsx)(r,{ev:a,onSelectJob:f},b)),h.length>3&&(0,d.jsxs)("div",{className:"text-[9px] px-1",style:{color:"var(--color-text-muted)"},children:["+",h.length-3," more"]})]})]},g)})},g))]})}function w({anchor:a,eventsByDay:b,todayStr:c,onDateChange:e,onModeChange:f}){let g=a.getFullYear(),h=Array.from({length:12},(a,b)=>b);return(0,d.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-4",children:h.map(a=>{let h=new Date(g,a,1),i=h.getDay(),j=new Date(g,a+1,0).getDate(),k=[];for(let a=0;a<i;a++)k.push(null);for(let a=1;a<=j;a++)k.push(a);return(0,d.jsxs)("button",{type:"button",onClick:()=>{e?.(p(h)),f?.("month")},className:"rounded-xl p-3 text-left cursor-pointer transition-colors",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="var(--color-surface)"},children:[(0,d.jsx)("div",{className:"text-xs font-semibold mb-2",style:{color:"var(--color-text)"},children:h.toLocaleDateString(void 0,{month:"short"})}),(0,d.jsxs)("div",{className:"grid grid-cols-7 gap-px",children:[["S","M","T","W","T","F","S"].map((a,b)=>(0,d.jsx)("div",{className:"text-[8px] text-center font-medium",style:{color:"var(--color-text-muted)"},children:a},b)),k.map((e,f)=>{if(null===e)return(0,d.jsx)("div",{},`e-${f}`);let h=`${g}-${String(a+1).padStart(2,"0")}-${String(e).padStart(2,"0")}`,i=b.get(h)??[],j=h===c,k=i.length>0,l=i.some(a=>"run"===a.kind&&"error"===a.run.status);return(0,d.jsx)("div",{className:"text-[9px] text-center rounded-sm leading-[16px]",style:{color:j?"var(--color-accent)":k?"var(--color-text)":"var(--color-text-muted)",fontWeight:j||k?600:400,background:l?"color-mix(in srgb, var(--color-error, #ef4444) 15%, transparent)":k?"color-mix(in srgb, var(--color-accent) 10%, transparent)":void 0},children:e},h)})]}),(()=>{let c=0;for(let d=1;d<=j;d++){let e=`${g}-${String(a+1).padStart(2,"0")}-${String(d).padStart(2,"0")}`;c+=(b.get(e)??[]).length}return c>0?(0,d.jsxs)("div",{className:"text-[9px] mt-1.5",style:{color:"var(--color-text-muted)"},children:[c," event",1!==c?"s":""]}):null})()]},a)})})}function x({jobs:a,allRuns:b,onSelectJob:c}){let f=(0,e.useMemo)(()=>{let c=b.length,d=b.filter(a=>"ok"===a.status).length,e=b.filter(a=>"error"===a.status).length,f=c>0?b.filter(a=>null!=a.durationMs).reduce((a,b)=>a+(b.durationMs??0),0)/Math.max(1,b.filter(a=>null!=a.durationMs).length):0,g=c>0?Math.round(d/c*100):0,h=Date.now(),i=[];for(let a=13;a>=0;a--){let c=h-864e5*a,d=c+864e5,e=b.filter(a=>a.ts>=c&&a.ts<d),f=new Date(c);i.push({day:`${f.getMonth()+1}/${f.getDate()}`,ok:e.filter(a=>"ok"===a.status).length,error:e.filter(a=>"error"===a.status).length,other:e.filter(a=>"ok"!==a.status&&"error"!==a.status).length})}return{total:c,ok:d,errors:e,avgDuration:f,successRate:g,runsByDay:i,jobStats:a.map(a=>{let c=b.filter(b=>b.jobId===a.id),d=c.filter(a=>"ok"===a.status).length,e=c.filter(a=>"error"===a.status).length,f=c.filter(a=>null!=a.durationMs).length>0?c.filter(a=>null!=a.durationMs).reduce((a,b)=>a+(b.durationMs??0),0)/c.filter(a=>null!=a.durationMs).length:0;return{job:a,runs:c.length,ok:d,errors:e,avgDuration:f}}).toSorted((a,b)=>b.runs-a.runs)}},[b,a]);return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,d.jsx)(y,{label:"Total Runs",value:String(f.total)}),(0,d.jsx)(y,{label:"Success Rate",value:`${f.successRate}%`,accent:f.successRate>=90?"var(--color-success, #22c55e)":f.successRate>=70?"var(--color-warning, #f59e0b)":"var(--color-error, #ef4444)"}),(0,d.jsx)(y,{label:"Errors",value:String(f.errors),accent:f.errors>0?"var(--color-error, #ef4444)":void 0}),(0,d.jsx)(y,{label:"Avg Duration",value:g(f.avgDuration)})]}),(0,d.jsxs)("div",{className:"rounded-2xl p-4",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsx)("h3",{className:"text-xs font-medium uppercase tracking-wider mb-4",style:{color:"var(--color-text-muted)"},children:"Runs (Last 14 Days)"}),(0,d.jsx)("div",{className:"flex items-end gap-1 h-32",children:f.runsByDay.map(a=>{let b=Math.max(...f.runsByDay.map(a=>a.ok+a.error+a.other),1),c=a.ok+a.error+a.other,e=Math.max(2,c/b*100),g=c>0?a.ok/c*100:100;return(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1",children:[(0,d.jsx)("div",{className:"w-full flex flex-col justify-end",style:{height:"100%"},children:(0,d.jsx)("div",{className:"w-full rounded-t-sm",style:{height:`${e}%`,background:0===c?"var(--color-surface-hover)":100===g?"var(--color-success, #22c55e)":g>50?"color-mix(in srgb, var(--color-success, #22c55e) 60%, var(--color-error, #ef4444))":"var(--color-error, #ef4444)",opacity:0===c?.3:.7},title:`${a.day}: ${a.ok} ok, ${a.error} errors`})}),(0,d.jsx)("span",{className:"text-[9px]",style:{color:"var(--color-text-muted)"},children:a.day})]},a.day)})}),(0,d.jsxs)("div",{className:"flex items-center gap-4 mt-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:"var(--color-success, #22c55e)",opacity:.7}}),(0,d.jsx)("span",{className:"text-[10px]",style:{color:"var(--color-text-muted)"},children:"Success"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:"var(--color-error, #ef4444)",opacity:.7}}),(0,d.jsx)("span",{className:"text-[10px]",style:{color:"var(--color-text-muted)"},children:"Error"})]})]})]}),(0,d.jsxs)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--color-border)"},children:(0,d.jsx)("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:"Per-Job Breakdown"})}),f.jobStats.map(a=>{let b=a.runs>0?Math.round(a.ok/a.runs*100):0;return(0,d.jsxs)("button",{type:"button",onClick:()=>c(a.job.id),className:"w-full flex items-center gap-3 px-4 py-3 text-left cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--color-border)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:a.job.name}),(0,d.jsxs)("div",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:[a.runs," runs / ",b,"% success / avg ",g(a.avgDuration)]})]}),(0,d.jsx)("div",{className:"w-24 h-2 rounded-full overflow-hidden flex-shrink-0",style:{background:"var(--color-surface-hover)"},children:(0,d.jsx)("div",{className:"h-full rounded-full",style:{width:`${b}%`,background:b>=90?"var(--color-success, #22c55e)":b>=70?"var(--color-warning, #f59e0b)":"var(--color-error, #ef4444)"}})}),null!=a.job.state.consecutiveErrors&&a.job.state.consecutiveErrors>0&&(0,d.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0",style:{background:"color-mix(in srgb, var(--color-error, #ef4444) 12%, transparent)",color:"var(--color-error, #ef4444)"},children:[a.job.state.consecutiveErrors," err"]})]},a.job.id)})]})]})}function y({label:a,value:b,accent:c}){return(0,d.jsxs)("div",{className:"rounded-xl p-3",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-wider mb-1",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("div",{className:"text-xl font-semibold",style:{color:c??"var(--color-text)"},children:b})]})}function z({title:a,icon:b,value:c,subtitle:e}){return(0,d.jsxs)("div",{className:"rounded-2xl p-4",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,d.jsx)("span",{style:{color:"var(--color-accent)"},children:b}),(0,d.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:a})]}),(0,d.jsx)("div",{className:"text-lg font-semibold mb-0.5",style:{color:"var(--color-text)"},children:c}),(0,d.jsx)("div",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:e})]})}function A({jobs:a}){let[b,c]=(0,e.useState)(Date.now()),g=a.filter(a=>a.state.nextRunAtMs&&a.state.nextRunAtMs>b&&a.state.nextRunAtMs<b+864e5).toSorted((a,b)=>(a.state.nextRunAtMs??0)-(b.state.nextRunAtMs??0));return 0===g.length?null:(0,d.jsxs)("div",{className:"mb-8",children:[(0,d.jsx)("h2",{className:"text-sm font-medium uppercase tracking-wider mb-3",style:{color:"var(--color-text-muted)"},children:"Upcoming (next 24h)"}),(0,d.jsx)("div",{className:"rounded-2xl p-4",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("div",{className:"absolute top-0 left-3 bottom-0 w-px",style:{background:"var(--color-border)"}}),(0,d.jsx)("div",{className:"space-y-3",children:g.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-3 pl-1",children:[(0,d.jsx)("div",{className:"relative z-10 w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"var(--color-accent)",opacity:.8},children:(0,d.jsx)("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--color-bg)"}})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:a.name}),(0,d.jsxs)("span",{className:"text-xs ml-2",style:{color:"var(--color-text-muted)"},children:["in ",f((a.state.nextRunAtMs??0)-b)]})]}),(0,d.jsx)("span",{className:"text-[11px] flex-shrink-0",style:{color:"var(--color-text-muted)"},children:new Date(a.state.nextRunAtMs).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]},a.id))})]})})]})}function B({jobs:a,onSelectJob:b,onSendCommand:c}){return(0,d.jsxs)("div",{className:"mb-6",children:[(0,d.jsx)("h2",{className:"text-sm font-medium uppercase tracking-wider mb-3",style:{color:"var(--color-text-muted)"},children:"Jobs"}),0===a.length?(0,d.jsx)("div",{className:"p-8 text-center rounded-2xl",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:(0,d.jsx)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"No cron jobs configured."})}):(0,d.jsx)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:(0,d.jsxs)("table",{className:"w-full text-sm",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{style:{borderBottom:"1px solid var(--color-border)",color:"var(--color-text-muted)"},children:[(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Name"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Schedule"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Status"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Next Run"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Last Run"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider w-20"})]})}),(0,d.jsx)("tbody",{children:a.map(a=>(0,d.jsx)(C,{job:a,onClick:()=>b(a.id),onSendCommand:c},a.id))})]})})]})}function C({job:a,onClick:b,onSendCommand:c}){let i=a.enabled?a.state.runningAtMs?"running":a.state.lastStatus??"idle":"disabled",j=h(i),[k,l]=(0,e.useState)(Date.now());return(0,d.jsxs)("tr",{className:"cursor-pointer transition-colors group",style:{borderBottom:"1px solid var(--color-border)"},onClick:b,onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsxs)("td",{className:"px-4 py-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"font-medium",style:{color:"var(--color-text)"},children:a.name}),null!=a.state.consecutiveErrors&&a.state.consecutiveErrors>0&&(0,d.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full",style:{background:"color-mix(in srgb, var(--color-error, #ef4444) 12%, transparent)",color:"var(--color-error, #ef4444)"},children:[a.state.consecutiveErrors," err"]})]}),a.description&&(0,d.jsx)("div",{className:"text-xs truncate max-w-[200px]",style:{color:"var(--color-text-muted)"},children:a.description})]}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs",style:{color:"var(--color-text-muted)"},children:function(a){switch(a.kind){case"cron":return`cron: ${a.expr}${a.tz?` (${a.tz})`:""}`;case"every":{let b=a.everyMs;if(b>=864e5)return`every ${Math.round(b/864e5)}d`;if(b>=36e5)return`every ${Math.round(b/36e5)}h`;if(b>=6e4)return`every ${Math.round(b/6e4)}m`;return`every ${Math.round(b/1e3)}s`}case"at":return`at ${a.at}`;default:return"unknown"}}(a.schedule)}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs px-2 py-0.5 rounded-full",style:{background:`color-mix(in srgb, ${j} 12%, transparent)`,color:j},children:["running"===i&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{background:j}}),i]})}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs",style:{color:"var(--color-text-muted)"},children:a.state.nextRunAtMs?a.state.nextRunAtMs>k?`in ${f(a.state.nextRunAtMs-k)}`:"overdue":"-"}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[a.state.lastStatus&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:h(a.state.lastStatus)}}),(0,d.jsx)("span",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:a.state.lastRunAtMs?`${function(a){let b=Date.now()-a;return b<6e4?"just now":b<36e5?`${Math.floor(b/6e4)}m ago`:b<864e5?`${Math.floor(b/36e5)}h ago`:`${Math.floor(b/864e5)}d ago`}(a.state.lastRunAtMs)}${a.state.lastDurationMs?` (${g(a.state.lastDurationMs)})`:""}`:"-"})]})}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-1 md:opacity-0 md:group-hover:opacity-100 transition-opacity",children:[!a.state.runningAtMs&&a.enabled&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),c?.(`Run cron job "${a.name}" (${a.id}) now with --force`)},className:"p-1 rounded cursor-pointer",style:{color:"var(--color-accent)"},title:"Run now",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polygon",{points:"6 3 20 12 6 21 6 3"})})}),(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),c?.(`${a.enabled?"Disable":"Enable"} cron job "${a.name}" (${a.id})`)},className:"p-1 rounded cursor-pointer",style:{color:a.enabled?"var(--color-text-muted)":"var(--color-success, #22c55e)"},title:a.enabled?"Disable":"Enable",children:a.enabled?(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("path",{d:"m4.93 4.93 14.14 14.14"})]}):(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})})})]})})]})}function D(){return(0,d.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M19.5 12.572l-7.5 7.428l-7.5 -7.428a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572"})})}function E(){return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}function F(){return(0,d.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polygon",{points:"6 3 20 12 6 21 6 3"})})}},464867:(a,b,c)=>{"use strict";c.d(b,{v:()=>y});var d=c(736927),e=c(115962),f=c(327629),g=c(437503),h=c(930439),i=c(444949),j=c(51161),k=c(535798),l=c(987221),m=c(665466),n=c(85969);let o=["today","yesterday","this_week","last_week","this_month"];function p(a,b){return a.getFullYear()===b.getFullYear()&&a.getMonth()===b.getMonth()&&a.getDate()===b.getDate()}function q({personId:a,onOpenPerson:b,onOpenCompany:c}){let[g,h]=(0,e.useState)([]),[i,k]=(0,e.useState)(0),[l,m]=(0,e.useState)(0),[n,q]=(0,e.useState)(!1),[r,t]=(0,e.useState)(!0),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),A=(0,e.useCallback)(async(b,c)=>{let d=await fetch(`/api/crm/people/${encodeURIComponent(a)}/activity?limit=100&offset=${b}`,{cache:"no-store",signal:c});if(!d.ok)throw Error(`HTTP ${d.status}`);return await d.json()},[a]),B=(0,e.useCallback)(async()=>{if(!u&&n){v(!0);try{let a=await A(l);if(!a)return;h(b=>[...b,...a.activities]),q(a.has_more),m(b=>b+a.activities.length)}catch(a){x(a instanceof Error?a.message:"Failed to load more activity.")}finally{v(!1)}}},[n,A,u,l]),C=(0,e.useMemo)(()=>{let a=new Date,b=new Map;for(let c of g){let d=function(a,b){if(null==a)return"unknown";let c="string"==typeof a?Date.parse(a):a instanceof Date?a.getTime():a;if(!Number.isFinite(c))return"unknown";let d=new Date(c);if(p(d,b))return"today";let e=new Date(b);if(e.setDate(b.getDate()-1),p(d,e))return"yesterday";let f=function(a){let b=new Date(a),c=b.getDay();return b.setDate(b.getDate()-(c+6)%7),b.setHours(0,0,0,0),b}(b),g=new Date(f);g.setDate(f.getDate()-7);let h=new Date(f);if(d>=f&&d<=b)return"this_week";if(d>=g&&d<h)return"last_week";if(d.getFullYear()===b.getFullYear()&&d.getMonth()===b.getMonth())return"this_month";let i=d.getFullYear(),j=String(d.getMonth()+1).padStart(2,"0");return`older:${i}-${j}`}(c.occurred_at,a);b.has(d)||b.set(d,[]),b.get(d).push(c)}return Array.from(b.entries()).sort(([a],[b])=>(function(a,b){let c=o.indexOf(a),d=o.indexOf(b);return -1!==c&&-1!==d?c-d:-1!==c?-1:-1!==d||"unknown"===a?1:"unknown"===b?-1:a<b?1:a>b?-1:0})(a,b))},[g]);return r&&0===g.length?(0,d.jsx)(j.ux,{label:"Loading activity…"}):w&&0===g.length?(0,d.jsx)(j.HF,{title:"Couldn't load activity",description:w}):0===g.length?(0,d.jsx)(j.HF,{title:"No activity yet",description:"Emails and meetings appear here once they're synced."}):(0,d.jsxs)("div",{className:"space-y-6",children:[C.map(([a,e])=>(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"sticky top-0 z-[1] mb-2 px-1 py-1 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)",background:"var(--color-background)"},children:function(a){switch(a){case"today":return"Today";case"yesterday":return"Yesterday";case"this_week":return"Earlier this week";case"last_week":return"Last week";case"this_month":return"Earlier this month";case"unknown":return"Unknown date";default:{let b=/^older:(\d{4})-(\d{2})$/.exec(a);if(!b)return a;let c=Number(b[1]),d=Number(b[2])-1;return new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(new Date(c,d,1))}}}(a)}),(0,d.jsx)("ul",{className:"space-y-2",children:e.map(a=>(0,d.jsx)(s,{row:a,expanded:y===a.id,onToggle:()=>z(b=>b===a.id?null:a.id),onOpenPerson:b,onOpenCompany:c},a.id))})]},a)),n&&(0,d.jsx)("div",{className:"flex justify-center pt-2",children:(0,d.jsx)(f.$,{type:"button",variant:"outline",size:"sm",onClick:B,disabled:u,children:u?"Loading…":`Show more (${(i-g.length).toLocaleString()} remaining)`})}),w&&g.length>0&&(0,d.jsx)("p",{className:"text-center text-[12px]",style:{color:"var(--color-text-muted)"},children:w})]})}let r={Sent:{label:"You",color:"#22c55e"},Received:{label:"Them",color:"#3b82f6"},Internal:{label:"Internal",color:"#94a3b8"}};function s({row:a,expanded:b,onToggle:c,onOpenPerson:e,onOpenCompany:f}){let g=a.direction?r[a.direction]:null,h=g?`${g.color}1a`:"var(--color-surface-hover)",i=g?g.color:"var(--color-text-muted)",j="Email"===a.type?a.email?.subject?.trim()||"(no subject)":a.event?.title?.trim()||"(no title)";return(0,d.jsxs)("li",{className:"rounded-xl border overflow-hidden",style:{borderColor:b?"var(--color-accent)":"var(--color-border)",background:"var(--color-surface)",transition:"border-color 120ms ease"},children:[(0,d.jsxs)("div",{role:"button",tabIndex:0,"aria-expanded":b,onClick:c,onKeyDown:a=>{a.target===a.currentTarget&&("Enter"===a.key||" "===a.key)&&(a.preventDefault(),c())},className:"grid w-full items-start gap-3 px-4 py-3 text-left cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] transition-colors",style:{gridTemplateColumns:"auto minmax(0, 1fr) auto"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full shrink-0",style:{background:h,color:i},"aria-hidden":!0,children:"Email"===a.type?(0,d.jsx)(v,{}):(0,d.jsx)(w,{})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"font-instrument truncate",style:{color:"var(--color-text)",fontSize:14,fontWeight:600},children:j}),g&&(0,d.jsx)("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full px-1.5 py-0 text-[10px] uppercase tracking-[0.06em]",style:{background:`${g.color}1f`,color:g.color,fontWeight:600},children:g.label})]}),(0,d.jsx)(t,{row:a})]}),(0,d.jsx)("span",{className:"text-right text-[11px] tabular-nums shrink-0",style:{color:"var(--color-text-muted)"},title:a.occurred_at?(0,k.Vv)(a.occurred_at):void 0,children:a.occurred_at&&(0,k.wI)(a.occurred_at)})]}),(0,d.jsx)("div",{className:"grid transition-[grid-template-rows] duration-[220ms] ease-out motion-reduce:transition-none",style:{gridTemplateRows:b?"1fr":"0fr"},children:(0,d.jsx)("div",{className:"overflow-hidden",children:b&&(0,d.jsx)(u,{row:a,onOpenPerson:e,onOpenCompany:f})})})]})}function t({row:a}){if("Email"===a.type&&a.email){let b=a.email.from?.name?.trim()||a.email.from?.email||null,c=a.email.snippet?.trim();return b||c?(0,d.jsxs)("p",{className:"mt-0.5 truncate text-[13px]",style:{color:"var(--color-text-muted)",fontFamily:'"Bookerly", Georgia, "Times New Roman", serif'},children:[b&&(0,d.jsx)("span",{style:{color:"var(--color-text)"},children:b}),b&&c&&(0,d.jsxs)("span",{children:[" — ",c]}),!b&&c]}):null}if("Meeting"===a.type&&a.event){let b=function(a,b){if(!a)return null;let c=new Date(a);if(Number.isNaN(c.getTime()))return null;let d=new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(c);if(!b)return d;let e=new Date(b);if(Number.isNaN(e.getTime()))return d;let f=new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(e);return`${d} – ${f}`}(a.event.start_at,a.event.end_at),c=a.event.meeting_type;return b||c?(0,d.jsxs)("p",{className:"mt-0.5 text-[12px]",style:{color:"var(--color-text-muted)"},children:[b,b&&c&&" \xb7 ",c]}):null}return null}function u({row:a,onOpenPerson:b,onOpenCompany:c}){return"Email"===a.type?a.email?.thread_id?(0,d.jsx)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-background)"},children:(0,d.jsx)(n.X,{threadId:a.email.thread_id,recipientName:a.email.from?.name??a.email.from?.email??null,onOpenPerson:b,autoScrollOnLoad:!1,showReply:!1})}):(0,d.jsx)("div",{className:"border-t px-4 py-4 text-[12px]",style:{borderColor:"var(--color-border)",background:"var(--color-background)",color:"var(--color-text-muted)"},children:"The thread for this message is no longer available."}):"Meeting"===a.type&&a.event?(0,d.jsx)(m.I,{eventId:a.event.id,fallbackEvent:{id:a.event.id,title:a.event.title,start_at:a.event.start_at,end_at:a.event.end_at,meeting_type:a.event.meeting_type},onOpenPerson:b,onOpenCompany:c}):null}function v(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,d.jsx)("path",{d:"m3 7 9 6 9-6"})]})}function w(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("rect",{x:"3",y:"4",width:"18",height:"17",rx:"2"}),(0,d.jsx)("path",{d:"M3 10h18"}),(0,d.jsx)("path",{d:"M8 2v4"}),(0,d.jsx)("path",{d:"M16 2v4"})]})}let x=[{id:"overview",label:"Overview"},{id:"emails",label:"Emails",getCount:a=>a.threads.length},{id:"calendar",label:"Meetings",getCount:a=>a.events.length},{id:"activity",label:"Activity",getCount:a=>a.interactions_summary.total},{id:"notes",label:"Notes"}];function y({personId:a,onOpenPerson:b,onOpenCompany:c,onBackToList:g}){let[h,i]=(0,e.useState)(null),[k,l]=(0,e.useState)(!0),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)("overview");return((0,e.useCallback)(async()=>{l(!0),n(null);try{let b=await fetch(`/api/crm/people/${encodeURIComponent(a)}`,{cache:"no-store"});if(404===b.status){n("Person not found."),i(null);return}if(!b.ok){let a=await b.json().catch(()=>({}));throw Error(a.error??`HTTP ${b.status}`)}let c=await b.json();i(c)}catch(a){n(a instanceof Error?a.message:"Failed to load person.")}finally{l(!1)}},[a]),k&&!h)?(0,d.jsx)("div",{className:"flex h-full flex-col",style:{background:"var(--color-background)"},children:(0,d.jsx)(j.ux,{label:"Loading profile…"})}):m||!h?(0,d.jsx)("div",{className:"flex h-full flex-col",style:{background:"var(--color-background)"},children:(0,d.jsx)(j.HF,{title:"Couldn't load this contact",description:m??"The record may have been deleted.",cta:g&&(0,d.jsx)(f.$,{variant:"outline",size:"sm",onClick:g,children:"Back to People"})})}):(0,d.jsxs)("div",{className:"flex h-full min-h-0 flex-col",style:{background:"var(--color-background)"},children:[(0,d.jsx)(z,{data:h,tab:o,onTabChange:p,onOpenCompany:c,onBackToList:g}),(0,d.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,d.jsxs)("div",{className:"mx-auto w-full max-w-4xl px-6 py-6",children:["overview"===o&&(0,d.jsx)(A,{data:h,onOpenCompany:c}),"emails"===o&&(0,d.jsx)(B,{data:h,onOpenPerson:b}),"calendar"===o&&(0,d.jsx)(C,{data:h,onOpenPerson:b,onOpenCompany:c}),"activity"===o&&(0,d.jsx)(D,{data:h,onOpenPerson:b,onOpenCompany:c}),"notes"===o&&(0,d.jsx)(E,{data:h})]})})]})}function z({data:a,tab:b,onTabChange:c,onOpenCompany:e,onBackToList:f}){let{person:j,company:k,derived_website:l}=a,m=j.name?.trim()||j.email||"Unknown contact",n=k?.website||l;return(0,d.jsxs)("header",{className:"shrink-0 px-6 pt-4 pb-0",style:{borderBottom:"1px solid var(--color-border)",background:"var(--color-background)"},children:[(0,d.jsx)("div",{className:"mb-3 flex items-center gap-2 text-[12px]",style:{color:"var(--color-text-muted)"},children:f&&(0,d.jsxs)("button",{type:"button",onClick:f,className:"inline-flex items-center gap-1 hover:underline",children:[(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,d.jsx)("path",{d:"m15 18-6-6 6-6"})}),"People"]})}),(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)(g.X,{src:j.avatar_url,name:m,seed:j.email??j.id,size:"xl"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[(0,d.jsx)("h1",{className:"font-instrument text-3xl tracking-tight truncate",style:{color:"var(--color-text)"},children:m}),(0,d.jsx)(i.q,{score:j.strength_score})]}),(0,d.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[13px]",children:[j.email&&(0,d.jsx)("a",{href:`mailto:${j.email}`,className:"hover:underline truncate",style:{color:"var(--color-text-muted)"},children:j.email}),k&&e&&(0,d.jsxs)("button",{type:"button",onClick:()=>e(k.id),className:"inline-flex items-center gap-1.5 hover:underline",style:{color:"var(--color-text-muted)"},children:[(0,d.jsx)(h.g,{domain:k.domain,name:k.name,size:"sm"}),(0,d.jsx)("span",{children:k.name??k.domain})]}),n&&(0,d.jsx)("a",{href:n,target:"_blank",rel:"noreferrer",className:"hover:underline",style:{color:"var(--color-text-muted)"},children:n.replace(/^https?:\/\//,"")})]}),(j.job_title||j.phone||j.linkedin_url)&&(0,d.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px]",style:{color:"var(--color-text-muted)"},children:[j.job_title&&(0,d.jsx)("span",{children:j.job_title}),j.phone&&(0,d.jsx)("span",{children:j.phone}),j.linkedin_url&&(0,d.jsx)("a",{href:j.linkedin_url,target:"_blank",rel:"noreferrer",className:"hover:underline",children:"LinkedIn"})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[j.email&&(0,d.jsx)("a",{href:`mailto:${j.email}`,className:"inline-flex h-8 w-8 items-center justify-center rounded-lg",style:{background:"var(--color-surface)",color:"var(--color-text-muted)",border:"1px solid var(--color-border)"},title:"Compose email",children:(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,d.jsx)("path",{d:"m3 7 9 6 9-6"})]})}),j.email&&(0,d.jsx)("a",{href:`https://mail.google.com/mail/u/0/#search/${encodeURIComponent("from:"+j.email+" OR to:"+j.email)}`,target:"_blank",rel:"noreferrer",className:"inline-flex h-8 w-8 items-center justify-center rounded-lg",style:{background:"var(--color-surface)",color:"var(--color-text-muted)",border:"1px solid var(--color-border)"},title:"Open in Gmail",children:(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,d.jsx)("path",{d:"M15 3h6v6"}),(0,d.jsx)("path",{d:"M10 14 21 3"}),(0,d.jsx)("path",{d:"M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"})]})})]})]}),(0,d.jsx)("div",{className:"mt-5 flex items-center gap-4 -mb-px",children:x.map(e=>{let f=e.getCount?.(a),g=e.id===b;return(0,d.jsxs)("button",{type:"button",onClick:()=>c(e.id),className:"relative flex items-center gap-1.5 px-1 py-2 text-[13px] font-medium transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)",borderBottom:g?"2px solid var(--color-text)":"2px solid transparent"},children:[e.label,"number"==typeof f&&f>0&&(0,d.jsx)("span",{className:"rounded-full px-1.5 py-0 text-[10px]",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:f})]},e.id)})})]})}function A({data:a,onOpenCompany:b}){let{person:c,company:e,interactions_summary:f}=a;return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:"At a glance"}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,d.jsx)(F,{label:"Strength",value:c.strength_label}),(0,d.jsx)(F,{label:"Last contact",value:c.last_interaction_at?(0,k.wI)(c.last_interaction_at):"—"}),(0,d.jsx)(F,{label:"Emails",value:f.email_count.toLocaleString()}),(0,d.jsx)(F,{label:"Meetings",value:f.meeting_count.toLocaleString()})]})]}),(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:"Contact"}),(0,d.jsxs)("div",{className:"space-y-2.5 rounded-2xl border p-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)(G,{label:"Email",value:c.email,link:c.email?`mailto:${c.email}`:void 0}),(0,d.jsx)(G,{label:"Phone",value:c.phone,link:c.phone?`tel:${c.phone}`:void 0}),(0,d.jsx)(G,{label:"LinkedIn",value:c.linkedin_url,link:c.linkedin_url??void 0,external:!0}),(0,d.jsx)(G,{label:"Job title",value:c.job_title}),(0,d.jsx)(G,{label:"Status",value:c.status}),(0,d.jsx)(G,{label:"Source",value:c.source})]})]}),e&&(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:"Company"}),(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(e.id),disabled:!b,className:"flex w-full items-center gap-3 rounded-2xl border p-4 text-left transition-colors disabled:cursor-default",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},onMouseEnter:a=>{b&&(a.currentTarget.style.borderColor="var(--color-accent)")},onMouseLeave:a=>{b&&(a.currentTarget.style.borderColor="var(--color-border)")},children:[(0,d.jsx)(h.g,{domain:e.domain,name:e.name,size:"lg"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:e.name??e.domain??"Unknown company"}),(e.domain||e.industry)&&(0,d.jsx)("p",{className:"mt-0.5 text-[12px]",style:{color:"var(--color-text-muted)"},children:[e.domain,e.industry].filter(Boolean).join(" \xb7 ")})]}),(0,d.jsx)(i.q,{score:e.strength_score})]})]})]})}function B({data:a,onOpenPerson:b}){return 0===a.threads.length?(0,d.jsx)(j.HF,{title:"No threads with this contact yet",description:"Threads appear here as soon as Gmail is connected and the next sync tick runs."}):(0,d.jsx)(l.A,{threads:a.threads,onOpenPerson:b})}function C({data:a,onOpenPerson:b,onOpenCompany:c}){let[f,g]=(0,e.useState)(null);if(0===a.events.length)return(0,d.jsx)(j.HF,{title:"No meetings with this contact",description:"Once Calendar is connected and the next sync runs, meetings show up here."});let h=new Map;for(let b of a.events){let a=b.start_at?(0,k._H)(b.start_at):"Unknown date";h.has(a)||h.set(a,[]),h.get(a).push(b)}return(0,d.jsx)("div",{className:"space-y-6",children:Array.from(h.entries()).map(([a,e])=>(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"sticky top-0 z-10 mb-2 px-1 py-1 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)",background:"var(--color-background)"},children:a}),(0,d.jsx)("ul",{className:"space-y-2",children:e.map(a=>(0,d.jsx)(m.E,{event:a,expanded:f===a.id,onToggle:()=>g(b=>b===a.id?null:a.id),onOpenPerson:b,onOpenCompany:c},a.id))})]},a))})}function D({data:a,onOpenPerson:b,onOpenCompany:c}){let e=a.interactions_summary;return 0===e.total?(0,d.jsx)(j.HF,{title:"No activity yet",description:"Emails and meetings appear here once they're synced."}):(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("section",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,d.jsx)(F,{label:"Interactions",value:e.total.toLocaleString()}),(0,d.jsx)(F,{label:"Emails",value:e.email_count.toLocaleString()}),(0,d.jsx)(F,{label:"Meetings",value:e.meeting_count.toLocaleString()}),(0,d.jsx)(F,{label:"Last reply",value:e.last_inbound_at?(0,k.wI)(e.last_inbound_at):"—"})]}),e.last_outbound_at&&(0,d.jsx)("div",{className:"rounded-2xl border px-4 py-3 text-[13px]",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:(0,d.jsxs)("p",{style:{color:"var(--color-text-muted)"},children:["You last reached out"," ",(0,d.jsx)("strong",{style:{color:"var(--color-text)"},children:(0,k.wI)(e.last_outbound_at)}),"."]})})]}),(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:"Timeline"}),(0,d.jsx)(q,{personId:a.person.id,onOpenPerson:b,onOpenCompany:c})]})]})}function E({data:a}){return a.person.notes?.trim()?(0,d.jsx)("article",{className:"prose prose-sm max-w-none",style:{color:"var(--color-text)"},children:(0,d.jsx)("pre",{style:{whiteSpace:"pre-wrap",fontFamily:"inherit"},children:a.person.notes})}):(0,d.jsx)(j.HF,{title:"No notes yet",description:"Notes added in the People object detail panel will show up here."})}function F({label:a,value:b}){return(0,d.jsxs)("div",{className:"rounded-2xl border p-3",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("dd",{className:"mt-1 text-[14px] font-medium",style:{color:"var(--color-text)"},children:b})]})}function G({label:a,value:b,link:c,external:e}){if(!b)return(0,d.jsxs)("div",{className:"flex items-baseline gap-3 text-[13px]",children:[(0,d.jsx)("dt",{className:"w-24 shrink-0",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("dd",{style:{color:"var(--color-text-muted)"},children:"—"})]});let f=c?(0,d.jsx)("a",{href:c,target:e?"_blank":void 0,rel:e?"noreferrer":void 0,className:"hover:underline truncate",style:{color:"var(--color-text)"},children:b}):(0,d.jsx)("span",{className:"truncate",style:{color:"var(--color-text)"},children:b});return(0,d.jsxs)("div",{className:"flex items-baseline gap-3 text-[13px] min-w-0",children:[(0,d.jsx)("dt",{className:"w-24 shrink-0",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("dd",{className:"min-w-0",children:f})]})}e.useMemo},468549:(a,b)=>{!function(a){"undefined"==typeof DO_NOT_EXPORT_BESSEL?a(b):a({})}(function(a){a.version="1.0.2";var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=Math;function s(a,b){for(var c=0,d=0;c<a.length;++c)d=b*d+a[c];return d}function t(a,b,c,d,e){if(0===b)return c;if(1===b)return d;for(var f=2/a,g=d,h=1;h<b;++h)g=d*h*f+e*c,c=d,d=g;return g}function u(a,b,c,d,e){return function(c,f){if(d){if(0===c)return 1==d?-1/0:1/0;else if(c<0)return NaN}if(0===f)return a(c);if(1===f)return b(c);if(f<0)return NaN;f|=0;var g=a(c),h=b(c);return t(c,f,g,h,e)}}var v=function(){var a=[0xd6759744e,-0x31c78f292,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse(),b=[0xd675973ab,0x3d5d6d39,9494680.718,59272.64853,267.8532712,1].reverse(),c=[1,-.001098628627,2734510407e-14,-2073370639e-15,2093887211e-16].reverse(),d=[-.01562499995,1430488765e-13,-6911147651e-15,7621095161e-16,-934935152e-16].reverse();function e(e){var f=0,g=0,h=0,i=e*e;if(e<8)f=(g=s(a,i))/(h=s(b,i));else{var j=e-.785398164;g=s(c,i=64/i),h=s(d,i),f=r.sqrt(.636619772/e)*(r.cos(j)*g-r.sin(j)*h*8/e)}return f}var f=[0x10d925ddd8,-0x1d6950b23,242396853.1,-2972611.439,15704.4826,-30.16036606].reverse(),g=[0x21b24bbb9a,0x891f618a,18583304.74,99447.43394,376.9991397,1].reverse(),h=[1,.00183105,-3516396496e-14,2457520174e-15,-240337019e-15].reverse(),i=[.04687499995,-2002690873e-13,8449199096e-15,-88228987e-14,105787412e-15].reverse();function j(a){var b=0,c=0,d=0,e=a*a,j=r.abs(a)-2.356194491;return 8>Math.abs(a)?b=(c=a*s(f,e))/(d=s(g,e)):(c=s(h,e=64/e),d=s(i,e),b=r.sqrt(.636619772/r.abs(a))*(r.cos(j)*c-r.sin(j)*d*8/r.abs(a)),a<0&&(b=-b)),b}return function a(b,c){if(c=Math.round(c),!isFinite(b))return isNaN(b)?b:0;if(c<0)return(c%2?-1:1)*a(b,-c);if(b<0)return(c%2?-1:1)*a(-b,c);if(0===c)return e(b);if(1===c)return j(b);if(0===b)return 0;var d=0;if(b>c)d=t(b,c,e(b),j(b),-1);else{for(var f=2*r.floor((c+r.floor(r.sqrt(40*c)))/2),g=!1,h=0,i=0,k=1,l=0,m=2/b,n=f;n>0;n--)l=n*m*k-h,h=k,k=l,r.abs(k)>1e10&&(k*=1e-10,h*=1e-10,d*=1e-10,i*=1e-10),g&&(i+=k),g=!g,n==c&&(d=h);d/=i=2*i-k}return d}}(),w=(b=[-0xb04cc5cd,0x1a4fa4b91,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),c=[0x954bf890d,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),d=[1,-.001098628627,2734510407e-14,-2073370639e-15,2093887211e-16].reverse(),e=[-.01562499995,1430488765e-13,-6911147651e-15,7621095161e-16,-934945152e-16].reverse(),f=[-4900604943e3,127527439e4,-0xbffb0414e,734926455.1,-4237922.726,8511.937935].reverse(),g=[249958057e5,0x62d2b66f40,0xde8afbbf,22459040.02,102042.605,354.9632885,1].reverse(),h=[1,.00183105,-3516396496e-14,2457520174e-15,-240337019e-15].reverse(),i=[.04687499995,-2002690873e-13,8449199096e-15,-88228987e-14,105787412e-15].reverse(),u(function(a){var f=0,g=0,h=0,i=a*a,j=a-.785398164;return a<8?f=(g=s(b,i))/(h=s(c,i))+.636619772*v(a,0)*r.log(a):(g=s(d,i=64/i),h=s(e,i),f=r.sqrt(.636619772/a)*(r.sin(j)*g+r.cos(j)*h*8/a)),f},function(a){var b=0,c=0,d=0,e=a*a,j=a-2.356194491;return a<8?b=(c=a*s(f,e))/(d=s(g,e))+.636619772*(v(a,1)*r.log(a)-1/a):(c=s(h,e=64/e),d=s(i,e),b=r.sqrt(.636619772/a)*(r.sin(j)*c+r.cos(j)*d*8/a)),b},"BESSELY",1,-1)),x=(j=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),k=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),l=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),m=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse(),function a(b,c){if(0===(c=Math.round(c)))return b<=3.75?s(j,b*b/14.0625):r.exp(r.abs(b))/r.sqrt(r.abs(b))*s(k,3.75/r.abs(b));if(1===c)return b<3.75?b*s(l,b*b/14.0625):(b<0?-1:1)*r.exp(r.abs(b))/r.sqrt(r.abs(b))*s(m,3.75/r.abs(b));if(c<0)return NaN;if(0===r.abs(b))return 0;if(b==1/0)return 1/0;var d,e=0,f=2/r.abs(b),g=0,h=1,i=0;for(d=2*r.round((c+r.round(r.sqrt(40*c)))/2);d>0;d--)i=d*f*h+g,g=h,h=i,r.abs(h)>1e10&&(h*=1e-10,g*=1e-10,e*=1e-10),d==c&&(e=g);return e*=a(b,0)/h,b<0&&c%2?-e:e}),y=(n=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),o=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse(),p=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),q=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse(),u(function(a){return a<=2?-r.log(a/2)*x(a,0)+s(n,a*a/4):r.exp(-a)/r.sqrt(a)*s(o,2/a)},function(a){return a<=2?r.log(a/2)*x(a,1)+1/a*s(p,a*a/4):r.exp(-a)/r.sqrt(a)*s(q,2/a)},"BESSELK",2,1));a.besselj=v,a.bessely=w,a.besseli=x,a.besselk=y})},472827:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isSymbol=function(a){return"symbol"==typeof a||a instanceof Symbol}},477288:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),!function(a,b){for(var c in b)Object.defineProperty(a,c,{enumerable:!0,get:b[c]})}(b,{ReadonlyURLSearchParams:function(){return k},RedirectType:function(){return e.RedirectType},forbidden:function(){return g.forbidden},notFound:function(){return f.notFound},permanentRedirect:function(){return d.permanentRedirect},redirect:function(){return d.redirect},unauthorized:function(){return h.unauthorized},unstable_isUnrecognizedActionError:function(){return l},unstable_rethrow:function(){return i.unstable_rethrow}});let d=c(627441),e=c(171298),f=c(173),g=c(26032),h=c(843155),i=c(430083);class j extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class k extends URLSearchParams{append(){throw new j}delete(){throw new j}set(){throw new j}sort(){throw new j}}function l(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},478425:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});var d=c(115962),e={outline:{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"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};let f=(a,b,c,f)=>{let g=(0,d.forwardRef)(({color:c="currentColor",size:g=24,stroke:h=2,title:i,className:j,children:k,...l},m)=>(0,d.createElement)("svg",{ref:m,...e[a],width:g,height:g,className:["tabler-icon",`tabler-icon-${b}`,j].join(" "),..."filled"===a?{fill:c}:{strokeWidth:h,stroke:c},...l},[i&&(0,d.createElement)("title",{key:"svg-title"},i),...f.map(([a,b])=>(0,d.createElement)(a,b)),...Array.isArray(k)?k:[k]]));return g.displayName=`${c}`,g}},478853:(a,b,c)=>{"use strict";c.d(b,{K:()=>o,w:()=>n});for(var d={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},e={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},f="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),g="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),h=0;h<10;h++)d[48+h]=d[96+h]=String(h);for(var h=1;h<=24;h++)d[h+111]="F"+h;for(var h=65;h<=90;h++)d[h]=String.fromCharCode(h+32),e[h]=String.fromCharCode(h);for(var i in d)e.hasOwnProperty(i)||(e[i]=d[i]);var j=c(381802);let k="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),l="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function m(a,b,c=!0){return b.altKey&&(a="Alt-"+a),b.ctrlKey&&(a="Ctrl-"+a),b.metaKey&&(a="Meta-"+a),c&&b.shiftKey&&(a="Shift-"+a),a}function n(a){return new j.k_({props:{handleKeyDown:o(a)}})}function o(a){let b=function(a){let b=Object.create(null);for(let c in a)b[function(a){let b,c,d,e,f=a.split(/-(?!$)/),g=f[f.length-1];"Space"==g&&(g=" ");for(let a=0;a<f.length-1;a++){let g=f[a];if(/^(cmd|meta|m)$/i.test(g))e=!0;else if(/^a(lt)?$/i.test(g))b=!0;else if(/^(c|ctrl|control)$/i.test(g))c=!0;else if(/^s(hift)?$/i.test(g))d=!0;else if(/^mod$/i.test(g))k?e=!0:c=!0;else throw Error("Unrecognized modifier name: "+g)}return b&&(g="Alt-"+g),c&&(g="Ctrl-"+g),e&&(g="Meta-"+g),d&&(g="Shift-"+g),g}(c)]=a[c];return b}(a);return function(a,c){var h;let i=("Esc"==(h=!(f&&c.metaKey&&c.shiftKey&&!c.ctrlKey&&!c.altKey||g&&c.shiftKey&&c.key&&1==c.key.length||"Unidentified"==c.key)&&c.key||(c.shiftKey?e:d)[c.keyCode]||c.key||"Unidentified")&&(h="Escape"),"Del"==h&&(h="Delete"),"Left"==h&&(h="ArrowLeft"),"Up"==h&&(h="ArrowUp"),"Right"==h&&(h="ArrowRight"),"Down"==h&&(h="ArrowDown"),h),j,k=b[m(i,c)];if(k&&k(a.state,a.dispatch,a))return!0;if(1==i.length&&" "!=i){if(c.shiftKey){let d=b[m(i,c,!1)];if(d&&d(a.state,a.dispatch,a))return!0}if((c.altKey||c.metaKey||c.ctrlKey)&&!(l&&c.ctrlKey&&c.altKey)&&(j=d[c.keyCode])&&j!=i){let d=b[m(j,c)];if(d&&d(a.state,a.dispatch,a))return!0}}return!1}}},479466:(a,b,c)=>{"use strict";c.d(b,{o:()=>e});var d=c(845722);function e(a,b){let c=(0,d.a)(a,b?.in);return c.setHours(0,0,0,0),c}},486230:(a,b,c)=>{"use strict";c.d(b,{WorkspaceShell:()=>d});let d=(0,c(872665).registerClientReference)(function(){throw Error("Attempted to call WorkspaceShell() from the server but WorkspaceShell is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/DenchClaw/DenchClaw/apps/web/app/workspace/workspace-content.tsx","WorkspaceShell")},490654:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(478425).A)("filled","database-filled","DatabaseFilled",[["path",{d:"M3 15.731c1.968 1.507 5.234 2.269 9 2.269c3.76 0 7.025 -.76 9 -2.252v2.252c0 2.425 -3.895 3.936 -8.693 3.998l-.307 .002c-4.938 0 -9 -1.523 -9 -4z",key:"svg-0"}],["path",{d:"M3 9.731c1.968 1.507 5.234 2.269 9 2.269c3.76 0 7.025 -.76 9 -2.252v2.252c0 2.477 -4.062 4 -9 4c-4.798 0 -8.77 -1.438 -8.979 -3.795l-.016 -.101l-.005 -.104z",key:"svg-1"}],["path",{d:"M12 2c1.041 0 2.044 .068 2.977 .198l.469 .071q .84 .14 1.586 .348l.44 .131l.075 .024a11 11 0 0 1 .805 .3l.199 .086q .535 .242 .967 .53q .165 .11 .313 .225a3.8 3.8 0 0 1 .669 .668l.091 .128q .07 .105 .129 .211l.07 .139q .163 .35 .2 .73l.01 .211c0 2.477 -4.062 4 -9 4c-4.798 0 -8.77 -1.438 -8.979 -3.795a1 1 0 0 1 -.021 -.205l.005 -.104l.016 -.1c.205 -2.306 4.01 -3.733 8.667 -3.794z",key:"svg-2"}]])},496230:(a,b,c)=>{"use strict";c.d(b,{L:()=>e});var d=c(115962);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(!0),[f,g]=(0,d.useState)(!1),[h,i]=(0,d.useState)(null),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)(null),[n,o]=(0,d.useState)(null),[p,q]=(0,d.useState)(null),[r,s]=(0,d.useState)(!1),t=(0,d.useRef)(!0);(0,d.useRef)(1e3);let u=(0,d.useRef)(0),[v,w]=(0,d.useState)(0),x=(0,d.useRef)(new Map),y=(0,d.useCallback)(a=>{let b=x.current,c=new Map,d=a=>a.map(a=>{let e=b.get(a.path),f=a;return"object"===a.type&&!a.defaultView&&e?.defaultView&&(f={...a,defaultView:e.defaultView}),"object"===f.type&&c.set(f.path,{type:f.type,defaultView:f.defaultView}),f.children&&f.children.length>0&&(f={...f,children:d(f.children)}),f}),e=d(a);return x.current=c,e},[]),z=(0,d.useCallback)(async()=>{let a=++u.current;try{let c=r?"?showHidden=1":"",d=await fetch(`/api/workspace/tree${c}`),f=await d.json();t.current&&u.current===a&&(b(y(f.tree??[])),g(f.exists??!1),m(f.workspaceRoot??null),o(f.openclawDir??null),q(f.workspace??f.profile??null),e(!1))}catch{t.current&&u.current===a&&e(!1)}},[r,y]),A=(0,d.useCallback)(async a=>{let c=++u.current;try{e(!0);let d=r?"&showHidden=1":"",f=await fetch(`/api/workspace/browse?dir=${encodeURIComponent(a)}${d}`),h=await f.json();t.current&&u.current===c&&(b(h.entries??[]),k(h.parentDir??null),g(!0),e(!1))}catch{t.current&&u.current===c&&e(!1)}},[r]),B=(0,d.useRef)(null),C=(0,d.useCallback)(a=>{let b=a;null!=a&&l&&a===l&&(b=null),null!=b&&b!==B.current&&e(!0),B.current=b,i(b)},[l]),D=(0,d.useCallback)(async()=>{h?await A(h):await z()},[h,A,z]);return{tree:a,loading:c,exists:f,refresh:(0,d.useCallback)(()=>{D()},[D]),reconnect:(0,d.useCallback)(()=>{w(a=>a+1),D()},[D]),browseDir:h,setBrowseDir:C,parentDir:j,workspaceRoot:l,openclawDir:n,activeWorkspace:p,showHidden:r,setShowHidden:s}}},497001:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(122053),e=c(653913),f=c(537889);b.minBy=function(a,b){if(null!=a)return d.minBy(Array.from(a),f.iteratee(b??e.identity))}},500419:(a,b,c)=>{"use strict";c.d(b,{G:()=>g});var d=c(736927),e=c(115962);function f({state:a}){return"loading"===a?(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:(0,d.jsx)("path",{d:"M21 12a9 9 0 1 1-9-9"})}):"playing"===a?(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,d.jsx)("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1"}),(0,d.jsx)("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1"})]}):(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),(0,d.jsx)("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),(0,d.jsx)("path",{d:"M19 5a10 10 0 0 1 0 14"})]})}function g({text:a}){let[b,c]=(0,e.useState)("idle"),g=(0,e.useRef)(null),h=(0,e.useRef)(null),i=()=>{g.current?.pause(),g.current=null,h.current&&(URL.revokeObjectURL(h.current),h.current=null),c("idle")},j=async()=>{if("loading"!==b){if("playing"===b)return void i();c("loading");try{let b=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})});if(!b.ok)throw Error("Failed to generate audio.");h.current&&URL.revokeObjectURL(h.current);let d=URL.createObjectURL(await b.blob());h.current=d;let e=new Audio(d);g.current=e,e.addEventListener("ended",i,{once:!0}),await e.play(),c("playing")}catch{c("error"),window.setTimeout(()=>c("idle"),2e3)}}};return(0,d.jsx)("button",{type:"button",onClick:()=>void j(),className:"p-1 rounded-md transition-colors",style:{color:"error"===b?"var(--color-error, #ef4444)":"var(--color-text-muted)"},title:"playing"===b?"Stop voice playback":"Play voice","aria-label":"playing"===b?"Stop voice playback":"Play voice",children:(0,d.jsx)(f,{state:b})})}},502044:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(422623);b.throttle=function(a,b=0,c={}){let{leading:e=!0,trailing:f=!0}=c;return d.debounce(a,b,{leading:e,maxWait:b,trailing:f})}},502714:(a,b,c)=>{"use strict";c.d(b,{w:()=>e});var d=c(585698);function e(a,b){return"function"==typeof a?a(b):a&&"object"==typeof a&&d._P in a?a[d._P](b):a instanceof Date?new a.constructor(b):new Date(b)}},505033:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(648438),e=c(783037),f=c(439384),g=c(882351);b.isIterateeCall=function(a,b,c){return!!f.isObject(c)&&(!!("number"==typeof b&&e.isArrayLike(c)&&d.isIndex(b))&&b<c.length||"string"==typeof b&&b in c)&&g.isEqualsSameValueZero(c[b],a)}},509078:(a,b,c)=>{"use strict";c.d(b,{tz:()=>cC,Ip:()=>cE,kt:()=>cF,K5:()=>cG,vL:()=>cH,Rc:()=>cD});var d,e,f,g=c(736927),h=c(115962),i=c.t(h,2),j=c(42813),k=c(155897),l=c(430792),m=c(687193),n=c(988447);function o(a){let b=a+"CollectionProvider",[c,d]=(0,k.A)(b),[e,f]=c(b,{collectionRef:{current:null},itemMap:new Map}),i=a=>{let{scope:b,children:c}=a,d=h.useRef(null),f=h.useRef(new Map).current;return(0,g.jsx)(e,{scope:b,itemMap:f,collectionRef:d,children:c})};i.displayName=b;let j=a+"CollectionSlot",l=(0,n.TL)(j),o=h.forwardRef((a,b)=>{let{scope:c,children:d}=a,e=f(j,c),h=(0,m.s)(b,e.collectionRef);return(0,g.jsx)(l,{ref:h,children:d})});o.displayName=j;let p=a+"CollectionItemSlot",q="data-radix-collection-item",r=(0,n.TL)(p),s=h.forwardRef((a,b)=>{let{scope:c,children:d,...e}=a,i=h.useRef(null),j=(0,m.s)(b,i),k=f(p,c);return h.useEffect(()=>(k.itemMap.set(i,{ref:i,...e}),()=>void k.itemMap.delete(i))),(0,g.jsx)(r,{...{[q]:""},ref:j,children:d})});return s.displayName=p,[{Provider:i,Slot:o,ItemSlot:s},function(b){let c=f(a+"CollectionConsumer",b);return h.useCallback(()=>{let a=c.collectionRef.current;if(!a)return[];let b=Array.from(a.querySelectorAll(`[${q}]`));return Array.from(c.itemMap.values()).sort((a,c)=>b.indexOf(a.ref.current)-b.indexOf(c.ref.current))},[c.collectionRef,c.itemMap])},d]}var p=new WeakMap;function q(a,b){if("at"in Array.prototype)return Array.prototype.at.call(a,b);let c=function(a,b){let c=a.length,d=r(b),e=d>=0?d:c+d;return e<0||e>=c?-1:e}(a,b);return -1===c?void 0:a[c]}function r(a){return a!=a||0===a?0:Math.trunc(a)}(class a extends Map{#a;constructor(a){super(a),this.#a=[...super.keys()],p.set(this,!0)}set(a,b){return p.get(this)&&(this.has(a)?this.#a[this.#a.indexOf(a)]=a:this.#a.push(a)),super.set(a,b),this}insert(a,b,c){let d,e=this.has(b),f=this.#a.length,g=r(a),h=g>=0?g:f+g,i=h<0||h>=f?-1:h;if(i===this.size||e&&i===this.size-1||-1===i)return this.set(b,c),this;let j=this.size+ +!e;g<0&&h++;let k=[...this.#a],l=!1;for(let a=h;a<j;a++)if(h===a){let f=k[a];k[a]===b&&(f=k[a+1]),e&&this.delete(b),d=this.get(f),this.set(b,c)}else{l||k[a-1]!==b||(l=!0);let c=k[l?a:a-1],e=d;d=this.get(c),this.delete(c),this.set(c,e)}return this}with(b,c,d){let e=new a(this);return e.insert(b,c,d),e}before(a){let b=this.#a.indexOf(a)-1;if(!(b<0))return this.entryAt(b)}setBefore(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d,b,c)}after(a){let b=this.#a.indexOf(a);if(-1!==(b=-1===b||b===this.size-1?-1:b+1))return this.entryAt(b)}setAfter(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d+1,b,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#a=[],super.clear()}delete(a){let b=super.delete(a);return b&&this.#a.splice(this.#a.indexOf(a),1),b}deleteAt(a){let b=this.keyAt(a);return void 0!==b&&this.delete(b)}at(a){let b=q(this.#a,a);if(void 0!==b)return this.get(b)}entryAt(a){let b=q(this.#a,a);if(void 0!==b)return[b,this.get(b)]}indexOf(a){return this.#a.indexOf(a)}keyAt(a){return q(this.#a,a)}from(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return d;c++}}findIndex(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return c;c++}return -1}filter(b,c){let d=[],e=0;for(let a of this)Reflect.apply(b,c,[a,e,this])&&d.push(a),e++;return new a(d)}map(b,c){let d=[],e=0;for(let a of this)d.push([a[0],Reflect.apply(b,c,[a,e,this])]),e++;return new a(d)}reduce(...a){let[b,c]=a,d=0,e=c??this.at(0);for(let c of this)e=0===d&&1===a.length?c:Reflect.apply(b,this,[e,c,d,this]),d++;return e}reduceRight(...a){let[b,c]=a,d=c??this.at(-1);for(let c=this.size-1;c>=0;c--){let e=this.at(c);d=c===this.size-1&&1===a.length?e:Reflect.apply(b,this,[d,e,c,this])}return d}toSorted(b){return new a([...this.entries()].sort(b))}toReversed(){let b=new a;for(let a=this.size-1;a>=0;a--){let c=this.keyAt(a),d=this.get(c);b.set(c,d)}return b}toSpliced(...b){let c=[...this.entries()];return c.splice(...b),new a(c)}slice(b,c){let d=new a,e=this.size-1;if(void 0===b)return d;b<0&&(b+=this.size),void 0!==c&&c>0&&(e=c-1);for(let a=b;a<=e;a++){let b=this.keyAt(a),c=this.get(b);d.set(b,c)}return d}every(a,b){let c=0;for(let d of this){if(!Reflect.apply(a,b,[d,c,this]))return!1;c++}return!0}some(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return!0;c++}return!1}});var s=h.createContext(void 0);function t(a){let b=h.useContext(s);return a||b||"ltr"}function u(a){let b=h.useRef(a);return h.useEffect(()=>{b.current=a}),h.useMemo(()=>(...a)=>b.current?.(...a),[])}var v="dismissableLayer.update",w=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),x=h.forwardRef((a,b)=>{let{disableOutsidePointerEvents:c=!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:i,onInteractOutside:k,onDismiss:n,...o}=a,p=h.useContext(w),[q,r]=h.useState(null),s=q?.ownerDocument??globalThis?.document,[,t]=h.useState({}),x=(0,m.s)(b,a=>r(a)),A=Array.from(p.layers),[B]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=A.indexOf(B),D=q?A.indexOf(q):-1,E=p.layersWithOutsidePointerEventsDisabled.size>0,F=D>=C,G=function(a,b=globalThis?.document){let c=u(a),d=h.useRef(!1),e=h.useRef(()=>{});return h.useEffect(()=>{let a=a=>{if(a.target&&!d.current){let d=function(){z("dismissableLayer.pointerDownOutside",c,f,{discrete:!0})},f={originalEvent:a};"touch"===a.pointerType?(b.removeEventListener("click",e.current),e.current=d,b.addEventListener("click",e.current,{once:!0})):d()}else b.removeEventListener("click",e.current);d.current=!1},f=window.setTimeout(()=>{b.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(f),b.removeEventListener("pointerdown",a),b.removeEventListener("click",e.current)}},[b,c]),{onPointerDownCapture:()=>d.current=!0}}(a=>{let b=a.target,c=[...p.branches].some(a=>a.contains(b));F&&!c&&(f?.(a),k?.(a),a.defaultPrevented||n?.())},s),H=function(a,b=globalThis?.document){let c=u(a),d=h.useRef(!1);return h.useEffect(()=>{let a=a=>{a.target&&!d.current&&z("dismissableLayer.focusOutside",c,{originalEvent:a},{discrete:!1})};return b.addEventListener("focusin",a),()=>b.removeEventListener("focusin",a)},[b,c]),{onFocusCapture:()=>d.current=!0,onBlurCapture:()=>d.current=!1}}(a=>{let b=a.target;![...p.branches].some(a=>a.contains(b))&&(i?.(a),k?.(a),a.defaultPrevented||n?.())},s);return!function(a,b=globalThis?.document){let c=u(a);h.useEffect(()=>{let a=a=>{"Escape"===a.key&&c(a)};return b.addEventListener("keydown",a,{capture:!0}),()=>b.removeEventListener("keydown",a,{capture:!0})},[c,b])}(a=>{D===p.layers.size-1&&(d?.(a),!a.defaultPrevented&&n&&(a.preventDefault(),n()))},s),h.useEffect(()=>{if(q)return c&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(e=s.body.style.pointerEvents,s.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(q)),p.layers.add(q),y(),()=>{c&&1===p.layersWithOutsidePointerEventsDisabled.size&&(s.body.style.pointerEvents=e)}},[q,s,c,p]),h.useEffect(()=>()=>{q&&(p.layers.delete(q),p.layersWithOutsidePointerEventsDisabled.delete(q),y())},[q,p]),h.useEffect(()=>{let a=()=>t({});return document.addEventListener(v,a),()=>document.removeEventListener(v,a)},[]),(0,g.jsx)(l.sG.div,{...o,ref:x,style:{pointerEvents:E?F?"auto":"none":void 0,...a.style},onFocusCapture:(0,j.mK)(a.onFocusCapture,H.onFocusCapture),onBlurCapture:(0,j.mK)(a.onBlurCapture,H.onBlurCapture),onPointerDownCapture:(0,j.mK)(a.onPointerDownCapture,G.onPointerDownCapture)})});function y(){let a=new CustomEvent(v);document.dispatchEvent(a)}function z(a,b,c,{discrete:d}){let e=c.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:c});b&&e.addEventListener(a,b,{once:!0}),d?(0,l.hO)(e,f):e.dispatchEvent(f)}x.displayName="DismissableLayer",h.forwardRef((a,b)=>{let c=h.useContext(w),d=h.useRef(null),e=(0,m.s)(b,d);return h.useEffect(()=>{let a=d.current;if(a)return c.branches.add(a),()=>{c.branches.delete(a)}},[c.branches]),(0,g.jsx)(l.sG.div,{...a,ref:e})}).displayName="DismissableLayerBranch";var A=0;function B(){let a=document.createElement("span");return a.setAttribute("data-radix-focus-guard",""),a.tabIndex=0,a.style.outline="none",a.style.opacity="0",a.style.position="fixed",a.style.pointerEvents="none",a}var C="focusScope.autoFocusOnMount",D="focusScope.autoFocusOnUnmount",E={bubbles:!1,cancelable:!0},F=h.forwardRef((a,b)=>{let{loop:c=!1,trapped:d=!1,onMountAutoFocus:e,onUnmountAutoFocus:f,...i}=a,[j,k]=h.useState(null),n=u(e),o=u(f),p=h.useRef(null),q=(0,m.s)(b,a=>k(a)),r=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(d){let a=function(a){if(r.paused||!j)return;let b=a.target;j.contains(b)?p.current=b:I(p.current,{select:!0})},b=function(a){if(r.paused||!j)return;let b=a.relatedTarget;null!==b&&(j.contains(b)||I(p.current,{select:!0}))};document.addEventListener("focusin",a),document.addEventListener("focusout",b);let c=new MutationObserver(function(a){if(document.activeElement===document.body)for(let b of a)b.removedNodes.length>0&&I(j)});return j&&c.observe(j,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",b),c.disconnect()}}},[d,j,r.paused]),h.useEffect(()=>{if(j){J.add(r);let a=document.activeElement;if(!j.contains(a)){let b=new CustomEvent(C,E);j.addEventListener(C,n),j.dispatchEvent(b),b.defaultPrevented||(function(a,{select:b=!1}={}){let c=document.activeElement;for(let d of a)if(I(d,{select:b}),document.activeElement!==c)return}(G(j).filter(a=>"A"!==a.tagName),{select:!0}),document.activeElement===a&&I(j))}return()=>{j.removeEventListener(C,n),setTimeout(()=>{let b=new CustomEvent(D,E);j.addEventListener(D,o),j.dispatchEvent(b),b.defaultPrevented||I(a??document.body,{select:!0}),j.removeEventListener(D,o),J.remove(r)},0)}}},[j,n,o,r]);let s=h.useCallback(a=>{if(!c&&!d||r.paused)return;let b="Tab"===a.key&&!a.altKey&&!a.ctrlKey&&!a.metaKey,e=document.activeElement;if(b&&e){let b=a.currentTarget,[d,f]=function(a){let b=G(a);return[H(b,a),H(b.reverse(),a)]}(b);d&&f?a.shiftKey||e!==f?a.shiftKey&&e===d&&(a.preventDefault(),c&&I(f,{select:!0})):(a.preventDefault(),c&&I(d,{select:!0})):e===b&&a.preventDefault()}},[c,d,r.paused]);return(0,g.jsx)(l.sG.div,{tabIndex:-1,...i,ref:q,onKeyDown:s})});function G(a){let b=[],c=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{let b="INPUT"===a.tagName&&"hidden"===a.type;return a.disabled||a.hidden||b?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;c.nextNode();)b.push(c.currentNode);return b}function H(a,b){for(let c of a)if(!function(a,{upTo:b}){if("hidden"===getComputedStyle(a).visibility)return!0;for(;a&&(void 0===b||a!==b);){if("none"===getComputedStyle(a).display)return!0;a=a.parentElement}return!1}(c,{upTo:b}))return c}function I(a,{select:b=!1}={}){if(a&&a.focus){var c;let d=document.activeElement;a.focus({preventScroll:!0}),a!==d&&(c=a)instanceof HTMLInputElement&&"select"in c&&b&&a.select()}}F.displayName="FocusScope";var J=function(){let a=[];return{add(b){let c=a[0];b!==c&&c?.pause(),(a=K(a,b)).unshift(b)},remove(b){a=K(a,b),a[0]?.resume()}}}();function K(a,b){let c=[...a],d=c.indexOf(b);return -1!==d&&c.splice(d,1),c}var L=c(880696),M=i[" useId ".trim().toString()]||(()=>void 0),N=0;function O(a){let[b,c]=h.useState(M());return(0,L.N)(()=>{a||c(a=>a??String(N++))},[a]),a||(b?`radix-${b}`:"")}var P=c(973815),Q=c(178103),R=h.forwardRef((a,b)=>{let{children:c,width:d=10,height:e=5,...f}=a;return(0,g.jsx)(l.sG.svg,{...f,ref:b,width:d,height:e,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?c:(0,g.jsx)("polygon",{points:"0,0 30,0 15,10"})})});R.displayName="Arrow";var S=c(534864),T="Popper",[U,V]=(0,k.A)(T),[W,X]=U(T),Y=a=>{let{__scopePopper:b,children:c}=a,[d,e]=h.useState(null);return(0,g.jsx)(W,{scope:b,anchor:d,onAnchorChange:e,children:c})};Y.displayName=T;var Z="PopperAnchor",_=h.forwardRef((a,b)=>{let{__scopePopper:c,virtualRef:d,...e}=a,f=X(Z,c),i=h.useRef(null),j=(0,m.s)(b,i),k=h.useRef(null);return h.useEffect(()=>{let a=k.current;k.current=d?.current||i.current,a!==k.current&&f.onAnchorChange(k.current)}),d?null:(0,g.jsx)(l.sG.div,{...e,ref:j})});_.displayName=Z;var aa="PopperContent",[ab,ac]=U(aa),ad=h.forwardRef((a,b)=>{let{__scopePopper:c,side:d="bottom",sideOffset:e=0,align:f="center",alignOffset:i=0,arrowPadding:j=0,avoidCollisions:k=!0,collisionBoundary:n=[],collisionPadding:o=0,sticky:p="partial",hideWhenDetached:q=!1,updatePositionStrategy:r="optimized",onPlaced:s,...t}=a,v=X(aa,c),[w,x]=h.useState(null),y=(0,m.s)(b,a=>x(a)),[z,A]=h.useState(null),B=(0,S.X)(z),C=B?.width??0,D=B?.height??0,E="number"==typeof o?o:{top:0,right:0,bottom:0,left:0,...o},F=Array.isArray(n)?n:[n],G=F.length>0,H={padding:E,boundary:F.filter(ah),altBoundary:G},{refs:I,floatingStyles:J,placement:K,isPositioned:M,middlewareData:N}=(0,P.we)({strategy:"fixed",placement:d+("center"!==f?"-"+f:""),whileElementsMounted:(...a)=>(0,Q.ll)(...a,{animationFrame:"always"===r}),elements:{reference:v.anchor},middleware:[(0,P.cY)({mainAxis:e+D,alignmentAxis:i}),k&&(0,P.BN)({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?(0,P.ER)():void 0,...H}),k&&(0,P.UU)({...H}),(0,P.Ej)({...H,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}}),z&&(0,P.UE)({element:z,padding:j}),ai({arrowWidth:C,arrowHeight:D}),q&&(0,P.jD)({strategy:"referenceHidden",...H})]}),[O,R]=aj(K),T=u(s);(0,L.N)(()=>{M&&T?.()},[M,T]);let U=N.arrow?.x,V=N.arrow?.y,W=N.arrow?.centerOffset!==0,[Y,Z]=h.useState();return(0,L.N)(()=>{w&&Z(window.getComputedStyle(w).zIndex)},[w]),(0,g.jsx)("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:M?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,g.jsx)(ab,{scope:c,placedSide:O,onArrowChange:A,arrowX:U,arrowY:V,shouldHideArrow:W,children:(0,g.jsx)(l.sG.div,{"data-side":O,"data-align":R,...t,ref:y,style:{...t.style,animation:M?void 0:"none"}})})})});ad.displayName=aa;var ae="PopperArrow",af={top:"bottom",right:"left",bottom:"top",left:"right"},ag=h.forwardRef(function(a,b){let{__scopePopper:c,...d}=a,e=ac(ae,c),f=af[e.placedSide];return(0,g.jsx)("span",{ref:e.onArrowChange,style:{position:"absolute",left:e.arrowX,top:e.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[e.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[e.placedSide],visibility:e.shouldHideArrow?"hidden":void 0},children:(0,g.jsx)(R,{...d,ref:b,style:{...d.style,display:"block"}})})});function ah(a){return null!==a}ag.displayName=ae;var ai=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=aj(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function aj(a){let[b,c="center"]=a.split("-");return[b,c]}var ak=c(249855),al=h.forwardRef((a,b)=>{let{container:c,...d}=a,[e,f]=h.useState(!1);(0,L.N)(()=>f(!0),[]);let i=c||e&&globalThis?.document?.body;return i?ak.createPortal((0,g.jsx)(l.sG.div,{...d,ref:b}),i):null});al.displayName="Portal";var am=a=>{let{present:b,children:c}=a,d=function(a){var b,c;let[d,e]=h.useState(),f=h.useRef(null),g=h.useRef(a),i=h.useRef("none"),[j,k]=(b=a?"mounted":"unmounted",c={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},h.useReducer((a,b)=>c[a][b]??a,b));return h.useEffect(()=>{let a=an(f.current);i.current="mounted"===j?a:"none"},[j]),(0,L.N)(()=>{let b=f.current,c=g.current;if(c!==a){let d=i.current,e=an(b);a?k("MOUNT"):"none"===e||b?.display==="none"?k("UNMOUNT"):c&&d!==e?k("ANIMATION_OUT"):k("UNMOUNT"),g.current=a}},[a,k]),(0,L.N)(()=>{if(d){let a,b=d.ownerDocument.defaultView??window,c=c=>{let e=an(f.current).includes(CSS.escape(c.animationName));if(c.target===d&&e&&(k("ANIMATION_END"),!g.current)){let c=d.style.animationFillMode;d.style.animationFillMode="forwards",a=b.setTimeout(()=>{"forwards"===d.style.animationFillMode&&(d.style.animationFillMode=c)})}},e=a=>{a.target===d&&(i.current=an(f.current))};return d.addEventListener("animationstart",e),d.addEventListener("animationcancel",c),d.addEventListener("animationend",c),()=>{b.clearTimeout(a),d.removeEventListener("animationstart",e),d.removeEventListener("animationcancel",c),d.removeEventListener("animationend",c)}}k("ANIMATION_END")},[d,k]),{isPresent:["mounted","unmountSuspended"].includes(j),ref:h.useCallback(a=>{f.current=a?getComputedStyle(a):null,e(a)},[])}}(b),e="function"==typeof c?c({present:d.isPresent}):h.Children.only(c),f=(0,m.s)(d.ref,function(a){let b=Object.getOwnPropertyDescriptor(a.props,"ref")?.get,c=b&&"isReactWarning"in b&&b.isReactWarning;return c?a.ref:(c=(b=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in b&&b.isReactWarning)?a.props.ref:a.props.ref||a.ref}(e));return"function"==typeof c||d.isPresent?h.cloneElement(e,{ref:f}):null};function an(a){return a?.animationName||"none"}am.displayName="Presence";var ao=c(173092),ap="rovingFocusGroup.onEntryFocus",aq={bubbles:!1,cancelable:!0},ar="RovingFocusGroup",[as,at,au]=o(ar),[av,aw]=(0,k.A)(ar,[au]),[ax,ay]=av(ar),az=h.forwardRef((a,b)=>(0,g.jsx)(as.Provider,{scope:a.__scopeRovingFocusGroup,children:(0,g.jsx)(as.Slot,{scope:a.__scopeRovingFocusGroup,children:(0,g.jsx)(aA,{...a,ref:b})})}));az.displayName=ar;var aA=h.forwardRef((a,b)=>{let{__scopeRovingFocusGroup:c,orientation:d,loop:e=!1,dir:f,currentTabStopId:i,defaultCurrentTabStopId:k,onCurrentTabStopIdChange:n,onEntryFocus:o,preventScrollOnEntryFocus:p=!1,...q}=a,r=h.useRef(null),s=(0,m.s)(b,r),v=t(f),[w,x]=(0,ao.i)({prop:i,defaultProp:k??null,onChange:n,caller:ar}),[y,z]=h.useState(!1),A=u(o),B=at(c),C=h.useRef(!1),[D,E]=h.useState(0);return h.useEffect(()=>{let a=r.current;if(a)return a.addEventListener(ap,A),()=>a.removeEventListener(ap,A)},[A]),(0,g.jsx)(ax,{scope:c,orientation:d,dir:v,loop:e,currentTabStopId:w,onItemFocus:h.useCallback(a=>x(a),[x]),onItemShiftTab:h.useCallback(()=>z(!0),[]),onFocusableItemAdd:h.useCallback(()=>E(a=>a+1),[]),onFocusableItemRemove:h.useCallback(()=>E(a=>a-1),[]),children:(0,g.jsx)(l.sG.div,{tabIndex:y||0===D?-1:0,"data-orientation":d,...q,ref:s,style:{outline:"none",...a.style},onMouseDown:(0,j.mK)(a.onMouseDown,()=>{C.current=!0}),onFocus:(0,j.mK)(a.onFocus,a=>{let b=!C.current;if(a.target===a.currentTarget&&b&&!y){let b=new CustomEvent(ap,aq);if(a.currentTarget.dispatchEvent(b),!b.defaultPrevented){let a=B().filter(a=>a.focusable);aE([a.find(a=>a.active),a.find(a=>a.id===w),...a].filter(Boolean).map(a=>a.ref.current),p)}}C.current=!1}),onBlur:(0,j.mK)(a.onBlur,()=>z(!1))})})}),aB="RovingFocusGroupItem",aC=h.forwardRef((a,b)=>{let{__scopeRovingFocusGroup:c,focusable:d=!0,active:e=!1,tabStopId:f,children:i,...k}=a,m=O(),n=f||m,o=ay(aB,c),p=o.currentTabStopId===n,q=at(c),{onFocusableItemAdd:r,onFocusableItemRemove:s,currentTabStopId:t}=o;return h.useEffect(()=>{if(d)return r(),()=>s()},[d,r,s]),(0,g.jsx)(as.ItemSlot,{scope:c,id:n,focusable:d,active:e,children:(0,g.jsx)(l.sG.span,{tabIndex:p?0:-1,"data-orientation":o.orientation,...k,ref:b,onMouseDown:(0,j.mK)(a.onMouseDown,a=>{d?o.onItemFocus(n):a.preventDefault()}),onFocus:(0,j.mK)(a.onFocus,()=>o.onItemFocus(n)),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{if("Tab"===a.key&&a.shiftKey)return void o.onItemShiftTab();if(a.target!==a.currentTarget)return;let b=function(a,b,c){var d;let e=(d=a.key,"rtl"!==c?d:"ArrowLeft"===d?"ArrowRight":"ArrowRight"===d?"ArrowLeft":d);if(!("vertical"===b&&["ArrowLeft","ArrowRight"].includes(e))&&!("horizontal"===b&&["ArrowUp","ArrowDown"].includes(e)))return aD[e]}(a,o.orientation,o.dir);if(void 0!==b){if(a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;a.preventDefault();let c=q().filter(a=>a.focusable).map(a=>a.ref.current);if("last"===b)c.reverse();else if("prev"===b||"next"===b){"prev"===b&&c.reverse();let d=c.indexOf(a.currentTarget);c=o.loop?function(a,b){return a.map((c,d)=>a[(b+d)%a.length])}(c,d+1):c.slice(d+1)}setTimeout(()=>aE(c))}}),children:"function"==typeof i?i({isCurrentTabStop:p,hasTabStop:null!=t}):i})})});aC.displayName=aB;var aD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aE(a,b=!1){let c=document.activeElement;for(let d of a)if(d===c||(d.focus({preventScroll:b}),document.activeElement!==c))return}var aF=function(a){return"undefined"==typeof document?null:(Array.isArray(a)?a[0]:a).ownerDocument.body},aG=new WeakMap,aH=new WeakMap,aI={},aJ=0,aK=function(a){return a&&(a.host||aK(a.parentNode))},aL=function(a,b,c,d){var e=(Array.isArray(a)?a:[a]).map(function(a){if(b.contains(a))return a;var c=aK(a);return c&&b.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",b,". Doing nothing"),null)}).filter(function(a){return!!a});aI[c]||(aI[c]=new WeakMap);var f=aI[c],g=[],h=new Set,i=new Set(e),j=function(a){!a||h.has(a)||(h.add(a),j(a.parentNode))};e.forEach(j);var k=function(a){!a||i.has(a)||Array.prototype.forEach.call(a.children,function(a){if(h.has(a))k(a);else try{var b=a.getAttribute(d),e=null!==b&&"false"!==b,i=(aG.get(a)||0)+1,j=(f.get(a)||0)+1;aG.set(a,i),f.set(a,j),g.push(a),1===i&&e&&aH.set(a,!0),1===j&&a.setAttribute(c,"true"),e||a.setAttribute(d,"true")}catch(b){console.error("aria-hidden: cannot operate on ",a,b)}})};return k(b),h.clear(),aJ++,function(){g.forEach(function(a){var b=aG.get(a)-1,e=f.get(a)-1;aG.set(a,b),f.set(a,e),b||(aH.has(a)||a.removeAttribute(d),aH.delete(a)),e||a.removeAttribute(c)}),--aJ||(aG=new WeakMap,aG=new WeakMap,aH=new WeakMap,aI={})}},aM=function(a,b,c){void 0===c&&(c="data-aria-hidden");var d=Array.from(Array.isArray(a)?a:[a]),e=b||aF(a);return e?(d.push.apply(d,Array.from(e.querySelectorAll("[aria-live], script"))),aL(d,e,c,"aria-hidden")):function(){return null}},aN=function(){return(aN=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c])Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a}).apply(this,arguments)};function aO(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&Object.prototype.propertyIsEnumerable.call(a,d[e])&&(c[d[e]]=a[d[e]]);return c}Object.create;Object.create;var aP=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),aQ="width-before-scroll-bar";function aR(a,b){return"function"==typeof a?a(b):a&&(a.current=b),a}var aS="undefined"!=typeof window?h.useLayoutEffect:h.useEffect,aT=new WeakMap;function aU(a){return a}var aV=function(a){void 0===a&&(a={});var b,c,d,e,f=(b=null,void 0===c&&(c=aU),d=[],e=!1,{read:function(){if(e)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return d.length?d[d.length-1]:null},useMedium:function(a){var b=c(a,e);return d.push(b),function(){d=d.filter(function(a){return a!==b})}},assignSyncMedium:function(a){for(e=!0;d.length;){var b=d;d=[],b.forEach(a)}d={push:function(b){return a(b)},filter:function(){return d}}},assignMedium:function(a){e=!0;var b=[];if(d.length){var c=d;d=[],c.forEach(a),b=d}var f=function(){var c=b;b=[],c.forEach(a)},g=function(){return Promise.resolve().then(f)};g(),d={push:function(a){b.push(a),g()},filter:function(a){return b=b.filter(a),d}}}});return f.options=aN({async:!0,ssr:!1},a),f}(),aW=function(){},aX=h.forwardRef(function(a,b){var c,d,e,f,g=h.useRef(null),i=h.useState({onScrollCapture:aW,onWheelCapture:aW,onTouchMoveCapture:aW}),j=i[0],k=i[1],l=a.forwardProps,m=a.children,n=a.className,o=a.removeScrollBar,p=a.enabled,q=a.shards,r=a.sideCar,s=a.noRelative,t=a.noIsolation,u=a.inert,v=a.allowPinchZoom,w=a.as,x=a.gapMode,y=aO(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=(c=[g,b],d=function(a){return c.forEach(function(b){return aR(b,a)})},(e=(0,h.useState)(function(){return{value:null,callback:d,facade:{get current(){return e.value},set current(value){var a=e.value;a!==value&&(e.value=value,e.callback(value,a))}}}})[0]).callback=d,f=e.facade,aS(function(){var a=aT.get(f);if(a){var b=new Set(a),d=new Set(c),e=f.current;b.forEach(function(a){d.has(a)||aR(a,null)}),d.forEach(function(a){b.has(a)||aR(a,e)})}aT.set(f,c)},[c]),f),A=aN(aN({},y),j);return h.createElement(h.Fragment,null,p&&h.createElement(r,{sideCar:aV,removeScrollBar:o,shards:q,noRelative:s,noIsolation:t,inert:u,setCallbacks:k,allowPinchZoom:!!v,lockRef:g,gapMode:x}),l?h.cloneElement(h.Children.only(m),aN(aN({},A),{ref:z})):h.createElement(void 0===w?"div":w,aN({},A,{className:n,ref:z}),m))});aX.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},aX.classNames={fullWidth:aQ,zeroRight:aP};var aY=function(a){var b=a.sideCar,c=aO(a,["sideCar"]);if(!b)throw Error("Sidecar: please provide `sideCar` property to import the right car");var d=b.read();if(!d)throw Error("Sidecar medium not found");return h.createElement(d,aN({},c))};aY.isSideCarExport=!0;var aZ=function(){var a=0,b=null;return{add:function(d){if(0==a&&(b=function(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var b=f||c.nc;return b&&a.setAttribute("nonce",b),a}())){var e,g;(e=b).styleSheet?e.styleSheet.cssText=d:e.appendChild(document.createTextNode(d)),g=b,(document.head||document.getElementsByTagName("head")[0]).appendChild(g)}a++},remove:function(){--a||!b||(b.parentNode&&b.parentNode.removeChild(b),b=null)}}},a$=function(){var a=aZ();return function(b,c){h.useEffect(function(){return a.add(b),function(){a.remove()}},[b&&c])}},a_=function(){var a=a$();return function(b){return a(b.styles,b.dynamic),null}},a0={left:0,top:0,right:0,gap:0},a1=function(a){return parseInt(a||"",10)||0},a2=function(a){var b=window.getComputedStyle(document.body),c=b["padding"===a?"paddingLeft":"marginLeft"],d=b["padding"===a?"paddingTop":"marginTop"],e=b["padding"===a?"paddingRight":"marginRight"];return[a1(c),a1(d),a1(e)]},a3=function(a){if(void 0===a&&(a="margin"),"undefined"==typeof window)return a0;var b=a2(a),c=document.documentElement.clientWidth,d=window.innerWidth;return{left:b[0],top:b[1],right:b[2],gap:Math.max(0,d-c+b[2]-b[0])}},a4=a_(),a5="data-scroll-locked",a6=function(a,b,c,d){var e=a.left,f=a.top,g=a.right,h=a.gap;return void 0===c&&(c="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(d,";\n padding-right: ").concat(h,"px ").concat(d,";\n }\n body[").concat(a5,"] {\n overflow: hidden ").concat(d,";\n overscroll-behavior: contain;\n ").concat([b&&"position: relative ".concat(d,";"),"margin"===c&&"\n padding-left: ".concat(e,"px;\n padding-top: ").concat(f,"px;\n padding-right: ").concat(g,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(h,"px ").concat(d,";\n "),"padding"===c&&"padding-right: ".concat(h,"px ").concat(d,";")].filter(Boolean).join(""),"\n }\n \n .").concat(aP," {\n right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(aQ," {\n margin-right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(aP," .").concat(aP," {\n right: 0 ").concat(d,";\n }\n \n .").concat(aQ," .").concat(aQ," {\n margin-right: 0 ").concat(d,";\n }\n \n body[").concat(a5,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(h,"px;\n }\n")},a7=function(){var a=parseInt(document.body.getAttribute(a5)||"0",10);return isFinite(a)?a:0},a8=function(){h.useEffect(function(){return document.body.setAttribute(a5,(a7()+1).toString()),function(){var a=a7()-1;a<=0?document.body.removeAttribute(a5):document.body.setAttribute(a5,a.toString())}},[])},a9=function(a){var b=a.noRelative,c=a.noImportant,d=a.gapMode,e=void 0===d?"margin":d;a8();var f=h.useMemo(function(){return a3(e)},[e]);return h.createElement(a4,{styles:a6(f,!b,e,c?"":"!important")})},ba=!1;if("undefined"!=typeof window)try{var bb=Object.defineProperty({},"passive",{get:function(){return ba=!0,!0}});window.addEventListener("test",bb,bb),window.removeEventListener("test",bb,bb)}catch(a){ba=!1}var bc=!!ba&&{passive:!1},bd=function(a,b){if(!(a instanceof Element))return!1;var c=window.getComputedStyle(a);return"hidden"!==c[b]&&(c.overflowY!==c.overflowX||"TEXTAREA"===a.tagName||"visible"!==c[b])},be=function(a,b){var c=b.ownerDocument,d=b;do{if("undefined"!=typeof ShadowRoot&&d instanceof ShadowRoot&&(d=d.host),bf(a,d)){var e=bg(a,d);if(e[1]>e[2])return!0}d=d.parentNode}while(d&&d!==c.body);return!1},bf=function(a,b){return"v"===a?bd(b,"overflowY"):bd(b,"overflowX")},bg=function(a,b){return"v"===a?[b.scrollTop,b.scrollHeight,b.clientHeight]:[b.scrollLeft,b.scrollWidth,b.clientWidth]},bh=function(a,b,c,d,e){var f,g=(f=window.getComputedStyle(b).direction,"h"===a&&"rtl"===f?-1:1),h=g*d,i=c.target,j=b.contains(i),k=!1,l=h>0,m=0,n=0;do{if(!i)break;var o=bg(a,i),p=o[0],q=o[1]-o[2]-g*p;(p||q)&&bf(a,i)&&(m+=q,n+=p);var r=i.parentNode;i=r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?r.host:r}while(!j&&i!==document.body||j&&(b.contains(i)||b===i));return l&&(e&&1>Math.abs(m)||!e&&h>m)?k=!0:!l&&(e&&1>Math.abs(n)||!e&&-h>n)&&(k=!0),k},bi=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},bj=function(a){return[a.deltaX,a.deltaY]},bk=function(a){return a&&"current"in a?a.current:a},bl=0,bm=[];let bn=(d=function(a){var b=h.useRef([]),c=h.useRef([0,0]),d=h.useRef(),e=h.useState(bl++)[0],f=h.useState(a_)[0],g=h.useRef(a);h.useEffect(function(){g.current=a},[a]),h.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(e));var b=(function(a,b,c){if(c||2==arguments.length)for(var d,e=0,f=b.length;e<f;e++)!d&&e in b||(d||(d=Array.prototype.slice.call(b,0,e)),d[e]=b[e]);return a.concat(d||Array.prototype.slice.call(b))})([a.lockRef.current],(a.shards||[]).map(bk),!0).filter(Boolean);return b.forEach(function(a){return a.classList.add("allow-interactivity-".concat(e))}),function(){document.body.classList.remove("block-interactivity-".concat(e)),b.forEach(function(a){return a.classList.remove("allow-interactivity-".concat(e))})}}},[a.inert,a.lockRef.current,a.shards]);var i=h.useCallback(function(a,b){if("touches"in a&&2===a.touches.length||"wheel"===a.type&&a.ctrlKey)return!g.current.allowPinchZoom;var e,f=bi(a),h=c.current,i="deltaX"in a?a.deltaX:h[0]-f[0],j="deltaY"in a?a.deltaY:h[1]-f[1],k=a.target,l=Math.abs(i)>Math.abs(j)?"h":"v";if("touches"in a&&"h"===l&&"range"===k.type)return!1;var m=window.getSelection(),n=m&&m.anchorNode;if(n&&(n===k||n.contains(k)))return!1;var o=be(l,k);if(!o)return!0;if(o?e=l:(e="v"===l?"h":"v",o=be(l,k)),!o)return!1;if(!d.current&&"changedTouches"in a&&(i||j)&&(d.current=e),!e)return!0;var p=d.current||e;return bh(p,b,a,"h"===p?i:j,!0)},[]),j=h.useCallback(function(a){if(bm.length&&bm[bm.length-1]===f){var c="deltaY"in a?bj(a):bi(a),d=b.current.filter(function(b){var d;return b.name===a.type&&(b.target===a.target||a.target===b.shadowParent)&&(d=b.delta,d[0]===c[0]&&d[1]===c[1])})[0];if(d&&d.should){a.cancelable&&a.preventDefault();return}if(!d){var e=(g.current.shards||[]).map(bk).filter(Boolean).filter(function(b){return b.contains(a.target)});(e.length>0?i(a,e[0]):!g.current.noIsolation)&&a.cancelable&&a.preventDefault()}}},[]),k=h.useCallback(function(a,c,d,e){var f={name:a,delta:c,target:d,should:e,shadowParent:function(a){for(var b=null;null!==a;)a instanceof ShadowRoot&&(b=a.host,a=a.host),a=a.parentNode;return b}(d)};b.current.push(f),setTimeout(function(){b.current=b.current.filter(function(a){return a!==f})},1)},[]),l=h.useCallback(function(a){c.current=bi(a),d.current=void 0},[]),m=h.useCallback(function(b){k(b.type,bj(b),b.target,i(b,a.lockRef.current))},[]),n=h.useCallback(function(b){k(b.type,bi(b),b.target,i(b,a.lockRef.current))},[]);h.useEffect(function(){return bm.push(f),a.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:n}),document.addEventListener("wheel",j,bc),document.addEventListener("touchmove",j,bc),document.addEventListener("touchstart",l,bc),function(){bm=bm.filter(function(a){return a!==f}),document.removeEventListener("wheel",j,bc),document.removeEventListener("touchmove",j,bc),document.removeEventListener("touchstart",l,bc)}},[]);var o=a.removeScrollBar,p=a.inert;return h.createElement(h.Fragment,null,p?h.createElement(f,{styles:"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")}):null,o?h.createElement(a9,{noRelative:a.noRelative,gapMode:a.gapMode}):null)},aV.useMedium(d),aY);var bo=h.forwardRef(function(a,b){return h.createElement(aX,aN({},a,{ref:b,sideCar:bn}))});bo.classNames=aX.classNames;var bp=["Enter"," "],bq=["ArrowUp","PageDown","End"],br=["ArrowDown","PageUp","Home",...bq],bs={ltr:[...bp,"ArrowRight"],rtl:[...bp,"ArrowLeft"]},bt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bu="Menu",[bv,bw,bx]=o(bu),[by,bz]=(0,k.A)(bu,[bx,V,aw]),bA=V(),bB=aw(),[bC,bD]=by(bu),[bE,bF]=by(bu),bG=a=>{let{__scopeMenu:b,open:c=!1,children:d,dir:e,onOpenChange:f,modal:i=!0}=a,j=bA(b),[k,l]=h.useState(null),m=h.useRef(!1),n=u(f),o=t(e);return h.useEffect(()=>{let a=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),(0,g.jsx)(Y,{...j,children:(0,g.jsx)(bC,{scope:b,open:c,onOpenChange:n,content:k,onContentChange:l,children:(0,g.jsx)(bE,{scope:b,onClose:h.useCallback(()=>n(!1),[n]),isUsingKeyboardRef:m,dir:o,modal:i,children:d})})})};bG.displayName=bu;var bH=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=bA(c);return(0,g.jsx)(_,{...e,...d,ref:b})});bH.displayName="MenuAnchor";var bI="MenuPortal",[bJ,bK]=by(bI,{forceMount:void 0}),bL=a=>{let{__scopeMenu:b,forceMount:c,children:d,container:e}=a,f=bD(bI,b);return(0,g.jsx)(bJ,{scope:b,forceMount:c,children:(0,g.jsx)(am,{present:c||f.open,children:(0,g.jsx)(al,{asChild:!0,container:e,children:d})})})};bL.displayName=bI;var bM="MenuContent",[bN,bO]=by(bM),bP=h.forwardRef((a,b)=>{let c=bK(bM,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=bD(bM,a.__scopeMenu),h=bF(bM,a.__scopeMenu);return(0,g.jsx)(bv.Provider,{scope:a.__scopeMenu,children:(0,g.jsx)(am,{present:d||f.open,children:(0,g.jsx)(bv.Slot,{scope:a.__scopeMenu,children:h.modal?(0,g.jsx)(bQ,{...e,ref:b}):(0,g.jsx)(bR,{...e,ref:b})})})})}),bQ=h.forwardRef((a,b)=>{let c=bD(bM,a.__scopeMenu),d=h.useRef(null),e=(0,m.s)(b,d);return h.useEffect(()=>{let a=d.current;if(a)return aM(a)},[]),(0,g.jsx)(bT,{...a,ref:e,trapFocus:c.open,disableOutsidePointerEvents:c.open,disableOutsideScroll:!0,onFocusOutside:(0,j.mK)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>c.onOpenChange(!1)})}),bR=h.forwardRef((a,b)=>{let c=bD(bM,a.__scopeMenu);return(0,g.jsx)(bT,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>c.onOpenChange(!1)})}),bS=(0,n.TL)("MenuContent.ScrollLock"),bT=h.forwardRef((a,b)=>{let{__scopeMenu:c,loop:d=!1,trapFocus:e,onOpenAutoFocus:f,onCloseAutoFocus:i,disableOutsidePointerEvents:k,onEntryFocus:l,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:p,onInteractOutside:q,onDismiss:r,disableOutsideScroll:s,...t}=a,u=bD(bM,c),v=bF(bM,c),w=bA(c),y=bB(c),z=bw(c),[C,D]=h.useState(null),E=h.useRef(null),G=(0,m.s)(b,E,u.onContentChange),H=h.useRef(0),I=h.useRef(""),J=h.useRef(0),K=h.useRef(null),L=h.useRef("right"),M=h.useRef(0),N=s?bo:h.Fragment;h.useEffect(()=>()=>window.clearTimeout(H.current),[]),h.useEffect(()=>{let a=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",a[0]??B()),document.body.insertAdjacentElement("beforeend",a[1]??B()),A++,()=>{1===A&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),A--}},[]);let O=h.useCallback(a=>L.current===K.current?.side&&function(a,b){return!!b&&function(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}({x:a.clientX,y:a.clientY},b)}(a,K.current?.area),[]);return(0,g.jsx)(bN,{scope:c,searchRef:I,onItemEnter:h.useCallback(a=>{O(a)&&a.preventDefault()},[O]),onItemLeave:h.useCallback(a=>{O(a)||(E.current?.focus(),D(null))},[O]),onTriggerLeave:h.useCallback(a=>{O(a)&&a.preventDefault()},[O]),pointerGraceTimerRef:J,onPointerGraceIntentChange:h.useCallback(a=>{K.current=a},[]),children:(0,g.jsx)(N,{...s?{as:bS,allowPinchZoom:!0}:void 0,children:(0,g.jsx)(F,{asChild:!0,trapped:e,onMountAutoFocus:(0,j.mK)(f,a=>{a.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,g.jsx)(x,{asChild:!0,disableOutsidePointerEvents:k,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:p,onInteractOutside:q,onDismiss:r,children:(0,g.jsx)(az,{asChild:!0,...y,dir:v.dir,orientation:"vertical",loop:d,currentTabStopId:C,onCurrentTabStopIdChange:D,onEntryFocus:(0,j.mK)(l,a=>{v.isUsingKeyboardRef.current||a.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,g.jsx)(ad,{role:"menu","aria-orientation":"vertical","data-state":ci(u.open),"data-radix-menu-content":"",dir:v.dir,...w,...t,ref:G,style:{outline:"none",...t.style},onKeyDown:(0,j.mK)(t.onKeyDown,a=>{let b=a.target.closest("[data-radix-menu-content]")===a.currentTarget,c=a.ctrlKey||a.altKey||a.metaKey,d=1===a.key.length;b&&("Tab"===a.key&&a.preventDefault(),!c&&d&&(a=>{let b=I.current+a,c=z().filter(a=>!a.disabled),d=document.activeElement,e=c.find(a=>a.ref.current===d)?.textValue,f=function(a,b,c){var d;let e=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,f=c?a.indexOf(c):-1,g=(d=Math.max(f,0),a.map((b,c)=>a[(d+c)%a.length]));1===e.length&&(g=g.filter(a=>a!==c));let h=g.find(a=>a.toLowerCase().startsWith(e.toLowerCase()));return h!==c?h:void 0}(c.map(a=>a.textValue),b,e),g=c.find(a=>a.textValue===f)?.ref.current;!function a(b){I.current=b,window.clearTimeout(H.current),""!==b&&(H.current=window.setTimeout(()=>a(""),1e3))}(b),g&&setTimeout(()=>g.focus())})(a.key));let e=E.current;if(a.target!==e||!br.includes(a.key))return;a.preventDefault();let f=z().filter(a=>!a.disabled).map(a=>a.ref.current);bq.includes(a.key)&&f.reverse(),function(a){let b=document.activeElement;for(let c of a)if(c===b||(c.focus(),document.activeElement!==b))return}(f)}),onBlur:(0,j.mK)(a.onBlur,a=>{a.currentTarget.contains(a.target)||(window.clearTimeout(H.current),I.current="")}),onPointerMove:(0,j.mK)(a.onPointerMove,cl(a=>{let b=a.target,c=M.current!==a.clientX;a.currentTarget.contains(b)&&c&&(L.current=a.clientX>M.current?"right":"left",M.current=a.clientX)}))})})})})})})});bP.displayName=bM;var bU=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,g.jsx)(l.sG.div,{role:"group",...d,ref:b})});bU.displayName="MenuGroup";var bV=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,g.jsx)(l.sG.div,{...d,ref:b})});bV.displayName="MenuLabel";var bW="MenuItem",bX="menu.itemSelect",bY=h.forwardRef((a,b)=>{let{disabled:c=!1,onSelect:d,...e}=a,f=h.useRef(null),i=bF(bW,a.__scopeMenu),k=bO(bW,a.__scopeMenu),n=(0,m.s)(b,f),o=h.useRef(!1);return(0,g.jsx)(bZ,{...e,ref:n,disabled:c,onClick:(0,j.mK)(a.onClick,()=>{let a=f.current;if(!c&&a){let b=new CustomEvent(bX,{bubbles:!0,cancelable:!0});a.addEventListener(bX,a=>d?.(a),{once:!0}),(0,l.hO)(a,b),b.defaultPrevented?o.current=!1:i.onClose()}}),onPointerDown:b=>{a.onPointerDown?.(b),o.current=!0},onPointerUp:(0,j.mK)(a.onPointerUp,a=>{o.current||a.currentTarget?.click()}),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{let b=""!==k.searchRef.current;c||b&&" "===a.key||bp.includes(a.key)&&(a.currentTarget.click(),a.preventDefault())})})});bY.displayName=bW;var bZ=h.forwardRef((a,b)=>{let{__scopeMenu:c,disabled:d=!1,textValue:e,...f}=a,i=bO(bW,c),k=bB(c),n=h.useRef(null),o=(0,m.s)(b,n),[p,q]=h.useState(!1),[r,s]=h.useState("");return h.useEffect(()=>{let a=n.current;a&&s((a.textContent??"").trim())},[f.children]),(0,g.jsx)(bv.ItemSlot,{scope:c,disabled:d,textValue:e??r,children:(0,g.jsx)(aC,{asChild:!0,...k,focusable:!d,children:(0,g.jsx)(l.sG.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":d||void 0,"data-disabled":d?"":void 0,...f,ref:o,onPointerMove:(0,j.mK)(a.onPointerMove,cl(a=>{d?i.onItemLeave(a):(i.onItemEnter(a),a.defaultPrevented||a.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,j.mK)(a.onPointerLeave,cl(a=>i.onItemLeave(a))),onFocus:(0,j.mK)(a.onFocus,()=>q(!0)),onBlur:(0,j.mK)(a.onBlur,()=>q(!1))})})})}),b$=h.forwardRef((a,b)=>{let{checked:c=!1,onCheckedChange:d,...e}=a;return(0,g.jsx)(b6,{scope:a.__scopeMenu,checked:c,children:(0,g.jsx)(bY,{role:"menuitemcheckbox","aria-checked":cj(c)?"mixed":c,...e,ref:b,"data-state":ck(c),onSelect:(0,j.mK)(e.onSelect,()=>d?.(!!cj(c)||!c),{checkForDefaultPrevented:!1})})})});b$.displayName="MenuCheckboxItem";var b_="MenuRadioGroup",[b0,b1]=by(b_,{value:void 0,onValueChange:()=>{}}),b2=h.forwardRef((a,b)=>{let{value:c,onValueChange:d,...e}=a,f=u(d);return(0,g.jsx)(b0,{scope:a.__scopeMenu,value:c,onValueChange:f,children:(0,g.jsx)(bU,{...e,ref:b})})});b2.displayName=b_;var b3="MenuRadioItem",b4=h.forwardRef((a,b)=>{let{value:c,...d}=a,e=b1(b3,a.__scopeMenu),f=c===e.value;return(0,g.jsx)(b6,{scope:a.__scopeMenu,checked:f,children:(0,g.jsx)(bY,{role:"menuitemradio","aria-checked":f,...d,ref:b,"data-state":ck(f),onSelect:(0,j.mK)(d.onSelect,()=>e.onValueChange?.(c),{checkForDefaultPrevented:!1})})})});b4.displayName=b3;var b5="MenuItemIndicator",[b6,b7]=by(b5,{checked:!1}),b8=h.forwardRef((a,b)=>{let{__scopeMenu:c,forceMount:d,...e}=a,f=b7(b5,c);return(0,g.jsx)(am,{present:d||cj(f.checked)||!0===f.checked,children:(0,g.jsx)(l.sG.span,{...e,ref:b,"data-state":ck(f.checked)})})});b8.displayName=b5;var b9=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,g.jsx)(l.sG.div,{role:"separator","aria-orientation":"horizontal",...d,ref:b})});b9.displayName="MenuSeparator";var ca=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=bA(c);return(0,g.jsx)(ag,{...e,...d,ref:b})});ca.displayName="MenuArrow";var cb="MenuSub",[cc,cd]=by(cb);var ce="MenuSubTrigger",cf=h.forwardRef((a,b)=>{let c=bD(ce,a.__scopeMenu),d=bF(ce,a.__scopeMenu),e=cd(ce,a.__scopeMenu),f=bO(ce,a.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:k,onPointerGraceIntentChange:l}=f,n={__scopeMenu:a.__scopeMenu},o=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>o,[o]),h.useEffect(()=>{let a=k.current;return()=>{window.clearTimeout(a),l(null)}},[k,l]),(0,g.jsx)(bH,{asChild:!0,...n,children:(0,g.jsx)(bZ,{id:e.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":e.contentId,"data-state":ci(c.open),...a,ref:(0,m.t)(b,e.onTriggerChange),onClick:b=>{a.onClick?.(b),a.disabled||b.defaultPrevented||(b.currentTarget.focus(),c.open||c.onOpenChange(!0))},onPointerMove:(0,j.mK)(a.onPointerMove,cl(b=>{f.onItemEnter(b),!b.defaultPrevented&&(a.disabled||c.open||i.current||(f.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{c.onOpenChange(!0),o()},100)))})),onPointerLeave:(0,j.mK)(a.onPointerLeave,cl(a=>{o();let b=c.content?.getBoundingClientRect();if(b){let d=c.content?.dataset.side,e="right"===d,g=b[e?"left":"right"],h=b[e?"right":"left"];f.onPointerGraceIntentChange({area:[{x:a.clientX+(e?-5:5),y:a.clientY},{x:g,y:b.top},{x:h,y:b.top},{x:h,y:b.bottom},{x:g,y:b.bottom}],side:d}),window.clearTimeout(k.current),k.current=window.setTimeout(()=>f.onPointerGraceIntentChange(null),300)}else{if(f.onTriggerLeave(a),a.defaultPrevented)return;f.onPointerGraceIntentChange(null)}})),onKeyDown:(0,j.mK)(a.onKeyDown,b=>{let e=""!==f.searchRef.current;a.disabled||e&&" "===b.key||bs[d.dir].includes(b.key)&&(c.onOpenChange(!0),c.content?.focus(),b.preventDefault())})})})});cf.displayName=ce;var cg="MenuSubContent",ch=h.forwardRef((a,b)=>{let c=bK(bM,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=bD(bM,a.__scopeMenu),i=bF(bM,a.__scopeMenu),k=cd(cg,a.__scopeMenu),l=h.useRef(null),n=(0,m.s)(b,l);return(0,g.jsx)(bv.Provider,{scope:a.__scopeMenu,children:(0,g.jsx)(am,{present:d||f.open,children:(0,g.jsx)(bv.Slot,{scope:a.__scopeMenu,children:(0,g.jsx)(bT,{id:k.contentId,"aria-labelledby":k.triggerId,...e,ref:n,align:"start",side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{i.isUsingKeyboardRef.current&&l.current?.focus(),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:(0,j.mK)(a.onFocusOutside,a=>{a.target!==k.trigger&&f.onOpenChange(!1)}),onEscapeKeyDown:(0,j.mK)(a.onEscapeKeyDown,a=>{i.onClose(),a.preventDefault()}),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{let b=a.currentTarget.contains(a.target),c=bt[i.dir].includes(a.key);b&&c&&(f.onOpenChange(!1),k.trigger?.focus(),a.preventDefault())})})})})})});function ci(a){return a?"open":"closed"}function cj(a){return"indeterminate"===a}function ck(a){return cj(a)?"indeterminate":a?"checked":"unchecked"}function cl(a){return b=>"mouse"===b.pointerType?a(b):void 0}ch.displayName=cg;var cm="ContextMenu",[cn,co]=(0,k.A)(cm,[bz]),cp=bz(),[cq,cr]=cn(cm),cs=a=>{let{__scopeContextMenu:b,children:c,onOpenChange:d,dir:e,modal:f=!0}=a,[i,j]=h.useState(!1),k=cp(b),l=u(d),m=h.useCallback(a=>{j(a),l(a)},[l]);return(0,g.jsx)(cq,{scope:b,open:i,onOpenChange:m,modal:f,children:(0,g.jsx)(bG,{...k,dir:e,open:i,onOpenChange:m,modal:f,children:c})})};cs.displayName=cm;var ct="ContextMenuTrigger",cu=h.forwardRef((a,b)=>{let{__scopeContextMenu:c,disabled:d=!1,...e}=a,f=cr(ct,c),i=cp(c),k=h.useRef({x:0,y:0}),m=h.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...k.current})}),n=h.useRef(0),o=h.useCallback(()=>window.clearTimeout(n.current),[]),p=a=>{k.current={x:a.clientX,y:a.clientY},f.onOpenChange(!0)};return h.useEffect(()=>o,[o]),h.useEffect(()=>void(d&&o()),[d,o]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(bH,{...i,virtualRef:m}),(0,g.jsx)(l.sG.span,{"data-state":f.open?"open":"closed","data-disabled":d?"":void 0,...e,ref:b,style:{WebkitTouchCallout:"none",...a.style},onContextMenu:d?a.onContextMenu:(0,j.mK)(a.onContextMenu,a=>{o(),p(a),a.preventDefault()}),onPointerDown:d?a.onPointerDown:(0,j.mK)(a.onPointerDown,cA(a=>{o(),n.current=window.setTimeout(()=>p(a),700)})),onPointerMove:d?a.onPointerMove:(0,j.mK)(a.onPointerMove,cA(o)),onPointerCancel:d?a.onPointerCancel:(0,j.mK)(a.onPointerCancel,cA(o)),onPointerUp:d?a.onPointerUp:(0,j.mK)(a.onPointerUp,cA(o))})]})});cu.displayName=ct;var cv=a=>{let{__scopeContextMenu:b,...c}=a,d=cp(b);return(0,g.jsx)(bL,{...d,...c})};cv.displayName="ContextMenuPortal";var cw="ContextMenuContent",cx=h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cr(cw,c),f=cp(c),i=h.useRef(!1);return(0,g.jsx)(bP,{...f,...d,ref:b,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:b=>{a.onCloseAutoFocus?.(b),!b.defaultPrevented&&i.current&&b.preventDefault(),i.current=!1},onInteractOutside:b=>{a.onInteractOutside?.(b),b.defaultPrevented||e.modal||(i.current=!0)},style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cx.displayName=cw,h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(bU,{...e,...d,ref:b})}).displayName="ContextMenuGroup",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(bV,{...e,...d,ref:b})}).displayName="ContextMenuLabel";var cy=h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(bY,{...e,...d,ref:b})});cy.displayName="ContextMenuItem",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b$,{...e,...d,ref:b})}).displayName="ContextMenuCheckboxItem",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b2,{...e,...d,ref:b})}).displayName="ContextMenuRadioGroup",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b4,{...e,...d,ref:b})}).displayName="ContextMenuRadioItem",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b8,{...e,...d,ref:b})}).displayName="ContextMenuItemIndicator";var cz=h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b9,{...e,...d,ref:b})});cz.displayName="ContextMenuSeparator",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(ca,{...e,...d,ref:b})}).displayName="ContextMenuArrow";function cA(a){return b=>"mouse"!==b.pointerType?a(b):void 0}h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(cf,{...e,...d,ref:b})}).displayName="ContextMenuSubTrigger",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(ch,{...e,...d,ref:b,style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="ContextMenuSubContent";var cB=c(165046);function cC({...a}){return(0,g.jsx)(cs,{"data-slot":"context-menu",...a})}function cD({className:a,...b}){return(0,g.jsx)(cu,{"data-slot":"context-menu-trigger",className:(0,cB.cn)("select-none",a),...b})}function cE({className:a,...b}){return(0,g.jsx)(cv,{children:(0,g.jsx)(cx,{"data-slot":"context-menu-content",className:(0,cB.cn)("bg-neutral-100/[0.67] dark:bg-neutral-900/[0.67] border border-white dark:border-white/10 backdrop-blur-md text-[var(--color-text)] z-[9999] max-h-[var(--radix-context-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-3xl p-1 shadow-[0_0_25px_0_rgba(0,0,0,0.16)] outline-none","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",a),...b})})}function cF({className:a,inset:b,variant:c="default",...d}){return(0,g.jsx)(cy,{"data-slot":"context-menu-item","data-inset":b,"data-variant":c,className:(0,cB.cn)("bg-transparent hover:bg-neutral-400/15 focus:bg-neutral-400/15 text-sm transition-all relative flex cursor-pointer items-center gap-2 rounded-full px-2 py-1.5 outline-none select-none","data-[variant=destructive]:text-[var(--color-error)] data-[variant=destructive]:hover:bg-[var(--color-error)]/10 data-[variant=destructive]:focus:bg-[var(--color-error)]/10 data-[variant=destructive]:hover:text-[var(--color-error)]",b&&"pl-8","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...d})}function cG({className:a,...b}){return(0,g.jsx)(cz,{"data-slot":"context-menu-separator",className:(0,cB.cn)("bg-neutral-400/15 -mx-1 my-1 h-px",a),...b})}function cH({className:a,...b}){return(0,g.jsx)("span",{"data-slot":"context-menu-shortcut",className:(0,cB.cn)("text-[var(--color-text-muted)] ml-auto text-xs tracking-widest",a),...b})}},512089:(a,b,c)=>{class d extends Error{constructor(a,b,c){if(super(b),null==b&&null==c&&d.errorMap.has(a))return d.errorMap.get(a);null==b&&null==c?(this._error=a,d.errorMap.set(a,this)):this._error=a,this.details=c}get error(){return this._error}get name(){return this._error}equals(a){return a instanceof d&&a._error===this._error}toString(){return this._error}}d.errorMap=new Map,d.DIV0=new d("#DIV/0!"),d.NA=new d("#N/A"),d.NAME=new d("#NAME?"),d.NULL=new d("#NULL!"),d.NUM=new d("#NUM!"),d.REF=new d("#REF!"),d.VALUE=new d("#VALUE!"),d.NOT_IMPLEMENTED=a=>new d("#NAME?",`Function ${a} is not implemented.`),d.TOO_MANY_ARGS=a=>new d("#N/A",`Function ${a} has too many arguments.`),d.ARG_MISSING=a=>{let{Types:b}=c(828358);return new d("#N/A",`Argument type ${a.map(a=>b[a]).join(", ")} is missing.`)},d.ERROR=(a,b)=>new d("#ERROR!",a,b),a.exports=d},513799:a=>{a.exports=function(a,b){let c;if("function"!=typeof a)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof a}\`.`);let d=0;return function(...e){clearTimeout(c);let f=Date.now(),g=b-(f-d);g<=0?(d=f,a.apply(this,e)):c=setTimeout(()=>{d=Date.now(),a.apply(this,e)},g)}}},514430:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.toKey=function(a){return"string"==typeof a||"symbol"==typeof a?a:Object.is(a?.valueOf?.(),-0)?"-0":String(a)}},518069:(a,b,c)=>{"use strict";c.d(b,{s:()=>r});var d=c(736927),e=c(115962);function f({label:a,value:b,onChange:c,fields:e,filterType:f,allowEmpty:g}){let h=f?Array.isArray(f)?f:[f]:null,i=h?e.filter(a=>h.includes(a.type)):e;return(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{className:"text-[10px] font-medium",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsxs)("select",{value:b??"",onChange:a=>c(a.target.value||void 0),className:"text-[12px] rounded-md border px-2 py-1.5 bg-transparent",style:{borderColor:"var(--color-border)",color:"var(--color-text)",background:"var(--color-surface)"},children:[g&&(0,d.jsx)("option",{value:"",children:"None"}),0===i.length&&(0,d.jsx)("option",{value:"",disabled:!0,children:"No matching fields"}),i.map(a=>(0,d.jsx)("option",{value:a.name,children:a.name},a.id))]})]})}function g({label:a,value:b,options:c,onChange:e}){return(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{className:"text-[10px] font-medium",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("div",{className:"flex rounded-md border overflow-hidden",style:{borderColor:"var(--color-border)"},children:c.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>e(a.value),className:"text-[11px] px-2.5 py-1 flex-1 transition-colors capitalize",style:{background:a.value===b?"var(--color-accent)":"var(--color-surface)",color:a.value===b?"#fff":"var(--color-text-muted)"},children:a.label},a.value))})]})}function h({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsx)(f,{label:"Group by field",value:a.kanbanField,onChange:b=>c({...a,kanbanField:b}),fields:b,filterType:"enum"})}function i({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f,{label:"Date field",value:a.calendarDateField,onChange:b=>c({...a,calendarDateField:b}),fields:b,filterType:"date"}),(0,d.jsx)(f,{label:"End date field (optional)",value:a.calendarEndDateField,onChange:b=>c({...a,calendarEndDateField:b}),fields:b,filterType:"date",allowEmpty:!0}),(0,d.jsx)(g,{label:"Default view",value:a.calendarMode??"month",options:[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"},{value:"year",label:"Year"}],onChange:b=>c({...a,calendarMode:b})})]})}function j({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f,{label:"Start date field",value:a.timelineStartField,onChange:b=>c({...a,timelineStartField:b}),fields:b,filterType:"date"}),(0,d.jsx)(f,{label:"End date field",value:a.timelineEndField,onChange:b=>c({...a,timelineEndField:b}),fields:b,filterType:"date",allowEmpty:!0}),(0,d.jsx)(f,{label:"Group by (optional)",value:a.timelineGroupField,onChange:b=>c({...a,timelineGroupField:b}),fields:b,filterType:"enum",allowEmpty:!0}),(0,d.jsx)(g,{label:"Default zoom",value:a.timelineZoom??"week",options:[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"},{value:"quarter",label:"Quarter"}],onChange:b=>c({...a,timelineZoom:b})})]})}function k({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f,{label:"Title field",value:a.galleryTitleField,onChange:b=>c({...a,galleryTitleField:b}),fields:b,filterType:"text"}),(0,d.jsx)(f,{label:"Cover field (optional)",value:a.galleryCoverField,onChange:b=>c({...a,galleryCoverField:b}),fields:b,allowEmpty:!0})]})}function l({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f,{label:"Title field",value:a.listTitleField,onChange:b=>c({...a,listTitleField:b}),fields:b,filterType:"text"}),(0,d.jsx)(f,{label:"Subtitle field (optional)",value:a.listSubtitleField,onChange:b=>c({...a,listSubtitleField:b}),fields:b,filterType:["text","email","richtext"],allowEmpty:!0})]})}function m(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function n({children:a}){return(0,d.jsx)("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:a})}function o({description:a}){return(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)(n,{children:"About"}),(0,d.jsx)("p",{className:"text-[12px] leading-snug",style:{color:"var(--color-text)"},children:a})]})}function p({displayField:a,candidates:b,onChange:c,updating:e}){return(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)(n,{children:"Display field"}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("select",{value:a??"",onChange:a=>c(a.target.value),disabled:e,className:"text-[12px] rounded-md border px-2 py-1.5 flex-1 outline-none cursor-pointer",style:{borderColor:"var(--color-border)",color:"var(--color-text)",background:"var(--color-surface)",opacity:e?.5:1},children:b.map(a=>(0,d.jsx)("option",{value:a.name,children:a.name},a.id))}),e&&(0,d.jsx)("div",{className:"w-3 h-3 border border-t-transparent rounded-full animate-spin shrink-0",style:{borderColor:"var(--color-text-muted)"}})]})]})}function q({fields:a,columnVisibility:b,onColumnVisibilityChange:c,stickyFirstColumn:e,onStickyFirstColumnChange:f}){return(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)(n,{children:"Columns"}),f&&(0,d.jsxs)("label",{className:"flex items-center gap-2 text-[12px] cursor-pointer",style:{color:"var(--color-text)"},children:[(0,d.jsx)("input",{type:"checkbox",checked:!!e,onChange:a=>f(a.target.checked),className:"cursor-pointer"}),"Freeze first column"]}),(0,d.jsx)("div",{className:"flex flex-col gap-1 max-h-48 overflow-y-auto rounded-md border p-1.5",style:{borderColor:"var(--color-border)"},children:0===a.length?(0,d.jsx)("div",{className:"text-[11px] px-1 py-0.5",style:{color:"var(--color-text-muted)"},children:"No columns"}):a.map(a=>{let e=!1!==b[a.id];return(0,d.jsxs)("label",{className:"flex items-center gap-2 text-[12px] cursor-pointer px-1 py-0.5 rounded hover:bg-[var(--color-surface-hover)]",style:{color:"var(--color-text)"},children:[(0,d.jsx)("input",{type:"checkbox",checked:e,onChange:()=>(a=>{let d=!1!==b[a];c({...b,[a]:!d})})(a.id),className:"cursor-pointer"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]},a.id)})})]})}function r({viewType:a,settings:b,fields:c,onSettingsChange:f,description:g,displayField:n,displayFieldCandidates:r,onDisplayFieldChange:s,updatingDisplayField:t,columnVisibility:u,onColumnVisibilityChange:v,stickyFirstColumn:w,onStickyFirstColumnChange:x}){let[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),B=!!(g&&g.trim()),C=!!(r&&r.length>0&&s),D=!!(v&&"table"===a);return B||C||D||"table"!==a?(0,d.jsxs)("div",{className:"relative",ref:A,children:[(0,d.jsx)("button",{type:"button",onClick:()=>z(!y),className:"flex items-center justify-center w-7 h-7 rounded-md hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer",style:{color:"var(--color-text-muted)"},title:"View settings","aria-label":"View settings",children:(0,d.jsx)(m,{})}),y&&(0,d.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 rounded-lg border shadow-lg p-3 min-w-[220px] sm:min-w-[260px] max-w-[calc(100vw-2rem)] flex flex-col gap-3",style:{borderColor:"var(--color-border)",background:"var(--color-surface)",boxShadow:"0 8px 24px rgba(0,0,0,0.12)"},children:[(0,d.jsx)("div",{className:"text-[11px] font-semibold",style:{color:"var(--color-text)"},children:{table:"Table Settings",kanban:"Board Settings",calendar:"Calendar Settings",timeline:"Timeline Settings",gallery:"Gallery Settings",list:"List Settings"}[a]}),B&&(0,d.jsx)(o,{description:g}),C&&(0,d.jsx)(p,{displayField:n,candidates:r,onChange:s,updating:!!t}),"kanban"===a&&(0,d.jsx)(h,{settings:b,fields:c,onSettingsChange:f}),"calendar"===a&&(0,d.jsx)(i,{settings:b,fields:c,onSettingsChange:f}),"timeline"===a&&(0,d.jsx)(j,{settings:b,fields:c,onSettingsChange:f}),"gallery"===a&&(0,d.jsx)(k,{settings:b,fields:c,onSettingsChange:f}),"list"===a&&(0,d.jsx)(l,{settings:b,fields:c,onSettingsChange:f}),D&&(0,d.jsx)(q,{fields:c,columnVisibility:u??{},onColumnVisibilityChange:v,stickyFirstColumn:w,onStickyFirstColumnChange:x})]})]}):null}},525365:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],f=(0,d.A)("search",e)},529294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},530342:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(944002),e=c(887011);b.matches=function(a){return a=e.cloneDeep(a),b=>d.isMatch(b,a)}},530858:(a,b,c)=>{"use strict";c.d(b,{i:()=>f});var d=c(286102),e=c(502714);function f(a,b){let{start:c,end:f}=(0,d.P)(b?.in,a),g=+c>+f,h=g?+c:+f,i=g?f:c;i.setHours(0,0,0,0),i.setDate(1);let j=b?.step??1;if(!j)return[];j<0&&(j=-j,g=!g);let k=[];for(;+i<=h;)k.push((0,e.w)(c,i)),i.setMonth(i.getMonth()+j);return g?k.reverse():k}},532513:(a,b,c)=>{"use strict";c.d(b,{x:()=>s});var d=c(736927),e=c(115962),f=c(981918),g=c(612563),h=c(379924),i=c(86839),j=c(707201),k=c(568443),l=c(18886),m=c(130526);function n(a){return null==a?"":"object"==typeof a?JSON.stringify(a):"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):""}function o({entry:a,fields:b,members:c,relationLabels:e,onEntryClick:g,objectName:h,onToast:i}){let j=n(a.entry_id)||"",{attributes:k,listeners:l,setNodeRef:m,isDragging:o}=(0,f.PM)({id:j,data:{entry:a}});return(0,d.jsx)("div",{ref:m,...l,...k,onClick:a=>{!o&&g&&(a.stopPropagation(),g(j))},className:"rounded-lg p-3 mb-2 transition-all duration-100 cursor-grab active:cursor-grabbing select-none",style:{background:"var(--color-surface)",border:`1px solid ${o?"var(--color-accent)":"var(--color-border)"}`,opacity:o?.4:1,transform:o?"scale(1.02)":void 0},children:(0,d.jsx)(p,{entry:a,fields:b,members:c,relationLabels:e,objectName:h,onToast:i})})}function p({entry:a,fields:b,members:c,relationLabels:e,objectName:f,onToast:i}){let k=function(a,b){let c=b.find(a=>a.name.toLowerCase().includes("name")||a.name.toLowerCase().includes("title"));return c?n(a[c.name])||"Untitled":n(a[b[0]?.name])||"Untitled"}(a,b),o=(0,m.I)(a,b),p=b.filter(a=>"action"===a.type),r=b.filter(a=>"action"!==a.type).filter(b=>"richtext"!==b.type&&null!==a[b.name]&&void 0!==a[b.name]&&""!==a[b.name]).slice(0,4),s=b.find(a=>a.name.toLowerCase().includes("name")||a.name.toLowerCase().includes("title"));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-1.5 min-w-0",style:{color:"var(--color-text)"},children:[o?.faviconUrl&&(0,d.jsx)(l.A,{src:o.faviconUrl,className:"w-4 h-4 rounded-[4px] shrink-0"}),(0,d.jsx)("div",{className:"text-sm font-medium truncate min-w-0",children:k})]}),(0,d.jsx)("div",{className:"space-y-1",children:r.filter(a=>a!==s).slice(0,3).map(b=>{let f=a[b.name];if(!f)return null;let i=n(f);if("user"===b.type){let a=c?.find(a=>a.id===i);a&&(i=a.name)}else if("relation"===b.type){let a=e?.[b.name];i=(function(a){if(!a)return[];let b=a.trim();if(!b)return[];if(b.startsWith("["))try{let a=JSON.parse(b);if(Array.isArray(a))return a.map(String).filter(Boolean)}catch{}return[b]})(i).map(b=>a?.[b]??b).join(", ")}let j="tags"===b.type?(0,h.k)(f):[];return(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)"},children:[b.name,":"]}),"enum"===b.type?(0,d.jsx)(q,{value:n(f),enumValues:b.enum_values,enumColors:b.enum_colors}):"tags"===b.type?(0,d.jsxs)("span",{className:"flex items-center gap-0.5 flex-wrap",children:[j.slice(0,3).map(a=>{let b=(0,g.KJ)(a),c="link"===b.kind&&b.href,e="url"===b.linkType&&!!b.faviconUrl;return c?(0,d.jsxs)("a",{href:b.href,target:"url"===b.linkType||"file"===b.linkType?"_blank":void 0,rel:"url"===b.linkType||"file"===b.linkType?"noopener noreferrer":void 0,onClick:a=>a.stopPropagation(),className:"inline-flex items-center gap-1 px-1.5 py-0 rounded text-[11px] font-medium hover:underline underline-offset-2 max-w-[220px]",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-accent)"},children:[e&&(0,d.jsx)(l.A,{src:b.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:b.text})]},a):(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0 rounded text-[11px] font-medium",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-text-muted)"},children:a},a)}),j.length>3&&(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)",opacity:.6},children:["+",j.length-3]})]}):"relation"===b.type?(0,d.jsxs)("span",{className:"truncate inline-flex items-center gap-0.5",style:{color:"#60a5fa"},children:[(0,d.jsxs)("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",style:{opacity:.5},children:[(0,d.jsx)("path",{d:"M7 7h10v10"}),(0,d.jsx)("path",{d:"M7 17 17 7"})]}),i]}):(0,d.jsx)("span",{className:"whitespace-pre-line line-clamp-2",style:{color:"var(--color-text)"},children:i})]},b.id)})}),f&&p.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1 mt-2 pt-1.5",style:{borderTop:"1px solid var(--color-border)"},onClick:a=>a.stopPropagation(),children:p.flatMap(b=>(function(a){if(!a)return[];try{let b=JSON.parse(a);if(b&&Array.isArray(b.actions))return b.actions}catch{}return[]})(b.default_value).map(c=>(0,d.jsx)(j.r,{action:c,entryId:String(a.entry_id??""),objectName:f,fieldId:b.id,compact:!0,onToast:i},`${b.id}_${c.id}`)))})]})}function q({value:a,enumValues:b,enumColors:c}){let e=b?.indexOf(a)??-1,f=e>=0&&c?c[e]:"#94a3b8";return(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0 rounded text-[11px] font-medium",style:{background:`${f}20`,color:f},children:a})}function r({columnName:a,color:b,items:c,cardFields:g,members:h,relationLabels:i,onEntryClick:j,isOver:k,groupFieldId:l,objectName:m,onRefresh:p,onToast:q}){let{setNodeRef:r}=(0,f.zM)({id:`column:${a}`}),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(a),[w,x]=(0,e.useState)(!1),y=(0,e.useRef)(null),z=(0,e.useCallback)(async()=>{let b=u.trim();if(!b||b===a||!l){t(!1),v(a);return}x(!0);try{(await fetch(`/api/workspace/objects/${encodeURIComponent(m)}/fields/${encodeURIComponent(l)}/enum-rename`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldValue:a,newValue:b})})).ok?p?.():v(a)}catch{v(a)}finally{x(!1),t(!1)}},[u,a,l,m,p]);return(0,d.jsxs)("div",{ref:r,className:"flex-shrink-0 flex flex-col rounded-xl transition-colors duration-150",style:{width:"280px",background:k?"var(--color-surface)":"var(--color-bg)",border:`1px solid ${k?"var(--color-accent)":"var(--color-border)"}`},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:b}}),s?(0,d.jsx)("input",{ref:y,value:u,onChange:a=>v(a.target.value),onBlur:z,onKeyDown:b=>{"Enter"===b.key&&z(),"Escape"===b.key&&(v(a),t(!1))},disabled:w,className:"text-sm font-medium flex-1 bg-transparent outline-none rounded px-1 -mx-1",style:{color:"var(--color-text)",border:"1px solid var(--color-accent)"}}):(0,d.jsx)("span",{className:"text-sm font-medium flex-1 cursor-text rounded px-1 -mx-1 hover:bg-[var(--color-surface-hover)] transition-colors",style:{color:"var(--color-text)"},onDoubleClick:()=>{l&&(v(a),t(!0))},title:l?"Double-click to rename":void 0,children:a}),(0,d.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{background:"var(--color-surface)",color:"var(--color-text-muted)"},children:c.length})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto p-2",style:{minHeight:"80px"},children:0===c.length?(0,d.jsx)("div",{className:"flex items-center justify-center py-8 rounded-lg border border-dashed text-xs transition-colors",style:{borderColor:k?"var(--color-accent)":"var(--color-border)",color:k?"var(--color-accent)":"var(--color-text-muted)"},children:k?"Drop here":"No entries"}):c.map((a,b)=>(0,d.jsx)(o,{entry:a,fields:g,members:h,relationLabels:i,onEntryClick:j,objectName:m,onToast:q},n(a.entry_id)||String(b)))})]})}function s({objectName:a,fields:b,entries:c,statuses:g,members:h,relationLabels:j,onEntryClick:l,onRefresh:m}){let q=(0,k.d)(),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(c),y=(0,f.FR)((0,f.MS)(f.AN,{activationConstraint:{distance:5}})),z=(0,e.useMemo)(()=>{let a=b.find(a=>"enum"===a.type&&a.name.toLowerCase().includes("status"));return a||(b.find(a=>"enum"===a.type)??null)},[b]),A=(0,e.useMemo)(()=>{if(g.length>0)return g.map(a=>({name:a.name,color:a.color??"#94a3b8"}));if(z?.enum_values)return z.enum_values.map((a,b)=>({name:a,color:z.enum_colors?.[b]??"#94a3b8"}));let a=new Set;for(let b of w){let c=z?b[z.name]:void 0;c&&a.add(n(c))}return Array.from(a).map(a=>({name:a,color:"#94a3b8"}))},[g,z,w]),B=(0,e.useMemo)(()=>{let a={};for(let b of A)a[b.name]=[];for(let b of(a._ungrouped=[],w)){let c=z?n(b[z.name]):"";a[c]?a[c].push(b):a._ungrouped.push(b)}return a},[A,w,z]),C=b.filter(a=>a!==z),D=(0,e.useMemo)(()=>s?w.find(a=>String(a.entry_id)===s)??null:null,[s,w]),E=(0,e.useCallback)(a=>{t(String(a.active.id))},[]),F=(0,e.useCallback)(a=>{let b=a.over?.id?String(a.over.id):null;b?.startsWith("column:")?v(b.replace("column:","")):v(null)},[]),G=(0,e.useCallback)(async b=>{t(null),v(null);let{active:c,over:d}=b;if(!d||!z)return;let e=String(d.id);if(!e.startsWith("column:"))return;let f=e.replace("column:",""),g=String(c.id),h=w.find(a=>String(a.entry_id)===g);if(!h)return;let i=n(h[z.name]);if(i!==f){x(a=>a.map(a=>String(a.entry_id)===g?{...a,[z.name]:f}:a));try{(await fetch(`/api/workspace/objects/${encodeURIComponent(a)}/entries/${encodeURIComponent(g)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fields:{[z.name]:f}})})).ok?m?.():x(a=>a.map(a=>String(a.entry_id)===g?{...a,[z.name]:i}:a))}catch{x(a=>a.map(a=>String(a.entry_id)===g?{...a,[z.name]:i}:a))}}},[z,w,a,m]);return z?(0,d.jsxs)(f.Mp,{sensors:y,collisionDetection:f.y$,onDragStart:E,onDragOver:F,onDragEnd:G,children:[(0,d.jsxs)("div",{className:"flex gap-4 overflow-x-auto pb-4 px-1",style:{minHeight:"400px"},children:[A.map(b=>(0,d.jsx)(r,{columnName:b.name,color:b.color,items:B[b.name]??[],cardFields:C,members:h,relationLabels:j,onEntryClick:l,isOver:u===b.name,groupFieldId:z.id,objectName:a,onRefresh:m,onToast:q},b.name)),B._ungrouped?.length>0&&(0,d.jsxs)("div",{className:"flex-shrink-0 flex flex-col rounded-xl",style:{width:"280px",background:"var(--color-bg)",border:"1px dashed var(--color-border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--color-text-muted)"},children:"Ungrouped"}),(0,d.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{background:"var(--color-surface)",color:"var(--color-text-muted)"},children:B._ungrouped.length})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto p-2",children:B._ungrouped.map((b,c)=>(0,d.jsx)(o,{entry:b,fields:C,members:h,relationLabels:j,onEntryClick:l,objectName:a,onToast:q},n(b.entry_id)||String(c)))})]})]}),(0,d.jsx)(f.Hd,{dropAnimation:null,children:D?(0,d.jsx)("div",{className:"rounded-lg p-3 shadow-xl",style:{width:"260px",background:"var(--color-surface)",border:"1px solid var(--color-accent)",transform:"rotate(2deg)"},children:(0,d.jsx)(p,{entry:D,fields:C,members:h,objectName:a,relationLabels:j,onToast:q})}):null})]}):(0,d.jsx)("div",{className:"flex flex-col items-center justify-center py-20 gap-3",children:(0,d.jsxs)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:["No enum field found for kanban grouping in"," ",(0,d.jsx)("span",{className:"font-medium",style:{color:"var(--color-text)"},children:(0,i.PV)(a)})]})})}},534487:(a,b,c)=>{"use strict";c.d(b,{f:()=>f});var d=c(502714),e=c(845722);function f(a,b,c){let f=(0,e.a)(a,c?.in);return isNaN(b)?(0,d.w)(c?.in||a,NaN):(b&&f.setDate(f.getDate()+b),f)}},534864:(a,b,c)=>{"use strict";c.d(b,{X:()=>f});var d=c(115962),e=c(880696);function f(a){let[b,c]=d.useState(void 0);return(0,e.N)(()=>{if(a){c({width:a.offsetWidth,height:a.offsetHeight});let b=new ResizeObserver(b=>{let d,e;if(!Array.isArray(b)||!b.length)return;let f=b[0];if("borderBoxSize"in f){let a=f.borderBoxSize,b=Array.isArray(a)?a[0]:a;d=b.inlineSize,e=b.blockSize}else d=a.offsetWidth,e=a.offsetHeight;c({width:d,height:e})});return b.observe(a,{box:"border-box"}),()=>b.unobserve(a)}c(void 0)},[a]),b}},535798:(a,b,c)=>{"use strict";function d(a){if(!a)return"";let b="string"==typeof a?Date.parse(a):a instanceof Date?a.getTime():a;if(!Number.isFinite(b))return"";let c=Date.now()-b,d=c<0,e=Math.abs(c),f=(a,b)=>d?`in ${a}${b}`:`${a}${b} ago`;return e<6e4?d?"soon":"just now":e<36e5?f(Math.round(e/6e4),"m"):e<864e5?f(Math.round(e/36e5),"h"):e<6048e5?f(Math.round(e/864e5),"d"):e<2592e6?f(Math.round(e/6048e5),"w"):e<31536e6?f(Math.round(e/2592e6),"mo"):f(Math.round(e/31536e6),"y")}function e(a){if(!a)return"";let b="string"==typeof a?new Date(a):a instanceof Date?a:new Date(a);return Number.isNaN(b.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}).format(b)}function f(a){if(!a)return"";let b="string"==typeof a?new Date(a):a instanceof Date?a:new Date(a);if(Number.isNaN(b.getTime()))return"";let c=new Date,d=new Date(c);d.setDate(c.getDate()-1);let e=(a,b)=>a.getFullYear()===b.getFullYear()&&a.getMonth()===b.getMonth()&&a.getDate()===b.getDate();return e(b,c)?"Today":e(b,d)?"Yesterday":new Intl.DateTimeFormat(void 0,{weekday:"short",month:"short",day:"numeric",year:b.getFullYear()!==c.getFullYear()?"numeric":void 0}).format(b)}c.d(b,{Vv:()=>e,_H:()=>f,wI:()=>d})},537889:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(653913),e=c(670016),f=c(530342),g=c(786975);b.iteratee=function(a){if(null==a)return d.identity;switch(typeof a){case"function":return a;case"object":if(Array.isArray(a)&&2===a.length)return g.matchesProperty(a[0],a[1]);return f.matches(a);case"string":case"symbol":case"number":return e.property(a)}}},545182:(a,b,c)=>{"use strict";c.d(b,{x:()=>e});var d=c(736927);function e({href:a,openInNewTab:b=!0,title:c="Open link",className:e}){return(0,d.jsx)("a",{href:a,...b?{target:"_blank",rel:"noopener noreferrer"}:{},title:c,"aria-label":c,onPointerDown:a=>a.stopPropagation(),onClick:a=>a.stopPropagation(),onDoubleClick:a=>a.stopPropagation(),className:e??"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md hover:bg-black/5",children:(0,d.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M7 7h10v10"}),(0,d.jsx)("path",{d:"M7 17 17 7"})]})})}},545343:(a,b,c)=>{"use strict";c.d(b,{q:()=>e});let d={};function e(){return d}},551651:(a,b,c)=>{"use strict";function d(a){let b=[],c=0;for(let d of a.matchAll(/```diff\s*\n([\s\S]*?)```/g)){let e=a.slice(c,d.index);e.trim()&&b.push({type:"text",text:e});let f=d[1].trimEnd();f?b.push({type:"diff-artifact",diff:f}):b.push({type:"text",text:d[0]}),c=(d.index??0)+d[0].length}let d=a.slice(c);return d.trim()&&b.push({type:"text",text:d}),b}function e(a){return a.includes("```diff")}c.d(b,{g:()=>d,k:()=>e})},554327:(a,b,c)=>{"use strict";c.d(b,{F:()=>d,J:()=>e});let d={displayName:"Dench Integrations",singularDisplayName:"Dench Integration",searchLabel:"Searching Dench Integrations",callLabel:"Calling Dench Integration",genericToolLabel:"Using Dench Integrations",attentionLabel:"Dench Integrations needs attention"};function e(a,b){let c=`Failed to ${a} ${d.displayName} status`;return"number"==typeof b?`${c} (${b})`:`${c}.`}},554818:(a,b,c)=>{"use strict";let d,e,f;c.d(b,{P:()=>fI});let g=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],h=new Set(g),i=(a,b,c)=>c>b?b:c<a?a:c,j={test:a=>"number"==typeof a,parse:parseFloat,transform:a=>a},k={...j,transform:a=>i(0,1,a)},l={...j,default:1},m=a=>Math.round(1e5*a)/1e5,n=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,o=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,p=(a,b)=>c=>!!("string"==typeof c&&o.test(c)&&c.startsWith(a)||b&&null!=c&&Object.prototype.hasOwnProperty.call(c,b)),q=(a,b,c)=>d=>{if("string"!=typeof d)return d;let[e,f,g,h]=d.match(n);return{[a]:parseFloat(e),[b]:parseFloat(f),[c]:parseFloat(g),alpha:void 0!==h?parseFloat(h):1}},r={...j,transform:a=>Math.round(i(0,255,a))},s={test:p("rgb","red"),parse:q("red","green","blue"),transform:({red:a,green:b,blue:c,alpha:d=1})=>"rgba("+r.transform(a)+", "+r.transform(b)+", "+r.transform(c)+", "+m(k.transform(d))+")"},t={test:p("#"),parse:function(a){let b="",c="",d="",e="";return a.length>5?(b=a.substring(1,3),c=a.substring(3,5),d=a.substring(5,7),e=a.substring(7,9)):(b=a.substring(1,2),c=a.substring(2,3),d=a.substring(3,4),e=a.substring(4,5),b+=b,c+=c,d+=d,e+=e),{red:parseInt(b,16),green:parseInt(c,16),blue:parseInt(d,16),alpha:e?parseInt(e,16)/255:1}},transform:s.transform},u=a=>({test:b=>"string"==typeof b&&b.endsWith(a)&&1===b.split(" ").length,parse:parseFloat,transform:b=>`${b}${a}`}),v=u("deg"),w=u("%"),x=u("px"),y=u("vh"),z=u("vw"),A={...w,parse:a=>w.parse(a)/100,transform:a=>w.transform(100*a)},B={test:p("hsl","hue"),parse:q("hue","saturation","lightness"),transform:({hue:a,saturation:b,lightness:c,alpha:d=1})=>"hsla("+Math.round(a)+", "+w.transform(m(b))+", "+w.transform(m(c))+", "+m(k.transform(d))+")"},C={test:a=>s.test(a)||t.test(a)||B.test(a),parse:a=>s.test(a)?s.parse(a):B.test(a)?B.parse(a):t.parse(a),transform:a=>"string"==typeof a?a:a.hasOwnProperty("red")?s.transform(a):B.transform(a),getAnimatableNone:a=>{let b=C.parse(a);return b.alpha=0,C.transform(b)}},D=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,E="number",F="color",G=/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 H(a){let b=a.toString(),c=[],d={color:[],number:[],var:[]},e=[],f=0,g=b.replace(G,a=>(C.test(a)?(d.color.push(f),e.push(F),c.push(C.parse(a))):a.startsWith("var(")?(d.var.push(f),e.push("var"),c.push(a)):(d.number.push(f),e.push(E),c.push(parseFloat(a))),++f,"${}")).split("${}");return{values:c,split:g,indexes:d,types:e}}function I(a){return H(a).values}function J(a){let{split:b,types:c}=H(a),d=b.length;return a=>{let e="";for(let f=0;f<d;f++)if(e+=b[f],void 0!==a[f]){let b=c[f];b===E?e+=m(a[f]):b===F?e+=C.transform(a[f]):e+=a[f]}return e}}let K=a=>"number"==typeof a?0:C.test(a)?C.getAnimatableNone(a):a,L={test:function(a){return isNaN(a)&&"string"==typeof a&&(a.match(n)?.length||0)+(a.match(D)?.length||0)>0},parse:I,createTransformer:J,getAnimatableNone:function(a){let b=I(a);return J(a)(b.map(K))}},M=new Set(["brightness","contrast","saturate","opacity"]);function N(a){let[b,c]=a.slice(0,-1).split("(");if("drop-shadow"===b)return a;let[d]=c.match(n)||[];if(!d)return a;let e=c.replace(d,""),f=+!!M.has(b);return d!==c&&(f*=100),b+"("+f+e+")"}let O=/\b([a-z-]*)\(.*?\)/gu,P={...L,getAnimatableNone:a=>{let b=a.match(O);return b?b.map(N).join(" "):a}},Q={...j,transform:Math.round},R={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,inset:x,insetBlock:x,insetBlockStart:x,insetBlockEnd:x,insetInline:x,insetInlineStart:x,insetInlineEnd:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,paddingBlock:x,paddingBlockStart:x,paddingBlockEnd:x,paddingInline:x,paddingInlineStart:x,paddingInlineEnd:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,marginBlock:x,marginBlockStart:x,marginBlockEnd:x,marginInline:x,marginInlineStart:x,marginInlineEnd:x,fontSize:x,backgroundPositionX:x,backgroundPositionY:x,rotate:v,rotateX:v,rotateY:v,rotateZ:v,scale:l,scaleX:l,scaleY:l,scaleZ:l,skew:v,skewX:v,skewY:v,distance:x,translateX:x,translateY:x,translateZ:x,x:x,y:x,z:x,perspective:x,transformPerspective:x,opacity:k,originX:A,originY:A,originZ:x,zIndex:Q,fillOpacity:k,strokeOpacity:k,numOctaves:Q},S={...R,color:C,backgroundColor:C,outlineColor:C,fill:C,stroke:C,borderColor:C,borderTopColor:C,borderRightColor:C,borderBottomColor:C,borderLeftColor:C,filter:P,WebkitFilter:P},T=a=>S[a],U=()=>({translate:0,scale:1,origin:0,originPoint:0}),V=()=>({x:U(),y:U()}),W=()=>({min:0,max:0}),X=()=>({x:W(),y:W()}),Y=a=>!!(a&&a.getVelocity),Z=new Set(["width","height","top","left","right","bottom",...g]),_=a=>b=>b.test(a),aa=[j,x,w,v,z,y,{test:a=>"auto"===a,parse:a=>a}],ab=a=>aa.find(_(a)),ac=()=>{},ad=()=>{},ae=a=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(a),af=a=>b=>"string"==typeof b&&b.startsWith(a),ag=af("--"),ah=af("var(--"),ai=a=>!!ah(a)&&aj.test(a.split("/*")[0].trim()),aj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ak(a){return"string"==typeof a&&a.split("/*")[0].includes("var(--")}let al=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,am=a=>180*a/Math.PI,an=a=>ap(am(Math.atan2(a[1],a[0]))),ao={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:a=>(Math.abs(a[0])+Math.abs(a[3]))/2,rotate:an,rotateZ:an,skewX:a=>am(Math.atan(a[1])),skewY:a=>am(Math.atan(a[2])),skew:a=>(Math.abs(a[1])+Math.abs(a[2]))/2},ap=a=>((a%=360)<0&&(a+=360),a),aq=a=>Math.sqrt(a[0]*a[0]+a[1]*a[1]),ar=a=>Math.sqrt(a[4]*a[4]+a[5]*a[5]),as={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:aq,scaleY:ar,scale:a=>(aq(a)+ar(a))/2,rotateX:a=>ap(am(Math.atan2(a[6],a[5]))),rotateY:a=>ap(am(Math.atan2(-a[2],a[0]))),rotateZ:an,rotate:an,skewX:a=>am(Math.atan(a[4])),skewY:a=>am(Math.atan(a[1])),skew:a=>(Math.abs(a[1])+Math.abs(a[4]))/2};function at(a){return+!!a.includes("scale")}function au(a,b){let c,d;if(!a||"none"===a)return at(b);let e=a.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(e)c=as,d=e;else{let b=a.match(/^matrix\(([-\d.e\s,]+)\)$/u);c=ao,d=b}if(!d)return at(b);let f=c[b],g=d[1].split(",").map(av);return"function"==typeof f?f(g):g[f]}function av(a){return parseFloat(a.trim())}let aw=a=>a===j||a===x,ax=new Set(["x","y","z"]),ay=g.filter(a=>!ax.has(a)),az={width:({x:a},{paddingLeft:b="0",paddingRight:c="0"})=>a.max-a.min-parseFloat(b)-parseFloat(c),height:({y:a},{paddingTop:b="0",paddingBottom:c="0"})=>a.max-a.min-parseFloat(b)-parseFloat(c),top:(a,{top:b})=>parseFloat(b),left:(a,{left:b})=>parseFloat(b),bottom:({y:a},{top:b})=>parseFloat(b)+(a.max-a.min),right:({x:a},{left:b})=>parseFloat(b)+(a.max-a.min),x:(a,{transform:b})=>au(b,"x"),y:(a,{transform:b})=>au(b,"y")};az.translateX=az.x,az.translateY=az.y;let aA=a=>a,aB={},aC=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],aD={value:null,addProjectionMetrics:null};function aE(a,b){let c=!1,d=!0,e={delta:0,timestamp:0,isProcessing:!1},f=()=>c=!0,g=aC.reduce((a,c)=>(a[c]=function(a,b){let c=new Set,d=new Set,e=!1,f=!1,g=new WeakSet,h={delta:0,timestamp:0,isProcessing:!1},i=0;function j(b){g.has(b)&&(k.schedule(b),a()),i++,b(h)}let k={schedule:(a,b=!1,f=!1)=>{let h=f&&e?c:d;return b&&g.add(a),h.has(a)||h.add(a),a},cancel:a=>{d.delete(a),g.delete(a)},process:a=>{if(h=a,e){f=!0;return}e=!0,[c,d]=[d,c],c.forEach(j),b&&aD.value&&aD.value.frameloop[b].push(i),i=0,c.clear(),e=!1,f&&(f=!1,k.process(a))}};return k}(f,b?c:void 0),a),{}),{setup:h,read:i,resolveKeyframes:j,preUpdate:k,update:l,preRender:m,render:n,postRender:o}=g,p=()=>{let f=aB.useManualTiming?e.timestamp:performance.now();c=!1,aB.useManualTiming||(e.delta=d?1e3/60:Math.max(Math.min(f-e.timestamp,40),1)),e.timestamp=f,e.isProcessing=!0,h.process(e),i.process(e),j.process(e),k.process(e),l.process(e),m.process(e),n.process(e),o.process(e),e.isProcessing=!1,c&&b&&(d=!1,a(p))};return{schedule:aC.reduce((b,f)=>{let h=g[f];return b[f]=(b,f=!1,g=!1)=>(!c&&(c=!0,d=!0,e.isProcessing||a(p)),h.schedule(b,f,g)),b},{}),cancel:a=>{for(let b=0;b<aC.length;b++)g[aC[b]].cancel(a)},state:e,steps:g}}let{schedule:aF,cancel:aG,state:aH,steps:aI}=aE("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:aA,!0),aJ=new Set,aK=!1,aL=!1,aM=!1;function aN(){if(aL){let a=Array.from(aJ).filter(a=>a.needsMeasurement),b=new Set(a.map(a=>a.element)),c=new Map;b.forEach(a=>{let b=function(a){let b=[];return ay.forEach(c=>{let d=a.getValue(c);void 0!==d&&(b.push([c,d.get()]),d.set(+!!c.startsWith("scale")))}),b}(a);b.length&&(c.set(a,b),a.render())}),a.forEach(a=>a.measureInitialState()),b.forEach(a=>{a.render();let b=c.get(a);b&&b.forEach(([b,c])=>{a.getValue(b)?.set(c)})}),a.forEach(a=>a.measureEndState()),a.forEach(a=>{void 0!==a.suspendedScrollY&&window.scrollTo(0,a.suspendedScrollY)})}aL=!1,aK=!1,aJ.forEach(a=>a.complete(aM)),aJ.clear()}function aO(){aJ.forEach(a=>{a.readKeyframes(),a.needsMeasurement&&(aL=!0)})}class aP{constructor(a,b,c,d,e,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...a],this.onComplete=b,this.name=c,this.motionValue=d,this.element=e,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(aJ.add(this),aK||(aK=!0,aF.read(aO),aF.resolveKeyframes(aN))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:a,name:b,element:c,motionValue:d}=this;if(null===a[0]){let e=d?.get(),f=a[a.length-1];if(void 0!==e)a[0]=e;else if(c&&b){let d=c.readValue(b,f);null!=d&&(a[0]=d)}void 0===a[0]&&(a[0]=f),d&&void 0===e&&d.set(a[0])}for(let b=1;b<a.length;b++)a[b]??(a[b]=a[b-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(a=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,a),aJ.delete(this)}cancel(){"scheduled"===this.state&&(aJ.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}let aQ=a=>/^0[^.\s]+$/u.test(a);function aR(a,b){let c=T(a);return c!==P&&(c=L),c.getAnimatableNone?c.getAnimatableNone(b):void 0}let aS=new Set(["auto","none","0"]);class aT extends aP{constructor(a,b,c,d,e){super(a,b,c,d,e,!0)}readKeyframes(){let{unresolvedKeyframes:a,element:b,name:c}=this;if(!b||!b.current)return;super.readKeyframes();for(let c=0;c<a.length;c++){let d=a[c];if("string"==typeof d&&ai(d=d.trim())){let e=function a(b,c,d=1){ad(d<=4,`Max CSS variable fallback depth detected in property "${b}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[e,f]=function(a){let b=al.exec(a);if(!b)return[,];let[,c,d,e]=b;return[`--${c??d}`,e]}(b);if(!e)return;let g=window.getComputedStyle(c).getPropertyValue(e);if(g){let a=g.trim();return ae(a)?parseFloat(a):a}return ai(f)?a(f,c,d+1):f}(d,b.current);void 0!==e&&(a[c]=e),c===a.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Z.has(c)||2!==a.length)return;let[d,e]=a,f=ab(d),g=ab(e);if(ak(d)!==ak(e)&&az[c]){this.needsMeasurement=!0;return}if(f!==g)if(aw(f)&&aw(g))for(let b=0;b<a.length;b++){let c=a[b];"string"==typeof c&&(a[b]=parseFloat(c))}else az[c]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:a,name:b}=this,c=[];for(let b=0;b<a.length;b++){var d;(null===a[b]||("number"==typeof(d=a[b])?0===d:null===d||"none"===d||"0"===d||aQ(d)))&&c.push(b)}c.length&&function(a,b,c){let d,e=0;for(;e<a.length&&!d;){let b=a[e];"string"==typeof b&&!aS.has(b)&&H(b).values.length&&(d=a[e]),e++}if(d&&c)for(let e of b)a[e]=aR(c,d)}(a,c,b)}measureInitialState(){let{element:a,unresolvedKeyframes:b,name:c}=this;if(!a||!a.current)return;"height"===c&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=az[c](a.measureViewportBox(),window.getComputedStyle(a.current)),b[0]=this.measuredOrigin;let d=b[b.length-1];void 0!==d&&a.getValue(c,d).jump(d,!1)}measureEndState(){let{element:a,name:b,unresolvedKeyframes:c}=this;if(!a||!a.current)return;let d=a.getValue(b);d&&d.jump(this.measuredOrigin,!1);let e=c.length-1,f=c[e];c[e]=az[b](a.measureViewportBox(),window.getComputedStyle(a.current)),null!==f&&void 0===this.finalKeyframe&&(this.finalKeyframe=f),this.removedTransforms?.length&&this.removedTransforms.forEach(([b,c])=>{a.getValue(b).set(c)}),this.resolveNoneKeyframes()}}let aU=a=>1e3*a;function aV(a,b){-1===a.indexOf(b)&&a.push(b)}function aW(a,b){let c=a.indexOf(b);c>-1&&a.splice(c,1)}class aX{constructor(){this.subscriptions=[]}add(a){return aV(this.subscriptions,a),()=>aW(this.subscriptions,a)}notify(a,b,c){let d=this.subscriptions.length;if(d)if(1===d)this.subscriptions[0](a,b,c);else for(let e=0;e<d;e++){let d=this.subscriptions[e];d&&d(a,b,c)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function aY(a){let b;return()=>(void 0===b&&(b=a()),b)}let aZ=aY(()=>void 0!==window.ScrollTimeline),a$=a=>null!==a;function a_(a,{repeat:b,repeatType:c="loop"},d,e=1){let f=a.filter(a$),g=e<0||b&&"loop"!==c&&b%2==1?0:f.length-1;return g&&void 0!==d?d:f[g]}class a0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(a=>{this.resolve=a})}notifyFinished(){this.resolve()}then(a,b){return this.finished.then(a,b)}}let a1={layout:0,mainThread:0,waapi:0},a2=a=>Array.isArray(a)&&"number"==typeof a[0],a3={},a4=function(a,b){let c=aY(a);return()=>a3[b]??c()}(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(a){return!1}return!0},"linearEasing"),a5=(a,b,c=10)=>{let d="",e=Math.max(Math.round(b/c),2);for(let b=0;b<e;b++)d+=Math.round(1e4*a(b/(e-1)))/1e4+", ";return`linear(${d.substring(0,d.length-2)})`},a6=([a,b,c,d])=>`cubic-bezier(${a}, ${b}, ${c}, ${d})`,a7={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:a6([0,.65,.55,1]),circOut:a6([.55,0,1,.45]),backIn:a6([.31,.01,.66,-.59]),backOut:a6([.33,1.53,.69,.99])};function a8(a){return"function"==typeof a&&"applyToOptions"in a}class a9 extends a0{constructor(a){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!a)return;let{element:b,name:c,keyframes:d,pseudoElement:e,allowFlatten:f=!1,finalKeyframe:g,onComplete:h}=a;this.isPseudoElement=!!e,this.allowFlatten=f,this.options=a,ad("string"!=typeof a.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");let i=function({type:a,...b}){return a8(a)&&a4()?a.applyToOptions(b):(b.duration??(b.duration=300),b.ease??(b.ease="easeOut"),b)}(a);this.animation=function(a,b,c,{delay:d=0,duration:e=300,repeat:f=0,repeatType:g="loop",ease:h="easeOut",times:i}={},j){let k={[b]:c};i&&(k.offset=i);let l=function a(b,c){if(b)return"function"==typeof b?a4()?a5(b,c):"ease-out":a2(b)?a6(b):Array.isArray(b)?b.map(b=>a(b,c)||a7.easeOut):a7[b]}(h,e);Array.isArray(l)&&(k.easing=l),aD.value&&a1.waapi++;let m={delay:d,duration:e,easing:Array.isArray(l)?"linear":l,fill:"both",iterations:f+1,direction:"reverse"===g?"alternate":"normal"};j&&(m.pseudoElement=j);let n=a.animate(k,m);return aD.value&&n.finished.finally(()=>{a1.waapi--}),n}(b,c,d,i,e),!1===i.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!e){let a=a_(d,this.options,g,this.speed);this.updateMotionValue?this.updateMotionValue(a):function(a,b,c){b.startsWith("--")?a.style.setProperty(b,c):a.style[b]=c}(b,c,a),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(a){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:a}=this;"idle"!==a&&"finished"!==a&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let a=this.options?.element;!this.isPseudoElement&&a?.isConnected&&this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:a=0}=this.options||{};return this.duration+a/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(a){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=aU(a)}get speed(){return this.animation.playbackRate}set speed(a){a<0&&(this.finishedTime=null),this.animation.playbackRate=a}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(a){this.manualStartTime=this.animation.startTime=a}attachTimeline({timeline:a,observe:b}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,a&&aZ())?(this.animation.timeline=a,aA):b(this)}}let ba=new Set(["opacity","clipPath","filter","transform"]),{schedule:bb}=aE(queueMicrotask,!1);function bc(){d=void 0}let bd={now:()=>(void 0===d&&bd.set(aH.isProcessing||aB.useManualTiming?aH.timestamp:performance.now()),d),set:a=>{d=a,queueMicrotask(bc)}},be={current:void 0};class bf{constructor(a,b={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{let b=bd.now();if(this.updatedAt!==b&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(a),this.owner=b.owner}setCurrent(a){this.current=a,this.updatedAt=bd.now(),null===this.canTrackVelocity&&void 0!==a&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,b){this.events[a]||(this.events[a]=new aX);let c=this.events[a].add(b);return"change"===a?()=>{c(),aF.read(()=>{this.events.change.getSize()||this.stop()})}:c}clearListeners(){for(let a in this.events)this.events[a].clear()}attach(a,b){this.passiveEffect=a,this.stopPassiveEffect=b}set(a){this.passiveEffect?this.passiveEffect(a,this.updateAndNotify):this.updateAndNotify(a)}setWithVelocity(a,b,c){this.set(b),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-c}jump(a,b=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,b&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(a){this.dependents||(this.dependents=new Set),this.dependents.add(a)}removeDependent(a){this.dependents&&this.dependents.delete(a)}get(){return be.current&&be.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var a;let b=bd.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||b-this.updatedAt>30)return 0;let c=Math.min(this.updatedAt-this.prevUpdatedAt,30);return a=parseFloat(this.current)-parseFloat(this.prevFrameValue),c?1e3/c*a:0}start(a){return this.stop(),new Promise(b=>{this.hasAnimated=!0,this.animation=a(b),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 bg(a,b){return new bf(a,b)}let bh=[...aa,C,L],bi=new WeakMap;function bj(a){return null!==a&&"object"==typeof a&&"function"==typeof a.start}function bk(a){return"string"==typeof a||Array.isArray(a)}let bl=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bm=["initial",...bl];function bn(a){return bj(a.animate)||bm.some(b=>bk(a[b]))}function bo(a){return!!(bn(a)||a.variants)}let bp={current:null},bq={current:!1},br="undefined"!=typeof window;function bs(a){let b=[{},{}];return a?.values.forEach((a,c)=>{b[0][c]=a.get(),b[1][c]=a.getVelocity()}),b}function bt(a,b,c,d){if("function"==typeof b){let[e,f]=bs(d);b=b(void 0!==c?c:a.custom,e,f)}if("string"==typeof b&&(b=a.variants&&a.variants[b]),"function"==typeof b){let[e,f]=bs(d);b=b(void 0!==c?c:a.custom,e,f)}return b}let bu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],bv={};class bw{scrapeMotionValuesFromProps(a,b,c){return{}}constructor({parent:a,props:b,presenceContext:c,reducedMotionConfig:d,skipAnimations:e,blockInitialAnimation:f,visualState:g},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=aP,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let a=bd.now();this.renderScheduledAt<a&&(this.renderScheduledAt=a,aF.render(this.render,!1,!0))};let{latestValues:i,renderState:j}=g;this.latestValues=i,this.baseTarget={...i},this.initialValues=b.initial?{...i}:{},this.renderState=j,this.parent=a,this.props=b,this.presenceContext=c,this.depth=a?a.depth+1:0,this.reducedMotionConfig=d,this.skipAnimationsConfig=e,this.options=h,this.blockInitialAnimation=!!f,this.isControllingVariants=bn(b),this.isVariantNode=bo(b),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);let{willChange:k,...l}=this.scrapeMotionValuesFromProps(b,{},this);for(let a in l){let b=l[a];void 0!==i[a]&&Y(b)&&b.set(i[a])}}mount(a){if(this.hasBeenMounted)for(let a in this.initialValues)this.values.get(a)?.jump(this.initialValues[a]),this.latestValues[a]=this.initialValues[a];this.current=a,bi.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,b)=>this.bindToMotionValue(b,a)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(bq.current||function(){if(bq.current=!0,br)if(window.matchMedia){let a=window.matchMedia("(prefers-reduced-motion)"),b=()=>bp.current=a.matches;a.addEventListener("change",b),b()}else bp.current=!1}(),this.shouldReduceMotion=bp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let a in this.projection&&this.projection.unmount(),aG(this.notifyUpdate),aG(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[a].clear();for(let a in this.features){let b=this.features[a];b&&(b.unmount(),b.isMounted=!1)}this.current=null}addChild(a){this.children.add(a),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(a)}removeChild(a){this.children.delete(a),this.enteringChildren&&this.enteringChildren.delete(a)}bindToMotionValue(a,b){let c;if(this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)(),b.accelerate&&ba.has(a)&&this.current instanceof HTMLElement){let{factory:c,keyframes:d,times:e,ease:f,duration:g}=b.accelerate,h=new a9({element:this.current,name:a,keyframes:d,times:e,ease:f,duration:aU(g)}),i=c(h);this.valueSubscriptions.set(a,()=>{i(),h.cancel()});return}let d=h.has(a);d&&this.onBindTransform&&this.onBindTransform();let e=b.on("change",b=>{this.latestValues[a]=b,this.props.onUpdate&&aF.preRender(this.notifyUpdate),d&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"undefined"!=typeof window&&window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,a,b)),this.valueSubscriptions.set(a,()=>{e(),c&&c(),b.owner&&b.stop()})}sortNodePosition(a){return this.current&&this.sortInstanceNodePosition&&this.type===a.type?this.sortInstanceNodePosition(this.current,a.current):0}updateFeatures(){let a="animation";for(a in bv){let b=bv[a];if(!b)continue;let{isEnabled:c,Feature:d}=b;if(!this.features[a]&&d&&c(this.props)&&(this.features[a]=new d(this)),this.features[a]){let b=this.features[a];b.isMounted?b.update():(b.mount(),b.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):X()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,b){this.latestValues[a]=b}update(a,b){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=b;for(let b=0;b<bu.length;b++){let c=bu[b];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);let d=a["on"+c];d&&(this.propEventSubscriptions[c]=this.on(c,d))}this.prevMotionValues=function(a,b,c){for(let d in b){let e=b[d],f=c[d];if(Y(e))a.addValue(d,e);else if(Y(f))a.addValue(d,bg(e,{owner:a}));else if(f!==e)if(a.hasValue(d)){let b=a.getValue(d);!0===b.liveStyle?b.jump(e):b.hasAnimated||b.set(e)}else{let b=a.getStaticValue(d);a.addValue(d,bg(void 0!==b?b:e,{owner:a}))}}for(let d in c)void 0===b[d]&&a.removeValue(d);return b}(this,this.scrapeMotionValuesFromProps(a,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]: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(a){let b=this.getClosestVariantNode();if(b)return b.variantChildren&&b.variantChildren.add(a),()=>b.variantChildren.delete(a)}addValue(a,b){let c=this.values.get(a);b!==c&&(c&&this.removeValue(a),this.bindToMotionValue(a,b),this.values.set(a,b),this.latestValues[a]=b.get())}removeValue(a){this.values.delete(a);let b=this.valueSubscriptions.get(a);b&&(b(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,b){if(this.props.values&&this.props.values[a])return this.props.values[a];let c=this.values.get(a);return void 0===c&&void 0!==b&&(c=bg(null===b?void 0:b,{owner:this}),this.addValue(a,c)),c}readValue(a,b){let c=void 0===this.latestValues[a]&&this.current?this.getBaseTargetFromProps(this.props,a)??this.readValueFromInstance(this.current,a,this.options):this.latestValues[a];if(null!=c){if("string"==typeof c&&(ae(c)||aQ(c)))c=parseFloat(c);else{let d;d=c,!bh.find(_(d))&&L.test(b)&&(c=aR(a,b))}this.setBaseTarget(a,Y(c)?c.get():c)}return Y(c)?c.get():c}setBaseTarget(a,b){this.baseTarget[a]=b}getBaseTarget(a){let b,{initial:c}=this.props;if("string"==typeof c||"object"==typeof c){let d=bt(this.props,c,this.presenceContext?.custom);d&&(b=d[a])}if(c&&void 0!==b)return b;let d=this.getBaseTargetFromProps(this.props,a);return void 0===d||Y(d)?void 0!==this.initialValues[a]&&void 0===b?void 0:this.baseTarget[a]:d}on(a,b){return this.events[a]||(this.events[a]=new aX),this.events[a].add(b)}notify(a,...b){this.events[a]&&this.events[a].notify(...b)}scheduleRenderMicrotask(){bb.render(this.render)}}class bx extends bw{constructor(){super(...arguments),this.KeyframeResolver=aT}sortInstanceNodePosition(a,b){return 2&a.compareDocumentPosition(b)?1:-1}getBaseTargetFromProps(a,b){let c=a.style;return c?c[b]:void 0}removeValueFromRenderState(a,{vars:b,style:c}){delete b[a],delete c[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:a}=this.props;Y(a)&&(this.childSubscription=a.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}}function by(a){return a.replace(/([A-Z])/g,a=>`-${a.toLowerCase()}`)}let bz=(a,b)=>b&&"number"==typeof a?b.transform(a):a,bA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bB=g.length;function bC(a,b,c){let{style:d,vars:e,transformOrigin:f}=a,i=!1,j=!1;for(let a in b){let c=b[a];if(h.has(a)){i=!0;continue}if(ag(a)){e[a]=c;continue}{let b=bz(c,R[a]);a.startsWith("origin")?(j=!0,f[a]=b):d[a]=b}}if(!b.transform&&(i||c?d.transform=function(a,b,c){let d="",e=!0;for(let f=0;f<bB;f++){let h=g[f],i=a[h];if(void 0===i)continue;let j=!0;if("number"==typeof i)j=i===+!!h.startsWith("scale");else{let a=parseFloat(i);j=h.startsWith("scale")?1===a:0===a}if(!j||c){let a=bz(i,R[h]);if(!j){e=!1;let b=bA[h]||h;d+=`${b}(${a}) `}c&&(b[h]=a)}}return d=d.trim(),c?d=c(b,e?"":d):e&&(d="none"),d}(b,a.transform,c):d.transform&&(d.transform="none")),j){let{originX:a="50%",originY:b="50%",originZ:c=0}=f;d.transformOrigin=`${a} ${b} ${c}`}}let bD={offset:"stroke-dashoffset",array:"stroke-dasharray"},bE={offset:"strokeDashoffset",array:"strokeDasharray"},bF=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function bG(a,{attrX:b,attrY:c,attrScale:d,pathLength:e,pathSpacing:f=1,pathOffset:g=0,...h},i,j,k){if(bC(a,h,j),i){a.style.viewBox&&(a.attrs.viewBox=a.style.viewBox);return}a.attrs=a.style,a.style={};let{attrs:l,style:m}=a;for(let a of(l.transform&&(m.transform=l.transform,delete l.transform),(m.transform||l.transformOrigin)&&(m.transformOrigin=l.transformOrigin??"50% 50%",delete l.transformOrigin),m.transform&&(m.transformBox=k?.transformBox??"fill-box",delete l.transformBox),bF))void 0!==l[a]&&(m[a]=l[a],delete l[a]);void 0!==b&&(l.x=b),void 0!==c&&(l.y=c),void 0!==d&&(l.scale=d),void 0!==e&&function(a,b,c=1,d=0,e=!0){a.pathLength=1;let f=e?bD:bE;a[f.offset]=`${-d}`,a[f.array]=`${b} ${c}`}(l,e,f,g,!1)}let bH=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"]),bI=a=>"string"==typeof a&&"svg"===a.toLowerCase();function bJ(a,{style:b,vars:c},d,e){let f,g=a.style;for(f in b)g[f]=b[f];for(f in e?.applyProjectionStyles(g,d),c)g.setProperty(f,c[f])}function bK(a,b){return b.max===b.min?0:a/(b.max-b.min)*100}let bL={correct:(a,b)=>{if(!b.target)return a;if("string"==typeof a)if(!x.test(a))return a;else a=parseFloat(a);let c=bK(a,b.target.x),d=bK(a,b.target.y);return`${c}% ${d}%`}},bM=(a,b,c)=>a+(b-a)*c,bN={borderRadius:{...bL,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bL,borderTopRightRadius:bL,borderBottomLeftRadius:bL,borderBottomRightRadius:bL,boxShadow:{correct:(a,{treeScale:b,projectionDelta:c})=>{let d=L.parse(a);if(d.length>5)return a;let e=L.createTransformer(a),f=+("number"!=typeof d[0]),g=c.x.scale*b.x,h=c.y.scale*b.y;d[0+f]/=g,d[1+f]/=h;let i=bM(g,h,.5);return"number"==typeof d[2+f]&&(d[2+f]/=i),"number"==typeof d[3+f]&&(d[3+f]/=i),e(d)}}};function bO(a,{layout:b,layoutId:c}){return h.has(a)||a.startsWith("origin")||(b||void 0!==c)&&(!!bN[a]||"opacity"===a)}function bP(a,b,c){let d=a.style,e=b?.style,f={};if(!d)return f;for(let b in d)(Y(d[b])||e&&Y(e[b])||bO(b,a)||c?.getValue(b)?.liveStyle!==void 0)&&(f[b]=d[b]);return f}function bQ(a,b,c){let d=bP(a,b,c);for(let c in a)(Y(a[c])||Y(b[c]))&&(d[-1!==g.indexOf(c)?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c]=a[c]);return d}class bR extends bx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=X}getBaseTargetFromProps(a,b){return a[b]}readValueFromInstance(a,b){if(h.has(b)){let a=T(b);return a&&a.default||0}return b=bH.has(b)?b:by(b),a.getAttribute(b)}scrapeMotionValuesFromProps(a,b,c){return bQ(a,b,c)}build(a,b,c){bG(a,b,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(a,b,c,d){for(let c in bJ(a,b,void 0,d),b.attrs)a.setAttribute(bH.has(c)?c:by(c),b.attrs[c])}mount(a){this.isSVGTag=bI(a.tagName),super.mount(a)}}function bS({top:a,left:b,right:c,bottom:d}){return{x:{min:b,max:c},y:{min:a,max:d}}}function bT(a){return void 0===a||1===a}function bU({scale:a,scaleX:b,scaleY:c}){return!bT(a)||!bT(b)||!bT(c)}function bV(a){return bU(a)||bW(a)||a.z||a.rotate||a.rotateX||a.rotateY||a.skewX||a.skewY}function bW(a){var b,c;return(b=a.x)&&"0%"!==b||(c=a.y)&&"0%"!==c}function bX(a,b,c,d,e){return void 0!==e&&(a=d+e*(a-d)),d+c*(a-d)+b}function bY(a,b=0,c=1,d,e){a.min=bX(a.min,b,c,d,e),a.max=bX(a.max,b,c,d,e)}function bZ(a,{x:b,y:c}){bY(a.x,b.translate,b.scale,b.originPoint),bY(a.y,c.translate,c.scale,c.originPoint)}function b$(a,b){a.min=a.min+b,a.max=a.max+b}function b_(a,b,c,d,e=.5){let f=bM(a.min,a.max,e);bY(a,b,c,f,d)}function b0(a,b){b_(a.x,b.x,b.scaleX,b.scale,b.originX),b_(a.y,b.y,b.scaleY,b.scale,b.originY)}function b1(a,b){return bS(function(a,b){if(!b)return a;let c=b({x:a.left,y:a.top}),d=b({x:a.right,y:a.bottom});return{top:c.y,left:c.x,bottom:d.y,right:d.x}}(a.getBoundingClientRect(),b))}class b2 extends bx{constructor(){super(...arguments),this.type="html",this.renderInstance=bJ}readValueFromInstance(a,b){if(h.has(b))return this.projection?.isProjecting?at(b):((a,b)=>{let{transform:c="none"}=getComputedStyle(a);return au(c,b)})(a,b);{let c=window.getComputedStyle(a),d=(ag(b)?c.getPropertyValue(b):c[b])||0;return"string"==typeof d?d.trim():d}}measureInstanceViewportBox(a,{transformPagePoint:b}){return b1(a,b)}build(a,b,c){bC(a,b,c.transformTemplate)}scrapeMotionValuesFromProps(a,b,c){return bP(a,b,c)}}var b3=c(115962);let b4=["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 b5(a){if("string"!=typeof a||a.includes("-"));else if(b4.indexOf(a)>-1||/[A-Z]/u.test(a))return!0;return!1}var b6=c(736927),b7=c(11263);let b8=(0,b3.createContext)({strict:!1});var b9=c(807740);let ca=(0,b3.createContext)({});function cb(a){return Array.isArray(a)?a.join(" "):a}let cc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function cd(a,b,c){for(let d in b)Y(b[d])||bO(d,c)||(a[d]=b[d])}let ce=()=>({...cc(),attrs:{}}),cf=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","propagate","ignoreStrict","viewport"]);function cg(a){return a.startsWith("while")||a.startsWith("drag")&&"draggable"!==a||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||cf.has(a)}let ch=a=>!cg(a);try{!function(a){"function"==typeof a&&(ch=b=>b.startsWith("on")?!cg(b):a(b))}(require("@emotion/is-prop-valid").default)}catch{}function ci(a){return Y(a)?a.get():a}var cj=c(950717),ck=c(41651);let cl=a=>(b,c)=>{let d=(0,b3.useContext)(ca),e=(0,b3.useContext)(cj.t),f=()=>(function({scrapeMotionValuesFromProps:a,createRenderState:b},c,d,e){return{latestValues:function(a,b,c,d){let e={},f=d(a,{});for(let a in f)e[a]=ci(f[a]);let{initial:g,animate:h}=a,i=bn(a),j=bo(a);b&&j&&!i&&!1!==a.inherit&&(void 0===g&&(g=b.initial),void 0===h&&(h=b.animate));let k=!!c&&!1===c.initial,l=(k=k||!1===g)?h:g;if(l&&"boolean"!=typeof l&&!bj(l)){let b=Array.isArray(l)?l:[l];for(let c=0;c<b.length;c++){let d=bt(a,b[c]);if(d){let{transitionEnd:a,transition:b,...c}=d;for(let a in c){let b=c[a];if(Array.isArray(b)){let a=k?b.length-1:0;b=b[a]}null!==b&&(e[a]=b)}for(let b in a)e[b]=a[b]}}}return e}(c,d,e,a),renderState:b()}})(a,b,d,e);return c?f():(0,ck.M)(f)},cm=cl({scrapeMotionValuesFromProps:bP,createRenderState:cc}),cn=cl({scrapeMotionValuesFromProps:bQ,createRenderState:ce});var co=c(589734);let cp={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"]},cq=!1;function cr(){return!function(){if(cq)return;let a={};for(let b in cp)a[b]={isEnabled:a=>cp[b].some(b=>!!a[b])};bv=a,cq=!0}(),bv}let cs=Symbol.for("motionComponentSymbol"),ct="data-"+by("framerAppearId"),cu=(0,b3.createContext)({});function cv(a){return a&&"object"==typeof a&&Object.prototype.hasOwnProperty.call(a,"current")}var cw=c(100546);function cx(a,{forwardMotionProps:b=!1,type:c}={},d,e){d&&function(a){let b=cr();for(let c in a)b[c]={...b[c],...a[c]};bv=b}(d);let f=c?"svg"===c:b5(a),g=f?cn:cm;function h(c,d){let h,i={...(0,b3.useContext)(b9.Q),...c,layoutId:function({layoutId:a}){let b=(0,b3.useContext)(b7.L).id;return b&&void 0!==a?b+"-"+a:a}(c)},{isStatic:j}=i,k=function(a){let{initial:b,animate:c}=function(a,b){if(bn(a)){let{initial:b,animate:c}=a;return{initial:!1===b||bk(b)?b:void 0,animate:bk(c)?c:void 0}}return!1!==a.inherit?b:{}}(a,(0,b3.useContext)(ca));return(0,b3.useMemo)(()=>({initial:b,animate:c}),[cb(b),cb(c)])}(c),l=g(c,j);if(!j&&co.B){(0,b3.useContext)(b8).strict;let b=function(a){let{drag:b,layout:c}=cr();if(!b&&!c)return{};let d={...b,...c};return{MeasureLayout:b?.isEnabled(a)||c?.isEnabled(a)?d.MeasureLayout:void 0,ProjectionNode:d.ProjectionNode}}(i);h=b.MeasureLayout,k.visualElement=function(a,b,c,d,e,f){let{visualElement:g}=(0,b3.useContext)(ca),h=(0,b3.useContext)(b8),i=(0,b3.useContext)(cj.t),j=(0,b3.useContext)(b9.Q),k=j.reducedMotion,l=j.skipAnimations,m=(0,b3.useRef)(null),n=(0,b3.useRef)(!1);d=d||h.renderer,!m.current&&d&&(m.current=d(a,{visualState:b,parent:g,props:c,presenceContext:i,blockInitialAnimation:!!i&&!1===i.initial,reducedMotionConfig:k,skipAnimations:l,isSVG:f}),n.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let o=m.current,p=(0,b3.useContext)(cu);o&&!o.projection&&e&&("html"===o.type||"svg"===o.type)&&function(a,b,c,d){let{layoutId:e,layout:f,drag:g,dragConstraints:h,layoutScroll:i,layoutRoot:j,layoutCrossfade:k}=b;a.projection=new c(a.latestValues,b["data-framer-portal-id"]?void 0:function a(b){if(b)return!1!==b.options.allowProjection?b.projection:a(b.parent)}(a.parent)),a.projection.setOptions({layoutId:e,layout:f,alwaysMeasureLayout:!!g||h&&cv(h),visualElement:a,animationType:"string"==typeof f?f:"both",initialPromotionConfig:d,crossfade:k,layoutScroll:i,layoutRoot:j})}(m.current,c,e,p);let q=(0,b3.useRef)(!1);(0,b3.useInsertionEffect)(()=>{o&&q.current&&o.update(c,i)});let r=c[ct],s=(0,b3.useRef)(!!r&&!window.MotionHandoffIsComplete?.(r)&&window.MotionHasOptimisedAnimation?.(r));return(0,cw.E)(()=>{n.current=!0,o&&(q.current=!0,window.MotionIsMounted=!0,o.updateFeatures(),o.scheduleRenderMicrotask(),s.current&&o.animationState&&o.animationState.animateChanges())}),o}(a,l,i,e,b.ProjectionNode,f)}return(0,b6.jsxs)(ca.Provider,{value:k,children:[h&&k.visualElement?(0,b6.jsx)(h,{visualElement:k.visualElement,...i}):null,function(a,b,c,{latestValues:d},e,f=!1,g){let h=(g??b5(a)?function(a,b,c,d){let e=(0,b3.useMemo)(()=>{let c=ce();return bG(c,b,bI(d),a.transformTemplate,a.style),{...c.attrs,style:{...c.style}}},[b]);if(a.style){let b={};cd(b,a.style,a),e.style={...b,...e.style}}return e}:function(a,b){let c={},d=function(a,b){let c=a.style||{},d={};return cd(d,c,a),Object.assign(d,function({transformTemplate:a},b){return(0,b3.useMemo)(()=>{let c=cc();return bC(c,b,a),Object.assign({},c.vars,c.style)},[b])}(a,b)),d}(a,b);return a.drag&&!1!==a.dragListener&&(c.draggable=!1,d.userSelect=d.WebkitUserSelect=d.WebkitTouchCallout="none",d.touchAction=!0===a.drag?"none":`pan-${"x"===a.drag?"y":"x"}`),void 0===a.tabIndex&&(a.onTap||a.onTapStart||a.whileTap)&&(c.tabIndex=0),c.style=d,c})(b,d,e,a),i=function(a,b,c){let d={};for(let e in a)("values"!==e||"object"!=typeof a.values)&&(ch(e)||!0===c&&cg(e)||!b&&!cg(e)||a.draggable&&e.startsWith("onDrag"))&&(d[e]=a[e]);return d}(b,"string"==typeof a,f),j=a!==b3.Fragment?{...i,...h,ref:c}:{},{children:k}=b,l=(0,b3.useMemo)(()=>Y(k)?k.get():k,[k]);return(0,b3.createElement)(a,{...j,children:l})}(a,c,function(a,b,c){let d=(0,b3.useRef)(c);(0,b3.useInsertionEffect)(()=>{d.current=c});let e=(0,b3.useRef)(null);return(0,b3.useCallback)(c=>{c&&a.onMount?.(c),b&&(c?b.mount(c):b.unmount());let f=d.current;if("function"==typeof f)if(c){let a=f(c);"function"==typeof a&&(e.current=a)}else e.current?(e.current(),e.current=null):f(c);else f&&(f.current=c)},[b])}(l,k.visualElement,d),l,j,b,f)]})}h.displayName=`motion.${"string"==typeof a?a:`create(${a.displayName??a.name??""})`}`;let i=(0,b3.forwardRef)(h);return i[cs]=a,i}class cy{constructor(a){this.isMounted=!1,this.node=a}update(){}}function cz(a,b,c){let d=a.getProps();return bt(d,b,void 0!==c?c:d.custom,a)}function cA(a,b){if(a?.inherit&&b){let{inherit:c,...d}=a;return{...b,...d}}return a}function cB(a,b){let c=a?.[b]??a?.default??a;return c!==a?cA(c,a):c}let cC=a=>Array.isArray(a);function cD(a,b){let c=a.getValue("willChange");if(Y(c)&&c.add)return c.add(b);if(!c&&aB.WillChange){let c=new aB.WillChange("auto");a.addValue("willChange",c),c.add(b)}}let cE=(a,b)=>c=>b(a(c)),cF=(...a)=>a.reduce(cE);function cG(a,b,c){return(c<0&&(c+=1),c>1&&(c-=1),c<1/6)?a+(b-a)*6*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a}function cH(a,b){return c=>c>0?b:a}let cI=(a,b,c)=>{let d=a*a,e=c*(b*b-d)+d;return e<0?0:Math.sqrt(e)},cJ=[t,s,B];function cK(a){let b=cJ.find(b=>b.test(a));if(ac(!!b,`'${a}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!b)return!1;let c=b.parse(a);return b===B&&(c=function({hue:a,saturation:b,lightness:c,alpha:d}){a/=360,c/=100;let e=0,f=0,g=0;if(b/=100){let d=c<.5?c*(1+b):c+b-c*b,h=2*c-d;e=cG(h,d,a+1/3),f=cG(h,d,a),g=cG(h,d,a-1/3)}else e=f=g=c;return{red:Math.round(255*e),green:Math.round(255*f),blue:Math.round(255*g),alpha:d}}(c)),c}let cL=(a,b)=>{let c=cK(a),d=cK(b);if(!c||!d)return cH(a,b);let e={...c};return a=>(e.red=cI(c.red,d.red,a),e.green=cI(c.green,d.green,a),e.blue=cI(c.blue,d.blue,a),e.alpha=bM(c.alpha,d.alpha,a),s.transform(e))},cM=new Set(["none","hidden"]);function cN(a,b){return c=>bM(a,b,c)}function cO(a){return"number"==typeof a?cN:"string"==typeof a?ai(a)?cH:C.test(a)?cL:cR:Array.isArray(a)?cP:"object"==typeof a?C.test(a)?cL:cQ:cH}function cP(a,b){let c=[...a],d=c.length,e=a.map((a,c)=>cO(a)(a,b[c]));return a=>{for(let b=0;b<d;b++)c[b]=e[b](a);return c}}function cQ(a,b){let c={...a,...b},d={};for(let e in c)void 0!==a[e]&&void 0!==b[e]&&(d[e]=cO(a[e])(a[e],b[e]));return a=>{for(let b in d)c[b]=d[b](a);return c}}let cR=(a,b)=>{let c=L.createTransformer(b),d=H(a),e=H(b);return d.indexes.var.length===e.indexes.var.length&&d.indexes.color.length===e.indexes.color.length&&d.indexes.number.length>=e.indexes.number.length?cM.has(a)&&!e.values.length||cM.has(b)&&!d.values.length?function(a,b){return cM.has(a)?c=>c<=0?a:b:c=>c>=1?b:a}(a,b):cF(cP(function(a,b){let c=[],d={color:0,var:0,number:0};for(let e=0;e<b.values.length;e++){let f=b.types[e],g=a.indexes[f][d[f]],h=a.values[g]??0;c[e]=h,d[f]++}return c}(d,e),e.values),c):(ac(!0,`Complex values '${a}' and '${b}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),cH(a,b))};function cS(a,b,c){return"number"==typeof a&&"number"==typeof b&&"number"==typeof c?bM(a,b,c):cO(a)(a,b)}let cT=a=>{let b=({timestamp:b})=>a(b);return{start:(a=!0)=>aF.update(b,a),stop:()=>aG(b),now:()=>aH.isProcessing?aH.timestamp:bd.now()}};function cU(a){let b=0,c=a.next(b);for(;!c.done&&b<2e4;)b+=50,c=a.next(b);return b>=2e4?1/0:b}function cV(a,b,c){var d,e;let f=Math.max(b-5,0);return d=c-a(f),(e=b-f)?1e3/e*d:0}let cW={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};function cX(a,b){return a*Math.sqrt(1-b*b)}let cY=["duration","bounce"],cZ=["stiffness","damping","mass"];function c$(a,b){return b.some(b=>void 0!==a[b])}function c_(a=cW.visualDuration,b=cW.bounce){let c,d="object"!=typeof a?{visualDuration:a,keyframes:[0,1],bounce:b}:a,{restSpeed:e,restDelta:f}=d,g=d.keyframes[0],h=d.keyframes[d.keyframes.length-1],j={done:!1,value:g},{stiffness:k,damping:l,mass:m,duration:n,velocity:o,isResolvedFromDuration:p}=function(a){let b={velocity:cW.velocity,stiffness:cW.stiffness,damping:cW.damping,mass:cW.mass,isResolvedFromDuration:!1,...a};if(!c$(a,cZ)&&c$(a,cY))if(a.visualDuration){let c=2*Math.PI/(1.2*a.visualDuration),d=c*c,e=2*i(.05,1,1-(a.bounce||0))*Math.sqrt(d);b={...b,mass:cW.mass,stiffness:d,damping:e}}else{let c=function({duration:a=cW.duration,bounce:b=cW.bounce,velocity:c=cW.velocity,mass:d=cW.mass}){let e,f;ac(a<=aU(cW.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let g=1-b;g=i(cW.minDamping,cW.maxDamping,g),a=i(cW.minDuration,cW.maxDuration,a/1e3),g<1?(e=b=>{let d=b*g,e=d*a;return .001-(d-c)/cX(b,g)*Math.exp(-e)},f=b=>{let d=b*g*a,f=Math.pow(g,2)*Math.pow(b,2)*a,h=Math.exp(-d),i=cX(Math.pow(b,2),g);return(d*c+c-f)*h*(-e(b)+.001>0?-1:1)/i}):(e=b=>-.001+Math.exp(-b*a)*((b-c)*a+1),f=b=>a*a*(c-b)*Math.exp(-b*a));let h=function(a,b,c){let d=c;for(let c=1;c<12;c++)d-=a(d)/b(d);return d}(e,f,5/a);if(a=aU(a),isNaN(h))return{stiffness:cW.stiffness,damping:cW.damping,duration:a};{let b=Math.pow(h,2)*d;return{stiffness:b,damping:2*g*Math.sqrt(d*b),duration:a}}}(a);(b={...b,...c,mass:cW.mass}).isResolvedFromDuration=!0}return b}({...d,velocity:-((d.velocity||0)/1e3)}),q=o||0,r=l/(2*Math.sqrt(k*m)),s=h-g,t=Math.sqrt(k/m)/1e3,u=5>Math.abs(s);if(e||(e=u?cW.restSpeed.granular:cW.restSpeed.default),f||(f=u?cW.restDelta.granular:cW.restDelta.default),r<1){let a=cX(t,r);c=b=>h-Math.exp(-r*t*b)*((q+r*t*s)/a*Math.sin(a*b)+s*Math.cos(a*b))}else if(1===r)c=a=>h-Math.exp(-t*a)*(s+(q+t*s)*a);else{let a=t*Math.sqrt(r*r-1);c=b=>{let c=Math.exp(-r*t*b),d=Math.min(a*b,300);return h-c*((q+r*t*s)*Math.sinh(d)+a*s*Math.cosh(d))/a}}let v={calculatedDuration:p&&n||null,next:a=>{let b=c(a);if(p)j.done=a>=n;else{let d=0===a?q:0;r<1&&(d=0===a?aU(q):cV(c,a,b));let g=Math.abs(h-b)<=f;j.done=Math.abs(d)<=e&&g}return j.value=j.done?h:b,j},toString:()=>{let a=Math.min(cU(v),2e4),b=a5(b=>v.next(a*b).value,a,30);return a+"ms "+b},toTransition:()=>{}};return v}function c0({keyframes:a,velocity:b=0,power:c=.8,timeConstant:d=325,bounceDamping:e=10,bounceStiffness:f=500,modifyTarget:g,min:h,max:i,restDelta:j=.5,restSpeed:k}){let l,m,n=a[0],o={done:!1,value:n},p=c*b,q=n+p,r=void 0===g?q:g(q);r!==q&&(p=r-n);let s=a=>-p*Math.exp(-a/d),t=a=>r+s(a),u=a=>{let b=s(a),c=t(a);o.done=Math.abs(b)<=j,o.value=o.done?r:c},v=a=>{let b;if(b=o.value,void 0!==h&&b<h||void 0!==i&&b>i){var c;l=a,m=c_({keyframes:[o.value,(c=o.value,void 0===h?i:void 0===i||Math.abs(h-c)<Math.abs(i-c)?h:i)],velocity:cV(t,a,o.value),damping:e,stiffness:f,restDelta:j,restSpeed:k})}};return v(0),{calculatedDuration:null,next:a=>{let b=!1;return(m||void 0!==l||(b=!0,u(a),v(a)),void 0!==l&&a>=l)?m.next(a-l):(b||u(a),o)}}}c_.applyToOptions=a=>{let b=function(a,b=100,c){let d=c({...a,keyframes:[0,b]}),e=Math.min(cU(d),2e4);return{type:"keyframes",ease:a=>d.next(e*a).value/b,duration:e/1e3}}(a,100,c_);return a.ease=b.ease,a.duration=aU(b.duration),a.type="keyframes",a};let c1=(a,b,c)=>(((1-3*c+3*b)*a+(3*c-6*b))*a+3*b)*a;function c2(a,b,c,d){return a===b&&c===d?aA:e=>0===e||1===e?e:c1(function(a,b,c,d,e){let f,g,h=0;do(f=c1(g=b+(c-b)/2,d,e)-a)>0?c=g:b=g;while(Math.abs(f)>1e-7&&++h<12);return g}(e,0,1,a,c),b,d)}let c3=c2(.42,0,1,1),c4=c2(0,0,.58,1),c5=c2(.42,0,.58,1),c6=a=>b=>b<=.5?a(2*b)/2:(2-a(2*(1-b)))/2,c7=a=>b=>1-a(1-b),c8=c2(.33,1.53,.69,.99),c9=c7(c8),da=c6(c9),db=a=>(a*=2)<1?.5*c9(a):.5*(2-Math.pow(2,-10*(a-1))),dc=a=>1-Math.sin(Math.acos(a)),dd=c7(dc),de=c6(dc),df={linear:aA,easeIn:c3,easeInOut:c5,easeOut:c4,circIn:dc,circInOut:de,circOut:dd,backIn:c9,backInOut:da,backOut:c8,anticipate:db},dg=a=>{if(a2(a)){ad(4===a.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[b,c,d,e]=a;return c2(b,c,d,e)}return"string"==typeof a?(ad(void 0!==df[a],`Invalid easing type '${a}'`,"invalid-easing-type"),df[a]):a},dh=(a,b,c)=>{let d=b-a;return 0===d?1:(c-a)/d};function di({duration:a=300,keyframes:b,times:c,ease:d="easeInOut"}){var e;let f=Array.isArray(d)&&"number"!=typeof d[0]?d.map(dg):dg(d),g={done:!1,value:b[0]},h=function(a,b,{clamp:c=!0,ease:d,mixer:e}={}){let f=a.length;if(ad(f===b.length,"Both input and output ranges must be the same length","range-length"),1===f)return()=>b[0];if(2===f&&b[0]===b[1])return()=>b[1];let g=a[0]===a[1];a[0]>a[f-1]&&(a=[...a].reverse(),b=[...b].reverse());let h=function(a,b,c){let d=[],e=c||aB.mix||cS,f=a.length-1;for(let c=0;c<f;c++){let f=e(a[c],a[c+1]);b&&(f=cF(Array.isArray(b)?b[c]||aA:b,f)),d.push(f)}return d}(b,d,e),j=h.length,k=c=>{if(g&&c<a[0])return b[0];let d=0;if(j>1)for(;d<a.length-2&&!(c<a[d+1]);d++);let e=dh(a[d],a[d+1],c);return h[d](e)};return c?b=>k(i(a[0],a[f-1],b)):k}((e=c&&c.length===b.length?c:function(a){let b=[0];return!function(a,b){let c=a[a.length-1];for(let d=1;d<=b;d++){let e=dh(0,b,d);a.push(bM(c,1,e))}}(b,a.length-1),b}(b),e.map(b=>b*a)),b,{ease:Array.isArray(f)?f:b.map(()=>f||c5).splice(0,b.length-1)});return{calculatedDuration:a,next:b=>(g.value=h(b),g.done=b>=a,g)}}let dj={decay:c0,inertia:c0,tween:di,keyframes:di,spring:c_};function dk(a){"string"==typeof a.type&&(a.type=dj[a.type])}let dl=a=>a/100;class dm extends a0{constructor(a){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:a}=this.options;a&&a.updatedAt!==bd.now()&&this.tick(bd.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},a1.mainThread++,this.options=a,this.initAnimation(),this.play(),!1===a.autoplay&&this.pause()}initAnimation(){let{options:a}=this;dk(a);let{type:b=di,repeat:c=0,repeatDelay:d=0,repeatType:e,velocity:f=0}=a,{keyframes:g}=a,h=b||di;h!==di&&"number"!=typeof g[0]&&(this.mixKeyframes=cF(dl,cS(g[0],g[1])),g=[0,100]);let i=h({...a,keyframes:g});"mirror"===e&&(this.mirroredGenerator=h({...a,keyframes:[...g].reverse(),velocity:-f})),null===i.calculatedDuration&&(i.calculatedDuration=cU(i));let{calculatedDuration:j}=i;this.calculatedDuration=j,this.resolvedDuration=j+d,this.totalDuration=this.resolvedDuration*(c+1)-d,this.generator=i}updateTime(a){let b=Math.round(a-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=b}tick(a,b=!1){let{generator:c,totalDuration:d,mixKeyframes:e,mirroredGenerator:f,resolvedDuration:g,calculatedDuration:h}=this;if(null===this.startTime)return c.next(0);let{delay:j=0,keyframes:k,repeat:l,repeatType:m,repeatDelay:n,type:o,onUpdate:p,finalKeyframe:q}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-d/this.speed,this.startTime)),b?this.currentTime=a:this.updateTime(a);let r=this.currentTime-j*(this.playbackSpeed>=0?1:-1),s=this.playbackSpeed>=0?r<0:r>d;this.currentTime=Math.max(r,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=d);let t=this.currentTime,u=c;if(l){let a=Math.min(this.currentTime,d)/g,b=Math.floor(a),c=a%1;!c&&a>=1&&(c=1),1===c&&b--,(b=Math.min(b,l+1))%2&&("reverse"===m?(c=1-c,n&&(c-=n/g)):"mirror"===m&&(u=f)),t=i(0,1,c)*g}let v=s?{done:!1,value:k[0]}:u.next(t);e&&(v.value=e(v.value));let{done:w}=v;s||null===h||(w=this.playbackSpeed>=0?this.currentTime>=d:this.currentTime<=0);let x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return x&&o!==c0&&(v.value=a_(k,this.options,q,this.speed)),p&&p(v.value),x&&this.finish(),v}then(a,b){return this.finished.then(a,b)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:a=0}=this.options||{};return this.duration+a/1e3}get time(){return this.currentTime/1e3}set time(a){a=aU(a),this.currentTime=a,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(a){this.updateTime(bd.now());let b=this.playbackSpeed!==a;this.playbackSpeed=a,b&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:a=cT,startTime:b}=this.options;this.driver||(this.driver=a(a=>this.tick(a))),this.options.onPlay?.();let c=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=c):null!==this.holdTime?this.startTime=c-this.holdTime:this.startTime||(this.startTime=b??c),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(bd.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&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,a1.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}attachTimeline(a){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),a.observe(this)}}let dn={anticipate:db,backInOut:da,circInOut:de};class dp extends a9{constructor(a){!function(a){"string"==typeof a.ease&&a.ease in dn&&(a.ease=dn[a.ease])}(a),dk(a),super(a),void 0!==a.startTime&&(this.startTime=a.startTime),this.options=a}updateMotionValue(a){let{motionValue:b,onUpdate:c,onComplete:d,element:e,...f}=this.options;if(!b)return;if(void 0!==a)return void b.set(a);let g=new dm({...f,autoplay:!1}),h=Math.max(10,bd.now()-this.startTime),j=i(0,10,h-10);b.setWithVelocity(g.sample(Math.max(0,h-j)).value,g.sample(h).value,j),g.stop()}}let dq=(a,b)=>"zIndex"!==b&&!!("number"==typeof a||Array.isArray(a)||"string"==typeof a&&(L.test(a)||"0"===a)&&!a.startsWith("url("));function dr(a){a.duration=0,a.type="keyframes"}let ds=new Set(["opacity","clipPath","filter","transform"]),dt=aY(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class du extends a0{constructor({autoplay:a=!0,delay:b=0,type:c="keyframes",repeat:d=0,repeatDelay:e=0,repeatType:f="loop",keyframes:g,name:h,motionValue:i,element:j,...k}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=bd.now();let l={autoplay:a,delay:b,type:c,repeat:d,repeatDelay:e,repeatType:f,name:h,motionValue:i,element:j,...k},m=j?.KeyframeResolver||aP;this.keyframeResolver=new m(g,(a,b,c)=>this.onKeyframesResolved(a,b,l,!c),h,i,j),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(a,b,c,d){this.keyframeResolver=void 0;let{name:e,type:f,velocity:g,delay:h,isHandoff:i,onUpdate:j}=c;this.resolvedAt=bd.now(),!function(a,b,c,d){let e=a[0];if(null===e)return!1;if("display"===b||"visibility"===b)return!0;let f=a[a.length-1],g=dq(e,b),h=dq(f,b);return ac(g===h,`You are trying to animate ${b} from "${e}" to "${f}". "${g?f:e}" is not an animatable value.`,"value-not-animatable"),!!g&&!!h&&(function(a){let b=a[0];if(1===a.length)return!0;for(let c=0;c<a.length;c++)if(a[c]!==b)return!0}(a)||("spring"===c||a8(c))&&d)}(a,e,f,g)&&((aB.instantAnimations||!h)&&j?.(a_(a,c,b)),a[0]=a[a.length-1],dr(c),c.repeat=0);let k={startTime:d?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:b,...c,keyframes:a},l=!i&&function(a){let{motionValue:b,name:c,repeatDelay:d,repeatType:e,damping:f,type:g}=a;if(!(b?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:h,transformTemplate:i}=b.owner.getProps();return dt()&&c&&ds.has(c)&&("transform"!==c||!i)&&!h&&!d&&"mirror"!==e&&0!==f&&"inertia"!==g}(k),m=k.motionValue?.owner?.current,n=l?new dp({...k,element:m}):new dm(k);n.finished.then(()=>{this.notifyFinished()}).catch(aA),this.pendingTimeline&&(this.stopTimeline=n.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=n}get finished(){return this._animation?this.animation.finished:this._finished}then(a,b){return this.finished.finally(a).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),aM=!0,aO(),aN(),aM=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(a){this.animation.time=a}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(a){this.animation.speed=a}get startTime(){return this.animation.startTime}attachTimeline(a){return this._animation?this.stopTimeline=this.animation.attachTimeline(a):this.pendingTimeline=a,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let dv={type:"spring",stiffness:500,damping:25,restSpeed:10},dw={type:"keyframes",duration:.8},dx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dy=a=>null!==a,dz=(a,b,c,d={},e,f)=>g=>{let i=cB(d,a)||{},j=i.delay||d.delay||0,{elapsed:k=0}=d;k-=aU(j);let l={keyframes:Array.isArray(c)?c:[null,c],ease:"easeOut",velocity:b.getVelocity(),...i,delay:-k,onUpdate:a=>{b.set(a),i.onUpdate&&i.onUpdate(a)},onComplete:()=>{g(),i.onComplete&&i.onComplete()},name:a,motionValue:b,element:f?void 0:e};!function({when:a,delay:b,delayChildren:c,staggerChildren:d,staggerDirection:e,repeat:f,repeatType:g,repeatDelay:h,from:i,elapsed:j,...k}){return!!Object.keys(k).length}(i)&&Object.assign(l,((a,{keyframes:b})=>b.length>2?dw:h.has(a)?a.startsWith("scale")?{type:"spring",stiffness:550,damping:0===b[1]?2*Math.sqrt(550):30,restSpeed:10}:dv:dx)(a,l)),l.duration&&(l.duration=aU(l.duration)),l.repeatDelay&&(l.repeatDelay=aU(l.repeatDelay)),void 0!==l.from&&(l.keyframes[0]=l.from);let m=!1;if(!1!==l.type&&(0!==l.duration||l.repeatDelay)||(dr(l),0===l.delay&&(m=!0)),(aB.instantAnimations||aB.skipAnimations||e?.shouldSkipAnimations)&&(m=!0,dr(l),l.delay=0),l.allowFlatten=!i.type&&!i.ease,m&&!f&&void 0!==b.get()){let a=function(a,{repeat:b,repeatType:c="loop"},d){let e=a.filter(dy),f=b&&"loop"!==c&&b%2==1?0:e.length-1;return e[f]}(l.keyframes,i);if(void 0!==a)return void aF.update(()=>{l.onUpdate(a),l.onComplete()})}return i.isSync?new dm(l):new du(l)};function dA(a,b,{delay:c=0,transitionOverride:d,type:e}={}){let{transition:f,transitionEnd:g,...h}=b,i=a.getDefaultTransition();f=f?cA(f,i):i;let j=f?.reduceMotion;d&&(f=d);let k=[],l=e&&a.animationState&&a.animationState.getState()[e];for(let b in h){let d=a.getValue(b,a.latestValues[b]??null),e=h[b];if(void 0===e||l&&function({protectedKeys:a,needsAnimating:b},c){let d=a.hasOwnProperty(c)&&!0!==b[c];return b[c]=!1,d}(l,b))continue;let g={delay:c,...cB(f||{},b)},i=d.get();if(void 0!==i&&!d.isAnimating&&!Array.isArray(e)&&e===i&&!g.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){let c=a.props[ct];if(c){let a=window.MotionHandoffAnimation(c,b,aF);null!==a&&(g.startTime=a,m=!0)}}cD(a,b);let n=j??a.shouldReduceMotion;d.start(dz(b,d,e,n&&Z.has(b)?{type:!1}:g,a,m));let o=d.animation;o&&k.push(o)}if(g){let b=()=>aF.update(()=>{g&&function(a,b){let{transitionEnd:c={},transition:d={},...e}=cz(a,b)||{};for(let b in e={...e,...c}){var f;let c=cC(f=e[b])?f[f.length-1]||0:f;a.hasValue(b)?a.getValue(b).set(c):a.addValue(b,bg(c))}}(a,g)});k.length?Promise.all(k).then(b):b()}return k}function dB(a,b,c,d=0,e=1){let f=Array.from(a).sort((a,b)=>a.sortNodePosition(b)).indexOf(b),g=a.size,h=(g-1)*d;return"function"==typeof c?c(f,g):1===e?f*d:h-f*d}function dC(a,b,c={}){let d=cz(a,b,"exit"===c.type?a.presenceContext?.custom:void 0),{transition:e=a.getDefaultTransition()||{}}=d||{};c.transitionOverride&&(e=c.transitionOverride);let f=d?()=>Promise.all(dA(a,d,c)):()=>Promise.resolve(),g=a.variantChildren&&a.variantChildren.size?(d=0)=>{let{delayChildren:f=0,staggerChildren:g,staggerDirection:h}=e;return function(a,b,c=0,d=0,e=0,f=1,g){let h=[];for(let i of a.variantChildren)i.notify("AnimationStart",b),h.push(dC(i,b,{...g,delay:c+("function"==typeof d?0:d)+dB(a.variantChildren,i,d,e,f)}).then(()=>i.notify("AnimationComplete",b)));return Promise.all(h)}(a,b,d,f,g,h,c)}:()=>Promise.resolve(),{when:h}=e;if(!h)return Promise.all([f(),g(c.delay)]);{let[a,b]="beforeChildren"===h?[f,g]:[g,f];return a().then(()=>b())}}let dD=bm.length;function dE(a,b){if(!Array.isArray(b))return!1;let c=b.length;if(c!==a.length)return!1;for(let d=0;d<c;d++)if(b[d]!==a[d])return!1;return!0}let dF=[...bl].reverse(),dG=bl.length;function dH(a=!1){return{isActive:a,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dI(){return{animate:dH(!0),whileInView:dH(),whileHover:dH(),whileTap:dH(),whileDrag:dH(),whileFocus:dH(),exit:dH()}}class dJ extends cy{constructor(a){super(a),a.animationState||(a.animationState=function(a){let b=b=>Promise.all(b.map(({animation:b,options:c})=>(function(a,b,c={}){let d;if(a.notify("AnimationStart",b),Array.isArray(b))d=Promise.all(b.map(b=>dC(a,b,c)));else if("string"==typeof b)d=dC(a,b,c);else{let e="function"==typeof b?cz(a,b,c.custom):b;d=Promise.all(dA(a,e,c))}return d.then(()=>{a.notify("AnimationComplete",b)})})(a,b,c))),c=dI(),d=!0,e=b=>(c,d)=>{let e=cz(a,d,"exit"===b?a.presenceContext?.custom:void 0);if(e){let{transition:a,transitionEnd:b,...d}=e;c={...c,...d,...b}}return c};function f(f){let{props:g}=a,h=function a(b){if(!b)return;if(!b.isControllingVariants){let c=b.parent&&a(b.parent)||{};return void 0!==b.props.initial&&(c.initial=b.props.initial),c}let c={};for(let a=0;a<dD;a++){let d=bm[a],e=b.props[d];(bk(e)||!1===e)&&(c[d]=e)}return c}(a.parent)||{},i=[],j=new Set,k={},l=1/0;for(let b=0;b<dG;b++){var m,n;let o=dF[b],p=c[o],q=void 0!==g[o]?g[o]:h[o],r=bk(q),s=o===f?p.isActive:null;!1===s&&(l=b);let t=q===h[o]&&q!==g[o]&&r;if(t&&d&&a.manuallyAnimateOnMount&&(t=!1),p.protectedKeys={...k},!p.isActive&&null===s||!q&&!p.prevProp||bj(q)||"boolean"==typeof q)continue;if("exit"===o&&p.isActive&&!0!==s){p.prevResolvedValues&&(k={...k,...p.prevResolvedValues});continue}let u=(m=p.prevProp,"string"==typeof(n=q)?n!==m:!!Array.isArray(n)&&!dE(n,m)),v=u||o===f&&p.isActive&&!t&&r||b>l&&r,w=!1,x=Array.isArray(q)?q:[q],y=x.reduce(e(o),{});!1===s&&(y={});let{prevResolvedValues:z={}}=p,A={...z,...y},B=b=>{v=!0,j.has(b)&&(w=!0,j.delete(b)),p.needsAnimating[b]=!0;let c=a.getValue(b);c&&(c.liveStyle=!1)};for(let a in A){let b=y[a],c=z[a];if(!k.hasOwnProperty(a))(cC(b)&&cC(c)?dE(b,c):b===c)?void 0!==b&&j.has(a)?B(a):p.protectedKeys[a]=!0:null!=b?B(a):j.add(a)}p.prevProp=q,p.prevResolvedValues=y,p.isActive&&(k={...k,...y}),d&&a.blockInitialAnimation&&(v=!1);let C=t&&u,D=!C||w;v&&D&&i.push(...x.map(b=>{let c={type:o};if("string"==typeof b&&d&&!C&&a.manuallyAnimateOnMount&&a.parent){let{parent:d}=a,e=cz(d,b);if(d.enteringChildren&&e){let{delayChildren:b}=e.transition||{};c.delay=dB(d.enteringChildren,a,b)}}return{animation:b,options:c}}))}if(j.size){let b={};if("boolean"!=typeof g.initial){let c=cz(a,Array.isArray(g.initial)?g.initial[0]:g.initial);c&&c.transition&&(b.transition=c.transition)}j.forEach(c=>{let d=a.getBaseTarget(c),e=a.getValue(c);e&&(e.liveStyle=!0),b[c]=d??null}),i.push({animation:b})}let o=!!i.length;return d&&(!1===g.initial||g.initial===g.animate)&&!a.manuallyAnimateOnMount&&(o=!1),d=!1,o?b(i):Promise.resolve()}return{animateChanges:f,setActive:function(b,d){if(c[b].isActive===d)return Promise.resolve();a.variantChildren?.forEach(a=>a.animationState?.setActive(b,d)),c[b].isActive=d;let e=f(b);for(let a in c)c[a].protectedKeys={};return e},setAnimateFunction:function(c){b=c(a)},getState:()=>c,reset:()=>{c=dI()}}}(a))}updateAnimationControlsSubscription(){let{animate:a}=this.node.getProps();bj(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:a}=this.node.getProps(),{animate:b}=this.node.prevProps||{};a!==b&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let dK=0;class dL extends cy{constructor(){super(...arguments),this.id=dK++}update(){if(!this.node.presenceContext)return;let{isPresent:a,onExitComplete:b}=this.node.presenceContext,{isPresent:c}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===c)return;let d=this.node.animationState.setActive("exit",!a);b&&!a&&d.then(()=>{b(this.id)})}mount(){let{register:a,onExitComplete:b}=this.node.presenceContext||{};b&&b(this.id),a&&(this.unmount=a(this.id))}unmount(){}}let dM={x:!1,y:!1};function dN(a){return[a("x"),a("y")]}function dO(a){return a.max-a.min}function dP(a,b,c,d=.5){a.origin=d,a.originPoint=bM(b.min,b.max,a.origin),a.scale=dO(c)/dO(b),a.translate=bM(c.min,c.max,a.origin)-a.originPoint,(a.scale>=.9999&&a.scale<=1.0001||isNaN(a.scale))&&(a.scale=1),(a.translate>=-.01&&a.translate<=.01||isNaN(a.translate))&&(a.translate=0)}function dQ(a,b,c,d){dP(a.x,b.x,c.x,d?d.originX:void 0),dP(a.y,b.y,c.y,d?d.originY:void 0)}function dR(a,b,c){a.min=c.min+b.min,a.max=a.min+dO(b)}function dS(a,b,c){a.min=b.min-c.min,a.max=a.min+dO(b)}function dT(a,b,c){dS(a.x,b.x,c.x),dS(a.y,b.y,c.y)}let dU=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),dV=new Set(["INPUT","SELECT","TEXTAREA"]);function dW(a,b,c,d={passive:!0}){return a.addEventListener(b,c,d),()=>a.removeEventListener(b,c)}var dX=c(136075);function dY(a){return(0,dX.G)(a)&&"ownerSVGElement"in a}function dZ(a,b,c){if(null==a)return[];if(a instanceof EventTarget)return[a];if("string"==typeof a){let d=document;b&&(d=b.current);let e=c?.[a]??d.querySelectorAll(a);return e?Array.from(e):[]}return Array.from(a).filter(a=>null!=a)}let d$=new WeakMap,d_=(a,b,c)=>(d,e)=>e&&e[0]?e[0][a+"Size"]:dY(d)&&"getBBox"in d?d.getBBox()[b]:d[c],d0=d_("inline","width","offsetWidth"),d1=d_("block","height","offsetHeight");function d2({target:a,borderBoxSize:b}){d$.get(a)?.forEach(c=>{c(a,{get width(){return d0(a,b)},get height(){return d1(a,b)}})})}function d3(a){a.forEach(d2)}let d4=new Set;function d5(a,b){return"function"==typeof a?(d4.add(a),f||(f=()=>{let a={get width(){return window.innerWidth},get height(){return window.innerHeight}};d4.forEach(b=>b(a))},window.addEventListener("resize",f)),()=>{d4.delete(a),d4.size||"function"!=typeof f||(window.removeEventListener("resize",f),f=void 0)}):function(a,b){e||"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(d3));let c=dZ(a);return c.forEach(a=>{let c=d$.get(a);c||(c=new Set,d$.set(a,c)),c.add(b),e?.observe(a)}),()=>{c.forEach(a=>{let c=d$.get(a);c?.delete(b),c?.size||e?.unobserve(a)})}}(a,b)}let d6=a=>"mouse"===a.pointerType?"number"!=typeof a.button||a.button<=0:!1!==a.isPrimary;function d7(a){return{point:{x:a.pageX,y:a.pageY}}}function d8(a,b,c,d){return dW(a,b,a=>d6(a)&&c(a,d7(a)),d)}let d9=({current:a})=>a?a.ownerDocument.defaultView:null,ea=(a,b)=>Math.abs(a-b),eb=new Set(["auto","scroll"]);class ec{constructor(a,b,{transformPagePoint:c,contextWindow:d=window,dragSnapToOrigin:e=!1,distanceThreshold:f=3,element:g}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=a=>{this.handleScroll(a.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=ef(this.lastMoveEventInfo,this.history),b=null!==this.startEvent,c=function(a,b){return Math.sqrt(ea(a.x,b.x)**2+ea(a.y,b.y)**2)}(a.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!c)return;let{point:d}=a,{timestamp:e}=aH;this.history.push({...d,timestamp:e});let{onStart:f,onMove:g}=this.handlers;b||(f&&f(this.lastMoveEvent,a),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,a)},this.handlePointerMove=(a,b)=>{this.lastMoveEvent=a,this.lastMoveEventInfo=ed(b,this.transformPagePoint),aF.update(this.updatePoint,!0)},this.handlePointerUp=(a,b)=>{this.end();let{onEnd:c,onSessionEnd:d,resumeAnimation:e}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&e&&e(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let f=ef("pointercancel"===a.type?this.lastMoveEventInfo:ed(b,this.transformPagePoint),this.history);this.startEvent&&c&&c(a,f),d&&d(a,f)},!d6(a))return;this.dragSnapToOrigin=e,this.handlers=b,this.transformPagePoint=c,this.distanceThreshold=f,this.contextWindow=d||window;let h=ed(d7(a),this.transformPagePoint),{point:i}=h,{timestamp:j}=aH;this.history=[{...i,timestamp:j}];let{onSessionStart:k}=b;k&&k(a,ef(h,this.history)),this.removeListeners=cF(d8(this.contextWindow,"pointermove",this.handlePointerMove),d8(this.contextWindow,"pointerup",this.handlePointerUp),d8(this.contextWindow,"pointercancel",this.handlePointerUp)),g&&this.startScrollTracking(g)}startScrollTracking(a){let b=a.parentElement;for(;b;){let a=getComputedStyle(b);(eb.has(a.overflowX)||eb.has(a.overflowY))&&this.scrollPositions.set(b,{x:b.scrollLeft,y:b.scrollTop}),b=b.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(a){let b=this.scrollPositions.get(a);if(!b)return;let c=a===window,d=c?{x:window.scrollX,y:window.scrollY}:{x:a.scrollLeft,y:a.scrollTop},e={x:d.x-b.x,y:d.y-b.y};(0!==e.x||0!==e.y)&&(c?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=e.x,this.lastMoveEventInfo.point.y+=e.y):this.history.length>0&&(this.history[0].x-=e.x,this.history[0].y-=e.y),this.scrollPositions.set(a,d),aF.update(this.updatePoint,!0))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),aG(this.updatePoint)}}function ed(a,b){return b?{point:b(a.point)}:a}function ee(a,b){return{x:a.x-b.x,y:a.y-b.y}}function ef({point:a},b){return{point:a,delta:ee(a,eg(b)),offset:ee(a,b[0]),velocity:function(a,b){if(a.length<2)return{x:0,y:0};let c=a.length-1,d=null,e=eg(a);for(;c>=0&&(d=a[c],!(e.timestamp-d.timestamp>aU(.1)));)c--;if(!d)return{x:0,y:0};d===a[0]&&a.length>2&&e.timestamp-d.timestamp>2*aU(b)&&(d=a[1]);let f=(e.timestamp-d.timestamp)/1e3;if(0===f)return{x:0,y:0};let g={x:(e.x-d.x)/f,y:(e.y-d.y)/f};return g.x===1/0&&(g.x=0),g.y===1/0&&(g.y=0),g}(b,.1)}}function eg(a){return a[a.length-1]}function eh(a,b,c){return{min:void 0!==b?a.min+b:void 0,max:void 0!==c?a.max+c-(a.max-a.min):void 0}}function ei(a,b){let c=b.min-a.min,d=b.max-a.max;return b.max-b.min<a.max-a.min&&([c,d]=[d,c]),{min:c,max:d}}function ej(a,b,c){return{min:ek(a,b),max:ek(a,c)}}function ek(a,b){return"number"==typeof a?a:a[b]||0}let el=new WeakMap;class em{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=X(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=a}start(a,{snapToCursor:b=!1,distanceThreshold:c}={}){let{presenceContext:d}=this.visualElement;if(d&&!1===d.isPresent)return;let e=a=>{b&&this.snapToCursor(d7(a).point),this.stopAnimation()},f=(a,b)=>{let{drag:c,dragPropagation:d,onDragStart:e}=this.getProps();if(c&&!d&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(a){if("x"===a||"y"===a)if(dM[a])return null;else return dM[a]=!0,()=>{dM[a]=!1};return dM.x||dM.y?null:(dM.x=dM.y=!0,()=>{dM.x=dM.y=!1})}(c),!this.openDragLock))return;this.latestPointerEvent=a,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),dN(a=>{let b=this.getAxisMotionValue(a).get()||0;if(w.test(b)){let{projection:c}=this.visualElement;if(c&&c.layout){let d=c.layout.layoutBox[a];d&&(b=dO(d)*(parseFloat(b)/100))}}this.originPoint[a]=b}),e&&aF.update(()=>e(a,b),!1,!0),cD(this.visualElement,"transform");let{animationState:f}=this.visualElement;f&&f.setActive("whileDrag",!0)},g=(a,b)=>{this.latestPointerEvent=a,this.latestPanInfo=b;let{dragPropagation:c,dragDirectionLock:d,onDirectionLock:e,onDrag:f}=this.getProps();if(!c&&!this.openDragLock)return;let{offset:g}=b;if(d&&null===this.currentDirection){this.currentDirection=function(a,b=10){let c=null;return Math.abs(a.y)>b?c="y":Math.abs(a.x)>b&&(c="x"),c}(g),null!==this.currentDirection&&e&&e(this.currentDirection);return}this.updateAxis("x",b.point,g),this.updateAxis("y",b.point,g),this.visualElement.render(),f&&aF.update(()=>f(a,b),!1,!0)},h=(a,b)=>{this.latestPointerEvent=a,this.latestPanInfo=b,this.stop(a,b),this.latestPointerEvent=null,this.latestPanInfo=null},i=()=>{let{dragSnapToOrigin:a}=this.getProps();(a||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:j}=this.getProps();this.panSession=new ec(a,{onSessionStart:e,onStart:f,onMove:g,onSessionEnd:h,resumeAnimation:i},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:j,distanceThreshold:c,contextWindow:d9(this.visualElement),element:this.visualElement.current})}stop(a,b){let c=a||this.latestPointerEvent,d=b||this.latestPanInfo,e=this.isDragging;if(this.cancel(),!e||!d||!c)return;let{velocity:f}=d;this.startAnimation(f);let{onDragEnd:g}=this.getProps();g&&aF.postRender(()=>g(c,d))}cancel(){this.isDragging=!1;let{projection:a,animationState:b}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:c}=this.getProps();!c&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),b&&b.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(a,b,c){let{drag:d}=this.getProps();if(!c||!eo(a,d,this.currentDirection))return;let e=this.getAxisMotionValue(a),f=this.originPoint[a]+c[a];this.constraints&&this.constraints[a]&&(f=function(a,{min:b,max:c},d){return void 0!==b&&a<b?a=d?bM(b,a,d.min):Math.max(a,b):void 0!==c&&a>c&&(a=d?bM(c,a,d.max):Math.min(a,c)),a}(f,this.constraints[a],this.elastic[a])),e.set(f)}resolveConstraints(){let{dragConstraints:a,dragElastic:b}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,d=this.constraints;a&&cv(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&c?this.constraints=function(a,{top:b,left:c,bottom:d,right:e}){return{x:eh(a.x,c,e),y:eh(a.y,b,d)}}(c.layoutBox,a):this.constraints=!1,this.elastic=function(a=.35){return!1===a?a=0:!0===a&&(a=.35),{x:ej(a,"left","right"),y:ej(a,"top","bottom")}}(b),d!==this.constraints&&!cv(a)&&c&&this.constraints&&!this.hasMutatedConstraints&&dN(a=>{!1!==this.constraints&&this.getAxisMotionValue(a)&&(this.constraints[a]=function(a,b){let c={};return void 0!==b.min&&(c.min=b.min-a.min),void 0!==b.max&&(c.max=b.max-a.min),c}(c.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){var a;let{dragConstraints:b,onMeasureDragConstraints:c}=this.getProps();if(!b||!cv(b))return!1;let d=b.current;ad(null!==d,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:e}=this.visualElement;if(!e||!e.layout)return!1;let f=function(a,b,c){let d=b1(a,c),{scroll:e}=b;return e&&(b$(d.x,e.offset.x),b$(d.y,e.offset.y)),d}(d,e.root,this.visualElement.getTransformPagePoint()),g=(a=e.layout.layoutBox,{x:ei(a.x,f.x),y:ei(a.y,f.y)});if(c){let a=c(function({x:a,y:b}){return{top:b.min,right:a.max,bottom:b.max,left:a.min}}(g));this.hasMutatedConstraints=!!a,a&&(g=bS(a))}return g}startAnimation(a){let{drag:b,dragMomentum:c,dragElastic:d,dragTransition:e,dragSnapToOrigin:f,onDragTransitionEnd:g}=this.getProps(),h=this.constraints||{};return Promise.all(dN(g=>{if(!eo(g,b,this.currentDirection))return;let i=h&&h[g]||{};f&&(i={min:0,max:0});let j={type:"inertia",velocity:c?a[g]:0,bounceStiffness:d?200:1e6,bounceDamping:d?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...e,...i};return this.startAxisValueAnimation(g,j)})).then(g)}startAxisValueAnimation(a,b){let c=this.getAxisMotionValue(a);return cD(this.visualElement,a),c.start(dz(a,c,0,b,this.visualElement,!1))}stopAnimation(){dN(a=>this.getAxisMotionValue(a).stop())}getAxisMotionValue(a){let b=`_drag${a.toUpperCase()}`,c=this.visualElement.getProps();return c[b]||this.visualElement.getValue(a,(c.initial?c.initial[a]:void 0)||0)}snapToCursor(a){dN(b=>{let{drag:c}=this.getProps();if(!eo(b,c,this.currentDirection))return;let{projection:d}=this.visualElement,e=this.getAxisMotionValue(b);if(d&&d.layout){let{min:c,max:f}=d.layout.layoutBox[b],g=e.get()||0;e.set(a[b]-bM(c,f,.5)+g)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:a,dragConstraints:b}=this.getProps(),{projection:c}=this.visualElement;if(!cv(b)||!c||!this.constraints)return;this.stopAnimation();let d={x:0,y:0};dN(a=>{let b=this.getAxisMotionValue(a);if(b&&!1!==this.constraints){let c=b.get();d[a]=function(a,b){let c=.5,d=dO(a),e=dO(b);return e>d?c=dh(b.min,b.max-d,a.min):d>e&&(c=dh(a.min,a.max-e,b.min)),i(0,1,c)}({min:c,max:c},this.constraints[a])}});let{transformTemplate:e}=this.visualElement.getProps();this.visualElement.current.style.transform=e?e({},""):"none",c.root&&c.root.updateScroll(),c.updateLayout(),this.constraints=!1,this.resolveConstraints(),dN(b=>{if(!eo(b,a,null))return;let c=this.getAxisMotionValue(b),{min:e,max:f}=this.constraints[b];c.set(bM(e,f,d[b]))}),this.visualElement.render()}addListeners(){let a;if(!this.visualElement.current)return;el.set(this.visualElement,this);let b=this.visualElement.current,c=d8(b,"pointerdown",a=>{let{drag:c,dragListener:d=!0}=this.getProps(),e=a.target,f=e!==b&&(dV.has(e.tagName)||!0===e.isContentEditable);c&&d&&!f&&this.start(a)}),d=()=>{let{dragConstraints:c}=this.getProps();cv(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),a||(a=function(a,b,c){let d=d5(a,en(c)),e=d5(b,en(c));return()=>{d(),e()}}(b,c.current,()=>this.scalePositionWithinConstraints())))},{projection:e}=this.visualElement,f=e.addEventListener("measure",d);e&&!e.layout&&(e.root&&e.root.updateScroll(),e.updateLayout()),aF.read(d);let g=dW(window,"resize",()=>this.scalePositionWithinConstraints()),h=e.addEventListener("didUpdate",({delta:a,hasLayoutChanged:b})=>{this.isDragging&&b&&(dN(b=>{let c=this.getAxisMotionValue(b);c&&(this.originPoint[b]+=a[b].translate,c.set(c.get()+a[b].translate))}),this.visualElement.render())});return()=>{g(),c(),f(),h&&h(),a&&a()}}getProps(){let a=this.visualElement.getProps(),{drag:b=!1,dragDirectionLock:c=!1,dragPropagation:d=!1,dragConstraints:e=!1,dragElastic:f=.35,dragMomentum:g=!0}=a;return{...a,drag:b,dragDirectionLock:c,dragPropagation:d,dragConstraints:e,dragElastic:f,dragMomentum:g}}}function en(a){let b=!0;return()=>{if(b){b=!1;return}a()}}function eo(a,b,c){return(!0===b||b===a)&&(null===c||c===a)}class ep extends cy{constructor(a){super(a),this.removeGroupControls=aA,this.removeListeners=aA,this.controls=new em(a)}mount(){let{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||aA}update(){let{dragControls:a}=this.node.getProps(),{dragControls:b}=this.node.prevProps||{};a!==b&&(this.removeGroupControls(),a&&(this.removeGroupControls=a.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}let eq=a=>(b,c)=>{a&&aF.update(()=>a(b,c),!1,!0)};class er extends cy{constructor(){super(...arguments),this.removePointerDownListener=aA}onPointerDown(a){this.session=new ec(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:d9(this.node)})}createPanHandlers(){let{onPanSessionStart:a,onPanStart:b,onPan:c,onPanEnd:d}=this.node.getProps();return{onSessionStart:eq(a),onStart:eq(b),onMove:eq(c),onEnd:(a,b)=>{delete this.session,d&&aF.postRender(()=>d(a,b))}}}mount(){this.removePointerDownListener=d8(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let es={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var et=c(15086);let eu=!1;class ev extends b3.Component{componentDidMount(){let{visualElement:a,layoutGroup:b,switchLayoutGroup:c,layoutId:d}=this.props,{projection:e}=a;e&&(b.group&&b.group.add(e),c&&c.register&&d&&c.register(e),eu&&e.root.didUpdate(),e.addEventListener("animationComplete",()=>{this.safeToRemove()}),e.setOptions({...e.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),es.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){let{layoutDependency:b,visualElement:c,drag:d,isPresent:e}=this.props,{projection:f}=c;return f&&(f.isPresent=e,a.layoutDependency!==b&&f.setOptions({...f.options,layoutDependency:b}),eu=!0,d||a.layoutDependency!==b||void 0===b||a.isPresent!==e?f.willUpdate():this.safeToRemove(),a.isPresent!==e&&(e?f.promote():f.relegate()||aF.postRender(()=>{let a=f.getStack();a&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),bb.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:a,layoutGroup:b,switchLayoutGroup:c}=this.props,{projection:d}=a;eu=!0,d&&(d.scheduleCheckAfterUnmount(),b&&b.group&&b.group.remove(d),c&&c.deregister&&c.deregister(d))}safeToRemove(){let{safeToRemove:a}=this.props;a&&a()}render(){return null}}function ew(a){let[b,c]=(0,et.xQ)(),d=(0,b3.useContext)(b7.L);return(0,b6.jsx)(ev,{...a,layoutGroup:d,switchLayoutGroup:(0,b3.useContext)(cu),isPresent:b,safeToRemove:c})}let ex=["TopLeft","TopRight","BottomLeft","BottomRight"],ey=ex.length,ez=a=>"string"==typeof a?parseFloat(a):a,eA=a=>"number"==typeof a||x.test(a);function eB(a,b){return void 0!==a[b]?a[b]:a.borderRadius}let eC=eE(0,.5,dd),eD=eE(.5,.95,aA);function eE(a,b,c){return d=>d<a?0:d>b?1:c(dh(a,b,d))}function eF(a,b){a.min=b.min,a.max=b.max}function eG(a,b){eF(a.x,b.x),eF(a.y,b.y)}function eH(a,b){a.translate=b.translate,a.scale=b.scale,a.originPoint=b.originPoint,a.origin=b.origin}function eI(a,b,c,d,e){return a-=b,a=d+1/c*(a-d),void 0!==e&&(a=d+1/e*(a-d)),a}function eJ(a,b,[c,d,e],f,g){!function(a,b=0,c=1,d=.5,e,f=a,g=a){if(w.test(b)&&(b=parseFloat(b),b=bM(g.min,g.max,b/100)-g.min),"number"!=typeof b)return;let h=bM(f.min,f.max,d);a===f&&(h-=b),a.min=eI(a.min,b,c,h,e),a.max=eI(a.max,b,c,h,e)}(a,b[c],b[d],b[e],b.scale,f,g)}let eK=["x","scaleX","originX"],eL=["y","scaleY","originY"];function eM(a,b,c,d){eJ(a.x,b,eK,c?c.x:void 0,d?d.x:void 0),eJ(a.y,b,eL,c?c.y:void 0,d?d.y:void 0)}function eN(a){return 0===a.translate&&1===a.scale}function eO(a){return eN(a.x)&&eN(a.y)}function eP(a,b){return a.min===b.min&&a.max===b.max}function eQ(a,b){return Math.round(a.min)===Math.round(b.min)&&Math.round(a.max)===Math.round(b.max)}function eR(a,b){return eQ(a.x,b.x)&&eQ(a.y,b.y)}function eS(a){return dO(a.x)/dO(a.y)}function eT(a,b){return a.translate===b.translate&&a.scale===b.scale&&a.originPoint===b.originPoint}class eU{constructor(){this.members=[]}add(a){aV(this.members,a);for(let b=this.members.length-1;b>=0;b--){let c=this.members[b];if(c===a||c===this.lead||c===this.prevLead)continue;let d=c.instance;d&&!1===d.isConnected&&!1!==c.isPresent&&!c.snapshot&&aW(this.members,c)}a.scheduleRender()}remove(a){if(aW(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){let a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(a){let b,c=this.members.findIndex(b=>a===b);if(0===c)return!1;for(let a=c;a>=0;a--){let c=this.members[a],d=c.instance;if(!1!==c.isPresent&&(!d||!1!==d.isConnected)){b=c;break}}return!!b&&(this.promote(b),!0)}promote(a,b){let c=this.lead;if(a!==c&&(this.prevLead=c,this.lead=a,a.show(),c)){c.instance&&c.scheduleRender(),a.scheduleRender();let d=c.options.layoutDependency,e=a.options.layoutDependency;if(void 0===d||void 0===e||d!==e){let d=c.instance;!(d&&!1===d.isConnected&&!c.snapshot)&&(a.resumeFrom=c,b&&(a.resumeFrom.preserveOpacity=!0),c.snapshot&&(a.snapshot=c.snapshot,a.snapshot.latestValues=c.animationValues||c.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0))}let{crossfade:f}=a.options;!1===f&&c.hide()}}exitAnimationComplete(){this.members.forEach(a=>{let{options:b,resumingFrom:c}=a;b.onExitComplete&&b.onExitComplete(),c&&c.options.onExitComplete&&c.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let eV=(a,b)=>a.depth-b.depth;class eW{constructor(){this.children=[],this.isDirty=!1}add(a){aV(this.children,a),this.isDirty=!0}remove(a){aW(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(eV),this.isDirty=!1,this.children.forEach(a)}}let eX={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},eY=["","X","Y","Z"],eZ=0;function e$(a,b,c,d){let{latestValues:e}=b;e[a]&&(c[a]=e[a],b.setStaticValue(a,0),d&&(d[a]=0))}function e_({attachResizeListener:a,defaultParent:b,measureScroll:c,checkIsScrollRoot:d,resetTransform:e}){return class{constructor(a={},c=b?.()){this.id=eZ++,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,aD.value&&(eX.nodes=eX.calculatedTargetDeltas=eX.calculatedProjections=0),this.nodes.forEach(e2),this.nodes.forEach(e9),this.nodes.forEach(fa),this.nodes.forEach(e3),aD.addProjectionMetrics&&aD.addProjectionMetrics(eX)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new eW)}addEventListener(a,b){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new aX),this.eventHandlers.get(a).add(b)}notifyListeners(a,...b){let c=this.eventHandlers.get(a);c&&c.notify(...b)}hasListeners(a){return this.eventHandlers.has(a)}mount(b){if(this.instance)return;this.isSVG=dY(b)&&!(dY(b)&&"svg"===b.tagName),this.instance=b;let{layoutId:c,layout:d,visualElement:e}=this.options;if(e&&!e.current&&e.mount(b),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),a){let c,d=0,e=()=>this.root.updateBlockedByResize=!1;aF.read(()=>{d=window.innerWidth}),a(b,()=>{let a=window.innerWidth;a!==d&&(d=a,this.root.updateBlockedByResize=!0,c&&c(),c=function(a,b){let c=bd.now(),d=({timestamp:e})=>{let f=e-c;f>=250&&(aG(d),a(f-b))};return aF.setup(d,!0),()=>aG(d)}(e,250),es.hasAnimatedSinceResize&&(es.hasAnimatedSinceResize=!1,this.nodes.forEach(e8)))})}c&&this.root.registerSharedNode(c,this),!1!==this.options.animate&&e&&(c||d)&&this.addEventListener("didUpdate",({delta:a,hasLayoutChanged:b,hasRelativeLayoutChanged:c,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let f=this.options.transition||e.getDefaultTransition()||fg,{onLayoutAnimationStart:g,onLayoutAnimationComplete:h}=e.getProps(),i=!this.targetLayout||!eR(this.targetLayout,d),j=!b&&c;if(this.options.layoutRoot||this.resumeFrom||j||b&&(i||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let b={...cB(f,"layout"),onPlay:g,onComplete:h};(e.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(a,j)}else b||e8(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),aG(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(fb),this.animationId++)}getTransformTemplate(){let{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function a(b){if(b.hasCheckedOptimisedAppear=!0,b.root===b)return;let{visualElement:c}=b.options;if(!c)return;let d=c.props[ct];if(window.MotionHasOptimisedAnimation(d,"transform")){let{layout:a,layoutId:c}=b.options;window.MotionCancelOptimisedAnimation(d,"transform",aF,!(a||c))}let{parent:e}=b;e&&!e.hasCheckedOptimisedAppear&&a(e)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let a=0;a<this.path.length;a++){let b=this.path[a];b.shouldResetTransform=!0,b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}let{layoutId:b,layout:c}=this.options;if(void 0===b&&!c)return;let d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(e5);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(e6);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(e7),this.nodes.forEach(e0),this.nodes.forEach(e1)):this.nodes.forEach(e6),this.clearAllSnapshots();let a=bd.now();aH.delta=i(0,1e3/60,a-aH.timestamp),aH.timestamp=a,aH.isProcessing=!0,aI.update.process(aH),aI.preRender.process(aH),aI.render.process(aH),aH.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(e4),this.sharedNodes.forEach(fc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,aF.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){aF.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||dO(this.snapshot.measuredBox.x)||dO(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 a=0;a<this.path.length;a++)this.path[a].updateScroll();let a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=X(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:b}=this.options;b&&b.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let b=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(b=!1),b&&this.instance){let b=d(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:b,offset:c(this.instance),wasRoot:this.scroll?this.scroll.isRoot:b}}}resetTransform(){if(!e)return;let a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,b=this.projectionDelta&&!eO(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;a&&this.instance&&(b||bV(this.latestValues)||f)&&(e(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){var b;let c=this.measurePageBox(),d=this.removeElementScroll(c);return a&&(d=this.removeTransform(d)),fj((b=d).x),fj(b.y),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:a}=this.options;if(!a)return X();let b=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(fl))){let{scroll:a}=this.root;a&&(b$(b.x,a.offset.x),b$(b.y,a.offset.y))}return b}removeElementScroll(a){let b=X();if(eG(b,a),this.scroll?.wasRoot)return b;for(let c=0;c<this.path.length;c++){let d=this.path[c],{scroll:e,options:f}=d;d!==this.root&&e&&f.layoutScroll&&(e.wasRoot&&eG(b,a),b$(b.x,e.offset.x),b$(b.y,e.offset.y))}return b}applyTransform(a,b=!1){let c=X();eG(c,a);for(let a=0;a<this.path.length;a++){let d=this.path[a];!b&&d.options.layoutScroll&&d.scroll&&d!==d.root&&b0(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),bV(d.latestValues)&&b0(c,d.latestValues)}return bV(this.latestValues)&&b0(c,this.latestValues),c}removeTransform(a){let b=X();eG(b,a);for(let a=0;a<this.path.length;a++){let c=this.path[a];if(!c.instance||!bV(c.latestValues))continue;bU(c.latestValues)&&c.updateSnapshot();let d=X();eG(d,c.measurePageBox()),eM(b,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return bV(this.latestValues)&&eM(b,this.latestValues),b}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:void 0===a.crossfade||a.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!==aH.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){let b=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=b.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=b.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=b.isSharedProjectionDirty);let c=!!this.resumingFrom||this!==b;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:d,layoutId:e}=this.options;if(!this.layout||!(d||e))return;this.resolvedRelativeTargetAt=aH.timestamp;let f=this.getClosestProjectingParent();if(f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=X(),this.targetWithTransforms=X()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var g,h,i;this.forceRelativeParentToResolveTarget(),g=this.target,h=this.relativeTarget,i=this.relativeParent.target,dR(g.x,h.x,i.x),dR(g.y,h.y,i.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):eG(this.target,this.layout.layoutBox),bZ(this.target,this.targetDelta)):eG(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&1!==this.animationProgress?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0),aD.value&&eX.calculatedTargetDeltas++}}getClosestProjectingParent(){if(!(!this.parent||bU(this.parent.latestValues)||bW(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,b,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=X(),this.relativeTargetOrigin=X(),dT(this.relativeTargetOrigin,b,c),eG(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let a=this.getLead(),b=!!this.resumingFrom||this!==a,c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),b&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===aH.timestamp&&(c=!1),c)return;let{layout:d,layoutId:e}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||e))return;eG(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,g=this.treeScale.y;!function(a,b,c,d=!1){let e,f,g=c.length;if(g){b.x=b.y=1;for(let h=0;h<g;h++){f=(e=c[h]).projectionDelta;let{visualElement:g}=e.options;(!g||!g.props.style||"contents"!==g.props.style.display)&&(d&&e.options.layoutScroll&&e.scroll&&e!==e.root&&b0(a,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),f&&(b.x*=f.x.scale,b.y*=f.y.scale,bZ(a,f)),d&&bV(e.latestValues)&&b0(a,e.latestValues))}b.x<1.0000000000001&&b.x>.999999999999&&(b.x=1),b.y<1.0000000000001&&b.y>.999999999999&&(b.y=1)}}(this.layoutCorrected,this.treeScale,this.path,b),a.layout&&!a.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=X());let{target:h}=a;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(eH(this.prevProjectionDelta.x,this.projectionDelta.x),eH(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),dQ(this.projectionDelta,this.layoutCorrected,h,this.latestValues),this.treeScale.x===f&&this.treeScale.y===g&&eT(this.projectionDelta.x,this.prevProjectionDelta.x)&&eT(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h)),aD.value&&eX.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){let a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=V(),this.projectionDelta=V(),this.projectionDeltaWithTransform=V()}setAnimationOrigin(a,b=!1){let c,d=this.snapshot,e=d?d.latestValues:{},f={...this.latestValues},g=V();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!b;let h=X(),i=(d?d.source:void 0)!==(this.layout?this.layout.source:void 0),j=this.getStack(),k=!j||j.members.length<=1,l=!!(i&&!k&&!0===this.options.crossfade&&!this.path.some(ff));this.animationProgress=0,this.mixTargetDelta=b=>{let d=b/1e3;if(fd(g.x,a.x,d),fd(g.y,a.y,d),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var j,m,n,o,p,q;dT(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),n=this.relativeTarget,o=this.relativeTargetOrigin,p=h,q=d,fe(n.x,o.x,p.x,q),fe(n.y,o.y,p.y,q),c&&(j=this.relativeTarget,m=c,eP(j.x,m.x)&&eP(j.y,m.y))&&(this.isProjectionDirty=!1),c||(c=X()),eG(c,this.relativeTarget)}i&&(this.animationValues=f,function(a,b,c,d,e,f){e?(a.opacity=bM(0,c.opacity??1,eC(d)),a.opacityExit=bM(b.opacity??1,0,eD(d))):f&&(a.opacity=bM(b.opacity??1,c.opacity??1,d));for(let e=0;e<ey;e++){let f=`border${ex[e]}Radius`,g=eB(b,f),h=eB(c,f);(void 0!==g||void 0!==h)&&(g||(g=0),h||(h=0),0===g||0===h||eA(g)===eA(h)?(a[f]=Math.max(bM(ez(g),ez(h),d),0),(w.test(h)||w.test(g))&&(a[f]+="%")):a[f]=h)}(b.rotate||c.rotate)&&(a.rotate=bM(b.rotate||0,c.rotate||0,d))}(f,e,this.latestValues,d,l,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=d},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(aG(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=aF.update(()=>{es.hasAnimatedSinceResize=!0,a1.layout++,this.motionValue||(this.motionValue=bg(0)),this.currentAnimation=function(a,b,c){let d=Y(a)?a:bg(a);return d.start(dz("",d,b,c)),d.animation}(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:b=>{this.mixTargetDelta(b),a.onUpdate&&a.onUpdate(b)},onStop:()=>{a1.layout--},onComplete:()=>{a1.layout--,a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let a=this.getLead(),{targetWithTransforms:b,target:c,layout:d,latestValues:e}=a;if(b&&c&&d){if(this!==a&&this.layout&&d&&fk(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||X();let b=dO(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+b;let d=dO(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+d}eG(b,c),b0(b,e),dQ(this.projectionDeltaWithTransform,this.layoutCorrected,b,e)}}registerSharedNode(a,b){this.sharedNodes.has(a)||this.sharedNodes.set(a,new eU),this.sharedNodes.get(a).add(b);let c=b.options.initialPromotionConfig;b.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(b):void 0})}isLead(){let a=this.getStack();return!a||a.lead===this}getLead(){let{layoutId:a}=this.options;return a&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:b,preserveFollowOpacity:c}={}){let d=this.getStack();d&&d.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),b&&this.setOptions({transition:b})}relegate(){let a=this.getStack();return!!a&&a.relegate(this)}resetSkewAndRotation(){let{visualElement:a}=this.options;if(!a)return;let b=!1,{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(b=!0),!b)return;let d={};c.z&&e$("z",a,d,this.animationValues);for(let b=0;b<eY.length;b++)e$(`rotate${eY[b]}`,a,d,this.animationValues),e$(`skew${eY[b]}`,a,d,this.animationValues);for(let b in a.render(),d)a.setStaticValue(b,d[b]),this.animationValues&&(this.animationValues[b]=d[b]);a.scheduleRender()}applyProjectionStyles(a,b){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}let c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=ci(b?.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}let d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(a.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,a.pointerEvents=ci(b?.pointerEvents)||""),this.hasProjected&&!bV(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";let e=d.animationValues||d.latestValues;this.applyTransformsToTarget();let f=function(a,b,c){let d="",e=a.x.translate/b.x,f=a.y.translate/b.y,g=c?.z||0;if((e||f||g)&&(d=`translate3d(${e}px, ${f}px, ${g}px) `),(1!==b.x||1!==b.y)&&(d+=`scale(${1/b.x}, ${1/b.y}) `),c){let{transformPerspective:a,rotate:b,rotateX:e,rotateY:f,skewX:g,skewY:h}=c;a&&(d=`perspective(${a}px) ${d}`),b&&(d+=`rotate(${b}deg) `),e&&(d+=`rotateX(${e}deg) `),f&&(d+=`rotateY(${f}deg) `),g&&(d+=`skewX(${g}deg) `),h&&(d+=`skewY(${h}deg) `)}let h=a.x.scale*b.x,i=a.y.scale*b.y;return(1!==h||1!==i)&&(d+=`scale(${h}, ${i})`),d||"none"}(this.projectionDeltaWithTransform,this.treeScale,e);c&&(f=c(e,f)),a.transform=f;let{x:g,y:h}=this.projectionDelta;for(let b in a.transformOrigin=`${100*g.origin}% ${100*h.origin}% 0`,d.animationValues?a.opacity=d===this?e.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:e.opacityExit:a.opacity=d===this?void 0!==e.opacity?e.opacity:"":void 0!==e.opacityExit?e.opacityExit:0,bN){if(void 0===e[b])continue;let{correct:c,applyTo:g,isCSSVariable:h}=bN[b],i="none"===f?e[b]:c(e[b],d);if(g){let b=g.length;for(let c=0;c<b;c++)a[g[c]]=i}else h?this.options.visualElement.renderState.vars[b]=i:a[b]=i}this.options.layoutId&&(a.pointerEvents=d===this?ci(b?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(e5),this.root.sharedNodes.clear()}}}function e0(a){a.updateLayout()}function e1(a){let b=a.resumeFrom?.snapshot||a.snapshot;if(a.isLead()&&a.layout&&b&&a.hasListeners("didUpdate")){let{layoutBox:c,measuredBox:d}=a.layout,{animationType:e}=a.options,f=b.source!==a.layout.source;"size"===e?dN(a=>{let d=f?b.measuredBox[a]:b.layoutBox[a],e=dO(d);d.min=c[a].min,d.max=d.min+e}):fk(e,b.layoutBox,c)&&dN(d=>{let e=f?b.measuredBox[d]:b.layoutBox[d],g=dO(c[d]);e.max=e.min+g,a.relativeTarget&&!a.currentAnimation&&(a.isProjectionDirty=!0,a.relativeTarget[d].max=a.relativeTarget[d].min+g)});let g=V();dQ(g,c,b.layoutBox);let h=V();f?dQ(h,a.applyTransform(d,!0),b.measuredBox):dQ(h,c,b.layoutBox);let i=!eO(g),j=!1;if(!a.resumeFrom){let d=a.getClosestProjectingParent();if(d&&!d.resumeFrom){let{snapshot:e,layout:f}=d;if(e&&f){let g=X();dT(g,b.layoutBox,e.layoutBox);let h=X();dT(h,c,f.layoutBox),eR(g,h)||(j=!0),d.options.layoutRoot&&(a.relativeTarget=h,a.relativeTargetOrigin=g,a.relativeParent=d)}}}a.notifyListeners("didUpdate",{layout:c,snapshot:b,delta:h,layoutDelta:g,hasLayoutChanged:i,hasRelativeLayoutChanged:j})}else if(a.isLead()){let{onExitComplete:b}=a.options;b&&b()}a.options.transition=void 0}function e2(a){aD.value&&eX.nodes++,a.parent&&(a.isProjecting()||(a.isProjectionDirty=a.parent.isProjectionDirty),a.isSharedProjectionDirty||(a.isSharedProjectionDirty=!!(a.isProjectionDirty||a.parent.isProjectionDirty||a.parent.isSharedProjectionDirty)),a.isTransformDirty||(a.isTransformDirty=a.parent.isTransformDirty))}function e3(a){a.isProjectionDirty=a.isSharedProjectionDirty=a.isTransformDirty=!1}function e4(a){a.clearSnapshot()}function e5(a){a.clearMeasurements()}function e6(a){a.isLayoutDirty=!1}function e7(a){let{visualElement:b}=a.options;b&&b.getProps().onBeforeLayoutMeasure&&b.notify("BeforeLayoutMeasure"),a.resetTransform()}function e8(a){a.finishAnimation(),a.targetDelta=a.relativeTarget=a.target=void 0,a.isProjectionDirty=!0}function e9(a){a.resolveTargetDelta()}function fa(a){a.calcProjection()}function fb(a){a.resetSkewAndRotation()}function fc(a){a.removeLeadSnapshot()}function fd(a,b,c){a.translate=bM(b.translate,0,c),a.scale=bM(b.scale,1,c),a.origin=b.origin,a.originPoint=b.originPoint}function fe(a,b,c,d){a.min=bM(b.min,c.min,d),a.max=bM(b.max,c.max,d)}function ff(a){return a.animationValues&&void 0!==a.animationValues.opacityExit}let fg={duration:.45,ease:[.4,0,.1,1]},fh=a=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(a),fi=fh("applewebkit/")&&!fh("chrome/")?Math.round:aA;function fj(a){a.min=fi(a.min),a.max=fi(a.max)}function fk(a,b,c){return"position"===a||"preserve-aspect"===a&&!(.2>=Math.abs(eS(b)-eS(c)))}function fl(a){return a!==a.root&&a.scroll?.wasRoot}let fm=e_({attachResizeListener:(a,b)=>dW(a,"resize",b),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),fn={current:void 0},fo=e_({measureScroll:a=>({x:a.scrollLeft,y:a.scrollTop}),defaultParent:()=>{if(!fn.current){let a=new fm({});a.mount(window),a.setOptions({layoutScroll:!0}),fn.current=a}return fn.current},resetTransform:(a,b)=>{a.style.transform=void 0!==b?b:"none"},checkIsScrollRoot:a=>"fixed"===window.getComputedStyle(a).position});function fp(a,b){let c=dZ(a),d=new AbortController;return[c,{passive:!0,...b,signal:d.signal},()=>d.abort()]}function fq(a,b,c){let{props:d}=a;a.animationState&&d.whileHover&&a.animationState.setActive("whileHover","Start"===c);let e=d["onHover"+c];e&&aF.postRender(()=>e(b,d7(b)))}class fr extends cy{mount(){let{current:a}=this.node;a&&(this.unmount=function(a,b,c={}){let[d,e,f]=fp(a,c);return d.forEach(a=>{let c,d=!1,f=!1,g=b=>{c&&(c(b),c=void 0),a.removeEventListener("pointerleave",i)},h=a=>{d=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),f&&(f=!1,g(a))},i=a=>{if("touch"!==a.pointerType){if(d){f=!0;return}g(a)}};a.addEventListener("pointerenter",d=>{if("touch"===d.pointerType||dM.x||dM.y)return;f=!1;let g=b(a,d);"function"==typeof g&&(c=g,a.addEventListener("pointerleave",i,e))},e),a.addEventListener("pointerdown",()=>{d=!0,window.addEventListener("pointerup",h,e),window.addEventListener("pointercancel",h,e)},e)}),f}(a,(a,b)=>(fq(this.node,b,"Start"),a=>fq(this.node,a,"End"))))}unmount(){}}class fs extends cy{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch(b){a=!0}a&&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=cF(dW(this.node.current,"focus",()=>this.onFocus()),dW(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}var ft=c(109364);let fu=(a,b)=>!!b&&(a===b||fu(a,b.parentElement)),fv=new WeakSet;function fw(a){return b=>{"Enter"===b.key&&a(b)}}function fx(a,b){a.dispatchEvent(new PointerEvent("pointer"+b,{isPrimary:!0,bubbles:!0}))}function fy(a){return d6(a)&&!(dM.x||dM.y)}let fz=new WeakSet;function fA(a,b,c){let{props:d}=a;if(a.current instanceof HTMLButtonElement&&a.current.disabled)return;a.animationState&&d.whileTap&&a.animationState.setActive("whileTap","Start"===c);let e=d["onTap"+("End"===c?"":c)];e&&aF.postRender(()=>e(b,d7(b)))}class fB extends cy{mount(){let{current:a}=this.node;if(!a)return;let{globalTapTarget:b,propagate:c}=this.node.props;this.unmount=function(a,b,c={}){let[d,e,f]=fp(a,c),g=a=>{let d=a.currentTarget;if(!fy(a)||fz.has(a))return;fv.add(d),c.stopPropagation&&fz.add(a);let f=b(d,a),g=(a,b)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",i),fv.has(d)&&fv.delete(d),fy(a)&&"function"==typeof f&&f(a,{success:b})},h=a=>{g(a,d===window||d===document||c.useGlobalTarget||fu(d,a.target))},i=a=>{g(a,!1)};window.addEventListener("pointerup",h,e),window.addEventListener("pointercancel",i,e)};return d.forEach(a=>{((c.useGlobalTarget?window:a).addEventListener("pointerdown",g,e),(0,ft.s)(a))&&(a.addEventListener("focus",a=>((a,b)=>{let c=a.currentTarget;if(!c)return;let d=fw(()=>{if(fv.has(c))return;fx(c,"down");let a=fw(()=>{fx(c,"up")});c.addEventListener("keyup",a,b),c.addEventListener("blur",()=>fx(c,"cancel"),b)});c.addEventListener("keydown",d,b),c.addEventListener("blur",()=>c.removeEventListener("keydown",d),b)})(a,e)),dU.has(a.tagName)||!0===a.isContentEditable||a.hasAttribute("tabindex")||(a.tabIndex=0))}),f}(a,(a,b)=>(fA(this.node,b,"Start"),(a,{success:b})=>fA(this.node,a,b?"End":"Cancel")),{useGlobalTarget:b,stopPropagation:c?.tap===!1})}unmount(){}}let fC=new WeakMap,fD=new WeakMap,fE=a=>{let b=fC.get(a.target);b&&b(a)},fF=a=>{a.forEach(fE)},fG={some:0,all:1};class fH extends cy{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:a={}}=this.node.getProps(),{root:b,margin:c,amount:d="some",once:e}=a,f={root:b?b.current:void 0,rootMargin:c,threshold:"number"==typeof d?d:fG[d]},g=a=>{let{isIntersecting:b}=a;if(this.isInView===b||(this.isInView=b,e&&!b&&this.hasEnteredView))return;b&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",b);let{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=b?c:d;f&&f(a)};var h=this.node.current;let i=function({root:a,...b}){let c=a||document;fD.has(c)||fD.set(c,{});let d=fD.get(c),e=JSON.stringify(b);return d[e]||(d[e]=new IntersectionObserver(fF,{root:a,...b})),d[e]}(f);return fC.set(h,g),i.observe(h),()=>{fC.delete(h),i.unobserve(h)}}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:a,prevProps:b}=this.node;["amount","margin","root"].some(function({viewport:a={}},{viewport:b={}}={}){return c=>a[c]!==b[c]}(a,b))&&this.startObserver()}unmount(){}}let fI=function(a,b){if("undefined"==typeof Proxy)return cx;let c=new Map,d=(c,d)=>cx(c,d,a,b);return new Proxy((a,b)=>d(a,b),{get:(e,f)=>"create"===f?d:(c.has(f)||c.set(f,cx(f,void 0,a,b)),c.get(f))})}({animation:{Feature:dJ},exit:{Feature:dL},inView:{Feature:fH},tap:{Feature:fB},focus:{Feature:fs},hover:{Feature:fr},pan:{Feature:er},drag:{Feature:ep,ProjectionNode:fo,MeasureLayout:ew},layout:{ProjectionNode:fo,MeasureLayout:ew}},(a,b)=>b.isSVG??b5(a)?new bR(b):new b2(b,{allowProjection:a!==b3.Fragment}))},554910:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(783037),e=c(747451);b.isArrayLikeObject=function(a){return e.isObjectLike(a)&&d.isArrayLike(a)}},554989:(a,b,c)=>{"use strict";c.d(b,{$7J:()=>p,$lo:()=>s,AHR:()=>C,CZR:()=>v,D6W:()=>j,J2O:()=>H,N3N:()=>h,Nxe:()=>E,SrF:()=>A,UKz:()=>y,X_y:()=>m,_eB:()=>x,awM:()=>q,ezH:()=>t,gkj:()=>e,i4$:()=>o,iU0:()=>r,jHc:()=>k,kDV:()=>i,lNO:()=>B,lic:()=>G,mM8:()=>u,nP5:()=>z,phd:()=>F,pz8:()=>n,unz:()=>w,vzR:()=>g,wsd:()=>l,x5_:()=>f,z3D:()=>D});var d=c(75567);function e(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5.033 14.649H.743a.74.74 0 0 1-.686-.458.74.74 0 0 1 .16-.808L3.19 10.41H1.06A1.06 1.06 0 0 1 0 9.35h3.957c.301 0 .57.18.686.458a.74.74 0 0 1-.161.808L1.51 13.59h2.464c.585 0 1.06.475 1.06 1.06zM24 11.338c0-1.14-.927-2.066-2.066-2.066-.61 0-1.158.265-1.537.686a2.061 2.061 0 0 0-1.536-.686c-1.14 0-2.066.926-2.066 2.066v3.311a1.06 1.06 0 0 0 1.06-1.06v-2.251a1.004 1.004 0 0 1 2.013 0v2.251c0 .586.474 1.06 1.06 1.06v-3.311a1.004 1.004 0 0 1 2.012 0v2.251c0 .586.475 1.06 1.06 1.06zM16.265 12a2.728 2.728 0 1 1-5.457 0 2.728 2.728 0 0 1 5.457 0zm-1.06 0a1.669 1.669 0 1 0-3.338 0 1.669 1.669 0 0 0 3.338 0zm-4.82 0a2.728 2.728 0 1 1-5.458 0 2.728 2.728 0 0 1 5.457 0zm-1.06 0a1.669 1.669 0 1 0-3.338 0 1.669 1.669 0 0 0 3.338 0z"},child:[]}]})(a)}function f(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.914 2.904V16.29L24 2.905H12.914zM0 2.906C0 5.966 2.483 8.45 5.543 8.45s5.542-2.484 5.543-5.544H0zm11.086 4.807L0 21.096h11.086V7.713zm7.37 7.84c-3.063 0-5.542 2.48-5.542 5.543H24c0-3.06-2.48-5.543-5.543-5.543z"},child:[]}]})(a)}function g(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},child:[]}]})(a)}function h(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21.147 0H2.853A2.86 2.86 0 000 2.853v18.294A2.86 2.86 0 002.853 24h18.294A2.86 2.86 0 0024 21.147V2.853A2.86 2.86 0 0021.147 0zM10.34 17.287a.953.953 0 01-.953.953h-4a.954.954 0 01-.954-.953V5.38a.953.953 0 01.954-.953h4a.954.954 0 01.953.953zm9.233-5.467a.944.944 0 01-.953.947h-4a.947.947 0 01-.953-.947V5.38a.953.953 0 01.953-.953h4a.954.954 0 01.953.953z"},child:[]}]})(a)}function i(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},child:[]}]})(a)}function j(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},child:[]}]})(a)}function k(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z"},child:[]}]})(a)}function l(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10.006 5.415a4.195 4.195 0 013.045-1.306c1.56 0 2.954.9 3.69 2.205.63-.3 1.35-.45 2.1-.45 2.85 0 5.159 2.34 5.159 5.22s-2.31 5.22-5.176 5.22c-.345 0-.69-.044-1.02-.104a3.75 3.75 0 01-3.3 1.95c-.6 0-1.155-.15-1.65-.375A4.314 4.314 0 018.88 20.4a4.302 4.302 0 01-4.05-2.82c-.27.062-.54.076-.825.076-2.204 0-4.005-1.8-4.005-4.05 0-1.5.811-2.805 2.01-3.51-.255-.57-.39-1.2-.39-1.846 0-2.58 2.1-4.65 4.65-4.65 1.53 0 2.85.705 3.72 1.8"},child:[]}]})(a)}function m(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M22.3977 7.0896h-2.3106V.0676l-7.5094 6.3542V.1577h-1.1554v6.1966L4.4904 0v7.0896H1.6023v10.3976h2.8882V24l6.932-6.3591v6.2005h1.1554v-6.0469l6.9318 6.1807v-6.4879h2.8882V7.0896zm-3.4657-4.531v4.531h-5.355l5.355-4.531zm-13.2862.0676 4.8691 4.4634H5.6458V2.6262zM2.7576 16.332V8.245h7.8476l-6.1149 6.1147v1.9723H2.7576zm2.8882 5.0404v-3.8852h.0001v-2.6488l5.7763-5.7764v7.0111l-5.7764 5.2993zm12.7086.0248-5.7766-5.1509V9.0618l5.7766 5.7766v6.5588zm2.8882-5.0652h-1.733v-1.9723L13.3948 8.245h7.8478v8.087z"},child:[]}]})(a)}function n(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"},child:[]}]})(a)}function o(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},child:[]}]})(a)}function p(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17.143 3.429v3.428h-3.429v3.429h-3.428V6.857H6.857V3.43H3.43v13.714H0v3.428h10.286v-3.428H6.857v-3.429h3.429v3.429h3.429v-3.429h3.428v3.429h-3.428v3.428H24v-3.428h-3.43V3.429z"},child:[]}]})(a)}function q(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.915 4.03c-1.968 0-3.683 1.28-4.871 3.113C.704 9.208 0 11.883 0 14.449c0 .706.07 1.369.21 1.973a6.624 6.624 0 0 0 .265.86 5.297 5.297 0 0 0 .371.761c.696 1.159 1.818 1.927 3.593 1.927 1.497 0 2.633-.671 3.965-2.444.76-1.012 1.144-1.626 2.663-4.32l.756-1.339.186-.325c.061.1.121.196.183.3l2.152 3.595c.724 1.21 1.665 2.556 2.47 3.314 1.046.987 1.992 1.22 3.06 1.22 1.075 0 1.876-.355 2.455-.843a3.743 3.743 0 0 0 .81-.973c.542-.939.861-2.127.861-3.745 0-2.72-.681-5.357-2.084-7.45-1.282-1.912-2.957-2.93-4.716-2.93-1.047 0-2.088.467-3.053 1.308-.652.57-1.257 1.29-1.82 2.05-.69-.875-1.335-1.547-1.958-2.056-1.182-.966-2.315-1.303-3.454-1.303zm10.16 2.053c1.147 0 2.188.758 2.992 1.999 1.132 1.748 1.647 4.195 1.647 6.4 0 1.548-.368 2.9-1.839 2.9-.58 0-1.027-.23-1.664-1.004-.496-.601-1.343-1.878-2.832-4.358l-.617-1.028a44.908 44.908 0 0 0-1.255-1.98c.07-.109.141-.224.211-.327 1.12-1.667 2.118-2.602 3.358-2.602zm-10.201.553c1.265 0 2.058.791 2.675 1.446.307.327.737.871 1.234 1.579l-1.02 1.566c-.757 1.163-1.882 3.017-2.837 4.338-1.191 1.649-1.81 1.817-2.486 1.817-.524 0-1.038-.237-1.383-.794-.263-.426-.464-1.13-.464-2.046 0-2.221.63-4.535 1.66-6.088.454-.687.964-1.226 1.533-1.533a2.264 2.264 0 0 1 1.088-.285z"},child:[]}]})(a)}function r(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"},child:[]}]})(a)}function s(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"},child:[]}]})(a)}function t(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z"},child:[]}]})(a)}function u(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z"},child:[]}]})(a)}function v(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.318 12.545H7.91v-1.909h3.41v1.91zM14.728 0v6h6l-6-6zm1.363 10.636h-3.41v1.91h3.41v-1.91zm0 3.273h-3.41v1.91h3.41v-1.91zM20.727 6.5v15.864c0 .904-.732 1.636-1.636 1.636H4.909a1.636 1.636 0 0 1-1.636-1.636V1.636C3.273.732 4.005 0 4.909 0h9.318v6.5h6.5zm-3.273 2.773H6.545v7.909h10.91v-7.91zm-6.136 4.636H7.91v1.91h3.41v-1.91z"},child:[]}]})(a)}function w(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.01 1.485c-2.082 0-3.754.02-3.743.047.01.02 1.708 3.001 3.774 6.62l3.76 6.574h3.76c2.081 0 3.753-.02 3.742-.047-.005-.02-1.708-3.001-3.775-6.62l-3.76-6.574zm-4.76 1.73a789.828 789.861 0 0 0-3.63 6.319L0 15.868l1.89 3.298 1.885 3.297 3.62-6.335 3.618-6.33-1.88-3.287C8.1 4.704 7.255 3.22 7.25 3.214zm2.259 12.653-.203.348c-.114.198-.96 1.672-1.88 3.287a423.93 423.948 0 0 1-1.698 2.97c-.01.026 3.24.042 7.222.042h7.244l1.796-3.157c.992-1.734 1.85-3.23 1.906-3.323l.104-.167h-7.249z"},child:[]}]})(a)}function x(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.316 5.684H24v12.632h-5.684V5.684zM5.684 24h12.632v-5.684H5.684V24zM18.316 5.684V0H1.895A1.894 1.894 0 0 0 0 1.895v16.421h5.684V5.684h12.632zm-7.207 6.25v-.065c.272-.144.5-.349.687-.617s.279-.595.279-.982c0-.379-.099-.72-.3-1.025a2.05 2.05 0 0 0-.832-.714 2.703 2.703 0 0 0-1.197-.257c-.6 0-1.094.156-1.481.467-.386.311-.65.671-.793 1.078l1.085.452c.086-.249.224-.461.413-.633.189-.172.445-.257.767-.257.33 0 .602.088.816.264a.86.86 0 0 1 .322.703c0 .33-.12.589-.36.778-.24.19-.535.284-.886.284h-.567v1.085h.633c.407 0 .748.109 1.02.327.272.218.407.499.407.843 0 .336-.129.614-.387.832s-.565.327-.924.327c-.351 0-.651-.103-.897-.311-.248-.208-.422-.502-.521-.881l-1.096.452c.178.616.505 1.082.977 1.401.472.319.984.478 1.538.477a2.84 2.84 0 0 0 1.293-.291c.382-.193.684-.458.902-.794.218-.336.327-.72.327-1.149 0-.429-.115-.797-.344-1.105a2.067 2.067 0 0 0-.881-.689zm2.093-1.931l.602.913L15 10.045v5.744h1.187V8.446h-.827l-2.158 1.557zM22.105 0h-3.289v5.184H24V1.895A1.894 1.894 0 0 0 22.105 0zm-3.289 23.5l4.684-4.684h-4.684V23.5zM0 22.105C0 23.152.848 24 1.895 24h3.289v-5.184H0v3.289z"},child:[]}]})(a)}function y(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"},child:[]}]})(a)}function z(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-2.023 2.309-3.178 3.927-1.964L5.455 4.64 12 9.548l6.545-4.91 1.528-1.145C21.69 2.28 24 3.434 24 5.457z"},child:[]}]})(a)}function A(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},child:[]}]})(a)}function B(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},child:[]}]})(a)}function C(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.6035 0v24h4.9317V0zm9.8613 0v24h4.9317V0z"},child:[]}]})(a)}function D(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"},child:[]}]})(a)}function E(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},child:[]}]})(a)}function F(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"},child:[]}]})(a)}function G(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.78 12.653c-2.882 0-5.22 2.336-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.34 5.22-5.22-2.336-5.22-5.22-5.22zm-13.56 0c-2.88 0-5.22 2.337-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.338 5.22-5.22-2.336-5.22-5.22-5.22zm12-6.525c0 2.883-2.337 5.22-5.22 5.22-2.882 0-5.22-2.337-5.22-5.22 0-2.88 2.338-5.22 5.22-5.22 2.883 0 5.22 2.34 5.22 5.22z"},child:[]}]})(a)}function H(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z"},child:[]}]})(a)}},559282:(a,b,c)=>{"use strict";c.d(b,{Dk:()=>M,$b:()=>J,Lf:()=>K,s8:()=>L});var d=c(736927),e=c(327648),f=c(32876),g=c(327770),h=c(422703),i=c(585004),j=c(250367),k=c(565254),l=c(418398),m=c(197143),n=c(685343),o=c(565744),p=c(673977),q=c(461821),r=c(720511),s=r.YY.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:a=>{let b=a.style.textAlign;return this.options.alignments.includes(b)?b:this.options.defaultAlignment},renderHTML:a=>a.textAlign?{style:`text-align: ${a.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:a=>({commands:b})=>!!this.options.alignments.includes(a)&&this.options.types.map(c=>b.updateAttributes(c,{textAlign:a})).some(a=>a),unsetTextAlign:()=>({commands:a})=>this.options.types.map(b=>a.resetAttributes(b,"textAlign")).some(a=>a),toggleTextAlign:a=>({editor:b,commands:c})=>!!this.options.alignments.includes(a)&&(b.isActive({textAlign:a})?c.unsetTextAlign():c.setTextAlign(a))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),t=(a,b=0)=>{let c=[];return!a.children.length||b>20||Array.from(a.children).forEach(a=>{"SPAN"===a.tagName?c.push(a):a.children.length&&c.push(...t(a,b+1))}),c},u=r.CU.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:a=>!!a.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(a=>{if(!a.children.length)return;let b=t(a);b&&b.forEach(a=>{var b,c;let d=a.getAttribute("style"),e=null==(c=null==(b=a.parentElement)?void 0:b.closest("span"))?void 0:c.getAttribute("style");a.setAttribute("style",`${e};${d}`)})})(a),{})}]},renderHTML({HTMLAttributes:a}){return["span",(0,r.KV)(this.options.HTMLAttributes,a),0]},addCommands(){return{toggleTextStyle:a=>({commands:b})=>b.toggleMark(this.name,a),removeEmptyTextStyle:()=>({tr:a})=>{let{selection:b}=a;return a.doc.nodesBetween(b.from,b.to,(b,c)=>{if(b.isTextblock)return!0;b.marks.filter(a=>a.type===this.type).some(a=>Object.values(a.attrs).some(a=>!!a))||a.removeMark(c,c+b.nodeSize,this.type)}),!0}}}}),v=r.YY.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:a=>{var b;let c=a.getAttribute("style");if(c){let a=c.split(";").map(a=>a.trim()).filter(Boolean);for(let b=a.length-1;b>=0;b-=1){let c=a[b].split(":");if(c.length>=2){let a=c[0].trim().toLowerCase(),b=c.slice(1).join(":").trim();if("background-color"===a)return b.replace(/['"]+/g,"")}}}return null==(b=a.style.backgroundColor)?void 0:b.replace(/['"]+/g,"")},renderHTML:a=>a.backgroundColor?{style:`background-color: ${a.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:a=>({chain:b})=>b().setMark("textStyle",{backgroundColor:a}).run(),unsetBackgroundColor:()=>({chain:a})=>a().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),w=r.YY.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:a=>{var b;let c=a.getAttribute("style");if(c){let a=c.split(";").map(a=>a.trim()).filter(Boolean);for(let b=a.length-1;b>=0;b-=1){let c=a[b].split(":");if(c.length>=2){let a=c[0].trim().toLowerCase(),b=c.slice(1).join(":").trim();if("color"===a)return b.replace(/['"]+/g,"")}}}return null==(b=a.style.color)?void 0:b.replace(/['"]+/g,"")},renderHTML:a=>a.color?{style:`color: ${a.color}`}:{}}}}]},addCommands:()=>({setColor:a=>({chain:b})=>b().setMark("textStyle",{color:a}).run(),unsetColor:()=>({chain:a})=>a().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),x=r.YY.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:a=>a.style.fontFamily,renderHTML:a=>a.fontFamily?{style:`font-family: ${a.fontFamily}`}:{}}}}]},addCommands:()=>({setFontFamily:a=>({chain:b})=>b().setMark("textStyle",{fontFamily:a}).run(),unsetFontFamily:()=>({chain:a})=>a().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),y=r.YY.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:a=>a.style.fontSize,renderHTML:a=>a.fontSize?{style:`font-size: ${a.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:a=>({chain:b})=>b().setMark("textStyle",{fontSize:a}).run(),unsetFontSize:()=>({chain:a})=>a().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),z=r.YY.create({name:"lineHeight",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:a=>a.style.lineHeight,renderHTML:a=>a.lineHeight?{style:`line-height: ${a.lineHeight}`}:{}}}}]},addCommands:()=>({setLineHeight:a=>({chain:b})=>b().setMark("textStyle",{lineHeight:a}).run(),unsetLineHeight:()=>({chain:a})=>a().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})});r.YY.create({name:"textStyleKit",addExtensions(){let a=[];return!1!==this.options.backgroundColor&&a.push(v.configure(this.options.backgroundColor)),!1!==this.options.color&&a.push(w.configure(this.options.color)),!1!==this.options.fontFamily&&a.push(x.configure(this.options.fontFamily)),!1!==this.options.fontSize&&a.push(y.configure(this.options.fontSize)),!1!==this.options.lineHeight&&a.push(z.configure(this.options.lineHeight)),!1!==this.options.textStyle&&a.push(u.configure(this.options.textStyle)),a}});var A=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,B=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,C=r.CU.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:a=>a.getAttribute("data-color")||a.style.backgroundColor,renderHTML:a=>a.color?{"data-color":a.color,style:`background-color: ${a.color}; color: inherit`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:a}){return["mark",(0,r.KV)(this.options.HTMLAttributes,a),0]},renderMarkdown:(a,b)=>`==${b.renderChildren(a)}==`,parseMarkdown:(a,b)=>b.applyMark("highlight",b.parseInline(a.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:a=>a.indexOf("=="),tokenize(a,b,c){let d=/^(==)([^=]+)(==)/.exec(a);if(d){let a=d[2].trim(),b=c.inlineTokens(a);return{type:"highlight",raw:d[0],text:a,tokens:b}}}},addCommands(){return{setHighlight:a=>({commands:b})=>b.setMark(this.name,a),toggleHighlight:a=>({commands:b})=>b.toggleMark(this.name,a),unsetHighlight:()=>({commands:a})=>a.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[(0,r.OX)({find:A,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:B,type:this.type})]}}),D=r.CU.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:a=>"super"===a&&null}],renderHTML({HTMLAttributes:a}){return["sup",(0,r.KV)(this.options.HTMLAttributes,a),0]},addCommands(){return{setSuperscript:()=>({commands:a})=>a.setMark(this.name),toggleSuperscript:()=>({commands:a})=>a.toggleMark(this.name),unsetSuperscript:()=>({commands:a})=>a.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),E=r.CU.create({name:"subscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sub"},{style:"vertical-align",getAttrs:a=>"sub"===a&&null}],renderHTML({HTMLAttributes:a}){return["sub",(0,r.KV)(this.options.HTMLAttributes,a),0]},addCommands(){return{setSubscript:()=>({commands:a})=>a.setMark(this.name),toggleSubscript:()=>({commands:a})=>a.toggleMark(this.name),unsetSubscript:()=>({commands:a})=>a.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),F=c(356103).n4,G=c(115962),H=c(29119),I=c(119590);function J(a){let b=a.split(".").pop()?.toLowerCase()??"";return"docx"===b||"doc"===b}function K(a){return a.split(".").pop()?.toLowerCase()==="txt"}function L(a){return a.trim()?a.split("\n").map(a=>`<p>${a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")||"<br>"}</p>`).join(""):"<p></p>"}function M({mode:a,initialHtml:b,filePath:r,onSave:t,onDirty:v,compact:x}){let[y,z]=(0,G.useState)(!1),[A,B]=(0,G.useState)("idle"),[J,K]=(0,G.useState)(!1),L=(0,G.useRef)(null),M=(0,G.useRef)(null),O=r.split("/").pop()??r,P="txt"===a,Q=(0,e.hG)({extensions:[g.A.configure({codeBlock:{HTMLAttributes:{class:"code-block"}}}),q.A,D,E,u,w,C.configure({multicolor:!0}),s.configure({types:["heading","paragraph"]}),h.Ay.configure({inline:!1,allowBase64:!0,HTMLAttributes:{class:"editor-image"}}),i.Ay.configure({openOnClick:!1,autolink:!0,HTMLAttributes:{class:"editor-link",rel:"noopener"}}),j.XI.configure({resizable:!1}),k.A,l.A,m.h,n.A,o.A.configure({nested:!0}),p.A.configure({placeholder:P?"Start typing...":"Start writing your document..."}),F],content:b,immediatelyRender:!1,onUpdate:()=>{K(!0),B("idle"),v?.()}}),R=(0,G.useCallback)(async a=>{let b=new FormData;b.append("file",a);try{let a=await fetch("/api/workspace/upload",{method:"POST",body:b});if(!a.ok)return null;let c=await a.json();return`/api/workspace/assets/${c.path.replace(/^assets\//,"")}`}catch{return null}},[]),U=(0,G.useCallback)(async a=>{if(Q)for(let b of a){let a=await R(b);a&&Q.chain().focus().setImage({src:a,alt:b.name}).run()}},[Q,R]),V=(0,G.useCallback)(async()=>{if(Q&&!y){z(!0),B("idle");try{if(P){let a=Q.getText();if(!(await fetch((0,H.nC)(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:r,content:a})})).ok)throw Error("Save failed")}else{let a=Q.getHTML(),{default:b}=await Promise.all([c.e(22477),c.e(68693)]).then(c.bind(c,168693)),d=await b(a,void 0,{table:{row:{cantSplit:!0}},footer:!0,pageNumber:!0}),e=new FormData;if(e.append("file",d),e.append("path",r),!(await fetch("/api/workspace/write-binary",{method:"POST",body:e})).ok)throw Error("Save failed")}B("saved"),K(!1),t?.(),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>B("idle"),2e3)}catch{B("error")}finally{z(!1)}}},[Q,r,y,P,t]);if(!Q)return(0,d.jsxs)("div",{className:"animate-pulse space-y-3 py-4 px-6",children:[(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"80%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"60%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"70%"}})]});let W=Q.storage.characterCount?.words()??0,X=Q.storage.characterCount?.characters()??0;return(0,d.jsxs)("div",{className:`rich-doc-editor ${x?"rich-doc-editor--compact":""}`,children:[(0,d.jsxs)("div",{className:"rich-doc-topbar",children:[(0,d.jsxs)("div",{className:"rich-doc-topbar-left",children:[(0,d.jsx)(aj,{mode:a}),(0,d.jsx)("span",{className:"rich-doc-filename",children:O}),J&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-unsaved",children:"Unsaved changes"}),"saved"===A&&!J&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-saved",children:"Saved"}),"error"===A&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-error",children:"Save failed"})]}),(0,d.jsxs)("div",{className:"rich-doc-topbar-right",children:[(0,d.jsxs)("span",{className:"editor-save-hint",children:["undefined"!=typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","+S"]}),(0,d.jsx)("button",{type:"button",onClick:()=>void V(),disabled:y||!J,className:"editor-save-button",children:y?"Saving...":"Save"})]})]}),!P&&(0,d.jsx)(N,{editor:Q,onUploadImages:U,imageInputRef:M}),P&&!x&&(0,d.jsxs)("div",{className:"editor-toolbar rich-doc-toolbar-minimal",children:[(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:!1,onClick:()=>Q.chain().focus().undo().run(),title:"Undo",disabled:!Q.can().undo(),children:(0,d.jsx)(S,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>Q.chain().focus().redo().run(),title:"Redo",disabled:!Q.can().redo(),children:(0,d.jsx)(T,{})})]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("span",{className:"rich-doc-txt-hint",children:"Plain text — formatting not preserved on save"})]}),!P&&(0,d.jsx)(f.m,{editor:Q,children:(0,d.jsxs)("div",{className:"bubble-menu",children:[(0,d.jsx)(I.zM,{active:Q.isActive("bold"),onClick:()=>Q.chain().focus().toggleBold().run(),title:"Bold",children:(0,d.jsx)("strong",{children:"B"})}),(0,d.jsx)(I.zM,{active:Q.isActive("italic"),onClick:()=>Q.chain().focus().toggleItalic().run(),title:"Italic",children:(0,d.jsx)("em",{children:"I"})}),(0,d.jsx)(I.zM,{active:Q.isActive("underline"),onClick:()=>Q.chain().focus().toggleUnderline().run(),title:"Underline",children:(0,d.jsx)("span",{style:{textDecoration:"underline"},children:"U"})}),(0,d.jsx)(I.zM,{active:Q.isActive("strike"),onClick:()=>Q.chain().focus().toggleStrike().run(),title:"Strikethrough",children:(0,d.jsx)("s",{children:"S"})}),(0,d.jsx)(I.zM,{active:Q.isActive("code"),onClick:()=>Q.chain().focus().toggleCode().run(),title:"Inline code",children:"<>"}),(0,d.jsx)(I.zM,{active:Q.isActive("link"),onClick:()=>{if(Q.isActive("link"))Q.chain().focus().unsetLink().run();else{let a=window.prompt("URL:");a&&Q.chain().focus().setLink({href:a}).run()}},title:"Link",children:(0,d.jsx)(ad,{size:14})})]})}),(0,d.jsx)("div",{className:"rich-doc-scroll",children:(0,d.jsx)("div",{className:`rich-doc-page ${P?"rich-doc-page--txt":""}`,children:(0,d.jsx)(e.$Z,{editor:Q})})}),!x&&(0,d.jsxs)("div",{className:"rich-doc-statusbar",children:[(0,d.jsxs)("span",{children:[W.toLocaleString()," word",1!==W?"s":""]}),(0,d.jsx)("span",{className:"rich-doc-statusbar-sep"}),(0,d.jsxs)("span",{children:[X.toLocaleString()," character",1!==X?"s":""]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("span",{className:"rich-doc-statusbar-mode",children:"docx"===a?"DOCX":"TXT"})]}),(0,d.jsx)("input",{ref:M,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:a=>{let b=Array.from(a.target.files??[]);b.length>0&&U(b),a.target.value=""}})]})}function N({editor:a,onUploadImages:b,imageInputRef:c}){let[e,f]=(0,G.useState)(!1),[g,h]=(0,G.useState)(!1),i=(0,G.useRef)(null),j=(0,G.useRef)(null);return(0,d.jsxs)("div",{className:"editor-toolbar rich-doc-toolbar",children:[(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:!1,onClick:()=>a.chain().focus().undo().run(),title:"Undo",disabled:!a.can().undo(),children:(0,d.jsx)(S,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>a.chain().focus().redo().run(),title:"Redo",disabled:!a.can().redo(),children:(0,d.jsx)(T,{})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsx)(I.$Q,{children:(0,d.jsx)(P,{editor:a})}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive("bold"),onClick:()=>a.chain().focus().toggleBold().run(),title:"Bold (Cmd+B)",children:(0,d.jsx)("strong",{children:"B"})}),(0,d.jsx)(I.IB,{active:a.isActive("italic"),onClick:()=>a.chain().focus().toggleItalic().run(),title:"Italic (Cmd+I)",children:(0,d.jsx)("em",{children:"I"})}),(0,d.jsx)(I.IB,{active:a.isActive("underline"),onClick:()=>a.chain().focus().toggleUnderline().run(),title:"Underline (Cmd+U)",children:(0,d.jsx)("span",{style:{textDecoration:"underline"},children:"U"})}),(0,d.jsx)(I.IB,{active:a.isActive("strike"),onClick:()=>a.chain().focus().toggleStrike().run(),title:"Strikethrough",children:(0,d.jsx)("s",{children:"S"})}),(0,d.jsx)(I.IB,{active:a.isActive("superscript"),onClick:()=>a.chain().focus().toggleSuperscript().run(),title:"Superscript",children:(0,d.jsxs)("span",{children:["X",(0,d.jsx)("sup",{style:{fontSize:"0.6em"},children:"2"})]})}),(0,d.jsx)(I.IB,{active:a.isActive("subscript"),onClick:()=>a.chain().focus().toggleSubscript().run(),title:"Subscript",children:(0,d.jsxs)("span",{children:["X",(0,d.jsx)("sub",{style:{fontSize:"0.6em"},children:"2"})]})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsxs)("div",{className:"relative",ref:i,children:[(0,d.jsx)(I.IB,{active:e,onClick:()=>{f(!e),h(!1)},title:"Text color",children:(0,d.jsx)(ah,{color:a.getAttributes("textStyle").color??"currentColor"})}),e&&(0,d.jsx)(R,{onSelect:b=>{b?a.chain().focus().setColor(b).run():a.chain().focus().unsetColor().run(),f(!1)}})]}),(0,d.jsxs)("div",{className:"relative",ref:j,children:[(0,d.jsx)(I.IB,{active:g,onClick:()=>{h(!g),f(!1)},title:"Highlight color",children:(0,d.jsx)(ai,{})}),g&&(0,d.jsx)(R,{onSelect:b=>{b?a.chain().focus().toggleHighlight({color:b}).run():a.chain().focus().unsetHighlight().run(),h(!1)}})]})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive({textAlign:"left"}),onClick:()=>a.chain().focus().setTextAlign("left").run(),title:"Align left",children:(0,d.jsx)(U,{})}),(0,d.jsx)(I.IB,{active:a.isActive({textAlign:"center"}),onClick:()=>a.chain().focus().setTextAlign("center").run(),title:"Align center",children:(0,d.jsx)(V,{})}),(0,d.jsx)(I.IB,{active:a.isActive({textAlign:"right"}),onClick:()=>a.chain().focus().setTextAlign("right").run(),title:"Align right",children:(0,d.jsx)(W,{})}),(0,d.jsx)(I.IB,{active:a.isActive({textAlign:"justify"}),onClick:()=>a.chain().focus().setTextAlign("justify").run(),title:"Justify",children:(0,d.jsx)(X,{})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive("bulletList"),onClick:()=>a.chain().focus().toggleBulletList().run(),title:"Bullet list",children:(0,d.jsx)(Y,{})}),(0,d.jsx)(I.IB,{active:a.isActive("orderedList"),onClick:()=>a.chain().focus().toggleOrderedList().run(),title:"Ordered list",children:(0,d.jsx)(Z,{})}),(0,d.jsx)(I.IB,{active:a.isActive("taskList"),onClick:()=>a.chain().focus().toggleTaskList().run(),title:"Task list",children:(0,d.jsx)(_,{})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive("blockquote"),onClick:()=>a.chain().focus().toggleBlockquote().run(),title:"Blockquote",children:(0,d.jsx)(aa,{})}),(0,d.jsx)(I.IB,{active:a.isActive("codeBlock"),onClick:()=>a.chain().focus().toggleCodeBlock().run(),title:"Code block",children:(0,d.jsx)(ab,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>a.chain().focus().setHorizontalRule().run(),title:"Horizontal rule",children:(0,d.jsx)(ac,{})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive("link"),onClick:()=>{if(a.isActive("link"))a.chain().focus().unsetLink().run();else{let b=window.prompt("Link URL:");b&&a.chain().focus().setLink({href:b}).run()}},title:"Insert link",children:(0,d.jsx)(ad,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>{if(b)c.current?.click();else{let b=window.prompt("Image URL:");b&&a.chain().focus().setImage({src:b}).run()}},title:"Insert image",children:(0,d.jsx)(ae,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>a.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),title:"Insert table",children:(0,d.jsx)(af,{})})]})]})}let O=[{label:"Normal text",level:0},{label:"Heading 1",level:1},{label:"Heading 2",level:2},{label:"Heading 3",level:3},{label:"Heading 4",level:4},{label:"Heading 5",level:5},{label:"Heading 6",level:6}];function P({editor:a}){let[b,c]=(0,G.useState)(!1),e=(0,G.useRef)(null),f=O.find(b=>b.level>0&&a.isActive("heading",{level:b.level}))??O[0];return(0,d.jsxs)("div",{className:"relative",ref:e,children:[(0,d.jsxs)("button",{type:"button",className:"rich-doc-style-dropdown",onClick:()=>c(!b),title:"Paragraph style",children:[(0,d.jsx)("span",{children:f.label}),(0,d.jsx)(ag,{})]}),b&&(0,d.jsx)("div",{className:"rich-doc-style-menu",children:O.map(b=>(0,d.jsx)("button",{type:"button",className:`rich-doc-style-option ${b.level===f.level?"rich-doc-style-option--active":""}`,onClick:()=>{0===b.level?a.chain().focus().setParagraph().run():a.chain().focus().toggleHeading({level:b.level}).run(),c(!1)},children:(0,d.jsx)("span",{style:{fontSize:0===b.level?void 0:`${Math.max(.75,1.4-.1*b.level)}rem`,fontWeight:b.level>0?600:400},children:b.label})},b.level))})]})}let Q=[null,"#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc","#dd7e6b","#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#a4c2f4","#9fc5e8","#b4a7d6","#d5a6bd","#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#6fa8dc","#8e7cc3","#c27ba0"];function R({onSelect:a}){return(0,d.jsx)("div",{className:"rich-doc-color-palette",children:Q.map(b=>(0,d.jsx)("button",{type:"button",className:"rich-doc-color-swatch",style:{background:b??"transparent",border:b?"1px solid var(--color-border)":"2px dashed var(--color-border)"},onClick:()=>a(b),title:b??"Remove color",children:!b&&(0,d.jsx)("span",{style:{fontSize:"10px",color:"var(--color-text-muted)"},children:"\xd7"})},b??"none"))})}function S(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 7v6h6"}),(0,d.jsx)("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})]})}function T(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M21 7v6h-6"}),(0,d.jsx)("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3L21 13"})]})}function U(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"17",x2:"3",y1:"10",y2:"10"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"14",y2:"14"}),(0,d.jsx)("line",{x1:"17",x2:"3",y1:"18",y2:"18"})]})}function V(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"18",x2:"6",y1:"10",y2:"10"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"14",y2:"14"}),(0,d.jsx)("line",{x1:"18",x2:"6",y1:"18",y2:"18"})]})}function W(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"21",x2:"7",y1:"10",y2:"10"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"14",y2:"14"}),(0,d.jsx)("line",{x1:"21",x2:"7",y1:"18",y2:"18"})]})}function X(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"21",x2:"3",y1:"10",y2:"10"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"14",y2:"14"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"18",y2:"18"})]})}function Y(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"8",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"18",y2:"18"})]})}function Z(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"10",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("path",{d:"M4 6h1v4"}),(0,d.jsx)("path",{d:"M4 10h2"}),(0,d.jsx)("path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"})]})}function _(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"6",height:"6",rx:"1"}),(0,d.jsx)("path",{d:"m3 17 2 2 4-4"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"18",y2:"18"})]})}function aa(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z"}),(0,d.jsx)("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z"})]})}function ab(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]})}function ac(){return(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("line",{x1:"2",x2:"22",y1:"12",y2:"12"})})}function ad({size:a=14}){return(0,d.jsxs)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,d.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}function ae(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,d.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,d.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})}function af(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12 3v18"}),(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M3 9h18"}),(0,d.jsx)("path",{d:"M3 15h18"})]})}function ag(){return(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})}function ah({color:a}){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M4 20h16",stroke:a,strokeWidth:"3"}),(0,d.jsx)("path",{d:"m8.5 3 3.5 11 3.5-11"})]})}function ai(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"m9 11-6 6v3h9l3-3"}),(0,d.jsx)("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})]})}function aj({mode:a}){return"txt"===a?(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-text-muted)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),(0,d.jsx)("path",{d:"M14 2v6h6"}),(0,d.jsx)("line",{x1:"8",x2:"16",y1:"13",y2:"13"}),(0,d.jsx)("line",{x1:"8",x2:"16",y1:"17",y2:"17"}),(0,d.jsx)("line",{x1:"8",x2:"10",y1:"9",y2:"9"})]}):(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#2b579a",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),(0,d.jsx)("path",{d:"M14 2v6h6"}),(0,d.jsx)("line",{x1:"8",x2:"16",y1:"13",y2:"13"}),(0,d.jsx)("line",{x1:"8",x2:"16",y1:"17",y2:"17"}),(0,d.jsx)("line",{x1:"8",x2:"10",y1:"9",y2:"9"})]})}},560382:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>C.default,__next_app__:()=>I,handler:()=>K,pages:()=>H,routeModule:()=>J,tree:()=>G});var d=c(135159),e=c(41752),f=c(295860),g=c(301769),h=c(573615),i=c(443399),j=c(384894),k=c(141651),l=c(405563),m=c(66361),n=c(267149),o=c(6314),p=c(593524),q=c(825877),r=c(200261),s=c(375804),t=c(318041),u=c(226713),v=c(975973),w=c(515422),x=c(388706),y=c(406527),z=c(161953),A=c(366107),B=c(986439),C=c(299207),D=c(933389),E=c(525188),F={};for(let a in D)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(F[a]=()=>D[a]);c.d(b,F);let G=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,803106)),"/home/runner/work/DenchClaw/DenchClaw/apps/web/app/page.tsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,509549)),"/home/runner/work/DenchClaw/DenchClaw/apps/web/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.bind(c,299207)),"/home/runner/work/DenchClaw/DenchClaw/apps/web/app/global-error.tsx"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,811313,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,460172,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,156863,23)),"next/dist/client/components/builtin/unauthorized.js"]}],H=["/home/runner/work/DenchClaw/DenchClaw/apps/web/app/page.tsx"],I={require:c,loadChunk:()=>Promise.resolve()},J=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:G},distDir:".next",relativeProjectDir:""});async function K(a,b,d){var F;let L="/page";"/index"===L&&(L="/");let M=(0,h.getRequestMeta)(a,"postponed"),N=(0,h.getRequestMeta)(a,"minimalMode"),O=await J.prepare(a,b,{srcPage:L,multiZoneDraftMode:!1});if(!O)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:P,query:Q,params:R,parsedUrl:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:_,isDraftMode:aa,resolvedPathname:ab,revalidateOnlyGenerated:ac,routerServerContext:ad,nextConfig:ae,interceptionRoutePatterns:af}=O,ag=S.pathname||"/",ah=(0,r.normalizeAppPath)(L),{isOnDemandRevalidate:ai}=O,aj=J.match(ag,_),ak=!!_.routes[ab],al=!!(aj||ak||_.routes[ah]),am=a.headers["user-agent"]||"",an=(0,u.getBotType)(am),ao=(0,p.isHtmlBotRequest)(a),ap=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],aq=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[t.RSC_HEADER],ar=(0,s.getIsPossibleServerAction)(a),as=(0,m.checkIsAppPPREnabled)(ae.experimental.ppr)&&(null==(F=_.routes[ah]??_.dynamicRoutes[ah])?void 0:F.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?M:void 0,aw=as&&aq&&!ap,ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=!am||(0,p.shouldServeStreamingMetadata)(am,ae.htmlLimitedBots);ao&&as&&(al=!1,ay=!1);let az=!0===J.isDev||!al||"string"==typeof M||aw,aA=ao&&as,aB=null;aa||!al||az||ar||av||aw||(aB=ab);let aC=aB;!aC&&J.isDev&&(aC=ab),J.isDev||aa||!al||!aq||aw||(0,k.d)(a.headers);let aD={...D,tree:G,pages:H,GlobalError:C.default,handler:K,routeModule:J,__next_app__:I};X&&Y&&(0,o.setReferenceManifestsSingleton)({page:L,clientReferenceManifest:Y,serverActionsManifest:X,serverModuleMap:(0,q.createServerModuleMap)({serverActionsManifest:X})});let aE=a.method||"GET",aF=(0,g.getTracer)(),aG=aF.getActiveScopeSpan();try{let f=J.getVaryHeader(ab,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return J.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aF.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aE} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aE} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:Q,params:R,page:ah,sharedContext:{buildId:P},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aD,Component:(0,j.T)(aD),params:R,routeModule:J,page:L,postponed:f,shouldWaitOnAllReady:aA,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||az,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,serverActionsManifest:X,clientReferenceManifest:Y,setIsrStatus:null==ad?void 0:ad.setIsrStatus,dir:c(333873).join(process.cwd(),J.relativeProjectDir),isDraftMode:aa,isRevalidate:al&&!f&&!aw,botType:an,isOnDemandRevalidate:ai,isPossibleServerAction:ar,assetPrefix:ae.assetPrefix,nextConfigOutput:ae.output,crossOrigin:ae.crossOrigin,trailingSlash:ae.trailingSlash,previewProps:_.preview,deploymentId:ae.deploymentId,enableTainting:ae.experimental.taint,htmlLimitedBots:ae.htmlLimitedBots,devtoolSegmentExplorer:ae.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ae.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ae.experimental.cacheLife,basePath:ae.basePath,serverActions:ae.experimental.serverActions,...at?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:at}:{},experimental:{isRoutePPREnabled:as,expireTime:ae.expireTime,staleTimes:ae.experimental.staleTimes,cacheComponents:!!ae.experimental.cacheComponents,clientSegmentCache:!!ae.experimental.clientSegmentCache,clientParamParsing:!!ae.experimental.clientParamParsing,dynamicOnHover:!!ae.experimental.dynamicOnHover,inlineCss:!!ae.experimental.inlineCss,authInterrupts:!!ae.experimental.authInterrupts,clientTraceMetadata:ae.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>J.onRequestError(a,b,d,ad),err:(0,h.getRequestMeta)(a,"invokeError"),dev:J.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[y.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,al&&(null==n?void 0:n.revalidate)===0&&!J.isDev&&!as){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ab}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
|
|
252
|
+
`+c.message,c.errorLocation={line:d,column:e},f.ERROR(c.message,c)}return b}}},410658:(a,b,c)=>{"use strict";c.d(b,{k:()=>f});var d=c(545343),e=c(845722);function f(a,b){let c=(0,d.q)(),f=b?.weekStartsOn??b?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,g=(0,e.a)(a,b?.in),h=g.getDay();return g.setDate(g.getDate()-(7*(h<f)+h-f)),g.setHours(0,0,0,0),g}},411202:(a,b,c)=>{"use strict";c.d(b,{a:()=>e});var d=c(347751);function e(a,b,c){return(0,d.P)(a,-b,c)}},413272:(a,b,c)=>{"use strict";c.d(b,{U:()=>T});var d=c(736927),e=c(115962),f=c(569607),g=c(626624),h=c(534487),i=c(355403),j=c(347751),k=c(411202);function l(a,b,c){return(0,j.P)(a,12*b,c)}var m=c(410658),n=c(545343),o=c(845722);function p(a,b){let c=(0,n.q)(),d=b?.weekStartsOn??b?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,e=(0,o.a)(a,b?.in),f=e.getDay();return e.setDate(e.getDate()+((f<d?-7:0)+6-(f-d))),e.setHours(23,59,59,999),e}function q(a,b){let c=(0,o.a)(a,b?.in);return c.setDate(1),c.setHours(0,0,0,0),c}function r(a,b){let c=(0,o.a)(a,b?.in),d=c.getMonth();return c.setFullYear(c.getFullYear(),d+1,0),c.setHours(23,59,59,999),c}var s=c(207346),t=c(712410),u=c(479466);function v(a,b,c){let[d,e]=(0,t.x)(c?.in,a,b);return+(0,u.o)(d)==+(0,u.o)(e)}var w=c(585698);function x(a,b,c){var d;let e=((0,o.a)(a)-(0,o.a)(b))/w.Cg;return(d=c?.roundingMethod,a=>{let b=(d?Math[d]:Math.trunc)(a);return 0===b?0:b})(e)}function y(a,b,c){let d=(0,o.a)(a,c?.in);return d.setTime(d.getTime()+b*w.Cg),d}function z(a,b,c){let[d,e]=(0,t.x)(c?.in,a,b);return d.getFullYear()===e.getFullYear()&&d.getMonth()===e.getMonth()}var A=c(502714);function B(a,b){var c;return v((0,A.w)(b?.in||a,a),(c=b?.in||a,(0,A.w)(c,Date.now())))}function C(a,b){return(0,o.a)(a,b?.in).getMinutes()}function D(a,b){return(0,o.a)(a,b?.in).getHours()}var E=c(999063),F=c(530858),G=c(18886),H=c(130526);function I(a){return null==a?"":"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):"object"==typeof a?JSON.stringify(a):""}function J(a){return(0,g.GP)(a,"yyyy-MM-dd")}function K(a){return a.toISOString()}function L(a,b,c){switch(b){case"day":return 1===c?(0,h.f)(a,1):(0,h.f)(a,-1,void 0);case"week":return 1===c?(0,i.J)(a,1):(0,i.J)(a,-1,void 0);case"month":return 1===c?(0,j.P)(a,1):(0,k.a)(a,1);case"year":return 1===c?l(a,1):l(a,-1,void 0)}}function M({event:a,compact:b,onClick:c,draggable:e,onDragStart:f}){let h=a.color??"var(--color-accent)";return(0,d.jsx)("button",{type:"button",draggable:e,onDragStart:f,onClick:a=>{a.stopPropagation(),c?.()},className:`text-left rounded px-1.5 truncate cursor-pointer transition-opacity hover:opacity-80 ${b?"text-[10px] py-0":"text-[11px] py-0.5"}`,style:{backgroundColor:h,color:"#fff",border:"none",width:"100%",lineHeight:b?"16px":"18px"},title:a.title,children:(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[!b&&(0,d.jsx)("span",{className:"opacity-70 shrink-0",children:(0,g.GP)(a.date,"HH:mm")}),a.faviconUrl&&(0,d.jsx)(G.A,{src:a.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.title||"Untitled"})]})})}function N({date:a,events:b,onEntryClick:c,onEntryDateChange:f}){let[i,j]=(0,e.useState)(null),k=(0,e.useRef)(null),l=q(a),n=r(a),o=(0,m.k)(l,{weekStartsOn:1}),t=p(n,{weekStartsOn:1}),w=(0,s.k)({start:o,end:t}),A=(0,e.useMemo)(()=>{let a=new Map;for(let c of b){let b=(0,g.GP)(c.date,"yyyy-MM-dd");if(a.has(b)||a.set(b,[]),a.get(b).push(c),c.endDate&&!v(c.date,c.endDate))for(let b of(0,s.k)({start:(0,h.f)(c.date,1),end:c.endDate})){let d=(0,g.GP)(b,"yyyy-MM-dd");a.has(d)||a.set(d,[]),a.get(d).push(c)}}return a},[b]),C=(0,e.useCallback)(a=>{k.current=a},[]),D=(0,e.useCallback)((a,b)=>{a.preventDefault(),j(b)},[]),E=(0,e.useCallback)((a,b)=>{a.preventDefault(),j(null);let c=k.current;if(!c||!f||v(c.date,b))return;let d=x((0,u.o)(b),(0,u.o)(c.date)),e=y(c.date,d),g={entryId:c.id,newDate:J(e)};c.endDate&&(g.newEndDate=J(y(c.endDate,d))),f(g),k.current=null},[f]),F=(0,e.useCallback)(()=>j(null),[]);return(0,d.jsxs)("div",{className:"w-full",children:[(0,d.jsx)("div",{className:"grid grid-cols-7 border-b",style:{borderColor:"var(--color-border)"},children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(a=>(0,d.jsx)("div",{className:"text-center text-[11px] font-medium py-2",style:{color:"var(--color-text-muted)"},children:a},a))}),(0,d.jsx)("div",{className:"grid grid-cols-7",children:w.map(b=>{let e=(0,g.GP)(b,"yyyy-MM-dd"),h=A.get(e)??[],j=z(b,a),k=B(b),l=i===e;return(0,d.jsxs)("div",{className:"min-h-[100px] border-b border-r p-1 transition-colors",style:{borderColor:"var(--color-border)",opacity:j?1:.4,background:l?"var(--color-accent-light, rgba(99,102,241,0.12))":k?"var(--color-surface-hover)":void 0},onDragOver:a=>D(a,e),onDragLeave:F,onDrop:a=>E(a,b),children:[(0,d.jsx)("div",{className:`text-[11px] mb-0.5 ${k?"font-bold":""}`,style:{color:k?"var(--color-accent)":"var(--color-text-muted)"},children:(0,g.GP)(b,"d")}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[h.slice(0,3).map(a=>(0,d.jsx)(M,{event:a,compact:!0,onClick:()=>c?.(a.id),draggable:!!f,onDragStart:()=>C(a)},a.id)),h.length>3&&(0,d.jsxs)("span",{className:"text-[10px] pl-1",style:{color:"var(--color-text-muted)"},children:["+",h.length-3," more"]})]})]},e)})})]})}function O({event:a,hourHeight:b,onEntryClick:c,onEntryDateChange:f}){let g=(0,e.useRef)(null),[h,i]=(0,e.useState)(null),j=(0,e.useRef)({y:0,startMinute:0,duration:0}),k=C(a.date)/60*b,l=a.endDate?Math.max(x(a.endDate,a.date),15):30,m=l/60*b,[n,o]=(0,e.useState)(0),[p,q]=(0,e.useState)(0),r=(0,e.useCallback)(b=>{f&&(b.preventDefault(),b.stopPropagation(),i("move"),j.current={y:b.clientY,startMinute:60*D(a.date)+C(a.date),duration:l},b.target.setPointerCapture(b.pointerId))},[f,a.date,l]),s=(0,e.useCallback)(a=>{f&&(a.preventDefault(),a.stopPropagation(),i("resize"),j.current={y:a.clientY,startMinute:0,duration:l},a.target.setPointerCapture(a.pointerId))},[f,l]),t=(0,e.useCallback)(a=>{if(!h)return;let b=a.clientY-j.current.y;"move"===h?o(b):q(b)},[h]),u=(0,e.useCallback)(c=>{if(!h||!f)return;let d=15*Math.round((c.clientY-j.current.y)/b*60/15);if("move"===h&&0!==d){let b=y(a.date,d),c={entryId:a.id,newDate:K(b)};a.endDate&&(c.newEndDate=K(y(a.endDate,d))),f(c)}else if("resize"===h&&0!==d){let b=y(a.endDate??y(a.date,l),d);b>a.date&&f({entryId:a.id,newDate:K(a.date),newEndDate:K(b)})}i(null),o(0),q(0)},[h,f,a,b,l]),v=k+("move"===h?n:0),w=Math.max(m+("resize"===h?p:0),15);return(0,d.jsxs)("div",{ref:g,className:"absolute left-0.5 right-0.5 rounded px-1 text-[10px] truncate select-none",style:{top:v,height:Math.min(w,6*b),backgroundColor:a.color??"var(--color-accent)",color:"#fff",lineHeight:"16px",zIndex:h?20:2,cursor:f?"move"===h?"grabbing":"grab":"pointer",opacity:h?.85:1,transition:h?"none":"top 0.15s, height 0.15s"},onPointerDown:r,onPointerMove:t,onPointerUp:u,onClick:b=>{h||(b.stopPropagation(),c?.(a.id))},title:a.title,children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[a.faviconUrl&&(0,d.jsx)(G.A,{src:a.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.title||"Untitled"})]}),f&&(0,d.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-2 cursor-ns-resize",style:{borderRadius:"0 0 4px 4px"},onPointerDown:s})]})}function P({date:a,events:b,onEntryClick:c,onEntryDateChange:f}){let i=(0,m.k)(a,{weekStartsOn:1}),j=(0,s.k)({start:i,end:(0,h.f)(i,6)}),k=Array.from({length:24},(a,b)=>b+0),l=(0,e.useMemo)(()=>{let a=new Map;for(let c of b){let b=(0,g.GP)(c.date,"yyyy-MM-dd");a.has(b)||a.set(b,[]),a.get(b).push(c)}return a},[b]);return(0,d.jsx)("div",{className:"w-full overflow-auto",style:{maxHeight:"calc(100vh - 280px)"},children:(0,d.jsxs)("div",{className:"grid",style:{gridTemplateColumns:"50px repeat(7, 1fr)"},children:[(0,d.jsx)("div",{className:"sticky top-0 z-10",style:{background:"var(--color-bg)"}}),j.map(a=>(0,d.jsxs)("div",{className:"sticky top-0 z-10 text-center py-2 border-b border-l text-[12px] font-medium",style:{borderColor:"var(--color-border)",background:"var(--color-bg)",color:B(a)?"var(--color-accent)":"var(--color-text)"},children:[(0,d.jsx)("div",{children:(0,g.GP)(a,"EEE")}),(0,d.jsx)("div",{className:`text-lg ${B(a)?"font-bold":""}`,children:(0,g.GP)(a,"d")})]},a.toISOString())),k.map(a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"text-[10px] text-right pr-2 pt-0.5",style:{color:"var(--color-text-muted)",height:60},children:(0,g.GP)(new Date(2e3,0,1,a),"ha")},`label-${a}`),j.map(b=>{let e=(0,g.GP)(b,"yyyy-MM-dd"),h=(l.get(e)??[]).filter(b=>D(b.date)===a);return(0,d.jsx)("div",{className:"border-b border-l relative",style:{borderColor:"var(--color-border)",height:60},children:h.map(a=>(0,d.jsx)(O,{event:a,hourHeight:60,onEntryClick:c,onEntryDateChange:f},a.id))},`${e}-${a}`)})]}))]})})}function Q({date:a,events:b,onEntryClick:c,onEntryDateChange:f}){let h=Array.from({length:24},(a,b)=>b+0),i=(0,e.useMemo)(()=>b.filter(b=>v(b.date,a)),[b,a]);return(0,d.jsx)("div",{className:"w-full overflow-auto",style:{maxHeight:"calc(100vh - 280px)"},children:(0,d.jsx)("div",{className:"grid",style:{gridTemplateColumns:"60px 1fr"},children:h.map(a=>{let b=i.filter(b=>D(b.date)===a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"text-[11px] text-right pr-3 pt-0.5",style:{color:"var(--color-text-muted)",height:60},children:(0,g.GP)(new Date(2e3,0,1,a),"h:mm a")},`label-${a}`),(0,d.jsx)("div",{className:"border-b border-l relative",style:{borderColor:"var(--color-border)",height:60},children:b.map(a=>(0,d.jsx)(O,{event:a,hourHeight:60,onEntryClick:c,onEntryDateChange:f},a.id))},`cell-${a}`)]})})})})}function R({date:a,events:b}){let c=(0,E.D)(a),f=function(a,b){let c=(0,o.a)(a,void 0),d=c.getFullYear();return c.setFullYear(d+1,0,0),c.setHours(23,59,59,999),c}(a),h=(0,F.i)({start:c,end:f}),i=(0,e.useMemo)(()=>{let a=new Map;for(let c of b){let b=c.date.getMonth();a.has(b)||a.set(b,[]),a.get(b).push(c)}return a},[b]);return(0,d.jsx)("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-4 p-2",children:h.map(a=>{let b=q(a),c=r(a),e=(0,m.k)(b,{weekStartsOn:1}),f=p(c,{weekStartsOn:1}),h=(0,s.k)({start:e,end:f}),j=i.get(a.getMonth())??[];return(0,d.jsxs)("div",{className:"rounded-lg border p-2",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"text-[12px] font-semibold mb-1",style:{color:"var(--color-text)"},children:(0,g.GP)(a,"MMMM")}),(0,d.jsxs)("div",{className:"grid grid-cols-7 gap-px",children:[["M","T","W","T","F","S","S"].map((a,b)=>(0,d.jsx)("div",{className:"text-[9px] text-center",style:{color:"var(--color-text-muted)"},children:a},b)),h.map(b=>{let c=z(b,a),e=B(b),f=j.some(a=>v(a.date,b));return(0,d.jsxs)("div",{className:"text-[9px] text-center py-0.5 relative",style:{color:c?e?"var(--color-accent)":"var(--color-text)":"transparent",fontWeight:e?700:400},children:[(0,g.GP)(b,"d"),f&&c&&(0,d.jsx)("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full",style:{backgroundColor:"var(--color-accent)"}})]},b.toISOString())})]}),j.length>0&&(0,d.jsxs)("div",{className:"mt-1 text-[10px]",style:{color:"var(--color-text-muted)"},children:[j.length," event",1!==j.length?"s":""]})]},a.toISOString())})})}function S({reason:a}){return(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 gap-2",children:[(0,d.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",style:{color:"var(--color-text-muted)",opacity:.4},children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),(0,d.jsx)("path",{d:"M16 2v4"}),(0,d.jsx)("path",{d:"M8 2v4"}),(0,d.jsx)("path",{d:"M3 10h18"})]}),(0,d.jsx)("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"no-date-field"===a?"No date field configured for calendar view. Open view settings to select one.":"No events to display in this range."})]})}function T({objectName:a,fields:b,entries:c,dateField:h,endDateField:i,mode:j,onModeChange:k,members:l,onEntryClick:n,onEntryDateChange:o}){let[q,r]=(0,e.useState)(()=>new Date),s=(0,e.useMemo)(()=>(function(a,b,c,d){let e=[];for(let g of a){let a=I(g[c]);if(a)try{let c,h=(0,f.H)(a);if(Number.isNaN(h.getTime()))continue;if(d){let a=I(g[d]);if(a){let b=(0,f.H)(a);Number.isNaN(b.getTime())||(c=b)}}e.push({id:I(g.entry_id??g.id),title:function(a,b){let c=b.find(a=>"text"===a.type&&/name|title/i.test(a.name))??b.find(a=>"text"===a.type);return c?I(a[c.name]):I(a.id)}(g,b),faviconUrl:(0,H.I)(g,b)?.faviconUrl,date:h,endDate:c,entry:g,color:function(a,b){let c=b.find(a=>"enum"===a.type&&a.enum_colors?.length);if(!c)return;let d=I(a[c.name]),e=c.enum_values?.indexOf(d)??-1;return e>=0?c.enum_colors[e]:void 0}(g,b)})}catch{}}return e})(c,b,h,i),[c,b,h,i]),t=(0,e.useCallback)(()=>r(a=>L(a,j,-1)),[j]),u=(0,e.useCallback)(()=>r(a=>L(a,j,1)),[j]),v=(0,e.useCallback)(()=>r(new Date),[]);return h?(0,d.jsxs)("div",{className:"w-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-3 px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-md hover:bg-[var(--color-surface-hover)] transition-colors",style:{color:"var(--color-text)"},children:(0,d.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,d.jsx)("path",{d:"m15 18-6-6 6-6"})})}),(0,d.jsx)("button",{type:"button",onClick:u,className:"p-1.5 rounded-md hover:bg-[var(--color-surface-hover)] transition-colors",style:{color:"var(--color-text)"},children:(0,d.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,d.jsx)("path",{d:"m9 18 6-6-6-6"})})}),(0,d.jsx)("button",{type:"button",onClick:v,className:"text-[12px] px-2.5 py-1 rounded-md border hover:bg-[var(--color-surface-hover)] transition-colors",style:{color:"var(--color-text)",borderColor:"var(--color-border)"},children:"Today"}),(0,d.jsx)("h3",{className:"text-sm font-semibold ml-2",style:{color:"var(--color-text)"},children:function(a,b){switch(b){case"day":return(0,g.GP)(a,"EEEE, MMMM d, yyyy");case"week":{let b=(0,m.k)(a,{weekStartsOn:1}),c=p(a,{weekStartsOn:1});return`${(0,g.GP)(b,"MMM d")} - ${(0,g.GP)(c,"MMM d, yyyy")}`}case"month":return(0,g.GP)(a,"MMMM yyyy");case"year":return(0,g.GP)(a,"yyyy")}}(q,j)})]}),(0,d.jsx)("div",{className:"flex rounded-lg border overflow-hidden",style:{borderColor:"var(--color-border)"},children:["day","week","month","year"].map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>k(a),className:"text-[11px] px-3 py-1 capitalize transition-colors",style:{background:a===j?"var(--color-accent)":"var(--color-surface)",color:a===j?"#fff":"var(--color-text-muted)",borderRight:"year"!==a?"1px solid var(--color-border)":void 0},children:a},a))})]}),(0,d.jsxs)("div",{className:"rounded-lg border overflow-hidden",style:{borderColor:"var(--color-border)",background:"var(--color-bg)"},children:["month"===j&&(0,d.jsx)(N,{date:q,events:s,onEntryClick:n,onEntryDateChange:o}),"week"===j&&(0,d.jsx)(P,{date:q,events:s,onEntryClick:n,onEntryDateChange:o}),"day"===j&&(0,d.jsx)(Q,{date:q,events:s,onEntryClick:n,onEntryDateChange:o}),"year"===j&&(0,d.jsx)(R,{date:q,events:s})]})]}):(0,d.jsx)(S,{reason:"no-date-field"})}},415182:(a,b,c)=>{"use strict";c.d(b,{R:()=>m});var d=c(736927),e=c(115962),f=c(327629),g=c(23581),h=c(843572),i=c(970093);function j({logo:a,name:b,slug:c}){let[f,g]=(0,e.useState)(!1),h=(0,i.m9)({toolkitSlug:c,toolkitName:b,initialLogo:a}),j=h.logo&&!f;return(0,d.jsx)("div",{className:"flex h-12 w-12 items-center justify-center overflow-hidden rounded-xl",style:{background:"var(--color-surface-hover)",border:"1px solid var(--color-border)"},children:j?(0,d.jsx)("img",{src:h.logo??void 0,alt:"",className:"h-8 w-8 object-contain",decoding:"async",onError:()=>g(!0)}):(0,d.jsx)("span",{className:"text-base font-semibold uppercase",style:{color:"var(--color-text-muted)"},children:b.slice(0,2)})})}function k(a){return({OAUTH2:"OAuth 2.0",OAUTH1:"OAuth 1.0",API_KEY:"API Key",BASIC:"Basic Auth",BEARER_TOKEN:"Bearer Token",JWT:"JWT",NO_AUTH:"No Auth"})[a]??a.replace(/_/g," ")}function l(a){let b=Date.parse(a);return Number.isFinite(b)?new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(b):"Connected recently"}function m({toolkit:a,connections:b,open:c,preferredAction:i,onOpenChange:m,onConnectionChange:n}){let[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w=(0,e.useRef)(!1),x=(0,e.useMemo)(()=>(0,h.eF)(b),[b]),y=(0,e.useMemo)(()=>x.filter(a=>a.is_active),[x]),z=y.length>0,A=i??(z?"connect":x.length>0?"reconnect":"connect"),B=(0,e.useCallback)(()=>{null!==v.current&&(window.clearInterval(v.current),v.current=null)},[]),C=(0,e.useCallback)(()=>{B(),u.current=null,w.current=!1},[B]),D=(0,e.useCallback)(async()=>{if(a){p(!0),t(null),C();try{let b=await fetch("/api/composio/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolkit:a.connect_slug??a.slug})}),c=await b.json();if(!b.ok)throw Error(c.error??"Failed to start connection.");let d=window.open(c.redirect_url,"_blank","popup=yes,width=560,height=720,resizable=yes,scrollbars=yes");if(!d)throw Error("Popup was blocked. Please allow popups and try again.");u.current=d,w.current=!1,d.focus?.(),v.current=window.setInterval(()=>{let b=u.current;b&&b.closed&&(B(),u.current=null,p(!1),w.current||(n({toolkit:a}),m(!1)))},500)}catch(a){p(!1),t(a instanceof Error?a.message:"Failed to connect.")}}},[C,n,m,B,a]),E=(0,e.useCallback)(async b=>{r(b),t(null);try{let c=await fetch("/api/composio/disconnect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connection_id:b})}),d=await c.json();if(!c.ok)throw Error(d.error??"Failed to disconnect.");n({toolkit:a,connected:!1})}catch(a){t(a instanceof Error?a.message:"Failed to disconnect.")}finally{r(null)}},[n]);if(!a)return null;let F=a.auth_schemes.length>0?a.auth_schemes.map(k).join(", "):null;return(0,d.jsx)(g.lG,{open:c,onOpenChange:m,children:(0,d.jsxs)(g.Cf,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-6 pt-6 pb-4",style:{borderBottom:"1px solid var(--color-border)"},children:[(0,d.jsx)(g.c7,{className:"space-y-0",children:(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)(j,{logo:a.logo,name:a.name,slug:a.slug}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)(g.L3,{className:"text-lg leading-tight",children:a.name}),a.description&&(0,d.jsx)(g.rr,{className:"mt-1 text-[13px] leading-relaxed line-clamp-2",children:a.description})]})]})}),(0,d.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[a.tools_count>0&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:[(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),a.tools_count," tool",1!==a.tools_count?"s":""]}),F&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:[(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,d.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),F]}),z&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium",style:{background:"rgba(16, 185, 129, 0.1)",color:"rgb(74 222 128)",border:"1px solid rgba(16, 185, 129, 0.2)"},children:[(0,d.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})}),y.length," connected"]})]}),a.categories.length>0&&(0,d.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:a.categories.slice(0,5).map(a=>(0,d.jsx)("span",{className:"rounded-full px-2 py-0.5 text-[11px]",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:a},a))})]}),(0,d.jsxs)("div",{className:"px-6 py-4 space-y-3 max-h-[340px] overflow-y-auto",children:[s&&(0,d.jsx)("div",{className:"rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-red-300",children:s}),x.length>0?(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Connections"}),(0,d.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[x.length," total"]})]}),x.map((a,b)=>{let c=a.is_active?"Disconnect":"Remove",e=a.is_same_account_reconnect,g="gateway_stable_id"!==a.account_identity_source;return(0,d.jsx)("div",{className:"rounded-xl border px-3 py-3",style:{borderColor:a.is_active?"rgba(16, 185, 129, 0.22)":"var(--color-border)",background:a.is_active?"rgba(16, 185, 129, 0.05)":"var(--color-surface-hover)"},children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:a.display_label}),(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:a.is_active?"rgba(16, 185, 129, 0.15)":"var(--color-background)",color:a.is_active?"rgb(74 222 128)":"var(--color-text-muted)",border:a.is_active?"1px solid rgba(16, 185, 129, 0.24)":"1px solid var(--color-border)"},children:a.normalized_status})]}),(0,d.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground",children:a.account_email||a.account_name||a.account_label?`Added ${l(a.created_at)}`:`Connection ${b+1} \xb7 Added ${l(a.created_at)}`}),(e||g)&&(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[e&&(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:"rgba(96, 165, 250, 0.12)",color:"rgb(147 197 253)",border:"1px solid rgba(96, 165, 250, 0.2)"},children:"Same account reconnected"}),g&&(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:"var(--color-background)",color:"var(--color-text-muted)",border:"1px solid var(--color-border)"},children:"Identity inferred"})]})]}),(0,d.jsx)(f.$,{variant:"outline",size:"sm",onClick:()=>void E(a.id),disabled:q===a.id,children:q===a.id?`${c}...`:c})]})},a.id)})]}):(0,d.jsxs)("div",{className:"px-3 py-5 text-center text-sm",style:{color:"#a3a3a3"},children:["No accounts connected yet. Connect your ",a.name," account to get started."]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2 px-6 py-4",style:{borderTop:"1px solid var(--color-border)"},children:[(0,d.jsx)("button",{type:"button",className:"rounded-full px-4 py-1.5 text-sm font-medium transition-all bg-stone-100 hover:bg-stone-200/50",style:{color:"#57534e"},onClick:()=>m(!1),children:"Close"}),(0,d.jsx)("button",{type:"button",className:"rounded-full px-4 py-1.5 text-sm font-medium",style:{background:"var(--color-accent)",color:"#fff"},onClick:()=>void D(),disabled:o,children:o?"Waiting for authorization...":"reconnect"===A?`Reconnect ${a.name}`:z?"Connect another account":`Connect ${a.name}`})]})]})})}},416170:(a,b,c)=>{"use strict";c.d(b,{a:()=>e});var d=c(115962);function e(a=768){let[b,c]=(0,d.useState)(!1);return b}},418398:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(250367).nA},419121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},421683:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(972182),e=c(764256),f=c(783037);b.last=function(a){if(f.isArrayLike(a))return d.last(e.toArray(a))}},422623:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(143116);b.debounce=function(a,b=0,c={}){let e;"object"!=typeof c&&(c={});let{leading:f=!1,trailing:g=!0,maxWait:h}=c,i=[,,];f&&(i[0]="leading"),g&&(i[1]="trailing");let j=null,k=d.debounce(function(...b){e=a.apply(this,b),j=null},b,{edges:i}),l=function(...b){return null!=h&&(null===j&&(j=Date.now()),Date.now()-j>=h)?(e=a.apply(this,b),j=Date.now(),k.cancel(),k.schedule(),e):(k.apply(this,b),e)};return l.cancel=k.cancel,l.flush=()=>(k.flush(),e),l}},422703:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>f});var d=c(720511),e=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,f=d.bP.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:a}){return["img",(0,d.KV)(this.options.HTMLAttributes,a)]},parseMarkdown:(a,b)=>b.createNode("image",{src:a.href,title:a.title,alt:a.text}),renderMarkdown:a=>{var b,c,d,e,f,g;let h=null!=(c=null==(b=a.attrs)?void 0:b.src)?c:"",i=null!=(e=null==(d=a.attrs)?void 0:d.alt)?e:"",j=null!=(g=null==(f=a.attrs)?void 0:f.title)?g:"";return j?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"undefined"==typeof document)return null;let{directions:a,minWidth:b,minHeight:c,alwaysPreserveAspectRatio:e}=this.options.resize;return({node:f,getPos:g,HTMLAttributes:h,editor:i})=>{let j=document.createElement("img");Object.entries(h).forEach(([a,b])=>{if(null!=b)switch(a){case"width":case"height":break;default:j.setAttribute(a,b)}}),j.src=h.src;let k=new d.Nz({element:j,editor:i,node:f,getPos:g,onResize:(a,b)=>{j.style.width=`${a}px`,j.style.height=`${b}px`},onCommit:(a,b)=>{let c=g();void 0!==c&&this.editor.chain().setNodeSelection(c).updateAttributes(this.name,{width:a,height:b}).run()},onUpdate:(a,b,c)=>a.type===f.type,options:{directions:a,min:{width:b,height:c},preserveAspectRatio:!0===e}}),l=k.dom;return l.style.visibility="hidden",l.style.pointerEvents="none",j.onload=()=>{l.style.visibility="",l.style.pointerEvents=""},k}},addCommands(){return{setImage:a=>({commands:b})=>b.insertContent({type:this.name,attrs:a})}},addInputRules(){return[(0,d.jT)({find:e,type:this.type,getAttributes:a=>{let[,,b,c,d]=a;return{src:c,alt:b,title:d}}})]}})},423721:(a,b,c)=>{"use strict";c.d(b,{dc:()=>f,VG:()=>g});var d=c(348445);let e=[],f=!1;function g(a,b,c,g){let h;"function"==typeof b&&"function"!=typeof c?(g=c,c=b):h=b;let i=(0,d.C)(h),j=g?-1:1;(function a(d,h,k){let l=d&&"object"==typeof d?d:{};if("string"==typeof l.type){let a="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(m,"name",{value:"node (\x1b[33m"+d.type+(a?"<"+a+">":"")+"\x1b[39m)"})}return m;function m(){var l;let m,n,o,p=e;if((!b||i(d,h,k[k.length-1]||void 0))&&(p=Array.isArray(l=c(d,k))?l:"number"==typeof l?[!0,l]:null==l?e:[l])[0]===f)return p;if("children"in d&&d.children&&d.children&&"skip"!==p[0])for(n=(g?d.children.length:-1)+j,o=k.concat(d);n>-1&&n<d.children.length;){if((m=a(d.children[n],n,o)())[0]===f)return m;n="number"==typeof m[1]?m[1]:n+j}return p}})(a,void 0,[])()}},423932:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],f=(0,d.A)("globe",e)},430083:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"unstable_rethrow",{enumerable:!0,get:function(){return d}});let d=c(301154).unstable_rethrow;("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},430792:(a,b,c)=>{"use strict";c.d(b,{hO:()=>i,sG:()=>h});var d=c(115962),e=c(249855),f=c(988447),g=c(736927),h=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((a,b)=>{let c=(0,f.TL)(`Primitive.${b}`),e=d.forwardRef((a,d)=>{let{asChild:e,...f}=a;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(e?c:b,{...f,ref:d})});return e.displayName=`Primitive.${b}`,{...a,[b]:e}},{});function i(a,b){a&&e.flushSync(()=>a.dispatchEvent(b))}},437503:(a,b,c)=>{"use strict";c.d(b,{X:()=>g});var d=c(736927),e=c(115962);let f=["#fda4af","#fbcfe8","#d8b4fe","#a5b4fc","#93c5fd","#7dd3fc","#67e8f9","#5eead4","#86efac","#bef264","#fde68a","#fdba74","#fca5a5"];function g({src:a,name:b,seed:c,size:g="md",className:i="",onError:j}){let[k,l]=(0,e.useState)(!1),m=function(a,b){let c=function(a){if(!a||"string"!=typeof a)return"?";let b=a.trim();if(!b)return"?";let c=b;if(b.includes("@")){let a=b.slice(0,b.indexOf("@"));a&&(c=a)}if(!(c=c.replace(/[._+-]/g," ").trim()))return"?";let d=c.split(/\s+/).filter(Boolean);if(0===d.length)return"?";if(1===d.length)return(d[0].charAt(0)||"?").toUpperCase();let e=d[0].charAt(0),f=d[d.length-1].charAt(0);return`${e}${f}`.toUpperCase()}(a);return{initials:c,background:function(a){let b=(a??"").trim();if(!b)return f[0];let c=0x811c9dc5;for(let a=0;a<b.length;a+=1)c^=b.charCodeAt(a),c=Math.imul(c,0x1000193);let d=Math.abs(c)%f.length;return f[d]}(b??a??""),foreground:"#0c0a09"}}(b??null,c??void 0),n=h[g],o=Math.max(10,Math.round(.4*n)),p=!!a&&!k;return(0,d.jsx)("span",{className:`inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 ${i}`,style:{width:n,height:n,background:p?"transparent":m.background,color:m.foreground,fontSize:o,fontWeight:600,lineHeight:1},"aria-label":b??"Avatar",children:p?(0,d.jsx)("img",{src:a??void 0,alt:b??"",width:n,height:n,decoding:"async",loading:"lazy",onError:()=>{l(!0),j?.()},style:{width:"100%",height:"100%",objectFit:"cover"}}):m.initials})}let h={sm:24,md:36,lg:48,xl:64}},438899:(a,b)=>{"use strict";function c(a){return a.split("/").map(a=>encodeURIComponent(a)).join("/")}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"encodeURIPath",{enumerable:!0,get:function(){return c}})},439384:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isObject=function(a){return null!==a&&("object"==typeof a||"function"==typeof a)}},441204:a=>{"use strict";a.exports=require("string_decoder")},442184:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],f=(0,d.A)("workflow",e)},444949:(a,b,c)=>{"use strict";c.d(b,{q:()=>f});var d=c(736927);let e=[{min:500,label:"Inner circle",color:"#6366f1",rank:4},{min:100,label:"Strong",color:"#22c55e",rank:3},{min:20,label:"Active",color:"#3b82f6",rank:2},{min:1,label:"Weak",color:"#f59e0b",rank:1},{min:0,label:"Cold",color:"#94a3b8",rank:0}];function f({score:a,size:b="md",showLabel:c=!0}){let f=function(a){let b="string"==typeof a?Number(a):a??0;if(!Number.isFinite(b)||b<0){let a=e[e.length-1];return{label:a.label,color:a.color,rank:a.rank}}for(let a of e)if(b>=a.min)return{label:a.label,color:a.color,rank:a.rank};let c=e[e.length-1];return{label:c.label,color:c.color,rank:c.rank}}(a),g="sm"===b?6:8;return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)",padding:"sm"===b?"1px 6px":"2px 8px",fontSize:"sm"===b?10:11,lineHeight:1.4},title:`Connection strength: ${f.label}`,children:[(0,d.jsx)("span",{"aria-hidden":!0,style:{width:g,height:g,borderRadius:99,background:f.color,flexShrink:0}}),c&&f.label]})}},450846:(a,b,c)=>{"use strict";c.d(b,{Kh:()=>d,Ms:()=>f,Mu:()=>v,Xc:()=>r,aW:()=>h,db:()=>g,hh:()=>u,iS:()=>t,os:()=>s,ri:()=>q});let d=["table","kanban","calendar","timeline","gallery","list"];function e(a){return"string"==typeof a&&d.includes(a)}function f(a,b,c){return a?.view_type&&e(a.view_type)?a.view_type:b&&e(b)?b:c&&e(c)?c:"table"}function g(a,b){if(!b)return a??{};if(!a)return b;let c={...b};for(let b of Object.keys(a)){let d=a[b];void 0!==d&&(c[b]=d)}return c}function h(a,b,c){switch(b){case"kanbanField":return c.find(a=>"enum"===a.type&&/status/i.test(a.name))?.name??c.find(a=>"enum"===a.type)?.name;case"calendarDateField":case"timelineStartField":return c.find(a=>"date"===a.type&&/due|start|begin/i.test(a.name))?.name??c.find(a=>"date"===a.type)?.name;case"calendarEndDateField":case"timelineEndField":return c.find(a=>"date"===a.type&&/end|finish|close/i.test(a.name))?.name;case"timelineGroupField":return c.find(a=>"enum"===a.type)?.name;case"galleryTitleField":case"listTitleField":return c.find(a=>"text"===a.type&&/name|title/i.test(a.name))?.name??c.find(a=>"text"===a.type)?.name;case"galleryCoverField":default:return;case"listSubtitleField":return c.find(a=>"text"===a.type&&!/name|title/i.test(a.name))?.name}}let i=[{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],j=[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},...i],k=[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},...i],l=[{value:"on",label:"is"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"date_between",label:"between"},{value:"relative_past",label:"in the last"},{value:"relative_next",label:"in the next"},...i],m=[{value:"is",label:"is"},{value:"is_not",label:"is not"},{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},...i],n=[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},...i],o=[{value:"has_any",label:"has any of"},{value:"has_none",label:"has none of"},{value:"has_all",label:"has all of"},...i],p=[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},...i];function q(a){switch(a){case"text":case"richtext":case"email":default:return j;case"number":return k;case"date":return l;case"enum":return m;case"boolean":return n;case"relation":case"user":return o;case"tags":return p}}function r(a){switch(a){case"text":case"richtext":case"email":case"tags":default:return"contains";case"number":return"eq";case"date":return"relative_past";case"enum":return"is";case"boolean":return"is_true";case"relation":case"user":return"has_any"}}function s(a){return"conjunction"in a&&"rules"in a}function t(a){return btoa(JSON.stringify(a))}function u(){return{id:"root",conjunction:"and",rules:[]}}function v(){return Math.random().toString(36).slice(2,9)}},452171:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(139957),e=c(266196),f=c(606461),g=c(958961),h=c(618515);function i(a,b,c,d=new Map,k){let l=k?.(a,b,c,d);if(void 0!==l)return l;if(g.isPrimitive(a))return a;if(d.has(a))return d.get(a);if(Array.isArray(a)){let b=Array(a.length);d.set(a,b);for(let e=0;e<a.length;e++)b[e]=i(a[e],e,c,d,k);return Object.hasOwn(a,"index")&&(b.index=a.index),Object.hasOwn(a,"input")&&(b.input=a.input),b}if(a instanceof Date)return new Date(a.getTime());if(a instanceof RegExp){let b=new RegExp(a.source,a.flags);return b.lastIndex=a.lastIndex,b}if(a instanceof Map){let b=new Map;for(let[e,f]of(d.set(a,b),a))b.set(e,i(f,e,c,d,k));return b}if(a instanceof Set){let b=new Set;for(let e of(d.set(a,b),a))b.add(i(e,void 0,c,d,k));return b}if("undefined"!=typeof Buffer&&Buffer.isBuffer(a))return a.subarray();if(h.isTypedArray(a)){let b=new(Object.getPrototypeOf(a)).constructor(a.length);d.set(a,b);for(let e=0;e<a.length;e++)b[e]=i(a[e],e,c,d,k);return b}if(a instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&a instanceof SharedArrayBuffer)return a.slice(0);if(a instanceof DataView){let b=new DataView(a.buffer.slice(0),a.byteOffset,a.byteLength);return d.set(a,b),j(b,a,c,d,k),b}if("undefined"!=typeof File&&a instanceof File){let b=new File([a],a.name,{type:a.type});return d.set(a,b),j(b,a,c,d,k),b}if("undefined"!=typeof Blob&&a instanceof Blob){let b=new Blob([a],{type:a.type});return d.set(a,b),j(b,a,c,d,k),b}if(a instanceof Error){let b=new a.constructor;return d.set(a,b),b.message=a.message,b.name=a.name,b.stack=a.stack,b.cause=a.cause,j(b,a,c,d,k),b}if(a instanceof Boolean){let b=new Boolean(a.valueOf());return d.set(a,b),j(b,a,c,d,k),b}if(a instanceof Number){let b=new Number(a.valueOf());return d.set(a,b),j(b,a,c,d,k),b}if(a instanceof String){let b=new String(a.valueOf());return d.set(a,b),j(b,a,c,d,k),b}if("object"==typeof a&&function(a){switch(e.getTag(a)){case f.argumentsTag:case f.arrayTag:case f.arrayBufferTag:case f.dataViewTag:case f.booleanTag:case f.dateTag:case f.float32ArrayTag:case f.float64ArrayTag:case f.int8ArrayTag:case f.int16ArrayTag:case f.int32ArrayTag:case f.mapTag:case f.numberTag:case f.objectTag:case f.regexpTag:case f.setTag:case f.stringTag:case f.symbolTag:case f.uint8ArrayTag:case f.uint8ClampedArrayTag:case f.uint16ArrayTag:case f.uint32ArrayTag:return!0;default:return!1}}(a)){let b=Object.create(Object.getPrototypeOf(a));return d.set(a,b),j(b,a,c,d,k),b}return a}function j(a,b,c=a,e,f){let g=[...Object.keys(b),...d.getSymbols(b)];for(let d=0;d<g.length;d++){let h=g[d],j=Object.getOwnPropertyDescriptor(a,h);(null==j||j.writable)&&(a[h]=i(b[h],h,c,e,f))}}b.cloneDeepWith=function(a,b){return i(a,void 0,a,new Map,b)},b.cloneDeepWithImpl=i,b.copyProperties=j},455511:a=>{"use strict";a.exports=require("crypto")},461821:(a,b,c)=>{"use strict";c.d(b,{A:()=>f,z:()=>e});var d=c(720511),e=d.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:a=>!!a.includes("underline")&&{}}],renderHTML({HTMLAttributes:a}){return["u",(0,d.KV)(this.options.HTMLAttributes,a),0]},parseMarkdown(a,b){return b.applyMark(this.name||"underline",b.parseInline(a.tokens||[]))},renderMarkdown:(a,b)=>`++${b.renderChildren(a)}++`,markdownTokenizer:{name:"underline",level:"inline",start:a=>a.indexOf("++"),tokenize(a,b,c){let d=/^(\+\+)([\s\S]+?)(\+\+)/.exec(a);if(!d)return;let e=d[2].trim();return{type:"underline",raw:d[0],text:e,tokens:c.inlineTokens(e)}}},addCommands(){return{setUnderline:()=>({commands:a})=>a.setMark(this.name),toggleUnderline:()=>({commands:a})=>a.toggleMark(this.name),unsetUnderline:()=>({commands:a})=>a.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),f=e},463912:(a,b,c)=>{"use strict";c.d(b,{j:()=>k});var d=c(736927),e=c(115962);function f(a){if(a<=0)return"now";let b=Math.ceil(a/1e3);if(b<60)return`${b}s`;let c=Math.floor(b/60),d=b%60;if(c<60)return d>0?`${c}m ${d}s`:`${c}m`;let e=Math.floor(c/60),f=c%60;return f>0?`${e}h ${f}m`:`${e}h`}function g(a){return a<1e3?`${a}ms`:a<6e4?`${(a/1e3).toFixed(1)}s`:`${Math.floor(a/6e4)}m ${Math.floor(a%6e4/1e3)}s`}function h(a){switch(a){case"ok":return"var(--color-success, #22c55e)";case"running":return"var(--color-accent)";case"error":return"var(--color-error, #ef4444)";case"disabled":default:return"var(--color-text-muted)";case"skipped":return"var(--color-warning, #f59e0b)"}}function i(a){let[b,c]=(0,e.useState)(Date.now());return a?f(a-b):null}let j=[{id:"overview",label:"Overview"},{id:"calendar",label:"Calendar"},{id:"insights",label:"Insights"}];function k({onSelectJob:a,onSendCommand:b,activeView:c="overview",onViewChange:f,calendarMode:g="month",onCalendarModeChange:h,calendarDate:k,onCalendarDateChange:m}){let[n,o]=(0,e.useState)([]),[p,q]=(0,e.useState)({intervalMs:864e5,nextDueEstimateMs:null}),[r,t]=(0,e.useState)({enabled:!1,nextWakeAtMs:null}),[u,v]=(0,e.useState)(!0),[w,y]=(0,e.useState)([]);(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cron/jobs"),b=await a.json();o(b.jobs??[]),q(b.heartbeat??{intervalMs:864e5,nextDueEstimateMs:null}),t(b.cronStatus??{enabled:!1,nextWakeAtMs:null});let c=(b.jobs??[]).map(a=>a.id).map(async a=>{try{let b=await fetch(`/api/cron/jobs/${encodeURIComponent(a)}/runs?limit=50`);return(await b.json()).entries??[]}catch{return[]}}),d=await Promise.all(c);y(d.flat().toSorted((a,b)=>b.ts-a.ts))}catch{}finally{v(!1)}},[]);let z=i(p.nextDueEstimateMs),A=i(r.nextWakeAtMs);if(u)return(0,d.jsx)("div",{className:"flex items-center justify-center h-full p-8",children:(0,d.jsx)("div",{className:"w-6 h-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})});let B=n.filter(a=>a.enabled),C=n.filter(a=>!a.enabled);return(0,d.jsxs)("div",{className:"p-6 max-w-5xl mx-auto",children:[(0,d.jsx)("div",{className:"flex items-end justify-between mb-6",children:(0,d.jsxs)("div",{children:[(0,d.jsx)("h1",{className:"font-instrument text-3xl tracking-tight mb-1",style:{color:"var(--color-text)"},children:"Cron"}),(0,d.jsxs)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:[B.length," active job",1!==B.length?"s":"",C.length>0&&` / ${C.length} disabled`]})]})}),(0,d.jsx)("div",{className:"flex items-center gap-1 mb-6 rounded-xl p-1",style:{background:"var(--color-surface-hover)"},children:j.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>f?.(a.id),className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-all cursor-pointer",style:{background:c===a.id?"var(--color-surface)":"transparent",color:c===a.id?"var(--color-text)":"var(--color-text-muted)",boxShadow:c===a.id?"var(--shadow-sm)":"none"},children:a.label},a.id))}),"overview"===c&&(0,d.jsx)(l,{jobs:n,enabledJobs:B,disabledJobs:C,heartbeatCountdown:z,heartbeat:p,cronWakeCountdown:A,onSelectJob:a,onSendCommand:b}),"calendar"===c&&(0,d.jsx)(s,{jobs:n,allRuns:w,mode:g,onModeChange:h,dateAnchor:k,onDateChange:m,onSelectJob:a}),"insights"===c&&(0,d.jsx)(x,{jobs:n,allRuns:w,onSelectJob:a})]})}function l({jobs:a,enabledJobs:b,disabledJobs:c,heartbeatCountdown:e,heartbeat:g,cronWakeCountdown:h,onSelectJob:i,onSendCommand:j}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:[(0,d.jsx)(z,{title:"Heartbeat",icon:(0,d.jsx)(D,{}),value:e?`in ${e}`:"unknown",subtitle:`Interval: ${f(g.intervalMs)}`}),(0,d.jsx)(z,{title:"Cron Scheduler",icon:(0,d.jsx)(E,{}),value:h?`next in ${h}`:0===a.length?"no jobs":"idle",subtitle:`${b.length} active / ${a.length} total jobs`}),(0,d.jsx)(z,{title:"Active Runs",icon:(0,d.jsx)(F,{}),value:`${a.filter(a=>a.state.runningAtMs).length}`,subtitle:(()=>{let b=a.filter(a=>a.state.runningAtMs),c=a.filter(a=>"error"===a.state.lastStatus).length;return b.length>0?b.map(a=>a.name).join(", "):c>0?`${c} with errors`:"All clear"})()})]}),(0,d.jsx)(A,{jobs:b}),(0,d.jsx)(B,{jobs:[...b,...c],onSelectJob:i,onSendCommand:j})]})}function m(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function n(a){let b=m(a);return b.setDate(b.getDate()-b.getDay()),b}function o(a,b){let c=m(a);return c.setDate(c.getDate()+b),c}function p(a){return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`}function q(a,b,c){let d=new Set;for(let e of a.split(",")){let a=e.match(/^(.+)\/(\d+)$/),f=a?parseInt(a[2],10):1,g=a?a[1]:e;if("*"===g)for(let a=b;a<=c;a+=f)d.add(a);else if(g.includes("-")){let[a,b]=g.split("-").map(Number);for(let c=a;c<=b;c+=f)d.add(c)}else d.add(parseInt(g,10))}return[...d].filter(a=>a>=b&&a<=c).sort((a,b)=>a-b)}function r({ev:a,onSelectJob:b}){let c=new Date(a.at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if("scheduled"===a.kind)return(0,d.jsxs)("button",{type:"button",onClick:()=>b(a.job.id),className:"w-full text-left text-[10px] px-1.5 py-0.5 rounded truncate cursor-pointer",style:{background:"color-mix(in srgb, var(--color-accent) 15%, transparent)",color:"var(--color-accent)"},title:`Scheduled: ${a.job.name} at ${c}`,children:[c," ",a.job.name]});let e="ok"===a.run.status?"var(--color-success, #22c55e)":"error"===a.run.status?"var(--color-error, #ef4444)":"var(--color-text-muted)";return(0,d.jsxs)("button",{type:"button",onClick:()=>a.job&&b(a.job.id),className:"w-full text-left text-[10px] px-1.5 py-0.5 rounded truncate flex items-center gap-1 cursor-pointer",style:{background:`color-mix(in srgb, ${e} 10%, transparent)`,color:e},title:`${a.run.status??"finished"}: ${a.job?.name??a.run.jobId} at ${c}`,children:[(0,d.jsx)("span",{className:"w-1 h-1 rounded-full flex-shrink-0",style:{background:e}}),(0,d.jsxs)("span",{className:"truncate",children:[c," ",a.job?.name??a.run.jobId.slice(0,8)]})]})}function s({jobs:a,allRuns:b,mode:c="month",onModeChange:f,dateAnchor:g,onDateChange:h,onSelectJob:i}){let j=function(a){if(!a)return null;let b=a.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(b)return new Date(Number(b[1]),Number(b[2])-1,Number(b[3]));let c=new Date(a);return Number.isNaN(c.getTime())?null:m(c)}(g)??m(new Date),k=a=>{let b="month"===c?function(a,b){let c=new Date(a.getFullYear(),a.getMonth(),1);c.setMonth(c.getMonth()+b);let d=new Date(c.getFullYear(),c.getMonth()+1,0).getDate();return c.setDate(Math.min(a.getDate(),d)),c}(j,a):"week"===c?o(j,7*a):"day"===c?o(j,a):function(a,b){let c=new Date(a.getFullYear()+b,a.getMonth(),1),d=new Date(c.getFullYear(),c.getMonth()+1,0).getDate();return c.setDate(Math.min(a.getDate(),d)),c}(j,a);h?.(p(b))},l=(0,e.useMemo)(()=>{let b=new Map;for(let c of a)b.set(c.id,c);return b},[a]),{rangeFrom:r,rangeTo:s}=(0,e.useMemo)(()=>{let a=j.getFullYear(),b=j.getMonth();if("day"===c){let c=new Date(a,b,j.getDate());return{rangeFrom:c.getTime(),rangeTo:o(c,1).getTime()}}if("week"===c){let a=n(j);return{rangeFrom:a.getTime(),rangeTo:o(a,7).getTime()}}if("year"===c)return{rangeFrom:new Date(a,0,1).getTime(),rangeTo:new Date(a+1,0,1).getTime()};let d=n(new Date(a,b,1));return{rangeFrom:d.getTime(),rangeTo:o(d,42).getTime()}},[j,c]),x=(0,e.useMemo)(()=>(function(a,b,c,d,e){let f=new Map,g=Date.now();for(let b of a){let a=b.runAtMs??b.ts;if(a<d||a>=e)continue;let g=p(new Date(a)),h=f.get(g)??[];h.push({kind:"run",run:b,job:c.get(b.jobId),at:a}),f.set(g,h)}for(let a of b)if(a.enabled)for(let b of function(a,b,c){if(!a.enabled)return[];let d=a.schedule;switch(d.kind){case"at":{let a=new Date(d.at).getTime();return a>=b&&a<c?[a]:[]}case"every":{let e=d.everyMs;if(e<=0)return[];let f=d.anchorMs??a.createdAtMs??b,g=[],h=f;if(h<b){let a=Math.floor((b-h)/e);h+=a*e}for(;h<c&&g.length<5e3;)h>=b&&g.push(h),h+=e;return g}case"cron":return function(a,b,c,d){let e=a.trim().split(/\s+/);if(e.length<5)return[];let f=q(e[0],0,59),g=q(e[1],0,23),h=q(e[2],1,31),i=q(e[3],1,12),j=q(e[4],0,6),k="*"===e[2],l="*"===e[4],m=[],n=new Date(b);n.setSeconds(0,0);let o=0;for(;n.getTime()<c&&o++<5e4;){if(!i.includes(n.getMonth()+1)){n.setMonth(n.getMonth()+1,1),n.setHours(0,0,0,0);continue}let a=k||h.includes(n.getDate()),d=l||j.includes(n.getDay());if(!(k&&l||(k||l?a&&d:a||d))){n.setDate(n.getDate()+1),n.setHours(0,0,0,0);continue}for(let a of g)for(let d of f){let e=new Date(n.getFullYear(),n.getMonth(),n.getDate(),a,d,0,0).getTime();e>=b&&e<c&&m.push(e)}n.setDate(n.getDate()+1),n.setHours(0,0,0,0)}return m}(d.expr,b,c,d.tz);default:return[]}}(a,d,e)){if(b<g)continue;let c=p(new Date(b)),d=f.get(c)??[];d.push({kind:"scheduled",job:a,at:b}),f.set(c,d)}for(let a of f.values())a.sort((a,b)=>{if(a.at!==b.at)return a.at-b.at;let c="run"===a.kind?a.job?.name??a.run.jobId:a.job.name,d="run"===b.kind?b.job?.name??b.run.jobId:b.job.name;return c.localeCompare(d)});return f})(b,a,l,r,s),[b,a,l,r,s]),y=(0,e.useMemo)(()=>{if("day"===c)return j.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"});if("week"===c){let a=n(j),b=new Date(a);return(b.setDate(b.getDate()+6),a.getMonth()===b.getMonth())?`${a.toLocaleDateString(void 0,{month:"long"})} ${a.getDate()}–${b.getDate()}, ${a.getFullYear()}`:`${a.toLocaleDateString(void 0,{month:"short",day:"numeric"})} – ${b.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}`}return"year"===c?String(j.getFullYear()):j.toLocaleDateString(void 0,{month:"long",year:"numeric"})},[j,c]),z=p(new Date);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>k(-1),className:"p-1.5 rounded-lg cursor-pointer",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"m15 18-6-6 6-6"})})}),(0,d.jsx)("h2",{className:"text-lg font-semibold",style:{color:"var(--color-text)"},children:y}),(0,d.jsx)("button",{type:"button",onClick:()=>k(1),className:"p-1.5 rounded-lg cursor-pointer",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"m9 18 6-6-6-6"})})}),(0,d.jsx)("button",{type:"button",onClick:()=>h?.(p(new Date)),className:"text-xs px-2.5 py-1 rounded-lg ml-2 cursor-pointer",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:"Today"})]}),(0,d.jsx)("div",{className:"flex items-center gap-1 rounded-lg p-0.5",style:{background:"var(--color-surface-hover)"},children:["day","week","month","year"].map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>f?.(a),className:"px-3 py-1 rounded-md text-xs font-medium cursor-pointer",style:{background:c===a?"var(--color-surface)":"transparent",color:c===a?"var(--color-text)":"var(--color-text-muted)"},children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),"day"===c&&(0,d.jsx)(t,{anchor:j,eventsByDay:x,todayStr:z,onSelectJob:i}),"week"===c&&(0,d.jsx)(u,{anchor:j,eventsByDay:x,todayStr:z,onSelectJob:i,onDateChange:h,onModeChange:f}),"month"===c&&(0,d.jsx)(v,{anchor:j,eventsByDay:x,todayStr:z,onSelectJob:i}),"year"===c&&(0,d.jsx)(w,{anchor:j,eventsByDay:x,todayStr:z,onDateChange:h,onModeChange:f})]})}function t({anchor:a,eventsByDay:b,todayStr:c,onSelectJob:f}){let g=p(a),h=b.get(g)??[],i=g===c,j=Array.from({length:24},(a,b)=>b),k=(0,e.useMemo)(()=>{let a=new Map;for(let b of h){let c=new Date(b.at).getHours(),d=a.get(c)??[];d.push(b),a.set(c,d)}return a},[h]);return(0,d.jsx)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:j.map(a=>{let b=k.get(a)??[],c=new Date().getHours(),e=i&&a===c;return(0,d.jsxs)("div",{className:"flex",style:{borderBottom:a<23?"1px solid var(--color-border)":void 0,background:e?"color-mix(in srgb, var(--color-accent) 4%, transparent)":void 0},children:[(0,d.jsx)("div",{className:"w-16 flex-shrink-0 px-3 py-2 text-right text-[11px] font-medium",style:{color:"var(--color-text-muted)",borderRight:"1px solid var(--color-border)"},children:0===a?"12 AM":a<12?`${a} AM`:12===a?"12 PM":`${a-12} PM`}),(0,d.jsx)("div",{className:"flex-1 min-h-[36px] px-2 py-1 flex flex-wrap gap-1 items-start",children:b.map((a,b)=>(0,d.jsx)(r,{ev:a,onSelectJob:f},b))})]},a)})})}function u({anchor:a,eventsByDay:b,todayStr:c,onSelectJob:e,onDateChange:f,onModeChange:g}){let h=n(a),i=Array.from({length:7},(a,b)=>{let c=new Date(h);return c.setDate(c.getDate()+b),c});return(0,d.jsxs)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"grid grid-cols-7",style:{borderBottom:"1px solid var(--color-border)"},children:i.map(a=>{let b=p(a),e=b===c;return(0,d.jsxs)("button",{type:"button",onClick:()=>{f?.(b),g?.("day")},className:"px-2 py-2 text-center cursor-pointer",style:{borderRight:6>a.getDay()?"1px solid var(--color-border)":void 0},children:[(0,d.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:a.toLocaleDateString(void 0,{weekday:"short"})}),(0,d.jsx)("div",{className:"text-sm font-semibold",style:{color:e?"var(--color-accent)":"var(--color-text)"},children:a.getDate()})]},b)})}),(0,d.jsx)("div",{className:"grid grid-cols-7",children:i.map(a=>{let f=p(a),g=b.get(f)??[],h=f===c;return(0,d.jsx)("div",{className:"min-h-[200px] p-1.5",style:{borderRight:6>a.getDay()?"1px solid var(--color-border)":void 0,background:h?"color-mix(in srgb, var(--color-accent) 4%, transparent)":void 0},children:(0,d.jsxs)("div",{className:"space-y-0.5",children:[g.slice(0,8).map((a,b)=>(0,d.jsx)(r,{ev:a,onSelectJob:e},b)),g.length>8&&(0,d.jsxs)("div",{className:"text-[9px] px-1",style:{color:"var(--color-text-muted)"},children:["+",g.length-8," more"]})]})},f)})})]})}function v({anchor:a,eventsByDay:b,todayStr:c,onSelectJob:f}){let g=(0,e.useMemo)(()=>{let b=n(new Date(a.getFullYear(),a.getMonth(),1)),c=[];for(let a=0;a<6;a++){let d=[];for(let c=0;c<7;c++){let e=new Date(b);e.setDate(e.getDate()+7*a+c),d.push(e)}c.push(d)}return c},[a]);return(0,d.jsxs)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"grid grid-cols-7",style:{borderBottom:"1px solid var(--color-border)"},children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(a=>(0,d.jsx)("div",{className:"px-2 py-2 text-center text-[11px] font-medium uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:a},a))}),g.map((e,g)=>(0,d.jsx)("div",{className:"grid grid-cols-7",style:{borderBottom:g<5?"1px solid var(--color-border)":void 0},children:e.map(e=>{let g=p(e),h=b.get(g)??[],i=e.getMonth()===a.getMonth(),j=g===c;return(0,d.jsxs)("div",{className:"min-h-[80px] p-1.5",style:{borderRight:6>e.getDay()?"1px solid var(--color-border)":void 0,opacity:i?1:.4,background:j?"color-mix(in srgb, var(--color-accent) 5%, transparent)":void 0},children:[(0,d.jsx)("div",{className:"text-xs font-medium mb-1",style:{color:j?"var(--color-accent)":"var(--color-text-muted)"},children:e.getDate()}),(0,d.jsxs)("div",{className:"space-y-0.5",children:[h.slice(0,3).map((a,b)=>(0,d.jsx)(r,{ev:a,onSelectJob:f},b)),h.length>3&&(0,d.jsxs)("div",{className:"text-[9px] px-1",style:{color:"var(--color-text-muted)"},children:["+",h.length-3," more"]})]})]},g)})},g))]})}function w({anchor:a,eventsByDay:b,todayStr:c,onDateChange:e,onModeChange:f}){let g=a.getFullYear(),h=Array.from({length:12},(a,b)=>b);return(0,d.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-4",children:h.map(a=>{let h=new Date(g,a,1),i=h.getDay(),j=new Date(g,a+1,0).getDate(),k=[];for(let a=0;a<i;a++)k.push(null);for(let a=1;a<=j;a++)k.push(a);return(0,d.jsxs)("button",{type:"button",onClick:()=>{e?.(p(h)),f?.("month")},className:"rounded-xl p-3 text-left cursor-pointer transition-colors",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="var(--color-surface)"},children:[(0,d.jsx)("div",{className:"text-xs font-semibold mb-2",style:{color:"var(--color-text)"},children:h.toLocaleDateString(void 0,{month:"short"})}),(0,d.jsxs)("div",{className:"grid grid-cols-7 gap-px",children:[["S","M","T","W","T","F","S"].map((a,b)=>(0,d.jsx)("div",{className:"text-[8px] text-center font-medium",style:{color:"var(--color-text-muted)"},children:a},b)),k.map((e,f)=>{if(null===e)return(0,d.jsx)("div",{},`e-${f}`);let h=`${g}-${String(a+1).padStart(2,"0")}-${String(e).padStart(2,"0")}`,i=b.get(h)??[],j=h===c,k=i.length>0,l=i.some(a=>"run"===a.kind&&"error"===a.run.status);return(0,d.jsx)("div",{className:"text-[9px] text-center rounded-sm leading-[16px]",style:{color:j?"var(--color-accent)":k?"var(--color-text)":"var(--color-text-muted)",fontWeight:j||k?600:400,background:l?"color-mix(in srgb, var(--color-error, #ef4444) 15%, transparent)":k?"color-mix(in srgb, var(--color-accent) 10%, transparent)":void 0},children:e},h)})]}),(()=>{let c=0;for(let d=1;d<=j;d++){let e=`${g}-${String(a+1).padStart(2,"0")}-${String(d).padStart(2,"0")}`;c+=(b.get(e)??[]).length}return c>0?(0,d.jsxs)("div",{className:"text-[9px] mt-1.5",style:{color:"var(--color-text-muted)"},children:[c," event",1!==c?"s":""]}):null})()]},a)})})}function x({jobs:a,allRuns:b,onSelectJob:c}){let f=(0,e.useMemo)(()=>{let c=b.length,d=b.filter(a=>"ok"===a.status).length,e=b.filter(a=>"error"===a.status).length,f=c>0?b.filter(a=>null!=a.durationMs).reduce((a,b)=>a+(b.durationMs??0),0)/Math.max(1,b.filter(a=>null!=a.durationMs).length):0,g=c>0?Math.round(d/c*100):0,h=Date.now(),i=[];for(let a=13;a>=0;a--){let c=h-864e5*a,d=c+864e5,e=b.filter(a=>a.ts>=c&&a.ts<d),f=new Date(c);i.push({day:`${f.getMonth()+1}/${f.getDate()}`,ok:e.filter(a=>"ok"===a.status).length,error:e.filter(a=>"error"===a.status).length,other:e.filter(a=>"ok"!==a.status&&"error"!==a.status).length})}return{total:c,ok:d,errors:e,avgDuration:f,successRate:g,runsByDay:i,jobStats:a.map(a=>{let c=b.filter(b=>b.jobId===a.id),d=c.filter(a=>"ok"===a.status).length,e=c.filter(a=>"error"===a.status).length,f=c.filter(a=>null!=a.durationMs).length>0?c.filter(a=>null!=a.durationMs).reduce((a,b)=>a+(b.durationMs??0),0)/c.filter(a=>null!=a.durationMs).length:0;return{job:a,runs:c.length,ok:d,errors:e,avgDuration:f}}).toSorted((a,b)=>b.runs-a.runs)}},[b,a]);return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,d.jsx)(y,{label:"Total Runs",value:String(f.total)}),(0,d.jsx)(y,{label:"Success Rate",value:`${f.successRate}%`,accent:f.successRate>=90?"var(--color-success, #22c55e)":f.successRate>=70?"var(--color-warning, #f59e0b)":"var(--color-error, #ef4444)"}),(0,d.jsx)(y,{label:"Errors",value:String(f.errors),accent:f.errors>0?"var(--color-error, #ef4444)":void 0}),(0,d.jsx)(y,{label:"Avg Duration",value:g(f.avgDuration)})]}),(0,d.jsxs)("div",{className:"rounded-2xl p-4",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsx)("h3",{className:"text-xs font-medium uppercase tracking-wider mb-4",style:{color:"var(--color-text-muted)"},children:"Runs (Last 14 Days)"}),(0,d.jsx)("div",{className:"flex items-end gap-1 h-32",children:f.runsByDay.map(a=>{let b=Math.max(...f.runsByDay.map(a=>a.ok+a.error+a.other),1),c=a.ok+a.error+a.other,e=Math.max(2,c/b*100),g=c>0?a.ok/c*100:100;return(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1",children:[(0,d.jsx)("div",{className:"w-full flex flex-col justify-end",style:{height:"100%"},children:(0,d.jsx)("div",{className:"w-full rounded-t-sm",style:{height:`${e}%`,background:0===c?"var(--color-surface-hover)":100===g?"var(--color-success, #22c55e)":g>50?"color-mix(in srgb, var(--color-success, #22c55e) 60%, var(--color-error, #ef4444))":"var(--color-error, #ef4444)",opacity:0===c?.3:.7},title:`${a.day}: ${a.ok} ok, ${a.error} errors`})}),(0,d.jsx)("span",{className:"text-[9px]",style:{color:"var(--color-text-muted)"},children:a.day})]},a.day)})}),(0,d.jsxs)("div",{className:"flex items-center gap-4 mt-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:"var(--color-success, #22c55e)",opacity:.7}}),(0,d.jsx)("span",{className:"text-[10px]",style:{color:"var(--color-text-muted)"},children:"Success"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:"var(--color-error, #ef4444)",opacity:.7}}),(0,d.jsx)("span",{className:"text-[10px]",style:{color:"var(--color-text-muted)"},children:"Error"})]})]})]}),(0,d.jsxs)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--color-border)"},children:(0,d.jsx)("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:"Per-Job Breakdown"})}),f.jobStats.map(a=>{let b=a.runs>0?Math.round(a.ok/a.runs*100):0;return(0,d.jsxs)("button",{type:"button",onClick:()=>c(a.job.id),className:"w-full flex items-center gap-3 px-4 py-3 text-left cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--color-border)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:a.job.name}),(0,d.jsxs)("div",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:[a.runs," runs / ",b,"% success / avg ",g(a.avgDuration)]})]}),(0,d.jsx)("div",{className:"w-24 h-2 rounded-full overflow-hidden flex-shrink-0",style:{background:"var(--color-surface-hover)"},children:(0,d.jsx)("div",{className:"h-full rounded-full",style:{width:`${b}%`,background:b>=90?"var(--color-success, #22c55e)":b>=70?"var(--color-warning, #f59e0b)":"var(--color-error, #ef4444)"}})}),null!=a.job.state.consecutiveErrors&&a.job.state.consecutiveErrors>0&&(0,d.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0",style:{background:"color-mix(in srgb, var(--color-error, #ef4444) 12%, transparent)",color:"var(--color-error, #ef4444)"},children:[a.job.state.consecutiveErrors," err"]})]},a.job.id)})]})]})}function y({label:a,value:b,accent:c}){return(0,d.jsxs)("div",{className:"rounded-xl p-3",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-wider mb-1",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("div",{className:"text-xl font-semibold",style:{color:c??"var(--color-text)"},children:b})]})}function z({title:a,icon:b,value:c,subtitle:e}){return(0,d.jsxs)("div",{className:"rounded-2xl p-4",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,d.jsx)("span",{style:{color:"var(--color-accent)"},children:b}),(0,d.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:a})]}),(0,d.jsx)("div",{className:"text-lg font-semibold mb-0.5",style:{color:"var(--color-text)"},children:c}),(0,d.jsx)("div",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:e})]})}function A({jobs:a}){let[b,c]=(0,e.useState)(Date.now()),g=a.filter(a=>a.state.nextRunAtMs&&a.state.nextRunAtMs>b&&a.state.nextRunAtMs<b+864e5).toSorted((a,b)=>(a.state.nextRunAtMs??0)-(b.state.nextRunAtMs??0));return 0===g.length?null:(0,d.jsxs)("div",{className:"mb-8",children:[(0,d.jsx)("h2",{className:"text-sm font-medium uppercase tracking-wider mb-3",style:{color:"var(--color-text-muted)"},children:"Upcoming (next 24h)"}),(0,d.jsx)("div",{className:"rounded-2xl p-4",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("div",{className:"absolute top-0 left-3 bottom-0 w-px",style:{background:"var(--color-border)"}}),(0,d.jsx)("div",{className:"space-y-3",children:g.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-3 pl-1",children:[(0,d.jsx)("div",{className:"relative z-10 w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"var(--color-accent)",opacity:.8},children:(0,d.jsx)("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--color-bg)"}})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:a.name}),(0,d.jsxs)("span",{className:"text-xs ml-2",style:{color:"var(--color-text-muted)"},children:["in ",f((a.state.nextRunAtMs??0)-b)]})]}),(0,d.jsx)("span",{className:"text-[11px] flex-shrink-0",style:{color:"var(--color-text-muted)"},children:new Date(a.state.nextRunAtMs).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]},a.id))})]})})]})}function B({jobs:a,onSelectJob:b,onSendCommand:c}){return(0,d.jsxs)("div",{className:"mb-6",children:[(0,d.jsx)("h2",{className:"text-sm font-medium uppercase tracking-wider mb-3",style:{color:"var(--color-text-muted)"},children:"Jobs"}),0===a.length?(0,d.jsx)("div",{className:"p-8 text-center rounded-2xl",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:(0,d.jsx)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"No cron jobs configured."})}):(0,d.jsx)("div",{className:"rounded-2xl overflow-hidden",style:{border:"1px solid var(--color-border)",background:"var(--color-surface)"},children:(0,d.jsxs)("table",{className:"w-full text-sm",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{style:{borderBottom:"1px solid var(--color-border)",color:"var(--color-text-muted)"},children:[(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Name"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Schedule"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Status"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Next Run"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider",children:"Last Run"}),(0,d.jsx)("th",{className:"text-left px-4 py-2.5 font-medium text-xs uppercase tracking-wider w-20"})]})}),(0,d.jsx)("tbody",{children:a.map(a=>(0,d.jsx)(C,{job:a,onClick:()=>b(a.id),onSendCommand:c},a.id))})]})})]})}function C({job:a,onClick:b,onSendCommand:c}){let i=a.enabled?a.state.runningAtMs?"running":a.state.lastStatus??"idle":"disabled",j=h(i),[k,l]=(0,e.useState)(Date.now());return(0,d.jsxs)("tr",{className:"cursor-pointer transition-colors group",style:{borderBottom:"1px solid var(--color-border)"},onClick:b,onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsxs)("td",{className:"px-4 py-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"font-medium",style:{color:"var(--color-text)"},children:a.name}),null!=a.state.consecutiveErrors&&a.state.consecutiveErrors>0&&(0,d.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full",style:{background:"color-mix(in srgb, var(--color-error, #ef4444) 12%, transparent)",color:"var(--color-error, #ef4444)"},children:[a.state.consecutiveErrors," err"]})]}),a.description&&(0,d.jsx)("div",{className:"text-xs truncate max-w-[200px]",style:{color:"var(--color-text-muted)"},children:a.description})]}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs",style:{color:"var(--color-text-muted)"},children:function(a){switch(a.kind){case"cron":return`cron: ${a.expr}${a.tz?` (${a.tz})`:""}`;case"every":{let b=a.everyMs;if(b>=864e5)return`every ${Math.round(b/864e5)}d`;if(b>=36e5)return`every ${Math.round(b/36e5)}h`;if(b>=6e4)return`every ${Math.round(b/6e4)}m`;return`every ${Math.round(b/1e3)}s`}case"at":return`at ${a.at}`;default:return"unknown"}}(a.schedule)}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs px-2 py-0.5 rounded-full",style:{background:`color-mix(in srgb, ${j} 12%, transparent)`,color:j},children:["running"===i&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{background:j}}),i]})}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs",style:{color:"var(--color-text-muted)"},children:a.state.nextRunAtMs?a.state.nextRunAtMs>k?`in ${f(a.state.nextRunAtMs-k)}`:"overdue":"-"}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[a.state.lastStatus&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:h(a.state.lastStatus)}}),(0,d.jsx)("span",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:a.state.lastRunAtMs?`${function(a){let b=Date.now()-a;return b<6e4?"just now":b<36e5?`${Math.floor(b/6e4)}m ago`:b<864e5?`${Math.floor(b/36e5)}h ago`:`${Math.floor(b/864e5)}d ago`}(a.state.lastRunAtMs)}${a.state.lastDurationMs?` (${g(a.state.lastDurationMs)})`:""}`:"-"})]})}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-1 md:opacity-0 md:group-hover:opacity-100 transition-opacity",children:[!a.state.runningAtMs&&a.enabled&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),c?.(`Run cron job "${a.name}" (${a.id}) now with --force`)},className:"p-1 rounded cursor-pointer",style:{color:"var(--color-accent)"},title:"Run now",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polygon",{points:"6 3 20 12 6 21 6 3"})})}),(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),c?.(`${a.enabled?"Disable":"Enable"} cron job "${a.name}" (${a.id})`)},className:"p-1 rounded cursor-pointer",style:{color:a.enabled?"var(--color-text-muted)":"var(--color-success, #22c55e)"},title:a.enabled?"Disable":"Enable",children:a.enabled?(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("path",{d:"m4.93 4.93 14.14 14.14"})]}):(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})})})]})})]})}function D(){return(0,d.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M19.5 12.572l-7.5 7.428l-7.5 -7.428a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572"})})}function E(){return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}function F(){return(0,d.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polygon",{points:"6 3 20 12 6 21 6 3"})})}},464867:(a,b,c)=>{"use strict";c.d(b,{v:()=>y});var d=c(736927),e=c(115962),f=c(327629),g=c(437503),h=c(930439),i=c(444949),j=c(51161),k=c(535798),l=c(987221),m=c(665466),n=c(85969);let o=["today","yesterday","this_week","last_week","this_month"];function p(a,b){return a.getFullYear()===b.getFullYear()&&a.getMonth()===b.getMonth()&&a.getDate()===b.getDate()}function q({personId:a,onOpenPerson:b,onOpenCompany:c}){let[g,h]=(0,e.useState)([]),[i,k]=(0,e.useState)(0),[l,m]=(0,e.useState)(0),[n,q]=(0,e.useState)(!1),[r,t]=(0,e.useState)(!0),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),A=(0,e.useCallback)(async(b,c)=>{let d=await fetch(`/api/crm/people/${encodeURIComponent(a)}/activity?limit=100&offset=${b}`,{cache:"no-store",signal:c});if(!d.ok)throw Error(`HTTP ${d.status}`);return await d.json()},[a]),B=(0,e.useCallback)(async()=>{if(!u&&n){v(!0);try{let a=await A(l);if(!a)return;h(b=>[...b,...a.activities]),q(a.has_more),m(b=>b+a.activities.length)}catch(a){x(a instanceof Error?a.message:"Failed to load more activity.")}finally{v(!1)}}},[n,A,u,l]),C=(0,e.useMemo)(()=>{let a=new Date,b=new Map;for(let c of g){let d=function(a,b){if(null==a)return"unknown";let c="string"==typeof a?Date.parse(a):a instanceof Date?a.getTime():a;if(!Number.isFinite(c))return"unknown";let d=new Date(c);if(p(d,b))return"today";let e=new Date(b);if(e.setDate(b.getDate()-1),p(d,e))return"yesterday";let f=function(a){let b=new Date(a),c=b.getDay();return b.setDate(b.getDate()-(c+6)%7),b.setHours(0,0,0,0),b}(b),g=new Date(f);g.setDate(f.getDate()-7);let h=new Date(f);if(d>=f&&d<=b)return"this_week";if(d>=g&&d<h)return"last_week";if(d.getFullYear()===b.getFullYear()&&d.getMonth()===b.getMonth())return"this_month";let i=d.getFullYear(),j=String(d.getMonth()+1).padStart(2,"0");return`older:${i}-${j}`}(c.occurred_at,a);b.has(d)||b.set(d,[]),b.get(d).push(c)}return Array.from(b.entries()).sort(([a],[b])=>(function(a,b){let c=o.indexOf(a),d=o.indexOf(b);return -1!==c&&-1!==d?c-d:-1!==c?-1:-1!==d||"unknown"===a?1:"unknown"===b?-1:a<b?1:a>b?-1:0})(a,b))},[g]);return r&&0===g.length?(0,d.jsx)(j.ux,{label:"Loading activity…"}):w&&0===g.length?(0,d.jsx)(j.HF,{title:"Couldn't load activity",description:w}):0===g.length?(0,d.jsx)(j.HF,{title:"No activity yet",description:"Emails and meetings appear here once they're synced."}):(0,d.jsxs)("div",{className:"space-y-6",children:[C.map(([a,e])=>(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"sticky top-0 z-[1] mb-2 px-1 py-1 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)",background:"var(--color-background)"},children:function(a){switch(a){case"today":return"Today";case"yesterday":return"Yesterday";case"this_week":return"Earlier this week";case"last_week":return"Last week";case"this_month":return"Earlier this month";case"unknown":return"Unknown date";default:{let b=/^older:(\d{4})-(\d{2})$/.exec(a);if(!b)return a;let c=Number(b[1]),d=Number(b[2])-1;return new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(new Date(c,d,1))}}}(a)}),(0,d.jsx)("ul",{className:"space-y-2",children:e.map(a=>(0,d.jsx)(s,{row:a,expanded:y===a.id,onToggle:()=>z(b=>b===a.id?null:a.id),onOpenPerson:b,onOpenCompany:c},a.id))})]},a)),n&&(0,d.jsx)("div",{className:"flex justify-center pt-2",children:(0,d.jsx)(f.$,{type:"button",variant:"outline",size:"sm",onClick:B,disabled:u,children:u?"Loading…":`Show more (${(i-g.length).toLocaleString()} remaining)`})}),w&&g.length>0&&(0,d.jsx)("p",{className:"text-center text-[12px]",style:{color:"var(--color-text-muted)"},children:w})]})}let r={Sent:{label:"You",color:"#22c55e"},Received:{label:"Them",color:"#3b82f6"},Internal:{label:"Internal",color:"#94a3b8"}};function s({row:a,expanded:b,onToggle:c,onOpenPerson:e,onOpenCompany:f}){let g=a.direction?r[a.direction]:null,h=g?`${g.color}1a`:"var(--color-surface-hover)",i=g?g.color:"var(--color-text-muted)",j="Email"===a.type?a.email?.subject?.trim()||"(no subject)":a.event?.title?.trim()||"(no title)";return(0,d.jsxs)("li",{className:"rounded-xl border overflow-hidden",style:{borderColor:b?"var(--color-accent)":"var(--color-border)",background:"var(--color-surface)",transition:"border-color 120ms ease"},children:[(0,d.jsxs)("div",{role:"button",tabIndex:0,"aria-expanded":b,onClick:c,onKeyDown:a=>{a.target===a.currentTarget&&("Enter"===a.key||" "===a.key)&&(a.preventDefault(),c())},className:"grid w-full items-start gap-3 px-4 py-3 text-left cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] transition-colors",style:{gridTemplateColumns:"auto minmax(0, 1fr) auto"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full shrink-0",style:{background:h,color:i},"aria-hidden":!0,children:"Email"===a.type?(0,d.jsx)(v,{}):(0,d.jsx)(w,{})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"font-instrument truncate",style:{color:"var(--color-text)",fontSize:14,fontWeight:600},children:j}),g&&(0,d.jsx)("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full px-1.5 py-0 text-[10px] uppercase tracking-[0.06em]",style:{background:`${g.color}1f`,color:g.color,fontWeight:600},children:g.label})]}),(0,d.jsx)(t,{row:a})]}),(0,d.jsx)("span",{className:"text-right text-[11px] tabular-nums shrink-0",style:{color:"var(--color-text-muted)"},title:a.occurred_at?(0,k.Vv)(a.occurred_at):void 0,children:a.occurred_at&&(0,k.wI)(a.occurred_at)})]}),(0,d.jsx)("div",{className:"grid transition-[grid-template-rows] duration-[220ms] ease-out motion-reduce:transition-none",style:{gridTemplateRows:b?"1fr":"0fr"},children:(0,d.jsx)("div",{className:"overflow-hidden",children:b&&(0,d.jsx)(u,{row:a,onOpenPerson:e,onOpenCompany:f})})})]})}function t({row:a}){if("Email"===a.type&&a.email){let b=a.email.from?.name?.trim()||a.email.from?.email||null,c=a.email.snippet?.trim();return b||c?(0,d.jsxs)("p",{className:"mt-0.5 truncate text-[13px]",style:{color:"var(--color-text-muted)",fontFamily:'"Bookerly", Georgia, "Times New Roman", serif'},children:[b&&(0,d.jsx)("span",{style:{color:"var(--color-text)"},children:b}),b&&c&&(0,d.jsxs)("span",{children:[" — ",c]}),!b&&c]}):null}if("Meeting"===a.type&&a.event){let b=function(a,b){if(!a)return null;let c=new Date(a);if(Number.isNaN(c.getTime()))return null;let d=new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(c);if(!b)return d;let e=new Date(b);if(Number.isNaN(e.getTime()))return d;let f=new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(e);return`${d} – ${f}`}(a.event.start_at,a.event.end_at),c=a.event.meeting_type;return b||c?(0,d.jsxs)("p",{className:"mt-0.5 text-[12px]",style:{color:"var(--color-text-muted)"},children:[b,b&&c&&" \xb7 ",c]}):null}return null}function u({row:a,onOpenPerson:b,onOpenCompany:c}){return"Email"===a.type?a.email?.thread_id?(0,d.jsx)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-background)"},children:(0,d.jsx)(n.X,{threadId:a.email.thread_id,recipientName:a.email.from?.name??a.email.from?.email??null,onOpenPerson:b,autoScrollOnLoad:!1,showReply:!1})}):(0,d.jsx)("div",{className:"border-t px-4 py-4 text-[12px]",style:{borderColor:"var(--color-border)",background:"var(--color-background)",color:"var(--color-text-muted)"},children:"The thread for this message is no longer available."}):"Meeting"===a.type&&a.event?(0,d.jsx)(m.I,{eventId:a.event.id,fallbackEvent:{id:a.event.id,title:a.event.title,start_at:a.event.start_at,end_at:a.event.end_at,meeting_type:a.event.meeting_type},onOpenPerson:b,onOpenCompany:c}):null}function v(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,d.jsx)("path",{d:"m3 7 9 6 9-6"})]})}function w(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("rect",{x:"3",y:"4",width:"18",height:"17",rx:"2"}),(0,d.jsx)("path",{d:"M3 10h18"}),(0,d.jsx)("path",{d:"M8 2v4"}),(0,d.jsx)("path",{d:"M16 2v4"})]})}let x=[{id:"overview",label:"Overview"},{id:"emails",label:"Emails",getCount:a=>a.threads.length},{id:"calendar",label:"Meetings",getCount:a=>a.events.length},{id:"activity",label:"Activity",getCount:a=>a.interactions_summary.total},{id:"notes",label:"Notes"}];function y({personId:a,onOpenPerson:b,onOpenCompany:c,onBackToList:g}){let[h,i]=(0,e.useState)(null),[k,l]=(0,e.useState)(!0),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)("overview");return((0,e.useCallback)(async()=>{l(!0),n(null);try{let b=await fetch(`/api/crm/people/${encodeURIComponent(a)}`,{cache:"no-store"});if(404===b.status){n("Person not found."),i(null);return}if(!b.ok){let a=await b.json().catch(()=>({}));throw Error(a.error??`HTTP ${b.status}`)}let c=await b.json();i(c)}catch(a){n(a instanceof Error?a.message:"Failed to load person.")}finally{l(!1)}},[a]),k&&!h)?(0,d.jsx)("div",{className:"flex h-full flex-col",style:{background:"var(--color-background)"},children:(0,d.jsx)(j.ux,{label:"Loading profile…"})}):m||!h?(0,d.jsx)("div",{className:"flex h-full flex-col",style:{background:"var(--color-background)"},children:(0,d.jsx)(j.HF,{title:"Couldn't load this contact",description:m??"The record may have been deleted.",cta:g&&(0,d.jsx)(f.$,{variant:"outline",size:"sm",onClick:g,children:"Back to People"})})}):(0,d.jsxs)("div",{className:"flex h-full min-h-0 flex-col",style:{background:"var(--color-background)"},children:[(0,d.jsx)(z,{data:h,tab:o,onTabChange:p,onOpenCompany:c,onBackToList:g}),(0,d.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,d.jsxs)("div",{className:"mx-auto w-full max-w-4xl px-6 py-6",children:["overview"===o&&(0,d.jsx)(A,{data:h,onOpenCompany:c}),"emails"===o&&(0,d.jsx)(B,{data:h,onOpenPerson:b}),"calendar"===o&&(0,d.jsx)(C,{data:h,onOpenPerson:b,onOpenCompany:c}),"activity"===o&&(0,d.jsx)(D,{data:h,onOpenPerson:b,onOpenCompany:c}),"notes"===o&&(0,d.jsx)(E,{data:h})]})})]})}function z({data:a,tab:b,onTabChange:c,onOpenCompany:e,onBackToList:f}){let{person:j,company:k,derived_website:l}=a,m=j.name?.trim()||j.email||"Unknown contact",n=k?.website||l;return(0,d.jsxs)("header",{className:"shrink-0 px-6 pt-4 pb-0",style:{borderBottom:"1px solid var(--color-border)",background:"var(--color-background)"},children:[(0,d.jsx)("div",{className:"mb-3 flex items-center gap-2 text-[12px]",style:{color:"var(--color-text-muted)"},children:f&&(0,d.jsxs)("button",{type:"button",onClick:f,className:"inline-flex items-center gap-1 hover:underline",children:[(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,d.jsx)("path",{d:"m15 18-6-6 6-6"})}),"People"]})}),(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)(g.X,{src:j.avatar_url,name:m,seed:j.email??j.id,size:"xl"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[(0,d.jsx)("h1",{className:"font-instrument text-3xl tracking-tight truncate",style:{color:"var(--color-text)"},children:m}),(0,d.jsx)(i.q,{score:j.strength_score})]}),(0,d.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[13px]",children:[j.email&&(0,d.jsx)("a",{href:`mailto:${j.email}`,className:"hover:underline truncate",style:{color:"var(--color-text-muted)"},children:j.email}),k&&e&&(0,d.jsxs)("button",{type:"button",onClick:()=>e(k.id),className:"inline-flex items-center gap-1.5 hover:underline",style:{color:"var(--color-text-muted)"},children:[(0,d.jsx)(h.g,{domain:k.domain,name:k.name,size:"sm"}),(0,d.jsx)("span",{children:k.name??k.domain})]}),n&&(0,d.jsx)("a",{href:n,target:"_blank",rel:"noreferrer",className:"hover:underline",style:{color:"var(--color-text-muted)"},children:n.replace(/^https?:\/\//,"")})]}),(j.job_title||j.phone||j.linkedin_url)&&(0,d.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px]",style:{color:"var(--color-text-muted)"},children:[j.job_title&&(0,d.jsx)("span",{children:j.job_title}),j.phone&&(0,d.jsx)("span",{children:j.phone}),j.linkedin_url&&(0,d.jsx)("a",{href:j.linkedin_url,target:"_blank",rel:"noreferrer",className:"hover:underline",children:"LinkedIn"})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[j.email&&(0,d.jsx)("a",{href:`mailto:${j.email}`,className:"inline-flex h-8 w-8 items-center justify-center rounded-lg",style:{background:"var(--color-surface)",color:"var(--color-text-muted)",border:"1px solid var(--color-border)"},title:"Compose email",children:(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,d.jsx)("path",{d:"m3 7 9 6 9-6"})]})}),j.email&&(0,d.jsx)("a",{href:`https://mail.google.com/mail/u/0/#search/${encodeURIComponent("from:"+j.email+" OR to:"+j.email)}`,target:"_blank",rel:"noreferrer",className:"inline-flex h-8 w-8 items-center justify-center rounded-lg",style:{background:"var(--color-surface)",color:"var(--color-text-muted)",border:"1px solid var(--color-border)"},title:"Open in Gmail",children:(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,d.jsx)("path",{d:"M15 3h6v6"}),(0,d.jsx)("path",{d:"M10 14 21 3"}),(0,d.jsx)("path",{d:"M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"})]})})]})]}),(0,d.jsx)("div",{className:"mt-5 flex items-center gap-4 -mb-px",children:x.map(e=>{let f=e.getCount?.(a),g=e.id===b;return(0,d.jsxs)("button",{type:"button",onClick:()=>c(e.id),className:"relative flex items-center gap-1.5 px-1 py-2 text-[13px] font-medium transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)",borderBottom:g?"2px solid var(--color-text)":"2px solid transparent"},children:[e.label,"number"==typeof f&&f>0&&(0,d.jsx)("span",{className:"rounded-full px-1.5 py-0 text-[10px]",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:f})]},e.id)})})]})}function A({data:a,onOpenCompany:b}){let{person:c,company:e,interactions_summary:f}=a;return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:"At a glance"}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,d.jsx)(F,{label:"Strength",value:c.strength_label}),(0,d.jsx)(F,{label:"Last contact",value:c.last_interaction_at?(0,k.wI)(c.last_interaction_at):"—"}),(0,d.jsx)(F,{label:"Emails",value:f.email_count.toLocaleString()}),(0,d.jsx)(F,{label:"Meetings",value:f.meeting_count.toLocaleString()})]})]}),(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:"Contact"}),(0,d.jsxs)("div",{className:"space-y-2.5 rounded-2xl border p-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)(G,{label:"Email",value:c.email,link:c.email?`mailto:${c.email}`:void 0}),(0,d.jsx)(G,{label:"Phone",value:c.phone,link:c.phone?`tel:${c.phone}`:void 0}),(0,d.jsx)(G,{label:"LinkedIn",value:c.linkedin_url,link:c.linkedin_url??void 0,external:!0}),(0,d.jsx)(G,{label:"Job title",value:c.job_title}),(0,d.jsx)(G,{label:"Status",value:c.status}),(0,d.jsx)(G,{label:"Source",value:c.source})]})]}),e&&(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:"Company"}),(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(e.id),disabled:!b,className:"flex w-full items-center gap-3 rounded-2xl border p-4 text-left transition-colors disabled:cursor-default",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},onMouseEnter:a=>{b&&(a.currentTarget.style.borderColor="var(--color-accent)")},onMouseLeave:a=>{b&&(a.currentTarget.style.borderColor="var(--color-border)")},children:[(0,d.jsx)(h.g,{domain:e.domain,name:e.name,size:"lg"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:e.name??e.domain??"Unknown company"}),(e.domain||e.industry)&&(0,d.jsx)("p",{className:"mt-0.5 text-[12px]",style:{color:"var(--color-text-muted)"},children:[e.domain,e.industry].filter(Boolean).join(" \xb7 ")})]}),(0,d.jsx)(i.q,{score:e.strength_score})]})]})]})}function B({data:a,onOpenPerson:b}){return 0===a.threads.length?(0,d.jsx)(j.HF,{title:"No threads with this contact yet",description:"Threads appear here as soon as Gmail is connected and the next sync tick runs."}):(0,d.jsx)(l.A,{threads:a.threads,onOpenPerson:b})}function C({data:a,onOpenPerson:b,onOpenCompany:c}){let[f,g]=(0,e.useState)(null);if(0===a.events.length)return(0,d.jsx)(j.HF,{title:"No meetings with this contact",description:"Once Calendar is connected and the next sync runs, meetings show up here."});let h=new Map;for(let b of a.events){let a=b.start_at?(0,k._H)(b.start_at):"Unknown date";h.has(a)||h.set(a,[]),h.get(a).push(b)}return(0,d.jsx)("div",{className:"space-y-6",children:Array.from(h.entries()).map(([a,e])=>(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"sticky top-0 z-10 mb-2 px-1 py-1 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)",background:"var(--color-background)"},children:a}),(0,d.jsx)("ul",{className:"space-y-2",children:e.map(a=>(0,d.jsx)(m.E,{event:a,expanded:f===a.id,onToggle:()=>g(b=>b===a.id?null:a.id),onOpenPerson:b,onOpenCompany:c},a.id))})]},a))})}function D({data:a,onOpenPerson:b,onOpenCompany:c}){let e=a.interactions_summary;return 0===e.total?(0,d.jsx)(j.HF,{title:"No activity yet",description:"Emails and meetings appear here once they're synced."}):(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("section",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,d.jsx)(F,{label:"Interactions",value:e.total.toLocaleString()}),(0,d.jsx)(F,{label:"Emails",value:e.email_count.toLocaleString()}),(0,d.jsx)(F,{label:"Meetings",value:e.meeting_count.toLocaleString()}),(0,d.jsx)(F,{label:"Last reply",value:e.last_inbound_at?(0,k.wI)(e.last_inbound_at):"—"})]}),e.last_outbound_at&&(0,d.jsx)("div",{className:"rounded-2xl border px-4 py-3 text-[13px]",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:(0,d.jsxs)("p",{style:{color:"var(--color-text-muted)"},children:["You last reached out"," ",(0,d.jsx)("strong",{style:{color:"var(--color-text)"},children:(0,k.wI)(e.last_outbound_at)}),"."]})})]}),(0,d.jsxs)("section",{children:[(0,d.jsx)("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:"Timeline"}),(0,d.jsx)(q,{personId:a.person.id,onOpenPerson:b,onOpenCompany:c})]})]})}function E({data:a}){return a.person.notes?.trim()?(0,d.jsx)("article",{className:"prose prose-sm max-w-none",style:{color:"var(--color-text)"},children:(0,d.jsx)("pre",{style:{whiteSpace:"pre-wrap",fontFamily:"inherit"},children:a.person.notes})}):(0,d.jsx)(j.HF,{title:"No notes yet",description:"Notes added in the People object detail panel will show up here."})}function F({label:a,value:b}){return(0,d.jsxs)("div",{className:"rounded-2xl border p-3",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("dd",{className:"mt-1 text-[14px] font-medium",style:{color:"var(--color-text)"},children:b})]})}function G({label:a,value:b,link:c,external:e}){if(!b)return(0,d.jsxs)("div",{className:"flex items-baseline gap-3 text-[13px]",children:[(0,d.jsx)("dt",{className:"w-24 shrink-0",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("dd",{style:{color:"var(--color-text-muted)"},children:"—"})]});let f=c?(0,d.jsx)("a",{href:c,target:e?"_blank":void 0,rel:e?"noreferrer":void 0,className:"hover:underline truncate",style:{color:"var(--color-text)"},children:b}):(0,d.jsx)("span",{className:"truncate",style:{color:"var(--color-text)"},children:b});return(0,d.jsxs)("div",{className:"flex items-baseline gap-3 text-[13px] min-w-0",children:[(0,d.jsx)("dt",{className:"w-24 shrink-0",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("dd",{className:"min-w-0",children:f})]})}e.useMemo},468549:(a,b)=>{!function(a){"undefined"==typeof DO_NOT_EXPORT_BESSEL?a(b):a({})}(function(a){a.version="1.0.2";var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=Math;function s(a,b){for(var c=0,d=0;c<a.length;++c)d=b*d+a[c];return d}function t(a,b,c,d,e){if(0===b)return c;if(1===b)return d;for(var f=2/a,g=d,h=1;h<b;++h)g=d*h*f+e*c,c=d,d=g;return g}function u(a,b,c,d,e){return function(c,f){if(d){if(0===c)return 1==d?-1/0:1/0;else if(c<0)return NaN}if(0===f)return a(c);if(1===f)return b(c);if(f<0)return NaN;f|=0;var g=a(c),h=b(c);return t(c,f,g,h,e)}}var v=function(){var a=[0xd6759744e,-0x31c78f292,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse(),b=[0xd675973ab,0x3d5d6d39,9494680.718,59272.64853,267.8532712,1].reverse(),c=[1,-.001098628627,2734510407e-14,-2073370639e-15,2093887211e-16].reverse(),d=[-.01562499995,1430488765e-13,-6911147651e-15,7621095161e-16,-934935152e-16].reverse();function e(e){var f=0,g=0,h=0,i=e*e;if(e<8)f=(g=s(a,i))/(h=s(b,i));else{var j=e-.785398164;g=s(c,i=64/i),h=s(d,i),f=r.sqrt(.636619772/e)*(r.cos(j)*g-r.sin(j)*h*8/e)}return f}var f=[0x10d925ddd8,-0x1d6950b23,242396853.1,-2972611.439,15704.4826,-30.16036606].reverse(),g=[0x21b24bbb9a,0x891f618a,18583304.74,99447.43394,376.9991397,1].reverse(),h=[1,.00183105,-3516396496e-14,2457520174e-15,-240337019e-15].reverse(),i=[.04687499995,-2002690873e-13,8449199096e-15,-88228987e-14,105787412e-15].reverse();function j(a){var b=0,c=0,d=0,e=a*a,j=r.abs(a)-2.356194491;return 8>Math.abs(a)?b=(c=a*s(f,e))/(d=s(g,e)):(c=s(h,e=64/e),d=s(i,e),b=r.sqrt(.636619772/r.abs(a))*(r.cos(j)*c-r.sin(j)*d*8/r.abs(a)),a<0&&(b=-b)),b}return function a(b,c){if(c=Math.round(c),!isFinite(b))return isNaN(b)?b:0;if(c<0)return(c%2?-1:1)*a(b,-c);if(b<0)return(c%2?-1:1)*a(-b,c);if(0===c)return e(b);if(1===c)return j(b);if(0===b)return 0;var d=0;if(b>c)d=t(b,c,e(b),j(b),-1);else{for(var f=2*r.floor((c+r.floor(r.sqrt(40*c)))/2),g=!1,h=0,i=0,k=1,l=0,m=2/b,n=f;n>0;n--)l=n*m*k-h,h=k,k=l,r.abs(k)>1e10&&(k*=1e-10,h*=1e-10,d*=1e-10,i*=1e-10),g&&(i+=k),g=!g,n==c&&(d=h);d/=i=2*i-k}return d}}(),w=(b=[-0xb04cc5cd,0x1a4fa4b91,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),c=[0x954bf890d,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),d=[1,-.001098628627,2734510407e-14,-2073370639e-15,2093887211e-16].reverse(),e=[-.01562499995,1430488765e-13,-6911147651e-15,7621095161e-16,-934945152e-16].reverse(),f=[-4900604943e3,127527439e4,-0xbffb0414e,734926455.1,-4237922.726,8511.937935].reverse(),g=[249958057e5,0x62d2b66f40,0xde8afbbf,22459040.02,102042.605,354.9632885,1].reverse(),h=[1,.00183105,-3516396496e-14,2457520174e-15,-240337019e-15].reverse(),i=[.04687499995,-2002690873e-13,8449199096e-15,-88228987e-14,105787412e-15].reverse(),u(function(a){var f=0,g=0,h=0,i=a*a,j=a-.785398164;return a<8?f=(g=s(b,i))/(h=s(c,i))+.636619772*v(a,0)*r.log(a):(g=s(d,i=64/i),h=s(e,i),f=r.sqrt(.636619772/a)*(r.sin(j)*g+r.cos(j)*h*8/a)),f},function(a){var b=0,c=0,d=0,e=a*a,j=a-2.356194491;return a<8?b=(c=a*s(f,e))/(d=s(g,e))+.636619772*(v(a,1)*r.log(a)-1/a):(c=s(h,e=64/e),d=s(i,e),b=r.sqrt(.636619772/a)*(r.sin(j)*c+r.cos(j)*d*8/a)),b},"BESSELY",1,-1)),x=(j=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),k=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),l=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),m=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse(),function a(b,c){if(0===(c=Math.round(c)))return b<=3.75?s(j,b*b/14.0625):r.exp(r.abs(b))/r.sqrt(r.abs(b))*s(k,3.75/r.abs(b));if(1===c)return b<3.75?b*s(l,b*b/14.0625):(b<0?-1:1)*r.exp(r.abs(b))/r.sqrt(r.abs(b))*s(m,3.75/r.abs(b));if(c<0)return NaN;if(0===r.abs(b))return 0;if(b==1/0)return 1/0;var d,e=0,f=2/r.abs(b),g=0,h=1,i=0;for(d=2*r.round((c+r.round(r.sqrt(40*c)))/2);d>0;d--)i=d*f*h+g,g=h,h=i,r.abs(h)>1e10&&(h*=1e-10,g*=1e-10,e*=1e-10),d==c&&(e=g);return e*=a(b,0)/h,b<0&&c%2?-e:e}),y=(n=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),o=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse(),p=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),q=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse(),u(function(a){return a<=2?-r.log(a/2)*x(a,0)+s(n,a*a/4):r.exp(-a)/r.sqrt(a)*s(o,2/a)},function(a){return a<=2?r.log(a/2)*x(a,1)+1/a*s(p,a*a/4):r.exp(-a)/r.sqrt(a)*s(q,2/a)},"BESSELK",2,1));a.besselj=v,a.bessely=w,a.besseli=x,a.besselk=y})},472827:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isSymbol=function(a){return"symbol"==typeof a||a instanceof Symbol}},477288:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),!function(a,b){for(var c in b)Object.defineProperty(a,c,{enumerable:!0,get:b[c]})}(b,{ReadonlyURLSearchParams:function(){return k},RedirectType:function(){return e.RedirectType},forbidden:function(){return g.forbidden},notFound:function(){return f.notFound},permanentRedirect:function(){return d.permanentRedirect},redirect:function(){return d.redirect},unauthorized:function(){return h.unauthorized},unstable_isUnrecognizedActionError:function(){return l},unstable_rethrow:function(){return i.unstable_rethrow}});let d=c(627441),e=c(171298),f=c(173),g=c(26032),h=c(843155),i=c(430083);class j extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class k extends URLSearchParams{append(){throw new j}delete(){throw new j}set(){throw new j}sort(){throw new j}}function l(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},478425:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});var d=c(115962),e={outline:{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"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};let f=(a,b,c,f)=>{let g=(0,d.forwardRef)(({color:c="currentColor",size:g=24,stroke:h=2,title:i,className:j,children:k,...l},m)=>(0,d.createElement)("svg",{ref:m,...e[a],width:g,height:g,className:["tabler-icon",`tabler-icon-${b}`,j].join(" "),..."filled"===a?{fill:c}:{strokeWidth:h,stroke:c},...l},[i&&(0,d.createElement)("title",{key:"svg-title"},i),...f.map(([a,b])=>(0,d.createElement)(a,b)),...Array.isArray(k)?k:[k]]));return g.displayName=`${c}`,g}},478853:(a,b,c)=>{"use strict";c.d(b,{K:()=>o,w:()=>n});for(var d={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},e={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},f="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),g="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),h=0;h<10;h++)d[48+h]=d[96+h]=String(h);for(var h=1;h<=24;h++)d[h+111]="F"+h;for(var h=65;h<=90;h++)d[h]=String.fromCharCode(h+32),e[h]=String.fromCharCode(h);for(var i in d)e.hasOwnProperty(i)||(e[i]=d[i]);var j=c(381802);let k="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),l="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function m(a,b,c=!0){return b.altKey&&(a="Alt-"+a),b.ctrlKey&&(a="Ctrl-"+a),b.metaKey&&(a="Meta-"+a),c&&b.shiftKey&&(a="Shift-"+a),a}function n(a){return new j.k_({props:{handleKeyDown:o(a)}})}function o(a){let b=function(a){let b=Object.create(null);for(let c in a)b[function(a){let b,c,d,e,f=a.split(/-(?!$)/),g=f[f.length-1];"Space"==g&&(g=" ");for(let a=0;a<f.length-1;a++){let g=f[a];if(/^(cmd|meta|m)$/i.test(g))e=!0;else if(/^a(lt)?$/i.test(g))b=!0;else if(/^(c|ctrl|control)$/i.test(g))c=!0;else if(/^s(hift)?$/i.test(g))d=!0;else if(/^mod$/i.test(g))k?e=!0:c=!0;else throw Error("Unrecognized modifier name: "+g)}return b&&(g="Alt-"+g),c&&(g="Ctrl-"+g),e&&(g="Meta-"+g),d&&(g="Shift-"+g),g}(c)]=a[c];return b}(a);return function(a,c){var h;let i=("Esc"==(h=!(f&&c.metaKey&&c.shiftKey&&!c.ctrlKey&&!c.altKey||g&&c.shiftKey&&c.key&&1==c.key.length||"Unidentified"==c.key)&&c.key||(c.shiftKey?e:d)[c.keyCode]||c.key||"Unidentified")&&(h="Escape"),"Del"==h&&(h="Delete"),"Left"==h&&(h="ArrowLeft"),"Up"==h&&(h="ArrowUp"),"Right"==h&&(h="ArrowRight"),"Down"==h&&(h="ArrowDown"),h),j,k=b[m(i,c)];if(k&&k(a.state,a.dispatch,a))return!0;if(1==i.length&&" "!=i){if(c.shiftKey){let d=b[m(i,c,!1)];if(d&&d(a.state,a.dispatch,a))return!0}if((c.altKey||c.metaKey||c.ctrlKey)&&!(l&&c.ctrlKey&&c.altKey)&&(j=d[c.keyCode])&&j!=i){let d=b[m(j,c)];if(d&&d(a.state,a.dispatch,a))return!0}}return!1}}},479466:(a,b,c)=>{"use strict";c.d(b,{o:()=>e});var d=c(845722);function e(a,b){let c=(0,d.a)(a,b?.in);return c.setHours(0,0,0,0),c}},486230:(a,b,c)=>{"use strict";c.d(b,{WorkspaceShell:()=>d});let d=(0,c(872665).registerClientReference)(function(){throw Error("Attempted to call WorkspaceShell() from the server but WorkspaceShell is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/DenchClaw/DenchClaw/apps/web/app/workspace/workspace-content.tsx","WorkspaceShell")},490654:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(478425).A)("filled","database-filled","DatabaseFilled",[["path",{d:"M3 15.731c1.968 1.507 5.234 2.269 9 2.269c3.76 0 7.025 -.76 9 -2.252v2.252c0 2.425 -3.895 3.936 -8.693 3.998l-.307 .002c-4.938 0 -9 -1.523 -9 -4z",key:"svg-0"}],["path",{d:"M3 9.731c1.968 1.507 5.234 2.269 9 2.269c3.76 0 7.025 -.76 9 -2.252v2.252c0 2.477 -4.062 4 -9 4c-4.798 0 -8.77 -1.438 -8.979 -3.795l-.016 -.101l-.005 -.104z",key:"svg-1"}],["path",{d:"M12 2c1.041 0 2.044 .068 2.977 .198l.469 .071q .84 .14 1.586 .348l.44 .131l.075 .024a11 11 0 0 1 .805 .3l.199 .086q .535 .242 .967 .53q .165 .11 .313 .225a3.8 3.8 0 0 1 .669 .668l.091 .128q .07 .105 .129 .211l.07 .139q .163 .35 .2 .73l.01 .211c0 2.477 -4.062 4 -9 4c-4.798 0 -8.77 -1.438 -8.979 -3.795a1 1 0 0 1 -.021 -.205l.005 -.104l.016 -.1c.205 -2.306 4.01 -3.733 8.667 -3.794z",key:"svg-2"}]])},496230:(a,b,c)=>{"use strict";c.d(b,{L:()=>e});var d=c(115962);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(!0),[f,g]=(0,d.useState)(!1),[h,i]=(0,d.useState)(null),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)(null),[n,o]=(0,d.useState)(null),[p,q]=(0,d.useState)(null),[r,s]=(0,d.useState)(!1),t=(0,d.useRef)(!0);(0,d.useRef)(1e3);let u=(0,d.useRef)(0),[v,w]=(0,d.useState)(0),x=(0,d.useRef)(new Map),y=(0,d.useCallback)(a=>{let b=x.current,c=new Map,d=a=>a.map(a=>{let e=b.get(a.path),f=a;return"object"===a.type&&!a.defaultView&&e?.defaultView&&(f={...a,defaultView:e.defaultView}),"object"===f.type&&c.set(f.path,{type:f.type,defaultView:f.defaultView}),f.children&&f.children.length>0&&(f={...f,children:d(f.children)}),f}),e=d(a);return x.current=c,e},[]),z=(0,d.useCallback)(async()=>{let a=++u.current;try{let c=r?"?showHidden=1":"",d=await fetch(`/api/workspace/tree${c}`),f=await d.json();t.current&&u.current===a&&(b(y(f.tree??[])),g(f.exists??!1),m(f.workspaceRoot??null),o(f.openclawDir??null),q(f.workspace??f.profile??null),e(!1))}catch{t.current&&u.current===a&&e(!1)}},[r,y]),A=(0,d.useCallback)(async a=>{let c=++u.current;try{e(!0);let d=r?"&showHidden=1":"",f=await fetch(`/api/workspace/browse?dir=${encodeURIComponent(a)}${d}`),h=await f.json();t.current&&u.current===c&&(b(h.entries??[]),k(h.parentDir??null),g(!0),e(!1))}catch{t.current&&u.current===c&&e(!1)}},[r]),B=(0,d.useRef)(null),C=(0,d.useCallback)(a=>{let b=a;null!=a&&l&&a===l&&(b=null),null!=b&&b!==B.current&&e(!0),B.current=b,i(b)},[l]),D=(0,d.useCallback)(async()=>{h?await A(h):await z()},[h,A,z]);return{tree:a,loading:c,exists:f,refresh:(0,d.useCallback)(()=>{D()},[D]),reconnect:(0,d.useCallback)(()=>{w(a=>a+1),D()},[D]),browseDir:h,setBrowseDir:C,parentDir:j,workspaceRoot:l,openclawDir:n,activeWorkspace:p,showHidden:r,setShowHidden:s}}},497001:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(122053),e=c(653913),f=c(537889);b.minBy=function(a,b){if(null!=a)return d.minBy(Array.from(a),f.iteratee(b??e.identity))}},500419:(a,b,c)=>{"use strict";c.d(b,{G:()=>g});var d=c(736927),e=c(115962);function f({state:a}){return"loading"===a?(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:(0,d.jsx)("path",{d:"M21 12a9 9 0 1 1-9-9"})}):"playing"===a?(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,d.jsx)("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1"}),(0,d.jsx)("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1"})]}):(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),(0,d.jsx)("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),(0,d.jsx)("path",{d:"M19 5a10 10 0 0 1 0 14"})]})}function g({text:a}){let[b,c]=(0,e.useState)("idle"),g=(0,e.useRef)(null),h=(0,e.useRef)(null),i=()=>{g.current?.pause(),g.current=null,h.current&&(URL.revokeObjectURL(h.current),h.current=null),c("idle")},j=async()=>{if("loading"!==b){if("playing"===b)return void i();c("loading");try{let b=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})});if(!b.ok)throw Error("Failed to generate audio.");h.current&&URL.revokeObjectURL(h.current);let d=URL.createObjectURL(await b.blob());h.current=d;let e=new Audio(d);g.current=e,e.addEventListener("ended",i,{once:!0}),await e.play(),c("playing")}catch{c("error"),window.setTimeout(()=>c("idle"),2e3)}}};return(0,d.jsx)("button",{type:"button",onClick:()=>void j(),className:"p-1 rounded-md transition-colors",style:{color:"error"===b?"var(--color-error, #ef4444)":"var(--color-text-muted)"},title:"playing"===b?"Stop voice playback":"Play voice","aria-label":"playing"===b?"Stop voice playback":"Play voice",children:(0,d.jsx)(f,{state:b})})}},502044:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(422623);b.throttle=function(a,b=0,c={}){let{leading:e=!0,trailing:f=!0}=c;return d.debounce(a,b,{leading:e,maxWait:b,trailing:f})}},502714:(a,b,c)=>{"use strict";c.d(b,{w:()=>e});var d=c(585698);function e(a,b){return"function"==typeof a?a(b):a&&"object"==typeof a&&d._P in a?a[d._P](b):a instanceof Date?new a.constructor(b):new Date(b)}},505033:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(648438),e=c(783037),f=c(439384),g=c(882351);b.isIterateeCall=function(a,b,c){return!!f.isObject(c)&&(!!("number"==typeof b&&e.isArrayLike(c)&&d.isIndex(b))&&b<c.length||"string"==typeof b&&b in c)&&g.isEqualsSameValueZero(c[b],a)}},509078:(a,b,c)=>{"use strict";c.d(b,{tz:()=>cC,Ip:()=>cE,kt:()=>cF,K5:()=>cG,vL:()=>cH,Rc:()=>cD});var d,e,f,g=c(736927),h=c(115962),i=c.t(h,2),j=c(42813),k=c(155897),l=c(430792),m=c(687193),n=c(988447);function o(a){let b=a+"CollectionProvider",[c,d]=(0,k.A)(b),[e,f]=c(b,{collectionRef:{current:null},itemMap:new Map}),i=a=>{let{scope:b,children:c}=a,d=h.useRef(null),f=h.useRef(new Map).current;return(0,g.jsx)(e,{scope:b,itemMap:f,collectionRef:d,children:c})};i.displayName=b;let j=a+"CollectionSlot",l=(0,n.TL)(j),o=h.forwardRef((a,b)=>{let{scope:c,children:d}=a,e=f(j,c),h=(0,m.s)(b,e.collectionRef);return(0,g.jsx)(l,{ref:h,children:d})});o.displayName=j;let p=a+"CollectionItemSlot",q="data-radix-collection-item",r=(0,n.TL)(p),s=h.forwardRef((a,b)=>{let{scope:c,children:d,...e}=a,i=h.useRef(null),j=(0,m.s)(b,i),k=f(p,c);return h.useEffect(()=>(k.itemMap.set(i,{ref:i,...e}),()=>void k.itemMap.delete(i))),(0,g.jsx)(r,{...{[q]:""},ref:j,children:d})});return s.displayName=p,[{Provider:i,Slot:o,ItemSlot:s},function(b){let c=f(a+"CollectionConsumer",b);return h.useCallback(()=>{let a=c.collectionRef.current;if(!a)return[];let b=Array.from(a.querySelectorAll(`[${q}]`));return Array.from(c.itemMap.values()).sort((a,c)=>b.indexOf(a.ref.current)-b.indexOf(c.ref.current))},[c.collectionRef,c.itemMap])},d]}var p=new WeakMap;function q(a,b){if("at"in Array.prototype)return Array.prototype.at.call(a,b);let c=function(a,b){let c=a.length,d=r(b),e=d>=0?d:c+d;return e<0||e>=c?-1:e}(a,b);return -1===c?void 0:a[c]}function r(a){return a!=a||0===a?0:Math.trunc(a)}(class a extends Map{#a;constructor(a){super(a),this.#a=[...super.keys()],p.set(this,!0)}set(a,b){return p.get(this)&&(this.has(a)?this.#a[this.#a.indexOf(a)]=a:this.#a.push(a)),super.set(a,b),this}insert(a,b,c){let d,e=this.has(b),f=this.#a.length,g=r(a),h=g>=0?g:f+g,i=h<0||h>=f?-1:h;if(i===this.size||e&&i===this.size-1||-1===i)return this.set(b,c),this;let j=this.size+ +!e;g<0&&h++;let k=[...this.#a],l=!1;for(let a=h;a<j;a++)if(h===a){let f=k[a];k[a]===b&&(f=k[a+1]),e&&this.delete(b),d=this.get(f),this.set(b,c)}else{l||k[a-1]!==b||(l=!0);let c=k[l?a:a-1],e=d;d=this.get(c),this.delete(c),this.set(c,e)}return this}with(b,c,d){let e=new a(this);return e.insert(b,c,d),e}before(a){let b=this.#a.indexOf(a)-1;if(!(b<0))return this.entryAt(b)}setBefore(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d,b,c)}after(a){let b=this.#a.indexOf(a);if(-1!==(b=-1===b||b===this.size-1?-1:b+1))return this.entryAt(b)}setAfter(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d+1,b,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#a=[],super.clear()}delete(a){let b=super.delete(a);return b&&this.#a.splice(this.#a.indexOf(a),1),b}deleteAt(a){let b=this.keyAt(a);return void 0!==b&&this.delete(b)}at(a){let b=q(this.#a,a);if(void 0!==b)return this.get(b)}entryAt(a){let b=q(this.#a,a);if(void 0!==b)return[b,this.get(b)]}indexOf(a){return this.#a.indexOf(a)}keyAt(a){return q(this.#a,a)}from(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return d;c++}}findIndex(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return c;c++}return -1}filter(b,c){let d=[],e=0;for(let a of this)Reflect.apply(b,c,[a,e,this])&&d.push(a),e++;return new a(d)}map(b,c){let d=[],e=0;for(let a of this)d.push([a[0],Reflect.apply(b,c,[a,e,this])]),e++;return new a(d)}reduce(...a){let[b,c]=a,d=0,e=c??this.at(0);for(let c of this)e=0===d&&1===a.length?c:Reflect.apply(b,this,[e,c,d,this]),d++;return e}reduceRight(...a){let[b,c]=a,d=c??this.at(-1);for(let c=this.size-1;c>=0;c--){let e=this.at(c);d=c===this.size-1&&1===a.length?e:Reflect.apply(b,this,[d,e,c,this])}return d}toSorted(b){return new a([...this.entries()].sort(b))}toReversed(){let b=new a;for(let a=this.size-1;a>=0;a--){let c=this.keyAt(a),d=this.get(c);b.set(c,d)}return b}toSpliced(...b){let c=[...this.entries()];return c.splice(...b),new a(c)}slice(b,c){let d=new a,e=this.size-1;if(void 0===b)return d;b<0&&(b+=this.size),void 0!==c&&c>0&&(e=c-1);for(let a=b;a<=e;a++){let b=this.keyAt(a),c=this.get(b);d.set(b,c)}return d}every(a,b){let c=0;for(let d of this){if(!Reflect.apply(a,b,[d,c,this]))return!1;c++}return!0}some(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return!0;c++}return!1}});var s=h.createContext(void 0);function t(a){let b=h.useContext(s);return a||b||"ltr"}function u(a){let b=h.useRef(a);return h.useEffect(()=>{b.current=a}),h.useMemo(()=>(...a)=>b.current?.(...a),[])}var v="dismissableLayer.update",w=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),x=h.forwardRef((a,b)=>{let{disableOutsidePointerEvents:c=!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:i,onInteractOutside:k,onDismiss:n,...o}=a,p=h.useContext(w),[q,r]=h.useState(null),s=q?.ownerDocument??globalThis?.document,[,t]=h.useState({}),x=(0,m.s)(b,a=>r(a)),A=Array.from(p.layers),[B]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=A.indexOf(B),D=q?A.indexOf(q):-1,E=p.layersWithOutsidePointerEventsDisabled.size>0,F=D>=C,G=function(a,b=globalThis?.document){let c=u(a),d=h.useRef(!1),e=h.useRef(()=>{});return h.useEffect(()=>{let a=a=>{if(a.target&&!d.current){let d=function(){z("dismissableLayer.pointerDownOutside",c,f,{discrete:!0})},f={originalEvent:a};"touch"===a.pointerType?(b.removeEventListener("click",e.current),e.current=d,b.addEventListener("click",e.current,{once:!0})):d()}else b.removeEventListener("click",e.current);d.current=!1},f=window.setTimeout(()=>{b.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(f),b.removeEventListener("pointerdown",a),b.removeEventListener("click",e.current)}},[b,c]),{onPointerDownCapture:()=>d.current=!0}}(a=>{let b=a.target,c=[...p.branches].some(a=>a.contains(b));F&&!c&&(f?.(a),k?.(a),a.defaultPrevented||n?.())},s),H=function(a,b=globalThis?.document){let c=u(a),d=h.useRef(!1);return h.useEffect(()=>{let a=a=>{a.target&&!d.current&&z("dismissableLayer.focusOutside",c,{originalEvent:a},{discrete:!1})};return b.addEventListener("focusin",a),()=>b.removeEventListener("focusin",a)},[b,c]),{onFocusCapture:()=>d.current=!0,onBlurCapture:()=>d.current=!1}}(a=>{let b=a.target;![...p.branches].some(a=>a.contains(b))&&(i?.(a),k?.(a),a.defaultPrevented||n?.())},s);return!function(a,b=globalThis?.document){let c=u(a);h.useEffect(()=>{let a=a=>{"Escape"===a.key&&c(a)};return b.addEventListener("keydown",a,{capture:!0}),()=>b.removeEventListener("keydown",a,{capture:!0})},[c,b])}(a=>{D===p.layers.size-1&&(d?.(a),!a.defaultPrevented&&n&&(a.preventDefault(),n()))},s),h.useEffect(()=>{if(q)return c&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(e=s.body.style.pointerEvents,s.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(q)),p.layers.add(q),y(),()=>{c&&1===p.layersWithOutsidePointerEventsDisabled.size&&(s.body.style.pointerEvents=e)}},[q,s,c,p]),h.useEffect(()=>()=>{q&&(p.layers.delete(q),p.layersWithOutsidePointerEventsDisabled.delete(q),y())},[q,p]),h.useEffect(()=>{let a=()=>t({});return document.addEventListener(v,a),()=>document.removeEventListener(v,a)},[]),(0,g.jsx)(l.sG.div,{...o,ref:x,style:{pointerEvents:E?F?"auto":"none":void 0,...a.style},onFocusCapture:(0,j.mK)(a.onFocusCapture,H.onFocusCapture),onBlurCapture:(0,j.mK)(a.onBlurCapture,H.onBlurCapture),onPointerDownCapture:(0,j.mK)(a.onPointerDownCapture,G.onPointerDownCapture)})});function y(){let a=new CustomEvent(v);document.dispatchEvent(a)}function z(a,b,c,{discrete:d}){let e=c.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:c});b&&e.addEventListener(a,b,{once:!0}),d?(0,l.hO)(e,f):e.dispatchEvent(f)}x.displayName="DismissableLayer",h.forwardRef((a,b)=>{let c=h.useContext(w),d=h.useRef(null),e=(0,m.s)(b,d);return h.useEffect(()=>{let a=d.current;if(a)return c.branches.add(a),()=>{c.branches.delete(a)}},[c.branches]),(0,g.jsx)(l.sG.div,{...a,ref:e})}).displayName="DismissableLayerBranch";var A=0;function B(){let a=document.createElement("span");return a.setAttribute("data-radix-focus-guard",""),a.tabIndex=0,a.style.outline="none",a.style.opacity="0",a.style.position="fixed",a.style.pointerEvents="none",a}var C="focusScope.autoFocusOnMount",D="focusScope.autoFocusOnUnmount",E={bubbles:!1,cancelable:!0},F=h.forwardRef((a,b)=>{let{loop:c=!1,trapped:d=!1,onMountAutoFocus:e,onUnmountAutoFocus:f,...i}=a,[j,k]=h.useState(null),n=u(e),o=u(f),p=h.useRef(null),q=(0,m.s)(b,a=>k(a)),r=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(d){let a=function(a){if(r.paused||!j)return;let b=a.target;j.contains(b)?p.current=b:I(p.current,{select:!0})},b=function(a){if(r.paused||!j)return;let b=a.relatedTarget;null!==b&&(j.contains(b)||I(p.current,{select:!0}))};document.addEventListener("focusin",a),document.addEventListener("focusout",b);let c=new MutationObserver(function(a){if(document.activeElement===document.body)for(let b of a)b.removedNodes.length>0&&I(j)});return j&&c.observe(j,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",b),c.disconnect()}}},[d,j,r.paused]),h.useEffect(()=>{if(j){J.add(r);let a=document.activeElement;if(!j.contains(a)){let b=new CustomEvent(C,E);j.addEventListener(C,n),j.dispatchEvent(b),b.defaultPrevented||(function(a,{select:b=!1}={}){let c=document.activeElement;for(let d of a)if(I(d,{select:b}),document.activeElement!==c)return}(G(j).filter(a=>"A"!==a.tagName),{select:!0}),document.activeElement===a&&I(j))}return()=>{j.removeEventListener(C,n),setTimeout(()=>{let b=new CustomEvent(D,E);j.addEventListener(D,o),j.dispatchEvent(b),b.defaultPrevented||I(a??document.body,{select:!0}),j.removeEventListener(D,o),J.remove(r)},0)}}},[j,n,o,r]);let s=h.useCallback(a=>{if(!c&&!d||r.paused)return;let b="Tab"===a.key&&!a.altKey&&!a.ctrlKey&&!a.metaKey,e=document.activeElement;if(b&&e){let b=a.currentTarget,[d,f]=function(a){let b=G(a);return[H(b,a),H(b.reverse(),a)]}(b);d&&f?a.shiftKey||e!==f?a.shiftKey&&e===d&&(a.preventDefault(),c&&I(f,{select:!0})):(a.preventDefault(),c&&I(d,{select:!0})):e===b&&a.preventDefault()}},[c,d,r.paused]);return(0,g.jsx)(l.sG.div,{tabIndex:-1,...i,ref:q,onKeyDown:s})});function G(a){let b=[],c=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{let b="INPUT"===a.tagName&&"hidden"===a.type;return a.disabled||a.hidden||b?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;c.nextNode();)b.push(c.currentNode);return b}function H(a,b){for(let c of a)if(!function(a,{upTo:b}){if("hidden"===getComputedStyle(a).visibility)return!0;for(;a&&(void 0===b||a!==b);){if("none"===getComputedStyle(a).display)return!0;a=a.parentElement}return!1}(c,{upTo:b}))return c}function I(a,{select:b=!1}={}){if(a&&a.focus){var c;let d=document.activeElement;a.focus({preventScroll:!0}),a!==d&&(c=a)instanceof HTMLInputElement&&"select"in c&&b&&a.select()}}F.displayName="FocusScope";var J=function(){let a=[];return{add(b){let c=a[0];b!==c&&c?.pause(),(a=K(a,b)).unshift(b)},remove(b){a=K(a,b),a[0]?.resume()}}}();function K(a,b){let c=[...a],d=c.indexOf(b);return -1!==d&&c.splice(d,1),c}var L=c(880696),M=i[" useId ".trim().toString()]||(()=>void 0),N=0;function O(a){let[b,c]=h.useState(M());return(0,L.N)(()=>{a||c(a=>a??String(N++))},[a]),a||(b?`radix-${b}`:"")}var P=c(973815),Q=c(178103),R=h.forwardRef((a,b)=>{let{children:c,width:d=10,height:e=5,...f}=a;return(0,g.jsx)(l.sG.svg,{...f,ref:b,width:d,height:e,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?c:(0,g.jsx)("polygon",{points:"0,0 30,0 15,10"})})});R.displayName="Arrow";var S=c(534864),T="Popper",[U,V]=(0,k.A)(T),[W,X]=U(T),Y=a=>{let{__scopePopper:b,children:c}=a,[d,e]=h.useState(null);return(0,g.jsx)(W,{scope:b,anchor:d,onAnchorChange:e,children:c})};Y.displayName=T;var Z="PopperAnchor",_=h.forwardRef((a,b)=>{let{__scopePopper:c,virtualRef:d,...e}=a,f=X(Z,c),i=h.useRef(null),j=(0,m.s)(b,i),k=h.useRef(null);return h.useEffect(()=>{let a=k.current;k.current=d?.current||i.current,a!==k.current&&f.onAnchorChange(k.current)}),d?null:(0,g.jsx)(l.sG.div,{...e,ref:j})});_.displayName=Z;var aa="PopperContent",[ab,ac]=U(aa),ad=h.forwardRef((a,b)=>{let{__scopePopper:c,side:d="bottom",sideOffset:e=0,align:f="center",alignOffset:i=0,arrowPadding:j=0,avoidCollisions:k=!0,collisionBoundary:n=[],collisionPadding:o=0,sticky:p="partial",hideWhenDetached:q=!1,updatePositionStrategy:r="optimized",onPlaced:s,...t}=a,v=X(aa,c),[w,x]=h.useState(null),y=(0,m.s)(b,a=>x(a)),[z,A]=h.useState(null),B=(0,S.X)(z),C=B?.width??0,D=B?.height??0,E="number"==typeof o?o:{top:0,right:0,bottom:0,left:0,...o},F=Array.isArray(n)?n:[n],G=F.length>0,H={padding:E,boundary:F.filter(ah),altBoundary:G},{refs:I,floatingStyles:J,placement:K,isPositioned:M,middlewareData:N}=(0,P.we)({strategy:"fixed",placement:d+("center"!==f?"-"+f:""),whileElementsMounted:(...a)=>(0,Q.ll)(...a,{animationFrame:"always"===r}),elements:{reference:v.anchor},middleware:[(0,P.cY)({mainAxis:e+D,alignmentAxis:i}),k&&(0,P.BN)({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?(0,P.ER)():void 0,...H}),k&&(0,P.UU)({...H}),(0,P.Ej)({...H,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}}),z&&(0,P.UE)({element:z,padding:j}),ai({arrowWidth:C,arrowHeight:D}),q&&(0,P.jD)({strategy:"referenceHidden",...H})]}),[O,R]=aj(K),T=u(s);(0,L.N)(()=>{M&&T?.()},[M,T]);let U=N.arrow?.x,V=N.arrow?.y,W=N.arrow?.centerOffset!==0,[Y,Z]=h.useState();return(0,L.N)(()=>{w&&Z(window.getComputedStyle(w).zIndex)},[w]),(0,g.jsx)("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:M?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,g.jsx)(ab,{scope:c,placedSide:O,onArrowChange:A,arrowX:U,arrowY:V,shouldHideArrow:W,children:(0,g.jsx)(l.sG.div,{"data-side":O,"data-align":R,...t,ref:y,style:{...t.style,animation:M?void 0:"none"}})})})});ad.displayName=aa;var ae="PopperArrow",af={top:"bottom",right:"left",bottom:"top",left:"right"},ag=h.forwardRef(function(a,b){let{__scopePopper:c,...d}=a,e=ac(ae,c),f=af[e.placedSide];return(0,g.jsx)("span",{ref:e.onArrowChange,style:{position:"absolute",left:e.arrowX,top:e.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[e.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[e.placedSide],visibility:e.shouldHideArrow?"hidden":void 0},children:(0,g.jsx)(R,{...d,ref:b,style:{...d.style,display:"block"}})})});function ah(a){return null!==a}ag.displayName=ae;var ai=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=aj(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function aj(a){let[b,c="center"]=a.split("-");return[b,c]}var ak=c(249855),al=h.forwardRef((a,b)=>{let{container:c,...d}=a,[e,f]=h.useState(!1);(0,L.N)(()=>f(!0),[]);let i=c||e&&globalThis?.document?.body;return i?ak.createPortal((0,g.jsx)(l.sG.div,{...d,ref:b}),i):null});al.displayName="Portal";var am=a=>{let{present:b,children:c}=a,d=function(a){var b,c;let[d,e]=h.useState(),f=h.useRef(null),g=h.useRef(a),i=h.useRef("none"),[j,k]=(b=a?"mounted":"unmounted",c={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},h.useReducer((a,b)=>c[a][b]??a,b));return h.useEffect(()=>{let a=an(f.current);i.current="mounted"===j?a:"none"},[j]),(0,L.N)(()=>{let b=f.current,c=g.current;if(c!==a){let d=i.current,e=an(b);a?k("MOUNT"):"none"===e||b?.display==="none"?k("UNMOUNT"):c&&d!==e?k("ANIMATION_OUT"):k("UNMOUNT"),g.current=a}},[a,k]),(0,L.N)(()=>{if(d){let a,b=d.ownerDocument.defaultView??window,c=c=>{let e=an(f.current).includes(CSS.escape(c.animationName));if(c.target===d&&e&&(k("ANIMATION_END"),!g.current)){let c=d.style.animationFillMode;d.style.animationFillMode="forwards",a=b.setTimeout(()=>{"forwards"===d.style.animationFillMode&&(d.style.animationFillMode=c)})}},e=a=>{a.target===d&&(i.current=an(f.current))};return d.addEventListener("animationstart",e),d.addEventListener("animationcancel",c),d.addEventListener("animationend",c),()=>{b.clearTimeout(a),d.removeEventListener("animationstart",e),d.removeEventListener("animationcancel",c),d.removeEventListener("animationend",c)}}k("ANIMATION_END")},[d,k]),{isPresent:["mounted","unmountSuspended"].includes(j),ref:h.useCallback(a=>{f.current=a?getComputedStyle(a):null,e(a)},[])}}(b),e="function"==typeof c?c({present:d.isPresent}):h.Children.only(c),f=(0,m.s)(d.ref,function(a){let b=Object.getOwnPropertyDescriptor(a.props,"ref")?.get,c=b&&"isReactWarning"in b&&b.isReactWarning;return c?a.ref:(c=(b=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in b&&b.isReactWarning)?a.props.ref:a.props.ref||a.ref}(e));return"function"==typeof c||d.isPresent?h.cloneElement(e,{ref:f}):null};function an(a){return a?.animationName||"none"}am.displayName="Presence";var ao=c(173092),ap="rovingFocusGroup.onEntryFocus",aq={bubbles:!1,cancelable:!0},ar="RovingFocusGroup",[as,at,au]=o(ar),[av,aw]=(0,k.A)(ar,[au]),[ax,ay]=av(ar),az=h.forwardRef((a,b)=>(0,g.jsx)(as.Provider,{scope:a.__scopeRovingFocusGroup,children:(0,g.jsx)(as.Slot,{scope:a.__scopeRovingFocusGroup,children:(0,g.jsx)(aA,{...a,ref:b})})}));az.displayName=ar;var aA=h.forwardRef((a,b)=>{let{__scopeRovingFocusGroup:c,orientation:d,loop:e=!1,dir:f,currentTabStopId:i,defaultCurrentTabStopId:k,onCurrentTabStopIdChange:n,onEntryFocus:o,preventScrollOnEntryFocus:p=!1,...q}=a,r=h.useRef(null),s=(0,m.s)(b,r),v=t(f),[w,x]=(0,ao.i)({prop:i,defaultProp:k??null,onChange:n,caller:ar}),[y,z]=h.useState(!1),A=u(o),B=at(c),C=h.useRef(!1),[D,E]=h.useState(0);return h.useEffect(()=>{let a=r.current;if(a)return a.addEventListener(ap,A),()=>a.removeEventListener(ap,A)},[A]),(0,g.jsx)(ax,{scope:c,orientation:d,dir:v,loop:e,currentTabStopId:w,onItemFocus:h.useCallback(a=>x(a),[x]),onItemShiftTab:h.useCallback(()=>z(!0),[]),onFocusableItemAdd:h.useCallback(()=>E(a=>a+1),[]),onFocusableItemRemove:h.useCallback(()=>E(a=>a-1),[]),children:(0,g.jsx)(l.sG.div,{tabIndex:y||0===D?-1:0,"data-orientation":d,...q,ref:s,style:{outline:"none",...a.style},onMouseDown:(0,j.mK)(a.onMouseDown,()=>{C.current=!0}),onFocus:(0,j.mK)(a.onFocus,a=>{let b=!C.current;if(a.target===a.currentTarget&&b&&!y){let b=new CustomEvent(ap,aq);if(a.currentTarget.dispatchEvent(b),!b.defaultPrevented){let a=B().filter(a=>a.focusable);aE([a.find(a=>a.active),a.find(a=>a.id===w),...a].filter(Boolean).map(a=>a.ref.current),p)}}C.current=!1}),onBlur:(0,j.mK)(a.onBlur,()=>z(!1))})})}),aB="RovingFocusGroupItem",aC=h.forwardRef((a,b)=>{let{__scopeRovingFocusGroup:c,focusable:d=!0,active:e=!1,tabStopId:f,children:i,...k}=a,m=O(),n=f||m,o=ay(aB,c),p=o.currentTabStopId===n,q=at(c),{onFocusableItemAdd:r,onFocusableItemRemove:s,currentTabStopId:t}=o;return h.useEffect(()=>{if(d)return r(),()=>s()},[d,r,s]),(0,g.jsx)(as.ItemSlot,{scope:c,id:n,focusable:d,active:e,children:(0,g.jsx)(l.sG.span,{tabIndex:p?0:-1,"data-orientation":o.orientation,...k,ref:b,onMouseDown:(0,j.mK)(a.onMouseDown,a=>{d?o.onItemFocus(n):a.preventDefault()}),onFocus:(0,j.mK)(a.onFocus,()=>o.onItemFocus(n)),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{if("Tab"===a.key&&a.shiftKey)return void o.onItemShiftTab();if(a.target!==a.currentTarget)return;let b=function(a,b,c){var d;let e=(d=a.key,"rtl"!==c?d:"ArrowLeft"===d?"ArrowRight":"ArrowRight"===d?"ArrowLeft":d);if(!("vertical"===b&&["ArrowLeft","ArrowRight"].includes(e))&&!("horizontal"===b&&["ArrowUp","ArrowDown"].includes(e)))return aD[e]}(a,o.orientation,o.dir);if(void 0!==b){if(a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;a.preventDefault();let c=q().filter(a=>a.focusable).map(a=>a.ref.current);if("last"===b)c.reverse();else if("prev"===b||"next"===b){"prev"===b&&c.reverse();let d=c.indexOf(a.currentTarget);c=o.loop?function(a,b){return a.map((c,d)=>a[(b+d)%a.length])}(c,d+1):c.slice(d+1)}setTimeout(()=>aE(c))}}),children:"function"==typeof i?i({isCurrentTabStop:p,hasTabStop:null!=t}):i})})});aC.displayName=aB;var aD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aE(a,b=!1){let c=document.activeElement;for(let d of a)if(d===c||(d.focus({preventScroll:b}),document.activeElement!==c))return}var aF=function(a){return"undefined"==typeof document?null:(Array.isArray(a)?a[0]:a).ownerDocument.body},aG=new WeakMap,aH=new WeakMap,aI={},aJ=0,aK=function(a){return a&&(a.host||aK(a.parentNode))},aL=function(a,b,c,d){var e=(Array.isArray(a)?a:[a]).map(function(a){if(b.contains(a))return a;var c=aK(a);return c&&b.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",b,". Doing nothing"),null)}).filter(function(a){return!!a});aI[c]||(aI[c]=new WeakMap);var f=aI[c],g=[],h=new Set,i=new Set(e),j=function(a){!a||h.has(a)||(h.add(a),j(a.parentNode))};e.forEach(j);var k=function(a){!a||i.has(a)||Array.prototype.forEach.call(a.children,function(a){if(h.has(a))k(a);else try{var b=a.getAttribute(d),e=null!==b&&"false"!==b,i=(aG.get(a)||0)+1,j=(f.get(a)||0)+1;aG.set(a,i),f.set(a,j),g.push(a),1===i&&e&&aH.set(a,!0),1===j&&a.setAttribute(c,"true"),e||a.setAttribute(d,"true")}catch(b){console.error("aria-hidden: cannot operate on ",a,b)}})};return k(b),h.clear(),aJ++,function(){g.forEach(function(a){var b=aG.get(a)-1,e=f.get(a)-1;aG.set(a,b),f.set(a,e),b||(aH.has(a)||a.removeAttribute(d),aH.delete(a)),e||a.removeAttribute(c)}),--aJ||(aG=new WeakMap,aG=new WeakMap,aH=new WeakMap,aI={})}},aM=function(a,b,c){void 0===c&&(c="data-aria-hidden");var d=Array.from(Array.isArray(a)?a:[a]),e=b||aF(a);return e?(d.push.apply(d,Array.from(e.querySelectorAll("[aria-live], script"))),aL(d,e,c,"aria-hidden")):function(){return null}},aN=function(){return(aN=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c])Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a}).apply(this,arguments)};function aO(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&Object.prototype.propertyIsEnumerable.call(a,d[e])&&(c[d[e]]=a[d[e]]);return c}Object.create;Object.create;var aP=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),aQ="width-before-scroll-bar";function aR(a,b){return"function"==typeof a?a(b):a&&(a.current=b),a}var aS="undefined"!=typeof window?h.useLayoutEffect:h.useEffect,aT=new WeakMap;function aU(a){return a}var aV=function(a){void 0===a&&(a={});var b,c,d,e,f=(b=null,void 0===c&&(c=aU),d=[],e=!1,{read:function(){if(e)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return d.length?d[d.length-1]:null},useMedium:function(a){var b=c(a,e);return d.push(b),function(){d=d.filter(function(a){return a!==b})}},assignSyncMedium:function(a){for(e=!0;d.length;){var b=d;d=[],b.forEach(a)}d={push:function(b){return a(b)},filter:function(){return d}}},assignMedium:function(a){e=!0;var b=[];if(d.length){var c=d;d=[],c.forEach(a),b=d}var f=function(){var c=b;b=[],c.forEach(a)},g=function(){return Promise.resolve().then(f)};g(),d={push:function(a){b.push(a),g()},filter:function(a){return b=b.filter(a),d}}}});return f.options=aN({async:!0,ssr:!1},a),f}(),aW=function(){},aX=h.forwardRef(function(a,b){var c,d,e,f,g=h.useRef(null),i=h.useState({onScrollCapture:aW,onWheelCapture:aW,onTouchMoveCapture:aW}),j=i[0],k=i[1],l=a.forwardProps,m=a.children,n=a.className,o=a.removeScrollBar,p=a.enabled,q=a.shards,r=a.sideCar,s=a.noRelative,t=a.noIsolation,u=a.inert,v=a.allowPinchZoom,w=a.as,x=a.gapMode,y=aO(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=(c=[g,b],d=function(a){return c.forEach(function(b){return aR(b,a)})},(e=(0,h.useState)(function(){return{value:null,callback:d,facade:{get current(){return e.value},set current(value){var a=e.value;a!==value&&(e.value=value,e.callback(value,a))}}}})[0]).callback=d,f=e.facade,aS(function(){var a=aT.get(f);if(a){var b=new Set(a),d=new Set(c),e=f.current;b.forEach(function(a){d.has(a)||aR(a,null)}),d.forEach(function(a){b.has(a)||aR(a,e)})}aT.set(f,c)},[c]),f),A=aN(aN({},y),j);return h.createElement(h.Fragment,null,p&&h.createElement(r,{sideCar:aV,removeScrollBar:o,shards:q,noRelative:s,noIsolation:t,inert:u,setCallbacks:k,allowPinchZoom:!!v,lockRef:g,gapMode:x}),l?h.cloneElement(h.Children.only(m),aN(aN({},A),{ref:z})):h.createElement(void 0===w?"div":w,aN({},A,{className:n,ref:z}),m))});aX.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},aX.classNames={fullWidth:aQ,zeroRight:aP};var aY=function(a){var b=a.sideCar,c=aO(a,["sideCar"]);if(!b)throw Error("Sidecar: please provide `sideCar` property to import the right car");var d=b.read();if(!d)throw Error("Sidecar medium not found");return h.createElement(d,aN({},c))};aY.isSideCarExport=!0;var aZ=function(){var a=0,b=null;return{add:function(d){if(0==a&&(b=function(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var b=f||c.nc;return b&&a.setAttribute("nonce",b),a}())){var e,g;(e=b).styleSheet?e.styleSheet.cssText=d:e.appendChild(document.createTextNode(d)),g=b,(document.head||document.getElementsByTagName("head")[0]).appendChild(g)}a++},remove:function(){--a||!b||(b.parentNode&&b.parentNode.removeChild(b),b=null)}}},a$=function(){var a=aZ();return function(b,c){h.useEffect(function(){return a.add(b),function(){a.remove()}},[b&&c])}},a_=function(){var a=a$();return function(b){return a(b.styles,b.dynamic),null}},a0={left:0,top:0,right:0,gap:0},a1=function(a){return parseInt(a||"",10)||0},a2=function(a){var b=window.getComputedStyle(document.body),c=b["padding"===a?"paddingLeft":"marginLeft"],d=b["padding"===a?"paddingTop":"marginTop"],e=b["padding"===a?"paddingRight":"marginRight"];return[a1(c),a1(d),a1(e)]},a3=function(a){if(void 0===a&&(a="margin"),"undefined"==typeof window)return a0;var b=a2(a),c=document.documentElement.clientWidth,d=window.innerWidth;return{left:b[0],top:b[1],right:b[2],gap:Math.max(0,d-c+b[2]-b[0])}},a4=a_(),a5="data-scroll-locked",a6=function(a,b,c,d){var e=a.left,f=a.top,g=a.right,h=a.gap;return void 0===c&&(c="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(d,";\n padding-right: ").concat(h,"px ").concat(d,";\n }\n body[").concat(a5,"] {\n overflow: hidden ").concat(d,";\n overscroll-behavior: contain;\n ").concat([b&&"position: relative ".concat(d,";"),"margin"===c&&"\n padding-left: ".concat(e,"px;\n padding-top: ").concat(f,"px;\n padding-right: ").concat(g,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(h,"px ").concat(d,";\n "),"padding"===c&&"padding-right: ".concat(h,"px ").concat(d,";")].filter(Boolean).join(""),"\n }\n \n .").concat(aP," {\n right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(aQ," {\n margin-right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(aP," .").concat(aP," {\n right: 0 ").concat(d,";\n }\n \n .").concat(aQ," .").concat(aQ," {\n margin-right: 0 ").concat(d,";\n }\n \n body[").concat(a5,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(h,"px;\n }\n")},a7=function(){var a=parseInt(document.body.getAttribute(a5)||"0",10);return isFinite(a)?a:0},a8=function(){h.useEffect(function(){return document.body.setAttribute(a5,(a7()+1).toString()),function(){var a=a7()-1;a<=0?document.body.removeAttribute(a5):document.body.setAttribute(a5,a.toString())}},[])},a9=function(a){var b=a.noRelative,c=a.noImportant,d=a.gapMode,e=void 0===d?"margin":d;a8();var f=h.useMemo(function(){return a3(e)},[e]);return h.createElement(a4,{styles:a6(f,!b,e,c?"":"!important")})},ba=!1;if("undefined"!=typeof window)try{var bb=Object.defineProperty({},"passive",{get:function(){return ba=!0,!0}});window.addEventListener("test",bb,bb),window.removeEventListener("test",bb,bb)}catch(a){ba=!1}var bc=!!ba&&{passive:!1},bd=function(a,b){if(!(a instanceof Element))return!1;var c=window.getComputedStyle(a);return"hidden"!==c[b]&&(c.overflowY!==c.overflowX||"TEXTAREA"===a.tagName||"visible"!==c[b])},be=function(a,b){var c=b.ownerDocument,d=b;do{if("undefined"!=typeof ShadowRoot&&d instanceof ShadowRoot&&(d=d.host),bf(a,d)){var e=bg(a,d);if(e[1]>e[2])return!0}d=d.parentNode}while(d&&d!==c.body);return!1},bf=function(a,b){return"v"===a?bd(b,"overflowY"):bd(b,"overflowX")},bg=function(a,b){return"v"===a?[b.scrollTop,b.scrollHeight,b.clientHeight]:[b.scrollLeft,b.scrollWidth,b.clientWidth]},bh=function(a,b,c,d,e){var f,g=(f=window.getComputedStyle(b).direction,"h"===a&&"rtl"===f?-1:1),h=g*d,i=c.target,j=b.contains(i),k=!1,l=h>0,m=0,n=0;do{if(!i)break;var o=bg(a,i),p=o[0],q=o[1]-o[2]-g*p;(p||q)&&bf(a,i)&&(m+=q,n+=p);var r=i.parentNode;i=r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?r.host:r}while(!j&&i!==document.body||j&&(b.contains(i)||b===i));return l&&(e&&1>Math.abs(m)||!e&&h>m)?k=!0:!l&&(e&&1>Math.abs(n)||!e&&-h>n)&&(k=!0),k},bi=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},bj=function(a){return[a.deltaX,a.deltaY]},bk=function(a){return a&&"current"in a?a.current:a},bl=0,bm=[];let bn=(d=function(a){var b=h.useRef([]),c=h.useRef([0,0]),d=h.useRef(),e=h.useState(bl++)[0],f=h.useState(a_)[0],g=h.useRef(a);h.useEffect(function(){g.current=a},[a]),h.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(e));var b=(function(a,b,c){if(c||2==arguments.length)for(var d,e=0,f=b.length;e<f;e++)!d&&e in b||(d||(d=Array.prototype.slice.call(b,0,e)),d[e]=b[e]);return a.concat(d||Array.prototype.slice.call(b))})([a.lockRef.current],(a.shards||[]).map(bk),!0).filter(Boolean);return b.forEach(function(a){return a.classList.add("allow-interactivity-".concat(e))}),function(){document.body.classList.remove("block-interactivity-".concat(e)),b.forEach(function(a){return a.classList.remove("allow-interactivity-".concat(e))})}}},[a.inert,a.lockRef.current,a.shards]);var i=h.useCallback(function(a,b){if("touches"in a&&2===a.touches.length||"wheel"===a.type&&a.ctrlKey)return!g.current.allowPinchZoom;var e,f=bi(a),h=c.current,i="deltaX"in a?a.deltaX:h[0]-f[0],j="deltaY"in a?a.deltaY:h[1]-f[1],k=a.target,l=Math.abs(i)>Math.abs(j)?"h":"v";if("touches"in a&&"h"===l&&"range"===k.type)return!1;var m=window.getSelection(),n=m&&m.anchorNode;if(n&&(n===k||n.contains(k)))return!1;var o=be(l,k);if(!o)return!0;if(o?e=l:(e="v"===l?"h":"v",o=be(l,k)),!o)return!1;if(!d.current&&"changedTouches"in a&&(i||j)&&(d.current=e),!e)return!0;var p=d.current||e;return bh(p,b,a,"h"===p?i:j,!0)},[]),j=h.useCallback(function(a){if(bm.length&&bm[bm.length-1]===f){var c="deltaY"in a?bj(a):bi(a),d=b.current.filter(function(b){var d;return b.name===a.type&&(b.target===a.target||a.target===b.shadowParent)&&(d=b.delta,d[0]===c[0]&&d[1]===c[1])})[0];if(d&&d.should){a.cancelable&&a.preventDefault();return}if(!d){var e=(g.current.shards||[]).map(bk).filter(Boolean).filter(function(b){return b.contains(a.target)});(e.length>0?i(a,e[0]):!g.current.noIsolation)&&a.cancelable&&a.preventDefault()}}},[]),k=h.useCallback(function(a,c,d,e){var f={name:a,delta:c,target:d,should:e,shadowParent:function(a){for(var b=null;null!==a;)a instanceof ShadowRoot&&(b=a.host,a=a.host),a=a.parentNode;return b}(d)};b.current.push(f),setTimeout(function(){b.current=b.current.filter(function(a){return a!==f})},1)},[]),l=h.useCallback(function(a){c.current=bi(a),d.current=void 0},[]),m=h.useCallback(function(b){k(b.type,bj(b),b.target,i(b,a.lockRef.current))},[]),n=h.useCallback(function(b){k(b.type,bi(b),b.target,i(b,a.lockRef.current))},[]);h.useEffect(function(){return bm.push(f),a.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:n}),document.addEventListener("wheel",j,bc),document.addEventListener("touchmove",j,bc),document.addEventListener("touchstart",l,bc),function(){bm=bm.filter(function(a){return a!==f}),document.removeEventListener("wheel",j,bc),document.removeEventListener("touchmove",j,bc),document.removeEventListener("touchstart",l,bc)}},[]);var o=a.removeScrollBar,p=a.inert;return h.createElement(h.Fragment,null,p?h.createElement(f,{styles:"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")}):null,o?h.createElement(a9,{noRelative:a.noRelative,gapMode:a.gapMode}):null)},aV.useMedium(d),aY);var bo=h.forwardRef(function(a,b){return h.createElement(aX,aN({},a,{ref:b,sideCar:bn}))});bo.classNames=aX.classNames;var bp=["Enter"," "],bq=["ArrowUp","PageDown","End"],br=["ArrowDown","PageUp","Home",...bq],bs={ltr:[...bp,"ArrowRight"],rtl:[...bp,"ArrowLeft"]},bt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bu="Menu",[bv,bw,bx]=o(bu),[by,bz]=(0,k.A)(bu,[bx,V,aw]),bA=V(),bB=aw(),[bC,bD]=by(bu),[bE,bF]=by(bu),bG=a=>{let{__scopeMenu:b,open:c=!1,children:d,dir:e,onOpenChange:f,modal:i=!0}=a,j=bA(b),[k,l]=h.useState(null),m=h.useRef(!1),n=u(f),o=t(e);return h.useEffect(()=>{let a=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),(0,g.jsx)(Y,{...j,children:(0,g.jsx)(bC,{scope:b,open:c,onOpenChange:n,content:k,onContentChange:l,children:(0,g.jsx)(bE,{scope:b,onClose:h.useCallback(()=>n(!1),[n]),isUsingKeyboardRef:m,dir:o,modal:i,children:d})})})};bG.displayName=bu;var bH=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=bA(c);return(0,g.jsx)(_,{...e,...d,ref:b})});bH.displayName="MenuAnchor";var bI="MenuPortal",[bJ,bK]=by(bI,{forceMount:void 0}),bL=a=>{let{__scopeMenu:b,forceMount:c,children:d,container:e}=a,f=bD(bI,b);return(0,g.jsx)(bJ,{scope:b,forceMount:c,children:(0,g.jsx)(am,{present:c||f.open,children:(0,g.jsx)(al,{asChild:!0,container:e,children:d})})})};bL.displayName=bI;var bM="MenuContent",[bN,bO]=by(bM),bP=h.forwardRef((a,b)=>{let c=bK(bM,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=bD(bM,a.__scopeMenu),h=bF(bM,a.__scopeMenu);return(0,g.jsx)(bv.Provider,{scope:a.__scopeMenu,children:(0,g.jsx)(am,{present:d||f.open,children:(0,g.jsx)(bv.Slot,{scope:a.__scopeMenu,children:h.modal?(0,g.jsx)(bQ,{...e,ref:b}):(0,g.jsx)(bR,{...e,ref:b})})})})}),bQ=h.forwardRef((a,b)=>{let c=bD(bM,a.__scopeMenu),d=h.useRef(null),e=(0,m.s)(b,d);return h.useEffect(()=>{let a=d.current;if(a)return aM(a)},[]),(0,g.jsx)(bT,{...a,ref:e,trapFocus:c.open,disableOutsidePointerEvents:c.open,disableOutsideScroll:!0,onFocusOutside:(0,j.mK)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>c.onOpenChange(!1)})}),bR=h.forwardRef((a,b)=>{let c=bD(bM,a.__scopeMenu);return(0,g.jsx)(bT,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>c.onOpenChange(!1)})}),bS=(0,n.TL)("MenuContent.ScrollLock"),bT=h.forwardRef((a,b)=>{let{__scopeMenu:c,loop:d=!1,trapFocus:e,onOpenAutoFocus:f,onCloseAutoFocus:i,disableOutsidePointerEvents:k,onEntryFocus:l,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:p,onInteractOutside:q,onDismiss:r,disableOutsideScroll:s,...t}=a,u=bD(bM,c),v=bF(bM,c),w=bA(c),y=bB(c),z=bw(c),[C,D]=h.useState(null),E=h.useRef(null),G=(0,m.s)(b,E,u.onContentChange),H=h.useRef(0),I=h.useRef(""),J=h.useRef(0),K=h.useRef(null),L=h.useRef("right"),M=h.useRef(0),N=s?bo:h.Fragment;h.useEffect(()=>()=>window.clearTimeout(H.current),[]),h.useEffect(()=>{let a=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",a[0]??B()),document.body.insertAdjacentElement("beforeend",a[1]??B()),A++,()=>{1===A&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),A--}},[]);let O=h.useCallback(a=>L.current===K.current?.side&&function(a,b){return!!b&&function(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}({x:a.clientX,y:a.clientY},b)}(a,K.current?.area),[]);return(0,g.jsx)(bN,{scope:c,searchRef:I,onItemEnter:h.useCallback(a=>{O(a)&&a.preventDefault()},[O]),onItemLeave:h.useCallback(a=>{O(a)||(E.current?.focus(),D(null))},[O]),onTriggerLeave:h.useCallback(a=>{O(a)&&a.preventDefault()},[O]),pointerGraceTimerRef:J,onPointerGraceIntentChange:h.useCallback(a=>{K.current=a},[]),children:(0,g.jsx)(N,{...s?{as:bS,allowPinchZoom:!0}:void 0,children:(0,g.jsx)(F,{asChild:!0,trapped:e,onMountAutoFocus:(0,j.mK)(f,a=>{a.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,g.jsx)(x,{asChild:!0,disableOutsidePointerEvents:k,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:p,onInteractOutside:q,onDismiss:r,children:(0,g.jsx)(az,{asChild:!0,...y,dir:v.dir,orientation:"vertical",loop:d,currentTabStopId:C,onCurrentTabStopIdChange:D,onEntryFocus:(0,j.mK)(l,a=>{v.isUsingKeyboardRef.current||a.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,g.jsx)(ad,{role:"menu","aria-orientation":"vertical","data-state":ci(u.open),"data-radix-menu-content":"",dir:v.dir,...w,...t,ref:G,style:{outline:"none",...t.style},onKeyDown:(0,j.mK)(t.onKeyDown,a=>{let b=a.target.closest("[data-radix-menu-content]")===a.currentTarget,c=a.ctrlKey||a.altKey||a.metaKey,d=1===a.key.length;b&&("Tab"===a.key&&a.preventDefault(),!c&&d&&(a=>{let b=I.current+a,c=z().filter(a=>!a.disabled),d=document.activeElement,e=c.find(a=>a.ref.current===d)?.textValue,f=function(a,b,c){var d;let e=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,f=c?a.indexOf(c):-1,g=(d=Math.max(f,0),a.map((b,c)=>a[(d+c)%a.length]));1===e.length&&(g=g.filter(a=>a!==c));let h=g.find(a=>a.toLowerCase().startsWith(e.toLowerCase()));return h!==c?h:void 0}(c.map(a=>a.textValue),b,e),g=c.find(a=>a.textValue===f)?.ref.current;!function a(b){I.current=b,window.clearTimeout(H.current),""!==b&&(H.current=window.setTimeout(()=>a(""),1e3))}(b),g&&setTimeout(()=>g.focus())})(a.key));let e=E.current;if(a.target!==e||!br.includes(a.key))return;a.preventDefault();let f=z().filter(a=>!a.disabled).map(a=>a.ref.current);bq.includes(a.key)&&f.reverse(),function(a){let b=document.activeElement;for(let c of a)if(c===b||(c.focus(),document.activeElement!==b))return}(f)}),onBlur:(0,j.mK)(a.onBlur,a=>{a.currentTarget.contains(a.target)||(window.clearTimeout(H.current),I.current="")}),onPointerMove:(0,j.mK)(a.onPointerMove,cl(a=>{let b=a.target,c=M.current!==a.clientX;a.currentTarget.contains(b)&&c&&(L.current=a.clientX>M.current?"right":"left",M.current=a.clientX)}))})})})})})})});bP.displayName=bM;var bU=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,g.jsx)(l.sG.div,{role:"group",...d,ref:b})});bU.displayName="MenuGroup";var bV=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,g.jsx)(l.sG.div,{...d,ref:b})});bV.displayName="MenuLabel";var bW="MenuItem",bX="menu.itemSelect",bY=h.forwardRef((a,b)=>{let{disabled:c=!1,onSelect:d,...e}=a,f=h.useRef(null),i=bF(bW,a.__scopeMenu),k=bO(bW,a.__scopeMenu),n=(0,m.s)(b,f),o=h.useRef(!1);return(0,g.jsx)(bZ,{...e,ref:n,disabled:c,onClick:(0,j.mK)(a.onClick,()=>{let a=f.current;if(!c&&a){let b=new CustomEvent(bX,{bubbles:!0,cancelable:!0});a.addEventListener(bX,a=>d?.(a),{once:!0}),(0,l.hO)(a,b),b.defaultPrevented?o.current=!1:i.onClose()}}),onPointerDown:b=>{a.onPointerDown?.(b),o.current=!0},onPointerUp:(0,j.mK)(a.onPointerUp,a=>{o.current||a.currentTarget?.click()}),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{let b=""!==k.searchRef.current;c||b&&" "===a.key||bp.includes(a.key)&&(a.currentTarget.click(),a.preventDefault())})})});bY.displayName=bW;var bZ=h.forwardRef((a,b)=>{let{__scopeMenu:c,disabled:d=!1,textValue:e,...f}=a,i=bO(bW,c),k=bB(c),n=h.useRef(null),o=(0,m.s)(b,n),[p,q]=h.useState(!1),[r,s]=h.useState("");return h.useEffect(()=>{let a=n.current;a&&s((a.textContent??"").trim())},[f.children]),(0,g.jsx)(bv.ItemSlot,{scope:c,disabled:d,textValue:e??r,children:(0,g.jsx)(aC,{asChild:!0,...k,focusable:!d,children:(0,g.jsx)(l.sG.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":d||void 0,"data-disabled":d?"":void 0,...f,ref:o,onPointerMove:(0,j.mK)(a.onPointerMove,cl(a=>{d?i.onItemLeave(a):(i.onItemEnter(a),a.defaultPrevented||a.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,j.mK)(a.onPointerLeave,cl(a=>i.onItemLeave(a))),onFocus:(0,j.mK)(a.onFocus,()=>q(!0)),onBlur:(0,j.mK)(a.onBlur,()=>q(!1))})})})}),b$=h.forwardRef((a,b)=>{let{checked:c=!1,onCheckedChange:d,...e}=a;return(0,g.jsx)(b6,{scope:a.__scopeMenu,checked:c,children:(0,g.jsx)(bY,{role:"menuitemcheckbox","aria-checked":cj(c)?"mixed":c,...e,ref:b,"data-state":ck(c),onSelect:(0,j.mK)(e.onSelect,()=>d?.(!!cj(c)||!c),{checkForDefaultPrevented:!1})})})});b$.displayName="MenuCheckboxItem";var b_="MenuRadioGroup",[b0,b1]=by(b_,{value:void 0,onValueChange:()=>{}}),b2=h.forwardRef((a,b)=>{let{value:c,onValueChange:d,...e}=a,f=u(d);return(0,g.jsx)(b0,{scope:a.__scopeMenu,value:c,onValueChange:f,children:(0,g.jsx)(bU,{...e,ref:b})})});b2.displayName=b_;var b3="MenuRadioItem",b4=h.forwardRef((a,b)=>{let{value:c,...d}=a,e=b1(b3,a.__scopeMenu),f=c===e.value;return(0,g.jsx)(b6,{scope:a.__scopeMenu,checked:f,children:(0,g.jsx)(bY,{role:"menuitemradio","aria-checked":f,...d,ref:b,"data-state":ck(f),onSelect:(0,j.mK)(d.onSelect,()=>e.onValueChange?.(c),{checkForDefaultPrevented:!1})})})});b4.displayName=b3;var b5="MenuItemIndicator",[b6,b7]=by(b5,{checked:!1}),b8=h.forwardRef((a,b)=>{let{__scopeMenu:c,forceMount:d,...e}=a,f=b7(b5,c);return(0,g.jsx)(am,{present:d||cj(f.checked)||!0===f.checked,children:(0,g.jsx)(l.sG.span,{...e,ref:b,"data-state":ck(f.checked)})})});b8.displayName=b5;var b9=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,g.jsx)(l.sG.div,{role:"separator","aria-orientation":"horizontal",...d,ref:b})});b9.displayName="MenuSeparator";var ca=h.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=bA(c);return(0,g.jsx)(ag,{...e,...d,ref:b})});ca.displayName="MenuArrow";var cb="MenuSub",[cc,cd]=by(cb);var ce="MenuSubTrigger",cf=h.forwardRef((a,b)=>{let c=bD(ce,a.__scopeMenu),d=bF(ce,a.__scopeMenu),e=cd(ce,a.__scopeMenu),f=bO(ce,a.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:k,onPointerGraceIntentChange:l}=f,n={__scopeMenu:a.__scopeMenu},o=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>o,[o]),h.useEffect(()=>{let a=k.current;return()=>{window.clearTimeout(a),l(null)}},[k,l]),(0,g.jsx)(bH,{asChild:!0,...n,children:(0,g.jsx)(bZ,{id:e.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":e.contentId,"data-state":ci(c.open),...a,ref:(0,m.t)(b,e.onTriggerChange),onClick:b=>{a.onClick?.(b),a.disabled||b.defaultPrevented||(b.currentTarget.focus(),c.open||c.onOpenChange(!0))},onPointerMove:(0,j.mK)(a.onPointerMove,cl(b=>{f.onItemEnter(b),!b.defaultPrevented&&(a.disabled||c.open||i.current||(f.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{c.onOpenChange(!0),o()},100)))})),onPointerLeave:(0,j.mK)(a.onPointerLeave,cl(a=>{o();let b=c.content?.getBoundingClientRect();if(b){let d=c.content?.dataset.side,e="right"===d,g=b[e?"left":"right"],h=b[e?"right":"left"];f.onPointerGraceIntentChange({area:[{x:a.clientX+(e?-5:5),y:a.clientY},{x:g,y:b.top},{x:h,y:b.top},{x:h,y:b.bottom},{x:g,y:b.bottom}],side:d}),window.clearTimeout(k.current),k.current=window.setTimeout(()=>f.onPointerGraceIntentChange(null),300)}else{if(f.onTriggerLeave(a),a.defaultPrevented)return;f.onPointerGraceIntentChange(null)}})),onKeyDown:(0,j.mK)(a.onKeyDown,b=>{let e=""!==f.searchRef.current;a.disabled||e&&" "===b.key||bs[d.dir].includes(b.key)&&(c.onOpenChange(!0),c.content?.focus(),b.preventDefault())})})})});cf.displayName=ce;var cg="MenuSubContent",ch=h.forwardRef((a,b)=>{let c=bK(bM,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=bD(bM,a.__scopeMenu),i=bF(bM,a.__scopeMenu),k=cd(cg,a.__scopeMenu),l=h.useRef(null),n=(0,m.s)(b,l);return(0,g.jsx)(bv.Provider,{scope:a.__scopeMenu,children:(0,g.jsx)(am,{present:d||f.open,children:(0,g.jsx)(bv.Slot,{scope:a.__scopeMenu,children:(0,g.jsx)(bT,{id:k.contentId,"aria-labelledby":k.triggerId,...e,ref:n,align:"start",side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{i.isUsingKeyboardRef.current&&l.current?.focus(),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:(0,j.mK)(a.onFocusOutside,a=>{a.target!==k.trigger&&f.onOpenChange(!1)}),onEscapeKeyDown:(0,j.mK)(a.onEscapeKeyDown,a=>{i.onClose(),a.preventDefault()}),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{let b=a.currentTarget.contains(a.target),c=bt[i.dir].includes(a.key);b&&c&&(f.onOpenChange(!1),k.trigger?.focus(),a.preventDefault())})})})})})});function ci(a){return a?"open":"closed"}function cj(a){return"indeterminate"===a}function ck(a){return cj(a)?"indeterminate":a?"checked":"unchecked"}function cl(a){return b=>"mouse"===b.pointerType?a(b):void 0}ch.displayName=cg;var cm="ContextMenu",[cn,co]=(0,k.A)(cm,[bz]),cp=bz(),[cq,cr]=cn(cm),cs=a=>{let{__scopeContextMenu:b,children:c,onOpenChange:d,dir:e,modal:f=!0}=a,[i,j]=h.useState(!1),k=cp(b),l=u(d),m=h.useCallback(a=>{j(a),l(a)},[l]);return(0,g.jsx)(cq,{scope:b,open:i,onOpenChange:m,modal:f,children:(0,g.jsx)(bG,{...k,dir:e,open:i,onOpenChange:m,modal:f,children:c})})};cs.displayName=cm;var ct="ContextMenuTrigger",cu=h.forwardRef((a,b)=>{let{__scopeContextMenu:c,disabled:d=!1,...e}=a,f=cr(ct,c),i=cp(c),k=h.useRef({x:0,y:0}),m=h.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...k.current})}),n=h.useRef(0),o=h.useCallback(()=>window.clearTimeout(n.current),[]),p=a=>{k.current={x:a.clientX,y:a.clientY},f.onOpenChange(!0)};return h.useEffect(()=>o,[o]),h.useEffect(()=>void(d&&o()),[d,o]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(bH,{...i,virtualRef:m}),(0,g.jsx)(l.sG.span,{"data-state":f.open?"open":"closed","data-disabled":d?"":void 0,...e,ref:b,style:{WebkitTouchCallout:"none",...a.style},onContextMenu:d?a.onContextMenu:(0,j.mK)(a.onContextMenu,a=>{o(),p(a),a.preventDefault()}),onPointerDown:d?a.onPointerDown:(0,j.mK)(a.onPointerDown,cA(a=>{o(),n.current=window.setTimeout(()=>p(a),700)})),onPointerMove:d?a.onPointerMove:(0,j.mK)(a.onPointerMove,cA(o)),onPointerCancel:d?a.onPointerCancel:(0,j.mK)(a.onPointerCancel,cA(o)),onPointerUp:d?a.onPointerUp:(0,j.mK)(a.onPointerUp,cA(o))})]})});cu.displayName=ct;var cv=a=>{let{__scopeContextMenu:b,...c}=a,d=cp(b);return(0,g.jsx)(bL,{...d,...c})};cv.displayName="ContextMenuPortal";var cw="ContextMenuContent",cx=h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cr(cw,c),f=cp(c),i=h.useRef(!1);return(0,g.jsx)(bP,{...f,...d,ref:b,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:b=>{a.onCloseAutoFocus?.(b),!b.defaultPrevented&&i.current&&b.preventDefault(),i.current=!1},onInteractOutside:b=>{a.onInteractOutside?.(b),b.defaultPrevented||e.modal||(i.current=!0)},style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cx.displayName=cw,h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(bU,{...e,...d,ref:b})}).displayName="ContextMenuGroup",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(bV,{...e,...d,ref:b})}).displayName="ContextMenuLabel";var cy=h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(bY,{...e,...d,ref:b})});cy.displayName="ContextMenuItem",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b$,{...e,...d,ref:b})}).displayName="ContextMenuCheckboxItem",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b2,{...e,...d,ref:b})}).displayName="ContextMenuRadioGroup",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b4,{...e,...d,ref:b})}).displayName="ContextMenuRadioItem",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b8,{...e,...d,ref:b})}).displayName="ContextMenuItemIndicator";var cz=h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(b9,{...e,...d,ref:b})});cz.displayName="ContextMenuSeparator",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(ca,{...e,...d,ref:b})}).displayName="ContextMenuArrow";function cA(a){return b=>"mouse"!==b.pointerType?a(b):void 0}h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(cf,{...e,...d,ref:b})}).displayName="ContextMenuSubTrigger",h.forwardRef((a,b)=>{let{__scopeContextMenu:c,...d}=a,e=cp(c);return(0,g.jsx)(ch,{...e,...d,ref:b,style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="ContextMenuSubContent";var cB=c(165046);function cC({...a}){return(0,g.jsx)(cs,{"data-slot":"context-menu",...a})}function cD({className:a,...b}){return(0,g.jsx)(cu,{"data-slot":"context-menu-trigger",className:(0,cB.cn)("select-none",a),...b})}function cE({className:a,...b}){return(0,g.jsx)(cv,{children:(0,g.jsx)(cx,{"data-slot":"context-menu-content",className:(0,cB.cn)("bg-neutral-100/[0.67] dark:bg-neutral-900/[0.67] border border-white dark:border-white/10 backdrop-blur-md text-[var(--color-text)] z-[9999] max-h-[var(--radix-context-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-3xl p-1 shadow-[0_0_25px_0_rgba(0,0,0,0.16)] outline-none","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",a),...b})})}function cF({className:a,inset:b,variant:c="default",...d}){return(0,g.jsx)(cy,{"data-slot":"context-menu-item","data-inset":b,"data-variant":c,className:(0,cB.cn)("bg-transparent hover:bg-neutral-400/15 focus:bg-neutral-400/15 text-sm transition-all relative flex cursor-pointer items-center gap-2 rounded-full px-2 py-1.5 outline-none select-none","data-[variant=destructive]:text-[var(--color-error)] data-[variant=destructive]:hover:bg-[var(--color-error)]/10 data-[variant=destructive]:focus:bg-[var(--color-error)]/10 data-[variant=destructive]:hover:text-[var(--color-error)]",b&&"pl-8","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...d})}function cG({className:a,...b}){return(0,g.jsx)(cz,{"data-slot":"context-menu-separator",className:(0,cB.cn)("bg-neutral-400/15 -mx-1 my-1 h-px",a),...b})}function cH({className:a,...b}){return(0,g.jsx)("span",{"data-slot":"context-menu-shortcut",className:(0,cB.cn)("text-[var(--color-text-muted)] ml-auto text-xs tracking-widest",a),...b})}},512089:(a,b,c)=>{class d extends Error{constructor(a,b,c){if(super(b),null==b&&null==c&&d.errorMap.has(a))return d.errorMap.get(a);null==b&&null==c?(this._error=a,d.errorMap.set(a,this)):this._error=a,this.details=c}get error(){return this._error}get name(){return this._error}equals(a){return a instanceof d&&a._error===this._error}toString(){return this._error}}d.errorMap=new Map,d.DIV0=new d("#DIV/0!"),d.NA=new d("#N/A"),d.NAME=new d("#NAME?"),d.NULL=new d("#NULL!"),d.NUM=new d("#NUM!"),d.REF=new d("#REF!"),d.VALUE=new d("#VALUE!"),d.NOT_IMPLEMENTED=a=>new d("#NAME?",`Function ${a} is not implemented.`),d.TOO_MANY_ARGS=a=>new d("#N/A",`Function ${a} has too many arguments.`),d.ARG_MISSING=a=>{let{Types:b}=c(828358);return new d("#N/A",`Argument type ${a.map(a=>b[a]).join(", ")} is missing.`)},d.ERROR=(a,b)=>new d("#ERROR!",a,b),a.exports=d},513799:a=>{a.exports=function(a,b){let c;if("function"!=typeof a)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof a}\`.`);let d=0;return function(...e){clearTimeout(c);let f=Date.now(),g=b-(f-d);g<=0?(d=f,a.apply(this,e)):c=setTimeout(()=>{d=Date.now(),a.apply(this,e)},g)}}},514430:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.toKey=function(a){return"string"==typeof a||"symbol"==typeof a?a:Object.is(a?.valueOf?.(),-0)?"-0":String(a)}},518069:(a,b,c)=>{"use strict";c.d(b,{s:()=>r});var d=c(736927),e=c(115962);function f({label:a,value:b,onChange:c,fields:e,filterType:f,allowEmpty:g}){let h=f?Array.isArray(f)?f:[f]:null,i=h?e.filter(a=>h.includes(a.type)):e;return(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{className:"text-[10px] font-medium",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsxs)("select",{value:b??"",onChange:a=>c(a.target.value||void 0),className:"text-[12px] rounded-md border px-2 py-1.5 bg-transparent",style:{borderColor:"var(--color-border)",color:"var(--color-text)",background:"var(--color-surface)"},children:[g&&(0,d.jsx)("option",{value:"",children:"None"}),0===i.length&&(0,d.jsx)("option",{value:"",disabled:!0,children:"No matching fields"}),i.map(a=>(0,d.jsx)("option",{value:a.name,children:a.name},a.id))]})]})}function g({label:a,value:b,options:c,onChange:e}){return(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{className:"text-[10px] font-medium",style:{color:"var(--color-text-muted)"},children:a}),(0,d.jsx)("div",{className:"flex rounded-md border overflow-hidden",style:{borderColor:"var(--color-border)"},children:c.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>e(a.value),className:"text-[11px] px-2.5 py-1 flex-1 transition-colors capitalize",style:{background:a.value===b?"var(--color-accent)":"var(--color-surface)",color:a.value===b?"#fff":"var(--color-text-muted)"},children:a.label},a.value))})]})}function h({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsx)(f,{label:"Group by field",value:a.kanbanField,onChange:b=>c({...a,kanbanField:b}),fields:b,filterType:"enum"})}function i({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f,{label:"Date field",value:a.calendarDateField,onChange:b=>c({...a,calendarDateField:b}),fields:b,filterType:"date"}),(0,d.jsx)(f,{label:"End date field (optional)",value:a.calendarEndDateField,onChange:b=>c({...a,calendarEndDateField:b}),fields:b,filterType:"date",allowEmpty:!0}),(0,d.jsx)(g,{label:"Default view",value:a.calendarMode??"month",options:[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"},{value:"year",label:"Year"}],onChange:b=>c({...a,calendarMode:b})})]})}function j({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f,{label:"Start date field",value:a.timelineStartField,onChange:b=>c({...a,timelineStartField:b}),fields:b,filterType:"date"}),(0,d.jsx)(f,{label:"End date field",value:a.timelineEndField,onChange:b=>c({...a,timelineEndField:b}),fields:b,filterType:"date",allowEmpty:!0}),(0,d.jsx)(f,{label:"Group by (optional)",value:a.timelineGroupField,onChange:b=>c({...a,timelineGroupField:b}),fields:b,filterType:"enum",allowEmpty:!0}),(0,d.jsx)(g,{label:"Default zoom",value:a.timelineZoom??"week",options:[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"},{value:"quarter",label:"Quarter"}],onChange:b=>c({...a,timelineZoom:b})})]})}function k({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f,{label:"Title field",value:a.galleryTitleField,onChange:b=>c({...a,galleryTitleField:b}),fields:b,filterType:"text"}),(0,d.jsx)(f,{label:"Cover field (optional)",value:a.galleryCoverField,onChange:b=>c({...a,galleryCoverField:b}),fields:b,allowEmpty:!0})]})}function l({settings:a,fields:b,onSettingsChange:c}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f,{label:"Title field",value:a.listTitleField,onChange:b=>c({...a,listTitleField:b}),fields:b,filterType:"text"}),(0,d.jsx)(f,{label:"Subtitle field (optional)",value:a.listSubtitleField,onChange:b=>c({...a,listSubtitleField:b}),fields:b,filterType:["text","email","richtext"],allowEmpty:!0})]})}function m(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function n({children:a}){return(0,d.jsx)("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:a})}function o({description:a}){return(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)(n,{children:"About"}),(0,d.jsx)("p",{className:"text-[12px] leading-snug",style:{color:"var(--color-text)"},children:a})]})}function p({displayField:a,candidates:b,onChange:c,updating:e}){return(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)(n,{children:"Display field"}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("select",{value:a??"",onChange:a=>c(a.target.value),disabled:e,className:"text-[12px] rounded-md border px-2 py-1.5 flex-1 outline-none cursor-pointer",style:{borderColor:"var(--color-border)",color:"var(--color-text)",background:"var(--color-surface)",opacity:e?.5:1},children:b.map(a=>(0,d.jsx)("option",{value:a.name,children:a.name},a.id))}),e&&(0,d.jsx)("div",{className:"w-3 h-3 border border-t-transparent rounded-full animate-spin shrink-0",style:{borderColor:"var(--color-text-muted)"}})]})]})}function q({fields:a,columnVisibility:b,onColumnVisibilityChange:c,stickyFirstColumn:e,onStickyFirstColumnChange:f}){return(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)(n,{children:"Columns"}),f&&(0,d.jsxs)("label",{className:"flex items-center gap-2 text-[12px] cursor-pointer",style:{color:"var(--color-text)"},children:[(0,d.jsx)("input",{type:"checkbox",checked:!!e,onChange:a=>f(a.target.checked),className:"cursor-pointer"}),"Freeze first column"]}),(0,d.jsx)("div",{className:"flex flex-col gap-1 max-h-48 overflow-y-auto rounded-md border p-1.5",style:{borderColor:"var(--color-border)"},children:0===a.length?(0,d.jsx)("div",{className:"text-[11px] px-1 py-0.5",style:{color:"var(--color-text-muted)"},children:"No columns"}):a.map(a=>{let e=!1!==b[a.id];return(0,d.jsxs)("label",{className:"flex items-center gap-2 text-[12px] cursor-pointer px-1 py-0.5 rounded hover:bg-[var(--color-surface-hover)]",style:{color:"var(--color-text)"},children:[(0,d.jsx)("input",{type:"checkbox",checked:e,onChange:()=>(a=>{let d=!1!==b[a];c({...b,[a]:!d})})(a.id),className:"cursor-pointer"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]},a.id)})})]})}function r({viewType:a,settings:b,fields:c,onSettingsChange:f,description:g,displayField:n,displayFieldCandidates:r,onDisplayFieldChange:s,updatingDisplayField:t,columnVisibility:u,onColumnVisibilityChange:v,stickyFirstColumn:w,onStickyFirstColumnChange:x}){let[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),B=!!(g&&g.trim()),C=!!(r&&r.length>0&&s),D=!!(v&&"table"===a);return B||C||D||"table"!==a?(0,d.jsxs)("div",{className:"relative",ref:A,children:[(0,d.jsx)("button",{type:"button",onClick:()=>z(!y),className:"flex items-center justify-center w-7 h-7 rounded-md hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer",style:{color:"var(--color-text-muted)"},title:"View settings","aria-label":"View settings",children:(0,d.jsx)(m,{})}),y&&(0,d.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 rounded-lg border shadow-lg p-3 min-w-[220px] sm:min-w-[260px] max-w-[calc(100vw-2rem)] flex flex-col gap-3",style:{borderColor:"var(--color-border)",background:"var(--color-surface)",boxShadow:"0 8px 24px rgba(0,0,0,0.12)"},children:[(0,d.jsx)("div",{className:"text-[11px] font-semibold",style:{color:"var(--color-text)"},children:{table:"Table Settings",kanban:"Board Settings",calendar:"Calendar Settings",timeline:"Timeline Settings",gallery:"Gallery Settings",list:"List Settings"}[a]}),B&&(0,d.jsx)(o,{description:g}),C&&(0,d.jsx)(p,{displayField:n,candidates:r,onChange:s,updating:!!t}),"kanban"===a&&(0,d.jsx)(h,{settings:b,fields:c,onSettingsChange:f}),"calendar"===a&&(0,d.jsx)(i,{settings:b,fields:c,onSettingsChange:f}),"timeline"===a&&(0,d.jsx)(j,{settings:b,fields:c,onSettingsChange:f}),"gallery"===a&&(0,d.jsx)(k,{settings:b,fields:c,onSettingsChange:f}),"list"===a&&(0,d.jsx)(l,{settings:b,fields:c,onSettingsChange:f}),D&&(0,d.jsx)(q,{fields:c,columnVisibility:u??{},onColumnVisibilityChange:v,stickyFirstColumn:w,onStickyFirstColumnChange:x})]})]}):null}},525365:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],f=(0,d.A)("search",e)},529294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},530342:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(944002),e=c(887011);b.matches=function(a){return a=e.cloneDeep(a),b=>d.isMatch(b,a)}},530858:(a,b,c)=>{"use strict";c.d(b,{i:()=>f});var d=c(286102),e=c(502714);function f(a,b){let{start:c,end:f}=(0,d.P)(b?.in,a),g=+c>+f,h=g?+c:+f,i=g?f:c;i.setHours(0,0,0,0),i.setDate(1);let j=b?.step??1;if(!j)return[];j<0&&(j=-j,g=!g);let k=[];for(;+i<=h;)k.push((0,e.w)(c,i)),i.setMonth(i.getMonth()+j);return g?k.reverse():k}},532513:(a,b,c)=>{"use strict";c.d(b,{x:()=>s});var d=c(736927),e=c(115962),f=c(981918),g=c(612563),h=c(379924),i=c(86839),j=c(707201),k=c(568443),l=c(18886),m=c(130526);function n(a){return null==a?"":"object"==typeof a?JSON.stringify(a):"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):""}function o({entry:a,fields:b,members:c,relationLabels:e,onEntryClick:g,objectName:h,onToast:i}){let j=n(a.entry_id)||"",{attributes:k,listeners:l,setNodeRef:m,isDragging:o}=(0,f.PM)({id:j,data:{entry:a}});return(0,d.jsx)("div",{ref:m,...l,...k,onClick:a=>{!o&&g&&(a.stopPropagation(),g(j))},className:"rounded-lg p-3 mb-2 transition-all duration-100 cursor-grab active:cursor-grabbing select-none",style:{background:"var(--color-surface)",border:`1px solid ${o?"var(--color-accent)":"var(--color-border)"}`,opacity:o?.4:1,transform:o?"scale(1.02)":void 0},children:(0,d.jsx)(p,{entry:a,fields:b,members:c,relationLabels:e,objectName:h,onToast:i})})}function p({entry:a,fields:b,members:c,relationLabels:e,objectName:f,onToast:i}){let k=function(a,b){let c=b.find(a=>a.name.toLowerCase().includes("name")||a.name.toLowerCase().includes("title"));return c?n(a[c.name])||"Untitled":n(a[b[0]?.name])||"Untitled"}(a,b),o=(0,m.I)(a,b),p=b.filter(a=>"action"===a.type),r=b.filter(a=>"action"!==a.type).filter(b=>"richtext"!==b.type&&null!==a[b.name]&&void 0!==a[b.name]&&""!==a[b.name]).slice(0,4),s=b.find(a=>a.name.toLowerCase().includes("name")||a.name.toLowerCase().includes("title"));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-1.5 min-w-0",style:{color:"var(--color-text)"},children:[o?.faviconUrl&&(0,d.jsx)(l.A,{src:o.faviconUrl,className:"w-4 h-4 rounded-[4px] shrink-0"}),(0,d.jsx)("div",{className:"text-sm font-medium truncate min-w-0",children:k})]}),(0,d.jsx)("div",{className:"space-y-1",children:r.filter(a=>a!==s).slice(0,3).map(b=>{let f=a[b.name];if(!f)return null;let i=n(f);if("user"===b.type){let a=c?.find(a=>a.id===i);a&&(i=a.name)}else if("relation"===b.type){let a=e?.[b.name];i=(function(a){if(!a)return[];let b=a.trim();if(!b)return[];if(b.startsWith("["))try{let a=JSON.parse(b);if(Array.isArray(a))return a.map(String).filter(Boolean)}catch{}return[b]})(i).map(b=>a?.[b]??b).join(", ")}let j="tags"===b.type?(0,h.k)(f):[];return(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)"},children:[b.name,":"]}),"enum"===b.type?(0,d.jsx)(q,{value:n(f),enumValues:b.enum_values,enumColors:b.enum_colors}):"tags"===b.type?(0,d.jsxs)("span",{className:"flex items-center gap-0.5 flex-wrap",children:[j.slice(0,3).map(a=>{let b=(0,g.KJ)(a),c="link"===b.kind&&b.href,e="url"===b.linkType&&!!b.faviconUrl;return c?(0,d.jsxs)("a",{href:b.href,target:"url"===b.linkType||"file"===b.linkType?"_blank":void 0,rel:"url"===b.linkType||"file"===b.linkType?"noopener noreferrer":void 0,onClick:a=>a.stopPropagation(),className:"inline-flex items-center gap-1 px-1.5 py-0 rounded text-[11px] font-medium hover:underline underline-offset-2 max-w-[220px]",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-accent)"},children:[e&&(0,d.jsx)(l.A,{src:b.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:b.text})]},a):(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0 rounded text-[11px] font-medium",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-text-muted)"},children:a},a)}),j.length>3&&(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)",opacity:.6},children:["+",j.length-3]})]}):"relation"===b.type?(0,d.jsxs)("span",{className:"truncate inline-flex items-center gap-0.5",style:{color:"#60a5fa"},children:[(0,d.jsxs)("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",style:{opacity:.5},children:[(0,d.jsx)("path",{d:"M7 7h10v10"}),(0,d.jsx)("path",{d:"M7 17 17 7"})]}),i]}):(0,d.jsx)("span",{className:"whitespace-pre-line line-clamp-2",style:{color:"var(--color-text)"},children:i})]},b.id)})}),f&&p.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1 mt-2 pt-1.5",style:{borderTop:"1px solid var(--color-border)"},onClick:a=>a.stopPropagation(),children:p.flatMap(b=>(function(a){if(!a)return[];try{let b=JSON.parse(a);if(b&&Array.isArray(b.actions))return b.actions}catch{}return[]})(b.default_value).map(c=>(0,d.jsx)(j.r,{action:c,entryId:String(a.entry_id??""),objectName:f,fieldId:b.id,compact:!0,onToast:i},`${b.id}_${c.id}`)))})]})}function q({value:a,enumValues:b,enumColors:c}){let e=b?.indexOf(a)??-1,f=e>=0&&c?c[e]:"#94a3b8";return(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0 rounded text-[11px] font-medium",style:{background:`${f}20`,color:f},children:a})}function r({columnName:a,color:b,items:c,cardFields:g,members:h,relationLabels:i,onEntryClick:j,isOver:k,groupFieldId:l,objectName:m,onRefresh:p,onToast:q}){let{setNodeRef:r}=(0,f.zM)({id:`column:${a}`}),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(a),[w,x]=(0,e.useState)(!1),y=(0,e.useRef)(null),z=(0,e.useCallback)(async()=>{let b=u.trim();if(!b||b===a||!l){t(!1),v(a);return}x(!0);try{(await fetch(`/api/workspace/objects/${encodeURIComponent(m)}/fields/${encodeURIComponent(l)}/enum-rename`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldValue:a,newValue:b})})).ok?p?.():v(a)}catch{v(a)}finally{x(!1),t(!1)}},[u,a,l,m,p]);return(0,d.jsxs)("div",{ref:r,className:"flex-shrink-0 flex flex-col rounded-xl transition-colors duration-150",style:{width:"280px",background:k?"var(--color-surface)":"var(--color-bg)",border:`1px solid ${k?"var(--color-accent)":"var(--color-border)"}`},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:b}}),s?(0,d.jsx)("input",{ref:y,value:u,onChange:a=>v(a.target.value),onBlur:z,onKeyDown:b=>{"Enter"===b.key&&z(),"Escape"===b.key&&(v(a),t(!1))},disabled:w,className:"text-sm font-medium flex-1 bg-transparent outline-none rounded px-1 -mx-1",style:{color:"var(--color-text)",border:"1px solid var(--color-accent)"}}):(0,d.jsx)("span",{className:"text-sm font-medium flex-1 cursor-text rounded px-1 -mx-1 hover:bg-[var(--color-surface-hover)] transition-colors",style:{color:"var(--color-text)"},onDoubleClick:()=>{l&&(v(a),t(!0))},title:l?"Double-click to rename":void 0,children:a}),(0,d.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{background:"var(--color-surface)",color:"var(--color-text-muted)"},children:c.length})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto p-2",style:{minHeight:"80px"},children:0===c.length?(0,d.jsx)("div",{className:"flex items-center justify-center py-8 rounded-lg border border-dashed text-xs transition-colors",style:{borderColor:k?"var(--color-accent)":"var(--color-border)",color:k?"var(--color-accent)":"var(--color-text-muted)"},children:k?"Drop here":"No entries"}):c.map((a,b)=>(0,d.jsx)(o,{entry:a,fields:g,members:h,relationLabels:i,onEntryClick:j,objectName:m,onToast:q},n(a.entry_id)||String(b)))})]})}function s({objectName:a,fields:b,entries:c,statuses:g,members:h,relationLabels:j,onEntryClick:l,onRefresh:m}){let q=(0,k.d)(),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(c),y=(0,f.FR)((0,f.MS)(f.AN,{activationConstraint:{distance:5}})),z=(0,e.useMemo)(()=>{let a=b.find(a=>"enum"===a.type&&a.name.toLowerCase().includes("status"));return a||(b.find(a=>"enum"===a.type)??null)},[b]),A=(0,e.useMemo)(()=>{if(g.length>0)return g.map(a=>({name:a.name,color:a.color??"#94a3b8"}));if(z?.enum_values)return z.enum_values.map((a,b)=>({name:a,color:z.enum_colors?.[b]??"#94a3b8"}));let a=new Set;for(let b of w){let c=z?b[z.name]:void 0;c&&a.add(n(c))}return Array.from(a).map(a=>({name:a,color:"#94a3b8"}))},[g,z,w]),B=(0,e.useMemo)(()=>{let a={};for(let b of A)a[b.name]=[];for(let b of(a._ungrouped=[],w)){let c=z?n(b[z.name]):"";a[c]?a[c].push(b):a._ungrouped.push(b)}return a},[A,w,z]),C=b.filter(a=>a!==z),D=(0,e.useMemo)(()=>s?w.find(a=>String(a.entry_id)===s)??null:null,[s,w]),E=(0,e.useCallback)(a=>{t(String(a.active.id))},[]),F=(0,e.useCallback)(a=>{let b=a.over?.id?String(a.over.id):null;b?.startsWith("column:")?v(b.replace("column:","")):v(null)},[]),G=(0,e.useCallback)(async b=>{t(null),v(null);let{active:c,over:d}=b;if(!d||!z)return;let e=String(d.id);if(!e.startsWith("column:"))return;let f=e.replace("column:",""),g=String(c.id),h=w.find(a=>String(a.entry_id)===g);if(!h)return;let i=n(h[z.name]);if(i!==f){x(a=>a.map(a=>String(a.entry_id)===g?{...a,[z.name]:f}:a));try{(await fetch(`/api/workspace/objects/${encodeURIComponent(a)}/entries/${encodeURIComponent(g)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fields:{[z.name]:f}})})).ok?m?.():x(a=>a.map(a=>String(a.entry_id)===g?{...a,[z.name]:i}:a))}catch{x(a=>a.map(a=>String(a.entry_id)===g?{...a,[z.name]:i}:a))}}},[z,w,a,m]);return z?(0,d.jsxs)(f.Mp,{sensors:y,collisionDetection:f.y$,onDragStart:E,onDragOver:F,onDragEnd:G,children:[(0,d.jsxs)("div",{className:"flex gap-4 overflow-x-auto pb-4 px-1",style:{minHeight:"400px"},children:[A.map(b=>(0,d.jsx)(r,{columnName:b.name,color:b.color,items:B[b.name]??[],cardFields:C,members:h,relationLabels:j,onEntryClick:l,isOver:u===b.name,groupFieldId:z.id,objectName:a,onRefresh:m,onToast:q},b.name)),B._ungrouped?.length>0&&(0,d.jsxs)("div",{className:"flex-shrink-0 flex flex-col rounded-xl",style:{width:"280px",background:"var(--color-bg)",border:"1px dashed var(--color-border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--color-text-muted)"},children:"Ungrouped"}),(0,d.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{background:"var(--color-surface)",color:"var(--color-text-muted)"},children:B._ungrouped.length})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto p-2",children:B._ungrouped.map((b,c)=>(0,d.jsx)(o,{entry:b,fields:C,members:h,relationLabels:j,onEntryClick:l,objectName:a,onToast:q},n(b.entry_id)||String(c)))})]})]}),(0,d.jsx)(f.Hd,{dropAnimation:null,children:D?(0,d.jsx)("div",{className:"rounded-lg p-3 shadow-xl",style:{width:"260px",background:"var(--color-surface)",border:"1px solid var(--color-accent)",transform:"rotate(2deg)"},children:(0,d.jsx)(p,{entry:D,fields:C,members:h,objectName:a,relationLabels:j,onToast:q})}):null})]}):(0,d.jsx)("div",{className:"flex flex-col items-center justify-center py-20 gap-3",children:(0,d.jsxs)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:["No enum field found for kanban grouping in"," ",(0,d.jsx)("span",{className:"font-medium",style:{color:"var(--color-text)"},children:(0,i.PV)(a)})]})})}},534487:(a,b,c)=>{"use strict";c.d(b,{f:()=>f});var d=c(502714),e=c(845722);function f(a,b,c){let f=(0,e.a)(a,c?.in);return isNaN(b)?(0,d.w)(c?.in||a,NaN):(b&&f.setDate(f.getDate()+b),f)}},534864:(a,b,c)=>{"use strict";c.d(b,{X:()=>f});var d=c(115962),e=c(880696);function f(a){let[b,c]=d.useState(void 0);return(0,e.N)(()=>{if(a){c({width:a.offsetWidth,height:a.offsetHeight});let b=new ResizeObserver(b=>{let d,e;if(!Array.isArray(b)||!b.length)return;let f=b[0];if("borderBoxSize"in f){let a=f.borderBoxSize,b=Array.isArray(a)?a[0]:a;d=b.inlineSize,e=b.blockSize}else d=a.offsetWidth,e=a.offsetHeight;c({width:d,height:e})});return b.observe(a,{box:"border-box"}),()=>b.unobserve(a)}c(void 0)},[a]),b}},535798:(a,b,c)=>{"use strict";function d(a){if(!a)return"";let b="string"==typeof a?Date.parse(a):a instanceof Date?a.getTime():a;if(!Number.isFinite(b))return"";let c=Date.now()-b,d=c<0,e=Math.abs(c),f=(a,b)=>d?`in ${a}${b}`:`${a}${b} ago`;return e<6e4?d?"soon":"just now":e<36e5?f(Math.round(e/6e4),"m"):e<864e5?f(Math.round(e/36e5),"h"):e<6048e5?f(Math.round(e/864e5),"d"):e<2592e6?f(Math.round(e/6048e5),"w"):e<31536e6?f(Math.round(e/2592e6),"mo"):f(Math.round(e/31536e6),"y")}function e(a){if(!a)return"";let b="string"==typeof a?new Date(a):a instanceof Date?a:new Date(a);return Number.isNaN(b.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}).format(b)}function f(a){if(!a)return"";let b="string"==typeof a?new Date(a):a instanceof Date?a:new Date(a);if(Number.isNaN(b.getTime()))return"";let c=new Date,d=new Date(c);d.setDate(c.getDate()-1);let e=(a,b)=>a.getFullYear()===b.getFullYear()&&a.getMonth()===b.getMonth()&&a.getDate()===b.getDate();return e(b,c)?"Today":e(b,d)?"Yesterday":new Intl.DateTimeFormat(void 0,{weekday:"short",month:"short",day:"numeric",year:b.getFullYear()!==c.getFullYear()?"numeric":void 0}).format(b)}c.d(b,{Vv:()=>e,_H:()=>f,wI:()=>d})},537889:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(653913),e=c(670016),f=c(530342),g=c(786975);b.iteratee=function(a){if(null==a)return d.identity;switch(typeof a){case"function":return a;case"object":if(Array.isArray(a)&&2===a.length)return g.matchesProperty(a[0],a[1]);return f.matches(a);case"string":case"symbol":case"number":return e.property(a)}}},545182:(a,b,c)=>{"use strict";c.d(b,{x:()=>e});var d=c(736927);function e({href:a,openInNewTab:b=!0,title:c="Open link",className:e}){return(0,d.jsx)("a",{href:a,...b?{target:"_blank",rel:"noopener noreferrer"}:{},title:c,"aria-label":c,onPointerDown:a=>a.stopPropagation(),onClick:a=>a.stopPropagation(),onDoubleClick:a=>a.stopPropagation(),className:e??"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md hover:bg-black/5",children:(0,d.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M7 7h10v10"}),(0,d.jsx)("path",{d:"M7 17 17 7"})]})})}},545343:(a,b,c)=>{"use strict";c.d(b,{q:()=>e});let d={};function e(){return d}},551651:(a,b,c)=>{"use strict";function d(a){let b=[],c=0;for(let d of a.matchAll(/```diff\s*\n([\s\S]*?)```/g)){let e=a.slice(c,d.index);e.trim()&&b.push({type:"text",text:e});let f=d[1].trimEnd();f?b.push({type:"diff-artifact",diff:f}):b.push({type:"text",text:d[0]}),c=(d.index??0)+d[0].length}let d=a.slice(c);return d.trim()&&b.push({type:"text",text:d}),b}function e(a){return a.includes("```diff")}c.d(b,{g:()=>d,k:()=>e})},554327:(a,b,c)=>{"use strict";c.d(b,{F:()=>d,J:()=>e});let d={displayName:"Dench Integrations",singularDisplayName:"Dench Integration",searchLabel:"Searching Dench Integrations",callLabel:"Calling Dench Integration",genericToolLabel:"Using Dench Integrations",attentionLabel:"Dench Integrations needs attention"};function e(a,b){let c=`Failed to ${a} ${d.displayName} status`;return"number"==typeof b?`${c} (${b})`:`${c}.`}},554818:(a,b,c)=>{"use strict";let d,e,f;c.d(b,{P:()=>fI});let g=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],h=new Set(g),i=(a,b,c)=>c>b?b:c<a?a:c,j={test:a=>"number"==typeof a,parse:parseFloat,transform:a=>a},k={...j,transform:a=>i(0,1,a)},l={...j,default:1},m=a=>Math.round(1e5*a)/1e5,n=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,o=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,p=(a,b)=>c=>!!("string"==typeof c&&o.test(c)&&c.startsWith(a)||b&&null!=c&&Object.prototype.hasOwnProperty.call(c,b)),q=(a,b,c)=>d=>{if("string"!=typeof d)return d;let[e,f,g,h]=d.match(n);return{[a]:parseFloat(e),[b]:parseFloat(f),[c]:parseFloat(g),alpha:void 0!==h?parseFloat(h):1}},r={...j,transform:a=>Math.round(i(0,255,a))},s={test:p("rgb","red"),parse:q("red","green","blue"),transform:({red:a,green:b,blue:c,alpha:d=1})=>"rgba("+r.transform(a)+", "+r.transform(b)+", "+r.transform(c)+", "+m(k.transform(d))+")"},t={test:p("#"),parse:function(a){let b="",c="",d="",e="";return a.length>5?(b=a.substring(1,3),c=a.substring(3,5),d=a.substring(5,7),e=a.substring(7,9)):(b=a.substring(1,2),c=a.substring(2,3),d=a.substring(3,4),e=a.substring(4,5),b+=b,c+=c,d+=d,e+=e),{red:parseInt(b,16),green:parseInt(c,16),blue:parseInt(d,16),alpha:e?parseInt(e,16)/255:1}},transform:s.transform},u=a=>({test:b=>"string"==typeof b&&b.endsWith(a)&&1===b.split(" ").length,parse:parseFloat,transform:b=>`${b}${a}`}),v=u("deg"),w=u("%"),x=u("px"),y=u("vh"),z=u("vw"),A={...w,parse:a=>w.parse(a)/100,transform:a=>w.transform(100*a)},B={test:p("hsl","hue"),parse:q("hue","saturation","lightness"),transform:({hue:a,saturation:b,lightness:c,alpha:d=1})=>"hsla("+Math.round(a)+", "+w.transform(m(b))+", "+w.transform(m(c))+", "+m(k.transform(d))+")"},C={test:a=>s.test(a)||t.test(a)||B.test(a),parse:a=>s.test(a)?s.parse(a):B.test(a)?B.parse(a):t.parse(a),transform:a=>"string"==typeof a?a:a.hasOwnProperty("red")?s.transform(a):B.transform(a),getAnimatableNone:a=>{let b=C.parse(a);return b.alpha=0,C.transform(b)}},D=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,E="number",F="color",G=/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 H(a){let b=a.toString(),c=[],d={color:[],number:[],var:[]},e=[],f=0,g=b.replace(G,a=>(C.test(a)?(d.color.push(f),e.push(F),c.push(C.parse(a))):a.startsWith("var(")?(d.var.push(f),e.push("var"),c.push(a)):(d.number.push(f),e.push(E),c.push(parseFloat(a))),++f,"${}")).split("${}");return{values:c,split:g,indexes:d,types:e}}function I(a){return H(a).values}function J(a){let{split:b,types:c}=H(a),d=b.length;return a=>{let e="";for(let f=0;f<d;f++)if(e+=b[f],void 0!==a[f]){let b=c[f];b===E?e+=m(a[f]):b===F?e+=C.transform(a[f]):e+=a[f]}return e}}let K=a=>"number"==typeof a?0:C.test(a)?C.getAnimatableNone(a):a,L={test:function(a){return isNaN(a)&&"string"==typeof a&&(a.match(n)?.length||0)+(a.match(D)?.length||0)>0},parse:I,createTransformer:J,getAnimatableNone:function(a){let b=I(a);return J(a)(b.map(K))}},M=new Set(["brightness","contrast","saturate","opacity"]);function N(a){let[b,c]=a.slice(0,-1).split("(");if("drop-shadow"===b)return a;let[d]=c.match(n)||[];if(!d)return a;let e=c.replace(d,""),f=+!!M.has(b);return d!==c&&(f*=100),b+"("+f+e+")"}let O=/\b([a-z-]*)\(.*?\)/gu,P={...L,getAnimatableNone:a=>{let b=a.match(O);return b?b.map(N).join(" "):a}},Q={...j,transform:Math.round},R={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,inset:x,insetBlock:x,insetBlockStart:x,insetBlockEnd:x,insetInline:x,insetInlineStart:x,insetInlineEnd:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,paddingBlock:x,paddingBlockStart:x,paddingBlockEnd:x,paddingInline:x,paddingInlineStart:x,paddingInlineEnd:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,marginBlock:x,marginBlockStart:x,marginBlockEnd:x,marginInline:x,marginInlineStart:x,marginInlineEnd:x,fontSize:x,backgroundPositionX:x,backgroundPositionY:x,rotate:v,rotateX:v,rotateY:v,rotateZ:v,scale:l,scaleX:l,scaleY:l,scaleZ:l,skew:v,skewX:v,skewY:v,distance:x,translateX:x,translateY:x,translateZ:x,x:x,y:x,z:x,perspective:x,transformPerspective:x,opacity:k,originX:A,originY:A,originZ:x,zIndex:Q,fillOpacity:k,strokeOpacity:k,numOctaves:Q},S={...R,color:C,backgroundColor:C,outlineColor:C,fill:C,stroke:C,borderColor:C,borderTopColor:C,borderRightColor:C,borderBottomColor:C,borderLeftColor:C,filter:P,WebkitFilter:P},T=a=>S[a],U=()=>({translate:0,scale:1,origin:0,originPoint:0}),V=()=>({x:U(),y:U()}),W=()=>({min:0,max:0}),X=()=>({x:W(),y:W()}),Y=a=>!!(a&&a.getVelocity),Z=new Set(["width","height","top","left","right","bottom",...g]),_=a=>b=>b.test(a),aa=[j,x,w,v,z,y,{test:a=>"auto"===a,parse:a=>a}],ab=a=>aa.find(_(a)),ac=()=>{},ad=()=>{},ae=a=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(a),af=a=>b=>"string"==typeof b&&b.startsWith(a),ag=af("--"),ah=af("var(--"),ai=a=>!!ah(a)&&aj.test(a.split("/*")[0].trim()),aj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ak(a){return"string"==typeof a&&a.split("/*")[0].includes("var(--")}let al=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,am=a=>180*a/Math.PI,an=a=>ap(am(Math.atan2(a[1],a[0]))),ao={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:a=>(Math.abs(a[0])+Math.abs(a[3]))/2,rotate:an,rotateZ:an,skewX:a=>am(Math.atan(a[1])),skewY:a=>am(Math.atan(a[2])),skew:a=>(Math.abs(a[1])+Math.abs(a[2]))/2},ap=a=>((a%=360)<0&&(a+=360),a),aq=a=>Math.sqrt(a[0]*a[0]+a[1]*a[1]),ar=a=>Math.sqrt(a[4]*a[4]+a[5]*a[5]),as={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:aq,scaleY:ar,scale:a=>(aq(a)+ar(a))/2,rotateX:a=>ap(am(Math.atan2(a[6],a[5]))),rotateY:a=>ap(am(Math.atan2(-a[2],a[0]))),rotateZ:an,rotate:an,skewX:a=>am(Math.atan(a[4])),skewY:a=>am(Math.atan(a[1])),skew:a=>(Math.abs(a[1])+Math.abs(a[4]))/2};function at(a){return+!!a.includes("scale")}function au(a,b){let c,d;if(!a||"none"===a)return at(b);let e=a.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(e)c=as,d=e;else{let b=a.match(/^matrix\(([-\d.e\s,]+)\)$/u);c=ao,d=b}if(!d)return at(b);let f=c[b],g=d[1].split(",").map(av);return"function"==typeof f?f(g):g[f]}function av(a){return parseFloat(a.trim())}let aw=a=>a===j||a===x,ax=new Set(["x","y","z"]),ay=g.filter(a=>!ax.has(a)),az={width:({x:a},{paddingLeft:b="0",paddingRight:c="0"})=>a.max-a.min-parseFloat(b)-parseFloat(c),height:({y:a},{paddingTop:b="0",paddingBottom:c="0"})=>a.max-a.min-parseFloat(b)-parseFloat(c),top:(a,{top:b})=>parseFloat(b),left:(a,{left:b})=>parseFloat(b),bottom:({y:a},{top:b})=>parseFloat(b)+(a.max-a.min),right:({x:a},{left:b})=>parseFloat(b)+(a.max-a.min),x:(a,{transform:b})=>au(b,"x"),y:(a,{transform:b})=>au(b,"y")};az.translateX=az.x,az.translateY=az.y;let aA=a=>a,aB={},aC=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],aD={value:null,addProjectionMetrics:null};function aE(a,b){let c=!1,d=!0,e={delta:0,timestamp:0,isProcessing:!1},f=()=>c=!0,g=aC.reduce((a,c)=>(a[c]=function(a,b){let c=new Set,d=new Set,e=!1,f=!1,g=new WeakSet,h={delta:0,timestamp:0,isProcessing:!1},i=0;function j(b){g.has(b)&&(k.schedule(b),a()),i++,b(h)}let k={schedule:(a,b=!1,f=!1)=>{let h=f&&e?c:d;return b&&g.add(a),h.has(a)||h.add(a),a},cancel:a=>{d.delete(a),g.delete(a)},process:a=>{if(h=a,e){f=!0;return}e=!0,[c,d]=[d,c],c.forEach(j),b&&aD.value&&aD.value.frameloop[b].push(i),i=0,c.clear(),e=!1,f&&(f=!1,k.process(a))}};return k}(f,b?c:void 0),a),{}),{setup:h,read:i,resolveKeyframes:j,preUpdate:k,update:l,preRender:m,render:n,postRender:o}=g,p=()=>{let f=aB.useManualTiming?e.timestamp:performance.now();c=!1,aB.useManualTiming||(e.delta=d?1e3/60:Math.max(Math.min(f-e.timestamp,40),1)),e.timestamp=f,e.isProcessing=!0,h.process(e),i.process(e),j.process(e),k.process(e),l.process(e),m.process(e),n.process(e),o.process(e),e.isProcessing=!1,c&&b&&(d=!1,a(p))};return{schedule:aC.reduce((b,f)=>{let h=g[f];return b[f]=(b,f=!1,g=!1)=>(!c&&(c=!0,d=!0,e.isProcessing||a(p)),h.schedule(b,f,g)),b},{}),cancel:a=>{for(let b=0;b<aC.length;b++)g[aC[b]].cancel(a)},state:e,steps:g}}let{schedule:aF,cancel:aG,state:aH,steps:aI}=aE("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:aA,!0),aJ=new Set,aK=!1,aL=!1,aM=!1;function aN(){if(aL){let a=Array.from(aJ).filter(a=>a.needsMeasurement),b=new Set(a.map(a=>a.element)),c=new Map;b.forEach(a=>{let b=function(a){let b=[];return ay.forEach(c=>{let d=a.getValue(c);void 0!==d&&(b.push([c,d.get()]),d.set(+!!c.startsWith("scale")))}),b}(a);b.length&&(c.set(a,b),a.render())}),a.forEach(a=>a.measureInitialState()),b.forEach(a=>{a.render();let b=c.get(a);b&&b.forEach(([b,c])=>{a.getValue(b)?.set(c)})}),a.forEach(a=>a.measureEndState()),a.forEach(a=>{void 0!==a.suspendedScrollY&&window.scrollTo(0,a.suspendedScrollY)})}aL=!1,aK=!1,aJ.forEach(a=>a.complete(aM)),aJ.clear()}function aO(){aJ.forEach(a=>{a.readKeyframes(),a.needsMeasurement&&(aL=!0)})}class aP{constructor(a,b,c,d,e,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...a],this.onComplete=b,this.name=c,this.motionValue=d,this.element=e,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(aJ.add(this),aK||(aK=!0,aF.read(aO),aF.resolveKeyframes(aN))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:a,name:b,element:c,motionValue:d}=this;if(null===a[0]){let e=d?.get(),f=a[a.length-1];if(void 0!==e)a[0]=e;else if(c&&b){let d=c.readValue(b,f);null!=d&&(a[0]=d)}void 0===a[0]&&(a[0]=f),d&&void 0===e&&d.set(a[0])}for(let b=1;b<a.length;b++)a[b]??(a[b]=a[b-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(a=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,a),aJ.delete(this)}cancel(){"scheduled"===this.state&&(aJ.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}let aQ=a=>/^0[^.\s]+$/u.test(a);function aR(a,b){let c=T(a);return c!==P&&(c=L),c.getAnimatableNone?c.getAnimatableNone(b):void 0}let aS=new Set(["auto","none","0"]);class aT extends aP{constructor(a,b,c,d,e){super(a,b,c,d,e,!0)}readKeyframes(){let{unresolvedKeyframes:a,element:b,name:c}=this;if(!b||!b.current)return;super.readKeyframes();for(let c=0;c<a.length;c++){let d=a[c];if("string"==typeof d&&ai(d=d.trim())){let e=function a(b,c,d=1){ad(d<=4,`Max CSS variable fallback depth detected in property "${b}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[e,f]=function(a){let b=al.exec(a);if(!b)return[,];let[,c,d,e]=b;return[`--${c??d}`,e]}(b);if(!e)return;let g=window.getComputedStyle(c).getPropertyValue(e);if(g){let a=g.trim();return ae(a)?parseFloat(a):a}return ai(f)?a(f,c,d+1):f}(d,b.current);void 0!==e&&(a[c]=e),c===a.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Z.has(c)||2!==a.length)return;let[d,e]=a,f=ab(d),g=ab(e);if(ak(d)!==ak(e)&&az[c]){this.needsMeasurement=!0;return}if(f!==g)if(aw(f)&&aw(g))for(let b=0;b<a.length;b++){let c=a[b];"string"==typeof c&&(a[b]=parseFloat(c))}else az[c]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:a,name:b}=this,c=[];for(let b=0;b<a.length;b++){var d;(null===a[b]||("number"==typeof(d=a[b])?0===d:null===d||"none"===d||"0"===d||aQ(d)))&&c.push(b)}c.length&&function(a,b,c){let d,e=0;for(;e<a.length&&!d;){let b=a[e];"string"==typeof b&&!aS.has(b)&&H(b).values.length&&(d=a[e]),e++}if(d&&c)for(let e of b)a[e]=aR(c,d)}(a,c,b)}measureInitialState(){let{element:a,unresolvedKeyframes:b,name:c}=this;if(!a||!a.current)return;"height"===c&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=az[c](a.measureViewportBox(),window.getComputedStyle(a.current)),b[0]=this.measuredOrigin;let d=b[b.length-1];void 0!==d&&a.getValue(c,d).jump(d,!1)}measureEndState(){let{element:a,name:b,unresolvedKeyframes:c}=this;if(!a||!a.current)return;let d=a.getValue(b);d&&d.jump(this.measuredOrigin,!1);let e=c.length-1,f=c[e];c[e]=az[b](a.measureViewportBox(),window.getComputedStyle(a.current)),null!==f&&void 0===this.finalKeyframe&&(this.finalKeyframe=f),this.removedTransforms?.length&&this.removedTransforms.forEach(([b,c])=>{a.getValue(b).set(c)}),this.resolveNoneKeyframes()}}let aU=a=>1e3*a;function aV(a,b){-1===a.indexOf(b)&&a.push(b)}function aW(a,b){let c=a.indexOf(b);c>-1&&a.splice(c,1)}class aX{constructor(){this.subscriptions=[]}add(a){return aV(this.subscriptions,a),()=>aW(this.subscriptions,a)}notify(a,b,c){let d=this.subscriptions.length;if(d)if(1===d)this.subscriptions[0](a,b,c);else for(let e=0;e<d;e++){let d=this.subscriptions[e];d&&d(a,b,c)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function aY(a){let b;return()=>(void 0===b&&(b=a()),b)}let aZ=aY(()=>void 0!==window.ScrollTimeline),a$=a=>null!==a;function a_(a,{repeat:b,repeatType:c="loop"},d,e=1){let f=a.filter(a$),g=e<0||b&&"loop"!==c&&b%2==1?0:f.length-1;return g&&void 0!==d?d:f[g]}class a0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(a=>{this.resolve=a})}notifyFinished(){this.resolve()}then(a,b){return this.finished.then(a,b)}}let a1={layout:0,mainThread:0,waapi:0},a2=a=>Array.isArray(a)&&"number"==typeof a[0],a3={},a4=function(a,b){let c=aY(a);return()=>a3[b]??c()}(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(a){return!1}return!0},"linearEasing"),a5=(a,b,c=10)=>{let d="",e=Math.max(Math.round(b/c),2);for(let b=0;b<e;b++)d+=Math.round(1e4*a(b/(e-1)))/1e4+", ";return`linear(${d.substring(0,d.length-2)})`},a6=([a,b,c,d])=>`cubic-bezier(${a}, ${b}, ${c}, ${d})`,a7={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:a6([0,.65,.55,1]),circOut:a6([.55,0,1,.45]),backIn:a6([.31,.01,.66,-.59]),backOut:a6([.33,1.53,.69,.99])};function a8(a){return"function"==typeof a&&"applyToOptions"in a}class a9 extends a0{constructor(a){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!a)return;let{element:b,name:c,keyframes:d,pseudoElement:e,allowFlatten:f=!1,finalKeyframe:g,onComplete:h}=a;this.isPseudoElement=!!e,this.allowFlatten=f,this.options=a,ad("string"!=typeof a.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");let i=function({type:a,...b}){return a8(a)&&a4()?a.applyToOptions(b):(b.duration??(b.duration=300),b.ease??(b.ease="easeOut"),b)}(a);this.animation=function(a,b,c,{delay:d=0,duration:e=300,repeat:f=0,repeatType:g="loop",ease:h="easeOut",times:i}={},j){let k={[b]:c};i&&(k.offset=i);let l=function a(b,c){if(b)return"function"==typeof b?a4()?a5(b,c):"ease-out":a2(b)?a6(b):Array.isArray(b)?b.map(b=>a(b,c)||a7.easeOut):a7[b]}(h,e);Array.isArray(l)&&(k.easing=l),aD.value&&a1.waapi++;let m={delay:d,duration:e,easing:Array.isArray(l)?"linear":l,fill:"both",iterations:f+1,direction:"reverse"===g?"alternate":"normal"};j&&(m.pseudoElement=j);let n=a.animate(k,m);return aD.value&&n.finished.finally(()=>{a1.waapi--}),n}(b,c,d,i,e),!1===i.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!e){let a=a_(d,this.options,g,this.speed);this.updateMotionValue?this.updateMotionValue(a):function(a,b,c){b.startsWith("--")?a.style.setProperty(b,c):a.style[b]=c}(b,c,a),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(a){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:a}=this;"idle"!==a&&"finished"!==a&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let a=this.options?.element;!this.isPseudoElement&&a?.isConnected&&this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:a=0}=this.options||{};return this.duration+a/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(a){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=aU(a)}get speed(){return this.animation.playbackRate}set speed(a){a<0&&(this.finishedTime=null),this.animation.playbackRate=a}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(a){this.manualStartTime=this.animation.startTime=a}attachTimeline({timeline:a,observe:b}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,a&&aZ())?(this.animation.timeline=a,aA):b(this)}}let ba=new Set(["opacity","clipPath","filter","transform"]),{schedule:bb}=aE(queueMicrotask,!1);function bc(){d=void 0}let bd={now:()=>(void 0===d&&bd.set(aH.isProcessing||aB.useManualTiming?aH.timestamp:performance.now()),d),set:a=>{d=a,queueMicrotask(bc)}},be={current:void 0};class bf{constructor(a,b={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{let b=bd.now();if(this.updatedAt!==b&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(a),this.owner=b.owner}setCurrent(a){this.current=a,this.updatedAt=bd.now(),null===this.canTrackVelocity&&void 0!==a&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,b){this.events[a]||(this.events[a]=new aX);let c=this.events[a].add(b);return"change"===a?()=>{c(),aF.read(()=>{this.events.change.getSize()||this.stop()})}:c}clearListeners(){for(let a in this.events)this.events[a].clear()}attach(a,b){this.passiveEffect=a,this.stopPassiveEffect=b}set(a){this.passiveEffect?this.passiveEffect(a,this.updateAndNotify):this.updateAndNotify(a)}setWithVelocity(a,b,c){this.set(b),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-c}jump(a,b=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,b&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(a){this.dependents||(this.dependents=new Set),this.dependents.add(a)}removeDependent(a){this.dependents&&this.dependents.delete(a)}get(){return be.current&&be.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var a;let b=bd.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||b-this.updatedAt>30)return 0;let c=Math.min(this.updatedAt-this.prevUpdatedAt,30);return a=parseFloat(this.current)-parseFloat(this.prevFrameValue),c?1e3/c*a:0}start(a){return this.stop(),new Promise(b=>{this.hasAnimated=!0,this.animation=a(b),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 bg(a,b){return new bf(a,b)}let bh=[...aa,C,L],bi=new WeakMap;function bj(a){return null!==a&&"object"==typeof a&&"function"==typeof a.start}function bk(a){return"string"==typeof a||Array.isArray(a)}let bl=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bm=["initial",...bl];function bn(a){return bj(a.animate)||bm.some(b=>bk(a[b]))}function bo(a){return!!(bn(a)||a.variants)}let bp={current:null},bq={current:!1},br="undefined"!=typeof window;function bs(a){let b=[{},{}];return a?.values.forEach((a,c)=>{b[0][c]=a.get(),b[1][c]=a.getVelocity()}),b}function bt(a,b,c,d){if("function"==typeof b){let[e,f]=bs(d);b=b(void 0!==c?c:a.custom,e,f)}if("string"==typeof b&&(b=a.variants&&a.variants[b]),"function"==typeof b){let[e,f]=bs(d);b=b(void 0!==c?c:a.custom,e,f)}return b}let bu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],bv={};class bw{scrapeMotionValuesFromProps(a,b,c){return{}}constructor({parent:a,props:b,presenceContext:c,reducedMotionConfig:d,skipAnimations:e,blockInitialAnimation:f,visualState:g},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=aP,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let a=bd.now();this.renderScheduledAt<a&&(this.renderScheduledAt=a,aF.render(this.render,!1,!0))};let{latestValues:i,renderState:j}=g;this.latestValues=i,this.baseTarget={...i},this.initialValues=b.initial?{...i}:{},this.renderState=j,this.parent=a,this.props=b,this.presenceContext=c,this.depth=a?a.depth+1:0,this.reducedMotionConfig=d,this.skipAnimationsConfig=e,this.options=h,this.blockInitialAnimation=!!f,this.isControllingVariants=bn(b),this.isVariantNode=bo(b),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);let{willChange:k,...l}=this.scrapeMotionValuesFromProps(b,{},this);for(let a in l){let b=l[a];void 0!==i[a]&&Y(b)&&b.set(i[a])}}mount(a){if(this.hasBeenMounted)for(let a in this.initialValues)this.values.get(a)?.jump(this.initialValues[a]),this.latestValues[a]=this.initialValues[a];this.current=a,bi.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,b)=>this.bindToMotionValue(b,a)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(bq.current||function(){if(bq.current=!0,br)if(window.matchMedia){let a=window.matchMedia("(prefers-reduced-motion)"),b=()=>bp.current=a.matches;a.addEventListener("change",b),b()}else bp.current=!1}(),this.shouldReduceMotion=bp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let a in this.projection&&this.projection.unmount(),aG(this.notifyUpdate),aG(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[a].clear();for(let a in this.features){let b=this.features[a];b&&(b.unmount(),b.isMounted=!1)}this.current=null}addChild(a){this.children.add(a),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(a)}removeChild(a){this.children.delete(a),this.enteringChildren&&this.enteringChildren.delete(a)}bindToMotionValue(a,b){let c;if(this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)(),b.accelerate&&ba.has(a)&&this.current instanceof HTMLElement){let{factory:c,keyframes:d,times:e,ease:f,duration:g}=b.accelerate,h=new a9({element:this.current,name:a,keyframes:d,times:e,ease:f,duration:aU(g)}),i=c(h);this.valueSubscriptions.set(a,()=>{i(),h.cancel()});return}let d=h.has(a);d&&this.onBindTransform&&this.onBindTransform();let e=b.on("change",b=>{this.latestValues[a]=b,this.props.onUpdate&&aF.preRender(this.notifyUpdate),d&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"undefined"!=typeof window&&window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,a,b)),this.valueSubscriptions.set(a,()=>{e(),c&&c(),b.owner&&b.stop()})}sortNodePosition(a){return this.current&&this.sortInstanceNodePosition&&this.type===a.type?this.sortInstanceNodePosition(this.current,a.current):0}updateFeatures(){let a="animation";for(a in bv){let b=bv[a];if(!b)continue;let{isEnabled:c,Feature:d}=b;if(!this.features[a]&&d&&c(this.props)&&(this.features[a]=new d(this)),this.features[a]){let b=this.features[a];b.isMounted?b.update():(b.mount(),b.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):X()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,b){this.latestValues[a]=b}update(a,b){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=b;for(let b=0;b<bu.length;b++){let c=bu[b];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);let d=a["on"+c];d&&(this.propEventSubscriptions[c]=this.on(c,d))}this.prevMotionValues=function(a,b,c){for(let d in b){let e=b[d],f=c[d];if(Y(e))a.addValue(d,e);else if(Y(f))a.addValue(d,bg(e,{owner:a}));else if(f!==e)if(a.hasValue(d)){let b=a.getValue(d);!0===b.liveStyle?b.jump(e):b.hasAnimated||b.set(e)}else{let b=a.getStaticValue(d);a.addValue(d,bg(void 0!==b?b:e,{owner:a}))}}for(let d in c)void 0===b[d]&&a.removeValue(d);return b}(this,this.scrapeMotionValuesFromProps(a,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]: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(a){let b=this.getClosestVariantNode();if(b)return b.variantChildren&&b.variantChildren.add(a),()=>b.variantChildren.delete(a)}addValue(a,b){let c=this.values.get(a);b!==c&&(c&&this.removeValue(a),this.bindToMotionValue(a,b),this.values.set(a,b),this.latestValues[a]=b.get())}removeValue(a){this.values.delete(a);let b=this.valueSubscriptions.get(a);b&&(b(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,b){if(this.props.values&&this.props.values[a])return this.props.values[a];let c=this.values.get(a);return void 0===c&&void 0!==b&&(c=bg(null===b?void 0:b,{owner:this}),this.addValue(a,c)),c}readValue(a,b){let c=void 0===this.latestValues[a]&&this.current?this.getBaseTargetFromProps(this.props,a)??this.readValueFromInstance(this.current,a,this.options):this.latestValues[a];if(null!=c){if("string"==typeof c&&(ae(c)||aQ(c)))c=parseFloat(c);else{let d;d=c,!bh.find(_(d))&&L.test(b)&&(c=aR(a,b))}this.setBaseTarget(a,Y(c)?c.get():c)}return Y(c)?c.get():c}setBaseTarget(a,b){this.baseTarget[a]=b}getBaseTarget(a){let b,{initial:c}=this.props;if("string"==typeof c||"object"==typeof c){let d=bt(this.props,c,this.presenceContext?.custom);d&&(b=d[a])}if(c&&void 0!==b)return b;let d=this.getBaseTargetFromProps(this.props,a);return void 0===d||Y(d)?void 0!==this.initialValues[a]&&void 0===b?void 0:this.baseTarget[a]:d}on(a,b){return this.events[a]||(this.events[a]=new aX),this.events[a].add(b)}notify(a,...b){this.events[a]&&this.events[a].notify(...b)}scheduleRenderMicrotask(){bb.render(this.render)}}class bx extends bw{constructor(){super(...arguments),this.KeyframeResolver=aT}sortInstanceNodePosition(a,b){return 2&a.compareDocumentPosition(b)?1:-1}getBaseTargetFromProps(a,b){let c=a.style;return c?c[b]:void 0}removeValueFromRenderState(a,{vars:b,style:c}){delete b[a],delete c[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:a}=this.props;Y(a)&&(this.childSubscription=a.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}}function by(a){return a.replace(/([A-Z])/g,a=>`-${a.toLowerCase()}`)}let bz=(a,b)=>b&&"number"==typeof a?b.transform(a):a,bA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bB=g.length;function bC(a,b,c){let{style:d,vars:e,transformOrigin:f}=a,i=!1,j=!1;for(let a in b){let c=b[a];if(h.has(a)){i=!0;continue}if(ag(a)){e[a]=c;continue}{let b=bz(c,R[a]);a.startsWith("origin")?(j=!0,f[a]=b):d[a]=b}}if(!b.transform&&(i||c?d.transform=function(a,b,c){let d="",e=!0;for(let f=0;f<bB;f++){let h=g[f],i=a[h];if(void 0===i)continue;let j=!0;if("number"==typeof i)j=i===+!!h.startsWith("scale");else{let a=parseFloat(i);j=h.startsWith("scale")?1===a:0===a}if(!j||c){let a=bz(i,R[h]);if(!j){e=!1;let b=bA[h]||h;d+=`${b}(${a}) `}c&&(b[h]=a)}}return d=d.trim(),c?d=c(b,e?"":d):e&&(d="none"),d}(b,a.transform,c):d.transform&&(d.transform="none")),j){let{originX:a="50%",originY:b="50%",originZ:c=0}=f;d.transformOrigin=`${a} ${b} ${c}`}}let bD={offset:"stroke-dashoffset",array:"stroke-dasharray"},bE={offset:"strokeDashoffset",array:"strokeDasharray"},bF=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function bG(a,{attrX:b,attrY:c,attrScale:d,pathLength:e,pathSpacing:f=1,pathOffset:g=0,...h},i,j,k){if(bC(a,h,j),i){a.style.viewBox&&(a.attrs.viewBox=a.style.viewBox);return}a.attrs=a.style,a.style={};let{attrs:l,style:m}=a;for(let a of(l.transform&&(m.transform=l.transform,delete l.transform),(m.transform||l.transformOrigin)&&(m.transformOrigin=l.transformOrigin??"50% 50%",delete l.transformOrigin),m.transform&&(m.transformBox=k?.transformBox??"fill-box",delete l.transformBox),bF))void 0!==l[a]&&(m[a]=l[a],delete l[a]);void 0!==b&&(l.x=b),void 0!==c&&(l.y=c),void 0!==d&&(l.scale=d),void 0!==e&&function(a,b,c=1,d=0,e=!0){a.pathLength=1;let f=e?bD:bE;a[f.offset]=`${-d}`,a[f.array]=`${b} ${c}`}(l,e,f,g,!1)}let bH=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"]),bI=a=>"string"==typeof a&&"svg"===a.toLowerCase();function bJ(a,{style:b,vars:c},d,e){let f,g=a.style;for(f in b)g[f]=b[f];for(f in e?.applyProjectionStyles(g,d),c)g.setProperty(f,c[f])}function bK(a,b){return b.max===b.min?0:a/(b.max-b.min)*100}let bL={correct:(a,b)=>{if(!b.target)return a;if("string"==typeof a)if(!x.test(a))return a;else a=parseFloat(a);let c=bK(a,b.target.x),d=bK(a,b.target.y);return`${c}% ${d}%`}},bM=(a,b,c)=>a+(b-a)*c,bN={borderRadius:{...bL,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bL,borderTopRightRadius:bL,borderBottomLeftRadius:bL,borderBottomRightRadius:bL,boxShadow:{correct:(a,{treeScale:b,projectionDelta:c})=>{let d=L.parse(a);if(d.length>5)return a;let e=L.createTransformer(a),f=+("number"!=typeof d[0]),g=c.x.scale*b.x,h=c.y.scale*b.y;d[0+f]/=g,d[1+f]/=h;let i=bM(g,h,.5);return"number"==typeof d[2+f]&&(d[2+f]/=i),"number"==typeof d[3+f]&&(d[3+f]/=i),e(d)}}};function bO(a,{layout:b,layoutId:c}){return h.has(a)||a.startsWith("origin")||(b||void 0!==c)&&(!!bN[a]||"opacity"===a)}function bP(a,b,c){let d=a.style,e=b?.style,f={};if(!d)return f;for(let b in d)(Y(d[b])||e&&Y(e[b])||bO(b,a)||c?.getValue(b)?.liveStyle!==void 0)&&(f[b]=d[b]);return f}function bQ(a,b,c){let d=bP(a,b,c);for(let c in a)(Y(a[c])||Y(b[c]))&&(d[-1!==g.indexOf(c)?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c]=a[c]);return d}class bR extends bx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=X}getBaseTargetFromProps(a,b){return a[b]}readValueFromInstance(a,b){if(h.has(b)){let a=T(b);return a&&a.default||0}return b=bH.has(b)?b:by(b),a.getAttribute(b)}scrapeMotionValuesFromProps(a,b,c){return bQ(a,b,c)}build(a,b,c){bG(a,b,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(a,b,c,d){for(let c in bJ(a,b,void 0,d),b.attrs)a.setAttribute(bH.has(c)?c:by(c),b.attrs[c])}mount(a){this.isSVGTag=bI(a.tagName),super.mount(a)}}function bS({top:a,left:b,right:c,bottom:d}){return{x:{min:b,max:c},y:{min:a,max:d}}}function bT(a){return void 0===a||1===a}function bU({scale:a,scaleX:b,scaleY:c}){return!bT(a)||!bT(b)||!bT(c)}function bV(a){return bU(a)||bW(a)||a.z||a.rotate||a.rotateX||a.rotateY||a.skewX||a.skewY}function bW(a){var b,c;return(b=a.x)&&"0%"!==b||(c=a.y)&&"0%"!==c}function bX(a,b,c,d,e){return void 0!==e&&(a=d+e*(a-d)),d+c*(a-d)+b}function bY(a,b=0,c=1,d,e){a.min=bX(a.min,b,c,d,e),a.max=bX(a.max,b,c,d,e)}function bZ(a,{x:b,y:c}){bY(a.x,b.translate,b.scale,b.originPoint),bY(a.y,c.translate,c.scale,c.originPoint)}function b$(a,b){a.min=a.min+b,a.max=a.max+b}function b_(a,b,c,d,e=.5){let f=bM(a.min,a.max,e);bY(a,b,c,f,d)}function b0(a,b){b_(a.x,b.x,b.scaleX,b.scale,b.originX),b_(a.y,b.y,b.scaleY,b.scale,b.originY)}function b1(a,b){return bS(function(a,b){if(!b)return a;let c=b({x:a.left,y:a.top}),d=b({x:a.right,y:a.bottom});return{top:c.y,left:c.x,bottom:d.y,right:d.x}}(a.getBoundingClientRect(),b))}class b2 extends bx{constructor(){super(...arguments),this.type="html",this.renderInstance=bJ}readValueFromInstance(a,b){if(h.has(b))return this.projection?.isProjecting?at(b):((a,b)=>{let{transform:c="none"}=getComputedStyle(a);return au(c,b)})(a,b);{let c=window.getComputedStyle(a),d=(ag(b)?c.getPropertyValue(b):c[b])||0;return"string"==typeof d?d.trim():d}}measureInstanceViewportBox(a,{transformPagePoint:b}){return b1(a,b)}build(a,b,c){bC(a,b,c.transformTemplate)}scrapeMotionValuesFromProps(a,b,c){return bP(a,b,c)}}var b3=c(115962);let b4=["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 b5(a){if("string"!=typeof a||a.includes("-"));else if(b4.indexOf(a)>-1||/[A-Z]/u.test(a))return!0;return!1}var b6=c(736927),b7=c(11263);let b8=(0,b3.createContext)({strict:!1});var b9=c(807740);let ca=(0,b3.createContext)({});function cb(a){return Array.isArray(a)?a.join(" "):a}let cc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function cd(a,b,c){for(let d in b)Y(b[d])||bO(d,c)||(a[d]=b[d])}let ce=()=>({...cc(),attrs:{}}),cf=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","propagate","ignoreStrict","viewport"]);function cg(a){return a.startsWith("while")||a.startsWith("drag")&&"draggable"!==a||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||cf.has(a)}let ch=a=>!cg(a);try{!function(a){"function"==typeof a&&(ch=b=>b.startsWith("on")?!cg(b):a(b))}(require("@emotion/is-prop-valid").default)}catch{}function ci(a){return Y(a)?a.get():a}var cj=c(950717),ck=c(41651);let cl=a=>(b,c)=>{let d=(0,b3.useContext)(ca),e=(0,b3.useContext)(cj.t),f=()=>(function({scrapeMotionValuesFromProps:a,createRenderState:b},c,d,e){return{latestValues:function(a,b,c,d){let e={},f=d(a,{});for(let a in f)e[a]=ci(f[a]);let{initial:g,animate:h}=a,i=bn(a),j=bo(a);b&&j&&!i&&!1!==a.inherit&&(void 0===g&&(g=b.initial),void 0===h&&(h=b.animate));let k=!!c&&!1===c.initial,l=(k=k||!1===g)?h:g;if(l&&"boolean"!=typeof l&&!bj(l)){let b=Array.isArray(l)?l:[l];for(let c=0;c<b.length;c++){let d=bt(a,b[c]);if(d){let{transitionEnd:a,transition:b,...c}=d;for(let a in c){let b=c[a];if(Array.isArray(b)){let a=k?b.length-1:0;b=b[a]}null!==b&&(e[a]=b)}for(let b in a)e[b]=a[b]}}}return e}(c,d,e,a),renderState:b()}})(a,b,d,e);return c?f():(0,ck.M)(f)},cm=cl({scrapeMotionValuesFromProps:bP,createRenderState:cc}),cn=cl({scrapeMotionValuesFromProps:bQ,createRenderState:ce});var co=c(589734);let cp={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"]},cq=!1;function cr(){return!function(){if(cq)return;let a={};for(let b in cp)a[b]={isEnabled:a=>cp[b].some(b=>!!a[b])};bv=a,cq=!0}(),bv}let cs=Symbol.for("motionComponentSymbol"),ct="data-"+by("framerAppearId"),cu=(0,b3.createContext)({});function cv(a){return a&&"object"==typeof a&&Object.prototype.hasOwnProperty.call(a,"current")}var cw=c(100546);function cx(a,{forwardMotionProps:b=!1,type:c}={},d,e){d&&function(a){let b=cr();for(let c in a)b[c]={...b[c],...a[c]};bv=b}(d);let f=c?"svg"===c:b5(a),g=f?cn:cm;function h(c,d){let h,i={...(0,b3.useContext)(b9.Q),...c,layoutId:function({layoutId:a}){let b=(0,b3.useContext)(b7.L).id;return b&&void 0!==a?b+"-"+a:a}(c)},{isStatic:j}=i,k=function(a){let{initial:b,animate:c}=function(a,b){if(bn(a)){let{initial:b,animate:c}=a;return{initial:!1===b||bk(b)?b:void 0,animate:bk(c)?c:void 0}}return!1!==a.inherit?b:{}}(a,(0,b3.useContext)(ca));return(0,b3.useMemo)(()=>({initial:b,animate:c}),[cb(b),cb(c)])}(c),l=g(c,j);if(!j&&co.B){(0,b3.useContext)(b8).strict;let b=function(a){let{drag:b,layout:c}=cr();if(!b&&!c)return{};let d={...b,...c};return{MeasureLayout:b?.isEnabled(a)||c?.isEnabled(a)?d.MeasureLayout:void 0,ProjectionNode:d.ProjectionNode}}(i);h=b.MeasureLayout,k.visualElement=function(a,b,c,d,e,f){let{visualElement:g}=(0,b3.useContext)(ca),h=(0,b3.useContext)(b8),i=(0,b3.useContext)(cj.t),j=(0,b3.useContext)(b9.Q),k=j.reducedMotion,l=j.skipAnimations,m=(0,b3.useRef)(null),n=(0,b3.useRef)(!1);d=d||h.renderer,!m.current&&d&&(m.current=d(a,{visualState:b,parent:g,props:c,presenceContext:i,blockInitialAnimation:!!i&&!1===i.initial,reducedMotionConfig:k,skipAnimations:l,isSVG:f}),n.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let o=m.current,p=(0,b3.useContext)(cu);o&&!o.projection&&e&&("html"===o.type||"svg"===o.type)&&function(a,b,c,d){let{layoutId:e,layout:f,drag:g,dragConstraints:h,layoutScroll:i,layoutRoot:j,layoutCrossfade:k}=b;a.projection=new c(a.latestValues,b["data-framer-portal-id"]?void 0:function a(b){if(b)return!1!==b.options.allowProjection?b.projection:a(b.parent)}(a.parent)),a.projection.setOptions({layoutId:e,layout:f,alwaysMeasureLayout:!!g||h&&cv(h),visualElement:a,animationType:"string"==typeof f?f:"both",initialPromotionConfig:d,crossfade:k,layoutScroll:i,layoutRoot:j})}(m.current,c,e,p);let q=(0,b3.useRef)(!1);(0,b3.useInsertionEffect)(()=>{o&&q.current&&o.update(c,i)});let r=c[ct],s=(0,b3.useRef)(!!r&&!window.MotionHandoffIsComplete?.(r)&&window.MotionHasOptimisedAnimation?.(r));return(0,cw.E)(()=>{n.current=!0,o&&(q.current=!0,window.MotionIsMounted=!0,o.updateFeatures(),o.scheduleRenderMicrotask(),s.current&&o.animationState&&o.animationState.animateChanges())}),o}(a,l,i,e,b.ProjectionNode,f)}return(0,b6.jsxs)(ca.Provider,{value:k,children:[h&&k.visualElement?(0,b6.jsx)(h,{visualElement:k.visualElement,...i}):null,function(a,b,c,{latestValues:d},e,f=!1,g){let h=(g??b5(a)?function(a,b,c,d){let e=(0,b3.useMemo)(()=>{let c=ce();return bG(c,b,bI(d),a.transformTemplate,a.style),{...c.attrs,style:{...c.style}}},[b]);if(a.style){let b={};cd(b,a.style,a),e.style={...b,...e.style}}return e}:function(a,b){let c={},d=function(a,b){let c=a.style||{},d={};return cd(d,c,a),Object.assign(d,function({transformTemplate:a},b){return(0,b3.useMemo)(()=>{let c=cc();return bC(c,b,a),Object.assign({},c.vars,c.style)},[b])}(a,b)),d}(a,b);return a.drag&&!1!==a.dragListener&&(c.draggable=!1,d.userSelect=d.WebkitUserSelect=d.WebkitTouchCallout="none",d.touchAction=!0===a.drag?"none":`pan-${"x"===a.drag?"y":"x"}`),void 0===a.tabIndex&&(a.onTap||a.onTapStart||a.whileTap)&&(c.tabIndex=0),c.style=d,c})(b,d,e,a),i=function(a,b,c){let d={};for(let e in a)("values"!==e||"object"!=typeof a.values)&&(ch(e)||!0===c&&cg(e)||!b&&!cg(e)||a.draggable&&e.startsWith("onDrag"))&&(d[e]=a[e]);return d}(b,"string"==typeof a,f),j=a!==b3.Fragment?{...i,...h,ref:c}:{},{children:k}=b,l=(0,b3.useMemo)(()=>Y(k)?k.get():k,[k]);return(0,b3.createElement)(a,{...j,children:l})}(a,c,function(a,b,c){let d=(0,b3.useRef)(c);(0,b3.useInsertionEffect)(()=>{d.current=c});let e=(0,b3.useRef)(null);return(0,b3.useCallback)(c=>{c&&a.onMount?.(c),b&&(c?b.mount(c):b.unmount());let f=d.current;if("function"==typeof f)if(c){let a=f(c);"function"==typeof a&&(e.current=a)}else e.current?(e.current(),e.current=null):f(c);else f&&(f.current=c)},[b])}(l,k.visualElement,d),l,j,b,f)]})}h.displayName=`motion.${"string"==typeof a?a:`create(${a.displayName??a.name??""})`}`;let i=(0,b3.forwardRef)(h);return i[cs]=a,i}class cy{constructor(a){this.isMounted=!1,this.node=a}update(){}}function cz(a,b,c){let d=a.getProps();return bt(d,b,void 0!==c?c:d.custom,a)}function cA(a,b){if(a?.inherit&&b){let{inherit:c,...d}=a;return{...b,...d}}return a}function cB(a,b){let c=a?.[b]??a?.default??a;return c!==a?cA(c,a):c}let cC=a=>Array.isArray(a);function cD(a,b){let c=a.getValue("willChange");if(Y(c)&&c.add)return c.add(b);if(!c&&aB.WillChange){let c=new aB.WillChange("auto");a.addValue("willChange",c),c.add(b)}}let cE=(a,b)=>c=>b(a(c)),cF=(...a)=>a.reduce(cE);function cG(a,b,c){return(c<0&&(c+=1),c>1&&(c-=1),c<1/6)?a+(b-a)*6*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a}function cH(a,b){return c=>c>0?b:a}let cI=(a,b,c)=>{let d=a*a,e=c*(b*b-d)+d;return e<0?0:Math.sqrt(e)},cJ=[t,s,B];function cK(a){let b=cJ.find(b=>b.test(a));if(ac(!!b,`'${a}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!b)return!1;let c=b.parse(a);return b===B&&(c=function({hue:a,saturation:b,lightness:c,alpha:d}){a/=360,c/=100;let e=0,f=0,g=0;if(b/=100){let d=c<.5?c*(1+b):c+b-c*b,h=2*c-d;e=cG(h,d,a+1/3),f=cG(h,d,a),g=cG(h,d,a-1/3)}else e=f=g=c;return{red:Math.round(255*e),green:Math.round(255*f),blue:Math.round(255*g),alpha:d}}(c)),c}let cL=(a,b)=>{let c=cK(a),d=cK(b);if(!c||!d)return cH(a,b);let e={...c};return a=>(e.red=cI(c.red,d.red,a),e.green=cI(c.green,d.green,a),e.blue=cI(c.blue,d.blue,a),e.alpha=bM(c.alpha,d.alpha,a),s.transform(e))},cM=new Set(["none","hidden"]);function cN(a,b){return c=>bM(a,b,c)}function cO(a){return"number"==typeof a?cN:"string"==typeof a?ai(a)?cH:C.test(a)?cL:cR:Array.isArray(a)?cP:"object"==typeof a?C.test(a)?cL:cQ:cH}function cP(a,b){let c=[...a],d=c.length,e=a.map((a,c)=>cO(a)(a,b[c]));return a=>{for(let b=0;b<d;b++)c[b]=e[b](a);return c}}function cQ(a,b){let c={...a,...b},d={};for(let e in c)void 0!==a[e]&&void 0!==b[e]&&(d[e]=cO(a[e])(a[e],b[e]));return a=>{for(let b in d)c[b]=d[b](a);return c}}let cR=(a,b)=>{let c=L.createTransformer(b),d=H(a),e=H(b);return d.indexes.var.length===e.indexes.var.length&&d.indexes.color.length===e.indexes.color.length&&d.indexes.number.length>=e.indexes.number.length?cM.has(a)&&!e.values.length||cM.has(b)&&!d.values.length?function(a,b){return cM.has(a)?c=>c<=0?a:b:c=>c>=1?b:a}(a,b):cF(cP(function(a,b){let c=[],d={color:0,var:0,number:0};for(let e=0;e<b.values.length;e++){let f=b.types[e],g=a.indexes[f][d[f]],h=a.values[g]??0;c[e]=h,d[f]++}return c}(d,e),e.values),c):(ac(!0,`Complex values '${a}' and '${b}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),cH(a,b))};function cS(a,b,c){return"number"==typeof a&&"number"==typeof b&&"number"==typeof c?bM(a,b,c):cO(a)(a,b)}let cT=a=>{let b=({timestamp:b})=>a(b);return{start:(a=!0)=>aF.update(b,a),stop:()=>aG(b),now:()=>aH.isProcessing?aH.timestamp:bd.now()}};function cU(a){let b=0,c=a.next(b);for(;!c.done&&b<2e4;)b+=50,c=a.next(b);return b>=2e4?1/0:b}function cV(a,b,c){var d,e;let f=Math.max(b-5,0);return d=c-a(f),(e=b-f)?1e3/e*d:0}let cW={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};function cX(a,b){return a*Math.sqrt(1-b*b)}let cY=["duration","bounce"],cZ=["stiffness","damping","mass"];function c$(a,b){return b.some(b=>void 0!==a[b])}function c_(a=cW.visualDuration,b=cW.bounce){let c,d="object"!=typeof a?{visualDuration:a,keyframes:[0,1],bounce:b}:a,{restSpeed:e,restDelta:f}=d,g=d.keyframes[0],h=d.keyframes[d.keyframes.length-1],j={done:!1,value:g},{stiffness:k,damping:l,mass:m,duration:n,velocity:o,isResolvedFromDuration:p}=function(a){let b={velocity:cW.velocity,stiffness:cW.stiffness,damping:cW.damping,mass:cW.mass,isResolvedFromDuration:!1,...a};if(!c$(a,cZ)&&c$(a,cY))if(a.visualDuration){let c=2*Math.PI/(1.2*a.visualDuration),d=c*c,e=2*i(.05,1,1-(a.bounce||0))*Math.sqrt(d);b={...b,mass:cW.mass,stiffness:d,damping:e}}else{let c=function({duration:a=cW.duration,bounce:b=cW.bounce,velocity:c=cW.velocity,mass:d=cW.mass}){let e,f;ac(a<=aU(cW.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let g=1-b;g=i(cW.minDamping,cW.maxDamping,g),a=i(cW.minDuration,cW.maxDuration,a/1e3),g<1?(e=b=>{let d=b*g,e=d*a;return .001-(d-c)/cX(b,g)*Math.exp(-e)},f=b=>{let d=b*g*a,f=Math.pow(g,2)*Math.pow(b,2)*a,h=Math.exp(-d),i=cX(Math.pow(b,2),g);return(d*c+c-f)*h*(-e(b)+.001>0?-1:1)/i}):(e=b=>-.001+Math.exp(-b*a)*((b-c)*a+1),f=b=>a*a*(c-b)*Math.exp(-b*a));let h=function(a,b,c){let d=c;for(let c=1;c<12;c++)d-=a(d)/b(d);return d}(e,f,5/a);if(a=aU(a),isNaN(h))return{stiffness:cW.stiffness,damping:cW.damping,duration:a};{let b=Math.pow(h,2)*d;return{stiffness:b,damping:2*g*Math.sqrt(d*b),duration:a}}}(a);(b={...b,...c,mass:cW.mass}).isResolvedFromDuration=!0}return b}({...d,velocity:-((d.velocity||0)/1e3)}),q=o||0,r=l/(2*Math.sqrt(k*m)),s=h-g,t=Math.sqrt(k/m)/1e3,u=5>Math.abs(s);if(e||(e=u?cW.restSpeed.granular:cW.restSpeed.default),f||(f=u?cW.restDelta.granular:cW.restDelta.default),r<1){let a=cX(t,r);c=b=>h-Math.exp(-r*t*b)*((q+r*t*s)/a*Math.sin(a*b)+s*Math.cos(a*b))}else if(1===r)c=a=>h-Math.exp(-t*a)*(s+(q+t*s)*a);else{let a=t*Math.sqrt(r*r-1);c=b=>{let c=Math.exp(-r*t*b),d=Math.min(a*b,300);return h-c*((q+r*t*s)*Math.sinh(d)+a*s*Math.cosh(d))/a}}let v={calculatedDuration:p&&n||null,next:a=>{let b=c(a);if(p)j.done=a>=n;else{let d=0===a?q:0;r<1&&(d=0===a?aU(q):cV(c,a,b));let g=Math.abs(h-b)<=f;j.done=Math.abs(d)<=e&&g}return j.value=j.done?h:b,j},toString:()=>{let a=Math.min(cU(v),2e4),b=a5(b=>v.next(a*b).value,a,30);return a+"ms "+b},toTransition:()=>{}};return v}function c0({keyframes:a,velocity:b=0,power:c=.8,timeConstant:d=325,bounceDamping:e=10,bounceStiffness:f=500,modifyTarget:g,min:h,max:i,restDelta:j=.5,restSpeed:k}){let l,m,n=a[0],o={done:!1,value:n},p=c*b,q=n+p,r=void 0===g?q:g(q);r!==q&&(p=r-n);let s=a=>-p*Math.exp(-a/d),t=a=>r+s(a),u=a=>{let b=s(a),c=t(a);o.done=Math.abs(b)<=j,o.value=o.done?r:c},v=a=>{let b;if(b=o.value,void 0!==h&&b<h||void 0!==i&&b>i){var c;l=a,m=c_({keyframes:[o.value,(c=o.value,void 0===h?i:void 0===i||Math.abs(h-c)<Math.abs(i-c)?h:i)],velocity:cV(t,a,o.value),damping:e,stiffness:f,restDelta:j,restSpeed:k})}};return v(0),{calculatedDuration:null,next:a=>{let b=!1;return(m||void 0!==l||(b=!0,u(a),v(a)),void 0!==l&&a>=l)?m.next(a-l):(b||u(a),o)}}}c_.applyToOptions=a=>{let b=function(a,b=100,c){let d=c({...a,keyframes:[0,b]}),e=Math.min(cU(d),2e4);return{type:"keyframes",ease:a=>d.next(e*a).value/b,duration:e/1e3}}(a,100,c_);return a.ease=b.ease,a.duration=aU(b.duration),a.type="keyframes",a};let c1=(a,b,c)=>(((1-3*c+3*b)*a+(3*c-6*b))*a+3*b)*a;function c2(a,b,c,d){return a===b&&c===d?aA:e=>0===e||1===e?e:c1(function(a,b,c,d,e){let f,g,h=0;do(f=c1(g=b+(c-b)/2,d,e)-a)>0?c=g:b=g;while(Math.abs(f)>1e-7&&++h<12);return g}(e,0,1,a,c),b,d)}let c3=c2(.42,0,1,1),c4=c2(0,0,.58,1),c5=c2(.42,0,.58,1),c6=a=>b=>b<=.5?a(2*b)/2:(2-a(2*(1-b)))/2,c7=a=>b=>1-a(1-b),c8=c2(.33,1.53,.69,.99),c9=c7(c8),da=c6(c9),db=a=>(a*=2)<1?.5*c9(a):.5*(2-Math.pow(2,-10*(a-1))),dc=a=>1-Math.sin(Math.acos(a)),dd=c7(dc),de=c6(dc),df={linear:aA,easeIn:c3,easeInOut:c5,easeOut:c4,circIn:dc,circInOut:de,circOut:dd,backIn:c9,backInOut:da,backOut:c8,anticipate:db},dg=a=>{if(a2(a)){ad(4===a.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[b,c,d,e]=a;return c2(b,c,d,e)}return"string"==typeof a?(ad(void 0!==df[a],`Invalid easing type '${a}'`,"invalid-easing-type"),df[a]):a},dh=(a,b,c)=>{let d=b-a;return 0===d?1:(c-a)/d};function di({duration:a=300,keyframes:b,times:c,ease:d="easeInOut"}){var e;let f=Array.isArray(d)&&"number"!=typeof d[0]?d.map(dg):dg(d),g={done:!1,value:b[0]},h=function(a,b,{clamp:c=!0,ease:d,mixer:e}={}){let f=a.length;if(ad(f===b.length,"Both input and output ranges must be the same length","range-length"),1===f)return()=>b[0];if(2===f&&b[0]===b[1])return()=>b[1];let g=a[0]===a[1];a[0]>a[f-1]&&(a=[...a].reverse(),b=[...b].reverse());let h=function(a,b,c){let d=[],e=c||aB.mix||cS,f=a.length-1;for(let c=0;c<f;c++){let f=e(a[c],a[c+1]);b&&(f=cF(Array.isArray(b)?b[c]||aA:b,f)),d.push(f)}return d}(b,d,e),j=h.length,k=c=>{if(g&&c<a[0])return b[0];let d=0;if(j>1)for(;d<a.length-2&&!(c<a[d+1]);d++);let e=dh(a[d],a[d+1],c);return h[d](e)};return c?b=>k(i(a[0],a[f-1],b)):k}((e=c&&c.length===b.length?c:function(a){let b=[0];return!function(a,b){let c=a[a.length-1];for(let d=1;d<=b;d++){let e=dh(0,b,d);a.push(bM(c,1,e))}}(b,a.length-1),b}(b),e.map(b=>b*a)),b,{ease:Array.isArray(f)?f:b.map(()=>f||c5).splice(0,b.length-1)});return{calculatedDuration:a,next:b=>(g.value=h(b),g.done=b>=a,g)}}let dj={decay:c0,inertia:c0,tween:di,keyframes:di,spring:c_};function dk(a){"string"==typeof a.type&&(a.type=dj[a.type])}let dl=a=>a/100;class dm extends a0{constructor(a){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:a}=this.options;a&&a.updatedAt!==bd.now()&&this.tick(bd.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},a1.mainThread++,this.options=a,this.initAnimation(),this.play(),!1===a.autoplay&&this.pause()}initAnimation(){let{options:a}=this;dk(a);let{type:b=di,repeat:c=0,repeatDelay:d=0,repeatType:e,velocity:f=0}=a,{keyframes:g}=a,h=b||di;h!==di&&"number"!=typeof g[0]&&(this.mixKeyframes=cF(dl,cS(g[0],g[1])),g=[0,100]);let i=h({...a,keyframes:g});"mirror"===e&&(this.mirroredGenerator=h({...a,keyframes:[...g].reverse(),velocity:-f})),null===i.calculatedDuration&&(i.calculatedDuration=cU(i));let{calculatedDuration:j}=i;this.calculatedDuration=j,this.resolvedDuration=j+d,this.totalDuration=this.resolvedDuration*(c+1)-d,this.generator=i}updateTime(a){let b=Math.round(a-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=b}tick(a,b=!1){let{generator:c,totalDuration:d,mixKeyframes:e,mirroredGenerator:f,resolvedDuration:g,calculatedDuration:h}=this;if(null===this.startTime)return c.next(0);let{delay:j=0,keyframes:k,repeat:l,repeatType:m,repeatDelay:n,type:o,onUpdate:p,finalKeyframe:q}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-d/this.speed,this.startTime)),b?this.currentTime=a:this.updateTime(a);let r=this.currentTime-j*(this.playbackSpeed>=0?1:-1),s=this.playbackSpeed>=0?r<0:r>d;this.currentTime=Math.max(r,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=d);let t=this.currentTime,u=c;if(l){let a=Math.min(this.currentTime,d)/g,b=Math.floor(a),c=a%1;!c&&a>=1&&(c=1),1===c&&b--,(b=Math.min(b,l+1))%2&&("reverse"===m?(c=1-c,n&&(c-=n/g)):"mirror"===m&&(u=f)),t=i(0,1,c)*g}let v=s?{done:!1,value:k[0]}:u.next(t);e&&(v.value=e(v.value));let{done:w}=v;s||null===h||(w=this.playbackSpeed>=0?this.currentTime>=d:this.currentTime<=0);let x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return x&&o!==c0&&(v.value=a_(k,this.options,q,this.speed)),p&&p(v.value),x&&this.finish(),v}then(a,b){return this.finished.then(a,b)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:a=0}=this.options||{};return this.duration+a/1e3}get time(){return this.currentTime/1e3}set time(a){a=aU(a),this.currentTime=a,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(a){this.updateTime(bd.now());let b=this.playbackSpeed!==a;this.playbackSpeed=a,b&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:a=cT,startTime:b}=this.options;this.driver||(this.driver=a(a=>this.tick(a))),this.options.onPlay?.();let c=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=c):null!==this.holdTime?this.startTime=c-this.holdTime:this.startTime||(this.startTime=b??c),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(bd.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&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,a1.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}attachTimeline(a){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),a.observe(this)}}let dn={anticipate:db,backInOut:da,circInOut:de};class dp extends a9{constructor(a){!function(a){"string"==typeof a.ease&&a.ease in dn&&(a.ease=dn[a.ease])}(a),dk(a),super(a),void 0!==a.startTime&&(this.startTime=a.startTime),this.options=a}updateMotionValue(a){let{motionValue:b,onUpdate:c,onComplete:d,element:e,...f}=this.options;if(!b)return;if(void 0!==a)return void b.set(a);let g=new dm({...f,autoplay:!1}),h=Math.max(10,bd.now()-this.startTime),j=i(0,10,h-10);b.setWithVelocity(g.sample(Math.max(0,h-j)).value,g.sample(h).value,j),g.stop()}}let dq=(a,b)=>"zIndex"!==b&&!!("number"==typeof a||Array.isArray(a)||"string"==typeof a&&(L.test(a)||"0"===a)&&!a.startsWith("url("));function dr(a){a.duration=0,a.type="keyframes"}let ds=new Set(["opacity","clipPath","filter","transform"]),dt=aY(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class du extends a0{constructor({autoplay:a=!0,delay:b=0,type:c="keyframes",repeat:d=0,repeatDelay:e=0,repeatType:f="loop",keyframes:g,name:h,motionValue:i,element:j,...k}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=bd.now();let l={autoplay:a,delay:b,type:c,repeat:d,repeatDelay:e,repeatType:f,name:h,motionValue:i,element:j,...k},m=j?.KeyframeResolver||aP;this.keyframeResolver=new m(g,(a,b,c)=>this.onKeyframesResolved(a,b,l,!c),h,i,j),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(a,b,c,d){this.keyframeResolver=void 0;let{name:e,type:f,velocity:g,delay:h,isHandoff:i,onUpdate:j}=c;this.resolvedAt=bd.now(),!function(a,b,c,d){let e=a[0];if(null===e)return!1;if("display"===b||"visibility"===b)return!0;let f=a[a.length-1],g=dq(e,b),h=dq(f,b);return ac(g===h,`You are trying to animate ${b} from "${e}" to "${f}". "${g?f:e}" is not an animatable value.`,"value-not-animatable"),!!g&&!!h&&(function(a){let b=a[0];if(1===a.length)return!0;for(let c=0;c<a.length;c++)if(a[c]!==b)return!0}(a)||("spring"===c||a8(c))&&d)}(a,e,f,g)&&((aB.instantAnimations||!h)&&j?.(a_(a,c,b)),a[0]=a[a.length-1],dr(c),c.repeat=0);let k={startTime:d?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:b,...c,keyframes:a},l=!i&&function(a){let{motionValue:b,name:c,repeatDelay:d,repeatType:e,damping:f,type:g}=a;if(!(b?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:h,transformTemplate:i}=b.owner.getProps();return dt()&&c&&ds.has(c)&&("transform"!==c||!i)&&!h&&!d&&"mirror"!==e&&0!==f&&"inertia"!==g}(k),m=k.motionValue?.owner?.current,n=l?new dp({...k,element:m}):new dm(k);n.finished.then(()=>{this.notifyFinished()}).catch(aA),this.pendingTimeline&&(this.stopTimeline=n.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=n}get finished(){return this._animation?this.animation.finished:this._finished}then(a,b){return this.finished.finally(a).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),aM=!0,aO(),aN(),aM=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(a){this.animation.time=a}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(a){this.animation.speed=a}get startTime(){return this.animation.startTime}attachTimeline(a){return this._animation?this.stopTimeline=this.animation.attachTimeline(a):this.pendingTimeline=a,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let dv={type:"spring",stiffness:500,damping:25,restSpeed:10},dw={type:"keyframes",duration:.8},dx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dy=a=>null!==a,dz=(a,b,c,d={},e,f)=>g=>{let i=cB(d,a)||{},j=i.delay||d.delay||0,{elapsed:k=0}=d;k-=aU(j);let l={keyframes:Array.isArray(c)?c:[null,c],ease:"easeOut",velocity:b.getVelocity(),...i,delay:-k,onUpdate:a=>{b.set(a),i.onUpdate&&i.onUpdate(a)},onComplete:()=>{g(),i.onComplete&&i.onComplete()},name:a,motionValue:b,element:f?void 0:e};!function({when:a,delay:b,delayChildren:c,staggerChildren:d,staggerDirection:e,repeat:f,repeatType:g,repeatDelay:h,from:i,elapsed:j,...k}){return!!Object.keys(k).length}(i)&&Object.assign(l,((a,{keyframes:b})=>b.length>2?dw:h.has(a)?a.startsWith("scale")?{type:"spring",stiffness:550,damping:0===b[1]?2*Math.sqrt(550):30,restSpeed:10}:dv:dx)(a,l)),l.duration&&(l.duration=aU(l.duration)),l.repeatDelay&&(l.repeatDelay=aU(l.repeatDelay)),void 0!==l.from&&(l.keyframes[0]=l.from);let m=!1;if(!1!==l.type&&(0!==l.duration||l.repeatDelay)||(dr(l),0===l.delay&&(m=!0)),(aB.instantAnimations||aB.skipAnimations||e?.shouldSkipAnimations)&&(m=!0,dr(l),l.delay=0),l.allowFlatten=!i.type&&!i.ease,m&&!f&&void 0!==b.get()){let a=function(a,{repeat:b,repeatType:c="loop"},d){let e=a.filter(dy),f=b&&"loop"!==c&&b%2==1?0:e.length-1;return e[f]}(l.keyframes,i);if(void 0!==a)return void aF.update(()=>{l.onUpdate(a),l.onComplete()})}return i.isSync?new dm(l):new du(l)};function dA(a,b,{delay:c=0,transitionOverride:d,type:e}={}){let{transition:f,transitionEnd:g,...h}=b,i=a.getDefaultTransition();f=f?cA(f,i):i;let j=f?.reduceMotion;d&&(f=d);let k=[],l=e&&a.animationState&&a.animationState.getState()[e];for(let b in h){let d=a.getValue(b,a.latestValues[b]??null),e=h[b];if(void 0===e||l&&function({protectedKeys:a,needsAnimating:b},c){let d=a.hasOwnProperty(c)&&!0!==b[c];return b[c]=!1,d}(l,b))continue;let g={delay:c,...cB(f||{},b)},i=d.get();if(void 0!==i&&!d.isAnimating&&!Array.isArray(e)&&e===i&&!g.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){let c=a.props[ct];if(c){let a=window.MotionHandoffAnimation(c,b,aF);null!==a&&(g.startTime=a,m=!0)}}cD(a,b);let n=j??a.shouldReduceMotion;d.start(dz(b,d,e,n&&Z.has(b)?{type:!1}:g,a,m));let o=d.animation;o&&k.push(o)}if(g){let b=()=>aF.update(()=>{g&&function(a,b){let{transitionEnd:c={},transition:d={},...e}=cz(a,b)||{};for(let b in e={...e,...c}){var f;let c=cC(f=e[b])?f[f.length-1]||0:f;a.hasValue(b)?a.getValue(b).set(c):a.addValue(b,bg(c))}}(a,g)});k.length?Promise.all(k).then(b):b()}return k}function dB(a,b,c,d=0,e=1){let f=Array.from(a).sort((a,b)=>a.sortNodePosition(b)).indexOf(b),g=a.size,h=(g-1)*d;return"function"==typeof c?c(f,g):1===e?f*d:h-f*d}function dC(a,b,c={}){let d=cz(a,b,"exit"===c.type?a.presenceContext?.custom:void 0),{transition:e=a.getDefaultTransition()||{}}=d||{};c.transitionOverride&&(e=c.transitionOverride);let f=d?()=>Promise.all(dA(a,d,c)):()=>Promise.resolve(),g=a.variantChildren&&a.variantChildren.size?(d=0)=>{let{delayChildren:f=0,staggerChildren:g,staggerDirection:h}=e;return function(a,b,c=0,d=0,e=0,f=1,g){let h=[];for(let i of a.variantChildren)i.notify("AnimationStart",b),h.push(dC(i,b,{...g,delay:c+("function"==typeof d?0:d)+dB(a.variantChildren,i,d,e,f)}).then(()=>i.notify("AnimationComplete",b)));return Promise.all(h)}(a,b,d,f,g,h,c)}:()=>Promise.resolve(),{when:h}=e;if(!h)return Promise.all([f(),g(c.delay)]);{let[a,b]="beforeChildren"===h?[f,g]:[g,f];return a().then(()=>b())}}let dD=bm.length;function dE(a,b){if(!Array.isArray(b))return!1;let c=b.length;if(c!==a.length)return!1;for(let d=0;d<c;d++)if(b[d]!==a[d])return!1;return!0}let dF=[...bl].reverse(),dG=bl.length;function dH(a=!1){return{isActive:a,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dI(){return{animate:dH(!0),whileInView:dH(),whileHover:dH(),whileTap:dH(),whileDrag:dH(),whileFocus:dH(),exit:dH()}}class dJ extends cy{constructor(a){super(a),a.animationState||(a.animationState=function(a){let b=b=>Promise.all(b.map(({animation:b,options:c})=>(function(a,b,c={}){let d;if(a.notify("AnimationStart",b),Array.isArray(b))d=Promise.all(b.map(b=>dC(a,b,c)));else if("string"==typeof b)d=dC(a,b,c);else{let e="function"==typeof b?cz(a,b,c.custom):b;d=Promise.all(dA(a,e,c))}return d.then(()=>{a.notify("AnimationComplete",b)})})(a,b,c))),c=dI(),d=!0,e=b=>(c,d)=>{let e=cz(a,d,"exit"===b?a.presenceContext?.custom:void 0);if(e){let{transition:a,transitionEnd:b,...d}=e;c={...c,...d,...b}}return c};function f(f){let{props:g}=a,h=function a(b){if(!b)return;if(!b.isControllingVariants){let c=b.parent&&a(b.parent)||{};return void 0!==b.props.initial&&(c.initial=b.props.initial),c}let c={};for(let a=0;a<dD;a++){let d=bm[a],e=b.props[d];(bk(e)||!1===e)&&(c[d]=e)}return c}(a.parent)||{},i=[],j=new Set,k={},l=1/0;for(let b=0;b<dG;b++){var m,n;let o=dF[b],p=c[o],q=void 0!==g[o]?g[o]:h[o],r=bk(q),s=o===f?p.isActive:null;!1===s&&(l=b);let t=q===h[o]&&q!==g[o]&&r;if(t&&d&&a.manuallyAnimateOnMount&&(t=!1),p.protectedKeys={...k},!p.isActive&&null===s||!q&&!p.prevProp||bj(q)||"boolean"==typeof q)continue;if("exit"===o&&p.isActive&&!0!==s){p.prevResolvedValues&&(k={...k,...p.prevResolvedValues});continue}let u=(m=p.prevProp,"string"==typeof(n=q)?n!==m:!!Array.isArray(n)&&!dE(n,m)),v=u||o===f&&p.isActive&&!t&&r||b>l&&r,w=!1,x=Array.isArray(q)?q:[q],y=x.reduce(e(o),{});!1===s&&(y={});let{prevResolvedValues:z={}}=p,A={...z,...y},B=b=>{v=!0,j.has(b)&&(w=!0,j.delete(b)),p.needsAnimating[b]=!0;let c=a.getValue(b);c&&(c.liveStyle=!1)};for(let a in A){let b=y[a],c=z[a];if(!k.hasOwnProperty(a))(cC(b)&&cC(c)?dE(b,c):b===c)?void 0!==b&&j.has(a)?B(a):p.protectedKeys[a]=!0:null!=b?B(a):j.add(a)}p.prevProp=q,p.prevResolvedValues=y,p.isActive&&(k={...k,...y}),d&&a.blockInitialAnimation&&(v=!1);let C=t&&u,D=!C||w;v&&D&&i.push(...x.map(b=>{let c={type:o};if("string"==typeof b&&d&&!C&&a.manuallyAnimateOnMount&&a.parent){let{parent:d}=a,e=cz(d,b);if(d.enteringChildren&&e){let{delayChildren:b}=e.transition||{};c.delay=dB(d.enteringChildren,a,b)}}return{animation:b,options:c}}))}if(j.size){let b={};if("boolean"!=typeof g.initial){let c=cz(a,Array.isArray(g.initial)?g.initial[0]:g.initial);c&&c.transition&&(b.transition=c.transition)}j.forEach(c=>{let d=a.getBaseTarget(c),e=a.getValue(c);e&&(e.liveStyle=!0),b[c]=d??null}),i.push({animation:b})}let o=!!i.length;return d&&(!1===g.initial||g.initial===g.animate)&&!a.manuallyAnimateOnMount&&(o=!1),d=!1,o?b(i):Promise.resolve()}return{animateChanges:f,setActive:function(b,d){if(c[b].isActive===d)return Promise.resolve();a.variantChildren?.forEach(a=>a.animationState?.setActive(b,d)),c[b].isActive=d;let e=f(b);for(let a in c)c[a].protectedKeys={};return e},setAnimateFunction:function(c){b=c(a)},getState:()=>c,reset:()=>{c=dI()}}}(a))}updateAnimationControlsSubscription(){let{animate:a}=this.node.getProps();bj(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:a}=this.node.getProps(),{animate:b}=this.node.prevProps||{};a!==b&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let dK=0;class dL extends cy{constructor(){super(...arguments),this.id=dK++}update(){if(!this.node.presenceContext)return;let{isPresent:a,onExitComplete:b}=this.node.presenceContext,{isPresent:c}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===c)return;let d=this.node.animationState.setActive("exit",!a);b&&!a&&d.then(()=>{b(this.id)})}mount(){let{register:a,onExitComplete:b}=this.node.presenceContext||{};b&&b(this.id),a&&(this.unmount=a(this.id))}unmount(){}}let dM={x:!1,y:!1};function dN(a){return[a("x"),a("y")]}function dO(a){return a.max-a.min}function dP(a,b,c,d=.5){a.origin=d,a.originPoint=bM(b.min,b.max,a.origin),a.scale=dO(c)/dO(b),a.translate=bM(c.min,c.max,a.origin)-a.originPoint,(a.scale>=.9999&&a.scale<=1.0001||isNaN(a.scale))&&(a.scale=1),(a.translate>=-.01&&a.translate<=.01||isNaN(a.translate))&&(a.translate=0)}function dQ(a,b,c,d){dP(a.x,b.x,c.x,d?d.originX:void 0),dP(a.y,b.y,c.y,d?d.originY:void 0)}function dR(a,b,c){a.min=c.min+b.min,a.max=a.min+dO(b)}function dS(a,b,c){a.min=b.min-c.min,a.max=a.min+dO(b)}function dT(a,b,c){dS(a.x,b.x,c.x),dS(a.y,b.y,c.y)}let dU=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),dV=new Set(["INPUT","SELECT","TEXTAREA"]);function dW(a,b,c,d={passive:!0}){return a.addEventListener(b,c,d),()=>a.removeEventListener(b,c)}var dX=c(136075);function dY(a){return(0,dX.G)(a)&&"ownerSVGElement"in a}function dZ(a,b,c){if(null==a)return[];if(a instanceof EventTarget)return[a];if("string"==typeof a){let d=document;b&&(d=b.current);let e=c?.[a]??d.querySelectorAll(a);return e?Array.from(e):[]}return Array.from(a).filter(a=>null!=a)}let d$=new WeakMap,d_=(a,b,c)=>(d,e)=>e&&e[0]?e[0][a+"Size"]:dY(d)&&"getBBox"in d?d.getBBox()[b]:d[c],d0=d_("inline","width","offsetWidth"),d1=d_("block","height","offsetHeight");function d2({target:a,borderBoxSize:b}){d$.get(a)?.forEach(c=>{c(a,{get width(){return d0(a,b)},get height(){return d1(a,b)}})})}function d3(a){a.forEach(d2)}let d4=new Set;function d5(a,b){return"function"==typeof a?(d4.add(a),f||(f=()=>{let a={get width(){return window.innerWidth},get height(){return window.innerHeight}};d4.forEach(b=>b(a))},window.addEventListener("resize",f)),()=>{d4.delete(a),d4.size||"function"!=typeof f||(window.removeEventListener("resize",f),f=void 0)}):function(a,b){e||"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(d3));let c=dZ(a);return c.forEach(a=>{let c=d$.get(a);c||(c=new Set,d$.set(a,c)),c.add(b),e?.observe(a)}),()=>{c.forEach(a=>{let c=d$.get(a);c?.delete(b),c?.size||e?.unobserve(a)})}}(a,b)}let d6=a=>"mouse"===a.pointerType?"number"!=typeof a.button||a.button<=0:!1!==a.isPrimary;function d7(a){return{point:{x:a.pageX,y:a.pageY}}}function d8(a,b,c,d){return dW(a,b,a=>d6(a)&&c(a,d7(a)),d)}let d9=({current:a})=>a?a.ownerDocument.defaultView:null,ea=(a,b)=>Math.abs(a-b),eb=new Set(["auto","scroll"]);class ec{constructor(a,b,{transformPagePoint:c,contextWindow:d=window,dragSnapToOrigin:e=!1,distanceThreshold:f=3,element:g}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=a=>{this.handleScroll(a.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=ef(this.lastMoveEventInfo,this.history),b=null!==this.startEvent,c=function(a,b){return Math.sqrt(ea(a.x,b.x)**2+ea(a.y,b.y)**2)}(a.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!c)return;let{point:d}=a,{timestamp:e}=aH;this.history.push({...d,timestamp:e});let{onStart:f,onMove:g}=this.handlers;b||(f&&f(this.lastMoveEvent,a),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,a)},this.handlePointerMove=(a,b)=>{this.lastMoveEvent=a,this.lastMoveEventInfo=ed(b,this.transformPagePoint),aF.update(this.updatePoint,!0)},this.handlePointerUp=(a,b)=>{this.end();let{onEnd:c,onSessionEnd:d,resumeAnimation:e}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&e&&e(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let f=ef("pointercancel"===a.type?this.lastMoveEventInfo:ed(b,this.transformPagePoint),this.history);this.startEvent&&c&&c(a,f),d&&d(a,f)},!d6(a))return;this.dragSnapToOrigin=e,this.handlers=b,this.transformPagePoint=c,this.distanceThreshold=f,this.contextWindow=d||window;let h=ed(d7(a),this.transformPagePoint),{point:i}=h,{timestamp:j}=aH;this.history=[{...i,timestamp:j}];let{onSessionStart:k}=b;k&&k(a,ef(h,this.history)),this.removeListeners=cF(d8(this.contextWindow,"pointermove",this.handlePointerMove),d8(this.contextWindow,"pointerup",this.handlePointerUp),d8(this.contextWindow,"pointercancel",this.handlePointerUp)),g&&this.startScrollTracking(g)}startScrollTracking(a){let b=a.parentElement;for(;b;){let a=getComputedStyle(b);(eb.has(a.overflowX)||eb.has(a.overflowY))&&this.scrollPositions.set(b,{x:b.scrollLeft,y:b.scrollTop}),b=b.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(a){let b=this.scrollPositions.get(a);if(!b)return;let c=a===window,d=c?{x:window.scrollX,y:window.scrollY}:{x:a.scrollLeft,y:a.scrollTop},e={x:d.x-b.x,y:d.y-b.y};(0!==e.x||0!==e.y)&&(c?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=e.x,this.lastMoveEventInfo.point.y+=e.y):this.history.length>0&&(this.history[0].x-=e.x,this.history[0].y-=e.y),this.scrollPositions.set(a,d),aF.update(this.updatePoint,!0))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),aG(this.updatePoint)}}function ed(a,b){return b?{point:b(a.point)}:a}function ee(a,b){return{x:a.x-b.x,y:a.y-b.y}}function ef({point:a},b){return{point:a,delta:ee(a,eg(b)),offset:ee(a,b[0]),velocity:function(a,b){if(a.length<2)return{x:0,y:0};let c=a.length-1,d=null,e=eg(a);for(;c>=0&&(d=a[c],!(e.timestamp-d.timestamp>aU(.1)));)c--;if(!d)return{x:0,y:0};d===a[0]&&a.length>2&&e.timestamp-d.timestamp>2*aU(b)&&(d=a[1]);let f=(e.timestamp-d.timestamp)/1e3;if(0===f)return{x:0,y:0};let g={x:(e.x-d.x)/f,y:(e.y-d.y)/f};return g.x===1/0&&(g.x=0),g.y===1/0&&(g.y=0),g}(b,.1)}}function eg(a){return a[a.length-1]}function eh(a,b,c){return{min:void 0!==b?a.min+b:void 0,max:void 0!==c?a.max+c-(a.max-a.min):void 0}}function ei(a,b){let c=b.min-a.min,d=b.max-a.max;return b.max-b.min<a.max-a.min&&([c,d]=[d,c]),{min:c,max:d}}function ej(a,b,c){return{min:ek(a,b),max:ek(a,c)}}function ek(a,b){return"number"==typeof a?a:a[b]||0}let el=new WeakMap;class em{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=X(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=a}start(a,{snapToCursor:b=!1,distanceThreshold:c}={}){let{presenceContext:d}=this.visualElement;if(d&&!1===d.isPresent)return;let e=a=>{b&&this.snapToCursor(d7(a).point),this.stopAnimation()},f=(a,b)=>{let{drag:c,dragPropagation:d,onDragStart:e}=this.getProps();if(c&&!d&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(a){if("x"===a||"y"===a)if(dM[a])return null;else return dM[a]=!0,()=>{dM[a]=!1};return dM.x||dM.y?null:(dM.x=dM.y=!0,()=>{dM.x=dM.y=!1})}(c),!this.openDragLock))return;this.latestPointerEvent=a,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),dN(a=>{let b=this.getAxisMotionValue(a).get()||0;if(w.test(b)){let{projection:c}=this.visualElement;if(c&&c.layout){let d=c.layout.layoutBox[a];d&&(b=dO(d)*(parseFloat(b)/100))}}this.originPoint[a]=b}),e&&aF.update(()=>e(a,b),!1,!0),cD(this.visualElement,"transform");let{animationState:f}=this.visualElement;f&&f.setActive("whileDrag",!0)},g=(a,b)=>{this.latestPointerEvent=a,this.latestPanInfo=b;let{dragPropagation:c,dragDirectionLock:d,onDirectionLock:e,onDrag:f}=this.getProps();if(!c&&!this.openDragLock)return;let{offset:g}=b;if(d&&null===this.currentDirection){this.currentDirection=function(a,b=10){let c=null;return Math.abs(a.y)>b?c="y":Math.abs(a.x)>b&&(c="x"),c}(g),null!==this.currentDirection&&e&&e(this.currentDirection);return}this.updateAxis("x",b.point,g),this.updateAxis("y",b.point,g),this.visualElement.render(),f&&aF.update(()=>f(a,b),!1,!0)},h=(a,b)=>{this.latestPointerEvent=a,this.latestPanInfo=b,this.stop(a,b),this.latestPointerEvent=null,this.latestPanInfo=null},i=()=>{let{dragSnapToOrigin:a}=this.getProps();(a||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:j}=this.getProps();this.panSession=new ec(a,{onSessionStart:e,onStart:f,onMove:g,onSessionEnd:h,resumeAnimation:i},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:j,distanceThreshold:c,contextWindow:d9(this.visualElement),element:this.visualElement.current})}stop(a,b){let c=a||this.latestPointerEvent,d=b||this.latestPanInfo,e=this.isDragging;if(this.cancel(),!e||!d||!c)return;let{velocity:f}=d;this.startAnimation(f);let{onDragEnd:g}=this.getProps();g&&aF.postRender(()=>g(c,d))}cancel(){this.isDragging=!1;let{projection:a,animationState:b}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:c}=this.getProps();!c&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),b&&b.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(a,b,c){let{drag:d}=this.getProps();if(!c||!eo(a,d,this.currentDirection))return;let e=this.getAxisMotionValue(a),f=this.originPoint[a]+c[a];this.constraints&&this.constraints[a]&&(f=function(a,{min:b,max:c},d){return void 0!==b&&a<b?a=d?bM(b,a,d.min):Math.max(a,b):void 0!==c&&a>c&&(a=d?bM(c,a,d.max):Math.min(a,c)),a}(f,this.constraints[a],this.elastic[a])),e.set(f)}resolveConstraints(){let{dragConstraints:a,dragElastic:b}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,d=this.constraints;a&&cv(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&c?this.constraints=function(a,{top:b,left:c,bottom:d,right:e}){return{x:eh(a.x,c,e),y:eh(a.y,b,d)}}(c.layoutBox,a):this.constraints=!1,this.elastic=function(a=.35){return!1===a?a=0:!0===a&&(a=.35),{x:ej(a,"left","right"),y:ej(a,"top","bottom")}}(b),d!==this.constraints&&!cv(a)&&c&&this.constraints&&!this.hasMutatedConstraints&&dN(a=>{!1!==this.constraints&&this.getAxisMotionValue(a)&&(this.constraints[a]=function(a,b){let c={};return void 0!==b.min&&(c.min=b.min-a.min),void 0!==b.max&&(c.max=b.max-a.min),c}(c.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){var a;let{dragConstraints:b,onMeasureDragConstraints:c}=this.getProps();if(!b||!cv(b))return!1;let d=b.current;ad(null!==d,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:e}=this.visualElement;if(!e||!e.layout)return!1;let f=function(a,b,c){let d=b1(a,c),{scroll:e}=b;return e&&(b$(d.x,e.offset.x),b$(d.y,e.offset.y)),d}(d,e.root,this.visualElement.getTransformPagePoint()),g=(a=e.layout.layoutBox,{x:ei(a.x,f.x),y:ei(a.y,f.y)});if(c){let a=c(function({x:a,y:b}){return{top:b.min,right:a.max,bottom:b.max,left:a.min}}(g));this.hasMutatedConstraints=!!a,a&&(g=bS(a))}return g}startAnimation(a){let{drag:b,dragMomentum:c,dragElastic:d,dragTransition:e,dragSnapToOrigin:f,onDragTransitionEnd:g}=this.getProps(),h=this.constraints||{};return Promise.all(dN(g=>{if(!eo(g,b,this.currentDirection))return;let i=h&&h[g]||{};f&&(i={min:0,max:0});let j={type:"inertia",velocity:c?a[g]:0,bounceStiffness:d?200:1e6,bounceDamping:d?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...e,...i};return this.startAxisValueAnimation(g,j)})).then(g)}startAxisValueAnimation(a,b){let c=this.getAxisMotionValue(a);return cD(this.visualElement,a),c.start(dz(a,c,0,b,this.visualElement,!1))}stopAnimation(){dN(a=>this.getAxisMotionValue(a).stop())}getAxisMotionValue(a){let b=`_drag${a.toUpperCase()}`,c=this.visualElement.getProps();return c[b]||this.visualElement.getValue(a,(c.initial?c.initial[a]:void 0)||0)}snapToCursor(a){dN(b=>{let{drag:c}=this.getProps();if(!eo(b,c,this.currentDirection))return;let{projection:d}=this.visualElement,e=this.getAxisMotionValue(b);if(d&&d.layout){let{min:c,max:f}=d.layout.layoutBox[b],g=e.get()||0;e.set(a[b]-bM(c,f,.5)+g)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:a,dragConstraints:b}=this.getProps(),{projection:c}=this.visualElement;if(!cv(b)||!c||!this.constraints)return;this.stopAnimation();let d={x:0,y:0};dN(a=>{let b=this.getAxisMotionValue(a);if(b&&!1!==this.constraints){let c=b.get();d[a]=function(a,b){let c=.5,d=dO(a),e=dO(b);return e>d?c=dh(b.min,b.max-d,a.min):d>e&&(c=dh(a.min,a.max-e,b.min)),i(0,1,c)}({min:c,max:c},this.constraints[a])}});let{transformTemplate:e}=this.visualElement.getProps();this.visualElement.current.style.transform=e?e({},""):"none",c.root&&c.root.updateScroll(),c.updateLayout(),this.constraints=!1,this.resolveConstraints(),dN(b=>{if(!eo(b,a,null))return;let c=this.getAxisMotionValue(b),{min:e,max:f}=this.constraints[b];c.set(bM(e,f,d[b]))}),this.visualElement.render()}addListeners(){let a;if(!this.visualElement.current)return;el.set(this.visualElement,this);let b=this.visualElement.current,c=d8(b,"pointerdown",a=>{let{drag:c,dragListener:d=!0}=this.getProps(),e=a.target,f=e!==b&&(dV.has(e.tagName)||!0===e.isContentEditable);c&&d&&!f&&this.start(a)}),d=()=>{let{dragConstraints:c}=this.getProps();cv(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),a||(a=function(a,b,c){let d=d5(a,en(c)),e=d5(b,en(c));return()=>{d(),e()}}(b,c.current,()=>this.scalePositionWithinConstraints())))},{projection:e}=this.visualElement,f=e.addEventListener("measure",d);e&&!e.layout&&(e.root&&e.root.updateScroll(),e.updateLayout()),aF.read(d);let g=dW(window,"resize",()=>this.scalePositionWithinConstraints()),h=e.addEventListener("didUpdate",({delta:a,hasLayoutChanged:b})=>{this.isDragging&&b&&(dN(b=>{let c=this.getAxisMotionValue(b);c&&(this.originPoint[b]+=a[b].translate,c.set(c.get()+a[b].translate))}),this.visualElement.render())});return()=>{g(),c(),f(),h&&h(),a&&a()}}getProps(){let a=this.visualElement.getProps(),{drag:b=!1,dragDirectionLock:c=!1,dragPropagation:d=!1,dragConstraints:e=!1,dragElastic:f=.35,dragMomentum:g=!0}=a;return{...a,drag:b,dragDirectionLock:c,dragPropagation:d,dragConstraints:e,dragElastic:f,dragMomentum:g}}}function en(a){let b=!0;return()=>{if(b){b=!1;return}a()}}function eo(a,b,c){return(!0===b||b===a)&&(null===c||c===a)}class ep extends cy{constructor(a){super(a),this.removeGroupControls=aA,this.removeListeners=aA,this.controls=new em(a)}mount(){let{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||aA}update(){let{dragControls:a}=this.node.getProps(),{dragControls:b}=this.node.prevProps||{};a!==b&&(this.removeGroupControls(),a&&(this.removeGroupControls=a.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}let eq=a=>(b,c)=>{a&&aF.update(()=>a(b,c),!1,!0)};class er extends cy{constructor(){super(...arguments),this.removePointerDownListener=aA}onPointerDown(a){this.session=new ec(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:d9(this.node)})}createPanHandlers(){let{onPanSessionStart:a,onPanStart:b,onPan:c,onPanEnd:d}=this.node.getProps();return{onSessionStart:eq(a),onStart:eq(b),onMove:eq(c),onEnd:(a,b)=>{delete this.session,d&&aF.postRender(()=>d(a,b))}}}mount(){this.removePointerDownListener=d8(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let es={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var et=c(15086);let eu=!1;class ev extends b3.Component{componentDidMount(){let{visualElement:a,layoutGroup:b,switchLayoutGroup:c,layoutId:d}=this.props,{projection:e}=a;e&&(b.group&&b.group.add(e),c&&c.register&&d&&c.register(e),eu&&e.root.didUpdate(),e.addEventListener("animationComplete",()=>{this.safeToRemove()}),e.setOptions({...e.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),es.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){let{layoutDependency:b,visualElement:c,drag:d,isPresent:e}=this.props,{projection:f}=c;return f&&(f.isPresent=e,a.layoutDependency!==b&&f.setOptions({...f.options,layoutDependency:b}),eu=!0,d||a.layoutDependency!==b||void 0===b||a.isPresent!==e?f.willUpdate():this.safeToRemove(),a.isPresent!==e&&(e?f.promote():f.relegate()||aF.postRender(()=>{let a=f.getStack();a&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),bb.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:a,layoutGroup:b,switchLayoutGroup:c}=this.props,{projection:d}=a;eu=!0,d&&(d.scheduleCheckAfterUnmount(),b&&b.group&&b.group.remove(d),c&&c.deregister&&c.deregister(d))}safeToRemove(){let{safeToRemove:a}=this.props;a&&a()}render(){return null}}function ew(a){let[b,c]=(0,et.xQ)(),d=(0,b3.useContext)(b7.L);return(0,b6.jsx)(ev,{...a,layoutGroup:d,switchLayoutGroup:(0,b3.useContext)(cu),isPresent:b,safeToRemove:c})}let ex=["TopLeft","TopRight","BottomLeft","BottomRight"],ey=ex.length,ez=a=>"string"==typeof a?parseFloat(a):a,eA=a=>"number"==typeof a||x.test(a);function eB(a,b){return void 0!==a[b]?a[b]:a.borderRadius}let eC=eE(0,.5,dd),eD=eE(.5,.95,aA);function eE(a,b,c){return d=>d<a?0:d>b?1:c(dh(a,b,d))}function eF(a,b){a.min=b.min,a.max=b.max}function eG(a,b){eF(a.x,b.x),eF(a.y,b.y)}function eH(a,b){a.translate=b.translate,a.scale=b.scale,a.originPoint=b.originPoint,a.origin=b.origin}function eI(a,b,c,d,e){return a-=b,a=d+1/c*(a-d),void 0!==e&&(a=d+1/e*(a-d)),a}function eJ(a,b,[c,d,e],f,g){!function(a,b=0,c=1,d=.5,e,f=a,g=a){if(w.test(b)&&(b=parseFloat(b),b=bM(g.min,g.max,b/100)-g.min),"number"!=typeof b)return;let h=bM(f.min,f.max,d);a===f&&(h-=b),a.min=eI(a.min,b,c,h,e),a.max=eI(a.max,b,c,h,e)}(a,b[c],b[d],b[e],b.scale,f,g)}let eK=["x","scaleX","originX"],eL=["y","scaleY","originY"];function eM(a,b,c,d){eJ(a.x,b,eK,c?c.x:void 0,d?d.x:void 0),eJ(a.y,b,eL,c?c.y:void 0,d?d.y:void 0)}function eN(a){return 0===a.translate&&1===a.scale}function eO(a){return eN(a.x)&&eN(a.y)}function eP(a,b){return a.min===b.min&&a.max===b.max}function eQ(a,b){return Math.round(a.min)===Math.round(b.min)&&Math.round(a.max)===Math.round(b.max)}function eR(a,b){return eQ(a.x,b.x)&&eQ(a.y,b.y)}function eS(a){return dO(a.x)/dO(a.y)}function eT(a,b){return a.translate===b.translate&&a.scale===b.scale&&a.originPoint===b.originPoint}class eU{constructor(){this.members=[]}add(a){aV(this.members,a);for(let b=this.members.length-1;b>=0;b--){let c=this.members[b];if(c===a||c===this.lead||c===this.prevLead)continue;let d=c.instance;d&&!1===d.isConnected&&!1!==c.isPresent&&!c.snapshot&&aW(this.members,c)}a.scheduleRender()}remove(a){if(aW(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){let a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(a){let b,c=this.members.findIndex(b=>a===b);if(0===c)return!1;for(let a=c;a>=0;a--){let c=this.members[a],d=c.instance;if(!1!==c.isPresent&&(!d||!1!==d.isConnected)){b=c;break}}return!!b&&(this.promote(b),!0)}promote(a,b){let c=this.lead;if(a!==c&&(this.prevLead=c,this.lead=a,a.show(),c)){c.instance&&c.scheduleRender(),a.scheduleRender();let d=c.options.layoutDependency,e=a.options.layoutDependency;if(void 0===d||void 0===e||d!==e){let d=c.instance;!(d&&!1===d.isConnected&&!c.snapshot)&&(a.resumeFrom=c,b&&(a.resumeFrom.preserveOpacity=!0),c.snapshot&&(a.snapshot=c.snapshot,a.snapshot.latestValues=c.animationValues||c.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0))}let{crossfade:f}=a.options;!1===f&&c.hide()}}exitAnimationComplete(){this.members.forEach(a=>{let{options:b,resumingFrom:c}=a;b.onExitComplete&&b.onExitComplete(),c&&c.options.onExitComplete&&c.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let eV=(a,b)=>a.depth-b.depth;class eW{constructor(){this.children=[],this.isDirty=!1}add(a){aV(this.children,a),this.isDirty=!0}remove(a){aW(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(eV),this.isDirty=!1,this.children.forEach(a)}}let eX={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},eY=["","X","Y","Z"],eZ=0;function e$(a,b,c,d){let{latestValues:e}=b;e[a]&&(c[a]=e[a],b.setStaticValue(a,0),d&&(d[a]=0))}function e_({attachResizeListener:a,defaultParent:b,measureScroll:c,checkIsScrollRoot:d,resetTransform:e}){return class{constructor(a={},c=b?.()){this.id=eZ++,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,aD.value&&(eX.nodes=eX.calculatedTargetDeltas=eX.calculatedProjections=0),this.nodes.forEach(e2),this.nodes.forEach(e9),this.nodes.forEach(fa),this.nodes.forEach(e3),aD.addProjectionMetrics&&aD.addProjectionMetrics(eX)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new eW)}addEventListener(a,b){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new aX),this.eventHandlers.get(a).add(b)}notifyListeners(a,...b){let c=this.eventHandlers.get(a);c&&c.notify(...b)}hasListeners(a){return this.eventHandlers.has(a)}mount(b){if(this.instance)return;this.isSVG=dY(b)&&!(dY(b)&&"svg"===b.tagName),this.instance=b;let{layoutId:c,layout:d,visualElement:e}=this.options;if(e&&!e.current&&e.mount(b),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),a){let c,d=0,e=()=>this.root.updateBlockedByResize=!1;aF.read(()=>{d=window.innerWidth}),a(b,()=>{let a=window.innerWidth;a!==d&&(d=a,this.root.updateBlockedByResize=!0,c&&c(),c=function(a,b){let c=bd.now(),d=({timestamp:e})=>{let f=e-c;f>=250&&(aG(d),a(f-b))};return aF.setup(d,!0),()=>aG(d)}(e,250),es.hasAnimatedSinceResize&&(es.hasAnimatedSinceResize=!1,this.nodes.forEach(e8)))})}c&&this.root.registerSharedNode(c,this),!1!==this.options.animate&&e&&(c||d)&&this.addEventListener("didUpdate",({delta:a,hasLayoutChanged:b,hasRelativeLayoutChanged:c,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let f=this.options.transition||e.getDefaultTransition()||fg,{onLayoutAnimationStart:g,onLayoutAnimationComplete:h}=e.getProps(),i=!this.targetLayout||!eR(this.targetLayout,d),j=!b&&c;if(this.options.layoutRoot||this.resumeFrom||j||b&&(i||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let b={...cB(f,"layout"),onPlay:g,onComplete:h};(e.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(a,j)}else b||e8(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),aG(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(fb),this.animationId++)}getTransformTemplate(){let{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function a(b){if(b.hasCheckedOptimisedAppear=!0,b.root===b)return;let{visualElement:c}=b.options;if(!c)return;let d=c.props[ct];if(window.MotionHasOptimisedAnimation(d,"transform")){let{layout:a,layoutId:c}=b.options;window.MotionCancelOptimisedAnimation(d,"transform",aF,!(a||c))}let{parent:e}=b;e&&!e.hasCheckedOptimisedAppear&&a(e)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let a=0;a<this.path.length;a++){let b=this.path[a];b.shouldResetTransform=!0,b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}let{layoutId:b,layout:c}=this.options;if(void 0===b&&!c)return;let d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(e5);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(e6);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(e7),this.nodes.forEach(e0),this.nodes.forEach(e1)):this.nodes.forEach(e6),this.clearAllSnapshots();let a=bd.now();aH.delta=i(0,1e3/60,a-aH.timestamp),aH.timestamp=a,aH.isProcessing=!0,aI.update.process(aH),aI.preRender.process(aH),aI.render.process(aH),aH.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(e4),this.sharedNodes.forEach(fc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,aF.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){aF.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||dO(this.snapshot.measuredBox.x)||dO(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 a=0;a<this.path.length;a++)this.path[a].updateScroll();let a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=X(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:b}=this.options;b&&b.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let b=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(b=!1),b&&this.instance){let b=d(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:b,offset:c(this.instance),wasRoot:this.scroll?this.scroll.isRoot:b}}}resetTransform(){if(!e)return;let a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,b=this.projectionDelta&&!eO(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;a&&this.instance&&(b||bV(this.latestValues)||f)&&(e(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){var b;let c=this.measurePageBox(),d=this.removeElementScroll(c);return a&&(d=this.removeTransform(d)),fj((b=d).x),fj(b.y),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:a}=this.options;if(!a)return X();let b=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(fl))){let{scroll:a}=this.root;a&&(b$(b.x,a.offset.x),b$(b.y,a.offset.y))}return b}removeElementScroll(a){let b=X();if(eG(b,a),this.scroll?.wasRoot)return b;for(let c=0;c<this.path.length;c++){let d=this.path[c],{scroll:e,options:f}=d;d!==this.root&&e&&f.layoutScroll&&(e.wasRoot&&eG(b,a),b$(b.x,e.offset.x),b$(b.y,e.offset.y))}return b}applyTransform(a,b=!1){let c=X();eG(c,a);for(let a=0;a<this.path.length;a++){let d=this.path[a];!b&&d.options.layoutScroll&&d.scroll&&d!==d.root&&b0(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),bV(d.latestValues)&&b0(c,d.latestValues)}return bV(this.latestValues)&&b0(c,this.latestValues),c}removeTransform(a){let b=X();eG(b,a);for(let a=0;a<this.path.length;a++){let c=this.path[a];if(!c.instance||!bV(c.latestValues))continue;bU(c.latestValues)&&c.updateSnapshot();let d=X();eG(d,c.measurePageBox()),eM(b,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return bV(this.latestValues)&&eM(b,this.latestValues),b}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:void 0===a.crossfade||a.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!==aH.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){let b=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=b.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=b.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=b.isSharedProjectionDirty);let c=!!this.resumingFrom||this!==b;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:d,layoutId:e}=this.options;if(!this.layout||!(d||e))return;this.resolvedRelativeTargetAt=aH.timestamp;let f=this.getClosestProjectingParent();if(f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=X(),this.targetWithTransforms=X()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var g,h,i;this.forceRelativeParentToResolveTarget(),g=this.target,h=this.relativeTarget,i=this.relativeParent.target,dR(g.x,h.x,i.x),dR(g.y,h.y,i.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):eG(this.target,this.layout.layoutBox),bZ(this.target,this.targetDelta)):eG(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&1!==this.animationProgress?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0),aD.value&&eX.calculatedTargetDeltas++}}getClosestProjectingParent(){if(!(!this.parent||bU(this.parent.latestValues)||bW(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,b,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=X(),this.relativeTargetOrigin=X(),dT(this.relativeTargetOrigin,b,c),eG(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let a=this.getLead(),b=!!this.resumingFrom||this!==a,c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),b&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===aH.timestamp&&(c=!1),c)return;let{layout:d,layoutId:e}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||e))return;eG(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,g=this.treeScale.y;!function(a,b,c,d=!1){let e,f,g=c.length;if(g){b.x=b.y=1;for(let h=0;h<g;h++){f=(e=c[h]).projectionDelta;let{visualElement:g}=e.options;(!g||!g.props.style||"contents"!==g.props.style.display)&&(d&&e.options.layoutScroll&&e.scroll&&e!==e.root&&b0(a,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),f&&(b.x*=f.x.scale,b.y*=f.y.scale,bZ(a,f)),d&&bV(e.latestValues)&&b0(a,e.latestValues))}b.x<1.0000000000001&&b.x>.999999999999&&(b.x=1),b.y<1.0000000000001&&b.y>.999999999999&&(b.y=1)}}(this.layoutCorrected,this.treeScale,this.path,b),a.layout&&!a.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=X());let{target:h}=a;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(eH(this.prevProjectionDelta.x,this.projectionDelta.x),eH(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),dQ(this.projectionDelta,this.layoutCorrected,h,this.latestValues),this.treeScale.x===f&&this.treeScale.y===g&&eT(this.projectionDelta.x,this.prevProjectionDelta.x)&&eT(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h)),aD.value&&eX.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){let a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=V(),this.projectionDelta=V(),this.projectionDeltaWithTransform=V()}setAnimationOrigin(a,b=!1){let c,d=this.snapshot,e=d?d.latestValues:{},f={...this.latestValues},g=V();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!b;let h=X(),i=(d?d.source:void 0)!==(this.layout?this.layout.source:void 0),j=this.getStack(),k=!j||j.members.length<=1,l=!!(i&&!k&&!0===this.options.crossfade&&!this.path.some(ff));this.animationProgress=0,this.mixTargetDelta=b=>{let d=b/1e3;if(fd(g.x,a.x,d),fd(g.y,a.y,d),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var j,m,n,o,p,q;dT(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),n=this.relativeTarget,o=this.relativeTargetOrigin,p=h,q=d,fe(n.x,o.x,p.x,q),fe(n.y,o.y,p.y,q),c&&(j=this.relativeTarget,m=c,eP(j.x,m.x)&&eP(j.y,m.y))&&(this.isProjectionDirty=!1),c||(c=X()),eG(c,this.relativeTarget)}i&&(this.animationValues=f,function(a,b,c,d,e,f){e?(a.opacity=bM(0,c.opacity??1,eC(d)),a.opacityExit=bM(b.opacity??1,0,eD(d))):f&&(a.opacity=bM(b.opacity??1,c.opacity??1,d));for(let e=0;e<ey;e++){let f=`border${ex[e]}Radius`,g=eB(b,f),h=eB(c,f);(void 0!==g||void 0!==h)&&(g||(g=0),h||(h=0),0===g||0===h||eA(g)===eA(h)?(a[f]=Math.max(bM(ez(g),ez(h),d),0),(w.test(h)||w.test(g))&&(a[f]+="%")):a[f]=h)}(b.rotate||c.rotate)&&(a.rotate=bM(b.rotate||0,c.rotate||0,d))}(f,e,this.latestValues,d,l,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=d},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(aG(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=aF.update(()=>{es.hasAnimatedSinceResize=!0,a1.layout++,this.motionValue||(this.motionValue=bg(0)),this.currentAnimation=function(a,b,c){let d=Y(a)?a:bg(a);return d.start(dz("",d,b,c)),d.animation}(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:b=>{this.mixTargetDelta(b),a.onUpdate&&a.onUpdate(b)},onStop:()=>{a1.layout--},onComplete:()=>{a1.layout--,a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let a=this.getLead(),{targetWithTransforms:b,target:c,layout:d,latestValues:e}=a;if(b&&c&&d){if(this!==a&&this.layout&&d&&fk(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||X();let b=dO(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+b;let d=dO(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+d}eG(b,c),b0(b,e),dQ(this.projectionDeltaWithTransform,this.layoutCorrected,b,e)}}registerSharedNode(a,b){this.sharedNodes.has(a)||this.sharedNodes.set(a,new eU),this.sharedNodes.get(a).add(b);let c=b.options.initialPromotionConfig;b.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(b):void 0})}isLead(){let a=this.getStack();return!a||a.lead===this}getLead(){let{layoutId:a}=this.options;return a&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:b,preserveFollowOpacity:c}={}){let d=this.getStack();d&&d.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),b&&this.setOptions({transition:b})}relegate(){let a=this.getStack();return!!a&&a.relegate(this)}resetSkewAndRotation(){let{visualElement:a}=this.options;if(!a)return;let b=!1,{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(b=!0),!b)return;let d={};c.z&&e$("z",a,d,this.animationValues);for(let b=0;b<eY.length;b++)e$(`rotate${eY[b]}`,a,d,this.animationValues),e$(`skew${eY[b]}`,a,d,this.animationValues);for(let b in a.render(),d)a.setStaticValue(b,d[b]),this.animationValues&&(this.animationValues[b]=d[b]);a.scheduleRender()}applyProjectionStyles(a,b){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}let c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=ci(b?.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}let d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(a.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,a.pointerEvents=ci(b?.pointerEvents)||""),this.hasProjected&&!bV(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";let e=d.animationValues||d.latestValues;this.applyTransformsToTarget();let f=function(a,b,c){let d="",e=a.x.translate/b.x,f=a.y.translate/b.y,g=c?.z||0;if((e||f||g)&&(d=`translate3d(${e}px, ${f}px, ${g}px) `),(1!==b.x||1!==b.y)&&(d+=`scale(${1/b.x}, ${1/b.y}) `),c){let{transformPerspective:a,rotate:b,rotateX:e,rotateY:f,skewX:g,skewY:h}=c;a&&(d=`perspective(${a}px) ${d}`),b&&(d+=`rotate(${b}deg) `),e&&(d+=`rotateX(${e}deg) `),f&&(d+=`rotateY(${f}deg) `),g&&(d+=`skewX(${g}deg) `),h&&(d+=`skewY(${h}deg) `)}let h=a.x.scale*b.x,i=a.y.scale*b.y;return(1!==h||1!==i)&&(d+=`scale(${h}, ${i})`),d||"none"}(this.projectionDeltaWithTransform,this.treeScale,e);c&&(f=c(e,f)),a.transform=f;let{x:g,y:h}=this.projectionDelta;for(let b in a.transformOrigin=`${100*g.origin}% ${100*h.origin}% 0`,d.animationValues?a.opacity=d===this?e.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:e.opacityExit:a.opacity=d===this?void 0!==e.opacity?e.opacity:"":void 0!==e.opacityExit?e.opacityExit:0,bN){if(void 0===e[b])continue;let{correct:c,applyTo:g,isCSSVariable:h}=bN[b],i="none"===f?e[b]:c(e[b],d);if(g){let b=g.length;for(let c=0;c<b;c++)a[g[c]]=i}else h?this.options.visualElement.renderState.vars[b]=i:a[b]=i}this.options.layoutId&&(a.pointerEvents=d===this?ci(b?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(e5),this.root.sharedNodes.clear()}}}function e0(a){a.updateLayout()}function e1(a){let b=a.resumeFrom?.snapshot||a.snapshot;if(a.isLead()&&a.layout&&b&&a.hasListeners("didUpdate")){let{layoutBox:c,measuredBox:d}=a.layout,{animationType:e}=a.options,f=b.source!==a.layout.source;"size"===e?dN(a=>{let d=f?b.measuredBox[a]:b.layoutBox[a],e=dO(d);d.min=c[a].min,d.max=d.min+e}):fk(e,b.layoutBox,c)&&dN(d=>{let e=f?b.measuredBox[d]:b.layoutBox[d],g=dO(c[d]);e.max=e.min+g,a.relativeTarget&&!a.currentAnimation&&(a.isProjectionDirty=!0,a.relativeTarget[d].max=a.relativeTarget[d].min+g)});let g=V();dQ(g,c,b.layoutBox);let h=V();f?dQ(h,a.applyTransform(d,!0),b.measuredBox):dQ(h,c,b.layoutBox);let i=!eO(g),j=!1;if(!a.resumeFrom){let d=a.getClosestProjectingParent();if(d&&!d.resumeFrom){let{snapshot:e,layout:f}=d;if(e&&f){let g=X();dT(g,b.layoutBox,e.layoutBox);let h=X();dT(h,c,f.layoutBox),eR(g,h)||(j=!0),d.options.layoutRoot&&(a.relativeTarget=h,a.relativeTargetOrigin=g,a.relativeParent=d)}}}a.notifyListeners("didUpdate",{layout:c,snapshot:b,delta:h,layoutDelta:g,hasLayoutChanged:i,hasRelativeLayoutChanged:j})}else if(a.isLead()){let{onExitComplete:b}=a.options;b&&b()}a.options.transition=void 0}function e2(a){aD.value&&eX.nodes++,a.parent&&(a.isProjecting()||(a.isProjectionDirty=a.parent.isProjectionDirty),a.isSharedProjectionDirty||(a.isSharedProjectionDirty=!!(a.isProjectionDirty||a.parent.isProjectionDirty||a.parent.isSharedProjectionDirty)),a.isTransformDirty||(a.isTransformDirty=a.parent.isTransformDirty))}function e3(a){a.isProjectionDirty=a.isSharedProjectionDirty=a.isTransformDirty=!1}function e4(a){a.clearSnapshot()}function e5(a){a.clearMeasurements()}function e6(a){a.isLayoutDirty=!1}function e7(a){let{visualElement:b}=a.options;b&&b.getProps().onBeforeLayoutMeasure&&b.notify("BeforeLayoutMeasure"),a.resetTransform()}function e8(a){a.finishAnimation(),a.targetDelta=a.relativeTarget=a.target=void 0,a.isProjectionDirty=!0}function e9(a){a.resolveTargetDelta()}function fa(a){a.calcProjection()}function fb(a){a.resetSkewAndRotation()}function fc(a){a.removeLeadSnapshot()}function fd(a,b,c){a.translate=bM(b.translate,0,c),a.scale=bM(b.scale,1,c),a.origin=b.origin,a.originPoint=b.originPoint}function fe(a,b,c,d){a.min=bM(b.min,c.min,d),a.max=bM(b.max,c.max,d)}function ff(a){return a.animationValues&&void 0!==a.animationValues.opacityExit}let fg={duration:.45,ease:[.4,0,.1,1]},fh=a=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(a),fi=fh("applewebkit/")&&!fh("chrome/")?Math.round:aA;function fj(a){a.min=fi(a.min),a.max=fi(a.max)}function fk(a,b,c){return"position"===a||"preserve-aspect"===a&&!(.2>=Math.abs(eS(b)-eS(c)))}function fl(a){return a!==a.root&&a.scroll?.wasRoot}let fm=e_({attachResizeListener:(a,b)=>dW(a,"resize",b),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),fn={current:void 0},fo=e_({measureScroll:a=>({x:a.scrollLeft,y:a.scrollTop}),defaultParent:()=>{if(!fn.current){let a=new fm({});a.mount(window),a.setOptions({layoutScroll:!0}),fn.current=a}return fn.current},resetTransform:(a,b)=>{a.style.transform=void 0!==b?b:"none"},checkIsScrollRoot:a=>"fixed"===window.getComputedStyle(a).position});function fp(a,b){let c=dZ(a),d=new AbortController;return[c,{passive:!0,...b,signal:d.signal},()=>d.abort()]}function fq(a,b,c){let{props:d}=a;a.animationState&&d.whileHover&&a.animationState.setActive("whileHover","Start"===c);let e=d["onHover"+c];e&&aF.postRender(()=>e(b,d7(b)))}class fr extends cy{mount(){let{current:a}=this.node;a&&(this.unmount=function(a,b,c={}){let[d,e,f]=fp(a,c);return d.forEach(a=>{let c,d=!1,f=!1,g=b=>{c&&(c(b),c=void 0),a.removeEventListener("pointerleave",i)},h=a=>{d=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),f&&(f=!1,g(a))},i=a=>{if("touch"!==a.pointerType){if(d){f=!0;return}g(a)}};a.addEventListener("pointerenter",d=>{if("touch"===d.pointerType||dM.x||dM.y)return;f=!1;let g=b(a,d);"function"==typeof g&&(c=g,a.addEventListener("pointerleave",i,e))},e),a.addEventListener("pointerdown",()=>{d=!0,window.addEventListener("pointerup",h,e),window.addEventListener("pointercancel",h,e)},e)}),f}(a,(a,b)=>(fq(this.node,b,"Start"),a=>fq(this.node,a,"End"))))}unmount(){}}class fs extends cy{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch(b){a=!0}a&&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=cF(dW(this.node.current,"focus",()=>this.onFocus()),dW(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}var ft=c(109364);let fu=(a,b)=>!!b&&(a===b||fu(a,b.parentElement)),fv=new WeakSet;function fw(a){return b=>{"Enter"===b.key&&a(b)}}function fx(a,b){a.dispatchEvent(new PointerEvent("pointer"+b,{isPrimary:!0,bubbles:!0}))}function fy(a){return d6(a)&&!(dM.x||dM.y)}let fz=new WeakSet;function fA(a,b,c){let{props:d}=a;if(a.current instanceof HTMLButtonElement&&a.current.disabled)return;a.animationState&&d.whileTap&&a.animationState.setActive("whileTap","Start"===c);let e=d["onTap"+("End"===c?"":c)];e&&aF.postRender(()=>e(b,d7(b)))}class fB extends cy{mount(){let{current:a}=this.node;if(!a)return;let{globalTapTarget:b,propagate:c}=this.node.props;this.unmount=function(a,b,c={}){let[d,e,f]=fp(a,c),g=a=>{let d=a.currentTarget;if(!fy(a)||fz.has(a))return;fv.add(d),c.stopPropagation&&fz.add(a);let f=b(d,a),g=(a,b)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",i),fv.has(d)&&fv.delete(d),fy(a)&&"function"==typeof f&&f(a,{success:b})},h=a=>{g(a,d===window||d===document||c.useGlobalTarget||fu(d,a.target))},i=a=>{g(a,!1)};window.addEventListener("pointerup",h,e),window.addEventListener("pointercancel",i,e)};return d.forEach(a=>{((c.useGlobalTarget?window:a).addEventListener("pointerdown",g,e),(0,ft.s)(a))&&(a.addEventListener("focus",a=>((a,b)=>{let c=a.currentTarget;if(!c)return;let d=fw(()=>{if(fv.has(c))return;fx(c,"down");let a=fw(()=>{fx(c,"up")});c.addEventListener("keyup",a,b),c.addEventListener("blur",()=>fx(c,"cancel"),b)});c.addEventListener("keydown",d,b),c.addEventListener("blur",()=>c.removeEventListener("keydown",d),b)})(a,e)),dU.has(a.tagName)||!0===a.isContentEditable||a.hasAttribute("tabindex")||(a.tabIndex=0))}),f}(a,(a,b)=>(fA(this.node,b,"Start"),(a,{success:b})=>fA(this.node,a,b?"End":"Cancel")),{useGlobalTarget:b,stopPropagation:c?.tap===!1})}unmount(){}}let fC=new WeakMap,fD=new WeakMap,fE=a=>{let b=fC.get(a.target);b&&b(a)},fF=a=>{a.forEach(fE)},fG={some:0,all:1};class fH extends cy{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:a={}}=this.node.getProps(),{root:b,margin:c,amount:d="some",once:e}=a,f={root:b?b.current:void 0,rootMargin:c,threshold:"number"==typeof d?d:fG[d]},g=a=>{let{isIntersecting:b}=a;if(this.isInView===b||(this.isInView=b,e&&!b&&this.hasEnteredView))return;b&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",b);let{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=b?c:d;f&&f(a)};var h=this.node.current;let i=function({root:a,...b}){let c=a||document;fD.has(c)||fD.set(c,{});let d=fD.get(c),e=JSON.stringify(b);return d[e]||(d[e]=new IntersectionObserver(fF,{root:a,...b})),d[e]}(f);return fC.set(h,g),i.observe(h),()=>{fC.delete(h),i.unobserve(h)}}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:a,prevProps:b}=this.node;["amount","margin","root"].some(function({viewport:a={}},{viewport:b={}}={}){return c=>a[c]!==b[c]}(a,b))&&this.startObserver()}unmount(){}}let fI=function(a,b){if("undefined"==typeof Proxy)return cx;let c=new Map,d=(c,d)=>cx(c,d,a,b);return new Proxy((a,b)=>d(a,b),{get:(e,f)=>"create"===f?d:(c.has(f)||c.set(f,cx(f,void 0,a,b)),c.get(f))})}({animation:{Feature:dJ},exit:{Feature:dL},inView:{Feature:fH},tap:{Feature:fB},focus:{Feature:fs},hover:{Feature:fr},pan:{Feature:er},drag:{Feature:ep,ProjectionNode:fo,MeasureLayout:ew},layout:{ProjectionNode:fo,MeasureLayout:ew}},(a,b)=>b.isSVG??b5(a)?new bR(b):new b2(b,{allowProjection:a!==b3.Fragment}))},554910:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(783037),e=c(747451);b.isArrayLikeObject=function(a){return e.isObjectLike(a)&&d.isArrayLike(a)}},554989:(a,b,c)=>{"use strict";c.d(b,{$7J:()=>p,$lo:()=>s,AHR:()=>C,CZR:()=>v,D6W:()=>j,J2O:()=>H,N3N:()=>h,Nxe:()=>E,SrF:()=>A,UKz:()=>y,X_y:()=>m,_eB:()=>x,awM:()=>q,ezH:()=>t,gkj:()=>e,i4$:()=>o,iU0:()=>r,jHc:()=>k,kDV:()=>i,lNO:()=>B,lic:()=>G,mM8:()=>u,nP5:()=>z,phd:()=>F,pz8:()=>n,unz:()=>w,vzR:()=>g,wsd:()=>l,x5_:()=>f,z3D:()=>D});var d=c(75567);function e(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5.033 14.649H.743a.74.74 0 0 1-.686-.458.74.74 0 0 1 .16-.808L3.19 10.41H1.06A1.06 1.06 0 0 1 0 9.35h3.957c.301 0 .57.18.686.458a.74.74 0 0 1-.161.808L1.51 13.59h2.464c.585 0 1.06.475 1.06 1.06zM24 11.338c0-1.14-.927-2.066-2.066-2.066-.61 0-1.158.265-1.537.686a2.061 2.061 0 0 0-1.536-.686c-1.14 0-2.066.926-2.066 2.066v3.311a1.06 1.06 0 0 0 1.06-1.06v-2.251a1.004 1.004 0 0 1 2.013 0v2.251c0 .586.474 1.06 1.06 1.06v-3.311a1.004 1.004 0 0 1 2.012 0v2.251c0 .586.475 1.06 1.06 1.06zM16.265 12a2.728 2.728 0 1 1-5.457 0 2.728 2.728 0 0 1 5.457 0zm-1.06 0a1.669 1.669 0 1 0-3.338 0 1.669 1.669 0 0 0 3.338 0zm-4.82 0a2.728 2.728 0 1 1-5.458 0 2.728 2.728 0 0 1 5.457 0zm-1.06 0a1.669 1.669 0 1 0-3.338 0 1.669 1.669 0 0 0 3.338 0z"},child:[]}]})(a)}function f(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.914 2.904V16.29L24 2.905H12.914zM0 2.906C0 5.966 2.483 8.45 5.543 8.45s5.542-2.484 5.543-5.544H0zm11.086 4.807L0 21.096h11.086V7.713zm7.37 7.84c-3.063 0-5.542 2.48-5.542 5.543H24c0-3.06-2.48-5.543-5.543-5.543z"},child:[]}]})(a)}function g(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},child:[]}]})(a)}function h(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21.147 0H2.853A2.86 2.86 0 000 2.853v18.294A2.86 2.86 0 002.853 24h18.294A2.86 2.86 0 0024 21.147V2.853A2.86 2.86 0 0021.147 0zM10.34 17.287a.953.953 0 01-.953.953h-4a.954.954 0 01-.954-.953V5.38a.953.953 0 01.954-.953h4a.954.954 0 01.953.953zm9.233-5.467a.944.944 0 01-.953.947h-4a.947.947 0 01-.953-.947V5.38a.953.953 0 01.953-.953h4a.954.954 0 01.953.953z"},child:[]}]})(a)}function i(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},child:[]}]})(a)}function j(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},child:[]}]})(a)}function k(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z"},child:[]}]})(a)}function l(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10.006 5.415a4.195 4.195 0 013.045-1.306c1.56 0 2.954.9 3.69 2.205.63-.3 1.35-.45 2.1-.45 2.85 0 5.159 2.34 5.159 5.22s-2.31 5.22-5.176 5.22c-.345 0-.69-.044-1.02-.104a3.75 3.75 0 01-3.3 1.95c-.6 0-1.155-.15-1.65-.375A4.314 4.314 0 018.88 20.4a4.302 4.302 0 01-4.05-2.82c-.27.062-.54.076-.825.076-2.204 0-4.005-1.8-4.005-4.05 0-1.5.811-2.805 2.01-3.51-.255-.57-.39-1.2-.39-1.846 0-2.58 2.1-4.65 4.65-4.65 1.53 0 2.85.705 3.72 1.8"},child:[]}]})(a)}function m(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M22.3977 7.0896h-2.3106V.0676l-7.5094 6.3542V.1577h-1.1554v6.1966L4.4904 0v7.0896H1.6023v10.3976h2.8882V24l6.932-6.3591v6.2005h1.1554v-6.0469l6.9318 6.1807v-6.4879h2.8882V7.0896zm-3.4657-4.531v4.531h-5.355l5.355-4.531zm-13.2862.0676 4.8691 4.4634H5.6458V2.6262zM2.7576 16.332V8.245h7.8476l-6.1149 6.1147v1.9723H2.7576zm2.8882 5.0404v-3.8852h.0001v-2.6488l5.7763-5.7764v7.0111l-5.7764 5.2993zm12.7086.0248-5.7766-5.1509V9.0618l5.7766 5.7766v6.5588zm2.8882-5.0652h-1.733v-1.9723L13.3948 8.245h7.8478v8.087z"},child:[]}]})(a)}function n(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"},child:[]}]})(a)}function o(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},child:[]}]})(a)}function p(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17.143 3.429v3.428h-3.429v3.429h-3.428V6.857H6.857V3.43H3.43v13.714H0v3.428h10.286v-3.428H6.857v-3.429h3.429v3.429h3.429v-3.429h3.428v3.429h-3.428v3.428H24v-3.428h-3.43V3.429z"},child:[]}]})(a)}function q(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.915 4.03c-1.968 0-3.683 1.28-4.871 3.113C.704 9.208 0 11.883 0 14.449c0 .706.07 1.369.21 1.973a6.624 6.624 0 0 0 .265.86 5.297 5.297 0 0 0 .371.761c.696 1.159 1.818 1.927 3.593 1.927 1.497 0 2.633-.671 3.965-2.444.76-1.012 1.144-1.626 2.663-4.32l.756-1.339.186-.325c.061.1.121.196.183.3l2.152 3.595c.724 1.21 1.665 2.556 2.47 3.314 1.046.987 1.992 1.22 3.06 1.22 1.075 0 1.876-.355 2.455-.843a3.743 3.743 0 0 0 .81-.973c.542-.939.861-2.127.861-3.745 0-2.72-.681-5.357-2.084-7.45-1.282-1.912-2.957-2.93-4.716-2.93-1.047 0-2.088.467-3.053 1.308-.652.57-1.257 1.29-1.82 2.05-.69-.875-1.335-1.547-1.958-2.056-1.182-.966-2.315-1.303-3.454-1.303zm10.16 2.053c1.147 0 2.188.758 2.992 1.999 1.132 1.748 1.647 4.195 1.647 6.4 0 1.548-.368 2.9-1.839 2.9-.58 0-1.027-.23-1.664-1.004-.496-.601-1.343-1.878-2.832-4.358l-.617-1.028a44.908 44.908 0 0 0-1.255-1.98c.07-.109.141-.224.211-.327 1.12-1.667 2.118-2.602 3.358-2.602zm-10.201.553c1.265 0 2.058.791 2.675 1.446.307.327.737.871 1.234 1.579l-1.02 1.566c-.757 1.163-1.882 3.017-2.837 4.338-1.191 1.649-1.81 1.817-2.486 1.817-.524 0-1.038-.237-1.383-.794-.263-.426-.464-1.13-.464-2.046 0-2.221.63-4.535 1.66-6.088.454-.687.964-1.226 1.533-1.533a2.264 2.264 0 0 1 1.088-.285z"},child:[]}]})(a)}function r(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"},child:[]}]})(a)}function s(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"},child:[]}]})(a)}function t(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z"},child:[]}]})(a)}function u(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z"},child:[]}]})(a)}function v(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.318 12.545H7.91v-1.909h3.41v1.91zM14.728 0v6h6l-6-6zm1.363 10.636h-3.41v1.91h3.41v-1.91zm0 3.273h-3.41v1.91h3.41v-1.91zM20.727 6.5v15.864c0 .904-.732 1.636-1.636 1.636H4.909a1.636 1.636 0 0 1-1.636-1.636V1.636C3.273.732 4.005 0 4.909 0h9.318v6.5h6.5zm-3.273 2.773H6.545v7.909h10.91v-7.91zm-6.136 4.636H7.91v1.91h3.41v-1.91z"},child:[]}]})(a)}function w(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.01 1.485c-2.082 0-3.754.02-3.743.047.01.02 1.708 3.001 3.774 6.62l3.76 6.574h3.76c2.081 0 3.753-.02 3.742-.047-.005-.02-1.708-3.001-3.775-6.62l-3.76-6.574zm-4.76 1.73a789.828 789.861 0 0 0-3.63 6.319L0 15.868l1.89 3.298 1.885 3.297 3.62-6.335 3.618-6.33-1.88-3.287C8.1 4.704 7.255 3.22 7.25 3.214zm2.259 12.653-.203.348c-.114.198-.96 1.672-1.88 3.287a423.93 423.948 0 0 1-1.698 2.97c-.01.026 3.24.042 7.222.042h7.244l1.796-3.157c.992-1.734 1.85-3.23 1.906-3.323l.104-.167h-7.249z"},child:[]}]})(a)}function x(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.316 5.684H24v12.632h-5.684V5.684zM5.684 24h12.632v-5.684H5.684V24zM18.316 5.684V0H1.895A1.894 1.894 0 0 0 0 1.895v16.421h5.684V5.684h12.632zm-7.207 6.25v-.065c.272-.144.5-.349.687-.617s.279-.595.279-.982c0-.379-.099-.72-.3-1.025a2.05 2.05 0 0 0-.832-.714 2.703 2.703 0 0 0-1.197-.257c-.6 0-1.094.156-1.481.467-.386.311-.65.671-.793 1.078l1.085.452c.086-.249.224-.461.413-.633.189-.172.445-.257.767-.257.33 0 .602.088.816.264a.86.86 0 0 1 .322.703c0 .33-.12.589-.36.778-.24.19-.535.284-.886.284h-.567v1.085h.633c.407 0 .748.109 1.02.327.272.218.407.499.407.843 0 .336-.129.614-.387.832s-.565.327-.924.327c-.351 0-.651-.103-.897-.311-.248-.208-.422-.502-.521-.881l-1.096.452c.178.616.505 1.082.977 1.401.472.319.984.478 1.538.477a2.84 2.84 0 0 0 1.293-.291c.382-.193.684-.458.902-.794.218-.336.327-.72.327-1.149 0-.429-.115-.797-.344-1.105a2.067 2.067 0 0 0-.881-.689zm2.093-1.931l.602.913L15 10.045v5.744h1.187V8.446h-.827l-2.158 1.557zM22.105 0h-3.289v5.184H24V1.895A1.894 1.894 0 0 0 22.105 0zm-3.289 23.5l4.684-4.684h-4.684V23.5zM0 22.105C0 23.152.848 24 1.895 24h3.289v-5.184H0v3.289z"},child:[]}]})(a)}function y(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"},child:[]}]})(a)}function z(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-2.023 2.309-3.178 3.927-1.964L5.455 4.64 12 9.548l6.545-4.91 1.528-1.145C21.69 2.28 24 3.434 24 5.457z"},child:[]}]})(a)}function A(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},child:[]}]})(a)}function B(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},child:[]}]})(a)}function C(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.6035 0v24h4.9317V0zm9.8613 0v24h4.9317V0z"},child:[]}]})(a)}function D(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"},child:[]}]})(a)}function E(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},child:[]}]})(a)}function F(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"},child:[]}]})(a)}function G(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.78 12.653c-2.882 0-5.22 2.336-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.34 5.22-5.22-2.336-5.22-5.22-5.22zm-13.56 0c-2.88 0-5.22 2.337-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.338 5.22-5.22-2.336-5.22-5.22-5.22zm12-6.525c0 2.883-2.337 5.22-5.22 5.22-2.882 0-5.22-2.337-5.22-5.22 0-2.88 2.338-5.22 5.22-5.22 2.883 0 5.22 2.34 5.22 5.22z"},child:[]}]})(a)}function H(a){return(0,d.k5)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z"},child:[]}]})(a)}},559282:(a,b,c)=>{"use strict";c.d(b,{Dk:()=>M,$b:()=>J,Lf:()=>K,s8:()=>L});var d=c(736927),e=c(327648),f=c(32876),g=c(327770),h=c(422703),i=c(585004),j=c(250367),k=c(565254),l=c(418398),m=c(197143),n=c(685343),o=c(565744),p=c(673977),q=c(461821),r=c(720511),s=r.YY.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:a=>{let b=a.style.textAlign;return this.options.alignments.includes(b)?b:this.options.defaultAlignment},renderHTML:a=>a.textAlign?{style:`text-align: ${a.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:a=>({commands:b})=>!!this.options.alignments.includes(a)&&this.options.types.map(c=>b.updateAttributes(c,{textAlign:a})).some(a=>a),unsetTextAlign:()=>({commands:a})=>this.options.types.map(b=>a.resetAttributes(b,"textAlign")).some(a=>a),toggleTextAlign:a=>({editor:b,commands:c})=>!!this.options.alignments.includes(a)&&(b.isActive({textAlign:a})?c.unsetTextAlign():c.setTextAlign(a))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),t=(a,b=0)=>{let c=[];return!a.children.length||b>20||Array.from(a.children).forEach(a=>{"SPAN"===a.tagName?c.push(a):a.children.length&&c.push(...t(a,b+1))}),c},u=r.CU.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:a=>!!a.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(a=>{if(!a.children.length)return;let b=t(a);b&&b.forEach(a=>{var b,c;let d=a.getAttribute("style"),e=null==(c=null==(b=a.parentElement)?void 0:b.closest("span"))?void 0:c.getAttribute("style");a.setAttribute("style",`${e};${d}`)})})(a),{})}]},renderHTML({HTMLAttributes:a}){return["span",(0,r.KV)(this.options.HTMLAttributes,a),0]},addCommands(){return{toggleTextStyle:a=>({commands:b})=>b.toggleMark(this.name,a),removeEmptyTextStyle:()=>({tr:a})=>{let{selection:b}=a;return a.doc.nodesBetween(b.from,b.to,(b,c)=>{if(b.isTextblock)return!0;b.marks.filter(a=>a.type===this.type).some(a=>Object.values(a.attrs).some(a=>!!a))||a.removeMark(c,c+b.nodeSize,this.type)}),!0}}}}),v=r.YY.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:a=>{var b;let c=a.getAttribute("style");if(c){let a=c.split(";").map(a=>a.trim()).filter(Boolean);for(let b=a.length-1;b>=0;b-=1){let c=a[b].split(":");if(c.length>=2){let a=c[0].trim().toLowerCase(),b=c.slice(1).join(":").trim();if("background-color"===a)return b.replace(/['"]+/g,"")}}}return null==(b=a.style.backgroundColor)?void 0:b.replace(/['"]+/g,"")},renderHTML:a=>a.backgroundColor?{style:`background-color: ${a.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:a=>({chain:b})=>b().setMark("textStyle",{backgroundColor:a}).run(),unsetBackgroundColor:()=>({chain:a})=>a().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),w=r.YY.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:a=>{var b;let c=a.getAttribute("style");if(c){let a=c.split(";").map(a=>a.trim()).filter(Boolean);for(let b=a.length-1;b>=0;b-=1){let c=a[b].split(":");if(c.length>=2){let a=c[0].trim().toLowerCase(),b=c.slice(1).join(":").trim();if("color"===a)return b.replace(/['"]+/g,"")}}}return null==(b=a.style.color)?void 0:b.replace(/['"]+/g,"")},renderHTML:a=>a.color?{style:`color: ${a.color}`}:{}}}}]},addCommands:()=>({setColor:a=>({chain:b})=>b().setMark("textStyle",{color:a}).run(),unsetColor:()=>({chain:a})=>a().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),x=r.YY.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:a=>a.style.fontFamily,renderHTML:a=>a.fontFamily?{style:`font-family: ${a.fontFamily}`}:{}}}}]},addCommands:()=>({setFontFamily:a=>({chain:b})=>b().setMark("textStyle",{fontFamily:a}).run(),unsetFontFamily:()=>({chain:a})=>a().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),y=r.YY.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:a=>a.style.fontSize,renderHTML:a=>a.fontSize?{style:`font-size: ${a.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:a=>({chain:b})=>b().setMark("textStyle",{fontSize:a}).run(),unsetFontSize:()=>({chain:a})=>a().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),z=r.YY.create({name:"lineHeight",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:a=>a.style.lineHeight,renderHTML:a=>a.lineHeight?{style:`line-height: ${a.lineHeight}`}:{}}}}]},addCommands:()=>({setLineHeight:a=>({chain:b})=>b().setMark("textStyle",{lineHeight:a}).run(),unsetLineHeight:()=>({chain:a})=>a().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})});r.YY.create({name:"textStyleKit",addExtensions(){let a=[];return!1!==this.options.backgroundColor&&a.push(v.configure(this.options.backgroundColor)),!1!==this.options.color&&a.push(w.configure(this.options.color)),!1!==this.options.fontFamily&&a.push(x.configure(this.options.fontFamily)),!1!==this.options.fontSize&&a.push(y.configure(this.options.fontSize)),!1!==this.options.lineHeight&&a.push(z.configure(this.options.lineHeight)),!1!==this.options.textStyle&&a.push(u.configure(this.options.textStyle)),a}});var A=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,B=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,C=r.CU.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:a=>a.getAttribute("data-color")||a.style.backgroundColor,renderHTML:a=>a.color?{"data-color":a.color,style:`background-color: ${a.color}; color: inherit`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:a}){return["mark",(0,r.KV)(this.options.HTMLAttributes,a),0]},renderMarkdown:(a,b)=>`==${b.renderChildren(a)}==`,parseMarkdown:(a,b)=>b.applyMark("highlight",b.parseInline(a.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:a=>a.indexOf("=="),tokenize(a,b,c){let d=/^(==)([^=]+)(==)/.exec(a);if(d){let a=d[2].trim(),b=c.inlineTokens(a);return{type:"highlight",raw:d[0],text:a,tokens:b}}}},addCommands(){return{setHighlight:a=>({commands:b})=>b.setMark(this.name,a),toggleHighlight:a=>({commands:b})=>b.toggleMark(this.name,a),unsetHighlight:()=>({commands:a})=>a.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[(0,r.OX)({find:A,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:B,type:this.type})]}}),D=r.CU.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:a=>"super"===a&&null}],renderHTML({HTMLAttributes:a}){return["sup",(0,r.KV)(this.options.HTMLAttributes,a),0]},addCommands(){return{setSuperscript:()=>({commands:a})=>a.setMark(this.name),toggleSuperscript:()=>({commands:a})=>a.toggleMark(this.name),unsetSuperscript:()=>({commands:a})=>a.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),E=r.CU.create({name:"subscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sub"},{style:"vertical-align",getAttrs:a=>"sub"===a&&null}],renderHTML({HTMLAttributes:a}){return["sub",(0,r.KV)(this.options.HTMLAttributes,a),0]},addCommands(){return{setSubscript:()=>({commands:a})=>a.setMark(this.name),toggleSubscript:()=>({commands:a})=>a.toggleMark(this.name),unsetSubscript:()=>({commands:a})=>a.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),F=c(356103).n4,G=c(115962),H=c(29119),I=c(119590);function J(a){let b=a.split(".").pop()?.toLowerCase()??"";return"docx"===b||"doc"===b}function K(a){return a.split(".").pop()?.toLowerCase()==="txt"}function L(a){return a.trim()?a.split("\n").map(a=>`<p>${a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")||"<br>"}</p>`).join(""):"<p></p>"}function M({mode:a,initialHtml:b,filePath:r,onSave:t,onDirty:v,compact:x}){let[y,z]=(0,G.useState)(!1),[A,B]=(0,G.useState)("idle"),[J,K]=(0,G.useState)(!1),L=(0,G.useRef)(null),M=(0,G.useRef)(null),O=r.split("/").pop()??r,P="txt"===a,Q=(0,e.hG)({extensions:[g.A.configure({codeBlock:{HTMLAttributes:{class:"code-block"}}}),q.A,D,E,u,w,C.configure({multicolor:!0}),s.configure({types:["heading","paragraph"]}),h.Ay.configure({inline:!1,allowBase64:!0,HTMLAttributes:{class:"editor-image"}}),i.Ay.configure({openOnClick:!1,autolink:!0,HTMLAttributes:{class:"editor-link",rel:"noopener"}}),j.XI.configure({resizable:!1}),k.A,l.A,m.h,n.A,o.A.configure({nested:!0}),p.A.configure({placeholder:P?"Start typing...":"Start writing your document..."}),F],content:b,immediatelyRender:!1,onUpdate:()=>{K(!0),B("idle"),v?.()}}),R=(0,G.useCallback)(async a=>{let b=new FormData;b.append("file",a);try{let a=await fetch("/api/workspace/upload",{method:"POST",body:b});if(!a.ok)return null;let c=await a.json();return`/api/workspace/assets/${c.path.replace(/^assets\//,"")}`}catch{return null}},[]),U=(0,G.useCallback)(async a=>{if(Q)for(let b of a){let a=await R(b);a&&Q.chain().focus().setImage({src:a,alt:b.name}).run()}},[Q,R]),V=(0,G.useCallback)(async()=>{if(Q&&!y){z(!0),B("idle");try{if(P){let a=Q.getText();if(!(await fetch((0,H.nC)(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:r,content:a})})).ok)throw Error("Save failed")}else{let a=Q.getHTML(),{default:b}=await Promise.all([c.e(22477),c.e(68693)]).then(c.bind(c,168693)),d=await b(a,void 0,{table:{row:{cantSplit:!0}},footer:!0,pageNumber:!0}),e=new FormData;if(e.append("file",d),e.append("path",r),!(await fetch("/api/workspace/write-binary",{method:"POST",body:e})).ok)throw Error("Save failed")}B("saved"),K(!1),t?.(),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>B("idle"),2e3)}catch{B("error")}finally{z(!1)}}},[Q,r,y,P,t]);if(!Q)return(0,d.jsxs)("div",{className:"animate-pulse space-y-3 py-4 px-6",children:[(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"80%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"60%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"70%"}})]});let W=Q.storage.characterCount?.words()??0,X=Q.storage.characterCount?.characters()??0;return(0,d.jsxs)("div",{className:`rich-doc-editor ${x?"rich-doc-editor--compact":""}`,children:[(0,d.jsxs)("div",{className:"rich-doc-topbar",children:[(0,d.jsxs)("div",{className:"rich-doc-topbar-left",children:[(0,d.jsx)(aj,{mode:a}),(0,d.jsx)("span",{className:"rich-doc-filename",children:O}),J&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-unsaved",children:"Unsaved changes"}),"saved"===A&&!J&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-saved",children:"Saved"}),"error"===A&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-error",children:"Save failed"})]}),(0,d.jsxs)("div",{className:"rich-doc-topbar-right",children:[(0,d.jsxs)("span",{className:"editor-save-hint",children:["undefined"!=typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","+S"]}),(0,d.jsx)("button",{type:"button",onClick:()=>void V(),disabled:y||!J,className:"editor-save-button",children:y?"Saving...":"Save"})]})]}),!P&&(0,d.jsx)(N,{editor:Q,onUploadImages:U,imageInputRef:M}),P&&!x&&(0,d.jsxs)("div",{className:"editor-toolbar rich-doc-toolbar-minimal",children:[(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:!1,onClick:()=>Q.chain().focus().undo().run(),title:"Undo",disabled:!Q.can().undo(),children:(0,d.jsx)(S,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>Q.chain().focus().redo().run(),title:"Redo",disabled:!Q.can().redo(),children:(0,d.jsx)(T,{})})]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("span",{className:"rich-doc-txt-hint",children:"Plain text — formatting not preserved on save"})]}),!P&&(0,d.jsx)(f.m,{editor:Q,children:(0,d.jsxs)("div",{className:"bubble-menu",children:[(0,d.jsx)(I.zM,{active:Q.isActive("bold"),onClick:()=>Q.chain().focus().toggleBold().run(),title:"Bold",children:(0,d.jsx)("strong",{children:"B"})}),(0,d.jsx)(I.zM,{active:Q.isActive("italic"),onClick:()=>Q.chain().focus().toggleItalic().run(),title:"Italic",children:(0,d.jsx)("em",{children:"I"})}),(0,d.jsx)(I.zM,{active:Q.isActive("underline"),onClick:()=>Q.chain().focus().toggleUnderline().run(),title:"Underline",children:(0,d.jsx)("span",{style:{textDecoration:"underline"},children:"U"})}),(0,d.jsx)(I.zM,{active:Q.isActive("strike"),onClick:()=>Q.chain().focus().toggleStrike().run(),title:"Strikethrough",children:(0,d.jsx)("s",{children:"S"})}),(0,d.jsx)(I.zM,{active:Q.isActive("code"),onClick:()=>Q.chain().focus().toggleCode().run(),title:"Inline code",children:"<>"}),(0,d.jsx)(I.zM,{active:Q.isActive("link"),onClick:()=>{if(Q.isActive("link"))Q.chain().focus().unsetLink().run();else{let a=window.prompt("URL:");a&&Q.chain().focus().setLink({href:a}).run()}},title:"Link",children:(0,d.jsx)(ad,{size:14})})]})}),(0,d.jsx)("div",{className:"rich-doc-scroll",children:(0,d.jsx)("div",{className:`rich-doc-page ${P?"rich-doc-page--txt":""}`,children:(0,d.jsx)(e.$Z,{editor:Q})})}),!x&&(0,d.jsxs)("div",{className:"rich-doc-statusbar",children:[(0,d.jsxs)("span",{children:[W.toLocaleString()," word",1!==W?"s":""]}),(0,d.jsx)("span",{className:"rich-doc-statusbar-sep"}),(0,d.jsxs)("span",{children:[X.toLocaleString()," character",1!==X?"s":""]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("span",{className:"rich-doc-statusbar-mode",children:"docx"===a?"DOCX":"TXT"})]}),(0,d.jsx)("input",{ref:M,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:a=>{let b=Array.from(a.target.files??[]);b.length>0&&U(b),a.target.value=""}})]})}function N({editor:a,onUploadImages:b,imageInputRef:c}){let[e,f]=(0,G.useState)(!1),[g,h]=(0,G.useState)(!1),i=(0,G.useRef)(null),j=(0,G.useRef)(null);return(0,d.jsxs)("div",{className:"editor-toolbar rich-doc-toolbar",children:[(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:!1,onClick:()=>a.chain().focus().undo().run(),title:"Undo",disabled:!a.can().undo(),children:(0,d.jsx)(S,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>a.chain().focus().redo().run(),title:"Redo",disabled:!a.can().redo(),children:(0,d.jsx)(T,{})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsx)(I.$Q,{children:(0,d.jsx)(P,{editor:a})}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive("bold"),onClick:()=>a.chain().focus().toggleBold().run(),title:"Bold (Cmd+B)",children:(0,d.jsx)("strong",{children:"B"})}),(0,d.jsx)(I.IB,{active:a.isActive("italic"),onClick:()=>a.chain().focus().toggleItalic().run(),title:"Italic (Cmd+I)",children:(0,d.jsx)("em",{children:"I"})}),(0,d.jsx)(I.IB,{active:a.isActive("underline"),onClick:()=>a.chain().focus().toggleUnderline().run(),title:"Underline (Cmd+U)",children:(0,d.jsx)("span",{style:{textDecoration:"underline"},children:"U"})}),(0,d.jsx)(I.IB,{active:a.isActive("strike"),onClick:()=>a.chain().focus().toggleStrike().run(),title:"Strikethrough",children:(0,d.jsx)("s",{children:"S"})}),(0,d.jsx)(I.IB,{active:a.isActive("superscript"),onClick:()=>a.chain().focus().toggleSuperscript().run(),title:"Superscript",children:(0,d.jsxs)("span",{children:["X",(0,d.jsx)("sup",{style:{fontSize:"0.6em"},children:"2"})]})}),(0,d.jsx)(I.IB,{active:a.isActive("subscript"),onClick:()=>a.chain().focus().toggleSubscript().run(),title:"Subscript",children:(0,d.jsxs)("span",{children:["X",(0,d.jsx)("sub",{style:{fontSize:"0.6em"},children:"2"})]})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsxs)("div",{className:"relative",ref:i,children:[(0,d.jsx)(I.IB,{active:e,onClick:()=>{f(!e),h(!1)},title:"Text color",children:(0,d.jsx)(ah,{color:a.getAttributes("textStyle").color??"currentColor"})}),e&&(0,d.jsx)(R,{onSelect:b=>{b?a.chain().focus().setColor(b).run():a.chain().focus().unsetColor().run(),f(!1)}})]}),(0,d.jsxs)("div",{className:"relative",ref:j,children:[(0,d.jsx)(I.IB,{active:g,onClick:()=>{h(!g),f(!1)},title:"Highlight color",children:(0,d.jsx)(ai,{})}),g&&(0,d.jsx)(R,{onSelect:b=>{b?a.chain().focus().toggleHighlight({color:b}).run():a.chain().focus().unsetHighlight().run(),h(!1)}})]})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive({textAlign:"left"}),onClick:()=>a.chain().focus().setTextAlign("left").run(),title:"Align left",children:(0,d.jsx)(U,{})}),(0,d.jsx)(I.IB,{active:a.isActive({textAlign:"center"}),onClick:()=>a.chain().focus().setTextAlign("center").run(),title:"Align center",children:(0,d.jsx)(V,{})}),(0,d.jsx)(I.IB,{active:a.isActive({textAlign:"right"}),onClick:()=>a.chain().focus().setTextAlign("right").run(),title:"Align right",children:(0,d.jsx)(W,{})}),(0,d.jsx)(I.IB,{active:a.isActive({textAlign:"justify"}),onClick:()=>a.chain().focus().setTextAlign("justify").run(),title:"Justify",children:(0,d.jsx)(X,{})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive("bulletList"),onClick:()=>a.chain().focus().toggleBulletList().run(),title:"Bullet list",children:(0,d.jsx)(Y,{})}),(0,d.jsx)(I.IB,{active:a.isActive("orderedList"),onClick:()=>a.chain().focus().toggleOrderedList().run(),title:"Ordered list",children:(0,d.jsx)(Z,{})}),(0,d.jsx)(I.IB,{active:a.isActive("taskList"),onClick:()=>a.chain().focus().toggleTaskList().run(),title:"Task list",children:(0,d.jsx)(_,{})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive("blockquote"),onClick:()=>a.chain().focus().toggleBlockquote().run(),title:"Blockquote",children:(0,d.jsx)(aa,{})}),(0,d.jsx)(I.IB,{active:a.isActive("codeBlock"),onClick:()=>a.chain().focus().toggleCodeBlock().run(),title:"Code block",children:(0,d.jsx)(ab,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>a.chain().focus().setHorizontalRule().run(),title:"Horizontal rule",children:(0,d.jsx)(ac,{})})]}),(0,d.jsx)(I.x_,{}),(0,d.jsxs)(I.$Q,{children:[(0,d.jsx)(I.IB,{active:a.isActive("link"),onClick:()=>{if(a.isActive("link"))a.chain().focus().unsetLink().run();else{let b=window.prompt("Link URL:");b&&a.chain().focus().setLink({href:b}).run()}},title:"Insert link",children:(0,d.jsx)(ad,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>{if(b)c.current?.click();else{let b=window.prompt("Image URL:");b&&a.chain().focus().setImage({src:b}).run()}},title:"Insert image",children:(0,d.jsx)(ae,{})}),(0,d.jsx)(I.IB,{active:!1,onClick:()=>a.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),title:"Insert table",children:(0,d.jsx)(af,{})})]})]})}let O=[{label:"Normal text",level:0},{label:"Heading 1",level:1},{label:"Heading 2",level:2},{label:"Heading 3",level:3},{label:"Heading 4",level:4},{label:"Heading 5",level:5},{label:"Heading 6",level:6}];function P({editor:a}){let[b,c]=(0,G.useState)(!1),e=(0,G.useRef)(null),f=O.find(b=>b.level>0&&a.isActive("heading",{level:b.level}))??O[0];return(0,d.jsxs)("div",{className:"relative",ref:e,children:[(0,d.jsxs)("button",{type:"button",className:"rich-doc-style-dropdown",onClick:()=>c(!b),title:"Paragraph style",children:[(0,d.jsx)("span",{children:f.label}),(0,d.jsx)(ag,{})]}),b&&(0,d.jsx)("div",{className:"rich-doc-style-menu",children:O.map(b=>(0,d.jsx)("button",{type:"button",className:`rich-doc-style-option ${b.level===f.level?"rich-doc-style-option--active":""}`,onClick:()=>{0===b.level?a.chain().focus().setParagraph().run():a.chain().focus().toggleHeading({level:b.level}).run(),c(!1)},children:(0,d.jsx)("span",{style:{fontSize:0===b.level?void 0:`${Math.max(.75,1.4-.1*b.level)}rem`,fontWeight:b.level>0?600:400},children:b.label})},b.level))})]})}let Q=[null,"#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc","#dd7e6b","#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#a4c2f4","#9fc5e8","#b4a7d6","#d5a6bd","#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#6fa8dc","#8e7cc3","#c27ba0"];function R({onSelect:a}){return(0,d.jsx)("div",{className:"rich-doc-color-palette",children:Q.map(b=>(0,d.jsx)("button",{type:"button",className:"rich-doc-color-swatch",style:{background:b??"transparent",border:b?"1px solid var(--color-border)":"2px dashed var(--color-border)"},onClick:()=>a(b),title:b??"Remove color",children:!b&&(0,d.jsx)("span",{style:{fontSize:"10px",color:"var(--color-text-muted)"},children:"\xd7"})},b??"none"))})}function S(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 7v6h6"}),(0,d.jsx)("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})]})}function T(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M21 7v6h-6"}),(0,d.jsx)("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3L21 13"})]})}function U(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"17",x2:"3",y1:"10",y2:"10"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"14",y2:"14"}),(0,d.jsx)("line",{x1:"17",x2:"3",y1:"18",y2:"18"})]})}function V(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"18",x2:"6",y1:"10",y2:"10"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"14",y2:"14"}),(0,d.jsx)("line",{x1:"18",x2:"6",y1:"18",y2:"18"})]})}function W(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"21",x2:"7",y1:"10",y2:"10"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"14",y2:"14"}),(0,d.jsx)("line",{x1:"21",x2:"7",y1:"18",y2:"18"})]})}function X(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"21",x2:"3",y1:"10",y2:"10"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"14",y2:"14"}),(0,d.jsx)("line",{x1:"21",x2:"3",y1:"18",y2:"18"})]})}function Y(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"8",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"18",y2:"18"})]})}function Z(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"10",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("path",{d:"M4 6h1v4"}),(0,d.jsx)("path",{d:"M4 10h2"}),(0,d.jsx)("path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"})]})}function _(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"6",height:"6",rx:"1"}),(0,d.jsx)("path",{d:"m3 17 2 2 4-4"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"18",y2:"18"})]})}function aa(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z"}),(0,d.jsx)("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z"})]})}function ab(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]})}function ac(){return(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("line",{x1:"2",x2:"22",y1:"12",y2:"12"})})}function ad({size:a=14}){return(0,d.jsxs)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,d.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}function ae(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,d.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,d.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})}function af(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12 3v18"}),(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M3 9h18"}),(0,d.jsx)("path",{d:"M3 15h18"})]})}function ag(){return(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})}function ah({color:a}){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M4 20h16",stroke:a,strokeWidth:"3"}),(0,d.jsx)("path",{d:"m8.5 3 3.5 11 3.5-11"})]})}function ai(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"m9 11-6 6v3h9l3-3"}),(0,d.jsx)("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})]})}function aj({mode:a}){return"txt"===a?(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-text-muted)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),(0,d.jsx)("path",{d:"M14 2v6h6"}),(0,d.jsx)("line",{x1:"8",x2:"16",y1:"13",y2:"13"}),(0,d.jsx)("line",{x1:"8",x2:"16",y1:"17",y2:"17"}),(0,d.jsx)("line",{x1:"8",x2:"10",y1:"9",y2:"9"})]}):(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#2b579a",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),(0,d.jsx)("path",{d:"M14 2v6h6"}),(0,d.jsx)("line",{x1:"8",x2:"16",y1:"13",y2:"13"}),(0,d.jsx)("line",{x1:"8",x2:"16",y1:"17",y2:"17"}),(0,d.jsx)("line",{x1:"8",x2:"10",y1:"9",y2:"9"})]})}},560382:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>C.default,__next_app__:()=>I,handler:()=>K,pages:()=>H,routeModule:()=>J,tree:()=>G});var d=c(135159),e=c(41752),f=c(295860),g=c(301769),h=c(573615),i=c(443399),j=c(384894),k=c(141651),l=c(405563),m=c(66361),n=c(267149),o=c(6314),p=c(593524),q=c(825877),r=c(200261),s=c(375804),t=c(318041),u=c(226713),v=c(975973),w=c(515422),x=c(388706),y=c(406527),z=c(161953),A=c(366107),B=c(986439),C=c(299207),D=c(933389),E=c(525188),F={};for(let a in D)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(F[a]=()=>D[a]);c.d(b,F);let G=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,803106)),"/home/runner/work/DenchClaw/DenchClaw/apps/web/app/page.tsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,509549)),"/home/runner/work/DenchClaw/DenchClaw/apps/web/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.bind(c,299207)),"/home/runner/work/DenchClaw/DenchClaw/apps/web/app/global-error.tsx"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,811313,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,460172,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,156863,23)),"next/dist/client/components/builtin/unauthorized.js"]}],H=["/home/runner/work/DenchClaw/DenchClaw/apps/web/app/page.tsx"],I={require:c,loadChunk:()=>Promise.resolve()},J=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:G},distDir:".next",relativeProjectDir:""});async function K(a,b,d){var F;let L="/page";"/index"===L&&(L="/");let M=(0,h.getRequestMeta)(a,"postponed"),N=(0,h.getRequestMeta)(a,"minimalMode"),O=await J.prepare(a,b,{srcPage:L,multiZoneDraftMode:!1});if(!O)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:P,query:Q,params:R,parsedUrl:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:_,isDraftMode:aa,resolvedPathname:ab,revalidateOnlyGenerated:ac,routerServerContext:ad,nextConfig:ae,interceptionRoutePatterns:af}=O,ag=S.pathname||"/",ah=(0,r.normalizeAppPath)(L),{isOnDemandRevalidate:ai}=O,aj=J.match(ag,_),ak=!!_.routes[ab],al=!!(aj||ak||_.routes[ah]),am=a.headers["user-agent"]||"",an=(0,u.getBotType)(am),ao=(0,p.isHtmlBotRequest)(a),ap=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],aq=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[t.RSC_HEADER],ar=(0,s.getIsPossibleServerAction)(a),as=(0,m.checkIsAppPPREnabled)(ae.experimental.ppr)&&(null==(F=_.routes[ah]??_.dynamicRoutes[ah])?void 0:F.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?M:void 0,aw=as&&aq&&!ap,ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=!am||(0,p.shouldServeStreamingMetadata)(am,ae.htmlLimitedBots);ao&&as&&(al=!1,ay=!1);let az=!0===J.isDev||!al||"string"==typeof M||aw,aA=ao&&as,aB=null;aa||!al||az||ar||av||aw||(aB=ab);let aC=aB;!aC&&J.isDev&&(aC=ab),J.isDev||aa||!al||!aq||aw||(0,k.d)(a.headers);let aD={...D,tree:G,pages:H,GlobalError:C.default,handler:K,routeModule:J,__next_app__:I};X&&Y&&(0,o.setReferenceManifestsSingleton)({page:L,clientReferenceManifest:Y,serverActionsManifest:X,serverModuleMap:(0,q.createServerModuleMap)({serverActionsManifest:X})});let aE=a.method||"GET",aF=(0,g.getTracer)(),aG=aF.getActiveScopeSpan();try{let f=J.getVaryHeader(ab,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return J.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aF.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aE} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aE} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:Q,params:R,page:ah,sharedContext:{buildId:P},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aD,Component:(0,j.T)(aD),params:R,routeModule:J,page:L,postponed:f,shouldWaitOnAllReady:aA,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||az,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,serverActionsManifest:X,clientReferenceManifest:Y,setIsrStatus:null==ad?void 0:ad.setIsrStatus,dir:c(333873).join(process.cwd(),J.relativeProjectDir),isDraftMode:aa,isRevalidate:al&&!f&&!aw,botType:an,isOnDemandRevalidate:ai,isPossibleServerAction:ar,assetPrefix:ae.assetPrefix,nextConfigOutput:ae.output,crossOrigin:ae.crossOrigin,trailingSlash:ae.trailingSlash,previewProps:_.preview,deploymentId:ae.deploymentId,enableTainting:ae.experimental.taint,htmlLimitedBots:ae.htmlLimitedBots,devtoolSegmentExplorer:ae.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ae.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ae.experimental.cacheLife,basePath:ae.basePath,serverActions:ae.experimental.serverActions,...at?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:at}:{},experimental:{isRoutePPREnabled:as,expireTime:ae.expireTime,staleTimes:ae.experimental.staleTimes,cacheComponents:!!ae.experimental.cacheComponents,clientSegmentCache:!!ae.experimental.clientSegmentCache,clientParamParsing:!!ae.experimental.clientParamParsing,dynamicOnHover:!!ae.experimental.dynamicOnHover,inlineCss:!!ae.experimental.inlineCss,authInterrupts:!!ae.experimental.authInterrupts,clientTraceMetadata:ae.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>J.onRequestError(a,b,d,ad),err:(0,h.getRequestMeta)(a,"invokeError"),dev:J.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[y.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,al&&(null==n?void 0:n.revalidate)===0&&!J.isDev&&!as){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ab}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
|
|
253
253
|
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:v.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},o=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i})=>{let j,k=!1===J.isDev,l=c||b.writableEnded;if(ai&&ac&&!f&&!N)return(null==ad?void 0:ad.render404)?await ad.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(aj&&(j=(0,w.parseFallbackField)(aj.fallback)),j===w.FallbackMode.PRERENDER&&(0,u.isBot)(am)&&(!as||ao)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ai=!0),ai&&(j!==w.FallbackMode.NOT_FOUND||f)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),!N&&j!==w.FallbackMode.BLOCKING_STATIC_RENDER&&aC&&!l&&!aa&&T&&(k||!ak)){let b;if((k||aj)&&j===w.FallbackMode.NOT_FOUND)throw new B.NoFallbackError;if(as&&!aq){let c="string"==typeof(null==aj?void 0:aj.fallback)?aj.fallback:k?ah:null;if(b=await J.handleResponse({cacheKey:c,req:a,nextConfig:ae,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:_,isRoutePPREnabled:as,responseGenerator:async()=>m({span:i,postponed:void 0,fallbackRouteParams:k||au?(0,n.u)(ah):null}),waitUntil:d.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let o=ai||g||!av?void 0:av;if(at&&void 0!==o)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:v.CachedRouteKind.PAGES,html:x.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let p=T&&as&&((0,h.getRequestMeta)(a,"renderFallbackShell")||au)?(0,n.u)(ag):null;return m({span:i,postponed:o,fallbackRouteParams:p})},p=async c=>{var f,g,i,j,k;let l,n=await J.handleResponse({cacheKey:aB,responseGenerator:a=>o({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ai,isRoutePPREnabled:as,req:a,nextConfig:ae,prerenderManifest:_,waitUntil:d.waitUntil});if(aa&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),J.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!n){if(aB)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=n.value)?void 0:f.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=n.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof n.value.postponed;al&&!aw&&(!p||ap)&&(N||b.setHeader("x-nextjs-cache",ai?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),b.setHeader(t.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=n;if(av)l={revalidate:0,expire:void 0};else if(N&&aq&&!ap&&as)l={revalidate:0,expire:void 0};else if(!J.isDev)if(aa)l={revalidate:0,expire:void 0};else if(al){if(n.cacheControl)if("number"==typeof n.cacheControl.revalidate){if(n.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${n.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:n.cacheControl.revalidate,expire:(null==(j=n.cacheControl)?void 0:j.expire)??ae.expireTime}}else l={revalidate:y.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(n.cacheControl=l,"string"==typeof ax&&(null==q?void 0:q.kind)===v.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[y.NEXT_CACHE_TAGS_HEADER];N&&al&&c&&"string"==typeof c&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ax);return void 0!==d?(0,A.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:x.default.fromStatic(d,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl}):(b.statusCode=204,(0,A.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl}))}let r=(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...n,value:{...n.value,kind:"PAGE"}},{url:(0,h.getRequestMeta)(a,"initURL")}))return null;if(p&&av)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(N&&al||delete a[y.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[y.NEXT_CACHE_TAGS_HEADER];if(N&&al&&s&&"string"==typeof s&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,s),!q.status||aq&&as||(b.statusCode=q.status),!N&&q.status&&E.RedirectStatusCode[q.status]&&aq&&(b.statusCode=200),p&&b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"1"),aq&&!aa){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:q.html,cacheControl:aw?{revalidate:0,expire:void 0}:n.cacheControl})}return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:x.default.fromStatic(q.rscData,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl})}let u=q.html;if(!p||N||aq)return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:u,cacheControl:n.cacheControl});if(at)return u.push(new ReadableStream({start(a){a.enqueue(z.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}});let w=new TransformStream;return u.push(w.readable),m({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(w.writable)}).catch(a=>{w.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}})};if(!aG)return await aF.withPropagatedContext(a.headers,()=>aF.trace(i.BaseServerSpan.handleRequest,{spanName:`${aE} ${a.url}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aE,"http.target":a.url}},p));await p(aG)}catch(b){throw b instanceof B.NoFallbackError||await J.onRequestError(a,b,{routerKind:"App Router",routePath:L,routeType:"render",revalidateReason:(0,f.c)({isRevalidate:al,isOnDemandRevalidate:ai})},ad),b}}},565254:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(250367).Hj},565744:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(95253).L2},567008:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.toString=function a(b){if(null==b)return"";if("string"==typeof b)return b;if(Array.isArray(b))return b.map(a).join(",");let c=String(b);return"0"===c&&Object.is(Number(b),-0)?"-0":c}},568443:(a,b,c)=>{"use strict";c.d(b,{d:()=>g,t:()=>i});var d=c(736927),e=c(115962);let f=(0,e.createContext)(()=>{});function g(){return(0,e.useContext)(f)}let h={success:{bg:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.25)",color:"#22c55e",icon:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#22c55e",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})})},error:{bg:"rgba(220, 38, 38, 0.08)",border:"1px solid rgba(220, 38, 38, 0.25)",color:"#dc2626",icon:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#dc2626",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,d.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})},info:{bg:"rgba(59, 130, 246, 0.08)",border:"1px solid rgba(59, 130, 246, 0.2)",color:"#3b82f6",icon:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3b82f6",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,d.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}};function i({children:a}){let[b,c]=(0,e.useState)([]),g=(0,e.useRef)(0),i=(0,e.useRef)(new Map),j=(0,e.useCallback)(a=>{c(b=>b.map(b=>b.id===a?{...b,dismissing:!0}:b)),setTimeout(()=>{c(b=>b.filter(b=>b.id!==a))},200);let b=i.current.get(a);b&&(clearTimeout(b),i.current.delete(a))},[]),k=(0,e.useCallback)((a,b)=>{let d=b?.type??"info",e=b?.duration??("error"===d?6e3:4e3),f=++g.current;c(b=>{let c=[...b,{id:f,message:a,type:d,duration:e}];return c.length>5?c.slice(-5):c});let h=setTimeout(()=>{j(f),i.current.delete(f)},e);i.current.set(f,h)},[j]);return(0,d.jsxs)(f.Provider,{value:k,children:[a,b.length>0&&(0,d.jsx)("div",{className:"fixed bottom-4 right-4 z-[9998] flex flex-col-reverse gap-2 pointer-events-none",style:{maxWidth:380},children:b.map(a=>{let b=h[a.type];return(0,d.jsxs)("div",{className:`pointer-events-auto flex items-start gap-2.5 px-3.5 py-2.5 rounded-lg shadow-lg transition-all duration-200 ${a.dismissing?"opacity-0 translate-x-4":"opacity-100 translate-x-0"}`,style:{background:"var(--color-surface)",border:b.border,backdropFilter:"blur(12px)"},children:[(0,d.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:b.icon}),(0,d.jsx)("p",{className:"text-xs leading-relaxed flex-1 min-w-0 break-words",style:{color:"var(--color-text)"},children:a.message}),(0,d.jsx)("button",{type:"button",onClick:()=>j(a.id),className:"flex-shrink-0 p-0.5 rounded hover:opacity-60 transition-opacity",style:{color:"var(--color-text-muted)"},children:(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,d.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},a.id)})})]})}},569607:(a,b,c)=>{"use strict";c.d(b,{H:()=>g});var d=c(585698),e=c(502714),f=c(845722);function g(a,b){let c,g,p=()=>(0,e.w)(b?.in,NaN),q=b?.additionalDigits??2,r=function(a){let b,c={},d=a.split(h.dateTimeDelimiter);if(d.length>2)return c;if(/:/.test(d[0])?b=d[0]:(c.date=d[0],b=d[1],h.timeZoneDelimiter.test(c.date)&&(c.date=a.split(h.timeZoneDelimiter)[0],b=a.substr(c.date.length,a.length))),b){let a=h.timezone.exec(b);a?(c.time=b.replace(a[1],""),c.timezone=a[1]):c.time=b}return c}(a);if(r.date){let a=function(a,b){let c=RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+b)+"})|(\\d{2}|[+-]\\d{"+(2+b)+"})$)"),d=a.match(c);if(!d)return{year:NaN,restDateString:""};let e=d[1]?parseInt(d[1]):null,f=d[2]?parseInt(d[2]):null;return{year:null===f?e:100*f,restDateString:a.slice((d[1]||d[2]).length)}}(r.date,q);c=function(a,b){var c,d,e,f,g,h,j;if(null===b)return new Date(NaN);let k=a.match(i);if(!k)return new Date(NaN);let m=!!k[4],p=l(k[1]),q=l(k[2])-1,r=l(k[3]),s=l(k[4]),t=l(k[5])-1;if(m){return(c=s,d=t,c>=1&&c<=53&&d>=0&&d<=6)?function(a,b,c){let d=new Date(0);d.setUTCFullYear(a,0,4);let e=d.getUTCDay()||7;return d.setUTCDate(d.getUTCDate()+((b-1)*7+c+1-e)),d}(b,s,t):new Date(NaN)}{let a=new Date(0);return(e=b,f=q,g=r,f>=0&&f<=11&&g>=1&&g<=(n[f]||(o(e)?29:28))&&(h=b,(j=p)>=1&&j<=(o(h)?366:365)))?(a.setUTCFullYear(b,q,Math.max(p,r)),a):new Date(NaN)}}(a.restDateString,a.year)}if(!c||isNaN(+c))return p();let s=+c,t=0;if(r.time&&isNaN(t=function(a){var b,c,e;let f=a.match(j);if(!f)return NaN;let g=m(f[1]),h=m(f[2]),i=m(f[3]);return(b=g,c=h,e=i,24===b?0===c&&0===e:e>=0&&e<60&&c>=0&&c<60&&b>=0&&b<25)?g*d.s0+h*d.Cg+1e3*i:NaN}(r.time)))return p();if(r.timezone){if(isNaN(g=function(a){var b;if("Z"===a)return 0;let c=a.match(k);if(!c)return 0;let e="+"===c[1]?-1:1,f=parseInt(c[2]),g=c[3]&&parseInt(c[3])||0;return(b=g)>=0&&b<=59?e*(f*d.s0+g*d.Cg):NaN}(r.timezone)))return p()}else{let a=new Date(s+t),c=(0,f.a)(0,b?.in);return c.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),c.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),c}return(0,f.a)(s+t+g,b?.in)}let h={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},i=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,j=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,k=/^([+-])(\d{2})(?::?(\d{2}))?$/;function l(a){return a?parseInt(a):1}function m(a){return a&&parseFloat(a.replace(",","."))||0}let n=[31,null,31,30,31,30,31,31,30,31,30,31];function o(a){return a%400==0||a%4==0&&a%100!=0}},576244:(a,b,c)=>{"use strict";c.d(b,{Y:()=>m});var d=c(736927),e=c(115962),f=c(612563),g=c(379924),h=c(18886),i=c(130526);function j(a){return null==a?"":"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):"object"==typeof a?JSON.stringify(a):""}function k({entry:a,fields:b,titleField:c,subtitleField:k,onEntryClick:l}){let m=j(a.entry_id??a.id),n=function(a,b,c){if(c){let b=j(a[c]);if(b)return b}let d=b.find(a=>"text"===a.type&&/name|title/i.test(a.name))??b.find(a=>"text"===a.type);return d?j(a[d.name]):j(a.id)}(a,b,c),o=(0,i.I)(a,b),p=(0,e.useMemo)(()=>{if(k){let b=j(a[k]);if(b)return b}let d=b.find(a=>"text"===a.type&&a.name!==c&&!/name|title/i.test(a.name));return d?j(a[d.name]):void 0},[a,b,c,k]),q=b.find(a=>"enum"===a.type&&a.enum_values?.length),r=q?j(a[q.name]):null,s=q&&r?function(a,b){if(!a||!b.enum_values)return null;let c=b.enum_values.indexOf(a);return{text:a,color:c>=0&&b.enum_colors?.[c]?b.enum_colors[c]:"#94a3b8"}}(r,q):null,t=b.find(a=>"tags"===a.type),u=t?(0,g.k)(a[t.name]):[],v=b.find(a=>"date"===a.type),w=v?j(a[v.name]):null;return(0,d.jsxs)("button",{type:"button",onClick:()=>l?.(m),className:"w-full text-left flex items-center gap-3 px-4 py-3 border-b hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer group",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:s?.color??"var(--color-text-muted)",opacity:.6}}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[o?.faviconUrl&&(0,d.jsx)(h.A,{src:o.faviconUrl,className:"w-4 h-4 rounded-[4px] shrink-0"}),(0,d.jsx)("span",{className:"text-[13px] font-medium truncate group-hover:underline",style:{color:"var(--color-text)"},children:n||"Untitled"})]}),s&&(0,d.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0",style:{backgroundColor:s.color,color:"#fff"},children:s.text}),u.slice(0,3).map(a=>{let b=(0,f.KJ)(a),c="link"===b.kind&&b.href,e="url"===b.linkType&&!!b.faviconUrl;return c?(0,d.jsxs)("a",{href:b.href,target:"url"===b.linkType||"file"===b.linkType?"_blank":void 0,rel:"url"===b.linkType||"file"===b.linkType?"noopener noreferrer":void 0,onClick:a=>a.stopPropagation(),className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0 hover:underline underline-offset-2 max-w-[220px]",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-accent)",border:"1px solid var(--color-border)"},children:[e&&(0,d.jsx)(h.A,{src:b.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:b.text})]},a):(0,d.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-text-muted)",border:"1px solid var(--color-border)"},children:a},a)})]}),p&&(0,d.jsx)("div",{className:"text-[11px] whitespace-pre-line line-clamp-1 mt-0.5",style:{color:"var(--color-text-muted)"},children:p})]}),w&&(0,d.jsx)("span",{className:"text-[11px] flex-shrink-0 tabular-nums",style:{color:"var(--color-text-muted)"},children:w.slice(0,10)})]})}function l(){return(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 gap-2",children:[(0,d.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",style:{color:"var(--color-text-muted)",opacity:.4},children:[(0,d.jsx)("path",{d:"M8 6h13"}),(0,d.jsx)("path",{d:"M8 12h13"}),(0,d.jsx)("path",{d:"M8 18h13"}),(0,d.jsx)("path",{d:"M3 6h.01"}),(0,d.jsx)("path",{d:"M3 12h.01"}),(0,d.jsx)("path",{d:"M3 18h.01"})]}),(0,d.jsx)("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"No entries to display in list view."})]})}function m({objectName:a,fields:b,entries:c,titleField:e,subtitleField:f,members:g,onEntryClick:h}){return 0===c.length?(0,d.jsx)(l,{}):(0,d.jsx)("div",{className:"rounded-lg border overflow-hidden",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:c.map(a=>(0,d.jsx)(k,{entry:a,fields:b,titleField:e,subtitleField:f,onEntryClick:h},j(a.entry_id??a.id)))})}},585004:(a,b,c)=>{"use strict";c.d(b,{N_:()=>aU,Ay:()=>aV});var d=c(720511);let e="numeric",f="ascii",g="alpha",h="asciinumeric",i="alphanumeric",j="domain",k="emoji",l="whitespace";function m(a,b,c){for(let d in b[e]&&(b[h]=!0,b[i]=!0),b[f]&&(b[h]=!0,b[g]=!0),b[h]&&(b[i]=!0),b[g]&&(b[i]=!0),b[i]&&(b[j]=!0),b[k]&&(b[j]=!0),b){let b=(d in c||(c[d]=[]),c[d]);0>b.indexOf(a)&&b.push(a)}}function n(a=null){this.j={},this.jr=[],this.jd=null,this.t=a}n.groups={},n.prototype={accepts(){return!!this.t},go(a){let b=this.j[a];if(b)return b;for(let b=0;b<this.jr.length;b++){let c=this.jr[b][0],d=this.jr[b][1];if(d&&c.test(a))return d}return this.jd},has(a,b=!1){return b?a in this.j:!!this.go(a)},ta(a,b,c,d){for(let e=0;e<a.length;e++)this.tt(a[e],b,c,d)},tr(a,b,c,d){let e;return d=d||n.groups,b&&b.j?e=b:(e=new n(b),c&&d&&m(b,c,d)),this.jr.push([a,e]),e},ts(a,b,c,d){let e=this,f=a.length;if(!f)return e;for(let b=0;b<f-1;b++)e=e.tt(a[b]);return e.tt(a[f-1],b,c,d)},tt(a,b,c,d){if(d=d||n.groups,b&&b.j)return this.j[a]=b,b;let e,f=this.go(a);return f?(Object.assign((e=new n).j,f.j),e.jr.push.apply(e.jr,f.jr),e.jd=f.jd,e.t=f.t):e=new n,b&&(d&&(e.t&&"string"==typeof e.t?m(b,Object.assign(function(a,b){let c={};for(let d in b)b[d].indexOf(a)>=0&&(c[d]=!0);return c}(e.t,d),c),d):c&&m(b,c,d)),e.t=b),this.j[a]=e,e}};let o=(a,b,c,d,e)=>a.ta(b,c,d,e),p=(a,b,c,d,e)=>a.tr(b,c,d,e),q=(a,b,c,d,e)=>a.ts(b,c,d,e),r=(a,b,c,d,e)=>a.tt(b,c,d,e),s="WORD",t="UWORD",u="ASCIINUMERICAL",v="ALPHANUMERICAL",w="LOCALHOST",x="UTLD",y="SCHEME",z="SLASH_SCHEME",A="OPENBRACE",B="CLOSEBRACE",C="OPENBRACKET",D="CLOSEBRACKET",E="OPENPAREN",F="CLOSEPAREN",G="OPENANGLEBRACKET",H="CLOSEANGLEBRACKET",I="FULLWIDTHLEFTPAREN",J="FULLWIDTHRIGHTPAREN",K="LEFTCORNERBRACKET",L="RIGHTCORNERBRACKET",M="LEFTWHITECORNERBRACKET",N="RIGHTWHITECORNERBRACKET",O="FULLWIDTHLESSTHAN",P="FULLWIDTHGREATERTHAN",Q="AMPERSAND",R="APOSTROPHE",S="ASTERISK",T="BACKSLASH",U="BACKTICK",V="CARET",W="COLON",X="COMMA",Y="DOLLAR",Z="EQUALS",_="EXCLAMATION",aa="HYPHEN",ab="PERCENT",ac="PIPE",ad="PLUS",ae="POUND",af="QUERY",ag="QUOTE",ah="FULLWIDTHMIDDLEDOT",ai="SEMI",aj="SLASH",ak="TILDE",al="UNDERSCORE",am="EMOJI";var an=Object.freeze({__proto__:null,ALPHANUMERICAL:v,AMPERSAND:Q,APOSTROPHE:R,ASCIINUMERICAL:u,ASTERISK:S,AT:"AT",BACKSLASH:T,BACKTICK:U,CARET:V,CLOSEANGLEBRACKET:H,CLOSEBRACE:B,CLOSEBRACKET:D,CLOSEPAREN:F,COLON:W,COMMA:X,DOLLAR:Y,DOT:"DOT",EMOJI:am,EQUALS:Z,EXCLAMATION:_,FULLWIDTHGREATERTHAN:P,FULLWIDTHLEFTPAREN:I,FULLWIDTHLESSTHAN:O,FULLWIDTHMIDDLEDOT:ah,FULLWIDTHRIGHTPAREN:J,HYPHEN:aa,LEFTCORNERBRACKET:K,LEFTWHITECORNERBRACKET:M,LOCALHOST:w,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:G,OPENBRACE:A,OPENBRACKET:C,OPENPAREN:E,PERCENT:ab,PIPE:ac,PLUS:ad,POUND:ae,QUERY:af,QUOTE:ag,RIGHTCORNERBRACKET:L,RIGHTWHITECORNERBRACKET:N,SCHEME:y,SEMI:ai,SLASH:aj,SLASH_SCHEME:z,SYM:"SYM",TILDE:ak,TLD:"TLD",UNDERSCORE:al,UTLD:x,UWORD:t,WORD:s,WS:"WS"});let ao=/[a-z]/,ap=/\p{L}/u,aq=/\p{Emoji}/u,ar=/\d/,as=/\s/,at=null,au=null;function av(a,b){let c=function(a){let b=[],c=a.length,d=0;for(;d<c;){let e,f=a.charCodeAt(d),g=f<55296||f>56319||d+1===c||(e=a.charCodeAt(d+1))<56320||e>57343?a[d]:a.slice(d,d+2);b.push(g),d+=g.length}return b}(b.replace(/[A-Z]/g,a=>a.toLowerCase())),d=c.length,e=[],f=0,g=0;for(;g<d;){let h=a,i=null,j=0,k=null,l=-1,m=-1;for(;g<d&&(i=h.go(c[g]));)(h=i).accepts()?(l=0,m=0,k=h):l>=0&&(l+=c[g].length,m++),j+=c[g].length,f+=c[g].length,g++;f-=l,g-=m,j-=l,e.push({t:k.t,v:b.slice(f-j,f),s:f-j,e:f})}return e}function aw(a,b,c,d,e){let f,g=b.length;for(let c=0;c<g-1;c++){let g=b[c];a.j[g]?f=a.j[g]:((f=new n(d)).jr=e.slice(),a.j[g]=f),a=f}return(f=new n(c)).jr=e.slice(),a.j[b[g-1]]=f,f}function ax(a){let b=[],c=[],d=0;for(;d<a.length;){let e=0;for(;"0123456789".indexOf(a[d+e])>=0;)e++;if(e>0){b.push(c.join(""));for(let b=parseInt(a.substring(d,d+e),10);b>0;b--)c.pop();d+=e}else c.push(a[d]),d++}return b}let ay={defaultProtocol:"http",events:null,format:aA,formatHref:aA,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function az(a,b=null){let c=Object.assign({},ay);a&&(c=Object.assign(c,a instanceof az?a.o:a));let d=c.ignoreTags,e=[];for(let a=0;a<d.length;a++)e.push(d[a].toUpperCase());this.o=c,b&&(this.defaultRender=b),this.ignoreTags=e}function aA(a){return a}function aB(a,b){this.t="token",this.v=a,this.tk=b}function aC(a,b){class c extends aB{constructor(b,c){super(b,c),this.t=a}}for(let a in b)c.prototype[a]=b[a];return c.t=a,c}az.prototype={o:ay,ignoreTags:[],defaultRender:a=>a,check(a){return this.get("validate",a.toString(),a)},get(a,b,c){let d=null!=b,e=this.o[a];return e&&("object"==typeof e?"function"==typeof(e=c.t in e?e[c.t]:ay[a])&&d&&(e=e(b,c)):"function"==typeof e&&d&&(e=e(b,c.t,c))),e},getObj(a,b,c){let d=this.o[a];return"function"==typeof d&&null!=b&&(d=d(b,c.t,c)),d},render(a){let b=a.render(this);return(this.get("render",null,a)||this.defaultRender)(b,a.t,a)}},aB.prototype={isLink:!1,toString(){return this.v},toHref(a){return this.toString()},toFormattedString(a){let b=this.toString(),c=a.get("truncate",b,this),d=a.get("format",b,this);return c&&d.length>c?d.substring(0,c)+"…":d},toFormattedHref(a){return a.get("formatHref",this.toHref(a.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(a=ay.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(a),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(a){return{type:this.t,value:this.toFormattedString(a),isLink:this.isLink,href:this.toFormattedHref(a),start:this.startIndex(),end:this.endIndex()}},validate(a){return a.get("validate",this.toString(),this)},render(a){let b=this.toHref(a.get("defaultProtocol")),c=a.get("formatHref",b,this),d=a.get("tagName",b,this),e=this.toFormattedString(a),f={},g=a.get("className",b,this),h=a.get("target",b,this),i=a.get("rel",b,this),j=a.getObj("attributes",b,this),k=a.getObj("events",b,this);return f.href=c,g&&(f.class=g),h&&(f.target=h),i&&(f.rel=i),j&&Object.assign(f,j),{tagName:d,attributes:f,content:e,eventListeners:k}}};let aD=aC("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),aE=aC("text"),aF=aC("nl"),aG=aC("url",{isLink:!0,toHref(a=ay.defaultProtocol){return this.hasProtocol()?this.v:`${a}://${this.v}`},hasProtocol(){let a=this.tk;return a.length>=2&&a[0].t!==w&&a[1].t===W}}),aH=a=>new n(a);function aI(a,b,c){let d=c[0].s,e=c[c.length-1].e;return new a(b.slice(d,e),c)}let aJ="undefined"!=typeof console&&console&&console.warn||(()=>{}),aK={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function aL(a,b=!1){if(aK.initialized&&aJ(`linkifyjs: already initialized - will not register custom scheme "${a}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(a))throw Error(`linkifyjs: incorrect scheme format.
|
|
254
254
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
255
255
|
2. Cannot start or end with "-"
|
|
@@ -261,7 +261,7 @@ see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__
|
|
|
261
261
|
${p}px !important;
|
|
262
262
|
${q}px !important;
|
|
263
263
|
}
|
|
264
|
-
`),()=>{s.contains(r)&&s.removeChild(r)}},[b]),(0,d.jsx)(m,{isPresent:b,childRef:j,sizeRef:n,pop:h,children:!1===h?a:e.cloneElement(a,{ref:p})})}let o=({children:a,initial:b,isPresent:c,onExitComplete:f,custom:h,presenceAffectsLayout:j,mode:k,anchorX:l,anchorY:m,root:o})=>{let q=(0,g.M)(p),r=(0,e.useId)(),s=!0,t=(0,e.useMemo)(()=>(s=!1,{id:r,initial:b,isPresent:c,custom:h,onExitComplete:a=>{for(let b of(q.set(a,!0),q.values()))if(!b)return;f&&f()},register:a=>(q.set(a,!1),()=>q.delete(a))}),[c,q,f]);return j&&s&&(t={...t}),(0,e.useMemo)(()=>{q.forEach((a,b)=>q.set(b,!1))},[c]),e.useEffect(()=>{c||q.size||!f||f()},[c]),a=(0,d.jsx)(n,{pop:"popLayout"===k,isPresent:c,anchorX:l,anchorY:m,root:o,children:a}),(0,d.jsx)(i.t.Provider,{value:t,children:a})};function p(){return new Map}var q=c(15086);let r=a=>a.key||"";function s(a){let b=[];return e.Children.forEach(a,a=>{(0,e.isValidElement)(a)&&b.push(a)}),b}let t=({children:a,custom:b,initial:c=!0,onExitComplete:i,presenceAffectsLayout:j=!0,mode:k="sync",propagate:l=!1,anchorX:m="left",anchorY:n="top",root:p})=>{let[t,u]=(0,q.xQ)(l),v=(0,e.useMemo)(()=>s(a),[a]),w=l&&!t?[]:v.map(r),x=(0,e.useRef)(!0),y=(0,e.useRef)(v),z=(0,g.M)(()=>new Map),A=(0,e.useRef)(new Set),[B,C]=(0,e.useState)(v),[D,E]=(0,e.useState)(v);(0,h.E)(()=>{x.current=!1,y.current=v;for(let a=0;a<D.length;a++){let b=r(D[a]);w.includes(b)?(z.delete(b),A.current.delete(b)):!0!==z.get(b)&&z.set(b,!1)}},[D,w.length,w.join("-")]);let F=[];if(v!==B){let a=[...v];for(let b=0;b<D.length;b++){let c=D[b],d=r(c);w.includes(d)||(a.splice(b,0,c),F.push(c))}return"wait"===k&&F.length&&(a=F),E(s(a)),C(v),null}let{forceRender:G}=(0,e.useContext)(f.L);return(0,d.jsx)(d.Fragment,{children:D.map(a=>{let e=r(a),f=(!l||!!t)&&(v===D||w.includes(e));return(0,d.jsx)(o,{isPresent:f,initial:(!x.current||!!c)&&void 0,custom:b,presenceAffectsLayout:j,mode:k,root:p,onExitComplete:f?void 0:()=>{if(A.current.has(e)||(A.current.add(e),!z.has(e)))return;z.set(e,!0);let a=!0;z.forEach(b=>{b||(a=!1)}),a&&(G?.(),E(y.current),l&&u?.(),i&&i())},anchorX:m,anchorY:n,children:a},e)})})}},656159:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isDeepKey=function(a){switch(typeof a){case"number":case"symbol":return!1;case"string":return a.includes(".")||a.includes("[")||a.includes("]")}}},658422:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(452171),e=c(266196),f=c(606461);b.cloneDeepWith=function(a,b){return d.cloneDeepWith(a,(c,g,h,i)=>{let j=b?.(c,g,h,i);if(void 0!==j)return j;if("object"==typeof a){if(e.getTag(a)===f.objectTag&&"function"!=typeof a.constructor){let b={};return i.set(a,b),d.copyProperties(b,a,h,i),b}switch(Object.prototype.toString.call(a)){case f.numberTag:case f.stringTag:case f.booleanTag:{let b=new a.constructor(a?.valueOf());return d.copyProperties(b,a),b}case f.argumentsTag:{let b={};return d.copyProperties(b,a),b.length=a.length,b[Symbol.iterator]=a[Symbol.iterator],b}default:return}}})}},658556:(a,b,c)=>{"use strict";function d(a,b){let c=String(a);if("string"!=typeof b)throw TypeError("Expected character");let d=0,e=c.indexOf(b);for(;-1!==e;)d++,e=c.indexOf(b,e+b.length);return d}c.d(b,{A:()=>aI});var e=c(972421),f=c(145214),g=c(423721),h=c(348445);let i="phrasing",j=["autolink","link","image","label"];function k(a){this.enter({type:"link",title:null,url:"",children:[]},a)}function l(a){this.config.enter.autolinkProtocol.call(this,a)}function m(a){this.config.exit.autolinkProtocol.call(this,a)}function n(a){this.config.exit.data.call(this,a);let b=this.stack[this.stack.length-1];(0,e.ok)("link"===b.type),b.url="http://"+this.sliceSerialize(a)}function o(a){this.config.exit.autolinkEmail.call(this,a)}function p(a){this.exit(a)}function q(a){!function(a,b,c){let d=(0,h.C)((c||{}).ignore||[]),e=function(a){let b=[];if(!Array.isArray(a))throw TypeError("Expected find and replace tuple or list of tuples");let c=!a[0]||Array.isArray(a[0])?a:[a],d=-1;for(;++d<c.length;){var e;let a=c[d];b.push(["string"==typeof(e=a[0])?RegExp(function(a){if("string"!=typeof a)throw TypeError("Expected a string");return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e,function(a){return"function"==typeof a?a:function(){return a}}(a[1])])}return b}(b),f=-1;for(;++f<e.length;)(0,g.VG)(a,"text",i);function i(a,b){let c,g=-1;for(;++g<b.length;){let a=b[g],e=c?c.children:void 0;if(d(a,e?e.indexOf(a):void 0,c))return;c=a}if(c)return function(a,b){let c=b[b.length-1],d=e[f][0],g=e[f][1],h=0,i=c.children.indexOf(a),j=!1,k=[];d.lastIndex=0;let l=d.exec(a.value);for(;l;){let c=l.index,e={index:l.index,input:l.input,stack:[...b,a]},f=g(...l,e);if("string"==typeof f&&(f=f.length>0?{type:"text",value:f}:void 0),!1===f?d.lastIndex=c+1:(h!==c&&k.push({type:"text",value:a.value.slice(h,c)}),Array.isArray(f)?k.push(...f):f&&k.push(f),h=c+l[0].length,j=!0),!d.global)break;l=d.exec(a.value)}return j?(h<a.value.length&&k.push({type:"text",value:a.value.slice(h)}),c.children.splice(i,1,...k)):k=[a],i+k.length}(a,b)}}(a,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,r],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,s]],{ignore:["link","linkReference"]})}function r(a,b,c,e,f){let g="";if(!t(f)||(/^w/i.test(b)&&(c=b+c,b="",g="http://"),!function(a){let b=a.split(".");return!(b.length<2||b[b.length-1]&&(/_/.test(b[b.length-1])||!/[a-zA-Z\d]/.test(b[b.length-1]))||b[b.length-2]&&(/_/.test(b[b.length-2])||!/[a-zA-Z\d]/.test(b[b.length-2])))}(c)))return!1;let h=function(a){let b=/[!"&'),.:;<>?\]}]+$/.exec(a);if(!b)return[a,void 0];a=a.slice(0,b.index);let c=b[0],e=c.indexOf(")"),f=d(a,"("),g=d(a,")");for(;-1!==e&&f>g;)a+=c.slice(0,e+1),e=(c=c.slice(e+1)).indexOf(")"),g++;return[a,c]}(c+e);if(!h[0])return!1;let i={type:"link",title:null,url:g+b+h[0],children:[{type:"text",value:b+h[0]}]};return h[1]?[i,{type:"text",value:h[1]}]:i}function s(a,b,c,d){return!(!t(d,!0)||/[-\d_]$/.test(c))&&{type:"link",title:null,url:"mailto:"+b+"@"+c,children:[{type:"text",value:b+"@"+c}]}}function t(a,b){let c=a.input.charCodeAt(a.index-1);return(0===a.index||(0,f.Ny)(c)||(0,f.es)(c))&&(!b||47!==c)}var u=c(732347);function v(){this.buffer()}function w(a){this.enter({type:"footnoteReference",identifier:"",label:""},a)}function x(){this.buffer()}function y(a){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},a)}function z(a){let b=this.resume(),c=this.stack[this.stack.length-1];(0,e.ok)("footnoteReference"===c.type),c.identifier=(0,u.B)(this.sliceSerialize(a)).toLowerCase(),c.label=b}function A(a){this.exit(a)}function B(a){let b=this.resume(),c=this.stack[this.stack.length-1];(0,e.ok)("footnoteDefinition"===c.type),c.identifier=(0,u.B)(this.sliceSerialize(a)).toLowerCase(),c.label=b}function C(a){this.exit(a)}function D(a,b,c,d){let e=c.createTracker(d),f=e.move("[^"),g=c.enter("footnoteReference"),h=c.enter("reference");return f+=e.move(c.safe(c.associationId(a),{after:"]",before:f})),h(),g(),f+=e.move("]")}function E(a,b,c){return 0===b?a:F(a,b,c)}function F(a,b,c){return(c?"":" ")+a}D.peek=function(){return"["};let G=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function H(a){this.enter({type:"delete",children:[]},a)}function I(a){this.exit(a)}function J(a,b,c,d){let e=c.createTracker(d),f=c.enter("strikethrough"),g=e.move("~~");return g+=c.containerPhrasing(a,{...e.current(),before:g,after:"~"}),g+=e.move("~~"),f(),g}function K(a){return a.length}function L(a){let b="string"==typeof a?a.codePointAt(0):0;return 67===b||99===b?99:76===b||108===b?108:114*(82===b||114===b)}J.peek=function(){return"~"};var M=c(294401);c(320608);c(210164);function N(a,b,c){let d=a.value||"",e="`",f=-1;for(;RegExp("(^|[^`])"+e+"([^`]|$)").test(d);)e+="`";for(/[^ \r\n]/.test(d)&&(/^[ \r\n]/.test(d)&&/[ \r\n]$/.test(d)||/^`|`$/.test(d))&&(d=" "+d+" ");++f<c.unsafe.length;){let a,b=c.unsafe[f],e=c.compilePattern(b);if(b.atBreak)for(;a=e.exec(d);){let b=a.index;10===d.charCodeAt(b)&&13===d.charCodeAt(b-1)&&b--,d=d.slice(0,b)+" "+d.slice(a.index+1)}}return e+d+e}N.peek=function(){return"`"};(0,h.C)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let O={inlineCode:N,listItem:function(a,b,c,d){let e=function(a){let b=a.options.listItemIndent||"one";if("tab"!==b&&"one"!==b&&"mixed"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return b}(c),f=c.bulletCurrent||function(a){let b=a.options.bullet||"*";if("*"!==b&&"+"!==b&&"-"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.bullet`, expected `*`, `+`, or `-`");return b}(c);b&&"list"===b.type&&b.ordered&&(f=("number"==typeof b.start&&b.start>-1?b.start:1)+(!1===c.options.incrementListMarker?0:b.children.indexOf(a))+f);let g=f.length+1;("tab"===e||"mixed"===e&&(b&&"list"===b.type&&b.spread||a.spread))&&(g=4*Math.ceil(g/4));let h=c.createTracker(d);h.move(f+" ".repeat(g-f.length)),h.shift(g);let i=c.enter("listItem"),j=c.indentLines(c.containerFlow(a,h.current()),function(a,b,c){return b?(c?"":" ".repeat(g))+a:(c?f:f+" ".repeat(g-f.length))+a});return i(),j}};function P(a){let b=a._align;(0,e.ok)(b,"expected `_align` on table"),this.enter({type:"table",align:b.map(function(a){return"none"===a?null:a}),children:[]},a),this.data.inTable=!0}function Q(a){this.exit(a),this.data.inTable=void 0}function R(a){this.enter({type:"tableRow",children:[]},a)}function S(a){this.exit(a)}function T(a){this.enter({type:"tableCell",children:[]},a)}function U(a){let b=this.resume();this.data.inTable&&(b=b.replace(/\\([\\|])/g,V));let c=this.stack[this.stack.length-1];(0,e.ok)("inlineCode"===c.type),c.value=b,this.exit(a)}function V(a,b){return"|"===b?b:a}function W(a){let b=this.stack[this.stack.length-2];(0,e.ok)("listItem"===b.type),b.checked="taskListCheckValueChecked"===a.type}function X(a){let b=this.stack[this.stack.length-2];if(b&&"listItem"===b.type&&"boolean"==typeof b.checked){let a=this.stack[this.stack.length-1];(0,e.ok)("paragraph"===a.type);let c=a.children[0];if(c&&"text"===c.type){let d,e=b.children,f=-1;for(;++f<e.length;){let a=e[f];if("paragraph"===a.type){d=a;break}}d===a&&(c.value=c.value.slice(1),0===c.value.length?a.children.shift():a.position&&c.position&&"number"==typeof c.position.start.offset&&(c.position.start.column++,c.position.start.offset++,a.position.start=Object.assign({},c.position.start)))}}this.exit(a)}function Y(a,b,c,d){let e=a.children[0],f="boolean"==typeof a.checked&&e&&"paragraph"===e.type,g="["+(a.checked?"x":" ")+"] ",h=c.createTracker(d);f&&h.move(g);let i=O.listItem(a,b,c,{...d,...h.current()});return f&&(i=i.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(a){return a+g})),i}var Z=c(161693);let _={tokenize:function(a,b,c){let d=0;return function b(f){return(87===f||119===f)&&d<3?(d++,a.consume(f),b):46===f&&3===d?(a.consume(f),e):c(f)};function e(a){return null===a?c(a):b(a)}},partial:!0},aa={tokenize:function(a,b,c){let d,e,g;return h;function h(b){return 46===b||95===b?a.check(ac,j,i)(b):null===b||(0,f.Ee)(b)||(0,f.Ny)(b)||45!==b&&(0,f.es)(b)?j(b):(g=!0,a.consume(b),h)}function i(b){return 95===b?d=!0:(e=d,d=void 0),a.consume(b),h}function j(a){return e||d||!g?c(a):b(a)}},partial:!0},ab={tokenize:function(a,b){let c=0,d=0;return e;function e(h){return 40===h?(c++,a.consume(h),e):41===h&&d<c?g(h):33===h||34===h||38===h||39===h||41===h||42===h||44===h||46===h||58===h||59===h||60===h||63===h||93===h||95===h||126===h?a.check(ac,b,g)(h):null===h||(0,f.Ee)(h)||(0,f.Ny)(h)?b(h):(a.consume(h),e)}function g(b){return 41===b&&d++,a.consume(b),e}},partial:!0},ac={tokenize:function(a,b,c){return d;function d(h){return 33===h||34===h||39===h||41===h||42===h||44===h||46===h||58===h||59===h||63===h||95===h||126===h?(a.consume(h),d):38===h?(a.consume(h),g):93===h?(a.consume(h),e):60===h||null===h||(0,f.Ee)(h)||(0,f.Ny)(h)?b(h):c(h)}function e(a){return null===a||40===a||91===a||(0,f.Ee)(a)||(0,f.Ny)(a)?b(a):d(a)}function g(b){return(0,f.CW)(b)?function b(e){return 59===e?(a.consume(e),d):(0,f.CW)(e)?(a.consume(e),b):c(e)}(b):c(b)}},partial:!0},ad={tokenize:function(a,b,c){return function(b){return a.consume(b),d};function d(a){return(0,f.lV)(a)?c(a):b(a)}},partial:!0},ae={name:"wwwAutolink",tokenize:function(a,b,c){let d=this;return function(b){return 87!==b&&119!==b||!aj.call(d,d.previous)||an(d.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkWww"),a.check(_,a.attempt(aa,a.attempt(ab,e),c),c)(b))};function e(c){return a.exit("literalAutolinkWww"),a.exit("literalAutolink"),b(c)}},previous:aj},af={name:"protocolAutolink",tokenize:function(a,b,c){let d=this,e="",g=!1;return function(b){return(72===b||104===b)&&ak.call(d,d.previous)&&!an(d.events)?(a.enter("literalAutolink"),a.enter("literalAutolinkHttp"),e+=String.fromCodePoint(b),a.consume(b),h):c(b)};function h(b){if((0,f.CW)(b)&&e.length<5)return e+=String.fromCodePoint(b),a.consume(b),h;if(58===b){let c=e.toLowerCase();if("http"===c||"https"===c)return a.consume(b),i}return c(b)}function i(b){return 47===b?(a.consume(b),g)?j:(g=!0,i):c(b)}function j(b){return null===b||(0,f.JQ)(b)||(0,f.Ee)(b)||(0,f.Ny)(b)||(0,f.es)(b)?c(b):a.attempt(aa,a.attempt(ab,k),c)(b)}function k(c){return a.exit("literalAutolinkHttp"),a.exit("literalAutolink"),b(c)}},previous:ak},ag={name:"emailAutolink",tokenize:function(a,b,c){let d,e,g=this;return function(b){return!am(b)||!al.call(g,g.previous)||an(g.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkEmail"),function b(d){return am(d)?(a.consume(d),b):64===d?(a.consume(d),h):c(d)}(b))};function h(b){return 46===b?a.check(ad,j,i)(b):45===b||95===b||(0,f.lV)(b)?(e=!0,a.consume(b),h):j(b)}function i(b){return a.consume(b),d=!0,h}function j(h){return e&&d&&(0,f.CW)(g.previous)?(a.exit("literalAutolinkEmail"),a.exit("literalAutolink"),b(h)):c(h)}},previous:al},ah={},ai=48;for(;ai<123;)ah[ai]=ag,58==++ai?ai=65:91===ai&&(ai=97);function aj(a){return null===a||40===a||42===a||95===a||91===a||93===a||126===a||(0,f.Ee)(a)}function ak(a){return!(0,f.CW)(a)}function al(a){return!(47===a||am(a))}function am(a){return 43===a||45===a||46===a||95===a||(0,f.lV)(a)}function an(a){let b=a.length,c=!1;for(;b--;){let d=a[b][1];if(("labelLink"===d.type||"labelImage"===d.type)&&!d._balanced){c=!0;break}if(d._gfmAutolinkLiteralWalkedInto){c=!1;break}}return a.length>0&&!c&&(a[a.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),c}ah[43]=ag,ah[45]=ag,ah[46]=ag,ah[95]=ag,ah[72]=[ag,af],ah[104]=[ag,af],ah[87]=[ag,ae],ah[119]=[ag,ae];var ao=c(360478),ap=c(621405);let aq={tokenize:function(a,b,c){let d=this;return(0,ap.N)(a,function(a){let e=d.events[d.events.length-1];return e&&"gfmFootnoteDefinitionIndent"===e[1].type&&4===e[2].sliceSerialize(e[1],!0).length?b(a):c(a)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function ar(a,b,c){let d,e=this,f=e.events.length,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]);for(;f--;){let a=e.events[f][1];if("labelImage"===a.type){d=a;break}if("gfmFootnoteCall"===a.type||"labelLink"===a.type||"label"===a.type||"image"===a.type||"link"===a.type)break}return function(f){if(!d||!d._balanced)return c(f);let h=(0,u.B)(e.sliceSerialize({start:d.end,end:e.now()}));return 94===h.codePointAt(0)&&g.includes(h.slice(1))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(f),a.exit("gfmFootnoteCallLabelMarker"),b(f)):c(f)}}function as(a,b){let c=a.length;for(;c--;)if("labelImage"===a[c][1].type&&"enter"===a[c][0]){a[c][1];break}a[c+1][1].type="data",a[c+3][1].type="gfmFootnoteCallLabelMarker";let d={type:"gfmFootnoteCall",start:Object.assign({},a[c+3][1].start),end:Object.assign({},a[a.length-1][1].end)},e={type:"gfmFootnoteCallMarker",start:Object.assign({},a[c+3][1].end),end:Object.assign({},a[c+3][1].end)};e.end.column++,e.end.offset++,e.end._bufferIndex++;let f={type:"gfmFootnoteCallString",start:Object.assign({},e.end),end:Object.assign({},a[a.length-1][1].start)},g={type:"chunkString",contentType:"string",start:Object.assign({},f.start),end:Object.assign({},f.end)},h=[a[c+1],a[c+2],["enter",d,b],a[c+3],a[c+4],["enter",e,b],["exit",e,b],["enter",f,b],["enter",g,b],["exit",g,b],["exit",f,b],a[a.length-2],a[a.length-1],["exit",d,b]];return a.splice(c,a.length-c+1,...h),a}function at(a,b,c){let d,e=this,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]),h=0;return function(b){return a.enter("gfmFootnoteCall"),a.enter("gfmFootnoteCallLabelMarker"),a.consume(b),a.exit("gfmFootnoteCallLabelMarker"),i};function i(b){return 94!==b?c(b):(a.enter("gfmFootnoteCallMarker"),a.consume(b),a.exit("gfmFootnoteCallMarker"),a.enter("gfmFootnoteCallString"),a.enter("chunkString").contentType="string",j)}function j(i){if(h>999||93===i&&!d||null===i||91===i||(0,f.Ee)(i))return c(i);if(93===i){a.exit("chunkString");let d=a.exit("gfmFootnoteCallString");return g.includes((0,u.B)(e.sliceSerialize(d)))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(i),a.exit("gfmFootnoteCallLabelMarker"),a.exit("gfmFootnoteCall"),b):c(i)}return(0,f.Ee)(i)||(d=!0),h++,a.consume(i),92===i?k:j}function k(b){return 91===b||92===b||93===b?(a.consume(b),h++,j):j(b)}}function au(a,b,c){let d,e,g=this,h=g.parser.gfmFootnotes||(g.parser.gfmFootnotes=[]),i=0;return function(b){return a.enter("gfmFootnoteDefinition")._container=!0,a.enter("gfmFootnoteDefinitionLabel"),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),j};function j(b){return 94===b?(a.enter("gfmFootnoteDefinitionMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionMarker"),a.enter("gfmFootnoteDefinitionLabelString"),a.enter("chunkString").contentType="string",k):c(b)}function k(b){if(i>999||93===b&&!e||null===b||91===b||(0,f.Ee)(b))return c(b);if(93===b){a.exit("chunkString");let c=a.exit("gfmFootnoteDefinitionLabelString");return d=(0,u.B)(g.sliceSerialize(c)),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),a.exit("gfmFootnoteDefinitionLabel"),m}return(0,f.Ee)(b)||(e=!0),i++,a.consume(b),92===b?l:k}function l(b){return 91===b||92===b||93===b?(a.consume(b),i++,k):k(b)}function m(b){return 58===b?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),h.includes(d)||h.push(d),(0,ap.N)(a,n,"gfmFootnoteDefinitionWhitespace")):c(b)}function n(a){return b(a)}}function av(a,b,c){return a.check(ao.B,b,a.attempt(aq,b,c))}function aw(a){a.exit("gfmFootnoteDefinition")}var ax=c(962349),ay=c(598525);class az{constructor(){this.map=[]}add(a,b,c){!function(a,b,c,d){let e=0;if(0!==c||0!==d.length){for(;e<a.map.length;){if(a.map[e][0]===b){a.map[e][1]+=c,a.map[e][2].push(...d);return}e+=1}a.map.push([b,c,d])}}(this,a,b,c)}consume(a){if(this.map.sort(function(a,b){return a[0]-b[0]}),0===this.map.length)return;let b=this.map.length,c=[];for(;b>0;)b-=1,c.push(a.slice(this.map[b][0]+this.map[b][1]),this.map[b][2]),a.length=this.map[b][0];c.push(a.slice()),a.length=0;let d=c.pop();for(;d;){for(let b of d)a.push(b);d=c.pop()}this.map.length=0}}function aA(a,b,c){let d,e=this,g=0,h=0;return function(a){let b=e.events.length-1;for(;b>-1;){let a=e.events[b][1].type;if("lineEnding"===a||"linePrefix"===a)b--;else break}let d=b>-1?e.events[b][1].type:null,f="tableHead"===d||"tableRow"===d?t:i;return f===t&&e.parser.lazy[e.now().line]?c(a):f(a)};function i(b){var c;return a.enter("tableHead"),a.enter("tableRow"),124===(c=b)||(d=!0,h+=1),j(c)}function j(b){return null===b?c(b):(0,f.HP)(b)?h>1?(h=0,e.interrupt=!0,a.exit("tableRow"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),m):c(b):(0,f.On)(b)?(0,ap.N)(a,j,"whitespace")(b):(h+=1,d&&(d=!1,g+=1),124===b)?(a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),d=!0,j):(a.enter("data"),k(b))}function k(b){return null===b||124===b||(0,f.Ee)(b)?(a.exit("data"),j(b)):(a.consume(b),92===b?l:k)}function l(b){return 92===b||124===b?(a.consume(b),k):k(b)}function m(b){return(e.interrupt=!1,e.parser.lazy[e.now().line])?c(b):(a.enter("tableDelimiterRow"),d=!1,(0,f.On)(b))?(0,ap.N)(a,n,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):n(b)}function n(b){return 45===b||58===b?p(b):124===b?(d=!0,a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),o):c(b)}function o(b){return(0,f.On)(b)?(0,ap.N)(a,p,"whitespace")(b):p(b)}function p(b){return 58===b?(h+=1,d=!0,a.enter("tableDelimiterMarker"),a.consume(b),a.exit("tableDelimiterMarker"),q):45===b?(h+=1,q(b)):null===b||(0,f.HP)(b)?s(b):c(b)}function q(b){return 45===b?(a.enter("tableDelimiterFiller"),function b(c){return 45===c?(a.consume(c),b):58===c?(d=!0,a.exit("tableDelimiterFiller"),a.enter("tableDelimiterMarker"),a.consume(c),a.exit("tableDelimiterMarker"),r):(a.exit("tableDelimiterFiller"),r(c))}(b)):c(b)}function r(b){return(0,f.On)(b)?(0,ap.N)(a,s,"whitespace")(b):s(b)}function s(e){if(124===e)return n(e);if(null===e||(0,f.HP)(e))return d&&g===h?(a.exit("tableDelimiterRow"),a.exit("tableHead"),b(e)):c(e);return c(e)}function t(b){return a.enter("tableRow"),u(b)}function u(c){return 124===c?(a.enter("tableCellDivider"),a.consume(c),a.exit("tableCellDivider"),u):null===c||(0,f.HP)(c)?(a.exit("tableRow"),b(c)):(0,f.On)(c)?(0,ap.N)(a,u,"whitespace")(c):(a.enter("data"),v(c))}function v(b){return null===b||124===b||(0,f.Ee)(b)?(a.exit("data"),u(b)):(a.consume(b),92===b?w:v)}function w(b){return 92===b||124===b?(a.consume(b),v):v(b)}}function aB(a,b){let c,d,e,f=-1,g=!0,h=0,i=[0,0,0,0],j=[0,0,0,0],k=!1,l=0,m=new az;for(;++f<a.length;){let n=a[f],o=n[1];"enter"===n[0]?"tableHead"===o.type?(k=!1,0!==l&&(aD(m,b,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",c,b]])):"tableRow"===o.type||"tableDelimiterRow"===o.type?(g=!0,e=void 0,i=[0,0,0,0],j=[0,f+1,0,0],k&&(k=!1,d={type:"tableBody",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",d,b]])),h="tableDelimiterRow"===o.type?2:d?3:1):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)?(g=!1,0===j[2]&&(0!==i[1]&&(j[0]=j[1],e=aC(m,b,i,h,void 0,e),i=[0,0,0,0]),j[2]=f)):"tableCellDivider"===o.type&&(g?g=!1:(0!==i[1]&&(j[0]=j[1],e=aC(m,b,i,h,void 0,e)),j=[(i=j)[1],f,0,0])):"tableHead"===o.type?(k=!0,l=f):"tableRow"===o.type||"tableDelimiterRow"===o.type?(l=f,0!==i[1]?(j[0]=j[1],e=aC(m,b,i,h,f,e)):0!==j[1]&&(e=aC(m,b,j,h,f,e)),h=0):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)&&(j[3]=f)}for(0!==l&&aD(m,b,l,c,d),m.consume(b.events),f=-1;++f<b.events.length;){let a=b.events[f];"enter"===a[0]&&"table"===a[1].type&&(a[1]._align=function(a,b){let c=!1,d=[];for(;b<a.length;){let e=a[b];if(c){if("enter"===e[0])"tableContent"===e[1].type&&d.push("tableDelimiterMarker"===a[b+1][1].type?"left":"none");else if("tableContent"===e[1].type){if("tableDelimiterMarker"===a[b-1][1].type){let a=d.length-1;d[a]="left"===d[a]?"center":"right"}}else if("tableDelimiterRow"===e[1].type)break}else"enter"===e[0]&&"tableDelimiterRow"===e[1].type&&(c=!0);b+=1}return d}(b.events,f))}return a}function aC(a,b,c,d,e,f){0!==c[0]&&(f.end=Object.assign({},aE(b.events,c[0])),a.add(c[0],0,[["exit",f,b]]));let g=aE(b.events,c[1]);if(f={type:1===d?"tableHeader":2===d?"tableDelimiter":"tableData",start:Object.assign({},g),end:Object.assign({},g)},a.add(c[1],0,[["enter",f,b]]),0!==c[2]){let e=aE(b.events,c[2]),f=aE(b.events,c[3]),g={type:"tableContent",start:Object.assign({},e),end:Object.assign({},f)};if(a.add(c[2],0,[["enter",g,b]]),2!==d){let d=b.events[c[2]],e=b.events[c[3]];if(d[1].end=Object.assign({},e[1].end),d[1].type="chunkText",d[1].contentType="text",c[3]>c[2]+1){let b=c[2]+1,d=c[3]-c[2]-1;a.add(b,d,[])}}a.add(c[3]+1,0,[["exit",g,b]])}return void 0!==e&&(f.end=Object.assign({},aE(b.events,e)),a.add(e,0,[["exit",f,b]]),f=void 0),f}function aD(a,b,c,d,e){let f=[],g=aE(b.events,c);e&&(e.end=Object.assign({},g),f.push(["exit",e,b])),d.end=Object.assign({},g),f.push(["exit",d,b]),a.add(c+1,0,f)}function aE(a,b){let c=a[b],d="enter"===c[0]?"start":"end";return c[1][d]}let aF={name:"tasklistCheck",tokenize:function(a,b,c){let d=this;return function(b){return null===d.previous&&d._gfmTasklistFirstContentOfListItem?(a.enter("taskListCheck"),a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),e):c(b)};function e(b){return(0,f.Ee)(b)?(a.enter("taskListCheckValueUnchecked"),a.consume(b),a.exit("taskListCheckValueUnchecked"),g):88===b||120===b?(a.enter("taskListCheckValueChecked"),a.consume(b),a.exit("taskListCheckValueChecked"),g):c(b)}function g(b){return 93===b?(a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),a.exit("taskListCheck"),h):c(b)}function h(d){return(0,f.HP)(d)?b(d):(0,f.On)(d)?a.check({tokenize:aG},b,c)(d):c(d)}}};function aG(a,b,c){return(0,ap.N)(a,function(a){return null===a?c(a):b(a)},"whitespace")}let aH={};function aI(a){let b,c=a||aH,d=this.data(),e=d.micromarkExtensions||(d.micromarkExtensions=[]),f=d.fromMarkdownExtensions||(d.fromMarkdownExtensions=[]),g=d.toMarkdownExtensions||(d.toMarkdownExtensions=[]);e.push((0,Z.y)([{text:ah},{document:{91:{name:"gfmFootnoteDefinition",tokenize:au,continuation:{tokenize:av},exit:aw}},text:{91:{name:"gfmFootnoteCall",tokenize:at},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ar,resolveTo:as}}},function(a){let b=(a||{}).singleTilde,c={name:"strikethrough",tokenize:function(a,c,d){let e=this.previous,f=this.events,g=0;return function(h){return 126===e&&"characterEscape"!==f[f.length-1][1].type?d(h):(a.enter("strikethroughSequenceTemporary"),function f(h){let i=(0,M.S)(e);if(126===h)return g>1?d(h):(a.consume(h),g++,f);if(g<2&&!b)return d(h);let j=a.exit("strikethroughSequenceTemporary"),k=(0,M.S)(h);return j._open=!k||2===k&&!!i,j._close=!i||2===i&&!!k,c(h)}(h))}},resolveAll:function(a,b){let c=-1;for(;++c<a.length;)if("enter"===a[c][0]&&"strikethroughSequenceTemporary"===a[c][1].type&&a[c][1]._close){let d=c;for(;d--;)if("exit"===a[d][0]&&"strikethroughSequenceTemporary"===a[d][1].type&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset==a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";let e={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},g=[["enter",e,b],["enter",a[d][1],b],["exit",a[d][1],b],["enter",f,b]],h=b.parser.constructs.insideSpan.null;h&&(0,ax.m)(g,g.length,0,(0,ay.W)(h,a.slice(d+1,c),b)),(0,ax.m)(g,g.length,0,[["exit",f,b],["enter",a[c][1],b],["exit",a[c][1],b],["exit",e,b]]),(0,ax.m)(a,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<a.length;)"strikethroughSequenceTemporary"===a[c][1].type&&(a[c][1].type="data");return a}};return null==b&&(b=!0),{text:{126:c},insideSpan:{null:[c]},attentionMarkers:{null:[126]}}}(c),{flow:{null:{name:"table",tokenize:aA,resolveAll:aB}}},{text:{91:aF}}])),f.push([{transforms:[q],enter:{literalAutolink:k,literalAutolinkEmail:l,literalAutolinkHttp:l,literalAutolinkWww:l},exit:{literalAutolink:p,literalAutolinkEmail:o,literalAutolinkHttp:m,literalAutolinkWww:n}},{enter:{gfmFootnoteCallString:v,gfmFootnoteCall:w,gfmFootnoteDefinitionLabelString:x,gfmFootnoteDefinition:y},exit:{gfmFootnoteCallString:z,gfmFootnoteCall:A,gfmFootnoteDefinitionLabelString:B,gfmFootnoteDefinition:C}},{canContainEols:["delete"],enter:{strikethrough:H},exit:{strikethrough:I}},{enter:{table:P,tableData:T,tableHeader:T,tableRow:R},exit:{codeText:U,table:Q,tableData:S,tableHeader:S,tableRow:S}},{exit:{taskListCheckValueChecked:W,taskListCheckValueUnchecked:W,paragraph:X}}]),g.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:i,notInConstruct:j},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:i,notInConstruct:j},{character:":",before:"[ps]",after:"\\/",inConstruct:i,notInConstruct:j}]},(b=!1,c&&c.firstLineBlank&&(b=!0),{handlers:{footnoteDefinition:function(a,c,d,e){let f=d.createTracker(e),g=f.move("[^"),h=d.enter("footnoteDefinition"),i=d.enter("label");return g+=f.move(d.safe(d.associationId(a),{before:g,after:"]"})),i(),g+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),g+=f.move((b?"\n":" ")+d.indentLines(d.containerFlow(a,f.current()),b?F:E))),h(),g},footnoteReference:D},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:G}],handlers:{delete:J}},function(a){let b=a||{},c=b.tableCellPadding,d=b.tablePipeAlign,e=b.stringLength,f=c?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(a,b,c){let d=O.inlineCode(a,b,c);return c.stack.includes("tableCell")&&(d=d.replace(/\|/g,"\\$&")),d},table:function(a,b,c,d){return h(function(a,b,c){let d=a.children,e=-1,f=[],g=b.enter("table");for(;++e<d.length;)f[e]=i(d[e],b,c);return g(),f}(a,c,d),a.align)},tableCell:g,tableRow:function(a,b,c,d){let e=h([i(a,c,d)]);return e.slice(0,e.indexOf("\n"))}}};function g(a,b,c,d){let e=c.enter("tableCell"),g=c.enter("phrasing"),h=c.containerPhrasing(a,{...d,before:f,after:f});return g(),e(),h}function h(a,b){return function(a,b){let c=b||{},d=(c.align||[]).concat(),e=c.stringLength||K,f=[],g=[],h=[],i=[],j=0,k=-1;for(;++k<a.length;){let b=[],d=[],f=-1;for(a[k].length>j&&(j=a[k].length);++f<a[k].length;){var l;let g=null==(l=a[k][f])?"":String(l);if(!1!==c.alignDelimiters){let a=e(g);d[f]=a,(void 0===i[f]||a>i[f])&&(i[f]=a)}b.push(g)}g[k]=b,h[k]=d}let m=-1;if("object"==typeof d&&"length"in d)for(;++m<j;)f[m]=L(d[m]);else{let a=L(d);for(;++m<j;)f[m]=a}m=-1;let n=[],o=[];for(;++m<j;){let a=f[m],b="",d="";99===a?(b=":",d=":"):108===a?b=":":114===a&&(d=":");let e=!1===c.alignDelimiters?1:Math.max(1,i[m]-b.length-d.length),g=b+"-".repeat(e)+d;!1!==c.alignDelimiters&&((e=b.length+e+d.length)>i[m]&&(i[m]=e),o[m]=e),n[m]=g}g.splice(1,0,n),h.splice(1,0,o),k=-1;let p=[];for(;++k<g.length;){let a=g[k],b=h[k];m=-1;let d=[];for(;++m<j;){let e=a[m]||"",g="",h="";if(!1!==c.alignDelimiters){let a=i[m]-(b[m]||0),c=f[m];114===c?g=" ".repeat(a):99===c?a%2?(g=" ".repeat(a/2+.5),h=" ".repeat(a/2-.5)):h=g=" ".repeat(a/2):h=" ".repeat(a)}!1===c.delimiterStart||m||d.push("|"),!1!==c.padding&&(!1!==c.alignDelimiters||""!==e)&&(!1!==c.delimiterStart||m)&&d.push(" "),!1!==c.alignDelimiters&&d.push(g),d.push(e),!1!==c.alignDelimiters&&d.push(h),!1!==c.padding&&d.push(" "),(!1!==c.delimiterEnd||m!==j-1)&&d.push("|")}p.push(!1===c.delimiterEnd?d.join("").replace(/ +$/,""):d.join(""))}return p.join("\n")}(a,{align:b,alignDelimiters:d,padding:c,stringLength:e})}function i(a,b,c){let d=a.children,e=-1,f=[],h=b.enter("tableRow");for(;++e<d.length;)f[e]=g(d[e],a,b,c);return h(),f}}(c),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Y}}]})}},663033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},665466:(a,b,c)=>{"use strict";c.d(b,{E:()=>i,I:()=>j});var d=c(736927),e=c(115962),f=c(437503),g=c(930439),h=c(535798);function i({event:a,expanded:b,onToggle:c,onOpenPerson:e,onOpenCompany:g}){let i=a.start_at?new Date(a.start_at):null,k=a.end_at?new Date(a.end_at):null,l=i?k?`${o(i)} – ${o(k)}`:o(i):"",m=(a.attendees??[]).slice(0,5),p=(a.attendees?.length??0)-m.length;return(0,d.jsxs)("li",{className:"overflow-hidden",style:{background:b?"var(--color-surface-hover)":"transparent",transition:"background 120ms ease"},children:[(0,d.jsxs)("div",{role:"button",tabIndex:0,"aria-expanded":b,onClick:c,onKeyDown:a=>{a.target===a.currentTarget&&("Enter"===a.key||" "===a.key)&&(a.preventDefault(),c())},className:"group/event w-full flex items-center gap-3 px-3 py-2 text-left cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] transition-colors",onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("div",{className:"text-[12px] tabular-nums shrink-0 whitespace-nowrap",style:{color:"var(--color-text-muted)",width:"11rem"},children:l||(a.start_at?(0,h.wI)(a.start_at):"")}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[(0,d.jsx)("p",{className:"truncate text-[13.5px]",style:{color:"var(--color-text)",fontWeight:500},children:a.title?.trim()||"(no title)"}),a.meeting_type&&(0,d.jsx)("span",{className:"shrink-0 rounded-full px-1.5 py-0 text-[10px] uppercase tracking-[0.06em]",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)",fontWeight:600},children:a.meeting_type})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[m.length>0&&(0,d.jsxs)("div",{className:"flex items-center -space-x-1.5",children:[m.slice(0,4).map(a=>(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),e?.(a.id)},disabled:!e,title:a.name??a.email??void 0,className:"disabled:cursor-default rounded-full",style:{boxShadow:"0 0 0 2px var(--color-background)"},children:(0,d.jsx)(f.X,{src:a.avatar_url,name:a.name,seed:a.email??a.id,size:"sm"})},a.id)),p>0&&(0,d.jsxs)("span",{className:"ml-1 text-[11px] tabular-nums",style:{color:"var(--color-text-muted)"},children:["+",p]})]}),(0,d.jsx)(n,{expanded:b})]})]}),(0,d.jsx)("div",{className:"grid transition-[grid-template-rows] duration-[220ms] ease-out motion-reduce:transition-none",style:{gridTemplateRows:b?"1fr":"0fr"},children:(0,d.jsx)("div",{className:"overflow-hidden",children:b&&(0,d.jsx)(j,{eventId:a.id,fallbackEvent:a,onOpenPerson:e,onOpenCompany:g})})})]})}function j({eventId:a,fallbackEvent:b,onOpenPerson:c,onOpenCompany:f}){var g;let[h,i]=(0,e.useState)(null),[j,n]=(0,e.useState)(!0),[p,q]=(0,e.useState)(null),r=h?.event.start_at??b.start_at?new Date(h?.event.start_at??b.start_at):null,s=h?.event.end_at??b.end_at?new Date(h?.event.end_at??b.end_at):null,t=r?(g=r,new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(g)):null,u=r?s?`${o(r)} – ${o(s)}`:o(r):null,v=r&&s?function(a,b){let c=b.getTime()-a.getTime();if(c<=0)return"";let d=Math.round(c/6e4);if(d>=1440){let a=Math.round(d/1440);return`${a} day${1===a?"":"s"}`}let e=Math.floor(d/60),f=d%60;return 0===e?`${f} min`:0===f?`${e}h`:`${e}h ${f}m`}(r,s):null,w=h?.organizer??null,x=h?.attendees??b.attendees??[],y=h?.companies??[];return(0,d.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-background)"},children:[(t||u||v)&&(0,d.jsx)(k,{label:"When",children:(0,d.jsxs)("div",{className:"text-[13px]",style:{color:"var(--color-text)"},children:[t&&(0,d.jsx)("div",{className:"font-medium",children:t}),(u||v)&&(0,d.jsxs)("div",{className:"mt-0.5",style:{color:"var(--color-text-muted)"},children:[u,u&&v&&" \xb7 ",v]})]})}),w&&(0,d.jsx)(k,{label:"Organizer",children:(0,d.jsx)(l,{person:w,onOpenPerson:c})}),x.length>0&&(0,d.jsx)(k,{label:`Attendees \xb7 ${x.length}`,children:(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:x.map(a=>(0,d.jsx)(l,{person:a,onOpenPerson:c},a.id))})}),y.length>0&&(0,d.jsx)(k,{label:1===y.length?"Company":"Companies",children:(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:y.map(a=>(0,d.jsx)(m,{company:a,onOpenCompany:f},a.id))})}),j&&!h&&(0,d.jsx)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:"Loading meeting details…"}),p&&(0,d.jsxs)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:["Couldn’t load meeting details (",p,"). Showing what we have."]}),!j&&!p&&h&&0===x.length&&!w&&0===y.length&&(0,d.jsx)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:"No additional details for this meeting."})]})}function k({label:a,children:b}){return(0,d.jsxs)("div",{className:"mb-4 last:mb-0",children:[(0,d.jsx)("h4",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:a}),b]})}function l({person:a,onOpenPerson:b}){let c=a.name?.trim()||a.email||"Unknown",e=a.name?.trim()&&a.email?a.email:null;return(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(a.id),disabled:!b,className:"flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors disabled:cursor-default",style:{color:"var(--color-text)"},onMouseEnter:a=>{b&&(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)(f.X,{src:a.avatar_url,name:c,seed:a.email??a.id,size:"sm"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium",style:{color:"var(--color-text)"},children:c}),e&&(0,d.jsx)("p",{className:"truncate text-[11px]",style:{color:"var(--color-text-muted)"},children:e})]})]})}function m({company:a,onOpenCompany:b}){let c=a.name?.trim()||a.domain||"Unknown company";return(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(a.id),disabled:!b,className:"flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors disabled:cursor-default",onMouseEnter:a=>{b&&(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)(g.g,{domain:a.domain,name:a.name,size:"sm"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium",style:{color:"var(--color-text)"},children:c}),a.domain&&a.name&&(0,d.jsx)("p",{className:"truncate text-[11px]",style:{color:"var(--color-text-muted)"},children:a.domain})]})]})}function n({expanded:a}){return(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"motion-reduce:transition-none",style:{color:"var(--color-text-muted)",transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})}function o(a){return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(a)}},669661:(a,b,c)=>{"use strict";c.d(b,{Lz:()=>bR,NZ:()=>br,zF:()=>bu});var d=c(381802),e=c(331480),f=c(731626);let g=function(a){for(var b=0;;b++)if(!(a=a.previousSibling))return b},h=function(a){let b=a.assignedSlot||a.parentNode;return b&&11==b.nodeType?b.host:b},i=null,j=function(a,b,c){let d=i||(i=document.createRange());return d.setEnd(a,null==c?a.nodeValue.length:c),d.setStart(a,b||0),d},k=function(){i=null},l=function(a,b,c,d){return c&&(n(a,b,c,d,-1)||n(a,b,c,d,1))},m=/^(img|br|input|textarea|hr)$/i;function n(a,b,c,d,e){for(var f;;){if(a==c&&b==d)return!0;if(b==(e<0?0:o(a))){let c=a.parentNode;if(!c||1!=c.nodeType||p(a)||m.test(a.nodeName)||"false"==a.contentEditable)return!1;b=g(a)+(e<0?0:1),a=c}else{if(1!=a.nodeType)return!1;let c=a.childNodes[b+(e<0?-1:0)];if(1==c.nodeType&&"false"==c.contentEditable)if(null==(f=c.pmViewDesc)||!f.ignoreForSelection)return!1;else b+=e;else a=c,b=e<0?o(a):0}}}function o(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function p(a){let b;for(let c=a;c&&!(b=c.pmViewDesc);c=c.parentNode);return b&&b.node&&b.node.isBlock&&(b.dom==a||b.contentDOM==a)}let q=function(a){return a.focusNode&&l(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset)};function r(a,b){let c=document.createEvent("Event");return c.initEvent("keydown",!0,!0),c.keyCode=a,c.key=c.code=b,c}let s="undefined"!=typeof navigator?navigator:null,t="undefined"!=typeof document?document:null,u=s&&s.userAgent||"",v=/Edge\/(\d+)/.exec(u),w=/MSIE \d/.exec(u),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(u),y=!!(w||x||v),z=w?document.documentMode:x?+x[1]:v?+v[1]:0,A=!y&&/gecko\/(\d+)/i.test(u);A&&(/Firefox\/(\d+)/.exec(u)||[0,0])[1];let B=!y&&/Chrome\/(\d+)/.exec(u),C=!!B,D=B?+B[1]:0,E=!y&&!!s&&/Apple Computer/.test(s.vendor),F=E&&(/Mobile\/\w+/.test(u)||!!s&&s.maxTouchPoints>2),G=F||!!s&&/Mac/.test(s.platform),H=!!s&&/Win/.test(s.platform),I=/Android \d/.test(u),J=!!t&&"webkitFontSmoothing"in t.documentElement.style,K=J?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function L(a,b){return"number"==typeof a?a:a[b]}function M(a,b,c){let d=a.someProp("scrollThreshold")||0,e=a.someProp("scrollMargin")||5,f=a.dom.ownerDocument;for(let g=c||a.dom;g;){if(1!=g.nodeType){g=h(g);continue}let a=g,c=a==f.body,i=c?function(a){let b=a.defaultView&&a.defaultView.visualViewport;return b?{left:0,right:b.width,top:0,bottom:b.height}:{left:0,right:a.documentElement.clientWidth,top:0,bottom:a.documentElement.clientHeight}}(f):function(a){let b=a.getBoundingClientRect(),c=b.width/a.offsetWidth||1,d=b.height/a.offsetHeight||1;return{left:b.left,right:b.left+a.clientWidth*c,top:b.top,bottom:b.top+a.clientHeight*d}}(a),j=0,k=0;if(b.top<i.top+L(d,"top")?k=-(i.top-b.top+L(e,"top")):b.bottom>i.bottom-L(d,"bottom")&&(k=b.bottom-b.top>i.bottom-i.top?b.top+L(e,"top")-i.top:b.bottom-i.bottom+L(e,"bottom")),b.left<i.left+L(d,"left")?j=-(i.left-b.left+L(e,"left")):b.right>i.right-L(d,"right")&&(j=b.right-i.right+L(e,"right")),j||k)if(c)f.defaultView.scrollBy(j,k);else{let c=a.scrollLeft,d=a.scrollTop;k&&(a.scrollTop+=k),j&&(a.scrollLeft+=j);let e=a.scrollLeft-c,f=a.scrollTop-d;b={left:b.left-e,top:b.top-f,right:b.right-e,bottom:b.bottom-f}}let l=c?"fixed":getComputedStyle(g).position;if(/^(fixed|sticky)$/.test(l))break;g="absolute"==l?g.offsetParent:h(g)}}function N(a){let b=[],c=a.ownerDocument;for(let d=a;d&&(b.push({dom:d,top:d.scrollTop,left:d.scrollLeft}),a!=c);d=h(d));return b}function O(a,b){for(let c=0;c<a.length;c++){let{dom:d,top:e,left:f}=a[c];d.scrollTop!=e+b&&(d.scrollTop=e+b),d.scrollLeft!=f&&(d.scrollLeft=f)}}let P=null;function Q(a,b){return a.left>=b.left-1&&a.left<=b.right+1&&a.top>=b.top-1&&a.top<=b.bottom+1}function R(a){return a.top<a.bottom||a.left<a.right}function S(a,b){let c=a.getClientRects();if(c.length){let a=c[b<0?0:c.length-1];if(R(a))return a}return Array.prototype.find.call(c,R)||a.getBoundingClientRect()}let T=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function U(a,b,c){let{node:d,offset:e,atom:f}=a.docView.domFromPos(b,c<0?-1:1),g=J||A;if(3==d.nodeType)if(g&&(T.test(d.nodeValue)||(c<0?!e:e==d.nodeValue.length))){let a=S(j(d,e,e),c);if(A&&e&&/\s/.test(d.nodeValue[e-1])&&e<d.nodeValue.length){let b=S(j(d,e-1,e-1),-1);if(b.top==a.top){let c=S(j(d,e,e+1),-1);if(c.top!=a.top)return V(c,c.left<b.left)}}return a}else{let a=e,b=e,f=c<0?1:-1;return c<0&&!e?(b++,f=-1):c>=0&&e==d.nodeValue.length?(a--,f=1):c<0?a--:b++,V(S(j(d,a,b),f),f<0)}if(!a.state.doc.resolve(b-(f||0)).parent.inlineContent){if(null==f&&e&&(c<0||e==o(d))){let a=d.childNodes[e-1];if(1==a.nodeType)return W(a.getBoundingClientRect(),!1)}if(null==f&&e<o(d)){let a=d.childNodes[e];if(1==a.nodeType)return W(a.getBoundingClientRect(),!0)}return W(d.getBoundingClientRect(),c>=0)}if(null==f&&e&&(c<0||e==o(d))){let a=d.childNodes[e-1],b=3==a.nodeType?j(a,o(a)-!g):1!=a.nodeType||"BR"==a.nodeName&&a.nextSibling?null:a;if(b)return V(S(b,1),!1)}if(null==f&&e<o(d)){let a=d.childNodes[e];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let b=a?3==a.nodeType?j(a,0,+!g):1==a.nodeType?a:null:null;if(b)return V(S(b,-1),!0)}return V(S(3==d.nodeType?j(d):d,-c),c>=0)}function V(a,b){if(0==a.width)return a;let c=b?a.left:a.right;return{top:a.top,bottom:a.bottom,left:c,right:c}}function W(a,b){if(0==a.height)return a;let c=b?a.top:a.bottom;return{top:c,bottom:c,left:a.left,right:a.right}}function X(a,b,c){let d=a.state,e=a.root.activeElement;d!=b&&a.updateState(b),e!=a.dom&&a.focus();try{return c()}finally{d!=b&&a.updateState(d),e!=a.dom&&e&&e.focus()}}let Y=/[\u0590-\u08ac]/,Z=null,_=null,aa=!1;class ab{constructor(a,b,c,d){this.parent=a,this.children=b,this.dom=c,this.contentDOM=d,this.dirty=0,c.pmViewDesc=this}matchesWidget(a){return!1}matchesMark(a){return!1}matchesNode(a,b,c){return!1}matchesHack(a){return!1}parseRule(){return null}stopEvent(a){return!1}get size(){let a=0;for(let b=0;b<this.children.length;b++)a+=this.children[b].size;return a}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let a=0;a<this.children.length;a++)this.children[a].destroy()}posBeforeChild(a){for(let b=0,c=this.posAtStart;;b++){let d=this.children[b];if(d==a)return c;c+=d.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(a,b,c){let d;if(this.contentDOM&&this.contentDOM.contains(1==a.nodeType?a:a.parentNode))if(c<0){let c,d;if(a==this.contentDOM)c=a.childNodes[b-1];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.previousSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.previousSibling;return c?this.posBeforeChild(d)+d.size:this.posAtStart}else{let c,d;if(a==this.contentDOM)c=a.childNodes[b];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.nextSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.nextSibling;return c?this.posBeforeChild(d):this.posAtEnd}if(a==this.dom&&this.contentDOM)d=b>g(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))d=2&a.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==b)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!1;break}if(b.previousSibling)break}if(null==d&&b==a.childNodes.length)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!0;break}if(b.nextSibling)break}}return(null==d?c>0:d)?this.posAtEnd:this.posAtStart}nearestDesc(a,b=!1){for(let c=!0,d=a;d;d=d.parentNode){let e=this.getDesc(d),f;if(e&&(!b||e.node))if(!c||!(f=e.nodeDOM)||(1==f.nodeType?f.contains(1==a.nodeType?a:a.parentNode):f==a))return e;else c=!1}}getDesc(a){let b=a.pmViewDesc;for(let a=b;a;a=a.parent)if(a==this)return b}posFromDOM(a,b,c){for(let d=a;d;d=d.parentNode){let e=this.getDesc(d);if(e)return e.localPosFromDOM(a,b,c)}return -1}descAt(a){for(let b=0,c=0;b<this.children.length;b++){let d=this.children[b],e=c+d.size;if(c==a&&e!=c){for(;!d.border&&d.children.length;)for(let a=0;a<d.children.length;a++){let b=d.children[a];if(b.size){d=b;break}}return d}if(a<e)return d.descAt(a-c-d.border);c=e}}domFromPos(a,b){if(!this.contentDOM)return{node:this.dom,offset:0,atom:a+1};let c=0,d=0;for(let b=0;c<this.children.length;c++){let e=this.children[c],f=b+e.size;if(f>a||e instanceof ai){d=a-b;break}b=f}if(d)return this.children[c].domFromPos(d-this.children[c].border,b);for(let a;c&&!(a=this.children[c-1]).size&&a instanceof ac&&a.side>=0;c--);if(b<=0){let a,d=!0;for(;(a=c?this.children[c-1]:null)&&a.dom.parentNode!=this.contentDOM;c--,d=!1);return a&&b&&d&&!a.border&&!a.domAtom?a.domFromPos(a.size,b):{node:this.contentDOM,offset:a?g(a.dom)+1:0}}{let a,d=!0;for(;(a=c<this.children.length?this.children[c]:null)&&a.dom.parentNode!=this.contentDOM;c++,d=!1);return a&&d&&!a.border&&!a.domAtom?a.domFromPos(0,b):{node:this.contentDOM,offset:a?g(a.dom):this.contentDOM.childNodes.length}}}parseRange(a,b,c=0){if(0==this.children.length)return{node:this.contentDOM,from:a,to:b,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let d=-1,e=-1;for(let f=c,h=0;;h++){let c=this.children[h],i=f+c.size;if(-1==d&&a<=i){let e=f+c.border;if(a>=e&&b<=i-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(a,b,e);a=f;for(let b=h;b>0;b--){let c=this.children[b-1];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(1)){d=g(c.dom)+1;break}a-=c.size}-1==d&&(d=0)}if(d>-1&&(i>b||h==this.children.length-1)){b=i;for(let a=h+1;a<this.children.length;a++){let c=this.children[a];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(-1)){e=g(c.dom);break}b+=c.size}-1==e&&(e=this.contentDOM.childNodes.length);break}f=i}return{node:this.contentDOM,from:a,to:b,fromOffset:d,toOffset:e}}emptyChildAt(a){if(this.border||!this.contentDOM||!this.children.length)return!1;let b=this.children[a<0?0:this.children.length-1];return 0==b.size||b.emptyChildAt(a)}domAfterPos(a){let{node:b,offset:c}=this.domFromPos(a,0);if(1!=b.nodeType||c==b.childNodes.length)throw RangeError("No node after pos "+a);return b.childNodes[c]}setSelection(a,b,c,d=!1){let e=Math.min(a,b),f=Math.max(a,b);for(let g=0,h=0;g<this.children.length;g++){let i=this.children[g],j=h+i.size;if(e>h&&f<j)return i.setSelection(a-h-i.border,b-h-i.border,c,d);h=j}let h=this.domFromPos(a,a?-1:1),i=b==a?h:this.domFromPos(b,b?-1:1),j=c.root.getSelection(),k=c.domSelectionRange(),m=!1;if((A||E)&&a==b){let{node:a,offset:b}=h;if(3==a.nodeType){if((m=!!(b&&"\n"==a.nodeValue[b-1]))&&b==a.nodeValue.length)for(let b=a,c;b;b=b.parentNode){if(c=b.nextSibling){"BR"==c.nodeName&&(h=i={node:c.parentNode,offset:g(c)+1});break}let a=b.pmViewDesc;if(a&&a.node&&a.node.isBlock)break}}else{let c=a.childNodes[b-1];m=c&&("BR"==c.nodeName||"false"==c.contentEditable)}}if(A&&k.focusNode&&k.focusNode!=i.node&&1==k.focusNode.nodeType){let a=k.focusNode.childNodes[k.focusOffset];a&&"false"==a.contentEditable&&(d=!0)}if(!(d||m&&E)&&l(h.node,h.offset,k.anchorNode,k.anchorOffset)&&l(i.node,i.offset,k.focusNode,k.focusOffset))return;let n=!1;if((j.extend||a==b)&&!(m&&A)){j.collapse(h.node,h.offset);try{a!=b&&j.extend(i.node,i.offset),n=!0}catch(a){}}if(!n){if(a>b){let a=h;h=i,i=a}let c=document.createRange();c.setEnd(i.node,i.offset),c.setStart(h.node,h.offset),j.removeAllRanges(),j.addRange(c)}}ignoreMutation(a){return!this.contentDOM&&"selection"!=a.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(a,b){for(let c=0,d=0;d<this.children.length;d++){let e=this.children[d],f=c+e.size;if(c==f?a<=f&&b>=c:a<f&&b>c){let d=c+e.border,g=f-e.border;if(a>=d&&b<=g){this.dirty=a==c||b==f?2:1,a==d&&b==g&&(e.contentLost||e.dom.parentNode!=this.contentDOM)?e.dirty=3:e.markDirty(a-d,b-d);return}e.dirty=e.dom!=e.contentDOM||e.dom.parentNode!=this.contentDOM||e.children.length?3:2}c=f}this.dirty=2}markParentsDirty(){let a=1;for(let b=this.parent;b;b=b.parent,a++){let c=1==a?2:1;b.dirty<c&&(b.dirty=c)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(a){return!1}}class ac extends ab{constructor(a,b,c,d){let e,f=b.type.toDOM;if("function"==typeof f&&(f=f(c,()=>e?e.parent?e.parent.posBeforeChild(e):void 0:d)),!b.type.spec.raw){if(1!=f.nodeType){let a=document.createElement("span");a.appendChild(f),f=a}f.contentEditable="false",f.classList.add("ProseMirror-widget")}super(a,[],f,null),this.widget=b,this.widget=b,e=this}matchesWidget(a){return 0==this.dirty&&a.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(a){let b=this.widget.spec.stopEvent;return!!b&&b(a)}ignoreMutation(a){return"selection"!=a.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ad extends ab{constructor(a,b,c,d){super(a,[],b,null),this.textDOM=c,this.text=d}get size(){return this.text.length}localPosFromDOM(a,b){return a!=this.textDOM?this.posAtStart+(b?this.size:0):this.posAtStart+b}domFromPos(a){return{node:this.textDOM,offset:a}}ignoreMutation(a){return"characterData"===a.type&&a.target.nodeValue==a.oldValue}}class ae extends ab{constructor(a,b,c,d,e){super(a,[],c,d),this.mark=b,this.spec=e}static create(a,b,c,d){let f=d.nodeViews[b.type.name],g=f&&f(b,d,c);return g&&g.dom||(g=e.ZF.renderSpec(document,b.type.spec.toDOM(b,c),null,b.attrs)),new ae(a,b,g.dom,g.contentDOM||g.dom,g)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(a){return 3!=this.dirty&&this.mark.eq(a)}markDirty(a,b){if(super.markDirty(a,b),0!=this.dirty){let a=this.parent;for(;!a.node;)a=a.parent;a.dirty<this.dirty&&(a.dirty=this.dirty),this.dirty=0}}slice(a,b,c){let d=ae.create(this.parent,this.mark,!0,c),e=this.children,f=this.size;b<f&&(e=at(e,b,f,c)),a>0&&(e=at(e,0,a,c));for(let a=0;a<e.length;a++)e[a].parent=d;return d.children=e,d}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class af extends ab{constructor(a,b,c,d,e,f,g,h,i){super(a,[],e,f),this.node=b,this.outerDeco=c,this.innerDeco=d,this.nodeDOM=g}static create(a,b,c,d,f,g){let h=f.nodeViews[b.type.name],i,j=h&&h(b,f,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:g,c,d),k=j&&j.dom,l=j&&j.contentDOM;if(b.isText)if(k){if(3!=k.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else k=document.createTextNode(b.text);else if(!k){let a=e.ZF.renderSpec(document,b.type.spec.toDOM(b),null,b.attrs);({dom:k,contentDOM:l}=a)}l||b.isText||"BR"==k.nodeName||(k.hasAttribute("contenteditable")||(k.contentEditable="false"),b.type.spec.draggable&&(k.draggable=!0));let m=k;return(k=ao(k,c,b),j)?i=new aj(a,b,c,d,k,l||null,m,j,f,g+1):b.isText?new ah(a,b,c,d,k,m,f):new af(a,b,c,d,k,l||null,m,f,g+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let a={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(a.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let b=this.children.length-1;b>=0;b--){let c=this.children[b];if(this.dom.contains(c.dom.parentNode)){a.contentElement=c.dom.parentNode;break}}a.contentElement||(a.getContent=()=>e.FK.empty)}else a.contentElement=this.contentDOM;else a.getContent=()=>this.node.content;return a}matchesNode(a,b,c){return 0==this.dirty&&a.eq(this.node)&&ap(b,this.outerDeco)&&c.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(a,b){let c=this.node.inlineContent,d=b,f=a.composing?this.localCompositionInfo(a,b):null,g=f&&f.pos>-1?f:null,h=f&&f.pos<0,i=new ar(this,g&&g.node,a);(function(a,b,c,d){let e=b.locals(a),f=0;if(0==e.length){for(let c=0;c<a.childCount;c++){let g=a.child(c);d(g,e,b.forChild(f,g),c),f+=g.nodeSize}return}let g=0,h=[],i=null;for(let j=0;;){let k,l,m,n;for(;g<e.length&&e[g].to==f;){let a=e[g++];a.widget&&(k?(l||(l=[k])).push(a):k=a)}if(k)if(l){l.sort(as);for(let a=0;a<l.length;a++)c(l[a],j,!!i)}else c(k,j,!!i);if(i)n=-1,m=i,i=null;else if(j<a.childCount)n=j,m=a.child(j++);else break;for(let a=0;a<h.length;a++)h[a].to<=f&&h.splice(a--,1);for(;g<e.length&&e[g].from<=f&&e[g].to>f;)h.push(e[g++]);let o=f+m.nodeSize;if(m.isText){let a=o;g<e.length&&e[g].from<a&&(a=e[g].from);for(let b=0;b<h.length;b++)h[b].to<a&&(a=h[b].to);a<o&&(i=m.cut(a-f),m=m.cut(0,a-f),o=a,n=-1)}else for(;g<e.length&&e[g].to<o;)g++;let p=m.isInline&&!m.isLeaf?h.filter(a=>!a.inline):h.slice();d(m,p,b.forChild(f,m),n),f=o}})(this.node,this.innerDeco,(b,f,g)=>{b.spec.marks?i.syncToMarks(b.spec.marks,c,a,f):b.type.side>=0&&!g&&i.syncToMarks(f==this.node.childCount?e.CU.none:this.node.child(f).marks,c,a,f),i.placeWidget(b,a,d)},(b,e,g,j)=>{let k;i.syncToMarks(b.marks,c,a,j),i.findNodeMatch(b,e,g,j)||h&&a.state.selection.from>d&&a.state.selection.to<d+b.nodeSize&&(k=i.findIndexWithChild(f.node))>-1&&i.updateNodeAt(b,e,g,k,a)||i.updateNextNode(b,e,g,a,j,d)||i.addNode(b,e,g,a,d),d+=b.nodeSize}),i.syncToMarks([],c,a,0),this.node.isTextblock&&i.addTextblockHacks(),i.destroyRest(),(i.changed||2==this.dirty)&&(g&&this.protectLocalComposition(a,g),function a(b,c,d){let e=b.firstChild,f=!1;for(let g=0;g<c.length;g++){let h=c[g],i=h.dom;if(i.parentNode==b){for(;i!=e;)e=aq(e),f=!0;e=e.nextSibling}else f=!0,b.insertBefore(i,e);if(h instanceof ae){let c=e?e.previousSibling:b.lastChild;a(h.contentDOM,h.children,d),e=c?c.nextSibling:b.firstChild}}for(;e;)e=aq(e),f=!0;f&&d.trackWrites==b&&(d.trackWrites=null)}(this.contentDOM,this.children,a),F&&function(a){if("UL"==a.nodeName||"OL"==a.nodeName){let b=a.style.cssText;a.style.cssText=b+"; list-style: square !important",window.getComputedStyle(a).listStyle,a.style.cssText=b}}(this.dom))}localCompositionInfo(a,b){let{from:c,to:e}=a.state.selection;if(!(a.state.selection instanceof d.U3)||c<b||e>b+this.node.content.size)return null;let f=a.input.compositionNode;if(!f||!this.dom.contains(f.parentNode))return null;if(!this.node.inlineContent)return{node:f,pos:-1,text:""};{let a=f.nodeValue,d=function(a,b,c,d){for(let e=0,f=0;e<a.childCount&&f<=d;){let g=a.child(e++),h=f;if(f+=g.nodeSize,!g.isText)continue;let i=g.text;for(;e<a.childCount;){let b=a.child(e++);if(f+=b.nodeSize,!b.isText)break;i+=b.text}if(f>=c){if(f>=d&&i.slice(d-b.length-h,d-h)==b)return d-b.length;let a=h<d?i.lastIndexOf(b,d-h-1):-1;if(a>=0&&a+b.length+h>=c)return h+a;if(c==d&&i.length>=d+b.length-h&&i.slice(d-h,d-h+b.length)==b)return d}}return -1}(this.node.content,a,c-b,e-b);return d<0?null:{node:f,pos:d,text:a}}}protectLocalComposition(a,{node:b,pos:c,text:d}){if(this.getDesc(b))return;let e=b;for(;e.parentNode!=this.contentDOM;e=e.parentNode){for(;e.previousSibling;)e.parentNode.removeChild(e.previousSibling);for(;e.nextSibling;)e.parentNode.removeChild(e.nextSibling);e.pmViewDesc&&(e.pmViewDesc=void 0)}let f=new ad(this,e,b,d);a.input.compositionNodes.push(f),this.children=at(this.children,c,c+d.length,a,f)}update(a,b,c,d){return 3!=this.dirty&&!!a.sameMarkup(this.node)&&(this.updateInner(a,b,c,d),!0)}updateInner(a,b,c,d){this.updateOuterDeco(b),this.node=a,this.innerDeco=c,this.contentDOM&&this.updateChildren(d,this.posAtStart),this.dirty=0}updateOuterDeco(a){if(ap(a,this.outerDeco))return;let b=1!=this.nodeDOM.nodeType,c=this.dom;this.dom=an(this.dom,this.nodeDOM,am(this.outerDeco,this.node,b),am(a,this.node,b)),this.dom!=c&&(c.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=a}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ag(a,b,c,d,e){ao(d,b,a);let f=new af(void 0,a,b,c,d,d,d,e,0);return f.contentDOM&&f.updateChildren(e,0),f}class ah extends af{constructor(a,b,c,d,e,f,g){super(a,b,c,d,e,null,f,g,0)}parseRule(){let a=this.nodeDOM.parentNode;for(;a&&a!=this.dom&&!a.pmIsDeco;)a=a.parentNode;return{skip:a||!0}}update(a,b,c,d){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!a.sameMarkup(this.node)&&(this.updateOuterDeco(b),(0!=this.dirty||a.text!=this.node.text)&&a.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=a.text,d.trackWrites==this.nodeDOM&&(d.trackWrites=null)),this.node=a,this.dirty=0,!0)}inParent(){let a=this.parent.contentDOM;for(let b=this.nodeDOM;b;b=b.parentNode)if(b==a)return!0;return!1}domFromPos(a){return{node:this.nodeDOM,offset:a}}localPosFromDOM(a,b,c){return a==this.nodeDOM?this.posAtStart+Math.min(b,this.node.text.length):super.localPosFromDOM(a,b,c)}ignoreMutation(a){return"characterData"!=a.type&&"selection"!=a.type}slice(a,b,c){let d=this.node.cut(a,b),e=document.createTextNode(d.text);return new ah(this.parent,d,this.outerDeco,this.innerDeco,e,e,c)}markDirty(a,b){super.markDirty(a,b),this.dom!=this.nodeDOM&&(0==a||b==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(a){return this.node.text==a}}class ai extends ab{parseRule(){return{ignore:!0}}matchesHack(a){return 0==this.dirty&&this.dom.nodeName==a}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class aj extends af{constructor(a,b,c,d,e,f,g,h,i,j){super(a,b,c,d,e,f,g,i,j),this.spec=h}update(a,b,c,d){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==a.type||this.spec.multiType)){let e=this.spec.update(a,b,c);return e&&this.updateInner(a,b,c,d),e}return(!!this.contentDOM||!!a.isLeaf)&&super.update(a,b,c,d)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(a,b,c,d){this.spec.setSelection?this.spec.setSelection(a,b,c.root):super.setSelection(a,b,c,d)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(a){return!!this.spec.stopEvent&&this.spec.stopEvent(a)}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}}let ak=function(a){a&&(this.nodeName=a)};ak.prototype=Object.create(null);let al=[new ak];function am(a,b,c){if(0==a.length)return al;let d=c?al[0]:new ak,e=[d];for(let f=0;f<a.length;f++){let g=a[f].type.attrs;if(g)for(let a in g.nodeName&&e.push(d=new ak(g.nodeName)),g){let f=g[a];null!=f&&(c&&1==e.length&&e.push(d=new ak(b.isInline?"span":"div")),"class"==a?d.class=(d.class?d.class+" ":"")+f:"style"==a?d.style=(d.style?d.style+";":"")+f:"nodeName"!=a&&(d[a]=f))}}return e}function an(a,b,c,d){if(c==al&&d==al)return b;let e=b;for(let b=0;b<d.length;b++){let f=d[b],g=c[b];if(b){let b;g&&g.nodeName==f.nodeName&&e!=a&&(b=e.parentNode)&&b.nodeName.toLowerCase()==f.nodeName||((b=document.createElement(f.nodeName)).pmIsDeco=!0,b.appendChild(e),g=al[0]),e=b}!function(a,b,c){for(let d in b)"class"==d||"style"==d||"nodeName"==d||d in c||a.removeAttribute(d);for(let d in c)"class"!=d&&"style"!=d&&"nodeName"!=d&&c[d]!=b[d]&&a.setAttribute(d,c[d]);if(b.class!=c.class){let d=b.class?b.class.split(" ").filter(Boolean):[],e=c.class?c.class.split(" ").filter(Boolean):[];for(let b=0;b<d.length;b++)-1==e.indexOf(d[b])&&a.classList.remove(d[b]);for(let b=0;b<e.length;b++)-1==d.indexOf(e[b])&&a.classList.add(e[b]);0==a.classList.length&&a.removeAttribute("class")}if(b.style!=c.style){if(b.style){let c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,d;for(;d=c.exec(b.style);)a.style.removeProperty(d[1])}c.style&&(a.style.cssText+=c.style)}}(e,g||al[0],f)}return e}function ao(a,b,c){return an(a,a,al,am(b,c,1!=a.nodeType))}function ap(a,b){if(a.length!=b.length)return!1;for(let c=0;c<a.length;c++)if(!a[c].type.eq(b[c].type))return!1;return!0}function aq(a){let b=a.nextSibling;return a.parentNode.removeChild(a),b}class ar{constructor(a,b,c){this.lock=b,this.view=c,this.index=0,this.stack=[],this.changed=!1,this.top=a,this.preMatch=function(a,b){let c=b,d=c.children.length,e=a.childCount,f=new Map,g=[];a:for(;e>0;){let h;for(;;)if(d){let a=c.children[d-1];if(a instanceof ae)c=a,d=a.children.length;else{h=a,d--;break}}else if(c==b)break a;else d=c.parent.children.indexOf(c),c=c.parent;let i=h.node;if(i){if(i!=a.child(e-1))break;--e,f.set(h,e),g.push(h)}}return{index:e,matched:f,matches:g.reverse()}}(a.node.content,a)}destroyBetween(a,b){if(a!=b){for(let c=a;c<b;c++)this.top.children[c].destroy();this.top.children.splice(a,b-a),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(a,b,c,d){let e=0,f=this.stack.length>>1,g=Math.min(f,a.length);for(;e<g&&(e==f-1?this.top:this.stack[e+1<<1]).matchesMark(a[e])&&!1!==a[e].type.spec.spanning;)e++;for(;e<f;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),f--;for(;f<a.length;){this.stack.push(this.top,this.index+1);let e=-1,g=this.top.children.length;d<this.preMatch.index&&(g=Math.min(this.index+3,g));for(let b=this.index;b<g;b++){let c=this.top.children[b];if(c.matchesMark(a[f])&&!this.isLocked(c.dom)){e=b;break}}if(e>-1)e>this.index&&(this.changed=!0,this.destroyBetween(this.index,e)),this.top=this.top.children[this.index];else{let d=ae.create(this.top,a[f],b,c);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,f++}}findNodeMatch(a,b,c,d){let e=-1,f;if(d>=this.preMatch.index&&(f=this.preMatch.matches[d-this.preMatch.index]).parent==this.top&&f.matchesNode(a,b,c))e=this.top.children.indexOf(f,this.index);else for(let d=this.index,f=Math.min(this.top.children.length,d+5);d<f;d++){let f=this.top.children[d];if(f.matchesNode(a,b,c)&&!this.preMatch.matched.has(f)){e=d;break}}return!(e<0)&&(this.destroyBetween(this.index,e),this.index++,!0)}updateNodeAt(a,b,c,d,e){let f=this.top.children[d];return 3==f.dirty&&f.dom==f.contentDOM&&(f.dirty=2),!!f.update(a,b,c,e)&&(this.destroyBetween(this.index,d),this.index++,!0)}findIndexWithChild(a){for(;;){let b=a.parentNode;if(!b)return -1;if(b==this.top.contentDOM){let b=a.pmViewDesc;if(b){for(let a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==b)return a}return -1}a=b}}updateNextNode(a,b,c,d,e,f){for(let g=this.index;g<this.top.children.length;g++){let h=this.top.children[g];if(h instanceof af){let i=this.preMatch.matched.get(h);if(null!=i&&i!=e)return!1;let j=h.dom,k,l=this.isLocked(j)&&!(a.isText&&h.node&&h.node.isText&&h.nodeDOM.nodeValue==a.text&&3!=h.dirty&&ap(b,h.outerDeco));if(!l&&h.update(a,b,c,d))return this.destroyBetween(this.index,g),h.dom!=j&&(this.changed=!0),this.index++,!0;if(!l&&(k=this.recreateWrapper(h,a,b,c,d,f)))return this.destroyBetween(this.index,g),this.top.children[this.index]=k,k.contentDOM&&(k.dirty=2,k.updateChildren(d,f+1),k.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(a,b,c,d,e,f){if(a.dirty||b.isAtom||!a.children.length||!a.node.content.eq(b.content)||!ap(c,a.outerDeco)||!d.eq(a.innerDeco))return null;let g=af.create(this.top,b,c,d,e,f);if(g.contentDOM)for(let b of(g.children=a.children,a.children=[],g.children))b.parent=g;return a.destroy(),g}addNode(a,b,c,d,e){let f=af.create(this.top,a,b,c,d,e);f.contentDOM&&f.updateChildren(d,e+1),this.top.children.splice(this.index++,0,f),this.changed=!0}placeWidget(a,b,c){let d=this.index<this.top.children.length?this.top.children[this.index]:null;if(d&&d.matchesWidget(a)&&(a==d.widget||!d.widget.type.toDOM.parentNode))this.index++;else{let d=new ac(this.top,a,b,c);this.top.children.splice(this.index++,0,d),this.changed=!0}}addTextblockHacks(){let a=this.top.children[this.index-1],b=this.top;for(;a instanceof ae;)a=(b=a).children[b.children.length-1];(!a||!(a instanceof ah)||/\n$/.test(a.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(a.node.text))&&((E||C)&&a&&"false"==a.dom.contentEditable&&this.addHackNode("IMG",b),this.addHackNode("BR",this.top))}addHackNode(a,b){if(b==this.top&&this.index<b.children.length&&b.children[this.index].matchesHack(a))this.index++;else{let c=document.createElement(a);"IMG"==a&&(c.className="ProseMirror-separator",c.alt=""),"BR"==a&&(c.className="ProseMirror-trailingBreak");let d=new ai(this.top,[],c,null);b!=this.top?b.children.push(d):b.children.splice(this.index++,0,d),this.changed=!0}}isLocked(a){return this.lock&&(a==this.lock||1==a.nodeType&&a.contains(this.lock.parentNode))}}function as(a,b){return a.type.side-b.type.side}function at(a,b,c,d,e){let f=[];for(let g=0,h=0;g<a.length;g++){let i=a[g],j=h,k=h+=i.size;j>=c||k<=b?f.push(i):(j<b&&f.push(i.slice(0,b-j,d)),e&&(f.push(e),e=void 0),k>c&&f.push(i.slice(c-j,i.size,d)))}return f}function au(a,b=null){let c=a.domSelectionRange(),e=a.state.doc;if(!c.focusNode)return null;let f=a.docView.nearestDesc(c.focusNode),h=f&&0==f.size,i=a.docView.posFromDOM(c.focusNode,c.focusOffset,1);if(i<0)return null;let j=e.resolve(i),k,l;if(q(c)){for(k=i;f&&!f.node;)f=f.parent;let a=f.node;if(f&&a.isAtom&&d.nh.isSelectable(a)&&f.parent&&!(a.isInline&&function(a,b,c){for(let d=0==b,e=b==o(a);d||e;){if(a==c)return!0;let b=g(a);if(!(a=a.parentNode))return!1;d=d&&0==b,e=e&&b==o(a)}}(c.focusNode,c.focusOffset,f.dom))){let a=f.posBefore;l=new d.nh(i==a?j:e.resolve(a))}}else{if(c instanceof a.dom.ownerDocument.defaultView.Selection&&c.rangeCount>1){let b=i,d=i;for(let e=0;e<c.rangeCount;e++){let f=c.getRangeAt(e);b=Math.min(b,a.docView.posFromDOM(f.startContainer,f.startOffset,1)),d=Math.max(d,a.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(b<0)return null;[k,i]=d==a.state.selection.anchor?[d,b]:[b,d],j=e.resolve(i)}else k=a.docView.posFromDOM(c.anchorNode,c.anchorOffset,1);if(k<0)return null}let m=e.resolve(k);if(!l){let c="pointer"==b||a.state.selection.head<j.pos&&!h?1:-1;l=aD(a,m,j,c)}return l}function av(a){return a.editable?a.hasFocus():aF(a)&&document.activeElement&&document.activeElement.contains(a.dom)}function aw(a,b=!1){let c=a.state.selection;if(aB(a,c),av(a)){if(!b&&a.input.mouseDown&&a.input.mouseDown.allowDefault&&C){let b=a.domSelectionRange(),c=a.domObserver.currentSelection;if(b.anchorNode&&c.anchorNode&&l(b.anchorNode,b.anchorOffset,c.anchorNode,c.anchorOffset)){a.input.mouseDown.delayedSelectionSync=!0,a.domObserver.setCurSelection();return}}if(a.domObserver.disconnectSelection(),a.cursorWrapper)!function(a){let b=a.domSelection();if(!b)return;let c=a.cursorWrapper.dom,d="IMG"==c.nodeName;d?b.collapse(c.parentNode,g(c)+1):b.collapse(c,0),!d&&!a.state.selection.visible&&y&&z<=11&&(c.disabled=!0,c.disabled=!1)}(a);else{var e;let f,g,h,i,{anchor:j,head:k}=c,l,m;ax&&!(c instanceof d.U3)&&(c.$from.parent.inlineContent||(l=ay(a,c.from)),c.empty||c.$from.parent.inlineContent||(m=ay(a,c.to))),a.docView.setSelection(j,k,a,b),ax&&(l&&aA(l),m&&aA(m)),c.visible?a.dom.classList.remove("ProseMirror-hideselection"):(a.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((f=(e=a).dom.ownerDocument).removeEventListener("selectionchange",e.input.hideSelectionGuard),h=(g=e.domSelectionRange()).anchorNode,i=g.anchorOffset,f.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(g.anchorNode!=h||g.anchorOffset!=i)&&(f.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!av(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})))}a.domObserver.setCurSelection(),a.domObserver.connectSelection()}}let ax=E||C&&D<63;function ay(a,b){let{node:c,offset:d}=a.docView.domFromPos(b,0),e=d<c.childNodes.length?c.childNodes[d]:null,f=d?c.childNodes[d-1]:null;if(E&&e&&"false"==e.contentEditable)return az(e);if((!e||"false"==e.contentEditable)&&(!f||"false"==f.contentEditable)){if(e)return az(e);else if(f)return az(f)}}function az(a){return a.contentEditable="true",E&&a.draggable&&(a.draggable=!1,a.wasDraggable=!0),a}function aA(a){a.contentEditable="false",a.wasDraggable&&(a.draggable=!0,a.wasDraggable=null)}function aB(a,b){if(b instanceof d.nh){let c=a.docView.descAt(b.from);c!=a.lastSelectedViewDesc&&(aC(a),c&&c.selectNode(),a.lastSelectedViewDesc=c)}else aC(a)}function aC(a){a.lastSelectedViewDesc&&(a.lastSelectedViewDesc.parent&&a.lastSelectedViewDesc.deselectNode(),a.lastSelectedViewDesc=void 0)}function aD(a,b,c,e){return a.someProp("createSelectionBetween",d=>d(a,b,c))||d.U3.between(b,c,e)}function aE(a){return(!a.editable||!!a.hasFocus())&&aF(a)}function aF(a){let b=a.domSelectionRange();if(!b.anchorNode)return!1;try{return a.dom.contains(3==b.anchorNode.nodeType?b.anchorNode.parentNode:b.anchorNode)&&(a.editable||a.dom.contains(3==b.focusNode.nodeType?b.focusNode.parentNode:b.focusNode))}catch(a){return!1}}function aG(a,b){let{$anchor:c,$head:e}=a.selection,f=b>0?c.max(e):c.min(e),g=f.parent.inlineContent?f.depth?a.doc.resolve(b>0?f.after():f.before()):null:f;return g&&d.LN.findFrom(g,b)}function aH(a,b){return a.dispatch(a.state.tr.setSelection(b).scrollIntoView()),!0}function aI(a,b,c){let e=a.state.selection;if(e instanceof d.U3){if(c.indexOf("s")>-1){let{$head:c}=e,f=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter;if(!f||f.isText||!f.isLeaf)return!1;let g=a.state.doc.resolve(c.pos+f.nodeSize*(b<0?-1:1));return aH(a,new d.U3(e.$anchor,g))}else if(!e.empty)return!1;else if(a.endOfTextblock(b>0?"forward":"backward")){let c=aG(a.state,b);return!!c&&c instanceof d.nh&&aH(a,c)}else if(!(G&&c.indexOf("m")>-1)){let c=e.$head,f=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter,g;if(!f||f.isText)return!1;let h=b<0?c.pos-f.nodeSize:c.pos;return!!(f.isAtom||(g=a.docView.descAt(h))&&!g.contentDOM)&&(d.nh.isSelectable(f)?aH(a,new d.nh(b<0?a.state.doc.resolve(c.pos-f.nodeSize):c)):!!J&&aH(a,new d.U3(a.state.doc.resolve(b<0?h:h+f.nodeSize))))}}else{if(e instanceof d.nh&&e.node.isInline)return aH(a,new d.U3(b>0?e.$to:e.$from));let c=aG(a.state,b);return!!c&&aH(a,c)}}function aJ(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function aK(a,b){let c=a.pmViewDesc;return c&&0==c.size&&(b<0||a.nextSibling||"BR"!=a.nodeName)}function aL(a,b){return b<0?function(a){let b=a.domSelectionRange(),c=b.focusNode,d=b.focusOffset;if(!c)return;let e,f,h=!1;for(A&&1==c.nodeType&&d<aJ(c)&&aK(c.childNodes[d],-1)&&(h=!0);;)if(d>0)if(1!=c.nodeType)break;else{let a=c.childNodes[d-1];if(aK(a,-1))e=c,f=--d;else if(3==a.nodeType)d=(c=a).nodeValue.length;else break}else if(aM(c))break;else{let b=c.previousSibling;for(;b&&aK(b,-1);)e=c.parentNode,f=g(b),b=b.previousSibling;if(b)d=aJ(c=b);else{if((c=c.parentNode)==a.dom)break;d=0}}h?aN(a,c,d):e&&aN(a,e,f)}(a):function(a){let b,c,d=a.domSelectionRange(),e=d.focusNode,f=d.focusOffset;if(!e)return;let h=aJ(e);for(;;)if(f<h){if(1!=e.nodeType)break;if(aK(e.childNodes[f],1))b=e,c=++f;else break}else if(aM(e))break;else{let d=e.nextSibling;for(;d&&aK(d,1);)b=d.parentNode,c=g(d)+1,d=d.nextSibling;if(d)f=0,h=aJ(e=d);else{if((e=e.parentNode)==a.dom)break;f=h=0}}b&&aN(a,b,c)}(a)}function aM(a){let b=a.pmViewDesc;return b&&b.node&&b.node.isBlock}function aN(a,b,c){if(3!=b.nodeType){let a,d;(d=function(a,b){for(;a&&b==a.childNodes.length&&!p(a);)b=g(a)+1,a=a.parentNode;for(;a&&b<a.childNodes.length;){let c=a.childNodes[b];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;a=c,b=0}}(b,c))?(b=d,c=0):(a=function(a,b){for(;a&&!b&&!p(a);)b=g(a),a=a.parentNode;for(;a&&b;){let c=a.childNodes[b-1];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;b=(a=c).childNodes.length}}(b,c))&&(b=a,c=a.nodeValue.length)}let d=a.domSelection();if(!d)return;if(q(d)){let a=document.createRange();a.setEnd(b,c),a.setStart(b,c),d.removeAllRanges(),d.addRange(a)}else d.extend&&d.extend(b,c);a.domObserver.setCurSelection();let{state:e}=a;setTimeout(()=>{a.state==e&&aw(a)},50)}function aO(a,b){let c=a.state.doc.resolve(b);if(!(C||H)&&c.parent.inlineContent){let d=a.coordsAtPos(b);if(b>c.start()){let c=a.coordsAtPos(b-1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left<d.left?"ltr":"rtl"}if(b<c.end()){let c=a.coordsAtPos(b+1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left>d.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(a.dom).direction?"rtl":"ltr"}function aP(a,b,c){let e=a.state.selection;if(e instanceof d.U3&&!e.empty||c.indexOf("s")>-1||G&&c.indexOf("m")>-1)return!1;let{$from:f,$to:g}=e;if(!f.parent.inlineContent||a.endOfTextblock(b<0?"up":"down")){let c=aG(a.state,b);if(c&&c instanceof d.nh)return aH(a,c)}if(!f.parent.inlineContent){let c=b<0?f:g,h=e instanceof d.i5?d.LN.near(c,b):d.LN.findFrom(c,b);return!!h&&aH(a,h)}return!1}function aQ(a,b){if(!(a.state.selection instanceof d.U3))return!0;let{$head:c,$anchor:e,empty:f}=a.state.selection;if(!c.sameParent(e))return!0;if(!f)return!1;if(a.endOfTextblock(b>0?"forward":"backward"))return!0;let g=!c.textOffset&&(b<0?c.nodeBefore:c.nodeAfter);if(g&&!g.isText){let d=a.state.tr;return b<0?d.delete(c.pos-g.nodeSize,c.pos):d.delete(c.pos,c.pos+g.nodeSize),a.dispatch(d),!0}return!1}function aR(a,b,c){a.domObserver.stop(),b.contentEditable=c,a.domObserver.start()}function aS(a,b){a.someProp("transformCopied",c=>{b=c(b,a)});let c=[],{content:d,openStart:f,openEnd:g}=b;for(;f>1&&g>1&&1==d.childCount&&1==d.firstChild.childCount;){f--,g--;let a=d.firstChild;c.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),d=a.content}let h=a.someProp("clipboardSerializer")||e.ZF.fromSchema(a.state.schema),i=a$(),j=i.createElement("div");j.appendChild(h.serializeFragment(d,{document:i}));let k=j.firstChild,l,m=0;for(;k&&1==k.nodeType&&(l=aY[k.nodeName.toLowerCase()]);){for(let a=l.length-1;a>=0;a--){let b=i.createElement(l[a]);for(;j.firstChild;)b.appendChild(j.firstChild);j.appendChild(b),m++}k=j.firstChild}return k&&1==k.nodeType&&k.setAttribute("data-pm-slice",`${f} ${g}${m?` -${m}`:""} ${JSON.stringify(c)}`),{dom:j,text:a.someProp("clipboardTextSerializer",c=>c(b,a))||b.content.textBetween(0,b.content.size,"\n\n"),slice:b}}function aT(a,b,c,d,f){let g,h,i=f.parent.type.spec.code;if(!c&&!b)return null;let j=!!b&&(d||i||!c);if(j){if(a.someProp("transformPastedText",c=>{b=c(b,i||d,a)}),i)return h=new e.Ji(e.FK.from(a.state.schema.text(b.replace(/\r\n?/g,"\n"))),0,0),a.someProp("transformPasted",b=>{h=b(h,a,!0)}),h;let c=a.someProp("clipboardTextParser",c=>c(b,f,d,a));if(c)h=c;else{let c=f.marks(),{schema:d}=a.state,h=e.ZF.fromSchema(d);g=document.createElement("div"),b.split(/(?:\r\n?|\n)+/).forEach(a=>{let b=g.appendChild(document.createElement("p"));a&&b.appendChild(h.serializeNode(d.text(a,c)))})}}else a.someProp("transformPastedHTML",b=>{c=b(c,a)}),g=function(a){var b;let c,d=/^(\s*<meta [^>]*>)*/.exec(a);d&&(a=a.slice(d[0].length));let e=a$().createElement("div"),f=/<([a-z][^>\s]+)/i.exec(a),g;if((g=f&&aY[f[1].toLowerCase()])&&(a=g.map(a=>"<"+a+">").join("")+a+g.map(a=>"</"+a+">").reverse().join("")),e.innerHTML=(b=a,(c=window.trustedTypes)?(a_||(a_=c.defaultPolicy||c.createPolicy("ProseMirrorClipboard",{createHTML:a=>a})),a_.createHTML(b)):b),g)for(let a=0;a<g.length;a++)e=e.querySelector(g[a])||e;return e}(c),J&&function(a){let b=a.querySelectorAll(C?"span:not([class]):not([style])":"span.Apple-converted-space");for(let c=0;c<b.length;c++){let d=b[c];1==d.childNodes.length&&"\xa0"==d.textContent&&d.parentNode&&d.parentNode.replaceChild(a.ownerDocument.createTextNode(" "),d)}}(g);let k=g&&g.querySelector("[data-pm-slice]"),l=k&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(k.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let a=+l[3];a>0;a--){let a=g.firstChild;for(;a&&1!=a.nodeType;)a=a.nextSibling;if(!a)break;g=a}if(h||(h=(a.someProp("clipboardParser")||a.someProp("domParser")||e.S4.fromSchema(a.state.schema)).parseSlice(g,{preserveWhitespace:!!(j||l),context:f,ruleFromNode:a=>"BR"!=a.nodeName||a.nextSibling||!a.parentNode||aU.test(a.parentNode.nodeName)?null:{ignore:!0}})),l)h=function(a,b){if(!a.size)return a;let c=a.content.firstChild.type.schema,d;try{d=JSON.parse(b)}catch(b){return a}let{content:f,openStart:g,openEnd:h}=a;for(let a=d.length-2;a>=0;a-=2){let b=c.nodes[d[a]];if(!b||b.hasRequiredAttrs())break;f=e.FK.from(b.create(d[a+1],f)),g++,h++}return new e.Ji(f,g,h)}(aX(h,+l[1],+l[2]),l[4]);else if((h=e.Ji.maxOpen(function(a,b){if(a.childCount<2)return a;for(let c=b.depth;c>=0;c--){let d=b.node(c).contentMatchAt(b.index(c)),f,g=[];if(a.forEach(a=>{if(!g)return;let b=d.findWrapping(a.type),c;if(!b)return g=null;if(c=g.length&&f.length&&function a(b,c,d,f,g){if(g<b.length&&g<c.length&&b[g]==c[g]){let h=a(b,c,d,f.lastChild,g+1);if(h)return f.copy(f.content.replaceChild(f.childCount-1,h));if(f.contentMatchAt(f.childCount).matchType(g==b.length-1?d.type:b[g+1]))return f.copy(f.content.append(e.FK.from(aV(d,b,g+1))))}}(b,f,a,g[g.length-1],0))g[g.length-1]=c;else{g.length&&(g[g.length-1]=function a(b,c){if(0==c)return b;let d=b.content.replaceChild(b.childCount-1,a(b.lastChild,c-1)),f=b.contentMatchAt(b.childCount).fillBefore(e.FK.empty,!0);return b.copy(d.append(f))}(g[g.length-1],f.length));let c=aV(a,b);g.push(c),d=d.matchType(c.type),f=b}}),g)return e.FK.from(g)}return a}(h.content,f),!0)).openStart||h.openEnd){let a=0,b=0;for(let b=h.content.firstChild;a<h.openStart&&!b.type.spec.isolating;a++,b=b.firstChild);for(let a=h.content.lastChild;b<h.openEnd&&!a.type.spec.isolating;b++,a=a.lastChild);h=aX(h,a,b)}return a.someProp("transformPasted",b=>{h=b(h,a,j)}),h}let aU=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function aV(a,b,c=0){for(let d=b.length-1;d>=c;d--)a=b[d].create(null,e.FK.from(a));return a}function aW(a,b,c,d,f,g){let h=b<0?a.firstChild:a.lastChild,i=h.content;return a.childCount>1&&(g=0),f<d-1&&(i=aW(i,b,c,d,f+1,g)),f>=c&&(i=b<0?h.contentMatchAt(0).fillBefore(i,g<=f).append(i):i.append(h.contentMatchAt(h.childCount).fillBefore(e.FK.empty,!0))),a.replaceChild(b<0?0:a.childCount-1,h.copy(i))}function aX(a,b,c){return b<a.openStart&&(a=new e.Ji(aW(a.content,-1,b,a.openStart,0,a.openEnd),b,a.openEnd)),c<a.openEnd&&(a=new e.Ji(aW(a.content,1,c,a.openEnd,0,0),a.openStart,c)),a}let aY={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},aZ=null;function a$(){return aZ||(aZ=document.implementation.createHTMLDocument("title"))}let a_=null,a0={},a1={},a2={touchstart:!0,touchmove:!0};class a3{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function a4(a,b){a.input.lastSelectionOrigin=b,a.input.lastSelectionTime=Date.now()}function a5(a){a.someProp("handleDOMEvents",b=>{for(let c in b)a.input.eventHandlers[c]||a.dom.addEventListener(c,a.input.eventHandlers[c]=b=>a6(a,b))})}function a6(a,b){return a.someProp("handleDOMEvents",c=>{let d=c[b.type];return!!d&&(d(a,b)||b.defaultPrevented)})}function a7(a){return{left:a.clientX,top:a.clientY}}function a8(a,b,c,d,e){if(-1==d)return!1;let f=a.state.doc.resolve(d);for(let d=f.depth+1;d>0;d--)if(a.someProp(b,b=>d>f.depth?b(a,c,f.nodeAfter,f.before(d),e,!0):b(a,c,f.node(d),f.before(d),e,!1)))return!0;return!1}function a9(a,b,c){if(a.focused||a.focus(),a.state.selection.eq(b))return;let d=a.state.tr.setSelection(b);"pointer"==c&&d.setMeta("pointer",!0),a.dispatch(d)}a1.keydown=(a,b)=>{if((a.input.shiftKey=16==b.keyCode||b.shiftKey,!bc(a,b))&&(a.input.lastKeyCode=b.keyCode,a.input.lastKeyCodeTime=Date.now(),!I||!C||13!=b.keyCode))if(229!=b.keyCode&&a.domObserver.forceFlush(),!F||13!=b.keyCode||b.ctrlKey||b.altKey||b.metaKey)a.someProp("handleKeyDown",c=>c(a,b))||function(a,b){let c,d=b.keyCode,e=(c="",b.ctrlKey&&(c+="c"),b.metaKey&&(c+="m"),b.altKey&&(c+="a"),b.shiftKey&&(c+="s"),c);if(8==d||G&&72==d&&"c"==e)return aQ(a,-1)||aL(a,-1);if(46==d&&!b.shiftKey||G&&68==d&&"c"==e)return aQ(a,1)||aL(a,1);if(13==d||27==d)return!0;if(37==d||G&&66==d&&"c"==e){let b=37==d?"ltr"==aO(a,a.state.selection.from)?-1:1:-1;return aI(a,b,e)||aL(a,b)}if(39==d||G&&70==d&&"c"==e){let b=39==d?"ltr"==aO(a,a.state.selection.from)?1:-1:1;return aI(a,b,e)||aL(a,b)}else if(38==d||G&&80==d&&"c"==e)return aP(a,-1,e)||aL(a,-1);else if(40==d||G&&78==d&&"c"==e)return function(a){if(!E||a.state.selection.$head.parentOffset>0)return!1;let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(b&&1==b.nodeType&&0==c&&b.firstChild&&"false"==b.firstChild.contentEditable){let c=b.firstChild;aR(a,c,"true"),setTimeout(()=>aR(a,c,"false"),20)}return!1}(a)||aP(a,1,e)||aL(a,1);else if(e==(G?"m":"c")&&(66==d||73==d||89==d||90==d))return!0;return!1}(a,b)?b.preventDefault():a4(a,"key");else{let b=Date.now();a.input.lastIOSEnter=b,a.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{a.input.lastIOSEnter==b&&(a.someProp("handleKeyDown",b=>b(a,r(13,"Enter"))),a.input.lastIOSEnter=0)},200)}},a1.keyup=(a,b)=>{16==b.keyCode&&(a.input.shiftKey=!1)},a1.keypress=(a,b)=>{if(bc(a,b)||!b.charCode||b.ctrlKey&&!b.altKey||G&&b.metaKey)return;if(a.someProp("handleKeyPress",c=>c(a,b)))return void b.preventDefault();let c=a.state.selection;if(!(c instanceof d.U3)||!c.$from.sameParent(c.$to)){let d=String.fromCharCode(b.charCode),e=()=>a.state.tr.insertText(d).scrollIntoView();/[\r\n]/.test(d)||a.someProp("handleTextInput",b=>b(a,c.$from.pos,c.$to.pos,d,e))||a.dispatch(e()),b.preventDefault()}};let ba=G?"metaKey":"ctrlKey";a0.mousedown=(a,b)=>{a.input.shiftKey=b.shiftKey;let c=bg(a),e=Date.now(),f="singleClick";e-a.input.lastClick.time<500&&function(a,b){let c=b.x-a.clientX,d=b.y-a.clientY;return c*c+d*d<100}(b,a.input.lastClick)&&!b[ba]&&a.input.lastClick.button==b.button&&("singleClick"==a.input.lastClick.type?f="doubleClick":"doubleClick"==a.input.lastClick.type&&(f="tripleClick")),a.input.lastClick={time:e,x:b.clientX,y:b.clientY,type:f,button:b.button};let g=a.posAtCoords(a7(b));g&&("singleClick"==f?(a.input.mouseDown&&a.input.mouseDown.done(),a.input.mouseDown=new bb(a,g,b,!!c)):("doubleClick"==f?function(a,b,c,d){return a8(a,"handleDoubleClickOn",b,c,d)||a.someProp("handleDoubleClick",c=>c(a,b,d))}:function(a,b,c,e){return a8(a,"handleTripleClickOn",b,c,e)||a.someProp("handleTripleClick",c=>c(a,b,e))||function(a,b,c){if(0!=c.button)return!1;let e=a.state.doc;if(-1==b)return!!e.inlineContent&&(a9(a,d.U3.create(e,0,e.content.size),"pointer"),!0);let f=e.resolve(b);for(let b=f.depth+1;b>0;b--){let c=b>f.depth?f.nodeAfter:f.node(b),g=f.before(b);if(c.inlineContent)a9(a,d.U3.create(e,g+1,g+1+c.content.size),"pointer");else{if(!d.nh.isSelectable(c))continue;a9(a,d.nh.create(e,g),"pointer")}return!0}}(a,c,e)})(a,g.pos,g.inside,b)?b.preventDefault():a4(a,"pointer"))};class bb{constructor(a,b,c,e){let f,g;if(this.view=a,this.pos=b,this.event=c,this.flushed=e,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=a.state.doc,this.selectNode=!!c[ba],this.allowDefault=c.shiftKey,b.inside>-1)f=a.state.doc.nodeAt(b.inside),g=b.inside;else{let c=a.state.doc.resolve(b.pos);f=c.parent,g=c.depth?c.before():0}let h=e?null:c.target,i=h?a.docView.nearestDesc(h,!0):null;this.target=i&&1==i.nodeDOM.nodeType?i.nodeDOM:null;let{selection:j}=a.state;(0==c.button&&f.type.spec.draggable&&!1!==f.type.spec.selectable||j instanceof d.nh&&j.from<=g&&j.to>g)&&(this.mightDrag={node:f,pos:g,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&A&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),a.root.addEventListener("mouseup",this.up=this.up.bind(this)),a.root.addEventListener("mousemove",this.move=this.move.bind(this)),a4(a,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>aw(this.view)),this.view.input.mouseDown=null}up(a){if(this.done(),!this.view.dom.contains(a.target))return;let b=this.pos;if(this.view.state.doc!=this.startDoc&&(b=this.view.posAtCoords(a7(a))),this.updateAllowDefault(a),this.allowDefault||!b)a4(this.view,"pointer");else{var c,e,f,g;(c=this.view,e=b.pos,f=b.inside,g=this.selectNode,a8(c,"handleClickOn",e,f,a)||c.someProp("handleClick",b=>b(c,e,a))||(g?function(a,b){if(-1==b)return!1;let c=a.state.selection,e,f;c instanceof d.nh&&(e=c.node);let g=a.state.doc.resolve(b);for(let a=g.depth+1;a>0;a--){let b=a>g.depth?g.nodeAfter:g.node(a);if(d.nh.isSelectable(b)){f=e&&c.$from.depth>0&&a>=c.$from.depth&&g.before(c.$from.depth+1)==c.$from.pos?g.before(c.$from.depth):g.before(a);break}}return null!=f&&(a9(a,d.nh.create(a.state.doc,f),"pointer"),!0)}(c,f):function(a,b){if(-1==b)return!1;let c=a.state.doc.resolve(b),e=c.nodeAfter;return!!(e&&e.isAtom&&d.nh.isSelectable(e))&&(a9(a,new d.nh(c),"pointer"),!0)}(c,f)))?a.preventDefault():0==a.button&&(this.flushed||E&&this.mightDrag&&!this.mightDrag.node.isAtom||C&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(b.pos-this.view.state.selection.from),Math.abs(b.pos-this.view.state.selection.to)))?(a9(this.view,d.LN.near(this.view.state.doc.resolve(b.pos)),"pointer"),a.preventDefault()):a4(this.view,"pointer")}}move(a){this.updateAllowDefault(a),a4(this.view,"pointer"),0==a.buttons&&this.done()}updateAllowDefault(a){!this.allowDefault&&(Math.abs(this.event.x-a.clientX)>4||Math.abs(this.event.y-a.clientY)>4)&&(this.allowDefault=!0)}}function bc(a,b){return!!a.composing||!!(E&&500>Math.abs(b.timeStamp-a.input.compositionEndedAt))&&(a.input.compositionEndedAt=-2e8,!0)}a0.touchstart=a=>{a.input.lastTouch=Date.now(),bg(a),a4(a,"pointer")},a0.touchmove=a=>{a.input.lastTouch=Date.now(),a4(a,"pointer")},a0.contextmenu=a=>bg(a);let bd=I?5e3:-1;function be(a,b){clearTimeout(a.input.composingTimeout),b>-1&&(a.input.composingTimeout=setTimeout(()=>bg(a),b))}function bf(a){let b;for(a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=((b=document.createEvent("Event")).initEvent("event",!0,!0),b.timeStamp));a.input.compositionNodes.length>0;)a.input.compositionNodes.pop().markParentsDirty()}function bg(a,b=!1){if(!I||!(a.domObserver.flushingSoon>=0)){if(a.domObserver.forceFlush(),bf(a),b||a.docView&&a.docView.dirty){let c=au(a),d=a.state.selection;return c&&!c.eq(d)?a.dispatch(a.state.tr.setSelection(c)):(a.markCursor||b)&&!d.$from.node(d.$from.sharedDepth(d.to)).inlineContent?a.dispatch(a.state.tr.deleteSelection()):a.updateState(a.state),!0}return!1}}a1.compositionstart=a1.compositionupdate=a=>{if(!a.composing){a.domObserver.flush();let{state:b}=a,c=b.selection.$to;if(b.selection instanceof d.U3&&(b.storedMarks||!c.textOffset&&c.parentOffset&&c.nodeBefore.marks.some(a=>!1===a.type.spec.inclusive)||C&&H&&function(a){let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(!b||1!=b.nodeType||c>=b.childNodes.length)return!1;let d=b.childNodes[c];return 1==d.nodeType&&"false"==d.contentEditable}(a)))a.markCursor=a.state.storedMarks||c.marks(),bg(a,!0),a.markCursor=null;else if(bg(a,!b.selection.empty),A&&b.selection.empty&&c.parentOffset&&!c.textOffset&&c.nodeBefore.marks.length){let b=a.domSelectionRange();for(let c=b.focusNode,d=b.focusOffset;c&&1==c.nodeType&&0!=d;){let b=d<0?c.lastChild:c.childNodes[d-1];if(!b)break;if(3==b.nodeType){let c=a.domSelection();c&&c.collapse(b,b.nodeValue.length);break}c=b,d=-1}}a.input.composing=!0}be(a,bd)},a1.compositionend=(a,b)=>{a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=b.timeStamp,a.input.compositionPendingChanges=a.domObserver.pendingRecords().length?a.input.compositionID:0,a.input.compositionNode=null,a.input.badSafariComposition?a.domObserver.forceFlush():a.input.compositionPendingChanges&&Promise.resolve().then(()=>a.domObserver.flush()),a.input.compositionID++,be(a,20))};let bh=y&&z<15||F&&K<604;function bi(a,b,c,d,f){let g=aT(a,b,c,d,a.state.selection.$from);if(a.someProp("handlePaste",b=>b(a,f,g||e.Ji.empty)))return!0;if(!g)return!1;let h=0==g.openStart&&0==g.openEnd&&1==g.content.childCount?g.content.firstChild:null,i=h?a.state.tr.replaceSelectionWith(h,d):a.state.tr.replaceSelection(g);return a.dispatch(i.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bj(a){let b=a.getData("text/plain")||a.getData("Text");if(b)return b;let c=a.getData("text/uri-list");return c?c.replace(/\r?\n/g," "):""}a0.copy=a1.cut=(a,b)=>{let c=a.state.selection,d="cut"==b.type;if(c.empty)return;let e=bh?null:b.clipboardData,{dom:f,text:g}=aS(a,c.content());e?(b.preventDefault(),e.clearData(),e.setData("text/html",f.innerHTML),e.setData("text/plain",g)):function(a,b){if(!a.dom.parentNode)return;let c=a.dom.parentNode.appendChild(document.createElement("div"));c.appendChild(b),c.style.cssText="position: fixed; left: -10000px; top: 10px";let d=getSelection(),e=document.createRange();e.selectNodeContents(b),a.dom.blur(),d.removeAllRanges(),d.addRange(e),setTimeout(()=>{c.parentNode&&c.parentNode.removeChild(c),a.focus()},50)}(a,f),d&&a.dispatch(a.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},a1.paste=(a,b)=>{if(a.composing&&!I)return;let c=bh?null:b.clipboardData,d=a.input.shiftKey&&45!=a.input.lastKeyCode;c&&bi(a,bj(c),c.getData("text/html"),d,b)?b.preventDefault():function(a,b){if(!a.dom.parentNode)return;let c=a.input.shiftKey||a.state.selection.$from.parent.type.spec.code,d=a.dom.parentNode.appendChild(document.createElement(c?"textarea":"div"));c||(d.contentEditable="true"),d.style.cssText="position: fixed; left: -10000px; top: 10px",d.focus();let e=a.input.shiftKey&&45!=a.input.lastKeyCode;setTimeout(()=>{a.focus(),d.parentNode&&d.parentNode.removeChild(d),c?bi(a,d.value,null,e,b):bi(a,d.textContent,d.innerHTML,e,b)},50)}(a,b)};class bk{constructor(a,b,c){this.slice=a,this.move=b,this.node=c}}let bl=G?"altKey":"ctrlKey";function bm(a,b){let c=a.someProp("dragCopies",a=>!a(b));return null!=c?c:!b[bl]}for(let a in a0.dragstart=(a,b)=>{let c,e=a.input.mouseDown;if(e&&e.done(),!b.dataTransfer)return;let f=a.state.selection,g=f.empty?null:a.posAtCoords(a7(b));if(g&&g.pos>=f.from&&g.pos<=(f instanceof d.nh?f.to-1:f.to));else if(e&&e.mightDrag)c=d.nh.create(a.state.doc,e.mightDrag.pos);else if(b.target&&1==b.target.nodeType){let e=a.docView.nearestDesc(b.target,!0);e&&e.node.type.spec.draggable&&e!=a.docView&&(c=d.nh.create(a.state.doc,e.posBefore))}let h=(c||a.state.selection).content(),{dom:i,text:j,slice:k}=aS(a,h);b.dataTransfer.files.length&&C&&!(D>120)||b.dataTransfer.clearData(),b.dataTransfer.setData(bh?"Text":"text/html",i.innerHTML),b.dataTransfer.effectAllowed="copyMove",bh||b.dataTransfer.setData("text/plain",j),a.dragging=new bk(k,bm(a,b),c)},a0.dragend=a=>{let b=a.dragging;window.setTimeout(()=>{a.dragging==b&&(a.dragging=null)},50)},a1.dragover=a1.dragenter=(a,b)=>b.preventDefault(),a1.drop=(a,b)=>{try{!function(a,b,c){if(!b.dataTransfer)return;let g=a.posAtCoords(a7(b));if(!g)return;let h=a.state.doc.resolve(g.pos),i=c&&c.slice;i?a.someProp("transformPasted",b=>{i=b(i,a,!1)}):i=aT(a,bj(b.dataTransfer),bh?null:b.dataTransfer.getData("text/html"),!1,h);let j=!!(c&&bm(a,b));if(a.someProp("handleDrop",c=>c(a,b,i||e.Ji.empty,j)))return b.preventDefault();if(!i)return;b.preventDefault();let k=i?(0,f.Um)(a.state.doc,h.pos,i):h.pos;null==k&&(k=h.pos);let l=a.state.tr;if(j){let{node:a}=c;a?a.replace(l):l.deleteSelection()}let m=l.mapping.map(k),n=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,o=l.doc;if(n?l.replaceRangeWith(m,m,i.content.firstChild):l.replaceRange(m,m,i),l.doc.eq(o))return;let p=l.doc.resolve(m);if(n&&d.nh.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new d.nh(p));else{let b=l.mapping.map(k);l.mapping.maps[l.mapping.maps.length-1].forEach((a,c,d,e)=>b=e),l.setSelection(aD(a,p,l.doc.resolve(b)))}a.focus(),a.dispatch(l.setMeta("uiEvent","drop"))}(a,b,a.dragging)}finally{a.dragging=null}},a0.focus=a=>{a.input.lastFocus=Date.now(),a.focused||(a.domObserver.stop(),a.dom.classList.add("ProseMirror-focused"),a.domObserver.start(),a.focused=!0,setTimeout(()=>{a.docView&&a.hasFocus()&&!a.domObserver.currentSelection.eq(a.domSelectionRange())&&aw(a)},20))},a0.blur=(a,b)=>{a.focused&&(a.domObserver.stop(),a.dom.classList.remove("ProseMirror-focused"),a.domObserver.start(),b.relatedTarget&&a.dom.contains(b.relatedTarget)&&a.domObserver.currentSelection.clear(),a.focused=!1)},a0.beforeinput=(a,b)=>{if(C&&I&&"deleteContentBackward"==b.inputType){a.domObserver.flushSoon();let{domChangeCount:b}=a.input;setTimeout(()=>{if(a.input.domChangeCount!=b||(a.dom.blur(),a.focus(),a.someProp("handleKeyDown",b=>b(a,r(8,"Backspace")))))return;let{$cursor:c}=a.state.selection;c&&c.pos>0&&a.dispatch(a.state.tr.delete(c.pos-1,c.pos).scrollIntoView())},50)}},a1)a0[a]=a1[a];function bn(a,b){if(a==b)return!0;for(let c in a)if(a[c]!==b[c])return!1;for(let c in b)if(!(c in a))return!1;return!0}class bo{constructor(a,b){this.toDOM=a,this.spec=b||bt,this.side=this.spec.side||0}map(a,b,c,d){let{pos:e,deleted:f}=a.mapResult(b.from+d,this.side<0?-1:1);return f?null:new br(e-c,e-c,this)}valid(){return!0}eq(a){return this==a||a instanceof bo&&(this.spec.key&&this.spec.key==a.spec.key||this.toDOM==a.toDOM&&bn(this.spec,a.spec))}destroy(a){this.spec.destroy&&this.spec.destroy(a)}}class bp{constructor(a,b){this.attrs=a,this.spec=b||bt}map(a,b,c,d){let e=a.map(b.from+d,this.spec.inclusiveStart?-1:1)-c,f=a.map(b.to+d,this.spec.inclusiveEnd?1:-1)-c;return e>=f?null:new br(e,f,this)}valid(a,b){return b.from<b.to}eq(a){return this==a||a instanceof bp&&bn(this.attrs,a.attrs)&&bn(this.spec,a.spec)}static is(a){return a.type instanceof bp}destroy(){}}class bq{constructor(a,b){this.attrs=a,this.spec=b||bt}map(a,b,c,d){let e=a.mapResult(b.from+d,1);if(e.deleted)return null;let f=a.mapResult(b.to+d,-1);return f.deleted||f.pos<=e.pos?null:new br(e.pos-c,f.pos-c,this)}valid(a,b){let{index:c,offset:d}=a.content.findIndex(b.from),e;return d==b.from&&!(e=a.child(c)).isText&&d+e.nodeSize==b.to}eq(a){return this==a||a instanceof bq&&bn(this.attrs,a.attrs)&&bn(this.spec,a.spec)}destroy(){}}class br{constructor(a,b,c){this.from=a,this.to=b,this.type=c}copy(a,b){return new br(a,b,this.type)}eq(a,b=0){return this.type.eq(a.type)&&this.from+b==a.from&&this.to+b==a.to}map(a,b,c){return this.type.map(a,this,b,c)}static widget(a,b,c){return new br(a,a,new bo(b,c))}static inline(a,b,c,d){return new br(a,b,new bp(c,d))}static node(a,b,c,d){return new br(a,b,new bq(c,d))}get spec(){return this.type.spec}get inline(){return this.type instanceof bp}get widget(){return this.type instanceof bo}}let bs=[],bt={};class bu{constructor(a,b){this.local=a.length?a:bs,this.children=b.length?b:bs}static create(a,b){return b.length?bA(b,a,0,bt):bv}find(a,b,c){let d=[];return this.findInner(null==a?0:a,null==b?1e9:b,d,0,c),d}findInner(a,b,c,d,e){for(let f=0;f<this.local.length;f++){let g=this.local[f];g.from<=b&&g.to>=a&&(!e||e(g.spec))&&c.push(g.copy(g.from+d,g.to+d))}for(let f=0;f<this.children.length;f+=3)if(this.children[f]<b&&this.children[f+1]>a){let g=this.children[f]+1;this.children[f+2].findInner(a-g,b-g,c,d+g,e)}}map(a,b,c){return this==bv||0==a.maps.length?this:this.mapInner(a,b,0,0,c||bt)}mapInner(a,b,c,d,e){let f;for(let g=0;g<this.local.length;g++){let h=this.local[g].map(a,c,d);h&&h.type.valid(b,h)?(f||(f=[])).push(h):e.onRemove&&e.onRemove(this.local[g].spec)}return this.children.length?function(a,b,c,d,e,f,g){let h=a.slice();for(let a=0,b=f;a<c.maps.length;a++){let d=0;c.maps[a].forEach((a,c,e,f)=>{let g=f-e-(c-a);for(let e=0;e<h.length;e+=3){let f=h[e+1];if(f<0||a>f+b-d)continue;let i=h[e]+b-d;c>=i?h[e+1]=a<=i?-2:-1:a>=b&&g&&(h[e]+=g,h[e+1]+=g)}d+=g}),b=c.maps[a].map(b,-1)}let i=!1;for(let b=0;b<h.length;b+=3)if(h[b+1]<0){if(-2==h[b+1]){i=!0,h[b+1]=-1;continue}let j=c.map(a[b]+f),k=j-e;if(k<0||k>=d.content.size){i=!0;continue}let l=c.map(a[b+1]+f,-1)-e,{index:m,offset:n}=d.content.findIndex(k),o=d.maybeChild(m);if(o&&n==k&&n+o.nodeSize==l){let d=h[b+2].mapInner(c,o,j+1,a[b]+f+1,g);d!=bv?(h[b]=k,h[b+1]=l,h[b+2]=d):(h[b+1]=-2,i=!0)}else i=!0}if(i){let i=bA(function(a,b,c,d,e,f,g){for(let h=0;h<a.length;h+=3)-1==a[h+1]&&function a(b,f){for(let a=0;a<b.local.length;a++){let h=b.local[a].map(d,e,f);h?c.push(h):g.onRemove&&g.onRemove(b.local[a].spec)}for(let c=0;c<b.children.length;c+=3)a(b.children[c+2],b.children[c]+f+1)}(a[h+2],b[h]+f+1);return c}(h,a,b,c,e,f,g),d,0,g);b=i.local;for(let a=0;a<h.length;a+=3)h[a+1]<0&&(h.splice(a,3),a-=3);for(let a=0,b=0;a<i.children.length;a+=3){let c=i.children[a];for(;b<h.length&&h[b]<c;)b+=3;h.splice(b,0,i.children[a],i.children[a+1],i.children[a+2])}}return new bu(b.sort(bB),h)}(this.children,f||[],a,b,c,d,e):f?new bu(f.sort(bB),bs):bv}add(a,b){return b.length?this==bv?bu.create(a,b):this.addInner(a,b,0):this}addInner(a,b,c){let d,e=0;a.forEach((a,f)=>{let g=f+c,h;if(h=by(b,a,g)){for(d||(d=this.children.slice());e<d.length&&d[e]<f;)e+=3;d[e]==f?d[e+2]=d[e+2].addInner(a,h,g+1):d.splice(e,0,f,f+a.nodeSize,bA(h,a,g+1,bt)),e+=3}});let f=bx(e?bz(b):b,-c);for(let b=0;b<f.length;b++)f[b].type.valid(a,f[b])||f.splice(b--,1);return new bu(f.length?this.local.concat(f).sort(bB):this.local,d||this.children)}remove(a){return 0==a.length||this==bv?this:this.removeInner(a,0)}removeInner(a,b){let c=this.children,d=this.local;for(let d=0;d<c.length;d+=3){let e,f=c[d]+b,g=c[d+1]+b;for(let b=0,c;b<a.length;b++)(c=a[b])&&c.from>f&&c.to<g&&(a[b]=null,(e||(e=[])).push(c));if(!e)continue;c==this.children&&(c=this.children.slice());let h=c[d+2].removeInner(e,f+1);h!=bv?c[d+2]=h:(c.splice(d,3),d-=3)}if(d.length){for(let c=0,e;c<a.length;c++)if(e=a[c])for(let a=0;a<d.length;a++)d[a].eq(e,b)&&(d==this.local&&(d=this.local.slice()),d.splice(a--,1))}return c==this.children&&d==this.local?this:d.length||c.length?new bu(d,c):bv}forChild(a,b){let c,d;if(this==bv)return this;if(b.isLeaf)return bu.empty;for(let b=0;b<this.children.length;b+=3)if(this.children[b]>=a){this.children[b]==a&&(c=this.children[b+2]);break}let e=a+1,f=e+b.content.size;for(let a=0;a<this.local.length;a++){let b=this.local[a];if(b.from<f&&b.to>e&&b.type instanceof bp){let a=Math.max(e,b.from)-e,c=Math.min(f,b.to)-e;a<c&&(d||(d=[])).push(b.copy(a,c))}}if(d){let a=new bu(d.sort(bB),bs);return c?new bw([a,c]):a}return c||bv}eq(a){if(this==a)return!0;if(!(a instanceof bu)||this.local.length!=a.local.length||this.children.length!=a.children.length)return!1;for(let b=0;b<this.local.length;b++)if(!this.local[b].eq(a.local[b]))return!1;for(let b=0;b<this.children.length;b+=3)if(this.children[b]!=a.children[b]||this.children[b+1]!=a.children[b+1]||!this.children[b+2].eq(a.children[b+2]))return!1;return!0}locals(a){return bC(this.localsInner(a))}localsInner(a){if(this==bv)return bs;if(a.inlineContent||!this.local.some(bp.is))return this.local;let b=[];for(let a=0;a<this.local.length;a++)this.local[a].type instanceof bp||b.push(this.local[a]);return b}forEachSet(a){a(this)}}bu.empty=new bu([],[]),bu.removeOverlap=bC;let bv=bu.empty;class bw{constructor(a){this.members=a}map(a,b){let c=this.members.map(c=>c.map(a,b,bt));return bw.from(c)}forChild(a,b){if(b.isLeaf)return bu.empty;let c=[];for(let d=0;d<this.members.length;d++){let e=this.members[d].forChild(a,b);e!=bv&&(e instanceof bw?c=c.concat(e.members):c.push(e))}return bw.from(c)}eq(a){if(!(a instanceof bw)||a.members.length!=this.members.length)return!1;for(let b=0;b<this.members.length;b++)if(!this.members[b].eq(a.members[b]))return!1;return!0}locals(a){let b,c=!0;for(let d=0;d<this.members.length;d++){let e=this.members[d].localsInner(a);if(e.length)if(b){c&&(b=b.slice(),c=!1);for(let a=0;a<e.length;a++)b.push(e[a])}else b=e}return b?bC(c?b:b.sort(bB)):bs}static from(a){switch(a.length){case 0:return bv;case 1:return a[0];default:return new bw(a.every(a=>a instanceof bu)?a:a.reduce((a,b)=>a.concat(b instanceof bu?b:b.members),[]))}}forEachSet(a){for(let b=0;b<this.members.length;b++)this.members[b].forEachSet(a)}}function bx(a,b){if(!b||!a.length)return a;let c=[];for(let d=0;d<a.length;d++){let e=a[d];c.push(new br(e.from+b,e.to+b,e.type))}return c}function by(a,b,c){if(b.isLeaf)return null;let d=c+b.nodeSize,e=null;for(let b=0,f;b<a.length;b++)(f=a[b])&&f.from>c&&f.to<d&&((e||(e=[])).push(f),a[b]=null);return e}function bz(a){let b=[];for(let c=0;c<a.length;c++)null!=a[c]&&b.push(a[c]);return b}function bA(a,b,c,d){let e=[],f=!1;b.forEach((b,g)=>{let h=by(a,b,g+c);if(h){f=!0;let a=bA(h,b,c+g+1,d);a!=bv&&e.push(g,g+b.nodeSize,a)}});let g=bx(f?bz(a):a,-c).sort(bB);for(let a=0;a<g.length;a++)g[a].type.valid(b,g[a])||(d.onRemove&&d.onRemove(g[a].spec),g.splice(a--,1));return g.length||e.length?new bu(g,e):bv}function bB(a,b){return a.from-b.from||a.to-b.to}function bC(a){let b=a;for(let c=0;c<b.length-1;c++){let d=b[c];if(d.from!=d.to)for(let e=c+1;e<b.length;e++){let f=b[e];if(f.from==d.from){f.to!=d.to&&(b==a&&(b=a.slice()),b[e]=f.copy(f.from,d.to),bD(b,e+1,f.copy(d.to,f.to)));continue}f.from<d.to&&(b==a&&(b=a.slice()),b[c]=d.copy(d.from,f.from),bD(b,e,d.copy(f.from,d.to)));break}}return b}function bD(a,b,c){for(;b<a.length&&bB(c,a[b])>0;)b++;a.splice(b,0,c)}function bE(a){let b=[];return a.someProp("decorations",c=>{let d=c(a.state);d&&d!=bv&&b.push(d)}),a.cursorWrapper&&b.push(bu.create(a.state.doc,[a.cursorWrapper.deco])),bw.from(b)}let bF={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},bG=y&&z<=11;class bH{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(a){this.anchorNode=a.anchorNode,this.anchorOffset=a.anchorOffset,this.focusNode=a.focusNode,this.focusOffset=a.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(a){return a.anchorNode==this.anchorNode&&a.anchorOffset==this.anchorOffset&&a.focusNode==this.focusNode&&a.focusOffset==this.focusOffset}}class bI{constructor(a,b){this.view=a,this.handleDOMChange=b,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new bH,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(b=>{for(let a=0;a<b.length;a++)this.queue.push(b[a]);y&&z<=11&&b.some(a=>"childList"==a.type&&a.removedNodes.length||"characterData"==a.type&&a.oldValue.length>a.target.nodeValue.length)?this.flushSoon():E&&a.composing&&b.some(a=>"childList"==a.type&&"TR"==a.target.nodeName)?(a.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),bG&&(this.onCharData=a=>{this.queue.push({target:a.target,type:"characterData",oldValue:a.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,bF)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let a=this.observer.takeRecords();if(a.length){for(let b=0;b<a.length;b++)this.queue.push(a[b]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(aE(this.view)){if(this.suppressingSelectionUpdates)return aw(this.view);if(y&&z<=11&&!this.view.state.selection.empty){let a=this.view.domSelectionRange();if(a.focusNode&&l(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(a){if(!a.focusNode)return!0;let b=new Set,c;for(let c=a.focusNode;c;c=h(c))b.add(c);for(let d=a.anchorNode;d;d=h(d))if(b.has(d)){c=d;break}let d=c&&this.view.docView.nearestDesc(c);if(d&&d.ignoreMutation({type:"selection",target:3==c.nodeType?c.parentNode:c}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let a of this.observer.takeRecords())this.queue.push(a);return this.queue}flush(){var a;let{view:b}=this;if(!b.docView||this.flushingSoon>-1)return;let c=this.pendingRecords();c.length&&(this.queue=[]);let e=b.domSelectionRange(),f=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&aE(b)&&!this.ignoreSelectionChange(e),g=-1,h=-1,i=!1,j=[];if(b.editable)for(let a=0;a<c.length;a++){let b=this.registerMutation(c[a],j);b&&(g=g<0?b.from:Math.min(b.from,g),h=h<0?b.to:Math.max(b.to,h),b.typeOver&&(i=!0))}if(j.some(a=>"BR"==a.nodeName)&&(8==b.input.lastKeyCode||46==b.input.lastKeyCode)){for(let a of j)if("BR"==a.nodeName&&a.parentNode){let b=a.nextSibling;b&&1==b.nodeType&&"false"==b.contentEditable&&a.parentNode.removeChild(a)}}else if(A&&j.length){let a=j.filter(a=>"BR"==a.nodeName);if(2==a.length){let[b,c]=a;b.parentNode&&b.parentNode.parentNode==c.parentNode?c.remove():b.remove()}else{let{focusNode:c}=this.currentSelection;for(let d of a){let a=d.parentNode;a&&"LI"==a.nodeName&&(!c||function(a,b){for(let c=b.parentNode;c&&c!=a.dom;c=c.parentNode){let b=a.docView.nearestDesc(c,!0);if(b&&b.node.isBlock)return c}return null}(b,c)!=a)&&d.remove()}}}let k=null;g<0&&f&&b.input.lastFocus>Date.now()-200&&Math.max(b.input.lastTouch,b.input.lastClick.time)<Date.now()-300&&q(e)&&(k=au(b))&&k.eq(d.LN.near(b.state.doc.resolve(0),1))?(b.input.lastFocus=0,aw(b),this.currentSelection.set(e),b.scrollToSelection()):(g>-1||f)&&(g>-1&&(b.docView.markDirty(g,h),a=b,!bJ.has(a)&&(bJ.set(a,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(a.dom).whiteSpace))&&(a.requiresGeckoHackNode=A,bK||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),bK=!0))),b.input.badSafariComposition&&(b.input.badSafariComposition=!1,function(a,b){var c;let{focusNode:d,focusOffset:e}=a.domSelectionRange();for(let f of b)if((null==(c=f.parentNode)?void 0:c.nodeName)=="TR"){let b=f.nextSibling;for(;b&&"TD"!=b.nodeName&&"TH"!=b.nodeName;)b=b.nextSibling;if(b){let c=b;for(;;){let a=c.firstChild;if(!a||1!=a.nodeType||"false"==a.contentEditable||/^(BR|IMG)$/.test(a.nodeName))break;c=a}c.insertBefore(f,c.firstChild),d==f&&a.domSelection().collapse(f,e)}else f.parentNode.removeChild(f)}}(b,j)),this.handleDOMChange(g,h,i,j),b.docView&&b.docView.dirty?b.updateState(b.state):this.currentSelection.eq(e)||aw(b),this.currentSelection.set(e))}registerMutation(a,b){if(b.indexOf(a.target)>-1)return null;let c=this.view.docView.nearestDesc(a.target);if("attributes"==a.type&&(c==this.view.docView||"contenteditable"==a.attributeName||"style"==a.attributeName&&!a.oldValue&&!a.target.getAttribute("style"))||!c||c.ignoreMutation(a))return null;if("childList"==a.type){for(let c=0;c<a.addedNodes.length;c++){let d=a.addedNodes[c];b.push(d),3==d.nodeType&&(this.lastChangedTextNode=d)}if(c.contentDOM&&c.contentDOM!=c.dom&&!c.contentDOM.contains(a.target))return{from:c.posBefore,to:c.posAfter};let d=a.previousSibling,e=a.nextSibling;if(y&&z<=11&&a.addedNodes.length)for(let b=0;b<a.addedNodes.length;b++){let{previousSibling:c,nextSibling:f}=a.addedNodes[b];(!c||0>Array.prototype.indexOf.call(a.addedNodes,c))&&(d=c),(!f||0>Array.prototype.indexOf.call(a.addedNodes,f))&&(e=f)}let f=d&&d.parentNode==a.target?g(d)+1:0,h=c.localPosFromDOM(a.target,f,-1),i=e&&e.parentNode==a.target?g(e):a.target.childNodes.length;return{from:h,to:c.localPosFromDOM(a.target,i,1)}}return"attributes"==a.type?{from:c.posAtStart-c.border,to:c.posAtEnd+c.border}:(this.lastChangedTextNode=a.target,{from:c.posAtStart,to:c.posAtEnd,typeOver:a.target.nodeValue==a.oldValue})}}let bJ=new WeakMap,bK=!1;function bL(a,b){let c=b.startContainer,d=b.startOffset,e=b.endContainer,f=b.endOffset,g=a.domAtPos(a.state.selection.anchor);return l(g.node,g.offset,e,f)&&([c,d,e,f]=[e,f,c,d]),{anchorNode:c,anchorOffset:d,focusNode:e,focusOffset:f}}function bM(a){let b=a.pmViewDesc;if(b)return b.parseRule();if("BR"==a.nodeName&&a.parentNode){if(E&&/^(ul|ol)$/i.test(a.parentNode.nodeName)){let a=document.createElement("div");return a.appendChild(document.createElement("li")),{skip:a}}else if(a.parentNode.lastChild==a||E&&/^(tr|table)$/i.test(a.parentNode.nodeName))return{ignore:!0}}else if("IMG"==a.nodeName&&a.getAttribute("mark-placeholder"))return{ignore:!0};return null}let bN=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function bO(a,b,c){return Math.max(c.anchor,c.head)>b.content.size?null:aD(a,b.resolve(c.anchor),b.resolve(c.head))}function bP(a,b,c){let d=a.depth,e=b?a.end():a.pos;for(;d>0&&(b||a.indexAfter(d)==a.node(d).childCount);)d--,e++,b=!1;if(c){let b=a.node(d).maybeChild(a.indexAfter(d));for(;b&&!b.isLeaf;)b=b.firstChild,e++}return e}function bQ(a){if(2!=a.length)return!1;let b=a.charCodeAt(0),c=a.charCodeAt(1);return b>=56320&&b<=57343&&c>=55296&&c<=56319}class bR{constructor(a,b){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new a3,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=b,this.state=b.state,this.directPlugins=b.plugins||[],this.directPlugins.forEach(bW),this.dispatch=this.dispatch.bind(this),this.dom=a&&a.mount||document.createElement("div"),a&&(a.appendChild?a.appendChild(this.dom):"function"==typeof a?a(this.dom):a.mount&&(this.mounted=!0)),this.editable=bU(this),bT(this),this.nodeViews=bV(this),this.docView=ag(this.state.doc,bS(this),bE(this),this.dom,this),this.domObserver=new bI(this,(a,b,c,f)=>(function(a,b,c,f,g){let h,i,j,k=a.input.compositionPendingChanges||(a.composing?a.input.compositionID:0);if(a.input.compositionPendingChanges=0,b<0){let b=a.input.lastSelectionTime>Date.now()-50?a.input.lastSelectionOrigin:null,c=au(a,b);if(c&&!a.state.selection.eq(c)){if(C&&I&&13===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter"))))return;let d=a.state.tr.setSelection(c);"pointer"==b?d.setMeta("pointer",!0):"key"==b&&d.scrollIntoView(),k&&d.setMeta("composition",k),a.dispatch(d)}return}let l=a.state.doc.resolve(b),m=l.sharedDepth(c);b=l.before(m+1),c=a.state.doc.resolve(c).after(m+1);let n=a.state.selection,o=function(a,b,c){let d,{node:f,fromOffset:g,toOffset:h,from:i,to:j}=a.docView.parseRange(b,c),k=a.domSelectionRange(),l=k.anchorNode;if(l&&a.dom.contains(1==l.nodeType?l:l.parentNode)&&(d=[{node:l,offset:k.anchorOffset}],q(k)||d.push({node:k.focusNode,offset:k.focusOffset})),C&&8===a.input.lastKeyCode)for(let a=h;a>g;a--){let b=f.childNodes[a-1],c=b.pmViewDesc;if("BR"==b.nodeName&&!c){h=a;break}if(!c||c.size)break}let m=a.state.doc,n=a.someProp("domParser")||e.S4.fromSchema(a.state.schema),o=m.resolve(i),p=null,r=n.parse(f,{topNode:o.parent,topMatch:o.parent.contentMatchAt(o.index()),topOpen:!0,from:g,to:h,preserveWhitespace:"pre"!=o.parent.type.whitespace||"full",findPositions:d,ruleFromNode:bM,context:o});if(d&&null!=d[0].pos){let a=d[0].pos,b=d[1]&&d[1].pos;null==b&&(b=a),p={anchor:a+i,head:b+i}}return{doc:r,sel:p,from:i,to:j}}(a,b,c),p=a.state.doc,s=p.slice(o.from,o.to);8===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime?(h=a.state.selection.to,i="end"):(h=a.state.selection.from,i="start"),a.input.lastKeyCode=null;let t=function(a,b,c,d,e){let f=a.findDiffStart(b,c);if(null==f)return null;let{a:g,b:h}=a.findDiffEnd(b,c+a.size,c+b.size);if("end"==e){let a=Math.max(0,f-Math.min(g,h));d-=g+a-f}if(g<f&&a.size<b.size){let a=d<=f&&d>=g?f-d:0;(f-=a)&&f<b.size&&bQ(b.textBetween(f-1,f+1))&&(f+=a?1:-1),h=f+(h-g),g=f}else if(h<f){let b=d<=f&&d>=h?f-d:0;(f-=b)&&f<a.size&&bQ(a.textBetween(f-1,f+1))&&(f+=b?1:-1),g=f+(g-h),h=f}return{start:f,endA:g,endB:h}}(s.content,o.doc.content,o.from,h,i);if(t&&a.input.domChangeCount++,(F&&a.input.lastIOSEnter>Date.now()-225||I)&&g.some(a=>1==a.nodeType&&!bN.test(a.nodeName))&&(!t||t.endA>=t.endB)&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter")))){a.input.lastIOSEnter=0;return}if(!t)if(f&&n instanceof d.U3&&!n.empty&&n.$head.sameParent(n.$anchor)&&!a.composing&&!(o.sel&&o.sel.anchor!=o.sel.head))t={start:n.from,endA:n.to,endB:n.to};else{if(o.sel){let b=bO(a,a.state.doc,o.sel);if(b&&!b.eq(a.state.selection)){let c=a.state.tr.setSelection(b);k&&c.setMeta("composition",k),a.dispatch(c)}}return}a.state.selection.from<a.state.selection.to&&t.start==t.endB&&a.state.selection instanceof d.U3&&(t.start>a.state.selection.from&&t.start<=a.state.selection.from+2&&a.state.selection.from>=o.from?t.start=a.state.selection.from:t.endA<a.state.selection.to&&t.endA>=a.state.selection.to-2&&a.state.selection.to<=o.to&&(t.endB+=a.state.selection.to-t.endA,t.endA=a.state.selection.to)),y&&z<=11&&t.endB==t.start+1&&t.endA==t.start&&t.start>o.from&&" \xa0"==o.doc.textBetween(t.start-o.from-1,t.start-o.from+1)&&(t.start--,t.endA--,t.endB--);let u=o.doc.resolveNoCache(t.start-o.from),v=o.doc.resolveNoCache(t.endB-o.from),w=p.resolve(t.start),x=u.sameParent(v)&&u.parent.inlineContent&&w.end()>=t.endA;if((F&&a.input.lastIOSEnter>Date.now()-225&&(!x||g.some(a=>"DIV"==a.nodeName||"P"==a.nodeName))||!x&&u.pos<o.doc.content.size&&(!u.sameParent(v)||!u.parent.inlineContent)&&u.pos<v.pos&&!/\S/.test(o.doc.textBetween(u.pos,v.pos,"","")))&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter")))){a.input.lastIOSEnter=0;return}if(a.state.selection.anchor>t.start&&function(a,b,c,d,e){if(c-b<=e.pos-d.pos||bP(d,!0,!1)<e.pos)return!1;let f=a.resolve(b);if(!d.parent.isTextblock){let a=f.nodeAfter;return null!=a&&c==b+a.nodeSize}if(f.parentOffset<f.parent.content.size||!f.parent.isTextblock)return!1;let g=a.resolve(bP(f,!0,!0));return!(!g.parent.isTextblock||g.pos>c||bP(g,!0,!1)<c)&&d.parent.content.cut(d.parentOffset).eq(g.parent.content)}(p,t.start,t.endA,u,v)&&a.someProp("handleKeyDown",b=>b(a,r(8,"Backspace")))){I&&C&&a.domObserver.suppressSelectionUpdates();return}C&&t.endB==t.start&&(a.input.lastChromeDelete=Date.now()),I&&!x&&u.start()!=v.start()&&0==v.parentOffset&&u.depth==v.depth&&o.sel&&o.sel.anchor==o.sel.head&&o.sel.head==t.endA&&(t.endB-=2,v=o.doc.resolveNoCache(t.endB-o.from),setTimeout(()=>{a.someProp("handleKeyDown",function(b){return b(a,r(13,"Enter"))})},20));let A=t.start,B=t.endA,D=b=>{let c=b||a.state.tr.replace(A,B,o.doc.slice(t.start-o.from,t.endB-o.from));if(o.sel){let b=bO(a,c.doc,o.sel);b&&!(C&&a.composing&&b.empty&&(t.start!=t.endB||a.input.lastChromeDelete<Date.now()-100)&&(b.head==A||b.head==c.mapping.map(B)-1)||y&&b.empty&&b.head==A)&&c.setSelection(b)}return k&&c.setMeta("composition",k),c.scrollIntoView()};if(x)if(u.pos==v.pos){y&&z<=11&&0==u.parentOffset&&(a.domObserver.suppressSelectionUpdates(),setTimeout(()=>aw(a),20));let b=D(a.state.tr.delete(A,B)),c=p.resolve(t.start).marksAcross(p.resolve(t.endA));c&&b.ensureMarks(c),a.dispatch(b)}else if(t.endA==t.endB&&(j=function(a,b){let c=a.firstChild.marks,d=b.firstChild.marks,f=c,g=d,h,i,j;for(let a=0;a<d.length;a++)f=d[a].removeFromSet(f);for(let a=0;a<c.length;a++)g=c[a].removeFromSet(g);if(1==f.length&&0==g.length)i=f[0],h="add",j=a=>a.mark(i.addToSet(a.marks));else{if(0!=f.length||1!=g.length)return null;i=g[0],h="remove",j=a=>a.mark(i.removeFromSet(a.marks))}let k=[];for(let a=0;a<b.childCount;a++)k.push(j(b.child(a)));if(e.FK.from(k).eq(a))return{mark:i,type:h}}(u.parent.content.cut(u.parentOffset,v.parentOffset),w.parent.content.cut(w.parentOffset,t.endA-w.start())))){let b=D(a.state.tr);"add"==j.type?b.addMark(A,B,j.mark):b.removeMark(A,B,j.mark),a.dispatch(b)}else if(u.parent.child(u.index()).isText&&u.index()==v.index()-!v.textOffset){let b=u.parent.textBetween(u.parentOffset,v.parentOffset),c=()=>D(a.state.tr.insertText(b,A,B));a.someProp("handleTextInput",d=>d(a,A,B,b,c))||a.dispatch(c())}else a.dispatch(D());else a.dispatch(D())})(this,a,b,c,f)),this.domObserver.start(),function(a){for(let b in a0){let c=a0[b];a.dom.addEventListener(b,a.input.eventHandlers[b]=b=>{!function(a,b){if(!b.bubbles)return!0;if(b.defaultPrevented)return!1;for(let c=b.target;c!=a.dom;c=c.parentNode)if(!c||11==c.nodeType||c.pmViewDesc&&c.pmViewDesc.stopEvent(b))return!1;return!0}(a,b)||a6(a,b)||!a.editable&&b.type in a1||c(a,b)},a2[b]?{passive:!0}:void 0)}E&&a.dom.addEventListener("input",()=>null),a5(a)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let a=this._props;for(let b in this._props={},a)this._props[b]=a[b];this._props.state=this.state}return this._props}update(a){a.handleDOMEvents!=this._props.handleDOMEvents&&a5(this);let b=this._props;this._props=a,a.plugins&&(a.plugins.forEach(bW),this.directPlugins=a.plugins),this.updateStateInner(a.state,b)}setProps(a){let b={};for(let a in this._props)b[a]=this._props[a];for(let c in b.state=this.state,a)b[c]=a[c];this.update(b)}updateState(a){this.updateStateInner(a,this._props)}updateStateInner(a,b){var c,d,e;let f=this.state,h=!1,i=!1;a.storedMarks&&this.composing&&(bf(this),i=!0),this.state=a;let j=f.plugins!=a.plugins||this._props.plugins!=b.plugins;if(j||this._props.plugins!=b.plugins||this._props.nodeViews!=b.nodeViews){let a=bV(this);(function(a,b){let c=0,d=0;for(let d in a){if(a[d]!=b[d])return!0;c++}for(let a in b)d++;return c!=d})(a,this.nodeViews)&&(this.nodeViews=a,h=!0)}(j||b.handleDOMEvents!=this._props.handleDOMEvents)&&a5(this),this.editable=bU(this),bT(this);let k=bE(this),m=bS(this),n=f.plugins==a.plugins||f.doc.eq(a.doc)?a.scrollToSelection>f.scrollToSelection?"to selection":"preserve":"reset",q=h||!this.docView.matchesNode(a.doc,m,k);(q||!a.selection.eq(f.selection))&&(i=!0);let r="preserve"==n&&i&&null==this.dom.style.overflowAnchor&&function(a){let b,c,d=a.dom.getBoundingClientRect(),e=Math.max(0,d.top);for(let f=(d.left+d.right)/2,g=e+1;g<Math.min(innerHeight,d.bottom);g+=5){let d=a.root.elementFromPoint(f,g);if(!d||d==a.dom||!a.dom.contains(d))continue;let h=d.getBoundingClientRect();if(h.top>=e-20){b=d,c=h.top;break}}return{refDOM:b,refTop:c,stack:N(a.dom)}}(this);if(i){let b,c,i;this.domObserver.stop();let j=q&&(y||C)&&!this.composing&&!f.selection.empty&&!a.selection.empty&&(d=f.selection,e=a.selection,i=Math.min(d.$anchor.sharedDepth(d.head),e.$anchor.sharedDepth(e.head)),d.$anchor.start(i)!=e.$anchor.start(i));if(q){let b=C?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(a){let b=a.domSelectionRange();if(!b.focusNode)return null;let c=function(a,b){for(;;){if(3==a.nodeType&&b)return a;if(1==a.nodeType&&b>0){if("false"==a.contentEditable)return null;b=o(a=a.childNodes[b-1])}else{if(!a.parentNode||p(a))return null;b=g(a),a=a.parentNode}}}(b.focusNode,b.focusOffset),d=function(a,b){for(;;){if(3==a.nodeType&&b<a.nodeValue.length)return a;if(1==a.nodeType&&b<a.childNodes.length){if("false"==a.contentEditable)return null;a=a.childNodes[b],b=0}else{if(!a.parentNode||p(a))return null;b=g(a)+1,a=a.parentNode}}}(b.focusNode,b.focusOffset);if(c&&d&&c!=d){let b=d.pmViewDesc,e=a.domObserver.lastChangedTextNode;if(c==e||d==e)return e;if(!b||!b.isText(d.nodeValue))return d;if(a.input.compositionNode==d){let a=c.pmViewDesc;if(!(!a||!a.isText(c.nodeValue)))return d}}return c||d}(this)),(h||!this.docView.update(a.doc,m,k,this))&&(this.docView.updateOuterDeco(m),this.docView.destroy(),this.docView=ag(a.doc,m,k,this.dom,this)),!b||this.trackWrites&&this.dom.contains(this.trackWrites)||(j=!0)}j||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),c=this.domSelectionRange(),l(b.node,b.offset,c.anchorNode,c.anchorOffset)))?aw(this,j):(aB(this,a.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(f),(null==(c=this.dragging)?void 0:c.node)&&!f.doc.eq(a.doc)&&this.updateDraggedNode(this.dragging,f),"reset"==n?this.dom.scrollTop=0:"to selection"==n?this.scrollToSelection():r&&function({refDOM:a,refTop:b,stack:c}){let d=a?a.getBoundingClientRect().top:0;O(c,0==d?0:d-b)}(r)}scrollToSelection(){let a=this.domSelectionRange().focusNode;if(a&&this.dom.contains(1==a.nodeType?a:a.parentNode))if(this.someProp("handleScrollToSelection",a=>a(this)));else if(this.state.selection instanceof d.nh){let b=this.docView.domAfterPos(this.state.selection.from);1==b.nodeType&&M(this,b.getBoundingClientRect(),a)}else M(this,this.coordsAtPos(this.state.selection.head,1),a)}destroyPluginViews(){let a;for(;a=this.pluginViews.pop();)a.destroy&&a.destroy()}updatePluginViews(a){if(a&&a.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let b=0;b<this.pluginViews.length;b++){let c=this.pluginViews[b];c.update&&c.update(this,a)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let a=0;a<this.directPlugins.length;a++){let b=this.directPlugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let b=this.state.plugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}}}updateDraggedNode(a,b){let c=a.node,e=-1;if(this.state.doc.nodeAt(c.from)==c.node)e=c.from;else{let a=c.from+(this.state.doc.content.size-b.doc.content.size);(a>0&&this.state.doc.nodeAt(a))==c.node&&(e=a)}this.dragging=new bk(a.slice,a.move,e<0?void 0:d.nh.create(this.state.doc,e))}someProp(a,b){let c=this._props&&this._props[a],d;if(null!=c&&(d=b?b(c):c))return d;for(let c=0;c<this.directPlugins.length;c++){let e=this.directPlugins[c].props[a];if(null!=e&&(d=b?b(e):e))return d}let e=this.state.plugins;if(e)for(let c=0;c<e.length;c++){let f=e[c].props[a];if(null!=f&&(d=b?b(f):f))return d}}hasFocus(){if(y){let a=this.root.activeElement;if(a==this.dom)return!0;if(!a||!this.dom.contains(a))return!1;for(;a&&this.dom!=a&&this.dom.contains(a);){if("false"==a.contentEditable)return!1;a=a.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(a){if(a.setActive)return a.setActive();if(P)return a.focus(P);let b=N(a);a.focus(null==P?{get preventScroll(){return P={preventScroll:!0},!0}}:void 0),P||(P=!1,O(b,0))}(this.dom),aw(this),this.domObserver.start()}get root(){let a=this._root;if(null==a){for(let a=this.dom.parentNode;a;a=a.parentNode)if(9==a.nodeType||11==a.nodeType&&a.host)return a.getSelection||(Object.getPrototypeOf(a).getSelection=()=>a.ownerDocument.getSelection()),this._root=a}return a||document}updateRoot(){this._root=null}posAtCoords(a){return function(a,b){var c;let d,e,f=a.dom.ownerDocument,g,i=0,k=function(a,b,c){if(a.caretPositionFromPoint)try{let d=a.caretPositionFromPoint(b,c);if(d)return{node:d.offsetNode,offset:Math.min(o(d.offsetNode),d.offset)}}catch(a){}if(a.caretRangeFromPoint){let d=a.caretRangeFromPoint(b,c);if(d)return{node:d.startContainer,offset:Math.min(o(d.startContainer),d.startOffset)}}}(f,b.left,b.top);k&&({node:g,offset:i}=k);let l=(a.root.elementFromPoint?a.root:f).elementFromPoint(b.left,b.top);if(!l||!a.dom.contains(1!=l.nodeType?l.parentNode:l)){let c=a.dom.getBoundingClientRect();if(!Q(b,c)||!(l=function a(b,c,d){let e=b.childNodes.length;if(e&&d.top<d.bottom)for(let f=Math.max(0,Math.min(e-1,Math.floor(e*(c.top-d.top)/(d.bottom-d.top))-2)),g=f;;){let d=b.childNodes[g];if(1==d.nodeType){let b=d.getClientRects();for(let e=0;e<b.length;e++){let f=b[e];if(Q(c,f))return a(d,c,f)}}if((g=(g+1)%e)==f)break}return b}(a.dom,b,c)))return null}if(E)for(let a=l;g&&a;a=h(a))a.draggable&&(g=void 0);if(l=(d=(c=l).parentNode)&&/^li$/i.test(d.nodeName)&&b.left<c.getBoundingClientRect().left?d:c,g){let c;if(A&&1==g.nodeType&&(i=Math.min(i,g.childNodes.length))<g.childNodes.length){let a=g.childNodes[i],c;"IMG"==a.nodeName&&(c=a.getBoundingClientRect()).right<=b.left&&c.bottom>b.top&&i++}J&&i&&1==g.nodeType&&1==(c=g.childNodes[i-1]).nodeType&&"false"==c.contentEditable&&c.getBoundingClientRect().top>=b.top&&i--,g==a.dom&&i==g.childNodes.length-1&&1==g.lastChild.nodeType&&b.top>g.lastChild.getBoundingClientRect().bottom?e=a.state.doc.content.size:(0==i||1!=g.nodeType||"BR"!=g.childNodes[i-1].nodeName)&&(e=function(a,b,c,d){let e=-1;for(let c=b,f=!1;c!=a.dom;){let b=a.docView.nearestDesc(c,!0),g;if(!b)return null;if(1==b.dom.nodeType&&(b.node.isBlock&&b.parent||!b.contentDOM)&&((g=b.dom.getBoundingClientRect()).width||g.height)&&(b.node.isBlock&&b.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(b.dom.nodeName)&&(!f&&g.left>d.left||g.top>d.top?e=b.posBefore:(!f&&g.right<d.left||g.bottom<d.top)&&(e=b.posAfter),f=!0),!b.contentDOM&&e<0&&!b.node.isText))return(b.node.isBlock?d.top<(g.top+g.bottom)/2:d.left<(g.left+g.right)/2)?b.posBefore:b.posAfter;c=b.dom.parentNode}return e>-1?e:a.docView.posFromDOM(b,c,-1)}(a,g,i,b))}null==e&&(e=function(a,b,c){let{node:d,offset:e}=function a(b,c){let d,e,f,g=2e8,h,i=0,k=c.top,l=c.top;for(let a=b.firstChild,m=0;a;a=a.nextSibling,m++){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=j(a).getClientRects()}for(let j=0;j<b.length;j++){let n=b[j];if(n.top<=k&&n.bottom>=l){k=Math.max(n.bottom,k),l=Math.min(n.top,l);let b=n.left>c.left?n.left-c.left:n.right<c.left?c.left-n.right:0;if(b<g){f=a,g=b,h=b&&3==f.nodeType?{left:n.right<c.left?n.right:n.left,top:c.top}:c,1==a.nodeType&&b&&(i=m+ +(c.left>=(n.left+n.right)/2));continue}}else n.top>c.top&&!d&&n.left<=c.left&&n.right>=c.left&&(d=a,e={left:Math.max(n.left,Math.min(n.right,c.left)),top:n.top});!f&&(c.left>=n.right&&c.top>=n.top||c.left>=n.left&&c.top>=n.bottom)&&(i=m+1)}}return(!f&&d&&(f=d,h=e,g=0),f&&3==f.nodeType)?function(a,b){let c=a.nodeValue.length,d=document.createRange(),e;for(let f=0;f<c;f++){d.setEnd(a,f+1),d.setStart(a,f);let c=S(d,1);if(c.top!=c.bottom&&Q(b,c)){e={node:a,offset:f+ +(b.left>=(c.left+c.right)/2)};break}}return d.detach(),e||{node:a,offset:0}}(f,h):!f||g&&1==f.nodeType?{node:b,offset:i}:a(f,h)}(b,c),f=-1;if(1==d.nodeType&&!d.firstChild){let a=d.getBoundingClientRect();f=a.left!=a.right&&c.left>(a.left+a.right)/2?1:-1}return a.docView.posFromDOM(d,e,f)}(a,l,b));let m=a.docView.nearestDesc(l,!0);return{pos:e,inside:m?m.posAtStart-m.border:-1}}(this,a)}coordsAtPos(a,b=1){return U(this,a,b)}domAtPos(a,b=0){return this.docView.domFromPos(a,b)}nodeDOM(a){let b=this.docView.descAt(a);return b?b.nodeDOM:null}posAtDOM(a,b,c=-1){let d=this.docView.posFromDOM(a,b,c);if(null==d)throw RangeError("DOM position not inside the editor");return d}endOfTextblock(a,b){return function(a,b,c){let d,e;return Z==b&&_==c?aa:(Z=b,_=c,aa="up"==c||"down"==c?(d=b.selection,e="up"==c?d.$from:d.$to,X(a,b,()=>{let{node:b}=a.docView.domFromPos(e.pos,"up"==c?-1:1);for(;;){let c=a.docView.nearestDesc(b,!0);if(!c)break;if(c.node.isBlock){b=c.contentDOM||c.dom;break}b=c.dom.parentNode}let d=U(a,e.pos,1);for(let a=b.firstChild;a;a=a.nextSibling){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=j(a,0,a.nodeValue.length).getClientRects()}for(let a=0;a<b.length;a++){let e=b[a];if(e.bottom>e.top+1&&("up"==c?d.top-e.top>(e.bottom-d.top)*2:e.bottom-d.bottom>(d.bottom-e.top)*2))return!1}}return!0})):function(a,b,c){let{$head:d}=b.selection;if(!d.parent.isTextblock)return!1;let e=d.parentOffset,f=e==d.parent.content.size,g=a.domSelection();return g?Y.test(d.parent.textContent)&&g.modify?X(a,b,()=>{let{focusNode:b,focusOffset:e,anchorNode:f,anchorOffset:h}=a.domSelectionRange(),i=g.caretBidiLevel;g.modify("move",c,"character");let j=d.depth?a.docView.domAfterPos(d.before()):a.dom,{focusNode:k,focusOffset:l}=a.domSelectionRange(),m=k&&!j.contains(1==k.nodeType?k:k.parentNode)||b==k&&e==l;try{g.collapse(f,h),b&&(b!=f||e!=h)&&g.extend&&g.extend(b,e)}catch(a){}return null!=i&&(g.caretBidiLevel=i),m}):"left"==c||"backward"==c?!e:f:d.pos==d.start()||d.pos==d.end()}(a,b,c))}(this,b||this.state,a)}pasteHTML(a,b){return bi(this,"",a,!1,b||new ClipboardEvent("paste"))}pasteText(a,b){return bi(this,a,null,!0,b||new ClipboardEvent("paste"))}serializeForClipboard(a){return aS(this,a)}destroy(){if(this.docView){for(let a in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(a,this.input.eventHandlers[a]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],bE(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,k()}}get isDestroyed(){return null==this.docView}dispatchEvent(a){!a6(this,a)&&a0[a.type]&&(this.editable||!(a.type in a1))&&a0[a.type](this,a)}domSelectionRange(){let a=this.domSelection();return a?E&&11===this.root.nodeType&&function(a){let b=a.activeElement;for(;b&&b.shadowRoot;)b=b.shadowRoot.activeElement;return b}(this.dom.ownerDocument)==this.dom&&function(a,b){let c;if(b.getComposedRanges){let c=b.getComposedRanges(a.root)[0];if(c)return bL(a,c)}function d(a){a.preventDefault(),a.stopImmediatePropagation(),c=a.getTargetRanges()[0]}return a.dom.addEventListener("beforeinput",d,!0),document.execCommand("indent"),a.dom.removeEventListener("beforeinput",d,!0),c?bL(a,c):null}(this,a)||a:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function bS(a){let b=Object.create(null);return b.class="ProseMirror",b.contenteditable=String(a.editable),a.someProp("attributes",c=>{if("function"==typeof c&&(c=c(a.state)),c)for(let a in c)"class"==a?b.class+=" "+c[a]:"style"==a?b.style=(b.style?b.style+";":"")+c[a]:b[a]||"contenteditable"==a||"nodeName"==a||(b[a]=String(c[a]))}),b.translate||(b.translate="no"),[br.node(0,a.state.doc.content.size,b)]}function bT(a){if(a.markCursor){let b=document.createElement("img");b.className="ProseMirror-separator",b.setAttribute("mark-placeholder","true"),b.setAttribute("alt",""),a.cursorWrapper={dom:b,deco:br.widget(a.state.selection.from,b,{raw:!0,marks:a.markCursor})}}else a.cursorWrapper=null}function bU(a){return!a.someProp("editable",b=>!1===b(a.state))}function bV(a){let b=Object.create(null);function c(a){for(let c in a)Object.prototype.hasOwnProperty.call(b,c)||(b[c]=a[c])}return a.someProp("nodeViews",c),a.someProp("markViews",c),b}function bW(a){if(a.spec.state||a.spec.filterTransaction||a.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}bR.prototype.dispatch=function(a){let b=this._props.dispatchTransaction;b?b.call(this,a):this.updateState(this.state.apply(a))}},670016:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(789253);b.property=function(a){return function(b){return d.get(b,a)}}},673977:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(356103).Or},676029:(a,b,c)=>{"use strict";c.d(b,{q:()=>Y});var d=c(115962);function e(a){return Array.isArray?Array.isArray(a):"[object Array]"===l(a)}let f=1/0;function g(a){return"string"==typeof a}function h(a){return"number"==typeof a}function i(a){return"object"==typeof a}function j(a){return null!=a}function k(a){return!a.trim().length}function l(a){return null==a?void 0===a?"[object Undefined]":"[object Null]":Object.prototype.toString.call(a)}let m=Object.prototype.hasOwnProperty;class n{constructor(a){this._keys=[],this._keyMap={};let b=0;a.forEach(a=>{let c=o(a);this._keys.push(c),this._keyMap[c.id]=c,b+=c.weight}),this._keys.forEach(a=>{a.weight/=b})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function o(a){let b=null,c=null,d=null,f=1,h=null;if(g(a)||e(a))d=a,b=p(a),c=q(a);else{if(!m.call(a,"name"))throw Error("Missing name property in key");let e=a.name;if(d=e,m.call(a,"weight")&&(f=a.weight)<=0)throw Error(`Property 'weight' in key '${e}' must be a positive integer`);b=p(e),c=q(e),h=a.getFn}return{path:b,id:c,weight:f,src:d,getFn:h}}function p(a){return e(a)?a:a.split(".")}function q(a){return e(a)?a.join("."):a}var r={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(a,b)=>a.score===b.score?a.idx<b.idx?-1:1:a.score<b.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(a,b){let c=[],d=!1,k=(a,b,m)=>{if(j(a))if(b[m]){var n,o;let p=a[b[m]];if(!j(p))return;if(m===b.length-1&&(g(p)||h(p)||!0===(n=p)||!1===n||i(o=n)&&null!==o&&"[object Boolean]"==l(n)))c.push(null==p?"":function(a){if("string"==typeof a)return a;let b=a+"";return"0"==b&&1/a==-f?"-0":b}(p));else if(e(p)){d=!0;for(let a=0,c=p.length;a<c;a+=1)k(p[a],b,m+1)}else b.length&&k(p,b,m+1)}else c.push(a)};return k(a,g(b)?b.split("."):b,0),d?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};let s=/[^ ]+/g;class t{constructor({getFn:a=r.getFn,fieldNormWeight:b=r.fieldNormWeight}={}){this.norm=function(a=1,b=3){let c=new Map,d=Math.pow(10,b);return{get(b){let e=b.match(s).length;if(c.has(e))return c.get(e);let f=parseFloat(Math.round(1/Math.pow(e,.5*a)*d)/d);return c.set(e,f),f},clear(){c.clear()}}}(b,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((a,b)=>{this._keysMap[a.id]=b})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((a,b)=>{this._addString(a,b)}):this.docs.forEach((a,b)=>{this._addObject(a,b)}),this.norm.clear())}add(a){let b=this.size();g(a)?this._addString(a,b):this._addObject(a,b)}removeAt(a){this.records.splice(a,1);for(let b=a,c=this.size();b<c;b+=1)this.records[b].i-=1}getValueForItemAtKeyId(a,b){return a[this._keysMap[b]]}size(){return this.records.length}_addString(a,b){if(!j(a)||k(a))return;let c={v:a,i:b,n:this.norm.get(a)};this.records.push(c)}_addObject(a,b){let c={i:b,$:{}};this.keys.forEach((b,d)=>{let f=b.getFn?b.getFn(a):this.getFn(a,b.path);if(j(f)){if(e(f)){let a=[],b=[{nestedArrIndex:-1,value:f}];for(;b.length;){let{nestedArrIndex:c,value:d}=b.pop();if(j(d))if(g(d)&&!k(d)){let b={v:d,i:c,n:this.norm.get(d)};a.push(b)}else e(d)&&d.forEach((a,c)=>{b.push({nestedArrIndex:c,value:a})})}c.$[d]=a}else if(g(f)&&!k(f)){let a={v:f,n:this.norm.get(f)};c.$[d]=a}}}),this.records.push(c)}toJSON(){return{keys:this.keys,records:this.records}}}function u(a,b,{getFn:c=r.getFn,fieldNormWeight:d=r.fieldNormWeight}={}){let e=new t({getFn:c,fieldNormWeight:d});return e.setKeys(a.map(o)),e.setSources(b),e.create(),e}function v(a,{errors:b=0,currentLocation:c=0,expectedLocation:d=0,distance:e=r.distance,ignoreLocation:f=r.ignoreLocation}={}){let g=b/a.length;if(f)return g;let h=Math.abs(d-c);return e?g+h/e:h?1:g}let w=String.prototype.normalize?a=>a.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):a=>a;class x{constructor(a,{location:b=r.location,threshold:c=r.threshold,distance:d=r.distance,includeMatches:e=r.includeMatches,findAllMatches:f=r.findAllMatches,minMatchCharLength:g=r.minMatchCharLength,isCaseSensitive:h=r.isCaseSensitive,ignoreDiacritics:i=r.ignoreDiacritics,ignoreLocation:j=r.ignoreLocation}={}){if(this.options={location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j},a=h?a:a.toLowerCase(),a=i?w(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;let k=(a,b)=>{this.chunks.push({pattern:a,alphabet:function(a){let b={};for(let c=0,d=a.length;c<d;c+=1){let e=a.charAt(c);b[e]=(b[e]||0)|1<<d-c-1}return b}(a),startIndex:b})},l=this.pattern.length;if(l>32){let a=0,b=l%32,c=l-b;for(;a<c;)k(this.pattern.substr(a,32),a),a+=32;if(b){let a=l-32;k(this.pattern.substr(a),a)}}else k(this.pattern,0)}searchIn(a){let{isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d}=this.options;if(a=b?a:a.toLowerCase(),a=c?w(a):a,this.pattern===a){let b={isMatch:!0,score:0};return d&&(b.indices=[[0,a.length-1]]),b}let{location:e,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,ignoreLocation:j}=this.options,k=[],l=0,m=!1;this.chunks.forEach(({pattern:b,alphabet:c,startIndex:n})=>{let{isMatch:o,score:p,indices:q}=function(a,b,c,{location:d=r.location,distance:e=r.distance,threshold:f=r.threshold,findAllMatches:g=r.findAllMatches,minMatchCharLength:h=r.minMatchCharLength,includeMatches:i=r.includeMatches,ignoreLocation:j=r.ignoreLocation}={}){let k;if(b.length>32)throw Error("Pattern length exceeds max of 32.");let l=b.length,m=a.length,n=Math.max(0,Math.min(d,m)),o=f,p=n,q=h>1||i,s=q?Array(m):[];for(;(k=a.indexOf(b,p))>-1;)if(o=Math.min(v(b,{currentLocation:k,expectedLocation:n,distance:e,ignoreLocation:j}),o),p=k+l,q){let a=0;for(;a<l;)s[k+a]=1,a+=1}p=-1;let t=[],u=1,w=l+m,x=1<<l-1;for(let d=0;d<l;d+=1){let f=0,h=w;for(;f<h;)v(b,{errors:d,currentLocation:n+h,expectedLocation:n,distance:e,ignoreLocation:j})<=o?f=h:w=h,h=Math.floor((w-f)/2+f);w=h;let i=Math.max(1,n-h+1),k=g?m:Math.min(n+h,m)+l,r=Array(k+2);r[k+1]=(1<<d)-1;for(let f=k;f>=i;f-=1){let g=f-1,h=c[a.charAt(g)];if(q&&(s[g]=+!!h),r[f]=(r[f+1]<<1|1)&h,d&&(r[f]|=(t[f+1]|t[f])<<1|1|t[f+1]),r[f]&x&&(u=v(b,{errors:d,currentLocation:g,expectedLocation:n,distance:e,ignoreLocation:j}))<=o){if(o=u,(p=g)<=n)break;i=Math.max(1,2*n-p)}}if(v(b,{errors:d+1,currentLocation:n,expectedLocation:n,distance:e,ignoreLocation:j})>o)break;t=r}let y={isMatch:p>=0,score:Math.max(.001,u)};if(q){let a=function(a=[],b=r.minMatchCharLength){let c=[],d=-1,e=-1,f=0;for(let g=a.length;f<g;f+=1){let g=a[f];g&&-1===d?d=f:g||-1===d||((e=f-1)-d+1>=b&&c.push([d,e]),d=-1)}return a[f-1]&&f-d>=b&&c.push([d,f-1]),c}(s,h);a.length?i&&(y.indices=a):y.isMatch=!1}return y}(a,b,c,{location:e+n,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,includeMatches:d,ignoreLocation:j});o&&(m=!0),l+=p,o&&q&&(k=[...k,...q])});let n={isMatch:m,score:m?l/this.chunks.length:1};return m&&d&&(n.indices=k),n}}class y{constructor(a){this.pattern=a}static isMultiMatch(a){return z(a,this.multiRegex)}static isSingleMatch(a){return z(a,this.singleRegex)}search(){}}function z(a,b){let c=a.match(b);return c?c[1]:null}class A extends y{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){let b=a===this.pattern;return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class B extends y{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){let b=-1===a.indexOf(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class C extends y{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){let b=a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class D extends y{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){let b=!a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class E extends y{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){let b=a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[a.length-this.pattern.length,a.length-1]}}}class F extends y{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){let b=!a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class G extends y{constructor(a,{location:b=r.location,threshold:c=r.threshold,distance:d=r.distance,includeMatches:e=r.includeMatches,findAllMatches:f=r.findAllMatches,minMatchCharLength:g=r.minMatchCharLength,isCaseSensitive:h=r.isCaseSensitive,ignoreDiacritics:i=r.ignoreDiacritics,ignoreLocation:j=r.ignoreLocation}={}){super(a),this._bitapSearch=new x(a,{location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class H extends y{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let b,c=0,d=[],e=this.pattern.length;for(;(b=a.indexOf(this.pattern,c))>-1;)c=b+e,d.push([b,c-1]);let f=!!d.length;return{isMatch:f,score:+!f,indices:d}}}let I=[A,H,C,D,F,E,B,G],J=I.length,K=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,L=new Set([G.type,H.type]);class M{constructor(a,{isCaseSensitive:b=r.isCaseSensitive,ignoreDiacritics:c=r.ignoreDiacritics,includeMatches:d=r.includeMatches,minMatchCharLength:e=r.minMatchCharLength,ignoreLocation:f=r.ignoreLocation,findAllMatches:g=r.findAllMatches,location:h=r.location,threshold:i=r.threshold,distance:j=r.distance}={}){this.query=null,this.options={isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d,minMatchCharLength:e,findAllMatches:g,ignoreLocation:f,location:h,threshold:i,distance:j},a=b?a:a.toLowerCase(),a=c?w(a):a,this.pattern=a,this.query=function(a,b={}){return a.split("|").map(a=>{let c=a.trim().split(K).filter(a=>a&&!!a.trim()),d=[];for(let a=0,e=c.length;a<e;a+=1){let e=c[a],f=!1,g=-1;for(;!f&&++g<J;){let a=I[g],c=a.isMultiMatch(e);c&&(d.push(new a(c,b)),f=!0)}if(!f)for(g=-1;++g<J;){let a=I[g],c=a.isSingleMatch(e);if(c){d.push(new a(c,b));break}}}return d})}(this.pattern,this.options)}static condition(a,b){return b.useExtendedSearch}searchIn(a){let b=this.query;if(!b)return{isMatch:!1,score:1};let{includeMatches:c,isCaseSensitive:d,ignoreDiacritics:e}=this.options;a=d?a:a.toLowerCase(),a=e?w(a):a;let f=0,g=[],h=0;for(let d=0,e=b.length;d<e;d+=1){let e=b[d];g.length=0,f=0;for(let b=0,d=e.length;b<d;b+=1){let d=e[b],{isMatch:i,indices:j,score:k}=d.search(a);if(i){if(f+=1,h+=k,c){let a=d.constructor.type;L.has(a)?g=[...g,...j]:g.push(j)}}else{h=0,f=0,g.length=0;break}}if(f){let a={isMatch:!0,score:h/f};return c&&(a.indices=g),a}}return{isMatch:!1,score:1}}}let N=[];function O(a,b){for(let c=0,d=N.length;c<d;c+=1){let d=N[c];if(d.condition(a,b))return new d(a,b)}return new x(a,b)}let P={AND:"$and",OR:"$or"},Q={PATH:"$path",PATTERN:"$val"},R=a=>!!(a[P.AND]||a[P.OR]),S=a=>({[P.AND]:Object.keys(a).map(b=>({[b]:a[b]}))});function T(a,b,{auto:c=!0}={}){let d=a=>{let f=Object.keys(a),h=!!a[Q.PATH];if(!h&&f.length>1&&!R(a))return d(S(a));if(!e(a)&&i(a)&&!R(a)){let d=h?a[Q.PATH]:f[0],e=h?a[Q.PATTERN]:a[d];if(!g(e))throw Error(`Invalid value for key ${d}`);let i={keyId:q(d),pattern:e};return c&&(i.searcher=O(e,b)),i}let j={children:[],operator:f[0]};return f.forEach(b=>{let c=a[b];e(c)&&c.forEach(a=>{j.children.push(d(a))})}),j};return R(a)||(a=S(a)),d(a)}function U(a,b){let c=a.matches;b.matches=[],j(c)&&c.forEach(a=>{if(!j(a.indices)||!a.indices.length)return;let{indices:c,value:d}=a,e={indices:c,value:d};a.key&&(e.key=a.key.src),a.idx>-1&&(e.refIndex=a.idx),b.matches.push(e)})}function V(a,b){b.score=a.score}class W{constructor(a,b={},c){this.options={...r,...b},this.options.useExtendedSearch,this._keyStore=new n(this.options.keys),this.setCollection(a,c)}setCollection(a,b){if(this._docs=a,b&&!(b instanceof t))throw Error("Incorrect 'index' type");this._myIndex=b||u(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){j(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){let b=[];for(let c=0,d=this._docs.length;c<d;c+=1){let e=this._docs[c];a(e,c)&&(this.removeAt(c),c-=1,d-=1,b.push(e))}return b}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:b=-1}={}){let{includeMatches:c,includeScore:d,shouldSort:e,sortFn:f,ignoreFieldNorm:i}=this.options,j=g(a)?g(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return!function(a,{ignoreFieldNorm:b=r.ignoreFieldNorm}){a.forEach(a=>{let c=1;a.matches.forEach(({key:a,norm:d,score:e})=>{let f=a?a.weight:null;c*=Math.pow(0===e&&f?Number.EPSILON:e,(f||1)*(b?1:d))}),a.score=c})}(j,{ignoreFieldNorm:i}),e&&j.sort(f),h(b)&&b>-1&&(j=j.slice(0,b)),function(a,b,{includeMatches:c=r.includeMatches,includeScore:d=r.includeScore}={}){let e=[];return c&&e.push(U),d&&e.push(V),a.map(a=>{let{idx:c}=a,d={item:b[c],refIndex:c};return e.length&&e.forEach(b=>{b(a,d)}),d})}(j,this._docs,{includeMatches:c,includeScore:d})}_searchStringList(a){let b=O(a,this.options),{records:c}=this._myIndex,d=[];return c.forEach(({v:a,i:c,n:e})=>{if(!j(a))return;let{isMatch:f,score:g,indices:h}=b.searchIn(a);f&&d.push({item:a,idx:c,matches:[{score:g,value:a,norm:e,indices:h}]})}),d}_searchLogical(a){let b=T(a,this.options),c=(a,b,d)=>{if(!a.children){let{keyId:c,searcher:e}=a,f=this._findMatches({key:this._keyStore.get(c),value:this._myIndex.getValueForItemAtKeyId(b,c),searcher:e});return f&&f.length?[{idx:d,item:b,matches:f}]:[]}let e=[];for(let f=0,g=a.children.length;f<g;f+=1){let g=c(a.children[f],b,d);if(g.length)e.push(...g);else if(a.operator===P.AND)return[]}return e},d=this._myIndex.records,e={},f=[];return d.forEach(({$:a,i:d})=>{if(j(a)){let g=c(b,a,d);g.length&&(e[d]||(e[d]={idx:d,item:a,matches:[]},f.push(e[d])),g.forEach(({matches:a})=>{e[d].matches.push(...a)}))}}),f}_searchObjectList(a){let b=O(a,this.options),{keys:c,records:d}=this._myIndex,e=[];return d.forEach(({$:a,i:d})=>{if(!j(a))return;let f=[];c.forEach((c,d)=>{f.push(...this._findMatches({key:c,value:a[d],searcher:b}))}),f.length&&e.push({idx:d,item:a,matches:f})}),e}_findMatches({key:a,value:b,searcher:c}){if(!j(b))return[];let d=[];if(e(b))b.forEach(({v:b,i:e,n:f})=>{if(!j(b))return;let{isMatch:g,score:h,indices:i}=c.searchIn(b);g&&d.push({score:h,key:a,value:b,idx:e,norm:f,indices:i})});else{let{v:e,n:f}=b,{isMatch:g,score:h,indices:i}=c.searchIn(e);g&&d.push({score:h,key:a,value:e,norm:f,indices:i})}return d}}W.version="7.1.0",W.createIndex=u,W.parseIndex=function(a,{getFn:b=r.getFn,fieldNormWeight:c=r.fieldNormWeight}={}){let{keys:d,records:e}=a,f=new t({getFn:b,fieldNormWeight:c});return f.setKeys(d),f.setIndexRecords(e),f},W.config=r,W.parseQuery=T,function(...a){N.push(...a)}(M);let X={keys:[{name:"label",weight:3},{name:"sublabel",weight:1},{name:"objectName",weight:1.5},{name:"fieldValues",weight:2}],threshold:.4,distance:200,includeScore:!0,shouldSort:!0,minMatchCharLength:1};function Y(a){let[b,c]=(0,d.useState)([]),[e,f]=(0,d.useState)(!0),g=(0,d.useRef)(!0);(0,d.useCallback)(async()=>{try{let a=await fetch("/api/workspace/search-index"),b=await a.json();g.current&&(c(b.items??[]),f(!1))}catch{g.current&&f(!1)}},[]);let h=(0,d.useMemo)(()=>0===b.length?null:new W(b.map(a=>({...a,fieldValues:a.fields?Object.values(a.fields).join(" "):void 0})),X),[b]),i=(0,d.useCallback)((a,c=20)=>a.trim()?h?h.search(a,{limit:c}).map(a=>a.item):[]:[...b].toSorted((a,b)=>{let c={object:0,file:1,entry:2};return(c[a.kind]??9)-(c[b.kind]??9)}).slice(0,c),[h,b]),j=(0,d.useRef)(i);return j.current=i,{items:b,loading:e,search:(0,d.useCallback)((a,b)=>j.current(a,b),[])}}},681560:(a,b,c)=>{"use strict";c.d(b,{I:()=>n});var d=c(736927),e=c(115962),f=c(681713),g=c(612563),h=c(379924),i=c(18886),j=c(130526);function k(a){return null==a?"":"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):"object"==typeof a?JSON.stringify(a):""}function l({entry:a,fields:b,titleField:c,coverField:l,onEntryClick:m}){let n=k(a.entry_id??a.id),o=function(a,b,c){if(c){let b=k(a[c]);if(b)return b}let d=b.find(a=>"text"===a.type&&/name|title/i.test(a.name))??b.find(a=>"text"===a.type);return d?k(a[d.name]):k(a.id)}(a,b,c),p=(0,j.I)(a,b),q=(0,e.useMemo)(()=>b.filter(a=>a.name!==c&&a.name!==l).slice(0,4),[b,c,l]),r=b.find(a=>"enum"===a.type&&a.enum_values?.length),s=r?k(a[r.name]):null,t=r&&s?function(a,b){if(!a||!b.enum_values)return null;let c=b.enum_values.indexOf(a);return{text:a,color:c>=0&&b.enum_colors?.[c]?b.enum_colors[c]:"#94a3b8"}}(s,r):null;return(0,d.jsxs)("button",{type:"button",onClick:()=>m?.(n),className:"text-left rounded-xl border p-4 hover:shadow-md transition-all cursor-pointer w-full group",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[p?.faviconUrl&&(0,d.jsx)(i.A,{src:p.faviconUrl,className:"w-4 h-4 rounded-[4px] shrink-0 mt-0.5"}),(0,d.jsx)("h4",{className:"text-[13px] font-semibold leading-tight line-clamp-2 group-hover:underline",style:{color:"var(--color-text)"},children:o||"Untitled"})]}),t&&(0,d.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0 whitespace-nowrap",style:{backgroundColor:t.color,color:"#fff"},children:t.text})]}),(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:q.map(b=>{let c=a[b.name];if(null==c||""===k(c))return null;let e="tags"===b.type?(0,h.k)(c):[];return(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:"text-[10px] flex-shrink-0 min-w-[60px]",style:{color:"var(--color-text-muted)"},children:b.name}),(0,d.jsx)("div",{className:"text-[12px] whitespace-pre-line line-clamp-2",style:{color:"var(--color-text)"},children:"tags"===b.type?(0,d.jsxs)("span",{className:"flex items-center gap-0.5 flex-wrap",children:[e.slice(0,3).map(a=>{let b=(0,g.KJ)(a),c="link"===b.kind&&b.href,e="url"===b.linkType&&!!b.faviconUrl;return c?(0,d.jsxs)("a",{href:b.href,target:"url"===b.linkType||"file"===b.linkType?"_blank":void 0,rel:"url"===b.linkType||"file"===b.linkType?"noopener noreferrer":void 0,onClick:a=>a.stopPropagation(),className:"inline-flex items-center gap-1 px-1.5 py-0 rounded text-[11px] font-medium hover:underline underline-offset-2 max-w-[220px]",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-accent)"},children:[e&&(0,d.jsx)(i.A,{src:b.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:b.text})]},a):(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0 rounded text-[11px] font-medium",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-text-muted)"},children:a},a)}),e.length>3&&(0,d.jsxs)("span",{className:"text-[10px]",style:{color:"var(--color-text-muted)"},children:["+",e.length-3]})]}):(0,d.jsx)(f.E,{value:c,fieldType:b.type,mode:"table",showUrlFavicon:!0})})]},b.id)})}),null!=a.created_at&&(0,d.jsx)("div",{className:"mt-3 text-[10px]",style:{color:"var(--color-text-muted)",opacity:.6},children:k(a.created_at).slice(0,10)})]})}function m(){return(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 gap-2",children:[(0,d.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",style:{color:"var(--color-text-muted)",opacity:.4},children:[(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"})]}),(0,d.jsx)("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"No entries to display in gallery view."})]})}function n({objectName:a,fields:b,entries:c,titleField:e,coverField:f,members:g,relationLabels:h,onEntryClick:i}){return 0===c.length?(0,d.jsx)(m,{}):(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:c.map(a=>(0,d.jsx)(l,{entry:a,fields:b,titleField:e,coverField:f,onEntryClick:i},k(a.entry_id??a.id)))})}},681713:(a,b,c)=>{"use strict";c.d(b,{E:()=>m});var d=c(736927),e=c(115962),f=c(612563),g=c(18886),h=c(545182),i=c(888973);function j(){return(0,d.jsx)("span",{style:{color:"var(--color-text-muted)",opacity:.5},children:"--"})}function k({mediaType:a,url:b,label:c}){return"image"===a?(0,d.jsx)("div",{className:"mt-2 rounded-lg overflow-hidden border",style:{borderColor:"var(--color-border)"},children:(0,d.jsx)("img",{src:b,alt:c,className:"max-h-64 w-auto"})}):"video"===a?(0,d.jsx)("video",{src:b,controls:!0,className:"mt-2 w-full max-h-72 rounded-lg border",style:{borderColor:"var(--color-border)",background:"#000"}}):"audio"===a?(0,d.jsx)("audio",{src:b,controls:!0,className:"mt-2 w-full"}):(0,d.jsx)("iframe",{src:`${b}#toolbar=0&navpanes=0&scrollbar=1`,title:c,className:"mt-2 w-full h-72 rounded-lg border",style:{borderColor:"var(--color-border)",background:"white"}})}function l({text:a,fieldType:b,showUrlFavicon:c=!1,linkInteractionMode:e="inline",isTableMode:j=!1}){let k=a.trim();if(!k)return(0,d.jsx)(d.Fragment,{children:a});let l=b&&"text"!==b&&"richtext"!==b?b:void 0,m=(0,f.KJ)(k,l);if("link"===m.kind&&m.href){if(!l&&"file"===m.linkType&&k.includes(" "))return(0,d.jsx)(d.Fragment,{children:m.text});let a="url"===m.linkType||"file"===m.linkType,b=c&&"url"===m.linkType&&!!m.faviconUrl;if("button"===e){let c=(0,d.jsxs)("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1.5 align-middle",style:{color:"var(--color-accent)"},children:[b&&(0,d.jsx)(g.A,{src:m.faviconUrl}),(0,d.jsx)("span",{className:j?"min-w-0 truncate":"min-w-0 break-all",children:m.text}),(0,d.jsx)(h.x,{href:m.href,openInNewTab:a,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm hover:bg-black/5"})]});return"url"===m.linkType?(0,d.jsx)(i.k,{href:m.href,children:c}):c}return(0,d.jsx)(i.U,{href:m.href,text:m.text,linkType:m.linkType??"url",faviconUrl:m.faviconUrl,showFavicon:b})}return"number"===m.kind||"currency"===m.kind?(0,d.jsx)("span",{className:"tabular-nums",children:m.text}):(0,d.jsx)(d.Fragment,{children:m.text})}function m({value:a,fieldType:b,mode:c="table",className:m,showUrlFavicon:n=!1,linkInteractionMode:o="inline"}){let p=(0,f.KJ)(a,b),q="table"===c;if("empty"===p.kind)return(0,d.jsx)(j,{});let r=p.text.replace(/\\r\\n/g,"\n").replace(/\\n/g,"\n").replace(/\\r/g,"\n");if(r.includes("\n")){let a=r.split("\n"),c=m??(q?"block max-w-[300px] line-clamp-3":"break-words");return(0,d.jsx)("span",{className:c,children:a.map((a,c)=>(0,d.jsxs)(e.Fragment,{children:[c>0&&(0,d.jsx)("br",{}),(0,d.jsx)(l,{text:a,fieldType:b,showUrlFavicon:n,linkInteractionMode:o,isTableMode:q})]},c))})}let s=m??(q?"truncate block max-w-[300px]":"break-words");if("link"===p.kind&&p.href){let a="url"===p.linkType||"file"===p.linkType,b=!q&&!!p.embedUrl&&!!p.mediaType,c=n&&"url"===p.linkType&&!!p.faviconUrl;if("button"===o){let e=(0,d.jsxs)("div",{className:q?"block max-w-[300px]":"w-full",children:[(0,d.jsxs)("span",{className:"flex w-full min-w-0 items-center gap-1.5",style:{color:"var(--color-accent)"},children:[c&&(0,d.jsx)(g.A,{src:p.faviconUrl}),(0,d.jsx)("span",{className:q?"min-w-0 truncate":"min-w-0 break-all",children:p.text}),(0,d.jsx)(h.x,{href:p.href,openInNewTab:a})]}),b&&(0,d.jsx)(k,{mediaType:p.mediaType,url:p.embedUrl,label:p.text})]});return"url"===p.linkType?(0,d.jsx)(i.k,{href:p.href,children:e}):e}return(0,d.jsxs)("div",{className:q?"block max-w-[300px]":"w-full",children:[(0,d.jsx)(i.U,{href:p.href,text:p.text,linkType:p.linkType??"url",faviconUrl:p.faviconUrl,showFavicon:c,layout:"block",className:q?"truncate":""}),b&&(0,d.jsx)(k,{mediaType:p.mediaType,url:p.embedUrl,label:p.text})]})}return"number"===p.kind||"currency"===p.kind?(0,d.jsx)("span",{className:`tabular-nums ${s}`,children:p.text}):(0,d.jsx)("span",{className:s,children:r})}},685233:(a,b,c)=>{"use strict";c.d(b,{X:()=>a6,S:()=>a7});var d=c(736927),e=c(115962),f=c(213505),g=c(492081),h=c(755726),i=c(922123),j=c(478105),k=c(363269),l=c(515016),m=c(558287),n=c(631608),o=c(846069),p=c(744277),q=c(68200),r=c(316780),s=c(398367),t=c(405287),u=c(587464),v=c(173961),w=c(760687),x=c(840512);let y=e.createContext(void 0),z=e.createContext(void 0),A=e.createContext(void 0),B=e.createContext("");function C(){let a=e.useContext(y);if(!a)throw Error((0,x.A)(22));return a}function D(){let a=e.useContext(z);if(!a)throw Error((0,x.A)(23));return a}function E(){let a=e.useContext(A);if(!a)throw Error((0,x.A)(24));return a}var F=c(569869);let G=(a,b)=>Object.is(a,b);function H(a,b,c){return null==a||null==b?Object.is(a,b):c(a,b)}function I(a,b,c){return a&&0!==a.length?a.findIndex(a=>void 0!==a&&H(a,b,c)):-1}function J(a){if(null==a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function K(a){return null!=a&&a.length>0&&"object"==typeof a[0]&&null!=a[0]&&"items"in a[0]}function L(a,b){if(b&&null!=a)return b(a)??"";if(a&&"object"==typeof a){if("label"in a&&null!=a.label)return String(a.label);if("value"in a)return String(a.value)}return J(a)}function M(a,b){return b&&null!=a?b(a)??"":a&&"object"==typeof a&&"value"in a&&"label"in a?J(a.value):J(a)}let N={id:(0,F.M)(a=>a.id),query:(0,F.M)(a=>a.query),items:(0,F.M)(a=>a.items),selectedValue:(0,F.M)(a=>a.selectedValue),hasSelectionChips:(0,F.M)(a=>{let b=a.selectedValue;return Array.isArray(b)&&b.length>0}),hasSelectedValue:(0,F.M)(a=>{let{selectedValue:b,selectionMode:c}=a;return null!=b&&(!("multiple"===c&&Array.isArray(b))||b.length>0)}),hasNullItemLabel:(0,F.M)((a,b)=>!!b&&function(a){if(!Array.isArray(a))return null!=a&&!("null"in a);if(K(a)){for(let b of a)for(let a of b.items)if(a&&null==a.value&&null!=a.label)return!0;return!1}for(let b of a)if(b&&null==b.value&&null!=b.label)return!0;return!1}(a.items)),open:(0,F.M)(a=>a.open),mounted:(0,F.M)(a=>a.mounted),forceMounted:(0,F.M)(a=>a.forceMounted),inline:(0,F.M)(a=>a.inline),activeIndex:(0,F.M)(a=>a.activeIndex),selectedIndex:(0,F.M)(a=>a.selectedIndex),isActive:(0,F.M)((a,b)=>a.activeIndex===b),isSelected:(0,F.M)((a,b)=>{let c=a.isItemEqualToValue,d=a.selectedValue;return Array.isArray(d)?d.some(a=>H(b,a,c)):H(b,d,c)}),transitionStatus:(0,F.M)(a=>a.transitionStatus),popupProps:(0,F.M)(a=>a.popupProps),inputProps:(0,F.M)(a=>a.inputProps),triggerProps:(0,F.M)(a=>a.triggerProps),getItemProps:(0,F.M)(a=>a.getItemProps),positionerElement:(0,F.M)(a=>a.positionerElement),listElement:(0,F.M)(a=>a.listElement),triggerElement:(0,F.M)(a=>a.triggerElement),inputElement:(0,F.M)(a=>a.inputElement),popupSide:(0,F.M)(a=>a.popupSide),openMethod:(0,F.M)(a=>a.openMethod),inputInsidePopup:(0,F.M)(a=>a.inputInsidePopup),selectionMode:(0,F.M)(a=>a.selectionMode),listRef:(0,F.M)(a=>a.listRef),labelsRef:(0,F.M)(a=>a.labelsRef),popupRef:(0,F.M)(a=>a.popupRef),emptyRef:(0,F.M)(a=>a.emptyRef),inputRef:(0,F.M)(a=>a.inputRef),keyboardActiveRef:(0,F.M)(a=>a.keyboardActiveRef),chipsContainerRef:(0,F.M)(a=>a.chipsContainerRef),clearRef:(0,F.M)(a=>a.clearRef),valuesRef:(0,F.M)(a=>a.valuesRef),allValuesRef:(0,F.M)(a=>a.allValuesRef),name:(0,F.M)(a=>a.name),disabled:(0,F.M)(a=>a.disabled),readOnly:(0,F.M)(a=>a.readOnly),required:(0,F.M)(a=>a.required),grid:(0,F.M)(a=>a.grid),isGrouped:(0,F.M)(a=>a.isGrouped),virtualized:(0,F.M)(a=>a.virtualized),onOpenChangeComplete:(0,F.M)(a=>a.onOpenChangeComplete),openOnInputClick:(0,F.M)(a=>a.openOnInputClick),itemToStringLabel:(0,F.M)(a=>a.itemToStringLabel),isItemEqualToValue:(0,F.M)(a=>a.isItemEqualToValue),modal:(0,F.M)(a=>a.modal),autoHighlight:(0,F.M)(a=>a.autoHighlight),submitOnItemClick:(0,F.M)(a=>a.submitOnItemClick)};var O=c(230652),P=c(577225);let Q=function(a){return a.disabled="data-disabled",a.valid="data-valid",a.invalid="data-invalid",a.touched="data-touched",a.dirty="data-dirty",a.filled="data-filled",a.focused="data-focused",a}({}),R=e.createContext({invalid:void 0,name:void 0,validityData:{state:{badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},errors:[],error:"",value:"",initialValue:null},setValidityData:P.tE,disabled:void 0,touched:!1,setTouched:P.tE,dirty:!1,setDirty:P.tE,filled:!1,setFilled:P.tE,focused:!1,setFocused:P.tE,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(a=P.t0)=>a,getInputValidationProps:(a=P.t0)=>a,inputRef:{current:null},commit:async()=>{}}});function S(a=!0){let b=e.useContext(R);if(b.setValidityData===P.tE&&!a)throw Error((0,x.A)(28));return b}var T=c(249855);let U=e.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:P.tE,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function V(){return e.useContext(U)}var W=c(725427),X=c(840507);let Y=e.createContext({controlId:void 0,registerControlId:P.tE,labelId:void 0,setLabelId:P.tE,messageIds:[],setMessageIds:P.tE,getDescriptionProps:a=>a});function Z(){return e.useContext(Y)}let _=new Map;var aa=c(735328),ab=c(192083);function ac(a,b){let c=e.useRef(a),d=(0,i.K)(b);(0,g.g)(()=>{c.current!==a&&d(c.current)},[a,d]),(0,g.g)(()=>{c.current=a},[a])}let ad=Symbol("none"),ae={value:ad,index:-1};function af(a){let b,c,x,{id:C,onOpenChangeComplete:D,defaultSelectedValue:E=null,selectedValue:F,onSelectedValueChange:J,defaultInputValue:Q,inputValue:R,selectionMode:U="none",onItemHighlighted:Y,name:af,disabled:ag=!1,readOnly:ah=!1,required:ai=!1,inputRef:aj,grid:ak=!1,items:al,filteredItems:am,filter:an,openOnInputClick:ao=!0,autoHighlight:ap=!1,keepHighlight:aq=!1,highlightItemOnHover:ar=!0,loopFocus:as=!0,itemToStringLabel:at,itemToStringValue:au,isItemEqualToValue:av=G,virtualized:aw=!1,inline:ax=!1,fillInputOnItemPress:ay=!0,modal:az=!1,limit:aA=-1,autoComplete:aB="list",formAutoComplete:aC,locale:aD,submitOnItemClick:aE=!1}=a,{clearErrors:aF}=V(),{setDirty:aG,validityData:aH,shouldValidateOnChange:aI,setFilled:aJ,name:aK,disabled:aL,setTouched:aM,setFocused:aN,validationMode:aO,validation:aP}=S(),aQ=function(a={}){let{id:b,implicit:c=!1,controlRef:d}=a,{controlId:f,registerControlId:h}=Z(),j=(0,X.e)(b),k=c?f:void 0,m=(0,l.j)(()=>Symbol("labelable-control")),n=e.useRef(!1),o=e.useRef(null!=b),p=(0,i.K)(()=>{n.current&&h!==P.tE&&(n.current=!1,h(m.current,void 0))});return(0,g.g)(()=>{let a;if(h!==P.tE){if(c){let c=d?.current;a=(0,W.vq)(c)&&null!=c.closest("label")?b??null:k??j}else if(null!=b)o.current=!0,a=b;else{if(!o.current)return void p();a=j}if(void 0===a)return void p();n.current=!0,h(m.current,a)}},[b,d,k,h,c,j,m,p]),e.useEffect(()=>p,[p]),f??j}({id:C}),aR=function(a={}){let b={usage:"search",sensitivity:"base",ignorePunctuation:!0,...a},c=`${function a(b){return Array.isArray(b)?b.map(b=>a(b)).join(","):null==b?"":String(b)}(a.locale)}|${JSON.stringify(b)}`,d=_.get(c);if(d)return d;let e=new Intl.Collator(a.locale,b),f={contains(a,b,c){if(!b)return!0;let d=L(a,c);for(let a=0;a<=d.length-b.length;a+=1)if(0===e.compare(d.slice(a,a+b.length),b))return!0;return!1},startsWith(a,b,c){if(!b)return!0;let d=L(a,c);return 0===e.compare(d.slice(0,b.length),b)},endsWith(a,b,c){if(!b)return!0;let d=L(a,c),f=b.length;return d.length>=f&&0===e.compare(d.slice(d.length-f),b)}};return _.set(c,f),f}({locale:aD}),[aS,aT]=e.useState(!1),[aU,aV]=e.useState(null),aW=e.useRef([]),aX=e.useRef([]),aY=e.useRef(null),aZ=e.useRef(null),a$=e.useRef(null),a_=e.useRef(!0),a0=e.useRef(!1),a1=e.useRef(null),a2=e.useRef(null),a3=e.useRef(null),a4=e.useRef(ae),a5=e.useRef(null),a6=e.useRef([]),a7=e.useRef([]),a8=aL||ag,a9=aK??af,ba="multiple"===U,bb="single"===U,bc=void 0!==R||void 0!==Q,bd=void 0!==al,be=void 0!==am;b="always"===ap?"always":!!ap&&"input-change";let[bf,bg]=(0,f.q)({controlled:F,default:ba?E??P.Ml:E,name:"Combobox",state:"selectedValue"}),bh=e.useMemo(()=>null===an?()=>!0:void 0!==an?an:bb&&!aS?(a,b)=>{if(null==a)return!1;if(!b)return!0;let c=L(a,at),d=null!=bf?L(bf,at):"";return!!(d&&aR.contains(d,b))&&d.length===b.length||aR.contains(c,b)}:(a,b)=>{if(null==a)return!1;let c=L(a,at);return aR.contains(c,b)},[an,bb,bf,aS,aR,at]),bi=(0,l.j)(()=>bc?Q??"":bb?L(bf,at):"").current,[bj,bk]=(0,f.q)({controlled:R,default:bi,name:"Combobox",state:"inputValue"}),[bl,bm]=(0,f.q)({controlled:a.open,default:a.defaultOpen,name:"Combobox",state:"open"}),bn=K(al),bo=aU??(""===bj?"":String(bj).trim()),bp=bb?L(bf,at):"",bq=bb&&!aS&&""!==bo&&""!==bp&&bp.length===bo.length&&aR.contains(bp,bo),br=bq?"":bo,bs=bd&&be&&bq,bt=e.useMemo(()=>al?bn?al.flatMap(a=>a.items):al:P.Ml,[al,bn]),bu=e.useMemo(()=>{if(am&&!bs)return am;if(!al)return P.Ml;if(bn){let a=[],b=0;for(let c of al){if(aA>-1&&b>=aA)break;let d=""===br?c.items:c.items.filter(a=>bh(a,br,at));if(0===d.length)continue;let e=aA>-1?aA-b:1/0,f=d.slice(0,e);if(f.length>0){let d={...c,items:f};a.push(d),b+=f.length}}return a}if(""===br)return aA>-1?bt.slice(0,aA):bt;let a=[];for(let b of bt){if(aA>-1&&a.length>=aA)break;bh(b,br,at)&&a.push(b)}return a},[am,bs,al,bn,br,aA,bh,at,bt]),bv=e.useMemo(()=>bn?bu.flatMap(a=>a.items):bu,[bu,bn]),bw=(0,l.j)(()=>new m.i({id:aQ,selectedValue:bf,open:bl,filter:bh,query:bo,items:al,selectionMode:U,listRef:aW,labelsRef:aX,popupRef:aY,emptyRef:a$,inputRef:aZ,keyboardActiveRef:a_,chipsContainerRef:a1,clearRef:a2,valuesRef:a6,allValuesRef:a7,selectionEventRef:a3,name:a9,disabled:a8,readOnly:ah,required:ai,grid:ak,isGrouped:bn,virtualized:aw,openOnInputClick:ao,itemToStringLabel:at,isItemEqualToValue:av,modal:az,autoHighlight:b,submitOnItemClick:aE,hasInputValue:bc,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:ax,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:D||P.tE,setOpen:P.tE,setInputValue:P.tE,setSelectedValue:P.tE,setIndices:P.tE,onItemHighlighted:P.tE,handleSelection:P.tE,getItemProps:()=>P.t0,forceMount:P.tE,requestSubmit:P.tE})).current,bx="none"===U?bj:bf,by=e.useMemo(()=>"none"===U?bx:Array.isArray(bf)?bf.map(a=>M(a,au)):M(bf,au),[bx,au,U,bf]),bz=(0,i.K)(Y),bA=(0,i.K)(D),bB=(0,n.P)(bw,N.activeIndex),bC=(0,n.P)(bw,N.selectedIndex),bD=(0,n.P)(bw,N.positionerElement),bE=(0,n.P)(bw,N.listElement),bF=(0,n.P)(bw,N.triggerElement),bG=(0,n.P)(bw,N.inputElement),bH=(0,n.P)(bw,N.inline),bI=(0,n.P)(bw,N.inputInsidePopup),bJ=(0,o.u)(bF),{mounted:bK,setMounted:bL,transitionStatus:bM}=(0,aa.$)(bl),{openMethod:bN,triggerProps:bO,reset:bP}=(0,ab.G)(bl);!function(a){let{enabled:b=!0,value:c,id:d,name:e,controlRef:f,commit:h}=a,{formRef:j}=V(),{invalid:k,markedDirtyRef:l,validityData:m,setValidityData:n}=S(),o=(0,i.K)(a.getValue);(0,g.g)(()=>{if(!b)return;let a=c;void 0===a&&(a=o()),null===m.initialValue&&null!==a&&n(b=>({...b,initialValue:a}))},[b,n,c,m.initialValue,o]),(0,g.g)(()=>{b&&d&&j.current.fields.set(d,{getValue:o,name:e,controlRef:f,validityData:{...m,state:{...m.state,valid:!k&&m.state.valid}},validate(a=!0){let b=c;void 0===b&&(b=o()),l.current=!0,a?T.flushSync(()=>h(b)):h(b)}})},[h,f,b,j,o,d,k,l,e,m,c]),(0,g.g)(()=>{let a=j.current.fields;return()=>{d&&a.delete(d)}},[j,d])}({id:aQ,name:a9,commit:aP.commit,value:bx,controlRef:bI?bJ:aZ,getValue:()=>by});let bQ=(0,i.K)(()=>{al?aX.current=bv.map(a=>L(a,at)):bw.set("forceMounted",!0)}),bR=e.useRef(bf);(0,g.g)(()=>{bf!==bR.current&&bQ()},[bQ,bf]);let bS=(0,i.K)(a=>{bw.update(a);let b=a.type||"none";if(void 0!==a.activeIndex)if(null===a.activeIndex)a4.current!==ae&&(a4.current=ae,bz(void 0,(0,v.M)(b,void 0,{index:-1})));else{let c=a6.current[a.activeIndex];a4.current={value:c,index:a.activeIndex},bz(c,(0,v.M)(b,void 0,{index:a.activeIndex}))}}),bT=(0,i.K)((c,d)=>{if(a0.current=d.reason===w.qs,a.onInputValueChange?.(c,d),!d.isCanceled){if(d.reason===w.pf){let a=d.event,e=a.inputType;if("compositionend"===a.type||null!=e&&""!==e&&"insertReplacementText"!==e){let a=""!==c.trim();a&&aT(!0),a5.current={hasQuery:a},a&&b&&null==bw.state.activeIndex&&bw.set("activeIndex",0)}}bk(c)}}),bU=(0,i.K)((b,c)=>{if(bl!==b&&("escape-key"===c.reason&&bd&&0===bv.length&&!bw.state.emptyRef.current&&c.allowPropagation(),a.onOpenChange?.(b,c),!c.isCanceled&&(!b&&aS&&(bb?(bH||aV(bo),""===bo&&aT(!1)):ba&&(bH||bI?bS({activeIndex:null}):aV(bo),bT("",(0,v.d)(w.qs,c.event)))),bm(b),!b&&bI&&(c.reason===w.Xn||c.reason===w.Np))&&(aM(!0),aN(!1),"onBlur"===aO))){let a="none"===U?bj:bf;aP.commit(a)}}),bV=(0,i.K)((a,b)=>{J?.(a,b),!b.isCanceled&&(bg(a),("none"===U&&aY.current&&ay||bb&&!bw.state.inputInsidePopup)&&bT(L(a,at),(0,v.d)(b.reason,b.event)),bb&&null!=a&&b.reason!==w.pf&&aS&&!bH&&aV(bo))}),bW=(0,i.K)((a,b)=>{let c=b;if(void 0===c){if(null===bB)return;c=a6.current[bB]}let d=(0,u.EW)(a),e=a3.current??a;a3.current=null;let f=(0,v.d)(w.Bo,e),g=d?.closest("a")?.getAttribute("href");if(g){g.startsWith("#")&&bU(!1,f);return}if(ba){var h,i,j,k;let a=Array.isArray(bf)?bf:[];if(bV((h=c,i=bw.state.isItemEqualToValue,a&&0!==a.length&&a.some(a=>void 0!==a&&H(h,a,i)))?(j=c,k=bw.state.isItemEqualToValue,a.filter(a=>!H(j,a,k))):[...a,c],f),!(aZ.current&&""!==aZ.current.value.trim()))return;bw.state.inputInsidePopup?bT("",(0,v.d)(w.qs,f.event)):bU(!1,f)}else bV(c,f),bU(!1,f)}),bX=(0,i.K)(()=>{if(!bw.state.submitOnItemClick)return;let a=bw.state.inputElement?.form;a&&"function"==typeof a.requestSubmit&&a.requestSubmit()}),bY=(0,i.K)(()=>{if(bL(!1),bA?.(!1),aT(!1),bP(),aV(null),"none"===U?bS({activeIndex:null,selectedIndex:null}):bS({activeIndex:null}),ba&&aZ.current&&""!==aZ.current.value&&!a0.current&&bT("",(0,v.d)(w.qs)),bb)if(bw.state.inputInsidePopup)aZ.current&&""!==aZ.current.value&&bT("",(0,v.d)(w.qs));else{let a=L(bf,at);if(aZ.current&&aZ.current.value!==a){let b=""===a?w.qs:w.dv;bT(a,(0,v.d)(b))}}}),bZ=e.useMemo(()=>bH&&bD?{current:bD.closest('[role="dialog"]')}:aY,[bH,bD]);(0,O.v)({enabled:!a.actionsRef,open:bl,ref:bZ,onComplete(){bl||bY()}}),e.useImperativeHandle(a.actionsRef,()=>({unmount:bY}),[bY]),(0,g.g)(function(){if(bl||"none"===U)return;let a=al?bt:a7.current;if(ba){let b=Array.isArray(bf)?bf:[],c=I(a,b[b.length-1],av);bS({selectedIndex:-1===c?null:c})}else{let b=I(a,bf,av);bS({selectedIndex:-1===b?null:b})}},[bl,bf,al,U,bt,ba,av,bS]),(0,g.g)(()=>{al&&(a6.current=bv,aW.current.length=bv.length)},[al,bv]),(0,g.g)(()=>{let a=a5.current;if(a&&(a.hasQuery?b&&bw.set("activeIndex",0):"always"===b&&bw.set("activeIndex",0),a5.current=null),!bl&&!bH)return;let c=bd||be?bv:a6.current,d=bw.state.activeIndex;if(null==d)return"always"===b&&c.length>0?void bw.set("activeIndex",0):void(a4.current!==ae&&(a4.current=ae,bw.state.onItemHighlighted(void 0,(0,v.M)(w.dv,void 0,{index:-1}))));if(d>=c.length){a4.current!==ae&&(a4.current=ae,bw.state.onItemHighlighted(void 0,(0,v.M)(w.dv,void 0,{index:-1}))),bw.set("activeIndex",null);return}let e=c[d],f=a4.current.value,g=f!==ad&&H(e,f,bw.state.isItemEqualToValue);a4.current.index===d&&g||(a4.current={value:e,index:d},bw.state.onItemHighlighted(e,(0,v.M)(w.dv,void 0,{index:d})))},[bB,b,be,bd,bv,bH,bl,bw]),(0,g.g)(()=>{if("none"===U)return void aJ(""!==String(bj));aJ(ba?Array.isArray(bf)&&bf.length>0:null!=bf)},[aJ,U,bj,bf,ba]),e.useEffect(()=>{bd&&b&&0===bv.length&&bS({activeIndex:null})},[bd,b,bv.length,bS]),ac(bo,()=>{bl&&""!==bo&&bo!==String(bi)&&aT(!0)}),ac(bf,()=>{if("none"!==U&&(aF(a9),aG(bf!==aH.initialValue),aI()?aP.commit(bf):aP.commit(bf,!0),bb&&!bc&&!bI)){let a=L(bf,at);bj!==a&&bT(a,(0,v.d)(w.dv))}}),ac(bj,()=>{"none"===U&&(aF(a9),aG(bj!==aH.initialValue),aI()?aP.commit(bj):aP.commit(bj,!0))}),ac(al,()=>{if(!bb||bc||bI||aS)return;let a=L(bf,at);bj!==a&&bT(a,(0,v.d)(w.dv))});let b$=(0,p.P)({open:!!bH||bl,onOpenChange:bU,elements:{reference:bI?bF:bG,floating:bD}});bH||(c=ak?"grid":"listbox",x=bl?"true":"false");let b_=e.useMemo(()=>{let a=bG?.tagName==="INPUT",b=a||bl,d=a?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return b&&(d.role="combobox",d["aria-expanded"]=x,d["aria-haspopup"]=c,d["aria-controls"]=bl?bE?.id:void 0,d["aria-autocomplete"]=aB),{reference:d,floating:{role:"presentation"}}},[bG,bl,x,c,bE?.id,aB]),b0=(0,q.k)(b$,{enabled:!ah&&!a8&&ao,event:"mousedown-only",toggle:!1,touchOpenDelay:50*!bI,reason:w._J}),b1=(0,r.s)(b$,{enabled:!ah&&!a8&&!bH,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:!!bH||void 0,outsidePress(a){let b=(0,u.EW)(a);return!(0,u.gR)(bF,b)&&!(0,u.gR)(a2.current,b)&&!(0,u.gR)(a1.current,b)}}),b2=(0,s.C)(b$,{enabled:!ah&&!a8,id:aQ,listRef:aW,activeIndex:bB,selectedIndex:bC,virtual:!0,loopFocus:as,allowEscape:as&&!b,focusItemOnOpen:!aS&&("none"!==U||!!b)&&"auto",focusItemOnHover:ar,resetOnPointerLeave:!aq,cols:ak?2:1,orientation:ak?"horizontal":void 0,disabledIndices:P.Ml,onNavigate(a,b){(b||bl)&&"ending"!==bM&&(b?bS({activeIndex:a,type:a_.current?"keyboard":"pointer"}):bS({activeIndex:a}))}}),{getReferenceProps:b3,getFloatingProps:b4,getItemProps:b5}=(0,t.b)([b_,b0,b1,b2]);(0,h.j)(()=>{bw.update({inline:ax,popupProps:b4(),inputProps:b3(),triggerProps:bO,getItemProps:b5,setOpen:bU,setInputValue:bT,setSelectedValue:bV,setIndices:bS,onItemHighlighted:bz,handleSelection:bW,forceMount:bQ,requestSubmit:bX})}),(0,g.g)(()=>{bw.update({id:aQ,selectedValue:bf,open:bl,mounted:bK,transitionStatus:bM,items:al,inline:ax,popupProps:b4(),inputProps:b3(),triggerProps:bO,openMethod:bN,getItemProps:b5,selectionMode:U,name:a9,disabled:a8,readOnly:ah,required:ai,grid:ak,isGrouped:bn,virtualized:aw,onOpenChangeComplete:bA,openOnInputClick:ao,itemToStringLabel:at,modal:az,autoHighlight:b,isItemEqualToValue:av,submitOnItemClick:aE,hasInputValue:bc,requestSubmit:bX})},[bw,aQ,bf,bl,bK,bM,al,b4,b3,b5,bN,bO,U,a9,a8,ah,ai,aP,ak,bn,aw,bA,ao,at,az,av,aE,bc,ax,bX,b]);let b6=(0,j.a)(aj,aP.inputRef),b7=e.useMemo(()=>({query:bo,hasItems:bd,filteredItems:bu,flatFilteredItems:bv}),[bo,bd,bu,bv]),b8=e.useMemo(()=>Array.isArray(bx)?"":M(bx,au),[bx,au]),b9=ba&&Array.isArray(bf)&&bf.length>0,ca=ba||"none"===U?void 0:a9,cb=e.useMemo(()=>ba&&Array.isArray(bf)&&a9?bf.map(a=>{let b=M(a,au);return(0,d.jsx)("input",{type:"hidden",name:a9,value:b},b)}):null,[ba,bf,a9,au]),cc=(0,d.jsxs)(e.Fragment,{children:[a.children,(0,d.jsx)("input",{...aP.getInputValidationProps({onFocus(){if(bI)return void bF?.focus();(aZ.current||bF)?.focus()},onChange(a){if(a.nativeEvent.defaultPrevented)return;let b=a.target.value,c=(0,v.d)(w.dv,a.nativeEvent);function d(){if(ba)return;if("none"===U){aG(b!==aH.initialValue),bT(b,c),aI()&&aP.commit(b);return}let a=a6.current.find(a=>M(a,au).toLowerCase()===b.toLowerCase());null!=a&&(aG(a!==aH.initialValue),bV?.(a,c),aI()&&aP.commit(a))}al?d():(bQ(),queueMicrotask(d))}}),id:aQ&&null==ca?`${aQ}-hidden-input`:void 0,name:ca,autoComplete:aC,disabled:a8,required:ai&&!b9,readOnly:ah,value:b8,ref:b6,style:ca?k.a:k.Q,tabIndex:-1,"aria-hidden":!0}),cb]});return(0,d.jsx)(y.Provider,{value:bw,children:(0,d.jsx)(z.Provider,{value:b$,children:(0,d.jsx)(A.Provider,{value:b7,children:(0,d.jsx)(B.Provider,{value:bj,children:cc})})})})}var ag=c(504745),ah=c(577979),ai=c(654277);let aj={...ai.jL,valid:a=>null===a?null:a?{[Q.valid]:""}:{[Q.invalid]:""},popupSide:a=>a?{"data-popup-side":a}:null,listEmpty:a=>a?{"data-list-empty":""}:null},ak=e.createContext(void 0);var al=c(20960);let am=e.createContext(void 0);function an(a){let b=e.useContext(am);if(void 0===b&&!a)throw Error((0,x.A)(21));return b}var ao=c(729406);let ap=e.forwardRef(function(a,b){let{render:c,className:d,disabled:f=!1,id:g,...h}=a,{state:j,disabled:k,setTouched:l,setFocused:m,validationMode:o,validation:p}=S(),{labelId:q}=Z(),r=e.useContext(ak),s=!!an(!0),t=C(),{filteredItems:u}=E(),x=e.useContext(B),y=(0,ao.j)(),z=(0,n.P)(t,N.required),A=(0,n.P)(t,N.disabled),D=(0,n.P)(t,N.readOnly),F=(0,n.P)(t,N.name),G=(0,n.P)(t,N.selectionMode),H=(0,n.P)(t,N.autoHighlight),I=(0,n.P)(t,N.inputProps),J=(0,n.P)(t,N.triggerProps),K=(0,n.P)(t,N.open),L=(0,n.P)(t,N.mounted),M=(0,n.P)(t,N.selectedValue),O=(0,n.P)(t,N.popupSide),P=(0,n.P)(t,N.positionerElement),Q=(0,n.P)(t,N.id),R=(0,n.P)(t,N.inline),T=!!H,U=k||A||f,V=0===u.length,W=s||R,Y=(0,X.e)(g??(W?void 0:Q)),[_,aa]=e.useState(null),ab=e.useRef(!1),ac=e.useRef(null),ad=e.useRef(!1),ae=(0,i.K)(a=>{let b=s||t.state.inline;b&&!t.state.hasInputValue&&t.state.setInputValue("",(0,v.d)(w.dv)),t.update({inputElement:a,inputInsidePopup:b})}),af={...j,open:K,disabled:U,readOnly:D,popupSide:L&&P?O:null,listEmpty:V};return(0,ah.o)("input",a,{state:af,ref:[b,t.state.inputRef,ae],props:[I,J,{type:"text",value:a.value??_??x,"aria-readonly":D||void 0,"aria-required":z||void 0,"aria-labelledby":q,disabled:U,readOnly:D,required:"none"===G?z:void 0,..."none"===G&&F&&{name:F},id:Y,onFocus(){if(m(!0),!R||!ad.current)return;ad.current=!1;let a=ac.current;null!=a&&Object.hasOwn(t.state.valuesRef.current,a)&&t.state.setIndices({activeIndex:a})},onBlur(){l(!0),m(!1);let a=t.state.activeIndex;if(R&&null!==a&&"always"!==H&&(ac.current=a,ad.current=!0,t.state.setIndices({activeIndex:null})),"onBlur"===o){let a="none"===G?x:M;p.commit(a)}},onCompositionStart(a){ag.m0||(ab.current=!0,aa(a.currentTarget.value))},onCompositionEnd(a){ab.current=!1;let b=a.currentTarget.value;aa(null),t.state.setInputValue(b,(0,v.d)(w.pf,a.nativeEvent))},onChange(a){let b=a.nativeEvent.inputType,c=ab.current||!(!b||"insertReplacementText"===b);if(ab.current){let b=a.currentTarget.value;aa(b),""!==b||t.state.openOnInputClick||t.state.inputInsidePopup||t.state.setOpen(!1,(0,v.d)(w.qs,a.nativeEvent));let d=b.trim();!D&&!U&&d&&c&&(t.state.setOpen(!0,(0,v.d)(w.pf,a.nativeEvent)),T||t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&null!==t.state.activeIndex&&!(T&&""!==d)&&t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"});return}t.state.setInputValue(a.currentTarget.value,(0,v.d)(w.pf,a.nativeEvent));let d=""===a.currentTarget.value,e=(0,v.d)(w.qs,a.nativeEvent);d&&!t.state.inputInsidePopup&&("single"===G&&t.state.setSelectedValue(null,e),t.state.openOnInputClick||t.state.setOpen(!1,e));let f=a.currentTarget.value.trim();!D&&!U&&f&&c&&(t.state.setOpen(!0,(0,v.d)(w.pf,a.nativeEvent)),T||t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&null!==t.state.activeIndex&&!T&&t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(a){if(U||D||a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)return;t.state.keyboardActiveRef.current=!0;let b=a.currentTarget,c=b.scrollWidth-b.clientWidth,d="rtl"===y;if("Home"===a.key){(0,al.jo)(a);let c=ag.gm&&d?b.value.length:0;b.setSelectionRange(c,c),b.scrollLeft=0;return}if("End"===a.key){(0,al.jo)(a);let e=ag.gm&&d?0:b.value.length;b.setSelectionRange(e,e),b.scrollLeft=d?-c:c;return}if(!L&&"Escape"===a.key){let b="multiple"===G&&Array.isArray(M)?0===M.length:null===M,c=(0,v.d)(w.jv,a.nativeEvent);t.state.setInputValue("",c),t.state.setSelectedValue("multiple"===G?[]:null,c),b||t.state.inline||c.isPropagationAllowed||a.stopPropagation();return}if(r&&"Backspace"===a.key&&""===b.value&&void 0===r.highlightedChipIndex&&Array.isArray(M)&&M.length>0){let b=M.slice(0,-1);t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"}),t.state.setSelectedValue(b,(0,v.d)(w.dv,a.nativeEvent));return}let e=r?.highlightedChipIndex!==void 0,f=function(a){let b;if(!r)return;let{highlightedChipIndex:c}=r;if(void 0!==c){if("ArrowLeft"===a.key)a.preventDefault(),b=c>0?c-1:void 0;else if("ArrowRight"===a.key)a.preventDefault(),b=c<M.length-1?c+1:void 0;else if("Backspace"===a.key||"Delete"===a.key){a.preventDefault();let d=c>=M.length-1?M.length-2:c;b=d>=0?d:void 0,t.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return b}return"ArrowLeft"===a.key&&(a.currentTarget.selectionStart??0)===0&&M.length>0?(a.preventDefault(),b=Math.max(M.length-1,0)):"Backspace"===a.key&&""===a.currentTarget.value&&M.length>0&&(t.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),a.preventDefault()),b}(a);if(r?.setHighlightedChipIndex(f),void 0!==f?r?.chipsRef.current[f]?.focus():e&&t.state.inputRef.current?.focus(),229!==a.which&&"Enter"===a.key&&K){let b=t.state.activeIndex,c=a.nativeEvent;if(null===b)return void t.state.setOpen(!1,(0,v.d)(w.dv,c));(0,al.jo)(a);let d=t.state.listRef.current[b];d&&(t.state.selectionEventRef.current=c,d.click(),t.state.selectionEventRef.current=null)}},onPointerMove(){t.state.keyboardActiveRef.current=!1},onPointerDown(){t.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(h):h],stateAttributesMapping:aj})});var aq=c(402831);let ar=e.createContext(void 0),as=e.forwardRef(function(a,b){let{keepMounted:c=!1,...e}=a,f=C(),g=(0,n.P)(f,N.mounted),h=(0,n.P)(f,N.forceMounted);return g||c||h?(0,d.jsx)(ar.Provider,{value:c,children:(0,d.jsx)(aq.XF,{ref:b,...e})}):null});var at=c(640023),au=c(568069),av=c(275819),aw=c(293863),ax=c(994152),ay=c(929035);let az=e.forwardRef(function(a,b){let{render:c,className:f,anchor:h,positionMethod:j="absolute",side:k="bottom",align:l="center",sideOffset:m=0,alignOffset:o=0,collisionBoundary:p="clipping-ancestors",collisionPadding:q=5,arrowPadding:r=5,sticky:s=!1,disableAnchorTracking:t=!1,collisionAvoidance:u=aw.uD,...v}=a,w=C(),{filteredItems:y}=E(),z=D(),A=function(){let a=e.useContext(ar);if(void 0===a)throw Error((0,x.A)(20));return a}(),B=(0,n.P)(w,N.modal),F=(0,n.P)(w,N.open),G=(0,n.P)(w,N.mounted),H=(0,n.P)(w,N.openMethod),I=(0,n.P)(w,N.triggerElement),J=(0,n.P)(w,N.inputElement),K=(0,n.P)(w,N.inputInsidePopup),L=(0,n.P)(w,N.transitionStatus),M=0===y.length,O=h??(K?I:J),P=(0,av.s)({anchor:O,floatingRootContext:z,positionMethod:j,mounted:G,side:k,sideOffset:m,align:l,alignOffset:o,arrowPadding:r,collisionBoundary:p,collisionPadding:q,sticky:s,disableAnchorTracking:t,keepMounted:A,collisionAvoidance:u,lazyFlip:!0});(0,au.K)(F&&B&&"touch"!==H,I);let Q=e.useMemo(()=>{let a={...P.positionerStyles};return F||(a.pointerEvents="none"),{role:"presentation",hidden:!G,style:a}},[F,G,P.positionerStyles]),R={open:F,side:P.side,align:P.align,anchorHidden:P.anchorHidden,empty:M};(0,g.g)(()=>{w.set("popupSide",P.side)},[w,P.side]);let S=e.useMemo(()=>({side:P.side,align:P.align,arrowRef:P.arrowRef,arrowUncentered:P.arrowUncentered,arrowStyles:P.arrowStyles,anchorHidden:P.anchorHidden,isPositioned:P.isPositioned}),[P.side,P.align,P.arrowRef,P.arrowUncentered,P.arrowStyles,P.anchorHidden,P.isPositioned]),T=(0,i.K)(a=>{w.set("positionerElement",a)}),U=(0,ah.o)("div",a,{state:R,ref:[b,T],props:[Q,(0,ax.d)(L),v],stateAttributesMapping:ai.GW});return(0,d.jsxs)(am.Provider,{value:S,children:[G&&B&&(0,d.jsx)(ay.W,{inert:(0,at.Y)(!F),cutout:J??I}),U]})});var aA=c(474228),aB=c(238978);let aC={...ai.GW,...aB.G},aD=e.forwardRef(function(a,b){let c,{render:e,className:f,initialFocus:g,finalFocus:h,...i}=a,j=C(),k=an(),l=D(),{filteredItems:m}=E(),o=(0,n.P)(j,N.mounted),p=(0,n.P)(j,N.open),q=(0,n.P)(j,N.openMethod),r=(0,n.P)(j,N.transitionStatus),s=(0,n.P)(j,N.inputInsidePopup),t=(0,n.P)(j,N.inputElement),v=0===m.length;(0,O.v)({open:p,ref:j.state.popupRef,onComplete(){p&&j.state.onOpenChangeComplete(!0)}});let w={open:p,side:k.side,align:k.align,anchorHidden:k.anchorHidden,transitionStatus:r,empty:v},x=(0,ah.o)("div",a,{state:w,ref:[b,j.state.popupRef],props:[{role:s?"dialog":"presentation",tabIndex:-1,onFocus(a){let b=(0,u.EW)(a.nativeEvent);"touch"!==q&&((0,u.gR)(j.state.listElement,b)||b===a.currentTarget)&&j.state.inputRef.current?.focus()}},(0,ax.d)(r),i],stateAttributesMapping:aC}),y=!!s&&(a=>"touch"===a?j.state.popupRef.current:t);return c=null!=h?h:!!s&&void 0,(0,d.jsx)(aA.s,{context:l,disabled:!o,modal:!s,openInteractionType:q,initialFocus:void 0===g?y:g,returnFocus:c,children:x})}),aE=e.createContext(null);function aF(a){let{children:b}=a,{filteredItems:c}=E(),f=e.useContext(aE),g=f?f.items:c;return g?(0,d.jsx)(e.Fragment,{children:g.map(b)}):null}var aG=c(987038);let aH=e.forwardRef(function(a,b){var c;let{render:f,className:g,children:h,...j}=a,k=C(),l=D(),m=!!an(!0),{filteredItems:o}=E(),p=(0,n.P)(k,N.items),q=(0,n.P)(k,N.labelsRef),r=(0,n.P)(k,N.listRef),s=(0,n.P)(k,N.selectionMode),t=(0,n.P)(k,N.grid),u=(0,n.P)(k,N.popupProps),v=(0,n.P)(k,N.disabled),w=(0,n.P)(k,N.readOnly),x=(0,n.P)(k,N.virtualized),y=0===o.length,z=(0,i.K)(a=>{k.set("positionerElement",a)}),A=(0,i.K)(a=>{k.set("listElement",a)}),B=e.useMemo(()=>"function"==typeof h?c||(c=(0,d.jsx)(aF,{children:h})):h,[h]),F=l.useState("floatingId"),G=(0,ah.o)("div",a,{state:{empty:y},ref:[b,A,m?null:z],props:[u,{children:B,tabIndex:-1,id:F,role:t?"grid":"listbox","aria-multiselectable":"multiple"===s?"true":void 0,onKeyDown(a){if(!v&&!w&&"Enter"===a.key){let b=k.state.activeIndex;if(null==b)return;(0,al.jo)(a);let c=a.nativeEvent,d=k.state.listRef.current[b];d&&(k.state.selectionEventRef.current=c,d.click(),k.state.selectionEventRef.current=null)}},onKeyDownCapture(){k.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){k.state.keyboardActiveRef.current=!1}},j]});return x?G:(0,d.jsx)(aG.u,{elementsRef:r,labelsRef:p?void 0:q,children:G})});var aI=c(360412);let aJ=e.createContext(void 0);var aK=c(642228);let aL=e.createContext(!1),aM=e.memo(e.forwardRef(function(a,b){let{render:c,className:f,value:h=null,index:i,disabled:j=!1,nativeButton:k=!1,...l}=a,m=e.useRef(!1),o=e.useRef(null),p=(0,aI.q)({index:i,textRef:o,indexGuessBehavior:aI.G.GuessFromOrder}),q=C(),r=e.useContext(aL),{flatFilteredItems:s,hasItems:t}=E(),u=(0,n.P)(q,N.open),v=(0,n.P)(q,N.selectionMode),w=(0,n.P)(q,N.readOnly),x=(0,n.P)(q,N.virtualized),y=(0,n.P)(q,N.isItemEqualToValue),z="none"!==v,A=i??(x?I(s,h,y):p.index),B=-1!==p.index,D=(0,n.P)(q,N.id),F=(0,n.P)(q,N.isActive,A),G=(0,n.P)(q,N.isSelected,h),J=(0,n.P)(q,N.getItemProps),K=e.useRef(null),L=null!=D&&B?`${D}-${A}`:void 0,M=G&&z;(0,g.g)(()=>{if(!(B&&(x||null!=i)))return;let a=q.state.listRef.current;return a[A]=K.current,()=>{delete a[A]}},[B,x,A,i,q]),(0,g.g)(()=>{if(!B||t)return;let a=q.state.valuesRef.current;return a[A]=h,"none"!==v&&q.state.allValuesRef.current.push(h),()=>{delete a[A]}},[B,t,A,h,q,v]),(0,g.g)(()=>{if(!u){m.current=!1;return}if(!B||t)return;let a=q.state.selectedValue;H(h,Array.isArray(a)?a[a.length-1]:a,y)&&q.set("selectedIndex",A)},[B,t,u,q,A,h,y]);let O=J({active:F,selected:M});O.id=void 0,O.onFocus=void 0;let{getButtonProps:P,buttonRef:Q}=(0,aK.s)({disabled:j,focusableWhenDisabled:!0,native:k});function R(a){function b(){q.state.handleSelection(a,h)}q.state.submitOnItemClick?(T.flushSync(b),q.state.requestSubmit()):b()}let S=(0,ah.o)("div",a,{ref:[Q,b,p.ref,K],state:{disabled:j,selected:M,highlighted:F},props:[O,{id:L,role:r?"gridcell":"option","aria-selected":z?M:void 0,tabIndex:void 0,onPointerDownCapture(a){m.current=!0,a.preventDefault()},onClick(a){j||w||R(a.nativeEvent)},onMouseUp(a){let b=m.current;m.current=!1,j||w||0!==a.button||b||!F||R(a.nativeEvent)}},l,P]}),U=e.useMemo(()=>({selected:M,textRef:o}),[M,o]);return(0,d.jsx)(aJ.Provider,{value:U,children:S})}));var aN=c(165046);let aO=function(a){let{multiple:b=!1,defaultValue:c,value:e,onValueChange:f,autoComplete:g,...h}=a;return(0,d.jsx)(af,{...h,selectionMode:b?"multiple":"single",selectedValue:e,defaultSelectedValue:c,onSelectedValueChange:f,formAutoComplete:g})},aP=e.forwardRef(({className:a,...b},c)=>(0,d.jsx)(ap,{ref:c,"data-slot":"combobox-input",className:(0,aN.cn)("w-full rounded-xl py-2 text-sm outline-none transition-colors",a),...b}));function aQ({className:a,side:b="bottom",sideOffset:c=8,align:e="start",alignOffset:f=0,anchor:g,...h}){return(0,d.jsx)(as,{children:(0,d.jsx)(az,{side:b,sideOffset:c,align:e,alignOffset:f,anchor:g,className:"isolate z-[10000]",children:(0,d.jsx)(aD,{"data-slot":"combobox-content",className:(0,aN.cn)("bg-neutral-100/[0.67] dark:bg-neutral-900/[0.67] border border-white dark:border-white/10 backdrop-blur-md text-[var(--color-text)] max-h-[var(--available-height)] w-[calc(var(--anchor-width)+48px)] overflow-hidden rounded-3xl p-1 shadow-[0_0_25px_0_rgba(0,0,0,0.16)] outline-none","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",a),...h})})})}function aR({className:a,...b}){return(0,d.jsx)(aH,{"data-slot":"combobox-list",className:(0,aN.cn)("max-h-[300px] overflow-y-auto overscroll-contain thin-scrollbar",a),...b})}function aS({className:a,children:b,...c}){return(0,d.jsx)(aM,{"data-slot":"combobox-item",className:(0,aN.cn)("bg-transparent data-highlighted:bg-neutral-400/15 text-sm transition-all relative flex w-full cursor-pointer items-center gap-2.5 rounded-2xl px-3 py-2 outline-none select-none","data-disabled:pointer-events-none data-disabled:opacity-50",a),...c,children:b})}aP.displayName="ComboboxInput";var aT=c(941809),aU=c(896703),aV=c(490654),aW=c(75567);function aX(a){return(0,aW.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.875 2.292a.114.114 0 0 0-.032.018A7.239 7.239 0 0 0 4.75 8.25a7.248 7.248 0 0 0 3.654 6.297c.57.327.982.955.941 1.682v.002l-.317 6.058a.75.75 0 1 1-1.498-.078l.317-6.062v-.004c.006-.09-.047-.215-.188-.296A8.749 8.749 0 0 1 3.25 8.25a8.738 8.738 0 0 1 3.732-7.169 1.547 1.547 0 0 1 1.709-.064c.484.292.809.835.809 1.46v4.714a.25.25 0 0 0 .119.213l2.25 1.385c.08.05.182.05.262 0l2.25-1.385a.25.25 0 0 0 .119-.213V2.478c0-.626.325-1.169.81-1.461a1.547 1.547 0 0 1 1.708.064 8.741 8.741 0 0 1 3.732 7.17 8.747 8.747 0 0 1-4.41 7.598c-.14.081-.193.206-.188.296v.004l.318 6.062a.75.75 0 1 1-1.498.078l-.317-6.058v-.002c-.041-.727.37-1.355.94-1.682A7.247 7.247 0 0 0 19.25 8.25a7.239 7.239 0 0 0-3.093-5.94.114.114 0 0 0-.032-.018l-.01-.001c-.003 0-.014 0-.031.01-.036.022-.084.079-.084.177V7.19c0 .608-.315 1.172-.833 1.49l-2.25 1.385a1.75 1.75 0 0 1-1.834 0l-2.25-1.384A1.752 1.752 0 0 1 8 7.192V2.477c0-.098-.048-.155-.084-.176a.068.068 0 0 0-.031-.011l-.01.001Z"},child:[]}]})(a)}function aY(a){return(0,aW.k5)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M2.5 7C2.5 9.48528 4.51472 11.5 7 11.5C9.48528 11.5 11.5 9.48528 11.5 7C11.5 4.51472 9.48528 2.5 7 2.5C4.51472 2.5 2.5 4.51472 2.5 7ZM2.5 17C2.5 19.4853 4.51472 21.5 7 21.5C9.48528 21.5 11.5 19.4853 11.5 17C11.5 14.5147 9.48528 12.5 7 12.5C4.51472 12.5 2.5 14.5147 2.5 17ZM12.5 17C12.5 19.4853 14.5147 21.5 17 21.5C19.4853 21.5 21.5 19.4853 21.5 17C21.5 14.5147 19.4853 12.5 17 12.5C14.5147 12.5 12.5 14.5147 12.5 17ZM9.5 7C9.5 8.38071 8.38071 9.5 7 9.5C5.61929 9.5 4.5 8.38071 4.5 7C4.5 5.61929 5.61929 4.5 7 4.5C8.38071 4.5 9.5 5.61929 9.5 7ZM9.5 17C9.5 18.3807 8.38071 19.5 7 19.5C5.61929 19.5 4.5 18.3807 4.5 17C4.5 15.6193 5.61929 14.5 7 14.5C8.38071 14.5 9.5 15.6193 9.5 17ZM19.5 17C19.5 18.3807 18.3807 19.5 17 19.5C15.6193 19.5 14.5 18.3807 14.5 17C14.5 15.6193 15.6193 14.5 17 14.5C18.3807 14.5 19.5 15.6193 19.5 17ZM17.5252 11.155L17.8026 10.5186C18.297 9.38398 19.1876 8.48059 20.2988 7.98638L21.1534 7.60631C21.6155 7.4008 21.6155 6.7284 21.1534 6.52289L20.3467 6.16406C19.2068 5.65713 18.3002 4.72031 17.8143 3.54712L17.5295 2.85945C17.3309 2.38018 16.669 2.38018 16.4705 2.85945L16.1856 3.54712C15.6997 4.72031 14.7932 5.65713 13.6534 6.16406L12.8466 6.52289C12.3845 6.7284 12.3845 7.4008 12.8466 7.60631L13.7011 7.98638C14.8124 8.48059 15.7029 9.38398 16.1974 10.5186L16.4748 11.155C16.6778 11.6209 17.3222 11.6209 17.5252 11.155Z"},child:[]}]})(a)}var aZ=c(826948),a$=c(57137),a_=c(489619),a0=c(86839),a1=c(981188);function a2(a){let b=a.path??a.id,c=b.split("/").pop()??a.label;return{name:"object"===a.kind?(0,a0.PV)(a.label):c,path:b,type:a.nodeType??("object"===a.kind?"folder":"file")}}function a3(){let{resolvedTheme:a,setTheme:b}=(0,aZ.D)(),[c,f]=(0,e.useState)(!1);if(!c)return(0,d.jsx)("div",{className:"w-[26px] h-[26px]"});let g="dark"===a;return(0,d.jsx)("button",{type:"button",onClick:()=>b(g?"light":"dark"),className:"p-1.5 rounded-lg transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:g?"Switch to light mode":"Switch to dark mode",children:g?(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,d.jsx)("path",{d:"M12 2v2"}),(0,d.jsx)("path",{d:"M12 20v2"}),(0,d.jsx)("path",{d:"m4.93 4.93 1.41 1.41"}),(0,d.jsx)("path",{d:"m17.66 17.66 1.41 1.41"}),(0,d.jsx)("path",{d:"M2 12h2"}),(0,d.jsx)("path",{d:"M20 12h2"}),(0,d.jsx)("path",{d:"m6.34 17.66-1.41 1.41"}),(0,d.jsx)("path",{d:"m19.07 4.93-1.41 1.41"})]}):(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})})}function a4(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("path",{d:"m21 21-4.3-4.3"})]})}function a5({type:a}){switch(a){case"folder":return(0,d.jsx)(aT.A,{size:16,style:{flexShrink:0,color:"#60a5fa"}});case"document":default:return(0,d.jsx)(aU.A,{size:16,style:{flexShrink:0,opacity:.7}});case"database":return(0,d.jsx)(aV.A,{size:16,style:{flexShrink:0}})}}function a6({onSelect:a,searchFn:b}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(""),k=(0,e.useRef)(!1),l=(0,e.useRef)(null),m=(0,e.useRef)(null),n=(0,e.useCallback)(a=>{if(k.current){k.current=!1;return}if(j(a),!a.trim()){f([]),h(!1);return}b?(f(b(a.trim(),20).map(a2)),h(!0)):(l.current&&clearTimeout(l.current),l.current=setTimeout(async()=>{try{let b=await fetch(`/api/workspace/suggest-files?q=${encodeURIComponent(a.trim())}`),c=await b.json();f(c.items??[]),h(!0)}catch{f([])}},150))},[b]);return(0,d.jsxs)(aO,{value:null,open:g,onOpenChange:a=>{a||h(!1)},onValueChange:b=>{b&&(k.current=!0,a(b),h(!1),j(""),f([]))},onInputValueChange:n,filter:null,itemToStringLabel:()=>"",children:[(0,d.jsxs)("div",{ref:m,className:"relative",children:[(0,d.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none z-10",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(a4,{})}),(0,d.jsx)(aP,{placeholder:"Search",className:"w-full pl-9 pr-10 py-1.5 rounded-xl text-sm outline-none transition-colors",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"}})]}),(0,d.jsxs)(aQ,{anchor:m,children:[(0,d.jsx)(aR,{children:c.map(a=>(0,d.jsxs)(aS,{value:a,children:[(0,d.jsx)("span",{className:"flex-shrink-0",style:{color:"var(--color-text-muted)",opacity:.55},children:(0,d.jsx)(a5,{type:a.type})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"truncate font-medium",children:a.name}),(0,d.jsx)("div",{className:"truncate text-xs",style:{color:"var(--color-text-muted)"},children:a.path.split("/").slice(0,-1).join("/")})]})]},a.path))}),i.trim()&&0===c.length&&(0,d.jsx)("div",{className:"py-3 text-center text-sm",style:{color:"var(--color-text-muted)"},children:"No files found"})]})]})}function a7({orgName:a,onFileSearchSelect:b,mobile:c,onClose:f,showHidden:g,onToggleHidden:h,width:i,onCollapse:j,compact:k=!1,onToggleCompact:l,activeWorkspace:m,onWorkspaceChanged:n,onNavigate:o,activeCrmTarget:p=null,customCrmObjects:q,activeCrmObjectName:r=null,onNavigateToCrmObject:s,chatsPanel:t,onNewChatSession:u}){let v=c?"280px":i??260,[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)("home"),A=[{id:"crm-people",label:"People",target:"people",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),(0,d.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,d.jsx)("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),(0,d.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})},{id:"crm-companies",label:"Companies",target:"companies",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M3 21h18"}),(0,d.jsx)("path",{d:"M5 21V7l8-4v18"}),(0,d.jsx)("path",{d:"M19 21V11l-6-4"}),(0,d.jsx)("path",{d:"M9 9h0"}),(0,d.jsx)("path",{d:"M9 13h0"}),(0,d.jsx)("path",{d:"M9 17h0"})]})},{id:"crm-inbox",label:"Inbox",target:"inbox",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),(0,d.jsx)("path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11Z"})]})},{id:"crm-calendar",label:"Calendar",target:"calendar",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),(0,d.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,d.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,d.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}],B=[{id:"cloud",label:"Cloud",icon:(0,d.jsx)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,d.jsx)("path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"})})},{id:"integrations",label:"Integrations",icon:(0,d.jsx)(aY,{className:"h-4 w-4 shrink-0","aria-hidden":!0})},{id:"skills",label:"Skills",icon:(0,d.jsx)(aX,{className:"h-4 w-4 shrink-0","aria-hidden":!0})},{id:"cron",label:"Cron",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}],C=(0,d.jsxs)("aside",{className:"flex flex-col h-screen shrink-0 border-r",style:{width:"number"==typeof v?`${v}px`:v,minWidth:"number"==typeof v?`${v}px`:v,background:"var(--color-bg)",borderColor:"var(--color-border)"},children:[l&&(0,d.jsx)("div",{className:"flex items-center justify-center h-[44px] shrink-0",children:(0,d.jsx)("button",{type:"button",onClick:l,className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"Expand sidebar",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M15 3v18"})]})})}),(0,d.jsx)("div",{className:"flex items-center justify-center pb-0.5 shrink-0",children:(0,d.jsx)(a$.N,{activeWorkspaceHint:m??null,onWorkspaceSwitch:()=>{n?.()},onWorkspaceDelete:()=>{n?.()},onCreateWorkspace:()=>{x(!0)},trigger:({onClick:b,activeWorkspace:c,switching:e})=>(0,d.jsx)("button",{type:"button",onClick:b,disabled:e,className:"w-7 h-7 mx-auto rounded-lg overflow-hidden flex items-center justify-center transition-opacity hover:opacity-90",title:`${a||"Workspace"}${c?` — ${c}`:""}`,children:(0,d.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",className:"w-7 h-7 object-cover",draggable:!1})})})}),o&&(0,d.jsxs)("div",{className:"flex flex-col items-center gap-0.5 pt-1 pb-1",children:[A.map(a=>{let b=p===a.target;return(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:a.label,"aria-label":a.label,children:a.icon},a.id)}),q&&q.length>0&&s&&q.map(a=>{let b=r===a.name,c=(0,a0.PV)(a.name);return(0,d.jsx)("button",{type:"button",onClick:()=>s(a.name),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:c,"aria-label":c,children:(0,d.jsx)(a1.P,{name:a.icon,size:16})},`crm-object-${a.name}`)})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0"}),o&&(0,d.jsx)("div",{className:"flex flex-col items-center gap-0.5 py-1",children:B.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:a.label,"aria-label":a.label,children:a.icon},a.id))}),(0,d.jsxs)("div",{className:"flex flex-col items-center py-1.5 gap-0.5",children:[h&&(0,d.jsx)("button",{type:"button",onClick:h,className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:g?"Hide dotfiles":"Show dotfiles",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,d.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,d.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,d.jsx)("path",{d:"m2 2 20 20"})]})})}),(0,d.jsx)(a3,{})]})]}),D=(0,d.jsxs)("aside",{className:`flex flex-col h-screen shrink-0 ${c?"drawer-left":"border-r"}`,style:{width:"number"==typeof v?`${v}px`:v,minWidth:"number"==typeof v?`${v}px`:v,background:"var(--color-bg)",borderColor:"var(--color-border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1 px-2 h-[44px] shrink-0",children:[(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(a$.N,{activeWorkspaceHint:m??null,onWorkspaceSwitch:()=>{n?.()},onWorkspaceDelete:()=>{n?.()},onCreateWorkspace:()=>{x(!0)},trigger:({onClick:b,activeWorkspace:c,switching:e})=>(0,d.jsxs)("button",{type:"button",onClick:b,disabled:e,className:"text-[13px] flex items-center gap-1.5 truncate w-full transition-colors rounded-lg px-2 py-1.5",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"Switch workspace",children:[(0,d.jsx)("span",{className:"truncate font-semibold",children:a||"Workspace"}),c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"shrink-0 opacity-40",children:"/"}),(0,d.jsx)("span",{className:"truncate text-[12px]",style:{color:"var(--color-text-muted)"},children:c})]}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})]})})}),(l||j)&&(0,d.jsx)("button",{type:"button",onClick:l??j,className:"p-1.5 rounded-lg shrink-0 transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:l?"Collapse to icons":"Hide sidebar (⌘B)",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M9 3v18"})]})})]}),t&&(0,d.jsxs)("div",{className:"px-2 pt-1 pb-1 flex items-center gap-1",children:[[{id:"home",label:"Home"},{id:"chats",label:"Chats"}].map(a=>{let b=y===a.id;return(0,d.jsx)("button",{type:"button",onClick:()=>z(a.id),className:"flex-1 px-2 py-1 rounded-md text-[12px] font-medium transition-colors cursor-pointer",style:{color:b?"var(--color-text)":"var(--color-text-muted)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:a.label},a.id)}),"chats"===y&&u&&(0,d.jsx)("button",{type:"button",onClick:u,className:"p-1 rounded-md transition-colors cursor-pointer shrink-0",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"New chat","aria-label":"New chat",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M5 12h14"}),(0,d.jsx)("path",{d:"M12 5v14"})]})})]}),"chats"===y&&t?(0,d.jsx)("div",{className:"flex-1 min-h-0 flex flex-col relative",children:t}):(0,d.jsxs)(d.Fragment,{children:[o&&(0,d.jsxs)("div",{className:"px-2 pt-1 pb-1",children:[(0,d.jsx)("div",{className:"px-2 pt-2 pb-1 text-[9px] lowercase",style:{color:"var(--color-text-muted)",letterSpacing:"0.05em"},children:"workspace"}),(0,d.jsxs)("div",{className:"space-y-0.5",children:[A.map(a=>{let b=p===a.target;return(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.id),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:a.icon}),a.label]},a.id)}),q&&q.length>0&&s&&q.map(a=>{let b=r===a.name,c=(0,a0.PV)(a.name);return(0,d.jsxs)("button",{type:"button",onClick:()=>s(a.name),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:c,children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(a1.P,{name:a.icon,size:16})}),c]},`crm-object-${a.name}`)})]})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0"}),o&&(0,d.jsx)("div",{className:"px-2 py-1 space-y-0.5",children:B.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.id),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:a.icon}),a.label]},a.id))})]}),(0,d.jsxs)("div",{className:"px-2 py-1.5 flex items-center justify-between",children:[(0,d.jsxs)("a",{href:"https://dench.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-2 py-1 rounded-lg text-[11px]",style:{color:"var(--color-text-muted)"},children:["dench.com"," v3.0.0"]}),(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[h&&(0,d.jsx)("button",{type:"button",onClick:h,className:"p-1.5 rounded-lg transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)"},title:g?"Hide dotfiles":"Show dotfiles",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,d.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,d.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,d.jsx)("path",{d:"m2 2 20 20"})]})})}),(0,d.jsx)(a3,{})]})]})]});return c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"drawer-backdrop",onClick:()=>void f?.(),children:(0,d.jsx)("div",{onClick:a=>a.stopPropagation(),className:"fixed inset-y-0 left-0 z-50",children:D})}),(0,d.jsx)(a_.s,{isOpen:w,onClose:()=>x(!1),onCreated:()=>{n?.()}})]}):(0,d.jsxs)(d.Fragment,{children:[!c&&k?C:D,(0,d.jsx)(a_.s,{isOpen:w,onClose:()=>x(!1),onCreated:()=>{n?.()}})]})}},685343:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(95253)._0},686937:a=>{"use strict";var b=Object.prototype.hasOwnProperty,c=Object.prototype.toString,d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=function(a){return"function"==typeof Array.isArray?Array.isArray(a):"[object Array]"===c.call(a)},g=function(a){if(!a||"[object Object]"!==c.call(a))return!1;var d,e=b.call(a,"constructor"),f=a.constructor&&a.constructor.prototype&&b.call(a.constructor.prototype,"isPrototypeOf");if(a.constructor&&!e&&!f)return!1;for(d in a);return void 0===d||b.call(a,d)},h=function(a,b){d&&"__proto__"===b.name?d(a,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):a[b.name]=b.newValue},i=function(a,c){if("__proto__"===c){if(!b.call(a,c))return;else if(e)return e(a,c).value}return a[c]};a.exports=function a(){var b,c,d,e,j,k,l=arguments[0],m=1,n=arguments.length,o=!1;for("boolean"==typeof l&&(o=l,l=arguments[1]||{},m=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});m<n;++m)if(b=arguments[m],null!=b)for(c in b)d=i(l,c),l!==(e=i(b,c))&&(o&&e&&(g(e)||(j=f(e)))?(j?(j=!1,k=d&&f(d)?d:[]):k=d&&g(d)?d:{},h(l,{name:c,newValue:a(o,k,e)})):void 0!==e&&h(l,{name:c,newValue:e}));return l}},699022:(a,b,c)=>{"use strict";function d(a,b){let c=a[b.tabId];return c&&c.sessionId===b.sessionId&&c.sessionKey===b.sessionKey&&c.isStreaming===b.isStreaming&&c.status===b.status&&c.isReconnecting===b.isReconnecting&&c.loadingSession===b.loadingSession?a:{...a,[b.tabId]:b}}function e(a,b){if(!(b in a))return a;let c={...a};return delete c[b],c}function f(a){return{parentStatuses:new Map(a.parentRuns.map(a=>[a.sessionId,a.status])),subagentStatuses:new Map(a.subagents.map(a=>[a.childSessionKey,a.status]))}}c.d(b,{F8:()=>f,T$:()=>e,ZZ:()=>d})},704092:(a,b,c)=>{"use strict";c.r(b),c.d(b,{Alternation:()=>av,Alternative:()=>ap,CstParser:()=>b_,EMPTY_ALT:()=>bZ,EOF:()=>ai,EarlyExitException:()=>br,EmbeddedActionsParser:()=>b0,GAstVisitor:()=>aB,Lexer:()=>V,LexerDefinitionErrorType:()=>d,MismatchedTokenException:()=>bo,NoViableAltException:()=>bp,NonTerminal:()=>an,NotAllInputParsedException:()=>bq,Option:()=>aq,Parser:()=>ca,ParserDefinitionErrorType:()=>g,Repetition:()=>at,RepetitionMandatory:()=>ar,RepetitionMandatoryWithSeparator:()=>as,RepetitionWithSeparator:()=>au,Rule:()=>ao,Terminal:()=>aw,VERSION:()=>h,assignOccurrenceIndices:()=>bf,clearCache:()=>b9,createSyntaxDiagramsCode:()=>b1,createToken:()=>ag,createTokenInstance:()=>aj,defaultGrammarResolverErrorProvider:()=>aM,defaultGrammarValidatorErrorProvider:()=>aN,defaultLexerErrorProvider:()=>T,defaultParserErrorProvider:()=>aL,generateParserFactory:()=>b7,generateParserModule:()=>b8,isRecognitionException:()=>bm,resolveGrammar:()=>bd,serializeGrammar:()=>ax,serializeProduction:()=>ay,tokenLabel:()=>W,tokenMatcher:()=>ak,tokenName:()=>X,validateGrammar:()=>be});var d,e,f,g,h="7.1.2",i=c(165892),j=c(935407),k={},l=new j.RegExpParser;function m(a){var b=a.toString();if(k.hasOwnProperty(b))return k[b];var c=l.pattern(b);return k[b]=c,c}var n=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),o="Complement Sets are not supported for first char optimization",p='Unable to use "first char" lexer optimizations:\n';function q(a,b,c){var d=J(a);b[d]=d,!0===c&&function(a,b){var c=String.fromCharCode(a),d=c.toUpperCase();if(d!==c){var e=J(d.charCodeAt(0));b[e]=e}else{var f=c.toLowerCase();if(f!==c){var e=J(f.charCodeAt(0));b[e]=e}}}(a,b)}function r(a,b){return(0,i.I6)(a.value,function(a){return"number"==typeof a?(0,i.gR)(b,a):void 0!==(0,i.I6)(b,function(b){return a.from<=b&&b<=a.to})})}var s=function(a){function b(b){var c=a.call(this)||this;return c.targetCharCodes=b,c.found=!1,c}return n(b,a),b.prototype.visitChildren=function(b){if(!0!==this.found){switch(b.type){case"Lookahead":this.visitLookahead(b);return;case"NegativeLookahead":this.visitNegativeLookahead(b);return}a.prototype.visitChildren.call(this,b)}},b.prototype.visitCharacter=function(a){(0,i.gR)(this.targetCharCodes,a.value)&&(this.found=!0)},b.prototype.visitSet=function(a){a.complement?void 0===r(a,this.targetCharCodes)&&(this.found=!0):void 0!==r(a,this.targetCharCodes)&&(this.found=!0)},b}(j.BaseRegExpVisitor);function t(a,b){if(!(b instanceof RegExp))return void 0!==(0,i.I6)(b,function(b){return(0,i.gR)(a,b.charCodeAt(0))});var c=m(b),d=new s(a);return d.visit(c),d.found}var u=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),v="PATTERN",w="defaultMode",x="modes",y="boolean"==typeof RegExp("(?:)").sticky,z=/[^\\][\$]/,A=/[^\\[][\^]|^\^/;function B(a){var b=a.ignoreCase?"i":"";return RegExp("^(?:"+a.source+")",b)}function C(a){var b=a.ignoreCase?"iy":"y";return RegExp(""+a.source,b)}function D(a){var b=a.PATTERN;if((0,i.gd)(b))return!1;if((0,i.Tn)(b))return!0;if((0,i.zy)(b,"exec"))return!0;if((0,i.Kg)(b))return!1;throw Error("non exhaustive match")}function E(a){return!!(0,i.Kg)(a)&&1===a.length&&a.charCodeAt(0)}var F={test:function(a){for(var b=a.length,c=this.lastIndex;c<b;c++){var d=a.charCodeAt(c);if(10===d)return this.lastIndex=c+1,!0;if(13===d)return 10===a.charCodeAt(c+1)?this.lastIndex=c+2:this.lastIndex=c+1,!0}return!1},lastIndex:0};function G(a,b){if((0,i.zy)(a,"LINE_BREAKS"))return!1;if((0,i.gd)(a.PATTERN)){try{t(b,a.PATTERN)}catch(a){return{issue:d.IDENTIFY_TERMINATOR,errMsg:a.message}}return!1}if((0,i.Kg)(a.PATTERN))return!1;if(D(a))return{issue:d.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function H(a){return(0,i.Tj)(a,function(a){return(0,i.Kg)(a)&&a.length>0?a.charCodeAt(0):a})}function I(a,b,c){void 0===a[b]?a[b]=[c]:a[b].push(c)}function J(a){return a<256?a:K[a]}var K=[];function L(a,b){var c=a.tokenTypeIdx;return c===b.tokenTypeIdx||!0===b.isParent&&!0===b.categoryMatchesMap[c]}function M(a,b){return a.tokenTypeIdx===b.tokenTypeIdx}var N=1,O={};function P(a){var b,c,d,e=function(a){for(var b=(0,i.T9)(a),c=a,d=!0;d;){c=(0,i.oE)((0,i.Bq)((0,i.Tj)(c,function(a){return a.CATEGORIES})));var e=(0,i.iv)(c,b);b=b.concat(e),(0,i.Im)(e)?d=!1:c=e}return b}(a);b=e,(0,i.jJ)(b,function(a){var b,c;Q(a)||(O[N]=a,a.tokenTypeIdx=N++),R(a)&&!(0,i.cy)(a.CATEGORIES)&&(a.CATEGORIES=[a.CATEGORIES]),R(a)||(a.CATEGORIES=[]),b=a,(0,i.zy)(b,"categoryMatches")||(a.categoryMatches=[]),c=a,(0,i.zy)(c,"categoryMatchesMap")||(a.categoryMatchesMap={})}),c=e,(0,i.jJ)(c,function(a){!function a(b,c){(0,i.jJ)(b,function(a){c.categoryMatchesMap[a.tokenTypeIdx]=!0}),(0,i.jJ)(c.CATEGORIES,function(d){var e=b.concat(c);(0,i.gR)(e,d)||a(e,d)})}([],a)}),d=e,(0,i.jJ)(d,function(a){a.categoryMatches=[],(0,i.jJ)(a.categoryMatchesMap,function(b,c){a.categoryMatches.push(O[c].tokenTypeIdx)})}),(0,i.jJ)(e,function(a){a.isParent=a.categoryMatches.length>0})}function Q(a){return(0,i.zy)(a,"tokenTypeIdx")}function R(a){return(0,i.zy)(a,"CATEGORIES")}function S(a){return(0,i.zy)(a,"tokenTypeIdx")}var T={buildUnableToPopLexerModeMessage:function(a){return"Unable to pop Lexer Mode after encountering Token ->"+a.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(a,b,c,d,e){return"unexpected character: ->"+a.charAt(b)+"<- at offset: "+b+", skipped "+c+" characters."}};!function(a){a[a.MISSING_PATTERN=0]="MISSING_PATTERN",a[a.INVALID_PATTERN=1]="INVALID_PATTERN",a[a.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",a[a.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",a[a.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",a[a.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",a[a.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",a[a.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",a[a.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",a[a.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",a[a.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",a[a.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",a[a.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",a[a.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",a[a.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",a[a.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",a[a.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(d||(d={}));var U={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:T,traceInitPerf:!1,skipValidations:!1};Object.freeze(U);var V=function(){function a(a,b){var c=this;if(void 0===b&&(b=U),this.lexerDefinition=a,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"==typeof b)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=(0,i.h1)(U,b);var e=this.config.traceInitPerf;!0===e?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof e&&(this.traceInitMaxIdent=e,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var e,f=!0;c.TRACE_INIT("Lexer Config handling",function(){if(c.config.lineTerminatorsPattern===U.lineTerminatorsPattern)c.config.lineTerminatorsPattern=F;else if(c.config.lineTerminatorCharacters===U.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(b.safeMode&&b.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');c.trackStartLines=/full|onlyStart/i.test(c.config.positionTracking),c.trackEndLines=/full/i.test(c.config.positionTracking),(0,i.cy)(a)?((e={modes:{}}).modes[w]=(0,i.T9)(a),e[w]=w):(f=!1,e=(0,i.lR)(a))}),!1===c.config.skipValidations&&(c.TRACE_INIT("performRuntimeChecks",function(){var a,b;c.lexerDefinitionErrors=c.lexerDefinitionErrors.concat((a=e,c.trackStartLines,c.config.lineTerminatorCharacters,b=[],(0,i.zy)(a,w)||b.push({message:"A MultiMode Lexer cannot be initialized without a <"+w+"> property in its definition\n",type:d.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,i.zy)(a,x)||b.push({message:"A MultiMode Lexer cannot be initialized without a <"+x+"> property in its definition\n",type:d.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,i.zy)(a,x)&&(0,i.zy)(a,w)&&!(0,i.zy)(a.modes,a.defaultMode)&&b.push({message:"A MultiMode Lexer cannot be initialized with a "+w+": <"+a.defaultMode+">which does not exist\n",type:d.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,i.zy)(a,x)&&(0,i.jJ)(a.modes,function(a,c){(0,i.jJ)(a,function(a,e){(0,i.b0)(a)&&b.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+c+"> at index: <")+e+">\n",type:d.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),b))}),c.TRACE_INIT("performWarningRuntimeChecks",function(){var a,b,f,g,h,j,k,l;c.lexerDefinitionWarning=c.lexerDefinitionWarning.concat((a=e,b=c.trackStartLines,f=c.config.lineTerminatorCharacters,g=[],h=!1,j=(0,i.oE)((0,i.Bq)((0,i.LG)(a.modes,function(a){return a}))),k=(0,i.ku)(j,function(a){return a[v]===V.NA}),l=H(f),b&&(0,i.jJ)(k,function(a){var b=G(a,l);if(!1!==b){var c={message:function(a,b){if(b.issue===d.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n The problem is in the <"+a.name+"> Token Type\n Root cause: "+b.errMsg+".\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(b.issue===d.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n The problem is in the <"+a.name+"> Token Type\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}(a,b),type:b.issue,tokenType:a};g.push(c)}else(0,i.zy)(a,"LINE_BREAKS")?!0===a.LINE_BREAKS&&(h=!0):t(l,a.PATTERN)&&(h=!0)}),b&&!h&&g.push({message:"Warning: No LINE_BREAKS Found.\n This Lexer has been defined to track line and column information,\n But none of the Token Types can be identified as matching a line terminator.\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n for details.",type:d.NO_LINE_BREAKS_FLAGS}),g))})),e.modes=e.modes?e.modes:{},(0,i.jJ)(e.modes,function(a,b){e.modes[b]=(0,i.ku)(a,function(a){return(0,i.b0)(a)})});var g=(0,i.HP)(e.modes);if((0,i.jJ)(e.modes,function(a,e){c.TRACE_INIT("Mode: <"+e+"> processing",function(){if(c.modes.push(e),!1===c.config.skipValidations&&c.TRACE_INIT("validatePatterns",function(){var b,e,f,h,k,l,n,o,p,q,r,s,t,w,x,y,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R;c.lexerDefinitionErrors=c.lexerDefinitionErrors.concat((b=[],k=a,l=(0,i.pb)(k,function(a){return!(0,i.zy)(a,v)}),e={errors:(0,i.Tj)(l,function(a){return{message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:d.MISSING_PATTERN,tokenTypes:[a]}}),valid:(0,i.iv)(k,l)},b=b.concat(e.errors),h=(n=e.valid,o=(0,i.pb)(n,function(a){var b=a[v];return!(0,i.gd)(b)&&!(0,i.Tn)(b)&&!(0,i.zy)(b,"exec")&&!(0,i.Kg)(b)}),f={errors:(0,i.Tj)(o,function(a){return{message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:d.INVALID_PATTERN,tokenTypes:[a]}}),valid:(0,i.iv)(n,o)}).valid,b=(b=(b=(b=(b=b.concat(f.errors)).concat((p=h,q=[],r=(0,i.pb)(p,function(a){return(0,i.gd)(a[v])}),(q=(q=(q=(q=q.concat((s=r,t=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.found=!1,b}return u(b,a),b.prototype.visitEndAnchor=function(a){this.found=!0},b}(j.BaseRegExpVisitor),w=(0,i.pb)(s,function(a){var b=a[v];try{var c=m(b),d=new t;return d.visit(c),d.found}catch(a){return z.test(b.source)}}),(0,i.Tj)(w,function(a){return{message:"Unexpected RegExp Anchor Error:\n Token Type: ->"+a.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",type:d.EOI_ANCHOR_FOUND,tokenTypes:[a]}})))).concat((x=r,y=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.found=!1,b}return u(b,a),b.prototype.visitStartAnchor=function(a){this.found=!0},b}(j.BaseRegExpVisitor),B=(0,i.pb)(x,function(a){var b=a[v];try{var c=m(b),d=new y;return d.visit(c),d.found}catch(a){return A.test(b.source)}}),(0,i.Tj)(B,function(a){return{message:"Unexpected RegExp Anchor Error:\n Token Type: ->"+a.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",type:d.SOI_ANCHOR_FOUND,tokenTypes:[a]}})))).concat((C=r,D=(0,i.pb)(C,function(a){var b=a[v];return b instanceof RegExp&&(b.multiline||b.global)}),(0,i.Tj)(D,function(a){return{message:"Token Type: ->"+a.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:d.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[a]}})))).concat((E=r,F=[],G=(0,i.Tj)(E,function(a){return(0,i.TS)(E,function(b,c){return a.PATTERN.source!==c.PATTERN.source||(0,i.gR)(F,c)||c.PATTERN===V.NA||(F.push(c),b.push(c)),b},[])}),G=(0,i.oE)(G),H=(0,i.pb)(G,function(a){return a.length>1}),(0,i.Tj)(H,function(a){var b=(0,i.Tj)(a,function(a){return a.name});return{message:"The same RegExp pattern ->"+(0,i.$1)(a).PATTERN+"<-has been used in all of the following Token Types: "+b.join(", ")+" <-",type:d.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})))).concat((I=r,J=(0,i.pb)(I,function(a){return a[v].test("")}),(0,i.Tj)(J,function(a){return{message:"Token Type: ->"+a.name+"<- static 'PATTERN' must not match an empty string",type:d.EMPTY_MATCH_PATTERN,tokenTypes:[a]}})))))).concat((K=h,L=(0,i.pb)(K,function(a){if(!(0,i.zy)(a,"GROUP"))return!1;var b=a.GROUP;return b!==V.SKIPPED&&b!==V.NA&&!(0,i.Kg)(b)}),(0,i.Tj)(L,function(a){return{message:"Token Type: ->"+a.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:d.INVALID_GROUP_TYPE_FOUND,tokenTypes:[a]}})))).concat((M=h,N=g,O=(0,i.pb)(M,function(a){return void 0!==a.PUSH_MODE&&!(0,i.gR)(N,a.PUSH_MODE)}),(0,i.Tj)(O,function(a){return{message:"Token Type: ->"+a.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+a.PUSH_MODE+"<-which does not exist",type:d.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}})))).concat((P=h,Q=[],R=(0,i.TS)(P,function(a,b,c){var d,e=b.PATTERN;return e===V.NA||((0,i.Kg)(e)?a.push({str:e,idx:c,tokenType:b}):(0,i.gd)(e)&&(d=e,void 0===(0,i.I6)([".","\\","[","]","|","^","$","(",")","?","*","+","{"],function(a){return -1!==d.source.indexOf(a)}))&&a.push({str:e.source,idx:c,tokenType:b})),a},[]),(0,i.jJ)(P,function(a,b){(0,i.jJ)(R,function(c){var e=c.str,f=c.idx,g=c.tokenType;if(b<f&&function(a,b){if((0,i.gd)(b)){var c=b.exec(a);return null!==c&&0===c.index}if((0,i.Tn)(b))return b(a,0,[],{});if((0,i.zy)(b,"exec"))return b.exec(a,0,[],{});if("string"==typeof b)return b===a;throw Error("non exhaustive match")}(e,a.PATTERN)){var h="Token: ->"+g.name+"<- can never be matched.\nBecause it appears AFTER the Token Type ->"+a.name+"<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE";Q.push({message:h,type:d.UNREACHABLE_PATTERN,tokenTypes:[a,g]})}})}),Q))))}),(0,i.Im)(c.lexerDefinitionErrors)){var f;P(a),c.TRACE_INIT("analyzeTokenTypes",function(){var d,e,g,h,k,l,n,r,s,u,w,x,z,A,F,L,M;d={lineTerminatorCharacters:c.config.lineTerminatorCharacters,positionTracking:b.positionTracking,ensureOptimizations:b.ensureOptimizations,safeMode:b.safeMode,tracer:c.TRACE_INIT.bind(c)},(A=(d=(0,i.NT)(d,{useSticky:y,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(a,b){return b()}})).tracer)("initCharCodeToOptimizedIndexMap",function(){if((0,i.Im)(K)){K=Array(65536);for(var a=0;a<65536;a++)K[a]=a>255?255+~~(a/255):a}}),A("Reject Lexer.NA",function(){e=(0,i.ku)(a,function(a){return a[v]===V.NA})}),F=!1,A("Transform Patterns",function(){F=!1,g=(0,i.Tj)(e,function(a){var b=a[v];if((0,i.gd)(b)){var c=b.source;return 1!==c.length||"^"===c||"$"===c||"."===c||b.ignoreCase?2!==c.length||"\\"!==c[0]||(0,i.gR)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],c[1])?d.useSticky?C(b):B(b):c[1]:c}if((0,i.Tn)(b))return F=!0,{exec:b};if((0,i.zy)(b,"exec"))return F=!0,b;if("string"==typeof b)if(1===b.length)return b;else{var e=new RegExp(b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"));return d.useSticky?C(e):B(e)}throw Error("non exhaustive match")})}),A("misc mapping",function(){h=(0,i.Tj)(e,function(a){return a.tokenTypeIdx}),k=(0,i.Tj)(e,function(a){var b=a.GROUP;if(b!==V.SKIPPED){if((0,i.Kg)(b))return b;if((0,i.b0)(b))return!1;throw Error("non exhaustive match")}}),l=(0,i.Tj)(e,function(a){var b=a.LONGER_ALT;if(b)return(0,i.qh)(e,b)}),n=(0,i.Tj)(e,function(a){return a.PUSH_MODE}),r=(0,i.Tj)(e,function(a){return(0,i.zy)(a,"POP_MODE")})}),A("Line Terminator Handling",function(){var a=H(d.lineTerminatorCharacters);s=(0,i.Tj)(e,function(a){return!1}),"onlyOffset"!==d.positionTracking&&(s=(0,i.Tj)(e,function(b){return(0,i.zy)(b,"LINE_BREAKS")?b.LINE_BREAKS:!1===G(b,a)?t(a,b.PATTERN):void 0}))}),A("Misc Mapping #2",function(){u=(0,i.Tj)(e,D),w=(0,i.Tj)(g,E),x=(0,i.TS)(e,function(a,b){var c=b.GROUP;return(0,i.Kg)(c)&&c!==V.SKIPPED&&(a[c]=[]),a},{}),z=(0,i.Tj)(g,function(a,b){return{pattern:g[b],longerAlt:l[b],canLineTerminator:s[b],isCustom:u[b],short:w[b],group:k[b],push:n[b],pop:r[b],tokenTypeIdx:h[b],tokenType:e[b]}})}),L=!0,M=[],d.safeMode||A("First Char Optimization",function(){M=(0,i.TS)(e,function(a,b,c){if("string"==typeof b.PATTERN){var e;I(a,J(b.PATTERN.charCodeAt(0)),z[c])}else if((0,i.cy)(b.START_CHARS_HINT))(0,i.jJ)(b.START_CHARS_HINT,function(b){var d=J("string"==typeof b?b.charCodeAt(0):b);e!==d&&(e=d,I(a,d,z[c]))});else if((0,i.gd)(b.PATTERN))if(b.PATTERN.unicode)L=!1,d.ensureOptimizations&&(0,i.Zi)(""+p+" Unable to analyze < "+b.PATTERN.toString()+" > pattern.\n The regexp unicode flag is not currently supported by the regexp-to-ast library.\n This will disable the lexer's first char optimizations.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var f=function(a,b){void 0===b&&(b=!1);try{var c=m(a);return function a(b,c,d){switch(b.type){case"Disjunction":for(var e=0;e<b.value.length;e++)a(b.value[e],c,d);break;case"Alternative":for(var f=b.value,e=0;e<f.length;e++){var g=f[e];switch(g.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}switch(g.type){case"Character":q(g.value,c,d);break;case"Set":if(!0===g.complement)throw Error(o);(0,i.jJ)(g.value,function(a){if("number"==typeof a)q(a,c,d);else if(!0===d)for(var b=a.from;b<=a.to;b++)q(b,c,d);else{for(var b=a.from;b<=a.to&&b<256;b++)q(b,c,d);if(a.to>=256)for(var e=a.from>=256?a.from:256,f=a.to,g=J(e),h=J(f),i=g;i<=h;i++)c[i]=i}});break;case"Group":a(g.value,c,d);break;default:throw Error("Non Exhaustive Match")}var h=void 0!==g.quantifier&&0===g.quantifier.atLeast;if("Group"===g.type&&!1===function a(b){return!!b.quantifier&&0===b.quantifier.atLeast||!!b.value&&((0,i.cy)(b.value)?(0,i.Si)(b.value,a):a(b.value))}(g)||"Group"!==g.type&&!1===h)break}break;default:throw Error("non exhaustive match!")}return(0,i.zu)(c)}(c.value,{},c.flags.ignoreCase)}catch(c){if(c.message===o)b&&(0,i.x5)(""+p+" Unable to optimize: < "+a.toString()+" >\n Complement Sets cannot be automatically optimized.\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var d="";b&&(d="\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),(0,i.Zi)(p+"\n Failed parsing: < "+a.toString()+" >\n Using the regexp-to-ast library version: "+j.VERSION+"\n Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+d)}}return[]}(b.PATTERN,d.ensureOptimizations);(0,i.Im)(f)&&(L=!1),(0,i.jJ)(f,function(b){I(a,b,z[c])})}else d.ensureOptimizations&&(0,i.Zi)(""+p+" TokenType: <"+b.name+"> is using a custom token pattern without providing <start_chars_hint> parameter.\n This will disable the lexer's first char optimizations.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),L=!1;return a},[])}),A("ArrayPacking",function(){M=(0,i.VS)(M)}),f={emptyGroups:x,patternIdxToConfig:z,charCodeToPatternIdxToConfig:M,hasCustom:F,canBeOptimized:L}}),c.patternIdxToConfig[e]=f.patternIdxToConfig,c.charCodeToPatternIdxToConfig[e]=f.charCodeToPatternIdxToConfig,c.emptyGroups=(0,i.h1)(c.emptyGroups,f.emptyGroups),c.hasCustom=f.hasCustom||c.hasCustom,c.canModeBeOptimized[e]=f.canBeOptimized}})}),c.defaultMode=e.defaultMode,!(0,i.Im)(c.lexerDefinitionErrors)&&!c.config.deferDefinitionErrorsHandling)throw Error("Errors detected in definition of Lexer:\n"+(0,i.Tj)(c.lexerDefinitionErrors,function(a){return a.message}).join("-----------------------\n"));(0,i.jJ)(c.lexerDefinitionWarning,function(a){(0,i.x5)(a.message)}),c.TRACE_INIT("Choosing sub-methods implementations",function(){if(y?(c.chopInput=i.zK,c.match=c.matchWithTest):(c.updateLastIndex=i.tE,c.match=c.matchWithExec),f&&(c.handleModes=i.tE),!1===c.trackStartLines&&(c.computeNewColumn=i.zK),!1===c.trackEndLines&&(c.updateTokenEndLineColumnLocation=i.tE),/full/i.test(c.config.positionTracking))c.createTokenInstance=c.createFullToken;else if(/onlyStart/i.test(c.config.positionTracking))c.createTokenInstance=c.createStartOnlyToken;else if(/onlyOffset/i.test(c.config.positionTracking))c.createTokenInstance=c.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+c.config.positionTracking+'"');c.hasCustom?(c.addToken=c.addTokenUsingPush,c.handlePayload=c.handlePayloadWithCustom):(c.addToken=c.addTokenUsingMemberAccess,c.handlePayload=c.handlePayloadNoCustom)}),c.TRACE_INIT("Failed Optimization Warnings",function(){var a=(0,i.TS)(c.canModeBeOptimized,function(a,b,c){return!1===b&&a.push(c),a},[]);if(b.ensureOptimizations&&!(0,i.Im)(a))throw Error("Lexer Modes: < "+a.join(", ")+' > cannot be optimized.\n Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n Or inspect the console log for details on how to resolve these issues.')}),c.TRACE_INIT("clearRegExpParserCache",function(){k={}}),c.TRACE_INIT("toFastProperties",function(){(0,i.Bl)(c)})})}return a.prototype.tokenize=function(a,b){if(void 0===b&&(b=this.defaultMode),!(0,i.Im)(this.lexerDefinitionErrors))throw Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+(0,i.Tj)(this.lexerDefinitionErrors,function(a){return a.message}).join("-----------------------\n"));return this.tokenizeInternal(a,b)},a.prototype.tokenizeInternal=function(a,b){var c,d,e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v=this,w=a,x=w.length,y=0,z=0,A=Array(this.hasCustom?0:Math.floor(a.length/10)),B=[],C=this.trackStartLines?1:void 0,D=this.trackStartLines?1:void 0,E=(c=this.emptyGroups,d={},e=(0,i.HP)(c),(0,i.jJ)(e,function(a){var b=c[a];if((0,i.cy)(b))d[a]=[];else throw Error("non exhaustive match")}),d),F=this.trackStartLines,G=this.config.lineTerminatorsPattern,H=0,I=[],K=[],L=[],M=[];Object.freeze(M);var N=void 0;function O(){return I}function P(a){var b=K[J(a)];return void 0===b?M:b}var Q=function(a){if(1===L.length&&void 0===a.tokenType.PUSH_MODE){var b=v.config.errorMessageProvider.buildUnableToPopLexerModeMessage(a);B.push({offset:a.startOffset,line:void 0!==a.startLine?a.startLine:void 0,column:void 0!==a.startColumn?a.startColumn:void 0,length:a.image.length,message:b})}else{L.pop();var c=(0,i.HV)(L);I=v.patternIdxToConfig[c],K=v.charCodeToPatternIdxToConfig[c],H=I.length;var d=v.canModeBeOptimized[c]&&!1===v.config.safeMode;N=K&&d?P:O}};function R(a){L.push(a),K=this.charCodeToPatternIdxToConfig[a],H=(I=this.patternIdxToConfig[a]).length,H=I.length;var b=this.canModeBeOptimized[a]&&!1===this.config.safeMode;N=K&&b?P:O}for(R.call(this,b);y<x;){k=null;var S=w.charCodeAt(y),T=N(S),U=T.length;for(f=0;f<U;f++){var V=(u=T[f]).pattern;l=null;var W=u.short;if(!1!==W?S===W&&(k=V):!0===u.isCustom?null!==(t=V.exec(w,y,A,E))?(k=t[0],void 0!==t.payload&&(l=t.payload)):k=null:(this.updateLastIndex(V,y),k=this.match(V,a,y)),null!==k){if(void 0!==(j=u.longerAlt)){var X=I[j],Y=X.pattern;m=null,!0===X.isCustom?null!==(t=Y.exec(w,y,A,E))?(h=t[0],void 0!==t.payload&&(m=t.payload)):h=null:(this.updateLastIndex(Y,y),h=this.match(Y,a,y)),h&&h.length>k.length&&(k=h,l=m,u=X)}break}}if(null!==k){if(n=k.length,void 0!==(o=u.group)&&(p=u.tokenTypeIdx,q=this.createTokenInstance(k,y,p,u.tokenType,C,D,n),this.handlePayload(q,l),!1===o?z=this.addToken(A,z,q):E[o].push(q)),a=this.chopInput(a,n),y+=n,D=this.computeNewColumn(D,n),!0===F&&!0===u.canLineTerminator){var Z=0,_=void 0,aa=void 0;G.lastIndex=0;do!0===(_=G.test(k))&&(aa=G.lastIndex-1,Z++);while(!0===_);0!==Z&&(C+=Z,D=n-aa,this.updateTokenEndLineColumnLocation(q,o,aa,Z,C,D,n))}this.handleModes(u,Q,R,q)}else{for(var ab=y,ac=C,ad=D,ae=!1;!ae&&y<x;)for(w.charCodeAt(y),a=this.chopInput(a,1),y++,g=0;g<H;g++){var af=I[g],V=af.pattern,W=af.short;if(!1!==W?w.charCodeAt(y)===W&&(ae=!0):!0===af.isCustom?ae=null!==V.exec(w,y,A,E):(this.updateLastIndex(V,y),ae=null!==V.exec(a)),!0===ae)break}r=y-ab,s=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,ab,r,ac,ad),B.push({offset:ab,line:ac,column:ad,length:r,message:s})}}return this.hasCustom||(A.length=z),{tokens:A,groups:E,errors:B}},a.prototype.handleModes=function(a,b,c,d){if(!0===a.pop){var e=a.push;b(d),void 0!==e&&c.call(this,e)}else void 0!==a.push&&c.call(this,a.push)},a.prototype.chopInput=function(a,b){return a.substring(b)},a.prototype.updateLastIndex=function(a,b){a.lastIndex=b},a.prototype.updateTokenEndLineColumnLocation=function(a,b,c,d,e,f,g){var h,i;void 0!==b&&(i=(h=c===g-1)?-1:0,(1!==d||!0!==h)&&(a.endLine=e+i,a.endColumn=f-1+-i))},a.prototype.computeNewColumn=function(a,b){return a+b},a.prototype.createTokenInstance=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return null},a.prototype.createOffsetOnlyToken=function(a,b,c,d){return{image:a,startOffset:b,tokenTypeIdx:c,tokenType:d}},a.prototype.createStartOnlyToken=function(a,b,c,d,e,f){return{image:a,startOffset:b,startLine:e,startColumn:f,tokenTypeIdx:c,tokenType:d}},a.prototype.createFullToken=function(a,b,c,d,e,f,g){return{image:a,startOffset:b,endOffset:b+g-1,startLine:e,endLine:e,startColumn:f,endColumn:f+g-1,tokenTypeIdx:c,tokenType:d}},a.prototype.addToken=function(a,b,c){return 666},a.prototype.addTokenUsingPush=function(a,b,c){return a.push(c),b},a.prototype.addTokenUsingMemberAccess=function(a,b,c){return a[b]=c,++b},a.prototype.handlePayload=function(a,b){},a.prototype.handlePayloadNoCustom=function(a,b){},a.prototype.handlePayloadWithCustom=function(a,b){null!==b&&(a.payload=b)},a.prototype.match=function(a,b,c){return null},a.prototype.matchWithTest=function(a,b,c){return!0===a.test(b)?b.substring(c,a.lastIndex):null},a.prototype.matchWithExec=function(a,b){var c=a.exec(b);return null!==c?c[0]:c},a.prototype.TRACE_INIT=function(a,b){if(!0!==this.traceInitPerf)return b();this.traceInitIndent++;var c=Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--\x3e <"+a+">");var d=(0,i.O1)(b),e=d.time,f=d.value,g=e>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(c+"<-- <"+a+"> time: "+e+"ms"),this.traceInitIndent--,f},a.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",a.NA=/NOT_APPLICABLE/,a}();function W(a){return Y(a)?a.LABEL:a.name}function X(a){return a.name}function Y(a){return(0,i.Kg)(a.LABEL)&&""!==a.LABEL}var Z="categories",_="label",aa="group",ab="push_mode",ac="pop_mode",ad="longer_alt",ae="line_breaks",af="start_chars_hint";function ag(a){return ah(a)}function ah(a){var b=a.pattern,c={};if(c.name=a.name,(0,i.b0)(b)||(c.PATTERN=b),(0,i.zy)(a,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";return(0,i.zy)(a,Z)&&(c.CATEGORIES=a[Z]),P([c]),(0,i.zy)(a,_)&&(c.LABEL=a[_]),(0,i.zy)(a,aa)&&(c.GROUP=a[aa]),(0,i.zy)(a,ac)&&(c.POP_MODE=a[ac]),(0,i.zy)(a,ab)&&(c.PUSH_MODE=a[ab]),(0,i.zy)(a,ad)&&(c.LONGER_ALT=a[ad]),(0,i.zy)(a,ae)&&(c.LINE_BREAKS=a[ae]),(0,i.zy)(a,af)&&(c.START_CHARS_HINT=a[af]),c}var ai=ah({name:"EOF",pattern:V.NA});function aj(a,b,c,d,e,f,g,h){return{image:b,startOffset:c,endOffset:d,startLine:e,endLine:f,startColumn:g,endColumn:h,tokenTypeIdx:a.tokenTypeIdx,tokenType:a}}function ak(a,b){return L(a,b)}P([ai]);var al=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),am=function(){function a(a){this._definition=a}return Object.defineProperty(a.prototype,"definition",{get:function(){return this._definition},set:function(a){this._definition=a},enumerable:!1,configurable:!0}),a.prototype.accept=function(a){a.visit(this),(0,i.jJ)(this.definition,function(b){b.accept(a)})},a}(),an=function(a){function b(b){var c=a.call(this,[])||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),Object.defineProperty(b.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(a){},enumerable:!1,configurable:!0}),b.prototype.accept=function(a){a.visit(this)},b}(am),ao=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.orgText="",(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),ap=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.ignoreAmbiguities=!1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),aq=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),ar=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),as=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),at=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),au=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),av=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,c.ignoreAmbiguities=!1,c.hasPredicates=!1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),Object.defineProperty(b.prototype,"definition",{get:function(){return this._definition},set:function(a){this._definition=a},enumerable:!1,configurable:!0}),b}(am),aw=function(){function a(a){this.idx=1,(0,i.kp)(this,(0,i.Up)(a,function(a){return void 0!==a}))}return a.prototype.accept=function(a){a.visit(this)},a}();function ax(a){return(0,i.Tj)(a,ay)}function ay(a){function b(a){return(0,i.Tj)(a,ay)}if(a instanceof an)return{type:"NonTerminal",name:a.nonTerminalName,idx:a.idx};if(a instanceof ap)return{type:"Alternative",definition:b(a.definition)};if(a instanceof aq)return{type:"Option",idx:a.idx,definition:b(a.definition)};if(a instanceof ar)return{type:"RepetitionMandatory",idx:a.idx,definition:b(a.definition)};if(a instanceof as)return{type:"RepetitionMandatoryWithSeparator",idx:a.idx,separator:ay(new aw({terminalType:a.separator})),definition:b(a.definition)};else if(a instanceof au)return{type:"RepetitionWithSeparator",idx:a.idx,separator:ay(new aw({terminalType:a.separator})),definition:b(a.definition)};else if(a instanceof at)return{type:"Repetition",idx:a.idx,definition:b(a.definition)};else if(a instanceof av)return{type:"Alternation",idx:a.idx,definition:b(a.definition)};else if(a instanceof aw){var c={type:"Terminal",name:a.terminalType.name,label:W(a.terminalType),idx:a.idx},d=a.terminalType.PATTERN;return a.terminalType.PATTERN&&(c.pattern=(0,i.gd)(d)?d.source:d),c}else if(a instanceof ao)return{type:"Rule",name:a.name,orgText:a.orgText,definition:b(a.definition)};else throw Error("non exhaustive match")}var az=function(){function a(){}return a.prototype.walk=function(a,b){var c=this;void 0===b&&(b=[]),(0,i.jJ)(a.definition,function(d,e){var f=(0,i.gv)(a.definition,e+1);if(d instanceof an)c.walkProdRef(d,f,b);else if(d instanceof aw)c.walkTerminal(d,f,b);else if(d instanceof ap)c.walkFlat(d,f,b);else if(d instanceof aq)c.walkOption(d,f,b);else if(d instanceof ar)c.walkAtLeastOne(d,f,b);else if(d instanceof as)c.walkAtLeastOneSep(d,f,b);else if(d instanceof au)c.walkManySep(d,f,b);else if(d instanceof at)c.walkMany(d,f,b);else if(d instanceof av)c.walkOr(d,f,b);else throw Error("non exhaustive match")})},a.prototype.walkTerminal=function(a,b,c){},a.prototype.walkProdRef=function(a,b,c){},a.prototype.walkFlat=function(a,b,c){var d=b.concat(c);this.walk(a,d)},a.prototype.walkOption=function(a,b,c){var d=b.concat(c);this.walk(a,d)},a.prototype.walkAtLeastOne=function(a,b,c){var d=[new aq({definition:a.definition})].concat(b,c);this.walk(a,d)},a.prototype.walkAtLeastOneSep=function(a,b,c){var d=aA(a,b,c);this.walk(a,d)},a.prototype.walkMany=function(a,b,c){var d=[new aq({definition:a.definition})].concat(b,c);this.walk(a,d)},a.prototype.walkManySep=function(a,b,c){var d=aA(a,b,c);this.walk(a,d)},a.prototype.walkOr=function(a,b,c){var d=this,e=b.concat(c);(0,i.jJ)(a.definition,function(a){var b=new ap({definition:[a]});d.walk(b,e)})},a}();function aA(a,b,c){return[new aq({definition:[new aw({terminalType:a.separator})].concat(a.definition)})].concat(b,c)}var aB=function(){function a(){}return a.prototype.visit=function(a){switch(a.constructor){case an:return this.visitNonTerminal(a);case ap:return this.visitAlternative(a);case aq:return this.visitOption(a);case ar:return this.visitRepetitionMandatory(a);case as:return this.visitRepetitionMandatoryWithSeparator(a);case au:return this.visitRepetitionWithSeparator(a);case at:return this.visitRepetition(a);case av:return this.visitAlternation(a);case aw:return this.visitTerminal(a);case ao:return this.visitRule(a);default:throw Error("non exhaustive match")}},a.prototype.visitNonTerminal=function(a){},a.prototype.visitAlternative=function(a){},a.prototype.visitOption=function(a){},a.prototype.visitRepetition=function(a){},a.prototype.visitRepetitionMandatory=function(a){},a.prototype.visitRepetitionMandatoryWithSeparator=function(a){},a.prototype.visitRepetitionWithSeparator=function(a){},a.prototype.visitAlternation=function(a){},a.prototype.visitTerminal=function(a){},a.prototype.visitRule=function(a){},a}(),aC=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();function aD(a,b){return void 0===b&&(b=[]),a instanceof aq||a instanceof at||a instanceof au||(a instanceof av?(0,i.zN)(a.definition,function(a){return aD(a,b)}):!(a instanceof an&&(0,i.gR)(b,a))&&a instanceof am&&(a instanceof an&&b.push(a),(0,i.Si)(a.definition,function(a){return aD(a,b)})))}function aE(a){if(a instanceof an)return"SUBRULE";if(a instanceof aq)return"OPTION";if(a instanceof av)return"OR";if(a instanceof ar)return"AT_LEAST_ONE";if(a instanceof as)return"AT_LEAST_ONE_SEP";else if(a instanceof au)return"MANY_SEP";else if(a instanceof at)return"MANY";else if(a instanceof aw)return"CONSUME";else throw Error("non exhaustive match")}var aF=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.separator="-",b.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},b}return aC(b,a),b.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},b.prototype.visitTerminal=function(a){var b=a.terminalType.name+this.separator+"Terminal";(0,i.zy)(this.dslMethods,b)||(this.dslMethods[b]=[]),this.dslMethods[b].push(a)},b.prototype.visitNonTerminal=function(a){var b=a.nonTerminalName+this.separator+"Terminal";(0,i.zy)(this.dslMethods,b)||(this.dslMethods[b]=[]),this.dslMethods[b].push(a)},b.prototype.visitOption=function(a){this.dslMethods.option.push(a)},b.prototype.visitRepetitionWithSeparator=function(a){this.dslMethods.repetitionWithSeparator.push(a)},b.prototype.visitRepetitionMandatory=function(a){this.dslMethods.repetitionMandatory.push(a)},b.prototype.visitRepetitionMandatoryWithSeparator=function(a){this.dslMethods.repetitionMandatoryWithSeparator.push(a)},b.prototype.visitRepetition=function(a){this.dslMethods.repetition.push(a)},b.prototype.visitAlternation=function(a){this.dslMethods.alternation.push(a)},b}(aB),aG=new aF;function aH(a){if(a instanceof an)return aH(a.referencedRule);if(a instanceof aw)return[a.terminalType];if(a instanceof ap||a instanceof aq||a instanceof at||a instanceof ar||a instanceof as||a instanceof au||a instanceof aw||a instanceof ao)return function(a){for(var b,c=[],d=a.definition,e=0,f=d.length>e,g=!0;f&&g;)g=aD(b=d[e]),c=c.concat(aH(b)),e+=1,f=d.length>e;return(0,i.sb)(c)}(a);if(a instanceof av){var b,c;return b=a,c=(0,i.Tj)(b.definition,function(a){return aH(a)}),(0,i.sb)((0,i.Bq)(c))}throw Error("non exhaustive match")}var aI="_~IN~_",aJ=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),aK=function(a){function b(b){var c=a.call(this)||this;return c.topProd=b,c.follows={},c}return aJ(b,a),b.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},b.prototype.walkTerminal=function(a,b,c){},b.prototype.walkProdRef=function(a,b,c){var d,e,f=(d=a.referencedRule,e=a.idx,d.name+e+aI+this.topProd.name),g=aH(new ap({definition:b.concat(c)}));this.follows[f]=g},b}(az),aL={buildMismatchTokenMessage:function(a){var b=a.expected,c=a.actual;return a.previous,a.ruleName,"Expecting "+(Y(b)?"--\x3e "+W(b)+" <--":"token of type --\x3e "+b.name+" <--")+" but found --\x3e '"+c.image+"' <--"},buildNotAllInputParsedMessage:function(a){var b=a.firstRedundant;return a.ruleName,"Redundant input, expecting EOF but found: "+b.image},buildNoViableAltMessage:function(a){var b=a.expectedPathsPerAlt,c=a.actual,d=(a.previous,a.customUserDescription);a.ruleName;var e="Expecting: ",f="\nbut found: '"+(0,i.$1)(c).image+"'";if(d)return e+d+f;var g=(0,i.TS)(b,function(a,b){return a.concat(b)},[]),h=(0,i.Tj)(g,function(a){return"["+(0,i.Tj)(a,function(a){return W(a)}).join(", ")+"]"});return e+"one of these possible Token sequences:\n"+(0,i.Tj)(h,function(a,b){return" "+(b+1)+". "+a}).join("\n")+f},buildEarlyExitMessage:function(a){var b=a.expectedIterationPaths,c=a.actual,d=a.customUserDescription;a.ruleName;var e="Expecting: ",f="\nbut found: '"+(0,i.$1)(c).image+"'";return d?e+d+f:e+("expecting at least one iteration which starts with one of these possible Token sequences::\n <"+(0,i.Tj)(b,function(a){return"["+(0,i.Tj)(a,function(a){return W(a)}).join(",")+"]"}).join(" ,"))+">"+f}};Object.freeze(aL);var aM={buildRuleNotFoundError:function(a,b){return"Invalid grammar, reference to a rule which is not defined: ->"+b.nonTerminalName+"<-\ninside top level rule: ->"+a.name+"<-"}},aN={buildDuplicateFoundError:function(a,b){var c=a.name,d=(0,i.$1)(b),e=d.idx,f=aE(d),g=d instanceof aw?d.terminalType.name:d instanceof an?d.nonTerminalName:"",h="->"+f+(e>0?e:"")+"<- "+(g?"with argument: ->"+g+"<-":"")+"\n appears more than once ("+b.length+" times) in the top level rule: ->"+c+"<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return(h=h.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildNamespaceConflictError:function(a){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+a.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(a){var b=(0,i.Tj)(a.prefixPath,function(a){return W(a)}).join(", "),c=0===a.alternation.idx?"":a.alternation.idx;return"Ambiguous alternatives: <"+a.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\n"+("in <OR"+c+"> inside <")+a.topLevelRule.name+"> Rule,\n<"+b+"> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(a){var b=(0,i.Tj)(a.prefixPath,function(a){return W(a)}).join(", "),c=0===a.alternation.idx?"":a.alternation.idx,d="Ambiguous Alternatives Detected: <"+a.ambiguityIndices.join(" ,")+"> in <OR"+c+"> inside <"+a.topLevelRule.name+"> Rule,\n<"+b+"> may appears as a prefix path in all these alternatives.\n";return d+"See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(a){var b=aE(a.repetition);return 0!==a.repetition.idx&&(b+=a.repetition.idx),"The repetition <"+b+"> within Rule <"+a.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(a){return"deprecated"},buildEmptyAlternationError:function(a){return"Ambiguous empty alternative: <"+(a.emptyChoiceIdx+1)+">"+(" in <OR"+a.alternation.idx+"> inside <")+a.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(a){return"An Alternation cannot have more than 256 alternatives:\n"+("<OR"+a.alternation.idx+"> inside <"+a.topLevelRule.name+"> Rule.\n has ")+(a.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(a){var b=a.topLevelRule.name,c=b+" --\x3e "+i.Tj(a.leftRecursionPath,function(a){return a.name}).concat([b]).join(" --\x3e ");return"Left Recursion found in grammar.\nrule: <"+b+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+c+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(a){return"deprecated"},buildDuplicateRuleNameError:function(a){return"Duplicate definition, rule: ->"+(a.topLevelRule instanceof ao?a.topLevelRule.name:a.topLevelRule)+"<- is already defined in the grammar: ->"+a.grammarName+"<-"}},aO=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),aP=function(a){function b(b,c){var d=a.call(this)||this;return d.nameToTopRule=b,d.errMsgProvider=c,d.errors=[],d}return aO(b,a),b.prototype.resolveRefs=function(){var a=this;(0,i.jJ)((0,i.zu)(this.nameToTopRule),function(b){a.currTopLevel=b,b.accept(a)})},b.prototype.visitNonTerminal=function(a){var b=this.nameToTopRule[a.nonTerminalName];if(b)a.referencedRule=b;else{var c=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,a);this.errors.push({message:c,type:g.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:a.nonTerminalName})}},b}(aB),aQ=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),aR=function(a){function b(b,c){var d=a.call(this,b,c)||this;return d.path=c,d.nextTerminalName="",d.nextTerminalOccurrence=0,d.nextTerminalName=d.path.lastTok.name,d.nextTerminalOccurrence=d.path.lastTokOccurrence,d}return aQ(b,a),b.prototype.walkTerminal=function(a,b,c){if(this.isAtEndOfPath&&a.terminalType.name===this.nextTerminalName&&a.idx===this.nextTerminalOccurrence&&!this.found){var d=new ap({definition:b.concat(c)});this.possibleTokTypes=aH(d),this.found=!0}},b}(function(a){function b(b,c){var d=a.call(this)||this;return d.topProd=b,d.path=c,d.possibleTokTypes=[],d.nextProductionName="",d.nextProductionOccurrence=0,d.found=!1,d.isAtEndOfPath=!1,d}return aQ(b,a),b.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,i.T9)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,i.T9)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},b.prototype.walk=function(b,c){void 0===c&&(c=[]),this.found||a.prototype.walk.call(this,b,c)},b.prototype.walkProdRef=function(a,b,c){if(a.referencedRule.name===this.nextProductionName&&a.idx===this.nextProductionOccurrence){var d=b.concat(c);this.updateExpectedNext(),this.walk(a.referencedRule,d)}},b.prototype.updateExpectedNext=function(){(0,i.Im)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},b}(az)),aS=function(a){function b(b,c){var d=a.call(this)||this;return d.topRule=b,d.occurrence=c,d.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},d}return aQ(b,a),b.prototype.startWalking=function(){return this.walk(this.topRule),this.result},b}(az),aT=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return aQ(b,a),b.prototype.walkMany=function(b,c,d){if(b.idx===this.occurrence){var e=(0,i.$1)(c.concat(d));this.result.isEndOfRule=void 0===e,e instanceof aw&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else a.prototype.walkMany.call(this,b,c,d)},b}(aS),aU=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return aQ(b,a),b.prototype.walkManySep=function(b,c,d){if(b.idx===this.occurrence){var e=(0,i.$1)(c.concat(d));this.result.isEndOfRule=void 0===e,e instanceof aw&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else a.prototype.walkManySep.call(this,b,c,d)},b}(aS),aV=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return aQ(b,a),b.prototype.walkAtLeastOne=function(b,c,d){if(b.idx===this.occurrence){var e=(0,i.$1)(c.concat(d));this.result.isEndOfRule=void 0===e,e instanceof aw&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else a.prototype.walkAtLeastOne.call(this,b,c,d)},b}(aS),aW=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return aQ(b,a),b.prototype.walkAtLeastOneSep=function(b,c,d){if(b.idx===this.occurrence){var e=(0,i.$1)(c.concat(d));this.result.isEndOfRule=void 0===e,e instanceof aw&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else a.prototype.walkAtLeastOneSep.call(this,b,c,d)},b}(aS);function aX(a,b,c){void 0===c&&(c=[]),c=(0,i.T9)(c);var d=[],e=0;function f(f){var g=aX(f.concat((0,i.gv)(a,e+1)),b,c);return d.concat(g)}for(;c.length<b&&e<a.length;){var g=a[e];if(g instanceof ap)return f(g.definition);if(g instanceof an)return f(g.definition);if(g instanceof aq)d=f(g.definition);else if(g instanceof ar){var h=g.definition.concat([new at({definition:g.definition})]);return f(h)}else if(g instanceof as){var h=[new ap({definition:g.definition}),new at({definition:[new aw({terminalType:g.separator})].concat(g.definition)})];return f(h)}else if(g instanceof au){var h=g.definition.concat([new at({definition:[new aw({terminalType:g.separator})].concat(g.definition)})]);d=f(h)}else if(g instanceof at){var h=g.definition.concat([new at({definition:g.definition})]);d=f(h)}else if(g instanceof av)return(0,i.jJ)(g.definition,function(a){!1===(0,i.Im)(a.definition)&&(d=f(a.definition))}),d;else if(g instanceof aw)c.push(g.terminalType);else throw Error("non exhaustive match");e++}return d.push({partialPath:c,suffixDef:(0,i.gv)(a,e)}),d}function aY(a,b,c,d){var e="EXIT_NONE_TERMINAL",f=[e],g="EXIT_ALTERNATIVE",h=!1,j=b.length,k=j-d-1,l=[],m=[];for(m.push({idx:-1,def:a,ruleStack:[],occurrenceStack:[]});!(0,i.Im)(m);){var n=m.pop();if(n===g){h&&(0,i.HV)(m).idx<=k&&m.pop();continue}var o=n.def,p=n.idx,q=n.ruleStack,r=n.occurrenceStack;if(!(0,i.Im)(o)){var s=o[0];if(s===e){var t={idx:p,def:(0,i.gv)(o),ruleStack:(0,i.gc)(q),occurrenceStack:(0,i.gc)(r)};m.push(t)}else if(s instanceof aw)if(p<j-1){var u=p+1;if(c(b[u],s.terminalType)){var t={idx:u,def:(0,i.gv)(o),ruleStack:q,occurrenceStack:r};m.push(t)}}else if(p===j-1)l.push({nextTokenType:s.terminalType,nextTokenOccurrence:s.idx,ruleStack:q,occurrenceStack:r}),h=!0;else throw Error("non exhaustive match");else if(s instanceof an){var v=(0,i.T9)(q);v.push(s.nonTerminalName);var w=(0,i.T9)(r);w.push(s.idx);var t={idx:p,def:s.definition.concat(f,(0,i.gv)(o)),ruleStack:v,occurrenceStack:w};m.push(t)}else if(s instanceof aq){var x={idx:p,def:(0,i.gv)(o),ruleStack:q,occurrenceStack:r};m.push(x),m.push(g);var y={idx:p,def:s.definition.concat((0,i.gv)(o)),ruleStack:q,occurrenceStack:r};m.push(y)}else if(s instanceof ar){var z=new at({definition:s.definition,idx:s.idx}),A=s.definition.concat([z],(0,i.gv)(o)),t={idx:p,def:A,ruleStack:q,occurrenceStack:r};m.push(t)}else if(s instanceof as){var B=new aw({terminalType:s.separator}),z=new at({definition:[B].concat(s.definition),idx:s.idx}),A=s.definition.concat([z],(0,i.gv)(o)),t={idx:p,def:A,ruleStack:q,occurrenceStack:r};m.push(t)}else if(s instanceof au){var x={idx:p,def:(0,i.gv)(o),ruleStack:q,occurrenceStack:r};m.push(x),m.push(g);var B=new aw({terminalType:s.separator}),C=new at({definition:[B].concat(s.definition),idx:s.idx}),A=s.definition.concat([C],(0,i.gv)(o)),y={idx:p,def:A,ruleStack:q,occurrenceStack:r};m.push(y)}else if(s instanceof at){var x={idx:p,def:(0,i.gv)(o),ruleStack:q,occurrenceStack:r};m.push(x),m.push(g);var C=new at({definition:s.definition,idx:s.idx}),A=s.definition.concat([C],(0,i.gv)(o)),y={idx:p,def:A,ruleStack:q,occurrenceStack:r};m.push(y)}else if(s instanceof av)for(var D=s.definition.length-1;D>=0;D--){var E={idx:p,def:s.definition[D].definition.concat((0,i.gv)(o)),ruleStack:q,occurrenceStack:r};m.push(E),m.push(g)}else if(s instanceof ap)m.push({idx:p,def:s.definition.concat((0,i.gv)(o)),ruleStack:q,occurrenceStack:r});else if(s instanceof ao)m.push(function(a,b,c,d){var e=(0,i.T9)(c);e.push(a.name);var f=(0,i.T9)(d);return f.push(1),{idx:b,def:a.definition,ruleStack:e,occurrenceStack:f}}(s,p,q,r));else throw Error("non exhaustive match")}}return l}var aZ=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();!function(a){a[a.OPTION=0]="OPTION",a[a.REPETITION=1]="REPETITION",a[a.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",a[a.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",a[a.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",a[a.ALTERNATION=5]="ALTERNATION"}(e||(e={}));var a$=function(a){function b(b,c,d){var e=a.call(this)||this;return e.topProd=b,e.targetOccurrence=c,e.targetProdType=d,e}return aZ(b,a),b.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},b.prototype.checkIsTarget=function(a,b,c,d){return a.idx===this.targetOccurrence&&this.targetProdType===b&&(this.restDef=c.concat(d),!0)},b.prototype.walkOption=function(b,c,d){this.checkIsTarget(b,e.OPTION,c,d)||a.prototype.walkOption.call(this,b,c,d)},b.prototype.walkAtLeastOne=function(b,c,d){this.checkIsTarget(b,e.REPETITION_MANDATORY,c,d)||a.prototype.walkOption.call(this,b,c,d)},b.prototype.walkAtLeastOneSep=function(b,c,d){this.checkIsTarget(b,e.REPETITION_MANDATORY_WITH_SEPARATOR,c,d)||a.prototype.walkOption.call(this,b,c,d)},b.prototype.walkMany=function(b,c,d){this.checkIsTarget(b,e.REPETITION,c,d)||a.prototype.walkOption.call(this,b,c,d)},b.prototype.walkManySep=function(b,c,d){this.checkIsTarget(b,e.REPETITION_WITH_SEPARATOR,c,d)||a.prototype.walkOption.call(this,b,c,d)},b}(az),a_=function(a){function b(b,c,d){var e=a.call(this)||this;return e.targetOccurrence=b,e.targetProdType=c,e.targetRef=d,e.result=[],e}return aZ(b,a),b.prototype.checkIsTarget=function(a,b){a.idx===this.targetOccurrence&&this.targetProdType===b&&(void 0===this.targetRef||a===this.targetRef)&&(this.result=a.definition)},b.prototype.visitOption=function(a){this.checkIsTarget(a,e.OPTION)},b.prototype.visitRepetition=function(a){this.checkIsTarget(a,e.REPETITION)},b.prototype.visitRepetitionMandatory=function(a){this.checkIsTarget(a,e.REPETITION_MANDATORY)},b.prototype.visitRepetitionMandatoryWithSeparator=function(a){this.checkIsTarget(a,e.REPETITION_MANDATORY_WITH_SEPARATOR)},b.prototype.visitRepetitionWithSeparator=function(a){this.checkIsTarget(a,e.REPETITION_WITH_SEPARATOR)},b.prototype.visitAlternation=function(a){this.checkIsTarget(a,e.ALTERNATION)},b}(aB);function a0(a){for(var b=Array(a),c=0;c<a;c++)b[c]=[];return b}function a1(a){for(var b=[""],c=0;c<a.length;c++){for(var d=a[c],e=[],f=0;f<b.length;f++){var g=b[f];e.push(g+"_"+d.tokenTypeIdx);for(var h=0;h<d.categoryMatches.length;h++){var i="_"+d.categoryMatches[h];e.push(g+i)}}b=e}return b}function a2(a,b){for(var c=(0,i.Tj)(a,function(a){return aX([a],1)}),d=a0(c.length),e=(0,i.Tj)(c,function(a){var b={};return(0,i.jJ)(a,function(a){var c=a1(a.partialPath);(0,i.jJ)(c,function(a){b[a]=!0})}),b}),f=c,g=1;g<=b;g++){var h=f;f=a0(h.length);for(var j=function(a){for(var c=h[a],j=0;j<c.length;j++){var k=c[j].partialPath,l=c[j].suffixDef,m=a1(k);if(function(a,b,c){for(var d=0;d<a.length;d++)if(d!==c){for(var e=a[d],f=0;f<b.length;f++)if(!0===e[b[f]])return!1}return!0}(e,m,a)||(0,i.Im)(l)||k.length===b){var n=d[a];if(!1===a5(n,k)){n.push(k);for(var o=0;o<m.length;o++){var p=m[o];e[a][p]=!0}}}else{var q=aX(l,g+1,k);f[a]=f[a].concat(q),(0,i.jJ)(q,function(b){var c=a1(b.partialPath);(0,i.jJ)(c,function(b){e[a][b]=!0})})}}},k=0;k<h.length;k++)j(k)}return d}function a3(a,b,c,d){var f=new a_(a,e.ALTERNATION,d);return b.accept(f),a2(f.result,c)}function a4(a,b,c,d){var e=new a_(a,c);b.accept(e);var f=e.result,g=new a$(b,a,c).startWalking();return a2([new ap({definition:f}),new ap({definition:g})],d)}function a5(a,b){f:for(var c=0;c<a.length;c++){var d=a[c];if(d.length===b.length){for(var e=0;e<d.length;e++){var f=b[e],g=d[e];if(!1==(f===g||void 0!==g.categoryMatchesMap[f.tokenTypeIdx]))continue f}return!0}}return!1}function a6(a){return(0,i.Si)(a,function(a){return(0,i.Si)(a,function(a){return(0,i.Si)(a,function(a){return(0,i.Im)(a.categoryMatches)})})})}var a7=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();function a8(a){return aE(a)+"_#_"+a.idx+"_#_"+a9(a)}function a9(a){return a instanceof aw?a.terminalType.name:a instanceof an?a.nonTerminalName:""}var ba=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.allProductions=[],b}return a7(b,a),b.prototype.visitNonTerminal=function(a){this.allProductions.push(a)},b.prototype.visitOption=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionWithSeparator=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionMandatory=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionMandatoryWithSeparator=function(a){this.allProductions.push(a)},b.prototype.visitRepetition=function(a){this.allProductions.push(a)},b.prototype.visitAlternation=function(a){this.allProductions.push(a)},b.prototype.visitTerminal=function(a){this.allProductions.push(a)},b}(aB),bb=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.alternations=[],b}return a7(b,a),b.prototype.visitAlternation=function(a){this.alternations.push(a)},b}(aB),bc=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.allProductions=[],b}return a7(b,a),b.prototype.visitRepetitionWithSeparator=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionMandatory=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionMandatoryWithSeparator=function(a){this.allProductions.push(a)},b.prototype.visitRepetition=function(a){this.allProductions.push(a)},b}(aB);function bd(a){a=(0,i.NT)(a,{errMsgProvider:aM});var b,c={};return(0,i.jJ)(a.rules,function(a){c[a.name]=a}),(b=new aP(c,a.errMsgProvider)).resolveRefs(),b.errors}function be(a){var b,c,d,f,h,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return b=(a=(0,i.NT)(a,{errMsgProvider:aN})).rules,c=a.maxLookahead,d=a.tokenTypes,f=a.errMsgProvider,h=a.grammarName,j=i.Tj(b,function(a){var b,c,d,e,h,j;return b=a,c=f,d=new ba,b.accept(d),e=d.allProductions,h=i.$z(e,a8),j=i.Up(h,function(a){return a.length>1}),i.Tj(i.zu(j),function(a){var d=i.$1(a),e=c.buildDuplicateFoundError(b,a),f=aE(d),h={message:e,type:g.DUPLICATE_PRODUCTIONS,ruleName:b.name,dslName:f,occurrence:d.idx},j=a9(d);return j&&(h.parameter=j),h})}),k=i.Tj(b,function(a){return function a(b,c,d,e){void 0===e&&(e=[]);var f=[],h=function a(b){var c=[];if(i.Im(b))return c;var d=i.$1(b);if(d instanceof an)c.push(d.referencedRule);else if(d instanceof ap||d instanceof aq||d instanceof ar||d instanceof as||d instanceof au||d instanceof at)c=c.concat(a(d.definition));else if(d instanceof av)c=i.Bq(i.Tj(d.definition,function(b){return a(b.definition)}));else if(d instanceof aw);else throw Error("non exhaustive match");var e=aD(d),f=b.length>1;if(!e||!f)return c;var g=i.gv(b);return c.concat(a(g))}(c.definition);if(i.Im(h))return[];var j=b.name;i.gR(h,b)&&f.push({message:d.buildLeftRecursionError({topLevelRule:b,leftRecursionPath:e}),type:g.LEFT_RECURSION,ruleName:j});var k=i.iv(h,e.concat([b])),l=i.Tj(k,function(c){var f=i.T9(e);return f.push(c),a(b,c,d,f)});return f.concat(i.Bq(l))}(a,a,f)}),l=[],m=[],n=[],(0,i.Si)(k,i.Im)&&(l=(0,i.Tj)(b,function(a){var b,c,d,e;return b=a,c=f,d=new bb,b.accept(d),e=d.alternations,i.TS(e,function(a,d){var e=i.gc(d.definition),f=i.Tj(e,function(a,e){var f=aY([a],[],null,1);return i.Im(f)?{message:c.buildEmptyAlternationError({topLevelRule:b,alternation:d,emptyChoiceIdx:e}),type:g.NONE_LAST_EMPTY_ALT,ruleName:b.name,occurrence:d.idx,alternative:e+1}:null});return a.concat(i.oE(f))},[])}),m=(0,i.Tj)(b,function(a){var b,d,e,h,j;return b=a,d=c,e=f,h=new bb,b.accept(h),j=h.alternations,j=(0,i.ku)(j,function(a){return!0===a.ignoreAmbiguities}),i.TS(j,function(a,c){var f,h,j,k,l,m,n,o,p,q,r,s,t=a3(c.idx,b,c.maxLookahead||d,c),u=(f=t,h=c,j=b,k=e,l=[],m=(0,i.TS)(f,function(a,b,c){return!0===h.definition[c].ignoreAmbiguities||(0,i.jJ)(b,function(b){var d=[c];(0,i.jJ)(f,function(a,e){c!==e&&a5(a,b)&&!0!==h.definition[e].ignoreAmbiguities&&d.push(e)}),d.length>1&&!a5(l,b)&&(l.push(b),a.push({alts:d,path:b}))}),a},[]),i.Tj(m,function(a){var b=(0,i.Tj)(a.alts,function(a){return a+1});return{message:k.buildAlternationAmbiguityError({topLevelRule:j,alternation:h,ambiguityIndices:b,prefixPath:a.path}),type:g.AMBIGUOUS_ALTS,ruleName:j.name,occurrence:h.idx,alternatives:[a.alts]}})),v=(n=t,o=c,p=b,q=e,r=[],s=(0,i.TS)(n,function(a,b,c){var d=(0,i.Tj)(b,function(a){return{idx:c,path:a}});return a.concat(d)},[]),(0,i.jJ)(s,function(a){if(!0!==o.definition[a.idx].ignoreAmbiguities){var b=a.idx,c=a.path,d=(0,i.JW)(s,function(a){var d;return!0!==o.definition[a.idx].ignoreAmbiguities&&a.idx<b&&(d=a.path,d.length<c.length&&(0,i.Si)(d,function(a,b){var d=c[b];return a===d||d.categoryMatchesMap[a.tokenTypeIdx]}))}),e=(0,i.Tj)(d,function(a){var c=[a.idx+1,b+1],d=0===o.idx?"":o.idx;return{message:q.buildAlternationPrefixAmbiguityError({topLevelRule:p,alternation:o,ambiguityIndices:c,prefixPath:a.path}),type:g.AMBIGUOUS_PREFIX_ALTS,ruleName:p.name,occurrence:d,alternatives:c}});r=r.concat(e)}}),r);return a.concat(u,v)},[])}),r=b,s=c,t=f,u=[],(0,i.jJ)(r,function(a){var b=new bc;a.accept(b);var c=b.allProductions;(0,i.jJ)(c,function(b){var c=function(a){if(a instanceof aq)return e.OPTION;if(a instanceof at)return e.REPETITION;if(a instanceof ar)return e.REPETITION_MANDATORY;if(a instanceof as)return e.REPETITION_MANDATORY_WITH_SEPARATOR;if(a instanceof au)return e.REPETITION_WITH_SEPARATOR;else if(a instanceof av)return e.ALTERNATION;else throw Error("non exhaustive match")}(b),d=b.maxLookahead||s,f=a4(b.idx,a,c,d)[0];if((0,i.Im)((0,i.Bq)(f))){var h=t.buildEmptyRepetitionError({topLevelRule:a,repetition:b});u.push({message:h,type:g.NO_NON_EMPTY_LOOKAHEAD,ruleName:a.name})}})}),n=u),v=b,w=d,x=f,y=[],z=(0,i.Tj)(w,function(a){return a.name}),(0,i.jJ)(v,function(a){var b=a.name;if((0,i.gR)(z,b)){var c=x.buildNamespaceConflictError(a);y.push({message:c,type:g.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:b})}}),o=y,p=(0,i.Tj)(b,function(a){var b,c,d,e;return b=a,c=f,d=new bb,b.accept(d),e=d.alternations,i.TS(e,function(a,d){return d.definition.length>255&&a.push({message:c.buildTooManyAlternativesError({topLevelRule:b,alternation:d}),type:g.TOO_MANY_ALTS,ruleName:b.name,occurrence:d.idx}),a},[])}),q=(0,i.Tj)(b,function(a){var c=a,d=b,e=h,j=f,k=[];if((0,i.TS)(d,function(a,b){return b.name===c.name?a+1:a},0)>1){var l=j.buildDuplicateRuleNameError({topLevelRule:c,grammarName:e});k.push({message:l,type:g.DUPLICATE_RULE_NAME,ruleName:c.name})}return k}),i.Bq(j.concat(n,k,l,m,o,p,q))}function bf(a){(0,i.jJ)(a.rules,function(a){var b=new aF;a.accept(b),(0,i.jJ)(b.dslMethods,function(a){(0,i.jJ)(a,function(a,b){a.idx=b+1})})})}var bg=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),bh="MismatchedTokenException",bi="NoViableAltException",bj="EarlyExitException",bk="NotAllInputParsedException",bl=[bh,bi,bj,bk];function bm(a){return(0,i.gR)(bl,a.name)}Object.freeze(bl);var bn=function(a){function b(b,c){var d=this.constructor,e=a.call(this,b)||this;return e.token=c,e.resyncedTokens=[],Object.setPrototypeOf(e,d.prototype),Error.captureStackTrace&&Error.captureStackTrace(e,e.constructor),e}return bg(b,a),b}(Error),bo=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e.previousToken=d,e.name=bh,e}return bg(b,a),b}(bn),bp=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e.previousToken=d,e.name=bi,e}return bg(b,a),b}(bn),bq=function(a){function b(b,c){var d=a.call(this,b,c)||this;return d.name=bk,d}return bg(b,a),b}(bn),br=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e.previousToken=d,e.name=bj,e}return bg(b,a),b}(bn),bs={},bt="InRuleRecoveryException";function bu(a){this.name=bt,this.message=a}bu.prototype=Error.prototype;var bv=function(){function a(){}return a.prototype.initRecoverable=function(a){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,i.zy)(a,"recoveryEnabled")?a.recoveryEnabled:bX.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=bw)},a.prototype.getTokenToInsert=function(a){var b=aj(a,"",NaN,NaN,NaN,NaN,NaN,NaN);return b.isInsertedInRecovery=!0,b},a.prototype.canTokenTypeBeInsertedInRecovery=function(a){return!0},a.prototype.tryInRepetitionRecovery=function(a,b,c,d){for(var e=this,f=this.findReSyncTokenType(),g=this.exportLexerState(),h=[],j=!1,k=this.LA(1),l=this.LA(1),m=function(){var a=e.LA(0),b=new bo(e.errorMessageProvider.buildMismatchTokenMessage({expected:d,actual:k,previous:a,ruleName:e.getCurrRuleFullName()}),k,e.LA(0));b.resyncedTokens=(0,i.gc)(h),e.SAVE_ERROR(b)};!j;)if(this.tokenMatcher(l,d))return void m();else if(c.call(this)){m(),a.apply(this,b);return}else this.tokenMatcher(l,f)?j=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,h));this.importLexerState(g)},a.prototype.shouldInRepetitionRecoveryBeTried=function(a,b,c){return!(!1===c||void 0===a||void 0===b||this.tokenMatcher(this.LA(1),a)||this.isBackTracking()||this.canPerformInRuleRecovery(a,this.getFollowsForInRuleRecovery(a,b)))},a.prototype.getFollowsForInRuleRecovery=function(a,b){var c=this.getCurrentGrammarPath(a,b);return this.getNextPossibleTokenTypes(c)},a.prototype.tryInRuleRecovery=function(a,b){if(this.canRecoverWithSingleTokenInsertion(a,b))return this.getTokenToInsert(a);if(this.canRecoverWithSingleTokenDeletion(a)){var c=this.SKIP_TOKEN();return this.consumeToken(),c}throw new bu("sad sad panda")},a.prototype.canPerformInRuleRecovery=function(a,b){return this.canRecoverWithSingleTokenInsertion(a,b)||this.canRecoverWithSingleTokenDeletion(a)},a.prototype.canRecoverWithSingleTokenInsertion=function(a,b){var c=this;if(!this.canTokenTypeBeInsertedInRecovery(a)||(0,i.Im)(b))return!1;var d=this.LA(1);return void 0!==(0,i.I6)(b,function(a){return c.tokenMatcher(d,a)})},a.prototype.canRecoverWithSingleTokenDeletion=function(a){return this.tokenMatcher(this.LA(2),a)},a.prototype.isInCurrentRuleReSyncSet=function(a){var b=this.getCurrFollowKey(),c=this.getFollowSetFromFollowKey(b);return(0,i.gR)(c,a)},a.prototype.findReSyncTokenType=function(){for(var a=this.flattenFollowSet(),b=this.LA(1),c=2;;){var d=b.tokenType;if((0,i.gR)(a,d))return d;b=this.LA(c),c++}},a.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return bs;var a=this.getLastExplicitRuleShortName(),b=this.getLastExplicitRuleOccurrenceIndex(),c=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(a),idxInCallingRule:b,inRule:this.shortRuleNameToFullName(c)}},a.prototype.buildFullFollowKeyStack=function(){var a=this,b=this.RULE_STACK,c=this.RULE_OCCURRENCE_STACK;return(0,i.Tj)(b,function(d,e){return 0===e?bs:{ruleName:a.shortRuleNameToFullName(d),idxInCallingRule:c[e],inRule:a.shortRuleNameToFullName(b[e-1])}})},a.prototype.flattenFollowSet=function(){var a=this,b=(0,i.Tj)(this.buildFullFollowKeyStack(),function(b){return a.getFollowSetFromFollowKey(b)});return(0,i.Bq)(b)},a.prototype.getFollowSetFromFollowKey=function(a){if(a===bs)return[ai];var b=a.ruleName+a.idxInCallingRule+aI+a.inRule;return this.resyncFollows[b]},a.prototype.addToResyncTokens=function(a,b){return this.tokenMatcher(a,ai)||b.push(a),b},a.prototype.reSyncTo=function(a){for(var b=[],c=this.LA(1);!1===this.tokenMatcher(c,a);)c=this.SKIP_TOKEN(),this.addToResyncTokens(c,b);return(0,i.gc)(b)},a.prototype.attemptInRepetitionRecovery=function(a,b,c,d,e,f,g){},a.prototype.getCurrentGrammarPath=function(a,b){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,i.T9)(this.RULE_OCCURRENCE_STACK),lastTok:a,lastTokOccurrence:b}},a.prototype.getHumanReadableRuleStack=function(){var a=this;return(0,i.Tj)(this.RULE_STACK,function(b){return a.shortRuleNameToFullName(b)})},a}();function bw(a,b,c,d,e,f,g){var h=this.getKeyForAutomaticLookahead(d,e),i=this.firstAfterRepMap[h];if(void 0===i){var j=this.getCurrRuleFullName();i=new f(this.getGAstProductions()[j],e).startWalking(),this.firstAfterRepMap[h]=i}var k=i.token,l=i.occurrence,m=i.isEndOfRule;1===this.RULE_STACK.length&&m&&void 0===k&&(k=ai,l=1),this.shouldInRepetitionRecoveryBeTried(k,l,g)&&this.tryInRepetitionRecovery(a,b,c,k)}var bx=function(){function a(){}return a.prototype.initLooksAhead=function(a){this.dynamicTokensEnabled=(0,i.zy)(a,"dynamicTokensEnabled")?a.dynamicTokensEnabled:bX.dynamicTokensEnabled,this.maxLookahead=(0,i.zy)(a,"maxLookahead")?a.maxLookahead:bX.maxLookahead,this.lookAheadFuncsCache=(0,i.rF)()?new Map:[],(0,i.rF)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},a.prototype.preComputeLookaheadFunctions=function(a){var b=this;(0,i.jJ)(a,function(a){b.TRACE_INIT(a.name+" Rule Lookahead",function(){var c,d=(aG.reset(),a.accept(aG),c=aG.dslMethods,aG.reset(),c),f=d.alternation,g=d.repetition,h=d.option,j=d.repetitionMandatory,k=d.repetitionMandatoryWithSeparator,l=d.repetitionWithSeparator;(0,i.jJ)(f,function(c){var d=0===c.idx?"":c.idx;b.TRACE_INIT(""+aE(c)+d,function(){var d,e,f,g,h,i,j,k,l=(d=c.idx,e=c.maxLookahead||b.maxLookahead,f=c.hasPredicates,g=b.dynamicTokensEnabled,h=b.lookAheadBuilderForAlternatives,j=a6(i=a3(d,a,e))?M:L,h(i,f,j,g)),m=(k=b.fullRuleNameToShort[a.name],256|c.idx|k);b.setLaFuncCache(m,l)})}),(0,i.jJ)(g,function(c){b.computeLookaheadFunc(a,c.idx,768,e.REPETITION,c.maxLookahead,aE(c))}),(0,i.jJ)(h,function(c){b.computeLookaheadFunc(a,c.idx,512,e.OPTION,c.maxLookahead,aE(c))}),(0,i.jJ)(j,function(c){b.computeLookaheadFunc(a,c.idx,1024,e.REPETITION_MANDATORY,c.maxLookahead,aE(c))}),(0,i.jJ)(k,function(c){b.computeLookaheadFunc(a,c.idx,1536,e.REPETITION_MANDATORY_WITH_SEPARATOR,c.maxLookahead,aE(c))}),(0,i.jJ)(l,function(c){b.computeLookaheadFunc(a,c.idx,1280,e.REPETITION_WITH_SEPARATOR,c.maxLookahead,aE(c))})})})},a.prototype.computeLookaheadFunc=function(a,b,c,d,e,f){var g=this;this.TRACE_INIT(""+f+(0===b?"":b),function(){var f,h,i,j,k,l=(f=e||g.maxLookahead,h=g.dynamicTokensEnabled,i=g.lookAheadBuilderForOptional,k=a6(j=a4(b,a,d,f))?M:L,i(j[0],k,h)),m=b|c|g.fullRuleNameToShort[a.name];g.setLaFuncCache(m,l)})},a.prototype.lookAheadBuilderForOptional=function(a,b,c){return function(a,b,c){var d=(0,i.Si)(a,function(a){return 1===a.length}),e=a.length;if(!d||c)return function(){g:for(var c=0;c<e;c++){for(var d=a[c],f=d.length,g=0;g<f;g++)if(!1===b(this.LA(g+1),d[g]))continue g;return!0}return!1};var f=(0,i.Bq)(a);if(1===f.length&&(0,i.Im)(f[0].categoryMatches)){var g=f[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===g}}var h=(0,i.TS)(f,function(a,b,c){return a[b.tokenTypeIdx]=!0,(0,i.jJ)(b.categoryMatches,function(b){a[b]=!0}),a},[]);return function(){return!0===h[this.LA(1).tokenTypeIdx]}}(a,b,c)},a.prototype.lookAheadBuilderForAlternatives=function(a,b,c,d){var e=a.length,f=(0,i.Si)(a,function(a){return(0,i.Si)(a,function(a){return 1===a.length})});if(b)return function(b){for(var d=(0,i.Tj)(b,function(a){return a.GATE}),f=0;f<e;f++){var g=a[f],h=g.length,j=d[f];if(void 0===j||!1!==j.call(this))g:for(var k=0;k<h;k++){for(var l=g[k],m=l.length,n=0;n<m;n++)if(!1===c(this.LA(n+1),l[n]))continue g;return f}}};if(!f||d)return function(){for(var b=0;b<e;b++){var d=a[b],f=d.length;g:for(var g=0;g<f;g++){for(var h=d[g],i=h.length,j=0;j<i;j++)if(!1===c(this.LA(j+1),h[j]))continue g;return b}}};var g=(0,i.Tj)(a,function(a){return(0,i.Bq)(a)}),h=(0,i.TS)(g,function(a,b,c){return(0,i.jJ)(b,function(b){(0,i.zy)(a,b.tokenTypeIdx)||(a[b.tokenTypeIdx]=c),(0,i.jJ)(b.categoryMatches,function(b){(0,i.zy)(a,b)||(a[b]=c)})}),a},[]);return function(){return h[this.LA(1).tokenTypeIdx]}},a.prototype.getKeyForAutomaticLookahead=function(a,b){return b|a|this.getLastExplicitRuleShortName()},a.prototype.getLaFuncFromCache=function(a){},a.prototype.getLaFuncFromMap=function(a){return this.lookAheadFuncsCache.get(a)},a.prototype.getLaFuncFromObj=function(a){return this.lookAheadFuncsCache[a]},a.prototype.setLaFuncCache=function(a,b){},a.prototype.setLaFuncCacheUsingMap=function(a,b){this.lookAheadFuncsCache.set(a,b)},a.prototype.setLaFuncUsingObj=function(a,b){this.lookAheadFuncsCache[a]=b},a}();function by(a,b){!0===isNaN(a.startOffset)?(a.startOffset=b.startOffset,a.endOffset=b.endOffset):a.endOffset<b.endOffset==!0&&(a.endOffset=b.endOffset)}function bz(a,b){!0===isNaN(a.startOffset)?(a.startOffset=b.startOffset,a.startColumn=b.startColumn,a.startLine=b.startLine,a.endOffset=b.endOffset,a.endColumn=b.endColumn,a.endLine=b.endLine):a.endOffset<b.endOffset==!0&&(a.endOffset=b.endOffset,a.endColumn=b.endColumn,a.endLine=b.endLine)}var bA="name";function bB(a){var b=a.name;return b||"anonymous"}function bC(a,b){var c=Object.getOwnPropertyDescriptor(a,bA);return(!!(0,i.b0)(c)||!!c.configurable)&&(Object.defineProperty(a,bA,{enumerable:!1,configurable:!0,writable:!1,value:b}),!0)}function bD(a,b){for(var c=(0,i.HP)(a),d=c.length,e=0;e<d;e++)for(var f=a[c[e]],g=f.length,h=0;h<g;h++){var j=f[h];void 0===j.tokenTypeIdx&&this[j.name](j.children,b)}}!function(a){a[a.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",a[a.MISSING_METHOD=1]="MISSING_METHOD"}(f||(f={}));var bE=["constructor","visit","validateVisitor"],bF=function(){function a(){}return a.prototype.initTreeBuilder=function(a){if(this.CST_STACK=[],this.outputCst=a.outputCst,this.nodeLocationTracking=(0,i.zy)(a,"nodeLocationTracking")?a.nodeLocationTracking:bX.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=bz,this.setNodeLocationFromNode=bz,this.cstPostRule=i.tE,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=i.tE,this.setNodeLocationFromNode=i.tE,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=by,this.setNodeLocationFromNode=by,this.cstPostRule=i.tE,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=i.tE,this.setNodeLocationFromNode=i.tE,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=i.tE,this.setNodeLocationFromNode=i.tE,this.cstPostRule=i.tE,this.setInitialNodeLocation=i.tE;else throw Error('Invalid <nodeLocationTracking> config option: "'+a.nodeLocationTracking+'"');else this.cstInvocationStateUpdate=i.tE,this.cstFinallyStateUpdate=i.tE,this.cstPostTerminal=i.tE,this.cstPostNonTerminal=i.tE,this.cstPostRule=i.tE},a.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(a){a.location={startOffset:NaN,endOffset:NaN}},a.prototype.setInitialNodeLocationOnlyOffsetRegular=function(a){a.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},a.prototype.setInitialNodeLocationFullRecovery=function(a){a.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},a.prototype.setInitialNodeLocationFullRegular=function(a){var b=this.LA(1);a.location={startOffset:b.startOffset,startLine:b.startLine,startColumn:b.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},a.prototype.cstInvocationStateUpdate=function(a,b){var c={name:a,children:{}};this.setInitialNodeLocation(c),this.CST_STACK.push(c)},a.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},a.prototype.cstPostRuleFull=function(a){var b=this.LA(0),c=a.location;c.startOffset<=b.startOffset==!0?(c.endOffset=b.endOffset,c.endLine=b.endLine,c.endColumn=b.endColumn):(c.startOffset=NaN,c.startLine=NaN,c.startColumn=NaN)},a.prototype.cstPostRuleOnlyOffset=function(a){var b=this.LA(0),c=a.location;c.startOffset<=b.startOffset==!0?c.endOffset=b.endOffset:c.startOffset=NaN},a.prototype.cstPostTerminal=function(a,b){var c=this.CST_STACK[this.CST_STACK.length-1];void 0===c.children[a]?c.children[a]=[b]:c.children[a].push(b),this.setNodeLocationFromToken(c.location,b)},a.prototype.cstPostNonTerminal=function(a,b){var c=this.CST_STACK[this.CST_STACK.length-1];void 0===c.children[b]?c.children[b]=[a]:c.children[b].push(a),this.setNodeLocationFromNode(c.location,a.location)},a.prototype.getBaseCstVisitorConstructor=function(){if((0,i.b0)(this.baseCstVisitorConstructor)){var a,b,c,d=(a=this.className,b=(0,i.HP)(this.gastProductionsCache),bC(c=function(){},a+"BaseSemantics"),c.prototype={visit:function(a,b){if((0,i.cy)(a)&&(a=a[0]),!(0,i.b0)(a))return this[a.name](a.children,b)},validateVisitor:function(){var a,c,d,e,g,h,j,k=(a=this,c=b,h=(d=a,e=c,g=(0,i.Tj)(e,function(a){if(!(0,i.Tn)(d[a]))return{msg:"Missing visitor method: <"+a+"> on "+bB(d.constructor)+" CST Visitor.",type:f.MISSING_METHOD,methodName:a}}),(0,i.oE)(g)),j=function(a,b){var c=[];for(var d in a)!(0,i.Tn)(a[d])||(0,i.gR)(bE,d)||(0,i.gR)(b,d)||c.push({msg:"Redundant visitor method: <"+d+"> on "+bB(a.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\n",type:f.REDUNDANT_METHOD,methodName:d});return c}(a,c),h.concat(j));if(!(0,i.Im)(k)){var l=(0,i.Tj)(k,function(a){return a.msg});throw Error("Errors Detected in CST Visitor <"+bB(this.constructor)+">:\n "+l.join("\n\n").replace(/\n/g,"\n "))}}},c.prototype.constructor=c,c._RULE_NAMES=b,c);return this.baseCstVisitorConstructor=d,d}return this.baseCstVisitorConstructor},a.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,i.b0)(this.baseCstVisitorWithDefaultsConstructor)){var a,b,c,d,e,f=(a=this.className,b=(0,i.HP)(this.gastProductionsCache),c=this.getBaseCstVisitorConstructor(),bC(d=function(){},a+"BaseSemanticsWithDefaults"),e=Object.create(c.prototype),(0,i.jJ)(b,function(a){e[a]=bD}),d.prototype=e,d.prototype.constructor=d,d);return this.baseCstVisitorWithDefaultsConstructor=f,f}return this.baseCstVisitorWithDefaultsConstructor},a.prototype.getLastExplicitRuleShortName=function(){var a=this.RULE_STACK;return a[a.length-1]},a.prototype.getPreviousExplicitRuleShortName=function(){var a=this.RULE_STACK;return a[a.length-2]},a.prototype.getLastExplicitRuleOccurrenceIndex=function(){var a=this.RULE_OCCURRENCE_STACK;return a[a.length-1]},a}(),bG=function(){function a(){}return a.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(a.prototype,"input",{get:function(){return this.tokVector},set:function(a){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=a,this.tokVectorLength=a.length},enumerable:!1,configurable:!0}),a.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):bW},a.prototype.LA=function(a){var b=this.currIdx+a;return b<0||this.tokVectorLength<=b?bW:this.tokVector[b]},a.prototype.consumeToken=function(){this.currIdx++},a.prototype.exportLexerState=function(){return this.currIdx},a.prototype.importLexerState=function(a){this.currIdx=a},a.prototype.resetLexerState=function(){this.currIdx=-1},a.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},a.prototype.getLexerPosition=function(){return this.exportLexerState()},a}(),bH=function(){function a(){}return a.prototype.ACTION=function(a){return a.call(this)},a.prototype.consume=function(a,b,c){return this.consumeInternal(b,a,c)},a.prototype.subrule=function(a,b,c){return this.subruleInternal(b,a,c)},a.prototype.option=function(a,b){return this.optionInternal(b,a)},a.prototype.or=function(a,b){return this.orInternal(b,a)},a.prototype.many=function(a,b){return this.manyInternal(a,b)},a.prototype.atLeastOne=function(a,b){return this.atLeastOneInternal(a,b)},a.prototype.CONSUME=function(a,b){return this.consumeInternal(a,0,b)},a.prototype.CONSUME1=function(a,b){return this.consumeInternal(a,1,b)},a.prototype.CONSUME2=function(a,b){return this.consumeInternal(a,2,b)},a.prototype.CONSUME3=function(a,b){return this.consumeInternal(a,3,b)},a.prototype.CONSUME4=function(a,b){return this.consumeInternal(a,4,b)},a.prototype.CONSUME5=function(a,b){return this.consumeInternal(a,5,b)},a.prototype.CONSUME6=function(a,b){return this.consumeInternal(a,6,b)},a.prototype.CONSUME7=function(a,b){return this.consumeInternal(a,7,b)},a.prototype.CONSUME8=function(a,b){return this.consumeInternal(a,8,b)},a.prototype.CONSUME9=function(a,b){return this.consumeInternal(a,9,b)},a.prototype.SUBRULE=function(a,b){return this.subruleInternal(a,0,b)},a.prototype.SUBRULE1=function(a,b){return this.subruleInternal(a,1,b)},a.prototype.SUBRULE2=function(a,b){return this.subruleInternal(a,2,b)},a.prototype.SUBRULE3=function(a,b){return this.subruleInternal(a,3,b)},a.prototype.SUBRULE4=function(a,b){return this.subruleInternal(a,4,b)},a.prototype.SUBRULE5=function(a,b){return this.subruleInternal(a,5,b)},a.prototype.SUBRULE6=function(a,b){return this.subruleInternal(a,6,b)},a.prototype.SUBRULE7=function(a,b){return this.subruleInternal(a,7,b)},a.prototype.SUBRULE8=function(a,b){return this.subruleInternal(a,8,b)},a.prototype.SUBRULE9=function(a,b){return this.subruleInternal(a,9,b)},a.prototype.OPTION=function(a){return this.optionInternal(a,0)},a.prototype.OPTION1=function(a){return this.optionInternal(a,1)},a.prototype.OPTION2=function(a){return this.optionInternal(a,2)},a.prototype.OPTION3=function(a){return this.optionInternal(a,3)},a.prototype.OPTION4=function(a){return this.optionInternal(a,4)},a.prototype.OPTION5=function(a){return this.optionInternal(a,5)},a.prototype.OPTION6=function(a){return this.optionInternal(a,6)},a.prototype.OPTION7=function(a){return this.optionInternal(a,7)},a.prototype.OPTION8=function(a){return this.optionInternal(a,8)},a.prototype.OPTION9=function(a){return this.optionInternal(a,9)},a.prototype.OR=function(a){return this.orInternal(a,0)},a.prototype.OR1=function(a){return this.orInternal(a,1)},a.prototype.OR2=function(a){return this.orInternal(a,2)},a.prototype.OR3=function(a){return this.orInternal(a,3)},a.prototype.OR4=function(a){return this.orInternal(a,4)},a.prototype.OR5=function(a){return this.orInternal(a,5)},a.prototype.OR6=function(a){return this.orInternal(a,6)},a.prototype.OR7=function(a){return this.orInternal(a,7)},a.prototype.OR8=function(a){return this.orInternal(a,8)},a.prototype.OR9=function(a){return this.orInternal(a,9)},a.prototype.MANY=function(a){this.manyInternal(0,a)},a.prototype.MANY1=function(a){this.manyInternal(1,a)},a.prototype.MANY2=function(a){this.manyInternal(2,a)},a.prototype.MANY3=function(a){this.manyInternal(3,a)},a.prototype.MANY4=function(a){this.manyInternal(4,a)},a.prototype.MANY5=function(a){this.manyInternal(5,a)},a.prototype.MANY6=function(a){this.manyInternal(6,a)},a.prototype.MANY7=function(a){this.manyInternal(7,a)},a.prototype.MANY8=function(a){this.manyInternal(8,a)},a.prototype.MANY9=function(a){this.manyInternal(9,a)},a.prototype.MANY_SEP=function(a){this.manySepFirstInternal(0,a)},a.prototype.MANY_SEP1=function(a){this.manySepFirstInternal(1,a)},a.prototype.MANY_SEP2=function(a){this.manySepFirstInternal(2,a)},a.prototype.MANY_SEP3=function(a){this.manySepFirstInternal(3,a)},a.prototype.MANY_SEP4=function(a){this.manySepFirstInternal(4,a)},a.prototype.MANY_SEP5=function(a){this.manySepFirstInternal(5,a)},a.prototype.MANY_SEP6=function(a){this.manySepFirstInternal(6,a)},a.prototype.MANY_SEP7=function(a){this.manySepFirstInternal(7,a)},a.prototype.MANY_SEP8=function(a){this.manySepFirstInternal(8,a)},a.prototype.MANY_SEP9=function(a){this.manySepFirstInternal(9,a)},a.prototype.AT_LEAST_ONE=function(a){this.atLeastOneInternal(0,a)},a.prototype.AT_LEAST_ONE1=function(a){return this.atLeastOneInternal(1,a)},a.prototype.AT_LEAST_ONE2=function(a){this.atLeastOneInternal(2,a)},a.prototype.AT_LEAST_ONE3=function(a){this.atLeastOneInternal(3,a)},a.prototype.AT_LEAST_ONE4=function(a){this.atLeastOneInternal(4,a)},a.prototype.AT_LEAST_ONE5=function(a){this.atLeastOneInternal(5,a)},a.prototype.AT_LEAST_ONE6=function(a){this.atLeastOneInternal(6,a)},a.prototype.AT_LEAST_ONE7=function(a){this.atLeastOneInternal(7,a)},a.prototype.AT_LEAST_ONE8=function(a){this.atLeastOneInternal(8,a)},a.prototype.AT_LEAST_ONE9=function(a){this.atLeastOneInternal(9,a)},a.prototype.AT_LEAST_ONE_SEP=function(a){this.atLeastOneSepFirstInternal(0,a)},a.prototype.AT_LEAST_ONE_SEP1=function(a){this.atLeastOneSepFirstInternal(1,a)},a.prototype.AT_LEAST_ONE_SEP2=function(a){this.atLeastOneSepFirstInternal(2,a)},a.prototype.AT_LEAST_ONE_SEP3=function(a){this.atLeastOneSepFirstInternal(3,a)},a.prototype.AT_LEAST_ONE_SEP4=function(a){this.atLeastOneSepFirstInternal(4,a)},a.prototype.AT_LEAST_ONE_SEP5=function(a){this.atLeastOneSepFirstInternal(5,a)},a.prototype.AT_LEAST_ONE_SEP6=function(a){this.atLeastOneSepFirstInternal(6,a)},a.prototype.AT_LEAST_ONE_SEP7=function(a){this.atLeastOneSepFirstInternal(7,a)},a.prototype.AT_LEAST_ONE_SEP8=function(a){this.atLeastOneSepFirstInternal(8,a)},a.prototype.AT_LEAST_ONE_SEP9=function(a){this.atLeastOneSepFirstInternal(9,a)},a.prototype.RULE=function(a,b,c){if(void 0===c&&(c=bY),(0,i.gR)(this.definedRulesNames,a)){var d={message:aN.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),type:g.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(d)}this.definedRulesNames.push(a);var e=this.defineRule(a,b,c);return this[a]=e,e},a.prototype.OVERRIDE_RULE=function(a,b,c){void 0===c&&(c=bY);var d,e,f,h=[];h=h.concat((d=this.definedRulesNames,e=this.className,f=[],i.gR(d,a)||f.push({message:"Invalid rule override, rule: ->"+a+"<- cannot be overridden in the grammar: ->"+e+"<-as it is not defined in any of the super grammars ",type:g.INVALID_RULE_OVERRIDE,ruleName:a}),f)),this.definitionErrors.push.apply(this.definitionErrors,h);var j=this.defineRule(a,b,c);return this[a]=j,j},a.prototype.BACKTRACK=function(a,b){return function(){this.isBackTrackingStack.push(1);var c=this.saveRecogState();try{return a.apply(this,b),!0}catch(a){if(bm(a))return!1;throw a}finally{this.reloadRecogState(c),this.isBackTrackingStack.pop()}}},a.prototype.getGAstProductions=function(){return this.gastProductionsCache},a.prototype.getSerializedGastProductions=function(){return ax((0,i.zu)(this.gastProductionsCache))},a}(),bI=function(){function a(){}return a.prototype.initRecognizerEngine=function(a,b){if(this.className=bB(this.constructor),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=M,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,i.zy)(b,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.");if((0,i.cy)(a)){if((0,i.Im)(a))throw Error("A Token Vocabulary cannot be empty.\n Note that the first argument for the parser constructor\n is no longer a Token vector (since v4.0).");if("number"==typeof a[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n For Further details.")}if((0,i.cy)(a))this.tokensMap=(0,i.TS)(a,function(a,b){return a[b.name]=b,a},{});else if((0,i.zy)(a,"modes")&&(0,i.Si)((0,i.Bq)((0,i.zu)(a.modes)),S)){var c=(0,i.Bq)((0,i.zu)(a.modes)),d=(0,i.sb)(c);this.tokensMap=(0,i.TS)(d,function(a,b){return a[b.name]=b,a},{})}else if((0,i.Gv)(a))this.tokensMap=(0,i.lR)(a);else throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=ai;var e=(0,i.Si)((0,i.zu)(a),function(a){return(0,i.Im)(a.categoryMatches)});this.tokenMatcher=e?M:L,P((0,i.zu)(this.tokensMap))},a.prototype.defineRule=function(a,b,c){if(this.selfAnalysisDone)throw Error("Grammar rule <"+a+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var d,e=(0,i.zy)(c,"resyncEnabled")?c.resyncEnabled:bY.resyncEnabled,f=(0,i.zy)(c,"recoveryValueFunc")?c.recoveryValueFunc:bY.recoveryValueFunc,g=this.ruleShortNameIdx<<12;function h(a){try{if(!0!==this.outputCst)return b.apply(this,a);b.apply(this,a);var c=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(c),c}catch(a){return this.invokeRuleCatch(a,e,f)}finally{this.ruleFinallyStateUpdate()}}return this.ruleShortNameIdx++,this.shortRuleNameToFull[g]=a,this.fullRuleNameToShort[a]=g,(d=function(b,c){return void 0===b&&(b=0),this.ruleInvocationStateUpdate(g,a,b),h.call(this,c)}).ruleName=a,d.originalGrammarAction=b,d},a.prototype.invokeRuleCatch=function(a,b,c){var d=1===this.RULE_STACK.length,e=b&&!this.isBackTracking()&&this.recoveryEnabled;if(bm(a)){if(e){var f=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(f)){if(a.resyncedTokens=this.reSyncTo(f),!this.outputCst)return c();var g=this.CST_STACK[this.CST_STACK.length-1];return g.recoveredNode=!0,g}if(this.outputCst){var g=this.CST_STACK[this.CST_STACK.length-1];g.recoveredNode=!0,a.partialCstResult=g}throw a}if(d)return this.moveToTerminatedState(),c()}throw a},a.prototype.optionInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(512,b);return this.optionInternalLogic(a,b,c)},a.prototype.optionInternalLogic=function(a,b,c){var d,e,f=this,g=this.getLaFuncFromCache(c);if(void 0!==a.DEF){if(d=a.DEF,void 0!==(e=a.GATE)){var h=g;g=function(){return e.call(f)&&h.call(f)}}}else d=a;if(!0===g.call(this))return d.call(this)},a.prototype.atLeastOneInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(1024,a);return this.atLeastOneInternalLogic(a,b,c)},a.prototype.atLeastOneInternalLogic=function(a,b,c){var d,f,g=this,h=this.getLaFuncFromCache(c);if(void 0!==b.DEF){if(d=b.DEF,void 0!==(f=b.GATE)){var i=h;h=function(){return f.call(g)&&i.call(g)}}}else d=b;if(!0===h.call(this))for(var j=this.doSingleRepetition(d);!0===h.call(this)&&!0===j;)j=this.doSingleRepetition(d);else throw this.raiseEarlyExitException(a,e.REPETITION_MANDATORY,b.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[a,b],h,1024,a,aV)},a.prototype.atLeastOneSepFirstInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(1536,a);this.atLeastOneSepFirstInternalLogic(a,b,c)},a.prototype.atLeastOneSepFirstInternalLogic=function(a,b,c){var d=this,f=b.DEF,g=b.SEP;if(!0===this.getLaFuncFromCache(c).call(this)){f.call(this);for(var h=function(){return d.tokenMatcher(d.LA(1),g)};!0===this.tokenMatcher(this.LA(1),g);)this.CONSUME(g),f.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[a,g,h,f,aW],h,1536,a,aW)}else throw this.raiseEarlyExitException(a,e.REPETITION_MANDATORY_WITH_SEPARATOR,b.ERR_MSG)},a.prototype.manyInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(768,a);return this.manyInternalLogic(a,b,c)},a.prototype.manyInternalLogic=function(a,b,c){var d,e,f=this,g=this.getLaFuncFromCache(c);if(void 0!==b.DEF){if(d=b.DEF,void 0!==(e=b.GATE)){var h=g;g=function(){return e.call(f)&&h.call(f)}}}else d=b;for(var i=!0;!0===g.call(this)&&!0===i;)i=this.doSingleRepetition(d);this.attemptInRepetitionRecovery(this.manyInternal,[a,b],g,768,a,aT,i)},a.prototype.manySepFirstInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(1280,a);this.manySepFirstInternalLogic(a,b,c)},a.prototype.manySepFirstInternalLogic=function(a,b,c){var d=this,e=b.DEF,f=b.SEP;if(!0===this.getLaFuncFromCache(c).call(this)){e.call(this);for(var g=function(){return d.tokenMatcher(d.LA(1),f)};!0===this.tokenMatcher(this.LA(1),f);)this.CONSUME(f),e.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[a,f,g,e,aU],g,1280,a,aU)}},a.prototype.repetitionSepSecondInternal=function(a,b,c,d,e){for(;c();)this.CONSUME(b),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[a,b,c,d,e],c,1536,a,e)},a.prototype.doSingleRepetition=function(a){var b=this.getLexerPosition();return a.call(this),this.getLexerPosition()>b},a.prototype.orInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(256,b),d=(0,i.cy)(a)?a:a.DEF,e=this.getLaFuncFromCache(c).call(this,d);if(void 0!==e)return d[e].ALT.call(this);this.raiseNoAltException(b,a.ERR_MSG)},a.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var a=this.LA(1),b=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:a,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new bq(b,a))}},a.prototype.subruleInternal=function(a,b,c){var d;try{var e=void 0!==c?c.ARGS:void 0;return d=a.call(this,b,e),this.cstPostNonTerminal(d,void 0!==c&&void 0!==c.LABEL?c.LABEL:a.ruleName),d}catch(b){this.subruleInternalError(b,c,a.ruleName)}},a.prototype.subruleInternalError=function(a,b,c){throw bm(a)&&void 0!==a.partialCstResult&&(this.cstPostNonTerminal(a.partialCstResult,void 0!==b&&void 0!==b.LABEL?b.LABEL:c),delete a.partialCstResult),a},a.prototype.consumeInternal=function(a,b,c){var d;try{var e=this.LA(1);!0===this.tokenMatcher(e,a)?(this.consumeToken(),d=e):this.consumeInternalError(a,e,c)}catch(c){d=this.consumeInternalRecovery(a,b,c)}return this.cstPostTerminal(void 0!==c&&void 0!==c.LABEL?c.LABEL:a.name,d),d},a.prototype.consumeInternalError=function(a,b,c){var d,e=this.LA(0);throw d=void 0!==c&&c.ERR_MSG?c.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:a,actual:b,previous:e,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bo(d,b,e))},a.prototype.consumeInternalRecovery=function(a,b,c){if(this.recoveryEnabled&&"MismatchedTokenException"===c.name&&!this.isBackTracking()){var d=this.getFollowsForInRuleRecovery(a,b);try{return this.tryInRuleRecovery(a,d)}catch(a){if(a.name===bt)throw c;throw a}}throw c},a.prototype.saveRecogState=function(){var a=this.errors,b=(0,i.T9)(this.RULE_STACK);return{errors:a,lexerState:this.exportLexerState(),RULE_STACK:b,CST_STACK:this.CST_STACK}},a.prototype.reloadRecogState=function(a){this.errors=a.errors,this.importLexerState(a.lexerState),this.RULE_STACK=a.RULE_STACK},a.prototype.ruleInvocationStateUpdate=function(a,b,c){this.RULE_OCCURRENCE_STACK.push(c),this.RULE_STACK.push(a),this.cstInvocationStateUpdate(b,a)},a.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},a.prototype.getCurrRuleFullName=function(){var a=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[a]},a.prototype.shortRuleNameToFullName=function(a){return this.shortRuleNameToFull[a]},a.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),ai)},a.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},a}(),bJ=function(){function a(){}return a.prototype.initErrorHandler=function(a){this._errors=[],this.errorMessageProvider=(0,i.zy)(a,"errorMessageProvider")?a.errorMessageProvider:bX.errorMessageProvider},a.prototype.SAVE_ERROR=function(a){if(bm(a))return a.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,i.T9)(this.RULE_OCCURRENCE_STACK)},this._errors.push(a),a;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(a.prototype,"errors",{get:function(){return(0,i.T9)(this._errors)},set:function(a){this._errors=a},enumerable:!1,configurable:!0}),a.prototype.raiseEarlyExitException=function(a,b,c){for(var d=this.getCurrRuleFullName(),e=a4(a,this.getGAstProductions()[d],b,this.maxLookahead)[0],f=[],g=1;g<=this.maxLookahead;g++)f.push(this.LA(g));var h=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:e,actual:f,previous:this.LA(0),customUserDescription:c,ruleName:d});throw this.SAVE_ERROR(new br(h,this.LA(1),this.LA(0)))},a.prototype.raiseNoAltException=function(a,b){for(var c=this.getCurrRuleFullName(),d=a3(a,this.getGAstProductions()[c],this.maxLookahead),e=[],f=1;f<=this.maxLookahead;f++)e.push(this.LA(f));var g=this.LA(0),h=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:d,actual:e,previous:g,customUserDescription:b,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new bp(h,this.LA(1),g))},a}(),bK=function(){function a(){}return a.prototype.initContentAssist=function(){},a.prototype.computeContentAssist=function(a,b){var c=this.gastProductionsCache[a];if((0,i.b0)(c))throw Error("Rule ->"+a+"<- does not exist in this grammar.");return aY([c],b,this.tokenMatcher,this.maxLookahead)},a.prototype.getNextPossibleTokenTypes=function(a){var b=(0,i.$1)(a.ruleStack);return new aR(this.getGAstProductions()[b],a).startWalking()},a}(),bL={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(bL);var bM=ah({name:"RECORDING_PHASE_TOKEN",pattern:V.NA});P([bM]);var bN=aj(bM,"This IToken indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(bN);var bO={name:"This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},bP=function(){function a(){}return a.prototype.initGastRecorder=function(a){this.recordingProdStack=[],this.RECORDING_PHASE=!1},a.prototype.enableRecording=function(){var a=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var b=function(b){var c=b>0?b:"";a["CONSUME"+c]=function(a,c){return this.consumeInternalRecord(a,b,c)},a["SUBRULE"+c]=function(a,c){return this.subruleInternalRecord(a,b,c)},a["OPTION"+c]=function(a){return this.optionInternalRecord(a,b)},a["OR"+c]=function(a){return this.orInternalRecord(a,b)},a["MANY"+c]=function(a){this.manyInternalRecord(b,a)},a["MANY_SEP"+c]=function(a){this.manySepFirstInternalRecord(b,a)},a["AT_LEAST_ONE"+c]=function(a){this.atLeastOneInternalRecord(b,a)},a["AT_LEAST_ONE_SEP"+c]=function(a){this.atLeastOneSepFirstInternalRecord(b,a)}},c=0;c<10;c++)b(c);a.consume=function(a,b,c){return this.consumeInternalRecord(b,a,c)},a.subrule=function(a,b,c){return this.subruleInternalRecord(b,a,c)},a.option=function(a,b){return this.optionInternalRecord(b,a)},a.or=function(a,b){return this.orInternalRecord(b,a)},a.many=function(a,b){this.manyInternalRecord(a,b)},a.atLeastOne=function(a,b){this.atLeastOneInternalRecord(a,b)},a.ACTION=a.ACTION_RECORD,a.BACKTRACK=a.BACKTRACK_RECORD,a.LA=a.LA_RECORD})},a.prototype.disableRecording=function(){var a=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var b=0;b<10;b++){var c=b>0?b:"";delete a["CONSUME"+c],delete a["SUBRULE"+c],delete a["OPTION"+c],delete a["OR"+c],delete a["MANY"+c],delete a["MANY_SEP"+c],delete a["AT_LEAST_ONE"+c],delete a["AT_LEAST_ONE_SEP"+c]}delete a.consume,delete a.subrule,delete a.option,delete a.or,delete a.many,delete a.atLeastOne,delete a.ACTION,delete a.BACKTRACK,delete a.LA})},a.prototype.ACTION_RECORD=function(a){},a.prototype.BACKTRACK_RECORD=function(a,b){return function(){return!0}},a.prototype.LA_RECORD=function(a){return bW},a.prototype.topLevelRuleRecord=function(a,b){try{var c=new ao({definition:[],name:a});return c.name=a,this.recordingProdStack.push(c),b.call(this),this.recordingProdStack.pop(),c}catch(a){if(!0!==a.KNOWN_RECORDER_ERROR)try{a.message=a.message+'\n This error was thrown during the "grammar recording phase" For more info see:\n https://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(a){}throw a}},a.prototype.optionInternalRecord=function(a,b){return bQ.call(this,aq,a,b)},a.prototype.atLeastOneInternalRecord=function(a,b){bQ.call(this,ar,b,a)},a.prototype.atLeastOneSepFirstInternalRecord=function(a,b){bQ.call(this,as,b,a,!0)},a.prototype.manyInternalRecord=function(a,b){bQ.call(this,at,b,a)},a.prototype.manySepFirstInternalRecord=function(a,b){bQ.call(this,au,b,a,!0)},a.prototype.orInternalRecord=function(a,b){return bR.call(this,a,b)},a.prototype.subruleInternalRecord=function(a,b,c){if(bT(b),!a||!1===(0,i.zy)(a,"ruleName")){var d=Error("<SUBRULE"+bS(b)+"> argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(a)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw d.KNOWN_RECORDER_ERROR=!0,d}var e=(0,i.se)(this.recordingProdStack),f=new an({idx:b,nonTerminalName:a.ruleName,referencedRule:void 0});return e.definition.push(f),this.outputCst?bO:bL},a.prototype.consumeInternalRecord=function(a,b,c){if(bT(b),!Q(a)){var d=Error("<CONSUME"+bS(b)+"> argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(a)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw d.KNOWN_RECORDER_ERROR=!0,d}var e=(0,i.se)(this.recordingProdStack),f=new aw({idx:b,terminalType:a});return e.definition.push(f),bN},a}();function bQ(a,b,c,d){void 0===d&&(d=!1),bT(c);var e=(0,i.se)(this.recordingProdStack),f=(0,i.Tn)(b)?b:b.DEF,g=new a({definition:[],idx:c});return d&&(g.separator=b.SEP),(0,i.zy)(b,"MAX_LOOKAHEAD")&&(g.maxLookahead=b.MAX_LOOKAHEAD),this.recordingProdStack.push(g),f.call(this),e.definition.push(g),this.recordingProdStack.pop(),bL}function bR(a,b){var c=this;bT(b);var d=(0,i.se)(this.recordingProdStack),e=!1===(0,i.cy)(a),f=!1===e?a:a.DEF,g=new av({definition:[],idx:b,ignoreAmbiguities:e&&!0===a.IGNORE_AMBIGUITIES});return(0,i.zy)(a,"MAX_LOOKAHEAD")&&(g.maxLookahead=a.MAX_LOOKAHEAD),g.hasPredicates=(0,i.zN)(f,function(a){return(0,i.Tn)(a.GATE)}),d.definition.push(g),(0,i.jJ)(f,function(a){var b=new ap({definition:[]});g.definition.push(b),(0,i.zy)(a,"IGNORE_AMBIGUITIES")?b.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:(0,i.zy)(a,"GATE")&&(b.ignoreAmbiguities=!0),c.recordingProdStack.push(b),a.ALT.call(c),c.recordingProdStack.pop()}),bL}function bS(a){return 0===a?"":""+a}function bT(a){if(a<0||a>255){var b=Error("Invalid DSL Method idx value: <"+a+">\n Idx value must be a none negative value smaller than "+256);throw b.KNOWN_RECORDER_ERROR=!0,b}}var bU=function(){function a(){}return a.prototype.initPerformanceTracer=function(a){if((0,i.zy)(a,"traceInitPerf")){var b=a.traceInitPerf,c="number"==typeof b;this.traceInitMaxIdent=c?b:1/0,this.traceInitPerf=c?b>0:b}else this.traceInitMaxIdent=0,this.traceInitPerf=bX.traceInitPerf;this.traceInitIndent=-1},a.prototype.TRACE_INIT=function(a,b){if(!0!==this.traceInitPerf)return b();this.traceInitIndent++;var c=Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--\x3e <"+a+">");var d=(0,i.O1)(b),e=d.time,f=d.value,g=e>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(c+"<-- <"+a+"> time: "+e+"ms"),this.traceInitIndent--,f},a}(),bV=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),bW=aj(ai,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(bW);var bX=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:aL,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),bY=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function bZ(a){return void 0===a&&(a=void 0),function(){return a}}!function(a){a[a.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",a[a.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",a[a.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",a[a.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",a[a.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",a[a.LEFT_RECURSION=5]="LEFT_RECURSION",a[a.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",a[a.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",a[a.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",a[a.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",a[a.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",a[a.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",a[a.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"}(g||(g={}));var b$=function(){function a(a,b){if(this.definitionErrors=[],this.selfAnalysisDone=!1,this.initErrorHandler(b),this.initLexerAdapter(),this.initLooksAhead(b),this.initRecognizerEngine(a,b),this.initRecoverable(b),this.initTreeBuilder(b),this.initContentAssist(),this.initGastRecorder(b),this.initPerformanceTracer(b),(0,i.zy)(b,"ignoredIssues"))throw Error("The <ignoredIssues> IParserConfig property has been deprecated.\n Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details.");this.skipValidations=(0,i.zy)(b,"skipValidations")?b.skipValidations:bX.skipValidations}return a.performSelfAnalysis=function(a){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},a.prototype.performSelfAnalysis=function(){var b=this;this.TRACE_INIT("performSelfAnalysis",function(){b.selfAnalysisDone=!0;var c=b.className;b.TRACE_INIT("toFastProps",function(){(0,i.Bl)(b)}),b.TRACE_INIT("Grammar Recording",function(){try{b.enableRecording(),(0,i.jJ)(b.definedRulesNames,function(a){var c=b[a].originalGrammarAction,d=void 0;b.TRACE_INIT(a+" Rule",function(){d=b.topLevelRuleRecord(a,c)}),b.gastProductionsCache[a]=d})}finally{b.disableRecording()}});var d=[];if(b.TRACE_INIT("Grammar Resolving",function(){d=bd({rules:(0,i.zu)(b.gastProductionsCache)}),b.definitionErrors.push.apply(b.definitionErrors,d)}),b.TRACE_INIT("Grammar Validations",function(){if((0,i.Im)(d)&&!1===b.skipValidations){var a=be({rules:(0,i.zu)(b.gastProductionsCache),maxLookahead:b.maxLookahead,tokenTypes:(0,i.zu)(b.tokensMap),errMsgProvider:aN,grammarName:c});b.definitionErrors.push.apply(b.definitionErrors,a)}}),(0,i.Im)(b.definitionErrors)&&(b.recoveryEnabled&&b.TRACE_INIT("computeAllProdsFollows",function(){var a,c,d=(a=(0,i.zu)(b.gastProductionsCache),c={},(0,i.jJ)(a,function(a){var b=new aK(a).startWalking();(0,i.kp)(c,b)}),c);b.resyncFollows=d}),b.TRACE_INIT("ComputeLookaheadFunctions",function(){b.preComputeLookaheadFunctions((0,i.zu)(b.gastProductionsCache))})),!a.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,i.Im)(b.definitionErrors))throw Error("Parser Definition Errors detected:\n "+(0,i.Tj)(b.definitionErrors,function(a){return a.message}).join("\n-------------------------------\n"))})},a.DEFER_DEFINITION_ERRORS_HANDLING=!1,a}();(0,i.XJ)(b$,[bv,bx,bF,bG,bI,bH,bJ,bK,bP,bU]);var b_=function(a){function b(b,c){void 0===c&&(c=bX);var d=(0,i.lR)(c);return d.outputCst=!0,a.call(this,b,d)||this}return bV(b,a),b}(b$),b0=function(a){function b(b,c){void 0===c&&(c=bX);var d=(0,i.lR)(c);return d.outputCst=!1,a.call(this,b,d)||this}return bV(b,a),b}(b$);function b1(a,b){var c=void 0===b?{}:b,d=c.resourceBase,e=void 0===d?"https://unpkg.com/chevrotain@"+h+"/diagrams/":d,f=c.css;return"\n\x3c!-- This is a generated file --\x3e\n<!DOCTYPE html>\n<meta charset=\"utf-8\">\n<style>\n body {\n background-color: hsl(30, 20%, 95%)\n }\n</style>\n\n\n<link rel='stylesheet' href='"+(void 0===f?"https://unpkg.com/chevrotain@"+h+"/diagrams/diagrams.css":f)+"'>\n"+("\n<script src='"+e+"vendor/railroad-diagrams.js'><\/script>\n<script src='"+e+"src/diagrams_builder.js'><\/script>\n<script src='"+e+"src/diagrams_behavior.js'><\/script>\n<script src='"+e+"src/main.js'><\/script>\n")+'\n<div id="diagrams" align="center"></div> \n'+("\n<script>\n window.serializedGrammar = "+JSON.stringify(a,null," ")+";\n<\/script>\n")+'\n<script>\n var diagramsDiv = document.getElementById("diagrams");\n main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);\n<\/script>\n'}function b2(a){var b;return"\nfunction "+a.name+"(tokenVocabulary, config) {\n // invoke super constructor\n // No support for embedded actions currently, so we can 'hardcode'\n // The use of CstParser.\n chevrotain.CstParser.call(this, tokenVocabulary, config)\n\n const $ = this\n\n "+(b=a.rules,(0,i.Tj)(b,function(a){var b,c,d;return c=1,d=b6(1,'$.RULE("'+(b=a).name+'", function() {')+"\n"+b5(b.definition,c+1)+(b6(c+1,"})")+"\n")}).join("\n"))+"\n\n // very important to call this after all the rules have been defined.\n // otherwise the parser may not work correctly as it will lack information\n // derived during the self analysis phase.\n this.performSelfAnalysis(this)\n}\n\n// inheritance as implemented in javascript in the previous decade... :(\n"+a.name+".prototype = Object.create(chevrotain.CstParser.prototype)\n"+a.name+".prototype.constructor = "+a.name+" \n "}function b3(a,b,c){var d=b6(c,"$."+(a+b.idx)+"(");return b.separator?(d+="{\n",d+=b6(c+1,"SEP: this.tokensMap."+b.separator.name)+",\n",d+="DEF: "+b4(b.definition,c+2)+"\n",d+=b6(c,"}")+"\n"):d+=b4(b.definition,c+1),d+=b6(c,")")+"\n"}function b4(a,b){var c="function() {\n";return c+=b5(a,b),c+=b6(b,"}")+"\n"}function b5(a,b){var c="";return(0,i.jJ)(a,function(a){c+=function(a,b){var c;if(a instanceof an)return b6(b,"$.SUBRULE"+a.idx+"($."+a.nonTerminalName+")\n");if(a instanceof aq)return b3("OPTION",a,b);if(a instanceof ar)return b3("AT_LEAST_ONE",a,b);if(a instanceof as)return b3("AT_LEAST_ONE_SEP",a,b);if(a instanceof au)return b3("MANY_SEP",a,b);else if(a instanceof at)return b3("MANY",a,b);else if(a instanceof av)return b6(b,"$.OR"+a.idx+"([")+"\n"+(0,i.Tj)(a.definition,function(a){var c,d,e;return c=a,e=b6(d=b+1,"{")+"\n"+(b6(d+1,"ALT: function() {")+"\n")+b5(c.definition,d+1)+(b6(d+1,"}")+"\n")+b6(d,"}")}).join(",\n")+"\n"+b6(b,"])\n");else if(a instanceof aw)return c=a.terminalType.name,b6(b,"$.CONSUME"+a.idx+"(this.tokensMap."+c+")\n");else if(a instanceof ap)return b5(a.definition,b);else throw Error("non exhaustive match")}(a,b+1)}),c}function b6(a,b){return Array(4*a+1).join(" ")+b}function b7(a){var b,d=Function("tokenVocabulary","config","chevrotain"," \n"+b2(b={name:a.name,rules:a.rules})+"\nreturn new "+b.name+"(tokenVocabulary, config) \n");return function(b){return d(a.tokenVocabulary,b,c(704092))}}function b8(a){var b;return"\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['chevrotain'], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory(require('chevrotain'));\n } else {\n // Browser globals (root is window)\n root.returnExports = factory(root.b);\n }\n}(typeof self !== 'undefined' ? self : this, function (chevrotain) {\n\n"+b2(b={name:a.name,rules:a.rules})+"\n \nreturn {\n "+b.name+": "+b.name+" \n}\n}));\n"}function b9(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n It performs no action other than printing this message.\n Please avoid using it as it will be completely removed in the future")}var ca=function(){throw Error("The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead. \nSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0")}},706575:(a,b,c)=>{"use strict";c.d(b,{x:()=>g});var d=c(736927),e=c(115962),f=c(86839);function g({relatedObjectName:a,value:b,multiple:c=!1,onChange:g,placeholder:h,variant:i="modal",autoFocus:j=!1}){let[k,l]=(0,e.useState)(j),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)([]),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(()=>(function(a){if(!a)return[];let b=a.trim();if(!b)return[];if(b.startsWith("["))try{let a=JSON.parse(b);if(Array.isArray(a))return a.map(String).filter(Boolean)}catch{}return[b]})(b)),u=(0,e.useRef)(null),v=(0,e.useRef)(null);(0,e.useRef)(null),(0,e.useCallback)(async b=>{r(!0);try{let c=new URLSearchParams;b&&c.set("q",b);let d=await fetch(`/api/workspace/objects/${encodeURIComponent(a)}/entries/options?${c}`);if(d.ok){let a=await d.json();p(a.options??[])}}catch{}finally{r(!1)}},[a]);let w=s.map(a=>{let b=o.find(b=>b.id===a),c=b?.label??a;return{id:a,label:String(null!=c&&"object"==typeof c?JSON.stringify(c):c??"")}}),x="inline"===i;return(0,d.jsxs)("div",{ref:u,className:"relative w-full",children:[(0,d.jsxs)("div",{onClick:()=>l(!k),className:`w-full flex items-center flex-wrap gap-1 cursor-pointer min-h-[1.5em] ${x?"text-xs":"px-3 py-2 text-sm rounded-lg"}`,style:x?{}:{background:"var(--color-surface)",color:"var(--color-text)",border:"1px solid var(--color-border)"},children:[w.length>0?w.map(({id:a,label:b})=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium",style:{background:"rgba(96, 165, 250, 0.1)",color:"#60a5fa",border:"1px solid rgba(96, 165, 250, 0.2)"},children:[(0,d.jsx)("span",{className:"truncate max-w-[160px]",children:String(b??"")}),(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation();let d=s.filter(b=>b!==a);t(d),c?g(0===d.length?"":JSON.stringify(d)):g("")},className:"ml-0.5 hover:opacity-70",style:{color:"#60a5fa"},children:(0,d.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M18 6 6 18"}),(0,d.jsx)("path",{d:"m6 6 12 12"})]})})]},a)):(0,d.jsx)("span",{style:{color:"var(--color-text-muted)",opacity:.5},children:h??`Select ${(0,f.A3)(a)}...`}),(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-auto flex-shrink-0",style:{color:"var(--color-text-muted)",transform:k?"rotate(180deg)":void 0,transition:"transform 0.15s"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})]}),k&&(0,d.jsxs)("div",{className:"absolute z-50 mt-1 w-full rounded-lg shadow-lg overflow-hidden",style:{background:"var(--color-bg)",border:"1px solid var(--color-border)",maxHeight:260},children:[(0,d.jsx)("div",{className:"p-2 border-b",style:{borderColor:"var(--color-border)"},children:(0,d.jsx)("input",{ref:v,type:"text",value:m,onChange:a=>n(a.target.value),placeholder:`Search ${(0,f.PV)(a)}...`,className:"w-full px-2.5 py-1.5 text-xs rounded-md outline-none",style:{background:"var(--color-surface)",color:"var(--color-text)",border:"1px solid var(--color-border)"},onKeyDown:a=>{"Escape"===a.key&&l(!1)}})}),(0,d.jsx)("div",{className:"overflow-y-auto",style:{maxHeight:200},children:q?(0,d.jsx)("div",{className:"px-3 py-4 text-center text-xs",style:{color:"var(--color-text-muted)"},children:"Loading..."}):0===o.length?(0,d.jsx)("div",{className:"px-3 py-4 text-center text-xs",style:{color:"var(--color-text-muted)"},children:m?"No matches found":"No entries"}):o.map(a=>{let b=s.includes(a.id);return(0,d.jsxs)("button",{type:"button",onClick:()=>(a=>{if(c){let b=s.includes(a)?s.filter(b=>b!==a):[...s,a];t(b),g(0===b.length?"":JSON.stringify(b))}else t([a]),g(a),l(!1)})(a.id),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 transition-colors",style:{background:b?"var(--color-accent-light, rgba(96, 165, 250, 0.08))":"transparent",color:"var(--color-text)"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover, rgba(255,255,255,0.04))")},onMouseLeave:a=>{a.currentTarget.style.background=b?"var(--color-accent-light, rgba(96, 165, 250, 0.08))":"transparent"},children:[c&&(0,d.jsx)("span",{className:"w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0",style:{borderColor:b?"var(--color-accent)":"var(--color-border)",background:b?"var(--color-accent)":"transparent"},children:b&&(0,d.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),!c&&b&&(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-accent)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})}),(0,d.jsx)("span",{className:"truncate",children:String(null!=a.label&&"object"==typeof a.label?JSON.stringify(a.label):a.label??"")})]},a.id)})})]})]})}},707201:(a,b,c)=>{"use strict";c.d(b,{r:()=>k,y:()=>l});var d=c(736927),e=c(115962);let f={default:{bg:"rgba(148, 163, 184, 0.08)",border:"1px solid rgba(148, 163, 184, 0.2)",text:"var(--color-text)",hoverBg:"rgba(148, 163, 184, 0.15)"},primary:{bg:"rgba(59, 130, 246, 0.08)",border:"1px solid rgba(59, 130, 246, 0.25)",text:"#3b82f6",hoverBg:"rgba(59, 130, 246, 0.15)"},destructive:{bg:"rgba(220, 38, 38, 0.08)",border:"1px solid rgba(220, 38, 38, 0.2)",text:"var(--color-error)",hoverBg:"rgba(220, 38, 38, 0.15)"},success:{bg:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.25)",text:"#22c55e",hoverBg:"rgba(34, 197, 94, 0.15)"},warning:{bg:"rgba(245, 158, 11, 0.08)",border:"1px solid rgba(245, 158, 11, 0.25)",text:"#f59e0b",hoverBg:"rgba(245, 158, 11, 0.15)"}};function g({size:a=12}){return(0,d.jsx)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"animate-spin",children:(0,d.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}function h({size:a=12}){return(0,d.jsx)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})})}function i({size:a=12}){return(0,d.jsxs)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,d.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function j({size:a=12}){return(0,d.jsx)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})})}function k({action:a,entryId:b,objectName:c,fieldId:k,compact:l=!1,state:m,onExecute:n,onRequestConfirm:o,onToast:p,disabled:q=!1}){let r,s,[t,u]=(0,e.useState)({status:"idle"}),v=(0,e.useRef)(null),w=(0,e.useRef)(null),x=m??t,{status:y}=x,z=(0,e.useCallback)(async()=>{if(n)return void n(a,b);u({status:"loading"});let d=new AbortController;w.current=d;try{let e=await fetch(`/api/workspace/objects/${encodeURIComponent(c)}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionId:a.id,fieldId:k,entryIds:[b]}),signal:d.signal});if(!e.ok){let a=(await e.json().catch(()=>({error:"Request failed"}))).error??"Request failed";u({status:"error",error:a}),p?.(a,{type:"error"});return}let f=e.body?.getReader();if(!f){u({status:"error",error:"No response stream"}),p?.("No response stream",{type:"error"});return}let g=new TextDecoder,h="";for(;;){let{done:b,value:c}=await f.read();if(b)break;let d=(h+=g.decode(c,{stream:!0})).split("\n");for(let b of(h=d.pop()??"",d))if(b.startsWith("data: "))try{let c=JSON.parse(b.slice(6));if("progress"===c.type)u({status:"loading",progress:{percent:c.percent,message:c.message}});else if("log"===c.type)p?.(c.message??"",{type:"error"===c.level?"error":"info"});else if("completed"===c.type)if("success"===c.status)u({status:"success",result:c.result}),p?.(a.successLabel??`${a.label} completed`,{type:"success"}),v.current=setTimeout(()=>{u({status:"idle"})},a.autoResetMs??3e3);else{let b=c.error??"Action failed";u({status:"error",error:b}),p?.(b,{type:"error"}),v.current=setTimeout(()=>{u({status:"idle"})},a.autoResetMs??5e3)}}catch{}}}catch(b){if(d.signal.aborted)return;let a=b instanceof Error?b.message:"Unknown error";u({status:"error",error:a}),p?.(a,{type:"error"})}},[a,b,c,k,n,p]),A=(0,e.useCallback)(c=>{if(c.stopPropagation(),"loading"!==y&&!q){if("error"===y)return void u({status:"idle"});a.confirmMessage&&o?o(a,b,z):z()}},[y,q,a,b,o,z]),B=f[a.variant??"default"]??f.default,C=B.bg,D=B.border,E=B.text;switch(y){case"loading":r=a.loadingLabel??"Running...",s=(0,d.jsx)(g,{size:l?14:12});break;case"success":r=a.successLabel??"Done!",s=(0,d.jsx)(h,{size:l?14:12}),C="rgba(34, 197, 94, 0.1)",D="1px solid rgba(34, 197, 94, 0.3)",E="#22c55e";break;case"error":r=a.errorLabel??"Failed",s=(0,d.jsx)(i,{size:l?14:12}),C="rgba(220, 38, 38, 0.1)",D="1px solid rgba(220, 38, 38, 0.3)",E="var(--color-error)";break;default:r=a.label,s=(0,d.jsx)(j,{size:l?14:12})}let F=x.progress?.percent;return(0,d.jsxs)("button",{type:"button",onClick:A,disabled:"loading"===y||q,className:"relative flex items-center gap-1.5 rounded-lg text-xs font-medium transition-all duration-200 overflow-hidden select-none",style:{padding:l?"4px 6px":"5px 10px",background:C,border:D,color:E,opacity:q?.5:1,cursor:"loading"===y||q?"not-allowed":"pointer"},title:"error"===y?x.error:a.label,onMouseEnter:a=>{"loading"===y||q||(a.currentTarget.style.background=B.hoverBg)},onMouseLeave:a=>{a.currentTarget.style.background=C},children:[null!=F&&"loading"===y&&(0,d.jsx)("div",{className:"absolute inset-0 opacity-15 transition-all duration-300",style:{background:E,width:`${F}%`}}),(0,d.jsxs)("span",{className:"relative z-10 flex items-center gap-1.5",children:[s,!l&&(0,d.jsx)("span",{className:"whitespace-nowrap",children:r})]})]})}function l(){let[a,b]=(0,e.useState)(new Map),[c,d]=(0,e.useState)(new Map),f=(0,e.useCallback)((b,c)=>a.get(`${b}_${c}`)??{status:"idle"},[a]),g=(0,e.useCallback)((a,c,d)=>{b(b=>{let e=new Map(b);return e.set(`${a}_${c}`,d),e})},[]),h=(0,e.useCallback)(async(a,b,c,e,f)=>{let h=e.length,i=0,j=0,k=h;for(let b of e)g(a.id,b,{status:"loading"});d(b=>{let c=new Map(b);return c.set(a.id,{status:"running",running:k,succeeded:i,failed:j,total:h}),c});try{let l=await fetch(`/api/workspace/objects/${encodeURIComponent(c)}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionId:a.id,fieldId:b,entryIds:e})});if(!l.ok){d(b=>{let c=new Map(b);return c.set(a.id,{status:"done",running:0,succeeded:0,failed:h,total:h}),c}),f?.onToast?.(`${a.label} failed to start`,{type:"error"});return}let m=l.body?.getReader();if(!m)return;let n=new TextDecoder,o="";for(;;){let{done:b,value:c}=await m.read();if(b)break;let e=(o+=n.decode(c,{stream:!0})).split("\n");for(let b of(o=e.pop()??"",e))if(b.startsWith("data: "))try{let c=JSON.parse(b.slice(6));if("progress"===c.type&&c.entryId)g(a.id,c.entryId,{status:"loading",progress:{percent:c.percent,message:c.message}});else if("completed"===c.type&&c.entryId){k--,"success"===c.status?(i++,g(a.id,c.entryId,{status:"success",result:c.result})):(j++,g(a.id,c.entryId,{status:"error",error:c.error})),d(b=>{let c=new Map(b);return c.set(a.id,{status:k>0?"running":"done",running:k,succeeded:i,failed:j,total:h}),c});let b=f?.autoResetMs??a.autoResetMs??3e3;setTimeout(()=>{g(a.id,c.entryId,{status:"idle"})},b)}}catch{}}}catch{}d(b=>{let c=new Map(b);return c.set(a.id,{status:"done",running:0,succeeded:i,failed:j,total:h}),c}),j>0?f?.onToast?.(`${a.label}: ${i} succeeded, ${j} failed`,{type:"error"}):i>0&&f?.onToast?.(`${a.label}: ${i} entries completed`,{type:"success"}),setTimeout(()=>{d(b=>{let c=new Map(b);return c.delete(a.id),c})},5e3)},[g]);return{getState:f,setState:g,executeBulkAction:h,bulkStates:c}}},710846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},712410:(a,b,c)=>{"use strict";c.d(b,{x:()=>e});var d=c(502714);function e(a,...b){let c=d.w.bind(null,a||b.find(a=>"object"==typeof a));return b.map(c)}},712557:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],f=(0,d.A)("rocket",e)},714659:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"default",{enumerable:!0,get:function(){return e}});let d=c(96309)._(c(629395));function e(a,b){var c;let e={};"function"==typeof a&&(e.loader=a);let f={...e,...b};return(0,d.default)({...f,modules:null==(c=f.loadableGenerated)?void 0:c.modules})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},719771:a=>{"use strict";a.exports=require("process")},720511:(a,b,c)=>{"use strict";c.d(b,{KE:()=>cf,YY:()=>b1,CU:()=>bZ,Db:()=>cx,bP:()=>cy,Yv:()=>cz,Nz:()=>ck,gk:()=>a1,AB:()=>cl,T7:()=>aV,Pi:()=>M,GG:()=>cm,Nx:()=>aW,eL:()=>aX,tp:()=>a$,yQ:()=>bc,gu:()=>bg,FF:()=>bh,iI:()=>aZ,hO:()=>bi,fl:()=>bj,Pg:()=>U,zU:()=>a5,q4:()=>be,iR:()=>bf,QN:()=>bn,J_:()=>bo,rU:()=>aD,Op:()=>br,BQ:()=>bs,eE:()=>ah,OX:()=>cg,Zc:()=>cA,KV:()=>a4,jT:()=>ch,Dd:()=>cu,MG:()=>bw,kj:()=>cv,JJ:()=>ci,tG:()=>cj});var d=c(731626),e=c(331480),f=c(381802);let g=(a,b)=>!a.selection.empty&&(b&&b(a.tr.deleteSelection().scrollIntoView()),!0);function h(a,b){let{$cursor:c}=a.selection;return c&&(b?b.endOfTextblock("backward",a):!(c.parentOffset>0))?c:null}let i=(a,b,c)=>{let g=h(a,c);if(!g)return!1;let i=m(g);if(!i){let c=g.blockRange(),e=c&&(0,d.jP)(c);return null!=e&&(b&&b(a.tr.lift(c,e).scrollIntoView()),!0)}let j=i.nodeBefore;if(w(a,i,b,-1))return!0;if(0==g.parent.content.size&&(k(j,"end")||f.nh.isSelectable(j)))for(let c=g.depth;;c--){let h=(0,d.$L)(a.doc,g.before(c),g.after(c),e.Ji.empty);if(h&&h.slice.size<h.to-h.from){if(b){let c=a.tr.step(h);c.setSelection(k(j,"end")?f.LN.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):f.nh.create(c.doc,i.pos-j.nodeSize)),b(c.scrollIntoView())}return!0}if(1==c||g.node(c-1).childCount>1)break}return!!j.isAtom&&i.depth==g.depth-1&&(b&&b(a.tr.delete(i.pos-j.nodeSize,i.pos).scrollIntoView()),!0)};function j(a,b,c){let g=b.nodeBefore,h=b.pos-1;for(;!g.isTextblock;h--){if(g.type.spec.isolating)return!1;let a=g.lastChild;if(!a)return!1;g=a}let i=b.nodeAfter,j=b.pos+1;for(;!i.isTextblock;j++){if(i.type.spec.isolating)return!1;let a=i.firstChild;if(!a)return!1;i=a}let k=(0,d.$L)(a.doc,h,j,e.Ji.empty);if(!k||k.from!=h||k instanceof d.Ln&&k.slice.size>=j-h)return!1;if(c){let b=a.tr.step(k);b.setSelection(f.U3.create(b.doc,h)),c(b.scrollIntoView())}return!0}function k(a,b,c=!1){for(let d=a;d;d="start"==b?d.firstChild:d.lastChild){if(d.isTextblock)return!0;if(c&&1!=d.childCount)break}return!1}let l=(a,b,c)=>{let{$head:d,empty:e}=a.selection,g=d;if(!e)return!1;if(d.parent.isTextblock){if(c?!c.endOfTextblock("backward",a):d.parentOffset>0)return!1;g=m(d)}let h=g&&g.nodeBefore;return!!h&&!!f.nh.isSelectable(h)&&(b&&b(a.tr.setSelection(f.nh.create(a.doc,g.pos-h.nodeSize)).scrollIntoView()),!0)};function m(a){if(!a.parent.type.spec.isolating)for(let b=a.depth-1;b>=0;b--){if(a.index(b)>0)return a.doc.resolve(a.before(b+1));if(a.node(b).type.spec.isolating)break}return null}function n(a,b){let{$cursor:c}=a.selection;return c&&(b?b.endOfTextblock("forward",a):!(c.parentOffset<c.parent.content.size))?c:null}let o=(a,b,c)=>{let g=n(a,c);if(!g)return!1;let h=q(g);if(!h)return!1;let i=h.nodeAfter;if(w(a,h,b,1))return!0;if(0==g.parent.content.size&&(k(i,"start")||f.nh.isSelectable(i))){let c=(0,d.$L)(a.doc,g.before(),g.after(),e.Ji.empty);if(c&&c.slice.size<c.to-c.from){if(b){let d=a.tr.step(c);d.setSelection(k(i,"start")?f.LN.findFrom(d.doc.resolve(d.mapping.map(h.pos)),1):f.nh.create(d.doc,d.mapping.map(h.pos))),b(d.scrollIntoView())}return!0}}return!!i.isAtom&&h.depth==g.depth-1&&(b&&b(a.tr.delete(h.pos,h.pos+i.nodeSize).scrollIntoView()),!0)},p=(a,b,c)=>{let{$head:d,empty:e}=a.selection,g=d;if(!e)return!1;if(d.parent.isTextblock){if(c?!c.endOfTextblock("forward",a):d.parentOffset<d.parent.content.size)return!1;g=q(d)}let h=g&&g.nodeAfter;return!!h&&!!f.nh.isSelectable(h)&&(b&&b(a.tr.setSelection(f.nh.create(a.doc,g.pos)).scrollIntoView()),!0)};function q(a){if(!a.parent.type.spec.isolating)for(let b=a.depth-1;b>=0;b--){let c=a.node(b);if(a.index(b)+1<c.childCount)return a.doc.resolve(a.after(b+1));if(c.type.spec.isolating)break}return null}let r=(a,b)=>{let{$head:c,$anchor:d}=a.selection;return!!c.parent.type.spec.code&&!!c.sameParent(d)&&(b&&b(a.tr.insertText("\n").scrollIntoView()),!0)};function s(a){for(let b=0;b<a.edgeCount;b++){let{type:c}=a.edge(b);if(c.isTextblock&&!c.hasRequiredAttrs())return c}return null}let t=(a,b)=>{let{$head:c,$anchor:d}=a.selection;if(!c.parent.type.spec.code||!c.sameParent(d))return!1;let e=c.node(-1),g=c.indexAfter(-1),h=s(e.contentMatchAt(g));if(!h||!e.canReplaceWith(g,g,h))return!1;if(b){let d=c.after(),e=a.tr.replaceWith(d,d,h.createAndFill());e.setSelection(f.LN.near(e.doc.resolve(d),1)),b(e.scrollIntoView())}return!0},u=(a,b)=>{let c=a.selection,{$from:d,$to:e}=c;if(c instanceof f.i5||d.parent.inlineContent||e.parent.inlineContent)return!1;let g=s(e.parent.contentMatchAt(e.indexAfter()));if(!g||!g.isTextblock)return!1;if(b){let c=(!d.parentOffset&&e.index()<e.parent.childCount?d:e).pos,h=a.tr.insert(c,g.createAndFill());h.setSelection(f.U3.create(h.doc,c+1)),b(h.scrollIntoView())}return!0},v=(a,b)=>{let{$cursor:c}=a.selection;if(!c||c.parent.content.size)return!1;if(c.depth>1&&c.after()!=c.end(-1)){let e=c.before();if((0,d.zy)(a.doc,e))return b&&b(a.tr.split(e).scrollIntoView()),!0}let e=c.blockRange(),f=e&&(0,d.jP)(e);return null!=f&&(b&&b(a.tr.lift(e,f).scrollIntoView()),!0)};function w(a,b,c,g){let h,i,j,l=b.nodeBefore,m=b.nodeAfter,n,o,p=l.type.spec.isolating||m.type.spec.isolating;if(!p&&(h=b.nodeBefore,i=b.nodeAfter,j=b.index(),h&&i&&h.type.compatibleContent(i.type)&&(!h.content.size&&b.parent.canReplace(j-1,j)?(c&&c(a.tr.delete(b.pos-h.nodeSize,b.pos).scrollIntoView()),!0):!!b.parent.canReplace(j,j+1)&&!!(i.isTextblock||(0,d.n9)(a.doc,b.pos))&&(c&&c(a.tr.join(b.pos).scrollIntoView()),!0))))return!0;let q=!p&&b.parent.canReplace(b.index(),b.index()+1);if(q&&(n=(o=l.contentMatchAt(l.childCount)).findWrapping(m.type))&&o.matchType(n[0]||m.type).validEnd){if(c){let f=b.pos+m.nodeSize,g=e.FK.empty;for(let a=n.length-1;a>=0;a--)g=e.FK.from(n[a].create(null,g));g=e.FK.from(l.copy(g));let h=a.tr.step(new d.Wg(b.pos-1,f,b.pos,f,new e.Ji(g,1,0),n.length,!0)),i=h.doc.resolve(f+2*n.length);i.nodeAfter&&i.nodeAfter.type==l.type&&(0,d.n9)(h.doc,i.pos)&&h.join(i.pos),c(h.scrollIntoView())}return!0}let r=m.type.spec.isolating||g>0&&p?null:f.LN.findFrom(b,1),s=r&&r.$from.blockRange(r.$to),t=s&&(0,d.jP)(s);if(null!=t&&t>=b.depth)return c&&c(a.tr.lift(s,t).scrollIntoView()),!0;if(q&&k(m,"start",!0)&&k(l,"end")){let f=l,g=[];for(;g.push(f),!f.isTextblock;)f=f.lastChild;let h=m,i=1;for(;!h.isTextblock;h=h.firstChild)i++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(c){let f=e.FK.empty;for(let a=g.length-1;a>=0;a--)f=e.FK.from(g[a].copy(f));c(a.tr.step(new d.Wg(b.pos-g.length,b.pos+m.nodeSize,b.pos+i,b.pos+m.nodeSize-i,new e.Ji(f,g.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function x(a){return function(b,c){let d=b.selection,e=a<0?d.$from:d.$to,g=e.depth;for(;e.node(g).isInline;){if(!g)return!1;g--}return!!e.node(g).isTextblock&&(c&&c(b.tr.setSelection(f.U3.create(b.doc,a<0?e.start(g):e.end(g)))),!0)}}let y=x(-1),z=x(1);function A(a,b=null){return function(c,d){let e=!1;for(let d=0;d<c.selection.ranges.length&&!e;d++){let{$from:{pos:f},$to:{pos:g}}=c.selection.ranges[d];c.doc.nodesBetween(f,g,(d,f)=>{if(e)return!1;if(!(!d.isTextblock||d.hasMarkup(a,b)))if(d.type==a)e=!0;else{let b=c.doc.resolve(f),d=b.index();e=b.parent.canReplaceWith(d,d+1,a)}})}if(!e)return!1;if(d){let e=c.tr;for(let d=0;d<c.selection.ranges.length;d++){let{$from:{pos:f},$to:{pos:g}}=c.selection.ranges[d];e.setBlockType(f,g,a,b)}d(e.scrollIntoView())}return!0}}function B(...a){return function(b,c,d){for(let e=0;e<a.length;e++)if(a[e](b,c,d))return!0;return!1}}let C=B(g,i,l),D=B(g,o,p),E={Enter:B(r,u,v,(a,b)=>{let{$from:c,$to:e}=a.selection;if(a.selection instanceof f.nh&&a.selection.node.isBlock)return!!c.parentOffset&&!!(0,d.zy)(a.doc,c.pos)&&(b&&b(a.tr.split(c.pos).scrollIntoView()),!0);if(!c.depth)return!1;let g=[],h,i,j=!1,k=!1;for(let a=c.depth;;a--){if(c.node(a).isBlock){let b;j=c.end(a)==c.pos+(c.depth-a),k=c.start(a)==c.pos-(c.depth-a),i=s(c.node(a-1).contentMatchAt(c.indexAfter(a-1)));g.unshift(b||(j&&i?{type:i}:null)),h=a;break}if(1==a)return!1;g.unshift(null)}let l=a.tr;(a.selection instanceof f.U3||a.selection instanceof f.i5)&&l.deleteSelection();let m=l.mapping.map(c.pos),n=(0,d.zy)(l.doc,m,g.length,g);if(n||(g[0]=i?{type:i}:null,n=(0,d.zy)(l.doc,m,g.length,g)),!n)return!1;if(l.split(m,g.length,g),!j&&k&&c.node(h).type!=i){let a=l.mapping.map(c.before(h)),b=l.doc.resolve(a);i&&c.node(h-1).canReplaceWith(b.index(),b.index()+1,i)&&l.setNodeMarkup(l.mapping.map(c.before(h)),i)}return b&&b(l.scrollIntoView()),!0}),"Mod-Enter":t,Backspace:C,"Mod-Backspace":C,"Shift-Backspace":C,Delete:D,"Mod-Delete":D,"Mod-a":(a,b)=>(b&&b(a.tr.setSelection(new f.i5(a.doc))),!0)},F={"Ctrl-h":E.Backspace,"Alt-Backspace":E["Mod-Backspace"],"Ctrl-d":E.Delete,"Ctrl-Alt-Backspace":E["Mod-Delete"],"Alt-Delete":E["Mod-Delete"],"Alt-d":E["Mod-Delete"],"Ctrl-a":y,"Ctrl-e":z};for(let a in E)F[a]=E[a];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();var G=c(669661),H=c(478853),I=Object.defineProperty,J=(a,b)=>{for(var c in b)I(a,c,{get:b[c],enumerable:!0})};function K(a){let{state:b,transaction:c}=a,{selection:d}=c,{doc:e}=c,{storedMarks:f}=c;return{...b,apply:b.apply.bind(b),applyTransaction:b.applyTransaction.bind(b),plugins:b.plugins,schema:b.schema,reconfigure:b.reconfigure.bind(b),toJSON:b.toJSON.bind(b),get storedMarks(){return f},get selection(){return d},get doc(){return e},get tr(){return d=c.selection,e=c.doc,f=c.storedMarks,c}}}var L=class{constructor(a){this.editor=a.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=a.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:a,editor:b,state:c}=this,{view:d}=b,{tr:e}=c,f=this.buildProps(e);return Object.fromEntries(Object.entries(a).map(([a,b])=>[a,(...a)=>{let c=b(...a)(f);return e.getMeta("preventDispatch")||this.hasCustomState||d.dispatch(e),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(a,b=!0){let{rawCommands:c,editor:d,state:e}=this,{view:f}=d,g=[],h=!!a,i=a||e.tr,j=()=>(h||!b||i.getMeta("preventDispatch")||this.hasCustomState||f.dispatch(i),g.every(a=>!0===a)),k={...Object.fromEntries(Object.entries(c).map(([a,c])=>[a,(...a)=>{let d=this.buildProps(i,b),e=c(...a)(d);return g.push(e),k}])),run:j};return k}createCan(a){let{rawCommands:b,state:c}=this,d=a||c.tr,e=this.buildProps(d,!1);return{...Object.fromEntries(Object.entries(b).map(([a,b])=>[a,(...a)=>b(...a)({...e,dispatch:void 0})])),chain:()=>this.createChain(d,!1)}}buildProps(a,b=!0){let{rawCommands:c,editor:d,state:e}=this,{view:f}=d,g={tr:a,editor:d,view:f,state:K({state:e,transaction:a}),dispatch:b?()=>void 0:void 0,chain:()=>this.createChain(a,b),can:()=>this.createCan(a),get commands(){return Object.fromEntries(Object.entries(c).map(([a,b])=>[a,(...a)=>b(...a)(g)]))}};return g}},M={};J(M,{blur:()=>N,clearContent:()=>O,clearNodes:()=>P,command:()=>Q,createParagraphNear:()=>R,cut:()=>S,deleteCurrentNode:()=>T,deleteNode:()=>V,deleteRange:()=>W,deleteSelection:()=>X,enter:()=>Y,exitCode:()=>Z,extendMarkRange:()=>af,first:()=>ag,focus:()=>am,forEach:()=>an,insertContent:()=>ao,insertContentAt:()=>as,joinBackward:()=>av,joinDown:()=>au,joinForward:()=>aw,joinItemBackward:()=>ax,joinItemForward:()=>ay,joinTextblockBackward:()=>az,joinTextblockForward:()=>aA,joinUp:()=>at,keyboardShortcut:()=>aC,lift:()=>aE,liftEmptyBlock:()=>aF,liftListItem:()=>aG,newlineInCode:()=>aH,resetAttributes:()=>aK,scrollIntoView:()=>aL,selectAll:()=>aM,selectNodeBackward:()=>aN,selectNodeForward:()=>aO,selectParentNode:()=>aP,selectTextblockEnd:()=>aQ,selectTextblockStart:()=>aR,setContent:()=>aT,setMark:()=>bx,setMeta:()=>by,setNode:()=>bz,setNodeSelection:()=>bA,setTextDirection:()=>bB,setTextSelection:()=>bC,sinkListItem:()=>bD,splitBlock:()=>bF,splitListItem:()=>bG,toggleList:()=>bJ,toggleMark:()=>bK,toggleNode:()=>bL,toggleWrap:()=>bM,undoInputRule:()=>bN,unsetAllMarks:()=>bO,unsetMark:()=>bP,unsetTextDirection:()=>bQ,updateAttributes:()=>bR,wrapIn:()=>bS,wrapInList:()=>bT});var N=()=>({editor:a,view:b})=>(requestAnimationFrame(()=>{var c;a.isDestroyed||(b.dom.blur(),null==(c=null==window?void 0:window.getSelection())||c.removeAllRanges())}),!0),O=(a=!0)=>({commands:b})=>b.setContent("",{emitUpdate:a}),P=()=>({state:a,tr:b,dispatch:c})=>{let{selection:e}=b,{ranges:f}=e;return!c||(f.forEach(({$from:c,$to:e})=>{a.doc.nodesBetween(c.pos,e.pos,(a,c)=>{if(a.type.isText)return;let{doc:e,mapping:f}=b,g=e.resolve(f.map(c)),h=e.resolve(f.map(c+a.nodeSize)),i=g.blockRange(h);if(!i)return;let j=(0,d.jP)(i);if(a.type.isTextblock){let{defaultType:a}=g.parent.contentMatchAt(g.index());b.setNodeMarkup(i.start,a)}(j||0===j)&&b.lift(i,j)})}),!0)},Q=a=>b=>a(b),R=()=>({state:a,dispatch:b})=>u(a,b),S=(a,b)=>({editor:c,tr:d})=>{let{state:e}=c,g=e.doc.slice(a.from,a.to);d.deleteRange(a.from,a.to);let h=d.mapping.map(b);return d.insert(h,g.content),d.setSelection(new f.U3(d.doc.resolve(Math.max(h-1,0)))),!0},T=()=>({tr:a,dispatch:b})=>{let{selection:c}=a,d=c.$anchor.node();if(d.content.size>0)return!1;let e=a.selection.$anchor;for(let c=e.depth;c>0;c-=1)if(e.node(c).type===d.type){if(b){let b=e.before(c),d=e.after(c);a.delete(b,d).scrollIntoView()}return!0}return!1};function U(a,b){if("string"==typeof a){if(!b.nodes[a])throw Error(`There is no node type named '${a}'. Maybe you forgot to add the extension?`);return b.nodes[a]}return a}var V=a=>({tr:b,state:c,dispatch:d})=>{let e=U(a,c.schema),f=b.selection.$anchor;for(let a=f.depth;a>0;a-=1)if(f.node(a).type===e){if(d){let c=f.before(a),d=f.after(a);b.delete(c,d).scrollIntoView()}return!0}return!1},W=a=>({tr:b,dispatch:c})=>{let{from:d,to:e}=a;return c&&b.delete(d,e),!0},X=()=>({state:a,dispatch:b})=>g(a,b),Y=()=>({commands:a})=>a.keyboardShortcut("Enter"),Z=()=>({state:a,dispatch:b})=>t(a,b);function _(a){return"[object RegExp]"===Object.prototype.toString.call(a)}function aa(a,b,c={strict:!0}){let d=Object.keys(b);return!d.length||d.every(d=>c.strict?b[d]===a[d]:_(b[d])?b[d].test(a[d]):b[d]===a[d])}function ab(a,b,c={}){return a.find(a=>a.type===b&&aa(Object.fromEntries(Object.keys(c).map(b=>[b,a.attrs[b]])),c))}function ac(a,b,c={}){return!!ab(a,b,c)}function ad(a,b,c){var d;if(!a||!b)return;let e=a.parent.childAfter(a.parentOffset);if(e.node&&e.node.marks.some(a=>a.type===b)||(e=a.parent.childBefore(a.parentOffset)),!e.node||!e.node.marks.some(a=>a.type===b)||(c=c||(null==(d=e.node.marks[0])?void 0:d.attrs),!ab([...e.node.marks],b,c)))return;let f=e.index,g=a.start()+e.offset,h=f+1,i=g+e.node.nodeSize;for(;f>0&&ac([...a.parent.child(f-1).marks],b,c);)f-=1,g-=a.parent.child(f).nodeSize;for(;h<a.parent.childCount&&ac([...a.parent.child(h).marks],b,c);)i+=a.parent.child(h).nodeSize,h+=1;return{from:g,to:i}}function ae(a,b){if("string"==typeof a){if(!b.marks[a])throw Error(`There is no mark type named '${a}'. Maybe you forgot to add the extension?`);return b.marks[a]}return a}var af=(a,b={})=>({tr:c,state:d,dispatch:e})=>{let g=ae(a,d.schema),{doc:h,selection:i}=c,{$from:j,from:k,to:l}=i;if(e){let a=ad(j,g,b);if(a&&a.from<=k&&a.to>=l){let b=f.U3.create(h,a.from,a.to);c.setSelection(b)}}return!0},ag=a=>b=>{let c="function"==typeof a?a(b):a;for(let a=0;a<c.length;a+=1)if(c[a](b))return!0;return!1};function ah(a){return a instanceof f.U3}function ai(a=0,b=0,c=0){return Math.min(Math.max(a,b),c)}function aj(a,b=null){if(!b)return null;let c=f.LN.atStart(a),d=f.LN.atEnd(a);if("start"===b||!0===b)return c;if("end"===b)return d;let e=c.from,g=d.to;return"all"===b?f.U3.create(a,ai(0,e,g),ai(a.content.size,e,g)):f.U3.create(a,ai(b,e,g),ai(b,e,g))}function ak(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function al(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var am=(a=null,b={})=>({editor:c,view:d,tr:e,dispatch:f})=>{b={scrollIntoView:!0,...b};let g=()=>{(al()||ak())&&d.dom.focus(),"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!al()&&!ak()&&d.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!c.isDestroyed&&(d.focus(),(null==b?void 0:b.scrollIntoView)&&c.commands.scrollIntoView())})};try{if(d.hasFocus()&&null===a||!1===a)return!0}catch{return!1}if(f&&null===a&&!ah(c.state.selection))return g(),!0;let h=aj(e.doc,a)||c.state.selection,i=c.state.selection.eq(h);return f&&(i||e.setSelection(h),i&&e.storedMarks&&e.setStoredMarks(e.storedMarks),g()),!0},an=(a,b)=>c=>a.every((a,d)=>b(a,{...c,index:d})),ao=(a,b)=>({tr:c,commands:d})=>d.insertContentAt({from:c.selection.from,to:c.selection.to},a,b),ap=a=>{let b=a.childNodes;for(let c=b.length-1;c>=0;c-=1){let d=b[c];3===d.nodeType&&d.nodeValue&&/^(\n\s\s|\n)$/.test(d.nodeValue)?a.removeChild(d):1===d.nodeType&&ap(d)}return a};function aq(a){if("undefined"==typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let b=`<body>${a}</body>`;return ap(new window.DOMParser().parseFromString(b,"text/html").body)}function ar(a,b,c){if(a instanceof e.bP||a instanceof e.FK)return a;c={slice:!0,parseOptions:{},...c};let d="object"==typeof a&&null!==a,f="string"==typeof a;if(d)try{if(Array.isArray(a)&&a.length>0)return e.FK.fromArray(a.map(a=>b.nodeFromJSON(a)));let d=b.nodeFromJSON(a);return c.errorOnInvalidContent&&d.check(),d}catch(d){if(c.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:d});return console.warn("[tiptap warn]: Invalid content.","Passed value:",a,"Error:",d),ar("",b,c)}if(f){if(c.errorOnInvalidContent){let d=!1,f="",g=new e.Sj({topNode:b.spec.topNode,marks:b.spec.marks,nodes:b.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:a=>(d=!0,f="string"==typeof a?a:a.outerHTML,null)}]}})});if(c.slice?e.S4.fromSchema(g).parseSlice(aq(a),c.parseOptions):e.S4.fromSchema(g).parse(aq(a),c.parseOptions),c.errorOnInvalidContent&&d)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${f}`)})}let d=e.S4.fromSchema(b);return c.slice?d.parseSlice(aq(a),c.parseOptions).content:d.parse(aq(a),c.parseOptions)}return ar("",b,c)}var as=(a,b,c)=>({tr:g,dispatch:h,editor:i})=>{var j;if(h){let h,k;c={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...c};let l=a=>{i.emit("contentError",{editor:i,error:a,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},m={preserveWhitespace:"full",...c.parseOptions};if(!c.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{ar(b,i.schema,{parseOptions:m,errorOnInvalidContent:!0})}catch(a){l(a)}try{h=ar(b,i.schema,{parseOptions:m,errorOnInvalidContent:null!=(j=c.errorOnInvalidContent)?j:i.options.enableContentCheck})}catch(a){return l(a),!1}let{from:n,to:o}="number"==typeof a?{from:a,to:a}:{from:a.from,to:a.to},p=!0,q=!0;if((!("type"in h)?h:[h]).forEach(a=>{a.check(),p=!!p&&a.isText&&0===a.marks.length,q=!!q&&a.isBlock}),n===o&&q){let{parent:a}=g.doc.resolve(n);!a.isTextblock||a.type.spec.code||a.childCount||(n-=1,o+=1)}if(p){if(Array.isArray(b))k=b.map(a=>a.text||"").join("");else if(b instanceof e.FK){let a="";b.forEach(b=>{b.text&&(a+=b.text)}),k=a}else k="object"==typeof b&&b&&b.text?b.text:b;g.insertText(k,n,o)}else{k=h;let a=g.doc.resolve(n),b=a.node(),c=0===a.parentOffset,d=b.isText||b.isTextblock,e=b.content.size>0;c&&d&&e&&(n=Math.max(0,n-1)),g.replaceWith(n,o,k)}c.updateSelection&&function(a,b,c){let e=a.steps.length-1;if(e<b)return;let g=a.steps[e];if(!(g instanceof d.Ln||g instanceof d.Wg))return;let h=a.mapping.maps[e],i=0;h.forEach((a,b,c,d)=>{0===i&&(i=d)}),a.setSelection(f.LN.near(a.doc.resolve(i),-1))}(g,g.steps.length-1,0),c.applyInputRules&&g.setMeta("applyInputRules",{from:n,text:k}),c.applyPasteRules&&g.setMeta("applyPasteRules",{from:n,text:k})}return!0},at=()=>({state:a,dispatch:b})=>((a,b)=>{let c=a.selection,e=c instanceof f.nh,g;if(e){if(c.node.isTextblock||!(0,d.n9)(a.doc,c.from))return!1;g=c.from}else if(null==(g=(0,d.N0)(a.doc,c.from,-1)))return!1;if(b){let c=a.tr.join(g);e&&c.setSelection(f.nh.create(c.doc,g-a.doc.resolve(g).nodeBefore.nodeSize)),b(c.scrollIntoView())}return!0})(a,b),au=()=>({state:a,dispatch:b})=>((a,b)=>{let c=a.selection,e;if(c instanceof f.nh){if(c.node.isTextblock||!(0,d.n9)(a.doc,c.to))return!1;e=c.to}else if(null==(e=(0,d.N0)(a.doc,c.to,1)))return!1;return b&&b(a.tr.join(e).scrollIntoView()),!0})(a,b),av=()=>({state:a,dispatch:b})=>i(a,b),aw=()=>({state:a,dispatch:b})=>o(a,b),ax=()=>({state:a,dispatch:b,tr:c})=>{try{let e=(0,d.N0)(a.doc,a.selection.$from.pos,-1);if(null==e)return!1;return c.join(e,2),b&&b(c),!0}catch{return!1}},ay=()=>({state:a,dispatch:b,tr:c})=>{try{let e=(0,d.N0)(a.doc,a.selection.$from.pos,1);if(null==e)return!1;return c.join(e,2),b&&b(c),!0}catch{return!1}},az=()=>({state:a,dispatch:b})=>((a,b,c)=>{let d=h(a,c);if(!d)return!1;let e=m(d);return!!e&&j(a,e,b)})(a,b),aA=()=>({state:a,dispatch:b})=>((a,b,c)=>{let d=n(a,c);if(!d)return!1;let e=q(d);return!!e&&j(a,e,b)})(a,b);function aB(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var aC=a=>({editor:b,view:c,tr:d,dispatch:e})=>{let f=(function(a){let b,c,d,e,f=a.split(/-(?!$)/),g=f[f.length-1];"Space"===g&&(g=" ");for(let a=0;a<f.length-1;a+=1){let g=f[a];if(/^(cmd|meta|m)$/i.test(g))e=!0;else if(/^a(lt)?$/i.test(g))b=!0;else if(/^(c|ctrl|control)$/i.test(g))c=!0;else if(/^s(hift)?$/i.test(g))d=!0;else if(/^mod$/i.test(g))al()||aB()?e=!0:c=!0;else throw Error(`Unrecognized modifier name: ${g}`)}return b&&(g=`Alt-${g}`),c&&(g=`Ctrl-${g}`),e&&(g=`Meta-${g}`),d&&(g=`Shift-${g}`),g})(a).split(/-(?!$)/),g=f.find(a=>!["Alt","Ctrl","Meta","Shift"].includes(a)),h=new KeyboardEvent("keydown",{key:"Space"===g?" ":g,altKey:f.includes("Alt"),ctrlKey:f.includes("Ctrl"),metaKey:f.includes("Meta"),shiftKey:f.includes("Shift"),bubbles:!0,cancelable:!0}),i=b.captureTransaction(()=>{c.someProp("handleKeyDown",a=>a(c,h))});return null==i||i.steps.forEach(a=>{let b=a.map(d.mapping);b&&e&&d.maybeStep(b)}),!0};function aD(a,b,c={}){let{from:d,to:e,empty:f}=a.selection,g=b?U(b,a.schema):null,h=[];a.doc.nodesBetween(d,e,(a,b)=>{if(a.isText)return;let c=Math.max(d,b),f=Math.min(e,b+a.nodeSize);h.push({node:a,from:c,to:f})});let i=e-d,j=h.filter(a=>!g||g.name===a.node.type.name).filter(a=>aa(a.node.attrs,c,{strict:!1}));return f?!!j.length:j.reduce((a,b)=>a+b.to-b.from,0)>=i}var aE=(a,b={})=>({state:c,dispatch:e})=>{let f=U(a,c.schema);return!!aD(c,f,b)&&((a,b)=>{let{$from:c,$to:e}=a.selection,f=c.blockRange(e),g=f&&(0,d.jP)(f);return null!=g&&(b&&b(a.tr.lift(f,g).scrollIntoView()),!0)})(c,e)},aF=()=>({state:a,dispatch:b})=>v(a,b),aG=a=>({state:b,dispatch:c})=>(function(a){return function(b,c){let{$from:f,$to:g}=b.selection,h=f.blockRange(g,b=>b.childCount>0&&b.firstChild.type==a);return!!h&&(!c||(f.node(h.depth-1).type==a?function(a,b,c,f){let g=a.tr,h=f.end,i=f.$to.end(f.depth);h<i&&(g.step(new d.Wg(h-1,i,h,i,new e.Ji(e.FK.from(c.create(null,f.parent.copy())),1,0),1,!0)),f=new e.u$(g.doc.resolve(f.$from.pos),g.doc.resolve(i),f.depth));let j=(0,d.jP)(f);if(null==j)return!1;g.lift(f,j);let k=g.doc.resolve(g.mapping.map(h,-1)-1);return(0,d.n9)(g.doc,k.pos)&&k.nodeBefore.type==k.nodeAfter.type&&g.join(k.pos),b(g.scrollIntoView()),!0}(b,c,a,h):function(a,b,c){let f=a.tr,g=c.parent;for(let a=c.end,b=c.endIndex-1,d=c.startIndex;b>d;b--)a-=g.child(b).nodeSize,f.delete(a-1,a+1);let h=f.doc.resolve(c.start),i=h.nodeAfter;if(f.mapping.map(c.end)!=c.start+h.nodeAfter.nodeSize)return!1;let j=0==c.startIndex,k=c.endIndex==g.childCount,l=h.node(-1),m=h.index(-1);if(!l.canReplace(m+ +!j,m+1,i.content.append(k?e.FK.empty:e.FK.from(g))))return!1;let n=h.pos,o=n+i.nodeSize;return f.step(new d.Wg(n-!!j,o+ +!!k,n+1,o-1,new e.Ji((j?e.FK.empty:e.FK.from(g.copy(e.FK.empty))).append(k?e.FK.empty:e.FK.from(g.copy(e.FK.empty))),+!j,+!k),+!j)),b(f.scrollIntoView()),!0}(b,c,h)))}})(U(a,b.schema))(b,c),aH=()=>({state:a,dispatch:b})=>r(a,b);function aI(a,b){return b.nodes[a]?"node":b.marks[a]?"mark":null}function aJ(a,b){let c="string"==typeof b?[b]:b;return Object.keys(a).reduce((b,d)=>(c.includes(d)||(b[d]=a[d]),b),{})}var aK=(a,b)=>({tr:c,state:d,dispatch:e})=>{let f=null,g=null,h=aI("string"==typeof a?a:a.name,d.schema);if(!h)return!1;"node"===h&&(f=U(a,d.schema)),"mark"===h&&(g=ae(a,d.schema));let i=!1;return c.selection.ranges.forEach(a=>{d.doc.nodesBetween(a.$from.pos,a.$to.pos,(a,d)=>{f&&f===a.type&&(i=!0,e&&c.setNodeMarkup(d,void 0,aJ(a.attrs,b))),g&&a.marks.length&&a.marks.forEach(f=>{g===f.type&&(i=!0,e&&c.addMark(d,d+a.nodeSize,g.create(aJ(f.attrs,b))))})})}),i},aL=()=>({tr:a,dispatch:b})=>(b&&a.scrollIntoView(),!0),aM=()=>({tr:a,dispatch:b})=>{if(b){let b=new f.i5(a.doc);a.setSelection(b)}return!0},aN=()=>({state:a,dispatch:b})=>l(a,b),aO=()=>({state:a,dispatch:b})=>p(a,b),aP=()=>({state:a,dispatch:b})=>((a,b)=>{let{$from:c,to:d}=a.selection,e,g=c.sharedDepth(d);return 0!=g&&(e=c.before(g),b&&b(a.tr.setSelection(f.nh.create(a.doc,e))),!0)})(a,b),aQ=()=>({state:a,dispatch:b})=>z(a,b),aR=()=>({state:a,dispatch:b})=>y(a,b);function aS(a,b,c={},d={}){return ar(a,b,{slice:!1,parseOptions:c,errorOnInvalidContent:d.errorOnInvalidContent})}var aT=(a,{errorOnInvalidContent:b,emitUpdate:c=!0,parseOptions:d={}}={})=>({editor:e,tr:f,dispatch:g,commands:h})=>{let{doc:i}=f;if("full"!==d.preserveWhitespace){let h=aS(a,e.schema,d,{errorOnInvalidContent:null!=b?b:e.options.enableContentCheck});return g&&f.replaceWith(0,i.content.size,h).setMeta("preventUpdate",!c),!0}return g&&f.setMeta("preventUpdate",!c),h.insertContentAt({from:0,to:i.content.size},a,{parseOptions:d,errorOnInvalidContent:null!=b?b:e.options.enableContentCheck})};function aU(a,b){let c=ae(b,a.schema),{from:d,to:e,empty:f}=a.selection,g=[];f?(a.storedMarks&&g.push(...a.storedMarks),g.push(...a.selection.$head.marks())):a.doc.nodesBetween(d,e,a=>{g.push(...a.marks)});let h=g.find(a=>a.type.name===c.name);return h?{...h.attrs}:{}}function aV(a,b){let c=new d.dL(a);return b.forEach(a=>{a.steps.forEach(a=>{c.step(a)})}),c}function aW(a,b,c){let d=[];return a.nodesBetween(b.from,b.to,(a,b)=>{c(a)&&d.push({node:a,pos:b})}),d}function aX(a,b){for(let c=a.depth;c>0;c-=1){let d=a.node(c);if(b(d))return{pos:c>0?a.before(c):0,start:a.start(c),depth:c,node:d}}}function aY(a){return b=>aX(b.$from,a)}function aZ(a,b,c){return void 0===a.config[b]&&a.parent?aZ(a.parent,b,c):"function"==typeof a.config[b]?a.config[b].bind({...c,parent:a.parent?aZ(a.parent,b,c):null}):a.config[b]}function a$(a){return a.map(a=>{let b={name:a.name,options:a.options,storage:a.storage},c=aZ(a,"addExtensions",b);return c?[a,...a$(c())]:a}).flat(10)}function a_(a,b){let c=e.ZF.fromSchema(b).serializeFragment(a),d=document.implementation.createHTMLDocument().createElement("div");return d.appendChild(c),d.innerHTML}function a0(a){return"function"==typeof a}function a1(a,b,...c){return a0(a)?b?a.bind(b)(...c):a(...c):a}function a2(a){let b=a.filter(a=>"extension"===a.type);return{baseExtensions:b,nodeExtensions:a.filter(a=>"node"===a.type),markExtensions:a.filter(a=>"mark"===a.type)}}function a3(a){let b=[],{nodeExtensions:c,markExtensions:d}=a2(a),e=[...c,...d],f={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return a.forEach(a=>{let c={name:a.name,options:a.options,storage:a.storage,extensions:e},d=aZ(a,"addGlobalAttributes",c);d&&d().forEach(a=>{a.types.forEach(c=>{Object.entries(a.attributes).forEach(([a,d])=>{b.push({type:c,name:a,attribute:{...f,...d}})})})})}),e.forEach(a=>{let c={name:a.name,options:a.options,storage:a.storage},d=aZ(a,"addAttributes",c);d&&Object.entries(d()).forEach(([c,d])=>{let e={...f,...d};"function"==typeof(null==e?void 0:e.default)&&(e.default=e.default()),(null==e?void 0:e.isRequired)&&(null==e?void 0:e.default)===void 0&&delete e.default,b.push({type:a.name,name:c,attribute:e})})}),b}function a4(...a){return a.filter(a=>!!a).reduce((a,b)=>{let c={...a};return Object.entries(b).forEach(([a,b])=>{if(!c[a]){c[a]=b;return}if("class"===a){let d=b?String(b).split(" "):[],e=c[a]?c[a].split(" "):[],f=d.filter(a=>!e.includes(a));c[a]=[...e,...f].join(" ")}else if("style"===a){let d=b?b.split(";").map(a=>a.trim()).filter(Boolean):[],e=c[a]?c[a].split(";").map(a=>a.trim()).filter(Boolean):[],f=new Map;e.forEach(a=>{let[b,c]=a.split(":").map(a=>a.trim());f.set(b,c)}),d.forEach(a=>{let[b,c]=a.split(":").map(a=>a.trim());f.set(b,c)}),c[a]=Array.from(f.entries()).map(([a,b])=>`${a}: ${b}`).join("; ")}else c[a]=b}),c},{})}function a5(a,b){return b.filter(b=>b.type===a.type.name).filter(a=>a.attribute.rendered).map(b=>b.attribute.renderHTML?b.attribute.renderHTML(a.attrs)||{}:{[b.name]:a.attrs[b.name]}).reduce((a,b)=>a4(a,b),{})}function a6(a,b){return"style"in a?a:{...a,getAttrs:c=>{let d=a.getAttrs?a.getAttrs(c):a.attrs;if(!1===d)return!1;let e=b.reduce((a,b)=>{var d;let e=b.attribute.parseHTML?b.attribute.parseHTML(c):"string"!=typeof(d=c.getAttribute(b.name))?d:d.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(d):"true"===d||"false"!==d&&d;return null==e?a:{...a,[b.name]:e}},{});return{...d,...e}}}}function a7(a){return Object.fromEntries(Object.entries(a).filter(([a,b])=>!("attrs"===a&&function(a={}){return 0===Object.keys(a).length&&a.constructor===Object}(b))&&null!=b))}function a8(a){var b,c;let d={};return!(null==(b=null==a?void 0:a.attribute)?void 0:b.isRequired)&&"default"in((null==a?void 0:a.attribute)||{})&&(d.default=a.attribute.default),(null==(c=null==a?void 0:a.attribute)?void 0:c.validate)!==void 0&&(d.validate=a.attribute.validate),[a.name,d]}function a9(a,b){var c;let d=a3(a),{nodeExtensions:f,markExtensions:g}=a2(a),h=null==(c=f.find(a=>aZ(a,"topNode")))?void 0:c.name,i=Object.fromEntries(f.map(c=>{let e=d.filter(a=>a.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:b},g=a7({...a.reduce((a,b)=>{let d=aZ(b,"extendNodeSchema",f);return{...a,...d?d(c):{}}},{}),content:a1(aZ(c,"content",f)),marks:a1(aZ(c,"marks",f)),group:a1(aZ(c,"group",f)),inline:a1(aZ(c,"inline",f)),atom:a1(aZ(c,"atom",f)),selectable:a1(aZ(c,"selectable",f)),draggable:a1(aZ(c,"draggable",f)),code:a1(aZ(c,"code",f)),whitespace:a1(aZ(c,"whitespace",f)),linebreakReplacement:a1(aZ(c,"linebreakReplacement",f)),defining:a1(aZ(c,"defining",f)),isolating:a1(aZ(c,"isolating",f)),attrs:Object.fromEntries(e.map(a8))}),h=a1(aZ(c,"parseHTML",f));h&&(g.parseDOM=h.map(a=>a6(a,e)));let i=aZ(c,"renderHTML",f);i&&(g.toDOM=a=>i({node:a,HTMLAttributes:a5(a,e)}));let j=aZ(c,"renderText",f);return j&&(g.toText=j),[c.name,g]})),j=Object.fromEntries(g.map(c=>{let e=d.filter(a=>a.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:b},g=a7({...a.reduce((a,b)=>{let d=aZ(b,"extendMarkSchema",f);return{...a,...d?d(c):{}}},{}),inclusive:a1(aZ(c,"inclusive",f)),excludes:a1(aZ(c,"excludes",f)),group:a1(aZ(c,"group",f)),spanning:a1(aZ(c,"spanning",f)),code:a1(aZ(c,"code",f)),attrs:Object.fromEntries(e.map(a8))}),h=a1(aZ(c,"parseHTML",f));h&&(g.parseDOM=h.map(a=>a6(a,e)));let i=aZ(c,"renderHTML",f);return i&&(g.toDOM=a=>i({mark:a,HTMLAttributes:a5(a,e)})),[c.name,g]}));return new e.Sj({topNode:h,nodes:i,marks:j})}function ba(a){return a.sort((a,b)=>{let c=aZ(a,"priority")||100,d=aZ(b,"priority")||100;return c>d?-1:+(c<d)})}function bb(a){var b;let c=ba(a$(a)),d=Array.from(new Set((b=c.map(a=>a.name)).filter((a,c)=>b.indexOf(a)!==c)));return d.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${d.map(a=>`'${a}'`).join(", ")}]. This can lead to issues.`),c}function bc(a,b){let c=a9(bb(b),void 0),d=aq(a);return e.S4.fromSchema(c).parse(d).toJSON()}function bd(a,b,c){let{from:d,to:e}=b,{blockSeparator:f="\n\n",textSerializers:g={}}=c||{},h="";return a.nodesBetween(d,e,(a,c,i,j)=>{var k;a.isBlock&&c>d&&(h+=f);let l=null==g?void 0:g[a.type.name];if(l)return i&&(h+=l({node:a,pos:c,parent:i,index:j,range:b})),!1;a.isText&&(h+=null==(k=null==a?void 0:a.text)?void 0:k.slice(Math.max(d,c)-c,e-c))}),h}function be(a,b){let c={from:0,to:a.content.size};return bd(a,c,b)}function bf(a){return Object.fromEntries(Object.entries(a.nodes).filter(([,a])=>a.spec.toText).map(([a,b])=>[a,b.spec.toText]))}function bg(a,b){let c=aI("string"==typeof b?b:b.name,a.schema);if("node"===c){let c=U(b,a.schema),{from:d,to:e}=a.selection,f=[];a.doc.nodesBetween(d,e,a=>{f.push(a)});let g=f.reverse().find(a=>a.type.name===c.name);return g?{...g.attrs}:{}}return"mark"===c?aU(a,b):{}}function bh(a){let{mapping:b,steps:c}=a,d=[];b.maps.forEach((a,e)=>{let f=[];if(a.ranges.length)a.forEach((a,b)=>{f.push({from:a,to:b})});else{let{from:a,to:b}=c[e];if(void 0===a||void 0===b)return;f.push({from:a,to:b})}f.forEach(({from:a,to:c})=>{let f=b.slice(e).map(a,-1),g=b.slice(e).map(c),h=b.invert().map(f,-1),i=b.invert().map(g);d.push({oldRange:{from:h,to:i},newRange:{from:f,to:g}})})});let e=function(a,b=JSON.stringify){let c={};return a.filter(a=>{let d=b(a);return!Object.prototype.hasOwnProperty.call(c,d)&&(c[d]=!0)})}(d);return 1===e.length?e:e.filter((a,b)=>!e.filter((a,c)=>c!==b).some(b=>a.oldRange.from>=b.oldRange.from&&a.oldRange.to<=b.oldRange.to&&a.newRange.from>=b.newRange.from&&a.newRange.to<=b.newRange.to))}function bi(a,b,c){let d=[];return a===b?c.resolve(a).marks().forEach(b=>{let e=ad(c.resolve(a),b.type);e&&d.push({mark:b,...e})}):c.nodesBetween(a,b,(a,b)=>{a&&(null==a?void 0:a.nodeSize)!==void 0&&d.push(...a.marks.map(c=>({from:b,to:b+a.nodeSize,mark:c})))}),d}var bj=(a,b,c,d=20)=>{let e=a.doc.resolve(c),f=d,g=null;for(;f>0&&null===g;){let a=e.node(f);(null==a?void 0:a.type.name)===b?g=a:f-=1}return[g,f]};function bk(a,b){return b.nodes[a]||b.marks[a]||null}function bl(a,b,c){return Object.fromEntries(Object.entries(c).filter(([c])=>{let d=a.find(a=>a.type===b&&a.name===c);return!!d&&d.attribute.keepOnSplit}))}function bm(a,b,c={}){let{empty:d,ranges:e}=a.selection,f=b?ae(b,a.schema):null;if(d)return!!(a.storedMarks||a.selection.$from.marks()).filter(a=>!f||f.name===a.type.name).find(a=>aa(a.attrs,c,{strict:!1}));let g=0,h=[];if(e.forEach(({$from:b,$to:c})=>{let d=b.pos,e=c.pos;a.doc.nodesBetween(d,e,(a,b)=>{if(!a.isText&&!a.marks.length)return;let c=Math.max(d,b),f=Math.min(e,b+a.nodeSize);g+=f-c,h.push(...a.marks.map(a=>({mark:a,from:c,to:f})))})}),0===g)return!1;let i=h.filter(a=>!f||f.name===a.mark.type.name).filter(a=>aa(a.mark.attrs,c,{strict:!1})).reduce((a,b)=>a+b.to-b.from,0),j=h.filter(a=>!f||a.mark.type!==f&&a.mark.type.excludes(f)).reduce((a,b)=>a+b.to-b.from,0);return(i>0?i+j:i)>=g}var bn=(a,b)=>{let{$from:c,$to:d,$anchor:e}=a.selection;if(b){let c=aY(a=>a.type.name===b)(a.selection);if(!c)return!1;let d=a.doc.resolve(c.pos+1);return e.pos+1===d.end()}return!(d.parentOffset<d.parent.nodeSize-2)&&c.pos===d.pos},bo=a=>{let{$from:b,$to:c}=a.selection;return!(b.parentOffset>0)&&b.pos===c.pos};function bp(a,b){return Array.isArray(b)?b.some(b=>("string"==typeof b?b:b.name)===a.name):b}function bq(a,b){let{nodeExtensions:c}=a2(b),d=c.find(b=>b.name===a);if(!d)return!1;let e={name:d.name,options:d.options,storage:d.storage},f=a1(aZ(d,"group",e));return"string"==typeof f&&f.split(" ").includes("list")}function br(a,{checkChildren:b=!0,ignoreWhitespace:c=!1}={}){var d;if(c){if("hardBreak"===a.type.name)return!0;if(a.isText)return/^\s*$/m.test(null!=(d=a.text)?d:"")}if(a.isText)return!a.text;if(a.isAtom||a.isLeaf)return!1;if(0===a.content.childCount)return!0;if(b){let d=!0;return a.content.forEach(a=>{!1!==d&&(br(a,{ignoreWhitespace:c,checkChildren:b})||(d=!1))}),d}return!1}function bs(a){return a instanceof f.nh}var bt=class a{constructor(a){this.position=a}static fromJSON(b){return new a(b.position)}toJSON(){return{position:this.position}}};function bu(a,b){let c=b.mapping.mapResult(a.position);return{position:new bt(c.pos),mapResult:c}}function bv(a){return new bt(a)}function bw(a,b,c){let d=a.state.doc.content.size,e=ai(b,0,d),f=ai(c,0,d),g=a.coordsAtPos(e),h=a.coordsAtPos(f,-1),i=Math.min(g.top,h.top),j=Math.max(g.bottom,h.bottom),k=Math.min(g.left,h.left),l=Math.max(g.right,h.right),m={top:i,bottom:j,left:k,right:l,width:l-k,height:j-i,x:k,y:i};return{...m,toJSON:()=>m}}var bx=(a,b={})=>({tr:c,state:d,dispatch:e})=>{let{selection:f}=c,{empty:g,ranges:h}=f,i=ae(a,d.schema);if(e)if(g){let a=aU(d,i);c.addStoredMark(i.create({...a,...b}))}else h.forEach(a=>{let e=a.$from.pos,f=a.$to.pos;d.doc.nodesBetween(e,f,(a,d)=>{let g=Math.max(d,e),h=Math.min(d+a.nodeSize,f);a.marks.find(a=>a.type===i)?a.marks.forEach(a=>{i===a.type&&c.addMark(g,h,i.create({...a.attrs,...b}))}):c.addMark(g,h,i.create(b))})});return function(a,b,c){var d;let{selection:e}=b,f=null;if(ah(e)&&(f=e.$cursor),f){let b=null!=(d=a.storedMarks)?d:f.marks();return f.parent.type.allowsMarkType(c)&&(!!c.isInSet(b)||!b.some(a=>a.type.excludes(c)))}let{ranges:g}=e;return g.some(({$from:b,$to:d})=>{let e=0===b.depth&&a.doc.inlineContent&&a.doc.type.allowsMarkType(c);return a.doc.nodesBetween(b.pos,d.pos,(a,b,d)=>{if(e)return!1;if(a.isInline){let b=!d||d.type.allowsMarkType(c),f=!!c.isInSet(a.marks)||!a.marks.some(a=>a.type.excludes(c));e=b&&f}return!e}),e})}(d,c,i)},by=(a,b)=>({tr:c})=>(c.setMeta(a,b),!0),bz=(a,b={})=>({state:c,dispatch:d,chain:e})=>{let f,g=U(a,c.schema);return(c.selection.$anchor.sameParent(c.selection.$head)&&(f=c.selection.$anchor.parent.attrs),g.isTextblock)?e().command(({commands:a})=>!!A(g,{...f,...b})(c)||a.clearNodes()).command(({state:a})=>A(g,{...f,...b})(a,d)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},bA=a=>({tr:b,dispatch:c})=>{if(c){let{doc:c}=b,d=ai(a,0,c.content.size),e=f.nh.create(c,d);b.setSelection(e)}return!0},bB=(a,b)=>({tr:c,state:d,dispatch:e})=>{let f,g,{selection:h}=d;return"number"==typeof b?(f=b,g=b):b&&"from"in b&&"to"in b?(f=b.from,g=b.to):(f=h.from,g=h.to),e&&c.doc.nodesBetween(f,g,(b,d)=>{b.isText||c.setNodeMarkup(d,void 0,{...b.attrs,dir:a})}),!0},bC=a=>({tr:b,dispatch:c})=>{if(c){let{doc:c}=b,{from:d,to:e}="number"==typeof a?{from:a,to:a}:a,g=f.U3.atStart(c).from,h=f.U3.atEnd(c).to,i=ai(d,g,h),j=ai(e,g,h),k=f.U3.create(c,i,j);b.setSelection(k)}return!0},bD=a=>({state:b,dispatch:c})=>(function(a){return function(b,c){let{$from:f,$to:g}=b.selection,h=f.blockRange(g,b=>b.childCount>0&&b.firstChild.type==a);if(!h)return!1;let i=h.startIndex;if(0==i)return!1;let j=h.parent,k=j.child(i-1);if(k.type!=a)return!1;if(c){let f=k.lastChild&&k.lastChild.type==j.type,g=e.FK.from(f?a.create():null),i=new e.Ji(e.FK.from(a.create(null,e.FK.from(j.type.create(null,g)))),f?3:1,0),l=h.start,m=h.end;c(b.tr.step(new d.Wg(l-(f?3:1),m,l,m,i,1,!0)).scrollIntoView())}return!0}})(U(a,b.schema))(b,c);function bE(a,b){let c=a.storedMarks||a.selection.$to.parentOffset&&a.selection.$from.marks();if(c){let d=c.filter(a=>null==b?void 0:b.includes(a.type.name));a.tr.ensureMarks(d)}}var bF=({keepMarks:a=!0}={})=>({tr:b,state:c,dispatch:e,editor:g})=>{let{selection:h,doc:i}=b,{$from:j,$to:k}=h,l=bl(g.extensionManager.attributes,j.node().type.name,j.node().attrs);if(h instanceof f.nh&&h.node.isBlock)return!!j.parentOffset&&!!(0,d.zy)(i,j.pos)&&(e&&(a&&bE(c,g.extensionManager.splittableMarks),b.split(j.pos).scrollIntoView()),!0);if(!j.parent.isBlock)return!1;let m=k.parentOffset===k.parent.content.size,n=0===j.depth?void 0:function(a){for(let b=0;b<a.edgeCount;b+=1){let{type:c}=a.edge(b);if(c.isTextblock&&!c.hasRequiredAttrs())return c}return null}(j.node(-1).contentMatchAt(j.indexAfter(-1))),o=m&&n?[{type:n,attrs:l}]:void 0,p=(0,d.zy)(b.doc,b.mapping.map(j.pos),1,o);if(!o&&!p&&(0,d.zy)(b.doc,b.mapping.map(j.pos),1,n?[{type:n}]:void 0)&&(p=!0,o=n?[{type:n,attrs:l}]:void 0),e){if(p&&(h instanceof f.U3&&b.deleteSelection(),b.split(b.mapping.map(j.pos),1,o),n&&!m&&!j.parentOffset&&j.parent.type!==n)){let a=b.mapping.map(j.before()),c=b.doc.resolve(a);j.node(-1).canReplaceWith(c.index(),c.index()+1,n)&&b.setNodeMarkup(b.mapping.map(j.before()),n)}a&&bE(c,g.extensionManager.splittableMarks),b.scrollIntoView()}return p},bG=(a,b={})=>({tr:c,state:g,dispatch:h,editor:i})=>{var j;let k=U(a,g.schema),{$from:l,$to:m}=g.selection,n=g.selection.node;if(n&&n.isBlock||l.depth<2||!l.sameParent(m))return!1;let o=l.node(-1);if(o.type!==k)return!1;let p=i.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==k||l.index(-2)!==l.node(-2).childCount-1)return!1;if(h){let a=e.FK.empty,d=l.index(-1)?1:l.index(-2)?2:3;for(let b=l.depth-d;b>=l.depth-3;b-=1)a=e.FK.from(l.node(b).copy(a));let g=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,h={...bl(p,l.node().type.name,l.node().attrs),...b},i=(null==(j=k.contentMatch.defaultType)?void 0:j.createAndFill(h))||void 0;a=a.append(e.FK.from(k.createAndFill(null,i)||void 0));let m=l.before(l.depth-(d-1));c.replace(m,l.after(-g),new e.Ji(a,4-d,0));let n=-1;c.doc.nodesBetween(m,c.doc.content.size,(a,b)=>{if(n>-1)return!1;a.isTextblock&&0===a.content.size&&(n=b+1)}),n>-1&&c.setSelection(f.U3.near(c.doc.resolve(n))),c.scrollIntoView()}return!0}let q=m.pos===l.end()?o.contentMatchAt(0).defaultType:null,r={...bl(p,o.type.name,o.attrs),...b},s={...bl(p,l.node().type.name,l.node().attrs),...b};c.delete(l.pos,m.pos);let t=q?[{type:k,attrs:r},{type:q,attrs:s}]:[{type:k,attrs:r}];if(!(0,d.zy)(c.doc,l.pos,2))return!1;if(h){let{selection:a,storedMarks:b}=g,{splittableMarks:d}=i.extensionManager,e=b||a.$to.parentOffset&&a.$from.marks();if(c.split(l.pos,2,t).scrollIntoView(),!e||!h)return!0;let f=e.filter(a=>d.includes(a.type.name));c.ensureMarks(f)}return!0},bH=(a,b)=>{let c=aY(a=>a.type===b)(a.selection);if(!c)return!0;let e=a.doc.resolve(Math.max(0,c.pos-1)).before(c.depth);if(void 0===e)return!0;let f=a.doc.nodeAt(e);return!(c.node.type===(null==f?void 0:f.type)&&(0,d.n9)(a.doc,c.pos))||(a.join(c.pos),!0)},bI=(a,b)=>{let c=aY(a=>a.type===b)(a.selection);if(!c)return!0;let e=a.doc.resolve(c.start).after(c.depth);if(void 0===e)return!0;let f=a.doc.nodeAt(e);return!(c.node.type===(null==f?void 0:f.type)&&(0,d.n9)(a.doc,e))||(a.join(e),!0)},bJ=(a,b,c,d={})=>({editor:e,tr:f,state:g,dispatch:h,chain:i,commands:j,can:k})=>{let{extensions:l,splittableMarks:m}=e.extensionManager,n=U(a,g.schema),o=U(b,g.schema),{selection:p,storedMarks:q}=g,{$from:r,$to:s}=p,t=r.blockRange(s),u=q||p.$to.parentOffset&&p.$from.marks();if(!t)return!1;let v=aY(a=>bq(a.type.name,l))(p);if(t.depth>=1&&v&&t.depth-v.depth<=1){if(v.node.type===n)return j.liftListItem(o);if(bq(v.node.type.name,l)&&n.validContent(v.node.content)&&h)return i().command(()=>(f.setNodeMarkup(v.pos,n),!0)).command(()=>bH(f,n)).command(()=>bI(f,n)).run()}return c&&u&&h?i().command(()=>{let a=k().wrapInList(n,d),b=u.filter(a=>m.includes(a.type.name));return f.ensureMarks(b),!!a||j.clearNodes()}).wrapInList(n,d).command(()=>bH(f,n)).command(()=>bI(f,n)).run():i().command(()=>!!k().wrapInList(n,d)||j.clearNodes()).wrapInList(n,d).command(()=>bH(f,n)).command(()=>bI(f,n)).run()},bK=(a,b={},c={})=>({state:d,commands:e})=>{let{extendEmptyMarkRange:f=!1}=c,g=ae(a,d.schema);return bm(d,g,b)?e.unsetMark(g,{extendEmptyMarkRange:f}):e.setMark(g,b)},bL=(a,b,c={})=>({state:d,commands:e})=>{let f,g=U(a,d.schema),h=U(b,d.schema),i=aD(d,g,c);return(d.selection.$anchor.sameParent(d.selection.$head)&&(f=d.selection.$anchor.parent.attrs),i)?e.setNode(h,f):e.setNode(g,{...f,...c})},bM=(a,b={})=>({state:c,commands:d})=>{let e=U(a,c.schema);return aD(c,e,b)?d.lift(e):d.wrapIn(e,b)},bN=()=>({state:a,dispatch:b})=>{let c=a.plugins;for(let d=0;d<c.length;d+=1){let e,f=c[d];if(f.spec.isInputRules&&(e=f.getState(a))){if(b){let b=a.tr,c=e.transform;for(let a=c.steps.length-1;a>=0;a-=1)b.step(c.steps[a].invert(c.docs[a]));if(e.text){let c=b.doc.resolve(e.from).marks();b.replaceWith(e.from,e.to,a.schema.text(e.text,c))}else b.delete(e.from,e.to)}return!0}}return!1},bO=()=>({tr:a,dispatch:b})=>{let{selection:c}=a,{empty:d,ranges:e}=c;return!!d||(b&&e.forEach(b=>{a.removeMark(b.$from.pos,b.$to.pos)}),!0)},bP=(a,b={})=>({tr:c,state:d,dispatch:e})=>{var f;let{extendEmptyMarkRange:g=!1}=b,{selection:h}=c,i=ae(a,d.schema),{$from:j,empty:k,ranges:l}=h;if(!e)return!0;if(k&&g){let{from:a,to:b}=h,d=null==(f=j.marks().find(a=>a.type===i))?void 0:f.attrs,e=ad(j,i,d);e&&(a=e.from,b=e.to),c.removeMark(a,b,i)}else l.forEach(a=>{c.removeMark(a.$from.pos,a.$to.pos,i)});return c.removeStoredMark(i),!0},bQ=a=>({tr:b,state:c,dispatch:d})=>{let e,f,{selection:g}=c;return"number"==typeof a?(e=a,f=a):a&&"from"in a&&"to"in a?(e=a.from,f=a.to):(e=g.from,f=g.to),d&&b.doc.nodesBetween(e,f,(a,c)=>{if(a.isText)return;let d={...a.attrs};delete d.dir,b.setNodeMarkup(c,void 0,d)}),!0},bR=(a,b={})=>({tr:c,state:d,dispatch:e})=>{let f=null,g=null,h=aI("string"==typeof a?a:a.name,d.schema);if(!h)return!1;"node"===h&&(f=U(a,d.schema)),"mark"===h&&(g=ae(a,d.schema));let i=!1;return c.selection.ranges.forEach(a=>{let h,j,k,l,m=a.$from.pos,n=a.$to.pos;c.selection.empty?d.doc.nodesBetween(m,n,(a,b)=>{f&&f===a.type&&(i=!0,k=Math.max(b,m),l=Math.min(b+a.nodeSize,n),h=b,j=a)}):d.doc.nodesBetween(m,n,(a,d)=>{d<m&&f&&f===a.type&&(i=!0,k=Math.max(d,m),l=Math.min(d+a.nodeSize,n),h=d,j=a),d>=m&&d<=n&&(f&&f===a.type&&(i=!0,e&&c.setNodeMarkup(d,void 0,{...a.attrs,...b})),g&&a.marks.length&&a.marks.forEach(f=>{if(g===f.type&&(i=!0,e)){let e=Math.max(d,m),h=Math.min(d+a.nodeSize,n);c.addMark(e,h,g.create({...f.attrs,...b}))}}))}),j&&(void 0!==h&&e&&c.setNodeMarkup(h,void 0,{...j.attrs,...b}),g&&j.marks.length&&j.marks.forEach(a=>{g===a.type&&e&&c.addMark(k,l,g.create({...a.attrs,...b}))}))}),i},bS=(a,b={})=>({state:c,dispatch:e})=>(function(a,b=null){return function(c,e){let{$from:f,$to:g}=c.selection,h=f.blockRange(g),i=h&&(0,d.oM)(h,a,b);return!!i&&(e&&e(c.tr.wrap(h,i).scrollIntoView()),!0)}})(U(a,c.schema),b)(c,e),bT=(a,b={})=>({state:c,dispatch:f})=>(function(a,b=null){return function(c,f){let{$from:g,$to:h}=c.selection,i=g.blockRange(h);if(!i)return!1;let j=f?c.tr:null;return!!function(a,b,c,f=null){let g=!1,h=b,i=b.$from.doc;if(b.depth>=2&&b.$from.node(b.depth-1).type.compatibleContent(c)&&0==b.startIndex){if(0==b.$from.index(b.depth-1))return!1;let a=i.resolve(b.start-2);h=new e.u$(a,a,b.depth),b.endIndex<b.parent.childCount&&(b=new e.u$(b.$from,i.resolve(b.$to.end(b.depth)),b.depth)),g=!0}let j=(0,d.oM)(h,c,f,b);return!!j&&(a&&function(a,b,c,f,g){let h=e.FK.empty;for(let a=c.length-1;a>=0;a--)h=e.FK.from(c[a].type.create(c[a].attrs,h));a.step(new d.Wg(b.start-2*!!f,b.end,b.start,b.end,new e.Ji(h,0,0),c.length,!0));let i=0;for(let a=0;a<c.length;a++)c[a].type==g&&(i=a+1);let j=c.length-i,k=b.start+c.length-2*!!f,l=b.parent;for(let c=b.startIndex,e=b.endIndex,f=!0;c<e;c++,f=!1)!f&&(0,d.zy)(a.doc,k,j)&&(a.split(k,j),k+=2*j),k+=l.child(c).nodeSize}(a,b,j,g,c),!0)}(j,i,a,b)&&(f&&f(j.scrollIntoView()),!0)}})(U(a,c.schema),b)(c,f),bU=class{constructor(){this.callbacks={}}on(a,b){return this.callbacks[a]||(this.callbacks[a]=[]),this.callbacks[a].push(b),this}emit(a,...b){let c=this.callbacks[a];return c&&c.forEach(a=>a.apply(this,b)),this}off(a,b){let c=this.callbacks[a];return c&&(b?this.callbacks[a]=c.filter(a=>a!==b):delete this.callbacks[a]),this}once(a,b){let c=(...d)=>{this.off(a,c),b.apply(this,d)};return this.on(a,c)}removeAllListeners(){this.callbacks={}}},bV=class{constructor(a){var b;this.find=a.find,this.handler=a.handler,this.undoable=null==(b=a.undoable)||b}};function bW(a){var b;let{editor:c,from:d,to:e,text:f,rules:g,plugin:h}=a,{view:i}=c;if(i.composing)return!1;let j=i.state.doc.resolve(d);if(j.parent.type.spec.code||(null==(b=j.nodeBefore||j.nodeAfter)?void 0:b.marks.find(a=>a.type.spec.code)))return!1;let k=!1,l=((a,b=500)=>{let c="",d=a.parentOffset;return a.parent.nodesBetween(Math.max(0,d-b),d,(a,b,e,f)=>{var g,h;let i=(null==(h=(g=a.type.spec).toText)?void 0:h.call(g,{node:a,pos:b,parent:e,index:f}))||a.textContent||"%leaf%";c+=a.isAtom&&!a.isText?i:i.slice(0,Math.max(0,d-b))}),c})(j)+f;return g.forEach(a=>{if(k)return;let b=((a,b)=>{if(_(b))return b.exec(a);let c=b(a);if(!c)return null;let d=[c.text];return d.index=c.index,d.input=a,d.data=c.data,c.replaceWith&&(c.text.includes(c.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),d.push(c.replaceWith)),d})(l,a.find);if(!b)return;let g=i.state.tr,j=K({state:i.state,transaction:g}),m={from:d-(b[0].length-f.length),to:e},{commands:n,chain:o,can:p}=new L({editor:c,state:j});null!==a.handler({state:j,range:m,match:b,commands:n,chain:o,can:p})&&g.steps.length&&(a.undoable&&g.setMeta(h,{transform:g,from:d,to:e,text:f}),i.dispatch(g),k=!0)}),k}function bX(a){return"Object"===Object.prototype.toString.call(a).slice(8,-1)&&a.constructor===Object&&Object.getPrototypeOf(a)===Object.prototype}var bY=class{constructor(a={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...a},this.name=this.config.name}get options(){return{...a1(aZ(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...a1(aZ(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(a={}){let b=this.extend({...this.config,addOptions:()=>(function a(b,c){let d={...b};return bX(b)&&bX(c)&&Object.keys(c).forEach(e=>{bX(c[e])&&bX(b[e])?d[e]=a(b[e],c[e]):d[e]=c[e]}),d})(this.options,a)});return b.name=this.name,b.parent=this.parent,b}extend(a={}){let b=new this.constructor({...this.config,...a});return b.parent=this,this.child=b,b.name="name"in a?a.name:b.parent.name,b}},bZ=class a extends bY{constructor(){super(...arguments),this.type="mark"}static create(b={}){return new a("function"==typeof b?b():b)}static handleExit({editor:a,mark:b}){let{tr:c}=a.state,d=a.state.selection.$from;if(d.pos===d.end()){let e=d.marks();if(!e.find(a=>(null==a?void 0:a.type.name)===b.name))return!1;let f=e.find(a=>(null==a?void 0:a.type.name)===b.name);return f&&c.removeStoredMark(f),c.insertText(" ",d.pos),a.view.dispatch(c),!0}return!1}configure(a){return super.configure(a)}extend(a){let b="function"==typeof a?a():a;return super.extend(b)}},b$=class{constructor(a){this.find=a.find,this.handler=a.handler}},b_=null,b0=class{constructor(a,b){this.splittableMarks=[],this.editor=b,this.baseExtensions=a,this.extensions=bb(a),this.schema=a9(this.extensions,b),this.setupExtensions()}get commands(){return this.extensions.reduce((a,b)=>{let c={name:b.name,options:b.options,storage:this.editor.extensionStorage[b.name],editor:this.editor,type:bk(b.name,this.schema)},d=aZ(b,"addCommands",c);return d?{...a,...d()}:a},{})}get plugins(){let{editor:a}=this;return ba([...this.extensions].reverse()).flatMap(b=>{let c={name:b.name,options:b.options,storage:this.editor.extensionStorage[b.name],editor:a,type:bk(b.name,this.schema)},d=[],g=aZ(b,"addKeyboardShortcuts",c),h={};if("mark"===b.type&&aZ(b,"exitable",c)&&(h.ArrowRight=()=>bZ.handleExit({editor:a,mark:b})),g){let b=Object.fromEntries(Object.entries(g()).map(([b,c])=>[b,()=>c({editor:a})]));h={...h,...b}}let i=(0,H.w)(h);d.push(i);let j=aZ(b,"addInputRules",c);if(bp(b,a.options.enableInputRules)&&j){let b=j();if(b&&b.length){let c=function(a){let{editor:b,rules:c}=a,d=new f.k_({state:{init:()=>null,apply(a,f,g){let h=a.getMeta(d);if(h)return h;let i=a.getMeta("applyInputRules");return i&&setTimeout(()=>{let{text:a}=i;"string"==typeof a||(a=a_(e.FK.from(a),g.schema));let{from:f}=i,h=f+a.length;bW({editor:b,from:f,to:h,text:a,rules:c,plugin:d})}),a.selectionSet||a.docChanged?null:f}},props:{handleTextInput:(a,e,f,g)=>bW({editor:b,from:e,to:f,text:g,rules:c,plugin:d}),handleDOMEvents:{compositionend:a=>(setTimeout(()=>{let{$cursor:e}=a.state.selection;e&&bW({editor:b,from:e.pos,to:e.pos,text:"",rules:c,plugin:d})}),!1)},handleKeyDown(a,e){if("Enter"!==e.key)return!1;let{$cursor:f}=a.state.selection;return!!f&&bW({editor:b,from:f.pos,to:f.pos,text:"\n",rules:c,plugin:d})}},isInputRules:!0});return d}({editor:a,rules:b}),g=Array.isArray(c)?c:[c];d.push(...g)}}let k=aZ(b,"addPasteRules",c);if(bp(b,a.options.enablePasteRules)&&k){let b=k();if(b&&b.length){let c=function(a){let b,{editor:c,rules:d}=a,g=null,h=!1,i=!1,j="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{b="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{b=null}let k=({state:a,from:d,to:e,rule:f,pasteEvt:g})=>{let h=a.tr;if(function(a){let{editor:b,state:c,from:d,to:e,rule:f,pasteEvent:g,dropEvent:h}=a,{commands:i,chain:j,can:k}=new L({editor:b,state:c}),l=[];return c.doc.nodesBetween(d,e,(a,b)=>{var m,n,o,p,q;if((null==(n=null==(m=a.type)?void 0:m.spec)?void 0:n.code)||!(a.isText||a.isTextblock||a.isInline))return;let r=null!=(q=null!=(p=null==(o=a.content)?void 0:o.size)?p:a.nodeSize)?q:0,s=Math.max(d,b),t=Math.min(e,b+r);s>=t||((a,b,c)=>{if(_(b))return[...a.matchAll(b)];let d=b(a,c);return d?d.map(b=>{let c=[b.text];return c.index=b.index,c.input=a,c.data=b.data,b.replaceWith&&(b.text.includes(b.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),c.push(b.replaceWith)),c}):[]})(a.isText?a.text||"":a.textBetween(s-b,t-b,void 0,""),f.find,g).forEach(a=>{if(void 0===a.index)return;let b=s+a.index+1,d=b+a[0].length,e={from:c.tr.mapping.map(b),to:c.tr.mapping.map(d)},m=f.handler({state:c,range:e,match:a,commands:i,chain:j,can:k,pasteEvent:g,dropEvent:h});l.push(m)})}),l.every(a=>null!==a)}({editor:c,state:K({state:a,transaction:h}),from:Math.max(d-1,0),to:e.b-1,rule:f,pasteEvent:g,dropEvent:b})&&h.steps.length){try{b="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{b=null}return j="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,h}};return d.map(a=>new f.k_({view(a){let b=b=>{var d;(g=(null==(d=a.dom.parentElement)?void 0:d.contains(b.target))?a.dom.parentElement:null)&&(b_=c)},d=()=>{b_&&(b_=null)};return window.addEventListener("dragstart",b),window.addEventListener("dragend",d),{destroy(){window.removeEventListener("dragstart",b),window.removeEventListener("dragend",d)}}},props:{handleDOMEvents:{drop:(a,c)=>{if(i=g===a.dom.parentElement,b=c,!i){let a=b_;(null==a?void 0:a.isEditable)&&setTimeout(()=>{let b=a.state.selection;b&&a.commands.deleteRange({from:b.from,to:b.to})},10)}return!1},paste:(a,b)=>{var c;let d=null==(c=b.clipboardData)?void 0:c.getData("text/html");return j=b,h=!!(null==d?void 0:d.includes("data-pm-slice")),!1}}},appendTransaction:(b,c,d)=>{let f=b[0],g="paste"===f.getMeta("uiEvent")&&!h,l="drop"===f.getMeta("uiEvent")&&!i,m=f.getMeta("applyPasteRules"),n=!!m;if(!g&&!l&&!n)return;if(n){let{text:b}=m;"string"==typeof b||(b=a_(e.FK.from(b),d.schema));let{from:c}=m,f=c+b.length;return k({rule:a,state:d,from:c,to:{b:f},pasteEvt:(a=>{var b;let c=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(b=c.clipboardData)||b.setData("text/html",a),c})(b)})}let o=c.doc.content.findDiffStart(d.doc.content),p=c.doc.content.findDiffEnd(d.doc.content);if("number"==typeof o&&p&&o!==p.b)return k({rule:a,state:d,from:o,to:p,pasteEvt:j})}}))}({editor:a,rules:b});d.push(...c)}}let l=aZ(b,"addProseMirrorPlugins",c);if(l){let a=l();d.push(...a)}return d})}get attributes(){return a3(this.extensions)}get nodeViews(){let{editor:a}=this,{nodeExtensions:b}=a2(this.extensions);return Object.fromEntries(b.filter(a=>!!aZ(a,"addNodeView")).map(b=>{let c=this.attributes.filter(a=>a.type===b.name),d={name:b.name,options:b.options,storage:this.editor.extensionStorage[b.name],editor:a,type:U(b.name,this.schema)},e=aZ(b,"addNodeView",d);if(!e)return[];let f=e();return f?[b.name,(d,e,g,h,i)=>{let j=a5(d,c);return f({node:d,view:e,getPos:g,decorations:h,innerDecorations:i,editor:a,extension:b,HTMLAttributes:j})}]:[]}))}dispatchTransaction(a){let{editor:b}=this;return ba([...this.extensions].reverse()).reduceRight((a,c)=>{let d={name:c.name,options:c.options,storage:this.editor.extensionStorage[c.name],editor:b,type:bk(c.name,this.schema)},e=aZ(c,"dispatchTransaction",d);return e?b=>{e.call(d,{transaction:b,next:a})}:a},a)}get markViews(){let{editor:a}=this,{markExtensions:b}=a2(this.extensions);return Object.fromEntries(b.filter(a=>!!aZ(a,"addMarkView")).map(b=>{let c=this.attributes.filter(a=>a.type===b.name),d={name:b.name,options:b.options,storage:this.editor.extensionStorage[b.name],editor:a,type:ae(b.name,this.schema)},e=aZ(b,"addMarkView",d);return e?[b.name,(d,f,g)=>{let h=a5(d,c);return e()({mark:d,view:f,inline:g,editor:a,extension:b,HTMLAttributes:h,updateAttributes:b=>{cw(d,a,b)}})}]:[]}))}setupExtensions(){let a=this.extensions;this.editor.extensionStorage=Object.fromEntries(a.map(a=>[a.name,a.storage])),a.forEach(a=>{var b;let c={name:a.name,options:a.options,storage:this.editor.extensionStorage[a.name],editor:this.editor,type:bk(a.name,this.schema)};"mark"===a.type&&(null==(b=a1(aZ(a,"keepOnSplit",c)))||b)&&this.splittableMarks.push(a.name);let d=aZ(a,"onBeforeCreate",c),e=aZ(a,"onCreate",c),f=aZ(a,"onUpdate",c),g=aZ(a,"onSelectionUpdate",c),h=aZ(a,"onTransaction",c),i=aZ(a,"onFocus",c),j=aZ(a,"onBlur",c),k=aZ(a,"onDestroy",c);d&&this.editor.on("beforeCreate",d),e&&this.editor.on("create",e),f&&this.editor.on("update",f),g&&this.editor.on("selectionUpdate",g),h&&this.editor.on("transaction",h),i&&this.editor.on("focus",i),j&&this.editor.on("blur",j),k&&this.editor.on("destroy",k)})}};b0.resolve=bb,b0.sort=ba,b0.flatten=a$,J({},{ClipboardTextSerializer:()=>b2,Commands:()=>b3,Delete:()=>b4,Drop:()=>b5,Editable:()=>b6,FocusEvents:()=>b8,Keymap:()=>b9,Paste:()=>ca,Tabindex:()=>cb,TextDirection:()=>cc,focusEventsPluginKey:()=>b7});var b1=class a extends bY{constructor(){super(...arguments),this.type="extension"}static create(b={}){return new a("function"==typeof b?b():b)}configure(a){return super.configure(a)}extend(a){let b="function"==typeof a?a():a;return super.extend(b)}},b2=b1.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new f.k_({key:new f.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:a}=this,{state:b,schema:c}=a,{doc:d,selection:e}=b,{ranges:f}=e,g=Math.min(...f.map(a=>a.$from.pos)),h=Math.max(...f.map(a=>a.$to.pos)),i=bf(c);return bd(d,{from:g,to:h},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:i})}}})]}}),b3=b1.create({name:"commands",addCommands:()=>({...M})}),b4=b1.create({name:"delete",onUpdate({transaction:a,appendedTransactions:b}){var c,e,f;let g=()=>{var c,e,f,g;if(null!=(g=null==(f=null==(e=null==(c=this.editor.options.coreExtensionOptions)?void 0:c.delete)?void 0:e.filterTransaction)?void 0:f.call(e,a))?g:a.getMeta("y-sync$"))return;let h=aV(a.before,[a,...b]);bh(h).forEach(b=>{h.mapping.mapResult(b.oldRange.from).deletedAfter&&h.mapping.mapResult(b.oldRange.to).deletedBefore&&h.before.nodesBetween(b.oldRange.from,b.oldRange.to,(c,d)=>{let e=d+c.nodeSize-2,f=b.oldRange.from<=d&&e<=b.oldRange.to;this.editor.emit("delete",{type:"node",node:c,from:d,to:e,newFrom:h.mapping.map(d),newTo:h.mapping.map(e),deletedRange:b.oldRange,newRange:b.newRange,partial:!f,editor:this.editor,transaction:a,combinedTransform:h})})});let i=h.mapping;h.steps.forEach((b,c)=>{var e,f;if(b instanceof d.Ys){let d=i.slice(c).map(b.from,-1),g=i.slice(c).map(b.to),j=i.invert().map(d,-1),k=i.invert().map(g),l=null==(e=h.doc.nodeAt(d-1))?void 0:e.marks.some(a=>a.eq(b.mark)),m=null==(f=h.doc.nodeAt(g))?void 0:f.marks.some(a=>a.eq(b.mark));this.editor.emit("delete",{type:"mark",mark:b.mark,from:b.from,to:b.to,deletedRange:{from:j,to:k},newRange:{from:d,to:g},partial:!!(m||l),editor:this.editor,transaction:a,combinedTransform:h})}})};null==(f=null==(e=null==(c=this.editor.options.coreExtensionOptions)?void 0:c.delete)?void 0:e.async)||f?setTimeout(g,0):g()}}),b5=b1.create({name:"drop",addProseMirrorPlugins(){return[new f.k_({key:new f.hs("tiptapDrop"),props:{handleDrop:(a,b,c,d)=>{this.editor.emit("drop",{editor:this.editor,event:b,slice:c,moved:d})}}})]}}),b6=b1.create({name:"editable",addProseMirrorPlugins(){return[new f.k_({key:new f.hs("editable"),props:{editable:()=>this.editor.options.editable}})]}}),b7=new f.hs("focusEvents"),b8=b1.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:a}=this;return[new f.k_({key:b7,props:{handleDOMEvents:{focus:(b,c)=>{a.isFocused=!0;let d=a.state.tr.setMeta("focus",{event:c}).setMeta("addToHistory",!1);return b.dispatch(d),!1},blur:(b,c)=>{a.isFocused=!1;let d=a.state.tr.setMeta("blur",{event:c}).setMeta("addToHistory",!1);return b.dispatch(d),!1}}}})]}}),b9=b1.create({name:"keymap",addKeyboardShortcuts(){let a=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:b})=>{let{selection:c,doc:d}=b,{empty:e,$anchor:g}=c,{pos:h,parent:i}=g,j=g.parent.isTextblock&&h>0?b.doc.resolve(h-1):g,k=j.parent.type.spec.isolating,l=g.pos-g.parentOffset,m=k&&1===j.parent.childCount?l===g.pos:f.LN.atStart(d).from===h;return!!e&&!!i.type.isTextblock&&!i.textContent.length&&!!m&&(!m||"paragraph"!==g.parent.type.name)&&a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),b=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),c={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:a,"Mod-Backspace":a,"Shift-Backspace":a,Delete:b,"Mod-Delete":b,"Mod-a":()=>this.editor.commands.selectAll()},d={...c},e={...c,"Ctrl-h":a,"Alt-Backspace":a,"Ctrl-d":b,"Ctrl-Alt-Backspace":b,"Alt-Delete":b,"Alt-d":b,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return al()||aB()?e:d},addProseMirrorPlugins(){return[new f.k_({key:new f.hs("clearDocument"),appendTransaction:(a,b,c)=>{if(a.some(a=>a.getMeta("composition")))return;let d=a.some(a=>a.docChanged)&&!b.doc.eq(c.doc),e=a.some(a=>a.getMeta("preventClearDocument"));if(!d||e)return;let{empty:g,from:h,to:i}=b.selection,j=f.LN.atStart(b.doc).from,k=f.LN.atEnd(b.doc).to;if(g||h!==j||i!==k||!br(c.doc))return;let l=c.tr,m=K({state:c,transaction:l}),{commands:n}=new L({editor:this.editor,state:m});if(n.clearNodes(),l.steps.length)return l}})]}}),ca=b1.create({name:"paste",addProseMirrorPlugins(){return[new f.k_({key:new f.hs("tiptapPaste"),props:{handlePaste:(a,b,c)=>{this.editor.emit("paste",{editor:this.editor,event:b,slice:c})}}})]}}),cb=b1.create({name:"tabindex",addProseMirrorPlugins(){return[new f.k_({key:new f.hs("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),cc=b1.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:a}=a2(this.extensions);return[{types:a.filter(a=>"text"!==a.name).map(a=>a.name),attributes:{dir:{default:this.options.direction,parseHTML:a=>{let b=a.getAttribute("dir");return b&&("ltr"===b||"rtl"===b||"auto"===b)?b:this.options.direction},renderHTML:a=>a.dir?{dir:a.dir}:{}}}}]},addProseMirrorPlugins(){return[new f.k_({key:new f.hs("textDirection"),props:{attributes:()=>{let a=this.options.direction;return a?{dir:a}:{}}}})]}}),cd=class a{constructor(a,b,c=!1,d=null){this.currentNode=null,this.actualDepth=null,this.isBlock=c,this.resolvedPos=a,this.editor=b,this.currentNode=d}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var a;return null!=(a=this.actualDepth)?a:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(a){let b=this.from,c=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);b=this.from+1,c=this.to-1}this.editor.commands.insertContentAt({from:b,to:c},a)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(0===this.depth)return null;let b=this.resolvedPos.start(this.resolvedPos.depth-1);return new a(this.resolvedPos.doc.resolve(b),this.editor)}get before(){let b=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return b.depth!==this.depth&&(b=this.resolvedPos.doc.resolve(this.from-3)),new a(b,this.editor)}get after(){let b=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return b.depth!==this.depth&&(b=this.resolvedPos.doc.resolve(this.to+3)),new a(b,this.editor)}get children(){let b=[];return this.node.content.forEach((c,d)=>{let e=c.isBlock&&!c.isTextblock,f=c.isAtom&&!c.isText,g=c.isInline,h=this.pos+d+ +!f;if(h<0||h>this.resolvedPos.doc.nodeSize-2)return;let i=this.resolvedPos.doc.resolve(h);if(!e&&!g&&i.depth<=this.depth)return;let j=new a(i,this.editor,e,e||g?c:null);e&&(j.actualDepth=this.depth+1),b.push(j)}),b}get firstChild(){return this.children[0]||null}get lastChild(){let a=this.children;return a[a.length-1]||null}closest(a,b={}){let c=null,d=this.parent;for(;d&&!c;){if(d.node.type.name===a)if(Object.keys(b).length>0){let a=d.node.attrs,c=Object.keys(b);for(let d=0;d<c.length;d+=1){let e=c[d];if(a[e]!==b[e])break}}else c=d;d=d.parent}return c}querySelector(a,b={}){return this.querySelectorAll(a,b,!0)[0]||null}querySelectorAll(a,b={},c=!1){let d=[];if(!this.children||0===this.children.length)return d;let e=Object.keys(b);return this.children.forEach(f=>{(!c||!(d.length>0))&&(f.node.type.name===a&&e.every(a=>b[a]===f.node.attrs[a])&&d.push(f),c&&d.length>0||(d=d.concat(f.querySelectorAll(a,b,c))))}),d}setAttribute(a){let{tr:b}=this.editor.state;b.setNodeMarkup(this.from,void 0,{...this.node.attrs,...a}),this.editor.view.dispatch(b)}},ce=`.ProseMirror {
|
|
264
|
+
`),()=>{s.contains(r)&&s.removeChild(r)}},[b]),(0,d.jsx)(m,{isPresent:b,childRef:j,sizeRef:n,pop:h,children:!1===h?a:e.cloneElement(a,{ref:p})})}let o=({children:a,initial:b,isPresent:c,onExitComplete:f,custom:h,presenceAffectsLayout:j,mode:k,anchorX:l,anchorY:m,root:o})=>{let q=(0,g.M)(p),r=(0,e.useId)(),s=!0,t=(0,e.useMemo)(()=>(s=!1,{id:r,initial:b,isPresent:c,custom:h,onExitComplete:a=>{for(let b of(q.set(a,!0),q.values()))if(!b)return;f&&f()},register:a=>(q.set(a,!1),()=>q.delete(a))}),[c,q,f]);return j&&s&&(t={...t}),(0,e.useMemo)(()=>{q.forEach((a,b)=>q.set(b,!1))},[c]),e.useEffect(()=>{c||q.size||!f||f()},[c]),a=(0,d.jsx)(n,{pop:"popLayout"===k,isPresent:c,anchorX:l,anchorY:m,root:o,children:a}),(0,d.jsx)(i.t.Provider,{value:t,children:a})};function p(){return new Map}var q=c(15086);let r=a=>a.key||"";function s(a){let b=[];return e.Children.forEach(a,a=>{(0,e.isValidElement)(a)&&b.push(a)}),b}let t=({children:a,custom:b,initial:c=!0,onExitComplete:i,presenceAffectsLayout:j=!0,mode:k="sync",propagate:l=!1,anchorX:m="left",anchorY:n="top",root:p})=>{let[t,u]=(0,q.xQ)(l),v=(0,e.useMemo)(()=>s(a),[a]),w=l&&!t?[]:v.map(r),x=(0,e.useRef)(!0),y=(0,e.useRef)(v),z=(0,g.M)(()=>new Map),A=(0,e.useRef)(new Set),[B,C]=(0,e.useState)(v),[D,E]=(0,e.useState)(v);(0,h.E)(()=>{x.current=!1,y.current=v;for(let a=0;a<D.length;a++){let b=r(D[a]);w.includes(b)?(z.delete(b),A.current.delete(b)):!0!==z.get(b)&&z.set(b,!1)}},[D,w.length,w.join("-")]);let F=[];if(v!==B){let a=[...v];for(let b=0;b<D.length;b++){let c=D[b],d=r(c);w.includes(d)||(a.splice(b,0,c),F.push(c))}return"wait"===k&&F.length&&(a=F),E(s(a)),C(v),null}let{forceRender:G}=(0,e.useContext)(f.L);return(0,d.jsx)(d.Fragment,{children:D.map(a=>{let e=r(a),f=(!l||!!t)&&(v===D||w.includes(e));return(0,d.jsx)(o,{isPresent:f,initial:(!x.current||!!c)&&void 0,custom:b,presenceAffectsLayout:j,mode:k,root:p,onExitComplete:f?void 0:()=>{if(A.current.has(e)||(A.current.add(e),!z.has(e)))return;z.set(e,!0);let a=!0;z.forEach(b=>{b||(a=!1)}),a&&(G?.(),E(y.current),l&&u?.(),i&&i())},anchorX:m,anchorY:n,children:a},e)})})}},656159:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isDeepKey=function(a){switch(typeof a){case"number":case"symbol":return!1;case"string":return a.includes(".")||a.includes("[")||a.includes("]")}}},658422:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(452171),e=c(266196),f=c(606461);b.cloneDeepWith=function(a,b){return d.cloneDeepWith(a,(c,g,h,i)=>{let j=b?.(c,g,h,i);if(void 0!==j)return j;if("object"==typeof a){if(e.getTag(a)===f.objectTag&&"function"!=typeof a.constructor){let b={};return i.set(a,b),d.copyProperties(b,a,h,i),b}switch(Object.prototype.toString.call(a)){case f.numberTag:case f.stringTag:case f.booleanTag:{let b=new a.constructor(a?.valueOf());return d.copyProperties(b,a),b}case f.argumentsTag:{let b={};return d.copyProperties(b,a),b.length=a.length,b[Symbol.iterator]=a[Symbol.iterator],b}default:return}}})}},658556:(a,b,c)=>{"use strict";function d(a,b){let c=String(a);if("string"!=typeof b)throw TypeError("Expected character");let d=0,e=c.indexOf(b);for(;-1!==e;)d++,e=c.indexOf(b,e+b.length);return d}c.d(b,{A:()=>aI});var e=c(972421),f=c(145214),g=c(423721),h=c(348445);let i="phrasing",j=["autolink","link","image","label"];function k(a){this.enter({type:"link",title:null,url:"",children:[]},a)}function l(a){this.config.enter.autolinkProtocol.call(this,a)}function m(a){this.config.exit.autolinkProtocol.call(this,a)}function n(a){this.config.exit.data.call(this,a);let b=this.stack[this.stack.length-1];(0,e.ok)("link"===b.type),b.url="http://"+this.sliceSerialize(a)}function o(a){this.config.exit.autolinkEmail.call(this,a)}function p(a){this.exit(a)}function q(a){!function(a,b,c){let d=(0,h.C)((c||{}).ignore||[]),e=function(a){let b=[];if(!Array.isArray(a))throw TypeError("Expected find and replace tuple or list of tuples");let c=!a[0]||Array.isArray(a[0])?a:[a],d=-1;for(;++d<c.length;){var e;let a=c[d];b.push(["string"==typeof(e=a[0])?RegExp(function(a){if("string"!=typeof a)throw TypeError("Expected a string");return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e,function(a){return"function"==typeof a?a:function(){return a}}(a[1])])}return b}(b),f=-1;for(;++f<e.length;)(0,g.VG)(a,"text",i);function i(a,b){let c,g=-1;for(;++g<b.length;){let a=b[g],e=c?c.children:void 0;if(d(a,e?e.indexOf(a):void 0,c))return;c=a}if(c)return function(a,b){let c=b[b.length-1],d=e[f][0],g=e[f][1],h=0,i=c.children.indexOf(a),j=!1,k=[];d.lastIndex=0;let l=d.exec(a.value);for(;l;){let c=l.index,e={index:l.index,input:l.input,stack:[...b,a]},f=g(...l,e);if("string"==typeof f&&(f=f.length>0?{type:"text",value:f}:void 0),!1===f?d.lastIndex=c+1:(h!==c&&k.push({type:"text",value:a.value.slice(h,c)}),Array.isArray(f)?k.push(...f):f&&k.push(f),h=c+l[0].length,j=!0),!d.global)break;l=d.exec(a.value)}return j?(h<a.value.length&&k.push({type:"text",value:a.value.slice(h)}),c.children.splice(i,1,...k)):k=[a],i+k.length}(a,b)}}(a,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,r],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,s]],{ignore:["link","linkReference"]})}function r(a,b,c,e,f){let g="";if(!t(f)||(/^w/i.test(b)&&(c=b+c,b="",g="http://"),!function(a){let b=a.split(".");return!(b.length<2||b[b.length-1]&&(/_/.test(b[b.length-1])||!/[a-zA-Z\d]/.test(b[b.length-1]))||b[b.length-2]&&(/_/.test(b[b.length-2])||!/[a-zA-Z\d]/.test(b[b.length-2])))}(c)))return!1;let h=function(a){let b=/[!"&'),.:;<>?\]}]+$/.exec(a);if(!b)return[a,void 0];a=a.slice(0,b.index);let c=b[0],e=c.indexOf(")"),f=d(a,"("),g=d(a,")");for(;-1!==e&&f>g;)a+=c.slice(0,e+1),e=(c=c.slice(e+1)).indexOf(")"),g++;return[a,c]}(c+e);if(!h[0])return!1;let i={type:"link",title:null,url:g+b+h[0],children:[{type:"text",value:b+h[0]}]};return h[1]?[i,{type:"text",value:h[1]}]:i}function s(a,b,c,d){return!(!t(d,!0)||/[-\d_]$/.test(c))&&{type:"link",title:null,url:"mailto:"+b+"@"+c,children:[{type:"text",value:b+"@"+c}]}}function t(a,b){let c=a.input.charCodeAt(a.index-1);return(0===a.index||(0,f.Ny)(c)||(0,f.es)(c))&&(!b||47!==c)}var u=c(732347);function v(){this.buffer()}function w(a){this.enter({type:"footnoteReference",identifier:"",label:""},a)}function x(){this.buffer()}function y(a){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},a)}function z(a){let b=this.resume(),c=this.stack[this.stack.length-1];(0,e.ok)("footnoteReference"===c.type),c.identifier=(0,u.B)(this.sliceSerialize(a)).toLowerCase(),c.label=b}function A(a){this.exit(a)}function B(a){let b=this.resume(),c=this.stack[this.stack.length-1];(0,e.ok)("footnoteDefinition"===c.type),c.identifier=(0,u.B)(this.sliceSerialize(a)).toLowerCase(),c.label=b}function C(a){this.exit(a)}function D(a,b,c,d){let e=c.createTracker(d),f=e.move("[^"),g=c.enter("footnoteReference"),h=c.enter("reference");return f+=e.move(c.safe(c.associationId(a),{after:"]",before:f})),h(),g(),f+=e.move("]")}function E(a,b,c){return 0===b?a:F(a,b,c)}function F(a,b,c){return(c?"":" ")+a}D.peek=function(){return"["};let G=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function H(a){this.enter({type:"delete",children:[]},a)}function I(a){this.exit(a)}function J(a,b,c,d){let e=c.createTracker(d),f=c.enter("strikethrough"),g=e.move("~~");return g+=c.containerPhrasing(a,{...e.current(),before:g,after:"~"}),g+=e.move("~~"),f(),g}function K(a){return a.length}function L(a){let b="string"==typeof a?a.codePointAt(0):0;return 67===b||99===b?99:76===b||108===b?108:114*(82===b||114===b)}J.peek=function(){return"~"};var M=c(294401);c(320608);c(210164);function N(a,b,c){let d=a.value||"",e="`",f=-1;for(;RegExp("(^|[^`])"+e+"([^`]|$)").test(d);)e+="`";for(/[^ \r\n]/.test(d)&&(/^[ \r\n]/.test(d)&&/[ \r\n]$/.test(d)||/^`|`$/.test(d))&&(d=" "+d+" ");++f<c.unsafe.length;){let a,b=c.unsafe[f],e=c.compilePattern(b);if(b.atBreak)for(;a=e.exec(d);){let b=a.index;10===d.charCodeAt(b)&&13===d.charCodeAt(b-1)&&b--,d=d.slice(0,b)+" "+d.slice(a.index+1)}}return e+d+e}N.peek=function(){return"`"};(0,h.C)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let O={inlineCode:N,listItem:function(a,b,c,d){let e=function(a){let b=a.options.listItemIndent||"one";if("tab"!==b&&"one"!==b&&"mixed"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return b}(c),f=c.bulletCurrent||function(a){let b=a.options.bullet||"*";if("*"!==b&&"+"!==b&&"-"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.bullet`, expected `*`, `+`, or `-`");return b}(c);b&&"list"===b.type&&b.ordered&&(f=("number"==typeof b.start&&b.start>-1?b.start:1)+(!1===c.options.incrementListMarker?0:b.children.indexOf(a))+f);let g=f.length+1;("tab"===e||"mixed"===e&&(b&&"list"===b.type&&b.spread||a.spread))&&(g=4*Math.ceil(g/4));let h=c.createTracker(d);h.move(f+" ".repeat(g-f.length)),h.shift(g);let i=c.enter("listItem"),j=c.indentLines(c.containerFlow(a,h.current()),function(a,b,c){return b?(c?"":" ".repeat(g))+a:(c?f:f+" ".repeat(g-f.length))+a});return i(),j}};function P(a){let b=a._align;(0,e.ok)(b,"expected `_align` on table"),this.enter({type:"table",align:b.map(function(a){return"none"===a?null:a}),children:[]},a),this.data.inTable=!0}function Q(a){this.exit(a),this.data.inTable=void 0}function R(a){this.enter({type:"tableRow",children:[]},a)}function S(a){this.exit(a)}function T(a){this.enter({type:"tableCell",children:[]},a)}function U(a){let b=this.resume();this.data.inTable&&(b=b.replace(/\\([\\|])/g,V));let c=this.stack[this.stack.length-1];(0,e.ok)("inlineCode"===c.type),c.value=b,this.exit(a)}function V(a,b){return"|"===b?b:a}function W(a){let b=this.stack[this.stack.length-2];(0,e.ok)("listItem"===b.type),b.checked="taskListCheckValueChecked"===a.type}function X(a){let b=this.stack[this.stack.length-2];if(b&&"listItem"===b.type&&"boolean"==typeof b.checked){let a=this.stack[this.stack.length-1];(0,e.ok)("paragraph"===a.type);let c=a.children[0];if(c&&"text"===c.type){let d,e=b.children,f=-1;for(;++f<e.length;){let a=e[f];if("paragraph"===a.type){d=a;break}}d===a&&(c.value=c.value.slice(1),0===c.value.length?a.children.shift():a.position&&c.position&&"number"==typeof c.position.start.offset&&(c.position.start.column++,c.position.start.offset++,a.position.start=Object.assign({},c.position.start)))}}this.exit(a)}function Y(a,b,c,d){let e=a.children[0],f="boolean"==typeof a.checked&&e&&"paragraph"===e.type,g="["+(a.checked?"x":" ")+"] ",h=c.createTracker(d);f&&h.move(g);let i=O.listItem(a,b,c,{...d,...h.current()});return f&&(i=i.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(a){return a+g})),i}var Z=c(161693);let _={tokenize:function(a,b,c){let d=0;return function b(f){return(87===f||119===f)&&d<3?(d++,a.consume(f),b):46===f&&3===d?(a.consume(f),e):c(f)};function e(a){return null===a?c(a):b(a)}},partial:!0},aa={tokenize:function(a,b,c){let d,e,g;return h;function h(b){return 46===b||95===b?a.check(ac,j,i)(b):null===b||(0,f.Ee)(b)||(0,f.Ny)(b)||45!==b&&(0,f.es)(b)?j(b):(g=!0,a.consume(b),h)}function i(b){return 95===b?d=!0:(e=d,d=void 0),a.consume(b),h}function j(a){return e||d||!g?c(a):b(a)}},partial:!0},ab={tokenize:function(a,b){let c=0,d=0;return e;function e(h){return 40===h?(c++,a.consume(h),e):41===h&&d<c?g(h):33===h||34===h||38===h||39===h||41===h||42===h||44===h||46===h||58===h||59===h||60===h||63===h||93===h||95===h||126===h?a.check(ac,b,g)(h):null===h||(0,f.Ee)(h)||(0,f.Ny)(h)?b(h):(a.consume(h),e)}function g(b){return 41===b&&d++,a.consume(b),e}},partial:!0},ac={tokenize:function(a,b,c){return d;function d(h){return 33===h||34===h||39===h||41===h||42===h||44===h||46===h||58===h||59===h||63===h||95===h||126===h?(a.consume(h),d):38===h?(a.consume(h),g):93===h?(a.consume(h),e):60===h||null===h||(0,f.Ee)(h)||(0,f.Ny)(h)?b(h):c(h)}function e(a){return null===a||40===a||91===a||(0,f.Ee)(a)||(0,f.Ny)(a)?b(a):d(a)}function g(b){return(0,f.CW)(b)?function b(e){return 59===e?(a.consume(e),d):(0,f.CW)(e)?(a.consume(e),b):c(e)}(b):c(b)}},partial:!0},ad={tokenize:function(a,b,c){return function(b){return a.consume(b),d};function d(a){return(0,f.lV)(a)?c(a):b(a)}},partial:!0},ae={name:"wwwAutolink",tokenize:function(a,b,c){let d=this;return function(b){return 87!==b&&119!==b||!aj.call(d,d.previous)||an(d.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkWww"),a.check(_,a.attempt(aa,a.attempt(ab,e),c),c)(b))};function e(c){return a.exit("literalAutolinkWww"),a.exit("literalAutolink"),b(c)}},previous:aj},af={name:"protocolAutolink",tokenize:function(a,b,c){let d=this,e="",g=!1;return function(b){return(72===b||104===b)&&ak.call(d,d.previous)&&!an(d.events)?(a.enter("literalAutolink"),a.enter("literalAutolinkHttp"),e+=String.fromCodePoint(b),a.consume(b),h):c(b)};function h(b){if((0,f.CW)(b)&&e.length<5)return e+=String.fromCodePoint(b),a.consume(b),h;if(58===b){let c=e.toLowerCase();if("http"===c||"https"===c)return a.consume(b),i}return c(b)}function i(b){return 47===b?(a.consume(b),g)?j:(g=!0,i):c(b)}function j(b){return null===b||(0,f.JQ)(b)||(0,f.Ee)(b)||(0,f.Ny)(b)||(0,f.es)(b)?c(b):a.attempt(aa,a.attempt(ab,k),c)(b)}function k(c){return a.exit("literalAutolinkHttp"),a.exit("literalAutolink"),b(c)}},previous:ak},ag={name:"emailAutolink",tokenize:function(a,b,c){let d,e,g=this;return function(b){return!am(b)||!al.call(g,g.previous)||an(g.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkEmail"),function b(d){return am(d)?(a.consume(d),b):64===d?(a.consume(d),h):c(d)}(b))};function h(b){return 46===b?a.check(ad,j,i)(b):45===b||95===b||(0,f.lV)(b)?(e=!0,a.consume(b),h):j(b)}function i(b){return a.consume(b),d=!0,h}function j(h){return e&&d&&(0,f.CW)(g.previous)?(a.exit("literalAutolinkEmail"),a.exit("literalAutolink"),b(h)):c(h)}},previous:al},ah={},ai=48;for(;ai<123;)ah[ai]=ag,58==++ai?ai=65:91===ai&&(ai=97);function aj(a){return null===a||40===a||42===a||95===a||91===a||93===a||126===a||(0,f.Ee)(a)}function ak(a){return!(0,f.CW)(a)}function al(a){return!(47===a||am(a))}function am(a){return 43===a||45===a||46===a||95===a||(0,f.lV)(a)}function an(a){let b=a.length,c=!1;for(;b--;){let d=a[b][1];if(("labelLink"===d.type||"labelImage"===d.type)&&!d._balanced){c=!0;break}if(d._gfmAutolinkLiteralWalkedInto){c=!1;break}}return a.length>0&&!c&&(a[a.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),c}ah[43]=ag,ah[45]=ag,ah[46]=ag,ah[95]=ag,ah[72]=[ag,af],ah[104]=[ag,af],ah[87]=[ag,ae],ah[119]=[ag,ae];var ao=c(360478),ap=c(621405);let aq={tokenize:function(a,b,c){let d=this;return(0,ap.N)(a,function(a){let e=d.events[d.events.length-1];return e&&"gfmFootnoteDefinitionIndent"===e[1].type&&4===e[2].sliceSerialize(e[1],!0).length?b(a):c(a)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function ar(a,b,c){let d,e=this,f=e.events.length,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]);for(;f--;){let a=e.events[f][1];if("labelImage"===a.type){d=a;break}if("gfmFootnoteCall"===a.type||"labelLink"===a.type||"label"===a.type||"image"===a.type||"link"===a.type)break}return function(f){if(!d||!d._balanced)return c(f);let h=(0,u.B)(e.sliceSerialize({start:d.end,end:e.now()}));return 94===h.codePointAt(0)&&g.includes(h.slice(1))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(f),a.exit("gfmFootnoteCallLabelMarker"),b(f)):c(f)}}function as(a,b){let c=a.length;for(;c--;)if("labelImage"===a[c][1].type&&"enter"===a[c][0]){a[c][1];break}a[c+1][1].type="data",a[c+3][1].type="gfmFootnoteCallLabelMarker";let d={type:"gfmFootnoteCall",start:Object.assign({},a[c+3][1].start),end:Object.assign({},a[a.length-1][1].end)},e={type:"gfmFootnoteCallMarker",start:Object.assign({},a[c+3][1].end),end:Object.assign({},a[c+3][1].end)};e.end.column++,e.end.offset++,e.end._bufferIndex++;let f={type:"gfmFootnoteCallString",start:Object.assign({},e.end),end:Object.assign({},a[a.length-1][1].start)},g={type:"chunkString",contentType:"string",start:Object.assign({},f.start),end:Object.assign({},f.end)},h=[a[c+1],a[c+2],["enter",d,b],a[c+3],a[c+4],["enter",e,b],["exit",e,b],["enter",f,b],["enter",g,b],["exit",g,b],["exit",f,b],a[a.length-2],a[a.length-1],["exit",d,b]];return a.splice(c,a.length-c+1,...h),a}function at(a,b,c){let d,e=this,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]),h=0;return function(b){return a.enter("gfmFootnoteCall"),a.enter("gfmFootnoteCallLabelMarker"),a.consume(b),a.exit("gfmFootnoteCallLabelMarker"),i};function i(b){return 94!==b?c(b):(a.enter("gfmFootnoteCallMarker"),a.consume(b),a.exit("gfmFootnoteCallMarker"),a.enter("gfmFootnoteCallString"),a.enter("chunkString").contentType="string",j)}function j(i){if(h>999||93===i&&!d||null===i||91===i||(0,f.Ee)(i))return c(i);if(93===i){a.exit("chunkString");let d=a.exit("gfmFootnoteCallString");return g.includes((0,u.B)(e.sliceSerialize(d)))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(i),a.exit("gfmFootnoteCallLabelMarker"),a.exit("gfmFootnoteCall"),b):c(i)}return(0,f.Ee)(i)||(d=!0),h++,a.consume(i),92===i?k:j}function k(b){return 91===b||92===b||93===b?(a.consume(b),h++,j):j(b)}}function au(a,b,c){let d,e,g=this,h=g.parser.gfmFootnotes||(g.parser.gfmFootnotes=[]),i=0;return function(b){return a.enter("gfmFootnoteDefinition")._container=!0,a.enter("gfmFootnoteDefinitionLabel"),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),j};function j(b){return 94===b?(a.enter("gfmFootnoteDefinitionMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionMarker"),a.enter("gfmFootnoteDefinitionLabelString"),a.enter("chunkString").contentType="string",k):c(b)}function k(b){if(i>999||93===b&&!e||null===b||91===b||(0,f.Ee)(b))return c(b);if(93===b){a.exit("chunkString");let c=a.exit("gfmFootnoteDefinitionLabelString");return d=(0,u.B)(g.sliceSerialize(c)),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),a.exit("gfmFootnoteDefinitionLabel"),m}return(0,f.Ee)(b)||(e=!0),i++,a.consume(b),92===b?l:k}function l(b){return 91===b||92===b||93===b?(a.consume(b),i++,k):k(b)}function m(b){return 58===b?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),h.includes(d)||h.push(d),(0,ap.N)(a,n,"gfmFootnoteDefinitionWhitespace")):c(b)}function n(a){return b(a)}}function av(a,b,c){return a.check(ao.B,b,a.attempt(aq,b,c))}function aw(a){a.exit("gfmFootnoteDefinition")}var ax=c(962349),ay=c(598525);class az{constructor(){this.map=[]}add(a,b,c){!function(a,b,c,d){let e=0;if(0!==c||0!==d.length){for(;e<a.map.length;){if(a.map[e][0]===b){a.map[e][1]+=c,a.map[e][2].push(...d);return}e+=1}a.map.push([b,c,d])}}(this,a,b,c)}consume(a){if(this.map.sort(function(a,b){return a[0]-b[0]}),0===this.map.length)return;let b=this.map.length,c=[];for(;b>0;)b-=1,c.push(a.slice(this.map[b][0]+this.map[b][1]),this.map[b][2]),a.length=this.map[b][0];c.push(a.slice()),a.length=0;let d=c.pop();for(;d;){for(let b of d)a.push(b);d=c.pop()}this.map.length=0}}function aA(a,b,c){let d,e=this,g=0,h=0;return function(a){let b=e.events.length-1;for(;b>-1;){let a=e.events[b][1].type;if("lineEnding"===a||"linePrefix"===a)b--;else break}let d=b>-1?e.events[b][1].type:null,f="tableHead"===d||"tableRow"===d?t:i;return f===t&&e.parser.lazy[e.now().line]?c(a):f(a)};function i(b){var c;return a.enter("tableHead"),a.enter("tableRow"),124===(c=b)||(d=!0,h+=1),j(c)}function j(b){return null===b?c(b):(0,f.HP)(b)?h>1?(h=0,e.interrupt=!0,a.exit("tableRow"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),m):c(b):(0,f.On)(b)?(0,ap.N)(a,j,"whitespace")(b):(h+=1,d&&(d=!1,g+=1),124===b)?(a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),d=!0,j):(a.enter("data"),k(b))}function k(b){return null===b||124===b||(0,f.Ee)(b)?(a.exit("data"),j(b)):(a.consume(b),92===b?l:k)}function l(b){return 92===b||124===b?(a.consume(b),k):k(b)}function m(b){return(e.interrupt=!1,e.parser.lazy[e.now().line])?c(b):(a.enter("tableDelimiterRow"),d=!1,(0,f.On)(b))?(0,ap.N)(a,n,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):n(b)}function n(b){return 45===b||58===b?p(b):124===b?(d=!0,a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),o):c(b)}function o(b){return(0,f.On)(b)?(0,ap.N)(a,p,"whitespace")(b):p(b)}function p(b){return 58===b?(h+=1,d=!0,a.enter("tableDelimiterMarker"),a.consume(b),a.exit("tableDelimiterMarker"),q):45===b?(h+=1,q(b)):null===b||(0,f.HP)(b)?s(b):c(b)}function q(b){return 45===b?(a.enter("tableDelimiterFiller"),function b(c){return 45===c?(a.consume(c),b):58===c?(d=!0,a.exit("tableDelimiterFiller"),a.enter("tableDelimiterMarker"),a.consume(c),a.exit("tableDelimiterMarker"),r):(a.exit("tableDelimiterFiller"),r(c))}(b)):c(b)}function r(b){return(0,f.On)(b)?(0,ap.N)(a,s,"whitespace")(b):s(b)}function s(e){if(124===e)return n(e);if(null===e||(0,f.HP)(e))return d&&g===h?(a.exit("tableDelimiterRow"),a.exit("tableHead"),b(e)):c(e);return c(e)}function t(b){return a.enter("tableRow"),u(b)}function u(c){return 124===c?(a.enter("tableCellDivider"),a.consume(c),a.exit("tableCellDivider"),u):null===c||(0,f.HP)(c)?(a.exit("tableRow"),b(c)):(0,f.On)(c)?(0,ap.N)(a,u,"whitespace")(c):(a.enter("data"),v(c))}function v(b){return null===b||124===b||(0,f.Ee)(b)?(a.exit("data"),u(b)):(a.consume(b),92===b?w:v)}function w(b){return 92===b||124===b?(a.consume(b),v):v(b)}}function aB(a,b){let c,d,e,f=-1,g=!0,h=0,i=[0,0,0,0],j=[0,0,0,0],k=!1,l=0,m=new az;for(;++f<a.length;){let n=a[f],o=n[1];"enter"===n[0]?"tableHead"===o.type?(k=!1,0!==l&&(aD(m,b,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",c,b]])):"tableRow"===o.type||"tableDelimiterRow"===o.type?(g=!0,e=void 0,i=[0,0,0,0],j=[0,f+1,0,0],k&&(k=!1,d={type:"tableBody",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",d,b]])),h="tableDelimiterRow"===o.type?2:d?3:1):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)?(g=!1,0===j[2]&&(0!==i[1]&&(j[0]=j[1],e=aC(m,b,i,h,void 0,e),i=[0,0,0,0]),j[2]=f)):"tableCellDivider"===o.type&&(g?g=!1:(0!==i[1]&&(j[0]=j[1],e=aC(m,b,i,h,void 0,e)),j=[(i=j)[1],f,0,0])):"tableHead"===o.type?(k=!0,l=f):"tableRow"===o.type||"tableDelimiterRow"===o.type?(l=f,0!==i[1]?(j[0]=j[1],e=aC(m,b,i,h,f,e)):0!==j[1]&&(e=aC(m,b,j,h,f,e)),h=0):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)&&(j[3]=f)}for(0!==l&&aD(m,b,l,c,d),m.consume(b.events),f=-1;++f<b.events.length;){let a=b.events[f];"enter"===a[0]&&"table"===a[1].type&&(a[1]._align=function(a,b){let c=!1,d=[];for(;b<a.length;){let e=a[b];if(c){if("enter"===e[0])"tableContent"===e[1].type&&d.push("tableDelimiterMarker"===a[b+1][1].type?"left":"none");else if("tableContent"===e[1].type){if("tableDelimiterMarker"===a[b-1][1].type){let a=d.length-1;d[a]="left"===d[a]?"center":"right"}}else if("tableDelimiterRow"===e[1].type)break}else"enter"===e[0]&&"tableDelimiterRow"===e[1].type&&(c=!0);b+=1}return d}(b.events,f))}return a}function aC(a,b,c,d,e,f){0!==c[0]&&(f.end=Object.assign({},aE(b.events,c[0])),a.add(c[0],0,[["exit",f,b]]));let g=aE(b.events,c[1]);if(f={type:1===d?"tableHeader":2===d?"tableDelimiter":"tableData",start:Object.assign({},g),end:Object.assign({},g)},a.add(c[1],0,[["enter",f,b]]),0!==c[2]){let e=aE(b.events,c[2]),f=aE(b.events,c[3]),g={type:"tableContent",start:Object.assign({},e),end:Object.assign({},f)};if(a.add(c[2],0,[["enter",g,b]]),2!==d){let d=b.events[c[2]],e=b.events[c[3]];if(d[1].end=Object.assign({},e[1].end),d[1].type="chunkText",d[1].contentType="text",c[3]>c[2]+1){let b=c[2]+1,d=c[3]-c[2]-1;a.add(b,d,[])}}a.add(c[3]+1,0,[["exit",g,b]])}return void 0!==e&&(f.end=Object.assign({},aE(b.events,e)),a.add(e,0,[["exit",f,b]]),f=void 0),f}function aD(a,b,c,d,e){let f=[],g=aE(b.events,c);e&&(e.end=Object.assign({},g),f.push(["exit",e,b])),d.end=Object.assign({},g),f.push(["exit",d,b]),a.add(c+1,0,f)}function aE(a,b){let c=a[b],d="enter"===c[0]?"start":"end";return c[1][d]}let aF={name:"tasklistCheck",tokenize:function(a,b,c){let d=this;return function(b){return null===d.previous&&d._gfmTasklistFirstContentOfListItem?(a.enter("taskListCheck"),a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),e):c(b)};function e(b){return(0,f.Ee)(b)?(a.enter("taskListCheckValueUnchecked"),a.consume(b),a.exit("taskListCheckValueUnchecked"),g):88===b||120===b?(a.enter("taskListCheckValueChecked"),a.consume(b),a.exit("taskListCheckValueChecked"),g):c(b)}function g(b){return 93===b?(a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),a.exit("taskListCheck"),h):c(b)}function h(d){return(0,f.HP)(d)?b(d):(0,f.On)(d)?a.check({tokenize:aG},b,c)(d):c(d)}}};function aG(a,b,c){return(0,ap.N)(a,function(a){return null===a?c(a):b(a)},"whitespace")}let aH={};function aI(a){let b,c=a||aH,d=this.data(),e=d.micromarkExtensions||(d.micromarkExtensions=[]),f=d.fromMarkdownExtensions||(d.fromMarkdownExtensions=[]),g=d.toMarkdownExtensions||(d.toMarkdownExtensions=[]);e.push((0,Z.y)([{text:ah},{document:{91:{name:"gfmFootnoteDefinition",tokenize:au,continuation:{tokenize:av},exit:aw}},text:{91:{name:"gfmFootnoteCall",tokenize:at},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ar,resolveTo:as}}},function(a){let b=(a||{}).singleTilde,c={name:"strikethrough",tokenize:function(a,c,d){let e=this.previous,f=this.events,g=0;return function(h){return 126===e&&"characterEscape"!==f[f.length-1][1].type?d(h):(a.enter("strikethroughSequenceTemporary"),function f(h){let i=(0,M.S)(e);if(126===h)return g>1?d(h):(a.consume(h),g++,f);if(g<2&&!b)return d(h);let j=a.exit("strikethroughSequenceTemporary"),k=(0,M.S)(h);return j._open=!k||2===k&&!!i,j._close=!i||2===i&&!!k,c(h)}(h))}},resolveAll:function(a,b){let c=-1;for(;++c<a.length;)if("enter"===a[c][0]&&"strikethroughSequenceTemporary"===a[c][1].type&&a[c][1]._close){let d=c;for(;d--;)if("exit"===a[d][0]&&"strikethroughSequenceTemporary"===a[d][1].type&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset==a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";let e={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},g=[["enter",e,b],["enter",a[d][1],b],["exit",a[d][1],b],["enter",f,b]],h=b.parser.constructs.insideSpan.null;h&&(0,ax.m)(g,g.length,0,(0,ay.W)(h,a.slice(d+1,c),b)),(0,ax.m)(g,g.length,0,[["exit",f,b],["enter",a[c][1],b],["exit",a[c][1],b],["exit",e,b]]),(0,ax.m)(a,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<a.length;)"strikethroughSequenceTemporary"===a[c][1].type&&(a[c][1].type="data");return a}};return null==b&&(b=!0),{text:{126:c},insideSpan:{null:[c]},attentionMarkers:{null:[126]}}}(c),{flow:{null:{name:"table",tokenize:aA,resolveAll:aB}}},{text:{91:aF}}])),f.push([{transforms:[q],enter:{literalAutolink:k,literalAutolinkEmail:l,literalAutolinkHttp:l,literalAutolinkWww:l},exit:{literalAutolink:p,literalAutolinkEmail:o,literalAutolinkHttp:m,literalAutolinkWww:n}},{enter:{gfmFootnoteCallString:v,gfmFootnoteCall:w,gfmFootnoteDefinitionLabelString:x,gfmFootnoteDefinition:y},exit:{gfmFootnoteCallString:z,gfmFootnoteCall:A,gfmFootnoteDefinitionLabelString:B,gfmFootnoteDefinition:C}},{canContainEols:["delete"],enter:{strikethrough:H},exit:{strikethrough:I}},{enter:{table:P,tableData:T,tableHeader:T,tableRow:R},exit:{codeText:U,table:Q,tableData:S,tableHeader:S,tableRow:S}},{exit:{taskListCheckValueChecked:W,taskListCheckValueUnchecked:W,paragraph:X}}]),g.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:i,notInConstruct:j},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:i,notInConstruct:j},{character:":",before:"[ps]",after:"\\/",inConstruct:i,notInConstruct:j}]},(b=!1,c&&c.firstLineBlank&&(b=!0),{handlers:{footnoteDefinition:function(a,c,d,e){let f=d.createTracker(e),g=f.move("[^"),h=d.enter("footnoteDefinition"),i=d.enter("label");return g+=f.move(d.safe(d.associationId(a),{before:g,after:"]"})),i(),g+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),g+=f.move((b?"\n":" ")+d.indentLines(d.containerFlow(a,f.current()),b?F:E))),h(),g},footnoteReference:D},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:G}],handlers:{delete:J}},function(a){let b=a||{},c=b.tableCellPadding,d=b.tablePipeAlign,e=b.stringLength,f=c?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(a,b,c){let d=O.inlineCode(a,b,c);return c.stack.includes("tableCell")&&(d=d.replace(/\|/g,"\\$&")),d},table:function(a,b,c,d){return h(function(a,b,c){let d=a.children,e=-1,f=[],g=b.enter("table");for(;++e<d.length;)f[e]=i(d[e],b,c);return g(),f}(a,c,d),a.align)},tableCell:g,tableRow:function(a,b,c,d){let e=h([i(a,c,d)]);return e.slice(0,e.indexOf("\n"))}}};function g(a,b,c,d){let e=c.enter("tableCell"),g=c.enter("phrasing"),h=c.containerPhrasing(a,{...d,before:f,after:f});return g(),e(),h}function h(a,b){return function(a,b){let c=b||{},d=(c.align||[]).concat(),e=c.stringLength||K,f=[],g=[],h=[],i=[],j=0,k=-1;for(;++k<a.length;){let b=[],d=[],f=-1;for(a[k].length>j&&(j=a[k].length);++f<a[k].length;){var l;let g=null==(l=a[k][f])?"":String(l);if(!1!==c.alignDelimiters){let a=e(g);d[f]=a,(void 0===i[f]||a>i[f])&&(i[f]=a)}b.push(g)}g[k]=b,h[k]=d}let m=-1;if("object"==typeof d&&"length"in d)for(;++m<j;)f[m]=L(d[m]);else{let a=L(d);for(;++m<j;)f[m]=a}m=-1;let n=[],o=[];for(;++m<j;){let a=f[m],b="",d="";99===a?(b=":",d=":"):108===a?b=":":114===a&&(d=":");let e=!1===c.alignDelimiters?1:Math.max(1,i[m]-b.length-d.length),g=b+"-".repeat(e)+d;!1!==c.alignDelimiters&&((e=b.length+e+d.length)>i[m]&&(i[m]=e),o[m]=e),n[m]=g}g.splice(1,0,n),h.splice(1,0,o),k=-1;let p=[];for(;++k<g.length;){let a=g[k],b=h[k];m=-1;let d=[];for(;++m<j;){let e=a[m]||"",g="",h="";if(!1!==c.alignDelimiters){let a=i[m]-(b[m]||0),c=f[m];114===c?g=" ".repeat(a):99===c?a%2?(g=" ".repeat(a/2+.5),h=" ".repeat(a/2-.5)):h=g=" ".repeat(a/2):h=" ".repeat(a)}!1===c.delimiterStart||m||d.push("|"),!1!==c.padding&&(!1!==c.alignDelimiters||""!==e)&&(!1!==c.delimiterStart||m)&&d.push(" "),!1!==c.alignDelimiters&&d.push(g),d.push(e),!1!==c.alignDelimiters&&d.push(h),!1!==c.padding&&d.push(" "),(!1!==c.delimiterEnd||m!==j-1)&&d.push("|")}p.push(!1===c.delimiterEnd?d.join("").replace(/ +$/,""):d.join(""))}return p.join("\n")}(a,{align:b,alignDelimiters:d,padding:c,stringLength:e})}function i(a,b,c){let d=a.children,e=-1,f=[],h=b.enter("tableRow");for(;++e<d.length;)f[e]=g(d[e],a,b,c);return h(),f}}(c),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Y}}]})}},663033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},665466:(a,b,c)=>{"use strict";c.d(b,{E:()=>i,I:()=>j});var d=c(736927),e=c(115962),f=c(437503),g=c(930439),h=c(535798);function i({event:a,expanded:b,onToggle:c,onOpenPerson:e,onOpenCompany:g}){let i=a.start_at?new Date(a.start_at):null,k=a.end_at?new Date(a.end_at):null,l=i?k?`${o(i)} – ${o(k)}`:o(i):"",m=(a.attendees??[]).slice(0,5),p=(a.attendees?.length??0)-m.length;return(0,d.jsxs)("li",{className:"overflow-hidden",style:{background:b?"var(--color-surface-hover)":"transparent",transition:"background 120ms ease"},children:[(0,d.jsxs)("div",{role:"button",tabIndex:0,"aria-expanded":b,onClick:c,onKeyDown:a=>{a.target===a.currentTarget&&("Enter"===a.key||" "===a.key)&&(a.preventDefault(),c())},className:"group/event w-full flex items-center gap-3 px-3 py-2 text-left cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] transition-colors",onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("div",{className:"text-[12px] tabular-nums shrink-0 whitespace-nowrap",style:{color:"var(--color-text-muted)",width:"11rem"},children:l||(a.start_at?(0,h.wI)(a.start_at):"")}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[(0,d.jsx)("p",{className:"truncate text-[13.5px]",style:{color:"var(--color-text)",fontWeight:500},children:a.title?.trim()||"(no title)"}),a.meeting_type&&(0,d.jsx)("span",{className:"shrink-0 rounded-full px-1.5 py-0 text-[10px] uppercase tracking-[0.06em]",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)",fontWeight:600},children:a.meeting_type})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[m.length>0&&(0,d.jsxs)("div",{className:"flex items-center -space-x-1.5",children:[m.slice(0,4).map(a=>(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),e?.(a.id)},disabled:!e,title:a.name??a.email??void 0,className:"disabled:cursor-default rounded-full",style:{boxShadow:"0 0 0 2px var(--color-background)"},children:(0,d.jsx)(f.X,{src:a.avatar_url,name:a.name,seed:a.email??a.id,size:"sm"})},a.id)),p>0&&(0,d.jsxs)("span",{className:"ml-1 text-[11px] tabular-nums",style:{color:"var(--color-text-muted)"},children:["+",p]})]}),(0,d.jsx)(n,{expanded:b})]})]}),(0,d.jsx)("div",{className:"grid transition-[grid-template-rows] duration-[220ms] ease-out motion-reduce:transition-none",style:{gridTemplateRows:b?"1fr":"0fr"},children:(0,d.jsx)("div",{className:"overflow-hidden",children:b&&(0,d.jsx)(j,{eventId:a.id,fallbackEvent:a,onOpenPerson:e,onOpenCompany:g})})})]})}function j({eventId:a,fallbackEvent:b,onOpenPerson:c,onOpenCompany:f}){var g;let[h,i]=(0,e.useState)(null),[j,n]=(0,e.useState)(!0),[p,q]=(0,e.useState)(null),r=h?.event.start_at??b.start_at?new Date(h?.event.start_at??b.start_at):null,s=h?.event.end_at??b.end_at?new Date(h?.event.end_at??b.end_at):null,t=r?(g=r,new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(g)):null,u=r?s?`${o(r)} – ${o(s)}`:o(r):null,v=r&&s?function(a,b){let c=b.getTime()-a.getTime();if(c<=0)return"";let d=Math.round(c/6e4);if(d>=1440){let a=Math.round(d/1440);return`${a} day${1===a?"":"s"}`}let e=Math.floor(d/60),f=d%60;return 0===e?`${f} min`:0===f?`${e}h`:`${e}h ${f}m`}(r,s):null,w=h?.organizer??null,x=h?.attendees??b.attendees??[],y=h?.companies??[];return(0,d.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-background)"},children:[(t||u||v)&&(0,d.jsx)(k,{label:"When",children:(0,d.jsxs)("div",{className:"text-[13px]",style:{color:"var(--color-text)"},children:[t&&(0,d.jsx)("div",{className:"font-medium",children:t}),(u||v)&&(0,d.jsxs)("div",{className:"mt-0.5",style:{color:"var(--color-text-muted)"},children:[u,u&&v&&" \xb7 ",v]})]})}),w&&(0,d.jsx)(k,{label:"Organizer",children:(0,d.jsx)(l,{person:w,onOpenPerson:c})}),x.length>0&&(0,d.jsx)(k,{label:`Attendees \xb7 ${x.length}`,children:(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:x.map(a=>(0,d.jsx)(l,{person:a,onOpenPerson:c},a.id))})}),y.length>0&&(0,d.jsx)(k,{label:1===y.length?"Company":"Companies",children:(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:y.map(a=>(0,d.jsx)(m,{company:a,onOpenCompany:f},a.id))})}),j&&!h&&(0,d.jsx)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:"Loading meeting details…"}),p&&(0,d.jsxs)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:["Couldn’t load meeting details (",p,"). Showing what we have."]}),!j&&!p&&h&&0===x.length&&!w&&0===y.length&&(0,d.jsx)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:"No additional details for this meeting."})]})}function k({label:a,children:b}){return(0,d.jsxs)("div",{className:"mb-4 last:mb-0",children:[(0,d.jsx)("h4",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:a}),b]})}function l({person:a,onOpenPerson:b}){let c=a.name?.trim()||a.email||"Unknown",e=a.name?.trim()&&a.email?a.email:null;return(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(a.id),disabled:!b,className:"flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors disabled:cursor-default",style:{color:"var(--color-text)"},onMouseEnter:a=>{b&&(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)(f.X,{src:a.avatar_url,name:c,seed:a.email??a.id,size:"sm"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium",style:{color:"var(--color-text)"},children:c}),e&&(0,d.jsx)("p",{className:"truncate text-[11px]",style:{color:"var(--color-text-muted)"},children:e})]})]})}function m({company:a,onOpenCompany:b}){let c=a.name?.trim()||a.domain||"Unknown company";return(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(a.id),disabled:!b,className:"flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors disabled:cursor-default",onMouseEnter:a=>{b&&(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)(g.g,{domain:a.domain,name:a.name,size:"sm"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium",style:{color:"var(--color-text)"},children:c}),a.domain&&a.name&&(0,d.jsx)("p",{className:"truncate text-[11px]",style:{color:"var(--color-text-muted)"},children:a.domain})]})]})}function n({expanded:a}){return(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"motion-reduce:transition-none",style:{color:"var(--color-text-muted)",transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})}function o(a){return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(a)}},669661:(a,b,c)=>{"use strict";c.d(b,{Lz:()=>bR,NZ:()=>br,zF:()=>bu});var d=c(381802),e=c(331480),f=c(731626);let g=function(a){for(var b=0;;b++)if(!(a=a.previousSibling))return b},h=function(a){let b=a.assignedSlot||a.parentNode;return b&&11==b.nodeType?b.host:b},i=null,j=function(a,b,c){let d=i||(i=document.createRange());return d.setEnd(a,null==c?a.nodeValue.length:c),d.setStart(a,b||0),d},k=function(){i=null},l=function(a,b,c,d){return c&&(n(a,b,c,d,-1)||n(a,b,c,d,1))},m=/^(img|br|input|textarea|hr)$/i;function n(a,b,c,d,e){for(var f;;){if(a==c&&b==d)return!0;if(b==(e<0?0:o(a))){let c=a.parentNode;if(!c||1!=c.nodeType||p(a)||m.test(a.nodeName)||"false"==a.contentEditable)return!1;b=g(a)+(e<0?0:1),a=c}else{if(1!=a.nodeType)return!1;let c=a.childNodes[b+(e<0?-1:0)];if(1==c.nodeType&&"false"==c.contentEditable)if(null==(f=c.pmViewDesc)||!f.ignoreForSelection)return!1;else b+=e;else a=c,b=e<0?o(a):0}}}function o(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function p(a){let b;for(let c=a;c&&!(b=c.pmViewDesc);c=c.parentNode);return b&&b.node&&b.node.isBlock&&(b.dom==a||b.contentDOM==a)}let q=function(a){return a.focusNode&&l(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset)};function r(a,b){let c=document.createEvent("Event");return c.initEvent("keydown",!0,!0),c.keyCode=a,c.key=c.code=b,c}let s="undefined"!=typeof navigator?navigator:null,t="undefined"!=typeof document?document:null,u=s&&s.userAgent||"",v=/Edge\/(\d+)/.exec(u),w=/MSIE \d/.exec(u),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(u),y=!!(w||x||v),z=w?document.documentMode:x?+x[1]:v?+v[1]:0,A=!y&&/gecko\/(\d+)/i.test(u);A&&(/Firefox\/(\d+)/.exec(u)||[0,0])[1];let B=!y&&/Chrome\/(\d+)/.exec(u),C=!!B,D=B?+B[1]:0,E=!y&&!!s&&/Apple Computer/.test(s.vendor),F=E&&(/Mobile\/\w+/.test(u)||!!s&&s.maxTouchPoints>2),G=F||!!s&&/Mac/.test(s.platform),H=!!s&&/Win/.test(s.platform),I=/Android \d/.test(u),J=!!t&&"webkitFontSmoothing"in t.documentElement.style,K=J?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function L(a,b){return"number"==typeof a?a:a[b]}function M(a,b,c){let d=a.someProp("scrollThreshold")||0,e=a.someProp("scrollMargin")||5,f=a.dom.ownerDocument;for(let g=c||a.dom;g;){if(1!=g.nodeType){g=h(g);continue}let a=g,c=a==f.body,i=c?function(a){let b=a.defaultView&&a.defaultView.visualViewport;return b?{left:0,right:b.width,top:0,bottom:b.height}:{left:0,right:a.documentElement.clientWidth,top:0,bottom:a.documentElement.clientHeight}}(f):function(a){let b=a.getBoundingClientRect(),c=b.width/a.offsetWidth||1,d=b.height/a.offsetHeight||1;return{left:b.left,right:b.left+a.clientWidth*c,top:b.top,bottom:b.top+a.clientHeight*d}}(a),j=0,k=0;if(b.top<i.top+L(d,"top")?k=-(i.top-b.top+L(e,"top")):b.bottom>i.bottom-L(d,"bottom")&&(k=b.bottom-b.top>i.bottom-i.top?b.top+L(e,"top")-i.top:b.bottom-i.bottom+L(e,"bottom")),b.left<i.left+L(d,"left")?j=-(i.left-b.left+L(e,"left")):b.right>i.right-L(d,"right")&&(j=b.right-i.right+L(e,"right")),j||k)if(c)f.defaultView.scrollBy(j,k);else{let c=a.scrollLeft,d=a.scrollTop;k&&(a.scrollTop+=k),j&&(a.scrollLeft+=j);let e=a.scrollLeft-c,f=a.scrollTop-d;b={left:b.left-e,top:b.top-f,right:b.right-e,bottom:b.bottom-f}}let l=c?"fixed":getComputedStyle(g).position;if(/^(fixed|sticky)$/.test(l))break;g="absolute"==l?g.offsetParent:h(g)}}function N(a){let b=[],c=a.ownerDocument;for(let d=a;d&&(b.push({dom:d,top:d.scrollTop,left:d.scrollLeft}),a!=c);d=h(d));return b}function O(a,b){for(let c=0;c<a.length;c++){let{dom:d,top:e,left:f}=a[c];d.scrollTop!=e+b&&(d.scrollTop=e+b),d.scrollLeft!=f&&(d.scrollLeft=f)}}let P=null;function Q(a,b){return a.left>=b.left-1&&a.left<=b.right+1&&a.top>=b.top-1&&a.top<=b.bottom+1}function R(a){return a.top<a.bottom||a.left<a.right}function S(a,b){let c=a.getClientRects();if(c.length){let a=c[b<0?0:c.length-1];if(R(a))return a}return Array.prototype.find.call(c,R)||a.getBoundingClientRect()}let T=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function U(a,b,c){let{node:d,offset:e,atom:f}=a.docView.domFromPos(b,c<0?-1:1),g=J||A;if(3==d.nodeType)if(g&&(T.test(d.nodeValue)||(c<0?!e:e==d.nodeValue.length))){let a=S(j(d,e,e),c);if(A&&e&&/\s/.test(d.nodeValue[e-1])&&e<d.nodeValue.length){let b=S(j(d,e-1,e-1),-1);if(b.top==a.top){let c=S(j(d,e,e+1),-1);if(c.top!=a.top)return V(c,c.left<b.left)}}return a}else{let a=e,b=e,f=c<0?1:-1;return c<0&&!e?(b++,f=-1):c>=0&&e==d.nodeValue.length?(a--,f=1):c<0?a--:b++,V(S(j(d,a,b),f),f<0)}if(!a.state.doc.resolve(b-(f||0)).parent.inlineContent){if(null==f&&e&&(c<0||e==o(d))){let a=d.childNodes[e-1];if(1==a.nodeType)return W(a.getBoundingClientRect(),!1)}if(null==f&&e<o(d)){let a=d.childNodes[e];if(1==a.nodeType)return W(a.getBoundingClientRect(),!0)}return W(d.getBoundingClientRect(),c>=0)}if(null==f&&e&&(c<0||e==o(d))){let a=d.childNodes[e-1],b=3==a.nodeType?j(a,o(a)-!g):1!=a.nodeType||"BR"==a.nodeName&&a.nextSibling?null:a;if(b)return V(S(b,1),!1)}if(null==f&&e<o(d)){let a=d.childNodes[e];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let b=a?3==a.nodeType?j(a,0,+!g):1==a.nodeType?a:null:null;if(b)return V(S(b,-1),!0)}return V(S(3==d.nodeType?j(d):d,-c),c>=0)}function V(a,b){if(0==a.width)return a;let c=b?a.left:a.right;return{top:a.top,bottom:a.bottom,left:c,right:c}}function W(a,b){if(0==a.height)return a;let c=b?a.top:a.bottom;return{top:c,bottom:c,left:a.left,right:a.right}}function X(a,b,c){let d=a.state,e=a.root.activeElement;d!=b&&a.updateState(b),e!=a.dom&&a.focus();try{return c()}finally{d!=b&&a.updateState(d),e!=a.dom&&e&&e.focus()}}let Y=/[\u0590-\u08ac]/,Z=null,_=null,aa=!1;class ab{constructor(a,b,c,d){this.parent=a,this.children=b,this.dom=c,this.contentDOM=d,this.dirty=0,c.pmViewDesc=this}matchesWidget(a){return!1}matchesMark(a){return!1}matchesNode(a,b,c){return!1}matchesHack(a){return!1}parseRule(){return null}stopEvent(a){return!1}get size(){let a=0;for(let b=0;b<this.children.length;b++)a+=this.children[b].size;return a}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let a=0;a<this.children.length;a++)this.children[a].destroy()}posBeforeChild(a){for(let b=0,c=this.posAtStart;;b++){let d=this.children[b];if(d==a)return c;c+=d.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(a,b,c){let d;if(this.contentDOM&&this.contentDOM.contains(1==a.nodeType?a:a.parentNode))if(c<0){let c,d;if(a==this.contentDOM)c=a.childNodes[b-1];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.previousSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.previousSibling;return c?this.posBeforeChild(d)+d.size:this.posAtStart}else{let c,d;if(a==this.contentDOM)c=a.childNodes[b];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.nextSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.nextSibling;return c?this.posBeforeChild(d):this.posAtEnd}if(a==this.dom&&this.contentDOM)d=b>g(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))d=2&a.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==b)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!1;break}if(b.previousSibling)break}if(null==d&&b==a.childNodes.length)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!0;break}if(b.nextSibling)break}}return(null==d?c>0:d)?this.posAtEnd:this.posAtStart}nearestDesc(a,b=!1){for(let c=!0,d=a;d;d=d.parentNode){let e=this.getDesc(d),f;if(e&&(!b||e.node))if(!c||!(f=e.nodeDOM)||(1==f.nodeType?f.contains(1==a.nodeType?a:a.parentNode):f==a))return e;else c=!1}}getDesc(a){let b=a.pmViewDesc;for(let a=b;a;a=a.parent)if(a==this)return b}posFromDOM(a,b,c){for(let d=a;d;d=d.parentNode){let e=this.getDesc(d);if(e)return e.localPosFromDOM(a,b,c)}return -1}descAt(a){for(let b=0,c=0;b<this.children.length;b++){let d=this.children[b],e=c+d.size;if(c==a&&e!=c){for(;!d.border&&d.children.length;)for(let a=0;a<d.children.length;a++){let b=d.children[a];if(b.size){d=b;break}}return d}if(a<e)return d.descAt(a-c-d.border);c=e}}domFromPos(a,b){if(!this.contentDOM)return{node:this.dom,offset:0,atom:a+1};let c=0,d=0;for(let b=0;c<this.children.length;c++){let e=this.children[c],f=b+e.size;if(f>a||e instanceof ai){d=a-b;break}b=f}if(d)return this.children[c].domFromPos(d-this.children[c].border,b);for(let a;c&&!(a=this.children[c-1]).size&&a instanceof ac&&a.side>=0;c--);if(b<=0){let a,d=!0;for(;(a=c?this.children[c-1]:null)&&a.dom.parentNode!=this.contentDOM;c--,d=!1);return a&&b&&d&&!a.border&&!a.domAtom?a.domFromPos(a.size,b):{node:this.contentDOM,offset:a?g(a.dom)+1:0}}{let a,d=!0;for(;(a=c<this.children.length?this.children[c]:null)&&a.dom.parentNode!=this.contentDOM;c++,d=!1);return a&&d&&!a.border&&!a.domAtom?a.domFromPos(0,b):{node:this.contentDOM,offset:a?g(a.dom):this.contentDOM.childNodes.length}}}parseRange(a,b,c=0){if(0==this.children.length)return{node:this.contentDOM,from:a,to:b,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let d=-1,e=-1;for(let f=c,h=0;;h++){let c=this.children[h],i=f+c.size;if(-1==d&&a<=i){let e=f+c.border;if(a>=e&&b<=i-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(a,b,e);a=f;for(let b=h;b>0;b--){let c=this.children[b-1];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(1)){d=g(c.dom)+1;break}a-=c.size}-1==d&&(d=0)}if(d>-1&&(i>b||h==this.children.length-1)){b=i;for(let a=h+1;a<this.children.length;a++){let c=this.children[a];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(-1)){e=g(c.dom);break}b+=c.size}-1==e&&(e=this.contentDOM.childNodes.length);break}f=i}return{node:this.contentDOM,from:a,to:b,fromOffset:d,toOffset:e}}emptyChildAt(a){if(this.border||!this.contentDOM||!this.children.length)return!1;let b=this.children[a<0?0:this.children.length-1];return 0==b.size||b.emptyChildAt(a)}domAfterPos(a){let{node:b,offset:c}=this.domFromPos(a,0);if(1!=b.nodeType||c==b.childNodes.length)throw RangeError("No node after pos "+a);return b.childNodes[c]}setSelection(a,b,c,d=!1){let e=Math.min(a,b),f=Math.max(a,b);for(let g=0,h=0;g<this.children.length;g++){let i=this.children[g],j=h+i.size;if(e>h&&f<j)return i.setSelection(a-h-i.border,b-h-i.border,c,d);h=j}let h=this.domFromPos(a,a?-1:1),i=b==a?h:this.domFromPos(b,b?-1:1),j=c.root.getSelection(),k=c.domSelectionRange(),m=!1;if((A||E)&&a==b){let{node:a,offset:b}=h;if(3==a.nodeType){if((m=!!(b&&"\n"==a.nodeValue[b-1]))&&b==a.nodeValue.length)for(let b=a,c;b;b=b.parentNode){if(c=b.nextSibling){"BR"==c.nodeName&&(h=i={node:c.parentNode,offset:g(c)+1});break}let a=b.pmViewDesc;if(a&&a.node&&a.node.isBlock)break}}else{let c=a.childNodes[b-1];m=c&&("BR"==c.nodeName||"false"==c.contentEditable)}}if(A&&k.focusNode&&k.focusNode!=i.node&&1==k.focusNode.nodeType){let a=k.focusNode.childNodes[k.focusOffset];a&&"false"==a.contentEditable&&(d=!0)}if(!(d||m&&E)&&l(h.node,h.offset,k.anchorNode,k.anchorOffset)&&l(i.node,i.offset,k.focusNode,k.focusOffset))return;let n=!1;if((j.extend||a==b)&&!(m&&A)){j.collapse(h.node,h.offset);try{a!=b&&j.extend(i.node,i.offset),n=!0}catch(a){}}if(!n){if(a>b){let a=h;h=i,i=a}let c=document.createRange();c.setEnd(i.node,i.offset),c.setStart(h.node,h.offset),j.removeAllRanges(),j.addRange(c)}}ignoreMutation(a){return!this.contentDOM&&"selection"!=a.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(a,b){for(let c=0,d=0;d<this.children.length;d++){let e=this.children[d],f=c+e.size;if(c==f?a<=f&&b>=c:a<f&&b>c){let d=c+e.border,g=f-e.border;if(a>=d&&b<=g){this.dirty=a==c||b==f?2:1,a==d&&b==g&&(e.contentLost||e.dom.parentNode!=this.contentDOM)?e.dirty=3:e.markDirty(a-d,b-d);return}e.dirty=e.dom!=e.contentDOM||e.dom.parentNode!=this.contentDOM||e.children.length?3:2}c=f}this.dirty=2}markParentsDirty(){let a=1;for(let b=this.parent;b;b=b.parent,a++){let c=1==a?2:1;b.dirty<c&&(b.dirty=c)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(a){return!1}}class ac extends ab{constructor(a,b,c,d){let e,f=b.type.toDOM;if("function"==typeof f&&(f=f(c,()=>e?e.parent?e.parent.posBeforeChild(e):void 0:d)),!b.type.spec.raw){if(1!=f.nodeType){let a=document.createElement("span");a.appendChild(f),f=a}f.contentEditable="false",f.classList.add("ProseMirror-widget")}super(a,[],f,null),this.widget=b,this.widget=b,e=this}matchesWidget(a){return 0==this.dirty&&a.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(a){let b=this.widget.spec.stopEvent;return!!b&&b(a)}ignoreMutation(a){return"selection"!=a.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ad extends ab{constructor(a,b,c,d){super(a,[],b,null),this.textDOM=c,this.text=d}get size(){return this.text.length}localPosFromDOM(a,b){return a!=this.textDOM?this.posAtStart+(b?this.size:0):this.posAtStart+b}domFromPos(a){return{node:this.textDOM,offset:a}}ignoreMutation(a){return"characterData"===a.type&&a.target.nodeValue==a.oldValue}}class ae extends ab{constructor(a,b,c,d,e){super(a,[],c,d),this.mark=b,this.spec=e}static create(a,b,c,d){let f=d.nodeViews[b.type.name],g=f&&f(b,d,c);return g&&g.dom||(g=e.ZF.renderSpec(document,b.type.spec.toDOM(b,c),null,b.attrs)),new ae(a,b,g.dom,g.contentDOM||g.dom,g)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(a){return 3!=this.dirty&&this.mark.eq(a)}markDirty(a,b){if(super.markDirty(a,b),0!=this.dirty){let a=this.parent;for(;!a.node;)a=a.parent;a.dirty<this.dirty&&(a.dirty=this.dirty),this.dirty=0}}slice(a,b,c){let d=ae.create(this.parent,this.mark,!0,c),e=this.children,f=this.size;b<f&&(e=at(e,b,f,c)),a>0&&(e=at(e,0,a,c));for(let a=0;a<e.length;a++)e[a].parent=d;return d.children=e,d}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class af extends ab{constructor(a,b,c,d,e,f,g,h,i){super(a,[],e,f),this.node=b,this.outerDeco=c,this.innerDeco=d,this.nodeDOM=g}static create(a,b,c,d,f,g){let h=f.nodeViews[b.type.name],i,j=h&&h(b,f,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:g,c,d),k=j&&j.dom,l=j&&j.contentDOM;if(b.isText)if(k){if(3!=k.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else k=document.createTextNode(b.text);else if(!k){let a=e.ZF.renderSpec(document,b.type.spec.toDOM(b),null,b.attrs);({dom:k,contentDOM:l}=a)}l||b.isText||"BR"==k.nodeName||(k.hasAttribute("contenteditable")||(k.contentEditable="false"),b.type.spec.draggable&&(k.draggable=!0));let m=k;return(k=ao(k,c,b),j)?i=new aj(a,b,c,d,k,l||null,m,j,f,g+1):b.isText?new ah(a,b,c,d,k,m,f):new af(a,b,c,d,k,l||null,m,f,g+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let a={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(a.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let b=this.children.length-1;b>=0;b--){let c=this.children[b];if(this.dom.contains(c.dom.parentNode)){a.contentElement=c.dom.parentNode;break}}a.contentElement||(a.getContent=()=>e.FK.empty)}else a.contentElement=this.contentDOM;else a.getContent=()=>this.node.content;return a}matchesNode(a,b,c){return 0==this.dirty&&a.eq(this.node)&&ap(b,this.outerDeco)&&c.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(a,b){let c=this.node.inlineContent,d=b,f=a.composing?this.localCompositionInfo(a,b):null,g=f&&f.pos>-1?f:null,h=f&&f.pos<0,i=new ar(this,g&&g.node,a);(function(a,b,c,d){let e=b.locals(a),f=0;if(0==e.length){for(let c=0;c<a.childCount;c++){let g=a.child(c);d(g,e,b.forChild(f,g),c),f+=g.nodeSize}return}let g=0,h=[],i=null;for(let j=0;;){let k,l,m,n;for(;g<e.length&&e[g].to==f;){let a=e[g++];a.widget&&(k?(l||(l=[k])).push(a):k=a)}if(k)if(l){l.sort(as);for(let a=0;a<l.length;a++)c(l[a],j,!!i)}else c(k,j,!!i);if(i)n=-1,m=i,i=null;else if(j<a.childCount)n=j,m=a.child(j++);else break;for(let a=0;a<h.length;a++)h[a].to<=f&&h.splice(a--,1);for(;g<e.length&&e[g].from<=f&&e[g].to>f;)h.push(e[g++]);let o=f+m.nodeSize;if(m.isText){let a=o;g<e.length&&e[g].from<a&&(a=e[g].from);for(let b=0;b<h.length;b++)h[b].to<a&&(a=h[b].to);a<o&&(i=m.cut(a-f),m=m.cut(0,a-f),o=a,n=-1)}else for(;g<e.length&&e[g].to<o;)g++;let p=m.isInline&&!m.isLeaf?h.filter(a=>!a.inline):h.slice();d(m,p,b.forChild(f,m),n),f=o}})(this.node,this.innerDeco,(b,f,g)=>{b.spec.marks?i.syncToMarks(b.spec.marks,c,a,f):b.type.side>=0&&!g&&i.syncToMarks(f==this.node.childCount?e.CU.none:this.node.child(f).marks,c,a,f),i.placeWidget(b,a,d)},(b,e,g,j)=>{let k;i.syncToMarks(b.marks,c,a,j),i.findNodeMatch(b,e,g,j)||h&&a.state.selection.from>d&&a.state.selection.to<d+b.nodeSize&&(k=i.findIndexWithChild(f.node))>-1&&i.updateNodeAt(b,e,g,k,a)||i.updateNextNode(b,e,g,a,j,d)||i.addNode(b,e,g,a,d),d+=b.nodeSize}),i.syncToMarks([],c,a,0),this.node.isTextblock&&i.addTextblockHacks(),i.destroyRest(),(i.changed||2==this.dirty)&&(g&&this.protectLocalComposition(a,g),function a(b,c,d){let e=b.firstChild,f=!1;for(let g=0;g<c.length;g++){let h=c[g],i=h.dom;if(i.parentNode==b){for(;i!=e;)e=aq(e),f=!0;e=e.nextSibling}else f=!0,b.insertBefore(i,e);if(h instanceof ae){let c=e?e.previousSibling:b.lastChild;a(h.contentDOM,h.children,d),e=c?c.nextSibling:b.firstChild}}for(;e;)e=aq(e),f=!0;f&&d.trackWrites==b&&(d.trackWrites=null)}(this.contentDOM,this.children,a),F&&function(a){if("UL"==a.nodeName||"OL"==a.nodeName){let b=a.style.cssText;a.style.cssText=b+"; list-style: square !important",window.getComputedStyle(a).listStyle,a.style.cssText=b}}(this.dom))}localCompositionInfo(a,b){let{from:c,to:e}=a.state.selection;if(!(a.state.selection instanceof d.U3)||c<b||e>b+this.node.content.size)return null;let f=a.input.compositionNode;if(!f||!this.dom.contains(f.parentNode))return null;if(!this.node.inlineContent)return{node:f,pos:-1,text:""};{let a=f.nodeValue,d=function(a,b,c,d){for(let e=0,f=0;e<a.childCount&&f<=d;){let g=a.child(e++),h=f;if(f+=g.nodeSize,!g.isText)continue;let i=g.text;for(;e<a.childCount;){let b=a.child(e++);if(f+=b.nodeSize,!b.isText)break;i+=b.text}if(f>=c){if(f>=d&&i.slice(d-b.length-h,d-h)==b)return d-b.length;let a=h<d?i.lastIndexOf(b,d-h-1):-1;if(a>=0&&a+b.length+h>=c)return h+a;if(c==d&&i.length>=d+b.length-h&&i.slice(d-h,d-h+b.length)==b)return d}}return -1}(this.node.content,a,c-b,e-b);return d<0?null:{node:f,pos:d,text:a}}}protectLocalComposition(a,{node:b,pos:c,text:d}){if(this.getDesc(b))return;let e=b;for(;e.parentNode!=this.contentDOM;e=e.parentNode){for(;e.previousSibling;)e.parentNode.removeChild(e.previousSibling);for(;e.nextSibling;)e.parentNode.removeChild(e.nextSibling);e.pmViewDesc&&(e.pmViewDesc=void 0)}let f=new ad(this,e,b,d);a.input.compositionNodes.push(f),this.children=at(this.children,c,c+d.length,a,f)}update(a,b,c,d){return 3!=this.dirty&&!!a.sameMarkup(this.node)&&(this.updateInner(a,b,c,d),!0)}updateInner(a,b,c,d){this.updateOuterDeco(b),this.node=a,this.innerDeco=c,this.contentDOM&&this.updateChildren(d,this.posAtStart),this.dirty=0}updateOuterDeco(a){if(ap(a,this.outerDeco))return;let b=1!=this.nodeDOM.nodeType,c=this.dom;this.dom=an(this.dom,this.nodeDOM,am(this.outerDeco,this.node,b),am(a,this.node,b)),this.dom!=c&&(c.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=a}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ag(a,b,c,d,e){ao(d,b,a);let f=new af(void 0,a,b,c,d,d,d,e,0);return f.contentDOM&&f.updateChildren(e,0),f}class ah extends af{constructor(a,b,c,d,e,f,g){super(a,b,c,d,e,null,f,g,0)}parseRule(){let a=this.nodeDOM.parentNode;for(;a&&a!=this.dom&&!a.pmIsDeco;)a=a.parentNode;return{skip:a||!0}}update(a,b,c,d){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!a.sameMarkup(this.node)&&(this.updateOuterDeco(b),(0!=this.dirty||a.text!=this.node.text)&&a.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=a.text,d.trackWrites==this.nodeDOM&&(d.trackWrites=null)),this.node=a,this.dirty=0,!0)}inParent(){let a=this.parent.contentDOM;for(let b=this.nodeDOM;b;b=b.parentNode)if(b==a)return!0;return!1}domFromPos(a){return{node:this.nodeDOM,offset:a}}localPosFromDOM(a,b,c){return a==this.nodeDOM?this.posAtStart+Math.min(b,this.node.text.length):super.localPosFromDOM(a,b,c)}ignoreMutation(a){return"characterData"!=a.type&&"selection"!=a.type}slice(a,b,c){let d=this.node.cut(a,b),e=document.createTextNode(d.text);return new ah(this.parent,d,this.outerDeco,this.innerDeco,e,e,c)}markDirty(a,b){super.markDirty(a,b),this.dom!=this.nodeDOM&&(0==a||b==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(a){return this.node.text==a}}class ai extends ab{parseRule(){return{ignore:!0}}matchesHack(a){return 0==this.dirty&&this.dom.nodeName==a}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class aj extends af{constructor(a,b,c,d,e,f,g,h,i,j){super(a,b,c,d,e,f,g,i,j),this.spec=h}update(a,b,c,d){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==a.type||this.spec.multiType)){let e=this.spec.update(a,b,c);return e&&this.updateInner(a,b,c,d),e}return(!!this.contentDOM||!!a.isLeaf)&&super.update(a,b,c,d)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(a,b,c,d){this.spec.setSelection?this.spec.setSelection(a,b,c.root):super.setSelection(a,b,c,d)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(a){return!!this.spec.stopEvent&&this.spec.stopEvent(a)}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}}let ak=function(a){a&&(this.nodeName=a)};ak.prototype=Object.create(null);let al=[new ak];function am(a,b,c){if(0==a.length)return al;let d=c?al[0]:new ak,e=[d];for(let f=0;f<a.length;f++){let g=a[f].type.attrs;if(g)for(let a in g.nodeName&&e.push(d=new ak(g.nodeName)),g){let f=g[a];null!=f&&(c&&1==e.length&&e.push(d=new ak(b.isInline?"span":"div")),"class"==a?d.class=(d.class?d.class+" ":"")+f:"style"==a?d.style=(d.style?d.style+";":"")+f:"nodeName"!=a&&(d[a]=f))}}return e}function an(a,b,c,d){if(c==al&&d==al)return b;let e=b;for(let b=0;b<d.length;b++){let f=d[b],g=c[b];if(b){let b;g&&g.nodeName==f.nodeName&&e!=a&&(b=e.parentNode)&&b.nodeName.toLowerCase()==f.nodeName||((b=document.createElement(f.nodeName)).pmIsDeco=!0,b.appendChild(e),g=al[0]),e=b}!function(a,b,c){for(let d in b)"class"==d||"style"==d||"nodeName"==d||d in c||a.removeAttribute(d);for(let d in c)"class"!=d&&"style"!=d&&"nodeName"!=d&&c[d]!=b[d]&&a.setAttribute(d,c[d]);if(b.class!=c.class){let d=b.class?b.class.split(" ").filter(Boolean):[],e=c.class?c.class.split(" ").filter(Boolean):[];for(let b=0;b<d.length;b++)-1==e.indexOf(d[b])&&a.classList.remove(d[b]);for(let b=0;b<e.length;b++)-1==d.indexOf(e[b])&&a.classList.add(e[b]);0==a.classList.length&&a.removeAttribute("class")}if(b.style!=c.style){if(b.style){let c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,d;for(;d=c.exec(b.style);)a.style.removeProperty(d[1])}c.style&&(a.style.cssText+=c.style)}}(e,g||al[0],f)}return e}function ao(a,b,c){return an(a,a,al,am(b,c,1!=a.nodeType))}function ap(a,b){if(a.length!=b.length)return!1;for(let c=0;c<a.length;c++)if(!a[c].type.eq(b[c].type))return!1;return!0}function aq(a){let b=a.nextSibling;return a.parentNode.removeChild(a),b}class ar{constructor(a,b,c){this.lock=b,this.view=c,this.index=0,this.stack=[],this.changed=!1,this.top=a,this.preMatch=function(a,b){let c=b,d=c.children.length,e=a.childCount,f=new Map,g=[];a:for(;e>0;){let h;for(;;)if(d){let a=c.children[d-1];if(a instanceof ae)c=a,d=a.children.length;else{h=a,d--;break}}else if(c==b)break a;else d=c.parent.children.indexOf(c),c=c.parent;let i=h.node;if(i){if(i!=a.child(e-1))break;--e,f.set(h,e),g.push(h)}}return{index:e,matched:f,matches:g.reverse()}}(a.node.content,a)}destroyBetween(a,b){if(a!=b){for(let c=a;c<b;c++)this.top.children[c].destroy();this.top.children.splice(a,b-a),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(a,b,c,d){let e=0,f=this.stack.length>>1,g=Math.min(f,a.length);for(;e<g&&(e==f-1?this.top:this.stack[e+1<<1]).matchesMark(a[e])&&!1!==a[e].type.spec.spanning;)e++;for(;e<f;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),f--;for(;f<a.length;){this.stack.push(this.top,this.index+1);let e=-1,g=this.top.children.length;d<this.preMatch.index&&(g=Math.min(this.index+3,g));for(let b=this.index;b<g;b++){let c=this.top.children[b];if(c.matchesMark(a[f])&&!this.isLocked(c.dom)){e=b;break}}if(e>-1)e>this.index&&(this.changed=!0,this.destroyBetween(this.index,e)),this.top=this.top.children[this.index];else{let d=ae.create(this.top,a[f],b,c);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,f++}}findNodeMatch(a,b,c,d){let e=-1,f;if(d>=this.preMatch.index&&(f=this.preMatch.matches[d-this.preMatch.index]).parent==this.top&&f.matchesNode(a,b,c))e=this.top.children.indexOf(f,this.index);else for(let d=this.index,f=Math.min(this.top.children.length,d+5);d<f;d++){let f=this.top.children[d];if(f.matchesNode(a,b,c)&&!this.preMatch.matched.has(f)){e=d;break}}return!(e<0)&&(this.destroyBetween(this.index,e),this.index++,!0)}updateNodeAt(a,b,c,d,e){let f=this.top.children[d];return 3==f.dirty&&f.dom==f.contentDOM&&(f.dirty=2),!!f.update(a,b,c,e)&&(this.destroyBetween(this.index,d),this.index++,!0)}findIndexWithChild(a){for(;;){let b=a.parentNode;if(!b)return -1;if(b==this.top.contentDOM){let b=a.pmViewDesc;if(b){for(let a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==b)return a}return -1}a=b}}updateNextNode(a,b,c,d,e,f){for(let g=this.index;g<this.top.children.length;g++){let h=this.top.children[g];if(h instanceof af){let i=this.preMatch.matched.get(h);if(null!=i&&i!=e)return!1;let j=h.dom,k,l=this.isLocked(j)&&!(a.isText&&h.node&&h.node.isText&&h.nodeDOM.nodeValue==a.text&&3!=h.dirty&&ap(b,h.outerDeco));if(!l&&h.update(a,b,c,d))return this.destroyBetween(this.index,g),h.dom!=j&&(this.changed=!0),this.index++,!0;if(!l&&(k=this.recreateWrapper(h,a,b,c,d,f)))return this.destroyBetween(this.index,g),this.top.children[this.index]=k,k.contentDOM&&(k.dirty=2,k.updateChildren(d,f+1),k.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(a,b,c,d,e,f){if(a.dirty||b.isAtom||!a.children.length||!a.node.content.eq(b.content)||!ap(c,a.outerDeco)||!d.eq(a.innerDeco))return null;let g=af.create(this.top,b,c,d,e,f);if(g.contentDOM)for(let b of(g.children=a.children,a.children=[],g.children))b.parent=g;return a.destroy(),g}addNode(a,b,c,d,e){let f=af.create(this.top,a,b,c,d,e);f.contentDOM&&f.updateChildren(d,e+1),this.top.children.splice(this.index++,0,f),this.changed=!0}placeWidget(a,b,c){let d=this.index<this.top.children.length?this.top.children[this.index]:null;if(d&&d.matchesWidget(a)&&(a==d.widget||!d.widget.type.toDOM.parentNode))this.index++;else{let d=new ac(this.top,a,b,c);this.top.children.splice(this.index++,0,d),this.changed=!0}}addTextblockHacks(){let a=this.top.children[this.index-1],b=this.top;for(;a instanceof ae;)a=(b=a).children[b.children.length-1];(!a||!(a instanceof ah)||/\n$/.test(a.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(a.node.text))&&((E||C)&&a&&"false"==a.dom.contentEditable&&this.addHackNode("IMG",b),this.addHackNode("BR",this.top))}addHackNode(a,b){if(b==this.top&&this.index<b.children.length&&b.children[this.index].matchesHack(a))this.index++;else{let c=document.createElement(a);"IMG"==a&&(c.className="ProseMirror-separator",c.alt=""),"BR"==a&&(c.className="ProseMirror-trailingBreak");let d=new ai(this.top,[],c,null);b!=this.top?b.children.push(d):b.children.splice(this.index++,0,d),this.changed=!0}}isLocked(a){return this.lock&&(a==this.lock||1==a.nodeType&&a.contains(this.lock.parentNode))}}function as(a,b){return a.type.side-b.type.side}function at(a,b,c,d,e){let f=[];for(let g=0,h=0;g<a.length;g++){let i=a[g],j=h,k=h+=i.size;j>=c||k<=b?f.push(i):(j<b&&f.push(i.slice(0,b-j,d)),e&&(f.push(e),e=void 0),k>c&&f.push(i.slice(c-j,i.size,d)))}return f}function au(a,b=null){let c=a.domSelectionRange(),e=a.state.doc;if(!c.focusNode)return null;let f=a.docView.nearestDesc(c.focusNode),h=f&&0==f.size,i=a.docView.posFromDOM(c.focusNode,c.focusOffset,1);if(i<0)return null;let j=e.resolve(i),k,l;if(q(c)){for(k=i;f&&!f.node;)f=f.parent;let a=f.node;if(f&&a.isAtom&&d.nh.isSelectable(a)&&f.parent&&!(a.isInline&&function(a,b,c){for(let d=0==b,e=b==o(a);d||e;){if(a==c)return!0;let b=g(a);if(!(a=a.parentNode))return!1;d=d&&0==b,e=e&&b==o(a)}}(c.focusNode,c.focusOffset,f.dom))){let a=f.posBefore;l=new d.nh(i==a?j:e.resolve(a))}}else{if(c instanceof a.dom.ownerDocument.defaultView.Selection&&c.rangeCount>1){let b=i,d=i;for(let e=0;e<c.rangeCount;e++){let f=c.getRangeAt(e);b=Math.min(b,a.docView.posFromDOM(f.startContainer,f.startOffset,1)),d=Math.max(d,a.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(b<0)return null;[k,i]=d==a.state.selection.anchor?[d,b]:[b,d],j=e.resolve(i)}else k=a.docView.posFromDOM(c.anchorNode,c.anchorOffset,1);if(k<0)return null}let m=e.resolve(k);if(!l){let c="pointer"==b||a.state.selection.head<j.pos&&!h?1:-1;l=aD(a,m,j,c)}return l}function av(a){return a.editable?a.hasFocus():aF(a)&&document.activeElement&&document.activeElement.contains(a.dom)}function aw(a,b=!1){let c=a.state.selection;if(aB(a,c),av(a)){if(!b&&a.input.mouseDown&&a.input.mouseDown.allowDefault&&C){let b=a.domSelectionRange(),c=a.domObserver.currentSelection;if(b.anchorNode&&c.anchorNode&&l(b.anchorNode,b.anchorOffset,c.anchorNode,c.anchorOffset)){a.input.mouseDown.delayedSelectionSync=!0,a.domObserver.setCurSelection();return}}if(a.domObserver.disconnectSelection(),a.cursorWrapper)!function(a){let b=a.domSelection();if(!b)return;let c=a.cursorWrapper.dom,d="IMG"==c.nodeName;d?b.collapse(c.parentNode,g(c)+1):b.collapse(c,0),!d&&!a.state.selection.visible&&y&&z<=11&&(c.disabled=!0,c.disabled=!1)}(a);else{var e;let f,g,h,i,{anchor:j,head:k}=c,l,m;ax&&!(c instanceof d.U3)&&(c.$from.parent.inlineContent||(l=ay(a,c.from)),c.empty||c.$from.parent.inlineContent||(m=ay(a,c.to))),a.docView.setSelection(j,k,a,b),ax&&(l&&aA(l),m&&aA(m)),c.visible?a.dom.classList.remove("ProseMirror-hideselection"):(a.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((f=(e=a).dom.ownerDocument).removeEventListener("selectionchange",e.input.hideSelectionGuard),h=(g=e.domSelectionRange()).anchorNode,i=g.anchorOffset,f.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(g.anchorNode!=h||g.anchorOffset!=i)&&(f.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!av(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})))}a.domObserver.setCurSelection(),a.domObserver.connectSelection()}}let ax=E||C&&D<63;function ay(a,b){let{node:c,offset:d}=a.docView.domFromPos(b,0),e=d<c.childNodes.length?c.childNodes[d]:null,f=d?c.childNodes[d-1]:null;if(E&&e&&"false"==e.contentEditable)return az(e);if((!e||"false"==e.contentEditable)&&(!f||"false"==f.contentEditable)){if(e)return az(e);else if(f)return az(f)}}function az(a){return a.contentEditable="true",E&&a.draggable&&(a.draggable=!1,a.wasDraggable=!0),a}function aA(a){a.contentEditable="false",a.wasDraggable&&(a.draggable=!0,a.wasDraggable=null)}function aB(a,b){if(b instanceof d.nh){let c=a.docView.descAt(b.from);c!=a.lastSelectedViewDesc&&(aC(a),c&&c.selectNode(),a.lastSelectedViewDesc=c)}else aC(a)}function aC(a){a.lastSelectedViewDesc&&(a.lastSelectedViewDesc.parent&&a.lastSelectedViewDesc.deselectNode(),a.lastSelectedViewDesc=void 0)}function aD(a,b,c,e){return a.someProp("createSelectionBetween",d=>d(a,b,c))||d.U3.between(b,c,e)}function aE(a){return(!a.editable||!!a.hasFocus())&&aF(a)}function aF(a){let b=a.domSelectionRange();if(!b.anchorNode)return!1;try{return a.dom.contains(3==b.anchorNode.nodeType?b.anchorNode.parentNode:b.anchorNode)&&(a.editable||a.dom.contains(3==b.focusNode.nodeType?b.focusNode.parentNode:b.focusNode))}catch(a){return!1}}function aG(a,b){let{$anchor:c,$head:e}=a.selection,f=b>0?c.max(e):c.min(e),g=f.parent.inlineContent?f.depth?a.doc.resolve(b>0?f.after():f.before()):null:f;return g&&d.LN.findFrom(g,b)}function aH(a,b){return a.dispatch(a.state.tr.setSelection(b).scrollIntoView()),!0}function aI(a,b,c){let e=a.state.selection;if(e instanceof d.U3){if(c.indexOf("s")>-1){let{$head:c}=e,f=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter;if(!f||f.isText||!f.isLeaf)return!1;let g=a.state.doc.resolve(c.pos+f.nodeSize*(b<0?-1:1));return aH(a,new d.U3(e.$anchor,g))}else if(!e.empty)return!1;else if(a.endOfTextblock(b>0?"forward":"backward")){let c=aG(a.state,b);return!!c&&c instanceof d.nh&&aH(a,c)}else if(!(G&&c.indexOf("m")>-1)){let c=e.$head,f=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter,g;if(!f||f.isText)return!1;let h=b<0?c.pos-f.nodeSize:c.pos;return!!(f.isAtom||(g=a.docView.descAt(h))&&!g.contentDOM)&&(d.nh.isSelectable(f)?aH(a,new d.nh(b<0?a.state.doc.resolve(c.pos-f.nodeSize):c)):!!J&&aH(a,new d.U3(a.state.doc.resolve(b<0?h:h+f.nodeSize))))}}else{if(e instanceof d.nh&&e.node.isInline)return aH(a,new d.U3(b>0?e.$to:e.$from));let c=aG(a.state,b);return!!c&&aH(a,c)}}function aJ(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function aK(a,b){let c=a.pmViewDesc;return c&&0==c.size&&(b<0||a.nextSibling||"BR"!=a.nodeName)}function aL(a,b){return b<0?function(a){let b=a.domSelectionRange(),c=b.focusNode,d=b.focusOffset;if(!c)return;let e,f,h=!1;for(A&&1==c.nodeType&&d<aJ(c)&&aK(c.childNodes[d],-1)&&(h=!0);;)if(d>0)if(1!=c.nodeType)break;else{let a=c.childNodes[d-1];if(aK(a,-1))e=c,f=--d;else if(3==a.nodeType)d=(c=a).nodeValue.length;else break}else if(aM(c))break;else{let b=c.previousSibling;for(;b&&aK(b,-1);)e=c.parentNode,f=g(b),b=b.previousSibling;if(b)d=aJ(c=b);else{if((c=c.parentNode)==a.dom)break;d=0}}h?aN(a,c,d):e&&aN(a,e,f)}(a):function(a){let b,c,d=a.domSelectionRange(),e=d.focusNode,f=d.focusOffset;if(!e)return;let h=aJ(e);for(;;)if(f<h){if(1!=e.nodeType)break;if(aK(e.childNodes[f],1))b=e,c=++f;else break}else if(aM(e))break;else{let d=e.nextSibling;for(;d&&aK(d,1);)b=d.parentNode,c=g(d)+1,d=d.nextSibling;if(d)f=0,h=aJ(e=d);else{if((e=e.parentNode)==a.dom)break;f=h=0}}b&&aN(a,b,c)}(a)}function aM(a){let b=a.pmViewDesc;return b&&b.node&&b.node.isBlock}function aN(a,b,c){if(3!=b.nodeType){let a,d;(d=function(a,b){for(;a&&b==a.childNodes.length&&!p(a);)b=g(a)+1,a=a.parentNode;for(;a&&b<a.childNodes.length;){let c=a.childNodes[b];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;a=c,b=0}}(b,c))?(b=d,c=0):(a=function(a,b){for(;a&&!b&&!p(a);)b=g(a),a=a.parentNode;for(;a&&b;){let c=a.childNodes[b-1];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;b=(a=c).childNodes.length}}(b,c))&&(b=a,c=a.nodeValue.length)}let d=a.domSelection();if(!d)return;if(q(d)){let a=document.createRange();a.setEnd(b,c),a.setStart(b,c),d.removeAllRanges(),d.addRange(a)}else d.extend&&d.extend(b,c);a.domObserver.setCurSelection();let{state:e}=a;setTimeout(()=>{a.state==e&&aw(a)},50)}function aO(a,b){let c=a.state.doc.resolve(b);if(!(C||H)&&c.parent.inlineContent){let d=a.coordsAtPos(b);if(b>c.start()){let c=a.coordsAtPos(b-1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left<d.left?"ltr":"rtl"}if(b<c.end()){let c=a.coordsAtPos(b+1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left>d.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(a.dom).direction?"rtl":"ltr"}function aP(a,b,c){let e=a.state.selection;if(e instanceof d.U3&&!e.empty||c.indexOf("s")>-1||G&&c.indexOf("m")>-1)return!1;let{$from:f,$to:g}=e;if(!f.parent.inlineContent||a.endOfTextblock(b<0?"up":"down")){let c=aG(a.state,b);if(c&&c instanceof d.nh)return aH(a,c)}if(!f.parent.inlineContent){let c=b<0?f:g,h=e instanceof d.i5?d.LN.near(c,b):d.LN.findFrom(c,b);return!!h&&aH(a,h)}return!1}function aQ(a,b){if(!(a.state.selection instanceof d.U3))return!0;let{$head:c,$anchor:e,empty:f}=a.state.selection;if(!c.sameParent(e))return!0;if(!f)return!1;if(a.endOfTextblock(b>0?"forward":"backward"))return!0;let g=!c.textOffset&&(b<0?c.nodeBefore:c.nodeAfter);if(g&&!g.isText){let d=a.state.tr;return b<0?d.delete(c.pos-g.nodeSize,c.pos):d.delete(c.pos,c.pos+g.nodeSize),a.dispatch(d),!0}return!1}function aR(a,b,c){a.domObserver.stop(),b.contentEditable=c,a.domObserver.start()}function aS(a,b){a.someProp("transformCopied",c=>{b=c(b,a)});let c=[],{content:d,openStart:f,openEnd:g}=b;for(;f>1&&g>1&&1==d.childCount&&1==d.firstChild.childCount;){f--,g--;let a=d.firstChild;c.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),d=a.content}let h=a.someProp("clipboardSerializer")||e.ZF.fromSchema(a.state.schema),i=a$(),j=i.createElement("div");j.appendChild(h.serializeFragment(d,{document:i}));let k=j.firstChild,l,m=0;for(;k&&1==k.nodeType&&(l=aY[k.nodeName.toLowerCase()]);){for(let a=l.length-1;a>=0;a--){let b=i.createElement(l[a]);for(;j.firstChild;)b.appendChild(j.firstChild);j.appendChild(b),m++}k=j.firstChild}return k&&1==k.nodeType&&k.setAttribute("data-pm-slice",`${f} ${g}${m?` -${m}`:""} ${JSON.stringify(c)}`),{dom:j,text:a.someProp("clipboardTextSerializer",c=>c(b,a))||b.content.textBetween(0,b.content.size,"\n\n"),slice:b}}function aT(a,b,c,d,f){let g,h,i=f.parent.type.spec.code;if(!c&&!b)return null;let j=!!b&&(d||i||!c);if(j){if(a.someProp("transformPastedText",c=>{b=c(b,i||d,a)}),i)return h=new e.Ji(e.FK.from(a.state.schema.text(b.replace(/\r\n?/g,"\n"))),0,0),a.someProp("transformPasted",b=>{h=b(h,a,!0)}),h;let c=a.someProp("clipboardTextParser",c=>c(b,f,d,a));if(c)h=c;else{let c=f.marks(),{schema:d}=a.state,h=e.ZF.fromSchema(d);g=document.createElement("div"),b.split(/(?:\r\n?|\n)+/).forEach(a=>{let b=g.appendChild(document.createElement("p"));a&&b.appendChild(h.serializeNode(d.text(a,c)))})}}else a.someProp("transformPastedHTML",b=>{c=b(c,a)}),g=function(a){var b;let c,d=/^(\s*<meta [^>]*>)*/.exec(a);d&&(a=a.slice(d[0].length));let e=a$().createElement("div"),f=/<([a-z][^>\s]+)/i.exec(a),g;if((g=f&&aY[f[1].toLowerCase()])&&(a=g.map(a=>"<"+a+">").join("")+a+g.map(a=>"</"+a+">").reverse().join("")),e.innerHTML=(b=a,(c=window.trustedTypes)?(a_||(a_=c.defaultPolicy||c.createPolicy("ProseMirrorClipboard",{createHTML:a=>a})),a_.createHTML(b)):b),g)for(let a=0;a<g.length;a++)e=e.querySelector(g[a])||e;return e}(c),J&&function(a){let b=a.querySelectorAll(C?"span:not([class]):not([style])":"span.Apple-converted-space");for(let c=0;c<b.length;c++){let d=b[c];1==d.childNodes.length&&"\xa0"==d.textContent&&d.parentNode&&d.parentNode.replaceChild(a.ownerDocument.createTextNode(" "),d)}}(g);let k=g&&g.querySelector("[data-pm-slice]"),l=k&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(k.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let a=+l[3];a>0;a--){let a=g.firstChild;for(;a&&1!=a.nodeType;)a=a.nextSibling;if(!a)break;g=a}if(h||(h=(a.someProp("clipboardParser")||a.someProp("domParser")||e.S4.fromSchema(a.state.schema)).parseSlice(g,{preserveWhitespace:!!(j||l),context:f,ruleFromNode:a=>"BR"!=a.nodeName||a.nextSibling||!a.parentNode||aU.test(a.parentNode.nodeName)?null:{ignore:!0}})),l)h=function(a,b){if(!a.size)return a;let c=a.content.firstChild.type.schema,d;try{d=JSON.parse(b)}catch(b){return a}let{content:f,openStart:g,openEnd:h}=a;for(let a=d.length-2;a>=0;a-=2){let b=c.nodes[d[a]];if(!b||b.hasRequiredAttrs())break;f=e.FK.from(b.create(d[a+1],f)),g++,h++}return new e.Ji(f,g,h)}(aX(h,+l[1],+l[2]),l[4]);else if((h=e.Ji.maxOpen(function(a,b){if(a.childCount<2)return a;for(let c=b.depth;c>=0;c--){let d=b.node(c).contentMatchAt(b.index(c)),f,g=[];if(a.forEach(a=>{if(!g)return;let b=d.findWrapping(a.type),c;if(!b)return g=null;if(c=g.length&&f.length&&function a(b,c,d,f,g){if(g<b.length&&g<c.length&&b[g]==c[g]){let h=a(b,c,d,f.lastChild,g+1);if(h)return f.copy(f.content.replaceChild(f.childCount-1,h));if(f.contentMatchAt(f.childCount).matchType(g==b.length-1?d.type:b[g+1]))return f.copy(f.content.append(e.FK.from(aV(d,b,g+1))))}}(b,f,a,g[g.length-1],0))g[g.length-1]=c;else{g.length&&(g[g.length-1]=function a(b,c){if(0==c)return b;let d=b.content.replaceChild(b.childCount-1,a(b.lastChild,c-1)),f=b.contentMatchAt(b.childCount).fillBefore(e.FK.empty,!0);return b.copy(d.append(f))}(g[g.length-1],f.length));let c=aV(a,b);g.push(c),d=d.matchType(c.type),f=b}}),g)return e.FK.from(g)}return a}(h.content,f),!0)).openStart||h.openEnd){let a=0,b=0;for(let b=h.content.firstChild;a<h.openStart&&!b.type.spec.isolating;a++,b=b.firstChild);for(let a=h.content.lastChild;b<h.openEnd&&!a.type.spec.isolating;b++,a=a.lastChild);h=aX(h,a,b)}return a.someProp("transformPasted",b=>{h=b(h,a,j)}),h}let aU=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function aV(a,b,c=0){for(let d=b.length-1;d>=c;d--)a=b[d].create(null,e.FK.from(a));return a}function aW(a,b,c,d,f,g){let h=b<0?a.firstChild:a.lastChild,i=h.content;return a.childCount>1&&(g=0),f<d-1&&(i=aW(i,b,c,d,f+1,g)),f>=c&&(i=b<0?h.contentMatchAt(0).fillBefore(i,g<=f).append(i):i.append(h.contentMatchAt(h.childCount).fillBefore(e.FK.empty,!0))),a.replaceChild(b<0?0:a.childCount-1,h.copy(i))}function aX(a,b,c){return b<a.openStart&&(a=new e.Ji(aW(a.content,-1,b,a.openStart,0,a.openEnd),b,a.openEnd)),c<a.openEnd&&(a=new e.Ji(aW(a.content,1,c,a.openEnd,0,0),a.openStart,c)),a}let aY={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},aZ=null;function a$(){return aZ||(aZ=document.implementation.createHTMLDocument("title"))}let a_=null,a0={},a1={},a2={touchstart:!0,touchmove:!0};class a3{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function a4(a,b){a.input.lastSelectionOrigin=b,a.input.lastSelectionTime=Date.now()}function a5(a){a.someProp("handleDOMEvents",b=>{for(let c in b)a.input.eventHandlers[c]||a.dom.addEventListener(c,a.input.eventHandlers[c]=b=>a6(a,b))})}function a6(a,b){return a.someProp("handleDOMEvents",c=>{let d=c[b.type];return!!d&&(d(a,b)||b.defaultPrevented)})}function a7(a){return{left:a.clientX,top:a.clientY}}function a8(a,b,c,d,e){if(-1==d)return!1;let f=a.state.doc.resolve(d);for(let d=f.depth+1;d>0;d--)if(a.someProp(b,b=>d>f.depth?b(a,c,f.nodeAfter,f.before(d),e,!0):b(a,c,f.node(d),f.before(d),e,!1)))return!0;return!1}function a9(a,b,c){if(a.focused||a.focus(),a.state.selection.eq(b))return;let d=a.state.tr.setSelection(b);"pointer"==c&&d.setMeta("pointer",!0),a.dispatch(d)}a1.keydown=(a,b)=>{if((a.input.shiftKey=16==b.keyCode||b.shiftKey,!bc(a,b))&&(a.input.lastKeyCode=b.keyCode,a.input.lastKeyCodeTime=Date.now(),!I||!C||13!=b.keyCode))if(229!=b.keyCode&&a.domObserver.forceFlush(),!F||13!=b.keyCode||b.ctrlKey||b.altKey||b.metaKey)a.someProp("handleKeyDown",c=>c(a,b))||function(a,b){let c,d=b.keyCode,e=(c="",b.ctrlKey&&(c+="c"),b.metaKey&&(c+="m"),b.altKey&&(c+="a"),b.shiftKey&&(c+="s"),c);if(8==d||G&&72==d&&"c"==e)return aQ(a,-1)||aL(a,-1);if(46==d&&!b.shiftKey||G&&68==d&&"c"==e)return aQ(a,1)||aL(a,1);if(13==d||27==d)return!0;if(37==d||G&&66==d&&"c"==e){let b=37==d?"ltr"==aO(a,a.state.selection.from)?-1:1:-1;return aI(a,b,e)||aL(a,b)}if(39==d||G&&70==d&&"c"==e){let b=39==d?"ltr"==aO(a,a.state.selection.from)?1:-1:1;return aI(a,b,e)||aL(a,b)}else if(38==d||G&&80==d&&"c"==e)return aP(a,-1,e)||aL(a,-1);else if(40==d||G&&78==d&&"c"==e)return function(a){if(!E||a.state.selection.$head.parentOffset>0)return!1;let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(b&&1==b.nodeType&&0==c&&b.firstChild&&"false"==b.firstChild.contentEditable){let c=b.firstChild;aR(a,c,"true"),setTimeout(()=>aR(a,c,"false"),20)}return!1}(a)||aP(a,1,e)||aL(a,1);else if(e==(G?"m":"c")&&(66==d||73==d||89==d||90==d))return!0;return!1}(a,b)?b.preventDefault():a4(a,"key");else{let b=Date.now();a.input.lastIOSEnter=b,a.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{a.input.lastIOSEnter==b&&(a.someProp("handleKeyDown",b=>b(a,r(13,"Enter"))),a.input.lastIOSEnter=0)},200)}},a1.keyup=(a,b)=>{16==b.keyCode&&(a.input.shiftKey=!1)},a1.keypress=(a,b)=>{if(bc(a,b)||!b.charCode||b.ctrlKey&&!b.altKey||G&&b.metaKey)return;if(a.someProp("handleKeyPress",c=>c(a,b)))return void b.preventDefault();let c=a.state.selection;if(!(c instanceof d.U3)||!c.$from.sameParent(c.$to)){let d=String.fromCharCode(b.charCode),e=()=>a.state.tr.insertText(d).scrollIntoView();/[\r\n]/.test(d)||a.someProp("handleTextInput",b=>b(a,c.$from.pos,c.$to.pos,d,e))||a.dispatch(e()),b.preventDefault()}};let ba=G?"metaKey":"ctrlKey";a0.mousedown=(a,b)=>{a.input.shiftKey=b.shiftKey;let c=bg(a),e=Date.now(),f="singleClick";e-a.input.lastClick.time<500&&function(a,b){let c=b.x-a.clientX,d=b.y-a.clientY;return c*c+d*d<100}(b,a.input.lastClick)&&!b[ba]&&a.input.lastClick.button==b.button&&("singleClick"==a.input.lastClick.type?f="doubleClick":"doubleClick"==a.input.lastClick.type&&(f="tripleClick")),a.input.lastClick={time:e,x:b.clientX,y:b.clientY,type:f,button:b.button};let g=a.posAtCoords(a7(b));g&&("singleClick"==f?(a.input.mouseDown&&a.input.mouseDown.done(),a.input.mouseDown=new bb(a,g,b,!!c)):("doubleClick"==f?function(a,b,c,d){return a8(a,"handleDoubleClickOn",b,c,d)||a.someProp("handleDoubleClick",c=>c(a,b,d))}:function(a,b,c,e){return a8(a,"handleTripleClickOn",b,c,e)||a.someProp("handleTripleClick",c=>c(a,b,e))||function(a,b,c){if(0!=c.button)return!1;let e=a.state.doc;if(-1==b)return!!e.inlineContent&&(a9(a,d.U3.create(e,0,e.content.size),"pointer"),!0);let f=e.resolve(b);for(let b=f.depth+1;b>0;b--){let c=b>f.depth?f.nodeAfter:f.node(b),g=f.before(b);if(c.inlineContent)a9(a,d.U3.create(e,g+1,g+1+c.content.size),"pointer");else{if(!d.nh.isSelectable(c))continue;a9(a,d.nh.create(e,g),"pointer")}return!0}}(a,c,e)})(a,g.pos,g.inside,b)?b.preventDefault():a4(a,"pointer"))};class bb{constructor(a,b,c,e){let f,g;if(this.view=a,this.pos=b,this.event=c,this.flushed=e,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=a.state.doc,this.selectNode=!!c[ba],this.allowDefault=c.shiftKey,b.inside>-1)f=a.state.doc.nodeAt(b.inside),g=b.inside;else{let c=a.state.doc.resolve(b.pos);f=c.parent,g=c.depth?c.before():0}let h=e?null:c.target,i=h?a.docView.nearestDesc(h,!0):null;this.target=i&&1==i.nodeDOM.nodeType?i.nodeDOM:null;let{selection:j}=a.state;(0==c.button&&f.type.spec.draggable&&!1!==f.type.spec.selectable||j instanceof d.nh&&j.from<=g&&j.to>g)&&(this.mightDrag={node:f,pos:g,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&A&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),a.root.addEventListener("mouseup",this.up=this.up.bind(this)),a.root.addEventListener("mousemove",this.move=this.move.bind(this)),a4(a,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>aw(this.view)),this.view.input.mouseDown=null}up(a){if(this.done(),!this.view.dom.contains(a.target))return;let b=this.pos;if(this.view.state.doc!=this.startDoc&&(b=this.view.posAtCoords(a7(a))),this.updateAllowDefault(a),this.allowDefault||!b)a4(this.view,"pointer");else{var c,e,f,g;(c=this.view,e=b.pos,f=b.inside,g=this.selectNode,a8(c,"handleClickOn",e,f,a)||c.someProp("handleClick",b=>b(c,e,a))||(g?function(a,b){if(-1==b)return!1;let c=a.state.selection,e,f;c instanceof d.nh&&(e=c.node);let g=a.state.doc.resolve(b);for(let a=g.depth+1;a>0;a--){let b=a>g.depth?g.nodeAfter:g.node(a);if(d.nh.isSelectable(b)){f=e&&c.$from.depth>0&&a>=c.$from.depth&&g.before(c.$from.depth+1)==c.$from.pos?g.before(c.$from.depth):g.before(a);break}}return null!=f&&(a9(a,d.nh.create(a.state.doc,f),"pointer"),!0)}(c,f):function(a,b){if(-1==b)return!1;let c=a.state.doc.resolve(b),e=c.nodeAfter;return!!(e&&e.isAtom&&d.nh.isSelectable(e))&&(a9(a,new d.nh(c),"pointer"),!0)}(c,f)))?a.preventDefault():0==a.button&&(this.flushed||E&&this.mightDrag&&!this.mightDrag.node.isAtom||C&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(b.pos-this.view.state.selection.from),Math.abs(b.pos-this.view.state.selection.to)))?(a9(this.view,d.LN.near(this.view.state.doc.resolve(b.pos)),"pointer"),a.preventDefault()):a4(this.view,"pointer")}}move(a){this.updateAllowDefault(a),a4(this.view,"pointer"),0==a.buttons&&this.done()}updateAllowDefault(a){!this.allowDefault&&(Math.abs(this.event.x-a.clientX)>4||Math.abs(this.event.y-a.clientY)>4)&&(this.allowDefault=!0)}}function bc(a,b){return!!a.composing||!!(E&&500>Math.abs(b.timeStamp-a.input.compositionEndedAt))&&(a.input.compositionEndedAt=-2e8,!0)}a0.touchstart=a=>{a.input.lastTouch=Date.now(),bg(a),a4(a,"pointer")},a0.touchmove=a=>{a.input.lastTouch=Date.now(),a4(a,"pointer")},a0.contextmenu=a=>bg(a);let bd=I?5e3:-1;function be(a,b){clearTimeout(a.input.composingTimeout),b>-1&&(a.input.composingTimeout=setTimeout(()=>bg(a),b))}function bf(a){let b;for(a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=((b=document.createEvent("Event")).initEvent("event",!0,!0),b.timeStamp));a.input.compositionNodes.length>0;)a.input.compositionNodes.pop().markParentsDirty()}function bg(a,b=!1){if(!I||!(a.domObserver.flushingSoon>=0)){if(a.domObserver.forceFlush(),bf(a),b||a.docView&&a.docView.dirty){let c=au(a),d=a.state.selection;return c&&!c.eq(d)?a.dispatch(a.state.tr.setSelection(c)):(a.markCursor||b)&&!d.$from.node(d.$from.sharedDepth(d.to)).inlineContent?a.dispatch(a.state.tr.deleteSelection()):a.updateState(a.state),!0}return!1}}a1.compositionstart=a1.compositionupdate=a=>{if(!a.composing){a.domObserver.flush();let{state:b}=a,c=b.selection.$to;if(b.selection instanceof d.U3&&(b.storedMarks||!c.textOffset&&c.parentOffset&&c.nodeBefore.marks.some(a=>!1===a.type.spec.inclusive)||C&&H&&function(a){let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(!b||1!=b.nodeType||c>=b.childNodes.length)return!1;let d=b.childNodes[c];return 1==d.nodeType&&"false"==d.contentEditable}(a)))a.markCursor=a.state.storedMarks||c.marks(),bg(a,!0),a.markCursor=null;else if(bg(a,!b.selection.empty),A&&b.selection.empty&&c.parentOffset&&!c.textOffset&&c.nodeBefore.marks.length){let b=a.domSelectionRange();for(let c=b.focusNode,d=b.focusOffset;c&&1==c.nodeType&&0!=d;){let b=d<0?c.lastChild:c.childNodes[d-1];if(!b)break;if(3==b.nodeType){let c=a.domSelection();c&&c.collapse(b,b.nodeValue.length);break}c=b,d=-1}}a.input.composing=!0}be(a,bd)},a1.compositionend=(a,b)=>{a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=b.timeStamp,a.input.compositionPendingChanges=a.domObserver.pendingRecords().length?a.input.compositionID:0,a.input.compositionNode=null,a.input.badSafariComposition?a.domObserver.forceFlush():a.input.compositionPendingChanges&&Promise.resolve().then(()=>a.domObserver.flush()),a.input.compositionID++,be(a,20))};let bh=y&&z<15||F&&K<604;function bi(a,b,c,d,f){let g=aT(a,b,c,d,a.state.selection.$from);if(a.someProp("handlePaste",b=>b(a,f,g||e.Ji.empty)))return!0;if(!g)return!1;let h=0==g.openStart&&0==g.openEnd&&1==g.content.childCount?g.content.firstChild:null,i=h?a.state.tr.replaceSelectionWith(h,d):a.state.tr.replaceSelection(g);return a.dispatch(i.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bj(a){let b=a.getData("text/plain")||a.getData("Text");if(b)return b;let c=a.getData("text/uri-list");return c?c.replace(/\r?\n/g," "):""}a0.copy=a1.cut=(a,b)=>{let c=a.state.selection,d="cut"==b.type;if(c.empty)return;let e=bh?null:b.clipboardData,{dom:f,text:g}=aS(a,c.content());e?(b.preventDefault(),e.clearData(),e.setData("text/html",f.innerHTML),e.setData("text/plain",g)):function(a,b){if(!a.dom.parentNode)return;let c=a.dom.parentNode.appendChild(document.createElement("div"));c.appendChild(b),c.style.cssText="position: fixed; left: -10000px; top: 10px";let d=getSelection(),e=document.createRange();e.selectNodeContents(b),a.dom.blur(),d.removeAllRanges(),d.addRange(e),setTimeout(()=>{c.parentNode&&c.parentNode.removeChild(c),a.focus()},50)}(a,f),d&&a.dispatch(a.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},a1.paste=(a,b)=>{if(a.composing&&!I)return;let c=bh?null:b.clipboardData,d=a.input.shiftKey&&45!=a.input.lastKeyCode;c&&bi(a,bj(c),c.getData("text/html"),d,b)?b.preventDefault():function(a,b){if(!a.dom.parentNode)return;let c=a.input.shiftKey||a.state.selection.$from.parent.type.spec.code,d=a.dom.parentNode.appendChild(document.createElement(c?"textarea":"div"));c||(d.contentEditable="true"),d.style.cssText="position: fixed; left: -10000px; top: 10px",d.focus();let e=a.input.shiftKey&&45!=a.input.lastKeyCode;setTimeout(()=>{a.focus(),d.parentNode&&d.parentNode.removeChild(d),c?bi(a,d.value,null,e,b):bi(a,d.textContent,d.innerHTML,e,b)},50)}(a,b)};class bk{constructor(a,b,c){this.slice=a,this.move=b,this.node=c}}let bl=G?"altKey":"ctrlKey";function bm(a,b){let c=a.someProp("dragCopies",a=>!a(b));return null!=c?c:!b[bl]}for(let a in a0.dragstart=(a,b)=>{let c,e=a.input.mouseDown;if(e&&e.done(),!b.dataTransfer)return;let f=a.state.selection,g=f.empty?null:a.posAtCoords(a7(b));if(g&&g.pos>=f.from&&g.pos<=(f instanceof d.nh?f.to-1:f.to));else if(e&&e.mightDrag)c=d.nh.create(a.state.doc,e.mightDrag.pos);else if(b.target&&1==b.target.nodeType){let e=a.docView.nearestDesc(b.target,!0);e&&e.node.type.spec.draggable&&e!=a.docView&&(c=d.nh.create(a.state.doc,e.posBefore))}let h=(c||a.state.selection).content(),{dom:i,text:j,slice:k}=aS(a,h);b.dataTransfer.files.length&&C&&!(D>120)||b.dataTransfer.clearData(),b.dataTransfer.setData(bh?"Text":"text/html",i.innerHTML),b.dataTransfer.effectAllowed="copyMove",bh||b.dataTransfer.setData("text/plain",j),a.dragging=new bk(k,bm(a,b),c)},a0.dragend=a=>{let b=a.dragging;window.setTimeout(()=>{a.dragging==b&&(a.dragging=null)},50)},a1.dragover=a1.dragenter=(a,b)=>b.preventDefault(),a1.drop=(a,b)=>{try{!function(a,b,c){if(!b.dataTransfer)return;let g=a.posAtCoords(a7(b));if(!g)return;let h=a.state.doc.resolve(g.pos),i=c&&c.slice;i?a.someProp("transformPasted",b=>{i=b(i,a,!1)}):i=aT(a,bj(b.dataTransfer),bh?null:b.dataTransfer.getData("text/html"),!1,h);let j=!!(c&&bm(a,b));if(a.someProp("handleDrop",c=>c(a,b,i||e.Ji.empty,j)))return b.preventDefault();if(!i)return;b.preventDefault();let k=i?(0,f.Um)(a.state.doc,h.pos,i):h.pos;null==k&&(k=h.pos);let l=a.state.tr;if(j){let{node:a}=c;a?a.replace(l):l.deleteSelection()}let m=l.mapping.map(k),n=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,o=l.doc;if(n?l.replaceRangeWith(m,m,i.content.firstChild):l.replaceRange(m,m,i),l.doc.eq(o))return;let p=l.doc.resolve(m);if(n&&d.nh.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new d.nh(p));else{let b=l.mapping.map(k);l.mapping.maps[l.mapping.maps.length-1].forEach((a,c,d,e)=>b=e),l.setSelection(aD(a,p,l.doc.resolve(b)))}a.focus(),a.dispatch(l.setMeta("uiEvent","drop"))}(a,b,a.dragging)}finally{a.dragging=null}},a0.focus=a=>{a.input.lastFocus=Date.now(),a.focused||(a.domObserver.stop(),a.dom.classList.add("ProseMirror-focused"),a.domObserver.start(),a.focused=!0,setTimeout(()=>{a.docView&&a.hasFocus()&&!a.domObserver.currentSelection.eq(a.domSelectionRange())&&aw(a)},20))},a0.blur=(a,b)=>{a.focused&&(a.domObserver.stop(),a.dom.classList.remove("ProseMirror-focused"),a.domObserver.start(),b.relatedTarget&&a.dom.contains(b.relatedTarget)&&a.domObserver.currentSelection.clear(),a.focused=!1)},a0.beforeinput=(a,b)=>{if(C&&I&&"deleteContentBackward"==b.inputType){a.domObserver.flushSoon();let{domChangeCount:b}=a.input;setTimeout(()=>{if(a.input.domChangeCount!=b||(a.dom.blur(),a.focus(),a.someProp("handleKeyDown",b=>b(a,r(8,"Backspace")))))return;let{$cursor:c}=a.state.selection;c&&c.pos>0&&a.dispatch(a.state.tr.delete(c.pos-1,c.pos).scrollIntoView())},50)}},a1)a0[a]=a1[a];function bn(a,b){if(a==b)return!0;for(let c in a)if(a[c]!==b[c])return!1;for(let c in b)if(!(c in a))return!1;return!0}class bo{constructor(a,b){this.toDOM=a,this.spec=b||bt,this.side=this.spec.side||0}map(a,b,c,d){let{pos:e,deleted:f}=a.mapResult(b.from+d,this.side<0?-1:1);return f?null:new br(e-c,e-c,this)}valid(){return!0}eq(a){return this==a||a instanceof bo&&(this.spec.key&&this.spec.key==a.spec.key||this.toDOM==a.toDOM&&bn(this.spec,a.spec))}destroy(a){this.spec.destroy&&this.spec.destroy(a)}}class bp{constructor(a,b){this.attrs=a,this.spec=b||bt}map(a,b,c,d){let e=a.map(b.from+d,this.spec.inclusiveStart?-1:1)-c,f=a.map(b.to+d,this.spec.inclusiveEnd?1:-1)-c;return e>=f?null:new br(e,f,this)}valid(a,b){return b.from<b.to}eq(a){return this==a||a instanceof bp&&bn(this.attrs,a.attrs)&&bn(this.spec,a.spec)}static is(a){return a.type instanceof bp}destroy(){}}class bq{constructor(a,b){this.attrs=a,this.spec=b||bt}map(a,b,c,d){let e=a.mapResult(b.from+d,1);if(e.deleted)return null;let f=a.mapResult(b.to+d,-1);return f.deleted||f.pos<=e.pos?null:new br(e.pos-c,f.pos-c,this)}valid(a,b){let{index:c,offset:d}=a.content.findIndex(b.from),e;return d==b.from&&!(e=a.child(c)).isText&&d+e.nodeSize==b.to}eq(a){return this==a||a instanceof bq&&bn(this.attrs,a.attrs)&&bn(this.spec,a.spec)}destroy(){}}class br{constructor(a,b,c){this.from=a,this.to=b,this.type=c}copy(a,b){return new br(a,b,this.type)}eq(a,b=0){return this.type.eq(a.type)&&this.from+b==a.from&&this.to+b==a.to}map(a,b,c){return this.type.map(a,this,b,c)}static widget(a,b,c){return new br(a,a,new bo(b,c))}static inline(a,b,c,d){return new br(a,b,new bp(c,d))}static node(a,b,c,d){return new br(a,b,new bq(c,d))}get spec(){return this.type.spec}get inline(){return this.type instanceof bp}get widget(){return this.type instanceof bo}}let bs=[],bt={};class bu{constructor(a,b){this.local=a.length?a:bs,this.children=b.length?b:bs}static create(a,b){return b.length?bA(b,a,0,bt):bv}find(a,b,c){let d=[];return this.findInner(null==a?0:a,null==b?1e9:b,d,0,c),d}findInner(a,b,c,d,e){for(let f=0;f<this.local.length;f++){let g=this.local[f];g.from<=b&&g.to>=a&&(!e||e(g.spec))&&c.push(g.copy(g.from+d,g.to+d))}for(let f=0;f<this.children.length;f+=3)if(this.children[f]<b&&this.children[f+1]>a){let g=this.children[f]+1;this.children[f+2].findInner(a-g,b-g,c,d+g,e)}}map(a,b,c){return this==bv||0==a.maps.length?this:this.mapInner(a,b,0,0,c||bt)}mapInner(a,b,c,d,e){let f;for(let g=0;g<this.local.length;g++){let h=this.local[g].map(a,c,d);h&&h.type.valid(b,h)?(f||(f=[])).push(h):e.onRemove&&e.onRemove(this.local[g].spec)}return this.children.length?function(a,b,c,d,e,f,g){let h=a.slice();for(let a=0,b=f;a<c.maps.length;a++){let d=0;c.maps[a].forEach((a,c,e,f)=>{let g=f-e-(c-a);for(let e=0;e<h.length;e+=3){let f=h[e+1];if(f<0||a>f+b-d)continue;let i=h[e]+b-d;c>=i?h[e+1]=a<=i?-2:-1:a>=b&&g&&(h[e]+=g,h[e+1]+=g)}d+=g}),b=c.maps[a].map(b,-1)}let i=!1;for(let b=0;b<h.length;b+=3)if(h[b+1]<0){if(-2==h[b+1]){i=!0,h[b+1]=-1;continue}let j=c.map(a[b]+f),k=j-e;if(k<0||k>=d.content.size){i=!0;continue}let l=c.map(a[b+1]+f,-1)-e,{index:m,offset:n}=d.content.findIndex(k),o=d.maybeChild(m);if(o&&n==k&&n+o.nodeSize==l){let d=h[b+2].mapInner(c,o,j+1,a[b]+f+1,g);d!=bv?(h[b]=k,h[b+1]=l,h[b+2]=d):(h[b+1]=-2,i=!0)}else i=!0}if(i){let i=bA(function(a,b,c,d,e,f,g){for(let h=0;h<a.length;h+=3)-1==a[h+1]&&function a(b,f){for(let a=0;a<b.local.length;a++){let h=b.local[a].map(d,e,f);h?c.push(h):g.onRemove&&g.onRemove(b.local[a].spec)}for(let c=0;c<b.children.length;c+=3)a(b.children[c+2],b.children[c]+f+1)}(a[h+2],b[h]+f+1);return c}(h,a,b,c,e,f,g),d,0,g);b=i.local;for(let a=0;a<h.length;a+=3)h[a+1]<0&&(h.splice(a,3),a-=3);for(let a=0,b=0;a<i.children.length;a+=3){let c=i.children[a];for(;b<h.length&&h[b]<c;)b+=3;h.splice(b,0,i.children[a],i.children[a+1],i.children[a+2])}}return new bu(b.sort(bB),h)}(this.children,f||[],a,b,c,d,e):f?new bu(f.sort(bB),bs):bv}add(a,b){return b.length?this==bv?bu.create(a,b):this.addInner(a,b,0):this}addInner(a,b,c){let d,e=0;a.forEach((a,f)=>{let g=f+c,h;if(h=by(b,a,g)){for(d||(d=this.children.slice());e<d.length&&d[e]<f;)e+=3;d[e]==f?d[e+2]=d[e+2].addInner(a,h,g+1):d.splice(e,0,f,f+a.nodeSize,bA(h,a,g+1,bt)),e+=3}});let f=bx(e?bz(b):b,-c);for(let b=0;b<f.length;b++)f[b].type.valid(a,f[b])||f.splice(b--,1);return new bu(f.length?this.local.concat(f).sort(bB):this.local,d||this.children)}remove(a){return 0==a.length||this==bv?this:this.removeInner(a,0)}removeInner(a,b){let c=this.children,d=this.local;for(let d=0;d<c.length;d+=3){let e,f=c[d]+b,g=c[d+1]+b;for(let b=0,c;b<a.length;b++)(c=a[b])&&c.from>f&&c.to<g&&(a[b]=null,(e||(e=[])).push(c));if(!e)continue;c==this.children&&(c=this.children.slice());let h=c[d+2].removeInner(e,f+1);h!=bv?c[d+2]=h:(c.splice(d,3),d-=3)}if(d.length){for(let c=0,e;c<a.length;c++)if(e=a[c])for(let a=0;a<d.length;a++)d[a].eq(e,b)&&(d==this.local&&(d=this.local.slice()),d.splice(a--,1))}return c==this.children&&d==this.local?this:d.length||c.length?new bu(d,c):bv}forChild(a,b){let c,d;if(this==bv)return this;if(b.isLeaf)return bu.empty;for(let b=0;b<this.children.length;b+=3)if(this.children[b]>=a){this.children[b]==a&&(c=this.children[b+2]);break}let e=a+1,f=e+b.content.size;for(let a=0;a<this.local.length;a++){let b=this.local[a];if(b.from<f&&b.to>e&&b.type instanceof bp){let a=Math.max(e,b.from)-e,c=Math.min(f,b.to)-e;a<c&&(d||(d=[])).push(b.copy(a,c))}}if(d){let a=new bu(d.sort(bB),bs);return c?new bw([a,c]):a}return c||bv}eq(a){if(this==a)return!0;if(!(a instanceof bu)||this.local.length!=a.local.length||this.children.length!=a.children.length)return!1;for(let b=0;b<this.local.length;b++)if(!this.local[b].eq(a.local[b]))return!1;for(let b=0;b<this.children.length;b+=3)if(this.children[b]!=a.children[b]||this.children[b+1]!=a.children[b+1]||!this.children[b+2].eq(a.children[b+2]))return!1;return!0}locals(a){return bC(this.localsInner(a))}localsInner(a){if(this==bv)return bs;if(a.inlineContent||!this.local.some(bp.is))return this.local;let b=[];for(let a=0;a<this.local.length;a++)this.local[a].type instanceof bp||b.push(this.local[a]);return b}forEachSet(a){a(this)}}bu.empty=new bu([],[]),bu.removeOverlap=bC;let bv=bu.empty;class bw{constructor(a){this.members=a}map(a,b){let c=this.members.map(c=>c.map(a,b,bt));return bw.from(c)}forChild(a,b){if(b.isLeaf)return bu.empty;let c=[];for(let d=0;d<this.members.length;d++){let e=this.members[d].forChild(a,b);e!=bv&&(e instanceof bw?c=c.concat(e.members):c.push(e))}return bw.from(c)}eq(a){if(!(a instanceof bw)||a.members.length!=this.members.length)return!1;for(let b=0;b<this.members.length;b++)if(!this.members[b].eq(a.members[b]))return!1;return!0}locals(a){let b,c=!0;for(let d=0;d<this.members.length;d++){let e=this.members[d].localsInner(a);if(e.length)if(b){c&&(b=b.slice(),c=!1);for(let a=0;a<e.length;a++)b.push(e[a])}else b=e}return b?bC(c?b:b.sort(bB)):bs}static from(a){switch(a.length){case 0:return bv;case 1:return a[0];default:return new bw(a.every(a=>a instanceof bu)?a:a.reduce((a,b)=>a.concat(b instanceof bu?b:b.members),[]))}}forEachSet(a){for(let b=0;b<this.members.length;b++)this.members[b].forEachSet(a)}}function bx(a,b){if(!b||!a.length)return a;let c=[];for(let d=0;d<a.length;d++){let e=a[d];c.push(new br(e.from+b,e.to+b,e.type))}return c}function by(a,b,c){if(b.isLeaf)return null;let d=c+b.nodeSize,e=null;for(let b=0,f;b<a.length;b++)(f=a[b])&&f.from>c&&f.to<d&&((e||(e=[])).push(f),a[b]=null);return e}function bz(a){let b=[];for(let c=0;c<a.length;c++)null!=a[c]&&b.push(a[c]);return b}function bA(a,b,c,d){let e=[],f=!1;b.forEach((b,g)=>{let h=by(a,b,g+c);if(h){f=!0;let a=bA(h,b,c+g+1,d);a!=bv&&e.push(g,g+b.nodeSize,a)}});let g=bx(f?bz(a):a,-c).sort(bB);for(let a=0;a<g.length;a++)g[a].type.valid(b,g[a])||(d.onRemove&&d.onRemove(g[a].spec),g.splice(a--,1));return g.length||e.length?new bu(g,e):bv}function bB(a,b){return a.from-b.from||a.to-b.to}function bC(a){let b=a;for(let c=0;c<b.length-1;c++){let d=b[c];if(d.from!=d.to)for(let e=c+1;e<b.length;e++){let f=b[e];if(f.from==d.from){f.to!=d.to&&(b==a&&(b=a.slice()),b[e]=f.copy(f.from,d.to),bD(b,e+1,f.copy(d.to,f.to)));continue}f.from<d.to&&(b==a&&(b=a.slice()),b[c]=d.copy(d.from,f.from),bD(b,e,d.copy(f.from,d.to)));break}}return b}function bD(a,b,c){for(;b<a.length&&bB(c,a[b])>0;)b++;a.splice(b,0,c)}function bE(a){let b=[];return a.someProp("decorations",c=>{let d=c(a.state);d&&d!=bv&&b.push(d)}),a.cursorWrapper&&b.push(bu.create(a.state.doc,[a.cursorWrapper.deco])),bw.from(b)}let bF={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},bG=y&&z<=11;class bH{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(a){this.anchorNode=a.anchorNode,this.anchorOffset=a.anchorOffset,this.focusNode=a.focusNode,this.focusOffset=a.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(a){return a.anchorNode==this.anchorNode&&a.anchorOffset==this.anchorOffset&&a.focusNode==this.focusNode&&a.focusOffset==this.focusOffset}}class bI{constructor(a,b){this.view=a,this.handleDOMChange=b,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new bH,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(b=>{for(let a=0;a<b.length;a++)this.queue.push(b[a]);y&&z<=11&&b.some(a=>"childList"==a.type&&a.removedNodes.length||"characterData"==a.type&&a.oldValue.length>a.target.nodeValue.length)?this.flushSoon():E&&a.composing&&b.some(a=>"childList"==a.type&&"TR"==a.target.nodeName)?(a.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),bG&&(this.onCharData=a=>{this.queue.push({target:a.target,type:"characterData",oldValue:a.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,bF)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let a=this.observer.takeRecords();if(a.length){for(let b=0;b<a.length;b++)this.queue.push(a[b]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(aE(this.view)){if(this.suppressingSelectionUpdates)return aw(this.view);if(y&&z<=11&&!this.view.state.selection.empty){let a=this.view.domSelectionRange();if(a.focusNode&&l(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(a){if(!a.focusNode)return!0;let b=new Set,c;for(let c=a.focusNode;c;c=h(c))b.add(c);for(let d=a.anchorNode;d;d=h(d))if(b.has(d)){c=d;break}let d=c&&this.view.docView.nearestDesc(c);if(d&&d.ignoreMutation({type:"selection",target:3==c.nodeType?c.parentNode:c}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let a of this.observer.takeRecords())this.queue.push(a);return this.queue}flush(){var a;let{view:b}=this;if(!b.docView||this.flushingSoon>-1)return;let c=this.pendingRecords();c.length&&(this.queue=[]);let e=b.domSelectionRange(),f=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&aE(b)&&!this.ignoreSelectionChange(e),g=-1,h=-1,i=!1,j=[];if(b.editable)for(let a=0;a<c.length;a++){let b=this.registerMutation(c[a],j);b&&(g=g<0?b.from:Math.min(b.from,g),h=h<0?b.to:Math.max(b.to,h),b.typeOver&&(i=!0))}if(j.some(a=>"BR"==a.nodeName)&&(8==b.input.lastKeyCode||46==b.input.lastKeyCode)){for(let a of j)if("BR"==a.nodeName&&a.parentNode){let b=a.nextSibling;b&&1==b.nodeType&&"false"==b.contentEditable&&a.parentNode.removeChild(a)}}else if(A&&j.length){let a=j.filter(a=>"BR"==a.nodeName);if(2==a.length){let[b,c]=a;b.parentNode&&b.parentNode.parentNode==c.parentNode?c.remove():b.remove()}else{let{focusNode:c}=this.currentSelection;for(let d of a){let a=d.parentNode;a&&"LI"==a.nodeName&&(!c||function(a,b){for(let c=b.parentNode;c&&c!=a.dom;c=c.parentNode){let b=a.docView.nearestDesc(c,!0);if(b&&b.node.isBlock)return c}return null}(b,c)!=a)&&d.remove()}}}let k=null;g<0&&f&&b.input.lastFocus>Date.now()-200&&Math.max(b.input.lastTouch,b.input.lastClick.time)<Date.now()-300&&q(e)&&(k=au(b))&&k.eq(d.LN.near(b.state.doc.resolve(0),1))?(b.input.lastFocus=0,aw(b),this.currentSelection.set(e),b.scrollToSelection()):(g>-1||f)&&(g>-1&&(b.docView.markDirty(g,h),a=b,!bJ.has(a)&&(bJ.set(a,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(a.dom).whiteSpace))&&(a.requiresGeckoHackNode=A,bK||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),bK=!0))),b.input.badSafariComposition&&(b.input.badSafariComposition=!1,function(a,b){var c;let{focusNode:d,focusOffset:e}=a.domSelectionRange();for(let f of b)if((null==(c=f.parentNode)?void 0:c.nodeName)=="TR"){let b=f.nextSibling;for(;b&&"TD"!=b.nodeName&&"TH"!=b.nodeName;)b=b.nextSibling;if(b){let c=b;for(;;){let a=c.firstChild;if(!a||1!=a.nodeType||"false"==a.contentEditable||/^(BR|IMG)$/.test(a.nodeName))break;c=a}c.insertBefore(f,c.firstChild),d==f&&a.domSelection().collapse(f,e)}else f.parentNode.removeChild(f)}}(b,j)),this.handleDOMChange(g,h,i,j),b.docView&&b.docView.dirty?b.updateState(b.state):this.currentSelection.eq(e)||aw(b),this.currentSelection.set(e))}registerMutation(a,b){if(b.indexOf(a.target)>-1)return null;let c=this.view.docView.nearestDesc(a.target);if("attributes"==a.type&&(c==this.view.docView||"contenteditable"==a.attributeName||"style"==a.attributeName&&!a.oldValue&&!a.target.getAttribute("style"))||!c||c.ignoreMutation(a))return null;if("childList"==a.type){for(let c=0;c<a.addedNodes.length;c++){let d=a.addedNodes[c];b.push(d),3==d.nodeType&&(this.lastChangedTextNode=d)}if(c.contentDOM&&c.contentDOM!=c.dom&&!c.contentDOM.contains(a.target))return{from:c.posBefore,to:c.posAfter};let d=a.previousSibling,e=a.nextSibling;if(y&&z<=11&&a.addedNodes.length)for(let b=0;b<a.addedNodes.length;b++){let{previousSibling:c,nextSibling:f}=a.addedNodes[b];(!c||0>Array.prototype.indexOf.call(a.addedNodes,c))&&(d=c),(!f||0>Array.prototype.indexOf.call(a.addedNodes,f))&&(e=f)}let f=d&&d.parentNode==a.target?g(d)+1:0,h=c.localPosFromDOM(a.target,f,-1),i=e&&e.parentNode==a.target?g(e):a.target.childNodes.length;return{from:h,to:c.localPosFromDOM(a.target,i,1)}}return"attributes"==a.type?{from:c.posAtStart-c.border,to:c.posAtEnd+c.border}:(this.lastChangedTextNode=a.target,{from:c.posAtStart,to:c.posAtEnd,typeOver:a.target.nodeValue==a.oldValue})}}let bJ=new WeakMap,bK=!1;function bL(a,b){let c=b.startContainer,d=b.startOffset,e=b.endContainer,f=b.endOffset,g=a.domAtPos(a.state.selection.anchor);return l(g.node,g.offset,e,f)&&([c,d,e,f]=[e,f,c,d]),{anchorNode:c,anchorOffset:d,focusNode:e,focusOffset:f}}function bM(a){let b=a.pmViewDesc;if(b)return b.parseRule();if("BR"==a.nodeName&&a.parentNode){if(E&&/^(ul|ol)$/i.test(a.parentNode.nodeName)){let a=document.createElement("div");return a.appendChild(document.createElement("li")),{skip:a}}else if(a.parentNode.lastChild==a||E&&/^(tr|table)$/i.test(a.parentNode.nodeName))return{ignore:!0}}else if("IMG"==a.nodeName&&a.getAttribute("mark-placeholder"))return{ignore:!0};return null}let bN=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function bO(a,b,c){return Math.max(c.anchor,c.head)>b.content.size?null:aD(a,b.resolve(c.anchor),b.resolve(c.head))}function bP(a,b,c){let d=a.depth,e=b?a.end():a.pos;for(;d>0&&(b||a.indexAfter(d)==a.node(d).childCount);)d--,e++,b=!1;if(c){let b=a.node(d).maybeChild(a.indexAfter(d));for(;b&&!b.isLeaf;)b=b.firstChild,e++}return e}function bQ(a){if(2!=a.length)return!1;let b=a.charCodeAt(0),c=a.charCodeAt(1);return b>=56320&&b<=57343&&c>=55296&&c<=56319}class bR{constructor(a,b){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new a3,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=b,this.state=b.state,this.directPlugins=b.plugins||[],this.directPlugins.forEach(bW),this.dispatch=this.dispatch.bind(this),this.dom=a&&a.mount||document.createElement("div"),a&&(a.appendChild?a.appendChild(this.dom):"function"==typeof a?a(this.dom):a.mount&&(this.mounted=!0)),this.editable=bU(this),bT(this),this.nodeViews=bV(this),this.docView=ag(this.state.doc,bS(this),bE(this),this.dom,this),this.domObserver=new bI(this,(a,b,c,f)=>(function(a,b,c,f,g){let h,i,j,k=a.input.compositionPendingChanges||(a.composing?a.input.compositionID:0);if(a.input.compositionPendingChanges=0,b<0){let b=a.input.lastSelectionTime>Date.now()-50?a.input.lastSelectionOrigin:null,c=au(a,b);if(c&&!a.state.selection.eq(c)){if(C&&I&&13===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter"))))return;let d=a.state.tr.setSelection(c);"pointer"==b?d.setMeta("pointer",!0):"key"==b&&d.scrollIntoView(),k&&d.setMeta("composition",k),a.dispatch(d)}return}let l=a.state.doc.resolve(b),m=l.sharedDepth(c);b=l.before(m+1),c=a.state.doc.resolve(c).after(m+1);let n=a.state.selection,o=function(a,b,c){let d,{node:f,fromOffset:g,toOffset:h,from:i,to:j}=a.docView.parseRange(b,c),k=a.domSelectionRange(),l=k.anchorNode;if(l&&a.dom.contains(1==l.nodeType?l:l.parentNode)&&(d=[{node:l,offset:k.anchorOffset}],q(k)||d.push({node:k.focusNode,offset:k.focusOffset})),C&&8===a.input.lastKeyCode)for(let a=h;a>g;a--){let b=f.childNodes[a-1],c=b.pmViewDesc;if("BR"==b.nodeName&&!c){h=a;break}if(!c||c.size)break}let m=a.state.doc,n=a.someProp("domParser")||e.S4.fromSchema(a.state.schema),o=m.resolve(i),p=null,r=n.parse(f,{topNode:o.parent,topMatch:o.parent.contentMatchAt(o.index()),topOpen:!0,from:g,to:h,preserveWhitespace:"pre"!=o.parent.type.whitespace||"full",findPositions:d,ruleFromNode:bM,context:o});if(d&&null!=d[0].pos){let a=d[0].pos,b=d[1]&&d[1].pos;null==b&&(b=a),p={anchor:a+i,head:b+i}}return{doc:r,sel:p,from:i,to:j}}(a,b,c),p=a.state.doc,s=p.slice(o.from,o.to);8===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime?(h=a.state.selection.to,i="end"):(h=a.state.selection.from,i="start"),a.input.lastKeyCode=null;let t=function(a,b,c,d,e){let f=a.findDiffStart(b,c);if(null==f)return null;let{a:g,b:h}=a.findDiffEnd(b,c+a.size,c+b.size);if("end"==e){let a=Math.max(0,f-Math.min(g,h));d-=g+a-f}if(g<f&&a.size<b.size){let a=d<=f&&d>=g?f-d:0;(f-=a)&&f<b.size&&bQ(b.textBetween(f-1,f+1))&&(f+=a?1:-1),h=f+(h-g),g=f}else if(h<f){let b=d<=f&&d>=h?f-d:0;(f-=b)&&f<a.size&&bQ(a.textBetween(f-1,f+1))&&(f+=b?1:-1),g=f+(g-h),h=f}return{start:f,endA:g,endB:h}}(s.content,o.doc.content,o.from,h,i);if(t&&a.input.domChangeCount++,(F&&a.input.lastIOSEnter>Date.now()-225||I)&&g.some(a=>1==a.nodeType&&!bN.test(a.nodeName))&&(!t||t.endA>=t.endB)&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter")))){a.input.lastIOSEnter=0;return}if(!t)if(f&&n instanceof d.U3&&!n.empty&&n.$head.sameParent(n.$anchor)&&!a.composing&&!(o.sel&&o.sel.anchor!=o.sel.head))t={start:n.from,endA:n.to,endB:n.to};else{if(o.sel){let b=bO(a,a.state.doc,o.sel);if(b&&!b.eq(a.state.selection)){let c=a.state.tr.setSelection(b);k&&c.setMeta("composition",k),a.dispatch(c)}}return}a.state.selection.from<a.state.selection.to&&t.start==t.endB&&a.state.selection instanceof d.U3&&(t.start>a.state.selection.from&&t.start<=a.state.selection.from+2&&a.state.selection.from>=o.from?t.start=a.state.selection.from:t.endA<a.state.selection.to&&t.endA>=a.state.selection.to-2&&a.state.selection.to<=o.to&&(t.endB+=a.state.selection.to-t.endA,t.endA=a.state.selection.to)),y&&z<=11&&t.endB==t.start+1&&t.endA==t.start&&t.start>o.from&&" \xa0"==o.doc.textBetween(t.start-o.from-1,t.start-o.from+1)&&(t.start--,t.endA--,t.endB--);let u=o.doc.resolveNoCache(t.start-o.from),v=o.doc.resolveNoCache(t.endB-o.from),w=p.resolve(t.start),x=u.sameParent(v)&&u.parent.inlineContent&&w.end()>=t.endA;if((F&&a.input.lastIOSEnter>Date.now()-225&&(!x||g.some(a=>"DIV"==a.nodeName||"P"==a.nodeName))||!x&&u.pos<o.doc.content.size&&(!u.sameParent(v)||!u.parent.inlineContent)&&u.pos<v.pos&&!/\S/.test(o.doc.textBetween(u.pos,v.pos,"","")))&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter")))){a.input.lastIOSEnter=0;return}if(a.state.selection.anchor>t.start&&function(a,b,c,d,e){if(c-b<=e.pos-d.pos||bP(d,!0,!1)<e.pos)return!1;let f=a.resolve(b);if(!d.parent.isTextblock){let a=f.nodeAfter;return null!=a&&c==b+a.nodeSize}if(f.parentOffset<f.parent.content.size||!f.parent.isTextblock)return!1;let g=a.resolve(bP(f,!0,!0));return!(!g.parent.isTextblock||g.pos>c||bP(g,!0,!1)<c)&&d.parent.content.cut(d.parentOffset).eq(g.parent.content)}(p,t.start,t.endA,u,v)&&a.someProp("handleKeyDown",b=>b(a,r(8,"Backspace")))){I&&C&&a.domObserver.suppressSelectionUpdates();return}C&&t.endB==t.start&&(a.input.lastChromeDelete=Date.now()),I&&!x&&u.start()!=v.start()&&0==v.parentOffset&&u.depth==v.depth&&o.sel&&o.sel.anchor==o.sel.head&&o.sel.head==t.endA&&(t.endB-=2,v=o.doc.resolveNoCache(t.endB-o.from),setTimeout(()=>{a.someProp("handleKeyDown",function(b){return b(a,r(13,"Enter"))})},20));let A=t.start,B=t.endA,D=b=>{let c=b||a.state.tr.replace(A,B,o.doc.slice(t.start-o.from,t.endB-o.from));if(o.sel){let b=bO(a,c.doc,o.sel);b&&!(C&&a.composing&&b.empty&&(t.start!=t.endB||a.input.lastChromeDelete<Date.now()-100)&&(b.head==A||b.head==c.mapping.map(B)-1)||y&&b.empty&&b.head==A)&&c.setSelection(b)}return k&&c.setMeta("composition",k),c.scrollIntoView()};if(x)if(u.pos==v.pos){y&&z<=11&&0==u.parentOffset&&(a.domObserver.suppressSelectionUpdates(),setTimeout(()=>aw(a),20));let b=D(a.state.tr.delete(A,B)),c=p.resolve(t.start).marksAcross(p.resolve(t.endA));c&&b.ensureMarks(c),a.dispatch(b)}else if(t.endA==t.endB&&(j=function(a,b){let c=a.firstChild.marks,d=b.firstChild.marks,f=c,g=d,h,i,j;for(let a=0;a<d.length;a++)f=d[a].removeFromSet(f);for(let a=0;a<c.length;a++)g=c[a].removeFromSet(g);if(1==f.length&&0==g.length)i=f[0],h="add",j=a=>a.mark(i.addToSet(a.marks));else{if(0!=f.length||1!=g.length)return null;i=g[0],h="remove",j=a=>a.mark(i.removeFromSet(a.marks))}let k=[];for(let a=0;a<b.childCount;a++)k.push(j(b.child(a)));if(e.FK.from(k).eq(a))return{mark:i,type:h}}(u.parent.content.cut(u.parentOffset,v.parentOffset),w.parent.content.cut(w.parentOffset,t.endA-w.start())))){let b=D(a.state.tr);"add"==j.type?b.addMark(A,B,j.mark):b.removeMark(A,B,j.mark),a.dispatch(b)}else if(u.parent.child(u.index()).isText&&u.index()==v.index()-!v.textOffset){let b=u.parent.textBetween(u.parentOffset,v.parentOffset),c=()=>D(a.state.tr.insertText(b,A,B));a.someProp("handleTextInput",d=>d(a,A,B,b,c))||a.dispatch(c())}else a.dispatch(D());else a.dispatch(D())})(this,a,b,c,f)),this.domObserver.start(),function(a){for(let b in a0){let c=a0[b];a.dom.addEventListener(b,a.input.eventHandlers[b]=b=>{!function(a,b){if(!b.bubbles)return!0;if(b.defaultPrevented)return!1;for(let c=b.target;c!=a.dom;c=c.parentNode)if(!c||11==c.nodeType||c.pmViewDesc&&c.pmViewDesc.stopEvent(b))return!1;return!0}(a,b)||a6(a,b)||!a.editable&&b.type in a1||c(a,b)},a2[b]?{passive:!0}:void 0)}E&&a.dom.addEventListener("input",()=>null),a5(a)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let a=this._props;for(let b in this._props={},a)this._props[b]=a[b];this._props.state=this.state}return this._props}update(a){a.handleDOMEvents!=this._props.handleDOMEvents&&a5(this);let b=this._props;this._props=a,a.plugins&&(a.plugins.forEach(bW),this.directPlugins=a.plugins),this.updateStateInner(a.state,b)}setProps(a){let b={};for(let a in this._props)b[a]=this._props[a];for(let c in b.state=this.state,a)b[c]=a[c];this.update(b)}updateState(a){this.updateStateInner(a,this._props)}updateStateInner(a,b){var c,d,e;let f=this.state,h=!1,i=!1;a.storedMarks&&this.composing&&(bf(this),i=!0),this.state=a;let j=f.plugins!=a.plugins||this._props.plugins!=b.plugins;if(j||this._props.plugins!=b.plugins||this._props.nodeViews!=b.nodeViews){let a=bV(this);(function(a,b){let c=0,d=0;for(let d in a){if(a[d]!=b[d])return!0;c++}for(let a in b)d++;return c!=d})(a,this.nodeViews)&&(this.nodeViews=a,h=!0)}(j||b.handleDOMEvents!=this._props.handleDOMEvents)&&a5(this),this.editable=bU(this),bT(this);let k=bE(this),m=bS(this),n=f.plugins==a.plugins||f.doc.eq(a.doc)?a.scrollToSelection>f.scrollToSelection?"to selection":"preserve":"reset",q=h||!this.docView.matchesNode(a.doc,m,k);(q||!a.selection.eq(f.selection))&&(i=!0);let r="preserve"==n&&i&&null==this.dom.style.overflowAnchor&&function(a){let b,c,d=a.dom.getBoundingClientRect(),e=Math.max(0,d.top);for(let f=(d.left+d.right)/2,g=e+1;g<Math.min(innerHeight,d.bottom);g+=5){let d=a.root.elementFromPoint(f,g);if(!d||d==a.dom||!a.dom.contains(d))continue;let h=d.getBoundingClientRect();if(h.top>=e-20){b=d,c=h.top;break}}return{refDOM:b,refTop:c,stack:N(a.dom)}}(this);if(i){let b,c,i;this.domObserver.stop();let j=q&&(y||C)&&!this.composing&&!f.selection.empty&&!a.selection.empty&&(d=f.selection,e=a.selection,i=Math.min(d.$anchor.sharedDepth(d.head),e.$anchor.sharedDepth(e.head)),d.$anchor.start(i)!=e.$anchor.start(i));if(q){let b=C?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(a){let b=a.domSelectionRange();if(!b.focusNode)return null;let c=function(a,b){for(;;){if(3==a.nodeType&&b)return a;if(1==a.nodeType&&b>0){if("false"==a.contentEditable)return null;b=o(a=a.childNodes[b-1])}else{if(!a.parentNode||p(a))return null;b=g(a),a=a.parentNode}}}(b.focusNode,b.focusOffset),d=function(a,b){for(;;){if(3==a.nodeType&&b<a.nodeValue.length)return a;if(1==a.nodeType&&b<a.childNodes.length){if("false"==a.contentEditable)return null;a=a.childNodes[b],b=0}else{if(!a.parentNode||p(a))return null;b=g(a)+1,a=a.parentNode}}}(b.focusNode,b.focusOffset);if(c&&d&&c!=d){let b=d.pmViewDesc,e=a.domObserver.lastChangedTextNode;if(c==e||d==e)return e;if(!b||!b.isText(d.nodeValue))return d;if(a.input.compositionNode==d){let a=c.pmViewDesc;if(!(!a||!a.isText(c.nodeValue)))return d}}return c||d}(this)),(h||!this.docView.update(a.doc,m,k,this))&&(this.docView.updateOuterDeco(m),this.docView.destroy(),this.docView=ag(a.doc,m,k,this.dom,this)),!b||this.trackWrites&&this.dom.contains(this.trackWrites)||(j=!0)}j||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),c=this.domSelectionRange(),l(b.node,b.offset,c.anchorNode,c.anchorOffset)))?aw(this,j):(aB(this,a.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(f),(null==(c=this.dragging)?void 0:c.node)&&!f.doc.eq(a.doc)&&this.updateDraggedNode(this.dragging,f),"reset"==n?this.dom.scrollTop=0:"to selection"==n?this.scrollToSelection():r&&function({refDOM:a,refTop:b,stack:c}){let d=a?a.getBoundingClientRect().top:0;O(c,0==d?0:d-b)}(r)}scrollToSelection(){let a=this.domSelectionRange().focusNode;if(a&&this.dom.contains(1==a.nodeType?a:a.parentNode))if(this.someProp("handleScrollToSelection",a=>a(this)));else if(this.state.selection instanceof d.nh){let b=this.docView.domAfterPos(this.state.selection.from);1==b.nodeType&&M(this,b.getBoundingClientRect(),a)}else M(this,this.coordsAtPos(this.state.selection.head,1),a)}destroyPluginViews(){let a;for(;a=this.pluginViews.pop();)a.destroy&&a.destroy()}updatePluginViews(a){if(a&&a.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let b=0;b<this.pluginViews.length;b++){let c=this.pluginViews[b];c.update&&c.update(this,a)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let a=0;a<this.directPlugins.length;a++){let b=this.directPlugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let b=this.state.plugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}}}updateDraggedNode(a,b){let c=a.node,e=-1;if(this.state.doc.nodeAt(c.from)==c.node)e=c.from;else{let a=c.from+(this.state.doc.content.size-b.doc.content.size);(a>0&&this.state.doc.nodeAt(a))==c.node&&(e=a)}this.dragging=new bk(a.slice,a.move,e<0?void 0:d.nh.create(this.state.doc,e))}someProp(a,b){let c=this._props&&this._props[a],d;if(null!=c&&(d=b?b(c):c))return d;for(let c=0;c<this.directPlugins.length;c++){let e=this.directPlugins[c].props[a];if(null!=e&&(d=b?b(e):e))return d}let e=this.state.plugins;if(e)for(let c=0;c<e.length;c++){let f=e[c].props[a];if(null!=f&&(d=b?b(f):f))return d}}hasFocus(){if(y){let a=this.root.activeElement;if(a==this.dom)return!0;if(!a||!this.dom.contains(a))return!1;for(;a&&this.dom!=a&&this.dom.contains(a);){if("false"==a.contentEditable)return!1;a=a.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(a){if(a.setActive)return a.setActive();if(P)return a.focus(P);let b=N(a);a.focus(null==P?{get preventScroll(){return P={preventScroll:!0},!0}}:void 0),P||(P=!1,O(b,0))}(this.dom),aw(this),this.domObserver.start()}get root(){let a=this._root;if(null==a){for(let a=this.dom.parentNode;a;a=a.parentNode)if(9==a.nodeType||11==a.nodeType&&a.host)return a.getSelection||(Object.getPrototypeOf(a).getSelection=()=>a.ownerDocument.getSelection()),this._root=a}return a||document}updateRoot(){this._root=null}posAtCoords(a){return function(a,b){var c;let d,e,f=a.dom.ownerDocument,g,i=0,k=function(a,b,c){if(a.caretPositionFromPoint)try{let d=a.caretPositionFromPoint(b,c);if(d)return{node:d.offsetNode,offset:Math.min(o(d.offsetNode),d.offset)}}catch(a){}if(a.caretRangeFromPoint){let d=a.caretRangeFromPoint(b,c);if(d)return{node:d.startContainer,offset:Math.min(o(d.startContainer),d.startOffset)}}}(f,b.left,b.top);k&&({node:g,offset:i}=k);let l=(a.root.elementFromPoint?a.root:f).elementFromPoint(b.left,b.top);if(!l||!a.dom.contains(1!=l.nodeType?l.parentNode:l)){let c=a.dom.getBoundingClientRect();if(!Q(b,c)||!(l=function a(b,c,d){let e=b.childNodes.length;if(e&&d.top<d.bottom)for(let f=Math.max(0,Math.min(e-1,Math.floor(e*(c.top-d.top)/(d.bottom-d.top))-2)),g=f;;){let d=b.childNodes[g];if(1==d.nodeType){let b=d.getClientRects();for(let e=0;e<b.length;e++){let f=b[e];if(Q(c,f))return a(d,c,f)}}if((g=(g+1)%e)==f)break}return b}(a.dom,b,c)))return null}if(E)for(let a=l;g&&a;a=h(a))a.draggable&&(g=void 0);if(l=(d=(c=l).parentNode)&&/^li$/i.test(d.nodeName)&&b.left<c.getBoundingClientRect().left?d:c,g){let c;if(A&&1==g.nodeType&&(i=Math.min(i,g.childNodes.length))<g.childNodes.length){let a=g.childNodes[i],c;"IMG"==a.nodeName&&(c=a.getBoundingClientRect()).right<=b.left&&c.bottom>b.top&&i++}J&&i&&1==g.nodeType&&1==(c=g.childNodes[i-1]).nodeType&&"false"==c.contentEditable&&c.getBoundingClientRect().top>=b.top&&i--,g==a.dom&&i==g.childNodes.length-1&&1==g.lastChild.nodeType&&b.top>g.lastChild.getBoundingClientRect().bottom?e=a.state.doc.content.size:(0==i||1!=g.nodeType||"BR"!=g.childNodes[i-1].nodeName)&&(e=function(a,b,c,d){let e=-1;for(let c=b,f=!1;c!=a.dom;){let b=a.docView.nearestDesc(c,!0),g;if(!b)return null;if(1==b.dom.nodeType&&(b.node.isBlock&&b.parent||!b.contentDOM)&&((g=b.dom.getBoundingClientRect()).width||g.height)&&(b.node.isBlock&&b.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(b.dom.nodeName)&&(!f&&g.left>d.left||g.top>d.top?e=b.posBefore:(!f&&g.right<d.left||g.bottom<d.top)&&(e=b.posAfter),f=!0),!b.contentDOM&&e<0&&!b.node.isText))return(b.node.isBlock?d.top<(g.top+g.bottom)/2:d.left<(g.left+g.right)/2)?b.posBefore:b.posAfter;c=b.dom.parentNode}return e>-1?e:a.docView.posFromDOM(b,c,-1)}(a,g,i,b))}null==e&&(e=function(a,b,c){let{node:d,offset:e}=function a(b,c){let d,e,f,g=2e8,h,i=0,k=c.top,l=c.top;for(let a=b.firstChild,m=0;a;a=a.nextSibling,m++){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=j(a).getClientRects()}for(let j=0;j<b.length;j++){let n=b[j];if(n.top<=k&&n.bottom>=l){k=Math.max(n.bottom,k),l=Math.min(n.top,l);let b=n.left>c.left?n.left-c.left:n.right<c.left?c.left-n.right:0;if(b<g){f=a,g=b,h=b&&3==f.nodeType?{left:n.right<c.left?n.right:n.left,top:c.top}:c,1==a.nodeType&&b&&(i=m+ +(c.left>=(n.left+n.right)/2));continue}}else n.top>c.top&&!d&&n.left<=c.left&&n.right>=c.left&&(d=a,e={left:Math.max(n.left,Math.min(n.right,c.left)),top:n.top});!f&&(c.left>=n.right&&c.top>=n.top||c.left>=n.left&&c.top>=n.bottom)&&(i=m+1)}}return(!f&&d&&(f=d,h=e,g=0),f&&3==f.nodeType)?function(a,b){let c=a.nodeValue.length,d=document.createRange(),e;for(let f=0;f<c;f++){d.setEnd(a,f+1),d.setStart(a,f);let c=S(d,1);if(c.top!=c.bottom&&Q(b,c)){e={node:a,offset:f+ +(b.left>=(c.left+c.right)/2)};break}}return d.detach(),e||{node:a,offset:0}}(f,h):!f||g&&1==f.nodeType?{node:b,offset:i}:a(f,h)}(b,c),f=-1;if(1==d.nodeType&&!d.firstChild){let a=d.getBoundingClientRect();f=a.left!=a.right&&c.left>(a.left+a.right)/2?1:-1}return a.docView.posFromDOM(d,e,f)}(a,l,b));let m=a.docView.nearestDesc(l,!0);return{pos:e,inside:m?m.posAtStart-m.border:-1}}(this,a)}coordsAtPos(a,b=1){return U(this,a,b)}domAtPos(a,b=0){return this.docView.domFromPos(a,b)}nodeDOM(a){let b=this.docView.descAt(a);return b?b.nodeDOM:null}posAtDOM(a,b,c=-1){let d=this.docView.posFromDOM(a,b,c);if(null==d)throw RangeError("DOM position not inside the editor");return d}endOfTextblock(a,b){return function(a,b,c){let d,e;return Z==b&&_==c?aa:(Z=b,_=c,aa="up"==c||"down"==c?(d=b.selection,e="up"==c?d.$from:d.$to,X(a,b,()=>{let{node:b}=a.docView.domFromPos(e.pos,"up"==c?-1:1);for(;;){let c=a.docView.nearestDesc(b,!0);if(!c)break;if(c.node.isBlock){b=c.contentDOM||c.dom;break}b=c.dom.parentNode}let d=U(a,e.pos,1);for(let a=b.firstChild;a;a=a.nextSibling){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=j(a,0,a.nodeValue.length).getClientRects()}for(let a=0;a<b.length;a++){let e=b[a];if(e.bottom>e.top+1&&("up"==c?d.top-e.top>(e.bottom-d.top)*2:e.bottom-d.bottom>(d.bottom-e.top)*2))return!1}}return!0})):function(a,b,c){let{$head:d}=b.selection;if(!d.parent.isTextblock)return!1;let e=d.parentOffset,f=e==d.parent.content.size,g=a.domSelection();return g?Y.test(d.parent.textContent)&&g.modify?X(a,b,()=>{let{focusNode:b,focusOffset:e,anchorNode:f,anchorOffset:h}=a.domSelectionRange(),i=g.caretBidiLevel;g.modify("move",c,"character");let j=d.depth?a.docView.domAfterPos(d.before()):a.dom,{focusNode:k,focusOffset:l}=a.domSelectionRange(),m=k&&!j.contains(1==k.nodeType?k:k.parentNode)||b==k&&e==l;try{g.collapse(f,h),b&&(b!=f||e!=h)&&g.extend&&g.extend(b,e)}catch(a){}return null!=i&&(g.caretBidiLevel=i),m}):"left"==c||"backward"==c?!e:f:d.pos==d.start()||d.pos==d.end()}(a,b,c))}(this,b||this.state,a)}pasteHTML(a,b){return bi(this,"",a,!1,b||new ClipboardEvent("paste"))}pasteText(a,b){return bi(this,a,null,!0,b||new ClipboardEvent("paste"))}serializeForClipboard(a){return aS(this,a)}destroy(){if(this.docView){for(let a in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(a,this.input.eventHandlers[a]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],bE(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,k()}}get isDestroyed(){return null==this.docView}dispatchEvent(a){!a6(this,a)&&a0[a.type]&&(this.editable||!(a.type in a1))&&a0[a.type](this,a)}domSelectionRange(){let a=this.domSelection();return a?E&&11===this.root.nodeType&&function(a){let b=a.activeElement;for(;b&&b.shadowRoot;)b=b.shadowRoot.activeElement;return b}(this.dom.ownerDocument)==this.dom&&function(a,b){let c;if(b.getComposedRanges){let c=b.getComposedRanges(a.root)[0];if(c)return bL(a,c)}function d(a){a.preventDefault(),a.stopImmediatePropagation(),c=a.getTargetRanges()[0]}return a.dom.addEventListener("beforeinput",d,!0),document.execCommand("indent"),a.dom.removeEventListener("beforeinput",d,!0),c?bL(a,c):null}(this,a)||a:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function bS(a){let b=Object.create(null);return b.class="ProseMirror",b.contenteditable=String(a.editable),a.someProp("attributes",c=>{if("function"==typeof c&&(c=c(a.state)),c)for(let a in c)"class"==a?b.class+=" "+c[a]:"style"==a?b.style=(b.style?b.style+";":"")+c[a]:b[a]||"contenteditable"==a||"nodeName"==a||(b[a]=String(c[a]))}),b.translate||(b.translate="no"),[br.node(0,a.state.doc.content.size,b)]}function bT(a){if(a.markCursor){let b=document.createElement("img");b.className="ProseMirror-separator",b.setAttribute("mark-placeholder","true"),b.setAttribute("alt",""),a.cursorWrapper={dom:b,deco:br.widget(a.state.selection.from,b,{raw:!0,marks:a.markCursor})}}else a.cursorWrapper=null}function bU(a){return!a.someProp("editable",b=>!1===b(a.state))}function bV(a){let b=Object.create(null);function c(a){for(let c in a)Object.prototype.hasOwnProperty.call(b,c)||(b[c]=a[c])}return a.someProp("nodeViews",c),a.someProp("markViews",c),b}function bW(a){if(a.spec.state||a.spec.filterTransaction||a.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}bR.prototype.dispatch=function(a){let b=this._props.dispatchTransaction;b?b.call(this,a):this.updateState(this.state.apply(a))}},670016:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(789253);b.property=function(a){return function(b){return d.get(b,a)}}},673977:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(356103).Or},676029:(a,b,c)=>{"use strict";c.d(b,{q:()=>Y});var d=c(115962);function e(a){return Array.isArray?Array.isArray(a):"[object Array]"===l(a)}let f=1/0;function g(a){return"string"==typeof a}function h(a){return"number"==typeof a}function i(a){return"object"==typeof a}function j(a){return null!=a}function k(a){return!a.trim().length}function l(a){return null==a?void 0===a?"[object Undefined]":"[object Null]":Object.prototype.toString.call(a)}let m=Object.prototype.hasOwnProperty;class n{constructor(a){this._keys=[],this._keyMap={};let b=0;a.forEach(a=>{let c=o(a);this._keys.push(c),this._keyMap[c.id]=c,b+=c.weight}),this._keys.forEach(a=>{a.weight/=b})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function o(a){let b=null,c=null,d=null,f=1,h=null;if(g(a)||e(a))d=a,b=p(a),c=q(a);else{if(!m.call(a,"name"))throw Error("Missing name property in key");let e=a.name;if(d=e,m.call(a,"weight")&&(f=a.weight)<=0)throw Error(`Property 'weight' in key '${e}' must be a positive integer`);b=p(e),c=q(e),h=a.getFn}return{path:b,id:c,weight:f,src:d,getFn:h}}function p(a){return e(a)?a:a.split(".")}function q(a){return e(a)?a.join("."):a}var r={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(a,b)=>a.score===b.score?a.idx<b.idx?-1:1:a.score<b.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(a,b){let c=[],d=!1,k=(a,b,m)=>{if(j(a))if(b[m]){var n,o;let p=a[b[m]];if(!j(p))return;if(m===b.length-1&&(g(p)||h(p)||!0===(n=p)||!1===n||i(o=n)&&null!==o&&"[object Boolean]"==l(n)))c.push(null==p?"":function(a){if("string"==typeof a)return a;let b=a+"";return"0"==b&&1/a==-f?"-0":b}(p));else if(e(p)){d=!0;for(let a=0,c=p.length;a<c;a+=1)k(p[a],b,m+1)}else b.length&&k(p,b,m+1)}else c.push(a)};return k(a,g(b)?b.split("."):b,0),d?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};let s=/[^ ]+/g;class t{constructor({getFn:a=r.getFn,fieldNormWeight:b=r.fieldNormWeight}={}){this.norm=function(a=1,b=3){let c=new Map,d=Math.pow(10,b);return{get(b){let e=b.match(s).length;if(c.has(e))return c.get(e);let f=parseFloat(Math.round(1/Math.pow(e,.5*a)*d)/d);return c.set(e,f),f},clear(){c.clear()}}}(b,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((a,b)=>{this._keysMap[a.id]=b})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((a,b)=>{this._addString(a,b)}):this.docs.forEach((a,b)=>{this._addObject(a,b)}),this.norm.clear())}add(a){let b=this.size();g(a)?this._addString(a,b):this._addObject(a,b)}removeAt(a){this.records.splice(a,1);for(let b=a,c=this.size();b<c;b+=1)this.records[b].i-=1}getValueForItemAtKeyId(a,b){return a[this._keysMap[b]]}size(){return this.records.length}_addString(a,b){if(!j(a)||k(a))return;let c={v:a,i:b,n:this.norm.get(a)};this.records.push(c)}_addObject(a,b){let c={i:b,$:{}};this.keys.forEach((b,d)=>{let f=b.getFn?b.getFn(a):this.getFn(a,b.path);if(j(f)){if(e(f)){let a=[],b=[{nestedArrIndex:-1,value:f}];for(;b.length;){let{nestedArrIndex:c,value:d}=b.pop();if(j(d))if(g(d)&&!k(d)){let b={v:d,i:c,n:this.norm.get(d)};a.push(b)}else e(d)&&d.forEach((a,c)=>{b.push({nestedArrIndex:c,value:a})})}c.$[d]=a}else if(g(f)&&!k(f)){let a={v:f,n:this.norm.get(f)};c.$[d]=a}}}),this.records.push(c)}toJSON(){return{keys:this.keys,records:this.records}}}function u(a,b,{getFn:c=r.getFn,fieldNormWeight:d=r.fieldNormWeight}={}){let e=new t({getFn:c,fieldNormWeight:d});return e.setKeys(a.map(o)),e.setSources(b),e.create(),e}function v(a,{errors:b=0,currentLocation:c=0,expectedLocation:d=0,distance:e=r.distance,ignoreLocation:f=r.ignoreLocation}={}){let g=b/a.length;if(f)return g;let h=Math.abs(d-c);return e?g+h/e:h?1:g}let w=String.prototype.normalize?a=>a.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):a=>a;class x{constructor(a,{location:b=r.location,threshold:c=r.threshold,distance:d=r.distance,includeMatches:e=r.includeMatches,findAllMatches:f=r.findAllMatches,minMatchCharLength:g=r.minMatchCharLength,isCaseSensitive:h=r.isCaseSensitive,ignoreDiacritics:i=r.ignoreDiacritics,ignoreLocation:j=r.ignoreLocation}={}){if(this.options={location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j},a=h?a:a.toLowerCase(),a=i?w(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;let k=(a,b)=>{this.chunks.push({pattern:a,alphabet:function(a){let b={};for(let c=0,d=a.length;c<d;c+=1){let e=a.charAt(c);b[e]=(b[e]||0)|1<<d-c-1}return b}(a),startIndex:b})},l=this.pattern.length;if(l>32){let a=0,b=l%32,c=l-b;for(;a<c;)k(this.pattern.substr(a,32),a),a+=32;if(b){let a=l-32;k(this.pattern.substr(a),a)}}else k(this.pattern,0)}searchIn(a){let{isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d}=this.options;if(a=b?a:a.toLowerCase(),a=c?w(a):a,this.pattern===a){let b={isMatch:!0,score:0};return d&&(b.indices=[[0,a.length-1]]),b}let{location:e,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,ignoreLocation:j}=this.options,k=[],l=0,m=!1;this.chunks.forEach(({pattern:b,alphabet:c,startIndex:n})=>{let{isMatch:o,score:p,indices:q}=function(a,b,c,{location:d=r.location,distance:e=r.distance,threshold:f=r.threshold,findAllMatches:g=r.findAllMatches,minMatchCharLength:h=r.minMatchCharLength,includeMatches:i=r.includeMatches,ignoreLocation:j=r.ignoreLocation}={}){let k;if(b.length>32)throw Error("Pattern length exceeds max of 32.");let l=b.length,m=a.length,n=Math.max(0,Math.min(d,m)),o=f,p=n,q=h>1||i,s=q?Array(m):[];for(;(k=a.indexOf(b,p))>-1;)if(o=Math.min(v(b,{currentLocation:k,expectedLocation:n,distance:e,ignoreLocation:j}),o),p=k+l,q){let a=0;for(;a<l;)s[k+a]=1,a+=1}p=-1;let t=[],u=1,w=l+m,x=1<<l-1;for(let d=0;d<l;d+=1){let f=0,h=w;for(;f<h;)v(b,{errors:d,currentLocation:n+h,expectedLocation:n,distance:e,ignoreLocation:j})<=o?f=h:w=h,h=Math.floor((w-f)/2+f);w=h;let i=Math.max(1,n-h+1),k=g?m:Math.min(n+h,m)+l,r=Array(k+2);r[k+1]=(1<<d)-1;for(let f=k;f>=i;f-=1){let g=f-1,h=c[a.charAt(g)];if(q&&(s[g]=+!!h),r[f]=(r[f+1]<<1|1)&h,d&&(r[f]|=(t[f+1]|t[f])<<1|1|t[f+1]),r[f]&x&&(u=v(b,{errors:d,currentLocation:g,expectedLocation:n,distance:e,ignoreLocation:j}))<=o){if(o=u,(p=g)<=n)break;i=Math.max(1,2*n-p)}}if(v(b,{errors:d+1,currentLocation:n,expectedLocation:n,distance:e,ignoreLocation:j})>o)break;t=r}let y={isMatch:p>=0,score:Math.max(.001,u)};if(q){let a=function(a=[],b=r.minMatchCharLength){let c=[],d=-1,e=-1,f=0;for(let g=a.length;f<g;f+=1){let g=a[f];g&&-1===d?d=f:g||-1===d||((e=f-1)-d+1>=b&&c.push([d,e]),d=-1)}return a[f-1]&&f-d>=b&&c.push([d,f-1]),c}(s,h);a.length?i&&(y.indices=a):y.isMatch=!1}return y}(a,b,c,{location:e+n,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,includeMatches:d,ignoreLocation:j});o&&(m=!0),l+=p,o&&q&&(k=[...k,...q])});let n={isMatch:m,score:m?l/this.chunks.length:1};return m&&d&&(n.indices=k),n}}class y{constructor(a){this.pattern=a}static isMultiMatch(a){return z(a,this.multiRegex)}static isSingleMatch(a){return z(a,this.singleRegex)}search(){}}function z(a,b){let c=a.match(b);return c?c[1]:null}class A extends y{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){let b=a===this.pattern;return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class B extends y{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){let b=-1===a.indexOf(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class C extends y{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){let b=a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class D extends y{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){let b=!a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class E extends y{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){let b=a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[a.length-this.pattern.length,a.length-1]}}}class F extends y{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){let b=!a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class G extends y{constructor(a,{location:b=r.location,threshold:c=r.threshold,distance:d=r.distance,includeMatches:e=r.includeMatches,findAllMatches:f=r.findAllMatches,minMatchCharLength:g=r.minMatchCharLength,isCaseSensitive:h=r.isCaseSensitive,ignoreDiacritics:i=r.ignoreDiacritics,ignoreLocation:j=r.ignoreLocation}={}){super(a),this._bitapSearch=new x(a,{location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class H extends y{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let b,c=0,d=[],e=this.pattern.length;for(;(b=a.indexOf(this.pattern,c))>-1;)c=b+e,d.push([b,c-1]);let f=!!d.length;return{isMatch:f,score:+!f,indices:d}}}let I=[A,H,C,D,F,E,B,G],J=I.length,K=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,L=new Set([G.type,H.type]);class M{constructor(a,{isCaseSensitive:b=r.isCaseSensitive,ignoreDiacritics:c=r.ignoreDiacritics,includeMatches:d=r.includeMatches,minMatchCharLength:e=r.minMatchCharLength,ignoreLocation:f=r.ignoreLocation,findAllMatches:g=r.findAllMatches,location:h=r.location,threshold:i=r.threshold,distance:j=r.distance}={}){this.query=null,this.options={isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d,minMatchCharLength:e,findAllMatches:g,ignoreLocation:f,location:h,threshold:i,distance:j},a=b?a:a.toLowerCase(),a=c?w(a):a,this.pattern=a,this.query=function(a,b={}){return a.split("|").map(a=>{let c=a.trim().split(K).filter(a=>a&&!!a.trim()),d=[];for(let a=0,e=c.length;a<e;a+=1){let e=c[a],f=!1,g=-1;for(;!f&&++g<J;){let a=I[g],c=a.isMultiMatch(e);c&&(d.push(new a(c,b)),f=!0)}if(!f)for(g=-1;++g<J;){let a=I[g],c=a.isSingleMatch(e);if(c){d.push(new a(c,b));break}}}return d})}(this.pattern,this.options)}static condition(a,b){return b.useExtendedSearch}searchIn(a){let b=this.query;if(!b)return{isMatch:!1,score:1};let{includeMatches:c,isCaseSensitive:d,ignoreDiacritics:e}=this.options;a=d?a:a.toLowerCase(),a=e?w(a):a;let f=0,g=[],h=0;for(let d=0,e=b.length;d<e;d+=1){let e=b[d];g.length=0,f=0;for(let b=0,d=e.length;b<d;b+=1){let d=e[b],{isMatch:i,indices:j,score:k}=d.search(a);if(i){if(f+=1,h+=k,c){let a=d.constructor.type;L.has(a)?g=[...g,...j]:g.push(j)}}else{h=0,f=0,g.length=0;break}}if(f){let a={isMatch:!0,score:h/f};return c&&(a.indices=g),a}}return{isMatch:!1,score:1}}}let N=[];function O(a,b){for(let c=0,d=N.length;c<d;c+=1){let d=N[c];if(d.condition(a,b))return new d(a,b)}return new x(a,b)}let P={AND:"$and",OR:"$or"},Q={PATH:"$path",PATTERN:"$val"},R=a=>!!(a[P.AND]||a[P.OR]),S=a=>({[P.AND]:Object.keys(a).map(b=>({[b]:a[b]}))});function T(a,b,{auto:c=!0}={}){let d=a=>{let f=Object.keys(a),h=!!a[Q.PATH];if(!h&&f.length>1&&!R(a))return d(S(a));if(!e(a)&&i(a)&&!R(a)){let d=h?a[Q.PATH]:f[0],e=h?a[Q.PATTERN]:a[d];if(!g(e))throw Error(`Invalid value for key ${d}`);let i={keyId:q(d),pattern:e};return c&&(i.searcher=O(e,b)),i}let j={children:[],operator:f[0]};return f.forEach(b=>{let c=a[b];e(c)&&c.forEach(a=>{j.children.push(d(a))})}),j};return R(a)||(a=S(a)),d(a)}function U(a,b){let c=a.matches;b.matches=[],j(c)&&c.forEach(a=>{if(!j(a.indices)||!a.indices.length)return;let{indices:c,value:d}=a,e={indices:c,value:d};a.key&&(e.key=a.key.src),a.idx>-1&&(e.refIndex=a.idx),b.matches.push(e)})}function V(a,b){b.score=a.score}class W{constructor(a,b={},c){this.options={...r,...b},this.options.useExtendedSearch,this._keyStore=new n(this.options.keys),this.setCollection(a,c)}setCollection(a,b){if(this._docs=a,b&&!(b instanceof t))throw Error("Incorrect 'index' type");this._myIndex=b||u(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){j(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){let b=[];for(let c=0,d=this._docs.length;c<d;c+=1){let e=this._docs[c];a(e,c)&&(this.removeAt(c),c-=1,d-=1,b.push(e))}return b}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:b=-1}={}){let{includeMatches:c,includeScore:d,shouldSort:e,sortFn:f,ignoreFieldNorm:i}=this.options,j=g(a)?g(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return!function(a,{ignoreFieldNorm:b=r.ignoreFieldNorm}){a.forEach(a=>{let c=1;a.matches.forEach(({key:a,norm:d,score:e})=>{let f=a?a.weight:null;c*=Math.pow(0===e&&f?Number.EPSILON:e,(f||1)*(b?1:d))}),a.score=c})}(j,{ignoreFieldNorm:i}),e&&j.sort(f),h(b)&&b>-1&&(j=j.slice(0,b)),function(a,b,{includeMatches:c=r.includeMatches,includeScore:d=r.includeScore}={}){let e=[];return c&&e.push(U),d&&e.push(V),a.map(a=>{let{idx:c}=a,d={item:b[c],refIndex:c};return e.length&&e.forEach(b=>{b(a,d)}),d})}(j,this._docs,{includeMatches:c,includeScore:d})}_searchStringList(a){let b=O(a,this.options),{records:c}=this._myIndex,d=[];return c.forEach(({v:a,i:c,n:e})=>{if(!j(a))return;let{isMatch:f,score:g,indices:h}=b.searchIn(a);f&&d.push({item:a,idx:c,matches:[{score:g,value:a,norm:e,indices:h}]})}),d}_searchLogical(a){let b=T(a,this.options),c=(a,b,d)=>{if(!a.children){let{keyId:c,searcher:e}=a,f=this._findMatches({key:this._keyStore.get(c),value:this._myIndex.getValueForItemAtKeyId(b,c),searcher:e});return f&&f.length?[{idx:d,item:b,matches:f}]:[]}let e=[];for(let f=0,g=a.children.length;f<g;f+=1){let g=c(a.children[f],b,d);if(g.length)e.push(...g);else if(a.operator===P.AND)return[]}return e},d=this._myIndex.records,e={},f=[];return d.forEach(({$:a,i:d})=>{if(j(a)){let g=c(b,a,d);g.length&&(e[d]||(e[d]={idx:d,item:a,matches:[]},f.push(e[d])),g.forEach(({matches:a})=>{e[d].matches.push(...a)}))}}),f}_searchObjectList(a){let b=O(a,this.options),{keys:c,records:d}=this._myIndex,e=[];return d.forEach(({$:a,i:d})=>{if(!j(a))return;let f=[];c.forEach((c,d)=>{f.push(...this._findMatches({key:c,value:a[d],searcher:b}))}),f.length&&e.push({idx:d,item:a,matches:f})}),e}_findMatches({key:a,value:b,searcher:c}){if(!j(b))return[];let d=[];if(e(b))b.forEach(({v:b,i:e,n:f})=>{if(!j(b))return;let{isMatch:g,score:h,indices:i}=c.searchIn(b);g&&d.push({score:h,key:a,value:b,idx:e,norm:f,indices:i})});else{let{v:e,n:f}=b,{isMatch:g,score:h,indices:i}=c.searchIn(e);g&&d.push({score:h,key:a,value:e,norm:f,indices:i})}return d}}W.version="7.1.0",W.createIndex=u,W.parseIndex=function(a,{getFn:b=r.getFn,fieldNormWeight:c=r.fieldNormWeight}={}){let{keys:d,records:e}=a,f=new t({getFn:b,fieldNormWeight:c});return f.setKeys(d),f.setIndexRecords(e),f},W.config=r,W.parseQuery=T,function(...a){N.push(...a)}(M);let X={keys:[{name:"label",weight:3},{name:"sublabel",weight:1},{name:"objectName",weight:1.5},{name:"fieldValues",weight:2}],threshold:.4,distance:200,includeScore:!0,shouldSort:!0,minMatchCharLength:1};function Y(a){let[b,c]=(0,d.useState)([]),[e,f]=(0,d.useState)(!0),g=(0,d.useRef)(!0);(0,d.useCallback)(async()=>{try{let a=await fetch("/api/workspace/search-index"),b=await a.json();g.current&&(c(b.items??[]),f(!1))}catch{g.current&&f(!1)}},[]);let h=(0,d.useMemo)(()=>0===b.length?null:new W(b.map(a=>({...a,fieldValues:a.fields?Object.values(a.fields).join(" "):void 0})),X),[b]),i=(0,d.useCallback)((a,c=20)=>a.trim()?h?h.search(a,{limit:c}).map(a=>a.item):[]:[...b].toSorted((a,b)=>{let c={object:0,file:1,entry:2};return(c[a.kind]??9)-(c[b.kind]??9)}).slice(0,c),[h,b]),j=(0,d.useRef)(i);return j.current=i,{items:b,loading:e,search:(0,d.useCallback)((a,b)=>j.current(a,b),[])}}},681560:(a,b,c)=>{"use strict";c.d(b,{I:()=>n});var d=c(736927),e=c(115962),f=c(681713),g=c(612563),h=c(379924),i=c(18886),j=c(130526);function k(a){return null==a?"":"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):"object"==typeof a?JSON.stringify(a):""}function l({entry:a,fields:b,titleField:c,coverField:l,onEntryClick:m}){let n=k(a.entry_id??a.id),o=function(a,b,c){if(c){let b=k(a[c]);if(b)return b}let d=b.find(a=>"text"===a.type&&/name|title/i.test(a.name))??b.find(a=>"text"===a.type);return d?k(a[d.name]):k(a.id)}(a,b,c),p=(0,j.I)(a,b),q=(0,e.useMemo)(()=>b.filter(a=>a.name!==c&&a.name!==l).slice(0,4),[b,c,l]),r=b.find(a=>"enum"===a.type&&a.enum_values?.length),s=r?k(a[r.name]):null,t=r&&s?function(a,b){if(!a||!b.enum_values)return null;let c=b.enum_values.indexOf(a);return{text:a,color:c>=0&&b.enum_colors?.[c]?b.enum_colors[c]:"#94a3b8"}}(s,r):null;return(0,d.jsxs)("button",{type:"button",onClick:()=>m?.(n),className:"text-left rounded-xl border p-4 hover:shadow-md transition-all cursor-pointer w-full group",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[p?.faviconUrl&&(0,d.jsx)(i.A,{src:p.faviconUrl,className:"w-4 h-4 rounded-[4px] shrink-0 mt-0.5"}),(0,d.jsx)("h4",{className:"text-[13px] font-semibold leading-tight line-clamp-2 group-hover:underline",style:{color:"var(--color-text)"},children:o||"Untitled"})]}),t&&(0,d.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0 whitespace-nowrap",style:{backgroundColor:t.color,color:"#fff"},children:t.text})]}),(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:q.map(b=>{let c=a[b.name];if(null==c||""===k(c))return null;let e="tags"===b.type?(0,h.k)(c):[];return(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:"text-[10px] flex-shrink-0 min-w-[60px]",style:{color:"var(--color-text-muted)"},children:b.name}),(0,d.jsx)("div",{className:"text-[12px] whitespace-pre-line line-clamp-2",style:{color:"var(--color-text)"},children:"tags"===b.type?(0,d.jsxs)("span",{className:"flex items-center gap-0.5 flex-wrap",children:[e.slice(0,3).map(a=>{let b=(0,g.KJ)(a),c="link"===b.kind&&b.href,e="url"===b.linkType&&!!b.faviconUrl;return c?(0,d.jsxs)("a",{href:b.href,target:"url"===b.linkType||"file"===b.linkType?"_blank":void 0,rel:"url"===b.linkType||"file"===b.linkType?"noopener noreferrer":void 0,onClick:a=>a.stopPropagation(),className:"inline-flex items-center gap-1 px-1.5 py-0 rounded text-[11px] font-medium hover:underline underline-offset-2 max-w-[220px]",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-accent)"},children:[e&&(0,d.jsx)(i.A,{src:b.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:b.text})]},a):(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0 rounded text-[11px] font-medium",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-text-muted)"},children:a},a)}),e.length>3&&(0,d.jsxs)("span",{className:"text-[10px]",style:{color:"var(--color-text-muted)"},children:["+",e.length-3]})]}):(0,d.jsx)(f.E,{value:c,fieldType:b.type,mode:"table",showUrlFavicon:!0})})]},b.id)})}),null!=a.created_at&&(0,d.jsx)("div",{className:"mt-3 text-[10px]",style:{color:"var(--color-text-muted)",opacity:.6},children:k(a.created_at).slice(0,10)})]})}function m(){return(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 gap-2",children:[(0,d.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",style:{color:"var(--color-text-muted)",opacity:.4},children:[(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"})]}),(0,d.jsx)("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"No entries to display in gallery view."})]})}function n({objectName:a,fields:b,entries:c,titleField:e,coverField:f,members:g,relationLabels:h,onEntryClick:i}){return 0===c.length?(0,d.jsx)(m,{}):(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:c.map(a=>(0,d.jsx)(l,{entry:a,fields:b,titleField:e,coverField:f,onEntryClick:i},k(a.entry_id??a.id)))})}},681713:(a,b,c)=>{"use strict";c.d(b,{E:()=>m});var d=c(736927),e=c(115962),f=c(612563),g=c(18886),h=c(545182),i=c(888973);function j(){return(0,d.jsx)("span",{style:{color:"var(--color-text-muted)",opacity:.5},children:"--"})}function k({mediaType:a,url:b,label:c}){return"image"===a?(0,d.jsx)("div",{className:"mt-2 rounded-lg overflow-hidden border",style:{borderColor:"var(--color-border)"},children:(0,d.jsx)("img",{src:b,alt:c,className:"max-h-64 w-auto"})}):"video"===a?(0,d.jsx)("video",{src:b,controls:!0,className:"mt-2 w-full max-h-72 rounded-lg border",style:{borderColor:"var(--color-border)",background:"#000"}}):"audio"===a?(0,d.jsx)("audio",{src:b,controls:!0,className:"mt-2 w-full"}):(0,d.jsx)("iframe",{src:`${b}#toolbar=0&navpanes=0&scrollbar=1`,title:c,className:"mt-2 w-full h-72 rounded-lg border",style:{borderColor:"var(--color-border)",background:"white"}})}function l({text:a,fieldType:b,showUrlFavicon:c=!1,linkInteractionMode:e="inline",isTableMode:j=!1}){let k=a.trim();if(!k)return(0,d.jsx)(d.Fragment,{children:a});let l=b&&"text"!==b&&"richtext"!==b?b:void 0,m=(0,f.KJ)(k,l);if("link"===m.kind&&m.href){if(!l&&"file"===m.linkType&&k.includes(" "))return(0,d.jsx)(d.Fragment,{children:m.text});let a="url"===m.linkType||"file"===m.linkType,b=c&&"url"===m.linkType&&!!m.faviconUrl;if("button"===e){let c=(0,d.jsxs)("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1.5 align-middle",style:{color:"var(--color-accent)"},children:[b&&(0,d.jsx)(g.A,{src:m.faviconUrl}),(0,d.jsx)("span",{className:j?"min-w-0 truncate":"min-w-0 break-all",children:m.text}),(0,d.jsx)(h.x,{href:m.href,openInNewTab:a,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm hover:bg-black/5"})]});return"url"===m.linkType?(0,d.jsx)(i.k,{href:m.href,children:c}):c}return(0,d.jsx)(i.U,{href:m.href,text:m.text,linkType:m.linkType??"url",faviconUrl:m.faviconUrl,showFavicon:b})}return"number"===m.kind||"currency"===m.kind?(0,d.jsx)("span",{className:"tabular-nums",children:m.text}):(0,d.jsx)(d.Fragment,{children:m.text})}function m({value:a,fieldType:b,mode:c="table",className:m,showUrlFavicon:n=!1,linkInteractionMode:o="inline"}){let p=(0,f.KJ)(a,b),q="table"===c;if("empty"===p.kind)return(0,d.jsx)(j,{});let r=p.text.replace(/\\r\\n/g,"\n").replace(/\\n/g,"\n").replace(/\\r/g,"\n");if(r.includes("\n")){let a=r.split("\n"),c=m??(q?"block max-w-[300px] line-clamp-3":"break-words");return(0,d.jsx)("span",{className:c,children:a.map((a,c)=>(0,d.jsxs)(e.Fragment,{children:[c>0&&(0,d.jsx)("br",{}),(0,d.jsx)(l,{text:a,fieldType:b,showUrlFavicon:n,linkInteractionMode:o,isTableMode:q})]},c))})}let s=m??(q?"truncate block max-w-[300px]":"break-words");if("link"===p.kind&&p.href){let a="url"===p.linkType||"file"===p.linkType,b=!q&&!!p.embedUrl&&!!p.mediaType,c=n&&"url"===p.linkType&&!!p.faviconUrl;if("button"===o){let e=(0,d.jsxs)("div",{className:q?"block max-w-[300px]":"w-full",children:[(0,d.jsxs)("span",{className:"flex w-full min-w-0 items-center gap-1.5",style:{color:"var(--color-accent)"},children:[c&&(0,d.jsx)(g.A,{src:p.faviconUrl}),(0,d.jsx)("span",{className:q?"min-w-0 truncate":"min-w-0 break-all",children:p.text}),(0,d.jsx)(h.x,{href:p.href,openInNewTab:a})]}),b&&(0,d.jsx)(k,{mediaType:p.mediaType,url:p.embedUrl,label:p.text})]});return"url"===p.linkType?(0,d.jsx)(i.k,{href:p.href,children:e}):e}return(0,d.jsxs)("div",{className:q?"block max-w-[300px]":"w-full",children:[(0,d.jsx)(i.U,{href:p.href,text:p.text,linkType:p.linkType??"url",faviconUrl:p.faviconUrl,showFavicon:c,layout:"block",className:q?"truncate":""}),b&&(0,d.jsx)(k,{mediaType:p.mediaType,url:p.embedUrl,label:p.text})]})}return"number"===p.kind||"currency"===p.kind?(0,d.jsx)("span",{className:`tabular-nums ${s}`,children:p.text}):(0,d.jsx)("span",{className:s,children:r})}},685233:(a,b,c)=>{"use strict";c.d(b,{X:()=>a6,S:()=>a7});var d=c(736927),e=c(115962),f=c(213505),g=c(492081),h=c(755726),i=c(922123),j=c(478105),k=c(363269),l=c(515016),m=c(558287),n=c(631608),o=c(846069),p=c(744277),q=c(68200),r=c(316780),s=c(398367),t=c(405287),u=c(587464),v=c(173961),w=c(760687),x=c(840512);let y=e.createContext(void 0),z=e.createContext(void 0),A=e.createContext(void 0),B=e.createContext("");function C(){let a=e.useContext(y);if(!a)throw Error((0,x.A)(22));return a}function D(){let a=e.useContext(z);if(!a)throw Error((0,x.A)(23));return a}function E(){let a=e.useContext(A);if(!a)throw Error((0,x.A)(24));return a}var F=c(569869);let G=(a,b)=>Object.is(a,b);function H(a,b,c){return null==a||null==b?Object.is(a,b):c(a,b)}function I(a,b,c){return a&&0!==a.length?a.findIndex(a=>void 0!==a&&H(a,b,c)):-1}function J(a){if(null==a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function K(a){return null!=a&&a.length>0&&"object"==typeof a[0]&&null!=a[0]&&"items"in a[0]}function L(a,b){if(b&&null!=a)return b(a)??"";if(a&&"object"==typeof a){if("label"in a&&null!=a.label)return String(a.label);if("value"in a)return String(a.value)}return J(a)}function M(a,b){return b&&null!=a?b(a)??"":a&&"object"==typeof a&&"value"in a&&"label"in a?J(a.value):J(a)}let N={id:(0,F.M)(a=>a.id),query:(0,F.M)(a=>a.query),items:(0,F.M)(a=>a.items),selectedValue:(0,F.M)(a=>a.selectedValue),hasSelectionChips:(0,F.M)(a=>{let b=a.selectedValue;return Array.isArray(b)&&b.length>0}),hasSelectedValue:(0,F.M)(a=>{let{selectedValue:b,selectionMode:c}=a;return null!=b&&(!("multiple"===c&&Array.isArray(b))||b.length>0)}),hasNullItemLabel:(0,F.M)((a,b)=>!!b&&function(a){if(!Array.isArray(a))return null!=a&&!("null"in a);if(K(a)){for(let b of a)for(let a of b.items)if(a&&null==a.value&&null!=a.label)return!0;return!1}for(let b of a)if(b&&null==b.value&&null!=b.label)return!0;return!1}(a.items)),open:(0,F.M)(a=>a.open),mounted:(0,F.M)(a=>a.mounted),forceMounted:(0,F.M)(a=>a.forceMounted),inline:(0,F.M)(a=>a.inline),activeIndex:(0,F.M)(a=>a.activeIndex),selectedIndex:(0,F.M)(a=>a.selectedIndex),isActive:(0,F.M)((a,b)=>a.activeIndex===b),isSelected:(0,F.M)((a,b)=>{let c=a.isItemEqualToValue,d=a.selectedValue;return Array.isArray(d)?d.some(a=>H(b,a,c)):H(b,d,c)}),transitionStatus:(0,F.M)(a=>a.transitionStatus),popupProps:(0,F.M)(a=>a.popupProps),inputProps:(0,F.M)(a=>a.inputProps),triggerProps:(0,F.M)(a=>a.triggerProps),getItemProps:(0,F.M)(a=>a.getItemProps),positionerElement:(0,F.M)(a=>a.positionerElement),listElement:(0,F.M)(a=>a.listElement),triggerElement:(0,F.M)(a=>a.triggerElement),inputElement:(0,F.M)(a=>a.inputElement),popupSide:(0,F.M)(a=>a.popupSide),openMethod:(0,F.M)(a=>a.openMethod),inputInsidePopup:(0,F.M)(a=>a.inputInsidePopup),selectionMode:(0,F.M)(a=>a.selectionMode),listRef:(0,F.M)(a=>a.listRef),labelsRef:(0,F.M)(a=>a.labelsRef),popupRef:(0,F.M)(a=>a.popupRef),emptyRef:(0,F.M)(a=>a.emptyRef),inputRef:(0,F.M)(a=>a.inputRef),keyboardActiveRef:(0,F.M)(a=>a.keyboardActiveRef),chipsContainerRef:(0,F.M)(a=>a.chipsContainerRef),clearRef:(0,F.M)(a=>a.clearRef),valuesRef:(0,F.M)(a=>a.valuesRef),allValuesRef:(0,F.M)(a=>a.allValuesRef),name:(0,F.M)(a=>a.name),disabled:(0,F.M)(a=>a.disabled),readOnly:(0,F.M)(a=>a.readOnly),required:(0,F.M)(a=>a.required),grid:(0,F.M)(a=>a.grid),isGrouped:(0,F.M)(a=>a.isGrouped),virtualized:(0,F.M)(a=>a.virtualized),onOpenChangeComplete:(0,F.M)(a=>a.onOpenChangeComplete),openOnInputClick:(0,F.M)(a=>a.openOnInputClick),itemToStringLabel:(0,F.M)(a=>a.itemToStringLabel),isItemEqualToValue:(0,F.M)(a=>a.isItemEqualToValue),modal:(0,F.M)(a=>a.modal),autoHighlight:(0,F.M)(a=>a.autoHighlight),submitOnItemClick:(0,F.M)(a=>a.submitOnItemClick)};var O=c(230652),P=c(577225);let Q=function(a){return a.disabled="data-disabled",a.valid="data-valid",a.invalid="data-invalid",a.touched="data-touched",a.dirty="data-dirty",a.filled="data-filled",a.focused="data-focused",a}({}),R=e.createContext({invalid:void 0,name:void 0,validityData:{state:{badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},errors:[],error:"",value:"",initialValue:null},setValidityData:P.tE,disabled:void 0,touched:!1,setTouched:P.tE,dirty:!1,setDirty:P.tE,filled:!1,setFilled:P.tE,focused:!1,setFocused:P.tE,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(a=P.t0)=>a,getInputValidationProps:(a=P.t0)=>a,inputRef:{current:null},commit:async()=>{}}});function S(a=!0){let b=e.useContext(R);if(b.setValidityData===P.tE&&!a)throw Error((0,x.A)(28));return b}var T=c(249855);let U=e.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:P.tE,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function V(){return e.useContext(U)}var W=c(725427),X=c(840507);let Y=e.createContext({controlId:void 0,registerControlId:P.tE,labelId:void 0,setLabelId:P.tE,messageIds:[],setMessageIds:P.tE,getDescriptionProps:a=>a});function Z(){return e.useContext(Y)}let _=new Map;var aa=c(735328),ab=c(192083);function ac(a,b){let c=e.useRef(a),d=(0,i.K)(b);(0,g.g)(()=>{c.current!==a&&d(c.current)},[a,d]),(0,g.g)(()=>{c.current=a},[a])}let ad=Symbol("none"),ae={value:ad,index:-1};function af(a){let b,c,x,{id:C,onOpenChangeComplete:D,defaultSelectedValue:E=null,selectedValue:F,onSelectedValueChange:J,defaultInputValue:Q,inputValue:R,selectionMode:U="none",onItemHighlighted:Y,name:af,disabled:ag=!1,readOnly:ah=!1,required:ai=!1,inputRef:aj,grid:ak=!1,items:al,filteredItems:am,filter:an,openOnInputClick:ao=!0,autoHighlight:ap=!1,keepHighlight:aq=!1,highlightItemOnHover:ar=!0,loopFocus:as=!0,itemToStringLabel:at,itemToStringValue:au,isItemEqualToValue:av=G,virtualized:aw=!1,inline:ax=!1,fillInputOnItemPress:ay=!0,modal:az=!1,limit:aA=-1,autoComplete:aB="list",formAutoComplete:aC,locale:aD,submitOnItemClick:aE=!1}=a,{clearErrors:aF}=V(),{setDirty:aG,validityData:aH,shouldValidateOnChange:aI,setFilled:aJ,name:aK,disabled:aL,setTouched:aM,setFocused:aN,validationMode:aO,validation:aP}=S(),aQ=function(a={}){let{id:b,implicit:c=!1,controlRef:d}=a,{controlId:f,registerControlId:h}=Z(),j=(0,X.e)(b),k=c?f:void 0,m=(0,l.j)(()=>Symbol("labelable-control")),n=e.useRef(!1),o=e.useRef(null!=b),p=(0,i.K)(()=>{n.current&&h!==P.tE&&(n.current=!1,h(m.current,void 0))});return(0,g.g)(()=>{let a;if(h!==P.tE){if(c){let c=d?.current;a=(0,W.vq)(c)&&null!=c.closest("label")?b??null:k??j}else if(null!=b)o.current=!0,a=b;else{if(!o.current)return void p();a=j}if(void 0===a)return void p();n.current=!0,h(m.current,a)}},[b,d,k,h,c,j,m,p]),e.useEffect(()=>p,[p]),f??j}({id:C}),aR=function(a={}){let b={usage:"search",sensitivity:"base",ignorePunctuation:!0,...a},c=`${function a(b){return Array.isArray(b)?b.map(b=>a(b)).join(","):null==b?"":String(b)}(a.locale)}|${JSON.stringify(b)}`,d=_.get(c);if(d)return d;let e=new Intl.Collator(a.locale,b),f={contains(a,b,c){if(!b)return!0;let d=L(a,c);for(let a=0;a<=d.length-b.length;a+=1)if(0===e.compare(d.slice(a,a+b.length),b))return!0;return!1},startsWith(a,b,c){if(!b)return!0;let d=L(a,c);return 0===e.compare(d.slice(0,b.length),b)},endsWith(a,b,c){if(!b)return!0;let d=L(a,c),f=b.length;return d.length>=f&&0===e.compare(d.slice(d.length-f),b)}};return _.set(c,f),f}({locale:aD}),[aS,aT]=e.useState(!1),[aU,aV]=e.useState(null),aW=e.useRef([]),aX=e.useRef([]),aY=e.useRef(null),aZ=e.useRef(null),a$=e.useRef(null),a_=e.useRef(!0),a0=e.useRef(!1),a1=e.useRef(null),a2=e.useRef(null),a3=e.useRef(null),a4=e.useRef(ae),a5=e.useRef(null),a6=e.useRef([]),a7=e.useRef([]),a8=aL||ag,a9=aK??af,ba="multiple"===U,bb="single"===U,bc=void 0!==R||void 0!==Q,bd=void 0!==al,be=void 0!==am;b="always"===ap?"always":!!ap&&"input-change";let[bf,bg]=(0,f.q)({controlled:F,default:ba?E??P.Ml:E,name:"Combobox",state:"selectedValue"}),bh=e.useMemo(()=>null===an?()=>!0:void 0!==an?an:bb&&!aS?(a,b)=>{if(null==a)return!1;if(!b)return!0;let c=L(a,at),d=null!=bf?L(bf,at):"";return!!(d&&aR.contains(d,b))&&d.length===b.length||aR.contains(c,b)}:(a,b)=>{if(null==a)return!1;let c=L(a,at);return aR.contains(c,b)},[an,bb,bf,aS,aR,at]),bi=(0,l.j)(()=>bc?Q??"":bb?L(bf,at):"").current,[bj,bk]=(0,f.q)({controlled:R,default:bi,name:"Combobox",state:"inputValue"}),[bl,bm]=(0,f.q)({controlled:a.open,default:a.defaultOpen,name:"Combobox",state:"open"}),bn=K(al),bo=aU??(""===bj?"":String(bj).trim()),bp=bb?L(bf,at):"",bq=bb&&!aS&&""!==bo&&""!==bp&&bp.length===bo.length&&aR.contains(bp,bo),br=bq?"":bo,bs=bd&&be&&bq,bt=e.useMemo(()=>al?bn?al.flatMap(a=>a.items):al:P.Ml,[al,bn]),bu=e.useMemo(()=>{if(am&&!bs)return am;if(!al)return P.Ml;if(bn){let a=[],b=0;for(let c of al){if(aA>-1&&b>=aA)break;let d=""===br?c.items:c.items.filter(a=>bh(a,br,at));if(0===d.length)continue;let e=aA>-1?aA-b:1/0,f=d.slice(0,e);if(f.length>0){let d={...c,items:f};a.push(d),b+=f.length}}return a}if(""===br)return aA>-1?bt.slice(0,aA):bt;let a=[];for(let b of bt){if(aA>-1&&a.length>=aA)break;bh(b,br,at)&&a.push(b)}return a},[am,bs,al,bn,br,aA,bh,at,bt]),bv=e.useMemo(()=>bn?bu.flatMap(a=>a.items):bu,[bu,bn]),bw=(0,l.j)(()=>new m.i({id:aQ,selectedValue:bf,open:bl,filter:bh,query:bo,items:al,selectionMode:U,listRef:aW,labelsRef:aX,popupRef:aY,emptyRef:a$,inputRef:aZ,keyboardActiveRef:a_,chipsContainerRef:a1,clearRef:a2,valuesRef:a6,allValuesRef:a7,selectionEventRef:a3,name:a9,disabled:a8,readOnly:ah,required:ai,grid:ak,isGrouped:bn,virtualized:aw,openOnInputClick:ao,itemToStringLabel:at,isItemEqualToValue:av,modal:az,autoHighlight:b,submitOnItemClick:aE,hasInputValue:bc,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:ax,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:D||P.tE,setOpen:P.tE,setInputValue:P.tE,setSelectedValue:P.tE,setIndices:P.tE,onItemHighlighted:P.tE,handleSelection:P.tE,getItemProps:()=>P.t0,forceMount:P.tE,requestSubmit:P.tE})).current,bx="none"===U?bj:bf,by=e.useMemo(()=>"none"===U?bx:Array.isArray(bf)?bf.map(a=>M(a,au)):M(bf,au),[bx,au,U,bf]),bz=(0,i.K)(Y),bA=(0,i.K)(D),bB=(0,n.P)(bw,N.activeIndex),bC=(0,n.P)(bw,N.selectedIndex),bD=(0,n.P)(bw,N.positionerElement),bE=(0,n.P)(bw,N.listElement),bF=(0,n.P)(bw,N.triggerElement),bG=(0,n.P)(bw,N.inputElement),bH=(0,n.P)(bw,N.inline),bI=(0,n.P)(bw,N.inputInsidePopup),bJ=(0,o.u)(bF),{mounted:bK,setMounted:bL,transitionStatus:bM}=(0,aa.$)(bl),{openMethod:bN,triggerProps:bO,reset:bP}=(0,ab.G)(bl);!function(a){let{enabled:b=!0,value:c,id:d,name:e,controlRef:f,commit:h}=a,{formRef:j}=V(),{invalid:k,markedDirtyRef:l,validityData:m,setValidityData:n}=S(),o=(0,i.K)(a.getValue);(0,g.g)(()=>{if(!b)return;let a=c;void 0===a&&(a=o()),null===m.initialValue&&null!==a&&n(b=>({...b,initialValue:a}))},[b,n,c,m.initialValue,o]),(0,g.g)(()=>{b&&d&&j.current.fields.set(d,{getValue:o,name:e,controlRef:f,validityData:{...m,state:{...m.state,valid:!k&&m.state.valid}},validate(a=!0){let b=c;void 0===b&&(b=o()),l.current=!0,a?T.flushSync(()=>h(b)):h(b)}})},[h,f,b,j,o,d,k,l,e,m,c]),(0,g.g)(()=>{let a=j.current.fields;return()=>{d&&a.delete(d)}},[j,d])}({id:aQ,name:a9,commit:aP.commit,value:bx,controlRef:bI?bJ:aZ,getValue:()=>by});let bQ=(0,i.K)(()=>{al?aX.current=bv.map(a=>L(a,at)):bw.set("forceMounted",!0)}),bR=e.useRef(bf);(0,g.g)(()=>{bf!==bR.current&&bQ()},[bQ,bf]);let bS=(0,i.K)(a=>{bw.update(a);let b=a.type||"none";if(void 0!==a.activeIndex)if(null===a.activeIndex)a4.current!==ae&&(a4.current=ae,bz(void 0,(0,v.M)(b,void 0,{index:-1})));else{let c=a6.current[a.activeIndex];a4.current={value:c,index:a.activeIndex},bz(c,(0,v.M)(b,void 0,{index:a.activeIndex}))}}),bT=(0,i.K)((c,d)=>{if(a0.current=d.reason===w.qs,a.onInputValueChange?.(c,d),!d.isCanceled){if(d.reason===w.pf){let a=d.event,e=a.inputType;if("compositionend"===a.type||null!=e&&""!==e&&"insertReplacementText"!==e){let a=""!==c.trim();a&&aT(!0),a5.current={hasQuery:a},a&&b&&null==bw.state.activeIndex&&bw.set("activeIndex",0)}}bk(c)}}),bU=(0,i.K)((b,c)=>{if(bl!==b&&("escape-key"===c.reason&&bd&&0===bv.length&&!bw.state.emptyRef.current&&c.allowPropagation(),a.onOpenChange?.(b,c),!c.isCanceled&&(!b&&aS&&(bb?(bH||aV(bo),""===bo&&aT(!1)):ba&&(bH||bI?bS({activeIndex:null}):aV(bo),bT("",(0,v.d)(w.qs,c.event)))),bm(b),!b&&bI&&(c.reason===w.Xn||c.reason===w.Np))&&(aM(!0),aN(!1),"onBlur"===aO))){let a="none"===U?bj:bf;aP.commit(a)}}),bV=(0,i.K)((a,b)=>{J?.(a,b),!b.isCanceled&&(bg(a),("none"===U&&aY.current&&ay||bb&&!bw.state.inputInsidePopup)&&bT(L(a,at),(0,v.d)(b.reason,b.event)),bb&&null!=a&&b.reason!==w.pf&&aS&&!bH&&aV(bo))}),bW=(0,i.K)((a,b)=>{let c=b;if(void 0===c){if(null===bB)return;c=a6.current[bB]}let d=(0,u.EW)(a),e=a3.current??a;a3.current=null;let f=(0,v.d)(w.Bo,e),g=d?.closest("a")?.getAttribute("href");if(g){g.startsWith("#")&&bU(!1,f);return}if(ba){var h,i,j,k;let a=Array.isArray(bf)?bf:[];if(bV((h=c,i=bw.state.isItemEqualToValue,a&&0!==a.length&&a.some(a=>void 0!==a&&H(h,a,i)))?(j=c,k=bw.state.isItemEqualToValue,a.filter(a=>!H(j,a,k))):[...a,c],f),!(aZ.current&&""!==aZ.current.value.trim()))return;bw.state.inputInsidePopup?bT("",(0,v.d)(w.qs,f.event)):bU(!1,f)}else bV(c,f),bU(!1,f)}),bX=(0,i.K)(()=>{if(!bw.state.submitOnItemClick)return;let a=bw.state.inputElement?.form;a&&"function"==typeof a.requestSubmit&&a.requestSubmit()}),bY=(0,i.K)(()=>{if(bL(!1),bA?.(!1),aT(!1),bP(),aV(null),"none"===U?bS({activeIndex:null,selectedIndex:null}):bS({activeIndex:null}),ba&&aZ.current&&""!==aZ.current.value&&!a0.current&&bT("",(0,v.d)(w.qs)),bb)if(bw.state.inputInsidePopup)aZ.current&&""!==aZ.current.value&&bT("",(0,v.d)(w.qs));else{let a=L(bf,at);if(aZ.current&&aZ.current.value!==a){let b=""===a?w.qs:w.dv;bT(a,(0,v.d)(b))}}}),bZ=e.useMemo(()=>bH&&bD?{current:bD.closest('[role="dialog"]')}:aY,[bH,bD]);(0,O.v)({enabled:!a.actionsRef,open:bl,ref:bZ,onComplete(){bl||bY()}}),e.useImperativeHandle(a.actionsRef,()=>({unmount:bY}),[bY]),(0,g.g)(function(){if(bl||"none"===U)return;let a=al?bt:a7.current;if(ba){let b=Array.isArray(bf)?bf:[],c=I(a,b[b.length-1],av);bS({selectedIndex:-1===c?null:c})}else{let b=I(a,bf,av);bS({selectedIndex:-1===b?null:b})}},[bl,bf,al,U,bt,ba,av,bS]),(0,g.g)(()=>{al&&(a6.current=bv,aW.current.length=bv.length)},[al,bv]),(0,g.g)(()=>{let a=a5.current;if(a&&(a.hasQuery?b&&bw.set("activeIndex",0):"always"===b&&bw.set("activeIndex",0),a5.current=null),!bl&&!bH)return;let c=bd||be?bv:a6.current,d=bw.state.activeIndex;if(null==d)return"always"===b&&c.length>0?void bw.set("activeIndex",0):void(a4.current!==ae&&(a4.current=ae,bw.state.onItemHighlighted(void 0,(0,v.M)(w.dv,void 0,{index:-1}))));if(d>=c.length){a4.current!==ae&&(a4.current=ae,bw.state.onItemHighlighted(void 0,(0,v.M)(w.dv,void 0,{index:-1}))),bw.set("activeIndex",null);return}let e=c[d],f=a4.current.value,g=f!==ad&&H(e,f,bw.state.isItemEqualToValue);a4.current.index===d&&g||(a4.current={value:e,index:d},bw.state.onItemHighlighted(e,(0,v.M)(w.dv,void 0,{index:d})))},[bB,b,be,bd,bv,bH,bl,bw]),(0,g.g)(()=>{if("none"===U)return void aJ(""!==String(bj));aJ(ba?Array.isArray(bf)&&bf.length>0:null!=bf)},[aJ,U,bj,bf,ba]),e.useEffect(()=>{bd&&b&&0===bv.length&&bS({activeIndex:null})},[bd,b,bv.length,bS]),ac(bo,()=>{bl&&""!==bo&&bo!==String(bi)&&aT(!0)}),ac(bf,()=>{if("none"!==U&&(aF(a9),aG(bf!==aH.initialValue),aI()?aP.commit(bf):aP.commit(bf,!0),bb&&!bc&&!bI)){let a=L(bf,at);bj!==a&&bT(a,(0,v.d)(w.dv))}}),ac(bj,()=>{"none"===U&&(aF(a9),aG(bj!==aH.initialValue),aI()?aP.commit(bj):aP.commit(bj,!0))}),ac(al,()=>{if(!bb||bc||bI||aS)return;let a=L(bf,at);bj!==a&&bT(a,(0,v.d)(w.dv))});let b$=(0,p.P)({open:!!bH||bl,onOpenChange:bU,elements:{reference:bI?bF:bG,floating:bD}});bH||(c=ak?"grid":"listbox",x=bl?"true":"false");let b_=e.useMemo(()=>{let a=bG?.tagName==="INPUT",b=a||bl,d=a?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return b&&(d.role="combobox",d["aria-expanded"]=x,d["aria-haspopup"]=c,d["aria-controls"]=bl?bE?.id:void 0,d["aria-autocomplete"]=aB),{reference:d,floating:{role:"presentation"}}},[bG,bl,x,c,bE?.id,aB]),b0=(0,q.k)(b$,{enabled:!ah&&!a8&&ao,event:"mousedown-only",toggle:!1,touchOpenDelay:50*!bI,reason:w._J}),b1=(0,r.s)(b$,{enabled:!ah&&!a8&&!bH,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:!!bH||void 0,outsidePress(a){let b=(0,u.EW)(a);return!(0,u.gR)(bF,b)&&!(0,u.gR)(a2.current,b)&&!(0,u.gR)(a1.current,b)}}),b2=(0,s.C)(b$,{enabled:!ah&&!a8,id:aQ,listRef:aW,activeIndex:bB,selectedIndex:bC,virtual:!0,loopFocus:as,allowEscape:as&&!b,focusItemOnOpen:!aS&&("none"!==U||!!b)&&"auto",focusItemOnHover:ar,resetOnPointerLeave:!aq,cols:ak?2:1,orientation:ak?"horizontal":void 0,disabledIndices:P.Ml,onNavigate(a,b){(b||bl)&&"ending"!==bM&&(b?bS({activeIndex:a,type:a_.current?"keyboard":"pointer"}):bS({activeIndex:a}))}}),{getReferenceProps:b3,getFloatingProps:b4,getItemProps:b5}=(0,t.b)([b_,b0,b1,b2]);(0,h.j)(()=>{bw.update({inline:ax,popupProps:b4(),inputProps:b3(),triggerProps:bO,getItemProps:b5,setOpen:bU,setInputValue:bT,setSelectedValue:bV,setIndices:bS,onItemHighlighted:bz,handleSelection:bW,forceMount:bQ,requestSubmit:bX})}),(0,g.g)(()=>{bw.update({id:aQ,selectedValue:bf,open:bl,mounted:bK,transitionStatus:bM,items:al,inline:ax,popupProps:b4(),inputProps:b3(),triggerProps:bO,openMethod:bN,getItemProps:b5,selectionMode:U,name:a9,disabled:a8,readOnly:ah,required:ai,grid:ak,isGrouped:bn,virtualized:aw,onOpenChangeComplete:bA,openOnInputClick:ao,itemToStringLabel:at,modal:az,autoHighlight:b,isItemEqualToValue:av,submitOnItemClick:aE,hasInputValue:bc,requestSubmit:bX})},[bw,aQ,bf,bl,bK,bM,al,b4,b3,b5,bN,bO,U,a9,a8,ah,ai,aP,ak,bn,aw,bA,ao,at,az,av,aE,bc,ax,bX,b]);let b6=(0,j.a)(aj,aP.inputRef),b7=e.useMemo(()=>({query:bo,hasItems:bd,filteredItems:bu,flatFilteredItems:bv}),[bo,bd,bu,bv]),b8=e.useMemo(()=>Array.isArray(bx)?"":M(bx,au),[bx,au]),b9=ba&&Array.isArray(bf)&&bf.length>0,ca=ba||"none"===U?void 0:a9,cb=e.useMemo(()=>ba&&Array.isArray(bf)&&a9?bf.map(a=>{let b=M(a,au);return(0,d.jsx)("input",{type:"hidden",name:a9,value:b},b)}):null,[ba,bf,a9,au]),cc=(0,d.jsxs)(e.Fragment,{children:[a.children,(0,d.jsx)("input",{...aP.getInputValidationProps({onFocus(){if(bI)return void bF?.focus();(aZ.current||bF)?.focus()},onChange(a){if(a.nativeEvent.defaultPrevented)return;let b=a.target.value,c=(0,v.d)(w.dv,a.nativeEvent);function d(){if(ba)return;if("none"===U){aG(b!==aH.initialValue),bT(b,c),aI()&&aP.commit(b);return}let a=a6.current.find(a=>M(a,au).toLowerCase()===b.toLowerCase());null!=a&&(aG(a!==aH.initialValue),bV?.(a,c),aI()&&aP.commit(a))}al?d():(bQ(),queueMicrotask(d))}}),id:aQ&&null==ca?`${aQ}-hidden-input`:void 0,name:ca,autoComplete:aC,disabled:a8,required:ai&&!b9,readOnly:ah,value:b8,ref:b6,style:ca?k.a:k.Q,tabIndex:-1,"aria-hidden":!0}),cb]});return(0,d.jsx)(y.Provider,{value:bw,children:(0,d.jsx)(z.Provider,{value:b$,children:(0,d.jsx)(A.Provider,{value:b7,children:(0,d.jsx)(B.Provider,{value:bj,children:cc})})})})}var ag=c(504745),ah=c(577979),ai=c(654277);let aj={...ai.jL,valid:a=>null===a?null:a?{[Q.valid]:""}:{[Q.invalid]:""},popupSide:a=>a?{"data-popup-side":a}:null,listEmpty:a=>a?{"data-list-empty":""}:null},ak=e.createContext(void 0);var al=c(20960);let am=e.createContext(void 0);function an(a){let b=e.useContext(am);if(void 0===b&&!a)throw Error((0,x.A)(21));return b}var ao=c(729406);let ap=e.forwardRef(function(a,b){let{render:c,className:d,disabled:f=!1,id:g,...h}=a,{state:j,disabled:k,setTouched:l,setFocused:m,validationMode:o,validation:p}=S(),{labelId:q}=Z(),r=e.useContext(ak),s=!!an(!0),t=C(),{filteredItems:u}=E(),x=e.useContext(B),y=(0,ao.j)(),z=(0,n.P)(t,N.required),A=(0,n.P)(t,N.disabled),D=(0,n.P)(t,N.readOnly),F=(0,n.P)(t,N.name),G=(0,n.P)(t,N.selectionMode),H=(0,n.P)(t,N.autoHighlight),I=(0,n.P)(t,N.inputProps),J=(0,n.P)(t,N.triggerProps),K=(0,n.P)(t,N.open),L=(0,n.P)(t,N.mounted),M=(0,n.P)(t,N.selectedValue),O=(0,n.P)(t,N.popupSide),P=(0,n.P)(t,N.positionerElement),Q=(0,n.P)(t,N.id),R=(0,n.P)(t,N.inline),T=!!H,U=k||A||f,V=0===u.length,W=s||R,Y=(0,X.e)(g??(W?void 0:Q)),[_,aa]=e.useState(null),ab=e.useRef(!1),ac=e.useRef(null),ad=e.useRef(!1),ae=(0,i.K)(a=>{let b=s||t.state.inline;b&&!t.state.hasInputValue&&t.state.setInputValue("",(0,v.d)(w.dv)),t.update({inputElement:a,inputInsidePopup:b})}),af={...j,open:K,disabled:U,readOnly:D,popupSide:L&&P?O:null,listEmpty:V};return(0,ah.o)("input",a,{state:af,ref:[b,t.state.inputRef,ae],props:[I,J,{type:"text",value:a.value??_??x,"aria-readonly":D||void 0,"aria-required":z||void 0,"aria-labelledby":q,disabled:U,readOnly:D,required:"none"===G?z:void 0,..."none"===G&&F&&{name:F},id:Y,onFocus(){if(m(!0),!R||!ad.current)return;ad.current=!1;let a=ac.current;null!=a&&Object.hasOwn(t.state.valuesRef.current,a)&&t.state.setIndices({activeIndex:a})},onBlur(){l(!0),m(!1);let a=t.state.activeIndex;if(R&&null!==a&&"always"!==H&&(ac.current=a,ad.current=!0,t.state.setIndices({activeIndex:null})),"onBlur"===o){let a="none"===G?x:M;p.commit(a)}},onCompositionStart(a){ag.m0||(ab.current=!0,aa(a.currentTarget.value))},onCompositionEnd(a){ab.current=!1;let b=a.currentTarget.value;aa(null),t.state.setInputValue(b,(0,v.d)(w.pf,a.nativeEvent))},onChange(a){let b=a.nativeEvent.inputType,c=ab.current||!(!b||"insertReplacementText"===b);if(ab.current){let b=a.currentTarget.value;aa(b),""!==b||t.state.openOnInputClick||t.state.inputInsidePopup||t.state.setOpen(!1,(0,v.d)(w.qs,a.nativeEvent));let d=b.trim();!D&&!U&&d&&c&&(t.state.setOpen(!0,(0,v.d)(w.pf,a.nativeEvent)),T||t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&null!==t.state.activeIndex&&!(T&&""!==d)&&t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"});return}t.state.setInputValue(a.currentTarget.value,(0,v.d)(w.pf,a.nativeEvent));let d=""===a.currentTarget.value,e=(0,v.d)(w.qs,a.nativeEvent);d&&!t.state.inputInsidePopup&&("single"===G&&t.state.setSelectedValue(null,e),t.state.openOnInputClick||t.state.setOpen(!1,e));let f=a.currentTarget.value.trim();!D&&!U&&f&&c&&(t.state.setOpen(!0,(0,v.d)(w.pf,a.nativeEvent)),T||t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&null!==t.state.activeIndex&&!T&&t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(a){if(U||D||a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)return;t.state.keyboardActiveRef.current=!0;let b=a.currentTarget,c=b.scrollWidth-b.clientWidth,d="rtl"===y;if("Home"===a.key){(0,al.jo)(a);let c=ag.gm&&d?b.value.length:0;b.setSelectionRange(c,c),b.scrollLeft=0;return}if("End"===a.key){(0,al.jo)(a);let e=ag.gm&&d?0:b.value.length;b.setSelectionRange(e,e),b.scrollLeft=d?-c:c;return}if(!L&&"Escape"===a.key){let b="multiple"===G&&Array.isArray(M)?0===M.length:null===M,c=(0,v.d)(w.jv,a.nativeEvent);t.state.setInputValue("",c),t.state.setSelectedValue("multiple"===G?[]:null,c),b||t.state.inline||c.isPropagationAllowed||a.stopPropagation();return}if(r&&"Backspace"===a.key&&""===b.value&&void 0===r.highlightedChipIndex&&Array.isArray(M)&&M.length>0){let b=M.slice(0,-1);t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"}),t.state.setSelectedValue(b,(0,v.d)(w.dv,a.nativeEvent));return}let e=r?.highlightedChipIndex!==void 0,f=function(a){let b;if(!r)return;let{highlightedChipIndex:c}=r;if(void 0!==c){if("ArrowLeft"===a.key)a.preventDefault(),b=c>0?c-1:void 0;else if("ArrowRight"===a.key)a.preventDefault(),b=c<M.length-1?c+1:void 0;else if("Backspace"===a.key||"Delete"===a.key){a.preventDefault();let d=c>=M.length-1?M.length-2:c;b=d>=0?d:void 0,t.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return b}return"ArrowLeft"===a.key&&(a.currentTarget.selectionStart??0)===0&&M.length>0?(a.preventDefault(),b=Math.max(M.length-1,0)):"Backspace"===a.key&&""===a.currentTarget.value&&M.length>0&&(t.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),a.preventDefault()),b}(a);if(r?.setHighlightedChipIndex(f),void 0!==f?r?.chipsRef.current[f]?.focus():e&&t.state.inputRef.current?.focus(),229!==a.which&&"Enter"===a.key&&K){let b=t.state.activeIndex,c=a.nativeEvent;if(null===b)return void t.state.setOpen(!1,(0,v.d)(w.dv,c));(0,al.jo)(a);let d=t.state.listRef.current[b];d&&(t.state.selectionEventRef.current=c,d.click(),t.state.selectionEventRef.current=null)}},onPointerMove(){t.state.keyboardActiveRef.current=!1},onPointerDown(){t.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(h):h],stateAttributesMapping:aj})});var aq=c(402831);let ar=e.createContext(void 0),as=e.forwardRef(function(a,b){let{keepMounted:c=!1,...e}=a,f=C(),g=(0,n.P)(f,N.mounted),h=(0,n.P)(f,N.forceMounted);return g||c||h?(0,d.jsx)(ar.Provider,{value:c,children:(0,d.jsx)(aq.XF,{ref:b,...e})}):null});var at=c(640023),au=c(568069),av=c(275819),aw=c(293863),ax=c(994152),ay=c(929035);let az=e.forwardRef(function(a,b){let{render:c,className:f,anchor:h,positionMethod:j="absolute",side:k="bottom",align:l="center",sideOffset:m=0,alignOffset:o=0,collisionBoundary:p="clipping-ancestors",collisionPadding:q=5,arrowPadding:r=5,sticky:s=!1,disableAnchorTracking:t=!1,collisionAvoidance:u=aw.uD,...v}=a,w=C(),{filteredItems:y}=E(),z=D(),A=function(){let a=e.useContext(ar);if(void 0===a)throw Error((0,x.A)(20));return a}(),B=(0,n.P)(w,N.modal),F=(0,n.P)(w,N.open),G=(0,n.P)(w,N.mounted),H=(0,n.P)(w,N.openMethod),I=(0,n.P)(w,N.triggerElement),J=(0,n.P)(w,N.inputElement),K=(0,n.P)(w,N.inputInsidePopup),L=(0,n.P)(w,N.transitionStatus),M=0===y.length,O=h??(K?I:J),P=(0,av.s)({anchor:O,floatingRootContext:z,positionMethod:j,mounted:G,side:k,sideOffset:m,align:l,alignOffset:o,arrowPadding:r,collisionBoundary:p,collisionPadding:q,sticky:s,disableAnchorTracking:t,keepMounted:A,collisionAvoidance:u,lazyFlip:!0});(0,au.K)(F&&B&&"touch"!==H,I);let Q=e.useMemo(()=>{let a={...P.positionerStyles};return F||(a.pointerEvents="none"),{role:"presentation",hidden:!G,style:a}},[F,G,P.positionerStyles]),R={open:F,side:P.side,align:P.align,anchorHidden:P.anchorHidden,empty:M};(0,g.g)(()=>{w.set("popupSide",P.side)},[w,P.side]);let S=e.useMemo(()=>({side:P.side,align:P.align,arrowRef:P.arrowRef,arrowUncentered:P.arrowUncentered,arrowStyles:P.arrowStyles,anchorHidden:P.anchorHidden,isPositioned:P.isPositioned}),[P.side,P.align,P.arrowRef,P.arrowUncentered,P.arrowStyles,P.anchorHidden,P.isPositioned]),T=(0,i.K)(a=>{w.set("positionerElement",a)}),U=(0,ah.o)("div",a,{state:R,ref:[b,T],props:[Q,(0,ax.d)(L),v],stateAttributesMapping:ai.GW});return(0,d.jsxs)(am.Provider,{value:S,children:[G&&B&&(0,d.jsx)(ay.W,{inert:(0,at.Y)(!F),cutout:J??I}),U]})});var aA=c(474228),aB=c(238978);let aC={...ai.GW,...aB.G},aD=e.forwardRef(function(a,b){let c,{render:e,className:f,initialFocus:g,finalFocus:h,...i}=a,j=C(),k=an(),l=D(),{filteredItems:m}=E(),o=(0,n.P)(j,N.mounted),p=(0,n.P)(j,N.open),q=(0,n.P)(j,N.openMethod),r=(0,n.P)(j,N.transitionStatus),s=(0,n.P)(j,N.inputInsidePopup),t=(0,n.P)(j,N.inputElement),v=0===m.length;(0,O.v)({open:p,ref:j.state.popupRef,onComplete(){p&&j.state.onOpenChangeComplete(!0)}});let w={open:p,side:k.side,align:k.align,anchorHidden:k.anchorHidden,transitionStatus:r,empty:v},x=(0,ah.o)("div",a,{state:w,ref:[b,j.state.popupRef],props:[{role:s?"dialog":"presentation",tabIndex:-1,onFocus(a){let b=(0,u.EW)(a.nativeEvent);"touch"!==q&&((0,u.gR)(j.state.listElement,b)||b===a.currentTarget)&&j.state.inputRef.current?.focus()}},(0,ax.d)(r),i],stateAttributesMapping:aC}),y=!!s&&(a=>"touch"===a?j.state.popupRef.current:t);return c=null!=h?h:!!s&&void 0,(0,d.jsx)(aA.s,{context:l,disabled:!o,modal:!s,openInteractionType:q,initialFocus:void 0===g?y:g,returnFocus:c,children:x})}),aE=e.createContext(null);function aF(a){let{children:b}=a,{filteredItems:c}=E(),f=e.useContext(aE),g=f?f.items:c;return g?(0,d.jsx)(e.Fragment,{children:g.map(b)}):null}var aG=c(987038);let aH=e.forwardRef(function(a,b){var c;let{render:f,className:g,children:h,...j}=a,k=C(),l=D(),m=!!an(!0),{filteredItems:o}=E(),p=(0,n.P)(k,N.items),q=(0,n.P)(k,N.labelsRef),r=(0,n.P)(k,N.listRef),s=(0,n.P)(k,N.selectionMode),t=(0,n.P)(k,N.grid),u=(0,n.P)(k,N.popupProps),v=(0,n.P)(k,N.disabled),w=(0,n.P)(k,N.readOnly),x=(0,n.P)(k,N.virtualized),y=0===o.length,z=(0,i.K)(a=>{k.set("positionerElement",a)}),A=(0,i.K)(a=>{k.set("listElement",a)}),B=e.useMemo(()=>"function"==typeof h?c||(c=(0,d.jsx)(aF,{children:h})):h,[h]),F=l.useState("floatingId"),G=(0,ah.o)("div",a,{state:{empty:y},ref:[b,A,m?null:z],props:[u,{children:B,tabIndex:-1,id:F,role:t?"grid":"listbox","aria-multiselectable":"multiple"===s?"true":void 0,onKeyDown(a){if(!v&&!w&&"Enter"===a.key){let b=k.state.activeIndex;if(null==b)return;(0,al.jo)(a);let c=a.nativeEvent,d=k.state.listRef.current[b];d&&(k.state.selectionEventRef.current=c,d.click(),k.state.selectionEventRef.current=null)}},onKeyDownCapture(){k.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){k.state.keyboardActiveRef.current=!1}},j]});return x?G:(0,d.jsx)(aG.u,{elementsRef:r,labelsRef:p?void 0:q,children:G})});var aI=c(360412);let aJ=e.createContext(void 0);var aK=c(642228);let aL=e.createContext(!1),aM=e.memo(e.forwardRef(function(a,b){let{render:c,className:f,value:h=null,index:i,disabled:j=!1,nativeButton:k=!1,...l}=a,m=e.useRef(!1),o=e.useRef(null),p=(0,aI.q)({index:i,textRef:o,indexGuessBehavior:aI.G.GuessFromOrder}),q=C(),r=e.useContext(aL),{flatFilteredItems:s,hasItems:t}=E(),u=(0,n.P)(q,N.open),v=(0,n.P)(q,N.selectionMode),w=(0,n.P)(q,N.readOnly),x=(0,n.P)(q,N.virtualized),y=(0,n.P)(q,N.isItemEqualToValue),z="none"!==v,A=i??(x?I(s,h,y):p.index),B=-1!==p.index,D=(0,n.P)(q,N.id),F=(0,n.P)(q,N.isActive,A),G=(0,n.P)(q,N.isSelected,h),J=(0,n.P)(q,N.getItemProps),K=e.useRef(null),L=null!=D&&B?`${D}-${A}`:void 0,M=G&&z;(0,g.g)(()=>{if(!(B&&(x||null!=i)))return;let a=q.state.listRef.current;return a[A]=K.current,()=>{delete a[A]}},[B,x,A,i,q]),(0,g.g)(()=>{if(!B||t)return;let a=q.state.valuesRef.current;return a[A]=h,"none"!==v&&q.state.allValuesRef.current.push(h),()=>{delete a[A]}},[B,t,A,h,q,v]),(0,g.g)(()=>{if(!u){m.current=!1;return}if(!B||t)return;let a=q.state.selectedValue;H(h,Array.isArray(a)?a[a.length-1]:a,y)&&q.set("selectedIndex",A)},[B,t,u,q,A,h,y]);let O=J({active:F,selected:M});O.id=void 0,O.onFocus=void 0;let{getButtonProps:P,buttonRef:Q}=(0,aK.s)({disabled:j,focusableWhenDisabled:!0,native:k});function R(a){function b(){q.state.handleSelection(a,h)}q.state.submitOnItemClick?(T.flushSync(b),q.state.requestSubmit()):b()}let S=(0,ah.o)("div",a,{ref:[Q,b,p.ref,K],state:{disabled:j,selected:M,highlighted:F},props:[O,{id:L,role:r?"gridcell":"option","aria-selected":z?M:void 0,tabIndex:void 0,onPointerDownCapture(a){m.current=!0,a.preventDefault()},onClick(a){j||w||R(a.nativeEvent)},onMouseUp(a){let b=m.current;m.current=!1,j||w||0!==a.button||b||!F||R(a.nativeEvent)}},l,P]}),U=e.useMemo(()=>({selected:M,textRef:o}),[M,o]);return(0,d.jsx)(aJ.Provider,{value:U,children:S})}));var aN=c(165046);let aO=function(a){let{multiple:b=!1,defaultValue:c,value:e,onValueChange:f,autoComplete:g,...h}=a;return(0,d.jsx)(af,{...h,selectionMode:b?"multiple":"single",selectedValue:e,defaultSelectedValue:c,onSelectedValueChange:f,formAutoComplete:g})},aP=e.forwardRef(({className:a,...b},c)=>(0,d.jsx)(ap,{ref:c,"data-slot":"combobox-input",className:(0,aN.cn)("w-full rounded-xl py-2 text-sm outline-none transition-colors",a),...b}));function aQ({className:a,side:b="bottom",sideOffset:c=8,align:e="start",alignOffset:f=0,anchor:g,...h}){return(0,d.jsx)(as,{children:(0,d.jsx)(az,{side:b,sideOffset:c,align:e,alignOffset:f,anchor:g,className:"isolate z-[10000]",children:(0,d.jsx)(aD,{"data-slot":"combobox-content",className:(0,aN.cn)("bg-neutral-100/[0.67] dark:bg-neutral-900/[0.67] border border-white dark:border-white/10 backdrop-blur-md text-[var(--color-text)] max-h-[var(--available-height)] w-[calc(var(--anchor-width)+48px)] overflow-hidden rounded-3xl p-1 shadow-[0_0_25px_0_rgba(0,0,0,0.16)] outline-none","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",a),...h})})})}function aR({className:a,...b}){return(0,d.jsx)(aH,{"data-slot":"combobox-list",className:(0,aN.cn)("max-h-[300px] overflow-y-auto overscroll-contain thin-scrollbar",a),...b})}function aS({className:a,children:b,...c}){return(0,d.jsx)(aM,{"data-slot":"combobox-item",className:(0,aN.cn)("bg-transparent data-highlighted:bg-neutral-400/15 text-sm transition-all relative flex w-full cursor-pointer items-center gap-2.5 rounded-2xl px-3 py-2 outline-none select-none","data-disabled:pointer-events-none data-disabled:opacity-50",a),...c,children:b})}aP.displayName="ComboboxInput";var aT=c(941809),aU=c(896703),aV=c(490654),aW=c(75567);function aX(a){return(0,aW.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.875 2.292a.114.114 0 0 0-.032.018A7.239 7.239 0 0 0 4.75 8.25a7.248 7.248 0 0 0 3.654 6.297c.57.327.982.955.941 1.682v.002l-.317 6.058a.75.75 0 1 1-1.498-.078l.317-6.062v-.004c.006-.09-.047-.215-.188-.296A8.749 8.749 0 0 1 3.25 8.25a8.738 8.738 0 0 1 3.732-7.169 1.547 1.547 0 0 1 1.709-.064c.484.292.809.835.809 1.46v4.714a.25.25 0 0 0 .119.213l2.25 1.385c.08.05.182.05.262 0l2.25-1.385a.25.25 0 0 0 .119-.213V2.478c0-.626.325-1.169.81-1.461a1.547 1.547 0 0 1 1.708.064 8.741 8.741 0 0 1 3.732 7.17 8.747 8.747 0 0 1-4.41 7.598c-.14.081-.193.206-.188.296v.004l.318 6.062a.75.75 0 1 1-1.498.078l-.317-6.058v-.002c-.041-.727.37-1.355.94-1.682A7.247 7.247 0 0 0 19.25 8.25a7.239 7.239 0 0 0-3.093-5.94.114.114 0 0 0-.032-.018l-.01-.001c-.003 0-.014 0-.031.01-.036.022-.084.079-.084.177V7.19c0 .608-.315 1.172-.833 1.49l-2.25 1.385a1.75 1.75 0 0 1-1.834 0l-2.25-1.384A1.752 1.752 0 0 1 8 7.192V2.477c0-.098-.048-.155-.084-.176a.068.068 0 0 0-.031-.011l-.01.001Z"},child:[]}]})(a)}function aY(a){return(0,aW.k5)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M2.5 7C2.5 9.48528 4.51472 11.5 7 11.5C9.48528 11.5 11.5 9.48528 11.5 7C11.5 4.51472 9.48528 2.5 7 2.5C4.51472 2.5 2.5 4.51472 2.5 7ZM2.5 17C2.5 19.4853 4.51472 21.5 7 21.5C9.48528 21.5 11.5 19.4853 11.5 17C11.5 14.5147 9.48528 12.5 7 12.5C4.51472 12.5 2.5 14.5147 2.5 17ZM12.5 17C12.5 19.4853 14.5147 21.5 17 21.5C19.4853 21.5 21.5 19.4853 21.5 17C21.5 14.5147 19.4853 12.5 17 12.5C14.5147 12.5 12.5 14.5147 12.5 17ZM9.5 7C9.5 8.38071 8.38071 9.5 7 9.5C5.61929 9.5 4.5 8.38071 4.5 7C4.5 5.61929 5.61929 4.5 7 4.5C8.38071 4.5 9.5 5.61929 9.5 7ZM9.5 17C9.5 18.3807 8.38071 19.5 7 19.5C5.61929 19.5 4.5 18.3807 4.5 17C4.5 15.6193 5.61929 14.5 7 14.5C8.38071 14.5 9.5 15.6193 9.5 17ZM19.5 17C19.5 18.3807 18.3807 19.5 17 19.5C15.6193 19.5 14.5 18.3807 14.5 17C14.5 15.6193 15.6193 14.5 17 14.5C18.3807 14.5 19.5 15.6193 19.5 17ZM17.5252 11.155L17.8026 10.5186C18.297 9.38398 19.1876 8.48059 20.2988 7.98638L21.1534 7.60631C21.6155 7.4008 21.6155 6.7284 21.1534 6.52289L20.3467 6.16406C19.2068 5.65713 18.3002 4.72031 17.8143 3.54712L17.5295 2.85945C17.3309 2.38018 16.669 2.38018 16.4705 2.85945L16.1856 3.54712C15.6997 4.72031 14.7932 5.65713 13.6534 6.16406L12.8466 6.52289C12.3845 6.7284 12.3845 7.4008 12.8466 7.60631L13.7011 7.98638C14.8124 8.48059 15.7029 9.38398 16.1974 10.5186L16.4748 11.155C16.6778 11.6209 17.3222 11.6209 17.5252 11.155Z"},child:[]}]})(a)}var aZ=c(826948),a$=c(57137),a_=c(489619),a0=c(86839),a1=c(981188);function a2(a){let b=a.path??a.id,c=b.split("/").pop()??a.label;return{name:"object"===a.kind?(0,a0.PV)(a.label):c,path:b,type:a.nodeType??("object"===a.kind?"folder":"file")}}function a3(){let{resolvedTheme:a,setTheme:b}=(0,aZ.D)(),[c,f]=(0,e.useState)(!1);if(!c)return(0,d.jsx)("div",{className:"w-[26px] h-[26px]"});let g="dark"===a;return(0,d.jsx)("button",{type:"button",onClick:()=>b(g?"light":"dark"),className:"p-1.5 rounded-lg transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:g?"Switch to light mode":"Switch to dark mode",children:g?(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,d.jsx)("path",{d:"M12 2v2"}),(0,d.jsx)("path",{d:"M12 20v2"}),(0,d.jsx)("path",{d:"m4.93 4.93 1.41 1.41"}),(0,d.jsx)("path",{d:"m17.66 17.66 1.41 1.41"}),(0,d.jsx)("path",{d:"M2 12h2"}),(0,d.jsx)("path",{d:"M20 12h2"}),(0,d.jsx)("path",{d:"m6.34 17.66-1.41 1.41"}),(0,d.jsx)("path",{d:"m19.07 4.93-1.41 1.41"})]}):(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})})}function a4(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("path",{d:"m21 21-4.3-4.3"})]})}function a5({type:a}){switch(a){case"folder":return(0,d.jsx)(aT.A,{size:16,style:{flexShrink:0,color:"#60a5fa"}});case"document":default:return(0,d.jsx)(aU.A,{size:16,style:{flexShrink:0,opacity:.7}});case"database":return(0,d.jsx)(aV.A,{size:16,style:{flexShrink:0}})}}function a6({onSelect:a,searchFn:b}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(""),k=(0,e.useRef)(!1),l=(0,e.useRef)(null),m=(0,e.useRef)(null),n=(0,e.useCallback)(a=>{if(k.current){k.current=!1;return}if(j(a),!a.trim()){f([]),h(!1);return}b?(f(b(a.trim(),20).map(a2)),h(!0)):(l.current&&clearTimeout(l.current),l.current=setTimeout(async()=>{try{let b=await fetch(`/api/workspace/suggest-files?q=${encodeURIComponent(a.trim())}`),c=await b.json();f(c.items??[]),h(!0)}catch{f([])}},150))},[b]);return(0,d.jsxs)(aO,{value:null,open:g,onOpenChange:a=>{a||h(!1)},onValueChange:b=>{b&&(k.current=!0,a(b),h(!1),j(""),f([]))},onInputValueChange:n,filter:null,itemToStringLabel:()=>"",children:[(0,d.jsxs)("div",{ref:m,className:"relative",children:[(0,d.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none z-10",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(a4,{})}),(0,d.jsx)(aP,{placeholder:"Search",className:"w-full pl-9 pr-10 py-1.5 rounded-xl text-sm outline-none transition-colors",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"}})]}),(0,d.jsxs)(aQ,{anchor:m,children:[(0,d.jsx)(aR,{children:c.map(a=>(0,d.jsxs)(aS,{value:a,children:[(0,d.jsx)("span",{className:"flex-shrink-0",style:{color:"var(--color-text-muted)",opacity:.55},children:(0,d.jsx)(a5,{type:a.type})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"truncate font-medium",children:a.name}),(0,d.jsx)("div",{className:"truncate text-xs",style:{color:"var(--color-text-muted)"},children:a.path.split("/").slice(0,-1).join("/")})]})]},a.path))}),i.trim()&&0===c.length&&(0,d.jsx)("div",{className:"py-3 text-center text-sm",style:{color:"var(--color-text-muted)"},children:"No files found"})]})]})}function a7({orgName:a,onFileSearchSelect:b,mobile:c,onClose:f,showHidden:g,onToggleHidden:h,width:i,onCollapse:j,compact:k=!1,onToggleCompact:l,activeWorkspace:m,onWorkspaceChanged:n,onNavigate:o,activeCrmTarget:p=null,customCrmObjects:q,activeCrmObjectName:r=null,onNavigateToCrmObject:s,chatsPanel:t,onNewChatSession:u}){let v=c?"280px":i??260,[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)("home"),A=[{id:"crm-people",label:"People",target:"people",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),(0,d.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,d.jsx)("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),(0,d.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})},{id:"crm-companies",label:"Companies",target:"companies",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M3 21h18"}),(0,d.jsx)("path",{d:"M5 21V7l8-4v18"}),(0,d.jsx)("path",{d:"M19 21V11l-6-4"}),(0,d.jsx)("path",{d:"M9 9h0"}),(0,d.jsx)("path",{d:"M9 13h0"}),(0,d.jsx)("path",{d:"M9 17h0"})]})},{id:"crm-inbox",label:"Inbox",target:"inbox",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),(0,d.jsx)("path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11Z"})]})},{id:"crm-calendar",label:"Calendar",target:"calendar",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),(0,d.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,d.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,d.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}],B=[{id:"cloud",label:"Cloud",icon:(0,d.jsx)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,d.jsx)("path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"})})},{id:"integrations",label:"Integrations",icon:(0,d.jsx)(aY,{className:"h-4 w-4 shrink-0","aria-hidden":!0})},{id:"skills",label:"Skills",icon:(0,d.jsx)(aX,{className:"h-4 w-4 shrink-0","aria-hidden":!0})},{id:"cron",label:"Cron",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}],C=(0,d.jsxs)("aside",{className:"flex flex-col h-screen shrink-0 border-r",style:{width:"number"==typeof v?`${v}px`:v,minWidth:"number"==typeof v?`${v}px`:v,background:"var(--color-bg)",borderColor:"var(--color-border)"},children:[l&&(0,d.jsx)("div",{className:"flex items-center justify-center h-[44px] shrink-0",children:(0,d.jsx)("button",{type:"button",onClick:l,className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"Expand sidebar",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M15 3v18"})]})})}),(0,d.jsx)("div",{className:"flex items-center justify-center pb-0.5 shrink-0",children:(0,d.jsx)(a$.N,{activeWorkspaceHint:m??null,onWorkspaceSwitch:()=>{n?.()},onWorkspaceDelete:()=>{n?.()},onCreateWorkspace:()=>{x(!0)},trigger:({onClick:b,activeWorkspace:c,switching:e})=>(0,d.jsx)("button",{type:"button",onClick:b,disabled:e,className:"w-7 h-7 mx-auto rounded-lg overflow-hidden flex items-center justify-center transition-opacity hover:opacity-90",title:`${a||"Workspace"}${c?` — ${c}`:""}`,children:(0,d.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",className:"w-7 h-7 object-cover",draggable:!1})})})}),o&&(0,d.jsxs)("div",{className:"flex flex-col items-center gap-0.5 pt-1 pb-1",children:[A.map(a=>{let b=p===a.target;return(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:a.label,"aria-label":a.label,children:a.icon},a.id)}),q&&q.length>0&&s&&q.map(a=>{let b=r===a.name,c=(0,a0.PV)(a.name);return(0,d.jsx)("button",{type:"button",onClick:()=>s(a.name),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:c,"aria-label":c,children:(0,d.jsx)(a1.P,{name:a.icon,size:16})},`crm-object-${a.name}`)})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0"}),o&&(0,d.jsx)("div",{className:"flex flex-col items-center gap-0.5 py-1",children:B.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:a.label,"aria-label":a.label,children:a.icon},a.id))}),(0,d.jsxs)("div",{className:"flex flex-col items-center py-1.5 gap-0.5",children:[h&&(0,d.jsx)("button",{type:"button",onClick:h,className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:g?"Hide dotfiles":"Show dotfiles",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,d.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,d.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,d.jsx)("path",{d:"m2 2 20 20"})]})})}),(0,d.jsx)(a3,{})]})]}),D=(0,d.jsxs)("aside",{className:`flex flex-col h-screen shrink-0 ${c?"drawer-left":"border-r"}`,style:{width:"number"==typeof v?`${v}px`:v,minWidth:"number"==typeof v?`${v}px`:v,background:"var(--color-bg)",borderColor:"var(--color-border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1 px-2 h-[44px] shrink-0",children:[(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(a$.N,{activeWorkspaceHint:m??null,onWorkspaceSwitch:()=>{n?.()},onWorkspaceDelete:()=>{n?.()},onCreateWorkspace:()=>{x(!0)},trigger:({onClick:b,activeWorkspace:c,switching:e})=>(0,d.jsxs)("button",{type:"button",onClick:b,disabled:e,className:"text-[13px] flex items-center gap-1.5 truncate w-full transition-colors rounded-lg px-2 py-1.5",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"Switch workspace",children:[(0,d.jsx)("span",{className:"truncate font-semibold",children:a||"Workspace"}),c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"shrink-0 opacity-40",children:"/"}),(0,d.jsx)("span",{className:"truncate text-[12px]",style:{color:"var(--color-text-muted)"},children:c})]}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})]})})}),(l||j)&&(0,d.jsx)("button",{type:"button",onClick:l??j,className:"p-1.5 rounded-lg shrink-0 transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:l?"Collapse to icons":"Hide sidebar (⌘B)",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M9 3v18"})]})})]}),t&&(0,d.jsxs)("div",{className:"px-2 pt-1 pb-1 flex items-center gap-1",children:[[{id:"home",label:"Home"},{id:"chats",label:"Chats"}].map(a=>{let b=y===a.id;return(0,d.jsx)("button",{type:"button",onClick:()=>z(a.id),className:"flex-1 px-2 py-1 rounded-md text-[12px] font-medium transition-colors cursor-pointer",style:{color:b?"var(--color-text)":"var(--color-text-muted)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:a.label},a.id)}),"chats"===y&&u&&(0,d.jsx)("button",{type:"button",onClick:u,className:"p-1 rounded-md transition-colors cursor-pointer shrink-0",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"New chat","aria-label":"New chat",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M5 12h14"}),(0,d.jsx)("path",{d:"M12 5v14"})]})})]}),"chats"===y&&t?(0,d.jsx)("div",{className:"flex-1 min-h-0 flex flex-col relative",children:t}):(0,d.jsxs)(d.Fragment,{children:[o&&(0,d.jsxs)("div",{className:"px-2 pt-1 pb-1",children:[(0,d.jsx)("div",{className:"px-2 pt-2 pb-1 text-[9px] lowercase",style:{color:"var(--color-text-muted)",letterSpacing:"0.05em"},children:"workspace"}),(0,d.jsxs)("div",{className:"space-y-0.5",children:[A.map(a=>{let b=p===a.target;return(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.id),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:a.icon}),a.label]},a.id)}),q&&q.length>0&&s&&q.map(a=>{let b=r===a.name,c=(0,a0.PV)(a.name);return(0,d.jsxs)("button",{type:"button",onClick:()=>s(a.name),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:c,children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(a1.P,{name:a.icon,size:16})}),c]},`crm-object-${a.name}`)})]})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0"}),o&&(0,d.jsx)("div",{className:"px-2 py-1 space-y-0.5",children:B.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.id),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:a.icon}),a.label]},a.id))})]}),(0,d.jsxs)("div",{className:"px-2 py-1.5 flex items-center justify-between",children:[(0,d.jsxs)("a",{href:"https://dench.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-2 py-1 rounded-lg text-[11px]",style:{color:"var(--color-text-muted)"},children:["dench.com"," v3.0.2"]}),(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[h&&(0,d.jsx)("button",{type:"button",onClick:h,className:"p-1.5 rounded-lg transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)"},title:g?"Hide dotfiles":"Show dotfiles",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,d.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,d.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,d.jsx)("path",{d:"m2 2 20 20"})]})})}),(0,d.jsx)(a3,{})]})]})]});return c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"drawer-backdrop",onClick:()=>void f?.(),children:(0,d.jsx)("div",{onClick:a=>a.stopPropagation(),className:"fixed inset-y-0 left-0 z-50",children:D})}),(0,d.jsx)(a_.s,{isOpen:w,onClose:()=>x(!1),onCreated:()=>{n?.()}})]}):(0,d.jsxs)(d.Fragment,{children:[!c&&k?C:D,(0,d.jsx)(a_.s,{isOpen:w,onClose:()=>x(!1),onCreated:()=>{n?.()}})]})}},685343:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(95253)._0},686937:a=>{"use strict";var b=Object.prototype.hasOwnProperty,c=Object.prototype.toString,d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=function(a){return"function"==typeof Array.isArray?Array.isArray(a):"[object Array]"===c.call(a)},g=function(a){if(!a||"[object Object]"!==c.call(a))return!1;var d,e=b.call(a,"constructor"),f=a.constructor&&a.constructor.prototype&&b.call(a.constructor.prototype,"isPrototypeOf");if(a.constructor&&!e&&!f)return!1;for(d in a);return void 0===d||b.call(a,d)},h=function(a,b){d&&"__proto__"===b.name?d(a,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):a[b.name]=b.newValue},i=function(a,c){if("__proto__"===c){if(!b.call(a,c))return;else if(e)return e(a,c).value}return a[c]};a.exports=function a(){var b,c,d,e,j,k,l=arguments[0],m=1,n=arguments.length,o=!1;for("boolean"==typeof l&&(o=l,l=arguments[1]||{},m=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});m<n;++m)if(b=arguments[m],null!=b)for(c in b)d=i(l,c),l!==(e=i(b,c))&&(o&&e&&(g(e)||(j=f(e)))?(j?(j=!1,k=d&&f(d)?d:[]):k=d&&g(d)?d:{},h(l,{name:c,newValue:a(o,k,e)})):void 0!==e&&h(l,{name:c,newValue:e}));return l}},699022:(a,b,c)=>{"use strict";function d(a,b){let c=a[b.tabId];return c&&c.sessionId===b.sessionId&&c.sessionKey===b.sessionKey&&c.isStreaming===b.isStreaming&&c.status===b.status&&c.isReconnecting===b.isReconnecting&&c.loadingSession===b.loadingSession?a:{...a,[b.tabId]:b}}function e(a,b){if(!(b in a))return a;let c={...a};return delete c[b],c}function f(a){return{parentStatuses:new Map(a.parentRuns.map(a=>[a.sessionId,a.status])),subagentStatuses:new Map(a.subagents.map(a=>[a.childSessionKey,a.status]))}}c.d(b,{F8:()=>f,T$:()=>e,ZZ:()=>d})},704092:(a,b,c)=>{"use strict";c.r(b),c.d(b,{Alternation:()=>av,Alternative:()=>ap,CstParser:()=>b_,EMPTY_ALT:()=>bZ,EOF:()=>ai,EarlyExitException:()=>br,EmbeddedActionsParser:()=>b0,GAstVisitor:()=>aB,Lexer:()=>V,LexerDefinitionErrorType:()=>d,MismatchedTokenException:()=>bo,NoViableAltException:()=>bp,NonTerminal:()=>an,NotAllInputParsedException:()=>bq,Option:()=>aq,Parser:()=>ca,ParserDefinitionErrorType:()=>g,Repetition:()=>at,RepetitionMandatory:()=>ar,RepetitionMandatoryWithSeparator:()=>as,RepetitionWithSeparator:()=>au,Rule:()=>ao,Terminal:()=>aw,VERSION:()=>h,assignOccurrenceIndices:()=>bf,clearCache:()=>b9,createSyntaxDiagramsCode:()=>b1,createToken:()=>ag,createTokenInstance:()=>aj,defaultGrammarResolverErrorProvider:()=>aM,defaultGrammarValidatorErrorProvider:()=>aN,defaultLexerErrorProvider:()=>T,defaultParserErrorProvider:()=>aL,generateParserFactory:()=>b7,generateParserModule:()=>b8,isRecognitionException:()=>bm,resolveGrammar:()=>bd,serializeGrammar:()=>ax,serializeProduction:()=>ay,tokenLabel:()=>W,tokenMatcher:()=>ak,tokenName:()=>X,validateGrammar:()=>be});var d,e,f,g,h="7.1.2",i=c(165892),j=c(935407),k={},l=new j.RegExpParser;function m(a){var b=a.toString();if(k.hasOwnProperty(b))return k[b];var c=l.pattern(b);return k[b]=c,c}var n=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),o="Complement Sets are not supported for first char optimization",p='Unable to use "first char" lexer optimizations:\n';function q(a,b,c){var d=J(a);b[d]=d,!0===c&&function(a,b){var c=String.fromCharCode(a),d=c.toUpperCase();if(d!==c){var e=J(d.charCodeAt(0));b[e]=e}else{var f=c.toLowerCase();if(f!==c){var e=J(f.charCodeAt(0));b[e]=e}}}(a,b)}function r(a,b){return(0,i.I6)(a.value,function(a){return"number"==typeof a?(0,i.gR)(b,a):void 0!==(0,i.I6)(b,function(b){return a.from<=b&&b<=a.to})})}var s=function(a){function b(b){var c=a.call(this)||this;return c.targetCharCodes=b,c.found=!1,c}return n(b,a),b.prototype.visitChildren=function(b){if(!0!==this.found){switch(b.type){case"Lookahead":this.visitLookahead(b);return;case"NegativeLookahead":this.visitNegativeLookahead(b);return}a.prototype.visitChildren.call(this,b)}},b.prototype.visitCharacter=function(a){(0,i.gR)(this.targetCharCodes,a.value)&&(this.found=!0)},b.prototype.visitSet=function(a){a.complement?void 0===r(a,this.targetCharCodes)&&(this.found=!0):void 0!==r(a,this.targetCharCodes)&&(this.found=!0)},b}(j.BaseRegExpVisitor);function t(a,b){if(!(b instanceof RegExp))return void 0!==(0,i.I6)(b,function(b){return(0,i.gR)(a,b.charCodeAt(0))});var c=m(b),d=new s(a);return d.visit(c),d.found}var u=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),v="PATTERN",w="defaultMode",x="modes",y="boolean"==typeof RegExp("(?:)").sticky,z=/[^\\][\$]/,A=/[^\\[][\^]|^\^/;function B(a){var b=a.ignoreCase?"i":"";return RegExp("^(?:"+a.source+")",b)}function C(a){var b=a.ignoreCase?"iy":"y";return RegExp(""+a.source,b)}function D(a){var b=a.PATTERN;if((0,i.gd)(b))return!1;if((0,i.Tn)(b))return!0;if((0,i.zy)(b,"exec"))return!0;if((0,i.Kg)(b))return!1;throw Error("non exhaustive match")}function E(a){return!!(0,i.Kg)(a)&&1===a.length&&a.charCodeAt(0)}var F={test:function(a){for(var b=a.length,c=this.lastIndex;c<b;c++){var d=a.charCodeAt(c);if(10===d)return this.lastIndex=c+1,!0;if(13===d)return 10===a.charCodeAt(c+1)?this.lastIndex=c+2:this.lastIndex=c+1,!0}return!1},lastIndex:0};function G(a,b){if((0,i.zy)(a,"LINE_BREAKS"))return!1;if((0,i.gd)(a.PATTERN)){try{t(b,a.PATTERN)}catch(a){return{issue:d.IDENTIFY_TERMINATOR,errMsg:a.message}}return!1}if((0,i.Kg)(a.PATTERN))return!1;if(D(a))return{issue:d.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function H(a){return(0,i.Tj)(a,function(a){return(0,i.Kg)(a)&&a.length>0?a.charCodeAt(0):a})}function I(a,b,c){void 0===a[b]?a[b]=[c]:a[b].push(c)}function J(a){return a<256?a:K[a]}var K=[];function L(a,b){var c=a.tokenTypeIdx;return c===b.tokenTypeIdx||!0===b.isParent&&!0===b.categoryMatchesMap[c]}function M(a,b){return a.tokenTypeIdx===b.tokenTypeIdx}var N=1,O={};function P(a){var b,c,d,e=function(a){for(var b=(0,i.T9)(a),c=a,d=!0;d;){c=(0,i.oE)((0,i.Bq)((0,i.Tj)(c,function(a){return a.CATEGORIES})));var e=(0,i.iv)(c,b);b=b.concat(e),(0,i.Im)(e)?d=!1:c=e}return b}(a);b=e,(0,i.jJ)(b,function(a){var b,c;Q(a)||(O[N]=a,a.tokenTypeIdx=N++),R(a)&&!(0,i.cy)(a.CATEGORIES)&&(a.CATEGORIES=[a.CATEGORIES]),R(a)||(a.CATEGORIES=[]),b=a,(0,i.zy)(b,"categoryMatches")||(a.categoryMatches=[]),c=a,(0,i.zy)(c,"categoryMatchesMap")||(a.categoryMatchesMap={})}),c=e,(0,i.jJ)(c,function(a){!function a(b,c){(0,i.jJ)(b,function(a){c.categoryMatchesMap[a.tokenTypeIdx]=!0}),(0,i.jJ)(c.CATEGORIES,function(d){var e=b.concat(c);(0,i.gR)(e,d)||a(e,d)})}([],a)}),d=e,(0,i.jJ)(d,function(a){a.categoryMatches=[],(0,i.jJ)(a.categoryMatchesMap,function(b,c){a.categoryMatches.push(O[c].tokenTypeIdx)})}),(0,i.jJ)(e,function(a){a.isParent=a.categoryMatches.length>0})}function Q(a){return(0,i.zy)(a,"tokenTypeIdx")}function R(a){return(0,i.zy)(a,"CATEGORIES")}function S(a){return(0,i.zy)(a,"tokenTypeIdx")}var T={buildUnableToPopLexerModeMessage:function(a){return"Unable to pop Lexer Mode after encountering Token ->"+a.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(a,b,c,d,e){return"unexpected character: ->"+a.charAt(b)+"<- at offset: "+b+", skipped "+c+" characters."}};!function(a){a[a.MISSING_PATTERN=0]="MISSING_PATTERN",a[a.INVALID_PATTERN=1]="INVALID_PATTERN",a[a.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",a[a.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",a[a.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",a[a.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",a[a.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",a[a.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",a[a.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",a[a.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",a[a.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",a[a.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",a[a.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",a[a.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",a[a.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",a[a.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",a[a.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(d||(d={}));var U={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:T,traceInitPerf:!1,skipValidations:!1};Object.freeze(U);var V=function(){function a(a,b){var c=this;if(void 0===b&&(b=U),this.lexerDefinition=a,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"==typeof b)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=(0,i.h1)(U,b);var e=this.config.traceInitPerf;!0===e?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof e&&(this.traceInitMaxIdent=e,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var e,f=!0;c.TRACE_INIT("Lexer Config handling",function(){if(c.config.lineTerminatorsPattern===U.lineTerminatorsPattern)c.config.lineTerminatorsPattern=F;else if(c.config.lineTerminatorCharacters===U.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(b.safeMode&&b.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');c.trackStartLines=/full|onlyStart/i.test(c.config.positionTracking),c.trackEndLines=/full/i.test(c.config.positionTracking),(0,i.cy)(a)?((e={modes:{}}).modes[w]=(0,i.T9)(a),e[w]=w):(f=!1,e=(0,i.lR)(a))}),!1===c.config.skipValidations&&(c.TRACE_INIT("performRuntimeChecks",function(){var a,b;c.lexerDefinitionErrors=c.lexerDefinitionErrors.concat((a=e,c.trackStartLines,c.config.lineTerminatorCharacters,b=[],(0,i.zy)(a,w)||b.push({message:"A MultiMode Lexer cannot be initialized without a <"+w+"> property in its definition\n",type:d.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,i.zy)(a,x)||b.push({message:"A MultiMode Lexer cannot be initialized without a <"+x+"> property in its definition\n",type:d.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,i.zy)(a,x)&&(0,i.zy)(a,w)&&!(0,i.zy)(a.modes,a.defaultMode)&&b.push({message:"A MultiMode Lexer cannot be initialized with a "+w+": <"+a.defaultMode+">which does not exist\n",type:d.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,i.zy)(a,x)&&(0,i.jJ)(a.modes,function(a,c){(0,i.jJ)(a,function(a,e){(0,i.b0)(a)&&b.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+c+"> at index: <")+e+">\n",type:d.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),b))}),c.TRACE_INIT("performWarningRuntimeChecks",function(){var a,b,f,g,h,j,k,l;c.lexerDefinitionWarning=c.lexerDefinitionWarning.concat((a=e,b=c.trackStartLines,f=c.config.lineTerminatorCharacters,g=[],h=!1,j=(0,i.oE)((0,i.Bq)((0,i.LG)(a.modes,function(a){return a}))),k=(0,i.ku)(j,function(a){return a[v]===V.NA}),l=H(f),b&&(0,i.jJ)(k,function(a){var b=G(a,l);if(!1!==b){var c={message:function(a,b){if(b.issue===d.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n The problem is in the <"+a.name+"> Token Type\n Root cause: "+b.errMsg+".\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(b.issue===d.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n The problem is in the <"+a.name+"> Token Type\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}(a,b),type:b.issue,tokenType:a};g.push(c)}else(0,i.zy)(a,"LINE_BREAKS")?!0===a.LINE_BREAKS&&(h=!0):t(l,a.PATTERN)&&(h=!0)}),b&&!h&&g.push({message:"Warning: No LINE_BREAKS Found.\n This Lexer has been defined to track line and column information,\n But none of the Token Types can be identified as matching a line terminator.\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n for details.",type:d.NO_LINE_BREAKS_FLAGS}),g))})),e.modes=e.modes?e.modes:{},(0,i.jJ)(e.modes,function(a,b){e.modes[b]=(0,i.ku)(a,function(a){return(0,i.b0)(a)})});var g=(0,i.HP)(e.modes);if((0,i.jJ)(e.modes,function(a,e){c.TRACE_INIT("Mode: <"+e+"> processing",function(){if(c.modes.push(e),!1===c.config.skipValidations&&c.TRACE_INIT("validatePatterns",function(){var b,e,f,h,k,l,n,o,p,q,r,s,t,w,x,y,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R;c.lexerDefinitionErrors=c.lexerDefinitionErrors.concat((b=[],k=a,l=(0,i.pb)(k,function(a){return!(0,i.zy)(a,v)}),e={errors:(0,i.Tj)(l,function(a){return{message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:d.MISSING_PATTERN,tokenTypes:[a]}}),valid:(0,i.iv)(k,l)},b=b.concat(e.errors),h=(n=e.valid,o=(0,i.pb)(n,function(a){var b=a[v];return!(0,i.gd)(b)&&!(0,i.Tn)(b)&&!(0,i.zy)(b,"exec")&&!(0,i.Kg)(b)}),f={errors:(0,i.Tj)(o,function(a){return{message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:d.INVALID_PATTERN,tokenTypes:[a]}}),valid:(0,i.iv)(n,o)}).valid,b=(b=(b=(b=(b=b.concat(f.errors)).concat((p=h,q=[],r=(0,i.pb)(p,function(a){return(0,i.gd)(a[v])}),(q=(q=(q=(q=q.concat((s=r,t=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.found=!1,b}return u(b,a),b.prototype.visitEndAnchor=function(a){this.found=!0},b}(j.BaseRegExpVisitor),w=(0,i.pb)(s,function(a){var b=a[v];try{var c=m(b),d=new t;return d.visit(c),d.found}catch(a){return z.test(b.source)}}),(0,i.Tj)(w,function(a){return{message:"Unexpected RegExp Anchor Error:\n Token Type: ->"+a.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",type:d.EOI_ANCHOR_FOUND,tokenTypes:[a]}})))).concat((x=r,y=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.found=!1,b}return u(b,a),b.prototype.visitStartAnchor=function(a){this.found=!0},b}(j.BaseRegExpVisitor),B=(0,i.pb)(x,function(a){var b=a[v];try{var c=m(b),d=new y;return d.visit(c),d.found}catch(a){return A.test(b.source)}}),(0,i.Tj)(B,function(a){return{message:"Unexpected RegExp Anchor Error:\n Token Type: ->"+a.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",type:d.SOI_ANCHOR_FOUND,tokenTypes:[a]}})))).concat((C=r,D=(0,i.pb)(C,function(a){var b=a[v];return b instanceof RegExp&&(b.multiline||b.global)}),(0,i.Tj)(D,function(a){return{message:"Token Type: ->"+a.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:d.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[a]}})))).concat((E=r,F=[],G=(0,i.Tj)(E,function(a){return(0,i.TS)(E,function(b,c){return a.PATTERN.source!==c.PATTERN.source||(0,i.gR)(F,c)||c.PATTERN===V.NA||(F.push(c),b.push(c)),b},[])}),G=(0,i.oE)(G),H=(0,i.pb)(G,function(a){return a.length>1}),(0,i.Tj)(H,function(a){var b=(0,i.Tj)(a,function(a){return a.name});return{message:"The same RegExp pattern ->"+(0,i.$1)(a).PATTERN+"<-has been used in all of the following Token Types: "+b.join(", ")+" <-",type:d.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})))).concat((I=r,J=(0,i.pb)(I,function(a){return a[v].test("")}),(0,i.Tj)(J,function(a){return{message:"Token Type: ->"+a.name+"<- static 'PATTERN' must not match an empty string",type:d.EMPTY_MATCH_PATTERN,tokenTypes:[a]}})))))).concat((K=h,L=(0,i.pb)(K,function(a){if(!(0,i.zy)(a,"GROUP"))return!1;var b=a.GROUP;return b!==V.SKIPPED&&b!==V.NA&&!(0,i.Kg)(b)}),(0,i.Tj)(L,function(a){return{message:"Token Type: ->"+a.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:d.INVALID_GROUP_TYPE_FOUND,tokenTypes:[a]}})))).concat((M=h,N=g,O=(0,i.pb)(M,function(a){return void 0!==a.PUSH_MODE&&!(0,i.gR)(N,a.PUSH_MODE)}),(0,i.Tj)(O,function(a){return{message:"Token Type: ->"+a.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+a.PUSH_MODE+"<-which does not exist",type:d.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}})))).concat((P=h,Q=[],R=(0,i.TS)(P,function(a,b,c){var d,e=b.PATTERN;return e===V.NA||((0,i.Kg)(e)?a.push({str:e,idx:c,tokenType:b}):(0,i.gd)(e)&&(d=e,void 0===(0,i.I6)([".","\\","[","]","|","^","$","(",")","?","*","+","{"],function(a){return -1!==d.source.indexOf(a)}))&&a.push({str:e.source,idx:c,tokenType:b})),a},[]),(0,i.jJ)(P,function(a,b){(0,i.jJ)(R,function(c){var e=c.str,f=c.idx,g=c.tokenType;if(b<f&&function(a,b){if((0,i.gd)(b)){var c=b.exec(a);return null!==c&&0===c.index}if((0,i.Tn)(b))return b(a,0,[],{});if((0,i.zy)(b,"exec"))return b.exec(a,0,[],{});if("string"==typeof b)return b===a;throw Error("non exhaustive match")}(e,a.PATTERN)){var h="Token: ->"+g.name+"<- can never be matched.\nBecause it appears AFTER the Token Type ->"+a.name+"<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE";Q.push({message:h,type:d.UNREACHABLE_PATTERN,tokenTypes:[a,g]})}})}),Q))))}),(0,i.Im)(c.lexerDefinitionErrors)){var f;P(a),c.TRACE_INIT("analyzeTokenTypes",function(){var d,e,g,h,k,l,n,r,s,u,w,x,z,A,F,L,M;d={lineTerminatorCharacters:c.config.lineTerminatorCharacters,positionTracking:b.positionTracking,ensureOptimizations:b.ensureOptimizations,safeMode:b.safeMode,tracer:c.TRACE_INIT.bind(c)},(A=(d=(0,i.NT)(d,{useSticky:y,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(a,b){return b()}})).tracer)("initCharCodeToOptimizedIndexMap",function(){if((0,i.Im)(K)){K=Array(65536);for(var a=0;a<65536;a++)K[a]=a>255?255+~~(a/255):a}}),A("Reject Lexer.NA",function(){e=(0,i.ku)(a,function(a){return a[v]===V.NA})}),F=!1,A("Transform Patterns",function(){F=!1,g=(0,i.Tj)(e,function(a){var b=a[v];if((0,i.gd)(b)){var c=b.source;return 1!==c.length||"^"===c||"$"===c||"."===c||b.ignoreCase?2!==c.length||"\\"!==c[0]||(0,i.gR)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],c[1])?d.useSticky?C(b):B(b):c[1]:c}if((0,i.Tn)(b))return F=!0,{exec:b};if((0,i.zy)(b,"exec"))return F=!0,b;if("string"==typeof b)if(1===b.length)return b;else{var e=new RegExp(b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"));return d.useSticky?C(e):B(e)}throw Error("non exhaustive match")})}),A("misc mapping",function(){h=(0,i.Tj)(e,function(a){return a.tokenTypeIdx}),k=(0,i.Tj)(e,function(a){var b=a.GROUP;if(b!==V.SKIPPED){if((0,i.Kg)(b))return b;if((0,i.b0)(b))return!1;throw Error("non exhaustive match")}}),l=(0,i.Tj)(e,function(a){var b=a.LONGER_ALT;if(b)return(0,i.qh)(e,b)}),n=(0,i.Tj)(e,function(a){return a.PUSH_MODE}),r=(0,i.Tj)(e,function(a){return(0,i.zy)(a,"POP_MODE")})}),A("Line Terminator Handling",function(){var a=H(d.lineTerminatorCharacters);s=(0,i.Tj)(e,function(a){return!1}),"onlyOffset"!==d.positionTracking&&(s=(0,i.Tj)(e,function(b){return(0,i.zy)(b,"LINE_BREAKS")?b.LINE_BREAKS:!1===G(b,a)?t(a,b.PATTERN):void 0}))}),A("Misc Mapping #2",function(){u=(0,i.Tj)(e,D),w=(0,i.Tj)(g,E),x=(0,i.TS)(e,function(a,b){var c=b.GROUP;return(0,i.Kg)(c)&&c!==V.SKIPPED&&(a[c]=[]),a},{}),z=(0,i.Tj)(g,function(a,b){return{pattern:g[b],longerAlt:l[b],canLineTerminator:s[b],isCustom:u[b],short:w[b],group:k[b],push:n[b],pop:r[b],tokenTypeIdx:h[b],tokenType:e[b]}})}),L=!0,M=[],d.safeMode||A("First Char Optimization",function(){M=(0,i.TS)(e,function(a,b,c){if("string"==typeof b.PATTERN){var e;I(a,J(b.PATTERN.charCodeAt(0)),z[c])}else if((0,i.cy)(b.START_CHARS_HINT))(0,i.jJ)(b.START_CHARS_HINT,function(b){var d=J("string"==typeof b?b.charCodeAt(0):b);e!==d&&(e=d,I(a,d,z[c]))});else if((0,i.gd)(b.PATTERN))if(b.PATTERN.unicode)L=!1,d.ensureOptimizations&&(0,i.Zi)(""+p+" Unable to analyze < "+b.PATTERN.toString()+" > pattern.\n The regexp unicode flag is not currently supported by the regexp-to-ast library.\n This will disable the lexer's first char optimizations.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var f=function(a,b){void 0===b&&(b=!1);try{var c=m(a);return function a(b,c,d){switch(b.type){case"Disjunction":for(var e=0;e<b.value.length;e++)a(b.value[e],c,d);break;case"Alternative":for(var f=b.value,e=0;e<f.length;e++){var g=f[e];switch(g.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}switch(g.type){case"Character":q(g.value,c,d);break;case"Set":if(!0===g.complement)throw Error(o);(0,i.jJ)(g.value,function(a){if("number"==typeof a)q(a,c,d);else if(!0===d)for(var b=a.from;b<=a.to;b++)q(b,c,d);else{for(var b=a.from;b<=a.to&&b<256;b++)q(b,c,d);if(a.to>=256)for(var e=a.from>=256?a.from:256,f=a.to,g=J(e),h=J(f),i=g;i<=h;i++)c[i]=i}});break;case"Group":a(g.value,c,d);break;default:throw Error("Non Exhaustive Match")}var h=void 0!==g.quantifier&&0===g.quantifier.atLeast;if("Group"===g.type&&!1===function a(b){return!!b.quantifier&&0===b.quantifier.atLeast||!!b.value&&((0,i.cy)(b.value)?(0,i.Si)(b.value,a):a(b.value))}(g)||"Group"!==g.type&&!1===h)break}break;default:throw Error("non exhaustive match!")}return(0,i.zu)(c)}(c.value,{},c.flags.ignoreCase)}catch(c){if(c.message===o)b&&(0,i.x5)(""+p+" Unable to optimize: < "+a.toString()+" >\n Complement Sets cannot be automatically optimized.\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var d="";b&&(d="\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),(0,i.Zi)(p+"\n Failed parsing: < "+a.toString()+" >\n Using the regexp-to-ast library version: "+j.VERSION+"\n Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+d)}}return[]}(b.PATTERN,d.ensureOptimizations);(0,i.Im)(f)&&(L=!1),(0,i.jJ)(f,function(b){I(a,b,z[c])})}else d.ensureOptimizations&&(0,i.Zi)(""+p+" TokenType: <"+b.name+"> is using a custom token pattern without providing <start_chars_hint> parameter.\n This will disable the lexer's first char optimizations.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),L=!1;return a},[])}),A("ArrayPacking",function(){M=(0,i.VS)(M)}),f={emptyGroups:x,patternIdxToConfig:z,charCodeToPatternIdxToConfig:M,hasCustom:F,canBeOptimized:L}}),c.patternIdxToConfig[e]=f.patternIdxToConfig,c.charCodeToPatternIdxToConfig[e]=f.charCodeToPatternIdxToConfig,c.emptyGroups=(0,i.h1)(c.emptyGroups,f.emptyGroups),c.hasCustom=f.hasCustom||c.hasCustom,c.canModeBeOptimized[e]=f.canBeOptimized}})}),c.defaultMode=e.defaultMode,!(0,i.Im)(c.lexerDefinitionErrors)&&!c.config.deferDefinitionErrorsHandling)throw Error("Errors detected in definition of Lexer:\n"+(0,i.Tj)(c.lexerDefinitionErrors,function(a){return a.message}).join("-----------------------\n"));(0,i.jJ)(c.lexerDefinitionWarning,function(a){(0,i.x5)(a.message)}),c.TRACE_INIT("Choosing sub-methods implementations",function(){if(y?(c.chopInput=i.zK,c.match=c.matchWithTest):(c.updateLastIndex=i.tE,c.match=c.matchWithExec),f&&(c.handleModes=i.tE),!1===c.trackStartLines&&(c.computeNewColumn=i.zK),!1===c.trackEndLines&&(c.updateTokenEndLineColumnLocation=i.tE),/full/i.test(c.config.positionTracking))c.createTokenInstance=c.createFullToken;else if(/onlyStart/i.test(c.config.positionTracking))c.createTokenInstance=c.createStartOnlyToken;else if(/onlyOffset/i.test(c.config.positionTracking))c.createTokenInstance=c.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+c.config.positionTracking+'"');c.hasCustom?(c.addToken=c.addTokenUsingPush,c.handlePayload=c.handlePayloadWithCustom):(c.addToken=c.addTokenUsingMemberAccess,c.handlePayload=c.handlePayloadNoCustom)}),c.TRACE_INIT("Failed Optimization Warnings",function(){var a=(0,i.TS)(c.canModeBeOptimized,function(a,b,c){return!1===b&&a.push(c),a},[]);if(b.ensureOptimizations&&!(0,i.Im)(a))throw Error("Lexer Modes: < "+a.join(", ")+' > cannot be optimized.\n Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n Or inspect the console log for details on how to resolve these issues.')}),c.TRACE_INIT("clearRegExpParserCache",function(){k={}}),c.TRACE_INIT("toFastProperties",function(){(0,i.Bl)(c)})})}return a.prototype.tokenize=function(a,b){if(void 0===b&&(b=this.defaultMode),!(0,i.Im)(this.lexerDefinitionErrors))throw Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+(0,i.Tj)(this.lexerDefinitionErrors,function(a){return a.message}).join("-----------------------\n"));return this.tokenizeInternal(a,b)},a.prototype.tokenizeInternal=function(a,b){var c,d,e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v=this,w=a,x=w.length,y=0,z=0,A=Array(this.hasCustom?0:Math.floor(a.length/10)),B=[],C=this.trackStartLines?1:void 0,D=this.trackStartLines?1:void 0,E=(c=this.emptyGroups,d={},e=(0,i.HP)(c),(0,i.jJ)(e,function(a){var b=c[a];if((0,i.cy)(b))d[a]=[];else throw Error("non exhaustive match")}),d),F=this.trackStartLines,G=this.config.lineTerminatorsPattern,H=0,I=[],K=[],L=[],M=[];Object.freeze(M);var N=void 0;function O(){return I}function P(a){var b=K[J(a)];return void 0===b?M:b}var Q=function(a){if(1===L.length&&void 0===a.tokenType.PUSH_MODE){var b=v.config.errorMessageProvider.buildUnableToPopLexerModeMessage(a);B.push({offset:a.startOffset,line:void 0!==a.startLine?a.startLine:void 0,column:void 0!==a.startColumn?a.startColumn:void 0,length:a.image.length,message:b})}else{L.pop();var c=(0,i.HV)(L);I=v.patternIdxToConfig[c],K=v.charCodeToPatternIdxToConfig[c],H=I.length;var d=v.canModeBeOptimized[c]&&!1===v.config.safeMode;N=K&&d?P:O}};function R(a){L.push(a),K=this.charCodeToPatternIdxToConfig[a],H=(I=this.patternIdxToConfig[a]).length,H=I.length;var b=this.canModeBeOptimized[a]&&!1===this.config.safeMode;N=K&&b?P:O}for(R.call(this,b);y<x;){k=null;var S=w.charCodeAt(y),T=N(S),U=T.length;for(f=0;f<U;f++){var V=(u=T[f]).pattern;l=null;var W=u.short;if(!1!==W?S===W&&(k=V):!0===u.isCustom?null!==(t=V.exec(w,y,A,E))?(k=t[0],void 0!==t.payload&&(l=t.payload)):k=null:(this.updateLastIndex(V,y),k=this.match(V,a,y)),null!==k){if(void 0!==(j=u.longerAlt)){var X=I[j],Y=X.pattern;m=null,!0===X.isCustom?null!==(t=Y.exec(w,y,A,E))?(h=t[0],void 0!==t.payload&&(m=t.payload)):h=null:(this.updateLastIndex(Y,y),h=this.match(Y,a,y)),h&&h.length>k.length&&(k=h,l=m,u=X)}break}}if(null!==k){if(n=k.length,void 0!==(o=u.group)&&(p=u.tokenTypeIdx,q=this.createTokenInstance(k,y,p,u.tokenType,C,D,n),this.handlePayload(q,l),!1===o?z=this.addToken(A,z,q):E[o].push(q)),a=this.chopInput(a,n),y+=n,D=this.computeNewColumn(D,n),!0===F&&!0===u.canLineTerminator){var Z=0,_=void 0,aa=void 0;G.lastIndex=0;do!0===(_=G.test(k))&&(aa=G.lastIndex-1,Z++);while(!0===_);0!==Z&&(C+=Z,D=n-aa,this.updateTokenEndLineColumnLocation(q,o,aa,Z,C,D,n))}this.handleModes(u,Q,R,q)}else{for(var ab=y,ac=C,ad=D,ae=!1;!ae&&y<x;)for(w.charCodeAt(y),a=this.chopInput(a,1),y++,g=0;g<H;g++){var af=I[g],V=af.pattern,W=af.short;if(!1!==W?w.charCodeAt(y)===W&&(ae=!0):!0===af.isCustom?ae=null!==V.exec(w,y,A,E):(this.updateLastIndex(V,y),ae=null!==V.exec(a)),!0===ae)break}r=y-ab,s=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,ab,r,ac,ad),B.push({offset:ab,line:ac,column:ad,length:r,message:s})}}return this.hasCustom||(A.length=z),{tokens:A,groups:E,errors:B}},a.prototype.handleModes=function(a,b,c,d){if(!0===a.pop){var e=a.push;b(d),void 0!==e&&c.call(this,e)}else void 0!==a.push&&c.call(this,a.push)},a.prototype.chopInput=function(a,b){return a.substring(b)},a.prototype.updateLastIndex=function(a,b){a.lastIndex=b},a.prototype.updateTokenEndLineColumnLocation=function(a,b,c,d,e,f,g){var h,i;void 0!==b&&(i=(h=c===g-1)?-1:0,(1!==d||!0!==h)&&(a.endLine=e+i,a.endColumn=f-1+-i))},a.prototype.computeNewColumn=function(a,b){return a+b},a.prototype.createTokenInstance=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return null},a.prototype.createOffsetOnlyToken=function(a,b,c,d){return{image:a,startOffset:b,tokenTypeIdx:c,tokenType:d}},a.prototype.createStartOnlyToken=function(a,b,c,d,e,f){return{image:a,startOffset:b,startLine:e,startColumn:f,tokenTypeIdx:c,tokenType:d}},a.prototype.createFullToken=function(a,b,c,d,e,f,g){return{image:a,startOffset:b,endOffset:b+g-1,startLine:e,endLine:e,startColumn:f,endColumn:f+g-1,tokenTypeIdx:c,tokenType:d}},a.prototype.addToken=function(a,b,c){return 666},a.prototype.addTokenUsingPush=function(a,b,c){return a.push(c),b},a.prototype.addTokenUsingMemberAccess=function(a,b,c){return a[b]=c,++b},a.prototype.handlePayload=function(a,b){},a.prototype.handlePayloadNoCustom=function(a,b){},a.prototype.handlePayloadWithCustom=function(a,b){null!==b&&(a.payload=b)},a.prototype.match=function(a,b,c){return null},a.prototype.matchWithTest=function(a,b,c){return!0===a.test(b)?b.substring(c,a.lastIndex):null},a.prototype.matchWithExec=function(a,b){var c=a.exec(b);return null!==c?c[0]:c},a.prototype.TRACE_INIT=function(a,b){if(!0!==this.traceInitPerf)return b();this.traceInitIndent++;var c=Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--\x3e <"+a+">");var d=(0,i.O1)(b),e=d.time,f=d.value,g=e>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(c+"<-- <"+a+"> time: "+e+"ms"),this.traceInitIndent--,f},a.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",a.NA=/NOT_APPLICABLE/,a}();function W(a){return Y(a)?a.LABEL:a.name}function X(a){return a.name}function Y(a){return(0,i.Kg)(a.LABEL)&&""!==a.LABEL}var Z="categories",_="label",aa="group",ab="push_mode",ac="pop_mode",ad="longer_alt",ae="line_breaks",af="start_chars_hint";function ag(a){return ah(a)}function ah(a){var b=a.pattern,c={};if(c.name=a.name,(0,i.b0)(b)||(c.PATTERN=b),(0,i.zy)(a,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";return(0,i.zy)(a,Z)&&(c.CATEGORIES=a[Z]),P([c]),(0,i.zy)(a,_)&&(c.LABEL=a[_]),(0,i.zy)(a,aa)&&(c.GROUP=a[aa]),(0,i.zy)(a,ac)&&(c.POP_MODE=a[ac]),(0,i.zy)(a,ab)&&(c.PUSH_MODE=a[ab]),(0,i.zy)(a,ad)&&(c.LONGER_ALT=a[ad]),(0,i.zy)(a,ae)&&(c.LINE_BREAKS=a[ae]),(0,i.zy)(a,af)&&(c.START_CHARS_HINT=a[af]),c}var ai=ah({name:"EOF",pattern:V.NA});function aj(a,b,c,d,e,f,g,h){return{image:b,startOffset:c,endOffset:d,startLine:e,endLine:f,startColumn:g,endColumn:h,tokenTypeIdx:a.tokenTypeIdx,tokenType:a}}function ak(a,b){return L(a,b)}P([ai]);var al=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),am=function(){function a(a){this._definition=a}return Object.defineProperty(a.prototype,"definition",{get:function(){return this._definition},set:function(a){this._definition=a},enumerable:!1,configurable:!0}),a.prototype.accept=function(a){a.visit(this),(0,i.jJ)(this.definition,function(b){b.accept(a)})},a}(),an=function(a){function b(b){var c=a.call(this,[])||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),Object.defineProperty(b.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(a){},enumerable:!1,configurable:!0}),b.prototype.accept=function(a){a.visit(this)},b}(am),ao=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.orgText="",(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),ap=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.ignoreAmbiguities=!1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),aq=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),ar=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),as=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),at=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),au=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),b}(am),av=function(a){function b(b){var c=a.call(this,b.definition)||this;return c.idx=1,c.ignoreAmbiguities=!1,c.hasPredicates=!1,(0,i.kp)(c,(0,i.Up)(b,function(a){return void 0!==a})),c}return al(b,a),Object.defineProperty(b.prototype,"definition",{get:function(){return this._definition},set:function(a){this._definition=a},enumerable:!1,configurable:!0}),b}(am),aw=function(){function a(a){this.idx=1,(0,i.kp)(this,(0,i.Up)(a,function(a){return void 0!==a}))}return a.prototype.accept=function(a){a.visit(this)},a}();function ax(a){return(0,i.Tj)(a,ay)}function ay(a){function b(a){return(0,i.Tj)(a,ay)}if(a instanceof an)return{type:"NonTerminal",name:a.nonTerminalName,idx:a.idx};if(a instanceof ap)return{type:"Alternative",definition:b(a.definition)};if(a instanceof aq)return{type:"Option",idx:a.idx,definition:b(a.definition)};if(a instanceof ar)return{type:"RepetitionMandatory",idx:a.idx,definition:b(a.definition)};if(a instanceof as)return{type:"RepetitionMandatoryWithSeparator",idx:a.idx,separator:ay(new aw({terminalType:a.separator})),definition:b(a.definition)};else if(a instanceof au)return{type:"RepetitionWithSeparator",idx:a.idx,separator:ay(new aw({terminalType:a.separator})),definition:b(a.definition)};else if(a instanceof at)return{type:"Repetition",idx:a.idx,definition:b(a.definition)};else if(a instanceof av)return{type:"Alternation",idx:a.idx,definition:b(a.definition)};else if(a instanceof aw){var c={type:"Terminal",name:a.terminalType.name,label:W(a.terminalType),idx:a.idx},d=a.terminalType.PATTERN;return a.terminalType.PATTERN&&(c.pattern=(0,i.gd)(d)?d.source:d),c}else if(a instanceof ao)return{type:"Rule",name:a.name,orgText:a.orgText,definition:b(a.definition)};else throw Error("non exhaustive match")}var az=function(){function a(){}return a.prototype.walk=function(a,b){var c=this;void 0===b&&(b=[]),(0,i.jJ)(a.definition,function(d,e){var f=(0,i.gv)(a.definition,e+1);if(d instanceof an)c.walkProdRef(d,f,b);else if(d instanceof aw)c.walkTerminal(d,f,b);else if(d instanceof ap)c.walkFlat(d,f,b);else if(d instanceof aq)c.walkOption(d,f,b);else if(d instanceof ar)c.walkAtLeastOne(d,f,b);else if(d instanceof as)c.walkAtLeastOneSep(d,f,b);else if(d instanceof au)c.walkManySep(d,f,b);else if(d instanceof at)c.walkMany(d,f,b);else if(d instanceof av)c.walkOr(d,f,b);else throw Error("non exhaustive match")})},a.prototype.walkTerminal=function(a,b,c){},a.prototype.walkProdRef=function(a,b,c){},a.prototype.walkFlat=function(a,b,c){var d=b.concat(c);this.walk(a,d)},a.prototype.walkOption=function(a,b,c){var d=b.concat(c);this.walk(a,d)},a.prototype.walkAtLeastOne=function(a,b,c){var d=[new aq({definition:a.definition})].concat(b,c);this.walk(a,d)},a.prototype.walkAtLeastOneSep=function(a,b,c){var d=aA(a,b,c);this.walk(a,d)},a.prototype.walkMany=function(a,b,c){var d=[new aq({definition:a.definition})].concat(b,c);this.walk(a,d)},a.prototype.walkManySep=function(a,b,c){var d=aA(a,b,c);this.walk(a,d)},a.prototype.walkOr=function(a,b,c){var d=this,e=b.concat(c);(0,i.jJ)(a.definition,function(a){var b=new ap({definition:[a]});d.walk(b,e)})},a}();function aA(a,b,c){return[new aq({definition:[new aw({terminalType:a.separator})].concat(a.definition)})].concat(b,c)}var aB=function(){function a(){}return a.prototype.visit=function(a){switch(a.constructor){case an:return this.visitNonTerminal(a);case ap:return this.visitAlternative(a);case aq:return this.visitOption(a);case ar:return this.visitRepetitionMandatory(a);case as:return this.visitRepetitionMandatoryWithSeparator(a);case au:return this.visitRepetitionWithSeparator(a);case at:return this.visitRepetition(a);case av:return this.visitAlternation(a);case aw:return this.visitTerminal(a);case ao:return this.visitRule(a);default:throw Error("non exhaustive match")}},a.prototype.visitNonTerminal=function(a){},a.prototype.visitAlternative=function(a){},a.prototype.visitOption=function(a){},a.prototype.visitRepetition=function(a){},a.prototype.visitRepetitionMandatory=function(a){},a.prototype.visitRepetitionMandatoryWithSeparator=function(a){},a.prototype.visitRepetitionWithSeparator=function(a){},a.prototype.visitAlternation=function(a){},a.prototype.visitTerminal=function(a){},a.prototype.visitRule=function(a){},a}(),aC=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();function aD(a,b){return void 0===b&&(b=[]),a instanceof aq||a instanceof at||a instanceof au||(a instanceof av?(0,i.zN)(a.definition,function(a){return aD(a,b)}):!(a instanceof an&&(0,i.gR)(b,a))&&a instanceof am&&(a instanceof an&&b.push(a),(0,i.Si)(a.definition,function(a){return aD(a,b)})))}function aE(a){if(a instanceof an)return"SUBRULE";if(a instanceof aq)return"OPTION";if(a instanceof av)return"OR";if(a instanceof ar)return"AT_LEAST_ONE";if(a instanceof as)return"AT_LEAST_ONE_SEP";else if(a instanceof au)return"MANY_SEP";else if(a instanceof at)return"MANY";else if(a instanceof aw)return"CONSUME";else throw Error("non exhaustive match")}var aF=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.separator="-",b.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},b}return aC(b,a),b.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},b.prototype.visitTerminal=function(a){var b=a.terminalType.name+this.separator+"Terminal";(0,i.zy)(this.dslMethods,b)||(this.dslMethods[b]=[]),this.dslMethods[b].push(a)},b.prototype.visitNonTerminal=function(a){var b=a.nonTerminalName+this.separator+"Terminal";(0,i.zy)(this.dslMethods,b)||(this.dslMethods[b]=[]),this.dslMethods[b].push(a)},b.prototype.visitOption=function(a){this.dslMethods.option.push(a)},b.prototype.visitRepetitionWithSeparator=function(a){this.dslMethods.repetitionWithSeparator.push(a)},b.prototype.visitRepetitionMandatory=function(a){this.dslMethods.repetitionMandatory.push(a)},b.prototype.visitRepetitionMandatoryWithSeparator=function(a){this.dslMethods.repetitionMandatoryWithSeparator.push(a)},b.prototype.visitRepetition=function(a){this.dslMethods.repetition.push(a)},b.prototype.visitAlternation=function(a){this.dslMethods.alternation.push(a)},b}(aB),aG=new aF;function aH(a){if(a instanceof an)return aH(a.referencedRule);if(a instanceof aw)return[a.terminalType];if(a instanceof ap||a instanceof aq||a instanceof at||a instanceof ar||a instanceof as||a instanceof au||a instanceof aw||a instanceof ao)return function(a){for(var b,c=[],d=a.definition,e=0,f=d.length>e,g=!0;f&&g;)g=aD(b=d[e]),c=c.concat(aH(b)),e+=1,f=d.length>e;return(0,i.sb)(c)}(a);if(a instanceof av){var b,c;return b=a,c=(0,i.Tj)(b.definition,function(a){return aH(a)}),(0,i.sb)((0,i.Bq)(c))}throw Error("non exhaustive match")}var aI="_~IN~_",aJ=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),aK=function(a){function b(b){var c=a.call(this)||this;return c.topProd=b,c.follows={},c}return aJ(b,a),b.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},b.prototype.walkTerminal=function(a,b,c){},b.prototype.walkProdRef=function(a,b,c){var d,e,f=(d=a.referencedRule,e=a.idx,d.name+e+aI+this.topProd.name),g=aH(new ap({definition:b.concat(c)}));this.follows[f]=g},b}(az),aL={buildMismatchTokenMessage:function(a){var b=a.expected,c=a.actual;return a.previous,a.ruleName,"Expecting "+(Y(b)?"--\x3e "+W(b)+" <--":"token of type --\x3e "+b.name+" <--")+" but found --\x3e '"+c.image+"' <--"},buildNotAllInputParsedMessage:function(a){var b=a.firstRedundant;return a.ruleName,"Redundant input, expecting EOF but found: "+b.image},buildNoViableAltMessage:function(a){var b=a.expectedPathsPerAlt,c=a.actual,d=(a.previous,a.customUserDescription);a.ruleName;var e="Expecting: ",f="\nbut found: '"+(0,i.$1)(c).image+"'";if(d)return e+d+f;var g=(0,i.TS)(b,function(a,b){return a.concat(b)},[]),h=(0,i.Tj)(g,function(a){return"["+(0,i.Tj)(a,function(a){return W(a)}).join(", ")+"]"});return e+"one of these possible Token sequences:\n"+(0,i.Tj)(h,function(a,b){return" "+(b+1)+". "+a}).join("\n")+f},buildEarlyExitMessage:function(a){var b=a.expectedIterationPaths,c=a.actual,d=a.customUserDescription;a.ruleName;var e="Expecting: ",f="\nbut found: '"+(0,i.$1)(c).image+"'";return d?e+d+f:e+("expecting at least one iteration which starts with one of these possible Token sequences::\n <"+(0,i.Tj)(b,function(a){return"["+(0,i.Tj)(a,function(a){return W(a)}).join(",")+"]"}).join(" ,"))+">"+f}};Object.freeze(aL);var aM={buildRuleNotFoundError:function(a,b){return"Invalid grammar, reference to a rule which is not defined: ->"+b.nonTerminalName+"<-\ninside top level rule: ->"+a.name+"<-"}},aN={buildDuplicateFoundError:function(a,b){var c=a.name,d=(0,i.$1)(b),e=d.idx,f=aE(d),g=d instanceof aw?d.terminalType.name:d instanceof an?d.nonTerminalName:"",h="->"+f+(e>0?e:"")+"<- "+(g?"with argument: ->"+g+"<-":"")+"\n appears more than once ("+b.length+" times) in the top level rule: ->"+c+"<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return(h=h.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildNamespaceConflictError:function(a){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+a.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(a){var b=(0,i.Tj)(a.prefixPath,function(a){return W(a)}).join(", "),c=0===a.alternation.idx?"":a.alternation.idx;return"Ambiguous alternatives: <"+a.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\n"+("in <OR"+c+"> inside <")+a.topLevelRule.name+"> Rule,\n<"+b+"> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(a){var b=(0,i.Tj)(a.prefixPath,function(a){return W(a)}).join(", "),c=0===a.alternation.idx?"":a.alternation.idx,d="Ambiguous Alternatives Detected: <"+a.ambiguityIndices.join(" ,")+"> in <OR"+c+"> inside <"+a.topLevelRule.name+"> Rule,\n<"+b+"> may appears as a prefix path in all these alternatives.\n";return d+"See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(a){var b=aE(a.repetition);return 0!==a.repetition.idx&&(b+=a.repetition.idx),"The repetition <"+b+"> within Rule <"+a.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(a){return"deprecated"},buildEmptyAlternationError:function(a){return"Ambiguous empty alternative: <"+(a.emptyChoiceIdx+1)+">"+(" in <OR"+a.alternation.idx+"> inside <")+a.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(a){return"An Alternation cannot have more than 256 alternatives:\n"+("<OR"+a.alternation.idx+"> inside <"+a.topLevelRule.name+"> Rule.\n has ")+(a.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(a){var b=a.topLevelRule.name,c=b+" --\x3e "+i.Tj(a.leftRecursionPath,function(a){return a.name}).concat([b]).join(" --\x3e ");return"Left Recursion found in grammar.\nrule: <"+b+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+c+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(a){return"deprecated"},buildDuplicateRuleNameError:function(a){return"Duplicate definition, rule: ->"+(a.topLevelRule instanceof ao?a.topLevelRule.name:a.topLevelRule)+"<- is already defined in the grammar: ->"+a.grammarName+"<-"}},aO=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),aP=function(a){function b(b,c){var d=a.call(this)||this;return d.nameToTopRule=b,d.errMsgProvider=c,d.errors=[],d}return aO(b,a),b.prototype.resolveRefs=function(){var a=this;(0,i.jJ)((0,i.zu)(this.nameToTopRule),function(b){a.currTopLevel=b,b.accept(a)})},b.prototype.visitNonTerminal=function(a){var b=this.nameToTopRule[a.nonTerminalName];if(b)a.referencedRule=b;else{var c=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,a);this.errors.push({message:c,type:g.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:a.nonTerminalName})}},b}(aB),aQ=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),aR=function(a){function b(b,c){var d=a.call(this,b,c)||this;return d.path=c,d.nextTerminalName="",d.nextTerminalOccurrence=0,d.nextTerminalName=d.path.lastTok.name,d.nextTerminalOccurrence=d.path.lastTokOccurrence,d}return aQ(b,a),b.prototype.walkTerminal=function(a,b,c){if(this.isAtEndOfPath&&a.terminalType.name===this.nextTerminalName&&a.idx===this.nextTerminalOccurrence&&!this.found){var d=new ap({definition:b.concat(c)});this.possibleTokTypes=aH(d),this.found=!0}},b}(function(a){function b(b,c){var d=a.call(this)||this;return d.topProd=b,d.path=c,d.possibleTokTypes=[],d.nextProductionName="",d.nextProductionOccurrence=0,d.found=!1,d.isAtEndOfPath=!1,d}return aQ(b,a),b.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,i.T9)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,i.T9)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},b.prototype.walk=function(b,c){void 0===c&&(c=[]),this.found||a.prototype.walk.call(this,b,c)},b.prototype.walkProdRef=function(a,b,c){if(a.referencedRule.name===this.nextProductionName&&a.idx===this.nextProductionOccurrence){var d=b.concat(c);this.updateExpectedNext(),this.walk(a.referencedRule,d)}},b.prototype.updateExpectedNext=function(){(0,i.Im)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},b}(az)),aS=function(a){function b(b,c){var d=a.call(this)||this;return d.topRule=b,d.occurrence=c,d.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},d}return aQ(b,a),b.prototype.startWalking=function(){return this.walk(this.topRule),this.result},b}(az),aT=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return aQ(b,a),b.prototype.walkMany=function(b,c,d){if(b.idx===this.occurrence){var e=(0,i.$1)(c.concat(d));this.result.isEndOfRule=void 0===e,e instanceof aw&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else a.prototype.walkMany.call(this,b,c,d)},b}(aS),aU=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return aQ(b,a),b.prototype.walkManySep=function(b,c,d){if(b.idx===this.occurrence){var e=(0,i.$1)(c.concat(d));this.result.isEndOfRule=void 0===e,e instanceof aw&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else a.prototype.walkManySep.call(this,b,c,d)},b}(aS),aV=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return aQ(b,a),b.prototype.walkAtLeastOne=function(b,c,d){if(b.idx===this.occurrence){var e=(0,i.$1)(c.concat(d));this.result.isEndOfRule=void 0===e,e instanceof aw&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else a.prototype.walkAtLeastOne.call(this,b,c,d)},b}(aS),aW=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return aQ(b,a),b.prototype.walkAtLeastOneSep=function(b,c,d){if(b.idx===this.occurrence){var e=(0,i.$1)(c.concat(d));this.result.isEndOfRule=void 0===e,e instanceof aw&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else a.prototype.walkAtLeastOneSep.call(this,b,c,d)},b}(aS);function aX(a,b,c){void 0===c&&(c=[]),c=(0,i.T9)(c);var d=[],e=0;function f(f){var g=aX(f.concat((0,i.gv)(a,e+1)),b,c);return d.concat(g)}for(;c.length<b&&e<a.length;){var g=a[e];if(g instanceof ap)return f(g.definition);if(g instanceof an)return f(g.definition);if(g instanceof aq)d=f(g.definition);else if(g instanceof ar){var h=g.definition.concat([new at({definition:g.definition})]);return f(h)}else if(g instanceof as){var h=[new ap({definition:g.definition}),new at({definition:[new aw({terminalType:g.separator})].concat(g.definition)})];return f(h)}else if(g instanceof au){var h=g.definition.concat([new at({definition:[new aw({terminalType:g.separator})].concat(g.definition)})]);d=f(h)}else if(g instanceof at){var h=g.definition.concat([new at({definition:g.definition})]);d=f(h)}else if(g instanceof av)return(0,i.jJ)(g.definition,function(a){!1===(0,i.Im)(a.definition)&&(d=f(a.definition))}),d;else if(g instanceof aw)c.push(g.terminalType);else throw Error("non exhaustive match");e++}return d.push({partialPath:c,suffixDef:(0,i.gv)(a,e)}),d}function aY(a,b,c,d){var e="EXIT_NONE_TERMINAL",f=[e],g="EXIT_ALTERNATIVE",h=!1,j=b.length,k=j-d-1,l=[],m=[];for(m.push({idx:-1,def:a,ruleStack:[],occurrenceStack:[]});!(0,i.Im)(m);){var n=m.pop();if(n===g){h&&(0,i.HV)(m).idx<=k&&m.pop();continue}var o=n.def,p=n.idx,q=n.ruleStack,r=n.occurrenceStack;if(!(0,i.Im)(o)){var s=o[0];if(s===e){var t={idx:p,def:(0,i.gv)(o),ruleStack:(0,i.gc)(q),occurrenceStack:(0,i.gc)(r)};m.push(t)}else if(s instanceof aw)if(p<j-1){var u=p+1;if(c(b[u],s.terminalType)){var t={idx:u,def:(0,i.gv)(o),ruleStack:q,occurrenceStack:r};m.push(t)}}else if(p===j-1)l.push({nextTokenType:s.terminalType,nextTokenOccurrence:s.idx,ruleStack:q,occurrenceStack:r}),h=!0;else throw Error("non exhaustive match");else if(s instanceof an){var v=(0,i.T9)(q);v.push(s.nonTerminalName);var w=(0,i.T9)(r);w.push(s.idx);var t={idx:p,def:s.definition.concat(f,(0,i.gv)(o)),ruleStack:v,occurrenceStack:w};m.push(t)}else if(s instanceof aq){var x={idx:p,def:(0,i.gv)(o),ruleStack:q,occurrenceStack:r};m.push(x),m.push(g);var y={idx:p,def:s.definition.concat((0,i.gv)(o)),ruleStack:q,occurrenceStack:r};m.push(y)}else if(s instanceof ar){var z=new at({definition:s.definition,idx:s.idx}),A=s.definition.concat([z],(0,i.gv)(o)),t={idx:p,def:A,ruleStack:q,occurrenceStack:r};m.push(t)}else if(s instanceof as){var B=new aw({terminalType:s.separator}),z=new at({definition:[B].concat(s.definition),idx:s.idx}),A=s.definition.concat([z],(0,i.gv)(o)),t={idx:p,def:A,ruleStack:q,occurrenceStack:r};m.push(t)}else if(s instanceof au){var x={idx:p,def:(0,i.gv)(o),ruleStack:q,occurrenceStack:r};m.push(x),m.push(g);var B=new aw({terminalType:s.separator}),C=new at({definition:[B].concat(s.definition),idx:s.idx}),A=s.definition.concat([C],(0,i.gv)(o)),y={idx:p,def:A,ruleStack:q,occurrenceStack:r};m.push(y)}else if(s instanceof at){var x={idx:p,def:(0,i.gv)(o),ruleStack:q,occurrenceStack:r};m.push(x),m.push(g);var C=new at({definition:s.definition,idx:s.idx}),A=s.definition.concat([C],(0,i.gv)(o)),y={idx:p,def:A,ruleStack:q,occurrenceStack:r};m.push(y)}else if(s instanceof av)for(var D=s.definition.length-1;D>=0;D--){var E={idx:p,def:s.definition[D].definition.concat((0,i.gv)(o)),ruleStack:q,occurrenceStack:r};m.push(E),m.push(g)}else if(s instanceof ap)m.push({idx:p,def:s.definition.concat((0,i.gv)(o)),ruleStack:q,occurrenceStack:r});else if(s instanceof ao)m.push(function(a,b,c,d){var e=(0,i.T9)(c);e.push(a.name);var f=(0,i.T9)(d);return f.push(1),{idx:b,def:a.definition,ruleStack:e,occurrenceStack:f}}(s,p,q,r));else throw Error("non exhaustive match")}}return l}var aZ=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();!function(a){a[a.OPTION=0]="OPTION",a[a.REPETITION=1]="REPETITION",a[a.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",a[a.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",a[a.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",a[a.ALTERNATION=5]="ALTERNATION"}(e||(e={}));var a$=function(a){function b(b,c,d){var e=a.call(this)||this;return e.topProd=b,e.targetOccurrence=c,e.targetProdType=d,e}return aZ(b,a),b.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},b.prototype.checkIsTarget=function(a,b,c,d){return a.idx===this.targetOccurrence&&this.targetProdType===b&&(this.restDef=c.concat(d),!0)},b.prototype.walkOption=function(b,c,d){this.checkIsTarget(b,e.OPTION,c,d)||a.prototype.walkOption.call(this,b,c,d)},b.prototype.walkAtLeastOne=function(b,c,d){this.checkIsTarget(b,e.REPETITION_MANDATORY,c,d)||a.prototype.walkOption.call(this,b,c,d)},b.prototype.walkAtLeastOneSep=function(b,c,d){this.checkIsTarget(b,e.REPETITION_MANDATORY_WITH_SEPARATOR,c,d)||a.prototype.walkOption.call(this,b,c,d)},b.prototype.walkMany=function(b,c,d){this.checkIsTarget(b,e.REPETITION,c,d)||a.prototype.walkOption.call(this,b,c,d)},b.prototype.walkManySep=function(b,c,d){this.checkIsTarget(b,e.REPETITION_WITH_SEPARATOR,c,d)||a.prototype.walkOption.call(this,b,c,d)},b}(az),a_=function(a){function b(b,c,d){var e=a.call(this)||this;return e.targetOccurrence=b,e.targetProdType=c,e.targetRef=d,e.result=[],e}return aZ(b,a),b.prototype.checkIsTarget=function(a,b){a.idx===this.targetOccurrence&&this.targetProdType===b&&(void 0===this.targetRef||a===this.targetRef)&&(this.result=a.definition)},b.prototype.visitOption=function(a){this.checkIsTarget(a,e.OPTION)},b.prototype.visitRepetition=function(a){this.checkIsTarget(a,e.REPETITION)},b.prototype.visitRepetitionMandatory=function(a){this.checkIsTarget(a,e.REPETITION_MANDATORY)},b.prototype.visitRepetitionMandatoryWithSeparator=function(a){this.checkIsTarget(a,e.REPETITION_MANDATORY_WITH_SEPARATOR)},b.prototype.visitRepetitionWithSeparator=function(a){this.checkIsTarget(a,e.REPETITION_WITH_SEPARATOR)},b.prototype.visitAlternation=function(a){this.checkIsTarget(a,e.ALTERNATION)},b}(aB);function a0(a){for(var b=Array(a),c=0;c<a;c++)b[c]=[];return b}function a1(a){for(var b=[""],c=0;c<a.length;c++){for(var d=a[c],e=[],f=0;f<b.length;f++){var g=b[f];e.push(g+"_"+d.tokenTypeIdx);for(var h=0;h<d.categoryMatches.length;h++){var i="_"+d.categoryMatches[h];e.push(g+i)}}b=e}return b}function a2(a,b){for(var c=(0,i.Tj)(a,function(a){return aX([a],1)}),d=a0(c.length),e=(0,i.Tj)(c,function(a){var b={};return(0,i.jJ)(a,function(a){var c=a1(a.partialPath);(0,i.jJ)(c,function(a){b[a]=!0})}),b}),f=c,g=1;g<=b;g++){var h=f;f=a0(h.length);for(var j=function(a){for(var c=h[a],j=0;j<c.length;j++){var k=c[j].partialPath,l=c[j].suffixDef,m=a1(k);if(function(a,b,c){for(var d=0;d<a.length;d++)if(d!==c){for(var e=a[d],f=0;f<b.length;f++)if(!0===e[b[f]])return!1}return!0}(e,m,a)||(0,i.Im)(l)||k.length===b){var n=d[a];if(!1===a5(n,k)){n.push(k);for(var o=0;o<m.length;o++){var p=m[o];e[a][p]=!0}}}else{var q=aX(l,g+1,k);f[a]=f[a].concat(q),(0,i.jJ)(q,function(b){var c=a1(b.partialPath);(0,i.jJ)(c,function(b){e[a][b]=!0})})}}},k=0;k<h.length;k++)j(k)}return d}function a3(a,b,c,d){var f=new a_(a,e.ALTERNATION,d);return b.accept(f),a2(f.result,c)}function a4(a,b,c,d){var e=new a_(a,c);b.accept(e);var f=e.result,g=new a$(b,a,c).startWalking();return a2([new ap({definition:f}),new ap({definition:g})],d)}function a5(a,b){f:for(var c=0;c<a.length;c++){var d=a[c];if(d.length===b.length){for(var e=0;e<d.length;e++){var f=b[e],g=d[e];if(!1==(f===g||void 0!==g.categoryMatchesMap[f.tokenTypeIdx]))continue f}return!0}}return!1}function a6(a){return(0,i.Si)(a,function(a){return(0,i.Si)(a,function(a){return(0,i.Si)(a,function(a){return(0,i.Im)(a.categoryMatches)})})})}var a7=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();function a8(a){return aE(a)+"_#_"+a.idx+"_#_"+a9(a)}function a9(a){return a instanceof aw?a.terminalType.name:a instanceof an?a.nonTerminalName:""}var ba=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.allProductions=[],b}return a7(b,a),b.prototype.visitNonTerminal=function(a){this.allProductions.push(a)},b.prototype.visitOption=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionWithSeparator=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionMandatory=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionMandatoryWithSeparator=function(a){this.allProductions.push(a)},b.prototype.visitRepetition=function(a){this.allProductions.push(a)},b.prototype.visitAlternation=function(a){this.allProductions.push(a)},b.prototype.visitTerminal=function(a){this.allProductions.push(a)},b}(aB),bb=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.alternations=[],b}return a7(b,a),b.prototype.visitAlternation=function(a){this.alternations.push(a)},b}(aB),bc=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.allProductions=[],b}return a7(b,a),b.prototype.visitRepetitionWithSeparator=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionMandatory=function(a){this.allProductions.push(a)},b.prototype.visitRepetitionMandatoryWithSeparator=function(a){this.allProductions.push(a)},b.prototype.visitRepetition=function(a){this.allProductions.push(a)},b}(aB);function bd(a){a=(0,i.NT)(a,{errMsgProvider:aM});var b,c={};return(0,i.jJ)(a.rules,function(a){c[a.name]=a}),(b=new aP(c,a.errMsgProvider)).resolveRefs(),b.errors}function be(a){var b,c,d,f,h,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return b=(a=(0,i.NT)(a,{errMsgProvider:aN})).rules,c=a.maxLookahead,d=a.tokenTypes,f=a.errMsgProvider,h=a.grammarName,j=i.Tj(b,function(a){var b,c,d,e,h,j;return b=a,c=f,d=new ba,b.accept(d),e=d.allProductions,h=i.$z(e,a8),j=i.Up(h,function(a){return a.length>1}),i.Tj(i.zu(j),function(a){var d=i.$1(a),e=c.buildDuplicateFoundError(b,a),f=aE(d),h={message:e,type:g.DUPLICATE_PRODUCTIONS,ruleName:b.name,dslName:f,occurrence:d.idx},j=a9(d);return j&&(h.parameter=j),h})}),k=i.Tj(b,function(a){return function a(b,c,d,e){void 0===e&&(e=[]);var f=[],h=function a(b){var c=[];if(i.Im(b))return c;var d=i.$1(b);if(d instanceof an)c.push(d.referencedRule);else if(d instanceof ap||d instanceof aq||d instanceof ar||d instanceof as||d instanceof au||d instanceof at)c=c.concat(a(d.definition));else if(d instanceof av)c=i.Bq(i.Tj(d.definition,function(b){return a(b.definition)}));else if(d instanceof aw);else throw Error("non exhaustive match");var e=aD(d),f=b.length>1;if(!e||!f)return c;var g=i.gv(b);return c.concat(a(g))}(c.definition);if(i.Im(h))return[];var j=b.name;i.gR(h,b)&&f.push({message:d.buildLeftRecursionError({topLevelRule:b,leftRecursionPath:e}),type:g.LEFT_RECURSION,ruleName:j});var k=i.iv(h,e.concat([b])),l=i.Tj(k,function(c){var f=i.T9(e);return f.push(c),a(b,c,d,f)});return f.concat(i.Bq(l))}(a,a,f)}),l=[],m=[],n=[],(0,i.Si)(k,i.Im)&&(l=(0,i.Tj)(b,function(a){var b,c,d,e;return b=a,c=f,d=new bb,b.accept(d),e=d.alternations,i.TS(e,function(a,d){var e=i.gc(d.definition),f=i.Tj(e,function(a,e){var f=aY([a],[],null,1);return i.Im(f)?{message:c.buildEmptyAlternationError({topLevelRule:b,alternation:d,emptyChoiceIdx:e}),type:g.NONE_LAST_EMPTY_ALT,ruleName:b.name,occurrence:d.idx,alternative:e+1}:null});return a.concat(i.oE(f))},[])}),m=(0,i.Tj)(b,function(a){var b,d,e,h,j;return b=a,d=c,e=f,h=new bb,b.accept(h),j=h.alternations,j=(0,i.ku)(j,function(a){return!0===a.ignoreAmbiguities}),i.TS(j,function(a,c){var f,h,j,k,l,m,n,o,p,q,r,s,t=a3(c.idx,b,c.maxLookahead||d,c),u=(f=t,h=c,j=b,k=e,l=[],m=(0,i.TS)(f,function(a,b,c){return!0===h.definition[c].ignoreAmbiguities||(0,i.jJ)(b,function(b){var d=[c];(0,i.jJ)(f,function(a,e){c!==e&&a5(a,b)&&!0!==h.definition[e].ignoreAmbiguities&&d.push(e)}),d.length>1&&!a5(l,b)&&(l.push(b),a.push({alts:d,path:b}))}),a},[]),i.Tj(m,function(a){var b=(0,i.Tj)(a.alts,function(a){return a+1});return{message:k.buildAlternationAmbiguityError({topLevelRule:j,alternation:h,ambiguityIndices:b,prefixPath:a.path}),type:g.AMBIGUOUS_ALTS,ruleName:j.name,occurrence:h.idx,alternatives:[a.alts]}})),v=(n=t,o=c,p=b,q=e,r=[],s=(0,i.TS)(n,function(a,b,c){var d=(0,i.Tj)(b,function(a){return{idx:c,path:a}});return a.concat(d)},[]),(0,i.jJ)(s,function(a){if(!0!==o.definition[a.idx].ignoreAmbiguities){var b=a.idx,c=a.path,d=(0,i.JW)(s,function(a){var d;return!0!==o.definition[a.idx].ignoreAmbiguities&&a.idx<b&&(d=a.path,d.length<c.length&&(0,i.Si)(d,function(a,b){var d=c[b];return a===d||d.categoryMatchesMap[a.tokenTypeIdx]}))}),e=(0,i.Tj)(d,function(a){var c=[a.idx+1,b+1],d=0===o.idx?"":o.idx;return{message:q.buildAlternationPrefixAmbiguityError({topLevelRule:p,alternation:o,ambiguityIndices:c,prefixPath:a.path}),type:g.AMBIGUOUS_PREFIX_ALTS,ruleName:p.name,occurrence:d,alternatives:c}});r=r.concat(e)}}),r);return a.concat(u,v)},[])}),r=b,s=c,t=f,u=[],(0,i.jJ)(r,function(a){var b=new bc;a.accept(b);var c=b.allProductions;(0,i.jJ)(c,function(b){var c=function(a){if(a instanceof aq)return e.OPTION;if(a instanceof at)return e.REPETITION;if(a instanceof ar)return e.REPETITION_MANDATORY;if(a instanceof as)return e.REPETITION_MANDATORY_WITH_SEPARATOR;if(a instanceof au)return e.REPETITION_WITH_SEPARATOR;else if(a instanceof av)return e.ALTERNATION;else throw Error("non exhaustive match")}(b),d=b.maxLookahead||s,f=a4(b.idx,a,c,d)[0];if((0,i.Im)((0,i.Bq)(f))){var h=t.buildEmptyRepetitionError({topLevelRule:a,repetition:b});u.push({message:h,type:g.NO_NON_EMPTY_LOOKAHEAD,ruleName:a.name})}})}),n=u),v=b,w=d,x=f,y=[],z=(0,i.Tj)(w,function(a){return a.name}),(0,i.jJ)(v,function(a){var b=a.name;if((0,i.gR)(z,b)){var c=x.buildNamespaceConflictError(a);y.push({message:c,type:g.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:b})}}),o=y,p=(0,i.Tj)(b,function(a){var b,c,d,e;return b=a,c=f,d=new bb,b.accept(d),e=d.alternations,i.TS(e,function(a,d){return d.definition.length>255&&a.push({message:c.buildTooManyAlternativesError({topLevelRule:b,alternation:d}),type:g.TOO_MANY_ALTS,ruleName:b.name,occurrence:d.idx}),a},[])}),q=(0,i.Tj)(b,function(a){var c=a,d=b,e=h,j=f,k=[];if((0,i.TS)(d,function(a,b){return b.name===c.name?a+1:a},0)>1){var l=j.buildDuplicateRuleNameError({topLevelRule:c,grammarName:e});k.push({message:l,type:g.DUPLICATE_RULE_NAME,ruleName:c.name})}return k}),i.Bq(j.concat(n,k,l,m,o,p,q))}function bf(a){(0,i.jJ)(a.rules,function(a){var b=new aF;a.accept(b),(0,i.jJ)(b.dslMethods,function(a){(0,i.jJ)(a,function(a,b){a.idx=b+1})})})}var bg=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),bh="MismatchedTokenException",bi="NoViableAltException",bj="EarlyExitException",bk="NotAllInputParsedException",bl=[bh,bi,bj,bk];function bm(a){return(0,i.gR)(bl,a.name)}Object.freeze(bl);var bn=function(a){function b(b,c){var d=this.constructor,e=a.call(this,b)||this;return e.token=c,e.resyncedTokens=[],Object.setPrototypeOf(e,d.prototype),Error.captureStackTrace&&Error.captureStackTrace(e,e.constructor),e}return bg(b,a),b}(Error),bo=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e.previousToken=d,e.name=bh,e}return bg(b,a),b}(bn),bp=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e.previousToken=d,e.name=bi,e}return bg(b,a),b}(bn),bq=function(a){function b(b,c){var d=a.call(this,b,c)||this;return d.name=bk,d}return bg(b,a),b}(bn),br=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e.previousToken=d,e.name=bj,e}return bg(b,a),b}(bn),bs={},bt="InRuleRecoveryException";function bu(a){this.name=bt,this.message=a}bu.prototype=Error.prototype;var bv=function(){function a(){}return a.prototype.initRecoverable=function(a){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,i.zy)(a,"recoveryEnabled")?a.recoveryEnabled:bX.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=bw)},a.prototype.getTokenToInsert=function(a){var b=aj(a,"",NaN,NaN,NaN,NaN,NaN,NaN);return b.isInsertedInRecovery=!0,b},a.prototype.canTokenTypeBeInsertedInRecovery=function(a){return!0},a.prototype.tryInRepetitionRecovery=function(a,b,c,d){for(var e=this,f=this.findReSyncTokenType(),g=this.exportLexerState(),h=[],j=!1,k=this.LA(1),l=this.LA(1),m=function(){var a=e.LA(0),b=new bo(e.errorMessageProvider.buildMismatchTokenMessage({expected:d,actual:k,previous:a,ruleName:e.getCurrRuleFullName()}),k,e.LA(0));b.resyncedTokens=(0,i.gc)(h),e.SAVE_ERROR(b)};!j;)if(this.tokenMatcher(l,d))return void m();else if(c.call(this)){m(),a.apply(this,b);return}else this.tokenMatcher(l,f)?j=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,h));this.importLexerState(g)},a.prototype.shouldInRepetitionRecoveryBeTried=function(a,b,c){return!(!1===c||void 0===a||void 0===b||this.tokenMatcher(this.LA(1),a)||this.isBackTracking()||this.canPerformInRuleRecovery(a,this.getFollowsForInRuleRecovery(a,b)))},a.prototype.getFollowsForInRuleRecovery=function(a,b){var c=this.getCurrentGrammarPath(a,b);return this.getNextPossibleTokenTypes(c)},a.prototype.tryInRuleRecovery=function(a,b){if(this.canRecoverWithSingleTokenInsertion(a,b))return this.getTokenToInsert(a);if(this.canRecoverWithSingleTokenDeletion(a)){var c=this.SKIP_TOKEN();return this.consumeToken(),c}throw new bu("sad sad panda")},a.prototype.canPerformInRuleRecovery=function(a,b){return this.canRecoverWithSingleTokenInsertion(a,b)||this.canRecoverWithSingleTokenDeletion(a)},a.prototype.canRecoverWithSingleTokenInsertion=function(a,b){var c=this;if(!this.canTokenTypeBeInsertedInRecovery(a)||(0,i.Im)(b))return!1;var d=this.LA(1);return void 0!==(0,i.I6)(b,function(a){return c.tokenMatcher(d,a)})},a.prototype.canRecoverWithSingleTokenDeletion=function(a){return this.tokenMatcher(this.LA(2),a)},a.prototype.isInCurrentRuleReSyncSet=function(a){var b=this.getCurrFollowKey(),c=this.getFollowSetFromFollowKey(b);return(0,i.gR)(c,a)},a.prototype.findReSyncTokenType=function(){for(var a=this.flattenFollowSet(),b=this.LA(1),c=2;;){var d=b.tokenType;if((0,i.gR)(a,d))return d;b=this.LA(c),c++}},a.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return bs;var a=this.getLastExplicitRuleShortName(),b=this.getLastExplicitRuleOccurrenceIndex(),c=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(a),idxInCallingRule:b,inRule:this.shortRuleNameToFullName(c)}},a.prototype.buildFullFollowKeyStack=function(){var a=this,b=this.RULE_STACK,c=this.RULE_OCCURRENCE_STACK;return(0,i.Tj)(b,function(d,e){return 0===e?bs:{ruleName:a.shortRuleNameToFullName(d),idxInCallingRule:c[e],inRule:a.shortRuleNameToFullName(b[e-1])}})},a.prototype.flattenFollowSet=function(){var a=this,b=(0,i.Tj)(this.buildFullFollowKeyStack(),function(b){return a.getFollowSetFromFollowKey(b)});return(0,i.Bq)(b)},a.prototype.getFollowSetFromFollowKey=function(a){if(a===bs)return[ai];var b=a.ruleName+a.idxInCallingRule+aI+a.inRule;return this.resyncFollows[b]},a.prototype.addToResyncTokens=function(a,b){return this.tokenMatcher(a,ai)||b.push(a),b},a.prototype.reSyncTo=function(a){for(var b=[],c=this.LA(1);!1===this.tokenMatcher(c,a);)c=this.SKIP_TOKEN(),this.addToResyncTokens(c,b);return(0,i.gc)(b)},a.prototype.attemptInRepetitionRecovery=function(a,b,c,d,e,f,g){},a.prototype.getCurrentGrammarPath=function(a,b){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,i.T9)(this.RULE_OCCURRENCE_STACK),lastTok:a,lastTokOccurrence:b}},a.prototype.getHumanReadableRuleStack=function(){var a=this;return(0,i.Tj)(this.RULE_STACK,function(b){return a.shortRuleNameToFullName(b)})},a}();function bw(a,b,c,d,e,f,g){var h=this.getKeyForAutomaticLookahead(d,e),i=this.firstAfterRepMap[h];if(void 0===i){var j=this.getCurrRuleFullName();i=new f(this.getGAstProductions()[j],e).startWalking(),this.firstAfterRepMap[h]=i}var k=i.token,l=i.occurrence,m=i.isEndOfRule;1===this.RULE_STACK.length&&m&&void 0===k&&(k=ai,l=1),this.shouldInRepetitionRecoveryBeTried(k,l,g)&&this.tryInRepetitionRecovery(a,b,c,k)}var bx=function(){function a(){}return a.prototype.initLooksAhead=function(a){this.dynamicTokensEnabled=(0,i.zy)(a,"dynamicTokensEnabled")?a.dynamicTokensEnabled:bX.dynamicTokensEnabled,this.maxLookahead=(0,i.zy)(a,"maxLookahead")?a.maxLookahead:bX.maxLookahead,this.lookAheadFuncsCache=(0,i.rF)()?new Map:[],(0,i.rF)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},a.prototype.preComputeLookaheadFunctions=function(a){var b=this;(0,i.jJ)(a,function(a){b.TRACE_INIT(a.name+" Rule Lookahead",function(){var c,d=(aG.reset(),a.accept(aG),c=aG.dslMethods,aG.reset(),c),f=d.alternation,g=d.repetition,h=d.option,j=d.repetitionMandatory,k=d.repetitionMandatoryWithSeparator,l=d.repetitionWithSeparator;(0,i.jJ)(f,function(c){var d=0===c.idx?"":c.idx;b.TRACE_INIT(""+aE(c)+d,function(){var d,e,f,g,h,i,j,k,l=(d=c.idx,e=c.maxLookahead||b.maxLookahead,f=c.hasPredicates,g=b.dynamicTokensEnabled,h=b.lookAheadBuilderForAlternatives,j=a6(i=a3(d,a,e))?M:L,h(i,f,j,g)),m=(k=b.fullRuleNameToShort[a.name],256|c.idx|k);b.setLaFuncCache(m,l)})}),(0,i.jJ)(g,function(c){b.computeLookaheadFunc(a,c.idx,768,e.REPETITION,c.maxLookahead,aE(c))}),(0,i.jJ)(h,function(c){b.computeLookaheadFunc(a,c.idx,512,e.OPTION,c.maxLookahead,aE(c))}),(0,i.jJ)(j,function(c){b.computeLookaheadFunc(a,c.idx,1024,e.REPETITION_MANDATORY,c.maxLookahead,aE(c))}),(0,i.jJ)(k,function(c){b.computeLookaheadFunc(a,c.idx,1536,e.REPETITION_MANDATORY_WITH_SEPARATOR,c.maxLookahead,aE(c))}),(0,i.jJ)(l,function(c){b.computeLookaheadFunc(a,c.idx,1280,e.REPETITION_WITH_SEPARATOR,c.maxLookahead,aE(c))})})})},a.prototype.computeLookaheadFunc=function(a,b,c,d,e,f){var g=this;this.TRACE_INIT(""+f+(0===b?"":b),function(){var f,h,i,j,k,l=(f=e||g.maxLookahead,h=g.dynamicTokensEnabled,i=g.lookAheadBuilderForOptional,k=a6(j=a4(b,a,d,f))?M:L,i(j[0],k,h)),m=b|c|g.fullRuleNameToShort[a.name];g.setLaFuncCache(m,l)})},a.prototype.lookAheadBuilderForOptional=function(a,b,c){return function(a,b,c){var d=(0,i.Si)(a,function(a){return 1===a.length}),e=a.length;if(!d||c)return function(){g:for(var c=0;c<e;c++){for(var d=a[c],f=d.length,g=0;g<f;g++)if(!1===b(this.LA(g+1),d[g]))continue g;return!0}return!1};var f=(0,i.Bq)(a);if(1===f.length&&(0,i.Im)(f[0].categoryMatches)){var g=f[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===g}}var h=(0,i.TS)(f,function(a,b,c){return a[b.tokenTypeIdx]=!0,(0,i.jJ)(b.categoryMatches,function(b){a[b]=!0}),a},[]);return function(){return!0===h[this.LA(1).tokenTypeIdx]}}(a,b,c)},a.prototype.lookAheadBuilderForAlternatives=function(a,b,c,d){var e=a.length,f=(0,i.Si)(a,function(a){return(0,i.Si)(a,function(a){return 1===a.length})});if(b)return function(b){for(var d=(0,i.Tj)(b,function(a){return a.GATE}),f=0;f<e;f++){var g=a[f],h=g.length,j=d[f];if(void 0===j||!1!==j.call(this))g:for(var k=0;k<h;k++){for(var l=g[k],m=l.length,n=0;n<m;n++)if(!1===c(this.LA(n+1),l[n]))continue g;return f}}};if(!f||d)return function(){for(var b=0;b<e;b++){var d=a[b],f=d.length;g:for(var g=0;g<f;g++){for(var h=d[g],i=h.length,j=0;j<i;j++)if(!1===c(this.LA(j+1),h[j]))continue g;return b}}};var g=(0,i.Tj)(a,function(a){return(0,i.Bq)(a)}),h=(0,i.TS)(g,function(a,b,c){return(0,i.jJ)(b,function(b){(0,i.zy)(a,b.tokenTypeIdx)||(a[b.tokenTypeIdx]=c),(0,i.jJ)(b.categoryMatches,function(b){(0,i.zy)(a,b)||(a[b]=c)})}),a},[]);return function(){return h[this.LA(1).tokenTypeIdx]}},a.prototype.getKeyForAutomaticLookahead=function(a,b){return b|a|this.getLastExplicitRuleShortName()},a.prototype.getLaFuncFromCache=function(a){},a.prototype.getLaFuncFromMap=function(a){return this.lookAheadFuncsCache.get(a)},a.prototype.getLaFuncFromObj=function(a){return this.lookAheadFuncsCache[a]},a.prototype.setLaFuncCache=function(a,b){},a.prototype.setLaFuncCacheUsingMap=function(a,b){this.lookAheadFuncsCache.set(a,b)},a.prototype.setLaFuncUsingObj=function(a,b){this.lookAheadFuncsCache[a]=b},a}();function by(a,b){!0===isNaN(a.startOffset)?(a.startOffset=b.startOffset,a.endOffset=b.endOffset):a.endOffset<b.endOffset==!0&&(a.endOffset=b.endOffset)}function bz(a,b){!0===isNaN(a.startOffset)?(a.startOffset=b.startOffset,a.startColumn=b.startColumn,a.startLine=b.startLine,a.endOffset=b.endOffset,a.endColumn=b.endColumn,a.endLine=b.endLine):a.endOffset<b.endOffset==!0&&(a.endOffset=b.endOffset,a.endColumn=b.endColumn,a.endLine=b.endLine)}var bA="name";function bB(a){var b=a.name;return b||"anonymous"}function bC(a,b){var c=Object.getOwnPropertyDescriptor(a,bA);return(!!(0,i.b0)(c)||!!c.configurable)&&(Object.defineProperty(a,bA,{enumerable:!1,configurable:!0,writable:!1,value:b}),!0)}function bD(a,b){for(var c=(0,i.HP)(a),d=c.length,e=0;e<d;e++)for(var f=a[c[e]],g=f.length,h=0;h<g;h++){var j=f[h];void 0===j.tokenTypeIdx&&this[j.name](j.children,b)}}!function(a){a[a.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",a[a.MISSING_METHOD=1]="MISSING_METHOD"}(f||(f={}));var bE=["constructor","visit","validateVisitor"],bF=function(){function a(){}return a.prototype.initTreeBuilder=function(a){if(this.CST_STACK=[],this.outputCst=a.outputCst,this.nodeLocationTracking=(0,i.zy)(a,"nodeLocationTracking")?a.nodeLocationTracking:bX.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=bz,this.setNodeLocationFromNode=bz,this.cstPostRule=i.tE,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=i.tE,this.setNodeLocationFromNode=i.tE,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=by,this.setNodeLocationFromNode=by,this.cstPostRule=i.tE,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=i.tE,this.setNodeLocationFromNode=i.tE,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=i.tE,this.setNodeLocationFromNode=i.tE,this.cstPostRule=i.tE,this.setInitialNodeLocation=i.tE;else throw Error('Invalid <nodeLocationTracking> config option: "'+a.nodeLocationTracking+'"');else this.cstInvocationStateUpdate=i.tE,this.cstFinallyStateUpdate=i.tE,this.cstPostTerminal=i.tE,this.cstPostNonTerminal=i.tE,this.cstPostRule=i.tE},a.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(a){a.location={startOffset:NaN,endOffset:NaN}},a.prototype.setInitialNodeLocationOnlyOffsetRegular=function(a){a.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},a.prototype.setInitialNodeLocationFullRecovery=function(a){a.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},a.prototype.setInitialNodeLocationFullRegular=function(a){var b=this.LA(1);a.location={startOffset:b.startOffset,startLine:b.startLine,startColumn:b.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},a.prototype.cstInvocationStateUpdate=function(a,b){var c={name:a,children:{}};this.setInitialNodeLocation(c),this.CST_STACK.push(c)},a.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},a.prototype.cstPostRuleFull=function(a){var b=this.LA(0),c=a.location;c.startOffset<=b.startOffset==!0?(c.endOffset=b.endOffset,c.endLine=b.endLine,c.endColumn=b.endColumn):(c.startOffset=NaN,c.startLine=NaN,c.startColumn=NaN)},a.prototype.cstPostRuleOnlyOffset=function(a){var b=this.LA(0),c=a.location;c.startOffset<=b.startOffset==!0?c.endOffset=b.endOffset:c.startOffset=NaN},a.prototype.cstPostTerminal=function(a,b){var c=this.CST_STACK[this.CST_STACK.length-1];void 0===c.children[a]?c.children[a]=[b]:c.children[a].push(b),this.setNodeLocationFromToken(c.location,b)},a.prototype.cstPostNonTerminal=function(a,b){var c=this.CST_STACK[this.CST_STACK.length-1];void 0===c.children[b]?c.children[b]=[a]:c.children[b].push(a),this.setNodeLocationFromNode(c.location,a.location)},a.prototype.getBaseCstVisitorConstructor=function(){if((0,i.b0)(this.baseCstVisitorConstructor)){var a,b,c,d=(a=this.className,b=(0,i.HP)(this.gastProductionsCache),bC(c=function(){},a+"BaseSemantics"),c.prototype={visit:function(a,b){if((0,i.cy)(a)&&(a=a[0]),!(0,i.b0)(a))return this[a.name](a.children,b)},validateVisitor:function(){var a,c,d,e,g,h,j,k=(a=this,c=b,h=(d=a,e=c,g=(0,i.Tj)(e,function(a){if(!(0,i.Tn)(d[a]))return{msg:"Missing visitor method: <"+a+"> on "+bB(d.constructor)+" CST Visitor.",type:f.MISSING_METHOD,methodName:a}}),(0,i.oE)(g)),j=function(a,b){var c=[];for(var d in a)!(0,i.Tn)(a[d])||(0,i.gR)(bE,d)||(0,i.gR)(b,d)||c.push({msg:"Redundant visitor method: <"+d+"> on "+bB(a.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\n",type:f.REDUNDANT_METHOD,methodName:d});return c}(a,c),h.concat(j));if(!(0,i.Im)(k)){var l=(0,i.Tj)(k,function(a){return a.msg});throw Error("Errors Detected in CST Visitor <"+bB(this.constructor)+">:\n "+l.join("\n\n").replace(/\n/g,"\n "))}}},c.prototype.constructor=c,c._RULE_NAMES=b,c);return this.baseCstVisitorConstructor=d,d}return this.baseCstVisitorConstructor},a.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,i.b0)(this.baseCstVisitorWithDefaultsConstructor)){var a,b,c,d,e,f=(a=this.className,b=(0,i.HP)(this.gastProductionsCache),c=this.getBaseCstVisitorConstructor(),bC(d=function(){},a+"BaseSemanticsWithDefaults"),e=Object.create(c.prototype),(0,i.jJ)(b,function(a){e[a]=bD}),d.prototype=e,d.prototype.constructor=d,d);return this.baseCstVisitorWithDefaultsConstructor=f,f}return this.baseCstVisitorWithDefaultsConstructor},a.prototype.getLastExplicitRuleShortName=function(){var a=this.RULE_STACK;return a[a.length-1]},a.prototype.getPreviousExplicitRuleShortName=function(){var a=this.RULE_STACK;return a[a.length-2]},a.prototype.getLastExplicitRuleOccurrenceIndex=function(){var a=this.RULE_OCCURRENCE_STACK;return a[a.length-1]},a}(),bG=function(){function a(){}return a.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(a.prototype,"input",{get:function(){return this.tokVector},set:function(a){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=a,this.tokVectorLength=a.length},enumerable:!1,configurable:!0}),a.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):bW},a.prototype.LA=function(a){var b=this.currIdx+a;return b<0||this.tokVectorLength<=b?bW:this.tokVector[b]},a.prototype.consumeToken=function(){this.currIdx++},a.prototype.exportLexerState=function(){return this.currIdx},a.prototype.importLexerState=function(a){this.currIdx=a},a.prototype.resetLexerState=function(){this.currIdx=-1},a.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},a.prototype.getLexerPosition=function(){return this.exportLexerState()},a}(),bH=function(){function a(){}return a.prototype.ACTION=function(a){return a.call(this)},a.prototype.consume=function(a,b,c){return this.consumeInternal(b,a,c)},a.prototype.subrule=function(a,b,c){return this.subruleInternal(b,a,c)},a.prototype.option=function(a,b){return this.optionInternal(b,a)},a.prototype.or=function(a,b){return this.orInternal(b,a)},a.prototype.many=function(a,b){return this.manyInternal(a,b)},a.prototype.atLeastOne=function(a,b){return this.atLeastOneInternal(a,b)},a.prototype.CONSUME=function(a,b){return this.consumeInternal(a,0,b)},a.prototype.CONSUME1=function(a,b){return this.consumeInternal(a,1,b)},a.prototype.CONSUME2=function(a,b){return this.consumeInternal(a,2,b)},a.prototype.CONSUME3=function(a,b){return this.consumeInternal(a,3,b)},a.prototype.CONSUME4=function(a,b){return this.consumeInternal(a,4,b)},a.prototype.CONSUME5=function(a,b){return this.consumeInternal(a,5,b)},a.prototype.CONSUME6=function(a,b){return this.consumeInternal(a,6,b)},a.prototype.CONSUME7=function(a,b){return this.consumeInternal(a,7,b)},a.prototype.CONSUME8=function(a,b){return this.consumeInternal(a,8,b)},a.prototype.CONSUME9=function(a,b){return this.consumeInternal(a,9,b)},a.prototype.SUBRULE=function(a,b){return this.subruleInternal(a,0,b)},a.prototype.SUBRULE1=function(a,b){return this.subruleInternal(a,1,b)},a.prototype.SUBRULE2=function(a,b){return this.subruleInternal(a,2,b)},a.prototype.SUBRULE3=function(a,b){return this.subruleInternal(a,3,b)},a.prototype.SUBRULE4=function(a,b){return this.subruleInternal(a,4,b)},a.prototype.SUBRULE5=function(a,b){return this.subruleInternal(a,5,b)},a.prototype.SUBRULE6=function(a,b){return this.subruleInternal(a,6,b)},a.prototype.SUBRULE7=function(a,b){return this.subruleInternal(a,7,b)},a.prototype.SUBRULE8=function(a,b){return this.subruleInternal(a,8,b)},a.prototype.SUBRULE9=function(a,b){return this.subruleInternal(a,9,b)},a.prototype.OPTION=function(a){return this.optionInternal(a,0)},a.prototype.OPTION1=function(a){return this.optionInternal(a,1)},a.prototype.OPTION2=function(a){return this.optionInternal(a,2)},a.prototype.OPTION3=function(a){return this.optionInternal(a,3)},a.prototype.OPTION4=function(a){return this.optionInternal(a,4)},a.prototype.OPTION5=function(a){return this.optionInternal(a,5)},a.prototype.OPTION6=function(a){return this.optionInternal(a,6)},a.prototype.OPTION7=function(a){return this.optionInternal(a,7)},a.prototype.OPTION8=function(a){return this.optionInternal(a,8)},a.prototype.OPTION9=function(a){return this.optionInternal(a,9)},a.prototype.OR=function(a){return this.orInternal(a,0)},a.prototype.OR1=function(a){return this.orInternal(a,1)},a.prototype.OR2=function(a){return this.orInternal(a,2)},a.prototype.OR3=function(a){return this.orInternal(a,3)},a.prototype.OR4=function(a){return this.orInternal(a,4)},a.prototype.OR5=function(a){return this.orInternal(a,5)},a.prototype.OR6=function(a){return this.orInternal(a,6)},a.prototype.OR7=function(a){return this.orInternal(a,7)},a.prototype.OR8=function(a){return this.orInternal(a,8)},a.prototype.OR9=function(a){return this.orInternal(a,9)},a.prototype.MANY=function(a){this.manyInternal(0,a)},a.prototype.MANY1=function(a){this.manyInternal(1,a)},a.prototype.MANY2=function(a){this.manyInternal(2,a)},a.prototype.MANY3=function(a){this.manyInternal(3,a)},a.prototype.MANY4=function(a){this.manyInternal(4,a)},a.prototype.MANY5=function(a){this.manyInternal(5,a)},a.prototype.MANY6=function(a){this.manyInternal(6,a)},a.prototype.MANY7=function(a){this.manyInternal(7,a)},a.prototype.MANY8=function(a){this.manyInternal(8,a)},a.prototype.MANY9=function(a){this.manyInternal(9,a)},a.prototype.MANY_SEP=function(a){this.manySepFirstInternal(0,a)},a.prototype.MANY_SEP1=function(a){this.manySepFirstInternal(1,a)},a.prototype.MANY_SEP2=function(a){this.manySepFirstInternal(2,a)},a.prototype.MANY_SEP3=function(a){this.manySepFirstInternal(3,a)},a.prototype.MANY_SEP4=function(a){this.manySepFirstInternal(4,a)},a.prototype.MANY_SEP5=function(a){this.manySepFirstInternal(5,a)},a.prototype.MANY_SEP6=function(a){this.manySepFirstInternal(6,a)},a.prototype.MANY_SEP7=function(a){this.manySepFirstInternal(7,a)},a.prototype.MANY_SEP8=function(a){this.manySepFirstInternal(8,a)},a.prototype.MANY_SEP9=function(a){this.manySepFirstInternal(9,a)},a.prototype.AT_LEAST_ONE=function(a){this.atLeastOneInternal(0,a)},a.prototype.AT_LEAST_ONE1=function(a){return this.atLeastOneInternal(1,a)},a.prototype.AT_LEAST_ONE2=function(a){this.atLeastOneInternal(2,a)},a.prototype.AT_LEAST_ONE3=function(a){this.atLeastOneInternal(3,a)},a.prototype.AT_LEAST_ONE4=function(a){this.atLeastOneInternal(4,a)},a.prototype.AT_LEAST_ONE5=function(a){this.atLeastOneInternal(5,a)},a.prototype.AT_LEAST_ONE6=function(a){this.atLeastOneInternal(6,a)},a.prototype.AT_LEAST_ONE7=function(a){this.atLeastOneInternal(7,a)},a.prototype.AT_LEAST_ONE8=function(a){this.atLeastOneInternal(8,a)},a.prototype.AT_LEAST_ONE9=function(a){this.atLeastOneInternal(9,a)},a.prototype.AT_LEAST_ONE_SEP=function(a){this.atLeastOneSepFirstInternal(0,a)},a.prototype.AT_LEAST_ONE_SEP1=function(a){this.atLeastOneSepFirstInternal(1,a)},a.prototype.AT_LEAST_ONE_SEP2=function(a){this.atLeastOneSepFirstInternal(2,a)},a.prototype.AT_LEAST_ONE_SEP3=function(a){this.atLeastOneSepFirstInternal(3,a)},a.prototype.AT_LEAST_ONE_SEP4=function(a){this.atLeastOneSepFirstInternal(4,a)},a.prototype.AT_LEAST_ONE_SEP5=function(a){this.atLeastOneSepFirstInternal(5,a)},a.prototype.AT_LEAST_ONE_SEP6=function(a){this.atLeastOneSepFirstInternal(6,a)},a.prototype.AT_LEAST_ONE_SEP7=function(a){this.atLeastOneSepFirstInternal(7,a)},a.prototype.AT_LEAST_ONE_SEP8=function(a){this.atLeastOneSepFirstInternal(8,a)},a.prototype.AT_LEAST_ONE_SEP9=function(a){this.atLeastOneSepFirstInternal(9,a)},a.prototype.RULE=function(a,b,c){if(void 0===c&&(c=bY),(0,i.gR)(this.definedRulesNames,a)){var d={message:aN.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),type:g.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(d)}this.definedRulesNames.push(a);var e=this.defineRule(a,b,c);return this[a]=e,e},a.prototype.OVERRIDE_RULE=function(a,b,c){void 0===c&&(c=bY);var d,e,f,h=[];h=h.concat((d=this.definedRulesNames,e=this.className,f=[],i.gR(d,a)||f.push({message:"Invalid rule override, rule: ->"+a+"<- cannot be overridden in the grammar: ->"+e+"<-as it is not defined in any of the super grammars ",type:g.INVALID_RULE_OVERRIDE,ruleName:a}),f)),this.definitionErrors.push.apply(this.definitionErrors,h);var j=this.defineRule(a,b,c);return this[a]=j,j},a.prototype.BACKTRACK=function(a,b){return function(){this.isBackTrackingStack.push(1);var c=this.saveRecogState();try{return a.apply(this,b),!0}catch(a){if(bm(a))return!1;throw a}finally{this.reloadRecogState(c),this.isBackTrackingStack.pop()}}},a.prototype.getGAstProductions=function(){return this.gastProductionsCache},a.prototype.getSerializedGastProductions=function(){return ax((0,i.zu)(this.gastProductionsCache))},a}(),bI=function(){function a(){}return a.prototype.initRecognizerEngine=function(a,b){if(this.className=bB(this.constructor),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=M,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,i.zy)(b,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.");if((0,i.cy)(a)){if((0,i.Im)(a))throw Error("A Token Vocabulary cannot be empty.\n Note that the first argument for the parser constructor\n is no longer a Token vector (since v4.0).");if("number"==typeof a[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n For Further details.")}if((0,i.cy)(a))this.tokensMap=(0,i.TS)(a,function(a,b){return a[b.name]=b,a},{});else if((0,i.zy)(a,"modes")&&(0,i.Si)((0,i.Bq)((0,i.zu)(a.modes)),S)){var c=(0,i.Bq)((0,i.zu)(a.modes)),d=(0,i.sb)(c);this.tokensMap=(0,i.TS)(d,function(a,b){return a[b.name]=b,a},{})}else if((0,i.Gv)(a))this.tokensMap=(0,i.lR)(a);else throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=ai;var e=(0,i.Si)((0,i.zu)(a),function(a){return(0,i.Im)(a.categoryMatches)});this.tokenMatcher=e?M:L,P((0,i.zu)(this.tokensMap))},a.prototype.defineRule=function(a,b,c){if(this.selfAnalysisDone)throw Error("Grammar rule <"+a+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var d,e=(0,i.zy)(c,"resyncEnabled")?c.resyncEnabled:bY.resyncEnabled,f=(0,i.zy)(c,"recoveryValueFunc")?c.recoveryValueFunc:bY.recoveryValueFunc,g=this.ruleShortNameIdx<<12;function h(a){try{if(!0!==this.outputCst)return b.apply(this,a);b.apply(this,a);var c=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(c),c}catch(a){return this.invokeRuleCatch(a,e,f)}finally{this.ruleFinallyStateUpdate()}}return this.ruleShortNameIdx++,this.shortRuleNameToFull[g]=a,this.fullRuleNameToShort[a]=g,(d=function(b,c){return void 0===b&&(b=0),this.ruleInvocationStateUpdate(g,a,b),h.call(this,c)}).ruleName=a,d.originalGrammarAction=b,d},a.prototype.invokeRuleCatch=function(a,b,c){var d=1===this.RULE_STACK.length,e=b&&!this.isBackTracking()&&this.recoveryEnabled;if(bm(a)){if(e){var f=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(f)){if(a.resyncedTokens=this.reSyncTo(f),!this.outputCst)return c();var g=this.CST_STACK[this.CST_STACK.length-1];return g.recoveredNode=!0,g}if(this.outputCst){var g=this.CST_STACK[this.CST_STACK.length-1];g.recoveredNode=!0,a.partialCstResult=g}throw a}if(d)return this.moveToTerminatedState(),c()}throw a},a.prototype.optionInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(512,b);return this.optionInternalLogic(a,b,c)},a.prototype.optionInternalLogic=function(a,b,c){var d,e,f=this,g=this.getLaFuncFromCache(c);if(void 0!==a.DEF){if(d=a.DEF,void 0!==(e=a.GATE)){var h=g;g=function(){return e.call(f)&&h.call(f)}}}else d=a;if(!0===g.call(this))return d.call(this)},a.prototype.atLeastOneInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(1024,a);return this.atLeastOneInternalLogic(a,b,c)},a.prototype.atLeastOneInternalLogic=function(a,b,c){var d,f,g=this,h=this.getLaFuncFromCache(c);if(void 0!==b.DEF){if(d=b.DEF,void 0!==(f=b.GATE)){var i=h;h=function(){return f.call(g)&&i.call(g)}}}else d=b;if(!0===h.call(this))for(var j=this.doSingleRepetition(d);!0===h.call(this)&&!0===j;)j=this.doSingleRepetition(d);else throw this.raiseEarlyExitException(a,e.REPETITION_MANDATORY,b.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[a,b],h,1024,a,aV)},a.prototype.atLeastOneSepFirstInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(1536,a);this.atLeastOneSepFirstInternalLogic(a,b,c)},a.prototype.atLeastOneSepFirstInternalLogic=function(a,b,c){var d=this,f=b.DEF,g=b.SEP;if(!0===this.getLaFuncFromCache(c).call(this)){f.call(this);for(var h=function(){return d.tokenMatcher(d.LA(1),g)};!0===this.tokenMatcher(this.LA(1),g);)this.CONSUME(g),f.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[a,g,h,f,aW],h,1536,a,aW)}else throw this.raiseEarlyExitException(a,e.REPETITION_MANDATORY_WITH_SEPARATOR,b.ERR_MSG)},a.prototype.manyInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(768,a);return this.manyInternalLogic(a,b,c)},a.prototype.manyInternalLogic=function(a,b,c){var d,e,f=this,g=this.getLaFuncFromCache(c);if(void 0!==b.DEF){if(d=b.DEF,void 0!==(e=b.GATE)){var h=g;g=function(){return e.call(f)&&h.call(f)}}}else d=b;for(var i=!0;!0===g.call(this)&&!0===i;)i=this.doSingleRepetition(d);this.attemptInRepetitionRecovery(this.manyInternal,[a,b],g,768,a,aT,i)},a.prototype.manySepFirstInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(1280,a);this.manySepFirstInternalLogic(a,b,c)},a.prototype.manySepFirstInternalLogic=function(a,b,c){var d=this,e=b.DEF,f=b.SEP;if(!0===this.getLaFuncFromCache(c).call(this)){e.call(this);for(var g=function(){return d.tokenMatcher(d.LA(1),f)};!0===this.tokenMatcher(this.LA(1),f);)this.CONSUME(f),e.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[a,f,g,e,aU],g,1280,a,aU)}},a.prototype.repetitionSepSecondInternal=function(a,b,c,d,e){for(;c();)this.CONSUME(b),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[a,b,c,d,e],c,1536,a,e)},a.prototype.doSingleRepetition=function(a){var b=this.getLexerPosition();return a.call(this),this.getLexerPosition()>b},a.prototype.orInternal=function(a,b){var c=this.getKeyForAutomaticLookahead(256,b),d=(0,i.cy)(a)?a:a.DEF,e=this.getLaFuncFromCache(c).call(this,d);if(void 0!==e)return d[e].ALT.call(this);this.raiseNoAltException(b,a.ERR_MSG)},a.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var a=this.LA(1),b=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:a,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new bq(b,a))}},a.prototype.subruleInternal=function(a,b,c){var d;try{var e=void 0!==c?c.ARGS:void 0;return d=a.call(this,b,e),this.cstPostNonTerminal(d,void 0!==c&&void 0!==c.LABEL?c.LABEL:a.ruleName),d}catch(b){this.subruleInternalError(b,c,a.ruleName)}},a.prototype.subruleInternalError=function(a,b,c){throw bm(a)&&void 0!==a.partialCstResult&&(this.cstPostNonTerminal(a.partialCstResult,void 0!==b&&void 0!==b.LABEL?b.LABEL:c),delete a.partialCstResult),a},a.prototype.consumeInternal=function(a,b,c){var d;try{var e=this.LA(1);!0===this.tokenMatcher(e,a)?(this.consumeToken(),d=e):this.consumeInternalError(a,e,c)}catch(c){d=this.consumeInternalRecovery(a,b,c)}return this.cstPostTerminal(void 0!==c&&void 0!==c.LABEL?c.LABEL:a.name,d),d},a.prototype.consumeInternalError=function(a,b,c){var d,e=this.LA(0);throw d=void 0!==c&&c.ERR_MSG?c.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:a,actual:b,previous:e,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bo(d,b,e))},a.prototype.consumeInternalRecovery=function(a,b,c){if(this.recoveryEnabled&&"MismatchedTokenException"===c.name&&!this.isBackTracking()){var d=this.getFollowsForInRuleRecovery(a,b);try{return this.tryInRuleRecovery(a,d)}catch(a){if(a.name===bt)throw c;throw a}}throw c},a.prototype.saveRecogState=function(){var a=this.errors,b=(0,i.T9)(this.RULE_STACK);return{errors:a,lexerState:this.exportLexerState(),RULE_STACK:b,CST_STACK:this.CST_STACK}},a.prototype.reloadRecogState=function(a){this.errors=a.errors,this.importLexerState(a.lexerState),this.RULE_STACK=a.RULE_STACK},a.prototype.ruleInvocationStateUpdate=function(a,b,c){this.RULE_OCCURRENCE_STACK.push(c),this.RULE_STACK.push(a),this.cstInvocationStateUpdate(b,a)},a.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},a.prototype.getCurrRuleFullName=function(){var a=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[a]},a.prototype.shortRuleNameToFullName=function(a){return this.shortRuleNameToFull[a]},a.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),ai)},a.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},a}(),bJ=function(){function a(){}return a.prototype.initErrorHandler=function(a){this._errors=[],this.errorMessageProvider=(0,i.zy)(a,"errorMessageProvider")?a.errorMessageProvider:bX.errorMessageProvider},a.prototype.SAVE_ERROR=function(a){if(bm(a))return a.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,i.T9)(this.RULE_OCCURRENCE_STACK)},this._errors.push(a),a;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(a.prototype,"errors",{get:function(){return(0,i.T9)(this._errors)},set:function(a){this._errors=a},enumerable:!1,configurable:!0}),a.prototype.raiseEarlyExitException=function(a,b,c){for(var d=this.getCurrRuleFullName(),e=a4(a,this.getGAstProductions()[d],b,this.maxLookahead)[0],f=[],g=1;g<=this.maxLookahead;g++)f.push(this.LA(g));var h=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:e,actual:f,previous:this.LA(0),customUserDescription:c,ruleName:d});throw this.SAVE_ERROR(new br(h,this.LA(1),this.LA(0)))},a.prototype.raiseNoAltException=function(a,b){for(var c=this.getCurrRuleFullName(),d=a3(a,this.getGAstProductions()[c],this.maxLookahead),e=[],f=1;f<=this.maxLookahead;f++)e.push(this.LA(f));var g=this.LA(0),h=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:d,actual:e,previous:g,customUserDescription:b,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new bp(h,this.LA(1),g))},a}(),bK=function(){function a(){}return a.prototype.initContentAssist=function(){},a.prototype.computeContentAssist=function(a,b){var c=this.gastProductionsCache[a];if((0,i.b0)(c))throw Error("Rule ->"+a+"<- does not exist in this grammar.");return aY([c],b,this.tokenMatcher,this.maxLookahead)},a.prototype.getNextPossibleTokenTypes=function(a){var b=(0,i.$1)(a.ruleStack);return new aR(this.getGAstProductions()[b],a).startWalking()},a}(),bL={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(bL);var bM=ah({name:"RECORDING_PHASE_TOKEN",pattern:V.NA});P([bM]);var bN=aj(bM,"This IToken indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(bN);var bO={name:"This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},bP=function(){function a(){}return a.prototype.initGastRecorder=function(a){this.recordingProdStack=[],this.RECORDING_PHASE=!1},a.prototype.enableRecording=function(){var a=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var b=function(b){var c=b>0?b:"";a["CONSUME"+c]=function(a,c){return this.consumeInternalRecord(a,b,c)},a["SUBRULE"+c]=function(a,c){return this.subruleInternalRecord(a,b,c)},a["OPTION"+c]=function(a){return this.optionInternalRecord(a,b)},a["OR"+c]=function(a){return this.orInternalRecord(a,b)},a["MANY"+c]=function(a){this.manyInternalRecord(b,a)},a["MANY_SEP"+c]=function(a){this.manySepFirstInternalRecord(b,a)},a["AT_LEAST_ONE"+c]=function(a){this.atLeastOneInternalRecord(b,a)},a["AT_LEAST_ONE_SEP"+c]=function(a){this.atLeastOneSepFirstInternalRecord(b,a)}},c=0;c<10;c++)b(c);a.consume=function(a,b,c){return this.consumeInternalRecord(b,a,c)},a.subrule=function(a,b,c){return this.subruleInternalRecord(b,a,c)},a.option=function(a,b){return this.optionInternalRecord(b,a)},a.or=function(a,b){return this.orInternalRecord(b,a)},a.many=function(a,b){this.manyInternalRecord(a,b)},a.atLeastOne=function(a,b){this.atLeastOneInternalRecord(a,b)},a.ACTION=a.ACTION_RECORD,a.BACKTRACK=a.BACKTRACK_RECORD,a.LA=a.LA_RECORD})},a.prototype.disableRecording=function(){var a=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var b=0;b<10;b++){var c=b>0?b:"";delete a["CONSUME"+c],delete a["SUBRULE"+c],delete a["OPTION"+c],delete a["OR"+c],delete a["MANY"+c],delete a["MANY_SEP"+c],delete a["AT_LEAST_ONE"+c],delete a["AT_LEAST_ONE_SEP"+c]}delete a.consume,delete a.subrule,delete a.option,delete a.or,delete a.many,delete a.atLeastOne,delete a.ACTION,delete a.BACKTRACK,delete a.LA})},a.prototype.ACTION_RECORD=function(a){},a.prototype.BACKTRACK_RECORD=function(a,b){return function(){return!0}},a.prototype.LA_RECORD=function(a){return bW},a.prototype.topLevelRuleRecord=function(a,b){try{var c=new ao({definition:[],name:a});return c.name=a,this.recordingProdStack.push(c),b.call(this),this.recordingProdStack.pop(),c}catch(a){if(!0!==a.KNOWN_RECORDER_ERROR)try{a.message=a.message+'\n This error was thrown during the "grammar recording phase" For more info see:\n https://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(a){}throw a}},a.prototype.optionInternalRecord=function(a,b){return bQ.call(this,aq,a,b)},a.prototype.atLeastOneInternalRecord=function(a,b){bQ.call(this,ar,b,a)},a.prototype.atLeastOneSepFirstInternalRecord=function(a,b){bQ.call(this,as,b,a,!0)},a.prototype.manyInternalRecord=function(a,b){bQ.call(this,at,b,a)},a.prototype.manySepFirstInternalRecord=function(a,b){bQ.call(this,au,b,a,!0)},a.prototype.orInternalRecord=function(a,b){return bR.call(this,a,b)},a.prototype.subruleInternalRecord=function(a,b,c){if(bT(b),!a||!1===(0,i.zy)(a,"ruleName")){var d=Error("<SUBRULE"+bS(b)+"> argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(a)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw d.KNOWN_RECORDER_ERROR=!0,d}var e=(0,i.se)(this.recordingProdStack),f=new an({idx:b,nonTerminalName:a.ruleName,referencedRule:void 0});return e.definition.push(f),this.outputCst?bO:bL},a.prototype.consumeInternalRecord=function(a,b,c){if(bT(b),!Q(a)){var d=Error("<CONSUME"+bS(b)+"> argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(a)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw d.KNOWN_RECORDER_ERROR=!0,d}var e=(0,i.se)(this.recordingProdStack),f=new aw({idx:b,terminalType:a});return e.definition.push(f),bN},a}();function bQ(a,b,c,d){void 0===d&&(d=!1),bT(c);var e=(0,i.se)(this.recordingProdStack),f=(0,i.Tn)(b)?b:b.DEF,g=new a({definition:[],idx:c});return d&&(g.separator=b.SEP),(0,i.zy)(b,"MAX_LOOKAHEAD")&&(g.maxLookahead=b.MAX_LOOKAHEAD),this.recordingProdStack.push(g),f.call(this),e.definition.push(g),this.recordingProdStack.pop(),bL}function bR(a,b){var c=this;bT(b);var d=(0,i.se)(this.recordingProdStack),e=!1===(0,i.cy)(a),f=!1===e?a:a.DEF,g=new av({definition:[],idx:b,ignoreAmbiguities:e&&!0===a.IGNORE_AMBIGUITIES});return(0,i.zy)(a,"MAX_LOOKAHEAD")&&(g.maxLookahead=a.MAX_LOOKAHEAD),g.hasPredicates=(0,i.zN)(f,function(a){return(0,i.Tn)(a.GATE)}),d.definition.push(g),(0,i.jJ)(f,function(a){var b=new ap({definition:[]});g.definition.push(b),(0,i.zy)(a,"IGNORE_AMBIGUITIES")?b.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:(0,i.zy)(a,"GATE")&&(b.ignoreAmbiguities=!0),c.recordingProdStack.push(b),a.ALT.call(c),c.recordingProdStack.pop()}),bL}function bS(a){return 0===a?"":""+a}function bT(a){if(a<0||a>255){var b=Error("Invalid DSL Method idx value: <"+a+">\n Idx value must be a none negative value smaller than "+256);throw b.KNOWN_RECORDER_ERROR=!0,b}}var bU=function(){function a(){}return a.prototype.initPerformanceTracer=function(a){if((0,i.zy)(a,"traceInitPerf")){var b=a.traceInitPerf,c="number"==typeof b;this.traceInitMaxIdent=c?b:1/0,this.traceInitPerf=c?b>0:b}else this.traceInitMaxIdent=0,this.traceInitPerf=bX.traceInitPerf;this.traceInitIndent=-1},a.prototype.TRACE_INIT=function(a,b){if(!0!==this.traceInitPerf)return b();this.traceInitIndent++;var c=Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--\x3e <"+a+">");var d=(0,i.O1)(b),e=d.time,f=d.value,g=e>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(c+"<-- <"+a+"> time: "+e+"ms"),this.traceInitIndent--,f},a}(),bV=function(){var a=function(b,c){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),bW=aj(ai,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(bW);var bX=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:aL,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),bY=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function bZ(a){return void 0===a&&(a=void 0),function(){return a}}!function(a){a[a.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",a[a.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",a[a.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",a[a.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",a[a.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",a[a.LEFT_RECURSION=5]="LEFT_RECURSION",a[a.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",a[a.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",a[a.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",a[a.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",a[a.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",a[a.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",a[a.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"}(g||(g={}));var b$=function(){function a(a,b){if(this.definitionErrors=[],this.selfAnalysisDone=!1,this.initErrorHandler(b),this.initLexerAdapter(),this.initLooksAhead(b),this.initRecognizerEngine(a,b),this.initRecoverable(b),this.initTreeBuilder(b),this.initContentAssist(),this.initGastRecorder(b),this.initPerformanceTracer(b),(0,i.zy)(b,"ignoredIssues"))throw Error("The <ignoredIssues> IParserConfig property has been deprecated.\n Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details.");this.skipValidations=(0,i.zy)(b,"skipValidations")?b.skipValidations:bX.skipValidations}return a.performSelfAnalysis=function(a){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},a.prototype.performSelfAnalysis=function(){var b=this;this.TRACE_INIT("performSelfAnalysis",function(){b.selfAnalysisDone=!0;var c=b.className;b.TRACE_INIT("toFastProps",function(){(0,i.Bl)(b)}),b.TRACE_INIT("Grammar Recording",function(){try{b.enableRecording(),(0,i.jJ)(b.definedRulesNames,function(a){var c=b[a].originalGrammarAction,d=void 0;b.TRACE_INIT(a+" Rule",function(){d=b.topLevelRuleRecord(a,c)}),b.gastProductionsCache[a]=d})}finally{b.disableRecording()}});var d=[];if(b.TRACE_INIT("Grammar Resolving",function(){d=bd({rules:(0,i.zu)(b.gastProductionsCache)}),b.definitionErrors.push.apply(b.definitionErrors,d)}),b.TRACE_INIT("Grammar Validations",function(){if((0,i.Im)(d)&&!1===b.skipValidations){var a=be({rules:(0,i.zu)(b.gastProductionsCache),maxLookahead:b.maxLookahead,tokenTypes:(0,i.zu)(b.tokensMap),errMsgProvider:aN,grammarName:c});b.definitionErrors.push.apply(b.definitionErrors,a)}}),(0,i.Im)(b.definitionErrors)&&(b.recoveryEnabled&&b.TRACE_INIT("computeAllProdsFollows",function(){var a,c,d=(a=(0,i.zu)(b.gastProductionsCache),c={},(0,i.jJ)(a,function(a){var b=new aK(a).startWalking();(0,i.kp)(c,b)}),c);b.resyncFollows=d}),b.TRACE_INIT("ComputeLookaheadFunctions",function(){b.preComputeLookaheadFunctions((0,i.zu)(b.gastProductionsCache))})),!a.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,i.Im)(b.definitionErrors))throw Error("Parser Definition Errors detected:\n "+(0,i.Tj)(b.definitionErrors,function(a){return a.message}).join("\n-------------------------------\n"))})},a.DEFER_DEFINITION_ERRORS_HANDLING=!1,a}();(0,i.XJ)(b$,[bv,bx,bF,bG,bI,bH,bJ,bK,bP,bU]);var b_=function(a){function b(b,c){void 0===c&&(c=bX);var d=(0,i.lR)(c);return d.outputCst=!0,a.call(this,b,d)||this}return bV(b,a),b}(b$),b0=function(a){function b(b,c){void 0===c&&(c=bX);var d=(0,i.lR)(c);return d.outputCst=!1,a.call(this,b,d)||this}return bV(b,a),b}(b$);function b1(a,b){var c=void 0===b?{}:b,d=c.resourceBase,e=void 0===d?"https://unpkg.com/chevrotain@"+h+"/diagrams/":d,f=c.css;return"\n\x3c!-- This is a generated file --\x3e\n<!DOCTYPE html>\n<meta charset=\"utf-8\">\n<style>\n body {\n background-color: hsl(30, 20%, 95%)\n }\n</style>\n\n\n<link rel='stylesheet' href='"+(void 0===f?"https://unpkg.com/chevrotain@"+h+"/diagrams/diagrams.css":f)+"'>\n"+("\n<script src='"+e+"vendor/railroad-diagrams.js'><\/script>\n<script src='"+e+"src/diagrams_builder.js'><\/script>\n<script src='"+e+"src/diagrams_behavior.js'><\/script>\n<script src='"+e+"src/main.js'><\/script>\n")+'\n<div id="diagrams" align="center"></div> \n'+("\n<script>\n window.serializedGrammar = "+JSON.stringify(a,null," ")+";\n<\/script>\n")+'\n<script>\n var diagramsDiv = document.getElementById("diagrams");\n main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);\n<\/script>\n'}function b2(a){var b;return"\nfunction "+a.name+"(tokenVocabulary, config) {\n // invoke super constructor\n // No support for embedded actions currently, so we can 'hardcode'\n // The use of CstParser.\n chevrotain.CstParser.call(this, tokenVocabulary, config)\n\n const $ = this\n\n "+(b=a.rules,(0,i.Tj)(b,function(a){var b,c,d;return c=1,d=b6(1,'$.RULE("'+(b=a).name+'", function() {')+"\n"+b5(b.definition,c+1)+(b6(c+1,"})")+"\n")}).join("\n"))+"\n\n // very important to call this after all the rules have been defined.\n // otherwise the parser may not work correctly as it will lack information\n // derived during the self analysis phase.\n this.performSelfAnalysis(this)\n}\n\n// inheritance as implemented in javascript in the previous decade... :(\n"+a.name+".prototype = Object.create(chevrotain.CstParser.prototype)\n"+a.name+".prototype.constructor = "+a.name+" \n "}function b3(a,b,c){var d=b6(c,"$."+(a+b.idx)+"(");return b.separator?(d+="{\n",d+=b6(c+1,"SEP: this.tokensMap."+b.separator.name)+",\n",d+="DEF: "+b4(b.definition,c+2)+"\n",d+=b6(c,"}")+"\n"):d+=b4(b.definition,c+1),d+=b6(c,")")+"\n"}function b4(a,b){var c="function() {\n";return c+=b5(a,b),c+=b6(b,"}")+"\n"}function b5(a,b){var c="";return(0,i.jJ)(a,function(a){c+=function(a,b){var c;if(a instanceof an)return b6(b,"$.SUBRULE"+a.idx+"($."+a.nonTerminalName+")\n");if(a instanceof aq)return b3("OPTION",a,b);if(a instanceof ar)return b3("AT_LEAST_ONE",a,b);if(a instanceof as)return b3("AT_LEAST_ONE_SEP",a,b);if(a instanceof au)return b3("MANY_SEP",a,b);else if(a instanceof at)return b3("MANY",a,b);else if(a instanceof av)return b6(b,"$.OR"+a.idx+"([")+"\n"+(0,i.Tj)(a.definition,function(a){var c,d,e;return c=a,e=b6(d=b+1,"{")+"\n"+(b6(d+1,"ALT: function() {")+"\n")+b5(c.definition,d+1)+(b6(d+1,"}")+"\n")+b6(d,"}")}).join(",\n")+"\n"+b6(b,"])\n");else if(a instanceof aw)return c=a.terminalType.name,b6(b,"$.CONSUME"+a.idx+"(this.tokensMap."+c+")\n");else if(a instanceof ap)return b5(a.definition,b);else throw Error("non exhaustive match")}(a,b+1)}),c}function b6(a,b){return Array(4*a+1).join(" ")+b}function b7(a){var b,d=Function("tokenVocabulary","config","chevrotain"," \n"+b2(b={name:a.name,rules:a.rules})+"\nreturn new "+b.name+"(tokenVocabulary, config) \n");return function(b){return d(a.tokenVocabulary,b,c(704092))}}function b8(a){var b;return"\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['chevrotain'], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory(require('chevrotain'));\n } else {\n // Browser globals (root is window)\n root.returnExports = factory(root.b);\n }\n}(typeof self !== 'undefined' ? self : this, function (chevrotain) {\n\n"+b2(b={name:a.name,rules:a.rules})+"\n \nreturn {\n "+b.name+": "+b.name+" \n}\n}));\n"}function b9(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n It performs no action other than printing this message.\n Please avoid using it as it will be completely removed in the future")}var ca=function(){throw Error("The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead. \nSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0")}},706575:(a,b,c)=>{"use strict";c.d(b,{x:()=>g});var d=c(736927),e=c(115962),f=c(86839);function g({relatedObjectName:a,value:b,multiple:c=!1,onChange:g,placeholder:h,variant:i="modal",autoFocus:j=!1}){let[k,l]=(0,e.useState)(j),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)([]),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(()=>(function(a){if(!a)return[];let b=a.trim();if(!b)return[];if(b.startsWith("["))try{let a=JSON.parse(b);if(Array.isArray(a))return a.map(String).filter(Boolean)}catch{}return[b]})(b)),u=(0,e.useRef)(null),v=(0,e.useRef)(null);(0,e.useRef)(null),(0,e.useCallback)(async b=>{r(!0);try{let c=new URLSearchParams;b&&c.set("q",b);let d=await fetch(`/api/workspace/objects/${encodeURIComponent(a)}/entries/options?${c}`);if(d.ok){let a=await d.json();p(a.options??[])}}catch{}finally{r(!1)}},[a]);let w=s.map(a=>{let b=o.find(b=>b.id===a),c=b?.label??a;return{id:a,label:String(null!=c&&"object"==typeof c?JSON.stringify(c):c??"")}}),x="inline"===i;return(0,d.jsxs)("div",{ref:u,className:"relative w-full",children:[(0,d.jsxs)("div",{onClick:()=>l(!k),className:`w-full flex items-center flex-wrap gap-1 cursor-pointer min-h-[1.5em] ${x?"text-xs":"px-3 py-2 text-sm rounded-lg"}`,style:x?{}:{background:"var(--color-surface)",color:"var(--color-text)",border:"1px solid var(--color-border)"},children:[w.length>0?w.map(({id:a,label:b})=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium",style:{background:"rgba(96, 165, 250, 0.1)",color:"#60a5fa",border:"1px solid rgba(96, 165, 250, 0.2)"},children:[(0,d.jsx)("span",{className:"truncate max-w-[160px]",children:String(b??"")}),(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation();let d=s.filter(b=>b!==a);t(d),c?g(0===d.length?"":JSON.stringify(d)):g("")},className:"ml-0.5 hover:opacity-70",style:{color:"#60a5fa"},children:(0,d.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M18 6 6 18"}),(0,d.jsx)("path",{d:"m6 6 12 12"})]})})]},a)):(0,d.jsx)("span",{style:{color:"var(--color-text-muted)",opacity:.5},children:h??`Select ${(0,f.A3)(a)}...`}),(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-auto flex-shrink-0",style:{color:"var(--color-text-muted)",transform:k?"rotate(180deg)":void 0,transition:"transform 0.15s"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})]}),k&&(0,d.jsxs)("div",{className:"absolute z-50 mt-1 w-full rounded-lg shadow-lg overflow-hidden",style:{background:"var(--color-bg)",border:"1px solid var(--color-border)",maxHeight:260},children:[(0,d.jsx)("div",{className:"p-2 border-b",style:{borderColor:"var(--color-border)"},children:(0,d.jsx)("input",{ref:v,type:"text",value:m,onChange:a=>n(a.target.value),placeholder:`Search ${(0,f.PV)(a)}...`,className:"w-full px-2.5 py-1.5 text-xs rounded-md outline-none",style:{background:"var(--color-surface)",color:"var(--color-text)",border:"1px solid var(--color-border)"},onKeyDown:a=>{"Escape"===a.key&&l(!1)}})}),(0,d.jsx)("div",{className:"overflow-y-auto",style:{maxHeight:200},children:q?(0,d.jsx)("div",{className:"px-3 py-4 text-center text-xs",style:{color:"var(--color-text-muted)"},children:"Loading..."}):0===o.length?(0,d.jsx)("div",{className:"px-3 py-4 text-center text-xs",style:{color:"var(--color-text-muted)"},children:m?"No matches found":"No entries"}):o.map(a=>{let b=s.includes(a.id);return(0,d.jsxs)("button",{type:"button",onClick:()=>(a=>{if(c){let b=s.includes(a)?s.filter(b=>b!==a):[...s,a];t(b),g(0===b.length?"":JSON.stringify(b))}else t([a]),g(a),l(!1)})(a.id),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 transition-colors",style:{background:b?"var(--color-accent-light, rgba(96, 165, 250, 0.08))":"transparent",color:"var(--color-text)"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover, rgba(255,255,255,0.04))")},onMouseLeave:a=>{a.currentTarget.style.background=b?"var(--color-accent-light, rgba(96, 165, 250, 0.08))":"transparent"},children:[c&&(0,d.jsx)("span",{className:"w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0",style:{borderColor:b?"var(--color-accent)":"var(--color-border)",background:b?"var(--color-accent)":"transparent"},children:b&&(0,d.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),!c&&b&&(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-accent)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})}),(0,d.jsx)("span",{className:"truncate",children:String(null!=a.label&&"object"==typeof a.label?JSON.stringify(a.label):a.label??"")})]},a.id)})})]})]})}},707201:(a,b,c)=>{"use strict";c.d(b,{r:()=>k,y:()=>l});var d=c(736927),e=c(115962);let f={default:{bg:"rgba(148, 163, 184, 0.08)",border:"1px solid rgba(148, 163, 184, 0.2)",text:"var(--color-text)",hoverBg:"rgba(148, 163, 184, 0.15)"},primary:{bg:"rgba(59, 130, 246, 0.08)",border:"1px solid rgba(59, 130, 246, 0.25)",text:"#3b82f6",hoverBg:"rgba(59, 130, 246, 0.15)"},destructive:{bg:"rgba(220, 38, 38, 0.08)",border:"1px solid rgba(220, 38, 38, 0.2)",text:"var(--color-error)",hoverBg:"rgba(220, 38, 38, 0.15)"},success:{bg:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.25)",text:"#22c55e",hoverBg:"rgba(34, 197, 94, 0.15)"},warning:{bg:"rgba(245, 158, 11, 0.08)",border:"1px solid rgba(245, 158, 11, 0.25)",text:"#f59e0b",hoverBg:"rgba(245, 158, 11, 0.15)"}};function g({size:a=12}){return(0,d.jsx)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"animate-spin",children:(0,d.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}function h({size:a=12}){return(0,d.jsx)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})})}function i({size:a=12}){return(0,d.jsxs)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,d.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function j({size:a=12}){return(0,d.jsx)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})})}function k({action:a,entryId:b,objectName:c,fieldId:k,compact:l=!1,state:m,onExecute:n,onRequestConfirm:o,onToast:p,disabled:q=!1}){let r,s,[t,u]=(0,e.useState)({status:"idle"}),v=(0,e.useRef)(null),w=(0,e.useRef)(null),x=m??t,{status:y}=x,z=(0,e.useCallback)(async()=>{if(n)return void n(a,b);u({status:"loading"});let d=new AbortController;w.current=d;try{let e=await fetch(`/api/workspace/objects/${encodeURIComponent(c)}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionId:a.id,fieldId:k,entryIds:[b]}),signal:d.signal});if(!e.ok){let a=(await e.json().catch(()=>({error:"Request failed"}))).error??"Request failed";u({status:"error",error:a}),p?.(a,{type:"error"});return}let f=e.body?.getReader();if(!f){u({status:"error",error:"No response stream"}),p?.("No response stream",{type:"error"});return}let g=new TextDecoder,h="";for(;;){let{done:b,value:c}=await f.read();if(b)break;let d=(h+=g.decode(c,{stream:!0})).split("\n");for(let b of(h=d.pop()??"",d))if(b.startsWith("data: "))try{let c=JSON.parse(b.slice(6));if("progress"===c.type)u({status:"loading",progress:{percent:c.percent,message:c.message}});else if("log"===c.type)p?.(c.message??"",{type:"error"===c.level?"error":"info"});else if("completed"===c.type)if("success"===c.status)u({status:"success",result:c.result}),p?.(a.successLabel??`${a.label} completed`,{type:"success"}),v.current=setTimeout(()=>{u({status:"idle"})},a.autoResetMs??3e3);else{let b=c.error??"Action failed";u({status:"error",error:b}),p?.(b,{type:"error"}),v.current=setTimeout(()=>{u({status:"idle"})},a.autoResetMs??5e3)}}catch{}}}catch(b){if(d.signal.aborted)return;let a=b instanceof Error?b.message:"Unknown error";u({status:"error",error:a}),p?.(a,{type:"error"})}},[a,b,c,k,n,p]),A=(0,e.useCallback)(c=>{if(c.stopPropagation(),"loading"!==y&&!q){if("error"===y)return void u({status:"idle"});a.confirmMessage&&o?o(a,b,z):z()}},[y,q,a,b,o,z]),B=f[a.variant??"default"]??f.default,C=B.bg,D=B.border,E=B.text;switch(y){case"loading":r=a.loadingLabel??"Running...",s=(0,d.jsx)(g,{size:l?14:12});break;case"success":r=a.successLabel??"Done!",s=(0,d.jsx)(h,{size:l?14:12}),C="rgba(34, 197, 94, 0.1)",D="1px solid rgba(34, 197, 94, 0.3)",E="#22c55e";break;case"error":r=a.errorLabel??"Failed",s=(0,d.jsx)(i,{size:l?14:12}),C="rgba(220, 38, 38, 0.1)",D="1px solid rgba(220, 38, 38, 0.3)",E="var(--color-error)";break;default:r=a.label,s=(0,d.jsx)(j,{size:l?14:12})}let F=x.progress?.percent;return(0,d.jsxs)("button",{type:"button",onClick:A,disabled:"loading"===y||q,className:"relative flex items-center gap-1.5 rounded-lg text-xs font-medium transition-all duration-200 overflow-hidden select-none",style:{padding:l?"4px 6px":"5px 10px",background:C,border:D,color:E,opacity:q?.5:1,cursor:"loading"===y||q?"not-allowed":"pointer"},title:"error"===y?x.error:a.label,onMouseEnter:a=>{"loading"===y||q||(a.currentTarget.style.background=B.hoverBg)},onMouseLeave:a=>{a.currentTarget.style.background=C},children:[null!=F&&"loading"===y&&(0,d.jsx)("div",{className:"absolute inset-0 opacity-15 transition-all duration-300",style:{background:E,width:`${F}%`}}),(0,d.jsxs)("span",{className:"relative z-10 flex items-center gap-1.5",children:[s,!l&&(0,d.jsx)("span",{className:"whitespace-nowrap",children:r})]})]})}function l(){let[a,b]=(0,e.useState)(new Map),[c,d]=(0,e.useState)(new Map),f=(0,e.useCallback)((b,c)=>a.get(`${b}_${c}`)??{status:"idle"},[a]),g=(0,e.useCallback)((a,c,d)=>{b(b=>{let e=new Map(b);return e.set(`${a}_${c}`,d),e})},[]),h=(0,e.useCallback)(async(a,b,c,e,f)=>{let h=e.length,i=0,j=0,k=h;for(let b of e)g(a.id,b,{status:"loading"});d(b=>{let c=new Map(b);return c.set(a.id,{status:"running",running:k,succeeded:i,failed:j,total:h}),c});try{let l=await fetch(`/api/workspace/objects/${encodeURIComponent(c)}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionId:a.id,fieldId:b,entryIds:e})});if(!l.ok){d(b=>{let c=new Map(b);return c.set(a.id,{status:"done",running:0,succeeded:0,failed:h,total:h}),c}),f?.onToast?.(`${a.label} failed to start`,{type:"error"});return}let m=l.body?.getReader();if(!m)return;let n=new TextDecoder,o="";for(;;){let{done:b,value:c}=await m.read();if(b)break;let e=(o+=n.decode(c,{stream:!0})).split("\n");for(let b of(o=e.pop()??"",e))if(b.startsWith("data: "))try{let c=JSON.parse(b.slice(6));if("progress"===c.type&&c.entryId)g(a.id,c.entryId,{status:"loading",progress:{percent:c.percent,message:c.message}});else if("completed"===c.type&&c.entryId){k--,"success"===c.status?(i++,g(a.id,c.entryId,{status:"success",result:c.result})):(j++,g(a.id,c.entryId,{status:"error",error:c.error})),d(b=>{let c=new Map(b);return c.set(a.id,{status:k>0?"running":"done",running:k,succeeded:i,failed:j,total:h}),c});let b=f?.autoResetMs??a.autoResetMs??3e3;setTimeout(()=>{g(a.id,c.entryId,{status:"idle"})},b)}}catch{}}}catch{}d(b=>{let c=new Map(b);return c.set(a.id,{status:"done",running:0,succeeded:i,failed:j,total:h}),c}),j>0?f?.onToast?.(`${a.label}: ${i} succeeded, ${j} failed`,{type:"error"}):i>0&&f?.onToast?.(`${a.label}: ${i} entries completed`,{type:"success"}),setTimeout(()=>{d(b=>{let c=new Map(b);return c.delete(a.id),c})},5e3)},[g]);return{getState:f,setState:g,executeBulkAction:h,bulkStates:c}}},710846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},712410:(a,b,c)=>{"use strict";c.d(b,{x:()=>e});var d=c(502714);function e(a,...b){let c=d.w.bind(null,a||b.find(a=>"object"==typeof a));return b.map(c)}},712557:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],f=(0,d.A)("rocket",e)},714659:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"default",{enumerable:!0,get:function(){return e}});let d=c(96309)._(c(629395));function e(a,b){var c;let e={};"function"==typeof a&&(e.loader=a);let f={...e,...b};return(0,d.default)({...f,modules:null==(c=f.loadableGenerated)?void 0:c.modules})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},719771:a=>{"use strict";a.exports=require("process")},720511:(a,b,c)=>{"use strict";c.d(b,{KE:()=>cf,YY:()=>b1,CU:()=>bZ,Db:()=>cx,bP:()=>cy,Yv:()=>cz,Nz:()=>ck,gk:()=>a1,AB:()=>cl,T7:()=>aV,Pi:()=>M,GG:()=>cm,Nx:()=>aW,eL:()=>aX,tp:()=>a$,yQ:()=>bc,gu:()=>bg,FF:()=>bh,iI:()=>aZ,hO:()=>bi,fl:()=>bj,Pg:()=>U,zU:()=>a5,q4:()=>be,iR:()=>bf,QN:()=>bn,J_:()=>bo,rU:()=>aD,Op:()=>br,BQ:()=>bs,eE:()=>ah,OX:()=>cg,Zc:()=>cA,KV:()=>a4,jT:()=>ch,Dd:()=>cu,MG:()=>bw,kj:()=>cv,JJ:()=>ci,tG:()=>cj});var d=c(731626),e=c(331480),f=c(381802);let g=(a,b)=>!a.selection.empty&&(b&&b(a.tr.deleteSelection().scrollIntoView()),!0);function h(a,b){let{$cursor:c}=a.selection;return c&&(b?b.endOfTextblock("backward",a):!(c.parentOffset>0))?c:null}let i=(a,b,c)=>{let g=h(a,c);if(!g)return!1;let i=m(g);if(!i){let c=g.blockRange(),e=c&&(0,d.jP)(c);return null!=e&&(b&&b(a.tr.lift(c,e).scrollIntoView()),!0)}let j=i.nodeBefore;if(w(a,i,b,-1))return!0;if(0==g.parent.content.size&&(k(j,"end")||f.nh.isSelectable(j)))for(let c=g.depth;;c--){let h=(0,d.$L)(a.doc,g.before(c),g.after(c),e.Ji.empty);if(h&&h.slice.size<h.to-h.from){if(b){let c=a.tr.step(h);c.setSelection(k(j,"end")?f.LN.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):f.nh.create(c.doc,i.pos-j.nodeSize)),b(c.scrollIntoView())}return!0}if(1==c||g.node(c-1).childCount>1)break}return!!j.isAtom&&i.depth==g.depth-1&&(b&&b(a.tr.delete(i.pos-j.nodeSize,i.pos).scrollIntoView()),!0)};function j(a,b,c){let g=b.nodeBefore,h=b.pos-1;for(;!g.isTextblock;h--){if(g.type.spec.isolating)return!1;let a=g.lastChild;if(!a)return!1;g=a}let i=b.nodeAfter,j=b.pos+1;for(;!i.isTextblock;j++){if(i.type.spec.isolating)return!1;let a=i.firstChild;if(!a)return!1;i=a}let k=(0,d.$L)(a.doc,h,j,e.Ji.empty);if(!k||k.from!=h||k instanceof d.Ln&&k.slice.size>=j-h)return!1;if(c){let b=a.tr.step(k);b.setSelection(f.U3.create(b.doc,h)),c(b.scrollIntoView())}return!0}function k(a,b,c=!1){for(let d=a;d;d="start"==b?d.firstChild:d.lastChild){if(d.isTextblock)return!0;if(c&&1!=d.childCount)break}return!1}let l=(a,b,c)=>{let{$head:d,empty:e}=a.selection,g=d;if(!e)return!1;if(d.parent.isTextblock){if(c?!c.endOfTextblock("backward",a):d.parentOffset>0)return!1;g=m(d)}let h=g&&g.nodeBefore;return!!h&&!!f.nh.isSelectable(h)&&(b&&b(a.tr.setSelection(f.nh.create(a.doc,g.pos-h.nodeSize)).scrollIntoView()),!0)};function m(a){if(!a.parent.type.spec.isolating)for(let b=a.depth-1;b>=0;b--){if(a.index(b)>0)return a.doc.resolve(a.before(b+1));if(a.node(b).type.spec.isolating)break}return null}function n(a,b){let{$cursor:c}=a.selection;return c&&(b?b.endOfTextblock("forward",a):!(c.parentOffset<c.parent.content.size))?c:null}let o=(a,b,c)=>{let g=n(a,c);if(!g)return!1;let h=q(g);if(!h)return!1;let i=h.nodeAfter;if(w(a,h,b,1))return!0;if(0==g.parent.content.size&&(k(i,"start")||f.nh.isSelectable(i))){let c=(0,d.$L)(a.doc,g.before(),g.after(),e.Ji.empty);if(c&&c.slice.size<c.to-c.from){if(b){let d=a.tr.step(c);d.setSelection(k(i,"start")?f.LN.findFrom(d.doc.resolve(d.mapping.map(h.pos)),1):f.nh.create(d.doc,d.mapping.map(h.pos))),b(d.scrollIntoView())}return!0}}return!!i.isAtom&&h.depth==g.depth-1&&(b&&b(a.tr.delete(h.pos,h.pos+i.nodeSize).scrollIntoView()),!0)},p=(a,b,c)=>{let{$head:d,empty:e}=a.selection,g=d;if(!e)return!1;if(d.parent.isTextblock){if(c?!c.endOfTextblock("forward",a):d.parentOffset<d.parent.content.size)return!1;g=q(d)}let h=g&&g.nodeAfter;return!!h&&!!f.nh.isSelectable(h)&&(b&&b(a.tr.setSelection(f.nh.create(a.doc,g.pos)).scrollIntoView()),!0)};function q(a){if(!a.parent.type.spec.isolating)for(let b=a.depth-1;b>=0;b--){let c=a.node(b);if(a.index(b)+1<c.childCount)return a.doc.resolve(a.after(b+1));if(c.type.spec.isolating)break}return null}let r=(a,b)=>{let{$head:c,$anchor:d}=a.selection;return!!c.parent.type.spec.code&&!!c.sameParent(d)&&(b&&b(a.tr.insertText("\n").scrollIntoView()),!0)};function s(a){for(let b=0;b<a.edgeCount;b++){let{type:c}=a.edge(b);if(c.isTextblock&&!c.hasRequiredAttrs())return c}return null}let t=(a,b)=>{let{$head:c,$anchor:d}=a.selection;if(!c.parent.type.spec.code||!c.sameParent(d))return!1;let e=c.node(-1),g=c.indexAfter(-1),h=s(e.contentMatchAt(g));if(!h||!e.canReplaceWith(g,g,h))return!1;if(b){let d=c.after(),e=a.tr.replaceWith(d,d,h.createAndFill());e.setSelection(f.LN.near(e.doc.resolve(d),1)),b(e.scrollIntoView())}return!0},u=(a,b)=>{let c=a.selection,{$from:d,$to:e}=c;if(c instanceof f.i5||d.parent.inlineContent||e.parent.inlineContent)return!1;let g=s(e.parent.contentMatchAt(e.indexAfter()));if(!g||!g.isTextblock)return!1;if(b){let c=(!d.parentOffset&&e.index()<e.parent.childCount?d:e).pos,h=a.tr.insert(c,g.createAndFill());h.setSelection(f.U3.create(h.doc,c+1)),b(h.scrollIntoView())}return!0},v=(a,b)=>{let{$cursor:c}=a.selection;if(!c||c.parent.content.size)return!1;if(c.depth>1&&c.after()!=c.end(-1)){let e=c.before();if((0,d.zy)(a.doc,e))return b&&b(a.tr.split(e).scrollIntoView()),!0}let e=c.blockRange(),f=e&&(0,d.jP)(e);return null!=f&&(b&&b(a.tr.lift(e,f).scrollIntoView()),!0)};function w(a,b,c,g){let h,i,j,l=b.nodeBefore,m=b.nodeAfter,n,o,p=l.type.spec.isolating||m.type.spec.isolating;if(!p&&(h=b.nodeBefore,i=b.nodeAfter,j=b.index(),h&&i&&h.type.compatibleContent(i.type)&&(!h.content.size&&b.parent.canReplace(j-1,j)?(c&&c(a.tr.delete(b.pos-h.nodeSize,b.pos).scrollIntoView()),!0):!!b.parent.canReplace(j,j+1)&&!!(i.isTextblock||(0,d.n9)(a.doc,b.pos))&&(c&&c(a.tr.join(b.pos).scrollIntoView()),!0))))return!0;let q=!p&&b.parent.canReplace(b.index(),b.index()+1);if(q&&(n=(o=l.contentMatchAt(l.childCount)).findWrapping(m.type))&&o.matchType(n[0]||m.type).validEnd){if(c){let f=b.pos+m.nodeSize,g=e.FK.empty;for(let a=n.length-1;a>=0;a--)g=e.FK.from(n[a].create(null,g));g=e.FK.from(l.copy(g));let h=a.tr.step(new d.Wg(b.pos-1,f,b.pos,f,new e.Ji(g,1,0),n.length,!0)),i=h.doc.resolve(f+2*n.length);i.nodeAfter&&i.nodeAfter.type==l.type&&(0,d.n9)(h.doc,i.pos)&&h.join(i.pos),c(h.scrollIntoView())}return!0}let r=m.type.spec.isolating||g>0&&p?null:f.LN.findFrom(b,1),s=r&&r.$from.blockRange(r.$to),t=s&&(0,d.jP)(s);if(null!=t&&t>=b.depth)return c&&c(a.tr.lift(s,t).scrollIntoView()),!0;if(q&&k(m,"start",!0)&&k(l,"end")){let f=l,g=[];for(;g.push(f),!f.isTextblock;)f=f.lastChild;let h=m,i=1;for(;!h.isTextblock;h=h.firstChild)i++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(c){let f=e.FK.empty;for(let a=g.length-1;a>=0;a--)f=e.FK.from(g[a].copy(f));c(a.tr.step(new d.Wg(b.pos-g.length,b.pos+m.nodeSize,b.pos+i,b.pos+m.nodeSize-i,new e.Ji(f,g.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function x(a){return function(b,c){let d=b.selection,e=a<0?d.$from:d.$to,g=e.depth;for(;e.node(g).isInline;){if(!g)return!1;g--}return!!e.node(g).isTextblock&&(c&&c(b.tr.setSelection(f.U3.create(b.doc,a<0?e.start(g):e.end(g)))),!0)}}let y=x(-1),z=x(1);function A(a,b=null){return function(c,d){let e=!1;for(let d=0;d<c.selection.ranges.length&&!e;d++){let{$from:{pos:f},$to:{pos:g}}=c.selection.ranges[d];c.doc.nodesBetween(f,g,(d,f)=>{if(e)return!1;if(!(!d.isTextblock||d.hasMarkup(a,b)))if(d.type==a)e=!0;else{let b=c.doc.resolve(f),d=b.index();e=b.parent.canReplaceWith(d,d+1,a)}})}if(!e)return!1;if(d){let e=c.tr;for(let d=0;d<c.selection.ranges.length;d++){let{$from:{pos:f},$to:{pos:g}}=c.selection.ranges[d];e.setBlockType(f,g,a,b)}d(e.scrollIntoView())}return!0}}function B(...a){return function(b,c,d){for(let e=0;e<a.length;e++)if(a[e](b,c,d))return!0;return!1}}let C=B(g,i,l),D=B(g,o,p),E={Enter:B(r,u,v,(a,b)=>{let{$from:c,$to:e}=a.selection;if(a.selection instanceof f.nh&&a.selection.node.isBlock)return!!c.parentOffset&&!!(0,d.zy)(a.doc,c.pos)&&(b&&b(a.tr.split(c.pos).scrollIntoView()),!0);if(!c.depth)return!1;let g=[],h,i,j=!1,k=!1;for(let a=c.depth;;a--){if(c.node(a).isBlock){let b;j=c.end(a)==c.pos+(c.depth-a),k=c.start(a)==c.pos-(c.depth-a),i=s(c.node(a-1).contentMatchAt(c.indexAfter(a-1)));g.unshift(b||(j&&i?{type:i}:null)),h=a;break}if(1==a)return!1;g.unshift(null)}let l=a.tr;(a.selection instanceof f.U3||a.selection instanceof f.i5)&&l.deleteSelection();let m=l.mapping.map(c.pos),n=(0,d.zy)(l.doc,m,g.length,g);if(n||(g[0]=i?{type:i}:null,n=(0,d.zy)(l.doc,m,g.length,g)),!n)return!1;if(l.split(m,g.length,g),!j&&k&&c.node(h).type!=i){let a=l.mapping.map(c.before(h)),b=l.doc.resolve(a);i&&c.node(h-1).canReplaceWith(b.index(),b.index()+1,i)&&l.setNodeMarkup(l.mapping.map(c.before(h)),i)}return b&&b(l.scrollIntoView()),!0}),"Mod-Enter":t,Backspace:C,"Mod-Backspace":C,"Shift-Backspace":C,Delete:D,"Mod-Delete":D,"Mod-a":(a,b)=>(b&&b(a.tr.setSelection(new f.i5(a.doc))),!0)},F={"Ctrl-h":E.Backspace,"Alt-Backspace":E["Mod-Backspace"],"Ctrl-d":E.Delete,"Ctrl-Alt-Backspace":E["Mod-Delete"],"Alt-Delete":E["Mod-Delete"],"Alt-d":E["Mod-Delete"],"Ctrl-a":y,"Ctrl-e":z};for(let a in E)F[a]=E[a];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();var G=c(669661),H=c(478853),I=Object.defineProperty,J=(a,b)=>{for(var c in b)I(a,c,{get:b[c],enumerable:!0})};function K(a){let{state:b,transaction:c}=a,{selection:d}=c,{doc:e}=c,{storedMarks:f}=c;return{...b,apply:b.apply.bind(b),applyTransaction:b.applyTransaction.bind(b),plugins:b.plugins,schema:b.schema,reconfigure:b.reconfigure.bind(b),toJSON:b.toJSON.bind(b),get storedMarks(){return f},get selection(){return d},get doc(){return e},get tr(){return d=c.selection,e=c.doc,f=c.storedMarks,c}}}var L=class{constructor(a){this.editor=a.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=a.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:a,editor:b,state:c}=this,{view:d}=b,{tr:e}=c,f=this.buildProps(e);return Object.fromEntries(Object.entries(a).map(([a,b])=>[a,(...a)=>{let c=b(...a)(f);return e.getMeta("preventDispatch")||this.hasCustomState||d.dispatch(e),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(a,b=!0){let{rawCommands:c,editor:d,state:e}=this,{view:f}=d,g=[],h=!!a,i=a||e.tr,j=()=>(h||!b||i.getMeta("preventDispatch")||this.hasCustomState||f.dispatch(i),g.every(a=>!0===a)),k={...Object.fromEntries(Object.entries(c).map(([a,c])=>[a,(...a)=>{let d=this.buildProps(i,b),e=c(...a)(d);return g.push(e),k}])),run:j};return k}createCan(a){let{rawCommands:b,state:c}=this,d=a||c.tr,e=this.buildProps(d,!1);return{...Object.fromEntries(Object.entries(b).map(([a,b])=>[a,(...a)=>b(...a)({...e,dispatch:void 0})])),chain:()=>this.createChain(d,!1)}}buildProps(a,b=!0){let{rawCommands:c,editor:d,state:e}=this,{view:f}=d,g={tr:a,editor:d,view:f,state:K({state:e,transaction:a}),dispatch:b?()=>void 0:void 0,chain:()=>this.createChain(a,b),can:()=>this.createCan(a),get commands(){return Object.fromEntries(Object.entries(c).map(([a,b])=>[a,(...a)=>b(...a)(g)]))}};return g}},M={};J(M,{blur:()=>N,clearContent:()=>O,clearNodes:()=>P,command:()=>Q,createParagraphNear:()=>R,cut:()=>S,deleteCurrentNode:()=>T,deleteNode:()=>V,deleteRange:()=>W,deleteSelection:()=>X,enter:()=>Y,exitCode:()=>Z,extendMarkRange:()=>af,first:()=>ag,focus:()=>am,forEach:()=>an,insertContent:()=>ao,insertContentAt:()=>as,joinBackward:()=>av,joinDown:()=>au,joinForward:()=>aw,joinItemBackward:()=>ax,joinItemForward:()=>ay,joinTextblockBackward:()=>az,joinTextblockForward:()=>aA,joinUp:()=>at,keyboardShortcut:()=>aC,lift:()=>aE,liftEmptyBlock:()=>aF,liftListItem:()=>aG,newlineInCode:()=>aH,resetAttributes:()=>aK,scrollIntoView:()=>aL,selectAll:()=>aM,selectNodeBackward:()=>aN,selectNodeForward:()=>aO,selectParentNode:()=>aP,selectTextblockEnd:()=>aQ,selectTextblockStart:()=>aR,setContent:()=>aT,setMark:()=>bx,setMeta:()=>by,setNode:()=>bz,setNodeSelection:()=>bA,setTextDirection:()=>bB,setTextSelection:()=>bC,sinkListItem:()=>bD,splitBlock:()=>bF,splitListItem:()=>bG,toggleList:()=>bJ,toggleMark:()=>bK,toggleNode:()=>bL,toggleWrap:()=>bM,undoInputRule:()=>bN,unsetAllMarks:()=>bO,unsetMark:()=>bP,unsetTextDirection:()=>bQ,updateAttributes:()=>bR,wrapIn:()=>bS,wrapInList:()=>bT});var N=()=>({editor:a,view:b})=>(requestAnimationFrame(()=>{var c;a.isDestroyed||(b.dom.blur(),null==(c=null==window?void 0:window.getSelection())||c.removeAllRanges())}),!0),O=(a=!0)=>({commands:b})=>b.setContent("",{emitUpdate:a}),P=()=>({state:a,tr:b,dispatch:c})=>{let{selection:e}=b,{ranges:f}=e;return!c||(f.forEach(({$from:c,$to:e})=>{a.doc.nodesBetween(c.pos,e.pos,(a,c)=>{if(a.type.isText)return;let{doc:e,mapping:f}=b,g=e.resolve(f.map(c)),h=e.resolve(f.map(c+a.nodeSize)),i=g.blockRange(h);if(!i)return;let j=(0,d.jP)(i);if(a.type.isTextblock){let{defaultType:a}=g.parent.contentMatchAt(g.index());b.setNodeMarkup(i.start,a)}(j||0===j)&&b.lift(i,j)})}),!0)},Q=a=>b=>a(b),R=()=>({state:a,dispatch:b})=>u(a,b),S=(a,b)=>({editor:c,tr:d})=>{let{state:e}=c,g=e.doc.slice(a.from,a.to);d.deleteRange(a.from,a.to);let h=d.mapping.map(b);return d.insert(h,g.content),d.setSelection(new f.U3(d.doc.resolve(Math.max(h-1,0)))),!0},T=()=>({tr:a,dispatch:b})=>{let{selection:c}=a,d=c.$anchor.node();if(d.content.size>0)return!1;let e=a.selection.$anchor;for(let c=e.depth;c>0;c-=1)if(e.node(c).type===d.type){if(b){let b=e.before(c),d=e.after(c);a.delete(b,d).scrollIntoView()}return!0}return!1};function U(a,b){if("string"==typeof a){if(!b.nodes[a])throw Error(`There is no node type named '${a}'. Maybe you forgot to add the extension?`);return b.nodes[a]}return a}var V=a=>({tr:b,state:c,dispatch:d})=>{let e=U(a,c.schema),f=b.selection.$anchor;for(let a=f.depth;a>0;a-=1)if(f.node(a).type===e){if(d){let c=f.before(a),d=f.after(a);b.delete(c,d).scrollIntoView()}return!0}return!1},W=a=>({tr:b,dispatch:c})=>{let{from:d,to:e}=a;return c&&b.delete(d,e),!0},X=()=>({state:a,dispatch:b})=>g(a,b),Y=()=>({commands:a})=>a.keyboardShortcut("Enter"),Z=()=>({state:a,dispatch:b})=>t(a,b);function _(a){return"[object RegExp]"===Object.prototype.toString.call(a)}function aa(a,b,c={strict:!0}){let d=Object.keys(b);return!d.length||d.every(d=>c.strict?b[d]===a[d]:_(b[d])?b[d].test(a[d]):b[d]===a[d])}function ab(a,b,c={}){return a.find(a=>a.type===b&&aa(Object.fromEntries(Object.keys(c).map(b=>[b,a.attrs[b]])),c))}function ac(a,b,c={}){return!!ab(a,b,c)}function ad(a,b,c){var d;if(!a||!b)return;let e=a.parent.childAfter(a.parentOffset);if(e.node&&e.node.marks.some(a=>a.type===b)||(e=a.parent.childBefore(a.parentOffset)),!e.node||!e.node.marks.some(a=>a.type===b)||(c=c||(null==(d=e.node.marks[0])?void 0:d.attrs),!ab([...e.node.marks],b,c)))return;let f=e.index,g=a.start()+e.offset,h=f+1,i=g+e.node.nodeSize;for(;f>0&&ac([...a.parent.child(f-1).marks],b,c);)f-=1,g-=a.parent.child(f).nodeSize;for(;h<a.parent.childCount&&ac([...a.parent.child(h).marks],b,c);)i+=a.parent.child(h).nodeSize,h+=1;return{from:g,to:i}}function ae(a,b){if("string"==typeof a){if(!b.marks[a])throw Error(`There is no mark type named '${a}'. Maybe you forgot to add the extension?`);return b.marks[a]}return a}var af=(a,b={})=>({tr:c,state:d,dispatch:e})=>{let g=ae(a,d.schema),{doc:h,selection:i}=c,{$from:j,from:k,to:l}=i;if(e){let a=ad(j,g,b);if(a&&a.from<=k&&a.to>=l){let b=f.U3.create(h,a.from,a.to);c.setSelection(b)}}return!0},ag=a=>b=>{let c="function"==typeof a?a(b):a;for(let a=0;a<c.length;a+=1)if(c[a](b))return!0;return!1};function ah(a){return a instanceof f.U3}function ai(a=0,b=0,c=0){return Math.min(Math.max(a,b),c)}function aj(a,b=null){if(!b)return null;let c=f.LN.atStart(a),d=f.LN.atEnd(a);if("start"===b||!0===b)return c;if("end"===b)return d;let e=c.from,g=d.to;return"all"===b?f.U3.create(a,ai(0,e,g),ai(a.content.size,e,g)):f.U3.create(a,ai(b,e,g),ai(b,e,g))}function ak(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function al(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var am=(a=null,b={})=>({editor:c,view:d,tr:e,dispatch:f})=>{b={scrollIntoView:!0,...b};let g=()=>{(al()||ak())&&d.dom.focus(),"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!al()&&!ak()&&d.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!c.isDestroyed&&(d.focus(),(null==b?void 0:b.scrollIntoView)&&c.commands.scrollIntoView())})};try{if(d.hasFocus()&&null===a||!1===a)return!0}catch{return!1}if(f&&null===a&&!ah(c.state.selection))return g(),!0;let h=aj(e.doc,a)||c.state.selection,i=c.state.selection.eq(h);return f&&(i||e.setSelection(h),i&&e.storedMarks&&e.setStoredMarks(e.storedMarks),g()),!0},an=(a,b)=>c=>a.every((a,d)=>b(a,{...c,index:d})),ao=(a,b)=>({tr:c,commands:d})=>d.insertContentAt({from:c.selection.from,to:c.selection.to},a,b),ap=a=>{let b=a.childNodes;for(let c=b.length-1;c>=0;c-=1){let d=b[c];3===d.nodeType&&d.nodeValue&&/^(\n\s\s|\n)$/.test(d.nodeValue)?a.removeChild(d):1===d.nodeType&&ap(d)}return a};function aq(a){if("undefined"==typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let b=`<body>${a}</body>`;return ap(new window.DOMParser().parseFromString(b,"text/html").body)}function ar(a,b,c){if(a instanceof e.bP||a instanceof e.FK)return a;c={slice:!0,parseOptions:{},...c};let d="object"==typeof a&&null!==a,f="string"==typeof a;if(d)try{if(Array.isArray(a)&&a.length>0)return e.FK.fromArray(a.map(a=>b.nodeFromJSON(a)));let d=b.nodeFromJSON(a);return c.errorOnInvalidContent&&d.check(),d}catch(d){if(c.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:d});return console.warn("[tiptap warn]: Invalid content.","Passed value:",a,"Error:",d),ar("",b,c)}if(f){if(c.errorOnInvalidContent){let d=!1,f="",g=new e.Sj({topNode:b.spec.topNode,marks:b.spec.marks,nodes:b.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:a=>(d=!0,f="string"==typeof a?a:a.outerHTML,null)}]}})});if(c.slice?e.S4.fromSchema(g).parseSlice(aq(a),c.parseOptions):e.S4.fromSchema(g).parse(aq(a),c.parseOptions),c.errorOnInvalidContent&&d)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${f}`)})}let d=e.S4.fromSchema(b);return c.slice?d.parseSlice(aq(a),c.parseOptions).content:d.parse(aq(a),c.parseOptions)}return ar("",b,c)}var as=(a,b,c)=>({tr:g,dispatch:h,editor:i})=>{var j;if(h){let h,k;c={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...c};let l=a=>{i.emit("contentError",{editor:i,error:a,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},m={preserveWhitespace:"full",...c.parseOptions};if(!c.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{ar(b,i.schema,{parseOptions:m,errorOnInvalidContent:!0})}catch(a){l(a)}try{h=ar(b,i.schema,{parseOptions:m,errorOnInvalidContent:null!=(j=c.errorOnInvalidContent)?j:i.options.enableContentCheck})}catch(a){return l(a),!1}let{from:n,to:o}="number"==typeof a?{from:a,to:a}:{from:a.from,to:a.to},p=!0,q=!0;if((!("type"in h)?h:[h]).forEach(a=>{a.check(),p=!!p&&a.isText&&0===a.marks.length,q=!!q&&a.isBlock}),n===o&&q){let{parent:a}=g.doc.resolve(n);!a.isTextblock||a.type.spec.code||a.childCount||(n-=1,o+=1)}if(p){if(Array.isArray(b))k=b.map(a=>a.text||"").join("");else if(b instanceof e.FK){let a="";b.forEach(b=>{b.text&&(a+=b.text)}),k=a}else k="object"==typeof b&&b&&b.text?b.text:b;g.insertText(k,n,o)}else{k=h;let a=g.doc.resolve(n),b=a.node(),c=0===a.parentOffset,d=b.isText||b.isTextblock,e=b.content.size>0;c&&d&&e&&(n=Math.max(0,n-1)),g.replaceWith(n,o,k)}c.updateSelection&&function(a,b,c){let e=a.steps.length-1;if(e<b)return;let g=a.steps[e];if(!(g instanceof d.Ln||g instanceof d.Wg))return;let h=a.mapping.maps[e],i=0;h.forEach((a,b,c,d)=>{0===i&&(i=d)}),a.setSelection(f.LN.near(a.doc.resolve(i),-1))}(g,g.steps.length-1,0),c.applyInputRules&&g.setMeta("applyInputRules",{from:n,text:k}),c.applyPasteRules&&g.setMeta("applyPasteRules",{from:n,text:k})}return!0},at=()=>({state:a,dispatch:b})=>((a,b)=>{let c=a.selection,e=c instanceof f.nh,g;if(e){if(c.node.isTextblock||!(0,d.n9)(a.doc,c.from))return!1;g=c.from}else if(null==(g=(0,d.N0)(a.doc,c.from,-1)))return!1;if(b){let c=a.tr.join(g);e&&c.setSelection(f.nh.create(c.doc,g-a.doc.resolve(g).nodeBefore.nodeSize)),b(c.scrollIntoView())}return!0})(a,b),au=()=>({state:a,dispatch:b})=>((a,b)=>{let c=a.selection,e;if(c instanceof f.nh){if(c.node.isTextblock||!(0,d.n9)(a.doc,c.to))return!1;e=c.to}else if(null==(e=(0,d.N0)(a.doc,c.to,1)))return!1;return b&&b(a.tr.join(e).scrollIntoView()),!0})(a,b),av=()=>({state:a,dispatch:b})=>i(a,b),aw=()=>({state:a,dispatch:b})=>o(a,b),ax=()=>({state:a,dispatch:b,tr:c})=>{try{let e=(0,d.N0)(a.doc,a.selection.$from.pos,-1);if(null==e)return!1;return c.join(e,2),b&&b(c),!0}catch{return!1}},ay=()=>({state:a,dispatch:b,tr:c})=>{try{let e=(0,d.N0)(a.doc,a.selection.$from.pos,1);if(null==e)return!1;return c.join(e,2),b&&b(c),!0}catch{return!1}},az=()=>({state:a,dispatch:b})=>((a,b,c)=>{let d=h(a,c);if(!d)return!1;let e=m(d);return!!e&&j(a,e,b)})(a,b),aA=()=>({state:a,dispatch:b})=>((a,b,c)=>{let d=n(a,c);if(!d)return!1;let e=q(d);return!!e&&j(a,e,b)})(a,b);function aB(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var aC=a=>({editor:b,view:c,tr:d,dispatch:e})=>{let f=(function(a){let b,c,d,e,f=a.split(/-(?!$)/),g=f[f.length-1];"Space"===g&&(g=" ");for(let a=0;a<f.length-1;a+=1){let g=f[a];if(/^(cmd|meta|m)$/i.test(g))e=!0;else if(/^a(lt)?$/i.test(g))b=!0;else if(/^(c|ctrl|control)$/i.test(g))c=!0;else if(/^s(hift)?$/i.test(g))d=!0;else if(/^mod$/i.test(g))al()||aB()?e=!0:c=!0;else throw Error(`Unrecognized modifier name: ${g}`)}return b&&(g=`Alt-${g}`),c&&(g=`Ctrl-${g}`),e&&(g=`Meta-${g}`),d&&(g=`Shift-${g}`),g})(a).split(/-(?!$)/),g=f.find(a=>!["Alt","Ctrl","Meta","Shift"].includes(a)),h=new KeyboardEvent("keydown",{key:"Space"===g?" ":g,altKey:f.includes("Alt"),ctrlKey:f.includes("Ctrl"),metaKey:f.includes("Meta"),shiftKey:f.includes("Shift"),bubbles:!0,cancelable:!0}),i=b.captureTransaction(()=>{c.someProp("handleKeyDown",a=>a(c,h))});return null==i||i.steps.forEach(a=>{let b=a.map(d.mapping);b&&e&&d.maybeStep(b)}),!0};function aD(a,b,c={}){let{from:d,to:e,empty:f}=a.selection,g=b?U(b,a.schema):null,h=[];a.doc.nodesBetween(d,e,(a,b)=>{if(a.isText)return;let c=Math.max(d,b),f=Math.min(e,b+a.nodeSize);h.push({node:a,from:c,to:f})});let i=e-d,j=h.filter(a=>!g||g.name===a.node.type.name).filter(a=>aa(a.node.attrs,c,{strict:!1}));return f?!!j.length:j.reduce((a,b)=>a+b.to-b.from,0)>=i}var aE=(a,b={})=>({state:c,dispatch:e})=>{let f=U(a,c.schema);return!!aD(c,f,b)&&((a,b)=>{let{$from:c,$to:e}=a.selection,f=c.blockRange(e),g=f&&(0,d.jP)(f);return null!=g&&(b&&b(a.tr.lift(f,g).scrollIntoView()),!0)})(c,e)},aF=()=>({state:a,dispatch:b})=>v(a,b),aG=a=>({state:b,dispatch:c})=>(function(a){return function(b,c){let{$from:f,$to:g}=b.selection,h=f.blockRange(g,b=>b.childCount>0&&b.firstChild.type==a);return!!h&&(!c||(f.node(h.depth-1).type==a?function(a,b,c,f){let g=a.tr,h=f.end,i=f.$to.end(f.depth);h<i&&(g.step(new d.Wg(h-1,i,h,i,new e.Ji(e.FK.from(c.create(null,f.parent.copy())),1,0),1,!0)),f=new e.u$(g.doc.resolve(f.$from.pos),g.doc.resolve(i),f.depth));let j=(0,d.jP)(f);if(null==j)return!1;g.lift(f,j);let k=g.doc.resolve(g.mapping.map(h,-1)-1);return(0,d.n9)(g.doc,k.pos)&&k.nodeBefore.type==k.nodeAfter.type&&g.join(k.pos),b(g.scrollIntoView()),!0}(b,c,a,h):function(a,b,c){let f=a.tr,g=c.parent;for(let a=c.end,b=c.endIndex-1,d=c.startIndex;b>d;b--)a-=g.child(b).nodeSize,f.delete(a-1,a+1);let h=f.doc.resolve(c.start),i=h.nodeAfter;if(f.mapping.map(c.end)!=c.start+h.nodeAfter.nodeSize)return!1;let j=0==c.startIndex,k=c.endIndex==g.childCount,l=h.node(-1),m=h.index(-1);if(!l.canReplace(m+ +!j,m+1,i.content.append(k?e.FK.empty:e.FK.from(g))))return!1;let n=h.pos,o=n+i.nodeSize;return f.step(new d.Wg(n-!!j,o+ +!!k,n+1,o-1,new e.Ji((j?e.FK.empty:e.FK.from(g.copy(e.FK.empty))).append(k?e.FK.empty:e.FK.from(g.copy(e.FK.empty))),+!j,+!k),+!j)),b(f.scrollIntoView()),!0}(b,c,h)))}})(U(a,b.schema))(b,c),aH=()=>({state:a,dispatch:b})=>r(a,b);function aI(a,b){return b.nodes[a]?"node":b.marks[a]?"mark":null}function aJ(a,b){let c="string"==typeof b?[b]:b;return Object.keys(a).reduce((b,d)=>(c.includes(d)||(b[d]=a[d]),b),{})}var aK=(a,b)=>({tr:c,state:d,dispatch:e})=>{let f=null,g=null,h=aI("string"==typeof a?a:a.name,d.schema);if(!h)return!1;"node"===h&&(f=U(a,d.schema)),"mark"===h&&(g=ae(a,d.schema));let i=!1;return c.selection.ranges.forEach(a=>{d.doc.nodesBetween(a.$from.pos,a.$to.pos,(a,d)=>{f&&f===a.type&&(i=!0,e&&c.setNodeMarkup(d,void 0,aJ(a.attrs,b))),g&&a.marks.length&&a.marks.forEach(f=>{g===f.type&&(i=!0,e&&c.addMark(d,d+a.nodeSize,g.create(aJ(f.attrs,b))))})})}),i},aL=()=>({tr:a,dispatch:b})=>(b&&a.scrollIntoView(),!0),aM=()=>({tr:a,dispatch:b})=>{if(b){let b=new f.i5(a.doc);a.setSelection(b)}return!0},aN=()=>({state:a,dispatch:b})=>l(a,b),aO=()=>({state:a,dispatch:b})=>p(a,b),aP=()=>({state:a,dispatch:b})=>((a,b)=>{let{$from:c,to:d}=a.selection,e,g=c.sharedDepth(d);return 0!=g&&(e=c.before(g),b&&b(a.tr.setSelection(f.nh.create(a.doc,e))),!0)})(a,b),aQ=()=>({state:a,dispatch:b})=>z(a,b),aR=()=>({state:a,dispatch:b})=>y(a,b);function aS(a,b,c={},d={}){return ar(a,b,{slice:!1,parseOptions:c,errorOnInvalidContent:d.errorOnInvalidContent})}var aT=(a,{errorOnInvalidContent:b,emitUpdate:c=!0,parseOptions:d={}}={})=>({editor:e,tr:f,dispatch:g,commands:h})=>{let{doc:i}=f;if("full"!==d.preserveWhitespace){let h=aS(a,e.schema,d,{errorOnInvalidContent:null!=b?b:e.options.enableContentCheck});return g&&f.replaceWith(0,i.content.size,h).setMeta("preventUpdate",!c),!0}return g&&f.setMeta("preventUpdate",!c),h.insertContentAt({from:0,to:i.content.size},a,{parseOptions:d,errorOnInvalidContent:null!=b?b:e.options.enableContentCheck})};function aU(a,b){let c=ae(b,a.schema),{from:d,to:e,empty:f}=a.selection,g=[];f?(a.storedMarks&&g.push(...a.storedMarks),g.push(...a.selection.$head.marks())):a.doc.nodesBetween(d,e,a=>{g.push(...a.marks)});let h=g.find(a=>a.type.name===c.name);return h?{...h.attrs}:{}}function aV(a,b){let c=new d.dL(a);return b.forEach(a=>{a.steps.forEach(a=>{c.step(a)})}),c}function aW(a,b,c){let d=[];return a.nodesBetween(b.from,b.to,(a,b)=>{c(a)&&d.push({node:a,pos:b})}),d}function aX(a,b){for(let c=a.depth;c>0;c-=1){let d=a.node(c);if(b(d))return{pos:c>0?a.before(c):0,start:a.start(c),depth:c,node:d}}}function aY(a){return b=>aX(b.$from,a)}function aZ(a,b,c){return void 0===a.config[b]&&a.parent?aZ(a.parent,b,c):"function"==typeof a.config[b]?a.config[b].bind({...c,parent:a.parent?aZ(a.parent,b,c):null}):a.config[b]}function a$(a){return a.map(a=>{let b={name:a.name,options:a.options,storage:a.storage},c=aZ(a,"addExtensions",b);return c?[a,...a$(c())]:a}).flat(10)}function a_(a,b){let c=e.ZF.fromSchema(b).serializeFragment(a),d=document.implementation.createHTMLDocument().createElement("div");return d.appendChild(c),d.innerHTML}function a0(a){return"function"==typeof a}function a1(a,b,...c){return a0(a)?b?a.bind(b)(...c):a(...c):a}function a2(a){let b=a.filter(a=>"extension"===a.type);return{baseExtensions:b,nodeExtensions:a.filter(a=>"node"===a.type),markExtensions:a.filter(a=>"mark"===a.type)}}function a3(a){let b=[],{nodeExtensions:c,markExtensions:d}=a2(a),e=[...c,...d],f={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return a.forEach(a=>{let c={name:a.name,options:a.options,storage:a.storage,extensions:e},d=aZ(a,"addGlobalAttributes",c);d&&d().forEach(a=>{a.types.forEach(c=>{Object.entries(a.attributes).forEach(([a,d])=>{b.push({type:c,name:a,attribute:{...f,...d}})})})})}),e.forEach(a=>{let c={name:a.name,options:a.options,storage:a.storage},d=aZ(a,"addAttributes",c);d&&Object.entries(d()).forEach(([c,d])=>{let e={...f,...d};"function"==typeof(null==e?void 0:e.default)&&(e.default=e.default()),(null==e?void 0:e.isRequired)&&(null==e?void 0:e.default)===void 0&&delete e.default,b.push({type:a.name,name:c,attribute:e})})}),b}function a4(...a){return a.filter(a=>!!a).reduce((a,b)=>{let c={...a};return Object.entries(b).forEach(([a,b])=>{if(!c[a]){c[a]=b;return}if("class"===a){let d=b?String(b).split(" "):[],e=c[a]?c[a].split(" "):[],f=d.filter(a=>!e.includes(a));c[a]=[...e,...f].join(" ")}else if("style"===a){let d=b?b.split(";").map(a=>a.trim()).filter(Boolean):[],e=c[a]?c[a].split(";").map(a=>a.trim()).filter(Boolean):[],f=new Map;e.forEach(a=>{let[b,c]=a.split(":").map(a=>a.trim());f.set(b,c)}),d.forEach(a=>{let[b,c]=a.split(":").map(a=>a.trim());f.set(b,c)}),c[a]=Array.from(f.entries()).map(([a,b])=>`${a}: ${b}`).join("; ")}else c[a]=b}),c},{})}function a5(a,b){return b.filter(b=>b.type===a.type.name).filter(a=>a.attribute.rendered).map(b=>b.attribute.renderHTML?b.attribute.renderHTML(a.attrs)||{}:{[b.name]:a.attrs[b.name]}).reduce((a,b)=>a4(a,b),{})}function a6(a,b){return"style"in a?a:{...a,getAttrs:c=>{let d=a.getAttrs?a.getAttrs(c):a.attrs;if(!1===d)return!1;let e=b.reduce((a,b)=>{var d;let e=b.attribute.parseHTML?b.attribute.parseHTML(c):"string"!=typeof(d=c.getAttribute(b.name))?d:d.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(d):"true"===d||"false"!==d&&d;return null==e?a:{...a,[b.name]:e}},{});return{...d,...e}}}}function a7(a){return Object.fromEntries(Object.entries(a).filter(([a,b])=>!("attrs"===a&&function(a={}){return 0===Object.keys(a).length&&a.constructor===Object}(b))&&null!=b))}function a8(a){var b,c;let d={};return!(null==(b=null==a?void 0:a.attribute)?void 0:b.isRequired)&&"default"in((null==a?void 0:a.attribute)||{})&&(d.default=a.attribute.default),(null==(c=null==a?void 0:a.attribute)?void 0:c.validate)!==void 0&&(d.validate=a.attribute.validate),[a.name,d]}function a9(a,b){var c;let d=a3(a),{nodeExtensions:f,markExtensions:g}=a2(a),h=null==(c=f.find(a=>aZ(a,"topNode")))?void 0:c.name,i=Object.fromEntries(f.map(c=>{let e=d.filter(a=>a.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:b},g=a7({...a.reduce((a,b)=>{let d=aZ(b,"extendNodeSchema",f);return{...a,...d?d(c):{}}},{}),content:a1(aZ(c,"content",f)),marks:a1(aZ(c,"marks",f)),group:a1(aZ(c,"group",f)),inline:a1(aZ(c,"inline",f)),atom:a1(aZ(c,"atom",f)),selectable:a1(aZ(c,"selectable",f)),draggable:a1(aZ(c,"draggable",f)),code:a1(aZ(c,"code",f)),whitespace:a1(aZ(c,"whitespace",f)),linebreakReplacement:a1(aZ(c,"linebreakReplacement",f)),defining:a1(aZ(c,"defining",f)),isolating:a1(aZ(c,"isolating",f)),attrs:Object.fromEntries(e.map(a8))}),h=a1(aZ(c,"parseHTML",f));h&&(g.parseDOM=h.map(a=>a6(a,e)));let i=aZ(c,"renderHTML",f);i&&(g.toDOM=a=>i({node:a,HTMLAttributes:a5(a,e)}));let j=aZ(c,"renderText",f);return j&&(g.toText=j),[c.name,g]})),j=Object.fromEntries(g.map(c=>{let e=d.filter(a=>a.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:b},g=a7({...a.reduce((a,b)=>{let d=aZ(b,"extendMarkSchema",f);return{...a,...d?d(c):{}}},{}),inclusive:a1(aZ(c,"inclusive",f)),excludes:a1(aZ(c,"excludes",f)),group:a1(aZ(c,"group",f)),spanning:a1(aZ(c,"spanning",f)),code:a1(aZ(c,"code",f)),attrs:Object.fromEntries(e.map(a8))}),h=a1(aZ(c,"parseHTML",f));h&&(g.parseDOM=h.map(a=>a6(a,e)));let i=aZ(c,"renderHTML",f);return i&&(g.toDOM=a=>i({mark:a,HTMLAttributes:a5(a,e)})),[c.name,g]}));return new e.Sj({topNode:h,nodes:i,marks:j})}function ba(a){return a.sort((a,b)=>{let c=aZ(a,"priority")||100,d=aZ(b,"priority")||100;return c>d?-1:+(c<d)})}function bb(a){var b;let c=ba(a$(a)),d=Array.from(new Set((b=c.map(a=>a.name)).filter((a,c)=>b.indexOf(a)!==c)));return d.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${d.map(a=>`'${a}'`).join(", ")}]. This can lead to issues.`),c}function bc(a,b){let c=a9(bb(b),void 0),d=aq(a);return e.S4.fromSchema(c).parse(d).toJSON()}function bd(a,b,c){let{from:d,to:e}=b,{blockSeparator:f="\n\n",textSerializers:g={}}=c||{},h="";return a.nodesBetween(d,e,(a,c,i,j)=>{var k;a.isBlock&&c>d&&(h+=f);let l=null==g?void 0:g[a.type.name];if(l)return i&&(h+=l({node:a,pos:c,parent:i,index:j,range:b})),!1;a.isText&&(h+=null==(k=null==a?void 0:a.text)?void 0:k.slice(Math.max(d,c)-c,e-c))}),h}function be(a,b){let c={from:0,to:a.content.size};return bd(a,c,b)}function bf(a){return Object.fromEntries(Object.entries(a.nodes).filter(([,a])=>a.spec.toText).map(([a,b])=>[a,b.spec.toText]))}function bg(a,b){let c=aI("string"==typeof b?b:b.name,a.schema);if("node"===c){let c=U(b,a.schema),{from:d,to:e}=a.selection,f=[];a.doc.nodesBetween(d,e,a=>{f.push(a)});let g=f.reverse().find(a=>a.type.name===c.name);return g?{...g.attrs}:{}}return"mark"===c?aU(a,b):{}}function bh(a){let{mapping:b,steps:c}=a,d=[];b.maps.forEach((a,e)=>{let f=[];if(a.ranges.length)a.forEach((a,b)=>{f.push({from:a,to:b})});else{let{from:a,to:b}=c[e];if(void 0===a||void 0===b)return;f.push({from:a,to:b})}f.forEach(({from:a,to:c})=>{let f=b.slice(e).map(a,-1),g=b.slice(e).map(c),h=b.invert().map(f,-1),i=b.invert().map(g);d.push({oldRange:{from:h,to:i},newRange:{from:f,to:g}})})});let e=function(a,b=JSON.stringify){let c={};return a.filter(a=>{let d=b(a);return!Object.prototype.hasOwnProperty.call(c,d)&&(c[d]=!0)})}(d);return 1===e.length?e:e.filter((a,b)=>!e.filter((a,c)=>c!==b).some(b=>a.oldRange.from>=b.oldRange.from&&a.oldRange.to<=b.oldRange.to&&a.newRange.from>=b.newRange.from&&a.newRange.to<=b.newRange.to))}function bi(a,b,c){let d=[];return a===b?c.resolve(a).marks().forEach(b=>{let e=ad(c.resolve(a),b.type);e&&d.push({mark:b,...e})}):c.nodesBetween(a,b,(a,b)=>{a&&(null==a?void 0:a.nodeSize)!==void 0&&d.push(...a.marks.map(c=>({from:b,to:b+a.nodeSize,mark:c})))}),d}var bj=(a,b,c,d=20)=>{let e=a.doc.resolve(c),f=d,g=null;for(;f>0&&null===g;){let a=e.node(f);(null==a?void 0:a.type.name)===b?g=a:f-=1}return[g,f]};function bk(a,b){return b.nodes[a]||b.marks[a]||null}function bl(a,b,c){return Object.fromEntries(Object.entries(c).filter(([c])=>{let d=a.find(a=>a.type===b&&a.name===c);return!!d&&d.attribute.keepOnSplit}))}function bm(a,b,c={}){let{empty:d,ranges:e}=a.selection,f=b?ae(b,a.schema):null;if(d)return!!(a.storedMarks||a.selection.$from.marks()).filter(a=>!f||f.name===a.type.name).find(a=>aa(a.attrs,c,{strict:!1}));let g=0,h=[];if(e.forEach(({$from:b,$to:c})=>{let d=b.pos,e=c.pos;a.doc.nodesBetween(d,e,(a,b)=>{if(!a.isText&&!a.marks.length)return;let c=Math.max(d,b),f=Math.min(e,b+a.nodeSize);g+=f-c,h.push(...a.marks.map(a=>({mark:a,from:c,to:f})))})}),0===g)return!1;let i=h.filter(a=>!f||f.name===a.mark.type.name).filter(a=>aa(a.mark.attrs,c,{strict:!1})).reduce((a,b)=>a+b.to-b.from,0),j=h.filter(a=>!f||a.mark.type!==f&&a.mark.type.excludes(f)).reduce((a,b)=>a+b.to-b.from,0);return(i>0?i+j:i)>=g}var bn=(a,b)=>{let{$from:c,$to:d,$anchor:e}=a.selection;if(b){let c=aY(a=>a.type.name===b)(a.selection);if(!c)return!1;let d=a.doc.resolve(c.pos+1);return e.pos+1===d.end()}return!(d.parentOffset<d.parent.nodeSize-2)&&c.pos===d.pos},bo=a=>{let{$from:b,$to:c}=a.selection;return!(b.parentOffset>0)&&b.pos===c.pos};function bp(a,b){return Array.isArray(b)?b.some(b=>("string"==typeof b?b:b.name)===a.name):b}function bq(a,b){let{nodeExtensions:c}=a2(b),d=c.find(b=>b.name===a);if(!d)return!1;let e={name:d.name,options:d.options,storage:d.storage},f=a1(aZ(d,"group",e));return"string"==typeof f&&f.split(" ").includes("list")}function br(a,{checkChildren:b=!0,ignoreWhitespace:c=!1}={}){var d;if(c){if("hardBreak"===a.type.name)return!0;if(a.isText)return/^\s*$/m.test(null!=(d=a.text)?d:"")}if(a.isText)return!a.text;if(a.isAtom||a.isLeaf)return!1;if(0===a.content.childCount)return!0;if(b){let d=!0;return a.content.forEach(a=>{!1!==d&&(br(a,{ignoreWhitespace:c,checkChildren:b})||(d=!1))}),d}return!1}function bs(a){return a instanceof f.nh}var bt=class a{constructor(a){this.position=a}static fromJSON(b){return new a(b.position)}toJSON(){return{position:this.position}}};function bu(a,b){let c=b.mapping.mapResult(a.position);return{position:new bt(c.pos),mapResult:c}}function bv(a){return new bt(a)}function bw(a,b,c){let d=a.state.doc.content.size,e=ai(b,0,d),f=ai(c,0,d),g=a.coordsAtPos(e),h=a.coordsAtPos(f,-1),i=Math.min(g.top,h.top),j=Math.max(g.bottom,h.bottom),k=Math.min(g.left,h.left),l=Math.max(g.right,h.right),m={top:i,bottom:j,left:k,right:l,width:l-k,height:j-i,x:k,y:i};return{...m,toJSON:()=>m}}var bx=(a,b={})=>({tr:c,state:d,dispatch:e})=>{let{selection:f}=c,{empty:g,ranges:h}=f,i=ae(a,d.schema);if(e)if(g){let a=aU(d,i);c.addStoredMark(i.create({...a,...b}))}else h.forEach(a=>{let e=a.$from.pos,f=a.$to.pos;d.doc.nodesBetween(e,f,(a,d)=>{let g=Math.max(d,e),h=Math.min(d+a.nodeSize,f);a.marks.find(a=>a.type===i)?a.marks.forEach(a=>{i===a.type&&c.addMark(g,h,i.create({...a.attrs,...b}))}):c.addMark(g,h,i.create(b))})});return function(a,b,c){var d;let{selection:e}=b,f=null;if(ah(e)&&(f=e.$cursor),f){let b=null!=(d=a.storedMarks)?d:f.marks();return f.parent.type.allowsMarkType(c)&&(!!c.isInSet(b)||!b.some(a=>a.type.excludes(c)))}let{ranges:g}=e;return g.some(({$from:b,$to:d})=>{let e=0===b.depth&&a.doc.inlineContent&&a.doc.type.allowsMarkType(c);return a.doc.nodesBetween(b.pos,d.pos,(a,b,d)=>{if(e)return!1;if(a.isInline){let b=!d||d.type.allowsMarkType(c),f=!!c.isInSet(a.marks)||!a.marks.some(a=>a.type.excludes(c));e=b&&f}return!e}),e})}(d,c,i)},by=(a,b)=>({tr:c})=>(c.setMeta(a,b),!0),bz=(a,b={})=>({state:c,dispatch:d,chain:e})=>{let f,g=U(a,c.schema);return(c.selection.$anchor.sameParent(c.selection.$head)&&(f=c.selection.$anchor.parent.attrs),g.isTextblock)?e().command(({commands:a})=>!!A(g,{...f,...b})(c)||a.clearNodes()).command(({state:a})=>A(g,{...f,...b})(a,d)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},bA=a=>({tr:b,dispatch:c})=>{if(c){let{doc:c}=b,d=ai(a,0,c.content.size),e=f.nh.create(c,d);b.setSelection(e)}return!0},bB=(a,b)=>({tr:c,state:d,dispatch:e})=>{let f,g,{selection:h}=d;return"number"==typeof b?(f=b,g=b):b&&"from"in b&&"to"in b?(f=b.from,g=b.to):(f=h.from,g=h.to),e&&c.doc.nodesBetween(f,g,(b,d)=>{b.isText||c.setNodeMarkup(d,void 0,{...b.attrs,dir:a})}),!0},bC=a=>({tr:b,dispatch:c})=>{if(c){let{doc:c}=b,{from:d,to:e}="number"==typeof a?{from:a,to:a}:a,g=f.U3.atStart(c).from,h=f.U3.atEnd(c).to,i=ai(d,g,h),j=ai(e,g,h),k=f.U3.create(c,i,j);b.setSelection(k)}return!0},bD=a=>({state:b,dispatch:c})=>(function(a){return function(b,c){let{$from:f,$to:g}=b.selection,h=f.blockRange(g,b=>b.childCount>0&&b.firstChild.type==a);if(!h)return!1;let i=h.startIndex;if(0==i)return!1;let j=h.parent,k=j.child(i-1);if(k.type!=a)return!1;if(c){let f=k.lastChild&&k.lastChild.type==j.type,g=e.FK.from(f?a.create():null),i=new e.Ji(e.FK.from(a.create(null,e.FK.from(j.type.create(null,g)))),f?3:1,0),l=h.start,m=h.end;c(b.tr.step(new d.Wg(l-(f?3:1),m,l,m,i,1,!0)).scrollIntoView())}return!0}})(U(a,b.schema))(b,c);function bE(a,b){let c=a.storedMarks||a.selection.$to.parentOffset&&a.selection.$from.marks();if(c){let d=c.filter(a=>null==b?void 0:b.includes(a.type.name));a.tr.ensureMarks(d)}}var bF=({keepMarks:a=!0}={})=>({tr:b,state:c,dispatch:e,editor:g})=>{let{selection:h,doc:i}=b,{$from:j,$to:k}=h,l=bl(g.extensionManager.attributes,j.node().type.name,j.node().attrs);if(h instanceof f.nh&&h.node.isBlock)return!!j.parentOffset&&!!(0,d.zy)(i,j.pos)&&(e&&(a&&bE(c,g.extensionManager.splittableMarks),b.split(j.pos).scrollIntoView()),!0);if(!j.parent.isBlock)return!1;let m=k.parentOffset===k.parent.content.size,n=0===j.depth?void 0:function(a){for(let b=0;b<a.edgeCount;b+=1){let{type:c}=a.edge(b);if(c.isTextblock&&!c.hasRequiredAttrs())return c}return null}(j.node(-1).contentMatchAt(j.indexAfter(-1))),o=m&&n?[{type:n,attrs:l}]:void 0,p=(0,d.zy)(b.doc,b.mapping.map(j.pos),1,o);if(!o&&!p&&(0,d.zy)(b.doc,b.mapping.map(j.pos),1,n?[{type:n}]:void 0)&&(p=!0,o=n?[{type:n,attrs:l}]:void 0),e){if(p&&(h instanceof f.U3&&b.deleteSelection(),b.split(b.mapping.map(j.pos),1,o),n&&!m&&!j.parentOffset&&j.parent.type!==n)){let a=b.mapping.map(j.before()),c=b.doc.resolve(a);j.node(-1).canReplaceWith(c.index(),c.index()+1,n)&&b.setNodeMarkup(b.mapping.map(j.before()),n)}a&&bE(c,g.extensionManager.splittableMarks),b.scrollIntoView()}return p},bG=(a,b={})=>({tr:c,state:g,dispatch:h,editor:i})=>{var j;let k=U(a,g.schema),{$from:l,$to:m}=g.selection,n=g.selection.node;if(n&&n.isBlock||l.depth<2||!l.sameParent(m))return!1;let o=l.node(-1);if(o.type!==k)return!1;let p=i.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==k||l.index(-2)!==l.node(-2).childCount-1)return!1;if(h){let a=e.FK.empty,d=l.index(-1)?1:l.index(-2)?2:3;for(let b=l.depth-d;b>=l.depth-3;b-=1)a=e.FK.from(l.node(b).copy(a));let g=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,h={...bl(p,l.node().type.name,l.node().attrs),...b},i=(null==(j=k.contentMatch.defaultType)?void 0:j.createAndFill(h))||void 0;a=a.append(e.FK.from(k.createAndFill(null,i)||void 0));let m=l.before(l.depth-(d-1));c.replace(m,l.after(-g),new e.Ji(a,4-d,0));let n=-1;c.doc.nodesBetween(m,c.doc.content.size,(a,b)=>{if(n>-1)return!1;a.isTextblock&&0===a.content.size&&(n=b+1)}),n>-1&&c.setSelection(f.U3.near(c.doc.resolve(n))),c.scrollIntoView()}return!0}let q=m.pos===l.end()?o.contentMatchAt(0).defaultType:null,r={...bl(p,o.type.name,o.attrs),...b},s={...bl(p,l.node().type.name,l.node().attrs),...b};c.delete(l.pos,m.pos);let t=q?[{type:k,attrs:r},{type:q,attrs:s}]:[{type:k,attrs:r}];if(!(0,d.zy)(c.doc,l.pos,2))return!1;if(h){let{selection:a,storedMarks:b}=g,{splittableMarks:d}=i.extensionManager,e=b||a.$to.parentOffset&&a.$from.marks();if(c.split(l.pos,2,t).scrollIntoView(),!e||!h)return!0;let f=e.filter(a=>d.includes(a.type.name));c.ensureMarks(f)}return!0},bH=(a,b)=>{let c=aY(a=>a.type===b)(a.selection);if(!c)return!0;let e=a.doc.resolve(Math.max(0,c.pos-1)).before(c.depth);if(void 0===e)return!0;let f=a.doc.nodeAt(e);return!(c.node.type===(null==f?void 0:f.type)&&(0,d.n9)(a.doc,c.pos))||(a.join(c.pos),!0)},bI=(a,b)=>{let c=aY(a=>a.type===b)(a.selection);if(!c)return!0;let e=a.doc.resolve(c.start).after(c.depth);if(void 0===e)return!0;let f=a.doc.nodeAt(e);return!(c.node.type===(null==f?void 0:f.type)&&(0,d.n9)(a.doc,e))||(a.join(e),!0)},bJ=(a,b,c,d={})=>({editor:e,tr:f,state:g,dispatch:h,chain:i,commands:j,can:k})=>{let{extensions:l,splittableMarks:m}=e.extensionManager,n=U(a,g.schema),o=U(b,g.schema),{selection:p,storedMarks:q}=g,{$from:r,$to:s}=p,t=r.blockRange(s),u=q||p.$to.parentOffset&&p.$from.marks();if(!t)return!1;let v=aY(a=>bq(a.type.name,l))(p);if(t.depth>=1&&v&&t.depth-v.depth<=1){if(v.node.type===n)return j.liftListItem(o);if(bq(v.node.type.name,l)&&n.validContent(v.node.content)&&h)return i().command(()=>(f.setNodeMarkup(v.pos,n),!0)).command(()=>bH(f,n)).command(()=>bI(f,n)).run()}return c&&u&&h?i().command(()=>{let a=k().wrapInList(n,d),b=u.filter(a=>m.includes(a.type.name));return f.ensureMarks(b),!!a||j.clearNodes()}).wrapInList(n,d).command(()=>bH(f,n)).command(()=>bI(f,n)).run():i().command(()=>!!k().wrapInList(n,d)||j.clearNodes()).wrapInList(n,d).command(()=>bH(f,n)).command(()=>bI(f,n)).run()},bK=(a,b={},c={})=>({state:d,commands:e})=>{let{extendEmptyMarkRange:f=!1}=c,g=ae(a,d.schema);return bm(d,g,b)?e.unsetMark(g,{extendEmptyMarkRange:f}):e.setMark(g,b)},bL=(a,b,c={})=>({state:d,commands:e})=>{let f,g=U(a,d.schema),h=U(b,d.schema),i=aD(d,g,c);return(d.selection.$anchor.sameParent(d.selection.$head)&&(f=d.selection.$anchor.parent.attrs),i)?e.setNode(h,f):e.setNode(g,{...f,...c})},bM=(a,b={})=>({state:c,commands:d})=>{let e=U(a,c.schema);return aD(c,e,b)?d.lift(e):d.wrapIn(e,b)},bN=()=>({state:a,dispatch:b})=>{let c=a.plugins;for(let d=0;d<c.length;d+=1){let e,f=c[d];if(f.spec.isInputRules&&(e=f.getState(a))){if(b){let b=a.tr,c=e.transform;for(let a=c.steps.length-1;a>=0;a-=1)b.step(c.steps[a].invert(c.docs[a]));if(e.text){let c=b.doc.resolve(e.from).marks();b.replaceWith(e.from,e.to,a.schema.text(e.text,c))}else b.delete(e.from,e.to)}return!0}}return!1},bO=()=>({tr:a,dispatch:b})=>{let{selection:c}=a,{empty:d,ranges:e}=c;return!!d||(b&&e.forEach(b=>{a.removeMark(b.$from.pos,b.$to.pos)}),!0)},bP=(a,b={})=>({tr:c,state:d,dispatch:e})=>{var f;let{extendEmptyMarkRange:g=!1}=b,{selection:h}=c,i=ae(a,d.schema),{$from:j,empty:k,ranges:l}=h;if(!e)return!0;if(k&&g){let{from:a,to:b}=h,d=null==(f=j.marks().find(a=>a.type===i))?void 0:f.attrs,e=ad(j,i,d);e&&(a=e.from,b=e.to),c.removeMark(a,b,i)}else l.forEach(a=>{c.removeMark(a.$from.pos,a.$to.pos,i)});return c.removeStoredMark(i),!0},bQ=a=>({tr:b,state:c,dispatch:d})=>{let e,f,{selection:g}=c;return"number"==typeof a?(e=a,f=a):a&&"from"in a&&"to"in a?(e=a.from,f=a.to):(e=g.from,f=g.to),d&&b.doc.nodesBetween(e,f,(a,c)=>{if(a.isText)return;let d={...a.attrs};delete d.dir,b.setNodeMarkup(c,void 0,d)}),!0},bR=(a,b={})=>({tr:c,state:d,dispatch:e})=>{let f=null,g=null,h=aI("string"==typeof a?a:a.name,d.schema);if(!h)return!1;"node"===h&&(f=U(a,d.schema)),"mark"===h&&(g=ae(a,d.schema));let i=!1;return c.selection.ranges.forEach(a=>{let h,j,k,l,m=a.$from.pos,n=a.$to.pos;c.selection.empty?d.doc.nodesBetween(m,n,(a,b)=>{f&&f===a.type&&(i=!0,k=Math.max(b,m),l=Math.min(b+a.nodeSize,n),h=b,j=a)}):d.doc.nodesBetween(m,n,(a,d)=>{d<m&&f&&f===a.type&&(i=!0,k=Math.max(d,m),l=Math.min(d+a.nodeSize,n),h=d,j=a),d>=m&&d<=n&&(f&&f===a.type&&(i=!0,e&&c.setNodeMarkup(d,void 0,{...a.attrs,...b})),g&&a.marks.length&&a.marks.forEach(f=>{if(g===f.type&&(i=!0,e)){let e=Math.max(d,m),h=Math.min(d+a.nodeSize,n);c.addMark(e,h,g.create({...f.attrs,...b}))}}))}),j&&(void 0!==h&&e&&c.setNodeMarkup(h,void 0,{...j.attrs,...b}),g&&j.marks.length&&j.marks.forEach(a=>{g===a.type&&e&&c.addMark(k,l,g.create({...a.attrs,...b}))}))}),i},bS=(a,b={})=>({state:c,dispatch:e})=>(function(a,b=null){return function(c,e){let{$from:f,$to:g}=c.selection,h=f.blockRange(g),i=h&&(0,d.oM)(h,a,b);return!!i&&(e&&e(c.tr.wrap(h,i).scrollIntoView()),!0)}})(U(a,c.schema),b)(c,e),bT=(a,b={})=>({state:c,dispatch:f})=>(function(a,b=null){return function(c,f){let{$from:g,$to:h}=c.selection,i=g.blockRange(h);if(!i)return!1;let j=f?c.tr:null;return!!function(a,b,c,f=null){let g=!1,h=b,i=b.$from.doc;if(b.depth>=2&&b.$from.node(b.depth-1).type.compatibleContent(c)&&0==b.startIndex){if(0==b.$from.index(b.depth-1))return!1;let a=i.resolve(b.start-2);h=new e.u$(a,a,b.depth),b.endIndex<b.parent.childCount&&(b=new e.u$(b.$from,i.resolve(b.$to.end(b.depth)),b.depth)),g=!0}let j=(0,d.oM)(h,c,f,b);return!!j&&(a&&function(a,b,c,f,g){let h=e.FK.empty;for(let a=c.length-1;a>=0;a--)h=e.FK.from(c[a].type.create(c[a].attrs,h));a.step(new d.Wg(b.start-2*!!f,b.end,b.start,b.end,new e.Ji(h,0,0),c.length,!0));let i=0;for(let a=0;a<c.length;a++)c[a].type==g&&(i=a+1);let j=c.length-i,k=b.start+c.length-2*!!f,l=b.parent;for(let c=b.startIndex,e=b.endIndex,f=!0;c<e;c++,f=!1)!f&&(0,d.zy)(a.doc,k,j)&&(a.split(k,j),k+=2*j),k+=l.child(c).nodeSize}(a,b,j,g,c),!0)}(j,i,a,b)&&(f&&f(j.scrollIntoView()),!0)}})(U(a,c.schema),b)(c,f),bU=class{constructor(){this.callbacks={}}on(a,b){return this.callbacks[a]||(this.callbacks[a]=[]),this.callbacks[a].push(b),this}emit(a,...b){let c=this.callbacks[a];return c&&c.forEach(a=>a.apply(this,b)),this}off(a,b){let c=this.callbacks[a];return c&&(b?this.callbacks[a]=c.filter(a=>a!==b):delete this.callbacks[a]),this}once(a,b){let c=(...d)=>{this.off(a,c),b.apply(this,d)};return this.on(a,c)}removeAllListeners(){this.callbacks={}}},bV=class{constructor(a){var b;this.find=a.find,this.handler=a.handler,this.undoable=null==(b=a.undoable)||b}};function bW(a){var b;let{editor:c,from:d,to:e,text:f,rules:g,plugin:h}=a,{view:i}=c;if(i.composing)return!1;let j=i.state.doc.resolve(d);if(j.parent.type.spec.code||(null==(b=j.nodeBefore||j.nodeAfter)?void 0:b.marks.find(a=>a.type.spec.code)))return!1;let k=!1,l=((a,b=500)=>{let c="",d=a.parentOffset;return a.parent.nodesBetween(Math.max(0,d-b),d,(a,b,e,f)=>{var g,h;let i=(null==(h=(g=a.type.spec).toText)?void 0:h.call(g,{node:a,pos:b,parent:e,index:f}))||a.textContent||"%leaf%";c+=a.isAtom&&!a.isText?i:i.slice(0,Math.max(0,d-b))}),c})(j)+f;return g.forEach(a=>{if(k)return;let b=((a,b)=>{if(_(b))return b.exec(a);let c=b(a);if(!c)return null;let d=[c.text];return d.index=c.index,d.input=a,d.data=c.data,c.replaceWith&&(c.text.includes(c.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),d.push(c.replaceWith)),d})(l,a.find);if(!b)return;let g=i.state.tr,j=K({state:i.state,transaction:g}),m={from:d-(b[0].length-f.length),to:e},{commands:n,chain:o,can:p}=new L({editor:c,state:j});null!==a.handler({state:j,range:m,match:b,commands:n,chain:o,can:p})&&g.steps.length&&(a.undoable&&g.setMeta(h,{transform:g,from:d,to:e,text:f}),i.dispatch(g),k=!0)}),k}function bX(a){return"Object"===Object.prototype.toString.call(a).slice(8,-1)&&a.constructor===Object&&Object.getPrototypeOf(a)===Object.prototype}var bY=class{constructor(a={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...a},this.name=this.config.name}get options(){return{...a1(aZ(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...a1(aZ(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(a={}){let b=this.extend({...this.config,addOptions:()=>(function a(b,c){let d={...b};return bX(b)&&bX(c)&&Object.keys(c).forEach(e=>{bX(c[e])&&bX(b[e])?d[e]=a(b[e],c[e]):d[e]=c[e]}),d})(this.options,a)});return b.name=this.name,b.parent=this.parent,b}extend(a={}){let b=new this.constructor({...this.config,...a});return b.parent=this,this.child=b,b.name="name"in a?a.name:b.parent.name,b}},bZ=class a extends bY{constructor(){super(...arguments),this.type="mark"}static create(b={}){return new a("function"==typeof b?b():b)}static handleExit({editor:a,mark:b}){let{tr:c}=a.state,d=a.state.selection.$from;if(d.pos===d.end()){let e=d.marks();if(!e.find(a=>(null==a?void 0:a.type.name)===b.name))return!1;let f=e.find(a=>(null==a?void 0:a.type.name)===b.name);return f&&c.removeStoredMark(f),c.insertText(" ",d.pos),a.view.dispatch(c),!0}return!1}configure(a){return super.configure(a)}extend(a){let b="function"==typeof a?a():a;return super.extend(b)}},b$=class{constructor(a){this.find=a.find,this.handler=a.handler}},b_=null,b0=class{constructor(a,b){this.splittableMarks=[],this.editor=b,this.baseExtensions=a,this.extensions=bb(a),this.schema=a9(this.extensions,b),this.setupExtensions()}get commands(){return this.extensions.reduce((a,b)=>{let c={name:b.name,options:b.options,storage:this.editor.extensionStorage[b.name],editor:this.editor,type:bk(b.name,this.schema)},d=aZ(b,"addCommands",c);return d?{...a,...d()}:a},{})}get plugins(){let{editor:a}=this;return ba([...this.extensions].reverse()).flatMap(b=>{let c={name:b.name,options:b.options,storage:this.editor.extensionStorage[b.name],editor:a,type:bk(b.name,this.schema)},d=[],g=aZ(b,"addKeyboardShortcuts",c),h={};if("mark"===b.type&&aZ(b,"exitable",c)&&(h.ArrowRight=()=>bZ.handleExit({editor:a,mark:b})),g){let b=Object.fromEntries(Object.entries(g()).map(([b,c])=>[b,()=>c({editor:a})]));h={...h,...b}}let i=(0,H.w)(h);d.push(i);let j=aZ(b,"addInputRules",c);if(bp(b,a.options.enableInputRules)&&j){let b=j();if(b&&b.length){let c=function(a){let{editor:b,rules:c}=a,d=new f.k_({state:{init:()=>null,apply(a,f,g){let h=a.getMeta(d);if(h)return h;let i=a.getMeta("applyInputRules");return i&&setTimeout(()=>{let{text:a}=i;"string"==typeof a||(a=a_(e.FK.from(a),g.schema));let{from:f}=i,h=f+a.length;bW({editor:b,from:f,to:h,text:a,rules:c,plugin:d})}),a.selectionSet||a.docChanged?null:f}},props:{handleTextInput:(a,e,f,g)=>bW({editor:b,from:e,to:f,text:g,rules:c,plugin:d}),handleDOMEvents:{compositionend:a=>(setTimeout(()=>{let{$cursor:e}=a.state.selection;e&&bW({editor:b,from:e.pos,to:e.pos,text:"",rules:c,plugin:d})}),!1)},handleKeyDown(a,e){if("Enter"!==e.key)return!1;let{$cursor:f}=a.state.selection;return!!f&&bW({editor:b,from:f.pos,to:f.pos,text:"\n",rules:c,plugin:d})}},isInputRules:!0});return d}({editor:a,rules:b}),g=Array.isArray(c)?c:[c];d.push(...g)}}let k=aZ(b,"addPasteRules",c);if(bp(b,a.options.enablePasteRules)&&k){let b=k();if(b&&b.length){let c=function(a){let b,{editor:c,rules:d}=a,g=null,h=!1,i=!1,j="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{b="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{b=null}let k=({state:a,from:d,to:e,rule:f,pasteEvt:g})=>{let h=a.tr;if(function(a){let{editor:b,state:c,from:d,to:e,rule:f,pasteEvent:g,dropEvent:h}=a,{commands:i,chain:j,can:k}=new L({editor:b,state:c}),l=[];return c.doc.nodesBetween(d,e,(a,b)=>{var m,n,o,p,q;if((null==(n=null==(m=a.type)?void 0:m.spec)?void 0:n.code)||!(a.isText||a.isTextblock||a.isInline))return;let r=null!=(q=null!=(p=null==(o=a.content)?void 0:o.size)?p:a.nodeSize)?q:0,s=Math.max(d,b),t=Math.min(e,b+r);s>=t||((a,b,c)=>{if(_(b))return[...a.matchAll(b)];let d=b(a,c);return d?d.map(b=>{let c=[b.text];return c.index=b.index,c.input=a,c.data=b.data,b.replaceWith&&(b.text.includes(b.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),c.push(b.replaceWith)),c}):[]})(a.isText?a.text||"":a.textBetween(s-b,t-b,void 0,""),f.find,g).forEach(a=>{if(void 0===a.index)return;let b=s+a.index+1,d=b+a[0].length,e={from:c.tr.mapping.map(b),to:c.tr.mapping.map(d)},m=f.handler({state:c,range:e,match:a,commands:i,chain:j,can:k,pasteEvent:g,dropEvent:h});l.push(m)})}),l.every(a=>null!==a)}({editor:c,state:K({state:a,transaction:h}),from:Math.max(d-1,0),to:e.b-1,rule:f,pasteEvent:g,dropEvent:b})&&h.steps.length){try{b="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{b=null}return j="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,h}};return d.map(a=>new f.k_({view(a){let b=b=>{var d;(g=(null==(d=a.dom.parentElement)?void 0:d.contains(b.target))?a.dom.parentElement:null)&&(b_=c)},d=()=>{b_&&(b_=null)};return window.addEventListener("dragstart",b),window.addEventListener("dragend",d),{destroy(){window.removeEventListener("dragstart",b),window.removeEventListener("dragend",d)}}},props:{handleDOMEvents:{drop:(a,c)=>{if(i=g===a.dom.parentElement,b=c,!i){let a=b_;(null==a?void 0:a.isEditable)&&setTimeout(()=>{let b=a.state.selection;b&&a.commands.deleteRange({from:b.from,to:b.to})},10)}return!1},paste:(a,b)=>{var c;let d=null==(c=b.clipboardData)?void 0:c.getData("text/html");return j=b,h=!!(null==d?void 0:d.includes("data-pm-slice")),!1}}},appendTransaction:(b,c,d)=>{let f=b[0],g="paste"===f.getMeta("uiEvent")&&!h,l="drop"===f.getMeta("uiEvent")&&!i,m=f.getMeta("applyPasteRules"),n=!!m;if(!g&&!l&&!n)return;if(n){let{text:b}=m;"string"==typeof b||(b=a_(e.FK.from(b),d.schema));let{from:c}=m,f=c+b.length;return k({rule:a,state:d,from:c,to:{b:f},pasteEvt:(a=>{var b;let c=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(b=c.clipboardData)||b.setData("text/html",a),c})(b)})}let o=c.doc.content.findDiffStart(d.doc.content),p=c.doc.content.findDiffEnd(d.doc.content);if("number"==typeof o&&p&&o!==p.b)return k({rule:a,state:d,from:o,to:p,pasteEvt:j})}}))}({editor:a,rules:b});d.push(...c)}}let l=aZ(b,"addProseMirrorPlugins",c);if(l){let a=l();d.push(...a)}return d})}get attributes(){return a3(this.extensions)}get nodeViews(){let{editor:a}=this,{nodeExtensions:b}=a2(this.extensions);return Object.fromEntries(b.filter(a=>!!aZ(a,"addNodeView")).map(b=>{let c=this.attributes.filter(a=>a.type===b.name),d={name:b.name,options:b.options,storage:this.editor.extensionStorage[b.name],editor:a,type:U(b.name,this.schema)},e=aZ(b,"addNodeView",d);if(!e)return[];let f=e();return f?[b.name,(d,e,g,h,i)=>{let j=a5(d,c);return f({node:d,view:e,getPos:g,decorations:h,innerDecorations:i,editor:a,extension:b,HTMLAttributes:j})}]:[]}))}dispatchTransaction(a){let{editor:b}=this;return ba([...this.extensions].reverse()).reduceRight((a,c)=>{let d={name:c.name,options:c.options,storage:this.editor.extensionStorage[c.name],editor:b,type:bk(c.name,this.schema)},e=aZ(c,"dispatchTransaction",d);return e?b=>{e.call(d,{transaction:b,next:a})}:a},a)}get markViews(){let{editor:a}=this,{markExtensions:b}=a2(this.extensions);return Object.fromEntries(b.filter(a=>!!aZ(a,"addMarkView")).map(b=>{let c=this.attributes.filter(a=>a.type===b.name),d={name:b.name,options:b.options,storage:this.editor.extensionStorage[b.name],editor:a,type:ae(b.name,this.schema)},e=aZ(b,"addMarkView",d);return e?[b.name,(d,f,g)=>{let h=a5(d,c);return e()({mark:d,view:f,inline:g,editor:a,extension:b,HTMLAttributes:h,updateAttributes:b=>{cw(d,a,b)}})}]:[]}))}setupExtensions(){let a=this.extensions;this.editor.extensionStorage=Object.fromEntries(a.map(a=>[a.name,a.storage])),a.forEach(a=>{var b;let c={name:a.name,options:a.options,storage:this.editor.extensionStorage[a.name],editor:this.editor,type:bk(a.name,this.schema)};"mark"===a.type&&(null==(b=a1(aZ(a,"keepOnSplit",c)))||b)&&this.splittableMarks.push(a.name);let d=aZ(a,"onBeforeCreate",c),e=aZ(a,"onCreate",c),f=aZ(a,"onUpdate",c),g=aZ(a,"onSelectionUpdate",c),h=aZ(a,"onTransaction",c),i=aZ(a,"onFocus",c),j=aZ(a,"onBlur",c),k=aZ(a,"onDestroy",c);d&&this.editor.on("beforeCreate",d),e&&this.editor.on("create",e),f&&this.editor.on("update",f),g&&this.editor.on("selectionUpdate",g),h&&this.editor.on("transaction",h),i&&this.editor.on("focus",i),j&&this.editor.on("blur",j),k&&this.editor.on("destroy",k)})}};b0.resolve=bb,b0.sort=ba,b0.flatten=a$,J({},{ClipboardTextSerializer:()=>b2,Commands:()=>b3,Delete:()=>b4,Drop:()=>b5,Editable:()=>b6,FocusEvents:()=>b8,Keymap:()=>b9,Paste:()=>ca,Tabindex:()=>cb,TextDirection:()=>cc,focusEventsPluginKey:()=>b7});var b1=class a extends bY{constructor(){super(...arguments),this.type="extension"}static create(b={}){return new a("function"==typeof b?b():b)}configure(a){return super.configure(a)}extend(a){let b="function"==typeof a?a():a;return super.extend(b)}},b2=b1.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new f.k_({key:new f.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:a}=this,{state:b,schema:c}=a,{doc:d,selection:e}=b,{ranges:f}=e,g=Math.min(...f.map(a=>a.$from.pos)),h=Math.max(...f.map(a=>a.$to.pos)),i=bf(c);return bd(d,{from:g,to:h},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:i})}}})]}}),b3=b1.create({name:"commands",addCommands:()=>({...M})}),b4=b1.create({name:"delete",onUpdate({transaction:a,appendedTransactions:b}){var c,e,f;let g=()=>{var c,e,f,g;if(null!=(g=null==(f=null==(e=null==(c=this.editor.options.coreExtensionOptions)?void 0:c.delete)?void 0:e.filterTransaction)?void 0:f.call(e,a))?g:a.getMeta("y-sync$"))return;let h=aV(a.before,[a,...b]);bh(h).forEach(b=>{h.mapping.mapResult(b.oldRange.from).deletedAfter&&h.mapping.mapResult(b.oldRange.to).deletedBefore&&h.before.nodesBetween(b.oldRange.from,b.oldRange.to,(c,d)=>{let e=d+c.nodeSize-2,f=b.oldRange.from<=d&&e<=b.oldRange.to;this.editor.emit("delete",{type:"node",node:c,from:d,to:e,newFrom:h.mapping.map(d),newTo:h.mapping.map(e),deletedRange:b.oldRange,newRange:b.newRange,partial:!f,editor:this.editor,transaction:a,combinedTransform:h})})});let i=h.mapping;h.steps.forEach((b,c)=>{var e,f;if(b instanceof d.Ys){let d=i.slice(c).map(b.from,-1),g=i.slice(c).map(b.to),j=i.invert().map(d,-1),k=i.invert().map(g),l=null==(e=h.doc.nodeAt(d-1))?void 0:e.marks.some(a=>a.eq(b.mark)),m=null==(f=h.doc.nodeAt(g))?void 0:f.marks.some(a=>a.eq(b.mark));this.editor.emit("delete",{type:"mark",mark:b.mark,from:b.from,to:b.to,deletedRange:{from:j,to:k},newRange:{from:d,to:g},partial:!!(m||l),editor:this.editor,transaction:a,combinedTransform:h})}})};null==(f=null==(e=null==(c=this.editor.options.coreExtensionOptions)?void 0:c.delete)?void 0:e.async)||f?setTimeout(g,0):g()}}),b5=b1.create({name:"drop",addProseMirrorPlugins(){return[new f.k_({key:new f.hs("tiptapDrop"),props:{handleDrop:(a,b,c,d)=>{this.editor.emit("drop",{editor:this.editor,event:b,slice:c,moved:d})}}})]}}),b6=b1.create({name:"editable",addProseMirrorPlugins(){return[new f.k_({key:new f.hs("editable"),props:{editable:()=>this.editor.options.editable}})]}}),b7=new f.hs("focusEvents"),b8=b1.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:a}=this;return[new f.k_({key:b7,props:{handleDOMEvents:{focus:(b,c)=>{a.isFocused=!0;let d=a.state.tr.setMeta("focus",{event:c}).setMeta("addToHistory",!1);return b.dispatch(d),!1},blur:(b,c)=>{a.isFocused=!1;let d=a.state.tr.setMeta("blur",{event:c}).setMeta("addToHistory",!1);return b.dispatch(d),!1}}}})]}}),b9=b1.create({name:"keymap",addKeyboardShortcuts(){let a=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:b})=>{let{selection:c,doc:d}=b,{empty:e,$anchor:g}=c,{pos:h,parent:i}=g,j=g.parent.isTextblock&&h>0?b.doc.resolve(h-1):g,k=j.parent.type.spec.isolating,l=g.pos-g.parentOffset,m=k&&1===j.parent.childCount?l===g.pos:f.LN.atStart(d).from===h;return!!e&&!!i.type.isTextblock&&!i.textContent.length&&!!m&&(!m||"paragraph"!==g.parent.type.name)&&a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),b=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),c={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:a,"Mod-Backspace":a,"Shift-Backspace":a,Delete:b,"Mod-Delete":b,"Mod-a":()=>this.editor.commands.selectAll()},d={...c},e={...c,"Ctrl-h":a,"Alt-Backspace":a,"Ctrl-d":b,"Ctrl-Alt-Backspace":b,"Alt-Delete":b,"Alt-d":b,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return al()||aB()?e:d},addProseMirrorPlugins(){return[new f.k_({key:new f.hs("clearDocument"),appendTransaction:(a,b,c)=>{if(a.some(a=>a.getMeta("composition")))return;let d=a.some(a=>a.docChanged)&&!b.doc.eq(c.doc),e=a.some(a=>a.getMeta("preventClearDocument"));if(!d||e)return;let{empty:g,from:h,to:i}=b.selection,j=f.LN.atStart(b.doc).from,k=f.LN.atEnd(b.doc).to;if(g||h!==j||i!==k||!br(c.doc))return;let l=c.tr,m=K({state:c,transaction:l}),{commands:n}=new L({editor:this.editor,state:m});if(n.clearNodes(),l.steps.length)return l}})]}}),ca=b1.create({name:"paste",addProseMirrorPlugins(){return[new f.k_({key:new f.hs("tiptapPaste"),props:{handlePaste:(a,b,c)=>{this.editor.emit("paste",{editor:this.editor,event:b,slice:c})}}})]}}),cb=b1.create({name:"tabindex",addProseMirrorPlugins(){return[new f.k_({key:new f.hs("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),cc=b1.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:a}=a2(this.extensions);return[{types:a.filter(a=>"text"!==a.name).map(a=>a.name),attributes:{dir:{default:this.options.direction,parseHTML:a=>{let b=a.getAttribute("dir");return b&&("ltr"===b||"rtl"===b||"auto"===b)?b:this.options.direction},renderHTML:a=>a.dir?{dir:a.dir}:{}}}}]},addProseMirrorPlugins(){return[new f.k_({key:new f.hs("textDirection"),props:{attributes:()=>{let a=this.options.direction;return a?{dir:a}:{}}}})]}}),cd=class a{constructor(a,b,c=!1,d=null){this.currentNode=null,this.actualDepth=null,this.isBlock=c,this.resolvedPos=a,this.editor=b,this.currentNode=d}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var a;return null!=(a=this.actualDepth)?a:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(a){let b=this.from,c=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);b=this.from+1,c=this.to-1}this.editor.commands.insertContentAt({from:b,to:c},a)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(0===this.depth)return null;let b=this.resolvedPos.start(this.resolvedPos.depth-1);return new a(this.resolvedPos.doc.resolve(b),this.editor)}get before(){let b=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return b.depth!==this.depth&&(b=this.resolvedPos.doc.resolve(this.from-3)),new a(b,this.editor)}get after(){let b=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return b.depth!==this.depth&&(b=this.resolvedPos.doc.resolve(this.to+3)),new a(b,this.editor)}get children(){let b=[];return this.node.content.forEach((c,d)=>{let e=c.isBlock&&!c.isTextblock,f=c.isAtom&&!c.isText,g=c.isInline,h=this.pos+d+ +!f;if(h<0||h>this.resolvedPos.doc.nodeSize-2)return;let i=this.resolvedPos.doc.resolve(h);if(!e&&!g&&i.depth<=this.depth)return;let j=new a(i,this.editor,e,e||g?c:null);e&&(j.actualDepth=this.depth+1),b.push(j)}),b}get firstChild(){return this.children[0]||null}get lastChild(){let a=this.children;return a[a.length-1]||null}closest(a,b={}){let c=null,d=this.parent;for(;d&&!c;){if(d.node.type.name===a)if(Object.keys(b).length>0){let a=d.node.attrs,c=Object.keys(b);for(let d=0;d<c.length;d+=1){let e=c[d];if(a[e]!==b[e])break}}else c=d;d=d.parent}return c}querySelector(a,b={}){return this.querySelectorAll(a,b,!0)[0]||null}querySelectorAll(a,b={},c=!1){let d=[];if(!this.children||0===this.children.length)return d;let e=Object.keys(b);return this.children.forEach(f=>{(!c||!(d.length>0))&&(f.node.type.name===a&&e.every(a=>b[a]===f.node.attrs[a])&&d.push(f),c&&d.length>0||(d=d.concat(f.querySelectorAll(a,b,c))))}),d}setAttribute(a){let{tr:b}=this.editor.state;b.setNodeMarkup(this.from,void 0,{...this.node.attrs,...a}),this.editor.view.dispatch(b)}},ce=`.ProseMirror {
|
|
265
265
|
position: relative;
|
|
266
266
|
}
|
|
267
267
|
|