(self.webpackChunkextendify=self.webpackChunkextendify||[]).push([[701],{1984:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9307);const o=(0,r.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,r.cloneElement)(e,{width:t,height:t,...n,ref:o})}))},8184:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})})},4310:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})})},5024:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})})},7231:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})})},5202:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})})},6329:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",children:(0,o.jsx)(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-1 16v-2h2v2h-2zm2-3v-1.141A3.991 3.991 0 0016 10a4 4 0 00-8 0h2c0-1.103.897-2 2-2s2 .897 2 2-.897 2-2 2a1 1 0 00-1 1v2h2z"})})},3279:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})})},7713:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"})})},2395:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})})},802:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(444),o=n(5893);const i=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})})},5018:(e,t,n)=>{"use strict";var r=n(9196);const o=window.wp.domReady;var i=n.n(o),s=n(9307),a=n(3689),l=n(5736),c=n(7887),u=n(3773),d=n(6989),h=n.n(d),p=n(7403),m=n(6993),f=n(270),g=n(782),v=n(1984),y=n(7713),x=n(5024),w=n(424),b=n(4981),E=n(3967),S=n.n(E);const T=({text:e,reset:t})=>(0,r.createElement)("div",{className:"rounded-lg border border-solid border-red-500 bg-red-100 p-5"},(0,r.createElement)("p",{className:"m-0 mb-4 text-sm text-gray-800"},e),t&&(0,r.createElement)("p",{className:"m-0"},(0,r.createElement)("button",{type:"button",className:"cursor-pointer border-none bg-transparent p-0 underline",onClick:t},(0,l.__)("Please try again.","extendify-local")))),C=(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("g",{clipPath:"url(#clip0_2114_35675)"},(0,r.createElement)("path",{d:"M11.2266 6.0469V4.93948C11.0919 4.889 10.9613 4.82828 10.8359 4.75784C10.345 4.46641 9.97524 4.00815 9.79416 3.46671C9.61308 2.92526 9.63277 2.33675 9.84962 1.80862C9.97012 1.5206 10.1452 1.25862 10.3652 1.03713C10.5846 0.817735 10.8447 0.643251 11.1309 0.523459C11.4193 0.403518 11.7287 0.342425 12.041 0.343772C12.5103 0.343706 12.9689 0.48286 13.359 0.74362C13.7491 1.00438 14.0531 1.37502 14.2324 1.80862C14.4719 2.38837 14.4719 3.03941 14.2324 3.61917C14.1131 3.90723 13.9378 4.16878 13.7168 4.3887L13.7051 4.40042C13.566 4.53722 13.4113 4.65718 13.2442 4.75784C13.1202 4.83102 12.9894 4.89186 12.8535 4.93948V6.0469H18.416C19.2143 6.04948 19.9792 6.36788 20.5435 6.93255C21.1078 7.49722 21.4257 8.26227 21.4278 9.06058V9.50784H22.459C22.8681 9.50939 23.2599 9.67272 23.549 9.96217C23.8381 10.2516 24.0009 10.6437 24.002 11.0528V14.6407C24.0009 15.0497 23.8381 15.4418 23.549 15.7313C23.2599 16.0207 22.8681 16.184 22.459 16.1856H21.4336V16.5899C21.431 17.389 21.1122 18.1547 20.5467 18.7194C19.9812 19.2841 19.2152 19.602 18.416 19.6036H10.7852L6.21094 23.5313C6.16052 23.5746 6.10202 23.6075 6.03882 23.6281C5.97562 23.6487 5.90897 23.6566 5.84271 23.6514C5.77644 23.6461 5.71188 23.6278 5.65273 23.5974C5.59357 23.5671 5.54101 23.5254 5.49805 23.4747C5.41215 23.3745 5.36809 23.2451 5.37501 23.1133L5.61915 19.5977H5.57813C4.78086 19.5956 4.01681 19.2781 3.45287 18.7146C2.88893 18.151 2.57094 17.3871 2.56836 16.5899V16.1856H1.54297C1.13355 16.1846 0.74119 16.0215 0.451684 15.7319C0.162178 15.4424 -0.00092183 15.0501 -0.00195312 14.6407L-0.00195312 11.0528C-0.000924304 10.6437 0.161907 10.2516 0.450991 9.96217C0.740076 9.67272 1.13193 9.50939 1.54102 9.50784H2.56836V9.05862C2.56991 8.26068 2.88744 7.49583 3.45149 6.93141C4.01554 6.367 4.78019 6.04897 5.57813 6.0469H11.2266ZM16.1582 9.58597C16.5198 9.58597 16.8732 9.69319 17.1739 9.89406C17.4745 10.0949 17.7088 10.3805 17.8472 10.7145C17.9856 11.0485 18.0218 11.4161 17.9512 11.7707C17.8807 12.1254 17.7066 12.4511 17.4509 12.7068C17.1952 12.9624 16.8695 13.1366 16.5149 13.2071C16.1602 13.2776 15.7927 13.2414 15.4586 13.1031C15.1246 12.9647 14.8391 12.7304 14.6382 12.4297C14.4373 12.1291 14.3301 11.7757 14.3301 11.4141C14.3301 10.9292 14.5227 10.4643 14.8655 10.1214C15.2084 9.77857 15.6734 9.58597 16.1582 9.58597ZM7.8418 9.58597C8.20337 9.58597 8.55682 9.69319 8.85746 9.89406C9.15809 10.0949 9.39241 10.3805 9.53077 10.7145C9.66914 11.0485 9.70534 11.4161 9.6348 11.7707C9.56427 12.1254 9.39015 12.4511 9.13448 12.7068C8.87882 12.9624 8.55308 13.1366 8.19845 13.2071C7.84383 13.2776 7.47626 13.2414 7.14221 13.1031C6.80816 12.9647 6.52265 12.7304 6.32177 12.4297C6.1209 12.1291 6.01368 11.7757 6.01368 11.4141C6.01368 10.9292 6.20628 10.4643 6.54912 10.1214C6.89196 9.77857 7.35695 9.58597 7.8418 9.58597ZM9.0879 15.711C9.06032 15.6892 9.03541 15.6643 9.01368 15.6368C8.95038 15.5625 8.91453 15.4687 8.91212 15.3711C8.91035 15.2731 8.94204 15.1773 9.00196 15.0996C9.02434 15.0714 9.0499 15.0459 9.07813 15.0235C9.18557 14.9388 9.31767 14.8915 9.45442 14.8887C9.59117 14.8859 9.72511 14.9277 9.83595 15.0078C10.1697 15.2712 10.5402 15.4844 10.9356 15.6407C11.2762 15.7724 11.6387 15.8387 12.0039 15.836C12.3737 15.8281 12.7393 15.7554 13.084 15.6211C13.4841 15.4612 13.8616 15.2498 14.207 14.9922C14.3204 14.9149 14.4558 14.8766 14.5928 14.8829C14.7298 14.8893 14.8611 14.94 14.9668 15.0274C14.9933 15.0518 15.0175 15.0786 15.0391 15.1075C15.0965 15.1867 15.1254 15.2831 15.1211 15.3809C15.1128 15.4787 15.073 15.5712 15.0078 15.6446C14.9831 15.6727 14.9548 15.6977 14.9238 15.7188C14.4846 16.0434 14.0029 16.3063 13.4922 16.5C13.0218 16.6774 12.5242 16.7719 12.0215 16.7793C11.5182 16.7864 11.0179 16.7016 10.5449 16.5293C10.0237 16.3343 9.53556 16.0603 9.09766 15.7168L9.0879 15.711ZM18.4141 7.06253H5.57813C5.04903 7.06459 4.54222 7.27582 4.16826 7.65014C3.79431 8.02445 3.58358 8.53147 3.58203 9.06058V16.5899C3.58358 17.119 3.79431 17.626 4.16826 18.0003C4.54222 18.3746 5.04903 18.5859 5.57813 18.5879H6.19727C6.33117 18.5979 6.45571 18.6604 6.54384 18.7617C6.63197 18.863 6.67658 18.995 6.66797 19.1289L6.47266 21.9766L10.2422 18.7325C10.2891 18.6856 10.3448 18.6485 10.4062 18.6233C10.4676 18.5982 10.5333 18.5855 10.5996 18.586H18.4121C18.9412 18.5839 19.448 18.3727 19.822 17.9984C20.1959 17.6241 20.4067 17.117 20.4082 16.5879V9.05862C20.4072 8.52988 20.1968 8.02306 19.8231 7.649C19.4494 7.27494 18.9428 7.06408 18.4141 7.06253Z"})),(0,r.createElement)("defs",null,(0,r.createElement)("clipPath",{id:"clip0_2114_35675"},(0,r.createElement)("rect",{width:"24",height:"23.3106",transform:"translate(0 0.34375)"})))),P=(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M3.51 6.03L11.02 9.25L3.5 8.25L3.51 6.03ZM11.01 14.75L3.5 17.97V15.75L11.01 14.75ZM1.51 3L1.5 10L16.5 12L1.5 14L1.51 21L22.5 12L1.51 3Z"})),k=(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M14.1818 5H7.63636C7.03273 5 6.51636 5.36364 6.29818 5.88727L4.10182 11.0145C4.03636 11.1818 4 11.3564 4 11.5455V13C4 13.8 4.65455 14.4545 5.45455 14.4545H10.0436L9.35273 17.7782L9.33091 18.0109C9.33091 18.3091 9.45455 18.5855 9.65091 18.7818L10.4218 19.5455L15.2145 14.7527C15.4764 14.4909 15.6364 14.1273 15.6364 13.7273V6.45455C15.6364 5.65455 14.9818 5 14.1818 5ZM14.1818 13.7273L11.0255 16.8836L12 13H5.45455V11.5455L7.63636 6.45455H14.1818V13.7273ZM17.0909 5H20V13.7273H17.0909V5Z"})),A=(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M9.81818 19.5455H16.3636C16.9673 19.5455 17.4836 19.1818 17.7018 18.6582L19.8982 13.5309C19.9636 13.3636 20 13.1891 20 13V11.5455C20 10.7455 19.3455 10.0909 18.5455 10.0909H13.9564L14.6473 6.76727L14.6691 6.53455C14.6691 6.23636 14.5455 5.96 14.3491 5.76364L13.5782 5L8.78545 9.79273C8.52364 10.0545 8.36364 10.4182 8.36364 10.8182V18.0909C8.36364 18.8909 9.01818 19.5455 9.81818 19.5455ZM9.81818 10.8182L12.9745 7.66182L12 11.5455H18.5455V13L16.3636 18.0909H9.81818V10.8182ZM4 10.8182H6.90909V19.5455H4V10.8182Z"})),_=(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z"}));(0,r.createElement)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M15.5 4V11H5.67L4.5 12.17V4H15.5ZM16.5 2H3.5C2.95 2 2.5 2.45 2.5 3V17L6.5 13H16.5C17.05 13 17.5 12.55 17.5 12V3C17.5 2.45 17.05 2 16.5 2ZM21.5 6H19.5V15H6.5V17C6.5 17.55 6.95 18 7.5 18H18.5L22.5 22V7C22.5 6.45 22.05 6 21.5 6Z"}));var L=n(2200);const M=["siteId","partnerId","wpVersion","wpLanguage","devbuild","isBlockTheme","userId"],{showAIConsent:N,userGaveConsent:D}=w.y.getState(),O={...Object.fromEntries(Object.entries(window.extSharedData).filter((([e])=>M.includes(e)))),showAIConsent:N,userGaveConsent:D},R=({answerId:e})=>{const[t,n]=(0,s.useState)(void 0);return(0,s.useEffect)((()=>{e&&void 0!==t&&(({answerId:e,rating:t})=>{fetch(`${L.Yy}/api/chat/rate-answer`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({answerId:e,rating:t})})})({answerId:e,rating:t})}),[t,e]),(0,r.createElement)("div",{className:"mt-1 flex items-center justify-end gap-0.5 text-right"},(0,r.createElement)("button",{type:"button","aria-pressed":1===t,"aria-live":"polite",onClick:()=>n((e=>1===e?0:1)),"aria-label":1===t?(0,l.__)("Remove rating","extendify-local"):(0,l.__)("Rate that this answer was helpful","extendify-local"),className:S()("m-0 h-5 w-5 cursor-pointer border-0 bg-transparent p-0 hover:text-design-main",{"text-design-main":1===t,"text-gray-500":1!==t})},(0,r.createElement)(v.Z,{className:"fill-current",icon:A})),(0,r.createElement)("button",{type:"button","aria-pressed":-1===t,"aria-live":"polite",onClick:()=>n((e=>-1===e?0:-1)),"aria-label":-1===t?(0,l.__)("Remove rating","extendify-local"):(0,l.__)("Rate that this answer was not helpful","extendify-local"),className:S()("m-0 h-5 w-5 cursor-pointer border-0 bg-transparent p-0 hover:text-design-main",{"text-design-main":-1===t,"text-gray-500":-1!==t})},(0,r.createElement)(v.Z,{className:"fill-current",icon:k})))},V={experienceLevel:"beginner",currentQuestion:void 0},F=(0,f.Ue)((0,g.tJ)((0,g.mW)(((e,t)=>({history:[],...V,setCurrentQuestion:t=>e({currentQuestion:t}),setExperienceLevel:t=>e({experienceLevel:t}),addHistory:t=>e((e=>({history:[t,...e.history.filter((({answerId:e})=>e!==t.answerId)).slice(0,9)]}))),hasHistory:()=>t().history.length>0,clearHistory:()=>e({history:[]}),deleteFromHistory:t=>e((e=>({history:e.history.filter((({answerId:e})=>e!==t.answerId))}))),historyCount:()=>t().history.length,reset:()=>e({...V})})),{name:"Extendify Chat History"}),{name:"extendify-chat-history",storage:(0,g.FL)((()=>localStorage))})),j=({question:e,answer:t,reset:n,error:o,answerId:i})=>{var a;const c=(0,s.useRef)(null),{addHistory:u,setCurrentQuestion:d}=F(),h=(0,b.pasteHandler)({plainText:null!==(a=t?.replace(/[\r\n]+/g,"
"))&&void 0!==a?a:""}),p=Array.isArray(h)?(0,b.serialize)(h):h;return(0,s.useEffect)((()=>{if(!i)return;const t={answerId:i,htmlAnswer:p,question:e,time:Date.now()};u(t),d(t)}),[i,p,u,e,d]),o?(0,r.createElement)("div",{className:"overflow-y-auto p-6 pb-10",ref:c},(0,r.createElement)("div",{className:"relative mb-8 ml-4 flex justify-end"},(0,r.createElement)(T,{text:(0,l.__)("Oops! We were unable to send your question.","extendify-local"),reset:n}))):(0,r.createElement)("div",{className:"flex h-full flex-col"},(0,r.createElement)("div",{className:"flex-grow overflow-y-auto p-6 pb-10",ref:c},(0,r.createElement)("div",{className:"relative mb-8 ml-4 flex justify-end"},(0,r.createElement)("div",{className:"m-0 rounded-lg bg-gray-800 p-5 text-sm text-design-text"},e)),(0,r.createElement)("div",{className:"relative"},(0,r.createElement)("div",{className:"absolute z-10 -ml-2 -mt-4 flex items-center rounded-full bg-design-main p-2"},(0,r.createElement)(v.Z,{icon:C,className:"h-4 w-4 fill-current text-design-text"})),(0,r.createElement)("div",{className:S()("m-0 inline-block rounded-lg bg-gray-100 p-5 text-sm text-gray-800",{"animate-pulse bg-gray-300":"..."===t,"bg-gray-100":"..."!==t}),dangerouslySetInnerHTML:{__html:p}}),i&&(0,r.createElement)(R,{answerId:i}))),(0,r.createElement)("div",{className:"ask-another-question relative flex justify-center p-4"},(0,r.createElement)("button",{type:"button",onClick:n,className:"flex cursor-pointer items-center gap-2 rounded-sm border-none bg-design-main px-4 py-2 text-sm text-design-text"},(0,l.__)("Ask Another Question","extendify-local"),(0,r.createElement)(v.Z,{icon:P,className:"h-6 fill-current text-design-text"}))))};var I=n(5202);const B=({setShowHistory:e})=>{const{history:t,setCurrentQuestion:n,deleteFromHistory:o}=F();return(0,s.useEffect)((()=>{t.length>0||setTimeout((()=>e(!1)),750)}),[t,e]),(0,r.createElement)("div",{className:"relative h-full"},(0,r.createElement)("div",{className:"flex items-center justify-between bg-gray-100 p-4 px-6 text-gray-900"},(0,r.createElement)("h1",{className:"m-0 p-0 text-sm font-medium"},(0,l.__)("Chat History","extendify-local")),(0,r.createElement)("button",{type:"button",onClick:()=>e(!1),className:"m-0 cursor-pointer border-0 bg-transparent fill-current p-0 text-design-text"},(0,r.createElement)(v.Z,{icon:I.Z,size:16}),(0,r.createElement)("span",{className:"sr-only"},(0,l.__)("Close history","extendify-local")))),(0,r.createElement)("ul",{className:"m-0 mt-3 h-full overflow-y-auto p-0"},[...t].sort(((e,t)=>e.time-t.time)).map((e=>(0,r.createElement)("li",{key:e.answerId,className:"group flex gap-1 px-2 pr-4"},(0,r.createElement)("button",{type:"button",onClick:()=>o(e),className:"m-0 cursor-pointer border-0 bg-transparent p-0 opacity-0 group-hover:opacity-100"},(0,r.createElement)(v.Z,{icon:I.Z,size:12}),(0,r.createElement)("span",{className:"sr-only"},(0,l.__)("Remove from history","extendify-local"))),(0,r.createElement)("button",{type:"button",className:"m-0 flex w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-gray-200 bg-transparent p-2.5 text-left hover:bg-gray-100",onClick:()=>n(e)},(0,r.createElement)("div",null,(0,r.createElement)("span",{className:"overflow-hidden truncate text-ellipsis"},e.question.substring(0,100))),(0,r.createElement)("span",null,(0,r.createElement)(v.Z,{className:"fill-current text-gray-900",icon:_}))))))))};var H=n(5609),z=n(3279),U=n(8184);const W=({setShowHistory:e})=>{const t={beginner:(0,l.__)("Beginner","extendify-local"),intermediate:(0,l.__)("Intermediate","extendify-local"),advanced:(0,l.__)("Advanced","extendify-local")},{historyCount:n,hasHistory:o,experienceLevel:i,setExperienceLevel:s}=F();return(0,r.createElement)("nav",{className:"absolute right-0 z-10 mx-4 mt-3 flex items-center justify-between gap-2"},(0,r.createElement)("div",{className:"flex items-center gap-2"},(0,r.createElement)(H.Dropdown,{className:"flex",contentClassName:"origin-top-right rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none",popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e})=>(0,r.createElement)("span",null,(0,r.createElement)(H.Icon,{icon:z.Z,onClick:e,size:28,className:"cursor-pointer rounded fill-current p-1 text-design-text hover:bg-white/10"}),(0,r.createElement)("span",{className:"sr-only"},(0,l.__)("Toggle menu","extendify-local"))),renderContent:({onClose:a})=>(0,r.createElement)(H.MenuGroup,{label:(0,l.__)("WordPress Comfort Level","extendify-local")},Object.entries(t).map((([e,t])=>(0,r.createElement)(H.MenuItem,{key:e,isSelected:i===e,onClick:()=>{s(e),a()},icon:i===e?U.Z:null},t))),(0,r.createElement)("hr",null),(0,r.createElement)(H.MenuItem,{disabled:!o(),onClick:()=>{e(!0),a()}},(0,l.sprintf)((0,l.__)("Chat History (%d)","extendify-local"),n)))})))},$=({value:e,className:t,onChange:n,onKeyDown:o,disabled:i,placeholder:l,maxRows:c=6})=>{const d=(0,s.useRef)(null),[h,p]=(0,s.useState)("auto"),[m,f]=(0,s.useState)("auto");return(0,s.useLayoutEffect)((()=>{if(!d.current)return;const e=window.getComputedStyle(d.current),t=parseFloat(e.lineHeight);f(t)}),[]),(0,s.useLayoutEffect)((()=>{const t=document.createElement("textarea");t.value=e||l,t.rows=1;const n=window.getComputedStyle(d.current);["paddingTop","paddingBottom","paddingLeft","paddingRight","width","fontFamily","fontSize","borderWidth"].forEach((e=>t.style[e]=n[e])),Object.assign(t.style,{position:"absolute",left:"-9999px"}),document.body.appendChild(t),p(t.scrollHeight),document.body.removeChild(t)}),[e,l]),(0,s.useEffect)((()=>{const e=d.current;if(!e)return;if(document.activeElement===e)return;const t=e.value.length;e.focus(),e.setSelectionRange(t,t)}),[e]),(0,r.createElement)(a.M,null,(0,r.createElement)(u.E.div,{key:"input",animate:{height:`${h}px`},transition:{duration:.2},style:{overflow:"hidden",maxHeight:m?m*c+16+"px":"none"}},(0,r.createElement)("label",{htmlFor:"draft-ai-textarea",className:"sr-only"},l),(0,r.createElement)("textarea",{ref:d,id:"draft-ai-textarea",disabled:i,className:t,value:e,rows:1,onChange:n,onKeyDown:o,placeholder:l,style:{overflowY:h{const[t,n]=(0,s.useState)(""),o=(0,s.useRef)(null);return(0,r.createElement)("form",{onSubmit:e,ref:o,className:""},(0,r.createElement)("p",{className:"m-0 mb-1 text-lg font-medium opacity-80"},(0,l.__)("Hi there!","extendify-local")),(0,r.createElement)("p",{className:"m-0 mb-6 text-2xl font-medium"},(0,l.__)("Ask me any questions about WordPress.","extendify-local")),(0,r.createElement)("div",{className:"relative rounded border border-gray-300 bg-white shadow"},(0,r.createElement)($,{value:t,className:"h-full w-full flex-1 resize-none py-4 pl-3 pr-10 placeholder-gray-600",placeholder:(0,l.__)("Ask your WordPress question…","extendify-local"),onChange:e=>{n(e.target.value)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||o?.current?.requestSubmit()}}),(0,r.createElement)("button",{type:"submit",className:"absolute bottom-3.5 right-2.5 flex h-6 cursor-pointer items-center border-none bg-transparent fill-current text-gray-700 hover:text-gray-900",disabled:!t},(0,r.createElement)(v.Z,{icon:P,className:"h-4 w-4"}))))};var Z=n(444),Y=n(5893);const G=(0,Y.jsx)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Y.jsx)(Z.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})}),K=({height:e})=>window.extHelpCenterData?.supportUrl?(0,r.createElement)("div",{className:"px-6 py-8"},(0,r.createElement)("a",{href:window.extHelpCenterData.supportUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-4 rounded border border-solid border-gray-300 px-4 py-3 text-sm text-gray-800 no-underline"},(0,r.createElement)("span",null,(0,l.__)("For other questions, visit our support page.","extendify-local")),(0,r.createElement)(v.Z,{icon:G,className:"w-8 fill-current"}))):(0,r.createElement)("div",{className:`bg-design-main ${e}`}),X=({onOpen:e})=>(0,r.createElement)("section",{className:""},(0,r.createElement)("button",{"data-test":"help-center-dashboard-ai-chat-button",type:"button",onClick:e,className:"m-0 flex w-full cursor-pointer justify-between gap-2 rounded-md border border-gray-200 bg-transparent p-2.5 text-left hover:bg-gray-100"},(0,r.createElement)(v.Z,{icon:y.Z,className:"rounded-full border-0 bg-design-main fill-design-text p-2",size:48}),(0,r.createElement)("div",{className:"grow pl-1"},(0,r.createElement)("h1",{className:"m-0 p-0 text-lg font-medium"},(0,l.__)("Ask AI","extendify-local")),(0,r.createElement)("p",{className:"m-0 p-0 text-xs text-gray-800"},(0,l.__)("Got questions? Ask our AI chatbot","extendify-local"))),(0,r.createElement)("div",{className:"flex h-12 grow-0 items-center justify-end"},(0,r.createElement)(v.Z,{icon:x.Z,size:24,className:"fill-current text-gray-700"})))),J=()=>{const{consentTermsHTML:e,setUserGaveConsent:t}=(0,w.y)();return(0,r.createElement)("div",{"data-test":"help-center-ai-chat-consent-prompt",className:"absolute inset-0 flex items-center justify-center bg-black/75 p-6"},(0,r.createElement)("div",{className:"rounded bg-white p-4"},(0,r.createElement)("h2",{className:"mb-2 mt-0 text-lg"},(0,l.__)("Terms of Use","extendify-local")),(0,r.createElement)("p",{className:"m-0",dangerouslySetInnerHTML:{__html:e}}),(0,r.createElement)("button",{"data-test":"help-center-ai-chat-consent-accept-button",className:"mt-4 w-full cursor-pointer rounded border-0 bg-design-main px-4 py-2 text-center text-white",type:"button",onClick:()=>t(!0)},(0,l.__)("Accept","extendify-local"))))},Q=[{slug:"ai-chat",title:(0,l.__)("AI Chatbot","extendify-local"),component:()=>{const[e,t]=(0,s.useState)(void 0),[n,o]=(0,s.useState)(void 0),[i,l]=(0,s.useState)(void 0),[c,d]=(0,s.useState)(!1),[h,p]=(0,s.useState)(!1),{experienceLevel:m,currentQuestion:f,setCurrentQuestion:g}=F(),v=(0,w.y)((e=>e.shouldShowAIConsent("help-center")));return(0,s.useLayoutEffect)((()=>{t(f?.question),o(f?.htmlAnswer),p(!1)}),[f]),v?(0,r.createElement)(J,null):e?(0,r.createElement)(j,{question:e,answer:n,answerId:i,reset:()=>{t(void 0),o(void 0),l(void 0),d(!1),p(!1),g(void 0)},error:c}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("section",{className:"flex h-full flex-col"},(0,r.createElement)(W,{setShowHistory:p,showHistory:h}),(0,r.createElement)("div",{className:"flex flex-grow items-center bg-design-main p-6 text-design-text"},(0,r.createElement)(q,{onSubmit:async e=>{var n;e.preventDefault();const r=null!==(n=e.target?.[0]?.value)&&void 0!==n?n:"";if(!r)return;o("..."),t(r);const i=await(({question:e,experienceLevel:t})=>fetch(`${L.Yy}/api/chat/ask-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:e,experienceLevel:t,...O})}))({question:r,experienceLevel:m});if(i.ok)try{const e=i.body.getReader(),t=new TextDecoder;for(;;){const{value:n,done:r}=await e.read();if(r)break;const i=t.decode(n);o((e=>"..."===e?i:(e+i).replace(/\{"id":"[a-zA-Z0-9]+"\}/g,"")))}l(i.headers.get("x-extendify-chat-id")||void 0)}catch(e){console.error(e)}else d(!0)}})),(0,r.createElement)(K,{height:"h-11"})),(0,r.createElement)(a.M,null,h&&(0,r.createElement)(u.E.section,{initial:{x:50},animate:{x:0},exit:{x:0},transition:{duration:.2},style:{"--ext-design-text":"#000000"},className:"absolute bottom-0 left-0 right-0 top-0 z-20 ml-4 mt-4 flex h-full flex-col overflow-hidden rounded-tl-lg bg-white shadow-2xl"},(0,r.createElement)(B,{setShowHistory:p}))))}}];var ee=n(3426);const te=ee.default||ee;var ne=n(9870);const re=e=>{const t=window.extSharedData.wpLanguage||null,n=new URLSearchParams({lang:t});return fetch(`${L.nX}/api/posts/${e}?${n.toString()}`).then((e=>{if(404===e.status)throw new Error("Not found");if(!e.ok)throw new Error(e.statusText);return e.json()}))};var oe;const ie={articles:[],recentArticles:[],viewedArticles:[],searchTerm:"",...null!==(oe=(0,p.a)(window.extHelpCenterData.userData.supportArticlesData)?.state)&&void 0!==oe?oe:{}},se=(0,f.Ue)((0,g.tJ)((0,g.mW)(((e,t)=>({...ie,pushArticle:n=>{const{slug:r,title:o}=n,i=t(),s=(new Date).toISOString(),a=s,l=i.viewedArticles.find((e=>e.slug===r)),c=[...i.viewedArticles.filter((e=>e.slug!==r)),l?{...l,count:l.count+1,lastViewedAt:s}:{slug:r,title:o,firstViewedAt:a,lastViewedAt:s,count:1}];h()({path:"/extendify/v1/help-center/support-articles-data",method:"POST",data:{state:{viewedArticles:c}}}),e({articles:[n,...i.articles],recentArticles:[n,...i.recentArticles.slice(0,9)],viewedArticles:c})},popArticle:()=>e((e=>({articles:e.articles.slice(1)}))),clearArticles:()=>e({articles:[]}),reset:()=>e({articles:[],searchTerm:""}),updateTitle:(t,n)=>e((e=>({articles:e.articles.map((e=>(e.slug===t&&(e.title=n),e)))}))),clearSearchTerm:()=>e({searchTerm:""}),setSearchTerm:t=>e({searchTerm:t})})),{name:"Extendify Help Center Knowledge Base"}),{name:"extendify-help-center-knowledge-base",storage:(0,g.FL)((()=>sessionStorage))})),ae=()=>{const{articles:e,pushArticle:t,popArticle:n,updateTitle:o}=se(),[i,a]=(0,s.useState)(),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(),p=e?.[0]?.slug,{data:m,error:f,loading:g}=(e=>{const{data:t,error:n}=(0,ne.Z)(e,re);return{data:t,error:n,loading:!t&&!n}})(p),v=m?.title;return(0,s.useEffect)((()=>{if(!f)return a(!1);i||(a(!0),n(),window.open(`https://wordpress.org/documentation/article/${p}`,"_blank"))}),[f,p,i,n]),(0,s.useEffect)((()=>{p&&v&&o(p,v)}),[v,o,p]),(0,s.useEffect)((()=>{if(!d.current)return;const e=d.current?.querySelectorAll("a"),n=d.current?.querySelectorAll("figure"),r=d.current?.querySelectorAll("img");n.forEach((e=>{e.classList.add("mx-auto"),e.classList.add("my-4"),e.classList.add("block"),e.classList.add("w-full"),e.classList.remove("wp-block-image")})),r.forEach((e=>{e.classList.add("object-contain"),e.classList.add("max-w-[400px]"),e.classList.add("max-h-[250px]")}));const o=async e=>{var n;if(e.preventDefault(),e.ctrlKey||e.metaKey)return e.stopPropagation(),window.open(e.target.href,"_blank");const r=null!==(n=e.target?.href)&&void 0!==n?n:e.target?.closest("a")?.href,{pathname:o}=new URL(r),i=o.split("/").filter(Boolean)?.at(-1);u(!0);const s=await(a=o,h()({path:`/extendify/v1/help-center/get-redirect?path=${a}`}));var a;if(u(!1),!s)return o.startsWith("/documentation/article/")?t({slug:i,title:void 0}):window.open(`https://wordpress.org${o}`,"_blank");t({slug:s.split("/").filter(Boolean)?.at(-1)})},i=e=>{e.preventDefault(),window.open(e.target.href,"_blank")},s=e=>e.preventDefault();return e.forEach((e=>{const{hash:t,host:n,pathname:r}=new URL(e.href);if(t&&n===window.location.host||r.startsWith("/support/category"))return e.addEventListener("click",s),e.setAttribute("aria-disabled","true"),void e.classList.add("link-disabled");if(r.match(/\.(jpg|jpeg|png|gif|pdf|doc|docx|xls|xlsx|ppt|pptx)$/))return void e.addEventListener("click",s);if(r.startsWith("/documentation/article")||r.startsWith("/support/article"))return void e.addEventListener("click",o);e.addEventListener("click",i);const a=document.createElement("span");a.innerHTML='',e.appendChild(a)})),()=>{e.forEach((e=>{e?.removeEventListener("click",o),e?.removeEventListener("click",i),e?.removeEventListener("click",s)}))}}),[m,t]),g||c?(0,r.createElement)("div",{className:"p-8 text-center text-base"},(0,r.createElement)(H.Spinner,null)):f?(0,r.createElement)("div",{className:"p-8 text-center text-base"},(0,l.__)("There was an error loading this article","extendify-local")):(0,r.createElement)("article",{ref:d,className:"extendify-documentation w-full","data-test":"kb-article-content"},(0,r.createElement)("h1",{className:"m-0 text-3xl"},v),m?.content&&te(m?.content))};var le=n(802);const ce=({articles:e})=>{const{pushArticle:t}=se(),{navigateTo:n}=$e();return(0,r.createElement)("ul",{className:"m-0 flex flex-col gap-1 py-2","data-test":"help-center-kb-articles-list"},e.map((({slug:e,title:o})=>(0,r.createElement)("li",{key:e,className:"m-0 py-1 pl-2 pr-3"},(0,r.createElement)("button",{type:"button",className:"flex cursor-pointer gap-2 bg-transparent text-sm text-gray-800 hover:underline hover:underline-offset-4",onClick:()=>{t({slug:e,title:o}),n("knowledge-base-article")}},(0,r.createElement)(v.Z,{size:20,icon:le.Z,className:"rotate-180 transform fill-gray-700"}),o)))))};var ue=n(2395),de=n(7231);const he=({onChange:e})=>{const{searchTerm:t,clearSearchTerm:n,reset:o}=se(),i=(0,s.useRef)(!1),a=(0,s.useRef)();return(0,r.createElement)("form",{method:"get",onSubmit:e=>e.preventDefault(),className:"relative h-10 w-full"},(0,r.createElement)("label",{htmlFor:"ext-help-center-search",className:"sr-only"},(0,l.__)("Search for articles","extendify-local")),(0,r.createElement)("input",{ref:a,name:"ext-kb-search",autoFocus:!0,autoCapitalize:"off",id:"ext-help-center-search",type:"text",value:null!=t?t:"",onChange:t=>e(t.target.value),onFocus:()=>{i.current||(i.current=!0,fetch(`${L.nX}/api/posts?boot=true`,{method:"POST"}))},placeholder:(0,l.__)("What do you need help with?","extendify-local"),className:"input border-text-800 h-10 w-full border px-3 text-sm placeholder-gray-600"}),(0,r.createElement)("div",{className:"absolute inset-y-5 right-2 flex items-center justify-center text-gray-400"},(0,r.createElement)(v.Z,{icon:t?de.Z:ue.Z,className:S()("fill-current",{"cursor-pointer":t}),onClick:()=>{o(),n(),a.current?.focus()},size:24})))},pe=async e=>{if(e.length<3)return null;const t=new URLSearchParams({lang:window.extSharedData.wpLanguage||null,search:e});return await fetch(`${L.nX}/api/posts?${t.toString()}`,{method:"POST"}).then((e=>{if(!e.ok)throw new Error(e.statusText);return e.json()}))},me=["wordpress-block-editor","blocks-list","adding-a-new-block","block-pattern","block-pattern-directory"],fe=(0,p.a)(window.extSharedData.resourceData)?.supportArticles?.filter((e=>me.includes(e.slug))),ge=({onOpen:e})=>{const{setSearchTerm:t}=se();return(0,r.createElement)("section",{className:"rounded-md border","data-test":"help-center-kb-section"},(0,r.createElement)("div",{className:"border-b border-gray-150 bg-gray-100 p-2.5 pb-4"},(0,r.createElement)("h1",{className:"m-0 mb-3 p-0 text-lg font-medium"},(0,l.__)("Knowledge Base","extendify-local")),(0,r.createElement)(he,{onChange:n=>{t(n),e()}})),(0,r.createElement)(ce,{articles:fe.slice(0,5)}))},ve=[{slug:"knowledge-base",title:(0,l.__)("Knowledge Base","extendify-local"),component:()=>{var e;const{setSearchTerm:t,searchTerm:n}=se(),{data:o,loading:i}=(e=>{const{data:t,error:n}=(0,ne.Z)(e||null,pe);return{data:t,error:n,loading:!t&&!n}})(n);return(0,r.createElement)("section",{className:"p-4"},(0,r.createElement)("div",{className:""},(0,r.createElement)("div",{className:"mb-4"},(0,r.createElement)("h2",{className:"m-0 mb-2 text-sm"},n&&i?(0,l.__)("Searching...","extendify-local"):o?.length>0?(0,l.__)("Search results","extendify-local"):(0,l.__)("Search the knowledge base","extendify-local")),(0,r.createElement)(he,{onChange:t})),i&&n?(0,r.createElement)("div",{className:"p-8 text-center text-base"},(0,r.createElement)(H.Spinner,null)):(0,r.createElement)(ce,{articles:null!==(e=o?.slice(0,10))&&void 0!==e?e:[]})))}},{slug:"knowledge-base-article",title:(0,l.__)("Knowledge Base","extendify-local"),component:()=>(0,r.createElement)("section",{className:"p-4"},(0,r.createElement)("div",{className:""},(0,r.createElement)("div",{className:""},(0,r.createElement)(ae,null))))}],ye=(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("path",{d:"M18.72,8.267L20,8.267L20,17.653C20,18.949 18.95,20 17.654,20L6.56,20L6.56,18.72L17.654,18.72C18.243,18.72 18.72,18.242 18.72,17.653L18.72,8.267Z"}),(0,r.createElement)("path",{d:"M16.8,5.387L16.8,15.413C16.8,16.179 16.179,16.8 15.413,16.8L5.387,16.8C4.621,16.8 4,16.179 4,15.413L4,5.387C4,4.621 4.621,4 5.387,4L15.413,4C16.179,4 16.8,4.621 16.8,5.387ZM15.52,5.387C15.52,5.328 15.472,5.28 15.413,5.28L5.387,5.28C5.328,5.28 5.28,5.328 5.28,5.387L5.28,15.413C5.28,15.472 5.328,15.52 5.387,15.52L15.413,15.52C15.472,15.52 15.52,15.472 15.52,15.413L15.52,5.387Z"}),(0,r.createElement)("path",{d:"M9.573,13.839L8.667,12.934L10.775,10.827L8.667,8.719L9.573,7.814L12.585,10.827L9.573,13.839Z"})),xe=(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,r.createElement)("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM8 14.5V5.5L14 10L8 14.5Z",fill:"currentColor"})),we=(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,r.createElement)("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 16.5C6.69 16.5 4 13.81 4 10.5H6C6 12.71 7.79 14.5 10 14.5C12.21 14.5 14 12.71 14 10.5C14 8.26 12.15 6.41 9.84 6.51L11.41 8.08L10 9.5L6 5.5L10 1.5L11.41 2.91L9.81 4.51C13.28 4.4 16 7.18 16 10.5C16 13.81 13.31 16.5 10 16.5Z"})),be=(0,f.Ue)((0,g.tJ)((0,g.mW)((e=>({visibility:"minimized",queuedTour:null,queueTourForRedirect:t=>e({queuedTour:t}),clearQueuedTour:()=>e({queuedTour:null}),setVisibility:t=>{if(!["open","minimized","closed"].includes(t))throw new Error("Invalid visibility state");e({visibility:t})}})),{name:"Extendify Help Center Globals Sync"}),{name:"extendify-help-center-globals-sync"}));var Ee;const Se={currentTour:null,currentStep:void 0,preparingStep:void 0,progress:[],...null!==(Ee=(0,p.a)(window.extHelpCenterData.userData.tourData)?.state)&&void 0!==Ee?Ee:{}},Te="/extendify/v1/help-center/tour-data",Ce={getItem:async()=>await h()({path:Te}),setItem:async(e,t)=>await h()({path:Te,method:"POST",data:{state:t}})},Pe=(0,f.Ue)((0,g.tJ)((0,g.mW)(((e,t)=>({...Se,startTour:async n=>{const{trackTourProgress:r,updateProgress:o,getStepData:i,onTourPage:s}=t();s(n?.settings?.startFrom)&&(await(n?.onStart?.(n)),n.steps=n.steps?.filter((e=>e?.showOnlyIf?.()||void 0===e?.showOnlyIf?.()))||[],await(i(0,n)?.events?.beforeAttach?.(n))),e({currentTour:n,currentStep:0,preparingStep:void 0});const a=r(n.id);o(a.id,{openedCount:Number(a.openedCount)+1,lastAction:"started"})},onTourPage:(e=null)=>{const n=window.location.href;if(e?.includes(n))return!0;const{currentTour:r}=t();return r?.settings?.startFrom?.includes(n)},completeCurrentTour:async()=>{const{currentTour:n,wasCompleted:r,findTourProgress:o,updateProgress:i}=t(),s=o(n?.id);s?.id&&(r(s.id)||i(s.id,{completedAt:(new Date).toISOString(),lastAction:"completed"}),i(s.id,{completedCount:Number(s.completedCount)+1,lastAction:"completed"}),await(n?.onDetach?.()),await(n?.onFinish?.()),e({currentTour:null,currentStep:void 0}),"site-assistant-tour"===s?.id&&window.dispatchEvent(new CustomEvent("extendify-assist:is-tour-finished",{detail:{isFinished:!0}})))},closeCurrentTour:async n=>{const{currentTour:r,findTourProgress:o,updateProgress:i}=t(),s=o(r?.id);if(!s?.id)return;const a={};return["redirected"].includes(n)?i(s?.id,{lastAction:n}):["closed-by-caught-error"].includes(n)?i(s?.id,{lastAction:n,errored:!0}):("closed-manually"===n&&(a.closedManuallyCount=Number(s.closedManuallyCount)+1),await(r?.onDetach?.()),await(r?.onFinish?.()),i(s?.id,{lastAction:n,...a}),void e({currentTour:null,currentStep:void 0,preparingStep:void 0}))},findTourProgress:e=>t().progress.find((t=>t.id===e)),wasCompleted:e=>t().findTourProgress(e)?.completedAt,wasOpened:e=>{var n;return Number(null!==(n=t().findTourProgress(e)?.openedCount)&&void 0!==n?n:0)>0},isSeen:e=>t().findTourProgress(e)?.firstSeenAt,trackTourProgress:n=>{const{findTourProgress:r}=t();return r(n)||e((e=>({progress:[...e.progress,{id:n,firstSeenAt:(new Date).toISOString(),updatedAt:(new Date).toISOString(),completedAt:null,lastAction:"init",currentStep:0,openedCount:0,closedManuallyCount:0,completedCount:0,errored:!1}]}))),r(n)},updateProgress:(t,n)=>{var r;const o=null!==(r=n?.lastAction)&&void 0!==r?r:"unknown";e((e=>({progress:e.progress.map((e=>e.id===t?{...e,...n,lastAction:o,updatedAt:(new Date).toISOString()}:e))})))},getStepData:(e,n=t().currentTour)=>{var r;return null!==(r=n?.steps?.[e])&&void 0!==r?r:{}},hasNextStep:()=>!!t().currentTour&&Number(t().currentStep){const{currentTour:e,goToStep:n,updateProgress:r,currentStep:o}=t(),i=Number(o)+1;await n(i),r(e.id,{currentStep:i,lastAction:"next"})},hasPreviousStep:()=>!!t().currentTour&&Number(t().currentStep)>0,prevStep:async()=>{const{currentTour:e,goToStep:n,updateProgress:r,currentStep:o}=t(),i=o-1;await n(i),r(e.id,{currentStep:i,lastAction:"prev"})},goToStep:async n=>{const{currentTour:r,updateProgress:o,closeCurrentTour:i,getStepData:s}=t(),a=r;if(n<0||n>a.steps.length-1)return void i("closed-by-caught-error");o(a.id,{currentStep:n,lastAction:`go-to-step-${n}`});const l=s(n)?.events;l?.beforeAttach&&(e((()=>({preparingStep:n}))),await Promise.allSettled([l.beforeAttach?.(a),new Promise((e=>setTimeout(e,300)))]),e((()=>({preparingStep:void 0})))),e((()=>({currentStep:n})))}})),{name:"Extendify Tour Progress"}),{name:"extendify-help-center-tour-progress",storage:(0,g.FL)((()=>Ce)),skipHydration:!0,partialize:e=>{const{currentTour:t,currentStep:n,preparingStep:r,...o}=e;return o}})),ke=e=>new Promise((t=>{const n=setInterval((()=>{document.querySelector(e)&&(clearInterval(n),t())}),50)})),Ae=e=>new Promise((t=>{const n=setInterval((()=>{document.querySelector(e)||(clearInterval(n),t())}),50)})),_e={id:"library-tour",title:(0,l.__)("Design Library","extendify-local"),settings:{allowOverflow:!0,hideDotsNav:!0,startFrom:[window.extSharedData.adminUrl+"post-new.php?post_type=page"]},onStart:async()=>{await ke("#extendify-library-btn"),document.querySelector(`[aria-label="${(0,l.__)("Settings")}"].is-pressed`)?.click()},steps:[{title:(0,l.__)("Open the Pattern Library","extendify-local"),text:(0,l.__)("The Extendify pattern library can be opened by clicking the button to the left.","extendify-local"),attachTo:{element:'#extendify-library-btn [role="button"]',offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{beforeAttach:()=>dispatchEvent(new CustomEvent("extendify::close-library"))}},{title:(0,l.__)("Filter Patterns","extendify-local"),text:(0,l.__)("Click on any pattern category to refine the selection.","extendify-local"),attachTo:{element:"#extendify-library-category-control",position:{x:"right",y:"top"},hook:"top left"},options:{allowPointerEvents:!0},events:{beforeAttach:async()=>(dispatchEvent(new CustomEvent("extendify::open-library")),await ke("#extendify-library-category-control"))}},{title:(0,l.__)("Select a Pattern","extendify-local"),text:(0,l.__)("Simply select any pattern you wish to insert into a page by clicking on it.","extendify-local"),attachTo:{element:"#extendify-library-patterns-list",position:{x:"left",y:"top"},hook:"top left"},events:{beforeAttach:async()=>{await ke("#extendify-library-patterns-list")}}},{title:(0,l.__)("View the Inserted Pattern","extendify-local"),text:(0,l.__)("The selected pattern has been inserted into the page.","extendify-local"),attachTo:{element:".wp-block-group:last-child",frame:'iframe[name="editor-canvas"]',offset:{marginTop:15,marginLeft:0},position:{x:"right",y:"top"},hook:"top right"},events:{beforeAttach:async()=>(document.querySelector("#extendify-library-patterns-list .library-pattern")?.click(),await Ae("#extendify-library-patterns-list"))},options:{hideBackButton:!0}}]},Le=()=>!!document.querySelector('iframe[name="editor-canvas"]'),Me=e=>{var t;return null!==(t=13!==e.keyCode)&&void 0!==t?t:e.preventDefault()},Ne=(e="")=>`.edit-post-header-toolbar__inserter-toggle${e}, .editor-document-tools__inserter-toggle${e}`,De={id:"page-editor-tour",title:(0,l.__)("Page editor","extendify-local"),settings:{allowOverflow:!0,startFrom:[window.extSharedData.adminUrl+"post-new.php?post_type=page"]},steps:[{title:(0,l.__)("Add a Block","extendify-local"),text:(0,l.__)("Click the plus to open the block inserter.","extendify-local"),attachTo:{element:Ne(),offset:{marginTop:15,marginLeft:0},position:{x:"left",y:"bottom"},hook:"top left"},events:{beforeAttach:async()=>(await ke(Ne()),requestAnimationFrame((()=>dispatchEvent(new CustomEvent("extendify::close-library")))))}},{title:(0,l.__)("Block Inserter","extendify-local"),text:(0,l.__)("Add a block by clicking or dragging it onto the page.","extendify-local"),attachTo:{element:".block-editor-inserter__menu",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{beforeAttach:async()=>(document.querySelector(Ne(":not(.is-pressed)"))?.click(),await ke(".block-editor-tabbed-sidebar")),onAttach:()=>{const e=document.querySelector(Ne());Oe.observe(e,{attributes:!0}),window.addEventListener("keydown",Me)},onDetach:async()=>{Oe.disconnect(),window.removeEventListener("keydown",Me),document.querySelector(Ne(".is-pressed"))?.click(),await Ae(".block-editor-inserter__block-list"),requestAnimationFrame((()=>{document.getElementById("help-center-tour-next-button")?.focus()}))}}},{title:(0,l.__)("Page Title","extendify-local"),text:(0,l.__)("Edit the page title by clicking it. Note: The title may or may not show up on the published page, depending on the page template used.","extendify-local"),attachTo:{element:()=>Le()?'iframe[name="editor-canvas"]':".wp-block-post-title",offset:()=>({marginTop:Le()?15:0,marginLeft:Le()?-15:15}),position:{x:"right",y:"top"},hook:()=>Le()?"top right":"top left"},events:{beforeAttach:async()=>{await window.wp.data.dispatch("core/editor").editPost({title:"Sample Post"})}}},{title:(0,l.__)("Blocks","extendify-local"),text:(0,l.__)("Each block will show up on the page and can be edited by clicking on it.","extendify-local"),attachTo:{element:()=>Le()?'iframe[name="editor-canvas"]':".wp-block-post-content > p",offset:()=>({marginTop:Le()?15:0,marginLeft:Le()?-15:15}),position:{x:"right",y:"top"},hook:()=>Le()?"top right":"top left"},events:{beforeAttach:async()=>{if(await window.wp.data.select("core/block-editor").getBlockCount()>0)return;const e=(0,b.createBlock)("core/paragraph",{content:(0,l.__)("This is a sample paragraph block. It can be several sentences long and will span multiple rows. You can add as many blocks as you'd like to the page.","extendify-local")});return await window.wp.data.dispatch("core/block-editor").insertBlock(e),Le()?await window.wp.data.dispatch("core/block-editor").flashBlock(e.clientId):null}}},{title:(0,l.__)("Page and Block Settings","extendify-local"),text:(0,l.__)("Select either page or block to change the settings for the entire page or the block that is selected.","extendify-local"),attachTo:{element:".interface-interface-skeleton__sidebar",offset:{marginTop:0,marginLeft:-15},position:{x:"left",y:"top"},hook:"top right"},events:{beforeAttach:async()=>{document.querySelector(`[aria-label="${(0,l.__)("Settings")}"]:not(.is-pressed)`)?.click(),await ke(".interface-interface-skeleton__sidebar"),document.querySelector('.edit-post-sidebar__panel-tab,[data-tab-id="edit-post/document"]')?.click(),await ke(".editor-post-status"),document.querySelector(".edit-post-post-status button")?.click()}}},{title:(0,l.__)("Preview","extendify-local"),text:(0,l.__)("Click preview to view how your changes look on the front end of your site.","extendify-local"),attachTo:{element:".block-editor-post-preview__button-toggle,.editor-preview-dropdown__toggle",offset:{marginTop:0,marginLeft:-15},position:{x:"left",y:"top"},hook:"top right"},events:{}},{title:(0,l.__)("Publish or Save","extendify-local"),text:(0,l.__)("Click publish or update to save the changes you have made to the page and make them live on the site.","extendify-local"),attachTo:{element:".editor-post-publish-button__button",offset:{marginTop:15},position:{x:"right",y:"bottom"},hook:"top right"},events:{}}]},Oe=new MutationObserver((()=>{document.querySelector(Ne(":not(.is-pressed)"))?.click()})),Re={id:"plugin-install-tour",title:(0,l.__)("Installing a plugin","extendify-local"),settings:{allowOverflow:!1,startFrom:[window.extSharedData.adminUrl+"plugin-install.php"]},onStart:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-plugins").classList.add("opensub")},steps:[{title:(0,l.__)("Add New plugin menu","extendify-local"),text:(0,l.__)("Click here to access the Add Plugins page.","extendify-local"),attachTo:{element:'#menu-plugins .wp-submenu a[href="plugin-install.php"]',offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{onDetach:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-plugins").classList.remove("opensub")}}},{title:(0,l.__)("Search","extendify-local"),text:(0,l.__)("Search for a plugin by name or functionality.","extendify-local"),attachTo:{element:".search-form.search-plugins",offset:{marginTop:5,marginLeft:-15},boxPadding:{top:-5,bottom:3,left:5,right:5},position:{x:"left",y:"top"},hook:"top right"},events:{}},{title:(0,l.__)("Plugin details","extendify-local"),text:(0,l.__)("See important information about each plugin.","extendify-local"),attachTo:{element:"#the-list .plugin-card:first-child .plugin-card-bottom",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"bottom"},hook:"bottom left"},events:{}},{title:(0,l.__)("Install now","extendify-local"),text:(0,l.__)("Install the plugin. Then, press this button again to activate the plugin.","extendify-local"),attachTo:{element:"#the-list .plugin-card:first-child .install-now",offset:{marginTop:-5,marginLeft:15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Upload Plugin","extendify-local"),text:(0,l.__)("If you have a plugin from an external source, you can upload it directly here.","extendify-local"),attachTo:{element:".upload-view-toggle",offset:{marginTop:-5,marginLeft:15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:"right",y:"top"},hook:"top left"},events:{}}]},Ve={id:"plugin-management-tour",title:(0,l.__)("Plugin management","extendify-local"),settings:{allowOverflow:!1,startFrom:[window.extSharedData.adminUrl+"plugins.php"]},onStart:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-plugins").classList.add("opensub")},steps:[{title:(0,l.__)("Installed Plugins menu","extendify-local"),text:(0,l.__)("Click this menu to see and manage the plugins you have installed.","extendify-local"),attachTo:{element:"#menu-plugins ul > li:nth-child(2)",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{onDetach:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-plugins").classList.remove("opensub")}}},{title:(0,l.__)("Installed plugins","extendify-local"),text:(0,l.__)("See all plugins installed on your site. This includes plugins that are active and deactivated.","extendify-local"),attachTo:{element:"tbody#the-list > tr:nth-child(1)",offset:{marginTop:15,marginLeft:0},position:{x:"right",y:"bottom"},hook:"top right"},events:{}},{title:(0,l.__)("Deactivate/activate option","extendify-local"),text:(0,l.__)("Under each plugin you can activate or deactivate it.","extendify-local"),attachTo:{element:"tbody#the-list > tr:nth-child(1) > td.plugin-title",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Add another","extendify-local"),text:(0,l.__)("Click here to add another plugin to your site.","extendify-local"),attachTo:{element:"a.page-title-action",offset:{marginTop:-5,marginLeft:15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:"right",y:"top"},hook:"top left"},events:{}}]},Fe={id:"site-assistant-tour",title:(0,l.__)("Site Assistant","extendify-local"),settings:{allowOverflow:!1,startFrom:[`${window.extSharedData.adminUrl}admin.php?page=extendify-assist#dashboard`]},steps:[{title:(0,l.__)("Tasks","extendify-local"),text:(0,l.__)("Now that you've created your starter site, make it your own with these follow up tasks.","extendify-local"),showOnlyIf:()=>document.getElementById("assist-tasks-module"),attachTo:{element:"#assist-tasks-module",offset:{marginTop:window.innerWidth<=1151?-15:2,marginLeft:window.innerWidth<=1151?-25:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Quick Links","extendify-local"),text:(0,l.__)("Easily access some of the most common items in WordPress with these quick links.","extendify-local"),attachTo:{element:"#assist-quick-links-module",offset:{marginTop:window.innerWidth<=1151?-15:2,marginLeft:window.innerWidth<=1151?-25:15},position:{x:"right",y:"top"},hook:"top left"},events:{onAttach:()=>{}}},{title:(0,l.__)("Website Tools & Plugins","extendify-local"),text:(0,l.__)("See our personalized recommendations for you that will help you accomplish your goals.","extendify-local"),showOnlyIf:()=>document.querySelector("#assist-recommendations-module"),attachTo:{element:"#assist-recommendations-module",offset:{marginTop:window.innerWidth<=1151?-15:2,marginLeft:window.innerWidth<=1151?-25:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Help Center","extendify-local"),text:(0,l.__)("You can always access the help center by clicking this button.","extendify-local"),showOnlyIf:()=>document.querySelector("#wp-admin-bar-help-center-btn"),attachTo:{element:"#wp-admin-bar-help-center-btn",offset:{marginTop:45,marginLeft:-5},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Visit your site","extendify-local"),text:(0,l.__)("You can always visit your site by clicking this button.","extendify-local"),attachTo:{element:"#assist-menu-bar",offset:{marginTop:20,marginLeft:-5},position:{x:"left",y:"bottom"},hook:"top left",boxPadding:{top:5,bottom:5,left:5,right:5}},events:{}},{title:(0,l.__)("Site Assistant","extendify-local"),text:(0,l.__)("Come back to the Site Assistant any time by clicking the menu item.","extendify-local"),attachTo:{element:"#toplevel_page_extendify-assist",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{onAttach:()=>{document.body.classList.contains("folded")&&(document.body.classList.remove("folded"),document.body.classList.add("temp-open"))},onDetach:()=>{document.body.classList.contains("temp-open")&&(document.body.classList.remove("temp-open"),document.body.classList.add("folded"))}}}]},je={id:"users-screen-tour",title:(0,l.__)("Users screen","extendify-local"),settings:{allowOverflow:!0,startFrom:[window.extSharedData.adminUrl+"users.php"]},onStart:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-users").classList.add("opensub")},steps:[{title:(0,l.__)("All Users menu","extendify-local"),text:(0,l.__)("Click here to view and manage the users on your site.","extendify-local"),attachTo:{element:"#menu-users ul > li:nth-child(2)",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{onDetach:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-users").classList.remove("opensub")}}},{title:(0,l.__)("Users","extendify-local"),text:(0,l.__)("See all of your users, including admin users in this table.","extendify-local"),attachTo:{element:"tbody#the-list > tr:nth-child(1)",offset:{marginTop:15,marginLeft:0},position:{x:"right",y:"bottom"},hook:"top right"},events:{}},{title:(0,l.__)("Edit user information","extendify-local"),text:(0,l.__)("Click the edit button to change the user's role, manage their account, or change their profile information.","extendify-local"),attachTo:{element:"tbody#the-list > tr:nth-child(1) > td.username",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{onAttach:()=>{document.querySelector("tbody#the-list > tr:nth-child(1) > td.username .row-actions").style.left="0"},onDetach:()=>{document.querySelector("tbody#the-list > tr:nth-child(1) > td.username .row-actions").style.left="-9999em"}}},{title:(0,l.__)("Search for users","extendify-local"),text:(0,l.__)("Use the search bar to find a particular user.","extendify-local"),attachTo:{element:"p.search-box",offset:{marginTop:-5,marginLeft:-15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:"left",y:"top"},hook:"top right"},events:{}},{title:(0,l.__)("Add a new user","extendify-local"),text:(0,l.__)("Click the Add New button to add a new user to your site.","extendify-local"),attachTo:{element:".page-title-action",offset:{marginTop:-5,marginLeft:15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:"right",y:"top"},hook:"top left"},events:{}}]},Ie={"welcome-tour":{id:"welcome-tour",title:(0,l.__)("Getting started with WordPress","extendify-local"),settings:{allowOverflow:!0,startFrom:[window.extSharedData.adminUrl+"index.php",window.extSharedData.adminUrl+"admin.php?page=extendify-assist#dashboard"],minBoxWidth:"360px"},onStart:()=>{document.body.classList.contains("folded")&&(document.body.classList.remove("folded"),document.body.classList.add("temp-open"))},onFinish:()=>{document.body.classList.contains("temp-open")&&(document.body.classList.remove("temp-open"),document.body.classList.add("folded"))},steps:[{title:(0,l.__)("View Site","extendify-local"),text:(0,l.__)("At any time, you can view your site (from a visitor's perspective) from the top admin bar under your site's name.","extendify-local"),image:"https://assets.extendify.com/tours/welcome/view-site.gif",attachTo:{element:"#wp-admin-bar-view-site",offset:{marginTop:0,marginLeft:10},position:{x:"right",y:"top"},hook:"top left"},events:{beforeAttach:()=>{const e=document.querySelector("#wp-admin-bar-site-name .ab-sub-wrapper");e.style.position="relative",e.style.display="block"},onAttach:()=>{const e=document.querySelector("#wp-admin-bar-site-name .ab-sub-wrapper");e.style.position="relative",e.style.display="block"},onDetach:()=>{const e=document.querySelector("#wp-admin-bar-site-name .ab-sub-wrapper");e.style.position="absolute",e.style.display=""}}},{title:(0,l.__)("Site Assistant","extendify-local"),text:(0,l.__)("Access the Site Assistant at any time.","extendify-local"),attachTo:{element:"#toplevel_page_extendify-assist",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:document.getElementById("toplevel_page_wpSq")?.textContent?.replace(/[^\w\s²]/g,"").trim(),text:(0,l.__)("Click here to go to your website management dashboard. From there you will be able to create more websites, and manage your account settings.","extendify-local"),showOnlyIf:()=>document.getElementById("toplevel_page_wpSq"),attachTo:{element:"#toplevel_page_wpSq",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Dashboard","extendify-local"),text:(0,l.__)("The default WordPress dashboard will have some overall site metrics and modules added from certain plugins.","extendify-local"),attachTo:{element:"#menu-dashboard",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Posts","extendify-local"),text:(0,l.__)("Manage and create blog posts.","extendify-local"),attachTo:{element:"#menu-posts",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Media","extendify-local"),text:(0,l.__)("Add, edit, or remove images and other media from your library. When you upload an image to be used on your site, it will be added to the library.","extendify-local"),attachTo:{element:"#menu-media",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Pages","extendify-local"),text:(0,l.__)("Use the pages menu to add, delete, or edit the pages on your site.","extendify-local"),image:"https://assets.extendify.com/tours/welcome/add-pages.gif",attachTo:{element:"#menu-pages",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Comments","extendify-local"),text:(0,l.__)("If you have commenting enabled on your posts, you can manage those comments here.","extendify-local"),attachTo:{element:"#menu-comments",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Appearance","extendify-local"),text:(0,l.__)("Manage your theme and access the Site Editor from the Appearance menu. The Site Editor is where you can make global changes to your site (such as the menu, header/footer, and styles).","extendify-local"),attachTo:{element:"#menu-appearance",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Plugins","extendify-local"),text:(0,l.__)("Add or manage the plugins on your site.","extendify-local"),attachTo:{element:"#menu-plugins",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Users","extendify-local"),text:(0,l.__)("Add or manage users on your site, both admin users and others.","extendify-local"),attachTo:{element:"#menu-users",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Tools","extendify-local"),text:(0,l.__)("Import/export post data, check site health, and edit theme or plugin files directly in the WordPress admin.","extendify-local"),attachTo:{element:"#menu-tools",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Settings","extendify-local"),text:(0,l.__)("Advanced settings for your site and for certain plugins.","extendify-local"),attachTo:{element:"#menu-settings",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("Collapse menu","extendify-local"),text:(0,l.__)("Use this toggle to collapse or expand the sidebar menu.","extendify-local"),attachTo:{element:"#collapse-menu",offset:{marginTop:0,marginLeft:15},position:{x:"right",y:"top"},hook:"top left"},events:{}},{title:(0,l.__)("User","extendify-local"),text:(0,l.__)("Manage your profile or log out of your account here.","extendify-local"),attachTo:{element:"#wp-admin-bar-user-actions",offset:{marginTop:0,marginLeft:-15},position:{x:"left",y:"top"},hook:"top right"},events:{beforeAttach:()=>{const e=document.querySelector("#wp-admin-bar-my-account .ab-sub-wrapper");e.style.position="relative",e.style.display="block"},onAttach:()=>{const e=document.querySelector("#wp-admin-bar-my-account .ab-sub-wrapper");e.style.position="relative",e.style.display="block",document.querySelector("#help-center-tour-next-button")?.focus()},onDetach:()=>{const e=document.querySelector("#wp-admin-bar-my-account .ab-sub-wrapper");e.style.position="absolute",e.style.display=""}}}]},"plugin-install-tour":Re,"plugin-management-tour":Ve,"page-editor-tour":De,"library-tour":_e,"users-screen-tour":je,"site-assistant-tour":Fe},Be=({onOpen:e,classes:t})=>{const{startTour:n}=Pe(),{setVisibility:o}=be(),i=Object.values(Ie).filter((e=>e.settings.startFrom.includes(window.location.href)||!e.settings.startFrom));return(0,r.createElement)("section",{className:t,"data-test":"help-center-tours-section"},(0,r.createElement)("button",{"data-test":"help-center-tours-open-button",type:"button",onClick:e,className:S()("m-0 flex w-full cursor-pointer justify-between gap-2 rounded-md border border-gray-200 bg-transparent p-2.5 text-left hover:bg-gray-100",{"rounded-b-none":i.length>0})},(0,r.createElement)(v.Z,{icon:ye,className:"rounded-full border-0 bg-design-main fill-design-text p-2",size:48}),(0,r.createElement)("div",{className:"grow pl-1"},(0,r.createElement)("h1",{className:"m-0 p-0 text-lg font-medium"},(0,l.__)("Tours","extendify-local")),(0,r.createElement)("p",{className:"m-0 p-0 text-xs text-gray-800"},(0,l.__)("Learn more about your WordPress admin","extendify-local"))),(0,r.createElement)("div",{className:"flex h-12 grow-0 items-center justify-between"},(0,r.createElement)(v.Z,{icon:x.Z,size:24,className:"fill-current text-gray-700"}))),i.length>0&&(0,r.createElement)("button",{type:"button",className:"text-md m-0 flex w-full cursor-pointer items-center justify-between gap-2 rounded-md rounded-t-none border border-t-0 border-gray-200 bg-transparent p-3 px-4 pl-[4.25rem] text-left font-medium text-gray-900 hover:bg-gray-100",onClick:()=>{o("minimized"),n(i[0])}},(0,l.__)("Tour this page","extendify-local"),(0,r.createElement)(v.Z,{icon:xe,size:16})))},He=[{slug:"tours",title:(0,l.__)("Tours","extendify-local"),component:()=>{const{wasCompleted:e,startTour:t}=Pe(),{setVisibility:n}=be();return(0,r.createElement)("section",{className:"p-4"},(0,r.createElement)("ul",{className:"m-0 flex flex-col gap-2 p-0","data-test":"help-center-tours-items-list"},Object.values(Ie).map((o=>{const{id:i,title:s}=o;return(0,r.createElement)("li",{key:i,className:"m-0 p-0"},(0,r.createElement)("button",{type:"button",className:"m-0 flex w-full cursor-pointer items-center justify-between gap-2 bg-gray-100 px-4 py-3.5 text-sm font-medium text-gray-900 hover:bg-gray-150",onClick:()=>{n("minimized"),t(o)}},s,e(i)?(0,r.createElement)(v.Z,{"data-test":"restart-tour-icon",icon:we,size:16}):(0,r.createElement)(v.Z,{"data-test":"play-tour-icon",icon:xe,size:16})))}))))}}],ze=[{slug:"dashboard",title:(0,l.__)("Help Center","extendify-local"),component:()=>{const{navigateTo:e}=$e();return(0,r.createElement)("div",{className:"mx-auto flex w-full max-w-md flex-col gap-3 rounded-2xl p-4"},(0,r.createElement)(ge,{onOpen:()=>e("knowledge-base")}),(0,r.createElement)(Be,{onOpen:()=>e("tours"),classes:"hidden md:block"}),window.extSharedData?.aiChatEnabled&&(0,r.createElement)(X,{onOpen:()=>e("ai-chat")}))}},...ve,...He,...Q],Ue={history:[],viewedPages:[],current:null},We=(0,f.Ue)((0,g.tJ)((0,g.mW)(((e,t)=>{var n;return{...Ue,...null!==(n=(0,p.a)(window.extHelpCenterData.userData.routerData)?.state)&&void 0!==n?n:{},goBack:()=>{if(t().history.length<2)return;const n=t().history[1];m.j.getState().incrementActivity(`hc-${n.slug}-back`),e((e=>({history:e.history.slice(1),current:n})))},setCurrent:n=>{if(!n)return;if(t().history[0]?.slug===n.slug)return;const r=t(),o=(new Date).toISOString(),i=o,s=r.viewedPages.find((e=>e.slug===n.slug)),a=[...r.viewedPages.filter((e=>e.slug!==n.slug)),s?{...s,count:Number(s.count)+1,lastViewedAt:o}:{slug:n.slug,firstViewedAt:i,lastViewedAt:o,count:1}];h()({path:"/extendify/v1/help-center/router-data",method:"POST",data:{state:{viewedPages:a}}}),e({history:[n,...r.history].filter(Boolean),current:n,viewedPages:a})},reset:()=>e({...Ue})}}),{name:"Extendify Help Center Router"}),{name:"extendify-help-center-router",storage:(0,g.FL)((()=>sessionStorage)),partialize:({history:e,current:t})=>({history:e,current:{...t,component:null}})})),$e=()=>{var e,t;const{current:n,setCurrent:o,history:i,goBack:a,reset:l}=We(),c=null!==(e=null!==(t=n?.component)&&void 0!==t?t:ze.find((e=>e.slug===n?.slug))?.component)&&void 0!==e?e:()=>null;return(0,s.useEffect)((()=>{n||o(ze[0])}),[n,o]),{current:n,CurrentPage:(0,s.useCallback)((()=>(0,r.createElement)("div",{role:"region","aria-live":"polite",className:"h-full"},(0,r.createElement)("h1",{className:"sr-only"},n?.title),(0,r.createElement)(c,null))),[n]),navigateTo:e=>{const t=ze.find((t=>t.slug===e));if(!t)return o(ze[0]);m.j.getState().incrementActivity(`hc-${t.slug}`),o(t)},goBack:a,history:i,reset:l}},qe=()=>{const{CurrentPage:e}=$e();return(0,r.createElement)("div",{className:"h-full w-full"},(0,r.createElement)(e,null))};var Ze=n(4310);const Ye=(0,Y.jsx)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Y.jsx)(Z.Path,{d:"M7 11.5h10V13H7z"})}),{partnerLogo:Ge,partnerName:Ke}=window.extSharedData,Xe=()=>{const{visibility:e,setVisibility:t}=be(),{incrementActivity:n}=(0,m.j)(),{current:o,history:i}=$e(),s="minimized"===e,a=()=>{const e=s?"open":"minimized";n(`hc-toggle-button-${e}`),t(e)};return(0,r.createElement)("div",{className:"relative flex items-center justify-end gap-x-2 bg-banner-main p-4"},(0,r.createElement)("div",{role:s?"button":"heading",onClick:s?a:void 0,"aria-label":s?(0,l.__)("Show Help Center","extendify-local"):void 0,"aria-expanded":s?"false":"true",className:S()("flex w-full justify-between bg-banner-main",{"cursor-pointer":s})},(0,r.createElement)("div",{className:S()("flex w-full gap-1",{"gap-4":1===i.length})},(0,r.createElement)(Je,null),o?.title&&(0,r.createElement)("span",{className:"border-banner-text text-base font-medium text-banner-text"},o.title))),(0,r.createElement)("div",{className:"flex items-center justify-end gap-2.5"},(0,r.createElement)("button",{className:"m-0 cursor-pointer border-0 bg-transparent fill-banner-text p-0 text-banner-text",type:"button","data-test":"help-center-toggle-minimize-button",onClick:a},s?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(v.Z,{className:"rotate-90 fill-current",icon:Ze.Z,size:24}),(0,r.createElement)("span",{className:"sr-only"},(0,l.__)("Show Help Center","extendify-local"))):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(v.Z,{className:"fill-current",icon:Ye,size:24}),(0,r.createElement)("span",{className:"sr-only"},(0,l.__)("Minimize Help Center","extendify-local")))),(0,r.createElement)("button",{className:"m-0 cursor-pointer border-0 bg-transparent fill-banner-text p-0 text-banner-text",type:"button","data-test":"help-center-close-button",onClick:()=>{n(`hc-close-button-when-${e}`),t("closed")}},(0,r.createElement)(v.Z,{icon:de.Z,size:24}),(0,r.createElement)("span",{className:"sr-only"},(0,l.__)("close","extendify-local")))))},Je=()=>{const{goBack:e,history:t}=$e(),{visibility:n}=be();return t.length>1&&"open"===n?(0,r.createElement)("button",{className:"m-0 cursor-pointer border-0 bg-transparent fill-banner-text p-0 text-banner-text",type:"button",onClick:e},(0,r.createElement)(v.Z,{icon:Ze.Z}),(0,r.createElement)("span",{className:"sr-only"},(0,l.__)("Go back","extendify-local"))):Ge?(0,r.createElement)("div",{className:"flex h-6 justify-center bg-banner-main after:relative after:-right-2 after:top-0.5 after:mr-2 after:text-banner-text after:opacity-40 after:content-['|']"},(0,r.createElement)("div",{className:"flex h-6 max-w-[9rem] overflow-hidden"},(0,r.createElement)("img",{className:"max-h-full max-w-full object-contain",src:Ge,alt:Ke}))):null},Qe=()=>(0,r.createElement)("div",{className:"overflow-hidden rounded-md border border-gray-500 shadow-2xl","data-test":"help-center-minimize-state"},(0,r.createElement)(Xe,null)),et=()=>{const{visibility:e}=be(),{reset:t}=$e(),{reset:n}=se(),{reset:o}=F();return(0,s.useEffect)((()=>{"closed"===e&&(t(),n(),o())}),[o,n,t,e]),"minimized"===e?(0,r.createElement)("div",{className:"extendify-help-center"},(0,r.createElement)("div",{className:"fixed bottom-0 right-0 z-high mx-auto w-[420px] md:m-8"},(0,r.createElement)(Qe,null))):"open"!==e?null:(0,r.createElement)(c.Vq,{ref:async()=>{await Promise.resolve(),document?.documentElement?.style&&(document.documentElement.style.overflow="unset",document.documentElement.style.paddingRight="unset")},className:"extendify-help-center","data-test":"help-center-modal",open:"open"===e,static:!0,onClose:()=>{}},(0,r.createElement)("div",{className:"fixed bottom-0 right-0 z-high mx-auto h-full max-h-[589px] w-full max-w-[420px] md:m-8 md:mt-20"},(0,r.createElement)(u.E.div,{key:"help-center-modal",initial:{y:6,opacity:0},animate:{y:0,opacity:1},exit:{y:0,opacity:0},transition:{duration:.2,delay:.1},className:"relative mx-auto h-full w-full shadow-2xl-flipped sm:flex sm:overflow-hidden md:rounded-md md:shadow-2xl"},(0,r.createElement)(c.$N,{className:"sr-only"},(0,l.__)("Extendify Help Center","extendify-local")),(0,r.createElement)("div",{className:"relative flex h-full w-full flex-col rounded-md border border-gray-400 bg-gray-50 md:overflow-hidden"},(0,r.createElement)(Xe,null),(0,r.createElement)("div",{className:"flex-grow overflow-y-auto overscroll-contain"},(0,r.createElement)(qe,null))))))},tt=e=>{const{top:t,right:n,bottom:r,left:o,width:i,height:s,x:a,y:l}=e.getBoundingClientRect();return{top:t,right:n,bottom:r,left:o,width:i,height:s,x:a,y:l}},nt=()=>{var e,t;const n=(0,s.useRef)(),{currentTour:o,currentStep:i,startTour:d,closeCurrentTour:h,getStepData:p,onTourPage:m}=Pe(),{settings:f}=o||{},{image:g,title:y,text:x,attachTo:w,events:b,options:E}=p(i),{queueTourForRedirect:S,queuedTour:T,clearQueuedTour:C}=be(),{element:P,frame:k,offset:A,position:_,hook:L,boxPadding:M}=w||{},N=(0,s.useMemo)((()=>"function"==typeof P?P():P),[P]),D=(0,s.useMemo)((()=>"function"==typeof k?k():k),[k]),O=(0,s.useMemo)((()=>"function"==typeof A?A():A),[A]),R=(0,s.useMemo)((()=>"function"==typeof L?L():L),[L]),V=(0,s.useRef)(),F=(0,s.useRef)(!1),[j,B]=(0,s.useState)(null),[H,z]=(0,s.useState)(!1),[U,W]=(0,s.useState)(!1),[$,q]=(0,s.useState)(null),[Z,Y]=(0,s.useState)({x:void 0,y:void 0,...O}),G=(0,s.useCallback)(((e,t)=>{Y(20===e?{x:e,y:t}:{x:e,y:t,...O})}),[O]),K=(0,s.useCallback)((()=>{const e=R?.split(" ")||[];return{x:e.includes("right")?n.current?.offsetWidth:0,y:e.includes("bottom")?n.current?.offsetHeight:0}}),[R]),X=(0,s.useCallback)((()=>{var e,t,r,o;if(!j)return;const i=D&&null!==(e=document.querySelector(D)?.contentDocument)&&void 0!==e?e:document,s=tt(null!==(t=i.querySelector(N))&&void 0!==t?t:j);if(i!==document){const e=tt(i.defaultView.frameElement);s.x+=e.x,s.left+=e.x,s.right+=e.x,s.y+=e.y,s.top+=e.y,s.bottom+=e.y}if(window.innerWidth<=960)return void h("closed-resize");if(void 0===_?.x)return G(void 0,void 0),q(null),void W(!1);const a=Math.max(20,s?.[_.x]-K().x),l=Math.max(20,s?.[_.y]-K().y),c=n.current;G(Math.min(a,window.innerWidth-(null!==(r=c?.offsetWidth)&&void 0!==r?r:0)-20),Math.min(l,window.innerHeight-(null!==(o=c?.offsetHeight)&&void 0!==o?o:0)-20)),q(s)}),[j,_,K,G,D,N,h]);if((0,s.useLayoutEffect)((()=>{f?.startFrom&&(m()||(z(!0),S(o.id),h("redirected"),window.location.assign(f?.startFrom[0]),window.location.href.split("#")[0]===f.startFrom[0].split("#")[0]&&window.location.reload()))}),[f?.startFrom,o,S,h,m]),(0,s.useEffect)((()=>{i&&document.querySelectorAll("[inert]").forEach((e=>e?.removeAttribute("inert")))}),[i]),(0,s.useEffect)((()=>{const e=e=>{const{tourSlug:t}=e.detail;Ie[t]&&requestAnimationFrame((()=>{window.dispatchEvent(new CustomEvent("extendify-hc:minimize")),d(Ie[t])}))};return window.addEventListener("extendify-assist:start-tour",e),()=>{window.removeEventListener("extendify-assist:start-tour",e)}}),[d]),(0,s.useLayoutEffect)((()=>{if(H)return;const e=T;let t=0;if(!e||!Ie[e])return C();const n=()=>{requestAnimationFrame((()=>{d(Ie[e])})),C()};return addEventListener("load",n),"complete"===document.readyState&&(t=requestAnimationFrame(n)),()=>{cancelAnimationFrame(t),removeEventListener("load",n)}}),[d,T,C,H]),(0,s.useEffect)((()=>{var e,t;if(!N)return;const n=null!==(t=(D&&null!==(e=document.querySelector(D)?.contentDocument)&&void 0!==e?e:document).querySelector(N))&&void 0!==t?t:document.querySelector(N);return n?(B(n),()=>B(null)):void 0}),[D,N]),(0,s.useLayoutEffect)((()=>{if(j&&!H)return W(!0),X(),addEventListener("resize",X),E?.allowPointerEvents||(j.style.pointerEvents="none"),()=>{removeEventListener("resize",X),j.style.pointerEvents="auto"}}),[H,j,X,E]),(0,s.useEffect)((()=>{F.current||i&&(F.current=!0)}),[i]),(0,s.useEffect)((()=>{if(void 0===i||!j)return;b?.onAttach?.(j);let e=0;const t=requestAnimationFrame((()=>{j.scrollIntoView({block:"start"}),X(),e=requestAnimationFrame(X)}));return V?.current?.focus(),()=>{b?.onDetach?.(j),cancelAnimationFrame(t),cancelAnimationFrame(e)}}),[i,b,j,X,V]),(0,s.useLayoutEffect)((()=>{if(f?.allowOverflow)return document.documentElement.classList.add("ext-force-overflow-auto"),()=>{document.documentElement.classList.remove("ext-force-overflow-auto")}}),[f]),!U)return null;const J=it($,M);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.M,null,Boolean(o)&&(0,r.createElement)(c.Vq,{as:u.E.div,static:!0,initialFocus:V,className:"extendify-help-center",open:Boolean(o),onClose:()=>{}},(0,r.createElement)("div",{className:"relative z-max"},(0,r.createElement)(u.E.div,{ref:n,animate:{opacity:1,...Z},initial:{opacity:0,...Z},onAnimationComplete:()=>{X()},transition:{duration:F.current?.5:0,ease:"easeInOut"},className:"fixed left-0 top-0 z-20 flex max-w-xs flex-col bg-transparent shadow-2xl sm:overflow-hidden",style:{minWidth:null!==(e=f?.minBoxWidth)&&void 0!==e?e:"325px"}},(0,r.createElement)("button",{"data-test":"close-tour",className:"absolute right-0 top-0 z-20 m-2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full border-0 bg-white p-0 leading-none outline-none ring-1 ring-gray-200 focus:shadow-none focus:ring-wp focus:ring-design-main",onClick:()=>h("closed-manually"),"aria-label":(0,l.__)("Close Modal","extendify-local")},(0,r.createElement)(v.Z,{icon:I.Z,className:"h-4 w-4 fill-current"})),(0,r.createElement)(c.Vq.Title,{className:"sr-only"},null!==(t=o?.title)&&void 0!==t?t:(0,l.__)("Tour","extendify-local")),g&&(0,r.createElement)("div",{className:"w-full p-6",style:{minHeight:150,background:"linear-gradient(58.72deg, #485563 7.71%, #29323C 92.87%)"}},(0,r.createElement)("img",{src:g,className:"block w-full",alt:y})),(0,r.createElement)("div",{className:"relative m-0 bg-white p-6 pt-0 text-left"},y&&(0,r.createElement)("h2",{className:"mb-2 text-xl font-medium"},y),x&&(0,r.createElement)("p",{className:"mb-6"},x),(0,r.createElement)(ot,{initialFocus:V})))))),E?.allowPointerEvents||(0,r.createElement)("div",{"aria-hidden":!0,className:"fixed inset-0 z-max-1"}),(0,r.createElement)(a.M,null,Boolean(o)&&void 0!==$?.left&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(u.E.div,{initial:{opacity:0,clipPath:"polygon(0px 0px, 100% 0px, 100% 100%, 0px 100%, 0 0)"},animate:{opacity:1,clipPath:`polygon(0px 0px, 100% 0px, 100% 100%, 0px 100%, 0 0, ${J.left}px 0, ${J.left}px ${J?.bottom}px, ${J?.right}px ${J.bottom}px, ${J.right}px ${J.top}px, ${J.left}px ${J.top}px)`},transition:{duration:F.current?.5:0,ease:"easeInOut"},className:"fixed inset-0 z-max-1 hidden bg-black/70 lg:block","aria-hidden":"true"}),(0,r.createElement)(rt,{rectWithPadding:J,finishedStepOne:F}))))},rt=({rectWithPadding:e,finishedStepOne:t})=>{const[n,o]=(0,s.useState)(!1);return(0,r.createElement)(u.E.div,{initial:{...null!=e?e:{}},animate:{...null!=e?e:{}},transition:{duration:t.current?.5:0,ease:"easeInOut"},onAnimationStart:()=>o(!1),onAnimationComplete:()=>o(!0),className:S()("fixed inset-0 z-high hidden border-2 lg:block",{"border-transparent":!n,"border-design-main":n}),"aria-hidden":"true"})},ot=({initialFocus:e})=>{const{goToStep:t,completeCurrentTour:n,currentStep:o,preparingStep:i,getStepData:s,hasNextStep:c,nextStep:d,hasPreviousStep:h,prevStep:p,currentTour:m}=Pe(),{options:f={}}=s(o),{hideBackButton:g=!1}=f,{steps:v,settings:y}=m||{};return(0,r.createElement)("div",{id:"extendify-tour-navigation",className:"flex w-full items-center justify-between"},(0,r.createElement)("div",{className:"flex flex-1 justify-start"},(0,r.createElement)(a.M,null,h()&&!g&&(0,r.createElement)(u.E.div,{initial:{opacity:0},animate:{opacity:1}},(0,r.createElement)("button",{className:"flex h-8 items-center justify-center gap-2 rounded-sm bg-transparent p-0 text-gray-900 ring-design-main hover:bg-transparent focus:outline-none focus:ring-wp focus:ring-offset-1 focus:ring-offset-white disabled:opacity-60",onClick:p,disabled:i>-1},i2&&!y?.hideDotsNav?(0,r.createElement)("nav",{role:"navigation","aria-label":(0,l.__)("Tour Steps","extendify-local"),className:"flex flex-1 -translate-x-3 items-center justify-center gap-1"},v.map(((e,n)=>(0,r.createElement)("div",{key:n},(0,r.createElement)("button",{"aria-label":(0,l.sprintf)(
// translators: %1$s is the current step, %2$s is the total number of steps
(0,l.__)("%1$s of %2$s","extendify-local"),n+1,v.length),"aria-current":n===o,className:"m-0 block h-2.5 w-2.5 cursor-pointer rounded-full p-0 ring-offset-1 ring-offset-white focus:outline-none focus:ring-wp focus:ring-design-main "+(n===o?"bg-design-main":"bg-gray-300"),onClick:()=>t(n),disabled:i>-1}))))):null,(0,r.createElement)("div",{className:"flex flex-1 justify-end"},c()?(0,r.createElement)(H.Button,{ref:e,id:"help-center-tour-next-button","data-test":"help-center-tour-next-button",onClick:d,disabled:i>-1,className:"flex gap-2 bg-design-main text-design-text focus:text-design-text disabled:opacity-60",variant:"primary"},i>o&&(0,r.createElement)(H.Spinner,{className:"m-0 h-4 text-design-main"}),(0,r.createElement)("span",null,(0,l.__)("Next","extendify-local"))):(0,r.createElement)(H.Button,{id:"help-center-tour-next-button","data-test":"help-center-tour-next-button",onClick:()=>{n()},className:"bg-design-main",variant:"primary"},(0,l.__)("Done","extendify-local"))))},it=(e,t)=>{var n,r,o,i,s,a,l,c,u,d;return{top:e.top-(null!==(n=t?.top)&&void 0!==n?n:0),left:e.left-(null!==(r=t?.left)&&void 0!==r?r:0),right:e.right+(null!==(o=t?.right)&&void 0!==o?o:0),bottom:e.bottom+(null!==(i=t?.bottom)&&void 0!==i?i:0),width:e.width+(null!==(s=t?.left)&&void 0!==s?s:0)+(null!==(a=t?.right)&&void 0!==a?a:0),height:e.height+(null!==(l=t?.top)&&void 0!==l?l:0)+(null!==(c=t?.bottom)&&void 0!==c?c:0),x:e.x-(null!==(u=t?.left)&&void 0!==u?u:0),y:e.y-(null!==(d=t?.top)&&void 0!==d?d:0)}},st=()=>{const{setVisibility:e,visibility:t}=be(),{navigateTo:n}=$e();return(0,s.useEffect)((()=>{const r=t=>{t?.detail?.page&&n(t.detail.page),e("open")},o=()=>{"open"===t&&e("minimized")};return window.addEventListener("extendify-hc:open",r),window.addEventListener("extendify-hc:minimize",o),()=>{window.removeEventListener("extendify-hc:open",r),window.removeEventListener("extendify-hc:minimize",o)}}),[e,t,n]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.M,null,(0,r.createElement)(et,null)),(0,r.createElement)(nt,null))},at=(e,t)=>{"function"==typeof s.createRoot?(0,s.createRoot)(t).render(e):(0,s.render)(e,t)},lt=()=>{const e=new URLSearchParams(window.location.search);return["page"].includes(e.get("extendify-launch"))};var ct=n(8817),ut=n(6329);const dt=()=>{const{setVisibility:e}=be(),{incrementActivity:t}=(0,m.j)();return(0,r.createElement)("button",{type:"button","data-test":"help-center-adminbar-button",onClick:()=>{e("open"),t("hc-admin-bar-button")},className:"m-1.5 -mt-1 inline-flex h-6 cursor-pointer items-center justify-center gap-1 rounded-sm border-0 bg-wp-theme-main p-1 px-2 leading-extra-tight text-white ring-offset-1 ring-offset-wp-theme-bg focus:outline-none focus:ring-wp focus:ring-wp-theme-main"},(0,l.__)("Help","extendify-local"),(0,r.createElement)(H.Icon,{icon:ut.Z,width:18,height:18,className:"fill-design-text"}))},ht=()=>{const{setVisibility:e}=be(),{incrementActivity:t}=(0,m.j)();return(0,r.createElement)(H.Button,{className:"is-compact ml-1 inline-flex gap-1","data-test":"help-center-editor-page-button",onClick:()=>{e("open"),t("hc-editor-page-button")},variant:"primary"},(0,l.__)("Help","extendify-local"),(0,r.createElement)(v.Z,{icon:ut.Z,width:18,height:18,className:"fill-design-text"}))};(()=>{if(lt())return;const e="wp-admin-bar-help-center-btn";if(document.getElementById(e))return;const t=Object.assign(document.createElement("li"),{className:"extendify-help-center",id:e});document.querySelector("#wp-admin-bar-my-account")?.after(t),at((0,r.createElement)(dt,null),t)})(),(0,ct.registerPlugin)("extendify-help-center-buttons",{render:()=>(0,r.createElement)(pt,null)});const pt=()=>((0,s.useEffect)((()=>{if(lt())return;const e="extendify-gtnbrg-help-center-btn";if(document.getElementById(e))return;const t=Object.assign(document.createElement("span"),{className:"extendify-help-center",id:e});requestAnimationFrame((()=>{requestAnimationFrame((()=>{document.getElementById(e)||(document.querySelector('[aria-controls="edit-post:document"]')?.after(t),document.querySelector('[aria-controls="edit-site:template"]')?.after(t),at((0,r.createElement)(ht,null),t))}))}))}),[]),null);i()((()=>{if(lt())return;const e="extendify-help-center-main";if(document.getElementById(e))return;const t=Object.assign(document.createElement("div"),{className:"extendify-help-center",id:e});document.body.append(t),at((0,r.createElement)(st,null),t)}))},7403:(e,t,n)=>{"use strict";n.d(t,{a:()=>r});const r=e=>{try{return JSON.parse(e)}catch(e){return{}}}},6993:(e,t,n)=>{"use strict";n.d(t,{j:()=>h});var r=n(6989),o=n.n(r),i=n(7403),s=n(270),a=n(782);const l="/extendify/v1/shared/activity",c={getItem:()=>o()({path:l}),setItem:(e,t)=>o()({path:l,method:"POST",data:{state:t}})},u=(0,i.a)(window.extSharedData.activity),d={actions:{}},h=(0,s.Ue)((0,a.tJ)((0,a.mW)(((e,t)=>{var n;return{...d,...null!==(n=u?.state)&&void 0!==n?n:{},incrementActivity:n=>{e((e=>({...e,actions:{...e.actions,[n]:Number(t().actions[n]||0)+1}})))}}}),{name:"Extendify Activity"}),{name:"extendify_shared_activity",storage:(0,a.FL)((()=>c)),skipHydration:!0}))},424:(e,t,n)=>{"use strict";n.d(t,{y:()=>l});var r=n(6989),o=n.n(r),i=n(270),s=n(782);const a={setItem:(e,t)=>o()({path:"/extendify/v1/shared/update-user-meta",method:"POST",data:{option:"ai_consent",value:t.state.userGaveConsent}})},l=(0,i.Ue)((0,s.tJ)((0,s.mW)(((e,t)=>{var n,r,o;return{showAIConsent:null!==(n=window.extSharedData?.showAIConsent)&&void 0!==n&&n,consentTermsHTML:null!==(r=window.extSharedData?.consentTermsHTML)&&void 0!==r?r:"",userGaveConsent:null!==(o=window.extSharedData?.userGaveConsent)&&void 0!==o&&o,setUserGaveConsent:t=>e({userGaveConsent:t}),shouldShowAIConsent:e=>{var n;const{showAIConsent:r,consentTermsHTML:o,userGaveConsent:i}=t(),s=r&&o,a={launch:s,draft:s&&!i,"help-center":s&&!i};return null!==(n=a?.[e])&&void 0!==n&&n}}}),{name:"Extendify AI Consent"}),{name:"extendify-ai-consent",storage:a,skipHydration:!0}))},2200:(e,t,n)=>{"use strict";n.d(t,{Ow:()=>s,Yy:()=>i,kE:()=>r,nX:()=>o});const r="https://patterns.extendify.com",o="https://kb.extendify.com",i="https://ai.extendify.com",s="https://insights.extendify.com"},9960:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},7915:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(9960),s=n(7790);o(n(7790),t);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=a),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:a,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,r=new s.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===i.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new s.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new s.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new s.Text(""),t=new s.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new s.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},7790:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);t.NodeWithChildren=h;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.CDATA,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(h);t.CDATA=p;var m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Root,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(h);t.Document=m;var f=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?s.ElementType.Script:"style"===t?s.ElementType.Style:s.ElementType.Tag);var i=e.call(this,r)||this;return i.name=t,i.attribs=n,i.type=o,i}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(h);function g(e){return(0,s.isTag)(e)}function v(e){return e.type===s.ElementType.CDATA}function y(e){return e.type===s.ElementType.Text}function x(e){return e.type===s.ElementType.Comment}function w(e){return e.type===s.ElementType.Directive}function b(e){return e.type===s.ElementType.Root}function E(e,t){var n;if(void 0===t&&(t=!1),y(e))n=new c(e.data);else if(x(e))n=new u(e.data);else if(g(e)){var r=t?S(e.children):[],o=new f(e.name,i({},e.attribs),r);r.forEach((function(e){return e.parent=o})),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=i({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=i({},e["x-attribsPrefix"])),n=o}else if(v(e)){r=t?S(e.children):[];var s=new p(r);r.forEach((function(e){return e.parent=s})),n=s}else if(b(e)){r=t?S(e.children):[];var a=new m(r);r.forEach((function(e){return e.parent=a})),e["x-mode"]&&(a["x-mode"]=e["x-mode"]),n=a}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var l=new d(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function S(e){for(var t=e.map((function(e){return E(e,!0)})),n=1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce((function(e,t){return e[t.toLowerCase()]=t,e}),{})},8276:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,u,d=e.match(i),h=d&&d[1]?d[1].toLowerCase():"";switch(h){case n:var m=c(e);return s.test(e)||null===(t=null==(g=m.querySelector(r))?void 0:g.parentNode)||void 0===t||t.removeChild(g),a.test(e)||null===(u=null==(g=m.querySelector(o))?void 0:g.parentNode)||void 0===u||u.removeChild(g),m.querySelectorAll(n);case r:case o:var f=l(e).querySelectorAll(h);return a.test(e)&&s.test(e)?f[0].parentNode.childNodes:f;default:return p?p(e):(g=l(e,o).querySelector(o)).childNodes;var g}};var n="html",r="head",o="body",i=/<([a-zA-Z]+[0-9]?)/,s=//i,a=//i,l=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u="object"==typeof window&&window.DOMParser;if("function"==typeof u){var d=new u;l=c=function(e,t){return t&&(e="<".concat(t,">").concat(e,"").concat(t,">")),d.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var h=document.implementation.createHTMLDocument();l=function(e,t){if(t){var n=h.documentElement.querySelector(t);return n&&(n.innerHTML=e),h}return h.documentElement.innerHTML=e,h}}var p,m="object"==typeof document&&document.createElement("template");m&&m.content&&(p=function(e){return m.innerHTML=e,m.content.childNodes})},4152:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t=e.match(s),n=t?t[1]:void 0;return(0,i.formatDOM)((0,o.default)(e),null,n)};var o=r(n(8276)),i=n(1507),s=/<(![a-zA-Z\s]+)>/},1507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatAttributes=i,t.formatDOM=function e(t,n,o){void 0===n&&(n=null);for(var a,l=[],c=0,u=t.length;c{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0===e&&(e={});var n={},c=Boolean(e.type&&a[e.type]);for(var u in e){var d=e[u];if((0,r.isCustomAttribute)(u))n[u]=d;else{var h=u.toLowerCase(),p=l(h);if(p){var m=(0,r.getPropertyInfo)(p);switch(i.includes(p)&&s.includes(t)&&!c&&(p=l("default"+h)),n[p]=d,m&&m.type){case r.BOOLEAN:n[p]=!0;break;case r.OVERLOADED_BOOLEAN:""===d&&(n[p]=!0)}}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=d)}}return(0,o.setStyleProp)(e.style,n),n};var r=n(5726),o=n(4606),i=["checked","value"],s=["input","select","textarea"],a={reset:!0,submit:!0};function l(e){return r.possibleStandardNames[e]}},3670:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){void 0===n&&(n={});for(var r=[],o="function"==typeof n.replace,c=n.transform||s.returnFirstArg,u=n.library||a,d=u.cloneElement,h=u.createElement,p=u.isValidElement,m=t.length,f=0;f1&&(v=d(v,{key:v.key||f})),r.push(c(v,g,f));continue}}if("text"!==g.type){var y=g,x={};l(y)?((0,s.setStyleProp)(y.attribs.style,y.attribs),x=y.attribs):y.attribs&&(x=(0,i.default)(y.attribs,y.name));var w=void 0;switch(g.type){case"script":case"style":g.children[0]&&(x.dangerouslySetInnerHTML={__html:g.children[0].data});break;case"tag":"textarea"===g.name&&g.children[0]?x.defaultValue=g.children[0].data:g.children&&g.children.length&&(w=e(g.children,n));break;default:continue}m>1&&(x.key=f),r.push(c(h(g.name,x,w),g,f))}else{var b=!g.data.trim().length;if(b&&g.parent&&!(0,s.canTextBeChildOfNode)(g.parent))continue;if(n.trim&&b)continue;r.push(c(g.data,g,f))}}return 1===r.length?r[0]:r};var o=n(9196),i=r(n(484)),s=n(4606),a={cloneElement:o.cloneElement,createElement:o.createElement,isValidElement:o.isValidElement};function l(e){return s.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,s.isCustomComponent)(e.name,e.attribs)}},3426:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,s.default)((0,o.default)(e,(null==t?void 0:t.htmlparser2)||l),t):[]};var o=r(n(4152));t.htmlToDOM=o.default;var i=r(n(484));t.attributesToProps=i.default;var s=r(n(3670));t.domToReact=s.default;var a=n(7915);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return a.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return a.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return a.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return a.Text}});var l={lowerCaseAttributeNames:!1}},4606:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=function(e,t){return e.includes("-")?!s.has(e):Boolean(t&&"string"==typeof t.is)},t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,i.default)(e,a)}catch(e){t.style={}}else t.style={}};var o=n(9196),i=r(n(1476)),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),a={reactCompat:!0};t.PRESERVE_CUSTOM_ATTRIBUTES=Number(o.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),t.canTextBeChildOfNode=function(e){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)},t.returnFirstArg=function(e){return e}},8139:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,h=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");h=~r?e.length-r:h+e.length}function m(){var e={line:d,column:h};return function(t){return t.position=new f(e),x(),t}}function f(e){this.start=e,this.end={line:d,column:h},this.source=l.source}f.prototype.content=e;var g=[];function v(t){var n=new Error(l.source+":"+d+":"+h+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=h,n.source=e,!l.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function x(){y(r)}function w(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=m();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return h+=2,p(r),e=e.slice(n),h+=2,t({type:"comment",comment:r})}}function E(){var e=m(),n=y(o);if(n){if(b(),!y(i))return v("property missing ':'");var r=y(s),l=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return y(a),l}}return x(),function(){var e,t=[];for(w(t);e=E();)!1!==e&&(t.push(e),w(t));return t}()}},5726:(e,t,n)=>{"use strict";function r(e,t,n,r,o,i,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}const o={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach((e=>{o[e]=new r(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((([e,t])=>{o[e]=new r(e,1,!1,t,null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((e=>{o[e]=new r(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((e=>{o[e]=new r(e,2,!1,e,null,!1,!1)})),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach((e=>{o[e]=new r(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((e=>{o[e]=new r(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((e=>{o[e]=new r(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((e=>{o[e]=new r(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((e=>{o[e]=new r(e,5,!1,e.toLowerCase(),null,!1,!1)}));const i=/[\-\:]([a-z])/g,s=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach((e=>{const t=e.replace(i,s);o[t]=new r(t,1,!1,e,null,!1,!1)})),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach((e=>{const t=e.replace(i,s);o[t]=new r(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((e=>{const t=e.replace(i,s);o[t]=new r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!1,!1)})),o.xlinkHref=new r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!0,!0)}));const{CAMELCASE:a,SAME:l,possibleStandardNames:c}=n(8229),u=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),d=Object.keys(c).reduce(((e,t)=>{const n=c[t];return n===l?e[t]=t:n===a?e[t.toLowerCase()]=t:e[t]=n,e}),{});t.BOOLEAN=3,t.BOOLEANISH_STRING=2,t.NUMERIC=5,t.OVERLOADED_BOOLEAN=4,t.POSITIVE_NUMERIC=6,t.RESERVED=0,t.STRING=1,t.getPropertyInfo=function(e){return o.hasOwnProperty(e)?o[e]:null},t.isCustomAttribute=u,t.possibleStandardNames=d},8229:(e,t)=>{t.SAME=0,t.CAMELCASE=1,t.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},5251:(e,t,n)=>{"use strict";var r=n(9196),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:a.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},5893:(e,t,n)=>{"use strict";e.exports=n(5251)},1476:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(5174)),o=n(6678);function i(e,t){var n={};return e&&"string"==typeof e?((0,r.default)(e,(function(e,r){e&&r&&(n[(0,o.camelCase)(e,t)]=r)})),n):n}i.default=i,e.exports=i},6678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,o=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||o.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,l):e.replace(i,l)).replace(r,a))}},5174:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(8139));t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,o.default)(e),i="function"==typeof t;return r.forEach((function(e){if("declaration"===e.type){var r=e.property,o=e.value;i?t(r,o,e):o&&((n=n||{})[r]=o)}})),n}},3250:(e,t,n)=>{"use strict";var r=n(9196),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return a((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),s((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},139:(e,t,n)=>{"use strict";var r=n(9196),o=n(1688),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.useSyncExternalStore,a=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c((function(){function e(e){if(!l){if(l=!0,s=e,e=r(e),void 0!==o&&h.hasValue){var t=h.value;if(o(t,e))return a=t}return a=e}if(t=a,i(s,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(s=e,a=n)}var s,a,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var p=s(e,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=p}),[p]),u(p),p}},1688:(e,t,n)=>{"use strict";e.exports=n(3250)},2798:(e,t,n)=>{"use strict";e.exports=n(139)},9196:e=>{"use strict";e.exports=window.React},6989:e=>{"use strict";e.exports=window.wp.apiFetch},4981:e=>{"use strict";e.exports=window.wp.blocks},5609:e=>{"use strict";e.exports=window.wp.components},9307:e=>{"use strict";e.exports=window.wp.element},5736:e=>{"use strict";e.exports=window.wp.i18n},8817:e=>{"use strict";e.exports=window.wp.plugins},444:e=>{"use strict";e.exports=window.wp.primitives},3967:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t{"use strict";n.d(t,{Vq:()=>Oe,$N:()=>De});var r=n(9196),o=n(1363),i=n(3855);function s(e,t,n,o){let s=(0,i.E)(n);(0,r.useEffect)((()=>{function n(e){s.current(e)}return(e=null!=e?e:window).addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}),[e,t,o])}class a extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}}function l(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let i=t[e].call(n,...o);i&&(n=i,r.forEach((e=>e())))}}}var c=n(6723);function u(e){return(0,r.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}let d=new a((()=>l((()=>[]),{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(-1===t)return this;let n=this.slice();return n.splice(t,1),n}})));function h(e,t){let n=d.get(t),o=(0,r.useId)(),i=u(n);if((0,c.e)((()=>{if(e)return n.dispatch("ADD",o),()=>n.dispatch("REMOVE",o)}),[n,e]),!e)return!1;let s=i.indexOf(o),a=i.length;return-1===s&&(s=a,a+=1),s===a-1}var p=n(3781),m=n(9362),f=n(5466);let g=new Map,v=new Map;function y(e){var t;let n=null!=(t=v.get(e))?t:0;return v.set(e,n+1),0!==n||(g.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>function(e){var t;let n=null!=(t=v.get(e))?t:1;if(1===n?v.delete(e):v.set(e,n-1),1!==n)return;let r=g.get(e);r&&(null===r["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,g.delete(e))}(e)}function x(e,{allowed:t,disallowed:n}={}){let r=h(e,"inert-others");(0,c.e)((()=>{var e,o;if(!r)return;let i=(0,m.k)();for(let t of null!=(e=null==n?void 0:n())?e:[])t&&i.add(y(t));let s=null!=(o=null==t?void 0:t())?o:[];for(let e of s){if(!e)continue;let t=(0,f.r)(e);if(!t)continue;let n=e.parentElement;for(;n&&n!==t.body;){for(let e of n.children)s.some((t=>e.contains(t)))||i.add(y(e));n=n.parentElement}}return i.dispose}),[r,t,n])}var w=n(8553),b=n(4575);function E(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function S(){return E()||/Android/gi.test(window.navigator.userAgent)}function T(e,t,n,o){let s=(0,i.E)(n);(0,r.useEffect)((()=>{if(e)return document.addEventListener(t,n,o),()=>document.removeEventListener(t,n,o);function n(e){s.current(e)}}),[e,t,o])}function C(e,t,n,o){let s=(0,i.E)(n);(0,r.useEffect)((()=>{if(e)return window.addEventListener(t,n,o),()=>window.removeEventListener(t,n,o);function n(e){s.current(e)}}),[e,t,o])}function P(...e){return(0,r.useMemo)((()=>(0,f.r)(...e)),[...e])}var k=n(6045);let A=(0,r.createContext)(null);function _({children:e,node:t}){let[n,o]=(0,r.useState)(null),i=L(null!=t?t:n);return r.createElement(A.Provider,{value:i},e,null===i&&r.createElement(k._,{features:k.x.Hidden,ref:e=>{var t,n;if(e)for(let r of null!=(n=null==(t=(0,f.r)(e))?void 0:t.querySelectorAll("html > *, body > *"))?n:[])if(r!==document.body&&r!==document.head&&r instanceof HTMLElement&&null!=r&&r.contains(e)){o(r);break}}}))}function L(e=null){var t;return null!=(t=(0,r.useContext)(A))?t:e}function M(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=null!=(n=t.defaultView)?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function N(){return E()?{before({doc:e,d:t,meta:n}){function r(e){return n.containers.flatMap((e=>e())).some((t=>t.contains(e)))}t.microTask((()=>{var n;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=(0,m.k)();n.style(e.documentElement,"scrollBehavior","auto"),t.add((()=>t.microTask((()=>n.dispose()))))}let o=null!=(n=window.scrollY)?n:window.pageYOffset,i=null;t.addEventListener(e,"click",(t=>{if(t.target instanceof HTMLElement)try{let n=t.target.closest("a");if(!n)return;let{hash:o}=new URL(n.href),s=e.querySelector(o);s&&!r(s)&&(i=s)}catch{}}),!0),t.addEventListener(e,"touchstart",(e=>{if(e.target instanceof HTMLElement)if(r(e.target)){let n=e.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;t.style(n,"overscrollBehavior","contain")}else t.style(e.target,"touchAction","none")})),t.addEventListener(e,"touchmove",(e=>{if(e.target instanceof HTMLElement){if("INPUT"===e.target.tagName)return;if(r(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}}),{passive:!1}),t.add((()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;o!==t&&window.scrollTo(0,o),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)}))}))}}:{}}function D(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let O=l((()=>new Map),{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:(0,m.k)(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:D(n)},o=[N(),M(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];o.forEach((({before:e})=>null==e?void 0:e(r))),o.forEach((({after:e})=>null==e?void 0:e(r)))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});O.subscribe((()=>{let e=O.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&O.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&O.dispatch("TEARDOWN",n)}}));var R=n(2180),V=n(3784),F=n(4782),j=n(6567);let I=(0,r.createContext)(!1);function B(){return(0,r.useContext)(I)}function H(e){return r.createElement(I.Provider,{value:e.force},e.children)}var z=n(2984),U=n(2351);let W=(0,r.createContext)(void 0),$=(0,r.createContext)(null);function q(){let e=(0,r.useContext)($);if(null===e){let e=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,q),e}return e}$.displayName="DescriptionContext";let Z=(0,U.yV)((function(e,t){let n=(0,r.useId)(),o=(0,r.useContext)(W),{id:i=`headlessui-description-${n}`,...s}=e,a=q(),l=(0,V.T)(t);(0,c.e)((()=>a.register(i)),[i,a.register]);let u=o||!1,d=(0,r.useMemo)((()=>({...a.slot,disabled:u})),[a.slot,u]),h={ref:l,...a.props,id:i};return(0,U.sY)({ourProps:h,theirProps:s,slot:d,defaultTag:"p",name:a.name||"Description"})})),Y=Object.assign(Z,{});var G=n(4192),K=n(4879),X=n(1021);function J(e){let t=(0,p.z)(e),n=(0,r.useRef)(!1);(0,r.useEffect)((()=>(n.current=!1,()=>{n.current=!0,(0,X.Y)((()=>{n.current&&t()}))})),[t])}var Q,ee=((Q=ee||{})[Q.Forwards=0]="Forwards",Q[Q.Backwards=1]="Backwards",Q);function te(e,t){let n=(0,r.useRef)([]),o=(0,p.z)(e);(0,r.useEffect)((()=>{let e=[...n.current];for(let[r,i]of t.entries())if(n.current[r]!==i){let r=o(t,e);return n.current=t,r}}),[o,...t])}let ne=[];function re(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}!function(e){function t(){"loading"!==document.readyState&&((()=>{function e(e){if(!(e.target instanceof HTMLElement)||e.target===document.body||ne[0]===e.target)return;let t=e.target;t=t.closest(b.y),ne.unshift(null!=t?t:e.target),ne=ne.filter((e=>null!=e&&e.isConnected)),ne.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}();var oe,ie=((oe=ie||{})[oe.None=0]="None",oe[oe.InitialFocus=1]="InitialFocus",oe[oe.TabLock=2]="TabLock",oe[oe.FocusLock=4]="FocusLock",oe[oe.RestoreFocus=8]="RestoreFocus",oe[oe.AutoFocus=16]="AutoFocus",oe);let se=(0,U.yV)((function(e,t){let n=(0,r.useRef)(null),o=(0,V.T)(n,t),{initialFocus:i,initialFocusFallback:a,containers:l,features:c=15,...u}=e;(0,R.H)()||(c=0);let d=P(n);!function(e,{ownerDocument:t}){let n=!!(8&e),o=function(e=!0){let t=(0,r.useRef)(ne.slice());return te((([e],[n])=>{!0===n&&!1===e&&(0,X.Y)((()=>{t.current.splice(0)})),!1===n&&!0===e&&(t.current=ne.slice())}),[e,ne,t]),(0,p.z)((()=>{var e;return null!=(e=t.current.find((e=>null!=e&&e.isConnected)))?e:null}))}(n);te((()=>{n||(null==t?void 0:t.activeElement)===(null==t?void 0:t.body)&&(0,b.C5)(o())}),[n]),J((()=>{n&&(0,b.C5)(o())}))}(c,{ownerDocument:d});let m=function(e,{ownerDocument:t,container:n,initialFocus:o,initialFocusFallback:i}){let s=(0,r.useRef)(null),a=h(!!(1&e),"focus-trap#initial-focus"),l=(0,K.t)();return te((()=>{if(0===e)return;if(!a)return void(null!=i&&i.current&&(0,b.C5)(i.current));let r=n.current;r&&(0,X.Y)((()=>{if(!l.current)return;let n=null==t?void 0:t.activeElement;if(null!=o&&o.current){if((null==o?void 0:o.current)===n)return void(s.current=n)}else if(r.contains(n))return void(s.current=n);if(null!=o&&o.current)(0,b.C5)(o.current);else{if(16&e){if((0,b.jA)(r,b.TO.First|b.TO.AutoFocus)!==b.fE.Error)return}else if((0,b.jA)(r,b.TO.First)!==b.fE.Error)return;if(null!=i&&i.current&&((0,b.C5)(i.current),(null==t?void 0:t.activeElement)===i.current))return;console.warn("There are no focusable elements inside the ")}s.current=null==t?void 0:t.activeElement}))}),[i,a,e]),s}(c,{ownerDocument:d,container:n,initialFocus:i,initialFocusFallback:a});!function(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let i=(0,K.t)(),a=!!(4&e);s(null==t?void 0:t.defaultView,"focus",(e=>{if(!a||!i.current)return;let t=re(r);n.current instanceof HTMLElement&&t.add(n.current);let s=o.current;if(!s)return;let l=e.target;l&&l instanceof HTMLElement?le(t,l)?(o.current=l,(0,b.C5)(l)):(e.preventDefault(),e.stopPropagation(),(0,b.C5)(s)):(0,b.C5)(o.current)}),!0)}(c,{ownerDocument:d,container:n,containers:l,previousActiveElement:m});let f=function(){let e=(0,r.useRef)(0);return C(!0,"keydown",(t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)}),!0),e}(),g=(0,p.z)((e=>{let t=n.current;t&&(0,z.E)(f.current,{[ee.Forwards]:()=>{(0,b.jA)(t,b.TO.First,{skipElements:[e.relatedTarget,a]})},[ee.Backwards]:()=>{(0,b.jA)(t,b.TO.Last,{skipElements:[e.relatedTarget,a]})}})})),v=h(!!(2&c),"focus-trap#tab-lock"),y=(0,G.G)(),x=(0,r.useRef)(!1),w={ref:o,onKeyDown(e){"Tab"==e.key&&(x.current=!0,y.requestAnimationFrame((()=>{x.current=!1})))},onBlur(e){if(!(4&c))return;let t=re(l);n.current instanceof HTMLElement&&t.add(n.current);let r=e.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(le(t,r)||(x.current?(0,b.jA)(n.current,(0,z.E)(f.current,{[ee.Forwards]:()=>b.TO.Next,[ee.Backwards]:()=>b.TO.Previous})|b.TO.WrapAround,{relativeTo:e.target}):e.target instanceof HTMLElement&&(0,b.C5)(e.target)))}};return r.createElement(r.Fragment,null,v&&r.createElement(k._,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:g,features:k.x.Focusable}),(0,U.sY)({ourProps:w,theirProps:u,defaultTag:"div",name:"FocusTrap"}),v&&r.createElement(k._,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:g,features:k.x.Focusable}))})),ae=Object.assign(se,{features:ie});function le(e,t){for(let n of e)if(n.contains(t))return!0;return!1}const ce=window.ReactDOM;var ue=n(7896);let de=r.Fragment,he=(0,U.yV)((function(e,t){let n=e,o=(0,r.useRef)(null),i=(0,V.T)((0,V.h)((e=>{o.current=e})),t),s=P(o),a=function(e){let t=B(),n=(0,r.useContext)(me),o=P(e),[i,s]=(0,r.useState)((()=>{var e;if(!t&&null!==n)return null!=(e=n.current)?e:null;if(ue.O.isServer)return null;let r=null==o?void 0:o.getElementById("headlessui-portal-root");if(r)return r;if(null===o)return null;let i=o.createElement("div");return i.setAttribute("id","headlessui-portal-root"),o.body.appendChild(i)}));return(0,r.useEffect)((()=>{null!==i&&(null!=o&&o.body.contains(i)||null==o||o.body.appendChild(i))}),[i,o]),(0,r.useEffect)((()=>{t||null!==n&&s(n.current)}),[n,s,t]),i}(o),[l]=(0,r.useState)((()=>{var e;return ue.O.isServer?null:null!=(e=null==s?void 0:s.createElement("div"))?e:null})),u=(0,r.useContext)(fe),d=(0,R.H)();return(0,c.e)((()=>{!a||!l||a.contains(l)||(l.setAttribute("data-headlessui-portal",""),a.appendChild(l))}),[a,l]),(0,c.e)((()=>{if(l&&u)return u.register(l)}),[u,l]),J((()=>{var e;!a||!l||(l instanceof Node&&a.contains(l)&&a.removeChild(l),a.childNodes.length<=0&&(null==(e=a.parentElement)||e.removeChild(a)))})),d&&a&&l?(0,ce.createPortal)((0,U.sY)({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:de,name:"Portal"}),l):null})),pe=r.Fragment,me=(0,r.createContext)(null),fe=(0,r.createContext)(null);function ge(){let e=(0,r.useContext)(fe),t=(0,r.useRef)([]),n=(0,p.z)((n=>(t.current.push(n),e&&e.register(n),()=>o(n)))),o=(0,p.z)((n=>{let r=t.current.indexOf(n);-1!==r&&t.current.splice(r,1),e&&e.unregister(n)})),i=(0,r.useMemo)((()=>({register:n,unregister:o,portals:t})),[n,o,t]);return[t,(0,r.useMemo)((()=>function({children:e}){return r.createElement(fe.Provider,{value:i},e)}),[i])]}let ve=(0,U.yV)((function(e,t){let n=(0,V.T)(t),{enabled:o=!0,...i}=e;return o?r.createElement(he,{...i,ref:n}):(0,U.sY)({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:de,name:"Portal"})})),ye=(0,U.yV)((function(e,t){let{target:n,...o}=e,i={ref:(0,V.T)(t)};return r.createElement(me.Provider,{value:n},(0,U.sY)({ourProps:i,theirProps:o,defaultTag:pe,name:"Popover.Group"}))})),xe=Object.assign(ve,{Group:ye});var we,be=n(8687),Ee=((we=Ee||{})[we.Open=0]="Open",we[we.Closed=1]="Closed",we),Se=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Se||{});let Te={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},Ce=(0,r.createContext)(null);function Pe(e){let t=(0,r.useContext)(Ce);if(null===t){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Pe),t}return t}function ke(e,t){return(0,z.E)(t.type,Te,e,t)}Ce.displayName="DialogContext";let Ae=(0,U.yV)((function(e,t){let n=(0,r.useId)(),{id:a=`headlessui-dialog-${n}`,open:l,onClose:d,initialFocus:m,role:f="dialog",autoFocus:g=!0,__demoMode:v=!1,unmount:y=!1,...E}=e,k=(0,r.useRef)(!1);f="dialog"===f||"alertdialog"===f?f:(k.current||(k.current=!0,console.warn(`Invalid role [${f}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let A=(0,j.oJ)();void 0===l&&null!==A&&(l=(A&j.ZM.Open)===j.ZM.Open);let _=(0,r.useRef)(null),M=(0,V.T)(_,t),N=P(_),D=l?0:1,[I,B]=(0,r.useReducer)(ke,{titleId:null,descriptionId:null,panelRef:(0,r.createRef)()}),z=(0,p.z)((()=>d(!1))),W=(0,p.z)((e=>B({type:0,id:e}))),q=!!(0,R.H)()&&0===D,[Z,Y]=ge(),G={get current(){var e;return null!=(e=I.panelRef.current)?e:_.current}},K=L(),{resolveContainers:X}=function({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=P(n),o=(0,p.z)((()=>{var o,i;let s=[];for(let t of e)null!==t&&(t instanceof HTMLElement?s.push(t):"current"in t&&t.current instanceof HTMLElement&&s.push(t.current));if(null!=t&&t.current)for(let e of t.current)s.push(e);for(let e of null!=(o=null==r?void 0:r.querySelectorAll("html > *, body > *"))?o:[])e!==document.body&&e!==document.head&&e instanceof HTMLElement&&"headlessui-portal-root"!==e.id&&(n&&(e.contains(n)||e.contains(null==(i=null==n?void 0:n.getRootNode())?void 0:i.host))||s.some((t=>e.contains(t)))||s.push(e));return s}));return{resolveContainers:o,contains:(0,p.z)((e=>o().some((t=>t.contains(e)))))}}({mainTreeNode:K,portals:Z,defaultContainers:[G]}),J=null!==A&&(A&j.ZM.Closing)===j.ZM.Closing;x(!v&&!J&&q,{allowed:(0,p.z)((()=>{var e,t;return[null!=(t=null==(e=_.current)?void 0:e.closest("[data-headlessui-portal]"))?t:null]})),disallowed:(0,p.z)((()=>{var e;return[null!=(e=null==K?void 0:K.closest("body > *:not(#headlessui-portal-root)"))?e:null]}))}),function(e,t,n){let o=h(e,"outside-click"),s=(0,i.E)(n),a=(0,r.useCallback)((function(e,n){if(e.defaultPrevented)return;let r=n(e);if(null===r||!r.getRootNode().contains(r)||!r.isConnected)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of o){if(null===t)continue;let n=t instanceof HTMLElement?t:t.current;if(null!=n&&n.contains(r)||e.composed&&e.composedPath().includes(n))return}return!(0,b.sP)(r,b.tJ.Loose)&&-1!==r.tabIndex&&e.preventDefault(),s.current(e,r)}),[s]),l=(0,r.useRef)(null);T(o,"pointerdown",(e=>{var t,n;l.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),T(o,"mousedown",(e=>{var t,n;l.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),T(o,"click",(e=>{S()||l.current&&(a(e,(()=>l.current)),l.current=null)}),!0);let c=(0,r.useRef)({x:0,y:0});T(o,"touchstart",(e=>{c.current.x=e.touches[0].clientX,c.current.y=e.touches[0].clientY}),!0),T(o,"touchend",(e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-c.current.x)>=30||Math.abs(n-c.current.y)>=30))return a(e,(()=>e.target instanceof HTMLElement?e.target:null))}),!0),C(o,"blur",(e=>a(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}(q,X,(e=>{e.preventDefault(),z()})),function(e,t=("undefined"!=typeof document?document.defaultView:null),n){let r=h(e,"escape");s(t,"keydown",(e=>{r&&(e.defaultPrevented||e.key===o.R.Escape&&n(e))}))}(q,null==N?void 0:N.defaultView,(e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),z()})),function(e,t,n=(()=>[document.body])){!function(e,t,n=(()=>({containers:[]}))){let r=u(O),o=t?r.get(t):void 0;o&&o.count,(0,c.e)((()=>{if(t&&e)return O.dispatch("PUSH",t,n),()=>O.dispatch("POP",t,n)}),[e,t])}(h(e,"scroll-lock"),t,(e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}}))}(!v&&!J&&q,N,X),(0,w.m)(q,_,z);let[Q,ee]=function(){let[e,t]=(0,r.useState)([]);return[e.length>0?e.join(" "):void 0,(0,r.useMemo)((()=>function(e){let n=(0,p.z)((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),o=(0,r.useMemo)((()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value})),[n,e.slot,e.name,e.props,e.value]);return r.createElement($.Provider,{value:o},e.children)}),[t])]}(),te=(0,r.useMemo)((()=>[{dialogState:D,close:z,setTitleId:W,unmount:y},I]),[D,I,z,W,y]),ne=(0,r.useMemo)((()=>({open:0===D})),[D]),re={ref:M,id:a,role:f,tabIndex:-1,"aria-modal":v?void 0:0===D||void 0,"aria-labelledby":I.titleId,"aria-describedby":Q,unmount:y},oe=!function(){var e;let[t]=(0,r.useState)((()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null)),[n,o]=(0,r.useState)(null!=(e=null==t?void 0:t.matches)&&e);return(0,c.e)((()=>{if(t)return t.addEventListener("change",e),()=>t.removeEventListener("change",e);function e(e){o(e.matches)}}),[t]),n}(),se=ie.None;return q&&!v&&(se|=ie.RestoreFocus,se|=ie.TabLock,g&&(se|=ie.AutoFocus),oe&&(se|=ie.InitialFocus)),r.createElement(j.uu,null,r.createElement(H,{force:!0},r.createElement(xe,null,r.createElement(Ce.Provider,{value:te},r.createElement(ye,{target:_},r.createElement(H,{force:!1},r.createElement(ee,{slot:ne},r.createElement(Y,null,r.createElement(ae,{initialFocus:m,initialFocusFallback:_,containers:X,features:se},r.createElement(F.Z,{value:z},(0,U.sY)({ourProps:re,theirProps:E,slot:ne,defaultTag:_e,features:Le,visible:0===D,name:"Dialog"})))))))))))})),_e="div",Le=U.VN.RenderStrategy|U.VN.Static,Me=(0,U.yV)((function(e,t){let{transition:n=!1,open:o,...i}=e,s=(0,j.oJ)(),a=e.hasOwnProperty("open")||null!==s,l=e.hasOwnProperty("onClose");if(!a&&!l)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!s&&"boolean"!=typeof e.open)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if("function"!=typeof e.onClose)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return void 0===o&&!n||i.static?r.createElement(_,null,r.createElement(Ae,{ref:t,open:o,...i})):r.createElement(_,null,r.createElement(be.u,{show:o,transition:n,unmount:i.unmount},r.createElement(Ae,{ref:t,...i})))})),Ne=(0,U.yV)((function(e,t){let n=(0,r.useId)(),{id:o=`headlessui-dialog-panel-${n}`,transition:i=!1,...s}=e,[{dialogState:a,unmount:l},c]=Pe("Dialog.Panel"),u=(0,V.T)(t,c.panelRef),d=(0,r.useMemo)((()=>({open:0===a})),[a]),h={ref:u,id:o,onClick:(0,p.z)((e=>{e.stopPropagation()}))};return r.createElement(i?be.x:r.Fragment,{...i?{unmount:l}:{}},(0,U.sY)({ourProps:h,theirProps:s,slot:d,defaultTag:"div",name:"Dialog.Panel"}))})),De=((0,U.yV)((function(e,t){let{transition:n=!1,...o}=e,[{dialogState:i,unmount:s}]=Pe("Dialog.Backdrop"),a=(0,r.useMemo)((()=>({open:0===i})),[i]),l={ref:t,"aria-hidden":!0};return r.createElement(n?be.x:r.Fragment,{...n?{unmount:s}:{}},(0,U.sY)({ourProps:l,theirProps:o,slot:a,defaultTag:"div",name:"Dialog.Backdrop"}))})),(0,U.yV)((function(e,t){let n=(0,r.useId)(),{id:o=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:s,setTitleId:a}]=Pe("Dialog.Title"),l=(0,V.T)(t);(0,r.useEffect)((()=>(a(o),()=>a(null))),[o,a]);let c=(0,r.useMemo)((()=>({open:0===s})),[s]);return(0,U.sY)({ourProps:{ref:l,id:o},theirProps:i,slot:c,defaultTag:"h2",name:"Dialog.Title"})}))),Oe=Object.assign(Me,{Panel:Ne,Title:De,Description:Y})},1363:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});var r,o=((r=o||{}).Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r)},8687:(e,t,n)=>{"use strict";n.d(t,{u:()=>_,x:()=>A});var r=n(9196),o=n(4192),i=n(3781),s=n(4879),a=n(6723),l=n(3855),c=n(8553),u=n(2180),d=n(3784),h=n(5189),p=n(6567),m=n(4067),f=n(2984),g=n(2351);function v(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:T)!==r.Fragment||1===r.Children.count(e.children)}let y=(0,r.createContext)(null);y.displayName="TransitionContext";var x,w=((x=w||{}).Visible="visible",x.Hidden="hidden",x);let b=(0,r.createContext)(null);function E(e){return"children"in e?E(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function S(e,t){let n=(0,l.E)(e),a=(0,r.useRef)([]),c=(0,s.t)(),u=(0,o.G)(),d=(0,i.z)(((e,t=g.l4.Hidden)=>{let r=a.current.findIndex((({el:t})=>t===e));-1!==r&&((0,f.E)(t,{[g.l4.Unmount](){a.current.splice(r,1)},[g.l4.Hidden](){a.current[r].state="hidden"}}),u.microTask((()=>{var e;!E(a)&&c.current&&(null==(e=n.current)||e.call(n))})))})),h=(0,i.z)((e=>{let t=a.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):a.current.push({el:e,state:"visible"}),()=>d(e,g.l4.Unmount)})),p=(0,r.useRef)([]),m=(0,r.useRef)(Promise.resolve()),v=(0,r.useRef)({enter:[],leave:[]}),y=(0,i.z)(((e,n,r)=>{p.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{p.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(v.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?m.current=m.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),x=(0,i.z)(((e,t,n)=>{Promise.all(v.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=p.current.shift())||e()})).then((()=>n(t)))}));return(0,r.useMemo)((()=>({children:a,register:h,unregister:d,onStart:y,onStop:x,wait:m,chains:v})),[h,d,a,y,x,v,m])}b.displayName="NestingContext";let T=r.Fragment,C=g.VN.RenderStrategy,P=(0,g.yV)((function(e,t){let{show:n,appear:o=!1,unmount:s=!0,...l}=e,h=(0,r.useRef)(null),m=v(e),f=(0,d.T)(...m?[h,t]:null===t?[]:[t]);(0,u.H)();let x=(0,p.oJ)();if(void 0===n&&null!==x&&(n=(x&p.ZM.Open)===p.ZM.Open),void 0===n)throw new Error("A is used but it is missing a `show={true | false}` prop.");let[w,T]=(0,r.useState)(n?"visible":"hidden"),P=S((()=>{n||T("hidden")})),[A,_]=(0,r.useState)(!0),L=(0,r.useRef)([n]);(0,a.e)((()=>{!1!==A&&L.current[L.current.length-1]!==n&&(L.current.push(n),_(!1))}),[L,n]);let M=(0,r.useMemo)((()=>({show:n,appear:o,initial:A})),[n,o,A]);(0,c.m)(n,h,(()=>T("hidden"))),(0,a.e)((()=>{n?T("visible"):!E(P)&&null!==h.current&&T("hidden")}),[n,P]);let N={unmount:s},D=(0,i.z)((()=>{var t;A&&_(!1),null==(t=e.beforeEnter)||t.call(e)})),O=(0,i.z)((()=>{var t;A&&_(!1),null==(t=e.beforeLeave)||t.call(e)}));return r.createElement(b.Provider,{value:P},r.createElement(y.Provider,{value:M},(0,g.sY)({ourProps:{...N,as:r.Fragment,children:r.createElement(k,{ref:f,...N,...l,beforeEnter:D,beforeLeave:O})},theirProps:{},defaultTag:r.Fragment,features:C,visible:"visible"===w,name:"Transition"})))})),k=(0,g.yV)((function(e,t){var n,o;let{transition:s=!0,beforeEnter:l,afterEnter:c,beforeLeave:x,afterLeave:w,enter:P,enterFrom:k,enterTo:A,entered:_,leave:L,leaveFrom:M,leaveTo:N,...D}=e,O=(0,r.useRef)(null),R=v(e),V=(0,d.T)(...R?[O,t]:null===t?[]:[t]),F=null==(n=D.unmount)||n?g.l4.Unmount:g.l4.Hidden,{show:j,appear:I,initial:B}=function(){let e=(0,r.useContext)(y);if(null===e)throw new Error("A is used but it is missing a parent or .");return e}(),[H,z]=(0,r.useState)(j?"visible":"hidden"),U=function(){let e=(0,r.useContext)(b);if(null===e)throw new Error("A is used but it is missing a parent or .");return e}(),{register:W,unregister:$}=U;(0,a.e)((()=>W(O)),[W,O]),(0,a.e)((()=>{if(F===g.l4.Hidden&&O.current)return j&&"visible"!==H?void z("visible"):(0,f.E)(H,{hidden:()=>$(O),visible:()=>W(O)})}),[H,O,W,$,j,F]);let q=(0,u.H)();(0,a.e)((()=>{if(R&&q&&"visible"===H&&null===O.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[O,H,q,R]);let Z=B&&!I,Y=I&&j&&B,G=(0,r.useRef)(!1),K=S((()=>{G.current||(z("hidden"),$(O))}),U),X=(0,i.z)((e=>{G.current=!0;let t=e?"enter":"leave";K.onStart(O,t,(e=>{"enter"===e?null==l||l():"leave"===e&&(null==x||x())}))})),J=(0,i.z)((e=>{let t=e?"enter":"leave";G.current=!1,K.onStop(O,t,(e=>{"enter"===e?null==c||c():"leave"===e&&(null==w||w())})),"leave"===t&&!E(K)&&(z("hidden"),$(O))}));(0,r.useEffect)((()=>{R&&s||(X(j),J(j))}),[j,R,s]);let Q=!(!s||!R||!q||Z),[,ee]=(0,h.Y)(Q,O,j,{start:X,end:J}),te=(0,g.oA)({ref:V,className:(null==(o=(0,m.A)(D.className,Y&&P,Y&&k,ee.enter&&P,ee.enter&&ee.closed&&k,ee.enter&&!ee.closed&&A,ee.leave&&L,ee.leave&&!ee.closed&&M,ee.leave&&ee.closed&&N,!ee.transition&&j&&_))?void 0:o.trim())||void 0,...(0,h.X)(ee)}),ne=0;return"visible"===H&&(ne|=p.ZM.Open),"hidden"===H&&(ne|=p.ZM.Closed),ee.enter&&(ne|=p.ZM.Opening),ee.leave&&(ne|=p.ZM.Closing),r.createElement(b.Provider,{value:K},r.createElement(p.up,{value:ne},(0,g.sY)({ourProps:te,theirProps:D,defaultTag:T,features:C,visible:"visible"===H,name:"Transition.Child"})))})),A=(0,g.yV)((function(e,t){let n=null!==(0,r.useContext)(y),o=null!==(0,p.oJ)();return r.createElement(r.Fragment,null,!n&&o?r.createElement(P,{ref:t,...e}):r.createElement(k,{ref:t,...e}))})),_=Object.assign(P,{Child:A,Root:P})},4192:(e,t,n)=>{"use strict";n.d(t,{G:()=>i});var r=n(9196),o=n(9362);function i(){let[e]=(0,r.useState)(o.k);return(0,r.useEffect)((()=>()=>e.dispose()),[e]),e}},3781:(e,t,n)=>{"use strict";n.d(t,{z:()=>i});var r=n(9196),o=n(3855);let i=function(e){let t=(0,o.E)(e);return r.useCallback(((...e)=>t.current(...e)),[t])}},4879:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var r=n(9196),o=n(6723);function i(){let e=(0,r.useRef)(!1);return(0,o.e)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}},6723:(e,t,n)=>{"use strict";n.d(t,{e:()=>i});var r=n(9196),o=n(7896);let i=(e,t)=>{o.O.isServer?(0,r.useEffect)(e,t):(0,r.useLayoutEffect)(e,t)}},3855:(e,t,n)=>{"use strict";n.d(t,{E:()=>i});var r=n(9196),o=n(6723);function i(e){let t=(0,r.useRef)(e);return(0,o.e)((()=>{t.current=e}),[e]),t}},8553:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var r=n(9196),o=n(9362),i=n(3855);function s(e,t,n){let s=(0,i.E)((e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()}));(0,r.useEffect)((()=>{if(!e)return;let n=null===t?null:t instanceof HTMLElement?t:t.current;if(!n)return;let r=(0,o.k)();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver((()=>s.current(n)));e.observe(n),r.add((()=>e.disconnect()))}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver((()=>s.current(n)));e.observe(n),r.add((()=>e.disconnect()))}return()=>r.dispose()}),[t,s,e])}},2180:(e,t,n)=>{"use strict";var r;n.d(t,{H:()=>s});var o=n(9196),i=n(7896);function s(){let e=function(){let e="undefined"==typeof document;return"useSyncExternalStore"in(r||(r=n.t(o,2)))&&(r||(r=n.t(o,2))).useSyncExternalStore((()=>()=>{}),(()=>!1),(()=>!e))}(),[t,s]=o.useState(i.O.isHandoffComplete);return t&&!1===i.O.isHandoffComplete&&s(!1),o.useEffect((()=>{!0!==t&&s(!0)}),[t]),o.useEffect((()=>i.O.handoff()),[]),!e&&t}},3784:(e,t,n)=>{"use strict";n.d(t,{T:()=>a,h:()=>s});var r=n(9196),o=n(3781);let i=Symbol();function s(e,t=!0){return Object.assign(e,{[i]:t})}function a(...e){let t=(0,r.useRef)(e);(0,r.useEffect)((()=>{t.current=e}),[e]);let n=(0,o.z)((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[i])))?void 0:n}},5189:(e,t,n)=>{"use strict";n.d(t,{X:()=>c,Y:()=>u});var r,o=n(9196),i=n(9362),s=n(4192),a=n(6723),l=((r=l||{})[r.None=0]="None",r[r.Closed=1]="Closed",r[r.Enter=2]="Enter",r[r.Leave=4]="Leave",r);function c(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]="");return t}function u(e,t,n,r){let[l,c]=(0,o.useState)(n),{hasFlag:u,addFlag:d,removeFlag:h}=function(e=0){let[t,n]=(0,o.useState)(e),r=(0,o.useCallback)((e=>n(e)),[t]),i=(0,o.useCallback)((e=>n((t=>t|e))),[t]),s=(0,o.useCallback)((e=>(t&e)===e),[t]),a=(0,o.useCallback)((e=>n((t=>t&~e))),[n]),l=(0,o.useCallback)((e=>n((t=>t^e))),[n]);return{flags:t,setFlag:r,addFlag:i,hasFlag:s,removeFlag:a,toggleFlag:l}}(e&&l?3:0),p=(0,o.useRef)(!1),m=(0,o.useRef)(!1),f=(0,s.G)();return(0,a.e)((function o(){var s;if(!e)return;n&&c(!0);let a=t.current;return a?(null==(s=null==r?void 0:r.start)||s.call(r,n),function(e,{prepare:t,run:n,done:r,inFlight:o}){let s=(0,i.k)();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:o}),s.nextFrame((()=>{s.add(function(e,t){let n=function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(t),r=(0,i.k)();if(!e)return r.dispose;let{transitionDuration:o,transitionDelay:s}=getComputedStyle(e),[a,l]=[o,s].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t})),c=a+l;if(0!==c){let t=r.group((r=>{let o=r.setTimeout((()=>{n(),r.dispose()}),c);r.addEventListener(e,"transitionrun",(i=>{i.target===i.currentTarget&&(o(),r.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(n(),t())})))}))}));r.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(n(),r.dispose())}))}else n();return r.dispose}(e,r)),n()})),s.dispose}(a,{inFlight:p,prepare(){m.current?m.current=!1:m.current=p.current,p.current=!0,!m.current&&(n?(d(3),h(4)):(d(4),h(2)))},run(){m.current?n?(h(3),d(4)):(h(4),d(3)):n?h(1):d(1)},done(){var e;m.current&&"function"==typeof a.getAnimations&&a.getAnimations().length>0||(p.current=!1,h(7),n||c(!1),null==(e=null==r?void 0:r.end)||e.call(r,n))}})):n?(d(3),f.nextFrame((()=>o()))):void 0}),[e,n,t,f]),e?[l,{closed:u(1),enter:u(2),leave:u(4),transition:u(2)||u(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}},4782:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9196);let o=(0,r.createContext)((()=>{}));function i({value:e,children:t}){return r.createElement(o.Provider,{value:e},t)}},6045:(e,t,n)=>{"use strict";n.d(t,{_:()=>s,x:()=>i});var r,o=n(2351),i=((r=i||{})[r.None=1]="None",r[r.Focusable=2]="Focusable",r[r.Hidden=4]="Hidden",r);let s=(0,o.yV)((function(e,t){var n;let{features:r=1,...i}=e,s={ref:t,"aria-hidden":2==(2&r)||(null!=(n=i["aria-hidden"])?n:void 0),hidden:4==(4&r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&r)&&2!=(2&r)&&{display:"none"}}};return(0,o.sY)({ourProps:s,theirProps:i,slot:{},defaultTag:"span",name:"Hidden"})}))},6567:(e,t,n)=>{"use strict";n.d(t,{ZM:()=>s,oJ:()=>a,up:()=>l,uu:()=>c});var r=n(9196);let o=(0,r.createContext)(null);o.displayName="OpenClosedContext";var i,s=((i=s||{})[i.Open=1]="Open",i[i.Closed=2]="Closed",i[i.Closing=4]="Closing",i[i.Opening=8]="Opening",i);function a(){return(0,r.useContext)(o)}function l({value:e,children:t}){return r.createElement(o.Provider,{value:e},t)}function c({children:e}){return r.createElement(o.Provider,{value:null},e)}},4067:(e,t,n)=>{"use strict";function r(...e){return Array.from(new Set(e.flatMap((e=>"string"==typeof e?e.split(" "):[])))).filter(Boolean).join(" ")}n.d(t,{A:()=>r})},9362:(e,t,n)=>{"use strict";n.d(t,{k:()=>o});var r=n(1021);function o(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add((()=>e.removeEventListener(n,r,o)))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add((()=>cancelAnimationFrame(n)))},nextFrame:(...e)=>t.requestAnimationFrame((()=>t.requestAnimationFrame(...e))),setTimeout(...e){let n=setTimeout(...e);return t.add((()=>clearTimeout(n)))},microTask(...e){let n={current:!0};return(0,r.Y)((()=>{n.current&&e[0]()})),t.add((()=>{n.current=!1}))},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add((()=>{Object.assign(e.style,{[t]:r})}))},group(e){let t=o();return e(t),this.add((()=>t.dispose()))},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}},7896:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=Object.defineProperty,o=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let i=new class{constructor(){o(this,"current",this.detect()),o(this,"handoffState","pending"),o(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}}},4575:(e,t,n)=>{"use strict";n.d(t,{C5:()=>g,TO:()=>u,fE:()=>d,jA:()=>x,sP:()=>m,tJ:()=>p,y:()=>i,z2:()=>y});var r=n(2984),o=n(5466);let i=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(","),s=["[data-autofocus]"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var a,l,c,u=((c=u||{})[c.First=1]="First",c[c.Previous=2]="Previous",c[c.Next=4]="Next",c[c.Last=8]="Last",c[c.WrapAround=16]="WrapAround",c[c.NoScroll=32]="NoScroll",c[c.AutoFocus=64]="AutoFocus",c),d=((l=d||{})[l.Error=0]="Error",l[l.Overflow=1]="Overflow",l[l.Success=2]="Success",l[l.Underflow=3]="Underflow",l),h=((a=h||{})[a.Previous=-1]="Previous",a[a.Next=1]="Next",a);var p=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(p||{});function m(e,t=0){var n;return e!==(null==(n=(0,o.r)(e))?void 0:n.body)&&(0,r.E)(t,{0:()=>e.matches(i),1(){let t=e;for(;null!==t;){if(t.matches(i))return!0;t=t.parentElement}return!1}})}var f=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(f||{});function g(e){null==e||e.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",(e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")}),!0),document.addEventListener("click",(e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")}),!0));let v=["textarea","input"].join(",");function y(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function x(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?n?y(e):e:64&t?function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(s)).sort(((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER))))}(e):function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(i)).sort(((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER))))}(e);o.length>0&&l.length>1&&(l=l.filter((e=>!o.some((t=>null!=t&&"current"in t?(null==t?void 0:t.current)===e:t===e))))),r=null!=r?r:a.activeElement;let c,u=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,l.indexOf(r))-1;if(4&t)return Math.max(0,l.indexOf(r))+1;if(8&t)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),h=32&t?{preventScroll:!0}:{},p=0,m=l.length;do{if(p>=m||p+m<=0)return 0;let e=d+p;if(16&t)e=(e+m)%m;else{if(e<0)return 3;if(e>=m)return 1}c=l[e],null==c||c.focus(h),p+=u}while(c!==a.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,v))&&n}(c)&&c.select(),2}},2984:(e,t,n)=>{"use strict";function r(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let o=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,r),o}n.d(t,{E:()=>r})},1021:(e,t,n)=>{"use strict";function r(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}n.d(t,{Y:()=>r})},5466:(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var r=n(7896);function o(e){return r.O.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}},2351:(e,t,n)=>{"use strict";n.d(t,{VN:()=>l,Y2:()=>h,dG:()=>f,l4:()=>c,oA:()=>v,sY:()=>u,yV:()=>g});var r,o,i=n(9196),s=n(4067),a=n(2984),l=((o=l||{})[o.None=0]="None",o[o.RenderStrategy=1]="RenderStrategy",o[o.Static=2]="Static",o),c=((r=c||{})[r.Unmount=0]="Unmount",r[r.Hidden=1]="Hidden",r);function u({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:l}){l=null!=l?l:p;let c=m(t,e);if(i)return d(c,n,r,s,l);let u=null!=o?o:0;if(2&u){let{static:e=!1,...t}=c;if(e)return d(t,n,r,s,l)}if(1&u){let{unmount:e=!0,...t}=c;return(0,a.E)(e?0:1,{0:()=>null,1:()=>d({...t,hidden:!0,style:{display:"none"}},n,r,s,l)})}return d(c,n,r,s,l)}function d(e,t={},n,r,o){let{as:a=n,children:l,refName:c="ref",...u}=y(e,["unmount","static"]),d=void 0!==e.ref?{[c]:e.ref}:{},h="function"==typeof l?l(t):l;"className"in u&&u.className&&"function"==typeof u.className&&(u.className=u.className(t)),u["aria-labelledby"]&&u["aria-labelledby"]===u.id&&(u["aria-labelledby"]=void 0);let p={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`)));if(e){p["data-headlessui-state"]=n.join(" ");for(let e of n)p[`data-${e}`]=""}}if(a===i.Fragment&&(Object.keys(v(u)).length>0||Object.keys(v(p)).length>0)){if((0,i.isValidElement)(h)&&!(Array.isArray(h)&&h.length>1)){let e=h.props,t=null==e?void 0:e.className,n="function"==typeof t?(...e)=>(0,s.A)(t(...e),u.className):(0,s.A)(t,u.className),r=n?{className:n}:{},a=m(h.props,v(y(u,["ref"])));for(let e in p)e in a&&delete p[e];return(0,i.cloneElement)(h,Object.assign({},a,p,d,{ref:o(h.ref,d.ref)},r))}if(Object.keys(v(u)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(v(u)).concat(Object.keys(v(p))).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"))}return(0,i.createElement)(a,Object.assign({},y(u,["ref"]),a!==i.Fragment&&d,a!==i.Fragment&&p),h)}function h(){let e=(0,i.useRef)([]),t=(0,i.useCallback)((t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)}),[]);return(...n)=>{if(!n.every((e=>null==e)))return e.current=n,t}}function p(...e){return e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function m(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function f(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)null==e||e(...t)}});return t}function g(e){var t;return Object.assign((0,i.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function v(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function y(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}},3689:(e,t,n)=>{"use strict";n.d(t,{M:()=>v});var r=n(5893),o=n(9196),i=n(240),s=n(6681),a=n(6014);class l extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function c({children:e,isPresent:t}){const n=(0,o.useId)(),i=(0,o.useRef)(null),s=(0,o.useRef)({width:0,height:0,top:0,left:0}),{nonce:c}=(0,o.useContext)(a._);return(0,o.useInsertionEffect)((()=>{const{width:e,height:r,top:o,left:a}=s.current;if(t||!i.current||!e||!r)return;i.current.dataset.motionPopId=n;const l=document.createElement("style");return c&&(l.nonce=c),document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${r}px !important;\n top: ${o}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}}),[t]),(0,r.jsx)(l,{isPresent:t,childRef:i,sizeRef:s,children:o.cloneElement(e,{ref:i})})}const u=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:l,presenceAffectsLayout:u,mode:h})=>{const p=(0,s.h)(d),m=(0,o.useId)(),f=(0,o.useMemo)((()=>({id:m,initial:t,isPresent:n,custom:l,onExitComplete:e=>{p.set(e,!0);for(const e of p.values())if(!e)return;a&&a()},register:e=>(p.set(e,!1),()=>p.delete(e))})),u?[Math.random()]:[n]);return(0,o.useMemo)((()=>{p.forEach(((e,t)=>p.set(t,!1)))}),[n]),o.useEffect((()=>{!n&&!p.size&&a&&a()}),[n]),"popLayout"===h&&(e=(0,r.jsx)(c,{isPresent:n,children:e})),(0,r.jsx)(i.O.Provider,{value:f,children:e})};function d(){return new Map}var h=n(5364),p=n(5487);const m=e=>e.key||"";function f(e){const t=[];return o.Children.forEach(e,(e=>{(0,o.isValidElement)(e)&&t.push(e)})),t}var g=n(8868);const v=({children:e,exitBeforeEnter:t,custom:n,initial:i=!0,onExitComplete:a,presenceAffectsLayout:l=!0,mode:c="sync"})=>{(0,p.k)(!t,"Replace exitBeforeEnter with mode='wait'");const d=(0,o.useMemo)((()=>f(e)),[e]),v=d.map(m),y=(0,o.useRef)(!0),x=(0,o.useRef)(d),w=(0,s.h)((()=>new Map)),[b,E]=(0,o.useState)(d),[S,T]=(0,o.useState)(d);(0,g.L)((()=>{y.current=!1,x.current=d;for(let e=0;e{const t=m(e),o=d===S||v.includes(t);return(0,r.jsx)(u,{isPresent:o,initial:!(y.current&&!i)&&void 0,custom:o?void 0:n,presenceAffectsLayout:l,mode:c,onExitComplete:o?void 0:()=>{if(!w.has(t))return;w.set(t,!0);let e=!0;w.forEach((t=>{t||(e=!1)})),e&&(null==P||P(),T(x.current),a&&a())},children:e},t)}))})}},5364:(e,t,n)=>{"use strict";n.d(t,{p:()=>r});const r=(0,n(9196).createContext)({})},6014:(e,t,n)=>{"use strict";n.d(t,{_:()=>r});const r=(0,n(9196).createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"})},240:(e,t,n)=>{"use strict";n.d(t,{O:()=>r});const r=(0,n(9196).createContext)(null)},3773:(e,t,n)=>{"use strict";n.d(t,{E:()=>Ms});var r=n(5893),o=n(9196),i=n(6014);const s=(0,o.createContext)({});var a=n(240),l=n(8868);const c=(0,o.createContext)({strict:!1}),u=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),d="data-"+u("framerAppearId"),h=["read","resolveKeyframes","update","preRender","render","postRender"];function p(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=h.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){i.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,o=!1,s=!1)=>{const a=s&&r?t:n;return o&&i.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),i.delete(e)},process:e=>{s=e,r?o=!0:(r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,o&&(o=!1,l.process(e)))}};return l}(i),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:p}=s,m=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),p.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:h.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(m)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t{S&&S.update(n,f)}));const C=(0,o.useRef)(Boolean(n[d]&&!window.HandoffComplete));return(0,l.L)((()=>{S&&(S.updateFeatures(),m.render(S.render),C.current&&S.animationState&&S.animationState.animateChanges())})),(0,o.useEffect)((()=>{S&&(!C.current&&S.animationState&&S.animationState.animateChanges(),C.current&&(C.current=!1,y||(y=!0,queueMicrotask(w))))})),S}function w(){window.HandoffComplete=!0}function b(e){if(e)return!1!==e.options.allowProjection?e.projection:b(e.parent)}function E(e,t,n){return(0,o.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):g(n)&&(n.current=r))}),[t])}function S(e){return"string"==typeof e||Array.isArray(e)}function T(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const C=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],P=["initial",...C];function k(e){return T(e.animate)||P.some((t=>S(e[t])))}function A(e){return Boolean(k(e)||e.variants)}function _(e){return Array.isArray(e)?e.join(" "):e}const L={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"]},M={};for(const e in L)M[e]={isEnabled:t=>L[e].some((e=>!!t[e]))};var N=n(1741),D=n(5364);const O=Symbol.for("motionComponentSymbol");function R({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:a,Component:l}){e&&function(e){for(const t in e)M[t]={...M[t],...e[t]}}(e);const u=(0,o.forwardRef)((function(e,u){let d;const h={...(0,o.useContext)(i._),...e,layoutId:V(e)},{isStatic:p}=h,m=function(e){const{initial:t,animate:n}=function(e,t){if(k(e)){const{initial:t,animate:n}=e;return{initial:!1===t||S(t)?t:void 0,animate:S(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(s));return(0,o.useMemo)((()=>({initial:t,animate:n})),[_(t),_(n)])}(e),f=a(e,p);if(!p&&N.j){(0,o.useContext)(c).strict;const e=function(e){const{drag:t,layout:n}=M;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(h);d=e.MeasureLayout,m.visualElement=x(l,f,h,t,e.ProjectionNode)}return(0,r.jsxs)(s.Provider,{value:m,children:[d&&m.visualElement?(0,r.jsx)(d,{visualElement:m.visualElement,...h}):null,n(l,e,E(f,m.visualElement,u),f,p,m.visualElement)]})}));return u[O]=l,u}function V({layoutId:e}){const t=(0,o.useContext)(D.p).id;return t&&void 0!==e?t+"-"+e:e}function F(e){function t(t,n={}){return R(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const j=["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 I(e){return"string"==typeof e&&!e.includes("-")&&!!(j.indexOf(e)>-1||/[A-Z]/u.test(e))}const B={},H=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z=new Set(H);function U(e,{layout:t,layoutId:n}){return z.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!B[e]||"opacity"===e)}const W=e=>Boolean(e&&e.getVelocity),$=(e,t)=>t&&"number"==typeof e?t.transform(e):e,q=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},Y={...Z,transform:e=>q(0,1,e)},G={...Z,default:1},K=e=>Math.round(1e5*e)/1e5,X=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,J=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Q=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function ee(e){return"string"==typeof e}const te=e=>({test:t=>ee(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ne=te("deg"),re=te("%"),oe=te("px"),ie=te("vh"),se=te("vw"),ae={...re,parse:e=>re.parse(e)/100,transform:e=>re.transform(100*e)},le={...Z,transform:Math.round},ce={borderWidth:oe,borderTopWidth:oe,borderRightWidth:oe,borderBottomWidth:oe,borderLeftWidth:oe,borderRadius:oe,radius:oe,borderTopLeftRadius:oe,borderTopRightRadius:oe,borderBottomRightRadius:oe,borderBottomLeftRadius:oe,width:oe,maxWidth:oe,height:oe,maxHeight:oe,size:oe,top:oe,right:oe,bottom:oe,left:oe,padding:oe,paddingTop:oe,paddingRight:oe,paddingBottom:oe,paddingLeft:oe,margin:oe,marginTop:oe,marginRight:oe,marginBottom:oe,marginLeft:oe,rotate:ne,rotateX:ne,rotateY:ne,rotateZ:ne,scale:G,scaleX:G,scaleY:G,scaleZ:G,skew:ne,skewX:ne,skewY:ne,distance:oe,translateX:oe,translateY:oe,translateZ:oe,x:oe,y:oe,z:oe,perspective:oe,transformPerspective:oe,opacity:Y,originX:ae,originY:ae,originZ:oe,zIndex:le,backgroundPositionX:oe,backgroundPositionY:oe,fillOpacity:Y,strokeOpacity:Y,numOctaves:le},ue={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},de=H.length,he=e=>t=>"string"==typeof t&&t.startsWith(e),pe=he("--"),me=he("var(--"),fe=e=>!!me(e)&&ge.test(e.split("/*")[0].trim()),ge=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ve(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(z.has(e))s=!0;else if(pe(e))o[e]=n;else{const t=$(n,ce[e]);e.startsWith("origin")?(a=!0,i[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}});function xe(e,t,n){for(const r in t)W(t[r])||U(r,n)||(e[r]=t[r])}function we(e,t){const n={},r=function(e,t){const n={};return xe(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,o.useMemo)((()=>{const n=ye();return ve(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const be=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 Ee(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||be.has(e)}let Se=e=>!Ee(e);try{(Te=require("@emotion/is-prop-valid").default)&&(Se=e=>e.startsWith("on")?!Ee(e):Te(e))}catch(e){}var Te;function Ce(e,t,n){return"string"==typeof e?e:oe.transform(t+n*e)}const Pe={offset:"stroke-dashoffset",array:"stroke-dasharray"},ke={offset:"strokeDashoffset",array:"strokeDasharray"};function Ae(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(ve(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(void 0!==o||void 0!==i||p.transform)&&(p.transformOrigin=function(e,t,n){return`${Ce(t,e.x,e.width)} ${Ce(n,e.y,e.height)}`}(m,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(h.x=t),void 0!==n&&(h.y=n),void 0!==r&&(h.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?Pe:ke;e[i.offset]=oe.transform(-r);const s=oe.transform(t),a=oe.transform(n);e[i.array]=`${s} ${a}`}(h,s,a,l,!1)}const _e=()=>({...ye(),attrs:{}}),Le=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Me(e,t,n,r){const i=(0,o.useMemo)((()=>{const n=_e();return Ae(n,t,Le(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};xe(t,e.style,e),i.style={...t,...i.style}}return i}function Ne(e=!1){return(t,n,r,{latestValues:i},s)=>{const a=(I(t)?Me:we)(n,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(Se(o)||!0===n&&Ee(o)||!t&&!Ee(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c=t!==o.Fragment?{...l,...a,ref:r}:{},{children:u}=n,d=(0,o.useMemo)((()=>W(u)?u.get():u),[u]);return(0,o.createElement)(t,{...c,children:d})}}function De(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const Oe=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 Re(e,t,n,r){De(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Oe.has(n)?n:u(n),t.attrs[n])}function Ve(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(W(o[s])||t.style&&W(t.style[s])||U(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return n&&o&&"string"==typeof o.willChange&&(n.applyWillChange=!1),i}function Fe(e,t,n){const r=Ve(e,t,n);for(const n in e)(W(e[n])||W(t[n]))&&(r[-1!==H.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function je(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function Ie(e,t,n,r){if("function"==typeof t){const[o,i]=je(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=je(r);t=t(void 0!==n?n:e.custom,o,i)}return t}var Be=n(6681);const He=e=>Array.isArray(e),ze=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),Ue=e=>He(e)?e[e.length-1]||0:e;function We(e){const t=W(e)?e.get():e;return ze(t)?t.toValue():t}const $e=new Set(["opacity","clipPath","filter","transform"]);function qe(e){return z.has(e)?"transform":$e.has(e)?u(e):void 0}function Ze(e,t){-1===e.indexOf(t)&&e.push(t)}function Ye(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ge=e=>(t,n)=>{const r=(0,o.useContext)(s),i=(0,o.useContext)(a.O),l=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},o,i,s,a){const l={latestValues:Je(o,i,s,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(o,e,l)),l}(e,t,r,i,n);return n?l():(0,Be.h)(l)};function Ke(e,t){const n=qe(t);n&&Ze(e,n)}function Xe(e,t,n){const r=Array.isArray(t)?t:[t];for(let t=0;t{for(const t in e){let n=e[t];Array.isArray(n)&&(n=n[m?n.length-1:0]),null!==n&&(s[t]=n)}for(const e in t)s[e]=t[e]})),l&&(d&&!1!==u&&!T(d)&&Xe(e,d,(e=>{for(const t in e)Ke(a,t)})),a.length&&(s.willChange=a.join(","))),s}var Qe=n(1662);const{schedule:et,cancel:tt,state:nt,steps:rt}=p("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Qe.Z,!0),ot={useVisualState:Ge({scrapeMotionValuesFromProps:Fe,createRenderState:_e,onMount:(e,t,{renderState:n,latestValues:r})=>{et.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),et.render((()=>{Ae(n,r,Le(t.tagName),e.transformTemplate),Re(t,n)}))}})},it={useVisualState:Ge({applyWillChange:!0,scrapeMotionValuesFromProps:Ve,createRenderState:ye})};function st(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const at=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function lt(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const ct=e=>t=>at(t)&&e(t,lt(t));function ut(e,t,n,r){return st(e,t,ct(n),r)}const dt=(e,t)=>n=>t(e(n)),ht=(...e)=>e.reduce(dt);function pt(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const mt=pt("dragHorizontal"),ft=pt("dragVertical");function gt(e){let t=!1;if("y"===e)t=ft();else if("x"===e)t=mt();else{const e=mt(),n=ft();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function vt(){const e=gt(!0);return!e||(e(),!1)}class yt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function xt(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return ut(e.current,n,((n,o)=>{if("touch"===n.pointerType||vt())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&et.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const wt=(e,t)=>!!t&&(e===t||wt(e,t.parentElement));function bt(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,lt(n))}const Et=new WeakMap,St=new WeakMap,Tt=e=>{const t=Et.get(e.target);t&&t(e)},Ct=e=>{e.forEach(Tt)};const Pt={some:0,all:1},kt={inView:{Feature:class extends yt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Pt[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;St.has(n)||St.set(n,{});const r=St.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Ct,{root:e,...t})),r[o]}(t);return Et.set(e,n),r.observe(e),()=>{Et.delete(e),r.unobserve(e)}}(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends yt{constructor(){super(...arguments),this.removeStartListeners=Qe.Z,this.removeEndListeners=Qe.Z,this.removeAccessibleListeners=Qe.Z,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=ut(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||wt(this.node.current,e.target)?n:r;i&&et.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=ut(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=ht(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=st(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=st(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&bt("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&et.postRender((()=>n(e,t)))}))})),bt("down",((e,t)=>{this.startPress(e,t)})))})),t=st(this.node.current,"blur",(()=>{this.isPressing&&bt("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=ht(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&et.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!vt()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&et.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=ut(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=st(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ht(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends yt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ht(st(this.node.current,"focus",(()=>this.onFocus())),st(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends yt{mount(){this.unmount=ht(xt(this.node,!0),xt(this.node,!1))}unmount(){}}}};function At(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r1e3*e,Mt=e=>e/1e3,Nt={type:"spring",stiffness:500,damping:25,restSpeed:10},Dt={type:"keyframes",duration:.8},Ot={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Rt=(e,{keyframes:t})=>t.length>2?Dt:z.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Nt:Ot;function Vt(e,t){return e[t]||e.default||e}const Ft=e=>null!==e;function jt(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Ft),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}let It;function Bt(){It=void 0}const Ht={now:()=>(void 0===It&&Ht.set(nt.isProcessing?nt.timestamp:performance.now()),It),set:e=>{It=e,queueMicrotask(Bt)}},zt=e=>/^0[^.\s]+$/u.test(e);var Ut=n(5487);const Wt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),$t=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function qt(e,t,n=1){(0,Ut.k)(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=$t.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Wt(e)?parseFloat(e):e}return fe(o)?qt(o,t,n+1):o}const Zt=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Yt=e=>e===Z||e===oe,Gt=(e,t)=>parseFloat(e.split(", ")[t]),Kt=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Gt(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Gt(t[1],e):0}},Xt=new Set(["x","y","z"]),Jt=H.filter((e=>!Xt.has(e))),Qt={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:Kt(4,13),y:Kt(5,14)};Qt.translateX=Qt.x,Qt.translateY=Qt.y;const en=e=>t=>t.test(e),tn=[Z,oe,re,ne,se,ie,{test:e=>"auto"===e,parse:e=>e}],nn=e=>tn.find(en(e)),rn=new Set;let on=!1,sn=!1;function an(){if(sn){const e=Array.from(rn).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return Jt.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}sn=!1,on=!1,rn.forEach((e=>e.complete())),rn.clear()}function ln(){rn.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(sn=!0)}))}class cn{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(rn.add(this),on||(on=!0,et.read(ln),et.resolveKeyframes(an))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(ee(n)&&Q.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),dn=(e,t,n)=>r=>{if(!ee(r))return r;const[o,i,s,a]=r.match(X);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},hn={...Z,transform:e=>Math.round((e=>q(0,255,e))(e))},pn={test:un("rgb","red"),parse:dn("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+hn.transform(e)+", "+hn.transform(t)+", "+hn.transform(n)+", "+K(Y.transform(r))+")"},mn={test:un("#"),parse:function(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}},transform:pn.transform},fn={test:un("hsl","hue"),parse:dn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+re.transform(K(t))+", "+re.transform(K(n))+", "+K(Y.transform(r))+")"},gn={test:e=>pn.test(e)||mn.test(e)||fn.test(e),parse:e=>pn.test(e)?pn.parse(e):fn.test(e)?fn.parse(e):mn.parse(e),transform:e=>ee(e)?e:e.hasOwnProperty("red")?pn.transform(e):fn.transform(e)},vn="number",yn="color",xn="var",wn="var(",bn="${}",En=/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 Sn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(En,(e=>(gn.test(e)?(r.color.push(i),o.push(yn),n.push(gn.parse(e))):e.startsWith(wn)?(r.var.push(i),o.push(xn),n.push(e)):(r.number.push(i),o.push(vn),n.push(parseFloat(e))),++i,bn))).split(bn);return{values:n,split:s,indexes:r,types:o}}function Tn(e){return Sn(e).values}function Cn(e){const{split:t,types:n}=Sn(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e,kn={test:function(e){var t,n;return isNaN(e)&&ee(e)&&((null===(t=e.match(X))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(J))||void 0===n?void 0:n.length)||0)>0},parse:Tn,createTransformer:Cn,getAnimatableNone:function(e){const t=Tn(e);return Cn(e)(t.map(Pn))}},An=new Set(["brightness","contrast","saturate","opacity"]);function Ln(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(X)||[];if(!r)return e;const o=n.replace(r,"");let i=An.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const Mn=/\b([a-z-]*)\(.*?\)/gu,Nn={...kn,getAnimatableNone:e=>{const t=e.match(Mn);return t?t.map(Ln).join(" "):e}},Dn={...ce,color:gn,backgroundColor:gn,outlineColor:gn,fill:gn,stroke:gn,borderColor:gn,borderTopColor:gn,borderRightColor:gn,borderBottomColor:gn,borderLeftColor:gn,filter:Nn,WebkitFilter:Nn},On=e=>Dn[e];function Rn(e,t){let n=On(e);return n!==Nn&&(n=kn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Vn=new Set(["auto","none","0"]);class Fn extends cn{constructor(e,t,n,r){super(e,t,n,r,null==r?void 0:r.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}function jn(e){let t;return()=>(void 0===t&&(t=e()),t)}const In=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!kn.test(e)&&"0"!==e||e.startsWith("url(")));class Bn{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}get resolved(){return this._resolved||this.hasAttemptedResolve||(ln(),an()),this._resolved}onKeyframesResolved(e,t){this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=In(o,t),a=In(i,t);return(0,Ut.K)(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function Hn(e,t){return t?e*(1e3/t):0}const zn=5;function Un(e,t,n){const r=Math.max(t-zn,0);return Hn(n-e(r),t-r)}const Wn=.001,$n=.01,qn=10,Zn=.05,Yn=1;const Gn=12;function Kn(e,t){return e*Math.sqrt(1-t*t)}const Xn=["duration","bounce"],Jn=["stiffness","damping","mass"];function Qn(e,t){return t.some((t=>void 0!==e[t]))}function er({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Qn(e,Jn)&&Qn(e,Xn)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;(0,Ut.K)(e<=Lt(qn),"Spring duration must be 10 seconds or less");let s=1-t;s=q(Zn,Yn,s),e=q($n,qn,Mt(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Kn(t,s),l=Math.exp(-o);return Wn-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Kn(Math.pow(t,2),s);return(-o(t)+Wn>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-Wn,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n{const n=Math.exp(-m*g*t);return i-n*((p+m*g*f)/e*Math.sin(e*t)+f*Math.cos(e*t))}}else if(1===m)y=e=>i-Math.exp(-g*e)*(f+(p+g*f)*e);else{const e=g*Math.sqrt(m*m-1);y=t=>{const n=Math.exp(-m*g*t),r=Math.min(e*t,300);return i-n*((p+m*g*f)*Math.sinh(r)+e*f*Math.cosh(r))/e}}return{calculatedDuration:h&&u||null,next:e=>{const r=y(e);if(h)s.done=e>=u;else{let o=p;0!==e&&(o=m<1?Un(y,e,r):0);const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function tr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=e=>void 0===a?l:void 0===l||Math.abs(a-e)-m*Math.exp(-e/r),y=e=>g+v(e),x=e=>{const t=v(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let w,b;const E=e=>{var t;t=h.value,(void 0!==a&&tl)&&(w=e,b=er({keyframes:[h.value,p(h.value)],velocity:Un(y,e,h.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:e=>{let t=!1;return b||void 0!==w||(t=!0,x(e),E(e)),void 0!==w&&e>=w?b.next(e-w):(!t&&x(e),h)}}}const nr=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function rr(e,t,n,r){if(e===t&&n===r)return Qe.Z;return o=>0===o||1===o?o:nr(function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=nr(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(o,0,1,e,n),t,r)}const or=rr(.42,0,1,1),ir=rr(0,0,.58,1),sr=rr(.42,0,.58,1),ar=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,lr=e=>t=>1-e(1-t),cr=e=>1-Math.sin(Math.acos(e)),ur=lr(cr),dr=ar(cr),hr=rr(.33,1.53,.69,.99),pr=lr(hr),mr=ar(pr),fr={linear:Qe.Z,easeIn:or,easeInOut:sr,easeOut:ir,circIn:cr,circInOut:dr,circOut:ur,backIn:pr,backInOut:mr,backOut:hr,anticipate:e=>(e*=2)<1?.5*pr(e):.5*(2-Math.pow(2,-10*(e-1)))},gr=e=>{if(Array.isArray(e)){(0,Ut.k)(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return rr(t,n,r,o)}return"string"==typeof e?((0,Ut.k)(void 0!==fr[e],`Invalid easing type '${e}'`),fr[e]):e},vr=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},yr=(e,t,n)=>e+(t-e)*n;function xr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wr(e,t){return n=>n>0?t:e}const br=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Er=[mn,pn,fn];function Sr(e){const t=(n=e,Er.find((e=>e.test(n))));var n;if((0,Ut.K)(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===fn&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=xr(a,r,e+1/3),i=xr(a,r,e),s=xr(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(r)),r}const Tr=(e,t)=>{const n=Sr(e),r=Sr(t);if(!n||!r)return wr(e,t);const o={...n};return e=>(o.red=br(n.red,r.red,e),o.green=br(n.green,r.green,e),o.blue=br(n.blue,r.blue,e),o.alpha=yr(n.alpha,r.alpha,e),pn.transform(o))},Cr=new Set(["none","hidden"]);function Pr(e,t){return n=>yr(e,t,n)}function kr(e){return"number"==typeof e?Pr:"string"==typeof e?fe(e)?wr:gn.test(e)?Tr:Lr:Array.isArray(e)?Ar:"object"==typeof e?gn.test(e)?Tr:_r:wr}function Ar(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>kr(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const Lr=(e,t)=>{const n=kn.createTransformer(t),r=Sn(e),o=Sn(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?Cr.has(e)&&!o.values.length||Cr.has(t)&&!r.values.length?function(e,t){return Cr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):ht(Ar(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;iArray.isArray(e)&&"number"!=typeof e[0])(r)?r.map(gr):gr(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=vr(0,t,r);e.push(yr(n,1,o))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if((0,Ut.k)(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||Mr,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(q(e[0],e[i-1],t)):l}(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||sr)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const Dr=e=>{const t=({timestamp:t})=>e(t);return{start:()=>et.update(t,!0),stop:()=>tt(t),now:()=>nt.isProcessing?nt.timestamp:Ht.now()}},Or={decay:tr,inertia:tr,tween:Nr,keyframes:Nr,spring:er},Rr=e=>e/100;class Vr extends Bn{constructor({KeyframeResolver:e=cn,...t}){super(t),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:n,motionValue:r,keyframes:o}=this.options,i=(e,t)=>this.onKeyframesResolved(e,t);n&&r&&r.owner?this.resolver=r.owner.resolveKeyframes(o,i,n,r):this.resolver=new e(o,i,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=Or[t]||Nr;let a,l;s!==Nr&&"number"!=typeof e[0]&&(a=ht(Rr,Mr(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:h,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,x=o;if(h){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,h+1),Boolean(t%2)&&("reverse"===p?(n=1-n,m&&(n-=m/u)):"mirror"===p&&(x=i)),y=q(0,1,n)*u}const w=v?{done:!1,value:a[0]}:x.next(y);s&&(w.value=s(w.value));let{done:b}=w;v||null===l||(b=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const E=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return E&&void 0!==r&&(w.value=jt(a,this.options,r)),f&&f(w.value),E&&this.finish(),w}get duration(){const{resolved:e}=this;return e?Mt(e.calculatedDuration):0}get time(){return Mt(this.currentTime)}set time(e){e=Lt(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Mt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=Dr,onPlay:t}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=n),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Fr=e=>Array.isArray(e)&&"number"==typeof e[0];function jr(e){return Boolean(!e||"string"==typeof e&&e in Br||Fr(e)||Array.isArray(e)&&e.every(jr))}const Ir=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Br={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ir([0,.65,.55,1]),circOut:Ir([.55,0,1,.45]),backIn:Ir([.31,.01,.66,-.59]),backOut:Ir([.33,1.53,.69,.99])};function Hr(e){return zr(e)||Br.easeOut}function zr(e){return e?Fr(e)?Ir(e):Array.isArray(e)?e.map(Hr):Br[e]:void 0}const Ur=jn((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class Wr extends Bn{constructor(e){super(e);const{name:t,motionValue:n,keyframes:r}=this.options;this.resolver=new Fn(r,((e,t)=>this.onKeyframesResolved(e,t)),t,n),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(c=this.options).type||!jr(c.ease)){const{onComplete:t,onUpdate:n,motionValue:a,...l}=this.options,c=function(e,t){const n=new Vr({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,l);1===(e=c.keyframes).length&&(e[1]=e[0]),r=c.duration,o=c.times,i=c.ease,s="keyframes"}var c;const u=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=zr(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return u.startTime=Ht.now(),this.pendingTimeline?(u.timeline=this.pendingTimeline,this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;a.set(jt(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Mt(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Mt(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Lt(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Qe.Z;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Qe.Z}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,...l}=this.options,c=new Vr({...l,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),u=Lt(this.time);e.setWithVelocity(c.sample(u-10).value,c.sample(u).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return Ur()&&n&&$e.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const $r=jn((()=>void 0!==window.ScrollTimeline));class qr{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n{if(!$r()||!t.attachTimeline)return t.pause(),function(e,n){let r;const o=()=>{const{currentTime:e}=n,o=(null===e?0:e.value)/100;r!==o&&(e=>{t.time=t.duration*e})(o),r=o};return et.update(o,!0),()=>tt(o)}(0,e);t.attachTimeline(e)}));return()=>{t.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get duration(){let e=0;for(let t=0;tt[e]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const Zr=(e,t,n,r={},o,i,s)=>a=>{const l=Vt(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u-=Lt(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),s&&s()},onStop:s,name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(l)||(d={...d,...Rt(e,d)}),d.duration&&(d.duration=Lt(d.duration)),d.repeatDelay&&(d.repeatDelay=Lt(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let h=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(h=!0)),h&&!i&&void 0!==t.get()){const e=jt(d.keyframes,l);if(void 0!==e)return et.update((()=>{d.onUpdate(e),d.onComplete()})),new qr([])}return!i&&Wr.supports(d)?new Wr(d):new Vr(d)};class Yr{constructor(){this.subscriptions=[]}add(e){return Ze(this.subscriptions,e),()=>Ye(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{const n=Ht.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Ht.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Yr);const n=this.events[e].add(t);return"change"===e?()=>{n(),et.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Gr.current&&Gr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Ht.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Hn(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Xr(e,t){return new Kr(e,t)}function Jr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xr(n))}function Qr(e){return e.getProps()[d]}class eo extends Kr{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=qe(e);if(!t)return;const n=this.counts.get(t)||0;this.counts.set(t,n+1),0===n&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const e=this.counts.get(t)-1;this.counts.set(t,e),0===e&&(Ye(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function to(e,t){var n;if(!e.applyWillChange)return;let r=e.getValue("willChange");return r||(null===(n=e.props.style)||void 0===n?void 0:n.willChange)||(r=new eo("auto"),e.addValue("willChange",r)),o=r,Boolean(W(o)&&o.add)?r.add(t):void 0;var o}function no({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function ro(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||u&&no(u,t))continue;const a={delay:n,elapsed:0,...Vt(s||{},t)};let d=!1;if(window.HandoffAppearAnimations){const n=Qr(e);if(n){const e=window.HandoffAppearAnimations(n,t,r,et);null!==e&&(a.elapsed=e,d=!0)}}r.start(Zr(t,r,o,e.shouldReduceMotion&&z.has(t)?{type:!1}:a,e,d,to(e,t)));const h=r.animation;h&&c.push(h)}return a&&Promise.all(c).then((()=>{et.update((()=>{a&&function(e,t){const n=_t(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Jr(e,t,Ue(i[t]))}(e,a)}))})),c}function oo(e,t,n={}){var r;const o=_t(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(ro(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(io).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(oo(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function io(e,t){return e.sortNodePosition(t)}const so=[...C].reverse(),ao=C.length;function lo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function co(){return{animate:lo(!0),whileInView:lo(),whileHover:lo(),whileTap:lo(),whileDrag:lo(),whileFocus:lo(),exit:lo()}}let uo=0;const ho={animation:{Feature:class extends yt{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=function(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>oo(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=oo(e,t,n);else{const o="function"==typeof t?_t(e,t,n.custom):t;r=Promise.all(ro(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=co(),r=!0;const o=t=>(n,r)=>{var o;const i=_t(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;td&&v),b=!1;const E=Array.isArray(g)?g:[g];let C=E.reduce(o(m),{});!1===y&&(C={});const{prevResolvedValues:P={}}=f,k={...P,...C},A=t=>{w=!0,c.has(t)&&(b=!0,c.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in k){const t=C[e],n=P[e];if(u.hasOwnProperty(e))continue;let r=!1;r=He(t)&&He(n)?!At(t,n):t!==n,r?null!=t?A(e):c.add(e):void 0!==t&&c.has(e)?A(e):f.protectedKeys[e]=!0}f.prevProp=g,f.prevResolvedValues=C,f.isActive&&(u={...u,...C}),r&&e.blockInitialAnimation&&(w=!1),!w||x&&!b||l.push(...E.map((e=>({animation:e,options:{type:m}}))))}var h,p;if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let m=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(m=!1),r=!1,m?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=co(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();T(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends yt{constructor(){super(...arguments),this.id=uo++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},po=(e,t)=>Math.abs(e-t);class mo{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=vo(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=po(e.x,t.x),r=po(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=nt;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=fo(t,this.transformPagePoint),et.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=vo("pointercancel"===e.type?this.lastMoveEventInfo:fo(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!at(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=fo(lt(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=nt;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,vo(i,this.history)),this.removeListeners=ht(ut(this.contextWindow,"pointermove",this.handlePointerMove),ut(this.contextWindow,"pointerup",this.handlePointerUp),ut(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),tt(this.updatePoint)}}function fo(e,t){return t?{point:t(e.point)}:e}function go(e,t){return{x:e.x-t.x,y:e.y-t.y}}function vo({point:e},t){return{point:e,delta:go(e,xo(t)),offset:go(e,yo(t)),velocity:wo(t,.1)}}function yo(e){return e[0]}function xo(e){return e[e.length-1]}function wo(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=xo(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Lt(t)));)n--;if(!r)return{x:0,y:0};const i=Mt(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const bo=.9999,Eo=1.0001,So=-.01,To=.01;function Co(e){return e.max-e.min}function Po(e,t,n,r=.5){e.origin=r,e.originPoint=yr(t.min,t.max,e.origin),e.scale=Co(n)/Co(t),e.translate=yr(n.min,n.max,e.origin)-e.originPoint,(e.scale>=bo&&e.scale<=Eo||isNaN(e.scale))&&(e.scale=1),(e.translate>=So&&e.translate<=To||isNaN(e.translate))&&(e.translate=0)}function ko(e,t,n,r){Po(e.x,t.x,n.x,r?r.originX:void 0),Po(e.y,t.y,n.y,r?r.originY:void 0)}function Ao(e,t,n){e.min=n.min+t.min,e.max=e.min+Co(t)}function _o(e,t,n){e.min=t.min-n.min,e.max=e.min+Co(t)}function Lo(e,t,n){_o(e.x,t.x,n.x),_o(e.y,t.y,n.y)}function Mo(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function No(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Fo=()=>({x:{min:0,max:0},y:{min:0,max:0}});function jo(e){return[e("x"),e("y")]}function Io({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Bo(e){return void 0===e||1===e}function Ho({scale:e,scaleX:t,scaleY:n}){return!Bo(e)||!Bo(t)||!Bo(n)}function zo(e){return Ho(e)||Uo(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Uo(e){return Wo(e.x)||Wo(e.y)}function Wo(e){return e&&"0%"!==e}function $o(e,t,n){return n+t*(e-n)}function qo(e,t,n,r,o){return void 0!==o&&(e=$o(e,o,r)),$o(e,n,r)+t}function Zo(e,t=0,n=1,r,o){e.min=qo(e.min,t,n,r,o),e.max=qo(e.max,t,n,r,o)}function Yo(e,{x:t,y:n}){Zo(e.x,t.translate,t.scale,t.originPoint),Zo(e.y,n.translate,n.scale,n.originPoint)}const Go=.999999999999,Ko=1.0000000000001;function Xo(e,t){e.min=e.min+t,e.max=e.max+t}function Jo(e,t,n,r,o=.5){Zo(e,t,n,yr(e.min,e.max,o),r)}function Qo(e,t){Jo(e.x,t.x,t.scaleX,t.scale,t.originX),Jo(e.y,t.y,t.scaleY,t.scale,t.originY)}function ei(e,t){return Io(function(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}}(e.getBoundingClientRect(),t))}const ti=({current:e})=>e?e.ownerDocument.defaultView:null,ni=new WeakMap;class ri{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Fo(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new mo(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(lt(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:o,onDragStart:i}=this.getProps();if(r&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=gt(r),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),jo((e=>{let t=this.getAxisMotionValue(e).get()||0;if(re.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=Co(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),i&&et.postRender((()=>i(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=to(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>jo((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:ti(this.visualElement)})}stop(e,t){var n;null===(n=this.removeWillChange)||void 0===n||n.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=t;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&et.postRender((()=>i(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!oi(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?yr(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&g(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Mo(e.x,n,o),y:Mo(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Do){return!1===e?e=0:!0===e&&(e=Do),{x:Oo(e,"left","right"),y:Oo(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&jo((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!g(e))return!1;const n=e.current;(0,Ut.k)(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=ei(e,n),{scroll:o}=t;return o&&(Xo(r.x,o.offset.x),Xo(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:No(e.x,t.x),y:No(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Io(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=jo((s=>{if(!oi(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(Zr(e,n,0,t,this.visualElement,!1,to(this.visualElement,e)))}stopAnimation(){jo((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){jo((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){jo((t=>{const{drag:n}=this.getProps();if(!oi(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-yr(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!g(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};jo((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Co(e),o=Co(t);return o>r?n=vr(t.min,t.max-r,e.min):r>o&&(n=vr(e.min,e.max-o,t.min)),q(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),jo((t=>{if(!oi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(yr(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;ni.set(this.visualElement,this);const e=ut(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();g(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),et.read(t);const o=st(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(jo((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Do,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function oi(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ii=e=>(t,n)=>{e&&et.postRender((()=>e(t,n)))},si={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ai(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const li={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!oe.test(e))return e;e=parseFloat(e)}return`${ai(e,t.target.x)}% ${ai(e,t.target.y)}%`}},ci={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=kn.parse(e);if(o.length>5)return r;const i=kn.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=yr(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}};class ui extends o.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=hi,Object.assign(B,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),si.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||et.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),m.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function di(e){const[t,n]=function(){const e=(0,o.useContext)(a.O);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=(0,o.useId)();(0,o.useEffect)((()=>r(i)),[]);const s=(0,o.useCallback)((()=>n&&n(i)),[i,n]);return!t&&n?[!1,s]:[!0]}(),i=(0,o.useContext)(D.p);return(0,r.jsx)(ui,{...e,layoutGroup:i,switchLayoutGroup:(0,o.useContext)(v),isPresent:t,safeToRemove:n})}const hi={borderRadius:{...li,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:li,borderTopRightRadius:li,borderBottomLeftRadius:li,borderBottomRightRadius:li,boxShadow:ci},pi=["TopLeft","TopRight","BottomLeft","BottomRight"],mi=pi.length,fi=e=>"string"==typeof e?parseFloat(e):e,gi=e=>"number"==typeof e||oe.test(e);function vi(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const yi=wi(0,.5,ur),xi=wi(.5,.95,Qe.Z);function wi(e,t,n){return r=>rt?1:n(vr(e,t,r))}function bi(e,t){e.min=t.min,e.max=t.max}function Ei(e,t){bi(e.x,t.x),bi(e.y,t.y)}function Si(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ti(e,t,n,r,o){return e=$o(e-=t,1/n,r),void 0!==o&&(e=$o(e,1/o,r)),e}function Ci(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){if(re.test(t)&&(t=parseFloat(t),t=yr(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=yr(i.min,i.max,r);e===i&&(a-=t),e.min=Ti(e.min,t,n,a,o),e.max=Ti(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const Pi=["x","scaleX","originX"],ki=["y","scaleY","originY"];function Ai(e,t,n,r){Ci(e.x,t,Pi,n?n.x:void 0,r?r.x:void 0),Ci(e.y,t,ki,n?n.y:void 0,r?r.y:void 0)}function _i(e){return 0===e.translate&&1===e.scale}function Li(e){return _i(e.x)&&_i(e.y)}function Mi(e,t){return e.min===t.min&&e.max===t.max}function Ni(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Di(e,t){return Ni(e.x,t.x)&&Ni(e.y,t.y)}function Oi(e){return Co(e.x)/Co(e.y)}function Ri(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Vi{constructor(){this.members=[]}add(e){Ze(this.members,e),e.scheduleRender()}remove(e){if(Ye(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Fi=(e,t)=>e.depth-t.depth;class ji{constructor(){this.children=[],this.isDirty=!1}add(e){Ze(this.children,e),this.isDirty=!0}remove(e){Ye(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Fi),this.isDirty=!1,this.children.forEach(e)}}const Ii={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Bi="undefined"!=typeof window&&void 0!==window.MotionDebug,Hi=["","X","Y","Z"],zi={visibility:"hidden"};let Ui=0;function Wi(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function $i(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return!1;const{visualElement:t}=e.options;return!!t&&(!!Qr(t)||!(!e.parent||e.parent.hasCheckedOptimisedAppear)&&$i(e.parent))}function qi({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Ui++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Bi&&(Ii.totalNodes=Ii.resolvedTargetDeltas=Ii.recalculatedProjection=0),this.nodes.forEach(Gi),this.nodes.forEach(ns),this.nodes.forEach(rs),this.nodes.forEach(Ki),Bi&&window.MotionDebug.record(Ii)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Ht.now(),r=({timestamp:t})=>{const o=t-n;o>=250&&(tt(r),e(o-250))};return et.read(r,!0),()=>tt(r)}(r),si.hasAnimatedSinceResize&&(si.hasAnimatedSinceResize=!1,this.nodes.forEach(ts))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||cs,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Di(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Vt(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||ts(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,tt(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(os),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.HandoffCancelAllAnimations&&$i(this)&&window.HandoffCancelAllAnimations(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eGo&&(t.x=1),t.yGo&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=Fo());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Si(this.prevProjectionDelta.x,this.projectionDelta.x),Si(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),ko(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Ri(this.projectionDelta.x,this.prevProjectionDelta.x)&&Ri(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Bi&&Ii.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Vo(),this.projectionDelta=Vo(),this.projectionDeltaWithTransform=Vo()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=Vo();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s=Fo(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(ls));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,p,m,f,g;ss(i.x,e.x,n),ss(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lo(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=s,g=n,as(p.x,m.x,f.x,g),as(p.y,m.y,f.y,g),d&&(l=this.relativeTarget,h=d,Mi(l.x,h.x)&&Mi(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d=Fo()),Ei(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=yr(0,void 0!==n.opacity?n.opacity:1,yi(r)),e.opacityExit=yr(void 0!==t.opacity?t.opacity:1,0,xi(r))):i&&(e.opacity=yr(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{si.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=W(0)?0:Xr(0);return r.start(Zr("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.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 e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&ps(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Fo();const t=Co(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Co(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Ei(t,n),Qo(t,o),ko(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Vi),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Wi("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Ji),this.root.sharedNodes.clear()}}}function Zi(e){e.updateLayout()}function Yi(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?jo((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Co(r);r.min=t[e].min,r.max=r.min+o})):ps(o,n.layoutBox,t)&&jo((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Co(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s=Vo();ko(s,t,n.layoutBox);const a=Vo();i?ko(a,e.applyTransform(r,!0),n.measuredBox):ko(a,t,n.layoutBox);const l=!Li(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s=Fo();Lo(s,n.layoutBox,o.layoutBox);const a=Fo();Lo(a,t,i.layoutBox),Di(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Gi(e){Bi&&Ii.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ki(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Xi(e){e.clearSnapshot()}function Ji(e){e.clearMeasurements()}function Qi(e){e.isLayoutDirty=!1}function es(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ts(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ns(e){e.resolveTargetDelta()}function rs(e){e.calcProjection()}function os(e){e.resetSkewAndRotation()}function is(e){e.removeLeadSnapshot()}function ss(e,t,n){e.translate=yr(t.translate,0,n),e.scale=yr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function as(e,t,n,r){e.min=yr(t.min,n.min,r),e.max=yr(t.max,n.max,r)}function ls(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const cs={duration:.45,ease:[.4,0,.1,1]},us=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ds=us("applewebkit/")&&!us("chrome/")?Math.round:Qe.Z;function hs(e){e.min=ds(e.min),e.max=ds(e.max)}function ps(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Oi(t),o=Oi(n),.2,!(Math.abs(r-o)<=.2));var r,o}function ms(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const fs=qi({attachResizeListener:(e,t)=>st(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),gs={current:void 0},vs=qi({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gs.current){const e=new fs({});e.mount(window),e.setOptions({layoutScroll:!0}),gs.current=e}return gs.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),ys={pan:{Feature:class extends yt{constructor(){super(...arguments),this.removePointerDownListener=Qe.Z}onPointerDown(e){this.session=new mo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ti(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ii(e),onStart:ii(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&et.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=ut(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends yt{constructor(e){super(e),this.removeGroupControls=Qe.Z,this.removeListeners=Qe.Z,this.controls=new ri(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qe.Z}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:vs,MeasureLayout:di}},xs={current:null},ws={current:!1},bs=new WeakMap,Es=[...tn,gn,kn],Ss=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ts=P.length;class Cs{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.applyWillChange=!1,this.resolveKeyframes=(e,t,n,r)=>new this.KeyframeResolver(e,t,n,r,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=cn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,et.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=k(t),this.isVariantNode=A(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&W(t)&&t.set(a[e],!1)}}mount(e){this.current=e,bs.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),ws.current||function(){if(ws.current=!0,N.j)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>xs.current=e.matches;e.addListener(t),t()}else xs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||xs.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){bs.delete(this.current),this.projection&&this.projection.unmount(),tt(this.notifyUpdate),tt(this.render),this.valueSubscriptions.forEach((e=>e())),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){const n=z.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&et.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(()=>{r(),o(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in M){const t=M[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Fo()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Xr(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];var o;return null!=r&&("string"==typeof r&&(Wt(r)||zt(r))?r=parseFloat(r):(o=r,!Es.find(en(o))&&kn.test(t)&&(r=Rn(e,t))),this.setBaseTarget(e,W(r)?r.get():r)),W(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=Ie(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||W(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Yr),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Ps extends Cs{constructor(){super(...arguments),this.KeyframeResolver=Fn}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class ks extends Ps{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=De}readValueFromInstance(e,t){if(z.has(t)){const e=On(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(pe(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return ei(e,t)}build(e,t,n){ve(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ve(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;W(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class As extends Ps{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Fo}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(z.has(t)){const e=On(t);return e&&e.default||0}return t=Oe.has(t)?t:u(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Fe(e,t,n)}build(e,t,n){Ae(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Re(e,t,0,r)}mount(e){this.isSVGTag=Le(e.tagName),super.mount(e)}}const _s=(e,t)=>I(e)?new As(t):new ks(t,{allowProjection:e!==o.Fragment}),Ls={...ho,...kt,...ys,layout:{ProjectionNode:vs,MeasureLayout:di}},Ms=F(((e,t)=>function(e,{forwardMotionProps:t=!1},n,r){return{...I(e)?ot:it,preloadedFeatures:n,useRender:Ne(t),createVisualElement:r,Component:e}}(e,t,Ls,_s)))},5487:(e,t,n)=>{"use strict";n.d(t,{K:()=>o,k:()=>i});var r=n(1662);let o=r.Z,i=r.Z},1741:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});const r="undefined"!=typeof window},1662:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=e=>e},6681:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});var r=n(9196);function o(e){const t=(0,r.useRef)(null);return null===t.current&&(t.current=e()),t.current}},8868:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var r=n(9196);const o=n(1741).j?r.useLayoutEffect:r.useEffect},46:(e,t,n)=>{"use strict";n.d(t,{$l:()=>s,BN:()=>F,DY:()=>m,Fs:()=>B,J$:()=>$,JN:()=>w,LI:()=>_,PM:()=>c,UG:()=>q,W6:()=>k,i_:()=>i,kY:()=>K,ko:()=>Q,kw:()=>A,mf:()=>l,o8:()=>a,qC:()=>N,s6:()=>J,sj:()=>V,u3:()=>O,u_:()=>z,w6:()=>P,xD:()=>ee});var r=n(9196);const o=()=>{},i=o(),s=Object,a=e=>e===i,l=e=>"function"==typeof e,c=(e,t)=>({...e,...t}),u=e=>l(e.then),d=new WeakMap;let h=0;const p=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(s(e)!==e||r||n==RegExp)o=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(o=d.get(e),o)return o;if(o=++h+"~",d.set(e,o),n==Array){for(o="@",i=0;i{const n=m.get(e);return[()=>!a(t)&&e.get(t)||f,r=>{if(!a(t)){const o=e.get(t);t in g||(g[t]=o),n[5](t,c(o,r),o||f)}},n[6],()=>!a(t)&&t in g?g[t]:!a(t)&&e.get(t)||f]};let b=!0;const[E,S]=y&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[o,o],T={isOnline:()=>b,isVisible:()=>{const e=x&&document.visibilityState;return a(e)||"hidden"!==e}},C={initFocus:e=>(x&&document.addEventListener("visibilitychange",e),E("focus",e),()=>{x&&document.removeEventListener("visibilitychange",e),S("focus",e)}),initReconnect:e=>{const t=()=>{b=!0,e()},n=()=>{b=!1};return E("online",t),E("offline",n),()=>{S("online",t),S("offline",n)}}},P=!r.useId,k=!y||"Deno"in window,A=e=>y&&typeof window.requestAnimationFrame!=v?window.requestAnimationFrame(e):setTimeout(e,1),_=k?r.useEffect:r.useLayoutEffect,L="undefined"!=typeof navigator&&navigator.connection,M=!k&&L&&(["slow-2g","2g"].includes(L.effectiveType)||L.saveData),N=e=>{if(l(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?p(e):"",t]};let D=0;const O=()=>++D,R=2;var V={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:R,RECONNECT_EVENT:1};async function F(...e){const[t,n,r,o]=e,s=c({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{});let d=s.populateCache;const h=s.rollbackOnError;let p=s.optimisticData;const f=s.throwOnError;if(l(n)){const e=n,r=[],o=t.keys();for(const n of o)!/^\$(inf|sub)\$/.test(n)&&e(t.get(n)._k)&&r.push(n);return Promise.all(r.map(g))}return g(n);async function g(n){const[o]=N(n);if(!o)return;const[c,g]=w(t,o),[v,y,x,b]=m.get(t),E=()=>{const e=v[o];return(l(s.revalidate)?s.revalidate(c().data,n):!1!==s.revalidate)&&(delete x[o],delete b[o],e&&e[0])?e[0](R).then((()=>c().data)):c().data};if(e.length<3)return E();let S,T=r;const C=O();y[o]=[C,0];const P=!a(p),k=c(),A=k.data,_=k._c,L=a(_)?A:_;if(P&&(p=l(p)?p(L,A):p,g({data:p,_c:L})),l(T))try{T=T(L)}catch(e){S=e}if(T&&u(T)){if(T=await T.catch((e=>{S=e})),C!==y[o][0]){if(S)throw S;return T}S&&P&&(e=>"function"==typeof h?h(e):!1!==h)(S)&&(d=!0,g({data:L,_c:i}))}if(d&&!S)if(l(d)){const e=d(T,L);g({data:e,error:i,_c:i})}else g({data:T,error:i,_c:i});if(y[o][1]=O(),Promise.resolve(E()).then((()=>{g({_c:i})})),!S)return T;if(f)throw S}}const j=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},I=(e,t)=>{if(!m.has(e)){const n=c(C,t),r={},s=F.bind(i,e);let a=o;const l={},u=(e,t)=>{const n=l[e]||[];return l[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},d=(t,n,r)=>{e.set(t,n);const o=l[t];if(o)for(const e of o)e(n,r)},h=()=>{if(!m.has(e)&&(m.set(e,[r,{},{},{},s,d,u]),!k)){const t=n.initFocus(setTimeout.bind(i,j.bind(i,r,0))),o=n.initReconnect(setTimeout.bind(i,j.bind(i,r,1)));a=()=>{t&&t(),o&&o(),m.delete(e)}}};return h(),[e,s,h,a]}return[e,m.get(e)[4]]},[B,H]=I(new Map),z=c({onLoadingSlow:o,onSuccess:o,onError:o,onErrorRetry:(e,__,t,n,r)=>{const o=t.errorRetryCount,i=r.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*t.errorRetryInterval;!a(o)&&i>o||setTimeout(n,s,r)},onDiscarded:o,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:M?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:M?5e3:3e3,compare:(e,t)=>p(e)==p(t),isPaused:()=>!1,cache:B,mutate:H,fallback:{}},T),U=(e,t)=>{const n=c(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=c(o,s))}return n},W=(0,r.createContext)({}),$=e=>{const{value:t}=e,n=(0,r.useContext)(W),o=l(t),s=(0,r.useMemo)((()=>o?t(n):t),[o,n,t]),a=(0,r.useMemo)((()=>o?s:U(n,s)),[o,n,s]),u=s&&s.provider,d=(0,r.useRef)(i);u&&!d.current&&(d.current=I(u(a.cache||B),s));const h=d.current;return h&&(a.cache=h[0],a.mutate=h[1]),_((()=>{if(h)return h[2]&&h[2](),h[3]}),[]),(0,r.createElement)(W.Provider,c(e,{value:a}))},q="$inf$",Z=y&&window.__SWR_DEVTOOLS_USE__,Y=Z?window.__SWR_DEVTOOLS_USE__:[],G=e=>l(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],K=()=>c(z,(0,r.useContext)(W)),X=Y.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const[r]=N(t),[,,,o]=m.get(B);if(r.startsWith(q))return n(...e);const i=o[r];return a(i)?n(...e):(delete o[r],i)}),r))),J=e=>function(...t){const n=K(),[r,o,i]=G(t),s=U(n,i);let a=e;const{use:l}=s,c=(l||[]).concat(X);for(let e=c.length;e--;)a=c[e](a);return a(r,o||s.fetcher||null,s)},Q=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}},ee=(e,t)=>(...n)=>{const[r,o,i]=G(n),s=(i.use||[]).concat(t);return e(r,o,{...i,use:s})};Z&&(window.__SWR_DEVTOOLS_REACT__=r)},9870:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(9196),o=n(1688),i=n(46);const s=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t})),e)}),a={dedupe:!0};i.$l.defineProperty(i.J$,"defaultValue",{value:i.u_});const l=(0,i.s6)(((e,t,n)=>{const{cache:l,compare:c,suspense:u,fallbackData:d,revalidateOnMount:h,revalidateIfStale:p,refreshInterval:m,refreshWhenHidden:f,refreshWhenOffline:g,keepPreviousData:v}=n,[y,x,w,b]=i.DY.get(l),[E,S]=(0,i.qC)(e),T=(0,r.useRef)(!1),C=(0,r.useRef)(!1),P=(0,r.useRef)(E),k=(0,r.useRef)(t),A=(0,r.useRef)(n),_=()=>A.current,L=()=>_().isVisible()&&_().isOnline(),[M,N,D,O]=(0,i.JN)(l,E),R=(0,r.useRef)({}).current,V=(0,i.o8)(d)?n.fallback[E]:d,F=(e,t)=>{for(const n in R){const r=n;if("data"===r){if(!c(e[r],t[r])){if(!(0,i.o8)(e[r]))return!1;if(!c(q,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},j=(0,r.useMemo)((()=>{const e=!!E&&!!t&&((0,i.o8)(h)?!_().isPaused()&&!u&&(!!(0,i.o8)(p)||p):h),n=t=>{const n=(0,i.PM)(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n},r=M(),o=O(),s=n(r),a=r===o?s:n(o);let l=s;return[()=>{const e=n(M());return F(e,l)?(l.data=e.data,l.isLoading=e.isLoading,l.isValidating=e.isValidating,l.error=e.error,l):(l=e,e)},()=>a]}),[l,E]),I=(0,o.useSyncExternalStore)((0,r.useCallback)((e=>D(E,((t,n)=>{F(n,t)||e()}))),[l,E]),j[0],j[1]),B=!T.current,H=y[E]&&y[E].length>0,z=I.data,U=(0,i.o8)(z)?V:z,W=I.error,$=(0,r.useRef)(U),q=v?(0,i.o8)(z)?$.current:z:U,Z=!(H&&!(0,i.o8)(W))&&(B&&!(0,i.o8)(h)?h:!_().isPaused()&&(u?!(0,i.o8)(U)&&p:(0,i.o8)(U)||p)),Y=!!(E&&t&&B&&Z),G=(0,i.o8)(I.isValidating)?Y:I.isValidating,K=(0,i.o8)(I.isLoading)?Y:I.isLoading,X=(0,r.useCallback)((async e=>{const t=k.current;if(!E||!t||C.current||_().isPaused())return!1;let r,o,s=!0;const a=e||{},l=!w[E]||!a.dedupe,u=()=>i.w6?!C.current&&E===P.current&&T.current:E===P.current,d={isValidating:!1,isLoading:!1},h=()=>{N(d)},p=()=>{const e=w[E];e&&e[1]===o&&delete w[E]},m={isValidating:!0};(0,i.o8)(M().data)&&(m.isLoading=!0);try{if(l&&(N(m),n.loadingTimeout&&(0,i.o8)(M().data)&&setTimeout((()=>{s&&u()&&_().onLoadingSlow(E,n)}),n.loadingTimeout),w[E]=[t(S),(0,i.u3)()]),[r,o]=w[E],r=await r,l&&setTimeout(p,n.dedupingInterval),!w[E]||w[E][1]!==o)return l&&u()&&_().onDiscarded(E),!1;d.error=i.i_;const e=x[E];if(!(0,i.o8)(e)&&(o<=e[0]||o<=e[1]||0===e[1]))return h(),l&&u()&&_().onDiscarded(E),!1;const a=M().data;d.data=c(a,r)?a:r,l&&u()&&_().onSuccess(r,E,n)}catch(e){p();const t=_(),{shouldRetryOnError:n}=t;t.isPaused()||(d.error=e,l&&u()&&(t.onError(e,E,t),(!0===n||(0,i.mf)(n)&&n(e))&&(_().revalidateOnFocus&&_().revalidateOnReconnect&&!L()||t.onErrorRetry(e,E,t,(e=>{const t=y[E];t&&t[0]&&t[0](i.sj.ERROR_REVALIDATE_EVENT,e)}),{retryCount:(a.retryCount||0)+1,dedupe:!0}))))}return s=!1,h(),!0}),[E,l]),J=(0,r.useCallback)(((...e)=>(0,i.BN)(l,P.current,...e)),[]);if((0,i.LI)((()=>{k.current=t,A.current=n,(0,i.o8)(z)||($.current=z)})),(0,i.LI)((()=>{if(!E)return;const e=X.bind(i.i_,a);let t=0;const n=(0,i.ko)(E,y,((n,r={})=>{if(n==i.sj.FOCUS_EVENT){const n=Date.now();_().revalidateOnFocus&&n>t&&L()&&(t=n+_().focusThrottleInterval,e())}else if(n==i.sj.RECONNECT_EVENT)_().revalidateOnReconnect&&L()&&e();else{if(n==i.sj.MUTATE_EVENT)return X();if(n==i.sj.ERROR_REVALIDATE_EVENT)return X(r)}}));return C.current=!1,P.current=E,T.current=!0,N({_k:S}),Z&&((0,i.o8)(U)||i.W6?e():(0,i.kw)(e)),()=>{C.current=!0,n()}}),[E]),(0,i.LI)((()=>{let e;function t(){const t=(0,i.mf)(m)?m(M().data):m;t&&-1!==e&&(e=setTimeout(n,t))}function n(){M().error||!f&&!_().isVisible()||!g&&!_().isOnline()?t():X(a).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[m,f,g,E]),(0,r.useDebugValue)(q),u&&(0,i.o8)(U)&&E){if(!i.w6&&i.W6)throw new Error("Fallback data is required when using suspense in SSR.");k.current=t,A.current=n,C.current=!1;const e=b[E];if(!(0,i.o8)(e)){const t=J(e);s(t)}if(!(0,i.o8)(W))throw W;{const e=X(a);(0,i.o8)(q)||(e.status="fulfilled",e.value=!0),s(e)}}return{mutate:J,get data(){return R.data=!0,q},get error(){return R.error=!0,W},get isValidating(){return R.isValidating=!0,G},get isLoading(){return R.isLoading=!0,K}}})),c=(0,i.xD)(l,(e=>(t,n,r)=>(r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,e(t,n,r))))},270:(e,t,n)=>{"use strict";n.d(t,{Ue:()=>d});const r=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>s,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=t=e(r,o,i);return i};var o=n(9196),i=n(2798);const{useDebugValue:s}=o,{useSyncExternalStoreWithSelector:a}=i;let l=!1;const c=e=>e,u=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t="function"==typeof e?(e=>e?r(e):r)(e):e,n=(e,n)=>function(e,t=c,n){n&&!l&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),l=!0);const r=a(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return s(r),r}(t,e,n);return Object.assign(n,t),n},d=e=>e?u(e):u},782:(e,t,n)=>{"use strict";n.d(t,{FL:()=>a,mW:()=>i,tJ:()=>c});const r=new Map,o=e=>{const t=r.get(e);return t?Object.fromEntries(Object.entries(t.stores).map((([e,t])=>[e,t.getState()]))):{}},i=(e,t={})=>(n,i,a)=>{const{enabled:l,anonymousActionType:c,store:u,...d}=t;let h;try{h=(null==l||l)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(e){}if(!h)return l&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,i,a);const{connection:p,...m}=((e,t,n)=>{if(void 0===e)return{type:"untracked",connection:t.connect(n)};const o=r.get(n.name);if(o)return{type:"tracked",store:e,...o};const i={connection:t.connect(n),stores:{}};return r.set(n.name,i),{type:"tracked",store:e,...i}})(u,h,d);let f=!0;a.setState=(e,t,r)=>{const s=n(e,t);if(!f)return s;const l=void 0===r?{type:c||"anonymous"}:"string"==typeof r?{type:r}:r;return void 0===u?(null==p||p.send(l,i()),s):(null==p||p.send({...l,type:`${u}/${l.type}`},{...o(d.name),[u]:a.getState()}),s)};const g=(...e)=>{const t=f;f=!1,n(...e),f=t},v=e(a.setState,i,a);if("untracked"===m.type?null==p||p.init(v):(m.stores[m.store]=a,null==p||p.init(Object.fromEntries(Object.entries(m.stores).map((([e,t])=>[e,e===m.store?v:t.getState()]))))),a.dispatchFromDevtools&&"function"==typeof a.dispatch){let e=!1;const t=a.dispatch;a.dispatch=(...n)=>{"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return p.subscribe((e=>{var t;switch(e.type){case"ACTION":return"string"!=typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):s(e.payload,(e=>{if("__setState"!==e.type)a.dispatchFromDevtools&&"function"==typeof a.dispatch&&a.dispatch(e);else{if(void 0===u)return void g(e.state);1!==Object.keys(e.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const t=e.state[u];if(null==t)return;JSON.stringify(a.getState())!==JSON.stringify(t)&&g(t)}}));case"DISPATCH":switch(e.payload.type){case"RESET":return g(v),void 0===u?null==p?void 0:p.init(a.getState()):null==p?void 0:p.init(o(d.name));case"COMMIT":return void 0===u?void(null==p||p.init(a.getState())):null==p?void 0:p.init(o(d.name));case"ROLLBACK":return s(e.state,(e=>{if(void 0===u)return g(e),void(null==p||p.init(a.getState()));g(e[u]),null==p||p.init(o(d.name))}));case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return s(e.state,(e=>{void 0!==u?JSON.stringify(a.getState())!==JSON.stringify(e[u])&&g(e[u]):g(e)}));case"IMPORT_STATE":{const{nextLiftedState:n}=e.payload,r=null==(t=n.computedStates.slice(-1)[0])?void 0:t.state;if(!r)return;return g(void 0===u?r:r[u]),void(null==p||p.send(null,n))}case"PAUSE_RECORDING":return f=!f}return}})),v},s=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){console.error("[zustand devtools middleware] Could not parse the received json",e)}void 0!==n&&t(n)};function a(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;const o=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),i=null!=(r=n.getItem(e))?r:null;return i instanceof Promise?i.then(o):o(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}const l=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>l(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>l(t)(e)}}},c=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const a=new Set,c=new Set;let u;try{u=i.getStorage()}catch(e){}if(!u)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)}),r,o);const d=l(i.serialize),h=()=>{const e=i.partialize({...r()});let t;const n=d({state:e,version:i.version}).then((e=>u.setItem(i.name,e))).catch((e=>{t=e}));if(t)throw t;return n},p=o.setState;o.setState=(e,t)=>{p(e,t),h()};const m=e(((...e)=>{n(...e),h()}),r,o);let f;const g=()=>{var e;if(!u)return;s=!1,a.forEach((e=>e(r())));const t=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,r()))||void 0;return l(u.getItem.bind(u))(i.name).then((e=>{if(e)return i.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return f=i.merge(e,null!=(t=r())?t:m),n(f,!0),h()})).then((()=>{null==t||t(f,void 0),s=!0,c.forEach((e=>e(f)))})).catch((e=>{null==t||t(void 0,e)}))};return o.persist={setOptions:e=>{i={...i,...e},e.getStorage&&(u=e.getStorage())},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>s,onHydrate:e=>(a.add(e),()=>{a.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},g(),f||m})(e,t)):((e,t)=>(n,r,o)=>{let i={storage:a((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const c=new Set,u=new Set;let d=i.storage;if(!d)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)}),r,o);const h=()=>{const e=i.partialize({...r()});return d.setItem(i.name,{state:e,version:i.version})},p=o.setState;o.setState=(e,t)=>{p(e,t),h()};const m=e(((...e)=>{n(...e),h()}),r,o);let f;o.getInitialState=()=>m;const g=()=>{var e,t;if(!d)return;s=!1,c.forEach((e=>{var t;return e(null!=(t=r())?t:m)}));const o=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=r())?e:m))||void 0;return l(d.getItem.bind(d))(i.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return[!1,e.state];if(i.migrate)return[!0,i.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]})).then((e=>{var t;const[o,s]=e;if(f=i.merge(s,null!=(t=r())?t:m),n(f,!0),o)return h()})).then((()=>{null==o||o(f,void 0),f=r(),s=!0,u.forEach((e=>e(f)))})).catch((e=>{null==o||o(void 0,e)}))};return o.persist={setOptions:e=>{i={...i,...e},e.storage&&(d=e.storage)},clearStorage:()=>{null==d||d.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>s,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},i.skipHydration||g(),f||m})(e,t)}},e=>{e(e.s=5018)}]);