PageSourceSearch

https://corporate.uktv.co.uk/_next/static/chunks/394.598bf2aec02a6b1a.js

js uktv.co.uk collected 2026-10-02 02:20:46 UTC 334,385 bytes, 194 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[394],{953:(e,t,n)=>{"use strict";n.d(t,{tb:()=>W});var r,i,o=[],s="ResizeObserver loop completed with undelivered notifications.",a=function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:s}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=s),window.dispatchEvent(e)};!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(r||(r={}));var l=function(e){return Object.freeze(e)},u=function(e,t){this.inlineSize=e,this.blockSize=t,l(this)},c=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,l(this)}return e.prototype.toJSON=function(){return{x:this.x,y:this.y,top:this.top,right:this.right,bottom:this.bottom,left:this.left,width:this.width,height:this.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),d=function(e){return e instanceof SVGElement&&"getBBox"in e},h=function(e){if(d(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e.offsetWidth,o=e.offsetHeight;return!(i||o||e.getClientRects().length)},f=function(e){if(e instanceof Element)return!0;var t,n=null==(t=null==e?void 0:e.ownerDocument)?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},p=function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},m="undefined"!=typeof window?window:{},g=new WeakMap,y=/auto|scroll/,v=/^tb|vertical/,b=/msie|trident/i.test(m.navigator&&m.navigator.userAgent),x=function(e){return parseFloat(e||"0")},w=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new u((n?t:e)||0,(n?e:t)||0)},k=l({devicePixelContentBoxSize:w(),borderBoxSize:w(),contentBoxSize:w(),contentRect:new c(0,0,0,0)}),S=function(e,t){if(void 0===t&&(t=!1),g.has(e)&&!t)return g.get(e);if(h(e))return g.set(e,k),k;var n=getComputedStyle(e),r=d(e)&&e.ownerSVGElement&&e.getBBox(),i=!b&&"border-box"===n.boxSizing,o=v.test(n.writingMode||""),s=!r&&y.test(n.overflowY||""),a=!r&&y.test(n.overflowX||""),u=r?0:x(n.paddingTop),f=r?0:x(n.paddingRight),p=r?0:x(n.paddingBottom),m=r?0:x(n.paddingLeft),S=r?0:x(n.borderTopWidth),E=r?0:x(n.borderRightWidth),T=r?0:x(n.borderBottomWidth),j=r?0:x(n.borderLeftWidth),A=m+f,M=u+p,_=j+E,P=S+T,C=a?e.offsetHeight-P-e.clientHeight:0,I=s?e.offsetWidth-_-e.clientWidth:0,O=r?r.width:x(n.width)-(i?A+_:0)-I,R=r?r.height:x(n.height)-(i?M+P:0)-C,V=O+A+I+_,L=R+M+C+P,D=l({devicePixelContentBoxSize:w(Math.round(O*devicePixelRatio),Math.round(R*devicePixelRatio),o),borderBoxSize:w(V,L,o),contentBoxSize:w(O,R,o),contentRect:new c(m,u,O,R)});return g.set(e,D),D},E=function(e,t,n){var i=S(e,n),o=i.borderBoxSize,s=i.contentBoxSize,a=i.devicePixelContentBoxSize;switch(t){case r.DEVICE_PIXEL_CONTENT_BOX:return a;case r.BORDER_BOX:return o;default:return s}},T=function(e){var t=S(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=l([t.borderBoxSize]),this.contentBoxSize=l([t.contentBoxSize]),this.devicePixelContentBoxSize=l([t.devicePixelContentBoxSize])},j=function(e){if(h(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},A=function(){var e=1/0,t=[];o.forEach(function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach(function(t){var n=new T(t.target),i=j(t.target);r.push(n),t.lastReportedSize=E(t.target,t.observedBox),i<e&&(e=i)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0;n<t.length;n++)(0,t[n])();return e},M=function(e){o.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(j(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},_=function(){var e=0;for(M(0);o.some(function(e){return e.activeTargets.length>0});)M(e=A());return o.some(function(e){return e.skippedTargets.length>0})&&a(),e>0},P=[],C=function(e){if(!i){var t=0,n=document.createTextNode("");
1new MutationObserver(function(){return P.splice(0).forEach(function(e){return e()})}).observe(n,{characterData:!0}),i=function(){n.textContent="".concat(t?t--:t++)}}P.push(e),i()},I=function(e){C(function(){requestAnimationFrame(e)})},O=0,R={attributes:!0,characterData:!0,childList:!0,subtree:!0},V=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],L=function(e){return void 0===e&&(e=0),Date.now()+e},D=!1,$=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!D){D=!0;var n=L(e);I(function(){var r=!1;try{r=_()}finally{if(D=!1,e=n-L(),!O)return;r?t.run(1e3):e>0?t.run(e):t.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,R)};document.body?t():m.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),V.forEach(function(t){return m.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),V.forEach(function(t){return m.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}()),z=function(e){!O&&e>0&&$.start(),(O+=e)||$.stop()},F=function(){function e(e,t){this.target=e,this.observedBox=t||r.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=E(this.target,this.observedBox,!0);return d(e=this.target)||p(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),B=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},N=new WeakMap,U=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return -1},H=function(){function e(){}return e.connect=function(e,t){var n=new B(e,t);N.set(e,n)},e.observe=function(e,t,n){var r=N.get(e),i=0===r.observationTargets.length;0>U(r.observationTargets,t)&&(i&&o.push(r),r.observationTargets.push(new F(t,n&&n.box)),z(1),$.schedule())},e.unobserve=function(e,t){var n=N.get(e),r=U(n.observationTargets,t),i=1===n.observationTargets.length;r>=0&&(i&&o.splice(o.indexOf(n),1),n.observationTargets.splice(r,1),z(-1))},e.disconnect=function(e){var t=this,n=N.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),W=function(){function e(e){if(0==arguments.length)throw TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");H.connect(this,e)}return e.prototype.observe=function(e,t){if(0==arguments.length)throw TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!f(e))throw TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");H.observe(this,e,t)},e.prototype.unobserve=function(e){if(0==arguments.length)throw TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!f(e))throw TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");H.unobserve(this,e)},e.prototype.disconnect=function(){H.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}()},2274:(e,t,n)=>{"use strict";n.d(t,{E:()=>i});var r=n(55729);let i=n(89636).B?r.useLayoutEffect:r.useEffect},2603:(e,t,n)=>{var r=n(88165);e.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:r(e,t,n)}},3619:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},6797:(e,t,n)=>{e.exports=n(95486)("toUpperCase")},9819:e=>{var t=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}}
1,13574:(e,t,n)=>{var r=n(25080),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},14165:e=>{e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},16153:(e,t,n)=>{var r=n(25080),i=n(88601),o=n(91544),s=n(50515),a=1/0,l=r?r.prototype:void 0,u=l?l.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-a?"-0":n}},16878:(e,t,n)=>{"use strict";e.exports=n(29610)},18053:(e,t,n)=>{var r=n(49355),i=n(9819),o=n(90199);e.exports=function(e){return i(e)?o(e):r(e)}},18571:(e,t,n)=>{"use strict";n.d(t,{N:()=>y});var r=n(6029),i=n(55729),o=n(72369),s=n(66414),a=n(2274),l=n(67017),u=n(67908);class c extends i.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,n=e instanceof HTMLElement&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function d({children:e,isPresent:t,anchorX:n}){let o=(0,i.useId)(),s=(0,i.useRef)(null),a=(0,i.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=(0,i.useContext)(u.Q);return(0,i.useInsertionEffect)(()=>{let{width:e,height:r,top:i,left:u,right:c}=a.current;if(t||!s.current||!e||!r)return;let d="left"===n?`left: ${u}`:`right: ${c}`;s.current.dataset.motionPopId=o;let h=document.createElement("style");return l&&(h.nonce=l),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
2          [data-motion-pop-id="${o}"] {
3            position: absolute !important;
4            width: ${e}px !important;
5            height: ${r}px !important;
6            ${d}px !important;
7            top: ${i}px !important;
8          }
9        `),()=>{document.head.removeChild(h)}},[t]),(0,r.jsx)(c,{isPresent:t,childRef:s,sizeRef:a,children:i.cloneElement(e,{ref:s})})}let h=({children:e,initial:t,isPresent:n,onExitComplete:o,custom:a,presenceAffectsLayout:u,mode:c,anchorX:h})=>{let p=(0,s.M)(f),m=(0,i.useId)(),g=!0,y=(0,i.useMemo)(()=>(g=!1,{id:m,initial:t,isPresent:n,custom:a,onExitComplete:e=>{for(let t of(p.set(e,!0),p.values()))if(!t)return;o&&o()},register:e=>(p.set(e,!1),()=>p.delete(e))}),[n,p,o]);return u&&g&&(y={...y}),(0,i.useMemo)(()=>{p.forEach((e,t)=>p.set(t,!1))},[n]),i.useEffect(()=>{n||p.size||!o||o()},[n]),"popLayout"===c&&(e=(0,r.jsx)(d,{isPresent:n,anchorX:h,children:e})),(0,r.jsx)(l.t.Provider,{value:y,children:e})};function f(){return new Map}var p=n(39622);let m=e=>e.key||"";function g(e){let t=[];return i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&t.push(e)}),t}let y=({children:e,custom:t,initial:n=!0,onExitComplete:l,presenceAffectsLayout:u=!0,mode:c="sync",propagate:d=!1,anchorX:f="left"})=>{let[y,v]=(0,p.xQ)(d),b=(0,i.useMemo)(()=>g(e),[e]),x=d&&!y?[]:b.map(m),w=(0,i.useRef)(!0),k=(0,i.useRef)(b),S=(0,s.M)(()=>new Map),[E,T]=(0,i.useState)(b),[j,A]=(0,i.useState)(b);(0,a.E)(()=>{w.current=!1,k.current=b;for(let e=0;e<j.length;e++){let t=m(j[e]);x.includes(t)?S.delete(t):!0!==S.get(t)&&S.set(t,!1)}},[j,x.length,x.join("-")]);let M=[];if(b!==E){let e=[...b];for(let t=0;t<j.length;t++){let n=j[t],r=m(n);x.includes(r)||(e.splice(t,0,n),M.push(n))}return"wait"===c&&M.length&&(e=M),A(g(e)),T(b),null}let{forceRender:_}=(0,i.useContext)(o.L);return(0,r.jsx)(r.Fragment,{children:j.map(e=>{let i=m(e),o=(!d||!!y)&&(b===j||x.includes(i));return(0,r.jsx)(h,{isPresent:o,initial:(!w.current||!!n)&&void 0,custom:t,presenceAffectsLayout:u,mode:c,onExitComplete:o?void 0:()=>{if(!S.has(i))return;S.set(i,!0);let e=!0;S.forEach(t=>{t||(e=!1)}),e&&(_?.(),A(k.current),d&&v?.(),l&&l())},anchorX:f,children:e},i)})})}},19508:e=>{var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},21985:(e,t,n)=>{var r=n(22546),i=n(60567),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
97f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(s,"")}},22546:(e,t,n)=>{e.exports=n(14165)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"})},23079:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},25080:(e,t,n)=>{e.exports=n(45516).Symbol},28288:(e,t,n)=>{"use strict";let r;n.r(t),n.d(t,{renderVisualEditing:()=>am});var i,o,s,a,l,u=n(6029),c=n(55729),d=n(89315),h=n(3213),f=n(33976),p=n(56760);let m=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,g=/_key\s*==\s*['"](.*)['"]/,y=/^\d*:\d*$/;function v(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function b(e){return"string"==typeof e?g.test(e.trim()):"object"==typeof e&&"_key"in e}function x(e){if("string"==typeof e&&y.test(e))return!0;if(!Array.isArray(e)||2!==e.length)return!1;let[t,n]=e;return("number"==typeof t||""===t)&&("number"==typeof n||""===n)}function w(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,n)=>{let r=typeof t;if("number"===r)return`${e}[${t}]`;if("string"===r)return`${e}${0===n?"":"."}${t}`;if(b(t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[n,r]=t;return`${e}[${n}:${r}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}function k(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(m);if(!t)throw Error("Invalid path string");return t.map(S)}function S(e){return v(e)?Number(e.replace(/[^\d]/g,"")):b(e)?{_key:e.match(g)[1]}:x(e)?function(e){let[t,n]=e.split(":").map(e=>""===e?e:Number(e));return[t,n]}(e):e}var E=Object.freeze({__proto__:null,fromString:k,get:function(e,t,n){let r="string"==typeof t?k(t):t;if(!Array.isArray(r))throw Error("Path must be an array or a string");let i=e;for(let e=0;e<r.length;e++){let t=r[e];if(v(t)){if(!Array.isArray(i))return n;i=i[t]}if(b(t)){if(!Array.isArray(i))return n;i=i.find(e=>e._key===t._key)}if("string"==typeof t&&(i="object"==typeof i&&null!==i?i[t]:void 0),typeof i>"u")return n}return i},isIndexSegment:v,isIndexTuple:x,isKeySegment:b,reKeySegment:g,toString:w});let T="drafts.";function j(e){return e.startsWith(T)}function A(e){return e.startsWith("versions.")}function M(e){return A(e)?T+_(e):j(e)?e:T+e}function _(e){return A(e)?e.split(".").slice(2).join("."):j(e)?e.slice(T.length):e}var P=n(33220),C=n(94145);function I(e){return e.split(/[[.\]]/g).filter(Boolean).map(e=>{var t;return e.includes("==")?function(e){let[t,n]=e.split("==");if("_key"!==t)throw Error(`Currently only "_key" is supported as path segment. Found ${t}`);if(typeof n>"u")throw Error('Invalid path segment, expected `key=="value"`');return{_key:n.replace(/^['"]/,"").replace(/['"]$/,"")}}(e):O.test(t=e)?Number(t):t})}let O=/^-?\d+$/,R=/^[a-z_$]+/;function V(e){return e.map((e,t)=>{var n;return n=0===t,Array.isArray(e)?`[${e[0]}:${e[1]||""}]`:"number"==typeof e?`[${e}
9]`:"object"==typeof e&&"_key"in e&&"string"==typeof e._key?`[_key==${JSON.stringify(e._key)}]`:"string"==typeof e&&R.test(e)?n?e:`.${e}`:`['${e}']`}).join("")}function L(e){if("createIfNotExists"in e)return{type:"createIfNotExists",document:e.createIfNotExists};if("createOrReplace"in e)return{type:"createOrReplace",document:e.createOrReplace};if("create"in e)return{type:"create",document:e.create};if("delete"in e)return{id:e.delete.id,type:"delete"};if("patch"in e){var t,n,r,i,o,s;return{type:"patch",id:e.patch.id,patches:[..."set"in(n=t=e.patch)?Object.keys(n.set).map(e=>({path:I(e),op:{type:"set",value:n.set[e]}})):[],..."setIfMissing"in(r=t)?Object.keys(r.setIfMissing).map(e=>({path:I(e),op:{type:"setIfMissing",value:r.setIfMissing[e]}})):[],..."unset"in(i=t)?i.unset.map(e=>({path:I(e),op:{type:"unset"}})):[],..."inc"in(o=t)?Object.keys(o.inc).map(e=>({path:I(e),op:{type:"inc",amount:o.inc[e]}})):[],..."inc"in(s=t)?Object.keys(s.dec).map(e=>({path:I(e),op:{type:"dec",amount:s.dec[e]}})):[],...function(e){if(!("insert"in e))return[];let t=function(e){let t=D.filter(t=>t in e);if(t.length>1)throw Error(`Insert patch is ambiguous. Should only contain one of: ${D.join(", ")}, instead found ${t.join(", ")}`);return t[0]}(e.insert);if(!t)throw Error("Insert patch missing position");let n=I(e.insert[t]),r=n.pop();return[{path:n,op:{type:"insert",position:t,referenceItem:r,items:e.insert.items}}]}(t)]}}throw Error(`Unknown mutation: ${JSON.stringify(e)}`)}let D=["before","replace","after"];function $(e){return F(e)}function z(e){return e.flatMap($)}function F(e){if("create"===e.type||"createIfNotExists"===e.type||"createOrReplace"===e.type)return{[e.type]:e.document};if("delete"===e.type)return{delete:{id:e.id}};let t=e.options?.ifRevision;return e.patches.map(n=>({patch:{id:e.id,...t&&{ifRevisionID:t},...function(e){let{path:t,op:n}=e;if("unset"===n.type)return{unset:[V(t)]};if("insert"===n.type)return{insert:{[n.position]:V([...t,n.referenceItem]),items:n.items}};if("diffMatchPatch"===n.type)return{diffMatchPatch:{[V(t)]:n.value}};if("inc"===n.type)return{inc:{[V(t)]:n.amount}};if("dec"===n.type)return{dec:{[V(t)]:n.amount}};if("set"===n.type||"setIfMissing"===n.type)return{[n.type]:{[V(t)]:n.value}};if("truncate"===n.type){let e=[n.startIndex,"number"==typeof n.endIndex?n.endIndex:""].join(":");return{unset:[`${V(t)}[${e}]`]}}if("upsert"===n.type)return{unset:n.items.map(e=>V([...t,{_key:e._key}])),insert:{[n.position]:V([...t,n.referenceItem]),items:n.items}};if("assign"===n.type)return{set:Object.fromEntries(Object.keys(n.value).map(e=>[V(t.concat(e)),n.value[e]]))};if("unassign"===n.type)return{unset:n.keys.map(e=>V(t.concat(e)))};if("replace"===n.type)return{insert:{replace:V(t.concat(n.referenceItem)),items:n.items}};if("remove"===n.type)return{unset:[V(t.concat(n.referenceItem))]};throw Error(`Unknown operation type ${n.type}`)}(n)}}))}function B(e){return Array.isArray(e)?e:[e]}var N=Object.freeze({__proto__:null,decode:function(e){return L(e)},decodeAll:function(e){return e.map(L)},encode:$,encodeAll:z,encodeMutation:F,encodeTransaction:function(e){return{transactionId:e.id,mutations:z(e.mutations)}}});function U(e,t,n){return{type:"insert",referenceItem:n,position:t,items:B(e)}}function H(e,t){return{type:"truncate",startIndex:e,endIndex:t}}function W(e){return{type:"remove",referenceItem:e}}function Y(e,t){return{path:"string"==typeof e?I(e):e,op:t}}var q=n(63286);let G=(0,q.H6)(),X=G,K=new Set,Z=/_key\s*==\s*['"](.*)['"]/,J=/^\d*:\d*$/;function Q(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function ee(e){return"string"==typeof e?Z.test(e.trim()):"object"==typeof e&&"_key"in e}let et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,en=/_key\s*==\s*['"](.*)['"]/;function er(e,t,n){let r="string"==typeof t?function(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(et);if(!t)throw Error("Invalid path string");return t.map(ei)}(t):t;if(!Array.isArray(r))throw Error("Path must be an array or a string");let i=e;for(let e=0;e<r.length;e++){let t=r[e];if(Q(t)){if(!Array.isArray(i))return n;i=i[t]}if(ee(t)){if(!Array.isArray(i))return n;i=i.find(e=>e._key===t._key)}if("string"==typeof t&&(i="object"==typeof i&&null!==i?i[t]:void 0),typeof i>"u")return n}return i}function ei(e){return Q(e)?Number(e.replace(/[^\d]/g,"")):ee(e)?{_key:e.match(en)[1]}:!function(e){if("string"==typeof e&&J.test(e))return!0;
9if(!Array.isArray(e)||2!==e.length)return!1;let[t,n]=e;return("number"==typeof t||""===t)&&("number"==typeof n||""===n)}(e)?e:function(e){let[t,n]=e.split(":").map(e=>""===e?e:Number(e));return[t,n]}(e)}function eo(){return(0,c.useSyncExternalStore)(el,ea,es)}function es(){return G}function ea(){return X}function el(e){return K.add(e),()=>K.delete(e)}function eu(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(e,r)},t)}}function ec(e,t){let n=(0,f.Fk)(),r=(0,f.v$)();if(t===G||!n&&!r)throw Error("The `useDocuments` hook cannot be used in this context");let i=M(e),o=_(e),s=t.getSnapshot().context?.documents,a=s?.[i],l=s?.[o],u=a||l;if(!u)throw Error(`Document "${e}" not found`);let c=a.getSnapshot().context?.local||l.getSnapshot().context?.local,d=new Promise(e=>{if(c)e(c);else{let t=u.on("ready",n=>{let{snapshot:r}=n;e(r||null),t.unsubscribe()})}});return{draftDoc:a,draftId:i,getSnapshot:()=>d,publishedDoc:l,publishedId:o,get snapshot(){if(!c)throw Error(`Snapshot for document "${e}" not found`);return c}}}function ed(){let e,t,n,r=(0,h.c)(7),i=eo();r[0]!==i?(e=e=>({id:e,commit:()=>{let{draftDoc:t}=ec(e,i);t.send({type:"submit"})},get:t=>{let{snapshot:n}=ec(e,i);return t?er(n,t):n},getSnapshot:function(e,t){let{getSnapshot:n}=ec(e,t);return n}(e,i),patch:async(t,n)=>{let r=ec(e,i),{draftDoc:o,draftId:s,getSnapshot:a,publishedId:l}=r,{commit:u=!0}=n||{},c=await ("function"==typeof t?t({draftId:s,publishedId:l,get snapshot(){return r.snapshot},getSnapshot:a}):t),d=await a();if(!d)throw Error(`Snapshot for document "${e}" not found`);o.send({type:"mutate",mutations:[{type:"createIfNotExists",document:{...d,_id:s}},{type:"patch",id:s,patches:B(c),...{}}]}),u&&("object"==typeof u&&"debounce"in u?eu(()=>o.send({type:"submit"}),u.debounce)():o.send({type:"submit"}))}}),r[0]=i,r[1]=e):e=r[1];let o=e;r[2]!==i?(t=(e,t,n)=>{let{draftDoc:r}=ec(e,i),{commit:o}=n||{},s=void 0===o||o;r.send({type:"mutate",mutations:t}),s&&("object"==typeof s&&"debounce"in s?eu(()=>r.send({type:"submit"}),s.debounce)():r.send({type:"submit"}))},r[2]=i,r[3]=t):t=r[3];let s=t;return r[4]!==o||r[5]!==s?(n={getDocument:o,mutateDocument:s},r[4]=o,r[5]=s,r[6]=n):n=r[6],n}let eh=(()=>{let e;return()=>{if(e)return e;e=[];for(let t=0;t<256;++t)e[t]=(t+256).toString(16).slice(1);return e}})();function ef(e){let t=eh();return(function(e=16){let t=new Uint8Array(e);return function(e){let t="undefined"!=typeof window&&"crypto"in window?window.crypto:globalThis.crypto;if(!t||!t.getRandomValues)throw Error("WebCrypto not available in this environment");t.getRandomValues(e)}(t),t})(e).reduce((e,n)=>e+t[n],"").slice(0,e)}function ep(e){let t,n,r="string"==typeof e?e:e.path,i=r.lastIndexOf("."),o=r.substring(i+1,r.length);if(!o.indexOf("["))throw Error("Invalid path: not an array");let s=r.lastIndexOf("["),a=r.substring(0,s);if(o.includes("_key")){let e=o.indexOf('"')+1,r=o.indexOf('"',e);t=o.substring(e,r),n=!0}else{let e=o.indexOf("[")+1,r=o.indexOf("]",e);t=o.substring(e,r),n=!1}if(!a||!t)throw Error("Invalid path");return{path:a,key:t,hasExplicitKey:n}}async function em(e,t,n){if(!e.type)throw Error("Node type is missing");let{path:r,key:i}=ep(e),o=await t.getSnapshot(),s=er(o,r),a=er(o,e.path),l=s.findIndex(e=>e._key===i),u=-1,c="before";if("first"===n){if(0===l)return[];u=0,c="before"}else if("last"===n){if(l===s.length-1)return[];u=-1,c="after"}else if("next"===n){if(l===s.length-1)return[];u=l,c="after"}else if("previous"===n){if(0===l)return[];u=l-1,c="before"}return[Y(r,H(l,l+1)),Y(r,U(a,c,u))]}var eg=n(41824);let ey=(0,eg.FsL)((0,eg.YjP)(),(0,eg.BpQ)(1)),ev=(0,eg.lqM)(ey),eb=(0,eg.Ikc)({baseUrl:ey,dataset:ev,id:ey,path:ey,projectId:ev,tool:ev,type:ev,workspace:ev}),ex=/^([\w-]+):(0|[1-9][0-9]*)$/,ew=/^([\w-]+):([0-9]+),([0-9]+)$/,ek=/^([\w-]+):([\w-]+)$/,eS=(0,eg.FsL)((0,eg.YjP)(),(0,eg.BpQ)(1)),eE=(0,eg.Ikc)({origin:eS,href:eS,data:(0,eg.lqM)((0,eg.g1P)((0,eg.YjP)(),(0,eg.L5J)()))});function eT(e){let t=(0,eg.xLC)(eb,e);if(t.success)return t.output;let n=(0,eg.xLC)(eE,e);if(n.success)try{let e=new URL(n.output.href,typeof document>"u"?"https://example.com":location.origin);return e.searchParams.size>
90?(0,eg.qgA)(eb,Object.fromEntries(e.searchParams.entries())):n.output}catch(e){return console.error("Failed to parse sanity node",e),n.output}}var ej={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},eA={0:8203,1:8204,2:8205,3:65279},eM=[,,,,].fill(String.fromCodePoint(eA[0])).join(""),e_=Object.fromEntries(Object.entries(eA).map(e=>e.reverse())),eP=Object.fromEntries(Object.entries(ej).map(e=>e.reverse())),eC=`${Object.values(ej).map(e=>`\\u{${e.toString(16)}}`).join("")}`,eI=RegExp(`[${eC}]{4,}`,"gu");let eO=[];for(let e=0;e<256;++e)eO.push((e+256).toString(16).slice(1));let eR=new Uint8Array(16);var eV={randomUUID:"u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eL(e){let t=e.getBoundingClientRect();return{x:t.x+scrollX,y:t.y+scrollY,w:t.width,h:t.height}}function eD(e,t,n){return"x"===n?{x:e.x+t,y:e.y,w:e.w-2*t,h:e.h}:{x:e.x,y:e.y+t,w:e.w,h:e.h-2*t}}function e$(e,t){return e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h}function ez(e,t){let n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function eF(e,t,n){let r,i,o={x:e.x1,y:e.y1};if(t.some(e=>(function(e,t){let n=e.x>=t.x&&e.x<=t.x+t.w,r=e.y>=t.y&&e.y<=t.y+t.h;return n&&r})(o,eD(e,Math.min(e.w,e.h)/10,"horizontal"===n?"x":"y"))))return null;for(let s of t){let t=function(e,t){let n=[{x1:t.x,y1:t.y,x2:t.x+t.w,y2:t.y},{x1:t.x+t.w,y1:t.y,x2:t.x+t.w,y2:t.y+t.h},{x1:t.x+t.w,y1:t.y+t.h,x2:t.x,y2:t.y+t.h},{x1:t.x,y1:t.y+t.h,x2:t.x,y2:t.y}],r=[];for(let t=0;t<n.length;t++){let i=function(e,t){let{x1:n,y1:r,x2:i,y2:o}=e,{x1:s,y1:a,x2:l,y2:u}=t;if(n===i&&r===o||s===l&&a===u)return!1;let c=(u-a)*(i-n)-(l-s)*(o-r);if(0===c)return!1;let d=((l-s)*(r-a)-(u-a)*(n-s))/c,h=((i-n)*(r-a)-(o-r)*(n-s))/c;return!(d<0)&&!(d>1)&&!(h<0)&&!(h>1)&&{x:n+d*(i-n),y:r+d*(o-r)}}(e,n[t]);if(i){let e=!1;for(let t=0;t<r.length;t++)r[t].x===i.x&&r[t].y===i.y&&(e=!0);e||r.push(i)}}return 0!==r.length&&r.sort((t,n)=>ez(t,{x:e.x1,y:e.y1})-ez(n,{x:e.x1,y:e.y1}))}(e,eD(s,Math.min(s.w,s.h)/10,"horizontal"===n?"x":"y"));if(t){let e=t[0];r?ez(o,e)<ez(o,r)&&(r=e,i=s):(r=e,i=s)}}return i||null}function eB(e,t,n){let{x:r,y:i,w:o,h:s}=e,{x:a,y:l}=n;return{x:a+(r-a)*t,y:l+(i-l)*t,w:o*t,h:s*t}}function eN(e){let t=Math.max(0,Math.min(...e.map(e=>e.y))),n=Math.min(document.body.scrollHeight,Math.max(...e.map(e=>e.y+e.h)));return{min:t,max:n,height:n-t}}function eU(e,t){return t.find(t=>e$(eL(t.elements.element),e))?.sanity}function eH(e,t,n){return Object.values(t).every(e=>null===e)?null:"horizontal"===n?{left:t.left?{rect:t.left,sanity:eU(t.left,e)}:null,right:t.right?{rect:t.right,sanity:eU(t.right,e)}:null}:{top:t.top?{rect:t.top,sanity:eU(t.top,e)}:null,bottom:t.bottom?{rect:t.bottom,sanity:eU(t.bottom,e)}:null}}function eW(e){let t=document.body.getBoundingClientRect();return{x:Math.max(t.x,Math.min(e.clientX,t.x+t.width)),y:e.clientY+window.scrollY}}function eY(e,t,n){let r=eL(t),i=[...t.querySelectorAll(":where(h1, h2, h3, h4, p, a, img, span, button):not(:has(*))")];e.x<=r.x&&(e.x=r.x),e.x>=r.x+r.w&&(e.x=r.x+r.w),e.y>=r.y+r.h&&(e.y=r.y+r.h),e.y<=r.y&&(e.y=r.y);let o=i.map(e=>{let t=eB(eL(e),n,{x:r.x,y:r.y});return{x:t.x-r.x,y:t.y-r.y,w:t.w,h:t.h,tagName:e.tagName}});return{offsetX:(r.x-e.x)*n,offsetY:(r.y-e.y)*n,w:r.w*n,h:r.h*n,maxWidth:r.w*n*.75,childRects:o}}async function eq(e,t,n,r,i){return new Promise(o=>{e.addEventListener("transitionend",()=>{setTimeout(()=>{r({type:"overlay/dragEndMinimapTransition"})},2*i),o()},{once:!0}),r({type:"overlay/dragStartMinimapTransition"}),r({type:"overlay/dragToggleMinimap",display:!0}),document.body.style.overflow="hidden",document.body.style.height="100%",document.documentElement.style.overflow="initial",document.documentElement.style.height="100%",setTimeout(()=>{e.style.transformOrigin="50% 0px",e.style.transition="transform 150ms ease",e.style.transform=`translate3d(0px, ${-n+scrollY}px, 0px) scale(${t})`},25)})}function eG(e){let t=function(e){let t=Math.max(0,Math.min(...e.map(e=>e.x))),n=Math.min(document.body.offsetWidth,Math.max(...e.map(e=>e.x+e.w)));return{min:t,max:n,width:n-t}}(e),n=eN(e),r=t.min>8&&t.min+t.width<=window.innerWidth-8,i=n.min>8&&n.min+n.height<=document.body.scrollHeight-8,o=r&&i;return{x:o?t.min-8:t.min,y:o?n.min-8:n.min,w:o?t.width+16:t.width,h:o?n.height+16:n.height}}async function eX(e,t,n,r,i,o){return new Promise(s=>{if(1===new DOMMatrix(window.getComputedStyle(t).transform).a)return;let a=n-window.innerHeight,l=scrollY;(e-=window.innerHeight/2)<0&&(e=0),t.addEventListener("transitionend",()=>{t.style.transition="none",t.style.transform="none",scrollTo({top:e,behavior:"instant"}),setTimeout(()=>{r({type:"overlay/dragEndMinimapTransition"}),r({type:"overlay/dragToggleMinimap",display:!1})},2*i),s()},{once:!0}),r({type:"overlay/dragStartMinimapTransition"}),t.style.transform=`translateY(${Math.max(l-e,-a+l)}px) scale(1)`,o&&(document.body.style.overflow=o.body.overflow,document.body.style.height=o.body.height,document.documentElement.style.overflow=o.documentElement.overflow,document.documentElement.style.height=o.documentElement.height)})}let eK=!1,eZ={y:0},eJ={x:0,y:0},eQ=typeof document>"u"?0:document.documentElement.scrollHeight,e0=null,e1=e=>e instanceof HTMLElement||e instanceof SVGElement,e2=e=>e&&e1(e)?e.dataset?.sanityOverlayElement?e:e2(e.parentElement):null;function e5(e,t=!1){return(eI.lastIndex=0,eI.test(e))?function(e,t=!1){try{let n=function(e){let t=e.match(eI);if(t)return function(e,t=!1){let n=Array.from(e);if(n.length%2==0){if(n.length%4||!e.startsWith(eM))return function(e,t){var n;let r=[];for(let t=.5*e.length;t--;){let n=`${eP[e[2*t].codePointAt(0)]}${eP[e[2*t+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(n,16)))}let i=[],o=[r.join("")],s=10;for(;o.length;){let e=o.shift();try{if(i.push(JSON.parse(e)),t)break}catch(r){if(!s--)throw r;let t=+(null==(n=r.message.match(/\sposition\s(\d+)$/))?void 0:n[1]);if(!t)throw r;o.unshift(e.substring(0,t),e.substring(t))}}return i}(n,t)}
9else throw Error("Encoded data has invalid length");let r=[];for(let e=.25*n.length;e--;){let t=n.slice(4*e,4*e+4).map(e=>e_[e.codePointAt(0)]).join("");r.unshift(String.fromCharCode(parseInt(t,4)))}if(t){r.shift();let e=r.indexOf("\0");return -1===e&&(e=r.length),[JSON.parse(r.slice(0,e).join(""))]}return r.join("").split("\0").filter(Boolean).map(e=>JSON.parse(e))}(t[0],!0)[0]}(e);return n&&"sanity.io"===n.origin?(t&&(n.href=n.href?.replace(".alt","")),n):null}catch(t){return console.error("Failed to decode stega for string: ",e,"with the original error: ",t),null}}(e,t):null}let e3=e=>e.nodeType===Node.ELEMENT_NODE,e4=e=>"IMG"===e.tagName,e6=e=>"TIME"===e.tagName,e9=e=>"SVG"===e.tagName.toUpperCase();function e8(e){return"path"in e}function e7(e){let t=e.lastIndexOf(".");return e.substring(t,e.length).includes("[")}function te(e){if(!e7(e))return null;let t=e.split(".");return t[t.length-1]=t[t.length-1].replace(/\[.*?\]/g,"[]"),t.join(".")}function tt(e,t){return!!e7(e.path)&&!!e7(t.path)&&te(e.path)===te(t.path)}function tn(e,t,n,r){if(!e.getAttribute("data-sanity")||e.getAttribute("data-sanity-drag-disable")||!t||!e8(t)||!e7(t.path))return null;let i=e.getAttribute("data-sanity-drag-group"),o=[...n].reduce((e,n)=>{let o=r.get(n),s=n.getAttribute("data-sanity-drag-disable"),a=n.getAttribute("data-sanity-drag-group"),l=null!==n.getAttribute("data-sanity");return o&&!s&&e8(o.sanity)&&tt(t,o.sanity)&&(null===i||i===a)&&l&&e.push(o),e},[]);return o.length<=1?null:o}let tr=(0,c.createContext)(null);var ti=n(67566),to=n(34589),ts=n(16878);function ta(e){let t=function e(t){var n;return!!(n=t)&&("object"==typeof n||"function"==typeof n)&&("reference"===t.name||e(t.type))}(e)&&1===(e.to??[]).length?e.to[0].icon:void 0;return e.icon??e.type?.icon??t}function tl(e,t){return{query:"change query"===t.type?t.query:e.query,groups:"select group"===t.type?e.groups.map(e=>({...e,selected:t.name===e.name})):e.groups,views:"toggle view"===t.type?e.views.map(e=>({...e,selected:t.name===e.name})):e.views}}let tu="all-items",tc={gridTemplateColumns:"repeat(auto-fill, minmax(118px, 1fr))"};function td(e){let t,n,r,i,o,s,a,l,d,f,p,m,g,y,v,b,x=(0,h.c)(54),w=void 0===e.showIcons||e.showIcons,k=void 0===e.filter||"auto"===e.filter?e.schemaTypes.length>5:e.filter;x[0]!==e.groups||x[1]!==e.labels?(t=e.groups?[{name:tu,title:e.labels["insert-menu.filter.all-items"],selected:!0},...e.groups.map(tp)]:[],x[0]=e.groups,x[1]=e.labels,x[2]=t):t=x[2],x[3]!==e.views?(n=e.views??[{name:"list"}],x[3]=e.views,x[4]=n):n=x[4],x[5]!==n?(r=n.map(tf),x[5]=n,x[6]=r):r=x[6],x[7]!==t||x[8]!==r?(i={query:"",groups:t,views:r},x[7]=t,x[8]=r,x[9]=i):i=x[9];let[S,E]=(0,c.useReducer)(tl,i);if(x[10]!==e||x[11]!==k||x[12]!==w||x[13]!==S.groups||x[14]!==S.query||x[15]!==S.views){var T,j,A;let t,n,r,i=(T=e.schemaTypes,j=S.query,A=S.groups,T.filter(e=>(function(e,t){let n=t.find(e=>e.selected);return!n||n.name===tu||n.of?.includes(e.name)})(e,A)&&function(e,t){let n=t.trim().toLowerCase();return e.title?e.title?.toLowerCase().includes(n):e.name.includes(n)}(e,j))),c=S.views.find(th),h=k||S.views.length>1,y=S.groups&&S.groups.length>0,v=h||y;a=P.W1,g=0,s=P.so,f="column",p="fill",x[25]!==v?(t=v?{style:{borderBottom:"1px solid var(--card-border-color)"},paddingBottom:1}:{},x[25]=v,x[26]=t):t=x[26],x[27]!==e.labels||x[28]!==k||x[29]!==h||x[30]!==S.query||x[31]!==S.views?(n=h?(0,u.jsxs)(P.so,{flex:"none",align:"center",paddingTop:1,paddingX:1,gap:1,children:[k?(0,u.jsx)(P.az,{flex:1,children:(0,u.jsx)(P.ks,{autoFocus:!0,border:!1,fontSize:1,icon:ti.WIv,onChange:e=>{E({type:"change query",query:e.target.value})},placeholder:e.labels["insert-menu.search.placeholder"],value:S.query})}):null,S.views.length>1?(0,u.jsx)(P.az,{flex:"none",children:(0,u.jsx)(ty,{views:S.views,onToggle:e=>{E({type:"toggle view",name:e})},labels:e.labels})}):null]}
9):null,x[27]=e.labels,x[28]=k,x[29]=h,x[30]=S.query,x[31]=S.views,x[32]=n):n=x[32],x[33]!==y||x[34]!==S.groups?(r=y?(0,u.jsx)(P.az,{paddingTop:1,paddingX:1,children:(0,u.jsx)(P.wb,{space:1,children:S.groups.map(e=>(0,u.jsx)(P.oz,{id:`${e.name}-tab`,"aria-controls":`${e.name}-panel`,label:e.title??to(e.name),selected:e.selected,onClick:()=>{E({type:"select group",name:e.name})}},e.name))})}):null,x[33]=y,x[34]=S.groups,x[35]=r):r=x[35],x[36]!==t||x[37]!==n||x[38]!==r?(m=(0,u.jsxs)(P.az,{...t,children:[n,r]}),x[36]=t,x[37]=n,x[38]=r,x[39]=m):m=x[39],o=P.az,l=1,d=0===i.length?(0,u.jsx)(P.az,{padding:2,children:(0,u.jsx)(P.EY,{muted:!0,size:1,children:e.labels["insert-menu.search.no-results"]})}):c?"grid"===c.name?(0,u.jsx)(P.xA,{autoRows:"auto",flex:1,gap:1,style:tc,children:i.map(t=>(0,u.jsx)(tb,{icon:w?ta(t):void 0,onClick:()=>{e.onSelect(t)},previewImageUrl:c.previewImageUrl?.(t.name),schemaType:t},t.name))}):(0,u.jsx)(P.BJ,{flex:1,space:1,children:i.map(t=>(0,u.jsx)(P.Dr,{icon:w?ta(t):void 0,onClick:()=>{e.onSelect(t)},text:t.title??to(t.name)},t.name))}):null,x[10]=e,x[11]=k,x[12]=w,x[13]=S.groups,x[14]=S.query,x[15]=S.views,x[16]=o,x[17]=s,x[18]=a,x[19]=l,x[20]=d,x[21]=f,x[22]=p,x[23]=m,x[24]=g}else o=x[16],s=x[17],a=x[18],l=x[19],d=x[20],f=x[21],p=x[22],m=x[23],g=x[24];return x[40]!==o||x[41]!==l||x[42]!==d?(y=(0,u.jsx)(o,{padding:l,children:d}),x[40]=o,x[41]=l,x[42]=d,x[43]=y):y=x[43],x[44]!==s||x[45]!==y||x[46]!==f||x[47]!==p||x[48]!==m?(v=(0,u.jsxs)(s,{direction:f,height:p,children:[m,y]}),x[44]=s,x[45]=y,x[46]=f,x[47]=p,x[48]=m,x[49]=v):v=x[49],x[50]!==a||x[51]!==v||x[52]!==g?(b=(0,u.jsx)(a,{padding:g,children:v}),x[50]=a,x[51]=v,x[52]=g,x[53]=b):b=x[53],b}function th(e){return e.selected}function tf(e,t){return{...e,selected:0===t}}function tp(e){return{...e,selected:!1}}let tm={grid:ti.jxC,list:ti.r$9},tg={grid:"insert-menu.toggle-grid-view.tooltip",list:"insert-menu.toggle-list-view.tooltip"};function ty(e){let t,n,r,i,o=(0,h.c)(11),s=e.views.findIndex(tv),a=e.views[s+1]??e.views[0],l=e.labels[tg[a.name]];o[0]!==l?(t=(0,u.jsx)(P.EY,{size:1,children:l}),o[0]=l,o[1]=t):t=o[1];let c=tm[a.name];return o[2]!==a.name||o[3]!==e?(n=()=>{e.onToggle(a.name)},o[2]=a.name,o[3]=e,o[4]=n):n=o[4],o[5]!==c||o[6]!==n?(r=(0,u.jsx)(P.$n,{mode:"bleed",icon:c,onClick:n}),o[5]=c,o[6]=n,o[7]=r):r=o[7],o[8]!==t||o[9]!==r?(i=(0,u.jsx)(P.m_,{content:t,placement:"top",portal:!0,children:r}),o[8]=t,o[9]=r,o[10]=i):i=o[10],i}function tv(e){return e.selected}function tb(e){let t,n,r,i,o,s,a,l,d,f=(0,h.c)(19),[p,m]=(0,c.useState)(!1),g=e.icon;f[0]===Symbol.for("react.memo_cache_sentinel")?(t={overflow:"hidden"},f[0]=t):t=f[0],f[1]===Symbol.for("react.memo_cache_sentinel")?(n={backgroundColor:"var(--card-muted-bg-color)",paddingBottom:"66.6%",position:"relative"},f[1]=n):n=f[1],f[2]!==g?(r=(0,ts.isValidElementType)(g)?(0,u.jsx)(P.so,{align:"center",justify:"center",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:(0,u.jsx)(P.EY,{size:1,children:(0,u.jsx)(g,{})})}):null,f[2]=g,f[3]=r):r=f[3],f[4]!==p||f[5]!==e.previewImageUrl?(i=!e.previewImageUrl||p?null:(0,u.jsx)("img",{src:e.previewImageUrl,style:{objectFit:"contain",width:"100%",height:"100%",position:"absolute",inset:0},onError:()=>{m(!0)}}),f[4]=p,f[5]=e.previewImageUrl,f[6]=i):i=f[6],f[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,u.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",boxShadow:"inset 0 0 0 0.5px var(--card-fg-color)",opacity:.1}}),f[7]=o):o=f[7],f[8]!==r||f[9]!==i?(s=(0,u.jsxs)(P.az,{flex:"none",style:n,children:[r,i,o]}),f[8]=r,f[9]=i,f[10]=s):s=f[10];let y=e.schemaType.title??e.schemaType.name;return f[11]!==y?(a=(0,u.jsx)(P.az,{flex:1,padding:2,children:(0,u.jsx)(P.EY,{size:1,weight:"medium",children:y})}),f[11]=y,f[12]=a):a=f[12],f[13]!==s||f[14]!==a?(l=(0,u.jsxs)(P.so,{direction:"column",gap:1,padding:1,children:[s,a]}),f[13]=s,f[14]=a,f[15]=l):l=f[15],f[16]!==e.onClick||f[17]!==l?(d=(0,u.jsx)(P.Dr,{padding:0,radius:2,onClick:e.onClick,style:t,children:l}),f[16]=e.onClick,f[17]=l,f[18]=d):d=f[18],d}function tx(e){if(!e)return(0,u.jsx)(ti.XRf,{});if("string"===e.type)return(0,u.jsx)(ti.H3M,{});if("number"===e.type)return(0,u.jsx)(ti.bZn,{});let{value:t}=e;
9if("icon"in e&&e.icon)return(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:e.icon}});let{type:n}=t;if("string"===n)return(0,u.jsx)(ti.H3M,{});if("boolean"===n)return(0,u.jsx)(ti.Dee,{});if("number"===n)return(0,u.jsx)(ti.bZn,{});if("array"===n||"union"===n)return(Array.isArray(t.of)?t.of:[t.of]).some(e=>"name"in e&&"block"===e.name)?(0,u.jsx)(ti.a1,{}):(0,u.jsx)(ti.Ss4,{});if("object"===n){if("image"===e.name)return(0,u.jsx)(ti.xfq,{});if("block"===e.name)return(0,u.jsx)(ti.H3M,{})}return(0,u.jsx)(ti.XRf,{})}let tw=C.I4.div`
10  height: 100%;
11  inset: 0;
12  overflow-y: scroll;
13  overscroll-behavior: contain;
14  pointer-events: all;
15  position: fixed;
16  width: 100%;
17  -ms-overflow-style: none;
18  scrollbar-width: none;
19  display: flex;
20  justify-content: center;
21  align-items: center;
22  &:before {
23    content: '';
24    display: block;
25    height: calc(100% + 1px);
26    position: absolute;
27    top: 0;
28    width: 100%;
29    z-index: -1;
30  }
31`,tk=C.I4.div`
32  background: transparent;
33  height: 100%;
34  inset: 0;
35  position: absolute;
36  width: 100%;
37`,tS=e=>{let t,n,r=(0,h.c)(6),{children:i,onDismiss:o,setBoundaryElement:s}=e;return r[0]!==o?(t=(0,u.jsx)(tk,{onClickCapture:o}),r[0]=o,r[1]=t):t=r[1],r[2]!==i||r[3]!==s||r[4]!==t?(n=(0,u.jsx)(P.ZL,{children:(0,u.jsxs)(tw,{"data-sanity-overlay-element":!0,ref:s,onClick:tE,children:[t,i]})}),r[2]=i,r[3]=s,r[4]=t,r[5]=n):n=r[5],n};function tE(e){e.stopPropagation()}function tT(e){return{type:"log",name:e.name,version:e.version,description:e.description,maxSampleRate:e.maxSampleRate,schema:void 0}}let tj={"Visual Editing Drag Sequence Completed":tT({name:"Visual Editing Drag Sequence Completed",description:"An array is successfully reordered using drag and drop.",version:1}),"Visual Editing Drag Minimap Enabled":tT({name:"Visual Editing Drag Minimap Enabled",description:"The zoomed-out minimap view is enabled during a drag sequence.",version:1}),"Visual Editing Context Menu Item Removed":tT({name:"Visual Editing Context Menu Item Removed",description:"An item is removed using the Context Menu.",version:1}),"Visual Editing Context Menu Item Duplicated":tT({name:"Visual Editing Context Menu Item Duplicated",description:"An item is duplicated using the Context Menu.",version:1}),"Visual Editing Context Menu Item Moved":tT({name:"Visual Editing Context Menu Item Moved",description:"An item is moved using the Context Menu.",version:1}),"Visual Editing Context Menu Item Inserted":tT({name:"Visual Editing Context Menu Item Inserted",description:"An item is inserted using the Context Menu.",version:1}),"Visual Editing Insert Menu Item Inserted":tT({name:"Visual Editing Insert Menu Item Inserted",description:"An item is inserted using the Insert Menu.",version:1}),"Visual Editing Overlay Clicked":tT({name:"Visual Editing Overlay Clicked",description:"An Overlay is clicked.",version:1})},tA=(0,c.createContext)(void 0);function tM(){let e=(0,c.useContext)(tA);if(!e)throw Error("Telemetry context is missing");return e}let t_={"insert-menu.filter.all-items":"All","insert-menu.search.no-results":"No results","insert-menu.search.placeholder":"Filter types…","insert-menu.toggle-grid-view.tooltip":"Toggle grid view","insert-menu.toggle-list-view.tooltip":"Toggle list view"},tP=e=>{let t,n,r,i,o=(0,h.c)(11),{node:s,onSelect:a}=e;o[0]!==s.options?.insertMenu?(t=s.options?.insertMenu||{},o[0]=s.options?.insertMenu,o[1]=t):t=o[1];let l=t;o[2]!==l.views?(n=l.views?.map(tC),o[2]=l.views,o[3]=n):n=o[3];let c=n;return o[4]!==s.of?(r=s.of.map(tI),o[4]=s.of,o[5]=r):r=o[5],o[6]!==l||o[7]!==a||o[8]!==r||o[9]!==c?(i=(0,u.jsx)(td,{...l,labels:t_,schemaTypes:r,onSelect:a,views:c}),o[6]=l,o[7]=a,o[8]=r,o[9]=c,o[10]=i):i=o[10],i};function tC(e){return"grid"===e.name?{...e,previewImageUrl:t=>e.previewImageUrls?.[t]}:e}function tI(e){return{...e,icon:tx(e)}}let tO=e=>{let t,n,r,i,o,s=(0,h.c)(10);return s[0]!==e?({children:t,style:r,...n}=e,s[0]=e,s[1]=t,s[2]=n,s[3]=r):(t=s[1],n=s[2],r=s[3]),s[4]!==r?(i={...r,pointerEvents:"all"},s[4]=r,s[5]=i):i=s[5],s[6]!==t||s[7]!==n||s[8]!==i?(o=(0,u.jsx)("div",{style:i,"data-sanity-overlay-element":!0,...n,children:t}),s[6]=t,s[7]=n,s[8]=i,s[9]=o):o=s[9],o},tR=e=>"object"==typeof e&&null!=e&&1===e.nodeType,tV=(e,t)=>
37(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,tL=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return tV(n.overflowY,t)||tV(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},tD=(e,t,n,r,i,o,s,a)=>o<e&&s>t||o>e&&s<t?0:o<=e&&a<=n||s>=t&&a>=n?o-e-r:s>t&&a<n||o<e&&a>n?s-t+i:0,t$=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},tz=(e,t)=>{var n,r,i,o;if("undefined"==typeof document)return[];let{scrollMode:s,block:a,inline:l,boundary:u,skipOverflowHiddenElements:c}=t,d="function"==typeof u?u:e=>e!==u;if(!tR(e))throw TypeError("Invalid target");let h=document.scrollingElement||document.documentElement,f=[],p=e;for(;tR(p)&&d(p);){if((p=t$(p))===h){f.push(p);break}null!=p&&p===document.body&&tL(p)&&!tL(document.documentElement)||null!=p&&tL(p,c)&&f.push(p)}let m=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,g=null!=(o=null==(i=window.visualViewport)?void 0:i.height)?o:innerHeight,{scrollX:y,scrollY:v}=window,{height:b,width:x,top:w,right:k,bottom:S,left:E}=e.getBoundingClientRect(),{top:T,right:j,bottom:A,left:M}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),_="start"===a||"nearest"===a?w-T:"end"===a?S+A:w+b/2-T+A,P="center"===l?E+x/2-M+j:"end"===l?k+j:E-M,C=[];for(let e=0;e<f.length;e++){let t=f[e],{height:n,width:r,top:i,right:o,bottom:u,left:c}=t.getBoundingClientRect();if("if-needed"===s&&w>=0&&E>=0&&S<=g&&k<=m&&(t===h&&!tL(t)||w>=i&&S<=u&&E>=c&&k<=o))break;let d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),T=parseInt(d.borderTopWidth,10),j=parseInt(d.borderRightWidth,10),A=parseInt(d.borderBottomWidth,10),M=0,I=0,O="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-j:0,R="offsetHeight"in t?t.offsetHeight-t.clientHeight-T-A:0,V="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,L="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(h===t)M="start"===a?_:"end"===a?_-g:"nearest"===a?tD(v,v+g,g,T,A,v+_,v+_+b,b):_-g/2,I="start"===l?P:"center"===l?P-m/2:"end"===l?P-m:tD(y,y+m,m,p,j,y+P,y+P+x,x),M=Math.max(0,M+v),I=Math.max(0,I+y);else{M="start"===a?_-i-T:"end"===a?_-u+A+R:"nearest"===a?tD(i,u,n,T,A+R,_,_+b,b):_-(i+n/2)+R/2,I="start"===l?P-c-p:"center"===l?P-(c+r/2)+O/2:"end"===l?P-o+j+O:tD(c,o,r,p,j+O,P,P+x,x);let{scrollLeft:e,scrollTop:s}=t;M=0===L?0:Math.max(0,Math.min(s+M/L,t.scrollHeight-n/L+R)),I=0===V?0:Math.max(0,Math.min(e+I/V,t.scrollWidth-r/V+O)),_+=s-M,P+=e-I}C.push({el:t,top:M,left:I})}return C};var tF=n(47112),tB=n(52812),tN=n(46321),tU=n(67395),tH=n(79798),tW=(0,n(92777).L)(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),tY=n(77102),tq=n(81590),tG=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,tN.C6)(t,e),t.prototype.lift=function(e){var t=new tX(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new tW},t.prototype.next=function(e){var t=this;(0,tq.Y)(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=(0,tN.Ju)(t.currentObservers),o=i.next();!o.done;o=i.next())o.value.next(e)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;(0,tq.Y)(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;(0,tq.Y)(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null==(e=this.observers)?void 0:e.length)>0}
37,enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this.hasError,r=this.isStopped,i=this.observers;return n||r?tH.Kn:(this.currentObservers=null,i.push(e),new tH.yU(function(){t.currentObservers=null,(0,tY.o)(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,n=this.thrownError,r=this.isStopped;t?e.error(n):r&&e.complete()},t.prototype.asObservable=function(){var e=new tU.c;return e.source=this,e},t.create=function(e,t){return new tX(e,t)},t}(tU.c),tX=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,tN.C6)(t,e),t.prototype.next=function(e){var t,n;null==(n=null==(t=this.destination)?void 0:t.next)||n.call(t,e)},t.prototype.error=function(e){var t,n;null==(n=null==(t=this.destination)?void 0:t.error)||n.call(t,e)},t.prototype.complete=function(){var e,t;null==(t=null==(e=this.destination)?void 0:e.complete)||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!=(n=null==(t=this.source)?void 0:t.subscribe(e))?n:tH.Kn},t}(tG),tK={now:function(){return(tK.delegate||Date).now()},delegate:void 0},tZ=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=tK);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,tN.C6)(t,e),t.prototype.next=function(t){var n=this.isStopped,r=this._buffer,i=this._infiniteTimeWindow,o=this._timestampProvider,s=this._windowTime;!n&&(r.push(t),i||r.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,n=this._buffer,r=this._infiniteTimeWindow,i=(r?1:2)*e;if(e<1/0&&i<n.length&&n.splice(0,n.length-i),!r){for(var o=t.now(),s=0,a=1;a<n.length&&n[a]<=o;a+=2)s=a;s&&n.splice(0,s+1)}},t}(tG),tJ=n(74187),tQ=n(38241),t0=n(37304),t1=n(65569),t2=n(5647);function t5(e){return e[e.length-1]}var t3=n(9275),t4=n(25178),t6=n(64894);function t9(e,t){return void 0===t&&(t=0),(0,t4.N)(function(n,r){n.subscribe((0,t6._)(r,function(n){return(0,t3.N)(r,e,function(){return r.next(n)},t)},function(){return(0,t3.N)(r,e,function(){return r.complete()},t)},function(n){return(0,t3.N)(r,e,function(){return r.error(n)},t)}))})}function t8(e,t){return void 0===t&&(t=0),(0,t4.N)(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}var t7=n(59053);function ne(e,t){if(!e)throw Error("Iterable cannot be null");return new tU.c(function(n){(0,t3.N)(n,t,function(){var r=e[Symbol.asyncIterator]();(0,t3.N)(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}var nt=n(44109),nn=n(50632),nr=n(88099),ni=n(6153),no=n(43995),ns=n(68859),na=n(36124);function nl(){for(var e,t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=(e=t5(r))&&(0,t2.T)(e.schedule)?r.pop():void 0,s=(t=1/0,"number"==typeof t5(r)?r.pop():t);return r.length?1===r.length?(0,t0.Tg)(r[0]):(void 0===(n=s)&&(n=1/0),(0,tJ.Z)(tQ.D,n))(o?function(e,t){if(null!=e){if((0,nt.l)(e))return(0,t0.Tg)(e).pipe(t8(t),t9(t));if((0,nr.X)(e))return new tU.c(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})});if((0,nn.y)(e))return(0,t0.Tg)(e).pipe(t8(t),t9(t));if((0,no.T)(e))return ne(e,t);if((0,ni.x)(e))return new tU.c(function(n){var r;return(0,t3.N)(n,t,function(){r=e[t7.l](),(0,t3.N)(n,t,function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return(0,t2.T)(null==r?void 0:r.return)&&r.return()}});if((0,na.U)(e))return ne((0,na.C)(e),t)}throw(0,ns.L)(e)}(r,o):(0,t0.Tg)(r)):t1.w}function nu(e){let[t,n]=e;return[t,n]}function nc(e,t){let n=e,r=t,i=n.length,o=r.length;if(0===i||0===o)return 0;i>o?n=n.substring(i-o):i<o&&(r=r.substring(0,i));let s=Math.min(i,o);if(n===r)return s;let a=0,l=1;for(let e=0;-1!==e;){let t=n.substring(s-l);if(-1===(e=r.indexOf(t)))break;
37l+=e,(0===e||n.substring(s-l)===r.substring(0,l))&&(a=l,l++)}return a}function nd(e,t){if(!e||!t||e[0]!==t[0])return 0;let n=0,r=Math.min(e.length,t.length),i=r,o=0;for(;n<i;)e.substring(o,i)===t.substring(o,i)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i}function nh(e,t){if(!e||!t||e[e.length-1]!==t[t.length-1])return 0;let n=0,r=Math.min(e.length,t.length),i=r,o=0;for(;n<i;)e.substring(e.length-i,e.length-o)===t.substring(t.length-i,t.length-o)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i}function nf(e){let t=e.charCodeAt(0);return t>=56320&&t<=57343}function np(e,t,n,r,i){let o=e.substring(0,n),s=t.substring(0,r),a=e.substring(n),l=t.substring(r),u=nk(o,s,{checkLines:!1,deadline:i}),c=nk(a,l,{checkLines:!1,deadline:i});return u.concat(c)}function nm(e,t,n){let r=e.slice(n,n+Math.floor(e.length/4)),i=-1,o="",s,a,l,u;for(;-1!==(i=t.indexOf(r,i+1));){let r=nd(e.slice(n),t.slice(i)),c=nh(e.slice(0,n),t.slice(0,i));o.length<c+r&&(o=t.slice(i-c,i)+t.slice(i,i+r),s=e.slice(0,n-c),a=e.slice(n+r),l=t.slice(0,i-c),u=t.slice(i+r))}return 2*o.length>=e.length?[s||"",a||"",l||"",u||"",o||""]:null}var ng=Object.defineProperty,ny=Object.getOwnPropertySymbols,nv=Object.prototype.hasOwnProperty,nb=Object.prototype.propertyIsEnumerable,nx=(e,t,n)=>t in e?ng(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function nw(e,t,n){if(null===e||null===t)throw Error("Null input. (diff)");let r=nk(e,t,function(e){let t;var n,r={checkLines:!0,deadline:(n=e.timeout||1,t=1,"u">typeof n&&(t=n<=0?Number.MAX_VALUE:n),Date.now()+1e3*t)},i=e;for(var o in i||(i={}))nv.call(i,o)&&nx(r,o,i[o]);if(ny)for(var o of ny(i))nb.call(i,o)&&nx(r,o,i[o]);return r}(n||{}));return function(e){for(let t=0;t<e.length;t++){let[n,r]=e[t];if(0===r.length)continue;let i=r[0];(function(e){let t=e.charCodeAt(0);return t>=55296&&t<=56319})(r[r.length-1])&&0===n&&nT(e,t,1),nf(i)&&0===n&&nT(e,t,-1)}for(let t=0;t<e.length;t++)0===e[t][1].length&&e.splice(t,1)}(r),r}function nk(e,t,n){let r=e,i=t;if(r===i)return r?[[0,r]]:[];let o=nd(r,i),s=r.substring(0,o);o=nh(r=r.substring(o),i=i.substring(o));let a=r.substring(r.length-o),l=function(e,t,n){let r;if(!e)return[[1,t]];if(!t)return[[-1,e]];let i=e.length>t.length?e:t,o=e.length>t.length?t:e,s=i.indexOf(o);if(-1!==s)return r=[[1,i.substring(0,s)],[0,o],[1,i.substring(s+o.length)]],e.length>t.length&&(r[0][0]=-1,r[2][0]=-1),r;if(1===o.length)return[[-1,e],[1,t]];let a=function(e,t,n=1){let r,i,o,s,a;if(n<=0)return null;let l=e.length>t.length?e:t,u=e.length>t.length?t:e;if(l.length<4||2*u.length<l.length)return null;let c=nm(l,u,Math.ceil(l.length/4)),d=nm(l,u,Math.ceil(l.length/2));if(c&&d)r=c[4].length>d[4].length?c:d;else{if(!c&&!d)return null;d?c||(r=d):r=c}if(!r)throw Error("Unable to find a half match.");return e.length>t.length?(i=r[0],o=r[1],s=r[2],a=r[3]):(s=r[0],a=r[1],i=r[2],o=r[3]),[i,o,s,a,r[4]]}(e,t);if(a){let e=a[0],t=a[1],r=a[2],i=a[3],o=a[4],s=nk(e,r,n),l=nk(t,i,n);return s.concat([[0,o]],l)}return n.checkLines&&e.length>100&&t.length>100?function(e,t,n){let r=e,i=t,o=function(e,t){let n=[],r={};function i(e){let t="",i=0,s=-1,a=n.length;for(;s<e.length-1;){-1===(s=e.indexOf(`
38`,i))&&(s=e.length-1);let l=e.slice(i,s+1);(r.hasOwnProperty?r.hasOwnProperty(l):void 0!==r[l])?t+=String.fromCharCode(r[l]):(a===o&&(l=e.slice(i),s=e.length),t+=String.fromCharCode(a),r[l]=a,n[a++]=l),i=s+1}return t}n[0]="";let o=4e4,s=i(e);return o=65535,{chars1:s,chars2:i(t),lineArray:n}}(r,i);r=o.chars1,i=o.chars2;let s=o.lineArray,a=nk(r,i,{checkLines:!1,deadline:n.deadline});(function(e,t){for(let n=0;n<e.length;n++){let r=e[n][1],i=[];for(let e=0;e<r.length;e++)i[e]=t[r.charCodeAt(e)];e[n][1]=i.join("")}})(a,s),(a=nj(a)).push([0,""]);let l=0,u=0,c=0,d="",h="";for(;l<a.length;){switch(a[l][0]){case 1:c++,h+=a[l][1];break;case -1:u++,d+=a[l][1];break;case 0:if(u>=1&&c>=1){a.splice(l-u-c,u+c),l=l-u-c;let e=nk(d,h,{checkLines:!1,deadline:n.deadline});for(let t=e.length-1;t>=0;t--)a.splice(l,0,e[t]);l+=e.length}c=0,u=0,d="",h="";break;default:throw Error("Unknown diff operation.")}l++}return a.pop(),a}(e,t,n):function(e,t,n){let r=e.length,i=t.length,o=Math.ceil((r+i)/2),s=2*o,a=Array(s),l=Array(s);for(let e=0;e<s;e++)a[e]=-1,l[e]=-1;a[o+1]=0,l[o+1]=0;let u=r-i,c=u%2!=0,d=0,h=0,f=0,p=0;for(let m=0;m<o&&!(Date.now()>n);m++){for(let f=-m+d;f<=m-h;f+=2){let p,g=o+f,y=(p=f===-m||f!==m&&a[g-1]<a[g+1]?a[g+1]:a[g-1]+1)-f;for(;p<r&&y<i&&e.charAt(p)===t.charAt(y);)p++,y++;if(a[g]=p,p>r)h+=2;else if(y>i)d+=2;else if(c){let i=o+u-f;if(i>=0&&i<s&&-1!==l[i]&&p>=r-l[i])return np(e,t,p,y,n)}}for(let d=-m+f;d<=m-p;d+=2){let h,g=o+d,y=(h=d===-m||d!==m&&l[g-1]<l[g+1]?l[g+1]:l[g-1]+1)-d;for(;h<r&&y<i&&e.charAt(r-h-1)===t.charAt(i-y-1);)h++,y++;if(l[g]=h,h>r)p+=2;else if(y>i)f+=2;else if(!c){let i=o+u-d;if(i>=0&&i<s&&-1!==a[i]){let s=a[i],l=o+s-i;if(s>=(h=r-h))return np(e,t,s,l,n)}}}}return[[-1,e],[1,t]]}(e,t,n.deadline)}(r=r.substring(0,r.length-o),i=i.substring(0,i.length-o),n);return s&&l.unshift([0,s]),a&&l.push([0,a]),l=nO(l)}function nS(e,t,n){return 1===n?e+t:t+e}function nE(e,t){return 1===t?[e.substring(0,e.length-1),e[e.length-1]]:[e.substring(1),e[0]]}function nT(e,t,n){var r,i;let o=1===n?-1:1,s=null,a=null,l=t+n;for(;l>=0&&l<e.length&&(null===s||null===a);l+=n){let[r,i]=e[l];
38if(0!==i.length){if(1===r){null===s&&(s=l);continue}else if(-1===r){null===a&&(a=l);continue}else if(0===r){if(null===s&&null===a){let[r,i]=nE(e[t][1],n);e[t][1]=r,e[l][1]=nS(e[l][1],i,o);return}break}}}if(null!==s&&null!==a&&(r=s,i=a,1===n?e[r][1][e[r][1].length-1]===e[i][1][e[i][1].length-1]:e[r][1][0]===e[i][1][0])){let[r,i]=nE(e[s][1],o),[l]=nE(e[a][1],o);e[s][1]=r,e[a][1]=l,e[t][1]=nS(e[t][1],i,n);return}let[u,c]=nE(e[t][1],n);e[t][1]=u,null===s?(e.splice(l,0,[1,c]),null!==a&&a>=l&&a++):e[s][1]=nS(e[s][1],c,o),null===a?e.splice(l,0,[-1,c]):e[a][1]=nS(e[a][1],c,o)}function nj(e){let t=e.map(e=>nu(e)),n=!1,r=[],i=0,o=null,s=0,a=0,l=0,u=0,c=0;for(;s<t.length;)0===t[s][0]?(r[i++]=s,a=u,l=c,u=0,c=0,o=t[s][1]):(1===t[s][0]?u+=t[s][1].length:c+=t[s][1].length,o&&o.length<=Math.max(a,l)&&o.length<=Math.max(u,c)&&(t.splice(r[i-1],0,[-1,o]),t[r[i-1]+1][0]=1,i--,s=--i>0?r[i-1]:-1,a=0,l=0,u=0,c=0,o=null,n=!0)),s++;for(n&&(t=nO(t)),t=nI(t),s=1;s<t.length;){if(-1===t[s-1][0]&&1===t[s][0]){let e=t[s-1][1],n=t[s][1],r=nc(e,n),i=nc(n,e);r>=i?(r>=e.length/2||r>=n.length/2)&&(t.splice(s,0,[0,n.substring(0,r)]),t[s-1][1]=e.substring(0,e.length-r),t[s+1][1]=n.substring(r),s++):(i>=e.length/2||i>=n.length/2)&&(t.splice(s,0,[0,e.substring(0,i)]),t[s-1][0]=1,t[s-1][1]=n.substring(0,n.length-i),t[s+1][0]=-1,t[s+1][1]=e.substring(i),s++),s++}s++}return t}let nA=/[^a-zA-Z0-9]/,nM=/\s/,n_=/[\r\n]/,nP=/\n\r?\n$/,nC=/^\r?\n\r?\n/;function nI(e){let t=e.map(e=>nu(e));function n(e,t){if(!e||!t)return 6;let n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(nA),o=r.match(nA),s=i&&n.match(nM),a=o&&r.match(nM),l=s&&n.match(n_),u=a&&r.match(n_),c=l&&e.match(nP),d=u&&t.match(nC);return c||d?5:l||u?4:i&&!s&&a?3:s||a?2:i||o?1:0}let r=1;for(;r<t.length-1;){if(0===t[r-1][0]&&0===t[r+1][0]){let e=t[r-1][1],i=t[r][1],o=t[r+1][1],s=nh(e,i);if(s){let t=i.substring(i.length-s);e=e.substring(0,e.length-s),i=t+i.substring(0,i.length-s),o=t+o}let a=e,l=i,u=o,c=n(e,i)+n(i,o);for(;i.charAt(0)===o.charAt(0);){e+=i.charAt(0),i=i.substring(1)+o.charAt(0),o=o.substring(1);let t=n(e,i)+n(i,o);t>=c&&(c=t,a=e,l=i,u=o)}t[r-1][1]!==a&&(a?t[r-1][1]=a:(t.splice(r-1,1),r--),t[r][1]=l,u?t[r+1][1]=u:(t.splice(r+1,1),r--))}r++}return t}function nO(e){let t=e.map(e=>nu(e));t.push([0,""]);let n=0,r=0,i=0,o="",s="",a;for(;n<t.length;)switch(t[n][0]){case 1:i++,s+=t[n][1],n++;break;case -1:r++,o+=t[n][1],n++;break;case 0:r+i>1?(0!==r&&0!==i&&(0!==(a=nd(s,o))&&(n-r-i>0&&0===t[n-r-i-1][0]?t[n-r-i-1][1]+=s.substring(0,a):(t.splice(0,0,[0,s.substring(0,a)]),n++),s=s.substring(a),o=o.substring(a)),0!==(a=nh(s,o))&&(t[n][1]=s.substring(s.length-a)+t[n][1],s=s.substring(0,s.length-a),o=o.substring(0,o.length-a))),n-=r+i,t.splice(n,r+i),o.length&&(t.splice(n,0,[-1,o]),n++),s.length&&(t.splice(n,0,[1,s]),n++),n++):0!==n&&0===t[n-1][0]?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,i=0,r=0,o="",s="";break;default:throw Error("Unknown diff operation")}""===t[t.length-1][1]&&t.pop();let l=!1;for(n=1;n<t.length-1;)0===t[n-1][0]&&0===t[n+1][0]&&(t[n][1].substring(t[n][1].length-t[n-1][1].length)===t[n-1][1]?(t[n][1]=t[n-1][1]+t[n][1].substring(0,t[n][1].length-t[n-1][1].length),t[n+1][1]=t[n-1][1]+t[n+1][1],t.splice(n-1,1),l=!0):t[n][1].substring(0,t[n+1][1].length)===t[n+1][1]&&(t[n-1][1]+=t[n+1][1],t[n][1]=t[n][1].substring(t[n+1][1].length)+t[n+1][1],t.splice(n+1,1),l=!0)),n++;return l&&(t=nO(t)),t}var nR=Object.defineProperty,nV=Object.getOwnPropertySymbols,nL=Object.prototype.hasOwnProperty,nD=Object.prototype.propertyIsEnumerable,n$=(e,t,n)=>t in e?nR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nz=(e,t)=>{for(var n in t||(t={}))nL.call(t,n)&&n$(e,n,t[n]);if(nV)for(var n of nV(t))nD.call(t,n)&&n$(e,n,t[n]);return e};let nF={threshold:.5,distance:1e3};function nB(e,t,n,r={}){if(null===e||null===t||null===n)throw Error("Null input. (match())");let i=Math.max(0,Math.min(n,e.length));return e===t?0:e.length?e.substring(i,i+t.length)===t?i:function(e,t,n,r={}){if(t.length>32)throw Error("Pattern too long for this browser.");let i=nz(nz({},nF),r),o=function(e){let t={};for(let n=0;n<e.length;n++)t[e.charAt(n)]=0;for(let n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t}(t);function s(e,r){let o=e/t.length,s=Math.abs(n-r);return i.distance?o+s/i.distance:s?1:o}let a=i.threshold,l=e.indexOf(t,n);-1!==l&&(a=Math.min(s(0,l),a),-1!==(l=e.lastIndexOf(t,n+t.length))&&(a=Math.min(s(0,l),a)));let u=1<<t.length-1;l=-1;let c,d,h=t.length+e.length,f=[];for(let r=0;r<t.length;r++){for(c=0,d=h;c<d;)s(r,n+d)<=a?c=d:h=d,d=Math.floor((h-c)/2+c);h=d;let i=Math.max(1,n-d+1),p=Math.min(n+d,e.length)+t.length,m=Array(p+2);m[p+1]=(1<<r)-1;for(let t=p;t>=i;t--){let c=o[e.charAt(t-1)];if(0===r?m[t]=(m[t+1]<<1|1)&c:m[t]=(m[t+1]<<1|1)&c|((f[t+1]|f[t])<<1|1)|f[t+1],m[t]&u){let e=s(r,t-1);if(e<=a)if(a=e,(l=t-1)>n)i=Math.max(1,2*n-l);else break}}if(s(r+1,n)>a)break;f=m}return l}(e,t,i,r):-1}function nN(e){let t=[];for(let n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")}function nU(e){let t=[];for(let n=0;n<e.length;n++)-1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")}function nH(e,t){let n=0,r=0,i=0,o=0,s;for(s=0;s<e.length&&(1!==e[s][0]&&(n+=e[s][1].length),-1!==e[s][0]&&(r+=e[s][1].length),!(n>t));s++)i=n,o=r;return e.length!==s&&-1===e[s][0]?o:o+(t-i)}function nW(e){let t=0;for(let n=0;n<e.length;n++){let r=e.codePointAt(n);if(typeof r>"u")throw Error("Failed to get codepoint");t+=nY(r)}return t}function nY(e){return e<=127?1:e<=2047?2:e<=65535?3:4}function nq(e,t){return{diffs:[],start1:e,start2:t,utf8Start1:e,utf8Start2:t,length1:0,length2:0,utf8Length1:0,utf8Length2:0}}var nG=Object.defineProperty,nX=Object.getOwnPropertySymbols,nK=Object.prototype.hasOwnProperty,nZ=Object.prototype.propertyIsEnumerable,nJ=(e,t,n)=>t in e?nG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nQ=(e,t)=>{for(var n in t||(t={}))nK.call(t,n)&&nJ(e,n,t[n]);if(nX)for(var n of nX(t))nZ.call(t,n)&&nJ(e,n,t[n]);return e};let n0={margin:4};function n1(e={}){return nQ(nQ({},n0),e)}function n2(e,t,n){if(0===t.length)return[];let r=[],i=nq(0,0),o=0,s=0,a=0,l=0,u=0,c=e,d=e;for(let e=0;e<t.length;e++){let h=t[e],[f,p]=h,m=p.length,g=nW(p);switch(!o&&0!==f&&(i.start1=s,i.start2=a,i.utf8Start1=l,i.utf8Start2=u),f){case 1:i.diffs[o++]=h,i.length2+=m,i.utf8Length2+=g,d=d.substring(0,a)+p+d.substring(a);break;case -1:i.length1+=m,i.utf8Length1+=g,i.diffs[o++]=h,d=d.substring(0,a)+d.substring(a+m);break;case 0:m<=2*n.margin&&o&&t.length!==e+1?(i.diffs[o++]=h,i.length1+=m,i.length2+=m,i.utf8Length1+=g,i.utf8Length2+=g):m>=2*n.margin&&o&&(n5(i,c,n),r.push(i),i=nq(-1,-1),o=0,c=d,s=a,l=u);break;default:throw Error("Unknown diff type")}1!==f&&(s+=m,l+=g),-1!==f&&(a+=m,u+=g)}return o&&(n5(i,c,n),r.push(i)),r}
38function n5(e,t,n){if(0===t.length)return;let r=t.substring(e.start2,e.start2+e.length1),i=0;for(;t.indexOf(r)!==t.lastIndexOf(r)&&r.length<32-n.margin-n.margin;)i+=n.margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=n.margin;let o=e.start2-i;o>=1&&nf(t[o])&&o--;let s=t.substring(o,e.start2);s&&e.diffs.unshift([0,s]);let a=s.length,l=nW(s),u=e.start2+e.length1+i;u<t.length&&nf(t[u])&&u++;let c=t.substring(e.start2+e.length1,u);c&&e.diffs.push([0,c]);let d=c.length,h=nW(c);e.start1-=a,e.start2-=a,e.utf8Start1-=l,e.utf8Start2-=l,e.length1+=a+d,e.length2+=a+d,e.utf8Length1+=l+h,e.utf8Length2+=l+h}let n3=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;function n4(e){return parseInt(e,10)}function n6(e){let t,n,r,{utf8Length1:i,utf8Length2:o,utf8Start1:s,utf8Start2:a,diffs:l}=e;t=0===i?`${s},0`:1===i?`${s+1}`:`${s+1},${i}`,n=0===o?`${a},0`:1===o?`${a+1}`:`${a+1},${o}`;let u=[`@@ -${t} +${n} @@
39`];for(let e=0;e<l.length;e++){switch(l[e][0]){case 1:r="+";break;case -1:r="-";break;case 0:r=" ";break;default:throw Error("Unknown patch operation.")}u[e+1]=`${r+encodeURI(l[e][1])}
40`}return u.join("").replace(/%20/g," ")}var n9="object"==typeof global&&global&&global.Object===Object&&global,n8="object"==typeof self&&self&&self.Object===Object&&self,n7=n9||n8||Function("return this")(),re=n7.Symbol,rt=Object.prototype,rn=rt.hasOwnProperty,rr=rt.toString,ri=re?re.toStringTag:void 0;let ro=function(e){var t=rn.call(e,ri),n=e[ri];try{e[ri]=void 0;var r=!0}catch(e){}var i=rr.call(e);return r&&(t?e[ri]=n:delete e[ri]),i};var rs=Object.prototype.toString,ra=re?re.toStringTag:void 0;let rl=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ra&&ra in Object(e)?ro(e):rs.call(e)},ru=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},rc=function(e){if(!ru(e))return!1;var t=rl(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var rd=n7["__core-js_shared__"],rh=function(){var e=/[^.]+$/.exec(rd&&rd.keys&&rd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),rf=Function.prototype.toString;let rp=function(e){if(null!=e){try{return rf.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var rm=/^\[object .+?Constructor\]$/,rg=Object.prototype,ry=Function.prototype.toString,rv=rg.hasOwnProperty,rb=RegExp("^"+ry.call(rv).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");let rx=function(e){return!!ru(e)&&(!rh||!(rh in e))&&(rc(e)?rb:rm).test(rp(e))},rw=function(e,t){var n=null==e?void 0:e[t];return rx(n)?n:void 0};var rk=function(){try{var e=rw(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();let rS=function(e,t,n){"__proto__"==t&&rk?rk(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},rE=function(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r},rT=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var a=o[++r];if(!1===t(i[a],a,i))break}return e},rj=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},rA=function(e){return null!=e&&"object"==typeof e},rM=function(e){return rA(e)&&"[object Arguments]"==rl(e)};var r_=Object.prototype,rP=r_.hasOwnProperty,rC=r_.propertyIsEnumerable,rI=rM(function(){return arguments}())?rM:function(e){return rA(e)&&rP.call(e,"callee")&&!rC.call(e,"callee")},rO=Array.isArray,rR="object"==typeof exports&&exports&&!exports.nodeType&&exports,rV=rR&&"object"==typeof module&&module&&!module.nodeType&&module,rL=rV&&rV.exports===rR?n7.Buffer:void 0;let rD=(rL?rL.isBuffer:void 0)||function(){return!1};var r$=/^(?:0|[1-9]\d*)$/;let rz=function(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&r$.test(e))&&e>-1&&e%1==0&&e<t},rF=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff};var rB={};rB["[object Float32Array]"]=rB["[object Float64Array]"]=rB["[object Int8Array]"]=rB["[object Int16Array]"]=rB["[object Int32Array]"]=rB["[object Uint8Array]"]=rB["[object Uint8ClampedArray]"]=rB["[object Uint16Array]"]=rB["[object Uint32Array]"]=!0,rB["[object Arguments]"]=rB["[object Array]"]=rB["[object ArrayBuffer]"]=rB["[object Boolean]"]=rB["[object DataView]"]=rB["[object Date]"]=rB["[object Error]"]=rB["[object Function]"]=rB["[object Map]"]=rB["[object Number]"]=rB["[object Object]"]=rB["[object RegExp]"]=rB["[object Set]"]=rB["[object String]"]=rB["[object WeakMap]"]=!1;var rN="object"==typeof exports&&exports&&!exports.nodeType&&exports,rU=rN&&"object"==typeof module&&module&&!module.nodeType&&module,rH=rU&&rU.exports===rN&&n9.process,rW=function(){try{var e=rU&&rU.require&&rU.require("util").t
40ypes;if(e)return e;return rH&&rH.binding&&rH.binding("util")}catch(e){}}(),rY=rW&&rW.isTypedArray,rq=rY?function(e){return rY(e)}:function(e){return rA(e)&&rF(e.length)&&!!rB[rl(e)]},rG=Object.prototype.hasOwnProperty;let rX=function(e,t){var n=rO(e),r=!n&&rI(e),i=!n&&!r&&rD(e),o=!n&&!r&&!i&&rq(e),s=n||r||i||o,a=s?rj(e.length,String):[],l=a.length;for(var u in e)(t||rG.call(e,u))&&!(s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||rz(u,l)))&&a.push(u);return a};var rK=Object.prototype;let rZ=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||rK)};var rJ=(s=Object.keys,a=Object,function(e){return s(a(e))}),rQ=Object.prototype.hasOwnProperty;let r0=function(e){if(!rZ(e))return rJ(e);var t=[];for(var n in Object(e))rQ.call(e,n)&&"constructor"!=n&&t.push(n);return t},r1=function(e){return null!=e&&rF(e.length)&&!rc(e)},r2=function(e){return r1(e)?rX(e):r0(e)};var r5=(i=function(e,t){return e&&rT(e,t,r2)},function(e,t){if(null==e)return e;if(!r1(e))return i(e,t);for(var n=e.length,r=-1,o=Object(e);++r<n&&!1!==t(o[r],r,o););return e});let r3=function(e,t,n,r){return r5(e,function(e,i,o){t(r,e,n(e),o)}),r},r4=function(e,t){return e===t||e!=e&&t!=t},r6=function(e,t){for(var n=e.length;n--;)if(r4(e[n][0],t))return n;return -1};var r9=Array.prototype.splice;function r8(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}r8.prototype.clear=function(){this.__data__=[],this.size=0},r8.prototype.delete=function(e){var t=this.__data__,n=r6(t,e);return!(n<0)&&(n==t.length-1?t.pop():r9.call(t,n,1),--this.size,!0)},r8.prototype.get=function(e){var t=this.__data__,n=r6(t,e);return n<0?void 0:t[n][1]},r8.prototype.has=function(e){return r6(this.__data__,e)>-1},r8.prototype.set=function(e,t){var n=this.__data__,r=r6(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var r7=rw(n7,"Map"),ie=rw(Object,"create"),it=Object.prototype.hasOwnProperty,ir=Object.prototype.hasOwnProperty;function ii(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ii.prototype.clear=function(){this.__data__=ie?ie(null):{},this.size=0},ii.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},ii.prototype.get=function(e){var t=this.__data__;if(ie){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return it.call(t,e)?t[e]:void 0},ii.prototype.has=function(e){var t=this.__data__;return ie?void 0!==t[e]:ir.call(t,e)},ii.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=ie&&void 0===t?"__lodash_hash_undefined__":t,this};let io=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},is=function(e,t){var n=e.__data__;return io(t)?n["string"==typeof t?"string":"hash"]:n.map};function ia(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function il(e){var t=this.__data__=new r8(e);this.size=t.size}function iu(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ia;++t<n;)this.add(e[t])}ia.prototype.clear=function(){this.size=0,this.__data__={hash:new ii,map:new(r7||r8),string:new ii}},ia.prototype.delete=function(e){var t=is(this,e).delete(e);return this.size-=!!t,t},ia.prototype.get=function(e){return is(this,e).get(e)},ia.prototype.has=function(e){return is(this,e).has(e)},ia.prototype.set=function(e,t){var n=is(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},il.prototype.clear=function(){this.__data__=new r8,this.size=0},il.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},il.prototype.get=function(e){return this.__data__.get(e)},il.prototype.has=function(e){return this.__data__.has(e)},il.prototype.set=function(e,t){var n=this.__data__;if(n instanceof r8){var r=n.__data__;if(!r7||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ia(r)}return n.set(e,t),this.size=n.size,this},iu.prototype.add=iu.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},iu.prototype.has=function(e){return this.__data__.has(e)};let ic=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},id=function(e,t,n,r,i,o){var s=1&n,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,f=2&n?new iu:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var p=e[d],m=t[d];if(r)var g=s?r(m,p,d,t,e,o):r(p,m,d,e,t,o);if(void 0!==g){if(g)continue;h=!1;break}if(f){if(!ic(t,function(e,t){if(!f.has(t)&&(p===e||i(p,e,n,r,o)))return f.push(t)})){h=!1;break}}else if(!(p===m||i(p,m,n,r,o))){h=!1;break}}return o.delete(e),o.delete(t),h};var ih=n7.Uint8Array;let ip=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},im=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n};var ig=re?re.prototype:void 0,iy=ig?ig.valueOf:void 0;let iv=function(e,t,n,r,i,o,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!o(new ih(e),new ih(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return r4(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ip;case"[object Set]":var l=1&r;if(a||(a=im),e.size!=t.size&&!l)break;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var c=id(a(e),a(t),r,i,o,s);return s.delete(e),c;case"[object Symbol]":if(iy)return iy.call(e)==iy.call(t)}return!1},ib=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},ix=function(e,t,n){var r=t(e);return rO(e)?r:ib(r,n(e))},iw=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o};var ik=Object.prototype.propertyIsEnumerable,iS=Object.getOwnPropertySymbols,iE=iS?function(e){return null==e?[]:iw(iS(e=Object(e)),function(t){return ik.call(e,t)})}:function(){return[]};let iT=function(e){return ix(e,r2,iE)};var ij=Object.prototype.hasOwnProperty;let iA=function(e,t,n,r,i,o){var s=1&n,a=iT(e),l=a.length;if(l!=iT(t).length&&!s)return!1;for(var u=l;u--;){var c=a[u];if(!(s?c in t:ij.call(t,c)))return!1}var d=o.get(e),h=o.get(t);if(d&&h)return d==t&&h==e;var f=!0;o.set(e,t),o.set(t,e);for(var p=s;++u<l;){var m=e[c=a[u]],g=t[c];if(r)var y=s?r(g,m,c,t,e,o):r(m,g,c,e,t,o);if(!(void 0===y?m===g||i(m,g,n,r,o):y)){f=!1;break}p||(p="constructor"==c)}if(f&&!p){var v=e.constructor,b=t.constructor;v!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b)&&(f=!1)}return o.delete(e),o.delete(t),f};var iM=rw(n7,"DataView"),i_=rw(n7,"Promise"),iP=rw(n7,"Set"),iC=rw(n7,"WeakMap"),iI="[object Map]",iO="[object Promise]",iR="[object Set]",iV="[object WeakMap]",iL="[object DataView]",iD=rp(iM),i$=rp(r7),iz=rp(i_),iF=rp(iP),iB=rp(iC),iN=rl;(iM&&iN(new iM(new ArrayBuffer(1)))!=iL||r7&&iN(new r7)!=iI||i_&&iN(i_.resolve())!=iO||iP&&iN(new iP)!=iR||iC&&iN(new iC)!=iV)&&(iN=function(e){var t=rl(e),n="[object Object]"==t?e.constructor:void 0,r=n?rp(n):"";if(r)switch(r){case iD:return iL;case i$:return iI;case iz:return iO;case iF:return iR;case iB:return iV}return t});let iU=iN;var iH="[object Arguments]",iW="[object Array]",iY="[object Object]",iq=Object.prototype.hasOwnProperty;let iG=function(e,t,n,r,i,o){var s=rO(e),a=rO(t),l=s?iW:iU(e),u=a?iW:iU(t);l=l==iH?iY:l,u=u==iH?iY:u;var c=l==iY,d=u==iY,h=l==u;if(h&&rD(e)){if(!rD(t))return!1;s=!0,c=!1}if(h&&!c)return o||(o=new il),s||rq(e)?id(e,t,n,r,i,o):iv(e,t,l,n,r,i,o);if(!(1&n)){var f=c&&iq.call(e,"__wrapped__"),p=d&&iq.call(t,"__wrapped__");
40if(f||p){var m=f?e.value():e,g=p?t.value():t;return o||(o=new il),i(m,g,n,r,o)}}return!!h&&(o||(o=new il),iA(e,t,n,r,i,o))},iX=function e(t,n,r,i,o){return t===n||(null!=t&&null!=n&&(rA(t)||rA(n))?iG(t,n,r,i,e,o):t!=t&&n!=n)},iK=function(e,t,n,r){var i=n.length,o=i,s=!r;if(null==e)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var l=(a=n[i])[0],u=e[l],c=a[1];if(s&&a[2]){if(void 0===u&&!(l in e))return!1}else{var d=new il;if(r)var h=r(u,c,l,e,t,d);if(!(void 0===h?iX(c,u,3,r,d):h))return!1}}return!0},iZ=function(e){return e==e&&!ru(e)},iJ=function(e){for(var t=r2(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,iZ(i)]}return t},iQ=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},i0=function(e){var t=iJ(e);return 1==t.length&&t[0][2]?iQ(t[0][0],t[0][1]):function(n){return n===e||iK(n,e,t)}},i1=function(e){return"symbol"==typeof e||rA(e)&&"[object Symbol]"==rl(e)};var i2=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i5=/^\w*$/;let i3=function(e,t){if(rO(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||i1(e))||i5.test(e)||!i2.test(e)||null!=t&&e in Object(t)};function i4(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i4.Cache||ia),n}i4.Cache=ia;var i6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i9=/\\(\\)?/g,i8=function(e){var t=i4(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i6,function(e,n,r,i){t.push(r?i.replace(i9,"$1"):n||e)}),t});let i7=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var oe=1/0,ot=re?re.prototype:void 0,on=ot?ot.toString:void 0;let or=function e(t){if("string"==typeof t)return t;if(rO(t))return i7(t,e)+"";if(i1(t))return on?on.call(t):"";var n=t+"";return"0"==n&&1/t==-oe?"-0":n},oi=function(e,t){return rO(e)?e:i3(e,t)?[e]:i8(null==e?"":or(e))};var oo=1/0;let os=function(e){if("string"==typeof e||i1(e))return e;var t=e+"";return"0"==t&&1/e==-oo?"-0":t},oa=function(e,t){t=oi(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[os(t[n++])];return n&&n==r?e:void 0},ol=function(e,t,n){var r=null==e?void 0:oa(e,t);return void 0===r?n:r},ou=function(e,t){return null!=e&&t in Object(e)},oc=function(e,t,n){t=oi(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=os(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&rF(i)&&rz(s,i)&&(rO(e)||rI(e))},od=function(e){return e},oh=function(e){var t;return i3(e)?(t=os(e),function(e){return null==e?void 0:e[t]}):function(t){return oa(t,e)}},of=function(e){if("function"==typeof e)return e;if(null==e)return od;if("object"==typeof e){var t,n;return rO(e)?(t=e[0],n=e[1],i3(t)&&iZ(n)?iQ(os(t),n):function(e){var r=ol(e,t);return void 0===r&&r===n?null!=e&&oc(e,t,ou):iX(n,r,3)}):i0(e)}return oh(e)};var op=Object.prototype.hasOwnProperty,om=(o=function(e,t,n){op.call(e,n)?e[n].push(t):rS(e,n,[t])},function(e,t){return(rO(e)?rE:r3)(e,o,of(t,2),{})});let og=["Value","Copy","Blank","ReturnIntoArray","ReturnIntoObject","ReturnIntoObjectSameKey","PushField","PushElement","PushParent","Pop","PushFieldCopy","PushFieldBlank","PushElementCopy","PushElementBlank","ReturnIntoObjectPop","ReturnIntoObjectSameKeyPop","ReturnIntoArrayPop","ObjectSetFieldValue","ObjectCopyField","ObjectDeleteField","ArrayAppendValue","ArrayAppendSlice","StringAppendString","StringAppendSlice"];class oy{model;root;patch;i;inputStack;outputStack;constructor(e,t,n){this.model=e,this.root=t,this.patch=n,this.i=0,this.inputStack=[],this.outputStack=[]}read(){return this.patch[this.i++]}process(){for(this.inputStack.push({value:this.root}),this.outputStack.push({value:this.root});this.i<this.patch.length;){let e=this.read(),t=og[e];if(!t)throw Error(`Unknown opcode: ${e}`);this[`process${t}`].apply(this)}let e=this.outputStack.pop();return this.finalizeOutput(e)}inputEntry(){return this.inputStack[this.inputStack.length-1]}inputKey(e,t){return e.keys||(e.keys=this.model.objectGetKeys(e.value).sort()),e.keys[t]}outputEntry(){return this.outputStack[this.outputStack.length-1]}outputArray(){let e=this.outputEntry();return e.writeValue||(e.writeValue=this.model.copyArray(e.value)),e.writeValue}outputObject(){let e=this.outputEntry();return e.writeValue||(e.writeValue=this.model.copyObject(e.value)),e.writeValue}outputString(){let e=this.outputEntry();return e.writeValue||(e.writeValue=this.model.copyString(e.value)),e.writeValue}finalizeOutput(e){return e.writeValue?this.model.finalize(e.writeValue):e.value}processValue(){let e=this.model.wrap(this.read());this.outputStack.push({value:e})}processCopy(){let e=this.inputEntry();this.outputStack.push({value:e.value})}processBlank(){this.outputStack.push({value:null})}processReturnIntoArray(){let e=this.outputStack.pop(),t=this.finalizeOutput(e),n=this.outputArray();this.model.arrayAppendValue(n,t)}processReturnIntoObject(){let e=this.read(),t=this.outputStack.pop(),n=this.finalizeOutput(t);n=this.model.markChanged(n);let r=this.outputObject();this.model.objectSetField(r,e,n)}processReturnIntoObjectSameKey(){let e=this.inputEntry(),t=this.outputStack.pop(),n=this.finalizeOutput(t),r=this.outputObject();this.model.objectSetField(r,e.key,n)}processPushField(){let e=this.read(),t=this.inputEntry(),n=this.inputKey(t,e),r=this.model.objectGetField(t.value,n);this.inputStack.push({value:r,key:n})}processPushElement(){let e=this.read(),t=this.inputEntry(),n=this.model.arrayGetElement(t.value,e);this.inputStack.push({value:n})}processPop(){this.inputStack.pop()}processPushFieldCopy(){this.processPushField(),this.processCopy()}processPushFieldBlank(){this.processPushField(),this.processBlank()}processPushElementCopy(){this.processPushElement(),this.processCopy()}processPushElementBlank(){this.processPushElement(),this.processBlank()}processReturnIntoObjectPop(){this.processReturnIntoObject(),this.processPop()}processReturnIntoObjectSameKeyPop(){this.processReturnIntoObjectSameKey(),this.processPop()}processReturnIntoArrayPop(){this.processReturnIntoArray(),this.processPop()}processObjectSetFieldValue(){this.processValue(),this.processReturnIntoObject()}processObjectCopyField(){this.processPushField(),this.processCopy(),this.processReturnIntoObjectSameKey(),this.processPop()}processObjectDeleteField(){let e=this.read(),t=this.inputEntry(),n=this.inputKey(t,e),r=this.outputObject();this.model.objectDeleteField(r,n)}processArrayAppendValue(){let e=this.model.wrap(this.read()),t=this.outputArray();this.model.arrayAppendValue(t,e)}processArrayAppendSlice(){let e=this.read(),t=this.read(),n=this.outputArray(),r=this.inputEntry().value;this.model.arrayAppendSlice(n,r,e,t)}processStringAppendString(){let e=this.model.wrap(this.read()),t=this.outputString();this.model.stringAppendValue(t,e)}processStringAppendSlice(){let e=this.read(),t=this.read(),n=this.outputString(),r=this.inputEntry().value;this.model.stringAppendSlice(n,r,e,t)}}function ov(e){return e>>16?4:e>>11?3:e>>7?2:1}function ob(e,t,n=0){let r=n,i=0;for(i=n;r<t;
40i++){let t=ov(e.codePointAt(i));4===t&&i++,r+=t}return i}class ox{wrap(e){return e}finalize(e){return Array.isArray(e)?e:e.data}markChanged(e){return e}objectGetKeys(e){return Object.keys(e)}objectGetField(e,t){return e[t]}arrayGetElement(e,t){return e[t]}copyObject(e){let t={type:"object",data:{}};if(null!==e)for(let[n,r]of Object.entries(e))t.data[n]=r;return t}copyArray(e){return null===e?[]:e.slice()}copyString(e){return{type:"string",data:null===e?"":e}}objectSetField(e,t,n){e.data[t]=n}objectDeleteField(e,t){delete e.data[t]}arrayAppendValue(e,t){e.push(t)}arrayAppendSlice(e,t,n,r){e.push(...t.slice(n,r))}stringAppendSlice(e,t,n,r){let i=ob(t,n),o=ob(t,r,i);e.data+=t.slice(i,o)}stringAppendValue(e,t){e.data+=t}}var ow=n(72181);function ok(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new tG}:t,r=e.resetOnError,i=void 0===r||r,o=e.resetOnComplete,s=void 0===o||o,a=e.resetOnRefCountZero,l=void 0===a||a;return function(e){var t,r,o,a=0,u=!1,c=!1,d=function(){null==r||r.unsubscribe(),r=void 0},h=function(){d(),t=o=void 0,u=c=!1},f=function(){var e=t;h(),null==e||e.unsubscribe()};return(0,t4.N)(function(e,p){a++,c||u||d();var m=o=null!=o?o:n();p.add(function(){0!=--a||c||u||(r=oS(f,l))}),m.subscribe(p),!t&&a>0&&(t=new ow.Ms({next:function(e){return m.next(e)},error:function(e){c=!0,d(),r=oS(h,i,e),m.error(e)},complete:function(){u=!0,d(),r=oS(h,s),m.complete()}}),(0,t0.Tg)(e).subscribe(t))})(e)}}function oS(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0===t)return void e();if(!1!==t){var i=new ow.Ms({next:function(){i.unsubscribe(),e()}});return(0,t0.Tg)(t.apply(void 0,(0,tN.fX)([],(0,tN.zs)(n)))).subscribe(i)}}var oE=n(88790),oT=n(98980),oj=function(e){function t(t,n){return e.call(this)||this}return(0,tN.C6)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(tH.yU),oA={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=oA.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,(0,tN.fX)([e,t],(0,tN.zs)(n))):setInterval.apply(void 0,(0,tN.fX)([e,t],(0,tN.zs)(n)))},clearInterval:function(e){var t=oA.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},oM=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,tN.C6)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n,r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!=(n=this.id)?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),oA.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&oA.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,tY.o)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(oj),o_=1,oP={};function oC(e){return e in oP&&(delete oP[e],!0)}var oI={setImmediate:function(e){var t=o_++;return oP[t]=!0,l||(l=Promise.resolve()),l.then(function(){return oC(t)&&e()}),t},clearImmediate:function(e){oC(e)}},oO=oI.setImmediate,oR=oI.clearImmediate,oV={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=oV.delegate;return((null==n?void 0:n.setImmediate)||oO).apply(void 0,(0,tN.fX)([],(0,tN.zs)(e)))},clearImmediate:function(e){var t=oV.delegate;return((null==t?void 0:t.clearImmediate)||oR)(e)},delegate:void 0},oL=function(e){function t(t,n){var r=e.call(this,t,n)||this;
40return r.scheduler=t,r.work=n,r}return(0,tN.C6)(t,e),t.prototype.requestAsyncId=function(t,n,r){return(void 0===r&&(r=0),null!==r&&r>0)?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=oV.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i,o=t.actions;null!=n&&(null==(i=o[o.length-1])?void 0:i.id)!==n&&(oV.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},t}(oM),oD=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=tK.now,e}(),o$=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,tN.C6)(t,e),t.prototype.flush=function(e){this._active=!0;var t,n=this._scheduled;this._scheduled=void 0;var r=this.actions;e=e||r.shift();do if(t=e.execute(e.state,e.delay))break;while((e=r[0])&&e.id===n&&r.shift());if(this._active=!1,t){for(;(e=r[0])&&e.id===n&&r.shift();)e.unsubscribe();throw t}},t}(function(e){function t(t,n){void 0===n&&(n=oD.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return(0,tN.C6)(t,e),t.prototype.flush=function(e){var t,n=this.actions;if(this._active)return void n.push(e);this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,t){for(;e=n.shift();)e.unsubscribe();throw t}},t}(oD)))(oL),oz=n(94696),oF=n(57497);function oB(e){if("patch"===e.type)return e.id;if("create"===e.type)return e.document._id;if("delete"===e.type)return e.id;if("createIfNotExists"===e.type||"createOrReplace"===e.type)return e.document._id;throw Error("Invalid mutation type")}let oN=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};function oU(e){return"string"==typeof e?._key}function oH(e){return"object"==typeof e&&"_key"in e&&"string"==typeof e._key}function oW(e){return"number"==typeof e||oH(e)}function oY(e,t){if(0===e.length)return t;let n=t;for(let t of e){if(oW(t)){if(!Array.isArray(n))return;if(oH(t)){n=n.find(e=>e._key===t._key);continue}n=n[t];continue}n=n[t]}return n}let oq=/^[a-z_$]+/;function oG(e){return e.map((e,t)=>{var n;return n=0===t,Array.isArray(e)?`[${e[0]}:${e[1]||""}]`:"number"==typeof e?`[${e}]`:oH(e)?`[_key==${JSON.stringify(e._key)}]`:"string"==typeof e&&oq.test(e)?n?e:`.${e}`:`['${e}']`}).join("")}function oX(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function oK(e,t){if("number"==typeof t){var n=e.length,r=t;if(0===n&&(-1===r||0===r))return 0;let i=r<0?n+r:r;return i>=n||i<0?null:i}if(oH(t)){let n=e.findIndex(e=>(null!==e&&"object"==typeof e&&"string"==typeof e._key&&e._key||null)===t._key);return -1===n?null:n}throw Error(`Expected path segment to be addressing a single array item either by numeric index or by '_key'. Instead saw ${JSON.stringify(t)}`)}function oZ(e,t,n,r){let i=e.slice();return i.splice(t,n,...r||[]),i}function oJ(e,t){var n;if(!Array.isArray(t))throw TypeError('Cannot apply "insert()" on non-array value');let r=oK(t,e.referenceItem);if(null===r)throw Error(`Found no matching array element to insert ${e.position}`);return 0===t.length?e.items:oZ(t,(n=e.position,"before"===n?r:r+1),0,e.items)}let oQ=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);var o0=Object.freeze({__proto__:null,assign:function(e,t){if(!oX(t))throw TypeError('Cannot apply "assign()" on non-object value');return!function(e){for(let t in e)if(oQ(e,t))return!1;return!0}(e.value)?{...t,...e.value}:t},dec:function(e,t){if("number"!=typeof t)throw TypeError('Cannot apply "dec()" on non-numeric value');return t-e.amount},diffMatchPatch:function(e,t){if("string"!=typeof t)throw TypeError('Cannot apply "diffMatchPatch()" on non-string value');return function(e,t,n={}){if("string"==typeof e)throw Error("Patches must be an array - pass the patch to `parsePatch()` first");let r=t;if(0===e.length)return[r,[]];let i=function(e,t,n={}){let r=0,i=0;function o(e){for(;r<e;){let e=t.codePointAt(i);if(typeof e>"u")return i;r+=nY(e),e>
4065535?i+=2:i+=1}if(!n.allowExceedingIndices&&r!==e)throw Error("Failed to determine byte offset");return i}let s=[];for(let t of e)s.push({diffs:t.diffs.map(e=>nu(e)),start1:o(t.start1),start2:o(t.start2),utf8Start1:t.utf8Start1,utf8Start2:t.utf8Start2,length1:t.length1,length2:t.length2,utf8Length1:t.utf8Length1,utf8Length2:t.utf8Length2});return s}(e,r,{allowExceedingIndices:n.allowExceedingIndices}),o=n.margin||4,s=n.deleteThreshold||.4,a=function(e,t=4){let n="";for(let e=1;e<=t;e++)n+=String.fromCharCode(e);for(let n of e)n.start1+=t,n.start2+=t,n.utf8Start1+=t,n.utf8Start2+=t;let r=e[0],i=r.diffs;if(0===i.length||0!==i[0][0])i.unshift([0,n]),r.start1-=t,r.start2-=t,r.utf8Start1-=t,r.utf8Start2-=t,r.length1+=t,r.length2+=t,r.utf8Length1+=t,r.utf8Length2+=t;else if(t>i[0][1].length){let e=i[0][1].length,o=t-e;i[0][1]=n.substring(e)+i[0][1],r.start1-=o,r.start2-=o,r.utf8Start1-=o,r.utf8Start2-=o,r.length1+=o,r.length2+=o,r.utf8Length1+=o,r.utf8Length2+=o}if(0===(i=(r=e[e.length-1]).diffs).length||0!==i[i.length-1][0])i.push([0,n]),r.length1+=t,r.length2+=t,r.utf8Length1+=t,r.utf8Length2+=t;else if(t>i[i.length-1][1].length){let e=t-i[i.length-1][1].length;i[i.length-1][1]+=n.substring(0,e),r.length1+=e,r.length2+=e,r.utf8Length1+=e,r.utf8Length2+=e}return n}(i,o);r=a+r+a,function(e,t=4){for(let n=0;n<e.length;n++){if(e[n].length1<=32)continue;let r=e[n];e.splice(n--,1);let i=r.start1,o=r.start2,s="";for(;0!==r.diffs.length;){let a=nq(i-s.length,o-s.length),l=!0;if(""!==s){let e=nW(s);a.length1=s.length,a.utf8Length1=e,a.length2=s.length,a.utf8Length2=e,a.diffs.push([0,s])}for(;0!==r.diffs.length&&a.length1<32-t;){let e=r.diffs[0][0],n=r.diffs[0][1],s=nW(n);if(1===e){a.length2+=n.length,a.utf8Length2+=s,o+=n.length;let e=r.diffs.shift();e&&a.diffs.push(e),l=!1}else -1===e&&1===a.diffs.length&&0===a.diffs[0][0]&&n.length>64?(a.length1+=n.length,a.utf8Length1+=s,i+=n.length,l=!1,a.diffs.push([e,n]),r.diffs.shift()):(s=nW(n=n.substring(0,32-a.length1-t)),a.length1+=n.length,a.utf8Length1+=s,i+=n.length,0===e?(a.length2+=n.length,a.utf8Length2+=s,o+=n.length):l=!1,a.diffs.push([e,n]),n===r.diffs[0][1]?r.diffs.shift():r.diffs[0][1]=r.diffs[0][1].substring(n.length))}s=(s=nU(a.diffs)).substring(s.length-t);let u=nN(r.diffs).substring(0,t),c=nW(u);""!==u&&(a.length1+=u.length,a.length2+=u.length,a.utf8Length1+=c,a.utf8Length2+=c,0!==a.diffs.length&&0===a.diffs[a.diffs.length-1][0]?a.diffs[a.diffs.length-1][1]+=u:a.diffs.push([0,u])),l||e.splice(++n,0,a)}}}(i,o);let l=0,u=[];for(let e=0;e<i.length;e++){let t=i[e].start2+l,n=nN(i[e].diffs),o,a=-1;if(n.length>32?-1!==(o=nB(r,n.substring(0,32),t))&&(-1===(a=nB(r,n.substring(n.length-32),t+n.length-32))||o>=a)&&(o=-1):o=nB(r,n,t),-1===o)u[e]=!1,l-=i[e].length2-i[e].length1;else{let c;if(u[e]=!0,l=o-t,c=-1===a?r.substring(o,o+n.length):r.substring(o,a+32),n===c)r=r.substring(0,o)+nU(i[e].diffs)+r.substring(o+n.length);else{let t=nw(n,c,{checkLines:!1});if(n.length>32&&function(e){let t=0,n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i][0],s=e[i][1];switch(o){case 1:n+=s.length;break;case -1:r+=s.length;break;case 0:t+=Math.max(n,r),n=0,r=0;break;default:throw Error("Unknown diff operation.")}}return t+Math.max(n,r)}(t)/n.length>s)u[e]=!1;else{t=nI(t);let n=0,s=0;for(let a=0;a<i[e].diffs.length;a++){let l=i[e].diffs[a];0!==l[0]&&(s=nH(t,n)),1===l[0]?r=r.substring(0,o+s)+l[1]+r.substring(o+s):-1===l[0]&&(r=r.substring(0,o+s)+r.substring(o+nH(t,n+l[1].length))),-1!==l[0]&&(n+=l[1].length)}}}}}return[r=r.substring(a.length,r.length-a.length),u]}(function(e){if(!e)return[];let t=[],n=e.split(`
41`),r=0;for(;r<n.length;){let e=n[r].match(n3);if(!e)throw Error(`Invalid patch string: ${n[r]}`);let i=nq(n4(e[1]),n4(e[3]));for(t.push(i),""===e[2]?(i.start1--,i.utf8Start1--,i.length1=1,i.utf8Length1=1):"0"===e[2]?(i.length1=0,i.utf8Length1=0):(i.start1--,i.utf8Start1--,i.utf8Length1=n4(e[2]),i.length1=i.utf8Length1),""===e[4]?(i.start2--,i.utf8Start2--,i.length2=1,i.utf8Length2=1):"0"===e[4]?(i.length2=0,i.utf8Length2=0):(i.start2--,i.utf8Start2--,i.utf8Length2=n4(e[4]),i.length2=i.utf8Length2),r++;r<n.length;){let e,t=n[r],o=t.charAt(0);if("@"===o)break;if(""===o){r++;continue}try{e=decodeURI(t.slice(1))}catch(e){throw Error(`Illegal escape in parse: ${t}`)}let s=nW(e)-e.length;if("-"===o)i.diffs.push([-1,e]),i.length1-=s;else if("+"===o)i.diffs.push([1,e]),i.length2-=s;else if(" "===o)i.diffs.push([0,e]),i.length1-=s,i.length2-=s;else throw Error(`Invalid patch mode "${o}" in: ${e}`);r++}}return t}(e.value),t)[0]},inc:function(e,t){if("number"!=typeof t)throw TypeError('Cannot apply "inc()" on non-numeric value');return t+e.amount},insert:oJ,remove:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "remove()" on non-array value');let n=oK(t,e.referenceItem);if(null===n)throw Error("Found no matching array element to replace");return oZ(t,n,1,[])},replace:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "replace()" on non-array value');let n=oK(t,e.referenceItem);if(null===n)throw Error("Found no matching array element to replace");return oZ(t,n,e.items.length,e.items)},set:function(e,t){return e.value},setIfMissing:function(e,t){return t??e.value},truncate:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "truncate()" on non-array value');return"number"==typeof e.endIndex?t.slice(0,e.startIndex).concat(t.slice(e.endIndex)):t.slice(0,e.startIndex)},unassign:function(e,t){if(!oX(t))throw TypeError('Cannot apply "unassign()" on non-object value');return 0===e.keys.length?t:function(e,t){let n={...e};for(let e of t)delete n[e];return n}(t,e.keys)},unset:function(e){},upsert:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "upsert()" on non-array value');
41if(0===e.items.length)return t;let n=[],r=[];if(e.items.forEach((e,i)=>{let o=t.findIndex(t=>t?._key===e._key);o>=0?n[o]=i:r.push(e)}),0===n.length&&0==r.length)return t;let i=[...t];for(let t of n)i[t]=e.items[n[t]];return oJ({type:"insert",items:r,referenceItem:e.referenceItem,position:e.position},i)}});function o1(e,t){return e.reduce((e,t)=>o2(t,e),t)}function o2(e,t){return function e(t,n,r){if(!(t.length>0)){if(!(n.type in o0))throw Error(`Invalid operation type: "${n.type}"`);return o0[n.type](n,r)}let[i,...o]=t;if(oW(i)&&Array.isArray(r)){var s=i,a=o,l=n,u=r;let t=oK(u,s);if(null===t||-1===t)return u;let c=u[t],d=e(a,l,c);return d===c?u:oZ(u,t,1,[d])}if("string"==typeof i&&oX(r)){var c=i,d=o,h=n,f=r;let t=f[c];if(void 0===t&&d.length>0)return f;let s=e(d,h,t);return s===t?f:{...f,[c]:s}}throw Error(`Cannot apply operation of type "${n.type}" to path ${oG(t)} on ${typeof r} value`)}(e.path,e.op,t)}function o5(e){return"_id"in e}function o3(e,t){return t.reduce((e,t)=>{let n=o4(e,t);if("error"===n.status)throw Error(n.message);return"noop"===n.status?e:n.after},e)}function o4(e,t){if("create"===t.type)return function(e,t){var n;if(e)return{status:"error",message:"Document already exist"};let r=(n=t.document,o5(n)?n:{...n,_id:oN()});return{status:"created",id:r._id,after:r}}(e,t);if("createIfNotExists"===t.type){return n=e,o5((r=t).document)?n?{status:"noop"}:{status:"created",id:r.document._id,after:r.document}:{status:"error",message:"Cannot createIfNotExists on document without _id"}}if("delete"===t.type){return i=e,o=t,i?o.id!==i._id?{status:"error",message:"Delete mutation targeted wrong document"}:{status:"deleted",id:o.id,before:i,after:void 0}:{status:"noop"}}if("createOrReplace"===t.type){return s=e,o5((a=t).document)?s?{status:"updated",id:a.document._id,before:s,after:a.document}:{status:"created",id:a.document._id,after:a.document}:{status:"error",message:"Cannot createIfNotExists on document without _id"}}if("patch"===t.type){var n,r,i,o,s,a,l=e,u=t;if(!l)return{status:"error",message:"Cannot apply patch on nonexistent document"};let c=function(e,t){if(e.options?.ifRevision&&t._rev!==e.options.ifRevision)throw Error("Revision mismatch");if(e.id!==t._id)throw Error(`Document id mismatch. Refusing to apply mutation for document with id="${e.id}" on the given document with id="${t._id}"`);return o1(e.patches,t)}(u,l);return l===c?{status:"noop"}:{status:"updated",id:u.id,before:l,after:c}}throw Error(`Invalid mutation type: ${t.type}`)}function o6(e,t,n){let r=[];for(let n of e.slice().reverse()){if(t(n))return r;r.push(n)}return r.reverse()}function o9(e,t){return oG(e)===oG(t)}function o8(e,t){let n=e;return t.reduce((e,t)=>{let r=n;if(n=o2(t,n),"set"===t.op.type&&"string"==typeof t.op.value){let n=oY(t.path,r);if("string"==typeof n){let r={...t,op:{type:"diffMatchPatch",value:(function(e,t,n){if("string"==typeof e&&"string"==typeof t){let n=nw(e,t,{checkLines:!0});return n.length>2&&(n=function(e,t=4){let n=e.map(e=>nu(e)),r=!1,i=[],o=0,s=null,a=0,l=!1,u=!1,c=!1,d=!1;for(;a<n.length;)0===n[a][0]?(n[a][1].length<t&&(c||d)?(i[o++]=a,l=c,u=d,s=n[a][1]):(o=0,s=null),c=!1,d=!1):(-1===n[a][0]?d=!0:c=!0,s&&(l&&u&&c&&d||s.length<t/2&&3===function(...e){return e.reduce((e,t)=>e+ +!!t,0)}(l,u,c,d))&&(n.splice(i[o-1],0,[-1,s]),n[i[o-1]+1][0]=1,o--,s=null,l&&u?(c=!0,d=!0,o=0):(a=--o>0?i[o-1]:-1,c=!1,d=!1),r=!0)),a++;return r&&(n=nO(n)),n}(n=nj(n))),n2(e,n,n1(void 0))}if(e&&Array.isArray(e)&&typeof t>"u")return n2(nN(e),e,n1(void 0));if("string"==typeof e&&t&&Array.isArray(t))return n2(e,t,n1(n));throw Error("Unknown call format to make()")})(n,t.op.value).map(n6).join("")}};return e.flatMap(e=>o9(e.path,t.path)&&"diffMatchPatch"===e.op.type?[]:e).concat(r)}}return e.push(t),e},[])}function o7(e,t,n,r){let i=t,o=r.map(t=>{let n=t.mutations.flatMap(t=>{if(oB(t)!==e)return[];let n=i;return i=o3(i,[t]),n&&"patch"===t.type?{type:"dmpified",mutation:{...t,dmpPatches:o8(n,t.patches),original:t.patches}}:t});return{...t,mutations:n}}),s=n;return o.map(t=>{let n=[];return t.mutations.forEach(t=>{if("dmpified"===t.type)try{s=o1(t.mutation.dmpPatches,s),n.push(t)}catch{console.warn("Failed to apply dmp patch, falling back to original");try{s=o1(t.mutation.original,s),n.push(t)}catch(t){throw Error(`Failed to apply patch for document "${e}": ${t.message}`)}}else s=o3(s,[t])})}),[r.map(t=>({...t,mutations:t.mutations.map(t=>"patch"!==t.type||oB(t)!==e?t:{...t,patches:t.patches.map(e=>"set"!==e.op.type?e:{...e,op:{...e.op,value:oY(e.path,s)}})})})),s]}function se(e){var t=e;if("create"===t.type||"createIfNotExists"===t.type||"createOrReplace"===t.type)return{[t.type]:t.document};
41if("delete"===t.type)return{delete:{id:t.id}};let n=t.options?.ifRevision;return t.patches.map(e=>({patch:{id:t.id,...n&&{ifRevisionID:n},...function(e){let{path:t,op:n}=e;if("unset"===n.type)return{unset:[oG(t)]};if("insert"===n.type)return{insert:{[n.position]:oG([...t,n.referenceItem]),items:n.items}};if("diffMatchPatch"===n.type)return{diffMatchPatch:{[oG(t)]:n.value}};if("inc"===n.type)return{inc:{[oG(t)]:n.amount}};if("dec"===n.type)return{dec:{[oG(t)]:n.amount}};if("set"===n.type||"setIfMissing"===n.type)return{[n.type]:{[oG(t)]:n.value}};if("truncate"===n.type){let e=[n.startIndex,"number"==typeof n.endIndex?n.endIndex:""].join(":");return{unset:[`${oG(t)}[${e}]`]}}if("upsert"===n.type)return{unset:n.items.map(e=>oG([...t,{_key:e._key}])),insert:{[n.position]:oG([...t,n.referenceItem]),items:n.items}};if("assign"===n.type)return{set:Object.fromEntries(Object.keys(n.value).map(e=>[oG(t.concat(e)),n.value[e]]))};if("unassign"===n.type)return{unset:n.keys.map(e=>oG(t.concat(e)))};if("replace"===n.type)return{insert:{replace:oG(t.concat(n.referenceItem)),items:n.items}};if("remove"===n.type)return{unset:[oG(t.concat(n.referenceItem))]};throw Error(`Unknown operation type ${n.type}`)}(e)}}))}function st(e){var t,n,r,i,o,s,a,l;let u=e.listen('*[!(_id in path("_.**"))]',{},{events:["welcome","mutation","reconnect"],includeResult:!1,includePreviousRevision:!1,visibility:"transaction",effectFormat:"mendoza",includeMutations:!1}).pipe(ok({resetOnRefCountZero:!0})),c=u.pipe((0,oE.p)(e=>"reconnect"===e.type)),d=u.pipe((0,oE.p)(e=>"welcome"===e.type)),h=u.pipe((0,oE.p)(e=>"mutation"===e.type)),f=nl(d,c).pipe((l=!1,t={bufferSize:1,refCount:!0},a=void 0===(i=t.bufferSize)?1/0:i,n=void 0===(o=t.windowTime)?1/0:o,l=void 0!==(s=t.refCount)&&s,r=t.scheduler,ok({connector:function(){return new tZ(a,n,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:l}))).pipe((0,oE.p)(e=>"welcome"===e.type));return nl(f,h,c)}let sn=(0,oz.mj)({types:{},actions:{"assign error to context":(0,oF.a)({error:({event:e})=>e}),"clear error from context":(0,oF.a)({error:void 0}),"connect to server-sent events":(0,tB.O)({type:"connect"}),"listen to server-sent events":(0,tB.P)("server-sent events",{id:"listener",input:({context:e})=>({listener:e.sharedListener||st(e.client),id:e.id})}),"stop listening to server-sent events":(0,tB.R)("listener"),"buffer remote mutation events":(0,oF.a)({mutationEvents:({event:e,context:t})=>((0,oz.DT)(e,"mutation"),[...t.mutationEvents,e])}),"restore stashed changes":(0,oF.a)({stagedChanges:({event:e,context:t})=>((0,oz.DT)(e,"xstate.done.actor.submitTransactions"),t.stashedChanges),stashedChanges:[]}),"rebase fetched remote snapshot":(0,oF.b)(({enqueue:e})=>{e.assign(({event:e,context:t})=>{(0,oz.DT)(e,"xstate.done.actor.getDocument");let n=t.remote,r=e.output,i=!1;for(let e of t.mutationEvents)e.effects?.apply&&(e.previousRev||"appear"===e.transition)&&(i||e.previousRev!==r?._rev||(i=!0),i&&(r=sr(r,e.effects.apply,e.resultRev)));t.cache&&(!t.cache.has(t.id)||t.cache.get(t.id)._rev!==r?._rev)&&t.cache.set(t.id,r);let[o,s]=o7(t.id,null===n?void 0:n,null===r?void 0:r,t.stagedChanges);return{remote:r,local:s,stagedChanges:o,mutationEvents:[]}}),e.sendParent(({context:e})=>({type:"rebased.remote",id:e.id,document:e.remote}))}),"apply mendoza patch":(0,oF.a)(({event:e,context:t})=>{(0,oz.DT)(e,"mutation");let n=t.remote;if(e.transactionId===n?._rev)return{};let r=sr(n,e.effects.apply,e.resultRev);t.cache&&(!t.cache.has(t.id)||t.cache.get(t.id)._rev!==r?._rev)&&t.cache.set(t.id,r);let[i,o]=o7(t.id,null===n?void 0:n,null===r?void 0:r,t.stagedChanges);return{remote:r,local:o,stagedChanges:i}}),"increment fetch attempts":(0,oF.a)({fetchRemoteSnapshotAttempts:({context:e})=>e.fetchRemoteSnapshotAttempts+1}),"reset fetch attempts":(0,oF.a)({fetchRemoteSnapshotAttempts:0}),"increment submit attempts":(0,oF.a)({submitTransactionsAttempts:({context:e})=>e.submitTransactionsAttempts+1}),"reset submit attempts":(0,oF.a)({submitTransactionsAttempts:0}),"stage mutation":(0,oF.a)({stagedChanges:({event:e,context:t})=>((0,oz.DT)(e,"mutate"),[...t.stagedChanges,{transaction:!1,mutations:e.mutations}])}),"stash mutation":(0,oF.a)({stashedChanges:({event:e,context:t})=>((0,oz.DT)(e,"mutate"),[...t.stashedChanges,{transaction:!1,mutations:e.mutations}])}),"rebase local snapshot":(0,oF.b)(({enqueue:e})=>{e.assign({local:({event:e,context:t})=>{(0,oz.DT)(e,"mutate");let n=new Map;
41return t.local&&n.set(t.id,t.local),function(e,t){e.forEach(e=>{("created"===e.status||"updated"===e.status)&&t.set(e.id,e.after),"deleted"===e.status&&t.delete(e.id)})}(function(e,t){let n=Object.create(null);for(let r of e){let e=oB(r);if(!e)throw Error("Unable to get document id from mutation");let i=n[e]?.after||t.get(e),o=o4(i,r);if("error"===o.status)throw Error(o.message);"noop"!==o.status&&("updated"===o.status||"created"===o.status||"deleted"===o.status)&&(e in n||(n[e]={before:i,after:void 0,muts:[]}),n[e].after=o.after)}return Object.entries(n).map(([e,{before:t,after:n,muts:r}])=>({id:e,status:n?t?"updated":"created":"deleted",mutations:r,before:t,after:n}))}(e.mutations,n),n),n.get(t.id)}}),e.sendParent(({context:e})=>({type:"rebased.local",id:e.id,document:e.local}))}),"send pristine event to parent":(0,oF.s)(({context:e})=>({type:"pristine",id:e.id})),"send sync event to parent":(0,oF.s)(({context:e})=>({type:"sync",id:e.id,document:e.remote})),"send mutation event to parent":(0,oF.s)(({context:e,event:t})=>((0,oz.DT)(t,"mutation"),{type:"mutation",id:e.id,previousRev:t.previousRev,resultRev:t.resultRev,effects:t.effects}))},actors:{"server-sent events":(0,q.OX)(({input:e})=>{let{listener:t,id:n}=e;return(0,oT.v)(()=>t).pipe((0,oE.p)(e=>"welcome"===e.type||"reconnect"===e.type||"mutation"===e.type&&e.documentId===n),t9(o$))}),"fetch remote snapshot":(0,q.Sx)(async({input:e,signal:t})=>{let{client:n,id:r}=e;return await n.getDocument(r,{signal:t}).catch(e=>{if(!(e instanceof Error&&"AbortError"===e.name))throw e})}),"submit mutations as transactions":(0,q.Sx)(async({input:e,signal:t})=>{let{client:n,transactions:r}=e;for(let e of r){if(t.aborted)return;await n.dataRequest("mutate",function(e){return{transactionId:e.id,mutations:e.mutations.flatMap(se)}}(e),{visibility:"async",returnDocuments:!1,signal:t}).catch(e=>{if(!(e instanceof Error&&"AbortError"===e.name))throw e})}})},delays:{fetchRemoteSnapshotTimeout:({context:e})=>1e3*Math.pow(2,e.fetchRemoteSnapshotAttempts),submitTransactionsTimeout:({context:e})=>1e3*Math.pow(2,e.submitTransactionsAttempts)}}).createMachine({id:"document-mutator",context:({input:e})=>({client:e.client.withConfig({allowReconfigure:!1}),sharedListener:e.sharedListener,id:e.id,remote:void 0,local:void 0,mutationEvents:[],stagedChanges:[],stashedChanges:[],error:void 0,fetchRemoteSnapshotAttempts:0,submitTransactionsAttempts:0,cache:e.cache}),entry:["connect to server-sent events"],on:{mutate:{actions:["rebase local snapshot","stage mutation"]}},initial:"disconnected",states:{disconnected:{on:{connect:{target:"connecting",actions:["listen to server-sent events"]}}},connecting:{on:{welcome:"connected",reconnect:"reconnecting",error:"connectFailure"},tags:["busy"]},connectFailure:{on:{connect:{target:"connecting",actions:["listen to server-sent events"]}},entry:["stop listening to server-sent events","assign error to context"],exit:["clear error from context"],tags:["error"]},reconnecting:{on:{welcome:{target:"connected"},error:{target:"connectFailure"}},tags:["busy","error"]},connected:{on:{mutation:{actions:["buffer remote mutation events"]},reconnect:"reconnecting"},entry:["clear error from context"],initial:"loading",states:{loading:{invoke:{src:"fetch remote snapshot",id:"getDocument",input:({context:e})=>({client:e.client,id:e.id}),onError:{target:"loadFailure"},onDone:{target:"loaded",actions:["rebase fetched remote snapshot","reset fetch attempts"]}},tags:["busy"]},loaded:{entry:["send sync event to parent"],on:{mutation:{actions:["apply mendoza patch","send mutation event to parent"]}},initial:"pristine",states:{pristine:{on:{mutate:{actions:["rebase local snapshot","stage mutation"],target:"dirty"}},tags:["ready"]},dirty:{on:{submit:"submitting"},tags:["ready"]},submitting:{on:{mutate:{actions:["rebase local snapshot","stash mutation"]}},invoke:{src:"submit mutations as transactions",id:"submitTransactions",input:({context:e})=>{let t=new Map;return t.set(e.id,e.remote),{client:e.client,transactions:(function(e,t){let n=[],r=[];return e.forEach(e=>{t(e)?r.push(e):(r.length>0&&n.push(r),r=[],n.push([e]))}),r.length>0&&n.push(r),n})(e.stagedChanges,e=>!e.transaction).flatMap(e=>({...e[0],mutations:e.flatMap(e=>e.mutations)})).map(e=>({...e,mutations:Object.values(om(e.mutations,oB)).flatMap(e=>{var t,n;return(0===(n=0===(t=e).length?t:t.reduce((e,t)=>
41"delete"===t.type?[t]:(e.push(t),e),[])).length?n:n.reduce((e,t)=>("createIfNotExists"!==t.type?e.push(t):o6(e,e=>"delete"===e.type).find(e=>"createIfNotExists"===e.type)||e.push(t),e),[])).flat().reduce((e,t)=>{let n=e[e.length-1];return n&&"patch"!==n.type||"patch"!==t.type?e.concat(t):e.slice(0,-1).concat({...t,patches:(n?.patches||[]).concat(t.patches)})},[])})})).map(e=>({...e,mutations:e.mutations.map(e=>"patch"!==e.type?e:{...e,patches:e.patches.reduce((e,t)=>{if("unset"!==t.op.type)return e.push(t),e;let n=e.filter(e=>{var n,r;return n=t.path,r=e.path,!(n.length<=r.length&&n.every((e,t)=>{var n,i;return n=e,i=function(e,t){if(t<0||t>=e.length)throw Error("Index out of bounds");return e[t]}(r,t),oU(n)&&oU(i)?n._key===i._key:"number"==typeof n?Number(n)===Number(i):n===i}))});return n.push(t),n},[]).reduceRight((e,t)=>(e.find(e=>{var n,r;return n=e.op,("set"===(r=t.op).type||"unset"===r.type)&&("set"===n.type||"unset"===n.type)&&o9(e.path,t.path)})||e.unshift(t),e),[]).reduce((e,t)=>("setIfMissing"!==t.op.type?e.push(t):o6(e,e=>"unset"===e.op.type).find(e=>"setIfMissing"===e.op.type&&o9(e.path,t.path))||e.push(t),e),[])})})).map(e=>{var n;return{...e,mutations:(n=t,e.mutations.map((e,t)=>{var r,i;return"patch"===e.type?(r=n.get(e.id),i=e,r?{...i,patches:o8(r,i.patches)}:i):e}))}}).map(e=>e.transaction&&void 0!==e.id?{id:e.id,mutations:e.mutations}:{mutations:e.mutations})}},onError:{target:"submitFailure"},onDone:{target:"pristine",actions:["restore stashed changes","reset submit attempts","send pristine event to parent"]}},tags:["busy","ready"]},submitFailure:{exit:["clear error from context"],after:{submitTransactionsTimeout:{actions:["increment submit attempts"],target:"submitting"}},on:{retry:"submitting"},tags:["error","ready"]}}},loadFailure:{exit:["clear error from context"],after:{fetchRemoteSnapshotTimeout:{actions:["increment fetch attempts"],target:"loading"}},on:{retry:"loading"},tags:["error"]}}}}});function sr(e,t,n){var r;let i=(r=function(e){if(!e)return null;let{_rev:t,...n}=e;return n}(e),new oy(new ox,r,t).process());return i?Object.assign(i,{_rev:n}):null}let si=(0,oz.mj)({types:{},actions:{"emit sync event":(0,oF.e)(({event:e})=>((0,oz.DT)(e,"sync"),e)),"emit mutation event":(0,oF.e)(({event:e})=>((0,oz.DT)(e,"mutation"),e)),"emit rebased event":(0,oF.e)(({event:e})=>((0,oz.DT)(e,["rebased.local","rebased.remote"]),e)),"emit pristine event":(0,oF.e)(({event:e})=>((0,oz.DT)(e,["pristine"]),e)),"add document actor":(0,oF.a)({documents:({context:e,event:t,spawn:n})=>{(0,oz.DT)(t,"observe");let r=t.documentId;return e.documents[r]?e.documents:{...e.documents,[r]:n("documentMutatorMachine",{input
41:{id:r,client:e.client,sharedListener:e.sharedListener||st(e.client)},id:r})}}}),"stop remote snapshot":(0,tB.R)(({context:e,event:t})=>((0,oz.DT)(t,"unobserve"),e.documents[t.documentId])),"remove remote snapshot from context":(0,oF.a)({documents:({context:e,event:t})=>{if((0,oz.DT)(t,"unobserve"),!e.documents[t.documentId])return e.documents;let{[t.documentId]:n,...r}=e.documents;return r}})},actors:{documentMutatorMachine:sn}}).createMachine({id:"dataset-mutator",context:({input:e})=>({documents:{},client:e.client,sharedListener:e.sharedListener}),on:{sync:{actions:["emit sync event"]},mutation:{actions:["emit mutation event"]},"rebased.*":{actions:["emit rebased event"]},pristine:{actions:["emit pristine event"]},observe:{actions:["add document actor"]},unobserve:{actions:["stop remote snapshot","remove remote snapshot from context"]}},initial:"pristine",states:{pristine:{}}}),so=e=>{let t,n,r,i,o=(0,h.c)(8),{comlink:s,history:a}=e;return o[0]!==s||o[1]!==a?(t=()=>s?.on("presentation/navigate",e=>{a?.update(e)}),n=[s,a],o[0]=s,o[1]=a,o[2]=t,o[3]=n):(t=o[2],n=o[3]),(0,c.useEffect)(t,n),o[4]!==s||o[5]!==a?(r=()=>{if(a)return a.subscribe(e=>{e.title=e.title||document.title,s?.post("visual-editing/navigate",e)})},i=[s,a],o[4]=s,o[5]=a,o[6]=r,o[7]=i):(r=o[6],i=o[7]),(0,c.useEffect)(r,i),null},ss=e=>{let t,n,r=(0,h.c)(3),{comlink:i}=e;return r[0]!==i?(t=()=>{let e=()=>{i.post("visual-editing/meta",{title:document.title})},t=new MutationObserver(t=>{let[n]=t;"TITLE"===n.target.nodeName&&e()});return t.observe(document.head,{subtree:!0,characterData:!0,childList:!0}),e(),()=>t.disconnect()},n=[i],r[0]=i,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,c.useEffect)(t,n),null};function sa(e){let t=new CustomEvent("sanity/dragEnd",{detail:e,cancelable:!0});window.dispatchEvent(t)}let sl=(0,c.createContext)(null);function su(){let e=(0,c.useContext)(sl);if(!e)throw Error("Schema context is missing");return e}function sc(e,t,n,r){if(!e.type)throw Error("Node type is missing");return()=>t.patch(()=>(function(e,t,n){let{path:r,key:i}=ep(e);return[Y(r,U([{_type:t,_key:ef()}],n,{_key:i}))]})(e,n,r))}function sd(e){let{node:t,doc:n}=e;return n?[{type:"action",label:"Duplicate",icon:ti.TdU,action:function(e,t){if(!e.type)throw Error("Node type is missing");return()=>t.patch(async({getSnapshot:t})=>(function(e,t,n="after"){let{path:r,key:i}=ep(e);return[Y(r,U({...er(t,e.path),_key:ef()},n,{_key:i}))]})(e,await t()))}(t,n),telemetryEvent:"Visual Editing Context Menu Item Duplicated"}]:[]}function sh(e){let{node:t,doc:n}=e;return n?[{type:"action",label:"Remove",icon:ti.YPx,action:function(e,t){if(!e.type)throw Error("Node type is missing");return()=>t.patch(async({getSnapshot:t})=>(function(e,t){let{path:n,key:r}=ep(e),i=er(t,n).findIndex(e=>e._key===r);return[Y(n,H(i,i+1))]})(e,await t()))}(t,n),telemetryEvent:"Visual Editing Context Menu Item Removed"}]:[]}async function sf(e,t=!0){let{node:n,doc:r}=e;if(!r)return[];let i=[],o=[],[s,a,l,u]=await Promise.all([em(n,r,"previous"),em(n,r,"next"),em(n,r,"first"),em(n,r,"last")]);return l.length&&o.push({type:"action",label:"To top",icon:ti.VQ$,action:()=>r.patch(l),telemetryEvent:"Visual Editing Context Menu Item Moved"}),s.length&&o.push({type:"action",label:"Up",icon:ti.Kpk,action:()=>r.patch(s),telemetryEvent:"Visual Editing Context Menu Item Moved"}),a.length&&o.push({type:"action",label:"Down",icon:ti.ZLN,action:()=>r.patch(a),telemetryEvent:"Visual Editing Context Menu Item Moved"}),u.length&&o.push({type:"action",label:"To bottom",icon:ti.wvk,action:()=>r.patch(u),telemetryEvent:"Visual Editing Context Menu Item Moved"}),o.length&&(i.push({type:"group",label:"Move",icon:ti.ycB,items:o}),t&&i.push({type:"divider"})),i}async function sp(e){let{node:t,field:n,doc:r}=e,i=[];return i.push(...sd(e)),i.push(...sh(e)),i.push(...await sf(e)),i.push({type:"action",label:"Insert before",icon:ti.SKY,action:sc(t,r,n.name,"before"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}),i.push({type:"action",label:"Insert after",icon:ti.amD,action:sc(t,r,n.name,"after"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}),i}let sm=e=>{let t,n,r,i,o,s=(0,h.c)(12),{label:a,parent:l,width:c,onSelect:d,boundaryElement:f}=e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(t=["left-start","right","left","right-end","left-end","bottom","top"],s[0]=t):t=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(n=[4,4,4,4],s[1]=n):n=s[1],s[2]!==f||s[3]!==c?(r={arrow:!1,constrainSize:!0,floatingBoundary:f,padding:0,placement:"right-start",fallbackPlacements:t,preventOverflow:!0,width:c,__unstable_margins:n},s[2]=f,s[3]=c,s[4]=r):r=s[4],s[5]!==d||s[6]!==l?(i=(0,u.jsx)(tP,{node:l,onSelect:d}),s[5]=d,s[6]=l,s[7]=i):i=s[7],s[8]!==a||s[9]!==r||s[10]!==i?(o=(0,u.jsx)(P.rX,{fontSize:1,icon:ti.amD,padding:2,popover:r,space
41:2,text:a,children:i}),s[8]=a,s[9]=r,s[10]=i,s[11]=o):o=s[11],o};async function sg(e){let{doc:t,node:n,parent:r}=e,i=[];if(i.push(...sd(e)),i.push(...sh(e)),i.push(...await sf(e)),r.options?.insertMenu){let e=(r.options.insertMenu||{}).views?.some(e=>"grid"===e.name)?0:void 0;i.push({type:"custom",component:({boundaryElement:i,sendTelemetry:o})=>(0,u.jsx)(sm,{label:"Insert before",onSelect:e=>{sc(n,t,e.name,"before")(),o("Visual Editing Context Menu Item Inserted",null)},parent:r,width:e,boundaryElement:i})}),i.push({type:"custom",component:({boundaryElement:i,sendTelemetry:o})=>(0,u.jsx)(sm,{label:"Insert after",onSelect:e=>{sc(n,t,e.name,"after")(),o("Visual Editing Context Menu Item Inserted",null)},parent:r,width:e,boundaryElement:i})})}else i.push({type:"group",label:"Insert before",icon:ti.SKY,items:r.of.filter(e=>"unionOption"===e.type).map(e=>({type:"action",icon:tx(e),label:"block"===e.name?"Paragraph":e.title||e.name,action:sc(n,t,e.name,"before"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}))}),i.push({type:"group",label:"Insert after",icon:ti.amD,items:r.of.filter(e=>"unionOption"===e.type).map(e=>({type:"action",label:"block"===e.name?"Paragraph":e.title||e.name,icon:tx(e),action:sc(n,t,e.name,"after"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}))});return i}let sy=[-4,4,-4,4];function sv(e){let t,n=(0,h.c)(27),{node:r,onDismiss:i,boundaryElement:o}=e,s=tM();n[0]!==r||n[1]!==i||n[2]!==s?(t=()=>{"action"===r.type&&(r.action?.(),i?.(),r.telemetryEvent&&s(r.telemetryEvent,null))},n[0]=r,n[1]=i,n[2]=s,n[3]=t):t=n[3];let a=t;if("divider"===r.type){let e;return n[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,u.jsx)(P.Nj,{}),n[4]=e):e=n[4],e}if("action"===r.type){let e,t=!r.action;return n[5]!==r.hotkeys||n[6]!==r.icon||n[7]!==r.label||n[8]!==a||n[9]!==t?(e=(0,u.jsx)(P.Dr,{fontSize:1,hotkeys:r.hotkeys,icon:r.icon,padding:2,space:2,text:r.label,disabled:t,onClick:a}),n[5]=r.hotkeys,n[6]=r.icon,n[7]=r.label,n[8]=a,n[9]=t,n[10]=e):e=n[10],e}if("group"===r.type){let e,t,s,a=r.icon;n[11]===Symbol.for("react.memo_cache_sentinel")?(e={arrow:!1,constrainSize:!0,placement:"right-start",fallbackPlacements:["left-start","right","left","right-end","left-end","bottom","top"],preventOverflow:!0,__unstable_margins:sy},n[11]=e):e=n[11];let l=r.label;if(n[12]!==o||n[13]!==r.items||n[14]!==i){let e;n[16]!==o||n[17]!==i?(e=(e,t)=>(0,u.jsx)(sv,{node:e,onDismiss:i,boundaryElement:o},t),n[16]=o,n[17]=i,n[18]=e):e=n[18],t=r.items.map(e),n[12]=o,n[13]=r.items,n[14]=i,n[15]=t}else t=n[15];return n[19]!==r.icon||n[20]!==r.label||n[21]!==t?(s=(0,u.jsx)(P.rX,{fontSize:1,icon:a,padding:2,popover:e,space:2,text:l,children:t}),n[19]=r.icon,n[20]=r.label,n[21]=t,n[22]=s):s=n[22],s}if("custom"===r.type){let e,{component:t}=r;return n[23]!==t||n[24]!==o||n[25]!==s?(e=(0,u.jsx)(t,{boundaryElement:o,sendTelemetry:s}),n[23]=t,n[24]=o,n[25]=s,n[26]=e):e=n[26],e}return null}let sb=e=>{let t,n,r,i,o,s,a,l,d,f,p,m,g,y,v,b,x,w,k=(0,h.c)(43),{node:S,onDismiss:E,position:T}=e,{x:j,y:A}=T,[M,_]=(0,c.useState)(null),{getField:C}=su(),{getDocument:I}=ed();k[0]!==C||k[1]!==S?(t=C(S),k[0]=C,k[1]=S,k[2]=t):t=k[2];let{field:O,parent:R}=t;n=O?.title||O?.name||"Unknown type";let[V,L]=(0,c.useState)(void 0);k[3]!==O||k[4]!==I||k[5]!==S||k[6]!==R?(r=()=>{(async()=>{let e=I(S.id);e&&L(await function(e){let{node:t,field:n,parent:r,doc:i}=e;return n?.type==="arrayItem"?sp({node:t,field:n,doc:i}):r?.type==="union"?sg({node:t,parent:r,doc:i}):Promise.resolve([])}({node:S,field:O,parent:R,doc:e}))})()},i=[O,S,R,I],k[3]=O,k[4]=I,k[5]=S,k[6]=R,k[7]=r,k[8]=i):(r=k[7],i=k[8]),(0,c.useEffect)(r,i),k[9]!==j||k[10]!==A?(s={getBoundingClientRect:()=>({bottom:A,left:j,right:j,top:A,width:0,height:0})},k[9]=j,k[10]=A,k[11]=s):s=k[11],o=s,k[12]!==O?(l=tx(O),k[12]=O,k[13]=l):l=k[13],a=l,k[14]===Symbol.for("react.memo_cache_sentinel")?(d={minWidth:120,maxWidth:160},k[14]=d):d=k[14],k[15]!==a||k[16]!==V?(f=(0,u.jsx)(P.az,{flex:"none",children:V?(0,u.jsx)(P.EY,{size:1,children:a}):(0,u.jsx)(P.y$,{size:1})}),k[15]=a,k[16]=V,k[17]=f):f=k[17];let D=V?n:"Loading...";k[18]!==D?(p=(0,u.jsx)(P.BJ,{flex:1,space:2,children:(0,u.jsx)(P.EY,{size:1,weight:"semibold",children:D})}),k[18]=D,k[19]=p):p=k[19],k[20]!==f||k[21]!==p?(m=(0,u.jsxs)(P.so,{gap:2,padding:2,children:[f,p]}),k[20]=f,k[21]=p,k[22]=m):m=k[22],k[23]!==M||k[24]!==V||k[25]!==E?(g=V&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(P.Nj,{}),V.map((e,t)=>(0,u.jsx)(sv,{node:e,onDismiss:E,boundaryElement:M},t))]}),k[23]=M,k[24]=V,k[25]=E,k[26]=g):g=k[26],k[27]!==m||k[28]!==g?(y=(0,u.jsxs)(P.W1,{style:d,children:[m,g]}),k[27]=m,k[28]=g,k[29]=y):y=k[29];let $=`${j}-${A}`;return k[30]!==j||k[31]!==A?(v={position:"absolute",left:j,top:A},k[30]=j,k[31]=A,k[32]=v):v=k[32],k[33]!==$||k[34]!==v?(b=(0,u.jsx)("div",{style:v},$),k[33]=$,k[34]=v,k[35]=b):b=k[35],k[36]!==o||k[37]!==y||k[38]!==b?(x=(0,u.jsx)(P.AM,{__unstable_margins:sy,arrow:!1,open:!0,placement:"right-start",referenceElement:o,content:y,children:b}),k[36]=o,k[37]=y,k[38]=b,k[39]=x):x=k[39],k[40]!==E||k[41]!==x?(w=(0,u.jsx)(tS,{setBoundaryElement:_,onDismiss:E,children:x}),k[40]=E,k[41]=x,k[42]=w):w=k[42],w},sx=(0,c.createContext)(null),sw=(0,C.I4)(P.Zp)`
42  background-color: var(--overlay-bg);
43  border-radius: 3px;
44  pointer-events: none;
45  position: absolute;
46  will-change: transform;
47  box-shadow: var(--overlay-box-shadow);
48  transition: none;
49
50  --overlay-bg: transparent;
51  --overlay-box-shadow: inset 0 0 0 1px transparent;
52
53  [data-overlays] & {
54    --overlay-bg: color-mix(in srgb, transparent 95%, var(--card-focus-ring-color));
55    --overlay-box-shadow: inset 0 0 0 2px
56      color-mix(in srgb, transparent 50%, var(--card-focus-ring-color));
57  }
58
59  [data-fading-out] & {
60    transition:
61      box-shadow 1550ms,
62      background-color 1550ms;
63
64    --overlay-bg: rgba(0, 0, 255, 0);
65    --overlay-box-shadow: inset 0 0 0 1px transparent;
66  }
67
68  &[data-focused] {
69    --overlay-box-shadow: inset 0 0 0 1px var(--card-focus-ring-color);
70  }
71
72  &[data-hovered]:not([data-focused]) {
73    transition: none;
74    --overlay-box-shadow: inset 0 0 0 2px var(--card-focus-ring-color);
75  }
76
77  /* [data-unmounted] & {
78    --overlay-box-shadow: inset 0 0 0 1px var(--card-focus-ring-color);
79  } */
80
81  :link {
82    text-decoration: none;
83  }
84`,sk=(0,C.I4)(P.so)`
85  bottom: 100%;
86  cursor: pointer;
87  pointer-events: none;
88  position: absolute;
89  right: 0;
90
91  [data-hovered] & {
92    pointer-events: all;
93  }
94
95  [data-flipped] & {
96    bottom: auto;
97    top: 100%;
98  }
99`,sS=(0,C.I4)(P.so)`
100  bottom: 100%;
101  cursor: pointer;
102  pointer-events: none;
103  position: absolute;
104  left: 0;
105
106  [data-hovered] & {
107    pointer-events: all;
108  }
109
110  [data-flipped] & {
111    bottom: auto;
112    top: 100%;
113  }
114`,sE=(0,C.I4)(P.Zp)`
115  cursor: pointer;
116  background-color: var(--card-focus-ring-color);
117  right: 0;
118  border-radius: 3px;
119
120  & [data-ui='Text'] {
121    color: #fff;
122    white-space: nowrap;
123  }
124`,sT=(0,C.I4)(P.so)`
125  display: flex;
126  align-items: center;
127  background-color: var(--card-focus-ring-color);
128  right: 0;
129  border-radius: 3px;
130  & [data-ui='Text'],
131  & [data-sanity-icon] {
132    color: #fff;
133    white-space: nowrap;
134  }
135`,sj=e=>{let t,n,r,i,o,s,a,l,d,f,p=(0,h.c)(35),{element:m,focused:g,componentResolver:y,node:v,showActions:b,draggable:x}=e,{getField:k,getType:S}=su();p[0]!==S||p[1]!==v?(t=S(v),p[0]=S,p[1]=v,p[2]=t):t=p[2];let T=t;p[3]!==k||p[4]!==v?(n=k(v),p[3]=k,p[4]=v,p[5]=n):n=p[5];let{field:M,parent:C}=n;p[6]!==v?(r="path"in v?function(e){let{id:t,type:n,path:r,baseUrl:i,tool:o,workspace:s}=e;return function(e){let{baseUrl:t,workspace:n="default",tool:r="default",id:i,type:o,path:s,projectId:a,dataset:l}=e;if(!t)throw Error("baseUrl is required");if(!s)throw Error("path is required");if(!i)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let u="default"===n?void 0:n,c="default"===r?void 0:r,d=_(i),h=Array.isArray(s)?w(s.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})):s,f=new URLSearchParams({baseUrl:t,id:d,type:o,path:h});if(u&&f.set("workspace",u),c&&f.set("tool",c),a&&f.set("projectId",a),l&&f.set("dataset",l),j(i)||A(i)){if(A(i)){let e=function(e){if(!A(e))return;let[t,n,...r]=e.split(".");return n}(i);f.set("perspective",e)}}else f.set("perspective","published");let p=["/"===t?"":t];u&&p.push(u);let m=["mode=presentation",`id=${d}`,`type=${o}`,`path=${encodeURIComponent(h)}`];return c&&m.push(`tool=${c}`),p.push("intent","edit",`${m.join(";")}?${f}`),p.join("/")}({baseUrl:i,workspace:s,tool:o,type:n,id:t,path:function(e){let t="";for(let n of e){if("string"==typeof n){t&&(t+="."),t+=n;continue}if("number"==typeof n){t&&(t+=":"),t+=`${n}`;continue}if(null!==n&&Array.isArray(n)){t&&(t+=":"),t+=`${n.join(",")}}`;continue}if(n._key){t&&(t+=":"),t+=`${n._key}`;continue}}return t}(E.fromString(r))})}(v):v.href,p[6]=v,p[7]=r):r=p[7];let I=r,O=function(){let e=(0,c.useContext)(sx);if(!e)throw Error("Preview Snapshots context is missing");return e}();e:{let e;if(!("path"in v)){i=void 0;break e}p[8]!==v||p[9]!==O?(e=O.find(e=>e._id===v.id)?.title,p[8]=v,p[9]=O,p[10]=e):e=p[10],i=e}let R=i;t:{let e;if(!("path"in v)||!M||!T){o=void 0;break t}let t=M.value.type,n=!!g;p[11]!==m||p[12]!==M||p[13]!==v||p[14]!==C||p[15]!==T||p[16]!==n||p[17]!==t?(e={document:T,element:m,field:M,focused:n,node:v,parent:C,type:t},p[11]=m,p[12]=M,p[13]=v,p[14]=C,p[15]=T,p[16]=n,p[17]=t,p[18]=e):e=p[18],o=e}let V=o,L=function(e,t){let n,r=(0,h.c)(4);e:{let i;if(!e){n=void 0;break e}if(r[0]!==e||r[1]!==t){let o=t?.(e);if(!o){n=void 0;break e}if((0,c.isValidElement)(o)){n=o;break e}i=(Array.isArray(o)?o:[o]).map(sM),r[0]=e,r[1]=t,r[2]=i,r[3]=n}else i=r[2],n=r[3];n=i}return n}(V,y);p[19]!==T?(s=T?.icon?(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:T.icon}}):(0,u.jsx)(ti.pyG,{}),p[19]=T,p[20]=s):s=p[20];let D=s;return p[21]!==I||p[22]!==b?(a=b?(0,u.jsx)(sk,{gap:1,paddingY:1,"data-sanity-overlay-element":!0,children:(0,u.jsx)(s_,{href:I})}):null,p[21]=I,p[22]=b,p[23]=a):a=p[23],p[24]!==x||p[25]!==D||p[26]!==R?(l=R&&(0,u.jsx)(sS,{gap:1,paddingY:1,children:(0,u.jsxs)(sT,{gap:2,padding:2,children:[x&&(0,u.jsx)(P.az,{marginRight:1,children:(0,u.jsx)(P.EY,{className:"drag-handle",size:0,children:(0,u.jsx)(ti.GG1,{})})}),(0,u.jsx)(P.EY,{size:0,children:D}),(0,u.jsx)(P.EY,{size:1,weight:"medium",children:R})]})}),p[24]=x,p[25]=D,p[26]=R,p[27]=l):l=p[27],p[28]!==V||p[29]!==L?(d=Array.isArray(L)?L.map((e,t)=>{let{component:n,props:r}=e;return(0,u.jsx)(n,{PointerEvents:tO,...V,...r},t)}):L,p[28]=V,p[29]=L,p[30]=d):d=p[30],p[31]!==a||p[32]!==l||p[33]!==d?(f=(0,u.jsxs)(u.Fragment,{children:[a,l,d]}),p[31]=a,p[32]=l,p[33]=d,p[34]=f):f=p[34],f},sA=(0,c.memo)(function(e){let t,n,r,i,o,s,a,l,d=(0,h.c)(24),{draggable:f,focused:p,hovered:m,rect:g,wasMaybeCollapsed:y,enableScrollIntoView:v}=e,b=(0,c.useRef)(null),x=(0,c.useRef)(!1),w=`${g.w}px`,k=`${g.h}px`,S=`translate(${g.x}px, ${g.y}px)`;d[0]!==w||d[1]!==k||d[2]!==S?(n={width:w,height:k,transform:S},d[0]=w,d[1]=k,d[2]=S,d[3]=n):n=d[3],t=n,d[4]!==v||d[5]!==p||d[6]!==y?(r=()=>{if(!x.current&&!y&&!0===p&&b.current&&v){let e=b.current;!function(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||
1350,left:parseFloat(t.scrollMarginLeft)||0}})(e);if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(tz(e,t));let r="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:i,top:o,left:s}of tz(e,!1===t?{block:"end",inline:"nearest"}:t===Object(t)&&0!==Object.keys(t).length?t:{block:"start",inline:"nearest"})){let e=o-n.top+n.bottom,t=s-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}(b.current,{behavior:t=>{0!==t.length&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},scrollMode:"if-needed",block:"center",inline:"nearest"})}x.current=!0===p},i=[p,y,v],d[4]=v,d[5]=p,d[6]=y,d[7]=r,d[8]=i):(r=d[7],i=d[8]),(0,c.useEffect)(r,i);let[E,T]=(0,c.useState)(!1);d[9]!==m?(o=()=>{if(!b.current||!m)return;let e=new IntersectionObserver(e=>{let[t]=e;T(t.boundingClientRect.top<0)},{threshold:1});return e.observe(b.current),()=>e.disconnect()},d[9]=m,d[10]=o):o=d[10],d[11]!==m||d[12]!==E?(s=[m,E],d[11]=m,d[12]=E,d[13]=s):s=d[13],(0,c.useEffect)(o,s);let j=p?"":void 0,A=m?"":void 0,M=E?"":void 0,_=f?"":void 0;return d[14]!==m||d[15]!==e?(a=m&&(0,u.jsx)(sj,{...e}),d[14]=m,d[15]=e,d[16]=a):a=d[16],d[17]!==t||d[18]!==A||d[19]!==M||d[20]!==_||d[21]!==a||d[22]!==j?(l=(0,u.jsx)(sw,{"data-focused":j,"data-hovered":A,"data-flipped":M,"data-draggable":_,ref:b,style:t,children:a}),d[17]=t,d[18]=A,d[19]=M,d[20]=_,d[21]=a,d[22]=j,d[23]=l):l=d[23],l});function sM(e){return"object"==typeof e&&"component"in e?e:{component:e,props:{}}}let s_=(0,c.memo)(function(e){let t,n,r,i,o=(0,h.c)(6),s=(0,c.useSyncExternalStore)(sP,sC);return o[0]!==e.href||o[1]!==s?(n=function e(t,n){try{let r=new URL(t,typeof location>"u"?void 0:location.origin);if(r.hash){let t=new URL(e(r.hash.slice(1),n));return`${r.origin}${r.pathname}${r.search}#${t.pathname}${t.search}`}return r.searchParams.set("preview",n),r.toString()}catch{return t}}(e.href,s),o[0]=e.href,o[1]=s,o[2]=n):n=o[2],t=n,o[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,u.jsx)(sE,{padding:2,children:(0,u.jsx)(P.EY,{size:1,weight:"medium",children:"Open in Studio"})}),o[3]=r):r=o[3],o[4]!==t?(i=(0,u.jsx)(P.az,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",children:r}),o[4]=t,o[5]=i):i=o[5],i});function sP(e){let t=()=>e();return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)}function sC(){return window.location.href}let sI=e=>{let t,n=(0,h.c)(5),{dragGroupRect:r}=e,i=`${r.y}px`,o=`${r.x}px`,s=`${r.w-1}px`,a=`${r.h-1}px`;return n[0]!==i||n[1]!==o||n[2]!==s||n[3]!==a?(t=(0,u.jsx)("div",{style:{position:"absolute",top:i,left:o,width:s,height:a,border:"1px dashed #f0709b",pointerEvents:"none"}}),n[0]=i,n[1]=o,n[2]=s,n[3]=a,n[4]=t):t=n[4],t},sO=e=>{let t,n=(0,h.c)(4),{dragInsertPosition:r}=e;if(null===r)return;let i=r?.left||r?.right?"horizontal":"vertical",o=0,s=0,a=0,l=0;if("horizontal"===i){let{left:e,right:t}=r;if(a=6,t&&e){let n=e.rect.x+e.rect.w,r=t.rect.x,i=.0125*Math.min(t.rect.h,e.rect.h);o=.5*n+.5*r-3,s=e.rect.y+i,l=Math.min(t.rect.h,e.rect.h)-2*i}else if(t&&!e){let e=.0125*t.rect.h;o=t.rect.x-3,s=t.rect.y+e,l=t.rect.h-2*e}else if(e&&!t){let t=.0125*e.rect.h;o=e.rect.x+e.rect.w-3,s=e.rect.y+t,l=e.rect.h-2*t}}else{let{bottom:e,top:t}=r;if(e&&t){let n=Math.min(t.rect.x,e.rect.x),r=t.rect.y+t.rect.h,i=e.rect.y,u=.0125*Math.min(e.rect.w,t.rect.w);l=6,o=n+u,s=.5*r+.5*i-3,a=Math.max(e.rect.w,t.rect.w)-2*u}else if(e&&!t){let t=.0125*e.rect.w;o=e.rect.x+t,s=e.rect.y-3,a=e.rect.w-2*t,l=6}else if(t&&!e){let e=.0125*t.rect.w;o=t.rect.x+e,s=t.rect.y+t.rect.h-3,a=t.rect.w-2*e,l=6}}let c=`${a}px`,d=`${l}px`,f=`translate(${o}px, ${s}px)`;return n[0]!==c||n[1]!==d||n[2]!==f?(t=(0,u.jsx)("div",{style:{position:"absolute",width:c,height:d,transform:f,background:"#556bfc",border:"2px solid white",borderRadius:"999px",zIndex:"999999"}}),n[0]=c,n[1]=d,n[2]=f,n[3]=t):t=n[3],t},sR=C.I4.div`
136  --drag-preview-opacity: 0.98;
137  --drag-preview-skeleton-stroke: #ffffff;
138
139  @media (prefers-color-scheme: dark) {
140    --drag-preview-skeleton-stroke: #383d51;
141  }
142
143  position: fixed;
144  display: grid;
145  transform: ${({$scaleFactor:e,$width:t,$height:n})=>`translate(calc(var(--drag-preview-x) - ${t/2}px), calc(var(--drag-preview-y) - ${n/2}px)) scale(${e})`};
146  width: ${({$width:e})=>`${e}px`};
147  height: ${({$height:e})=>`${e}px`};
148  z-index: 9999999;
149  opacity: var(--drag-preview-opacity);
150  cursor: move;
151
152  .drag-preview-content-wrapper {
153    position: relative;
154    width: 100%;
155    height: 100%;
156    container-type: inline-size;
157  }
158
159  [data-ui='card'] {
160    position: relative;
161    width: 100%;
162    height: 100%;
163  }
164
165  .drag-preview-skeleton {
166    position: absolute;
167    inset: 0;
168
169    rect {
170      stroke: var(--drag-preview-skeleton-stroke);
171    }
172  }
173
174  .drag-preview-handle {
175    position: absolute;
176    top: 4cqmin;
177    left: 4cqmin;
178    width: 6cqmin;
179    fill: var(--drag-preview-handle-fill);
180  }
181`,sV=e=>{let t,n,r,i,o,s,a,l,c,d,f,p,m,g,y,v,b,x,w,k,S,E=(0,h.c)(50),{skeleton:T}=e,j=Math.min(T.maxWidth,window.innerWidth/2),A=T.w>j?j/T.w:1,M=T.offsetX*A,_=T.offsetY*A,C=(0,P.Xy)(),I=(0,P.M4)(),O=I.radius[~~function(e,t,n,r,i){var o;return o=(e-0)*(i-1)/1920+1,o<r?r:o>i?i:o}(T.w,0,0,1,I.radius.length-2)];if(E[0]!==M||E[1]!==_||E[2]!==C||E[3]!==O||E[4]!==A||E[5]!==T.childRects||E[6]!==T.h||E[7]!==T.w){let e=T.childRects.filter(sL),u=T.childRects.filter(sD);
181n=sR,i=T.w,o=T.h,s=M,a=_,l=A,t=P.Zp,p=O,m=4,g="hidden",y="transparent",v=C?"dark":"light",f="drag-preview-content-wrapper",c="drag-preview-skeleton",d=`0 0 ${T.w} ${T.h}`,r=[...e,...u],E[0]=M,E[1]=_,E[2]=C,E[3]=O,E[4]=A,E[5]=T.childRects,E[6]=T.h,E[7]=T.w,E[8]=t,E[9]=n,E[10]=r,E[11]=i,E[12]=o,E[13]=s,E[14]=a,E[15]=l,E[16]=c,E[17]=d,E[18]=f,E[19]=p,E[20]=m,E[21]=g,E[22]=y,E[23]=v}else t=E[8],n=E[9],r=E[10],i=E[11],o=E[12],s=E[13],a=E[14],l=E[15],c=E[16],d=E[17],f=E[18],p=E[19],m=E[20],g=E[21],y=E[22],v=E[23];return E[24]!==r||E[25]!==I.color?(b=r.map((e,t)=>(0,u.jsx)("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:I.color.skeleton.from},t)),E[24]=r,E[25]=I.color,E[26]=b):b=E[26],E[27]!==b||E[28]!==c||E[29]!==d?(x=(0,u.jsx)("svg",{className:c,viewBox:d,children:b}),E[27]=b,E[28]=c,E[29]=d,E[30]=x):x=E[30],E[31]!==x||E[32]!==f?(w=(0,u.jsx)("div",{className:f,children:x}),E[31]=x,E[32]=f,E[33]=w):w=E[33],E[34]!==t||E[35]!==w||E[36]!==p||E[37]!==m||E[38]!==g||E[39]!==y||E[40]!==v?(k=(0,u.jsx)(t,{radius:p,shadow:m,overflow:g,tone:y,scheme:v,children:w}),E[34]=t,E[35]=w,E[36]=p,E[37]=m,E[38]=g,E[39]=y,E[40]=v,E[41]=k):k=E[41],E[42]!==n||E[43]!==i||E[44]!==o||E[45]!==s||E[46]!==a||E[47]!==l||E[48]!==k?(S=(0,u.jsx)(n,{$width:i,$height:o,$offsetX:s,$offsetY:a,$scaleFactor:l,children:k}),E[42]=n,E[43]=i,E[44]=o,E[45]=s,E[46]=a,E[47]=l,E[48]=k,E[49]=S):S=E[49],S};function sL(e){return"IMG"===e.tagName}function sD(e){return"IMG"!==e.tagName}let s$=(0,C.I4)(P.Zp)`
182  position: fixed;
183  bottom: 2rem;
184  left: 2rem;
185`,sz=()=>{let e,t,n=(0,h.c)(2);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e={zIndex:"999999"},n[0]=e):e=n[0],n[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,u.jsx)(s$,{padding:2,shadow:2,radius:2,style:e,children:(0,u.jsxs)(P.so,{align:"center",gap:2,children:[(0,u.jsx)(P.qW,{keys:["Shift"]}),(0,u.jsx)(P.EY,{size:1,children:"Zoom Out"}),(0,u.jsx)(ti.mSu,{})]})}),n[1]=t):t=n[1],t};function sF(e,t){let{type:n}=t,{contextMenu:r,focusPath:i,perspective:o,isDragging:s,dragInsertPosition:a,dragShowMinimap:l,dragShowMinimapPrompt:u,dragSkeleton:c,dragMinimapTransition:d,dragGroupRect:h}=e,f=!1;if("presentation/focus"===n){let n=e.focusPath;n!==(i=t.data.path)&&(f=n.slice(i.length).startsWith("["))}return"presentation/perspective"===n&&(o=t.data.perspective),"element/contextmenu"===n&&(r="sanity"in t?{node:t.sanity,position:t.position}:null),("element/click"===n||"element/mouseleave"===n||"overlay/blur"===n||"presentation/blur"===n||"presentation/focus"===n)&&(r=null),"overlay/dragUpdateInsertPosition"===n&&(a=t.insertPosition),"overlay/dragStart"===n&&(s=!0),"overlay/dragUpdateSkeleton"===t.type&&(c=t.skeleton),"overlay/dragEnd"===n&&(s=!1),"overlay/dragToggleMinimapPrompt"===t.type&&(u=t.display),"overlay/dragStartMinimapTransition"===n&&(d=!0),"overlay/dragEndMinimapTransition"===n&&(d=!1),"overlay/dragUpdateGroupRect"===n&&(h=t.groupRect),"overlay/dragToggleMinimap"===n&&(l=t.display),{...e,contextMenu:r,elements:((e,t)=>{let{type:n}=t;switch(n){case"element/register":return e.find(e=>e.id===t.id)?e:[...e,{id:t.id,activated:!1,element:t.element,focused:!1,hovered:!1,rect:t.rect,sanity:t.sanity,dragDisabled:t.dragDisabled}];case"element/activate":return e.map(e=>e.id===t.id?{...e,activated:!0}:e);case"element/update":return e.map(e=>e.id===t.id?{...e,sanity:t.sanity,rect:t.rect}:e);case"element/unregister":return e.filter(e=>e.id!==t.id);case"element/deactivate":return e.map(e=>e.id===t.id?{...e,activated:!1,hovered:!1}:e);case"element/mouseenter":return e.map(e=>e.id===t.id?{...e,rect:t.rect,hovered:!0}:{...e,hovered:!1});case"element/mouseleave":return e.map(e=>e.id===t.id?{...e,hovered:!1}:e);case"element/updateRect":return e.map(e=>e.id===t.id?{...e,rect:t.rect}:e);case"element/click":return e.map(e=>({...e,focused:e.id===t.id&&"clicked"}));case"overlay/blur":return e.map(e=>({...e,focused:!1}));case"presentation/blur":return e.map(e=>({...e,focused:!1}));case"presentation/focus":{let n=e.find(e=>"clicked"===e.focused);return e.map(e=>{let r="path"in e.sanity&&e.sanity.id===t.data.id&&e.sanity.path===t.data.path;return n&&e===n&&r?e:{...e,focused:r&&n?"duplicate":r}})}default:return e}})(e.elements,t),dragInsertPosition:a,dragSkeleton:c,dragGroupRect:h,isDragging:s,focusPath:i,perspective:o,wasMaybeCollapsed:f,dragShowMinimap:l,dragShowMinimapPrompt:u,dragMinimapTransition:d}}let sB=function(e){let t,n,r,i,o,s,a,l=(0,h.c)(13),{comlink:d,children:f}=e;l[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],l[0]=t):t=l[0];let[p,m]=(0,c.useState)(t);l[1]!==d?(n=async e=>{if(d)try{let t=await d.fetch("visual-editing/preview-snapshots",void 0,{signal:e,suppressWarnings:!0});m(t.snapshots)}catch{}},l[1]=d,l[2]=n):n=l[2];let g=n;return l[3]!==d||l[4]!==g?(r=()=>{if(!d)return;let e=new AbortController,t=d.onStatus(()=>{g(e.signal)},"connected");return()=>{e.abort(),t()}},i=[d,g],l[3]=d,l[4]=g,l[5]=r,l[6]=i):(r=l[5],i=l[6]),(0,c.useEffect)(r,i),l[7]!==d?(o=()=>d?.on("presentation/preview-snapshots",e=>{m(e.snapshots)}),s=[d],l[7]=d,l[8]=o,l[9]=s):(o=l[8],s=l[9]),(0,c.useEffect)(o,s),l[10]!==f||l[11]!==p?(a=(0,u.jsx)(sx.Provider,{value:p,children:f}),l[10]=f,l[11]=p,l[12]=a):a=l[12],a};function sN(e){return"document"===e.type}function sU(e){return"type"===e.type}let sH=function(e){let t,n,r,i,o,s,a,l,d,f,p,m,g=(0,h.c)(22),{comlink:y,children:v,elements:b}=e;g[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Map,g[0]=t):t=g[0];let[x,w]=(0,c.useState)(t),[k,S]=(0,c.useState)(null);g[1]!==y?(n=()=>
185{if(!y)return;let e=async function(e){if(y)try{let t=await y.fetch("visual-editing/schema",void 0,{signal:e,suppressWarnings:!0});S(t.schema)}catch{}},t=new AbortController,n=y.onStatus(()=>{e(t.signal)},"connected");return()=>{t.abort(),n()}},r=[y],g[1]=y,g[2]=n,g[3]=r):(n=g[2],r=g[3]),(0,c.useEffect)(n,r),g[4]===Symbol.for("react.memo_cache_sentinel")?(i=[],g[4]=i):i=g[4];let E=(0,c.useRef)(i),T=(0,c.useDeferredValue)(b);g[5]!==T?(o=T.reduce((e,t)=>{let{sanity:n}=t;if(!("id"in n)||!n.path.includes("[_key=="))return e;let r=n.path.split(".").toReversed().reduce((e,t)=>e.length?[t,...e]:t.includes("[_key==")?[t]:[],[]).join(".");return e.find(e=>e.id===n.id&&e.path===r)||e.push({id:n.id,path:r}),e},[]),g[5]=T,g[6]=o):o=g[6];let j=o,A=(0,c.useRef)(null);g[7]!==y||g[8]!==j?(s=()=>{if(!j.length||!y)return;let e=async(e,t)=>{let n=E.current;try{E.current=e;let n=await y.fetch("visual-editing/schema-union-types",{paths:e},{signal:t,suppressWarnings:!0});if(t.aborted)return;w(n.types),A.current=null}catch{}t.aborted&&(E.current=n)};j.some(e=>!E.current.find(t=>{let{id:n,path:r}=t;return n===e.id&&r===e.path}))&&(A.current?.abort(),A.current=new AbortController,e(j,A.current.signal))},a=[y,j],g[7]=y,g[8]=j,g[9]=s,g[10]=a):(s=g[9],a=g[10]),(0,c.useEffect)(s,a),g[11]!==k?(l=(e,t)=>{if(!k||"string"!=typeof e&&(!("path"in e)||!Array.isArray(k)))return;let n="string"==typeof e?e:e.type;return k.filter("document"===(t||"document")?sN:sU).find(e=>e.name===n)},g[11]=k,g[12]=l):l=g[12];let M=l;g[13]!==M||g[14]!==x?(d=e=>{if(!("path"in e))return{field:void 0,parent:void 0};let t=M(e);if(!t)return{field:void 0,parent:void 0};let n=e.path.split(".").flatMap(sW);try{return function t(n,r,i,o){let s=void 0===o?[]:o;if(!n)return{field:void 0,parent:void 0};let[a,...l]=r;if("fields"in n){let e=n.fields[a];if(!e&&"rest"in n)return t(n.rest,r,n,s);if(!l.length)return{field:e,parent:i};if(!e)throw Error(`[@sanity/visual-editing] No field could be resolved at path: "${[...s,...r].join(".")}"`);return t(e.value,l,n,[...s,a])}if("array"===n.type)return t(n.of,r,n,s);if("arrayItem"===n.type)return l.length?t(n.value,l,n,[...s,a]):{field:n,parent:i};if("union"===n.type){let r=a.startsWith("[_key==")?x?.get(e.id)?.get([s.join("."),a].filter(Boolean).join("")):a;return t(n.of.find(e=>"unionOption"===e.type?e.name===r:e),l,n,[...s,a])}if("unionOption"===n.type)return a?t(n.value,r,n,s):{field:n,parent:i};if("inline"===n.type)return t(M(n.name,"type").value,r,n,s);throw Error(`[@sanity/visual-editing] No field could be resolved at path: "${[...s,...r].join(".")}"`)}(t,n,void 0)}catch(e){return e instanceof Error&&console.warn(e.message),{field:void 0,parent:void 0}}},g[13]=M,g[14]=x,g[15]=d):d=g[15];let _=d;return g[16]!==_||g[17]!==M?(p={getField:_,getType:M},g[16]=_,g[17]=M,g[18]=p):p=g[18],f=p,g[19]!==v||g[20]!==f?(m=(0,u.jsx)(sl.Provider,{value:f,children:v}),g[19]=v,g[20]=f,g[21]=m):m=g[21],m};function sW(e){return e.includes("[")?e.split(/(\[.+\])/,2):[e]}let sY=(e=>{let t=e,n=new Set;return{getState:()=>t,setState:e=>{t=e(t),n.forEach(e=>e())},subscribe:e=>(n.add(e),()=>n.delete(e))}})({}),sq=e=>{let t,n,r,i,o,s,a,l=(0,h.c)(11),{comlink:d,children:f}=e;return l[0]!==d?(t=()=>d?.on("presentation/shared-state",sG),n=[d],l[0]=d,l[1]=t,l[2]=n):(t=l[1],n=l[2]),(0,c.useEffect)(t,n),l[3]!==d?(r=()=>{(async function(){let e=await d?.fetch("visual-editing/shared-state",void 0,{suppressWarnings:!0});e&&sY.setState(()=>e.state)})().catch(sX)},i=[d],l[3]=d,l[4]=r,l[5]=i):(r=l[4],i=l[5]),(0,c.useEffect)(r,i),l[6]!==d?(s={comlink:d,store:sY},l[6]=d,l[7]=s):s=l[7],o=s,l[8]!==f||l[9]!==o?(a=(0,u.jsx)(tr.Provider,{value:o,children:f}),l[8]=f,l[9]=o,l[10]=a):a=l[10],a};function sG(e){"value"in e?sY.setState(t=>({...t,[e.key]:e.value})):sY.setState(t=>Object.fromEntries(Object.entries(t).filter(t=>{let[n]=t;return n!==e.key})))}function sX(e){console.debug(e),console.warn("[@sanity/visual-editing]: Failed to fetch shared state. Check your version of `sanity` is up-to-date")}let sK=e=>{let t,n,r=(0,h.c)(5),{children:i,comlink:o}=e;r[0]!==o?(t=(e,t)=>{if(!o)return;let n=tj[e];if(n)o.post("visual-editing/telemetry-log",{event:n,data:t});else throw Error(`Telemetry event: ${e} does not exist`)},r[0]=o,r[1]=t):t=r[1];let s=t;return r[2]!==i||r[3]!==s?(n=(0,u.jsx)(tA.Provider,{value:s,children:i}),r[2]=i,r[3]=s,r[4]=n):n=r[4],n};function sZ(){}function sJ(e){return e.id}function sQ(e){return!!e}function s0(e){let{sanity:t}=e;return"id"in t?t:null}let s1=C.I4.div`
186  background-color: transparent;
187  direction: ltr;
188  inset: 0;
189  pointer-events: none;
190  position: absolute;
191  width: 100%;
192  height: 100%;
193  z-index: ${({$zIndex:e})=>e??"9999999"};
194`;function s2(e){let t,n;return t=requestAnimationFrame(()=>{n=requestAnimationFrame(e)}),()=>{void 0!==t&&cancelAnimationFrame(t),void 0!==n&&cancelAnimationFrame(n)}}let s5=e=>{let t,n,r,i,o,s=(0,h.c)(8),{documentIds:a}=e;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],s[0]=t):t=s[0];let[l,u]=(0,c.useState)(t);s[1]!==a?(n=()=>{u(e=>
194{let t=Array.from(new Set(a));return e.length===t.length&&e.reduce(s8,t)?.length===0?e:t})},r=[a],s[1]=a,s[2]=n,s[3]=r):(n=s[2],r=s[3]),(0,c.useEffect)(n,r);let d=eo();return s[4]!==d||s[5]!==l?(i=()=>{for(let e of l)d.send({type:"observe",documentId:M(e)}),d.send({type:"observe",documentId:_(e)});return()=>{for(let e of l)d.send({type:"unobserve",documentId:M(e)}),d.send({type:"unobserve",documentId:_(e)})}},o=[d,l],s[4]=d,s[5]=l,s[6]=i,s[7]=o):(i=s[6],o=s[7]),(0,c.useEffect)(i,o),null},s3=e=>{let t,n,i,o=(0,h.c)(12),{comlink:s,dispatch:a,inFrame:l,inPopUp:u,onDrag:d,overlayEnabled:f,rootElement:p}=e,{dispatchDragEndEvent:m}=function(){let e,t,n,r=(0,h.c)(4),{getDocument:i}=ed();return r[0]!==i?(e=()=>{let e=e=>{let{insertPosition:t,target:n,preventInsertDefault:r}=e.detail;if(r)return;let o=function(e){if(e){let{top:t,right:n,bottom:r,left:i}=e;if(i||t)return{node:(i??t).sanity,position:"after"};if(n||r)return{node:(n??r).sanity,position:"before"}}}(t);if(o){let e=i(n.id),{node:t,position:r}=o,{key:s,hasExplicitKey:a}=ep(n),{path:l,key:u}=ep(t);l&&u&&u!==s&&e.patch(async e=>{let{getSnapshot:t}=e,i=er(await t(),n.path);return a?[Y(l,W({_key:s})),Y(l,U(i,r,{_key:u}))]:[Y(l,W(~~s)),Y(l,U(i,r,u>s?~~u-1:~~u))]})}};return window.addEventListener("sanity/dragEnd",e),()=>{window.removeEventListener("sanity/dragEnd",e)}},t=[i],r[0]=i,r[1]=e,r[2]=t):(e=r[1],t=r[2]),(0,c.useEffect)(e,t),r[3]===Symbol.for("react.memo_cache_sentinel")?(n={dispatchDragEndEvent:sa},r[3]=n):n=r[3],n}(),g=tM();o[0]!==s||o[1]!==a||o[2]!==m||o[3]!==d||o[4]!==g?(t=e=>{if("element/click"===e.type){let{sanity:t}=e;s?.post("visual-editing/focus",t),g("Visual Editing Overlay Clicked",null)}else if("overlay/activate"===e.type)s?.post("visual-editing/toggle",{enabled:!0});else if("overlay/deactivate"===e.type)s?.post("visual-editing/toggle",{enabled:!1});else if("overlay/dragEnd"===e.type){let{insertPosition:t,target:n,dragGroup:r,flow:i,preventInsertDefault:o}=e;m({insertPosition:t,target:n,dragGroup:r,flow:i,preventInsertDefault:o}),t&&g("Visual Editing Drag Sequence Completed",null)}else if("overlay/dragUpdateCursorPosition"===e.type)return void d(e.x,e.y);else if("overlay/dragToggleMinimap"===e.type&&!0===e.display)g("Visual Editing Drag Minimap Enabled",null);else if("overlay/setCursor"===e.type){let{element:t,cursor:n}=e;n?t.style.cursor=n:t.style.removeProperty("cursor")}a(e)},o[0]=s,o[1]=a,o[2]=m,o[3]=d,o[4]=g,o[5]=t):t=o[5];let y=function(e,t,n,i){let o,s,a=(0,h.c)(7),l=(0,c.useRef)(void 0),u=eo()!==G;return a[0]!==e||a[1]!==t||a[2]!==n||a[3]!==i||a[4]!==u?(o=()=>{if(e)return l.current=function({handler:e,overlayElement:t,inFrame:n,inPopUp:i,optimisticActorReady:o}){let s=!1,a=new Map,l=new WeakMap,u=new Set,c=new WeakMap,d=new WeakMap,h,f,p,m=!1,g=[],y=()=>g[g.length-1];function v(e,t){e.removeEventListener("click",t.click,{capture:!0}),e.removeEventListener("contextmenu",t.contextmenu,{capture:!0}),e.removeEventListener("mousemove",t.mousemove,{capture:!0}),e.removeEventListener("mousedown",t.mousedown,{capture:!0}),e.removeEventListener("mouseenter",t.mouseenter),e.removeEventListener("mouseleave",t.mouseleave)}function b({id:t,elements:n,handlers:r}){let{element:i,measureElement:o}=n;i.addEventListener("click",r.click,{capture:!0}),i.addEventListener("contextmenu",r.contextmenu,{capture:!0}),i.addEventListener("mousemove",r.mousemove,{once:!0,capture:!0}),i.addEventListener("mousedown",r.mousedown,{capture:!0}),h.observe(o),e({type:"element/activate",id:t})}function x({id:t,elements:n,handlers:r}){let{element:i,measureElement:o}=n;v(i,r),h.unobserve(o),g=g.filter(e=>e!==i),e({type:"element/deactivate",id:t})}function w(t){if(!(!n&&!i||!o))for(let n of g){if(t===n){let n=l.get(t)?.sanity;if(!n||!e8(n))return;if(tn(t,n,u,l)){let n=t.style.cursor;n&&d.set(t,n),e({type:"overlay/setCursor",element:t,cursor:"move"});continue}}k(n)}}function k(t){let n=d.get(t);e({type:"overlay/setCursor",element:t,cursor:n})}function S(d){for(let h of function e(t){let n=[];function r(e,t){let r=function(e){if("object"==typeof e&&null!==e)return eT(e);try{let t=JSON.parse(e);return eT(t)}catch{let t=e.split(";").reduce((e,t)=>
194{let[n,r]=t.split("=");if(!n||t.includes("=")&&!r)return e;switch(n){case"id":e.id=r;break;case"type":e.type=r;break;case"path":e.path=E.toString(function(e){let t=[];for(let n of e.split(".")){let e=ex.exec(n);if(e){t.push(e[1],Number(e[2]));continue}let r=ew.exec(n);if(r){t.push(r[1],[Number(r[2]),Number(r[3])]);continue}let i=ek.exec(n);if(i){t.push(i[1],{_key:i[2]});continue}t.push(n)}return t}(r));break;case"base":e.baseUrl=decodeURIComponent(r);break;case"tool":e.tool=r;break;case"workspace":e.workspace=r;break;case"projectId":e.projectId=r;break;case"dataset":e.dataset=r}return e},{});if((0,eg.is)(eb,t))return t;return}}(t);if(!r)return;let i=function e(t){let{display:n}=window.getComputedStyle(t);if("inline"!==n)return t;let r=t.parentElement;return r?e(r):null}(e);i&&n.push({elements:{element:e,measureElement:i},sanity:r})}if(t)for(let i of t.childNodes){let{nodeType:t,parentElement:o,textContent:s}=i;if(e3(i)&&i.dataset?.sanityEditTarget!==void 0){let t=e(i).map(({sanity:e})=>e);if(!t.map(e=>e8(e)).every((e,t,n)=>e===n[0]))continue;let r=function(e){if(!e.length||!e.map(e=>e8(e)).every((e,t,n)=>e===n[0]))return;if(!e8(e[0]))return e[0];let t=e.filter(e8),n=e[0],r=["projectId","dataset","id","baseUrl","workspace","tool"];for(let e=1;e<t.length;e++){let i=t[e];if(r.some(e=>i[e]!==n?.[e])){n=void 0;break}n.path=function(e,t){let n=e.split("."),r=t.split("."),i=Math.min(n.length,r.length);return n=n.slice(0,i).reverse(),r=r.slice(0,i).reverse(),n.reduce((e,t,n)=>t===r[n]?[...e,t]:[],[]).reverse().join(".")}(n.path,i.path)}return n}(t);r&&n.push({elements:{element:i,measureElement:i},sanity:r})}else if(t===Node.TEXT_NODE&&o&&s){let e=e5(s);if(!e)continue;r(o,e)}else if(e3(i)){if("SCRIPT"===i.tagName||"SANITY-VISUAL-EDITING"===i.tagName)continue;if(i.dataset?.sanity)r(i,i.dataset.sanity);else if(i.dataset?.sanityEditInfo)r(i,i.dataset.sanityEditInfo);else if(e4(i)){let e=e5(i.alt,!0);if(!e)continue;r(i,e);continue}else if(e6(i)){let e=e5(i.dateTime,!0);if(!e)continue;r(i,e)}else if(e9(i)){if(!i.ariaLabel)continue;let e=e5(i.ariaLabel,!0);if(!e)continue;r(i,e)}n.push(...e(i))}}return n}(d)){let{element:d}=h.elements;l.has(d)?function({elements:t,sanity:n}){let{element:r}=t,i=l.get(r);i&&(l.set(r,{...i,sanity:n}),e({type:"element/update",id:i.id,rect:eL(r),sanity:n}))}(h):function({elements:d,sanity:h}){let{element:p,measureElement:v}=d,x={click(t){let r=t.target;if(p===y()&&p.contains(r)){n&&(t.preventDefault(),t.stopPropagation());let r=l.get(p)?.sanity;r&&!m&&e({type:"element/click",id:S,sanity:r})}},contextmenu(t){if(!("path"in h)||!n&&!i||!o||!h.path.split(".").pop()?.includes("[_key=="))return;let r=t.target;p===y()&&p.contains(r)&&((n||i)&&(t.preventDefault(),t.stopPropagation()),e({type:"element/contextmenu",id:S,position:{x:t.clientX,y:t.clientY},sanity:h}))},mousedown(t){if(t.preventDefault(),t.currentTarget!==g.at(-1)||p.getAttribute("data-sanity-drag-disable")||!n&&!i||!o)return;let r=l.get(p)?.sanity;if(!r||!e8(r)||!e7(r.path))return;let s=tn(p,h,u,l);s&&function(e){var t;let{mouseEvent:n,element:r,overlayGroup:i,handler:o,target:s,onSequenceStart:a,onSequenceEnd:l}=e;if(0!==n.button)return;window.focus();let u=i.map(e=>eL(e.elements.element)),c=r.getAttribute("data-sanity-drag-flow")||((t=u).some(e=>t.filter(t=>!e$(e,t)).some(t=>e.y===t.y))?"horizontal":"vertical"),d=r.getAttribute("data-sanity-drag-group"),h=!!r.getAttribute("data-sanity-drag-minimap-disable"),f=!!r.getAttribute("data-sanity-drag-prevent-default"),p=r.getAttribute("data-unstable_sanity-drag-document-height"),m=r.getAttribute("data-unstable_sanity-drag-group-height"),g=null,y=eW(n),v=document.body,{minYScaled:b,scaleFactor:x}=function(e,t){let n=t||eN(e).height,r=(n+=200)>window.innerHeight?window.innerHeight/n:1,{min:i}=eN(e.map(e=>eB(e,r,{x:window.innerWidth/2,y:0})));return{scaleFactor:r,minYScaled:i-100*r}}(u,m?~~m:null),w=!1,k=!1,S=!0;eK||(e0={body:{overflow:window.getComputedStyle(document.body).overflow,height:window.getComputedStyle(document.body).height},documentElement:{overflow:window.getComputedStyle(document.documentElement).overflow,height:window.getComputedStyle(document.documentElement).height}},eQ=p?~~p:document.documentElement.scrollHeight);let E=setInterval(()=>{u=i.map(e=>eL(e.elements.element))},150),T=()=>{x>=1||(o({type:"overlay/dragUpdateSkeleton",skeleton:eY(eJ,r,x)}),o({type:"overlay/dragToggleMinimapPrompt",display:!1}),eq(v,x,b,o,150).then(()=>{setTimeout(()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:eG(u)})},300)}))},j=e=>{Math.abs(e.deltaY)>=10&&x<1&&!eK&&!k&&!h&&S&&(o({type:"overlay/dragToggleMinimapPrompt",display:!0}),k=!0),!e.shiftKey||eK||h||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),eK=!0,setTimeout(()=>{T()},50))},A=e=>{if(e.preventDefault(),eZ=function(e){let t=document.body,n=window.getComputedStyle(t).transform;if("none"===n)return{x:e.x,y:e.y};let r=new DOMMatrix(n).inverse(),i=new DOMPoint(e.x,e.y).matrixTransform(r);return{x:i.x,y:i.y}}(eJ=eW(e)),4>Math.abs(ez(eJ,y)))return;if(!w){let e=eG(u),t=eY(eJ,r,1);o({type:"overlay/dragStart",flow:c}),o({type:"overlay/dragUpdateSkeleton",skeleton:t}),o({type:"overlay/dragUpdateGroupRect",groupRect:e}),w=!0,a()}o({type:"overlay/dragUpdateCursorPosition",x:eJ.x,y:eJ.y}),!e.shiftKey||eK||h||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),eK=!0,setTimeout(()=>{T()},50));let t=function(e,t,n){if("horizontal"===n){let r={x1:e.x,y1:e.y,x2:e.x-1e8,y2:e.y},i={x1:e.x,y1:e.y,x2:e.x+1e8,y2:e.y};return{left:eF(r,t,n),right:eF(i,t,n)}}{let r={x1:e.x,y1:e.y,x2:e.x,y2:e.y-1e8},i={x1:e.x,y1:e.y,x2:e.x,y2:e.y+1e8};return{top:eF(r,t,n),bottom:eF(i,t,n)}}}(eJ,u,c);JSON.stringify(g)!==JSON.stringify(t)&&o({type:"overlay/dragUpdateInsertPosition",insertPosition:eH(i,g=t,c)})},M=()=>{S=!1,o({type:"overlay/dragEnd",target:s,insertPosition:g?eH(i,g,c):null,dragGroup:d,flow:c,preventInsertDefault:f}),k&&o({type:"overlay/dragToggleMinimapPrompt",display:!1}),eK||(clearInterval(E),l(),O(),I()),C()},_=e=>{"Shift"===e.key&&eK&&(eK=!1,o({type:"overlay/dragUpdateSkeleton",skeleton:eY(eJ,r,1/x)}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{eX(eZ.y,v,eQ,o,150,e0)},50),o({type:"overlay/dragUpdateGroupRect",groupRect:null}),S||(clearInterval(E),C(),O(),I(),l()))},P=()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:null}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{eX(eZ.y,v,eQ,o,150,e0).then(()=>{eK=!1})},50),clearInterval(E),C(),O(),I(),l()},C=()=>{window.removeEventListener("mousemove",A),window.removeEventListener("wheel",j),window.removeEventListener("mouseup",M)},I=()=>{window.removeEventListener("keyup",_)},O=()=>{window.removeEventListener("blur",P)};window.addEventListener("blur",P),window.addEventListener("keyup",_),window.addEventListener("wheel",j),window.addEventListener("mousemove",A),window.addEventListener("mouseup",M)}({element:p,handler:e,mouseEvent:t,overlayGroup:s,target:r,onSequenceStart:()=>{m=!0},onSequenceEnd:()=>{setTimeout(()=>{m=!1},250)}})},mousemove(e){x.mouseenter(e);let t=e.currentTarget;t&&(t.addEventListener("mouseenter",x.mouseenter),t.addEventListener("mouseleave",x.mouseleave))},mouseenter(){document.querySelector("vercel-live-feedback")&&p.closest("[data-vercel-edit-info]")||p.closest("[data-vercel-edit-target]")||(g.push(p),e({type:"element/mouseenter",id:S,rect:eL(p)}),w(p))},mouseleave(n){function r(){g.pop();let t=y();if(e({type:"element/mouseleave",id:S}),t){w(t);let n=l.get(t);n&&e({type:"element/mouseenter",id:n.id,rect:eL(t)})}k(p)}let{relatedTarget:i}=n,o=e2(i),s=t.contains(o);if(e1(o)&&s)return function e(t){let n=i=>{let{relatedTarget:o}=i;e2(o)?o&&e1(o)&&(t.removeEventListener("mouseleave",n),e(o)):(t.removeEventListener("mouseleave",n),r())};t.addEventListener("mouseleave",n)}(o);r()}},S=function(e,t,n){if(eV.randomUUID&&!e)return eV.randomUUID();let i=(e=e||{}).random??e.rng?.()??function(){if(!r){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(eR)}();if(i.length<16)throw Error("Random bytes length must be >= 16");return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,t=0){return(eO[e[t+0]]+eO[e[t+1]]+eO[e[t+2]]+eO[e[t+3]]+"-"+eO[e[t+4]]+eO[e[t+5]]+"-"+eO[e[t+6]]+eO[e[t+7]]+"-"+eO[e[t+8]]+eO[e[t+9]]+"-"+eO[e[t+10]]+eO[e[t+11]]+eO[e[t+12]]+eO[e[t+13]]+eO[e[t+14]]+eO[e[t+15]]).toLowerCase()}(i)}(),E={id:S,elements:d,sanity:h,handlers:x};u.add(p),c.set(v,p),a.set(S,p),l.set(p,E),f?.observe(p),e({type:"element/register",id:S,element:p,rect:eL(p),sanity:h,dragDisabled:!!p.getAttribute("data-sanity-drag-disable")}),s&&b(E)}(h)}}function T(t){let n=l.get(t);if(n){let{id:r,handlers:i}=n;v(t,i),h.unobserve(t),l.delete(t),u.delete(t),a.delete(r),e({type:"element/unregister",id:r})}}function j(t){let n=l.get(t);n&&e({type:"element/updateRect",id:n.id,rect:eL(t)})}function A(e){if(s)for(let t of e){let{target:e}=t,n=e1(e)&&l.get(e);n&&(t.isIntersecting?b(n):x(n))}}function M(t){let n=e2(t.target);if(n){"capture"===n.dataset.sanityOverlayElement&&(t.preventDefault(),t.stopPropagation());return}g=[],e({type:"overlay/blur"})}function _(){for(let e of u)j(e)}function P(t){"Escape"===t.key&&(g=[],e({type:"overlay/blur"}))}function C(e){let{target:t}=e;if(!(t===window.document||!e1(t)))for(let e of u)t.contains(e)&&j(e)}function I(){s||(f=new IntersectionObserver(A,{threshold:.3}
194),u.forEach(e=>f.observe(e)),e({type:"overlay/activate"}),s=!0)}function O(){s&&(f?.disconnect(),u.forEach(e=>{let t=l.get(e);t&&x(t)}),e({type:"overlay/deactivate"}),s=!1)}return window.document.fonts.ready.then(()=>{for(let e of u)j(e)}),window.addEventListener("click",M),window.addEventListener("contextmenu",M),window.addEventListener("keydown",P),window.addEventListener("resize",_),window.addEventListener("scroll",C,{capture:!0,passive:!0}),h=new ResizeObserver(function(e){for(let t of e){let e=t.target;if(e1(e)){let t=c.get(e);if(!t)return;j(t)}}}),(p=new MutationObserver(function(e){let n=!1;for(let r of e){let{target:e,type:i}=r,o="characterData"===i?e.parentElement:e;o===t||t.contains(o)||(n=!0,e1(o)&&S({childNodes:[o]}))}if(n)for(let e of u)e.isConnected||T(e)})).observe(document.body,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),S(document.body),I(),{activate:I,deactivate:O,destroy:function(){window.removeEventListener("click",M),window.removeEventListener("contextmenu",M),window.removeEventListener("keydown",P),window.removeEventListener("resize",_),window.removeEventListener("scroll",C),p.disconnect(),h.disconnect(),u.forEach(e=>{T(e)}),a.clear(),u.clear(),g=[],O()}}}({handler:t,overlayElement:e,inFrame:n,inPopUp:i,optimisticActorReady:u}),()=>{l.current?.destroy(),l.current=void 0}},s=[e,t,n,i,u],a[0]=e,a[1]=t,a[2]=n,a[3]=i,a[4]=u,a[5]=o,a[6]=s):(o=a[5],s=a[6]),(0,c.useEffect)(o,s),l}(p,t,l,u);return o[6]!==y.current||o[7]!==f?(n=()=>{f?y.current?.activate():y.current?.deactivate()},o[6]=y.current,o[7]=f,o[8]=n):n=o[8],o[9]!==y||o[10]!==f?(i=[y,f],o[9]=y,o[10]=f,o[11]=i):i=o[11],(0,c.useEffect)(n,i),null},s4=e=>{let t,n,r,i,o,s,a,l,d,f,p,m,g,y,v,b,x,w,k,S,E,T,j,A,M,_=(0,h.c)(74),{comlink:C,comlinkStatus:I,componentResolver:O,inFrame:R,inPopUp:V,zIndex:L}=e,D=(0,P.Xy)();_[0]===Symbol.for("react.memo_cache_sentinel")?(t={contextMenu:null,dragInsertPosition:null,dragShowMinimap:!1,dragShowMinimapPrompt:!1,dragSkeleton:null,elements:[],focusPath:"",isDragging:!1,perspective:"published",wasMaybeCollapsed:!1,dragMinimapTransition:!1,dragGroupRect:null},_[0]=t):t=_[0];let[$,z]=(0,c.useReducer)(sF,t),{contextMenu:F,dragInsertPosition:B,dragShowMinimap:N,dragShowMinimapPrompt:U,dragSkeleton:H,elements:W,isDragging:Y,perspective:q,wasMaybeCollapsed:X,dragMinimapTransition:K,dragGroupRect:Z}=$,[J,Q]=(0,c.useState)(null),[ee,et]=(0,c.useState)(!0);_[1]!==C?(n=()=>{let e=[C?.on("presentation/focus",e=>{z({type:"presentation/focus",data:e})}),C?.on("presentation/blur",e=>{z({type:"presentation/blur",data:e})}),C?.on("presentation/toggle-overlay",()=>{et(s7)})].filter(Boolean);return()=>e.forEach(ae)},r=[C],_[1]=C,_[2]=n,_[3]=r):(n=_[2],r=_[3]),(0,c.useEffect)(n,r),function(e,t){let n,r,i=(0,h.c)(4);i[0]!==e||i[1]!==t?(n=()=>{let n=new AbortController;e?.fetch("visual-editing/fetch-perspective",void 0,{signal:n.signal,suppressWarnings:!0}).then(e=>{t({type:"presentation/perspective",data:e})}).catch(sZ);let r=e?.on("presentation/perspective",e=>{t({type:"presentation/perspective",data:e})});return()=>{r?.(),n.abort()}},r=[e,t],i[0]=e,i[1]=t,i[2]=n,i[3]=r):(n=i[2],r=i[3]),(0,c.useEffect)(n,r)}(C,z),function(e,t,n){let r,i,o,s=(0,h.c)(7),a=(0,c.useRef)(void 0);s[0]!==e?(r=(t,n)=>{e?.post("visual-editing/documents",{documents:t,perspective:n})},s[0]=e,s[1]=r):r=s[1];let l=r;s[2]!==t||s[3]!==n||s[4]!==l?(i=()=>{let e=t.map(s0).filter(sQ),r=new Set(e.map(sJ));if(!a.current||!function(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}(r,a.current.nodeIds)||n!==a.current.perspective){let t=Array.from(r).map(t=>{let{type:n,projectId:r,dataset:i}=e.find(e=>e.id===t);return r&&i?{_id:t,_type:n,_projectId:r,_dataset:i}:{_id:t,_type:n}});a.current={nodeIds:r,perspective:n},l(t,n)}},o=[t,n,l],s[2]=t,s[3]=n,s[4]=l,s[5]=i,s[6]=o):(i=s[5],o=s[6]),(0,c.useEffect)(i,o)}(C,W,q),_[4]!==J?(i=(e,t)=>{J&&(J.style.setProperty("--drag-preview-x",`${e}px`),J.style.setProperty("--drag-preview-y",`${t-window.scrollY}px`))},_[4]=J,_[5]=i):i=_[5];let en=i;_[6]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{let e=e=>{s9(e)&&et(an)},t=e=>{s9(e)&&et(ar),function(e,t){return e.every(e=>s6[e]?t[s6[e]]:t.key===e.toUpperCase())}(["mod","\\"],e)&&et(ai)};return window.addEventListener("click",at),window.addEventListener("keydown",t),window.addEventListener("keyup",e),()=>{window.removeEventListener("click",at),window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}},s=[et],_[6]=o,_[7]=s):(o=_[6],s=_[7]),(0,c.useEffect)(o,s);let[er,ei]=(0,c.useState)(!1),[es,ea]=(0,c.useState)(!1),el=(0,c.useRef)(void 0);_[8]!==ee?(a=()=>
194{if(ee)return s2(()=>{ei(!0),s2(()=>{ea(!0),el.current=setTimeout(()=>{ea(!1),ei(!1)},1500)})});el.current&&(clearTimeout(el.current),ei(!1),ea(!1))},l=[ee],_[8]=ee,_[9]=a,_[10]=l):(a=_[9],l=_[10]),(0,c.useEffect)(a,l),_[11]!==W?(f=W.flatMap(ao),_[11]=W,_[12]=f):f=_[12],d=f,_[13]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{z({type:"overlay/blur"})},_[13]=p):p=_[13];let eu=p,ec=eo()!==G;m=ec?O:void 0;e:{let e;if((R||V)&&"connected"!==I||Y){let e;_[14]===Symbol.for("react.memo_cache_sentinel")?(e=[],_[14]=e):e=_[14],g=e;break e}_[15]!==m||_[16]!==K||_[17]!==N||_[18]!==W||_[19]!==R||_[20]!==Y||_[21]!==ec||_[22]!==X?(e=W.filter(as).map(e=>{let{id:t,element:n,focused:r,hovered:i,rect:o,sanity:s,dragDisabled:a}=e,l=!a&&!!n.getAttribute("data-sanity")&&ec&&W.some(e=>"id"in e.sanity&&"id"in s&&tt(e.sanity,s)&&e.sanity.path!==s.path);return(0,u.jsx)(sA,{componentResolver:m,element:n,enableScrollIntoView:!Y&&!K&&!N,focused:r,hovered:i,node:s,rect:o,showActions:!R,draggable:l,isDragging:Y||K,wasMaybeCollapsed:r&&X},t)}),_[15]=m,_[16]=K,_[17]=N,_[18]=W,_[19]=R,_[20]=Y,_[21]=ec,_[22]=X,_[23]=e):e=_[23],g=e}let ed=g,eh=D?"dark":"light",ef=es?"":void 0,ep=er?"":void 0;return _[24]!==d||_[25]!==q?(y=(0,u.jsx)(s5,{documentIds:d,perspective:q}),_[24]=d,_[25]=q,_[26]=y):y=_[26],_[27]!==C||_[28]!==R||_[29]!==V||_[30]!==ee||_[31]!==J||_[32]!==en?(v=(0,u.jsx)(s3,{c
194omlink:C,dispatch:z,inFrame:R,inPopUp:V,onDrag:en,overlayEnabled:ee,rootElement:J}),_[27]=C,_[28]=R,_[29]=V,_[30]=ee,_[31]=J,_[32]=en,_[33]=v):v=_[33],_[34]!==F?(b=F&&(0,u.jsx)(sb,{...F,onDismiss:eu}),_[34]=F,_[35]=b):b=_[35],_[36]!==Z||_[37]!==B||_[38]!==K||_[39]!==U||_[40]!==Y?(x=Y&&!K&&(0,u.jsxs)(u.Fragment,{children:[B&&(0,u.jsx)(sO,{dragInsertPosition:B}),U&&(0,u.jsx)(sz,{}),Z&&(0,u.jsx)(sI,{dragGroupRect:Z})]}),_[36]=Z,_[37]=B,_[38]=K,_[39]=U,_[40]=Y,_[41]=x):x=_[41],_[42]!==H||_[43]!==Y?(w=Y&&H&&(0,u.jsx)(sV,{skeleton:H}),_[42]=H,_[43]=Y,_[44]=w):w=_[44],_[45]!==ed||_[46]!==ef||_[47]!==ep||_[48]!==y||_[49]!==v||_[50]!==b||_[51]!==x||_[52]!==w||_[53]!==L?(k=(0,u.jsxs)(s1,{"data-fading-out":ef,"data-overlays":ep,ref:Q,$zIndex:L,children:[y,v,b,ed,x,w]}),_[45]=ed,_[46]=ef,_[47]=ep,_[48]=y,_[49]=v,_[50]=b,_[51]=x,_[52]=w,_[53]=L,_[54]=k):k=_[54],_[55]!==C||_[56]!==k?(S=(0,u.jsx)(sq,{comlink:C,children:k}),_[55]=C,_[56]=k,_[57]=S):S=_[57],_[58]!==C||_[59]!==S?(E=(0,u.jsx)(sB,{comlink:C,children:S}),_[58]=C,_[59]=S,_[60]=E):E=_[60],_[61]!==C||_[62]!==W||_[63]!==E?(T=(0,u.jsx)(sH,{comlink:C,elements:W,children:E}),_[61]=C,_[62]=W,_[63]=E,_[64]=T):T=_[64],_[65]!==J||_[66]!==T?(j=(0,u.jsx)(P.XS,{children:(0,u.jsx)(P.GD,{element:J,children:T})}),_[65]=J,_[66]=T,_[67]=j):j=_[67],_[68]!==eh||_[69]!==j?(A=(0,u.jsx)(P.NP,{scheme:eh,theme:P.Qx,tone:"transparent",children:j}),_[68]=eh,_[69]=j,_[70]=A):A=_[70],_[71]!==C||_[72]!==A?(M=(0,u.jsx)(sK,{comlink:C,children:A}),_[71]=C,_[72]=A,_[73]=M):M=_[73],M},s6={alt:"altKey",ctrl:"ctrlKey",mod:"u">typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function s9(e){return"Alt"===e.key}function s8(e,t){return e.filter(e=>e!==t)}function s7(e){return!e}function ae(e){return e()}function at(e){let t=e.target;if(((0,P.nY)(t)||(0,P.sb)(t)&&t.closest("a"))&&e.altKey){e.preventDefault(),e.stopPropagation();let t=new MouseEvent(e.type,{...e,altKey:!1,bubbles:!0,cancelable:!0});e.target?.dispatchEvent(t)}}function an(e){return!e}function ar(e){return!e}function ai(e){return!e}function ao(e){return"id"in e.sanity?[e.sanity.id]:[]}function as(e){return e.activated||e.focused}let aa=e=>{let t,n,r=(0,h.c)(4),{comlink:i,refresh:o}=e,s=(0,c.useRef)(0),a=(0,c.useRef)(0);return r[0]!==i||r[1]!==o?(t=()=>i.on("presentation/refresh",e=>{if("manual"===e.source){let t;clearTimeout(s.current);let n=o(e);!1!==n&&(i.post("visual-editing/refreshing",e),t=!1,s.current=window.setTimeout(()=>{i.post("visual-editing/refreshed",e),t=!0},3e3),n?.finally?.(()=>{t||(clearTimeout(s.current),i.post("visual-editing/refreshed",e))}))}else if("mutation"===e.source){clearTimeout(a.current);let t=o(e);if(!1===t)return;i.post("visual-editing/refreshing",e),a.current=window.setTimeout(()=>{let t=o(e);!1!==t&&(i.post("visual-editing/refreshing",e),t?.finally?.(()=>{i.post("visual-editing/refreshed",e)})||i.post("visual-editing/refreshed",e))},1e3),t?.finally?.(()=>{i.post("visual-editing/refreshed",e)})||i.post("visual-editing/refreshed",e)}}),n=[i,o],r[0]=i,r[1]=o,r[2]=t,r[3]=n):(t=r[2],n=r[3]),(0,c.useEffect)(t,n),null};function al(e){let{data:t,origin:n}=e;t&&"object"==typeof t&&"domain"in t&&"sanity/channels"===t.domain&&"from"in t&&"presentation"===t.from&&"type"in t&&"presentation/status"===t.type&&window.parent.postMessage({domain:"sanity/channels",type:"visual-editing/status",data:{origin:location.origin}},n)}function au(){console.warn("[@sanity/visual-editing] Package version mismatch detected: Please update your Sanity studio to prevent potential compatibility issues.")}function ac(){}let ad=e=>{let t,n,r,i,o,s,a,l,d=(0,h.c)(22),{components:m,history:g,portal:y,refresh:v,zIndex:b}=e,x=void 0===y||y,[w,k]=(0,c.useState)(null),[S,E]=(0,c.useState)(null);d[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{k((0,f.Fk)()),E((0,f.v$)())},n=[],d[0]=t,d[1]=n):(t=d[0],n=d[1]),(0,c.useEffect)(t,n);let[T,j]=(0,c.useState)(null);d[2]!==x?(r=()=>{if(!1===x)return;let e=document.createElement("sanity-visual-editing");return document.documentElement.appendChild(e),j(e),()=>{j(null),document.documentElement.contains(e)&&document.documentElement.removeChild(e)}},i=[x],d[2]=x,d[3]=r,d[4]=i):(r=d[3],i=d[4]),(0,c.useEffect)(r,i);let[A,M]=function(e){let t,n,r,i,o,s=(0,h.c)(9),a=void 0===e||e,[l,u]=(0,c.useState)(),[d,p]=(0,c.useState)("idle");return s[0]!==a?(t=()=>{if(!a)return;let e=(0,tF.RM)({name:"visual-editing",connectTo:"presentation"},(0,tF.Uc)().provide({actors:(0,f.jF)()})),t=e.onStatus(()=>p("connected"),"connected");u(e);let n=e.start();return()=>{t(),n(),u(void 0)}},n=[a],s[0]=a,s[1]=t,s[2]=n):(t=s[1],n=s[2]),(0,c.useEffect)(t,n),s[3]!==d?(r=()=>{if("connected"===d)return;let e=new AbortController;return window.addEventListener("message",al,{signal:e.signal}),()=>{e.abort()}},i=[d],s[3]=d,s[4]=r,s[5]=i):(r=s[4],i=s[5]),(0,c.useEffect)(r,i),s[6]!==l||s[7]!==d?(o=[l,d],s[6]=l,s[7]=d,s[8]=o):o=s[8],o}(!0===w||!0===S);!function(e){let t,n,r=(0,h.c)(3);r[0]!==e?(t=()=>{if(!e)return;let t=function(e){let t=new tZ(1),n=new tG;return e.fetch("visual-editing/snapshot-welcome",void 0,{suppressWarnings:!0}).then(e=>{t.next(e.event)}).catch(()=>{}
194),e.on("presentation/snapshot-event",e=>{"reconnect"===e.event.type&&t.next(e.event),"mutation"===e.event.type&&n.next(e.event)}),nl(t,n)}(e),n=si.provide({actors:{documentMutatorMachine:(e=>{let t=(0,q.Sx)(async({input:t,signal:n})=>{let{id:r}=t,{snapshot:i}=await e.fetch("visual-editing/fetch-snapshot",{documentId:r},{signal:n});return i}),n=(0,q.Sx)(async({input:t})=>{let{transactions:n}=t;for(let t of n){let n=N.encodeTransaction(t);return e.post("visual-editing/mutate",n)}});return sn.provide({actions:{"send sync event to parent":(0,oF.b)(({enqueue:e})=>{e.sendParent(({context:e})=>({type:"sync",id:e.id,document:e.remote})),e.emit(({context:e})=>({type:"ready",snapshot:e.local}))})},actors:{"fetch remote snapshot":t,"submit mutations as transactions":n}})})(e)}}),r=(0,tB.A)(n,{input:{client:{withConfig:ac},sharedListener:t}});r.start();let i=new AbortController;return e.fetch("visual-editing/features",void 0,{signal:i.signal,suppressWarnings:!0}).then(e=>{e.features.optimistic&&function(e){for(let t of(X=e,K))t()}(r)}).catch(au),()=>{r.stop(),i.abort()}},n=[e],r[0]=e,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,c.useEffect)(t,n)}("connected"===M?A:void 0),d[5]!==A||d[6]!==M||d[7]!==m||d[8]!==w||d[9]!==S||d[10]!==b?(o=null!==w&&null!==S&&(0,u.jsx)(s4,{comlink:A,comlinkStatus:M,componentResolver:m,inFrame:w,inPopUp:S,zIndex:b}),d[5]=A,d[6]=M,d[7]=m,d[8]=w,d[9]=S,d[10]=b,d[11]=o):o=d[11],d[12]!==A||d[13]!==g||d[14]!==v?(s=A&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(so,{comlink:A,history:g}),(0,u.jsx)(ss,{comlink:A}),v&&(0,u.jsx)(aa,{comlink:A,refresh:v})]}),d[12]=A,d[13]=g,d[14]=v,d[15]=s):s=d[15],d[16]!==o||d[17]!==s?(a=(0,u.jsxs)(u.Fragment,{children:[o,s]}),d[16]=o,d[17]=s,d[18]=a):a=d[18];let _=a;return!1!==x&&T?(d[19]!==_||d[20]!==T?(l=(0,p.createPortal)(_,T),d[19]=_,d[20]=T,d[21]=l):l=d[21],l):_};ad.displayName="VisualEditing";let ah=null,af=null,ap=null;function am(e,{components:t,history:n,refresh:r,zIndex:i}){ap&&clearTimeout(ap),e.addEventListener("abort",()=>{ap=setTimeout(()=>{af&&(af.unmount(),af=null),ah&&(ah.parentNode.removeChild(ah),ah=null)},1e3)}),ah||(ah=document.createElement("sanity-visual-editing"),document.body.parentNode.insertBefore(ah,document.body.nextSibling)),af||(af=(0,d.createRoot)(ah)),af.render((0,u.jsx)(c.StrictMode,{children:(0,u.jsx)(ad,{components:t,history:n,refresh:r,zIndex:i,portal:!1})}))}},29610:(e,t)=>{"use strict";var n,r=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function y(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case o:case a:case s:case h:case f:return e;default:switch(e=e&&e.$$typeof){case c:case u:case d:case m:case p:case l:return e;default:return t}}case i:return t}}}n=Symbol.for("react.module.reference"),t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=d,t.Fragment=o,t.Lazy=m,t.Memo=p,t.Portal=i,t.Profiler=a,t.StrictMode=s,t.Suspense=h,t.SuspenseList=f,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return y(e)===u},t.isContextProvider=function(e){return y(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return y(e)===d},t.isFragment=function(e){return y(e)===o},t.isLazy=function(e){return y(e)===m},t.isMemo=function(e){return y(e)===p},t.isPortal=function(e){return y(e)===i},t.isProfiler=function(e){return y(e)===a},t.isStrictMode=function(e){return y(e)===s},t.isSuspense=function(e){return y(e)===h},t.isSuspenseList=function(e){return y(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===a||e===s||e===h||e===f||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===p||e.$$typeof===l||e.$$typeof===u||e.$$typeof===d||e.$$typeof===n||void 0!==e.getModuleId)||!1},t.typeOf=y},32459:e=>{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},33573:(e,t,n)=>{var r=n(25080),i=n(13574),o=n(23079),s=r?r.toStringTag:void 0;
194e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},34589:(e,t,n)=>{var r=n(79990),i=n(6797);e.exports=r(function(e,t,n){return e+(n?" ":"")+i(t)})},37978:(e,t,n)=>{"use strict";let r;function i(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function o(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function s(e,t,n,r){if("function"==typeof t){let[i,s]=o(r);t=t(void 0!==n?n:e.custom,i,s)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[i,s]=o(r);t=t(void 0!==n?n:e.custom,i,s)}return t}function a(e,t,n){let r=e.getProps();return s(r,t,void 0!==n?n:r.custom,e)}function l(e,t){return e?.[t]??e?.default??e}n.d(t,{P:()=>om});let u=e=>e,c={},d=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],h={value:null,addProjectionMetrics:null};function f(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=d.reduce((e,n)=>(e[n]=function(e,t){let n=new Set,r=new Set,i=!1,o=!1,s=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(t){s.has(t)&&(c.schedule(t),e()),l++,t(a)}let c={schedule:(e,t=!1,o=!1)=>{let a=o&&i?n:r;return t&&s.add(e),a.has(e)||a.add(e),e},cancel:e=>{r.delete(e),s.delete(e)},process:e=>{if(a=e,i){o=!0;return}i=!0,[n,r]=[r,n],n.forEach(u),t&&h.value&&h.value.frameloop[t].push(l),l=0,n.clear(),i=!1,o&&(o=!1,c.process(e))}};return c}(o,t?n:void 0),e),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:f,update:p,preRender:m,render:g,postRender:y}=s,v=()=>{let o=c.useManualTiming?i.timestamp:performance.now();n=!1,c.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),f.process(i),p.process(i),m.process(i),g.process(i),y.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(v))};return{schedule:d.reduce((t,o)=>{let a=s[o];return t[o]=(t,o=!1,s=!1)=>(!n&&(n=!0,r=!0,i.isProcessing||e(v)),a.schedule(t,o,s)),t},{}),cancel:e=>{for(let t=0;t<d.length;t++)s[d[t]].cancel(e)},state:i,steps:s}}let{schedule:p,cancel:m,state:g,steps:y}=f("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0),v=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],b=new Set(v),x=new Set(["width","height","top","left","right","bottom",...v]);function w(e,t){-1===e.indexOf(t)&&e.push(t)}function k(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}class S{constructor(){this.subscriptions=[]}add(e){return w(this.subscriptions,e),()=>k(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function E(){r=void 0}let T={now:()=>(void 0===r&&T.set(g.isProcessing||c.useManualTiming?g.timestamp:performance.now()),r),set:e=>{r=e,queueMicrotask(E)}},j={current:void 0};class A{constructor(e,t={}){this.version="12.8.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{let n=T.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){this.current=e,this.updatedAt=T.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new S);let n=this.events[e].add(t);return"change"===e?()=>{n(),p.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){"none"===e&&console.trace(),t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}
194setWithVelocity(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 j.current&&j.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=T.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),n?1e3/n*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function M(e,t){return new A(e,t)}let _=e=>Array.isArray(e),P=e=>!!(e&&e.getVelocity);function C(e,t){let n=e.getValue("willChange");if(P(n)&&n.add)return n.add(t);if(!n&&c.WillChange){let n=new c.WillChange("auto");e.addValue("willChange",n),n.add(t)}}let I=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),O="data-"+I("framerAppearId"),R=(e,t)=>n=>t(e(n)),V=(...e)=>e.reduce(R),L=(e,t,n)=>n>t?t:n<e?e:n,D=e=>1e3*e,$={layout:0,mainThread:0,waapi:0},z=()=>{},F=()=>{},B=e=>t=>"string"==typeof t&&t.startsWith(e),N=B("--"),U=B("var(--"),H=e=>!!U(e)&&W.test(e.split("/*")[0].trim()),W=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Y={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},q={...Y,transform:e=>L(0,1,e)},G={...Y,default:1},X=e=>Math.round(1e5*e)/1e5,K=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Z=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,J=(e,t)=>n=>!!("string"==typeof n&&Z.test(n)&&n.startsWith(e)||t&&null!=n&&Object.prototype.hasOwnProperty.call(n,t)),Q=(e,t,n)=>r=>{if("string"!=typeof r)return r;let[i,o,s,a]=r.match(K);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ee={...Y,transform:e=>Math.round(L(0,255,e))},et={test:J("rgb","red"),parse:Q("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ee.transform(e)+", "+ee.transform(t)+", "+ee.transform(n)+", "+X(q.transform(r))+")"},en={test:J("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:et.transform},er=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ei=er("deg"),eo=er("%"),es=er("px"),ea=er("vh"),el=er("vw"),eu={...eo,parse:e=>eo.parse(e)/100,transform:e=>eo.transform(100*e)},ec={test:J("hsl","hue"),parse:Q("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+eo.transform(X(t))+", "+eo.transform(X(n))+", "+X(q.transform(r))+")"},ed={test:e=>et.test(e)||en.test(e)||ec.test(e),parse:e=>et.test(e)?et.parse(e):ec.test(e)?ec.parse(e):en.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?et.transform(e):ec.transform(e)},eh=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ef="number",ep="color",em=/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 eg(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],o=0,s=t.replace(em,e=>(ed.test(e)?(r.color.push(o),i.push(ep),n.push(ed.parse(e))):e.startsWith("var(")?(r.var.push(o),i.push("var"),n.push(e)):(r.number.push(o),i.push(ef),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:s,indexes:r,types:i}}function ey(e){return eg(e).values}function ev(e){let{split:t,types:n}=eg(e),r=t.length;return e=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],void 0!==e[o]){let t=n[o];t===ef?i+=X(e[o]):t===ep?i+=ed.transform(e[o]):i+=e[o]}return i}}let eb=e=>"number"==typeof e?0:e,ex={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(K)?.length||0)+(e.match(eh)?.length||0)>0},parse:ey,createTransformer:ev,getAnimatableNone:function(e){let t=ey(e);return ev(e)(t.map(eb))}};
194function ew(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ek(e,t){return n=>n>0?t:e}let eS=(e,t,n)=>e+(t-e)*n,eE=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},eT=[en,et,ec];function ej(e){let t=eT.find(t=>t.test(e));if(z(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===ec&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,o=0,s=0;if(t/=100){let r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;i=ew(a,r,e+1/3),o=ew(a,r,e),s=ew(a,r,e-1/3)}else i=o=s=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*s),alpha:r}}(n)),n}let eA=(e,t)=>{let n=ej(e),r=ej(t);if(!n||!r)return ek(e,t);let i={...n};return e=>(i.red=eE(n.red,r.red,e),i.green=eE(n.green,r.green,e),i.blue=eE(n.blue,r.blue,e),i.alpha=eS(n.alpha,r.alpha,e),et.transform(i))},eM=new Set(["none","hidden"]);function e_(e,t){return n=>eS(e,t,n)}function eP(e){return"number"==typeof e?e_:"string"==typeof e?H(e)?ek:ed.test(e)?eA:eO:Array.isArray(e)?eC:"object"==typeof e?ed.test(e)?eA:eI:ek}function eC(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>eP(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function eI(e,t){let n={...e,...t},r={};for(let i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=eP(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}let eO=(e,t)=>{let n=ex.createTransformer(t),r=eg(e),i=eg(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?eM.has(e)&&!i.values.length||eM.has(t)&&!r.values.length?function(e,t){return eM.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):V(eC(function(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let o=t.types[i],s=e.indexes[o][r[o]],a=e.values[s]??0;n[i]=a,r[o]++}return n}(r,i),i.values),n):(z(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),ek(e,t))};function eR(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?eS(e,t,n):eP(e)(e,t)}let eV=e=>{let t=({timestamp:t})=>e(t);return{start:()=>p.update(t,!0),stop:()=>m(t),now:()=>g.isProcessing?g.timestamp:T.now()}},eL=(e,t,n=10)=>{let r="",i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=e(t/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`};function eD(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}function e$(e,t,n){var r,i;let o=Math.max(t-5,0);return r=n-e(o),(i=t-o)?1e3/i*r:0}let ez={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function eF(e,t){return e*Math.sqrt(1-t*t)}let eB=["duration","bounce"],eN=["stiffness","damping","mass"];function eU(e,t){return t.some(t=>void 0!==e[t])}function eH(e=ez.visualDuration,t=ez.bounce){let n,r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:i,restDelta:o}=r,s=r.keyframes[0],a=r.keyframes[r.keyframes.length-1],l={done:!1,value:s},{stiffness:u,damping:c,mass:d,duration:h,velocity:f,isResolvedFromDuration:p}=function(e){let t={velocity:ez.velocity,stiffness:ez.stiffness,damping:ez.damping,mass:ez.mass,isResolvedFromDuration:!1,...e};if(!eU(e,eN)&&eU(e,eB))if(e.visualDuration){let n=2*Math.PI/(1.2*e.visualDuration),r=n*n,i=2*L(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:ez.mass,stiffness:r,damping:i}}else{let n=function({duration:e=ez.duration,bounce:t=ez.bounce,velocity:n=ez.velocity,mass:r=ez.mass}){let i,o;z(e<=D(ez.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=L(ez.minDamping,ez.maxDamping,s),e=L(ez.minDuration,ez.maxDuration,e/1e3),s<1?(i=t=>{let r=t*s,i=r*e;return .001-(r-n)/eF(t,s)*Math.exp(-i)},o=t=>{let r=t*s*e,o=Math.pow(s,2)*Math.pow(t,2)*e,a=Math.exp(-r),l=eF(Math.pow(t,2),s);return(r*n+n-o)*a*(-i(t)+.001>0?-1:1)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),o=t=>e*e*(n-t)*Math.exp(-t*e));let a=function(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}(i,o,5/e);if(e=D(e),isNaN(a))return{stiffness:ez.stiffness,damping:ez.damping,duration:e};{let t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}(e);(t={...t,...n,mass:ez.mass}).isResolvedFromDuration=!0}return t}({...r,velocity:-((r.velocity||0)/1e3)}
194),m=f||0,g=c/(2*Math.sqrt(u*d)),y=a-s,v=Math.sqrt(u/d)/1e3,b=5>Math.abs(y);if(i||(i=b?ez.restSpeed.granular:ez.restSpeed.default),o||(o=b?ez.restDelta.granular:ez.restDelta.default),g<1){let e=eF(v,g);n=t=>a-Math.exp(-g*v*t)*((m+g*v*y)/e*Math.sin(e*t)+y*Math.cos(e*t))}else if(1===g)n=e=>a-Math.exp(-v*e)*(y+(m+v*y)*e);else{let e=v*Math.sqrt(g*g-1);n=t=>{let n=Math.exp(-g*v*t),r=Math.min(e*t,300);return a-n*((m+g*v*y)*Math.sinh(r)+e*y*Math.cosh(r))/e}}let x={calculatedDuration:p&&h||null,next:e=>{let t=n(e);if(p)l.done=e>=h;else{let r=0===e?m:0;g<1&&(r=0===e?D(m):e$(n,e,t));let s=Math.abs(a-t)<=o;l.done=Math.abs(r)<=i&&s}return l.value=l.done?a:t,l},toString:()=>{let e=Math.min(eD(x),2e4),t=eL(t=>x.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return x}function eW({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){let d,h,f=e[0],p={done:!1,value:f},m=n*t,g=f+m,y=void 0===s?g:s(g);y!==g&&(m=y-f);let v=e=>-m*Math.exp(-e/r),b=e=>y+v(e),x=e=>{let t=v(e),n=b(e);p.done=Math.abs(t)<=u,p.value=p.done?y:n},w=e=>{let t;if(t=p.value,void 0!==a&&t<a||void 0!==l&&t>l){var n;d=e,h=eH({keyframes:[p.value,(n=p.value,void 0===a?l:void 0===l||Math.abs(a-n)<Math.abs(l-n)?a:l)],velocity:e$(b,e,p.value),damping:i,stiffness:o,restDelta:u,restSpeed:c})}};return w(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==d||(t=!0,x(e),w(e)),void 0!==d&&e>=d)?h.next(e-d):(t||x(e),p)}}}eH.applyToOptions=e=>{let t=function(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(eD(r),2e4);return{type:"keyframes",ease:e=>r.next(i*e).value/t,duration:i/1e3}}(e,100,eH);return e.ease=t.ease,e.duration=D(t.duration),e.type="keyframes",e};let eY=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function eq(e,t,n,r){return e===t&&n===r?u:i=>0===i||1===i?i:eY(function(e,t,n,r,i){let o,s,a=0;do(o=eY(s=t+(n-t)/2,r,i)-e)>0?n=s:t=s;while(Math.abs(o)>1e-7&&++a<12);return s}(i,0,1,e,n),t,r)}let eG=eq(.42,0,1,1),eX=eq(0,0,.58,1),eK=eq(.42,0,.58,1),eZ=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,eJ=e=>t=>1-e(1-t),eQ=eq(.33,1.53,.69,.99),e0=eJ(eQ),e1=eZ(e0),e2=e=>(e*=2)<1?.5*e0(e):.5*(2-Math.pow(2,-10*(e-1))),e5=e=>1-Math.sin(Math.acos(e)),e3=eJ(e5),e4=eZ(e5),e6=e=>Array.isArray(e)&&"number"==typeof e[0],e9={linear:u,easeIn:eG,easeInOut:eK,easeOut:eX,circIn:e5,circInOut:e4,circOut:e3,backIn:e0,backInOut:e1,backOut:eQ,anticipate:e2},e8=e=>{if(e6(e)){F(4===e.length,"Cubic bezier arrays must contain four numerical values.");let[t,n,r,i]=e;return eq(t,n,r,i)}return"string"==typeof e?(F(void 0!==e9[e],`Invalid easing type '${e}'`),e9[e]):e},e7=(e,t,n)=>{let r=t-e;return 0===r?1:(n-e)/r};function te({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){var i;let o=Array.isArray(r)&&"number"!=typeof r[0]?r.map(e8):e8(r),s={done:!1,value:t[0]},a=function(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let o=e.length;if(F(o===t.length,"Both input and output ranges must be the same length"),1===o)return()=>t[0];if(2===o&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=function(e,t,n){let r=[],i=n||c.mix||eR,o=e.length-1;for(let n=0;n<o;n++){let o=i(e[n],e[n+1]);t&&(o=V(Array.isArray(t)?t[n]||u:t,o)),r.push(o)}return r}(t,r,i),l=a.length,d=n=>{if(s&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=e7(e[r],e[r+1],n);return a[r](i)};return n?t=>d(L(e[0],e[o-1],t)):d}((i=n&&n.length===t.length?n:function(e){let t=[0];return!function(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=e7(0,t,r);e.push(eS(n,1,i))}}(t,e.length-1),t}(t),i.map(t=>t*e)),t,{ease:Array.isArray(o)?o:t.map(()=>o||eK).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(s.value=a(t),s.done=t>=e,s)}}let tt=e=>null!==e;function tn(e,{repeat:t,repeatType:n="loop"},r,i=1){let o=e.filter(tt),s=i<0||t&&"loop"!==n&&t%2==1?0:o.length-1;return s&&void 0!==r?r:o[s]}let tr={decay:eW,inertia:eW,tween:te,keyframes:te,spring:eH};function ti(e){"string"==typeof e.type&&(e.type=tr[e.type])}class to{constructor(){this.count=0,this.updateFinished()}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let ts=e=>e/100;class ta extends to{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;if(e&&e.updatedAt!==T.now()&&this.tick(T.now()),this.isStopped=!0,"idle"===this.state)return;this.teardown();let{onStop:t}=this.options;t&&t()},$.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){let{options:e}=this;ti(e);let{type:t=te,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=e,{keyframes:s}=e,a=t||te;a!==te&&"number"!=typeof s[0]&&(this.mixKeyframes=V(ts,eR(s[0],s[1])),s=[0,100]);let l=a({...e,keyframes:s}
194);"mirror"===i&&(this.mirroredGenerator=a({...e,keyframes:[...s].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=eD(l));let{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);let{delay:l=0,keyframes:u,repeat:c,repeatType:d,repeatDelay:h,type:f,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let v=this.currentTime,b=n;if(c){let e=Math.min(this.currentTime,r)/s,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,(t=Math.min(t,c+1))%2&&("reverse"===d?(n=1-n,h&&(n-=h/s)):"mirror"===d&&(b=o)),v=L(0,1,n)*s}let x=y?{done:!1,value:u[0]}:b.next(v);i&&(x.value=i(x.value));let{done:w}=x;
194y||null===a||(w=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&f!==eW&&(x.value=tn(u,this.options,m,this.speed)),p&&p(x.value),k&&this.finish(),x}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get time(){return this.currentTime/1e3}set time(e){e=D(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(T.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=eV,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();let r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:"finished"===this.state?(this.updateFinished(),this.startTime=r):this.startTime||(this.startTime=n??r),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(T.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished";let{onComplete:e}=this.options;e&&e()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,$.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),e.observe(this)}}let tl=e=>180*e/Math.PI,tu=e=>td(tl(Math.atan2(e[1],e[0]))),tc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:tu,rotateZ:tu,skewX:e=>tl(Math.atan(e[1])),skewY:e=>tl(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},td=e=>((e%=360)<0&&(e+=360),e),th=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tf=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),tp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:th,scaleY:tf,scale:e=>(th(e)+tf(e))/2,rotateX:e=>td(tl(Math.atan2(e[6],e[5]))),rotateY:e=>td(tl(Math.atan2(-e[2],e[0]))),rotateZ:tu,rotate:tu,skewX:e=>tl(Math.atan(e[4])),skewY:e=>tl(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tm(e){return+!!e.includes("scale")}function tg(e,t){let n,r;if(!e||"none"===e)return tm(t);let i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(i)n=tp,r=i;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=tc,r=t}if(!r)return tm(t);let o=n[t],s=r[1].split(",").map(ty);return"function"==typeof o?o(s):s[o]}function ty(e){return parseFloat(e.trim())}let tv=e=>e===Y||e===es,tb=new Set(["x","y","z"]),tx=v.filter(e=>!tb.has(e)),tw={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>tg(t,"x"),y:(e,{transform:t})=>tg(t,"y")};tw.translateX=tw.x,tw.translateY=tw.y;let tk=new Set,tS=!1,tE=!1,tT=!1;function tj(){if(tE){let e=Array.from(tk).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=function(e){let t=[];return tx.forEach(n=>{let r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(+!!n.startsWith("scale")))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}
194tE=!1,tS=!1,tk.forEach(e=>e.complete(tT)),tk.clear()}function tA(){tk.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(tE=!0)})}class tM{constructor(e,t,n,r,i,o=!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=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(tk.add(this),tS||(tS=!0,p.read(tA),p.resolveKeyframes(tj))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){let i=r?.get(),o=e[e.length-1];if(void 0!==i)e[0]=i;else if(n&&t){let r=n.readValue(t,o);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=o),r&&void 0===i&&r.set(e[0])}for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),tk.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,tk.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}function t_(e){let t;return()=>(void 0===t&&(t=e()),t)}let tP=t_(()=>void 0!==window.ScrollTimeline),tC={},tI=function(e,t){let n=t_(e);return()=>tC[t]??n()}(()=>{try{document.createElement("div").animate({opacity:0}
194,{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),tO=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,tR={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tO([0,.65,.55,1]),circOut:tO([.55,0,1,.45]),backIn:tO([.31,.01,.66,-.59]),backOut:tO([.33,1.53,.69,.99])};function tV(e){return"function"==typeof e&&"applyToOptions"in e}class tL extends to{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:s}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,F("string"!=typeof e.type,'animateMini doesn\'t support "type" as a string. Did you mean to import { spring } from "motion"?');let a=function({type:e,...t}){return tV(e)&&tI()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=function(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:l}={},u){let c={[t]:n};l&&(c.offset=l);let d=function e(t,n){if(t)return"function"==typeof t?tI()?eL(t,n):"ease-out":e6(t)?tO(t):Array.isArray(t)?t.map(t=>e(t,n)||tR.easeOut):tR[t]}(a,i);Array.isArray(d)&&(c.easing=d),h.value&&$.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"};u&&(f.pseudoElement=u);let p=e.animate(c,f);return h.value&&p.finished.finally(()=>{$.waapi--}),p}(t,n,r,a,i),!1===a.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=tn(r,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(e):function(e,t,n){t.startsWith("--")?e.style.setProperty(t,n):e.style[t]=n}(t,n,e),this.animation.cancel()}this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(e){this.finishedTime=null,this.animation.currentTime=D(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&tP())?(this.animation.timeline=e,u):t(this)}}let tD={anticipate:e2,backInOut:e1,circInOut:e4};class t$ extends tL{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in tD&&(e.ease=tD[e.ease])}(e),ti(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...o}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);let s=new ta({...o,autoplay:!1}),a=D(this.finishedTime??this.time);t.setWithVelocity(s.sample(a-10).value,s.sample(a).value,10),s.stop()}}let tz=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(ex.test(e)||"0"===e)&&!e.startsWith("url(")),tF=new Set(["opacity","clipPath","filter","transform"]),tB=t_(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class tN extends to{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:s,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation?(this._animation.stop(),this.stopTimeline?.()):this.keyframeResolver?.cancel()},this.createdAt=T.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:
194o,name:a,motionValue:l,element:u,...c},h=u?.KeyframeResolver||tM;this.keyframeResolver=new h(s,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:o,velocity:s,delay:a,isHandoff:l,onUpdate:d,onComplete:h}=n;this.resolvedAt=T.now(),!function(e,t,n,r){let i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;let o=e[e.length-1],s=tz(i,t),a=tz(o,t);return z(s===a,`You are trying to animate ${t} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!!s&&!!a&&(function(e){let t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||tV(n))&&r)}(e,i,o,s)&&((c.instantAnimations||!a)&&d?.(tn(e,n,t)),e[0]=e[e.length-1],n.duration=0,n.repeat=0);let f={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},p=!l&&function(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:o,type:s}=e;if(!t||!t.owner||!(t.owner.current instanceof HTMLElement))return!1;let{onUpdate:a,transformTemplate:l}=t.owner.getProps();return tB()&&n&&tF.has(n)&&("transform"!==n||!l)&&!a&&!r&&"mirror"!==i&&0!==o&&"inertia"!==s}(f)?new t$({...f,element:f.motionValue.owner.current}):new ta(f);p.finished.then(()=>{h?.(),this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(tT=!0,tA(),tj(),tT=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this.animation.cancel()}}let tU=e=>null!==e,tH={type:"spring",stiffness:500,damping:25,restSpeed:10},tW={type:"keyframes",duration:.8},tY={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tq=(e,t,n,r={},i,o)=>s=>{let a=l(r,e)||{},u=a.delay||r.delay||0,{elapsed:d=0}=r;d-=D(u);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-d,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};!function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(a)&&Object.assign(h,((e,{keyframes:t})=>t.length>2?tW:b.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:tH:tY)(e,h)),h.duration&&(h.duration=D(h.duration)),h.repeatDelay&&(h.repeatDelay=D(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let f=!1;if(!1!==h.type&&(0!==h.duration||h.repeatDelay)||(h.duration=0,0===h.delay&&(f=!0)),(c.instantAnimations||c.skipAnimations)&&(f=!0,h.duration=0,h.delay=0),h.allowFlatten=!a.type&&!a.ease,f&&!o&&void 0!==t.get()){let e=function(e,{repeat:t,repeatType:n="loop"},r){let i=e.filter(tU),o=t&&"loop"!==n&&t%2==1?0:i.length-1;return i[o]}(h.keyframes,a);if(void 0!==e)return void p.update(()=>{h.onUpdate(e),h.onComplete()})}return new tN(h)};function tG(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...u}=t;r&&(o=r);let c=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in u){let r=e.getValue(t,e.latestValues[t]??null),i=u[t];if(void 0===i||d&&function({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}(d,t))continue;let s={delay:n,...l(o||{},t)},a=!1;if(window.MotionHandoffAnimation){let n=e.props[O];if(n){let e=window.MotionHandoffAnimation(n,t,p);null!==e&&(s.startTime=e,a=!0)}}C(e,t),r.start(tq(t,r,i,e.shouldReduceMotion&&x.has(t)?{type:!1}:s,e,a));let h=r.animation;h&&c.push(h)}return s&&Promise.all(c).then(()=>{p.update(()=>{s&&function(e,t){let{transitionEnd:n={},transition:r={},...i}=a(e,t)||{};for(let t in i={...i,...n}){var o;let n=_(o=i[t])?o[o.length-1]||0:o;e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,M(n))}}(e,s)})}),c}function tX(e,t,n={}){let r=a(e,t,"exit"===n.type?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let o=r?()=>Promise.all(tG(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,i=1,o){let s=[],a=(e.variantChildren.size-1)*r,l=1===i?(e=0)=>e*r:(e=0)=>a-e*r;
194return Array.from(e.variantChildren).sort(tK).forEach((e,r)=>{e.notify("AnimationStart",t),s.push(tX(e,t,{...o,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)return Promise.all([o(),s(n.delay)]);{let[e,t]="beforeChildren"===l?[o,s]:[s,o];return e().then(()=>t())}}function tK(e,t){return e.sortNodePosition(t)}function tZ(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function tJ(e){return"string"==typeof e||Array.isArray(e)}let tQ=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],t0=["initial",...tQ],t1=t0.length,t2=[...tQ].reverse(),t5=tQ.length;function t3(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function t4(){return{animate:t3(!0),whileInView:t3(),whileHover:t3(),whileTap:t3(),whileDrag:t3(),whileFocus:t3(),exit:t3()}}class t6{constructor(e){this.isMounted=!1,this.node=e}update(){}}class t9 extends t6{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>(function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t))r=Promise.all(t.map(t=>tX(e,t,n)));else if("string"==typeof t)r=tX(e,t,n);else{let i="function"==typeof t?a(e,t,n.custom):t;r=Promise.all(tG(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})})(e,t,n))),n=t4(),r=!0,o=t=>(n,r)=>{let i=a(e,r,"exit"===t?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function s(s){let{props:l}=e,u=function e(t){if(!t)return;if(!t.isControllingVariants){let n=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(n.initial=t.props.initial),n}let n={};for(let e=0;e<t1;e++){let r=t0[e],i=t.props[r];(tJ(i)||!1===i)&&(n[r]=i)}return n}(e.parent)||{},c=[],d=new Set,h={},f=1/0;for(let t=0;t<t5;t++){var p,m;let a=t2[t],g=n[a],y=void 0!==l[a]?l[a]:u[a],v=tJ(y),b=a===s?g.isActive:null;!1===b&&(f=t);let x=y===u[a]&&y!==l[a]&&v;if(x&&r&&e.manuallyAnimateOnMount&&(x=!1),g.protectedKeys={...h},!g.isActive&&null===b||!y&&!g.prevProp||i(y)||"boolean"==typeof y)continue;let w=(p=g.prevProp,"string"==typeof(m=y)?m!==p:!!Array.isArray(m)&&!tZ(m,p)),k=w||a===s&&g.isActive&&!x&&v||t>f&&v,S=!1,E=Array.isArray(y)?y:[y],T=E.reduce(o(a),{});!1===b&&(T={});let{prevResolvedValues:j={}}=g,A={...j,...T},M=t=>{k=!0,d.has(t)&&(S=!0,d.delete(t)),g.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in A){let t=T[e],n=j[e];if(!h.hasOwnProperty(e))(_(t)&&_(n)?tZ(t,n):t===n)?void 0!==t&&d.has(e)?M(e):g.protectedKeys[e]=!0:null!=t?M(e):d.add(e)}g.prevProp=y,g.prevResolvedValues=T,g.isActive&&(h={...h,...T}),r&&e.blockInitialAnimation&&(k=!1);let P=!(x&&w)||S;k&&P&&c.push(...E.map(e=>({animation:e,options:{type:a}})))}if(d.size){let t={};if("boolean"!=typeof l.initial){let n=a(e,Array.isArray(l.initial)?l.initial[0]:l.initial);n&&n.transition&&(t.transition=n.transition)}d.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let g=!!c.length;return r&&(!1===l.initial||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=t4(),r=!0}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();i(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let t8=0;class t7 extends t6{constructor(){super(...arguments),this.id=t8++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>
194{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}let ne={x:!1,y:!1};function nt(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}let nn=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function nr(e){return{point:{x:e.pageX,y:e.pageY}}}function ni(e,t,n,r){return nt(e,t,e=>nn(e)&&n(e,nr(e)),r)}function no({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ns(e){return e.max-e.min}function na(e,t,n,r=.5){e.origin=r,e.originPoint=eS(t.min,t.max,e.origin),e.scale=ns(n)/ns(t),e.translate=eS(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function nl(e,t,n,r){na(e.x,t.x,n.x,r?r.originX:void 0),na(e.y,t.y,n.y,r?r.originY:void 0)}function nu(e,t,n){e.min=n.min+t.min,e.max=e.min+ns(t)}function nc(e,t,n){e.min=t.min-n.min,e.max=e.min+ns(t)}function nd(e,t,n){nc(e.x,t.x,n.x),nc(e.y,t.y,n.y)}let nh=()=>({translate:0,scale:1,origin:0,originPoint:0}),nf=()=>({x:nh(),y:nh()}),np=()=>({min:0,max:0}),nm=()=>({x:np(),y:np()});function ng(e){return[e("x"),e("y")]}function ny(e){return void 0===e||1===e}function nv({scale:e,scaleX:t,scaleY:n}){return!ny(e)||!ny(t)||!ny(n)}function nb(e){return nv(e)||nx(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function nx(e){var t,n;return(t=e.x)&&"0%"!==t||(n=e.y)&&"0%"!==n}function nw(e,t,n,r,i){return void 0!==i&&(e=r+i*(e-r)),r+n*(e-r)+t}function nk(e,t=0,n=1,r,i){e.min=nw(e.min,t,n,r,i),e.max=nw(e.max,t,n,r,i)}function nS(e,{x:t,y:n}){nk(e.x,t.translate,t.scale,t.originPoint),nk(e.y,n.translate,n.scale,n.originPoint)}function nE(e,t){e.min=e.min+t,e.max=e.max+t}function nT(e,t,n,r,i=.5){let o=eS(e.min,e.max,i);nk(e,t,n,o,r)}function nj(e,t){nT(e.x,t.x,t.scaleX,t.scale,t.originX),nT(e.y,t.y,t.scaleY,t.scale,t.originY)}function nA(e,t){return no(function(e,t){if(!t)return e;let 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))}let nM=({current:e})=>e?e.ownerDocument.defaultView:null;function n_(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}let nP=(e,t)=>Math.abs(e-t);class nC{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=nR(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){return Math.sqrt(nP(e.x,t.x)**2+nP(e.y,t.y)**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=g;this.history.push({...r,timestamp:i});let{onStart:o,onMove:s}=this.handlers;t||(o&&o(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=nI(t,this.transformPagePoint),p.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let o=nR("pointercancel"===e.type?this.lastMoveEventInfo:nI(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,o),r&&r(e,o)},!nn(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;let o=nI(nr(e),this.transformPagePoint),{point:s}=o,{timestamp:a}=g;this.history=[{...s,timestamp:a}];let{onSessionStart:l}=t;l&&l(e,nR(o,this.history)),this.removeListeners=V(ni(this.contextWindow,"pointermove",this.handlePointerMove),ni(this.contextWindow,"pointerup",this.handlePointerUp),ni(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),m(this.updatePoint)}}function nI(e,t){return t?{point:t(e.point)}:e}function nO(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nR({point:e},t){return{point:e,delta:nO(e,nV(t)),offset:nO(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=nV(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>D(.1)));)n--;if(!r)return{x:0,y:0};let o=(i.timestamp-r.timestamp)/1e3;if(0===o)return{x:0,y:0};let s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}(t,.1)}}function nV(e){return e[e.length-1]}function nL(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 nD(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function n$(e,t,n){return{min:nz(e,t),max:nz(e,n)}}function nz(e,t){return"number"==typeof e?e:e[t]||0}let nF=new WeakMap;
194class nB{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=nm(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){let{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;let r=e=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(nr(e).point)},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(ne[e])return null;else return ne[e]=!0,()=>{ne[e]=!1};return ne.x||ne.y?null:(ne.x=ne.y=!0,()=>{ne.x=ne.y=!1})}(n),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ng(e=>{let t=this.getAxisMotionValue(e).get()||0;if(eo.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=ns(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&p.postRender(()=>i(e,t)),C(this.visualElement,"transform");let{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},o=(e,t)=>{let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:s}=t;if(r&&null===this.currentDirection){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),null!==this.currentDirection&&i&&i(this.currentDirection);return}this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),o&&o(e,t)},s=(e,t)=>this.stop(e,t),a=()=>ng(e=>"paused"===this.getAnimationState(e)&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new nC(e,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:s,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:nM(this.visualElement)})}stop(e,t){let n=this.isDragging;if(this.cancel(),!n)return;let{velocity:r}=t;this.startAnimation(r);let{onDragEnd:i}=this.getProps();i&&p.postRender(()=>i(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!nN(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?eS(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?eS(n,e,r.max):Math.min(e,n)),e}(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&n_(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=function(e,{top:t,left:n,bottom:r,right:i}){return{x:nL(e.x,n,i),y:nL(e.y,t,r)}}(n.layoutBox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:n$(e,"left","right"),y:n$(e,"top","bottom")}}(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&ng(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){let n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!n_(t))return!1;let r=t.current;F(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;let o=function(e,t,n){let r=nA(e,n),{scroll:i}=t;return i&&(nE(r.x,i.offset.x),nE(r.y,i.offset.y)),r}(r,i.root,this.visualElement.getTransformPagePoint()),s=(e=i.layout.layoutBox,{x:nD(e.x,o.x),y:nD(e.y,o.y)});if(n){let e=n(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(s));this.hasMutatedConstraints=!!e,e&&(s=no(e))}return s}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{};return Promise.all(ng(s=>{if(!nN(s,t,this.currentDirection))return;let l=a&&a[s]||{};o&&(l={min:0,max:0});let u={type:"inertia",velocity:n?e[s]:0,bounceStiffness:r?200:1e6,bounceDamping:r?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,u)})).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return C(this.visualElement,e),n.start(tq(e,n,0,t,this.visualElement,!1))}stopAnimation(){ng(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){ng(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let 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){ng(t=>{let{drag:n}=this.getProps();if(!nN(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:o}=r.layout.layoutBox[t];i.set(e[t]-eS(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!n_(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};ng(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){let n=t.get();r[e]=function(e,t){let n=.5,r=ns(e),i=ns(t);return i>r?n=e7(t.min,t.max-r,e.min):r>i&&(n=e7(e.min,e.max-i,t.min)),L(0,1,n)}({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ng(t=>{if(!nN(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:o}=this.constraints[t];n.set(eS(i,o,r[t]))})}addListeners(){if(!this.visualElement.current)return;nF.set(this.visualElement,this);let e=ni(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:n=!0}
194=this.getProps();t&&n&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();n_(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()),p.read(t);let i=nt(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ng(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{i(),e(),r(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=.35,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:s}}}function nN(e,t,n){return(!0===t||t===e)&&(null===n||n===e)}class nU extends t6{constructor(e){super(e),this.removeGroupControls=u,this.removeListeners=u,this.controls=new nB(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||u}unmount(){this.removeGroupControls(),this.removeListeners()}}let nH=e=>(t,n)=>{e&&p.postRender(()=>e(t,n))};class nW extends t6{constructor(){super(...arguments),this.removePointerDownListener=u}onPointerDown(e){this.session=new nC(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nM(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:nH(e),onStart:nH(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&p.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=ni(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}var nY,nq,nG=n(6029);let{schedule:nX}=f(queueMicrotask,!1);var nK=n(55729),nZ=n(39622),nJ=n(72369);let nQ=(0,nK.createContext)({}),n0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function n1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let n2={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!es.test(e))return e;else e=parseFloat(e);let n=n1(e,t.target.x),r=n1(e,t.target.y);return`${n}% ${r}%`}},n5={};class n3 extends nK.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;for(let e in n6)n5[e]=n6[e],N(e)&&(n5[e].isCSSVariable=!0);i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),n0.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,o=n.projection;return o&&(o.isPresent=i,r||e.layoutDependency!==t||void 0===t||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||p.postRender(()=>{let e=o.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),nX.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{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(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function n4(e){let[t,n]=(0,nZ.xQ)(),r=(0,nK.useContext)(nJ.L);return(0,nG.jsx)(n3,{...e,layoutGroup:r,switchLayoutGroup:(0,nK.useContext)(nQ),isPresent:t,safeToRemove:n})}let n6={borderRadius:{...n2,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:n2,borderTopRightRadius:n2,borderBottomLeftRadius:n2,borderBottomRightRadius:n2,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=ex.parse(e);if(r.length>5)return e;let i=ex.createTransformer(e),o=+("number"!=typeof r[0]),s=n.x.scale*t.x,a=n.y.scale*t.y;r[0+o]/=s,r[1+o]/=a;
194let l=eS(s,a,.5);return"number"==typeof r[2+o]&&(r[2+o]/=l),"number"==typeof r[3+o]&&(r[3+o]/=l),i(r)}}},n9=(e,t)=>e.depth-t.depth;class n8{constructor(){this.children=[],this.isDirty=!1}add(e){w(this.children,e),this.isDirty=!0}remove(e){k(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(n9),this.isDirty=!1,this.children.forEach(e)}}function n7(e){return P(e)?e.get():e}let re=["TopLeft","TopRight","BottomLeft","BottomRight"],rt=re.length,rn=e=>"string"==typeof e?parseFloat(e):e,rr=e=>"number"==typeof e||es.test(e);function ri(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let ro=ra(0,.5,e3),rs=ra(.5,.95,u);function ra(e,t,n){return r=>r<e?0:r>t?1:n(e7(e,t,r))}function rl(e,t){e.min=t.min,e.max=t.max}function ru(e,t){rl(e.x,t.x),rl(e.y,t.y)}function rc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function rd(e,t,n,r,i){return e-=t,e=r+1/n*(e-r),void 0!==i&&(e=r+1/i*(e-r)),e}function rh(e,t,[n,r,i],o,s){!function(e,t=0,n=1,r=.5,i,o=e,s=e){if(eo.test(t)&&(t=parseFloat(t),t=eS(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=eS(o.min,o.max,r);e===o&&(a-=t),e.min=rd(e.min,t,n,a,i),e.max=rd(e.max,t,n,a,i)}(e,t[n],t[r],t[i],t.scale,o,s)}let rf=["x","scaleX","originX"],rp=["y","scaleY","originY"];function rm(e,t,n,r){rh(e.x,t,rf,n?n.x:void 0,r?r.x:void 0),rh(e.y,t,rp,n?n.y:void 0,r?r.y:void 0)}function rg(e){return 0===e.translate&&1===e.scale}function ry(e){return rg(e.x)&&rg(e.y)}function rv(e,t){return e.min===t.min&&e.max===t.max}function rb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function rx(e,t){return rb(e.x,t.x)&&rb(e.y,t.y)}function rw(e){return ns(e.x)/ns(e.y)}function rk(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class rS{constructor(){this.members=[]}add(e){w(this.members,e),e.scheduleRender()}remove(e){if(k(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t,n=this.members.findIndex(t=>e===t);if(0===n)return!1;for(let e=n;e>=0;e--){let n=this.members[e];if(!1!==n.isPresent){t=n;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let 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);let{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{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)}}let rE={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},rT=["","X","Y","Z"],rj={visibility:"hidden"},rA=0;function rM(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function r_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=rA++,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,h.value&&(rE.nodes=rE.calculatedTargetDeltas=rE.calculatedProjections=0),this.nodes.forEac
194h(rI),this.nodes.forEach(rz),this.nodes.forEach(rF),this.nodes.forEach(rO),h.addProjectionMetrics&&h.addProjectionMetrics(rE)},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;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new n8)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new S),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=t instanceof SVGElement&&"svg"!==t.tagName,this.instance=t;let{layoutId:r,layout:i,visualElement:o}=this.options;if(o&&!o.current&&o.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||r)&&(this.isLayoutDirty=!0),e){let n,r=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){let n=T.now(),r=({timestamp:t})=>{let i=t-n;i>=250&&(m(r),e(i-250))};return p.setup(r,!0),()=>m(r)}(r,250),n0.hasAnimatedSinceResize&&(n0.hasAnimatedSinceResize=!1,this.nodes.forEach(r$))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&o&&(r||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let i=this.options.transition||o.getDefaultTransition()||rY,{onLayoutAnimationStart:s,onLayoutAnimationComplete:a}=o.getProps(),u=!this.targetLayout||!rx(this.targetLayout,r),c=!t&&n;if(this.options.layoutRoot||this.resumeFrom||c||t&&(u||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);let t={...l(i,"layout"),onPlay:s,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||r$(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,m(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(rB),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:n}=t.options;if(!n)return;let r=n.props[O];if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",p,!(e||n))}let{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&e(i)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEac
194h(rV);return}this.isUpdating||this.nodes.forEach(rL),this.isUpdating=!1,this.nodes.forEach(rD),this.nodes.forEach(rP),this.nodes.forEach(rC),this.clearAllSnapshots();let e=T.now();g.delta=L(0,1e3/60,e-g.timestamp),g.timestamp=e,g.isProcessing=!0,y.update.process(g),y.preRender.process(g),y.render.process(g),g.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,nX.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rR),this.sharedNodes.forEach(rN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,p.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){p.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||ns(this.snapshot.measuredBox.x)||ns(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected=nm(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!ry(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,o=r!==this.prevTransformTemplateValue;e&&(t||nb(this.latestValues)||o)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let n=this.measurePageBox(),r=this.removeElementScroll(n);return e&&(r=this.removeTransform(r)),rX((t=r).x),rX(t.y),{animationId:this.root.animationId,measuredBox:n,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return nm();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(rZ))){let{scroll:e}=this.root;e&&(nE(t.x,e.offset.x),nE(t.y,e.offset.y))}return t}removeElementScroll(e){let t=nm();if(ru(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:o}=r;r!==this.root&&i&&o.layoutScroll&&(i.wasRoot&&ru(t,e),nE(t.x,i.offset.x),nE(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=nm();ru(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&nj(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),nb(r.latestValues)&&nj(n,r.latestValues)}return nb(this.latestValues)&&nj(n,this.latestValues),n}removeTransform(e){let t=nm();ru(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!nb(n.latestValues))continue;nv(n.latestValues)&&n.updateSnapshot();let r=nm();ru(r,n.measurePageBox()),rm(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return nb(this.latestValues)&&rm(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==g.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.
194isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(this.layout&&(r||i)){if(this.resolvedRelativeTargetAt=g.timestamp,!this.targetDelta&&!this.relativeTarget){let e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nm(),this.relativeTargetOrigin=nm(),nd(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),ru(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if(this.target||(this.target=nm(),this.targetWithTransforms=nm()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var o,s,a;this.forceRelativeParentToResolveTarget(),o=this.target,s=this.relativeTarget,a=this.relativeParent.target,nu(o.x,s.x,a.x),nu(o.y,s.y,a.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ru(this.target,this.layout.layoutBox),nS(this.target,this.targetDelta)):ru(this.target,this.layout.layoutBox);if(this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nm(),this.relativeTargetOrigin=nm(),nd(this.relativeTargetOrigin,this.target,e.target),ru(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}h.value&&rE.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||nv(this.parent.latestValues)||nx(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===g.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;ru(this.layoutCorrected,this.layout.layoutBox);let o=this.treeScale.x,s=this.treeScale.y;!function(e,t,n,r=!1){let i,o,s=n.length;if(s){t.x=t.y=1;for(let a=0;a<s;a++){o=(i=n[a]).projectionDelta;let{visualElement:s}=i.options;(!s||!s.props.style||"contents"!==s.props.style.display)&&(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&nj(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,nS(e,o)),r&&nb(i.latestValues)&&nj(e,i.latestValues))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=nm());let{target:a}=e;if(!a){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(rc(this.prevProjectionDelta.x,this.projectionDelta.x),rc(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),nl(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===s&&rk(this.projectionDelta.x,this.prevProjectionDelta.x)&&rk(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a)),h.value&&rE.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=nf(),this.projectionDelta=nf(),this.projectionDeltaWithTransform=nf()}setAnimationOrigin(e,t=!1){let n,r=this.snapshot,i=r?r.latestValues:{},o={...this.latestValues},s=nf();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let a=nm(),l=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=!!(l&&!c&&!0===this.options.crossfade&&!this.path.some(rW));this.animationProgress=0,this.mixTargetDelta=t=>{let r=t/1e3;if(rU(s.x,e.x,r),rU(s.y,e.y,r),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var u,h,f,p,m,g;nd(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,p=this.relativeTargetOrigin,m=a,g=r,rH(f.x,p.x,m.x,g),rH(f.y,p.y,m.y,g),n&&(u=this.relativeTarget,h=n,rv(u.x,h.x)&&rv(u.y,h.y))&&(this.isProjectionDirty=!1),n||(n=nm()),ru(n,this.relativeTarget)}l&&(this.animationValues=o,function(e,t,n,r,i,o){i?(e.opacity=eS(0,n.opacity??1,ro(r)),e.opacityExit=eS(t.opacity??1,0,rs(r))):o&&(e.opacity=eS(t.opacity??1,n.opacity??1,r));for(let i=0;i<rt;i++){let o=`border${re[i]}Radius`,s=ri(t,o),a=ri(n,o);(void 0!==s||void 0!==a)&&(s||(s=0),a||(a=0),0===s||0===a||rr(s)===rr(a)?(e[o]=Math.max(eS(rn(s),rn(a),r),0),(eo.test(a)||eo.test(s))&&(e[o]+="%")):e[o]=a)}(t.rotate||n.rotate)&&(e.rotate=eS(t.rotate||0,n.rotate||0,r))}(o,i,this.latestValues,r,d,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(m(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=p.update(()=>{n0.hasAnimatedSinceResize=!0,$.layout++,this.currentAnimation=function(e,t,n){let r=P(0)?0:M(e);return r.start(tq("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{$.layout--},onComplete:()=>{$.layout--,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);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&rK(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||nm();let t=ns(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=ns(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}ru(t,n),nj(t,i),nl(this.projectionDeltaWithTransform,this.layoutCorrected,t,i
194)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new rS),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&rM("z",e,r,this.animationValues);for(let t=0;t<rT.length;t++)rM(`rotate${rT[t]}`,e,r,this.animationValues),rM(`skew${rT[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}getProjectionStyles(e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return rj;let t={visibility:""},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.opacity="",t.pointerEvents=n7(e?.pointerEvents)||"",t.transform=n?n(this.latestValues,""):"none",t;let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){let t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=n7(e?.pointerEvents)||""),this.hasProjected&&!nb(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1),t}let i=r.animationValues||r.latestValues;this.applyTransformsToTarget(),t.transform=function(e,t,n){let r="",i=e.x.translate/t.x,o=e.
194y.translate/t.y,s=n?.z||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(1!==t.x||1!==t.y)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:o,skewX:s,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),a&&(r+=`skewY(${a}deg) `)}let a=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==a||1!==l)&&(r+=`scale(${a}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),n&&(t.transform=n(i,t.transform));let{x:o,y:s}=this.projectionDelta;for(let e in t.transformOrigin=`${100*o.origin}% ${100*s.origin}% 0`,r.animationValues?t.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:t.opacity=r===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0,n5){if(void 0===i[e])continue;let{correct:n,applyTo:o,isCSSVariable:s}=n5[e],a="none"===t.transform?i[e]:n(i[e],r);if(o){let e=o.length;for(let n=0;n<e;n++)t[o[n]]=a}else s?this.options.visualElement.renderState.vars[e]=a:t[e]=a}return this.options.layoutId&&(t.pointerEvents=r===this?n7(e?.pointerEvents)||"":"none"),t}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(rV),this.root.sharedNodes.clear()}}}function rP(e){e.updateLayout()}function rC(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;"size"===i?ng(e=>{let r=o?t.measuredBox[e]:t.layoutBox[e],i=ns(r);r.min=n[e].min,r.max=r.min+i}):rK(i,t.layoutBox,n)&&ng(r=>{let i=o?t.measuredBox[r]:t.layoutBox[r],s=ns(n[r]);i.max=i.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)});let s=nf();nl(s,n,t.layoutBox);let a=nf();o?nl(a,e.applyTransform(r,!0),t.measuredBox):nl(a,n,t.layoutBox);let l=!ry(s),u=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:o}=r;if(i&&o){let s=nm();nd(s,t.layoutBox,i.layoutBox);let a=nm();nd(a,n,o.layoutBox),rx(s,a)||(u=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function rI(e){h.value&&rE.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function rO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rR(e){e.clearSnapshot()}function rV(e){e.clearMeasurements()}function rL(e){e.isLayoutDirty=!1}function rD(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function r$(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rz(e){e.resolveTargetDelta()}function rF(e){e.calcProjection()}function rB(e){e.resetSkewAndRotation()}function rN(e){e.removeLeadSnapshot()}function rU(e,t,n){e.translate=eS(t.translate,0,n),e.scale=eS(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rH(e,t,n,r){e.min=eS(t.min,n.min,r),e.max=eS(t.max,n.max,r)}function rW(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let rY={duration:.45,ease:[.4,0,.1,1]},rq=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),rG=rq("applewebkit/")&&!rq("chrome/")?Math.round:u;function rX(e){e.min=rG(e.min),e.max=rG(e.max)}function rK(e,t,n){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(rw(t)-rw(n)))}function rZ(e){return e!==e.root&&e.scroll?.wasRoot}let rJ=r_({attachResizeListener:(e,t)=>nt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rQ={current:void 0},r0=r_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rQ.current){let e=new rJ({});e.mount(window),e.setOptions({layoutScroll:!0}),rQ.current=e}return rQ.current},resetTransform:(e,t)=>
194{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function r1(e,t){let n=function(e,t,n){if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document,n=(void 0)??t.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function r2(e){return!("touch"===e.pointerType||ne.x||ne.y)}function r5(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);let i=r["onHover"+n];i&&p.postRender(()=>i(t,nr(t)))}class r3 extends t6{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){let[r,i,o]=r1(e,n),s=e=>{if(!r2(e))return;let{target:n}=e,r=t(n,e);if("function"!=typeof r||!n)return;let o=e=>{r2(e)&&(r(e),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,i)};return r.forEach(e=>{e.addEventListener("pointerenter",s,i)}),o}(e,(e,t)=>(r5(this.node,t,"Start"),e=>r5(this.node,e,"End"))))}unmount(){}}class r4 extends t6{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=V(nt(this.node.current,"focus",()=>this.onFocus()),nt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}let r6=(e,t)=>!!t&&(e===t||r6(e,t.parentElement)),r9=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),r8=new WeakSet;function r7(e){return t=>{"Enter"===t.key&&e(t)}}function ie(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function it(e){return nn(e)&&!(ne.x||ne.y)}function ir(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);let i=r["onTap"+("End"===n?"":n)];i&&p.postRender(()=>i(t,nr(t)))}class ii extends t6{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){let[r,i,o]=r1(e,n),s=e=>{let r=e.currentTarget;if(!it(e)||r8.has(r))return;r8.add(r);let o=t(r,e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),it(e)&&r8.has(r)&&(r8.delete(r),"function"==typeof o&&o(e,{success:t}))},a=e=>{s(e,r===window||r===document||n.useGlobalTarget||r6(r,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",l,i)};return r.forEach(e=>{((n.useGlobalTarget?window:e).addEventListener("pointerdown",s,i),e instanceof HTMLElement)&&(e.addEventListener("focus",e=>((e,t)=>{let n=e.currentTarget;if(!n)return;let r=r7(()=>{if(r8.has(n))return;ie(n,"down");let e=r7(()=>{ie(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>ie(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i)),r9.has(e.tagName)||-1!==e.tabIndex||e.hasAttribute("tabindex")||(e.tabIndex=0))}),o}(e,(e,t)=>(ir(this.node,t,"Start"),(e,{success:t})=>ir(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}let io=new WeakMap,is=new WeakMap,ia=e=>{let t=io.get(e.target);t&&t(e)},il=e=>{e.forEach(ia)},iu={some:0,all:1};class ic extends t6{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:i}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:iu[r]},s=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=t?n:r;o&&o(e)};var a=this.node.current;let l=function({root:e,...t}){let n=e||document;is.has(n)||is.set(n,{});let r=is.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(il,{root:e,...t})),r[i]}(o);return io.set(a,s),l.observe(a),()=>{io.delete(a),l.unobserve(a)}}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{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(){}}let id=(0,nK.createContext)({strict:!1});var ih=n(67908);let ip=(0,nK.createContext)({});function im(e){return i(e.animate)||t0.some(t=>tJ(e[t]))}function ig(e){return!!(im(e)||e.variants)}function iy(e){return Array.isArray(e)?e.join(" "):e}var iv=n(89636);let ib={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"]},ix={};for(let e in ib)ix[e]={isEnabled:t=>ib[e].some(e=>!!t[e])};let iw=Symbol.for("motionComponentSymbol");var ik=n(67017),iS=n(2274);function iE(e,{layout:t,layoutId:n}){return b.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!n5[e]||"opacity"===e)}let iT=(e,t)=>t&&"number"==typeof e?t.transform(e):e,ij={...Y,transform:Math.round},iA={borderWidth:es,borderTopWidth:es,borderRightWidth:es,borderBottomWidth:es,borderLeftWidth:es,borderRadius:es,radius:es,borderTopLeftRadius:es,borderTopRightRadius:es,borderBottomRightRadius:es,borderBottomLeftRadius:es,width:es,maxWidth:es,height:es,maxHeight:es,top:es,right:es,bottom:es,left:es,padding:es,paddingTop:es,paddingRight:es,paddingBottom:es,paddingLeft:es,margin:es,marginTop:es,marginRight:es,marginBottom:es,marginLeft:es,backgroundPositionX:es,backgroundPositionY:es,rotate:ei,rotateX:ei,rotateY:ei,rotateZ:ei,scale:G,scaleX:G,scaleY:G,scaleZ:G,skew:ei,skewX:ei,skewY:ei,distance:es,translateX:es,translateY:es,translateZ:es,x:es,y:es,z:es,perspective:es,transformPerspective:es,opacity:q,originX:eu,originY:eu,originZ:es,zIndex:ij,fillOpacity:q,strokeOpacity:q,numOctaves:ij},iM={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},i_=v.length;function iP(e,t,n){let{style:r,vars:i,transformOrigin:o}=e,s=!1,a=!1;for(let e in t){let n=t[e];if(b.has(e)){s=!0;continue}
194if(N(e)){i[e]=n;continue}{let t=iT(n,iA[e]);e.startsWith("origin")?(a=!0,o[e]=t):r[e]=t}}if(!t.transform&&(s||n?r.transform=function(e,t,n){let r="",i=!0;for(let o=0;o<i_;o++){let s=v[o],a=e[s];if(void 0===a)continue;let l=!0;if(!(l="number"==typeof a?a===+!!s.startsWith("scale"):0===parseFloat(a))||n){let e=iT(a,iA[s]);if(!l){i=!1;let t=iM[s]||s;r+=`${t}(${e}) `}n&&(t[s]=e)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),a){let{originX:e="50%",originY:t="50%",originZ:n=0}=o;r.transformOrigin=`${e} ${t} ${n}`}}let iC=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function iI(e,t,n){for(let r in t)P(t[r])||iE(r,n)||(e[r]=t[r])}let iO=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 iR(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||iO.has(e)}let iV=e=>!iR(e);try{!function(e){e&&(iV=t=>t.startsWith("on")?!iR(t):e(t))}(require("@emotion/is-prop-valid").default)}catch{}let iL=["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 iD(e){if("string"!=typeof e||e.includes("-"));else if(iL.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let i$={offset:"stroke-dashoffset",array:"stroke-dasharray"},iz={offset:"strokeDashoffset",array:"strokeDasharray"};function iF(e,t,n){return"string"==typeof e?e:es.transform(t+n*e)}function iB(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,d){if(iP(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:h,style:f,dimensions:p}=e;h.transform&&(p&&(f.transform=h.transform),delete h.transform),p&&(void 0!==i||void 0!==o||f.transform)&&(f.transformOrigin=function(e,t,n){let r=iF(t,e.x,e.width),i=iF(n,e.y,e.height);return`${r} ${i}`}(p,void 0!==i?i:.5,void 0!==o?o:.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,i=!0){e.pathLength=1;let o=i?i$:iz;e[o.offset]=es.transform(-r);let s=es.transform(t),a=es.transform(n);e[o.array]=`${s} ${a}`}(h,s,a,l,!1)}let iN=()=>({...iC(),attrs:{}}),iU=e=>"string"==typeof e&&"svg"===e.toLowerCase();var iH=n(66414);let iW=e=>(t,n)=>{let r=(0,nK.useContext)(ip),o=(0,nK.useContext)(ik.t),a=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,a){let l={latestValues:function(e,t,n,r){let o={},a=r(e,{});for(let e in a)o[e]=n7(a[e]);let{initial:l,animate:u}=e,c=im(e),d=ig(e);t&&d&&!c&&!1!==e.inherit&&(void 0===l&&(l=t.initial),void 0===u&&(u=t.animate));let h=!!n&&!1===n.initial,f=(h=h||!1===l)?u:l;if(f&&"boolean"!=typeof f&&!i(f)){let t=Array.isArray(f)?f:[f];for(let n=0;n<t.length;n++){let r=s(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=h?t.length-1:0;t=t[e]}null!==t&&(o[e]=t)}for(let t in e)o[t]=e[t]}}}return o}(r,o,a,e),renderState:t()};return n&&(l.onMount=e=>n({props:r,current:e,...l}),l.onUpdate=e=>n(e)),l})(e,t,r,o);return n?a():(0,iH.M)(a)};function iY(e,t,n){let{style:r}=e,i={};for(let o in r)(P(r[o])||t.style&&P(t.style[o])||iE(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(i[o]=r[o]);return i}let iq={useVisualState:iW({scrapeMotionValuesFromProps:iY,createRenderState:iC})};function iG(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(e){t.dimensions={x:0,y:0,width:0,height:0}}}function iX(e,{style:t,vars:n},r,i){for(let o in Object.assign(e.style,t,i&&i.getProjectionStyles(r)),n)e.style.setProperty(o,n[o])}let iK=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 iZ(e,t,n,r){for(let n in iX(e,t,void 0,r),t.attrs)e.setAttribute(iK.has(n)?n:I(n),t.attrs[n])}function iJ(e,t,n){let r=iY(e,t,n);for(let n in e)(P(e[n])||P(t[n]))&&(r[-1!==v.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}let iQ=["x","y","width","height","cx","cy","r"],i0={useVisualState:iW({scrapeMotionValuesFromProps:iJ,createRenderState:iN,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let o=!!e.drag;if(!o){for(let e in i)if(b.has(e)){o=!0;break}}if(!o)return;let s=!t;if(t)for(let n=0;n<iQ.length;n++){let r=iQ[n];e[r]!==t[r]&&(s=!0)}s&&p.read(()=>{iG(n,r),p.render(()=>{iB(r,i,iU(n.tagName),e.transformTemplate),iZ(n,r)})})}})},i1=e=>t=>t.test(e),i2=[Y,es,eo,ei,el,ea,{test:e=>"auto"===e,parse:e=>e}],i5=e=>i2.find(i1(e)),i3=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),i4=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,i6=e=>/^0[^.\s]+$/u.test(e),i9=new Set(["brightness","contrast","saturate","opacity"]);function i8(e){let[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[r]=n.match(K)||[];if(!r)return e;let i=n.replace(r,""),o=+!!i9.has(t);return r!==n&&(o*=100),t+"("+o+i+")"}let i7=/\b([a-z-]*)\(.*?\)/gu,oe={...ex,getAnimatableNone:e=>{let t=e.match(i7);return t?t.map(i8).join(" "):e}},ot={...iA,color:ed,backgroundColor:ed,outlineColor:ed,fill:ed,stroke:ed,borderColor:ed,borderTopColor:ed,borderRightColor:ed,borderBottomColor:ed,borderLeftColor:ed,filter:oe,WebkitFilter:oe},on=e=>ot[e];function or(e,t){let n=on(e);return n!==oe&&(n=ex),n.getAnimatableNone?n.getAnimatableNone(t):void 0}
194let oi=new Set(["auto","none","0"]);class oo extends tM{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if("string"==typeof r&&H(r=r.trim())){let i=function e(t,n,r=1){F(r<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);let[i,o]=function(e){let t=i4.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}(t);if(!i)return;let s=window.getComputedStyle(n).getPropertyValue(i);if(s){let e=s.trim();return i3(e)?parseFloat(e):e}return H(o)?e(o,n,r+1):o}(r,t.current);void 0!==i&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!x.has(n)||2!==e.length)return;let[r,i]=e,o=i5(r),s=i5(i);if(o!==s)if(tv(o)&&tv(s))for(let t=0;t<e.length;t++){let n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++){var r;(null===e[t]||("number"==typeof(r=e[t])?0===r:null===r||"none"===r||"0"===r||i6(r)))&&n.push(t)}n.length&&function(e,t,n){let r,i=0;for(;i<e.length&&!r;){let t=e[i];"string"==typeof t&&!oi.has(t)&&eg(t).values.length&&(r=e[i]),i++}if(r&&n)for(let i of t)e[i]=or(n,r)}(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tw[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,o=n[i];n[i]=tw[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEac
194h(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}let os=[...i2,ed,ex],oa={current:null},ol={current:!1},ou=new WeakMap,oc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class od{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=tM,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=T.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,p.render(this.render,!1,!0))};let{latestValues:a,renderState:l,onUpdate:u}=o;this.onUpdate=u,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=!!i,this.isControllingVariants=im(t),this.isVariantNode=ig(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];void 0!==a[e]&&P(t)&&t.set(a[e],!1)}}mount(e){this.current=e,ou.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)),ol.current||function(){if(ol.current=!0,iv.B)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>oa.current=e.matches;e.addListener(t),t()}else oa.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||oa.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),m(this.notifyUpdate),m(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){let n;this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let r=b.has(e);r&&this.onBindTransform&&this.onBindTransform();let i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&p.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),o(),n&&n(),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 ix){let t=ix[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):nm()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<oc.length;t++){let n=oc[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(e,t,n){for(let r in t){let i=t[r],o=n[r];if(P(i))e.addValue(r,i);else if(P(o))e.addValue(r,M(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){let t=e.getValue(r);!0===t.liveStyle?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,M(void 0!==t?t:i,{owner:e}))}}for(let r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}
194addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let 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);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=M(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=n){if("string"==typeof n&&(i3(n)||i6(n)))n=parseFloat(n);else{let r;r=n,!os.find(i1(r))&&ex.test(t)&&(n=or(e,t))}this.setBaseTarget(e,P(n)?n.get():n)}return P(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t,{initial:n}=this.props;if("string"==typeof n||"object"==typeof n){let r=s(this.props,n,this.presenceContext?.custom);r&&(t=r[e])}if(n&&void 0!==t)return t;let r=this.getBaseTargetFromProps(this.props,e);return void 0===r||P(r)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new S),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class oh extends od{constructor(){super(...arguments),this.KeyframeResolver=oo}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]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;P(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class of extends oh{constructor(){super(...arguments),this.type="html",this.renderInstance=iX}readValueFromInstance(e,t){if(b.has(t)){let{transform:n="none"}=getComputedStyle(e);return tg(n,t)}{let n=window.getComputedStyle(e),r=(N(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return nA(e,t)}build(e,t,n){iP(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return iY(e,t,n)}}class op extends oh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=nm,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&iG(this.current,this.renderState)}}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(b.has(t)){let e=on(t);return e&&e.default||0}return t=iK.has(t)?t:I(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return iJ(e,t,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&p.postRender(this.updateDimensions)}
194build(e,t,n){iB(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){iZ(e,t,n,r)}mount(e){this.isSVGTag=iU(e.tagName),super.mount(e)}}let om=function(e){if("undefined"==typeof Proxy)return e;let t=new Map;return new Proxy((...t)=>e(...t),{get:(n,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}((nY={animation:{Feature:t9},exit:{Feature:t7},inView:{Feature:ic},tap:{Feature:ii},focus:{Feature:r4},hover:{Feature:r3},pan:{Feature:nW},drag:{Feature:nU,ProjectionNode:r0,MeasureLayout:n4},layout:{ProjectionNode:r0,MeasureLayout:n4}},nq=(e,t)=>iD(e)?new op(t):new of(t,{allowProjection:e!==nK.Fragment}),function(e,{forwardMotionProps:t}={forwardMotionProps:!1}){return function({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){function o(e,o){var s;let a,l={...(0,nK.useContext)(ih.Q),...e,layoutId:function({layoutId:e}){let t=(0,nK.useContext)(nJ.L).id;return t&&void 0!==e?t+"-"+e:e}(e)},{isStatic:u}=l,c=function(e){let{initial:t,animate:n}=function(e,t){if(im(e)){let{initial:t,animate:n}=e;return{initial:!1===t||tJ(t)?t:void 0,animate:tJ(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,nK.useContext)(ip));return(0,nK.useMemo)(()=>({initial:t,animate:n}),[iy(t),iy(n)])}(e),d=r(e,u);if(!u&&iv.B){(0,nK.useContext)(id).strict;let e=function(e){let{drag:t,layout:n}=ix;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(l);a=e.MeasureLayout,c.visualElement=function(e,t,n,r,i){let{visualElement:o}=(0,nK.useContext)(ip),s=(0,nK.useContext)(id),a=(0,nK.useContext)(ik.t),l=(0,nK.useContext)(ih.Q).reducedMotion,u=(0,nK.useRef)(null);r=r||s.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:l}));let c=u.current,d=(0,nK.useContext)(nQ);c&&!c.projection&&i&&("html"===c.type||"svg"===c.type)&&function(e,t,n,r){let{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&n_(a),visualElement:e,animationType:"string"==typeof o?o:"both",initialPromotionConfig:r,crossfade:c,layoutScroll:l,layoutRoot:u})}(u.current,n,i,d);let h=(0,nK.useRef)(!1);(0,nK.useInsertionEffect)(()=>{c&&h.current&&c.update(n,a)});let f=n[O],p=(0,nK.useRef)(!!f&&!window.MotionHandoffIsComplete?.(f)&&window.MotionHasOptimisedAnimation?.(f));return(0,iS.E)(()=>{c&&(h.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),nX.render(c.render),p.current&&c.animationState&&c.animationState.animateChanges())}),(0,nK.useEffect)(()=>{c&&(!p.current&&c.animationState&&c.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(f)}),p.current=!1))}),c}(i,d,l,t,e.ProjectionNode)}return(0,nG.jsxs)(ip.Provider,{value:c,children:[a&&c.visualElement?(0,nG.jsx)(a,{visualElement:c.visualElement,...l}):null,n(i,e,(s=c.visualElement,(0,nK.useCallback)(e=>{e&&d.onMount&&d.onMount(e),s&&(e?s.mount(e):s.unmount()),o&&("function"==typeof o?o(e):n_(o)&&(o.current=e))},[s])),d,u,c.visualElement)]})}e&&function(e){for(let t in e)ix[t]={...ix[t],...e[t]}}(e),o.displayName=`motion.${"string"==typeof i?i:`create(${i.displayName??i.name??""})`}`;let s=(0,nK.forwardRef)(o);return s[iw]=i,s}({...iD(e)?i0:iq,preloadedFeatures:nY,useRender:function(e=!1){return(t,n,r,{latestValues:i},o)=>{let s=(iD(t)?function(e,t,n,r){let i=(0,nK.useMemo)(()=>{let n=iN();return iB(n,t,iU(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};iI(t,e.style,e),i.style={...t,...i.style}}return i}:function(e,t){let n={},r=function(e,t){let n=e.style||{},r={};return iI(r,n,e),Object.assign(r,function({transformTemplate:e},t){return(0,nK.useMemo)(()=>{let n=iC();return iP(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),r}(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"}
194`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n})(n,i,o,t),a=function(e,t,n){let r={};for(let i in e)("values"!==i||"object"!=typeof e.values)&&(iV(i)||!0===n&&iR(i)||!t&&!iR(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}(n,"string"==typeof t,e),l=t!==nK.Fragment?{...a,...s,ref:r}:{},{children:u}=n,c=(0,nK.useMemo)(()=>P(u)?u.get():u,[u]);return(0,nK.createElement)(t,{...l,children:c})}}(t),createVisualElement:nq,Component:e})}))},39622:(e,t,n)=>{"use strict";n.d(t,{xQ:()=>o});var r=n(55729),i=n(67017);function o(e=!0){let t=(0,r.useContext)(i.t);if(null===t)return[!0,null];let{isPresent:n,onExitComplete:s,register:a}=t,l=(0,r.useId)();(0,r.useEffect)(()=>{if(e)return a(l)},[e]);let u=(0,r.useCallback)(()=>e&&s&&s(l),[l,s,e]);return!n&&s?[!1,u]:[!0]}},43624:e=>{var t="\ud800-\udfff",n="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",i="A-Z\\xc0-\\xd6\\xd8-\\xde",o="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",s="['’]",a="["+o+"]",l="["+r+"]",u="[^"+t+o+"\\d+"+n+r+i+"]",c="(?:\ud83c[\udde6-\uddff]){2}",d="[\ud800-\udbff][\udc00-\udfff]",h="["+i+"]",f="(?:"+l+"|"+u+")",p="(?:"+h+"|"+u+")",m="(?:"+s+"(?:d|ll|m|re|s|t|ve))?",g="(?:"+s+"(?:D|LL|M|RE|S|T|VE))?",y="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",v="[\\ufe0e\\ufe0f]?",b="(?:\\u200d(?:"+["[^"+t+"]",c,d].join("|")+")"+v+y+")*",x="(?:"+["["+n+"]",c,d].join("|")+")"+(v+y+b),w=RegExp([h+"?"+l+"+"+m+"(?="+[a,h,"$"].join("|")+")",p+"+"+g+"(?="+[a,h+f,"$"].join("|")+")",h+"?"+f+"+"+m,h+"+"+g,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",x].join("|"),"g");e.exports=function(e){return e.match(w)||[]}},45516:(e,t,n)=>{var r=n(97397),i="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||i||Function("return this")()},49355:e=>{e.exports=function(e){return e.split("")}},50515:(e,t,n)=>{var r=n(33573),i=n(3619);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},60567:(e,t,n)=>{var r=n(16153);e.exports=function(e){return null==e?"":r(e)}},62659:e=>{var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},66414:(e,t,n)=>{"use strict";n.d(t,{M:()=>i});var r=n(55729);function i(e){let t=(0,r.useRef)(null);return null===t.current&&(t.current=e()),t.current}},67017:(e,t,n)=>{"use strict";n.d(t,{t:()=>r});let r=(0,n(55729).createContext)(null)},67908:(e,t,n)=>{"use strict";n.d(t,{Q:()=>r});let r=(0,n(55729).createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"})},72369:(e,t,n)=>{"use strict";n.d(t,{L:()=>r});let r=(0,n(55729).createContext)({})},72772:(e,t,n)=>{var r=n(19508),i=n(62659),o=n(60567),s=n(43624);e.exports=function(e,t,n){return(e=o(e),void 0===(t=n?void 0:t))?i(e)?s(e):r(e):e.match(t)||[]}},79990:(e,t,n)=>{var r=n(32459),i=n(21985),o=n(72772),s=RegExp("['’]","g");e.exports=function(e){return function(t){return r(o(i(t).replace(s,"")),e,"")}}},88165:e=>{e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}},88601:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},89636:(e,t,n)=>{"use strict";n.d(t,{B:()=>r});let r="undefined"!=typeof window},90199:e=>{var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\ud83c[\udffb-\udfff]",i="[^"+t+"]",o="(?:\ud83c[\udde6-\uddff]){2}",s="[\ud800-\udbff][\udc00-\udfff]",a="(?:"+n+"|"+r+")?",l="[\\ufe0e\\ufe0f]?",u="(?:\\u200d(?:"+[i,o,s].join("|")+")"+l+a+")*",c=RegExp(r+"(?="+r+")|"+("(?:"+[i+n+"?",n,o,s,"["+t+"]"].join("|"))+")"+(l+a+u),"g");e.exports=function(e){return e.match(c)||[]}},91544:e=>{e.exports=Array.isArray},94932:(e,t,n)=>{"use strict";n.d(t,{me:()=>ed,sR:()=>ef,JW:()=>g});let r=["gray","blue","purple","magenta","red","orange","yellow","green","cyan"],i=["50","100","200","300","400","500","600","700","800","900","950"],o={black:{title:"Black",hex:"#0d0e12"},white:{title:"White",hex:"#ffffff"},gray:{50:{title:"Gray 50",hex:"#f6f6f8"},100:{title:"Gray 100",hex:"#eeeef1"},200:{title:"Gray 200",hex:"#e3e4e8"},300:{title:"Gray 300",hex:"#bbbdc9"},400:{title:"Gray 400",hex:"#9499ad"},500:{title:"Gray 500",hex:"#727892"},600:{title:"Gray 600",hex:"#515870"},700:{title:"Gray 700",hex:"#383d51"},800:{title:"Gray 800",hex:"#252837"},900:{title:"Gray 900",hex:"#1b1d27"},950:{title:"Gray 950",hex:"#13141b"}},blue:{50:{title:"Blue 50",hex:"#f5f8ff"},100:{title:"Blue 100",hex:"#e5edff"},200:{title:"Blue 200",hex:"#dbe5ff"},300:{title:"Blue 300",hex:"#a8bfff"},400:{title:"Blue 400",hex:"#7595ff"},500:{title:"Blue 500",hex:"#556bfc"},600:{title:"Blue 600",hex:"#4043e7"},700:{title:"Blue 700",hex:"#2927aa"},800:{title:"Blue 800",hex:"#192457"},900:{title:"Blue 900",hex:"#161a41"},950:{title:"Blue 950",hex:"#101228"}},purple:{50:{title:"Purple 50",hex:"#f8f5ff"},100:{title:"Purple 100",hex:"#f1ebff"},200:{title:"Purple 200",hex:"#ece1fe"},300:{title:"Purple 300",hex:"#ccb1fc"},400:{title:"Purple 400",hex:"#b087f7"},500:{title:"Purple 500",hex:"#8f57ef"},600:{title:"Purple 600",hex:"#721fe5"},700:{title:"Purple 700",hex:"#4c1a9e"},800:{title:"Purple 800",hex:"#2f1862"},900:{title:"Purple 900",hex:"#23173f"},950:{title:"Purple 950",hex:"#181128"}},magenta:{50:{title:"Magenta 50",hex:"#fef6f9"},100:{title:"Magenta 100",hex:"#fde8ef"},200:{title:"Magenta 200",hex:"#fcdee9"},300:{title:"Magenta 300",hex:"#f7abc5"},400:{title:"Magenta 400",hex:"#f0709b"},500:{title:"Magenta 500",hex:"#e72767"},600:{title:"Magenta 600",hex:"#b11651"},700:{title:"Magenta 700",hex:"#7c1342"},800:{title:"Magenta 800",hex:"#4b1130"},900:{title:"Magenta 900",hex:"#341325"},950:{title:"Magenta 950",hex:"#1f0f14"}},red:{50:{title:"Red 50",hex:"#fff6f5"},100:{title:"Red 100",hex:"#ffe7e5"},200:{title:"Red 200",hex:"#ffdedc"},300:{title:"Red 300",hex:"#fdada5"},400:{title:"Red 400",hex:"#f77769"},500:{title:"Red 500",hex:"#ef4434"},600:{title:"Red 600",hex:"#cc2819"},700:{title:"Red 700",hex:"#8b2018"},800:{title:"Red 800",hex:"#4d1714"},900:{title:"Red 900",hex:"#321615"},950:{title:"Red 950",hex:"#1e1011"}},orange:{50:{title:"Orange 50",hex:"#fff7f0"},100:{title:"Orange 100",hex:"#ffeadb"},200:{title:"Orange 200",hex:"#ffddc7"},300:{title:"Orange 300",hex:"#ffb685"},400:{title:"Orange 400",hex:"#ff8e42"},500:{title:"Orange 500",hex:"#fa6400"},600:{title:"Orange 600",hex:"#b14802"},700:{title:"Orange 700",hex:"#7c3404"},800:{title:"Orange 800",hex:"#461e07"},900:{title:"Orange 900",hex:"#32160b"},950:{title:"Orange 950",hex:"#21120d"}},yellow:{50:{title:"Yellow 50",hex:"#fefae1"},100:{title:"Yellow 100",hex:"#fcf3bb"},200:{title:"Yellow 200",hex:"#f9e994"},300:{title:"Yellow 300",hex:"#f7d455"},400:{title:"Yellow 400",hex:"#f9bc15"},500:{title:"Yellow 500",hex:"#d28a04"},600:{title:"Yellow 600",hex:"#965908"},700:{title:"Yellow 700",hex:"#653a0b"},800:{title:"Yellow 800",hex:"#3b220c"},900:{title:"Yellow 900",hex:"#271a11"},950:{title:"Yellow 950",hex:"#181410"}},green:{50:{title:"Green 50",hex:"#e7fef5"},100:{title:"Green 100",hex:"#c5fce8"},200:{title:"Green 200",hex:"#a9f9dc"},300:{title:"Green 300",hex:"#59f3ba"},400:{title:"Green 400",hex:"#0ff0a1"},500:{title:"Green 500",hex:"#04b97a"},600:{title:"Green 600",hex:"#01794f"},700:{title:"Green 700",hex:"#015133"},800:{title:"Green 800",hex:"#023120"},900:{title:"Green 900",hex:"#06231a"},950:{title:"Green 950",hex:"#071715"}},cyan:{50:{title:"Cyan 50",hex:"#e7fefe"},100:{title:"Cyan 100",hex:"#c5fcfc"},200:{title:"Cyan 200",hex:"#96f8f8"},300:{title:"Cyan 300",hex:"#62efef"},400:{title:"Cyan 400",hex:"#18e2e2"},500:{title:"Cyan 500",hex:"#04b8be"},600:{title:"Cyan 600",hex:"#037782"},700:{title:"Cyan 700",hex:"#024950"},800:{title:"Cyan 800",hex:"#042f34"},900:{title:"Cyan 900",hex:"#072227"},950:{title:"Cyan 950",hex:"#0d181c"}}},s={transparent:{lightest:"hsl(240, 100%, 95%)",lighter:"hsl(240, 100%, 70%)",light:"hsl(240, 100%, 65%)",base
194:"hsl(240, 100%, 50%)",dark:"hsl(240, 100%, 35%)",darker:"hsl(240, 100%, 20%)",darkest:"hsl(240, 100%, 5%)"},primary:{lightest:"hsl(240, 100%, 95%)",lighter:"hsl(240, 100%, 70%)",light:"hsl(240, 100%, 65%)",base:"hsl(240, 100%, 50%)",dark:"hsl(240, 100%, 35%)",darker:"hsl(240, 100%, 20%)",darkest:"hsl(240, 100%, 5%)"},positive:{lightest:"hsl(120, 100%, 95%)",lighter:"hsl(120, 100%, 70%)",light:"hsl(120, 100%, 65%)",base:"hsl(120, 100%, 50%)",dark:"hsl(120, 100%, 35%)",darker:"hsl(120, 100%, 20%)",darkest:"hsl(120, 100%, 5%)"},caution:{lightest:"hsl(60, 100%, 95%)",lighter:"hsl(60, 100%, 70%)",light:"hsl(60, 100%, 65%)",base:"hsl(60, 100%, 50%)",dark:"hsl(60, 100%, 35%)",darker:"hsl(60, 100%, 20%)",darkest:"hsl(60, 100%, 5%)"},critical:{lightest:"hsl(0, 100%, 95%)",lighter:"hsl(0, 100%, 70%)",light:"hsl(0, 100%, 65%)",base:"hsl(0, 100%, 50%)",dark:"hsl(0, 100%, 35%)",darker:"hsl(0, 100%, 20%)",darkest:"hsl(0, 100%, 5%)"}};s.transparent.darkest,s.transparent.lightest,s.transparent.lightest,s.transparent.darkest,s.transparent.darker,s.transparent.lighter,s.transparent.base,s.transparent.base,s.primary.darkest,s.primary.lightest,s.primary.lightest,s.primary.darkest,s.primary.darker,s.primary.lighter,s.primary.base,s.primary.base,s.positive.darkest,s.positive.lightest,s.positive.lightest,s.positive.darkest,s.positive.darker,s.positive.lighter,s.positive.base,s.positive.base,s.caution.darkest,s.caution.lightest,s.caution.lightest,s.caution.darkest,s.caution.darker,s.caution.lighter,s.caution.base,s.caution.base,s.critical.darkest,s.critical.lightest,s.critical.lightest,s.critical.darkest,s.critical.darker,s.critical.lighter,s.critical.base,s.critical.base;let a={avatar:{sizes:[{distance:-4,size:19},{distance:-4,size:25},{distance:-8,size:33},{distance:-12,size:49}],focusRing:{offset:1,width:1}},button:{textWeight:"medium",border:{width:1},focusRing:{offset:-1,width:1}},card:{border:{width:1},focusRing:{offset:-1,width:1},shadow:{outline:.5}},container:[320,640,960,1280,1600,1920],media:[360,600,900,1200,1800,2400],layer:{dialog:{zOffset:600},popover:{zOffset:400},tooltip:{zOffset:200}},radius:[0,1,3,6,9,12,21],shadow:[null,{umbra:[0,0,0,0],penumbra:[0,0,0,0],ambient:[0,0,0,0]},{umbra:[0,3,5,-2],penumbra:[0,6,10,0],ambient:[0,1,18,1]},{umbra:[0,7,8,-4],penumbra:[0,12,17,2],ambient:[0,5,22,4]},{umbra:[0,9,11,-5],penumbra:[0,18,28,2],ambient:[0,7,34,6]},{umbra:[0,11,15,-7],penumbra:[0,24,38,3],ambient:[0,9,46,8]}],space:[0,4,8,12,20,32,52,84,136,220],input:{border:{width:1},checkbox:{size:17,focusRing:{offset:-1,width:1}},radio:{size:17,markSize:9,focusRing:{offset:-1,width:1}},switch:{width:25,height:17,padding:5,transitionDurationMs:150,transitionTimingFunction:"ease-out",focusRing:{offset:1,width:1}},select:{focusRing:{offset:-1,width:1}},text:{focusRing:{offset:-1,width:1}}},style:{button:{root:{transition:"background-color 100ms,border-color 100ms,color 100ms"}}}},l={code:{family:"ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",weights:{regular:400,medium:500,semibold:600,bold:700},sizes:[{ascenderHeight:4,descenderHeight:4,fontSize:10,iconSize:17,lineHeight:15,letterSpacing:0},{ascenderHeight:5,descenderHeight:5,fontSize:13,iconSize:21,lineHeight:19,letterSpacing:0},{ascenderHeight:6,descenderHeight:6,fontSize:16,iconSize:25,lineHeight:23,letterSpacing:0},{ascenderHeight:7,descenderHeight:7,fontSize:19,iconSize:29,lineHeight:27,letterSpacing:0},{ascenderHeight:8,descenderHeight:8,fontSize:22,iconSize:33,lineHeight:31,letterSpacing:0}]},heading:{family:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',weights:{regular:700,medium:800,semibold:900,bold:900},sizes:[{ascenderHeight:5,descenderHeight:5,fontSize:13,iconSize:17,lineHeight:19,letterSpacing:0},{ascenderHeight:6,descenderHeight:6,fontSize:16,iconSize:25,lineHeight:23,letterSpacing:0},{ascenderHeight:7,descenderHeight:7,fontSize:21,iconSize:33,lineHeight:29,letterSpacing:0},{ascenderHeight:8,descenderHeight:8,fontSize:27,iconSize:41,lineHeight:35,letterSpacing:0},{ascenderHeight:9.5,descenderHeight:8.5,fontSize:33,iconSize:49,lineHeight:41,letterSpacing:0},{ascenderHeight:10.5,descenderHeight:9.5,fontSize:38,iconSize:53,lineHeight:47,letterSpacing:0}]},label:{family:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',weights:{regular:600,medium:700,semibold:800,bold:900},sizes:[{ascenderHeight:2,descenderHeight:2,fontSize:8.1,iconSize:13,lineHeight:10,letterSpacing:.5},{ascenderHeight:2,descenderHeight:2,fontSize:9.5,iconSize:15,lineHeight:11,letterSpacing:.5},{ascenderHeight:2,descenderHeight:2,fontSize:10.8,iconSize:17,lineHeight:12,letterSpacing:.5},{ascenderHeight:2,descenderHeight:2,fontSize:12.25,iconSize:19,lineHeight:13,letterSpacing:.5},{ascenderHeight:2,descenderHeight:2,fontSize:13.6,iconSize:21,lineHeight:14,letterSpacing:.5},{ascenderHeight:2,descenderHeight:2,fontSize:15,iconSize:23,lineHeight:15,letterSpacing:.5}]},text:{family:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',weights:{regular:400,medium:500,semibold:600,bold:700},sizes:[{ascenderHeight:4,descenderHeight:4,fontSize:10,iconSize:17,lineHeight:15,letterSpacing:0},{ascenderHeight:5,descenderHeight:5,fontSize:13,iconSize:21,lineHeight:19,letterSpacing:0},{ascenderHeight:6,descenderHeight:6,fontSize:15,iconSize:25,lineHeight:23,letterSpacing:0},{ascenderHeight:7,descenderHeight:7,fontSize:18,iconSize:29,lineHeight:27,letterSpacing:0}
194,{ascenderHeight:8,descenderHeight:8,fontSize:21,iconSize:33,lineHeight:31,letterSpacing:0}]}},u=new WeakMap;function c(e){let t=u.get(e);if(t)return t;let n=h(e,e.card.enabled),r={_blend:e._blend||(e.dark?"screen":"multiply"),_dark:e.dark,accent:n.accent,avatar:n.avatar,backdrop:e.base.shadow.ambient,badge:n.badge,bg:e.base.bg,border:e.base.border,button:{default:d(e,e.button.default),ghost:d(e,e.button.ghost),bleed:d(e,e.button.bleed)},code:n.code,fg:e.base.fg,focusRing:e.base.focusRing,icon:n.muted.fg,input:{default:f(e.input.default),invalid:f(e.input.invalid)},kbd:n.kbd,link:n.link,muted:{...n.muted,bg:e.selectable?.default.enabled.bg2||e.base.bg},selectable:d(e,e.selectable||e.muted),shadow:e.base.shadow,skeleton:{from:e.skeleton?.from||e.base.border,to:e.skeleton?.to||e.base.border},syntax:e.syntax};return u.set(e,r),r}function d(e,t){return{default:{enabled:h(e,t.default.enabled),hovered:h(e,t.default.hovered),pressed:h(e,t.default.pressed),selected:h(e,t.default.selected),disabled:h(e,t.default.disabled)},neutral:{enabled:h(e,t.default.enabled),hovered:h(e,t.default.hovered),pressed:h(e,t.default.pressed),selected:h(e,t.default.selected),disabled:h(e,t.default.disabled)},primary:{enabled:h(e,t.primary.enabled),hovered:h(e,t.primary.hovered),pressed:h(e,t.primary.pressed),selected:h(e,t.primary.selected),disabled:h(e,t.primary.disabled)},suggest:{enabled:h(e,t.primary.enabled),hovered:h(e,t.primary.hovered),pressed:h(e,t.primary.pressed),selected:h(e,t.primary.selected),disabled:h(e,t.primary.disabled)},positive:{enabled:h(e,t.positive.enabled),hovered:h(e,t.positive.hovered),pressed:h(e,t.positive.pressed),selected:h(e,t.positive.selected),disabled:h(e,t.positive.disabled)},caution:{enabled:h(e,t.caution.enabled),hovered:h(e,t.caution.hovered),pressed:h(e,t.caution.pressed),selected:h(e,t.caution.selected),disabled:h(e,t.caution.disabled)},critical:{enabled:h(e,t.critical.enabled),hovered:h(e,t.critical.hovered),pressed:h(e,t.critical.pressed),selected:h(e,t.critical.selected),disabled:h(e,t.critical.disabled)}}}function h(e,t){return{...t,avatar:{gray:{bg:e.spot.gray,fg:e.base.bg},blue:{bg:e.spot.blue,fg:e.base.bg},purple:{bg:e.spot.purple,fg:e.base.bg},magenta:{bg:e.spot.magenta,fg:e.base.bg},red:{bg:e.spot.red,fg:e.base.bg},orange:{bg:e.spot.orange,fg:e.base.bg},yellow:{bg:e.spot.yellow,fg:e.base.bg},green:{bg:e.spot.green,fg:e.base.bg},cyan:{bg:e.spot.cyan,fg:e.base.bg}},badge:{default:{bg:e.muted.default.enabled.bg,fg:e.muted.default.enabled.fg,dot:e.muted.default.enabled.muted.fg,icon:e.muted.default.enabled.muted.fg},neutral:{bg:e.muted.transparent.enabled.bg,fg:e.muted.transparent.enabled.fg,dot:e.muted.transparent.enabled.muted.fg,icon:e.muted.transparent.enabled.muted.fg},primary:{bg:e.muted.primary.enabled.bg,fg:e.muted.primary.enabled.fg,dot:e.muted.primary.enabled.muted.fg,icon:e.muted.primary.enabled.muted.fg},suggest:{bg:e.muted.primary.enabled.bg,fg:e.muted.primary.enabled.fg,dot:e.muted.primary.enabled.muted.fg,icon:e.muted.primary.enabled.muted.fg},positive:{bg:e.muted.positive.enabled.bg,fg:e.muted.positive.enabled.fg,dot:e.muted.positive.enabled.muted.fg,icon:e.muted.positive.enabled.muted.fg},caution:{bg:e.muted.caution.enabled.bg,fg:e.muted.caution.enabled.fg,dot:e.muted.caution.enabled.muted.fg,icon:e.muted.caution.enabled.muted.fg},critical:{bg:e.muted.critical.enabled.bg,fg:e.muted.critical.enabled.fg,dot:e.muted.critical.enabled.muted.fg,icon:e.muted.critical.enabled.muted.fg}},kbd:{bg:e.muted.default.enabled.bg,fg:e.muted.default.enabled.fg,border:e.muted.default.enabled.border},muted:{...e.muted.default.enabled.muted,bg:t.bg2||t.bg},skeleton:{from:t.skeleton?.from||t.border,to:t.skeleton?.to||t.border}}}function f(e){return{enabled:p(e.enabled),disabled:p(e.disabled),readOnly:p(e.readOnly),hovered:p(e.hovered)}}function p(e){return{bg:e.bg,border:e.border,fg:e.fg,muted:{bg:e.bg2},placeholder:e.placeholder}}let m=new WeakMap;function g(e){if(e.sanity.v2?._resolved)return e.sanity.v2;let t=m.get(e);if(t)return t;let n={_version:2,_resolved:!0,avatar:{...a.avatar,...e.sanity.avatar},button:{...a.button,...e.sanity.button},card:a.card,color:c(e.sanity.color),container:e.sanity.container,font:e.sanity.fonts,input:{...a.input,...e.sanity.input,checkbox:{...a.input.checkbox,...e.sanity.input.checkbox},radio:{...a.input.radio,...e.sanity.input.radio},switch:{...a.input.switch,...e.sanity.input.switch}},layer:e.sanity.layer??a.layer,media:e.sanity.media,radius:e.sanity.radius,shadow:e.sanity.shadows,space:e.sanity.space,style:e.sanity.styles};return m.set(e,n),n}function y(e){return 2===e._version}let v=new WeakMap,b=new WeakMap;function x(e){let t=b.get(e);if(t)return t;let{avatar:n,button:r,color:i,container:o,font:s,input:a,media:l,radiu
194s:u,shadow:c,space:d,style:h}=e;return{_version:0,avatar:n,button:r,container:o,color:{light:{transparent:w(i.light.transparent),default:w(i.light.default),primary:w(i.light.primary),positive:w(i.light.positive),caution:w(i.light.caution),critical:w(i.light.critical)},dark:{transparent:w(i.dark.transparent),default:w(i.dark.default),primary:w(i.dark.primary),positive:w(i.dark.positive),caution:w(i.dark.caution),critical:w(i.dark.critical)}},focusRing:a.text.focusRing,fonts:s,input:a,media:l,radius:u,shadows:c,space:d,styles:h,v2:e}}function w(e){return{base:{bg:e.bg,fg:e.fg,border:e.border,focusRing:e.focusRing,shadow:e.shadow},button:e.button,card:e.selectable.default,dark:e._dark,input:{default:k(e.input.default),invalid:k(e.input.invalid)},muted:{...e.button.ghost,transparent:e.button.ghost.default},solid:{...e.button.default,transparent:e.button.default.default},selectable:e.selectable,spot:{gray:e.avatar.gray.bg,blue:e.avatar.blue.bg,purple:e.avatar.purple.bg,magenta:e.avatar.magenta.bg,red:e.avatar.red.bg,orange:e.avatar.orange.bg,yellow:e.avatar.yellow.bg,green:e.avatar.green.bg,cyan:e.avatar.cyan.bg},syntax:e.syntax}}function k(e){return{enabled:S(e.enabled),disabled:S(e.disabled),readOnly:S(e.readOnly),hovered:S(e.hovered)}}function S(e){return{bg:e.bg,bg2:e.muted.bg,border:e.border,fg:e.fg,placeholder:e.placeholder}}let E=["multiply","screen"],T=["transparent","default","neutral","primary","suggest","positive","caution","critical"],j=["default","neutral","primary","suggest","positive","caution","critical"],A=["enabled","hovered","pressed","selected","disabled"],M=["default","ghost","bleed"],_=["default","invali
194d"],P=["enabled","hovered","readOnly","disabled"];function C(e){return i.includes(e)}function I(e){return/^\d+%$/.test(e)}function O(e){var t;let n=e.split("/"),i=n.shift()||"",[o,s]=i.split(" ");if(C(o)){let e=n.shift()||"";return I(s)?{type:"color",tint:o,mix:Number(s.slice(0,-1))/100}:R(e)?{type:"color",tint:o,opacity:Number(e)}:{type:"color",tint:o}}if("black"===(t=o)||"white"===t){let e=n.shift()||"";return I(s)?{type:"color",key:o,mix:Number(s.slice(0,-1))/100}:R(e)?{type:"color",key:o,opacity:Number(e)}:{type:"color",key:o}}if(r.includes(o)){let[e,t]=(i=n.shift()||"").split(" ");if(C(e)){let r=n.shift()||"";return I(t)?{type:"color",hue:o,tint:e,mix:Number(t.slice(0,-1))/100}:R(r)?{type:"color",hue:o,tint:e,opacity:Number(r)}:{type:"color",hue:o,tint:e}}return{type:"hue",value:o}}if(E.includes(o))return{type:"blendMode",value:o}}function R(e){return"0"===e||/^0\.[0-9]+$/.test(e)||"1"===e}[...r],[...T],[...j],[...A],[..._],[...P];let V=["500","500"];function L(e,t=V){var n;let r,{hue:i,scheme:o}=e,s=O(t[+("light"!==o)]);if(!s||"color"!==s.type)throw Error(`Invalid color token: ${t[0]}`);return n={...s,hue:s.hue||i},r="",r="black"===n.key||"white"===n.key?n.key:`${n.hue}/${n.tint}`,void 0!==n.mix?`${r} ${100*n.mix}%`:(void 0!==n.opacity&&(r+=`/${n.opacity}`),r)}let D={base:{"*":{_blend:["multiply","screen"],accent:{fg:["purple/600","purple/400"]},avatar:{"*":{_blend:["screen","multiply"],bg:["500","400"],fg:["white","black"]}},backdrop:["gray/200/0.5","black/0.5"],badge:{"*":{bg:["100","900"],fg:["600","400"],icon:["500","500"],dot:["500","500"]},positive:{bg:["200 50%","900"],fg:["600","500"]},caution:{bg:["200 50%","900"],fg:["600","500"]}},bg:["50","950"],border:["200","800"],code:{bg:["50","950"],fg:["600","400"]},fg:["800","200"],focusRing:["blue/500","blue/500"],icon:["600","400"],kbd:{bg:["white","black"],fg:["600","400"],border:["200","800"]},link:{fg:["blue/600","blue/300"]},muted:{bg:["50","950"],fg:["700 75%","300 75%"]},shadow:{outline:["500/0.3","500/0.4"],umbra:["gray/500/0.1","black/0.2"],penumbra:["gray/500/0.07","black/0.14"],ambient:["gray/500/0.06","black/0.12"]},skeleton:{from:["100","900"],to:["100 50%","900 50%"]}},transparent:{bg:["50","black"]},default:{bg:["white","950"],fg:["800","200"],muted:{fg:["600","400"]}},primary:{_hue:"blue"},suggest:{_hue:"purple"},positive:{_hue:"green",shadow:{outline:["500/0.4","500/0.4"]}},caution:{_hue:"yellow",shadow:{outline:["600/0.3","500/0.4"]}},critical:{_hue:"red"}},button:{default:{"*":{"*":{_blend:["screen","multiply"],accent:{fg:["purple/300","purple/700"]},avatar:{"*":{_blend:["screen","multiply"],bg:["500","400"],fg:["white","black"]}},badge:{"*":{bg:["900","100"],fg:["400","600"],dot:["500","500"],icon:["500","500"]}},bg:["500","400"],border:["500/0","400/0"],code:{bg:["500 20%","400 20%"],fg:["200","600"]},fg:["white","black"],icon:["100 70%","900 70%"],kbd:{bg:["black","white"],fg:["200","600"],border:["800","200"]},link:{fg:["blue/200","blue/600"]},muted:{bg:["950","50"],fg:["100 70%","900 70%"]},skeleton:{from:["900","100"],to:["900 50%","100 50%"]}},hovered:{bg:["600","300"],border:["700/0","300/0"]},pressed:{bg:["700","300"]},selected:{bg:["700","300"]},disabled:{_hue:"gray",accent:{fg:["100 70%","900 70%"]},avatar:{"*":{_blend:["screen","multiply"],bg:["gray/500","gray/400"],fg:["white","black"]}},badge:{"*":{bg:["gray/700","gray/300"],fg:["white","black"],dot:["white","black"],icon:["white","black"]}},bg:["300","600"],code:{bg:["950","50"],fg:["300","600"]},fg:["300","600"],muted:{bg:["950","50"],fg:["300","600"]},kbd:{bg:["black","white"],fg:["white","black"],border:["700","300"]},link:{fg:["100 70%","900 70%"]}}},default:{"*":{avatar:{"*":{_blend:["screen","multiply"],bg:["500","400"],fg:["white","black"]}},bg:["800","200"],muted:{bg:["950","50"],fg:["400","600"]}},hovered:{bg:["900","100"]},pressed:{bg:["black","white"]},selected:{bg:["black","white"]}}},ghost:{"*":{"*":{_blend:["multiply","screen"],accent:{fg:["purple/700 60%","purple/300 70%"]},avatar:{"*":{_blend:["screen","multiply"],bg:["500","400"],fg:["white","black"]}},badge:{"*":{bg:["100","900"],fg:["600","400"],dot:["500","500"],icon:["500","500"]}},bg:["50","950"],border:["100","900"],code:{bg:["500 10%","400 10%"],fg:["700 60%","400 60%"]},fg:["600","400"],icon:["700 60%","300 60%"],kbd:{bg:["white","black"],fg:["600","400"],border:["200","800"]},link:{fg:["blue/700 60%","blue/300 60%"]},muted:{bg:["100","950"],fg:["700 60%","300 60%"]},skeleton:{from:["100","900"],to:["100 50%","900 50%"]}},hovered:{bg:["100","900"],fg:["700","300"]},pressed:{bg:["200","800"],fg:["800","200"]},selected:{bg:["200","800"],fg:["800","200"]},disabled:{_hue:"gray",accent:{fg:["200","800"]},avatar:{"*":{_blend:["screen","multiply"],bg:["gray/100","gray/900"],fg:["white","black"]}}
194,badge:{"*":{_hue:"gray",bg:["50","950"],fg:["gray/200","gray/800"],dot:["gray/200","gray/800"],icon:["gray/200","gray/800"]}},border:["100","900"],code:{bg:["50","950"],fg:["200","800"]},fg:["400","600"],icon:["300","700"],muted:{fg:["300","700"]},kbd:{bg:["white","black"],fg:["200","800"],border:["100","900"]},link:{fg:["200","800"]}}},positive:{"*":{border:["600 20%","800"]}},caution:{"*":{border:["600 20%","800"]}}},bleed:{"*":{"*":{_blend:["multiply","screen"],accent:{fg:["purple/700 70%","purple/300 70%"]},avatar:{"*":{_blend:["screen","multiply"],bg:["500","400"],fg:["white","black"]}},badge:{"*":{bg:["100","900"],fg:["600","400"],dot:["500","500"],icon:["500","500"]}},bg:["white","black"],border:["white/0","black/0"],code:{bg:["50","950"],fg:["700 75%","300 75%"]},fg:["700","300"],icon:["700 75%","300 75%"],kbd:{bg:["white","black"],fg:["700","300"],border:["200","800"]},link:{fg:["blue/700 70%","blue/300 70%"]},muted:{bg:["100","950"],fg:["700 75%","300 75%"]},skeleton:{from:["100","900"],to:["100 50%","900 50%"]}},hovered:{bg:["50","950"],fg:["800","200"],icon:["800 70%","300 70%"]},pressed:{bg:["100","900"],fg:["800","200"],icon:["800 70%","200 70%"]},selected:{bg:["100","900"],fg:["800","200"],icon:["800 60%","200 60%"]},disabled:{_hue:"gray",accent:{fg:["200","800"]},avatar:{"*":{_blend:["screen","multiply"],bg:["gray/100","gray/900"],fg:["white","black"]}},badge:{"*":{_hue:"gray",bg:["50","950"],fg:["gray/200","gray/800"],dot:["gray/200","gray/800"],icon:["gray/200","gray/800"]}},code:{bg:["50","950"],fg:["200","800"]},fg:["400","600"],icon:["300","700"],muted:{fg:["400","600"]},kbd:{bg:["white","black"],fg:["200","800"],border:["100","900"]},link:{fg:["200","800"]}}}}},input:{"*":{"*":{_blend:["multiply","screen"],bg:["white","black"],border:["200","700"],fg:["black","200"],muted:{bg:["50","950"]},placeholder:["400","600"]},hovered:{border:["300","700"]},readOnly:{bg:["50","950"],border:["200","800"],fg:["800","200"]},disabled:{bg:["50","950"],fg:["400","600"],border:["100","900"],placeholder:["200","800 50%"]}},invalid:{"*":{_hue:"red",bg:["100","950"]}}},selectable:{"*":{"*":{_blend:["multiply","screen"],accent:{fg:["purple/700 70%","purple/300 70%"]},avatar:{"*":{_blend:["screen","multiply"],bg:["500","400"],fg:["white","black"]}},badge:{"*":{bg:["100","900"],fg:["600","400"],dot:["500","500"],icon:["500","500"]}},bg:["white","black"],border:["200","800"],code:{bg:["50","950"],fg:["600","400"]},fg:["700","300"],icon:["700 75%","300 75%"],kbd:{bg:["white","black"],fg:["600","400"],border:["200","800"]},link:{fg:["blue/700 70%","blue/300 70%"]},muted:{bg:["50","950"],fg:["700 75%","300 75%"]},skeleton:{from:["100","900"],to:["100 50%","900 50%"]}},hovered:{bg:["50","950"]},pressed:{bg:["100","900"]},selected:{_blend:["screen","multiply"],accent:{fg:["purple/300","purple/700"]},avatar:{"*":{_blend:["multiply","screen"],bg:["white","black"],fg:["black","white"]}},badge:{"*":{bg:["900","100"],fg:["400","600"],dot:["500","500"],icon:["500","500"]}},bg:["500","400"],border:["500 20%","400 20%"],code:{bg:["500 20%","400 20%"],fg:["200","600"]},fg:["white","black"],icon:["100 70%","900 70%"],kbd:{bg:["black","white"],fg:["200","600"],border:["800","200"]},link:{fg:["blue/200","blue/600"]},muted:{bg:["500 10%","400 10%"],fg:["100 70%","900 70%"]},skeleton:{from:["900","100"],to:["900 50%","100 50%"]}},disabled:{_hue:"gray",accent:{fg:["200","800"]},avatar:{"*":{_blend:["screen","multiply"],bg:["gray/100","gray/900"],fg:["white","black"]}},badge:{"*":{_hue:"gray",bg:["50","950"],fg:["gray/200","gray/800"],dot:["gray/200","gray/800"],icon:["gray/200","gray/800"]}},border:["100","900"],code:{bg:["50","950"],fg:["200","800"]},fg:["200","800"],icon:["200","800"],kbd:{bg:["white","black"],fg:["200","800"],border:["100","900"]},link:{fg:["200","800"]},muted:{bg:["50 50%","950 50%"],fg:["200","800"]}}},default:{selected:{_hue:"blue"}},critical:{disabled:{bg:["50 50%","950 50%"]}}},syntax:{atrule:["purple/600","purple/400"],attrName:["green/600","green/400"],attrValue:["yellow/600","yellow/400"],attribute:["yellow/600","yellow/400"],boolean:["purple/600","purple/400"],builtin:["purple/600","purple/400"],c
194data:["yellow/600","yellow/400"],char:["yellow/600","yellow/400"],class:["orange/600","orange/400"],className:["cyan/600","cyan/400"],comment:["gray/400","gray/600"],constant:["purple/600","purple/400"],deleted:["red/600","red/400"],entity:["red/600","red/400"],function:["green/600","green/400"],hexcode:["blue/600","blue/400"],id:["purple/600","purple/400"],important:["purple/600","purple/400"],inserted:["yellow/600","yellow/400"],keyword:["magenta/600","magenta/400"],number:["purple/600","purple/400"],operator:["magenta/600","magenta/400"],property:["blue/600","blue/400"],pseudoClass:["yellow/600","yellow/400"],pseudoElement:["yellow/600","yellow/400"],punctuation:["gray/600","gray/400"],regex:["blue/600","blue/400"],selector:["red/600","red/400"],string:["yellow/600","yellow/400"],symbol:["purple/600","purple/400"],tag:["red/600","red/400"],unit:["orange/600","orange/400"],url:["red/600","red/400"],variable:["red/600","red/400"]}};function $(e){return!!(e&&"object"==typeof e&&!Array.isArray(e))}function z(...e){let t=e.filter(Boolean);return 0===t.length?{}:t.reduce(F,{})}function F(e,t){for(let n of Object.keys(t)){let r=e[n],i=t[n];$(r)&&$(i)?e[n]=z(r,i):e[n]=i}return e}function B(e,t){let{scheme:n}=e,r={};for(let e of T)r[e]=function(e,t){let{scheme:n,tone:r}=e,i=t?.color?.base?.[r],o={hue:i?._hue||"gray",scheme:n};return{_blend:(i?._blend||["multiply","screen"])[+("light"!==n)],_dark:"dark"===n,accent:{fg:L(o,i?.accent?.fg)},avatar:N({scheme:n},i),backdrop:L(o,i?.backdrop),badge:H(i?.badge,{scheme:n},t),bg:L(o,i?.bg),border:L(o,i?.border),button:function(e,t){let{scheme:n,tone:r}=e,i={};for(let e of M)i[e]=function(e,t){let{cardTone:n,mode:r,scheme:i}=e,o={};for(let e of j)o[e]=function(e,t){let{cardTone:n,mode:r,scheme:i,tone:o}=e,s={};for(let e of A)s[e]=function(e,t){let{cardTone:n,mode:r,tone:i,scheme:o,state:s}=e,a=t?.color?.base?.[n],l=t?.color?.button?.[r]?.[i]?.[s],u=l?._hue||a?._hue||"gray",c=l?._blend||["screen","multiply"],d={hue:u,scheme:o};return{_blend:c[+("light"!==o)],accent:{fg:L(d,l?.accent?.fg)},avatar:N({scheme:o},l),badge:H(l?.badge,{scheme:o},t),bg:L(d,l?.bg),border:L(d,l?.border),code:{bg:L(d,l?.code?.bg),fg:L(d,l?.code?.fg)},fg:L(d,l?.fg),icon:L(d,l?.icon),muted:{bg:L(d,l?.muted?.bg),fg:L(d,l?.muted?.fg)},kbd:{bg:L(d,l?.kbd?.bg),fg:L(d,l?.kbd?.fg),border:L(d,l?.kbd?.border)},link:{fg:L(d,l?.link?.fg)},skeleton:{from:L(d,l?.skeleton?.from),to:L(d,l?.skeleton?.to)}}}({cardTone:n,mode:r,tone:o,scheme:i,state:e},t);return s}({cardTone:n,mode:r,scheme:i,tone:e},t);return o}({cardTone:r,scheme:n,mode:e},t);return i}({scheme:n,tone:r},t),code:{bg:L(o,i?.code?.bg),fg:L(o,i?.code?.fg)},fg:L(o,i?.fg),focusRing:L(o,i?.focusRing),icon:L(o,i?.icon),input:function(e,t){let{scheme:n,tone:r}=e;return{default:W({mode:"default",scheme:n,tone:r},t),invalid:W({mode:"invalid",scheme:n,tone:r},t)}}({scheme:n,tone:r},t),kbd:{bg:L(o,i?.kbd?.bg),fg:L(o,i?.kbd?.fg),border:L(o,i?.kbd?.border)},link:{fg:L(o,i?.link?.fg)},muted:{bg:L(o,i?.muted?.bg),fg:L(o,i?.muted?.fg)},selectable:function(e,t){let{scheme:n,tone:r}=e,i={};for(let e of j)i[e]=function(e,t){let{cardTone:n,scheme:r,tone:i}=e,o={};for(let e of A)o[e]=function(e,t){let{cardTone:n,scheme:r,state:i,tone:o}=e,s=t?.color?.base?.[n],a=t?.color?.selectable?.[o]?.[i],l=a?._hue||s?._hue||"gray",u=a?._blend||["screen","multiply"],c={hue:l,scheme:r};return{_blend:u[+("light"!==r)],accent:{fg:L(c,a?.accent?.fg)},avatar:N({scheme:r},a),badge:H(a?.badge,{scheme:r},t),bg:L(c,a?.bg),border:L(c,a?.border),code:{bg:L(c,a?.code?.bg),fg:L(c,a?.code?.fg)},fg:L(c,a?.fg),icon:L(c,a?.icon),muted:{bg:L(c,a?.muted?.bg),fg:L(c,a?.muted?.fg)},kbd:{bg:L(c,a?.kbd?.bg),fg:L(c,a?.kbd?.fg),border:L(c,a?.kbd?.border)},link:{fg:L(c,a?.link?.fg)},skeleton:{from:L(c,a?.skeleton?.from),to:L(c,a?.skeleton?.to)}}}({cardTone:n,tone:i,scheme:r,state:e},t);return o}({cardTone:r,scheme:n,tone:e},t);return i}({scheme:n,tone:r},t),shadow:function(e,t){let{scheme:n,tone:r}=e,i=t?.color?.base?.[r],o={hue:i?._hue||"gray",scheme:n};return{outline:L(o,i?.shadow?.outline),umbra:L(o,i?.shadow?.umbra),penumbra:L(o,i?.shadow?.penumbra),ambient:L(o,i?.shadow?.ambient)}}
194({scheme:n,tone:r},t),skeleton:{from:L(o,i?.skeleton?.from),to:L(o,i?.skeleton?.to)},syntax:function(e,t){let{scheme:n}=e,r=t?.color?.syntax,i={hue:"gray",scheme:n};return{atrule:L(i,r?.atrule),attrName:L(i,r?.attrName),attrValue:L(i,r?.attrValue),attribute:L(i,r?.attribute),boolean:L(i,r?.boolean),builtin:L(i,r?.builtin),cdata:L(i,r?.cdata),char:L(i,r?.char),class:L(i,r?.class),className:L(i,r?.className),comment:L(i,r?.comment),constant:L(i,r?.constant),deleted:L(i,r?.deleted),doctype:L(i,r?.doctype),entity:L(i,r?.entity),function:L(i,r?.function),hexcode:L(i,r?.hexcode),id:L(i,r?.id),important:L(i,r?.important),inserted:L(i,r?.inserted),keyword:L(i,r?.keyword),number:L(i,r?.number),operator:L(i,r?.operator),prolog:L(i,r?.prolog),property:L(i,r?.property),pseudoClass:L(i,r?.pseudoClass),pseudoElement:L(i,r?.pseudoElement),punctuation:L(i,r?.punctuation),regex:L(i,r?.regex),selector:L(i,r?.selector),string:L(i,r?.string),symbol:L(i,r?.symbol),tag:L(i,r?.tag),unit:L(i,r?.unit),url:L(i,r?.url),variable:L(i,r?.variable)}}({scheme:n},t)}}({scheme:n,tone:e},t);return r}function N(e,t){let{scheme:n}=e;return{gray:U({color:"gray",scheme:n},t),blue:U({color:"blue",scheme:n},t),purple:U({color:"purple",scheme:n},t),magenta:U({color:"magenta",scheme:n},t),red:U({color:"red",scheme:n},t),orange:U({color:"orange",scheme:n},t),yellow:U({color:"yellow",scheme:n},t),green:U({color:"green",scheme:n},t),cyan:U({color:"cyan",scheme:n},t)}}function U(e,t){let{color:n,scheme:r}=e,i=t?.avatar?.[n],o={hue:i?._hue||"gray",scheme:r};return{_blend:(i?._blend||["screen","multiply"])[+("light"!==r)],bg:L(o,i?.bg),fg:L(o,i?.fg)}}function H(e,t,n){let{scheme:r}=t,i={};for(let t of j)i[t]=function(e,t,n){let{scheme:r,tone:i}=t,o=e?.[i],s={hue:o?._hue||n?.color?.base?.[i]?._hue||"gray",scheme:r};return{bg:L(s,o?.bg),fg:L(s,o?.fg),dot:L(s,o?.dot),icon:L(s,o?.icon)}}(e,{scheme:r,tone:t},n);return i}function W(e,t){let{mode:n,scheme:r,tone:i}=e;return{enabled:Y({mode:n,scheme:r,state:"enabled",cardTone:i},t),hovered:Y({mode:n,scheme:r,state:"hovered",cardTone:i},t),readOnly:Y({mode:n,scheme:r,state:"readOnly",cardTone:i},t),disabled:Y({mode:n,scheme:r,state:"disabled",cardTone:i},t)}}function Y(e,t){let{cardTone:n,mode:r,scheme:i,state:o}=e,s=t?.color?.base?.[n],a=t?.color?.input?.[r]?.[o],l=a?._hue||s?._hue||"gray",u=a?._blend||["screen","multiply"],c={hue:l,scheme:i};return{_blend:u[+("light"!==i)],bg:L(c,a?.bg),border:L(c,a?.border),fg:L(c,a?.fg),muted:{bg:L(c,a?.muted?.bg)},placeholder:L(c,a?.placeholder)}}function q(e,t=0,n=1){return Math.min(n,Math.max(t,e))}function G(e,t,n,r,i){var o;return n*(1-(o=q((i-e)/(t-e))))+r*o}function X(e){return Math.round(e)}function K(e){if(4===e.length){let t=e.slice(1,2),n=e.slice(2,3),r=e.slice(3,4);return{r:parseInt(t+t,16),g:parseInt(n+n,16),b:parseInt(r+r,16)}}return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16)}}function Z(e){let t=X(q(Math.round(e.r),0,255)),n=X(q(Math.round(e.g),0,255)),r=X(q(Math.round(e.b),0,255));return"a"in e?`rgba(${t},${n},${r},${e.a})`:"#"+(0x1000000+(t<<16)+(n<<8)+r).toString(16).slice(1)}let J=/hsl\(\s*(\d+)\s*,\s*((\d+(?:\.\d+)?)%)\s*,\s*((\d+(?:\.\d+)?)%)\s*\)/i;function Q(e){if(!e)return{r:0,g:0,b:0};if("string"!=typeof e)throw Error("parseColor: expected a string");if("#"===e[0]&&(4===e.length||7===e.length)&&function(e){for(let t of e)if(-1==="0123456789ABCDEFabcdef".indexOf(t))return!1;return!0}(e.slice(1)))return K(e);if(e.startsWith("hsl("))return function(e){let t=e.s/100,n=e.l/100,r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e.h/60%2-1)),o=n-r/2,s=0,a=0,l=0;return 0<=e.h&&e.h<60?(s=r,a=i,l=0):60<=e.h&&e.h<120?(s=i,a=r,l=0):120<=e.h&&e.h<180?(s=0,a=r,l=i):180<=e.h&&e.h<240?(s=0,a=i,l=r):240<=e.h&&e.h<300?(s=i,a=0,l=r):300<=e.h&&e.h<360&&(s=r,a=0,l=i),{r:Math.round((s+o)*255),g:Math.round((a+o)*255),b:Math.round((l+o)*255)}}(function(e){let t=J.exec(e);if(!t)throw Error(`parseHsl: string is not a HSL color: "${e}"`);return{h:parseInt(t[1]),s:parseFloat(t[3]),l:parseFloat(t[5])}}(e));if(e.startsWith("rgba(")){let t=e.replace(/rgba\(|\)/g,"").split(",");return{r:parseInt(t[0]),g:parseInt(t[1]),b:parseInt(t[2]),a:parseFloat(t[3])}}throw Error(`parseColor: unexpected color format: "${e}"`)}let ee=[0,255];function et(e,t){let{bg:n,blendMode:r,colorPalette:i}=t;if("white"===n)throw Error("Cannot blend with white background");let o=O(e);
194if(!o||"color"!==o.type)throw Error(`Invalid color token value: ${e}`);let s="";if("black"===o.key&&(s=en(i.black)),"white"===o.key&&(s=en(i.white)),o.hue&&o.tint&&(s=en(i[o.hue][o.tint])),!s)throw Error(`Invalid color token value: ${e}`);let a=s,l={blendMode:r,bg:n,black:en(i.black),white:en(i.white)};try{if(s=function(e,t){var n,r,i,o,s,a;let{blendMode:l}=t,u=Q(e),c=Q(t.black),d=Q(t.white),h=t.bg?Q(t.bg):"multiply"===l?d:c,f={r:[c.r,d.r],g:[c.g,d.g],b:[c.b,d.b]},p={r:q(G(...f.r,...ee,h.r),...ee),g:q(G(...f.g,...ee,h.g),...ee),b:q(G(...f.b,...ee,h.b),...ee)},m={r:q(G(...f.r,...ee,u.r),...ee),g:q(G(...f.g,...ee,u.g),...ee),b:q(G(...f.b,...ee,u.b),...ee)},g="multiply"===l?{r:255*(p.r/255*(m.r/255)),g:255*(p.g/255*(m.g/255)),b:255*(p.b/255*(m.b/255))}:{r:255*((n=p.r/255)+(r=m.r/255)-n*r),g:255*((i=p.g/255)+(o=m.g/255)-i*o),b:255*((s=p.b/255)+(a=m.b/255)-s*a)};return Z({r:q(G(...ee,...f.r,g.r),...f.r),g:q(G(...ee,...f.g,g.g),...f.g),b:q(G(...ee,...f.b,g.b),...f.b)})}(s,l),n&&void 0!==o.mix){var u,c,d,h,f,p,m;let e=K(n),t=K(s);s=Z((u=o.mix,{r:(c=e.r,d=t.r,c+(d-c)*u),g:(h=e.g,f=t.g,h+(f-h)*u),b:(p=e.b,m=t.b,p+(m-p)*u)}))}}catch(e){throw console.warn("could not blend",s,l),e}return"#aN"===s&&(console.warn(`invalid color token value: ${e}`),s=a),void 0!==o.opacity&&(s=function(e,t){let n=Q(e);return`rgba(${n.r},${n.g},${n.b},${t})`}(s,o.opacity)),s}function en(e){return"string"==typeof e?e:e.hex}function er(e,t){let n=Object.entries(t),[,r]=n.find(([e])=>"transparent"===e),[,i]=n.find(([e])=>"default"===e),o=ei(r,{colorPalette:e}),s=ei(i,{colorPalette:e}),a=s.bg;if("white"===a)throw Error("Cannot blend with white background");return Object.fromEntries([["transparent",o],["default",s],...n.filter(([e])=>"default"!==e&&"transparent"!==e).map(([t,n])=>[t,ei(n,{bg:a,colorPalette:e})])])}function ei(e,t){var n,r,i,o;let{colorPalette:s,bg:a}=t,l=e._blend||"multiply",u=et(e.bg,{colorPalette:s,bg:a,blendMode:l}),c={colorPalette:s,bg:u,blendMode:l},d=(n=e.button,r={baseBg:u,blendMode:l,colorPalette:s},{default:ea(n.default,r),ghost:ea(n.ghost,r),bleed:ea(n.bleed,r)}),h=function(e,t){let n={};for(let o of j){var r,i;n[o]=(r=e[o],i=t,{enabled:el(r.enabled,i),hovered:el(r.hovered,i),pressed:el(r.pressed,i),selected:el(r.selected,i),disabled:el(r.disabled,i)})}return n}(e.selectable,{colorPalette:s,baseBg:u,blendMode:l}),f={outline:et(e.shadow.outline,c),umbra:et(e.shadow.umbra,{...c,bg:void 0,colorPalette:{...s,black:"#000000"}}),penumbra:et(e.shadow.penumbra,{...c,bg:void 0,colorPalette:{...s,black:"#000000"}}),ambient:et(e.shadow.ambient,{...c,bg:void 0,colorPalette:{...s,black:"#000000"}})};return{_blend:l,_dark:e._dark,accent:{fg:et(e.accent.fg,c)},avatar:eo(e.avatar,{baseBg:u,colorPalette:s,blendMode:l}),backdrop:et(e.backdrop,c),badge:es(e.badge,{baseBg:u,colorPalette:s,blendMode:l}),bg:u,border:et(e.border,c),button:d,code:{bg:et(e.code.bg,c),fg:et(e.code.fg,c)},fg:et(e.fg,c),focusRing:et(e.focusRing,c),icon:et(e.icon,c),input:(i=e.input,o={baseBg:u,colorPalette:s,blendMode:l},{default:eu(i.default,o),invalid:eu(i.invalid,o)}),kbd:function(e,t){let{baseBg:n,blendMode:r,colorPalette:i}=t,o=et(e.bg,{bg:n,blendMode:r,colorPalette:i}),s={bg:o,blendMode:r,colorPalette:i};return{bg:o,fg:et(e.fg,s),border:et(e.border,s)}}(e.kbd,{baseBg:u,colorPalette:s,blendMode:l}),link:{fg:et(e.link.fg,c)},muted:{bg:et(e.muted.bg,c),fg:et(e.muted.fg,c)},shadow:f,skeleton:{from:et(e.skeleton.from,c),to:et(e.skeleton.to,c)},syntax:function(e,t){let{colorPalette:n,baseBg:r,blendMode:i}=t,o={colorPalette:n,bg:r,blendMode:i};return{atrule:et(e.atrule,o),attrName:et(e.attrName,o),attrValue:et(e.attrValue,o),attribute:et(e.attribute,o),boolean:et(e.boolean,o),builtin:et(e.builtin,o),cdata:et(e.cdata,o),char:et(e.char,o),class:et(e.class,o),className:et(e.className,o),comment:et(e.comment,o),constant:et(e.constant,o),deleted:et(e.deleted,o),doctype:et(e.doctype,o),entity:et(e.entity,o),function:et(e.function,o),hexcode:et(e.hexcode,o),id:et(e.id,o),important:et(e.important,o),inserted:et(e.inserted,o),keyword:et(e.keyword,o),number:et(e.number,o),operator:et(e.operator,o),prolog:et(e.prolog,o),property:et(e.property,o),pseudoClass:et(e.pseudoClass,o),pseudoElement:et(e.pseudoElement,o),punctuation:et(e.punctuation,o),regex:et(e.regex,o),selector:et(e.selector,o),string:et(e.string,o),symbol:et(e.symbol,o),tag:et(e.tag,o),unit:et(e.unit,o),url:et(e.url,o),variable:et(e.variable,o)}}(e.syntax,{baseBg:u,colorPalette:s,blendMode:l}),selectable:h}}function eo(e,t){let n={};for(let i of r)n[i]=function(e,t){let{baseBg:n,blendMode:r,colorPalette:i}=t,o=e._blend||"multiply",s=et(e.bg,{bg:n,blendMode:r,colorPalette:i});return{_blend:o,bg:s,fg:et(e.fg,{bg:s,blendMode:o,colorPalette:i})}}(e[i],t);return n}function es(e,t){let n={};for(let r of j)n[r]=function(e,t){let{baseBg:n,blendMode:r,colorPalette:i}=t,o=et(e.bg,{bg:n,blendMode:r,colorPalette:i}),s={bg:o,blendMode:r,colorPalette:i};return{bg:o,dot:et(e.dot,s),fg:et(e.fg,s),icon:et(e.icon,s)}}(e[r],t);return n}function ea(e,t){let n={};for(let o of j){var r,i;n[o]=(r=e[o],i=t,{enabled:el(r.enabled,i),hovered:el(r.hovered,i),pressed:el(r.pressed,i),selected:el(r.selected,i),disabled:el(r.disabled,i)})}return n}function el(e,t){let{baseBg:n,blendMode:r,colorPalette:i}=t,o=e._blend||"multiply",s=et(e.bg,{bg:n,blendMode:r,colorPalette:i}),a={bg:s,blendMode:o,colorPalette:i};return{_blend:o,accent:{fg:et(e.accent.fg,a)},avatar:eo(e.avatar,{baseBg:s,colorPalette:i,blendMode:o}),badge:es(e.badge,{baseBg:s,colorPalette:i,blendMode:o}),bg:s,border:et(e.border,a),code:{bg:et(e.code.bg,a),fg:et(e.code.fg,a)},fg:et(e.fg,a),icon:et(e.icon,a),link:{fg:et(e.link.fg,a)},muted:{bg:et(e.muted.bg,a),fg:et(e.muted.fg,a)},kbd:{bg:et(e.kbd.bg,a),fg:et(e.kbd.fg,a),border:et(e.kbd.border,a)},skeleton:{from:et(e.skeleton?.from,a),to:et(e.skeleton?.to,a)}}}function eu(e,t){return{enabled:ec(e.enabled,t),hovered:ec(e.hovered,t),readOnly:ec(e.readOnly,t),disabled:ec(e.disabled,t)}}function ec(e,t){let{baseBg:n,blendMode:r,colorPalette:i}=t,o=e._blend||"multiply",s=et(e.bg,{colorPalette:i,bg:n,blendMode:r}),a={colorPalette:i,bg:s,blendMode:o};return{_blend:o,bg:s,border:et(e.border,a),fg:et(e.fg,a),muted:{bg:et(e.muted.bg,a)},placeholder:et(e.placeholder,a)}}function ed(e){let t=function(e){let t={color:function(e){let t=z(D,e);return{base:function(e){let t={};for(let n of T)t[n]=function(e,t){let n=z(e?.base?.["*"],e?.base?.[t]),i=n._hue||e?.base?.[t]?._hue||"gray";return{...n,_hue:i,avatar:r.reduce((e,t)=>
194({...e,[t]:z({_hue:t},n.avatar?.["*"],n.avatar?.[t])}),{}),badge:j.reduce((t,r)=>({...t,[r]:{_hue:e?.base?.[r]?._hue||i,...n.badge?.["*"],...n.badge?.[r]}}),{})}}(e,n);return t}(t),button:function(e){let t={};for(let n of M)t[n]=function(e,t){let n={};for(let i of j)n[i]=function(e,t,n){let i={};for(let o of A)i[o]=function(e,t,n,i){let o=z(e?.button?.[n]?.["*"]?.["*"],e?.button?.[n]?.[t]?.["*"],e?.button?.[n]?.["*"]?.[i],e?.button?.[n]?.[t]?.[i]),s=o._hue||e?.base?.[t]?._hue;return{...o,_hue:s,avatar:r.reduce((e,t)=>({...e,[t]:z({_hue:t},o.avatar?.["*"],o.avatar?.[t])}),{}),badge:j.reduce((t,n)=>({...t,[n]:{_hue:e?.base?.[n]?._hue||s,...o.badge?.["*"],...o.badge?.[n]}}),{})}}(e,n,t,o);return i}(e,t,i);return n}(e,n);return t}(t),input:function(e){let t={};for(let n of _)t[n]=function(e,t){let n={};for(let r of P)n[r]=function(e,t,n){let r=z(e?.input?.["*"]?.["*"],e?.input?.[t]?.["*"],e?.input?.["*"]?.[n],e?.input?.[t]?.[n]),i=r._hue||e?.input?.[t]?._hue;return{...r,_hue:i}}(e,t,r);return n}(e,n);return t}(t),selectable:function(e){let t={};for(let n of j)t[n]=function(e,t){let n={_hue:e?.selectable?.[t]?._hue||e?.base?.[t]?._hue};for(let i of A)n[i]=function(e,t,n){let i=z(e?.selectable?.["*"]?.["*"],e?.selectable?.[t]?.["*"],e?.selectable?.["*"]?.[n],e?.selectable?.[t]?.[n]),o=i._hue||e?.base?.[t]?._hue;return{...i,_hue:o,avatar:r.reduce((e,t)=>({...e,[t]:z({_hue:t},i.avatar?.["*"],i.avatar?.[t])}),{}),badge:j.reduce((t,n)=>({...t,[n]:{_hue:e?.base?.[n]?._hue||o,...i.badge?.["*"],...i.badge?.[n]}}),{})}}(e,t,i);return n}(e,n);return t}(t),syntax:t.syntax}}(e?.color)};return{light:B({scheme:"light"},t),dark:B({scheme:"dark"},t)}}(e);return x({_version:2,avatar:e?.avatar??a.avatar,button:e?.button??a.button,card:e?.card??a.card,color:function(e,t){let n=t?.palette??o;return{light:er(n,e.light),dark:er(n,e.dark)}}(t,e),container:e?.container??a.container,font:e?.font??l,input:e?.input??a.input,layer:e?.layer??a.layer,media:e?.media??a.media,radius:e?.radius??a.radius,shadow:e?.shadow??a.shadow,space:e?.space??a.space,style:e?.style??a.style})}let eh=new Map;function ef(e,t,n){var r;let i=function(e,t,n){let r=eh.get(t);if(!r)return;let i=r.get(n);if(i)return i.get(e)}(e,t,n);if(i)return i;let o=y(e)?x(e):e,s=y(e)?e:function(e){if(e.v2)return e.v2;let t=v.get(e);if(t)return t;let{avatar:n,button:r,color:i,container:o,fonts:s,input:l,layer:u,media:d,radius:h,shadows:f,space:p,styles:m}=e,g={_version:2,avatar:{...a.avatar,...n},button:{...a.button,...r},card:a.card,color:{light:{transparent:c(i.light.transparent),default:c(i.light.default),neutral:c(i.light.transparent),primary:c(i.light.primary),suggest:c(i.light.primary),positive:c(i.light.positive),caution:c(i.light.caution),critical:c(i.light.critical)},dark:{transparent:c(i.dark.transparent),default:c(i.dark.default),neutral:c(i.dark.transparent),primary:c(i.dark.primary),suggest:c(i.dark.primary),positive:c(i.dark.positive),caution:c(i.dark.caution),critical:c(i.dark.critical)}},container:o,font:s,input:{...a.input,...l,checkbox:{...a.input.checkbox,...l.checkbox},radio:{...a.input.radio,...l.radio},switch:{...a.input.switch,...l.switch}},layer:u??a.layer,media:d,radius:h,shadow:f,space:p,style:m};return v.set(e,g),g}(e),l=o.color[t]||o.color.light,u=l[n]||l.default,d=o.layer||a.layer,h=s.color[t]||s.color.light,f="neutral"in(r=h[n]||h.default).badge?r:{...r,badge:{...r.badge,neutral:r.badge.default,suggest:r.badge.primary},button:{bleed:{...r.button.bleed,neutral:r.button.bleed.default,suggest:r.button.bleed.primary},default:{...r.button.default,neutral:r.button.default.default,suggest:r.button.default.primary},ghost:{...r.button.ghost,neutral:r.button.ghost.default,suggest:r.button.ghost.primary}},selectable:{...r.selectable,neutral:r.selectable.default,suggest:r.selectable.primary}},p=s.layer||a.layer,m={sanity:{...o,color:u,layer:d,v2:{...s,_resolved:!0,color:f,layer:p}}};return function(e,t,n,r){eh.has(t)||eh.set(t,new Map);let i=eh.get(t);i.has(n)||i.set(n,new WeakMap),i.get(n).set(e,r)}(e,t,n,m),m}},95486:(e,t,n)=>{var r=n(2603),i=n(9819),o=n(18053),s=n(60567);e.exports=function(e){return function(t){var n=i(t=s(t))?o(t):void 0,a=n?n[0]:t.charAt(0),l=n?r(n,1).join(""):t.slice(1);return a[e]()+l}}},97397:(e,t,n)=>{e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.