app-v3-scripts-editor 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -63368,10 +63368,10 @@ const KIe = () => {
|
|
|
63368
63368
|
Cs,
|
|
63369
63369
|
{
|
|
63370
63370
|
wrapperTag: (o) => /* @__PURE__ */ z(gn, { ...o, direction: "vertical", size: 16 }),
|
|
63371
|
-
children: oV.map((o) => {
|
|
63371
|
+
children: oV.filter((o) => n == null ? void 0 : n.includes(o.key)).map((o) => {
|
|
63372
63372
|
const i = o.icon, a = o.active, s = o.label.includes(`
|
|
63373
63373
|
`) || o.label.length > 9;
|
|
63374
|
-
return
|
|
63374
|
+
return /* @__PURE__ */ Ve(
|
|
63375
63375
|
wn,
|
|
63376
63376
|
{
|
|
63377
63377
|
draggable: !0,
|
|
@@ -63394,7 +63394,7 @@ const KIe = () => {
|
|
|
63394
63394
|
]
|
|
63395
63395
|
},
|
|
63396
63396
|
o.key
|
|
63397
|
-
)
|
|
63397
|
+
);
|
|
63398
63398
|
})
|
|
63399
63399
|
}
|
|
63400
63400
|
) });
|
|
@@ -399,5 +399,5 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
399
399
|
`):" "+gL(i[0]):"as no adapter specified";throw new Pt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:vx};function yx(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yu(null,e)}function yL(e){return yx(e),e.headers=xo.from(e.headers),e.data=mx.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vL.getAdapter(e.adapter||uh.adapter)(e).then(function(r){return yx(e),r.data=mx.call(e,e.transformResponse,r),r.headers=xo.from(r.headers),r},function(r){return iL(r)||(yx(e),r&&r.response&&(r.response.data=mx.call(e,e.transformResponse,r.response),r.response.headers=xo.from(r.response.headers))),Promise.reject(r)})}const bL="1.11.0",kv={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{kv[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const wL={};kv.transitional=function(t,n,r){function o(i,a){return"[Axios v"+bL+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,s)=>{if(t===!1)throw new Pt(o(a," has been removed"+(n?" in "+n:"")),Pt.ERR_DEPRECATED);return n&&!wL[a]&&(wL[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,s):!0}},kv.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function uye(e,t,n){if(typeof e!="object")throw new Pt("options must be an object",Pt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const s=e[i],l=s===void 0||a(s,i,e);if(l!==!0)throw new Pt("option "+i+" must be "+l,Pt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Pt("Unknown option "+i,Pt.ERR_BAD_OPTION)}}const Fv={assertOptions:uye,validators:kv},va=Fv.validators;let Rl=class{constructor(t){this.defaults=t||{},this.interceptors={request:new tL,response:new tL}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
400
400
|
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ll(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Fv.assertOptions(r,{silentJSONParsing:va.transitional(va.boolean),forcedJSONParsing:va.transitional(va.boolean),clarifyTimeoutError:va.transitional(va.boolean)},!1),o!=null&&($e.isFunction(o)?n.paramsSerializer={serialize:o}:Fv.assertOptions(o,{encode:va.function,serialize:va.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Fv.assertOptions(n,{baseUrl:va.spelling("baseURL"),withXsrfToken:va.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&$e.merge(i.common,i[n.method]);i&&$e.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=xo.concat(a,i);const s=[];let l=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(l=l&&b.synchronous,s.unshift(b.fulfilled,b.rejected))});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let u,d=0,h;if(!l){const y=[yL.bind(this),void 0];for(y.unshift(...s),y.push(...c),h=y.length,u=Promise.resolve(n);d<h;)u=u.then(y[d++],y[d++]);return u}h=s.length;let p=n;for(d=0;d<h;){const y=s[d++],b=s[d++];try{p=y(p)}catch(v){b.call(this,v);break}}try{u=yL.call(this,p)}catch(y){return Promise.reject(y)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Ll(this.defaults,t);const n=cL(t.baseURL,t.url,t.allowAbsoluteUrls);return eL(n,t.params,t.paramsSerializer)}};$e.forEach(["delete","get","head","options"],function(t){Rl.prototype[t]=function(n,r){return this.request(Ll(r||{},{method:t,url:n,data:(r||{}).data}))}}),$e.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,s){return this.request(Ll(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Rl.prototype[t]=n(),Rl.prototype[t+"Form"]=n(!0)});let dye=class GB{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(s=>{r.subscribe(s),i=s}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,s){r.reason||(r.reason=new yu(i,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new GB(function(o){t=o}),cancel:t}}};function fye(e){return function(n){return e.apply(null,n)}}function hye(e){return $e.isObject(e)&&e.isAxiosError===!0}const bx={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bx).forEach(([e,t])=>{bx[t]=e});function CL(e){const t=new Rl(e),n=B6(Rl.prototype.request,t);return $e.extend(n,Rl.prototype,t,{allOwnKeys:!0}),$e.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return CL(Ll(e,o))},n}const rr=CL(uh);rr.Axios=Rl,rr.CanceledError=yu,rr.CancelToken=dye,rr.isCancel=iL,rr.VERSION=bL,rr.toFormData=Mv,rr.AxiosError=Pt,rr.Cancel=rr.CanceledError,rr.all=function(t){return Promise.all(t)},rr.spread=fye,rr.isAxiosError=hye,rr.mergeConfig=Ll,rr.AxiosHeaders=xo,rr.formToJSON=e=>rL($e.isHTMLForm(e)?new FormData(e):e),rr.getAdapter=vL.getAdapter,rr.HttpStatusCode=bx,rr.default=rr;const{Axios:OTe,AxiosError:NTe,CanceledError:TTe,isCancel:ITe,CancelToken:PTe,VERSION:MTe,all:ATe,Cancel:DTe,isAxiosError:LTe,spread:RTe,toFormData:kTe,AxiosHeaders:FTe,HttpStatusCode:BTe,formToJSON:VTe,getAdapter:zTe,mergeConfig:jTe}=rr,xL=T.createContext(void 0),pye=(e,t,n)=>{if(!t)throw new Error("AUTHORIZATION_HEADER is required");const r=rr.create({baseURL:e,headers:{"Content-Type":"application/json",...t.startsWith("Bearer ")?{Authorization:t}:t.startsWith("x-api-key")?{"x-api-key":t.substring(9)}:{Authorization:`Bearer ${t}`}}});return r.interceptors.request.use(o=>{var i;return console.log(`[Scripts Editor - ${n}]: Request:`,(i=o.method)==null?void 0:i.toUpperCase(),o.url),o},o=>Promise.reject(o)),r.interceptors.response.use(o=>o,o=>{var i,a;return console.error(`[Scripts Editor - ${n}]: Response Error:`,(i=o.response)==null?void 0:i.status,(a=o.response)==null?void 0:a.data),Promise.reject(o)}),r},SL=({children:e,BASE_URL:t,AUTHORIZATION_HEADER:n,context:r,BLOCKS_ENABLED:o})=>{const i=T.useRef(null),a=T.useMemo(()=>pye(t,n,"Main API"),[t,n]),s=T.useMemo(()=>({axiosInstance:a,reactFlowRef:i,context:r,BLOCKS_ENABLED:o}),[a,r,o]);return k.jsx(xL.Provider,{value:s,children:e})},Bv=()=>{const e=T.useContext(xL);if(!e)throw new Error("useInstanceContext must be used within an InstanceContextProvider");return e},EL=()=>{const{axiosInstance:e,context:{COMPANY_ID:t,CALLBOTSCENARIO_ID:n}}=Bv(),{error:r}=lC();return CV({mutationFn:async({audio:o})=>{var a,s,l,c;if(!t||!n)throw new Error("COMPANY_ID and CALLBOTSCENARIO_ID are required");const i=new FormData;i.append("raw_file",o);try{return(a=(await e.postForm(`/company/${t}/callbotscenario/${n}/file`,i)).data)==null?void 0:a.url}catch(u){const d=u;throw r((c=(l=(s=d.response)==null?void 0:s.data)==null?void 0:l.raw_file)==null?void 0:c[0]),d}},onError:o=>{console.error("Upload audio error:",o)}})},mye=({audioStream:e,isRecording:t})=>{const n=T.useRef(null),r=T.useRef(void 0),o=T.useRef(null),i=T.useRef(null);return T.useEffect(()=>{if(!e||!t){r.current&&cancelAnimationFrame(r.current),i.current&&(i.current.close(),i.current=null);return}const a=n.current;if(!a)return;const s=a.getContext("2d");if(!s)return;i.current=new(window.AudioContext||window.webkitAudioContext);const l=i.current.createMediaStreamSource(e);o.current=i.current.createAnalyser(),o.current.fftSize=256,o.current.smoothingTimeConstant=.8,l.connect(o.current);const c=o.current.frequencyBinCount,u=new Uint8Array(c),d=()=>{if(!o.current||!s)return;r.current=requestAnimationFrame(d),o.current.getByteFrequencyData(u),s.clearRect(0,0,a.width,a.height);const h=3,p=1;let y=0;for(let v=0;v<c;v++){const w=Math.max(4,u[v]/255*(a.height-8));s.fillStyle="#000",s.beginPath(),s.roundRect(y,a.height-w-4,h,w,1.5),s.fill(),y+=h+p}const b=a.height/2;s.strokeStyle="#ccc",s.setLineDash([2,2]),s.lineWidth=1,s.beginPath(),s.moveTo(y+8,b),s.lineTo(a.width-4,b),s.stroke(),s.setLineDash([])};return d(),()=>{r.current&&cancelAnimationFrame(r.current)}},[e,t]),k.jsx("canvas",{ref:n,width:64,height:32,style:{backgroundColor:"transparent"}})},wx=60*10,Cx=({onFinishRecord:e})=>{const[t,n]=T.useState(!1),{mutateAsync:r}=EL(),o=y=>{const b=Math.floor(y/60),v=y%60;return`${b.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}`},i=y=>yhe(y,"dd/MM/yyyy HH:mm:ss"),a=T.useCallback(()=>{const y=new Date;return y.setSeconds(y.getSeconds()+wx),y},[]),{totalSeconds:s,isRunning:l,start:c,pause:u,restart:d}=Wve.useTimer({expiryTimestamp:a(),onExpire:()=>console.warn("Recording time expired"),autoStart:!1}),h=wx-s,p=async y=>{const b=`recording_${i(new Date).replace(/[/:]/g,"_")}.wav`,v=new File([y],b,{type:y.type});return{audioUrl:await r({audio:v}),transcript:`Transcript for ${b} - This is a placeholder transcript that would be generated from the recorded audio.`}};return k.jsx(zve.ReactMediaRecorder,{audio:!0,video:!1,onStart:()=>{const y=new Date;y.setSeconds(y.getSeconds()+wx),d(y),c()},onStop:async(y,b)=>{if(u(),b&&e){n(!0);try{const v=await p(b);e(v.audioUrl,v.transcript)}catch(v){iu.error("Tải lên audio thất bại!"),console.error("Upload error:",v),e(y)}finally{n(!1)}}},render:({status:y,startRecording:b,stopRecording:v,mediaBlobUrl:w,previewAudioStream:x})=>{const C=y==="recording";return k.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[C?k.jsx(hn,{type:"text",onClick:v,disabled:t,style:{width:"32px",height:"32px",borderRadius:"8px",backgroundColor:In.speakBlock.background,border:`1px solid ${In.speakBlock.border}`,display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:k.jsx("div",{style:{width:"12px",height:"12px",backgroundColor:In.common.red,borderRadius:"2px"}})}):k.jsx(hn,{icon:t?k.jsx(aa,{}):k.jsx(ub,{}),onClick:b,disabled:t,loading:t,children:t?"Đang tải lên...":"Ghi âm"}),C&&k.jsxs(k.Fragment,{children:[k.jsx("div",{style:{display:"flex",alignItems:"center",flex:1},children:k.jsx(mye,{audioStream:x,isRecording:C})}),k.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:"#000",minWidth:"40px",textAlign:"right"},children:o(h)})]})]})}})},xx=({url:e,className:t,formPath:n})=>{const r=$t.useFormInstance();if(!e||e==="")return k.jsx(Rc,{message:"Không có file âm thanh",description:"Vui lòng tải lên file âm thanh hoặc ghi âm",type:"info",showIcon:!0,icon:k.jsx(ub,{})});const o=()=>{n&&n.forEach(i=>{r.setFieldValue(i,void 0)})};return k.jsx("div",{className:t,children:k.jsxs("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[k.jsxs("audio",{controls:!0,preload:"auto","aria-label":"Audio playback",src:e,style:{height:32,maxWidth:"260px"},children:[k.jsx("track",{kind:"captions",src:"",label:"Captions"}),"Trình duyệt của bạn không hỗ trợ phát âm thanh."]}),n&&k.jsx(Tf,{title:"Xóa âm thanh",description:"Bạn có chắc chắn muốn xóa không?",onConfirm:o,okText:"Xóa",cancelText:"Hủy",placement:"top",children:k.jsx(hn,{danger:!0,icon:k.jsx(Md,{}),"aria-label":"Delete audio",style:{marginLeft:"8px"}})})]})})},{TextArea:gye}=Vr,vye=({placeholder:e="Vui lòng tải lên ghi âm để cá nhân hoá",rows:t=4})=>{const n=yg(),r=T.useRef(null),{isOpen:o,onOpen:i,onClose:a}=Df(),[s,l]=T.useState(""),[c,u]=T.useState("confirm"),d=C=>{},h=C=>{var O;const S=r.current;if(!S)return;const E=(O=S.resizableTextArea)==null?void 0:O.textArea;if(!E)return;const $=E.value.substring(E.selectionStart,E.selectionEnd);$.trim()?(l($),u("confirm"),i()):a()},p=()=>{u("configure")},y=()=>{a(),l(""),u("confirm")},b=()=>{var I;const C=r.current;if(!C)return;const S=(I=C.resizableTextArea)==null?void 0:I.textArea;if(!S)return;const E=S.value,$=E.substring(0,S.selectionStart),O=E.substring(S.selectionEnd),N=$+`{{${s}}}`+O;n.setFieldValue(["record","transcript_personalize"],N),n.submit(),a(),l(""),u("confirm")},v=()=>{a(),l(""),u("confirm")},w=()=>k.jsxs("div",{style:{minWidth:"300px"},children:[k.jsx("div",{style:{marginBottom:"16px"},children:k.jsxs(hr.Text,{children:["Bạn muốn thay thế cụm từ ",k.jsx("strong",{children:s})," bằng biến?"]})}),k.jsx(jr,{isOpen:c==="configure",children:k.jsx("div",{children:k.jsx("div",{style:{padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"8px"},children:k.jsx("p",{children:"TODO: Component tìm kiếm tên trường"})})})})]}),x=()=>c==="confirm"?{onConfirm:p,onCancel:y,okText:"Thêm biến",cancelText:"Hủy"}:{onConfirm:b,onCancel:v,okText:"Thêm biến",cancelText:"Hủy"};return k.jsxs(k.Fragment,{children:[k.jsx(Tf,{title:w(),...x(),open:o,icon:!1,children:k.jsx(hr.Text,{type:"secondary",children:"Bôi đen cụm từ trong kịch bản để thay thế bằng biến"})}),k.jsx(gye,{ref:r,placeholder:e,rows:t,value:n.getFieldValue(["record","transcript_personalize"]),onChange:d,onMouseUp:h,style:{width:"100%",border:"none",borderRadius:X5.block.rounded.borderRadius,backgroundColor:In.common.gray,padding:"12px",marginTop:"12px",fontSize:"14px",lineHeight:"1.5",resize:"none"}})]})},Sx=({onUploadSuccess:e,fieldName:t="audio",disabled:n=!1})=>{const{mutateAsync:r,isPending:o}=EL(),i=async s=>({audioUrl:await r({audio:s}),transcript:`Transcript for ${s.name} - This is a placeholder transcript that would be generated from the uploaded audio file.`}),a={name:t,accept:".mp3,.wav,.m4a",showUploadList:!1,beforeUpload:async s=>{if(!["audio/mp3","audio/mpeg","audio/wav","audio/x-wav","audio/m4a","audio/x-m4a"].includes(s.type))return iu.error("Chỉ chấp nhận file audio (mp3, wav, m4a)!"),!1;if(!(s.size/1024/1024<50))return iu.error("File phải nhỏ hơn 50MB!"),!1;try{const u=await i(s);e==null||e(u.audioUrl,u.transcript)}catch(u){iu.error("Tải lên audio thất bại!"),console.error("Upload error:",u)}return!1}};return k.jsx(iC,{...a,children:k.jsx(hn,{icon:o?k.jsx(aa,{}):k.jsx(hN,{}),disabled:n||o,loading:o,children:o?"Đang tải lên...":"Tải lên"})})},{TextArea:Ex}=Vr,{Text:bu}=hr,yye=({prefixPaths:e=[]})=>{const t=$t.useWatch([...e,"record","detect_gender"]),n=$t.useWatch([...e,"record","personalize"]),r=yg(),o=$t.useWatch([...e,"record","default_record"],r),i=$t.useWatch([...e,"record","male_record"],r),a=$t.useWatch([...e,"record","female_record"],r);return k.jsxs(k.Fragment,{children:[k.jsxs($t.Item,{name:[...e,"record","default_record"],valuePropName:"checked",style:{marginBottom:"8px"},label:k.jsx(bu,{strong:!0,children:"Mặc định"}),children:[k.jsxs(an,{direction:"horizontal",size:0,wrap:!0,children:[k.jsx(jr,{isOpen:!o,children:k.jsxs(an,{direction:"horizontal",size:16,wrap:!0,style:{marginTop:"8px"},children:[k.jsx(Sx,{onUploadSuccess:(s,l)=>{r.setFieldValue([...e,"record","default_record"],s),r.setFieldValue([...e,"record","transcript_original"],l),r.submit()}}),k.jsx(Cx,{onFinishRecord:(s,l)=>{r.setFieldValue([...e,"record","default_record"],s),r.setFieldValue([...e,"record","transcript_original"],l),r.submit()}})]})}),k.jsx(jr,{isOpen:!!o,children:k.jsx(xx,{url:o,formPath:[[...e,"record","default_record"],[...e,"record","transcript_original"]]})})]}),k.jsx("div",{style:{marginTop:8},children:k.jsx(bu,{italic:!0,type:"secondary",children:r.getFieldValue([...e,"record","transcript_original"])})})]}),k.jsx($t.Item,{name:[...e,"record","detect_gender"],valuePropName:"checked",style:{marginBottom:"0px"},children:k.jsx(Ef,{children:k.jsx(bu,{strong:!0,children:"Phân biệt giới tính"})})}),k.jsx(jr,{isOpen:t,children:k.jsxs(Sw,{gutter:[0,16],children:[k.jsx($t.Item,{name:[...e,"record","male_record"],noStyle:!0,children:k.jsxs(an,{direction:"horizontal",size:0,wrap:!0,children:[k.jsx(bu,{children:"Khách hàng nam"}),k.jsxs(an,{direction:"horizontal",size:0,wrap:!0,children:[k.jsx(jr,{isOpen:!i,children:k.jsxs(an,{direction:"horizontal",size:16,wrap:!0,style:{marginTop:"8px"},children:[k.jsx(Sx,{onUploadSuccess:(s,l)=>{r.setFieldValue([...e,"record","male_record"],s),r.submit()}}),k.jsx(Cx,{onFinishRecord:(s,l)=>{r.setFieldValue([...e,"record","male_record"],s),r.submit()}})]})}),k.jsx(jr,{isOpen:!!i,children:k.jsx(xx,{url:i,formPath:[[...e,"record","male_record"],[...e,"record","transcript_original"]]})})]})]})}),k.jsx($t.Item,{name:[...e,"record","female_record"],noStyle:!0,children:k.jsxs(an,{direction:"horizontal",size:0,wrap:!0,children:[k.jsx(bu,{children:"Khách hàng nữ"}),k.jsxs(an,{direction:"horizontal",size:0,wrap:!0,children:[k.jsx(jr,{isOpen:!a,children:k.jsxs(an,{direction:"horizontal",size:16,wrap:!0,style:{marginTop:"8px"},children:[k.jsx(Sx,{onUploadSuccess:(s,l)=>{r.setFieldValue([...e,"record","female_record"],s),r.submit()}}),k.jsx(Cx,{onFinishRecord:(s,l)=>{r.setFieldValue([...e,"record","female_record"],s),r.submit()}})]})}),k.jsx(jr,{isOpen:!!a,children:k.jsx(xx,{url:a,formPath:[[...e,"record","female_record"],[...e,"record","transcript_original"]]})})]})]})})]})}),k.jsx($f,{style:{margin:"8px 0"}}),k.jsx($t.Item,{name:[...e,"record","personalize"],valuePropName:"checked",style:{marginBottom:"8px"},children:k.jsx(Ef,{children:k.jsx(bu,{strong:!0,children:"Cá nhân hoá"})})}),k.jsx(jr,{isOpen:n,children:k.jsx(vye,{})}),k.jsx($t.Item,{name:[...e,"record","transcript_with_timestamp"],label:"Transcript với timestamp",hidden:!0,children:k.jsx(Ex,{placeholder:"<span start='0.0' end='0.3'>em</span> ...",rows:2})}),k.jsx($t.Item,{name:[...e,"record","transcript_original"],label:"Transcript gốc",hidden:!0,children:k.jsx(Ex,{placeholder:"Em chào anh chị ạ",rows:2})}),k.jsx($t.Item,{name:[...e,"record","transcript_personalize"],label:"Transcript cá nhân hóa",hidden:!0,children:k.jsx(Ex,{placeholder:"Em chào {{name}} ạ",rows:2})})]})},bye=({id:e})=>{const{getNode:t,setNodes:n}=no(),r=Bg(),{infos:o,errors:i}=tv(e),a=o.length!==0||i.length!==0,{data:s}=t(e),l=s,[c]=$t.useForm(),u=$t.useWatch(["type"],c)||Yn.MACHINE,d=p=>{r(e,p)},h=ha.debounce(()=>{c.submit()},500);return k.jsx("div",{className:ufe,children:k.jsx($t,{form:c,layout:"vertical",initialValues:{...l},onFinish:d,onBlur:()=>{c.submit()},onChange:()=>{h()},children:k.jsxs(an,{direction:"vertical",size:"small",style:{height:"500px"},children:[k.jsx($t.Item,{name:["type"],noStyle:!0,children:k.jsx(Ew,{block:!0,options:[{label:"Giọng máy",value:Yn.MACHINE},{label:"Ghi âm",value:Yn.RECORD},{label:"Prompt",value:Yn.PROMPT}]})}),k.jsx(jr,{isOpen:u===Yn.RECORD,children:k.jsx(yye,{})}),k.jsx(jr,{isOpen:u===Yn.MACHINE,children:k.jsx(ffe,{})}),k.jsx(jr,{isOpen:u===Yn.PROMPT,children:k.jsx(pfe,{})}),k.jsxs(qa,{visible:a,children:[k.jsx($f,{style:{margin:"4px 0"}}),!ha.isEmpty(o)&&k.jsx("div",{className:Z3,children:o.map(p=>k.jsx(Rc,{message:p.title,description:p.description,type:"info",showIcon:!0,closable:!0,style:{padding:"12px",margin:"12px 0"}},p.title))}),!ha.isEmpty(i)&&k.jsx("div",{className:Z3,children:i.map(p=>k.jsx(Rc,{style:{padding:"12px"},message:p.title,description:p.description,type:"error",showIcon:!0,closable:!0},p.title))})]}),k.jsx(jS,{id:e}),k.jsx("div",{style:{height:"200px"}})]})})})},$x=({id:e,data:t,mini:n})=>{const{displayComponent:r}=kg(),{errors:o}=tv(e),i=t.title||"Bot nói",a=t.type||Yn.RECORD,s=T.useMemo(()=>{var u,d,h;return a===Yn.MACHINE?((u=t==null?void 0:t.machine)==null?void 0:u.content)||"Vui lòng nhập nội dung":a===Yn.PROMPT?((d=t==null?void 0:t.prompt)==null?void 0:d.content)||"Vui lòng nhập nội dung":a===Yn.RECORD?((h=t==null?void 0:t.record)==null?void 0:h.transcript_original)||"Vui lòng ghi âm hoặc tải file ghi âm":"N/A"},[a,t]),l=u=>{var d;(d=u.target)!=null&&d.closest("button")||(u.stopPropagation(),u.preventDefault(),r(k.jsx(bye,{id:e}),"Cài đặt bot nói"))},c=T.useMemo(()=>a===Yn.RECORD?"Ghi âm":a===Yn.MACHINE?"Giọng máy":a===Yn.PROMPT?"Prompt":"UNKNOWN",[a]);return n?k.jsx("div",{className:sfe,children:k.jsx("div",{className:G3,children:k.jsxs("div",{className:K3,children:[k.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[k.jsx("span",{className:X3,children:k.jsx(mb,{})}),k.jsx("span",{className:Y3,children:i})]}),k.jsx("div",{className:Q3,children:c})]})})}):k.jsx("div",{className:afe,onClick:l,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&l(u)},children:k.jsxs("div",{className:G3,children:[k.jsxs("div",{className:K3,children:[k.jsx("span",{className:X3,children:k.jsx(mb,{})}),k.jsx("span",{className:Y3,children:i}),k.jsx(Vg,{id:e,color:In.common.red}),k.jsx("div",{className:Q3,children:c}),k.jsx(Fg,{id:e,deleteBtnColor:In.common.red})]}),k.jsx(jr,{isOpen:!ha.isEmpty(o),children:k.jsx("div",{className:lfe,children:o.map(u=>k.jsx(Rc,{style:{width:"100%"},message:u.title,type:"error",showIcon:!0,closable:!0},`small-${e}-${u.title}`))})}),k.jsx("div",{className:cfe,children:k.jsx(qa,{children:s},`${e}-${s}`)})]})})};var wye="scripts_editor_flqrya0",Cye="scripts_editor_flqrya1",xye="scripts_editor_flqrya2 scripts_editor_flqrya1",$L="scripts_editor_flqrya3",Sye="scripts_editor_flqrya4",Eye="scripts_editor_flqrya5 scripts_editor_flqrya4";const _L=({mini:e})=>e?k.jsxs("div",{className:xye,children:[k.jsx("span",{className:$L,children:k.jsx(J5,{style:{fontSize:"20px"}})}),k.jsx("span",{className:Eye,children:"Bắt đầu"})]}):k.jsx("div",{className:wye,children:k.jsxs("div",{className:Cye,children:[k.jsx("span",{className:$L,children:k.jsx(J5,{})}),k.jsx("span",{className:Sye,children:"Bắt đầu"})]})}),OL=T.createContext({});function $ye(e){const t=T.useRef(null);return t.current===null&&(t.current=e()),t.current}const _x=typeof window<"u",_ye=_x?T.useLayoutEffect:T.useEffect,Ox=T.createContext(null);function Nx(e,t){e.indexOf(t)===-1&&e.push(t)}function Tx(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ka=(e,t,n)=>n>t?t:n<e?e:n;function Ix(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let wu=()=>{},Xa=()=>{};process.env.NODE_ENV!=="production"&&(wu=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Ix(t,n))},Xa=(e,t,n)=>{if(!e)throw new Error(Ix(t,n))});const Ya={},NL=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function TL(e){return typeof e=="object"&&e!==null}const IL=e=>/^0[^.\s]+$/u.test(e);function Px(e){let t;return()=>(t===void 0&&(t=e()),t)}const ai=e=>e,Oye=(e,t)=>n=>t(e(n)),fh=(...e)=>e.reduce(Oye),hh=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Mx{constructor(){this.subscriptions=[]}add(t){return Nx(this.subscriptions,t),()=>Tx(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const a=this.subscriptions[i];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Hi=e=>e*1e3,ya=e=>e/1e3;function PL(e,t){return t?e*(1e3/t):0}const ML=new Set;function Ax(e,t,n){e||ML.has(t)||(console.warn(Ix(t,n)),ML.add(t))}const AL=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Nye=1e-7,Tye=12;function Iye(e,t,n,r,o){let i,a,s=0;do a=t+(n-t)/2,i=AL(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>Nye&&++s<Tye);return a}function ph(e,t,n,r){if(e===t&&n===r)return ai;const o=i=>Iye(i,0,1,e,n);return i=>i===0||i===1?i:AL(o(i),t,r)}const DL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,LL=e=>t=>1-e(1-t),RL=ph(.33,1.53,.69,.99),Dx=LL(RL),kL=DL(Dx),FL=e=>(e*=2)<1?.5*Dx(e):.5*(2-Math.pow(2,-10*(e-1))),Lx=e=>1-Math.sin(Math.acos(e)),BL=LL(Lx),VL=DL(Lx),Pye=ph(.42,0,1,1),Mye=ph(0,0,.58,1),zL=ph(.42,0,.58,1),Aye=e=>Array.isArray(e)&&typeof e[0]!="number",jL=e=>Array.isArray(e)&&typeof e[0]=="number",HL={linear:ai,easeIn:Pye,easeInOut:zL,easeOut:Mye,circIn:Lx,circInOut:VL,circOut:BL,backIn:Dx,backInOut:kL,backOut:RL,anticipate:FL},Dye=e=>typeof e=="string",WL=e=>{if(jL(e)){Xa(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return ph(t,n,r,o)}else if(Dye(e))return Xa(HL[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),HL[e];return e},Vv=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Lye(e,t){let n=new Set,r=new Set,o=!1,i=!1;const a=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(u){a.has(u)&&(c.schedule(u),e()),u(s)}const c={schedule:(u,d=!1,h=!1)=>{const y=h&&o?n:r;return d&&a.add(u),y.has(u)||y.add(u),u},cancel:u=>{r.delete(u),a.delete(u)},process:u=>{if(s=u,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,i&&(i=!1,c.process(u))}};return c}const Rye=40;function UL(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Vv.reduce((C,S)=>(C[S]=Lye(i),C),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:y}=a,b=()=>{const C=Ya.useManualTiming?o.timestamp:performance.now();n=!1,Ya.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(C-o.timestamp,Rye),1)),o.timestamp=C,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),h.process(o),p.process(o),y.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(b))},v=()=>{n=!0,r=!0,o.isProcessing||e(b)};return{schedule:Vv.reduce((C,S)=>{const E=a[S];return C[S]=($,O=!1,N=!1)=>(n||v(),E.schedule($,O,N)),C},{}),cancel:C=>{for(let S=0;S<Vv.length;S++)a[Vv[S]].cancel(C)},state:o,steps:a}}const{schedule:Rn,cancel:Rs,state:Hr,steps:Rx}=UL(typeof requestAnimationFrame<"u"?requestAnimationFrame:ai,!0);let zv;function kye(){zv=void 0}const So={now:()=>(zv===void 0&&So.set(Hr.isProcessing||Ya.useManualTiming?Hr.timestamp:performance.now()),zv),set:e=>{zv=e,queueMicrotask(kye)}},qL=e=>t=>typeof t=="string"&&t.startsWith(e),kx=qL("--"),Fye=qL("var(--"),Fx=e=>Fye(e)?Bye.test(e.split("/*")[0].trim()):!1,Bye=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Cu={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},mh={...Cu,transform:e=>Ka(0,1,e)},jv={...Cu,default:1},gh=e=>Math.round(e*1e5)/1e5,Bx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Vye(e){return e==null}const zye=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Vx=(e,t)=>n=>!!(typeof n=="string"&&zye.test(n)&&n.startsWith(e)||t&&!Vye(n)&&Object.prototype.hasOwnProperty.call(n,t)),GL=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,a,s]=r.match(Bx);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},jye=e=>Ka(0,255,e),zx={...Cu,transform:e=>Math.round(jye(e))},kl={test:Vx("rgb","red"),parse:GL("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zx.transform(e)+", "+zx.transform(t)+", "+zx.transform(n)+", "+gh(mh.transform(r))+")"};function Hye(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const jx={test:Vx("#"),parse:Hye,transform:kl.transform},vh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ks=vh("deg"),ba=vh("%"),St=vh("px"),Wye=vh("vh"),Uye=vh("vw"),KL={...ba,parse:e=>ba.parse(e)/100,transform:e=>ba.transform(e*100)},xu={test:Vx("hsl","hue"),parse:GL("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ba.transform(gh(t))+", "+ba.transform(gh(n))+", "+gh(mh.transform(r))+")"},pr={test:e=>kl.test(e)||jx.test(e)||xu.test(e),parse:e=>kl.test(e)?kl.parse(e):xu.test(e)?xu.parse(e):jx.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?kl.transform(e):xu.transform(e),getAnimatableNone:e=>{const t=pr.parse(e);return t.alpha=0,pr.transform(t)}},qye=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Gye(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Bx))==null?void 0:t.length)||0)+(((n=e.match(qye))==null?void 0:n.length)||0)>0}const XL="number",YL="color",Kye="var",Xye="var(",QL="${}",Yye=/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 yh(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Yye,l=>(pr.test(l)?(r.color.push(i),o.push(YL),n.push(pr.parse(l))):l.startsWith(Xye)?(r.var.push(i),o.push(Kye),n.push(l)):(r.number.push(i),o.push(XL),n.push(parseFloat(l))),++i,QL)).split(QL);return{values:n,split:s,indexes:r,types:o}}function ZL(e){return yh(e).values}function JL(e){const{split:t,types:n}=yh(e),r=t.length;return o=>{let i="";for(let a=0;a<r;a++)if(i+=t[a],o[a]!==void 0){const s=n[a];s===XL?i+=gh(o[a]):s===YL?i+=pr.transform(o[a]):i+=o[a]}return i}}const Qye=e=>typeof e=="number"?0:pr.test(e)?pr.getAnimatableNone(e):e;function Zye(e){const t=ZL(e);return JL(e)(t.map(Qye))}const Fs={test:Gye,parse:ZL,createTransformer:JL,getAnimatableNone:Zye};function Hx(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Jye({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=Hx(l,s,e+1/3),i=Hx(l,s,e),a=Hx(l,s,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Hv(e,t){return n=>n>0?t:e}const jn=(e,t,n)=>e+(t-e)*n,Wx=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},ebe=[jx,kl,xu],tbe=e=>ebe.find(t=>t.test(e));function eR(e){const t=tbe(e);if(wu(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===xu&&(n=Jye(n)),n}const tR=(e,t)=>{const n=eR(e),r=eR(t);if(!n||!r)return Hv(e,t);const o={...n};return i=>(o.red=Wx(n.red,r.red,i),o.green=Wx(n.green,r.green,i),o.blue=Wx(n.blue,r.blue,i),o.alpha=jn(n.alpha,r.alpha,i),kl.transform(o))},Ux=new Set(["none","hidden"]);function nbe(e,t){return Ux.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function rbe(e,t){return n=>jn(e,t,n)}function qx(e){return typeof e=="number"?rbe:typeof e=="string"?Fx(e)?Hv:pr.test(e)?tR:abe:Array.isArray(e)?nR:typeof e=="object"?pr.test(e)?tR:obe:Hv}function nR(e,t){const n=[...e],r=n.length,o=e.map((i,a)=>qx(i)(i,t[a]));return i=>{for(let a=0;a<r;a++)n[a]=o[a](i);return n}}function obe(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=qx(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function ibe(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],a=e.indexes[i][r[i]],s=e.values[a]??0;n[o]=s,r[i]++}return n}const abe=(e,t)=>{const n=Fs.createTransformer(t),r=yh(e),o=yh(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Ux.has(e)&&!o.values.length||Ux.has(t)&&!r.values.length?nbe(e,t):fh(nR(ibe(r,o),o.values),n):(wu(!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.`,"complex-values-different"),Hv(e,t))};function rR(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?jn(e,t,n):qx(e)(e,t)}const sbe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Rn.update(t,n),stop:()=>Rs(t),now:()=>Hr.isProcessing?Hr.timestamp:So.now()}},oR=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=Math.round(e(i/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Wv=2e4;function Gx(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Wv;)t+=n,r=e.next(t);return t>=Wv?1/0:t}function lbe(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(Gx(r),Wv);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:ya(o)}}const cbe=5;function iR(e,t,n){const r=Math.max(t-cbe,0);return PL(n-e(r),t-r)}const Hn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Kx=.001;function ube({duration:e=Hn.duration,bounce:t=Hn.bounce,velocity:n=Hn.velocity,mass:r=Hn.mass}){let o,i;wu(e<=Hi(Hn.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=Ka(Hn.minDamping,Hn.maxDamping,a),e=Ka(Hn.minDuration,Hn.maxDuration,ya(e)),a<1?(o=c=>{const u=c*a,d=u*e,h=u-n,p=Xx(c,a),y=Math.exp(-d);return Kx-h/p*y},i=c=>{const d=c*a*e,h=d*n+n,p=Math.pow(a,2)*Math.pow(c,2)*e,y=Math.exp(-d),b=Xx(Math.pow(c,2),a);return(-o(c)+Kx>0?-1:1)*((h-p)*y)/b}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Kx+u*d},i=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const s=5/e,l=fbe(o,i,s);if(e=Hi(e),isNaN(l))return{stiffness:Hn.stiffness,damping:Hn.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:a*2*Math.sqrt(r*c),duration:e}}}const dbe=12;function fbe(e,t,n){let r=n;for(let o=1;o<dbe;o++)r=r-e(r)/t(r);return r}function Xx(e,t){return e*Math.sqrt(1-t*t)}const hbe=["duration","bounce"],pbe=["stiffness","damping","mass"];function aR(e,t){return t.some(n=>e[n]!==void 0)}function mbe(e){let t={velocity:Hn.velocity,stiffness:Hn.stiffness,damping:Hn.damping,mass:Hn.mass,isResolvedFromDuration:!1,...e};if(!aR(e,pbe)&&aR(e,hbe))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*Ka(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Hn.mass,stiffness:o,damping:i}}else{const n=ube(e);t={...t,...n,mass:Hn.mass},t.isResolvedFromDuration=!0}return t}function Uv(e=Hn.visualDuration,t=Hn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],s={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=mbe({...n,velocity:-ya(n.velocity||0)}),y=h||0,b=c/(2*Math.sqrt(l*u)),v=a-i,w=ya(Math.sqrt(l/u)),x=Math.abs(v)<5;r||(r=x?Hn.restSpeed.granular:Hn.restSpeed.default),o||(o=x?Hn.restDelta.granular:Hn.restDelta.default);let C;if(b<1){const E=Xx(w,b);C=$=>{const O=Math.exp(-b*w*$);return a-O*((y+b*w*v)/E*Math.sin(E*$)+v*Math.cos(E*$))}}else if(b===1)C=E=>a-Math.exp(-w*E)*(v+(y+w*v)*E);else{const E=w*Math.sqrt(b*b-1);C=$=>{const O=Math.exp(-b*w*$),N=Math.min(E*$,300);return a-O*((y+b*w*v)*Math.sinh(N)+E*v*Math.cosh(N))/E}}const S={calculatedDuration:p&&d||null,next:E=>{const $=C(E);if(p)s.done=E>=d;else{let O=E===0?y:0;b<1&&(O=E===0?Hi(y):iR(C,E,$));const N=Math.abs(O)<=r,I=Math.abs(a-$)<=o;s.done=N&&I}return s.value=s.done?a:$,s},toString:()=>{const E=Math.min(Gx(S),Wv),$=oR(O=>S.next(E*O).value,E,30);return E+"ms "+$},toTransition:()=>{}};return S}Uv.applyToOptions=e=>{const t=lbe(e,100,Uv);return e.ease=t.ease,e.duration=Hi(t.duration),e.type="keyframes",e};function Yx({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=N=>s!==void 0&&N<s||l!==void 0&&N>l,y=N=>s===void 0?l:l===void 0||Math.abs(s-N)<Math.abs(l-N)?s:l;let b=n*t;const v=d+b,w=a===void 0?v:a(v);w!==v&&(b=w-d);const x=N=>-b*Math.exp(-N/r),C=N=>w+x(N),S=N=>{const I=x(N),M=C(N);h.done=Math.abs(I)<=c,h.value=h.done?w:M};let E,$;const O=N=>{p(h.value)&&(E=N,$=Uv({keyframes:[h.value,y(h.value)],velocity:iR(C,N,h.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return O(0),{calculatedDuration:null,next:N=>{let I=!1;return!$&&E===void 0&&(I=!0,S(N),O(N)),E!==void 0&&N>=E?$.next(N-E):(!I&&S(N),h)}}}function gbe(e,t,n){const r=[],o=n||Ya.mix||rR,i=e.length-1;for(let a=0;a<i;a++){let s=o(e[a],e[a+1]);if(t){const l=Array.isArray(t)?t[a]||ai:t;s=fh(l,s)}r.push(s)}return r}function vbe(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Xa(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=gbe(t,r,o),l=s.length,c=u=>{if(a&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const h=hh(e[d],e[d+1],u);return s[d](h)};return n?u=>c(Ka(e[0],e[i-1],u)):c}function ybe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=hh(0,t,r);e.push(jn(n,1,o))}}function bbe(e){const t=[0];return ybe(t,e.length-1),t}function wbe(e,t){return e.map(n=>n*t)}function Cbe(e,t){return e.map(()=>t||zL).splice(0,e.length-1)}function Su({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=Aye(r)?r.map(WL):WL(r),i={done:!1,value:t[0]},a=wbe(n&&n.length===t.length?n:bbe(t),e),s=vbe(a,t,{ease:Array.isArray(o)?o:Cbe(t,o)});return{calculatedDuration:e,next:l=>(i.value=s(l),i.done=l>=e,i)}}const xbe=e=>e!==null;function Qx(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(xbe),s=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const Sbe={decay:Yx,inertia:Yx,tween:Su,keyframes:Su,spring:Uv};function sR(e){typeof e.type=="string"&&(e.type=Sbe[e.type])}class Zx{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Ebe=e=>e/100;class Jx extends Zx{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==So.now()&&this.tick(So.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;sR(t);const{type:n=Su,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:a=0}=t;let{keyframes:s}=t;const l=n||Su;process.env.NODE_ENV!=="production"&&l!==Su&&Xa(s.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${s}`,"spring-two-frames"),l!==Su&&typeof s[0]!="number"&&(this.mixKeyframes=fh(Ebe,rR(s[0],s[1])),s=[0,100]);const c=l({...t,keyframes:s});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Gx(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:h,repeatDelay:p,type:y,onUpdate:b,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const w=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?w<0:w>o;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let C=this.currentTime,S=r;if(d){const N=Math.min(this.currentTime,o)/s;let I=Math.floor(N),M=N%1;!M&&N>=1&&(M=1),M===1&&I--,I=Math.min(I,d+1),!!(I%2)&&(h==="reverse"?(M=1-M,p&&(M-=p/s)):h==="mirror"&&(S=a)),C=Ka(0,1,M)*s}const E=x?{done:!1,value:u[0]}:S.next(C);i&&(E.value=i(E.value));let{done:$}=E;!x&&l!==null&&($=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return O&&y!==Yx&&(E.value=Qx(u,this.options,v,this.speed)),b&&b(E.value),O&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return ya(this.calculatedDuration)}get time(){return ya(this.currentTime)}set time(t){var n;t=Hi(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(So.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ya(this.currentTime))}play(){var o,i;if(this.isStopped)return;const{driver:t=sbe,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(i=(o=this.options).onPlay)==null||i.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(So.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function $be(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Fl=e=>e*180/Math.PI,eS=e=>{const t=Fl(Math.atan2(e[1],e[0]));return tS(t)},_be={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:eS,rotateZ:eS,skewX:e=>Fl(Math.atan(e[1])),skewY:e=>Fl(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},tS=e=>(e=e%360,e<0&&(e+=360),e),lR=eS,cR=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),uR=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Obe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:cR,scaleY:uR,scale:e=>(cR(e)+uR(e))/2,rotateX:e=>tS(Fl(Math.atan2(e[6],e[5]))),rotateY:e=>tS(Fl(Math.atan2(-e[2],e[0]))),rotateZ:lR,rotate:lR,skewX:e=>Fl(Math.atan(e[4])),skewY:e=>Fl(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function nS(e){return e.includes("scale")?1:0}function rS(e,t){if(!e||e==="none")return nS(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=Obe,o=n;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_be,o=s}if(!o)return nS(t);const i=r[t],a=o[1].split(",").map(Tbe);return typeof i=="function"?i(a):a[i]}const Nbe=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return rS(n,t)};function Tbe(e){return parseFloat(e.trim())}const Eu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$u=new Set(Eu),dR=e=>e===Cu||e===St,Ibe=new Set(["x","y","z"]),Pbe=Eu.filter(e=>!Ibe.has(e));function Mbe(e){const t=[];return Pbe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Bl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>rS(t,"x"),y:(e,{transform:t})=>rS(t,"y")};Bl.translateX=Bl.x,Bl.translateY=Bl.y;const Vl=new Set;let oS=!1,iS=!1,aS=!1;function fR(){if(iS){const e=Array.from(Vl).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=Mbe(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,a])=>{var s;(s=r.getValue(i))==null||s.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}iS=!1,oS=!1,Vl.forEach(e=>e.complete(aS)),Vl.clear()}function hR(){Vl.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(iS=!0)})}function Abe(){aS=!0,hR(),fR(),aS=!1}class sS{constructor(t,n,r,o,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Vl.add(this),oS||(oS=!0,Rn.read(hR),Rn.resolveKeyframes(fR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o==null?void 0:o.get(),a=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const s=r.readValue(n,a);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=a),o&&i===void 0&&o.set(t[0])}$be(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Vl.delete(this)}cancel(){this.state==="scheduled"&&(Vl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Dbe=e=>e.startsWith("--");function Lbe(e,t,n){Dbe(t)?e.style.setProperty(t,n):e.style[t]=n}const Rbe=Px(()=>window.ScrollTimeline!==void 0),kbe={};function Fbe(e,t){const n=Px(e);return()=>kbe[t]??n()}const pR=Fbe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),bh=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,mR={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bh([0,.65,.55,1]),circOut:bh([.55,0,1,.45]),backIn:bh([.31,.01,.66,-.59]),backOut:bh([.33,1.53,.69,.99])};function gR(e,t){if(e)return typeof e=="function"?pR()?oR(e,t):"ease-out":jL(e)?bh(e):Array.isArray(e)?e.map(n=>gR(n,t)||mR.easeOut):mR[e]}function Bbe(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:a="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=gR(s,o);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function vR(e){return typeof e=="function"&&"applyToOptions"in e}function Vbe({type:e,...t}){return vR(e)&&pR()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class zbe extends Zx{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=t,Xa(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=Vbe(t);this.animation=Bbe(n,r,o,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Qx(o,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(u):Lbe(n,r,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ya(Number(t))}get time(){return ya(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Hi(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Rbe()?(this.animation.timeline=t,ai):n(this)}}const yR={anticipate:FL,backInOut:kL,circInOut:VL};function jbe(e){return e in yR}function Hbe(e){typeof e.ease=="string"&&jbe(e.ease)&&(e.ease=yR[e.ease])}const bR=10;class Wbe extends zbe{constructor(t){Hbe(t),sR(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const s=new Jx({...a,autoplay:!1}),l=Hi(this.finishedTime??this.time);n.setWithVelocity(s.sample(l-bR).value,s.sample(l).value,bR),s.stop()}}const wR=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Fs.test(e)||e==="0")&&!e.startsWith("url("));function Ube(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function qbe(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],a=wR(o,t),s=wR(i,t);return wu(a===s,`You are trying to animate ${t} from "${o}" to "${i}". "${a?i:o}" is not an animatable value.`,"value-not-animatable"),!a||!s?!1:Ube(e)||(n==="spring"||vR(n))&&r}function lS(e){e.duration=0,e.type}const Gbe=new Set(["opacity","clipPath","filter","transform"]),Kbe=Px(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Xbe(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:a}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return Kbe()&&n&&Gbe.has(n)&&(n!=="transform"||!c)&&!l&&!r&&o!=="mirror"&&i!==0&&a!=="inertia"}const Ybe=40;class Qbe extends Zx{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:a="loop",keyframes:s,name:l,motionValue:c,element:u,...d}){var y;super(),this.stop=()=>{var b,v;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=So.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:a,name:l,motionValue:c,element:u,...d},p=(u==null?void 0:u.KeyframeResolver)||sS;this.keyframeResolver=new p(s,(b,v,w)=>this.onKeyframesResolved(b,v,h,!w),l,c,u),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:i,type:a,velocity:s,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=So.now(),qbe(t,i,a,s)||((Ya.instantAnimations||!l)&&(u==null||u(Qx(t,r,n))),t[0]=t[t.length-1],lS(r),r.repeat=0);const h={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Ybe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},p=!c&&Xbe(h)?new Wbe({...h,element:h.motionValue.owner.current}):new Jx(h);p.finished.then(()=>this.notifyFinished()).catch(ai),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Abe()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Zbe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jbe(e){const t=Zbe.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const e1e=4;function CR(e,t,n=1){Xa(n<=e1e,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=Jbe(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return NL(a)?parseFloat(a):a}return Fx(o)?CR(o,t,n+1):o}function cS(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const xR=new Set(["width","height","top","left","right","bottom",...Eu]),t1e={test:e=>e==="auto",parse:e=>e},SR=e=>t=>t.test(e),ER=[Cu,St,ba,ks,Uye,Wye,t1e],$R=e=>ER.find(SR(e));function n1e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||IL(e):!0}const r1e=new Set(["brightness","contrast","saturate","opacity"]);function o1e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Bx)||[];if(!r)return e;const o=n.replace(r,"");let i=r1e.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const i1e=/\b([a-z-]*)\(.*?\)/gu,uS={...Fs,getAnimatableNone:e=>{const t=e.match(i1e);return t?t.map(o1e).join(" "):e}},_R={...Cu,transform:Math.round},dS={borderWidth:St,borderTopWidth:St,borderRightWidth:St,borderBottomWidth:St,borderLeftWidth:St,borderRadius:St,radius:St,borderTopLeftRadius:St,borderTopRightRadius:St,borderBottomRightRadius:St,borderBottomLeftRadius:St,width:St,maxWidth:St,height:St,maxHeight:St,top:St,right:St,bottom:St,left:St,padding:St,paddingTop:St,paddingRight:St,paddingBottom:St,paddingLeft:St,margin:St,marginTop:St,marginRight:St,marginBottom:St,marginLeft:St,backgroundPositionX:St,backgroundPositionY:St,...{rotate:ks,rotateX:ks,rotateY:ks,rotateZ:ks,scale:jv,scaleX:jv,scaleY:jv,scaleZ:jv,skew:ks,skewX:ks,skewY:ks,distance:St,translateX:St,translateY:St,translateZ:St,x:St,y:St,z:St,perspective:St,transformPerspective:St,opacity:mh,originX:KL,originY:KL,originZ:St},zIndex:_R,fillOpacity:mh,strokeOpacity:mh,numOctaves:_R},a1e={...dS,color:pr,backgroundColor:pr,outlineColor:pr,fill:pr,stroke:pr,borderColor:pr,borderTopColor:pr,borderRightColor:pr,borderBottomColor:pr,borderLeftColor:pr,filter:uS,WebkitFilter:uS},OR=e=>a1e[e];function NR(e,t){let n=OR(e);return n!==uS&&(n=Fs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const s1e=new Set(["auto","none","0"]);function l1e(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!s1e.has(i)&&yh(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=NR(n,o)}class c1e extends sS{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Fx(c))){const u=CR(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!xR.has(r)||t.length!==2)return;const[o,i]=t,a=$R(o),s=$R(i);if(a!==s)if(dR(a)&&dR(s))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else Bl[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||n1e(t[o]))&&r.push(o);r.length&&l1e(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Bl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var s;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=Bl[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(s=this.removedTransforms)!=null&&s.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function u1e(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const TR=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function d1e(e){return TL(e)&&"offsetHeight"in e}const IR=30,f1e=e=>!isNaN(parseFloat(e));class h1e{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const o=So.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=So.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=f1e(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ax(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Mx);const r=this.events[t].add(n);return t==="change"?()=>{r(),Rn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=So.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>IR)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,IR);return PL(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _u(e,t){return new h1e(e,t)}const{schedule:fS}=UL(queueMicrotask,!1),Wi={x:!1,y:!1};function PR(){return Wi.x||Wi.y}function p1e(e){return e==="x"||e==="y"?Wi[e]?null:(Wi[e]=!0,()=>{Wi[e]=!1}):Wi.x||Wi.y?null:(Wi.x=Wi.y=!0,()=>{Wi.x=Wi.y=!1})}function MR(e,t){const n=u1e(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function AR(e){return!(e.pointerType==="touch"||PR())}function m1e(e,t,n={}){const[r,o,i]=MR(e,n),a=s=>{if(!AR(s))return;const{target:l}=s,c=t(l,s);if(typeof c!="function"||!l)return;const u=d=>{AR(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(s=>{s.addEventListener("pointerenter",a,o)}),i}const DR=(e,t)=>t?e===t?!0:DR(e,t.parentElement):!1,hS=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,g1e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function v1e(e){return g1e.has(e.tagName)||e.tabIndex!==-1}const qv=new WeakSet;function LR(e){return t=>{t.key==="Enter"&&e(t)}}function pS(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const y1e=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=LR(()=>{if(qv.has(n))return;pS(n,"down");const o=LR(()=>{pS(n,"up")}),i=()=>pS(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function RR(e){return hS(e)&&!PR()}function b1e(e,t,n={}){const[r,o,i]=MR(e,n),a=s=>{const l=s.currentTarget;if(!RR(s))return;qv.add(l);const c=t(l,s),u=(p,y)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),qv.has(l)&&qv.delete(l),RR(p)&&typeof c=="function"&&c(p,{success:y})},d=p=>{u(p,l===window||l===document||n.useGlobalTarget||DR(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",h,o)};return r.forEach(s=>{(n.useGlobalTarget?window:s).addEventListener("pointerdown",a,o),d1e(s)&&(s.addEventListener("focus",c=>y1e(c,o)),!v1e(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),i}function kR(e){return TL(e)&&"ownerSVGElement"in e}function w1e(e){return kR(e)&&e.tagName==="svg"}const Xr=e=>!!(e&&e.getVelocity),C1e=[...ER,pr,Fs],x1e=e=>C1e.find(SR(e)),FR=T.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function S1e(e=!0){const t=T.useContext(Ox);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=T.useId();T.useEffect(()=>{if(e)return o(i)},[e]);const a=T.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const BR=T.createContext({strict:!1}),VR={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ou={};for(const e in VR)Ou[e]={isEnabled:t=>VR[e].some(n=>!!t[n])};function E1e(e){for(const t in e)Ou[t]={...Ou[t],...e[t]}}const $1e=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 Gv(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$1e.has(e)}let zR=e=>!Gv(e);function _1e(e){typeof e=="function"&&(zR=t=>t.startsWith("on")?!Gv(t):e(t))}try{_1e(require("@emotion/is-prop-valid").default)}catch{}function O1e(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(zR(o)||n===!0&&Gv(o)||!t&&!Gv(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Kv=T.createContext({});function Xv(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function wh(e){return typeof e=="string"||Array.isArray(e)}const mS=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gS=["initial",...mS];function Yv(e){return Xv(e.animate)||gS.some(t=>wh(e[t]))}function jR(e){return!!(Yv(e)||e.variants)}function N1e(e,t){if(Yv(e)){const{initial:n,animate:r}=e;return{initial:n===!1||wh(n)?n:void 0,animate:wh(r)?r:void 0}}return e.inherit!==!1?t:{}}function T1e(e){const{initial:t,animate:n}=N1e(e,T.useContext(Kv));return T.useMemo(()=>({initial:t,animate:n}),[HR(t),HR(n)])}function HR(e){return Array.isArray(e)?e.join(" "):e}const Ch={};function I1e(e){for(const t in e)Ch[t]=e[t],kx(t)&&(Ch[t].isCSSVariable=!0)}function WR(e,{layout:t,layoutId:n}){return $u.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ch[e]||e==="opacity")}const P1e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},M1e=Eu.length;function A1e(e,t,n){let r="",o=!0;for(let i=0;i<M1e;i++){const a=Eu[i],s=e[a];if(s===void 0)continue;let l=!0;if(typeof s=="number"?l=s===(a.startsWith("scale")?1:0):l=parseFloat(s)===0,!l||n){const c=TR(s,dS[a]);if(!l){o=!1;const u=P1e[a]||a;r+=`${u}(${c}) `}n&&(t[a]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function vS(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let a=!1,s=!1;for(const l in t){const c=t[l];if($u.has(l)){a=!0;continue}else if(kx(l)){o[l]=c;continue}else{const u=TR(c,dS[l]);l.startsWith("origin")?(s=!0,i[l]=u):r[l]=u}}if(t.transform||(a||n?r.transform=A1e(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const yS=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function UR(e,t,n){for(const r in t)!Xr(t[r])&&!WR(r,n)&&(e[r]=t[r])}function D1e({transformTemplate:e},t){return T.useMemo(()=>{const n=yS();return vS(n,t,e),Object.assign({},n.vars,n.style)},[t])}function L1e(e,t){const n=e.style||{},r={};return UR(r,n,e),Object.assign(r,D1e(e,t)),r}function R1e(e,t){const n={},r=L1e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const k1e={offset:"stroke-dashoffset",array:"stroke-dasharray"},F1e={offset:"strokeDashoffset",array:"strokeDasharray"};function B1e(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?k1e:F1e;e[i.offset]=St.transform(-r);const a=St.transform(t),s=St.transform(n);e[i.array]=`${a} ${s}`}function qR(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:a=0,...s},l,c,u){if(vS(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&B1e(d,o,i,a,!1)}const GR=()=>({...yS(),attrs:{}}),KR=e=>typeof e=="string"&&e.toLowerCase()==="svg";function V1e(e,t,n,r){const o=T.useMemo(()=>{const i=GR();return qR(i,t,KR(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};UR(i,e.style,e),o.style={...i,...o.style}}return o}const z1e=["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 bS(e){return typeof e!="string"||e.includes("-")?!1:!!(z1e.indexOf(e)>-1||/[A-Z]/u.test(e))}function j1e(e,t,n,{latestValues:r},o,i=!1){const s=(bS(e)?V1e:R1e)(t,r,o,e),l=O1e(t,typeof e=="string",i),c=e!==T.Fragment?{...l,...s,ref:n}:{},{children:u}=t,d=T.useMemo(()=>Xr(u)?u.get():u,[u]);return T.createElement(e,{...c,children:d})}function XR(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function wS(e,t,n,r){if(typeof t=="function"){const[o,i]=XR(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=XR(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function Qv(e){return Xr(e)?e.get():e}function H1e({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:W1e(n,r,o,e),renderState:t()}}function W1e(e,t,n,r){const o={},i=r(e,{});for(const h in i)o[h]=Qv(i[h]);let{initial:a,animate:s}=e;const l=Yv(e),c=jR(e);t&&c&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u=u||a===!1;const d=u?s:a;if(d&&typeof d!="boolean"&&!Xv(d)){const h=Array.isArray(d)?d:[d];for(let p=0;p<h.length;p++){const y=wS(e,h[p]);if(y){const{transitionEnd:b,transition:v,...w}=y;for(const x in w){let C=w[x];if(Array.isArray(C)){const S=u?C.length-1:0;C=C[S]}C!==null&&(o[x]=C)}for(const x in b)o[x]=b[x]}}}return o}const YR=e=>(t,n)=>{const r=T.useContext(Kv),o=T.useContext(Ox),i=()=>H1e(e,t,r,o);return n?i():$ye(i)};function CS(e,t,n){var i;const{style:r}=e,o={};for(const a in r)(Xr(r[a])||t.style&&Xr(t.style[a])||WR(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(o[a]=r[a]);return o}const U1e=YR({scrapeMotionValuesFromProps:CS,createRenderState:yS});function QR(e,t,n){const r=CS(e,t,n);for(const o in e)if(Xr(e[o])||Xr(t[o])){const i=Eu.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const q1e=YR({scrapeMotionValuesFromProps:QR,createRenderState:GR}),G1e=Symbol.for("motionComponentSymbol");function Nu(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function K1e(e,t,n){return T.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Nu(n)&&(n.current=r))},[t])}const xS=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ZR="data-"+xS("framerAppearId"),JR=T.createContext({});function X1e(e,t,n,r,o){var b,v;const{visualElement:i}=T.useContext(Kv),a=T.useContext(BR),s=T.useContext(Ox),l=T.useContext(FR).reducedMotion,c=T.useRef(null);r=r||a.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=T.useContext(JR);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&Y1e(c.current,n,o,d);const h=T.useRef(!1);T.useInsertionEffect(()=>{u&&h.current&&u.update(n,s)});const p=n[ZR],y=T.useRef(!!p&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,p))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,p)));return _ye(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),y.current&&u.animationState&&u.animationState.animateChanges())}),T.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)==null||w.call(window,p)}),y.current=!1),u.enteringChildren=void 0)}),u}function Y1e(e,t,n,r){const{layoutId:o,layout:i,drag:a,dragConstraints:s,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:e8(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!a||s&&Nu(s),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function e8(e){if(e)return e.options.allowProjection!==!1?e.projection:e8(e.parent)}function SS(e,{forwardMotionProps:t=!1}={},n,r){n&&E1e(n);const o=bS(e)?q1e:U1e;function i(s,l){let c;const u={...T.useContext(FR),...s,layoutId:Q1e(s)},{isStatic:d}=u,h=T1e(s),p=o(s,d);if(!d&&_x){Z1e(u,n);const y=J1e(u);c=y.MeasureLayout,h.visualElement=X1e(e,p,u,r,y.ProjectionNode)}return k.jsxs(Kv.Provider,{value:h,children:[c&&h.visualElement?k.jsx(c,{visualElement:h.visualElement,...u}):null,j1e(e,s,K1e(p,h.visualElement,l),p,d,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const a=T.forwardRef(i);return a[G1e]=e,a}function Q1e({layoutId:e}){const t=T.useContext(OL).id;return t&&e!==void 0?t+"-"+e:e}function Z1e(e,t){const n=T.useContext(BR).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?wu(!1,r,"lazy-strict-mode"):Xa(!1,r,"lazy-strict-mode")}}function J1e(e){const{drag:t,layout:n}=Ou;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function ewe(e,t){if(typeof Proxy>"u")return SS;const n=new Map,r=(i,a)=>SS(i,a,e,t),o=(i,a)=>(process.env.NODE_ENV!=="production"&&Ax(!1,"motion() is deprecated. Use motion.create() instead."),r(i,a));return new Proxy(o,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,SS(a,void 0,e,t)),n.get(a))})}function t8({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function twe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function nwe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ES(e){return e===void 0||e===1}function $S({scale:e,scaleX:t,scaleY:n}){return!ES(e)||!ES(t)||!ES(n)}function zl(e){return $S(e)||n8(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function n8(e){return r8(e.x)||r8(e.y)}function r8(e){return e&&e!=="0%"}function Zv(e,t,n){const r=e-n,o=t*r;return n+o}function o8(e,t,n,r,o){return o!==void 0&&(e=Zv(e,o,r)),Zv(e,n,r)+t}function _S(e,t=0,n=1,r,o){e.min=o8(e.min,t,n,r,o),e.max=o8(e.max,t,n,r,o)}function i8(e,{x:t,y:n}){_S(e.x,t.translate,t.scale,t.originPoint),_S(e.y,n.translate,n.scale,n.originPoint)}const a8=.999999999999,s8=1.0000000000001;function rwe(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,a;for(let s=0;s<o;s++){i=n[s],a=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Iu(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,i8(e,a)),r&&zl(i.latestValues)&&Iu(e,i.latestValues))}t.x<s8&&t.x>a8&&(t.x=1),t.y<s8&&t.y>a8&&(t.y=1)}function Tu(e,t){e.min=e.min+t,e.max=e.max+t}function l8(e,t,n,r,o=.5){const i=jn(e.min,e.max,o);_S(e,t,n,i,r)}function Iu(e,t){l8(e.x,t.x,t.scaleX,t.scale,t.originX),l8(e.y,t.y,t.scaleY,t.scale,t.originY)}function c8(e,t){return t8(nwe(e.getBoundingClientRect(),t))}function owe(e,t,n){const r=c8(e,n),{scroll:o}=t;return o&&(Tu(r.x,o.offset.x),Tu(r.y,o.offset.y)),r}const u8=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pu=()=>({x:u8(),y:u8()}),d8=()=>({min:0,max:0}),or=()=>({x:d8(),y:d8()}),OS={current:null},f8={current:!1};function iwe(){if(f8.current=!0,!!_x)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>OS.current=e.matches;e.addEventListener("change",t),t()}else OS.current=!1}const awe=new WeakMap;function swe(e,t,n){for(const r in t){const o=t[r],i=n[r];if(Xr(o))e.addValue(r,o);else if(Xr(i))e.addValue(r,_u(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=e.getStaticValue(r);e.addValue(r,_u(a!==void 0?a:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const h8=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lwe{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,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=sS,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=()=>{const h=So.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Rn.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=s,this.blockInitialAnimation=!!i,this.isControllingVariants=Yv(n),this.isVariantNode=jR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in d){const p=d[h];l[h]!==void 0&&Xr(p)&&p.set(l[h])}}mount(t){var n;this.current=t,awe.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,o)=>this.bindToMotionValue(o,r)),f8.current||iwe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:OS.current,process.env.NODE_ENV!=="production"&&Ax(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Rs(this.notifyUpdate),Rs(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=$u.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Rn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ou){const n=Ou[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):or()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<h8.length;r++){const o=h8[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,a=t[i];a&&(this.propEventSubscriptions[o]=this.on(o,a))}this.prevMotionValues=swe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=_u(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(NL(r)||IL(r))?r=parseFloat(r):!x1e(r)&&Fs.test(n)&&(r=NR(t,n)),this.setBaseTarget(t,Xr(r)?r.get():r)),Xr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=wS(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Xr(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Mx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){fS.render(this.render)}}class p8 extends lwe{constructor(){super(...arguments),this.KeyframeResolver=c1e}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function m8(e,{style:t,vars:n},r,o){const i=e.style;let a;for(a in t)i[a]=t[a];o==null||o.applyProjectionStyles(i,r);for(a in n)i.setProperty(a,n[a])}function cwe(e){return window.getComputedStyle(e)}class uwe extends p8{constructor(){super(...arguments),this.type="html",this.renderInstance=m8}readValueFromInstance(t,n){var r;if($u.has(n))return(r=this.projection)!=null&&r.isProjecting?nS(n):Nbe(t,n);{const o=cwe(t),i=(kx(n)?o.getPropertyValue(n):o[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return c8(t,n)}build(t,n,r){vS(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return CS(t,n,r)}}const g8=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 dwe(e,t,n,r){m8(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(g8.has(o)?o:xS(o),t.attrs[o])}class fwe extends p8{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=or}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if($u.has(n)){const r=OR(n);return r&&r.default||0}return n=g8.has(n)?n:xS(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return QR(t,n,r)}build(t,n,r){qR(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){dwe(t,n,r,o)}mount(t){this.isSVGTag=KR(t.tagName),super.mount(t)}}const hwe=(e,t)=>bS(e)?new fwe(t):new uwe(t,{allowProjection:e!==T.Fragment});function Mu(e,t,n){const r=e.getProps();return wS(r,t,n!==void 0?n:r.custom,e)}const NS=e=>Array.isArray(e);function pwe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_u(n))}function mwe(e){return NS(e)?e[e.length-1]||0:e}function gwe(e,t){const n=Mu(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const a in i){const s=mwe(i[a]);pwe(e,a,s)}}function vwe(e){return!!(Xr(e)&&e.add)}function TS(e,t){const n=e.getValue("willChange");if(vwe(n))return n.add(t);if(!n&&Ya.WillChange){const r=new Ya.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function v8(e){return e.props[ZR]}const ywe=e=>e!==null;function bwe(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(ywe),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const wwe={type:"spring",stiffness:500,damping:25,restSpeed:10},Cwe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xwe={type:"keyframes",duration:.8},Swe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ewe=(e,{keyframes:t})=>t.length>2?xwe:$u.has(e)?e.startsWith("scale")?Cwe(t[1]):wwe:Swe;function $we({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const IS=(e,t,n,r={},o,i)=>a=>{const s=cS(r,e)||{},l=s.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Hi(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:h=>{t.set(h),s.onUpdate&&s.onUpdate(h)},onComplete:()=>{a(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:i?void 0:o};$we(s)||Object.assign(u,Ewe(e,u)),u.duration&&(u.duration=Hi(u.duration)),u.repeatDelay&&(u.repeatDelay=Hi(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(lS(u),u.delay===0&&(d=!0)),(Ya.instantAnimations||Ya.skipAnimations)&&(d=!0,lS(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!i&&t.get()!==void 0){const h=bwe(u.keyframes,s);if(h!==void 0){Rn.update(()=>{u.onUpdate(h),u.onComplete()});return}}return s.isSync?new Jx(u):new Qbe(u)};function _we({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function y8(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:a,...s}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in s){const d=e.getValue(u,e.latestValues[u]??null),h=s[u];if(h===void 0||c&&_we(c,u))continue;const p={delay:n,...cS(i||{},u)},y=d.get();if(y!==void 0&&!d.isAnimating&&!Array.isArray(h)&&h===y&&!p.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const w=v8(e);if(w){const x=window.MotionHandoffAnimation(w,u,Rn);x!==null&&(p.startTime=x,b=!0)}}TS(e,u),d.start(IS(u,d,h,e.shouldReduceMotion&&xR.has(u)?{type:!1}:p,e,b));const v=d.animation;v&&l.push(v)}return a&&Promise.all(l).then(()=>{Rn.update(()=>{a&&gwe(e,a)})}),l}function b8(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),a=e.size,s=(a-1)*r;return typeof n=="function"?n(i,a):o===1?i*r:s-i*r}function PS(e,t,n={}){var l;const r=Mu(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(y8(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=o;return Owe(e,t,c,u,d,h,n)}:()=>Promise.resolve(),{when:s}=o;if(s){const[c,u]=s==="beforeChildren"?[i,a]:[a,i];return c().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function Owe(e,t,n=0,r=0,o=0,i=1,a){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(PS(l,t,{...a,delay:n+(typeof r=="function"?0:r)+b8(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}function Nwe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>PS(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=PS(e,t,n);else{const o=typeof t=="function"?Mu(e,t,n.custom):t;r=Promise.all(y8(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function w8(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Twe=gS.length;function C8(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?C8(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Twe;n++){const r=gS[n],o=e.props[r];(wh(o)||o===!1)&&(t[r]=o)}return t}const Iwe=[...mS].reverse(),Pwe=mS.length;function Mwe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Nwe(e,n,r)))}function Awe(e){let t=Mwe(e),n=x8(),r=!0;const o=l=>(c,u)=>{var h;const d=Mu(e,u,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(d){const{transition:p,transitionEnd:y,...b}=d;c={...c,...b,...y}}return c};function i(l){t=l(e)}function a(l){const{props:c}=e,u=C8(e.parent)||{},d=[],h=new Set;let p={},y=1/0;for(let v=0;v<Pwe;v++){const w=Iwe[v],x=n[w],C=c[w]!==void 0?c[w]:u[w],S=wh(C),E=w===l?x.isActive:null;E===!1&&(y=v);let $=C===u[w]&&C!==c[w]&&S;if($&&r&&e.manuallyAnimateOnMount&&($=!1),x.protectedKeys={...p},!x.isActive&&E===null||!C&&!x.prevProp||Xv(C)||typeof C=="boolean")continue;const O=Dwe(x.prevProp,C);let N=O||w===l&&x.isActive&&!$&&S||v>y&&S,I=!1;const M=Array.isArray(C)?C:[C];let A=M.reduce(o(w),{});E===!1&&(A={});const{prevResolvedValues:z={}}=x,B={...z,...A},P=L=>{N=!0,h.has(L)&&(I=!0,h.delete(L)),x.needsAnimating[L]=!0;const V=e.getValue(L);V&&(V.liveStyle=!1)};for(const L in B){const V=A[L],j=z[L];if(p.hasOwnProperty(L))continue;let W=!1;NS(V)&&NS(j)?W=!w8(V,j):W=V!==j,W?V!=null?P(L):h.add(L):V!==void 0&&h.has(L)?P(L):x.protectedKeys[L]=!0}x.prevProp=C,x.prevResolvedValues=A,x.isActive&&(p={...p,...A}),r&&e.blockInitialAnimation&&(N=!1);const F=$&&O;N&&(!F||I)&&d.push(...M.map(L=>{const V={type:w};if(typeof L=="string"&&r&&!F&&e.manuallyAnimateOnMount&&e.parent){const{parent:j}=e,W=Mu(j,L);if(j.enteringChildren&&W){const{delayChildren:U}=W.transition||{};V.delay=b8(j.enteringChildren,e,U)}}return{animation:L,options:V}}))}if(h.size){const v={};if(typeof c.initial!="boolean"){const w=Mu(e,Array.isArray(c.initial)?c.initial[0]:c.initial);w&&w.transition&&(v.transition=w.transition)}h.forEach(w=>{const x=e.getBaseTarget(w),C=e.getValue(w);C&&(C.liveStyle=!0),v[w]=x??null}),d.push({animation:v})}let b=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?t(d):Promise.resolve()}function s(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(h=>{var p;return(p=h.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const u=a(l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:a,setActive:s,setAnimateFunction:i,getState:()=>n,reset:()=>{n=x8(),r=!0}}}function Dwe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!w8(t,e):!1}function jl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function x8(){return{animate:jl(!0),whileInView:jl(),whileHover:jl(),whileTap:jl(),whileDrag:jl(),whileFocus:jl(),exit:jl()}}class Bs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Lwe extends Bs{constructor(t){super(t),t.animationState||(t.animationState=Awe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xv(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Rwe=0;class kwe extends Bs{constructor(){super(...arguments),this.id=Rwe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Fwe={animation:{Feature:Lwe},exit:{Feature:kwe}};function xh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sh(e){return{point:{x:e.pageX,y:e.pageY}}}const Bwe=e=>t=>hS(t)&&e(t,Sh(t));function Eh(e,t,n,r){return xh(e,t,Bwe(n),r)}const S8=1e-4,Vwe=1-S8,zwe=1+S8,E8=.01,jwe=0-E8,Hwe=0+E8;function lo(e){return e.max-e.min}function Wwe(e,t,n){return Math.abs(e-t)<=n}function $8(e,t,n,r=.5){e.origin=r,e.originPoint=jn(t.min,t.max,e.origin),e.scale=lo(n)/lo(t),e.translate=jn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Vwe&&e.scale<=zwe||isNaN(e.scale))&&(e.scale=1),(e.translate>=jwe&&e.translate<=Hwe||isNaN(e.translate))&&(e.translate=0)}function $h(e,t,n,r){$8(e.x,t.x,n.x,r?r.originX:void 0),$8(e.y,t.y,n.y,r?r.originY:void 0)}function _8(e,t,n){e.min=n.min+t.min,e.max=e.min+lo(t)}function Uwe(e,t,n){_8(e.x,t.x,n.x),_8(e.y,t.y,n.y)}function O8(e,t,n){e.min=t.min-n.min,e.max=e.min+lo(t)}function _h(e,t,n){O8(e.x,t.x,n.x),O8(e.y,t.y,n.y)}function si(e){return[e("x"),e("y")]}const N8=({current:e})=>e?e.ownerDocument.defaultView:null,T8=(e,t)=>Math.abs(e-t);function qwe(e,t){const n=T8(e.x,t.x),r=T8(e.y,t.y);return Math.sqrt(n**2+r**2)}class I8{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=AS(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,y=qwe(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!y)return;const{point:b}=h,{timestamp:v}=Hr;this.history.push({...b,timestamp:v});const{onStart:w,onMove:x}=this.handlers;p||(w&&w(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=MS(p,this.transformPagePoint),Rn.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:y,onSessionEnd:b,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=AS(h.type==="pointercancel"?this.lastMoveEventInfo:MS(p,this.transformPagePoint),this.history);this.startEvent&&y&&y(h,w),b&&b(h,w)},!hS(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=o||window;const s=Sh(t),l=MS(s,this.transformPagePoint),{point:c}=l,{timestamp:u}=Hr;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,AS(l,this.history)),this.removeListeners=fh(Eh(this.contextWindow,"pointermove",this.handlePointerMove),Eh(this.contextWindow,"pointerup",this.handlePointerUp),Eh(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Rs(this.updatePoint)}}function MS(e,t){return t?{point:t(e.point)}:e}function P8(e,t){return{x:e.x-t.x,y:e.y-t.y}}function AS({point:e},t){return{point:e,delta:P8(e,M8(t)),offset:P8(e,Gwe(t)),velocity:Kwe(t,.1)}}function Gwe(e){return e[0]}function M8(e){return e[e.length-1]}function Kwe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=M8(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Hi(t)));)n--;if(!r)return{x:0,y:0};const i=ya(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Xwe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?jn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?jn(n,e,r.max):Math.min(e,n)),e}function A8(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Ywe(e,{top:t,left:n,bottom:r,right:o}){return{x:A8(e.x,n,o),y:A8(e.y,t,r)}}function D8(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Qwe(e,t){return{x:D8(e.x,t.x),y:D8(e.y,t.y)}}function Zwe(e,t){let n=.5;const r=lo(e),o=lo(t);return o>r?n=hh(t.min,t.max-r,e.min):r>o&&(n=hh(e.min,e.max-o,t.min)),Ka(0,1,n)}function Jwe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const DS=.35;function eCe(e=DS){return e===!1?e=0:e===!0&&(e=DS),{x:L8(e,"left","right"),y:L8(e,"top","bottom")}}function L8(e,t,n){return{min:R8(e,t),max:R8(e,n)}}function R8(e,t){return typeof e=="number"?e:e[t]||0}const tCe=new WeakMap;class nCe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=or(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Sh(d).point)},a=(d,h)=>{const{drag:p,dragPropagation:y,onDragStart:b}=this.getProps();if(p&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=p1e(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),si(w=>{let x=this.getAxisMotionValue(w).get()||0;if(ba.test(x)){const{projection:C}=this.visualElement;if(C&&C.layout){const S=C.layout.layoutBox[w];S&&(x=lo(S)*(parseFloat(x)/100))}}this.originPoint[w]=x}),b&&Rn.postRender(()=>b(d,h)),TS(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},s=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:y,onDirectionLock:b,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:w}=h;if(y&&this.currentDirection===null){this.currentDirection=rCe(w),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",h.point,w),this.updateAxis("y",h.point,w),this.visualElement.render(),v&&v(d,h)},l=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h,this.stop(d,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>si(d=>{var h;return this.getAnimationState(d)==="paused"&&((h=this.getAxisMotionValue(d).animation)==null?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new I8(t,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:N8(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:a}=o;this.startAnimation(a);const{onDragEnd:s}=this.getProps();s&&Rn.postRender(()=>s(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Jv(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Xwe(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,o=this.constraints;t&&Nu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Ywe(r.layoutBox,t):this.constraints=!1,this.elastic=eCe(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&si(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Jwe(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Nu(t))return!1;const r=t.current;Xa(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=owe(r,o.root,this.visualElement.getTransformPagePoint());let a=Qwe(o.layout.layoutBox,i);if(n){const s=n(twe(a));this.hasMutatedConstraints=!!s,s&&(a=t8(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},c=si(u=>{if(!Jv(u,n,this.currentDirection))return;let d=l&&l[u]||{};a&&(d={min:0,max:0});const h=o?200:1e6,p=o?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,y)});return Promise.all(c).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return TS(this.visualElement,t),r.start(IS(t,r,0,n,this.visualElement,!1))}stopAnimation(){si(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){si(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){si(n=>{const{drag:r}=this.getProps();if(!Jv(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:s}=o.layout.layoutBox[n];i.set(t[n]-jn(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Nu(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};si(a=>{const s=this.getAxisMotionValue(a);if(s&&this.constraints!==!1){const l=s.get();o[a]=Zwe({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),si(a=>{if(!Jv(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:c}=this.constraints[a];s.set(jn(l,c,o[a]))})}addListeners(){if(!this.visualElement.current)return;tCe.set(this.visualElement,this);const t=this.visualElement.current,n=Eh(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Nu(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Rn.read(r);const a=xh(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(si(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=DS,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:s}}}function Jv(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function rCe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class oCe extends Bs{constructor(t){super(t),this.removeGroupControls=ai,this.removeListeners=ai,this.controls=new nCe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ai}unmount(){this.removeGroupControls(),this.removeListeners()}}const k8=e=>(t,n)=>{e&&Rn.postRender(()=>e(t,n))};class iCe extends Bs{constructor(){super(...arguments),this.removePointerDownListener=ai}onPointerDown(t){this.session=new I8(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:N8(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:k8(t),onStart:k8(n),onMove:r,onEnd:(i,a)=>{delete this.session,o&&Rn.postRender(()=>o(i,a))}}}mount(){this.removePointerDownListener=Eh(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const e0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function F8(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Oh={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(St.test(e))e=parseFloat(e);else return e;const n=F8(e,t.target.x),r=F8(e,t.target.y);return`${n}% ${r}%`}},aCe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Fs.parse(e);if(o.length>5)return r;const i=Fs.createTransformer(e),a=typeof o[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;o[0+a]/=s,o[1+a]/=l;const c=jn(s,l,.5);return typeof o[2+a]=="number"&&(o[2+a]/=c),typeof o[3+a]=="number"&&(o[3+a]/=c),i(o)}};let LS=!1;class sCe extends T.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;I1e(lCe),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),LS&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),e0.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,LS=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||Rn.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),fS.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;LS=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function B8(e){const[t,n]=S1e(),r=T.useContext(OL);return k.jsx(sCe,{...e,layoutGroup:r,switchLayoutGroup:T.useContext(JR),isPresent:t,safeToRemove:n})}const lCe={borderRadius:{...Oh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Oh,borderTopRightRadius:Oh,borderBottomLeftRadius:Oh,borderBottomRightRadius:Oh,boxShadow:aCe};function cCe(e,t,n){const r=Xr(e)?e:_u(e);return r.start(IS("",r,t,n)),r.animation}const uCe=(e,t)=>e.depth-t.depth;class dCe{constructor(){this.children=[],this.isDirty=!1}add(t){Nx(this.children,t),this.isDirty=!0}remove(t){Tx(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(uCe),this.isDirty=!1,this.children.forEach(t)}}function fCe(e,t){const n=So.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Rs(r),e(i-t))};return Rn.setup(r,!0),()=>Rs(r)}const V8=["TopLeft","TopRight","BottomLeft","BottomRight"],hCe=V8.length,z8=e=>typeof e=="string"?parseFloat(e):e,j8=e=>typeof e=="number"||St.test(e);function pCe(e,t,n,r,o,i){o?(e.opacity=jn(0,n.opacity??1,mCe(r)),e.opacityExit=jn(t.opacity??1,0,gCe(r))):i&&(e.opacity=jn(t.opacity??1,n.opacity??1,r));for(let a=0;a<hCe;a++){const s=`border${V8[a]}Radius`;let l=H8(t,s),c=H8(n,s);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||j8(l)===j8(c)?(e[s]=Math.max(jn(z8(l),z8(c),r),0),(ba.test(c)||ba.test(l))&&(e[s]+="%")):e[s]=c}(t.rotate||n.rotate)&&(e.rotate=jn(t.rotate||0,n.rotate||0,r))}function H8(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const mCe=W8(0,.5,BL),gCe=W8(.5,.95,ai);function W8(e,t,n){return r=>r<e?0:r>t?1:n(hh(e,t,r))}function U8(e,t){e.min=t.min,e.max=t.max}function li(e,t){U8(e.x,t.x),U8(e.y,t.y)}function q8(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function G8(e,t,n,r,o){return e-=t,e=Zv(e,1/n,r),o!==void 0&&(e=Zv(e,1/o,r)),e}function vCe(e,t=0,n=1,r=.5,o,i=e,a=e){if(ba.test(t)&&(t=parseFloat(t),t=jn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=jn(i.min,i.max,r);e===i&&(s-=t),e.min=G8(e.min,t,n,s,o),e.max=G8(e.max,t,n,s,o)}function K8(e,t,[n,r,o],i,a){vCe(e,t[n],t[r],t[o],t.scale,i,a)}const yCe=["x","scaleX","originX"],bCe=["y","scaleY","originY"];function X8(e,t,n,r){K8(e.x,t,yCe,n?n.x:void 0,r?r.x:void 0),K8(e.y,t,bCe,n?n.y:void 0,r?r.y:void 0)}function Y8(e){return e.translate===0&&e.scale===1}function Q8(e){return Y8(e.x)&&Y8(e.y)}function Z8(e,t){return e.min===t.min&&e.max===t.max}function wCe(e,t){return Z8(e.x,t.x)&&Z8(e.y,t.y)}function J8(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ek(e,t){return J8(e.x,t.x)&&J8(e.y,t.y)}function tk(e){return lo(e.x)/lo(e.y)}function nk(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class CCe{constructor(){this.members=[]}add(t){Nx(this.members,t),t.scheduleRender()}remove(t){if(Tx(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function xCe(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((o||i||a)&&(r=`translate3d(${o}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:h,skewX:p,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),y&&(r+=`skewY(${y}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(r+=`scale(${s}, ${l})`),r||"none"}const RS=["","X","Y","Z"],SCe=1e3;let ECe=0;function kS(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function rk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=v8(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Rn,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&rk(r)}function ok({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},s=t==null?void 0:t()){this.id=ECe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(OCe),this.nodes.forEach(PCe),this.nodes.forEach(MCe),this.nodes.forEach(NCe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new dCe)}addEventListener(a,s){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Mx),this.eventHandlers.get(a).add(s)}notifyListeners(a,...s){const l=this.eventHandlers.get(a);l&&l.notify(...s)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=kR(a)&&!w1e(a),this.instance=a;const{layoutId:s,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||s)&&(this.isLayoutDirty=!0),e){let u,d=0;const h=()=>this.root.updateBlockedByResize=!1;Rn.read(()=>{d=window.innerWidth}),e(a,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=fCe(h,250),e0.hasAnimatedSinceResize&&(e0.hasAnimatedSinceResize=!1,this.nodes.forEach(sk)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&c&&(s||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||kCe,{onLayoutAnimationStart:b,onLayoutAnimationComplete:v}=c.getProps(),w=!this.targetLayout||!ek(this.targetLayout,p),x=!d&&h;if(this.options.layoutRoot||this.resumeFrom||x||d&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...cS(y,"layout"),onPlay:b,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(u,x)}else d||sk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Rs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ACe),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&rk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ik);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ak);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ICe),this.nodes.forEach($Ce),this.nodes.forEach(_Ce)):this.nodes.forEach(ak),this.clearAllSnapshots();const s=So.now();Hr.delta=Ka(0,1e3/60,s-Hr.timestamp),Hr.timestamp=s,Hr.isProcessing=!0,Rx.update.process(Hr),Rx.preRender.process(Hr),Rx.render.process(Hr),Hr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,fS.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(TCe),this.sharedNodes.forEach(DCe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Rn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Rn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!lo(this.snapshot.measuredBox.x)&&!lo(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=or(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(s=!1),s&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!Q8(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;a&&this.instance&&(s||zl(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const s=this.measurePageBox();let l=this.removeElementScroll(s);return a&&(l=this.removeTransform(l)),FCe(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:a}=this.options;if(!a)return or();const s=a.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(BCe))){const{scroll:u}=this.root;u&&(Tu(s.x,u.offset.x),Tu(s.y,u.offset.y))}return s}removeElementScroll(a){var l;const s=or();if(li(s,a),(l=this.scroll)!=null&&l.wasRoot)return s;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&li(s,a),Tu(s.x,d.offset.x),Tu(s.y,d.offset.y))}return s}applyTransform(a,s=!1){const l=or();li(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];!s&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Iu(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),zl(u.latestValues)&&Iu(l,u.latestValues)}return zl(this.latestValues)&&Iu(l,this.latestValues),l}removeTransform(a){const s=or();li(s,a);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!zl(c.latestValues))continue;$S(c.latestValues)&&c.updateSnapshot();const u=or(),d=c.measurePageBox();li(u,d),X8(s,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return zl(this.latestValues)&&X8(s,this.latestValues),s}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}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!==Hr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var h;const s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==s;if(!(a||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Hr.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=or(),this.relativeTargetOrigin=or(),_h(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),li(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=or(),this.targetWithTransforms=or()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Uwe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):li(this.target,this.layout.layoutBox),i8(this.target,this.targetDelta)):li(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=or(),this.relativeTargetOrigin=or(),_h(this.relativeTargetOrigin,this.target,p.target),li(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||$S(this.parent.latestValues)||n8(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var y;const a=this.getLead(),s=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Hr.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;li(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;rwe(this.layoutCorrected,this.treeScale,this.path,s),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=or());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(q8(this.prevProjectionDelta.x,this.projectionDelta.x),q8(this.prevProjectionDelta.y,this.projectionDelta.y)),$h(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!nk(this.projectionDelta.x,this.prevProjectionDelta.x)||!nk(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var s;if((s=this.options.visualElement)==null||s.scheduleRender(),a){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Pu(),this.projectionDelta=Pu(),this.projectionDeltaWithTransform=Pu()}setAnimationOrigin(a,s=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Pu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const h=or(),p=l?l.source:void 0,y=this.layout?this.layout.source:void 0,b=p!==y,v=this.getStack(),w=!v||v.members.length<=1,x=!!(b&&!w&&this.options.crossfade===!0&&!this.path.some(RCe));this.animationProgress=0;let C;this.mixTargetDelta=S=>{const E=S/1e3;lk(d.x,a.x,E),lk(d.y,a.y,E),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_h(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),LCe(this.relativeTarget,this.relativeTargetOrigin,h,E),C&&wCe(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=or()),li(C,this.relativeTarget)),b&&(this.animationValues=u,pCe(u,c,this.latestValues,E,x,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var s,l,c;this.notifyListeners("animationStart"),(s=this.currentAnimation)==null||s.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Rs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rn.update(()=>{e0.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_u(0)),this.currentAnimation=cCe(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),a.onUpdate&&a.onUpdate(u)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(SCe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:c,latestValues:u}=a;if(!(!s||!l||!c)){if(this!==a&&this.layout&&c&&hk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||or();const d=lo(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+d;const h=lo(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+h}li(s,l),Iu(s,u),$h(this.projectionDeltaWithTransform,this.layoutCorrected,s,u)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new CCe),this.sharedNodes.get(a).add(s);const c=s.options.initialPromotionConfig;s.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())==null?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())==null?void 0:s.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;const c={};l.z&&kS("z",a,c,this.animationValues);for(let u=0;u<RS.length;u++)kS(`rotate${RS[u]}`,a,c,this.animationValues),kS(`skew${RS[u]}`,a,c,this.animationValues);a.render();for(const u in c)a.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);a.scheduleRender()}applyProjectionStyles(a,s){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Qv(s==null?void 0:s.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Qv(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!zl(this.latestValues)&&(a.transform=l?l({},""):"none",this.hasProjected=!1);return}a.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=xCe(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),a.transform=d;const{x:h,y:p}=this.projectionDelta;a.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const y in Ch){if(u[y]===void 0)continue;const{correct:b,applyTo:v,isCSSVariable:w}=Ch[y],x=d==="none"?u[y]:b(u[y],c);if(v){const C=v.length;for(let S=0;S<C;S++)a[v[S]]=x}else w?this.options.visualElement.renderState.vars[y]=x:a[y]=x}this.options.layoutId&&(a.pointerEvents=c===this?Qv(s==null?void 0:s.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var s;return(s=a.currentAnimation)==null?void 0:s.stop()}),this.root.nodes.forEach(ik),this.root.sharedNodes.clear()}}}function $Ce(e){e.updateLayout()}function _Ce(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i==="size"?si(d=>{const h=a?t.measuredBox[d]:t.layoutBox[d],p=lo(h);h.min=r[d].min,h.max=h.min+p}):hk(i,t.layoutBox,r)&&si(d=>{const h=a?t.measuredBox[d]:t.layoutBox[d],p=lo(r[d]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const s=Pu();$h(s,r,t.layoutBox);const l=Pu();a?$h(l,e.applyTransform(o,!0),t.measuredBox):$h(l,r,t.layoutBox);const c=!Q8(s);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:p}=d;if(h&&p){const y=or();_h(y,t.layoutBox,h.layoutBox);const b=or();_h(b,r,p.layoutBox),ek(y,b)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=y,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:s,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function OCe(e){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 NCe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function TCe(e){e.clearSnapshot()}function ik(e){e.clearMeasurements()}function ak(e){e.isLayoutDirty=!1}function ICe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function sk(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function PCe(e){e.resolveTargetDelta()}function MCe(e){e.calcProjection()}function ACe(e){e.resetSkewAndRotation()}function DCe(e){e.removeLeadSnapshot()}function lk(e,t,n){e.translate=jn(t.translate,0,n),e.scale=jn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ck(e,t,n,r){e.min=jn(t.min,n.min,r),e.max=jn(t.max,n.max,r)}function LCe(e,t,n,r){ck(e.x,t.x,n.x,r),ck(e.y,t.y,n.y,r)}function RCe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const kCe={duration:.45,ease:[.4,0,.1,1]},uk=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dk=uk("applewebkit/")&&!uk("chrome/")?Math.round:ai;function fk(e){e.min=dk(e.min),e.max=dk(e.max)}function FCe(e){fk(e.x),fk(e.y)}function hk(e,t,n){return e==="position"||e==="preserve-aspect"&&!Wwe(tk(t),tk(n),.2)}function BCe(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const VCe=ok({attachResizeListener:(e,t)=>xh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),FS={current:void 0},pk=ok({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!FS.current){const e=new VCe({});e.mount(window),e.setOptions({layoutScroll:!0}),FS.current=e}return FS.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zCe={pan:{Feature:iCe},drag:{Feature:oCe,ProjectionNode:pk,MeasureLayout:B8}};function mk(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Rn.postRender(()=>i(t,Sh(t)))}class jCe extends Bs{mount(){const{current:t}=this.node;t&&(this.unmount=m1e(t,(n,r)=>(mk(this.node,r,"Start"),o=>mk(this.node,o,"End"))))}unmount(){}}class HCe extends Bs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=fh(xh(this.node.current,"focus",()=>this.onFocus()),xh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function gk(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Rn.postRender(()=>i(t,Sh(t)))}class WCe extends Bs{mount(){const{current:t}=this.node;t&&(this.unmount=b1e(t,(n,r)=>(gk(this.node,r,"Start"),(o,{success:i})=>gk(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const BS=new WeakMap,VS=new WeakMap,UCe=e=>{const t=BS.get(e.target);t&&t(e)},qCe=e=>{e.forEach(UCe)};function GCe({root:e,...t}){const n=e||document;VS.has(n)||VS.set(n,{});const r=VS.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(qCe,{root:e,...t})),r[o]}function KCe(e,t,n){const r=GCe(t);return BS.set(e,n),r.observe(e),()=>{BS.delete(e),r.unobserve(e)}}const XCe={some:0,all:1};class YCe extends Bs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:XCe[o]},s=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return KCe(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(QCe(t,n))&&this.startObserver()}unmount(){}}function QCe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ZCe={...Fwe,...{inView:{Feature:YCe},tap:{Feature:WCe},focus:{Feature:HCe},hover:{Feature:jCe}},...zCe,...{layout:{ProjectionNode:pk,MeasureLayout:B8}}},JCe=ewe(ZCe,hwe),Nh=({children:e})=>k.jsx(JCe.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.18,ease:"easeOut"},children:e}),exe=({id:e,data:t})=>k.jsxs(Nh,{children:[k.jsx(ro,{type:"source",position:at.Right}),k.jsx(_L,{id:e,data:t})]});var txe="scripts_editor_1b2l0x40",nxe="scripts_editor_1b2l0x41",vk="scripts_editor_1b2l0x42",yk="scripts_editor_1b2l0x43",bk="scripts_editor_1b2l0x44",wk="scripts_editor_1b2l0x45",rxe="scripts_editor_1b2l0x46",oxe="scripts_editor_1b2l0x49",Ck="scripts_editor_1b2l0x4a",xk="scripts_editor_1b2l0x4d";const ixe=()=>k.jsxs(k.Fragment,{children:[k.jsx(hr.Text,{strong:!0,children:"Cài đặt tổng đài"}),k.jsx($t.Item,{label:"Chọn nhánh nội bộ",name:["external","value"],style:{marginBottom:12},children:k.jsx(Vr,{placeholder:"Nhập số điện thoại"})}),k.jsx($t.Item,{noStyle:!0,name:["external","maximum_try"],children:k.jsx(pg,{addonBefore:"Chờ tối đa",addonAfter:"giây",min:1,max:300,placeholder:"30",style:{width:"100%"}})})]}),axe=()=>k.jsxs(k.Fragment,{children:[k.jsx(hr.Text,{strong:!0,children:"Cài đặt tổng đài"}),k.jsx($t.Item,{label:"Chọn nhánh nội bộ",name:["internal","value"],style:{marginBottom:12},children:k.jsx(Vr,{placeholder:"Chọn nhánh nội bộ hoặc nhập số điện thoại"})}),k.jsx($t.Item,{noStyle:!0,name:["internal","maximum_try"],children:k.jsx(pg,{addonBefore:"Chờ tối đa",addonAfter:"giây",min:1,max:300,placeholder:"30",style:{width:"100%"}})})]}),sxe=({id:e})=>{const{getNode:t}=no(),{data:n}=t(e),r=n,[o]=$t.useForm(),[i,a]=T.useState(r.type),{infos:s}=tv(e),l=Bg(),c=d=>{l(e,d)},u=ha.debounce(()=>{o.submit()},500);return T.useEffect(()=>{o.setFieldsValue({...r}),a(r.type)},[r,o]),k.jsxs($t,{form:o,layout:"vertical",onFinish:c,onBlur:()=>{o.submit()},onChange:()=>{u()},children:[k.jsx($t.Item,{name:"type",noStyle:!0,children:k.jsx(Ew,{value:i,onChange:d=>{a(d)},options:[{label:"Tổng đài",value:ki.INTERNAL},{label:"Điện thoại",value:ki.EXTERNAL}],block:!0})}),k.jsxs(an,{direction:"vertical",size:8,style:{width:"100%",marginTop:16},children:[k.jsx(jr,{isOpen:i===ki.INTERNAL,children:k.jsx(axe,{})}),k.jsx(jr,{isOpen:i===ki.EXTERNAL,children:k.jsx(ixe,{})}),!ha.isEmpty(s)&&k.jsx(qa,{children:s.map(d=>k.jsx(Rc,{message:d.title,description:d.description,type:"info",showIcon:!0,closable:!0,style:{padding:"12px",margin:"12px 0"}},d.title))})]}),k.jsx($f,{}),k.jsx(jS,{id:e}),k.jsx("div",{style:{height:"200px"}})]})},zS=({id:e,data:t,mini:n,group:r})=>{const{displayComponent:o}=kg(),i=t.title||"Chuyển máy",a=t.type||ki.INTERNAL,s=cO(),l=u=>{var d;(d=u.target)!=null&&d.closest("button")||(u.stopPropagation(),u.preventDefault(),o(k.jsx(sxe,{id:e}),"Cài đặt chuyển máy"),s(e))},c=T.useMemo(()=>a===ki.INTERNAL?"Tổng đài":a===ki.EXTERNAL?"Điện thoại":"UNKNOWN",[a]);return n?k.jsx("div",{className:nxe,children:k.jsx("div",{className:vk,children:k.jsxs("div",{className:yk,children:[k.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[k.jsx("span",{className:bk,children:k.jsx(iN,{})}),k.jsx("span",{className:wk,children:i})]}),k.jsx("div",{className:rxe,children:c})]})})}):k.jsx("div",{className:txe,onClick:l,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&l(u)},children:k.jsxs("div",{className:vk,children:[k.jsxs("div",{className:yk,children:[k.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[k.jsx("span",{className:bk,children:k.jsx(eue,{})}),k.jsx("span",{className:wk,children:i}),k.jsx(Vg,{id:e,color:In.icon.transferCall})]}),k.jsx(Fg,{id:e,deleteBtnColor:In.icon.transferCall})]}),!r&&k.jsx("div",{className:oxe,children:k.jsxs(qa,{children:[k.jsxs("div",{className:Ck,children:["Chuyển máy thành công",k.jsx(ro,{type:"target",id:`${e}_success`,position:at.Right,className:xk,style:{top:"50%",right:"8%"}})]}),k.jsxs("div",{className:Ck,children:["Chuyển máy thất bại",k.jsx(ro,{type:"target",id:`${e}_failed`,position:at.Right,className:xk,style:{top:"75%",right:"8%"}})]})]})})]})})},lxe=({data:e,id:t})=>k.jsxs(Nh,{children:[k.jsx(ro,{type:"target",position:at.Left}),k.jsx(zS,{id:t,data:e})]}),jS=({id:e})=>{const t=ZW(),n=eU(),{fitView:r}=no(),o=rH({id:e},t,n),i=nH({id:e},t,n),a=T.useCallback(c=>{r({nodes:[{id:c}],padding:.2,duration:700})},[r]),s=T.useCallback(c=>c.length===0?k.jsx(hr.Text,{type:"secondary",children:"Không có node nào"}):k.jsx(qa,{wrapperTag:u=>k.jsx(an,{...u,direction:"vertical",wrap:!0,size:0,style:{width:"100%"}}),children:c.map(u=>{const d={id:u.id,data:u.data,mini:!0};let h=k.jsx(hr.Text,{children:"NODE_NOT_IMPLEMENTED"},u.id);return u.type===We.START&&(h=k.jsx(_L,{...d})),u.type===We.SPEAK&&(h=k.jsx($x,{...d})),u.type===We.LISTEN&&(h=k.jsx(US,{...d})),u.type===We.TRANSFER&&(h=k.jsx(zS,{...d})),k.jsx("div",{onMouseDown:p=>(p.stopPropagation(),a(u.id)),style:{width:"100%",border:"none",background:"transparent",padding:0,margin:0,cursor:"pointer",outline:"none",textAlign:"left"},children:h},u.id)})}),[a]),l=[{key:"1",label:k.jsx("b",{children:"Mối quan hệ"}),children:k.jsxs(an,{wrap:!0,direction:"vertical",size:8,style:{width:"100%"},children:[k.jsx(hr.Text,{strong:!0,type:"secondary",children:"Node trước"}),s(o),k.jsx(hr.Text,{strong:!0,type:"secondary",children:"Node sau"}),s(i),k.jsx(hr.Text,{strong:!0,type:"secondary",children:"Node cha"}),s([])]}),styles:{header:{padding:"0px 0px 12px 0px"},body:{padding:0}}}];return k.jsx(eP,{ghost:!0,items:l})},cxe=()=>{const e=yg(),t=r=>{var a;const o={id:"condition-"+R5(),label:`Ý định ${(((a=e.getFieldValue("conditions"))==null?void 0:a.length)||0)+1}`,description:"",included_keywords:[],excluded_keywords:[],repeat_if_interrupted:!1,is_conversion:!1,...r},i=e.getFieldValue("conditions")||[];e.setFieldValue("conditions",[o,...i])},n=[{key:"new",label:"Mới",icon:k.jsx(hb,{}),onClick:t},{key:"interested",label:"Quan tâm",onClick:()=>t(Af.INTERESTED)},{key:"not-interested",label:"Không quan tâm",onClick:()=>t(Af.NOT_INTERESTED)},{key:"not-heard",label:"Không nghe rõ",onClick:()=>t(Af.NOT_HEARD)},{key:"busy",label:"Bận",onClick:()=>t(Af.BUSY)}];return k.jsx(mg,{menu:{items:n},placement:"bottomRight",trigger:["hover"],children:k.jsx(hn,{type:"primary",icon:k.jsx(pb,{}),size:"small"})})};function uxe(e){return au({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.0005 0C18.627 0 24 5.373 24 12.0005 24 18.627 18.627 24 11.9995 24 5.373 24 0 18.627 0 11.9995 0 5.373 5.373 0 12.0005 0zm0 19.826a7.8265 7.8265 0 10-.001-15.652C7.7133 4.2246 4.2653 7.7136 4.2653 12c0 4.2864 3.448 7.7754 7.7342 7.826h.001zm0-3.9853a3.8402 3.8402 0 110-7.6803c2.1204.0006 3.839 1.7197 3.839 3.8401s-1.7186 3.8396-3.839 3.8402z"},child:[]}]})(e)}var dxe="scripts_editor_18y8ld80",fxe="scripts_editor_18y8ld81",hxe="scripts_editor_18y8ld82",pxe="scripts_editor_18y8ld83",mxe="scripts_editor_18y8ld84",gxe="scripts_editor_18y8ld85",t0="scripts_editor_18y8ld86",HS="scripts_editor_18y8ld87",vxe="scripts_editor_18y8ld88",yxe="scripts_editor_18y8ld89";const bxe=({fieldName:e,isConversion:t})=>{const{isOpen:n,onOpen:r,onClose:o}=Df(),i=$t.useFormInstance(),[a,s]=T.useState(!1),l=T.useMemo(()=>{var y;const p=i.getFieldValue("conditions")||[];return((y=p==null?void 0:p[e])==null?void 0:y.label)??""},[e,i]),[c,u]=T.useState(l),d=({key:p})=>{if(p==="conversion"){const y=i.getFieldValue("conditions")||[],b=y.map(v=>{var w;return v.id===((w=y[e])==null?void 0:w.id)?{...v,is_conversion:!t}:v});i.setFieldValue("conditions",b),i.submit()}p==="rename"&&(u(l),o(),s(!0))},h=[{key:"template",icon:k.jsx(sN,{}),label:"Lưu thành mẫu",disabled:!0},{key:"conversion",icon:k.jsx(KO,{}),label:t?"Hủy làm chuyển đổi":"Đặt làm chuyển đổi"},{type:"divider"},{key:"rename",icon:k.jsx(Kp,{}),label:"Đổi tên nhãn"}];return k.jsx(mg,{menu:{items:h,onClick:d},open:n,onOpenChange:p=>{p?r():o()},children:k.jsx(Jm,{open:a,onOpenChange:p=>s(p),trigger:"click",placement:"bottomRight",content:k.jsxs(an,{direction:"vertical",size:8,className:vxe,children:[k.jsx(Vr,{autoFocus:!0,value:c,onChange:p=>u(p.target.value),placeholder:"Nhập nhãn mới",onPressEnter:()=>{const p=i.getFieldValue("conditions")||[],y=p.map(b=>{var v;return b.id===((v=p[e])==null?void 0:v.id)?{...b,label:c}:b});i.setFieldValue("conditions",y),s(!1),i.submit()}}),k.jsxs(an,{className:yxe,children:[k.jsx(hn,{size:"small",onClick:()=>s(!1),children:"Hủy"}),k.jsx(hn,{size:"small",type:"primary",onClick:()=>{const p=i.getFieldValue("conditions")||[],y=p.map(b=>{var v;return b.id===((v=p[e])==null?void 0:v.id)?{...b,label:c}:b});i.setFieldValue("conditions",y),s(!1),i.submit()},children:"Xác nhận"})]})]}),children:k.jsx(hn,{onClick:p=>{p.stopPropagation()},icon:k.jsx(rN,{}),type:"text",size:"small"})})})},{Text:Th}=hr,wxe=({field:e,condition:t,onDelete:n})=>k.jsx(eP,{defaultActiveKey:["1"],className:dxe,items:[{key:"1",label:k.jsxs("div",{className:fxe,children:[k.jsxs("div",{className:hxe,children:[k.jsx($t.Item,{name:[e.name,"label"],noStyle:!0,children:k.jsx(Th,{strong:!0,children:t.label})}),t.is_conversion&&k.jsx(jw,{color:"orange",className:pxe,children:k.jsxs(an,{size:4,direction:"horizontal",align:"center",children:[k.jsx(uxe,{className:mxe}),"Chuyển đổi"]})})]}),k.jsxs(an,{onClick:r=>r.stopPropagation(),children:[k.jsx(hn,{icon:k.jsx(Md,{}),type:"text",danger:!0,size:"small",onClick:()=>n(t.id)}),k.jsx(bxe,{fieldName:e.name,isConversion:t.is_conversion})]})]}),children:k.jsxs("div",{className:gxe,children:[k.jsx($t.Item,{name:[e.name,"description"],label:k.jsxs(an,{size:8,direction:"horizontal",align:"center",children:[k.jsx(Th,{children:"Nhận diện ý định bằng AI"}),k.jsx(hn,{type:"text",size:"small",children:k.jsx(cC,{className:HS})})]}),className:t0,children:k.jsx(Vr,{placeholder:"Mô tả ý định"})}),k.jsx($t.Item,{name:[e.name,"included_keywords"],label:k.jsxs(an,{size:8,direction:"horizontal",align:"center",children:[k.jsx(Th,{children:"Từ khoá"}),k.jsx(hn,{type:"text",size:"small",children:k.jsx(cC,{className:HS})})]}),className:t0,children:k.jsx(Vr,{placeholder:"Điền từ khoá"})}),k.jsx($t.Item,{name:[e.name,"excluded_keywords"],label:k.jsxs(an,{size:8,direction:"horizontal",align:"center",children:[k.jsx(Th,{children:"Từ khoá loại trừ"}),k.jsx(hn,{type:"text",size:"small",children:k.jsx(cC,{className:HS})})]}),className:t0,children:k.jsx(Vr,{placeholder:"Điền từ khoá loại trừ"})}),k.jsx($t.Item,{name:[e.name,"repeat_if_interrupted"],valuePropName:"checked",className:t0,children:k.jsxs(an,{direction:"horizontal",size:8,align:"start",children:[k.jsx($g,{}),k.jsx(Th,{children:"Quay trở lại câu đang nói nếu bị ngắt quãng"})]})})]})}]},e.key),{Text:WS}=hr,Cxe=({id:e})=>{const t=Bg(),{data:n}=Q5(e),r=n,[o]=$t.useForm(),i=$t.useWatch("conditions",o),a=c=>{t(e,c)},s=ha.debounce(()=>{o.submit()},500),l=c=>{const d=(o.getFieldValue("conditions")||[]).filter(h=>h.id!==c);o.setFieldValue("conditions",d),s()};return yO(()=>{r.conditions&&o.setFieldsValue(r)},[r.conditions]),k.jsx("div",{style:{height:"100%"},children:k.jsx($t,{form:o,layout:"vertical",initialValues:{...r},onFinish:a,onBlur:()=>{o.submit()},onChange:()=>{s()},children:k.jsxs(an,{direction:"vertical",size:"small",style:{width:"100%"},children:[k.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[k.jsx(WS,{strong:!0,children:"Nhận diện ý định khách hàng"}),k.jsx(cxe,{})]}),k.jsx($t.List,{name:"conditions",children:c=>ha.isEmpty(c)?k.jsx(Xm,{}):k.jsx(k.Fragment,{children:c.map((u,d)=>{var p;const h=i==null?void 0:i[d];return h?(p=h.id)!=null&&p.includes("condition-default-")?k.jsx(k.Fragment,{}):k.jsx(qa,{children:k.jsx(wxe,{field:u,condition:h,onDelete:l})},u.key):k.jsx(Fw,{})})})}),k.jsx($f,{}),k.jsxs(an,{direction:"vertical",size:16,style:{width:"100%"},children:[k.jsx($t.Item,{noStyle:!0,name:"maximum_retry",children:k.jsx(Vr,{addonBefore:"Kích hoạt mỗi TH tối đa",type:"number",min:0,addonAfter:"lần",style:{width:"100%"}})}),k.jsx($t.Item,{name:"is_global_node",valuePropName:"checked",children:k.jsxs(an,{direction:"horizontal",size:4,align:"start",children:[k.jsx($g,{}),k.jsxs(an,{direction:"vertical",size:4,style:{padding:"0 8px"},children:[k.jsx(WS,{children:"Node toàn cục"}),k.jsx(WS,{type:"secondary",children:"Cho phép node này được kích hoạt tại bất cứ thời điểm nào trong cuộc gọi"})]})]})})]}),k.jsx(jS,{id:e}),k.jsx("div",{style:{height:"100px"}})]})})})},{Text:Sk}=hr,US=({id:e,data:t,mini:n})=>{const{displayComponent:r}=kg(),o=i=>{var a;(a=i.target)!=null&&a.closest("button")||(i.stopPropagation(),i.preventDefault(),r(k.jsx(Cxe,{id:e}),"Cài đặt bot nghe"))};return n?k.jsxs(ua,{className:V3,styles:{body:{padding:"8px"}},children:[k.jsx("div",{className:`${j3}`,children:k.jsxs("div",{className:z3,children:[k.jsx(e3,{size:24,color:In.listenBlock.focus}),k.jsx(Sk,{strong:!0,className:H3,children:t.title})]})}),k.jsx("div",{className:W3})]}):k.jsxs(ua,{onClick:o,className:V3,styles:{body:{padding:"8px"}},children:[k.jsxs("div",{className:`${j3} drag-handle__custom`,children:[k.jsxs("div",{className:z3,children:[k.jsx(e3,{size:16,color:In.listenBlock.focus}),k.jsx(Sk,{strong:!0,className:H3,children:t.title}),k.jsx(Vg,{id:e,color:In.listenBlock.focus})]}),k.jsx(Fg,{id:e,deleteBtnColor:In.listenBlock.focus})]}),k.jsx("div",{className:W3,children:k.jsx(rfe,{NODE_ID:e})})]})},xxe=({data:e,id:t})=>k.jsxs(Nh,{children:[k.jsx(ro,{type:"target",position:at.Left}),k.jsx(US,{id:t,data:e})]}),Sxe=[We.SPEAK,We.TRANSFER],Exe=e=>{const t=W5(e);return{verifyAddable:T.useCallback(r=>{const o=Sxe.includes(r);let i=!0;const a=[];return o||(i=!1,a.push("Block này không hỗ trợ thêm vào nhóm")),t.filter(s=>s.type===We.SPEAK).length>0&&r===We.SPEAK&&(i=!1,a.push("Nhóm chỉ có thể chứa tối đa 1 block nói")),t.filter(s=>s.type===We.TRANSFER).length>0&&r===We.TRANSFER&&(i=!1,a.push("Nhóm chỉ có thể chứa tối đa 1 block chuyển máy")),{allowed:i,errors:a}},[t])}};var $xe="scripts_editor_dxvfua1",_xe="scripts_editor_dxvfua2",Oxe="scripts_editor_dxvfua3",Nxe="scripts_editor_dxvfua4",Txe="scripts_editor_dxvfua5 scripts_editor_dxvfua4";const{Text:Ek}=hr,Ixe=({id:e,data:t})=>{const[n]=sC(),{setNodes:r}=no(),{screenToFlowPosition:o}=no(),i=W5(e),{verifyAddable:a}=Exe(e),{error:s}=lC(),l=i.length>0,c=p=>{p.preventDefault(),p.dataTransfer.dropEffect="move"},u=p=>`${e}_${p.toLowerCase()}_${Mg()}`,d=p=>{if(p.preventDefault(),!n)return;const y=a(n);if(!y.allowed){y.errors.forEach(w=>{s({content:w,key:w})});return}const b=o({x:p.clientX,y:p.clientY}),v={id:u(n),type:n,position:b,data:{title:Mf[n],...Ag[n]},deletable:!0,...Dg[n],parentId:e,extent:"parent",hidden:!0};r(w=>w.concat(v))},h=T.useMemo(()=>i.map(p=>p.type===We.SPEAK?k.jsx($x,{...p,data:p.data,group:!0},p.id):p.type===We.LISTEN?k.jsx(US,{...p,data:p.data,group:!0},p.id):p.type===We.TRANSFER?k.jsx(zS,{...p,data:p.data,group:!0},p.id):k.jsx(k.Fragment,{})),[i]);return k.jsx("div",{children:k.jsxs(ua,{className:$xe,styles:{body:{padding:"8px",display:"flex",flex:1,flexDirection:"column",height:"100%",minHeight:"100%"}},children:[k.jsxs("div",{className:`${_xe} drag-handle__custom`,children:[k.jsxs("div",{className:Oxe,children:[k.jsx(H5,{size:16,color:In.common.black}),k.jsx(Ek,{strong:!0,children:t.title}),k.jsx(Vg,{id:e,color:In.common.black})]}),k.jsx(Fg,{id:e,deleteBtnColor:In.common.black})]}),k.jsx(an,{direction:"vertical",size:8,children:h}),k.jsx("button",{className:l?Nxe:Txe,onDragOver:c,onDrop:d,type:"button","data-group-drop-zone":"true",children:k.jsx(Ek,{children:"Thả block vào đây"})}),k.jsxs(an,{direction:"vertical",size:8,style:{marginTop:8},children:[k.jsxs(ua,{styles:{body:{padding:"12px"}},children:["Thực hiện thành công",k.jsx(ro,{type:"source",position:at.Right})]}),k.jsxs(ua,{styles:{body:{padding:"12px"}},children:["Thực hiện thất bại",k.jsx(ro,{type:"source",position:at.Right})]})]})]})})},Pxe=({data:e,id:t})=>k.jsxs(Nh,{children:[k.jsx(ro,{type:"target",position:at.Left}),k.jsx(Ixe,{id:t,data:e})]}),Mxe=({data:e,id:t})=>k.jsxs(Nh,{children:[k.jsx(ro,{type:"target",position:at.Left}),k.jsx($x,{id:t,data:e}),k.jsx(ro,{type:"source",position:at.Right})]}),$k={[We.SPEAK]:Mxe,[We.START]:exe,[We.LISTEN]:xxe,[We.TRANSFER]:lxe,[We.GROUP]:Pxe},n0=e=>{switch(e.type){case We.START:return In.startBlock.background;case We.SPEAK:return In.speakBlock.background;case We.LISTEN:return In.listenBlock.background;case We.TRANSFER:return In.icon.transferCall;case We.GET_DATA:case We.UPDATE_DATA:case We.ADD_DATA:return In.icon.getData;case We.HTTP_REQUEST:return In.icon.httpRequest;case We.CONDITION:return In.icon.condition;case We.NOTE:return In.common.gray;case We.GROUP:return In.groupBlock.background;default:return In.common.gray}},_k=[We.SPEAK,We.LISTEN,We.TRANSFER,We.GET_DATA,We.UPDATE_DATA,We.ADD_DATA,We.HTTP_REQUEST,We.CONDITION,We.NOTE,We.GROUP],qS=[{key:We.SPEAK,label:"Bot nói",icon:uN},{key:We.LISTEN,label:"Bot nghe",icon:UO},{key:We.TRANSFER,label:"Chuyển máy",icon:dN},{key:We.GET_DATA,label:"Lấy dữ liệu",icon:Gp},{key:We.UPDATE_DATA,label:`Cập nhật
|
|
401
401
|
dữ liệu`,icon:Gp},{key:We.ADD_DATA,label:"Thêm dữ liệu",icon:Gp},{key:We.HTTP_REQUEST,label:`HTTP
|
|
402
|
-
Request`,icon:WO},{key:We.CONDITION,label:"Điều kiện",icon:GO},{key:We.NOTE,label:"Gán biến",icon:nN},{key:We.GROUP,label:"Nhóm",icon:H5}],GS={[We.START]:"none",[We.SPEAK]:"#d7268a",[We.LISTEN]:"#d2691e",[We.TRANSFER]:"#20b2aa",[We.GET_DATA]:"#1890ff",[We.UPDATE_DATA]:"#1890ff",[We.ADD_DATA]:"#1890ff",[We.HTTP_REQUEST]:"#20b2aa",[We.CONDITION]:"#1890ff",[We.NOTE]:"#8a2be2",[We.GROUP]:"#000000"};var Axe="scripts_editor_223f7c0",Dxe="scripts_editor_223f7c2";const Lxe={button:({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:a,style:s,markerEnd:l,target:c})=>{const{isOpen:u,onOpen:d,onClose:h}=Df(),{setEdges:p,setNodes:y}=no(),[b,v,w]=by({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a}),x=[...qS.map(E=>({label:k.jsxs(an,{align:"center",size:8,children:[T.createElement(E.icon,{style:{color:GS[E.key]}}),E.label]}),key:E.key}))],C=E=>{E.preventDefault(),d()},S=({key:E})=>{const $=E,O={id:`${$.toLowerCase()}_${Mg()}`,type:$,position:{x:v,y:w},data:{title:Mf[$],...Ag[$]},deletable:!0,...Dg[$]};y(N=>N.concat(O)),Ok.includes($)?p(N=>{const I=N.map(M=>M.id===e?{...M,target:O.id}:M);if(c){const M={id:`${O.id}_${c}_${Mg()}`,source:O.id,target:c,type:"button"};I.push(M)}return I}):p(N=>N.filter(I=>I.id!==e)),h()};return k.jsxs(k.Fragment,{children:[k.jsx($d,{path:b,markerEnd:l,style:s??{}}),k.jsx(YW,{children:k.jsx(Ai,{title:"Thêm nút",children:k.jsx("div",{className:`${Axe} nodrag nopan ${u?Dxe:""}`,style:{transform:`translate(-50%, -50%) translate(${v}px,${w}px)`},children:k.jsx(mg,{onOpenChange:E=>{E?d():h()},menu:{items:x,onClick:S},open:u,trigger:["click"],children:k.jsx(hn,{onClick:C,type:"text",size:"large",style:{padding:4},children:k.jsx(hb,{style:{fontSize:24}})})})})})})]})}},Ok=[We.SPEAK];function Rxe(){const{getNodes:e,getEdges:t}=no(),n=lC();return{isValidConnection:T.useCallback(o=>{const i=e(),a=t(),s=i.find(l=>l.id===o.source);return i.find(l=>l.id===o.target),s.type===We.START&&a.filter(l=>l.source===o.source).length>0?(n.error({key:"start-node-only-one",content:"Bot bắt đầu chỉ có 1 đầu ra"}),!1):!0},[t,e,n])}}var kxe="scripts_editor_ohkkdt0",Nk="scripts_editor_ohkkdt2",Fxe="scripts_editor_ohkkdt3",Bxe="scripts_editor_ohkkdt4",Vxe="scripts_editor_ohkkdt5";const zxe=()=>{const[e,t]=sC(),{BLOCKS_ENABLED:n}=Bv(),r=(o,i)=>{t(i),o.dataTransfer.effectAllowed="move"};return ha.isEmpty(n)?k.jsx(k.Fragment,{}):k.jsx("div",{className:kxe,children:k.jsx(qa,{wrapperTag:o=>k.jsx(an,{...o,direction:"vertical",size:16}),children:qS.map(o=>{const i=o.icon,a=o.active,s=o.label.includes(`
|
|
403
|
-
`)||o.label.length>9;return
|
|
402
|
+
Request`,icon:WO},{key:We.CONDITION,label:"Điều kiện",icon:GO},{key:We.NOTE,label:"Gán biến",icon:nN},{key:We.GROUP,label:"Nhóm",icon:H5}],GS={[We.START]:"none",[We.SPEAK]:"#d7268a",[We.LISTEN]:"#d2691e",[We.TRANSFER]:"#20b2aa",[We.GET_DATA]:"#1890ff",[We.UPDATE_DATA]:"#1890ff",[We.ADD_DATA]:"#1890ff",[We.HTTP_REQUEST]:"#20b2aa",[We.CONDITION]:"#1890ff",[We.NOTE]:"#8a2be2",[We.GROUP]:"#000000"};var Axe="scripts_editor_223f7c0",Dxe="scripts_editor_223f7c2";const Lxe={button:({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:a,style:s,markerEnd:l,target:c})=>{const{isOpen:u,onOpen:d,onClose:h}=Df(),{setEdges:p,setNodes:y}=no(),[b,v,w]=by({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a}),x=[...qS.map(E=>({label:k.jsxs(an,{align:"center",size:8,children:[T.createElement(E.icon,{style:{color:GS[E.key]}}),E.label]}),key:E.key}))],C=E=>{E.preventDefault(),d()},S=({key:E})=>{const $=E,O={id:`${$.toLowerCase()}_${Mg()}`,type:$,position:{x:v,y:w},data:{title:Mf[$],...Ag[$]},deletable:!0,...Dg[$]};y(N=>N.concat(O)),Ok.includes($)?p(N=>{const I=N.map(M=>M.id===e?{...M,target:O.id}:M);if(c){const M={id:`${O.id}_${c}_${Mg()}`,source:O.id,target:c,type:"button"};I.push(M)}return I}):p(N=>N.filter(I=>I.id!==e)),h()};return k.jsxs(k.Fragment,{children:[k.jsx($d,{path:b,markerEnd:l,style:s??{}}),k.jsx(YW,{children:k.jsx(Ai,{title:"Thêm nút",children:k.jsx("div",{className:`${Axe} nodrag nopan ${u?Dxe:""}`,style:{transform:`translate(-50%, -50%) translate(${v}px,${w}px)`},children:k.jsx(mg,{onOpenChange:E=>{E?d():h()},menu:{items:x,onClick:S},open:u,trigger:["click"],children:k.jsx(hn,{onClick:C,type:"text",size:"large",style:{padding:4},children:k.jsx(hb,{style:{fontSize:24}})})})})})})]})}},Ok=[We.SPEAK];function Rxe(){const{getNodes:e,getEdges:t}=no(),n=lC();return{isValidConnection:T.useCallback(o=>{const i=e(),a=t(),s=i.find(l=>l.id===o.source);return i.find(l=>l.id===o.target),s.type===We.START&&a.filter(l=>l.source===o.source).length>0?(n.error({key:"start-node-only-one",content:"Bot bắt đầu chỉ có 1 đầu ra"}),!1):!0},[t,e,n])}}var kxe="scripts_editor_ohkkdt0",Nk="scripts_editor_ohkkdt2",Fxe="scripts_editor_ohkkdt3",Bxe="scripts_editor_ohkkdt4",Vxe="scripts_editor_ohkkdt5";const zxe=()=>{const[e,t]=sC(),{BLOCKS_ENABLED:n}=Bv(),r=(o,i)=>{t(i),o.dataTransfer.effectAllowed="move"};return ha.isEmpty(n)?k.jsx(k.Fragment,{}):k.jsx("div",{className:kxe,children:k.jsx(qa,{wrapperTag:o=>k.jsx(an,{...o,direction:"vertical",size:16}),children:qS.filter(o=>n==null?void 0:n.includes(o.key)).map(o=>{const i=o.icon,a=o.active,s=o.label.includes(`
|
|
403
|
+
`)||o.label.length>9;return k.jsxs(hn,{draggable:!0,type:"text",className:a?`${Nk} ${Fxe}`:Nk,onDragStart:l=>r(l,o.key),style:{minHeight:s?"62px":"54px"},children:[k.jsx("span",{className:Bxe,style:{color:GS[o.key]},children:k.jsx(i,{})}),k.jsx("span",{className:Vxe,children:o.label})]},o.key)})})})};var jxe="scripts_editor_3c0va90",Hxe="scripts_editor_3c0va91",Wxe="scripts_editor_3c0va93";const Uxe=e=>`${e.toLowerCase()}_${Mg()}`,qxe=T.forwardRef((e,t)=>{const{reactFlowRef:n}=Bv(),[r,o,i]=tU(k5),[a,s,l]=nU(F5),[c,u]=T.useState(),{screenToFlowPosition:d,fitView:h}=no(),{isValidConnection:p}=Rxe(),[y]=sC(),b=TC(),v=e.onAlertsChange||(()=>{}),w=T.useCallback($=>s(O=>M2({...$,type:"button"},O)),[s]),x=T.useCallback($=>{u($)},[]),C=T.useCallback($=>{$.preventDefault(),$.dataTransfer.dropEffect="move"},[]),S=T.useCallback($=>{if($.preventDefault(),!y||$.target.closest('[data-group-drop-zone="true"]'))return;const I=d({x:$.clientX,y:$.clientY}),M={id:Uxe(y),type:y,position:I,data:{title:Mf[y],...Ag[y]},deletable:!0,...Dg[y]};o(A=>A.concat(M))},[d,y,o]),E=T.useCallback($=>{h({nodes:[{id:$}],padding:.2,duration:700})},[h]);return T.useImperativeHandle(t,()=>({getFlowJson:()=>c==null?void 0:c.toObject(),loadFlowJson:$=>{if(!$)return;const O=Array.isArray($.nodes)?$.nodes:[],N=Array.isArray($.edges)?$.edges:[];if(o(O),s(N),$.viewport&&c){const{x:I,y:M,zoom:A}=$.viewport;c.setViewport({x:I,y:M,zoom:A})}else c&&c.fitView()},moveToNode:$=>{E($)}})),yO(()=>{v(b)},[b]),k.jsx("div",{className:jxe,children:k.jsx("div",{className:Hxe,children:k.jsx("div",{className:Wxe,ref:n,children:k.jsxs(KW,{nodes:r,edges:a,nodeTypes:$k,edgeTypes:Lxe,onNodesChange:i,onEdgesChange:l,isValidConnection:p,onConnect:w,onInit:x,onDrop:S,onDragOver:C,fitView:!0,connectionMode:ll.Strict,children:[k.jsx(pU,{orientation:"horizontal"}),k.jsx(sU,{variant:"dots",gap:12,size:2}),k.jsx(OU,{nodeColor:n0,pannable:!0,zoomable:!0,maskColor:"#F7F7F7",nodeStrokeWidth:4,nodeStrokeColor:$=>n0($)?Or(n0($)).darken(.25).hex():"transparent",nodeBorderRadius:12}),k.jsx(zxe,{})]})})})})}),Gxe=T.forwardRef((e,t)=>k.jsx("section",{className:"scripts-editor-global",children:k.jsx(SL,{...e,BLOCKS_ENABLED:e.BLOCKS_ENABLED||_k,children:k.jsx(wV,{client:WU,children:k.jsx(qce,{children:k.jsx(lO,{children:k.jsx(Uce,{children:k.jsx(Qce,{children:k.jsx(qxe,{ref:t,onAlertsChange:e.onAlertsChange})})})})})})})}));Ct.AUTO_CONNECT_BLOCKS=Ok,Ct.BlockType=We,Ct.DEFAULT_SIDEBAR_BUTTONS=_k,Ct.INTENTS=Af,Ct.InstanceContextProvider=SL,Ct.SPEAK_TYPE=Yn,Ct.ScriptEditor=Gxe,Ct.TRANSFER_TYPE=ki,Ct.getNodeColor=n0,Ct.iconColors=GS,Ct.initialData=Ag,Ct.initialEdges=F5,Ct.initialNodeProps=Dg,Ct.initialNodes=k5,Ct.initialTitles=Mf,Ct.nodeTypes=$k,Ct.sidebarButtons=qS,Ct.useAlert=tv,Ct.useAlerts=TC,Ct.useInstanceContext=Bv,Object.defineProperty(Ct,Symbol.toStringTag,{value:"Module"})});
|