PageSourceSearch

https://baipiao.ai/assets/assistant-ui-primitives-Bn9nn9-n.js

js baipiao.ai collected 2026-10-05 15:19:57 UTC 10,483 bytes, 1 lines download raw bytes

1import{r as u,j as n}from"./react-vendor-P5XnYvWb.js";import{S as T,a as _,b as I,D as $,c as V,d as b,e as M,f as A,g as E,h as R,P as B,R as K,T as q,i as L,C as U,A as J,j as F,k as W,l as X,m as G}from"./radix-ui-BXT0dNmF.js";import{X as H}from"./icons-C3gyKvVD.js";function f(...e){return e.filter(Boolean).join(" ")}const z=u.createContext({active:!0,layer:0}),me=z.Provider;function k(){return u.useContext(z)}const h={preview:90,player:130,catalog:140,dialog:2147483500};function Q(e,a){if(!a.active||!a.ownerId||!e.scope.active||e.scope.ownerId&&e.scope.ownerId!==a.ownerId||e.scope.routeKey&&e.scope.routeKey!==a.routeKey||e.layer<=a.layer||e.coverage==="none")return!1;if(e.coverage==="viewport")return!0;const t=a.rect;if(!t)return!1;const o=e.coverage;return t.width>0&&t.height>0&&o.width>0&&o.height>0&&Math.max(t.left,o.left)<Math.min(t.left+t.width,o.left+o.width)&&Math.max(t.top,o.top)<Math.min(t.top+t.height,o.top+o.height)}const p={"player-controls":{coverage:"none",layer:0},dialog:{coverage:"viewport",layer:h.dialog},catalog:{coverage:"viewport",layer:h.catalog},passive:{coverage:"none",layer:0}},Y=Object.keys(p);function Z(){const e=new Map,a=new Set;let t=Object.freeze({"player-controls":0,dialog:0,catalog:0,passive:0,entries:Object.freeze([])}),o=!1;function r(){o||(o=!0,queueMicrotask(()=>{o=!1;const s=Object.fromEntries(Y.map(d=>[d,0])),i=[];for(const{kind:d,entry:l}of e.values())s[d]++,i.push(l);const c={...s,entries:i};if(JSON.stringify(t)!==JSON.stringify(c)){t=Object.freeze({...s,entries:Object.freeze(i)});for(const d of Array.from(a))d()}}))}return{acquire(s,i){const c=p[s];if(!c)throw new Error("Unknown overlay presentation kind");const d=i??{scope:{active:!0,layer:0},layer:c.layer,coverage:c.coverage},l=Symbol(s);return e.set(l,{kind:s,entry:Object.freeze({...d,scope:Object.freeze({...d.scope})})}),r(),()=>{e.delete(l)&&r()}},getSnapshot:()=>t,isSurfaceOccluded:s=>t.entries.some(i=>Q(i,s)),subscribe(s){return a.add(s),()=>{a.delete(s)}}}}const ee=Z();function C(e,a=!0){const t=k(),o=p[e],r=Math.max(o.layer,t.layer+1);return u.useLayoutEffect(()=>{if(!(!a||!t.active))return ee.acquire(e,{scope:t,layer:r,coverage:o.coverage})},[a,e,t,r,o.coverage]),r}function pe({kind:e,active:a=!0}){const t=C(e,a),o=u.useRef(null);return u.useLayoutEffect(()=>{var i;if(!a||p[e].coverage==="none")return;const r=(i=o.current)==null?void 0:i.parentElement;if(!r)return;const s=r.style.zIndex;return r.style.zIndex=String(t),()=>{r.style.zIndex=s}},[a,e,t]),n.jsx("span",{hidden:!0,ref:o,"aria-hidden":"true"})}function xe({className:e,...a}){return n.jsx(T,{"data-slot":"switch",className:f("relative inline-flex h-7 w-12 shrink-0 cursor-pointer items-center rounded-full border border-[var(--movie-border)] bg-[var(--movie-surface-strong)] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[var(--movie-primary-muted)] disabled:cursor-wait disabled:opacity-55 data-[state=checked]:border-[var(--movie-primary-strong)] data-[state=checked]:bg-[var(--movie-primary-strong)]",e),...a,children:n.jsx(_,{"data-slot":"switch-thumb",className:"pointer-events-none block size-5 shrink-0 rounded-full bg-white shadow-sm transition-transform data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-1"})})}const N=u.createContext(!1);function te({open:e,defaultOpen:a=!1,onOpenChange:t}){const[o,r]=u.useState(a),s=e??o,i=u.useCallback(c=>{e===void 0&&r(c),t==null||t(c)},[e,t]);return{open:s,onOpenChange:i}}function P(e){var a,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(a=0;a<r;a++)e[a]&&(t=P(e[a]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function ae(){for(var e,a,t=0,o="",r=arguments.length;t<r;t++)(e=arguments[t])&&(a=P(e))&&(o&&(o+=" "),o+=a);return o}const j=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,w=ae,oe=(e,a)=>t=>{var o;if((a==null?void 0:a.variants)==null)return w(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:r,defaultVariants:s}=a,i=Object.keys(r).map(l=>{const g=t==null?void 0:t[l],m=s==null?void 0:s[l];if(g===null)return null;const v=j(g)||j(m);return r[l][v]}),c=t&&Object.entries(t).reduce((l,g)=>{let[m,v]=g;return v===void 0||(l[m]=v),l},{}),d=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((l,g)=>{let{class:m,className:v,...S}=g;return Object.entries(S).every(O=>{let[y,x]=O;return Array.isArray(x)?x.includes({...s,...c}[y]):{...s,...c}[y]===x})?[...l,m,v]:l},[]);return w(e,i,d,t==null?void 0:t.class,t==null?void 0:t.className)},ne=oe("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 text-white",outline:"bg-background hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 border shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function D({className:e,variant:a="default",size:t="default",asChild:o=!1,...r}){const s=o?I:"button";return n.jsx(s,{"data-slot":"button","data-variant":a,"data-size":t,className:f(ne({variant:a,size:t,className:e})),...r})}function he({...e}){const a=te(e);return n.jsx(N.Provider,{value:a.open&&e.modal!==!1,children:n.jsx($,{"data-slot":"dialog",...e,...a})})}function se({...e}){return n.jsx(E,{"data-slot":"dialog-portal",...e})}function be({...e}){return n.jsx(b,{"data-slot":"dialog-close",...e})}function re({className:e,...a}){const t=u.useContext(N),o=C("dialog",t);return n.jsx(R,{"data-slot":"dialog-overlay",className:f("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=open]:animate-in fixed inset-0 z-50 bg-black/50",e),...a,style:{...a.style,zIndex:o}})}function ye({className:e,children:a,containerClassName:t,overlayClassName:o,showCloseButton:r=!0,...s}){const i=k(),c=Math.max(h.dialog,i.layer+1);return n.jsxs(se,{"data-slot":"dialog-portal",children:[n.jsx(re,{className:o}),n.jsx("div",{"data-slot":"dialog-layer",style:{zIndex:c},className:f("pointer-events-none fixed inset-0 z-50 grid place-items-center p-4",t),children:n.jsxs(V,{"data-slot":"dialog-content",className:f("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 bg-background data-[state=closed]:animate-out data-[state=open]:animate-in pointer-events-auto relative grid w-full max-w-[calc(100%-2rem)] gap-4 roun
1ded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...s,children:[a,r&&n.jsxs(b,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[n.jsx(H,{}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})})]})}function je({className:e,showCloseButton:a=!1,children:t,...o}){return n.jsxs("div",{"data-slot":"dialog-footer",className:f("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...o,children:[t,a&&n.jsx(b,{asChild:!0,children:n.jsx(D,{variant:"outline",children:"Close"})})]})}function we({className:e,...a}){return n.jsx(M,{"data-slot":"dialog-title",className:f("text-lg leading-none font-semibold",e),...a})}function ze({className:e,...a}){return n.jsx(A,{"data-slot":"dialog-description",className:f("text-muted-foreground text-sm",e),...a})}function ie({delayDuration:e=0,...a}){return n.jsx(B,{"data-slot":"tooltip-provider",delayDuration:e,...a})}function le({...e}){return n.jsx(K,{"data-slot":"tooltip",...e})}function ce({...e}){return n.jsx(q,{"data-slot":"tooltip-trigger",...e})}function de({className:e,sideOffset:a=0,children:t,...o}){return n.jsx(L,{children:n.jsxs(U,{"data-slot":"tooltip-content",sideOffset:a,className:f("fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 animate-in bg-foreground text-background data-[state=closed]:animate-out z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...o,children:[t,n.jsx(J,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const ue=u.forwardRef(({children:e,tooltip:a,side:t="bottom",className:o,...r},s)=>n.jsx(ie,{delayDuration:0,children:n.jsxs(le,{children:[n.jsx(ce,{asChild:!0,children:n.jsxs(D,{variant:"ghost",size:"icon",...r,className:f("aui-button-icon size-6 p-1 active:scale-90",o),ref:s,children:[n.jsx(F,{children:e}),n.jsx("span",{className:"aui-sr-only sr-only",children:a})]})}),n.jsx(de,{side:t,children:a})]})}));ue.displayName="TooltipIconButton";function ke({...e}){return n.jsx(X,{"data-slot":"collapsible",...e})}function Ce({...e}){return n.jsx(W,{"data-slot":"collapsible-trigger",...e})}function Ne({...e}){return n.jsx(G,{"data-slot":"collapsible-content",...e})}export{D as B,ke as C,he as D,pe as O,me as P,xe as S,ue as T,C as a,ye as b,f as c,we as d,ze as e,te as f,je as g,be as h,Ne as i,Ce as j,ee as o,h as p,k as u};

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.