1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,599568,(e,t,n)=>{var r=e.r(581511);t.exports=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},806016,(e,t,n)=>{var r=e.r(599568);t.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},878379,(e,t,n)=>{var r=e.r(806016),i=e.r(424516),o=Object.prototype.hasOwnProperty;t.exports=i(function(e,t,n){o.call(e,n)?e[n].push(t):r(e,n,[t])})},302791,864676,535438,252247,511568,428585,e=>{"use strict";let t,n,r,i,o,s,a,l;var u,c,d,p,f,h,m=e.i(255127),y=e.i(780747),g=e.i(10412);let v={"handshake/syn":g.MSG_HANDSHAKE_SYN,"handshake/syn-ack":g.MSG_HANDSHAKE_SYN_ACK,"handshake/ack":g.MSG_HANDSHAKE_ACK,"channel/response":g.MSG_RESPONSE,"channel/heartbeat":g.MSG_HEARTBEAT,"channel/disconnect":g.MSG_DISCONNECT,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"},x={[g.MSG_HANDSHAKE_SYN]:"handshake/syn",[g.MSG_HANDSHAKE_SYN_ACK]:"handshake/syn-ack",[g.MSG_HANDSHAKE_ACK]:"handshake/ack",[g.MSG_RESPONSE]:"channel/response",[g.MSG_HEARTBEAT]:"channel/heartbeat",[g.MSG_DISCONNECT]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},w=e=>{let{data:t}=e;return t&&"object"==typeof t&&"domain"in t&&"type"in t&&"from"in t&&"to"in t&&("sanity/channels"===t.domain&&(t.domain=g.DOMAIN),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.channelId=t.connectionId,delete t.connectionId,t.type=v[t.type]??t.type),e},b=({context:e},t)=>{let{sources:n,targetOrigin:r}=e,i=(e=>{let{channelId:t,...n}=e,r={...n,connectionId:t};return r.domain===g.DOMAIN&&(r.domain="sanity/channels"),"visual-editing"===r.to&&(r.to="overlays"),"visual-editing"===r.from&&(r.from="overlays"),r.type=x[r.type]??r.type,"channel/response"===r.type&&r.responseTo&&!r.data&&(r.data={responseTo:r.responseTo}),("handshake/syn"===r.type||"handshake/syn-ack"===r.type||"handshake/ack"===r.type)&&(r.data={id:r.connectionId}),r})(t.message);n.forEach(e=>{e.postMessage(i,{targetOrigin:r})})},E=()=>({listen:(0,g.createListenLogic)(w),requestMachine:(0,g.createRequestMachine)().provide({actions:{"send message":b}})});function k(){return window.self!==window.top}function _(){return!!window.opener}e.s(["createCompatibilityActors",0,E,"isMaybePreviewIframe",0,k,"isMaybePreviewWindow",0,_],864676);var j=e.i(980074),C=e.i(904684),S=e.i(980396);let M={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function I(e){return e||t?{lang:e?.lang??t?.lang,message:e?.message,abortEarly:e?.abortEarly??t?.abortEarly,abortPipeEarly:e?.abortPipeEarly??t?.abortPipeEarly}:M}function T(e,t,o,s,a){var l,u,c,d;let p,f=a&&"input"in a?a.input:o.value,h=a?.expected??e.expects??null,m=a?.received??("string"==(p=typeof f)?`"${f}"`:"number"===p||"bigint"===p||"boolean"===p?`${f}`:"object"===p||"function"===p?(f&&Object.getPrototypeOf(f)?.constructor?.name)??"null":p),y={kind:e.kind,type:e.type,input:f,expected:h,received:m,message:`Invalid ${t}: ${h?`Expected ${h} but r`:"R"}eceived ${m}`,requirement:e.requirement,path:a?.path,issues:a?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},g="schema"===e.kind,v=a?.message??e.message??(l=e.reference,u=y.lang,i?.get(l)?.get(u))??(g?(c=y.lang,r?.get(c)):null)??s.message??(d=y.lang,n?.get(d));void 0!==v&&(y.message="function"==typeof v?v(y):v),g&&(o.typed=!1),o.issues?o.issues.push(y):o.issues=[y]}let L=new WeakMap;function A(e){let t=L.get(e);return t||(t={version:1,vendor:"valibot",validate:t=>e["~run"]({value:t},I())},L.set(e,t)),t}var R=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};function $(e,t){return{kind:"validation",type:"min_length",reference:$,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length<this.requirement&&T(this,"length",e,t,{received:`${e.value.length}`}),e}}}
1let N={abortEarly:!0};function P(e,t,n){return"function"==typeof e.fallback?e.fallback(t,n):e.fallback}function O(e,t,n){return"function"==typeof e.default?e.default(t,n):e.default}function V(e,t){return{kind:"schema",type:"object",reference:V,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return A(this)},"~run"(e,t){let n=e.value;if(n&&"object"==typeof n)for(let r in e.typed=!0,e.value={},this.entries){let i=this.entries[r];if(r in n||("exact_optional"===i.type||"optional"===i.type||"nullish"===i.type)&&void 0!==i.default){let o=r in n?n[r]:O(i),s=i["~run"]({value:o},t);if(s.issues){let i={type:"object",origin:"value",input:n,key:r,value:o};for(let t of s.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[r]=s.value}else if(void 0!==i.fallback)e.value[r]=P(i);else if("exact_optional"!==i.type&&"optional"!==i.type&&"nullish"!==i.type&&(T(this,"key",e,t,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]}),t.abortEarly))break}else T(this,"type",e,t);return e}}}function D(e,t){return{kind:"schema",type:"optional",reference:D,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return A(this)},"~run"(e,t){return void 0===e.value&&(void 0!==this.default&&(e.value=O(this,e,t)),void 0===e.value)?(e.typed=!0,e):this.wrapped["~run"](e,t)}}}function H(e){return{kind:"schema",type:"string",reference:H,expects:"string",async:!1,message:e,get"~standard"(){return A(this)},"~run"(e,t){return"string"==typeof e.value?e.typed=!0:T(this,"type",e,t),e}}}function B(...e){return{...e[0],pipe:e,get"~standard"(){return A(this)},"~run"(t,n){for(let r of e)if("metadata"!==r.kind){if(t.issues&&("schema"===r.kind||"transformation"===r.kind)){t.typed=!1;break}t.issues&&(n.abortEarly||n.abortPipeEarly)||(t=r["~run"](t,n))}return t}}}function U(e,t,n){let r=e["~run"]({value:t},I(n));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}let W=B(H(),$(1)),z=D(W),F=V({baseUrl:W,dataset:z,id:W,path:W,projectId:z,tool:z,type:z,workspace:z,perspective:{...u=H(),fallback:"drafts",get"~standard"(){return A(this)},"~run"(e,t){let n=u["~run"](e,t);return n.issues?{typed:!0,value:P(this,n,t)}:n}}});function q(e){return!F["~run"]({value:e},N).issues}function G(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}let Z=/^([\w-]+):(0|[1-9][0-9]*)$/,Y=/^([\w-]+):([0-9]+),([0-9]+)$/,K=/^([\w-]+):([\w-]+)$/,J=B(H(),$(1)),X=V({origin:J,href:J,data:D(function e(t,n,r){return{kind:"schema",type:"record",reference:e,expects:"Object",async:!1,key:t,value:n,message:r,get"~standard"(){return A(this)},"~run"(e,t){let n=e.value;if(n&&"object"==typeof n){for(let r in e.typed=!0,e.value={},n)if(Object.prototype.hasOwnProperty.call(n,r)&&"__proto__"!==r&&"prototype"!==r&&"constructor"!==r){let i=n[r],o=this.key["~run"]({value:r},t);if(o.issues){let s={type:"object",origin:"key",input:n,key:r,value:i};for(let t of o.issues)t.path=[s],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}let s=this.value["~run"]({value:i},t);if(s.issues){let o={type:"object",origin:"value",input:n,key:r,value:i};for(let t of s.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}o.typed&&s.typed||(e.typed=!1),o.typed&&(e.value[o.value]=s.value)}}else T(this,"type",e,t);return e}}}(H(),function e(){return{kind:"schema",type:"unknown",reference:e,expects:"unknown",async:!1,get"~standard"(){return A(this)},"~run":e=>(e.typed=!0,e)}}()))});function Q(e){let t=U(F,e);if(t.success)return t.output;let n=U(X,e);if(n.success)try{let e=new URL(n.output.href,typeof document>"u"?"https://example.com":location.origin);return e.searchParams.size>0?function(e,t){let n=e["~run"]({value:t},I(void 0));if(n.issues)throw new R(n.issues);return n.value}
1(F,Object.fromEntries(e.searchParams.entries())):n.output}catch(e){return console.error("Failed to parse sanity node",e),n.output}}function ee(e){if("object"==typeof e&&null!==e)return Q(e);try{let t=JSON.parse(e);return Q(t)}catch{let t=e.split(";").reduce((e,t)=>{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=S.studioPath.toString(function(e){let t=[];for(let n of e.split(".")){let e=Z.exec(n);if(e){t.push(e[1],Number(e[2]));continue}let r=Y.exec(n);if(r){t.push(r[1],[Number(r[2]),Number(r[3])]);continue}let i=K.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"perspective":e.perspective=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(q(t))return t;return}}e.s(["createDataAttribute",0,function e(t){function n(e){return e?"string"==typeof e?S.studioPath.fromString(e):e:[]}function r(e){if(!e.id)throw Error("`id` is required to create a data attribute");if(!e.type)throw Error("`type` is required to create a data attribute");if(!e.path||!e.path.length)throw Error("`path` is required to create a data attribute");return function(e){let{id:t,path:n,baseUrl:r,tool:i,workspace:o,type:s}=e;return q(e)?[["id",(0,S.getPublishedId)(t)],["type",s],["path",G(S.studioPath.fromString(n))],["base",encodeURIComponent(r)],["workspace",o],["tool",i]].filter(([,e])=>!!e).map(e=>e.join("=")).join(";"):void 0}({baseUrl:e.baseUrl||"/",workspace:e.workspace,tool:e.tool,type:e.type,id:e.id,path:"string"==typeof e.path?e.path:S.studioPath.toString(e.path),perspective:e.perspective})}let i=e=>r({...t,path:[...n(t.path),...n(e)]});return i.toString=function(){return r(t)},i.combine=function(n){return e({...t,...n})},i.scope=function(r){return e({...t,path:[...n(t.path),...n(r)]})},i},"decodeSanityNodeData",0,ee,"pathToUrlString",0,G],535438);var et=e.i(623606);let en=[];for(let e=0;e<256;++e)en.push((e+256).toString(16).slice(1));let er=new Uint8Array(16);var ei="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function eo(e,t,n){return ei&&!e?ei():function(e){let t=(e=e||{}).random??e.rng?.()??function(){if(!o){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");o=crypto.getRandomValues.bind(crypto)}return o(er)}();if(t.length<16)throw Error("Random bytes length must be >= 16");return t[6]=15&t[6]|64,t[8]=63&t[8]|128,function(e,t=0){return(en[e[t+0]]+e
1n[e[t+1]]+en[e[t+2]]+en[e[t+3]]+"-"+en[e[t+4]]+en[e[t+5]]+"-"+en[e[t+6]]+en[e[t+7]]+"-"+en[e[t+8]]+en[e[t+9]]+"-"+en[e[t+10]]+en[e[t+11]]+en[e[t+12]]+en[e[t+13]]+en[e[t+14]]+en[e[t+15]]).toLowerCase()}(t)}(e)}function es(e){let t=e.getBoundingClientRect();return{x:t.x+scrollX,y:t.y+scrollY,w:t.width,h:t.height}}function ea(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 el(e,t){return e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h}function eu(e,t){let n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function ec(e,t,n){let r,i,o={x:e.x1,y:e.y1};if(t.some(e=>{var t;let r,i;return t=ea(e,Math.min(e.w,e.h)/10,"horizontal"===n?"x":"y"),r=o.x>=t.x&&o.x<=t.x+t.w,i=o.y>=t.y&&o.y<=t.y+t.h,r&&i}))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,p=((i-n)*(r-a)-(o-r)*(n-s))/c;return!(d<0)&&!(d>1)&&!(p<0)&&!(p>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)=>eu(t,{x:e.x1,y:e.y1})-eu(n,{x:e.x1,y:e.y1}))}(e,ea(s,Math.min(s.w,s.h)/10,"horizontal"===n?"x":"y"));if(t){let e=t[0];r?eu(o,e)<eu(o,r)&&(r=e,i=s):(r=e,i=s)}}return i||null}function ed(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 ep(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 ef(e,t){return t.find(t=>el(es(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:ef(t.left,e)}:null,right:t.right?{rect:t.right,sanity:ef(t.right,e)}:null}:{top:t.top?{rect:t.top,sanity:ef(t.top,e)}:null,bottom:t.bottom?{rect:t.bottom,sanity:ef(t.bottom,e)}:null}}function em(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=es(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=ed(es(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 eg(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 ev(e){let t,n,r=(t=Math.max(0,Math.min(...e.map(e=>e.x))),{min:t,max:n=Math.min(document.body.offsetWidth,Math.max(...e.map(e=>e.x+e.w))),width:n-t}),i=ep(e),o=r.min>8&&r.min+r.width<=window.innerWidth-8,s=i.min>8&&i.min+i.height<=document.body.scrollHeight-8,a=o&&s;return{x:a?r.min-8:r.min,y:a?i.min-8:i.min,w:a?r.width+16:r.width,h:a?i.height+16:i.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 ew=!1,eb={y:0},eE={x:0,y:0},ek=typeof document>"u"?0:document.documentElement.scrollHeight,e_=null,ej=e=>e instanceof HTMLElement||e instanceof SVGElement,eC=e=>e&&ej(e)?e.dataset?.sanityOverlayElement?e:eC(e.parentElement):null;function eS(e){return et.VERCEL_STEGA_REGEX.lastIndex=0,et.VERCEL_STEGA_REGEX.test(e)}function eM(e){return et.VERCEL_STEGA_REGEX.lastIndex=0,e.replace(et.VERCEL_STEGA_REGEX,"")}function eI(e,t=!1){return eS(e)?function(e,t=!1){try{let n=(0,et.vercelStegaDecode)(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}function eT(e){return"path"in e}function eL(e){if(!e.length||!e.map(e=>eT(e)).every((e,t,n)=>e===n[0]))return;if(!eT(e[0]))return e[0];let t=e.filter(eT),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={...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
1)=>t===r[n]?[...e,t]:[],[]).reverse().join(".")}(n.path,i.path)}}return n}function eA(e){let t=e.lastIndexOf(".");return e.substring(t,e.length).includes("[")}function eR(e){if(!eA(e))return null;let t=e.split(".");return t[t.length-1]=t[t.length-1].replace(/\[.*?\]/g,"[]"),t.join(".")}function e$(e,t){return!!eA(e.path)&&!!eA(t.path)&&eR(e.path)===eR(t.path)}function eN(e,t,n,r){if(!e.getAttribute("data-sanity")||e.getAttribute("data-sanity-drag-disable")||!t||!eT(t)||!eA(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?.sanity&&!s&&eT(o.sanity)&&e$(t,o.sanity)&&(null===i||i===a)&&l&&e.push(o),e},[]);return o.length<=1?null:o}let eP=(0,j.createContext)(null);var eO=e.i(276204),eO=eO,eV=eO,eD=e.i(507196),eH=e.i(978262),eB=e.i(800368),eU=e.i(549295),eW=e.i(222346),ez=e.i(273279),eF=e.i(221322),eq=e.i(466031),eG=e.i(287918),eZ=e.i(4251),eY=eO,eK=eO,eJ=eO,eX=eO,eQ=eO,e1=e.i(31499),e0=eO,e5=eO,e2=eO,e3=e.i(809434),e4=e.i(878524);function e6(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):e8.test(t=e)?Number(t):t})}let e8=/^-?\d+$/;function e7(e){return"string"==typeof e?._key}function e9(e){return"object"==typeof e&&"_key"in e&&"string"==typeof e._key}function te(e){return"number"==typeof e||e9(e)}let tt=/^[a-z_$]+/;function tn(e){return e.map((e,t)=>{var n;return n=0===t,Array.isArray(e)?`[${e[0]}:${e[1]||""}]`:"number"==typeof e?`[${e}]`:e9(e)?`[_key==${JSON.stringify(e._key)}]`:"string"==typeof e&&tt.test(e)?n?e:`.${e}`:`['${e}']`}).join("")}function tr(e){return Array.isArray(e)?e:[e]}function ti(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,a;return{type:"patch",id:e.patch.id,patches:[..."set"in(n=t=e.patch)?Object.keys(n.set).map(e=>({path:e6(e),op:{type:"set",value:n.set[e]}})):[],..."setIfMissing"in(r=t)?Object.keys(r.setIfMissing).map(e=>({path:e6(e),op:{type:"setIfMissing",value:r.setIfMissing[e]}})):[],..."unset"in(i=t)?i.unset.map(e=>({path:e6(e),op:{type:"unset"}})):[],..."inc"in(o=t)?Object.keys(o.inc).map(e=>({path:e6(e),op:{type:"inc",amount:o.inc[e]}})):[],..."inc"in(s=t)?Object.keys(s.dec).map(e=>({path:e6(e),op:{type:"dec",amount:s.dec[e]}})):[],...function(e){if(!("insert"in e))return[];let t=function(e){let t=to.filter(t=>t in e);if(t.length>1)throw Error(`Insert patch is ambiguous. Should only contain one of: ${to.join(", ")}, instead found ${t.join(", ")}`);return t[0]}(e.insert);if(!t)throw Error("Insert patch missing position");let n=e6(e.insert[t]),r=n.pop();return[{path:n,op:{type:"insert",position:t,referenceItem:r,items:e.insert.items}}]}(t),..."diffMatchPatch"in(a=t)?Object.keys(a.diffMatchPatch).map(e=>({path:e6(e),op:{type:"diffMatchPatch",value:a.diffMatchPatch[e]}})):[]]}}throw Error(`Unknown mutation: ${JSON.stringify(e)}`)}let to=["before","replace","after"];function ts(e){return tu(e)}function ta(e){return e.flatMap(ts)}function tl(e){return{transactionId:e.id,mutations:ta(e.mutations)}}function tu(e){switch(e.type){case"create":case"createIfNotExists":case"createOrReplace":return{[e.type]:e.document};case"delete":return{delete:{id:e.id}};case"patch":{let t=e.options?.ifRevision;return e.patches.map(n=>({patch:{id:e.id,...t&&{ifRevisionID:t},...tc(n)}}))}}}function tc(e){let{path:t,op:n}=e;if("unset"===n.type)return{unset:[tn(t)]};if("insert"===n.type)return{insert:{[n.position]:tn([...t,n.referenceItem]),items:n.items}};if("diffMatchPatch"===n.type)return{diffMatchPatch:{[tn(t)]:n.value}};if("inc"===n.type)return{inc:{[tn(t)]:n.amount}};if("dec"===n.type)return{dec:{[tn(t)]:n.amount}};if("set"===n.type||"setIfMissing"===n.type)return{[n.type]:{[tn(t)]:n.value}};if("truncate"===n.type){let e=[n.startIndex,"number"==typeof n.endIndex?n.endIndex:""].join(":");return{unset:[`${tn(t)}[${e}]`]}}if("upsert"===n.type)return{unset:n.items.map(e=>
1tn([...t,{_key:e._key}])),insert:{[n.position]:tn([...t,n.referenceItem]),items:n.items}};if("assign"===n.type)return{set:Object.fromEntries(Object.keys(n.value).map(e=>[tn(t.concat(e)),n.value[e]]))};if("unassign"===n.type)return{unset:n.keys.map(e=>tn(t.concat(e)))};if("replace"===n.type)return{insert:{replace:tn(t.concat(n.referenceItem)),items:n.items}};if("remove"===n.type)return{unset:[tn(t.concat(n.referenceItem))]};throw"insertIfMissing"===n.type?Error("Patch type insertIfMissing is not supported by Sanity"):Error(`Unknown operation type ${n.type}`)}function td(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function tp(e,t){return{path:"string"==typeof e?e6(e):e,op:t}}function tf(e,t,n){return{type:"insert",referenceItem:n,position:t,items:tr(e)}}function th(e,t){return{type:"truncate",startIndex:e,endIndex:t}}function tm(e){return{type:"remove",referenceItem:e}}var ty=Object.freeze({__proto__:null,decode:function(e){return ti(e)},decodeAll:function(e){return e.map(ti)},encode:ts,encodeAll:ta,encodeMutation:tu,encodePatch:tc,encodeTransaction:tl});class tg{constructor(e){this._process=e,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(e){let t={value:e,next:null};if(this._current){this._last.next=t,this._last=t;return}this._current=t,this._last=t,this._active&&this.flush()}flush(){for(;this._current;){let e=this._current;this._process(e.value),this._current=e.next}this._last=null}}let tv="xstate.init",tx="xstate.stop";function tw(e,t){return{type:`xstate.done.state.${e}`,output:t}}function tb(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function tE(e){return{type:tv,input:e}}function tk(e){setTimeout(()=>{throw e})}let t_="function"==typeof Symbol&&Symbol.observable||"@@observable";function tj(e){if(tT(e))return e;let t=[],n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r]}return t.push(n),t}function tC(e){var t;return(t=e)&&"object"==typeof t&&"machine"in t&&"value"in t?e.value:"string"!=typeof e?e:function(e){if(1===e.length)return e[0];let t={},n=t;for(let t=0;t<e.length-1;t++)if(t===e.length-2)n[e[t]]=e[t+1];else{let r=n;n={},r[e[t]]=n}return t}(tj(e))}function tS(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let o=r[i];n[o]=t(e[o],o,e,i)}return n}function tM(e){var t;return void 0===e?[]:tT(t=e)?t:[t]}function tI(e,t,n,r){return"function"==typeof e?e({context:t,event:n,self:r}):e}function tT(e){return Array.isArray(e)}function tL(e){var t;return(tT(t=e)?t:[t]).map(e=>void 0===e||"string"==typeof e?{target:e}:e)}function tA(e){if(void 0!==e&&""!==e)return tM(e)}function tR(e,t,n){let r="object"==typeof e,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}function t$(e,t){let n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];let[,r,i]=n,o=e.getStateNodeById(i).config.invoke;return(Array.isArray(o)?o[r]:o).src}function tN(e,t){if(t===e||"*"===t)return!0;if(!t.endsWith(".*"))return!1;let n=t.split("."),r=e.split(".");for(let e=0;e<n.length;e++){let t=n[e],i=r[e];if("*"===t)return e===n.length-1;if(t!==i)return!1}return!0}function tP(e,t){return`${e.sessionId}.${t}`}let tO=0,tV=!1,tD=((c={})[c.NotStarted=0]="NotStarted",c[c.Running=1]="Running",c[c.Stopped=2]="Stopped",c),tH={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class tB{constructor(e,t){this.logic=e,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new tg(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=tD.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const n={...tH,...t},{clock:r,logger:i,parent:o,syncSnapshot:s,id:a,systemId:l,inspect:u}=n;this.system=o?o.system:function(e,t){let n=new Map,r=new Map,i=new WeakMap,o=new Set,s={},{clock:a,logger:l}=t,u={schedule:(e,t,n,r,i=Math.random().toString(36).slice(2))=>{let o={source:e,target:t,event:n,delay:r,id:i,startedAt:Date.now()},l=tP(e,i);c._snapshot._scheduledEvents[l]=o;let u=a.setTimeout(()=>{delete s[l],delete c._snapshot._scheduledEvents[l],c._relay(e,t,n)},r);s[l]=u},cancel:(e,t)=>
1{let n=tP(e,t),r=s[n];delete s[n],delete c._snapshot._scheduledEvents[n],void 0!==r&&a.clearTimeout(r)},cancelAll:e=>{for(let t in c._snapshot._scheduledEvents){let n=c._snapshot._scheduledEvents[t];n.source===e&&u.cancel(e,n.id)}}},c={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${tO++}`,_register:(e,t)=>(n.set(e,t),e),_unregister:e=>{n.delete(e.sessionId);let t=i.get(e);void 0!==t&&(r.delete(t),i.delete(e))},get:e=>r.get(e),getAll:()=>Object.fromEntries(r.entries()),_set:(e,t)=>{let n=r.get(e);if(n&&n!==t)throw Error(`Actor with system ID '${e}' already exists.`);r.set(e,t),i.set(t,e)},inspect:e=>{let t=tR(e);return o.add(t),{unsubscribe(){o.delete(t)}}},_sendInspectionEvent:t=>{if(!o.size)return;let n={...t,rootId:e.sessionId};o.forEach(e=>e.next?.(n))},_relay:(e,t,n)=>{c._sendInspectionEvent({type:"@xstate.event",sourceRef:e,actorRef:t,event:n}),t._send(n)},scheduler:u,getSnapshot:()=>({_scheduledEvents:{...c._snapshot._scheduledEvents}}),start:()=>{let e=c._snapshot._scheduledEvents;for(let t in c._snapshot._scheduledEvents={},e){let{source:n,target:r,event:i,delay:o,id:s}=e[t];u.schedule(n,r,i,o,s)}},_clock:a,_logger:l};return c}(this,{clock:r,logger:i}),u&&!o&&this.system.inspect(tR(u)),this.sessionId=this.system._bookId(),this.id=a??this.sessionId,this.logger=t?.logger??this.system._logger,this.clock=t?.clock??this.system._clock,this._parent=o,this._syncSnapshot=s,this.options=n,this.src=n.src??e,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:e=>{this._deferred.push(e)},system:this.system,stopChild:e=>{if(e._parent!==this)throw Error(`Cannot stop child actor ${e.id} of ${this.id} because it is not a child`);e._stop()},emit:e=>{let t=this.eventListeners.get(e.type),n=this.eventListeners.get("*");if(t||n)for(let r of[...t?t.values():[],...n?n.values():[]])try{r(e)}catch(e){tk(e)}},actionExecutor:e=>{let t=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:e.type,params:e.params}}),!e.exec)return;let t=tV;try{tV=!0,e.exec(e.info,e.params)}finally{tV=t}};this._processingStatus===tD.Running?t():this._deferred.push(t)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),l&&(this.systemId=l,this.system._set(l,this)),this._initState(t?.snapshot??t?.state),l&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(e){try{this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(e){this._snapshot={status:"error",output:void 0,error:e}}}update(e,t){let n;for(this._snapshot=e;n=this._deferred.shift();)try{n()}catch(t){this._deferred.length=0,this._snapshot={...e,status:"error",error:t}}switch(this._snapshot.status){case"active":for(let t of this.observers)try{t.next?.(e)}catch(e){tk(e)}break;case"done":var r;for(let t of this.observers)try{t.next?.(e)}catch(e){tk(e)}this._stopProcedure(),this._complete(),this._doneEvent=(r=this.id,{type:`xstate.done.actor.${r}`,output:this._snapshot.output,actorId:r}),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error)}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:t,snapshot:e})}subscribe(e,t,n){let r=tR(e,t,n);if(this._processingStatus!==tD.Stopped)this.observers.add(r);else switch(this._snapshot.status){case"done":try{r.complete?.()}catch(e){tk(e)}break;case"error":{let e=this._snapshot.error;if(r.error)try{r.error(e)}catch(e){tk(e)}else tk(e)}}return{unsubscribe:()=>{this.observers.delete(r)}}}on(e,t){let n=this.eventListeners.get(e);n||(n=new Set,this.eventListeners.set(e,n));let r=t.bind(void 0);return n.add(r),{unsubscribe:()=>{n.delete(r)}}}select(e,t=Object.is){return{subscribe:n=>{let r=tR(n),i=e(this.getSnapshot());return this.subscribe(n=>{let o=e(n);t(i,o)||(i=o,r.next?.(o))})},get:()=>e(this.getSnapshot())}}start(){if(this._processingStatus===tD.Running)return this;this._syncSnapshot&&this.subscribe({next:e=>{"active"===e.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:e})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=tD.Running;let e=tE(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:e}),this._snapshot.status){case"done":return this.update(this._snapshot,e),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(e){return this._snapshot={...this._snapshot,status:"error",error:e},this._error(e),this}return this.update(this._snapshot,e),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(e){let t,n;try{t=this.logic.transition(this._snapshot,e,this._actorScope)}catch(e){n={err:e}}if(n){let{err:e}=n;this._snapshot={...this._snapshot,status:"error",error:e},this._error(e);return}this.update(t,e),e.type===tx&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===tD.Stopped||((this.mailbox.clear(),this._processingStatus===tD.NotStarted)?this._processingStatus=tD.Stopped:this.mailbox.enqueue({type:tx})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let e of this.observers)try{e.complete?.()}catch(e){tk(e)}this.observers.clear(),this.eventListeners.clear()}_reportError(e){if(!this.observers.size){this._parent||tk(e),this.eventListeners.clear();return}let t=!1;for(let n of this.observers){let r=n.error;t||=!r;try{r?.(e)}catch(e){tk(e)}}this.observers.clear(),this.eventListeners.clear(),t&&tk(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,tb(this.id,e))}_stopProcedure(){return this._processingStatus!==tD.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new tg(this._process.bind(this)),this._processingStatus=tD.Stopped,this.system._unregister(this)),this}_send(e){this._processingStatus!==tD.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){let{devTools:t}=this.options;t&&("function"==typeof t?t:t=>{if("u"<typeof window)return;let n=function(){let t="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:e.g;if(t.__xstate__)return t.__xstate__}();n&&n.register(t)})(this)}toJSON(){return{xstate$$type:1,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[t_](){return this}getSnapshot(){return this._snapshot}}function tU(e,...[t]){return new tB(e,t)}function tW(e,t,n,r,{sendId:i}){return[t,{sendId:"function"==typeof i?i(n,r):i},void 0]}function tz(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function tF(e){function t(e,t){}return t.type="xstate.cancel",t.sendId=e,t.resolve=tW,t.execute=tz,t}function tq(e,t,n,r,{id:i,systemId:o,src:s,input:a,syncSnapshot:l}){let u,c,d="string"==typeof s?t$(t.machine,s):s,p="function"==typeof i?i(n):i;return d&&(c="function"==typeof a?a({context:t.context,event:n.event,self:e.self}):a,u=tU(d,{id:p,src:s,parent:e.self,syncSnapshot:l,systemId:o,input:c})),[n_(t,{children:{...t.children,[p]:u}}),{id:i,systemId:o,actorRef:u,src:s,input:c},void 0]}function tG(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==tD.Stopped&&t.start()})}function tZ(...[e,{id:t,systemId:n,input:r,syncSnapshot:i=!1}={}]){function o(e,t){}return o.type="xstate.spawnChild",o.id=t,o.systemId=n,o.src=e,o.input=r,o.syncSnapshot=i,o.resolve=tq,o.execute=tG,o}function tY(e,t,n,r,{actorRef:i}){let o="function"==typeof i?i(n,r):i,s="string"==typeof o?t.children[o]:o,a=t.children;return s&&(a={...a},delete a[s.id]),[n_(t,{children:a}),s,void 0]}function tK(e,t){if(t){if(!function e(t,n){let r=n.getSnapshot();if(r&&"children"in r)for(let n of Object.values(r.children))e(t,n);t.system._unregister(n)}(e,t),t._processingStatus!==tD.Running)return void e.stopChild(t);e.defer(()=>{e.stopChild(t)})}}function tJ(e){function t(e,t){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=tY,t.execute=tK,t}function tX(e,{context:t,event:n},{guards:r}){return r.every(r=>tQ(r,t,n,e))}function tQ(e,t,n,r){let{machine:i}=r,o="function"==typeof e,s=o?e:i.implementations.guards["string"==typeof e?e:e.type];if(!o&&!s)throw Error(`Guard '${"string"==typeof e?e:e.type}' is not implemented.'.`);if("function"!=typeof s)return tQ(s,t,n,r);let a={context:t,event:n},l=o||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:t,event:n}):e.params:void 0;return"check"in s?s.check(r,a,s):s(a,l)}function t1(e){return"atomic"===e.type||"final"===e.type}function t0(e){return Object.values(e.states).filter(e=>"history"!==e.type)}function t5(e,t){let n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function t2(e){let t=new Set(e),n=t3(t);for(let e of t)if("compound"!==e.type||n.get(e)&&n.get(e).length){if("parallel"===e.type){for(let n of t0(e))if("history"!==n.type&&!t.has(n))for(let e of nt(n))t.add(e)}}
1else nt(e).forEach(e=>t.add(e));for(let e of t){let n=e.parent;for(;n;)t.add(n),n=n.parent}return t}function t3(e){let t=new Map;for(let n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function t4(e,t){return function e(t,n){let r=n.get(t);if(!r)return{};if("compound"===t.type){let e=r[0];if(!e)return{};if(t1(e))return e.key}let i={};for(let t of r)i[t.key]=e(t,n);return i}(e,t3(t2(t)))}function t6(e,t){return"compound"===t.type?t0(t).some(t=>"final"===t.type&&e.has(t)):"parallel"===t.type?t0(t).every(t=>t6(e,t)):"final"===t.type}let t8=e=>"#"===e[0];function t7(e,t,n){let r=tA(n.target),i=n.reenter??!1,o=function(e,t){if(void 0!==t)return t.map(t=>{if("string"!=typeof t)return t;if(t8(t))return e.machine.getStateNodeById(t);let n="."===t[0];if(n&&!e.parent)return ni(e,t.slice(1));let r=n?e.key+t:t;if(e.parent)try{return ni(e.parent,r)}catch(t){throw Error(`Invalid transition definition for state node '${e.id}': 2${t.message}`)}throw Error(`Invalid target: "${t}" is not a valid target from the root node. Did you mean ".${t}"?`)})}(e,r),s={...n,actions:tM(n.actions),guard:n.guard,target:o,source:e,reenter
2:i,eventType:t,toJSON:()=>({...s,source:`#${e.id}`,target:o?o.map(e=>`#${e.id}`):void 0})};return s}function t9(e){let t=tA(e.config.target);return t?{target:t.map(t=>"string"==typeof t?ni(e.parent,t):t)}:"parallel"===e.parent.type?{target:[e.parent]}:e.parent.initial}function ne(e){return"history"===e.type}function nt(e){let t=nn(e);for(let n of t)for(let r of t5(n,e))t.add(r);return t}function nn(e){let t=new Set;return!function e(n){if(!t.has(n)){if(t.add(n),"compound"===n.type)e(n.initial.target[0]);else if("parallel"===n.type)for(let t of t0(n))e(t)}}(e),t}function nr(e,t){if(t8(t))return e.machine.getStateNodeById(t);if(!e.states)throw Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let n=e.states[t];if(!n)throw Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function ni(e,t){if("string"==typeof t&&t8(t))try{return e.machine.getStateNodeById(t)}catch{}let n=tj(t).slice(),r=e;for(;n.length;){let e=n.shift();if(!e.length)break;r=nr(r,e)}return r}function no(e,t){if("string"==typeof t){let n=e.states[t];if(!n)throw Error(`State '${t}' does not exist on '${e.id}'`);return[e,n]}let n=Object.keys(t),r=n.map(t=>nr(e,t)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((n,r)=>{let i=nr(e,r);if(!i)return n;let o=no(i,t[r]);return n.concat(o)},[]))}function ns(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function na(e,t,n){let r=new Set;for(let i of e){let e=!1,o=new Set;for(let s of r)if(function(e,t){let n=new Set(e),r=new Set(t);for(let e of n)if(r.has(e))return!0;for(let e of r)if(n.has(e))return!0;return!1}(nc([i],t,n),nc([s],t,n)))if(ns(i.source,s.source))o.add(s);else{e=!0;break}if(!e){for(let e of o)r.delete(e);r.add(i)}}return Array.from(r)}function nl(e,t){if(!e.target)return[];let n=new Set;for(let r of e.target)if(ne(r))if(t[r.id])for(let e of t[r.id])n.add(e);else for(let e of nl(t9(r),t))n.add(e);else n.add(r);return[...n]}function nu(e,t){let n=nl(e,t);if(!n)return;if(!e.reenter&&n.every(t=>t===e.source||ns(t,e.source)))return e.source;let r=function(e){let[t,...n]=e;for(let e of t5(t,void 0))if(n.every(t=>ns(t,e)))return e}(n.concat(e.source));return r||(e.reenter?void 0:e.source.machine.root)}function nc(e,t,n){let r=new Set;for(let i of e)if(i.target?.length){let e=nu(i,n);for(let n of(i.reenter&&i.source===e&&r.add(e),t))ns(n,e)&&r.add(n)}return[...r]}function nd(e,t,n,r,i,o){let s=[];if(!e.length)return[t,s];let a=n.actionExecutor;n.actionExecutor=e=>{s.push(e),a(e)};try{let a=new Set(t._nodes),l=t.historyValue,u=na(e,a,l),c=t;i||([c,l]=function(e,t,n,r,i,o,s,a){let l,u=e,c=nc(r,i,o);for(let e of(c.sort((e,t)=>t.order-e.order),c))for(let t of function(e){return Object.keys(e.states).map(t=>e.states[t]).filter(e=>"history"===e.type)}(e)){let n;n="deep"===t.history?t=>t1(t)&&ns(t,e):t=>t.parent===e,(l??={...o})[t.id]=Array.from(i).filter(n)}for(let e of c)u=nh(u,t,n,[...e.exit,...e.invoke.map(e=>tJ(e.id))],s,void 0),i.delete(e);return[u,l||o]}(c,r,n,u,a,l,o,n.actionExecutor)),c=nh(c,r,n,u.flatMap(e=>e.actions),o,void 0),c=function(e,t,n,r,i,o,s,a){let l=e,u=new Set,c=new Set;(function(e,t,n,r){for(let i of e){let e=nu(i,t);for(let o of i.target||[])!ne(o)&&(i.source!==o||i.source!==e||i.reenter)&&(r.add(o),n.add(o)),np(o,t,n,r);for(let o of nl(i,t)){let s=t5(o,e);e?.type==="parallel"&&s.push(e),nf(r,t,n,s,!i.source.parent&&i.reenter?void 0:e)}}})(r,s,c,u),a&&c.add(e.machine.root);let d=new Set;for(let e of[...u].sort((e,t)=>e.order-t.order)){i.add(e);let r=[];for(let t of(r.push(...e.entry),e.invoke))r.push(tZ(t.src,{...t,syncSnapshot:!!t.onSnapshot}));if(c.has(e)){let t=e.initial.actions;r.push(...t)}if(l=nh(l,t,n,r,o,e.invoke.map(e=>e.id)),"final"===e.type){let r=e.parent,s=r?.type==="parallel"?r:r?.parent,a=s||e;for(r?.type==="compound"&&o.push(tw(r.id,void 0!==e.output?tI(e.output,l.context,t,n.self):void 0));s?.type==="parallel"&&!d.has(s)&&t6(i,s);)d.add(s),o.push(tw(s.id)),a=s,s=s.parent;if(s)continue;l=n_(l,{status:"done",output:function(e,t,n,r,i){if(void 0===r.output)return;let o=tw(i.id,void 0!==i.output&&i.parent?tI(i.output,e.context,t,n.self):void 0);return tI(r.output,e.context,o,n.self)}(l,t,n,l.machine.root,a)})}}return l}(c,r,n,u,a,o,l,i);let d=[...a];"done"===c.status&&(c=nh(c,r,n,d.sort((e,t)=>
2t.order-e.order).flatMap(e=>e.exit),o,void 0));try{if(l===t.historyValue&&function(e,t){if(e.length!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}(t._nodes,a))return[c,s];return[n_(c,{_nodes:d,historyValue:l}),s]}catch(e){throw e}}finally{n.actionExecutor=a}}function np(e,t,n,r){var i,o,s,a;if(ne(e))if(t[e.id]){let s=t[e.id];for(let e of s)r.add(e),np(e,t,n,r);for(let a of s){i=a,o=e.parent,nf(r,t,n,t5(i,o))}}else{let i=t9(e);for(let o of i.target)r.add(o),i===e.parent?.initial&&n.add(e.parent),np(o,t,n,r);for(let o of i.target){s=o,a=e.parent,nf(r,t,n,t5(s,a))}}else if("compound"===e.type){let[i]=e.initial.target;ne(i)||(r.add(i),n.add(i)),np(i,t,n,r),nf(r,t,n,t5(i,e))}else if("parallel"===e.type)for(let i of t0(e).filter(e=>!ne(e)))[...r].some(e=>ns(e,i))||(ne(i)||(r.add(i),n.add(i)),np(i,t,n,r))}function nf(e,t,n,r,i){for(let o of r)if((!i||ns(o,i))&&e.add(o),"parallel"===o.type)for(let r of t0(o).filter(e=>!ne(e)))[...e].some(e=>ns(e,r))||(e.add(r),np(r,t,n,e))}function nh(e,t,n,r,i,o){let s=o?[]:void 0,a=function e(t,n,r,i,o,s){let{machine:a}=t,l=t;for(let t of i){var u;let i="function"==typeof t,c=i?t:(u="string"==typeof t?t:t.type,a.implementations.actions[u]),d={context:l.context,event:n,self:r.self,system:r.system},p=i||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:l.context,event:n}):t.params:void 0;if(!c||!("resolve"in c)){r.actionExecutor({type:"string"==typeof t?t:"object"==typeof t?t.type:t.name||"(anonymous)",info:d,params:p,exec:c}
2);continue}let[f,h,m]=c.resolve(r,l,d,p,c,o);l=f,"retryResolve"in c&&s?.push([c,h]),"execute"in c&&r.actionExecutor({type:c.type,info:d,params:h,exec:c.execute.bind(null,r,h)}),m&&(l=e(l,n,r,m,o,s))}return l}(e,t,n,r,{internalQueue:i,deferredActorIds:o},s);return s?.forEach(([e,t])=>{e.retryResolve(n,a,t)}),a}function nm(e,t,n,r){let i=e,o=[];function s(e,t,r){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:t,snapshot:e[0],_transitions:r}),o.push(e)}if(t.type===tx)return s([i=n_(ny(i,t,n),{status:"stopped"}),[]],t,[]),{snapshot:i,microsteps:o};let a=t;if(a.type!==tv){let t=a,l=t.type.startsWith("xstate.error.actor"),u=ng(t,i);if(l&&!u.length)return s([i=n_(e,{status:"error",error:t.error}),[]],t,[]),{snapshot:i,microsteps:o};let c=nd(u,e,n,a,!1,r);i=c[0],s(c,t,u)}let l=!0,u=e.machine.options?.maxIterations??1/0,c=0;for(;"active"===i.status;){if(++c>u)throw Error(`Infinite loop detected: the machine has processed more than ${u} microsteps without reaching a stable state. This usually happens when there's a cycle of transitions (e.g., eventless transitions or raised events causing state A -> B -> C -> A).`);let e=l?function(e,t){let n=new Set;for(let r of e._nodes.filter(t1))e:for(let i of[r].concat(t5(r,void 0)))if(i.always){for(let r of i.always)if(void 0===r.guard||tQ(r.guard,e.context,t,e)){n.add(r);break e}}return na(Array.from(n),new Set(e._nodes),e.historyValue)}(i,a):[],t=e.length?i:void 0;if(!e.length){if(!r.length)break;e=ng(a=r.shift(),i)}let o=nd(e,i,n,a,!1,r);l=(i=o[0])!==t,s(o,a,e)}return"active"!==i.status&&ny(i,a,n),{snapshot:i,microsteps:o}}function ny(e,t,n){return nh(e,t,n,Object.values(e.children).map(e=>tJ(e)),[],void 0)}function ng(e,t){return t.machine.getTransitionData(t,e)}let nv=function(e){return function e(t,n){let r=tC(t),i=tC(n);return"string"==typeof i?"string"==typeof r&&i===r:"string"==typeof r?r in i:Object.keys(r).every(t=>t in i&&e(r[t],i[t]))}(e,this.value)},nx=function(e){return this.tags.has(e)},nw=function(e){let t=this.machine.getTransitionData(this,e);return!!t?.length&&t.some(e=>void 0!==e.target||e.actions.length)},nb=function(){let{_nodes:e,tags:t,machine:n,getMeta:r,toJSON:i,can:o,hasTag:s,matches:a,...l}=this;return{...l,tags:Array.from(t)}},nE=function(){return this._nodes.reduce((e,t)=>(void 0!==t.meta&&(e[t.id]=t.meta),e),{})};function nk(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:t4(t.root,e._nodes),tags:new Set(e._nodes.flatMap(e=>e.tags)),children:e.children,historyValue:e.historyValue||{},matches:nv,hasTag:nx,can:nw,getMeta:nE,toJSON:nb}}function n_(e,t={}){return nk({...e,...t},e.machine)}function nj(e,t,n,r,{event:i,id:o,delay:s},{internalQueue:a}){let l,u=t.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);let c="function"==typeof i?i(n,r):i;if("string"==typeof s){let e=u&&u[s];l="function"==typeof e?e(n,r):e}else l="function"==typeof s?s(n,r):s;return"number"!=typeof l&&a.push(c),[t,{event:c,id:o,delay:l},void 0]}function nC(e,t){let{event:n,delay:r,id:i}=t;if("number"==typeof r)return void e.defer(()=>{let t=e.self;e.system.scheduler.schedule(t,t,n,r,i)})}function nS(e,t){function n(e,t){}return n.type="xstate.raise",n.event=e,n.id=t?.id,n.delay=t?.delay,n.resolve=nj,n.execute=nC,n}let nM="xstate.observable.error",nI="xstate.observable.complete",nT="xstate.promise.resolve",nL="xstate.promise.reject",nA=new WeakMap;function nR(e){return{config:e,transition:(e,t,n)=>{if("active"!==e.status)return e;switch(t.type){case nT:{let n=t.data;return{...e,status:"done",output:n,input:void 0}}case nL:return{...e,status:"error",error:t.data,input:void 0};case tx:return nA.get(n.self)?.abort(),nA.delete(n.self),{...e,status:"stopped",input:void 0};default:return e}},start:(t,{self:n,system:r,emit:i})=>{if("active"!==t.status)return;let o=new AbortController;nA.set(n,o),Promise.resolve(e({input:t.input,system:r,self:n,signal:o.signal,emit:i})).then(e=>{"active"===n.getSnapshot().status&&(nA.delete(n),r._relay(n,n,{type:nT,data:e}))},e=>
2{"active"===n.getSnapshot().status&&(nA.delete(n),r._relay(n,n,{type:nL,data:e}))})},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,input:t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}let n$=tU((p=void 0,{config:d=e=>void 0,transition:(e,t,n)=>({...e,context:d(e.context,t,n)}),getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof p?p({input:t}):p}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e})),nN=n$,nP=new Set;function nO(e){return e===n$}function nV(e){for(let t of(nN=e,nP))t()}e.s(["actor",()=>nN,"emptyActor",0,n$,"isEmptyActor",0,nO,"listeners",0,nP,"setActor",0,nV],252247);var nD=e.i(370170);let nH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nB=/_key\s*==\s*['"](.*)['"]/;function nU(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(nH);if(!t)throw Error("Invalid path string");return t.map(nW)}(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((0,nD.isIndexSegment)(t)){if(!Array.isArray(i))return n;i=i[t]}if((0,nD.isKeySegment)(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 nW(e){return(0,nD.isIndexSegment)(e)?Number(e.replace(/[^\d]/g,"")):(0,nD.isKeySegment)(e)?{_key:e.match(nB)[1]}:(0,nD.isIndexTuple)(e)?function(e){let[t,n]=e.split(":").map(e=>""===e?e:Number(e));return[t,n]}(e):e}function nz(){return(0,j.useSyncExternalStore)(nG,nq,nF)}function nF(){return n$}function nq(){return nN}function nG(e){return nP.add(e),()=>nP.delete(e)}function nZ(){let e,t=(0,y.c)(2),n=nz();return t[0]!==n?(e=nO(n),t[0]=n,t[1]=e):e=t[1],!e}function nY(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(e,r)},t)}}function nK(e,t){let n=k(),r=_();if(nO(t)||!n&&!r)throw Error("The `useDocuments` hook cannot be used in this context");let i=(0,S.getDraftId)(e),o=(0,S.getPublishedId)(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 nJ(){let e,t,n,r=(0,y.c)(7),i=nz();r[0]!==i?(e=e=>({id:e,commit:()=>{let{draftDoc:t}=nK(e,i);t.send({type:"submit"})},get:t=>{let{snapshot:n}=nK(e,i);return t?nU(n,t):n},getSnapshot:function(e,t){let{getSnapshot:n}=nK(e,t);return n}(e,i),patch:async(t,n)=>{let r=nK(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:tr(c),...{}}]}),u&&("object"==typeof u&&"debounce"in u?nY(()=>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}=nK(e,i),{commit:o}=n||{},s=void 0===o||o;r.send({type:"mutate",mutations:t}),s&&("object"==typeof s&&"debounce"in s?nY(()=>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}function nX(e){let t=(()=>{if(s)return s;s=[];for(let e=0;e<256;++e)s[e]=(e+256).toString(16).slice(1);return s})();return(function(e=16){let t=new Uint8Array(e);return crypto.getRandomValues(t),t})(e).reduce((e,n)=>e+t[n],"").slice(0,e)}function nQ(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}}function n1(e,t,n="after"){let{path:r,key:i}=nQ(e);return[tp(r,tf({...nU(t,e.path),_key:nX()},n,{_key:i}))]}function n0(e,t){let{path:n,key:r}=nQ(e),i=nU(t,n).findIndex(e=>e._key===r);return[tp(n,th(i,i+1))]}
2function n5(e,t,n){let{path:r,key:i}=nQ(e);return[tp(r,tf([{_type:t,_key:nX()}],n,{_key:i}))]}async function n2(e,t,n){if(!e.type)throw Error("Node type is missing");let{path:r,key:i}=nQ(e),o=await t.getSnapshot(),s=nU(o,r),a=nU(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[tp(r,th(l,l+1)),tp(r,tf(a,c,u))]}e.s(["get",0,nU,"getArrayDuplicatePatches",0,n1,"getArrayInsertPatches",0,n5,"getArrayItemKeyAndParentPath",0,nQ,"getArrayMovePatches",0,n2,"getArrayRemovePatches",0,n0,"useDocuments",0,nJ,"useOptimisticActor",0,nz,"useOptimisticActorReady",0,nZ],511568);var n3=eO,n4=eO,n6=eO,n8=eO,n7=e.i(547321),n9=eO;let re=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"search",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M15.0355 15.0355L20 20M16.5 11.5C16.5 14.2614 14.2614 16.5 11.5 16.5C8.73858 16.5 6.5 14.2614 6.5 11.5C6.5 8.73858 8.73858 6.5 11.5 6.5C14.2614 6.5 16.5 8.73858 16.5 11.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})}),rt=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"th-large",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M12.5 6.5V12.5M12.5 12.5V18.5M12.5 12.5H19.5M12.5 12.5H5.5M19.5 12.5V6.5H5.5V12.5M19.5 12.5V18.5H5.5V12.5",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})}),rn=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"ulist",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M7.10153 17.5C7.10153 17.8322 6.83221 18.1016 6.5 18.1016C6.16778 18.1016 5.89847 17.8322 5.89847 17.5C5.89847 17.1678 6.16778 16.8985 6.5 16.8985C6.83221 16.8985 7.10153 17.1678 7.10153 17.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M7.10153 7.49997C7.10153 7.83218 6.83221 8.1015 6.5 8.1015C6.16778 8.1015 5.89847 7.83218 5.89847 7.49997C5.89847 7.16775 6.16778 6.89844 6.5 6.89844C6.83221 6.89844 7.10153 7.16775 7.10153 7.49997Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M7.10153 12.5C7.10153 12.8322 6.83221 13.1015 6.5 13.1015C6.16778 13.1015 5.89847 12.8322 5.89847 12.5C5.89847 12.1678 6.16778 11.8984 6.5 11.8984C6.83221 11.8984 7.10153 12.1678 7.10153 12.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M10 7.5H19M10 17.5H19M10 12.5H19",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})]})});var rr=e.i(938500),ri=e.i(533824);let ro=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"block-content",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 7.60002L11 7.60003V6.40003L21 6.40002V7.60002Z",fill:"currentColor"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 11.2667L12.4833 11.2667V10.0667L21 10.0667V11.2667Z",fill:"currentColor"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 14.9334H13.9254V13.7334L21 13.7334V14.9334Z",fill:"currentColor"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 18.6002H4V17.4002H21V18.6002Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M9.86438 15.6H11.2L8.27623 7.60003H6.92377L4 15.6H5.29072L6.0371 13.4767H9.12362L9.86438 15.6ZM7.53546 9.05255H7.63086L8.80374 12.4344H6.35698L7.53546 9.05255Z",fill:"currentColor"})]})}),rs=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"checkmark-circle",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M9.5 12.1316L11.7414 14.5L16 10M20.5 12.5C20.5 16.9183 16.9183 20.5 12.5 20.5C8.08172 20.5 4.5 16.9183 4.5 12.5C4.5 8.08172 8.08172 4.5 12.5 4.5C16.9183 4.5 20.5 8.08172 20.5 12.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})}),ra=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"cube",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M4.5 8L12.5 3L20.5 8V17L12.5 22L4.5 17V8Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M12.5 22V13M12.5 13L4.5 8M12.5 13L20.5 8",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})]})}),rl=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"image",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M5.5 15.5L8.79289 12.2071C9.18342 11.8166 9.81658 11.8166 10.2071 12.2071L12.8867 14.8867C13.2386 15.2386 13.7957 15.2782 14.1938 14.9796L15.1192 14.2856C15.3601 14.1049 15.6696 14.0424 15.9618 14.1154L19.5 15M5.5 6.5H19.5V18.5H5.5V6.5ZM15.5 10.5C15.5 11.0523 15.0523 11.5 14.5 11.5C13.9477 11.5 13.5 11.0523 13.5 10.5C13.5 9.94772 13.9477 9.5 14.5 9.5C15.0523 9.5 15.5 9.94772 15.5 10.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})}),ru=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"number",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.0165 17.6336H3.83636V16.4336H21.0165V17.6336Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M7.09808 13.3967V7.508H5.74066L3.83636 8.78241V10.091L5.65277 8.88495H5.74066V13.3967H3.84125V14.5539H8.89984V13.3967H7.09808Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M9.81781 9.63202V9.66132H11.1069V9.62714C11.1069 8.95331 11.5756 8.49432 12.2739 8.49432C12.9575 8.49432 13.4018 8.89471 13.4018 9.50507C13.4018 9.9787 13.1528 10.3498 12.1909 11.3117L9.89594 13.5822V14.5539H14.8618V13.3869H11.7807V13.299L13.1577 11.9855C14.3491 10.843 14.7543 10.1838 14.7543 9.41229C14.7543 8.19159 13.7729 7.36639 12.3178 7.36639C10.8383 7.36639 9.81781 8.28436 9.81781 9.63202Z",fill:"currentColor"}
2),(0,m.jsx)("path",{d:"M17.6694 11.4631H18.5092C19.3198 11.4631 19.8422 11.8683 19.8422 12.4982C19.8422 13.1183 19.3295 13.5139 18.5239 13.5139C17.767 13.5139 17.2592 13.133 17.2104 12.5324H15.9262C15.9897 13.8508 17.0248 14.6955 18.5629 14.6955C20.1401 14.6955 21.2192 13.841 21.2192 12.591C21.2192 11.6584 20.6528 11.0334 19.7006 10.9211V10.8332C20.4721 10.6769 20.9457 10.0666 20.9457 9.23651C20.9457 8.12323 19.9741 7.36639 18.5434 7.36639C17.0541 7.36639 16.1118 8.17694 16.0629 9.50018H17.2983C17.3422 8.88007 17.8061 8.48456 18.4995 8.48456C19.2075 8.48456 19.6567 8.85565 19.6567 9.44159C19.6567 10.0324 19.1977 10.4182 18.4946 10.4182H17.6694V11.4631Z",fill:"currentColor"})]})}),rc=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"string",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M11.6748 15.5227H13.1855L9.87842 6.36304H8.34863L5.0415 15.5227H6.50146L7.3457 13.0916H10.8369L11.6748 15.5227ZM9.04053 8.02612H9.14844L10.4751 11.8982H7.70752L9.04053 8.02612Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M16.8101 14.488C16.0674 14.488 15.5278 14.1262 15.5278 13.5042C15.5278 12.8948 15.9595 12.571 16.9116 12.5076L18.6001 12.3997V12.9773C18.6001 13.8342 17.8384 14.488 16.8101 14.488ZM16.4609 15.637C17.3687 15.637 18.124 15.2434 18.5366 14.5515H18.6445V15.5227H19.9585V10.8C19.9585 9.34009 18.981 8.47681 17.248 8.47681C15.6802 8.47681 14.563 9.23853 14.4233 10.4255H15.7437C15.896 9.93677 16.4229 9.65747 17.1846 9.65747C18.1177 9.65747 18.6001 10.0701 18.6001 10.8V11.3967L16.7275 11.5046C15.0835 11.6062 14.1567 12.3235 14.1567 13.5676C14.1567 14.8308 15.1279 15.637 16.4609 15.637Z",fill:"currentColor"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.9585 18.637L5.0415 18.637V17.437L19.9585 17.437V18.637Z",fill:"currentColor"})]})}),rd=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"th-list",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M9.5 6.5V10.5M9.5 10.5V14.5M9.5 10.5H19.5M9.5 10.5H5.5M9.5 14.5V18.5M9.5 14.5H19.5M9.5 14.5H5.5M5.5 6.5H19.5V18.5H5.5V6.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})}),rp=e=>{let t,n,r,i,o,s=(0,y.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,m.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};function rf(e){return{type:"log",name:e.name,version:e.version,description:e.description,maxSampleRate:e.maxSampleRate,schema:void 0}}let rh={"Visual Editing Drag Sequence Completed":rf({name:"Visual Editing Drag Sequence Completed",description:"An array is successfully reordered using drag and drop.",version:1}),"Visual Editing Drag Minimap Enabled":rf({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":rf({name:"Visual Editing Context Menu Item Removed",description:"An item is removed using the Context Menu.",version:1}),"Visual Editing Context Menu Item Duplicated":rf({name:"Visual Editing Context Menu Item Duplicated",description:"An item is duplicated using the Context Menu.",version:1}),"Visual Editing Context Menu Item Moved":rf({name:"Visual Editing Context Menu Item Moved",description:"An item is moved using the Context Menu.",version:1}),"Visual Editing Context Menu Item Inserted":rf({name:"Visual Editing Context Menu Item Inserted",description:"An item is inserted using the Context Menu.",version:1}),"Visual Editing Insert Menu Item Inserted":rf({name:"Visual Editing Insert Menu Item Inserted",description:"An item is inserted using the Insert Menu.",version:1}),"Visual Editing Overlay Clicked":rf({name:"Visual Editing Overlay Clicked",description:"An Overlay is clicked.",version:1})},rm=(0,j.createContext)(void 0);function ry(){let e=(0,j.useContext)(rm);
2if(!e)throw Error("Telemetry context is missing");return e}function rg(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 rv(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 rx="all-items",rw={gridTemplateColumns:"repeat(auto-fill, minmax(118px, 1fr))",alignItems:"start"};function rb(e){let t,n,r,i,o,s,a,l,u,c,d,p,f,h,g,v,x=(0,y.c)(54),w=void 0===e.showIcons||e.showIcons,b=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:rx,title:e.labels["insert-menu.filter.all-items"],selected:!0},...e.groups.map(r_)]:[],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(rk),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[E,k]=(0,j.useReducer)(rv,i);if(x[10]!==e||x[11]!==b||x[12]!==w||x[13]!==E.groups||x[14]!==E.query||x[15]!==E.views){var _,C,S;let t,n,r,i=(_=e.schemaTypes,C=E.query,S=E.groups,_.filter(e=>{var t,n;let r,i;return t=e,(!(r=S.find(e=>e.selected))||r.name===rx||r.of?.includes(t.name))&&(n=e,i=C.trim().toLowerCase(),n.title?n.title?.toLowerCase().includes(i):n.name.includes(i))})),h=E.views.find(rE),y=b||E.views.length>1,g=E.groups&&E.groups.length>0,v=y||g;a=eF.Menu,f=0,s=ez.Flex,c="column",d="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]!==b||x[29]!==y||x[30]!==E.query||x[31]!==E.views?(n=y?(0,m.jsxs)(ez.Flex,{flex:"none",align:"center",paddingTop:1,paddingX:1,gap:1,children:[b?(0,m.jsx)(eH.Box,{flex:1,children:(0,m.jsx)(n8.f,{autoFocus:!0,border:!1,fontSize:1,icon:re,onChange:e=>{k({type:"change query",query:e.target.value})},placeholder:e.labels["insert-menu.search.placeholder"],value:E.query})}):null,E.views.length>1?(0,m.jsx)(eH.Box,{flex:"none",children:(0,m.jsx)(rS,{views:E.views,onToggle:e=>{k({type:"toggle view",name:e})},labels:e.labels})}):null]}):null,x[27]=e.labels,x[28]=b,x[29]=y,x[30]=E.query,x[31]=E.views,x[32]=n):n=x[32],x[33]!==g||x[34]!==E.groups?(r=g?(0,m.jsx)(eH.Box,{paddingTop:1,paddingX:1,children:(0,m.jsx)(n3.t,{space:1,children:E.groups.map(e=>(0,m.jsx)(n4.n,{id:`${e.name}-tab`,"aria-controls":`${e.name}-panel`,label:e.title??(0,rr.startCase)(e.name),selected:e.selected,onClick:()=>{k({type:"select group",name:e.name})}},e.name))})}):null,x[33]=g,x[34]=E.groups,x[35]=r):r=x[35],x[36]!==t||x[37]!==n||x[38]!==r?(p=(0,m.jsxs)(eH.Box,{...t,children:[n,r]}),x[36]=t,x[37]=n,x[38]=r,x[39]=p):p=x[39],o=eH.Box,l=1,u=0===i.length?(0,m.jsx)(eH.Box,{padding:2,children:(0,m.jsx)(eB.Text,{muted:!0,size:1,children:e.labels["insert-menu.search.no-results"]})}):h?"grid"===h.name?(0,m.jsx)(n6.D,{autoRows:"auto",flex:1,gap:1,style:rw,children:i.map(t=>(0,m.jsx)(rI,{icon:w?rg(t):void 0,onClick:()=>{e.onSelect(t)},previewImageUrl:h.previewImageUrl?.(t.name),schemaType:t},t.name))}):(0,m.jsx)(eW.Stack,{flex:1,space:1,children:i.map(t=>(0,m.jsx)(eD.MenuItem,{icon:w?rg(t):void 0,onClick:()=>{e.onSelect(t)},text:t.title??(0,rr.startCase)(t.name)},t.name))}):null,x[10]=e,x[11]=b,x[12]=w,x[13]=E.groups,x[14]=E.query,x[15]=E.views,x[16]=o,x[17]=s,x[18]=a,x[19]=l,x[20]=u,x[21]=c,x[22]=d,x[23]=p,x[24]=f}else o=x[16],s=x[17],a=x[18],l=x[19],u=x[20],c=x[21],d=x[22],p=x[23],f=x[24];return x[40]!==o||x[41]!==l||x[42]!==u?(h=(0,m.jsx)(o,{padding:l,children:u}),x[40]=o,x[41]=l,x[42]=u,x[43]=h):h=x[43],x[44]!==s||x[45]!==h||x[46]!==c||x[47]!==d||x[48]!==p?(g=(0,m.jsxs)(s,{direction:c,height:d,children:[p,h]}),x[44]=s,x[45]=h,x[46]=c,x[47]=d,x[48]=p,x[49]=g):g=x[49],x[50]!==a||x[51]!==g||x[52]!==f?(v=(0,m.jsx)(a,{padding:f,children:g}),x[50]=a,x[51]=g,x[52]=f,x[53]=v):v=x[53],v}function rE(e){return e.selected}function rk(e,t){return{...e,selected:0===t}}function r_(e){return{...e,selected:!1}}let rj={grid:rt,list:rn},rC={grid:"insert-menu.toggle-grid-view.tooltip",list:"insert-menu.toggle-list-view.tooltip"};function rS(e){let t,n,r,i,o=(0,y.c)(11),s=e.views.findIndex(rM),a=e.views[s+1]??e.views[0],l=e.labels[rC[a.name]];o[0]!==l?(t=(0,m.jsx)(eB.Text,{size:1,children:l}),o[0]=l,o[1]=t):t=o[1];let u=rj[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]!==u||o[6]!==n?(r=(0,m.jsx)(eG.Button,{mode:"bleed",icon:u,onClick:n}),o[5]=u,o[6]=n,o[7]=r):r=o[7],o[8]!==t||o[9]!==r?(i=(0,m.jsx)(n7.Tooltip,{content:t,placement:"top",portal:!0,children:r}),o[8]=t,o[9]=r,o[10]=i):i=o[10],i}function rM(e){return e.selected}function rI(e){let t,n,r,i,o,s,a,l,u,c=(0,y.c)(20),[d,p]=(0,j.use
2State)(!1),f=e.icon,h=!!e.previewImageUrl&&!d;c[0]===Symbol.for("react.memo_cache_sentinel")?(t={overflow:"hidden"},c[0]=t):t=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(n={backgroundColor:"var(--card-muted-bg-color)",paddingBottom:"66.6%",position:"relative"},c[1]=n):n=c[1],c[2]!==f||c[3]!==h?(r=(0,ri.isValidElementType)(f)&&!h?(0,m.jsx)(ez.Flex,{align:"center",justify:"center",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:(0,m.jsx)(eB.Text,{size:1,children:(0,m.jsx)(f,{})})}):null,c[2]=f,c[3]=h,c[4]=r):r=c[4],c[5]!==h||c[6]!==e.previewImageUrl?(i=h?(0,m.jsx)("img",{src:e.previewImageUrl,style:{objectFit:"contain",width:"100%",height:"100%",position:"absolute",inset:0},onError:()=>{p(!0)}}):null,c[5]=h,c[6]=e.previewImageUrl,c[7]=i):i=c[7],c[8]===Symbol.for("react.memo_cache_sentinel")?(o=(0,m.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}}),c[8]=o):o=c[8],c[9]!==r||c[10]!==i?(s=(0,m.jsxs)(eH.Box,{flex:"none",style:n,children:[r,i,o]}),c[9]=r,c[10]=i,c[11]=s):s=c[11];let g=e.schemaType.title??e.schemaType.name;return c[12]!==g?(a=(0,m.jsx)(eH.Box,{flex:"none",paddingX:2,paddingY:1,children:(0,m.jsx)(eB.Text,{size:1,weight:"medium",children:g})}),c[12]=g,c[13]=a):a=c[13],c[14]!==s||c[15]!==a?(l=(0,m.jsxs)(ez.Flex,{direction:"column",gap:1,padding:1,children:[s,a]}),c[14]=s,c[15]=a,c[16]=l):l=c[16],c[17]!==e.onClick||c[18]!==l?(u=(0,m.jsx)(eD.MenuItem,{padding:0,radius:2,onClick:e.onClick,style:t,children:l}),c[17]=e.onClick,c[18]=l,c[19]=u):u=c[19],u}let rT=e3.css` 3 overflow-y: scroll; 4 overscroll-behavior: contain; 5 -ms-overflow-style: none; 6 scrollbar-width: none; 7 8 &:before { 9 content: ''; 10 display: block; 11 height: calc(100% + 1px); 12 position: absolute; 13 top: 0; 14 width: 100%; 15 z-index: -1; 16 } 17`,rL=e3.styled.div.withConfig({displayName:"PortalContainer",componentId:"sc-11pn4rs-0"})(["height:100%;inset:0;pointer-events:all;position:fixed;width:100%;display:flex;justify-content:center;align-items:center;",""],e=>e.$blockScroll&&rT),rA=e3.styled.div.withConfig({displayName:"PortalBackground",componentId:"sc-11pn4rs-1"})(["background:transparent;height:100%;inset:0;position:absolute;width:100%;"]),rR=e=>{let t,n=(0,y.c)(2);return n[0]!==e?(t=(0,m.jsx)(n9.g,{children:(0,m.jsx)(r$,{...e})}),n[0]=e,n[1]=t):t=n[1],t},r$=e=>{let t,n,r=(0,y.c)(7),{children:i,onDismiss:o,setBoundaryElement:s,blockScroll:a}=e,l=void 0===a||a;return r[0]!==o?(t=(0,m.jsx)(rA,{onMouseDownCapture:()=>{o?.()}}),r[0]=o,r[1]=t):t=r[1],r[2]!==l||r[3]!==i||r[4]!==s||r[5]!==t?(n=(0,m.jsxs)(rL,{"data-sanity-overlay-element":!0,ref:s,onClick:rN,$blockScroll:l,children:[t,i]}),r[2]=l,r[3]=i,r[4]=s,r[5]=t,r[6]=n):n=r[6],n};function rN(e){e.stopPropagation()}function rP(e){if(!e)return(0,m.jsx)(ra,{});if("string"===e.type)return(0,m.jsx)(rc,{});if("number"===e.type)return(0,m.jsx)(ru,{});let{value:t}=e;if("icon"in e&&e.icon)return(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:e.icon}});let{type:n}=t;if("string"===n)return(0,m.jsx)(rc,{});if("boolean"===n)return(0,m.jsx)(rs,{});if("number"===n)return(0,m.jsx)(ru,{});if("array"===n||"union"===n)return(Array.isArray(t.of)?t.of:[t.of]).some(e=>"name"in e&&"block"===e.name)?(0,m.jsx)(ro,{}):(0,m.jsx)(rd,{});if("object"===n){if("image"===e.name)return(0,m.jsx)(rl,{});if("block"===e.name)return(0,m.jsx)(rc,{})}return(0,m.jsx)(ra,{})}let rO={"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"},rV=e=>{let t,n,r,i,o=(0,y.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(rD),o[2]=l.views,o[3]=n):n=o[3];let u=n;return o[4]!==s.of?(r=s.of.map(rH),o[4]=s.of,o[5]=r):r=o[5],o[6]!==l||o[7]!==a||o[8]!==r||o[9]!==u?(i=(0,m.jsx)(rb,{...l,labels:rO,schemaTypes:r,onSelect:a,views:u}),o[6]=l,o[7]=a,o[8]=r,o[9]=u,o[10]=i):i=o[10],i};function rD(e){return"grid"===e.name?{...e,previewImageUrl:t=>e.previewImageUrls?.[t]}:e}function rH(e){return{...e,icon:rP(e)}}let rB=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"arrow-down",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M12.5 19.5V5",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M18 14L12.5 19.5L7 14",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})]})}),rU=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"arrow-up",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M7 11L12.5 5.5L18 11",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M12.5 5.5V20",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})]})}),rW=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"copy",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M8.5 8.5H5.5V20.5H16.5V16.5M19.5 4.5H8.5V16.5H19.5V4.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})}),rz=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"insert-above",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M14.5 10.5556L10.5 10.5556M12.5 12.5L12.5 8.5M18.5 5.5L6.5 5.5M18.5 19.5L6.5 19.5L6.5 15.5L18.5 15.5L18.5 19.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"square",strokeLinejoin:"round"})})}),rF=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"insert-below",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M10.5 14.5H14.5M12.5 12.5V16.5M6.5 19.5H18.5M6.5 5.5H18.5V9.5H6.5V5.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"square",strokeLinejoin:"round"})})}),rq=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"publish",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M4.99997 5.50006H20M12.5 9.00005V20",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M7.5 14L12.5 9.00006L17.5 14",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})]})});var rG=e.i(813141);let rZ=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"sort",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M8.5 18.5V6M16.5 19V6.5M12 15L8.5 18.5L5 15M13 10L16.5 6.5L20 10",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})}),rY=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"unpublish",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M5 19.5H20M12.5 16V5",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M17.5 11L12.5 16L7.5 11",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})]})}),rK=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"document",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M11.5 4.5V9.5H6.5",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M18.5 20.5H6.5V9.5L11.5 4.5H18.5V20.5Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})]})}),rJ=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"drag-handle",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M9.5 8C10.3284 8 11 7.32843 11 6.5C11 5.67157 10.3284 5 9.5 5C8.67157 5 8 5.67157 8 6.5C8 7.32843 8.67157 8 9.5 8Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M9.5 14C10.3284 14 11 13.3284 11 12.5C11 11.6716 10.3284 11 9.5 11C8.67157 11 8 11.6716 8 12.5C8 13.3284 8.67157 14 9.5 14Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M11 18.5C11 19.3284 10.3284 20 9.5 20C8.67157 20 8 19.3284 8 18.5C8 17.6716 8.67157 17 9.5 17C10.3284 17 11 17.6716 11 18.5Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M15.5 8C16.3284 8 17 7.32843 17 6.5C17 5.67157 16.3284 5 15.5 5C14.6716 5 14 5.67157 14 6.5C14 7.32843 14.6716 8 15.5 8Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11C16.3284 11 17 11.6716 17 12.5Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M15.5 20C16.3284 20 17 19.3284 17 18.5C17 17.6716 16.3284 17 15.5 17C14.6716 17 14 17.6716 14 18.5C14 19.3284 14.6716 20 15.5 20Z",fill:"currentColor"})]})}),rX=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"ellipsis-vertical",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M14 6.5C14 7.32843 13.3284 8 12.5 8C11.6716 8 11 7.32843 11 6.5C11 5.67157 11.6716 5 12.5 5C13.3284 5 14 5.67157 14 6.5Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M14 12.5C14 13.3284 13.3284 14 12.5 14C11.6716 14 11 13.3284 11 12.5C11 11.6716 11.6716 11 12.5 11C13.3284 11 14 11.6716 14 12.5Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M14 18.5C14 19.3284 13.3284 20 12.5 20C11.6716 20 11 19.3284 11 18.5C11 17.6716 11.6716 17 12.5 17C13.3284 17 14 17.6716 14 18.5Z",fill:"currentColor"})]})}),rQ=(0,j.forwardRef)(function(e,t){return(0,m.jsx)("svg",{"data-sanity-icon":"plug",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,m.jsx)("path",{d:"M13.25 8.5L16.75 5M16.25 11.5L19.75 8M9.25 15.5L5.25 19.5M7.75 14L9.75 12C8.25 10 8.75 9 9.75 8C10.15 7.6 11.25 6.5 11.25 6.5L18.25 13.5C18.25 13.5 17.3825 14.3675 16.75 15C15.75 16 14.75 16.5 12.75 15L10.75 17L7.75 14Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})});var r1=e.i(25560),r0=e.i(187484);let r5=(0,j.forwardRef)(function(e,t){return(0,m.jsxs)("svg",{"data-sanity-icon":"expand",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,m.jsx)("path",{d:"M14 6.5H18.5V11M11 18.5H6.5V14",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M18.5 6.5L14 11M6.5 18.5L11 14",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})]})});var r2=e.i(659454),r3=e.i(791413),r4=e.i(178480),r6=e.i(878379),r8=e.i(730917);function r7(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(e9(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 r9(e,t,n,r){let i=e.slice();return i.splice(t,n,...r||[]),i}function ie(e,t){let n={...e};for(let e of t)delete n[e];return n}function it(e,t){var n;if(!Array.isArray(t))throw TypeError('Cannot apply "insert()" on non-array value');let r=r7(t,e.referenceItem);if(null===r)throw Error(`Found no matching array element to insert ${e.position}`);return 0===t.length?e.items:r9(t,(n=e.position,"before"===n?r:r+1),0,e.
17items)}let ir=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);var ii=Object.freeze({__proto__:null,assign:function(e,t){if(!td(t))throw TypeError('Cannot apply "assign()" on non-object value');return!function(e){for(let t in e)if(ir(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(0,r8.applyPatches)((0,r8.parsePatch)(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:it,insertIfMissing:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "insertIfMissing()" on non-array value');if(0===e.items.length)return t;let n=e.items.filter(e=>!t.find(t=>e._key===t?._key));return 0===n.length?t:it({items:n,referenceItem:e.referenceItem,position:e.position},t)},remove:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "remove()" on non-array value');let n=r7(t,e.referenceItem);if(null===n)throw Error("Found no matching array element to replace");return r9(t,n,1,[])},replace:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "replace()" on non-array value');let n=r7(t,e.referenceItem);if(null===n)throw Error("Found no matching array element to replace");return r9(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(!td(t))throw TypeError('Cannot apply "unassign()" on non-object value');return 0===e.keys.length?t:ie(t,e.keys)},unset:function(e){},upsert:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "upsert()" on non-array value');
17if(0===e.items.length)return t;let n={},r=[];e.items.forEach((e,i)=>{let o=t.findIndex(t=>t?._key===e._key);o>=0?n[o]=i:r.push(e)});let i=Object.keys(n);if(0===i.length&&0==r.length)return t;let o=[...t];for(let t of i){let r=Number(t);o[r]=e.items[n[r]]}return it({items:r,referenceItem:e.referenceItem,position:e.position},o)}});function io(e,t){return e.reduce((e,t)=>is(t,e),t)}function is(e,t){return function e(t,n,r){if(!(t.length>0)){if(!(n.type in ii))throw Error(`Invalid operation type: "${n.type}"`);return ii[n.type](n,r)}let[i,...o]=t;if(te(i)&&Array.isArray(r)){var s=i,a=o,l=n,u=r;let t=r7(u,s);if(null===t||-1===t)return u;let c=u[t],d=e(a,l,c);return d===c?u:r9(u,t,1,void 0===d?[]:[d])}if("string"==typeof i&&td(r)){var c=i,d=o,p=n,f=r;let t=f[c];if(void 0===t&&d.length>0)return f;let s=e(d,p,t);return void 0===s?ie(f,[c]):s===t?f:{...f,[c]:s}}throw Error(`Cannot apply operation of type "${n.type}" to path ${tn(t)} on ${typeof r} value`)}(e.path,e.op,t)}function ia(e){return"_id"in e}function il(e,t){if(0===e.length)return t;let n=t;for(let t of e){if(te(t)){if(!Array.isArray(n))return;if(e9(t)){n=n.find(e=>e._key===t._key);continue}n=n[t];continue}n=n[t]}return n}var iu=e.i(893106),ic=e.i(114395);function id(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")}function ip(e,t){return t.reduce((e,t)=>{let n=ih(e,t);if("error"===n.status)throw Error(n.message);return"noop"===n.status?e:n.after},e)}function ih(e,t){if("create"===t.type){var n,r,i,o,s,a,l,u,c=e,d=t;if(c)return{status:"error",message:"Document already exist"};let p=(l=d.document,u=iu.nanoid,ia(l)?l:{...l,_id:u()});return{status:"created",id:p._id,after:p}}if("createIfNotExists"===t.type){return n=e,ia((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,ia((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 p=e,f=t;if(!p)return{status:"error",message:"Cannot apply patch on nonexistent document"};let n=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 io(e.patches,t)}(f,p);return p===n?{status:"noop"}:{status:"updated",id:f.id,before:p,after:n}}throw Error(`Invalid mutation type: ${t.type}`)}function im(e,t,n){let r=[];for(let n of e.slice().reverse()){if(t(n))return r;r.push(n)}return r.reverse()}function iy(e,t){return tn(e)===tn(t)}function ig(e,t){let n=e;return t.reduce((e,t)=>{let r=n;if(n=is(t,n),"set"===t.op.type&&"string"==typeof t.op.value){let n=il(t.path,r);if("string"==typeof n){let r={...t,op:{type:"diffMatchPatch",value:(0,r8.stringifyPatches)((0,r8.makePatches)(n,t.op.value))}};return e.flatMap(e=>iy(e.path,t.path)&&"diffMatchPatch"===e.op.type?[]:e).concat(r)}}return e.push(t),e},[])}function iv(e,t,n,r){let i=t,o=r.map(t=>{let n=t.mutations.flatMap(t=>{if(id(t)!==e)return[];let n=i;return i=ip(i,[t]),n&&"patch"===t.type?{type:"dmpified",mutation:{...t,dmpPatches:ig(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=io(t.mutation.dmpPatches,s),n.push(t)}catch{console.warn("Failed to apply dmp patch, falling back to original");try{s=io(t.mutation.original,s),n.push(t)}catch(t){throw Error(`Failed to apply patch for document "${e}": ${t.message}`,{cause:t})}}else s=ip(s,[t])})}),[r.map(t=>({...t,mutations:t.mutations.map(t=>"patch"!==t.type||id(t)!==e?t:{...t,patches:t.patches.map(e=>"set"!==e.op.type?e:{...e,op:{...e.op,value:il(e.path,s)}})})})),s]}var ix=e.i(921335),iw=e.i(134671),ib=e.i(80205),iE=e.i(30214),ik=e.i(159862),i_=e.i(799798),ij=e.i(597971);function iC(e,t,n,r,{assignment:i}){if(!t.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let o={},s={context:t.context,event:n.event,spawn:function(e,{machine:t,context:n},r,i){return(o,s)=>{let a=((o,s)=>{if("string"!=typeof o)return tU(o,{id:s?.id,parent:e.self,syncSnapshot:s?.syncSnapshot,input:s?.input,src:o,systemId:s?.systemId});{let a=t$(t,o);if(!a)throw Error(`Actor logic '${o}' not implemented in machine '${t.id}'`);let l=tU(a,{id:s?.id,parent:e.self,syncSnapshot:s?.syncSnapshot,input:"function"==typeof s?.input?s.input({context:n,event:r,self:e.self}):s?.input,src:o,systemId:s?.systemId});return i[l.id]=l,l}})(o,s);return i[a.id]=a,e.defer(()=>{a._processingStatus!==tD.Stopped&&a.start()}),a}}(e,t,n.event,o),self:e.self,system:e.system},a={};if("function"==typeof i)a=i(s,r);else for(let e of Object.keys(i)){let t=i[e];a[e]="function"==typeof t?t(s,r):t}let l=Object.assign({},t.context,a);return[n_(t,{context:l,children:Object.keys(o).length?{...t.children,...o}:t.children}),void 0,void 0]}function iS(e){function t(e,t){}return t.type="xstate.assign",t.assignment=e,t.resolve=iC,t}let iM=new WeakMap;function iI(e,t,n){let r=iM.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},iM.set(e,r)),r[t]}let iT={},iL=e=>"string"==typeof e?{type:e}:"function"==typeof e?"resolve"in e?{type:e.type}:{type:e.name}:e;class iA{constructor(e,t){if(this.config=e,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=t._parent,this.key=t._key,this.machine=t._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join("."),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?tS(this.config.states,(e,t)=>new iA(e,{_parent:this,_key:t,_machine:this.machine})):iT,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for c
17ompound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=tM(this.config.entry).slice(),this.exit=tM(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=tM(e.tags).slice()}_initialize(){this.transitions=function(e){let t=new Map;if(e.config.on)for(let n of Object.keys(e.config.on)){if(""===n)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let r=e.config.on[n];t.set(n,tL(r).map(t=>t7(e,n,t)))}if(e.config.onDone){let n=`xstate.done.state.${e.id}`;t.set(n,tL(e.config.onDone).map(t=>t7(e,n,t)))}for(let n of e.invoke){if(n.onDone){let r=`xstate.done.actor.${n.id}`;t.set(r,tL(n.onDone).map(t=>t7(e,r,t)))}if(n.onError){let r=`xstate.error.actor.${n.id}`;t.set(r,tL(n.onError).map(t=>t7(e,r,t)))}if(n.onSnapshot){let r=`xstate.snapshot.${n.id}`;t.set(r,tL(n.onSnapshot).map(t=>t7(e,r,t)))}}for(let n of e.after){let e=t.get(n.eventType);e||(e=[],t.set(n.eventType,e)),e.push(n)}return t}(this),this.config.always&&(this.always=tL(this.config.always).map(e=>t7(this,"",e))),Object.keys(this.states).forEach(e=>{this.states[e]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.t
17ype,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(iL),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(iL),eventType:null})}:void 0,history:this.history,states:tS(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map(iL)})),entry:this.entry.map(iL),exit:this.exit.map(iL),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return iI(this,"invoke",()=>tM(this.config.invoke).map((e,t)=>{var n,r;let{src:i,systemId:o}=e,s=e.id??(n=this.id,`${t}.${n}`),a="string"==typeof i?i:`xstate.invoke.${r=this.id,`${t}.${r}`}`;return{...e,src:a,id:s,systemId:o,toJSON(){let{onDone:t,onError:n,...r}=e;return{...r,type:"xstate.invoke",src:a,id:s}}}}))}get on(){return iI(this,"on",()=>[...this.transitions].flatMap(([e,t])=>t.map(t=>[e,t])).reduce((e,[t,n])=>(e[t]=e[t]||[],e[t].push(n),e),{}))}get after(){return iI(this,"delayedTransitions",()=>{var e;let t;return e=this,(t=e.config.after)?Object.keys(t).flatMap(n=>{var r;let i,o,s=t[n],a=Number.isNaN(+n)?n:+n,l=(r=e.id,o=(i={type:`xstate.after.${a}.${r}`}).type,e.entry.push(nS(i,{id:o,delay:a})),e.exit.push(tF(o)),o);return tM("string"==typeof s?{target:s}:s).map(e=>({...e,event:l,delay:a}))}).map(t=>{let{delay:n}=t;return{...t7(e,t.event,t),delay:n}}):[]})}get initial(){return iI(this,"initial",()=>(function(e,t){let n="string"==typeof t?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let r={source:e,actions:t&&"string"!=typeof t?tM(t.actions):[],eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r})(this,this.config.initial))}next(e,t){let n,r=t.type,i=[];for(let o of iI(this,`candidates-${r}`,()=>{var e;let t,n;return e=this,t=e.transitions.get(r),n=[...e.transitions.keys()].filter(e=>e!==r&&tN(r,e)).sort((e,t)=>t.length-e.length).flatMap(t=>e.transitions.get(t)),t?[...t,...n]:n})){let{guard:s}=o,a=e.context,l=!1;try{l=!s||tQ(s,a,t,e)}catch(t){let e="string"==typeof s?s:"object"==typeof s?s.type:void 0;throw Error(`Unable to evaluate guard ${e?`'${e}' `:""}in transition for event '${r}' in state node '${this.id}': 18${t.message}`)}if(l){i.push(...o.actions),n=o;break}}return n?[n]:void 0}get events(){return iI(this,"events",()=>{let{states:e}=this,t=new Set(this.ownEvents);if(e)for(let n of Object.keys(e)){let r=e[n];if(r.states)for(let e of r.events)t.add(`${e}`)}return Array.from(t)})}get ownEvents(){return Array.from(new Set(Object.keys(Object.fromEntries(this.transitions)).filter(e=>this.transitions.get(e).some(e=>!(!e.target&&!e.actions.length&&!e.reenter)))))}}class iR{constructor(e,t){this.config=e,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.options=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=e.id||"(machine)",this.implementations={actors:t?.actors??{},actions:t?.actions??{},delays:t?.delays??{},guards:t?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.options={maxIterations:1/0,...this.config.options},this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new iA(e,{_key:this.id,_machine:this}),this.root._initialize(),function(e){let t=[],n=r=>{Object.values(r).forEach(r=>{if(r.config.route&&r.config.id){let n=r.config.id,i=r.config.route.guard,o=({event:e})=>e.to===`#${n}`,s={...r.config.route,guard:i?function(e){function t(e,t){return!1}return t.check=tX,t.guards=e,t}([o,i]):o,target:`#${n}`};t.push(t7(e,"xstate.route",s))}r.states&&n(r.states)})};n(e.states),t.length>0&&e.transitions.set("xstate.route",t)}(this.root),this.states=this.root.states,this.events=this.root.events}provide(e){let{actions:t,guards:n,actors:r,delays:i}=this.implementations;return new iR(this.config,{actions:{...t,...e.actions},guards:{...n,...e.guards},actors:{...r,...e.actors},delays:{...i,...e.delays}})}resolveState(e){var t;let n,r=(n=t2(no(t=this.root,e.value)),t4(t,[...n])),i=t2(no(this.root,r));return nk({_nodes:[...i],context:e.context||{},children:{},status:t6(i,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,t,n){return nm(e,t,n,[]).snapshot}microstep(e,t,n){return nm(e,t,n,[]).microsteps.map(([e])=>e)}getTransitionData(e,t){return function e(t,n,r,i){if("string"==typeof n){let e;return(e=nr(t,n).next(r,i))&&e.length?e:t.next(r,i)}if(1===Object.keys(n).length){let o,s;return(s=e(nr(t,(o=Object.keys(n))[0]),n[o[0]],r,i))&&s.length?s:t.next(r,i)}let o=[];for(let s of Object.keys(n)){let a=n[s];if(!a)continue;let l=e(nr(t,s),a,r,i);l&&o.push(...l)}return o.length?o:t.next(r,i)}(this.root,e.value,e,t)||[]}_getPreInitialState(e,t,n){let{context:r}=this.config,i=nk({context:"function"!=typeof r&&r?r:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof r?nh(i,t,e,[iS(({spawn:e,event:t,self:n})=>r({spawn:e,input:t.input,self:n}))],n,void 0):i}getInitialSnapshot(e,t){var n;let r=tE(t),i=[],o=this._getPreInitialState(e,r,i),[s]=(n=this.root,nd([{target:[...nn(n)],source:n,reenter:!0,actions:[],eventType:null,toJSON:null}],o,e,r,!0,i)),{snapshot:a}=nm(s,r,e,i);return a}
18start(e){Object.values(e.children).forEach(e=>{"active"===e.getSnapshot().status&&e.start()})}getStateNodeById(e){let t=tj(e),n=t.slice(1),r=t8(t[0])?t[0].slice(1):t[0],i=this.idMap.get(r);if(!i)throw Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);return ni(i,n)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,t){return function(e,t){let{_nodes:n,tags:r,machine:i,children:o,context:s,can:a,hasTag:l,matches:u,getMeta:c,toJSON:d,...p}=e,f={};for(let e in o){let n=o[e];f[e]={snapshot:n.getPersistedSnapshot(t),src:n.src,systemId:n.systemId,syncSnapshot:n._syncSnapshot}}return{...p,context:function e(t){let n;for(let r in t){let i=t[r];if(i&&"object"==typeof i)if("sessionId"in i&&"send"in i&&"ref"in i)(n??=Array.isArray(t)?t.slice():{...t})[r]={xstate$$type:1,id:i.id};else{let o=e(i);o!==i&&((n??=Array.isArray(t)?t.slice():{...t})[r]=o)}}return n??t}(s),children:f,historyValue:function(e){if("object"!=typeof e||null===e)return{};let t={};for(let n in e){let r=e[n];Array.isArray(r)&&(t[n]=r.map(e=>({id:e.id})))}return t}(p.historyValue)}}(e,t)}restoreSnapshot(e,t){let n={},r=e.children;Object.keys(r).forEach(e=>{let i=r[e],o=i.snapshot,s=i.src,a="string"==typeof s?t$(this,s):s;if(!a)return;let l=tU(a,{id:e,parent:t.self,syncSnapshot:i.syncSnapshot,snapshot:o,src:s,systemId:i.systemId});n[e]=l});let i=function(e,t){if(!t||"object"!=typeof t)return{};let n={};for(let r in t)for(let i of t[r]){let t=function(e,t){if(t instanceof iA)return t;try{return e.machine.getStateNodeById(t.id)}catch{}}(e,i);t&&(n[r]??=[],n[r].push(t))}return n}(this.root,e.historyValue),o=nk({...e,children:n,_nodes:Array.from(t2(no(this.root,e.value))),historyValue:i},this),s=new Set;return!function e(t,n){if(!s.has(t))for(let r in s.add(t),t){let i=t[r];if(i&&"object"==typeof i){if("xstate$$type"in i&&1===i.xstate$$type){t[r]=n[i.id];continue}e(i,n)}}}(o.context,n),o}}function i$(e,t,n,r,{event:i}){return[t,{event:"function"==typeof i?i(n,r):i},void 0]}function iN(e,{event:t}){e.defer(()=>e.emit(t))}function iP(e){function t(e,t){}return t.type="xstate.emit",t.event=e,t.resolve=i$,t.execute=iN,t}let iO=((f={}).Parent="#_parent",f.Internal="#_internal",f);function iV(e,t,n,r,{to:i,event:o,id:s,delay:a},l){let u,c,d=t.machine.implementations.delays;if("string"==typeof o)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${o}" }) instead`);let p="function"==typeof o?o(n,r):o;if("string"==typeof a){let e=d&&d[a];u="function"==typeof e?e(n,r):e}else u="function"==typeof a?a(n,r):a;let f="function"==typeof i?i(n,r):i;if("string"==typeof f){if(!(c=f===iO.Parent?e.self._parent:f===iO.Internal?e.self:f.startsWith("#_")?t.children[f.slice(2)]:l.deferredActorIds?.includes(f)?f:t.children[f]))throw Error(`Unable to send event to actor '${f}' from machine '${t.machine.id}'.`)}else c=f||e.self;return[t,{to:c,targetId:"string"==typeof f?f:void 0,event:p,id:s,delay:u},void 0]}function iD(e,t,n){"string"==typeof n.to&&(n.to=t.children[n.to])}function iH(e,t){e.defer(()=>{let{to:n,event:r,delay:i,id:o}=t;"number"==typeof i?e.system.scheduler.schedule(e.self,n,r,i,o):e.system._relay(e.self,n,"xstate.error"===r.type?tb(e.self.id,r.data):r)})}function iB(e,t,n){function r(e,t){}return r.type="xstate.sendTo",r.to=e,r.event=t,r.id=n?.id,r.delay=n?.delay,r.resolve=iV,r.retryResolve=iD,r.execute=iH,r}function iU(e,t){return iB(iO.Parent,e,t)}function iW(e,t,n,r,{collect:i}){let o=[],s=function(e){o.push(e)};return s.assign=(...e)=>{o.push(iS(...e))},s.cancel=(...e)=>{o.push(tF(...e))},s.raise=(...e)=>{o.push(nS(...e))},s.sendTo=(...e)=>{o.push(iB(...e))},s.sendParent=(...e)=>{o.push(iU(...e))},s.spawnChild=(...e)=>{o.push(tZ(...e))},s.stopChild=(...e)=>{o.push(tJ(...e))},s.emit=(...e)=>{o.push(iP(...e))},i({context:n.context,event:n.event,enqueue:s,check:e=>tQ(e,t.context,n.event,t),self:e.self,system:e.system},r),[t,void 0,o]}function iz(e){function t(e,t){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=iW,t}function iF(e,t,n,r,{value:i,label:o}){return[t,{value:"function"==typeof i?i(n,r):i,label:o},void 0]}function iq({logger:e},{value:t,label:n}){n?e(n,t):e(t)}function iG(e=({context:e,event:t})=>({context:e,event:t}),t){function n(e,t){}return n.type="xstate.log",n.value=e,n.label=t,n.resolve=iF,n.execute=iq,n}function iZ(e,t){let n=tM(t);if(!n.some(t=>tN(e.type,t))){let t=1===n.length?`type matching "${n[0]}"`:`one of types matching "${n.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(e)} to have ${t}`)}}function iY({schemas:e,actors:t,actions:n,guards:r,delays:i}){return{assign:iS,sendTo:iB,raise:nS,log:iG,cancel:tF,stopChild:tJ,enqueueActions:iz,emit:iP,spawnChild:tZ,createStateConfig:e=>e,createAction:e=>e,createMachine:o=>new iR({...o,schemas:e},{actors:t,actions:n,guards:r,delays:i}),extend:o=>iY({schemas:e,actors:t,actions:{...n,...o.actions},guards:{...r,...o.guards},delays:{...i,...o.delays}})}}
18function iK(e){let t=e.listen('*[!(_id in path("_.**"))]',{},{events:["welcome","mutation","reconnect"],includeResult:!1,includePreviousRevision:!1,visibility:"transaction",effectFormat:"mendoza",includeMutations:!1}).pipe((0,iw.share)({resetOnRefCountZero:!0})),n=t.pipe((0,ib.filter)(e=>"reconnect"===e.type)),r=t.pipe((0,ib.filter)(e=>"welcome"===e.type)),i=t.pipe((0,ib.filter)(e=>"mutation"===e.type)),o=(0,r4.merge)(r,n).pipe((0,iE.shareReplay)({bufferSize:1,refCount:!0})).pipe((0,ib.filter)(e=>"welcome"===e.type));return(0,r4.merge)(o,i,n)}let iJ=iY({types:{},actions:{"assign error to context":iS({error:({event:e})=>e}),"clear error from context":iS({error:void 0}),"connect to server-sent events":nS({type:"connect"}),"listen to server-sent events":tZ("server-sent events",{id:"listener",input:({context:e})=>({listener:e.sharedListener||iK(e.client),id:e.id})}),"stop listening to server-sent events":tJ("listener"),"buffer remote mutation events":iS({mutationEvents:({event:e,context:t})=>(iZ(e,"mutation"),[...t.mutationEvents,e])}),"restore stashed changes":iS({stagedChanges:({event:e,context:t})=>(iZ(e,"xstate.done.actor.submitTransactions"),t.stashedChanges),stashedChanges:[]}),"rebase fetched remote snapshot":iz(({enqueue:e})=>{e.assign(({event:e,context:t})=>{iZ(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=iX(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]=iv(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":iS(({event:e,context:t})=>{iZ(e,"mutation");let n=t.remote;if(e.transactionId===n?._rev)return{};let r=iX(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]=iv(t.id,null===n?void 0:n,null===r?void 0:r,t.stagedChanges);return{remote:r,local:o,stagedChanges:i}}),"increment fetch attempts":iS({fetchRemoteSnapshotAttempts:({context:e})=>e.fetchRemoteSnapshotAttempts+1}),"reset fetch attempts":iS({fetchRemoteSnapshotAttempts:0}),"increment submit attempts":iS({submitTransactionsAttempts:({context:e})=>e.submitTransactionsAttempts+1}),"reset submit attempts":iS({submitTransactionsAttempts:0}),"stage mutation":iS({stagedChanges:({event:e,context:t})=>(iZ(e,"mutate"),[...t.stagedChanges,{transaction:!1,mutations:e.mutations}])}),"stash mutation":iS({stashedChanges:({event:e,context:t})=>(iZ(e,"mutate"),[...t.stashedChanges,{transaction:!1,mutations:e.mutations}])}),"rebase local snapshot":iz(({enqueue:e})=>{e.assign({local:({event:e,context:t})=>{var n;iZ(e,"mutate");let r=new Map;return t.local&&r.set(t.id,t.local),n=function(e,t){let n=Object.create(null);for(let r of e){let e=id(r);if(!e)throw Error("Unable to get document id from mutation");let i=n[e]?.after||t.get(e),o=ih(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:[]}),t.set(e,o.after),n[e].after=o.after,n[e].muts.push(r))}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,r),n.forEach(e=>{("created"===e.status||"updated"===e.status)&&r.set(e.id,e.after),"deleted"===e.status&&r.delete(e.id)}),r.get(t.id)}}),e.sendParent(({context:e})=>({type:"rebased.local",id:e.id,document:e.local}))}),"send pristine event to parent":iU(({context:e})=>({type:"pristine",id:e.id})),"send sync event to parent":iU(({context:e})=>({type:"sync",id:e.id,document:e.remote})),"send mutation event to parent":iU(({context:e,event:t})=>(iZ(t,"mutation"),{type:"mutation",id:e.id,previousRev:t.previousRev,resultRev:t.resultRev,effects:t.effects}))},actors:{"server-sent events":{config:h=({input:e})=>{let{listener:t,id:n}=e;return(0,ik.defer)(()=>t).pipe((0,ib.filter)(e=>"welcome"===e.type||"reconnect"===e.type||"mutation"===e.type&&e.documentId===n),(0,i_.observeOn)(ij.asapScheduler))},transition:(e,t)=>{if("active"!==e.status)return e;switch(t.type){case nM:return{...e,status:"error",error:t.data,input:void 0,_subscription:void 0};case nI:return{...e,status:"done",input:void 0,_subscription:void 0};case tx:return e._subscription.unsubscribe(),{...e,status:"stopped",input:void 0,_subscription:void 0};default:return e}},getInitialSnapshot:(e,t)=>
18({status:"active",output:void 0,error:void 0,context:void 0,input:t,_subscription:void 0}),start:(e,{self:t,system:n,emit:r})=>{"done"!==e.status&&(e._subscription=h({input:e.input,system:n,self:t,emit:r}).subscribe({next:e=>{t._parent&&n._relay(t,t._parent,e)},error:e=>{n._relay(t,t,{type:nM,data:e})},complete:()=>{n._relay(t,t,{type:nI})}}))},getPersistedSnapshot:({_subscription:e,...t})=>t,restoreSnapshot:e=>({...e,_subscription:void 0})},"fetch remote snapshot":nR(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":nR(async({input:e,signal:t})=>{let{client:n,transactions:r}=e;for(let e of r){if(t.aborted)return;await n.dataRequest("mutate",tl(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})=>{var t,n;let r,i,o=new Map;return o.set(e.id,e.remote),{client:e.client,transactions:(t=e.stagedChanges,n=e=>!e.transaction,r=[],i=[],t.forEach(e=>{n(e)?i.push(e):(i.length>0&&r.push(i),i=[],r.push([e]))}),i.length>0&&r.push(i),r).flatMap(e=>({...e[0],mutations:e.flatMap(e=>e.mutations)})).map(e=>{var t;return{...e,mutations:(t=e.mutations,Object.values((0,r6.default)(t,id)).flatMap(e=>{var t,n;return(0===(n=0===(t=e).length?t:t.reduce((e,t)=>"delete"===t.type?[t]:(e.push(t),e),[])).length?n:n.reduce((e,t)=>("createIfNotExists"!==t.type?e.push(t):im(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),e7(n)&&e7(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)&&iy(e.path,t.path)})||e.unshift(t),e),[]).reduce((e,t)=>
18("setIfMissing"!==t.op.type?e.push(t):im(e,e=>"unset"===e.op.type).find(e=>"setIfMissing"===e.op.type&&iy(e.path,t.path))||e.push(t),e),[])})})).map(e=>{var t;return{...e,mutations:(t=o,e.mutations.map((e,n)=>{var r,i;if("patch"!==e.type)return e;let o=t.get(e.id);return o?(r=o,{...i=e,patches:ig(r,i.patches)}):e}))}}).map(e=>e.transaction&&void 0!==e.id?{id:e.id,mutations:e.mutations}:{id:(0,ic.uuid)(),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 iX(e,t,n){let r=(0,ix.applyPatch)(function(e){if(!e)return null;let{_rev:t,...n}=e;return n}(e),t);return r?Object.assign(r,{_rev:n}):null}let iQ=e=>{let t=nR(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=nR(async({input:t})=>{let{transactions:n}=t;for(let t of n){let n=ty.encodeTransaction(t);return e.post("visual-editing/mutate",n)}});return iJ.provide({actions:{"send sync event to parent":iz(({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}})},i1=iY({types:{},actions:{"emit sync event":iP(({event:e})=>(iZ(e,"sync"),e)),"emit mutation event":iP(({event:e})=>(iZ(e,"mutation"),e)),"emit rebased event":iP(({event:e})=>(iZ(e,["rebased.local","rebased.remote"]),e)),"emit pristine event":iP(({event:e})=>(iZ(e,["pristine"]),e)),"add document actor":iS({documents:({context:e,event:t,spawn:n})=>{iZ(t,"observe");let r=t.documentId;return e.documents[r]?e.documents:{...e.documents,[r]:n("documentMutatorMachine",{input
18:{id:r,client:e.client,sharedListener:e.sharedListener||iK(e.client)},id:r})}}}),"stop remote snapshot":tJ(({context:e,event:t})=>(iZ(t,"unobserve"),e.documents[t.documentId])),"remove remote snapshot from context":iS({documents:({context:e,event:t})=>{if(iZ(t,"unobserve"),!e.documents[t.documentId])return e.documents;let{[t.documentId]:n,...r}=e.documents;return r}})},actors:{documentMutatorMachine:iJ}}).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:{}}}),i0=e=>i1.provide({actors:{documentMutatorMachine:iQ(e)}});function i5(e){if(e.defaultPrevented)return;let{clipboardData:t}=e;if(!t)return;let n=document.activeElement;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement){let r=function(e){try{let{selectionStart:t,selectionEnd:n,value:r}=e;return null===t||null===n||t===n?null:r.slice(t,n)}catch{return null}}(n);if(!r||!eS(r))return;e.preventDefault(),t.setData("text/plain",eM(r));return}let r=document.getSelection();if(!r||r.isCollapsed||0===r.rangeCount)return;let i=r.toString(),o=function(e){let t="";for(let n=0;n<e.rangeCount;n++){let r=document.createElement("div");r.appendChild(e.getRangeAt(n).cloneContents()),t+=r.innerHTML}return t}(r);
18(eS(i)||eS(o))&&(e.preventDefault(),t.setData("text/plain",eM(i)),o&&t.setData("text/html",eM(o)))}e.s(["createDatasetMutator",0,i0,"createDocumentMutator",0,iQ],428585);let i2={IMG:["alt"],TIME:["datetime"],SVG:["aria-label"]};function i3(e){return e.nodeType===Node.ELEMENT_NODE}function i4(e){return i3(e)&&"SANITY-VISUAL-EDITING"===e.tagName.toUpperCase()}function i6(e){let t=i3(e)?e:e.parentElement;return!!t&&null!==t.closest("sanity-visual-editing")}function i8(e){return!!document.head&&document.head.contains(e)}function i7(e,t,n,r,i){if(!(!n||!eS(n))){if(r)return void i("head",e,t,n);i2[e.tagName.toUpperCase()]?.includes(t.toLowerCase())||i("attribute",e,t,n)}}function i9(e,t,n){let{attributes:r}=e;for(let i=0;i<r.length;i++){let o=r[i];o&&i7(e,o.name,o.value,t,n)}}function oe(e,t,n){let r,i=e.parentElement;if(t)r="head";else switch(i?.tagName.toUpperCase()){case"SCRIPT":r="script";break;case"STYLE":r="style";break;case"TEXTAREA":r="form-value";break;default:return}let o=e.textContent;o&&eS(o)&&n(r,i??void 0,void 0,o)}function ot(e,t,n){i3(e)?i4(e)||i9(e,t,n):e.nodeType===Node.TEXT_NODE&&oe(e,t,n)}function on(e,t,n){let r;ot(e,t,n);let i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:e=>i4(e)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;r=i.nextNode();)ot(r,t,n)}let or=new Set,oi=null;function oo(e){if(oi!==e)for(let t of(oi=e,or))t()}let os=e=>{let t,n,r,i,o=(0,y.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,j.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,j.useEffect)(r,i),null},oa=new Set,ol=null,ou=null,oc=null,od=null,op=null,of=new Set,oh=!1,om=0;function oy(e){return of.add(e),()=>of.delete(e)}function og(){return oh}let ov=e=>{let t,n,r=(0,y.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,j.useEffect)(t,n),null};function ox(e){let t=new CustomEvent("sanity/dragEnd",{detail:e,cancelable:!0});window.dispatchEvent(t)}let ow=(0,j.createContext)(null);function ob(){let e=(0,j.useContext)(ow);if(!e)throw Error("Schema context is missing");return e}function oE(e,t,n,r){if(!e.type)throw Error("Node type is missing");return()=>t.patch(()=>n5(e,n,r))}function ok(e){let{node:t,doc:n}=e;return n?[{type:"action",label:"Duplicate",icon:rW,action:function(e,t){if(!e.type)throw Error("Node type is missing");return()=>t.patch(async({getSnapshot:t})=>n1(e,await t()))}(t,n),telemetryEvent:"Visual Editing Context Menu Item Duplicated"}]:[]}function o_(e){let{node:t,doc:n}=e;return n?[{type:"action",label:"Remove",icon:rG.RemoveIcon,action:function(e,t){if(!e.type)throw Error("Node type is missing");return()=>t.patch(async({getSnapshot:t})=>n0(e,await t()))}(t,n),telemetryEvent:"Visual Editing Context Menu Item Removed"}]:[]}async function oj(e,t=!0){let{node:n,doc:r}=e;if(!r)return[];let i=[],o=[],[s,a,l,u]=await Promise.all([n2(n,r,"previous"),n2(n,r,"next"),n2(n,r,"first"),n2(n,r,"last")]);return l.length&&o.push({type:"action",label:"To top",icon:rq,action:()=>r.patch(l),telemetryEvent:"Visual Editing Context Menu Item Moved"}),s.length&&o.push({type:"action",label:"Up",icon:rU,action:()=>r.patch(s),telemetryEvent:"Visual Editing Context Menu Item Moved"}),a.length&&o.push({type:"action",label:"Down",icon:rB,action:()=>r.patch(a),telemetryEvent:"Visual Editing Context Menu Item Moved"}),u.length&&o.push({type:"action",label:"To bottom",icon:rY,action:()=>r.patch(u),telemetryEvent:"Visual Editing Context Menu Item Moved"}),o.length&&(i.push({type:"group",label:"Move",icon:rZ,items:o}),t&&i.push({type:"divider"})),i}async function oC(e){let{node:t,field:n,doc:r}=e,i=[];return i.push(...ok(e)),i.push(...o_(e)),i.push(...await oj(e)),i.push({type:"action",label:"Insert before",icon:rz,action:oE(t,r,n.name,"before"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}),i.push({type:"action",label:"Insert after",icon:rF,action:oE(t,r,n.name,"after"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}),i}let oS=e=>{let t,n,r,i,o,s=(0,y.c)(12),{label:a,parent:l,width:u,onSelect:c,boundaryElement:d}=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]!==d||s[3]!==u?(r={arrow:!1,constrainSize:!0,floatingBoundary:d,padding:0,placement:"right-start",fallbackPlacements:t,preventOverflow:!0,width:u,__unstable_margins:n},s[2]=d,s[3]=u,s[4]=r):r=s[4],s[5]!==c||s[6]!==l?(i=(0,m.jsx)(rV,{node:l,onSelect:c}
18),s[5]=c,s[6]=l,s[7]=i):i=s[7],s[8]!==a||s[9]!==r||s[10]!==i?(o=(0,m.jsx)(eO.i,{fontSize:1,icon:rF,padding:2,popover:r,space:2,text:a,children:i}),s[8]=a,s[9]=r,s[10]=i,s[11]=o):o=s[11],o};async function oM(e){let{doc:t,node:n,parent:r}=e,i=[];if(i.push(...ok(e)),i.push(...o_(e)),i.push(...await oj(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,m.jsx)(oS,{label:"Insert before",onSelect:e=>{oE(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,m.jsx)(oS,{label:"Insert after",onSelect:e=>{oE(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:rz,items:r.of.filter(e=>"unionOption"===e.type).map(e=>({type:"action",icon:rP(e),label:"block"===e.name?"Paragraph":e.title||e.name,action:oE(n,t,e.name,"before"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}))}),i.push({type:"group",label:"Insert after",icon:rF,items:r.of.filter(e=>"unionOption"===e.type).map(e=>({type:"action",label:"block"===e.name?"Paragraph":e.title||e.name,icon:rP(e),action:oE(n,t,e.name,"after"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}))});return i}let oI=[-4,4,-4,4];function oT(e){let t,n=(0,y.c)(27),{node:r,onDismiss:i,boundaryElement:o}=e,s=ry();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,m.jsx)(eV.a,{}),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,m.jsx)(eD.MenuItem,{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:oI},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,m.jsx)(oT,{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,m.jsx)(eO.i,{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,m.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 oL=e=>{let t,n,r,i,o,s,a,l,u,c,d,p,f,h,g,v=(0,y.c)(43),{node:x,onDismiss:w,position:b}=e,{x:E,y:k}=b,[_,C]=(0,j.useState)(null),{getField:S}=ob(),{getDocument:M}=nJ();v[0]!==S||v[1]!==x?(t=S(x),v[0]=S,v[1]=x,v[2]=t):t=v[2];let{field:I,parent:T}=t,L=I?.title||I?.name||"Unknown type",[A,R]=(0,j.useState)(void 0);v[3]!==I||v[4]!==M||v[5]!==x||v[6]!==T?(n=()=>{(async()=>{let e=M(x.id);e&&R(await function(e){let{node:t,field:n,parent:r,doc:i}=e;return n?.type==="arrayItem"?oC({node:t,field:n,doc:i}):r?.type==="union"?oM({node:t,parent:r,doc:i}):Promise.resolve([])}({node:x,field:I,parent:T,doc:e}))})()},r=[I,x,T,M],v[3]=I,v[4]=M,v[5]=x,v[6]=T,v[7]=n,v[8]=r):(n=v[7],r=v[8]),(0,j.useEffect)(n,r),v[9]!==E||v[10]!==k?(i={getBoundingClientRect:()=>({bottom:k,left:E,right:E,top:k,width:0,height:0})},v[9]=E,v[10]=k,v[11]=i):i=v[11];let $=i;v[12]!==I?(o=rP(I),v[12]=I,v[13]=o):o=v[13];let N=o;v[14]===Symbol.for("react.memo_cache_sentinel")?(s={minWidth:120,maxWidth:160},v[14]=s):s=v[14],v[15]!==N||v[16]!==A?(a=(0,m.jsx)(eH.Box,{flex:"none",children:A?(0,m.jsx)(eB.Text,{size:1,children:N}):(0,m.jsx)(eU.Spinner,{size:1})}),v[15]=N,v[16]=A,v[17]=a):a=v[17];let P=A?L:"Loading...";v[18]!==P?(l=(0,m.jsx)(eW.Stack,{flex:1,space:2,children:(0,m.jsx)(eB.Text,{size:1,weight:"semibold",children:P})}),v[18]=P,v[19]=l):l=v[19],v[20]!==a||v[21]!==l?(u=(0,m.jsxs)(ez.Flex,{gap:2,padding:2,children:[a,l]}),v[20]=a,v[21]=l,v[22]=u):u=v[22],v[23]!==_||v[24]!==A||v[25]!==w?(c=A&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(eV.a,{}),A.map((e,t)=>(0,m.jsx)(oT,{node:e,onDismiss:w,boundaryElement:_},t))]}),v[23]=_,v[24]=A,v[25]=w,v[26]=c):c=v[26],v[27]!==u||v[28]!==c?(d=(0,m.jsxs)(eF.Menu,{style:s,children:[u,c]}),v[27]=u,v[28]=c,v[29]=d):d=v[29];let O=`${E}-${k}`;return v[30]!==E||v[31]!==k?(p={position:"absolute",left:E,top:k}
18,v[30]=E,v[31]=k,v[32]=p):p=v[32],v[33]!==O||v[34]!==p?(f=(0,m.jsx)("div",{style:p},O),v[33]=O,v[34]=p,v[35]=f):f=v[35],v[36]!==$||v[37]!==d||v[38]!==f?(h=(0,m.jsx)(eq.Popover,{__unstable_margins:oI,arrow:!1,open:!0,placement:"right-start",referenceElement:$,content:d,children:f}),v[36]=$,v[37]=d,v[38]=f,v[39]=h):h=v[39],v[40]!==w||v[41]!==h?(g=(0,m.jsx)(rR,{setBoundaryElement:C,onDismiss:w,children:h}),v[40]=w,v[41]=h,v[42]=g):g=v[42],g},oA=(0,j.createContext)(null),oR=(0,e3.styled)(eZ.Card).withConfig({displayName:"Root",componentId:"sc-e95gnt-0"})(["background-color:var(--overlay-bg);border-radius:3px;pointer-events:none;position:absolute;will-change:transform;box-shadow:var(--overlay-box-shadow);transition:none;--overlay-bg:transparent;--overlay-box-shadow:inset 0 0 0 1px transparent;[data-overlays] &{--overlay-bg:color-mix(in srgb,transparent 95%,var(--card-focus-ring-color));--overlay-box-shadow:inset 0 0 0 2px color-mix(in srgb,transparent 50%,var(--card-focus-ring-color));}[data-fading-out] &{transition:box-shadow 1550ms,background-color 1550ms;--overlay-bg:rgba(0,0,255,0);--overlay-box-shadow:inset 0 0 0 1px transparent;}&[data-focused]{--overlay-box-shadow:inset 0 0 0 1px var(--card-focus-ring-color);}&[data-hovered]:not([data-focused]){transition:none;--overlay-box-shadow:inset 0 0 0 2px var(--card-focus-ring-color);}:link{text-decoration:none;}"]),o$=(0,e3.styled)(ez.Flex).withConfig({displayName:"Actions",componentId:"sc-e95gnt-1"})(["bottom:100%;cursor:pointer;pointer-events:none;position:absolute;right:0;[data-hovered]:not([data-menu-open]) &{pointer-events:all;}[data-flipped] &{bottom:auto;top:100%;}"]),oN=(0,e3.styled)(ez.Flex).withConfig({displayName:"HUD",componentId:"sc-e95gnt-2"})(["top:100%;cursor:pointer;pointer-events:none;position:absolute;left:0;gap:4px;padding:4px 0;flex-wrap:wrap;[data-hovered]:not([data-menu-open]) &{pointer-events:all;}[data-flipped] &{top:calc(100% + 2rem);}"]),oP=(0,e3.styled)(ez.Flex).withConfig({displayName:"MenuWrapper",componentId:"sc-e95gnt-3"})(["margin:-0.5rem;[data-hovered]:not([data-menu-open]) &{pointer-events:all;}"]),oO=(0,e3.styled)(ez.Flex).withConfig({displayName:"Tab",componentId:"sc-e95gnt-4"})(["bottom:100%;cursor:pointer;pointer-events:none;position:absolute;left:0;[data-hovered]:not([data-menu-open]) &{pointer-events:all;}[data-flipped] &{bottom:auto;top:100%;}"]),oV=(0,e3.styled)(eZ.Card).withConfig({displayName:"ActionOpen",componentId:"sc-e95gnt-5"})(["cursor:pointer;background-color:var(--card-focus-ring-color);right:0;border-radius:3px;& [data-ui='Text']{color:#fff;white-space:nowrap;}"]),oD=(0,e3.styled)(ez.Flex).withConfig({displayName:"Labels",componentId:"sc-e95gnt-6"})(["display:flex;align-items:center;background-color:var(--card-focus-ring-color);right:0;border-radius:3px;& [data-ui='Text'],& [data-sanity-icon]{color:#fff;white-space:nowrap;}"]),oH=e3.styled.div.withConfig({displayName:"ExclusivePluginContainer",componentId:"sc-e95gnt-7"})(["position:absolute;inset:0;pointer-events:all;"]),oB=e=>{let t,n,r,i,o,s,a,l,u,c,d,p,f,h,g,v,x,w=(0,y.c)(60),{id:b,element:E,focused:k,componentResolver:_,node:C,showActions:M,draggable:I,targets:T,elementType:L,comlink:A,onActivateExclusivePlugin:R,onMenuOpenChange:$,inFrame:N}=e,{getField:P,getType:O}=ob();w[0]!==O||w[1]!==C?(t=O(C),w[0]=O,w[1]=C,w[2]=t):t=w[2];let V=t;w[3]!==C?(n="path"in C?function(e){let{id:t,type:n,path:r,baseUrl:i,tool:o,workspace:s,perspective:a}=e,[l,u]=(0,S.createEditUrl)({baseUrl:i,workspace:s,tool:o,type:n,id:t,path:r?G(S.studioPath.fromString(r)):[]}).split("?"),c=new URLSearchParams(u),d=a||c.get("perspective");return"drafts"===d?c.delete("perspective"):d&&c.set("perspective",d),`${l}?${c}`}(C):C.href,w[3]=C,w[4]=n):n=w[4];let D=n,H=function(){let e=(0,j.useContext)(oA);if(!e)throw Error("Preview Snapshots context is missing");return e}();t:{let e;if(!("path"in C)){r=void 0;break t}w[5]!==C||w[6]!==H?(e=H.find(e=>e._id===C.id)?.title,w[5]=C,w[6]=H,w[7]=e):e=w[7],r=e}let B=r;w[8]!==E||w[9]!==k||w[10]!==P||w[11]!==O?(i=function(e,t){let n=O(e),{field:r,parent:i}=P(e);if(!("id"in e)||!r||!n)return;let o=r.value.type;return{document:n,element:E,targetElement:t||E,field:r,focused:!!k,node:e,parent:i,type:o}},w[8]=E,w[9]=k,w[10]=P,w[11]=O,w[12]=i):i=w[12];let U=i;if(w[13]!==L||w[14]!==U||w[15]!==C?(o="element"===L?U(C):void 0,w[13]=L,w[14]=U,w[15]=C,w[16]=o):o=w[16],w[17]!==U||w[18]!==T){let e;w[20]!==U?(e=e=>U(e.sanity,e.element),w[20]=U,w[21]=e):e=w[21],s=T.map(e).filter(oF),w[17]=U,w[18]=T,w[19]=s}else s=w[19];w[22]!==o||w[23]!==s?(a={legacyComponentContext:o,pluginContexts:s},w[22]=o,w[23]=s,w[24]=a):a=w[24];let W=a,z=function(e,t){let n,r=(0,y.c)(3);if(r[0]!==e||r[1]!==t){t:{if(!e){n=void 0;break t}let r=t?.(e);if(!r){n=void 0;break t}if((0,j.isValidElement)(r)){n=r;break t}n=(Array.isArray(r)?r:[r]).map(oW)}r[0]=e,r[1]=t,r[2]=n}else n=r[2];return n}(W.legacyComponentContext,_),F=function(e,t){let n,r=(0,y.c)(5);if(r[0]!==e||r[1]!==t){let i;r[3]!==t?(i=e=>{let n={id:eo(),context:e,hud:[],exclusive:[]};return t?.forEach(t=>{t.guard?.(e)&&("hud"===t.type&&n.hud.push(t),"exclusive"===t.type&&n.exclusive.push(t))}),n},r[3]=t,r[4]=i):i=r[4],n=e.map(i),r[0]=e,r[1]=t,r[2]=n}else n=r[2];return n}(W.pluginContexts,e.plugins);w[25]!==V?(l=V?.icon?(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:V.icon}}):(0,m.jsx)(rK,{}),w[25]=V,w[26]=l):l=w[26];let q=l,Z=(0,j.useId)();w[27]!==F?(u=F?.some(oq),w[27]=F,w[28]=u):u=w[28];let Y=u||F?.length>1;w[29]!==b?(c=()=>{window.dispatchEvent(new CustomEvent("sanity-overlay/label-click",{detail:{id:b}}))},w[29]=b,w[30]=c):c=w[30];let K=c;return w[31]!==D||w[32]!==N||w[33]!==M?(d=M?(0,m.jsx)(o$,{gap:1,paddingY:1,children:(0,m.jsx)(oz,{inFrame:N,href:D})}):null,w[31]=D,w[32]=N,w[33]=M,w[34]=d):d=w[34],w[35]!==A||w[36]!==I||w[37]!==K||w[38]!==q||w[39]!==Z||w[40]!==F||w[41]!==R||w[42]!==$||w[43]!==Y||w[44]!==B?(p=(B||Y)&&(0,m.jsx)(oO,{gap:1,paddingY:1,onClick:K,children:(0,m.jsxs)(oD,{gap:2,padding:2,children:[I&&(0,m.jsx)(eH.Box,{marginRight:1,children:(0,m.jsx)(eB.Text,{className:"drag-handle",size:0,children:(0,m.jsx)(rJ,{})})}),(0,m.jsx)(eB.Text,{size:0,children:q}),B&&(0,m.jsx)(eB.Text,{size:1,weight:"medium",children:B}),Y&&(0,m.jsx)(eH.Box,{paddingLeft:2,onClick:oG,children:(0,m.jsx)(oP,{children:(0,m.jsx)(r1.MenuButton,{id:Z,popover:{animate:!0,placement:"bottom-start",constrainSize:!0,tone:"default"},onOpen:()=>{$?.(!0)},onClose:()=>{$?.(!1)},button:(0,m.jsx)(eG.Button,{icon:rX,tone:"primary",padding:2}),menu:(0,m.jsx)(eF.Menu,{paddingY:0,children:(0,m.jsx)(rp,{children:F?.map((e,t)=>(0,m.jsxs)(j.Fragment,{children:[(0,m.jsxs)(eW.Stack,{role:"group",paddingY:1,space:0,children:[(0,m.jsx)(eD.MenuItem,{paddingY:2,text:(0,m.jsx)(eH.Box,{paddingY:2,children:(0,m.jsx)(eB.Text,{muted:!0,size:1,style:{textTransform:"capitalize"},children:`${e.context.document.name}: ${e.context.field?.name}`})}),onClick:()=>{e.context.node&&A?.post("visual-editing/focus",e.context.node)}}),e.exclusive.map(t=>
18t.component?(0,m.jsx)(eD.MenuItem,{paddingY:2,icon:t.icon||(0,m.jsx)(rQ,{}),text:(0,m.jsx)(eH.Box,{paddingY:2,children:(0,m.jsx)(eB.Text,{size:1,children:t.title||t.name})}),onClick:()=>R?.(t,e.context)},t.name):null)]}),t<F.length-1&&(0,m.jsx)(eV.a,{})]},e.id))})})})})})]})}),w[35]=A,w[36]=I,w[37]=K,w[38]=q,w[39]=Z,w[40]=F,w[41]=R,w[42]=$,w[43]=Y,w[44]=B,w[45]=p):p=w[45],w[46]!==F?(f=F?.map(oZ),w[46]=F,w[47]=f):f=w[47],w[48]!==f?(h=(0,m.jsx)(oN,{children:f}),w[48]=f,w[49]=h):h=w[49],w[50]!==d||w[51]!==p||w[52]!==h?(g=(0,m.jsxs)(rp,{children:[d,p,h]}),w[50]=d,w[51]=p,w[52]=h,w[53]=g):g=w[53],w[54]!==z||w[55]!==W.legacyComponentContext?(v=Array.isArray(z)?z.map((e,t)=>{let{component:n,props:r}=e;return(0,m.jsx)(n,{PointerEvents:rp,...W.legacyComponentContext,...r},t)}):z,w[54]=z,w[55]=W.legacyComponentContext,w[56]=v):v=w[56],w[57]!==g||w[58]!==v?(x=(0,m.jsxs)(m.Fragment,{children:[g,v]}),w[57]=g,w[58]=v,w[59]=x):x=w[59],x},oU=(0,j.memo)(function(e){let t,n,r,i,o,s,a,l,u,c,d,p,f,h=(0,y.c)(39),{draggable:g,focused:v,hovered:x,rect:w,wasMaybeCollapsed:b,enableScrollIntoView:E,inFrame:k}=e,_=(0,j.useRef)(null),C=(0,j.useRef)(!1),S=`${w.w}px`,M=`${w.h}px`,I=`translate(${w.x}px, ${w.y}px)`;h[0]!==S||h[1]!==M||h[2]!==I?(t={width:S,height:M,transform:I},h[0]=S,h[1]=M,h[2]=I,h[3]=t):t=h[3];let T=t;h[4]!==E||h[5]!==v||h[6]!==b?(n=()=>{if(!C.current&&!b&&!0===v&&_.current&&E){let e=_.current;(0,r0.default)(_.current,{behavior:t=>{0!==t.length&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},scrollMode:"if-needed",block:"center",inline:"nearest"})}C.current=!0===v},r=[v,b,E],h[4]=E,h[5]=v,h[6]=b,h[7]=n,h[8]=r):(n=h[7],r=h[8]),(0,j.useEffect)(n,r);
18let[L,A]=(0,j.useState)(!1);h[9]!==x?(i=()=>{if(!_.current||!x)return;let e=new IntersectionObserver(e=>{let[t]=e;A(t.boundingClientRect.top<0)},{threshold:1});return e.observe(_.current),()=>e.disconnect()},h[9]=x,h[10]=i):i=h[10],h[11]!==x||h[12]!==L?(o=[x,L],h[11]=x,h[12]=L,h[13]=o):o=h[13],(0,j.useEffect)(i,o);let[R,$]=(0,j.useState)(null);h[14]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{$(null),window.dispatchEvent(new CustomEvent("sanity-overlay/exclusive-plugin-closed"))},h[14]=s):s=h[14];let N=s;h[15]===Symbol.for("react.memo_cache_sentinel")?(a=(e,t)=>{$({plugin:e,context:t})},h[15]=a):a=h[15];let P=a,O=R?.plugin.component,[V,D]=(0,j.useState)(!1);h[16]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{(0,j.startTransition)(()=>D(!1))},h[16]=l):l=h[16],h[17]!==x?(u=[x],h[17]=x,h[18]=u):u=h[18],(0,j.useEffect)(l,u),h[19]!==O||h[20]!==V?(c=V||O?(0,m.jsx)(r$,{onDismiss:N,blockScroll:V}):null,h[19]=O,h[20]=V,h[21]=c):c=h[21];let H=v?"":void 0,B=x?"":void 0,U=L?"":void 0,W=g?"":void 0,z=V?"":void 0;return h[22]!==O||h[23]!==R||h[24]!==x||h[25]!==k||h[26]!==e?(d=O?(0,m.jsx)(oH,{"data-sanity-overlay-element":!0,onClick:oY,children:(0,m.jsx)(O,{...R.context,closeExclusiveView:N})}):x?(0,m.jsx)(oB,{...e,inFrame:k,onActivateExclusivePlugin:P,onMenuOpenChange:D}):null,h[22]=O,h[23]=R,h[24]=x,h[25]=k,h[26]=e,h[27]=d):d=h[27],h[28]!==T||h[29]!==H||h[30]!==B||h[31]!==U||h[32]!==W||h[33]!==z||h[34]!==d?(p=(0,m.jsx)(oR,{"data-focused":H,"data-hovered":B,"data-flipped":U,"data-draggable":W,"data-menu-open":z,ref:_,style:T,children:d}),h[28]=T,h[29]=H,h[30]=B,h[31]=U,h[32]=W,h[33]=z,h[34]=d,h[35]=p):p=h[35],h[36]!==c||h[37]!==p?(f=(0,m.jsxs)(m.Fragment,{children:[c,p]}),h[36]=c,h[37]=p,h[38]=f):f=h[38],f});function oW(e){return"object"==typeof e&&"component"in e?e:{component:e,props:{}}}let oz=(0,j.memo)(function(e){let t,n,r,i=(0,y.c)(8),{inFrame:o}=e,s=(0,j.useSyncExternalStore)(oK,oJ);
18i[0]!==e.href||i[1]!==s?(t=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),i[0]=e.href,i[1]=s,i[2]=t):t=i[2];let a=t,l=o?void 0:"_blank",u=o?"noopener":"noopener noreferrer";return i[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,m.jsx)(oV,{padding:2,children:(0,m.jsx)(eB.Text,{size:1,weight:"medium",children:"Open in Studio"})}),i[3]=n):n=i[3],i[4]!==a||i[5]!==l||i[6]!==u?(r=(0,m.jsx)(eH.Box,{as:"a",href:a,target:l,rel:u,children:n}),i[4]=a,i[5]=l,i[6]=u,i[7]=r):r=i[7],r});function oF(e){return void 0!==e}function oq(e){return e.exclusive.length>0}function oG(e){e.stopPropagation()}function oZ(e){return(0,m.jsx)(j.Fragment,{children:e.hud.map(t=>{let n=t.component;return n?(0,m.jsx)(n,{...e.context},t.name):null})},e.id)}function oY(e){e.stopPropagation()}function oK(e){let t=()=>e();return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)}function oJ(){return window.location.href}let oX=e=>{let t,n=(0,y.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,m.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},oQ=e=>{let t,n=(0,y.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 u=`${a}px`,c=`${l}px`,d=`translate(${o}px, ${s}px)`;return n[0]!==u||n[1]!==c||n[2]!==d?(t=(0,m.jsx)("div",{style:{position:"absolute",width:u,height:c,transform:d,background:"#556bfc",border:"2px solid white",borderRadius:"999px",zIndex:"999999"}}),n[0]=u,n[1]=c,n[2]=d,n[3]=t):t=n[3],t},o1=e3.styled.div.withConfig({displayName:"Root",componentId:"sc-1vb3dia-0"})(["--drag-preview-opacity:0.98;--drag-preview-skeleton-stroke:#ffffff;@media (prefers-color-scheme:dark){--drag-preview-skeleton-stroke:#383d51;}position:fixed;display:grid;transform:",";width:",";height:",";z-index:9999999;opacity:var(--drag-preview-opacity);cursor:move;.drag-preview-content-wrapper{position:relative;width:100%;height:100%;container-type:inline-size;}[data-ui='card']{position:relative;width:100%;height:100%;}.drag-preview-skeleton{position:absolute;inset:0;rect{stroke:var(--drag-preview-skeleton-stroke);}}.drag-preview-handle{position:absolute;top:4cqmin;left:4cqmin;width:6cqmin;fill:var(--drag-preview-handle-fill);}"],({$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})`,({$width:e})=>`${e}px`,({$height:e})=>`${e}px`),o0=e=>{var t,n;let r,i,o,s,a,l,u,c,d,p,f,h,g,v,x,w,b,E,k,_,j,C=(0,y.c)(50),{skeleton:S}=e,M=Math.min(S.maxWidth,window.innerWidth/2),I=S.w>M?M/S.w:1,T=S.offsetX*I,L=S.offsetY*I,A=(0,eY.k)(),R=(0,eK.rt)(),$=R.radius[~~(n=(S.w-0)*((t=R.radius.length-2)-1)/1920+1,n<1?1:n>t?t:n)];if(C[0]!==T||C[1]!==L||C[2]!==A||C[3]!==$||C[4]!==I||C[5]!==S.childRects||C[6]!==S.h||C[7]!==S.w){let e=S.childRects.filter(o5),t=S.childRects.filter(o2);i=o1,s=S.w,a=S.h,l=T,u=L,c=I,r=eZ.Card,h=$,g=4,v="hidden",x="transparent",w=A?"dark":"light",f="drag-preview-content-wrapper",d="drag-preview-skeleton",p=`0 0 ${S.w} ${S.h}`,o=[...e,...t],C[0]=T,C[1]=L,C[2]=A,C[3]=$,C[4]=I,C[5]=S.childRects,C[6]=S.h,C[7]=S.w,C[8]=r,C[9]=i,C[10]=o,C[11]=s,C[12]=a,C[13]=l,C[14]=u,C[15]=c,C[16]=d,C[17]=p,C[18]=f,C[19]=h,C[20]=g,C[21]=v,C[22]=x,C[23]=w}else r=C[8],i=C[9],o=C[10],s=C[11],a=C[12],l=C[13],u=C[14],c=C[15],d=C[16],p=C[17],f=C[18],h=C[19],g=C[20],v=C[21],x=C[22],w=C[23];return C[24]!==o||C[25]!==R.color?(b=o.map((e,t)=>(0,m.jsx)("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:R.color.skeleton.from},t)),C[24]=o,C[25]=R.color,C[26]=b):b=C[26],C[27]!==b||C[28]!==d||C[29]!==p?(E=(0,m.jsx)("svg",{className:d,viewBox:p,children:b}),C[27]=b,C[28]=d,C[29]=p,C[30]=E):E=C[30],C[31]!==E||C[32]!==f?(k=(0,m.jsx)("div",{className:f,children:E}),C[31]=E,C[32]=f,C[33]=k):k=C[33],C[34]!==r||C[35]!==k||C[36]!==h||C[37]!==g||C[38]!==v||C[39]!==x||C[40]!==w?(_=(0,m.jsx)(r,{radius:h,shadow:g,overflow:v,tone
18:x,scheme:w,children:k}),C[34]=r,C[35]=k,C[36]=h,C[37]=g,C[38]=v,C[39]=x,C[40]=w,C[41]=_):_=C[41],C[42]!==i||C[43]!==s||C[44]!==a||C[45]!==l||C[46]!==u||C[47]!==c||C[48]!==_?(j=(0,m.jsx)(i,{$width:s,$height:a,$offsetX:l,$offsetY:u,$scaleFactor:c,children:_}),C[42]=i,C[43]=s,C[44]=a,C[45]=l,C[46]=u,C[47]=c,C[48]=_,C[49]=j):j=C[49],j};function o5(e){return"IMG"===e.tagName}function o2(e){return"IMG"!==e.tagName}let o3=(0,e3.styled)(eZ.Card).withConfig({displayName:"Root",componentId:"sc-1ys1jta-0"})(["position:fixed;bottom:2rem;left:2rem;"]),o4=()=>{let e,t,n=(0,y.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,m.jsx)(o3,{padding:2,shadow:2,radius:2,style:e,children:(0,m.jsxs)(ez.Flex,{align:"center",gap:2,children:[(0,m.jsx)(eJ.s,{keys:["Shift"]}),(0,m.jsx)(eB.Text,{size:1,children:"Zoom Out"}),(0,m.jsx)(r5,{})]})}),n[1]=t):t=n[1],t};function o6(e,t){let{type:n}=t,{contextMenu:r,focusPath:i,perspective:o,variant:s,isDragging:a,dragInsertPosition:l,dragShowMinimap:u,dragShowMinimapPrompt:c,dragSkeleton:d,dragMinimapTransition:p,dragGroupRect:f}=e,h=!1;if("presentation/focus"===n){let n=e.focusPath;n!==(i=t.data.path)&&(h=n.slice(i.length).startsWith("["))}return"presentation/perspective"===n&&(o=t.data.perspective,s=t.data.variant||void 0),"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&&(l=t.insertPosition),"overlay/dragStart"===n&&(a=!0),"overlay/dragUpdateSkeleton"===t.type&&(d=t.skeleton),"overlay/dragEnd"===n&&(a=!1),"overlay/dragToggleMinimapPrompt"===t.type&&(c=t.display),"overlay/dragStartMinimapTransition"===n&&(p=!0),"overlay/dragEndMinimapTransition"===n&&(p=!1),"overlay/dragUpdateGroupRect"===n&&(f=t.groupRect),"overlay/dragToggleMinimap"===n&&(u=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,targets:t.targets,elementType:t.elementType}];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,targets:t.targets,elementType:t.elementType}: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/reset-mouse-state":return e.map(e=>({...e,focused:!1,hovered:!1}));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:l,dragSkeleton:d,dragGroupRect:f,isDragging:a,focusPath:i,perspective:o,variant:s,wasMaybeCollapsed:h,dragShowMinimap:u,dragShowMinimapPrompt:c,dragMinimapTransition:p}}let o8=function(e){let t,n,r,i,o,s,a,l=(0,y.c)(13),{comlink:u,children:c}=e;l[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],l[0]=t):t=l[0];let[d,p]=(0,j.useState)(t);l[1]!==u?(n=async e=>{if(u)try{let t=await u.fetch("visual-editing/preview-snapshots",void 0,{signal:e,suppressWarnings:!0});p(t.snapshots)}catch{}},l[1]=u,l[2]=n):n=l[2];let f=n;return l[3]!==u||l[4]!==f?(r=()=>{if(!u)return;let e=new AbortController,t=u.onStatus(()=>{f(e.signal)},"connected");return()=>{e.abort(),t()}},i=[u,f],l[3]=u,l[4]=f,l[5]=r,l[6]=i):(r=l[5],i=l[6]),(0,j.useEffect)(r,i),l[7]!==u?(o=()=>u?.on("presentation/preview-snapshots",e=>{p(e.snapshots)}),s=[u],l[7]=u,l[8]=o,l[9]=s):(o=l[8],s=l[9]),(0,j.useEffect)(o,s),l[10]!==c||l[11]!==d?(a=(0,m.jsx)(oA.Provider,{value:d,children:c}),l[10]=c,l[11]=d,l[12]=a):a=l[12],a};function o7(e){return"document"===e.type}function o9(e){return"type"===e.type}let se=function(e){let t,n,r,i,o,s,a,l,u,c,d,p=(0,y.c)(22),{comlink:f,children:h,elements:g}=e;p[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Map,p[0]=t):t=p[0];
18let[v,x]=(0,j.useState)(t),[w,b]=(0,j.useState)(null);p[1]!==f?(n=()=>{if(!f)return;let e=async function(e){if(f)try{let t=await f.fetch("visual-editing/schema",void 0,{signal:e,suppressWarnings:!0});b(t.schema)}catch{}},t=new AbortController,n=f.onStatus(()=>{e(t.signal)},"connected");return()=>{t.abort(),n()}},r=[f],p[1]=f,p[2]=n,p[3]=r):(n=p[2],r=p[3]),(0,j.useEffect)(n,r),p[4]===Symbol.for("react.memo_cache_sentinel")?(i=[],p[4]=i):i=p[4];let E=(0,j.useRef)(i),k=(0,j.useDeferredValue)(g);p[5]!==k?(o=k.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},[]),p[5]=k,p[6]=o):o=p[6];let _=o,C=(0,j.useRef)(null);p[7]!==f||p[8]!==_?(s=()=>{if(!_.length||!f)return;let e=async(e,t)=>{let n=E.current;try{E.current=e;let n=await f.fetch("visual-editing/schema-union-types",{paths:e},{signal:t,suppressWarnings:!0});if(t.aborted)return;x(n.types),C.current=null}catch{}t.aborted&&(E.current=n)};_.some(e=>!E.current.find(t=>{let{id:n,path:r}=t;return n===e.id&&r===e.path}))&&(C.current?.abort(),C.current=new AbortController,e(_,C.current.signal))},a=[f,_],p[7]=f,p[8]=_,p[9]=s,p[10]=a):(s=p[9],a=p[10]),(0,j.useEffect)(s,a),p[11]!==w?(l=(e,t)=>{if(!w||"string"!=typeof e&&(!("path"in e)||!Array.isArray(w)))return;let n="string"==typeof e?e:e.type;return w.filter("document"===(t||"document")?o7:o9).find(e=>e.name===n)},p[11]=w,p[12]=l):l=p[12];let S=l;p[13]!==S||p[14]!==v?(u=e=>{if(!("path"in e))return{field:void 0,parent:void 0};let t=S(e);if(!t)return{field:void 0,parent:void 0};let n=e.path.split(".").flatMap(st);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==")?v?.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(S(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}}},p[13]=S,p[14]=v,p[15]=u):u=p[15];let M=u;p[16]!==M||p[17]!==S?(c={getField:M,getType:S},p[16]=M,p[17]=S,p[18]=c):c=p[18];let I=c;return p[19]!==h||p[20]!==I?(d=(0,m.jsx)(ow.Provider,{value:I,children:h}),p[19]=h,p[20]=I,p[21]=d):d=p[21],d};function st(e){return e.includes("[")?e.split(/(\[.+\])/,2):[e]}let sn=(a={},l=new Set,{getState:()=>a,setState:e=>{a=e(a),l.forEach(e=>e())},subscribe:e=>(l.add(e),()=>l.delete(e))}),sr=e=>{let t,n,r,i,o,s,a=(0,y.c)(11),{comlink:l,children:u}=e;a[0]!==l?(t=()=>l?.on("presentation/shared-state",si),n=[l],a[0]=l,a[1]=t,a[2]=n):(t=a[1],n=a[2]),(0,j.useEffect)(t,n),a[3]!==l?(r=()=>{(async function(){let e=await l?.fetch("visual-editing/shared-state",void 0,{suppressWarnings:!0});e&&sn.setState(()=>e.state)})().catch(so)},i=[l],a[3]=l,a[4]=r,a[5]=i):(r=a[4],i=a[5]),(0,j.useEffect)(r,i),a[6]!==l?(o={comlink:l,store:sn},a[6]=l,a[7]=o):o=a[7];let c=o;return a[8]!==u||a[9]!==c?(s=(0,m.jsx)(eP.Provider,{value:c,children:u}),a[8]=u,a[9]=c,a[10]=s):s=a[10],s};function si(e){"value"in e?sn.setState(t=>({...t,[e.key]:e.value})):sn.setState(t=>Object.fromEntries(Object.entries(t).filter(t=>{let[n]=t;return n!==e.key})))}function so(e){console.debug(e),console.warn("[@sanity/visual-editing]: Failed to fetch shared state. Check your version of `sanity` is up-to-date")}let ss=e=>{let t,n,r=(0,y.c)(5),{children:i,comlink:o}=e;r[0]!==o?(t=(e,t)=>
18{if(!o)return;let n=rh[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,m.jsx)(rm.Provider,{value:s,children:i}),r[2]=i,r[3]=s,r[4]=n):n=r[4],n};function sa(){}function sl(e){let{id:t,type:n,projectId:r,dataset:i}=e;return r&&i?{_id:t,_type:n,_projectId:r,_dataset:i}:{_id:t,_type:n}}function su(e){return e.id}let sc=e3.styled.div.withConfig({displayName:"Root",componentId:"sc-dwbgdv-0"})(["background-color:transparent;direction:ltr;inset:0;pointer-events:none;position:absolute;width:100%;height:100%;z-index:",";"],({$zIndex:e})=>e??"9999999");function sd(e){let t,n;return t=requestAnimationFrame(()=>{n=requestAnimationFrame(e)}),()=>{void 0!==t&&cancelAnimationFrame(t),void 0!==n&&cancelAnimationFrame(n)}}let sp=e=>{let t,n,r,i,o,s=(0,y.c)(8),{documentIds:a}=e;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],s[0]=t):t=s[0];let[l,u]=(0,j.useState)(t);s[1]!==a?(n=()=>{(0,j.startTransition)(()=>u(e=>{let t=Array.from(new Set(a));return e.length===t.length&&e.reduce(sC,t)?.length===0?e:t}))},r=[a],s[1]=a,s[2]=n,s[3]=r):(n=s[2],r=s[3]),(0,j.useEffect)(n,r);let c=nz();return s[4]!==c||s[5]!==l?(i=()=>{for(let e of l)c.send({type:"observe",documentId:(0,S.getDraftId)(e)}),c.send({type:"observe",documentId:(0,S.getPublishedId)(e)});return()=>{for(let e of l)c.send({type:"unobserve",documentId:(0,S.getDraftId)(e)}),c.send({type:"unobserve",documentId:(0,S.getPublishedId)(e)})}},o=[c,l],s[4]=c,s[5]=l,s[6]=i,s[7]=o):(i=s[6],o=s[7]),(0,j.useEffect)(i,o),null},sf=e=>{var t;let n,r,i,o,s,a,l,u,c=(0,y.c)(12),{comlink:d,dispatch:p,inFrame:f,inPopUp:h,onDrag:m,overlayEnabled:g,rootElement:v}=e,{dispatchDragEndEvent:x}=function(){let e,t,n,r=(0,y.c)(4),{getDocument:i}=nJ();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}=nQ(n),{path:l,key:u}=nQ(t);l&&u&&u!==s&&e.patch(async e=>{let{getSnapshot:t}=e,i=nU(await t(),n.path);return a?[tp(l,tm({_key:s})),tp(l,tf(i,r,{_key:u}))]:[tp(l,tm(~~s)),tp(l,tf(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,j.useEffect)(e,t),r[3]===Symbol.for("react.memo_cache_sentinel")?(n={dispatchDragEndEvent:ox},r[3]=n):n=r[3],n}(),w=ry();c[0]!==d||c[1]!==p||c[2]!==x||c[3]!==m||c[4]!==w?(n=e=>{if("element/click"===e.type){let{sanity:t}=e;d?.post("visual-editing/focus",t),w("Visual Editing Overlay Clicked",null)}else if("overlay/activate"===e.type)d?.post("visual-editing/toggle",{enabled:!0});else if("overlay/deactivate"===e.type)d?.post("visual-editing/toggle",{enabled:!1});else if("overlay/dragEnd"===e.type){let{insertPosition:t,target:n,dragGroup:r,flow:i,preventInsertDefault:o}=e;x({insertPosition:t,target:n,dragGroup:r,flow:i,preventInsertDefault:o}),t&&w("Visual Editing Drag Sequence Completed",null)}else if("overlay/dragUpdateCursorPosition"===e.type)return void m(e.x,e.y);else if("overlay/dragToggleMinimap"===e.type&&!0===e.display)w("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")}p(e)},c[0]=d,c[1]=p,c[2]=x,c[3]=m,c[4]=w,c[5]=n):n=c[5];let b=(t=n,a=(0,y.c)(7),l=(0,j.useRef)(void 0),u=nZ(),a[0]!==v||a[1]!==t||a[2]!==f||a[3]!==h||a[4]!==u?(o=()=>{if(v)return l.current=function({handler:e,overlayElement:t,inFrame:n,inPopUp:r,optimisticActorReady:i}){let o=!1,s=new Map,a=new WeakMap,l=new Set,u=new WeakMap,c=new WeakMap,d,p,f,h=!1,m=[],y=()=>m[m.length-1];function g(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)}
18function v({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}),d.observe(o),e({type:"element/activate",id:t})}function x({id:t,elements:n,handlers:r}){let{element:i,measureElement:o}=n;g(i,r),d.unobserve(o),m=m.filter(e=>e!==i),e({type:"element/deactivate",id:t})}function w(t){if(!(!n&&!r||!i))for(let n of m){if(t===n){let n=a.get(t)?.sanity;if(!n||!eT(n))return;if(eN(t,n,l,a)){let n=t.style.cursor;n&&c.set(t,n),e({type:"overlay/setCursor",element:t,cursor:"move"});continue}}b(n)}}function b(t){let n=c.get(t);e({type:"overlay/setCursor",element:t,cursor:n})}function E(c){for(let d of function e(t){let n=[];function r(e,t,n,r){let i=ee(t);if(!i)return;let o=function e(t){let{display:n}=window.getComputedStyle(t);if("inline"!==n)return t;let r=t.parentElement;return r?e(r):null}(e);if(o)return{elements:{element:e,measureElement:o},sanity:i,reason:n,preventGrouping:r}}if(t)for(let i of t.childNodes)!function t(i,o){let s=function(t){let{nodeType:n,parentElement:i,textContent:o}=t;if(t.nodeType===Node.ELEMENT_NODE&&t.dataset?.sanityEditTarget!==void 0){let n=eL(e(t).map(e=>"element"===e.type?e.commonSanity:void 0).filter(e=>void 0!==e));if(n)return{reason:"edit-target",elements:{element:t,measureElement:t},sanity:n}}else if(n===Node.TEXT_NODE&&i&&o){let e=eI(o);return e?r(i,e,"stega-text",!0):void 0}else if(t.nodeType===Node.ELEMENT_NODE){if("SCRIPT"===t.tagName||"SANITY-VISUAL-EDITING"===t.tagName)return;if(t.dataset?.sanity)return r(t,t.dataset.sanity,"data-attribute",!!(t.textContent&&eS(t.textContent)));if(t.dataset?.sanityEditInfo)return r(t,t.dataset.sanityEditInfo,"data-attribute",!!(t.textContent&&eS(t.textContent)));if("IMG"===t.tagName){let e=eI(t.alt,!0);return e?r(t,e,"stega-attribute"):void 0}if("TIME"===t.tagName){let e=eI(t.dateTime,!0);return e?r(t,e,"stega-attribute"):void 0}if("SVG"===t.tagName.toUpperCase()){if(!t.ariaLabel)return;let e=eI(t.ariaLabel,!0);return e?r(t,e,"stega-attribute"):void 0}}}(i),a=o;if(i.nodeType===Node.ELEMENT_NODE&&i.dataset?.sanityEditGroup!==void 0&&(a={type:"group",elements:{element:i,measureElement:i},targets:[]},n.push(a)),s){let e={elements:s.elements,sanity:s.sanity,reason:s.reason};a&&!s.preventGrouping?a.targets.push(e):n.push({elements:s.elements,type:"element",targets:[e]})}if(i.nodeType===Node.ELEMENT_NODE&&"IMG"!==i.tagName&&"SCRIPT"!==i.tagName&&"SANITY-VISUAL-EDITING"!==i.tagName)for(let e of i.childNodes)t(e,a)}(i,void 0);return n.map(e=>{if(0===e.targets.length&&"group"===e.type)return{...e,commonSanity:void 0};let t=1===e.targets.length?e.targets[0].sanity:eL(e.targets.map(({sanity:e})=>e).filter(e=>void 0!==e))||e.targets[0].sanity;return t?{...e,commonSanity:t}:null}).filter(e=>null!==e)}(c)){if("group"===d.type){for(let e of d.targets){let t=a.get(e.elements.element);t&&"element"===t.type&&k(e.elements.element)}0===d.targets.length&&k(d.elements.element)}if(!d.commonSanity)continue;let{element:c}=d.elements;a.has(c)?function(t){let{element:n}=t.elements,r=a.get(n);r&&(a.set(n,{...r,sanity:t.commonSanity}),e({type:"element/update",elementType:r.type,id:r.id,rect:es(n),sanity:t.commonSanity,targets:t.targets.map(e=>({sanity:e.sanity,element:e.elements.element}))}))}(d):function({type:c,elements:d,commonSanity:f,targets:g}){let{element:x,measureElement:E}=d,k={click(t){let r=t.target;if(x===y()&&x.contains(r)){n&&(t.preventDefault(),t.stopPropagation());let r=a.get(x)?.sanity;r&&!h&&e({type:"element/click",id:_,sanity:r})}},contextmenu(t){if(!("path"in f)||!n&&!r||!i||!f.path.split(".").pop()?.includes("[_key=="))return;let o=t.target;x===y()&&x.contains(o)&&((n||r)&&(t.preventDefault(),t.stopPropagation()),e({type:"element/contextmenu",id:_,position:{x:t.clientX,y:t.clientY},sanity:f}))},mousedown(t){if(t.preventDefault(),t.currentTarget!==m.at(-1)||x.getAttribute("data-sanity-drag-disable")||!n&&!r||!i)return;let o=a.get(x)?.sanity;if(!o||!eT(o)||!eA(o.path))return;let s=eN(x,f,l,a);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=>es(e.elements.element)),c=r.getAttribute("data-sanity-drag-flow")||((t=u).some(e=>t.filter(t=>!el(e,t)).some(t=>e.y===t.y))?"horizontal":"vertical"),d=r.getAttribute("data-sanity-drag-group"),p=!!r.getAttribute("data-sanity-drag-minima
18p-disable"),f=!!r.getAttribute("data-sanity-drag-prevent-default"),h=r.getAttribute("data-unstable_sanity-drag-document-height"),m=r.getAttribute("data-unstable_sanity-drag-group-height"),y=null,g=em(n),v=document.body,{minYScaled:x,scaleFactor:w}=function(e,t){let n=t||ep(e).height,r=(n+=200)>window.innerHeight?window.innerHeight/n:1,{min:i}=ep(e.map(e=>ed(e,r,{x:window.innerWidth/2,y:0})));return{scaleFactor:r,minYScaled:i-100*r}}(u,m?~~m:null),b=!1,E=!1,k=!0;ew||(e_={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}},ek=h?~~h:document.documentElement.scrollHeight);let _=setInterval(()=>{u=i.map(e=>es(e.elements.element))},150),j=()=>{w>=1||(o({type:"overlay/dragUpdateSkeleton",skeleton:ey(eE,r,w)}),o({type:"overlay/dragToggleMinimapPrompt",display:!1}),eg(v,w,x,o,150).then(()=>{setTimeout(()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:ev(u)})},300)}))},C=e=>{Math.abs(e.deltaY)>=10&&w<1&&!ew&&!E&&!p&&k&&(o({type:"overlay/dragToggleMinimapPrompt",display:!0}),E=!0),!e.shiftKey||ew||p||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),ew=!0,setTimeout(()=>{j()},50))},S=e=>{if(e.preventDefault(),eb=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}}(eE=em(e)),4>Math.abs(eu(eE,g)))return;if(!b){let e=ev(u),t=ey(eE,r,1);o({type:"overlay/dragStart",flow:c}),o({type:"overlay/dragUpdateSkeleton",skeleton:t}),o({type:"overlay/dragUpdateGroupRect",groupRect:e}),b=!0,a()}o({type:"overlay/dragUpdateCursorPosition",x:eE.x,y:eE.y}),!e.shiftKey||ew||p||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),ew=!0,setTimeout(()=>{j()},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:ec(r,t,n),right:ec(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:ec(r,t,n),bottom:ec(i,t,n)}}}(eE,u,c);JSON.stringify(y)!==JSON.stringify(t)&&o({type:"overlay/dragUpdateInsertPosition",insertPosition:eh(i,y=t,c)})},M=()=>{k=!1,o({type:"overlay/dragEnd",target:s,insertPosition:y?eh(i,y,c):null,dragGroup:d,flow:c,preventInsertDefault:f}),E&&o({type:"overlay/dragToggleMinimapPrompt",display:!1}),ew||(clearInterval(_),l(),R(),A()),L()},I=e=>{"Shift"===e.key&&ew&&(ew=!1,o({type:"overlay/dragUpdateSkeleton",skeleton:ey(eE,r,1/w)}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{ex(eb.y,v,ek,o,150,e_)},50),o({type:"overlay/dragUpdateGroupRect",groupRect:null}),k||(clearInterval(_),L(),R(),A(),l()))},T=()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:null}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{ex(eb.y,v,ek,o,150,e_).then(()=>{ew=!1})},50),clearInterval(_),L(),R(),A(),l()},L=()=>{window.removeEventListener("mousemove",S),window.removeEventListener("wheel",C),window.removeEventListener("mouseup",M)},A=()=>{window.removeEventListener("keyup",I)},R=()=>{window.removeEventListener("blur",T)};window.addEventListener("blur",T),window.addEventListener("keyup",I),window.addEventListener("wheel",C),window.addEventListener("mousemove",S),window.addEventListener("mouseup",M)}({element:x,handler:e,mouseEvent:t,overlayGroup:s,target:o,onSequenceStart:()=>{h=!0},onSequenceEnd:()=>{setTimeout(()=>{h=!1},250)}})},mousemove(e){k.mouseenter(e);let t=e.currentTarget;t&&(t.addEventListener("mouseenter",k.mouseenter),t.addEventListener("mouseleave",k.mouseleave))},mouseenter(){document.querySelector("vercel-live-feedback")&&x.closest("[data-vercel-edit-info]")||x.closest("[data-vercel-edit-target]")||(m.push(x),e({type:"element/mouseenter",id:_,rect:es(x)}),w(x))},mouseleave(n){function r(){m.pop();let t=y();if(e({type:"element/mouseleave",id:_}),t){w(t);let n=a.get(t);n&&e({type:"element/mouseenter",id:n.id,rect:es(t)})}b(x)}let{relatedTarget:i}=n,o=eC(i),s=t.contains(o);if(ej(o)&&s)return function e(t){let n=i=>{let{relatedTarget:o}=i;eC(o)?o&&ej(o)&&(t.removeEventListener("mouseleave",n),e(o)):(t.removeEventListener("mouseleave",n),r())};t.addEventListener("mouseleave",n)}(o);r()}},_=eo(),j={type:c,id:_,elements:d,sanity:f,handlers:k};l.add(x),u.set(E,x),s.set(_,x),a.set(x,j),p?.observe(x),e({type:"element/register",elementType:c,id:_,element:x,rect:es(x),sanity:f,dragDisabled:!!x.getAttribute("data-sanity-drag-disable"),targets:g.map(e=>({sanity:e.sanity,element:e.elements.element}))}),o&&v(j)}(d)}}function k(t){let n=a.get(t);if(n){let{id:r,handlers:i}=n;g(t,i),d.unobserve(t),a.delete(t),l.delete(t),s.delete(r),e({type:"element/unregister",id:r})}}function _(t){let n=a.get(t);n&&e({type:"element/updateRect",id:n.id,rect:es(t)})}function j(e){if(o)for(let t of e){let{target:e}=t,n=ej(e)&&a.get(e);n&&(t.isIntersecting?v(n):x(n))}}function C(t){let n=eC(t.target);if(n){"capture"===n.dataset.sanityOverlayElement&&(t.preventDefault(),t.stopPropagation());return}m=[],e({type:"overlay/blur"})}function S(){m=[],e({type:"overlay/reset-mouse-state"})}function M(){for(let e of l)_(e)}function I(t){"Escape"===t.key&&(m=[],e({type:"overlay/blur"}))}function T(e){let{target:t}=e;if(!(t===window.document||!ej(t)))for(let e of l)t.contains(e)&&_(e)}function L(){o||(p=new IntersectionObserver(j,{threshold:.3}
18),l.forEach(e=>p.observe(e)),e({type:"overlay/activate"}),o=!0)}function A(){o&&(p?.disconnect(),l.forEach(e=>{let t=a.get(e);t&&x(t)}),e({type:"overlay/deactivate"}),o=!1)}function R(t){let{id:n}=t.detail,r=s.get(n);if(!r)return;let i=a.get(r)?.sanity;i&&e({type:"element/click",id:n,sanity:i})}return window.document.fonts.ready.then(()=>{for(let e of l)_(e)}),window.addEventListener("click",C),window.addEventListener("contextmenu",C),window.addEventListener("sanity-overlay/exclusive-plugin-closed",S),window.addEventListener("sanity-overlay/label-click",R),window.addEventListener("keydown",I),window.addEventListener("resize",M),window.addEventListener("scroll",T,{capture:!0,passive:!0}),d=new ResizeObserver(function(e){for(let t of e){let e=t.target;if(ej(e)){let t=u.get(e);if(!t)return;_(t)}}}),(f=new MutationObserver(function(e){let n=!1;for(let r of e){let{target:e,type:i}=r,o="characterData"===i?e.parentElement:e;if(!(o===t||t.contains(o))&&(n=!0,ej(o))){let e=o.parentElement?.closest("[data-sanity-edit-group]")||null;E({childNodes:[ej(e)?e:o]})}}if(n)for(let e of l)e.isConnected||k(e),a.get(e)?.type!=="group"||e.hasAttribute("data-sanity-edit-group")||k(e)})).observe(document.body,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),E(document.body),L(),{activate:L,deactivate:A,destroy:function(){window.removeEventListener("click",C),window.removeEventListener("contextmenu",C),window.removeEventListener("sanity-overlay/exclusive-plugin-closed",S),window.removeEventListener("sanity-overlay/label-click",R),window.removeEventListener("keydown",I),window.removeEventListener("resize",M),window.removeEventListener("scroll",T),f.disconnect(),d.disconnect(),l.forEach(e=>{k(e)}),s.clear(),l.clear(),m=[],A()}}}({handler:t,overlayElement:v,inFrame:f,inPopUp:h,optimisticActorReady:u}),()=>{l.current?.destroy(),l.current=void 0}},s=[v,t,f,h,u],a[0]=v,a[1]=t,a[2]=f,a[3]=h,a[4]=u,a[5]=o,a[6]=s):(o=a[5],s=a[6]),(0,j.useEffect)(o,s),l);return c[6]!==b.current||c[7]!==g?(r=()=>{g?b.current?.activate():b.current?.deactivate()},c[6]=b.current,c[7]=g,c[8]=r):r=c[8],c[9]!==b||c[10]!==g?(i=[b,g],c[9]=b,c[10]=g,c[11]=i):i=c[11],(0,j.useEffect)(r,i),null};function sh(e){let t,n,r,i,o,s,a,l,u,c,d,p,f,h,g,v,x,w,b,E,k,_,C,S,M,I,T,L,A,R,$,N,P,O,V,D,H=(0,y.c)(77),{comlink:B,comlinkStatus:U,componentResolver:W,inFrame:z,inPopUp:F,zIndex:q,onPerspectiveChange:G,onVariantChange:Z}=e,Y=(0,eY.k)();H[0]===Symbol.for("react.memo_cache_sentinel")?(t={contextMenu:null,dragInsertPosition:null,dragShowMinimap:!1,dragShowMinimapPrompt:!1,dragSkeleton:null,elements:[],focusPath:"",isDragging:!1,perspective:"published",variant:void 0,wasMaybeCollapsed:!1,dragMinimapTransition:!1,dragGroupRect:null},H[0]=t):t=H[0];let[K,J]=(0,j.useReducer)(o6,t),{contextMenu:X,dragInsertPosition:Q,dragShowMinimap:ee,dragShowMinimapPrompt:et,dragSkeleton:en,elements:er,isDragging:ei,perspective:eo,variant:es,wasMaybeCollapsed:ea,dragMinimapTransition:el,dragGroupRect:eu}=K,[ec,ed]=(0,j.useState)(null),[ep,ef]=(0,j.useState)(!0);H[1]!==B?(n=()=>{let e=[B?.on("presentation/focus",e=>{J({type:"presentation/focus",data:e})}),B?.on("presentation/blur",e=>{J({type:"presentation/blur",data:e})}),B?.on("presentation/toggle-overlay",()=>{ef(sk)})].filter(Boolean);return()=>e.forEach(sE)},r=[B],H[1]=B,H[2]=n,H[3]=r):(n=H[2],r=H[3]),(0,j.useEffect)(n,r),T=(0,y.c)(14),L=!!G,A=!!Z,T[0]!==J||T[1]!==G||T[2]!==Z?(S=e=>{J({type:"presentation/perspective",data:e}),G?.(e.perspective),Z?.(e.variant||void 0)},T[0]=J,T[1]=G,T[2]=Z,T[3]=S):S=T[3],R=(0,j.useEffectEvent)(S),T[4]!==B||T[5]!==R||T[6]!==L||T[7]!==A?(M=()=>{let e=new AbortController;B?.fetch("visual-editing/fetch-perspective",{handlesPerspectiveChange:L,handlesVariantChange:A},{signal:e.signal,suppressWarnings:!0}).then(e=>{R(e)}).catch(sa);let t=B?.on("presentation/perspective",e=>{R(e)});return()=>{t?.(),e.abort()}},T[4]=B,T[5]=R,T[6]=L,T[7]=A,T[8]=M):M=T[8],T[9]!==B||T[10]!==J||T[11]!==L||T[12]!==A?(I=[B,J,L,A],T[9]=B,T[10]=J,T[11]=L,T[12]=A,T[13]=I):I=T[13],(0,j.useEffect)(M,I),O=(0,y.c)(8),V=(0,j.useRef)(void 0),O[0]!==B?($=(e,t,n
18)=>{B?.post("visual-editing/documents",{documents:e,perspective:t,variant:n})},O[0]=B,O[1]=$):$=O[1],D=$,O[2]!==er||O[3]!==eo||O[4]!==D||O[5]!==es?(N=()=>{let e,t,n=(e=[...er].sort((e,t)=>{let n=e.rect.y-t.rect.y;return 0!==n?n:e.rect.x-t.rect.x}),t=new Set,e.reduce((e,n)=>{let{sanity:r}=n;return!(!r||!("id"in r)||t.has(r.id))&&(t.add(r.id),e.push(r)),e},[])),r=n.map(su),i=V.current?.orderedIds;if(!i||i.length!==r.length||r.some((e,t)=>e!==i[t])||eo!==V.current?.perspective||es!==V.current?.variant){let e=n.map(sl);V.current={orderedIds:r,perspective:eo,variant:es},D(e,eo,es)}},P=[er,eo,es,D],O[2]=er,O[3]=eo,O[4]=D,O[5]=es,O[6]=N,O[7]=P):(N=O[6],P=O[7]),(0,j.useEffect)(N,P),H[4]!==ec?(i=(e,t)=>{ec&&(ec.style.setProperty("--drag-preview-x",`${e}px`),ec.style.setProperty("--drag-preview-y",`${t-window.scrollY}px`))},H[4]=ec,H[5]=i):i=H[5];let eh=i;H[6]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{let e=!1,t=t=>{sj(t)&&e&&(e=!1,ef(sw))},n=t=>{var n,r;if(sj(t)){if(t.ctrlKey||t.metaKey||t.shiftKey)return;e||(e=!0,ef(sx))}n=["mod","\\"],r=t,n.every(e=>s_[e]?r[s_[e]]:r.key===e.toUpperCase())&&ef(sv)},r=()=>{e&&(e=!1,ef(sg))};return window.addEventListener("click",sb),window.addEventListener("keydown",n),window.addEventListener("keyup",t),window.addEventListener("blur",r),()=>{window.removeEventListener("click",sb),window.removeEventListener("keydown",n),window.removeEventListener("keyup",t),window.removeEventListener("blur",r)}},s=[ef],H[6]=o,H[7]=s):(o=H[6],s=H[7]),(0,j.useEffect)(o,s);
18let[em,ey]=(0,j.useState)(!1),[eg,ev]=(0,j.useState)(!1),ex=(0,j.useRef)(void 0);H[8]!==ep?(a=()=>{if(ep)return sd(()=>{ey(!0),sd(()=>{ev(!0),ex.current=setTimeout(()=>{ev(!1),ey(!1)},1500)})});ex.current&&(clearTimeout(ex.current),(0,j.startTransition)(()=>{ey(!1),ev(!1)}))},l=[ep],H[8]=ep,H[9]=a,H[10]=l):(a=H[9],l=H[10]),(0,j.useEffect)(a,l),H[11]!==er?(u=er.flatMap(sy),H[11]=er,H[12]=u):u=H[12];let ew=u;H[13]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{J({type:"overlay/blur"})},H[13]=c):c=H[13];let eb=c,eE=nZ(),ek=eE?W:void 0,[e_,ej]=(0,j.useState)(!1);!e_&&z&&"connected"===U&&ej(!0);t:{let t;if(ei){let e;H[14]===Symbol.for("react.memo_cache_sentinel")?(e=[],H[14]=e):e=H[14],d=e;break t}H[15]!==B||H[16]!==ek||H[17]!==el||H[18]!==ee||H[19]!==er||H[20]!==z||H[21]!==ei||H[22]!==eE||H[23]!==e.plugins||H[24]!==e_||H[25]!==ea?(t=er.filter(sm).map(t=>{let{id:n,element:r,focused:i,hovered:o,rect:s,sanity:a,dragDisabled:l,targets:u,elementType:c}=t,d=!l&&!!r.getAttribute("data-sanity")&&eE&&er.some(e=>"id"in e.sanity&&"id"in a&&e$(e.sanity,a)&&e.sanity.path!==a.path);return(0,m.jsx)(oU,{comlink:B,componentResolver:ek,plugins:e.plugins,element:r,enableScrollIntoView:!ei&&!el&&!ee,id:n,focused:i,hovered:o,node:a,rect:s,showActions:!e_,draggable:d,isDragging:ei||el,wasMaybeCollapsed:i&&ea,targets:u,elementType:c,inFrame:z},n)}),H[15]=B,H[16]=ek,H[17]=el,H[18]=ee,H[19]=er,H[20]=z,H[21]=ei,H[22]=eE,H[23]=e.plugins,H[24]=e_,H[25]=ea,H[26]=t):t=H[26],d=t}let eC=d,eS=Y?"dark":"light",eM=eg?"":void 0,eI=em?"":void 0;return H[27]!==ew||H[28]!==eo?(p=(0,m.jsx)(sp,{documentIds:ew,perspective:eo}),H[27]=ew,H[28]=eo,H[29]=p):p=H[29],H[30]!==B||H[31]!==z||H[32]!==F||H[33]!==ep||H[34]!==ec||H[35]!==eh?(f=(0,m.jsx)(sf,{comlink:B,dispatch:J,inFrame:z,inPopUp:F,onDrag:eh,overlayEnabled:ep,rootElement:ec}),H[30]=B,H[31]=z,H[32]=F,H[33]=ep,H[34]=ec,H[35]=eh,H[36]=f):f=H[36],H[37]!==X?(h=X&&(0,m.jsx)(oL,{...X,onDismiss:eb}),H[37]=X,H[38]=h):h=H[38],H[39]!==eu||H[40]!==Q||H[41]!==el||H[42]!==et||H[43]!==ei?(g=ei&&!el&&(0,m.jsxs)(m.Fragment,{children:[Q&&(0,m.jsx)(oQ,{dragInsertPosition:Q}),et&&(0,m.jsx)(o4,{}),eu&&(0,m.jsx)(oX,{dragGroupRect:eu})]}),H[39]=eu,H[40]=Q,H[41]=el,H[42]=et,H[43]=ei,H[44]=g):g=H[44],H[45]!==en||H[46]!==ei?(v=ei&&en&&(0,m.jsx)(o0,{skeleton:en}),H[45]=en,H[46]=ei,H[47]=v):v=H[47],H[48]!==eC||H[49]!==eM||H[50]!==eI||H[51]!==p||H[52]!==f||H[53]!==h||H[54]!==g||H[55]!==v||H[56]!==q?(x=(0,m.jsxs)(sc,{"data-fading-out":eM,"data-overlays":eI,ref:ed,$zIndex:q,children:[p,f,h,eC,g,v]}),H[48]=eC,H[49]=eM,H[50]=eI,H[51]=p,H[52]=f,H[53]=h,H[54]=g,H[55]=v,H[56]=q,H[57]=x):x=H[57],H[58]!==B||H[59]!==x?(w=(0,m.jsx)(sr,{comlink:B,children:x}),H[58]=B,H[59]=x,H[60]=w):w=H[60],H[61]!==B||H[62]!==w?(b=(0,m.jsx)(o8,{comlink:B,children:w}),H[61]=B,H[62]=w,H[63]=b):b=H[63],H[64]!==B||H[65]!==er||H[66]!==b?(E=(0,m.jsx)(se,{comlink:B,elements:er,children:b}),H[64]=B,H[65]=er,H[66]=b,H[67]=E):E=H[67],H[68]!==ec||H[69]!==E?(k=(0,m.jsx)(eX.b,{children:(0,m.jsx)(eQ.h,{element:ec,children:E})}),H[68]=ec,H[69]=E,H[70]=k):k=H[70],H[71]!==eS||H[72]!==k?(_=(0,m.jsx)(e1.ThemeProvider,{scheme:eS,theme:e0.Ft,tone:"transparent",children:k}),H[71]=eS,H[72]=k,H[73]=_):_=H[73],H[74]!==B||H[75]!==_?(C=(0,m.jsx)(ss,{comlink:B,children:_}),H[74]=B,H[75]=_,H[76]=C):C=H[76],C}function sm(e){return e.activated||e.focused}function sy(e){return"id"in e.sanity?[e.sanity.id]:[]}function sg(e){return!e}function sv(e){return!e}function sx(e){return!e}function sw(e){return!e}function sb(e){let t=e.target;if(((0,e5.vt)(t)||(0,e2.bt)(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 sE(e){return e()}function sk(e){return!e}let s_={alt:"altKey",ctrl:"ctrlKey",mod:"u">typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function sj(e){return"Alt"===e.key}function sC(e,t){return e.filter(e=>e!==t)}let sS=e=>{let t,n,r=(0,y.c)(4),{comlink:i,refresh:o}=e,s=(0,j.useRef)(0),a=(0,j.useRef)(0);return r[0]!==i||r[1]!==o?(t=()=>i.on("presentation/refresh",e=>{if("manual"===e.source){clearTimeout(s.current);
18let t=o(e);if(!1===t)return;i.post("visual-editing/refreshing",e);let n=!1;s.current=window.setTimeout(()=>{i.post("visual-editing/refreshed",e),n=!0},3e3),t?.finally?.(()=>{n||(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,j.useEffect)(t,n),null};function sM(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 sI(){console.warn("[@sanity/visual-editing] Package version mismatch detected: Please update your Sanity studio to prevent potential compatibility issues.")}function sT(){}let sL=(0,j.lazy)(()=>e.A(295347)),sA=e=>{var t;let n,r,i,o,s,a,l,u,c,d,p,f,h,v,x,w,b,S,M,I=(0,y.c)(44),{components:T,plugins:L,history:A,keepStegaOnCopy:R,portal:$,refresh:N,zIndex:P,onPerspectiveChange:O,onVariantChange:V,onSuspiciousStega:D}=e,H=void 0===$||$,[B,U]=(0,j.useState)(null),[W,z]=(0,j.useState)(null);I[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{(0,j.startTransition)(()=>{U(k()),z(_())})},r=[],I[0]=n,I[1]=r):(n=I[0],r=I[1]),(0,j.useEffect)(n,r),I[2]!==R?(i=()=>{if(!R)return document.addEventListener("copy",i5),()=>{document.removeEventListener("copy",i5)}},o=[R],I[2]=R,I[3]=i,I[4]=o):(i=I[3],o=I[4]),(0,j.useEffect)(i,o),I[5]!==D?(s=e=>D?.(e),I[5]=D,I[6]=s):s=I[6];let F=(0,j.useEffectEvent)(s),q="function"==typeof D;I[7]!==F||I[8]!==q?(a=()=>{if(q){let e,t,n,r,i,o,s,a,l,u;return e=new Set,t=[],n=[],r=!1,i=null,o=!1,s=(n,r,i,o)=>{let s=eM(o),a=`${n}|${i??""}|${s}`;e.has(a)||(e.add(a),t.push({kind:n,element:r,attribute:i,value:o,cleaned:s,sanity:function(e){try{let t=(0,et.vercelStegaDecode)(e);return t&&"object"==typeof t&&"sanity.io"===t.origin?ee(t)??t:void 0}catch{return}}(o)}))},a=()=>{if(i=null,!o){if(r||(r=!0,function(e){let{documentElement:t,head:n,body:r}=document;t&&i9(t,!1,e),n&&on(n,!0,e),r&&on(r,!1,e),function(e){let t=location.href;if(eS(t))return e("url",void 0,void 0,t);try{let n=decodeURIComponent(t);eS(n)&&e("url",void 0,void 0,n)}catch{}}(e)}(s)),n.length>0)for(let e of n.splice(0))!function(e,t){let{target:n,type:r}=e;if(!(!n.isConnected||i6(n)))if("attributes"===r){if(i3(n)&&e.attributeName){let r=n.getAttributeNS(e.attributeNamespace,e.attributeName);i7(n,e.attributeName,r,i8(n),t)}}else if("characterData"===r)oe(n,i8(n),t);else for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];!r||!r.isConnected||i6(r)||on(r,i8(r),t)}}(e,s);t.length>0&&F(t.splice(0))}},l=()=>{i||o||(i=function(e){if("function"==typeof requestIdleCallback){let t=requestIdleCallback(e,{timeout:1e3});return()=>cancelIdleCallback(t)}let t=setTimeout(e,0);return()=>clearTimeout(t)}(a))},(u=new MutationObserver(e=>{for(let t of e)n.push(t);l()})).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),l(),()=>{o=!0,u.disconnect(),i?.(),i=null}}},I[7]=F,I[8]=q,I[9]=a):a=I[9],I[10]!==q?(l=[q],I[10]=q,I[11]=l):l=I[11],(0,j.useEffect)(a,l);let[G,Z]=(0,j.useState)(null);I[12]!==H?(u=()=>{if(!1===H)return;let e=document.createElement("sanity-visual-editing");return document.documentElement.appendChild(e),(0,j.startTransition)(()=>Z(e)),()=>{(0,j.startTransition)(()=>Z(null)),document.documentElement.contains(e)&&document.documentElement.removeChild(e)}},c=[H],I[12]=H,I[13]=u,I[14]=c):(u=I[13],c=I[14]),(0,j.useEffect)(u,c);let[Y,K]=function(e){let t,n,r,i,o,s=(0,y.c)(9),a=void 0===e||e,[l,u]=(0,j.useState)(),[c,d]=(0,j.useState)("idle");return s[0]!==a?(t=()=>{if(!a)return;let e=(0,g.createNode)({name:"visual-editing",connectTo:"presentation"},(0,g.createNodeMachine)().provide({actors:E()})),t=e.onStatus(()=>d("connected"),"connected");(0,j.startTransition)(()=>u(e));let n=e.start();return()=>{t(),n(),(0,j.startTransition)(()=>u(void 0))}},n=[a],s[0]=a,s[1]=t,s[2]=n):(t=s[1],n=s[2]),(0,j.useEffect)(t,n),s[3]!==c?(r=()=>{if("connected"===c)return;let e=new AbortController;return window.addEventListener("message",sM,{signal:e.signal}),()=>{e.abort()}},i=[c],s[3]=c,s[4]=r,s[5]=i):(r=s[4],i=s[5]),(0,j.useEffect)(r,i),s[6]!==l||s[7]!==c?(o=[l,c],s[6]=l,s[7]=c,s[8]=o):o=s[8],o}(!0===B||!0===W);t="connected"===K?Y:void 0,(M=(0,y.c)(3))[0]!==t?(b=()=>{let e,n;if(!t)return;let r=(e=new r2.ReplaySubject(1),n=new r3.Subject,t.fetch("visual-editing/snapshot-welcome",void 0,{suppressWarnings:!0}).then(t=>{e.next(t.event)}).catch(()=>{}
18),t.on("presentation/snapshot-event",t=>{"reconnect"===t.event.type&&e.next(t.event),"mutation"===t.event.type&&n.next(t.event)}),(0,r4.merge)(e,n)),i=tU(i0(t),{input:{client:{withConfig:sT},sharedListener:r}});i.start();let o=new AbortController;return t.fetch("visual-editing/features",void 0,{signal:o.signal,suppressWarnings:!0}).then(e=>{e.features.optimistic&&nV(i)}).catch(sI),()=>{i.stop(),o.abort()}},S=[t],M[0]=t,M[1]=b,M[2]=S):(b=M[1],S=M[2]),(0,j.useEffect)(b,S);let J=(0,j.useDeferredValue)((0,j.useSyncExternalStore)(oy,og,sR),!1);I[15]!==K||I[16]!==B||I[17]!==W?(d=()=>{if("connected"===K)oo(W?"presentation-window":"presentation-iframe");else if(B||W){let e=setTimeout(s$,1e3);return()=>{clearTimeout(e),oo(null)}}else oo("standalone");return sN},p=[K,W,B],I[15]=K,I[16]=B,I[17]=W,I[18]=d,I[19]=p):(d=I[18],p=I[19]),(0,j.useEffect)(d,p),I[20]!==Y||I[21]!==K||I[22]!==T||I[23]!==B||I[24]!==W||I[25]!==O||I[26]!==V||I[27]!==L||I[28]!==P?(f=null!==B&&null!==W&&(0,m.jsx)(sh,{comlink:Y,comlinkStatus:K,componentResolver:T,onPerspectiveChange:O,onVariantChange:V,plugins:L,inFrame:B,inPopUp:W,zIndex:P}),I[20]=Y,I[21]=K,I[22]=T,I[23]=B,I[24]=W,I[25]=O,I[26]=V,I[27]=L,I[28]=P,I[29]=f):f=I[29],I[30]!==Y||I[31]!==A||I[32]!==N?(h=Y&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(os,{comlink:Y,history:A}),(0,m.jsx)(ov,{comlink:Y}),N&&(0,m.jsx)(sS,{comlink:Y,refresh:N})]}),I[30]=Y,I[31]=A,I[32]=N,I[33]=h):h=I[33],I[34]!==K||I[35]!==J?(v="connected"===K&&J&&(0,m.jsx)(j.Suspense,{children:(0,m.jsx)(sL,{})}),I[34]=K,I[35]=J,I[36]=v):v=I[36],I[37]!==f||I[38]!==h||I[39]!==v?(x=(0,m.jsxs)(m.Fragment,{children:[f,h,v]}),I[37]=f,I[38]=h,I[39]=v,I[40]=x):x=I[40];let X=x;return!1!==H&&G?(I[41]!==X||I[42]!==G?(w=(0,C.createPortal)(X,G),I[41]=X,I[42]=G,I[43]=w):w=I[43],w):X};function sR(){return!1}function s$(){return oo("standalone")}function sN(){return oo(null)}sA.displayName="VisualEditing",e.s(["VisualEditing",0,sA,"addQueryListener",0,function(){if(om++,!oh)for(let e of(oh=!0,of))e();return()=>{if(0==--om&&oh)for(let e of(oh=!1,of))e()}},"comlink",()=>ol,"comlinkDataset",()=>oc,"comlinkPerspective",()=>od,"comlinkProjectId",()=>ou,"comlinkVariant",()=>op,"getSnapshot",0,function(){return oi},"setLoaderClientConfig",0,function(e,t){for(let n of(ou=e,oc=t,oa))n()},"setLoaderComlink",0,function(e){for(let t of(ol=e,oa))t()},"setLoaderPerspective",0,function(e){for(let t of(od=e,oa))t()},"setLoaderVariant",0,function(e){for(let t of(op=e,oa))t()},"subscribe",0,function(e){return or.add(e),()=>{or.delete(e)}},"subscribe$1",0,function(e){return oa.add(e),()=>oa.delete(e)}],302791)}]);
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.