1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/skillDocMarkdown-DqTJqYW4.js","assets/entry-BCe1jibU.js","assets/index-Bbg-v3fd.css","assets/markdownPlugins-Ba1IUTy3.js","assets/___vite-browser-external_commonjs-proxy-ER1nOxK5.js","assets/index-BY9hT1n1.js","assets/index-CwQt3Ija.js","assets/index-CL4wfJ-C.js","assets/index-BlwpXAa2.js","assets/usePreprocessedMarkdown-I9Hgc9_R.js"])))=>i.map(i=>d[i]); 2import{r as u,j as n,b as M,v as S,n as Ce,w as Se,c as je,_ as Ne}from"./entry-BCe1jibU.js";import{e as _}from"./graphql-4Y3Cu4kt.js";import{av as Ie,aw as Le,ax as Te,ay as De}from"./operations-Dn0xY-u2.js";import{aW as J,aX as W,aY as Ue,m as z,z as P,aZ as Ae,a_ as Be,a$ as Fe,b0 as Z,b1 as _e,n as Ee,P as Re,b2 as $e,ai as Me,Q as ze,b3 as Pe,C as Oe,F as We,aD as qe,x as Ke,ab as He,b4 as Ge,a5 as ee,az as Ye,q as Ve,p as Qe,b5 as Xe,b6 as Je}from"./icons-B6i7AQrN.js";import{L as te}from"./loadingSpinner-CcuzCIpg.js";import{s as T}from"./toast-Blm9fZ-n.js";import{u as Ze}from"./useDetailDrawerResize-B0OyrTYs.js";import{r as et}from"./workspace-DuK6VJcz.js";import{S as se}from"./filesLocationIntent-CfWXdV4g.js";import{u as O}from"./filesUi-CmxDdKBk.js";import{u as ne,f as ae,g as le,h as oe,F as re,q as tt,r as ie,e as st,C as nt,D as at,E as lt,G as ot,j as rt,o as it,k as ct,s as ut,H as dt,B as D}from"./NativeButton-DgYgvC9L.js";import{o as h}from"./index-BTadJ-54.js";import{L as mt}from"./LindyAssistantIconV2-BiFcbjgm.js";import{C as ce}from"./ConfirmDialog-YvAQicdu.js";import{D as pt,a as ht,b as ft,c as gt,j as bt}from"./menu-bRNVZU59.js";import{D as xt,a as kt,b as yt,c as R}from"./DropdownMenu-Blck2ZPc.js";import{m as vt,o as g,r as y,a as b,c as A}from"./mobx.esm-B0_cIGIu.js";import{t as q}from"./bundle-mjs-CSqCgoPn.js";import"./Scrollable-BvCr7Sb1.js";import"./XMarkIcon-CqPeZFAz.js";import"./InformationCircleIcon-DCmSqGbl.js";import"./index-pNUg2pyP.js";import"./buttonStyles-DgzPUjES.js";import"./utils-DTwRz6Bg.js";import"./clsx-B-dksMZM.js";import"./index-DCFPOf8O.js";import"./index-Bnm1XHl9.js";import"./index-B7k7stR0.js";import"./ChevronIcon-BZD4A-JD.js";import"./index-D-697TjG.js";import"./index-CeqHvuZF.js";const wt=h(function({state:e}){const[s,a]=u.useState(""),l=e.listing?.viewerCanInstallToTeam??!1,[o,r]=u.useState(e.scope==="team"&&l?"team":"personal"),i=u.useRef(null),c=u.useCallback(()=>e.close(),[e]),{refs:d,context:m}=ne({open:!0,onOpenChange:c}),k=ae(m),j=le(m,{role:"dialog"}),{getFloatingProps:I}=oe([k,j]),f=s.trim(),N=f.length>0&&!se.test(f),w=e.skills.some(C=>C.installed&&C.tier===(o==="team"?"team":"user")&&C.name===f),p=f.length>0&&!N&&!w&&(o!=="team"||l),x=u.useCallback(C=>{a(C.target.value.toLowerCase())},[]),v=u.useCallback(C=>{r(C.target.checked?"team":"personal")},[]),F=u.useCallback(C=>{C.preventDefault(),p&&e.createInFiles(f,o)},[p,o,e,f]);return n.jsx(re,{children:n.jsx(tt,{lockScroll:!0,className:"fixed inset-0 z-modal-overlay bg-slate-4/80 backdrop-blur dark:bg-black/80",children:n.jsx(ie,{context:m,initialFocus:i,outsideElementsInert:!0,children:n.jsxs("form",{ref:d.setFloating,...I(),"aria-labelledby":"new-skill-title","aria-describedby":"new-skill-description",className:"fixed left-1/2 top-1/2 grid max-h-[85vh] w-full max-w-md -translate-x-1/2 -translate-y-1/2 grid-cols-[minmax(0,1fr)] grid-rows-[auto_1fr_auto] rounded-lg bg-white shadow-xl dark:bg-slate-1 max-sm:m-0 max-sm:h-dvh max-sm:max-h-none max-sm:w-screen max-sm:rounded-none",onSubmit:F,children:[n.jsxs("div",{className:"relative flex flex-col gap-y-1.5 p-5",children:[n.jsx("h2",{id:"new-skill-title",className:"text-sm font-medium text-slate-12",children:"New skill"}),n.jsx("button",{type:"button","aria-label":"Close",className:"absolute right-4 top-4 roun
2ded-md p-1 text-slate-11 transition hover:bg-slate-3 hover:text-slate-12 focus:outline-none focus:ring-2 focus:ring-primary-9",onClick:c,children:n.jsx(J,{className:"size-5"})})]}),n.jsx("div",{className:"min-h-0 min-w-0 overflow-y-auto p-5",children:n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("input",{ref:i,"aria-label":"Skill name",autoCapitalize:"none",value:s,placeholder:"skill-name (dash-case)",onChange:x,className:"block w-full appearance-none rounded-md border border-slate-4 bg-slate-1 p-3 text-sm leading-5 text-slate-12 transition hover:border-slate-8 focus-within:border-primary-9 focus-within:ring-1 focus-within:ring-primary-9 focus:outline-none dark:border-[0.5px] dark:border-white/[0.16] dark:!bg-transparent dark:ring-0 dark:hover:border-white/[0.16] dark:focus:border-white/[0.16] dark:focus:ring-0 dark:focus-visible:ring-1 dark:focus-visible:ring-white/[0.32] dark:focus-within:border-white/[0.16] dark:has-[:focus-visible]:ring-1 dark:has-[:focus-visible]:ring-white/[0.32]"}),l?n.jsxs("label",{className:"flex items-center gap-2 text-sm leading-4 text-slate-11",children:[n.jsx("input",{type:"checkbox",className:"size-4 shrink-0",checked:o==="team",onChange:v}),n.jsx("span",{children:"Create in the team folder"})]}):null,n.jsx("p",{id:"new-skill-description",className:"text-xs text-slate-10",children:N?'Use dash-case: lowercase letters, digits, dashes (e.g. "quarterly-report").':w?`You already have a ${o==="team"?"team":"personal"} skill named "${f}".`:"Opens the Files page with a starter SKILL.md ready to edit."})]})}),n.jsxs("div",{className:"flex items-center justify-end gap-x-2 px-5 py-4",children:[n.jsx("button",{type:"button",onClick:c,className:"h-8 rounded-full border-0 bg-black/[0.04] px-3 py-0 text-sm font-medium text-slate-12 hover:bg-black/[0.06] active:bg-black/[0.06] dark:bg-white/[0.05] dark:hover:bg-white/[0.07] dark:active:bg-white/[0.07]",children:"Cancel"}),n.jsx("button",{type:"submit",disabled:!p,className:"h-8 rounded-full border-0 bg-slate-12 px-4 text-sm font-medium text-slate-1 hover:bg-slate-11 active:bg-slate-10 disabled:pointer-events-none disabled:border-slate-4 disabled:bg-slate-4 disabled:text-slate-9",children:"Create"})]})]})})})})});function ue({src:t,darkSrc:e,compact:s=!1,onError:a}){return n.jsxs("div",{className:s?"w-20 shrink-0":"w-full shrink-0",children:[n.jsx("img",{src:t,alt:"",width:576,height:324,loading:"lazy",decoding:"async",className:`block aspect-video w-full object-contain ${e?"dark:hidden":""}`,onError:a}),e&&n.jsx("img",{src:e,alt:"",width:576,height:324,loading:"lazy",decoding:"async",className:"hidden aspect-video w-full object-contain dark:block",onError:a})]})}function Ct({example:t,compact:e=!1}){const[s,a]=u.useState(!1);function l(){a(!0)}return n.jsxs("article",{"aria-label":t.title,className:`group flex min-w-0 overflow-hidden rounded-xl bg-panel p-4 shadow-[0_1px_4px_rgba(0,0,0,0.08)] ring-[0.5px] ring-edge-strong transition-[background-color,box-shadow,opacity] duration-150 ease-out hover:bg-slate-2 hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)] hover:ring-edge-strong-hover active:bg-slate-2 active:shadow-[0_2px_6px_rgba(0,0,0,0.12)] active:ring-edge-strong-hover dark:bg-card dark:hover:bg-white/[0.08] dark:active:bg-white/[0.11] ${e?"flex-row items-start gap-4":"flex-col gap-8"}`,children:[n.jsx(ue,{src:t.logoUrl,darkSrc:t.logoUrlDark,compact:e}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[n.jsx("h4",{className:"truncate text-sm font-medium leading-5 text-slate-12",children:t.title}),n.jsx("p",{className:"line-clamp-2 min-h-10 text-sm leading-5 text-slate-11",children:t.description}),n.jsxs("div",{className:"mt-3 flex min-h-7 flex-wrap items-end justify-between gap-2",children:[n.jsx("span",{className:"text-xs leading-[18px] text-slate-11",children:"Built by Lindy"}),n.jsx("button",{"aria-label":`Add ${t.title}`,onClick:l,className:"h-7 rounded-full bg-slate-12 px-3 text-[13px] font-medium text-slate-1 opacity-100 transition-opacity sm:opacity-0 group-hover:opacity-100 focus-visible:opacity-100",children:"Add"})]}),s&&n.jsx("p",{role:"status",className:"mt-2 text-xs text-slate-11",children:"This skill is a preview and canât be added yet."})]})]})}function St(t,e){return t?"grid grid-cols-1 gap-3":e?"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4":"-m-2 flex snap-x snap-mandatory scroll-p-2 gap-3 overflow-x-auto scroll-smooth p-2 scrollbar-none motion-reduce:scroll-auto"}function jt(t,e){return t||e?"min-w-0 [&>*]:w-full":"flex w-[85%] shrink-0 snap-start sm:w-72 [&>*]:w-full"}function Nt(t){return{left:t.scrollLeft>1,right:t.scrollLeft+t.clientWidth<t.scrollWidth-1}}function It(t,e){return t.left===e.left&&t.right===e.right}function Lt({edges:t,id:e,onNext:s,onPrevious:a,title:l}){return!t.left&&!t.right?null:n.jsxs("div",{className:"ml-auto flex shrink-0 gap-1",children:[n.jsx("button",{"aria-label":`Previous ${l}`,"aria-controls":e,disabled:!t.left,onClick:a,className:"flex size-8 items-center justify-center rounded-full text-slate-11 focus-visible:outline focus-visible:outline-2 disabled:opacity-30 hover:bg-slate-3",children:n.jsx(W,{className:"size-4 rotate-180"})}),n.jsx("button",{"aria-label":`Next ${l}`,"aria-controls":e,disabled:!t.right,onClick:s,className:"flex size-8 items-center justify-center rounded-full text-slate-11 focus-visible:outline focus-visible:outline-2 disabled:opacity-30 hover:bg-slate-3",children:n.jsx(W,{className:"size-4"})})]})}function Tt({edges:t,id:e,onNext:s,onPrevious:a,onTabClick:l,onTabKey:o,tabs:r,title:i}){return n.jsxs("div",{className:"mb-4 flex min-h-8 items-center justify-between gap-3",children:[r?n.jsx("div",{role:"tablist","aria-label":"Skill use cases",className:"flex min-w-0 items-center gap-3 overflow-x-auto scrollbar-none sm:gap-5",children:r.map((c,d)=>n.jsx("button",{id:`${e}-tab-${d}`,role:"tab","aria-selected":c===i,"aria-controls":`${e}-panel`,tabIndex:c===i?0:-1,value:c,onClick:l,onKeyDown:o,className:`shrink-0 text-sm font-medium text-slate-12 focus-visible:outline focus-visible:outline-2 sm:text-base ${c===i?"opacity-100":"opacity-50"}`,children:c.replace(/ skills$/,"")},c))}):n.jsx("h3",{className:"text-base font-medium text-slate-12",children:i}),n.jsx(Lt,{edges:t,id:e,onNext:s,onPrevious:a,title:i})]})}function Dt({edges:t}){return n.jsxs(n.Fragment,{children:[t.left&&n.jsx("div",{"aria-hidden":"true","data-testid":"skill-fade-left",className:"pointer-events-none absolute -inset-y-2 -left-2 w-16 bg-gradient-to-r from-canvas to-transparent"}),t.right&&n.jsx("div",{"aria-hidden":"true","data-testid":"skill-fade-right",className:"pointer-events-none absolute -inset-y-2 -right-2 w-20 bg-gradient-to-l from-canvas to-transparent"})]})}function Ut({title:t,children:e,wrap:s=!1,tabs:a,onTabChange:l,list:o=!1}){const r=u.useRef(null),i=u.useId(),c=u.Children.toArray(e),[d,m]=u.useState({left:!1,right:!1}),k=u.useCallback(()=>{const p=r.current;
2if(!p)return;const x=o||s?{left:!1,right:!1}:Nt(p);m(v=>It(v,x)?v:x)},[o,s]);u.useEffect(()=>{const p=r.current;if(!p)return;k(),p.addEventListener("scroll",k,{passive:!0});const x=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return x?.observe(p),()=>{p.removeEventListener("scroll",k),x?.disconnect()}},[c.length,t,k]);function j(p){if(!a)return;const x=a.indexOf(t),v=p.key==="ArrowRight"?(x+1)%a.length:p.key==="ArrowLeft"?(x+a.length-1)%a.length:p.key==="Home"?0:p.key==="End"?a.length-1:-1;if(v<0)return;p.preventDefault(),p.currentTarget.parentElement?.querySelectorAll('[role="tab"]')?.[v]?.focus(),l?.(a[v])}function I(p){l?.(p.currentTarget.value)}function f(p){const x=r.current,v=x?.firstElementChild;x&&v&&x.scrollBy({left:p*(v.clientWidth+12)})}function N(){f(-1)}function w(){f(1)}return n.jsxs("section",{"aria-label":t,className:"min-w-0",children:[n.jsx(Tt,{edges:d,id:i,onNext:w,onPrevious:N,onTabClick:I,onTabKey:j,tabs:a,title:t}),n.jsxs("div",{className:"relative min-w-0",role:a?"tabpanel":void 0,id:`${i}-panel`,"aria-labelledby":a?`${i}-tab-${a.indexOf(t)}`:void 0,children:[n.jsx("div",{ref:r,id:i,tabIndex:0,"aria-label":`${t} cards`,className:St(o,s),children:u.Children.map(c,p=>n.jsx("div",{className:jt(o,s),children:p}))},t),n.jsx(Dt,{edges:d})]})]})}const de={"abstract-api":"Connect your Abstract API account to validate emails, phone numbers, and other business data.",actionstep:"Connect your Actionstep account to manage legal matters, contacts, tasks, documents, and billing.",activecampaign:"Connect your ActiveCampaign account to manage contacts, tags, deals, and campaigns.",aftership:"Connect your AfterShip account to track shipments and flag delivery exceptions.",airtable:"Connect your Airtable account to read and update shared trackers and databases.","amadeus-self-service":"Connect your Amadeus account to search flights and hotels.",apollo:"Connect your Apollo account to find, enrich, and manage sales prospects.",asana:"Connect your Asana account to create and manage projects, tasks, and assignments.",assemblyai:"Connect your AssemblyAI account to transcribe audio and generate captions and chapters.",attio:"Connect your Attio account to manage people, companies, deals, and tasks.",bannerbear:"Connect your Bannerbear account to generate on-brand graphics from templates.",bigcommerce:"Connect your BigCommerce account to review orders and create shipments.","bland-ai":"Connect your Bland account to make, receive, and review calls.",brevo:"Connect your Brevo account to manage contacts and send email and SMS campaigns.","browser-use-cloud":"Connect your Browser Use Cloud account to run browser tasks on sites without APIs.",browserbase:"Connect your Browserbase account to run managed browser sessions for repetitive web work.","cal-com":"Connect your Cal.com account to create booking links and manage bookings.",calendly:"Connect your Calendly account to read scheduling events and coordinate follow-ups.",chargebee:"Connect your Chargebee account to look up customers and subscriptions.",clickup:"Connect your ClickUp account to turn requests into tasks and update their status.",clio:"Connect your Clio account to manage legal matters, contacts, tasks, documents, and billing.","close-crm":"Connect your Close account to manage leads and log calls and follow-ups.",cloudinary:"Connect your Cloudinary account to store, transform, and deliver media assets.",coda:"Connect your Coda account to update docs and tables.",contentful:"Connect your Contentful account to draft and update structured content.",creatomate:"Connect your Creatomate account to render templated social videos.",customerio:"Connect your Customer.io account to update customer attributes and trigger messages.",datadog:"Connect your Datadog account to inspect monitors, metrics, and incident signals.",dataforseo:"Connect your DataForSEO account to research keywords, rankings, and competitors.",easypost:"Connect your EasyPost account to inspect shipments and buy shipping labels.",elevenlabs:"Connect your ElevenLabs account to generate narration, dubbing, and synthetic voice audio.","fal-ai":"Connect your fal.ai account to run image, video, audio, and 3D generation models.",filevine:"Connect your Filevine account to manage legal projects, contacts, tasks, and case data.",firecrawl:"Connect your Firecrawl account to extract structured content from websites.","follow-up-boss":"Connect your Follow Up Boss account to manage real-estate leads, notes, and events.",formstack:"Connect your Formstack account to create forms and retrieve submissions.","foursquare-places":"Connect your Foursquare account to search venues and enrich local-business research.",freshdesk:"Connect your Freshdesk account to triage tickets and send support replies.",front:"Connect your Front account to review shared-inbox conversations and send replies.",heygen:"Connect your HeyGen account to produce avatar-presenter and translated videos.",highlevel:"Connect your HighLevel account to manage contacts, pipelines, and appointments.",hubspot:"Connect your HubSpot account to enrich CRM records and manage follow-ups.",hunter:"Connect your Hunter account to find and verify professional email addresses.",instantly:"
2Connect your Instantly account to review outreach campaigns and leads.",intercom:"Connect your Intercom account to search conversations and send replies.","jira-cloud":"Connect your Jira account to create and track project tickets.",jotform:"Connect your Jotform account to build forms and process submissions.","judge-me":"Connect your Judge.me account to read and manage product reviews.",kickbox:"Connect your Kickbox account to validate email lists before outreach.",klaviyo:"Connect your Klaviyo account to update profiles and trigger marketing flows.",lawmatics:"Connect your Lawmatics account to manage prospects and intake activity.",linear:"Connect your Linear account to create and update issues.",litify:"Connect your Litify account to manage legal matters on your Salesforce org.",lob:"Connect your Lob account to verify addresses and send physical mail.",lofty:"Connect your Lofty account to view and update real-estate leads.","loop-returns":"Connect your Loop Returns account to review and process returns, exchanges, and refunds.",loops:"Connect your Loops account to add users to lifecycle email sequences.",loyaltylion:"Connect your LoyaltyLion account to review customer points and redeem rewards.","luma-agents":"Connect your Luma account to generate and orchestrate image and video jobs.",mailchimp:"Connect your Mailchimp account to sync audiences, tags, and campaigns.",monday:"Connect your monday.com account to manage team workboards and pipelines.",neverbounce:"Connect your NeverBounce account to clean email lists and reduce bounces.","open-to-close":"Connect your Open To Close account to track transactions and add notes.",pandadoc:"Connect your PandaDoc account to create proposals from templates and track status.",paypal:"Connect your PayPal account to inspect payments and issue refunds.","pdf-co":"Connect your PDF.co account to convert, merge, OCR, and split documents.",pdfmonkey:"Connect your PDFMonkey account to render reports and invoices as PDFs.",pipedrive:"Connect your Pipedrive account to create deals and view pipeline summaries.",placid:"Connect your Placid account to generate image, video, and PDF variants from templates.",posthog:"Connect your PostHog account to answer product questions and manage insights and flags.",recharge:"Connect your Recharge account to review and update subscriptions.",rentcast:"Connect your RentCast account to research properties, rents, and market values.",replicate:"Connect your Replicate account to run AI models and retrieve predictions.","retell-ai":"Connect your Retell AI account to operate and review AI voice-agent calls.",runway:"Connect your Runway account to generate campaign video clips and b-roll.",sentry:"Connect your Sentry account to inspect issues, projects, and error trends.",serpapi:"Connect your SerpApi account to collect maps, shopping, and search results.",shipbob:"Connect your ShipBob account to review fulfillment orders and create shipments.",shippo:"Connect your Shippo account to inspect shipments and buy shipping labels.","shipstation-shipengine":"Connect your ShipStation account to list carriers and buy shipping labels.",shopify:"Connect your Shopify account to inspect and update your product catalog.",shotstack:"Connect your Shotstack account to assemble video, image, and audio timelines.","sierra-interactive":"Connect your Sierra Interactive account to manage real-estate leads and activities.",smartlead:"Connect your Smartlead account to review outreach campaigns, leads, and replies.",smartsheet:"Connect your Smartsheet account to maintain sheets and status reports.",smarty:"Connect your Smarty account to validate and standardize customer addresses.",snowflake:"Connect your Snowflake account and run SQL with the native Execute SQL action.",square:"Connect your Square account to inspect payments and issue refunds.",stripe:"Connect your Stripe account to inspect payments and capture manual charges.",teamwork:"Connect your Teamwork account to create project tasks and notify owners.",telnyx:"Connect your Telnyx account to send messages and manage calls and verification.",todoist:"Connect your Todoist account to capture follow-ups and scheduled tasks.",trello:"Connect your Trello account to create cards and checklists for handoffs.",twilio:"Connect your Twilio account to send SMS or WhatsApp messages and manage calls.",typeform:"Connect your Typeform account to create forms and route submissions.",vapi:"Connect your Vapi account to configure voice assistants and place calls.","walk-score":"Connect your Walk Score account to add walk, transit, and bike scores to a property brief.",webflow:"Connect your Webflow account to create and update website CMS content.",woocommerce:"Connect your WooCommerce account to review orders and issue refunds.",yotpo:"Connect your Yotpo account to read reviews and product-content data.",zendesk:"Connect your Zendesk account to triage and update support tickets."},B="All skills";function At(t){const e=new Map,s=[];for(const l of t){const o=l.category?.trim();if(!o){s.push(l);continue}const r=e.get(o);r?r.push(l):e.set(o,[l])}return[...[...e.entries()].sort(([l],[o])=>l.localeCompare(o)).map(([l,o])=>({label:l,skills:o})),{label:B,skills:s}].filter(l=>l.skills.length>0)}function K(t,e,s){return s.startsWith("https://")||s.startsWith("/")?s:`${t}/api/system-skills/${encodeURIComponent(e)}/${s}`}const Bt="Your skills",Ft="Built-in skills",_t="Included with Lindy and always on.";function Et(t){return[{label:Bt,skills:t.filter(e=>!e.builtin)},{label:Ft,note:_t,skills:t.filter(e=>e.builtin)}].filter(e=>e.skills.length>0)}function U(t,e){return`${e}:${t}`}const Rt="personal",$t=new Set(["ai","api","crm","csv","html","llm","pdf","seo","sms","sql","ui","url"]);function me(t,e){const s=e?.trim();return s||t.split("-").map(a=>$t.has(a)?a.toUpperCase():a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function pe(t){const{name:e}=t,s=t.illustrationLight?.trim(),a=t.illustrationDark?.trim();return!s||!a?null:{light:K(M.apiOrigin,e,s),dark:K(M.apiOrigin,e,a)}}function Mt(t){return t==="user"||t==="team"||t==="system"?t:"user"}function he(t){return`${M.apiOrigin}/api/system-skills/${encodeURIComponent(t)}/logo.png`}function zt(t,e,s){if(s!=="system")return t[U(e,s)]}function Pt(t,e){return e?{category:t.category,description:de[t.name]??t.description,logoUrl:he(t.name)}:{category:null,description:t.description,logoUrl:null}}function Ot(t,e,s){return t&&e===s}function Wt(t,e,s,a){const l=Mt(t.tier);if(zt(a,t.name,l)?.installed===!1)return null;const r=e.has(t.name);if(l==="system"&&r)return null;const i=l==="system",c=Pt(t,i);return{name:t.name,title:me(t.name,t.displayName),description:c.description,userDescription:t.userDescription,category:c.category,illustration:pe(t),logoUrl:c.logoUrl,tier:l,installed:!0,builtin:i,inMarket:r,discoverRepresentative:Ot(r,s.get(t.name),l),disabled:t.status!=="enabled"}}function qt(t,e){return t[U(e,"user")]?.installed===!0?"user":t[U(e,"team")]?.installed===!0?"team":null}function Kt(t,e){return{name:t.name,title:me(t.name,t.displayName),description:de[t.name]??t.description,userDescription:t.userDescription,category:t.category,illustration:pe(t),logoUrl:he(t.name),tier:e,installed:e!=null,builtin:!1,inMarket:!0,discoverRepresentative:!0,disabled:!1}}function Ht(t){return t.category==="Built-in"&&t.userDescription!=null}function Gt(t,e){const s=new Set(t.marketplace.map(r=>r.name)),a=new Map(t.resolvedInstalled.map(r=>[r.name,r.tier])),l=[];for(const r of t.installed){const i=Wt(r,s,a,e);i&&l.push(i)}const o=new Set(l.map(r=>r.name));for(const r of t.marketplace)o.has(r.name)||l.push(Kt(r,qt(e,r.name)));return l}function Yt(t){return t.some(e=>e.installed&&!e.builtin)?"personal":"all"}function Vt(t){return t.installed?t.tier==="system"?!t.disabled&&Ht(t):t.tier==="user":!1}function fe(t,e){switch(e){case"personal":return Vt(t);case"team":return t.installed&&t.tier==="team";default:return t.discoverRepresentative}}function Qt(t,e){return e?`${t.title} ${t.name} ${t.description}`.toLowerCase().includes(e):!0}function Xt(t,e){switch(e){case"installed":return t.installed;case"builtin":return t.builtin;case"notinstalled":case"all":return!t.installed;default:return!0}}function Jt(t){return t==="personal"?"Personal":t==="team"?"Team":"Marketplace"}function Zt(t,e){return t==="all"?At(e):t==="personal"?Et(e):[{label:null,skills:e}]}function es(t,e){const s=Jt(t),a=t==="all"?e:"all",l=a==="installed"?"installed":a==="notinstalled"?"not installed":a==="builtin"?"built-in":null;return l?`${s} · ${l}`:`${s} skills`}function ts(t){const{skills:e,scope:s,statusFilter:a}=t,l=t.search.trim().toLowerCase(),o=s==="all",r=e.filter(i=>fe(i,s)&&Qt(i,l)&&(!o||Xt(i,a))).sort((i,c)=>Number(c.installed)-Number(i.installed));return{sections:Zt(s,r),resultCount:r.length,activeCount:new Set(e.filter(i=>i.installed&&!i.builtin&&!i.disabled).map(i=>i.name)).size,availableCount:e.filter(i=>i.inMarket&&!i.installed).length,statusOptions:[{label:"Available",value:"all"},{label:"Installed",value:"installed"},{label:"Built-in",value:"builtin"}],resultLabel:es(s,a)}}function E(t,e){return!t.installed||t.builtin?!1:t.tier!=="team"||e}const ss=h(function({state:e}){const[s,a]=u.useState(!1),[l,o]=u.useState(null),r=u.useRef([]),i=u.useRef([]),c=e.view.statusOptions,d=c.findIndex(L=>L.value===e.statusFilter),m=`Filter skills: ${c[d]?.label??"Show all"}`,k=e.statusFilter!=="all",{refs:j,floatingStyles:I,context:f}=ne({open:s,onOpenChange:a,placement:"bottom-end",transform:!1,middleware:[it(6),ct(),ut({padding:8})],whileElementsMounted:rt}),N=st(f),{isMounted:w}=nt(f,{duration:200}),p=ae(f),x=le(f,{role:"menu"}),v=at(f,{listRef:r,activeIndex:l,onNavigate:o,loop:!0}),F=lt(f,{listRef:i,activeIndex:l,onMatch:o,enabled:s}),{getReferenceProps:C,getFloatingProps:ye,getItemProps:ve}=oe([N,p,x,v,F]),we=u.useCallback(L=>{e.setStatusFilter(L),a(!1)},[e]);return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:j.setReference,type:"button","aria-label":m,title:m,"data-testid":"skills-status-filter",className:`relative flex size-8 shrink-0 items-center justify-center rounded-xl border-0 bg-black/[0.04] text-slate-12 outline-none transition-[background-color,opacity] duration-150 ease-out hover:bg-black/[0.06] hover:opacity-100 focus-visible:ring-2 focus-visible:ring-primary-8 aria-expanded:bg-black/[0.06] dark:bg-white/[0.05] dark:hover:bg-white/[0.07] dark:aria-expanded:bg-white/[0.07] ${k?"opacity-100":"opacity-50"}`,...C(),children:[n.jsx(Ue,{className:"size-4"}),k?n.jsx("span",{"data-testid":"skills-filter-active",className:"absolute right-0.5 top-0.5 size-1.5 rounded-full bg-primary-9"}):null]}
2),w?n.jsx(re,{children:n.jsx(ie,{context:f,initialFocus:j.floating,outsideElementsInert:!0,children:n.jsx("div",{ref:j.setFloating,style:I,"data-state":s?"open":"closed",className:"z-modal-overlay-tooltips mt-1 flex max-h-96 w-44 origin-top flex-col gap-y-1 overflow-auto rounded-[10px] border-[0.5px] border-black/[0.12] bg-white p-1 shadow-[0_3px_6px_rgba(0,0,0,0.1),0_0.5px_1px_rgba(0,0,0,0.1)] outline-none data-[state=closed]:pointer-events-none data-[state=closed]:animate-popover-out data-[state=open]:animate-popover-in motion-reduce:animate-none dark:border-white/[0.12] dark:bg-card",...ye(),children:n.jsx(ot,{elementsRef:r,labelsRef:i,children:c.map(L=>n.jsx(ns,{option:L,selected:e.statusFilter===L.value,activeIndex:l,onSelect:we,getItemProps:ve},L.value))})})})}):null]})});function ns({option:t,selected:e,activeIndex:s,onSelect:a,getItemProps:l}){const{ref:o,index:r}=dt({label:t.label}),i=u.useCallback(()=>a(t.value),[a,t.value]);return n.jsxs("button",{ref:o,type:"button",role:"menuitem",tabIndex:s===r?0:-1,className:"group flex w-full shrink-0 cursor-pointer select-none items-center justify-between gap-x-3 rounded-md px-1.5 py-2 text-sm font-medium truncate text-slate-12 outline-none transition hover:bg-slate-3 focus:bg-slate-3 dark:hover:bg-white/[0.08]",...l({onClick:i}),children:[t.label,e?n.jsx(z,{className:"size-4 shrink-0 text-primary-9"}):null]})}const H=[{label:"Marketing skills",examples:[{title:"Content repurposing",description:"Turn one great idea into posts for every channel.",logoUrl:"/skill-icons/meeting-follow-up-soft-transparent.png",logoUrlDark:"/skill-icons/meeting-follow-up-dark-transparent.png"},{title:"Campaign brief",description:"Turn a campaign goal into a brief your team can run with.",logoUrl:"/skill-icons/inbox-brief-soft-transparent.png",logoUrlDark:"/skill-icons/inbox-brief-dark-transparent.png"},{title:"SEO content outline",description:"Turn a target keyword into a clear writing plan.",logoUrl:"/skill-icons/customer-research-soft-transparent.png",logoUrlDark:"/skill-icons/customer-research-dark-transparent.png"},{title:"Newsletter draft",description:"Turn your latest updates into a newsletter worth opening.",logoUrl:"/skill-icons/meeting-follow-up-soft-transparent.png",logoUrlDark:"/skill-icons/meeting-follow-up-dark-transparent.png"},{title:"Content calendar",description:"Plan a month of content around your next launch.",logoUrl:"/skill-icons/weekly-planning-soft-transparent.png",logoUrlDark:"/skill-icons/weekly-planning-dark-transparent.png"}]},{label:"GTM skills",examples:[{title:"Account research",description:"Find the context that makes your next pitch relevant.",logoUrl:"/skill-icons/customer-research-soft-transparent.png",logoUrlDark:"/skill-icons/customer-research-dark-transparent.png"},{title:"Personalized outreach",description:"Draft an opening message that speaks to each prospect.",logoUrl:"/skill-icons/meeting-follow-up-soft-transparent.png",logoUrlDark:"/skill-icons/meeting-follow-up-dark-transparent.png"},{title:"Call prep",description:"Walk into every sales call with a focused account brief.",logoUrl:"/skill-icons/inbox-brief-soft-transparent.png",logoUrlDark:"/skill-icons/inbox-brief-dark-transparent.png"},{title:"Pipeline review",description:"Spot stalled deals and decide what to move forward.",logoUrl:"/skill-icons/workflow-refresh-soft-transparent.png",logoUrlDark:"/skill-icons/workflow-refresh-dark-transparent.png"},{title:"Deal follow-up",description:"Turn sales conversations into timely next steps.",logoUrl:"/skill-icons/meeting-follow-up-soft-transparent.png",logoUrlDark:"/skill-icons/meeting-follow-up-dark-transparent.png"},{title:"Competitor brief",description:"See how competitors position themselves before your next pitch.",logoUrl:"/skill-icons/customer-research-soft-transparent.png",logoUrlDark:"/skill-icons/customer-research-dark-transparent.png"},{title:"Weekly sales digest",description:"Bring wins, risks, and next steps into one weekly update.",logoUrl:"/skill-icons/weekly-planning-soft-transparent.png",logoUrlDark:"/skill-icons/weekly-planning-dark-trans
2parent.png"}]},{label:"Meeting skills",examples:[{title:"Meeting follow-up",description:"Turn meeting notes into recaps and ready-to-send follow-ups.",logoUrl:"/skill-icons/meeting-follow-up-soft-transparent.png",logoUrlDark:"/skill-icons/meeting-follow-up-dark-transparent.png"},{title:"Action item tracker",description:"Pull owners and next steps out of every meeting.",logoUrl:"/skill-icons/workflow-refresh-soft-transparent.png",logoUrlDark:"/skill-icons/workflow-refresh-dark-transparent.png"}]},{label:"Productivity skills",examples:[{title:"Weekly planning",description:"Turn a busy week into a clear plan.",logoUrl:"/skill-icons/weekly-planning-soft-transparent.png",logoUrlDark:"/skill-icons/weekly-planning-dark-transparent.png"},{title:"Inbox brief",description:"Turn a busy inbox into a short list of what needs you.",logoUrl:"/skill-icons/inbox-brief-soft-transparent.png",logoUrlDark:"/skill-icons/inbox-brief-dark-transparent.png"},{title:"Daily priorities",description:"Start each morning with the three things that matter most.",logoUrl:"/skill-icons/daily-meeting-highlights-soft-transparent.png",logoUrlDark:"/skill-icons/daily-meeting-highlights-dark-transparent.png"}]}];function as(t,e){if(e===void 0)return t.map(a=>({...a,examples:[]}));const s=e.trim().toLowerCase();return[...H.map(({label:a,examples:l})=>({label:a,skills:t.find(o=>o.label===a)?.skills??[],examples:l.filter(o=>`${o.title} ${o.description}`.toLowerCase().includes(s))})),...t.filter(a=>!H.some(({label:l})=>l===a.label)).map(a=>({...a,examples:[]}))].filter(a=>a.skills.length>0||a.examples.length>0)}const ls=3e4,$="Installing the skill took too long",os=[{label:"Personal",value:"personal"},{label:"Workspace",value:"team"},{label:"Discover",value:"all"}];function ge(t){return`${t} ${t===1?"skill":"skills"}`}function rs(t,e){if(e==="team"&&t.installed&&t.tier==="user")return"user"}function is(t){return t.tier==="team"?"team":"user"}function cs(t,e,s,a){if(s)return`Added ${t.title} to workspace`;const l=a?"Reinstalled":"Installed",o=e==="team"?"your team":"you";return`${l} ${t.title} for ${o}`}function us(t,e,s,a,l){t&&T({level:"success",label:cs(e,s,a,l),message:a?"Everyone in this workspace can use it now":"Your assistant can use it now"})}function G(t,e){t&&T({level:"danger",label:e})}function ds(t,e){t&&T({level:"success",label:`Removed ${e.title}`,message:e.inMarket?"Reinstall it from the marketplace anytime.":"The folder is removed from your files."})}function ms(t,e){return t.selectedName===e.name&&t.selectedTier===e.tier}function ps(t,e){return!t.builtin&&!e}function hs(t,e){return!t.builtin&&t.installed&&!e}function Y(t,e){return t===e?"success":"danger"}function fs(t,e){return t===e?`Added ${ge(t)} to workspace`:`Added ${t} of ${e} skills to workspace`}function gs(t,e){return t===e?`Everyone in this workspace can use ${t===1?"it":"them"} now.`:`${e-t} could not be added. Try again.`}function bs(t,e){return t===e?`Removed ${ge(t)}`:`Removed ${t} of ${e} skills`}function xs(t,e){return t===e?`${t===1?"Its folder was":"Their folders were"} removed from your files.`:`${e-t} could not be removed. Try again.`}async function V(t,e){const s=[];for(const a of t)s.push(await e(a));return s}const ks=u.lazy(()=>Ne(async()=>{const{SkillDocMarkdown:t}=await import("./skillDocMarkdown-DqTJqYW4.js");return{SkillDocMarkdown:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(({SkillDocMarkdown:t})=>({default:t}))),Q=n.jsx("div",{className:"flex justify-center py-10",children:n.jsx(te,{label:"Loading instructions"})});class ys extends u.Component{state={failed:!1};reload=()=>window.location.reload();static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){je(e)}render(){return this.state.failed?n.jsxs("div",{role:"alert",className:"text-sm text-red-9",children:[n.jsx("p",{children:"Instructions did not load."}),n.jsx("button",{type:"button",onClick:this.reload,className:"mt-2 underline",children:"Refresh"})]}):this.props.children}}class vs{status="loading";listing=null;overrides={};scope=Rt;search="";statusFilter="all";selectedName=null;selectedTier=null;document=null;documentMarkdown=null;documentStatus="idle";uninstallTarget=null;bulkUninstallTargets=null;selectionMode=!1;selectedNames=new Set;isBulkBusy=!1;creating=!1;busyNames=new Set;docRequestId=0;workspaceUrl=null;constructor(){vt(this,{navigateToFiles:!0,busyNames:g,selectedNames:g,docRequestId:!1,workspaceUrl:!1,loadDocument:!1,installOne:!1,pruneSelection:!1,reconcile:!1,rollback:!1,uninstallOne:!1,isBusy:!1,status:g.ref,listing:g.ref,overrides:g.ref,scope:g.ref,search:g.ref,statusFilter:g.ref,selectedName:g.ref,selectedTier:g.ref,document:g.ref,documentMarkdown:g.ref,documentStatus:g.ref,uninstallTarget:g.ref,bulkUninstallTargets:g.ref,selectionMode:g.ref,isBulkBusy:g.ref,creating:g.ref,skills:A,view:A,selectableSkills:A,selectedSkills:A,selectedSkill:A,load:b,
2setScope:b,setSearch:b,setStatusFilter:b,startSelection:b,exitSelection:b,toggleSelection:b,open:b,close:b,install:b,bulkAddToWorkspace:b,uninstall:b,bulkUninstall:b,requestUninstall:b,requestBulkUninstall:b,startCreating:b,createInFiles:b,editInFiles:b})}get skills(){return this.listing?Gt(this.listing,this.overrides):[]}get view(){return ts({skills:this.skills,scope:this.scope,search:this.search,statusFilter:this.statusFilter})}get selectedSkill(){return this.selectedName?this.skills.find(e=>e.name===this.selectedName&&(this.selectedTier===null||e.tier===this.selectedTier)&&fe(e,this.scope))??null:null}get selectableSkills(){return this.view.sections.flatMap(e=>e.skills).filter(e=>e.tier==="user")}get selectedSkills(){return this.selectableSkills.filter(e=>this.selectedNames.has(e.name))}async load(){const e=this.status!=="ready";this.status!=="ready"&&(this.status="loading");try{const s=await et();this.workspaceUrl=s?.url??null;const a=await _(Ie,{workspaceUrl:this.workspaceUrl});y(()=>{this.listing=a.assistantSkills,this.reconcile(),e&&(this.scope=Yt(this.skills)),this.pruneSelection(),this.status="ready"})}catch{y(()=>{this.status="error"})}}reconcile(){const e=this.listing?.installed??[];let s=!1;const a={};for(const[l,o]of Object.entries(this.overrides)){const r=l.slice(l.indexOf(":")+1),i=e.some(d=>d.name===r&&d.tier===o.tier);if(o.installed?i:!i){s=!0;continue}a[l]=o}s&&(this.overrides=a)}setScope(e){this.close(),this.exitSelection(),this.scope=e}setSearch(e){this.search=e,this.pruneSelection()}setStatusFilter(e){this.statusFilter=e,this.pruneSelection()}startSelection(){this.scope!=="personal"||this.selectableSkills.length===0||(this.close(),this.selectedNames.clear(),this.selectionMode=!0)}exitSelection(){this.selectionMode=!1,this.selectedNames.clear(),this.bulkUninstallTargets=null}toggleSelection(e){!this.selectionMode||this.isBulkBusy||e.tier!=="user"||(this.selectedNames.has(e.name)?this.selectedNames.delete(e.name):this.selectedNames.add(e.name))}pruneSelection(){const e=new Set(this.selectableSkills.map(s=>s.name));for(const s of this.selectedNames)e.has(s)||this.selectedNames.delete(s)}open(e){this.creating=!1,this.selectedName=e.name,this.selectedTier=e.tier,this.document=null,this.documentMarkdown=null;const s=++this.docRequestId;this.documentStatus="loading";const a=this.listing?.installed.find(l=>l.name===e.name&&l.tier===e.tier)?.tier??"system";S(this.loadDocument(e.name,a,s))}close(){this.docRequestId++,this.creating=!1,this.selectedName=null,this.selectedTier=null,this.document=null,this.documentMarkdown=null,this.documentStatus="idle"}async loadDocument(e,s,a){try{const l=await _(Le,{name:e,tier:s,workspaceUrl:this.workspaceUrl});y(()=>{this.docRequestId===a&&(this.documentMarkdown=l.assistantSkillDocument?.markdown??null,this.document=l.assistantSkillDocument?l.assistantSkillDocument.markdown:null,this.documentStatus="ready")})}catch{y(()=>{this.docRequestId===a&&(this.documentStatus="error")})}}isBusy(e){return this.busyNames.has(e)}async installOne(e,s,a){if(!ps(e,this.busyNames.has(e.name)))return!1;const l=rs(e,s),o=new AbortController;this.busyNames.add(e.name);let r;try{const i=await Promise.race([_(Te,{input:{name:e.name,scope:s,sourceScope:l,workspaceUrl:this.workspaceUrl}},{signal:o.signal}),new Promise((d,m)=>{r=setTimeout(()=>{o.abort(),m(new Error($))},ls)})]);if(i.installAssistantSkill.__typename!=="MutationInstallAssistantSkillSuccess")throw new Error(i.installAssistantSkill.message);const c=i.installAssistantSkill.data;return y(()=>{this.overrides={...this.overrides,[U(e.name,s)]:{installed:!0,tier:s}}}),us(a,e,s,l==="user",c.replaced),!0}catch(i){return this.rollback(e.name,s),a&&i instanceof Error&&i.message===$?T({durationMs:5e3,level:"danger",label:$,message:"Try again."}):G(a,i instanceof Error?i.message:"Installing the skill failed"),!1}finally{r!==void 0&&clearTimeout(r),y(()=>this.busyNames.delete(e.name))}}async install(e,s){const a=s==="team"&&e.installed&&e.tier==="user";(await this.installOne(e,s,!0)||a)&&await this.load()}async bulkAddToWorkspace(){const e=this.selectedSkills;if(this.listing?.viewerCanInstallToTeam&&e.length!==0&&!this.isBulkBusy){this.isBulkBusy=!0;try{const s=await V(e,o=>this.installOne(o,"team",!1)),a=e.filter((o,r)=>!s[r]),l=e.length-a.length;T({level:Y(l,e.length),label:fs(l,e.length),message:gs(l,e.length)}),await this.load(),y(()=>{this.selectedNames.clear(),a.forEach(o=>this.selectedNames.add(o.name)),a.length===0&&(this.selectionMode=!1)})}finally{y(()=>{this.isBulkBusy=!1})}}}requestUninstall(e){this.uninstallTarget=e}requestBulkUninstall(e){this.bulkUninstallTargets=e}async uninstallOne(e,s){if(!hs(e,this.busyNames.has(e.name)))return!1;const a=is(e);this.busyNames.add(e.name),y(()=>{this.overrides={...this.overrides,[U(e.name,a)]:{installed:!1,tier:a}}});
2try{const l=await _(De,{input:{name:e.name,scope:a,workspaceUrl:this.workspaceUrl}});if(l.uninstallAssistantSkill.__typename!=="MutationUninstallAssistantSkillSuccess")throw new Error(l.uninstallAssistantSkill.message);return ds(s,e),y(()=>{ms(this,e)&&this.close()}),!0}catch(l){return this.rollback(e.name,a),G(s,l instanceof Error?l.message:"Removing the skill failed"),!1}finally{y(()=>this.busyNames.delete(e.name))}}async uninstall(e){this.uninstallTarget=null,await this.uninstallOne(e,!0)&&await this.load()}async bulkUninstall(){const e=this.bulkUninstallTargets??[];if(!(e.length===0||this.isBulkBusy)){this.bulkUninstallTargets=null,this.isBulkBusy=!0;try{const s=await V(e,o=>this.uninstallOne(o,!1)),a=e.filter((o,r)=>!s[r]),l=e.length-a.length;T({level:Y(l,e.length),label:bs(l,e.length),message:xs(l,e.length)}),l>0&&await this.load(),y(()=>{this.selectedNames.clear(),a.forEach(o=>this.selectedNames.add(o.name)),a.length===0&&(this.selectionMode=!1)})}finally{y(()=>{this.isBulkBusy=!1})}}}rollback(e,s){const a=U(e,s);y(()=>{const{[a]:l,...o}=this.overrides;this.overrides=o})}startCreating(){this.close(),this.exitSelection(),this.creating=!0}createInFiles(e,s){const a=e.trim(),l=s==="team"?"team":"user";!se.test(a)||s==="team"&&!this.listing?.viewerCanInstallToTeam||this.skills.some(o=>o.installed&&o.tier===l&&o.name===a)||(this.close(),this.navigateToFiles({create:`skill:${a}`,repo:s}))}editInFiles(e){E(e,this.listing?.viewerCanInstallToTeam??!1)&&(this.close(),this.navigateToFiles({open:`.skills/${e.name}/SKILL.md`,repo:e.tier==="team"?"team":"personal"}))}navigateToFiles(e){const s=new URLSearchParams(e);Ce(Se(`/files?${s}`,this.workspaceUrl))}}const ws="group relative flex h-[136px] cursor-pointer flex-col gap-4 overflow-hidden rounded-xl bg-panel p-4 shadow-[0_1px_4px_rgba(0,0,0,0.08)] ring-[0.5px] ring-edge-strong transition-[background-color,box-shadow,opacity] duration-150 ease-out hover:bg-slate-2 hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)] hover:ring-edge-strong-hover active:bg-slate-2 active:shadow-[0_2px_6px_rgba(0,0,0,0.12)] active:ring-edge-strong-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-8 dark:bg-card dark:hover:bg-white/[0.08] dark:active:bg-white/[0.11]",Cs=[[/setting|preference|config/,$e],[/code|script|developer|custom-tool|build.*tool|call.*tool/,Me],[/connect|integration|oauth|webhook|tool/,ze],[/contact|customer|people|user/,Z],[/email|gmail|inbox|mail/,Pe],[/calendar|meeting|schedule/,Oe],[/search|research|browse|browser|web/,P],[/file|document|pdf|sheet|drive|data|database|memory|storage/,We],[/message|slack|chat|sms/,qe],[/write|draft|content|note|image|photo|design|color/,Ke],[/security|permission|auth/,He],[/workflow|automate|trigger/,Ge],[/capabilit|guide|help|learn/,ee]],be=["text-[#789b82]","text-[#7997b8]","text-[#9687b3]","text-[#b7868f]","text-[#a58e65]","text-[#719b99]"];function Ss(t){let e=0;for(const s of t)e=Math.trunc((e*31+s.codePointAt(0))%2147483647);return Math.abs(e)%be.length}function js({skill:t}){const[e,s]=u.useState(!1),a=u.useCallback(()=>s(!0),[]);if(t.logoUrl&&!e)return n.jsx("span",{"aria-hidden":!0,className:"flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-white ring-[0.5px] ring-black/[0.12]",children:n.jsx("img",{src:t.logoUrl,alt:"",className:"size-full object-contain",onError:a})});const l=`${t.name} ${t.title}`.toLowerCase(),o=Cs.find(([i])=>i.test(l))?.[1]??ee,r=be[Ss(t.name)];return n.jsx("span",{"aria-hidden":!0,className:"flex size-7 shrink-0 items-center justify-center rounded-lg bg-white ring-[0.5px] ring-black/[0.12]",children:n.jsx(o,{className:`size-4 ${r}`})})}function Ns({skill:t}){const e=t.illustration?`${t.illustration.light} 3${t.illustration.dark}`:null,[s,a]=u.useState(null),l=u.useCallback(()=>a(e),[e]);return t.illustration&&s!==e?n.jsx(ue,{src:t.illustration.light,darkSrc:t.illustration.dark,onError:l}):n.jsx("div",{"data-testid":"skill-artwork-fallback",className:"flex aspect-video w-full shrink-0 items-center justify-center rounded-lg bg-slate-2 dark:bg-white/[0.04]",children:n.jsx(mt,{"aria-hidden":"true",className:"size-16"})})}const Is=h(function({state:e,skill:s}){const a=e.isBusy(s.name),l=e.listing?.viewerCanInstallToTeam??!1,o=u.useCallback(()=>S(e.install(s,"team")),[s,e]),r=u.useCallback(()=>e.editInFiles(s),[s,e]),i=u.useCallback(()=>S(e.install(s,s.tier==="team"?"team":"user")),[s,e]);return E(s,l)?n.jsxs(xt,{children:[n.jsx(kt,{asChild:!0,"aria-label":"Skill actions",children:n.jsx(D,{level:"secondary",size:"sm",variant:"pill",className:"h-7 rounded-l-none border-[0.5px] border-l-0 border-black/[0.12] bg-transparent px-1.5 py-1 text-slate-11 hover:bg-slate-3 hover:text-slate-12 dark:border-white/[0.12] dark:bg-card dark:text-slate-12 dark:hover:bg-white/[0.08]",children:n.jsx(Ve,{className:"size-3.5"})})}),n.jsxs(yt,{align:"end",className:"min-w-[212px]",children:[s.tier==="user"&&l?n.jsxs(R,{className:"gap-x-2.5",disabled:a,onSelect:o,children:[n.jsx(Qe,{className:"size-4"}),"Add to workspace"]}):null,n.jsxs(R,{className:"gap-x-2.5",disabled:a,onSelect:r,children:[n.jsx(Xe,{className:"size-4"}),"Edit in Files"]}),s.inMarket?n.jsxs(R,{className:"gap-x-2.5",disabled:a,onSelect:i,children:[n.jsx(Je,{className:"size-4",strokeWidth:2}),"Reinstall from marketplace"]}):null]})]}):null}),xe=h(function({state:e,skill:s}){const a=E(s,e.listing?.viewerCanInstallToTeam??!1);function l(r){r.stopPropagation()}function o(){e.requestUninstall(s)}return n.jsxs("div",{className:"inline-flex h-7 items-stretch overflow-hidden rounded-full",onClick:l,children:[a?n.jsx(D,{level:"secondary",size:"sm",variant:"pill","aria-label":`Remove ${s.title}`,className:"h-7 rounded-r-none border-[0.5px] border-black/[0.12] bg-transparent px-3 py-1 text-[13px] leading-5 text-slate-11 hover:bg-slate-3 hover:text-slate-12 dark:border-white/[0.12] dark:bg-card dark:text-slate-12 dark:hover:bg-white/[0.08]","data-testid":"skill-card-uninstall",onClick:o,children:"Remove"}):n.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border-[0.5px] border-black/[0.12] bg-transparent px-3 text-[13px] font-medium leading-5 text-slate-11 dark:border-white/[0.12] dark:bg-card dark:text-slate-12 ${s.disabled?"opacity-50":""}`,children:[s.disabled?null:n.jsx(z,{className:"size-3 text-success-9"}),s.disabled?"Disabled":"Installed"]}),n.jsx(Is,{state:e,skill:s})]})});function Ls(t,e,s,a){const l=[ws];return t&&l.push("!h-auto !gap-5"),e&&l.push("!bg-[#007AFF]/[0.08] !ring-2 !ring-primary-8 dark:!bg-[#007AFF]/[0.14]"),s&&l.push("cursor-wait"),a&&l.push("opacity-70"),l.join(" ")}function Ts(t,e,s){return t?{role:"checkbox","aria-checked":e,"aria-disabled":s}:{role:"button"}}function Ds(t){return t.tier==="user"?"Personal":t.tier==="team"?"Workspace":"Built by Lindy"}function Us({active:t,selected:e}
3){return t?n.jsx("span",{"aria-hidden":!0,className:`absolute right-3 top-3 z-10 grid size-5 place-items-center rounded-md border border-black/15 bg-panel shadow-sm dark:border-white/15 dark:bg-card ${e?"!border-primary-9 !bg-primary-9 text-white":"text-transparent"}`,children:n.jsx(z,{className:"size-3.5",strokeWidth:2.5})}):null}const As=h(function({state:e,skill:s}){return e.selectionMode||s.builtin?null:s.installed?n.jsx(xe,{state:e,skill:s}):n.jsx(ke,{state:e,skill:s,testId:"skill-card-install",className:"pointer-events-none opacity-0 transition-opacity duration-150 ease-out focus-visible:pointer-events-auto focus-visible:opacity-100 group-hover:pointer-events-auto group-hover:opacity-100 motion-reduce:transition-none max-sm:pointer-events-auto max-sm:opacity-100"})});function Bs({controls:t,featured:e,skill:s}){return e?n.jsx(Ns,{skill:s}):n.jsxs("div",{className:"flex h-7 items-start justify-between gap-3",children:[n.jsx(js,{skill:s}),t]})}function Fs({controls:t,featured:e,skill:s}){const a=s.userDescription?.trim()||s.description.trim()||"No description provided.";return e?n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[n.jsx("span",{className:"truncate text-sm font-medium leading-5 text-slate-12",children:s.title}),n.jsx("p",{className:"line-clamp-3 min-h-[60px] text-sm leading-5 text-slate-11",children:a}),n.jsxs("div",{className:"mt-3 flex min-h-7 flex-wrap items-end justify-between gap-2",children:[n.jsx("span",{className:"text-xs leading-[18px] text-slate-11",children:Ds(s)}),t]})]}):n.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[n.jsx("div",{className:"flex min-w-0 items-center gap-1.5",children:n.jsx("span",{className:"truncate text-sm font-medium leading-5 text-slate-12",children:s.title})}),n.jsx("p",{className:"line-clamp-2 min-h-9 text-xs leading-[18px] text-slate-11",children:a})]})}const _s=h(function({state:e,skill:s,featured:a=!1}){const l=e.selectionMode&&s.tier==="user",o=l&&e.selectedNames.has(s.name),r=l&&e.isBulkBusy;function i(){if(l){e.toggleSelection(s);return}e.open(s)}function c(m){m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),i())}const d=n.jsx(As,{state:e,skill:s});return n.jsxs("div",{...Ts(l,o,r),className:Ls(a,o,r,s.disabled),tabIndex:0,"data-testid":"skill-card",onClick:i,onKeyDown:c,children:[n.jsx(Us,{active:l,selected:o}),n.jsx(Bs,{controls:d,featured:a,skill:s}),n.jsx(Fs,{controls:d,featured:a,skill:s})]})}),Es=h(function({state:e,option:s}){function a(){e.setScope(s.value)}const l=e.scope===s.value,o=q(`size-4 shrink-0 opacity-50 transition-opacity duration-150 group-hover:opacity-100 motion-reduce:transition-none ${l?"opacity-100":""}`);return n.jsxs("button",{type:"button",className:q(`group inline-flex h-7 shrink-0 items-center gap-1.5 overflow-hidden rounded-xl bg-transparent pl-2 pr-3 text-sm font-medium leading-5 text-slate-12 outline-none transition-[background-color,color] duration-150 ease-out focus-visible:ring-2 focus-visible:ring-primary-8 motion-reduce:transition-none ${l?"bg-slate-4 hover:bg-slate-5 active:bg-slate-6":"hover:bg-slate-4 active:bg-slate-5"}`),"aria-pressed":l,"data-testid":"skills-scope",onClick:a,children:[s.value==="personal"?n.jsx(Fe,{className:o,strokeWidth:1.75}):s.value==="team"?n.jsx(Z,{className:o,strokeWidth:1.75}):n.jsx(_e,{className:o,strokeWidth:1.75}),n.jsx("span",{className:`transition-opacity duration-150 group-hover:opacity-100 motion-reduce:transition-none ${l?"":"opacity-60"}`,children:s.label})]})}),Rs=h(function({state:e,viewMode:s,onViewModeChange:a}){function l(c){e.setSearch(c.target.value)}function o(){e.startSelection()}const r=u.useCallback(()=>a("grid"),[a]),i=u.useCallback(()=>a("list"),[a]);return n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsx("div",{className:"flex w-fit max-w-full flex-wrap items-center gap-2",role:"group","aria-label":"Skill tabs",children:os.map(c=>n.jsx(Es,{state:e,option:c},c.value))}),n.jsxs("div",{className:"flex min-w-0 basis-full items-center justify-end gap-2 sm:ml-auto sm:basis-auto sm:flex-none",children:[e.scope==="personal"&&e.selectableSkills.length>0&&!e.selectionMode?n.jsx(D,{level:"secondary",size:"sm",variant:"pill",className:"h-8 px-3",onClick:o,children:"Select"}):null,n.jsxs("label",{className:"group relative min-w-32 max-w-64 flex-1 sm:w-56",children:[n.jsx(P,{className:"pointer-events-none absolute left-2.5 top-1/2 z-10 size-4 -translate-y-1/2 text-slate-12 opacity-50 transition-opacity duration-150 ease-out group-hover:opacity-100"}),n.jsx("span",{className:"sr-only",children:"Search skills"}),n.jsx("input",{type:"search","aria-label":"Search skills",className:"h-8 w-full rounded-xl !border-0 !bg-black/[0.04] py-0 pl-8 pr-3 text-sm text-slate-12 shadow-none outline-none transition-colors duration-150 ease-out placeholder:text-slate-11 hover:!bg-black/[0.06] focus-visible:ring-2 focus-visible:ring-primary-8 dark:!bg-white/[0.05] dark:hover:!bg-white/[0.07]",placeholder:"Search","data-testid":"skills-search",value:e.search,onChange:l})]}),n.jsxs("div",{role:"tablist","aria-label":"Skill view",className:"flex h-8 shrink-0 items-center rounded-xl bg-black/[0.04] p-0.5 dark:bg-white/[0.05]",children:[n.jsx(X,{active:s==="grid",label:"Grid view",onClick:r,children:n.jsx(Ae,{className:"size-4",strokeWidth:1.75})}),n.jsx(X,{active:s==="list",label:"List view",onClick:i,children:n.jsx(Be,{className:"size-4",strokeWidth:1.75})})]}),e.scope==="all"?n.jsx(ss,{state:e}):null]})]})}),$s=h(function({state:e}){const s=e.selectedSkills.length,a=e.isBulkBusy||s===0,l=u.useCallback(()=>S(e.bulkAddToWorkspace()),[e]),o=u.useCallback(()=>e.requestBulkUninstall(e.selectedSkills),[e]),r=u.useCallback(()=>e.exitSelection(),[e]);return n.jsxs("div",{role:"toolbar","aria-label":"Selected skill actions","aria-busy":e.isBulkBusy,className:"sticky top-3 z-20 flex flex-wrap items-center gap-2 rounded-[14px] border border-slate-4 bg-panel p-2 shadow-md",children:[n.jsxs("span",{className:"px-2 text-sm font-medium text-slate-12","aria-live":"polite",children:[s," ",s===1?"skill":"skills"," selected"]}),e.listing?.viewerCanInstallToTeam?n.jsx(D,{level:"secondary",size:"sm",variant:"pill",disabled:a,onClick:l,children:"Add to workspace"}):null,n.jsx(D,{level:"danger",size:"sm",variant:"pill",disabled:a,onClick:o,children:"Remove"}),n.jsx(D,{level:"secondary",size:"sm",variant:"pill",disabled:e.isBulkBusy,className:"ml-auto",onClick:r,children:"Cancel"})]})});function Ms(t){u.useEffect(()=>{const e=s=>{s.key==="Escape"&&t.selectionMode&&!t.isBulkBusy&&t.exitSelection()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t])}function X({active:t,children:e,label:s,onClick:a}){return n.jsx("button",{type:"button",role:"tab","aria-label":s,"aria-selected":t,className:`inline-flex size-7 min-w-0 cursor-pointer items-center justify-center rounded-[10px] p-0 text-slate-12 outline-none transition-[background-color,box-shadow,opacity] duration-150 ease-out focus-visible:ring-2 focus-visible:ring-primary-8 ${t?"bg-panel opacity-100 shadow-[0_1px_2px_rgba(0,0,0,0.08)] dark:bg-white/[0.08] dark:active:bg-white/[0.11] dark:shadow-none":"bg-transparent opacity-50 hover:bg-slate-4 hover:opacity-100 dark:hover:bg-white/[0.08] dark:active:bg-white/[0.11]"}`,onClick:a,children:e})}const ke=h(function({state:e,skill:s,className:a="",testId:l}){function o(i){i.stopPropagation(),S(e.install(s,"user"))}const r=e.isBusy(s.name);return n.jsx(D,{size:"sm",level:"contrast",variant:"pill","aria-label":r?`Adding ${s.title}`:`Add ${s.title}`,className:`h-7 border-0 bg-slate-12 py-1 pl-3 pr-2 text-[13px] leading-5 text-slate-1 backdrop-blur-[8px] hover:bg-slate-11 dark:bg-[#f6f5f4] dar
3k:text-[#333231] dark:hover:bg-white ${a} ${r?"pointer-events-auto !opacity-100":""}`,"data-testid":l,disabled:r,onClick:o,children:n.jsxs("span",{className:"flex items-center gap-0.5",children:[r?"Addingâ¦":"Add",r?null:n.jsx(Ye,{className:"size-[18px]"})]})})}),zs=t=>t instanceof Element&&t.closest("#lindy-root")!==null&&t.closest("[data-floating-notifications]")===null,Ps=h(function({children:e,state:s}){const a=u.useRef(null),l=O(),o=u.useCallback(()=>s.close(),[s]),r=u.useCallback(w=>{w.preventDefault(),a.current?.focus({preventScroll:!0})},[]),i=u.useCallback(w=>{const p=w.detail.originalEvent.target;(s.uninstallTarget!==null||!zs(p))&&w.preventDefault()},[s]),{drawerWidth:c,isMobile:d,isResizing:m,handleResizePointerDown:k,handleResizeKeyDown:j,minimumWidth:I,maximumWidth:f}=Ze(),N=u.useMemo(()=>({width:c,userSelect:m?"none":void 0}),[c,m]);return n.jsx(pt,{modal:!1,open:!0,onClose:o,children:n.jsxs(ht,{ref:a,overlayClassName:"hidden",onOpenAutoFocus:r,onCloseAutoFocus:l,onInteractOutside:i,tabIndex:-1,role:"dialog",className:"fixed bottom-[6px] left-auto right-[6px] top-[6px] z-modal-overlay grid h-[calc(100dvh-12px)] max-h-none max-w-[calc(100vw-12px)] translate-x-0 translate-y-0 grid-cols-[minmax(0,1fr)] grid-rows-[minmax(0,1fr)] overflow-visible rounded-none bg-transparent p-0 shadow-none outline-none dark:bg-transparent data-[state=open]:animate-sheet-in motion-reduce:data-[state=open]:animate-none max-sm:w-[calc(100vw-12px)] max-sm:h-[calc(100svh-12px)]","data-testid":"skill-detail-modal",style:N,children:[n.jsxs("div",{className:"grid h-full w-full grid-cols-[minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-[20px] bg-panel px-8 pb-4 pt-8 shadow-[0_1px_4px_rgba(0,0,0,0.08)] ring-[0.5px] ring-edge-strong dark:bg-card dark:shadow-none dark:ring-white/[0.06]",children:[n.jsx("div",{className:"absolute left-4 top-4 z-20 flex items-center gap-1",children:n.jsx("button",{type:"button","aria-label":"Close",className:"flex size-7 items-center justify-center rounded-lg text-slate-11 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-primary-8 hover:bg-slate-3 hover:text-slate-12",onClick:o,children:n.jsx(J,{className:"size-4"})})}),e]}),d?null:n.jsx("div",{role:"separator","aria-label":"Resize skill details","aria-orientation":"vertical","aria-valuemin":I,"aria-valuemax":f,"aria-valuenow":Math.round(c),tabIndex:0,className:"group absolute inset-y-0 -left-1.5 z-20 w-3 cursor-col-resize outline-none",onPointerDown:k,onKeyDown:j,children:n.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 h-8 w-1 -translate-y-1/2 rounded-2xl bg-[rgba(0,0,0,0.48)] opacity-0 backdrop-blur-[8px] transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100"})})]})})}),Os=h(function({state:e}){const s=e.selectedSkill;return s?n.jsx(Ps,{state:e,children:n.jsx(Ws,{state:e,skill:s},`${s.tier}:${s.name}`)}):null}),Ws=h(function({state:e,skill:s}){const[a,l]=u.useState(!1),o=u.useCallback(c=>{l(c.currentTarget.scrollTop>2)},[]),r=u.useCallback(c=>{c.stopPropagation()},[]);function i(){const c=e.documentMarkdown;c&&S(navigator.clipboard.writeText(c).then(()=>T({level:"success",label:"Instructions copied"})))}return n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-testid":"skill-detail-sticky-header",className:`relative z-10 -mx-8 -mt-8 min-w-0 border-b-[0.5px] bg-panel px-8 pb-4 pt-8 transition-[border-color,box-shadow] duration-150 ease-out motion-reduce:transition-none dark:bg-card ${a?"border-edge-strong shadow-[0_1px_4px_rgba(0,0,0,0.08)]":"border-transparent shadow-none"}`,children:n.jsxs("div",{className:"flex min-w-0 flex-col items-center gap-4",children:[n.jsxs("div",{className:"flex w-full min-w-0 flex-col items-center gap-1 text-center",children:[n.jsx("div",{className:"flex max-w-full items-center justify-center gap-1.5",children:n.jsx(ft,{className:"truncate text-base font-medium leading-6 text-slate-12",children:s.title})}),n.jsx(gt,{className:"line-clamp-2 w-full text-sm leading-5 text-slate-11",children:s.description})]}),s.installed?s.builtin?null:n.jsx(xe,{state:e,skill:s}):n.jsx(ke,{state:e,skill:s,testId:"skill-modal-install"})]})}),n.jsx(bt,{rootClassName:"-ml-2 -mr-8 w-[calc(100%+2.5rem)]",className:"min-w-0 overscroll-y-contain pb-0 pl-2 pr-8 pt-8 [&>div]:!block","data-testid":"skill-detail-scroll",onScroll:o,onWheel:r,scrollbarClassName:"w-1 bg-transparent p-0",scrollbarVisibility:"scroll",scrollHideDelay:500,children:e.documentStatus==="loading"?Q:e.documentStatus==="error"?n.jsx("p",{className:"text-sm text-red-9",role:"alert",children:"Loading the instructions failed."}):e.document!==null?n.jsxs("div",{children:[n.jsx("div",{className:"mb-2.5 text-sm font-medium leading-5 text-[#6d635b]",children:"Instructions"}),n.jsxs("div",{className:`relative min-h-32 ${E(s,e.listing?.viewerCanInstallToTeam??!1)?"":"rounded-lg bg-black/[0.035] px-4 py-3"}`,children:[n.jsx("button",{type:"button","aria-label":"Copy instructions",className:"absolute right-2 top-2 z-10 flex size-6 items-center justify-center rounded-md text-slate-10 transition-colors hover:bg-slate-3 hover:text-slate-12","data-testid":"skill-doc-copy",onClick:i,children:n.jsx(Ee,{className:"size-3.5"})}),n.jsx("div",{className:"pr-8",children:n.jsx(ys,{children:n.jsx(u.Suspense,{fallback:Q,children:n.jsx(ks,{source:e.document})})})})]})]}):e.documentStatus==="ready"?n.jsx("p",{className:"text-sm text-slate-10",children:"This skill has no content yet."}):null})]})}),qs=h(function({state:e}){return e.bulkUninstallTargets?n.jsx(Ks,{state:e,count:e.bulkUninstallTargets.length}):e.uninstallTarget?n.jsx(Hs,{state:e,skill:e.uninstallTarget}):null});function Ks({state:t,count:e}){const s=O(),a=u.useCallback(()=>t.requestBulkUninstall(null),[t]),l=u.useCallback(()=>S(t.bulkUninstall()),[t]),o=e===1?"skill":"skills",r=e===1?"Your assistant will no longer load this
3skill. Its folder is removed from your files.":"Your assistant will no longer load these skills. Their folders are removed from your files.";return n.jsx(ce,{open:!0,destructive:!0,"data-testid":"skill-bulk-uninstall-dialog",onCloseAutoFocus:s,onCancel:a,onConfirm:l,title:`Remove ${e} ${o}?`,description:r,confirmLabel:`Remove ${e}`})}function Hs({state:t,skill:e}){const s=O(),a=u.useCallback(()=>t.requestUninstall(null),[t]),l=u.useCallback(()=>S(t.uninstall(e)),[e,t]);return n.jsx(ce,{open:!0,destructive:!0,"data-testid":"skill-uninstall-dialog",onCloseAutoFocus:s,onCancel:a,onConfirm:l,title:`Remove ${e.title}?`,description:e.tier==="team"?"Your whole team loses this skill. The folder is removed from the team files.":"Your assistant will no longer load this skill. The folder is removed from your files.",confirmLabel:"Remove"})}function Gs(t,e,s){return!t||s!=="all"?null:e}function Ys({label:t,note:e}){return t?n.jsxs("div",{className:"mb-3",children:[n.jsx("h3",{className:"text-base font-medium text-slate-12",children:t}),e?n.jsx("p",{className:"mt-1 text-xs leading-[18px] text-[#6d635b]",children:e}):null]}):null}function Vs(t){return t==="grid"?"grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-4":"grid grid-cols-1 gap-3"}const Qs=h(function({state:e,section:s,viewMode:a,examples:l=[],categoryLabels:o,onUseCaseChange:r,featured:i=!1}){const c=[...s.skills.map(m=>n.jsx(_s,{state:e,skill:m,featured:a==="grid"},`${m.tier??"market"}:${m.name}`)),...l.map(m=>n.jsx(Ct,{example:m,compact:a==="list"},m.title))],d=Gs(i,s.label,e.scope);return d?n.jsx(Ut,{title:d,list:a==="list",wrap:a==="grid",tabs:o,onTabChange:r,children:c}):n.jsxs("section",{children:[n.jsx(Ys,{label:s.label,note:s.note}),n.jsx("div",{className:Vs(a),children:c})]})}),Xs="Browse and manage skills that help Lindy handle specific tasks. Lindy automatically uses the right skills as it works.";function Js(t,e){return t!=="all"?[]:e.filter(s=>s.label&&s.label!==B).map(s=>s.label)}function Zs(t,e,s){return t!=="all"?e:e.filter(a=>a.label===B||a.label===s)}function en(t){return t.scope!=="all"||t.search.trim()!==""?!1:t.statusFilter==="all"}function tn(t,e){return t==="all"&&e.label!==B}function sn(t,e){return t==="all"&&e!==B?"use-cases":e??"results"}const nn=h(function({state:e,onRetry:s}){return e.status==="loading"?n.jsx("div",{className:"flex flex-1 items-center justify-center",children:n.jsx(te,{label:"Loading skills"})}):e.status==="error"?n.jsxs("p",{className:"flex flex-1 items-center justify-center text-sm text-red-9",role:"alert",children:["Loading skills failed."," ",n.jsx("button",{className:"underline",onClick:s,children:"Retry"})]}):null});function an({marketplace:t}){return n.jsxs("div",{className:"px-5 py-16 text-center",children:[n.jsx(P,{className:"mx-auto mb-3 size-7 text-slate-9",strokeWidth:1.5}),n.jsx("div",{className:"text-sm font-medium text-slate-11",children:t?"No marketplace skills available":"No skills match"}),n.jsx("div",{className:"mt-1 text-[13px] text-slate-10",children:t?"Lindy will add new skills here.":"Try a different search or segment."})]})}const ln=h(function({state:e}){return e.selectionMode?n.jsx($s,{state:e}):null}),on=h(function({state:e}){return e.creating?n.jsx(wt,{state:e}):null}),rn=h(function({state:e,sections:s,visibleSections:a,categoryLabels:l,viewMode:o,onUseCaseChange:r}){if(s.every(d=>d.skills.length===0&&d.examples.length===0))return n.jsx(an,{marketplace:en(e)});const c=e.scope==="all"?"flex flex-col gap-14":"flex flex-col gap-6";return n.jsx("div",{className:c,children:a.map(d=>n.jsx(Qs,{featured:tn(e.scope,d),state:e,section:d,examples:d.examples,categoryLabels:l,onUseCaseChange:r,viewMode:o},sn(e.scope,d.label)))})}),cn=h(function({state:e,viewMode:s,selectedUseCase:a,onViewModeChange:l,onUseCaseChange:o,onCreateSkill:r}){if(!e.listing)return null;const i=as(e.view.sections,void 0),c=Js(e.scope,i),d=c.includes(a)?a:c[0],m=Zs(e.scope,i,d),k=e.scope==="all"?"pb-8 pt-8":"pb-8";return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable] [scrollbar-width:thin]",children:n.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 pb-8 pt-8",children:[n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[n.jsx("h1",{className:"text-xl font-semibold text-slate-12",children:"Skills"}),n.jsx("p",{className:"max-w-2xl text-sm text-slate-11",children:Xs})]}),n.jsxs("button",{type:"button","aria-label":"New skill",className:"inline-flex h-7 shrink-0 items-center gap-1 rounded-full border-0 bg-slate-12 py-1 pl-2 pr-3 text-[14px] font-medium leading-5 text-slate-1 outline-none transition-colors hover:bg-slate-11 focus-visible:ring-2 focus-visible:ring-primary-8 dark:bg-slate-12 dark:text-slate-1","data-testid":"new-skill-button",onClick:r,children:[n.jsx(Re,{className:"size-[18px]"})," New"]})]}
3),n.jsx(Rs,{state:e,viewMode:s,onViewModeChange:l}),n.jsx(ln,{state:e}),n.jsx("div",{className:k,children:n.jsx(rn,{state:e,sections:i,visibleSections:m,categoryLabels:c,viewMode:s,onUseCaseChange:o})})]})}),n.jsx(Os,{state:e}),n.jsx(on,{state:e}),n.jsx(qs,{state:e})]})}),Pn=h(function(){const[e]=u.useState(()=>new vs);Ms(e);const[s,a]=u.useState("grid"),[l,o]=u.useState("Marketing");u.useEffect(()=>{const c=document.title;return document.title="Skills",S(e.load()),()=>{document.title=c}},[e]);function r(){S(e.load())}function i(){e.startCreating()}return n.jsxs("div",{className:"flex size-full min-h-0 flex-col",children:[n.jsx(nn,{state:e,onRetry:r}),n.jsx(cn,{state:e,viewMode:s,selectedUseCase:l,onViewModeChange:a,onUseCaseChange:o,onCreateSkill:i})]})});export{$s as BulkSkillsBar,Rs as FilterBar,_s as SkillCard,Os as SkillDetailPanel,vs as SkillsState,qs as UninstallDialog,Pn as View,Ms as useSkillsSelectionEscape};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.