PageSourceSearch

https://web-static3.lovart.ai/lovart_prd/static/_next/static/chunks/2bq66ka2wlnw8.js

js lovart.ai collected 2026-10-01 12:17:46 UTC 342,794 bytes, 20 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76773,e=>{"use strict";let t;var i=e.i(820967);e.i(284328);var n=e.i(649192),r=e.i(443219),r=r,a=e.i(224292),s=e.i(839905),l=e.i(899376),o=e.i(292286);let u=(0,i.createContext)(void 0);var c=e.i(781532);Object.assign({},c.default.Modal);let d=[],h=()=>d.reduce((e,t)=>Object.assign(Object.assign({},e),t),c.default.Modal);var m=e.i(87503);let p=e=>{let{locale:t={},children:n,_ANT_MARK__:r}=e;i.useEffect(()=>(function(e){if(e){let t=Object.assign({},e);return d.push(t),h(),()=>{d=d.filter(e=>e!==t),h()}}Object.assign({},c.default.Modal)})(null==t?void 0:t.Modal),[t]);let a=i.useMemo(()=>Object.assign(Object.assign({},t),{exist:!0}),[t]);return i.createElement(m.default.Provider,{value:a},n)};var f=e.i(25979),g=e.i(774077),x=e.i(353489),v=e.i(937824);e.i(37374);var y=e.i(665749),_=e.i(221588),b=e.i(62018),w=e.i(973759);let j=`-ant-${Date.now()}-${Math.random()}`,N=i.createContext(!1),E=({children:e,disabled:t})=>{let n=i.useContext(N);return i.createElement(N.Provider,{value:null!=t?t:n},e)};var T=e.i(778163),C=e.i(777376);let{useId:A}=Object.assign({},i),k=void 0===A?()=>"":A;e.i(302248);var M=e.i(437887),M=M,I=e.i(614614);let S=i.createContext(!0);function O(e){let t=i.useContext(S),{children:n}=e,[,r]=(0,I.useToken)(),{motion:a}=r,s=i.useRef(!1);return(s.current||(s.current=t!==a),s.current)?i.createElement(S.Provider,{value:a},i.createElement(M.default,{motion:a},n)):n}let R=()=>null;var P=e.i(174580),D=e.i(441882),L=e.i(97914),F=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)0>t.indexOf(n[r])&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i};let U=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"],V=e=>{var t,d,h;let m,y,_,{children:b,csp:w,autoInsertSpaceInButton:j,alert:N,anchor:A,form:M,locale:I,componentSize:S,direction:V,space:z,splitter:B,virtual:$,dropdownMatchSelectWidth:H,popupMatchSelectWidth:q,popupOverflow:W,legacyLocale:G,parentContext:Y,iconPrefixCls:Q,theme:K,componentDisabled:X,segmented:Z,statistic:J,spin:ee,calendar:et,carousel:ei,cascader:en,collapse:er,typography:ea,checkbox:es,descriptions:el,divider:eo,drawer:eu,skeleton:ec,steps:ed,image:eh,layout:em,list:ep,mentions:ef,modal:eg,progress:ex,result:ev,slider:ey,breadcrumb:e_,menu:eb,pagination:ew,input:ej,textArea:eN,empty:eE,badge:eT,radio:eC,rate:eA,switch:ek,transfer:eM,avatar:eI,message:eS,tag:eO,table:eR,card:eP,tabs:eD,timeline:eL,timePicker:eF,upload:eU,notification:eV,tree:ez,colorPicker:eB,datePicker:e$,rangePicker:eH,flex:eq,wave:eW,dropdown:eG,warning:eY,tour:eQ,tooltip:eK,popover:eX,popconfirm:eZ,floatButton:eJ,floatButtonGroup:e0,variant:e1,inputNumber:e2,treeSelect:e5}=e,e3=i.useCallback((t,i)=>{let{prefixCls:n}=e;if(i)return i;let r=n||Y.getPrefixCls("");return t?`${r}-${t}`:r},[Y.getPrefixCls,e.prefixCls]),e4=Q||Y.iconPrefixCls||v.defaultIconPrefixCls,e7=w||Y.csp;((e,t)=>{let[i,n]=(0,L.default)();return(0,P.useStyleRegister)({theme:i,token:n,hashId:"",path:["ant-design-icons",e],nonce:()=>null==t?void 0:t.nonce,layer:{name:"antd"}},()=>(0,D.genIconStyle)(e))})(e4,e7);let e6=(t=Y.theme,d={prefixCls:e3("")},(0,o.devUseWarning)("ConfigProvider"),y=!1!==(m=K||{}).inherit&&t?t:Object.assign(Object.assign({},g.defaultConfig),{hashed:null!=(h=null==t?void 0:t.hashed)?h:g.defaultConfig.hashed,cssVar:null==t?void 0:t.cssVar}),_=k(),(0,s.default)(()=>{var e,i;if(!K)return t;let n=Object.assign({},y.components);Object.keys(K.components||{}).forEach(e=>{n[e]=Object.assign(Object.assign({},n[e]),K.components[e])});let r=`css-var-${_.replace(/:/g,"")}`,a=(null!=(e=m.cssVar)?e:y.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:null==d?void 0:d.prefixCls},"object"==typeof y.cssVar?y.cssVar:{}),"object"==typeof m.cssVar?m.cssVar:{}),{key:"object"==typeof m.cssVar&&(null==(i=m.cssVar)?void 0:i.key)||r});return Object.assign(Object.assign(Object.assign({},y),m),{token:Object.assign(Object.assign({},y.token),m.token),components:n,cssVar:a})},[m,y],(e,t)=>e.some((e,i)=>{let n=t[i];return!(0,C.default)(e,n,!0)}))),e8={csp:e7,autoInsertSpaceInButton:j,alert:N,anchor:A,locale:I||G,direction:V,space:z,splitter:B,virtual:$,popupMatchSelectWidth:null!=q?q:H,popupOverflow:W,getPrefixCls:e3,iconPrefixCls:e4,theme:e6,segmented:Z,statistic:J,spin:ee,calendar:et,carousel:ei,cascader:en,collapse:er,typography:ea,checkbox:es,descriptions:el,divider:eo,drawer:eu,skeleton:ec,steps:ed,image:eh,input:ej,textArea:eN,layout:em,list:ep,mentions:ef,modal:eg,progress:ex,result:ev,slider:ey,breadcrumb:e_,menu:eb,pagination:ew,empty:eE,badge:eT,radio:eC,rate:eA,switch:ek,transfer:eM,avatar:eI,message:eS,tag:eO,table:eR,card:eP,tabs:eD,timeline:eL,timePicker:eF,upload:eU,notification:eV,tree:ez,colorPicker:eB,datePicker:e$,rangePicker:eH,flex:eq,wave:eW,dropdown:eG,warning:eY,tour:eQ,tooltip:eK,popover:eX,popconfirm:eZ,floatButton:eJ,floatButtonGroup:e0,variant:e1,inputNumber:e2,treeSelect:e5},e9=Object.assign({},Y);
1Object.keys(e8).forEach(e=>{void 0!==e8[e]&&(e9[e]=e8[e])}),U.forEach(t=>{let i=e[t];i&&(e9[t]=i)}),void 0!==j&&(e9.button=Object.assign({autoInsertSpace:j},e9.button));let te=(0,s.default)(()=>e9,e9,(e,t)=>{let i=Object.keys(e),n=Object.keys(t);return i.length!==n.length||i.some(i=>e[i]!==t[i])}),{layer:tt}=i.useContext(r.default),ti=i.useMemo(()=>({prefixCls:e4,csp:e7,layer:tt?"antd":void 0}),[e4,e7,tt]),tn=i.createElement(i.Fragment,null,i.createElement(R,{dropdownMatchSelectWidth:H}),b),tr=i.useMemo(()=>{var e,t,i,n;return(0,l.merge)((null==(e=c.default.Form)?void 0:e.defaultValidateMessages)||{},(null==(i=null==(t=te.locale)?void 0:t.Form)?void 0:i.defaultValidateMessages)||{},(null==(n=te.form)?void 0:n.validateMessages)||{},(null==M?void 0:M.validateMessages)||{})},[te,null==M?void 0:M.validateMessages]);Object.keys(tr).length>0&&(tn=i.createElement(u.Provider,{value:tr},tn)),I&&(tn=i.createElement(p,{locale:I,_ANT_MARK__:"internalMark"},tn)),(e4||e7)&&(tn=i.createElement(a.default.Provider,{value:ti},tn)),S&&(tn=i.createElement(T.SizeContextProvider,{size:S},tn)),tn=i.createElement(O,null,tn);let ta=i.useMemo(()=>{let e=e6||{},{algorithm:t,token:i,components:r,cssVar:a}=e,s=F(e,["algorithm","token","components","cssVar"]),l=t&&(!Array.isArray(t)||t.length>0)?(0,n.createTheme)(t):f.defaultTheme,o={};Object.entries(r||{}).forEach(([e,t])=>{let i=Object.assign({},t);"algorithm"in i&&(!0===i.algorithm?i.theme=l:(Array.isArray(i.algorithm)||"function"==typeof i.algorithm)&&(i.theme=(0,n.createTheme)(i.algorithm)),delete i.algorithm),o[e]=i});let u=Object.assign(Object.assign({},x.default),i);return Object.assign(Object.assign({},s),{theme:l,token:u,components:o,override:Object.assign({override:u},o),cssVar:a})},[e6]);return K&&(tn=i.createElement(g.DesignTokenContext.Provider,{value:ta},tn)),te.warning&&(tn=i.createElement(o.WarningContext.Provider,{value:te.warning},tn)),void 0!==X&&(tn=i.createElement(E,{disabled:X},tn)),i.createElement(v.ConfigContext.Provider,{value:te},tn)},z=e=>{let t=i.useContext(v.ConfigContext),n=i.useContext(m.default);return i.createElement(V,Object.assign({parentContext:t,legacyLocale:n},e))};z.ConfigContext=v.ConfigContext,z.SizeContext=T.default,z.config=e=>{let{prefixCls:i,iconPrefixCls:n,theme:r,holderRender:a}=e;if(void 0!==i&&(t=i),r&&Object.keys(r).some(e=>e.endsWith("Color"))){let e;e=function(e,t){let i={},n=(e,t)=>{let i=e.clone();return(i=(null==t?void 0:t(i))||i).toRgbString()},r=(e,t)=>{let r=new _.FastColor(e),a=(0,y.generate)(r.toRgbString());i[`${t}-color`]=n(r),i[`${t}-color-disabled`]=a[1],i[`${t}-color-hover`]=a[4],i[`${t}-color-active`]=a[6],i[`${t}-color-outline`]=r.clone().setA(.2).toRgbString(),i[`${t}-color-deprecated-bg`]=a[0],i[`${t}-color-deprecated-border`]=a[2]};if(t.primaryColor){r(t.primaryColor,"primary");let e=new _.FastColor(t.primaryColor),a=(0,y.generate)(e.toRgbString());a.forEach((e,t)=>{i[`primary-${t+1}`]=e}),i["primary-color-deprecated-l-35"]=n(e,e=>e.lighten(35)),i["primary-color-deprecated-l-20"]=n(e,e=>e.lighten(20)),i["primary-color-deprecated-t-20"]=n(e,e=>e.tint(20)),i["primary-color-deprecated-t-50"]=n(e,e=>e.tint(50)),i["primary-color-deprecated-f-12"]=n(e,e=>e.setA(.12*e.a));let s=new _.FastColor(a[0]);i["primary-color-active-deprecated-f-30"]=n(s,e=>e.setA(.3*e.a)),i["primary-color-active-deprecated-d-02"]=n(s,e=>e.darken(2))}t.successColor&&r(t.successColor,"success"),t.warningColor&&r(t.warningColor,"warning"),t.errorColor&&r(t.errorColor,"error"),t.infoColor&&r(t.infoColor,"info");let a=Object.keys(i).map(t=>`--${e}-${t}: ${i[t]};`);return`
2  :root {
3    ${a.join("\n")}
4  }
5  `.trim()}(t||v.defaultPrefixCls,r),(0,b.default)()&&(0,w.updateCSS)(e,`${j}-dynamic-theme`)}},z.useConfig=function(){return{componentDisabled:(0,i.useContext)(N),componentSize:(0,i.useContext)(T.default)}},Object.defineProperty(z,"SizeContext",{get:()=>T.default}),e.s(["ConfigProvider",0,z],76773)},476302,829881,e=>{"use strict";let t,i,n;var r,a,s,l=e.i(21590),o=e.i(820967);let u=(0,o.createContext)({});function c(e){let t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}let d=(0,o.createContext)(null);var h=o;let m=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class p extends h.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function f({children:e,isPresent:t}){let i=(0,h.useId)(),n=(0,h.useRef)(null),r=(0,h.useRef)({width:0,height:0,top:0,left:0}),{nonce:a}=(0,h.useContext)(m);return(0,h.useInsertionEffect)(()=>{let{width:e,height:s,top:l,left:o}=r.current;if(t||!n.current||!e||!s)return;n.current.dataset.motionPopId=i;let u=document.createElement("style");return a&&(u.nonce=a),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
6          [data-motion-pop-id="${i}"] {
7            position: absolute !important;
8            width: ${e}px !important;
9            height: ${s}px !important;
10            top: ${l}px !important;
11            left: ${o}px !important;
12          }
13        `),()=>{document.head.removeChild(u)}},[t]),(0,l.jsx)(p,{isPresent:t,childRef:n,sizeRef:r,children:h.cloneElement(e,{ref:n})})}let g=({children:e,initial:t,isPresent:i,onExitComplete:n,custom:r,presenceAffectsLayout:a,mode:s})=>{let u=c(x),h=(0,o.useId)(),m=(0,o.useCallback)(e=>
13{for(let t of(u.set(e,!0),u.values()))if(!t)return;n&&n()},[u,n]),p=(0,o.useMemo)(()=>({id:h,initial:t,isPresent:i,custom:r,onExitComplete:m,register:e=>(u.set(e,!1),()=>u.delete(e))}),a?[Math.random(),m]:[i,m]);return(0,o.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[i]),o.useEffect(()=>{i||u.size||!n||n()},[i]),"popLayout"===s&&(e=(0,l.jsx)(f,{isPresent:i,children:e})),(0,l.jsx)(d.Provider,{value:p,children:e})};function x(){return new Map}function v(e=!0){let t=(0,o.useContext)(d);if(null===t)return[!0,null];let{isPresent:i,onExitComplete:n,register:r}=t,a=(0,o.useId)();(0,o.useEffect)(()=>{e&&r(a)},[e]);let s=(0,o.useCallback)(()=>e&&n&&n(a),[a,n,e]);return!i&&n?[!1,s]:[!0]}let y=e=>e.key||"";function _(e){let t=[];return o.Children.forEach(e,e=>{(0,o.isValidElement)(e)&&t.push(e)}),t}let b="u">typeof window,w=b?o.useLayoutEffect:o.useEffect;function j(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}e.s(["AnimatePresence",0,({children:e,custom:t,initial:i=!0,onExitComplete:n,presenceAffectsLayout:r=!0,mode:a="sync",propagate:s=!1})=>{let[d,h]=v(s),m=(0,o.useMemo)(()=>_(e),[e]),p=s&&!d?[]:m.map(y),f=(0,o.useRef)(!0),x=(0,o.useRef)(m),b=c(()=>new Map),[j,N]=(0,o.useState)(m),[E,T]=(0,o.useState)(m);w(()=>{f.current=!1,x.current=m;for(let e=0;e<E.length;e++){let t=y(E[e]);p.includes(t)?b.delete(t):!0!==b.get(t)&&b.set(t,!1)}},[E,p.length,p.join("-")]);let C=[];if(m!==j){let e=[...m];for(let t=0;t<E.length;t++){let i=E[t],n=y(i);p.includes(n)||(e.splice(t,0,i),C.push(i))}"wait"===a&&C.length&&(e=C),T(_(e)),N(m);return}let{forceRender:A}=(0,o.useContext)(u);return(0,l.jsx)(l.Fragment,{children:E.map(e=>{let o=y(e),u=(!s||!!d)&&(m===E||p.includes(o));return(0,l.jsx)(g,{isPresent:u,initial:(!f.current||!!i)&&void 0,custom:u?void 0:t,presenceAffectsLayout:r,mode:a,onExitComplete:u?void 0:()=>{if(!b.has(o))return;b.set(o,!0);let e=!0;b.forEach(t=>{t||(e=!1)}),e&&(null==A||A(),T(x.current),s&&(null==h||h()),n&&n())},children:e},o)})})}],476302);let N=e=>Array.isArray(e);function E(e,t){if(!Array.isArray(t))return!1;let i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function T(e){return"string"==typeof e||Array.isArray(e)}function C(e){let t=[{},{}];return null==e||e.values.forEach((e,i)=>{t[0][i]=e.get(),t[1][i]=e.getVelocity()}),t}function A(e,t,i,n){if("function"==typeof t){let[r,a]=C(n);t=t(void 0!==i?i:e.custom,r,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[r,a]=C(n);t=t(void 0!==i?i:e.custom,r,a)}return t}function k(e,t,i){let n=e.getProps();return A(n,t,void 0!==i?i:n.custom,e)}let M=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],I=["initial",...M],S=e=>e;function O(e){let t;return()=>(void 0===t&&(t=e()),t)}let R=O(()=>void 0!==window.ScrollTimeline);class P{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t}attachTimeline(e,t){let i=this.animations.map(i=>R()&&i.attachTimeline?i.attachTimeline(e):"function"==typeof t?t(i):void 0);return()=>{i.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class D extends P{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}let L=e=>1e3*e;function F(e){let t=0,i=e.next(t);for(;!i.done&&t<2e4;)t+=50,i=e.next(t);return t>=2e4?1/0:t}function U(e,t){e.timeline=t,e.onfinish=null}let V=e=>Array.isArray(e)&&"number"==typeof e[0],z,B=(i=O(()=>{try{document.createElement("div").animate({opacity:0}
13,{easing:"linear(0, 1)"})}catch(e){return!1}return!0}),()=>{var e;return null!=(e=z)?e:i()}),$=(e,t,i)=>{let n=t-e;return 0===n?1:(i-e)/n},H=(e,t,i=10)=>{let n="",r=Math.max(Math.round(t/i),2);for(let t=0;t<r;t++)n+=e($(0,r-1,t))+", ";return`linear(${n.substring(0,n.length-2)})`},q=([e,t,i,n])=>`cubic-bezier(${e}, ${t}, ${i}, ${n})`,W={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:q([0,.65,.55,1]),circOut:q([.55,0,1,.45]),backIn:q([.31,.01,.66,-.59]),backOut:q([.33,1.53,.69,.99])};function G(e,t){return e?e[t]||e.default||e:void 0}function Y(e){return"function"==typeof e}let Q=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],K=new Set(Q),X=new Set(["width","height","top","left","right","bottom",...Q]),Z=e=>N(e)?e[e.length-1]||0:e,J=["read","resolveKeyframes","update","preRender","render","postRender"];function ee(e,t){let i=!1,n=!0,r={delta:0,timestamp:0,isProcessing:!1},a=()=>i=!0,s=J.reduce((e,t)=>(e[t]=function(e){let t=new Set,i=new Set,n=!1,r=!1,a=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function l(t){a.has(t)&&(o.schedule(t),e()),t(s)}let o={schedule:(e,r=!1,s=!1)=>{let l=s&&n?t:i;return r&&a.add(e),l.has(e)||l.add(e),e},cancel:e=>{i.delete(e),a.delete(e)},process:e=>{if(s=e,n){r=!0;return}n=!0,[t,i]=[i,t],t.forEach(l),t.clear(),n=!1,r&&(r=!1,o.process(e))}};return o}(a),e),{}),{read:l,resolveKeyframes:o,update:u,preRender:c,render:d,postRender:h}=s,m=()=>{let a=performance.now();i=!1,r.delta=n?1e3/60:Math.max(Math.min(a-r.timestamp,40),1),r.timestamp=a,r.isProcessing=!0,l.process(r),o.process(r),u.process(r),c.process(r),d.process(r),h.process(r),r.isProcessing=!1,i&&t&&(n=!1,e(m))};return{schedule:J.reduce((t,a)=>{let l=s[a];return t[a]=(t,a=!1,s=!1)=>(!i&&(i=!0,n=!0,r.isProcessing||e(m)),l.schedule(t,a,s)),t},{}),cancel:e=>{for(let t=0;t<J.length;t++)s[J[t]].cancel(e)},state:r,steps:s}}let{schedule:et,cancel:ei,state:en,steps:er}=ee("u">typeof requestAnimationFrame?requestAnimationFrame:S,!0);function ea(){t=void 0}let es={now:()=>(void 0===t&&es.set(en.isProcessing?en.timestamp:performance.now()),t),set:e=>{t=e,queueMicrotask(ea)}};function el(e,t){-1===e.indexOf(t)&&e.push(t)}function eo(e,t){let i=e.indexOf(t);i>-1&&e.splice(i,1)}class eu{constructor(){this.subscriptions=[]}add(e){return el(this.subscriptions,e),()=>eo(this.subscriptions,e)}notify(e,t,i){let n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,i);else for(let r=0;r<n;r++){let n=this.subscriptions[r];n&&n(e,t,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class ec{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{let i=es.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=es.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new eu);let i=this.events[e].add(t);return"change"===e?()=>{i(),et.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return n&&n.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=es.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),i?1e3/i*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ed(e,t){return new ec(e,t)}let eh=e=>!!(e&&e.getVelocity);function em(e,t){let i=e.getValue("willChange");if(eh(i)&&i.add)return i.add(t)}let ep=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ef="data-"+ep("framerAppearId"),eg=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e;function ex(e,t,i,n){return e===t&&i===n?S:r=>0===r||1===r?r:eg(function(e,t,i,n,r){let a,s,l=0;do(a=eg(s=t+(i-t)/2,n,r)-e)>0?i=s:t=s;while(Math.abs(a)>1e-7&&++l<12)return s}(r,0,1,e,i),t,n)}let ev=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ey=e=>t=>1-e(1-t),e_=ex(.33,1.53,.69,.99),eb=ey(e_),ew=ev(eb),ej=e=>(e*=2)<1?.5*eb(e):.5*(2-Math.pow(2,-10*(e-1))),eN=e=>1-Math.sin(Math.acos(e)),eE=ey(eN),eT=ev(eN),eC=(e,t,i)=>i>t?t:i<e?e:i,eA={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},ek={...eA,transform:e=>eC(0,1,e)},eM={...eA,default:1},eI=e=>Math.round(1e5*e)/1e5,eS=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,eO=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,eR=(e,t)=>i=>!!("string"==typeof i&&eO.test(i)&&i.startsWith(e)||t&&null!=i&&Object.prototype.hasOwnProperty.call(i,t)),eP=(e,t,i)=>n=>{if("string"!=typeof n)return n;let[r,a,s,l]=n.match(eS);return{[e]:parseFloat(r),[t]:parseFloat(a),[i]:parseFloat(s),alpha:void 0!==l?parseFloat(l):1}},eD={...eA,transform:e=>Math.round(eC(0,255,e))},eL={test:eR("rgb","red"),parse:eP("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:n=1})=>"rgba("+eD.transform(e)+", "+eD.transform(t)+", "+eD.transform(i)+", "+eI(ek.transform(n))+")"},eF={test:eR("#"),parse:function(e){let t="",i="",n="",r="";return e.length>5?(t=e.substring(1,3),i=e.substring(3,5),n=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),i=e.substring(2,3),n=e.substring(3,4),r=e.substring(4,5),t+=t,i+=i,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(n,16),alph
13a:r?parseInt(r,16)/255:1}},transform:eL.transform},eU=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),eV=eU("deg"),ez=eU("%"),eB=eU("px"),e$=eU("vh"),eH=eU("vw"),eq={...ez,parse:e=>ez.parse(e)/100,transform:e=>ez.transform(100*e)},eW={test:eR("hsl","hue"),parse:eP("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:n=1})=>"hsla("+Math.round(e)+", "+ez.transform(eI(t))+", "+ez.transform(eI(i))+", "+eI(ek.transform(n))+")"},eG={test:e=>eL.test(e)||eF.test(e)||eW.test(e),parse:e=>eL.test(e)?eL.parse(e):eW.test(e)?eW.parse(e):eF.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?eL.transform(e):eW.transform(e)},eY=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,eQ="number",eK="color",eX=/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 eZ(e){let t=e.toString(),i=[],n={color:[],number:[],var:[]},r=[],a=0,s=t.replace(eX,e=>(eG.test(e)?(n.color.push(a),r.push(eK),i.push(eG.parse(e))):e.startsWith("var(")?(n.var.push(a),r.push("var"),i.push(e)):(n.number.push(a),r.push(eQ),i.push(parseFloat(e))),++a,"${}")).split("${}");return{values:i,split:s,indexes:n,types:r}}function eJ(e){return eZ(e).values}function e0(e){let{split:t,types:i}=eZ(e),n=t.length;return e=>{let r="";for(let a=0;a<n;a++)if(r+=t[a],void 0!==e[a]){let t=i[a];t===eQ?r+=eI(e[a]):t===eK?r+=eG.transform(e[a]):r+=e[a]}return r}}let e1=e=>"number"==typeof e?0:e,e2={test:function(e){var t,i;return isNaN(e)&&"string"==typeof e&&((null==(t=e.match(eS))?void 0:t.length)||0)+((null==(i=e.match(eY))?void 0:i.length)||0)>0},parse:eJ,createTransformer:e0,getAnimatableNone:function(e){let t=eJ(e);return e0(e)(t.map(e1))}},e5=new Set(["brightness","contrast","saturate","opacity"]);function e3(e){let[t,i]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[n]=i.match(eS)||[];if(!n)return e;let r=i.replace(n,""),a=+!!e5.has(t);return n!==i&&(a*=100),t+"("+a+r+")"}let e4=/\b([a-z-]*)\(.*?\)/gu,e7={...e2,getAnimatableNone:e=>{let t=e.match(e4);return t?t.map(e3).join(" "):e}},e6={...eA,transform:Math.round},e8={borderWidth:eB,borderTopWidth:eB,borderRightWidth:eB,borderBottomWidth:eB,borderLeftWidth:eB,borderRadius:eB,radius:eB,borderTopLeftRadius:eB,borderTopRightRadius:eB,borderBottomRightRadius:eB,borderBottomLeftRadius:eB,width:eB,maxWidth:eB,height:eB,maxHeight:eB,top:eB,right:eB,bottom:eB,left:eB,padding:eB,paddingTop:eB,paddingRight:eB,paddingBottom:eB,paddingLeft:eB,margin:eB,marginTop:eB,marginRight:eB,marginBottom:eB,marginLeft:eB,backgroundPositionX:eB,backgroundPositionY:eB,rotate:eV,rotateX:eV,rotateY:eV,rotateZ:eV,scale:eM,scaleX:eM,scaleY:eM,scaleZ:eM,skew:eV,skewX:eV,skewY:eV,distance:eB,translateX:eB,translateY:eB,translateZ:eB,x:eB,y:eB,z:eB,perspective:eB,transformPerspective:eB,opacity:ek,originX:eq,originY:eq,originZ:eB,zIndex:e6,size:eB,fillOpacity:ek,strokeOpacity:ek,numOctaves:e6},e9={...e8,color:eG,backgroundColor:eG,outlineColor:eG,fill:eG,stroke:eG,borderColor:eG,borderTopColor:eG,borderRightColor:eG,borderBottomColor:eG,borderLeftColor:eG,filter:e7,WebkitFilter:e7},te=e=>e9[e];function tt(e,t){let i=te(e);return i!==e7&&(i=e2),i.getAnimatableNone?i.getAnimatableNone(t):void 0}let ti=new Set(["auto","none","0"]),tn=e=>e===eA||e===eB,tr=(e,t)=>parseFloat(e.split(", ")[t]),ta=(e,t)=>(i,{transform:n})=>{if("none"===n||!n)return 0;let r=n.match(/^matrix3d\((.+)\)$/u);if(r)return tr(r[1],t);{let t=n.match(/^matrix\((.+)\)$/u);return t?tr(t[1],e):0}},ts=new Set(["x","y","z"]),tl=Q.filter(e=>!ts.has(e)),to={width:({x:e},{paddingLeft:t="0",paddingRight:i="0"})=>e.max-e.min-parseFloat(t)-parseFloat(i),height:({y:e},{paddingTop:t="0",paddingBottom:i="0"})=>e.max-e.min-parseFloat(t)-parseFloat(i),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ta(4,13),y:ta(5,14)};to.translateX=to.x,to.translateY=to.y;let tu=new Set,tc=!1,td=!1;function th(){if(td){let e=Array.from(tu).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),i=new Map;
13t.forEach(e=>{let t,n=(t=[],tl.forEach(i=>{let n=e.getValue(i);void 0!==n&&(t.push([i,n.get()]),n.set(+!!i.startsWith("scale")))}),t);n.length&&(i.set(e,n),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=i.get(e);t&&t.forEach(([t,i])=>{var n;null==(n=e.getValue(t))||n.set(i)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}td=!1,tc=!1,tu.forEach(e=>e.complete()),tu.clear()}function tm(){tu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(td=!0)})}class tp{constructor(e,t,i,n,r,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=n,this.element=r,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(tu.add(this),tc||(tc=!0,et.read(tm),et.resolveKeyframes(th))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:i,motionValue:n}=this;for(let r=0;r<e.length;r++)if(null===e[r])if(0===r){let r=null==n?void 0:n.get(),a=e[e.length-1];if(void 0!==r)e[0]=r;else if(i&&t){let n=i.readValue(t,a);null!=n&&(e[0]=n)}void 0===e[0]&&(e[0]=a),n&&void 0===r&&n.set(e[0])}else e[r]=e[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),tu.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,tu.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let tf=e=>t=>"string"==typeof t&&t.startsWith(e),tg=tf("--"),tx=tf("var(--"),tv=e=>!!tx(e)&&ty.test(e.split("/*")[0].trim()),ty=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,t_=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,tb=e=>t=>t.test(e),tw=[eA,eB,ez,eV,eH,e$,{test:e=>"auto"===e,parse:e=>e}],tj=e=>tw.find(tb(e));class tN extends tp{constructor(e,t,i,n,r){super(e,t,i,n,r,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let i=0;i<e.length;i++){let n=e[i];if("string"==typeof n&&tv(n=n.trim())){let r=function e(t,i,n=1){S(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);let[r,a]=function(e){let t=t_.exec(e);if(!t)return[,];let[,i,n,r]=t;return[`--${null!=i?i:n}`,r]}(t);if(!r)return;let s=window.getComputedStyle(i).getPropertyValue(r);if(s){let e=s.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)?parseFloat(e):e}return tv(a)?e(a,i,n+1):a}(n,t.current);void 0!==r&&(e[i]=r),i===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!X.has(i)||2!==e.length)return;let[n,r]=e,a=tj(n),s=tj(r);if(a!==s)if(tn(a)&&tn(s))for(let t=0;t<e.length;t++){let i=e[t];"string"==typeof i&&(e[t]=parseFloat(i))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,i=[];for(let t=0;t<e.length;t++)(function(e){if("number"==typeof e)return 0===e;if(null===e)return!0;return"none"===e||"0"===e||/^0[^.\s]+$/u.test(e)})(e[t])&&i.push(t);i.length&&function(e,t,i){let n,r=0;for(;r<e.length&&!n;){let t=e[r];"string"==typeof t&&!ti.has(t)&&eZ(t).values.length&&(n=e[r]),r++}if(n&&i)for(let r of t)e[r]=tt(i,n)}(e,i,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=to[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let n=t[t.length-1];void 0!==n&&e.getValue(i,n).jump(n,!1)}measureEndState(){var e;let{element:t,name:i,unresolvedKeyframes:n}=this;if(!t||!t.current)return;let r=t.getValue(i);r&&r.jump(this.measuredOrigin,!1);let a=n.length-1,s=n[a];n[a]=to[i](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),(null==(e=this.removedTransforms)?void 0:e.length)&&this.removedTransforms.forEac
13h(([e,i])=>{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}let tE=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(e2.test(e)||"0"===e)&&!e.startsWith("url(")),tT=e=>null!==e;function tC(e,{repeat:t,repeatType:i="loop"},n){let r=e.filter(tT),a=t&&"loop"!==i&&t%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class tA{constructor({autoplay:e=!0,delay:t=0,type:i="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:a="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=es.now(),this.options={autoplay:e,delay:t,type:i,repeat:n,repeatDelay:r,repeatType:a,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(tm(),th()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=es.now(),this.hasAttemptedResolve=!0;let{name:i,type:n,velocity:r,delay:a,onComplete:s,onUpdate:l,isGenerator:o}=this.options;if(!o&&!function(e,t,i,n){let r=e[0];if(null===r)return!1;if("display"===t||"visibility"===t)return!0;let a=e[e.length-1],s=tE(r,t),l=tE(a,t);return S(s===l,`You are trying to animate ${t} from "${r}" to "${a}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${a} via the \`style\` property.`),!!s&&!!l&&(function(e){let t=e[0];if(1===e.length)return!0;for(let i=0;i<e.length;i++)if(e[i]!==t)return!0}(e)||("spring"===i||Y(i))&&n)}(e,i,n,r))if(a)this.options.duration=0;else{l&&l(tC(e,this.options,t)),s&&s(),this.resolveFinishedPromise();return}let u=this.initPlayback(e,t);!1!==u&&(this._resolved={keyframes:e,finalKeyframe:t,...u},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}let tk=(e,t,i)=>e+(t-e)*i;function tM(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function tI(e,t){return i=>i>0?t:e}let tS=(e,t,i)=>{let n=e*e,r=i*(t*t-n)+n;return r<0?0:Math.sqrt(r)},tO=[eF,eL,eW];function tR(e){let t=tO.find(t=>t.test(e));if(S(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let i=t.parse(e);return t===eW&&(i=function({hue:e,saturation:t,lightness:i,alpha:n}){e/=360,i/=100;let r=0,a=0,s=0;if(t/=100){let n=i<.5?i*(1+t):i+t-i*t,l=2*i-n;r=tM(l,n,e+1/3),a=tM(l,n,e),s=tM(l,n,e-1/3)}else r=a=s=i;return{red:Math.round(255*r),green:Math.round(255*a),blue:Math.round(255*s),alpha:n}}(i)),i}let tP=(e,t)=>{let i=tR(e),n=tR(t);if(!i||!n)return tI(e,t);let r={...i};return e=>(r.red=tS(i.red,n.red,e),r.green=tS(i.green,n.green,e),r.blue=tS(i.blue,n.blue,e),r.alpha=tk(i.alpha,n.alpha,e),eL.transform(r))},tD=(e,t)=>i=>t(e(i)),tL=(...e)=>e.reduce(tD),tF=new Set(["none","hidden"]);function tU(e,t){return i=>tk(e,t,i)}function tV(e){return"number"==typeof e?tU:"string"==typeof e?tv(e)?tI:eG.test(e)?tP:t$:Array.isArray(e)?tz:"object"==typeof e?eG.test(e)?tP:tB:tI}function tz(e,t){let i=[...e],n=i.length,r=e.map((e,i)=>tV(e)(e,t[i]));return e=>{for(let t=0;t<n;t++)i[t]=r[t](e);return i}}function tB(e,t){let i={...e,...t},n={};for(let r in i)void 0!==e[r]&&void 0!==t[r]&&(n[r]=tV(e[r])(e[r],t[r]));return e=>{for(let t in n)i[t]=n[t](e);return i}}let t$=(e,t)=>{let i=e2.createTransformer(t),n=eZ(e),r=eZ(t);if(!(n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length))return S(!0,`Complex values '${e}' and '${t}' 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.`),tI(e,t);if(tF.has(e)&&!r.values.length||tF.has(t)&&!n.values.length)return tF.has(e)?i=>i<=0?e:t:i=>i>=1?t:e;return tL(tz(function(e,t){var i;let n=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){let s=t.types[a],l=e.indexes[s][r[s]],o=null!=(i=e.values[l])?i:0;n[a]=o,r[s]++}
13return n}(n,r),r.values),i)};function tH(e,t,i){return"number"==typeof e&&"number"==typeof t&&"number"==typeof i?tk(e,t,i):tV(e)(e,t)}function tq(e,t,i){var n,r;let a=Math.max(t-5,0);return n=i-e(a),(r=t-a)?1e3/r*n:0}let tW=.01,tG=2,tY=.005,tQ=.5;function tK(e,t){return e*Math.sqrt(1-t*t)}let tX=["duration","bounce"],tZ=["stiffness","damping","mass"];function tJ(e,t){return t.some(t=>void 0!==e[t])}function t0(e=.3,t=.3){let i,n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:r,restDelta:a}=n,s=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],o={done:!1,value:s},{stiffness:u,damping:c,mass:d,duration:h,velocity:m,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!tJ(e,tZ)&&tJ(e,tX))if(e.visualDuration){let i=2*Math.PI/(1.2*e.visualDuration),n=i*i,r=2*eC(.05,1,1-(e.bounce||0))*Math.sqrt(n);t={...t,mass:1,stiffness:n,damping:r}}else{let i=function({duration:e=800,bounce:t=.3,velocity:i=0,mass:n=1}){let r,a;S(e<=L(10));let s=1-t;s=eC(.05,1,s),e=eC(.01,10,e/1e3),s<1?(r=t=>{let n=t*s,r=n*e;return .001-(n-i)/tK(t,s)*Math.exp(-r)},a=t=>{let n=t*s*e,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-n),o=tK(Math.pow(t,2),s);return(n*i+i-a)*l*(-r(t)+.001>0?-1:1)/o}):(r=t=>-.001+Math.exp(-t*e)*((t-i)*e+1),a=t=>e*e*(i-t)*Math.exp(-t*e));let l=function(e,t,i){let n=i;for(let i=1;i<12;i++)n-=e(n)/t(n);return n}(r,a,5/e);if(e=L(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(l,2)*n;return{stiffness:t,damping:2*s*Math.sqrt(n*t),duration:e}}}(e);(t={...t,...i,mass:1}).isResolvedFromDuration=!0}return t}({...n,velocity:-((n.velocity||0)/1e3)}),f=m||0,g=c/(2*Math.sqrt(u*d)),x=l-s,v=Math.sqrt(u/d)/1e3,y=5>Math.abs(x);if(r||(r=y?tW:tG),a||(a=y?tY:tQ),g<1){let e=tK(v,g);i=t=>l-Math.exp(-g*v*t)*((f+g*v*x)/e*Math.sin(e*t)+x*Math.cos(e*t))}else if(1===g)i=e=>l-Math.exp(-v*e)*(x+(f+v*x)*e);else{let e=v*Math.sqrt(g*g-1);i=t=>{let i=Math.exp(-g*v*t),n=Math.min(e*t,300);return l-i*((f+g*v*x)*Math.sinh(n)+e*x*Math.cosh(n))/e}}let _={calculatedDuration:p&&h||null,next:e=>{let t=i(e);if(p)o.done=e>=h;else{let n=0;g<1&&(n=0===e?L(f):tq(i,e,t));let s=Math.abs(l-t)<=a;o.done=Math.abs(n)<=r&&s}return o.value=o.done?l:t,o},toString:()=>{let e=Math.min(F(_),2e4),t=H(t=>_.next(e*t).value,e,30);return e+"ms "+t}};return _}function t1({keyframes:e,velocity:t=0,power:i=.8,timeConstant:n=325,bounceDamping:r=10,bounceStiffness:a=500,modifyTarget:s,min:l,max:o,restDelta:u=.5,restSpeed:c}){let d,h,m=e[0],p={done:!1,value:m},f=i*t,g=m+f,x=void 0===s?g:s(g);x!==g&&(f=x-m);let v=e=>-f*Math.exp(-e/n),y=e=>x+v(e),_=e=>{let t=v(e),i=y(e);p.done=Math.abs(t)<=u,p.value=p.done?x:i},b=e=>{let t;if(t=p.value,void 0!==l&&t<l||void 0!==o&&t>o){var i;d=e,h=t0({keyframes:[p.value,(i=p.value,void 0===l?o:void 0===o||Math.abs(l-i)<Math.abs(o-i)?l:o)],velocity:tq(y,e,p.value),damping:r,stiffness:a,restDelta:u,restSpeed:c})}};return b(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==d||(t=!0,_(e),b(e)),void 0!==d&&e>=d)?h.next(e-d):(t||_(e),p)}}}let t2=ex(.42,0,1,1),t5=ex(0,0,.58,1),t3=ex(.42,0,.58,1),t4={linear:S,easeIn:t2,easeInOut:t3,easeOut:t5,circIn:eN,circInOut:eT,circOut:eE,backIn:eb,backInOut:ew,backOut:e_,anticipate:ej},t7=e=>{if(V(e)){S(4===e.length);let[t,i,n,r]=e;return ex(t,i,n,r)}return"string"==typeof e?(S(void 0!==t4[e],`Invalid easing type '${e}'`),t4[e]):e};function t6({duration:e=300,keyframes:t,times:i,ease:n="easeInOut"}){var r;let a,s=Array.isArray(n)&&"number"!=typeof n[0]?n.map(t7):t7(n),l={done:!1,value:t[0]},o=function(e,t,{clamp:i=!0,ease:n,mixer:r}={}){let a=e.length;if(S(a===t.length),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let l=function(e,t,i){let n=[],r=i||tH,a=e.length-1;for(let i=0;i<a;i++){let a=r(e[i],e[i+1]);t&&(a=tL(Array.isArray(t)?t[i]||S:t,a)),n.push(a)}return n}(t,n,r),o=l.length,u=i=>{if(s&&i<e[0])return t[0];let n=0;if(o>1)for(;n<e.length-2&&!(i<e[n+1]);n++);let r=$(e[n],e[n+1],i);return l[n](r)};return i?t=>u(eC(e[0],e[a-1],t)):u}
13((r=i&&i.length===t.length?i:(!function(e,t){let i=e[e.length-1];for(let n=1;n<=t;n++){let r=$(0,t,n);e.push(tk(i,1,r))}}(a=[0],t.length-1),a),r.map(t=>t*e)),t,{ease:Array.isArray(s)?s:t.map(()=>s||t3).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(l.value=o(t),l.done=t>=e,l)}}let t8=e=>{let t=({timestamp:t})=>e(t);return{start:()=>et.update(t,!0),stop:()=>ei(t),now:()=>en.isProcessing?en.timestamp:es.now()}},t9={decay:t1,inertia:t1,tween:t6,keyframes:t6,spring:t0},ie=e=>e/100;class it extends tA{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();let{onStop:e}=this.options;e&&e()};const{name:t,motionValue:i,element:n,keyframes:r}=this.options,a=(null==n?void 0:n.KeyframeResolver)||tp,s=(e,t)=>this.onKeyframesResolved(e,t);this.resolver=new a(r,s,t,i,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){let t,i,{type:n="keyframes",repeat:r=0,repeatDelay:a=0,repeatType:s,velocity:l=0}=this.options,o=Y(n)?n:t9[n]||t6;o!==t6&&"number"!=typeof e[0]&&(t=tL(ie,tH(e[0],e[1])),e=[0,100]);let u=o({...this.options,keyframes:e});"mirror"===s&&(i=o({...this.options,keyframes:[...e].reverse(),velocity:-l})),null===u.calculatedDuration&&(u.calculatedDuration=F(u));let{calculatedDuration:c}=u,d=c+a;return{generator:u,mirroredGenerator:i,mapPercentToKeyframes:t,calculatedDuration:c,resolvedDuration:d,totalDuration:d*(r+1)-a}}onPostResolved(){let{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){let{resolved:i}=this;if(!i){let{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}let{finalKeyframe:n,generator:r,mirroredGenerator:a,mapPercentToKeyframes:s,keyframes:l,calculatedDuration:o,totalDuration:u,resolvedDuration:c}=i;if(null===this.startTime)return r.next(0);let{delay:d,repeat:h,repeatType:m,repeatDelay:p,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;let g=this.currentTime-d*(this.speed>=0?1:-1),x=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let v=this.currentTime,y=r;if(h){let e=Math.min(this.currentTime,u)/c,t=Math.floor(e),i=e%1;!i&&e>=1&&(i=1),1===i&&t--,(t=Math.min(t,h+1))%2&&("reverse"===m?(i=1-i,p&&(i-=p/c)):"mirror"===m&&(y=a)),v=eC(0,1,i)*c}let _=x?{done:!1,value:l[0]}:y.next(v);s&&(_.value=s(_.value));let{done:b}=_;x||null===o||(b=this.speed>=0?this.currentTime>=u:this.currentTime<=0);let w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return w&&void 0!==n&&(_.value=tC(l,this.options,n)),f&&f(_.value),w&&this.finish(),_}get duration(){let{resolved:e}=this;return e?e.calculatedDuration/1e3:0}get time(){return this.currentTime/1e3}set time(e){e=L(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=this.currentTime/1e3)}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:e=t8,onPlay:t,startTime:i}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();let n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=null!=i?i:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=null!=(e=this.currentTime)?e:0}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedProm
13ise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}let ii=new Set(["opacity","clipPath","filter","transform"]),ir=O(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ia={anticipate:ej,backInOut:ew,circInOut:eT};class is extends tA{constructor(e){super(e);const{name:t,motionValue:i,element:n,keyframes:r}=this.options;this.resolver=new tN(r,(e,t)=>this.onKeyframesResolved(e,t),t,i,n),this.resolver.scheduleResolve()}initPlayback(e,t){var i;let{duration:n=300,times:r,ease:a,type:s,motionValue:l,name:o,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if("string"==typeof a&&B()&&a in ia&&(a=ia[a]),Y((i=this.options).type)||"spring"===i.type||!function e(t){return!!("function"==typeof t&&B()||!t||"string"==typeof t&&(t in W||B())||V(t)||Array.isArray(t)&&t.every(e))}(i.ease)){let{onComplete:t,onUpdate:i,motionValue:l,element:o,...u}=this.options,c=function(e,t){let i=new it({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),n={done:!1,value:e[0]},r=[],a=0;for(;!n.done&&a<2e4;)r.push((n=i.sample(a)).value),a+=10;return{times:void 0,keyframes:r,duration:a-10,ease:"linear"}}(e,u);1===(e=c.keyframes).length&&(e[1]=e[0]),n=c.duration,r=c.times,a=c.ease,s="keyframes"}let c=function(e,t,i,{delay:n=0,duration:r=300,repeat:a=0,repeatType:s="loop",ease:l="easeInOut",times:o}={}){let u={[t]:i};o&&(u.offset=o);let c=function e(t,i){if(t)return"function"==typeof t&&B()?H(t,i):V(t)?q(t):Array.isArray(t)?t.map(t=>e(t,i)||W.easeOut):W[t]}(l,r);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:n,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:"reverse"===s?"alternate":"normal"})}(l.owner.current,o,e,{...this.options,duration:n,times:r,ease:a});return c.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(U(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{let{onComplete:i}=this.options;l.set(tC(e,this.options,t)),i&&i(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:r,type:s,ease:a,keyframes:e}}get duration(){let{resolved:e}=this;if(!e)return 0;let{duration:t}=e;return t/1e3}get time(){let{resolved:e}=this;if(!e)return 0;let{animation:t}=e;return(t.currentTime||0)/1e3}set time(e){let{resolved:t}=this;if(!t)return;let{animation:i}=t;i.currentTime=L(e)}get speed(){let{resolved:e}=this;if(!e)return 1;let{animation:t}=e;return t.playbackRate}set speed(e){let{resolved:t}=this;if(!t)return;let{animation:i}=t;i.playbackRate=e}get state(){let{resolved:e}=this;if(!e)return"idle";let{animation:t}=e;return t.playState}get startTime(){let{resolved:e}=this;if(!e)return null;let{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){let{resolved:t}=this;if(!t)return S;let{animation:i}=t;U(i,e)}else this.pendingTimeline=e;return S}play(){if(this.isStopped)return;let{resolved:e}=this;if(!e)return;let{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){let{resolved:e}=this;if(!e)return;let{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:e}=this;if(!e)return;let{animation:t,keyframes:i,duration:n,type:r,ease:a,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){let{motionValue:e,onUpdate:t,onComplete:l,element:o,...u}=this.options,c=new it({...u,keyframes:i,duration:n,type:r,ease:a,times:s,isGenerator:!0}),d=L(this.time);e.setWithVelocity(c.sample(d-10).value,c.sample(d).value,10)}let{onStop:l}=this.options;l&&l(),this.cancel()}complete(){let{resolved:e}=this;e&&e.animation.finish()}cancel(){let{resolved:e}=this;e&&e.animation.cancel()}static supports(e){let{motionValue:t,name:i,repeatDelay:n,repeatType:r,damping:a,type:s}=e;if(!t||!t.owner||!(t.owner.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:o}=t.owner.getProps();return ir()&&i&&ii.has(i)&&!l&&!o&&!n&&"mirror"!==r&&0!==a&&"inertia"!==s}}let il={type:"spring",stiffness:500,damping:25,restSpeed:10},io={type:"keyframes",duration:.8},iu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ic=(e,t,i,n={},r,a)=>s=>{let l=G(n,e)||{},o=l.delay||n.delay||0,{elapsed:u=0}=n;u-=L(o);let c={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{s(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:r};!function({when:e,delay:t,delayChildren:i,staggerChildren:n,staggerDirection:r,repeat:a,repeatType:s,repeatDelay:l,from:o,elapsed:u,...c}){return!!Object.keys(c).length}(l)&&(c={...c,...((e,{keyframes:t})=>t.length>2?io:K.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:il:iu)(e,c)}),c.duration&&(c.duration=L(c.duration)),c.repeatDelay&&(c.repeatDelay=L(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if(!1!==c.type&&(0!==c.duration||c.repeatDelay)||(c.duration=0,0===c.delay&&(d=!0)),d&&!a&&void 0!==t.get()){let e=tC(c.keyframes,l);if(void 0!==e)return et.update(()=>{c.onUpdate(e),c.onComplete()}),new D([])}return!a&&is.supports(c)?new is(c):new it(c)};function id(e,t,{delay:i=0,transitionOverride:n,type:r}={}){var a;let{transition:s=e.getDefaultTransition(),transitionEnd:l,...o}=t;n&&(s=n);let u=[],c=r&&e.animationState&&e.animationState.getState()[r];for(let t in o){let n=e.getValue(t,null!=(a=e.latestValues[t])?a:null),r=o[t];if(void 0===r||c&&function({protectedKeys:e,needsAnimating:t},i){let n=e.hasOwnProperty(i)&&!0!==t[i];return t[i]=!1,n}(c,t))continue;let l={delay:i,...G(s||{},t)},d=!1;if(window.MotionHandoffAnimation){let i=e.props[ef];if(i){let e=window.MotionHandoffAnimation(i,t,et);null!==e&&(l.startTime=e,d=!0)}}em(e,t),n.start(ic(t,n,r,e.shouldReduceMotion&&X.has(t)?{type:!1}:l,e,d));let h=n.animation;h&&u.push(h)}return l&&Promise.all(u).then(()=>{et.update(()=>{l&&function(e,t){let{transitionEnd:i={},transition:n={},...r}=k(e,t)||{};for(let t in r={...r,...i}){let i=Z(r[t]);e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,ed(i))}}(e,l)})}),u}function ih(e,t,i={}){var n;let r=k(e,t,"exit"===i.type?null==(n=e.presenceContext)?void 0:n.custom:void 0),{transition:a=e.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(a=i.transitionOverride);let s=r?()=>Promise.all(id(e,r,i)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(n=0)=>{let{delayChildren:r=0,staggerChildren:s,staggerDirection:l}=a;return function(e,t,i=0,n=0,r=1,a){let s=[],l=(e.variantChildren.size-1)*n,o=1===r?(e=0)=>e*n:(e=0)=>
13l-e*n;return Array.from(e.variantChildren).sort(im).forEach((e,n)=>{e.notify("AnimationStart",t),s.push(ih(e,t,{...a,delay:i+o(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(s)}(e,t,r+n,s,l,i)}:()=>Promise.resolve(),{when:o}=a;if(!o)return Promise.all([s(),l(i.delay)]);{let[e,t]="beforeChildren"===o?[s,l]:[l,s];return e().then(()=>t())}}function im(e,t){return e.sortNodePosition(t)}let ip=I.length,ig=[...M].reverse(),ix=M.length;function iv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iy(){return{animate:iv(!0),whileInView:iv(),whileHover:iv(),whileTap:iv(),whileDrag:iv(),whileFocus:iv(),exit:iv()}}class i_{constructor(e){this.isMounted=!1,this.node=e}update(){}}let ib=0,iw={x:!1,y:!1},ij=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function iN(e,t,i,n={passive:!0}){return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i)}function iE(e){return{point:{x:e.pageX,y:e.pageY}}}function iT(e,t,i,n){return iN(e,t,e=>ij(e)&&i(e,iE(e)),n)}let iC=(e,t)=>Math.abs(e-t);class iA{constructor(e,t,{transformPagePoint:i,contextWindow:n,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let i=iI(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,r=(e=i.offset,t={x:0,y:0},Math.sqrt(iC(e.x,t.x)**2+iC(e.y,t.y)**2)>=3);if(!n&&!r)return;let{point:a}=i,{timestamp:s}=en;this.history.push({...a,timestamp:s});let{onStart:l,onMove:o}=this.handlers;n||(l&&l(this.lastMoveEvent,i),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,i)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=ik(t,this.transformPagePoint),et.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:i,onSessionEnd:n,resumeAnimation:r}=this.handlers;if(this.dragSnapToOrigin&&r&&r(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=iI("pointercancel"===e.type?this.lastMoveEventInfo:ik(t,this.transformPagePoint),this.history);this.startEvent&&i&&i(e,a),n&&n(e,a)},!ij(e))return;this.dragSnapToOrigin=r,this.handlers=t,this.transformPagePoint=i,this.contextWindow=n||window;const a=ik(iE(e),this.transformPagePoint),{point:s}=a,{timestamp:l}=en;this.history=[{...s,timestamp:l}];const{onSessionStart:o}=t;o&&o(e,iI(a,this.history)),this.removeListeners=tL(iT(this.contextWindow,"pointermove",this.handlePointerMove),iT(this.contextWindow,"pointerup",this.handlePointerUp),iT(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ei(this.updatePoint)}}function ik(e,t){return t?{point:t(e.point)}:e}function iM(e,t){return{x:e.x-t.x,y:e.y-t.y}}function iI({point:e},t){return{point:e,delta:iM(e,iS(t)),offset:iM(e,t[0]),velocity:function(e){if(e.length<2)return{x:0,y:0};let t=e.length-1,i=null,n=iS(e);for(;t>=0&&(i=e[t],!(n.timestamp-i.timestamp>L(.1)));)t--;if(!i)return{x:0,y:0};let r=(n.timestamp-i.timestamp)/1e3;if(0===r)return{x:0,y:0};let a={x:(n.x-i.x)/r,y:(n.y-i.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}(t)}}function iS(e){return e[e.length-1]}function iO(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function iR(e){return e.max-e.min}function iP(e,t,i,n=.5){e.origin=n,e.originPoint=tk(t.min,t.max,e.origin),e.scale=iR(i)/iR(t),e.translate=tk(i.min,i.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function iD(e,t,i,n){iP(e.x,t.x,i.x,n?n.originX:void 0),iP(e.y,t.y,i.y,n?n.originY:void 0)}function iL(e,t,i){e.min=i.min+t.min,e.max=e.min+iR(t)}function iF(e,t,i){e.min=t.min-i.min,e.max=e.min+iR(t)}function iU(e,t,i){iF(e.x,t.x,i.x),iF(e.y,t.y,i.y)}function iV(e,t,i){return{min:void 0!==t?e.min+t:void 0,max:void 0!==i?e.max+i-(e.max-e.min):void 0}}function iz(e,t){let i=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([i,n]=[n,i]),{min:i,max:n}}function iB(e,t,i){return{min:i$(e,t),max:i$(e,i)}}function i$(e,t){return"number"==typeof e?e:e[t]||0}let iH=()=>({translate:0,scale:1,origin:0,originPoint:0}),iq=()=>({x:iH(),y:iH()}),iW=()=>({min:0,max:0}),iG=()=>({x:iW(),y:iW()});function iY(e){return[e("x"),e("y")]}function iQ({top:e,left:t,right:i,bottom:n}){return{x:{min:t,max:i},y:{min:e,max:n}}}function iK(e){return void 0===e||1===e}function iX({scale:e,scaleX:t,scaleY:i}){return!iK(e)||!iK(t)||!iK(i)}function iZ(e){return iX(e)||iJ(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function iJ(e){var t,i;return(t=e.x)&&"0%"!==t||(i=e.y)&&"0%"!==i}function i0(e,t,i,n,r){return void 0!==r&&(e=n+r*(e-n)),n+i*(e-n)+t}function i1(e,t=0,i=1,n,r){e.min=i0(e.min,t,i,n,r),e.max=i0(e.max,t,i,n,r)}function i2(e,{x:t,y:i}){i1(e.x,t.translate,t.scale,t.originPoint),i1(e.y,i.translate,i.scale,i.originPoint)}function i5(e,t){e.min=e.min+t,e.max=e.max+t}function i3(e,t,i,n,r=.5){let a=tk(e.min,e.max,r);i1(e,t,i,a,n)}function i4(e,t){i3(e.x,t.x,t.scaleX,t.scale,t.originX),i3(e.y,t.y,t.scaleY,t.scale,t.originY)}function i7(e,t){return iQ(function(e,t){if(!t)return e;let i=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}let i6=({current:e})=>e?e.ownerDocument.defaultView:null,i8=new WeakMap;class i9{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=iG(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){let{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let n=e=>{let{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(iE(e).point)},r=(e,t)=>{let{drag:i,dragPropagation:n,onDragStart:r}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"
13y"===e)if(iw[e])return null;else return iw[e]=!0,()=>{iw[e]=!1};return iw.x||iw.y?null:(iw.x=iw.y=!0,()=>{iw.x=iw.y=!1})}(i),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),iY(e=>{let t=this.getAxisMotionValue(e).get()||0;if(ez.test(t)){let{projection:i}=this.visualElement;if(i&&i.layout){let n=i.layout.layoutBox[e];n&&(t=iR(n)*(parseFloat(t)/100))}}this.originPoint[e]=t}),r&&et.postRender(()=>r(e,t)),em(this.visualElement,"transform");let{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},a=(e,t)=>{let{dragPropagation:i,dragDirectionLock:n,onDirectionLock:r,onDrag:a}=this.getProps();if(!i&&!this.openDragLock)return;let{offset:s}=t;if(n&&null===this.currentDirection){this.currentDirection=function(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}(s),null!==this.currentDirection&&r&&r(this.currentDirection);return}this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),a&&a(e,t)},s=(e,t)=>this.stop(e,t),l=()=>iY(e=>{var t;return"paused"===this.getAnimationState(e)&&(null==(t=this.getAxisMotionValue(e).animation)?void 0:t.play())}),{dragSnapToOrigin:o}=this.getProps();this.panSession=new iA(e,{onSessionStart:n,onStart:r,onMove:a,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,contextWindow:i6(this.visualElement)})}stop(e,t){let i=this.isDragging;if(this.cancel(),!i)return;let{velocity:n}=t;this.startAnimation(n);let{onDragEnd:r}=this.getProps();r&&et.postRender(()=>r(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){let{drag:n}=this.getProps();if(!i||!ne(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),a=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:i},n){return void 0!==t&&e<t?e=n?tk(t,e,n.min):Math.max(e,t):void 0!==i&&e>i&&(e=n?tk(i,e,n.max):Math.min(e,i)),e}(a,this.constraints[e],this.elastic[e])),r.set(a)}resolveConstraints(){var e;let{dragConstraints:t,dragElastic:i}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null==(e=this.visualElement.projection)?void 0:e.layout,r=this.constraints;t&&iO(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=function(e,{top:t,left:i,bottom:n,right:r}){return{x:iV(e.x,i,r),y:iV(e.y,t,n)}}(n.layoutBox,t):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:iB(e,"left","right"),y:iB(e,"top","bottom")}}(i),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&iY(e=>{var t,i;let r;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=n.layoutBox[e],i=this.constraints[e],r={},void 0!==i.min&&(r.min=i.min-t.min),void 0!==i.max&&(r.max=i.max-t.min),r))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!iO(t))return!1;let n=t.current;S(null!==n);let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let a=function(e,t,i){let n=i7(e,i),{scroll:r}=t;return r&&(i5(n.x,r.offset.x),i5(n.y,r.offset.y)),n}(n,r.root,this.visualElement.getTransformPagePoint()),s=(e=r.layout.layoutBox,{x:iz(e.x,a.x),y:iz(e.y,a.y)});if(i){let e=i(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(s));this.hasMutatedConstraints=!!e,e&&(s=iQ(e))}return s}startAnimation(e){let{drag:t,dragMomentum:i,dragElastic:n,dragTransition:r,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{};return Promise.all(iY(s=>{if(!ne(s,t,this.currentDirection))return;let o=l&&l[s]||{};a&&(o={min:0,max:0});let u={type:"inertia",velocity:i?e[s]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...r,...o};return this.startAxisValueAnimation(s,u)})).then(s)}startAxisValueAnimation(e,t){let i=this.getAxisMotionValue(e);return em(this.visualElement,e),i.start(ic(e,i,0,t,this.visualElement,!1))}stopAnimation(){iY(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){iY(e=>{var t;return null==(t=this.getAxisMotionValue(e).animation)?void 0:t.pause()})}getAnimationState(e){var t;return null==(t=this.getAxisMotionValue(e).animation)?void 0:t.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps();return i[t]||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){iY(t=>{let{drag:i}=this.getProps();if(!ne(t,i,this.currentDirection))return;let{projection:n}=this.visualElement,r=this.getAxisMotionValue(t);if(n&&n.layout){let{min:i,max:a}=n.layout.layoutBox[t];r.set(e[t]-tk(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!iO(t)||!i||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};iY(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var i,r;let a,s,l,o=t.get();n[e]=(i={min:o,max:o},r=this.constraints[e],a=.5,s=iR(i),(l=iR(r))>s?a=$(r.min,r.max-s,i.min):s>
13l&&(a=$(i.min,i.max-l,r.min)),eC(0,1,a))}});let{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),iY(t=>{if(!ne(t,e,null))return;let i=this.getAxisMotionValue(t),{min:r,max:a}=this.constraints[t];i.set(tk(r,a,n[t]))})}addListeners(){if(!this.visualElement.current)return;i8.set(this.visualElement,this);let e=iT(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:i=!0}=this.getProps();t&&i&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();iO(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,n=i.addEventListener("measure",t);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),et.read(t);let r=iN(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(iY(t=>{let i=this.getAxisMotionValue(t);i&&(this.originPoint[t]+=e[t].translate,i.set(i.get()+e[t].translate))}),this.visualElement.render())});return()=>{r(),e(),n(),a&&a()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:r=!1,dragElastic:a=.35,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:n,dragConstraints:r,dragElastic:a,dragMomentum:s}}}function ne(e,t,i){return(!0===t||t===e)&&(null===i||i===e)}let nt=e=>(t,i)=>{e&&et.postRender(()=>e(t,i))};var ni=o;let nn=(0,o.createContext)({}),nr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function na(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let ns={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!eB.test(e))return e;else e=parseFloat(e);let i=na(e,t.target.x),n=na(e,t.target.y);return`${i}% ${n}%`}},nl={},{schedule:no,cancel:nu}=ee(queueMicrotask,!1);class nc extends ni.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:n}=this.props,{projection:r}=e;Object.assign(nl,nh),r&&(t.group&&t.group.add(r),i&&i.register&&n&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),nr.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:i,drag:n,isPresent:r}=this.props,a=i.projection;return a&&(a.isPresent=r,n||e.layoutDependency!==t||void 0===t?a.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?a.promote():a.relegate()||et.postRender(()=>{let e=a.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),no.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function nd(e){let[t,i]=v(),n=(0,ni.useContext)(u);return(0,l.jsx)(nc,{...e,layoutGroup:n,switchLayoutGroup:(0,ni.useContext)(nn),isPresent:t,safeToRemove:i})}let nh={borderRadius:{...ns,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ns,borderTopRightRadius:ns,borderBottomLeftRadius:ns,borderBottomRightRadius:ns,boxShadow:{correct:(e,{treeScale:t,projectionDelta:i})=>{let n=e2.parse(e);if(n.length>5)return e;let r=e2.createTransformer(e),a=+("number"!=typeof n[0]),s=i.x.scale*t.x,l=i.y.scale*t.y;n[0+a]/=s,n[1+a]/=l;let o=tk(s,l,.5);return"number"==typeof n[2+a]&&(n[2+a]/=o),"number"==typeof n[3+a]&&(n[3+a]/=o),r(n)}}},nm=(e,t)=>e.depth-t.depth;class np{constructor(){this.children=[],this.isDirty=!1}add(e){el(this.children,e),this.isDirty=!0}remove(e){eo(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(nm),this.isDirty=!1,this.children.forEach(e)}}function nf(e){let t=eh(e)?e.get():e;return t&&"object"==typeof t&&t.mix&&t.toValue?t.toValue():t}let ng=["TopLeft","TopRight","BottomLeft","BottomRight"],nx=ng.length,nv=e=>"string"==typeof e?parseFloat(e):e,ny=e=>"number"==typeof e||eB.test(e);function n_(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let nb=nj(0,.5,eE),nw=nj(.5,.95,S);function nj(e,t,i){return n=>n<e?0:n>t?1:i($(e,t,n))}function nN(e,t){e.min=t.min,e.max=t.max}function nE(e,t){nN(e.x,t.x),nN(e.y,t.y)}function nT(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function nC(e,t,i,n,r){return e-=t,e=n+1/i*(e-n),void 0!==r&&(e=n+1/r*(e-n)),e}function nA(e,t,[i,n,r],a,s){!function(e,t=0,i=1,n=.5,r,a=e,s=e){if(ez.test(t)&&(t=parseFloat(t),t=tk(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let l=tk(a.min,a.max,n);e===a&&(l-=t),e.min=nC(e.min,t,i,l,r),e.max=nC(e.max,t,i,l,r)}(e,t[i],t[n],t[r],t.scale,a,s)}let nk=["x","scaleX","originX"],nM=["y","scaleY","originY"];function nI(e,t,i,n){nA(e.x,t,nk,i?i.x:void 0,n?n.x:void 0),nA(e.y,t,nM,i?i.y:void 0,n?n.y:void 0)}function nS(e){return 0===e.translate&&1===e.scale}function nO(e){return nS(e.x)&&nS(e.y)}function nR(e,t){return e.min===t.min&&e.max===t.max}function nP(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function nD(e,t){return nP(e.x,t.x)&&nP(e.y,t.y)}function nL(e){return iR(e.x)/iR(e.y)}function nF(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class nU{constructor(){this.members=[]}add(e){el(this.members,e),e.scheduleRender()}remove(e){if(eo(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t,i=this.members.findIndex(t=>e===t);if(0===i)return!1;for(let e=i;e>=0;e--){let i=this.members[e];if(!1!==i.isPresent){t=i;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:n}=e.options;!1===n&&i.hide()}}
13exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let nV={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},nz="u">typeof window&&void 0!==window.MotionDebug,nB=["","X","Y","Z"],n$={visibility:"hidden"},nH=0;function nq(e,t,i,n){let{latestValues:r}=t;r[e]&&(i[e]=r[e],t.setStaticValue(e,0),n&&(n[e]=0))}function nW({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:n,resetTransform:r}){return class{constructor(e={},i=null==t?void 0:t()){this.id=nH++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,nz&&(nV.totalNodes=nV.resolvedTargetDeltas=nV.recalculatedProjection=0),this.nodes.forEach(nQ),this.nodes.forEach(n2),this.nodes.forEach(n5),this.nodes.forEach(nK),nz&&window.MotionDebug.record(nV)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new np)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new eu),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let i=this.eventHandlers.get(e);i&&i.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=t instanceof SVGElement&&"svg"!==t.tagName,this.instance=t;let{layoutId:n,layout:r,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(r||n)&&(this.isLayoutDirty=!0),e){let i,n=()=>this.root.updateBlockedByResize=!1;e(t,()=>{let e,t;this.root.updateBlockedByResize=!0,i&&i(),e=es.now(),t=({timestamp:i})=>{let r=i-e;r>=250&&(ei(t),n())},et.read(t,!0),i=()=>ei(t),nr.hasAnimatedSinceResize&&(nr.hasAnimatedSinceResize=!1,this.nodes.forEach(n1))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||r)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let r=this.options.transition||a.getDefaultTransition()||n9,{onLayoutAnimationStart:s,onLayoutAnimationComplete:l}=a.getProps(),o=!this.targetLayout||!nD(this.targetLayout,n)||i,u=!t&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||t&&(o||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,u);let t={...G(r,"layout"),onPlay:s,onComplete:l};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||n1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ei(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.forEac
13h(n3),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:i}=t.options;if(!i)return;let n=i.props[ef];if(window.MotionHasOptimisedAnimation(n,"transform")){let{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",et,!(e||i))}let{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&e(r)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:i}=this.options;if(void 0===t&&!i)return;let n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(nZ);return}this.isUpdating||this.nodes.forEach(nJ),this.isUpdating=!1,this.nodes.forEach(n0),this.nodes.forEach(nG),this.nodes.forEach(nY),this.clearAllSnapshots();let e=es.now();en.delta=eC(0,1e3/60,e-en.timestamp),en.timestamp=e,en.isProcessing=!0,er.update.process(en),er.preRender.process(en),er.render.process(en),en.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,no.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(nX),this.sharedNodes.forEach(n4)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,et.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){et.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected=iG(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){let t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!r)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!nO(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,a=n!==this.prevTransformTemplateValue;e&&(t||iZ(this.latestValues)||a)&&(r(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let i=this.measurePageBox(),n=this.removeElementScroll(i);return e&&(n=this.removeTransform(n)),ri((t=n).x),ri(t.y),{animationId:this.root.animationId,measuredBox:i,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;let{visualElement:t}=this.options;if(!t)return iG();let i=t.measureViewportBox();if(!((null==(e=this.scroll)?void 0:e.wasRoot)||this.path.some(rr))){let{scroll:e}=this.root;e&&(i5(i.x,e.offset.x),i5(i.y,e.offset.y))}return i}removeElementScroll(e){var t;let i=iG();if(nE(i,e),null==(t=this.scroll)?void 0:t.wasRoot)return i;for(let t=0;t<this.path.length;t++){let n=this.path[t],{scroll:r,options:a}=n;n!==this.root&&r&&a.layoutScroll&&(r.wasRoot&&nE(i,e),i5(i.x,r.offset.x),i5(i.y,r.offset.y))}return i}applyTransform(e,t=!1){let i=iG();nE(i,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&i4(i,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),iZ(n.latestValues)&&i4(i,n.latestValues)}return iZ(this.latestValues)&&i4(i,this.latestValues),i}removeTransform(e){let t=iG();nE(t,e);for(let e=0;e<this.path.length;e++){let i=this.path[e];if(!i.instance||!iZ(i.latestValues))continue;iX(i.latestValues)&&i.updateSnapshot();let n=iG();nE(n,i.measurePageBox()),nI(t,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,n)}return iZ(this.latestValues)&&nI(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==en.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t,i,n,r;let a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);let s=!!this.resumingFrom||this!==a;if(!(e||s&&this.isSharedProjectionDirty||this.isProjectionDirty||(null==(t=this.parent)?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:l,layoutId:o}=this.options;if(this.layout&&(l||o)){if(this.resolvedRelativeTargetAt=en.timestamp,!this.targetDelta&&!this.relativeTarget){let e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=iG(),this.relativeTargetOrigin=iG(),iU(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),nE(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if((this.target||(this.target=iG(),this.targetWithTransforms=iG()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target)?(this.forceRelativeParentToResolveTarget(),i=this.target,n=this.relativeTarget,r=this.relativeParent.target,iL(i.x,n.x,r.x),iL(i.y,n.y,r.y)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):nE(this.target,this.layout.layoutBox),i2(this.target,this.targetDelta)):nE(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=iG(),this.relativeTargetOrigin=iG(),iU(this.relativeTargetOrigin,this.target,e.target),nE(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}nz&&nV.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||iX(this.parent.latestValues)||iJ(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)}calcProjection(){var e;let t=this.getLead(),i=!!this.resumingFrom||this!==t,n=!0;if((this.isProjectionDirty||(null==(e=this.parent)?void 0:e.isProjectionDirty))&&(n=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===en.timestamp&&(n=!1),n)return;let{layout:r,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||a))return;nE(this.layoutCorrected,this.layout.layoutBox);let s=this.treeScale.x,l=this.treeScale.y;!function(e,t,i,n=!1){let r,a,s=i.length;if(s){t.x=t.y=1;for(let l=0;l<s;l++){a=(r=i[l]).projectionDelta;let{visualElement:s}=r.options;(!s||!s.props.style||"contents"!==s.props.style.display)&&(n&&r.options.layoutScroll&&r.scroll&&r!==r.root&&i4(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,i2(e,a)),n&&iZ(r.latestValues)&&i4(e,r.latestValues))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,i),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms=iG());let{target:o}=t;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(nT(this.prevProjectionDelta.x,this.projectionDelta.x),nT(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),iD(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===s&&this.treeScale.y===l&&nF(this.projectionDelta.x,this.prevProjectionDelta.x)&&nF(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o)),nz&&nV.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null==(t=this.options.visualElement)||t.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=iq(),this.projectionDelta=iq(),this.projectionDeltaWithTransform=iq()}setAnimationOrigin(e,t=!1){let i,n=this.snapshot,r=n?n.latestValues:{},a={...this.latestValues},s=iq();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let l=iG(),o=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=!!(o&&!c&&!0===this.options.crossfade&&!this.path.some(n8));this.animationProgress=0,this.mixTargetDelta=t=>{let n=t/1e3;if(n7(s.x,e.x,n),n7(s.y,e.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var u,h,m,p,f,g;iU(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,p=this.relativeTargetOrigin,f=l,g=n,n6(m.x,p.x,f.x,g),n6(m.y,p.y,f.y,g),i&&(u=this.relativeTarget,h=i,nR(u.x,h.x)&&nR(u.y,h.y))&&(this.isProjectionDirty=!1),i||(i=iG()),nE(i,this.relativeTarget)}o&&(this.animationValues=a,function(e,t,i,n,r,a){r?(e.opacity=tk(0,void 0!==i.opacity?i.opacity:1,nb(n)),e.opacityExit=tk(void 0!==t.opacity?t.opacity:1,0,nw(n))):a&&(e.opacity=tk(void 0!==t.opacity?t.opacity:1,void 0!==i.opacity?i.opacity:1,n));for(let r=0;r<nx;r++){let a=`border${ng[r]}Radius`,s=n_(t,a),l=n_(i,a);(void 0!==s||void 0!==l)&&(s||(s=0),l||(l=0),0===s||0===l||ny(s)===ny(l)?(e[a]=Math.max(tk(nv(s),nv(l),n),0),(ez.test(l)||ez.test(s))&&(e[a]+="%")):e[a]=l)}(t.rotate||i.rotate)&&(e.rotate=tk(t.rotate||0,i.rotate||0,n))}(a,r,this.latestValues,n,d,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ei(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=et.update(()=>{var t;let i;nr.hasAnimatedSinceResize=!0,this.currentAnimation=(t={...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}},(i=eh(0)?0:ed(0)).start(ic("",i,1e3,t)),i.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:i,layout:n,latestValues:r}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&rn(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||iG();let t=iR(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=iR(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}nE(t,i),i4(t,r),iD(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new nU),this.sharedNodes.get(e).add(t);let i=t.options.initialPromotionConfig;t.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){var e;let{layoutId:t}=this.options;return t&&(null==(e=this.getStack())?void 0:e.lead)||this}getPrevLead(){var e;let{layoutId:t}=this.options;return t?null==(e=this.getStack())?void 0:e.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:i}={}){let n=this.getStack();n&&n.promote(this,i),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}
13resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:i}=e;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(t=!0),!t)return;let n={};i.z&&nq("z",e,n,this.animationValues);for(let t=0;t<nB.length;t++)nq(`rotate${nB[t]}`,e,n,this.animationValues),nq(`skew${nB[t]}`,e,n,this.animationValues);for(let t in e.render(),n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}getProjectionStyles(e){var t,i;if(!this.instance||this.isSVG)return;if(!this.isVisible)return n$;let n={visibility:""},r=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=nf(null==e?void 0:e.pointerEvents)||"",n.transform=r?r(this.latestValues,""):"none",n;let a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){let t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=nf(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!iZ(this.latestValues)&&(t.transform=r?r({},""):"none",this.hasProjected=!1),t}let s=a.animationValues||a.latestValues;this.applyTransformsToTarget(),n.transform=function(e,t,i){let n="",r=e.x.translate/t.x,a=e.y.translate/t.y,s=(null==i?void 0:i.z)||0;if((r||a||s)&&(n=`translate3d(${r}px, ${a}px, ${s}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),i){let{transformPerspective:e,rotate:t,rotateX:r,rotateY:a,skewX:s,skewY:l}=i;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),r&&(n+=`rotateX(${r}deg) `),a&&(n+=`rotateY(${a}deg) `),s&&(n+=`skewX(${s}deg) `),l&&(n+=`skewY(${l}deg) `)}let l=e.x.scale*t.x,o=e.y.scale*t.y;return(1!==l||1!==o)&&(n+=`scale(${l}, ${o})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),r&&(n.transform=r(s,n.transform));let{x:l,y:o}=this.projectionDelta;for(let e in n.transformOrigin=`${100*l.origin}% ${100*o.origin}% 0`,a.animationValues?n.opacity=a===this?null!=(i=null!=(t=s.opacity)?t:this.latestValues.opacity)?i:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:n.opacity=a===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0,nl){if(void 0===s[e])continue;let{correct:t,applyTo:i}=nl[e],r="none"===n.transform?s[e]:t(s[e],a);if(i){let e=i.length;for(let t=0;t<e;t++)n[i[t]]=r}else n[e]=r}return this.options.layoutId&&(n.pointerEvents=a===this?nf(null==e?void 0:e.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null==(t=e.currentAnimation)?void 0:t.stop()}),this.root.nodes.forEach(nZ),this.root.sharedNodes.clear()}}}function nG(e){e.updateLayout()}function nY(e){var t;let i=(null==(t=e.resumeFrom)?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){let{layoutBox:t,measuredBox:n}=e.layout,{animationType:r}=e.options,a=i.source!==e.layout.source;"size"===r?iY(e=>{let n=a?i.measuredBox[e]:i.layoutBox[e],r=iR(n);n.min=t[e].min,n.max=n.min+r}):rn(r,i.layoutBox,t)&&iY(n=>{let r=a?i.measuredBox[n]:i.layoutBox[n],s=iR(t[n]);r.max=r.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+s)});let s=iq();iD(s,t,i.layoutBox);let l=iq();a?iD(l,e.applyTransform(n,!0),i.measuredBox):iD(l,t,i.layoutBox);let o=!nO(s),u=!1;if(!e.resumeFrom){let n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:r,layout:a}=n;
13if(r&&a){let s=iG();iU(s,i.layoutBox,r.layoutBox);let l=iG();iU(l,t,a.layoutBox),nD(s,l)||(u=!0),n.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=s,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:i,delta:l,layoutDelta:s,hasLayoutChanged:o,hasRelativeTargetChanged:u})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function nQ(e){nz&&nV.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function nK(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function nX(e){e.clearSnapshot()}function nZ(e){e.clearMeasurements()}function nJ(e){e.isLayoutDirty=!1}function n0(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function n1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function n2(e){e.resolveTargetDelta()}function n5(e){e.calcProjection()}function n3(e){e.resetSkewAndRotation()}function n4(e){e.removeLeadSnapshot()}function n7(e,t,i){e.translate=tk(t.translate,0,i),e.scale=tk(t.scale,1,i),e.origin=t.origin,e.originPoint=t.originPoint}function n6(e,t,i,n){e.min=tk(t.min,i.min,n),e.max=tk(t.max,i.max,n)}function n8(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let n9={duration:.45,ease:[.4,0,.1,1]},re=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),rt=re("applewebkit/")&&!re("chrome/")?Math.round:S;function ri(e){e.min=rt(e.min),e.max=rt(e.max)}function rn(e,t,i){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(nL(t)-nL(i)))}function rr(e){var t;return e!==e.root&&(null==(t=e.scroll)?void 0:t.wasRoot)}let ra=nW({attachResizeListener:(e,t)=>iN(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rs={current:void 0},rl=nW({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rs.current){let e=new ra({});e.mount(window),e.setOptions({layoutScroll:!0}),rs.current=e}return rs.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function ro(e,t){let i=function(e){if(e instanceof Element)return[e];if("string"==typeof e){let t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),n=new AbortController;return[i,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function ru(e){return t=>{"touch"===t.pointerType||iw.x||iw.y||e(t)}}function rc(e,t,i){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===i);let r=n["onHover"+i];r&&et.postRender(()=>r(t,iE(t)))}let rd=(e,t)=>!!t&&(e===t||rd(e,t.parentElement)),rh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),rm=new WeakSet;function rp(e){return t=>{"Enter"===t.key&&e(t)}}function rf(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function rg(e){return ij(e)&&!(iw.x||iw.y)}function rx(e,t,i){let{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===i);let r=n["onTap"+("End"===i?"":i)];r&&et.postRender(()=>r(t,iE(t)))}let rv=new WeakMap,ry=new WeakMap,r_=e=>{let t=rv.get(e.target);t&&t(e)},rb=e=>{e.forEach(r_)},rw={some:0,all:1},rj=(0,o.createContext)({strict:!1}),rN=(0,o.createContext)({});function rE(e){return j(e.animate)||I.some(t=>T(e[t]))}function rT(e){return!!(rE(e)||e.variants)}function rC(e){return Array.isArray(e)?e.join(" "):e}let rA={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"]},rk={};for(let e in rA)rk[e]={isEnabled:t=>rA[e].some(e=>!!t[e])};let rM=Symbol.for("motionComponentSymbol"),rI=["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 rS(e){if("string"!=typeof e||e.includes("-"));else if(rI.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let rO=e=>(t,i)=>{let n=(0,o.useContext)(rN),r=(0,o.useContext)(d),a=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:i},n,r,a){let s={latestValues:function(e,t,i,n){let r={},a=n(e,{});for(let e in a)r[e]=nf(a[e]);let{initial:s,animate:l}=e,o=rE(e),u=rT(e);t&&u&&!o&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===l&&(l=t.animate));let c=!!i&&!1===i.initial,d=(c=c||!1===s)?l:s;if(d&&"boolean"!=typeof d&&!j(d)){let t=Array.isArray(d)?d:[d];for(let i=0;i<t.length;i++){let n=A(e,t[i]);if(n){let{transitionEnd:e,transition:t,...i}=n;for(let e in i){let t=i[e];if(Array.isArray(t)){let e=c?t.length-1:0;t=t[e]}null!==t&&(r[e]=t)}for(let t in e)r[t]=e[t]}}}return r}(n,r,a,e),renderState:t()};return i&&(s.onMount=e=>i({props:n,current:e,...s}),s.onUpdate=e=>i(e)),s})(e,t,n,r);return i?a():c(a)},rR=(e,t)=>t&&"number"==typeof e?t.transform(e):e,rP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rD=Q.length;function rL(e,t,i){let{style:n,vars:r,transformOrigin:a}=e,s=!1,l=!1;for(let e in t){let i=t[e];if(K.has(e)){s=!0;continue}if(tg(e)){r[e]=i;continue}{let t=rR(i,e8[e]);e.startsWith("origin")?(l=!0,a[e]=t):n[e]=t}}if(!t.transform&&(s||i?n.transform=function(e,t,i){let n="",r=!0;for(let a=0;a<rD;a++){let s=Q[a],l=e[s];if(void 0===l)continue;let o=!0;if(!(o="number"==typeof l?l===+!!s.startsWith("scale"):0===parseFloat(l))||i){let e=rR(l,e8[s]);if(!o){r=!1;let t=rP[s]||s;n+=`${t}(${e}) `}i&&(t[s]=e)}}return n=n.trim(),i?n=i(t,r?"":n):r&&(n="none"),n}(t,e.transform,i):n.transform&&(n.transform="none")),l){let{originX:e="50%",originY:t="50%",originZ:i=0}=a;n.transformOrigin=`${e} ${t} ${i}`}}let rF={offset:"stroke-dashoffset",array:"stroke-dasharray"},rU={offset:"strokeDashoffset",array:"strokeDasharray"};function rV(e,t,i){return"string"==typeof e?e:eB.transform(t+i*e)}function rz(e,{attrX:t,attrY:i,attrScale:n,originX:r,originY:a,pathLength:s,pathSpacing:l=1,pathOffset:o=0,...u},c,d){let h,m;
13if(rL(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:p,style:f,dimensions:g}=e;p.transform&&(g&&(f.transform=p.transform),delete p.transform),g&&(void 0!==r||void 0!==a||f.transform)&&(h=rV(void 0!==r?r:.5,g.x,g.width),m=rV(void 0!==a?a:.5,g.y,g.height),f.transformOrigin=`${h} ${m}`),void 0!==t&&(p.x=t),void 0!==i&&(p.y=i),void 0!==n&&(p.scale=n),void 0!==s&&function(e,t,i=1,n=0,r=!0){e.pathLength=1;let a=r?rF:rU;e[a.offset]=eB.transform(-n);let s=eB.transform(t),l=eB.transform(i);e[a.array]=`${s} ${l}`}(p,s,l,o,!1)}let rB=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),r$=()=>({...rB(),attrs:{}}),rH=e=>"string"==typeof e&&"svg"===e.toLowerCase();function rq(e,{style:t,vars:i},n,r){for(let a in Object.assign(e.style,t,r&&r.getProjectionStyles(n)),i)e.style.setProperty(a,i[a])}let rW=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"]);function rG(e,t,i,n){for(let i in rq(e,t,void 0,n),t.attrs)e.setAttribute(rW.has(i)?i:ep(i),t.attrs[i])}function rY(e,{layout:t,layoutId:i}){return K.has(e)||e.startsWith("origin")||(t||void 0!==i)&&(!!nl[e]||"opacity"===e)}function rQ(e,t,i){var n;let{style:r}=e,a={};for(let s in r)(eh(r[s])||t.style&&eh(t.style[s])||rY(s,e)||(null==(n=null==i?void 0:i.getValue(s))?void 0:n.liveStyle)!==void 0)&&(a[s]=r[s]);return a}function rK(e,t,i){let n=rQ(e,t,i);for(let i in e)(eh(e[i])||eh(t[i]))&&(n[-1!==Q.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]);return n}let rX=["x","y","width","height","cx","cy","r"],rZ={useVisualState:rO({scrapeMotionValuesFromProps:rK,createRenderState:r$,onUpdate:({props:e,prevProps:t,current:i,renderState:n,latestValues:r})=>{if(!i)return;let a=!!e.drag;if(!a){for(let e in r)if(K.has(e)){a=!0;break}}if(!a)return;let s=!t;if(t)for(let i=0;i<rX.length;i++){let n=rX[i];e[n]!==t[n]&&(s=!0)}s&&et.read(()=>{try{n.dimensions="function"==typeof i.getBBox?i.getBBox():i.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}et.render(()=>{rz(n,r,rH(i.tagName),e.transformTemplate),rG(i,n)})})}})},rJ={useVisualState:rO({scrapeMotionValuesFromProps:rQ,createRenderState:rB})};function r0(e,t,i){for(let n in t)eh(t[n])||rY(n,i)||(e[n]=t[n])}let r1=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function r2(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||r1.has(e)}let r5=e=>!r2(e);try{(r=e.r(570606).default)&&(r5=e=>e.startsWith("on")?!r2(e):r(e))}catch(e){}let r3={current:null},r4={current:!1},r7=[...tw,eG,e2],r6=new WeakMap,r8=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class r9{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:n,blockInitialAnimation:r,visualState:a},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=tp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=es.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,et.render(this.render,!1,!0))};
13const{latestValues:l,renderState:o,onUpdate:u}=a;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=o,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.blockInitialAnimation=!!r,this.isControllingVariants=rE(t),this.isVariantNode=rT(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==l[e]&&eh(t)&&t.set(l[e],!1)}}mount(e){this.current=e,r6.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),r4.current||function(){if(r4.current=!0,b)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>r3.current=e.matches;e.addListener(t),t()}else r3.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||r3.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in r6.delete(this.current),this.projection&&this.projection.unmount(),ei(this.notifyUpdate),ei(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){let i;this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=K.has(e),r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&et.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),a=t.on("renderRequest",this.scheduleRender);window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),a(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in rk){let t=rk[e];if(!t)continue;let{isEnabled:i,Feature:n}=t;if(!this.features[e]&&n&&i(this.props)&&(this.features[e]=new n(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):iG()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<r8.length;t++){let i=r8[t];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let n=e["on"+i];n&&(this.propEventSubscriptions[i]=this.on(i,n))}this.prevMotionValues=function(e,t,i){for(let n in t){let r=t[n],a=i[n];if(eh(r))e.addValue(n,r);else if(eh(a))e.addValue(n,ed(r,{owner:e}));else if(a!==r)if(e.hasValue(n)){let t=e.getValue(n);!0===t.liveStyle?t.jump(r):t.hasAnimated||t.set(r)}else{let t=e.getStaticValue(n);e.addValue(n,ed(void 0!==t?t:r,{owner:e}))}}for(let n in i)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}
13addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return void 0===i&&void 0!==t&&(i=ed(null===t?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){var i;let n=void 0===this.latestValues[e]&&this.current?null!=(i=this.getBaseTargetFromProps(this.props,e))?i:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=n){let i,r;if("string"==typeof n&&(i=n,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i)||(r=n,/^0[^.\s]+$/u.test(r))))n=parseFloat(n);else{let i;i=n,!r7.find(tb(i))&&e2.test(t)&&(n=tt(e,t))}this.setBaseTarget(e,eh(n)?n.get():n)}return eh(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;let i,{initial:n}=this.props;if("string"==typeof n||"object"==typeof n){let r=A(this.props,n,null==(t=this.presenceContext)?void 0:t.custom);r&&(i=r[e])}if(n&&void 0!==i)return i;let r=this.getBaseTargetFromProps(this.props,e);return void 0===r||eh(r)?void 0!==this.initialValues[e]&&void 0===i?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new eu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class ae extends r9{constructor(){super(...arguments),this.KeyframeResolver=tN}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;eh(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class at extends ae{constructor(){super(...arguments),this.type="html",this.renderInstance=rq}readValueFromInstance(e,t){if(K.has(t)){let e=te(t);return e&&e.default||0}{let i=window.getComputedStyle(e),n=(tg(t)?i.getPropertyValue(t):i[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return i7(e,t)}build(e,t,i){rL(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return rQ(e,t,i)}}class ai extends ae{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=iG}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(K.has(t)){let e=te(t);return e&&e.default||0}return t=rW.has(t)?t:ep(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return rK(e,t,i)}build(e,t,i){rz(e,t,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,i,n){rG(e,t,i,n)}mount(e){this.isSVGTag=rH(e.tagName),super.mount(e)}}let an=function(e){if("u"<typeof Proxy)return e;let t=new Map;return new Proxy((...t)=>e(...t),{get:(i,n)=>"create"===n?e:(t.has(n)||t.set(n,e(n)),t.get(n))})}((a={animation:{Feature:class extends i_{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:i})=>(function(e,t,i={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>ih(e,t,i)));else if("string"==typeof t)n=ih(e,t,i);else{let r="function"==typeof t?k(e,t,i.custom):t;n=Promise.all(id(e,r,i))}return n.then(()=>{e.notify("AnimationComplete",t)})})(e,t,i))),i=iy(),n=!0,r=t=>(i,n)=>{var r;let a=k(e,n,"exit"===t?null==(r=e.presenceContext)?void 0:r.custom:void 0);if(a){let{transition:e,transitionEnd:t,...n}=a;i={...i,...n,...t}}return i};function a(a){let{props:s}=e,l=function e(t){if(!t)return;if(!t.isControllingVariants){let i=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(i.initial=t.props.initial),i}let i={};for(let e=0;e<ip;e++){let n=I[e],r=t.props[n];(T(r)||!1===r)&&(i[n]=r)}return i}(e.parent)||{},o=[],u=new Set,c={},d=1/0;for(let t=0;t<ix;t++){var h,m;let p=ig[t],f=i[p],g=void 0!==s[p]?s[p]:l[p],x=T(g),v=p===a?f.isActive:null;!1===v&&(d=t);let y=g===l[p]&&g!==s[p]&&x;if(y&&n&&e.manuallyAnimateOnMount&&(y=!1),f.protectedKeys={...c},!f.isActive&&null===v||!g&&!f.prevProp||j(g)||"boolean"==typeof g)continue;let _=(h=f.prevProp,"string"==typeof(m=g)?m!==h:!!Array.isArray(m)&&!E(m,h)),b=_||p===a&&f.isActive&&!y&&x||t>d&&x,w=!1,C=Array.isArray(g)?g:[g],A=C.reduce(r(p),{});!1===v&&(A={});let{prevResolvedValues:k={}}=f,M={...k,...A},I=t=>{b=!0,u.has(t)&&(w=!0,u.delete(t)),f.needsAnimating[t]=!0;let i=e.getValue(t);i&&(i.liveStyle=!1)};for(let e in M){let t=A[e],i=k[e];if(!c.hasOwnProperty(e))(N(t)&&N(i)?E(t,i):t===i)?void 0!==t&&u.has(e)?I(e):f.protectedKeys[e]=!0:null!=t?I(e):u.add(e)}f.prevProp=g,f.prevResolvedValues=A,f.isActive&&(c={...c,...A}),n&&e.blockInitialAnimation&&(b=!1);let S=!(y&&_)||w;b&&S&&o.push(...C.map(e=>({animation:e,options:{type:p}})))}if(u.size){let t={};u.forEach(i=>
13{let n=e.getBaseTarget(i),r=e.getValue(i);r&&(r.liveStyle=!0),t[i]=null!=n?n:null}),o.push({animation:t})}let p=!!o.length;return n&&(!1===s.initial||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?t(o):Promise.resolve()}return{animateChanges:a,setActive:function(t,n){var r;if(i[t].isActive===n)return Promise.resolve();null==(r=e.variantChildren)||r.forEach(e=>{var i;return null==(i=e.animationState)?void 0:i.setActive(t,n)}),i[t].isActive=n;let s=a(t);for(let e in i)i[e].protectedKeys={};return s},setAnimateFunction:function(i){t=i(e)},getState:()=>i,reset:()=>{i=iy(),n=!0}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();j(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null==(e=this.unmountControls)||e.call(this)}}},exit:{Feature:class extends i_{constructor(){super(...arguments),this.id=ib++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;let n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}},inView:{Feature:class extends i_{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.unmount();let{viewport:i={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:s}=i,l={root:n?n.current:void 0,rootMargin:r,threshold:"number"==typeof a?a:rw[a]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,s&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),r=t?i:n;r&&r(e)};return e=this.node.current,t=function({root:e,...t}){let i=e||document;ry.has(i)||ry.set(i,{});let n=ry.get(i),r=JSON.stringify(t);return n[r]||(n[r]=new IntersectionObserver(rb,{root:e,...t})),n[r]}(l),rv.set(e,o),t.observe(e),()=>{rv.delete(e),t.unobserve(e)}}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends i_{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,i={}){let[n,r,a]=ro(e,i),s=e=>{let n=e.currentTarget;if(!rg(e)||rm.has(n))return;rm.add(n);let a=t(e),s=(e,t)=>{window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",o),rg(e)&&rm.has(n)&&(rm.delete(n),"function"==typeof a&&a(e,{success:t}))},l=e=>{s(e,i.useGlobalTarget||rd(n,e.target))},o=e=>{s(e,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",o,r)};return n.forEach(e=>{rh.has(e.tagName)||-1!==e.tabIndex||null!==e.getAttribute("tabindex")||(e.tabIndex=0),(i.useGlobalTarget?window:e).addEventListener("pointerdown",s,r),e.addEventListener("focus",e=>((e,t)=>{let i=e.currentTarget;if(!i)return;let n=rp(()=>{if(rm.has(i))return;rf(i,"down");let e=rp(()=>{rf(i,"up")});i.addEventListener("keyup",e,t),i.addEventListener("blur",()=>rf(i,"cancel"),t)});i.addEventListener("keydown",n,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),t)})(e,r),r)}),a}(e,e=>(rx(this.node,e,"Start"),(e,{success:t})=>rx(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends i_{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=tL(iN(this.node.current,"focus",()=>this.onFocus()),iN(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}}
13,hover:{Feature:class extends i_{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,i={}){let[n,r,a]=ro(e,i),s=ru(e=>{let{target:i}=e,n=t(e);if("function"!=typeof n||!i)return;let a=ru(e=>{n(e),i.removeEventListener("pointerleave",a)});i.addEventListener("pointerleave",a,r)});return n.forEach(e=>{e.addEventListener("pointerenter",s,r)}),a}(e,e=>(rc(this.node,e,"Start"),e=>rc(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends i_{constructor(){super(...arguments),this.removePointerDownListener=S}onPointerDown(e){this.session=new iA(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:i6(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:nt(e),onStart:nt(t),onMove:i,onEnd:(e,t)=>{delete this.session,n&&et.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=iT(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends i_{constructor(e){super(e),this.removeGroupControls=S,this.removeListeners=S,this.controls=new i9(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||S}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:rl,MeasureLayout:nd},layout:{ProjectionNode:rl,MeasureLayout:nd}},s=(e,t)=>rS(e)?new ai(t):new at(t,{allowProjection:e!==o.Fragment}),function(e,{forwardMotionProps:t}={forwardMotionProps:!1}){return function({preloadedFeatures:e,createVisualElement:t,useRender:i,useVisualState:n,Component:r}){var a,s;function c(e,a){var s;let c,h={...(0,o.useContext)(m),...e,layoutId:function({layoutId:e}){let t=(0,o.useContext)(u).id;return t&&void 0!==e?t+"-"+e:e}(e)},{isStatic:p}=h,f=function(e){let{initial:t,animate:i}=function(e,t){if(rE(e)){let{initial:t,animate:i}=e;return{initial:!1===t||T(t)?t:void 0,animate:T(i)?i:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(rN));return(0,o.useMemo)(()=>({initial:t,animate:i}),[rC(t),rC(i)])}(e),g=n(e,p);if(!p&&b){(0,o.useContext)(rj).strict;let e=function(e){let{drag:t,layout:i}=rk;if(!t&&!i)return{};let n={...t,...i};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==i?void 0:i.isEnabled(e))?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(h);c=e.MeasureLayout,f.visualElement=function(e,t,i,n,r){var a,s;let{visualElement:l}=(0,o.useContext)(rN),u=(0,o.useContext)(rj),c=(0,o.useContext)(d),h=(0,o.useContext)(m).reducedMotion,p=(0,o.useRef)(null);n=n||u.renderer,!p.current&&n&&(p.current=n(e,{visualState:t,parent:l,props:i,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:h}));let f=p.current,g=(0,o.useContext)(nn);f&&!f.projection&&r&&("html"===f.type||"svg"===f.type)&&function(e,t,i,n){let{layoutId:r,layout:a,drag:s,dragConstraints:l,layoutScroll:o,layoutRoot:u}=t;e.projection=new i(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:r,layout:a,alwaysMeasureLayout:!!s||l&&iO(l),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:n,layoutScroll:o,layoutRoot:u})}(p.current,i,r,g);let x=(0,o.useRef)(!1);(0,o.useInsertionEffect)(()=>{f&&x.current&&f.update(i,c)});let v=i[ef],y=(0,o.useRef)(!!v&&!(null==(a=window.MotionHandoffIsComplete)?void 0:a.call(window,v))&&(null==(s=window.MotionHasOptimisedAnimation)?void 0:s.call(window,v)));return w(()=>{f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),no.render(f.render),y.current&&f.animationState&&f.animationState.animateChanges())}),(0,o.useEffect)(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var e;null==(e=window.MotionHandoffMarkAsComplete)||e.call(window,v)}),y.current=!1))}),f}(r,g,h,t,e.ProjectionNode)}return(0,l.jsxs)(rN.Provider,{value:f,children:[c&&f.visualElement?(0,l.jsx)(c,{visualElement:f.visualElement,...h}):null,i(r,e,(s=f.visualElement,(0,o.useCallback)(e=>{e&&g.onMount&&g.onMount(e),s&&(e?s.mount(e):s.unmount()),a&&("function"==typeof a?a(e):iO(a)&&(a.current=e))},[s])),g,p,f.visualElement)]})}e&&function(e){for(let t in e)rk[t]={...rk[t],...e[t]}}(e),c.displayName=`motion.${"string"==typeof r?r:`create(${null!=(s=null!=(a=r.displayName)?a:r.name)?s:""})`}`;let h=(0,o.forwardRef)(c);return h[rM]=r,h}({...rS(e)?rZ:rJ,preloadedFeatures:a,useRender:function(e=!1){return(t,i,n,{latestValues:r},a)=>{let s=(rS(t)?function(e,t,i,n){let r=(0,o.useMemo)(()=>{let i=r$();return rz(i,t,rH(n),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){let t={};r0(t,e.style,e),r.style={...t,...r.style}}return r}:function(e,t){let i,n,r={},a=(i=e.style||{},r0(n={},i,e),Object.assign(n,function({transformTemplate:e},t){return(0,o.useMemo)(()=>{let i=rB();return rL(i,t,e),Object.assign({},i.vars,i.style)},[t])}(e,t)),n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}
13`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=a,r})(i,r,a,t),l=function(e,t,i){let n={};for(let r in e)("values"!==r||"object"!=typeof e.values)&&(r5(r)||!0===i&&r2(r)||!t&&!r2(r)||e.draggable&&r.startsWith("onDrag"))&&(n[r]=e[r]);return n}(i,"string"==typeof t,e),u=t!==o.Fragment?{...l,...s,ref:n}:{},{children:c}=i,d=(0,o.useMemo)(()=>eh(c)?c.get():c,[c]);return(0,o.createElement)(t,{...u,children:d})}}(t),createVisualElement:s,Component:e})}));e.s(["motion",0,an],829881)},438176,533197,903945,671199,568951,743026,888591,97305,116272,31483,593672,478989,621819,689095,864895,498173,196710,5239,975252,13959,517216,57352,397349,935406,73326,326496,930479,536049,44289,376400,5960,632224,380741,78102,e=>{"use strict";var t,i,n,r,a,s,l,o,u,c,d,h,m,p,f,g,x,v,y,_,b,w,j=e.i(21590),N=e.i(820967),E=e.i(369133),T=e.i(715074),C=e.i(957865),A=e.i(421387),k=e.i(727989);function M(){let{t:e}=(0,T.useI18n)();return(0,j.jsx)("p",{className:"line-clamp-1 cursor-text select-text text-ellipsis text-sm leading-[1.6] text-[#141414]",children:e("agent_tool_use_error")})}let I=(0,N.memo)(function(e){let{data:t,isNewAgentUI:i}=e,n=(0,N.useMemo)(()=>i?C.default:k.default,[i]),r=(0,N.useMemo)(()=>{if(!t?.event_data)return null;let e=t?.event_data?.error_code||t?.event_data?.code;if("string"==typeof e)return e;let i=t?.event_data?.error;return"string"==typeof i&&i?.startsWith("[")?i?.match(/\[(.*?)\]/)?.[1]?.trim():null},[t]);return r?(0,j.jsx)(n,{event_data:{error_type:r},threadId:"",actionId:"",noActionBtn:!0}):i?(0,j.jsx)(A.default,{threadId:"",actionId:""}):(0,j.jsx)(M,{})});function S(){return(S=Object.assign.bind()).apply(null,arguments)}let O=function(e){return N.createElement("svg",S({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),t||(t=N.createElement("path",{fill:"currentColor",fillOpacity:.9,d:"M9.47 13.47a.75.75 0 1 1 1.06 1.06l-4.72 4.72H10a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1-.75-.75v-6a.75.75 0 0 1 1.5 0v4.19zM19.25 10V5.81l-4.72 4.72a.75.75 0 1 1-1.06-1.06l4.72-4.72H14a.75.75 0 0 1 0-1.5h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-1.5 0"})))};e.s(["default",0,O],533197);var R=e.i(863167),P=e.i(7284),D=e.i(973930),L=e.i(222789);e.i(676385);var F=e.i(850654),U=e.i(414720),V=e.i(458462),z=e.i(864088),B=e.i(361114);let $=(0,N.lazy)(()=>e.A(47163)),H="__artifact_info_entry_guide_done__",q=(0,z.createMutableAnimationData)(U);function W(){try{return"u">typeof localStorage&&"1"!==localStorage.getItem(H)}catch{return!1}}function G({buttonRef:e}){let[t,i]=(0,N.useState)(W),[n,r]=(0,N.useState)(!1);return((0,N.useEffect)(()=>{if(!t)return;let i=e.current?.closest("[data-artifact-info-anchor]");if(!i)return;let n=()=>r(!0),a=()=>r(!1);return i.addEventListener("mouseenter",n),i.addEventListener("mouseleave",a),()=>{i.removeEventListener("mouseenter",n),i.removeEventListener("mouseleave",a)}},[t,e]),t&&n)?(0,j.jsx)("span",{className:"pointer-events-none flex size-3.5 items-center justify-center",children:(0,j.jsx)(N.Suspense,{fallback:(0,j.jsx)(V.default,{className:"size-3.5"}),children:(0,j.jsx)($,{animationData:q,loop:!1,autoplay:!0,onComplete:()=>{try{localStorage.setItem(H,"1")}catch{}i(!1)},style:{width:21,height:21,flexShrink:0}})})}):(0,j.jsx)(V.default,{className:"size-3.5"})}let Y="text-lo-special-white rounded-lo-radius-4 hover:bg-lo-bg-overlay-active flex size-5 shrink-0 cursor-pointer items-center justify-center";function Q({artifactId:e,elementType:t,coverUrl:i}){let{onShowArtifactInfo:n}=(0,D.useAgentUIContext)(),{threadId:r,actionId:a}=(0,B.useMessageTrackContext)(),s=(0,N.useRef)(null),l=(0,N.useCallback)(s=>{s.stopPropagation(),s.preventDefault();let l=(s.currentTarget.closest("[data-artifact-info-anchor]")??s.currentTarget).getBoundingClientRect().top;n?.({artifactId:e,elementType:t,coverUrl:i,anchorTop:l,threadId:r,actionId:a})},[n,e,t,i,r,a]);return n?(0,j.jsx)("button",{ref:s,type:"button","data-testid":F.Agent.ArtifactInfoEntry,className:Y,onClick:l,onPointerDown:e=>e.stopPropagation(),children:(0,j.jsx)(G,{buttonRef:s})}):null}var K=e.i(532675);let X=(0,N.memo)(function(e){let{className:t,children:i,...n}=e;return(0,j.jsxs)("div",{className:(0,K.twClsx)("agent-chat-skeleton",t&&t),...n,children:[(0,j.jsx)("div",{"aria-hidden":!0,
13className:"agent-chat-skeleton__beam"}),null!=i&&(0,j.jsx)("div",{className:"agent-chat-skeleton__content",children:i})]})}),Z=(0,N.memo)(function(e){let{initialSize:t,className:i,style:n,aspectRatio:r,maxHeightFit:a,...s}=e,l={...r?a?{height:"100%",aspectRatio:r}:{width:"100%",aspectRatio:r}:{width:"100%",height:"100%"},...t};return(0,j.jsx)("div",{className:(0,K.twClsx)("pointer-events-none absolute left-0 top-0 z-10 h-full w-full overflow-hidden",i&&i),style:n,...s,children:(0,j.jsx)(X,{style:{...l,...n}})})});function J(){return(J=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,Z],903945);let ee=function(e){return N.createElement("svg",J({xmlns:"http://www.w3.org/2000/svg",width:20,height:21,fill:"none",viewBox:"0 0 20 21"},e),i||(i=N.createElement("path",{fill:"#fff",d:"M2.679 13.177c.315 0 .57.256.571.571v2.763a.917.917 0 0 0 .917.916h11.666a.917.917 0 0 0 .917-.916v-2.763c0-.315.256-.571.571-.571h.358c.315 0 .57.256.571.571v2.763a2.42 2.42 0 0 1-2.417 2.417H4.167A2.42 2.42 0 0 1 1.75 16.51v-2.763c0-.315.256-.571.571-.571zm7.5-10.833c.315 0 .571.255.571.571v9.284l2.482-2.482a.57.57 0 0 1 .808 0l.253.253a.57.57 0 0 1 0 .808l-3.763 3.763a.75.75 0 0 1-1.06 0l-3.763-3.763a.57.57 0 0 1 0-.808l.253-.253a.57.57 0 0 1 .808 0l2.482 2.482V2.915c0-.316.256-.571.571-.571z"})))};function et(){return(et=Object.assign.bind()).apply(null,arguments)}let ei=function(e){return N.createElement("svg",et({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20"},e),n||(n=N.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.06 3.659a6.667 6.667 0 1 0 4.607 6.34.833.833 0 1 1 1.667 0 8.333 8.333 0 1 1-5.759-7.925.833.833 0 0 1-.515 1.585",clipRule:"evenodd"})))};var en=e.i(579023);async function er(e,t="",i="png"){if(e)try{let n=e.split("/").pop();if(t){let r=e.split(".").pop()||i;n=t+"."+r}let r=await fetch(e);if(!r.ok)return;let a=await r.blob(),s=URL.createObjectURL(new Blob([a])),l=document.createElement("a");l.href=s,l.download=n,document.body.appendChild(l),l.click(),URL.revokeObjectURL(s),l.remove()}catch(t){en.logger.error("Download failed:",t),window?.open?.(e,"_blank")}}let ea=new Map;function es(e){return ea.has(e)?ea.get(e):new Promise(t=>{let i=new Image;i.onload=()=>{ea.set(e,{width:i.width,height:i.height}),t({width:i.width,height:i.height})},i.onerror=()=>{t({width:1024,height:1024})},i.src=e})}e.s(["fetchDownloadFile",0,er,"fetchQueryImageSize",0,es],671199);let el=(0,N.memo)(function(e){let{fileUrl:t,fileName:i,fileType:n,btnClassName:r,icon:a,iconSize:s=20,iconColor:l="white",onDownloadCallback:o,downloadHandler:u,...c}=e,[d,h]=(0,N.useState)(!1),m=(0,N.useMemo)(()=>d?(0,j.jsx)(ei,{width:s,height:s,color:l,className:"animate-spin"}):a||(0,j.jsx)(ee,{width:s,height:s,color:l}),[d,a,s,l]),p=(0,N.useCallback)(async()=>{o?.({fileUrl:t,fileName:i,fileType:n}),h(!0);try{await Promise.all([u?.({fileUrl:t,fileName:i,fileType:n})??er?.(t,i,n)??Promise.resolve(),new Promise(e=>{setTimeout(()=>e(!0),500)})])}finally{h(!1)}},[o,u,t,i,n]);return(0,j.jsx)("button",{onClick:d?void 0:p,disabled:d,className:(0,P.default)("absolute bottom-[2px] right-[2px] z-[1] cursor-pointer","flex items-center justify-center p-1",r&&r),...c,children:m})});e.s(["default",0,el],568951);var eo=e.i(186697);let eu=(0,N.memo)(function(e){let{src:t,canPreview:i=!0,draggedImage:n,draggingSource:r="agent-image",agentGenerated:a=!1,imgBoxClassName:s,showAiGeneratedBadge:l,showAiGeneratedBadgeOnThumbnail:o,...u}=e,c=(0,N.useCallback)(async e=>{if(n?.image_url){if(e.stopPropagation(),"number"!=typeof n?.width||"number"!=typeof n?.height){let{width:e,height:t}=await es(n?.image_url);n.width=e,n.height=t}(0,D.getAgentUIContext)()?.handleDragFiles?.({source:r,type:"image",items:[{...n,agentGenerated:a,threadId:n.threadId??u.threadId,actionId:n.actionId??u.actionId}]})}},[a,n,r,u.threadId,u.actionId]);return t?(0,j.jsx)(j.Fragment,{children:i?(0,j.jsx)(eo.default,{src:t,draggable:!!n,onDragStart:c,showAiGeneratedBadge:l,showAiGeneratedBadgeOnThumbnail:o,downloadArtifactItem:n,downloadFileName:n?.image_name||n?.title,...u}):(0,j.jsxs)("div",{className:(0,P.default)("relative overflow-hidden",s),children:[(0,j.jsx)("img",{src:t,draggable:!!n,onDragStart:c,...u}),l&&!1!==o&&(0,j.jsx)(L.default,{})]})}):null});e.s(["default",0,eu],743026);let ec=(0,N.memo)(function(e){let{boxStyle:t,boxClassName:i,onBoxClick:n,label:r,labelClassName:a,skeleton:s=!0,skeletonStyle:l,skeletonTestId:o,downloadable:u=!1,onDownloadCallback:c,showAiGeneratedBadge:d=!1,showArtifactInfoEntry:h=!0,fullscreenEntry:m=!1,onImageClick:p,children:f,...g}=e,[x,v]=(0,N.useState)(!1),y=(0,N.useCallback)(()=>v(!0),[]),{handleDownloadArtifact:_,onShowArtifactInfo:b}=(0,D.useAgentUIContext)(),w=!!(h&&b&&g.draggedImage?.artifact_id),E=(0,N.useRef)(null),T=(0,N.useRef)(!1),C=(0,N.useCallback)(()=>{T.current=!0;let e=E.current?.querySelector(".ant-image img");e?.click(),T.current=!1},[]),A=(0,N.useCallback)(e=>{if(T.current){T.current=!1;return}e.preventDefault(),e.stopPropagation(),p?.({openPreview:C})},[p,C]),k=(0,N.useCallback)(async e=>{_&&d&&await _({artifactType:"image",...e,item:g.draggedImage,agentGenerated:d,threadId:g.threadId,actionId:g.actionId})},[_,d,g.draggedImage,g.threadId,g.actionId]);return(0,j.jsxs)("div",{className:(0,P.default)("group/artifact-info relative overflow-hidden",i&&i),style:t,onClick:n,"data-artifact-info-anchor":!0,ref:E,children:[(0,j.jsx)(eu,{onLoad:y,showAiGeneratedBadge:d,showAiGeneratedBadgeOnThumbnail:!1,onClickCapture:p?A:void 0,...g}),x&&d&&(0,j.jsx)(L.default,{}),x&&(m||w||u)&&(0,j.jsxs)("div",{className:(0,P.default)("bg-lo-special-modal-backdrop rounded-lo-radius-6 absolute top-1 right-1 z-10 flex h-6 items-center gap-1 px-0.5","pointer-events-none opacity-0 transition-opacity duration-200 group-hover/artifact-info:pointer-events-auto group-hover/artifact-info:opacity-100"),onClick:e=>e.stopPropagation(),children:[m&&(0,j.jsx)("button",{type:"button","data-testid":"agent-image-fullscreen-btn",onClick:C,className:Y,children:(0,j.jsx)(O,{className:"size-3.5"})}),w&&(0,j.jsx)(Q,{artifactId:g.draggedImage.artifact_id,elementType:"image",coverUrl:g.src}),u&&(0,j.jsx)(el,{fileUrl:g.src,fileName:g.draggedImage?.image_name,downloadHandler:d&&_?k:void 0,onDownloadCallback:c,icon:(0,j.jsx)(R.default,{className:"size-3.5"}),iconSize:14,className:Y})]}),r&&x&&(0,j.jsx)("div",{className:(0,P.default)("inline-block whitespace-nowrap",a&&a),children:(0,j.jsx)("p",{className:"overflow-hidden text-ellipsis",children:r})}),!x&&s&&(0,j.jsx)(Z,{style:l,"data-testid":o}),f]})});e.s(["default",0,ec],888591),e.s(["ImageCard",0,ec],97305);let ed={width:"86px",height:"100px",overflow:"hidden",borderRadius:"4px"},eh=(0,N.memo)(function(e){let{artifact:t,displayOrder:i,displayLength:n,threadId:r,actionId:a}=e,{shouldShowArtifactBadge:s}=(0,D.useAgentUIContext)(),l=t?.content,o=!l,[u]=(0,N.useState)(i-n),[c,d]=(0,N.useState)(u>0),h=(0,N.useMemo)(()=>({...ed,opacity:+!c}),[c]);return(0,N.useEffect)(()=>{u>0&&setTimeout(()=>{d(!1)},100*u)},[u]),(0,j.jsx)(ec,{src:l,skeleton:o,boxClassName:"transition-[opacity] duration-200 ease-in-out",boxStyle:h,skeletonStyle:ed,downloadable:!o,agentGenerated:!0,showAiGeneratedBadge:s?.({artifactType:"image",surface:"chat-card",item:t,agentGenerated:!0,threadId:r,actionId:a}),threadId:r,actionId:a})}),em=(0,N.memo)(function(e){let{artifacts:t,threadId:i,actionId:n}=e,r=t?.length??0,[a,s]=(0,N.useState)(r);return(0,N.useEffect)(()=>{r&&setTimeout(()=>{s(e=>e>=r?e:r)},2e3)},[r]),(0,j.jsx)(j.Fragment,{children:(0,j.jsx)("div",{className:"flex w-full flex-wrap gap-[6px]",children:t.map((e,t)=>(0,j.jsx)(eh,{artifact:e,displayOrder:t+1,displayLength:a,threadId:i,actionId:n},t+1))})})});var ep=e.i(714236),ef=e.i(72290),eg=e.i(178766);function ex(){return(ex=Object.assign.bind()).apply(null,arguments)}let ev=function(e){return N.createElement("svg",ex({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),r||(r=N.createElement("path",{fill:"currentColor",fillOpacity:.9,d:"M11.5 4.83a.25.25 0 0 0-.406-.195L7.017 7.897a2.75 2.75 0 0 1-1.718.603H3.75c-.69 0-1.25.56-1.25 1.25v4.5c0 .69.56 1.25 1.25 1.25h1.549c.624 0 1.23.212 1.718.602l4.077 3.263a.25.25 0 0 0 .406-.195zm10 7.17a9.47 9.47 0 0 0-2.782-6.718.75.75 0 0 1 1.06-1.06A10.97 10.97 0 0 1 23 12c0 3.037-1.232 5.788-3.222 7.778a.75.75 0 1 1-1.06-1.06A9.47 9.47 0 0 0 21.5 12m-4.75 0a4.74 4.74 0 0 0-1.392-3.359.75.75 0 0 1 1.06-1.06A6.23 6.23 0 0 1 18.25 12c0 1.725-.7 3.289-1.831 4.419a.75.75 0 1 1-1.06-1.06A4.73 4.73 0 0 0 16.75 12M13 19.17c0 1.467-1.697 2.282-2.843 1.366L6.08 17.274A1.25 1.25 0 0 0 5.3 17H3.75A2.75 2.75 0 0 1 1 14.25v-4.5A2.75 2.75 0 0 1 3.75 7h1.549c.283 0 .559-.097.78-.274l4.078-3.261C11.303 2.548 13 3.363 13 4.83z"})))};function ey(){return(ey=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,ev],116272);let e_=function(e){return N.createElement("svg",ey({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),a||(a=N.createElement("path",{fill:"currentColor",fillOpacity:.9,d:"M11.5 4.83a.25.25 0 0 0-.406-.195L7.017 7.897a2.75 2.75 0 0 1-1.718.603H3.75c-.69 0-1.25.56-1.25 1.25v4.5c0 .69.56 1.25 1.25 1.25h1.549c.624 0 1.23.212 1.717.602l4.078 3.263a.25.25 0 0 0 .406-.195zm9.47 4.64a.75.75 0 0 1 1.06 1.06l-1.591 1.59 1.591 1.593a.75.75 0 0 1-1.06 1.06l-1.591-1.59-1.59 1.59a.75.75 0 0 1-1.062-1.06l1.591-1.592-1.59-1.591a.75.75 0 1 1 1.06-1.06l1.59 1.59zM13 19.17c0 1.467-1.697 2.282-2.843 1.366L6.08 17.274A1.25 1.25 0 0 0 5.3 17H3.75A2.75 2.75 0 0 1 1 14.25v-4.5A2.75 2.75 0 0 1 3.75 7h1.549c.283 0 .559-.097.78-.274l4.078-3.262C11.303 2.548 13 3.364 13 4.831z"})))};e.s(["default",0,e_],31483);var eb=e.i(110005),ew=e.i(753935),ej=e.i(49862);let eN=function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw TypeError("Expected a function");return(0,ej.default)(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),(0,ew.default)(e,t,{leading:n,maxWait:t,trailing:r})},eE=(0,N.memo)(function(e){let t,i,{src:n,poster:r,style:a,overlay:s,onLoad:l,onLoadedData:o,threadId:u,actionId:c,artifactItem:d,agentGenerated:h=!1}=e,m=(0,N.useRef)(null),p=(0,N.useRef)(null),f=(0,N.useRef)(null),g=(0,N.useRef)(null),x=(0,N.useRef)(null),[v,y]=(0,N.useState)(!1),[_,b]=(0,N.useState)(0),[w,E]=(0,N.useState)(0),[T,C]=(0,N.useState)(1),[A,k]=(0,N.useState)(!1),[M,I]=(0,N.useState)(!1),[S,P]=(0,N.useState)(!1),[L,F]=(0,N.useState)(!1),{handleDownloadArtifact:U,interceptVideoPreview:V}=(0,D.useAgentUIContext)(),z=(0,N.useRef)(!1);(0,N.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{E(e.duration),l?.()},i=()=>{b(e.currentTime)},n=()=>{y(!0)},r=()=>{y(!1)},a=()=>{C(e.volume),I(e.muted)};return e.addEventListener("loadedmetadata",t),e.addEventListener("timeupdate",i),e.addEventListener("play",n),e.addEventListener("pause",r),e.addEventListener("volumechange",a),()=>{e.removeEventListener("loadedmetadata",t),e.removeEventListener("timeupdate",i),e.removeEventListener("play",n),e.removeEventListener("pause",r),e.removeEventListener("volumechange",a)}},[l]),(0,N.useEffect)(()=>{p.current.readyState>=HTMLMediaElement.HAVE_METADATA&&(l?.(),E(p.current.duration))},[]);let B=(0,N.useCallback)(e=>{let t=f.current;if(!t||!p.current)return;let i=t.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e-i.left)/i.width))*w;p.current.currentTime=n,b(n);let r=n/w*100;g.current&&(g.current.style.left=`${r}%`)},[w]),$=(0,N.useCallback)(eN(e=>{B(e)},100,{leading:!0,trailing:!0}),[B]),H=(0,N.useCallback)(e=>{S&&$("touches"in e?e.touches[0].clientX:e.clientX)},[S,$]),q=e=>{e.preventDefault(),z.current=v,v&&p.current&&p.current.pause(),P(!0),"touches"in e?B(e.touches[0].clientX):B(e.clientX)},W=()=>{P(!1),z.current&&p.current&&p.current.play().catch(()=>{en.logger.warn("自动恢复播放失败,可能需要用户交互")})},G=()=>{let e=p.current;e&&(v?e.pause():e.play().catch(e=>{"AbortError"!==e.name&&en.logger.warn("Video playback failed:",e)}),(0,eb.mc)("agent.video.button.click",{thread_id:u,action_id:c,video_cover_url:r,video_url:n,action_type:v?"pause":"play"},eb.DUAL_WRITE_OPTIONS))},Y=(0,N.useCallback)(async()=>
13{if(n&&!L){(0,eb.mc)("agent.export.click",{thread_id:u,action_id:c,action_type:"download",object_type:"video",object_url:n},eb.DUAL_WRITE_OPTIONS),F(!0);try{if(U&&h)return void await U({artifactType:"video",fileUrl:n,fileName:d?.video_name||"video",item:d,agentGenerated:h,threadId:u,actionId:c});let e=await fetch(n);if(!e.ok)throw Error(`HTTP error: ${e.status}`);let t=await e.blob(),i=URL.createObjectURL(t),r=document.createElement("a");r.href=i,r.setAttribute("download","video.mp4"),r.setAttribute("target","_blank"),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(i)}catch(e){en.logger.error("下载视频失败:",e)}finally{F(!1)}}},[n,L,u,c,U,h,d]),Q=_/w*100,X=_/w*100;return(0,j.jsxs)("div",{ref:m,className:"group relative bg-black",style:a,onMouseLeave:W,onTouchCancel:W,children:[(0,j.jsx)("video",{ref:p,src:n,poster:r,className:"h-full w-full cursor-pointer object-contain",playsInline:!0,onClick:()=>{V&&(p.current?.pause(),V({videoUrl:n,coverUrl:r,agentGenerated:h}))||G()},onContextMenu:e=>e.preventDefault(),onLoadedData:o}),s,(0,j.jsxs)("div",{className:(0,K.twClsx)("absolute right-0 bottom-0 left-0 h-14 px-2 pt-5 pb-2","bg-gradient-to-t from-black/50 to-transparent","linear pointer-events-none invisible transition-[visibility] duration-150 group-hover:pointer-events-auto group-hover:visible"),onMouseMove:H,onTouchMove:H,children:[(0,j.jsx)("div",{className:"w-full px-0.5",children:(0,j.jsxs)("div",{ref:f,className:"relative mb-2.5 h-0.5 w-full cursor-pointer rounded-full bg-[#7F7F7F80]",onClick:e=>{if(S)return;let t=f.current;if(!t||!p.current)return;let i=t.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width));p.current.currentTime=n*w},children:[(0,j.jsx)("div",{className:"relative h-full rounded-full transition-all duration-100",style:{width:`${S?Q:X}%`,background:"white"}}),(0,j.jsxs)("div",{ref:g,className:`absolute top-1/2 hidden items-center justify-center rounded-full group-hover:flex ${S?"z-10 scale-110":"scale-100"}`,style:{left:`${S?Q:X}%`,transform:"translate(-50%, -50%)",transition:S?"none":"all 0.1s ease"},onMouseDown:q,onTouchStart:q,onMouseUp:W,onTouchEnd:W,children:[X>10&&(0,j.jsx)("span",{className:"inline-block h-0.5 w-1 rounded-full bg-white"}),(0,j.jsx)("span",{className:"relative inline-block h-1.5 w-1.5 cursor-grab rounded-full bg-white active:cursor-grabbing"})]})]})}),(0,j.jsxs)("div",{className:"flex items-center justify-between text-white",children:[(0,j.jsxs)("div",{className:"flex items-center gap-2",children:[(0,j.jsx)("button",{onClick:G,className:"pointer-events-auto visible flex size-4 items-center justify-center",children:v?(0,j.jsx)(ef.default,{className:"size-4"}):(0,j.jsx)(eg.default,{className:"size-4"})}),(0,j.jsx)("div",{className:"text-xs whitespace-nowrap",children:Number.isFinite(w)?(t=Math.floor(w/60),i=Math.floor(w%60),`${t.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`):"00:00"})]}),(0,j.jsxs)("div",{className:"relative flex items-center justify-end gap-3",children:[(0,j.jsxs)("div",{className:"flex items-center justify-center gap-1.5",onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),children:[A&&(0,j.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,j.jsx)("div",{ref:x,className:"relative h-[3px] w-10 cursor-pointer rounded-full bg-[#7F7F7F80]",onClick:e=>{e.stopPropagation();let t=x.current;if(!t||!p.current)return;let i=t.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width));p.current.volume=n,C(n),n>0&&p.current.muted&&(p.current.muted=!1,I(!1))},children:(0,j.jsx)("div",{className:"transition-width absolute left-0 h-full w-full rounded-full duration-200",style:{width:`${100*T}%`,background:"white"}})})}),(0,j.jsx)("button",{onClick:()=>{let e=p.current;e&&(e.muted=!e.muted,I(e.muted),(0,eb.mc)("agent.video.button.click",{thread_id:u,action_id:c,video_cover_url:r,video_url:n,action_type:e.muted?"mute":"unmute"},eb.DUAL_WRITE_OPTIONS))},className:"flex size-4 items-center justify-center",children:M||0===T?(0,j.jsx)(e_,{className:"size-4"}):(0,j.jsx)(ev,{className:"size-4"})})]}),(0,j.jsx)("button",{onClick:Y,disabled:L,className:"flex items-center justify-center",title:L?"Downloading...":"",children:L?(0,j.jsx)(ep.default,{className:"size-4 animate-spin"}):(0,j.jsx)(R.default,{className:"size-4"})}),(0,j.jsx)("button",{onClick:()=>{let e=m.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen())},className:"flex items-center justify-center",children:(0,j.jsx)(O,{className:"size-4"})})]})]})]})]})});e.s(["default",0,eE],593672);var eT=e.i(636028);function eC(){return(eC=Object.assign.bind()).apply(null,arguments)}let eA=function(e){return N.createElement("svg",eC({xmlns:"http://www.w3.org/2000/svg",width:15,height:15,fill:"none",viewBox:"0 0 15 15"},e),s||(s=N.createElement("path",{fill:"#fff",d:"M7.858 2.023c.322 0 .583.262.583.584v5.591l1.92-1.92a.583.583 0 0 1 .826.825L8.27 10.019a.583.583 0 0 1-.825 0L4.53 7.103a.583.583 0 0 1 .825-.825l1.92 1.92V2.607c0-.322.262-.584.584-.584"})),l||(l=N.createElement("path",{fill:"#fff",d:"M2.608 9.023c.322 0 .583.262.583.584v2.333a.583.583 0 0 0 .583.583h8.167a.583.583 0 0 0 .583-.583V9.607a.583.583 0 0 1 1.167 0v2.333a1.75 1.75 0 0 1-1.75 1.75H3.774a1.75 1.75 0 0 1-1.75-1.75V9.607c0-.322.262-.584.584-.584"})))};function ek(){return(ek=Object.assign.bind()).apply(null,arguments)}let eM=function(e){return N.createElement("svg",ek({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20"}
13,e),o||(o=N.createElement("g",{filter:"url(#border-progress-icon_svg__a)"},N.createElement("circle",{cx:10,cy:10,r:5.25,stroke:"url(#border-progress-icon_svg__b)",strokeWidth:1.5,shapeRendering:"crispEdges"}))),u||(u=N.createElement("defs",null,N.createElement("linearGradient",{id:"border-progress-icon_svg__b",x1:15,x2:4,y1:10,y2:10,gradientUnits:"userSpaceOnUse"},N.createElement("stop",{stopColor:"#9AFFAD"}),N.createElement("stop",{offset:1,stopColor:"#FFFBD3"})),N.createElement("filter",{id:"border-progress-icon_svg__a",width:20,height:20,x:0,y:0,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},N.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),N.createElement("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),N.createElement("feOffset",null),N.createElement("feGaussianBlur",{stdDeviation:2}),N.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),N.createElement("feColorMatrix",{values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"}),N.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_14986_518397"}),N.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_14986_518397",result:"shape"})))))};function eI(){return(eI=Object.assign.bind()).apply(null,arguments)}let eS=function(e){return N.createElement("svg",eI({xmlns:"http://www.w3.org/2000/svg",width:22,height:22,fill:"none",viewBox:"0 0 22 22"},e),c||(c=N.createElement("path",{fill:"#fff",d:"M5.309 13q.055.817.157 1.63l.03.185c.193.907.94 1.603 1.873 1.72l.453.053c.392.043.786.073 1.179.1v1.504a31 31 0 0 1-1.342-.113l-.476-.056a3.69 3.69 0 0 1-3.154-2.896l-.051-.31A31 31 0 0 1 3.805 13zm
1312.904 0q-.05.683-.133 1.363l-.057.453-.052.311a3.69 3.69 0 0 1-3.154 2.896l-.475.056q-.67.072-1.341.113V16.69a29 29 0 0 0 1.63-.156 2.194 2.194 0 0 0 1.904-1.903l.056-.454q.072-.588.118-1.177zM9 5.31a29 29 0 0 0-1.179.102l-.453.054a2.19 2.19 0 0 0-1.873 1.72l-.03.183Q5.364 8.182 5.309 9H3.808q.042-.671.114-1.34l.056-.477a3.69 3.69 0 0 1 2.895-3.154l.31-.052A31 31 0 0 1 9 3.805zm4-1.505q.91.059 1.816.172a3.69 3.69 0 0 1 3.206 3.206l.057.455q.084.68.133 1.362h-1.504l-.031-.385-.087-.793-.056-.453a2.19 2.19 0 0 0-1.72-1.873l-.184-.03A29 29 0 0 0 13 5.309z"})))};function eO(){return(eO=Object.assign.bind()).apply(null,arguments)}let eR=function(e){return N.createElement("svg",eO({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),d||(d=N.createElement("path",{fill:"currentColor",d:"M5.29 4.289a.82.82 0 0 1 1.16 0l15.797 15.798a.82.82 0 1 1-1.16 1.159l-1.814-1.815q-.585.482-1.241.866a.82.82 0 0 1-1.122-.294.82.82 0 0 1 .296-1.122q.473-.277.9-.616l-3.843-3.844a18.2 18.2 0 0 1-1.207 4.53c-.46 1.12-1.857 1.393-2.732.677l-.168-.158a27 27 0 0 0-1.674-1.648c-.508-.452-1.214-.675-1.992-.675h-.896a2.114 2.114 0 0 1-2.043-1.578l-.04-.188a20.2 20.2 0 0 1 0-6.643 2.114 2.114 0 0 1 2.083-1.765h.982q.117 0 .23-.008L5.289 5.45a.82.82 0 0 1 0-1.16m2.91 4.07a5.1 5.1 0 0 1-1.624.254h-.982a.475.475 0 0 0-.466.395 18.6 18.6 0 0 0 0 6.104l.022.082a.47.47 0 0 0 .444.312h.896c1.076 0 2.204.31 3.082 1.09.642.572 1.28 1.22 1.779 1.751a.12.12 0 0 0 .112.035.1.1 0 0 0 .051-.02.1.1 0 0 0 .026-.034l.149-.38c.62-1.623.976-3.322 1.07-5.031zm8.73-4.151a.82.82 0 0 1 1.047-.331l.074.039.26.158a9.48 9.48 0 0 1 4.435 8.026l-.006.327a9.4 9.4 0 0 1-1.445 4.71L20.1 15.94a7.8 7.8 0 0 0 1.001-3.57l.005-.27a7.84 7.84 0 0 0-3.67-6.64l-.215-.131-.07-.046a.82.82 0 0 1-.222-1.076m-1.86 3.068a.82.82 0 0 1 1.048-.334l.075.038.321.202a5.89 5.89 0 0 1 2.108 7.281l-1.282-1.282a4.251 4.251 0 0 0-1.74-4.638l-.233-.145-.07-.046a.823.823 0 0 1-.226-1.076m-4.872-2.69c.858-.856 2.404-.637 2.892.568l.163.417a18.3 18.3 0 0 1 1.078 4.601l-1.996-1.996a17 17 0 0 0-.617-2.028l-.148-.379a.1.1 0 0 0-.027-.036.14.14 0 0 0-.06-.023.15.15 0 0 0-.108.021l-.025.022c-.207.236-.44.49-.687.75l-1.16-1.16c.216-.229.425-.456.614-.67z"})))};function eP(){return(eP=Object.assign.bind()).apply(null,arguments)}let eD=function(e){return N.createElement("svg",eP({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),h||(h=N.createElement("path",{fill:"currentColor",d:"M8.75 5C9.44 5 10 5.56 10 6.25v11.5a1.25 1.25 0 0 1-2.5 0V6.25C7.5 5.56 8.06 5 8.75 5m6.5 0c.69 0 1.25.56 1.25 1.25v11.5a1.25 1.25 0 0 1-2.5 0V6.25c0-.69.56-1.25 1.25-1.25"})))};function eL(){return(eL=Object.assign.bind()).apply(null,arguments)}let eF=function(e){return N.createElement("svg",eL({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20"},e),m||(m=N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:1.667,d:"M3.332 10V7.033c0-3.683 2.608-5.191 5.8-3.35l2.575 1.484 2.575 1.483c3.192 1.842 3.192 4.858 0 6.7l-2.575 1.483-2.575 1.484c-3.192 1.841-5.8.333-5.8-3.35z"})))};function eU(){return(eU=Object.assign.bind()).apply(null,arguments)}let eV=function(e){return N.createElement("svg",eU({xmlns:"http://www.w3.org/2000/svg",width:21,height:22,fill:"none",viewBox:"0 0 21 22"},e),p||(p=N.createElement("g",{stroke:"currentColor",strokeWidth:1.375,clipPath:"url(#sound-icon_svg__a)"},N.createElement("path",{strokeLinecap:"round",d:"M16.328 4.66a7.443 7.443 0 0 1-.015 12.862"}),N.createElement("path",{d:"M11.736 15.886c-.197 1.093-1.564 1.533-2.368.767a32 32 0 0 0-1.451-1.314c-.509-.428-1.161-.62-1.825-.62h-.485a1.11 1.11 0 0 1-1.096-.929 16.7 16.7 0 0 1 0-5.477 1.11 1.11 0 0 1 1.096-.928h.546c.627 0 1.247-.162 1.739-.551.476-.376.998-.845 1.486-1.306.8-.756 2.16-.349 2.358.734a27 27 0 0 1 0 9.624Z"}),N.createElement("path",{strokeLinecap:"round",d:"M14.316 7.296a4.362 4.362 0 0 1-.07 7.586"}))),f||(f=N.createElement("defs",null,N.createElement("clipPath",{id:"sound-icon_svg__a"},N.createElement("path",{fill:"#fff",d:"M.313.688h20.625v20.625H.313z"})))))},ez=(0,N.memo)(function(e){let{src:t,poster:i,aspectRatio:n="432/244",overlay:r,onLoad:a,threadId:s,actionId:l,parentThreadI
13d:o,parentActionId:u,agentName:c,artifactItem:d,agentGenerated:h=!1}=e,m=(0,N.useRef)(null),p=(0,N.useRef)(null),f=(0,N.useRef)(null),g=(0,N.useRef)(null),x=(0,N.useRef)(null),[v,y]=(0,N.useState)(!1),[_,b]=(0,N.useState)(0),[w,E]=(0,N.useState)(0),[T,C]=(0,N.useState)(!0),[A,k]=(0,N.useState)(1),[M,I]=(0,N.useState)(!1),[S,O]=(0,N.useState)(!1),[R,P]=(0,N.useState)(!1),[L,F]=(0,N.useState)(!1),{handleDownloadArtifact:U}=(0,D.useAgentUIContext)(),V=(0,N.useRef)(!1),z=function(e){if(e&&!/\/audit_invalid\/|audit_invalid\.png/i.test(e))return e}(i);(0,N.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{E(e.duration),a?.()},i=()=>{b(e.currentTime)},n=()=>{y(!0)},r=()=>{y(!1)},s=()=>{k(e.volume),O(e.muted)};return e.addEventListener("loadedmetadata",t),e.addEventListener("timeupdate",i),e.addEventListener("play",n),e.addEventListener("pause",r),e.addEventListener("volumechange",s),()=>{e.removeEventListener("loadedmetadata",t),e.removeEventListener("timeupdate",i),e.removeEventListener("play",n),e.removeEventListener("pause",r),e.removeEventListener("volumechange",s)}},[a]),(0,N.useEffect)(()=>{p.current.readyState>=HTMLMediaElement.HAVE_METADATA&&(a?.(),E(p.current.duration))},[]);let B=e=>{let t=Math.floor(e/60),i=Math.floor(e%60);return`${t.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},$=(0,N.useCallback)(e=>{let t=f.current;if(!t||!p.current)return;let i=t.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e-i.left)/i.width))*w;p.current.currentTime=n,b(n);let r=n/w*100;g.current&&(g.current.style.left=`${r}%`)},[w]),H=(0,N.useCallback)(eN(e=>{$(e)},100,{leading:!0,trailing:!0}),[$]),q=(0,N.useCallback)(e=>{R&&H("touches"in e?e.touches[0].clientX:e.clientX)},[R,H]),W=e=>{e.preventDefault(),V.current=v,v&&p.current&&p.current.pause(),P(!0),"touches"in e?$(e.touches[0].clientX):$(e.clientX)},G=()=>{P(!1),V.current&&p.current&&p.current.play().catch(()=>{en.logger.warn("自动恢复播放失败,可能需要用户交互")})},Y=()=>{let e=p.current;e&&(v?e.pause():e.play().catch(e=>{"AbortError"!==e.name&&en.logger.warn("Video playback failed:",e)}),(0,eb.mc)("agent.video.button.click",{thread_id:s,action_id:l,video_cover_url:z,video_url:t,action_type:v?"pause":"play"},eb.DUAL_WRITE_OPTIONS))},Q=(0,N.useCallback)(async()=>{if(t&&!L){(0,eT.reportAgentExportClick)({...(0,eT.toAgentTrackParams)({threadId:s,actionId:l,parentThreadId:o,parentActionId:u,agentName:c}),action_type:"download",object_type:"video",object_url:t}),F(!0);try{if(U&&h)return void await U({artifactType:"video",fileUrl:t,fileName:d?.video_name||"video",item:d,agentGenerated:h,threadId:s,actionId:l});let e=await fetch(t);if(!e.ok)throw Error(`HTTP error: ${e.status}`);let i=await e.blob(),n=URL.createObjectURL(i),r=document.createElement("a");r.href=n,r.setAttribute("download","video.mp4"),r.setAttribute("target","_blank"),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}catch(e){en.logger.error("下载视频失败:",e)}finally{F(!1)}}},[t,L,s,l,o,u,c,U,h,d]),K=_/w*100,X=_/w*100;return(0,j.jsxs)("div",{ref:m,className:"group relative bg-black",style:{aspectRatio:n},children:[(0,j.jsx)("video",{ref:p,src:t,poster:z,className:"h-full w-full object-contain",playsInline:!0,onClick:Y,onContextMenu:e=>e.preventDefault(),onLoadedData:()=>{(0,en.logger)("Video loaded:",t)}}),r,(0,j.jsxs)("div",{className:"agent-chat-video-player-controls group absolute right-0 bottom-0 left-0 bg-gradient-to-t from-black/70 to-transparent px-8 pb-4 transition-opacity duration-300",style:{opacity:T||!v?1:0},onMouseEnter:()=>C(!0),onMouseMove:q,onTouchMove:q,children:[(0,j.jsxs)("div",{ref:f,className:"relative mb-3 h-1 w-full cursor-pointer rounded-full bg-black/30",onClick:e=>{if(R)return;let t=f.current;if(!t||!p.current)return;let i=t.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width));p.current.currentTime=n*w},children:[(0,j.jsx)("div",{className:"relative h-full rounded-[22px] transition-all duration-100",style:{width:`${R?K:X}%`,background:"linear-gradient(270deg, #B1FF8C 5.17%, rgba(195, 255, 168, 0) 123.1%)"}}),(0,j.jsxs)("div",{ref:g,className:`absolute top-1/2 hidden items-center justify-center rounded-full group-hover:flex ${R?"z-10 scale-110":"scale-100"}`,style:{left:`${R?K:X}%`,transform:"translate(-50%, -50%)",transition:R?"none":"all 0.1s ease"},onMouseDown:W,onTouchStart:W,onMouseUp:G,onTouchEnd:G,children:[X>10&&(0,j.jsx)("span",{className:"inline-block h-1 w-1 rounded-full bg-white"}),(0,j.jsx)(eM,{className:"inline-block h-[15px] w-[15px] cursor-grab active:cursor-grabbing"})]})]}),(0,j.jsxs)("div",{className:"flex items-center justify-between text-white",children:[(0,j.jsxs)("div",{className:"flex items-center gap-4",children:[(0,j.jsx)("button",{onClick:Y,className:"flex h-5 w-5 items-center justify-center",children:v?(0,j.jsx)(eD,{className:"h-5 w-5"}):(0,j.jsx)(eF,{className:"h-5 w-5"})}),(0,j.jsxs)("div",{className:"text-xs",children:[B(_)," / ",B(w)]})]}),(0,j.jsxs)("div",{className:"relative flex items-center gap-3",children:[(0,j.jsx)("button",{onClick:Q,disabled:L,className:"flex items-center justify-center disabled:opacity-50",title:L?"Downloading...":"",children:L?(0,j.jsxs)("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,j.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"white",strokeWidth:"3"}),(0,j.jsx)("path",{className:"opacity-75",fill:"white",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):(0,j.jsx)(eA,{className:"h-5 w-5 [&_path]:fill-[#FFFFFF]"})}),(0,j.jsx)("button",{onClick:()=>{let e=m.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen())},className:"flex items-center justify-center",children:(0,j.jsx)(eS,{className:"h-5 w-5"})}),(0,j.jsx)("span",{className:"h-5 w-5"}),(0,j.jsxs)("div",{className:"absolute right-0 flex h-8 items-center justify-center",onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),children:[(0,j.jsx)("button",{onClick:()=>{let e=p.current;e&&(e.muted=!e.muted,O(e.muted),(0,eb.mc)("agent.video.button.click",{thread_id:s,action_id:l,video_cover_url:z,video_url:t,action_type:e.muted?"mute":"unmute"},eb.DUAL_WRITE_OPTIONS))}
13,className:"flex items-center justify-center",children:S||0===A?(0,j.jsx)(eR,{className:"h-5 w-5"}):(0,j.jsx)(eV,{className:"h-5 w-5"})}),M&&(0,j.jsx)("div",{className:"absolute bottom-[24px] left-1/2 z-10 mb-1 flex -translate-x-1/2 items-center justify-center rounded-md bg-black/80 p-1",onClick:e=>e.stopPropagation(),children:(0,j.jsx)("div",{ref:x,className:"relative h-16 w-1 cursor-pointer rounded-full bg-gray-400",onClick:e=>{e.stopPropagation();let t=x.current;if(!t||!p.current)return;let i=t.getBoundingClientRect(),n=1-Math.max(0,Math.min(1,(e.clientY-i.top)/i.height));p.current.volume=n,k(n),n>0&&p.current.muted&&(p.current.muted=!1,O(!1))},children:(0,j.jsx)("div",{className:"absolute bottom-0 w-full rounded-full",style:{height:`${100*A}%`,background:"linear-gradient(to top, #B1FF8C, rgba(195, 255, 168, 0.60))"}})})})]})]})]})]})]})});function eB(e){let{artifact:t,width:i,height:n,threadId:r,actionId:a,isNewAgentUI:s}=e,{content:l,metadata:o}=t,[u,c]=(0,N.useState)(!1),{shouldShowArtifactBadge:d}=(0,D.useAgentUIContext)(),h=(0,N.useMemo)(()=>s?eE:ez,[s]),m=i&&n?`${i}/${n}`:"16/9",p=!l,f=u&&d?.({artifactType:"video",surface:"chat-card",item:t,agentGenerated:!0,threadId:r,actionId:a});return(0,j.jsxs)("div",{className:"relative w-full overflow-hidden",style:{borderRadius:2,aspectRatio:m},children:[(p||!u)&&(0,j.jsx)(Z,{className:"pointer-events-none absolute left-0 top-0 w-full",style:{opacity:p?1:.6}}),!p&&(0,j.jsx)(h,{src:l,poster:o?.cover_url,aspectRatio:m,overlay:f?(0,j.jsx)(L.default,{}):void 0,threadId:r,actionId:a,artifactItem:t,agentGenerated:!0,onLoad:()=>c(!0)})]})}e.s(["default",0,ez],478989);let e$=(0,N.memo)(function(e){let{artifacts:t,params:i,threadId:n,actionId:r,isNewAgentUI:a}=e,{width:s,height:l}=i?.input_args?.original_unit_data||{width:16,height:9};return(0,j.jsx)("div",{className:"flex w-full flex-col gap-2",children:t.map((e,t)=>(0,j.jsx)(eB,{artifact:e,width:s,height:l,threadId:n,actionId:r,isNewAgentUI:a},t+1))})}),eH=(0,N.memo)(function(e){let{loading:t,content:i=[],input:n,sessionModeType:r,threadId:a,actionId:s,isNewAgentUI:l}=e,o=i?.[0]?.event_type,u=i?.[0]?.event_data?.artifacts,[c,d]=(0,N.useMemo)(()=>{let e=u?.[0]?.type;return t?[e,u]:[e,u?.filter(e=>!!e?.content)]},[t,u]),h=(0,N.useMemo)(()=>"replay"===r?void 0:{threadId:a,actionId:s},[a,s]);if("generator_error"===o||!t&&!c)return(0,j.jsx)(I,{generatorParams:n?.generatorParams,data:i?.[0],isNewAgentUI:l});switch(c){case"image":return(0,j.jsx)(em,{loading:t,artifacts:d,...h});case"video":return(0,j.jsx)(e$,{loading:t,artifacts:d,params:n?.generatorParams,threadId:a,actionId:s,isNewAgentUI:l});default:return null}});var eq=e.i(853410);function eW(){var e;let t,i,n,r,[a,s]=(0,N.useState)({width:0,height:0});return{ref:(e=e=>{e&&s({width:e.offsetWidth,height:e.offsetHeight})},t=(0,N.useRef)(e),i=(0,N.useRef)(null),n=(0,N.useRef)({unobserve:e=>{},observe:e=>{},disconnect:()=>{}}),r=(0,N.useCallback)(()=>{i.current&&t.current?.(i.current)},[]),(0,N.useEffect)(()=>(r(),void 0!==window.ResizeObserver&&(n.current=new ResizeObserver(()=>{r()}),i.current&&n.current.observe(i.current)),()=>{n.current&&i.current&&(n.current.unobserve(i.current),n.current.disconnect())}),[r]),i),...a}}e.s(["useElementSizeObserver",0,eW],621819);var eG=e.i(19996);let eY=(0,eG.asset)("generators.default"),eQ={nbp:"generators.nbp",gpt_image_1:"generators.gptImage1",hailuo_02:"generators.hailuo02",ideogram:"generators.ideogram",ideogram_v4:"generators.ideogramV4",kling_1_6:"generators.kling16",kling_2_0_master:"generators.kling20Master",kling_2_1:"generators.kling21",kling_2_1_master:"generators.kling21Master",ltx:"generators.ltx",luma:"generators.luma",midjourney:"generators.midjourney",qwen:"generators.qwen",recraft_v3:"generators.recraftV3",seedance_1_0:"generators.seedance10",seedream_3:"generators.seedream3",veo3:"generators.veo3",veo3_fast:"generators.veo3Fast",vidu_q1:"generators.viduQ1",wan_2_2:"generators.wan22",flux_kontext_max:"generators.fluxKontextMax",default:"generators.default"},eK=Object.fromEntries([{name:"vertex/anon-bob",display_name:"Nano Banana Pro",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/nbp.svg",description:"Google's state-of-the-art image editing model",type:"image",index:1},{name:"seedance/seedance-2-5",display_name:"Seedance 2.5",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedance_1_0.svg",description:"Fast, high-quality model from ByteDance",type:"video",index:1,is_vip:!0},{name:"seedance/seedance-2-0",display_name:"Seedance 2.0",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedance_1_0.svg",description:"Fast, high-quality model from ByteDance",type:"video",index:2,is_vip:!0},{name:"vertex/nano-banana-2",display_name:"Nano Banana 2",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/nbp.svg",description:"Google's state-of-the-art image editing model with multi-resolution support",type:"image",index:2},{name:"vertex/nano-banana-2-lite",display_name:"Nano Banana 2 Lite",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/nbp.svg",description:"Google's lightweight Nano Banana 2 image model (1K)",type:"image",index:3},{name:"seedance/seedance-2-0-fast",display_name:"Seedance 2.0 Fast",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedance_1_0.svg",description:"Fast, high-quality model from ByteDance",type:"video",index:3,is_vip:!0},{name:"seedance/seedance-2-0-mini",display_name:"Seedance 2.0 Mini",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedance_1_0.svg",description:"Fast, high-quality model from ByteDance",type:"video",index:4,is_vip:!0},{name:"openai/gpt-image-2",display_name:"GPT Image 2",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/gpt_image_1.svg",description:"OpenAI's next-generation image model",type:"image",index:4},{name:"openai/gpt-image-1-5",display_name:"GPT Image 1.5",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/gpt_image_1.svg",description:"OpenAI's most advanced image model",type:"image",index:5},{name:"kling/kling-v3",display_name:"Kling 3.0",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_2_1_master.svg",description:"Kling's latest Version high-resolution video model",type:"video",index:5,is_vip:!0},{name:"kling/kling-v3-omni",display_name:"Kling 3.0 Omni",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_2_1_master.svg",description:"Kling's latest Omni Version high-resolution video model",type:"video",index:6,is_vip:!0},{name:"seedream/seedream-5-0-pro",display_name:"Seedream 5.0 Pro",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedream_3.svg",description:"New fast, high-quality model from ByteDance",type:"image",index:6},{name:"vertex/veo3-1",display_name:"Veo 3.1",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/veo3.svg",description:"Google's latest video model with integrated audio and visuals",type:"video",index:7,is_vip:!0},{name:"luma/uni-1",display_name:"Luma Uni-1",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/luma.svg",description:"Luma Agents uni-1: text-to-image allows up to 9 reference image URLs; image-edit requires source_image and up to 8 additional reference URLs in image",type:"image",index:
137},{name:"vertex/veo3-1-fast",display_name:"Veo 3.1 Fast",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/veo3_fast.svg",description:"Fast frontier model with audio",type:"video",index:8,is_vip:!0},{name:"luma/uni-1-max",display_name:"Luma Uni-1 Max",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/luma.svg",description:"Luma Agents uni-1-max: text-to-image allows up to 9 reference image URLs; image-edit requires source_image and up to 8 additional reference URLs in image",type:"image",index:8},{name:"fal/flux-2-pro",display_name:"Flux 2 Pro",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/flux_kontext_max.svg",description:"BFL's high-fidelity image model",type:"image",index:9},{name:"vertex/gemini-omni",display_name:"Gemini Omni Flash",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/gemini_omni.svg",description:"Google's conversational video model — text-to-video and image-to-video at 720p",type:"video",index:9,is_vip:!0},{name:"fal/flux-2-max",display_name:"Flux 2 Max",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/flux_kontext_max.svg",description:"BFL's high-fidelity image model",type:"image",index:10},{name:"kling/kling-video-o1",display_name:"Kling O1",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_2_0_master.svg",description:"Kling's omni video model.",type:"video",index:10,is_vip:!0},{name:"vertex/nano-banana",display_name:"Nano Banana",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/nbp.svg",description:"Google's state-of-the-art image editing model",type:"image",index:11},{name:"kling/kling-video-extension",display_name:"Kling Video Extension",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_1_6.svg",description:"Extend an existing Kling-generated video (video-extend API).",type:"video-modify",index:11,is_vip:!0},{name:"seedream/seedream-5-0",display_name:"Seedream 5.0 Lite",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedream_3.svg",description:"New fast, high-quality model from ByteDance",type:"image",index:12},{name:"kling/kling-v2-6",display_name:"Kling 2.6",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_2_1_master.svg",description:"Kling's latest Version high-resolution video model",type:"video",index:12,is_vip:!0},{name:"seedream/seedream-4-5",display_name:"Seedream 4.5",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedream_3.svg",description:"New fast, high-quality model from ByteDance",type:"image",index:13},{name:"seedance/seedance-1-5-pro",display_name:"Seedance Pro 1.5",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedance_1_0.svg",description:"Fast, high-quality model from ByteDance",type:"video",index:13},{name:"kling/kling-v2-5-turbo",display_name:"Kling 2.5 Turbo",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_2_1_master.svg",description:"Kling's latest Turbo Version high-resolution video model",type:"video",index:14,is_vip:!0},{name:"seedream/seedream-4-0",display_name:"Seedream 4",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedream_3.svg",description:"New fast, high-quality model from ByteDance",type:"image",index:14},{name:"qwenimage/qwen-image-3-0-pro",display_name:"Qwen-Image 3.0 Pro",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/qwen.svg",description:"Alibaba Qwen-Image 3.0 Pro for text-to-image and multi-reference image editing",type:"image",index:15},{name:"wan/wan-2-6",display_name:"Wan 2.6",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/wan_2_2.svg",description:"Fast, high-quality model from Alibaba",type:"video",index:15},{name:"wan/wan-2-5-preview",display_name:"Wan 2.5",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/wan_2_2.svg",description:"Fast, high-quality model from Alibaba",type:"video",index:16},{name:"qwenimage/qwen-image-3-0",display_name:"Qwen-Image 3.0",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/qwen.svg",description:"Alibaba Qwen-Image 3.0 for text-to-image and multi-reference image editing",type:"image",index:16},{name:"vidu/vidu-q3",display_name:"Vidu Q3",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/vidu_q1.svg",description:"Vidu Q3 delivers high-fidelity short videos from start/end frames or single keyframes, with Turbo and Pro variants for different speed-quality trade-offs.",type:"video",index:17},{name:"openai/gpt-image-1",display_name:"GPT Image",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/gpt_image_1.svg",description:"OpenAI's image model",type:"image",index:17},{name:"youchuan/midjourney",display_name:"Midjourney",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/midjourney.svg",description:"An image generation model that transforms text into artistic visuals.",type:"image",index:18},{name:"vidu/vidu-q2-pro",display_name:"Vidu Q2 Pro",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/vidu_q1.svg",description:"Vidu Q2 Pro supp
13orts video reference, video editing, and video replacement with high-fidelity output.",type:"video",index:18},{name:"vidu/vidu-q2",display_name:"Vidu Q2",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/vidu_q1.svg",description:"Vidu Q2 delivers high-fidelity short videos from start/end frames or single keyframes, with Turbo and Pro variants for different speed-quality trade-offs.",type:"video",index:19},{name:"ideogram/ideogram-v4",display_name:"Ideogram 4",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/ideogram_v4.svg",description:"Ideogram 4.0 text-to-image with 2K output and Magic Prompt",type:"image",index:20},{name:"vertex/veo3",display_name:"Veo 3",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/veo3.svg",description:"Google's latest video model with integrated audio and visuals",type:"video",index:20,is_vip:!0},{name:"ideogram/ideogram-v3",display_name:"Ideogram",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/ideogram.svg",description:"Highly aesthetic, general-purpose model",type:"image",index:21},{name:"vertex/veo3-fast",display_name:"Veo 3 Fast",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/veo3_fast.svg",description:"Fast frontier model with audio",type:"video",index:21,is_vip:!0},{name:"kling/kling-v2-1-master",display_name:"Kling 2.1 Master",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_2_1_master.svg",description:"Kling's latest Master Version high-resolution video model",type:"video",index:22,is_vip:!0},{name:"ideogram/p-image-ideogram",display_name:"Ideogram P-Image",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/ideogram_v4.svg",description:"Fast, low-cost Ideogram text-to-image built with Pruna AI; four speed/quality tiers",type:"image",index:22},{name:"seedance/seedance-1-0-pro",display_name:"Seedance Pro 1.0",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedance_1_0.svg",description:"Fast, high-quality model from ByteDance",type:"video",index:23},{name:"recraft/recraft-v3",display_name:"Recraft V3",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/recraft_v3.svg",description:"High-precision AI image generation model",type:"image",index:23},{name:"kling/kling-v2-master",display_name:"Kling 2.0 Master",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_2_0_master.svg",description:"High-resolution video models of the Kling 2.0 generation",type:"video",index:24,is_vip:!0},{name:"lovart/remover",display_name:"Remover",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Lovart AI Remover",type:"image-modify",index:999},{name:"kling/kling-v2-1",display_name:"Kling 2.1",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_2_1.svg",description:"Kling's high-res video model.",type:"video",index:25,is_vip:!0},{name:"kling/kling-v1-6",display_name:"Kling 1.6",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/kling_1_6.svg",description:"High-quality model for complex scenes",type:"video",index:26,is_vip:!0},{name:"vidu/vidu-q1",display_name:"Vidu Q1",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/vidu_q1.svg",description:"Vidu Q1 is a newly released, highly controllable video large language model that excels in multi-subject detail control.",type:"video",index:27},{name:"minimax/minimax-hailuo-02",display_name:"Hailuo 02",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/hailuo_02.svg",description:"Frontier model with dynamic motion",type:"video",index:28},{name:"minimax/minimax-hailuo-2-3",display_name:"Hailuo 2.3",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/hailuo_02.svg",description:"Frontier model with dynamic motion",type:"video",index:29},{name:"minimax/minimax-hailuo-2-3-fast",display_name:"Hailuo 2.3 Fast",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/hailuo_02.svg",description:"Frontier model with dynamic motion",type:"video",index:30}
13,{name:"minimax/minimax-h3",display_name:"MiniMax-H3",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/hailuo_02.svg",description:"MiniMax-H3 video generation with 768P/2K output and multimodal reference support",type:"video",index:31},{name:"fal/ltxv",display_name:"LTXV 2.0",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/ltx.svg",description:"FAL's high-fidelity video model with audio generation",type:"video",index:32},{name:"topaz/upscale-video",display_name:"Video Upscaler",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Topaz Video Upscaler",type:"video-modify",index:999},{name:"bria/remove-video-background",display_name:"Video Background Remover",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Bria Video Background Remover",type:"video-modify",index:999},{name:"wavespeed/bria-expand",display_name:"Wavespeed Bria Expand",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Wavespeed AI Image Expand",type:"image-modify",index:999},{name:"lovart/layer-separation",display_name:"Layer Separation",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Lovart AI Layer Separation",type:"image-modify",index:999},{name:"lovart/image-expand",display_name:"Image Expand",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Lovart AI Image Expand",type:"image-modify",index:999},{name:"lovart/move-object",display_name:"Move Object",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Move object from source area to target area",type:"image-modify",index:999},{name:"lovart/font-generator",display_name:"Font Generator",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Lovart AI Font Generator",type:"font",index:999},{name:"wavespeed/image-upscaler",display_name:"Wavespeed Image Upscaler",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Wavespeed AI Image Upscaler",type:"image-modify",index:999},{name:"wavespeed/multiple-angles",display_name:"Qwen Image Edit 2509 Multiple Angles",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Wavespeed Qwen Image Edit 2509 Multiple Angles. Generates multiple-angle views from reference image(s).",type:"image-modify",index:999},{name:"seedream/seedream-5-0-pro-layer",display_name:"Seedream 5.0 Pro Layer",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/seedream_3.svg",description:"Split one image into a base image plus independently editable transparent layers using Seedream 5.0 Pro",type:"image-modify",index:999},{name:"vectorizer/vectorizer",display_name:"Image Vectorization API",icon:"https://lovart-persist-us.oss-us-east-1.aliyuncs.com/web/generator/default.svg",description:"Image Vectorization",type:"image-modify",index:999}].map(e=>{var t;let i;return{...e,icon:(t=e.icon,(i=eQ[t.split("/").pop()?.replace(/\.svg$/i,"")??""])?(0,eG.asset)(i):eY),is_ultimate:!1,is_vip:!1}}).map(e=>[e.name,e]));var eX=e.i(940674);let eZ=(0,e.i(610471).createWithEqualityFn)()(()=>({configMap:null})),{useStore:eJ,setState:e0,getState:e1}=(0,eX.createStoreUtils)(eZ);var e2=e.i(174290);let e5=[["reference_to_video","Reference"],["multi_image_to_video","Multi Image"],["video_edit","Edit"],["motion_control","Motion Control"],["start_end_frame","Frames"]],e3=(0,N.memo)(function(e){let t,{t:i}=(0,T.useI18n)(),{generatorParams:n}=e,{generator_name:r,input_args:a={}}=n,s=a?.original_unit_data,l=(t=eJ("configMap"),(0,N.useMemo)(()=>t&&Object.keys(t).length>0?t:eK,[t])),{icon:o,displayName:u}=(0,N.useMemo)(()=>{let e=l[r];return e?{icon:e.icon,displayName:e.display_name}:{icon:null,displayName:r}},[l,r]),c=(0,N.useMemo)(()=>{let e=s?.paramsText??"";if("video"===s?.generator_type){let t=e5.find(([,t])=>e?.startsWith?.(t));if(t){let[n,r]=t;e=e?.replace?.(r,i(n))}}return e},[s?.generator_type,s?.paramsText,i]);return(0,j.jsxs)("span",{className:"text-lo-text-secondary relative top-[2px] inline-flex h-[22px] w-fit items-center gap-1 text-xs",children:[o&&(0,j.jsx)(e2.ModelIcon,{model:{name:r,displayName:u,svgIconUrl:o},className:"text-lo-icon-secondary relative top-[-0.5px] size-3 shrink-0"}),(0,j.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,j.jsx)("span",{children:u}),(0,j.jsx)("span",{children:"·"}),c]})]})}),e4=/\[@(?:ref:)?(image|video|audio):([\w]+)(?::([^\]]*))?\]/g;function e7({refType:e,thumbnailUrl:t,videoUrl:i,label:n}){let r=t?(0,j.jsx)("img",{src:t,className:"size-[14px] shrink-0 rounded-sm object-cover"}):"video"===e&&i?(0,j.jsx)("video",{src:i,muted:!0,preload:"metadata",className:"size-[14px] shrink-0 rounded-sm object-cover"}):null;return(0,j.jsxs)("span",{className:"mx-0.5 inline-flex h-[20px] max-w-[140px] select-none items-center gap-1 rounded-md border-[0.5px] border-[#919191] px-1 align-baseline text-[12px] leading-[18px] text-[#363636]",children:[r,(0,j.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n})]})}let e6=(0,N.memo)(function(e){let{t}=(0,T.useI18n)(),{generatorParams:i}=e,n=i?.input_args?.original_unit_data,r=n?.prompt??i?.input_args?.prompt??"",{ref:a,width:s}=eW(),[l,o]=(0,N.useState)(!1),[u,c]=(0,N.useState)(!0);(0,N.useEffect)(()=>{a.current?.scrollHeight&&o(a.current.scrollHeight>110)},[a,s]);let d=(0,N.useMemo)(()=>(function(e){let t,i=[],n=0,r=RegExp(e4.source,"g");for(;null!==(t=r.exec(e));)t.index>n&&i.push({type:"text",value:e.slice(n,t.index)}),i.push({type:"ref",refType:t[1],refId:t[2],label:t[3]}),n=r.lastIndex;return n<e.length&&i.push({type:"text",value:e.slice(n)}),i})(r),[r]),h=d.some(e=>"ref"===e.type),m=h?"":r;return(0,j.jsxs)("div",{className:"flex w-full text-sm",children:[(0,j.jsxs)("div",{ref:a,className:(0,K.twClsx)("relative line-clamp-5 flex-1 overflow-hidden text-ellipsis",l&&!u&&"line-clamp-none"),children:[h?(0,j.jsx)("span",{className:"text-lo-text-default mr-2 select-text leading-[22px]",children:d.map((e,i)=>{let r;if("text"===e.type)return(0,j.jsx)("span",{children:e.value},i);let a=function(e,t,i){if(!i)return null;if("image"===e){let e=i.image??[],n=e.findIndex(e=>e.refId===t);return n<0?null:{thumbnailUrl:e[n].url,index:n}}if("video"===e){let e=i.video_list??[],n=e.findIndex(e=>e.refId===t);
13return n<0?null:{thumbnailUrl:e[n].cover_url||void 0,videoUrl:e[n].url,index:n}}if("audio"===e){let e=(i.audio_list??[]).findIndex(e=>e.refId===t);return e<0?null:{index:e}}return null}(e.refType,e.refId,n),s=(r=e.refType,t(`ref_type_${r}`)||r),l=a?`${s} ${a.index+1}`:e.label||s;return(0,j.jsx)(e7,{refType:e.refType,thumbnailUrl:a?.thumbnailUrl,videoUrl:a?.videoUrl,label:l},i)})}):(0,j.jsx)("span",{className:"text-lo-text-default mr-2 select-text leading-[22px]",children:m}),(0,j.jsx)(e3,{generatorParams:i}),l&&u&&(0,j.jsx)("div",{className:"bg-lo-bg-body absolute bottom-[1px] right-0 rounded px-1",children:(0,j.jsx)(e3,{generatorParams:i})})]}),(0,j.jsx)("div",{className:"flex w-8 justify-end",children:l&&(0,j.jsx)("button",{className:"hover:bg-lo-bg-overlay-hover inline-flex h-6 w-6 items-center justify-center rounded-lg",onClick:()=>c(!u),children:(0,j.jsx)(eq.default,{className:(0,K.twClsx)("h-[14px] w-[14px] [&_path]:fill-[currentColor]",!u&&"rotate-180")})})})]})}),e8=(0,N.memo)(function(e){let{generatorParams:t,sessionModeType:i}=e,{image:n=[],video_list:r=[],start_frame:a,end_frame:s,source_image:l=[]}=t?.input_args?.original_unit_data||{},o=(0,N.useMemo)(()=>{let e=[];for(let t of l)e.push({url:t.url,width:t.width,height:t.height});for(let t of n)e.push({url:t.url,width:t.width,height:t.height});let t=t=>{t&&("string"==typeof t?e.push({url:t}):t.url&&e.push({url:t.url,width:t.width,height:t.height}))};for(let i of(t(a),t(s),r))e.push({url:i.cover_url,width:i.width,height:i.height});return e},[n,r,a,s,l]);return o?.length?(0,j.jsx)("div",{className:"w-full",children:(0,j.jsx)("div",{className:(0,P.default)("group flex w-fit flex-wrap gap-1","replay"!==i&&"cursor-pointer"),onClick:()=>{(0,D.getAgentUIContext)()?.agentGeneratorHandler?.applyReference?.({generatorParams:t})},children:o.map(({url:e},t)=>(0,j.jsx)("div",{className:(0,P.default)("h-6 w-5 overflow-hidden rounded","replay"!==i&&"transition-all duration-300 group-hover:scale-105"),children:(0,j.jsx)("img",{src:e,className:"h-full w-full object-cover"})},t+1))})}):null}),e9=(0,N.memo)(function(e){let{generatorParams:t,sessionModeType:i}=e;return t?.generator_name?(0,j.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,j.jsx)(e8,{generatorParams:t,sessionModeType:i}),(0,j.jsx)(e6,{generatorParams:t})]}):null});var te=e.i(86979);function tt(){return(tt=Object.assign.bind()).apply(null,arguments)}let ti=function(e){return N.createElement("svg",tt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),g||(g=N.createElement("path",{fill:"currentColor",fillOpacity:.9,d:"M4 20.25v-3c0-.966.784-1.75 1.75-1.75h3a.75.75 0 0 1 0 1.5H6.349A7.65 7.65 0 0 0 12 19.5a7.5 7.5 0 0 0 7.442-8.438.75.75 0 1 1 1.489-.186Q21 11.43 21 12a9 9 0 0 1-9 9 9.15 9.15 0 0 1-6.5-2.714v1.964a.75.75 0 0 1-1.5 0M3 12a9 9 0 0 1 9-9 9.15 9.15 0 0 1 6.512 2.725V3.75a.75.75 0 0 1 1.5 0v3a1.75 1.75 0 0 1-1.75 1.75h-3a.75.75 0 0 1 0-1.5h2.39A7.65 7.65 0 0 0 12 4.5a7.5 7.5 0 0 0-7.442 8.439.75.75 0 1 1-1.489.185A9 9 0 0 1 3 12"})))};var tn=e.i(367236);let tr=(0,N.memo)(function(e){let{t}=(0,T.useI18n)(),{loading:i,input:n}=e;return i||!n?.generatorParams?.generator_name?null:(0,j.jsxs)("div",{className:"flex gap-2",children:[(0,j.jsx)(tn.VoteButton,{tooltip:t("agent_generator_reedit_btn"),icon:(0,j.jsx)(te.default,{className:"text-lo-icon-secondary group-hover:text-lo-icon-default size-4"}),onClick:()=>{(0,D.getAgentUIContext)()?.agentGeneratorHandler?.applyInput?.(n)}}),(0,j.jsx)(tn.VoteButton,{tooltip:t("agent_generator_regenerate_btn"),icon:(0,j.jsx)(ti,{className:"text-lo-icon-secondary group-hover:text-lo-icon-default size-4"}),onClick:()=>{(0,D.getAgentUIContext)()?.agentGeneratorHandler?.regenerate?.(n)}})]})}),ta=(0,N.memo)(function(e){let{input:t,sessionModeType:i,threadId:n,actionId:r,loading:a}=e;return(0,j.jsxs)("div",{className:"flex w-full flex-col gap-3 pb-6",children:[(0,j.jsx)(e9,{generatorParams:t?.generatorParams,sessionModeType:i}),(0,j.jsx)(eH,{...e}),"replay"!==i&&!a&&(0,j.jsx)(E.SessionVoteButtons,{threadId:n,actionId:r,resultType:"output",rootClassName:"p-0",leftPlaceholder:(0,j.jsx)(tr,{...e})})]})});e.s(["default",0,ta],438176);var ts=e.i(892534),tl=e.i(605858);function to(e){let{t}=(0,T.useI18n)(),{startTime:i,estimateWait:n=0,remainingSeconds:r=0}=e,[a,s]=(0,N.useState)(0),[l]=(0,N.useState)(()=>i>0?i:+Date.now()),o=(0,N.useMemo)(()=>r>0?r:n>0?n:60,[n,r]),u=(0,N.useMemo)(()=>{let e=+Date.now(),t=l;return e>1e3*t&&(t*=1e3),Math.max(1,Math.ceil((o-(e-t)/1e3)/60))},[l,o,a]),c=(0,N.useMemo)(()=>u>120?(0,j.jsx)("span",{children:t("agent_queue_waiting_time_over_hours",{count:2})}):(0,j.jsxs)(N.Fragment,{children:[(0,j.jsx)("span",{children:u}),(0,j.jsx)("span",{children:u>1?t("agent_queue_waiting_time_minutes"):t("agent_queue_waiting_time_minute")})]}),[u,t]);return(0,N.useEffect)(()=>{let e=setInterval(()=>{s(e=>(e+1)%10)},1e4);return()=>clearInterval(e)},[]),(0,j.jsxs)("div",{className:"text-[#00000080]",children:[(0,j.jsx)("span",{children:t("agent_queue_waiting_time_prefix")}),c]})}let tu=(0,N.memo)(function(e){let{t}=(0,T.useI18n)(),{queueInfo:i}=e,{estimate_cost:n,queue_start_time:r,estimate_wait:a,remaining_wait_seconds:s}=i,[l,o]=(0,N.useState)(!1),u="number"==typeof n&&n>0&&!!(0,D.getAgentUIContext)()?.handleSkipQueue;return a||s?(0,j.jsxs)("div",{className:"text-[13px] leading-[1.4]",children:[(0,j.jsx)(to,{startTime:r,estimateWait:a,remainingSeconds:s}),u?(0,j.jsxs)("button",{className:(0,P.default)("inline-flex items-center gap-1 text-[#147DFF]",!l&&"curs
13or-pointer",l&&"cursor-wait"),disabled:l,onClick:()=>{let{thread_id:e,action_id:t,step_id:n,tool_call_id:r,generator_task_id:a}=i;(0,D.getAgentUIContext)()?.handleSkipQueue?.({threadId:e,actionId:t,stepId:n,toolCallIds:[r],generatorTaskIds:[a]}),o(!0)},children:[(0,j.jsx)("span",{children:t("agent_queue_waiting_skip_btn_prefix")}),(0,j.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,j.jsx)(tl.default,{className:"w-2"}),(0,j.jsx)("span",{children:n})]}),(0,j.jsx)("span",{children:t("agent_queue_waiting_skip_btn_suffix")})]}):null]}):null}),tc=(0,N.memo)(function(e){let{message:t}=e;return(0,ts.checkIsAgentQueueWaitingMessage)(t)?(t?.queue_info?.tool_call_id||(t.queue_info.tool_call_id=t?.toolCallId),(0,j.jsx)("div",{className:"mt-2 flex flex-col gap-2",children:(0,j.jsx)(tu,{queueInfo:t?.queue_info})})):null});e.s(["default",0,tc],689095);var td=e.i(572935),th=e.i(812878);let tm="[::][\\s\\S]*?\\]\\([^)]+\\)\\n\\n---",tp=RegExp(`\\*\\*([^*]+)\\*\\*${tm}`,"g"),tf=RegExp(`\\*\\*[^*]+\\*\\*${tm}`),tg=/\d+\.\s*([^:]+):\s*!\[([^\]]*)\]\(([^)]+)\)/g,tx=/!\[([^\]]*)\]\(([^)]+)\)/g;function tv(){return(e,t)=>{let i,n="string"==typeof t?.value?t.value:"";if(!tf.test(n))return;let r=[];for(tp.lastIndex=0;null!==(i=tp.exec(n));){let e=i[0],t=(i[1]??"").trim(),n=function(e){let t,i=[];for(tg.lastIndex=0;null!==(t=tg.exec(e));)i.push({title:t[1]?.trim()??"",alt:t[2]??"",url:t[3]??""});if(i.length>0)return i;for(tx.lastIndex=0;null!==(t=tx.exec(e));)i.push({alt:t[1]??"",url:t[2]??""});return i}(e);n.length>0&&r.push({start:i.index,end:i.index+i[0].length,blockTitle:t,images:n})}if(0===r.length)return;let a=e.children??[],s=[];for(let e of r){let t=-1,i=-1;for(let n=0;n<a.length;n++){let r=a[n],s=r?.position?.start?.offset,l=r?.position?.end?.offset;null!=s&&null!=l&&(l<=e.start||s>=e.end||(t<0&&(t=n),i=n))}t>=0&&i>=0&&s.push({startIndex:t,endIndex:i,blockTitle:e.blockTitle,images:e.images})}for(let t=s.length-1;t>=0;t--){let{startIndex:i,endIndex:n,blockTitle:r,images:a}=s[t];e.children.splice(i,n-i+1,{type:"referenceImage",data:{hName:"referenceImage",hProperties:{blockTitle:r,images:JSON.stringify(a)}}})}}}let ty=(0,N.memo)(function(e){let{blockTitle:t,images:i}=e,n=[];try{i&&(n=JSON.parse(i))}catch{}return n.length?(0,j.jsxs)("div",{className:"flex flex-col gap-1",children:[t?(0,j.jsx)("p",{children:(0,j.jsxs)("strong",{children:[t,":"]})}):null,(0,j.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map((e,t)=>{if(!e?.url)return null;let i=e.title||e.alt||"Image";return(0,j.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,j.jsx)(eo.default,{src:e.url,alt:e.alt,className:"cursor-pointer rounded-lg bg-[#f5f5f5] object-cover",width:80,height:80}),!!i&&(0,j.jsx)("span",{className:"text-xs",children:i})]},`${e.url}-${t}`)})})]}):null});var t_=e.i(822799),tb=e.i(216920);function tw(){return e=>{(0,tb.visit)(e,"code",(e,t,i)=>{if("sug"!==e.lang)return;let n=function(e){let t;if(!e)return[];let i=[],n=/<suggestion>\s*(?:<image>([\s\S]*?)<\/image>\s*)?<label>([\s\S]*?)<\/label>\s*<prompt>([\s\S]*?)<\/prompt>\s*<\/suggestion>/gi;for(;null!==(t=n.exec(e));){let e=t[1]?.trim(),n=t[2]?.trim(),r=t[3]?.trim();n&&r&&i.push({image:e,label:n,prompt:r})}return i}(e.value);n.length&&i.children.splice(t,1,{type:"suggestion",data:{hName:"suggestion",hProperties:{suggestions:JSON.stringify(n)}}})})}}function tj(e){let{label:t,prompt:i,image:n,onApplyPrompt:r,disabled:a}=e,s=(0,N.useMemo)(()=>n&&n?.startsWith("http")?n:null,[n]),l=(0,N.useCallback)(e=>{if(!e?.clientX&&!e?.clientY)return;let t="";s&&(t=`[@image:#1:Image:${s}]`),t+=i,r?.(t)},[r,i,s]);return(0,j.jsxs)("button",{type:"button",onClick:a?void 0:l,disabled:a,className:(0,P.default)("rounded-lo-radius-8 inline-flex h-8 items-center gap-2 pl-2 pr-3","text-lo-text-default text-[13px]","transition-background-color duration-150",a?"text-lo-text-disabled cursor-default":"hover:bg-lo-bg-overlay active:bg-lo-bg-overlay-hover cursor-pointer"),children:[(0,j.jsx)(t_.default,{className:"text-lo-icon-secondary size-4"}),(0,j.jsx)("span",{children:t})]})}let tN=(0,N.memo)(function(e){let{suggestions:t,sessionModeType:i}=e,{agentChatInputHandler:n}=(0,D.useAgentUIContext)(),{threadId:r,actionId:a}=(0,B.useMessageTrackContext)(),s=(0,N.useMemo)(()=>
13{if(!t)return[];try{return JSON.parse(t)}catch{return[]}},[t]),l=(0,N.useCallback)(e=>{(0,eb.mc)("agent.suggestion.item.click",{thread_id:r,action_id:a,suggestion_content:e},eb.DUAL_WRITE_OPTIONS),n?.appendFormatTextToAgentChatInput?.(e,{focus:!0})},[n,r,a]);if(!s.length)return null;let o="replay"===i;return(0,j.jsx)("div",{className:"relative -left-2 mt-2 flex flex-col items-start gap-1",children:s.map((e,t)=>(0,j.jsx)(tj,{disabled:o,onApplyPrompt:l,...e},`${e.label}-${t}`))})}),tE=(0,N.memo)(function(e){let{children:t,className:i,components:n,sessionModeType:r}=e,a=(0,N.useMemo)(()=>({img:()=>null,referenceImage:e=>(0,j.jsx)(ty,{...e}),suggestion:e=>(0,j.jsx)(tN,{...e,sessionModeType:r}),table:({children:e,...t})=>(0,j.jsx)("div",{className:"table-wrapper agent-chat-scrollbar",children:(0,j.jsx)("table",{...t,children:e})})}),[r]),s=(0,N.useMemo)(()=>({...a,...n}),[a,n]);return(0,j.jsx)("div",{className:i,"data-testid":"agent-text-message",children:(0,j.jsx)(td.default,{remarkPlugins:[th.default,tv,tw],components:s,children:t})})});e.s(["AgentMarkdown",0,tE],864895);let tT=(0,N.memo)(function(e){let{text:t,sessionModeType:i}=e;return t?(0,j.jsx)(tE,{className:"markdown-content agent rounded-xl leading-relaxed empty:hidden",sessionModeType:i,children:t}):null});function tC(){return(0,N.useEffect)(()=>{let e=document.getElementById("agent-chat-sessions");e&&(e.style.scrollBehavior="smooth",e.scrollTop=e.scrollHeight)},[]),null}e.s(["default",0,tT],498173);let tA=(0,N.memo)(function(e){let{t}=(0,T.useI18n)(),{runningInfo:i}=e,{elapsed_seconds:n,elapsed_start_time:r}=i,[a,s]=(0,N.useState)(0),l=(0,N.useMemo)(()=>(Date.now()-r)/1e3+n,[n,r,a]);return((0,N.useEffect)(()=>{let e=setInterval(()=>{s(e=>(e+1)%10)},5e3);return()=>clearInterval(e)},[]),l<=300)?null:(0,j.jsxs)("div",{className:"text-lo-text-secondary text-xs",children:[(0,j.jsx)("span",{children:t("agent_running_long_time_tip")}),(0,j.jsx)(tC,{})]})}),tk=(0,N.memo)(function(e){let{className:t,message:i}=e;return!i?.loading||!i?.running_info?.elapsed_start_time||i?.queue_info?.event?null:(0,j.jsx)("div",{className:(0,K.twClsx)("mt-2",t&&t),children:(0,j.jsx)(tA,{runningInfo:i?.running_info})})});e.s(["default",0,tk],196710);var tM=e.i(893204);let tI={[tM.AgentToolName.MAKE_PLAN]:{initialCollapsed:!1},[tM.AgentToolName.UPDATE_PLAN]:{initialCollapsed:!1}};function tS(e){let{t}=(0,T.useI18n)(),{name:i,loading:n,content:r}=e,a=(0,N.useRef)(null),[s,l]=(0,N.useState)(0),o=!n||r?.length>0,u=(0,N.useMemo)(()=>{let e=(0,tM.getAgentToolProcessingSteps)(i,t);if(Array.isArray(e))return e;if(!0===e)return[t("agent_tool_use_processing")];let n=(0,tM.checkIsAgentToolNoContent)(i);return e||n?null:[t("agent_tool_use_processing")]},[i,t]),c=(0,N.useMemo)(()=>u?.length?u.length:0,[u]),d=(0,N.useMemo)(()=>Math.max(Math.min(c-1,s),0),[c,s]),h=(0,N.useCallback)((e=0)=>{l(e),a.current=setTimeout(()=>l(e=>e+1),1500*(e+1))},[]);return((0,N.useEffect)(()=>{if(c&&(clearTimeout(a.current),!(c<1)))return h(0),()=>clearTimeout(a.current)},[c,h]),(0,N.useEffect)(()=>{d&&h(d)},[h,d]),o||!c)?null:u?.[d]}e.s(["getAgentToolUseCollapsableProps",0,function(e){let{name:t}=e;return tI[t]}],5239),e.s(["useToolUseProcessingStep",0,tS],975252);let tO=(0,N.memo)(function(e){let{toolName:t,...i}=e,n=tS(i);return n?(0,j.jsxs)("span",{className:"flex max-w-full items-center gap-3 overflow-hidden empty:hidden",children:[(0,j.jsx)("span",{className:"text-[#A4A9B2]",children:t}),(0,j.jsx)("span",{className:"inline-flex h-[14px] w-[1px] bg-[#D9D9D9]"}),(0,j.jsx)("span",{className:"skeleton-text line-clamp-1 text-ellipsis",children:n})]}):t});function tR(e){let{className:t="absolute bottom-0 h-[90px] w-full",style:i={background:"linear-gradient(180deg, rgba(247, 247, 247, 0) 0%, #F7F7F7 80%)"}}=e;return(0,j.jsx)("div",{className:(0,P.default)("pointer-events-none",t),style:i})}e.s(["default",0,tO],13959),e.s(["useToolUseRenderState",0,function(e){let{t}=(0,T.useI18n)(),{name:i,loading:n,content:r}=e,a=(0,N.useMemo)(()=>!!r?.length&&r.filter(e=>e?.event_type!=="waiting").length>0,[r]),s=(0,N.useMemo)(()=>r?.some(e=>e?.event_type==="waiting")||!1,[r]),{toolName:l,toolIcon:o}=(0,N.useMemo)(()=>({toolName:(0,tM.getAgentToolName)(i,null,t),toolIcon:(0,tM.getAgentToolIcon)(i)}),[i,t]),u=(0,N.useMemo)(()=>!a&&(!!s||!0===n),[n,a,s]);return{toolKey:i,toolName:l,toolIcon:o,loading:n,processing:u}}],517216);let tP=(0,N.memo)(function(e){let{style:t,rootClassName:i,collapsedRootStyle:n,className:r,maxHeight:a=200,forceCollapsed:s=!1,collapsable:l=!0,initialCollapsed:o=!0,renderHeader:u,renderFooter:c,children:d,...h}
13=e,{ref:m,height:p}=eW(),[f,g]=(0,N.useState)(o),[x,v,y]=(0,N.useMemo)(()=>{if(!l)return[!1,!1,"unset"];let e=p>a,t=e&&f,i=t?a:e?p:"unset";return[e,t,i]},[p,a,l,f]),_=(0,N.useMemo)(()=>({hasCollapseButton:x,collapseToggled:f,setCollapseToggled:g,collapsed:v}),[f,v,x]),b=(0,N.useMemo)(()=>u?.(_),[u,_]),w=(0,N.useMemo)(()=>c?.(_),[c,_]);return(0,N.useEffect)(()=>{s&&g(s)},[s]),(0,j.jsxs)("div",{"data-collapsed":v,className:(0,P.default)(l&&"relative overflow-hidden transition-[height,width]",i&&i),style:{...t,...v?n:{},height:y},...h,children:[(0,j.jsxs)("div",{ref:m,className:(0,P.default)("w-full",r&&r),children:[b,d]}),w]})});function tD(){return(tD=Object.assign.bind()).apply(null,arguments)}let tL=function(e){return N.createElement("svg",tD({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),x||(x=N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M5.334 6.666 8 9.333l2.667-2.667"})))},tF=(0,N.memo)(function(e){let{headerClassName:t,leftButtonClassName:i,titleClassName:n,buttonClassName:r,title:a,icon:s,leftButton:l,rightButton:o,hasCollapseButton:u,collapseIcon:c,expandedAngle:d,collapseToggled:h,setCollapseToggled:m,collapsedHeaderStyle:p,collapsedLeftButtonStyle:f,collapsedRightButtonStyle:g}=e,x=(0,N.useMemo)(()=>"function"==typeof a?a?.(h??!1):a,[a,h]),v=(0,N.useMemo)(()=>"function"==typeof s?s?.(h??!1):s,[s,h]);return(0,j.jsxs)("div",{className:(0,P.default)(u&&"cursor-pointer",t&&t),onClick:u?()=>m?.(!h):void 0,style:h?p:void 0,children:[(0,j.jsxs)("div",{className:(0,P.default)(i&&i),style:h?f:void 0,children:[v,x&&(0,j.jsx)("div",{className:(0,P.default)("inline-block min-w-2 whitespace-nowrap"),style:{maxWidth:"calc(100%)"},children:(0,j.jsx)("div",{className:(0,P.default)("agent-chat-session-title overflow-hidden text-ellipsis",n&&n),"data-testid":"agent-chat-session-title",children:x})}),l]}),(0,j.jsxs)("div",{className:"flex flex-shrink-0 items-center justify-end gap-1",style:h?g:void 0,children:[o,u&&(0,j.jsx)("button",{className:(0,P.default)(r&&r),style:{transform:`rotate(${h?"0deg":`${d??180}deg`})`},children:c||(0,j.jsx)(tL,{})})]})]})}),tU=(0,N.memo)(function(e){let{rootClassName:t="rounded-2xl",className:i="flex flex-col gap-2 p-3",headerClassName:n,leftButtonClassName:r,collapsedLeftButtonStyle:a,titleClassName:s,buttonClassName:l,title:o,icon:u,collapseIcon:c,leftButton:d,rightButton:h,children:m,noCollapsedEffect:p,collapsedMaskClassName:f,collapsedMaskStyle:g,collapsedHeaderStyle:x,collapsedRightButtonStyle:v,expandedAngle:y,..._}=e,b=(0,N.useCallback)(e=>(0,j.jsx)(tF,{icon:u,title:o,collapseIcon:c,leftButton:d,rightButton:h,buttonClassName:l,headerClassName:n,leftButtonClassName:r,titleClassName:s,collapsedLeftButtonStyle:a,collapsedHeaderStyle:x,collapsedRightButtonStyle:v,expandedAngle:y,...e}),[u,o,c,d,h,l,n,r,s,a,x,v,y]),w=(0,N.useCallback)(e=>{let{collapsed:t}=e;return p||!t?null:(0,j.jsx)(tR,{className:f,style:g})},[p,f,g]);return(0,j.jsx)(tP,{rootClassName:t,className:i,renderHeader:b,renderFooter:w,..._,children:m})});e.s(["default",0,tU],57352);let tV=(0,N.memo)(function(e){let{loading:t,...i}=e;return(0,j.jsx)(tU,{rootClassName:"w-full",className:"flex flex-col gap-2",headerClassName:"flex items-center justify-between text-[12px] text-[#A4A9B2] collapsable-tool-use-header",leftButtonClassName:"max-w-full h-4 flex items-center gap-1 transition-color",titleClassName:(0,P.default)("font-[Poppins] font-medium",t&&"skeleton-text"),...i})});e.s(["CollapsableToolUseCard",0,tV],397349);let tz=(0,N.memo)(function(e){let{event_data:t}=e,i=(0,N.useMemo)(()=>{if(!t?.artifact?.length)return null;let e="";for(let i of t.artifact)e+=i?.summary||"";return e},[t]);return i?(0,j.jsx)("div",{className:"markdown-content mx-2",children:(0,j.jsx)(td.default,{children:i})}):null});e.s(["default",0,tz],935406);var tB=e.i(264458),t$=e.i(937824),tH=e.i(272657);let tq=e=>{let{prefixCls:t,className:i,style:n,size:r,shape:a}=e,s=(0,tB.default)({[`${t}-lg`]:"large"===r,[`${t}-sm`]:"small"===r}),l=(0,tB.default)({[`${t}-circle`]:"circle"===a,[`${t}-square`]:"square"===a,[`${t}-round`]:"round"===a}),o=N.useMemo(()=>"number"==typeof r?{width:r,height:r,lineHeight:`${r}px`}:{},[r]);return N.createElement("span",{className:(0,tB.default)(t,s,l,i),style:Object.assign(Object.assign({},o),n)})};e.i(284328);var tW=e.i(978513),tG=e.i(269088),tY=e.i(929530),tQ=e.i(204116);let tK=new tW.Keyframes("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),tX=e=>({height:e,lineHeight:(0,tG.unit)(e)}),tZ=e=>Object.assign({width:e},tX(e)),tJ=(e,t)=>
13Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},tX(e)),t0=e=>Object.assign({width:e},tX(e)),t1=(e,t,i)=>{let{skeletonButtonCls:n}=e;return{[`${i}${n}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${i}${n}-round`]:{borderRadius:t}}},t2=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},tX(e)),t5=(0,tY.genStyleHooks)("Skeleton",e=>{let{componentCls:t,calc:i}=e;return(e=>{let{componentCls:t,skeletonAvatarCls:i,skeletonTitleCls:n,skeletonParagraphCls:r,skeletonButtonCls:a,skeletonInputCls:s,skeletonImageCls:l,controlHeight:o,controlHeightLG:u,controlHeightSM:c,gradientFromColor:d,padding:h,marginSM:m,borderRadius:p,titleHeight:f,blockRadius:g,paragraphLiHeight:x,controlHeightXS:v,paragraphMarginTop:y}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:h,verticalAlign:"top",[i]:Object.assign({display:"inline-block",verticalAlign:"top",background:d},tZ(o)),[`${i}-circle`]:{borderRadius:"50%"},[`${i}-lg`]:Object.assign({},tZ(u)),[`${i}-sm`]:Object.assign({},tZ(c))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[n]:{width:"100%",height:f,background:d,borderRadius:g,[`+ ${r}`]:{marginBlockStart:c}},[r]:{padding:0,"> li":{width:"100%",height:x,listStyle:"none",background:d,borderRadius:g,"+ li":{marginBlockStart:v}}},[`${r}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${n}, ${r} > li`]:{borderRadius:p}}},[`${t}-with-avatar ${t}-content`]:{[n]:{marginBlockStart:m,[`+ ${r}`]:{marginBlockStart:y}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},(e=>{let{borderRadiusSM:t,skeletonButtonCls:i,controlHeight:n,controlHeightLG:r,controlHeightSM:a,gradientFromColor:s,calc:l}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[i]:Object.assign({display:"inline-block",verticalAlign:"top",background:s,borderRadius:t,width:l(n).mul(2).equal(),minWidth:l(n).mul(2).equal()},t2(n,l))},t1(e,n,i)),{[`${i}-lg`]:Object.assign({},t2(r,l))}),t1(e,r,`${i}-lg`)),{[`${i}-sm`]:Object.assign({},t2(a,l))}),t1(e,a,`${i}-sm`))})(e)),(e=>{let{skeletonAvatarCls:t,gradientFromColor:i,controlHeight:n,controlHeightLG:r,controlHeightSM:a}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:i},tZ(n)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},tZ(r)),[`${t}${t}-sm`]:Object.assign({},tZ(a))}})(e)),(e=>{let{controlHeight:t,borderRadiusSM:i,skeletonInputCls:n,controlHeightLG:r,controlHeightSM:a,gradientFromColor:s,calc:l}=e;return{[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:s,borderRadius:i}
13,tJ(t,l)),[`${n}-lg`]:Object.assign({},tJ(r,l)),[`${n}-sm`]:Object.assign({},tJ(a,l))}})(e)),(e=>{let{skeletonImageCls:t,imageSizeBase:i,gradientFromColor:n,borderRadiusSM:r,calc:a}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:n,borderRadius:r},t0(a(i).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},t0(i)),{maxWidth:a(i).mul(4).equal(),maxHeight:a(i).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}})(e)),[`${t}${t}-block`]:{width:"100%",[a]:{width:"100%"},[s]:{width:"100%"}},[`${t}${t}-active`]:{[`
14        ${n},
15        ${r} > li,
16        ${i},
17        ${a},
18        ${s},
19        ${l}
20      `]:Object.assign({},{background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:tK,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"})}}})((0,tQ.mergeToken)(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:i(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"}))},e=>{let{colorFillContent:t,colorFill:i}=e;return{color:t,colorGradientEnd:i,gradientFromColor:t,gradientToColor:i,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),t3=e=>{let{prefixCls:t,className:i,style:n,rows:r=0}=e,a=Array.from({length:r}).map((t,i)=>N.createElement("li",{key:i,style:{width:((e,t)=>{let{width:i,rows:n=2}=t;return Array.isArray(i)?i[e]:n-1===e?i:void 0})(i,e)}}));return N.createElement("ul",{className:(0,tB.default)(t,i),style:n},a)},t4=({prefixCls:e,className:t,width:i,style:n})=>N.createElement("h3",{className:(0,tB.default)(e,t),style:Object.assign({width:i},n)});function t7(e){return e&&"object"==typeof e?e:{}}let t6=e=>{let{prefixCls:t,loading:i,className:n,rootClassName:r,style:a,children:s,avatar:l=!1,title:o=!0,paragraph:u=!0,active:c,round:d}=e,{getPrefixCls:h,direction:m,className:p,style:f}=(0,t$.useComponentConfig)("skeleton"),g=h("skeleton",t),[x,v,y]=t5(g);if(i||!("loading"in e)){let e,t,i=!!l,s=!!o,h=!!u;if(i){let t=Object.assign(Object.assign({prefixCls:`${g}-avatar`},s&&!h?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),t7(l));e=N.createElement("div",{className:`${g}-header`},N.createElement(tq,Object.assign({},t)))}if(s||h){let e,n;if(s){let t=Object.assign(Object.assign({prefixCls:`${g}-title`},!i&&h?{width:"38%"}:i&&h?{width:"50%"}:{}),t7(o));e=N.createElement(t4,Object.assign({},t))}if(h){let e,t=Object.assign(Object.assign({prefixCls:`${g}-paragraph`},(e={},i&&s||(e.width="61%"),!i&&s?e.rows=3:e.rows=2,e)),t7(u));n=N.createElement(t3,Object.assign({},t))}t=N.createElement("div",{className:`${g}-content`},e,n)}let _=(0,tB.default)(g,{[`${g}-with-avatar`]:i,[`${g}-active`]:c,[`${g}-rtl`]:"rtl"===m,[`${g}-round`]:d},p,n,r,v,y);return x(N.createElement("div",{className:_,style:Object.assign(Object.assign({},f),a)},e,t))}return null!=s?s:null};t6.Button=e=>{let{prefixCls:t,className:i,rootClassName:n,active:r,block:a=!1,size:s="default"}=e,{getPrefixCls:l}=N.useContext(t$.ConfigContext),o=l("skeleton",t),[u,c,d]=t5(o),h=(0,tH.default)(e,["prefixCls"]),m=(0,tB.default)(o,`${o}-element`,{[`${o}-active`]:r,[`${o}-block`]:a},i,n,c,d);return u(N.createElement("div",{className:m},N.createElement(tq,Object.assign({prefixCls:`${o}-button`,size:s},h))))},t6.Avatar=e=>{let{prefixCls:t,className:i,rootClassName:n,active:r,shape:a="circle",size:s="default"}=e,{getPrefixCls:l}=N.useContext(t$.ConfigContext),o=l("skeleton",t),[u,c,d]=t5(o),h=(0,tH.default)(e,["prefixCls","className"]),m=(0,tB.default)(o,`${o}-element`,{[`${o}-active`]:r},i,n,c,d);return u(N.createElement("div",{className:m},N.createElement(tq,Object.assign({prefixCls:`${o}-avatar`,shape:a,size:s},h))))},t6.Input=e=>{let{prefixCls:t,className:i,rootClassName:n,active:r,block:a,size:s="default"}=e,{getPrefixCls:l}=N.useContext(t$.ConfigContext),o=l("skeleton",t),[u,c,d]=t5(o),h=(0,tH.default)(e,["prefixCls"]),m=(0,tB.default)(o,`${o}-element`,{[`${o}-active`]:r,[`${o}-block`]:a},i,n,c,d);return u(N.createElement("div",{className:m},N.createElement(tq,Object.assign({prefixCls:`${o}-input`,size:s},h))))},t6.Image=e=>{let{prefixCls:t,className:i,rootClassName:n,style:r,active:a}=e,{getPrefixCls:s}=N.useContext(t$.ConfigContext),l=s("skeleton",t),[o,u,c]=t5(l),d=(0,tB.default)(l,`${l}-element`,{[`${l}-active`]:a},i,n,u,c);return o(N.createElement("div",{className:d},N.createElement("div",{className:(0,tB.default)(`${l}-image`,i),style:r},N.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${l}-image-svg`},N.createElement("title",null,"Image placeholder"),N.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:`${l}-image-path`})))))},t6.Node=e=>{let{prefixCls:t,className:i,rootClassName:n,style:r,active:a,children:s}=e,{getPrefixCls:l}=N.useContext(t$.ConfigContext),o=l("skeleton",t),[u,c,d]=t5(o),h=(0,tB.default)(o,`${o}-element`,{[`${o}-active`]:a},c,i,n,d);return u(N.createElement("div",{className:h},N.createElement("div",{className:(0,tB.default)(`${o}-image`,i),style:r},s)))},e.s(["Skeleton",0,t6],73326);let t8=(0,N.memo)(function(e){let{text:t,className:i="flex-1",textClassName:n="line-clamp-1",textStyle:r,leftBtn:a,rightBtn:s,...l}=e;return t?(0,j.jsxs)("div",{className:(0,P.default)("overflow-hidden empty:hidden",i&&i),...l,children:[a,(0,j.jsx)("div",{className:(0,P.default)("text-ellipsis empty:hidden",n&&n),style:r,children:t}),s]}):null}),t9=(0,N.memo)(function(e){let{title:t,titleClassName:i="line-clamp-1",titleStyle:n,...r}=e;return t?(0,j.jsx)(t8,{text:t,className:"flex min-w-2 max-w-full items-center justify-between",textClassName:(0,P.default)("cursor-text select-text break-all font-[Poppins] text-sm font-semibold text-[#2F3640]",i&&i),textStyle:n,...r}):null});e.s(["EllipsisTitle",0,t9],326496);let ie=(0,N.memo)(function(e){let{rootClassName:t="flex max-w-full w-fit flex-col gap-2",rootStyle:i,children:n,"data-testid":r,...a}=e;return(0,j.jsxs)("div",{className:t,style:i,"data-testid":r,children:[(0,j.jsx)(t9,{...a}),n]})});function it(){return(it=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,ie],930479);let ii=function(e){return N.createElement("svg",it({xmlns:"http://www.w3.org/2000/svg",width:75,height:75,fill:"none",viewBox:"0 0 75 75"},e),v||(v=N.createElement("rect",{width:73,height:73,x:1,y:1,fill:"#0E1014",rx:36.5}
20)),y||(y=N.createElement("rect",{width:73,height:73,x:1,y:1,stroke:"#F6F6F6",strokeWidth:2,rx:36.5})),_||(_=N.createElement("path",{fill:"#fff",d:"M23.6 60.121a.57.57 0 1 1 0 1.138.57.57 0 0 1 0-1.138m15.117-1.64a.459.459 0 1 1-.002.917.459.459 0 0 1 .002-.918m-10.751-.517a.689.689 0 1 1 0 1.377.689.689 0 0 1 0-1.377m25.67-1.02a.303.303 0 1 1-.001.606.303.303 0 0 1 0-.607m-10.614-.562a.561.561 0 1 1 0 1.123.561.561 0 0 1 0-1.123m-10.75-.583a.8.8 0 1 1 0 1.598.8.8 0 0 1 0-1.598m-10.555 0a.57.57 0 1 1 0 1.138.57.57 0 0 1 0-1.138m36.316-1.054a.474.474 0 1 1-.001.949.474.474 0 0 1 .001-.949m-10.723-.554a.705.705 0 1 1-.001 1.41.705.705 0 0 1 .002-1.41m-10.735-.49a.914.914 0 1 1 0 1.828.914.914 0 0 1 0-1.829m-10.56-.413a1.035 1.035 0 1 1 0 2.07 1.035 1.035 0 0 1 0-2.07m25.662-1.325a.864.864 0 1 1 0 1.728.864.864 0 0 1 0-1.728M40.96 51.49a1.042 1.042 0 1 1 0 2.085 1.042 1.042 0 0 1 0-2.085M62.285 53a.262.262 0 1 1-.001.523.262.262 0 0 1 .001-.523M30.32 51.028a1.237 1.237 0 1 1-.001 2.474 1.237 1.237 0 0 1 .001-2.474m-10.666.657a.38.38 0 1 1 0 .76.38.38 0 0 1 0-.76m36.235-1.748a1.013 1.013 0 1 1 0 2.026 1.013 1.013 0 0 1 0-2.026M45.25 49.31a1.18 1.18 0 1 1 0 2.36 1.18 1.18 0 0 1 0-2.36m-10.682-.527a1.422 1.422 0 1 1 0 2.844 1.422 1.422 0 0 1 0-2.844m-10.535.31a.886.886 0 1 1 0 1.771.886.886 0 0 1 0-1.771m25.526-1.92a1.318 1.318 0 1 1 0 2.637 1.318 1.318 0 0 1 0-2.636m-10.66-.514a1.529 1.529 0 1 1-.001 3.058 1.529 1.529 0 0 1 0-3.058m-10.485-.013a1.364 1.364 0 1 1 0 2.73 1.364 1.364 0 0 1 0-2.73m31.83 1.783a.471.471 0 1 1 0 .942.471.471 0 0 1 0-.942m-42.59-.882a.206.206 0 1 1 0 .411.206.206 0 0 1 0-.411M53.84 45.53a1.137 1.137 0 1 1 0 2.274 1.137 1.137 0 0 1 0-2.274m-10.588-.93a1.566 1.566 0 1 1 0 3.131 1.566 1.566 0 0 1 0-3.131m-10.614-.462a1.772 1.772 0 1 1 0 3.543 1.772 1.772 0 0 1 0-3.543m-10.645.816a.763.763 0 1 1-.001 1.527.763.763 0 0 1 .001-1.527m25.461-2.326a1.635 1.635 0 1 1 0 3.27 1.635 1.635 0 0 1 0-3.27m-10.571-.622a1.904 1.904 0 1 1 0 3.808 1.904 1.904 0 0 1 0-3.808m21.323 1.951a.64.64 0 1 1-.001 1.28.64.64 0 0 1 .001-1.28m-31.831-1.587a1.274 1.274 0 1 1-.001 2.548 1.274 1.274 0 0 1 .001-2.548m14.873-2.433a1.937 1.937 0 1 1 0 3.875 1.937 1.937 0 0 1 0-3.875m10.576 1.076a1.274 1.274 0 1 1 0 2.548 1.274 1.274 0 0 1 0-2.548m-21.111-1.01a1.683 1.683 0 1 1 0 3.367 1.683 1.683 0 0 1 0-3.367m-10.734.722a.663.663 0 1 1 0 1.326.663.663 0 0 1 0-1.326m15.08-3.103a2.052 2.052 0 1 1 0 4.103 2.052 2.052 0 0 1 0-4.103m10.365.645a1.71 1.71 0 1 1 0 3.42 1.71 1.71 0 0 1 0-3.42M56.2 39.526a.744.744 0 1 1-.001 1.488.744.744 0 0 1 .001-1.488m-31.874-1.355a1.155 1.155 0 1 1 0 2.31 1.155 1.155 0 0 1 0-2.31m14.853-2.52a2.07 2.07 0 1 1 0 4.14 2.07 2.07 0 0 1 0-4.14m10.601.942a1.348 1.348 0 1 1 0 2.695 1.348 1.348 0 0 1 0-2.695m-21.16-.776a1.55 1.55 0 1 1-.002 3.1 1.55 1.55 0 0 1 .001-3.1m-10.713.666a.538.538 0 1 1 0 1.076.538.538 0 0 1 0-1.076m25.535-2.648a1.81 1.81 0 1 1 0 3.621 1.81 1.81 0 0 1 0-3.621m-10.497-.3a1.904 1.904 0 1 1 0 3.808 1.904 1.904 0 0 1 0-3.808m21.234 1.502a.878.878 0 1 1 0 1.756.878.878 0 0 1 0-1.756m-31.893-1.014a1.002 1.002 0 1 1-.001 2.004 1.002 1.002 0 0 1 .001-2.004m14.995-2.49a1.904 1.904 0 1 1 0 3.807 1.904 1.904 0 0 1 0-3.808m10.428.639a1.464 1.464 0 1 1 0 2.928 1.464 1.464 0 0 1 0-2.928m-21.066-.631a1.441 1.441 0 1 1 0 2.882 1.441 1.441 0 0 1 0-2.882m31.87 2.004a.323.323 0 1 1 0 .646.323.323 0 0 1 0-.646m-16.89-4.041a1.889 1.889 0 1 1 0 3.778 1.889 1.889 0 0 1 0-3.778m-25.673 2.958a.314.314 0 1 1-.001.628.314.314 0 0 1 .001-.628m14.929-2.896a1.607 1.607 0 1 1-.001 3.214 1.607 1.607 0 0 1 0-3.214m21.267 1.018a1.037 1.037 0 1 1 0 2.074 1.037 1.037 0 0 1 0-2.074m-31.864-.69a.843.843 0 1 1 0 1.685.843.843 0 0 1 0-1.685m25.43-2.222a1.584 1.584 0 1 1 0 3.169 1.584 1.584 0 0 1 0-3.17m-10.53-.09a1.535 1.535 0 1 1 0 3.07 1.535 1.535 0 0 1 0-3.07m21.334 1.47a.528.528 0 1 1 0 1.057.528.528 0 0 1 0-1.057m-31.943-1.658a1.32 1.32 0 1 1 0 2.64 1.32 1.32 0 0 1 0-2.64m25.528-1.286a1.2 1.2 0 1 1 0 2.399 1.2 1.2 0 0 1 0-2.399m-10.566-.384a1.385 1.385 0 1 1 0 2.769 1.385 1.385 0 0 1 0-2.77m-10.633-.149a1.25 1.25 0 1 1 0 2.501 1.25 1.25 0 0 1 0-2.5m-10.585.095a.748.748 0 1 1-.001 1.495.748.748 0 0 1 .001-1.495m25.53-1.87a1.281 1.281 0 1 1 0 2.563 1.281 1.281 0 0 1 0-2.562m10.669.808a.685.685 0 1 1 0 1.371.685.685 0 0 1 0-1.37m-21.267-.89a1.062 1.062 0 1 1-.001 2.125 1.062 1.062 0 0 1 .001-2.124m-10.744-.116a.865.865 0 1 1 0 1.73.865.865 0 0 1 0-1.73m25.69-1.773a1.2 1.2 0 1 1 0 2.398 1.2 1.2 0 0 1 0-2.398m-10.669-.137a.977.977 0 1 1 0 1.954.977.977 0 0 1 0-1.954m-10.632-.018a.758.758 0 1 1-.002 1.515.758.758 0 0 1 .002-1.515M16.148 21.6a.512.512 0 1 1 0 1.024.512.512 0 0 1 0-1.024m36.307-1.49a.815.815 0 1 1 0 1.63.815.815 0 0 1 0-1.63m-10.628-.239a.855.855 0 1 1 0 1.71.855.855 0 0 1 0-1.71m-10.662-.106a.638.638 0 1 1-.002 1.277.638.638 0 0 1 .002-1.277m-10.7-.051a.365.365 0 1 1 0 .73.365.365 0 0 1 0-.73m25.676-1.742a.708.708 0 1 1 0 1.416.708.708 0 0 1 0-1.416m-10.605-.054a.448.448 0 1 1 0 .896.448.448 0 0 1 0-.896m14.968-1.911a.596.596 0 1 1 0 1.19.596.596 0 0 1 0-1.19m-10.652.02a.283.283 0 1 1 0 .566.283.283 0 0 1 0-.567m14.927-1.901a.448.448 0 1 1-.001.896.448.448 0 0 1 .001-.896"})))};function ir(e){let t=Math.floor(e/60),i=Math.floor(e%60);return`${t.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}let ia=(0,N.memo)(function(e){let{src:t,coverImage:i,title:n,onLoad:r,onCanPlay:a,threadId:s,actionId:l,parentThreadI
20d:o,parentActionId:u,agentName:c,className:d,artifactItem:h,agentGenerated:m=!1}=e,p=(0,N.useRef)(null),f=(0,N.useRef)(null),g=(0,N.useRef)(null),[x,v]=(0,N.useState)(!1),[y,_]=(0,N.useState)(0),[b,w]=(0,N.useState)(0),[E,T]=(0,N.useState)(1),[C,A]=(0,N.useState)(!1),[k,M]=(0,N.useState)(!1),[I,S]=(0,N.useState)(!1),{width:O,ref:R}=eW(),{handleDownloadArtifact:L}=(0,D.useAgentUIContext)();(0,N.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{w(e.duration),S(!0),r?.()},i=()=>{S(!0),a?.()},n=()=>{_(e.currentTime)},s=()=>{v(!0)},l=()=>{v(!1)},o=()=>{T(e.volume),M(e.muted)},u=()=>{v(!1),_(0),e.currentTime=0};return e.addEventListener("loadedmetadata",t),e.addEventListener("canplay",i),e.addEventListener("timeupdate",n),e.addEventListener("play",s),e.addEventListener("pause",l),e.addEventListener("volumechange",o),e.addEventListener("ended",u),()=>{e.removeEventListener("loadedmetadata",t),e.removeEventListener("canplay",i),e.removeEventListener("timeupdate",n),e.removeEventListener("play",s),e.removeEventListener("pause",l),e.removeEventListener("volumechange",o),e.removeEventListener("ended",u)}},[r,a]);let F=()=>{let e=p.current;e&&(x?e.pause():e.play(),(0,eb.mc)("agent.audio.button.click",{thread_id:s,action_id:l,audio_url:t,action_type:x?"pause":"play"},eb.DUAL_WRITE_OPTIONS))},U=async()=>{if(!t)return;if((0,eT.reportAgentExportClick)({...(0,eT.toAgentTrackParams)({threadId:s,actionId:l,parentThreadId:o,parentActionId:u,agentName:c}),action_type:"download",object_type:"audio",object_url:t}),L&&m)return void await L({artifactType:"audio",fileUrl:t,fileName:n||"audio",item:h,agentGenerated:m,threadId:s,actionId:l});let e=document.createElement("a");e.href=t,e.setAttribute("download",n?`${n}.mp3`:"audio.mp3"),e.setAttribute("target","_blank"),fetch(t).then(e=>e.blob()).then(t=>{let i=URL.createObjectURL(t);e.href=i,document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(i)}).catch(e=>{en.logger.error("下载音频失败:",e)})};return(0,j.jsxs)("div",{className:(0,P.default)(d,"mt-4 flex h-[74px] w-[95%] flex-col items-center rounded-lg bg-black/5",!I&&"opacity-60"),children:[(0,j.jsx)("audio",{ref:p,src:t,className:"hidden"}),(0,j.jsxs)("div",{className:"relative h-[74px] w-full items-center",children:[(0,j.jsxs)("div",{ref:R,className:"agent-chat-audio-player-controls flex items-center px-4",children:[(0,j.jsxs)("div",{className:(0,P.default)("agent-chat-audio-player-cover relative bottom-[17px] h-[75px] w-[75px] flex-shrink-0 rounded-full border-[2px] border-[#F6F6F6] bg-gray-200"),onClick:F,children:[i&&(0,j.jsx)("img",{src:i,alt:n,className:"h-full w-full rounded-full object-cover"}),!i&&(0,j.jsx)(ii,{className:"h-full w-full"})]}),(0,j.jsxs)("div",{className:"agent-chat-audio-player-controls-content ml-3 flex flex-1 items-center justify-between gap-4",children:[(0,j.jsxs)("div",{className:"flex items-center gap-3",children:[(0,j.jsx)("div",{className:"agent-chat-audio-player-play-pause-button pointer-events-auto cursor-pointer rounded-full bg-white p-2",onClick:F,children:x?(0,j.jsx)(eD,{className:"h-[24px] w-[24px] text-[#527456]"}):(0,j.jsx)(eF,{className:"h-[24px] w-[24px] text-[#86909C]"})}),O>325&&(0,j.jsxs)("div",{className:"pointer-events-auto text-nowrap text-xs font-medium text-[#2F3640]",children:[ir(y)," / ",ir(b)]})]}),(0,j.jsxs)("div",{className:"flex items-center gap-3",children:[(0,j.jsx)("button",{onClick:()=>{U()},className:"pointer-events-auto flex items-center justify-center text-gray-600 hover:text-gray-800",disabled:!I,children:(0,j.jsx)(eA,{className:"h-[22px] w-[22px] [&_path]:fill-[#86909C]"})}),(0,j.jsxs)("div",{className:"relative flex h-16 items-center justify-center",onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:[(0,j.jsx)("button",{onClick:()=>{let e=p.current;e&&(e.muted=!e.muted,M(e.muted),(0,eb.mc)("agent.audio.button.click",{thread_id:s,action_id:l,audio_url:t,action_type:e.muted?"mute":"unmute"},eb.DUAL_WRITE_OPTIONS))},className:"pointer-events-auto flex items-center justify-center text-gray-600 hover:text-gray-800",children:k||0===E?(0,j.jsx)(eR,{className:"h-[22px] w-[22px] text-[#86909C]"}):(0,j.jsx)(eV,{className:"h-[22px] w-[22px] text-[#86909C]"})}),C&&(0,j.jsx)("div",{className:"pointer-events-auto absolute bottom-[50px] left-1/2 z-10 flex -translate-x-1/2 items-center justify-center rounded-md border border-gray-200 bg-white p-1 shadow-lg",onClick:e=>e.stopPropagation(),children:(0,j.jsx)("div",{ref:g,className:"relative h-16 w-1 cursor-pointer rounded-full bg-gray-300",onClick:e=>{e.stopPropagation();let t=g.current;if(!t||!p.current)return;let i=t.getBoundingClientRect(),n=1-Math.max(0,Math.min(1,(e.clientY-i.top)/i.height));p.current.volume=n,T(n),n>0&&p.current.muted&&(p.current.muted=!1,M(!1))},children:(0,j.jsx)("div",{className:"absolute bottom-0 w-full rounded-full",style:{height:`${100*E}%`,background:"linear-gradient(to top, #4ade80, #86efac)"}})})})]})]})]})]}),(0,j.jsx)("div",{ref:f,className:"pointer-events-auto relative bottom-[5px] left-[1%] h-[5px] w-[97%] cursor-pointer rounded-full",onClick:e=>{let t=f.current;if(!t||!p.current)return;let i=t.getBoundingClientRect(),n=(e.clientX-i.left)/i.width;p.current.currentTime=n*b},children:(0,j.jsx)("div",{className:"group relative h-full rounded-full",style:{width:`${y/b*100}%`,background:"linear-gradient(90deg, #FFF 0%, #B1E783 100%)"},children:(0,j.jsx)("span",{className:"absolute -bottom-[4px] -right-[10px] hidden h-[15px] w-[15px] rounded-full border-[2px] border-[#B8E98D] bg-white group-hover:block"})})})]})]})}),is=(0,N.memo)(function(e){let{t}=(0,T.useI18n)(),{eventType:i,audioInfo:n,threadId:r,actionId:a}=e,[s,l]=(0,N.useState)(!1),{shouldShowArtifactBadge:o}=(0,D.useAgentUIContext)(),u=s&&o?.({artifactType:"audio",surface:"chat-card",item:n,agentGenerated:!0,threadId:r,actionId:a}),c=(0,N.useMemo)(()=>"text_to_speech"===i?t("agent_tool_voice_generation_title"):s?n?.title?n?.title:t("agent_tool_audio_generation_title"):t("audio_generation_waiting"),[n.title,s,i,t]);return(0,j.jsx)(ie,{"data-testid":"audio-generation-card",title:c,rootClassName:"flex flex-col gap-2",children:(0,j.jsxs)("div",{className:(0,P.default)("relative min-h-24 w-full"),children:[n?.audio_url&&(0,j.jsx)(ia,{src:n.audio_url,coverImage:n.cover_url||void 0,title:n.title,onCanPlay:()=>l(!0),threadId:r,actionId:a,artifactItem:n,agentGenerated:!0}),u&&(0,j.jsx)(L.default,{compact:!0}),!s&&!n?.audio_url&&(0,j.jsx)(t6.Node,{active:!0,"data-testid":"audio-loading-skeleton",className:"absolute left-0 top-0",style:{width:260,height:90,borderRadius:20}})]})})}),il=(0,N.memo)(function(e){let{event_data:t,event_type:i,threadId:n,actionId:r}=e,a=(0,N.useMemo)(()=>t?.artifact?.length?t.artifact:[],[t]);return a?.length?a.map(e=>(0,j.jsx)(is,{eventType:i,audioInfo:e,threadId:n||"",actionId:r||""},e?.audio_url)):null});function io(e){if(!e||"string"!=typeof e)return!1;let t=e?.slice?.(0,50);return t?.includes?.("Error code")}e.s(["default",0,il],536049);let iu=(0,N.memo)(function(e){let{event_data:t,emptyPlaceholder:i}=e,n=(0,N.useMemo)(()=>
20{if(!t?.artifact?.length)return[];let e=[];for(let i of t.artifact)!(!i?.thinking&&!i?.suggestion&&!i.text||io(i?.thinking))&&(io(i?.suggestion)||e.push(i));return e},[t]);return n?.length?n.map(({thinking:e,suggestion:t,text:i},n)=>(0,j.jsxs)("div",{className:"markdown-content ml-2","data-testid":"markdown-text-message",children:[e&&(0,j.jsx)(td.default,{children:e}),t&&(0,j.jsx)(td.default,{children:t}),i&&(0,j.jsx)(td.default,{children:i})]},n+1)):i});function ic(){return(ic=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,iu],44289);let id=function(e){return N.createElement("svg",ic({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none",viewBox:"0 0 16 17"},e),b||(b=N.createElement("path",{fill:"#2F3640",d:"m11.957 6.562-3.477 3.53-1.062 1.061-1.063-1.06-2.117-2.121 1.063-1.06L7.418 9.03l3.48-3.53z"})))};function ih(){return(ih=Object.assign.bind()).apply(null,arguments)}let im=function(e){return N.createElement("svg",ih({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none",viewBox:"0 0 16 17"},e),w||(w=N.createElement("circle",{cx:8,cy:8.5,r:3,fill:"#A4A9B2"})))},ip=(0,N.memo)(function(e){let{t}=(0,T.useI18n)(),{messageId:i,steps:n=[],className:r}=e;return(0,j.jsx)("div",{id:i,className:(0,P.default)("flex w-full flex-col gap-4 pt-1 empty:hidden",r&&r),children:n?.map(({tool:e,description:i,done:n},r)=>{let a=(0,tM.getAgentToolName)(e,null,t);return(0,j.jsxs)("div",{className:"flex gap-2",children:[(0,j.jsx)("div",{className:"flex w-5 flex-shrink-0 flex-col items-center gap-1",children:(0,j.jsx)("div",{className:"flex h-6 w-full flex-shrink-0 items-center justify-center",children:n?(0,j.jsx)(id,{}):(0,j.jsx)(im,{})})}),(0,j.jsxs)("div",{className:"flex cursor-text select-text flex-col gap-1 text-sm",children:[(0,j.jsx)("span",{className:(0,P.default)("text-[15px] font-semibold leading-[1.6]",n&&"text-[#2F3640]",!n&&"text-[#86909c]"),children:a}),(0,j.jsx)("span",{className:"text-sm font-medium leading-[1.6] text-[#2F3640]",children:i})]})]},`${e}-${r+1}`)})})}),ig=(0,N.memo)(function(e){let{event_data:t}=e,i=(0,N.useMemo)(()=>{if(!t?.artifact?.length)return null;let e=[];for(let i of t.artifact)e.push(...(i?.steps||[]).map(e=>({...e,done:!0})));return e},[t]);return i?.length?(0,j.jsx)(ip,{steps:i}):null});e.s(["default",0,ig],376400);var ix=e.i(107783);let iv=(0,N.memo)(function(e){let{t}=(0,T.useI18n)(),{brandKitsInfo:i,emptyPlaceholder:n}=e;if(!(0,N.useMemo)(()=>Object.values(i??{}).some(e=>e?.length>0),[i]))return n??null;let{texts:r=[],logos:a=[],colors:s=[],fonts:l=[],photos:o=[]}=i??{};return(0,j.jsxs)("div",{className:"flex flex-col gap-4 px-3 pb-3","data-testid":"explore-kits-card",children:[r?.length>0&&(0,j.jsxs)("section",{className:"flex flex-col gap-[10px]",children:[(0,j.jsx)("p",{className:"text-lo-body-md text-lo-text-secondary font-semibold",children:t("brandkit_section_design_guidance")}),(0,j.jsx)("div",{className:"rounded-lo-radius-8 bg-lo-bg-overlay px-2 py-1.5",children:r.map((e,t)=>(0,j.jsx)("div",{className:"markdown-content text-lo-body-md text-lo-text-default whitespace-pre-wrap",children:(0,j.jsx)(td.default,{children:e})},t))})]}),a?.length>0&&(0,j.jsxs)("section",{className:"flex flex-col gap-[10px]",children:[(0,j.jsx)("p",{className:"text-lo-body-md text-lo-text-secondary font-semibold",children:"Logo"}),(0,j.jsx)("div",{className:"flex flex-wrap gap-3",children:a.map(e=>(0,j.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-1",children:[(0,j.jsx)("div",{className:"rounded-lo-radius-10 bg-lo-bg-overlay flex items-center justify-center overflow-hidden",style:{width:150,height:113},children:(0,j.jsx)("img",{src:(0,ix.convert2CompressedUrl)(e.url,300),alt:e.name,className:"size-full object-contain"})}),(0,j.jsx)("span",{className:"text-lo-body-xs text-lo-text-default w-full truncate",children:e.name})]},e.url))})]}),s?.length>0&&(0,j.jsxs)("section",{className:"flex flex-col gap-[10px]",children:[(0,j.jsx)("p",{className:"text-lo-body-md text-lo-text-secondary font-semibold",children:t("brandkit_section_color")}),(0,j.jsx)("div",{className:"flex flex-wrap gap-3",children:s.map(e=>(0,j.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-1",style:{width:69},children:[(0,j.jsx)("div",{className:"rounded-lo-radius-10 border-lo-border-neutral-l1 overflow-hidden border",style:{width:69,height:69,backgroundColor:e.value}}),(0,j.jsx)("span",{className:"text-lo-body-xs text-lo-text-default w-full truncate text-center",children:e.name})]},`${e.name}-${e.value}`))})]}),l?.length>0&&(0,j.jsxs)("section",{className:"flex flex-col gap-[10px]",children:[(0,j.jsx)("p",{className:"text-lo-body-md text-lo-text-secondary font-semibold",children:t("brandkit_section_fonts")}),(0,j.jsx)("div",{className:"flex flex-wrap gap-3",children:l.map(e=>(0,j.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-1",children:[(0,j.jsx)("div",{className:"rounded-lo-radius-10 bg-lo-bg-overlay flex items-center justify-center overflow-hidden",style:{width:150,height:113},children:e.previewUrl&&(0,j.jsx)("img",{src:(0,ix.convert2CompressedUrl)(e.previewUrl,300),alt:e.name,className:"size-full object-contain"})}),(0,j.jsx)("span",{className:"text-lo-body-xs text-lo-text-default w-full truncate",children:e.name})]},`${e.name}-${e.role}`))})]}),o?.length>0&&(0,j.jsxs)("section",{className:"flex flex-col gap-[10px]",children:[(0,j.jsx)("p",{className:"text-lo-body-md text-lo-text-secondary font-semibold",children:t("brandkit_section_photography")}),(0,j.jsx)("div",{className:"flex flex-wrap gap-3",children:o.map(e=>(0,j.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-1",children:[(0,j.jsx)("div",{className:"rounded-lo-radius-10 bg-lo-bg-overlay overflow-hidden",style:{width:150,height:113},children:(0,j.jsx)("img",{src:(0,ix.convert2CompressedUrl)(e.url,300),alt:e.name,className:"size-full object-cover"})}),(0,j.jsx)("span",{className:"text-lo-body-xs text-lo-text-default w-full truncate",children:e.name})]},e.url))})]})]})});e.s(["default",0,iv],5960);var iy=e.i(847360);function i_(e,t){if(!e?.length)return{};switch(t){case iy.ArtifactOutputType.IMAGE_GENERATION:return ib(e);case iy.ArtifactOutputType.VIDEO_GENERATION:var i,n=e;if(!n?.length)return{};let r=[];for(let e of n)(e?.video_url||e?.video_url_wm)&&(e?.video_url||(e.video_url=e.video_url_wm),r.push(e));return{videoList:r};case iy.ArtifactOutputType.AUDIO_GENERATION:var a=e;if(!a?.length)return{};let s=[];for(let e of a)e?.audio_url&&s.push(e);return{audioList:s};case iy.ArtifactOutputType.THREE_D_MODEL_GENERATION:var l=e;if(!l?.length)return{};let o=[];for(let e of l)(e?.pbr_model_url||e?.model_url)&&(e?.model_url||(e.model_url=e.pbr_model_url),o.push(e));return{threeDModelList:o};case iy.ArtifactOutputType.HTML_GENERATION:var u=e;if(!u?.length)return{};let c=null,d=null;
20for(let e of u)if(e?.image_url&&!c&&(c=e),e?.html_url&&!d&&(d=e),c&&d)break;return{htmlGroup:{htmlInfo:d,imageInfo:c}};case iy.ArtifactOutputType.SVG_GENERATION:return ib(e);case iy.ArtifactOutputType.MARKDOWN_CONTENT:var h=e;if(!h?.length)return{};let m=[],p="";for(let e of h){if(e?.title&&(p=e.title),e?.text&&m.push({title:p,content:e.text}),e?.thought&&m.push({title:p,content:e.thought}),e?.thinking&&m.push({title:p,content:e.thinking}),e?.suggestion&&m.push({title:p,content:e.suggestion}),e?.description&&m.push({title:p,content:e.description}),e?.summary){let t=[];if(e?.references?.length)for(let i of e.references){if(!i)continue;let{title:e,link:n}=i;t.push({title:e,link:n})}m.push({title:p,content:e.summary,links:t})}e?.video_analysis_result&&m.push({title:p,content:e.video_analysis_result})}return{markdownList:m};case iy.ArtifactOutputType.LORA_RECOMMENDATION:var f=e;if(!f?.length)return{};let g=[];for(let e of f)e?.model_id&&g.push({model_id:e?.model_id,cover_image_url:e?.cover_image_url,cover_image_name:e?.cover_image_name});return{loraList:g};case iy.ArtifactOutputType.IMAGE_SEARCH:var x=e;if(!x?.length)return{};let v=[];for(let e of x)e?.images?.length&&v.push({title:e?.search_query||e?.title,images:e?.images});return{galleryList:v};case iy.ArtifactOutputType.WEB_SEARCH:var y=e;if(!y?.length)return{};let _="",b=[];for(let e of y){if(b?.length>0)break;e?.summary&&(_=e.summary,b=e.references)}return{webSearchInfo:{summary:_,references:b}};case iy.ArtifactOutputType.IMAGE_INSIGHT:var w=e;if(!w?.length)return{};let j=[];for(let e of w){if(e?.images?.length>0)for(let t of e.images)t?.image_url&&j.push(t);if(e?.image_urls?.length>0)for(let t of e.image_urls)t&&j.push({image_url:t})}return{insightImageList:j};case iy.ArtifactOutputType.MAKE_STORY:var N=e;if(!N?.length)return{};let E={};for(let e of N)e?.length<2||(E[e[0]]=e[1]);return{storyBook:E};case iy.ArtifactOutputType.SLIDES_GENERATION:var T=e;if(!T?.length)return{};let C=[];for(let e of T)e?.images?.length&&C.push({title:e?.title,group_type:e?.group_type,task_context:e?.task_context,images:e?.images});return{slideGroupList:C};case iy.ArtifactOutputType.LAYER_SEPARATION:return function(e){let t;if(!e?.length)return{};let i=[],n=[];for(let r of e){let e=r?.image_url||r?.image_url_wm;if(!e)continue;let a=r?.metadata??{};if(n.push({...r,image_url:e,width:r?.width??a.width??0,height:r?.height??a.height??0}),a.is_base_image){t||(t={...r,image_url:e,width:r?.width??a.width??0,height:r?.height??a.height??0});continue}let s=a.bounding_box?.absolute;if(!Array.isArray(s)||s.length<4)continue;let[l,o,u,c]=s.map(Number);[l,o,u,c].every(Number.isFinite)&&i.push({image_url:e,name:a.name||r?.image_name||"",description:a.description,z_index:Number(a.z_index)||0,x:l,y:o,width:Math.max(u-l,1),height:Math.max(c-o,1)})}return n.length?(i.sort((e,t)=>e.z_index-t.z_index),{layerSeparationInfo:{baseImage:t,layers:i},imageList:n}):{}}(e);case iy.ArtifactOutputType.GENERATOR_GENERATION:var A=e;if(!A?.length)return{};let k=[],M=[];for(let e of A){let t={source:e?.source??e?.metadata?.source,artifact_source:e?.artifact_source??e?.metadata?.artifact_source,artifact_metadata:e?.artifact_metadata??e?.metadata?.artifact_metadata};switch(e?.type){case"image":e?.content&&k.push({image_url:e?.content,width:e?.metadata?.width,height:e?.metadata?.height,...t});break;case"video":e?.content&&M.push({video_url:e?.content,cover_url:e?.metadata?.cover_url,width:e?.metadata?.width,height:e?.metadata?.height,video_name:"",...t})}}return{imageList:k,videoList:M};case iy.ArtifactOutputType.TERMINATE_QUESTION:var I=e;if(!I?.length)return{};let S={questions:[],questionOptions:null};for(let e of I)e?.question&&(S.questions.push(e.question),e?.options?.length&&(S.questionOptions=e));return{terminateQuestionInfo:S};case iy.ArtifactOutputType.EXECUTION_PLAN:var O=e;if(!O?.length)return{};let R=[];for(let e of O)e?.steps?.length&&R.push(...(e?.steps||[]).map(e=>({...e,done:!0})));return{executionPlanInfo:{steps:R}};case iy.ArtifactOutputType.SEARCH_CONTENT:return function(e){if(!e?.length)return{};let t=null,i=[],n=[],r=[];for(let a of e)if(a?.artifact_type){if(a?.artifact_type==="arguments"){t=a.arguments;continue}if(a?.artifact_type==="group_image_search"){i.push(a);continue}a?.artifact_type==="search_info"&&n.push(a),a?.artifact_type==="web_page_content"&&r.push(a)}let a={};return t&&(a={...a,argumentsInfo:t}),i?.length&&(a={...a,groupImageSearchList:i}),n?.length&&(a={...a,searchInfoList:n}),r?.length&&(a={...a,webPageContentList:r}),{searchContentInfo:a}}(e);case iy.ArtifactOutputType.CREATE_SKILL:return i=e,i?.length&&(i?.[0]?.skills?.length||i?.[0]?.name)?{createSkillInfo:i?.[0]}:{};
20case iy.ArtifactOutputType.BRAND_KITS:var P=e;let D={logos:[],photos:[],fonts:[],colors:[],texts:[]};if(!P?.length)return{};for(let e of P)if("image_info"===e.artifact_type){if("font_preview"===e.metadata?.item_type||!e.image_url)continue;let t={url:e.image_url,name:e.image_name||"",role:e.metadata?.role||""};iw.has(t.role)?D.logos.push(t):D.photos.push(t)}else if("plain_text"===e.artifact_type){let t=e.extra_info?.item_type;"font"===t?D.fonts.push({name:e.extra_info?.font_name||"",role:e.extra_info?.role||"",previewUrl:e.extra_info?.preview_url}):"color"===t?D.colors.push({name:e.extra_info?.color_name||"",value:e.extra_info?.color_value||"",role:e.extra_info?.role||""}):"text"===t&&e.text&&D.texts.push(e.text)}return{brandKitsInfo:D};case iy.ArtifactOutputType.SEARCH_REFERENCES:var L=e;if(!L?.length)return{};let F={text_references:[],image_references:[]};for(let e of L)e?.text_references?.length&&F.text_references.push(...e.text_references),e?.image_references?.length&&F.image_references.push(...e.image_references);return{searchReferencesInfo:F};case iy.ArtifactOutputType.CONNECTOR_PICKER:var U=e;if(!U?.length)return{};let V=[];for(let e of U)e?.provider&&e?.display_name&&V.push({artifact_type:"connector_picker",provider:e.provider,display_name:e.display_name,icon:e.icon??"",needs_reauthorize:!!e.needs_reauthorize,authorize_url:e.authorize_url??""});return V.length?{connectorPickerInfo:{artifact:V}}:{};default:return{}}}function ib(e){if(!e?.length)return{};let t=[];for(let i of e)(i?.image_url||i?.image_url_wm)&&(i?.image_url||(i.image_url=i.image_url_wm),t.push(i));return{imageList:t}}let iw=new Set(["primary","secondary","icon","wordmark"]);e.s(["parseArtifactOutput",0,i_,"parseToolUseMessageOutput",0,function(e){let t=function(e){if(!e||!e.content?.length)return[];let{name:t,content:i}=e;if(1===i.length)return i;let n=i.map(e=>({...e,event_data:{...e?.event_data}}));if(t===tM.AgentToolName.HTML_GENERATE&&n?.length===2)for(let e of n)"object"==typeof e?.event_data&&(e.event_data.artifact_type="html_info");let r={};for(let e of n){let{event_data:t,...i}=e||{},n=(0,iy.parseToolUseArtifactType)(e);if(!n||!e?.event_data?.artifact?.length)continue;if(!r[n]){r[n]={...i,event_data:{...t,artifact_type:n,artifact:[...t.artifact]}};continue}let a=r[n];a?.event_data?.artifact?.push(...t.artifact)}return Object.values(r)}(e);return t?.map(t=>({...t,...function(e,t){let{artifactType:i,artifactOutputType:n}=(0,iy.parseToolUseOutputType)(e,t),r=e?.event_data?.artifact;n===iy.ArtifactOutputType.GENERATOR_GENERATION&&(r=e?.event_data?.artifacts);let a=i_(r,n);return{artifactType:i,artifactOutputType:n,artifactOutput:a}}(t,e)}))}],632224);let ij=(0,N.memo)(function(e){let{event_data:t,emptyPlaceholder:i}=e,n=(0,N.useMemo)(()=>t?.artifact?.length?i_(t.artifact,iy.ArtifactOutputType.BRAND_KITS)?.brandKitsInfo:{},[t]);return(0,j.jsx)(iv,{brandKitsInfo:n,emptyPlaceholder:i})});e.s(["default",0,ij],380741);let iN=(0,N.memo)(function(e){let{t}=(0,T.useI18n)(),{htmlInfo:i}=e;return i?.html_url?(0,j.jsx)("a",{className:(0,P.default)("ml-2 flex h-8 flex-shrink-0 items-center gap-1","text-xs text-[#A4A9B2] hover:text-[#86909C] active:text-[#2F3640]"),href:i.html_url,target:"_blank",rel:"noopener noreferrer",children:(0,j.jsx)("span",{children:t("html_generation_preview")})}):null});e.s(["default",0,iN],78102)},282985,e=>{"use strict";var t,i=e.i(526762),n=e.i(893204);let r=Object.entries({CONTENT_POLICY_ERROR_TYPE:["API_CONTENT_POLICY","API_INPUT_POLICY_VIOLATION","API_OUTPUT_POLICY_VIOLATION","moderated","CONTENT_MODERATED","SEEDANCE_2_INPUT_POLICY_VIOLATION"],AI_MODEL_ERROR_TYPE:["API_PARAM_VALIDATION_FAILED","API_SERVICE_UNAVAILABLE","API_AUTH_FAILED","API_QUOTA_EXCEEDED","API_SERVER_ERROR","API_NETWORK_ERROR","API_TIMEOUT","API_NO_ARTIFACTS","API_CALL_ERROR"],REQUEST_FAILED_ERROR_TYPE:["TOOL_SVC_SYSTEM_ERROR","API_SVC_SYSTEM_ERROR","TIMEOUT","INPUT_PARAMS_INVALID","UNEXPECTED_ERROR"],MAX_INPUT_TOKEN_ERROR_TYPE:["MAX_INPUT_TOKEN_EXCEEDED"],MAX_OUTPUT_TOKEN_ERROR_TYPE:["MAX_OUTPUT_TOKEN_EXCEEDED"],VENDER_API_ERROR_TYPE:["VENDER_API_ERROR"],DLQ_REASONING_ERROR:"DLQ_REASONING_ERROR",API_RATE_LIMIT:["API_RATE_LIMIT","API_BUSY"],API_INPUT_SD2_RP_POLICY_VIOLATION:"API_INPUT_SD2_RP_POLICY_VIOLATION"}).reduce((e,[t,i])=>"string"==typeof i?Object.assign(e,{[i]:t}):Array.isArray(i)?i.reduce((e,i)=>Object.assign(e,{[i]:t}),e):e,{});var a=((t={}).RETRY="RETRY",t.START_NEW_CHAT="START_NEW_CHAT",t.EDIT_PROMPT="EDIT_PROMPT",t[t.HIDDEN=null]="HIDDEN",t);function s(e=i.translate){return{CONTENT_POLICY_ERROR_TYPE:{title:e("agent_tool_use_error_content_policy_error_title"),description:e("agent_tool_use_error_content_policy_error_description"),btnText:e("agent_tool_use_error_edit_prompt_btn"),action:"EDIT_PROMPT"},API_INPUT_SD2_RP_POLICY_VIOLATION:{title:e("agent_tool_use_error_sd2_pr_policy_violation_title"),description:e("agent_tool_use_error_sd2_pr_policy_violation_description"),btnText:"",action:a.HIDDEN},AI_MODEL_ERROR_TYPE:{title:e("agent_tool_use_error_ai_model_error_title"),description:e("agent_tool_use_error_ai_model_error_description"),btnText:e("agent_tool_use_error_retry_btn"),action:"RETRY"},REQUEST_FAILED_ERROR_TYPE:{title:e("agent_tool_use_error_request_failed_error_title"),description:e("agent_tool_use_error_request_failed_error_description"),btnText:e("agent_tool_use_error_retry_btn"),action:"RETRY"},MAX_INPUT_TOKEN_ERROR_TYPE:{title:e("agent_tool_use_error_max_input_token_error_title"),description:e("agent_tool_use_error_max_input_token_error_description"),btnText:e("agent_tool_use_error_start_new_chat_btn"),action:"START_NEW_CHAT"},MAX_OUTPUT_TOKEN_ERROR_TYPE:{title:e("agent_tool_use_error_max_output_token_error_title"),description:e("agent_tool_use_error_max_output_token_error_description"),btnText:e("agent_tool_use_error_retry_btn"),action:"RETRY"},VENDER_API_ERROR_TYPE:{title:e("agent_tool_use_error_vender_api_error_title"),description:e("agent_tool_use_error_vender_api_error_description"),btnText:e("agent_tool_use_error_retry_btn"),action:"RETRY"},DLQ_REASONING_ERROR:{title:e("agent_tool_use_error_request_failed_error_title"),description:e("agent_tool_use_error_vender_api_error_description"),btnText:e("agent_tool_use_error_retry_btn"),action:"RETRY"},API_RATE_LIMIT:{title:e("agent_tool_use_error_api_rate_limit_title"),description:e("agent_tool_use_error_api_rate_limit_description"),btnText:e("agent_tool_use_error_retry_btn"),action:"RETRY"}}}function l(e){if(!e?.error_type)return null;let t=e?.error_type;if(t&&r[t])return r[t];let i=function(e){if("string"!=typeof e||!e||!e.startsWith("{")||!e.endsWith("}"))return null;try{let t=JSON.parse(e);return"string"==typeof t?.error_code?t.error_code:null}catch{return null}}(e?.error_info);return i&&r[i]?r[i]:null}e.s(["ERROR_BTN_ACTION",()=>a,"getErrorCategoryConfigMap",0,s,"getToolUseErrorRenderTitle",0,function(e,t=i.translate){let{event_data:r,name:a,content:o,title:u}=e||{};if(u)return u;let c=r??o?.[0]?.event_data,d=c?.error_type,h=l(c);if(h){let e=s(t)?.[h];if(e?.title)return e.title}return t("USER_ABORT"===d?"agent_tool_use_user_abort":"policy_restriction_error"===d?"agent_tool_use_policy_error":a===n.AgentToolName.LORA_RECOMMENDATION?"agent_tool_use_lora_recommendation_error":a===n.AgentToolName.WEB_SEARCH?"agent_tool_use_web_search_error":a===n.AgentToolName.SEARCH_MOODBOARD?"agent_tool_use_search_moodboard_error":a===n.AgentToolName.GROUNDED_SEARCH?"agent_tool_use_grounded_search_error":a===n.AgentToolName.STRUCTURED_IMAGE_SEARCH?"agent_tool_use_structured_image_search_error":a===n.AgentToolName.WEB_FETCH||a===n.AgentToolName.WEB_FETCH_V2?"agent_tool_use_web_fetch_error":"agent_tool_use_error")},"parseErrorCategoryFromEventData",0,l])},727989,e=>{"use strict";var t=e.i(21590),i=e.i(820967),n=e.i(282985),r=e.i(715074),a=e.i(973930),s=e.i(532675);function l(e){let{className:i,btnText:r,btnAction:l,isLastSession:o,isOnProgressSession:u,sessionModeType:c}=e;return o&&"replay"!==c&&(0,a.getAgentUIContext)()?.agentToolErrorHandler&&(!u||l!==n.ERROR_BTN_ACTION.RETRY)?(0,t.jsx)("span",{className:(0,s.twClsx)("cursor-pointer select-none text-[#147DFF]",i&&i),onClick:()=>{switch(l){case n.ERROR_BTN_ACTION.RETRY:(0,a.getAgentUIContext)()?.agentToolErrorHandler?.retry?.(e);break;case n.ERROR_BTN_ACTION.START_NEW_CHAT:(0,a.getAgentUIContext)()?.agentToolErrorHandler?.startNewChat?.(e);break;case n.ERROR_BTN_ACTION.EDIT_PROMPT:(0,a.getAgentUIContext)()?.agentToolErrorHandler?.appplyInput?.(e)}},children:r}):null}let o=(0,i.memo)(function(e){let{title:i,description:n,btnText:r,className:a,bt
20nClassName:o,noActionBtn:u,...c}=e;return(0,t.jsxs)("div",{className:(0,s.twClsx)("flex cursor-text select-text flex-col gap-1 text-sm leading-[1.6] text-[#141414]",a&&a),children:[(0,t.jsx)("span",{className:"font-semibold",children:i}),n&&(0,t.jsx)("span",{className:"font-normal",children:n}),r&&!u&&(0,t.jsx)(l,{className:o,btnText:r,...c})]})}),u=(0,i.memo)(function(e){let{t:i}=(0,r.useI18n)(),{loading:a}=e;if(a)return null;let s=(0,n.getToolUseErrorRenderTitle)(e,i);return s?(0,t.jsx)(o,{...e,title:s}):null}),c=(0,i.memo)(function(e){let{t:a}=(0,r.useI18n)(),{errorCategory:s,...l}=e,u=(0,i.useMemo)(()=>(0,n.getErrorCategoryConfigMap)(a)[s],[s,a]);return u?(0,t.jsx)(o,{title:u.title,description:u.description,btnText:u.btnText,btnAction:u.action,...l}):null}),d=(0,i.memo)(function(e){let{loading:i,content:r,event_data:a}=e;if(i)return null;let s=a??r?.[0]?.event_data,l=(0,n.parseErrorCategoryFromEventData)(s);return l?(0,t.jsx)(c,{...e,errorCategory:l}):(0,t.jsx)(u,{...e})});e.s(["default",0,d],727989)},9801,397134,54343,671530,112963,424319,776946,605564,898561,60587,195705,29781,178952,164164,697727,273219,247962,683102,e=>{"use strict";var t,i,n,r,a,s,l,o,u,c,d,h,m,p,f,g,x,v,y,_,b,w,j,N,E,T,C,A,k=e.i(21590),M=e.i(820967),I=e.i(974869),S=e.i(361114),O=e.i(892534),R=e.i(438176),P=e.i(689095),D=e.i(498173),L=e.i(196710),F=e.i(893204),U=e.i(5239),V=e.i(13959),z=e.i(517216),B=e.i(397349),$=e.i(847360),H=e.i(579023),q=e.i(935406),W=e.i(536049),G=e.i(44289),Y=e.i(376400),Q=e.i(380741),K=e.i(715074),X=e.i(632224),Z=e.i(930479),J=e.i(78102),ee=e.i(76773),et=e.i(568951);e.s(["DownloadBtn",()=>et.default],397134);var et=et,ei=e.i(97305);let en=(0,M.memo)(function(e){let{imageInfo:t,loading:i}=e,n=(0,M.useMemo)(()=>t?.width&&t?.height?{aspectRatio:t.width/t.height,width:"100%"}:{height:240,width:"100%"},[t]);return(0,k.jsxs)("div",{className:"downloadable-img relative max-h-60 w-full overflow-hidden",children:[(0,k.jsx)(ee.ConfigProvider,{theme:{components:{Skeleton:{gradientFromColor:"#F0F0F0",gradientToColor:"#DBDBDB"}}},children:(0,k.jsx)(ei.ImageCard,{src:t?.image_url,draggedImage:t,boxClassName:"w-full rounded",boxStyle:n,style:{transformOrigin:"top center"},skeletonStyle:{maxHeight:240,borderRadius:4},downloadable:!1})}),!i&&t&&(0,k.jsx)("div",{className:"pointer-events-none absolute bottom-0 left-0 h-24 w-full",style:{background:"linear-gradient(180deg, rgba(241, 245, 235, 0) 0%, #F1F5EB 100%)"},children:(0,k.jsx)(et.default,{fileUrl:t?.image_url,fileName:t?.image_name,btnClassName:"downloadable-btn rounded-full h-8 w-8 bg-[#0C0C0D66]",style:{display:"flex",bottom:8,right:8}})})]})}),er=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),{event_data:i,loading:n}=e,{htmlInfo:r,imageInfo:a}=(0,M.useMemo)(()=>i?.artifact?.length&&(0,X.parseArtifactOutput)(i.artifact,$.ArtifactOutputType.HTML_GENERATION)?.htmlGroup||{},[i?.artifact]);return r&&a||n?(0,k.jsx)(Z.default,{"data-testid":"html-generation-card",title:n?void 0:t("agent_tool_html_generation_title"),rootClassName:"flex w-full flex-col gap-2",rightBtn:n||!r?null:(0,k.jsx)(J.default,{htmlInfo:r}),children:(a||n)&&(0,k.jsx)(en,{imageInfo:a,loading:n})}):null});var ea=e.i(572935);let es=(0,M.memo)(function(e){let{event_data:t}=e,i=(0,M.useMemo)(()=>{if(!t?.artifact?.length)return null;let e="";for(let i of t.artifact)e+=i?.description||"";return e},[t]);return i?(0,k.jsx)("div",{"data-testid":"markdown-text-message",className:"markdown-content mx-2",children:(0,k.jsx)(ea.default,{children:i})}):null});var el=e.i(636028),eo=e.i(7284),eu=e.i(973930);let ec=(0,M.memo)(function(e){let{displayAsList:t,onClick:i}=e;return(0,k.jsx)("button",{className:"absolute right-0 top-0 z-[2] flex h-7 items-center",onClick:i,children:(0,k.jsx)("span",{className:"text-xs text-[#A4A9B2] hover:text-[#86909C] active:text-[#2F3640]",children:t?"Pick up":"Show more"})})}),ed={width:160,height:220,position:"absolute",top:0,left:0,borderRadius:4,backgroundColor:"#F0F0F0",overflow:"hidden",pointerEvents:"none",transitionProperty:"all",transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",transitionDuration:"150ms",boxShadow:"0px 4px 20px 0px #00000014"},eh={backgroundColor:"#F0F0F0",pointerEvents:"none"},em={borderRadius:4,overflow:"hidden"},ep={1:[{x:0,y:0,r:0,width:220,height:276,borderRadius:4}],2:[{x:11,y:17,r:6},{x:46,y:7,r:-2}],3:[{x:11,y:17,r:6},{x:46,y:7,r:-2},{x:84,y:10,r:-8}],4:[{x:11,y:17,r:6},{x:46,y:7,r:-2},{x:84,y:10,r:-8},{x:116,y:23,r:-16}],5:[{x:11,y:17,r:6},{x:46,y:7,r:-2},{x:84,y:10,r:-8},{x:116,y:23,r:-16},{x:148,y:33,r:-24}]},ef={1:[{x:0,y:0,r:0,width:220,height:276,borderRadius:4}],2:[{x:11,y:17,r:6},{x:56,y:7,r:-2}],3:[{x:11,y:17,r:6},{x:56,y:7,r:-2},{x:106,y:10,r:-8}],4:[{x:11,y:17,r:6},{x:56,y:7,r:-2},{x:106,y:10,r:-8},{x:153,y:23,r:-16}],5:[{x:11,y:17,r:6},{x:56,y:7,r:-2},{x:106,y:10,r:-8},{x:153,y:23,r:-16},{x:190,y:33,r:-24}]};function eg(e,t){if(!t?.shouldFitImageSize||!e)return{};let{width:i,height:n}=e||{};if(!i||!n)return{};let{maxWidth:r=408,maxHeight:a=400}=t||{},s=i/n,l=i,o=n;return s<.5?l=(o=a)/2:(l=(o=a)*s)>r&&(o=(l=r)/s),{width:l,height:o}}let ex=(0,M.memo)(function(e){let{position:t,currentIndex:i,maximumIndex:n,imageList:r,loadingImageCount:a=0,imageFitSizeOptions:s,readonly:l,onDownloadCallback:o,threadId:u,actionId:c}=e,{shouldShowArtifactBadge:d}=(0,eu.useAgentUIContext)(),[h,m]=(0,M.useState)(0),{x:p,y:f,r:g,...x}=t,v=`translate(${p}px, ${f}px) rotate(${-(g||0)}deg)`,y=r?.[i],_=i===n,b=_&&4===i&&(r?.length||0)>5,w=a>0&&(!y||_),j=w||b?null:y,N=j?eg(j,s):{},E={...ed,transform:v,zIndex:n-i+1,...x,...N,pointerEvents:l?"none":"auto"};return n>0&&(h<1&&(E={...E,transform:"translate(0px, 0px) rotate(0deg)",opacity:i>0?0:1}),h<2&&(E={...E,transitionDelay:"100ms",transitionDuration:"300ms",transitionTimingFunction:"ease"})),b&&(E={...E,...eh}),(0,M.useEffect)(()=>{setTimeout(()=>{m(1),setTimeout(()=>{m(2)},300)},200)},[]),(0,k.jsx)(ei.ImageCard,{boxStyle:E,src:j?.image_url,draggedImage:j||void 0,agentGenerated:!!j,showAiGeneratedBadge:j?d?.({artifactType:"image",surface:"chat-card",item:j,agentGenerated:!0,threadId:u,actionId:c}):void 0,downloadable:!!j&&!l,skeleton:!b,skeletonStyle:{...em,...N},skeletonTestId:w?"agent-image-loading-placeholder":void 0,onDownloadCallback:o,threadId:u,actionId:c})}),ev=(0,M.memo)(function(e){let{listTransforms:t,imageList:i,loadingImageCount:n=0,imageFitSizeOptions:r,displayAsList:a,onDownloadCallback:s,threadId:l,actionId:o}=e,[u,c]=(0,M.useState)(!1),d=(0,M.useMemo)(()=>{let e=i?.length||0;return n&&(e=n),Math.min(e,5)},[i,n]),h=(0,M.useMemo)(()=>n?ep[d]:a&&t?.length?t:u?ef[d]:ep[d],[n,a,u,d,t]),m=(0,M.useMemo)(()=>n>0||d>1,[d,n]),p=h?.length;return(0,k.jsx)("div",{className:"h-full w-full",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:h.map((e,t)=>(0,k.jsx)(ex,{position:e,currentIndex:t,maximumIndex:p-1,imageList:i,loadingImageCount:n,imageFitSizeOptions:r,readonly:m,onDownloadCallback:s,threadId:l,actionId:o},t))})});var ey=e.i(621819);let e_=(0,M.memo)(function(e){let{imageList:t,loading:i=!1,sessionModeType:n,threadId:r,actionId:a,parentThreadI
20d:s,parentActionId:l,agentName:o}=e,{shouldShowArtifactBadge:u}=(0,eu.useAgentUIContext)(),c=t?.length||0,d=1===c&&!i,h=(0,M.useMemo)(()=>!!d&&!!t?.[0]?.height&&!!t?.[0]?.width,[d,t]),m=(0,M.useCallback)(e=>{(0,el.reportAgentExportClick)({...(0,el.toAgentTrackParams)({threadId:r,actionId:a,parentThreadId:s,parentActionId:l,agentName:o}),action_type:"download",object_type:"image",object_url:e?.fileUrl})},[r,a,s,l,o]),{listDomRef:p,renderHeight:f,initialAsList:g,displayAsList:x,handleDisplayAsList:v,handleToggleDisplayAsList:y,listTransforms:_,imageFitSizeOptions:b}=function(e){let{imageCount:t=0,shouldFitImageSize:i=!1,sessionModeType:n}=e,{ref:r,width:a,height:s}=(0,ey.useElementSizeObserver)(),[l,o]=(0,M.useState)(()=>!!(t>=2)&&"replay"===n),[u,c]=(0,M.useState)(l),[d,h]=(0,M.useState)([]),m=(0,M.useCallback)(()=>c(!0),[]),p=(0,M.useCallback)(()=>c(e=>!e),[]),f=(0,M.useMemo)(()=>i?s:u?s<=276?s<264?s+12:276:s:276,[u,i,s]),g=(0,M.useMemo)(()=>({shouldFitImageSize:i,maxWidth:a}),[i,a]);return(0,M.useEffect)(()=>{if(t<2)return;let e=r.current?.childNodes;if(e)try{let i=Math.min(t,5),n=[];for(let t=0;t<i;t++){let{offsetTop:i,offsetLeft:r,offsetWidth:a,offsetHeight:s}=e[t];n.push({x:r,y:i,width:a,height:s,r:0})}h(n)}catch(e){(0,H.logger)(e?.message)}},[t,r,f]),(0,M.useEffect)(()=>{setTimeout(()=>{o(!1)},1e3)},[]),{listDomRef:r,renderHeight:f,imageFitSizeOptions:g,listTransforms:d,initialAsList:l,displayAsList:u,setDisplayAsList:c,handleDisplayAsList:m,handleToggleDisplayAsList:p}}({imageCount:c,shouldFitImageSize:h,sessionModeType:n}),w=(0,M.useMemo)(()=>"replay"===n?void 0:{threadId:r,actionId:a},[n,r,a]);return(0,k.jsxs)(ee.ConfigProvider,{theme:{components:{Skeleton:{gradientFromColor:"#F0F0F0",gradientToColor:"#DBDBDB"}}},children:[!i&&c>=2&&(0,k.jsx)(ec,{displayAsList:x,onClick:y}),(0,k.jsxs)("div",{className:(0,eo.default)("relative w-full transition-[height]",!x&&"overflow-hidden"),style:{height:f},children:[(0,k.jsx)("div",{onClick:i||d?void 0:v,className:(0,eo.default)("absolute left-0 top-0 h-full w-full transition-opacity",g&&"invisible",x&&"pointer-events-none z-0",!x&&"z-[1]",!x&&!i&&!d&&"cursor-pointer"),children:(0,k.jsx)(ev,{imageList:t,listTransforms:_,loadingImageCount:+!!i,displayAsList:x,imageFitSizeOptions:b,onDownloadCallback:m,...w})}),(0,k.jsx)("div",{className:(0,eo.default)("h-full w-full","transition-opacity delay-100 duration-200 ease-in",x&&"z-[1] opacity-100",!x&&"pointer-events-none invisible z-0 opacity-0"),children:(0,k.jsx)("div",{ref:p,className:"relative flex w-full flex-wrap justify-start gap-2",children:t?.map((e,t)=>{let i=eg(e,b);return(0,k.jsx)(ei.ImageCard,{src:e.image_url,draggedImage:e,agentGenerated:!0,showAiGeneratedBadge:u?.({artifactType:"image",surface:"chat-card",item:e,agentGenerated:!0,threadId:r,actionId:a}),boxClassName:"flex-shrink-0 w-[92px] h-[130px]",boxStyle:{...i,borderRadius:4,overflow:"hidden"},downloadable:!0,onDownloadCallback:m,threadId:r,actionId:a},`${e.image_url}-${t+1}`)})})})]})]})}),eb=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),{event_data:i,emptyPlaceholder:n=null,loading:r,sessionModeType:a,threadId:s,actionId:l}=e,o=(0,M.useMemo)(()=>{if(!i?.artifact?.length)return[];let e=[];for(let t of i.artifact)t?.image_url&&e.push(t);return e},[i]),u=(0,M.useMemo)(()=>o?.length?o.length>1?t("agent_tool_image_generation_title"):(o&&o.length>0?o[o.length-1]:void 0)?.image_name||t("agent_tool_image_generation_title"):null,[o,t]);return o?.length||r?(0,k.jsx)(Z.default,{"data-testid":"image-generation-card",rootClassName:"flex w-full flex-col gap-2 relative",title:u,rightBtn:(0,k.jsx)("div",{className:"invisible h-7 w-[70px] flex-shrink-0"}),children:(0,k.jsx)(e_,{imageList:o,loading:r,sessionModeType:a,threadId:s||"",actionId:l||""})}):n});var ew=e.i(888591);let ej=(0,M.memo)((0,M.forwardRef)(function(e,t){let{className:i,itemClassName:n,imageList:r,downloadable:a}=e;return(0,k.jsx)("div",{ref:t,className:(0,eo.default)("image-card-list relative",i&&i),children:r?.map((e,t)=>(0,k.jsx)(ew.default,{src:e.image_url,draggedImage:e,boxClassName:n,downloadable:a},`${e.image_url}-${t+1}`))})}));e.s(["ImageCardList",0,ej],54343);let eN=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),{event_data:i}=e,n=(0,M.useMemo)(()=>
20{if(!i?.artifact?.length)return[];let e=[];for(let t of i.artifact)if(t?.images?.length)for(let i of t.images)i?.image_url&&e.push(i);return e},[i]);return n?.length?(0,k.jsx)(Z.default,{title:t("agent_tool_image_insight_title"),children:(0,k.jsx)(ej,{className:"flex w-full flex-wrap justify-start gap-[6px]",itemClassName:"flex-shrink-0 w-[60px] h-[80px] rounded-sm",imageList:n,downloadable:!1})}):null}),eE=(0,M.memo)(function(e){let{event_data:t}=e,i=(0,M.useMemo)(()=>{if(!t?.artifact?.length)return null;let e={};for(let i of t.artifact)i?.length<2||(e[i[0]]=i[1]);return e},[t]);return i?(0,k.jsx)(Z.default,{title:"",children:(0,k.jsxs)("div",{className:"markdown-content mx-2",children:[i.story&&(0,k.jsx)(ea.default,{children:i.story}),i.characters&&(0,k.jsx)(ea.default,{children:i.characters}),i.scenes&&(0,k.jsx)(ea.default,{children:i.scenes}),i.story_board&&(0,k.jsx)(ea.default,{children:i.story_board})]})}):null}),eT=(0,M.memo)(function(e){let{event_data:t,className:i}=e,n=(0,M.useMemo)(()=>{if(!t?.artifact?.length)return null;let e="";for(let i of t.artifact)e+=i?.text||"";return e},[t]);return n?(0,k.jsx)("div",{"data-testid":"markdown-text-message",className:(0,eo.default)("markdown-content mx-2",i&&i),children:(0,k.jsx)(ea.default,{children:n})}):null});function eC(){return(eC=Object.assign.bind()).apply(null,arguments)}let eA=function(e){return M.createElement("svg",eC({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),t||(t=M.createElement("path",{fill:"currentColor",d:"M20.12 5.45a2.33 2.33 0 0 1 2.33 2.33v12.34a2.33 2.33 0 0 1-2.33 2.33H7.78l-.238-.011A2.33 2.33 0 0 1 5.45 20.12V7.78c0-1.206.917-2.199 2.092-2.318l.238-.012zM7.78 7.25a.53.53 0 0 0-.53.53v12.34c0 .293.238.53.53.53h12.34a.53.53 0 0 0 .53-.53V7.78a.53.53 0 0 0-.53-.53zm9.07 2.695a.901.901 0 0 1 0 1.801h-3.956l4.623 4.623a.9.9 0 0 1-1.273 1.273l-4.493-4.494v3.698a.901.901 0 0 1-1.8 0v-5.7a1.2 1.2 0 0 1 1.2-1.2zm-1.4-8.395a.9.9 0 0 1 0 1.8h-10a2.1 2.1 0 0 0-2.1 2.1v11a.9.9 0 0 1-1.8 0v-11a3.9 3.9 0 0 1 3.9-3.9z"})))};e.s(["default",0,eA],671530);var ek=e.i(532675);let eM=(0,M.memo)(function(e){let{label:t,icon:i,variant:n="default",className:r="h-8 px-2",labelClassName:a,labelStyle:s,disabled:l,active:o,selected:u,children:c,...d}=e;return(0,k.jsxs)("button",{disabled:l,className:(0,ek.twClsx)("flex items-center justify-center gap-1","default"===n&&"rounded-lg border-none","outline"===n&&"box-border rounded-full border-[0.5px]",!l&&!o&&!u&&"hover:bg-lo-bg-overlay-hover active:bg-lo-bg-overlay-active border-[#C4C4C4] bg-[transparent] text-[#363636]",!l&&!o&&u&&"border-[#147DFF] bg-[#3D9BFF1A] text-[#147DFF] hover:bg-[#3D9BFF26] active:bg-[#3D9BFF40]",!l&&"cursor-pointer",l&&"cursor-not-allowed",l&&!u&&"border-[#E3E3E3] bg-[transparent] text-[#A8A8A8]",l&&u&&"border-[#8FCDFF] bg-[#3D9BFF1A] text-[#8FCDFF]",o&&!u&&"border-[#C4C4C4] bg-[#0C0C0D14] text-[#363636]",o&&u&&"border-[#147DFF] bg-[#3D9BFF40] text-[#147DFF]",r),...d,children:[i,t&&(0,k.jsx)("span",{className:(0,ek.twClsx)("text-xs",a),style:s,children:t}),c]})});function eI(e){return(0,k.jsx)(eM,{variant:"default",...e})}e.s(["AgentUITransparentButton",0,eI],112963);let eS={optionCard:{default:{},disabled:{maxWidth:"400px",background:"#FFFFFFF2",boxShadow:"none",backdropFilter:"blur(16px)",border:"0.5px solid #C1C5CC",borderRadius:12,padding:16},selectable:{maxWidth:"400px",background:"#FFFFFFF2",boxShadow:"0px 0px 0px 2px #FFFFFF inset, 0px 4px 16px 0px #58B7F64D",backdropFilter:"blur(16px)",border:"0.5px solid #59B7F6",borderRadius:12,padding:16}},questionCard:{default:{maxWidth:"400px",backdropFilter:"blur(16px)",boxShadow:"0px 0px 0px 2px #ffffff inset",background:"linear-gradient(360deg, rgba(255, 255, 255, 0.95) 20.79%, rgba(247, 247, 247, 0.95) 138.44%)",border:"0.5px solid #C1C5CC",padding:16,borderRadius:12}}};function eO(e){let{sessionModeType:t,scene:i,disabled:n}=e,r=eS[i];if(n)return r.disabled?r.disabled:r.default;switch(i){case"optionCard":if("living"===t)return r.default;return r.selectable;case"questionCard":if("living"===t)return{};return r.default;default:return r.default}}function eR(e){let{sessionModeType:t,scene:i}=e;if("living"===t)return"h-[68px] w-[110px]";switch(i){case"searchImage":default:return"h-[68px] w-[68px]";case"questionImage":return"w-[146px] h-[146px]"}}e.s(["getSessionModeImageOptionItemClassName",0,eR,"getSessionModeOptionsStyle",0,eO],424319);var eP=e.i(549060),eD=e.i(497107),eL=e.i(447154);let eF=(0,M.memo)(function(e){let{children:t}=e,[i]=(0,eD.usePreventPageZoomState)();return(0,k.jsx)(eP.Image.PreviewGroup,{preview:{rootClassName:"agent-chat-image-gallery-preview",icons:eL.imagePreviewNavIcons,countRender:eL.imagePreviewCountRender,onVisibleChange:e=>{i(e)}},children:t})});e.s(["ImagePreviewGroup",0,eF],776946);var eU=e.i(533197);function eV(){return(eV=Object.assign.bind()).apply(null,arguments)}let ez=function(e){return M.createElement("svg",eV({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),i||(i=M.createElement("path",{fill:"#fff",d:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8"})),n||(n=M.createElement("path",{stroke:"#000",strokeOpacity:.07,d:"M8 .5a7.5 7.5 0 1 1 0 15 7.5 7.5 0 0 1 0-15Z"})),r||(r=M.createElement("path",{fill:"#000",fillOpacity:.9,d:"M11.466 4.79a.438.438 0 0 1 .65.586l-5.25 5.834a.44.44 0 0 1-.634.016L3.607 8.601a.437.437 0 1 1 .618-.619l2.299 2.299z"})))};function eB(){return(eB=Object.assign.bind()).apply(null,arguments)}let e$=function(e){return M.createElement("svg",eB({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),a||(a=M.createElement("path",{fill:"#fff",fillOpacity:.7,d:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8"})),s||(s=M.createElement("path",{stroke:"#000",strokeOpacity:.07,d:"M8 .5a7.5 7.5 0 1 1 0 15 7.5 7.5 0 0 1 0-15Z"})))},eH=(0,M.memo)(function(e){let{images:t,selectedMap:i,inputSelectedMap:n={},readonly:r=!1,onClick:a,previewClickRef:s,rowIndex:l,threadId:o,actionId:u}=e,c=(0,M.useRef)(null),d=(0,M.useCallback)(e=>{c.current&&e?.target&&!e?.target?.closest(".agent-chat-image-preview")&&c.current?.contains(e?.target)&&a?.(e)},[a]);if(!t?.length)return null;let h=r&&!Object.keys(i)?.length,m=!r&&Object.keys(n)?.length>0;return(0,k.jsx)("div",{ref:c,className:"grid w-full gap-1",style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`,gridAutoFlow:"row"},children:t?.map((e,t)=>{let a=e?.image_url,c=e?.source;if(!a)return null;let p=i?.[a],f=n?.[a],g=!r&&m&&!f,x=r||g,v=h||g||x&&!p;return(0,k.jsxs)("div",{"data-index":t,"data-value":a,"data-source":c,"data-row-index":l,"data-col-index":t,onClick:x?void 0:d,className:(0,ek.twClsx)("group relative w-full overflow-hidden rounded-[2px] p-[2px]",!x&&"cursor-pointer"),children:[(0,k.jsx)("div",{className:"pointer-events-none absolute left-0 top-0 z-20 h-full w-full",style:{backgroundColor:v?"#FFFFFF":"transparent",opacity:v?.6:1},children:!(r&&!p&&!f||g)&&(0,k.jsx)("div",{className:"absolute left-1 top-1",children:p?(0,k.jsx)(ez,{}):f?(0,k.jsx)(e$,{color:"#147DFF"}):(0,k.jsx)(e$,{color:"#86909C"})})}),(0,k.jsx)(ew.default,{src:e?.image_url,boxClassName:(0,ek.twClsx)("aspect-square w-full cursor-pointer rounded",!x&&"pointer-events-none"),boxStyle:{width:"100%",height:"auto"},threadId:o,actionId:u,children:!x&&(0,k.jsx)("div",{className:"absolute left-0 top-0 z-10 h-full w-full bg-black-500 opacity-0 transition-opacity duration-300 group-hover:opacity-100",children:(0,k.jsx)("div",{className:"pointer-events-auto absolute bottom-1 right-1 cursor-pointer",onClick:e=>{let t=e?.currentTarget?.parentElement?.parentElement,i=t?.getElementsByClassName("agent-chat-image-preview")?.[0];i?.click(),s.current=!0},children:(0,k.jsx)(eU.default,{className:"agent-chat-image-preview-icon size-4 text-white transition-transform duration-150 hover:scale-110"})})})})]},t)})})});e.s(["SelectableImageList",0,eH],605564);var eq=e.i(270168);let eW=e=>{let{selectedMap:t,inputSelectedMap:i,readonly:n}=e;return(0,M.useMemo)(()=>
20n&&i&&Object.keys(i)?.length?i:t,[t,i,n])};e.s(["useMergedSelectedMap",0,eW],898561);var eG=e.i(110005);let eY=(0,M.memo)(function(e){let{galleryList:t,disabled:i,inputSelectedMap:n,threadId:r,actionId:a,sessionModeType:s}=e,l=(0,M.useRef)(+new Date),o=(0,M.useRef)(!1),{selectedMap:u,handleSelect:c}=(0,eq.useAgentUIInputParamSelectHandler)({groupKey:`${l?.current}_inspiration_image`,dataKey:"imageUrl"}),d=eW({selectedMap:u,inputSelectedMap:n,readonly:i}),h=(0,M.useCallback)(e=>{if(o.current){o.current=!1;return}let t=e?.currentTarget?.dataset?.value;if(!t)return;let i=e?.currentTarget?.dataset?.source,n=Number(e?.currentTarget?.dataset?.rowIndex??-1),s=Number(e?.currentTarget?.dataset?.colIndex??-1);c({key:t,type:"image",source:i,metaInfo:{display_mode:"row_col",source_agent_action_id:a,source_row:n,source_col:s},data:{imageUrl:t,imageLabel:"reference",imageSource:i}}),function(e){let{threadId:t,actionId:i,mediaSource:n,imageUrl:r,itemRow:a,itemCol:s}=e;(0,eG.mc)("agent.output.media.item.click",{thread_id:t,action_id:i,media_source:n||"",display_mode:"row_col",image_url:r,item_row:a,item_col:s},eG.DUAL_WRITE_OPTIONS)}({threadId:r,actionId:a,mediaSource:i,imageUrl:t,itemRow:Number(n),itemCol:Number(s)})},[c,r,a]),m=eR({sessionModeType:s,scene:"searchImage"}),p=(0,M.useMemo)(()=>"replay"===s?void 0:{threadId:r,actionId:a},[s,r,a]);return(0,k.jsx)(eF,{children:t.map((e,t)=>e?.images?.length?(0,k.jsx)("div",{className:"flex flex-col gap-1",children:(0,k.jsx)(eH,{rowIndex:t,images:e?.images?.slice(0,4),readonly:i,selectedMap:d,inputSelectedMap:n,onClick:i?void 0:h,itemClassName:m,previewClickRef:o,...p})},t):null)})}),eQ=(0,M.memo)(function(e){let{threadId:t,actionId:i,mediaSource:n,galleryList:r}=e;return(0,M.useEffect)(()=>{!function(e){let{threadId:t,actionId:i,mediaSource:n,galleryList:r}=e;(0,eG.mc)("agent.output.media.show",{thread_id:t,action_id:i,media_source:n,display_mode:"row_col",contents:r},eG.DUAL_WRITE_OPTIONS)}({threadId:t,actionId:i,mediaSource:n,galleryList:r})},[]),null}),eK=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),{event_data:i,isLastSession:n,sessionModeType:r,inputSelectedMap:a,threadId:s,actionId:l}=e,o=!n||"replay"===r,u=(0,M.useMemo)(()=>(0,O.parseGeneralImageSearchOptions)(i),[i]);if(!u?.length)return;let c=eO({sessionModeType:r,scene:"optionCard",disabled:o}),d=u?.[0]?.images?.[0]?.source;return(0,k.jsxs)("div",{className:"flex flex-row gap-3","data-testid":"search-image-gallery",style:c,children:[(0,k.jsx)(Z.default,{rootClassName:"flex w-full flex-col gap-2",title:t("agent_tool_image_search_title"),textClassName:(0,eo.default)("line-clamp-1 cursor-text select-text text-ellipsis break-all empty:hidden","font-[Poppins] text-sm font-semibold text-[#2f3640]"),className:"flex flex-1 items-center justify-between",rightBtn:"replay"!==r&&(0,k.jsx)(eI,{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center",icon:(0,k.jsx)(eA,{width:14,height:14,className:"[&_path]:fill-[currentColor]"}),onClick:()=>{(0,eu.getAgentUIContext)()?.handleInsertGalleryImages?.({galleryList:u,threadId:s,actionId:l}),function(e){let{threadId:t,actionId:i,mediaSource:n}=e;(0,eG.mc)("agent.output.media.item.send2canvas.click",{thread_id:t,action_id:i,media_source:n||"",display_mode:"row_col"},eG.DUAL_WRITE_OPTIONS)}({galleryList:u,mediaSource:d,threadId:s,actionId:l})}}),children:(0,k.jsx)(eY,{galleryList:u,disabled:o,inputSelectedMap:a,sessionModeType:r,threadId:s,actionId:l})}),!o&&(0,k.jsx)(eQ,{mediaSource:d,galleryList:u,threadId:s,actionId:l})]})});function eX(){return(eX=Object.assign.bind()).apply(null,arguments)}let eZ=function(e){return M.createElement("svg",eX({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),l||(l=M.createElement("path",{fill:"#2D2D2D",fillRule:"evenodd",d:"M9.414 18.708 8 17.294 13.293 12 8 6.708l1.414-1.414L16.121 12z",clipRule:"evenodd"})))};var eJ=e.i(743026);e.s(["DraggableImage",()=>eJ.default],60587);var eJ=eJ,e0=e.i(189173);e.s(["ImagePreviewList",()=>e0.default],195705);var e0=e0;function e1(e){let t=[],i=0,n=e.length;for(;i<n;){if("\\"===e[i]&&i+1<n){i+=2;continue}
20if(e.startsWith("```",i)){"```"===t[t.length-1]?t.pop():t.push("```"),i+=3;continue}if(t.includes("```")){i++;continue}if("`"===e[i]){"`"===t[t.length-1]?t.pop():t.push("`"),i++;continue}if(t.includes("`")){i++;continue}if(e.startsWith("**",i)){"**"===t[t.length-1]?t.pop():t.push("**"),i+=2;continue}if("*"===e[i]){(0===i||"\n"===e[i-1])&&i+1<n&&" "===e[i+1]||("*"===t[t.length-1]?t.pop():t.push("*")),i++;continue}if("["===e[i]){t.push("]"),i++;continue}if("]"===e[i]){if("]"===t[t.length-1]&&(t.pop(),i+1<n&&"("===e[i+1])){t.push(")"),i+=2;continue}i++;continue}if(")"===e[i]){")"===t[t.length-1]&&t.pop(),i++;continue}i++}let r=e;for(;t.length>0;){let e=t.pop();e&&(r+=e)}return r}function e2(e){return(0,k.jsx)(eT,{...e,className:"!mx-0",event_type:"visual_identity_design_directions",event_data:{artifact_type:"visual_identity_design_directions",artifact:[{text:e.markdown}]}})}let e5=(0,M.memo)(({title:e,summary:t,references:i=[],messageProps:n,onViewReport:r,actionSlot:a,viewReportText:s})=>{let{t:l}=(0,K.useI18n)(),o=(0,M.useMemo)(()=>"replay"===n.sessionModeType?void 0:{threadId:n.threadId,actionId:n.actionId},[n.sessionModeType,n.threadId,n.actionId]);return(0,k.jsxs)("div",{className:"flex w-full flex-col gap-2 rounded-lg border-[0.5px] border-solid p-3",style:{borderColor:"var(--Stroke-Medium, #C4C4C4)"},children:[(0,k.jsx)("p",{className:"whitespace-pre-wrap font-['Poppins'] text-[15px] font-semibold leading-normal text-[#363636]",children:e}),t&&(0,k.jsx)("div",{className:"line-clamp-3 w-full text-sm leading-5 text-black",children:(0,k.jsx)(e2,{...n,markdown:function(e){if(!e)return"";let t=e.split("\n"),i=[],n=!1,r=!1,a=!1;for(let e=0;e<t.length;e++){let s=t[e];if(s.trim().startsWith("```")&&(a=!a))break;if(!a){if(!n&&/^#{1,6}\s+/.test(s)){n=!0,i.push(s);continue}if(n){let e=s.trim();if(!e){if(r)break;continue}if(!r&&/^#{1,6}\s+/.test(e))continue;if(!r&&e){r=!0,i.push(s);continue}if(r){if(/^#{1,6}\s+/.test(e)||!e)break;i.push(s)}}}}if(!n){let e=0;for(let n=0;n<t.length;n++){let r=t[n],s=r.trim();if(r.trim().startsWith("```")&&(a=!a))break;if(!a){if(!s){if(e>0)break;continue}if(/^#{1,6}\s+/.test(s)){if(i.push(r),++e>=2)break;continue}if(i.push(r),++e>=2)break}}}let s=i.join("\n").trim();if(s.length>300){let e=s.split("\n"),t="",i=s;e.length>0&&/^#{1,6}\s+/.test(e[0])?(t=e[0]+"\n",i=e.length>1?e.slice(1).join("\n"):""):i=s;let n=Math.max(0,300-t.length);if(i.length>n){let e=n,r=[".","!","?","。","!","?","\n"];for(let t=e;t<Math.min(i.length,e+100);t++)if(r.includes(i[t])){e=t+1;break}s=(t+(i=e1(i=i.substring(0,e)))).trim()}}else s=e1(s);return s===e.trim()?e:(s!==e.trim()&&(s+="..."),s)}(t)})}),i.length>0&&(0,k.jsx)("div",{className:"grid w-full grid-cols-5 gap-2",children:(0,k.jsx)(e0.default,{children:i.map((e,t)=>(0,k.jsx)("div",{className:"aspect-[148/204] w-full shrink-0 overflow-hidden rounded bg-[#f7f7f7]",children:(0,k.jsx)(eJ.default,{src:e.image_url,previewRootClassName:"full-report-card-preview",...o,toolCallId:n.toolCallId,enableDownload:!0,enableAddToCanvas:!0,enableSendToChatbox:!0,draggedImage:{image_url:e.image_url,image_name:e.description,width:void 0,height:void 0}})},e.id||t))})}),a||(0,k.jsxs)("button",{type:"button",onClick:()=>{(0,eG.mc)("agent.deep_research.view_full_report.click",{thread_id:n.threadId,action_id:n.actionId,tool_call_id:n.toolCallId},eG.DUAL_WRITE_OPTIONS),r?.()},className:"flex w-fit items-center justify-center transition-opacity hover:opacity-70",children:[(0,k.jsx)("div",{className:"flex-none",children:(0,k.jsx)(eZ,{className:"h-3.5 w-3.5 rotate-180 text-neutral-g6 [&_path]:fill-current"})}),(0,k.jsx)("span",{className:"ml-1 text-xs font-normal leading-5 text-neutral-g6",children:l(s||"agent_deep_research_view_full_report")})]})]})});function e3(){return(e3=Object.assign.bind()).apply(null,arguments)}e5.displayName="FullReportCard";let e4=function(e){return M.createElement("svg",e3({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),o||(o=M.createElement("path",{fill:"#000",d:"M12 4a8 8 0 0 0-8 8 8 8 0 0 0 8 8 8 8 0 0 0 8-8h2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z"})))};function e7({className:e}){return(0,k.jsx)("svg",{viewBox:"0 0 4 4",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:(0,k.jsx)("circle",{cx:"2",cy:"2",r:"2",fill:"
20currentColor"})})}(0,M.memo)(({title:e,summaryText:t,onClick:i})=>(0,k.jsxs)("div",{className:"ml-1 flex w-full flex-col gap-1",children:[(0,k.jsxs)("div",{className:"flex items-center gap-1",children:[(0,k.jsx)("div",{className:"flex h-4 w-3 flex-shrink-0 items-center justify-center",children:(0,k.jsx)(e7,{className:"h-1 w-1 flex-shrink-0 text-[var(--text-icon-black,#141414)]"})}),(0,k.jsx)("p",{className:"truncate font-['Inter'] text-xs leading-[1.4] font-bold text-[var(--text-icon-black,#141414)]",children:e})]}),(0,k.jsxs)("button",{type:"button",onClick:i,className:"ml-4 flex w-fit items-center transition-opacity hover:opacity-70",children:[(0,k.jsx)("span",{className:"text-xs leading-5 font-normal text-[#919191]",children:t}),(0,k.jsx)("div",{className:"ml-1 flex-none",children:(0,k.jsx)(eZ,{className:"text-neutral-g6 h-3.5 w-3.5 [&_path]:fill-current"})})]})]})).displayName="StepCardCollapsed";let e6=(0,M.memo)(({title:e,queries:t=[]})=>(0,k.jsxs)("div",{className:"ml-1 flex w-full flex-col gap-1",children:[(0,k.jsxs)("div",{className:"flex items-center gap-1",children:[(0,k.jsx)("div",{className:"flex h-4 w-3 flex-shrink-0 items-center justify-center",children:(0,k.jsx)(e7,{className:"h-1 w-1 flex-shrink-0 text-[var(--text-icon-black,#141414)]"})}),(0,k.jsx)("p",{className:"truncate font-['Inter'] text-xs leading-[1.4] font-bold text-[var(--text-icon-black,#141414)]",children:e})]}),t.length>0&&(0,k.jsx)("ul",{className:"ml-4 flex flex-col gap-1",children:t.map((e,t)=>(0,k.jsxs)("li",{className:"flex items-center gap-2",children:[(0,k.jsx)(e4,{className:"h-3 w-3 shrink-0 animate-spin text-[#8a8a8a] [&>*]:fill-[#8a8a8a]"}),(0,k.jsx)("span",{className:"truncate text-xs leading-5 font-normal text-[#8a8a8a]",children:e})]},`query-${t}`))})]}));e6.displayName="StepCardActive";var eJ=eJ,e0=e0;function e8(e,t){let[i,n]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{let e=setInterval(()=>{n(Array.from(document.querySelectorAll(`.${t} .ant-image-preview-wrap`)).some(e=>"none"!==getComputedStyle(e).display))},100);return()=>clearInterval(e)},[e,t]),i}e.s(["useImagePreviewOpen",0,e8],29781);var e9=e.i(854480);function te(){return(0,e9.useMediaQuery)("(max-width: 768px)")}e.s(["useIsMobile",0,te],178952);var tt=e.i(410258),ti=e.i(509976),tn=e.i(587939);function tr(e={}){let{enabled:t=!0,onDragStart:i,onDragEnd:n}=e,r=(0,M.useRef)(null),a=(0,M.useRef)(null),s=(0,M.useRef)({startX:0,startY:0,initialTranslateX:0,initialTranslateY:0,isDragging:!1,rafId:0}),l=(0,M.useCallback)(e=>{if(!t||e.target.closest('button, a, input, textarea, [role="button"], .no-drag'))return;let n=r.current;if(!n)return;e.preventDefault(),i?.(e);let a=s.current;a.isDragging=!0,a.startX=e.clientX,a.startY=e.clientY;let l=new DOMMatrixReadOnly(window.getComputedStyle(n).transform);a.initialTranslateX=l.m41,a.initialTranslateY=l.m42,document.addEventListener("mousemove",o,{passive:!1}),document.addEventListener("mouseup",u),document.body.style.userSelect="none",n.style.willChange="transform"},[t,i]),o=(0,M.useCallback)(e=>{let t=s.current;if(!t.isDragging||!r.current)return;e.preventDefault();let i=e.clientX-t.startX,n=e.clientY-t.startY;t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{r.current&&(r.current.style.transform=`translate3d(${t.initialTranslateX+i}px, ${t.initialTranslateY+n}
20px, 0)`)})},[]),u=(0,M.useCallback)(()=>{let e=s.current;e.isDragging&&(e.isDragging=!1,e.rafId&&(cancelAnimationFrame(e.rafId),e.rafId=0),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",u),document.body.style.userSelect="",r.current&&(r.current.style.willChange=""),n?.())},[n,o]);return(0,M.useEffect)(()=>()=>{let e=s.current;e.rafId&&cancelAnimationFrame(e.rafId),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",u)},[o,u]),{targetRef:r,handleRef:a,handleDragStart:l}}function ta({visible:e,onClose:t,children:i,title:n,desktopBodyPadding:r="md:px-[88px]",draggable:a=!0,closeOnEscape:s=!1}){let l=te(),o=(0,eu.useAgentUIContext)(),u=!l&&a,{targetRef:c,handleDragStart:d}=tr({enabled:u});(0,M.useEffect)(()=>{if(!e||!s)return;let i=e=>{if("Escape"!==e.key)return;let i=e.target;i?.tagName==="TEXTAREA"||i?.tagName==="INPUT"||i?.isContentEditable||t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,s,t]);let h=o.agentChatSide??"right",m=(0,M.useMemo)(()=>{if(l)return 0;let e=o.getAgentChatWidth?.()??0;if(0===e)return 0;let t=window.innerWidth;if(t-e>800){let i=t/2-e-32-400;return"left"===h?-i:i}return 0},[h,l,o]);return!e||"u"<typeof document?null:(0,tt.createPortal)((0,k.jsx)("div",{className:"pointer-events-none fixed inset-0 z-[200] flex items-center justify-center",children:(0,k.jsxs)("div",{ref:c,className:(0,tn.cn)("pointer-events-auto flex flex-col bg-white",l?"h-full w-full":"w-[800px] max-w-[calc(100vw-32px)] rounded-2xl shadow-[0_8px_24px_rgba(0,0,0,0.12)]"),style:{...0!==m&&{transform:`translateX(${m}px)`}},children:[(0,k.jsxs)("div",{className:"flex items-center justify-between px-4 py-4",onMouseDown:d,style:{cursor:u?"move":"default",borderBottom:"0.5px solid var(--Stroke-Light, #E3E3E3)"},children:[(0,k.jsx)("h2",{className:"font-['Inter'] text-[16px] font-medium leading-[17px] text-[#141414]",children:n}),(0,k.jsx)("button",{type:"button","aria-label":"Close",onClick:t,className:"text-lo-icon-secondary hover:text-lo-icon-default flex size-6 shrink-0 cursor-pointer items-center justify-center",children:(0,k.jsx)(ti.default,{className:"size-4"})})]}),(0,k.jsx)("div",{className:`agent-chat-scrollbar px-4 py-[24px] ${r}`,style:{maxHeight:l?void 0:"70vh",overflowY:"auto"},children:i})]})}),document.body)}e.s(["useDraggable",0,tr],164164);let ts=(0,M.memo)(function({visible:e,onClose:t,artifacts:i,title:n,sessionModeType:r,threadId:a,actionId:s}){let{t:l}=(0,K.useI18n)(),o=e8(e,"si-image-preview-open"),u=te(),c=(0,M.useMemo)(()=>"replay"===r?void 0:{threadId:a,actionId:s},[r,a,s]);return(0,k.jsx)(ta,{visible:e,onClose:t,title:n||"Search Images",closeOnEscape:!o,desktopBodyPadding:"md:px-6",children:(0,k.jsx)("div",{className:"flex flex-col gap-6",children:i.map((e,t)=>{let i=(e.images||[]).map((e,i)=>({id:e.artifact_id||`${t}-${i}`,image_url:e.image_url,description:e.description,title:e.description,width:e.width,height:e.height}));if(0===i.length)return null;let n=e.search_query||"";return(0,k.jsx)(e0.default,{children:(0,k.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,k.jsx)("div",{className:"flex flex-col gap-1",children:n&&(0,k.jsxs)("p",{className:"font-['Inter'] text-[24px] font-semibold leading-[29px] text-[#141414]",children:[l("agent_deep_research_key_takeaways"),": ",n]})}),((e,t,i=!1,n)=>(0,k.jsxs)("div",{className:"flex flex-col gap-3",children:[t&&(0,k.jsxs)("h3",{className:"font-['Poppins'] text-[14px] font-semibold leading-normal text-[#525252]",children:[t," ",(0,k.jsxs)("span",{className:"text-[#919191]",children:["· ",e.length]})]}),(0,k.jsx)(e0.default,{children:e.length>0&&(0,k.jsx)("div",{className:"flex flex-col gap-2",children:i?(0,k.jsx)("div",{className:"grid grid-cols-2 gap-2",children:e.map((e,t)=>(0,k.jsx)("div",{className:"aspect-square overflow-hidden rounded bg-[#f7f7f7]",children:(0,k.jsx)(eJ.default,{src:e.image_url,alt:e.description||"",description:e.description,previewRootClassName:"si-image-preview-open",...n,enableDownload:!0,enableAddToCanvas:!0,enableSendToChatbox:!0,draggedImage:{image_url:e.image_url,width:e.width,height:e.height,description:e.description},draggingSource:"search_images_modal"})},e.id||t))}):(function(e,t=.85){let i=[],n=[],r=0;for(;r<e.length;){let a=e[r];n.push(a);let s=n.reduce((e,t)=>
20e+203*(t.width&&t.height?t.width/t.height:1),0),l=(n.length-1)*8,o=s+l;if(o>=752*t||r===e.length-1){let a=r===e.length-1&&o<752*t?1:(752-l)/s;i.push({images:[...n],scaleFactor:a}),n=[]}r++}return i})(e).map((e,t)=>(0,k.jsx)("div",{className:"flex gap-2",children:e.images.map((t,i)=>{var r;let a=(r=e.scaleFactor,{width:Math.round(203*(t.width&&t.height?t.width/t.height:1)*r),height:203});return(0,k.jsx)("div",{className:"overflow-hidden rounded bg-[#f7f7f7]",style:{height:`${a.height}px`,width:`${a.width}px`,flexShrink:0},children:(0,k.jsx)(eJ.default,{src:t.image_url,alt:t.description||"",description:t.description,previewRootClassName:"si-image-preview-open",...n,enableDownload:!0,enableAddToCanvas:!0,enableSendToChatbox:!0,draggedImage:{image_url:t.image_url,width:t.width,height:t.height,description:t.description},draggingSource:"search_images_modal"})},t.id||i)})},t))})})]}))(i,l("agent_deep_research_visual_reference"),u,c)]})},t)})})})}),tl=(0,M.memo)(function(e){let t=(Array.isArray(e?.event_data?.artifact)?e.event_data.artifact:[]).filter(e=>e?.artifact_type==="group_image_search"),[i,n]=(0,M.useState)(!1),r=0===t.length,a=e.toolInput,s=a?.current_step,l=a?.search_query,o=a?.search_queries||(l?[l]:[]),u=s||"Visual references",c=o.length>0?o:[u],d=(0,M.useMemo)(()=>{let e=[];return t.forEach(t=>{(Array.isArray(t?.images)?t.images:[]).forEach((i,n)=>{let r=i?.image_url||i?.url;r&&e.push({id:`${t.search_query||"img"}-${i?.artifact_id||n}`,image_url:r,url:r,description:i?.description||i?.title||t.search_query})})}),e},[t]),h=!!(0,M.useMemo)(()=>t.map(e=>e.search_query).filter(Boolean).join(", ")||void 0,[t])||d.length>0;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{"data-testid":"search-images-card",className:"mb-[2px] flex w-full flex-col gap-3",children:r?(0,k.jsx)(e6,{title:u,queries:c}):h&&(0,k.jsx)(e5,{title:u,references:d,messageProps:e,onViewReport:()=>n(!0),viewReportText:"agent_deep_research_view_full_report"})}),i&&(0,k.jsx)(ts,{visible:i,onClose:()=>n(!1),artifacts:t,title:u,sessionModeType:e.sessionModeType,threadId:e.threadId,actionId:e.actionId})]})});e.i(676385);var to=e.i(850654);let tu={AttachmentUploadStart:{value:"agent-attachment-upload-start",info:"开始上传附件"},AttachmentUploadSuccess:{value:"agent-attachment-upload-success",info:"附件上传成功"},AttachmentUploadError:{value:"agent-attachment-upload-error",info:"附件上传失败"},AttachmentPreviewReady:{value:"agent-attachment-preview-ready",info:"等待图片上传并生成预览"},AttachmentRemoved:{value:"agent-attachment-removed",info:"附件已移除"},ThreadStart:{value:"agent-thread-start",info:"等待对话线程开始"},ThreadInitialized:{value:"agent-thread-initialized",info:"等待对话线程初始化"},ThreadEnd:{value:"agent-thread-end",info:"等待对话线程结束"},ActionStart:{value:"agent-action-start",info:"等待 Agent 动作开始",level:"debug"},ActionEnd:{value:"agent-action-end",info:"等待 Agent 动作执行完成",level:"debug"},StepStart:{value:"agent-step-start",info:"等待 Agent 步骤开始",level:"debug"},StepEnd:{value:"agent-step-end",info:"等待 Agent 步骤执行完成",level:"debug"},MessageSendStart:{value:"agent-message-send-start",info:"开始发送消息",level:"debug"},MessageSendSuccess:{value:"agent-message-send-success",info:"消息发送成功",level:"debug"},MessageSendError:{value:"agent-message-send-error",info:"消息发送失败"},MessageReceiveStart:{value:"agent-message-receive-start",info:"开始接收消息",level:"debug"},MessageReceiveComplete:{value:"agent-message-receive-complete",info:"消息接收完成",level:"debug"},MessageReceived:{value:"agent-message-received",info:"收到消息",level:"debug"},AssetLibraryMentionRefSynced:{value:"agent-asset-library-mention-ref-synced",info:"Asset Library mention 已同步到 Ref"},ReasoningMessageFinished:{value:"agent-reasoning-message-finished",info:"Agent reasoning 消息已完成"},GeneratorMessageSendStart:{value:"agent-generator-message-send-start",info:"Agent Generator 开始发送",level:"debug"},CommerceRestoreRequested:{value:"agent-commerce-restore-requested",info:"Agent 商业化卡片已请求恢复"},NotificationBoardActionSettled:{value:"agent-notification-board-action-settled",info:"通知看板动作已完成"},ToolExecutionStart:{value:"agent-tool-execution-start",info:"工具执行开始"},ToolExecutionComplete:{value:"agent-tool-execution-complete",info:"工具执行完成"},ToolExecutionError:{value:"agent-tool-execution-error",info:"工具执行出错"},PanelOpened:{value:"agent-panel-opened",info:"Agent 面板已打开"},PanelClosed:{value:"agent-panel-closed",info:"Agent 面板已关闭"},PanelReady:{value:"agent-panel-ready",info:"Agent 面板已就绪"},PanelInitialized:{value:"agent-panel-initialized",info:"等待 Agent 面板初始化完成"},ArtifactGenerated:{value:"agent-artifact-generated",info:"Artifact 已生成"},ArtifactInserted:{value:"agent-artifact-inserted",info:"Artifact 已插入"},SkillSaved:{value:"agent-skill-saved",info:"Agent Skill 已保存"},CrashTest:{value:"agent-crash-test",info:"测试模式:主动触发错误"}};e.s(["AgentEvents",0,tu],697727);var tc=e.i(377636);e.i(132249);var td=e.i(306617),th=e.i(6184),tm=e.i(533528),tp=e.i(86979),tf=e.i(451078);let tg=(0,M.memo)(function(e){let{skill:t,onChange:i,threadId:n,actionId:r}=e,[a,s]=(0,M.useState)(null);return(0,k.jsxs)("button",{"data-testid":to.Agent.SkillCardEdit,className:(0,tn.cn)("rounded-lo-radius-8 inline-flex size-8 items-center justify-center","text-lo-icon-default border-lo-border-neutral-l2 cursor-pointer border","hover:bg-lo-bg-overlay-hover active:bg-lo-bg-overlay-active bg-transparent"),onClick:()=>{let e=new Date()?.toUTCString();s({...t,id:e,key:e,title:t.name}),(0,eG.mc)("agent.guide.card.create_skill.edit.click",{thread_id:n,action_id:r,skill_name:t?.name??""},eG.DUAL_WRITE_OPTIONS)},children:[(0,k.jsx)(tp.default,{className:"size-4"}),a&&(0,k.jsx)(tf.default,{skill:a,hidePopoverMenu:!0,onClose:()=>{s(null)},onSubmit:e=>{i?.({...t,...e}),s(null)}})]})});function tx(e){return`skill-${e}`}function tv(e){let{threadId:t,actionId:i,skillName:n}=e,r=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{r.current||(r.current=!0,(0,eG.mc)("agent.guide.card.create_skill.show",{thread_id:t,action_id:i,skill_name:n},eG.DUAL_WRITE_OPTIONS))},[i,t,n]),null}let ty=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),{ugcVersion:i,skill:n,taskId:r,threadId:a,actionId:s,sessionModeType:l,isOnProgressSession:o,readonly:u}=e,[c,d]=(0,M.useState)(n),[h,m]=(0,M.useState)(()=>+!!localStorage?.getItem?.(tx(r))),p=1===h,f=c?.name,g=async()=>{try{if(-1===h)return;(0,eG.mc)("agent.guide.card.create_skill.save.click",{thread_id:a,action_id:s,skill_name:f},eG.DUAL_WRITE_OPTIONS),m(-1);let e=await (0,tm.requestCreateUgcSkill)({ugcVersion:i,taskId:r,threadId:a,skill:c});if(!e){(0,td.notifyError)(t("agent_skill_save_error")),m(0);return}localStorage?.setItem?.(tx(r),"1"),m(1),(0,th.emitTestEvent)(tu.SkillSaved,{taskId:r,threadId:a,skill:c}),window?.dispatchEvent?.(new CustomEvent("AGENT_USER_SKILL_SAVED",{detail:{taskId:r,threadId:a,skill:c}})),(0,eG.mc)("agent.guide.card.create_skill.save.success",{skill_id:e,thread_id:a,action_id:s,skill_name:f},eG.DUAL_WRITE_OPTIONS)}catch(e){(0,td.notifyError)(t("agent_skill_save_error")),m(0)}};return(0,k.jsxs)("div",{"data-testid":to.Agent.SkillCard,className:(0,tn.cn)("border-lo-border-neutral-l1 rounded-lo-radius-16 border"),children:[(0,k.jsxs)("div",{className:"flex h-[72px] items-center justify-between gap-3 px-3",children:[(0,k.jsx)("div",{className:"bg-lo-bg-overlay flex h-10 w-10 items-center justify-center rounded-full",children:(0,k.jsx)(tc.default,{className:"text-lo-accent-cyan size-4"})}),(0,k.jsxs)("div",{className:"flex flex-1 flex-col justify-center",children:[(0,k.jsx)("div",{className:"text-lo-text-default line-clamp-1 text-[13px] leading-5",children:c?.name}),c?.description&&(0,k.jsx)("div",{className:"text-lo-text-secondary mt-0.5 line-clamp-1 text-xs leading-[18px]",children:c?.description})]})]}),"replay"!==l&&!u&&(0,k.jsx)("div",{className:"border-lo-border-neutral-l1 h-14 w-full justify-end border-t px-3",children:(0,k.jsxs)("div",{className:"flex h-full items-center justify-end gap-2",children:[!p&&(0,k.jsx)(tg,{skill:c,onChange:e=>{d(t=>({...t,...e}))},threadId:a,actionId:s}),!p&&(0,k.jsx)("button",{"data-testid":to.Agent.SkillCardSave,className:(0,tn.cn)("rounded-lo-radius-8 inline-flex h-8 cursor-pointer items-center px-3 text-[13px]","bg-lo-bg-invert text-lo-text-onbrand hover:bg-lo-bg-invert-hover active:bg-lo-bg-invert-active disabled:cursor-wait disabled:opacity-50"),disabled:-1===
20h,onClick:g,children:t("agent_skill_save_tip")}),p&&(0,k.jsx)("div",{"data-testid":to.Agent.SkillCardSaved,className:(0,tn.cn)("rounded-lo-radius-8 inline-flex h-8 items-center px-3 text-[13px]","text-lo-text-disabled border-lo-border-neutral-l2 select-none border"),children:t("agent_skill_saved_tip")})]})}),o&&(0,k.jsx)(tv,{threadId:a,actionId:s,skillName:f})]})});e.s(["default",0,ty],273219);let t_=(0,M.memo)(function(e){let{createSkillInfo:t,...i}=e,{skills:n,task_id:r,thread_id:a}=t;return(0,k.jsx)("div",{className:"flex flex-col gap-2",children:n.map(e=>(0,k.jsx)(ty,{skill:e,taskId:r,threadId:a,...i},e.name))})}),tb=(0,M.memo)(function(e){let{event_data:t,...i}=e,n=(0,M.useMemo)(()=>t?.artifact?.length?t.artifact?.[0]:null,[t]);return n?.skills?.length?(0,k.jsx)(t_,{createSkillInfo:n,...i}):null}),tw=(0,M.memo)(function(e){let{questions:t,sessionModeType:i}=e,n=t?.length;if(!n)return null;let r=eO({sessionModeType:i,scene:"questionCard"});return(0,k.jsxs)("div",{className:(0,eo.default)("whitespace-pre-wrap text-wrap break-words","font-[Poppins] text-[14px] font-medium leading-[1.6] text-[#2F3640]"),"data-testid":"question-list",style:r,children:[1===n&&(0,k.jsx)("span",{className:"cursor-text select-text",children:t?.[0]}),n>1&&(0,k.jsx)("ol",{className:"list-decimal pl-4",children:t.map((e,t)=>(0,k.jsx)("li",{className:"mb-1 cursor-text select-text list-decimal",children:e},t))})]})}),tj=(0,M.memo)(function(e){let{options:t,readonly:i=!0,inputSelectedMap:n,threadId:r,actionId:a,sessionModeType:s}=e,{selectedMap:l,handleSelect:o}=(0,eq.useAgentUIInputParamSelectHandler)({groupKey:"question_image",dataKey:"imageUrl"}),u=eW({selectedMap:l,inputSelectedMap:n,readonly:i}),c=(0,M.useRef)(!1),d=(0,M.useCallback)(e=>{if(c.current){c.current=!1;return}let t=e?.currentTarget?.dataset?.value,i=e?.currentTarget?.dataset?.source;if(!t)return;o({key:t,type:"image",source:"request_feedback",data:{imageUrl:t,imageLabel:"reference",imageSource:i}});let n=e?.currentTarget?.dataset?.index??-1;(0,eG.mc)("agent.ask.widget.option.click",{widget_type:"image_url",thread_id:r,action_id:a,option:t,option_index:Number(n)},eG.DUAL_WRITE_OPTIONS)},[o,r,a]),h=(0,M.useMemo)(()=>t?.length?t?.filter(O.checkIsQuestionImageOption).map(e=>({image_url:e.content}),[]):[],[t]),m=(0,M.useMemo)(()=>{if(!h?.length)return[];if(h.length<=3)return[h];let e=[];for(let t=0;t<h.length;t+=3){let i=h.slice(t,t+3);i.length<3&&i.push(...Array(3-i.length).fill({image_url:""})),e.push(i)}return e},[h]),p=(0,M.useMemo)(()=>"replay"===s?void 0:{threadId:r,actionId:a},[s,r,a]);if(!m?.length)return null;let f=eR({sessionModeType:s,scene:"questionImage"});return(0,k.jsx)(eF,{children:m.map((e,t)=>(0,k.jsx)("div",{className:"flex flex-col gap-1",children:(0,k.jsx)(eH,{images:e,readonly:i,itemClassName:f,selectedMap:u,inputSelectedMap:n,onClick:i?null:d,previewClickRef:c,...p})},t))})});function tN(){return(tN=Object.assign.bind()).apply(null,arguments)}let tE=function(e){return M.createElement("svg",tN({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),u||(u=M.createElement("g",{clipPath:"url(#selected_svg__a)"},M.createElement("path",{fill:"#000",fillOpacity:.9,d:"M11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0"}))),c||(c=M.createElement("rect",{width:15,height:15,x:.5,y:.5,stroke:"#000",strokeOpacity:.9,rx:7.5})),d||(d=M.createElement("defs",null,M.createElement("clipPath",{id:"selected_svg__a"},M.createElement("rect",{width:16,height:16,fill:"#fff",rx:8})))))};function tT(){return(tT=Object.assign.bind()).apply(null,arguments)}let tC=function(e){return M.createElement("svg",tT({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),h||(h=M.createElement("rect",{width:15,height:15,x:.5,y:.5,stroke:"#000",strokeOpacity:.5,rx:7.5})))};function tA(e){let{readonly:t,selected:i}=e;return t?i?(0,k.jsx)(tE,{className:"size-4"}):(0,k.jsx)(tC,{className:"size-4 opacity-40"}):i?(0,k.jsx)(tE,{className:"size-4"}):(0,k.jsx)(tC,{className:"size-4"})}let tk=(0,M.memo)(function(e){let{options:t,selectedMap:i,inputSelectedMap:n={},readonly:r=!0,onClick:a,optionClassName:s}=e;if(!t?.length)return null;let l=!r&&Object.keys(n)?.length>0;return(0,k.jsx)("div",{className:"flex w-full flex-col flex-wrap gap-2",children:t.map((e,t)=>{if(!e?.value)return null;let o=e.value,u=!!i?.[o],c=n?.[o],d=r||!r&&l&&!c;return(0,k.jsx)("div",{"data-index":t,"data-value":o,"data-testid":`text-option-${t}`,onClick:d?void 0:a,className:(0,ek.twClsx)("relative w-full overflow-hidden",!d&&"cursor-pointer"),children:(0,k.jsxs)("div",{className:(0,ek.twClsx)("flex h-full w-full flex-shrink-0 gap-2","rounded-lo-radius-8 py-1 pl-1 pr-3",!d&&"text-lo-text-default hover:bg-lo-bg-overlay",d&&"cursor-text select-text",u&&"bg-lo-bg-overlay-hover",d&&!u&&"text-lo-text-disabled",s&&s),children:[(0,k.jsx)("div",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center",children:(0,k.jsx)(tA,{readonly:d,selected:u})}),(0,k.jsxs)("div",{className:"flex-1 select-text text-wrap break-words",children:[" ",o]})]})},t)})})});e.s(["SelectableTextList",0,tk],247962);let tM=(0,M.memo)(function(e){let{options:t,readonly:i=!0,inputSelectedMap:n,threadId:r,actionId:a}=e,{selectedMap:s,handleSelect:l}=(0,eq.useAgentUIInputParamSelectHandler)({groupKey:"question_text",dataKey:"text"}),o=eW({selectedMap:s,inputSelectedMap:n,readonly:i}),u=(0,M.useCallback)(e=>{let t=e?.currentTarget?.dataset?.value;if(!t)return;l({key:t,type:"text",data:{type:"text",text:t,textSource:"reference"}});let i=e?.currentTarget?.dataset?.index??-1;(0,eG.mc)("agent.ask.widget.option.click",{widget_type:"text",thread_id:r,action_id:a,option:t,option_index:Number(i)},eG.DUAL_WRITE_OPTIONS)},[l,r,a]),c=(0,M.useMemo)(()=>t?.length?t.filter(O.checkIsQuestionTextOption).map(e=>({value:e.content})):[],[t]);return t?.length?(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(tk,{options:c,selectedMap:o,inputSelectedMap:n,readonly:i,onClick:u,optionClassName:"text-sm font-medium leading-[1.6]"})}):null}),tI=(0,M.memo)(function(e){let{threadId:t,actionId:i,options:n}=e;return(0,M.useEffect)(()=>{(0,eG.mc)("agent.ask.widget.show",{widget_type:n?.[0]?.type,thread_id:t,action_id:i,options:n},eG.DUAL_WRITE_OPTIONS)},[]),!0}),tS=(0,M.memo)(function(e){let{question:t,disabled:i=!0,threadId:n,actionId:r,inputSelectedMap:a,sessionModeType:s}=e,{question:l,options:o}=t||{},{isImageOption:u,isTextOption:c}=(0,M.useMemo)(()=>(0,O.checkTerminateQuestionOptionsStatus)(o),[o]);if(!o?.length)return null;let d=eO({sessionModeType:s,scene:"optionCard",disabled:i});return(0,k.jsxs)("div",{className:"terminate-question-options flex w-full flex-col gap-2 rounded-xl","data-testid":"question-options",style:d,children:[(0,k.jsx)("div",{className:(0,eo.default)("cursor-text select-text empty:hidden","text-[15px] font-semibold leading-[1.6] text-[#2F3640]"),children:l}),u&&(0,k.jsx)(tj,{options:o,readonly:i,inputSelectedMap:a,sessionModeType:s,threadId:n,actionId:r}),c&&(0,k.jsx)(tM,{options:o,readonly:i,inputSelectedMap:a,threadId:n,actionId:r}),!i&&o?.length>0&&(0,k.jsx)(tI,{threadId:n,actionId:r,options:o})]})}),tO=(0,M.memo)(function(e){let{event_data:t,isLastSession:i,sessionModeType:n,isOnProgressSession:r,threadId:a,actionId:s,inputSelectedMap:l}=e,{questions:o,questionOptions:u}=(0,M.useMemo)(()=>(0,O.parseTerminateWithQuestionOptions)(t),[t]);if(!o?.length)return null;
20let c=(u?.options?.length||0)>0,d=!i||"replay"===n||!!r;return(0,k.jsxs)("div",{className:"flex flex-col empty:hidden",children:[c&&(0,k.jsx)(tS,{question:u,disabled:d,threadId:a||"",actionId:s||"",inputSelectedMap:l,sessionModeType:n}),!c&&(0,k.jsx)(tw,{questions:o,sessionModeType:n})]})}),tR=(0,M.memo)(function(e){let{event_data:t}=e,i=(0,M.useMemo)(()=>{if(!t?.artifact?.length)return null;let e="";for(let i of t.artifact)e+=i?.thought||"";return e},[t]);return i?(0,k.jsx)("div",{className:"markdown-content mx-2",children:(0,k.jsx)(ea.default,{children:i})}):null});function tP(){return(tP=Object.assign.bind()).apply(null,arguments)}let tD=function(e){return M.createElement("svg",tP({xmlns:"http://www.w3.org/2000/svg",width:44,height:44,fill:"none",viewBox:"0 0 44 44"},e),m||(m=M.createElement("path",{fill:"#0C0C0D",fillOpacity:.15,d:"M0 12C0 5.373 5.373 0 12 0h20c6.627 0 12 5.373 12 12v20c0 6.627-5.373 12-12 12H12C5.373 44 0 38.627 0 32z"})),p||(p=M.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M24.561 11.594c-.758-.415-1.687-.595-2.56-.594s-1.802.184-2.557.608l-5.338 2.959c-.798.442-1.466 1.177-1.93 1.965-.466.789-.785 1.728-.785 2.64v5.65c0 .91.32 1.85.784 2.638.465.789 1.134 1.524 1.931 1.966l5.339 2.97h.002c.755.418 1.686.598 2.559.598s1.803-.18 2.558-.597l.003-.002 5.34-2.97c.797-.442 1.464-1.176 1.929-1.965.465-.788.785-1.727.785-2.639v-5.65c0-.911-.32-1.85-.785-2.639s-1.133-1.524-1.931-1.966l-5.338-2.969zm-4.14 1.76c.383-.216.954-.353 1.582-.354s1.203.133 1.595.347l.002.001 5.336 2.968c.25.139.508.356.747.63l-7.681 4.45-7.678-4.443c.24-.279.5-.498.751-.637l5.34-2.96zm-6.989 5.394a2.3 2.3 0 0 0-.041.423v5.65c0 .469.175 1.06.507 1.624.333.563.765 1.003 1.177 1.231l5.34 2.97c.163.09.362.167.585.225v-7.744zM23 30.874c.227-.058.43-.136.596-.227l5.339-2.97c.411-.228.846-.669 1.178-1.232.332-.564.508-1.155.508-1.624v-5.65q0-.204-.043-.431L23 23.13z",clipRule:"evenodd"})))},tL=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),{event_data:i,emptyPlaceholder:n,threadId:r,actionId:a,parentThreadId:s,parentActionId:l,agentName:o}=e,u=(0,M.useMemo)(()=>{if(!i?.artifact?.length)return{};let e={};for(let t of i.artifact)(t?.pbr_model_url||t?.model_url)&&(t.model_url||(t.model_url=t.pbr_model_url),e=t);return e},[i]),c=(0,M.useCallback)(()=>{(0,eu.getAgentUIContext)()?.handlePreviewFile?.({type:"3d",item:{...u,threadId:r,actionId:a,parentThreadId:s,parentActionId:l,agentName:o}})},[u,r,a,s,l,o]);return u?.model_url?(0,k.jsx)(Z.default,{"data-testid":"three-d-model-card",rootClassName:"flex w-full flex-col gap-2",title:u?.title||t("agent_tool_tripo_title"),children:(0,k.jsxs)("div",{className:"group relative aspect-[400/276] w-full cursor-pointer overflow-hidden rounded",children:[(0,k.jsx)("div",{className:"absolute inset-0 z-[0] bg-[#F7F8FA] opacity-80 transition-opacity duration-200 group-hover:opacity-100",style:{background:"linear-gradient(180.73deg,rgb(133, 133, 133) 0.58%, #DCDCDC 76.07%, #DCDCDC 99.33%)"}}),(0,k.jsx)("div",{className:"absolute bottom-3 right-3 z-[1] cursor-pointer",onClick:c,children:(0,k.jsx)(tD,{})}),(0,k.jsx)("img",{onClick:c,src:u.preview_image_url,className:"absolute inset-0 h-full w-full object-contain transition-transform duration-200 group-hover:scale-110"})]})}):n});var tF=e.i(727989);let tU=(0,M.memo)(function(e){let{event_data:t}=e,i=(0,M.useMemo)(()=>{if(!t?.artifact?.length)return null;let e="";for(let i of t.artifact)e+=i?.video_analysis_result||"";return e},[t]);return i?(0,k.jsx)("div",{className:"markdown-content mx-2",children:(0,k.jsx)(ea.default,{children:i})}):null});var tV=e.i(222789),tz=e.i(903945),tB=e.i(478989);let t$=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),{videoInfo:i,eventType:n,threadId:r,actionId:a}=e,[s,l]=(0,M.useState)(!1),{shouldShowArtifactBadge:o}=(0,eu.useAgentUIContext)(),u=s&&o?.({artifactType:"video",surface:"chat-card",item:i,agentGenerated:!0,threadId:r,actionId:a}),c=(0,M.useMemo)(()=>{if(s)if("video_clipping"===n)return t("agent_tool_video_clipper_title");else return t("agent_tool_video_generation_title");return t("video_generation_waiting")},[n,s,t]);return(0,k.jsx)(Z.default,{title:i?.video_name||c,rootClassName:"flex w-full w-fit flex-col gap-2",children:(0,k.jsxs)("div",{className:(0,eo.default)("relative w-full overflow-hidden rounded-lg",!s&&"min-h-[160px]"),children:[i.video_url&&(0,k.jsx)(tB.default,{src:i?.video_url,poster:i?.cover_url,aspectRatio:"432/244",overlay:u?(0,k.jsx)(tV.default,{}):void 0,onLoad:()=>l(!0),threadId:r,actionId:a,artifactItem:i,agentGenerated:!0}),!s&&(0,k.jsx)(tz.default,{className:"absolute left-0 top-0"})]})})}),tH=(0,M.memo)(function(e){let{event_data:t,event_type:i,threadId:n,actionId:r}=e,a=(0,M.useMemo)(()=>t?.artifact?.length?t.artifact:[],[t]);return a?.length?(0,k.jsx)("div",{"data-testid":"video-generation-card",className:"flex max-w-full flex-col gap-6 empty:hidden",children:a.map(e=>(0,k.jsx)(t$,{eventType:i,videoInfo:e,threadId:n,actionId:r},e?.video_url))}):null}),tq=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),{event_data:i}=e,[n,r]=(0,M.useMemo)(()=>
20{if(!i?.artifact?.length)return[];let e="",t=[];for(let n of i.artifact)if(e=n.summary,n?.references?.length)for(let e of n.references){if(!e)continue;let{title:i,link:n}=e;t.push({title:i,link:n})}return[e,t]},[i]);return r?.length||n?(0,k.jsx)(Z.default,{title:t("agent_tool_web_search_title"),children:(0,k.jsxs)("div",{className:"markdown-content mx-2",children:[(0,k.jsx)(ea.default,{children:n}),(0,k.jsx)("div",{className:"flex w-full flex-wrap gap-1",children:r?.map(({title:e,link:t},i)=>(0,k.jsx)("div",{className:"rounded-xl bg-[#EBF8FF] px-2 py-[2px] text-xs",children:(0,k.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[#0E80F5]",children:e})},i))})]})}):(0,k.jsx)(tF.default,{title:t("agent_tool_use_web_search_error"),threadId:e.threadId||"",actionId:e.actionId||""})});var tW=e.i(884619);function tG({artifacts:e}){let{t}=(0,K.useI18n)(),i=e.filter(e=>"search_info"===e.artifact_type);return(0,k.jsx)("div",{className:"flex flex-col gap-3",children:i.map((e,n)=>{let r=e.query||"",a=e.key_findings||"",s=e.references||[];return(0,k.jsxs)("div",{className:"flex flex-col gap-3",children:[r&&(0,k.jsxs)("div",{className:"inline-flex items-center gap-1 self-start rounded-lg border border-solid border-[#c4c4c4] bg-[#f7f7f7] px-4 py-2",children:[(0,k.jsx)(tW.default,{className:"h-4 w-4 flex-shrink-0 text-[#919191]"}),(0,k.jsx)("p",{className:"text-[14px] font-normal leading-[17px] text-[#141414]",children:r})]}),a&&(0,k.jsx)("div",{className:"flex flex-col gap-0",children:(0,k.jsx)("div",{className:"markdown-content prose prose-sm max-w-none text-sm leading-[1.6] text-black",children:(0,k.jsx)(ea.default,{children:a})})}),s.length>0&&(0,k.jsx)("div",{className:"h-[0.5px] w-full bg-[#E3E3E3]"}),s.length>0&&(0,k.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,k.jsxs)("h3",{className:"font-['Poppins'] text-sm font-semibold leading-normal text-[#363636]",children:[t("agent_deep_research_sources")," ",(0,k.jsxs)("span",{className:"text-[#919191]",children:["· ",s.length]})]}),(0,k.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,t)=>(0,k.jsxs)("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:"box-border flex max-w-[240px] items-center gap-1 rounded-full bg-[rgba(12,12,13,0.04)] px-2 py-1 transition-colors hover:bg-[rgba(12,12,13,0.08)]",children:[(0,k.jsx)(tW.default,{className:"h-3 w-3 flex-shrink-0 text-[#525252]"}),(0,k.jsx)("p",{className:"truncate text-xs font-normal leading-normal text-[#525252]",children:e.title||e.link||"Reference"})]},t))})]}),n<i.length-1&&(0,k.jsx)("div",{className:"h-px w-full bg-slate-200"})]},n)})})}let tY=(0,M.memo)(function({visible:e,onClose:t,artifacts:i,title:n}){let{t:r}=(0,K.useI18n)(),a=n||r("agent_deep_research_modal_search_sources");return(0,k.jsx)(ta,{visible:e,onClose:t,title:a,closeOnEscape:!0,children:(0,k.jsx)(tG,{artifacts:i})})}),tQ=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),i=(Array.isArray(e?.event_data?.artifact)?e.event_data.artifact:[]).filter(e=>e?.artifact_type==="search_info"),[n,r]=(0,M.useState)(!1),a=0===i.length,s=e.toolInput,l=s?.queries||s?.search_queries,o=s?.query||s?.search_query,u=Array.isArray(l)?l:o?[o]:[],c=s?.current_step||t("chat_web_search"),d=(0,M.useMemo)(()=>{let e=i.map(e=>e.key_findings).filter(Boolean).join("\n\n");if(e)return e;let t=i[0]?.references?.[0];if(t)return`${t.title||"Reference"}: ${t.link}`},[i]);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{"data-testid":"web-search-content-card",className:"mb-[2px] flex w-full flex-col gap-3",children:a?(0,k.jsx)(e6,{title:c,queries:u}):(0,k.jsx)(e5,{title:c,summary:d,references:[],messageProps:e,onViewReport:()=>r(!0),viewReportText:"agent_deep_research_view_full_report"})}),n&&(0,k.jsx)(tY,{visible:n,onClose:()=>r(!1),artifacts:i,title:c})]})});var eJ=eJ,e0=e0;let tK=(0,M.memo)(function({visible:e,onClose:t,artifact:i,sessionModeType:n,threadId:r,actionId:a}){let{t:s}=(0,K.useI18n)(),l=e8(e,"dr-image-preview-open"),o=(0,M.useMemo)(()=>"replay"===n?void 0:{threadId:r,actionId:a},[n,r,a]);if(!i)return null;let u=[],c=[],d="";Array.isArray(i.extracted_images)&&u.push(...i.extracted_images),Array.isArray(i.screenshots)&&c.push(...i.screenshots),"string"==typeof i.extracted_content&&(d=i.extracted_content);let h=c.map((e,t)=>({id:`screenshot-${t}`,image_url:e.image_url,title:e.description,description:e.description,width:e.width,height:e.height})),m=u.map((e,t)=>({id:`extracted-${t}`,image_url:e.image_url,title:e.description,description:e.description,width:e.width,height:e.height})),p=(e,t,i)=>(0,k.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,k.jsxs)("h3",{className:"font-['Poppins'] text-[14px] font-semibold leading-normal text-[#525252]",children:[t," ",(0,k.jsxs)("span",{className:"text-[#919191]",children:["· ",e.length]})]}),(0,k.jsx)(e0.default,{children:(0,k.jsx)("div",{className:"columns-1 gap-2 sm:columns-2",children:e.map((e,t)=>{let n=e.description;return(0,k.jsxs)("div",{className:`mb-2 flex break-inside-avoid flex-col gap-2 rounded-lg ${n?"bg-[rgba(12,12,13,0.04)] p-3":"p-0"}`,children:[(0,k.jsx)("div",{className:"relative overflow-hidden rounded bg-[#f7f7f7]",children:(0,k.jsx)(eJ.default,{src:e.image_url,alt:e.description||"",previewRootClassName:"dr-image-preview-open",...i,enableDownload:!0,enableAddToCanvas:!0,enableSendToChatbox:!0,draggedImage:{image_url:e.image_url,width:e.width,height:e.height,description:e.description},draggingSource:"website_content_modal"})}),e.description&&(0,k.jsx)("div",{className:"prose prose-sm max-w-none text-[14px] font-normal leading-[1.4] text-[#525252]",children:(0,k.jsx)(ea.default,{children:e.description})})]},e.id||t)})})})]}),f=i.title||"Website content";return(0,k.jsx)(ta,{visible:e,onClose:t,title:f,closeOnEscape:!l,children:(0,k.jsxs)("div",{className:"flex flex-col gap-3",children:[m.length>0&&p(m,s("agent_deep_research_images_from_website"),o),h.length>0&&m.length>0&&(0,k.jsx)("div",{className:"h-[0.5px] w-full",style:{backgroundColor:"var(--Stroke-Medium, #C4C4C4)"}}),h.length>0&&p(h,s("agent_deep_research_screenshots"),o),d&&(h.length>0||m.length>0)&&(0,k.jsx)("div",{className:"h-[0.5px] w-full",style:{backgroundColor:"var(--Stroke-Medium, #C4C4C4)"}}),d&&(0,k.jsx)("div",{className:"markdown-content prose prose-sm max-w-none text-sm leading-[1.6] text-black",children:(0,k.jsx)(ea.default,{children:d})})]})})}),tX=(0,M.memo)(function(e){let t=(Array.isArray(e?.event_data?.artifact)?e.event_data.artifact:[]).find(e=>e?.artifact_type==="web_page_content"),[i,n]=(0,M.useState)(!1),r=!t,a=e.toolInput,s=t?.url||a?.url||"Extracting website...",l=t?.query||a?.query||"Full website extraction",o=t?.title||"Website content",u=(0,M.useMemo)(()=>
20{if(!t)return[];let e=[];return(Array.isArray(t?.screenshots)?t.screenshots:[]).forEach((t,i)=>{let n=t?.image_url||t?.url;n&&e.push({id:`screenshot-${t?.artifact_id||i}`,image_url:n,url:n,description:t?.description||t?.title})}),(Array.isArray(t?.extracted_images)?t.extracted_images:[]).forEach((t,i)=>{let n=t?.image_url||t?.url;n&&e.push({id:`extracted-${t?.artifact_id||i}`,image_url:n,url:n,description:t?.description||t?.title})}),e},[t]),c=t?.extracted_content;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{"data-testid":"website-content-card",className:"flex w-full flex-col gap-3",children:r?(0,k.jsx)(e6,{title:s,queries:[l]}):(0,k.jsx)(e5,{title:o,summary:c,references:u,messageProps:e,onViewReport:()=>n(!0),viewReportText:"agent_deep_research_view_full_report"})}),i&&t&&(0,k.jsx)(tK,{visible:i,onClose:()=>n(!1),artifact:t,sessionModeType:e.sessionModeType,threadId:e.threadId,actionId:e.actionId})]})}),tZ=(0,M.memo)(function(e){let{event_type:t,event_data:i,name:n}=e;switch(t){case"plain_text":case"domain_guidance":case"visual_identity_design_guidance":if(n===F.AgentToolName.EXPLORE_KITS)return(0,k.jsx)(Q.default,{...e});return(0,k.jsx)(G.default,{...e});case"think":return(0,k.jsx)(tR,{...e});case"search_info":return(0,k.jsx)(tQ,{...e});case"web_search":case"web_search_result":return(0,k.jsx)(tq,{...e});case"group_image_info":return(0,k.jsx)(eN,{...e});case"image_analyzer":return(0,k.jsx)(es,{...e});case"image_info":if((0,O.checkIsAgentImageAnalyzeMessage)(e))return(0,k.jsx)(es,{...e});if((0,O.checkIsAgentHTMLGenerateMessage)(e))return(0,k.jsx)(er,{...e});if(n===F.AgentToolName.EXPLORE_KITS)return(0,k.jsx)(Q.default,{...e});return(0,k.jsx)(eb,{...e});case"execution_plan":return(0,k.jsx)(Y.default,{...e});case"video_analyzer":return(0,k.jsx)(tU,{...e});case"video_generation":case"video_info":case"video_clipping":case"video_clipping_info":return(0,k.jsx)(tH,{...e});case"audio_analyzer":return(0,k.jsx)(q.default,{...e});case"audio_generation":case"text_to_speech":case"audio_info":return(0,k.jsx)(W.default,{...e});case"make_story":case"story_board":return(0,k.jsx)(eE,{...e});case"questions":return(0,k.jsx)(tO,{...e});case"three_d_model_generated":case"three_d_model_info":return(0,k.jsx)(tL,{...e});case"html_generation":case"html_info":return(0,k.jsx)(er,{...e});case"create_skill":case"skill":return(0,k.jsx)(tb,{...e});case"visual_identity_design_directions":return(0,k.jsx)(eT,{...e});case"visual_identity_image_search":case"group_image_search":if(n===F.AgentToolName.SEARCH_IMAGE||n===F.AgentToolName.SEARCH_IMAGES)return(0,k.jsx)(tl,{...e});return(0,k.jsx)(eK,{...e});case"web_page_content":return(0,k.jsx)(tX,{...e});case"error":return(0,k.jsx)(tF.default,{...e,threadId:e.threadId||"",actionId:e.actionId||""});default:return(0,H.logger)("ToolEventMessage: event_data?.artifact_type",i?.artifact_type,e),null}}),tJ=(0,M.memo)(function(e){let{name:t,loading:i,content:n}=e,r=(0,M.useMemo)(()=>{if(!n?.length)return(t?(0,F.getAgentToolUseConfig)(t)?.loading:void 0)===F.ToolLoadingType.IMAGE&&i?[{event_type:"image_info",event_data:null}]:null;if(1===n.length)return n;if(2===n.length){let e=(0,O.matchAgentLegacyHTMLGenerateContent)({name:t,content:n});if(e&&e?.length>0)return e}let e={};for(let t of n){let{event_type:i,event_data:n}=t||{};if(!i||!n?.artifact?.length)continue;if(!e[i]){e[i]={event_type:i,event_data:{...n,artifact:[...n.artifact]}};continue}let r=e[i];r?.event_data?.artifact?.push(...n.artifact)}return Object.values(e)},[n,i,t]);return r?.length?r?.map((t,i)=>{let n=(0,$.parseToolUseArtifactType)(t);return(0,k.jsx)(tZ,{...e,...t,event_type:n,emptyPlaceholder:(0,k.jsx)(tF.default,{...e})},`${n}-${i+1}`)}):(0,k.jsx)(tF.default,{...e})}),t0=(0,M.memo)(function(e){let{toolName:t,toolIcon:i,processing:n}=(0,z.useToolUseRenderState)(e),r=(0,U.getAgentToolUseCollapsableProps)(e);return(0,k.jsx)("div",{"data-testid":"agent-tool-use-analysis",children:(0,k.jsx)(B.CollapsableToolUseCard,{maxHeight:40,noCollapsedEffect:!0,rootClassName:"rounded-xl bg-gradient-to-br from-[rgba(82,109,135,0.07)] via-[7.08%] to-[rgba(255,255,255,0.1)] via-[57.34%]",className:"flex flex-col p-3",collapsedRootStyle:{background:"#526D871A"},collapsedHeaderStyle:{color:"#2F3640"},title:n?(0,k.jsx)(V.default,{...e,toolName:t}):t,icon:i,...r,children:(0,k.jsx)("div",{className:"mt-3 flex max-w-full flex-col gap-2 overflow-hidden empty:hidden",children:(0,k.jsx)(tJ,{...e})})})})});var t1=e.i(853410);let t2=(0,M.memo)(function(e){let{loading:t,content:i,onUpdateToolStatusLabel:n,name:r}=e;if(!i?.length&&!t)return(0,k.jsx)(tF.default,{...e});let a=i?.find(e=>e?.event_data?.artifact_type!=="arguments");if(!a)if(!t)return(0,k.jsx)(tF.default,{...e});else{let e=function(e){switch(e){case F.AgentToolName.SEARCH_WEB_INFO:case F.AgentToolName.SEARCH_WEB:return"search_info";case F.AgentToolName.SEARCH_IMAGE:case F.AgentToolName.SEARCH_IMAGES:return"group_image_search";case F.AgentToolName.SEARCH_WEBSITE_CONTENT:return"web_page_content";default:return null}}(r);if(!e)return null;a={event_type:e,event_data:{artifact:[]}}}if(i&&i.length>1){let e=a?.event_type,t=[];for(let n of i)if(n?.event_type===e&&n?.event_data?.artifact){let e=n.event_data.artifact.filter(e=>e?.artifact_type!=="arguments");t.push(...e)}t.length>0&&(a={...a,event_data:{...a?.event_data,artifact:t}})}else if(a?.event_data?.artifact){let e=a.event_data.artifact.filter(e=>e?.artifact_type!=="arguments");e.length>0&&(a={...a,event_data:{...a.event_data,artifact:e}})}let s=(0,$.parseToolUseArtifactType)(a);return(0,k.jsx)(tZ,{...e,...a,event_type:s,emptyPlaceholder:(0,k.jsx)(tF.default,{...e}),onUpdateToolStatusLabel:n},s)});var t5=e.i(73326);let t3=(0,M.memo)(function(e){let{loadingType:t}=e;return(0,M.useMemo)(()=>{switch(t){case F.ToolLoadingType.COMMON:return(0,k.jsx)("div",{"data-testid":"agent-skeleton-loading-common",className:"flex max-w-[350px] empty:hidden",style:{padding:16,borderRadius:12,backdropFilter:"blur(16px)",boxShadow:"0px 0px 0px 2px #ffffff inset, 0px 4px 20px 0px #0000001A"},children:(0,k.jsxs)("div",{className:"flex h-16 w-full flex-col justify-between",children:[(0,k.jsx)(t5.Skeleton.Node,{active:!0,className:"flex-shrink-1 w-full",style:{width:"95%",height:"26px",borderRadius:"8px"}}),(0,k.jsx)(t5.Skeleton.Node,{active:!0,className:"flex-shrink-1 w-full",style:{width:"80%",height:"26px",borderRadius:"8px"}})]})});case F.ToolLoadingType.VIDEO:return(0,k.jsx)("div",{"data-testid":"agent-skeleton-loading-video",children:(0,k.jsx)(t5.Skeleton.Node,{active:!0,style:{width:300,height:160,borderRadius:12}})});case F.ToolLoadingType.AUDIO:return(0,k.jsx)("div",{"data-testid":"agent-skeleton-loading-audio",children:(0,k.jsx)(t5.Skeleton.Node,{active:!0,style:{width:260,height:90,borderRadius:20}})});default:return null}},[t])}),t4=(0,M.memo)(function(e){let{name:t,loading:i,content:n}=e;if(!F.getAgentToolUseConfig?.(t)?.loading||!i||n?.length>0)return null;let r=(0,F.getAgentToolUseConfig)(t)?.loading;return r?(0,k.jsx)(t3,{loadingType:r}):null}),t7=(0,M.memo)(function(e){let{toolName:t,toolIcon:i,processing:n}
20=(0,z.useToolUseRenderState)(e),[r,a]=(0,M.useState)(void 0);return(0,k.jsx)("div",{"data-testid":"agent-tool-use-collapsable",children:(0,k.jsx)(B.CollapsableToolUseCard,{noCollapsedEffect:!0,title:e=>(0,k.jsxs)("span",{className:"inline-flex items-center text-[#525252]",children:[(0,k.jsx)("span",{className:"mr-1",children:t}),(0,k.jsx)("span",{className:"mr-2 inline-flex h-4 w-4 items-center justify-center",children:(0,k.jsx)(t1.default,{className:(0,eo.default)("h-[14px] w-[14px] text-[#A4A9B2] transition-transform",e?"rotate-180":"")})}),r&&(0,k.jsx)("span",{className:"font-normal text-[#8a8a8a]",children:r})]}),icon:i,className:"flex flex-col gap-3",...{buttonClassName:"hidden w-0 p-0 m-0",initialCollapsed:!1,maxHeight:16},children:(0,k.jsxs)("div",{className:"flex max-w-full flex-col gap-2 empty:hidden",children:[n&&(0,k.jsx)(t4,{...e}),(0,k.jsx)(t2,{...e,onUpdateToolStatusLabel:a})]})})})}),t6=(0,M.memo)(function(e){let{toolName:t,toolIcon:i,processing:n}=(0,z.useToolUseRenderState)(e);return(0,k.jsx)("div",{"data-testid":"agent-tool-use-no-content",children:(0,k.jsx)(B.CollapsableToolUseCard,{collapsable:!1,noCollapsedEffect:!0,loading:n,title:t,icon:i})})});var t8=e.i(326496),t9=e.i(975252);let ie=(0,M.memo)(function(e){let t=(0,t9.useToolUseProcessingStep)(e);return(0,k.jsx)(t8.EllipsisTitle,{title:t,className:"flex items-center empty:hidden",titleClassName:"skeleton-text line-clamp-1","data-testid":"agent-tool-processing"})}),it=(0,M.memo)(function(e){let{toolKey:t,toolName:i,toolIcon:n,processing:r}=(0,z.useToolUseRenderState)(e),a=(0,F.getAgentToolUseConfig)(t),s=a?.loading;return(0,k.jsx)("div",{"data-testid":"agent-tool-use-primary",children:(0,k.jsx)(B.CollapsableToolUseCard,{collapsable:!1,noCollapsedEffect:!0,title:i,icon:n,children:(0,k.jsxs)("div",{className:"flex max-w-full flex-col gap-2 empty:hidden",children:[r&&s!==F.ToolLoadingType.COMMON&&(0,k.jsx)(ie,{...e}),r&&(0,k.jsx)(t4,{...e}),(0,k.jsx)(tJ,{...e})]})})})}),ii=(0,M.memo)(function(){return(0,k.jsxs)("div",{className:"flex w-full justify-between gap-2",children:[(0,k.jsxs)("div",{className:"flex w-full flex-col justify-between",children:[(0,k.jsx)(t5.Skeleton.Node,{active:!0,className:"flex-shrink-1 w-full",style:{width:"95%",height:"26px",borderRadius:"8px"}}),(0,k.jsx)(t5.Skeleton.Node,{active:!0,className:"flex-shrink-1 w-full",style:{width:"80%",height:"26px",borderRadius:"8px"}})]}),(0,k.jsx)(t5.Skeleton.Node,{active:!0,className:"flex-shrink-0",style:{width:64,height:64,borderRadius:"8px"}})]})});function ir(){return(ir=Object.assign.bind()).apply(null,arguments)}let ia=function(e){return M.createElement("svg",ir({xmlns:"http://www.w3.org/2000/svg",width:14,height:15,fill:"none",viewBox:"0 0 14 15"},e),f||(f=M.createElement("path",{fill:"currentColor",d:"M8.68 3.486a.234.234 0 0 1 .33 0l.33.331c.091.091.091.238 0 .33L5.794 7.693l3.546 3.547a.234.234 0 0 1 0 .33l-.33.33a.234.234 0 0 1-.33 0L4.803 8.023a.467.467 0 0 1 0-.659z"})))},is=null,il=new Set,io=e=>{is=e,il.forEach(t=>t(e))};var iu=e.i(282985);function ic(){return(ic=Object.assign.bind()).apply(null,arguments)}let id=function(e){return M.createElement("svg",ic({xmlns:"http://www.w3.org/2000/svg",width:64,height:64,fill:"none",viewBox:"0 0 64 64"},e),M.createElement("foreignObject",{width:63.343,height:43.986,x:-.293,y:12.756},M.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{backdropFilter:"blur(3.5px)",clipPath:"url(#thumbnail-failed_svg__a)",height:"100%",width:"100%"}})),g||(g=M.createElement("path",{fill:"#E5E6EC",d:"M25.07 20.379a1.4 1.4 0 0 1 2.328 0L40.3 39.73l3.935-5.786a1.4 1.4 0 0 1 2.316 0l9.255 13.61c.631.929-.034 2.187-1.158 2.187H44.372l-.014.001H8.11a1.4 1.4 0 0 1-1.165-2.177z","data-figma-bg-blur-radius":7})),x||(x=M.createElement("circle",{cx:41.3,cy:21.7,r:4.2,fill:"#E5E6EC"})),v||(v=M.createElement("defs",null,M.createElement("clipPath",{id:"thumbnail-failed_svg__a",transform:"translate(.293 -12.756)"},M.createElement("path",{d:"M25.07 20.379a1.4 1.4 0 0 1 2.328 0L40.3 39.73l3.935-5.786a1.4 1.4 0 0 1 2.316 0l9.255 13.61c.631.929-.034 2.187-1.158 2.187H44.372l-.014.001H8.11a1.4 1.4 0 0 1-1.165-2.177z"})))))};function ih(){return(ih=Object.assign.bind()).apply(null,arguments)}let im=function(e){return M.createElement("svg",ih({xmlns:"http://www.w3.org/2000/svg",width:64,height:64,fill:"none",viewBox:"0 0 64 64"},e),y||(y=M.createElement("circle",{cx:39.221,cy:31.836,r:14.278,fill:"#9CA8B8"}
20)),M.createElement("foreignObject",{width:65.219,height:45.928,x:-1.595,y:11.703},M.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{backdropFilter:"blur(4.28px)",clipPath:"url(#thumbnail-image_svg__a)",height:"100%",width:"100%"}})),_||(_=M.createElement("g",{"data-figma-bg-blur-radius":8.553},M.createElement("mask",{id:"thumbnail-image_svg__b",fill:"#fff"},M.createElement("path",{d:"M25.479 20.52a.595.595 0 0 1 .99 0l12.939 19.408 4.493-6.606a.595.595 0 0 1 .984 0l10.082 14.827a.595.595 0 0 1-.492.928H7.553a.595.595 0 0 1-.494-.926z"})),M.createElement("path",{fill:"#fff",fillOpacity:.8,d:"M25.479 20.52a.595.595 0 0 1 .99 0l12.939 19.408 4.493-6.606a.595.595 0 0 1 .984 0l10.082 14.827a.595.595 0 0 1-.492.928H7.553a.595.595 0 0 1-.494-.926z"}),M.createElement("path",{fill:"#C1C5CC",d:"m25.479 20.52-.142-.094zm.99 0-.142.096zm12.939 19.408-.143.095.141.211.143-.21zm4.493-6.606.141.096zm.984 0 .142-.097zm10.082 14.827.142-.096zm-20.67.927.003-.17h-.004zm-26.744 0v.171zm-.494-.925.142.094zm18.42-27.63.142.095a.424.424 0 0 1 .706 0l.142-.095.142-.095a.766.766 0 0 0-1.274 0zm.99 0-.142.095 12.938 19.407.143-.095.142-.095-12.938-19.407zm12.939 19.407.141.096 4.493-6.606-.141-.096-.142-.097-4.493 6.607zm4.493-6.606.141.096a.424.424 0 0 1 .702 0l.141-.096.142-.097a.766.766 0 0 0-1.268 0zm.984 0-.141.096 10.082 14.827.141-.096.142-.097-10.082-14.827zm10.082 14.827-.141.096a.423.423 0 0 1-.351.661v.342c.615 0 .98-.687.634-1.195zm-.492.928v-.17H34.311v.341h20.164zm-20.164 0v-.17l.002-.001H34.3l-.004.17-.004.171h-.006.01l.015.001zm-.015 0v-.172H7.553v.342h26.743zm-26.743 0v-.172a.424.424 0 0 1-.352-.66l-.142-.094-.142-.095a.766.766 0 0 0 .636 1.191zm-.494-.926.142.094 18.42-27.63-.142-.094-.142-.095-18.42 27.63z",mask:"url(#thumbnail-image_svg__b)"}))),b||(b=M.createElement("defs",null,M.createElement("clipPath",{id:"thumbnail-image_svg__a",transform:"translate(1.595 -11.703)"},M.createElement("path",{d:"M25.479 20.52a.595.595 0 0 1 .99 0l12.939 19.408 4.493-6.606a.595.595 0 0 1 .984 0l10.082 14.827a.595.595 0 0 1-.492.928H7.553a.595.595 0 0 1-.494-.926z"})))))};var ip=e.i(829881);function ig(){return(ig=Object.assign.bind()).apply(null,arguments)}let ix=function(e){return M.createElement("svg",ig({xmlns:"http://www.w3.org/2000/svg",width:64,height:64,fill:"none",viewBox:"0 0 64 64"},e),w||(w=M.createElement("path",{fill:"#9CA8B8",d:"M18.497 17.518a1.95 1.95 0 0 1 1.948-1.924H38.9c.517 0 1.012.205 1.377.57l2.595 2.595 3.347 3.451c.352.364.5
205.85.55 1.357v6.393l-.362 16.603a1.95 1.95 0 0 1-1.948 1.905H20.09a1.95 1.95 0 0 1-1.948-1.971z"})),M.createElement("mask",{id:"thumbnail-file-only_svg__a",width:29,height:34,x:18,y:15,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},j||(j=M.createElement("path",{fill:"#68809B",d:"M18.497 17.52a1.95 1.95 0 0 1 1.948-1.924H38.9c.517 0 1.012.205 1.377.57l2.595 2.595 3.347 3.451c.352.364.55.85.55 1.356v6.394l-.362 16.603a1.95 1.95 0 0 1-1.948 1.906H20.09a1.95 1.95 0 0 1-1.948-1.972z"}))),N||(N=M.createElement("g",{mask:"url(#thumbnail-file-only_svg__a)"},M.createElement("path",{fill:"#CED9E8",d:"M39.363 21.44v-7.305l9.01 9.253H41.31a1.95 1.95 0 0 1-1.948-1.948"}))))};function iv(){return(iv=Object.assign.bind()).apply(null,arguments)}let iy=function(e){return M.createElement("svg",iv({xmlns:"http://www.w3.org/2000/svg",width:64,height:64,fill:"none",viewBox:"0 0 64 64"},e),E||(E=M.createElement("g",{filter:"url(#thumbnail-folder-only_svg__a)",shapeRendering:"crispEdges"},M.createElement("path",{fill:"#fff",fillOpacity:.98,d:"M12.59 27.67a1.95 1.95 0 0 1 1.945-2.057H26.53c.665 0 1.302.273 1.761.754l3.243 3.397a3.9 3.9 0 0 0 2.818 1.206h15.968c1.13 0 2.022.957 1.944 2.084l-1.19 17.045a1.95 1.95 0 0 1-1.943 1.813H15.78a1.95 1.95 0 0 1-1.945-1.84z"}),M.createElement("path",{stroke:"#C1C5CC",strokeWidth:.195,d:"M14.535 25.71h11.996c.639.001 1.25.263 1.69.725l3.244 3.397a4 4 0 0 0 2.888 1.235h15.968c1.073 0 1.921.91 1.847 1.98l-1.19 17.046a1.85 1.85 0 0 1-1.846 1.721H15.779a1.85 1.85 0 0 1-1.847-1.748l-1.245-22.402a1.85 1.85 0 0 1 1.848-1.953Z"}))),T||(T=M.createElement("rect",{width:5.3,height:2.356,x:42.455,y:34.447,fill:"#fff",rx:.487})),C||(C=M.createElement("defs",null,M.createElement("filter",{id:"thumbnail-folder-only_svg__a",width:48.635,height:35.251,x:8.111,y:23.493,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},M.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),M.createElement("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),M.createElement("feOffset",{dy:2.356}),M.createElement("feGaussianBlur",{stdDeviation:2.238}),M.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),M.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07 0"}),M.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4067_61685"}),M.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4067_61685",result:"shape"})))))},i_=e=>{let{open:t,hover:i}=e;return(0,k.jsxs)("div",{className:"h-16 w-16 relative flex items-center justify-center",children:[(0,k.jsx)(ip.motion.div,{className:"absolute inset-0",animate:{x:2*!!t,y:t?-3:i&&!t?-6:0,rotate:15*!!t},transition:{type:"spring",stiffness:300,damping:25},children:(0,k.jsx)(ix,{})}),(0,k.jsx)(ip.motion.div,{className:"absolute inset-0 ",children:(0,k.jsx)(iy,{})})]})};function ib(e,t){let{name:i,content:n}=e,r=n?.[0]?.event_data?.artifact?.[0],a=r?.title||(0,F.getAgentToolName)(i,null,t),s=n?.[1];if(s&&"kit_info"===s.event_type){let e=s?.event_data?.kit_name;e&&(a=e)}return a}function iw(){return(iw=Object.assign.bind()).apply(null,arguments)}let ij=function(e){return M.createElement("svg",iw({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),A||(A=M.createElement("path",{fill:"#000",d:"m18.637 6.637-5.01 5.009 5.031 5.03-1.273 1.274-5.032-5.031-5.03 5.031-1.273-1.273 5.03-5.031-5.01-5.01 1.274-1.273 5.01 5.01 5.01-5.01z"})))},iN=e=>{let t=document.querySelector(`[data-trigger-id="${e}"]`);if(t){let e=t.getBoundingClientRect(),i=e.left-640-36;i<10&&(i=e.right+36);let n=e.top+e.height/2-200;return n<10?n=10:n+400>window.innerHeight-10&&(n=window.innerHeight-400-10),{top:n,left:i}}return null};function iE(e){let{title:t,children:i,onClose:n,triggerId:r}=e,a=(0,M.useRef)(null),s=(0,M.useRef)(null),[l,o]=(0,M.useState)(()=>iN(r));return(0,M.useEffect)(()=>{let e=()=>{o(iN(r))};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[r]),(0,M.useEffect)(()=>{function e(e){if(s.current===e.target)return void n();if(window.innerWidth>=768){if(a.current?.contains(e.target)||e.target?.closest(`[data-trigger-id="${r}"]`)||e.target?.closest(".agent-chat-image-preview"))return;n()}}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[n,r]),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{ref:s,className:"pointer-events-auto fixed inset-0 bg-black/70 md:hidden"}),(0,k.jsxs)("div",{ref:a,className:(0,eo.default)("flex flex-col font-inter","bg-white shadow-lg","pointer-events-auto overflow-hidden","md:max-h-[640px] md:min-
20h-[240px] md:w-[640px] md:gap-4 md:px-3 md:pb-6 md:pt-4","md:fixed md:rounded-2xl","md:top-1/2 md:-translate-y-1/2 md:transform","max-md:fixed max-md:bottom-0 max-md:left-0 max-md:right-0 max-md:z-10","max-md:max-h-[calc(80vh-20px)] max-md:min-h-[40vh]","max-md:rounded-b-none max-md:rounded-t-xl"),style:window.innerWidth>=768&&l?{left:`${l.left}px`}:void 0,children:[(0,k.jsxs)("div",{className:(0,eo.default)("flex items-center justify-between","md:px-0 md:pb-0","max-md:bg-white/95 max-md:px-4 max-md:py-[15px] max-md:backdrop-blur-[20px]"),children:[(0,k.jsx)(t8.EllipsisTitle,{title:t,className:"flex-1 text-[18px] md:text-base"}),(0,k.jsx)("button",{onClick:n,className:"p-1",children:(0,k.jsx)(ij,{})})]}),(0,k.jsx)("div",{className:(0,eo.default)("agent-chat-scrollbar z-0 flex flex-1 flex-col gap-2","overflow-y-auto overflow-x-hidden","max-md:px-4 max-md:py-2.5"),children:i}),(0,k.jsx)("div",{className:"h-5 shrink-0 bg-white md:hidden"})]})]})}let iT=(0,M.memo)(function(e){let{title:t,children:i,visible:n,onClose:r,triggerId:a}=e,[s,l]=(0,M.useState)(null);return((0,M.useEffect)(()=>{if(n){let e=document.createElement("div");return e.className="pointer-events-none z-[1000] fixed inset-0",document.body.appendChild(e),l(e),()=>{document.body.contains(e)&&document.body.removeChild(e),l(null)}}},[n]),n&&i&&s)?(0,tt.createPortal)((0,k.jsx)(iE,{title:t,onClose:r,triggerId:a,children:i}),s):null}),iC=(0,M.memo)(function(e){let{t}=(0,K.useI18n)(),{title:i,icon:n,motionIcon:r,isError:a}=function(e,t){let{name:i,content:n}=e;return!function(e){let{content:t}=e;return!t?.length||t?.[0]?.event_type==="error"}(e)?i===F.AgentToolName.LORA_RECOMMENDATION?{title:ib(e,t),icon:im,motionIcon:i_}:{title:ib(e,t),motionIcon:i_}:{title:(0,iu.getToolUseErrorRenderTitle)({name:i,event_data:n?.[0]?.event_data},t),icon:id,isError:!0}}(e,t),{isVisible:s,open:l,close:o,portalId:u}=(()=>{let[e,t]=(0,M.useState)(!1),i=(0,M.useId)(),n=(0,M.useCallback)(()=>{t(!0),io(i)},[i]),r=(0,M.useCallback)(()=>{t(!1),is===i&&io(null)},[i]);return(0,M.useEffect)(()=>{let e=e=>{e&&e!==i&&t(!1)};return il.add(e),()=>{il.delete(e),is===i&&io(null)}},[i]),{isVisible:e,open:n,close:r,portalId:i}})(),[c,d]=(0,M.useState)(!1);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("div",{"data-trigger-id":u,className:(0,eo.default)("flex h-16 justify-between gap-4",!a&&"cursor-pointer"),onClick:a?null:()=>{s?o():l()},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[(0,k.jsxs)("div",{className:"flex flex-col justify-between",children:[(0,k.jsx)(t8.EllipsisTitle,{title:i,className:"overflow-hidden"}),!a&&(0,k.jsx)("div",{className:"flex flex-1 cursor-pointer flex-col justify-end",children:(0,k.jsxs)("button",{className:"flex items-center gap-1 text-xs text-[#A4A9B2] hover:text-[#86909C] active:text-[#2F3640]",children:[(0,k.jsx)(ia,{}),(0,k.jsx)("span",{children:t("agent_tool_check_details")})]})})]}),(0,k.jsx)("div",{className:"aspect-square w-16",children:r?(0,k.jsx)(r,{open:s,hover:c}):(0,k.jsx)(n,{})})]}),(0,k.jsx)(iT,{title:i,visible:s,onClose:o,triggerId:u,children:(0,k.jsx)(tJ,{...e})})]})}),iA=(0,M.memo)(function(e){let{toolName:t,toolIcon:i,processing:n}=(0,z.useToolUseRenderState)(e);return(0,k.jsx)("div",{"data-testid":"agent-tool-use-secondary",children:(0,k.jsx)(B.CollapsableToolUseCard,{collapsable:!1,noCollapsedEffect:!0,title:t,icon:i,children:(0,k.jsx)("div",{className:"flex max-w-[350px] flex-col gap-2 empty:hidden",children:(0,k.jsx)("div",{className:"mb-2",style:{padding:16,borderRadius:12,backdropFilter:"blur(16px)",border:"0.5px solid #E5E6EC",boxShadow:"0px 0px 0px 2px #ffffff inset, 0px 4px 20px 0px #0000000A"},children:n?(0,k.jsx)(ii,{}):(0,k.jsx)(iC,{...e})})})})})}),ik=(0,M.memo)(function(e){let{name:t}=e;switch((0,F.getAgentToolConfigCategory)(t)){case F.AGENT_TOOL_USE_CATEGORY.PRIMARY:return(0,k.jsx)(it,{...e});case F.AGENT_TOOL_USE_CATEGORY.SECONDARY:return(0,k.jsx)(iA,{...e});case F.AGENT_TOOL_USE_CATEGORY.ANALYSIS:return(0,k.jsx)(t0,{...e});case F.AGENT_TOOL_USE_CATEGORY.NO_CONTENT:return(0,k.jsx)(t6,{...e});case F.AGENT_TOOL_USE_CATEGORY.COLLAPSABLE:return(0,k.jsx)(t7,{...e});case F.AGENT_TOOL_USE_CATEGORY.HIDDEN:default:return null}}),iM=(0,M.memo)(function(e){let{message:t,...i}=e,n=t?.type,r=(0,M.useMemo)(()=>{switch(n){case"text":return"agent-message-text";case"user":return"agent-message-user";case"tool_use":return"agent-message-tool-use";default:return"agent-message"}},[n]),a=null;return("text"===n?a=(0,k.jsx)(D.default,{text:t?.text,sessionModeType:i.sessionModeType}
20):"user"===n?a=(0,k.jsx)(I.AgentChatUserInput,{input:t?.input}):"tool_use"!==n||(0,O.checkIsAgentHiddenMessage)(t)?"generator_event"===n&&(a=(0,k.jsx)(R.default,{...t,...i})):a=(0,k.jsx)(ik,{...t,...i}),a)?(0,k.jsxs)(S.MessageTrackProvider,{threadId:t?.threadId,actionId:t?.actionId,parentThreadId:t?.parentThreadId,parentActionId:t?.parentActionId,agentName:t?.agentName,children:[(0,k.jsx)("div",{"data-testid":r,children:a}),(0,k.jsx)(P.default,{message:t}),(0,k.jsx)(L.default,{message:t})]}):null});e.s(["AgentChatMessage",0,iM],9801),e.s(["AgentUIConfigProvider",()=>eu.default],683102)},957865,421387,e=>{"use strict";var t=e.i(21590),i=e.i(820967),n=e.i(466471),r=e.i(282985),a=e.i(715074),s=e.i(532675),l=e.i(539423),o=e.i(990718),u=e.i(958032),c=e.i(107783),d=e.i(151908);function h({status:e}){let{t:i}=(0,a.useI18n)();return"NON_COMPLIANT"===e?(0,t.jsx)("div",{className:"bg-lo-status-danger-default rounded-lo-radius-4 absolute right-[4px] top-[4px] flex h-[16px] items-center justify-center px-[4px]",children:(0,t.jsx)("span",{className:"text-[11px] font-medium leading-[16px] text-white",children:i("agent_tool_use_error_seedance_2_moderation_not_passed")})}):"COMPLIANT"===e?(0,t.jsx)(l.default,{className:"text-lo-status-success-default absolute right-[4px] top-[4px] size-[18px]"}):null}function m({url:e}){let i=(0,c.convert2VideoPosterUrl)(e,160);return i?(0,t.jsx)("img",{src:i,alt:"",className:"size-full object-cover"}):(0,t.jsx)(d.VideoThunbnailCover,{videoUrl:e})}function p({result:e}){let i=e.asset_type?.toUpperCase(),n="VIDEO"===i;return(0,t.jsxs)("div",{className:"bg-lo-bg-overlay relative aspect-square select-none overflow-hidden rounded-[2px]",children:["AUDIO"===i?(0,t.jsx)("div",{className:"border-lo-border-neutral-l1 flex size-full items-center justify-center rounded-[8px] border",children:(0,t.jsx)(u.default,{className:"text-lo-icon-secondary size-[28px]"})}):n?(0,t.jsx)(m,{url:e.asset_url}):(0,t.jsx)("img",{src:(0,c.convert2CompressedUrl)(e.asset_url,160)??e.asset_url,alt:"",className:"size-full object-cover"}),(0,t.jsx)(h,{status:e.status}),n&&(0,t.jsx)("div",{className:"rounded-lo-radius-4 absolute bottom-[4px] left-[4px] flex items-center justify-center bg-black/40 p-[2px] backdrop-blur-[10px]",children:(0,t.jsx)(o.default,{className:"size-[14px] text-white"})})]})}let f=(0,i.memo)(function({moderationResults:e,className:i}){return e?.length?(0,t.jsx)("div",{className:(0,s.twClsx)("grid grid-cols-4 gap-[4px]",i),children:e.map((e,i)=>e?.status==="PENDING"?null:(0,t.jsx)(p,{result:e},`${e.asset_url}-${i}`))}):null});function g(e){let{title:i,description:n,className:r,moderationResults:a}=e;return(0,t.jsxs)("div",{className:(0,s.twClsx)("bg-lo-bg-overlay flex flex-col gap-1","text-lo-text-default p-3 text-sm leading-6","border-lo-border-neutral-l1 rounded-2xl border",r&&r),children:[(0,t.jsxs)("div",{className:"ml-1 flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"font-medium",children:i}),n&&(0,t.jsx)("span",{className:"font-normal",children:n})]}),(0,t.jsx)(f,{moderationResults:a})]})}let x=(0,i.memo)(function(e){let{t:r}=(0,a.useI18n)(),{errorDetail:s,errorType:l}=e,{moderation_results:o}=s??{},{title:u,description:c}=(0,i.useMemo)(()=>(0,n.getErrorDetailCustomizedConfigMap)(r)[l],[l,r]);return u&&c?(0,t.jsx)(g,{title:u,description:c,moderationResults:o}):null});e.i(132249);var v=e.i(694528),y=e.i(973930);function _(e){let{className:i,btnText:n,btnAction:a,isLastSession:s,isOnProgressSession:l,sessionModeType:o}=e;return s&&"replay"!==o&&(0,y.getAgentUIContext)()?.agentToolErrorHandler&&(!l||a!==r.ERROR_BTN_ACTION.RETRY)?(0,t.jsx)(v.Button,{size:"md",className:i,onClick:()=>{switch(a){case r.ERROR_BTN_ACTION.RETRY:(0,y.getAgentUIContext)()?.agentToolErrorHandler?.retry?.(e);break;case r.ERROR_BTN_ACTION.START_NEW_CHAT:(0,y.getAgentUIContext)()?.agentToolErrorHandler?.startNewChat?.(e);break;case r.ERROR_BTN_ACTION.EDIT_PROMPT:(0,y.getAgentUIContext)()?.agentToolErrorHandler?.appplyInput?.(e)}},children:n}):null}let b=(0,i.memo)(function(e){let{title:i,description:n,btnText:r,className:a,btnClassName:l,noActionBtn:o,...u}=e;return(0,t.jsxs)("div",{className:(0,s.twClsx)("bg-lo-bg-overlay flex flex-col gap-3","text-lo-text-default p-3 text-sm font-normal leading-normal","border-lo-border-neutral-l1 rounded-2xl border",a&&a),children:[(0,t.jsxs)("div",{className:"ml-1 flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"font-medium",children:i}),n&&(0,t.jsx)("span",{className:"font-normal",children:n})]}),r&&!o&&(0,t.jsx)(_,{className:l,btnText:r,...u})]})}),w=(0,i.memo)(function(e){let{t:i}=(0,a.useI18n)(),{loading:n}=e;if(n)return null;let s=(0,r.getToolUseErrorRenderTitle)(e,i);return s?(0,t.jsx)(b,{...e,title:s}):null});e.s(["default",0,w],421387);let j=(0,i.memo)(function(e){let{t:n}=(0,a.useI18n)(),{errorCategory:s,...l}=e,o=(0,i.useMemo)(()=>(0,r.getErrorCategoryConfigMap)(n)[s],[s,n]);
20return o?(0,t.jsx)(b,{title:o.title,description:o.description,btnText:o.btnText,btnAction:o.action,...l}):null}),N=(0,i.memo)(function(e){let{loading:i,content:a,event_data:s}=e;if(i)return null;let l=s??a?.[0]?.event_data,o=l?.error_detail;if(o&&(0,n.checkIsCustomizedErrorDetail)(o,l?.error_type))return(0,t.jsx)(x,{...e,errorDetail:o,errorType:l?.error_type});let u=(0,r.parseErrorCategoryFromEventData)(l);return u?(0,t.jsx)(j,{...e,errorCategory:u}):(0,t.jsx)(w,{...e})});e.s(["default",0,N],957865)},974869,e=>{"use strict";var t=e.i(732390);e.s(["AgentChatUserInput",()=>t.default])},369133,270168,367236,466471,e=>{"use strict";var t=e.i(21590),i=e.i(820967),n=e.i(715074),r=e.i(770413),a=e.i(2664),s=e.i(297894),l=e.i(830665),o=e.i(254667);e.i(132249);var u=e.i(306617),c=e.i(110005),d=e.i(476302),h=e.i(829881),m=e.i(973930);function p(){let{historySessionLength:e}=(0,m.useAgentUIContext)();return(0,i.useMemo)(()=>e,[e])}e.s(["useAgentUIHistorySessionLength",0,p,"useAgentUIInputParamSelectHandler",0,function(e){let{useInputParamSelectHandler:t}=(0,m.useAgentUIContext)();return t(e)}],270168);var f=e.i(532675),g=e.i(113079),x=e.i(203475),v=e.i(694528);function y(e){let{t:i}=(0,n.useI18n)(),{onCancel:r,onConfirm:a,cancelLabel:s,confirmLabel:l}=e,o=s||i("agent_vote_cancel"),u=l||i("agent_vote_confirm");return(0,t.jsxs)("div",{className:"flex items-end justify-end gap-2",children:[(0,t.jsx)(v.Button,{type:"button",variant:"outline",size:"sm",onClick:r,children:o}),(0,t.jsx)(v.Button,{type:"button",variant:"invert",size:"sm",onClick:a,children:u})]})}function _(e){let{t:i}=(0,n.useI18n)(),{label:r,optional:a=!0,children:s,className:l}=e;return(0,t.jsxs)("div",{className:(0,f.twClsx)("flex flex-col gap-2",l),children:[(0,t.jsxs)("p",{className:"text-lo-body-sm text-lo-text-secondary",children:[(0,t.jsx)("span",{className:"font-medium",children:r}),a&&(0,t.jsxs)("span",{className:"text-lo-text-tertiary",children:[" ",i("agent_vote_optional")]})]}),s]})}function b(e){let{t:i}=(0,n.useI18n)(),{title:r,issueTypeOptions:a,issueType:s,onIssueTypeChange:l,comment:o,onCommentChange:u,onCancel:c,onConfirm:d,cancelLabel:h,confirmLabel:m,className:p,showIssueType:v=!0}=e,b=r||i("agent_vote_feedback_title");return(0,t.jsxs)("div",{className:(0,f.twClsx)("mt-3 flex flex-col gap-2",p),children:[(0,t.jsx)("p",{className:"text-lo-body-md text-lo-text-default font-semibold",children:b}),(0,t.jsxs)("div",{className:"border-lo-border-neutral-l1 bg-lo-bg-float shadow-lo-elevation-100 rounded-lo-radius-12 flex flex-col gap-3 border p-3",children:[v&&(0,t.jsx)(_,{label:i("agent_vote_issue_type"),children:(0,t.jsx)(g.MultiSelect,{options:a,value:s,onValueChange:l,placeholder:i("agent_vote_please_select"),width:"100%",side:"top"})}),(0,t.jsx)(_,{label:i("agent_vote_comment"),children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)(x.TextareaAutosize,{value:o,onValueChange:u,placeholder:i("agent_vote_placeholder"),maxLength:100,size:"md",minRows:3,maxRows:6,containerClassName:"w-full"}),(0,t.jsxs)("p",{className:"text-lo-body-sm text-lo-text-tertiary text-right tabular-nums",children:[o.length,"/100"]})]})}),(0,t.jsx)(y,{onCancel:c,onConfirm:d,cancelLabel:h,confirmLabel:m})]})]})}e.i(670999);var w=e.i(466057),j=e.i(7284);function N(e){let{icon:i,selected:n=!1,className:r,tooltip:a,...s}=e;return(0,t.jsx)(w.Tooltip,{title:a,children:(0,t.jsx)("button",{type:"button",className:(0,j.default)("rounded-lo-radius-6 group flex size-6 cursor-pointer items-center justify-center bg-transparent transition-colors","hover:bg-lo-bg-overlay-hover",n&&"bg-lo-bg-overlay",r),...s,children:i})})}e.s(["VoteButton",0,N],367236);let E=(0,o.createLogger)("SessionVote");e.s(["SessionVoteButtons",0,function(e){let{t:o}=(0,n.useI18n)(),{threadId:m,actionId:g,resultType:x,rootClassName:v,className:y,children:_,rightPlaceholder:w,leftPlaceholder:j}=e,T=p(),[C,A]=(0,i.useState)(null),[k,M]=(0,i.useState)(!1),[I,S]=(0,i.useState)([]),[O,R]=(0,i.useState)(""),P=(0,i.useRef)(null),D=(0,i.useMemo)(()=>[{value:"didnt_follow_instructions",label:o("agent_vote_issue_didnt_follow_instructions")},{value:"not_factually_correct",label:o("agent_vote_issue_not_factually_correct")},{value:"dont_like_style",label:o("agent_vote_issue_dont_like_style")},{value:"doesnt_match_reference",label:o("agent_vote_issue_doesnt_match_reference")},{value:"took_too_long",label:o("agent_vote_issue_took_too_long")},{value:"consume_too_many_credits",label:o("agent_vote_issue_consume_too_many_credits")}],[o]),L=(0,i.useCallback)(e=>{let t=C===e?null:e;A(t),M("dislike"===t),"dislike"!==t&&(S([]),R(""));try{(0,c.mc)("agent.dialog.session.vote",{thread_id:m??"",action_id:g??"",vote_type:t??"",image_url:[],response_type:x,thread_id_type:"",source:"thread_bottom"},c.DUAL_WRITE_OPTIONS)}catch(e){E("reportAgentSessionVote error:",e)}},[C,m,g,x]),F=(0,i.useCallback)(()=>{try{(0,c.mc)("agent.dialog.session.vote.reason.click",{thread_id:m??"",action_id:g??"",vote_type:C??"",image_url:[],response_type:x,thread_id_type:"",issue_type:I.join(","),comment:O,source:"thread_bottom"},c.DUAL_WRITE_OPTIONS),S([]),R(""),M(!1),(0,u.notifySuccess)(o("agent_vote_feedback_submit_success"))}catch(e){E("reportAgentSessionVote error:",e)}},[C,I,O,m,g,x,o]),U=(0,i.useCallback)(()=>{S([]),R(""),M(!1)},[]);return(0,i.useEffect)(()=>{k&&P.current&&setTimeout(()=>{P.current?.parentElement?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},500)},[k]),(0,i.useEffect)(()=>{M(!1)},[T]),(0,t.jsxs)("div",{ref:P,className:(0,f.twClsx)("flex w-full flex-col items-start pb-4",v&&v),children:[_,(0,t.jsxs)("div",{className:(0,f.twClsx)("relative -left-[4px] flex items-center gap-2 pt-1",y&&y),children:[j,(0,t.jsx)(N,{icon:"like"===C?(0,t.jsx)(l.default,{className:"text-lo-icon-default size-4"}):(0,t.jsx)(s.default,{className:"text-lo-icon-secondary group-hover:text-lo-icon-default size-4"}),selected:"like"===C,"aria-label":"点赞",onClick:()=>L("like"),tooltip:o("agent_vote_helpful")}),(0,t.jsx)(N,{icon:"dislike"===C?(0,t.jsx)(a.default,{className:"text-lo-icon-default size-4"}):(0,t.jsx)(r.default,{className:"text-lo-icon-secondary group-hover:text-lo-icon-default size-4"}),selected:"dislike"===C,"aria-label":"点踩",onClick:()=>L("dislike"),tooltip:o("agent_vote_not_helpful")}),w]}),(0,t.jsx)(d.AnimatePresence,{children:k&&(0,t.jsx)(h.motion.div,{initial:{opacity:0,height:0,y:-8}
20,animate:{opacity:1,height:"auto",y:0},exit:{opacity:0,height:0,y:-8},transition:{duration:.5,ease:[.58,0,0,1]},className:"w-full overflow-hidden",children:(0,t.jsx)(b,{className:"w-full",issueTypeOptions:D,issueType:I,onIssueTypeChange:S,comment:O,onCommentChange:R,onCancel:U,onConfirm:F})})})]})}],369133);var T=e.i(526762);e.s(["checkIsCustomizedErrorDetail",0,function(e,t){return!!e&&!!("SEEDANCE_2_INPUT_POLICY_VIOLATION"===t&&e?.moderation_results?.length)},"getErrorDetailCustomizedConfigMap",0,function(e=T.translate){return{SEEDANCE_2_INPUT_POLICY_VIOLATION:{title:e("agent_tool_use_error_seedance_2_moderation_title"),description:e("agent_tool_use_error_seedance_2_moderation_description")}}}],466471)},361114,e=>{"use strict";var t=e.i(21590),i=e.i(820967);let n=(0,i.createContext)({}),r=(0,i.memo)(function(e){let{children:r,threadId:a,actionId:s,parentThreadId:l,parentActionId:o,agentName:u}=e,c=(0,i.useMemo)(()=>({threadId:a,actionId:s,parentThreadId:l,parentActionId:o,agentName:u}),[a,s,l,o,u]);return(0,t.jsx)(n.Provider,{value:c,children:r})});e.s(["MessageTrackProvider",0,r,"useMessageTrackContext",0,function(){return(0,i.useContext)(n)}])},414720,(e,t,i)=>{t.exports={v:"5.12.2",fr:60,ip:0,op:120,w:22,h:22,nm:"Sparkles 22px Spin Pulse",ddd:0,assets:[{id:"sparkle_large",w:22,h:22,u:"",p:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHZpZXdCb3g9Ii00IC00IDIyIDIyIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNOS4xODYyIDQuNTIwNzVDOS4xODYyIDQuMjc5MTMgOC45OTAzMSA0LjA4MzI1IDguNzQ4NyA0LjA4MzI1QzguNTA3MDggNC4wODMyNSA4LjMxMTIgNC4yNzkxMyA4LjMxMTIgNC41MjA3NUM4LjMxMTIgNS45MzU4IDcuOTk4NTkgNi44NTQ4NCA3LjQyNjExIDcuNDI3MzNDNi44NTM2MiA3Ljk5OTgxIDUuOTM0NTggOC4zMTI0MiA0LjUxOTUzIDguMzEyNDJDNC4yNzc5MSA4LjMxMjQyIDQuMDgyMDMgOC41MDgzIDQuMDgyMDMgOC43NDk5MkM0LjA4MjAzIDguOTkxNTQgNC4yNzc5MSA5LjE4NzQyIDQuNTE5NTMgOS4xODc0MkM1LjkzNDU4IDkuMTg3NDIgNi44NTM2MiA5LjUwMDAzIDcuNDI2MTEgMTAuMDcyNUM3Ljk5ODU5IDEwLjY0NSA4LjMxMTIgMTEuNTY0IDguMzExMiAxMi45NzkxQzguMzExMiAxMy4yMjA3IDguNTA3MDggMTMuNDE2NiA4Ljc0ODcgMTMuNDE2NkM4Ljk5MDMxIDEzLjQxNjYgOS4xODYyIDEzLjIyMDcgOS4xODYyIDEyLjk3OTFDOS4xODYyIDExLjU2NCA5LjQ5ODgxIDEwLjY0NSAxMC4wNzEzIDEwLjA3MjVDMTAuNjQzOCA5LjUwMDAzIDExLjU2MjggOS4xODc0MiAxMi45Nzc5IDkuMTg3NDJDMTMuMjE5NSA5LjE4NzQyIDEzLjQxNTQgOC45OTE1NCAxMy40MTU0IDguNzQ5OTJDMTMuNDE1NCA4LjUwODMgMTMuMjE5NSA4LjMxMjQyIDEyLjk3NzkgOC4zMTI0MkMxMS41NjI4IDguMzEyNDIgMTAuNjQzOCA3Ljk5OTgxIDEwLjA3MTMgNy40MjczM0M5LjQ5ODgxIDYuODU0ODQgOS4xODYyIDUuOTM1OCA5LjE4NjIgNC4
201MjA3NVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=",e:1},{id:"sparkle_small",w:22,h:22,u:"",p:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHZpZXdCb3g9Ii00IC00IDIyIDIyIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNC4yMjc4NiAxLjAyMDc1QzQuMjI3ODYgMC43NzkxMjkgNC4wMzE5OSAwLjU4MzI1MiAzLjc5MDM2IDAuNTgzMjUyQzMuNTQ4NzQgMC41ODMyNTIgMy4zNTI4NiAwLjc3OTEyOSAzLjM1Mjg2IDEuMDIwNzVDMy4zNTI4NiAxLjkyOTQ0IDMuMTUxNjcgMi40ODM4NyAyLjgxNzE2IDIuODE4MzhDMi40ODI2NSAzLjE1Mjg5IDEuOTI4MjIgMy4zNTQwOSAxLjAxOTUzIDMuMzU0MDlDMC43Nzc5MDkgMy4zNTQwOSAwLjU4MjAzMSAzLjU0OTk2IDAuNTgyMDMxIDMuNzkxNTlDMC41ODIwMzEgNC4wMzMyMSAwLjc3NzkwOSA0LjIyOTA5IDEuMDE5NTMgNC4yMjkwOUMxLjkyODIyIDQuMjI5MDkgMi40ODI2NSA0LjQzMDI4IDIuODE3MTYgNC43NjQ3OUMzLjE1MTY3IDUuMDk5MyAzLjM1Mjg2IDUuNjUzNzMgMy4zNTI4NiA2LjU2MjQyQzMuMzUyODYgNi44MDQwNCAzLjU0ODc0IDYuOTk5OTIgMy43OTAzNiA2Ljk5OTkyQzQuMDMxOTkgNi45OTk5MiA0LjIyNzg2IDYuODA0MDQgNC4yMjc4NiA2LjU2MjQyQzQuMjI3ODYgNS42NTM3MyA0LjQyOTA2IDUuMDk5MyA0Ljc2MzU3IDQuNzY0NzlDNS4wOTgwOCA0LjQzMDI4IDUuNjUyNTEgNC4yMjkwOSA2LjU2MTIgNC4yMjkwOUM2LjgwMjgxIDQuMjI5MDkgNi45OTg3IDQuMDMzMjEgNi45OTg3IDMuNzkxNTlDNi45OTg3IDMuNTQ5OTYgNi44MDI4MSAzLjM1NDA5IDYuNTYxMiAzLjM1NDA5QzUuNjUyNTEgMy4zNTQwOSA1LjA5ODA4IDMuMTUyODkgNC43NjM1NyAyLjgxODM4QzQuNDI5MDYgMi40ODM4NyA0LjIyNzg2IDEuOTI5NDQgNC4yMjc4NiAxLjAyMDc1WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==",e:1}],layers:[{ddd:0,ind:1,ty:2,nm:"Large sparkle",refId:"sparkle_large",sr:1,ks:{o:{a:0,k:100},r:{a:1,k:[{t:0,s:[0],e:[180],o:{x:[.42],y:[0]},i:{x:[.58],y:[1]}},{t:60,s:[180],e:[360],o:{x:[.42],y:[0]},i:{x:[.58],y:[1]}},{t:120,s:[360]}]},p:{a:0,k:[12.7487,12.7499,0]},a:{a:0,k:[12.7487,12.7499,0]},s:{a:1,k:[{t:0,s:[100,100,100],e:[120,120,100],o:{x:[.42,.42,.42],y:[0,0,0]},i:{x:[.58,.58,.58],y:[1,1,1]}},{t:60,s:[120,120,100],e:[100,100,100],o:{x:[.42,.42,.42],y:[0,0,0]},i:{x:[.58,.58,.58],y:[1,1,1]}},{t:120,s:[100,100,100]}]}},ao:0,ip:0,op:120,st:0,bm:0},{ddd:0,ind:2,ty:2,nm:"Small sparkle",refId:"sparkle_small",sr:1,ks:{o:{a:0,k:100},r:{a:1,k:[{t:0,s:[0],e:[180],o:{x:[.42],y:[0]},i:{x:[.58],y:[1]}},{t:60,s:[180],e:[360],o:{x:[.42],y:[0]},i:{x:[.58],y:[1]}},{t:120,s:[360]}]},p:{a:0,k:[7.7904,7.7916,0]},a:{a:0,k:[7.7904,7.7916,0]},s:{a:1,k:[{t:0,s:[100,100,100],e:[120,120,100],o:{x:[.42,.42,.42],y:[0,0,0]},i:{x:[.58,.58,.58],y:[1,1,1]}},{t:60,s:[120,120,100],e:[100,100,100],o:{x:[.42,.42,.42],y:[0,0,0]},i:{x:[.58,.58,.58],y:[1,1,1]}},{t:120,s:[100,100,100]}]}},ao:0,ip:0,op:120,st:0,bm:0}],markers:[]}}]);

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.