smoodly 0.0.45 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/addresses.d.ts +6 -7
- package/dist/addresses.js +6 -4
- package/dist/admin/PublicSans-LICENSE.txt +93 -0
- package/dist/admin/auth-config.d.ts +6 -0
- package/dist/admin/auth-config.js +1 -0
- package/dist/admin/browser/fetch-op.d.ts +10 -0
- package/dist/admin/browser/fetch-op.js +44 -0
- package/dist/admin/browser/main.d.ts +1 -0
- package/dist/admin/browser/main.js +21 -0
- package/dist/admin/custom-section.d.ts +1 -1
- package/dist/admin/drift.d.ts +1 -1
- package/dist/admin/editor/EditorView.js +14 -14
- package/dist/admin/editor/autosave.js +1 -1
- package/dist/admin/editor/canvas-address.d.ts +2 -0
- package/dist/admin/editor/canvas-address.js +8 -0
- package/dist/admin/editor/overlay-geometry.d.ts +1 -1
- package/dist/admin/editor/protocol.d.ts +18 -4
- package/dist/admin/editor/protocol.js +15 -1
- package/dist/admin/editor/useCanvasBridge.d.ts +1 -1
- package/dist/admin/editor/useCanvasBridge.js +5 -6
- package/dist/admin/editor/useInlineSession.js +4 -2
- package/dist/admin/files.d.ts +11 -0
- package/dist/admin/files.generated.js +2 -0
- package/dist/admin/files.js +8 -0
- package/dist/admin/forms/useRefOptions.d.ts +2 -2
- package/dist/admin/forms/useRefOptions.js +2 -2
- package/dist/admin/forms/useRichtextEditor.js +4 -4
- package/dist/admin/handler.d.ts +40 -0
- package/dist/admin/handler.js +151 -0
- package/dist/admin/index.d.ts +1 -1
- package/dist/admin/ops-impl.d.ts +7 -1
- package/dist/admin/ops-impl.js +110 -33
- package/dist/admin/ops.d.ts +3 -2
- package/dist/admin/page-data.d.ts +21 -0
- package/dist/admin/page-data.js +4 -0
- package/dist/admin/page.d.ts +6 -0
- package/dist/admin/page.js +35 -0
- package/dist/admin/serialize.js +7 -7
- package/dist/admin/shell/AdminApp.js +2 -2
- package/dist/admin/shell/EntryForm.js +1 -1
- package/dist/admin/shell/router.d.ts +3 -16
- package/dist/admin/shell/router.js +3 -39
- package/dist/admin/shell/session.d.ts +2 -5
- package/dist/admin/supabase-auth.js +1 -1
- package/dist/admin/tree-ops.d.ts +1 -1
- package/dist/admin/ui/fonts.d.ts +12 -0
- package/dist/admin/ui/fonts.js +22 -0
- package/dist/admin/ui/theme.d.ts +13 -4
- package/dist/admin/ui/theme.js +28 -157
- package/dist/assemble.d.ts +60 -0
- package/dist/assemble.js +359 -0
- package/dist/astro/cache.d.ts +34 -0
- package/dist/astro/cache.js +69 -0
- package/dist/astro/components/Custom.astro +21 -0
- package/dist/astro/components/Guarded.astro +24 -0
- package/dist/astro/components/Head.astro +26 -0
- package/dist/astro/components/Image.astro +20 -0
- package/dist/astro/components/RichText.astro +23 -0
- package/dist/astro/components/Section.astro +20 -0
- package/dist/astro/components/Video.astro +5 -0
- package/dist/astro/components/Zone.astro +19 -0
- package/dist/astro/components.d.ts +6 -0
- package/dist/astro/components.js +7 -0
- package/dist/astro/content-loaders.d.ts +40 -0
- package/dist/astro/content-loaders.js +100 -0
- package/dist/astro/content.d.ts +9 -0
- package/dist/astro/content.js +17 -0
- package/dist/astro/custom.d.ts +1 -0
- package/dist/astro/custom.js +3 -0
- package/dist/astro/defaults.d.ts +20 -0
- package/dist/astro/defaults.js +21 -0
- package/dist/astro/env-files.d.ts +1 -0
- package/dist/astro/env-files.js +21 -0
- package/dist/astro/head.d.ts +13 -0
- package/dist/astro/head.js +19 -0
- package/dist/astro/image.d.ts +27 -0
- package/dist/astro/image.js +29 -0
- package/dist/astro/index.d.ts +43 -0
- package/dist/astro/index.js +111 -0
- package/dist/astro/locale-paths.d.ts +30 -0
- package/dist/astro/locale-paths.js +38 -0
- package/dist/astro/middleware.d.ts +1 -0
- package/dist/astro/middleware.js +83 -0
- package/dist/astro/preview-document.d.ts +1 -0
- package/dist/astro/preview-document.js +18 -0
- package/dist/astro/preview.d.ts +10 -0
- package/dist/astro/preview.js +72 -0
- package/dist/astro/richtext.d.ts +15 -0
- package/dist/astro/richtext.js +78 -0
- package/dist/astro/routes/admin.d.ts +3 -0
- package/dist/astro/routes/admin.js +41 -0
- package/dist/astro/routes/page.astro +17 -0
- package/dist/astro/routes/preview.astro +11 -0
- package/dist/astro/runtime.d.ts +32 -0
- package/dist/astro/runtime.js +46 -0
- package/dist/astro/scope.d.ts +45 -0
- package/dist/astro/scope.js +103 -0
- package/dist/astro/server.d.ts +14 -0
- package/dist/astro/server.js +45 -0
- package/dist/astro/shell.d.ts +67 -0
- package/dist/astro/shell.js +63 -0
- package/dist/astro/style.d.ts +1 -0
- package/dist/astro/style.js +11 -0
- package/dist/astro/views-check.d.ts +3 -0
- package/dist/astro/views-check.js +19 -0
- package/dist/astro/zone.d.ts +39 -0
- package/dist/astro/zone.js +33 -0
- package/dist/bind.d.ts +19 -0
- package/dist/bind.js +34 -0
- package/dist/bridge/bridge.d.ts +9 -0
- package/dist/bridge/bridge.js +107 -0
- package/dist/bridge/entry.d.ts +1 -0
- package/dist/bridge/entry.js +5 -0
- package/dist/bridge/preview-pill.d.ts +18 -0
- package/dist/bridge/preview-pill.js +115 -0
- package/dist/cli/import.d.ts +3 -0
- package/dist/cli/import.js +10 -1
- package/dist/cli/load-collections.js +4 -3
- package/dist/cli/load-config.d.ts +4 -0
- package/dist/cli/load-config.js +26 -0
- package/dist/cli/main.d.ts +5 -1
- package/dist/cli/main.js +24 -6
- package/dist/cli/migrate.d.ts +3 -0
- package/dist/cli/migrate.js +8 -1
- package/dist/cli/rebuild.d.ts +23 -0
- package/dist/cli/rebuild.js +22 -0
- package/dist/cli/space-io.d.ts +15 -1
- package/dist/cli/space-io.js +14 -0
- package/dist/client.js +5 -0
- package/dist/config.d.ts +28 -20
- package/dist/config.js +71 -75
- package/dist/content/content-api.d.ts +1 -1
- package/dist/content/node.d.ts +2 -3
- package/dist/content/node.js +2 -1
- package/dist/crash-message.d.ts +1 -0
- package/dist/crash-message.js +8 -0
- package/dist/css.d.ts +4 -0
- package/dist/css.js +5 -2
- package/dist/custom/CustomSection.d.ts +1 -1
- package/dist/custom/CustomSection.js +4 -8
- package/dist/custom/css.js +2 -2
- package/dist/custom/index.d.ts +6 -10
- package/dist/custom/index.js +1 -2
- package/dist/custom/layout.d.ts +5 -0
- package/dist/custom/layout.js +14 -0
- package/dist/entry-page.d.ts +3 -18
- package/dist/env.js +1 -1
- package/dist/global-id.js +2 -2
- package/dist/global.d.ts +5 -2
- package/dist/global.js +8 -5
- package/dist/image/next-config.d.ts +3 -0
- package/dist/image/next-config.js +12 -7
- package/dist/image/remote-pattern.d.ts +1 -0
- package/dist/image/remote-pattern.js +5 -0
- package/dist/index.d.ts +15 -17
- package/dist/index.js +10 -19
- package/dist/marks.d.ts +7 -0
- package/dist/marks.js +7 -0
- package/dist/next/admin-route.d.ts +7 -0
- package/dist/next/admin-route.js +28 -0
- package/dist/next/bridge.d.ts +1 -0
- package/dist/next/bridge.js +26 -0
- package/dist/next/canvas-boundary.d.ts +1 -1
- package/dist/next/canvas-slot.d.ts +1 -0
- package/dist/next/canvas-slot.js +4 -3
- package/dist/next/index.d.ts +2 -0
- package/dist/next/index.js +1 -0
- package/dist/next/page-renderer.d.ts +5 -1
- package/dist/next/page-renderer.js +19 -33
- package/dist/next/preview-pill-define.d.ts +1 -0
- package/dist/next/preview-pill-define.js +10 -0
- package/dist/next/preview-pill.d.ts +0 -3
- package/dist/next/preview-pill.js +7 -50
- package/dist/next/queries.d.ts +3 -28
- package/dist/next/queries.js +3 -90
- package/dist/next/reads.d.ts +2 -0
- package/dist/next/reads.js +18 -0
- package/dist/page-context.d.ts +89 -0
- package/dist/page-context.js +8 -0
- package/dist/pairing.d.ts +2 -22
- package/dist/project.d.ts +69 -0
- package/dist/project.js +210 -0
- package/dist/published.d.ts +96 -0
- package/dist/published.js +125 -0
- package/dist/react.d.ts +61 -0
- package/dist/react.js +17 -0
- package/dist/read-shapes.d.ts +1 -1
- package/dist/reads.d.ts +80 -0
- package/dist/reads.js +142 -0
- package/dist/refs.d.ts +1 -1
- package/dist/registration.d.ts +8 -0
- package/dist/registration.js +17 -0
- package/dist/render.d.ts +5 -83
- package/dist/render.js +5 -10
- package/dist/resolve.d.ts +1 -1
- package/dist/richtext/index.d.ts +6 -2
- package/dist/richtext/index.js +3 -2
- package/dist/richtext-href.d.ts +4 -0
- package/dist/richtext-href.js +17 -0
- package/dist/richtext-render.js +1 -14
- package/dist/schema-version.d.ts +1 -1
- package/dist/schema-version.js +1 -1
- package/dist/section-crash.d.ts +2 -2
- package/dist/section-crash.js +2 -7
- package/dist/section-wrapper.d.ts +3 -10
- package/dist/section-wrapper.js +3 -2
- package/dist/site.d.ts +38 -14
- package/dist/site.js +159 -286
- package/dist/smd-key.d.ts +9 -0
- package/dist/smd-key.js +1 -0
- package/dist/sql-space.d.ts +4 -0
- package/dist/sql-space.js +10 -5
- package/dist/sql.d.ts +2 -0
- package/dist/sql.js +117 -0
- package/dist/store.d.ts +1 -1
- package/dist/supabase-published-store.d.ts +35 -0
- package/dist/supabase-published-store.js +215 -0
- package/dist/supabase-store.d.ts +1 -1
- package/dist/toolset.d.ts +2 -4
- package/dist/toolset.js +6 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/view-props.d.ts +40 -0
- package/dist/view-props.js +1 -0
- package/dist/views.d.ts +36 -0
- package/dist/views.js +52 -0
- package/dist/zones.d.ts +7 -7
- package/dist/zones.js +7 -6
- package/migrations/20261007120000_smoodly_v8.sql +154 -0
- package/migrations/20261007200000_smoodly_v9.sql +30 -0
- package/package.json +46 -19
- package/dist/admin/next/bridge.d.ts +0 -2
- package/dist/admin/next/bridge.js +0 -129
- package/dist/admin/next/create-admin.d.ts +0 -19
- package/dist/admin/next/create-admin.js +0 -44
- package/dist/admin/next/index.d.ts +0 -8
- package/dist/admin/next/index.js +0 -8
- package/dist/admin/next/op-handler.d.ts +0 -18
- package/dist/admin/next/op-handler.js +0 -31
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Generated by scripts/build-admin.ts — do not edit.
|
|
2
|
+
export const adminFiles = {"hash":"25c333c01930","files":{"admin.js":{"type":"text/javascript; charset=utf-8","body":"var vq=Object.create;var LT=Object.defineProperty;var xq=Object.getOwnPropertyDescriptor;var wq=Object.getOwnPropertyNames;var Sq=Object.getPrototypeOf,kq=Object.prototype.hasOwnProperty;var br=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}};var Cq=(t,e,n,r)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let o of wq(e))!kq.call(t,o)&&o!==n&<(t,o,{get:()=>e[o],enumerable:!(r=xq(e,o))||r.enumerable});return t};var T=(t,e,n)=>(n=t!=null?vq(Sq(t)):{},Cq(e||!t||!t.__esModule?LT(n,\"default\",{value:t,enumerable:!0}):n,t));var NT=br(Et=>{\"use strict\";function mS(t,e){var n=t.length;t.push(e);e:for(;0<n;){var r=n-1>>>1,o=t[r];if(0<xy(o,e))t[r]=e,t[n]=o,n=r;else break e}}function us(t){return t.length===0?null:t[0]}function Sy(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var r=0,o=t.length,s=o>>>1;r<s;){var a=2*(r+1)-1,i=t[a],l=a+1,u=t[l];if(0>xy(i,n))l<o&&0>xy(u,i)?(t[r]=u,t[l]=n,r=l):(t[r]=i,t[a]=n,r=a);else if(l<o&&0>xy(u,n))t[r]=u,t[l]=n,r=l;else break e}}return e}function xy(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}Et.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(AT=performance,Et.unstable_now=function(){return AT.now()}):(fS=Date,ET=fS.now(),Et.unstable_now=function(){return fS.now()-ET});var AT,fS,ET,Zs=[],Qa=[],Lq=1,fo=null,jn=3,gS=!1,vp=!1,xp=!1,yS=!1,IT=typeof setTimeout==\"function\"?setTimeout:null,MT=typeof clearTimeout==\"function\"?clearTimeout:null,TT=typeof setImmediate<\"u\"?setImmediate:null;function wy(t){for(var e=us(Qa);e!==null;){if(e.callback===null)Sy(Qa);else if(e.startTime<=t)Sy(Qa),e.sortIndex=e.expirationTime,mS(Zs,e);else break;e=us(Qa)}}function bS(t){if(xp=!1,wy(t),!vp)if(us(Zs)!==null)vp=!0,gc||(gc=!0,mc());else{var e=us(Qa);e!==null&&vS(bS,e.startTime-t)}}var gc=!1,wp=-1,_T=5,OT=-1;function DT(){return yS?!0:!(Et.unstable_now()-OT<_T)}function pS(){if(yS=!1,gc){var t=Et.unstable_now();OT=t;var e=!0;try{e:{vp=!1,xp&&(xp=!1,MT(wp),wp=-1),gS=!0;var n=jn;try{t:{for(wy(t),fo=us(Zs);fo!==null&&!(fo.expirationTime>t&&DT());){var r=fo.callback;if(typeof r==\"function\"){fo.callback=null,jn=fo.priorityLevel;var o=r(fo.expirationTime<=t);if(t=Et.unstable_now(),typeof o==\"function\"){fo.callback=o,wy(t),e=!0;break t}fo===us(Zs)&&Sy(Zs),wy(t)}else Sy(Zs);fo=us(Zs)}if(fo!==null)e=!0;else{var s=us(Qa);s!==null&&vS(bS,s.startTime-t),e=!1}}break e}finally{fo=null,jn=n,gS=!1}e=void 0}}finally{e?mc():gc=!1}}}var mc;typeof TT==\"function\"?mc=function(){TT(pS)}:typeof MessageChannel<\"u\"?(hS=new MessageChannel,RT=hS.port2,hS.port1.onmessage=pS,mc=function(){RT.postMessage(null)}):mc=function(){IT(pS,0)};var hS,RT;function vS(t,e){wp=IT(function(){t(Et.unstable_now())},e)}Et.unstable_IdlePriority=5;Et.unstable_ImmediatePriority=1;Et.unstable_LowPriority=4;Et.unstable_NormalPriority=3;Et.unstable_Profiling=null;Et.unstable_UserBlockingPriority=2;Et.unstable_cancelCallback=function(t){t.callback=null};Et.unstable_forceFrameRate=function(t){0>t||125<t?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):_T=0<t?Math.floor(1e3/t):5};Et.unstable_getCurrentPriorityLevel=function(){return jn};Et.unstable_next=function(t){switch(jn){case 1:case 2:case 3:var e=3;break;default:e=jn}var n=jn;jn=e;try{return t()}finally{jn=n}};Et.unstable_requestPaint=function(){yS=!0};Et.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=jn;jn=t;try{return e()}finally{jn=n}};Et.unstable_scheduleCallback=function(t,e,n){var r=Et.unstable_now();switch(typeof n==\"object\"&&n!==null?(n=n.delay,n=typeof n==\"number\"&&0<n?r+n:r):n=r,t){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,t={id:Lq++,callback:e,priorityLevel:t,startTime:n,expirationTime:o,sortIndex:-1},n>r?(t.sortIndex=n,mS(Qa,t),us(Zs)===null&&t===us(Qa)&&(xp?(MT(wp),wp=-1):xp=!0,vS(bS,n-r))):(t.sortIndex=o,mS(Zs,t),vp||gS||(vp=!0,gc||(gc=!0,mc()))),t};Et.unstable_shouldYield=DT;Et.unstable_wrapCallback=function(t){var e=jn;return function(){var n=jn;jn=e;try{return t.apply(this,arguments)}finally{jn=n}}}});var BT=br((tae,PT)=>{\"use strict\";PT.exports=NT()});var WT=br(Ce=>{\"use strict\";var SS=Symbol.for(\"react.transitional.element\"),Aq=Symbol.for(\"react.portal\"),Eq=Symbol.for(\"react.fragment\"),Tq=Symbol.for(\"react.strict_mode\"),Rq=Symbol.for(\"react.profiler\"),Iq=Symbol.for(\"react.consumer\"),Mq=Symbol.for(\"react.context\"),_q=Symbol.for(\"react.forward_ref\"),Oq=Symbol.for(\"react.suspense\"),Dq=Symbol.for(\"react.memo\"),UT=Symbol.for(\"react.lazy\"),Nq=Symbol.for(\"react.activity\"),zT=Symbol.iterator;function Pq(t){return t===null||typeof t!=\"object\"?null:(t=zT&&t[zT]||t[\"@@iterator\"],typeof t==\"function\"?t:null)}var jT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qT=Object.assign,VT={};function bc(t,e,n){this.props=t,this.context=e,this.refs=VT,this.updater=n||jT}bc.prototype.isReactComponent={};bc.prototype.setState=function(t,e){if(typeof t!=\"object\"&&typeof t!=\"function\"&&t!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,t,e,\"setState\")};bc.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,\"forceUpdate\")};function KT(){}KT.prototype=bc.prototype;function kS(t,e,n){this.props=t,this.context=e,this.refs=VT,this.updater=n||jT}var CS=kS.prototype=new KT;CS.constructor=kS;qT(CS,bc.prototype);CS.isPureReactComponent=!0;var FT=Array.isArray;function wS(){}var bt={H:null,A:null,T:null,S:null},GT=Object.prototype.hasOwnProperty;function LS(t,e,n){var r=n.ref;return{$$typeof:SS,type:t,key:e,ref:r!==void 0?r:null,props:n}}function Bq(t,e){return LS(t.type,e,t.props)}function AS(t){return typeof t==\"object\"&&t!==null&&t.$$typeof===SS}function zq(t){var e={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+t.replace(/[=:]/g,function(n){return e[n]})}var HT=/\\/+/g;function xS(t,e){return typeof t==\"object\"&&t!==null&&t.key!=null?zq(\"\"+t.key):e.toString(36)}function Fq(t){switch(t.status){case\"fulfilled\":return t.value;case\"rejected\":throw t.reason;default:switch(typeof t.status==\"string\"?t.then(wS,wS):(t.status=\"pending\",t.then(function(e){t.status===\"pending\"&&(t.status=\"fulfilled\",t.value=e)},function(e){t.status===\"pending\"&&(t.status=\"rejected\",t.reason=e)})),t.status){case\"fulfilled\":return t.value;case\"rejected\":throw t.reason}}throw t}function yc(t,e,n,r,o){var s=typeof t;(s===\"undefined\"||s===\"boolean\")&&(t=null);var a=!1;if(t===null)a=!0;else switch(s){case\"bigint\":case\"string\":case\"number\":a=!0;break;case\"object\":switch(t.$$typeof){case SS:case Aq:a=!0;break;case UT:return a=t._init,yc(a(t._payload),e,n,r,o)}}if(a)return o=o(t),a=r===\"\"?\".\"+xS(t,0):r,FT(o)?(n=\"\",a!=null&&(n=a.replace(HT,\"$&/\")+\"/\"),yc(o,e,n,\"\",function(u){return u})):o!=null&&(AS(o)&&(o=Bq(o,n+(o.key==null||t&&t.key===o.key?\"\":(\"\"+o.key).replace(HT,\"$&/\")+\"/\")+a)),e.push(o)),1;a=0;var i=r===\"\"?\".\":r+\":\";if(FT(t))for(var l=0;l<t.length;l++)r=t[l],s=i+xS(r,l),a+=yc(r,e,n,s,o);else if(l=Pq(t),typeof l==\"function\")for(t=l.call(t),l=0;!(r=t.next()).done;)r=r.value,s=i+xS(r,l++),a+=yc(r,e,n,s,o);else if(s===\"object\"){if(typeof t.then==\"function\")return yc(Fq(t),e,n,r,o);throw e=String(t),Error(\"Objects are not valid as a React child (found: \"+(e===\"[object Object]\"?\"object with keys {\"+Object.keys(t).join(\", \")+\"}\":e)+\"). If you meant to render a collection of children, use an array instead.\")}return a}function ky(t,e,n){if(t==null)return t;var r=[],o=0;return yc(t,r,\"\",\"\",function(s){return e.call(n,s,o++)}),r}function Hq(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var $T=typeof reportError==\"function\"?reportError:function(t){if(typeof window==\"object\"&&typeof window.ErrorEvent==\"function\"){var e=new window.ErrorEvent(\"error\",{bubbles:!0,cancelable:!0,message:typeof t==\"object\"&&t!==null&&typeof t.message==\"string\"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process==\"object\"&&typeof process.emit==\"function\"){process.emit(\"uncaughtException\",t);return}console.error(t)},$q={map:ky,forEach:function(t,e,n){ky(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return ky(t,function(){e++}),e},toArray:function(t){return ky(t,function(e){return e})||[]},only:function(t){if(!AS(t))throw Error(\"React.Children.only expected to receive a single React element child.\");return t}};Ce.Activity=Nq;Ce.Children=$q;Ce.Component=bc;Ce.Fragment=Eq;Ce.Profiler=Rq;Ce.PureComponent=kS;Ce.StrictMode=Tq;Ce.Suspense=Oq;Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=bt;Ce.__COMPILER_RUNTIME={__proto__:null,c:function(t){return bt.H.useMemoCache(t)}};Ce.cache=function(t){return function(){return t.apply(null,arguments)}};Ce.cacheSignal=function(){return null};Ce.cloneElement=function(t,e,n){if(t==null)throw Error(\"The argument must be a React element, but you passed \"+t+\".\");var r=qT({},t.props),o=t.key;if(e!=null)for(s in e.key!==void 0&&(o=\"\"+e.key),e)!GT.call(e,s)||s===\"key\"||s===\"__self\"||s===\"__source\"||s===\"ref\"&&e.ref===void 0||(r[s]=e[s]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var a=Array(s),i=0;i<s;i++)a[i]=arguments[i+2];r.children=a}return LS(t.type,o,r)};Ce.createContext=function(t){return t={$$typeof:Mq,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:Iq,_context:t},t};Ce.createElement=function(t,e,n){var r,o={},s=null;if(e!=null)for(r in e.key!==void 0&&(s=\"\"+e.key),e)GT.call(e,r)&&r!==\"key\"&&r!==\"__self\"&&r!==\"__source\"&&(o[r]=e[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var i=Array(a),l=0;l<a;l++)i[l]=arguments[l+2];o.children=i}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return LS(t,s,o)};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(t){return{$$typeof:_q,render:t}};Ce.isValidElement=AS;Ce.lazy=function(t){return{$$typeof:UT,_payload:{_status:-1,_result:t},_init:Hq}};Ce.memo=function(t,e){return{$$typeof:Dq,type:t,compare:e===void 0?null:e}};Ce.startTransition=function(t){var e=bt.T,n={};bt.T=n;try{var r=t(),o=bt.S;o!==null&&o(n,r),typeof r==\"object\"&&r!==null&&typeof r.then==\"function\"&&r.then(wS,$T)}catch(s){$T(s)}finally{e!==null&&n.types!==null&&(e.types=n.types),bt.T=e}};Ce.unstable_useCacheRefresh=function(){return bt.H.useCacheRefresh()};Ce.use=function(t){return bt.H.use(t)};Ce.useActionState=function(t,e,n){return bt.H.useActionState(t,e,n)};Ce.useCallback=function(t,e){return bt.H.useCallback(t,e)};Ce.useContext=function(t){return bt.H.useContext(t)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(t,e){return bt.H.useDeferredValue(t,e)};Ce.useEffect=function(t,e){return bt.H.useEffect(t,e)};Ce.useEffectEvent=function(t){return bt.H.useEffectEvent(t)};Ce.useId=function(){return bt.H.useId()};Ce.useImperativeHandle=function(t,e,n){return bt.H.useImperativeHandle(t,e,n)};Ce.useInsertionEffect=function(t,e){return bt.H.useInsertionEffect(t,e)};Ce.useLayoutEffect=function(t,e){return bt.H.useLayoutEffect(t,e)};Ce.useMemo=function(t,e){return bt.H.useMemo(t,e)};Ce.useOptimistic=function(t,e){return bt.H.useOptimistic(t,e)};Ce.useReducer=function(t,e,n){return bt.H.useReducer(t,e,n)};Ce.useRef=function(t){return bt.H.useRef(t)};Ce.useState=function(t){return bt.H.useState(t)};Ce.useSyncExternalStore=function(t,e,n){return bt.H.useSyncExternalStore(t,e,n)};Ce.useTransition=function(){return bt.H.useTransition()};Ce.version=\"19.2.8\"});var te=br((rae,XT)=>{\"use strict\";XT.exports=WT()});var YT=br(rr=>{\"use strict\";var Uq=te();function JT(t){var e=\"https://react.dev/errors/\"+t;if(1<arguments.length){e+=\"?args[]=\"+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+=\"&args[]=\"+encodeURIComponent(arguments[n])}return\"Minified React error #\"+t+\"; visit \"+e+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}function ei(){}var nr={d:{f:ei,r:function(){throw Error(JT(522))},D:ei,C:ei,L:ei,m:ei,X:ei,S:ei,M:ei},p:0,findDOMNode:null},jq=Symbol.for(\"react.portal\");function qq(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:jq,key:r==null?null:\"\"+r,children:t,containerInfo:e,implementation:n}}var Sp=Uq.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Cy(t,e){if(t===\"font\")return\"\";if(typeof e==\"string\")return e===\"use-credentials\"?e:\"\"}rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=nr;rr.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(JT(299));return qq(t,e,null,n)};rr.flushSync=function(t){var e=Sp.T,n=nr.p;try{if(Sp.T=null,nr.p=2,t)return t()}finally{Sp.T=e,nr.p=n,nr.d.f()}};rr.preconnect=function(t,e){typeof t==\"string\"&&(e?(e=e.crossOrigin,e=typeof e==\"string\"?e===\"use-credentials\"?e:\"\":void 0):e=null,nr.d.C(t,e))};rr.prefetchDNS=function(t){typeof t==\"string\"&&nr.d.D(t)};rr.preinit=function(t,e){if(typeof t==\"string\"&&e&&typeof e.as==\"string\"){var n=e.as,r=Cy(n,e.crossOrigin),o=typeof e.integrity==\"string\"?e.integrity:void 0,s=typeof e.fetchPriority==\"string\"?e.fetchPriority:void 0;n===\"style\"?nr.d.S(t,typeof e.precedence==\"string\"?e.precedence:void 0,{crossOrigin:r,integrity:o,fetchPriority:s}):n===\"script\"&&nr.d.X(t,{crossOrigin:r,integrity:o,fetchPriority:s,nonce:typeof e.nonce==\"string\"?e.nonce:void 0})}};rr.preinitModule=function(t,e){if(typeof t==\"string\")if(typeof e==\"object\"&&e!==null){if(e.as==null||e.as===\"script\"){var n=Cy(e.as,e.crossOrigin);nr.d.M(t,{crossOrigin:n,integrity:typeof e.integrity==\"string\"?e.integrity:void 0,nonce:typeof e.nonce==\"string\"?e.nonce:void 0})}}else e==null&&nr.d.M(t)};rr.preload=function(t,e){if(typeof t==\"string\"&&typeof e==\"object\"&&e!==null&&typeof e.as==\"string\"){var n=e.as,r=Cy(n,e.crossOrigin);nr.d.L(t,n,{crossOrigin:r,integrity:typeof e.integrity==\"string\"?e.integrity:void 0,nonce:typeof e.nonce==\"string\"?e.nonce:void 0,type:typeof e.type==\"string\"?e.type:void 0,fetchPriority:typeof e.fetchPriority==\"string\"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy==\"string\"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet==\"string\"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes==\"string\"?e.imageSizes:void 0,media:typeof e.media==\"string\"?e.media:void 0})}};rr.preloadModule=function(t,e){if(typeof t==\"string\")if(e){var n=Cy(e.as,e.crossOrigin);nr.d.m(t,{as:typeof e.as==\"string\"&&e.as!==\"script\"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity==\"string\"?e.integrity:void 0})}else nr.d.m(t)};rr.requestFormReset=function(t){nr.d.r(t)};rr.unstable_batchedUpdates=function(t,e){return t(e)};rr.useFormState=function(t,e,n){return Sp.H.useFormState(t,e,n)};rr.useFormStatus=function(){return Sp.H.useHostTransitionStatus()};rr.version=\"19.2.8\"});var Tl=br((sae,QT)=>{\"use strict\";function ZT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ZT)}catch(t){console.error(t)}}ZT(),QT.exports=YT()});var dO=br(Xb=>{\"use strict\";var sn=BT(),LI=te(),Vq=Tl();function B(t){var e=\"https://react.dev/errors/\"+t;if(1<arguments.length){e+=\"?args[]=\"+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+=\"&args[]=\"+encodeURIComponent(arguments[n])}return\"Minified React error #\"+t+\"; visit \"+e+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}function AI(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function lh(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function EI(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function TI(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function eR(t){if(lh(t)!==t)throw Error(B(188))}function Kq(t){var e=t.alternate;if(!e){if(e=lh(t),e===null)throw Error(B(188));return e!==t?null:t}for(var n=t,r=e;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return eR(o),t;if(s===r)return eR(o),e;s=s.sibling}throw Error(B(188))}if(n.return!==r.return)n=o,r=s;else{for(var a=!1,i=o.child;i;){if(i===n){a=!0,n=o,r=s;break}if(i===r){a=!0,r=o,n=s;break}i=i.sibling}if(!a){for(i=s.child;i;){if(i===n){a=!0,n=s,r=o;break}if(i===r){a=!0,r=s,n=o;break}i=i.sibling}if(!a)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?t:e}function RI(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=RI(t),e!==null)return e;t=t.sibling}return null}var wt=Object.assign,Gq=Symbol.for(\"react.element\"),Ly=Symbol.for(\"react.transitional.element\"),Ip=Symbol.for(\"react.portal\"),Cc=Symbol.for(\"react.fragment\"),II=Symbol.for(\"react.strict_mode\"),ak=Symbol.for(\"react.profiler\"),MI=Symbol.for(\"react.consumer\"),aa=Symbol.for(\"react.context\"),tC=Symbol.for(\"react.forward_ref\"),ik=Symbol.for(\"react.suspense\"),lk=Symbol.for(\"react.suspense_list\"),nC=Symbol.for(\"react.memo\"),ti=Symbol.for(\"react.lazy\"),uk=Symbol.for(\"react.activity\"),Wq=Symbol.for(\"react.memo_cache_sentinel\"),tR=Symbol.iterator;function kp(t){return t===null||typeof t!=\"object\"?null:(t=tR&&t[tR]||t[\"@@iterator\"],typeof t==\"function\"?t:null)}var Xq=Symbol.for(\"react.client.reference\");function ck(t){if(t==null)return null;if(typeof t==\"function\")return t.$$typeof===Xq?null:t.displayName||t.name||null;if(typeof t==\"string\")return t;switch(t){case Cc:return\"Fragment\";case ak:return\"Profiler\";case II:return\"StrictMode\";case ik:return\"Suspense\";case lk:return\"SuspenseList\";case uk:return\"Activity\"}if(typeof t==\"object\")switch(t.$$typeof){case Ip:return\"Portal\";case aa:return t.displayName||\"Context\";case MI:return(t._context.displayName||\"Context\")+\".Consumer\";case tC:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||\"\",t=t!==\"\"?\"ForwardRef(\"+t+\")\":\"ForwardRef\"),t;case nC:return e=t.displayName||null,e!==null?e:ck(t.type)||\"Memo\";case ti:e=t._payload,t=t._init;try{return ck(t(e))}catch{}}return null}var Mp=Array.isArray,be=LI.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ye=Vq.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Dl={pending:!1,data:null,method:null,action:null},dk=[],Lc=-1;function hs(t){return{current:t}}function mn(t){0>Lc||(t.current=dk[Lc],dk[Lc]=null,Lc--)}function ht(t,e){Lc++,dk[Lc]=t.current,t.current=e}var ps=hs(null),Wp=hs(null),fi=hs(null),ob=hs(null);function sb(t,e){switch(ht(fi,e),ht(Wp,t),ht(ps,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?lI(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=lI(e),t=Y_(e,t);else switch(t){case\"svg\":t=1;break;case\"math\":t=2;break;default:t=0}}mn(ps),ht(ps,t)}function jc(){mn(ps),mn(Wp),mn(fi)}function fk(t){t.memoizedState!==null&&ht(ob,t);var e=ps.current,n=Y_(e,t.type);e!==n&&(ht(Wp,t),ht(ps,n))}function ab(t){Wp.current===t&&(mn(ps),mn(Wp)),ob.current===t&&(mn(ob),sh._currentValue=Dl)}var ES,nR;function Il(t){if(ES===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\\n( *(at )?)/);ES=e&&e[1]||\"\",nR=-1<n.stack.indexOf(`\n at`)?\" (<anonymous>)\":-1<n.stack.indexOf(\"@\")?\"@unknown:0:0\":\"\"}return`\n`+ES+t+nR}var TS=!1;function RS(t,e){if(!t||TS)return\"\";TS=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(e){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(d,[])}catch(p){var f=p}Reflect.construct(t,[],d)}else{try{d.call()}catch(p){f=p}t.call(d.prototype)}}else{try{throw Error()}catch(p){f=p}(d=t())&&typeof d.catch==\"function\"&&d.catch(function(){})}}catch(p){if(p&&f&&typeof p.stack==\"string\")return[p.stack,f.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=\"DetermineComponentFrameRoot\";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,\"name\");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,\"name\",{value:\"DetermineComponentFrameRoot\"});var s=r.DetermineComponentFrameRoot(),a=s[0],i=s[1];if(a&&i){var l=a.split(`\n`),u=i.split(`\n`);for(o=r=0;r<l.length&&!l[r].includes(\"DetermineComponentFrameRoot\");)r++;for(;o<u.length&&!u[o].includes(\"DetermineComponentFrameRoot\");)o++;if(r===l.length||o===u.length)for(r=l.length-1,o=u.length-1;1<=r&&0<=o&&l[r]!==u[o];)o--;for(;1<=r&&0<=o;r--,o--)if(l[r]!==u[o]){if(r!==1||o!==1)do if(r--,o--,0>o||l[r]!==u[o]){var c=`\n`+l[r].replace(\" at new \",\" at \");return t.displayName&&c.includes(\"<anonymous>\")&&(c=c.replace(\"<anonymous>\",t.displayName)),c}while(1<=r&&0<=o);break}}}finally{TS=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:\"\")?Il(n):\"\"}function Jq(t,e){switch(t.tag){case 26:case 27:case 5:return Il(t.type);case 16:return Il(\"Lazy\");case 13:return t.child!==e&&e!==null?Il(\"Suspense Fallback\"):Il(\"Suspense\");case 19:return Il(\"SuspenseList\");case 0:case 15:return RS(t.type,!1);case 11:return RS(t.type.render,!1);case 1:return RS(t.type,!0);case 31:return Il(\"Activity\");default:return\"\"}}function rR(t){try{var e=\"\",n=null;do e+=Jq(t,n),n=t,t=t.return;while(t);return e}catch(r){return`\nError generating stack: `+r.message+`\n`+r.stack}}var pk=Object.prototype.hasOwnProperty,rC=sn.unstable_scheduleCallback,IS=sn.unstable_cancelCallback,Yq=sn.unstable_shouldYield,Zq=sn.unstable_requestPaint,Hr=sn.unstable_now,Qq=sn.unstable_getCurrentPriorityLevel,_I=sn.unstable_ImmediatePriority,OI=sn.unstable_UserBlockingPriority,ib=sn.unstable_NormalPriority,e6=sn.unstable_LowPriority,DI=sn.unstable_IdlePriority,t6=sn.log,n6=sn.unstable_setDisableYieldValue,uh=null,$r=null;function ii(t){if(typeof t6==\"function\"&&n6(t),$r&&typeof $r.setStrictMode==\"function\")try{$r.setStrictMode(uh,t)}catch{}}var Ur=Math.clz32?Math.clz32:s6,r6=Math.log,o6=Math.LN2;function s6(t){return t>>>=0,t===0?32:31-(r6(t)/o6|0)|0}var Ay=256,Ey=262144,Ty=4194304;function Ml(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ob(t,e,n){var r=t.pendingLanes;if(r===0)return 0;var o=0,s=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var i=r&134217727;return i!==0?(r=i&~s,r!==0?o=Ml(r):(a&=i,a!==0?o=Ml(a):n||(n=i&~t,n!==0&&(o=Ml(n))))):(i=r&~s,i!==0?o=Ml(i):a!==0?o=Ml(a):n||(n=r&~t,n!==0&&(o=Ml(n)))),o===0?0:e!==0&&e!==o&&(e&s)===0&&(s=o&-o,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:o}function ch(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function a6(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function NI(){var t=Ty;return Ty<<=1,(Ty&62914560)===0&&(Ty=4194304),t}function MS(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function dh(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function i6(t,e,n,r,o,s){var a=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var i=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(n=a&~n;0<n;){var c=31-Ur(n),d=1<<c;i[c]=0,l[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var p=f[c];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&PI(t,r,0),s!==0&&o===0&&t.tag!==0&&(t.suspendedLanes|=s&~(a&~e))}function PI(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-Ur(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|n&261930}function BI(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Ur(n),o=1<<r;o&e|t[r]&e&&(t[r]|=e),n&=~o}}function zI(t,e){var n=e&-e;return n=(n&42)!==0?1:oC(n),(n&(t.suspendedLanes|e))!==0?0:n}function oC(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function sC(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function FI(){var t=Ye.p;return t!==0?t:(t=window.event,t===void 0?32:lO(t.type))}function oR(t,e){var n=Ye.p;try{return Ye.p=t,e()}finally{Ye.p=n}}var Li=Math.random().toString(36).slice(2),Ln=\"__reactFiber$\"+Li,Cr=\"__reactProps$\"+Li,ed=\"__reactContainer$\"+Li,hk=\"__reactEvents$\"+Li,l6=\"__reactListeners$\"+Li,u6=\"__reactHandles$\"+Li,sR=\"__reactResources$\"+Li,fh=\"__reactMarker$\"+Li;function aC(t){delete t[Ln],delete t[Cr],delete t[hk],delete t[l6],delete t[u6]}function Ac(t){var e=t[Ln];if(e)return e;for(var n=t.parentNode;n;){if(e=n[ed]||n[Ln]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=pI(t);t!==null;){if(n=t[Ln])return n;t=pI(t)}return e}t=n,n=t.parentNode}return null}function td(t){if(t=t[Ln]||t[ed]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function _p(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(B(33))}function Pc(t){var e=t[sR];return e||(e=t[sR]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function hn(t){t[fh]=!0}var HI=new Set,$I={};function ql(t,e){qc(t,e),qc(t+\"Capture\",e)}function qc(t,e){for($I[t]=e,t=0;t<e.length;t++)HI.add(e[t])}var c6=RegExp(\"^[:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD][:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\"),aR={},iR={};function d6(t){return pk.call(iR,t)?!0:pk.call(aR,t)?!1:c6.test(t)?iR[t]=!0:(aR[t]=!0,!1)}function jy(t,e,n){if(d6(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case\"undefined\":case\"function\":case\"symbol\":t.removeAttribute(e);return;case\"boolean\":var r=e.toLowerCase().slice(0,5);if(r!==\"data-\"&&r!==\"aria-\"){t.removeAttribute(e);return}}t.setAttribute(e,\"\"+n)}}function Ry(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case\"undefined\":case\"function\":case\"symbol\":case\"boolean\":t.removeAttribute(e);return}t.setAttribute(e,\"\"+n)}}function Qs(t,e,n,r){if(r===null)t.removeAttribute(n);else{switch(typeof r){case\"undefined\":case\"function\":case\"symbol\":case\"boolean\":t.removeAttribute(n);return}t.setAttributeNS(e,n,\"\"+r)}}function ho(t){switch(typeof t){case\"bigint\":case\"boolean\":case\"number\":case\"string\":case\"undefined\":return t;case\"object\":return t;default:return\"\"}}function UI(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()===\"input\"&&(e===\"checkbox\"||e===\"radio\")}function f6(t,e,n){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof r<\"u\"&&typeof r.get==\"function\"&&typeof r.set==\"function\"){var o=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=\"\"+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=\"\"+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function mk(t){if(!t._valueTracker){var e=UI(t)?\"checked\":\"value\";t._valueTracker=f6(t,e,\"\"+t[e])}}function jI(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r=\"\";return t&&(r=UI(t)?t.checked?\"true\":\"false\":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function lb(t){if(t=t||(typeof document<\"u\"?document:void 0),typeof t>\"u\")return null;try{return t.activeElement||t.body}catch{return t.body}}var p6=/[\\n\"\\\\]/g;function yo(t){return t.replace(p6,function(e){return\"\\\\\"+e.charCodeAt(0).toString(16)+\" \"})}function gk(t,e,n,r,o,s,a,i){t.name=\"\",a!=null&&typeof a!=\"function\"&&typeof a!=\"symbol\"&&typeof a!=\"boolean\"?t.type=a:t.removeAttribute(\"type\"),e!=null?a===\"number\"?(e===0&&t.value===\"\"||t.value!=e)&&(t.value=\"\"+ho(e)):t.value!==\"\"+ho(e)&&(t.value=\"\"+ho(e)):a!==\"submit\"&&a!==\"reset\"||t.removeAttribute(\"value\"),e!=null?yk(t,a,ho(e)):n!=null?yk(t,a,ho(n)):r!=null&&t.removeAttribute(\"value\"),o==null&&s!=null&&(t.defaultChecked=!!s),o!=null&&(t.checked=o&&typeof o!=\"function\"&&typeof o!=\"symbol\"),i!=null&&typeof i!=\"function\"&&typeof i!=\"symbol\"&&typeof i!=\"boolean\"?t.name=\"\"+ho(i):t.removeAttribute(\"name\")}function qI(t,e,n,r,o,s,a,i){if(s!=null&&typeof s!=\"function\"&&typeof s!=\"symbol\"&&typeof s!=\"boolean\"&&(t.type=s),e!=null||n!=null){if(!(s!==\"submit\"&&s!==\"reset\"||e!=null)){mk(t);return}n=n!=null?\"\"+ho(n):\"\",e=e!=null?\"\"+ho(e):n,i||e===t.value||(t.value=e),t.defaultValue=e}r=r??o,r=typeof r!=\"function\"&&typeof r!=\"symbol\"&&!!r,t.checked=i?t.checked:!!r,t.defaultChecked=!!r,a!=null&&typeof a!=\"function\"&&typeof a!=\"symbol\"&&typeof a!=\"boolean\"&&(t.name=a),mk(t)}function yk(t,e,n){e===\"number\"&&lb(t.ownerDocument)===t||t.defaultValue===\"\"+n||(t.defaultValue=\"\"+n)}function Bc(t,e,n,r){if(t=t.options,e){e={};for(var o=0;o<n.length;o++)e[\"$\"+n[o]]=!0;for(n=0;n<t.length;n++)o=e.hasOwnProperty(\"$\"+t[n].value),t[n].selected!==o&&(t[n].selected=o),o&&r&&(t[n].defaultSelected=!0)}else{for(n=\"\"+ho(n),e=null,o=0;o<t.length;o++){if(t[o].value===n){t[o].selected=!0,r&&(t[o].defaultSelected=!0);return}e!==null||t[o].disabled||(e=t[o])}e!==null&&(e.selected=!0)}}function VI(t,e,n){if(e!=null&&(e=\"\"+ho(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?\"\"+ho(n):\"\"}function KI(t,e,n,r){if(e==null){if(r!=null){if(n!=null)throw Error(B(92));if(Mp(r)){if(1<r.length)throw Error(B(93));r=r[0]}n=r}n==null&&(n=\"\"),e=n}n=ho(e),t.defaultValue=n,r=t.textContent,r===n&&r!==\"\"&&r!==null&&(t.value=r),mk(t)}function Vc(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var h6=new Set(\"animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp\".split(\" \"));function lR(t,e,n){var r=e.indexOf(\"--\")===0;n==null||typeof n==\"boolean\"||n===\"\"?r?t.setProperty(e,\"\"):e===\"float\"?t.cssFloat=\"\":t[e]=\"\":r?t.setProperty(e,n):typeof n!=\"number\"||n===0||h6.has(e)?e===\"float\"?t.cssFloat=n:t[e]=(\"\"+n).trim():t[e]=n+\"px\"}function GI(t,e,n){if(e!=null&&typeof e!=\"object\")throw Error(B(62));if(t=t.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||e!=null&&e.hasOwnProperty(r)||(r.indexOf(\"--\")===0?t.setProperty(r,\"\"):r===\"float\"?t.cssFloat=\"\":t[r]=\"\");for(var o in e)r=e[o],e.hasOwnProperty(o)&&n[o]!==r&&lR(t,o,r)}else for(var s in e)e.hasOwnProperty(s)&&lR(t,s,e[s])}function iC(t){if(t.indexOf(\"-\")===-1)return!1;switch(t){case\"annotation-xml\":case\"color-profile\":case\"font-face\":case\"font-face-src\":case\"font-face-uri\":case\"font-face-format\":case\"font-face-name\":case\"missing-glyph\":return!1;default:return!0}}var m6=new Map([[\"acceptCharset\",\"accept-charset\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"],[\"crossOrigin\",\"crossorigin\"],[\"accentHeight\",\"accent-height\"],[\"alignmentBaseline\",\"alignment-baseline\"],[\"arabicForm\",\"arabic-form\"],[\"baselineShift\",\"baseline-shift\"],[\"capHeight\",\"cap-height\"],[\"clipPath\",\"clip-path\"],[\"clipRule\",\"clip-rule\"],[\"colorInterpolation\",\"color-interpolation\"],[\"colorInterpolationFilters\",\"color-interpolation-filters\"],[\"colorProfile\",\"color-profile\"],[\"colorRendering\",\"color-rendering\"],[\"dominantBaseline\",\"dominant-baseline\"],[\"enableBackground\",\"enable-background\"],[\"fillOpacity\",\"fill-opacity\"],[\"fillRule\",\"fill-rule\"],[\"floodColor\",\"flood-color\"],[\"floodOpacity\",\"flood-opacity\"],[\"fontFamily\",\"font-family\"],[\"fontSize\",\"font-size\"],[\"fontSizeAdjust\",\"font-size-adjust\"],[\"fontStretch\",\"font-stretch\"],[\"fontStyle\",\"font-style\"],[\"fontVariant\",\"font-variant\"],[\"fontWeight\",\"font-weight\"],[\"glyphName\",\"glyph-name\"],[\"glyphOrientationHorizontal\",\"glyph-orientation-horizontal\"],[\"glyphOrientationVertical\",\"glyph-orientation-vertical\"],[\"horizAdvX\",\"horiz-adv-x\"],[\"horizOriginX\",\"horiz-origin-x\"],[\"imageRendering\",\"image-rendering\"],[\"letterSpacing\",\"letter-spacing\"],[\"lightingColor\",\"lighting-color\"],[\"markerEnd\",\"marker-end\"],[\"markerMid\",\"marker-mid\"],[\"markerStart\",\"marker-start\"],[\"overlinePosition\",\"overline-position\"],[\"overlineThickness\",\"overline-thickness\"],[\"paintOrder\",\"paint-order\"],[\"panose-1\",\"panose-1\"],[\"pointerEvents\",\"pointer-events\"],[\"renderingIntent\",\"rendering-intent\"],[\"shapeRendering\",\"shape-rendering\"],[\"stopColor\",\"stop-color\"],[\"stopOpacity\",\"stop-opacity\"],[\"strikethroughPosition\",\"strikethrough-position\"],[\"strikethroughThickness\",\"strikethrough-thickness\"],[\"strokeDasharray\",\"stroke-dasharray\"],[\"strokeDashoffset\",\"stroke-dashoffset\"],[\"strokeLinecap\",\"stroke-linecap\"],[\"strokeLinejoin\",\"stroke-linejoin\"],[\"strokeMiterlimit\",\"stroke-miterlimit\"],[\"strokeOpacity\",\"stroke-opacity\"],[\"strokeWidth\",\"stroke-width\"],[\"textAnchor\",\"text-anchor\"],[\"textDecoration\",\"text-decoration\"],[\"textRendering\",\"text-rendering\"],[\"transformOrigin\",\"transform-origin\"],[\"underlinePosition\",\"underline-position\"],[\"underlineThickness\",\"underline-thickness\"],[\"unicodeBidi\",\"unicode-bidi\"],[\"unicodeRange\",\"unicode-range\"],[\"unitsPerEm\",\"units-per-em\"],[\"vAlphabetic\",\"v-alphabetic\"],[\"vHanging\",\"v-hanging\"],[\"vIdeographic\",\"v-ideographic\"],[\"vMathematical\",\"v-mathematical\"],[\"vectorEffect\",\"vector-effect\"],[\"vertAdvY\",\"vert-adv-y\"],[\"vertOriginX\",\"vert-origin-x\"],[\"vertOriginY\",\"vert-origin-y\"],[\"wordSpacing\",\"word-spacing\"],[\"writingMode\",\"writing-mode\"],[\"xmlnsXlink\",\"xmlns:xlink\"],[\"xHeight\",\"x-height\"]]),g6=/^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*:/i;function qy(t){return g6.test(\"\"+t)?\"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\":t}function ia(){}var bk=null;function lC(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ec=null,zc=null;function uR(t){var e=td(t);if(e&&(t=e.stateNode)){var n=t[Cr]||null;e:switch(t=e.stateNode,e.type){case\"input\":if(gk(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type===\"radio\"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name=\"'+yo(\"\"+e)+'\"][type=\"radio\"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var o=r[Cr]||null;if(!o)throw Error(B(90));gk(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(e=0;e<n.length;e++)r=n[e],r.form===t.form&&jI(r)}break e;case\"textarea\":VI(t,n.value,n.defaultValue);break e;case\"select\":e=n.value,e!=null&&Bc(t,!!n.multiple,e,!1)}}}var _S=!1;function WI(t,e,n){if(_S)return t(e,n);_S=!0;try{var r=t(e);return r}finally{if(_S=!1,(Ec!==null||zc!==null)&&(Vb(),Ec&&(e=Ec,t=zc,zc=Ec=null,uR(e),t)))for(e=0;e<t.length;e++)uR(t[e])}}function Xp(t,e){var n=t.stateNode;if(n===null)return null;var r=n[Cr]||null;if(r===null)return null;n=r[e];e:switch(e){case\"onClick\":case\"onClickCapture\":case\"onDoubleClick\":case\"onDoubleClickCapture\":case\"onMouseDown\":case\"onMouseDownCapture\":case\"onMouseMove\":case\"onMouseMoveCapture\":case\"onMouseUp\":case\"onMouseUpCapture\":case\"onMouseEnter\":(r=!r.disabled)||(t=t.type,r=!(t===\"button\"||t===\"input\"||t===\"select\"||t===\"textarea\")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!=\"function\")throw Error(B(231,e,typeof n));return n}var fa=!(typeof window>\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),vk=!1;if(fa)try{vc={},Object.defineProperty(vc,\"passive\",{get:function(){vk=!0}}),window.addEventListener(\"test\",vc,vc),window.removeEventListener(\"test\",vc,vc)}catch{vk=!1}var vc,li=null,uC=null,Vy=null;function XI(){if(Vy)return Vy;var t,e=uC,n=e.length,r,o=\"value\"in li?li.value:li.textContent,s=o.length;for(t=0;t<n&&e[t]===o[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===o[s-r];r++);return Vy=o.slice(t,1<r?1-r:void 0)}function Ky(t){var e=t.keyCode;return\"charCode\"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Iy(){return!0}function cR(){return!1}function Lr(t){function e(n,r,o,s,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var i in t)t.hasOwnProperty(i)&&(n=t[i],this[i]=n?n(s):s[i]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Iy:cR,this.isPropagationStopped=cR,this}return wt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!=\"unknown\"&&(n.returnValue=!1),this.isDefaultPrevented=Iy)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!=\"unknown\"&&(n.cancelBubble=!0),this.isPropagationStopped=Iy)},persist:function(){},isPersistent:Iy}),e}var Vl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Db=Lr(Vl),ph=wt({},Vl,{view:0,detail:0}),y6=Lr(ph),OS,DS,Cp,Nb=wt({},ph,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cC,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return\"movementX\"in t?t.movementX:(t!==Cp&&(Cp&&t.type===\"mousemove\"?(OS=t.screenX-Cp.screenX,DS=t.screenY-Cp.screenY):DS=OS=0,Cp=t),OS)},movementY:function(t){return\"movementY\"in t?t.movementY:DS}}),dR=Lr(Nb),b6=wt({},Nb,{dataTransfer:0}),v6=Lr(b6),x6=wt({},ph,{relatedTarget:0}),NS=Lr(x6),w6=wt({},Vl,{animationName:0,elapsedTime:0,pseudoElement:0}),S6=Lr(w6),k6=wt({},Vl,{clipboardData:function(t){return\"clipboardData\"in t?t.clipboardData:window.clipboardData}}),C6=Lr(k6),L6=wt({},Vl,{data:0}),fR=Lr(L6),A6={Esc:\"Escape\",Spacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},E6={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",19:\"Pause\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"},T6={Alt:\"altKey\",Control:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};function R6(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=T6[t])?!!e[t]:!1}function cC(){return R6}var I6=wt({},ph,{key:function(t){if(t.key){var e=A6[t.key]||t.key;if(e!==\"Unidentified\")return e}return t.type===\"keypress\"?(t=Ky(t),t===13?\"Enter\":String.fromCharCode(t)):t.type===\"keydown\"||t.type===\"keyup\"?E6[t.keyCode]||\"Unidentified\":\"\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cC,charCode:function(t){return t.type===\"keypress\"?Ky(t):0},keyCode:function(t){return t.type===\"keydown\"||t.type===\"keyup\"?t.keyCode:0},which:function(t){return t.type===\"keypress\"?Ky(t):t.type===\"keydown\"||t.type===\"keyup\"?t.keyCode:0}}),M6=Lr(I6),_6=wt({},Nb,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pR=Lr(_6),O6=wt({},ph,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cC}),D6=Lr(O6),N6=wt({},Vl,{propertyName:0,elapsedTime:0,pseudoElement:0}),P6=Lr(N6),B6=wt({},Nb,{deltaX:function(t){return\"deltaX\"in t?t.deltaX:\"wheelDeltaX\"in t?-t.wheelDeltaX:0},deltaY:function(t){return\"deltaY\"in t?t.deltaY:\"wheelDeltaY\"in t?-t.wheelDeltaY:\"wheelDelta\"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),z6=Lr(B6),F6=wt({},Vl,{newState:0,oldState:0}),H6=Lr(F6),$6=[9,13,27,32],dC=fa&&\"CompositionEvent\"in window,Np=null;fa&&\"documentMode\"in document&&(Np=document.documentMode);var U6=fa&&\"TextEvent\"in window&&!Np,JI=fa&&(!dC||Np&&8<Np&&11>=Np),hR=\" \",mR=!1;function YI(t,e){switch(t){case\"keyup\":return $6.indexOf(e.keyCode)!==-1;case\"keydown\":return e.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function ZI(t){return t=t.detail,typeof t==\"object\"&&\"data\"in t?t.data:null}var Tc=!1;function j6(t,e){switch(t){case\"compositionend\":return ZI(e);case\"keypress\":return e.which!==32?null:(mR=!0,hR);case\"textInput\":return t=e.data,t===hR&&mR?null:t;default:return null}}function q6(t,e){if(Tc)return t===\"compositionend\"||!dC&&YI(t,e)?(t=XI(),Vy=uC=li=null,Tc=!1,t):null;switch(t){case\"paste\":return null;case\"keypress\":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case\"compositionend\":return JI&&e.locale!==\"ko\"?null:e.data;default:return null}}var V6={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function gR(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e===\"input\"?!!V6[t.type]:e===\"textarea\"}function QI(t,e,n,r){Ec?zc?zc.push(r):zc=[r]:Ec=r,e=Ab(e,\"onChange\"),0<e.length&&(n=new Db(\"onChange\",\"change\",null,n,r),t.push({event:n,listeners:e}))}var Pp=null,Jp=null;function K6(t){W_(t,0)}function Pb(t){var e=_p(t);if(jI(e))return t}function yR(t,e){if(t===\"change\")return e}var eM=!1;fa&&(fa?(_y=\"oninput\"in document,_y||(PS=document.createElement(\"div\"),PS.setAttribute(\"oninput\",\"return;\"),_y=typeof PS.oninput==\"function\"),My=_y):My=!1,eM=My&&(!document.documentMode||9<document.documentMode));var My,_y,PS;function bR(){Pp&&(Pp.detachEvent(\"onpropertychange\",tM),Jp=Pp=null)}function tM(t){if(t.propertyName===\"value\"&&Pb(Jp)){var e=[];QI(e,Jp,t,lC(t)),WI(K6,e)}}function G6(t,e,n){t===\"focusin\"?(bR(),Pp=e,Jp=n,Pp.attachEvent(\"onpropertychange\",tM)):t===\"focusout\"&&bR()}function W6(t){if(t===\"selectionchange\"||t===\"keyup\"||t===\"keydown\")return Pb(Jp)}function X6(t,e){if(t===\"click\")return Pb(e)}function J6(t,e){if(t===\"input\"||t===\"change\")return Pb(e)}function Y6(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var qr=typeof Object.is==\"function\"?Object.is:Y6;function Yp(t,e){if(qr(t,e))return!0;if(typeof t!=\"object\"||t===null||typeof e!=\"object\"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!pk.call(e,o)||!qr(t[o],e[o]))return!1}return!0}function vR(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function xR(t,e){var n=vR(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=vR(n)}}function nM(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?nM(t,e.parentNode):\"contains\"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function rM(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=lb(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href==\"string\"}catch{n=!1}if(n)t=e.contentWindow;else break;e=lb(t.document)}return e}function fC(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e===\"input\"&&(t.type===\"text\"||t.type===\"search\"||t.type===\"tel\"||t.type===\"url\"||t.type===\"password\")||e===\"textarea\"||t.contentEditable===\"true\")}var Z6=fa&&\"documentMode\"in document&&11>=document.documentMode,Rc=null,xk=null,Bp=null,wk=!1;function wR(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wk||Rc==null||Rc!==lb(r)||(r=Rc,\"selectionStart\"in r&&fC(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Bp&&Yp(Bp,r)||(Bp=r,r=Ab(xk,\"onSelect\"),0<r.length&&(e=new Db(\"onSelect\",\"select\",null,e,n),t.push({event:e,listeners:r}),e.target=Rc)))}function Rl(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n[\"Webkit\"+t]=\"webkit\"+e,n[\"Moz\"+t]=\"moz\"+e,n}var Ic={animationend:Rl(\"Animation\",\"AnimationEnd\"),animationiteration:Rl(\"Animation\",\"AnimationIteration\"),animationstart:Rl(\"Animation\",\"AnimationStart\"),transitionrun:Rl(\"Transition\",\"TransitionRun\"),transitionstart:Rl(\"Transition\",\"TransitionStart\"),transitioncancel:Rl(\"Transition\",\"TransitionCancel\"),transitionend:Rl(\"Transition\",\"TransitionEnd\")},BS={},oM={};fa&&(oM=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Ic.animationend.animation,delete Ic.animationiteration.animation,delete Ic.animationstart.animation),\"TransitionEvent\"in window||delete Ic.transitionend.transition);function Kl(t){if(BS[t])return BS[t];if(!Ic[t])return t;var e=Ic[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in oM)return BS[t]=e[n];return t}var sM=Kl(\"animationend\"),aM=Kl(\"animationiteration\"),iM=Kl(\"animationstart\"),Q6=Kl(\"transitionrun\"),e5=Kl(\"transitionstart\"),t5=Kl(\"transitioncancel\"),lM=Kl(\"transitionend\"),uM=new Map,Sk=\"abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\".split(\" \");Sk.push(\"scrollEnd\");function qo(t,e){uM.set(t,e),ql(e,[t])}var ub=typeof reportError==\"function\"?reportError:function(t){if(typeof window==\"object\"&&typeof window.ErrorEvent==\"function\"){var e=new window.ErrorEvent(\"error\",{bubbles:!0,cancelable:!0,message:typeof t==\"object\"&&t!==null&&typeof t.message==\"string\"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process==\"object\"&&typeof process.emit==\"function\"){process.emit(\"uncaughtException\",t);return}console.error(t)},po=[],Mc=0,pC=0;function Bb(){for(var t=Mc,e=pC=Mc=0;e<t;){var n=po[e];po[e++]=null;var r=po[e];po[e++]=null;var o=po[e];po[e++]=null;var s=po[e];if(po[e++]=null,r!==null&&o!==null){var a=r.pending;a===null?o.next=o:(o.next=a.next,a.next=o),r.pending=o}s!==0&&cM(n,o,s)}}function zb(t,e,n,r){po[Mc++]=t,po[Mc++]=e,po[Mc++]=n,po[Mc++]=r,pC|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function hC(t,e,n,r){return zb(t,e,n,r),cb(t)}function Gl(t,e){return zb(t,null,null,e),cb(t)}function cM(t,e,n){t.lanes|=n;var r=t.alternate;r!==null&&(r.lanes|=n);for(var o=!1,s=t.return;s!==null;)s.childLanes|=n,r=s.alternate,r!==null&&(r.childLanes|=n),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(o=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,o&&e!==null&&(o=31-Ur(n),t=s.hiddenUpdates,r=t[o],r===null?t[o]=[e]:r.push(e),e.lane=n|536870912),s):null}function cb(t){if(50<Kp)throw Kp=0,jk=null,Error(B(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var _c={};function n5(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zr(t,e,n,r){return new n5(t,e,n,r)}function mC(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ua(t,e){var n=t.alternate;return n===null?(n=zr(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function dM(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Gy(t,e,n,r,o,s){var a=0;if(r=t,typeof t==\"function\")mC(t)&&(a=1);else if(typeof t==\"string\")a=sV(t,n,ps.current)?26:t===\"html\"||t===\"head\"||t===\"body\"?27:5;else e:switch(t){case uk:return t=zr(31,n,e,o),t.elementType=uk,t.lanes=s,t;case Cc:return Nl(n.children,o,s,e);case II:a=8,o|=24;break;case ak:return t=zr(12,n,e,o|2),t.elementType=ak,t.lanes=s,t;case ik:return t=zr(13,n,e,o),t.elementType=ik,t.lanes=s,t;case lk:return t=zr(19,n,e,o),t.elementType=lk,t.lanes=s,t;default:if(typeof t==\"object\"&&t!==null)switch(t.$$typeof){case aa:a=10;break e;case MI:a=9;break e;case tC:a=11;break e;case nC:a=14;break e;case ti:a=16,r=null;break e}a=29,n=Error(B(130,t===null?\"null\":typeof t,\"\")),r=null}return e=zr(a,n,e,o),e.elementType=t,e.type=r,e.lanes=s,e}function Nl(t,e,n,r){return t=zr(7,t,r,e),t.lanes=n,t}function zS(t,e,n){return t=zr(6,t,null,e),t.lanes=n,t}function fM(t){var e=zr(18,null,null,0);return e.stateNode=t,e}function FS(t,e,n){return e=zr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var SR=new WeakMap;function bo(t,e){if(typeof t==\"object\"&&t!==null){var n=SR.get(t);return n!==void 0?n:(e={value:t,source:e,stack:rR(e)},SR.set(t,e),e)}return{value:t,source:e,stack:rR(e)}}var Oc=[],Dc=0,db=null,Zp=0,mo=[],go=0,wi=null,cs=1,ds=\"\";function oa(t,e){Oc[Dc++]=Zp,Oc[Dc++]=db,db=t,Zp=e}function pM(t,e,n){mo[go++]=cs,mo[go++]=ds,mo[go++]=wi,wi=t;var r=cs;t=ds;var o=32-Ur(r)-1;r&=~(1<<o),n+=1;var s=32-Ur(e)+o;if(30<s){var a=o-o%5;s=(r&(1<<a)-1).toString(32),r>>=a,o-=a,cs=1<<32-Ur(e)+o|n<<o|r,ds=s+t}else cs=1<<s|n<<o|r,ds=t}function gC(t){t.return!==null&&(oa(t,1),pM(t,1,0))}function yC(t){for(;t===db;)db=Oc[--Dc],Oc[Dc]=null,Zp=Oc[--Dc],Oc[Dc]=null;for(;t===wi;)wi=mo[--go],mo[go]=null,ds=mo[--go],mo[go]=null,cs=mo[--go],mo[go]=null}function hM(t,e){mo[go++]=cs,mo[go++]=ds,mo[go++]=wi,cs=e.id,ds=e.overflow,wi=t}var An=null,xt=null,$e=!1,pi=null,vo=!1,kk=Error(B(519));function Si(t){var e=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?\"text\":\"HTML\",\"\"));throw Qp(bo(e,t)),kk}function kR(t){var e=t.stateNode,n=t.type,r=t.memoizedProps;switch(e[Ln]=t,e[Cr]=r,n){case\"dialog\":De(\"cancel\",e),De(\"close\",e);break;case\"iframe\":case\"object\":case\"embed\":De(\"load\",e);break;case\"video\":case\"audio\":for(n=0;n<rh.length;n++)De(rh[n],e);break;case\"source\":De(\"error\",e);break;case\"img\":case\"image\":case\"link\":De(\"error\",e),De(\"load\",e);break;case\"details\":De(\"toggle\",e);break;case\"input\":De(\"invalid\",e),qI(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case\"select\":De(\"invalid\",e);break;case\"textarea\":De(\"invalid\",e),KI(e,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=\"string\"&&typeof n!=\"number\"&&typeof n!=\"bigint\"||e.textContent===\"\"+n||r.suppressHydrationWarning===!0||J_(e.textContent,n)?(r.popover!=null&&(De(\"beforetoggle\",e),De(\"toggle\",e)),r.onScroll!=null&&De(\"scroll\",e),r.onScrollEnd!=null&&De(\"scrollend\",e),r.onClick!=null&&(e.onclick=ia),e=!0):e=!1,e||Si(t,!0)}function CR(t){for(An=t.return;An;)switch(An.tag){case 5:case 31:case 13:vo=!1;return;case 27:case 3:vo=!0;return;default:An=An.return}}function xc(t){if(t!==An)return!1;if(!$e)return CR(t),$e=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!==\"form\"&&n!==\"button\")||Wk(t.type,t.memoizedProps)),n=!n),n&&xt&&Si(t),CR(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(B(317));xt=fI(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(B(317));xt=fI(t)}else e===27?(e=xt,Ai(t.type)?(t=Zk,Zk=null,xt=t):xt=e):xt=An?wo(t.stateNode.nextSibling):null;return!0}function Fl(){xt=An=null,$e=!1}function HS(){var t=pi;return t!==null&&(Sr===null?Sr=t:Sr.push.apply(Sr,t),pi=null),t}function Qp(t){pi===null?pi=[t]:pi.push(t)}var Ck=hs(null),Wl=null,la=null;function ri(t,e,n){ht(Ck,e._currentValue),e._currentValue=n}function ca(t){t._currentValue=Ck.current,mn(Ck)}function Lk(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ak(t,e,n,r){var o=t.child;for(o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){var a=o.child;s=s.firstContext;e:for(;s!==null;){var i=s;s=o;for(var l=0;l<e.length;l++)if(i.context===e[l]){s.lanes|=n,i=s.alternate,i!==null&&(i.lanes|=n),Lk(s.return,n,t),r||(a=null);break e}s=i.next}}else if(o.tag===18){if(a=o.return,a===null)throw Error(B(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Lk(a,n,t),a=null}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}}function nd(t,e,n,r){t=null;for(var o=e,s=!1;o!==null;){if(!s){if((o.flags&524288)!==0)s=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var a=o.alternate;if(a===null)throw Error(B(387));if(a=a.memoizedProps,a!==null){var i=o.type;qr(o.pendingProps.value,a.value)||(t!==null?t.push(i):t=[i])}}else if(o===ob.current){if(a=o.alternate,a===null)throw Error(B(387));a.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(t!==null?t.push(sh):t=[sh])}o=o.return}t!==null&&Ak(e,t,n,r),e.flags|=262144}function fb(t){for(t=t.firstContext;t!==null;){if(!qr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Hl(t){Wl=t,la=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function En(t){return mM(Wl,t)}function Oy(t,e){return Wl===null&&Hl(t),mM(t,e)}function mM(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},la===null){if(t===null)throw Error(B(308));la=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else la=la.next=e;return n}var r5=typeof AbortController<\"u\"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,r){t.push(r)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},o5=sn.unstable_scheduleCallback,s5=sn.unstable_NormalPriority,Jt={$$typeof:aa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bC(){return{controller:new r5,data:new Map,refCount:0}}function hh(t){t.refCount--,t.refCount===0&&o5(s5,function(){t.controller.abort()})}var zp=null,Ek=0,Kc=0,Fc=null;function a5(t,e){if(zp===null){var n=zp=[];Ek=0,Kc=jC(),Fc={status:\"pending\",value:void 0,then:function(r){n.push(r)}}}return Ek++,e.then(LR,LR),e}function LR(){if(--Ek===0&&zp!==null){Fc!==null&&(Fc.status=\"fulfilled\");var t=zp;zp=null,Kc=0,Fc=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function i5(t,e){var n=[],r={status:\"pending\",value:null,reason:null,then:function(o){n.push(o)}};return t.then(function(){r.status=\"fulfilled\",r.value=e;for(var o=0;o<n.length;o++)(0,n[o])(e)},function(o){for(r.status=\"rejected\",r.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),r}var AR=be.S;be.S=function(t,e){R_=Hr(),typeof e==\"object\"&&e!==null&&typeof e.then==\"function\"&&a5(t,e),AR!==null&&AR(t,e)};var Pl=hs(null);function vC(){var t=Pl.current;return t!==null?t:ct.pooledCache}function Wy(t,e){e===null?ht(Pl,Pl.current):ht(Pl,e.pool)}function gM(){var t=vC();return t===null?null:{parent:Jt._currentValue,pool:t}}var rd=Error(B(460)),xC=Error(B(474)),Fb=Error(B(542)),pb={then:function(){}};function ER(t){return t=t.status,t===\"fulfilled\"||t===\"rejected\"}function yM(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(ia,ia),e=n),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw t=e.reason,RR(t),t;default:if(typeof e.status==\"string\")e.then(ia,ia);else{if(t=ct,t!==null&&100<t.shellSuspendCounter)throw Error(B(482));t=e,t.status=\"pending\",t.then(function(r){if(e.status===\"pending\"){var o=e;o.status=\"fulfilled\",o.value=r}},function(r){if(e.status===\"pending\"){var o=e;o.status=\"rejected\",o.reason=r}})}switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw t=e.reason,RR(t),t}throw Bl=e,rd}}function _l(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n==\"object\"&&typeof n.then==\"function\"?(Bl=n,rd):n}}var Bl=null;function TR(){if(Bl===null)throw Error(B(459));var t=Bl;return Bl=null,t}function RR(t){if(t===rd||t===Fb)throw Error(B(483))}var Hc=null,eh=0;function Dy(t){var e=eh;return eh+=1,Hc===null&&(Hc=[]),yM(Hc,t,e)}function Lp(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Ny(t,e){throw e.$$typeof===Gq?Error(B(525)):(t=Object.prototype.toString.call(e),Error(B(31,t===\"[object Object]\"?\"object with keys {\"+Object.keys(e).join(\", \")+\"}\":t)))}function bM(t){function e(y,b){if(t){var x=y.deletions;x===null?(y.deletions=[b],y.flags|=16):x.push(b)}}function n(y,b){if(!t)return null;for(;b!==null;)e(y,b),b=b.sibling;return null}function r(y){for(var b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function o(y,b){return y=ua(y,b),y.index=0,y.sibling=null,y}function s(y,b,x){return y.index=x,t?(x=y.alternate,x!==null?(x=x.index,x<b?(y.flags|=67108866,b):x):(y.flags|=67108866,b)):(y.flags|=1048576,b)}function a(y){return t&&y.alternate===null&&(y.flags|=67108866),y}function i(y,b,x,v){return b===null||b.tag!==6?(b=zS(x,y.mode,v),b.return=y,b):(b=o(b,x),b.return=y,b)}function l(y,b,x,v){var S=x.type;return S===Cc?c(y,b,x.props.children,v,x.key):b!==null&&(b.elementType===S||typeof S==\"object\"&&S!==null&&S.$$typeof===ti&&_l(S)===b.type)?(b=o(b,x.props),Lp(b,x),b.return=y,b):(b=Gy(x.type,x.key,x.props,null,y.mode,v),Lp(b,x),b.return=y,b)}function u(y,b,x,v){return b===null||b.tag!==4||b.stateNode.containerInfo!==x.containerInfo||b.stateNode.implementation!==x.implementation?(b=FS(x,y.mode,v),b.return=y,b):(b=o(b,x.children||[]),b.return=y,b)}function c(y,b,x,v,S){return b===null||b.tag!==7?(b=Nl(x,y.mode,v,S),b.return=y,b):(b=o(b,x),b.return=y,b)}function d(y,b,x){if(typeof b==\"string\"&&b!==\"\"||typeof b==\"number\"||typeof b==\"bigint\")return b=zS(\"\"+b,y.mode,x),b.return=y,b;if(typeof b==\"object\"&&b!==null){switch(b.$$typeof){case Ly:return x=Gy(b.type,b.key,b.props,null,y.mode,x),Lp(x,b),x.return=y,x;case Ip:return b=FS(b,y.mode,x),b.return=y,b;case ti:return b=_l(b),d(y,b,x)}if(Mp(b)||kp(b))return b=Nl(b,y.mode,x,null),b.return=y,b;if(typeof b.then==\"function\")return d(y,Dy(b),x);if(b.$$typeof===aa)return d(y,Oy(y,b),x);Ny(y,b)}return null}function f(y,b,x,v){var S=b!==null?b.key:null;if(typeof x==\"string\"&&x!==\"\"||typeof x==\"number\"||typeof x==\"bigint\")return S!==null?null:i(y,b,\"\"+x,v);if(typeof x==\"object\"&&x!==null){switch(x.$$typeof){case Ly:return x.key===S?l(y,b,x,v):null;case Ip:return x.key===S?u(y,b,x,v):null;case ti:return x=_l(x),f(y,b,x,v)}if(Mp(x)||kp(x))return S!==null?null:c(y,b,x,v,null);if(typeof x.then==\"function\")return f(y,b,Dy(x),v);if(x.$$typeof===aa)return f(y,b,Oy(y,x),v);Ny(y,x)}return null}function p(y,b,x,v,S){if(typeof v==\"string\"&&v!==\"\"||typeof v==\"number\"||typeof v==\"bigint\")return y=y.get(x)||null,i(b,y,\"\"+v,S);if(typeof v==\"object\"&&v!==null){switch(v.$$typeof){case Ly:return y=y.get(v.key===null?x:v.key)||null,l(b,y,v,S);case Ip:return y=y.get(v.key===null?x:v.key)||null,u(b,y,v,S);case ti:return v=_l(v),p(y,b,x,v,S)}if(Mp(v)||kp(v))return y=y.get(x)||null,c(b,y,v,S,null);if(typeof v.then==\"function\")return p(y,b,x,Dy(v),S);if(v.$$typeof===aa)return p(y,b,x,Oy(b,v),S);Ny(b,v)}return null}function h(y,b,x,v){for(var S=null,E=null,w=b,k=b=0,A=null;w!==null&&k<x.length;k++){w.index>k?(A=w,w=null):A=w.sibling;var L=f(y,w,x[k],v);if(L===null){w===null&&(w=A);break}t&&w&&L.alternate===null&&e(y,w),b=s(L,b,k),E===null?S=L:E.sibling=L,E=L,w=A}if(k===x.length)return n(y,w),$e&&oa(y,k),S;if(w===null){for(;k<x.length;k++)w=d(y,x[k],v),w!==null&&(b=s(w,b,k),E===null?S=w:E.sibling=w,E=w);return $e&&oa(y,k),S}for(w=r(w);k<x.length;k++)A=p(w,y,k,x[k],v),A!==null&&(t&&A.alternate!==null&&w.delete(A.key===null?k:A.key),b=s(A,b,k),E===null?S=A:E.sibling=A,E=A);return t&&w.forEach(function(_){return e(y,_)}),$e&&oa(y,k),S}function g(y,b,x,v){if(x==null)throw Error(B(151));for(var S=null,E=null,w=b,k=b=0,A=null,L=x.next();w!==null&&!L.done;k++,L=x.next()){w.index>k?(A=w,w=null):A=w.sibling;var _=f(y,w,L.value,v);if(_===null){w===null&&(w=A);break}t&&w&&_.alternate===null&&e(y,w),b=s(_,b,k),E===null?S=_:E.sibling=_,E=_,w=A}if(L.done)return n(y,w),$e&&oa(y,k),S;if(w===null){for(;!L.done;k++,L=x.next())L=d(y,L.value,v),L!==null&&(b=s(L,b,k),E===null?S=L:E.sibling=L,E=L);return $e&&oa(y,k),S}for(w=r(w);!L.done;k++,L=x.next())L=p(w,y,k,L.value,v),L!==null&&(t&&L.alternate!==null&&w.delete(L.key===null?k:L.key),b=s(L,b,k),E===null?S=L:E.sibling=L,E=L);return t&&w.forEach(function(P){return e(y,P)}),$e&&oa(y,k),S}function m(y,b,x,v){if(typeof x==\"object\"&&x!==null&&x.type===Cc&&x.key===null&&(x=x.props.children),typeof x==\"object\"&&x!==null){switch(x.$$typeof){case Ly:e:{for(var S=x.key;b!==null;){if(b.key===S){if(S=x.type,S===Cc){if(b.tag===7){n(y,b.sibling),v=o(b,x.props.children),v.return=y,y=v;break e}}else if(b.elementType===S||typeof S==\"object\"&&S!==null&&S.$$typeof===ti&&_l(S)===b.type){n(y,b.sibling),v=o(b,x.props),Lp(v,x),v.return=y,y=v;break e}n(y,b);break}else e(y,b);b=b.sibling}x.type===Cc?(v=Nl(x.props.children,y.mode,v,x.key),v.return=y,y=v):(v=Gy(x.type,x.key,x.props,null,y.mode,v),Lp(v,x),v.return=y,y=v)}return a(y);case Ip:e:{for(S=x.key;b!==null;){if(b.key===S)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),v=o(b,x.children||[]),v.return=y,y=v;break e}else{n(y,b);break}else e(y,b);b=b.sibling}v=FS(x,y.mode,v),v.return=y,y=v}return a(y);case ti:return x=_l(x),m(y,b,x,v)}if(Mp(x))return h(y,b,x,v);if(kp(x)){if(S=kp(x),typeof S!=\"function\")throw Error(B(150));return x=S.call(x),g(y,b,x,v)}if(typeof x.then==\"function\")return m(y,b,Dy(x),v);if(x.$$typeof===aa)return m(y,b,Oy(y,x),v);Ny(y,x)}return typeof x==\"string\"&&x!==\"\"||typeof x==\"number\"||typeof x==\"bigint\"?(x=\"\"+x,b!==null&&b.tag===6?(n(y,b.sibling),v=o(b,x),v.return=y,y=v):(n(y,b),v=zS(x,y.mode,v),v.return=y,y=v),a(y)):n(y,b)}return function(y,b,x,v){try{eh=0;var S=m(y,b,x,v);return Hc=null,S}catch(w){if(w===rd||w===Fb)throw w;var E=zr(29,w,null,y.mode);return E.lanes=v,E.return=y,E}}}var $l=bM(!0),vM=bM(!1),ni=!1;function wC(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tk(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function hi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function mi(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(Je&2)!==0){var o=r.pending;return o===null?e.next=e:(e.next=o.next,o.next=e),r.pending=e,e=cb(t),cM(t,null,n),e}return zb(t,r,e,n),cb(t)}function Fp(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,BI(t,n)}}function $S(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?o=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?o=s=e:s=s.next=e}else o=s=e;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Rk=!1;function Hp(){if(Rk){var t=Fc;if(t!==null)throw t}}function $p(t,e,n,r){Rk=!1;var o=t.updateQueue;ni=!1;var s=o.firstBaseUpdate,a=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var l=i,u=l.next;l.next=null,a===null?s=u:a.next=u,a=l;var c=t.alternate;c!==null&&(c=c.updateQueue,i=c.lastBaseUpdate,i!==a&&(i===null?c.firstBaseUpdate=u:i.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=o.baseState;a=0,c=u=l=null,i=s;do{var f=i.lane&-536870913,p=f!==i.lane;if(p?(Fe&f)===f:(r&f)===f){f!==0&&f===Kc&&(Rk=!0),c!==null&&(c=c.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});e:{var h=t,g=i;f=e;var m=n;switch(g.tag){case 1:if(h=g.payload,typeof h==\"function\"){d=h.call(m,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==\"function\"?h.call(m,d,f):h,f==null)break e;d=wt({},d,f);break e;case 2:ni=!0}}f=i.callback,f!==null&&(t.flags|=64,p&&(t.flags|=8192),p=o.callbacks,p===null?o.callbacks=[f]:p.push(f))}else p={lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,a|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;p=i,i=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,s===null&&(o.shared.lanes=0),Ci|=a,t.lanes=a,t.memoizedState=d}}function xM(t,e){if(typeof t!=\"function\")throw Error(B(191,t));t.call(e)}function wM(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)xM(n[t],e)}var Gc=hs(null),hb=hs(0);function IR(t,e){t=ga,ht(hb,t),ht(Gc,e),ga=t|e.baseLanes}function Ik(){ht(hb,ga),ht(Gc,Gc.current)}function SC(){ga=hb.current,mn(Gc),mn(hb)}var Vr=hs(null),xo=null;function oi(t){var e=t.alternate;ht(Ut,Ut.current&1),ht(Vr,t),xo===null&&(e===null||Gc.current!==null||e.memoizedState!==null)&&(xo=t)}function Mk(t){ht(Ut,Ut.current),ht(Vr,t),xo===null&&(xo=t)}function SM(t){t.tag===22?(ht(Ut,Ut.current),ht(Vr,t),xo===null&&(xo=t)):si(t)}function si(){ht(Ut,Ut.current),ht(Vr,Vr.current)}function Br(t){mn(Vr),xo===t&&(xo=null),mn(Ut)}var Ut=hs(0);function mb(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Jk(n)||Yk(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder===\"forwards\"||e.memoizedProps.revealOrder===\"backwards\"||e.memoizedProps.revealOrder===\"unstable_legacy-backwards\"||e.memoizedProps.revealOrder===\"together\")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var pa=0,Ae=null,lt=null,Wt=null,gb=!1,$c=!1,Ul=!1,yb=0,th=0,Uc=null,l5=0;function Nt(){throw Error(B(321))}function kC(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!qr(t[n],e[n]))return!1;return!0}function CC(t,e,n,r,o,s){return pa=s,Ae=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,be.H=t===null||t.memoizedState===null?QM:NC,Ul=!1,s=n(r,o),Ul=!1,$c&&(s=CM(e,n,r,o)),kM(t),s}function kM(t){be.H=nh;var e=lt!==null&<.next!==null;if(pa=0,Wt=lt=Ae=null,gb=!1,th=0,Uc=null,e)throw Error(B(300));t===null||Yt||(t=t.dependencies,t!==null&&fb(t)&&(Yt=!0))}function CM(t,e,n,r){Ae=t;var o=0;do{if($c&&(Uc=null),th=0,$c=!1,25<=o)throw Error(B(301));if(o+=1,Wt=lt=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}be.H=e_,s=e(n,r)}while($c);return s}function u5(){var t=be.H,e=t.useState()[0];return e=typeof e.then==\"function\"?mh(e):e,t=t.useState()[0],(lt!==null?lt.memoizedState:null)!==t&&(Ae.flags|=1024),e}function LC(){var t=yb!==0;return yb=0,t}function AC(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function EC(t){if(gb){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}gb=!1}pa=0,Wt=lt=Ae=null,$c=!1,th=yb=0,Uc=null}function or(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wt===null?Ae.memoizedState=Wt=t:Wt=Wt.next=t,Wt}function jt(){if(lt===null){var t=Ae.alternate;t=t!==null?t.memoizedState:null}else t=lt.next;var e=Wt===null?Ae.memoizedState:Wt.next;if(e!==null)Wt=e,lt=t;else{if(t===null)throw Ae.alternate===null?Error(B(467)):Error(B(310));lt=t,t={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Wt===null?Ae.memoizedState=Wt=t:Wt=Wt.next=t}return Wt}function Hb(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mh(t){var e=th;return th+=1,Uc===null&&(Uc=[]),t=yM(Uc,t,e),e=Ae,(Wt===null?e.memoizedState:Wt.next)===null&&(e=e.alternate,be.H=e===null||e.memoizedState===null?QM:NC),t}function $b(t){if(t!==null&&typeof t==\"object\"){if(typeof t.then==\"function\")return mh(t);if(t.$$typeof===aa)return En(t)}throw Error(B(438,String(t)))}function TC(t){var e=null,n=Ae.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var r=Ae.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(e={data:r.data.map(function(o){return o.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=Hb(),Ae.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),r=0;r<t;r++)n[r]=Wq;return e.index++,n}function ha(t,e){return typeof e==\"function\"?e(t):e}function Xy(t){var e=jt();return RC(e,lt,t)}function RC(t,e,n){var r=t.queue;if(r===null)throw Error(B(311));r.lastRenderedReducer=n;var o=t.baseQueue,s=r.pending;if(s!==null){if(o!==null){var a=o.next;o.next=s.next,s.next=a}e.baseQueue=o=s,r.pending=null}if(s=t.baseState,o===null)t.memoizedState=s;else{e=o.next;var i=a=null,l=null,u=e,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Fe&d)===d:(pa&d)===d){var f=u.revertLane;if(f===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===Kc&&(c=!0);else if((pa&f)===f){u=u.next,f===Kc&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(i=l=d,a=s):l=l.next=d,Ae.lanes|=f,Ci|=f;d=u.action,Ul&&n(s,d),s=u.hasEagerState?u.eagerState:n(s,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(i=l=f,a=s):l=l.next=f,Ae.lanes|=d,Ci|=d;u=u.next}while(u!==null&&u!==e);if(l===null?a=s:l.next=i,!qr(s,t.memoizedState)&&(Yt=!0,c&&(n=Fc,n!==null)))throw n;t.memoizedState=s,t.baseState=a,t.baseQueue=l,r.lastRenderedState=s}return o===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function US(t){var e=jt(),n=e.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=t;var r=n.dispatch,o=n.pending,s=e.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do s=t(s,a.action),a=a.next;while(a!==o);qr(s,e.memoizedState)||(Yt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function LM(t,e,n){var r=Ae,o=jt(),s=$e;if(s){if(n===void 0)throw Error(B(407));n=n()}else n=e();var a=!qr((lt||o).memoizedState,n);if(a&&(o.memoizedState=n,Yt=!0),o=o.queue,IC(TM.bind(null,r,o,t),[t]),o.getSnapshot!==e||a||Wt!==null&&Wt.memoizedState.tag&1){if(r.flags|=2048,Wc(9,{destroy:void 0},EM.bind(null,r,o,n,e),null),ct===null)throw Error(B(349));s||(pa&127)!==0||AM(r,e,n)}return n}function AM(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Ae.updateQueue,e===null?(e=Hb(),Ae.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function EM(t,e,n,r){e.value=n,e.getSnapshot=r,RM(e)&&IM(t)}function TM(t,e,n){return n(function(){RM(e)&&IM(t)})}function RM(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!qr(t,n)}catch{return!0}}function IM(t){var e=Gl(t,2);e!==null&&kr(e,t,2)}function _k(t){var e=or();if(typeof t==\"function\"){var n=t;if(t=n(),Ul){ii(!0);try{n()}finally{ii(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:t},e}function MM(t,e,n,r){return t.baseState=n,RC(t,lt,typeof r==\"function\"?r:ha)}function c5(t,e,n,r,o){if(jb(t))throw Error(B(485));if(t=e.action,t!==null){var s={payload:o,action:t,next:null,isTransition:!0,status:\"pending\",value:null,reason:null,listeners:[],then:function(a){s.listeners.push(a)}};be.T!==null?n(!0):s.isTransition=!1,r(s),n=e.pending,n===null?(s.next=e.pending=s,_M(e,s)):(s.next=n.next,e.pending=n.next=s)}}function _M(t,e){var n=e.action,r=e.payload,o=t.state;if(e.isTransition){var s=be.T,a={};be.T=a;try{var i=n(o,r),l=be.S;l!==null&&l(a,i),MR(t,e,i)}catch(u){Ok(t,e,u)}finally{s!==null&&a.types!==null&&(s.types=a.types),be.T=s}}else try{s=n(o,r),MR(t,e,s)}catch(u){Ok(t,e,u)}}function MR(t,e,n){n!==null&&typeof n==\"object\"&&typeof n.then==\"function\"?n.then(function(r){_R(t,e,r)},function(r){return Ok(t,e,r)}):_R(t,e,n)}function _R(t,e,n){e.status=\"fulfilled\",e.value=n,OM(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,_M(t,n)))}function Ok(t,e,n){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status=\"rejected\",e.reason=n,OM(e),e=e.next;while(e!==r)}t.action=null}function OM(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function DM(t,e){return e}function OR(t,e){if($e){var n=ct.formState;if(n!==null){e:{var r=Ae;if($e){if(xt){t:{for(var o=xt,s=vo;o.nodeType!==8;){if(!s){o=null;break t}if(o=wo(o.nextSibling),o===null){o=null;break t}}s=o.data,o=s===\"F!\"||s===\"F\"?o:null}if(o){xt=wo(o.nextSibling),r=o.data===\"F!\";break e}}Si(r)}r=!1}r&&(e=n[0])}}return n=or(),n.memoizedState=n.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:DM,lastRenderedState:e},n.queue=r,n=JM.bind(null,Ae,r),r.dispatch=n,r=_k(!1),s=DC.bind(null,Ae,!1,r.queue),r=or(),o={state:e,dispatch:null,action:t,pending:null},r.queue=o,n=c5.bind(null,Ae,o,s,n),o.dispatch=n,r.memoizedState=t,[e,n,!1]}function DR(t){var e=jt();return NM(e,lt,t)}function NM(t,e,n){if(e=RC(t,e,DM)[0],t=Xy(ha)[0],typeof e==\"object\"&&e!==null&&typeof e.then==\"function\")try{var r=mh(e)}catch(a){throw a===rd?Fb:a}else r=e;e=jt();var o=e.queue,s=o.dispatch;return n!==e.memoizedState&&(Ae.flags|=2048,Wc(9,{destroy:void 0},d5.bind(null,o,n),null)),[r,s,t]}function d5(t,e){t.action=e}function NR(t){var e=jt(),n=lt;if(n!==null)return NM(e,n,t);jt(),e=e.memoizedState,n=jt();var r=n.queue.dispatch;return n.memoizedState=t,[e,r,!1]}function Wc(t,e,n,r){return t={tag:t,create:n,deps:r,inst:e,next:null},e=Ae.updateQueue,e===null&&(e=Hb(),Ae.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t),t}function PM(){return jt().memoizedState}function Jy(t,e,n,r){var o=or();Ae.flags|=t,o.memoizedState=Wc(1|e,{destroy:void 0},n,r===void 0?null:r)}function Ub(t,e,n,r){var o=jt();r=r===void 0?null:r;var s=o.memoizedState.inst;lt!==null&&r!==null&&kC(r,lt.memoizedState.deps)?o.memoizedState=Wc(e,s,n,r):(Ae.flags|=t,o.memoizedState=Wc(1|e,s,n,r))}function PR(t,e){Jy(8390656,8,t,e)}function IC(t,e){Ub(2048,8,t,e)}function f5(t){Ae.flags|=4;var e=Ae.updateQueue;if(e===null)e=Hb(),Ae.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function BM(t){var e=jt().memoizedState;return f5({ref:e,nextImpl:t}),function(){if((Je&2)!==0)throw Error(B(440));return e.impl.apply(void 0,arguments)}}function zM(t,e){return Ub(4,2,t,e)}function FM(t,e){return Ub(4,4,t,e)}function HM(t,e){if(typeof e==\"function\"){t=t();var n=e(t);return function(){typeof n==\"function\"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function $M(t,e,n){n=n!=null?n.concat([t]):null,Ub(4,4,HM.bind(null,e,t),n)}function MC(){}function UM(t,e){var n=jt();e=e===void 0?null:e;var r=n.memoizedState;return e!==null&&kC(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function jM(t,e){var n=jt();e=e===void 0?null:e;var r=n.memoizedState;if(e!==null&&kC(e,r[1]))return r[0];if(r=t(),Ul){ii(!0);try{t()}finally{ii(!1)}}return n.memoizedState=[r,e],r}function _C(t,e,n){return n===void 0||(pa&1073741824)!==0&&(Fe&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=M_(),Ae.lanes|=t,Ci|=t,n)}function qM(t,e,n,r){return qr(n,e)?n:Gc.current!==null?(t=_C(t,n,r),qr(t,e)||(Yt=!0),t):(pa&42)===0||(pa&1073741824)!==0&&(Fe&261930)===0?(Yt=!0,t.memoizedState=n):(t=M_(),Ae.lanes|=t,Ci|=t,e)}function VM(t,e,n,r,o){var s=Ye.p;Ye.p=s!==0&&8>s?s:8;var a=be.T,i={};be.T=i,DC(t,!1,e,n);try{var l=o(),u=be.S;if(u!==null&&u(i,l),l!==null&&typeof l==\"object\"&&typeof l.then==\"function\"){var c=i5(l,r);Up(t,e,c,jr(t))}else Up(t,e,r,jr(t))}catch(d){Up(t,e,{then:function(){},status:\"rejected\",reason:d},jr())}finally{Ye.p=s,a!==null&&i.types!==null&&(a.types=i.types),be.T=a}}function p5(){}function Dk(t,e,n,r){if(t.tag!==5)throw Error(B(476));var o=KM(t).queue;VM(t,o,e,Dl,n===null?p5:function(){return GM(t),n(r)})}function KM(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Dl,baseState:Dl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:Dl},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function GM(t){var e=KM(t);e.next===null&&(e=t.alternate.memoizedState),Up(t,e.next.queue,{},jr())}function OC(){return En(sh)}function WM(){return jt().memoizedState}function XM(){return jt().memoizedState}function h5(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=jr();t=hi(n);var r=mi(e,t,n);r!==null&&(kr(r,e,n),Fp(r,e,n)),e={cache:bC()},t.payload=e;return}e=e.return}}function m5(t,e,n){var r=jr();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},jb(t)?YM(e,n):(n=hC(t,e,n,r),n!==null&&(kr(n,t,r),ZM(n,e,r)))}function JM(t,e,n){var r=jr();Up(t,e,n,r)}function Up(t,e,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(jb(t))YM(e,o);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,i=s(a,n);if(o.hasEagerState=!0,o.eagerState=i,qr(i,a))return zb(t,e,o,0),ct===null&&Bb(),!1}catch{}if(n=hC(t,e,o,r),n!==null)return kr(n,t,r),ZM(n,e,r),!0}return!1}function DC(t,e,n,r){if(r={lane:2,revertLane:jC(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},jb(t)){if(e)throw Error(B(479))}else e=hC(t,n,r,2),e!==null&&kr(e,t,2)}function jb(t){var e=t.alternate;return t===Ae||e!==null&&e===Ae}function YM(t,e){$c=gb=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function ZM(t,e,n){if((n&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,BI(t,n)}}var nh={readContext:En,use:$b,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};nh.useEffectEvent=Nt;var QM={readContext:En,use:$b,useCallback:function(t,e){return or().memoizedState=[t,e===void 0?null:e],t},useContext:En,useEffect:PR,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Jy(4194308,4,HM.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Jy(4194308,4,t,e)},useInsertionEffect:function(t,e){Jy(4,2,t,e)},useMemo:function(t,e){var n=or();e=e===void 0?null:e;var r=t();if(Ul){ii(!0);try{t()}finally{ii(!1)}}return n.memoizedState=[r,e],r},useReducer:function(t,e,n){var r=or();if(n!==void 0){var o=n(e);if(Ul){ii(!0);try{n(e)}finally{ii(!1)}}}else o=e;return r.memoizedState=r.baseState=o,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:o},r.queue=t,t=t.dispatch=m5.bind(null,Ae,t),[r.memoizedState,t]},useRef:function(t){var e=or();return t={current:t},e.memoizedState=t},useState:function(t){t=_k(t);var e=t.queue,n=JM.bind(null,Ae,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:MC,useDeferredValue:function(t,e){var n=or();return _C(n,t,e)},useTransition:function(){var t=_k(!1);return t=VM.bind(null,Ae,t.queue,!0,!1),or().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var r=Ae,o=or();if($e){if(n===void 0)throw Error(B(407));n=n()}else{if(n=e(),ct===null)throw Error(B(349));(Fe&127)!==0||AM(r,e,n)}o.memoizedState=n;var s={value:n,getSnapshot:e};return o.queue=s,PR(TM.bind(null,r,s,t),[t]),r.flags|=2048,Wc(9,{destroy:void 0},EM.bind(null,r,s,n,e),null),n},useId:function(){var t=or(),e=ct.identifierPrefix;if($e){var n=ds,r=cs;n=(r&~(1<<32-Ur(r)-1)).toString(32)+n,e=\"_\"+e+\"R_\"+n,n=yb++,0<n&&(e+=\"H\"+n.toString(32)),e+=\"_\"}else n=l5++,e=\"_\"+e+\"r_\"+n.toString(32)+\"_\";return t.memoizedState=e},useHostTransitionStatus:OC,useFormState:OR,useActionState:OR,useOptimistic:function(t){var e=or();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=DC.bind(null,Ae,!0,n),n.dispatch=e,[t,e]},useMemoCache:TC,useCacheRefresh:function(){return or().memoizedState=h5.bind(null,Ae)},useEffectEvent:function(t){var e=or(),n={impl:t};return e.memoizedState=n,function(){if((Je&2)!==0)throw Error(B(440));return n.impl.apply(void 0,arguments)}}},NC={readContext:En,use:$b,useCallback:UM,useContext:En,useEffect:IC,useImperativeHandle:$M,useInsertionEffect:zM,useLayoutEffect:FM,useMemo:jM,useReducer:Xy,useRef:PM,useState:function(){return Xy(ha)},useDebugValue:MC,useDeferredValue:function(t,e){var n=jt();return qM(n,lt.memoizedState,t,e)},useTransition:function(){var t=Xy(ha)[0],e=jt().memoizedState;return[typeof t==\"boolean\"?t:mh(t),e]},useSyncExternalStore:LM,useId:WM,useHostTransitionStatus:OC,useFormState:DR,useActionState:DR,useOptimistic:function(t,e){var n=jt();return MM(n,lt,t,e)},useMemoCache:TC,useCacheRefresh:XM};NC.useEffectEvent=BM;var e_={readContext:En,use:$b,useCallback:UM,useContext:En,useEffect:IC,useImperativeHandle:$M,useInsertionEffect:zM,useLayoutEffect:FM,useMemo:jM,useReducer:US,useRef:PM,useState:function(){return US(ha)},useDebugValue:MC,useDeferredValue:function(t,e){var n=jt();return lt===null?_C(n,t,e):qM(n,lt.memoizedState,t,e)},useTransition:function(){var t=US(ha)[0],e=jt().memoizedState;return[typeof t==\"boolean\"?t:mh(t),e]},useSyncExternalStore:LM,useId:WM,useHostTransitionStatus:OC,useFormState:NR,useActionState:NR,useOptimistic:function(t,e){var n=jt();return lt!==null?MM(n,lt,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:TC,useCacheRefresh:XM};e_.useEffectEvent=BM;function jS(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:wt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Nk={enqueueSetState:function(t,e,n){t=t._reactInternals;var r=jr(),o=hi(r);o.payload=e,n!=null&&(o.callback=n),e=mi(t,o,r),e!==null&&(kr(e,t,r),Fp(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=jr(),o=hi(r);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=mi(t,o,r),e!==null&&(kr(e,t,r),Fp(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=jr(),r=hi(n);r.tag=2,e!=null&&(r.callback=e),e=mi(t,r,n),e!==null&&(kr(e,t,n),Fp(e,t,n))}};function BR(t,e,n,r,o,s,a){return t=t.stateNode,typeof t.shouldComponentUpdate==\"function\"?t.shouldComponentUpdate(r,s,a):e.prototype&&e.prototype.isPureReactComponent?!Yp(n,r)||!Yp(o,s):!0}function zR(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps==\"function\"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps==\"function\"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Nk.enqueueReplaceState(e,e.state,null)}function jl(t,e){var n=e;if(\"ref\"in e){n={};for(var r in e)r!==\"ref\"&&(n[r]=e[r])}if(t=t.defaultProps){n===e&&(n=wt({},n));for(var o in t)n[o]===void 0&&(n[o]=t[o])}return n}function t_(t){ub(t)}function n_(t){console.error(t)}function r_(t){ub(t)}function bb(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function FR(t,e,n){try{var r=t.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Pk(t,e,n){return n=hi(n),n.tag=3,n.payload={element:null},n.callback=function(){bb(t,e)},n}function o_(t){return t=hi(t),t.tag=3,t}function s_(t,e,n,r){var o=n.type.getDerivedStateFromError;if(typeof o==\"function\"){var s=r.value;t.payload=function(){return o(s)},t.callback=function(){FR(e,n,r)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch==\"function\"&&(t.callback=function(){FR(e,n,r),typeof o!=\"function\"&&(gi===null?gi=new Set([this]):gi.add(this));var i=r.stack;this.componentDidCatch(r.value,{componentStack:i!==null?i:\"\"})})}function g5(t,e,n,r,o){if(n.flags|=32768,r!==null&&typeof r==\"object\"&&typeof r.then==\"function\"){if(e=n.alternate,e!==null&&nd(e,n,o,!0),n=Vr.current,n!==null){switch(n.tag){case 31:case 13:return xo===null?kb():n.alternate===null&&Pt===0&&(Pt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===pb?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([r]):e.add(r),ek(t,r,o)),!1;case 22:return n.flags|=65536,r===pb?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([r]):n.add(r)),ek(t,r,o)),!1}throw Error(B(435,n.tag))}return ek(t,r,o),kb(),!1}if($e)return e=Vr.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=o,r!==kk&&(t=Error(B(422),{cause:r}),Qp(bo(t,n)))):(r!==kk&&(e=Error(B(423),{cause:r}),Qp(bo(e,n))),t=t.current.alternate,t.flags|=65536,o&=-o,t.lanes|=o,r=bo(r,n),o=Pk(t.stateNode,r,o),$S(t,o),Pt!==4&&(Pt=2)),!1;var s=Error(B(520),{cause:r});if(s=bo(s,n),Vp===null?Vp=[s]:Vp.push(s),Pt!==4&&(Pt=2),e===null)return!0;r=bo(r,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=o&-o,n.lanes|=t,t=Pk(n.stateNode,r,t),$S(n,t),!1;case 1:if(e=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError==\"function\"||s!==null&&typeof s.componentDidCatch==\"function\"&&(gi===null||!gi.has(s))))return n.flags|=65536,o&=-o,n.lanes|=o,o=o_(o),s_(o,t,n,r),$S(n,o),!1}n=n.return}while(n!==null);return!1}var PC=Error(B(461)),Yt=!1;function Cn(t,e,n,r){e.child=t===null?vM(e,null,n,r):$l(e,t.child,n,r)}function HR(t,e,n,r,o){n=n.render;var s=e.ref;if(\"ref\"in r){var a={};for(var i in r)i!==\"ref\"&&(a[i]=r[i])}else a=r;return Hl(e),r=CC(t,e,n,a,s,o),i=LC(),t!==null&&!Yt?(AC(t,e,o),ma(t,e,o)):($e&&i&&gC(e),e.flags|=1,Cn(t,e,r,o),e.child)}function $R(t,e,n,r,o){if(t===null){var s=n.type;return typeof s==\"function\"&&!mC(s)&&s.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=s,a_(t,e,s,r,o)):(t=Gy(n.type,null,r,e,e.mode,o),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!BC(t,o)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:Yp,n(a,r)&&t.ref===e.ref)return ma(t,e,o)}return e.flags|=1,t=ua(s,r),t.ref=e.ref,t.return=e,e.child=t}function a_(t,e,n,r,o){if(t!==null){var s=t.memoizedProps;if(Yp(s,r)&&t.ref===e.ref)if(Yt=!1,e.pendingProps=r=s,BC(t,o))(t.flags&131072)!==0&&(Yt=!0);else return e.lanes=t.lanes,ma(t,e,o)}return Bk(t,e,n,r,o)}function i_(t,e,n,r){var o=r.children,s=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===\"hidden\"){if((e.flags&128)!==0){if(s=s!==null?s.baseLanes|n:n,t!==null){for(r=e.child=t.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~s}else r=0,e.child=null;return UR(t,e,s,n,r)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Wy(e,s!==null?s.cachePool:null),s!==null?IR(e,s):Ik(),SM(e);else return r=e.lanes=536870912,UR(t,e,s!==null?s.baseLanes|n:n,n,r)}else s!==null?(Wy(e,s.cachePool),IR(e,s),si(e),e.memoizedState=null):(t!==null&&Wy(e,null),Ik(),si(e));return Cn(t,e,o,n),e.child}function Op(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function UR(t,e,n,r,o){var s=vC();return s=s===null?null:{parent:Jt._currentValue,pool:s},e.memoizedState={baseLanes:n,cachePool:s},t!==null&&Wy(e,null),Ik(),SM(e),t!==null&&nd(t,e,r,!0),e.childLanes=o,null}function Yy(t,e){return e=vb({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function jR(t,e,n){return $l(e,t.child,null,n),t=Yy(e,e.pendingProps),t.flags|=2,Br(e),e.memoizedState=null,t}function y5(t,e,n){var r=e.pendingProps,o=(e.flags&128)!==0;if(e.flags&=-129,t===null){if($e){if(r.mode===\"hidden\")return t=Yy(e,r),e.lanes=536870912,Op(null,t);if(Mk(e),(t=xt)?(t=Q_(t,vo),t=t!==null&&t.data===\"&\"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:wi!==null?{id:cs,overflow:ds}:null,retryLane:536870912,hydrationErrors:null},n=fM(t),n.return=e,e.child=n,An=e,xt=null)):t=null,t===null)throw Si(e);return e.lanes=536870912,null}return Yy(e,r)}var s=t.memoizedState;if(s!==null){var a=s.dehydrated;if(Mk(e),o)if(e.flags&256)e.flags&=-257,e=jR(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(B(558));else if(Yt||nd(t,e,n,!1),o=(n&t.childLanes)!==0,Yt||o){if(r=ct,r!==null&&(a=zI(r,n),a!==0&&a!==s.retryLane))throw s.retryLane=a,Gl(t,a),kr(r,t,a),PC;kb(),e=jR(t,e,n)}else t=s.treeContext,xt=wo(a.nextSibling),An=e,$e=!0,pi=null,vo=!1,t!==null&&hM(e,t),e=Yy(e,r),e.flags|=4096;return e}return t=ua(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Zy(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!=\"function\"&&typeof n!=\"object\")throw Error(B(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Bk(t,e,n,r,o){return Hl(e),n=CC(t,e,n,r,void 0,o),r=LC(),t!==null&&!Yt?(AC(t,e,o),ma(t,e,o)):($e&&r&&gC(e),e.flags|=1,Cn(t,e,n,o),e.child)}function qR(t,e,n,r,o,s){return Hl(e),e.updateQueue=null,n=CM(e,r,n,o),kM(t),r=LC(),t!==null&&!Yt?(AC(t,e,s),ma(t,e,s)):($e&&r&&gC(e),e.flags|=1,Cn(t,e,n,s),e.child)}function VR(t,e,n,r,o){if(Hl(e),e.stateNode===null){var s=_c,a=n.contextType;typeof a==\"object\"&&a!==null&&(s=En(a)),s=new n(r,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Nk,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=r,s.state=e.memoizedState,s.refs={},wC(e),a=n.contextType,s.context=typeof a==\"object\"&&a!==null?En(a):_c,s.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a==\"function\"&&(jS(e,n,a,r),s.state=e.memoizedState),typeof n.getDerivedStateFromProps==\"function\"||typeof s.getSnapshotBeforeUpdate==\"function\"||typeof s.UNSAFE_componentWillMount!=\"function\"&&typeof s.componentWillMount!=\"function\"||(a=s.state,typeof s.componentWillMount==\"function\"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount==\"function\"&&s.UNSAFE_componentWillMount(),a!==s.state&&Nk.enqueueReplaceState(s,s.state,null),$p(e,r,s,o),Hp(),s.state=e.memoizedState),typeof s.componentDidMount==\"function\"&&(e.flags|=4194308),r=!0}else if(t===null){s=e.stateNode;var i=e.memoizedProps,l=jl(n,i);s.props=l;var u=s.context,c=n.contextType;a=_c,typeof c==\"object\"&&c!==null&&(a=En(c));var d=n.getDerivedStateFromProps;c=typeof d==\"function\"||typeof s.getSnapshotBeforeUpdate==\"function\",i=e.pendingProps!==i,c||typeof s.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof s.componentWillReceiveProps!=\"function\"||(i||u!==a)&&zR(e,s,r,a),ni=!1;var f=e.memoizedState;s.state=f,$p(e,r,s,o),Hp(),u=e.memoizedState,i||f!==u||ni?(typeof d==\"function\"&&(jS(e,n,d,r),u=e.memoizedState),(l=ni||BR(e,n,l,r,f,u,a))?(c||typeof s.UNSAFE_componentWillMount!=\"function\"&&typeof s.componentWillMount!=\"function\"||(typeof s.componentWillMount==\"function\"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount==\"function\"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount==\"function\"&&(e.flags|=4194308)):(typeof s.componentDidMount==\"function\"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=u),s.props=r,s.state=u,s.context=a,r=l):(typeof s.componentDidMount==\"function\"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,Tk(t,e),a=e.memoizedProps,c=jl(n,a),s.props=c,d=e.pendingProps,f=s.context,u=n.contextType,l=_c,typeof u==\"object\"&&u!==null&&(l=En(u)),i=n.getDerivedStateFromProps,(u=typeof i==\"function\"||typeof s.getSnapshotBeforeUpdate==\"function\")||typeof s.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof s.componentWillReceiveProps!=\"function\"||(a!==d||f!==l)&&zR(e,s,r,l),ni=!1,f=e.memoizedState,s.state=f,$p(e,r,s,o),Hp();var p=e.memoizedState;a!==d||f!==p||ni||t!==null&&t.dependencies!==null&&fb(t.dependencies)?(typeof i==\"function\"&&(jS(e,n,i,r),p=e.memoizedState),(c=ni||BR(e,n,c,r,f,p,l)||t!==null&&t.dependencies!==null&&fb(t.dependencies))?(u||typeof s.UNSAFE_componentWillUpdate!=\"function\"&&typeof s.componentWillUpdate!=\"function\"||(typeof s.componentWillUpdate==\"function\"&&s.componentWillUpdate(r,p,l),typeof s.UNSAFE_componentWillUpdate==\"function\"&&s.UNSAFE_componentWillUpdate(r,p,l)),typeof s.componentDidUpdate==\"function\"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate==\"function\"&&(e.flags|=1024)):(typeof s.componentDidUpdate!=\"function\"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!=\"function\"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),s.props=r,s.state=p,s.context=l,r=c):(typeof s.componentDidUpdate!=\"function\"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!=\"function\"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return s=r,Zy(t,e),r=(e.flags&128)!==0,s||r?(s=e.stateNode,n=r&&typeof n.getDerivedStateFromError!=\"function\"?null:s.render(),e.flags|=1,t!==null&&r?(e.child=$l(e,t.child,null,o),e.child=$l(e,null,n,o)):Cn(t,e,n,o),e.memoizedState=s.state,t=e.child):t=ma(t,e,o),t}function KR(t,e,n,r){return Fl(),e.flags|=256,Cn(t,e,n,r),e.child}var qS={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function VS(t){return{baseLanes:t,cachePool:gM()}}function KS(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Fr),t}function l_(t,e,n){var r=e.pendingProps,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(Ut.current&2)!==0),a&&(o=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if($e){if(o?oi(e):si(e),(t=xt)?(t=Q_(t,vo),t=t!==null&&t.data!==\"&\"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:wi!==null?{id:cs,overflow:ds}:null,retryLane:536870912,hydrationErrors:null},n=fM(t),n.return=e,e.child=n,An=e,xt=null)):t=null,t===null)throw Si(e);return Yk(t)?e.lanes=32:e.lanes=536870912,null}var i=r.children;return r=r.fallback,o?(si(e),o=e.mode,i=vb({mode:\"hidden\",children:i},o),r=Nl(r,o,n,null),i.return=e,r.return=e,i.sibling=r,e.child=i,r=e.child,r.memoizedState=VS(n),r.childLanes=KS(t,a,n),e.memoizedState=qS,Op(null,r)):(oi(e),zk(e,i))}var l=t.memoizedState;if(l!==null&&(i=l.dehydrated,i!==null)){if(s)e.flags&256?(oi(e),e.flags&=-257,e=GS(t,e,n)):e.memoizedState!==null?(si(e),e.child=t.child,e.flags|=128,e=null):(si(e),i=r.fallback,o=e.mode,r=vb({mode:\"visible\",children:r.children},o),i=Nl(i,o,n,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,$l(e,t.child,null,n),r=e.child,r.memoizedState=VS(n),r.childLanes=KS(t,a,n),e.memoizedState=qS,e=Op(null,r));else if(oi(e),Yk(i)){if(a=i.nextSibling&&i.nextSibling.dataset,a)var u=a.dgst;a=u,r=Error(B(419)),r.stack=\"\",r.digest=a,Qp({value:r,source:null,stack:null}),e=GS(t,e,n)}else if(Yt||nd(t,e,n,!1),a=(n&t.childLanes)!==0,Yt||a){if(a=ct,a!==null&&(r=zI(a,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Gl(t,r),kr(a,t,r),PC;Jk(i)||kb(),e=GS(t,e,n)}else Jk(i)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,xt=wo(i.nextSibling),An=e,$e=!0,pi=null,vo=!1,t!==null&&hM(e,t),e=zk(e,r.children),e.flags|=4096);return e}return o?(si(e),i=r.fallback,o=e.mode,l=t.child,u=l.sibling,r=ua(l,{mode:\"hidden\",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?i=ua(u,i):(i=Nl(i,o,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,Op(null,r),r=e.child,i=t.child.memoizedState,i===null?i=VS(n):(o=i.cachePool,o!==null?(l=Jt._currentValue,o=o.parent!==l?{parent:l,pool:l}:o):o=gM(),i={baseLanes:i.baseLanes|n,cachePool:o}),r.memoizedState=i,r.childLanes=KS(t,a,n),e.memoizedState=qS,Op(t.child,r)):(oi(e),n=t.child,t=n.sibling,n=ua(n,{mode:\"visible\",children:r.children}),n.return=e,n.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=n,e.memoizedState=null,n)}function zk(t,e){return e=vb({mode:\"visible\",children:e},t.mode),e.return=t,t.child=e}function vb(t,e){return t=zr(22,t,null,e),t.lanes=0,t}function GS(t,e,n){return $l(e,t.child,null,n),t=zk(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function GR(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Lk(t.return,e,n)}function WS(t,e,n,r,o,s){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:s}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o,a.treeForkCount=s)}function u_(t,e,n){var r=e.pendingProps,o=r.revealOrder,s=r.tail;r=r.children;var a=Ut.current,i=(a&2)!==0;if(i?(a=a&1|2,e.flags|=128):a&=1,ht(Ut,a),Cn(t,e,r,n),r=$e?Zp:0,!i&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&GR(t,n,e);else if(t.tag===19)GR(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(o){case\"forwards\":for(n=e.child,o=null;n!==null;)t=n.alternate,t!==null&&mb(t)===null&&(o=n),n=n.sibling;n=o,n===null?(o=e.child,e.child=null):(o=n.sibling,n.sibling=null),WS(e,!1,o,n,s,r);break;case\"backwards\":case\"unstable_legacy-backwards\":for(n=null,o=e.child,e.child=null;o!==null;){if(t=o.alternate,t!==null&&mb(t)===null){e.child=o;break}t=o.sibling,o.sibling=n,n=o,o=t}WS(e,!0,n,null,s,r);break;case\"together\":WS(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function ma(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ci|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(nd(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(B(153));if(e.child!==null){for(t=e.child,n=ua(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ua(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function BC(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&fb(t)))}function b5(t,e,n){switch(e.tag){case 3:sb(e,e.stateNode.containerInfo),ri(e,Jt,t.memoizedState.cache),Fl();break;case 27:case 5:fk(e);break;case 4:sb(e,e.stateNode.containerInfo);break;case 10:ri(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Mk(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(oi(e),e.flags|=128,null):(n&e.child.childLanes)!==0?l_(t,e,n):(oi(e),t=ma(t,e,n),t!==null?t.sibling:null);oi(e);break;case 19:var o=(t.flags&128)!==0;if(r=(n&e.childLanes)!==0,r||(nd(t,e,n,!1),r=(n&e.childLanes)!==0),o){if(r)return u_(t,e,n);e.flags|=128}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ht(Ut,Ut.current),r)break;return null;case 22:return e.lanes=0,i_(t,e,n,e.pendingProps);case 24:ri(e,Jt,t.memoizedState.cache)}return ma(t,e,n)}function c_(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)Yt=!0;else{if(!BC(t,n)&&(e.flags&128)===0)return Yt=!1,b5(t,e,n);Yt=(t.flags&131072)!==0}else Yt=!1,$e&&(e.flags&1048576)!==0&&pM(e,Zp,e.index);switch(e.lanes=0,e.tag){case 16:e:{var r=e.pendingProps;if(t=_l(e.elementType),e.type=t,typeof t==\"function\")mC(t)?(r=jl(t,r),e.tag=1,e=VR(null,e,t,r,n)):(e.tag=0,e=Bk(null,e,t,r,n));else{if(t!=null){var o=t.$$typeof;if(o===tC){e.tag=11,e=HR(null,e,t,r,n);break e}else if(o===nC){e.tag=14,e=$R(null,e,t,r,n);break e}}throw e=ck(t)||t,Error(B(306,e,\"\"))}}return e;case 0:return Bk(t,e,e.type,e.pendingProps,n);case 1:return r=e.type,o=jl(r,e.pendingProps),VR(t,e,r,o,n);case 3:e:{if(sb(e,e.stateNode.containerInfo),t===null)throw Error(B(387));r=e.pendingProps;var s=e.memoizedState;o=s.element,Tk(t,e),$p(e,r,null,n);var a=e.memoizedState;if(r=a.cache,ri(e,Jt,r),r!==s.cache&&Ak(e,[Jt],n,!0),Hp(),r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=KR(t,e,r,n);break e}else if(r!==o){o=bo(Error(B(424)),e),Qp(o),e=KR(t,e,r,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName===\"HTML\"?t.ownerDocument.body:t,xt=wo(t.firstChild),An=e,$e=!0,pi=null,vo=!0,n=vM(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fl(),r===o){e=ma(t,e,n);break e}Cn(t,e,r,n)}e=e.child}return e;case 26:return Zy(t,e),t===null?(n=mI(e.type,null,e.pendingProps,null))?e.memoizedState=n:$e||(n=e.type,t=e.pendingProps,r=Eb(fi.current).createElement(n),r[Ln]=e,r[Cr]=t,Tn(r,n,t),hn(r),e.stateNode=r):e.memoizedState=mI(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return fk(e),t===null&&$e&&(r=e.stateNode=eO(e.type,e.pendingProps,fi.current),An=e,vo=!0,o=xt,Ai(e.type)?(Zk=o,xt=wo(r.firstChild)):xt=o),Cn(t,e,e.pendingProps.children,n),Zy(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&$e&&((o=r=xt)&&(r=K5(r,e.type,e.pendingProps,vo),r!==null?(e.stateNode=r,An=e,xt=wo(r.firstChild),vo=!1,o=!0):o=!1),o||Si(e)),fk(e),o=e.type,s=e.pendingProps,a=t!==null?t.memoizedProps:null,r=s.children,Wk(o,s)?r=null:a!==null&&Wk(o,a)&&(e.flags|=32),e.memoizedState!==null&&(o=CC(t,e,u5,null,null,n),sh._currentValue=o),Zy(t,e),Cn(t,e,r,n),e.child;case 6:return t===null&&$e&&((t=n=xt)&&(n=G5(n,e.pendingProps,vo),n!==null?(e.stateNode=n,An=e,xt=null,t=!0):t=!1),t||Si(e)),null;case 13:return l_(t,e,n);case 4:return sb(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=$l(e,null,r,n):Cn(t,e,r,n),e.child;case 11:return HR(t,e,e.type,e.pendingProps,n);case 7:return Cn(t,e,e.pendingProps,n),e.child;case 8:return Cn(t,e,e.pendingProps.children,n),e.child;case 12:return Cn(t,e,e.pendingProps.children,n),e.child;case 10:return r=e.pendingProps,ri(e,e.type,r.value),Cn(t,e,r.children,n),e.child;case 9:return o=e.type._context,r=e.pendingProps.children,Hl(e),o=En(o),r=r(o),e.flags|=1,Cn(t,e,r,n),e.child;case 14:return $R(t,e,e.type,e.pendingProps,n);case 15:return a_(t,e,e.type,e.pendingProps,n);case 19:return u_(t,e,n);case 31:return y5(t,e,n);case 22:return i_(t,e,n,e.pendingProps);case 24:return Hl(e),r=En(Jt),t===null?(o=vC(),o===null&&(o=ct,s=bC(),o.pooledCache=s,s.refCount++,s!==null&&(o.pooledCacheLanes|=n),o=s),e.memoizedState={parent:r,cache:o},wC(e),ri(e,Jt,o)):((t.lanes&n)!==0&&(Tk(t,e),$p(e,null,null,n),Hp()),o=t.memoizedState,s=e.memoizedState,o.parent!==r?(o={parent:r,cache:r},e.memoizedState=o,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=o),ri(e,Jt,r)):(r=s.cache,ri(e,Jt,r),r!==o.cache&&Ak(e,[Jt],n,!0))),Cn(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(B(156,e.tag))}function ea(t){t.flags|=4}function XS(t,e,n,r,o){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(o&335544128)===o)if(t.stateNode.complete)t.flags|=8192;else if(D_())t.flags|=8192;else throw Bl=pb,xC}else t.flags&=-16777217}function WR(t,e){if(e.type!==\"stylesheet\"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!rO(e))if(D_())t.flags|=8192;else throw Bl=pb,xC}function Py(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?NI():536870912,t.lanes|=e,Xc|=e)}function Ap(t,e){if(!$e)switch(t.tailMode){case\"hidden\":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case\"collapsed\":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function vt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&65011712,r|=o.flags&65011712,o.return=t,o=o.sibling;else for(o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=t,o=o.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function v5(t,e,n){var r=e.pendingProps;switch(yC(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(e),null;case 1:return vt(e),null;case 3:return n=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),ca(Jt),jc(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(xc(e)?ea(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,HS())),vt(e),null;case 26:var o=e.type,s=e.memoizedState;return t===null?(ea(e),s!==null?(vt(e),WR(e,s)):(vt(e),XS(e,o,null,r,n))):s?s!==t.memoizedState?(ea(e),vt(e),WR(e,s)):(vt(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&ea(e),vt(e),XS(e,o,t,r,n)),null;case 27:if(ab(e),n=fi.current,o=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ea(e);else{if(!r){if(e.stateNode===null)throw Error(B(166));return vt(e),null}t=ps.current,xc(e)?kR(e,t):(t=eO(o,r,n),e.stateNode=t,ea(e))}return vt(e),null;case 5:if(ab(e),o=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ea(e);else{if(!r){if(e.stateNode===null)throw Error(B(166));return vt(e),null}if(s=ps.current,xc(e))kR(e,s);else{var a=Eb(fi.current);switch(s){case 1:s=a.createElementNS(\"http://www.w3.org/2000/svg\",o);break;case 2:s=a.createElementNS(\"http://www.w3.org/1998/Math/MathML\",o);break;default:switch(o){case\"svg\":s=a.createElementNS(\"http://www.w3.org/2000/svg\",o);break;case\"math\":s=a.createElementNS(\"http://www.w3.org/1998/Math/MathML\",o);break;case\"script\":s=a.createElement(\"div\"),s.innerHTML=\"<script><\\/script>\",s=s.removeChild(s.firstChild);break;case\"select\":s=typeof r.is==\"string\"?a.createElement(\"select\",{is:r.is}):a.createElement(\"select\"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s=typeof r.is==\"string\"?a.createElement(o,{is:r.is}):a.createElement(o)}}s[Ln]=e,s[Cr]=r;e:for(a=e.child;a!==null;){if(a.tag===5||a.tag===6)s.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}e.stateNode=s;e:switch(Tn(s,o,r),o){case\"button\":case\"input\":case\"select\":case\"textarea\":r=!!r.autoFocus;break e;case\"img\":r=!0;break e;default:r=!1}r&&ea(e)}}return vt(e),XS(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&ea(e);else{if(typeof r!=\"string\"&&e.stateNode===null)throw Error(B(166));if(t=fi.current,xc(e)){if(t=e.stateNode,n=e.memoizedProps,r=null,o=An,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}t[Ln]=e,t=!!(t.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||J_(t.nodeValue,n)),t||Si(e,!0)}else t=Eb(t).createTextNode(r),t[Ln]=e,e.stateNode=t}return vt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(r=xc(e),n!==null){if(t===null){if(!r)throw Error(B(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(B(557));t[Ln]=e}else Fl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;vt(e),t=!1}else n=HS(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Br(e),e):(Br(e),null);if((e.flags&128)!==0)throw Error(B(558))}return vt(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(o=xc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(B(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(B(317));o[Ln]=e}else Fl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;vt(e),o=!1}else o=HS(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),o=!0;if(!o)return e.flags&256?(Br(e),e):(Br(e),null)}return Br(e),(e.flags&128)!==0?(e.lanes=n,e):(n=r!==null,t=t!==null&&t.memoizedState!==null,n&&(r=e.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==o&&(r.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Py(e,e.updateQueue),vt(e),null);case 4:return jc(),t===null&&qC(e.stateNode.containerInfo),vt(e),null;case 10:return ca(e.type),vt(e),null;case 19:if(mn(Ut),r=e.memoizedState,r===null)return vt(e),null;if(o=(e.flags&128)!==0,s=r.rendering,s===null)if(o)Ap(r,!1);else{if(Pt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=mb(t),s!==null){for(e.flags|=128,Ap(r,!1),t=s.updateQueue,e.updateQueue=t,Py(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)dM(n,t),n=n.sibling;return ht(Ut,Ut.current&1|2),$e&&oa(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&Hr()>wb&&(e.flags|=128,o=!0,Ap(r,!1),e.lanes=4194304)}else{if(!o)if(t=mb(s),t!==null){if(e.flags|=128,o=!0,t=t.updateQueue,e.updateQueue=t,Py(e,t),Ap(r,!0),r.tail===null&&r.tailMode===\"hidden\"&&!s.alternate&&!$e)return vt(e),null}else 2*Hr()-r.renderingStartTime>wb&&n!==536870912&&(e.flags|=128,o=!0,Ap(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(t=r.last,t!==null?t.sibling=s:e.child=s,r.last=s)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=Hr(),t.sibling=null,n=Ut.current,ht(Ut,o?n&1|2:n&1),$e&&oa(e,r.treeForkCount),t):(vt(e),null);case 22:case 23:return Br(e),SC(),r=e.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(e.flags|=8192):r&&(e.flags|=8192),r?(n&536870912)!==0&&(e.flags&128)===0&&(vt(e),e.subtreeFlags&6&&(e.flags|=8192)):vt(e),n=e.updateQueue,n!==null&&Py(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),r=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),r!==n&&(e.flags|=2048),t!==null&&mn(Pl),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),ca(Jt),vt(e),null;case 25:return null;case 30:return null}throw Error(B(156,e.tag))}function x5(t,e){switch(yC(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ca(Jt),jc(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ab(e),null;case 31:if(e.memoizedState!==null){if(Br(e),e.alternate===null)throw Error(B(340));Fl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Br(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(B(340));Fl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return mn(Ut),null;case 4:return jc(),null;case 10:return ca(e.type),null;case 22:case 23:return Br(e),SC(),t!==null&&mn(Pl),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return ca(Jt),null;case 25:return null;default:return null}}function d_(t,e){switch(yC(e),e.tag){case 3:ca(Jt),jc();break;case 26:case 27:case 5:ab(e);break;case 4:jc();break;case 31:e.memoizedState!==null&&Br(e);break;case 13:Br(e);break;case 19:mn(Ut);break;case 10:ca(e.type);break;case 22:case 23:Br(e),SC(),t!==null&&mn(Pl);break;case 24:ca(Jt)}}function gh(t,e){try{var n=e.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&t)===t){r=void 0;var s=n.create,a=n.inst;r=s(),a.destroy=r}n=n.next}while(n!==o)}}catch(i){tt(e,e.return,i)}}function ki(t,e,n){try{var r=e.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var s=o.next;r=s;do{if((r.tag&t)===t){var a=r.inst,i=a.destroy;if(i!==void 0){a.destroy=void 0,o=e;var l=n,u=i;try{u()}catch(c){tt(o,l,c)}}}r=r.next}while(r!==s)}}catch(c){tt(e,e.return,c)}}function f_(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{wM(e,n)}catch(r){tt(t,t.return,r)}}}function p_(t,e,n){n.props=jl(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(r){tt(t,e,r)}}function jp(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof n==\"function\"?t.refCleanup=n(r):n.current=r}}catch(o){tt(t,e,o)}}function fs(t,e){var n=t.ref,r=t.refCleanup;if(n!==null)if(typeof r==\"function\")try{r()}catch(o){tt(t,e,o)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(o){tt(t,e,o)}else n.current=null}function h_(t){var e=t.type,n=t.memoizedProps,r=t.stateNode;try{e:switch(e){case\"button\":case\"input\":case\"select\":case\"textarea\":n.autoFocus&&r.focus();break e;case\"img\":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){tt(t,t.return,o)}}function JS(t,e,n){try{var r=t.stateNode;H5(r,t.type,n,e),r[Cr]=e}catch(o){tt(t,t.return,o)}}function m_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ai(t.type)||t.tag===4}function YS(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||m_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ai(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Fk(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName===\"HTML\"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName===\"HTML\"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ia));else if(r!==4&&(r===27&&Ai(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Fk(t,e,n),t=t.sibling;t!==null;)Fk(t,e,n),t=t.sibling}function xb(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(r===27&&Ai(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(xb(t,e,n),t=t.sibling;t!==null;)xb(t,e,n),t=t.sibling}function g_(t){var e=t.stateNode,n=t.memoizedProps;try{for(var r=t.type,o=e.attributes;o.length;)e.removeAttributeNode(o[0]);Tn(e,r,n),e[Ln]=t,e[Cr]=n}catch(s){tt(t,t.return,s)}}var sa=!1,Xt=!1,ZS=!1,XR=typeof WeakSet==\"function\"?WeakSet:Set,pn=null;function w5(t,e){if(t=t.containerInfo,Kk=Mb,t=rM(t),fC(t)){if(\"selectionStart\"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,i=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(i=a+o),d!==s||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++u===o&&(i=a),f===s&&++c===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=i===-1||l===-1?null:{start:i,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gk={focusedElem:t,selectionRange:n},Mb=!1,pn=e;pn!==null;)if(e=pn,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,pn=t;else for(;pn!==null;){switch(e=pn,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)o=t[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&s!==null){t=void 0,n=e,o=s.memoizedProps,s=s.memoizedState,r=n.stateNode;try{var h=jl(n.type,o);t=r.getSnapshotBeforeUpdate(h,s),r.__reactInternalSnapshotBeforeUpdate=t}catch(g){tt(n,n.return,g)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Xk(t);else if(n===1)switch(t.nodeName){case\"HEAD\":case\"HTML\":case\"BODY\":Xk(t);break;default:t.textContent=\"\"}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(B(163))}if(t=e.sibling,t!==null){t.return=e.return,pn=t;break}pn=e.return}}function y_(t,e,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:na(t,n),r&4&&gh(5,n);break;case 1:if(na(t,n),r&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){tt(n,n.return,a)}else{var o=jl(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(o,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){tt(n,n.return,a)}}r&64&&f_(n),r&512&&jp(n,n.return);break;case 3:if(na(t,n),r&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{wM(t,e)}catch(a){tt(n,n.return,a)}}break;case 27:e===null&&r&4&&g_(n);case 26:case 5:na(t,n),e===null&&r&4&&h_(n),r&512&&jp(n,n.return);break;case 12:na(t,n);break;case 31:na(t,n),r&4&&x_(t,n);break;case 13:na(t,n),r&4&&w_(t,n),r&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=I5.bind(null,n),W5(t,n))));break;case 22:if(r=n.memoizedState!==null||sa,!r){e=e!==null&&e.memoizedState!==null||Xt,o=sa;var s=Xt;sa=r,(Xt=e)&&!s?ra(t,n,(n.subtreeFlags&8772)!==0):na(t,n),sa=o,Xt=s}break;case 30:break;default:na(t,n)}}function b_(t){var e=t.alternate;e!==null&&(t.alternate=null,b_(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&aC(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Tt=null,wr=!1;function ta(t,e,n){for(n=n.child;n!==null;)v_(t,e,n),n=n.sibling}function v_(t,e,n){if($r&&typeof $r.onCommitFiberUnmount==\"function\")try{$r.onCommitFiberUnmount(uh,n)}catch{}switch(n.tag){case 26:Xt||fs(n,e),ta(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xt||fs(n,e);var r=Tt,o=wr;Ai(n.type)&&(Tt=n.stateNode,wr=!1),ta(t,e,n),Gp(n.stateNode),Tt=r,wr=o;break;case 5:Xt||fs(n,e);case 6:if(r=Tt,o=wr,Tt=null,ta(t,e,n),Tt=r,wr=o,Tt!==null)if(wr)try{(Tt.nodeType===9?Tt.body:Tt.nodeName===\"HTML\"?Tt.ownerDocument.body:Tt).removeChild(n.stateNode)}catch(s){tt(n,e,s)}else try{Tt.removeChild(n.stateNode)}catch(s){tt(n,e,s)}break;case 18:Tt!==null&&(wr?(t=Tt,cI(t.nodeType===9?t.body:t.nodeName===\"HTML\"?t.ownerDocument.body:t,n.stateNode),Qc(t)):cI(Tt,n.stateNode));break;case 4:r=Tt,o=wr,Tt=n.stateNode.containerInfo,wr=!0,ta(t,e,n),Tt=r,wr=o;break;case 0:case 11:case 14:case 15:ki(2,n,e),Xt||ki(4,n,e),ta(t,e,n);break;case 1:Xt||(fs(n,e),r=n.stateNode,typeof r.componentWillUnmount==\"function\"&&p_(n,e,r)),ta(t,e,n);break;case 21:ta(t,e,n);break;case 22:Xt=(r=Xt)||n.memoizedState!==null,ta(t,e,n),Xt=r;break;default:ta(t,e,n)}}function x_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Qc(t)}catch(n){tt(e,e.return,n)}}}function w_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Qc(t)}catch(n){tt(e,e.return,n)}}function S5(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new XR),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new XR),e;default:throw Error(B(435,t.tag))}}function By(t,e){var n=S5(t);e.forEach(function(r){if(!n.has(r)){n.add(r);var o=M5.bind(null,t,r);r.then(o,o)}})}function vr(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],s=t,a=e,i=a;e:for(;i!==null;){switch(i.tag){case 27:if(Ai(i.type)){Tt=i.stateNode,wr=!1;break e}break;case 5:Tt=i.stateNode,wr=!1;break e;case 3:case 4:Tt=i.stateNode.containerInfo,wr=!0;break e}i=i.return}if(Tt===null)throw Error(B(160));v_(s,a,o),Tt=null,wr=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)S_(e,t),e=e.sibling}var jo=null;function S_(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:vr(e,t),xr(t),r&4&&(ki(3,t,t.return),gh(3,t),ki(5,t,t.return));break;case 1:vr(e,t),xr(t),r&512&&(Xt||n===null||fs(n,n.return)),r&64&&sa&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=jo;if(vr(e,t),xr(t),r&512&&(Xt||n===null||fs(n,n.return)),r&4){var s=n!==null?n.memoizedState:null;if(r=t.memoizedState,n===null)if(r===null)if(t.stateNode===null){e:{r=t.type,n=t.memoizedProps,o=o.ownerDocument||o;t:switch(r){case\"title\":s=o.getElementsByTagName(\"title\")[0],(!s||s[fh]||s[Ln]||s.namespaceURI===\"http://www.w3.org/2000/svg\"||s.hasAttribute(\"itemprop\"))&&(s=o.createElement(r),o.head.insertBefore(s,o.querySelector(\"head > title\"))),Tn(s,r,n),s[Ln]=t,hn(s),r=s;break e;case\"link\":var a=yI(\"link\",\"href\",o).get(r+(n.href||\"\"));if(a){for(var i=0;i<a.length;i++)if(s=a[i],s.getAttribute(\"href\")===(n.href==null||n.href===\"\"?null:n.href)&&s.getAttribute(\"rel\")===(n.rel==null?null:n.rel)&&s.getAttribute(\"title\")===(n.title==null?null:n.title)&&s.getAttribute(\"crossorigin\")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(i,1);break t}}s=o.createElement(r),Tn(s,r,n),o.head.appendChild(s);break;case\"meta\":if(a=yI(\"meta\",\"content\",o).get(r+(n.content||\"\"))){for(i=0;i<a.length;i++)if(s=a[i],s.getAttribute(\"content\")===(n.content==null?null:\"\"+n.content)&&s.getAttribute(\"name\")===(n.name==null?null:n.name)&&s.getAttribute(\"property\")===(n.property==null?null:n.property)&&s.getAttribute(\"http-equiv\")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute(\"charset\")===(n.charSet==null?null:n.charSet)){a.splice(i,1);break t}}s=o.createElement(r),Tn(s,r,n),o.head.appendChild(s);break;default:throw Error(B(468,r))}s[Ln]=t,hn(s),r=s}t.stateNode=r}else bI(o,t.type,t.stateNode);else t.stateNode=gI(o,r,t.memoizedProps);else s!==r?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,r===null?bI(o,t.type,t.stateNode):gI(o,r,t.memoizedProps)):r===null&&t.stateNode!==null&&JS(t,t.memoizedProps,n.memoizedProps)}break;case 27:vr(e,t),xr(t),r&512&&(Xt||n===null||fs(n,n.return)),n!==null&&r&4&&JS(t,t.memoizedProps,n.memoizedProps);break;case 5:if(vr(e,t),xr(t),r&512&&(Xt||n===null||fs(n,n.return)),t.flags&32){o=t.stateNode;try{Vc(o,\"\")}catch(h){tt(t,t.return,h)}}r&4&&t.stateNode!=null&&(o=t.memoizedProps,JS(t,o,n!==null?n.memoizedProps:o)),r&1024&&(ZS=!0);break;case 6:if(vr(e,t),xr(t),r&4){if(t.stateNode===null)throw Error(B(162));r=t.memoizedProps,n=t.stateNode;try{n.nodeValue=r}catch(h){tt(t,t.return,h)}}break;case 3:if(tb=null,o=jo,jo=Tb(e.containerInfo),vr(e,t),jo=o,xr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Qc(e.containerInfo)}catch(h){tt(t,t.return,h)}ZS&&(ZS=!1,k_(t));break;case 4:r=jo,jo=Tb(t.stateNode.containerInfo),vr(e,t),xr(t),jo=r;break;case 12:vr(e,t),xr(t);break;case 31:vr(e,t),xr(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,By(t,r)));break;case 13:vr(e,t),xr(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(qb=Hr()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,By(t,r)));break;case 22:o=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=sa,c=Xt;if(sa=u||o,Xt=c||l,vr(e,t),Xt=c,sa=u,xr(t),r&8192)e:for(e=t.stateNode,e._visibility=o?e._visibility&-2:e._visibility|1,o&&(n===null||l||sa||Xt||Ol(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(s=l.stateNode,o)a=s.style,typeof a.setProperty==\"function\"?a.setProperty(\"display\",\"none\",\"important\"):a.display=\"none\";else{i=l.stateNode;var d=l.memoizedProps.style,f=d!=null&&d.hasOwnProperty(\"display\")?d.display:null;i.style.display=f==null||typeof f==\"boolean\"?\"\":(\"\"+f).trim()}}catch(h){tt(l,l.return,h)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=o?\"\":l.memoizedProps}catch(h){tt(l,l.return,h)}}}else if(e.tag===18){if(n===null){l=e;try{var p=l.stateNode;o?dI(p,!0):dI(l.stateNode,!1)}catch(h){tt(l,l.return,h)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}r&4&&(r=t.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,By(t,n))));break;case 19:vr(e,t),xr(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,By(t,r)));break;case 30:break;case 21:break;default:vr(e,t),xr(t)}}function xr(t){var e=t.flags;if(e&2){try{for(var n,r=t.return;r!==null;){if(m_(r)){n=r;break}r=r.return}if(n==null)throw Error(B(160));switch(n.tag){case 27:var o=n.stateNode,s=YS(t);xb(t,s,o);break;case 5:var a=n.stateNode;n.flags&32&&(Vc(a,\"\"),n.flags&=-33);var i=YS(t);xb(t,i,a);break;case 3:case 4:var l=n.stateNode.containerInfo,u=YS(t);Fk(t,u,l);break;default:throw Error(B(161))}}catch(c){tt(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function k_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;k_(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function na(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)y_(t,e.alternate,e),e=e.sibling}function Ol(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ki(4,e,e.return),Ol(e);break;case 1:fs(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount==\"function\"&&p_(e,e.return,n),Ol(e);break;case 27:Gp(e.stateNode);case 26:case 5:fs(e,e.return),Ol(e);break;case 22:e.memoizedState===null&&Ol(e);break;case 30:Ol(e);break;default:Ol(e)}t=t.sibling}}function ra(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var r=e.alternate,o=t,s=e,a=s.flags;switch(s.tag){case 0:case 11:case 15:ra(o,s,n),gh(4,s);break;case 1:if(ra(o,s,n),r=s,o=r.stateNode,typeof o.componentDidMount==\"function\")try{o.componentDidMount()}catch(u){tt(r,r.return,u)}if(r=s,o=r.updateQueue,o!==null){var i=r.stateNode;try{var l=o.shared.hiddenCallbacks;if(l!==null)for(o.shared.hiddenCallbacks=null,o=0;o<l.length;o++)xM(l[o],i)}catch(u){tt(r,r.return,u)}}n&&a&64&&f_(s),jp(s,s.return);break;case 27:g_(s);case 26:case 5:ra(o,s,n),n&&r===null&&a&4&&h_(s),jp(s,s.return);break;case 12:ra(o,s,n);break;case 31:ra(o,s,n),n&&a&4&&x_(o,s);break;case 13:ra(o,s,n),n&&a&4&&w_(o,s);break;case 22:s.memoizedState===null&&ra(o,s,n),jp(s,s.return);break;case 30:break;default:ra(o,s,n)}e=e.sibling}}function zC(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&hh(n))}function FC(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&hh(t))}function Uo(t,e,n,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)C_(t,e,n,r),e=e.sibling}function C_(t,e,n,r){var o=e.flags;switch(e.tag){case 0:case 11:case 15:Uo(t,e,n,r),o&2048&&gh(9,e);break;case 1:Uo(t,e,n,r);break;case 3:Uo(t,e,n,r),o&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&hh(t)));break;case 12:if(o&2048){Uo(t,e,n,r),t=e.stateNode;try{var s=e.memoizedProps,a=s.id,i=s.onPostCommit;typeof i==\"function\"&&i(a,e.alternate===null?\"mount\":\"update\",t.passiveEffectDuration,-0)}catch(l){tt(e,e.return,l)}}else Uo(t,e,n,r);break;case 31:Uo(t,e,n,r);break;case 13:Uo(t,e,n,r);break;case 23:break;case 22:s=e.stateNode,a=e.alternate,e.memoizedState!==null?s._visibility&2?Uo(t,e,n,r):qp(t,e):s._visibility&2?Uo(t,e,n,r):(s._visibility|=2,Sc(t,e,n,r,(e.subtreeFlags&10256)!==0||!1)),o&2048&&zC(a,e);break;case 24:Uo(t,e,n,r),o&2048&&FC(e.alternate,e);break;default:Uo(t,e,n,r)}}function Sc(t,e,n,r,o){for(o=o&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var s=t,a=e,i=n,l=r,u=a.flags;switch(a.tag){case 0:case 11:case 15:Sc(s,a,i,l,o),gh(8,a);break;case 23:break;case 22:var c=a.stateNode;a.memoizedState!==null?c._visibility&2?Sc(s,a,i,l,o):qp(s,a):(c._visibility|=2,Sc(s,a,i,l,o)),o&&u&2048&&zC(a.alternate,a);break;case 24:Sc(s,a,i,l,o),o&&u&2048&&FC(a.alternate,a);break;default:Sc(s,a,i,l,o)}e=e.sibling}}function qp(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,r=e,o=r.flags;switch(r.tag){case 22:qp(n,r),o&2048&&zC(r.alternate,r);break;case 24:qp(n,r),o&2048&&FC(r.alternate,r);break;default:qp(n,r)}e=e.sibling}}var Dp=8192;function wc(t,e,n){if(t.subtreeFlags&Dp)for(t=t.child;t!==null;)L_(t,e,n),t=t.sibling}function L_(t,e,n){switch(t.tag){case 26:wc(t,e,n),t.flags&Dp&&t.memoizedState!==null&&aV(n,jo,t.memoizedState,t.memoizedProps);break;case 5:wc(t,e,n);break;case 3:case 4:var r=jo;jo=Tb(t.stateNode.containerInfo),wc(t,e,n),jo=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=Dp,Dp=16777216,wc(t,e,n),Dp=r):wc(t,e,n));break;default:wc(t,e,n)}}function A_(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Ep(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var r=e[n];pn=r,T_(r,t)}A_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)E_(t),t=t.sibling}function E_(t){switch(t.tag){case 0:case 11:case 15:Ep(t),t.flags&2048&&ki(9,t,t.return);break;case 3:Ep(t);break;case 12:Ep(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Qy(t)):Ep(t);break;default:Ep(t)}}function Qy(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var r=e[n];pn=r,T_(r,t)}A_(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ki(8,e,e.return),Qy(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Qy(e));break;default:Qy(e)}t=t.sibling}}function T_(t,e){for(;pn!==null;){var n=pn;switch(n.tag){case 0:case 11:case 15:ki(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:hh(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,pn=r;else e:for(n=t;pn!==null;){r=pn;var o=r.sibling,s=r.return;if(b_(r),r===n){pn=null;break e}if(o!==null){o.return=s,pn=o;break e}pn=s}}}var k5={getCacheForType:function(t){var e=En(Jt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return En(Jt).controller.signal}},C5=typeof WeakMap==\"function\"?WeakMap:Map,Je=0,ct=null,Ne=null,Fe=0,et=0,Pr=null,ui=!1,od=!1,HC=!1,ga=0,Pt=0,Ci=0,zl=0,$C=0,Fr=0,Xc=0,Vp=null,Sr=null,Hk=!1,qb=0,R_=0,wb=1/0,Sb=null,gi=null,on=0,yi=null,Jc=null,da=0,$k=0,Uk=null,I_=null,Kp=0,jk=null;function jr(){return(Je&2)!==0&&Fe!==0?Fe&-Fe:be.T!==null?jC():FI()}function M_(){if(Fr===0)if((Fe&536870912)===0||$e){var t=Ey;Ey<<=1,(Ey&3932160)===0&&(Ey=262144),Fr=t}else Fr=536870912;return t=Vr.current,t!==null&&(t.flags|=32),Fr}function kr(t,e,n){(t===ct&&(et===2||et===9)||t.cancelPendingCommit!==null)&&(Yc(t,0),ci(t,Fe,Fr,!1)),dh(t,n),((Je&2)===0||t!==ct)&&(t===ct&&((Je&2)===0&&(zl|=n),Pt===4&&ci(t,Fe,Fr,!1)),ms(t))}function __(t,e,n){if((Je&6)!==0)throw Error(B(327));var r=!n&&(e&127)===0&&(e&t.expiredLanes)===0||ch(t,e),o=r?E5(t,e):QS(t,e,!0),s=r;do{if(o===0){od&&!r&&ci(t,e,0,!1);break}else{if(n=t.current.alternate,s&&!L5(n)){o=QS(t,e,!1),s=!1;continue}if(o===2){if(s=e,t.errorRecoveryDisabledLanes&s)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;e:{var i=t;o=Vp;var l=i.current.memoizedState.isDehydrated;if(l&&(Yc(i,a).flags|=256),a=QS(i,a,!1),a!==2){if(HC&&!l){i.errorRecoveryDisabledLanes|=s,zl|=s,o=4;break e}s=Sr,Sr=o,s!==null&&(Sr===null?Sr=s:Sr.push.apply(Sr,s))}o=a}if(s=!1,o!==2)continue}}if(o===1){Yc(t,0),ci(t,e,0,!0);break}e:{switch(r=t,s=o,s){case 0:case 1:throw Error(B(345));case 4:if((e&4194048)!==e)break;case 6:ci(r,e,Fr,!ui);break e;case 2:Sr=null;break;case 3:case 5:break;default:throw Error(B(329))}if((e&62914560)===e&&(o=qb+300-Hr(),10<o)){if(ci(r,e,Fr,!ui),Ob(r,0,!0)!==0)break e;da=e,r.timeoutHandle=Z_(JR.bind(null,r,n,Sr,Sb,Hk,e,Fr,zl,Xc,ui,s,\"Throttled\",-0,0),o);break e}JR(r,n,Sr,Sb,Hk,e,Fr,zl,Xc,ui,s,null,-0,0)}}break}while(!0);ms(t)}function JR(t,e,n,r,o,s,a,i,l,u,c,d,f,p){if(t.timeoutHandle=-1,d=e.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ia},L_(e,s,d);var h=(s&62914560)===s?qb-Hr():(s&4194048)===s?R_-Hr():0;if(h=iV(d,h),h!==null){da=s,t.cancelPendingCommit=h(ZR.bind(null,t,e,s,n,r,o,a,i,l,c,d,null,f,p)),ci(t,s,a,!u);return}}ZR(t,e,s,n,r,o,a,i,l)}function L5(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var o=n[r],s=o.getSnapshot;o=o.value;try{if(!qr(s(),o))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ci(t,e,n,r){e&=~$C,e&=~zl,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var o=e;0<o;){var s=31-Ur(o),a=1<<s;r[s]=-1,o&=~a}n!==0&&PI(t,n,e)}function Vb(){return(Je&6)===0?(yh(0,!1),!1):!0}function UC(){if(Ne!==null){if(et===0)var t=Ne.return;else t=Ne,la=Wl=null,EC(t),Hc=null,eh=0,t=Ne;for(;t!==null;)d_(t.alternate,t),t=t.return;Ne=null}}function Yc(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,j5(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),da=0,UC(),ct=t,Ne=n=ua(t.current,null),Fe=e,et=0,Pr=null,ui=!1,od=ch(t,e),HC=!1,Xc=Fr=$C=zl=Ci=Pt=0,Sr=Vp=null,Hk=!1,(e&8)!==0&&(e|=e&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=e;0<r;){var o=31-Ur(r),s=1<<o;e|=t[o],r&=~s}return ga=e,Bb(),n}function O_(t,e){Ae=null,be.H=nh,e===rd||e===Fb?(e=TR(),et=3):e===xC?(e=TR(),et=4):et=e===PC?8:e!==null&&typeof e==\"object\"&&typeof e.then==\"function\"?6:1,Pr=e,Ne===null&&(Pt=1,bb(t,bo(e,t.current)))}function D_(){var t=Vr.current;return t===null?!0:(Fe&4194048)===Fe?xo===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?t===xo:!1}function N_(){var t=be.H;return be.H=nh,t===null?nh:t}function P_(){var t=be.A;return be.A=k5,t}function kb(){Pt=4,ui||(Fe&4194048)!==Fe&&Vr.current!==null||(od=!0),(Ci&134217727)===0&&(zl&134217727)===0||ct===null||ci(ct,Fe,Fr,!1)}function QS(t,e,n){var r=Je;Je|=2;var o=N_(),s=P_();(ct!==t||Fe!==e)&&(Sb=null,Yc(t,e)),e=!1;var a=Pt;e:do try{if(et!==0&&Ne!==null){var i=Ne,l=Pr;switch(et){case 8:UC(),a=6;break e;case 3:case 2:case 9:case 6:Vr.current===null&&(e=!0);var u=et;if(et=0,Pr=null,Nc(t,i,l,u),n&&od){a=0;break e}break;default:u=et,et=0,Pr=null,Nc(t,i,l,u)}}A5(),a=Pt;break}catch(c){O_(t,c)}while(!0);return e&&t.shellSuspendCounter++,la=Wl=null,Je=r,be.H=o,be.A=s,Ne===null&&(ct=null,Fe=0,Bb()),a}function A5(){for(;Ne!==null;)B_(Ne)}function E5(t,e){var n=Je;Je|=2;var r=N_(),o=P_();ct!==t||Fe!==e?(Sb=null,wb=Hr()+500,Yc(t,e)):od=ch(t,e);e:do try{if(et!==0&&Ne!==null){e=Ne;var s=Pr;t:switch(et){case 1:et=0,Pr=null,Nc(t,e,s,1);break;case 2:case 9:if(ER(s)){et=0,Pr=null,YR(e);break}e=function(){et!==2&&et!==9||ct!==t||(et=7),ms(t)},s.then(e,e);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:ER(s)?(et=0,Pr=null,YR(e)):(et=0,Pr=null,Nc(t,e,s,7));break;case 5:var a=null;switch(Ne.tag){case 26:a=Ne.memoizedState;case 5:case 27:var i=Ne;if(a?rO(a):i.stateNode.complete){et=0,Pr=null;var l=i.sibling;if(l!==null)Ne=l;else{var u=i.return;u!==null?(Ne=u,Kb(u)):Ne=null}break t}}et=0,Pr=null,Nc(t,e,s,5);break;case 6:et=0,Pr=null,Nc(t,e,s,6);break;case 8:UC(),Pt=6;break e;default:throw Error(B(462))}}T5();break}catch(c){O_(t,c)}while(!0);return la=Wl=null,be.H=r,be.A=o,Je=n,Ne!==null?0:(ct=null,Fe=0,Bb(),Pt)}function T5(){for(;Ne!==null&&!Yq();)B_(Ne)}function B_(t){var e=c_(t.alternate,t,ga);t.memoizedProps=t.pendingProps,e===null?Kb(t):Ne=e}function YR(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=qR(n,e,e.pendingProps,e.type,void 0,Fe);break;case 11:e=qR(n,e,e.pendingProps,e.type.render,e.ref,Fe);break;case 5:EC(e);default:d_(n,e),e=Ne=dM(e,ga),e=c_(n,e,ga)}t.memoizedProps=t.pendingProps,e===null?Kb(t):Ne=e}function Nc(t,e,n,r){la=Wl=null,EC(e),Hc=null,eh=0;var o=e.return;try{if(g5(t,o,e,n,Fe)){Pt=1,bb(t,bo(n,t.current)),Ne=null;return}}catch(s){if(o!==null)throw Ne=o,s;Pt=1,bb(t,bo(n,t.current)),Ne=null;return}e.flags&32768?($e||r===1?t=!0:od||(Fe&536870912)!==0?t=!1:(ui=t=!0,(r===2||r===9||r===3||r===6)&&(r=Vr.current,r!==null&&r.tag===13&&(r.flags|=16384))),z_(e,t)):Kb(e)}function Kb(t){var e=t;do{if((e.flags&32768)!==0){z_(e,ui);return}t=e.return;var n=v5(e.alternate,e,ga);if(n!==null){Ne=n;return}if(e=e.sibling,e!==null){Ne=e;return}Ne=e=t}while(e!==null);Pt===0&&(Pt=5)}function z_(t,e){do{var n=x5(t.alternate,t);if(n!==null){n.flags&=32767,Ne=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Ne=t;return}Ne=t=n}while(t!==null);Pt=6,Ne=null}function ZR(t,e,n,r,o,s,a,i,l){t.cancelPendingCommit=null;do Gb();while(on!==0);if((Je&6)!==0)throw Error(B(327));if(e!==null){if(e===t.current)throw Error(B(177));if(s=e.lanes|e.childLanes,s|=pC,i6(t,n,s,a,i,l),t===ct&&(Ne=ct=null,Fe=0),Jc=e,yi=t,da=n,$k=s,Uk=o,I_=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,_5(ib,function(){return j_(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=be.T,be.T=null,o=Ye.p,Ye.p=2,a=Je,Je|=4;try{w5(t,e,n)}finally{Je=a,Ye.p=o,be.T=r}}on=1,F_(),H_(),$_()}}function F_(){if(on===1){on=0;var t=yi,e=Jc,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=be.T,be.T=null;var r=Ye.p;Ye.p=2;var o=Je;Je|=4;try{S_(e,t);var s=Gk,a=rM(t.containerInfo),i=s.focusedElem,l=s.selectionRange;if(a!==i&&i&&i.ownerDocument&&nM(i.ownerDocument.documentElement,i)){if(l!==null&&fC(i)){var u=l.start,c=l.end;if(c===void 0&&(c=u),\"selectionStart\"in i)i.selectionStart=u,i.selectionEnd=Math.min(c,i.value.length);else{var d=i.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),h=i.textContent.length,g=Math.min(l.start,h),m=l.end===void 0?g:Math.min(l.end,h);!p.extend&&g>m&&(a=m,m=g,g=a);var y=xR(i,g),b=xR(i,m);if(y&&b&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==b.node||p.focusOffset!==b.offset)){var x=d.createRange();x.setStart(y.node,y.offset),p.removeAllRanges(),g>m?(p.addRange(x),p.extend(b.node,b.offset)):(x.setEnd(b.node,b.offset),p.addRange(x))}}}}for(d=[],p=i;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof i.focus==\"function\"&&i.focus(),i=0;i<d.length;i++){var v=d[i];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}Mb=!!Kk,Gk=Kk=null}finally{Je=o,Ye.p=r,be.T=n}}t.current=e,on=2}}function H_(){if(on===2){on=0;var t=yi,e=Jc,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=be.T,be.T=null;var r=Ye.p;Ye.p=2;var o=Je;Je|=4;try{y_(t,e.alternate,e)}finally{Je=o,Ye.p=r,be.T=n}}on=3}}function $_(){if(on===4||on===3){on=0,Zq();var t=yi,e=Jc,n=da,r=I_;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?on=5:(on=0,Jc=yi=null,U_(t,t.pendingLanes));var o=t.pendingLanes;if(o===0&&(gi=null),sC(n),e=e.stateNode,$r&&typeof $r.onCommitFiberRoot==\"function\")try{$r.onCommitFiberRoot(uh,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=be.T,o=Ye.p,Ye.p=2,be.T=null;try{for(var s=t.onRecoverableError,a=0;a<r.length;a++){var i=r[a];s(i.value,{componentStack:i.stack})}}finally{be.T=e,Ye.p=o}}(da&3)!==0&&Gb(),ms(t),o=t.pendingLanes,(n&261930)!==0&&(o&42)!==0?t===jk?Kp++:(Kp=0,jk=t):Kp=0,yh(0,!1)}}function U_(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,hh(e)))}function Gb(){return F_(),H_(),$_(),j_()}function j_(){if(on!==5)return!1;var t=yi,e=$k;$k=0;var n=sC(da),r=be.T,o=Ye.p;try{Ye.p=32>n?32:n,be.T=null,n=Uk,Uk=null;var s=yi,a=da;if(on=0,Jc=yi=null,da=0,(Je&6)!==0)throw Error(B(331));var i=Je;if(Je|=4,E_(s.current),C_(s,s.current,a,n),Je=i,yh(0,!1),$r&&typeof $r.onPostCommitFiberRoot==\"function\")try{$r.onPostCommitFiberRoot(uh,s)}catch{}return!0}finally{Ye.p=o,be.T=r,U_(t,e)}}function QR(t,e,n){e=bo(n,e),e=Pk(t.stateNode,e,2),t=mi(t,e,2),t!==null&&(dh(t,2),ms(t))}function tt(t,e,n){if(t.tag===3)QR(t,t,n);else for(;e!==null;){if(e.tag===3){QR(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError==\"function\"||typeof r.componentDidCatch==\"function\"&&(gi===null||!gi.has(r))){t=bo(n,t),n=o_(2),r=mi(e,n,2),r!==null&&(s_(n,r,e,t),dh(r,2),ms(r));break}}e=e.return}}function ek(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new C5;var o=new Set;r.set(e,o)}else o=r.get(e),o===void 0&&(o=new Set,r.set(e,o));o.has(n)||(HC=!0,o.add(n),t=R5.bind(null,t,e,n),e.then(t,t))}function R5(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,ct===t&&(Fe&n)===n&&(Pt===4||Pt===3&&(Fe&62914560)===Fe&&300>Hr()-qb?(Je&2)===0&&Yc(t,0):$C|=n,Xc===Fe&&(Xc=0)),ms(t)}function q_(t,e){e===0&&(e=NI()),t=Gl(t,e),t!==null&&(dh(t,e),ms(t))}function I5(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),q_(t,n)}function M5(t,e){var n=0;switch(t.tag){case 31:case 13:var r=t.stateNode,o=t.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(B(314))}r!==null&&r.delete(e),q_(t,n)}function _5(t,e){return rC(t,e)}var Cb=null,kc=null,qk=!1,Lb=!1,tk=!1,di=0;function ms(t){t!==kc&&t.next===null&&(kc===null?Cb=kc=t:kc=kc.next=t),Lb=!0,qk||(qk=!0,D5())}function yh(t,e){if(!tk&&Lb){tk=!0;do for(var n=!1,r=Cb;r!==null;){if(!e)if(t!==0){var o=r.pendingLanes;if(o===0)var s=0;else{var a=r.suspendedLanes,i=r.pingedLanes;s=(1<<31-Ur(42|t)+1)-1,s&=o&~(a&~i),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,eI(r,s))}else s=Fe,s=Ob(r,r===ct?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(s&3)===0||ch(r,s)||(n=!0,eI(r,s));r=r.next}while(n);tk=!1}}function O5(){V_()}function V_(){Lb=qk=!1;var t=0;di!==0&&U5()&&(t=di);for(var e=Hr(),n=null,r=Cb;r!==null;){var o=r.next,s=K_(r,e);s===0?(r.next=null,n===null?Cb=o:n.next=o,o===null&&(kc=n)):(n=r,(t!==0||(s&3)!==0)&&(Lb=!0)),r=o}on!==0&&on!==5||yh(t,!1),di!==0&&(di=0)}function K_(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,o=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var a=31-Ur(s),i=1<<a,l=o[a];l===-1?((i&n)===0||(i&r)!==0)&&(o[a]=a6(i,e)):l<=e&&(t.expiredLanes|=i),s&=~i}if(e=ct,n=Fe,n=Ob(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,n===0||t===e&&(et===2||et===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&IS(r),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||ch(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(r!==null&&IS(r),sC(n)){case 2:case 8:n=OI;break;case 32:n=ib;break;case 268435456:n=DI;break;default:n=ib}return r=G_.bind(null,t),n=rC(n,r),t.callbackPriority=e,t.callbackNode=n,e}return r!==null&&r!==null&&IS(r),t.callbackPriority=2,t.callbackNode=null,2}function G_(t,e){if(on!==0&&on!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Gb()&&t.callbackNode!==n)return null;var r=Fe;return r=Ob(t,t===ct?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(__(t,r,e),K_(t,Hr()),t.callbackNode!=null&&t.callbackNode===n?G_.bind(null,t):null)}function eI(t,e){if(Gb())return null;__(t,e,!0)}function D5(){q5(function(){(Je&6)!==0?rC(_I,O5):V_()})}function jC(){if(di===0){var t=Kc;t===0&&(t=Ay,Ay<<=1,(Ay&261888)===0&&(Ay=256)),di=t}return di}function tI(t){return t==null||typeof t==\"symbol\"||typeof t==\"boolean\"?null:typeof t==\"function\"?t:qy(\"\"+t)}function nI(t,e){var n=e.ownerDocument.createElement(\"input\");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute(\"form\",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function N5(t,e,n,r,o){if(e===\"submit\"&&n&&n.stateNode===o){var s=tI((o[Cr]||null).action),a=r.submitter;a&&(e=(e=a[Cr]||null)?tI(e.formAction):a.getAttribute(\"formAction\"),e!==null&&(s=e,a=null));var i=new Db(\"action\",\"action\",null,r,o);t.push({event:i,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(di!==0){var l=a?nI(o,a):new FormData(o);Dk(n,{pending:!0,data:l,method:o.method,action:s},null,l)}}else typeof s==\"function\"&&(i.preventDefault(),l=a?nI(o,a):new FormData(o),Dk(n,{pending:!0,data:l,method:o.method,action:s},s,l))},currentTarget:o}]})}}for(zy=0;zy<Sk.length;zy++)Fy=Sk[zy],rI=Fy.toLowerCase(),oI=Fy[0].toUpperCase()+Fy.slice(1),qo(rI,\"on\"+oI);var Fy,rI,oI,zy;qo(sM,\"onAnimationEnd\");qo(aM,\"onAnimationIteration\");qo(iM,\"onAnimationStart\");qo(\"dblclick\",\"onDoubleClick\");qo(\"focusin\",\"onFocus\");qo(\"focusout\",\"onBlur\");qo(Q6,\"onTransitionRun\");qo(e5,\"onTransitionStart\");qo(t5,\"onTransitionCancel\");qo(lM,\"onTransitionEnd\");qc(\"onMouseEnter\",[\"mouseout\",\"mouseover\"]);qc(\"onMouseLeave\",[\"mouseout\",\"mouseover\"]);qc(\"onPointerEnter\",[\"pointerout\",\"pointerover\"]);qc(\"onPointerLeave\",[\"pointerout\",\"pointerover\"]);ql(\"onChange\",\"change click focusin focusout input keydown keyup selectionchange\".split(\" \"));ql(\"onSelect\",\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\".split(\" \"));ql(\"onBeforeInput\",[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]);ql(\"onCompositionEnd\",\"compositionend focusout keydown keypress keyup mousedown\".split(\" \"));ql(\"onCompositionStart\",\"compositionstart focusout keydown keypress keyup mousedown\".split(\" \"));ql(\"onCompositionUpdate\",\"compositionupdate focusout keydown keypress keyup mousedown\".split(\" \"));var rh=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),P5=new Set(\"beforetoggle cancel close invalid load scroll scrollend toggle\".split(\" \").concat(rh));function W_(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],o=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var a=r.length-1;0<=a;a--){var i=r[a],l=i.instance,u=i.currentTarget;if(i=i.listener,l!==s&&o.isPropagationStopped())break e;s=i,o.currentTarget=u;try{s(o)}catch(c){ub(c)}o.currentTarget=null,s=l}else for(a=0;a<r.length;a++){if(i=r[a],l=i.instance,u=i.currentTarget,i=i.listener,l!==s&&o.isPropagationStopped())break e;s=i,o.currentTarget=u;try{s(o)}catch(c){ub(c)}o.currentTarget=null,s=l}}}}function De(t,e){var n=e[hk];n===void 0&&(n=e[hk]=new Set);var r=t+\"__bubble\";n.has(r)||(X_(e,t,2,!1),n.add(r))}function nk(t,e,n){var r=0;e&&(r|=4),X_(n,t,r,e)}var Hy=\"_reactListening\"+Math.random().toString(36).slice(2);function qC(t){if(!t[Hy]){t[Hy]=!0,HI.forEach(function(n){n!==\"selectionchange\"&&(P5.has(n)||nk(n,!1,t),nk(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Hy]||(e[Hy]=!0,nk(\"selectionchange\",!1,e))}}function X_(t,e,n,r){switch(lO(e)){case 2:var o=cV;break;case 8:o=dV;break;default:o=WC}n=o.bind(null,e,n,t),o=void 0,!vk||e!==\"touchstart\"&&e!==\"touchmove\"&&e!==\"wheel\"||(o=!0),r?o!==void 0?t.addEventListener(e,n,{capture:!0,passive:o}):t.addEventListener(e,n,!0):o!==void 0?t.addEventListener(e,n,{passive:o}):t.addEventListener(e,n,!1)}function rk(t,e,n,r,o){var s=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var i=r.stateNode.containerInfo;if(i===o)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===o)return;a=a.return}for(;i!==null;){if(a=Ac(i),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){r=s=a;continue e}i=i.parentNode}}r=r.return}WI(function(){var u=s,c=lC(n),d=[];e:{var f=uM.get(t);if(f!==void 0){var p=Db,h=t;switch(t){case\"keypress\":if(Ky(n)===0)break e;case\"keydown\":case\"keyup\":p=M6;break;case\"focusin\":h=\"focus\",p=NS;break;case\"focusout\":h=\"blur\",p=NS;break;case\"beforeblur\":case\"afterblur\":p=NS;break;case\"click\":if(n.button===2)break e;case\"auxclick\":case\"dblclick\":case\"mousedown\":case\"mousemove\":case\"mouseup\":case\"mouseout\":case\"mouseover\":case\"contextmenu\":p=dR;break;case\"drag\":case\"dragend\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"dragstart\":case\"drop\":p=v6;break;case\"touchcancel\":case\"touchend\":case\"touchmove\":case\"touchstart\":p=D6;break;case sM:case aM:case iM:p=S6;break;case lM:p=P6;break;case\"scroll\":case\"scrollend\":p=y6;break;case\"wheel\":p=z6;break;case\"copy\":case\"cut\":case\"paste\":p=C6;break;case\"gotpointercapture\":case\"lostpointercapture\":case\"pointercancel\":case\"pointerdown\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"pointerup\":p=pR;break;case\"toggle\":case\"beforetoggle\":p=H6}var g=(e&4)!==0,m=!g&&(t===\"scroll\"||t===\"scrollend\"),y=g?f!==null?f+\"Capture\":null:f;g=[];for(var b=u,x;b!==null;){var v=b;if(x=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||x===null||y===null||(v=Xp(b,y),v!=null&&g.push(oh(b,v,x))),m)break;b=b.return}0<g.length&&(f=new p(f,h,null,n,c),d.push({event:f,listeners:g}))}}if((e&7)===0){e:{if(f=t===\"mouseover\"||t===\"pointerover\",p=t===\"mouseout\"||t===\"pointerout\",f&&n!==bk&&(h=n.relatedTarget||n.fromElement)&&(Ac(h)||h[ed]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(h=n.relatedTarget||n.toElement,p=u,h=h?Ac(h):null,h!==null&&(m=lh(h),g=h.tag,h!==m||g!==5&&g!==27&&g!==6)&&(h=null)):(p=null,h=u),p!==h)){if(g=dR,v=\"onMouseLeave\",y=\"onMouseEnter\",b=\"mouse\",(t===\"pointerout\"||t===\"pointerover\")&&(g=pR,v=\"onPointerLeave\",y=\"onPointerEnter\",b=\"pointer\"),m=p==null?f:_p(p),x=h==null?f:_p(h),f=new g(v,b+\"leave\",p,n,c),f.target=m,f.relatedTarget=x,v=null,Ac(c)===u&&(g=new g(y,b+\"enter\",h,n,c),g.target=x,g.relatedTarget=m,v=g),m=v,p&&h)t:{for(g=B5,y=p,b=h,x=0,v=y;v;v=g(v))x++;v=0;for(var S=b;S;S=g(S))v++;for(;0<x-v;)y=g(y),x--;for(;0<v-x;)b=g(b),v--;for(;x--;){if(y===b||b!==null&&y===b.alternate){g=y;break t}y=g(y),b=g(b)}g=null}else g=null;p!==null&&sI(d,f,p,g,!1),h!==null&&m!==null&&sI(d,m,h,g,!0)}}e:{if(f=u?_p(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p===\"select\"||p===\"input\"&&f.type===\"file\")var E=yR;else if(gR(f))if(eM)E=J6;else{E=W6;var w=G6}else p=f.nodeName,!p||p.toLowerCase()!==\"input\"||f.type!==\"checkbox\"&&f.type!==\"radio\"?u&&iC(u.elementType)&&(E=yR):E=X6;if(E&&(E=E(t,u))){QI(d,E,n,c);break e}w&&w(t,f,u),t===\"focusout\"&&u&&f.type===\"number\"&&u.memoizedProps.value!=null&&yk(f,\"number\",f.value)}switch(w=u?_p(u):window,t){case\"focusin\":(gR(w)||w.contentEditable===\"true\")&&(Rc=w,xk=u,Bp=null);break;case\"focusout\":Bp=xk=Rc=null;break;case\"mousedown\":wk=!0;break;case\"contextmenu\":case\"mouseup\":case\"dragend\":wk=!1,wR(d,n,c);break;case\"selectionchange\":if(Z6)break;case\"keydown\":case\"keyup\":wR(d,n,c)}var k;if(dC)e:{switch(t){case\"compositionstart\":var A=\"onCompositionStart\";break e;case\"compositionend\":A=\"onCompositionEnd\";break e;case\"compositionupdate\":A=\"onCompositionUpdate\";break e}A=void 0}else Tc?YI(t,n)&&(A=\"onCompositionEnd\"):t===\"keydown\"&&n.keyCode===229&&(A=\"onCompositionStart\");A&&(JI&&n.locale!==\"ko\"&&(Tc||A!==\"onCompositionStart\"?A===\"onCompositionEnd\"&&Tc&&(k=XI()):(li=c,uC=\"value\"in li?li.value:li.textContent,Tc=!0)),w=Ab(u,A),0<w.length&&(A=new fR(A,t,null,n,c),d.push({event:A,listeners:w}),k?A.data=k:(k=ZI(n),k!==null&&(A.data=k)))),(k=U6?j6(t,n):q6(t,n))&&(A=Ab(u,\"onBeforeInput\"),0<A.length&&(w=new fR(\"onBeforeInput\",\"beforeinput\",null,n,c),d.push({event:w,listeners:A}),w.data=k)),N5(d,t,u,n,c)}W_(d,e)})}function oh(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Ab(t,e){for(var n=e+\"Capture\",r=[];t!==null;){var o=t,s=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||s===null||(o=Xp(t,n),o!=null&&r.unshift(oh(t,o,s)),o=Xp(t,e),o!=null&&r.push(oh(t,o,s))),t.tag===3)return r;t=t.return}return[]}function B5(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function sI(t,e,n,r,o){for(var s=e._reactName,a=[];n!==null&&n!==r;){var i=n,l=i.alternate,u=i.stateNode;if(i=i.tag,l!==null&&l===r)break;i!==5&&i!==26&&i!==27||u===null||(l=u,o?(u=Xp(n,s),u!=null&&a.unshift(oh(n,u,l))):o||(u=Xp(n,s),u!=null&&a.push(oh(n,u,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var z5=/\\r\\n?/g,F5=/\\u0000|\\uFFFD/g;function aI(t){return(typeof t==\"string\"?t:\"\"+t).replace(z5,`\n`).replace(F5,\"\")}function J_(t,e){return e=aI(e),aI(t)===e}function it(t,e,n,r,o,s){switch(n){case\"children\":typeof r==\"string\"?e===\"body\"||e===\"textarea\"&&r===\"\"||Vc(t,r):(typeof r==\"number\"||typeof r==\"bigint\")&&e!==\"body\"&&Vc(t,\"\"+r);break;case\"className\":Ry(t,\"class\",r);break;case\"tabIndex\":Ry(t,\"tabindex\",r);break;case\"dir\":case\"role\":case\"viewBox\":case\"width\":case\"height\":Ry(t,n,r);break;case\"style\":GI(t,r,s);break;case\"data\":if(e!==\"object\"){Ry(t,\"data\",r);break}case\"src\":case\"href\":if(r===\"\"&&(e!==\"a\"||n!==\"href\")){t.removeAttribute(n);break}if(r==null||typeof r==\"function\"||typeof r==\"symbol\"||typeof r==\"boolean\"){t.removeAttribute(n);break}r=qy(\"\"+r),t.setAttribute(n,r);break;case\"action\":case\"formAction\":if(typeof r==\"function\"){t.setAttribute(n,\"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')\");break}else typeof s==\"function\"&&(n===\"formAction\"?(e!==\"input\"&&it(t,e,\"name\",o.name,o,null),it(t,e,\"formEncType\",o.formEncType,o,null),it(t,e,\"formMethod\",o.formMethod,o,null),it(t,e,\"formTarget\",o.formTarget,o,null)):(it(t,e,\"encType\",o.encType,o,null),it(t,e,\"method\",o.method,o,null),it(t,e,\"target\",o.target,o,null)));if(r==null||typeof r==\"symbol\"||typeof r==\"boolean\"){t.removeAttribute(n);break}r=qy(\"\"+r),t.setAttribute(n,r);break;case\"onClick\":r!=null&&(t.onclick=ia);break;case\"onScroll\":r!=null&&De(\"scroll\",t);break;case\"onScrollEnd\":r!=null&&De(\"scrollend\",t);break;case\"dangerouslySetInnerHTML\":if(r!=null){if(typeof r!=\"object\"||!(\"__html\"in r))throw Error(B(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(B(60));t.innerHTML=n}}break;case\"multiple\":t.multiple=r&&typeof r!=\"function\"&&typeof r!=\"symbol\";break;case\"muted\":t.muted=r&&typeof r!=\"function\"&&typeof r!=\"symbol\";break;case\"suppressContentEditableWarning\":case\"suppressHydrationWarning\":case\"defaultValue\":case\"defaultChecked\":case\"innerHTML\":case\"ref\":break;case\"autoFocus\":break;case\"xlinkHref\":if(r==null||typeof r==\"function\"||typeof r==\"boolean\"||typeof r==\"symbol\"){t.removeAttribute(\"xlink:href\");break}n=qy(\"\"+r),t.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",n);break;case\"contentEditable\":case\"spellCheck\":case\"draggable\":case\"value\":case\"autoReverse\":case\"externalResourcesRequired\":case\"focusable\":case\"preserveAlpha\":r!=null&&typeof r!=\"function\"&&typeof r!=\"symbol\"?t.setAttribute(n,\"\"+r):t.removeAttribute(n);break;case\"inert\":case\"allowFullScreen\":case\"async\":case\"autoPlay\":case\"controls\":case\"default\":case\"defer\":case\"disabled\":case\"disablePictureInPicture\":case\"disableRemotePlayback\":case\"formNoValidate\":case\"hidden\":case\"loop\":case\"noModule\":case\"noValidate\":case\"open\":case\"playsInline\":case\"readOnly\":case\"required\":case\"reversed\":case\"scoped\":case\"seamless\":case\"itemScope\":r&&typeof r!=\"function\"&&typeof r!=\"symbol\"?t.setAttribute(n,\"\"):t.removeAttribute(n);break;case\"capture\":case\"download\":r===!0?t.setAttribute(n,\"\"):r!==!1&&r!=null&&typeof r!=\"function\"&&typeof r!=\"symbol\"?t.setAttribute(n,r):t.removeAttribute(n);break;case\"cols\":case\"rows\":case\"size\":case\"span\":r!=null&&typeof r!=\"function\"&&typeof r!=\"symbol\"&&!isNaN(r)&&1<=r?t.setAttribute(n,r):t.removeAttribute(n);break;case\"rowSpan\":case\"start\":r==null||typeof r==\"function\"||typeof r==\"symbol\"||isNaN(r)?t.removeAttribute(n):t.setAttribute(n,r);break;case\"popover\":De(\"beforetoggle\",t),De(\"toggle\",t),jy(t,\"popover\",r);break;case\"xlinkActuate\":Qs(t,\"http://www.w3.org/1999/xlink\",\"xlink:actuate\",r);break;case\"xlinkArcrole\":Qs(t,\"http://www.w3.org/1999/xlink\",\"xlink:arcrole\",r);break;case\"xlinkRole\":Qs(t,\"http://www.w3.org/1999/xlink\",\"xlink:role\",r);break;case\"xlinkShow\":Qs(t,\"http://www.w3.org/1999/xlink\",\"xlink:show\",r);break;case\"xlinkTitle\":Qs(t,\"http://www.w3.org/1999/xlink\",\"xlink:title\",r);break;case\"xlinkType\":Qs(t,\"http://www.w3.org/1999/xlink\",\"xlink:type\",r);break;case\"xmlBase\":Qs(t,\"http://www.w3.org/XML/1998/namespace\",\"xml:base\",r);break;case\"xmlLang\":Qs(t,\"http://www.w3.org/XML/1998/namespace\",\"xml:lang\",r);break;case\"xmlSpace\":Qs(t,\"http://www.w3.org/XML/1998/namespace\",\"xml:space\",r);break;case\"is\":jy(t,\"is\",r);break;case\"innerText\":case\"textContent\":break;default:(!(2<n.length)||n[0]!==\"o\"&&n[0]!==\"O\"||n[1]!==\"n\"&&n[1]!==\"N\")&&(n=m6.get(n)||n,jy(t,n,r))}}function Vk(t,e,n,r,o,s){switch(n){case\"style\":GI(t,r,s);break;case\"dangerouslySetInnerHTML\":if(r!=null){if(typeof r!=\"object\"||!(\"__html\"in r))throw Error(B(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(B(60));t.innerHTML=n}}break;case\"children\":typeof r==\"string\"?Vc(t,r):(typeof r==\"number\"||typeof r==\"bigint\")&&Vc(t,\"\"+r);break;case\"onScroll\":r!=null&&De(\"scroll\",t);break;case\"onScrollEnd\":r!=null&&De(\"scrollend\",t);break;case\"onClick\":r!=null&&(t.onclick=ia);break;case\"suppressContentEditableWarning\":case\"suppressHydrationWarning\":case\"innerHTML\":case\"ref\":break;case\"innerText\":case\"textContent\":break;default:if(!$I.hasOwnProperty(n))e:{if(n[0]===\"o\"&&n[1]===\"n\"&&(o=n.endsWith(\"Capture\"),e=n.slice(2,o?n.length-7:void 0),s=t[Cr]||null,s=s!=null?s[n]:null,typeof s==\"function\"&&t.removeEventListener(e,s,o),typeof r==\"function\")){typeof s!=\"function\"&&s!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,r,o);break e}n in t?t[n]=r:r===!0?t.setAttribute(n,\"\"):jy(t,n,r)}}}function Tn(t,e,n){switch(e){case\"div\":case\"span\":case\"svg\":case\"path\":case\"a\":case\"g\":case\"p\":case\"li\":break;case\"img\":De(\"error\",t),De(\"load\",t);var r=!1,o=!1,s;for(s in n)if(n.hasOwnProperty(s)){var a=n[s];if(a!=null)switch(s){case\"src\":r=!0;break;case\"srcSet\":o=!0;break;case\"children\":case\"dangerouslySetInnerHTML\":throw Error(B(137,e));default:it(t,e,s,a,n,null)}}o&&it(t,e,\"srcSet\",n.srcSet,n,null),r&&it(t,e,\"src\",n.src,n,null);return;case\"input\":De(\"invalid\",t);var i=s=a=o=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var c=n[r];if(c!=null)switch(r){case\"name\":o=c;break;case\"type\":a=c;break;case\"checked\":l=c;break;case\"defaultChecked\":u=c;break;case\"value\":s=c;break;case\"defaultValue\":i=c;break;case\"children\":case\"dangerouslySetInnerHTML\":if(c!=null)throw Error(B(137,e));break;default:it(t,e,r,c,n,null)}}qI(t,s,i,l,u,a,o,!1);return;case\"select\":De(\"invalid\",t),r=a=s=null;for(o in n)if(n.hasOwnProperty(o)&&(i=n[o],i!=null))switch(o){case\"value\":s=i;break;case\"defaultValue\":a=i;break;case\"multiple\":r=i;default:it(t,e,o,i,n,null)}e=s,n=a,t.multiple=!!r,e!=null?Bc(t,!!r,e,!1):n!=null&&Bc(t,!!r,n,!0);return;case\"textarea\":De(\"invalid\",t),s=o=r=null;for(a in n)if(n.hasOwnProperty(a)&&(i=n[a],i!=null))switch(a){case\"value\":r=i;break;case\"defaultValue\":o=i;break;case\"children\":s=i;break;case\"dangerouslySetInnerHTML\":if(i!=null)throw Error(B(91));break;default:it(t,e,a,i,n,null)}KI(t,r,o,s);return;case\"option\":for(l in n)n.hasOwnProperty(l)&&(r=n[l],r!=null)&&(l===\"selected\"?t.selected=r&&typeof r!=\"function\"&&typeof r!=\"symbol\":it(t,e,l,r,n,null));return;case\"dialog\":De(\"beforetoggle\",t),De(\"toggle\",t),De(\"cancel\",t),De(\"close\",t);break;case\"iframe\":case\"object\":De(\"load\",t);break;case\"video\":case\"audio\":for(r=0;r<rh.length;r++)De(rh[r],t);break;case\"image\":De(\"error\",t),De(\"load\",t);break;case\"details\":De(\"toggle\",t);break;case\"embed\":case\"source\":case\"link\":De(\"error\",t),De(\"load\",t);case\"area\":case\"base\":case\"br\":case\"col\":case\"hr\":case\"keygen\":case\"meta\":case\"param\":case\"track\":case\"wbr\":case\"menuitem\":for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case\"children\":case\"dangerouslySetInnerHTML\":throw Error(B(137,e));default:it(t,e,u,r,n,null)}return;default:if(iC(e)){for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!==void 0&&Vk(t,e,c,r,n,void 0));return}}for(i in n)n.hasOwnProperty(i)&&(r=n[i],r!=null&&it(t,e,i,r,n,null))}function H5(t,e,n,r){switch(e){case\"div\":case\"span\":case\"svg\":case\"path\":case\"a\":case\"g\":case\"p\":case\"li\":break;case\"input\":var o=null,s=null,a=null,i=null,l=null,u=null,c=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&d!=null)switch(p){case\"checked\":break;case\"value\":break;case\"defaultValue\":l=d;default:r.hasOwnProperty(p)||it(t,e,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(p!=null||d!=null))switch(f){case\"type\":s=p;break;case\"name\":o=p;break;case\"checked\":u=p;break;case\"defaultChecked\":c=p;break;case\"value\":a=p;break;case\"defaultValue\":i=p;break;case\"children\":case\"dangerouslySetInnerHTML\":if(p!=null)throw Error(B(137,e));break;default:p!==d&&it(t,e,f,p,r,d)}}gk(t,a,i,l,u,c,s,o);return;case\"select\":p=a=i=f=null;for(s in n)if(l=n[s],n.hasOwnProperty(s)&&l!=null)switch(s){case\"value\":break;case\"multiple\":p=l;default:r.hasOwnProperty(s)||it(t,e,s,null,r,l)}for(o in r)if(s=r[o],l=n[o],r.hasOwnProperty(o)&&(s!=null||l!=null))switch(o){case\"value\":f=s;break;case\"defaultValue\":i=s;break;case\"multiple\":a=s;default:s!==l&&it(t,e,o,s,r,l)}e=i,n=a,r=p,f!=null?Bc(t,!!n,f,!1):!!r!=!!n&&(e!=null?Bc(t,!!n,e,!0):Bc(t,!!n,n?[]:\"\",!1));return;case\"textarea\":p=f=null;for(i in n)if(o=n[i],n.hasOwnProperty(i)&&o!=null&&!r.hasOwnProperty(i))switch(i){case\"value\":break;case\"children\":break;default:it(t,e,i,null,r,o)}for(a in r)if(o=r[a],s=n[a],r.hasOwnProperty(a)&&(o!=null||s!=null))switch(a){case\"value\":f=o;break;case\"defaultValue\":p=o;break;case\"children\":break;case\"dangerouslySetInnerHTML\":if(o!=null)throw Error(B(91));break;default:o!==s&&it(t,e,a,o,r,s)}VI(t,f,p);return;case\"option\":for(var h in n)f=n[h],n.hasOwnProperty(h)&&f!=null&&!r.hasOwnProperty(h)&&(h===\"selected\"?t.selected=!1:it(t,e,h,null,r,f));for(l in r)f=r[l],p=n[l],r.hasOwnProperty(l)&&f!==p&&(f!=null||p!=null)&&(l===\"selected\"?t.selected=f&&typeof f!=\"function\"&&typeof f!=\"symbol\":it(t,e,l,f,r,p));return;case\"img\":case\"link\":case\"area\":case\"base\":case\"br\":case\"col\":case\"embed\":case\"hr\":case\"keygen\":case\"meta\":case\"param\":case\"source\":case\"track\":case\"wbr\":case\"menuitem\":for(var g in n)f=n[g],n.hasOwnProperty(g)&&f!=null&&!r.hasOwnProperty(g)&&it(t,e,g,null,r,f);for(u in r)if(f=r[u],p=n[u],r.hasOwnProperty(u)&&f!==p&&(f!=null||p!=null))switch(u){case\"children\":case\"dangerouslySetInnerHTML\":if(f!=null)throw Error(B(137,e));break;default:it(t,e,u,f,r,p)}return;default:if(iC(e)){for(var m in n)f=n[m],n.hasOwnProperty(m)&&f!==void 0&&!r.hasOwnProperty(m)&&Vk(t,e,m,void 0,r,f);for(c in r)f=r[c],p=n[c],!r.hasOwnProperty(c)||f===p||f===void 0&&p===void 0||Vk(t,e,c,f,r,p);return}}for(var y in n)f=n[y],n.hasOwnProperty(y)&&f!=null&&!r.hasOwnProperty(y)&&it(t,e,y,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||f==null&&p==null||it(t,e,d,f,r,p)}function iI(t){switch(t){case\"css\":case\"script\":case\"font\":case\"img\":case\"image\":case\"input\":case\"link\":return!0;default:return!1}}function $5(){if(typeof performance.getEntriesByType==\"function\"){for(var t=0,e=0,n=performance.getEntriesByType(\"resource\"),r=0;r<n.length;r++){var o=n[r],s=o.transferSize,a=o.initiatorType,i=o.duration;if(s&&i&&iI(a)){for(a=0,i=o.responseEnd,r+=1;r<n.length;r++){var l=n[r],u=l.startTime;if(u>i)break;var c=l.transferSize,d=l.initiatorType;c&&iI(d)&&(l=l.responseEnd,a+=c*(l<i?1:(i-u)/(l-u)))}if(--r,e+=8*(s+a)/(o.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t==\"number\")?t:5}var Kk=null,Gk=null;function Eb(t){return t.nodeType===9?t:t.ownerDocument}function lI(t){switch(t){case\"http://www.w3.org/2000/svg\":return 1;case\"http://www.w3.org/1998/Math/MathML\":return 2;default:return 0}}function Y_(t,e){if(t===0)switch(e){case\"svg\":return 1;case\"math\":return 2;default:return 0}return t===1&&e===\"foreignObject\"?0:t}function Wk(t,e){return t===\"textarea\"||t===\"noscript\"||typeof e.children==\"string\"||typeof e.children==\"number\"||typeof e.children==\"bigint\"||typeof e.dangerouslySetInnerHTML==\"object\"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var ok=null;function U5(){var t=window.event;return t&&t.type===\"popstate\"?t===ok?!1:(ok=t,!0):(ok=null,!1)}var Z_=typeof setTimeout==\"function\"?setTimeout:void 0,j5=typeof clearTimeout==\"function\"?clearTimeout:void 0,uI=typeof Promise==\"function\"?Promise:void 0,q5=typeof queueMicrotask==\"function\"?queueMicrotask:typeof uI<\"u\"?function(t){return uI.resolve(null).then(t).catch(V5)}:Z_;function V5(t){setTimeout(function(){throw t})}function Ai(t){return t===\"head\"}function cI(t,e){var n=e,r=0;do{var o=n.nextSibling;if(t.removeChild(n),o&&o.nodeType===8)if(n=o.data,n===\"/$\"||n===\"/&\"){if(r===0){t.removeChild(o),Qc(e);return}r--}else if(n===\"$\"||n===\"$?\"||n===\"$~\"||n===\"$!\"||n===\"&\")r++;else if(n===\"html\")Gp(t.ownerDocument.documentElement);else if(n===\"head\"){n=t.ownerDocument.head,Gp(n);for(var s=n.firstChild;s;){var a=s.nextSibling,i=s.nodeName;s[fh]||i===\"SCRIPT\"||i===\"STYLE\"||i===\"LINK\"&&s.rel.toLowerCase()===\"stylesheet\"||n.removeChild(s),s=a}}else n===\"body\"&&Gp(t.ownerDocument.body);n=o}while(n);Qc(e)}function dI(t,e){var n=t;t=0;do{var r=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display=\"none\"):(n.style.display=n._stashedDisplay||\"\",n.getAttribute(\"style\")===\"\"&&n.removeAttribute(\"style\")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=\"\"):n.nodeValue=n._stashedText||\"\"),r&&r.nodeType===8)if(n=r.data,n===\"/$\"){if(t===0)break;t--}else n!==\"$\"&&n!==\"$?\"&&n!==\"$~\"&&n!==\"$!\"||t++;n=r}while(n)}function Xk(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case\"HTML\":case\"HEAD\":case\"BODY\":Xk(n),aC(n);continue;case\"SCRIPT\":case\"STYLE\":continue;case\"LINK\":if(n.rel.toLowerCase()===\"stylesheet\")continue}t.removeChild(n)}}function K5(t,e,n,r){for(;t.nodeType===1;){var o=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!r&&(t.nodeName!==\"INPUT\"||t.type!==\"hidden\"))break}else if(r){if(!t[fh])switch(e){case\"meta\":if(!t.hasAttribute(\"itemprop\"))break;return t;case\"link\":if(s=t.getAttribute(\"rel\"),s===\"stylesheet\"&&t.hasAttribute(\"data-precedence\"))break;if(s!==o.rel||t.getAttribute(\"href\")!==(o.href==null||o.href===\"\"?null:o.href)||t.getAttribute(\"crossorigin\")!==(o.crossOrigin==null?null:o.crossOrigin)||t.getAttribute(\"title\")!==(o.title==null?null:o.title))break;return t;case\"style\":if(t.hasAttribute(\"data-precedence\"))break;return t;case\"script\":if(s=t.getAttribute(\"src\"),(s!==(o.src==null?null:o.src)||t.getAttribute(\"type\")!==(o.type==null?null:o.type)||t.getAttribute(\"crossorigin\")!==(o.crossOrigin==null?null:o.crossOrigin))&&s&&t.hasAttribute(\"async\")&&!t.hasAttribute(\"itemprop\"))break;return t;default:return t}}else if(e===\"input\"&&t.type===\"hidden\"){var s=o.name==null?null:\"\"+o.name;if(o.type===\"hidden\"&&t.getAttribute(\"name\")===s)return t}else return t;if(t=wo(t.nextSibling),t===null)break}return null}function G5(t,e,n){if(e===\"\")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!==\"INPUT\"||t.type!==\"hidden\")&&!n||(t=wo(t.nextSibling),t===null))return null;return t}function Q_(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!==\"INPUT\"||t.type!==\"hidden\")&&!e||(t=wo(t.nextSibling),t===null))return null;return t}function Jk(t){return t.data===\"$?\"||t.data===\"$~\"}function Yk(t){return t.data===\"$!\"||t.data===\"$?\"&&t.ownerDocument.readyState!==\"loading\"}function W5(t,e){var n=t.ownerDocument;if(t.data===\"$~\")t._reactRetry=e;else if(t.data!==\"$?\"||n.readyState!==\"loading\")e();else{var r=function(){e(),n.removeEventListener(\"DOMContentLoaded\",r)};n.addEventListener(\"DOMContentLoaded\",r),t._reactRetry=r}}function wo(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e===\"$\"||e===\"$!\"||e===\"$?\"||e===\"$~\"||e===\"&\"||e===\"F!\"||e===\"F\")break;if(e===\"/$\"||e===\"/&\")return null}}return t}var Zk=null;function fI(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n===\"/$\"||n===\"/&\"){if(e===0)return wo(t.nextSibling);e--}else n!==\"$\"&&n!==\"$!\"&&n!==\"$?\"&&n!==\"$~\"&&n!==\"&\"||e++}t=t.nextSibling}return null}function pI(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n===\"$\"||n===\"$!\"||n===\"$?\"||n===\"$~\"||n===\"&\"){if(e===0)return t;e--}else n!==\"/$\"&&n!==\"/&\"||e++}t=t.previousSibling}return null}function eO(t,e,n){switch(e=Eb(n),t){case\"html\":if(t=e.documentElement,!t)throw Error(B(452));return t;case\"head\":if(t=e.head,!t)throw Error(B(453));return t;case\"body\":if(t=e.body,!t)throw Error(B(454));return t;default:throw Error(B(451))}}function Gp(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);aC(t)}var So=new Map,hI=new Set;function Tb(t){return typeof t.getRootNode==\"function\"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ya=Ye.d;Ye.d={f:X5,r:J5,D:Y5,C:Z5,L:Q5,m:eV,X:nV,S:tV,M:rV};function X5(){var t=ya.f(),e=Vb();return t||e}function J5(t){var e=td(t);e!==null&&e.tag===5&&e.type===\"form\"?GM(e):ya.r(t)}var sd=typeof document>\"u\"?null:document;function tO(t,e,n){var r=sd;if(r&&typeof e==\"string\"&&e){var o=yo(e);o='link[rel=\"'+t+'\"][href=\"'+o+'\"]',typeof n==\"string\"&&(o+='[crossorigin=\"'+n+'\"]'),hI.has(o)||(hI.add(o),t={rel:t,crossOrigin:n,href:e},r.querySelector(o)===null&&(e=r.createElement(\"link\"),Tn(e,\"link\",t),hn(e),r.head.appendChild(e)))}}function Y5(t){ya.D(t),tO(\"dns-prefetch\",t,null)}function Z5(t,e){ya.C(t,e),tO(\"preconnect\",t,e)}function Q5(t,e,n){ya.L(t,e,n);var r=sd;if(r&&t&&e){var o='link[rel=\"preload\"][as=\"'+yo(e)+'\"]';e===\"image\"&&n&&n.imageSrcSet?(o+='[imagesrcset=\"'+yo(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(o+='[imagesizes=\"'+yo(n.imageSizes)+'\"]')):o+='[href=\"'+yo(t)+'\"]';var s=o;switch(e){case\"style\":s=Zc(t);break;case\"script\":s=ad(t)}So.has(s)||(t=wt({rel:\"preload\",href:e===\"image\"&&n&&n.imageSrcSet?void 0:t,as:e},n),So.set(s,t),r.querySelector(o)!==null||e===\"style\"&&r.querySelector(bh(s))||e===\"script\"&&r.querySelector(vh(s))||(e=r.createElement(\"link\"),Tn(e,\"link\",t),hn(e),r.head.appendChild(e)))}}function eV(t,e){ya.m(t,e);var n=sd;if(n&&t){var r=e&&typeof e.as==\"string\"?e.as:\"script\",o='link[rel=\"modulepreload\"][as=\"'+yo(r)+'\"][href=\"'+yo(t)+'\"]',s=o;switch(r){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":s=ad(t)}if(!So.has(s)&&(t=wt({rel:\"modulepreload\",href:t},e),So.set(s,t),n.querySelector(o)===null)){switch(r){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(vh(s)))return}r=n.createElement(\"link\"),Tn(r,\"link\",t),hn(r),n.head.appendChild(r)}}}function tV(t,e,n){ya.S(t,e,n);var r=sd;if(r&&t){var o=Pc(r).hoistableStyles,s=Zc(t);e=e||\"default\";var a=o.get(s);if(!a){var i={loading:0,preload:null};if(a=r.querySelector(bh(s)))i.loading=5;else{t=wt({rel:\"stylesheet\",href:t,\"data-precedence\":e},n),(n=So.get(s))&&VC(t,n);var l=a=r.createElement(\"link\");hn(l),Tn(l,\"link\",t),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener(\"load\",function(){i.loading|=1}),l.addEventListener(\"error\",function(){i.loading|=2}),i.loading|=4,eb(a,e,r)}a={type:\"stylesheet\",instance:a,count:1,state:i},o.set(s,a)}}}function nV(t,e){ya.X(t,e);var n=sd;if(n&&t){var r=Pc(n).hoistableScripts,o=ad(t),s=r.get(o);s||(s=n.querySelector(vh(o)),s||(t=wt({src:t,async:!0},e),(e=So.get(o))&&KC(t,e),s=n.createElement(\"script\"),hn(s),Tn(s,\"link\",t),n.head.appendChild(s)),s={type:\"script\",instance:s,count:1,state:null},r.set(o,s))}}function rV(t,e){ya.M(t,e);var n=sd;if(n&&t){var r=Pc(n).hoistableScripts,o=ad(t),s=r.get(o);s||(s=n.querySelector(vh(o)),s||(t=wt({src:t,async:!0,type:\"module\"},e),(e=So.get(o))&&KC(t,e),s=n.createElement(\"script\"),hn(s),Tn(s,\"link\",t),n.head.appendChild(s)),s={type:\"script\",instance:s,count:1,state:null},r.set(o,s))}}function mI(t,e,n,r){var o=(o=fi.current)?Tb(o):null;if(!o)throw Error(B(446));switch(t){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(e=Zc(n.href),n=Pc(o).hoistableStyles,r=n.get(e),r||(r={type:\"style\",instance:null,count:0,state:null},n.set(e,r)),r):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){t=Zc(n.href);var s=Pc(o).hoistableStyles,a=s.get(t);if(a||(o=o.ownerDocument||o,a={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,a),(s=o.querySelector(bh(t)))&&!s._p&&(a.instance=s,a.state.loading=5),So.has(t)||(n={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},So.set(t,n),s||oV(o,t,n,a.state))),e&&r===null)throw Error(B(528,\"\"));return a}if(e&&r!==null)throw Error(B(529,\"\"));return null;case\"script\":return e=n.async,n=n.src,typeof n==\"string\"&&e&&typeof e!=\"function\"&&typeof e!=\"symbol\"?(e=ad(n),n=Pc(o).hoistableScripts,r=n.get(e),r||(r={type:\"script\",instance:null,count:0,state:null},n.set(e,r)),r):{type:\"void\",instance:null,count:0,state:null};default:throw Error(B(444,t))}}function Zc(t){return'href=\"'+yo(t)+'\"'}function bh(t){return'link[rel=\"stylesheet\"]['+t+\"]\"}function nO(t){return wt({},t,{\"data-precedence\":t.precedence,precedence:null})}function oV(t,e,n,r){t.querySelector('link[rel=\"preload\"][as=\"style\"]['+e+\"]\")?r.loading=1:(e=t.createElement(\"link\"),r.preload=e,e.addEventListener(\"load\",function(){return r.loading|=1}),e.addEventListener(\"error\",function(){return r.loading|=2}),Tn(e,\"link\",n),hn(e),t.head.appendChild(e))}function ad(t){return'[src=\"'+yo(t)+'\"]'}function vh(t){return\"script[async]\"+t}function gI(t,e,n){if(e.count++,e.instance===null)switch(e.type){case\"style\":var r=t.querySelector('style[data-href~=\"'+yo(n.href)+'\"]');if(r)return e.instance=r,hn(r),r;var o=wt({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement(\"style\"),hn(r),Tn(r,\"style\",o),eb(r,n.precedence,t),e.instance=r;case\"stylesheet\":o=Zc(n.href);var s=t.querySelector(bh(o));if(s)return e.state.loading|=4,e.instance=s,hn(s),s;r=nO(n),(o=So.get(o))&&VC(r,o),s=(t.ownerDocument||t).createElement(\"link\"),hn(s);var a=s;return a._p=new Promise(function(i,l){a.onload=i,a.onerror=l}),Tn(s,\"link\",r),e.state.loading|=4,eb(s,n.precedence,t),e.instance=s;case\"script\":return s=ad(n.src),(o=t.querySelector(vh(s)))?(e.instance=o,hn(o),o):(r=n,(o=So.get(s))&&(r=wt({},n),KC(r,o)),t=t.ownerDocument||t,o=t.createElement(\"script\"),hn(o),Tn(o,\"link\",r),t.head.appendChild(o),e.instance=o);case\"void\":return null;default:throw Error(B(443,e.type))}else e.type===\"stylesheet\"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,eb(r,n.precedence,t));return e.instance}function eb(t,e,n){for(var r=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,s=o,a=0;a<r.length;a++){var i=r[a];if(i.dataset.precedence===e)s=i;else if(s!==o)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function VC(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function KC(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var tb=null;function yI(t,e,n){if(tb===null){var r=new Map,o=tb=new Map;o.set(n,r)}else o=tb,r=o.get(n),r||(r=new Map,o.set(n,r));if(r.has(t))return r;for(r.set(t,null),n=n.getElementsByTagName(t),o=0;o<n.length;o++){var s=n[o];if(!(s[fh]||s[Ln]||t===\"link\"&&s.getAttribute(\"rel\")===\"stylesheet\")&&s.namespaceURI!==\"http://www.w3.org/2000/svg\"){var a=s.getAttribute(e)||\"\";a=t+a;var i=r.get(a);i?i.push(s):r.set(a,[s])}}return r}function bI(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e===\"title\"?t.querySelector(\"head > title\"):null)}function sV(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case\"meta\":case\"title\":return!0;case\"style\":if(typeof e.precedence!=\"string\"||typeof e.href!=\"string\"||e.href===\"\")break;return!0;case\"link\":if(typeof e.rel!=\"string\"||typeof e.href!=\"string\"||e.href===\"\"||e.onLoad||e.onError)break;return e.rel===\"stylesheet\"?(t=e.disabled,typeof e.precedence==\"string\"&&t==null):!0;case\"script\":if(e.async&&typeof e.async!=\"function\"&&typeof e.async!=\"symbol\"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src==\"string\")return!0}return!1}function rO(t){return!(t.type===\"stylesheet\"&&(t.state.loading&3)===0)}function aV(t,e,n,r){if(n.type===\"stylesheet\"&&(typeof r.media!=\"string\"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=Zc(r.href),s=e.querySelector(bh(o));if(s){e=s._p,e!==null&&typeof e==\"object\"&&typeof e.then==\"function\"&&(t.count++,t=Rb.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,hn(s);return}s=e.ownerDocument||e,r=nO(r),(o=So.get(o))&&VC(r,o),s=s.createElement(\"link\"),hn(s);var a=s;a._p=new Promise(function(i,l){a.onload=i,a.onerror=l}),Tn(s,\"link\",r),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Rb.bind(t),e.addEventListener(\"load\",n),e.addEventListener(\"error\",n))}}var sk=0;function iV(t,e){return t.stylesheets&&t.count===0&&nb(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var r=setTimeout(function(){if(t.stylesheets&&nb(t,t.stylesheets),t.unsuspend){var s=t.unsuspend;t.unsuspend=null,s()}},6e4+e);0<t.imgBytes&&sk===0&&(sk=62500*$5());var o=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&nb(t,t.stylesheets),t.unsuspend)){var s=t.unsuspend;t.unsuspend=null,s()}},(t.imgBytes>sk?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function Rb(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nb(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ib=null;function nb(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ib=new Map,e.forEach(lV,t),Ib=null,Rb.call(t))}function lV(t,e){if(!(e.state.loading&4)){var n=Ib.get(t);if(n)var r=n.get(null);else{n=new Map,Ib.set(t,n);for(var o=t.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),s=0;s<o.length;s++){var a=o[s];(a.nodeName===\"LINK\"||a.getAttribute(\"media\")!==\"not all\")&&(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}o=e.instance,a=o.getAttribute(\"data-precedence\"),s=n.get(a)||r,s===r&&n.set(null,o),n.set(a,o),this.count++,r=Rb.bind(this),o.addEventListener(\"load\",r),o.addEventListener(\"error\",r),s?s.parentNode.insertBefore(o,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(o,t.firstChild)),e.state.loading|=4}}var sh={$$typeof:aa,Provider:null,Consumer:null,_currentValue:Dl,_currentValue2:Dl,_threadCount:0};function uV(t,e,n,r,o,s,a,i,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=MS(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=MS(0),this.hiddenUpdates=MS(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=s,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function oO(t,e,n,r,o,s,a,i,l,u,c,d){return t=new uV(t,e,n,a,l,u,c,d,i),e=1,s===!0&&(e|=24),s=zr(3,null,null,e),t.current=s,s.stateNode=t,e=bC(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:r,isDehydrated:n,cache:e},wC(s),t}function sO(t){return t?(t=_c,t):_c}function aO(t,e,n,r,o,s){o=sO(o),r.context===null?r.context=o:r.pendingContext=o,r=hi(e),r.payload={element:n},s=s===void 0?null:s,s!==null&&(r.callback=s),n=mi(t,r,e),n!==null&&(kr(n,t,e),Fp(n,t,e))}function vI(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function GC(t,e){vI(t,e),(t=t.alternate)&&vI(t,e)}function iO(t){if(t.tag===13||t.tag===31){var e=Gl(t,67108864);e!==null&&kr(e,t,67108864),GC(t,67108864)}}function xI(t){if(t.tag===13||t.tag===31){var e=jr();e=oC(e);var n=Gl(t,e);n!==null&&kr(n,t,e),GC(t,e)}}var Mb=!0;function cV(t,e,n,r){var o=be.T;be.T=null;var s=Ye.p;try{Ye.p=2,WC(t,e,n,r)}finally{Ye.p=s,be.T=o}}function dV(t,e,n,r){var o=be.T;be.T=null;var s=Ye.p;try{Ye.p=8,WC(t,e,n,r)}finally{Ye.p=s,be.T=o}}function WC(t,e,n,r){if(Mb){var o=Qk(r);if(o===null)rk(t,e,r,_b,n),wI(t,r);else if(pV(o,t,e,n,r))r.stopPropagation();else if(wI(t,r),e&4&&-1<fV.indexOf(t)){for(;o!==null;){var s=td(o);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var a=Ml(s.pendingLanes);if(a!==0){var i=s;for(i.pendingLanes|=2,i.entangledLanes|=2;a;){var l=1<<31-Ur(a);i.entanglements[1]|=l,a&=~l}ms(s),(Je&6)===0&&(wb=Hr()+500,yh(0,!1))}}break;case 31:case 13:i=Gl(s,2),i!==null&&kr(i,s,2),Vb(),GC(s,2)}if(s=Qk(r),s===null&&rk(t,e,r,_b,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else rk(t,e,r,null,n)}}function Qk(t){return t=lC(t),XC(t)}var _b=null;function XC(t){if(_b=null,t=Ac(t),t!==null){var e=lh(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=EI(e),t!==null)return t;t=null}else if(n===31){if(t=TI(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return _b=t,null}function lO(t){switch(t){case\"beforetoggle\":case\"cancel\":case\"click\":case\"close\":case\"contextmenu\":case\"copy\":case\"cut\":case\"auxclick\":case\"dblclick\":case\"dragend\":case\"dragstart\":case\"drop\":case\"focusin\":case\"focusout\":case\"input\":case\"invalid\":case\"keydown\":case\"keypress\":case\"keyup\":case\"mousedown\":case\"mouseup\":case\"paste\":case\"pause\":case\"play\":case\"pointercancel\":case\"pointerdown\":case\"pointerup\":case\"ratechange\":case\"reset\":case\"resize\":case\"seeked\":case\"submit\":case\"toggle\":case\"touchcancel\":case\"touchend\":case\"touchstart\":case\"volumechange\":case\"change\":case\"selectionchange\":case\"textInput\":case\"compositionstart\":case\"compositionend\":case\"compositionupdate\":case\"beforeblur\":case\"afterblur\":case\"beforeinput\":case\"blur\":case\"fullscreenchange\":case\"focus\":case\"hashchange\":case\"popstate\":case\"select\":case\"selectstart\":return 2;case\"drag\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"mousemove\":case\"mouseout\":case\"mouseover\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"scroll\":case\"touchmove\":case\"wheel\":case\"mouseenter\":case\"mouseleave\":case\"pointerenter\":case\"pointerleave\":return 8;case\"message\":switch(Qq()){case _I:return 2;case OI:return 8;case ib:case e6:return 32;case DI:return 268435456;default:return 32}default:return 32}}var eC=!1,bi=null,vi=null,xi=null,ah=new Map,ih=new Map,ai=[],fV=\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset\".split(\" \");function wI(t,e){switch(t){case\"focusin\":case\"focusout\":bi=null;break;case\"dragenter\":case\"dragleave\":vi=null;break;case\"mouseover\":case\"mouseout\":xi=null;break;case\"pointerover\":case\"pointerout\":ah.delete(e.pointerId);break;case\"gotpointercapture\":case\"lostpointercapture\":ih.delete(e.pointerId)}}function Tp(t,e,n,r,o,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},e!==null&&(e=td(e),e!==null&&iO(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,o!==null&&e.indexOf(o)===-1&&e.push(o),t)}function pV(t,e,n,r,o){switch(e){case\"focusin\":return bi=Tp(bi,t,e,n,r,o),!0;case\"dragenter\":return vi=Tp(vi,t,e,n,r,o),!0;case\"mouseover\":return xi=Tp(xi,t,e,n,r,o),!0;case\"pointerover\":var s=o.pointerId;return ah.set(s,Tp(ah.get(s)||null,t,e,n,r,o)),!0;case\"gotpointercapture\":return s=o.pointerId,ih.set(s,Tp(ih.get(s)||null,t,e,n,r,o)),!0}return!1}function uO(t){var e=Ac(t.target);if(e!==null){var n=lh(e);if(n!==null){if(e=n.tag,e===13){if(e=EI(n),e!==null){t.blockedOn=e,oR(t.priority,function(){xI(n)});return}}else if(e===31){if(e=TI(n),e!==null){t.blockedOn=e,oR(t.priority,function(){xI(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function rb(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Qk(t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);bk=r,n.target.dispatchEvent(r),bk=null}else return e=td(n),e!==null&&iO(e),t.blockedOn=n,!1;e.shift()}return!0}function SI(t,e,n){rb(t)&&n.delete(e)}function hV(){eC=!1,bi!==null&&rb(bi)&&(bi=null),vi!==null&&rb(vi)&&(vi=null),xi!==null&&rb(xi)&&(xi=null),ah.forEach(SI),ih.forEach(SI)}function $y(t,e){t.blockedOn===e&&(t.blockedOn=null,eC||(eC=!0,sn.unstable_scheduleCallback(sn.unstable_NormalPriority,hV)))}var Uy=null;function kI(t){Uy!==t&&(Uy=t,sn.unstable_scheduleCallback(sn.unstable_NormalPriority,function(){Uy===t&&(Uy=null);for(var e=0;e<t.length;e+=3){var n=t[e],r=t[e+1],o=t[e+2];if(typeof r!=\"function\"){if(XC(r||n)===null)continue;break}var s=td(n);s!==null&&(t.splice(e,3),e-=3,Dk(s,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Qc(t){function e(l){return $y(l,t)}bi!==null&&$y(bi,t),vi!==null&&$y(vi,t),xi!==null&&$y(xi,t),ah.forEach(e),ih.forEach(e);for(var n=0;n<ai.length;n++){var r=ai[n];r.blockedOn===t&&(r.blockedOn=null)}for(;0<ai.length&&(n=ai[0],n.blockedOn===null);)uO(n),n.blockedOn===null&&ai.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var o=n[r],s=n[r+1],a=o[Cr]||null;if(typeof s==\"function\")a||kI(n);else if(a){var i=null;if(s&&s.hasAttribute(\"formAction\")){if(o=s,a=s[Cr]||null)i=a.formAction;else if(XC(o)!==null)continue}else i=a.action;typeof i==\"function\"?n[r+1]=i:(n.splice(r,3),r-=3),kI(n)}}}function cO(){function t(s){s.canIntercept&&s.info===\"react-transition\"&&s.intercept({handler:function(){return new Promise(function(a){return o=a})},focusReset:\"manual\",scroll:\"manual\"})}function e(){o!==null&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:\"react-transition\",history:\"replace\"})}}if(typeof navigation==\"object\"){var r=!1,o=null;return navigation.addEventListener(\"navigate\",t),navigation.addEventListener(\"navigatesuccess\",e),navigation.addEventListener(\"navigateerror\",e),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(\"navigate\",t),navigation.removeEventListener(\"navigatesuccess\",e),navigation.removeEventListener(\"navigateerror\",e),o!==null&&(o(),o=null)}}}function JC(t){this._internalRoot=t}Wb.prototype.render=JC.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(B(409));var n=e.current,r=jr();aO(n,r,t,e,null,null)};Wb.prototype.unmount=JC.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;aO(t.current,2,null,t,null,null),Vb(),e[ed]=null}};function Wb(t){this._internalRoot=t}Wb.prototype.unstable_scheduleHydration=function(t){if(t){var e=FI();t={blockedOn:null,target:t,priority:e};for(var n=0;n<ai.length&&e!==0&&e<ai[n].priority;n++);ai.splice(n,0,t),n===0&&uO(t)}};var CI=LI.version;if(CI!==\"19.2.8\")throw Error(B(527,CI,\"19.2.8\"));Ye.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render==\"function\"?Error(B(188)):(t=Object.keys(t).join(\",\"),Error(B(268,t)));return t=Kq(e),t=t!==null?RI(t):null,t=t===null?null:t.stateNode,t};var mV={bundleType:0,version:\"19.2.8\",rendererPackageName:\"react-dom\",currentDispatcherRef:be,reconcilerVersion:\"19.2.8\"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\"u\"&&(Rp=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Rp.isDisabled&&Rp.supportsFiber))try{uh=Rp.inject(mV),$r=Rp}catch{}var Rp;Xb.createRoot=function(t,e){if(!AI(t))throw Error(B(299));var n=!1,r=\"\",o=t_,s=n_,a=r_;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onUncaughtError!==void 0&&(o=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=oO(t,1,!1,null,null,n,r,null,o,s,a,cO),t[ed]=e.current,qC(t),new JC(e)};Xb.hydrateRoot=function(t,e,n){if(!AI(t))throw Error(B(299));var r=!1,o=\"\",s=t_,a=n_,i=r_,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(i=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=oO(t,1,!0,e,n??null,r,o,l,s,a,i,cO),e.context=sO(null),n=e.current,r=jr(),r=oC(r),o=hi(r),o.callback=null,mi(n,o,r),n=r,e.current.lanes=n,dh(e,n),ms(e),t[ed]=e.current,qC(t),new Wb(e)};Xb.version=\"19.2.8\"});var hO=br((iae,pO)=>{\"use strict\";function fO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fO)}catch(t){console.error(t)}}fO(),pO.exports=dO()});var DO=br(nv=>{\"use strict\";var i8=Symbol.for(\"react.transitional.element\"),l8=Symbol.for(\"react.fragment\");function OO(t,e,n){var r=null;if(n!==void 0&&(r=\"\"+n),e.key!==void 0&&(r=\"\"+e.key),\"key\"in e){n={};for(var o in e)o!==\"key\"&&(n[o]=e[o])}else n=e;return e=n.ref,{$$typeof:i8,type:t,key:r,ref:e!==void 0?e:null,props:n}}nv.Fragment=l8;nv.jsx=OO;nv.jsxs=OO});var O=br((xle,NO)=>{\"use strict\";NO.exports=DO()});var JN=br(XN=>{\"use strict\";var Pd=te();function q9(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var V9=typeof Object.is==\"function\"?Object.is:q9,K9=Pd.useState,G9=Pd.useEffect,W9=Pd.useLayoutEffect,X9=Pd.useDebugValue;function J9(t,e){var n=e(),r=K9({inst:{value:n,getSnapshot:e}}),o=r[0].inst,s=r[1];return W9(function(){o.value=n,o.getSnapshot=e,qL(o)&&s({inst:o})},[t,n,e]),G9(function(){return qL(o)&&s({inst:o}),t(function(){qL(o)&&s({inst:o})})},[t]),X9(n),n}function qL(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!V9(t,n)}catch{return!0}}function Y9(t,e){return e()}var Z9=typeof window>\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"?Y9:J9;XN.useSyncExternalStore=Pd.useSyncExternalStore!==void 0?Pd.useSyncExternalStore:Z9});var VL=br((Qce,YN)=>{\"use strict\";YN.exports=JN()});var TB=br(EB=>{\"use strict\";var Rx=te(),JX=VL();function YX(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ZX=typeof Object.is==\"function\"?Object.is:YX,QX=JX.useSyncExternalStore,eJ=Rx.useRef,tJ=Rx.useEffect,nJ=Rx.useMemo,rJ=Rx.useDebugValue;EB.useSyncExternalStoreWithSelector=function(t,e,n,r,o){var s=eJ(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=nJ(function(){function l(p){if(!u){if(u=!0,c=p,p=r(p),o!==void 0&&a.hasValue){var h=a.value;if(o(h,p))return d=h}return d=p}if(h=d,ZX(c,p))return h;var g=r(p);return o!==void 0&&o(h,g)?(c=p,h):(c=p,d=g)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,n,r,o]);var i=QX(t,s[0],s[1]);return tJ(function(){a.hasValue=!0,a.value=i},[i]),rJ(i),i}});var IB=br((dfe,RB)=>{\"use strict\";RB.exports=TB()});var $4=T(hO(),1);var mO=\"smoodly-admin-data\",gO=\"smoodly-admin-root\";var yO=\"\";function bO(t){yO=t}var YC=t=>yO+t;var as=T(te(),1);var gV={pages:[\"list\",\"get\",\"create\",\"saveDraft\",\"publish\",\"unpublish\",\"discardDraft\",\"delete\",\"rename\",\"move\",\"setTemplate\",\"addLocale\",\"removeLocale\",\"listVersions\",\"restore\"],entries:[\"list\",\"distinct\",\"get\",\"create\",\"save\",\"setStatus\",\"discardDraft\",\"delete\",\"move\",\"addLocale\",\"removeLocale\",\"listVersions\",\"getVersion\",\"restore\"],globals:[\"list\",\"get\",\"save\",\"setStatus\",\"discardDraft\",\"listVersions\",\"getVersion\",\"restore\"],assets:[\"list\",\"get\",\"beginUpload\",\"finishUpload\",\"update\",\"delete\",\"usage\"],members:[\"list\",\"me\",\"invite\",\"setRole\",\"remove\"],redirects:[\"list\",\"targets\",\"add\",\"remove\"],health:[\"scan\"],schema:[\"status\"],preview:[\"enable\",\"disable\"]};function vO(t,e,n){let r={};for(let[o,s]of Object.entries(gV)){r[o]={};for(let a of s)r[o][a]=(...i)=>{let l=e?.()??null;return t({path:`${o}.${a}`,args:i,...l?{token:l}:{}}).then(u=>(!u.ok&&u.expired&&n?.(),u))}}return r}var Ko=T(te(),1);var ud=T(te(),1);var Zb=T(te(),1);var Jb=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==\"\"&&r.indexOf(e)===n).join(\" \").trim();var xO=t=>t.replace(/([a-z0-9])([A-Z])/g,\"$1-$2\").toLowerCase();var wO=t=>t.replace(/^([A-Z])|[\\s-_]+(\\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());var ZC=t=>{let e=wO(t);return e.charAt(0).toUpperCase()+e.slice(1)};var xh=T(te(),1);var Yb={xmlns:\"http://www.w3.org/2000/svg\",width:24,height:24,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:2,strokeLinecap:\"round\",strokeLinejoin:\"round\"};var SO=t=>{for(let e in t)if(e.startsWith(\"aria-\")||e===\"role\"||e===\"title\")return!0;return!1};var id=T(te(),1);var yV=(0,id.createContext)({});var kO=()=>(0,id.useContext)(yV);var CO=(0,xh.forwardRef)(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o=\"\",children:s,iconNode:a,...i},l)=>{let{size:u=24,strokeWidth:c=2,absoluteStrokeWidth:d=!1,color:f=\"currentColor\",className:p=\"\"}=kO()??{},h=r??d?Number(n??c)*24/Number(e??u):n??c;return(0,xh.createElement)(\"svg\",{ref:l,...Yb,width:e??u??Yb.width,height:e??u??Yb.height,stroke:t??f,strokeWidth:h,className:Jb(\"lucide\",p,o),...!s&&!SO(i)&&{\"aria-hidden\":\"true\"},...i},[...a.map(([g,m])=>(0,xh.createElement)(g,m)),...Array.isArray(s)?s:[s]])});var ae=(t,e)=>{let n=(0,Zb.forwardRef)(({className:r,...o},s)=>(0,Zb.createElement)(CO,{ref:s,iconNode:e,className:Jb(`lucide-${xO(ZC(t))}`,`lucide-${t}`,r),...o}));return n.displayName=ZC(t),n};var bV=[[\"path\",{d:\"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8\",key:\"mg9rjx\"}]],wh=ae(\"bold\",bV);var vV=[[\"path\",{d:\"M8 2v3\",key:\"1ioesn\"}],[\"path\",{d:\"M16 2v3\",key:\"otl347\"}],[\"rect\",{x:\"3\",y:\"3\",width:\"18\",height:\"18\",rx:\"2\",key:\"h1oib\"}],[\"path\",{d:\"M3 9h18\",key:\"1pudct\"}],[\"path\",{d:\"M8 13h.01\",key:\"1sbv64\"}],[\"path\",{d:\"M12 13h.01\",key:\"y0uutt\"}],[\"path\",{d:\"M16 13h.01\",key:\"wip0gl\"}],[\"path\",{d:\"M8 17h.01\",key:\"p3bg7i\"}],[\"path\",{d:\"M12 17h.01\",key:\"p32p05\"}],[\"path\",{d:\"M16 17h.01\",key:\"ql8jdd\"}]],Sh=ae(\"calendar-days\",vV);var xV=[[\"path\",{d:\"m6 9 6 6 6-6\",key:\"qrunsl\"}]],kh=ae(\"chevron-down\",xV);var wV=[[\"path\",{d:\"m15 18-6-6 6-6\",key:\"1wnfg3\"}]],Ch=ae(\"chevron-left\",wV);var SV=[[\"path\",{d:\"m9 18 6-6-6-6\",key:\"mthhwq\"}]],Lh=ae(\"chevron-right\",SV);var kV=[[\"path\",{d:\"M15 3h6v6\",key:\"1q9fwt\"}],[\"path\",{d:\"M10 14 21 3\",key:\"gplh6r\"}],[\"path\",{d:\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\",key:\"a6xqqp\"}]],Ah=ae(\"external-link\",kV);var CV=[[\"path\",{d:\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",key:\"1nclc0\"}],[\"circle\",{cx:\"12\",cy:\"12\",r:\"3\",key:\"1v7zrd\"}]],Xl=ae(\"eye\",CV);var LV=[[\"path\",{d:\"M10.114 4.462A14.5 14.5 0 0 1 12 2a10 10 0 0 1 9.313 13.643\",key:\"1jq2r7\"}],[\"path\",{d:\"M15.557 15.556A14.5 14.5 0 0 1 12 22 10 10 0 0 1 4.929 4.929\",key:\"1ohfya\"}],[\"path\",{d:\"M15.892 10.234A14.5 14.5 0 0 0 12 2a10 10 0 0 0-3.643.687\",key:\"1fyh9w\"}],[\"path\",{d:\"M17.656 12H22\",key:\"1ttse4\"}],[\"path\",{d:\"M19.071 19.071A10 10 0 0 1 12 22 14.5 14.5 0 0 1 8.44 8.45\",key:\"rmtjzo\"}],[\"path\",{d:\"M2 12h10\",key:\"19562f\"}],[\"path\",{d:\"m2 2 20 20\",key:\"1ooewy\"}]],Eh=ae(\"globe-off\",LV);var AV=[[\"circle\",{cx:\"12\",cy:\"12\",r:\"10\",key:\"1mglay\"}],[\"path\",{d:\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\",key:\"13o1zl\"}],[\"path\",{d:\"M2 12h20\",key:\"9i4pu4\"}]],Th=ae(\"globe\",AV);var EV=[[\"circle\",{cx:\"9\",cy:\"12\",r:\"1\",key:\"1vctgf\"}],[\"circle\",{cx:\"9\",cy:\"5\",r:\"1\",key:\"hp0tcf\"}],[\"circle\",{cx:\"9\",cy:\"19\",r:\"1\",key:\"fkjjf6\"}],[\"circle\",{cx:\"15\",cy:\"12\",r:\"1\",key:\"1tmaij\"}],[\"circle\",{cx:\"15\",cy:\"5\",r:\"1\",key:\"19l28e\"}],[\"circle\",{cx:\"15\",cy:\"19\",r:\"1\",key:\"f4zoj3\"}]],Rh=ae(\"grip-vertical\",EV);var TV=[[\"path\",{d:\"M4 12h8\",key:\"17cfdx\"}],[\"path\",{d:\"M4 18V6\",key:\"1rz3zl\"}],[\"path\",{d:\"M12 18V6\",key:\"zqpxq5\"}],[\"path\",{d:\"m17 12 3-2v8\",key:\"1hhhft\"}]],Ih=ae(\"heading-1\",TV);var RV=[[\"path\",{d:\"M4 12h8\",key:\"17cfdx\"}],[\"path\",{d:\"M4 18V6\",key:\"1rz3zl\"}],[\"path\",{d:\"M12 18V6\",key:\"zqpxq5\"}],[\"path\",{d:\"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1\",key:\"9jr5yi\"}]],Mh=ae(\"heading-2\",RV);var IV=[[\"path\",{d:\"M4 12h8\",key:\"17cfdx\"}],[\"path\",{d:\"M4 18V6\",key:\"1rz3zl\"}],[\"path\",{d:\"M12 18V6\",key:\"zqpxq5\"}],[\"path\",{d:\"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2\",key:\"68ncm8\"}],[\"path\",{d:\"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2\",key:\"1ejuhz\"}]],_h=ae(\"heading-3\",IV);var MV=[[\"path\",{d:\"M12 18V6\",key:\"zqpxq5\"}],[\"path\",{d:\"M17 10v3a1 1 0 0 0 1 1h3\",key:\"tj5zdr\"}],[\"path\",{d:\"M21 10v8\",key:\"1kdml4\"}],[\"path\",{d:\"M4 12h8\",key:\"17cfdx\"}],[\"path\",{d:\"M4 18V6\",key:\"1rz3zl\"}]],Oh=ae(\"heading-4\",MV);var _V=[[\"path\",{d:\"M4 12h8\",key:\"17cfdx\"}],[\"path\",{d:\"M4 18V6\",key:\"1rz3zl\"}],[\"path\",{d:\"M12 18V6\",key:\"zqpxq5\"}],[\"path\",{d:\"M17 13v-3h4\",key:\"1nvgqp\"}],[\"path\",{d:\"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17\",key:\"2nebdn\"}]],Dh=ae(\"heading-5\",_V);var OV=[[\"path\",{d:\"M4 12h8\",key:\"17cfdx\"}],[\"path\",{d:\"M4 18V6\",key:\"1rz3zl\"}],[\"path\",{d:\"M12 18V6\",key:\"zqpxq5\"}],[\"circle\",{cx:\"19\",cy:\"16\",r:\"2\",key:\"15mx69\"}],[\"path\",{d:\"M20 10c-2 2-3 3.5-3 6\",key:\"f35dl0\"}]],Nh=ae(\"heading-6\",OV);var DV=[[\"rect\",{width:\"18\",height:\"18\",x:\"3\",y:\"3\",rx:\"2\",ry:\"2\",key:\"1m3agn\"}],[\"circle\",{cx:\"9\",cy:\"9\",r:\"2\",key:\"af1f0g\"}],[\"path\",{d:\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\",key:\"1xmnt7\"}]],Ph=ae(\"image\",DV);var NV=[[\"line\",{x1:\"19\",x2:\"10\",y1:\"4\",y2:\"4\",key:\"15jd3p\"}],[\"line\",{x1:\"14\",x2:\"5\",y1:\"20\",y2:\"20\",key:\"bu0au3\"}],[\"line\",{x1:\"15\",x2:\"9\",y1:\"4\",y2:\"20\",key:\"uljnxc\"}]],Bh=ae(\"italic\",NV);var PV=[[\"rect\",{width:\"8\",height:\"18\",x:\"3\",y:\"3\",rx:\"1\",key:\"oynpb5\"}],[\"path\",{d:\"M7 3v18\",key:\"bbkbws\"}],[\"path\",{d:\"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z\",key:\"1qboyk\"}]],zh=ae(\"library-big\",PV);var BV=[[\"path\",{d:\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\",key:\"1cjeqo\"}],[\"path\",{d:\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\",key:\"19qd67\"}]],Fh=ae(\"link\",BV);var zV=[[\"path\",{d:\"M11 5h10\",key:\"1cz7ny\"}],[\"path\",{d:\"M11 12h10\",key:\"1438ji\"}],[\"path\",{d:\"M11 19h10\",key:\"11t30w\"}],[\"path\",{d:\"M4 4h1v5\",key:\"10yrso\"}],[\"path\",{d:\"M4 9h2\",key:\"r1h2o0\"}],[\"path\",{d:\"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02\",key:\"xtkcd5\"}]],Hh=ae(\"list-ordered\",zV);var FV=[[\"path\",{d:\"M3 5h.01\",key:\"18ugdj\"}],[\"path\",{d:\"M3 12h.01\",key:\"nlz23k\"}],[\"path\",{d:\"M3 19h.01\",key:\"noohij\"}],[\"path\",{d:\"M8 5h13\",key:\"1pao27\"}],[\"path\",{d:\"M8 12h13\",key:\"1za7za\"}],[\"path\",{d:\"M8 19h13\",key:\"m83p4d\"}]],$h=ae(\"list\",FV);var HV=[[\"rect\",{width:\"18\",height:\"11\",x:\"3\",y:\"11\",rx:\"2\",ry:\"2\",key:\"1w4ew1\"}],[\"path\",{d:\"M7 11V7a5 5 0 0 1 10 0v4\",key:\"fwvmzm\"}]],Uh=ae(\"lock\",HV);var $V=[[\"path\",{d:\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\",key:\"kfwtm\"}]],jh=ae(\"moon\",$V);var UV=[[\"rect\",{width:\"18\",height:\"18\",x:\"3\",y:\"3\",rx:\"2\",key:\"afitv7\"}],[\"path\",{d:\"M3 9h18\",key:\"1pudct\"}]],qh=ae(\"panel-top\",UV);var jV=[[\"path\",{d:\"M5 12h14\",key:\"1ays0h\"}],[\"path\",{d:\"M12 5v14\",key:\"s699le\"}]],Vh=ae(\"plus\",jV);var qV=[[\"path\",{d:\"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\",key:\"rib7q0\"}],[\"path\",{d:\"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\",key:\"1ymkrd\"}]],Kh=ae(\"quote\",qV);var VV=[[\"path\",{d:\"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\",key:\"1i5ecw\"}],[\"circle\",{cx:\"12\",cy:\"12\",r:\"3\",key:\"1v7zrd\"}]],Gh=ae(\"settings\",VV);var KV=[[\"circle\",{cx:\"12\",cy:\"12\",r:\"4\",key:\"4exip2\"}],[\"path\",{d:\"M12 2v2\",key:\"tus03m\"}],[\"path\",{d:\"M12 20v2\",key:\"1lh1kg\"}],[\"path\",{d:\"m4.93 4.93 1.41 1.41\",key:\"149t6j\"}],[\"path\",{d:\"m17.66 17.66 1.41 1.41\",key:\"ptbguv\"}],[\"path\",{d:\"M2 12h2\",key:\"1t8f8n\"}],[\"path\",{d:\"M20 12h2\",key:\"1q8mjw\"}],[\"path\",{d:\"m6.34 17.66-1.41 1.41\",key:\"1m8zz5\"}],[\"path\",{d:\"m19.07 4.93-1.41 1.41\",key:\"1shlcs\"}]],Wh=ae(\"sun\",KV);var Xh=\"smoodly-inspector-w\";var QC=(t,e=0)=>Math.max(260,Math.floor(t-e-440)),eL=(t,e,n=0)=>Math.min(QC(e,n),Math.max(260,Math.round(t)));var LO=\"#FFFFFF\",tL=\"#1B1E30\",GV=`\n --accent:#1C6E5B; --accent-hover:#175C4C; --accent-soft:#DDEBE4; --accent-line:#9CC9B8; --on-accent:#FFFFFF;\n --green-700:#1F7A46; --green-50:#E3F3EA; --green-300:#6FD39A; --green-500:#2E9E5B;\n --amber-700:#8A5A00; --amber-50:#FBF1DC; --amber-300:#E8B85A;\n --red-700:#C4372E; --red-50:#FBE9E7; --red-300:#F5A5A0;\n\n /* The shell: navy frame, white sheet, grey tiles on the sheet, white fields on the tiles. */\n --frame:#151727; --sheet:${LO};\n --bg:var(--sheet); --canvas:#ECEDF1; --surface:#F6F6F6; --surface-form:#F6F6F6; --surface-inset:#FFFFFF;\n --menu-bg:#FFFFFF;\n --input-bg:#FFFFFF; --input-hover-bg:#FFFFFF; --input-focus-bg:#FFFFFF; --input-border:transparent;\n --line:#E4E5EA; --line-dashed:#CFD1D9; --line-soft:#ECEDF1;\n --text:#151727; --text-secondary:#454A5C; --text-muted:#6B6F80; --text-subtle:#9A9EAB; --text-disabled:#C5C8D2;\n --selection:var(--accent); --nav-active-bg:var(--accent-soft); --nav-active-fg:var(--accent);\n --selection-global:#C4620C;\n --hover:rgba(21,23,39,.05); --press:rgba(21,23,39,.09); --control-hover:#ECEDF1; --canvas-ground:#EDEDED;\n --btn-secondary-bg:var(--surface); --btn-secondary-hover:#ECEDF1;\n /* The rail sits on the frame: its own greys, the active tile a white tint. */\n --rail-fg:#B9BDCE; --rail-active-fg:#FFFFFF; --rail-active-bg:rgba(255,255,255,.14); --rail-hover-bg:rgba(255,255,255,.08);\n --bar-bg:transparent; --bar-border:0; --menu-border:0; --card-divider:0;\n --card-title-size:var(--text-md); --card-title-color:var(--text);\n /* In-card segmented (tabs, the span bar): white track, the chosen option in the tile grey. */\n --tabs-bg:var(--surface-inset); --tab-active-bg:var(--surface); --tab-active-fg:var(--text); --tab-active-shadow:none;\n --spanbar-bg:var(--surface-inset); --spanbar-col:var(--surface); --switch-bg:var(--line-dashed);\n /* On the sheet (the locale switch): grey track, the chosen option white. */\n --seg-bg:var(--surface); --seg-active-bg:var(--surface-inset);\n /* Rows keep a light rule (asked for 2026-09-25); the header has none, as the handoff. */\n --table-rule:1px solid transparent; --row-rule:1px solid var(--line);\n --outline-row-bg:var(--surface-inset); --outline-row-border:1px solid transparent;\n --toolbar-bg:#151727; --toolbar-fg:#FFFFFF;\n /* The \"+\" rides the canvas page, which stays light in both themes \\u2014 so\n literals, opaque, not the theme's accent-soft (a translucent tint in\n dark mode that washed out over the white page, 2026-09-10). */\n --plus-bg:#DDEBE4; --plus-hover:#D0E3D9; --plus-fg:#1C6E5B;\n --plus-icon-bg:#1C6E5B; --plus-icon-fg:#FFFFFF; --plus-shadow:none;\n --logo-color:var(--accent); --logo-outer:#FFFFFF; --logo-inner:var(--frame);\n\n --status-published-fg:var(--green-700); --status-published-bg:var(--green-50);\n --status-changes-fg:var(--amber-700); --status-changes-bg:var(--amber-50);\n --status-draft-fg:var(--text-muted); --status-draft-bg:var(--control-hover);\n --status-scheduled-fg:var(--accent); --status-scheduled-bg:var(--accent-soft);\n --status-saved-dot:var(--green-500);\n --warn:var(--amber-700); --warn-soft:var(--amber-50);\n --danger:var(--red-700); --danger-soft:var(--red-50);\n\n /* The edited page inside the canvas stays light in both themes. */\n --page-bg:#FFFFFF; --page-text:#151727;\n --shadow-page:0 1px 2px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.1);\n --shadow-float:0 2px 8px rgba(0,0,0,.2);\n --shadow-seg:0 1px 2px rgba(21,23,39,.08);\n --focus-ring:0 0 0 .5px var(--accent);\n --shadow-pop:0 4px 20px rgba(21,23,39,.14);\n --scrim:rgba(21,23,39,.4); --shadow-modal:0 24px 64px rgba(21,23,39,.28);\n --logo-filter:none;\n\n /* Which half of the theme toggle is visible. A token, so the icon can never\n disagree with the colors \\u2014 both follow the one cascade below. */\n --when-light:inline-flex; --when-dark:none;\n`,WV=`\n --accent:#6CC4A6; --accent-hover:#82D2B8; --accent-soft:rgba(108,196,166,.18); --accent-line:#6CC4A6; --on-accent:#151727;\n --selection-global:#F09A5C;\n --frame:#0F1120; --sheet:${tL};\n --canvas:#131526; --surface:#242840; --surface-form:#242840; --surface-inset:#1B1E30;\n --menu-bg:#242840;\n --input-bg:#1B1E30; --input-hover-bg:#1B1E30; --input-focus-bg:#1B1E30;\n --line:#33384F; --line-dashed:#444A63; --line-soft:#33384F;\n --text:#EEF0F5; --text-secondary:#C5C8D2; --text-muted:#9A9FB3; --text-subtle:#7C819A; --text-disabled:#4F5570;\n --hover:rgba(238,240,245,.05); --press:rgba(238,240,245,.09); --control-hover:#2C3049; --canvas-ground:var(--control-hover);\n --btn-secondary-bg:var(--surface); --btn-secondary-hover:#2C3049;\n --switch-bg:var(--line-dashed);\n --toolbar-bg:#0F1120; --toolbar-fg:#EEF0F5;\n --logo-inner:#151727;\n\n --status-published-fg:var(--green-300); --status-published-bg:rgba(111,211,154,.14);\n --status-changes-fg:var(--amber-300); --status-changes-bg:rgba(232,184,90,.14);\n --status-draft-fg:var(--text-muted); --status-draft-bg:var(--press);\n --warn:var(--amber-300); --warn-soft:rgba(232,184,90,.14);\n --danger:var(--red-300); --danger-soft:rgba(244,102,92,.14);\n\n --shadow-page:0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);\n --shadow-pop:0 4px 20px rgba(0,0,0,.5);\n --scrim:rgba(0,0,0,.55); --shadow-modal:0 24px 64px rgba(0,0,0,.5);\n --when-light:none; --when-dark:inline-flex;\n`,XV=`\n --font-sans:'Public Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;\n --font-serif:var(--font-sans);\n --font-mono:ui-monospace,Menlo,Consolas,monospace;\n --text-2xs:10px; --text-xs:11px; --text-sm:12px; --text-md:14px;\n --text-lg:15px; --text-xl:16px; --text-2xl:20px; --text-3xl:22px; --text-4xl:30px;\n --tracking-tight:-0.02em; --tracking-label:0.1em; --tracking-tag:0.08em;\n --caps-transform:none; --caps-tracking:0;\n --label-size:12px; --label-weight:500; --label-transform:none; --label-tracking:0;\n --meta-font:var(--font-sans); --meta-size:13px;\n --title-font:var(--font-sans); --title-size:18px; --title-weight:600; --title-tracking:-0.01em;\n --doc-title-size:30px;\n --blocktag-font:var(--font-sans); --blocktag-size:11px; --blocktag-transform:none; --blocktag-tracking:0;\n --blocktag-radius:4px; --blocktag-shift:translate(16px,-50%); --blocktag-shift-inside:translate(16px,8px);\n --badge-h:24px; --badge-dot:inline-block;\n\n --radius-xs:2px; --radius-sm:6px; --radius-md:8px; --radius-lg:10px;\n --radius-card:16px; --radius-card-lg:16px; --radius-modal:20px; --radius-btn:999px; --radius-round:999px;\n --page-radius:8px 8px 0 0; --selection-radius:2px; /* the canvas hover/selection ring: 2px (asked for 2026-09-26; 8px before) */\n --outline-row-radius:6px; --tabs-radius:10px; --tab-radius:6px; --row-radius:2px; --tag-radius:999px; /* list row hover fill: 2px (same day; 10px before) */\n --plus-radius:8px; --toolbar-radius:8px;\n --rtcard-bg:var(--surface); --rtcard-border:var(--line);\n --control-h:40px; --control-h-sm:34px; --control-h-lg:48px; --button-h:36px; --button-h-sm:28px; --row-h:48px; --topbar-h:64px;\n --outline-row-h:36px; --seg-pad-y:7px; --tabs-pad:3px;\n --plus-h:32px; --plus-pad:0 14px 0 6px; --plus-label:inline;\n --nav-w:72px; --inspector-w:360px; --gutter:20px;\n /* The frame is 6px above, right of and below the sheet; the rail fills the left edge. */\n --frame-pad:6px; --frame-pad-top:6px; --shell-gap:0px; --sheet-radius:20px; --sheet-pad:0 24px 24px;\n --rail-pad:18px 6px 16px; --rail-logo:block; --rail-logo-opacity:.8; --rail-tile-w:44px; --rail-tile-h:40px; --rail-tile-radius:12px;\n --topbar-pad:0; --back-size:32px; --back-bg:var(--surface);\n --table-pad:8px 12px; --table-top:80px; --canvas-pad:28px 40px 0; --card-pad:16px 18px; --card-gap:12px; --form-pad:32px 40px;\n --border:1px solid var(--line);\n --outline-selection:2px solid var(--selection);\n --outline-selection-global:2px solid var(--selection-global);\n`;function JV(t,e,n,r){return`\n${t}{${e}${n}}\nhtml[data-theme=\"dark\"] ${t},${t}[data-theme=\"dark\"]{${r}}\n@media (prefers-color-scheme:dark){\n html:not([data-theme=\"light\"]) ${t}:not([data-theme=\"light\"]){${r}}\n}\n${t}[data-theme=\"light\"]{${n}}`}var ev=`\n${JV(\".sm-admin\",XV,GV,WV)}\n\n/* The admin owns the viewport; a host <body> margin would push it into a\n page scrollbar. Scoped by :has, so only a page holding the admin is touched. */\nbody:has(.sm-admin){margin:0}\n.sm-admin,.sm-admin *,.sm-admin *::before,.sm-admin *::after{box-sizing:border-box}\n.sm-admin{\n font-family:var(--font-sans);font-size:var(--text-md);line-height:1.4;\n color:var(--text);background:var(--bg);\n -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;\n}\n.sm-admin h1,.sm-admin h2,.sm-admin h3,.sm-admin p,.sm-admin ul{margin:0}\n/* :where() keeps this at zero specificity \\u2014 a bare <a> is accent, but any\n component class on it (.sm-nav-item, .sm-btn, .sm-back) decides its own\n colour. Without this the element selector silently beat every one of them. */\n:where(.sm-admin a){color:var(--accent);text-decoration:none}\n:where(.sm-admin a:hover){color:var(--accent-hover)}\n.sm-admin button,.sm-admin input,.sm-admin select,.sm-admin textarea{font-family:inherit}\n.sm-admin ::placeholder{color:var(--text-subtle)}\n.sm-admin ::selection{background:var(--accent-soft);color:var(--text)}\n.sm-mono{font-family:var(--font-mono)}\n.sm-code{background:var(--surface);border-radius:8px;padding:10px 12px;margin:0;font:13px/1.5 var(--font-mono);overflow:auto}\n\n/* \\u2500\\u2500 shell \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n/* Rail | main. The shell is the frame (design_handoff_smoodly_neutral/\n components/AppShell.html): navy, 6px above, right of and below the main\n column, which is the white sheet with a 20px radius and its own inner\n padding; the rail fills the frame's left edge.\n The main column stacks the top bar over one tile-shaped region: list,\n form or editor. */\n.sm-shell{\n display:grid;grid-template-columns:var(--nav-w) 1fr;column-gap:var(--shell-gap);\n padding:var(--frame-pad-top) var(--frame-pad) var(--frame-pad) 0;height:100vh;height:100dvh;overflow:hidden;background:var(--frame);\n}\n.sm-shell>.sm-main{\n min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;\n background:var(--sheet);border-radius:var(--sheet-radius);padding:var(--sheet-pad);\n}\n.sm-wordmark{height:18px;width:auto;color:var(--logo-color);filter:var(--logo-filter);flex:none}\n/* The IconRail (design_handoff_smoodly_neutral/components/IconRail.html):\n a 72px rail on the frame with the app icon on top, 18px Lucide icons\n over a 10px label and a 44\\xD740 active tile in a white tint \\u2014 the rail's\n own colour tokens, since the frame is navy in both themes. */\n.sm-rail{\n width:var(--nav-w);height:100%;display:flex;flex-direction:column;align-items:center;gap:18px;\n padding:var(--rail-pad);background:var(--bar-bg);border-right:var(--bar-border);color:var(--rail-fg);\n font:500 10px/1 var(--font-sans);position:relative;\n}\n/* The logo: white outer / navy inner on the frame, at a little under full\n opacity so it does not glare (2026-09-25). */\n.sm-rail__logo{width:20px;height:auto;display:var(--rail-logo);flex:none;margin-bottom:6px;opacity:var(--rail-logo-opacity)} /* 20px wide (asked for 2026-09-26; 28px before) */\n.sm-rail__list{display:flex;flex-direction:column;gap:8px;width:100%;margin:0;padding:0;list-style:none}\n.sm-rail__item{position:relative}\n.sm-rail__btn{\n appearance:none;background:none;border:0;margin:0;padding:2px 0;width:100%;display:flex;flex-direction:column;\n align-items:center;gap:6px;color:inherit;font:inherit;cursor:pointer;border-radius:var(--radius-md);text-decoration:none;\n}\n.sm-rail__btn:hover{color:inherit}\n.sm-rail__btn:focus-visible{outline:2px solid var(--rail-active-fg);outline-offset:-2px;box-shadow:none}\n.sm-rail__tile{position:relative;width:var(--rail-tile-w);height:var(--rail-tile-h);border-radius:var(--rail-tile-radius);display:grid;place-items:center;transition:background .12s}\n.sm-rail__btn:hover .sm-rail__tile{background:var(--rail-hover-bg)}\n.sm-rail__btn[aria-current=\"page\"],.sm-rail__btn[aria-expanded=\"true\"]{color:var(--rail-active-fg);font-weight:600}\n.sm-rail__btn[aria-current=\"page\"]:hover,.sm-rail__btn[aria-expanded=\"true\"]:hover{color:var(--rail-active-fg)}\n.sm-rail__btn[aria-current=\"page\"] .sm-rail__tile,.sm-rail__btn[aria-expanded=\"true\"] .sm-rail__tile{background:var(--rail-active-bg)}\n.sm-rail__tile svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}\n.sm-rail__label{letter-spacing:.01em;white-space:nowrap}\n/* Not greyed: the reference renders every inactive item at --text and marks\n the unavailable ones only by being inert (no pointer, no hover). */\n.sm-rail__btn[aria-disabled=\"true\"]{cursor:default}\n.sm-rail__btn[aria-disabled=\"true\"]:hover .sm-rail__tile{background:transparent}\n.sm-rail__foot{margin-top:auto;display:flex;flex-direction:column;align-items:center}\n.sm-rail__user{\n width:28px;height:28px;border-radius:var(--radius-round);background:var(--accent-soft);color:var(--accent);\n display:grid;place-items:center;font-size:var(--text-xs);font-weight:600;border:0;cursor:pointer;padding:0;\n}\n.sm-rail__user:focus-visible{outline:2px solid var(--rail-active-fg);outline-offset:1px;box-shadow:none}\n/* Flyout: 6px right of the rail, aligned with its item (the user menu aligns to the bottom).\n Menus float on --menu-bg (the sheet white in the neutral look, so they read over the frame). */\n.sm-rail__menu{\n position:absolute;left:calc(100% + 6px);top:0;z-index:20;width:168px;padding:6px;margin:0;list-style:none;\n background:var(--menu-bg);border:var(--menu-border);border-radius:var(--radius-md);box-shadow:var(--shadow-pop);\n display:none;flex-direction:column;gap:1px;font-size:var(--text-md);font-weight:500;color:var(--text);\n}\n.sm-rail__menu[data-open=\"true\"]{display:flex}\n.sm-rail__menu--up{top:auto;bottom:0}\n/* The Collections flyout opens on hover, so it is roomier (the names at --text-lg) and an invisible\n bridge spans the 6px gap so the pointer can cross from the rail without closing it. */\n.sm-rail__menu--collections{width:208px;padding:8px;gap:2px;font-size:var(--text-lg)}\n.sm-rail__menu--collections::before{content:\"\";position:absolute;left:-8px;top:0;bottom:0;width:8px}\n.sm-rail__menu--collections .sm-rail__menu-item{padding:9px 12px}\n.sm-rail__menu-title{font-size:9px;font-weight:600;letter-spacing:var(--tracking-label);text-transform:uppercase;color:var(--text-muted);padding:6px 8px 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.sm-rail__menu-item{\n appearance:none;background:none;border:0;width:100%;display:flex;align-items:center;justify-content:space-between;\n padding:7px 10px;border-radius:var(--radius-sm);color:inherit;font:inherit;cursor:pointer;text-align:left;text-decoration:none;\n}\n.sm-rail__menu-item:hover,.sm-rail__menu-item:focus-visible{background:var(--hover);color:inherit;outline:0;box-shadow:none}\n.sm-rail__menu-item[aria-current=\"page\"],.sm-rail__menu-item[aria-current=\"page\"]:hover{background:var(--nav-active-bg);color:var(--nav-active-fg);font-weight:600}\n.sm-when-light{display:var(--when-light);align-items:center;gap:8px}\n.sm-when-dark{display:var(--when-dark);align-items:center;gap:8px}\n/* .sm-nav-item survives as the inspector's link style (EditorView). */\n.sm-nav-item{\n display:block;padding:8px 12px;border-radius:var(--radius-sm);line-height:1.3;\n color:var(--text);font-weight:500;text-decoration:none;cursor:pointer;\n background:transparent;border:0;width:100%;text-align:left;font-size:var(--text-md);\n overflow:hidden;text-overflow:ellipsis;white-space:nowrap;\n}\n.sm-nav-item:hover{background:var(--surface-inset);color:var(--text)}\n\n/* \\u2500\\u2500 top bar \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n.sm-topbar{\n height:var(--topbar-h);flex:none;display:flex;align-items:center;justify-content:space-between;\n gap:16px;padding:var(--topbar-pad);border-bottom:var(--bar-border);background:var(--bar-bg);\n}\n.sm-topbar__left{display:flex;align-items:center;gap:10px;min-width:0}\n.sm-topbar__right{display:flex;align-items:center;gap:10px;flex:none}\n.sm-crumbs{display:flex;align-items:center;gap:10px;color:var(--text-muted);min-width:0}\n.sm-crumbs__sep{opacity:.5}\n.sm-crumbs__here{color:var(--text);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.sm-back{\n width:var(--back-size);height:var(--back-size);flex:none;display:grid;place-items:center;\n border:0;border-radius:var(--radius-round);background:var(--back-bg);padding:0;\n color:var(--text);font:inherit;cursor:pointer;line-height:1;\n}\n.sm-back:hover{color:var(--accent)}\n/* The view title (Pages, Articles\\u2026): Public Sans 18px (2026-09-09; the\n serif stays for the document title and richtext headings). Inside a\n card head or a modal it is a smaller sans heading. */\n.sm-title{font:var(--title-weight) var(--title-size)/1.2 var(--title-font);letter-spacing:var(--title-tracking)}\n.sm-inspector__head .sm-title,.sm-modal__head .sm-title{font:600 var(--text-lg)/1.3 var(--font-sans);letter-spacing:0}\n.sm-count{color:var(--text-muted);font-size:var(--text-md)}\n\n/* \\u2500\\u2500 buttons \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n.sm-btn{\n display:inline-flex;align-items:center;justify-content:center;gap:6px;\n height:var(--button-h);padding:0 16px;border-radius:var(--radius-btn);border:0;\n font-size:var(--text-md);font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;\n text-decoration:none;\n}\n.sm-btn--lg{height:var(--control-h-lg);padding:0 20px}\n/* An icon-only pill: the top bar's View live eye (2026-09-26). */\n.sm-btn--icon{width:var(--button-h);padding:0;border-radius:50%;color:var(--text-muted)}\n.sm-btn--sm,.sm-btn--sm.sm-btn--primary,.sm-btn--sm.sm-btn--ok{height:var(--button-h-sm);padding:0 12px;font-size:var(--text-sm)}\n.sm-btn--primary{background:var(--accent);color:var(--on-accent);font-weight:600;padding:0 18px}\n.sm-btn--primary:hover{background:var(--accent-hover);color:var(--on-accent)}\n.sm-btn--secondary{background:var(--btn-secondary-bg);color:var(--text)}\n.sm-btn--secondary:hover{background:var(--btn-secondary-hover);color:var(--text)}\n.sm-btn--ghost{background:transparent;color:var(--accent);font-weight:600;padding:0 10px}\n.sm-btn--ghost:hover{background:var(--accent-soft);color:var(--accent)}\n.sm-btn--danger{background:var(--btn-secondary-bg);color:var(--danger)}\n.sm-btn--danger:hover{background:var(--danger-soft);color:var(--danger)}\n/* The confirm dialog's destructive primary: filled red (ConfirmModal.html). */\n.sm-btn--destructive{background:var(--danger);color:#fff;font-weight:600;padding:0 18px}\n.sm-btn--destructive:hover{filter:brightness(.94);color:#fff}\n.sm-btn--ok{background:var(--status-published-bg);color:var(--status-published-fg);font-weight:600;padding:0 18px}\n.sm-btn:disabled,.sm-btn[aria-disabled=\"true\"]{opacity:.5;cursor:default;pointer-events:none}\n.sm-btn:focus-visible,.sm-iconbtn:focus-visible,.sm-nav-item:focus-visible,\n.sm-tab:focus-visible,.sm-seg__opt:focus-visible,.sm-pill:focus-visible,.sm-row:focus-visible{\n outline:2px solid var(--accent);outline-offset:1px\n}\n\n.sm-iconbtn{\n width:24px;height:24px;flex:none;display:grid;place-items:center;padding:0;\n border:0;border-radius:var(--radius-sm);background:transparent;color:var(--text-muted);\n font-size:12px;line-height:1;cursor:pointer;\n}\n.sm-iconbtn:hover{background:var(--hover);color:var(--text)}\n.sm-iconbtn--inverse{color:var(--toolbar-fg)}\n.sm-iconbtn--inverse:hover{background:rgba(255,255,255,.14);color:#fff}\n.sm-iconbtn:disabled{opacity:.3;cursor:default}\n.sm-iconbtn:disabled:hover{background:transparent}\n\n/* \\u2500\\u2500 fields \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n.sm-field{display:flex;flex-direction:column;gap:8px;min-width:0}\n.sm-field__head{display:flex;align-items:baseline;justify-content:space-between;gap:8px}\n.sm-label{\n display:inline-flex;align-items:center;gap:5px;\n font-size:var(--label-size);font-weight:var(--label-weight);letter-spacing:var(--label-tracking);\n text-transform:var(--label-transform);color:var(--text-muted);\n}\n/* The \"same in every language\" mark beside a field name that is not\n .localized() (a Lucide globe-off), instead of grouping fields by locale. */\n.sm-label__mark{display:inline-flex;color:var(--text-subtle);cursor:help}\n.sm-label__mark svg{width:13px;height:13px}\n.sm-counter{font-size:var(--text-sm);color:var(--text-subtle)}\n.sm-field__aside{display:flex;align-items:baseline;gap:10px;flex:none}\n/* A head's text action (a list's Collapse all / Expand all): a small accent link. */\n.sm-field__action{background:none;border:0;padding:0;font:inherit;font-size:var(--text-sm);font-weight:600;color:var(--accent);cursor:pointer}\n.sm-field__action:hover{color:var(--accent-hover)}\n/* A row of them: a media field's Edit / Replace / Remove in the head, and\n the same three on a richtext image card's head (2026-09-25). */\n.sm-field__actions{display:flex;align-items:baseline;gap:12px;flex:none}\n.sm-rtcard__head .sm-field__actions{margin-left:auto;padding-right:4px}\n.sm-hint{font-size:var(--text-sm);color:var(--text-muted)}\n.sm-input,.sm-textarea,.sm-select{\n width:100%;min-width:0;border:1px solid var(--input-border);border-radius:var(--radius-md);\n background:var(--input-bg);color:var(--text);font-size:var(--text-md);\n outline:0;box-shadow:none;\n}\n.sm-input,.sm-select{height:var(--control-h);padding:0 14px}\n.sm-textarea{padding:11px 14px;line-height:1.55;resize:vertical;min-height:72px}\n/* The document title at the doc-title size. */\n.sm-input--lg{\n height:var(--control-h-lg);font:600 var(--doc-title-size)/1.2 var(--font-serif);letter-spacing:var(--title-tracking);\n}\n/* Scoped, so it outranks the .sm-admin input {font-family:inherit} reset above. */\n.sm-admin .sm-input--mono{font-family:var(--font-mono);font-size:var(--text-sm)}\n.sm-input:hover,.sm-textarea:hover,.sm-select:hover{background:var(--input-hover-bg)}\n.sm-input:focus,.sm-textarea:focus,.sm-select:focus,\n.sm-inputwrap:focus-within{\n background:var(--input-focus-bg);border-color:var(--selection);box-shadow:var(--focus-ring);\n}\n.sm-input:disabled,.sm-textarea:disabled,.sm-select:disabled{opacity:.6;cursor:default}\n.sm-select{\n appearance:none;-webkit-appearance:none;cursor:pointer;padding-right:30px;font-weight:500;\n background-image:linear-gradient(45deg,transparent 50%,var(--text-muted) 50%),\n linear-gradient(135deg,var(--text-muted) 50%,transparent 50%);\n background-position:calc(100% - 16px) calc(50% - 1px),calc(100% - 12px) calc(50% - 1px);\n background-size:4px 4px,4px 4px;background-repeat:no-repeat;\n}\n.sm-inputwrap{\n display:flex;align-items:center;gap:0;height:var(--control-h);padding:0 14px;\n border:1px solid var(--input-border);border-radius:var(--radius-md);background:var(--input-bg);\n}\n/* The inner input keeps a 22px line box: with the 12px mono font alone its\n caret was a 14px sliver flush against the prefix, a blinking glyph (2026-09-25). */\n.sm-inputwrap>.sm-input{height:auto;line-height:22px;padding:0;background:transparent;border:0;box-shadow:none}\n.sm-inputwrap>.sm-input:hover,.sm-inputwrap>.sm-input:focus{background:transparent;box-shadow:none}\n.sm-prefix{color:var(--text-muted);font-family:var(--font-mono);font-size:var(--text-sm);flex:none}\n.sm-error{color:var(--danger);font-size:var(--text-sm)}\n/* \\u2500\\u2500 richtext \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n.sm-richtext{display:flex;flex-direction:column;gap:8px;min-width:0}\n.sm-richtext__bar{display:flex;flex-wrap:wrap;align-items:center;gap:2px}\n.sm-richtext__sep{width:1px;height:16px;margin:0 4px;background:var(--line)}\n.sm-richtext__bar .sm-iconbtn[aria-pressed=\"true\"]{background:var(--press);color:var(--text)}\n.sm-richtext__link{display:flex;align-items:center;gap:6px}\n/* A hairline, not the (transparent in the neutral look) input border: a\n rich text box is a canvas, and its edge must read without a hover (asked for 2026-09-25). */\n.sm-richtext__content{\n min-height:140px;padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius-md);\n background:var(--input-bg);color:var(--text);font-size:var(--text-lg);line-height:1.6;outline:0;\n}\n.sm-richtext__content:hover{background:var(--input-hover-bg)}\n/* The field's focus ring steps back while a block node is selected: the\n selected card carries the accent outline, and two green frames read as\n one confusing one (2026-09-25). */\n.sm-richtext__content:focus:not(:has(.ProseMirror-selectednode)){background:var(--input-focus-bg);border-color:var(--selection);box-shadow:var(--focus-ring)}\n/* Block spacing: the sibling rules carry the .sm-admin prefix so they\n outrank the admin-wide .sm-admin p{margin:0} reset (a bare\n .sm-richtext__content>*+* lost to it and left the paragraphs\n touching). Paragraphs get .9em, a heading 1.5em above. */\n.sm-richtext__content :where(p,h1,h2,h3,h4,h5,h6,ul,ol,blockquote){margin:0}\n.sm-admin .sm-richtext__content>*+*{margin-top:.9em}\n.sm-admin .sm-richtext__content>*+:is(h1,h2,h3,h4,h5,h6){margin-top:1.5em}\n/* Block-node cards (TipTap wraps each node view in .react-renderer) get\n room above and below; the document's first and last keep the edges. */\n.sm-richtext__content>.react-renderer{margin:18px 0}\n.sm-richtext__content>.react-renderer:first-child{margin-top:0}\n.sm-richtext__content>.react-renderer:last-child{margin-bottom:0}\n/* Headings inside content take the heading font and weight. */\n.sm-richtext__content h1,.sm-richtext__content h2,.sm-richtext__content h3,\n.sm-richtext__content h4,.sm-richtext__content h5,.sm-richtext__content h6{\n font-family:var(--font-serif);font-weight:600;line-height:1.3;letter-spacing:var(--title-tracking);\n}\n.sm-richtext__content h1{font-size:var(--text-3xl)}\n.sm-richtext__content h2{font-size:var(--text-2xl)}\n.sm-richtext__content h3{font-size:var(--text-xl)}\n.sm-richtext__content h4,.sm-richtext__content h5,.sm-richtext__content h6{font-size:var(--text-lg)}\n.sm-richtext__content ul,.sm-richtext__content ol{padding-left:20px}\n.sm-richtext__content li+li{margin-top:.25em}\n.sm-richtext__body{position:relative}\n/* The \"+\" menu floats under the toolbar's right end (the \"+\" is its last\n button) instead of pushing the content down; the picker inside drops\n its own chrome. The slash menu floats under the caret the same way. */\n.sm-richtext__head{position:relative}\n.sm-richtext__menu{\n position:absolute;top:calc(100% + 6px);right:0;z-index:65;width:300px;max-width:100%;\n display:flex;flex-direction:column;gap:6px;padding:6px;\n background:var(--menu-bg);border:var(--menu-border);border-radius:var(--radius-md);box-shadow:var(--shadow-pop);\n}\n.sm-richtext__menu .sm-picker{width:100%;padding:0;border:0;box-shadow:none;background:transparent}\n.sm-richtext__slash .sm-picker{width:100%;max-width:300px}\n.sm-richtext__slash{position:absolute;left:0;z-index:65}\n.sm-richtext__insert-empty{padding:8px;color:var(--text-muted);font-size:var(--text-sm)}\n.sm-picker__item--active,.sm-picker__item[aria-selected=\"true\"]{background:var(--nav-active-bg)}\n/* block-node cards (elements, images) inside a richtext field: the tile\n tone with a hairline, so a card stands off the white field it sits in\n (2026-09-25). The\n selected card takes the accent outline below. */\n.sm-rtcard{border:1px solid var(--rtcard-border);border-radius:var(--radius-md);background:var(--rtcard-bg);min-width:0}\n.sm-richtext__content .ProseMirror-selectednode .sm-rtcard,.sm-richtext__content .sm-rtcard.ProseMirror-selectednode{outline:2px solid var(--accent);outline-offset:1px}\n.sm-rtcard__head{display:flex;align-items:center;gap:6px;height:var(--control-h-sm);padding:0 6px 0 10px;cursor:grab;user-select:none}\n.sm-rtcard__icon{width:18px;height:18px;flex:none;border-radius:var(--radius-xs);background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-size:11px}\n.sm-rtcard__title{flex:1;min-width:0;font-weight:600;font-size:var(--text-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.sm-rtcard__body{display:flex;flex-direction:column;gap:10px;padding:10px 12px 12px;border-top:1px solid var(--line)}\n/* The whole image, letterboxed on the inset tone, never cropped: the card is a preview, not a crop. */\n.sm-rtcard__thumb{display:block;width:100%;height:160px;object-fit:contain;border-radius:var(--radius-sm);background:var(--surface-inset)}\n.sm-rtcard__caption{font-size:var(--text-sm);font-style:italic;color:var(--text-muted);text-align:center}\n.sm-richtext__content blockquote{padding-left:12px;border-left:2px solid var(--line);color:var(--text-muted)}\n.sm-richtext__content a{color:var(--accent);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--accent-line)}\n\n/* Inline editing in the canvas (spec 2026-09-10). The outlines are drawn in\n the overlay from the bridge's field rects; the toolbar floats above the\n selection. */\n.sm-fieldhover{outline:1px solid color-mix(in srgb,var(--selection) 55%,transparent);outline-offset:2px;border-radius:2px;pointer-events:none}\n.sm-fieldedit{outline:1.5px solid var(--selection);outline-offset:3px;border-radius:2px;pointer-events:none}\n.sm-floatbar{\n position:absolute;z-index:60;display:flex;flex-direction:column;gap:6px;padding:4px;\n background:var(--menu-bg);border-radius:var(--radius-md);box-shadow:var(--shadow-pop);pointer-events:auto;\n}\n.sm-floatbar .sm-richtext__link{padding:0 4px 4px}\n.sm-floatbar .sm-richtext__menu{position:static;width:300px}\n/* The canvas editor root: ProseMirror's base rules (TipTap injects its\n stylesheet into the admin document, never the iframe) and nothing of the\n widget's typography \\u2014 the site's CSS styles the content. */\n.sm-inline-richtext{position:relative;outline:none;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:\"liga\" 0}\n.sm-inline-richtext:focus{outline:none}\n.sm-inline-richtext [contenteditable=\"false\"]{white-space:normal}\n.sm-inline-richtext [contenteditable=\"false\"] [contenteditable=\"true\"]{white-space:pre-wrap}\n.sm-inline-richtext .ProseMirror-selectednode .sm-rtcard,.sm-inline-richtext .sm-rtcard.ProseMirror-selectednode{outline:2px solid var(--accent);outline-offset:1px}\n/* The inspector while a richtext field is edited in the canvas. */\n.sm-inline-note{\n display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:var(--control-h);padding:0 6px 0 14px;\n border-radius:var(--radius-md);background:var(--surface-inset);color:var(--text-muted);font-size:var(--text-sm);\n}\n/* The custom section's row cards and the width bar (spec 2026-09-14 \\xA76). */\n.sm-rowcards{display:flex;flex-direction:column;gap:12px;align-items:stretch}\n.sm-rowcard{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid var(--input-border);border-radius:var(--radius-md);background:var(--input-bg);min-width:0}\n.sm-rowcard__head{display:flex;align-items:center;gap:4px}\n.sm-rowcard__title{flex:1;font-weight:600}\n.sm-rowcard__presets{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}\n/* Secondary buttons sit on the white card: an outline so they read as buttons. */\n.sm-rowcard__presets .sm-btn{height:var(--control-h-sm);padding:0 10px;font-size:var(--text-sm);border:1px solid var(--line)}\n.sm-rowcards > .sm-btn{align-self:flex-start;border:1px solid var(--line)}\n.sm-stepper{display:flex;align-items:center;gap:8px}\n.sm-stepper__value{min-width:20px;text-align:center;font-weight:600}\n/* The \\u2212 and + read as buttons, not glyphs: a hairline in both themes (asked for 2026-09-25). */\n.sm-stepper .sm-iconbtn{border:1px solid var(--line)}\n.sm-spanbar{display:flex;gap:2px;height:32px;background:var(--spanbar-bg);border-radius:var(--radius-md);padding:3px;user-select:none}\n.sm-spanbar__col{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;background:var(--spanbar-col);border-radius:6px;font-size:var(--text-sm);color:var(--text-muted)}\n.sm-spanbar__handle{position:absolute;right:-6px;top:0;bottom:0;width:10px;padding:0;border:0;background:transparent;cursor:col-resize;touch-action:none;z-index:1}\n.sm-spanbar__handle::after{content:\"\";position:absolute;left:4px;top:8px;bottom:8px;width:2px;border-radius:1px;background:var(--text-muted)}\n.sm-spanbar__handle:focus-visible{outline:none}\n.sm-spanbar__handle:focus-visible::after,.sm-spanbar__handle:hover::after{background:var(--accent)}\n/* A field revealed from a canvas click: one pulse of the accent, then nothing. */\n.sm-field--reveal{animation:sm-reveal .9s ease-out;border-radius:var(--radius-sm)}\n@keyframes sm-reveal{0%{outline:2px solid var(--selection);outline-offset:4px}100%{outline:2px solid transparent;outline-offset:4px}}\n\n.sm-group{display:flex;flex-direction:column;gap:10px;padding:2px 0 0 12px;border-left:2px solid var(--line)}\n.sm-list{display:flex;flex-direction:column;gap:8px;align-items:stretch}\n.sm-listrow{border:1px solid var(--input-border);border-radius:var(--radius-md);background:var(--input-bg);min-width:0}\n.sm-listrow__head{display:flex;align-items:center;gap:2px;height:var(--control-h-sm);padding:0 6px 0 6px}\n.sm-listrow__toggle{\n flex:1;min-width:0;display:flex;align-items:center;gap:6px;height:100%;padding:0 6px;\n border:0;background:transparent;color:var(--text);font:inherit;font-size:var(--text-md);font-weight:500;\n text-align:left;cursor:pointer;\n}\n.sm-listrow__toggle:hover{color:var(--accent)}\n.sm-listrow__summary{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n.sm-listrow__body{display:flex;flex-direction:column;gap:10px;padding:10px 12px 12px;border-top:1px solid var(--line)}\n\n/* \\u2500\\u2500 data \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n/* The list card: the scrolling region under the top bar (ListView). */\n.sm-listwrap{flex:1;min-height:0;overflow:auto;background:var(--surface-form);border-radius:var(--radius-card-lg)}\n.sm-listnotice{display:flex;flex-direction:column;gap:var(--card-gap);margin-bottom:var(--card-gap);flex:none}\n.sm-listnotice:empty{display:none}\n/* The rows sit in a centred column of at most 1200px inside the card,\n under --table-top of air reserved for the coming search and filters. */\n.sm-table{display:flex;flex-direction:column;padding:var(--table-pad);padding-top:var(--table-top);max-width:1200px;margin:0 auto}\n.sm-table__head,.sm-row{display:grid;gap:12px;align-items:center;padding:0 8px}\n.sm-table__head{\n height:40px;border-bottom:var(--table-rule);font-family:var(--meta-font);font-weight:500;\n font-size:var(--meta-size);letter-spacing:var(--caps-tracking);color:var(--text-muted);\n text-transform:var(--caps-transform);position:sticky;top:0;background:var(--surface-form);z-index:1;\n}\n/* Rows: a hairline under every row, none under the header (2026-09-25). The rule is a\n pseudo-element, not a border: a border would follow the rounded corners\n the neutral hover fill has, and the line must stay straight. */\n.sm-table__body{display:flex;flex-direction:column}\n.sm-row{\n position:relative;height:var(--row-h);border-radius:var(--row-radius);background:transparent;\n border:0;font:inherit;color:inherit;text-align:left;width:100%;\n}\n.sm-row::after{content:\"\";position:absolute;left:0;right:0;bottom:0;border-bottom:var(--row-rule);pointer-events:none}\n.sm-row--clickable{cursor:pointer}\n.sm-row--clickable:hover{background:var(--surface-inset)}\n.sm-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}\n.sm-cell--muted{color:var(--text-muted);font-size:var(--meta-size)}\n.sm-cell--warn{color:var(--warn);font-size:var(--meta-size);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.sm-cell--mono{font-family:var(--font-mono);font-size:var(--text-sm);color:var(--text-muted)}\n.sm-cell--title{font-weight:500}\n.sm-cell--grip{overflow:visible;display:flex;align-items:center;margin-left:-4px}\n.sm-empty{padding:28px 8px;color:var(--text-muted)}\n/* Settings \\u203A Content health (spec 2026-09-27 editor safety \\xA74): headed sections of grouped rows. */\n.sm-health section+section{margin-top:24px}\n.sm-health__section{font-size:var(--text-sm);font-weight:600;letter-spacing:var(--caps-tracking);text-transform:var(--caps-transform);color:var(--text-muted);margin:0 0 8px;padding:0 8px}\n.sm-health__group{display:flex;flex-direction:column;gap:2px;margin-bottom:16px}\n.sm-health__group > .sm-btn{align-self:flex-start;margin-top:4px}\n.sm-health__headline{display:flex;justify-content:space-between;gap:12px;font-weight:600;padding:6px 8px;margin:0}\n.sm-health__row{grid-template-columns:minmax(160px,1fr) 140px 90px 120px 70px}\n/* \\u2500\\u2500 drag and drop (spec 2026-09-09 \\xA77) \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n/* The grip is faint until its row is hovered or it has focus. */\n.sm-grip{\n display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:none;\n border:0;background:transparent;color:var(--text-muted);border-radius:var(--radius-xs);\n cursor:grab;touch-action:none;opacity:0;transition:opacity 120ms ease;padding:0;\n}\n.sm-row:hover .sm-grip,.sm-listrow__head:hover .sm-grip,.sm-outline-row:hover .sm-grip,.sm-grip:focus-visible{opacity:1}\n.sm-grip:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}\n/* The lifted row follows the pointer; siblings slide (transition set inline by the hook). */\n.sm-drag--lifted{position:relative;z-index:2;box-shadow:var(--shadow-pop);background:var(--surface);cursor:grabbing}\n.sm-drag--lifted .sm-grip{opacity:1;cursor:grabbing}\n.sm-drag--invalid{opacity:.5}\n.sm-chevron{\n width:12px;flex:none;border:0;background:none;padding:0;font:inherit;font-size:10px;\n color:var(--text-muted);cursor:pointer;line-height:1;\n}\n.sm-chevron:hover{color:var(--text)}\n.sm-cell--tree{display:flex;align-items:center;gap:8px;font-weight:500}\n.sm-cell--tree.sm-cell--parent{font-weight:600}\n.sm-rowmenu{\n border:0;background:none;padding:0 6px;font:inherit;color:var(--text-muted);cursor:pointer;\n border-radius:var(--radius-sm);line-height:1;height:24px;\n}\n.sm-rowmenu:hover{background:var(--surface-inset);color:var(--text)}\n.sm-dotmenu{\n width:var(--button-h);height:var(--button-h);flex:none;border-radius:50%;border:0;padding:0;\n background:var(--btn-secondary-bg);color:var(--text-muted);font:inherit;font-weight:700;letter-spacing:1px;\n display:grid;place-items:center;cursor:pointer;\n}\n.sm-dotmenu:hover{background:var(--btn-secondary-hover);color:var(--text)}\n.sm-dotmenu:disabled{opacity:.4;cursor:default}\n.sm-dotmenu:disabled:hover{background:var(--btn-secondary-bg);color:var(--text-muted)}\n.sm-dotmenu--sm{width:var(--button-h-sm);height:var(--button-h-sm);font-size:var(--text-sm)}\n/* Fixed, placed by ActionMenu from the button's rect (2026-09-26): a table cell clips absolute children. */\n.sm-picker--menu{position:fixed;width:220px;z-index:60}\n\n/* Status pill: a dot before the word. */\n.sm-badge{\n display:inline-flex;align-items:center;gap:6px;height:var(--badge-h);padding:0 10px;border-radius:var(--radius-btn);\n font-size:var(--text-sm);font-weight:600;letter-spacing:var(--caps-tracking);white-space:nowrap;\n}\n.sm-badge::before{content:\"\";width:6px;height:6px;border-radius:50%;background:currentColor;display:var(--badge-dot);flex:none}\n.sm-savestate{\n display:inline-flex;align-items:center;gap:7px;padding:0 8px;\n font-size:var(--text-sm);font-weight:500;letter-spacing:var(--caps-tracking);text-transform:var(--caps-transform);\n}\n.sm-dot{width:6px;height:6px;border-radius:var(--radius-round);flex:none}\n\n/* \\u2500\\u2500 navigation bits \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n/* Tabs read as an in-card segmented control: a white track with the chosen\n option in the tile grey and 10/6px corners \\u2014 all tokens. */\n.sm-tabs{\n display:flex;gap:2px;padding:var(--tabs-pad);background:var(--tabs-bg);border-radius:var(--tabs-radius);\n border-bottom:var(--card-divider);flex:none;\n}\n.sm-tab{\n flex:1;display:flex;align-items:center;justify-content:center;border:0;background:transparent;\n padding:var(--seg-pad-y) 10px;border-radius:var(--tab-radius);font:inherit;font-weight:500;\n cursor:pointer;color:var(--text-muted);white-space:nowrap;\n}\n.sm-tab:hover{color:var(--text)}\n.sm-tab[aria-selected=\"true\"]{background:var(--tab-active-bg);color:var(--tab-active-fg);font-weight:600;box-shadow:var(--tab-active-shadow)}\n/* The segmented control's track is --seg-bg (the canvas tone), one step\n below the inset so it reads on the cream ground of the top bar and the\n canvas meta row as well as on a white card. */\n.sm-seg{display:flex;gap:2px;padding:3px;background:var(--seg-bg);border-radius:var(--radius-btn)}\n/* A locale switch: each option wide enough to read as a tab, not a chip. */\n.sm-seg--locale .sm-seg__opt{min-width:64px}\n.sm-seg--stretch{width:100%}\n.sm-seg--disabled{opacity:.6}\n.sm-seg__opt:disabled{cursor:default}\n.sm-seg__opt{\n flex:1;padding:var(--seg-pad-y) 10px;border:0;border-radius:var(--radius-btn);background:transparent;\n color:var(--text-muted);font:inherit;font-weight:500;cursor:pointer;white-space:nowrap;\n}\n.sm-seg__opt:hover{color:var(--text)}\n.sm-seg__opt[aria-pressed=\"true\"]{background:var(--seg-active-bg);color:var(--text);font-weight:600;box-shadow:var(--shadow-seg)}\n/* A locale the record does not have yet: subtle, still a button (it opens the add pane). */\n.sm-seg__opt--absent{color:var(--text-subtle)}\n/* f.radio as a pill row (spec 2026-09-14 \\xA75): small chips a step below the tabs and the\n segmented control \\u2014 no track, the chosen pill filled in the soft accent, the rest bare.\n Wraps when the labels need it. */\n.sm-pills{display:flex;flex-wrap:wrap;gap:4px;padding:2px 0}\n.sm-pill{\n height:var(--control-h-sm);padding:0 10px;border:0;border-radius:var(--radius-btn);background:transparent;\n color:var(--text-muted);font:inherit;font-size:var(--text-sm);font-weight:500;line-height:1;cursor:pointer;white-space:nowrap;\n}\n.sm-pill:hover{color:var(--text);background:var(--surface-inset)}\n.sm-pill[aria-pressed=\"true\"]{background:var(--accent-soft);color:var(--accent);font-weight:600}\n.sm-pills--disabled{opacity:.6}\n.sm-pill:disabled{cursor:default}\n/* The custom-CSS box: code, no wrapping, no spellcheck. */\n.sm-css{font-family:var(--font-mono);font-size:12px;line-height:1.5;white-space:pre;overflow-x:auto}\n/* Switch (f.boolean, the SEO noindex toggle): a pill track, knob slides right when on. */\n.sm-switch{width:36px;height:20px;padding:2px;border:0;border-radius:var(--radius-round);background:var(--switch-bg);cursor:pointer;display:inline-flex;align-items:center;flex:none}\n.sm-switch[aria-checked=\"true\"]{background:var(--accent)}\n.sm-switch__knob{width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s}\n.sm-switch[aria-checked=\"true\"] .sm-switch__knob{transform:translateX(16px)}\n.sm-switch:disabled{opacity:.6;cursor:default}\n.sm-switch:focus-visible{box-shadow:var(--focus-ring)}\n/* Radio groups and checkbox lists (f.radio, f.checkboxes): native inputs in the accent, one row per option. */\n.sm-choices{display:flex;flex-direction:column;gap:8px;padding:4px 0}\n.sm-choice{display:flex;align-items:center;gap:8px;font-size:var(--text-md);cursor:pointer}\n.sm-choice input{accent-color:var(--accent);width:16px;height:16px;margin:0;flex:none}\n/* A choice with a description line (the invite modal's roles): input on the first line, text stacked. */\n.sm-choice--desc{align-items:flex-start}\n.sm-choice--desc input{margin-top:2px}\n.sm-choice__label{display:block;font-weight:500}\n.sm-choice__desc{display:block;margin-top:2px;font-size:var(--text-sm);color:var(--text-muted)}\n/* A soft counter past its limit (SEO title and description). */\n.sm-counter--over{color:var(--warn)}\n/* The page glyph beside the page title in the empty-selection inspector head. */\n.sm-pageglyph{width:10px;height:13px;border:1.5px solid var(--text-muted);border-radius:var(--radius-xs);flex:none}\n.sm-divider{height:1px;background:var(--line);flex:none}\n.sm-sectionlabel{display:flex;align-items:center;justify-content:space-between;gap:8px}\n/* The overline: a small uppercase tracked heading for a group \\u2014 the\n inspector's Spacing & layout / Advanced, the picker's Add to <zone> and\n Site, the outline's zones, the Settings nav (2026-09-26; a mono face before). */\n.sm-overline,.sm-sectionlabel--caps>.sm-label{\n font-family:var(--font-sans);font-size:var(--text-xs);font-weight:600;letter-spacing:var(--tracking-tag);text-transform:uppercase;color:var(--text-muted);\n}\n.sm-stale{padding:8px 20px 0}\n/* Drift (spec 2026-09-27 editor safety \\xA75): the document notice under the stale line, the orphan group at a form's foot. */\n.sm-drift{padding:8px 20px 0}\n.sm-orphans{margin-top:16px;border-top:1px solid var(--line);padding-top:12px}\n.sm-orphans__head{cursor:pointer;font-size:var(--text-sm);font-weight:600;letter-spacing:var(--caps-tracking);text-transform:var(--caps-transform);color:var(--text-muted)}\n.sm-orphans__row{display:grid;grid-template-columns:minmax(80px,auto) 1fr auto auto;gap:8px;align-items:center;margin-top:8px}\n.sm-orphans__value{color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--font-mono);font-size:var(--text-sm)}\n.sm-lock{display:inline-flex;align-items:center;margin-left:6px;color:var(--text-muted);vertical-align:middle}\n.sm-presence{margin:0;padding:6px 20px 0;font-size:13px;color:var(--text-muted)}\n.sm-banner{\n display:flex;gap:14px;align-items:flex-start;padding:12px 16px;border-radius:var(--radius-md);\n font-size:var(--text-md);\n}\n.sm-banner--error{background:var(--danger-soft);color:var(--danger)}\n.sm-banner--ok{background:var(--status-published-bg);color:var(--status-published-fg)}\n.sm-banner--warn{background:var(--warn-soft);color:var(--warn)}\n.sm-fielderr{margin:6px 0 0;padding-left:18px;font:inherit;font-size:var(--text-sm);font-family:var(--font-mono)}\n.sm-fielderr__field{background:none;border:0;padding:0;font:inherit;color:inherit;text-decoration:underline;cursor:pointer}\n\n/* \\u2500\\u2500 cards \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n/* The inspector column (editor, entry and global forms) is a stack of\n cards (grey tiles). */\n.sm-inspector{\n display:flex;flex-direction:column;gap:var(--card-gap);min-height:0;overflow:auto;\n background:var(--bar-bg);border-left:var(--bar-border);\n}\n.sm-card{\n display:flex;flex-direction:column;gap:12px;padding:var(--card-pad);flex:none;\n background:var(--surface);border-radius:var(--radius-card);\n}\n.sm-card+.sm-card{border-top:var(--card-divider)}\n/* A card's first section label is its title. */\n.sm-card>.sm-sectionlabel:first-child>.sm-label,.sm-card>.sm-inspector__head>.sm-label{\n font-size:var(--card-title-size);font-weight:600;color:var(--card-title-color);\n}\n.sm-inspector__head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none}\n.sm-inspector__body{display:flex;flex-direction:column;gap:14px}\n/* A tab's groups (spec 2026-09-14 \\xA75): the section's own settings untitled, then Spacing & layout and Advanced under a hairline. */\n.sm-inspector__group{display:flex;flex-direction:column;gap:12px}\n.sm-inspector__group+.sm-inspector__group{margin-top:8px;padding-top:12px;border-top:1px solid var(--line)}\n/* The form card: the main column of the entry and global forms. Every\n field (and the banner) is a centred 680px column \\u2014 a reading width \\u2014\n while the card itself still fills the main area. */\n.sm-form{\n display:flex;flex-direction:column;gap:18px;padding:var(--form-pad);min-width:0;overflow:auto;\n background:var(--surface-form);border-radius:var(--radius-card-lg);\n}\n.sm-form>*{width:100%;max-width:680px;align-self:center}\n\n/* \\u2500\\u2500 editor \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n/* canvas \\xB7 handle \\xB7 inspector. The handle column is 8px (the gutter is 0).\n The calc() is the\n maximum the drag maths (ui/resize.ts) also applies \\u2014 the row less the\n handle and the canvas's 440px minimum \\u2014 so a window that shrinks after a\n drag never leaves the canvas squeezed. */\n.sm-editor{flex:1;min-height:0;display:grid;grid-template-columns:1fr max(var(--gutter),8px) min(var(--inspector-w),calc(100% - max(var(--gutter),8px) - 440px))}\n.sm-editor[inert],.sm-form[inert]{opacity:.6}\n/* The drag-to-resize handle (spec 2026-09-10 \\xA73): fills its column, draws a\n 2px line down its centre on hover and while dragging \\u2014 a shade off the\n ground, since the col-resize cursor already says it drags (2026-09-10);\n keyboard focus alone gets the accent, a focus ring must be seen. */\n.sm-resize{position:relative;cursor:col-resize;touch-action:none;outline:none;align-self:stretch}\n.sm-resize::after{content:\"\";position:absolute;top:0;bottom:0;left:50%;width:2px;margin-left:-1px;border-radius:1px;background:transparent;transition:background .12s}\n.sm-resize:hover::after,.sm-admin--resizing .sm-resize::after{background:var(--line-dashed)}\n.sm-resize:focus-visible::after{background:var(--accent)}\n/* While a drag is live: the resize cursor everywhere, no text selection, and\n the canvas iframe must not swallow the pointer when it crosses it. */\n.sm-admin--resizing,.sm-admin--resizing *{cursor:col-resize!important;user-select:none}\n.sm-admin--resizing iframe{pointer-events:none}\n.sm-canvas{\n display:flex;flex-direction:column;background:var(--canvas);border-radius:var(--radius-card-lg);\n min-width:0;min-height:0;overflow:hidden;\n}\n.sm-canvas__scroll{flex:1;min-height:0;overflow:auto;padding:var(--canvas-pad)}\n.sm-page{\n position:relative;background:var(--page-bg);border-radius:var(--page-radius);\n box-shadow:var(--shadow-page);min-height:100%;\n}\n.sm-canvas__loading{\n height:240px;display:grid;place-items:center;color:var(--text-subtle);font-family:var(--meta-font);\n font-size:var(--meta-size);letter-spacing:var(--caps-tracking);text-transform:var(--caps-transform);\n}\n.sm-blockglyph{width:14px;height:10px;border:1.5px solid var(--text-muted);border-radius:var(--radius-xs);flex:none}\n/* The selected block's label: a 4px-cornered chip. */\n.sm-blocktag{\n position:absolute;top:0;left:0;transform:var(--blocktag-shift);background:var(--selection);color:var(--on-accent);\n font-family:var(--blocktag-font);font-size:var(--blocktag-size);font-weight:600;line-height:1.3;\n letter-spacing:var(--blocktag-tracking);text-transform:var(--blocktag-transform);padding:3px 10px;\n border-radius:var(--blocktag-radius);white-space:nowrap;\n}\n.sm-blocktag--global{background:var(--selection-global)}\n.sm-blocktag--inside{transform:var(--blocktag-shift-inside)}\n.sm-blocktoolbar{\n display:flex;gap:2px;padding:3px;background:var(--toolbar-bg);border-radius:var(--toolbar-radius);\n box-shadow:var(--shadow-float);\n}\n.sm-blocktoolbar__note{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--toolbar-fg);opacity:.7;padding:4px 8px}\n/* The insert affordance between sections: a labelled pill (the label is\n 8px-cornered). */\n.sm-plus{\n display:inline-flex;align-items:center;gap:8px;height:var(--plus-h);min-width:var(--plus-h);padding:var(--plus-pad);\n border-radius:var(--plus-radius);border:0;background:var(--plus-bg);color:var(--plus-fg);\n font:500 var(--text-lg)/1 var(--font-sans);cursor:pointer;box-shadow:var(--plus-shadow);white-space:nowrap;\n transition:background .12s,transform .12s;\n}\n/* Hover is a tiny scale-up, nothing that moves the pill (the tooltip that\n used to appear under it grew the wrapper and shifted it, 2026-09-10). */\n.sm-plus:hover{background:var(--plus-hover);transform:scale(1.05)}\n.sm-plus__icon{\n width:20px;height:20px;flex:none;border-radius:50%;background:var(--plus-icon-bg);color:var(--plus-icon-fg);\n display:grid;place-items:center;font-size:15px;line-height:1;\n}\n.sm-plus__label{display:var(--plus-label);font-size:var(--text-sm)}\n.sm-guide{height:1px;background:color-mix(in srgb,var(--selection) 35%,transparent)}\n/* Outline rows: white boxes on the tile. */\n.sm-outline-row{\n display:flex;align-items:center;justify-content:space-between;gap:4px;\n height:var(--outline-row-h);border-radius:var(--outline-row-radius);padding:0 6px 0 12px;\n color:var(--text);font-weight:500;background:var(--outline-row-bg);\n border:var(--outline-row-border);\n}\n.sm-outline-row--clickable{cursor:pointer}\n.sm-outline-row--clickable:hover{background:var(--control-hover)}\n/* Selected and locked rows are read by their fill, so they drop the hairline \\u2014\n border-color, not border, so every row keeps the same box. */\n.sm-outline-row--selected,.sm-outline-row--selected:hover{\n background:var(--nav-active-bg);color:var(--nav-active-fg);font-weight:600;border-color:transparent;\n}\n.sm-outline-row--empty{border:1px dashed var(--line-dashed);color:var(--text-muted);padding:0 12px}\n.sm-outline-row--locked{background:var(--surface-inset);color:var(--text-muted);padding:0 12px;border-color:transparent}\n.sm-outline-row__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}\n.sm-outline-row__note{font-size:var(--text-sm);font-weight:500;flex:none;letter-spacing:var(--caps-tracking);text-transform:var(--caps-transform)}\n.sm-outline-row__add{color:var(--accent);font-weight:500;flex:none}\n/* Drift marks (spec 2026-09-27 editor safety \\xA75): a stripe inside the row's left edge, red for broken, muted for left over. */\n.sm-outline-row--broken{box-shadow:inset 3px 0 0 var(--danger)}\n.sm-outline-row--orphan{box-shadow:inset 3px 0 0 var(--line-dashed)}\n.sm-outline-note{margin:0;font-size:var(--text-sm);color:var(--danger)}\n/* A removed zone's one row wraps its sentence rather than cutting it: the inspector is narrow. */\n.sm-outline-row--removed{height:auto;min-height:var(--outline-row-h);padding-block:6px}\n.sm-outline-row--removed .sm-outline-row__label{white-space:normal}\n.sm-rtcard--broken{box-shadow:inset 3px 0 0 var(--danger)}\n/* A row with a grip: the grip takes the left padding's place and the label follows it. */\n.sm-outline-row--grip{padding-left:2px}\n.sm-outline-row--grip .sm-outline-row__label{flex:1}\n\n.sm-picker{\n width:300px;background:var(--menu-bg);border:var(--menu-border);border-radius:var(--radius-md);\n padding:6px;box-shadow:var(--shadow-pop);\n}\n.sm-picker__item{\n display:flex;gap:10px;align-items:center;width:100%;text-align:left;background:transparent;\n border:0;border-radius:var(--radius-sm);padding:8px 10px;cursor:pointer;color:var(--text);font:inherit;\n}\n.sm-picker__item:hover{background:var(--nav-active-bg)}\n/* after the base item rule: same specificity, so source order decides (ActionMenu states) */\n.sm-picker__item:disabled{opacity:.4;cursor:default}\n.sm-picker__item:disabled:hover{background:transparent}\n.sm-picker__item--danger{color:var(--danger)}\n.sm-picker__icon{\n width:26px;height:26px;flex:none;border-radius:var(--radius-sm);background:var(--accent-soft);\n color:var(--accent);display:grid;place-items:center;font-size:13px;\n}\n/* Combobox (spec 2026-09-17 \\xA71): the input owns the width, the list hangs under it \\u2014\n portaled and fixed at the input's width (--combo-w), above modals and below\n the confirm scrim (2026-09-27); inline under the input in static markup. */\n.sm-combo{position:relative}\n.sm-combo .sm-input{width:100%;padding-right:30px}\n.sm-combo--suffix .sm-input{padding-right:96px}\n.sm-combo__suffix{position:absolute;right:28px;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:4px}\n.sm-combo__suffix a.sm-iconbtn{text-decoration:none}\n.sm-combo__chevron{position:absolute;right:10px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--text-muted)}\n.sm-combo__list{position:absolute;top:calc(100% + 4px);left:0;right:0;width:auto;max-height:280px;overflow-y:auto;z-index:60}\n.sm-combo__list--floating{position:fixed;top:auto;right:auto;width:var(--combo-w,300px);z-index:75}\n.sm-combo__empty{padding:8px 10px;color:var(--text-muted);font-size:var(--text-sm)}\n/* Reference picker (spec 2026-09-17 \\xA72): the picked entries under the search input. */\n.sm-refpicker{display:flex;flex-direction:column;gap:6px;min-width:0}\n.sm-refpicker__rows{display:flex;flex-direction:column;gap:4px}\n.sm-refpicker__title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.sm-refrow{\n display:flex;align-items:center;gap:6px;height:var(--control-h-sm);padding:0 6px 0 10px;\n border:1px solid var(--input-border);border-radius:var(--radius-md);background:var(--input-bg);min-width:0;\n}\n.sm-refrow:has(.sm-grip){padding-left:6px}\n.sm-refrow:hover .sm-grip{opacity:1}\n.sm-refrow--muted .sm-refpicker__title{color:var(--text-muted)}\n.sm-refrow__note{font-size:var(--text-sm)}\n.sm-refrow a.sm-iconbtn{text-decoration:none}\n/* Tags (spec 2026-09-17 \\xA75): chips that wrap, a dashed + Add, the inline input in its place. */\n.sm-tags{display:flex;flex-wrap:wrap;gap:6px;align-items:center}\n.sm-tag{\n display:inline-flex;align-items:center;gap:6px;height:var(--control-h-sm);padding:0 10px;border:0;\n border-radius:var(--tag-radius);background:var(--surface-inset);color:var(--text);font:inherit;font-size:var(--text-sm);white-space:nowrap;\n transition:background .2s;\n}\n.sm-tag--flash{background:var(--accent-soft)}\n.sm-tag__x{border:0;background:transparent;padding:0;color:var(--text-muted);cursor:pointer;font:inherit;line-height:1}\n.sm-tag__x:hover{color:var(--text)}\n.sm-tag--add{background:transparent;border:1px dashed var(--line);color:var(--text-muted);cursor:pointer}\n.sm-tag--add:hover{color:var(--text);border-color:var(--text-muted)}\n.sm-combo--tag{width:180px}\n.sm-combo--tag .sm-input{height:var(--control-h-sm);padding-right:10px}\n.sm-combo--tag .sm-combo__chevron{display:none}\n.sm-combo__list.sm-combo__list--tag{right:auto;width:240px}\n/* \\u2500\\u2500 date and datetime pickers (spec 2026-09-25) \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\n The text box with a calendar button as its suffix; for datetime an hour\n and a minute select beside it; the popover a month grid on the menu\n surface, 7 \\xD7 32px cells in 252px, flipping upward when the room below\n is short (opensUp, as the combobox). */\n.sm-date{position:relative;display:flex;flex-direction:column;gap:8px;min-width:0}\n.sm-date__row{display:flex;align-items:center;gap:8px;min-width:0}\n.sm-inputwrap.sm-date__wrap{flex:1;min-width:0;padding-right:6px}\n.sm-date__btn{\n width:28px;height:28px;flex:none;display:grid;place-items:center;padding:0;\n border:0;border-radius:var(--radius-sm);background:transparent;color:var(--text-muted);cursor:pointer;\n}\n.sm-date__btn:hover,.sm-date__btn[aria-expanded=\"true\"]{background:var(--hover);color:var(--text)}\n.sm-date__time{width:auto;flex:none;padding-right:30px}\n.sm-date__colon{color:var(--text-muted);margin:0 -4px}\n/* left is inline: the popover's right edge under the calendar button (2026-09-26; flush left before). */\n.sm-cal{\n position:absolute;top:calc(var(--control-h) + 4px);left:0;z-index:60;width:252px;padding:8px;\n background:var(--menu-bg);border:var(--menu-border);border-radius:var(--radius-md);box-shadow:var(--shadow-pop);\n}\n.sm-cal--up{top:auto;bottom:calc(100% + 4px)}\n.sm-cal__head{display:flex;align-items:center;gap:4px;height:28px;margin-bottom:4px}\n.sm-cal__month{flex:1;text-align:center;font-weight:600;font-size:var(--text-sm)}\n.sm-cal__nav{\n width:24px;height:24px;display:grid;place-items:center;padding:0;border:0;border-radius:var(--radius-sm);\n background:transparent;color:var(--text-muted);cursor:pointer;\n}\n.sm-cal__nav:hover{background:var(--hover);color:var(--text)}\n.sm-cal__grid{display:grid;grid-template-columns:repeat(7,32px);gap:2px}\n.sm-cal__wd{height:24px;display:grid;place-items:center;font-size:var(--text-xs);color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}\n.sm-cal__day{\n height:32px;padding:0;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--text);\n font:inherit;font-size:var(--text-sm);cursor:pointer;\n}\n.sm-cal__day:hover{background:var(--nav-active-bg)}\n.sm-cal__day--out{color:var(--text-subtle)}\n.sm-cal__day--today{box-shadow:inset 0 0 0 1px var(--accent-line)}\n.sm-cal__day--focus{box-shadow:inset 0 0 0 2px var(--accent)}\n.sm-cal__day[aria-pressed=\"true\"],.sm-cal__day[aria-pressed=\"true\"]:hover{background:var(--accent);color:var(--on-accent)}\n.sm-cal__foot{display:flex;justify-content:flex-end;padding:6px 4px 0}\n.sm-dashed{\n border:1px dashed var(--line-dashed);border-radius:var(--radius-lg);\n display:flex;align-items:center;justify-content:center;gap:8px;color:var(--text-subtle);\n font-family:var(--meta-font);font-size:var(--text-sm);letter-spacing:var(--caps-tracking);text-transform:var(--caps-transform);\n}\n\n/* \\u2500\\u2500 media \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n/* The single track is minmax(0,1fr), not auto: an auto track grows to the panel's own width, so the\n panel's max-width:100% would cap at nothing and a 1200px History panel ran past a laptop viewport. */\n.sm-modal{position:fixed;inset:0;z-index:70;background:var(--scrim);display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);place-items:center;padding:24px}\n.sm-modal__panel{\n max-width:100%;max-height:100%;display:flex;flex-direction:column;background:var(--menu-bg);\n border:var(--menu-border);border-radius:var(--radius-modal);box-shadow:var(--shadow-modal);overflow:hidden;\n}\n.sm-modal__head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px;border-bottom:var(--card-divider)}\n.sm-modal__body{padding:12px 16px;overflow:auto;display:flex;flex-direction:column;gap:10px;min-height:0}\n/* Fields on the white modal panel take the tile tone, like the dialog's (2026-09-25). */\n.sm-modal__panel .sm-input,.sm-modal__panel .sm-textarea,.sm-modal__panel .sm-select{background:var(--surface)}\n.sm-modal__foot{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px 14px;border-top:var(--card-divider)}\n.sm-modal__body--flush{padding:0;gap:0;flex:1}\n/* \\u2500\\u2500 history (spec 2026-09-13) \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n.sm-history{display:flex;flex:1;min-height:0}\n.sm-history__list{width:260px;flex:none;overflow:auto;display:flex;flex-direction:column;border-right:var(--card-divider)}\n.sm-history__row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border:0;border-bottom:var(--card-divider);background:none;color:inherit;font:inherit;font-size:var(--text-sm);text-align:left;cursor:pointer}\n.sm-history__row:hover{background:var(--input-bg)}\n.sm-history__row--active,.sm-history__row--active:hover{background:var(--input-bg);font-weight:600}\n.sm-history__tag{font-size:var(--text-sm);color:var(--text-muted);padding:1px 8px;border-radius:999px;border:1px solid var(--line-dashed)}\n.sm-history__tag--live{color:var(--status-published-fg);background:var(--status-published-bg);border-color:transparent}\n.sm-history__main{flex:1;min-width:0;display:flex;overflow:auto}\n.sm-history__frame{flex:1;width:100%;height:100%;border:0;background:#fff}\n.sm-history__form{flex:1;min-width:0;margin:0;padding:16px;border:0;pointer-events:none;display:flex;flex-direction:column;gap:14px}\n.sm-picker-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}\n.sm-dropzone{\n border:1px dashed var(--line-dashed);border-radius:var(--radius-lg);background:var(--input-bg);color:var(--text-muted);\n display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:18px;text-align:center;\n}\n/* The picker's drop bar: tall enough to aim a drag at (2026-09-25). */\n.sm-dropzone--bar{padding:28px 10px;font-size:var(--text-sm)}\n.sm-mediagrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}\n.sm-mediacard{\n display:flex;flex-direction:column;gap:4px;padding:6px;background:transparent;border:1.5px solid transparent;\n border-radius:var(--radius-md);cursor:pointer;text-align:left;color:var(--text);font:inherit;min-width:0;\n}\n.sm-mediacard:hover{background:var(--control-hover)}\n.sm-mediacard[aria-pressed=\"true\"]{border-color:var(--selection);background:var(--accent-soft)}\n.sm-mediacard__thumb{display:block;aspect-ratio:4/3;border-radius:var(--radius-sm);overflow:hidden;background:var(--surface-inset)}\n.sm-mediacard__img{width:100%;height:100%;object-fit:cover;display:block}\n.sm-thumb--chip{display:grid;place-items:center;width:100%;height:100%;font-weight:600;color:var(--text-muted);font-size:var(--text-sm)}\n.sm-mediacard__name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.sm-mediacard__meta{font-size:var(--text-sm);color:var(--text-muted)}\n.sm-media{display:flex;flex-direction:column;gap:6px}\n/* The filled image field: a canvas (a shade off its ground \\u2014 a neutral\n grey in light mode, lighter in dark \\u2014 up to 300px tall) with the cropped frame\n contained inside it; the frame keeps its aspect and is sized by the\n widget as min(300px tall, full width). The inset tone alone read as an\n empty field (2026-09-25). */\n.sm-media__canvas{\n display:flex;align-items:center;justify-content:center;max-height:300px;overflow:hidden;\n border-radius:var(--radius-md);background:var(--canvas-ground);\n}\n.sm-media__thumb{position:relative;overflow:hidden;max-width:100%;max-height:300px;background:var(--surface-inset)}\n.sm-media__thumb>img,.sm-media__thumb>video{position:absolute;max-width:none;display:block}\n.sm-media__alt{font-size:var(--text-sm);color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.sm-media>.sm-media__alt{text-align:center}\n.sm-media__actions{display:flex;gap:6px}\n.sm-media__chip{display:flex;align-items:center;gap:8px;padding:6px 12px;background:var(--surface-inset);border-radius:var(--radius-btn)}\n.sm-crop{display:grid;grid-template-columns:1fr 240px;gap:14px;min-height:0}\n.sm-crop__stage{position:relative;user-select:none;touch-action:none;background:var(--surface-inset);border-radius:var(--radius-md);overflow:hidden}\n.sm-crop__stage>img{display:block;width:100%;height:auto;pointer-events:none}\n.sm-crop__shade{position:absolute;inset:0;background:rgba(0,0,0,.45);pointer-events:none}\n.sm-crop__rect{position:absolute;outline:1.5px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.4);cursor:move;background:transparent}\n.sm-crop__handle{position:absolute;width:12px;height:12px;background:#fff;border:1px solid rgba(0,0,0,.4);border-radius:2px}\n.sm-crop__handle--nw{left:-6px;top:-6px;cursor:nwse-resize}.sm-crop__handle--ne{right:-6px;top:-6px;cursor:nesw-resize}\n.sm-crop__handle--sw{left:-6px;bottom:-6px;cursor:nesw-resize}.sm-crop__handle--se{right:-6px;bottom:-6px;cursor:nwse-resize}\n.sm-crop__hotspot{position:absolute;width:22px;height:22px;margin:-11px 0 0 -11px;border-radius:50%;border:2px solid #fff;background:color-mix(in srgb,var(--accent) 55%,transparent);cursor:grab;box-shadow:0 0 0 1px rgba(0,0,0,.4)}\n.sm-crop__side{display:flex;flex-direction:column;gap:10px}\n.sm-crop__preview{position:relative;overflow:hidden;border-radius:var(--radius-md);background:var(--surface-inset)}\n.sm-crop__preview>img{position:absolute;max-width:none;display:block}\n.sm-mediascreen{display:grid;grid-template-columns:1fr 300px;column-gap:var(--gutter);flex:1;min-height:0}\n.sm-mediascreen__grid{padding:var(--table-pad);overflow:auto;background:var(--surface-form);border-radius:var(--radius-card-lg)}\n.sm-mediascreen__inspector{\n border-left:var(--bar-border);padding:var(--card-pad);overflow:auto;display:flex;flex-direction:column;gap:10px;\n background:var(--surface);border-radius:var(--radius-card);\n}\n.sm-facts{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;font-size:var(--text-sm);color:var(--text-muted)}\n.sm-usage{display:flex;flex-direction:column;gap:4px}\n/* The Settings area (spec 2026-09-25 \\xA75): a 200px nav card beside the\n page, both under the main column; the page keeps its own top bar. */\n.sm-settings{display:grid;grid-template-columns:200px 1fr;column-gap:var(--gutter);flex:1;min-height:0}\n/* The nav card starts under the page's top bar, so its top meets the page's\n grey card across the gutter; no heading (asked for 2026-09-26; an 18px\n title, then an overline, lived above the links earlier that day). */\n.sm-settings__nav{\n display:flex;flex-direction:column;gap:2px;padding:var(--table-pad);overflow:auto;margin-top:var(--topbar-h);\n background:var(--surface-form);border-radius:var(--radius-card-lg);\n}\n.sm-settings__link{\n display:block;padding:8px 10px;border-radius:var(--radius-md);color:var(--text);text-decoration:none;font-size:var(--text-md);\n}\n.sm-settings__link:hover{background:var(--surface-inset)}\n.sm-settings__link[aria-current=\"page\"],.sm-settings__link[aria-current=\"page\"]:hover{background:var(--nav-active-bg);color:var(--nav-active-fg);font-weight:600}\n.sm-settings__page{display:flex;flex-direction:column;min-width:0;min-height:0}\n\n/* \\u2500\\u2500 dialog card (design_handoff_smoodly_neutral/components/ConfirmModal.html) \\u2500\\u2500 */\n/* The scrim covers the whole admin, frame included, above every modal\n (a History restore asks from inside one). The card: 440px, the modal\n radius, 28/28/24 padding, sections 20px apart. The confirm question and\n the page form dialogs share it (ui/Dialog.tsx). */\n.sm-scrim{position:fixed;inset:0;z-index:80;background:var(--scrim);display:grid;place-items:center;padding:24px}\n.sm-dialog{\n width:440px;max-width:100%;display:flex;flex-direction:column;gap:20px;padding:28px 28px 24px;\n background:var(--menu-bg);border:var(--menu-border);border-radius:var(--radius-modal);box-shadow:var(--shadow-modal);\n color:var(--text);\n}\n.sm-dialog__head{display:flex;flex-direction:column;gap:8px}\n.sm-dialog__titlerow{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}\n.sm-dialog__title{font:var(--title-weight) var(--title-size)/1.3 var(--title-font);letter-spacing:var(--title-tracking);margin:0}\n.sm-dialog__close{\n width:28px;height:28px;flex:none;margin:-4px -6px 0 0;display:grid;place-items:center;\n border:0;border-radius:var(--radius-sm);background:transparent;color:var(--text-muted);font-size:14px;line-height:1;cursor:pointer;\n}\n.sm-dialog__close:hover{background:var(--hover);color:var(--text)}\n.sm-dialog__close:focus-visible{outline:2px solid var(--accent);outline-offset:1px}\n/* The confirm's consequence sits right under the title, closer than the sections. */\n.sm-confirm .sm-dialog__body{margin:-12px 0 0}\n.sm-dialog__body{margin:0;color:var(--text-secondary);line-height:1.55}\n/* The context chip: the subject's name (truncates) and its path (never does). */\n.sm-dialog__context{\n display:flex;align-items:center;gap:10px;height:36px;padding:0 12px;\n background:var(--surface);border-radius:var(--radius-lg);color:var(--text-muted);font-size:var(--text-sm);white-space:nowrap;\n}\n.sm-dialog__context strong{font-weight:500;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:var(--text-md)}\n.sm-dialog__context code{font-family:var(--font-mono);flex:none}\n.sm-confirm__option{margin-top:4px;font-size:var(--text-md);color:var(--text)}\n.sm-redirects-from{display:flex;flex-direction:column;gap:4px}\n.sm-redirects-from code{font-size:var(--text-sm)}\n/* A form dialog's fields: white fields on the white card get the tile tone instead. */\n.sm-dialog__form{display:flex;flex-direction:column;gap:14px}\n.sm-dialog__form .sm-input,.sm-dialog__form .sm-select,.sm-dialog__form .sm-inputwrap{background:var(--surface)}\n.sm-dialog__form .sm-inputwrap>.sm-input{background:transparent}\n.sm-dialog__actions{display:flex;justify-content:flex-end;gap:10px}\n`,nL=\"smoodly-theme\",dle=`(function(){try{var e=document.currentScript.parentElement,t=localStorage.getItem(${JSON.stringify(nL)}),w=localStorage.getItem(${JSON.stringify(Xh)});if(t===\"dark\"||t===\"light\")e.setAttribute(\"data-theme\",t);if(w&&/^\\\\d+$/.test(w)&&+w>=${260})e.style.setProperty(\"--inspector-w\",w+\"px\")}catch(e){}})()`,fle=`body{margin:0}.sm-admin{min-height:100vh;background:${LO}}@media (prefers-color-scheme:dark){.sm-admin:not([data-theme=\"light\"]){background:${tL}}}.sm-admin[data-theme=\"dark\"]{background:${tL}}`;var Jh=T(te(),1);var YV=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,rL=t=>YV.test(t);var AO={\\u00F8:\"o\",\\u00E6:\"ae\",\\u0153:\"oe\",\\u00DF:\"ss\",\\u0142:\"l\",\\u0111:\"d\",\\u00F0:\"d\",\\u00FE:\"th\",\\u0127:\"h\",\\u0131:\"i\"},ZV=new RegExp(`[${Object.keys(AO).join(\"\")}]`,\"g\");function Jl(t){return t.normalize(\"NFKD\").replace(/[\\u0300-\\u036f]/g,\"\").toLowerCase().replace(ZV,e=>AO[e]).replace(/[^a-z0-9]+/g,\"-\").replace(/^-+|-+$/g,\"\")}var QV=t=>t.length===0?\"/\":\"/\"+t.join(\"/\");function EO(t){let e=t;try{let n=decodeURIComponent(t);n.includes(\"/\")||(e=n)}catch{}return e.normalize(\"NFC\")}function e8(t,e){let n=[t],r=t;for(;r.parentId!==null;){let o=e(r.parentId);if(!o)throw new Error(`smoodly: broken parent chain at \"${t.id}\".`);n.unshift(o),r=o}return n}var t8=(t,e)=>t.parentId===null&&t.locales[e.locales.default]?.slug===e.homePageSlug;function n8(t,e,n){let r=n.addresses?.[t.fixed]?.[e];return r===void 0?null:r.split(\"/\")}function r8(t,e,n,r){if(!t.locales[n])return null;if(t8(t,r))return\"/\";let o=e8(t,e);if(!o.every(l=>l.locales[n]!==void 0))return null;let[s,...a]=o,i=s.fixed?n8(s,n,r):[s.locales[n].slug];return i===null?null:QV([...i,...a.map(l=>l.locales[n].slug)])}function TO(t,e,n){let r=s=>t.find(a=>a.id===s),o=s=>t.filter(a=>a.parentId===s).map(a=>({record:a,path:r8(a,r,e,n),children:o(a.id)}));return o(null)}var tv=\"/admin\";var RO=(t,e)=>`${t}${e}`;function IO(t,e){if(t===\"\"||t===e||t.startsWith(`${e}/`))return null;let n=`/${t.split(\"/\").filter(r=>r!==\"\")[0]??\"\"}`;return`The admin is open at ${t}, but admin.path in the Smoodly config is ${e}. Set admin: { path: \"${n}\" } in the config, or move the route folder back.`}function o8(t,e=tv){return t!==e&&!t.startsWith(`${e}/`)?[]:t.slice(e.length).split(\"/\").filter(n=>n!==\"\")}function MO(t,e){return t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey?!1:!e||e===\"_self\"}var oL=new Set;function s8(t){let{pathname:e,search:n}=window.location;return{pathname:e,segments:o8(e,t),search:n}}var a8=(t,e)=>t.pathname===e.pathname&&t.search===e.search;async function sr(t,e={}){window.history[e.replace?\"replaceState\":\"pushState\"](null,\"\",t);for(let n of oL)n();return!0}function _O(t){let[e,n]=(0,Jh.useState)({pathname:\"\",segments:[],search:\"\"});return(0,Jh.useEffect)(()=>{let r=()=>n(o=>{let s=s8(t);return a8(o,s)?o:s});return r(),oL.add(r),window.addEventListener(\"popstate\",r),()=>{oL.delete(r),window.removeEventListener(\"popstate\",r)}},[t]),e}function ld(t){(0,Jh.useEffect)(()=>{if(!t)return;let e=n=>{n.preventDefault(),n.returnValue=\"\"};return window.addEventListener(\"beforeunload\",e),()=>window.removeEventListener(\"beforeunload\",e)},[t])}var PO=T(O(),1);function qn({href:t,onClick:e,...n}){return(0,PO.jsx)(\"a\",{href:t,...n,onClick:r=>{e?.(r),MO(r,n.target)&&(r.preventDefault(),sr(t))}})}var fe=T(O(),1),BO={size:14,strokeWidth:1.5,\"aria-hidden\":!0};function cd({height:t=18}){return(0,fe.jsx)(\"svg\",{className:\"sm-wordmark\",style:{height:t},viewBox:\"0 0 183 43\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",role:\"img\",\"aria-label\":\"Smoodly\",children:(0,fe.jsx)(\"path\",{fill:\"currentColor\",d:\"M13.294 9.9796C15.9908 9.9796 19.823 10.7144 21.4552 11.5204L20.1069 18.3473C18.1198 17.4228 15.3284 16.688 12.7973 16.688C11.307 16.688 10.3371 17.0198 10.3371 17.8021C10.3371 18.3236 10.8575 18.6318 11.7801 18.8214L13.7198 19.2481C17.7413 20.1251 19.7993 22.2111 19.7993 25.4112C19.7993 31.9063 14.7607 34.3716 8.23173 34.3716C4.9909 34.3716 1.8447 33.5893 0.046875 32.8782L1.48987 25.6009C3.90274 26.8572 7.14357 27.6395 9.22526 27.6395C10.7156 27.6395 11.7328 27.2602 11.7328 26.3357C11.7328 25.8142 11.3543 25.4112 10.2425 25.2216L8.58656 24.8897C5.44036 24.2971 2.74362 22.14 2.74362 18.6792C2.74362 13.2982 6.81239 10.0033 13.3413 10.0033L13.294 9.9796ZM52.8463 9.9796C49.014 9.9796 46.6012 12.0656 45.2528 13.5116C44.1883 11.3308 41.9174 9.9796 39.2916 9.9796C36.6658 9.9796 34.6551 10.9989 33.283 12.3975L33.6142 10.7381H26.0681L21.6208 33.6604H29.2616L32.0766 19.011C32.9992 17.8495 34.2529 16.9724 35.6013 16.9724C37.4464 16.9724 38.2034 18.2288 37.8249 20.22L35.2228 33.6604H42.8636L45.6786 18.9162C46.6012 17.8021 47.8549 16.9724 49.156 16.9724C51.0011 16.9724 51.7344 18.2288 51.3796 20.22L49.9366 27.7817C49.5581 29.7255 49.4635 31.9537 50.1732 33.6604H57.8139C57.1279 31.9537 57.1989 29.7255 57.5774 27.7817L59.3752 18.3236C60.3451 13.3219 57.1043 10.027 52.8463 10.027V9.9796ZM109.596 19.6273C109.596 27.6158 103.304 34.3241 94.7877 34.3241C89.7727 34.3241 86.1061 31.9537 84.6158 28.3743C84.4975 28.1136 84.19 28.0662 84.0244 28.3032C81.3986 31.93 77.0933 34.3241 72.031 34.3241C65.4074 34.3241 61.0548 30.1996 61.0548 24.629C61.0548 16.688 67.2998 9.9796 75.8159 9.9796C80.8545 9.9796 84.5211 12.3501 86.0351 15.882C86.1534 16.1428 86.4609 16.1902 86.6265 15.9531C89.2523 12.3501 93.5103 9.9559 98.5963 9.9559C105.267 9.9559 109.62 14.0805 109.62 19.6036L109.596 19.6273ZM78.7965 20.9785C78.7965 18.7029 77.2825 17.1858 74.8697 17.1858C71.6761 17.1858 69.0267 19.9592 69.0267 23.349C69.0267 25.672 70.5643 27.1417 72.9062 27.1417C76.0997 27.1417 78.7728 24.3682 78.7728 20.9785H78.7965ZM101.577 20.9785C101.577 18.7029 100.039 17.1858 97.65 17.1858C94.4565 17.1858 91.8307 19.9592 91.8307 23.349C91.8307 25.672 93.3447 27.1417 95.7103 27.1417C98.9038 27.1417 101.601 24.3682 101.601 20.9785H101.577ZM134.529 33.6367H126.888C126.652 33.1152 126.51 32.5226 126.463 31.93C124.972 33.0915 122.299 34.3479 119.484 34.3479C114.02 34.3479 110.968 29.9388 110.921 24.7475C110.921 16.7591 116.527 10.0033 123.837 10.0033C126.108 10.0033 128.331 10.6433 129.68 12.0419L132.022 0H139.662L134.293 27.7343C133.914 29.6781 133.819 31.9063 134.529 33.6367ZM128.331 18.9873C127.503 17.8258 126.06 17.1858 124.57 17.1858C121.14 17.1858 118.964 20.0066 118.964 23.1356C118.822 25.6957 120.454 27.1654 122.749 27.1654C124.002 27.1654 125.848 26.4305 127.101 25.3638L128.308 19.011L128.331 18.9873ZM146.002 27.758L151.348 0H143.708L138.338 27.7343C137.959 29.6781 137.865 31.9063 138.574 33.613H146.215C145.529 31.9063 145.624 29.6781 145.978 27.7343L146.002 27.758ZM169.752 10.7381L162.064 23.823L158.776 10.7381H150.71L156.86 32.4041L150.095 43.0237H158.421L178.552 10.7381H169.705H169.752ZM179.167 24.8423C176.258 24.8423 173.608 27.4024 173.608 30.2707C173.608 32.3093 175.099 33.8975 177.417 33.8975C180.421 33.8975 183.023 31.3374 183.023 28.4691C183.023 26.3831 181.486 24.8423 179.191 24.8423H179.167Z\"})})}function zO(){return(0,fe.jsxs)(\"button\",{type:\"button\",role:\"menuitem\",className:\"sm-rail__menu-item\",onClick:e=>{let n=e.currentTarget.closest(\".sm-admin\");if(!(n instanceof HTMLElement))return;let r=n.getAttribute(\"data-theme\")??document.documentElement.getAttribute(\"data-theme\"),s=(r?r===\"dark\":window.matchMedia(\"(prefers-color-scheme: dark)\").matches)?\"light\":\"dark\";n.setAttribute(\"data-theme\",s);try{localStorage.setItem(nL,s)}catch{}},children:[(0,fe.jsxs)(\"span\",{className:\"sm-when-light\",children:[(0,fe.jsx)(jh,{...BO}),\"Dark mode\"]}),(0,fe.jsxs)(\"span\",{className:\"sm-when-dark\",children:[(0,fe.jsx)(Wh,{...BO}),\"Light mode\"]})]})}function Q({variant:t=\"primary\",size:e=\"md\",className:n,...r}){return(0,fe.jsx)(\"button\",{type:\"button\",className:Ie(\"sm-btn\",`sm-btn--${t}`,e===\"lg\"&&\"sm-btn--lg\",e===\"sm\"&&\"sm-btn--sm\",n),...r})}function rv({variant:t=\"secondary\",icon:e=!1,children:n,...r}){return(0,fe.jsx)(\"a\",{className:Ie(\"sm-btn\",`sm-btn--${t}`,e&&\"sm-btn--icon\"),...r,children:n})}function nt({label:t,tone:e=\"default\",size:n=24,children:r,...o}){return(0,fe.jsx)(\"button\",{type:\"button\",\"aria-label\":t,title:t,className:Ie(\"sm-iconbtn\",e===\"inverse\"&&\"sm-iconbtn--inverse\"),style:{width:n,height:n},...o,children:r})}function dd({checked:t,onChange:e,disabled:n,label:r}){return(0,fe.jsx)(\"button\",{type:\"button\",role:\"switch\",\"aria-checked\":t,\"aria-label\":r,disabled:n,className:\"sm-switch\",onClick:()=>e(!t),children:(0,fe.jsx)(\"span\",{className:\"sm-switch__knob\"})})}function Ei(t){return(0,fe.jsx)(\"button\",{type:\"button\",className:\"sm-grip\",\"aria-label\":\"Drag to reorder\",title:\"Drag to reorder\",...t,children:(0,fe.jsx)(Rh,{size:14,strokeWidth:1.75,\"aria-hidden\":\"true\"})})}function xe({label:t,mark:e,counter:n,action:r,hint:o,error:s,asDiv:a,children:i,style:l,className:u,path:c}){return(0,fe.jsxs)(a?\"div\":\"label\",{className:Ie(\"sm-field\",u),style:l,\"data-sm-path\":c,children:[(t||n||r)&&(0,fe.jsxs)(\"span\",{className:\"sm-field__head\",children:[(0,fe.jsxs)(\"span\",{className:\"sm-label\",children:[t,e]}),(n||r)&&(0,fe.jsxs)(\"span\",{className:\"sm-field__aside\",children:[n&&(0,fe.jsx)(\"span\",{className:\"sm-counter\",children:n}),r]})]}),i,o&&(0,fe.jsx)(\"span\",{className:\"sm-hint\",children:o}),s&&(0,fe.jsx)(\"span\",{className:\"sm-error\",children:s})]})}function ov(){let t=\"Same in every language\";return(0,fe.jsx)(\"span\",{className:\"sm-label__mark\",role:\"img\",\"aria-label\":t,title:t,children:(0,fe.jsx)(Eh,{size:13,strokeWidth:1.75,\"aria-hidden\":\"true\"})})}function ko({left:t,right:e}){return(0,fe.jsxs)(\"header\",{className:\"sm-topbar\",children:[(0,fe.jsx)(\"div\",{className:\"sm-topbar__left\",children:t}),(0,fe.jsx)(\"div\",{className:\"sm-topbar__right\",children:e})]})}function fd({items:t,backHref:e}){return(0,fe.jsxs)(\"div\",{className:\"sm-crumbs\",children:[e&&(0,fe.jsx)(qn,{className:\"sm-back\",href:e,\"aria-label\":\"Back\",children:\"\\u2190\"}),t.map((n,r)=>{let o=r===t.length-1;return(0,fe.jsxs)(ud.Fragment,{children:[r>0&&!n.label.startsWith(\"/\")&&(0,fe.jsx)(\"span\",{className:\"sm-crumbs__sep\",children:\"/\"}),o?(0,fe.jsx)(\"span\",{className:\"sm-crumbs__here\",children:n.label}):n.href?(0,fe.jsx)(qn,{href:n.href,style:{color:\"inherit\"},children:n.label}):(0,fe.jsx)(\"span\",{children:n.label}),n.trailing]},r)})]})}function Yh({tabs:t,value:e,onChange:n}){return(0,fe.jsx)(\"div\",{className:\"sm-tabs\",role:\"tablist\",children:t.map(r=>(0,fe.jsx)(\"button\",{type:\"button\",role:\"tab\",\"aria-selected\":r===e,className:\"sm-tab\",onClick:()=>n(r),children:r},r))})}function ba({options:t,value:e,onChange:n,stretch:r,disabled:o,label:s,option:a,className:i}){return(0,fe.jsx)(\"div\",{className:Ie(\"sm-seg\",r&&\"sm-seg--stretch\",o&&\"sm-seg--disabled\",i),children:t.map(l=>{let u=a?.(l);return(0,fe.jsx)(\"button\",{type:\"button\",className:Ie(\"sm-seg__opt\",u?.className),\"aria-pressed\":l===e,disabled:o||u?.disabled,title:u?.title,onClick:()=>n(l),children:s?s(l):l},l)})})}var u8={published:\"published\",\"unpublished changes\":\"changes\",draft:\"draft\"};function gs({status:t}){let e=u8[t.toLowerCase()]??\"draft\";return(0,fe.jsx)(\"span\",{className:\"sm-badge\",style:{background:`var(--status-${e}-bg)`,color:`var(--status-${e}-fg)`},children:t})}function Yl({state:t,pending:e=!1}){let n={saved:{label:\"Saved\",dot:\"var(--status-saved-dot)\",color:\"var(--text-muted)\"},saving:{label:\"Saving\",dot:\"var(--warn)\",color:\"var(--text-muted)\"},error:{label:\"Save failed \\u2014 retrying\",dot:\"var(--danger)\",color:\"var(--danger)\"},stale:{label:\"Not saved \\u2014 newer version exists\",dot:\"var(--danger)\",color:\"var(--danger)\"},refused:{label:\"Not saved \\u2014 fix the marked fields\",dot:\"var(--danger)\",color:\"var(--danger)\"}},{label:r,dot:o,color:s}=n[e&&t===\"saved\"?\"saving\":t];return(0,fe.jsxs)(\"span\",{className:\"sm-savestate\",\"data-testid\":\"save-status\",style:{color:s},title:r,children:[(0,fe.jsx)(\"span\",{className:\"sm-dot\",style:{background:o}}),r]})}function Zt({children:t,action:e,caps:n,style:r}){return(0,fe.jsxs)(\"div\",{className:Ie(\"sm-sectionlabel\",n&&\"sm-sectionlabel--caps\"),style:r,children:[(0,fe.jsx)(\"span\",{className:\"sm-label\",children:t}),e&&(0,fe.jsx)(\"span\",{style:{color:\"var(--accent)\",fontWeight:600,fontSize:\"var(--text-sm)\"},children:e})]})}function pd({fields:t,onReveal:e}){return t.length===0?null:(0,fe.jsx)(\"ul\",{className:\"sm-fielderr\",children:t.map(n=>(0,fe.jsxs)(\"li\",{children:[e?(0,fe.jsx)(\"button\",{type:\"button\",className:\"sm-fielderr__field\",onClick:()=>e(n.field),children:n.field}):n.field,\": \",n.message]},n.field))})}function Me({tone:t,children:e,onDismiss:n,revealKey:r}){let o=(0,ud.useRef)(null);return(0,ud.useEffect)(()=>{r!==void 0&&o.current?.scrollIntoView({block:\"nearest\",behavior:\"smooth\"})},[r]),(0,fe.jsxs)(\"div\",{ref:o,className:`sm-banner sm-banner--${t}`,role:t===\"error\"?\"alert\":void 0,children:[(0,fe.jsx)(\"div\",{style:{flex:1,minWidth:0},children:e}),n&&(0,fe.jsx)(\"button\",{type:\"button\",onClick:n,\"aria-label\":\"Dismiss\",style:{background:\"transparent\",border:0,color:\"inherit\",cursor:\"pointer\",font:\"inherit\",padding:0},children:\"\\xD7\"})]})}function Ie(...t){return t.filter(Boolean).join(\" \")}function Kr({label:t,value:e,mono:n}){return(0,fe.jsxs)(\"div\",{style:{display:\"flex\",justifyContent:\"space-between\",gap:10,fontSize:\"var(--text-sm)\",color:\"var(--text-muted)\"},children:[(0,fe.jsx)(\"span\",{children:t}),(0,fe.jsx)(\"span\",{style:{color:\"var(--text)\",fontFamily:n?\"var(--font-mono)\":void 0,overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\"},children:e})]})}var qt=T(O(),1);function ys({title:t,titleTrailing:e,actions:n,notice:r,columns:o,rows:s,empty:a,sortable:i}){let u={gridTemplateColumns:(i?[\"24px\",...o.map(c=>c.width)]:o.map(c=>c.width)).join(\" \")};return(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(ko,{left:(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(\"span\",{className:\"sm-title\",children:t}),e]}),right:n}),r&&(0,qt.jsx)(\"div\",{className:\"sm-listnotice\",children:r}),(0,qt.jsx)(\"div\",{className:\"sm-listwrap\",children:(0,qt.jsxs)(\"div\",{className:\"sm-table\",children:[(0,qt.jsxs)(\"div\",{className:\"sm-table__head\",style:u,children:[i&&(0,qt.jsx)(\"span\",{\"aria-hidden\":\"true\"}),o.map(c=>(0,qt.jsx)(\"span\",{children:c.label},c.label))]}),(0,qt.jsxs)(\"div\",{className:\"sm-table__body\",ref:i?.hook.containerRef,children:[s.map((c,d)=>{let f=!!(c.href||c.onClick),p=c.href,h=c.onClick??(p?()=>{sr(p)}:void 0);return(0,qt.jsxs)(\"div\",{style:{...u,...i?.hook.rowStyle(d)},role:f?\"button\":void 0,tabIndex:f?0:void 0,className:Ie(\"sm-row\",f&&\"sm-row--clickable\",i?.hook.rowClass(d)),onClick:h,onKeyDown:g=>{h&&(g.key===\"Enter\"||g.key===\" \")&&(g.preventDefault(),h())},children:[i&&(0,qt.jsx)(\"span\",{className:\"sm-cell sm-cell--grip\",children:i.canDrag(d)&&(0,qt.jsx)(Ei,{...i.hook.handleProps(d)})}),c.cells.map((g,m)=>(0,qt.jsx)(\"span\",{className:\"sm-cell\",children:g},m))]},c.key)}),s.length===0&&(0,qt.jsx)(\"div\",{className:\"sm-empty\",children:a??\"Nothing here yet.\"})]})]})})]})}var FO=t=>`page:${t}`,sL=t=>t.startsWith(\"collection:\")?t.slice(11):null;function HO(t){return t.filter(e=>e.slug===void 0)}function c8(t,e){let n=t.fixed&&e.addresses[t.fixed]?sL(t.fixed):null;return n===null?null:e.collections.find(r=>r.name===n)??null}function aL(t,e){return!!t.fixed&&e.addresses[t.fixed]!==void 0}function d8(t,e,n){for(let[r,o]of Object.entries(e.addresses)){let s=o[n];if(s===void 0||o[e.locales.default]===e.homePageSlug||`/${s}`!==t)continue;let a=sL(r),i=a?e.collections.find(l=>l.name===a)?.title??a:e.pages.find(l=>FO(l.name)===r)?.title??r;return{key:r,label:a?`the ${i} collection`:`the ${i} page`}}return null}function f8(t,e,n){if(t===null)return null;let r=d8(t,e,n);return r?`${t} is set in code for ${r.label}, so visitors don't see this page. Rename or move it.`:null}function Zh(t,e,n){if(t===null)return;let r=Object.values(e.addresses).map(o=>o[n]).filter(o=>o!==void 0&&`/${o}`.startsWith(`${t}/`));return r.length===0?void 0:r.map(o=>`/${o} stays where it is \\u2014 it is set in code.`).join(\" \")}function p8(t,e,n){return t.locales[e]?.title??t.locales[n.locales.default]?.title??Object.values(t.locales)[0]?.title??t.id}function hd(t,e){return t.locales[e.locales.default]?e.locales.default:Object.keys(t.locales)[0]}function ar(t){return t.status!==\"published\"?\"draft\":t.publishedVersionId===null||t.publishedVersionId===t.draftVersionId?\"published\":\"draft edits\"}function $O(t,e,n,r){let o={locales:e.locales,homePageSlug:e.homePageSlug,addresses:e.addresses},s=l=>e.pages.find(u=>u.name===l)?.title??l,a=[],i=(l,u,c)=>{l.forEach((d,f)=>{let p=d.record,h=p.locales[n],g=h!==void 0,m=c8(p,e),y=p.parentId===null&&p.locales[e.locales.default]?.slug===e.homePageSlug,b=!r.has(p.id),x=!!p.fixed&&e.addresses[p.fixed]===void 0;a.push({id:p.id,parentId:c,depth:u,index:f,siblingCount:l.length,hasChildren:d.children.length>0,expanded:b,title:p8(p,n,e),path:d.path,present:g,locales:Object.keys(p.locales),kind:m?\"mount\":p.template===null?\"folder\":\"page\",collection:m?.name??null,fixed:aL(p,e),conflict:p.fixed?null:f8(d.path,e,n),orphan:x,isHome:y,template:p.template,templateTitle:m?p.template===null?\"Collection\":`Collection \\xB7 ${s(p.template)}`:p.template===null?\"Path\":s(p.template),status:!h||p.template===null?null:ar(h),canHaveChildren:g&&!m&&!y&&!x&&u+1<e.pageDepth,record:p}),b&&i(d.children,u+1,p.id)})};return i(TO(t,n,o),0,null),a}var UO=t=>!t.orphan,h8=t=>t.fixed||t.isHome;function iL(t,e){let n=t.filter(r=>r.parentId===e);return n.length===0?0:1+Math.max(...n.map(r=>iL(t,r.id)))}function jO(t,e,n,r,o,s,a=20){let i=t.filter((y,b)=>b!==e),l=n>0?i[n-1]:null,u=n<i.length?i[n]:null,c=l?l.depth+1:0,d=u?u.depth:0;if(d>c)return null;let f=t[e].depth+Math.round(r/a),p=Math.max(d,Math.min(c,f));if(p+o>=s||p>0&&h8(t[e]))return null;let h=null;if(p>0){for(let y=n-1;y>=0;y--)if(i[y].depth===p-1){h=i[y];break}if(!h||!h.canHaveChildren)return null}let g=h?.id??null;if(h&&h.hasChildren&&!h.expanded)return{depth:p,parentId:g,index:void 0};let m=0;for(let y=0;y<n;y++)i[y].parentId===g&&m++;return{depth:p,parentId:g,index:m}}function bs(t){return t===\"published\"?\"Published\":t===\"draft edits\"?\"Unpublished changes\":\"Draft\"}function qO(t,e){return t===null?{publish:!1,discard:!1,unpublish:!1}:{publish:t!==\"published\"||e,discard:t===\"draft edits\",unpublish:t===\"published\"||t===\"draft edits\"}}var Co=T(O(),1),VO=3,Zl=t=>t.charAt(0).toUpperCase()+t.slice(1);function md({registry:t,present:e,parentLocales:n,value:r,adding:o,onSwitch:s,onAdd:a}){let i=t.locales.supported,l=i.filter(d=>!e.includes(d)&&d!==r),u=d=>!n.includes(d),c=d=>`add ${d} to the parent first`;return i.length<=VO?(0,Co.jsx)(ba,{options:i,value:r,disabled:o,label:Zl,className:\"sm-seg--locale\",option:d=>{if(l.includes(d))return u(d)?{disabled:!0,title:c(d),className:\"sm-seg__opt--absent\"}:{title:`Not in ${d} yet`,className:\"sm-seg__opt--absent\"}},onChange:s}):(0,Co.jsxs)(\"select\",{className:\"sm-input\",style:{width:\"auto\"},value:r,\"aria-label\":\"Locale\",onChange:d=>{let f=d.target.value;f.startsWith(\"+\")?a(f.slice(1)):s(f)},children:[e.map(d=>(0,Co.jsx)(\"option\",{value:d,children:Zl(d)},d)),!e.includes(r)&&(0,Co.jsxs)(\"option\",{value:r,children:[Zl(r),\" (not yet)\"]}),l.length>0&&(0,Co.jsx)(\"optgroup\",{label:\"Add locale\",disabled:o,children:l.map(d=>u(d)?(0,Co.jsxs)(\"option\",{value:`+${d}`,disabled:!0,title:c(d),children:[\"+ \",Zl(d),\" \\u2014 \",c(d)]},d):(0,Co.jsxs)(\"option\",{value:`+${d}`,children:[\"+ \",Zl(d)]},d))})]})}function Ti({locales:t,value:e,onChange:n}){return t.length<=VO?(0,Co.jsx)(ba,{options:t,value:e,onChange:n,label:Zl,className:\"sm-seg--locale\"}):(0,Co.jsx)(\"select\",{className:\"sm-input\",style:{width:\"auto\"},value:e,\"aria-label\":\"Locale\",onChange:r=>n(r.target.value),children:t.map(r=>(0,Co.jsx)(\"option\",{value:r,children:Zl(r)},r))})}var Lo=T(te(),1);function KO(t,e,n){let r=0;return t.forEach((o,s)=>{s!==e&&n>o.top+o.height/2&&r++}),r}function lL(t,e,n){let r=t[e]?.height??0;return t.map((o,s)=>s===e?0:n>e&&s>e&&s<=n?-r:n<e&&s>=n&&s<e?r:0)}function GO(t,e,n){if(n===e||!t[e]||!t[n])return 0;let r=t[e];return n>e?t[n].top+t[n].height-r.height-r.top:t[n].top-r.top}function WO(t,e,n){let r=t[e];if(!r||t.length===0)return n;let o=Math.min(...t.map(a=>a.top)),s=Math.max(...t.map(a=>a.top+a.height));return Math.max(o-r.top,Math.min(s-r.height-r.top,n))}function XO(t,e,n){let r=e+n;return r<0||r>=t?null:r}var m8=4,sv=32,JO=14,YO=\"transform 120ms ease\",g8=t=>{for(let e=t;e;e=e.parentElement){let n=window.getComputedStyle(e).overflowY;if(n===\"auto\"||n===\"scroll\")return e}return null},y8=(t,e)=>t===e||t!==null&&e!==null&&t.depth===e.depth&&t.parentId===e.parentId&&t.index===e.index,b8=()=>{let t=e=>{e.stopPropagation(),e.preventDefault()};window.addEventListener(\"click\",t,{capture:!0,once:!0}),window.setTimeout(()=>window.removeEventListener(\"click\",t,{capture:!0}),0)},ZO=(t,e)=>{let n=t.getBoundingClientRect().top;return Array.from(t.children).slice(0,e).map(r=>{let o=r.getBoundingClientRect();return{top:o.top-n,height:o.height}})};function vs(t){let e=(0,Lo.useRef)(null),n=(0,Lo.useRef)(t);n.current=t;let r=(0,Lo.useRef)(null),[o,s]=(0,Lo.useState)(null),[a,i]=(0,Lo.useState)(null),l=(0,Lo.useRef)(null);l.current=a,(0,Lo.useLayoutEffect)(()=>{let b=r.current,x=e.current;!o||!b||b.rects||!x||(b.rects=ZO(x,n.current.count),b.scroller=g8(x))},[o!==null]),(0,Lo.useEffect)(()=>()=>r.current?.detach(),[]);let u=(b,x,v,S)=>{let E=n.current.onDrop(b,x,v);if(E&&typeof E.then==\"function\"){let w={from:b,to:x,rects:S};i(w);let k=()=>i(A=>A===w?null:A);E.then(k,k)}},c=(b,x)=>{let v=r.current,S=e.current;if(!v||!v.started||!v.rects||!S)return;let{project:E}=n.current,w=x-S.getBoundingClientRect().top-v.startCY,k=v.rects[v.from],A=KO(v.rects,v.from,k.top+w+k.height/2),L=WO(v.rects,v.from,w),_=E?E(A,v.from,b-v.startX):null,P=!E||_!==null;v.dy=L;let D=S.children[v.from];D&&(D.style.transform=`translateY(${L}px)`),(A!==v.to||P!==v.valid||!y8(_,v.projection))&&(v.to=A,v.valid=P,v.projection=_,s({from:v.from,to:A,projection:_,valid:P}))},d=()=>{let b=r.current;if(!b||!b.started)return;let x=b.scroller;if(x){let v=x.getBoundingClientRect(),S=0;b.lastY<v.top+sv?S=-Math.min(JO,(v.top+sv-b.lastY)/2):b.lastY>v.bottom-sv&&(S=Math.min(JO,(b.lastY-(v.bottom-sv))/2)),S!==0&&(x.scrollTop+=S,c(b.lastX,b.lastY))}b.raf=window.requestAnimationFrame(d)},f=b=>{let x=r.current;if(!x||(x.detach(),window.cancelAnimationFrame(x.raf),document.body.style.userSelect=\"\",r.current=null,!x.started))return;b8();let v=x.to!==x.from||x.projection!==null;b&&x.valid&&x.rects&&v&&u(x.from,x.to,x.projection,x.rects),s(null)},p=b=>x=>{if(x.button!==0||r.current||l.current)return;let v=e.current;if(!v)return;x.preventDefault();let S=A=>{let L=r.current;if(L){if(L.lastX=A.clientX,L.lastY=A.clientY,!L.started){if(Math.abs(A.clientX-L.startX)+Math.abs(A.clientY-L.startY)<m8)return;L.started=!0,document.body.style.userSelect=\"none\",n.current.onDragStart?.(L.from),s({from:L.from,to:L.from,projection:null,valid:!0}),L.raf=window.requestAnimationFrame(d);return}A.preventDefault(),c(A.clientX,A.clientY)}},E=()=>f(!0),w=()=>f(!1),k=A=>{A.key===\"Escape\"&&f(!1)};r.current={from:b,startX:x.clientX,startY:x.clientY,startCY:x.clientY-v.getBoundingClientRect().top,lastX:x.clientX,lastY:x.clientY,started:!1,rects:null,scroller:null,raf:0,to:b,dy:0,projection:null,valid:!0,detach(){window.removeEventListener(\"pointermove\",S),window.removeEventListener(\"pointerup\",E),window.removeEventListener(\"pointercancel\",w),window.removeEventListener(\"keydown\",k)}},window.addEventListener(\"pointermove\",S),window.addEventListener(\"pointerup\",E),window.addEventListener(\"pointercancel\",w),window.addEventListener(\"keydown\",k)},h=b=>x=>{if(x.stopPropagation(),x.key!==\"ArrowUp\"&&x.key!==\"ArrowDown\"||(x.preventDefault(),r.current||l.current))return;let v=e.current,{count:S,project:E}=n.current,w=XO(S,b,x.key===\"ArrowUp\"?-1:1);if(w===null||!v)return;let k=E?E(w,b,0):null;E&&k===null||u(b,w,k,ZO(v,S))},g=b=>{b.stopPropagation(),b.preventDefault()};return{containerRef:e,handleProps:b=>({onPointerDown:p(b),onKeyDown:h(b),onClick:g}),rowStyle:b=>{let x=r.current;return o&&x?.rects?b===o.from?{transform:`translateY(${x.dy}px)`,transition:\"none\"}:{transform:`translateY(${lL(x.rects,o.from,o.to)[b]??0}px)`,transition:YO}:a?{transform:`translateY(${b===a.from?GO(a.rects,a.from,a.to):lL(a.rects,a.from,a.to)[b]??0}px)`,transition:YO}:{}},rowClass:b=>{if(!(!o||b!==o.from))return o.valid?\"sm-drag--lifted\":\"sm-drag--lifted sm-drag--invalid\"},active:o}}var gd=T(te(),1);var QO=(0,gd.createContext)(tv),eD=QO.Provider;function Qe(){let t=(0,gd.useContext)(QO);return(0,gd.useCallback)(e=>RO(t,e),[t])}var Ql=T(O(),1);function an({message:t,back:e=!0,onRetry:n}){let r=Qe();return(0,Ql.jsx)(\"div\",{style:{display:\"grid\",placeItems:\"center\",flex:1,padding:40},children:(0,Ql.jsxs)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:12,maxWidth:420},children:[(0,Ql.jsx)(Me,{tone:\"error\",children:t}),n&&(0,Ql.jsx)(Q,{variant:\"secondary\",style:{alignSelf:\"flex-start\"},onClick:n,children:\"Retry\"}),e&&(0,Ql.jsx)(\"a\",{href:r(\"/pages\"),style:{fontSize:\"var(--text-md)\"},children:\"\\u2190 Back to pages\"})]})})}var tD=\"smoodly-locale\";function v8(t,e){return t&&e.supported.includes(t)?t:e.default}function xs(t){let e=null;try{e=window.localStorage.getItem(tD)}catch{}return v8(e,t)}function Vo(t){try{window.localStorage.setItem(tD,t)}catch{}}var eu={title:\"Discard unsaved changes?\",body:\"The draft goes back to the published version. Every edit since the last publish is lost.\",confirmLabel:\"Discard changes\",destructive:!0},Qh=new Set,yd=[],x8=0,nD=()=>{for(let t of Qh)t()};function bd(t){let e=t.option?.checked??!1;if(Qh.size===0){let n=[t.title,t.body].filter(Boolean).join(`\n\n`),r=typeof window<\"u\"&&typeof window.confirm==\"function\"?window.confirm(n):!1;return Promise.resolve({yes:r,checked:e})}return new Promise(n=>{let r=++x8,o={id:r,options:t,answer(s,a=e){yd.some(i=>i.id===r)&&(yd=yd.filter(i=>i.id!==r),nD(),n({yes:s,checked:a}))}};yd=[...yd,o],nD()})}var rt=t=>bd(t).then(e=>e.yes),rD=()=>yd[0]??null;function oD(t){return Qh.add(t),()=>{Qh.delete(t)}}function vd(t){return Qh.size===0?(typeof window<\"u\"&&typeof window.alert==\"function\"&&window.alert(`${t.title}\n\n${t.message}`),Promise.resolve()):bd({title:t.title,body:t.message,confirmLabel:\"OK\",single:!0}).then(()=>{})}var em={title:\"Change the live URL?\",body:\"This is published. With a redirect, visitors and search engines who open the old address are sent to the new one.\",confirmLabel:\"Change URL\"},uL={label:\"Redirect the old address\",checked:!0};function tm(t){return t.status===\"published\"&&t.from!==null&&t.to!==t.from}async function nm(t,e,n){if(!tm(t))return{ok:!0,redirect:!0};let r=n?`${em.body} ${n}`:em.body,{yes:o,checked:s}=await bd({...em,body:r,option:{...uL},subject:e});return{ok:o,redirect:s}}var wd=T(te(),1);var xd=T(te(),1),sD=T(Tl(),1);var va=T(O(),1);function w8(){return typeof document>\"u\"?null:document.querySelector(\".sm-admin\")??document.body}function av({title:t,role:e=\"dialog\",describedBy:n,onClose:r,actions:o,className:s,children:a}){let i=(0,xd.useRef)(null),u=`sm-dialog-title${(0,xd.useId)()}`;(0,xd.useEffect)(()=>{let p=typeof document<\"u\"?document.activeElement:null,h=g=>{g.key===\"Escape\"&&(g.stopPropagation(),r())};return window.addEventListener(\"keydown\",h,!0),()=>{window.removeEventListener(\"keydown\",h,!0),p?.focus?.()}},[r]);let c=p=>{if(p.key!==\"Tab\"||!i.current)return;let h=Array.from(i.current.querySelectorAll(\"button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled)\"));if(h.length===0)return;let g=h[0],m=h[h.length-1];p.shiftKey&&document.activeElement===g?(p.preventDefault(),m.focus()):!p.shiftKey&&document.activeElement===m&&(p.preventDefault(),g.focus())},d=(0,va.jsx)(\"div\",{className:\"sm-scrim\",onClick:r,children:(0,va.jsxs)(\"div\",{className:Ie(\"sm-dialog\",s),role:e,\"aria-modal\":\"true\",\"aria-labelledby\":u,\"aria-describedby\":n,ref:i,onClick:p=>p.stopPropagation(),onKeyDown:c,children:[(0,va.jsx)(\"div\",{className:\"sm-dialog__head\",children:(0,va.jsxs)(\"div\",{className:\"sm-dialog__titlerow\",children:[(0,va.jsx)(\"h2\",{className:\"sm-dialog__title\",id:u,children:t}),(0,va.jsx)(\"button\",{type:\"button\",className:\"sm-dialog__close\",\"aria-label\":\"Close\",onClick:r,children:\"\\xD7\"})]})}),a,(0,va.jsx)(\"div\",{className:\"sm-dialog__actions\",children:o})]})}),f=w8();return f?(0,sD.createPortal)(d,f):d}function cL(t,e){return t===\"\"||t===Jl(e)}var S8=\"This title has no letters a slug can use \\u2014 type one, like novosti.\";function xa(t){let e=Jl(t);return e!==\"\"?e:/[\\p{L}\\p{N}]/u.test(t)?t:\"\"}function iv(t){return typeof t==\"string\"&&t.trim()!==\"\"&&Jl(t)===\"\"?S8:void 0}function aD(t,e,n,r,o){let s={...t,[e]:n};if(r===void 0||e!==r||!o)return s;let a=typeof t.slug==\"string\"?t.slug:\"\",i=typeof t[r]==\"string\"?t[r]:\"\";return cL(a,i)?{...s,slug:Jl(typeof n==\"string\"?n:\"\")}:s}var Qt=T(O(),1);function lv({title:t,submitLabel:e,fields:n,templates:r=[],parentPath:o,initial:s,onClose:a,onSubmit:i}){let[l,u]=(0,wd.useState)({title:s?.title??\"\",slug:s?.slug??\"\",template:s?.template??r[0]?.name??null}),[c,d]=(0,wd.useState)(null),[f,p]=(0,wd.useState)(!1),h=n.template&&r.length>1,g=o===void 0?void 0:o===\"/\"?\"/\":`${o}/`,m=v=>u(S=>({...S,title:v,slug:n.slug&&cL(S.slug,S.title)?Jl(v):S.slug})),y=()=>u(v=>({...v,slug:xa(v.slug)})),b=async v=>{if(v.preventDefault(),f)return;d(null),p(!0);let S=xa(l.slug.trim());u(E=>({...E,slug:S})),d(await i({...l,title:l.title.trim(),slug:S})),p(!1)},x=`sm-page-form${(0,wd.useId)()}`;return(0,Qt.jsx)(av,{title:t,onClose:a,actions:(0,Qt.jsxs)(Qt.Fragment,{children:[(0,Qt.jsx)(Q,{variant:\"secondary\",onClick:a,children:\"Cancel\"}),(0,Qt.jsx)(\"button\",{type:\"submit\",form:x,className:\"sm-btn sm-btn--primary\",disabled:f,children:f?\"Saving\\u2026\":e})]}),children:(0,Qt.jsxs)(\"form\",{id:x,className:\"sm-dialog__form\",onSubmit:b,children:[n.title&&(0,Qt.jsx)(xe,{label:\"Title\",children:(0,Qt.jsx)(\"input\",{className:\"sm-input\",required:!0,autoFocus:!0,value:l.title,onChange:v=>m(v.target.value)})}),n.slug&&(0,Qt.jsx)(xe,{label:\"Slug\",hint:(l.slug===\"\"?iv(l.title):void 0)??\"The URL segment: lowercase letters, digits and hyphens.\",children:g?(0,Qt.jsxs)(\"span\",{className:\"sm-inputwrap\",children:[(0,Qt.jsx)(\"span\",{className:\"sm-prefix\",children:g}),(0,Qt.jsx)(\"input\",{className:\"sm-input sm-input--mono\",required:!0,autoFocus:!n.title,value:l.slug,onChange:v=>u(S=>({...S,slug:v.target.value})),onBlur:y})]}):(0,Qt.jsx)(\"input\",{className:\"sm-input sm-input--mono\",required:!0,autoFocus:!n.title,value:l.slug,onChange:v=>u(S=>({...S,slug:v.target.value})),onBlur:y})}),h&&(0,Qt.jsx)(xe,{label:\"Page type\",children:(0,Qt.jsx)(\"select\",{className:\"sm-select\",autoFocus:!n.title&&!n.slug,value:l.template??\"\",onChange:v=>u(S=>({...S,template:v.target.value})),children:r.map(v=>(0,Qt.jsx)(\"option\",{value:v.name,children:v.title},v.name))})}),c&&(0,Qt.jsx)(Me,{tone:\"error\",children:c})]})})}var wa=T(te(),1),iD={status:\"off\",others:[]},lD=(0,wa.createContext)(null),uD=lD.Provider,Sa=()=>(0,wa.useContext)(lD);function Ao(){let t=Sa();return(0,wa.useSyncExternalStore)(t?t.subscribe:()=>()=>{},t?t.getState:()=>iD,()=>iD)}function Sd(t){let e=Sa(),n=t?.kind,r=t?.id,o=t?.locale;(0,wa.useEffect)(()=>{if(!(!e||!n||!r||!o))return e.track({kind:n,id:r,locale:o}),()=>e.track(null)},[e,n,r,o])}function kd(t,e){let n=Sa(),r=t?.kind,o=t?.id,s=t?.locale;(0,wa.useEffect)(()=>{if(!(!n||!r||!o||!s))return n.onSaved(a=>{a.kind===r&&a.id===o&&a.locale===s&&e(a)})})}var k8=(t,e)=>t.kind===e.kind&&t.id===e.id&&t.locale===e.locale,C8=t=>t.split(\"@\")[0];function Eo(t,e){return[...new Set(t.filter(n=>k8(n,e)).map(n=>C8(n.email)))].sort()}var cD=t=>typeof t==\"object\"&&t!==null&&[\"page\",\"entry\",\"global\"].includes(t.kind)&&typeof t.id==\"string\"&&typeof t.locale==\"string\";function dD(t){let e={status:\"off\",others:[]},n=null,r=null,o=new Set,s=new Set,a=l=>{e={...e,...l};for(let u of o)u()},i=()=>{if(!n)return[];let l=[];for(let[u,c]of Object.entries(n.presenceState()))if(u!==t.email)for(let d of c)cD(d)&&l.push({email:u,kind:d.kind,id:d.id,locale:d.locale});return l};return{join(){if(!n){try{n=t.connect()}catch{a({status:\"failed\"});return}a({status:\"joining\"}),n.onSync(()=>a({others:i()})),n.onBroadcast(\"saved\",l=>{let{email:u,savedAt:c}=l;if(!cD(l)||typeof u!=\"string\"||u===t.email)return;let d={kind:l.kind,id:l.id,locale:l.locale,email:u,savedAt:typeof c==\"string\"?c:null};for(let f of s)f(d)}),n.subscribe(l=>{l===\"SUBSCRIBED\"?(a({status:\"joined\"}),r&&n&&n.track(r).catch(()=>{})):(l===\"CHANNEL_ERROR\"||l===\"TIMED_OUT\"||l===\"CLOSED\")&&a({status:\"failed\",others:[]})})}},track(l){r=l,!(e.status!==\"joined\"||!n)&&(l?n.track(l):n.untrack()).catch(()=>{})},announce(l,u){e.status!==\"joined\"||!n||n.send({type:\"broadcast\",event:\"saved\",payload:{...l,email:t.email,savedAt:u}}).catch(()=>{})},setAuth(l){n&&n.setAuth(l).catch(()=>{})},onSaved(l){return s.add(l),()=>{s.delete(l)}},getState:()=>e,subscribe(l){return o.add(l),()=>{o.delete(l)}},dispose(){let l=n;n=null,a({status:\"off\",others:[]}),l&&l.unsubscribe().catch(()=>{})}}}function fD(t,e){let{data:n}=t.onAuthStateChange((r,o)=>{r===\"TOKEN_REFRESHED\"&&o&&e.setAuth(o.access_token)});return()=>n.subscription.unsubscribe()}var dL=T(O(),1),L8=t=>t.length===1?`${t[0]} is editing`:`${t.join(\", \")} are editing`;function Cd({names:t}){if(t.length===0)return null;let e=L8(t);return(0,dL.jsx)(\"span\",{className:\"sm-lock\",role:\"img\",\"aria-label\":e,title:e,children:(0,dL.jsx)(Uh,{size:14,strokeWidth:1.5,\"aria-hidden\":\"true\"})})}var qe=T(O(),1);function pD({ops:t,registry:e}){let{others:n}=Ao(),r=Qe(),[o,s]=(0,Ko.useState)(null),[a,i]=(0,Ko.useState)(null),[l,u]=(0,Ko.useState)(()=>new Set),[c,d]=(0,Ko.useState)(null),[f,p]=(0,Ko.useState)(null),[h,g]=(0,Ko.useState)(()=>xs(e.locales)),m=e.locales.supported.length>1,y=M=>{g(M),Vo(M)},b=(0,Ko.useCallback)(()=>t.pages.list().then(M=>M.ok?s(M.data):i(M.message)).catch(()=>i(\"Couldn't reach the server.\")),[t]);(0,Ko.useEffect)(()=>{b()},[b]);let x=o?$O(o,e,h,l):[],v=HO(e.pages),S=v.length===0,E=M=>u(V=>{let I=new Set(V);return I.has(M)?I.delete(M):I.add(M),I}),w=vs({count:x.length,onDragStart:M=>{let V=x[M];V.hasChildren&&V.expanded&&E(V.id)},project:(M,V,I)=>jO(x,V,M,I,iL(o??[],x[V].id),e.pageDepth),onDrop:async(M,V,I)=>{let U=x[M];if(!I||I.parentId===U.parentId&&I.index===U.index)return;let me=U.record.locales[h],Oe=await nm({status:me?.status,from:U.parentId??\"\",to:I.parentId??\"\"},{name:U.title,path:U.path},Zh(U.path,e,h));if(!Oe.ok)return;if(!await L(()=>t.pages.move(U.id,{parentId:I.parentId,index:I.index,redirect:Oe.redirect})))throw new Error(\"move refused\")}}),k=M=>{sr(r(`/pages/${encodeURIComponent(M)}?locale=${encodeURIComponent(h)}`))},A=async(M,V)=>{let I;try{I=await M()}catch{I={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}return I.ok?(V?.(I.data),await b(),null):I.message},L=async(M,V)=>{let I=await A(M,V);return I&&vd({title:\"That didn't work\",message:I}),I===null},_=(M,V)=>{V===\"page\"&&S||p({kind:\"new\",parentId:M,node:V})},P=M=>{if(!S){if(v.length===1){L(()=>t.pages.setTemplate(M.id,v[0].name),V=>k(V.id));return}p({kind:\"template\",row:M})}},D=M=>{M.record.locales[h]&&p({kind:\"rename\",row:M})},F=()=>p(null),j=M=>{if(!M)return\"/\";let V=M.lastIndexOf(\"/\");return V<=0?\"/\":M.slice(0,V)},K=async M=>{if(!f)return null;if(f.kind===\"new\"){let me=f.node===\"page\"?M.template:null;return f.node===\"page\"&&!me?\"Choose a page type.\":A(()=>t.pages.create({parentId:f.parentId,locale:h,slug:M.slug,title:M.title,template:me}),Oe=>{me&&k(Oe.id)})}if(f.kind===\"template\")return M.template?A(()=>t.pages.setTemplate(f.row.id,M.template),me=>k(me.id)):\"Choose a page type.\";let{row:V}=f,I=V.record.locales[h];if(!I)return null;if(V.isHome)return A(()=>t.pages.rename(V.id,{locale:h,title:M.title}));let U=await nm({status:I.status,from:I.slug,to:M.slug},{name:V.title,path:V.path},Zh(V.path,e,h));return U.ok?A(()=>t.pages.rename(V.id,{locale:h,title:M.title,slug:M.slug,redirect:U.redirect})):null},ve=async M=>{let V=hd(M.record,e);await rt({title:`Add this page to ${h}?`,body:`Its ${V} content is copied as the first ${h} draft. Nothing is published until you publish it.`,confirmLabel:`Add to ${h}`,subject:{name:M.title,path:M.record.locales[V]?M.path:null}})&&L(()=>t.pages.addLocale(M.id,h,{from:V}),U=>{U.template!==null&&k(U.id)})},ue=async M=>{await rt({title:`Remove this page from ${h}?`,body:`Its ${h} content and history are deleted. Other languages are not affected.`,confirmLabel:`Remove from ${h}`,destructive:!0,subject:{name:M.title,path:M.path}})&&L(()=>t.pages.removeLocale(M.id,h))},Ue=async M=>{let V=M.locales.length>1?` in every language (${M.locales.join(\", \")})`:\"\";await rt({title:M.hasChildren?\"Delete this page and everything under it?\":\"Delete this page?\",body:`The page${V} and its history are removed. Links pointing to it stop working. This cannot be undone.`,confirmLabel:\"Delete page\",destructive:!0,subject:{name:M.title,path:M.path}})&&L(()=>t.pages.delete(M.id))},Re=M=>{let V=[];return M.orphan?(M.hasChildren||V.push({label:\"Delete\",run:()=>Ue(M)}),V):M.present?(M.canHaveChildren&&!S&&V.push({label:\"New subpage\",run:()=>_(M.id,\"page\")}),M.canHaveChildren&&V.push({label:\"New subpath\",run:()=>_(M.id,\"folder\")}),M.kind===\"folder\"&&!S&&V.push({label:\"Add page here\",run:()=>P(M)}),M.fixed||V.push({label:\"Rename\\u2026\",run:()=>D(M)}),m&&!M.fixed&&!M.isHome&&M.locales.length>1&&V.push({label:`Remove from ${h}`,run:()=>ue(M)}),!M.fixed&&!M.isHome&&!M.hasChildren&&V.push({label:\"Delete\",run:()=>Ue(M)}),V):(M.fixed||V.push({label:`Add ${h}`,run:()=>ve(M)}),V)},je=M=>{M.present?M.template!==null?k(M.id):M.kind===\"mount\"&&M.collection?sr(r(`/${M.collection}`)):M.hasChildren&&E(M.id):!M.orphan&&!M.fixed&&ve(M)};if(a)return(0,qe.jsx)(an,{message:a});let Ke=c?Re(c.row):[];return(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(ys,{title:\"Pages\",titleTrailing:m&&(0,qe.jsx)(Ti,{locales:e.locales.supported,value:h,onChange:y}),actions:(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Q,{variant:\"secondary\",onClick:()=>_(null,\"folder\"),children:\"+ New path\"}),(0,qe.jsx)(Q,{onClick:()=>_(null,\"page\"),disabled:S,title:S?\"Every page registration is fixed \\u2014 add an open one (a page schema with no `slug`) to create pages here.\":void 0,children:\"+ New page\"})]}),columns:[{label:\"Title\",width:\"minmax(160px,1fr)\"},{label:\"URL\",width:\"minmax(140px,260px)\"},{label:\"Page type\",width:\"minmax(100px,160px)\"},{label:\"Status\",width:\"170px\"},{label:\"\",width:\"32px\"}],empty:o?\"No pages yet.\":\"Loading\\u2026\",sortable:{hook:w,canDrag:M=>UO(x[M])},rows:x.map((M,V)=>{let I=M.present?void 0:{opacity:.45},U=w.active?.from===V?w.active:null,me=U?.projection?U.projection.depth:M.depth;return{key:M.id,onClick:()=>je(M),cells:[(0,qe.jsxs)(\"span\",{className:M.hasChildren?\"sm-cell sm-cell--tree sm-cell--parent\":\"sm-cell sm-cell--tree\",style:{paddingLeft:me*20,...I},children:[(0,qe.jsx)(\"button\",{type:\"button\",className:\"sm-chevron\",\"aria-label\":M.expanded?\"Collapse\":\"Expand\",\"aria-expanded\":M.hasChildren?M.expanded:void 0,style:{visibility:M.hasChildren?\"visible\":\"hidden\"},onClick:Oe=>{Oe.stopPropagation(),E(M.id)},onKeyDown:Oe=>Oe.stopPropagation(),children:M.expanded?\"\\u25BE\":\"\\u25B8\"}),M.conflict?(0,qe.jsxs)(\"span\",{style:{display:\"flex\",flexDirection:\"column\",minWidth:0},children:[(0,qe.jsx)(\"span\",{style:{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\"},children:M.title}),(0,qe.jsx)(\"span\",{className:\"sm-cell--warn\",title:M.conflict,children:M.conflict})]}):(0,qe.jsx)(\"span\",{style:{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\"},children:M.title}),(0,qe.jsx)(Cd,{names:Eo(n,{kind:\"page\",id:M.id,locale:h})})]},\"t\"),M.orphan?(0,qe.jsx)(\"span\",{className:\"sm-cell sm-cell--muted\",children:\"\\u2014\"},\"p\"):M.present?(0,qe.jsx)(\"span\",{className:\"sm-cell sm-cell--mono\",children:M.path},\"p\"):(0,qe.jsx)(\"span\",{className:\"sm-cell sm-cell--muted\",children:M.fixed?`not in ${h}`:`not in ${h} \\u2014 click to add`},\"p\"),(0,qe.jsx)(\"span\",{className:\"sm-cell sm-cell--muted\",style:I,children:M.orphan?\"No longer in code\":M.templateTitle},\"k\"),M.status?(0,qe.jsx)(gs,{status:bs(M.status)},\"s\"):(0,qe.jsx)(\"span\",{className:\"sm-cell sm-cell--muted\",children:\"\\u2014\"},\"s\"),(0,qe.jsx)(\"button\",{type:\"button\",className:\"sm-rowmenu\",\"aria-label\":\"Row menu\",onClick:Oe=>{Oe.stopPropagation(),d({row:M,x:Oe.clientX,y:Oe.clientY})},onKeyDown:Oe=>Oe.stopPropagation(),children:\"\\xB7\\xB7\\xB7\"},\"m\")]}})}),c&&(0,qe.jsx)(\"div\",{style:{position:\"fixed\",inset:0,zIndex:60},onClick:()=>d(null),children:(0,qe.jsxs)(\"div\",{className:\"sm-picker\",onClick:M=>M.stopPropagation(),style:{position:\"absolute\",left:Math.max(12,Math.min(c.x-280,window.innerWidth-312)),top:Math.min(c.y+8,Math.max(12,window.innerHeight-300))},children:[Ke.map(M=>(0,qe.jsx)(\"button\",{type:\"button\",className:\"sm-picker__item\",onClick:()=>{d(null),M.run()},children:M.label},M.label)),Ke.length===0&&(0,qe.jsx)(\"p\",{style:{color:\"var(--text-muted)\",padding:10},children:c?.row.orphan?\"No longer in code \\u2014 move its child pages out, then delete it.\":\"Owned by code \\u2014 nothing to change here.\"})]})}),f?.kind===\"new\"&&(0,qe.jsx)(lv,{title:f.node===\"page\"?f.parentId?\"New subpage\":\"New page\":f.parentId?\"New subpath\":\"New path\",submitLabel:f.node===\"page\"?\"Create page\":\"Create path\",fields:{title:!0,slug:!0,template:f.node===\"page\"},templates:v,parentPath:f.parentId?x.find(M=>M.id===f.parentId)?.path??\"/\":\"/\",onClose:F,onSubmit:M=>K(M).then(V=>(V===null&&F(),V))}),f?.kind===\"template\"&&(0,qe.jsx)(lv,{title:\"Add page here\",submitLabel:\"Add page\",fields:{template:!0},templates:v,onClose:F,onSubmit:M=>K(M).then(V=>(V===null&&F(),V))}),f?.kind===\"rename\"&&(0,qe.jsx)(lv,{title:\"Rename page\",submitLabel:\"Rename\",fields:{title:!0,slug:!f.row.isHome},initial:{title:f.row.record.locales[h]?.title??\"\",slug:f.row.record.locales[h]?.slug??\"\"},parentPath:f.row.isHome?void 0:j(f.row.path),onClose:F,onSubmit:M=>K(M).then(V=>(V===null&&F(),V))})]})}var Ri=T(te(),1);function Ld(t,e,n,r){let o=e.titleField,s=a=>{let i=t.locales[a];if(!i||!o)return;let l=o in i.fields?i.fields[o]:t.fields[o];return typeof l==\"string\"&&l.length>0?l:void 0};return s(r)??s(n.locales.default)??Object.keys(t.locales).map(s).find(a=>a!==void 0)??\"Untitled\"}function tu(t,e){return t.locales[e.locales.default]?e.locales.default:Object.keys(t.locales)[0]}function hD(t){return Object.entries(t.fields).filter(([e,n])=>e===\"slug\"||n.localized===!0).map(([e])=>e)}function mD(t,e,n,r){return t.map(o=>{let s=o.locales[r];return{id:o.id,title:Ld(o,e,n,r),present:s!==void 0,status:s?ar(s):null,updatedAt:s?s.updatedAt:o.updatedAt}})}function gD(t){return t.manual&&t.depth===1}function nu(t,e=Date.now()){let n=e-t;if(n<6e4)return\"Just now\";if(n<36e5)return`${Math.floor(n/6e4)} min ago`;if(n<864e5){let s=Math.floor(n/36e5);return s===1?\"1 hour ago\":`${s} hours ago`}if(n<2*864e5)return\"Yesterday\";let r=new Date(t),o=r.getFullYear()===new Date(e).getFullYear();return r.toLocaleDateString(void 0,{month:\"short\",day:\"numeric\",...o?{}:{year:\"numeric\"}})}function uv(t){return new Date(t).toLocaleString(void 0,{day:\"numeric\",month:\"short\",year:\"numeric\",hour:\"2-digit\",minute:\"2-digit\"})}function Ad(t,e,n=Date.now()){let r=nu(t,n);return e?`${r} \\xB7 ${e}`:r}var Gr=T(O(),1);function yD({ops:t,registry:e,collection:n}){let r=Qe(),o=e.collections.find(v=>v.name===n),[s,a]=(0,Ri.useState)(null),[i,l]=(0,Ri.useState)(null),[u,c]=(0,Ri.useState)(()=>xs(e.locales)),{others:d}=Ao(),f=e.locales.supported.length>1,p=v=>{c(v),Vo(v)},h=(0,Ri.useCallback)(()=>t.entries.list(n).then(v=>v.ok?a(v.data):l(v.message)).catch(()=>l(\"Couldn't reach the server.\")),[t,n]);(0,Ri.useEffect)(()=>{h()},[h]);let g=s&&o?mD(s,o,e,u):[],m=vs({count:g.length,onDrop:async(v,S)=>{let E=s?.find(k=>k.id===g[v].id);if(!E||v===S)return;let w;try{w=await t.entries.move(n,E.id,{parentId:E.parentId,index:S})}catch{w={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(!w.ok)throw vd({title:\"Couldn't move the entry\",message:w.message}),new Error(w.message);await h()}});if(!o)return(0,Gr.jsx)(an,{message:\"No such collection.\"});if(i)return(0,Gr.jsx)(an,{message:i});let y=v=>{sr(r(`/${n}/${encodeURIComponent(v)}?locale=${encodeURIComponent(u)}`))},b=async()=>{let v;try{v=await t.entries.create(n,{locale:u,fields:{}})}catch{v={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(!v.ok){vd({title:\"Couldn't create the entry\",message:v.message});return}y(v.data.id)},x=async v=>{let S=s?.find(A=>A.id===v.id);if(!S)return;let E=tu(S,e);if(!await rt({title:`Add this entry to ${u}?`,body:`Its ${E} fields are copied as the first ${u} draft. Nothing is published until you publish it.`,confirmLabel:`Add to ${u}`,subject:{name:v.title}}))return;let k;try{k=await t.entries.addLocale(n,v.id,u,{from:E})}catch{k={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(!k.ok){vd({title:`Couldn't add the entry to ${u}`,message:k.message});return}y(v.id)};return(0,Gr.jsx)(ys,{title:o.title,titleTrailing:f&&(0,Gr.jsx)(Ti,{locales:e.locales.supported,value:u,onChange:p}),actions:(0,Gr.jsx)(Q,{onClick:()=>{b()},children:\"+ New entry\"}),columns:[{label:\"Title\",width:\"minmax(160px,1fr)\"},{label:\"Updated\",width:\"minmax(110px,160px)\"},{label:\"Status\",width:\"170px\"}],empty:s?\"Nothing here yet.\":\"Loading\\u2026\",sortable:gD(o)?{hook:m,canDrag:()=>!0}:void 0,rows:g.map(v=>{let S=v.present?void 0:{opacity:.45};return{key:v.id,onClick:()=>v.present?y(v.id):void x(v),cells:[(0,Gr.jsxs)(\"span\",{className:\"sm-cell sm-cell--title\",style:S,children:[v.title,(0,Gr.jsx)(Cd,{names:Eo(d,{kind:\"entry\",id:v.id,locale:u})})]},\"t\"),v.present?(0,Gr.jsx)(\"span\",{className:\"sm-cell sm-cell--muted\",children:nu(v.updatedAt)},\"u\"):(0,Gr.jsxs)(\"span\",{className:\"sm-cell sm-cell--muted\",children:[\"not in \",u,\" \\u2014 click to add\"]},\"u\"),v.status?(0,Gr.jsx)(gs,{status:bs(v.status)},\"c\"):(0,Gr.jsx)(\"span\",{className:\"sm-cell sm-cell--muted\",children:\"\\u2014\"},\"c\")]}})})}var Pe=T(te(),1);var A8=[\"fields\",\"settings\"];function E8(t){for(let e of A8)if(t.startsWith(`${e}.`))return[e,t.slice(e.length+1)];return[null,t]}function T8(t,e){let[n,r]=E8(t);return(n===null?e.self:e[n])?.[r]}var bD=t=>t==null||t===\"\"||Array.isArray(t)&&t.length===0||typeof t==\"object\"&&!Array.isArray(t)&&Object.keys(t).length===0||typeof t==\"object\"&&!Array.isArray(t)&&\"asset\"in t&&typeof t.asset!=\"string\";function R8(t,e){let n=T8(t.path,e);switch(t.op){case\"is\":return n===t.value;case\"isNot\":return n!==t.value;case\"in\":return Array.isArray(t.value)&&t.value.includes(n);case\"isEmpty\":return bD(n);case\"isNotEmpty\":return!bD(n);default:return!1}}var I8=t=>typeof t==\"object\"&&t!==null&&typeof t.path==\"string\"&&typeof t.op==\"string\";function Wr(t,e){let{hidden:n}=t;return I8(n)?R8(n,e):!1}var M8=[[/@import/i,\"@import is not allowed.\"],[/url\\s*\\(/i,\"url() is not allowed.\"],[/expression\\s*\\(/i,\"expression() is not allowed.\"],[/behavior\\s*:/i,\"behavior: is not allowed.\"],[/<\\//,'\"</\" is not allowed.']];function _8(t){return t.replace(/\\\\([0-9a-fA-F]{1,6})[ \\t\\n\\r\\f]?/g,(e,n)=>{let r=parseInt(n,16);return r===0||r>1114111?\"\\uFFFD\":String.fromCodePoint(r)}).replace(/\\\\(.)/gs,\"$1\")}function O8(t){let e=0;for(let n of t)if(n===\"{\")e++;else if(n===\"}\"&&--e<0)return!1;return e===0}function cv(t){if(t.length>4e3)return\"At most 4000 characters.\";let e=_8(t);for(let[n,r]of M8)if(n.test(t)||n.test(e))return r;return O8(t)?null:\"Braces must balance.\"}var fL=t=>t.trim().replace(/\\s+/g,\" \"),vD=t=>t.toLocaleLowerCase(),Ed=(t,e)=>vD(t)===vD(e);function xD(t,e,n={}){let r=[...t],o=null;for(let s of e.split(\",\")){let a=fL(s);if(a===\"\")continue;let i=n.known?.find(u=>Ed(u,a))??a,l=r.find(u=>Ed(u,i));if(l!==void 0){o??(o=l);continue}if(typeof n.max==\"number\"&&r.length>=n.max)break;r.push(i)}return{tags:r,duplicate:o}}function pL(t){if(!t||typeof t!=\"object\")return!1;let e=t;return e.type===\"image\"||e.type===\"element\"||typeof e.text==\"string\"&&e.text.trim()!==\"\"?!0:Array.isArray(e.content)&&e.content.some(pL)}function wD(t){return JSON.parse(JSON.stringify(t))}var SD=\"image\",dv=\"element\",D8=t=>typeof t==\"object\"&&t!==null&&typeof t.type==\"string\";function hL(t){let e=[],n=r=>{if(D8(r)&&((r.type===SD||r.type===dv)&&((typeof r.attrs!=\"object\"||r.attrs===null)&&(r.attrs={}),e.push(r)),Array.isArray(r.content)))for(let o of r.content)n(o)};return n(t),e}function fv(t){let e={};for(let n of t??[]){let r=\"schema\"in n?n.schema:n;r.name in e||(e[r.name]={fields:r.fields,settings:r.settings??{}})}return e}var P8=[\"bold\",\"italic\",\"link\"],B8=[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"bulletList\",\"orderedList\",\"blockquote\",\"image\"],mL={marks:[\"bold\",\"italic\",\"link\"],nodes:[\"h2\",\"h3\",\"h4\",\"bulletList\",\"orderedList\",\"blockquote\"]},z8=t=>P8.includes(t),F8=t=>B8.includes(t);var H8=/^h([1-6])$/;function Ii(t){let e=t&&typeof t==\"object\"?t:mL,n=Array.isArray(e.marks)?e.marks.filter(a=>typeof a==\"string\"&&z8(a)):[],r=Array.isArray(e.nodes)?e.nodes.filter(a=>typeof a==\"string\"&&F8(a)):[],o=Array.isArray(e.elements)?e.elements.filter(a=>typeof a==\"string\"):[],s=r.map(a=>H8.exec(a)?.[1]).filter(a=>a!==void 0).map(Number).sort((a,i)=>a-i);return{marks:new Set(n),nodes:new Set(r),headingLevels:s,image:r.includes(\"image\"),elements:o}}var ws=\"custom\",rm=6,ru=12;var gL={type:\"doc\",content:[{type:\"paragraph\"}]};function CD(t=1){let e=Math.max(1,Math.min(rm,t));return{spans:om(Array(e).fill(1)),gap:\"md\",align:\"top\",reverse:!1,columns:Array.from({length:e},()=>structuredClone(gL))}}function om(t){let e=t.length;if(e===0)return[];if(e>ru)return om(t.slice(0,ru));let n=t.map(l=>Number.isFinite(l)&&l>0?l:1),r=n.reduce((l,u)=>l+u,0),o=n.map(l=>l/r*ru),s=o.map(l=>Math.floor(l)),a=ru-s.reduce((l,u)=>l+u,0),i=o.map((l,u)=>[l-s[u],u]).sort((l,u)=>u[0]-l[0]||l[1]-u[1]);for(let[,l]of i){if(a<=0)break;s[l]++,a--}for(let l=0;l<e;l++)for(;s[l]<1;){let u=s.indexOf(Math.max(...s));s[u]--,s[l]++}return s}function yL(t,e){let n=Math.max(1,Math.min(rm,e)),r=t.columns.length;if(n===r)return t;if(n>r){let a=[...t.spans],i=[...t.columns];for(;a.length<n;)a.push(a[a.length-1]??1),i.push(structuredClone(gL));return{...t,spans:om(a),columns:i}}let o=t.columns.slice(0,n),s=t.columns.slice(n).reduce((a,i)=>U8(a,i),o[n-1]);return o[n-1]=s,{...t,spans:om(t.spans.slice(0,n)),columns:o}}function bL(t,e,n){if(e<0||e>=t.length-1)return t;let r=t[e]+t[e+1],o=Math.max(1,Math.min(r-1,Math.round(n))),s=[...t];return s[e]=o,s[e+1]=r-o,s}function LD(t,e,n,r){let o=n.slice(0,r).reduce((l,u)=>l+u,0),s=Math.max(1,e)/ru,a=n[r]+n[r+1],i=Math.round(t/s)-o;return Math.max(1,Math.min(a-1,i))}function AD(t){return t===2?[{label:\"1/2 \\xB7 1/2\",spans:[6,6]},{label:\"1/3 \\xB7 2/3\",spans:[4,8]},{label:\"2/3 \\xB7 1/3\",spans:[8,4]}]:t===3?[{label:\"1/3 \\xB7 1/3 \\xB7 1/3\",spans:[4,4,4]}]:t===4?[{label:\"1/4 \\xD7 4\",spans:[3,3,3,3]}]:[]}var pv=t=>typeof t==\"object\"&&t!==null&&t.type===\"doc\"&&Array.isArray(t.content),$8=t=>typeof t==\"object\"&&t!==null&&t.type===\"paragraph\"&&(!Array.isArray(t.content)||t.content.length===0),kD=t=>pv(t)&&t.content.every($8);function U8(t,e){return!pv(t)||kD(t)?pv(e)?e:structuredClone(gL):!pv(e)||kD(e)?t:{type:\"doc\",content:[...t.content,...e.content]}}function ED(t){let e=Array.isArray(t)?t[0]:void 0,n=Array.isArray(e?.columns)?e.columns.length:0;return n===0?\"Custom section\":`Custom section \\xB7 ${n} column${n===1?\"\":\"s\"}`}var j8=/^(\\d{4})-(\\d{2})-(\\d{2})$/,q8=/^(\\d{4}-\\d{2}-\\d{2})T(\\d{2}):(\\d{2}):00Z$/;var hv=t=>String(t).padStart(2,\"0\");function TD(t,e){return new Date(Date.UTC(t,e,0)).getUTCDate()}function am(t){let e=j8.exec(t);if(!e)return null;let n={y:Number(e[1]),m:Number(e[2]),d:Number(e[3])};return n.m<1||n.m>12||n.d<1||n.d>TD(n.y,n.m)?null:n}var im=t=>`${String(t.y).padStart(4,\"0\")}-${hv(t.m)}-${hv(t.d)}`,mv=(t,e)=>t.y===e.y&&t.m===e.m&&t.d===e.d,RD=t=>am(t)!==null,ID=t=>{let e=new Date(t);return{y:e.getUTCFullYear(),m:e.getUTCMonth()+1,d:e.getUTCDate()}};function sm(t,e,n){if(e===\"month\"){let r=t.y*12+(t.m-1)+n,o=Math.floor(r/12),s=r-o*12+1;return{y:o,m:s,d:Math.min(t.d,TD(o,s))}}return ID(Date.UTC(t.y,t.m-1,t.d)+n*(e===\"week\"?7:1)*864e5)}function MD(t,e){let n=(new Date(Date.UTC(t,e-1,1)).getUTCDay()+6)%7,r=sm({y:t,m:e,d:1},\"day\",-n),o=[];for(let s=0;s<6;s++){let a=[];for(let i=0;i<7;i++)a.push(r),r=sm(r,\"day\",1);o.push(a)}return o}function _D(t,e,n=\"en\"){return new Intl.DateTimeFormat(n,{month:\"long\",year:\"numeric\",timeZone:\"UTC\"}).format(new Date(Date.UTC(t,e-1,1)))}function OD(t=\"en\"){let e=new Intl.DateTimeFormat(t,{weekday:\"short\",timeZone:\"UTC\"});return[0,1,2,3,4,5,6].map(n=>e.format(new Date(Date.UTC(2024,0,1+n))))}function DD(t){let e=q8.exec(t);if(!e)return null;let n=am(e[1]);if(!n)return null;let r=Number(e[2]),o=Number(e[3]);return r>23||o>59?null:new Date(Date.UTC(n.y,n.m-1,n.d,r,o))}var V8=t=>`${im(ID(t.getTime()))}T${hv(t.getUTCHours())}:${hv(t.getUTCMinutes())}:00Z`,ND=t=>DD(t)!==null;function vL(t,e){let n=new Intl.DateTimeFormat(\"en-US\",{timeZone:e,hourCycle:\"h23\",year:\"numeric\",month:\"2-digit\",day:\"2-digit\",hour:\"2-digit\",minute:\"2-digit\"}).formatToParts(t),r=o=>Number(n.find(s=>s.type===o)?.value);return{day:{y:r(\"year\"),m:r(\"month\"),d:r(\"day\")},hour:r(\"hour\")%24,minute:r(\"minute\")}}function PD(t,e){let n=DD(t);return n?vL(n,e):null}function xL(t,e,n,r){let o=Date.UTC(t.y,t.m-1,t.d,e,n),s=o;for(let a=0;a<2;a++){let i=vL(new Date(s),r),l=Date.UTC(i.day.y,i.day.m-1,i.day.d,i.hour,i.minute);if(l===o)break;s+=o-l}return V8(new Date(s))}function lm(t,e=new Date){return vL(e,t).day}var BD=Array.from({length:24},(t,e)=>e);function zD(t){let e=Array.from({length:12},(n,r)=>r*5);return t===null||e.includes(t)?e:[...e,t].sort((n,r)=>n-r)}var FD=31536e3,pce={maxSize:25*1024*1024,accept:[\"image/jpeg\",\"image/png\",\"image/webp\",\"image/avif\",\"image/gif\",\"image/svg+xml\",\"video/mp4\",\"video/webm\",\"application/pdf\"]},gv={left:0,top:0,width:1,height:1},yv={x:.5,y:.5},Td=t=>Math.min(1,Math.max(0,t)),K8=/^(\\d+(?:\\.\\d+)?):(\\d+(?:\\.\\d+)?)$/;function ou(t){let e=K8.exec(t),n=e?Number(e[1]):0,r=e?Number(e[2]):0;if(!e||n<=0||r<=0)throw new Error(`smoodly: \"${t}\" is not an aspect \\u2014 use \"w:h\", like \"16:9\".`);return n/r}var wL=(t,e)=>t.width*e/t.height;function su(t){return Array.isArray(t)?t.flatMap(e=>{if(typeof e==\"string\")return[{value:e,label:e}];if(e&&typeof e==\"object\"&&typeof e.value==\"string\"){let n=e;return[{value:n.value,label:typeof n.label==\"string\"?n.label:n.value}]}return[]}):[]}var bv=t=>su(t).map(e=>e.value);var au=\"$seo\";var ka=\"global\",Go=\"$settings\",Ss=\"$styles\",To=\"$css\";var SL=\"global:\";function HD(t){return t.startsWith(SL)&&t.length>SL.length?t.slice(SL.length):null}var kL={\"unknown-section\":\"broken\",\"unknown-element\":\"broken\",\"unknown-shape\":\"broken\",\"unknown-collection\":\"broken\",misfit:\"broken\",\"zone-disallowed\":\"broken\",\"zone-over-max\":\"broken\",\"orphan-field\":\"orphan\",\"orphan-zone\":\"orphan\",\"element-outside-toolset\":\"orphan\",\"localization-on\":\"orphan\",\"localization-off\":\"orphan\"},xv=t=>kL[t.kind]===\"broken\",UD=t=>t==null||t===\"\"||Array.isArray(t)&&t.length===0,ks=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),G8=t=>Array.isArray(t)&&t.every(e=>typeof e==\"string\");function CL(t,e){if(UD(e))return!0;switch(t.type){case\"text\":case\"link\":case\"slug\":case\"date\":case\"datetime\":return typeof e==\"string\";case\"tags\":return G8(e);case\"number\":return typeof e==\"number\"&&Number.isFinite(e);case\"boolean\":return typeof e==\"boolean\";case\"select\":case\"radio\":{let n=bv(t.options);return typeof e==\"string\"&&(n.length===0||n.includes(e))}case\"checkboxes\":{let n=bv(t.options);return Array.isArray(e)&&e.every(r=>typeof r==\"string\"&&n.includes(r))}case\"image\":case\"video\":case\"file\":return ks(e)&&typeof e.asset==\"string\";case\"ref\":return typeof e==\"string\";case\"refList\":return Array.isArray(e)&&e.every(n=>typeof n==\"string\"&&n!==\"\");case\"object\":return ks(e);case\"list\":return Array.isArray(e);case\"richtext\":return ks(e)&&e.type===\"doc\";default:return!0}}function jD(t,e){let n=()=>`Must be one of: ${bv(t.options).join(\", \")}.`;switch(t.type){case\"text\":case\"link\":case\"slug\":return\"Must be text.\";case\"number\":return\"Must be a number.\";case\"boolean\":return\"Must be on or off.\";case\"date\":return\"Not a date (2026-09-02).\";case\"datetime\":return\"Not a date and time.\";case\"image\":case\"video\":case\"file\":return\"Must be an uploaded file.\";case\"list\":return\"Must be a list.\";case\"object\":return\"Must be an object.\";case\"ref\":return\"Must be an entry.\";case\"refList\":return\"Must be a list of entries.\";case\"tags\":return\"Must be a list of tags.\";case\"richtext\":return\"Must be rich text.\";case\"select\":case\"radio\":return n();case\"checkboxes\":return Array.isArray(e)?n():\"Must be a list.\";default:return\"Doesn't fit this field.\"}}var Rd=(t,e)=>t===\"\"?e:`${t}.${e}`;function Id(t,e,n,r,o,s){for(let[a,i]of Object.entries(n))a in r||o.out.push({kind:\"orphan-field\",path:Rd(t,a),subject:{...o.subject,field:Rd(e,a)},value:i});for(let[a,i]of Object.entries(r))Wr(i,s)||qD(Rd(t,a),Rd(e,a),n[a],i,o,s)}function qD(t,e,n,r,o,s){if(!UD(n)){if(!CL(r,n)){o.out.push({kind:\"misfit\",path:t,subject:{...o.subject,field:e},value:n,detail:{type:r.type}});return}r.type===\"object\"?Id(t,e,n,r.fields??{},o,{...s,self:n}):r.type===\"list\"?r.item&&!Wr(r.item,s)&&n.forEach((a,i)=>qD(`${t}.${i}`,`${e}[]`,a,r.item,o,s)):r.type===\"richtext\"&&X8(t,e,n,r,o)}}function W8(t){let e=[],n=r=>{ks(r)&&(r.type===\"element\"&&e.push(ks(r.attrs)?r.attrs:{}),Array.isArray(r.content)&&r.content.forEach(n))};return n(t),e}function X8(t,e,n,r,o){let s=Ii(r.toolset).elements;W8(n).forEach((a,i)=>{let l=`${t}.elements.${i}`,u=typeof a.name==\"string\"?a.name:\"\",c=o.registry.elements.find(h=>h.name===u);if(!c){o.out.push({kind:\"unknown-element\",path:l,subject:{scope:\"element\",name:u}});return}(!s.includes(u)||!c.contexts.includes(\"richtext\"))&&o.out.push({kind:\"element-outside-toolset\",path:l,subject:{scope:\"element\",name:u,field:e,within:`${o.subject.scope}:${o.subject.name}`}});let d=ks(a.fields)?a.fields:{},f=ks(a.settings)?a.settings:{},p={...o,subject:{scope:\"element\",name:u}};Id(l,\"\",d,c.fields,p,{self:d,fields:d,settings:f}),Id(`${l}.settings`,\"settings\",f,c.settings,p,{self:f,fields:d,settings:f})})}function vv(t,e,n,r,o){let s={registry:t,out:[],subject:e},a=ks(r.fields)?r.fields:{},i=ks(r.settings)?r.settings:{},l=ks(r.styles)?r.styles:{};return Id(n,\"\",a,o.fields,s,{self:a,fields:a,settings:i}),Id(Rd(n,\"settings\"),\"settings\",i,o.settings??{},s,{self:i,fields:a,settings:i}),Id(Rd(n,\"styles\"),\"styles\",l,o.styles??{},s,{self:l,fields:a,settings:i}),s.out}function J8(t,e){return t.kind===\"locked\"?e===t.component:t.kind===\"sections\"?t.allow.includes(e):e===ws?t.custom:t.allow===\"*\"||t.allow.includes(e)}function Y8(t,e,n,r,o,s){if(o.type===ka){let i=typeof o.fields?.item==\"string\"?o.fields.item:\"\";t.globals.some(l=>l.name===i)||s.push({kind:\"unknown-section\",path:o.id,subject:{scope:\"global\",name:i}});return}let a=o.type===ws?t.custom:t.sections.find(i=>i.name===o.type);if(!a){s.push({kind:\"unknown-section\",path:o.id,subject:{scope:\"section\",name:o.type}});return}J8(r,o.type)||s.push({kind:\"zone-disallowed\",path:o.id,subject:{scope:\"zone\",name:n,field:o.type,within:e}}),s.push(...vv(t,{scope:\"section\",name:a.name},o.id,o,a))}function VD(t,e,n){if(e===null)return[];let r=t.pages.find(s=>s.name===e);if(!r)return[{kind:\"unknown-shape\",path:\"page\",subject:{scope:\"page\",name:e}}];if(!n)return[];let o=[];for(let[s,a]of Object.entries(n.zones??{})){let i=Array.isArray(a)?a:[],l=r.zones[s];if(!l){i.length>0&&o.push({kind:\"orphan-zone\",path:`zone:${s}`,subject:{scope:\"zone\",name:s,within:r.name},detail:{count:i.length}});continue}l.kind===\"sections\"&&typeof l.max==\"number\"&&i.length>l.max&&o.push({kind:\"zone-over-max\",path:`zone:${s}`,subject:{scope:\"zone\",name:s,within:r.name},detail:{max:l.max,count:i.length}});for(let u of i)Y8(t,r.name,s,l,u,o)}return o.push(...vv(t,{scope:\"page\",name:r.name},\"page.fields\",{fields:n.fields??{}},{fields:r.fields})),o}var Z8=new Set([\"slug\",au,Go,Ss,To]);function $D(t,e,n,r){if(!(!n.shared||!n.own))for(let[o,s]of Object.entries(e))Z8.has(o)||(s.localized===!0&&o in n.shared&&!(o in n.own)&&r.push({kind:\"localization-on\",path:o,subject:{...t,field:o},value:n.shared[o]}),s.localized!==!0&&o in n.own&&r.push({kind:\"localization-off\",path:o,subject:{...t,field:o},value:n.own[o]}))}function wv(t,e,n){let r=[],o=t.collections.find(a=>a.name===e);if(o){let a={scope:\"collection\",name:e},{slug:i,[au]:l,...u}=n.fields;return r.push(...vv(t,a,\"\",{fields:u},{fields:o.fields})),$D(a,o.fields,n,r),r}let s=t.globals.find(a=>a.name===e);if(s){let a={scope:\"global\",name:e},{[Go]:i,[Ss]:l,[To]:u,slug:c,...d}=n.fields;return r.push(...vv(t,a,\"\",{fields:d,settings:i,styles:l},s)),$D(a,s.fields,n,r),r}return[{kind:\"unknown-collection\",path:\"collection\",subject:{scope:\"collection\",name:e}}]}var KD=t=>[t.kind,t.subject.scope,t.subject.within??\"\",t.subject.name,t.subject.field??\"\"].join(\"|\");var Q8=\"Use lowercase letters, digits and single hyphens, like my-post.\",GD=t=>t.fields&&typeof t.fields==\"object\"?t.fields:{},e9=t=>t.item&&typeof t.item==\"object\"?t.item:void 0,WD=t=>t==null||t===\"\"||Array.isArray(t)&&t.length===0,XD=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t)&&Object.values(t).every(e=>WD(e)||XD(e)),LL=t=>t.optional===!0||t.type===\"boolean\"||t.type===\"object\"&&Object.values(GD(t)).every(LL),Md=(t,e)=>`${t} ${e}${t===1?\"\":\"s\"}`;function JD(t,e,n,r,o,s){if(!(n.type===\"object\"&&n.optional===!0&&XD(e))){if(WD(e)){LL(n)||r.push({field:t,message:\"Required.\"});return}if(!CL(n,e)){r.push({field:t,message:jD(n,e)});return}if(n.type===\"slug\"&&!rL(e)){r.push({field:t,message:Q8});return}if(n.type===\"richtext\"){if(!pL(e)){LL(n)||r.push({field:t,message:\"Required.\"});return}let a=0;for(let i of hL(e)){if(i.type!==dv)continue;let l=i.attrs,u=typeof l.name==\"string\"?o[l.name]:void 0;if(u){let c=l.fields&&typeof l.fields==\"object\"?l.fields:{},d=l.settings&&typeof l.settings==\"object\"?l.settings:{};Sv(`${t}.elements.${a}`,c,u.fields,r,o,{self:c,fields:c,settings:d}),Sv(`${t}.elements.${a}.settings`,d,u.settings??{},r,o,{self:d,fields:c,settings:d})}a++}return}if(n.type===\"date\"){RD(e)||r.push({field:t,message:\"Not a date (2026-09-02).\"});return}if(n.type===\"datetime\"){ND(e)||r.push({field:t,message:\"Not a date and time.\"});return}if(!(n.type===\"image\"||n.type===\"video\"||n.type===\"file\")){if(n.type===\"list\"){if(!Array.isArray(e))return;typeof n.min==\"number\"&&e.length<n.min&&r.push({field:t,message:`At least ${Md(n.min,\"item\")}.`}),typeof n.max==\"number\"&&e.length>n.max&&r.push({field:t,message:`At most ${Md(n.max,\"item\")}.`});let a=e9(n);a&&!Wr(a,s)&&e.forEach((i,l)=>JD(`${t}.${l}`,i,a,r,o,s));return}if(n.type===\"object\"){Sv(t,e,GD(n),r,o,{...s,self:e});return}if(!(n.type===\"boolean\"||n.type===\"select\"||n.type===\"radio\"||n.type===\"checkboxes\")&&n.type!==\"ref\"){if(n.type===\"refList\"){if(!Array.isArray(e))return;typeof n.min==\"number\"&&e.length<n.min&&r.push({field:t,message:`At least ${Md(n.min,\"item\")}.`}),typeof n.max==\"number\"&&e.length>n.max&&r.push({field:t,message:`At most ${Md(n.max,\"item\")}.`}),new Set(e).size!==e.length&&r.push({field:t,message:\"The same entry is listed twice.\"});return}if(n.type===\"tags\"){if(!Array.isArray(e))return;typeof n.min==\"number\"&&e.length<n.min&&r.push({field:t,message:`At least ${Md(n.min,\"item\")}.`}),typeof n.max==\"number\"&&e.length>n.max&&r.push({field:t,message:`At most ${Md(n.max,\"item\")}.`}),e.forEach((a,i)=>{typeof a!=\"string\"||a===\"\"||fL(a)!==a?r.push({field:`${t}.${i}`,message:\"Must be a trimmed, non-empty tag.\"}):e.slice(0,i).some(l=>typeof l==\"string\"&&Ed(l,a))&&r.push({field:`${t}.${i}`,message:\"Duplicate tag.\"})});return}typeof n.max==\"number\"&&typeof e==\"string\"&&e.length>n.max&&r.push({field:t,message:`Must be at most ${n.max} characters.`})}}}}function Sv(t,e,n,r,o,s){for(let[a,i]of Object.entries(n))Wr(i,s)||JD(t===\"\"?a:`${t}.${a}`,e[a],i,r,o,s)}function Cv(t,e){let n={};for(let r of e)r.field in t&&(n[r.field]=r.message);return n}function kv(t,e,n={},r={}){let o=[];return Sv(\"\",t,e,o,n,{self:t,fields:r.fields??t,settings:r.settings}),o}function YD(t,e,n={}){let r=t.fields??{},o=t.settings??{},s={fields:r,settings:o},a=kv(r,e.fields,n,s);for(let i of kv(o,e.settings??{},n,s))a.push({field:`settings.${i.field}`,message:i.message});if(typeof t.css==\"string\"&&t.css!==\"\"){let i=cv(t.css);i&&a.push({field:\"css\",message:i})}return a}var vE=T(te(),1);var Ee=T(te(),1);function Vn(t){this.content=t}Vn.prototype={constructor:Vn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),s=r.content.slice();return o==-1?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new Vn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Vn(n)},addToStart:function(t,e){return new Vn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Vn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),s=r.find(t);return o.splice(s==-1?o.length:s,0,e,n),new Vn(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Vn.from(t),t.size?new Vn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Vn.from(t),t.size?new Vn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Vn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Vn.from=function(t){if(t instanceof Vn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Vn(e)};var AL=Vn;function iN(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),s=e.child(r);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let a=o.text,i=s.text,l=0;for(;a[l]==i[l];l++)n++;return l&&l<a.length&&l<i.length&&cN(a.charCodeAt(l-1))&&uN(a.charCodeAt(l))&&n--,n}if(o.content.size||s.content.size){let a=iN(o.content,s.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function lN(t,e,n,r){for(let o=t.childCount,s=e.childCount;;){if(o==0||s==0)return o==s?null:{a:n,b:r};let a=t.child(--o),i=e.child(--s),l=a.nodeSize;if(a==i){n-=l,r-=l;continue}if(!a.sameMarkup(i))return{a:n,b:r};if(a.isText&&a.text!=i.text){let u=a.text,c=i.text,d=u.length,f=c.length;for(;d>0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,r--;return d&&f&&d<u.length&&cN(u.charCodeAt(d-1))&&uN(u.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(a.content.size||i.content.size){let u=lN(a.content,i.content,n-1,r-1);if(u)return u}n-=l,r-=l}}function uN(t){return t>=56320&&t<57344}function cN(t){return t>=55296&&t<56320}var H=class t{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,s){for(let a=0,i=0;i<n;a++){let l=this.content[a],u=i+l.nodeSize;if(u>e&&r(l,o+i,s||null,a)!==!1&&l.content.size){let c=i+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,o+c)}i=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s=\"\",a=!0;return this.nodesBetween(e,n,(i,l)=>{let u=i.isText?i.text.slice(Math.max(e,l)-l,n-l):i.isLeaf?o?typeof o==\"function\"?o(i):o:i.type.spec.leafText?i.type.spec.leafText(i):\"\":\"\";i.isBlock&&(i.isLeaf&&u||i.isTextblock)&&r&&(a?a=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)o.push(e.content[s]);return new t(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let s=0,a=0;a<n;s++){let i=this.content[s],l=a+i.nodeSize;l>e&&((a<e||l>n)&&(i.isText?i=i.cut(Math.max(0,e-a),Math.min(i.text.length,n-a)):i=i.cut(Math.max(0,e-a-1),Math.min(i.content.size,n-a-1))),r.push(i),o+=i.nodeSize),a=l}return new t(r,o)}cutByIndex(e,n){return e==n?t.empty:e==0&&n==this.content.length?this:new t(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new t(o,s)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError(\"Index \"+e+\" out of range for \"+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return iN(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return lN(this,e,n,r)}findIndex(e){if(e==0)return Lv(0,e);if(e==this.size)return Lv(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),s=r+o.nodeSize;if(s>=e)return s==e?Lv(n+1,s):Lv(n,r);r=s}}toString(){return\"<\"+this.toStringInner()+\">\"}toStringInner(){return this.content.join(\", \")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError(\"Invalid input for Fragment.fromJSON\");return t.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let n,r=0;for(let o=0;o<e.length;o++){let s=e[o];r+=s.nodeSize,o&&s.isText&&e[o-1].sameMarkup(s)?(n||(n=e.slice(0,o)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new t(n||e,r)}static from(e){if(!e)return t.empty;if(e instanceof t)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new t([e],e.nodeSize);throw new RangeError(\"Can not convert \"+e+\" to a Fragment\"+(e.nodesBetween?\" (looks like multiple versions of prosemirror-model were loaded)\":\"\"))}};H.empty=new H([],0);var EL={index:0,offset:0};function Lv(t,e){return EL.index=t,EL.offset=e,EL}function Tv(t,e){if(t===e)return!0;if(!(t&&typeof t==\"object\")||!(e&&typeof e==\"object\"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Tv(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Tv(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}var Ge=class t{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let s=e[o];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,o));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Tv(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError(\"Invalid input for Mark.fromJSON\");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return t.none;if(e instanceof t)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Ge.none=[];var Mi=class extends Error{},G=class t{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=fN(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(dN(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+\"(\"+this.openStart+\",\"+this.openEnd+\")\"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return t.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!=\"number\"||typeof o!=\"number\")throw new RangeError(\"Invalid input for Slice.fromJSON\");return new t(H.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new t(e,r,o)}};G.empty=new G(H.empty,0,0);function dN(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:a,offset:i}=t.findIndex(n);if(o==e||s.isText){if(i!=n&&!t.child(a).isText)throw new RangeError(\"Removing non-flat range\");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError(\"Removing non-flat range\");return t.replaceChild(r,s.copy(dN(s.content,e-o-1,n-o-1)))}function fN(t,e,n,r,o,s){let{index:a,offset:i}=t.findIndex(e),l=t.maybeChild(a);if(i==e||l.isText)return s&&r<=0&&o<=0&&!s.canReplace(a,a,n)?null:t.cut(0,e).append(n).append(t.cut(e));let u=fN(l.content,e-i-1,n,a==0?r-1:0,a==t.childCount-1?o-1:0,l);return u&&t.replaceChild(a,l.copy(u))}function t9(t,e,n){if(n.openStart>t.depth)throw new Mi(\"Inserted content deeper than insertion position\");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Mi(\"Inconsistent open depths\");return pN(t,e,n,0)}function pN(t,e,n,r){let o=t.index(r),s=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let a=pN(t,e,n,r+1);return s.copy(s.content.replaceChild(o,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,i=a.content;return lu(a,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}else{let{start:a,end:i}=n9(n,t);return lu(s,mN(t,a,i,e,r))}else return lu(s,Rv(t,e,r))}function hN(t,e){if(!e.type.compatibleContent(t.type))throw new Mi(\"Cannot join \"+e.type.name+\" onto \"+t.type.name)}function TL(t,e,n){let r=t.node(n);return hN(r,e.node(n)),r}function iu(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function um(t,e,n,r){let o=(e||t).node(n),s=0,a=e?e.index(n):o.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(iu(t.nodeAfter,r),s++));for(let i=s;i<a;i++)iu(o.child(i),r);e&&e.depth==n&&e.textOffset&&iu(e.nodeBefore,r)}function lu(t,e){if(!t.type.validContent(e))throw new Mi(\"Invalid content for node \"+t.type.name);return t.copy(e)}function mN(t,e,n,r,o){let s=t.depth>o&&TL(t,e,o+1),a=r.depth>o&&TL(n,r,o+1),i=[];return um(null,t,o,i),s&&a&&e.index(o)==n.index(o)?(hN(s,a),iu(lu(s,mN(t,e,n,r,o+1)),i)):(s&&iu(lu(s,Rv(t,e,o+1)),i),um(e,n,o,i),a&&iu(lu(a,Rv(n,r,o+1)),i)),um(r,null,o,i),new H(i)}function Rv(t,e,n){let r=[];if(um(null,t,n,r),t.depth>n){let o=TL(t,e,n+1);iu(lu(o,Rv(t,e,n+1)),r)}return um(e,null,n,r),new H(r)}function n9(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)o=e.node(s).copy(H.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}var Iv=class t{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError(\"There is no position before the top-level node\");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError(\"There is no position after the top-level node\");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)o+=r.child(s).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ge.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let i=r;r=o,o=i}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!o||!s[a].isInSet(o.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!o||!r[s].isInSet(o.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new uu(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=\"\";for(let n=1;n<=this.depth;n++)e+=(e?\"/\":\"\")+this.node(n).type.name+\"_\"+this.index(n-1);return e+\":\"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError(\"Position \"+n+\" out of range\");let r=[],o=0,s=n;for(let a=e;;){let{index:i,offset:l}=a.content.findIndex(s),u=s-l;if(r.push(a,i,o+l),!u||(a=a.child(i),a.isText))break;s=u-1,o+=l+1}return new t(n,r,s)}static resolveCached(e,n){let r=ZD.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==n)return a}else ZD.set(e,r=new RL);let o=r.elts[r.i]=t.resolve(e,n);return r.i=(r.i+1)%r9,o}},RL=class{constructor(){this.elts=[],this.i=0}},r9=12,ZD=new WeakMap,uu=class{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},o9=Object.create(null),Ro=class t{constructor(e,n,r,o=Ge.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||H.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,\"\")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Tv(this.attrs,n||e.defaultAttrs||o9)&&Ge.sameSet(this.marks,r||Ge.none)}copy(e=null){return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return G.empty;let o=this.resolve(e),s=this.resolve(n),a=r?0:o.sharedDepth(n),i=o.start(a),u=o.node(a).content.cut(o.pos-i,s.pos-i);return new G(u,o.depth-a,s.depth-a)}replace(e,n,r){return t9(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return Iv.resolveCached(this,e)}resolveNoCache(e){return Iv.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=\"(\"+this.content.toStringInner()+\")\"),gN(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error(\"Called contentMatchAt on a node with invalid content\");return n}canReplace(e,n,r=H.empty,o=0,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,o,s),i=a&&a.matchFragment(this.content,n);if(!i||!i.validEnd)return!1;for(let l=o;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ge.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ge.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError(\"Invalid input for Node.fromJSON\");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError(\"Invalid mark data for Node.fromJSON\");r=n.marks.map(e.markFromJSON)}if(n.type==\"text\"){if(typeof n.text!=\"string\")throw new RangeError(\"Invalid text node in JSON\");return e.text(n.text,r)}let o=H.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,o,r);return s.type.checkAttrs(s.attrs),s}};Ro.prototype.text=void 0;var IL=class t extends Ro{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError(\"Empty text nodes are not allowed\");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):gN(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function gN(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+\"(\"+e+\")\";return e}var cu=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new ML(e,n);if(r.next==null)return t.empty;let o=yN(r);r.next&&r.err(\"Unexpected trailing text\");let s=d9(c9(o));return f9(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let s=n;o&&s<r;s++)o=o.matchType(e.child(s).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function s(a,i){let l=a.matchFragment(e,r);if(l&&(!n||l.validEnd))return H.from(i.map(u=>u.createAndFill()));for(let u=0;u<a.next.length;u++){let{type:c,next:d}=a.next[u];if(!(c.isText||c.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=s(d,i.concat(c));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),s=o.match;if(s.matchType(e)){let a=[];for(let i=o;i.type;i=i.via)a.push(i.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:i,next:l}=s.next[a];!i.isLeaf&&!i.hasRequiredAttrs()&&!(i.name in n)&&(!o.type||l.validEnd)&&(r.push({match:i.contentMatch,type:i,via:o}),n[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let s=o+(r.validEnd?\"*\":\" \")+\" \";for(let a=0;a<r.next.length;a++)s+=(a?\", \":\"\")+r.next[a].type.name+\"->\"+e.indexOf(r.next[a].next);return s}).join(`\n`)}};cu.empty=new cu(!0);var ML=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\\s*(?=\\b|\\W|$)/),this.tokens[this.tokens.length-1]==\"\"&&this.tokens.pop(),this.tokens[0]==\"\"&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+\" (in content expression '\"+this.string+\"')\")}};function yN(t){let e=[];do e.push(s9(t));while(t.eat(\"|\"));return e.length==1?e[0]:{type:\"choice\",exprs:e}}function s9(t){let e=[];do e.push(a9(t));while(t.next&&t.next!=\")\"&&t.next!=\"|\");return e.length==1?e[0]:{type:\"seq\",exprs:e}}function a9(t){let e=u9(t);for(;;)if(t.eat(\"+\"))e={type:\"plus\",expr:e};else if(t.eat(\"*\"))e={type:\"star\",expr:e};else if(t.eat(\"?\"))e={type:\"opt\",expr:e};else if(t.eat(\"{\"))e=i9(t,e);else break;return e}function QD(t){/\\D/.test(t.next)&&t.err(\"Expected number, got '\"+t.next+\"'\");let e=Number(t.next);return t.pos++,e}function i9(t,e){let n=QD(t),r=n;return t.eat(\",\")&&(t.next!=\"}\"?r=QD(t):r=-1),t.eat(\"}\")||t.err(\"Unclosed braced range\"),{type:\"range\",min:n,max:r,expr:e}}function l9(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let s in n){let a=n[s];a.isInGroup(e)&&o.push(a)}return o.length==0&&t.err(\"No node type or group '\"+e+\"' found\"),o}function u9(t){if(t.eat(\"(\")){let e=yN(t);return t.eat(\")\")||t.err(\"Missing closing paren\"),e}else if(/\\W/.test(t.next))t.err(\"Unexpected token '\"+t.next+\"'\");else{let e=l9(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err(\"Mixing inline and block content\"),{type:\"name\",value:n}));return t.pos++,e.length==1?e[0]:{type:\"choice\",exprs:e}}}function c9(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(a,i,l){let u={term:l,to:i};return e[a].push(u),u}function o(a,i){a.forEach(l=>l.to=i)}function s(a,i){if(a.type==\"choice\")return a.exprs.reduce((l,u)=>l.concat(s(u,i)),[]);if(a.type==\"seq\")for(let l=0;;l++){let u=s(a.exprs[l],i);if(l==a.exprs.length-1)return u;o(u,i=n())}else if(a.type==\"star\"){let l=n();return r(i,l),o(s(a.expr,l),l),[r(l)]}else if(a.type==\"plus\"){let l=n();return o(s(a.expr,i),l),o(s(a.expr,l),l),[r(l)]}else{if(a.type==\"opt\")return[r(i)].concat(s(a.expr,i));if(a.type==\"range\"){let l=i;for(let u=0;u<a.min;u++){let c=n();o(s(a.expr,l),c),l=c}if(a.max==-1)o(s(a.expr,l),l);else for(let u=a.min;u<a.max;u++){let c=n();r(l,c),o(s(a.expr,l),c),l=c}return[r(l)]}else{if(a.type==\"name\")return[r(i,void 0,a.value)];throw new Error(\"Unknown expr type\")}}}}function bN(t,e){return e-t}function eN(t,e){let n=[];return r(e),n.sort(bN);function r(o){let s=t[o];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(o);for(let a=0;a<s.length;a++){let{term:i,to:l}=s[a];!i&&n.indexOf(l)==-1&&r(l)}}}function d9(t){let e=Object.create(null);return n(eN(t,0));function n(r){let o=[];r.forEach(a=>{t[a].forEach(({term:i,to:l})=>{if(!i)return;let u;for(let c=0;c<o.length;c++)o[c][0]==i&&(u=o[c][1]);eN(t,l).forEach(c=>{u||o.push([i,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[r.join(\",\")]=new cu(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let i=o[a][1].sort(bN);s.next.push({type:o[a][0],next:e[i.join(\",\")]||n(i)})}return s}}function f9(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,a=[];for(let i=0;i<o.next.length;i++){let{type:l,next:u}=o.next[i];a.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&e.err(\"Only non-generatable nodes (\"+a.join(\", \")+\") in a required position (see https://prosemirror.net/docs/guide/#generatable)\")}}function vN(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function xN(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let s=t[r];if(s.hasDefault)o=s.default;else throw new RangeError(\"No value supplied for attribute \"+r)}n[r]=o}return n}function wN(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let o in t)t[o].validate&&t[o].validate(e[o])}function SN(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new _L(t,r,e[r]);return n}var Mv=class t{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(\" \"):[],this.attrs=SN(e,r.attrs),this.defaultAttrs=vN(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e==\"text\"),this.isText=e==\"text\"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==cu.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?\"pre\":\"normal\")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:xN(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error(\"NodeType.create can't construct text nodes\");return new Ro(this,this.computeAttrs(e),H.from(n),Ge.setFrom(r))}createChecked(e=null,n,r){return n=H.from(n),this.checkContent(n),new Ro(this,this.computeAttrs(e),n,Ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=H.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(H.empty,!0);return s?new Ro(this,e,n.append(s),Ge.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){wN(this.attrs,e,\"node\",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ge.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,a)=>r[s]=new t(s,n,a));let o=n.spec.topNode||\"doc\";if(!r[o])throw new RangeError(\"Schema is missing its top node type ('\"+o+\"')\");if(!r.text)throw new RangeError(\"Every schema needs a 'text' type\");for(let s in r.text.attrs)throw new RangeError(\"The text node type should not have attributes\");return r}};function p9(t,e,n){let r=n.split(\"|\");return o=>{let s=o===null?\"null\":typeof o;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}var _L=class{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,\"default\"),this.default=r.default,this.validate=typeof r.validate==\"string\"?p9(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},dm=class t{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=SN(e,o.attrs),this.excluded=null;let s=vN(this.attrs);this.instance=s?new Ge(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Ge(this,xN(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,a)=>r[s]=new t(s,o++,n,a)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){wN(this.attrs,e,\"mark\",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},_i=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=AL.from(e.nodes),n.marks=AL.from(e.marks||{}),this.nodes=Mv.compile(this.spec.nodes,this),this.marks=dm.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+\" can not be both a node and a mark\");let s=this.nodes[o],a=s.spec.content||\"\",i=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=cu.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError(\"Multiple linebreak nodes defined\");if(!s.isInline||!s.isLeaf)throw new RangeError(\"Linebreak replacement nodes must be inline leaf nodes\");this.linebreakReplacement=s}s.markSet=i==\"_\"?null:i?tN(this,i.split(\" \")):i==\"\"||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],a=s.spec.excludes;s.excluded=a==null?[s]:a==\"\"?[]:tN(this,a.split(\" \"))}this.nodeFromJSON=o=>Ro.fromJSON(this,o),this.markFromJSON=o=>Ge.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||\"doc\"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e==\"string\")e=this.nodeType(e);else if(e instanceof Mv){if(e.schema!=this)throw new RangeError(\"Node type from different schema used (\"+e.name+\")\")}else throw new RangeError(\"Invalid node type: \"+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new IL(r,r.defaultAttrs,e,Ge.setFrom(n))}mark(e,n){return typeof e==\"string\"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError(\"Unknown node type: \"+e);return n}};function tN(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t.marks[o],a=s;if(s)n.push(s);else for(let i in t.marks){let l=t.marks[i];(o==\"_\"||l.spec.group&&l.spec.group.split(\" \").indexOf(o)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError(\"Unknown mark type: '\"+e[r]+\"'\")}return n}function h9(t){return t.tag!=null}function m9(t){return t.style!=null}var Xr=class t{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(h9(o))this.tags.push(o);else if(m9(o)){let s=/[^=]*/.exec(o.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\\b/.test(o.tag)||!o.node)return!1;let s=e.nodes[o.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new _v(this,n,!1);return r.addAll(e,Ge.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new _v(this,n,!0);return r.addAll(e,Ge.none,n.from,n.to),G.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let s=this.tags[o];if(b9(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,n,r,o){for(let s=o?this.styles.indexOf(o)+1:0;s<this.styles.length;s++){let a=this.styles[s],i=a.style;if(!(i.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||i.length>e.length&&(i.charCodeAt(e.length)!=61||i.slice(e.length+1)!=n))){if(a.getAttrs){let l=a.getAttrs(n);if(l===!1)continue;a.attrs=l||void 0}return a}}}static schemaRules(e){let n=[];function r(o){let s=o.priority==null?50:o.priority,a=0;for(;a<n.length;a++){let i=n[a];if((i.priority==null?50:i.priority)<s)break}n.splice(a,0,o)}for(let o in e.marks){let s=e.marks[o].spec.parseDOM;s&&s.forEach(a=>{r(a=rN(a)),a.mark||a.ignore||a.clearMark||(a.mark=o)})}for(let o in e.nodes){let s=e.nodes[o].spec.parseDOM;s&&s.forEach(a=>{r(a=rN(a)),a.node||a.ignore||a.mark||(a.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}},kN={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},g9={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},CN={ol:!0,ul:!0},fm=1,OL=2,cm=4;function nN(t,e,n){return e!=null?(e?fm:0)|(e===\"full\"?OL:0):t&&t.whitespace==\"pre\"?fm|OL:n&~cm}var _d=class{constructor(e,n,r,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=Ge.none,this.match=s||(a&cm?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(H.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fm)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \\t\\r\\n\\u000c]+$/.exec(r.text))){let s=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=H.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(H.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!kN.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},_v=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,a=nN(null,n.preserveWhitespace,0)|(r?cm:0);o?s=new _d(o.type,o.attrs,Ge.none,!0,n.topMatch||o.type.contentMatch,a):r?s=new _d(null,null,Ge.none,!0,null,a):s=new _d(e.schema.topNodeType,null,Ge.none,!0,null,a),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,s=o.options&OL?\"full\":this.localPreserveWS||(o.options&fm)>0,{schema:a}=this.parser;if(s===\"full\"||o.inlineContext(e)||/[^ \\t\\r\\n\\u000c]/.test(r)){if(s)if(s===\"full\")r=r.replace(/\\r\\n?/g,`\n`);else if(a.linebreakReplacement&&/[\\r\\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let i=r.split(/\\r?\\n|\\r/);for(let l=0;l<i.length;l++)l&&this.insertNode(a.linebreakReplacement.create(),n,!0),i[l]&&this.insertNode(a.text(i[l]),n,!/\\S/.test(i[l]));r=\"\"}else r=r.replace(/\\r?\\n|\\r/g,\" \");else if(r=r.replace(/[ \\t\\r\\n\\u000c]+/g,\" \"),/^[ \\t\\r\\n\\u000c]/.test(r)&&this.open==this.nodes.length-1){let i=o.content[o.content.length-1],l=e.previousSibling;(!i||l&&l.nodeName==\"BR\"||i.isText&&/[ \\t\\r\\n\\u000c]$/.test(i.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),n,!/\\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,s=this.top;(e.tagName==\"PRE\"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),i;CN.hasOwnProperty(a)&&this.parser.normalizeLists&&y9(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,r));e:if(l?l.ignore:g9.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(kN.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),u&&this.sync(s),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?i:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName==\"BR\"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`\n`),n)}ignoreFallback(e,n){e.nodeName==\"BR\"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(\"-\"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let s=this.parser.matchedStyles[o],a=r.getPropertyValue(s);if(a)for(let i=void 0;;){let l=this.parser.matchStyle(s,a,this,i);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)i=l;else break}}return n}addElementByRule(e,n,r,o){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,e.nodeName==\"BR\")||this.leafFallback(e,r);else{let l=this.enter(a,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let i=this.top;if(a&&a.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement==\"string\"?l=e.querySelector(n.contentElement):typeof n.contentElement==\"function\"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(i)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,i=o==null?null:e.childNodes[o];a!=i;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,n);this.findAtPoint(e,s)}findPlace(e,n,r){let o,s;for(let a=this.open,i=0;a>=0;a--){let l=this.nodes[a],u=l.findWrapping(e);if(u&&(!o||o.length>u.length+i)&&(o=u,s=l,!u.length))break;if(l.solid){if(r)break;i+=2}}if(!o)return null;this.sync(s);for(let a=0;a<o.length;a++)n=this.enterInner(o[a],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let a=Ge.none;for(let i of o.concat(e.marks))(s.type?s.type.allowsMarkType(i.type):oN(i.type,e.type))&&(a=i.addToSet(a));return s.content.push(e.mark(a)),!0}return!1}enter(e,n,r,o){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,o)),s}enterInner(e,n,r,o=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let i=nN(e,s,a.options);a.options&cm&&a.content.length==0&&(i|=cm);let l=Ge.none;return r=r.filter(u=>(a.type?a.type.allowsMarkType(u.type):oN(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new _d(e,n,l,o,null,i)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=fm)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf(\"|\")>-1)return e.split(/\\s*\\|\\s*/).some(this.matchesContext,this);let n=e.split(\"/\"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(o?0:1),a=(i,l)=>{for(;i>=0;i--){let u=n[i];if(u==\"\"){if(i==n.length-1||i==0)continue;for(;l>=s;l--)if(a(i-1,l))return!0;return!1}else{let c=l>0||l==0&&o?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function y9(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&CN.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r==\"li\"?n=e:r&&(n=null)}}function b9(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function rN(t){let e={};for(let n in t)e[n]=t[n];return e}function oN(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],a=i=>{s.push(i);for(let l=0;l<i.edgeCount;l++){let{type:u,next:c}=i.edge(l);if(u==e||s.indexOf(c)<0&&a(c))return!0}};if(a(o.contentMatch))return!0}}var Wo=class t{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Av(n).createDocumentFragment());let o=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let i=0,l=0;for(;i<s.length&&l<a.marks.length;){let u=a.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[i][0])||u.type.spec.spanning===!1)break;i++,l++}for(;i<s.length;)o=s.pop()[1];for(;l<a.marks.length;){let u=a.marks[l++],c=this.serializeMark(u,a.isInline,n);c&&(s.push([u,o]),o.appendChild(c.dom),o=c.contentDOM||c.dom)}}o.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){if(e.isText)return Av(n).createTextNode(e.text);let{dom:r,contentDOM:o}=Ev(Av(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError(\"Content hole not allowed in a leaf node spec\");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Ev(Av(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return typeof n==\"string\"?{dom:e.createTextNode(n)}:Ev(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=sN(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return sN(e.marks)}};function sN(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Av(t){return t.document||window.document}var aN=new WeakMap;function v9(t){let e=aN.get(t);return e===void 0&&aN.set(t,e=x9(t)),e}function x9(t){let e=null;function n(r){if(r&&typeof r==\"object\")if(Array.isArray(r))if(typeof r[0]==\"string\")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Ev(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let o=e[0],s;if(typeof o!=\"string\")throw new RangeError(\"Invalid array passed to renderSpec\");if(r&&(s=v9(r))&&s.indexOf(e)>-1)throw new RangeError(\"Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.\");let a=o.indexOf(\" \");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let i,l=n?t.createElementNS(n,o):t.createElement(o),u=e[1],c=1;if(u&&typeof u==\"object\"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(\" \");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d==\"style\"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>c)throw new RangeError(\"Content hole must be the only child of its parent node\");return{dom:l,contentDOM:l}}else if(typeof f==\"string\")l.appendChild(t.createTextNode(f));else{let{dom:p,contentDOM:h}=Ev(t,f,n,r);if(l.appendChild(p),h){if(i)throw new RangeError(\"Multiple content holes\");i=h}}}return{dom:l,contentDOM:i}}var RN=65535,IN=Math.pow(2,16);function w9(t,e){return t+e*IN}function LN(t){return t&RN}function S9(t){return(t-(t&RN))/IN}var MN=1,_N=2,Ov=4,ON=8,mm=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&ON)>0}get deletedBefore(){return(this.delInfo&(MN|Ov))>0}get deletedAfter(){return(this.delInfo&(_N|Ov))>0}get deletedAcross(){return(this.delInfo&Ov)>0}},Ca=class t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}recover(e){let n=0,r=LN(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+S9(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let i=0;i<this.ranges.length;i+=3){let l=this.ranges[i]-(this.inverted?o:0);if(l>e)break;let u=this.ranges[i+s],c=this.ranges[i+a],d=l+u;if(e<=d){let f=u?e==l?-1:e==d?1:n:n,p=l+o+(f<0?0:c);if(r)return p;let h=e==(n<0?l:d)?null:w9(i/3,e-l),g=e==l?_N:e==d?MN:Ov;return(n<0?e!=l:e!=d)&&(g|=ON),new mm(p,g,h)}o+=c-u}return r?e+o:new mm(e+o,0,null)}touches(e,n){let r=0,o=LN(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let i=0;i<this.ranges.length;i+=3){let l=this.ranges[i]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[i+s],c=l+u;if(e<=c&&i==o*3)return!0;r+=this.ranges[i+a]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let a=this.ranges[o],i=a-(this.inverted?s:0),l=a+(this.inverted?0:s),u=this.ranges[o+n],c=this.ranges[o+r];e(i,i+u,l,l+c),s+=c-u}}invert(){return new t(this.ranges,!this.inverted)}toString(){return(this.inverted?\"-\":\"\")+JSON.stringify(this.ranges)}static offset(e){return e==0?t.empty:new t(e<0?[0,-e,0]:[0,0,e])}};Ca.empty=new Ca([]);var gm=class t{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new t(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s],i=a.mapResult(e,n);if(i.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(i.recover);continue}}o|=i.delInfo,e=i.pos}return r?e:new mm(e,o,null)}},DL=Object.create(null),gn=class{getMap(){return Ca.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError(\"Invalid input for Step.fromJSON\");let r=DL[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in DL)throw new RangeError(\"Duplicate use of step JSON ID \"+e);return DL[e]=n,n.prototype.jsonID=e,n}},Rn=class t{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new t(e,null)}static fail(e){return new t(null,e)}static fromReplace(e,n,r,o){try{return t.ok(e.replace(n,r,o))}catch(s){if(s instanceof Mi)return t.fail(s.message);throw s}}};function zL(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(zL(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return H.fromArray(r)}var ym=class t extends gn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),s=new G(zL(n.content,(a,i)=>!a.isAtom||!i.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),n.openStart,n.openEnd);return Rn.fromReplace(e,this.from,this.to,s)}invert(){return new Xo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:\"addMark\",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!=\"number\"||typeof n.to!=\"number\")throw new RangeError(\"Invalid input for AddMarkStep.fromJSON\");return new t(n.from,n.to,e.markFromJSON(n.mark))}};gn.jsonID(\"addMark\",ym);var Xo=class t extends gn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new G(zL(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Rn.fromReplace(e,this.from,this.to,r)}invert(){return new ym(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:\"removeMark\",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!=\"number\"||typeof n.to!=\"number\")throw new RangeError(\"Invalid input for RemoveMarkStep.fromJSON\");return new t(n.from,n.to,e.markFromJSON(n.mark))}};gn.jsonID(\"removeMark\",Xo);var bm=class t extends gn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Rn.fail(\"No node at mark step's position\");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Rn.fromReplace(e,this.pos,this.pos+1,new G(H.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new t(this.pos,n.marks[o]);return new t(this.pos,this.mark)}}return new Od(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}toJSON(){return{stepType:\"addNodeMark\",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!=\"number\")throw new RangeError(\"Invalid input for AddNodeMarkStep.fromJSON\");return new t(n.pos,e.markFromJSON(n.mark))}};gn.jsonID(\"addNodeMark\",bm);var Od=class t extends gn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Rn.fail(\"No node at mark step's position\");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Rn.fromReplace(e,this.pos,this.pos+1,new G(H.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new bm(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}toJSON(){return{stepType:\"removeNodeMark\",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!=\"number\")throw new RangeError(\"Invalid input for RemoveNodeMarkStep.fromJSON\");return new t(n.pos,e.markFromJSON(n.mark))}};gn.jsonID(\"removeNodeMark\",Od);var Rt=class t extends gn{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&PL(e,this.from,this.to)?Rn.fail(\"Structure replace would overwrite content\"):Rn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ca([this.from,this.to-this.from,this.slice.size])}invert(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&t.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new t(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:\"replace\",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!=\"number\"||typeof n.to!=\"number\")throw new RangeError(\"Invalid input for ReplaceStep.fromJSON\");return new t(n.from,n.to,G.fromJSON(e,n.slice),!!n.structure)}};Rt.MAP_BIAS=1;gn.jsonID(\"replace\",Rt);var Bt=class t extends gn{constructor(e,n,r,o,s,a,i=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=a,this.structure=i}apply(e){if(this.structure&&(PL(e,this.from,this.gapFrom)||PL(e,this.gapTo,this.to)))return Rn.fail(\"Structure gap-replace would overwrite content\");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Rn.fail(\"Gap is not a flat range\");let r=this.slice.insertAt(this.insert,n.content);return r?Rn.fromReplace(e,this.from,this.to,r):Rn.fail(\"Content does not fit in gap\")}getMap(){return new Ca([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new t(n.pos,r.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:\"replaceAround\",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!=\"number\"||typeof n.to!=\"number\"||typeof n.gapFrom!=\"number\"||typeof n.gapTo!=\"number\"||typeof n.insert!=\"number\")throw new RangeError(\"Invalid input for ReplaceAroundStep.fromJSON\");return new t(n.from,n.to,n.gapFrom,n.gapTo,G.fromJSON(e,n.slice),n.insert,!!n.structure)}};gn.jsonID(\"replaceAround\",Bt);function PL(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function k9(t,e,n,r){let o=[],s=[],a,i;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,n),h=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(h)||(a&&a.to==f&&a.mark.eq(d[g])?a.to=p:o.push(a=new Xo(f,p,d[g])));i&&i.to==f?i.to=p:s.push(i=new ym(f,p,r))}}),o.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function C9(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(a,i)=>{if(!a.isInline)return;s++;let l=null;if(r instanceof dm){let u=a.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let u=Math.min(i+a.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],f;for(let p=0;p<o.length;p++){let h=o[p];h.step==s-1&&d.eq(o[p].style)&&(f=h)}f?(f.to=u,f.step=s):o.push({style:d,from:Math.max(i,e),to:u,step:s})}}}),o.forEach(a=>t.step(new Xo(a.from,a.to,a.style)))}function FL(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),a=[],i=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),c=i+u.nodeSize,d=r.matchType(u.type);if(!d)a.push(new Rt(i,c,G.empty));else{r=d;for(let f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||t.step(new Xo(i,c,u.marks[f]));if(o&&u.isText&&n.whitespace!=\"pre\"){let f,p=/\\r?\\n|\\r/g,h;for(;f=p.exec(u.text);)h||(h=new G(H.from(n.schema.text(\" \",n.allowedMarks(u.marks))),0,0)),a.push(new Rt(i+f.index,i+f.index+f[0].length,h))}}i=c}if(!r.validEnd){let l=r.fillBefore(H.empty,!0);t.replace(i,i,new G(l,0,0))}for(let l=a.length-1;l>=0;l--)t.step(a[l])}function L9(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Jo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,s=0;;--r){let a=t.$from.node(r),i=t.$from.index(r)+o,l=t.$to.indexAfter(r)-s;if(r<t.depth&&a.canReplace(i,l,n))return r;if(r==0||a.type.spec.isolating||!L9(a,i,l))break;i&&(o=1),l<a.childCount&&(s=1)}return null}function A9(t,e,n){let{$from:r,$to:o,depth:s}=e,a=r.before(s+1),i=o.after(s+1),l=a,u=i,c=H.empty,d=0;for(let h=s,g=!1;h>n;h--)g||r.index(h)>0?(g=!0,c=H.from(r.node(h).copy(c)),d++):l--;let f=H.empty,p=0;for(let h=s,g=!1;h>n;h--)g||o.after(h+1)<o.end(h)?(g=!0,f=H.from(o.node(h).copy(f)),p++):u++;t.step(new Bt(l,u,a,i,new G(c.append(f),d,p),c.size-d,!0))}function Di(t,e,n=null,r=t){let o=E9(t,e),s=o&&T9(r,e);return s?o.map(AN).concat({type:e,attrs:n}).concat(s.map(AN)):null}function AN(t){return{type:t,attrs:null}}function E9(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return n.canReplaceWith(r,o,a)?s:null}function T9(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let l=(a.length?a[a.length-1]:e).contentMatch;for(let u=r;l&&u<o;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:a}function R9(t,e,n){let r=H.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let i=n[a].type.contentMatch.matchFragment(r);if(!i||!i.validEnd)throw new RangeError(\"Wrapper type given to Transform.wrap does not form valid content of its parent wrapper\")}r=H.from(n[a].type.create(n[a].attrs,r))}let o=e.start,s=e.end;t.step(new Bt(o,s,o,s,new G(r,0,0),n.length,!0))}function I9(t,e,n,r,o){if(!r.isTextblock)throw new RangeError(\"Type given to setBlockType should be a textblock\");let s=t.steps.length;t.doc.nodesBetween(e,n,(a,i)=>{let l=typeof o==\"function\"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,l)&&M9(t.doc,t.mapping.slice(s).map(i),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace==\"pre\",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?u=!1:!p&&h&&(u=!0)}u===!1&&NN(t,a,i,s),FL(t,t.mapping.slice(s).map(i,1),r,void 0,u===null);let c=t.mapping.slice(s),d=c.map(i,1),f=c.map(i+a.nodeSize,1);return t.step(new Bt(d,f,d+1,f-1,new G(H.from(r.create(l,null,a.marks)),0,0),1,!0)),u===!0&&DN(t,a,i,s),!1}})}function DN(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let a,i=/\\r?\\n|\\r/g;for(;a=i.exec(o.text);){let l=t.mapping.slice(r).map(n+1+s+a.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function NN(t,e,n,r){e.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+s);t.replaceWith(a,a+1,e.type.schema.text(`\n`))}})}function M9(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function _9(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError(\"No node at given position\");n||(n=s.type);let a=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError(\"Invalid content for node type \"+n.name);t.step(new Bt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new G(H.from(a),0,0),1,!0))}function In(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,a=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[c+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let g=r&&r[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(p))return!1}let i=o.indexAfter(s),l=r&&r[0];return o.node(s).canReplaceWith(i,i,l?l.type:o.node(s+1).type)}function O9(t,e,n=1,r){let o=t.doc.resolve(e),s=H.empty,a=H.empty;for(let i=o.depth,l=o.depth-n,u=n-1;i>l;i--,u--){s=H.from(o.node(i).copy(s));let c=r&&r[u];a=H.from(c?c.type.create(c.attrs,a):o.node(i).copy(a))}t.step(new Rt(e,e,new G(s.append(a),n,n),!0))}function ir(t,e){let n=t.resolve(e),r=n.index();return PN(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function D9(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let s=e.child(o),a=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(a),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function PN(t,e){return!!(t&&e&&!t.isLeaf&&D9(t,e))}function La(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,a,i=r.index(o);if(o==r.depth?(s=r.nodeBefore,a=r.nodeAfter):n>0?(s=r.node(o+1),i++,a=r.node(o).maybeChild(i)):(s=r.node(o).maybeChild(i-1),a=r.node(o+1)),s&&!s.isTextblock&&PN(s,a)&&r.node(o).canReplace(i,i+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function N9(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,s=t.doc.resolve(e-n),a=s.node().type;if(o&&a.inlineContent){let c=a.whitespace==\"pre\",d=!!a.contentMatch.matchType(o);c&&!d?r=!1:!c&&d&&(r=!0)}let i=t.steps.length;if(r===!1){let c=t.doc.resolve(e+n);NN(t,c.node(),c.before(),i)}a.inlineContent&&FL(t,e+n-1,a,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(i),u=l.map(e-n);if(t.step(new Rt(u,l.map(e+n,-1),G.empty,!0)),r===!0){let c=t.doc.resolve(u);DN(t,c.node(),c.before(),t.steps.length)}return t}function P9(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function Pv(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=r.depth;a>=0;a--){let i=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(i>0?1:0),u=r.node(a),c=!1;if(s==1)c=u.canReplace(l,l,o);else{let d=u.contentMatchAt(l).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(l,l,d[0])}if(c)return i==0?r.pos:i<0?r.before(a+1):r.after(a+1)}return null}function vm(t,e,n=e,r=G.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return BN(o,s,r)?new Rt(e,n,r):new BL(o,s,r).fit()}function BN(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var BL=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=H.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=H.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let s=this.placed,a=r.depth,i=o.depth;for(;a&&i&&s.childCount==1;)s=s.firstChild.content,a--,i--;let l=new G(s,a,i);return e>-1?new Bt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Rt(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=EN(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let a=o.firstChild;for(let i=this.depth;i>=0;i--){let{type:l,match:u}=this.frontier[i],c,d=null;if(n==1&&(a?u.matchType(a.type)||(d=u.fillBefore(H.from(a),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:i,parent:s,inject:d};if(n==2&&a&&(c=u.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:i,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced;return TN(e,-1)<=n?!1:(this.unplaced.size>1&&TN(e,1)>r&&r++,this.unplaced=new G(e,n+1,r),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=EN(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new G(pm(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new G(pm(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let a=this.unplaced,i=r?r.content:a.content,l=a.openStart-e,u=0,c=[],{match:d,type:f}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)c.push(o.child(g));d=d.matchFragment(o)}let p=i.size+e-(a.content.size-a.openEnd);for(;u<i.childCount;){let g=i.child(u),m=d.matchType(g.type);if(!m)break;u++,(u>1||l==0||g.content.size)&&(d=m,c.push(zN(g.mark(f.allowedMarks(g.marks)),u==1?l:0,u==i.childCount?p:-1)))}let h=u==i.childCount;h||(p=-1),this.placed=hm(this.placed,n,H.from(c)),this.frontier[n].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,m=i;g<p;g++){let y=m.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),m=y.content}this.unplaced=h?e==0?G.empty:new G(pm(a.content,e-1,1),e-1,p<0?a.openEnd:e-1):new G(pm(a.content,e,u),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!NL(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=NL(e,n,o,r,s);if(a){for(let i=n-1;i>=0;i--){let{match:l,type:u}=this.frontier[i],c=NL(e,i,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:a,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=hm(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=hm(this.placed,this.depth,H.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(H.empty,!0);n.childCount&&(this.placed=hm(this.placed,this.frontier.length,n))}};function pm(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(pm(t.firstChild.content,e-1,n)))}function hm(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(hm(t.lastChild.content,e-1,n)))}function EN(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function zN(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,zN(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(H.empty,!0)))),t.copy(r)}function NL(t,e,n,r,o){let s=t.node(e),a=o?t.indexAfter(e):t.index(e);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let i=r.fillBefore(s.content,!0,a);return i&&!B9(n,s.content,a)?i:null}function B9(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function z9(t){return t.spec.defining||t.spec.definingForContent}function TN(t,e){for(let n=0;;n++){let r=e<0?t.firstChild:t.lastChild;if(!r||r.isAtom)return n;t=r.content}}function F9(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(BN(o,s,r))return t.step(new Rt(e,n,r));let a=HN(o,s);a[a.length-1]==0&&a.pop();let i=-(o.depth+1);a.unshift(i);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;a.indexOf(f)>-1?i=f:o.before(f)==p&&a.splice(1,0,-f)}let l=a.indexOf(i),u=[],c=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(u.push(h),p==r.openStart)break;f=h.content}for(let f=c-1;f>=0;f--){let p=u[f],h=z9(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(i)-1)))c=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+c+1)%(r.openStart+1),h=u[p];if(h)for(let g=0;g<a.length;g++){let m=a[(g+l)%a.length],y=!0;m<0&&(y=!1,m=-m);let b=o.node(m-1),x=o.index(m-1);if(b.canReplaceWith(x,x,h.type,h.marks))return t.replace(o.before(m),y?s.after(m):n,new G(FN(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let f=a.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=a[f];p<0||(e=o.before(p),n=s.after(p))}}function FN(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(FN(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(H.empty,!0))}return t}function H9(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=P9(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new G(H.from(r),0,0))}function $9(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&r.parentOffset==0&&o.parentOffset==0){let a=r.sharedDepth(n),i=!1;for(let l=r.depth;l>a;l--)r.node(l).type.spec.isolating&&(i=!0);for(let l=o.depth;l>a;l--)o.node(l).type.spec.isolating&&(i=!0);if(!i){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=o.depth;l>0&&n==o.start(l);l--)n=o.before(l);r=t.doc.resolve(e),o=t.doc.resolve(n)}}let s=HN(r,o);for(let a=0;a<s.length;a++){let i=s[a],l=a==s.length-1;if(l&&i==0||r.node(i).type.contentMatch.validEnd)return t.delete(r.start(i),o.end(i));if(i>0&&(l||r.node(i-1).canReplace(r.index(i-1),o.indexAfter(i-1))))return t.delete(r.before(i),o.after(i))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&o.end(a)-n!=o.depth-a&&r.start(a-1)==o.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),o.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function HN(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}var Dv=class t extends gn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Rn.fail(\"No node at attribute step's position\");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Rn.fromReplace(e,this.pos,this.pos+1,new G(H.from(o),0,n.isLeaf?0:1))}getMap(){return Ca.empty}invert(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}toJSON(){return{stepType:\"attr\",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!=\"number\"||typeof n.attr!=\"string\")throw new RangeError(\"Invalid input for AttrStep.fromJSON\");return new t(n.pos,n.attr,n.value)}};gn.jsonID(\"attr\",Dv);var Nv=class t extends gn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Rn.ok(r)}getMap(){return Ca.empty}invert(e){return new t(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:\"docAttr\",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!=\"string\")throw new RangeError(\"Invalid input for DocAttrStep.fromJSON\");return new t(n.attr,n.value)}};gn.jsonID(\"docAttr\",Nv);var Dd=class extends Error{};Dd=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Dd.prototype=Object.create(Error.prototype);Dd.prototype.constructor=Dd;Dd.prototype.name=\"TransformError\";var Oi=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new gm}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Dd(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(e=o.map(e,1),n=o.map(n,-1)),o.forEach((s,a,i,l)=>{e=Math.min(e,i),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=G.empty){let o=vm(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new G(H.from(r),0,0))}delete(e,n){return this.replace(e,n,G.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return F9(this,e,n,r),this}replaceRangeWith(e,n,r){return H9(this,e,n,r),this}deleteRange(e,n){return $9(this,e,n),this}lift(e,n){return A9(this,e,n),this}join(e,n=1){return N9(this,e,n),this}wrap(e,n){return R9(this,e,n),this}setBlockType(e,n=e,r,o=null){return I9(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return _9(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Dv(e,n,r)),this}setDocAttribute(e,n){return this.step(new Nv(e,n)),this}addNodeMark(e,n){return this.step(new bm(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError(\"No node at position \"+e);if(n instanceof Ge)n.isInSet(r.marks)&&this.step(new Od(e,n));else{let o=r.marks,s,a=[];for(;s=n.isInSet(o);)a.push(new Od(e,s)),o=s.removeFromSet(o);for(let i=a.length-1;i>=0;i--)this.step(a[i])}return this}split(e,n=1,r){return O9(this,e,n,r),this}addMark(e,n,r){return k9(this,e,n,r),this}removeMark(e,n,r){return C9(this,e,n,r),this}clearIncompatible(e,n,r){return FL(this,e,n,r),this}};var HL=Object.create(null),pe=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new zv(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=G.empty){let r=n.content.lastChild,o=null;for(let i=0;i<n.openEnd;i++)o=r,r=r.lastChild;let s=e.steps.length,a=this.ranges;for(let i=0;i<a.length;i++){let{$from:l,$to:u}=a[i],c=e.mapping.slice(s);e.replaceRange(c.map(l.pos),c.map(u.pos),i?G.empty:n),i==0&&jN(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:i}=o[s],l=e.mapping.slice(r),u=l.map(a.pos),c=l.map(i.pos);s?e.deleteRange(u,c):(e.replaceRangeWith(u,c,n),jN(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new J(e):Nd(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let a=n<0?Nd(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Nd(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Mn(e.node(0))}static atStart(e){return Nd(e,e,0,0,1)||new Mn(e)}static atEnd(e){return Nd(e,e,e.content.size,e.childCount,-1)||new Mn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError(\"Invalid input for Selection.fromJSON\");let r=HL[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in HL)throw new RangeError(\"Duplicate use of selection JSON ID \"+e);return HL[e]=n,n.prototype.jsonID=e,n}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}};pe.prototype.visible=!0;var zv=class{constructor(e,n){this.$from=e,this.$to=n}},$N=!1;function UN(t){!$N&&!t.parent.inlineContent&&($N=!0,console.warn(\"TextSelection endpoint not pointing into a node with inline content (\"+t.parent.type.name+\")\"))}var J=class t extends pe{constructor(e,n=e){UN(e),UN(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return pe.near(r);let o=e.resolve(n.map(this.anchor));return new t(o.parent.inlineContent?o:r,r)}replace(e,n=G.empty){if(super.replace(e,n),n==G.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Fv(this.anchor,this.head)}toJSON(){return{type:\"text\",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!=\"number\"||typeof n.head!=\"number\")throw new RangeError(\"Invalid input for TextSelection.fromJSON\");return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let s=pe.findFrom(n,r,!0)||pe.findFrom(n,-r,!0);if(s)n=s.$head;else return pe.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(pe.findFrom(e,-r,!0)||pe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new t(e,n)}};pe.jsonID(\"text\",J);var Fv=class t{constructor(e,n){this.anchor=e,this.head=n}map(e){return new t(e.map(this.anchor),e.map(this.head))}resolve(e){return J.between(e.resolve(this.anchor),e.resolve(this.head))}},oe=class t extends pe{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),s=e.resolve(o);return r?pe.near(s):new t(s)}content(){return new G(H.from(this.node),0,0)}eq(e){return e instanceof t&&e.anchor==this.anchor}toJSON(){return{type:\"node\",anchor:this.anchor}}getBookmark(){return new UL(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!=\"number\")throw new RangeError(\"Invalid input for NodeSelection.fromJSON\");return new t(e.resolve(n.anchor))}static create(e,n){return new t(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};oe.prototype.visible=!1;pe.jsonID(\"node\",oe);var UL=class t{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Fv(r,r):new t(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&oe.isSelectable(r)?new oe(n):pe.near(n)}},Mn=class t extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=G.empty){if(n==G.empty){e.delete(0,e.doc.content.size);let r=pe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:\"all\"}}static fromJSON(e){return new t(e)}map(e){return new t(e)}eq(e){return e instanceof t}getBookmark(){return U9}};pe.jsonID(\"all\",Mn);var U9={map(){return this},resolve(t){return new Mn(t)}};function Nd(t,e,n,r,o,s=!1){if(e.inlineContent)return J.create(t,n);for(let a=r-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){let i=e.child(a);if(i.isAtom){if(!s&&oe.isSelectable(i))return oe.create(t,n-(o<0?i.nodeSize:0))}else{let l=Nd(t,i,n+o,o<0?i.childCount:0,o,s);if(l)return l}n+=i.nodeSize*o}return null}function jN(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Rt||o instanceof Bt))return;let s=t.mapping.maps[r],a;s.forEach((i,l,u,c)=>{a==null&&(a=c)}),t.setSelection(pe.near(t.doc.resolve(a),n))}var qN=1,Bv=2,VN=4,jL=class extends Oi{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError(\"Selection passed to setSelection must point at the current document\");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|qN)&~Bv,this.storedMarks=null,this}get selectionSet(){return(this.updated&qN)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Bv,this}ensureMarks(e){return Ge.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Bv)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Bv,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(pe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e==\"string\"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e==\"string\"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=VN,this}get scrolledIntoView(){return(this.updated&VN)>0}};function KN(t,e){return!e||!t?t:t.bind(e)}var du=class{constructor(e,n,r){this.name=e,this.init=KN(n.init,r),this.apply=KN(n.apply,r)}},j9=[new du(\"doc\",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new du(\"selection\",{init(t,e){return t.selection||pe.atStart(e.doc)},apply(t){return t.selection}}),new du(\"storedMarks\",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new du(\"scrollToSelection\",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],xm=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=j9.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError(\"Adding different instances of a keyed plugin (\"+r.key+\")\");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new du(r.key,r.spec.state,r))})}},Cs=class t{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let i=this.config.plugins[a];if(i.spec.appendTransaction){let l=o?o[a].n:0,u=o?o[a].state:this,c=l<n.length&&i.spec.appendTransaction.call(i,l?n.slice(l):n,u,r);if(c&&r.filterTransaction(c,a)){if(c.setMeta(\"appendedTransaction\",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<a?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),s=!0}o&&(o[a]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError(\"Applying a mismatched transaction\");let n=new t(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new jL(this)}static create(e){let n=new xm(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new t(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new xm(this.schema,e.plugins),r=n.fields,o=new t(n);for(let s=0;s<r.length;s++){let a=r[s].name;o[a]=this.hasOwnProperty(a)?this[a]:r[s].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e==\"object\")for(let r in e){if(r==\"doc\"||r==\"selection\")throw new RangeError(\"The JSON fields `doc` and `selection` are reserved\");let o=e[r],s=o.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError(\"Invalid input for EditorState.fromJSON\");if(!e.schema)throw new RangeError(\"Required config field 'schema' missing\");let o=new xm(e.schema,e.plugins),s=new t(o);return o.fields.forEach(a=>{if(a.name==\"doc\")s.doc=Ro.fromJSON(e.schema,n.doc);else if(a.name==\"selection\")s.selection=pe.fromJSON(s.doc,n.selection);else if(a.name==\"storedMarks\")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let i in r){let l=r[i],u=l.spec.state;if(l.key==a.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){s[a.name]=u.fromJSON.call(l,e,n[i],s);return}}s[a.name]=a.init(e,s)}}),s}};function GN(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r==\"handleDOMEvents\"&&(o=GN(o,e,{})),n[r]=o}return n}var ie=class{constructor(e){this.spec=e,this.props={},e.props&&GN(e.props,this,this.props),this.key=e.key?e.key.key:WN(\"plugin\")}getState(e){return e[this.key]}},$L=Object.create(null);function WN(t){return t in $L?t+\"$\"+ ++$L[t]:($L[t]=0,t+\"$\")}var we=class{constructor(e=\"key\"){this.key=WN(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var Ix=T(Tl(),1),eA=T(VL(),1);var ZN=Object.defineProperty,QN=(t,e)=>{let n={};for(var r in t)ZN(n,r,{get:t[r],enumerable:!0});return e||ZN(n,Symbol.toStringTag,{value:\"Module\"}),n};var tP=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function nP(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock(\"backward\",t):n.parentOffset>0)?null:n}var wm=(t,e,n)=>{let r=nP(t,n);if(!r)return!1;let o=GL(r);if(!o){let a=r.blockRange(),i=a&&Jo(a);return i==null?!1:(e&&e(t.tr.lift(a,i).scrollIntoView()),!0)}let s=o.nodeBefore;if(sP(t,o,e,-1))return!0;if(r.parent.content.size==0&&(Bd(s,\"end\")||oe.isSelectable(s)))for(let a=r.depth;;a--){let i=vm(t.doc,r.before(a),r.after(a),G.empty);if(i&&i.slice.size<i.to-i.from){if(e){let l=t.tr.step(i);l.setSelection(Bd(s,\"end\")?pe.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):oe.create(l.doc,o.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1},Hv=(t,e,n)=>{let r=nP(t,n);if(!r)return!1;let o=GL(r);return o?rP(t,o,e):!1},$v=(t,e,n)=>{let r=oP(t,n);if(!r)return!1;let o=WL(r);return o?rP(t,o,e):!1};function rP(t,e,n){let r=e.nodeBefore,o=r,s=e.pos-1;for(;!o.isTextblock;s--){if(o.type.spec.isolating)return!1;let c=o.lastChild;if(!c)return!1;o=c}let a=e.nodeAfter,i=a,l=e.pos+1;for(;!i.isTextblock;l++){if(i.type.spec.isolating)return!1;let c=i.firstChild;if(!c)return!1;i=c}let u=vm(t.doc,s,l,G.empty);if(!u||u.from!=s||u instanceof Rt&&u.slice.size>=l-s)return!1;if(n){let c=t.tr.step(u);c.setSelection(J.create(c.doc,s)),n(c.scrollIntoView())}return!0}function Bd(t,e,n=!1){for(let r=t;r;r=e==\"start\"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Sm=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(\"backward\",t):r.parentOffset>0)return!1;s=GL(r)}let a=s&&s.nodeBefore;return!a||!oe.isSelectable(a)?!1:(e&&e(t.tr.setSelection(oe.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function GL(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function oP(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock(\"forward\",t):n.parentOffset<n.parent.content.size)?null:n}var km=(t,e,n)=>{let r=oP(t,n);if(!r)return!1;let o=WL(r);if(!o)return!1;let s=o.nodeAfter;if(sP(t,o,e,1))return!0;if(r.parent.content.size==0&&(Bd(s,\"start\")||oe.isSelectable(s))){let a=vm(t.doc,r.before(),r.after(),G.empty);if(a&&a.slice.size<a.to-a.from){if(e){let i=t.tr.step(a);i.setSelection(Bd(s,\"start\")?pe.findFrom(i.doc.resolve(i.mapping.map(o.pos)),1):oe.create(i.doc,i.mapping.map(o.pos))),e(i.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},Cm=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(\"forward\",t):r.parentOffset<r.parent.content.size)return!1;s=WL(r)}let a=s&&s.nodeAfter;return!a||!oe.isSelectable(a)?!1:(e&&e(t.tr.setSelection(oe.create(t.doc,s.pos)).scrollIntoView()),!0)};function WL(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}var Uv=(t,e)=>{let n=t.selection,r=n instanceof oe,o;if(r){if(n.node.isTextblock||!ir(t.doc,n.from))return!1;o=n.from}else if(o=La(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(oe.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},jv=(t,e)=>{let n=t.selection,r;if(n instanceof oe){if(n.node.isTextblock||!ir(t.doc,n.to))return!1;r=n.to}else if(r=La(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},qv=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&Jo(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},Lm=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`\n`).scrollIntoView()),!0)};function XL(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Am=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),a=XL(o.contentMatchAt(s));if(!a||!o.canReplaceWith(s,s,a))return!1;if(e){let i=n.after(),l=t.tr.replaceWith(i,i,a.createAndFill());l.setSelection(pe.near(l.doc.resolve(i),1)),e(l.scrollIntoView())}return!0},Em=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Mn||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=XL(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,i=t.tr.insert(a,s.createAndFill());i.setSelection(J.create(i.doc,a+1)),e(i.scrollIntoView())}return!0},Tm=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(In(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Jo(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function Q9(t){return(e,n)=>{if(e.selection instanceof oe&&e.selection.node.isBlock){let{$from:p}=e.selection;return!p.parentOffset||!In(e.doc,p.pos)?!1:(n&&n(e.tr.split(p.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let r=e.tr;!e.selection.empty&&(e.selection instanceof J||e.selection instanceof Mn)&&r.deleteSelection();let{$from:o}=r.selection,s=r.steps.length,a=[],i,l,u=!1,c=!1;for(let p=o.depth;;p--)if(o.node(p).isBlock){u=o.end(p)==o.pos+(o.depth-p),c=o.start(p)==o.pos-(o.depth-p),l=XL(o.node(p-1).contentMatchAt(o.indexAfter(p-1)));let g=t&&t(o.parent,u,o);a.unshift(g||(u&&l?{type:l}:null)),i=p;break}else{if(p==1)return!1;a.unshift(null)}let d=o.pos,f=In(r.doc,d,a.length,a);if(f||(a[0]=l?{type:l}:null,f=In(r.doc,d,a.length,a)),!f)return!1;if(r.split(d,a.length,a),!u&&c&&o.node(i).type!=l){let p=r.mapping.slice(s),h=p.map(o.before(i)),g=r.doc.resolve(h);l&&o.node(i-1).canReplaceWith(g.index(),g.index()+1,l)&&r.setNodeMarkup(p.map(o.before(i)),l)}return n&&n(r.scrollIntoView()),!0}}var eK=Q9();var Vv=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(oe.create(t.doc,o))),!0)},tK=(t,e)=>(e&&e(t.tr.setSelection(new Mn(t.doc))),!0);function nK(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||ir(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function sP(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,a,i,l=o.type.spec.isolating||s.type.spec.isolating;if(!l&&nK(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(a=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(a[0]||s.type).validEnd){if(n){let p=e.pos+s.nodeSize,h=H.empty;for(let y=a.length-1;y>=0;y--)h=H.from(a[y].create(null,h));h=H.from(o.copy(h));let g=t.tr.step(new Bt(e.pos-1,p,e.pos,p,new G(h,1,0),a.length,!0)),m=g.doc.resolve(p+2*a.length);m.nodeAfter&&m.nodeAfter.type==o.type&&ir(g.doc,m.pos)&&g.join(m.pos),n(g.scrollIntoView())}return!0}let c=s.type.spec.isolating||r>0&&l?null:pe.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),f=d&&Jo(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(u&&Bd(s,\"start\",!0)&&Bd(o,\"end\")){let p=o,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let g=s,m=1;for(;!g.isTextblock;g=g.firstChild)m++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let y=H.empty;for(let x=h.length-1;x>=0;x--)y=H.from(h[x].copy(y));let b=t.tr.step(new Bt(e.pos-h.length,e.pos+s.nodeSize,e.pos+m,e.pos+s.nodeSize-m,new G(y,h.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function aP(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(J.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}var Rm=aP(-1),Im=aP(1);function Kv(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,a=o.blockRange(s),i=a&&Di(a,t,e);return i?(r&&r(n.tr.wrap(a,i).scrollIntoView()),!0):!1}}function zd(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:a},$to:{pos:i}}=n.selection.ranges[s];n.doc.nodesBetween(a,i,(l,u)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let c=n.doc.resolve(u),d=c.index();o=c.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:i},$to:{pos:l}}=n.selection.ranges[a];s.setBlockType(i,l,t,e)}r(s.scrollIntoView())}return!0}}function JL(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var KL=JL(tP,wm,Sm),eP=JL(tP,km,Cm),Ni={Enter:JL(Lm,Em,Tm,eK),\"Mod-Enter\":Am,Backspace:KL,\"Mod-Backspace\":KL,\"Shift-Backspace\":KL,Delete:eP,\"Mod-Delete\":eP,\"Mod-a\":tK},rK={\"Ctrl-h\":Ni.Backspace,\"Alt-Backspace\":Ni[\"Mod-Backspace\"],\"Ctrl-d\":Ni.Delete,\"Ctrl-Alt-Backspace\":Ni[\"Mod-Delete\"],\"Alt-Delete\":Ni[\"Mod-Delete\"],\"Alt-d\":Ni[\"Mod-Delete\"],\"Ctrl-a\":Rm,\"Ctrl-e\":Im};for(let t in Ni)rK[t]=Ni[t];var ade=typeof navigator<\"u\"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<\"u\"&&os.platform?os.platform()==\"darwin\":!1;function Gv(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,a=o.blockRange(s);if(!a)return!1;let i=r?n.tr:null;return oK(i,a,t,e)?(r&&r(i.scrollIntoView()),!0):!1}}function oK(t,e,n,r=null){let o=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=a.resolve(e.start-2);s=new uu(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new uu(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let i=Di(s,n,r,e);return i?(t&&sK(t,e,i,o,n),!0):!1}function sK(t,e,n,r,o){let s=H.empty;for(let c=n.length-1;c>=0;c--)s=H.from(n[c].type.create(n[c].attrs,s));t.step(new Bt(e.start-(r?2:0),e.end,e.start,e.end,new G(s,0,0),n.length,!0));let a=0;for(let c=0;c<n.length;c++)n[c].type==o&&(a=c+1);let i=n.length-a,l=e.start+n.length-(r?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,f=!0;c<d;c++,f=!1)!f&&In(t.doc,l,i)&&(t.split(l,i),l+=2*i),l+=u.child(c).nodeSize;return t}function Wv(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,a=>a.childCount>0&&a.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?aK(e,n,t,s):iK(e,n,s):!0:!1}}function aK(t,e,n,r){let o=t.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(o.step(new Bt(s-1,a,s,a,new G(H.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new uu(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));let i=Jo(r);if(i==null)return!1;o.lift(r,i);let l=o.doc.resolve(o.mapping.map(s,-1)-1);return ir(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}function iK(t,e,n){let r=t.tr,o=n.parent;for(let p=n.end,h=n.endIndex-1,g=n.startIndex;h>g;h--)p-=o.child(h).nodeSize,r.delete(p-1,p+1);let s=r.doc.resolve(n.start),a=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let i=n.startIndex==0,l=n.endIndex==o.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(i?0:1),c+1,a.content.append(l?H.empty:H.from(o))))return!1;let d=s.pos,f=d+a.nodeSize;return r.step(new Bt(d-(i?1:0),f+(l?1:0),d+1,f-1,new G((i?H.empty:H.from(o.copy(H.empty))).append(l?H.empty:H.from(o.copy(H.empty))),i?0:1,l?0:1),i?0:1)),e(r.scrollIntoView()),!0}function Xv(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,u=>u.childCount>0&&u.firstChild.type==t);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let i=s.parent,l=i.child(a-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==i.type,c=H.from(u?t.create():null),d=new G(H.from(t.create(null,H.from(i.type.create(null,c)))),u?3:1,0),f=s.start,p=s.end;n(e.tr.step(new Bt(f-(u?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}var _n=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Ud=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},t1=null,Ea=function(t,e,n){let r=t1||(t1=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},lK=function(){t1=null},vu=function(t,e,n,r){return n&&(iP(t,e,n,r,-1)||iP(t,e,n,r,1))},uK=/^(img|br|input|textarea|hr)$/i;function iP(t,e,n,r,o){for(var s;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Mo(t))){let a=t.parentNode;if(!a||a.nodeType!=1||zm(t)||uK.test(t.nodeName)||t.contentEditable==\"false\")return!1;e=_n(t)+(o<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[e+(o<0?-1:0)];if(a.nodeType==1&&a.contentEditable==\"false\")if(!((s=a.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=o;else return!1;else t=a,e=o<0?Mo(t):0}else return!1}}function Mo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function cK(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable==\"false\")return null;t=t.childNodes[e-1],e=Mo(t)}else if(t.parentNode&&!zm(t))e=_n(t),t=t.parentNode;else return null}}function dK(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable==\"false\")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!zm(t))e=_n(t)+1,t=t.parentNode;else return null}}function fK(t,e,n){for(let r=e==0,o=e==Mo(t);r||o;){if(t==n)return!0;let s=_n(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==Mo(t)}}function zm(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var ix=function(t){return t.focusNode&&vu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function fu(t,e){let n=document.createEvent(\"Event\");return n.initEvent(\"keydown\",!0,!0),n.keyCode=t,n.key=n.code=e,n}function pK(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function hK(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Mo(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Mo(r.startContainer),r.startOffset)}}}var Ls=typeof navigator<\"u\"?navigator:null,lP=typeof document<\"u\"?document:null,Hi=Ls&&Ls.userAgent||\"\",n1=/Edge\\/(\\d+)/.exec(Hi),BP=/MSIE \\d/.exec(Hi),r1=/Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(Hi),Ar=!!(BP||r1||n1),zi=BP?document.documentMode:r1?+r1[1]:n1?+n1[1]:0,_o=!Ar&&/gecko\\/(\\d+)/i.test(Hi);_o&&+(/Firefox\\/(\\d+)/.exec(Hi)||[0,0])[1];var o1=!Ar&&/Chrome\\/(\\d+)/.exec(Hi),On=!!o1,zP=o1?+o1[1]:0,Gn=!Ar&&!!Ls&&/Apple Computer/.test(Ls.vendor),jd=Gn&&(/Mobile\\/\\w+/.test(Hi)||!!Ls&&Ls.maxTouchPoints>2),Io=jd||(Ls?/Mac/.test(Ls.platform):!1),FP=Ls?/Win/.test(Ls.platform):!1,Ta=/Android \\d/.test(Hi),Fm=!!lP&&\"webkitFontSmoothing\"in lP.documentElement.style,mK=Fm?+(/\\bAppleWebKit\\/(\\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function gK(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Aa(t,e){return typeof t==\"number\"?t:t[e]}function yK(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function uP(t,e,n){if(!s1(e)&&e.left==0)return;let r=t.someProp(\"scrollThreshold\")||0,o=t.someProp(\"scrollMargin\")||5,s=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=Ud(a);continue}let i=a,l=i==s.body,u=l?gK(s):yK(i),c=0,d=0;if(e.top<u.top+Aa(r,\"top\")?d=-(u.top-e.top+Aa(o,\"top\")):e.bottom>u.bottom-Aa(r,\"bottom\")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Aa(o,\"top\")-u.top:e.bottom-u.bottom+Aa(o,\"bottom\")),e.left<u.left+Aa(r,\"left\")?c=-(u.left-e.left+Aa(o,\"left\")):e.right>u.right-Aa(r,\"right\")&&(c=e.right-u.right+Aa(o,\"right\")),c||d)if(l)s.defaultView.scrollBy(c,d);else{let p=i.scrollLeft,h=i.scrollTop;d&&(i.scrollTop+=d),c&&(i.scrollLeft+=c);let g=i.scrollLeft-p,m=i.scrollTop-h;e={left:e.left-g,top:e.top-m,right:e.right-g,bottom:e.bottom-m}}let f=l?\"fixed\":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(f))break;a=f==\"absolute\"?a.offsetParent:Ud(a)}}function bK(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let i=t.root.elementFromPoint(s,a);if(!i||i==t.dom||!t.dom.contains(i))continue;let l=i.getBoundingClientRect();if(l.top>=n-20){r=i,o=l.top;break}}return{refDOM:r,refTop:o,stack:HP(t.dom)}}function HP(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Ud(r));return e}function vK({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;$P(n,r==0?0:r-e)}function $P(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}var Fd=null;function xK(t){if(t.setActive)return t.setActive();if(Fd)return t.focus(Fd);let e=HP(t);t.focus(Fd==null?{get preventScroll(){return Fd={preventScroll:!0},!0}}:void 0),Fd||(Fd=!1,$P(e,0))}function UP(t,e){let n,r=2e8,o,s=0,a=e.top,i=e.top,l,u;for(let c=t.firstChild,d=0;c;c=c.nextSibling,d++){let f;if(c.nodeType==1)f=c.getClientRects();else if(c.nodeType==3)f=Ea(c).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=a&&h.bottom>=i){a=Math.max(h.bottom,a),i=Math.min(h.top,i);let g=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(g<r){n=c,r=g,o=g&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,c.nodeType==1&&g&&(s=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=c,u={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(s=d+1)}}return!n&&l&&(n=l,o=u,r=0),n&&n.nodeType==3?wK(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:UP(n,o)}function wK(t,e){let n=t.nodeValue.length,r=document.createRange(),o;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let a=Pi(r,1);if(a.top!=a.bottom&&w1(e,a)){o={node:t,offset:s+(e.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),o||{node:t,offset:0}}function w1(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function SK(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function kK(t,e,n){let{node:r,offset:o}=UP(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function CK(t,e,n,r){let o=-1;for(let s=e,a=!1;s!=t.dom;){let i=t.docView.nearestDesc(s,!0),l;if(!i)return null;if(i.dom.nodeType==1&&(i.node.isBlock&&i.parent||!i.contentDOM)&&((l=i.dom.getBoundingClientRect()).width||l.height)&&(i.node.isBlock&&i.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(i.dom.nodeName)&&(!a&&l.left>r.left||l.top>r.top?o=i.posBefore:(!a&&l.right<r.left||l.bottom<r.top)&&(o=i.posAfter),a=!0),!i.contentDOM&&o<0&&!i.node.isText))return(i.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?i.posBefore:i.posAfter;s=i.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function jP(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let a=t.childNodes[s];if(a.nodeType==1){let i=a.getClientRects();for(let l=0;l<i.length;l++){let u=i[l];if(w1(e,u))return jP(a,e,u)}}if((s=(s+1)%r)==o)break}return t}function LK(t,e){let n=t.dom.ownerDocument,r,o=0,s=hK(n,e.left,e.top);s&&({node:r,offset:o}=s);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),i;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let u=t.dom.getBoundingClientRect();if(!w1(e,u)||(a=jP(t.dom,e,u),!a))return null}if(Gn)for(let u=a;r&&u;u=Ud(u))u.draggable&&(r=void 0);if(a=SK(a,e),r){if(_o&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let c=r.childNodes[o],d;c.nodeName==\"IMG\"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let u;Fm&&o&&r.nodeType==1&&(u=r.childNodes[o-1]).nodeType==1&&u.contentEditable==\"false\"&&u.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?i=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!=\"BR\")&&(i=CK(t,r,o,e))}i==null&&(i=kK(t,a,e));let l=t.docView.nearestDesc(a,!0);return{pos:i,inside:l?l.posAtStart-l.border:-1}}function s1(t){return t.top<t.bottom||t.left<t.right}function Pi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(s1(r))return r}return Array.prototype.find.call(n,s1)||t.getBoundingClientRect()}var AK=/[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;function qP(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=Fm||_o;if(r.nodeType==3)if(a&&(AK.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=Pi(Ea(r,o,o),n);if(_o&&o&&/\\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let u=Pi(Ea(r,o-1,o-1),-1);if(u.top==l.top){let c=Pi(Ea(r,o,o+1),-1);if(c.top!=l.top)return Mm(c,c.left<u.left)}}return l}else{let l=o,u=o,c=n<0?1:-1;return n<0&&!o?(u++,c=-1):n>=0&&o==r.nodeValue.length?(l--,c=1):n<0?l--:u++,Mm(Pi(Ea(r,l,u),c),c<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Mo(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return YL(l.getBoundingClientRect(),!1)}if(s==null&&o<Mo(r)){let l=r.childNodes[o];if(l.nodeType==1)return YL(l.getBoundingClientRect(),!0)}return YL(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Mo(r))){let l=r.childNodes[o-1],u=l.nodeType==3?Ea(l,Mo(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!=\"BR\"||!l.nextSibling)?l:null;if(u)return Mm(Pi(u,1),!1)}if(s==null&&o<Mo(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Ea(l,0,a?0:1):l.nodeType==1?l:null:null;if(u)return Mm(Pi(u,-1),!0)}return Mm(Pi(r.nodeType==3?Ea(r):r,-n),n>=0)}function Mm(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function YL(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function VP(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function EK(t,e,n){let r=e.selection,o=n==\"up\"?r.$from:r.$to;return VP(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n==\"up\"?-1:1);for(;;){let i=t.docView.nearestDesc(s,!0);if(!i)break;if(i.node.isBlock){s=i.contentDOM||i.dom;break}s=i.dom.parentNode}let a=qP(t,o.pos,1);for(let i=s.firstChild;i;i=i.nextSibling){let l;if(i.nodeType==1)l=i.getClientRects();else if(i.nodeType==3)l=Ea(i,0,i.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(n==\"up\"?a.top-c.top>(c.bottom-a.top)*2:c.bottom-a.bottom>(a.bottom-c.top)*2))return!1}}return!0})}var TK=/[\\u0590-\\u08ac]/;function RK(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,a=o==r.parent.content.size,i=t.domSelection();return i?!TK.test(r.parent.textContent)||!i.modify?n==\"left\"||n==\"backward\"?s:a:VP(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:d}=t.domSelectionRange(),f=i.caretBidiLevel;i.modify(\"move\",n,\"character\");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:g}=t.domSelectionRange(),m=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&u==g;try{i.collapse(c,d),l&&(l!=c||u!=d)&&i.extend&&i.extend(l,u)}catch{}return f!=null&&(i.caretBidiLevel=f),m}):r.pos==r.start()||r.pos==r.end()}var cP=null,dP=null,fP=!1;function IK(t,e,n){return cP==e&&dP==n?fP:(cP=e,dP=n,fP=n==\"up\"||n==\"down\"?EK(t,e,n):RK(t,e,n))}var Oo=0,pP=1,pu=2,Yo=3,xu=class{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Oo,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,a;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(a)+a.size:this.posAtStart}else{let s,a;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>_n(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let s=this.getDesc(o),a;if(s&&(!n||s.node))if(r&&(a=s.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)for(let a=0;a<o.children.length;a++){let i=o.children[a];if(i.size){o=i;break}}return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let a=this.children[r],i=s+a.size;if(i>e||a instanceof Zv){o=e-s;break}s=i}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Jv&&s.side>=0;r--);if(n<=0){let s,a=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?_n(s.dom)+1:0}}else{let s,a=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?_n(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,s=-1;for(let a=r,i=0;;i++){let l=this.children[i],u=a+l.size;if(o==-1&&e<=u){let c=a+l.border;if(e>=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=a;for(let d=i;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=_n(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(u>n||i==this.children.length-1)){n=u;for(let c=i+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=_n(d.dom);break}n+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=u}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError(\"No node after pos \"+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let s=Math.min(e,n),a=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let g=this.children[p],m=h+g.size;if(s>h&&a<m)return g.setSelection(e-h-g.border,n-h-g.border,r,o);h=m}let i=this.domFromPos(e,e?-1:1),l=n==e?i:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),c=r.domSelectionRange(),d=!1;if((_o||Gn)&&e==n){let{node:p,offset:h}=i;if(p.nodeType==3){if(d=!!(h&&p.nodeValue[h-1]==`\n`),d&&h==p.nodeValue.length)for(let g=p,m;g;g=g.parentNode){if(m=g.nextSibling){m.nodeName==\"BR\"&&(i=l={node:m.parentNode,offset:_n(m)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=p.childNodes[h-1];d=g&&(g.nodeName==\"BR\"||g.contentEditable==\"false\")}}if(_o&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let p=c.focusNode.childNodes[c.focusOffset];p&&p.contentEditable==\"false\"&&(o=!0)}if(!(o||d&&Gn)&&vu(i.node,i.offset,c.anchorNode,c.anchorOffset)&&vu(l.node,l.offset,c.focusNode,c.focusOffset))return;let f=!1;if((u.extend||e==n)&&!(d&&_o)){u.collapse(i.node,i.offset);try{e!=n&&u.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let h=i;i=l,l=h}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(i.node,i.offset),u.removeAllRanges(),u.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!=\"selection\"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let s=this.children[o],a=r+s.size;if(r==a?e<=a&&n>=r:e<a&&n>r){let i=r+s.border,l=a-s.border;if(e>=i&&n<=l){this.dirty=e==r||n==a?pu:pP,e==i&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Yo:s.markDirty(e-i,n-i);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?pu:Yo}r=a}this.dirty=pu}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?pu:pP;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Jv=class extends xu{constructor(e,n,r,o){let s,a=n.type.toDOM;if(typeof a==\"function\"&&(a=a(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(a.nodeType!=1){let i=document.createElement(\"span\");i.appendChild(a),a=i}a.hasAttribute(\"contenteditable\")||(a.contentEditable=\"false\"),a.classList.add(\"ProseMirror-widget\")}super(e,[],a,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Oo&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!=\"selection\"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},a1=class extends xu{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===\"characterData\"&&e.target.nodeValue==e.oldValue}},mu=class t extends xu{constructor(e,n,r,o,s){super(e,[],r,o),this.mark=n,this.spec=s}static create(e,n,r,o){let s=o.nodeViews[n.type.name],a=s&&s(n,o,r);return(!a||!a.dom)&&(a=Wo.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&Yo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Yo&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Oo){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Oo}}slice(e,n,r){let o=t.create(this.parent,this.mark,!0,r),s=this.children,a=this.size;n<a&&(s=c1(s,n,a,r)),e>0&&(s=c1(s,0,e,r));for(let i=0;i<s.length;i++)s[i].parent=o;return o.children=s,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Fi=class t extends xu{constructor(e,n,r,o,s,a,i){super(e,[],s,a),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=i}static create(e,n,r,o,s,a){let i=s.nodeViews[n.type.name],l,u=i&&i(n,s,()=>{if(!l)return a;if(l.parent)return l.parent.posBeforeChild(l)},r,o),c=u&&u.dom,d=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError(\"Text must be rendered as a DOM text node\")}else c||({dom:c,contentDOM:d}=Wo.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!=\"BR\"&&(c.hasAttribute(\"contenteditable\")||(c.contentEditable=\"false\"),n.type.spec.draggable&&(c.draggable=!0));let f=c;return c=WP(c,r,n),u?l=new i1(e,n,r,o,c,d||null,f,u):n.isText?new Yv(e,n,r,o,c,f):new t(e,n,r,o,c,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==\"pre\"&&(n.preserveWhitespace=\"full\"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let o=this.children[r];if(this.dom.contains(o.dom.parentNode)){n.contentElement=o.dom.parentNode;break}}if(!n.contentElement){let r=e&&e.find(o=>o.nodeType==1&&e.indexOf(o.parentNode)<0&&this.dom.contains(o));r?n.contentElement=r:n.getContent=()=>H.empty}}return n}matchesNode(e,n,r){return this.dirty==Oo&&e.eq(this.node)&&Qv(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,s=e.composing?this.localCompositionInfo(e,n):null,a=s&&s.pos>-1?s:null,i=s&&s.pos<0,l=new u1(this,a&&a.node,e);DK(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e,c):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?Ge.none:this.node.child(c).marks,r,e,c),l.placeWidget(u,e,o)},(u,c,d,f)=>{l.syncToMarks(u.marks,r,e,f);let p;l.findNodeMatch(u,c,d,f)||i&&e.state.selection.from>o&&e.state.selection.to<o+u.nodeSize&&(p=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,c,d,p,e)||l.updateNextNode(u,c,d,e,f,o)||l.addNode(u,c,d,e,o),o+=u.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==pu)&&(a&&this.protectLocalComposition(e,a),KP(this.contentDOM,this.children,e),jd&&NK(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof J)||r<n||o>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,i=PK(this.node.content,a,r-n,o-n);return i<0?null:{node:s,pos:i,text:a}}else return{node:s,pos:-1,text:\"\"}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let a=new a1(this,s,n,o);e.input.compositionNodes.push(a),this.children=c1(this.children,r,r+o.length,e,a)}update(e,n,r,o){return this.dirty==Yo||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Oo}updateOuterDeco(e){if(Qv(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=GP(this.dom,this.nodeDOM,l1(this.outerDeco,this.node,n),l1(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(\"ProseMirror-selectednode\"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(\"ProseMirror-selectednode\"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(\"draggable\"))}get domAtom(){return this.node.isAtom}};function hP(t,e,n,r,o){WP(r,e,t);let s=new Fi(void 0,t,e,n,r,r,r);return s.contentDOM&&s.updateChildren(o,0),s}var Yv=class t extends Fi{constructor(e,n,r,o,s,a){super(e,n,r,o,s,null,a)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==Yo||this.dirty!=Oo&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Oo||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=Oo,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!=\"characterData\"&&e.type!=\"selection\"}slice(e,n,r){let o=this.node.cut(e,n),s=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,s,s)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Yo)}get domAtom(){return!1}isText(e){return this.node.text==e}},Zv=class extends xu{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Oo&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==\"IMG\"}},i1=class extends Fi{constructor(e,n,r,o,s,a,i,l){super(e,n,r,o,s,a,i),this.spec=l}update(e,n,r,o){if(this.dirty==Yo)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,o),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function KP(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let a=e[s],i=a.dom;if(i.parentNode==t){for(;i!=r;)r=mP(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(i,r);if(a instanceof mu){let l=r?r.previousSibling:t.lastChild;KP(a.contentDOM,a.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=mP(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}var Om=function(t){t&&(this.nodeName=t)};Om.prototype=Object.create(null);var hu=[new Om];function l1(t,e,n){if(t.length==0)return hu;let r=n?hu[0]:new Om,o=[r];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&o.push(r=new Om(a.nodeName));for(let i in a){let l=a[i];l!=null&&(n&&o.length==1&&o.push(r=new Om(e.isInline?\"span\":\"div\")),i==\"class\"?r.class=(r.class?r.class+\" \":\"\")+l:i==\"style\"?r.style=(r.style?r.style+\";\":\"\")+l:i!=\"nodeName\"&&(r[i]=l))}}}return o}function GP(t,e,n,r){if(n==hu&&r==hu)return e;let o=e;for(let s=0;s<r.length;s++){let a=r[s],i=n[s];if(s){let l;i&&i.nodeName==a.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==a.nodeName||(l=document.createElement(a.nodeName),l.pmIsDeco=!0,l.appendChild(o),i=hu[0]),o=l}MK(o,i||hu[0],a)}return o}function MK(t,e,n){for(let r in e)r!=\"class\"&&r!=\"style\"&&r!=\"nodeName\"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!=\"class\"&&r!=\"style\"&&r!=\"nodeName\"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(\" \").filter(Boolean):[],o=n.class?n.class.split(\" \").filter(Boolean):[];for(let s=0;s<r.length;s++)o.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&t.classList.add(o[s]);t.classList.length==0&&t.removeAttribute(\"class\")}if(e.style!=n.style){if(e.style){let r=/\\s*([\\w\\-\\xa1-\\uffff]+)\\s*:(?:\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|\\(.*?\\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function WP(t,e,n){return GP(t,t,hu,l1(e,n,t.nodeType!=1))}function Qv(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function mP(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var u1=class{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=_K(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,o){let s=0,a=this.stack.length>>1,i=Math.min(a,e.length);for(;s<i&&(s==a-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<a;)this.destroyRest(),this.top.dirty=Oo,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let l=-1,u=this.top.children.length;o<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let d=this.top.children[c];if(d.matchesMark(e[a])&&!this.isLocked(d.dom)){l=c;break}}if(l<0&&this.index<this.top.children.length){let c=this.top.children[this.index];c instanceof mu&&c.dirty!=Yo&&c.mark.type==e[a].type&&c.spec.update&&!this.isLocked(c.dom)&&c.spec.update(e[a])&&(c.mark=e[a],l=this.index,this.changed=!0)}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=mu.create(this.top,e[a],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,a++}}findNodeMatch(e,n,r,o){let s=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(e,n,r))s=this.top.children.indexOf(a,this.index);else for(let i=this.index,l=Math.min(this.top.children.length,i+5);i<l;i++){let u=this.top.children[i];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){s=i;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,o,s){let a=this.top.children[o];return a.dirty==Yo&&a.dom==a.contentDOM&&(a.dirty=pu),a.update(e,n,r,s)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,s,a){for(let i=this.index;i<this.top.children.length;i++){let l=this.top.children[i];if(l instanceof Fi){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let c=l.dom,d,f=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Yo&&Qv(n,l.outerDeco));if(!f&&l.update(e,n,r,o))return this.destroyBetween(this.index,i),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,r,o,a)))return this.destroyBetween(this.index,i),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=pu,d.updateChildren(o,a+1),d.dirty=Oo),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,s,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Qv(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let i=Fi.create(this.top,n,r,o,s,a);if(i.contentDOM){i.children=e.children,e.children=[];for(let l of i.children)l.parent=i}return e.destroy(),i}addNode(e,n,r,o,s){let a=Fi.create(this.top,e,n,r,o,s);a.contentDOM&&a.updateChildren(o,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let s=new Jv(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof mu;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Yv)||/\\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\\s$/.test(e.node.text))&&((Gn||On)&&e&&e.dom.contentEditable==\"false\"&&this.addHackNode(\"IMG\",n),this.addHackNode(\"BR\",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e==\"IMG\"&&(r.className=\"ProseMirror-separator\",r.alt=\"\"),e==\"BR\"&&(r.className=\"ProseMirror-trailingBreak\");let o=new Zv(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function _K(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,a=[];e:for(;o>0;){let i;for(;;)if(r){let u=n.children[r-1];if(u instanceof mu)n=u,r=u.children.length;else{i=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=i.node;if(l){if(l!=t.child(o-1))break;--o,s.set(i,o),a.push(i)}}return{index:o,matched:s,matches:a.reverse()}}function OK(t,e){return t.type.side-e.type.side}function DK(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let u=0;u<t.childCount;u++){let c=t.child(u);r(c,o,e.forChild(s,c),u),s+=c.nodeSize}return}let a=0,i=[],l=null;for(let u=0;;){let c,d;for(;a<o.length&&o[a].to==s;){let m=o[a++];m.widget&&(c?(d||(d=[c])).push(m):c=m)}if(c)if(d){d.sort(OK);for(let m=0;m<d.length;m++)n(d[m],u,!!l)}else n(c,u,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(u<t.childCount)p=u,f=t.child(u++);else break;for(let m=0;m<i.length;m++)i[m].to<=s&&i.splice(m--,1);for(;a<o.length&&o[a].from<=s&&o[a].to>s;)i.push(o[a++]);let h=s+f.nodeSize;if(f.isText){let m=h;a<o.length&&o[a].from<m&&(m=o[a].from);for(let y=0;y<i.length;y++)i[y].to<m&&(m=i[y].to);m<h&&(l=f.cut(m-s),f=f.cut(0,m-s),h=m,p=-1)}else for(;a<o.length&&o[a].to<h;)a++;let g=f.isInline&&!f.isLeaf?i.filter(m=>!m.inline):i.slice();r(f,g,e.forChild(s,f),p),s=h}}function NK(t){if(t.nodeName==\"UL\"||t.nodeName==\"OL\"){let e=t.style.cssText;t.style.cssText=e+\"; list-style: square !important\",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function PK(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let a=t.child(o++),i=s;if(s+=a.nodeSize,!a.isText)continue;let l=a.text;for(;o<t.childCount;){let u=t.child(o++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=n){if(s>=r&&l.slice(r-e.length-i,r-i)==e)return r-e.length;let u=i<r?l.lastIndexOf(e,r-i-1):-1;if(u>=0&&u+e.length+i>=n)return i+u;if(n==r&&l.length>=r+e.length-i&&l.slice(r-i,r-i+e.length)==e)return r}}return-1}function c1(t,e,n,r,o){let s=[];for(let a=0,i=0;a<t.length;a++){let l=t[a],u=i,c=i+=l.size;u>=n||c<=e?s.push(l):(u<e&&s.push(l.slice(0,e-u,r)),o&&(s.push(o),o=void 0),c>n&&s.push(l.slice(n-u,l.size,r)))}return s}function S1(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),s=o&&o.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let i=r.resolve(a),l,u;if(ix(n)){for(l=a;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&oe.isSelectable(d)&&o.parent&&!(d.isInline&&fK(n.focusNode,n.focusOffset,o.dom))){let f=o.posBefore;u=new oe(a==f?i:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=a,f=a;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[l,a]=f==t.state.selection.anchor?[f,d]:[d,f],i=r.resolve(a)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=r.resolve(l);if(!u){let d=e==\"pointer\"||t.state.selection.head<i.pos&&!s?1:-1;u=k1(t,c,i,d)}return u}function XP(t){return t.editable?t.hasFocus():YP(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ia(t,e=!1){let n=t.state.selection;if(JP(t,n),!XP(t))return;let r=t.input.mouseDown;if(!e&&On&&r){let o=t.domSelectionRange(),s=t.domObserver.currentSelection;if(o.anchorNode&&s.anchorNode&&vu(o.anchorNode,o.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)zK(t);else{let{anchor:o,head:s}=n,a,i;gP&&!(n instanceof J)&&(n.$from.parent.inlineContent||(a=yP(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(i=yP(t,n.to))),t.docView.setSelection(o,s,t,e),gP&&(a&&bP(a),i&&bP(i)),n.visible?t.dom.classList.remove(\"ProseMirror-hideselection\"):(t.dom.classList.add(\"ProseMirror-hideselection\"),\"onselectionchange\"in document&&BK(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}var gP=Gn||On&&zP<63;function yP(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Gn&&o&&o.contentEditable==\"false\")return ZL(o);if((!o||o.contentEditable==\"false\")&&(!s||s.contentEditable==\"false\")){if(o)return ZL(o);if(s)return ZL(s)}}function ZL(t){return t.contentEditable=\"true\",Gn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function bP(t){t.contentEditable=\"false\",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function BK(t){let e=t.dom.ownerDocument;e.removeEventListener(\"selectionchange\",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener(\"selectionchange\",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener(\"selectionchange\",t.input.hideSelectionGuard),setTimeout(()=>{(!XP(t)||t.state.selection.visible)&&t.dom.classList.remove(\"ProseMirror-hideselection\")},20))})}function zK(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName==\"IMG\";r?e.collapse(n.parentNode,_n(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Ar&&zi<=11&&(n.disabled=!0,n.disabled=!1)}function JP(t,e){if(e instanceof oe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(vP(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else vP(t)}function vP(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function k1(t,e,n,r){return t.someProp(\"createSelectionBetween\",o=>o(t,e,n))||J.between(e,n,r)}function xP(t){return t.editable&&!t.hasFocus()?!1:YP(t)}function YP(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function FK(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return vu(e.node,e.offset,n.anchorNode,n.anchorOffset)}function d1(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return s&&pe.findFrom(s,e)}function Bi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function wP(t,e,n){let r=t.state.selection;if(r instanceof J)if(n.indexOf(\"s\")>-1){let{$head:o}=r,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=t.state.doc.resolve(o.pos+s.nodeSize*(e<0?-1:1));return Bi(t,new J(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?\"forward\":\"backward\")){let o=d1(t.state,e);return o&&o instanceof oe?Bi(t,o):!1}else if(!(Io&&n.indexOf(\"m\")>-1)){let o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,a;if(!s||s.isText)return!1;let i=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(a=t.docView.descAt(i))&&!a.contentDOM?oe.isSelectable(s)?Bi(t,new oe(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):Fm?Bi(t,new J(t.state.doc.resolve(e<0?i:i+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof oe&&r.node.isInline)return Bi(t,new J(e>0?r.$to:r.$from));{let o=d1(t.state,e);return o?Bi(t,o):!1}}}function ex(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Dm(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!=\"BR\")}function Hd(t,e){return e<0?HK(t):$K(t)}function HK(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,a=!1;for(_o&&n.nodeType==1&&r<ex(n)&&Dm(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let i=n.childNodes[r-1];if(Dm(i,-1))o=n,s=--r;else if(i.nodeType==3)n=i,r=n.nodeValue.length;else break}}else{if(ZP(n))break;{let i=n.previousSibling;for(;i&&Dm(i,-1);)o=n.parentNode,s=_n(i),i=i.previousSibling;if(i)n=i,r=ex(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?f1(t,n,r):o&&f1(t,o,s)}function $K(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=ex(n),s,a;for(;;)if(r<o){if(n.nodeType!=1)break;let i=n.childNodes[r];if(Dm(i,1))s=n,a=++r;else break}else{if(ZP(n))break;{let i=n.nextSibling;for(;i&&Dm(i,1);)s=i.parentNode,a=_n(i)+1,i=i.nextSibling;if(i)n=i,r=0,o=ex(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&f1(t,s,a)}function ZP(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function UK(t,e){for(;t&&e==t.childNodes.length&&!zm(t);)e=_n(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==\"false\")break;t=n,e=0}}function jK(t,e){for(;t&&!e&&!zm(t);)e=_n(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==\"false\")break;t=n,e=t.childNodes.length}}function f1(t,e,n){if(e.nodeType!=3){let s,a;(a=UK(e,n))?(e=a,n=0):(s=jK(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ix(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Ia(t)},50)}function SP(t,e){let n=t.state.doc.resolve(e);if(!(On||FP)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),a=(s.top+s.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(s.left-o.left)>1)return s.left<o.left?\"ltr\":\"rtl\"}if(e<n.end()){let s=t.coordsAtPos(e+1),a=(s.top+s.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(s.left-o.left)>1)return s.left>o.left?\"ltr\":\"rtl\"}}return getComputedStyle(t.dom).direction==\"rtl\"?\"rtl\":\"ltr\"}function kP(t,e,n){let r=t.state.selection;if(r instanceof J&&!r.empty||n.indexOf(\"s\")>-1||Io&&n.indexOf(\"m\")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?\"up\":\"down\")){let a=d1(t.state,e);if(a&&a instanceof oe)return Bi(t,a)}if(!o.parent.inlineContent){let a=e<0?o:s,i=r instanceof Mn?pe.near(a,e):pe.findFrom(a,e);return i?Bi(t,i):!1}return!1}function CP(t,e){if(!(t.state.selection instanceof J))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?\"forward\":\"backward\"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let a=t.state.tr;return e<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),t.dispatch(a),!0}return!1}function LP(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function qK(t){if(!Gn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable==\"false\"){let r=e.firstChild;LP(t,r,\"true\"),setTimeout(()=>LP(t,r,\"false\"),20)}return!1}function VK(t){let e=\"\";return t.ctrlKey&&(e+=\"c\"),t.metaKey&&(e+=\"m\"),t.altKey&&(e+=\"a\"),t.shiftKey&&(e+=\"s\"),e}function KK(t,e){let n=e.keyCode,r=VK(e);if(n==8||Io&&n==72&&r==\"c\")return CP(t,-1)||Hd(t,-1);if(n==46&&!e.shiftKey||Io&&n==68&&r==\"c\")return CP(t,1)||Hd(t,1);if(n==13||n==27)return!0;if(n==37||Io&&n==66&&r==\"c\"){let o=n==37?SP(t,t.state.selection.from)==\"ltr\"?-1:1:-1;return wP(t,o,r)||Hd(t,o)}else if(n==39||Io&&n==70&&r==\"c\"){let o=n==39?SP(t,t.state.selection.from)==\"ltr\"?1:-1:1;return wP(t,o,r)||Hd(t,o)}else{if(n==38||Io&&n==80&&r==\"c\")return kP(t,-1,r)||Hd(t,-1);if(n==40||Io&&n==78&&r==\"c\")return qK(t)||kP(t,1,r)||Hd(t,1);if(r==(Io?\"m\":\"c\")&&(n==66||n==73||n==89||n==90))return!0}return!1}function C1(t,e){t.someProp(\"transformCopied\",p=>{e=p(e,t)});let n=[],{content:r,openStart:o,openEnd:s}=e;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let a=t.someProp(\"clipboardSerializer\")||Wo.fromSchema(t.state.schema),i=o2(),l=i.createElement(\"div\");l.appendChild(a.serializeFragment(r,{document:i}));let u=l.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=r2[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let h=i.createElement(c[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute(\"data-pm-slice\",`${o} ${s}${d?` -${d}`:\"\"} ${JSON.stringify(n)}`);let f=t.someProp(\"clipboardTextSerializer\",p=>p(e,t))||e.content.textBetween(0,e.content.size,`\n\n`);return{dom:l,text:f,slice:e}}function QP(t,e,n,r,o){let s=o.parent.type.spec.code,a,i;if(!n&&!e)return null;let l=!!e&&(r||s||!n);if(l){if(t.someProp(\"transformPastedText\",f=>{e=f(e,s||r,t)}),s)return i=new G(H.from(t.state.schema.text(e.replace(/\\r\\n?/g,`\n`))),0,0),t.someProp(\"transformPasted\",f=>{i=f(i,t,!0)}),i;let d=t.someProp(\"clipboardTextParser\",f=>f(e,o,r,t));if(d)i=d;else{let f=o.marks(),{schema:p}=t.state,h=Wo.fromSchema(p);a=document.createElement(\"div\"),e.split(/(?:\\r\\n?|\\n)+/).forEach(g=>{let m=a.appendChild(document.createElement(\"p\"));g&&m.appendChild(h.serializeNode(p.text(g,f)))})}}else t.someProp(\"transformPastedHTML\",d=>{n=d(n,t)}),a=JK(n),Fm&&YK(a);let u=a&&a.querySelector(\"[data-pm-slice]\"),c=u&&/^(\\d+) (\\d+)(?: -(\\d+))? (.*)/.exec(u.getAttribute(\"data-pm-slice\")||\"\");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=a.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;a=f}if(i||(i=(t.someProp(\"clipboardParser\")||t.someProp(\"domParser\")||Xr.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(l||c),context:o,ruleFromNode(f){return f.nodeName==\"BR\"&&!f.nextSibling&&f.parentNode&&!GK.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)i=ZK(AP(i,+c[1],+c[2]),c[4]);else if(i=G.maxOpen(WK(i.content,o),!0),i.openStart||i.openEnd){let d=0,f=0;for(let p=i.content.firstChild;d<i.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=i.content.lastChild;f<i.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);i=AP(i,d,f)}return t.someProp(\"transformPasted\",d=>{i=d(i,t,l)}),i}var GK=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function WK(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),s,a=[];if(t.forEach(i=>{if(!a)return;let l=o.findWrapping(i.type),u;if(!l)return a=null;if(u=a.length&&s.length&&t2(l,s,i,a[a.length-1],0))a[a.length-1]=u;else{a.length&&(a[a.length-1]=n2(a[a.length-1],s.length));let c=e2(i,l);a.push(c),o=o.matchType(c.type),s=l}}),a)return H.from(a)}return t}function e2(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,H.from(t));return t}function t2(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=t2(t,e,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(H.from(e2(n,t,o+1))))}}function n2(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,n2(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(H.empty,!0);return t.copy(n.append(r))}function p1(t,e,n,r,o,s){let a=e<0?t.firstChild:t.lastChild,i=a.content;return t.childCount>1&&(s=0),o<r-1&&(i=p1(i,e,n,r,o+1,s)),o>=n&&(i=e<0?a.contentMatchAt(0).fillBefore(i,s<=o).append(i):i.append(a.contentMatchAt(a.childCount).fillBefore(H.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(i))}function AP(t,e,n){return e<t.openStart&&(t=new G(p1(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new G(p1(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var r2={thead:[\"table\"],tbody:[\"table\"],tfoot:[\"table\"],caption:[\"table\"],colgroup:[\"table\"],col:[\"table\",\"colgroup\"],tr:[\"table\",\"tbody\"],td:[\"table\",\"tbody\",\"tr\"],th:[\"table\",\"tbody\",\"tr\"]};function o2(){return document.implementation.createHTMLDocument(\"title\")}var _m=null;function XK(t){let e=window.trustedTypes;if(!e)return t;if(!_m){if(_m=e.defaultPolicy)try{return _m.createHTML(t)}catch{}_m=e.createPolicy(\"ProseMirrorClipboard\",{createHTML:n=>n})}return _m.createHTML(t)}function JK(t){let e=/^(\\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=o2(),r=n.body,o=/<([a-z][^>\\s]+)/i.exec(t),s;if((s=o&&r2[o[1].toLowerCase()])&&(t=s.map(a=>\"<\"+a+\">\").join(\"\")+t+s.map(a=>\"</\"+a+\">\").reverse().join(\"\")),r.innerHTML=XK(t),s)for(let a=0;a<s.length;a++)r=r.querySelector(s[a])||r;for(let a=0;a<n.styleSheets.length;a++){let i=n.styleSheets[a];for(let l=0;l<i.rules.length;l++){let u=i.rules[l];if(u instanceof CSSStyleRule){let c=r.querySelectorAll(u.selectorText);for(let d=0;d<c.length;d++)c[d].style.cssText+=u.style.cssText}}}return r}function YK(t){let e=t.querySelectorAll(On?\"span:not([class]):not([style])\":\"span.Apple-converted-space\");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==\"\\xA0\"&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(\" \"),r)}}function ZK(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:s,openEnd:a}=t;for(let i=r.length-2;i>=0;i-=2){let l=n.nodes[r[i]];if(!l||l.hasRequiredAttrs())break;try{l.checkAttrs(r[i+1])}catch{break}o=H.from(l.create(r[i+1],o)),s++,a++}return new G(o,s,a)}var lr={},ur={},QK={touchstart:!0,touchmove:!0},h1=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:\"\",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function eG(t){for(let e in lr){let n=lr[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{nG(t,r)&&!L1(t,r)&&(t.editable||!(r.type in ur))&&n(t,r)},QK[e]?{passive:!0}:void 0)}Gn&&t.dom.addEventListener(\"input\",()=>null),m1(t)}function Ra(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function tG(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function m1(t){t.someProp(\"handleDOMEvents\",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>L1(t,r))})}function L1(t,e){return t.someProp(\"handleDOMEvents\",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function nG(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function rG(t,e){!L1(t,e)&&lr[e.type]&&(t.editable||!(e.type in ur))&&lr[e.type](t,e)}ur.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!i2(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ta&&On&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),jd&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp(\"handleKeyDown\",o=>o(t,fu(13,\"Enter\"))),t.input.lastIOSEnter=0)},200)}else t.someProp(\"handleKeyDown\",r=>r(t,n))||KK(t,n)?n.preventDefault():Ra(t,\"key\")};ur.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ur.keypress=(t,e)=>{let n=e;if(i2(t)||!n.charCode||n.ctrlKey&&!n.altKey||Io&&n.metaKey)return;if(t.someProp(\"handleKeyPress\",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof J)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(o).scrollIntoView();!/[\\r\\n]/.test(o)&&!t.someProp(\"handleTextInput\",a=>a(t,r.$from.pos,r.$to.pos,o,s))&&t.dispatch(s()),n.preventDefault()}};function Hm(t){return{left:t.clientX,top:t.clientY}}function oG(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function A1(t,e,n,r,o){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let a=s.depth+1;a>0;a--)if(t.someProp(e,i=>a>s.depth?i(t,n,s.nodeAfter,s.before(a),o,!0):i(t,n,s.node(a),s.before(a),o,!1)))return!0;return!1}function $m(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n==\"pointer\"&&r.setMeta(\"pointer\",!0),t.dispatch(r)}function sG(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&oe.isSelectable(r)?($m(t,new oe(n),\"pointer\"),!0):!1}function aG(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof oe&&(r=n.node);let s=t.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let i=a>s.depth?s.nodeAfter:s.node(a);if(oe.isSelectable(i)){r&&n.$from.depth>0&&a>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(a);break}}return o!=null?($m(t,oe.create(t.state.doc,o),\"pointer\"),!0):!1}function iG(t,e,n,r,o){return A1(t,\"handleClickOn\",e,n,r)||t.someProp(\"handleClick\",s=>s(t,e,r))||(o?aG(t,n):sG(t,n))}function lG(t,e,n,r){return A1(t,\"handleDoubleClickOn\",e,n,r)||t.someProp(\"handleDoubleClick\",o=>o(t,e,r))}function uG(t,e,n,r){return A1(t,\"handleTripleClickOn\",e,n,r)||t.someProp(\"handleTripleClick\",o=>o(t,e,r))||cG(t,n,r)}function cG(t,e,n){if(n.button!=0)return!1;let r=s2(t,e,!0),o=t.state.doc;return r?($m(t,r,\"pointer\"),r instanceof J&&o.eq(t.state.doc)&&(t.input.mouseDown=new y1(t,r)),!0):!1}function s2(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?J.create(r,0,r.content.size):null;let o=r.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s),i=o.before(s);if(a.inlineContent)return J.create(r,i+1,i+1+a.content.size);if(n&&oe.isSelectable(a))return oe.create(r,i)}return null}function E1(t){return nx(t)}var a2=Io?\"metaKey\":\"ctrlKey\";lr.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=E1(t),o=Date.now(),s=\"singleClick\";o-t.input.lastClick.time<500&&oG(n,t.input.lastClick)&&!n[a2]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type==\"singleClick\"?s=\"doubleClick\":t.input.lastClick.type==\"doubleClick\"&&(s=\"tripleClick\")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let a=t.posAtCoords(Hm(n));a&&(s==\"singleClick\"?t.input.mouseDown=new g1(t,a,n,!!r):(s==\"doubleClick\"?lG:uG)(t,a.pos,a.inside,n)?n.preventDefault():Ra(t,\"pointer\"))};var tx=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(\"mouseup\",this.up=this.up.bind(this)),e.root.addEventListener(\"mousemove\",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(\"mouseup\",this.up),this.view.root.removeEventListener(\"mousemove\",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},g1=class extends tx{constructor(e,n,r,o){super(e),this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[a2],this.allowDefault=r.shiftKey;let s,a;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),a=n.inside;else{let c=e.state.doc.resolve(n.pos);s=c.parent,a=c.depth?c.before():0}let i=o?null:r.target,l=i?e.docView.nearestDesc(i,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof oe&&u.from<=a&&u.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&_o&&!this.target.hasAttribute(\"contentEditable\"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(\"contentEditable\",\"false\")},20),this.view.domObserver.start()),Ra(e,\"pointer\")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(\"draggable\"),this.mightDrag.setUneditable&&this.target.removeAttribute(\"contentEditable\"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Ia(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Hm(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ra(this.view,\"pointer\"):iG(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Gn&&this.mightDrag&&!this.mightDrag.node.isAtom||On&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?($m(this.view,pe.near(this.view.state.doc.resolve(n.pos)),\"pointer\"),e.preventDefault()):Ra(this.view,\"pointer\")}move(e){this.updateAllowDefault(e),Ra(this.view,\"pointer\"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},y1=class extends tx{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Ra(this.view,\"pointer\");let n=this.view.posAtCoords(Hm(e)),r=n&&s2(this.view,n.inside,!1);if(!r)return;let{doc:o}=this.view.state,s=this.startSelection,[a,i]=r.from<s.from?[s.to,r.from]:[s.from,r.to];$m(this.view,J.create(o,a,i),\"pointer\")}};lr.touchstart=t=>{t.input.lastTouch=Date.now(),E1(t),Ra(t,\"pointer\")};lr.touchmove=t=>{t.input.lastTouch=Date.now(),Ra(t,\"pointer\")};lr.contextmenu=t=>E1(t);function i2(t,e){return t.composing?!0:Gn&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var dG=Ta?5e3:-1;ur.compositionstart=ur.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof J&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||On&&FP&&fG(t)))t.markCursor=t.state.storedMarks||n.marks(),nx(t,!0),t.markCursor=null;else if(nx(t,!e.selection.empty),_o&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let a=s<0?o.lastChild:o.childNodes[s-1];if(!a)break;if(a.nodeType==3){let i=t.domSelection();i&&i.collapse(a,a.nodeValue.length);break}else o=a,s=-1}}t.input.composing=!0}l2(t,dG)};function fG(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable==\"false\"}ur.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,l2(t,20))};function l2(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>nx(t),e))}function u2(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function pG(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=cK(e.focusNode,e.focusOffset),r=dK(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function nx(t,e=!1){if(!(Ta&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),u2(t),e||t.docView&&t.docView.dirty){let n=S1(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function hG(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement(\"div\"));n.appendChild(e),n.style.cssText=\"position: fixed; left: -10000px; top: 10px\";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var Nm=Ar&&zi<15||jd&&mK<604;lr.copy=ur.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type==\"cut\";if(r.empty)return;let s=Nm?null:n.clipboardData,a=r.content(),{dom:i,text:l}=C1(t,a);s?(n.preventDefault(),s.clearData(),s.setData(\"text/html\",i.innerHTML),s.setData(\"text/plain\",l)):hG(t,i),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta(\"uiEvent\",\"cut\"))};function mG(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function gG(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?\"textarea\":\"div\"));n||(r.contentEditable=\"true\"),r.style.cssText=\"position: fixed; left: -10000px; top: 10px\",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Pm(t,r.value,null,o,e):Pm(t,r.textContent,r.innerHTML,o,e)},50)}function Pm(t,e,n,r,o){let s=QP(t,e,n,r,t.state.selection.$from);if(t.someProp(\"handlePaste\",l=>l(t,o,s||G.empty)))return!0;if(!s)return!1;let a=mG(s),i=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(s);return t.dispatch(i.scrollIntoView().setMeta(\"paste\",!0).setMeta(\"uiEvent\",\"paste\")),!0}function c2(t){let e=t.getData(\"text/plain\")||t.getData(\"Text\");if(e)return e;let n=t.getData(\"text/uri-list\");return n?n.replace(/\\r?\\n/g,\" \"):\"\"}ur.paste=(t,e)=>{let n=e;if(t.composing&&!Ta)return;let r=Nm?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Pm(t,c2(r),r.getData(\"text/html\"),o,n)?n.preventDefault():gG(t,n)};var rx=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}},yG=Io?\"altKey\":\"ctrlKey\";function d2(t,e){let n;return t.someProp(\"dragCopies\",r=>{n=n||r(e)}),n!=null?!n:!e[yG]}lr.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,s=o.empty?null:t.posAtCoords(Hm(n)),a;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof oe?o.to-1:o.to))){if(r&&r.mightDrag)a=oe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(a=oe.create(t.state.doc,d.posBefore))}}let i=(a||t.state.selection).content(),{dom:l,text:u,slice:c}=C1(t,i);(!n.dataTransfer.files.length||!On||zP>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Nm?\"Text\":\"text/html\",l.innerHTML),n.dataTransfer.effectAllowed=\"copyMove\",Nm||n.dataTransfer.setData(\"text/plain\",u),t.dragging=new rx(c,d2(t,n),a)};lr.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ur.dragover=ur.dragenter=(t,e)=>e.preventDefault();ur.drop=(t,e)=>{try{bG(t,e,t.dragging)}finally{t.dragging=null}};function bG(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Hm(e));if(!r)return;let o=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp(\"transformPasted\",p=>{s=p(s,t,!1)}):s=QP(t,c2(e.dataTransfer),Nm?null:e.dataTransfer.getData(\"text/html\"),!1,o);let a=!!(n&&d2(t,e));if(t.someProp(\"handleDrop\",p=>p(t,e,s||G.empty,a))){e.preventDefault();return}if(!s)return;e.preventDefault();let i=s?Pv(t.state.doc,o.pos,s):o.pos;i==null&&(i=o.pos);let l=t.state.tr;if(a){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(i),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=l.doc;if(c?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),l.doc.eq(d))return;let f=l.doc.resolve(u);if(c&&oe.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new oe(f));else{let p=l.mapping.map(i);l.mapping.maps[l.mapping.maps.length-1].forEach((h,g,m,y)=>p=y),l.setSelection(k1(t,f,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta(\"uiEvent\",\"drop\"))}lr.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add(\"ProseMirror-focused\"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ia(t)},20))};lr.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove(\"ProseMirror-focused\"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};lr.beforeinput=(t,e)=>{if(Ta&&e.inputType==\"deleteContentBackward\"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp(\"handleKeyDown\",s=>s(t,fu(8,\"Backspace\")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in ur)lr[t]=ur[t];function Bm(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}var ox=class t{constructor(e,n){this.toDOM=e,this.spec=n||yu,this.side=this.spec.side||0}map(e,n,r,o){let{pos:s,deleted:a}=e.mapResult(n.from+o,this.side<0?-1:1);return a?null:new yn(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Bm(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},gu=class t{constructor(e,n){this.attrs=e,this.spec=n||yu}map(e,n,r,o){let s=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new yn(s,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof t&&Bm(this.attrs,e.attrs)&&Bm(this.spec,e.spec)}static is(e){return e.type instanceof t}destroy(){}},b1=class t{constructor(e,n){this.attrs=e,this.spec=n||yu}map(e,n,r,o){let s=e.mapResult(n.from+o,1);if(s.deleted)return null;let a=e.mapResult(n.to+o,-1);return a.deleted||a.pos<=s.pos?null:new yn(s.pos-r,a.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),s;return o==n.from&&!(s=e.child(r)).isText&&o+s.nodeSize==n.to}eq(e){return this==e||e instanceof t&&Bm(this.attrs,e.attrs)&&Bm(this.spec,e.spec)}destroy(){}},yn=class t{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new t(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new t(e,e,new ox(n,r))}static inline(e,n,r,o){return new t(e,n,new gu(r,o))}static node(e,n,r,o){return new t(e,n,new b1(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof gu}get widget(){return this.type instanceof ox}},$d=[],yu={},He=class t{constructor(e,n){this.local=e.length?e:$d,this.children=n.length?n:$d}static create(e,n){return n.length?ax(n,e,0,yu):Kn}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,s){for(let a=0;a<this.local.length;a++){let i=this.local[a];i.from<=n&&i.to>=e&&(!s||s(i.spec))&&r.push(i.copy(i.from+o,i.to+o))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let i=this.children[a]+1;this.children[a+2].findInner(e-i,n-i,r,o+i,s)}}map(e,n,r){return this==Kn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||yu)}mapInner(e,n,r,o,s){let a;for(let i=0;i<this.local.length;i++){let l=this.local[i].map(e,r,o);l&&l.type.valid(n,l)?(a||(a=[])).push(l):s.onRemove&&s.onRemove(this.local[i].spec)}return this.children.length?vG(this.children,a||[],e,n,r,o,s):a?new t(a.sort(bu),$d):Kn}add(e,n){return n.length?this==Kn?t.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((i,l)=>{let u=l+r,c;if(c=p2(n,i,u)){for(o||(o=this.children.slice());s<o.length&&o[s]<l;)s+=3;o[s]==l?o[s+2]=o[s+2].addInner(i,c,u+1):o.splice(s,0,l,l+i.nodeSize,ax(c,i,u+1,yu)),s+=3}});let a=f2(s?h2(n):n,-r);for(let i=0;i<a.length;i++)a[i].type.valid(e,a[i])||a.splice(i--,1);return new t(a.length?this.local.concat(a).sort(bu):this.local,o||this.children)}remove(e){return e.length==0||this==Kn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let a,i=r[s]+n,l=r[s+1]+n;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>i&&d.to<l&&(e[c]=null,(a||(a=[])).push(d));if(!a)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(a,i+1);u!=Kn?r[s+2]=u:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,a;s<e.length;s++)if(a=e[s])for(let i=0;i<o.length;i++)o[i].eq(a,n)&&(o==this.local&&(o=this.local.slice()),o.splice(i--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new t(o,r):Kn}forChild(e,n){if(this==Kn)return this;if(n.isLeaf)return t.empty;let r,o;for(let i=0;i<this.children.length;i+=3)if(this.children[i]>=e){this.children[i]==e&&(r=this.children[i+2]);break}let s=e+1,a=s+n.content.size;for(let i=0;i<this.local.length;i++){let l=this.local[i];if(l.from<a&&l.to>s&&l.type instanceof gu){let u=Math.max(s,l.from)-s,c=Math.min(a,l.to)-s;u<c&&(o||(o=[])).push(l.copy(u,c))}}if(o){let i=new t(o.sort(bu),$d);return r?new sx([i,r]):i}return r||Kn}eq(e){if(this==e)return!0;if(!(e instanceof t)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return T1(this.localsInner(e))}localsInner(e){if(this==Kn)return $d;if(e.inlineContent||!this.local.some(gu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof gu||n.push(this.local[r]);return n}forEachSet(e){e(this)}};He.empty=new He([],[]);He.removeOverlap=T1;var Kn=He.empty,sx=class t{constructor(e){this.members=e}map(e,n){let r=this.members.map(o=>o.map(e,n,yu));return t.from(r)}forChild(e,n){if(n.isLeaf)return He.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=Kn&&(s instanceof t?r=r.concat(s.members):r.push(s))}return t.from(r)}eq(e){if(!(e instanceof t)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let s=this.members[o].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let a=0;a<s.length;a++)n.push(s[a])}}return n?T1(r?n:n.sort(bu)):$d}static from(e){switch(e.length){case 0:return Kn;case 1:return e[0];default:return new t(e.every(n=>n instanceof He)?e:e.reduce((n,r)=>n.concat(r instanceof He?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}};function vG(t,e,n,r,o,s,a){let i=t.slice();for(let u=0,c=s;u<n.maps.length;u++){let d=0;n.maps[u].forEach((f,p,h,g)=>{let m=g-h-(p-f);for(let y=0;y<i.length;y+=3){let b=i[y+1];if(b<0||f>b+c-d)continue;let x=i[y]+c-d;p>=x?i[y+1]=f<=x?-2:-1:f>=c&&m&&(i[y]+=m,i[y+1]+=m)}d+=m}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u<i.length;u+=3)if(i[u+1]<0){if(i[u+1]==-2){l=!0,i[u+1]=-1;continue}let c=n.map(t[u]+s),d=c-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(t[u+1]+s,-1),p=f-o,{index:h,offset:g}=r.content.findIndex(d),m=r.maybeChild(h);if(m&&g==d&&g+m.nodeSize==p){let y=i[u+2].mapInner(n,m,c+1,t[u]+s+1,a);y!=Kn?(i[u]=d,i[u+1]=p,i[u+2]=y):(i[u+1]=-2,l=!0)}else l=!0}if(l){let u=xG(i,t,e,n,o,s,a),c=ax(u,r,0,a);e=c.local;for(let d=0;d<i.length;d+=3)i[d+1]<0&&(i.splice(d,3),d-=3);for(let d=0,f=0;d<c.children.length;d+=3){let p=c.children[d];for(;f<i.length&&i[f]<p;)f+=3;i.splice(f,0,c.children[d],c.children[d+1],c.children[d+2])}}return new He(e.sort(bu),i)}function f2(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new yn(o.from+e,o.to+e,o.type))}return n}function xG(t,e,n,r,o,s,a){function i(l,u){for(let c=0;c<l.local.length;c++){let d=l.local[c].map(r,o,u);d?n.push(d):a.onRemove&&a.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)i(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&i(t[l+2],e[l]+s+1);return n}function p2(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let s=0,a;s<t.length;s++)(a=t[s])&&a.from>n&&a.to<r&&((o||(o=[])).push(a),t[s]=null);return o}function h2(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ax(t,e,n,r){let o=[],s=!1;e.forEach((i,l)=>{let u=p2(t,i,l+n);if(u){s=!0;let c=ax(u,i,n+l+1,r);c!=Kn&&o.push(l,l+i.nodeSize,c)}});let a=f2(s?h2(t):t,-n).sort(bu);for(let i=0;i<a.length;i++)a[i].type.valid(e,a[i])||(r.onRemove&&r.onRemove(a[i].spec),a.splice(i--,1));return a.length||o.length?new He(a,o):Kn}function bu(t,e){return t.from-e.from||t.to-e.to}function T1(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let s=e[o];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[o]=s.copy(s.from,r.to),EP(e,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),EP(e,o,r.copy(s.from,r.to)));break}}}return e}function EP(t,e,n){for(;e<t.length&&bu(n,t[e])>0;)e++;t.splice(e,0,n)}function QL(t){let e=[];return t.someProp(\"decorations\",n=>{let r=n(t.state);r&&r!=Kn&&e.push(r)}),t.cursorWrapper&&e.push(He.create(t.state.doc,[t.cursorWrapper.deco])),sx.from(e)}var wG={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},SG=Ar&&zi<=11,v1=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},x1=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new v1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Ar&&zi<=11&&r.some(o=>o.type==\"childList\"&&o.removedNodes.length||o.type==\"characterData\"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():Gn&&e.composing&&r.some(o=>o.type==\"childList\"&&o.target.nodeName==\"TR\")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),SG&&(this.onCharData=r=>{this.queue.push({target:r.target,type:\"characterData\",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,wG)),this.onCharData&&this.view.dom.addEventListener(\"DOMCharacterDataModified\",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(\"DOMCharacterDataModified\",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(\"selectionchange\",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(\"selectionchange\",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(xP(this.view)){if(this.suppressingSelectionUpdates)return Ia(this.view);if(Ar&&zi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Ud(s))n.add(s);for(let s=e.anchorNode;s;s=Ud(s))if(n.has(s)){r=s;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:\"selection\",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&xP(e)&&!this.ignoreSelectionChange(r),s=-1,a=-1,i=!1,l=[];if(e.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],l);d&&(s=s<0?d.from:Math.min(d.from,s),a=a<0?d.to:Math.max(d.to,a),d.typeOver&&(i=!0))}if(l.some(c=>c.nodeName==\"BR\")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||On&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(c=>c.type==\"childList\"&&c.removedNodes.length))){for(let c of l)if(c.nodeName==\"BR\"&&c.parentNode){let d=c.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable==\"false\"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(_o&&l.length){let c=l.filter(d=>d.nodeName==\"BR\");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let p=f.parentNode;p&&p.nodeName==\"LI\"&&(!d||LG(e,d)!=p)&&f.remove()}}}let u=null;s<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ix(r)&&(u=S1(e))&&u.eq(pe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ia(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,a),kG(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,AG(e,l)),this.handleDOMChange(s,a,i,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ia(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type==\"attributes\"&&(r==this.view.docView||e.attributeName==\"contenteditable\"||e.attributeName==\"style\"&&!e.oldValue&&!e.target.getAttribute(\"style\"))||!r||r.ignoreMutation(e))return null;if(e.type==\"childList\"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,s=e.nextSibling;if(Ar&&zi<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:f}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let a=o&&o.parentNode==e.target?_n(o)+1:0,i=r.localPosFromDOM(e.target,a,-1),l=s&&s.parentNode==e.target?_n(s):e.target.childNodes.length,u=r.localPosFromDOM(e.target,l,1);return{from:i,to:u}}else return e.type==\"attributes\"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},TP=new WeakMap,RP=!1;function kG(t){if(!TP.has(t)&&(TP.set(t,null),[\"normal\",\"nowrap\",\"pre-line\"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=_o,RP)return;console.warn(\"ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.\"),RP=!0}}function IP(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return vu(a.node,a.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function CG(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return IP(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener(\"beforeinput\",r,!0),document.execCommand(\"indent\"),t.dom.removeEventListener(\"beforeinput\",r,!0),n?IP(t,n):null}function LG(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function AG(t,e){var n;let{focusNode:r,focusOffset:o}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)==\"TR\"){let a=s.nextSibling;for(;a&&a.nodeName!=\"TD\"&&a.nodeName!=\"TH\";)a=a.nextSibling;if(a){let i=a;for(;;){let l=i.firstChild;if(!l||l.nodeType!=1||l.contentEditable==\"false\"||/^(BR|IMG)$/.test(l.nodeName))break;i=l}i.insertBefore(s,i.firstChild),r==s&&t.domSelection().collapse(s,o)}else s.parentNode.removeChild(s)}}function EG(t,e,n,r){let{node:o,fromOffset:s,toOffset:a,from:i,to:l}=t.docView.parseRange(e,n),u=t.domSelectionRange(),c,d=u.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:u.anchorOffset}],ix(u)||c.push({node:u.focusNode,offset:u.focusOffset})),On&&t.input.lastKeyCode===8)for(let y=a;y>s;y--){let b=o.childNodes[y-1],x=b.pmViewDesc;if(b.nodeName==\"BR\"&&!x){a=y;break}if(!x||x.size)break}let f=t.state.doc,p=t.someProp(\"domParser\")||Xr.fromSchema(t.state.schema),h=f.resolve(i),g=null,m=p.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:s,to:a,preserveWhitespace:h.parent.type.whitespace==\"pre\"?\"full\":!0,findPositions:c,ruleFromNode:TG(r),context:h});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),g={anchor:y+i,head:b+i}}return{doc:m,sel:g,from:i,to:l}}var TG=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName==\"BR\"&&e.parentNode){if(Gn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement(\"div\");return r.appendChild(document.createElement(\"li\")),{skip:r}}else if(e.parentNode.lastChild==e||Gn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==\"IMG\"&&e.getAttribute(\"mark-placeholder\"))return{ignore:!0};return null},RG=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function IG(t,e,n,r,o){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let w=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,k=S1(t,w);if(k&&!t.state.selection.eq(k)){if(On&&Ta&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp(\"handleKeyDown\",L=>L(t,fu(13,\"Enter\"))))return;let A=t.state.tr.setSelection(k);w==\"pointer\"?A.setMeta(\"pointer\",!0):w==\"key\"&&A.scrollIntoView(),s&&A.setMeta(\"composition\",s),t.dispatch(A)}return}let a=t.state.doc.resolve(e),i=a.sharedDepth(n);e=a.before(i+1),n=t.state.doc.resolve(n).after(i+1);let l=t.state.selection,u=EG(t,e,n,o),c=t.state.doc,d=c.slice(u.from,u.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p=\"end\"):(f=t.state.selection.from,p=\"start\"),t.input.lastKeyCode=null;let h=OG(d.content,u.doc.content,u.from,f,p);if(h&&t.input.domChangeCount++,(jd&&t.input.lastIOSEnter>Date.now()-225||Ta)&&o.some(w=>w.nodeType==1&&!RG.test(w.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp(\"handleKeyDown\",w=>w(t,fu(13,\"Enter\")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof J&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let w=MP(t,t.state.doc,u.sel);if(w&&!w.eq(t.state.selection)){let k=t.state.tr.setSelection(w);s&&k.setMeta(\"composition\",s),t.dispatch(k)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof J&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Ar&&zi<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)==\" \\xA0\"&&(h.start--,h.endA--,h.endB--);let g=u.doc.resolveNoCache(h.start-u.from),m=u.doc.resolveNoCache(h.endB-u.from),y=c.resolve(h.start),b=g.sameParent(m)&&g.parent.inlineContent&&y.end()>=h.endA;if((jd&&t.input.lastIOSEnter>Date.now()-225&&(!b||o.some(w=>w.nodeName==\"DIV\"||w.nodeName==\"P\"))||!b&&g.pos<u.doc.content.size&&(!g.sameParent(m)||!g.parent.inlineContent)&&g.pos<m.pos&&!/\\S/.test(u.doc.textBetween(g.pos,m.pos,\"\",\"\")))&&t.someProp(\"handleKeyDown\",w=>w(t,fu(13,\"Enter\")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&_G(c,h.start,h.endA,g,m)&&t.someProp(\"handleKeyDown\",w=>w(t,fu(8,\"Backspace\")))){Ta&&On&&t.domObserver.suppressSelectionUpdates();return}On&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),Ta&&!b&&g.start()!=m.start()&&m.parentOffset==0&&g.depth==m.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,m=u.doc.resolveNoCache(h.endB-u.from),setTimeout(()=>{t.someProp(\"handleKeyDown\",function(w){return w(t,fu(13,\"Enter\"))})},20));let x=h.start,v=h.endA,S=w=>{let k=w||t.state.tr.replace(x,v,u.doc.slice(h.start-u.from,h.endB-u.from));if(u.sel){let A=MP(t,k.doc,u.sel);A&&!(On&&t.composing&&A.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(A.head==x||A.head==k.mapping.map(v)-1)||Ar&&A.empty&&A.head==x)&&k.setSelection(A)}return s&&k.setMeta(\"composition\",s),k.scrollIntoView()},E;if(b)if(g.pos==m.pos){Ar&&zi<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ia(t),20));let w=S(t.state.tr.delete(x,v)),k=c.resolve(h.start).marksAcross(c.resolve(h.endA));k&&w.ensureMarks(k),t.dispatch(w)}else if(h.endA==h.endB&&(E=MG(g.parent.content.cut(g.parentOffset,m.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start())))){let w=S(t.state.tr);E.type==\"add\"?w.addMark(x,v,E.mark):w.removeMark(x,v,E.mark),t.dispatch(w)}else if(g.parent.child(g.index()).isText&&g.index()==m.index()-(m.textOffset?0:1)){let w=g.parent.textBetween(g.parentOffset,m.parentOffset),k=()=>S(t.state.tr.insertText(w,x,v));t.someProp(\"handleTextInput\",A=>A(t,x,v,w,k))||t.dispatch(k())}else t.dispatch(S());else t.dispatch(S())}function MP(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:k1(t,e.resolve(n.anchor),e.resolve(n.head))}function MG(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,a,i,l;for(let c=0;c<r.length;c++)o=r[c].removeFromSet(o);for(let c=0;c<n.length;c++)s=n[c].removeFromSet(s);if(o.length==1&&s.length==0)i=o[0],a=\"add\",l=c=>c.mark(i.addToSet(c.marks));else if(o.length==0&&s.length==1)i=s[0],a=\"remove\",l=c=>c.mark(i.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(l(e.child(c)));if(H.from(u).eq(t))return{mark:i,type:a}}function _G(t,e,n,r,o){if(n-e<=o.pos-r.pos||e1(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let i=s.nodeAfter;return i!=null&&n==e+i.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let a=t.resolve(e1(s,!0,!0));return!a.parent.isTextblock||a.pos>n||e1(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function e1(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function OG(t,e,n,r,o){let s=t.findDiffStart(e,n),a=n+t.size,i=n+e.size;if(s==null)return null;let{a:l,b:u}=t.findDiffEnd(e,a,i);if(o==\"end\"){let c=Math.max(0,s-Math.min(l,u));r-=l+c-s}if(l<s&&a<i){let c=r<=s&&r>=l?s-r:0;s-=c,u=s+(u-l),l=s}else if(u<s){let c=r<=s&&r>=u?s-r:0;s-=c,l=s+(l-u),u=s}return{start:s,endA:l,endB:u}}var qd=class{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new h1,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(PP),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(\"div\"),e&&(e.appendChild?e.appendChild(this.dom):typeof e==\"function\"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=DP(this),OP(this),this.nodeViews=NP(this),this.docView=hP(this.state.doc,_P(this),QL(this),this.dom,this),this.domObserver=new x1(this,(r,o,s,a)=>IG(this,r,o,s,a)),this.domObserver.start(),eG(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&m1(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(PP),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(u2(this),a=!0),this.state=e;let i=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(i||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=NP(this);NG(p,this.nodeViews)&&(this.nodeViews=p,s=!0)}(i||n.handleDOMEvents!=this._props.handleDOMEvents)&&m1(this),this.editable=DP(this),OP(this);let l=QL(this),u=_P(this),c=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?\"reset\":e.scrollToSelection>o.scrollToSelection?\"to selection\":\"preserve\",d=s||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(o.selection))&&(a=!0);let f=c==\"preserve\"&&a&&this.dom.style.overflowAnchor==null&&bK(this);if(a){this.domObserver.stop();let p=d&&(Ar||On)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&DG(o.selection,e.selection);if(d){let g=On?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=pG(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=hP(e.doc,u,l,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}let h=this.input.mouseDown;p||!(h&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&FK(this)&&h.delaySelUpdate())?Ia(this,p):(JP(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),c==\"reset\"?this.dom.scrollTop=0:c==\"to selection\"?this.scrollToSelection():f&&vK(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp(\"handleScrollToSelection\",n=>n(this)))if(this.state.selection instanceof oe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&uP(this,n.getBoundingClientRect(),e)}else uP(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(o=s)}this.dragging=new rx(e.slice,e.move,o<0?void 0:oe.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let a=0;a<this.directPlugins.length;a++){let i=this.directPlugins[a].props[e];if(i!=null&&(o=n?n(i):i))return o}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let i=s[a].props[e];if(i!=null&&(o=n?n(i):i))return o}}hasFocus(){if(Ar){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==\"false\")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&xK(this.dom),Ia(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return LK(this,e)}coordsAtPos(e,n=1){return qP(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError(\"DOM position not inside the editor\");return o}endOfTextblock(e,n){return IK(this,n||this.state,e)}pasteHTML(e,n){return Pm(this,\"\",e,!1,n||new ClipboardEvent(\"paste\"))}pasteText(e,n){return Pm(this,e,null,!0,n||new ClipboardEvent(\"paste\"))}serializeForClipboard(e){return C1(this,e)}destroy(){this.docView&&(tG(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],QL(this),this),this.dom.textContent=\"\"):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,lK())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return rG(this,e)}domSelectionRange(){let e=this.domSelection();return e?Gn&&this.root.nodeType===11&&pK(this.dom.ownerDocument)==this.dom&&CG(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};qd.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function _P(t){let e=Object.create(null);return e.class=\"ProseMirror\",e.contenteditable=String(t.editable),t.someProp(\"attributes\",n=>{if(typeof n==\"function\"&&(n=n(t.state)),n)for(let r in n)r==\"class\"?e.class+=\" \"+n[r]:r==\"style\"?e.style=(e.style?e.style+\";\":\"\")+n[r]:!e[r]&&r!=\"contenteditable\"&&r!=\"nodeName\"&&(e[r]=String(n[r]))}),e.translate||(e.translate=\"no\"),[yn.node(0,t.state.doc.content.size,e)]}function OP(t){if(t.markCursor){let e=document.createElement(\"img\");e.className=\"ProseMirror-separator\",e.setAttribute(\"mark-placeholder\",\"true\"),e.setAttribute(\"alt\",\"\"),t.cursorWrapper={dom:e,deco:yn.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function DP(t){return!t.someProp(\"editable\",e=>e(t.state)===!1)}function DG(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function NP(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp(\"nodeViews\",n),t.someProp(\"markViews\",n),e}function NG(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function PP(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError(\"Plugins passed directly to the view must not have a state component\")}var Ma={8:\"Backspace\",9:\"Tab\",10:\"Enter\",12:\"NumLock\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",44:\"PrintScreen\",45:\"Insert\",46:\"Delete\",59:\";\",61:\"=\",91:\"Meta\",92:\"Meta\",106:\"*\",107:\"+\",108:\",\",109:\"-\",110:\".\",111:\"/\",144:\"NumLock\",145:\"ScrollLock\",160:\"Shift\",161:\"Shift\",162:\"Control\",163:\"Control\",164:\"Alt\",165:\"Alt\",173:\"-\",186:\";\",187:\"=\",188:\",\",189:\"-\",190:\".\",191:\"/\",192:\"`\",219:\"[\",220:\"\\\\\",221:\"]\",222:\"'\"},ux={48:\")\",49:\"!\",50:\"@\",51:\"#\",52:\"$\",53:\"%\",54:\"^\",55:\"&\",56:\"*\",57:\"(\",59:\":\",61:\"+\",173:\"_\",186:\":\",187:\"+\",188:\"<\",189:\"_\",190:\">\",191:\"?\",192:\"~\",219:\"{\",220:\"|\",221:\"}\",222:'\"'},PG=typeof navigator<\"u\"&&/Mac/.test(navigator.platform),BG=typeof navigator<\"u\"&&/MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);for(en=0;en<10;en++)Ma[48+en]=Ma[96+en]=String(en);var en;for(en=1;en<=24;en++)Ma[en+111]=\"F\"+en;var en;for(en=65;en<=90;en++)Ma[en]=String.fromCharCode(en+32),ux[en]=String.fromCharCode(en);var en;for(lx in Ma)ux.hasOwnProperty(lx)||(ux[lx]=Ma[lx]);var lx;function m2(t){var e=PG&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||BG&&t.shiftKey&&t.key&&t.key.length==1||t.key==\"Unidentified\",n=!e&&t.key||(t.shiftKey?ux:Ma)[t.keyCode]||t.key||\"Unidentified\";return n==\"Esc\"&&(n=\"Escape\"),n==\"Del\"&&(n=\"Delete\"),n==\"Left\"&&(n=\"ArrowLeft\"),n==\"Up\"&&(n=\"ArrowUp\"),n==\"Right\"&&(n=\"ArrowRight\"),n==\"Down\"&&(n=\"ArrowDown\"),n}var zG=typeof navigator<\"u\"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),FG=typeof navigator<\"u\"&&/Win/.test(navigator.platform);function HG(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==\"Space\"&&(n=\" \");let r,o,s,a;for(let i=0;i<e.length-1;i++){let l=e[i];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))zG?a=!0:o=!0;else throw new Error(\"Unrecognized modifier name: \"+l)}return r&&(n=\"Alt-\"+n),o&&(n=\"Ctrl-\"+n),a&&(n=\"Meta-\"+n),s&&(n=\"Shift-\"+n),n}function $G(t){let e=Object.create(null);for(let n in t)e[HG(n)]=t[n];return e}function R1(t,e,n=!0){return e.altKey&&(t=\"Alt-\"+t),e.ctrlKey&&(t=\"Ctrl-\"+t),e.metaKey&&(t=\"Meta-\"+t),n&&e.shiftKey&&(t=\"Shift-\"+t),t}function cx(t){return new ie({props:{handleKeyDown:I1(t)}})}function I1(t){let e=$G(t);return function(n,r){let o=m2(r),s,a=e[R1(o,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=\" \"){if(r.shiftKey){let i=e[R1(o,r,!1)];if(i&&i(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(FG&&r.ctrlKey&&r.altKey)&&(s=Ma[r.keyCode])&&s!=o){let i=e[R1(s,r)];if(i&&i(n.state,n.dispatch,n))return!0}}return!1}}var dx=200,Dn=function(){};Dn.prototype.append=function(e){return e.length?(e=Dn.from(e),!this.length&&e||e.length<dx&&this.leafAppend(e)||this.length<dx&&e.leafPrepend(this)||this.appendInner(e)):this};Dn.prototype.prepend=function(e){return e.length?Dn.from(e).append(this):this};Dn.prototype.appendInner=function(e){return new UG(this,e)};Dn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Dn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Dn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Dn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Dn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(s,a){return o.push(e(s,a))},n,r),o};Dn.from=function(e){return e instanceof Dn?e:e&&e.length?new g2(e):Dn.empty};var g2=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,a,i){for(var l=s;l<a;l++)if(o(this.values[l],i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,a,i){for(var l=s-1;l>=a;l--)if(o(this.values[l],i+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=dx)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=dx)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(Dn);Dn.empty=new g2([]);var UG=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,s,a){var i=this.left.length;if(o<i&&this.left.forEachInner(r,o,Math.min(s,i),a)===!1||s>i&&this.right.forEachInner(r,Math.max(o-i,0),Math.min(this.length,s)-i,a+i)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,a){var i=this.left.length;if(o>i&&this.right.forEachInvertedInner(r,o-i,Math.max(s,i)-i,a+i)===!1||s<i&&this.left.forEachInvertedInner(r,Math.min(o,i),s,a)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(r,o):r>=s?this.right.slice(r-s,o-s):this.left.slice(r,s).append(this.right.slice(0,o-s))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(Dn),M1=Dn;var jG=500,wu=class t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let a=e.tr,i,l,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),s=o.maps.length),s--,c.push(d);return}if(o){c.push(new As(d.map));let p=d.step.map(o.slice(s)),h;p&&a.maybeStep(p).doc&&(h=a.mapping.maps[a.mapping.maps.length-1],u.push(new As(h,void 0,void 0,u.length+c.length))),s--,h&&o.appendMap(h,s)}else a.maybeStep(d.step);if(d.selection)return i=o?d.selection.map(o.slice(s)):d.selection,l=new t(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:i}}addTransform(e,n,r,o){let s=[],a=this.eventCount,i=this.items,l=!o&&i.length?i.get(i.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),f=new As(e.mapping.maps[c],d,n),p;(p=l&&l.merge(f))&&(f=p,c?s.pop():i=i.slice(0,i.length-1)),s.push(f),n&&(a++,n=void 0),o||(l=f)}let u=a-r.depth;return u>VG&&(i=qG(i,u),a-=u),new t(i.append(s),a)}remapping(e,n){let r=new gm;return this.items.forEach((o,s)=>{let a=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new t(this.items.append(e.map(n=>new As(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,i=this.eventCount;this.items.forEach(f=>{f.selection&&i--},o);let l=n;this.items.forEach(f=>{let p=s.getMirror(--l);if(p==null)return;a=Math.min(a,p);let h=s.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),m=f.selection&&f.selection.map(s.slice(l+1,p));m&&i++,r.push(new As(h,g,m))}else r.push(new As(h))},o);let u=[];for(let f=n;f<a;f++)u.push(new As(s.maps[f]));let c=this.items.slice(0,o).append(u).append(r),d=new t(c,i);return d.emptyItemCount()>jG&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((a,i)=>{if(i>=e)o.push(a),a.selection&&s++;else if(a.step){let l=a.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=a.selection&&a.selection.map(n.slice(r));c&&s++;let d=new As(u.invert(),l,c),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else a.map&&r--},this.items.length,0),new t(M1.from(o.reverse()),s)}};wu.empty=new wu(M1.empty,0);function qG(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}var As=class t{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}},Es=class{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}},VG=20;function KG(t,e,n,r){let o=n.getMeta($i),s;if(o)return o.historyState;n.getMeta(v2)&&(t=new Es(t.done,t.undone,null,0,-1));let a=n.getMeta(\"appendedTransaction\");if(n.steps.length==0)return t;if(a&&a.getMeta($i))return a.getMeta($i).redo?new Es(t.done.addTransform(n,void 0,r,fx(e)),t.undone,y2(n.mapping.maps),t.prevTime,t.prevComposition):new Es(t.done,t.undone.addTransform(n,void 0,r,fx(e)),null,t.prevTime,t.prevComposition);if(n.getMeta(\"addToHistory\")!==!1&&!(a&&a.getMeta(\"addToHistory\")===!1)){let i=n.getMeta(\"composition\"),l=t.prevTime==0||!a&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!GG(n,t.prevRanges)),u=a?_1(t.prevRanges,n.mapping):y2(n.mapping.maps);return new Es(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,fx(e)),wu.empty,u,n.time,i??t.prevComposition)}else return(s=n.getMeta(\"rebased\"))?new Es(t.done.rebased(n,s),t.undone.rebased(n,s),_1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Es(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),_1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function GG(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function y2(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,a)=>e.push(s,a));return e}function _1(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function WG(t,e,n){let r=fx(e),o=$i.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),i=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),l=new Es(n?i:s.remaining,n?s.remaining:i,null,0,-1);return s.transform.setSelection(a).setMeta($i,{redo:n,historyState:l})}var O1=!1,b2=null;function fx(t){let e=t.plugins;if(b2!=e){O1=!1,b2=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){O1=!0;break}}return O1}function px(t){return t.setMeta(v2,!0)}var $i=new we(\"history\"),v2=new we(\"closeHistory\");function x2(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ie({key:$i,state:{init(){return new Es(wu.empty,wu.empty,null,0,-1)},apply(e,n,r){return KG(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r==\"historyUndo\"?D1:r==\"historyRedo\"?N1:null;return!o||!e.editable?!1:(n.preventDefault(),o(e.state,e.dispatch))}}}})}function hx(t,e){return(n,r)=>{let o=$i.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=WG(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}var D1=hx(!1,!0),N1=hx(!0,!0),Ode=hx(!1,!1),Dde=hx(!0,!1);function mx(t){return t.getMeta($i)!=null}function wx(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}var Xd=class P2{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:s}=r,a=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([i,l])=>[i,(...c)=>{let d=l(...c)(a);return!s.getMeta(\"preventDispatch\")&&!this.hasCustomState&&o.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:o,state:s}=this,{view:a}=o,i=[],l=!!e,u=e||s.tr,c=()=>(!l&&n&&!u.getMeta(\"preventDispatch\")&&!this.hasCustomState&&a.dispatch(u),i.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...g)=>{let m=this.buildProps(u,n),y=p(...g)(m);return i.push(y),d}])),run:c};return d}static createFakeChain(){let e=new Proxy({},{get:(n,r)=>{if(r!==\"then\")return r===\"run\"?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:n,state:r}=this,o=!1,s=e||r.tr,a=this.buildProps(s,o);return{...Object.fromEntries(Object.entries(n).map(([i,l])=>[i,(...u)=>l(...u)({...a,dispatch:void 0})])),chain:()=>this.createChain(s,o)}}static createFallbackCan(){let e=P2.createFakeChain();return new Proxy({chain:()=>e},{get:(n,r)=>{if(r!==\"then\")return r===\"chain\"?n.chain:()=>!1}})}buildProps(e,n=!0){let{rawCommands:r,editor:o,state:s}=this,{view:a}=o,i={tr:e,editor:o,view:a,state:wx({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...c)=>u(...c)(i)]))}};return i}},XG=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{if(!t.isDestroyed){var n;e.dom.blur(),(n=window)===null||n===void 0||(n=n.getSelection())===null||n===void 0||n.removeAllRanges()}}),!0),JG=(t=!0)=>({commands:e})=>e.setContent(\"\",{emitUpdate:t}),YG=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(i,l)=>{if(i.type.isText)return;let{doc:u,mapping:c}=e,d=u.resolve(c.map(l)),f=u.resolve(c.map(l+i.nodeSize)),p=d.blockRange(f);if(!p)return;let h=Jo(p);if(i.type.isTextblock){let{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,g)}(h||h===0)&&e.lift(p,h)})}),!0},ZG=t=>e=>t(e),QG=()=>({state:t,dispatch:e})=>Em(t,e),eW=(t,e)=>({editor:n,tr:r})=>{let{state:o}=n,s=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new J(r.doc.resolve(Math.max(a-1,0)))),!0},tW=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){let a=o.before(s),i=o.after(s);t.delete(a,i).scrollIntoView()}return!0}return!1};function tn(t,e){if(typeof t==\"string\"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var nW=t=>({tr:e,state:n,dispatch:r})=>{let o=tn(t,n.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===o){if(r){let i=s.before(a),l=s.after(a);e.delete(i,l).scrollIntoView()}return!0}return!1},rW=t=>({tr:e,dispatch:n})=>{let{from:r,to:o}=t;return n&&e.delete(r,o),!0},oW=t=>t.content?/^text(\\*|\\+)/.test(t.content):!1,w2=(t,e,n)=>{if(!t.parent.isInline||n===\"left\"&&t.pos>t.start()||n===\"right\"&&t.pos<t.end())return t.pos;let r=e.nodes[t.parent.type.name].spec;return oW(r)?n===\"left\"?t.start()-1:t.end()+1:t.pos},sW=(t,e,n)=>({from:w2(t,n,\"left\"),to:w2(e,n,\"right\")}),aW=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){let n=t.tr,{ranges:r}=t.selection,o=n.steps.length;r.forEach(s=>{let a=n.mapping.slice(o),i=n.doc.resolve(a.map(s.$from.pos)),l=n.doc.resolve(a.map(s.$to.pos)),{from:u,to:c}=sW(i,l,t.schema);n.deleteRange(u,c)}),n.selection.empty||n.setSelection(J.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},iW=()=>({commands:t})=>t.keyboardShortcut(\"Enter\"),lW=()=>({state:t,dispatch:e})=>Am(t,e);function j1(t){return Object.prototype.toString.call(t)===\"[object RegExp]\"}function xx(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:j1(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function B2(t,e,n={}){return t.find(r=>r.type===e&&xx(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function S2(t,e,n={}){return!!B2(t,e,n)}function q1(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(l=>l.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(l=>l.type===e))return;if(!n){let l=r.node.marks.find(u=>u.type===e);l&&(n=l.attrs)}if(!B2([...r.node.marks],e,n))return;let o=r.index,s=t.start()+r.offset,a=o+1,i=s+r.node.nodeSize;for(;o>0&&S2([...t.parent.child(o-1).marks],e,n);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&S2([...t.parent.child(a).marks],e,n);)i+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:i}}function _a(t,e){if(typeof t==\"string\"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var uW=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=_a(t,r.schema),{doc:a,selection:i}=n,{$from:l,from:u,to:c}=i;if(o){let d=q1(l,s,e);if(d&&d.from<=u&&d.to>=c){let f=J.create(a,d.from,d.to);n.setSelection(f)}}return!0},cW=t=>e=>{let n=typeof t==\"function\"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Sx(t){return t instanceof J}function Su(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function F1(t,e=null){if(!e)return null;let n=pe.atStart(t),r=pe.atEnd(t);if(e===\"start\"||e===!0)return n;if(e===\"end\")return r;let o=n.from,s=r.to;return e===\"all\"?J.create(t,Su(0,o,s),Su(t.content.size,o,s)):J.create(t,Su(e,o,s),Su(e,o,s))}function qm(){return[\"Android\"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function ku(){return[\"iPad Simulator\",\"iPhone Simulator\",\"iPod Simulator\",\"iPad\",\"iPhone\",\"iPod\"].includes(navigator.platform)||navigator.userAgent.includes(\"Mac\")&&\"ontouchend\"in document}function dW(){return typeof navigator<\"u\"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var fW=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};let a=()=>{(ku()||qm())&&r.dom.focus(),dW()&&!ku()&&!qm()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!Sx(n.state.selection))return a(),!0;let i=F1(o.doc,t)||n.state.selection,l=n.state.selection.eq(i);return s&&(l||o.setSelection(i),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},pW=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),hW=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),z2=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\\n\\s\\s|\\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&z2(r)}return t};function gx(t){if(typeof window>\"u\")throw new Error(\"[tiptap error]: there is no window object available, so this function cannot be used\");let e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,\"text/html\").body;return z2(n)}function F2(t){return typeof t?.nodesBetween==\"function\"}function Jd(t,e,n){if(F2(t))return t;let r=typeof t==\"object\"&&t!==null;n={slice:!0,parseOptions:{},...n};let o=typeof t==\"string\";if(r)try{if(Array.isArray(t)&&t.length>0)return H.fromArray(t.map(a=>e.nodeFromJSON(a)));let s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(s){if(n.errorOnInvalidContent)throw new Error(\"[tiptap error]: Invalid JSON content\",{cause:s});return console.warn(\"[tiptap warn]: Invalid content.\",\"Passed value:\",t,\"Error:\",s),Jd(\"\",e,n)}if(o){if(n.errorOnInvalidContent){let a=!1,i=\"\",l=new _i({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:\"inline*\",group:\"block\",parseDOM:[{tag:\"*\",getAttrs:u=>(a=!0,i=typeof u==\"string\"?u:u.outerHTML,null)}]}})});if(n.slice?Xr.fromSchema(l).parseSlice(gx(t),n.parseOptions):Xr.fromSchema(l).parse(gx(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error(\"[tiptap error]: Invalid HTML content\",{cause:new Error(`Invalid element found: ${i}`)})}let s=Xr.fromSchema(e);return n.slice?s.parseSlice(gx(t),n.parseOptions).content:s.parse(gx(t),n.parseOptions)}return Jd(\"\",e,n)}function H2(t){return!(\"type\"in t)}function $2(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Rt||o instanceof Bt))return;let s=t.mapping.maps[r],a=0;s.forEach((i,l,u,c)=>{a===0&&(a=c)}),t.setSelection(pe.near(t.doc.resolve(a),n))}var mW=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,l=m=>{s.emit(\"contentError\",{editor:s,error:m,disableCollaboration:()=>{\"collaboration\"in s.storage&&typeof s.storage.collaboration==\"object\"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:\"full\",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Jd(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(m){l(m)}try{var a;i=Jd(e,s.schema,{parseOptions:u,errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck})}catch(m){return l(m),!1}let{from:c,to:d}=typeof t==\"number\"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0,h=H2(i)?i.content:[i];if(h.forEach(m=>{m.check(),f=f?m.isText&&m.marks.length===0:!1,p=p?m.isBlock:!1}),c===d&&p){let{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,d+=1)}let g;if(f)Array.isArray(e)?g=e.map(m=>m.text||\"\").join(\"\"):F2(e)?g=h.map(m=>{var y;return(y=m.text)!==null&&y!==void 0?y:\"\"}).join(\"\"):typeof e==\"object\"&&e&&e.text?g=e.text:g=e,r.insertText(g,c,d);else{g=H.from(h);let m=r.doc.resolve(c),y=m.node(),b=m.parentOffset===0,x=y.isText||y.isTextblock,v=y.content.size>0;b&&x&&v&&p&&(c=Math.max(0,c-1)),r.replaceWith(c,d,h)}n.updateSelection&&$2(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(\"applyInputRules\",{from:c,text:g}),n.applyPasteRules&&r.setMeta(\"applyPasteRules\",{from:c,text:g})}return!0};function U2(t){for(let e=0;e<t.edgeCount;e+=1){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var gW=(t={})=>({tr:e,dispatch:n,editor:r})=>{let{pos:o,attrs:s,content:a,updateSelection:i=!0}=t,l;typeof o==\"number\"?l=e.doc.resolve(o):o?l=o:l=e.selection.$from;let u=U2(l.parent.contentMatchAt(l.index()));if(!u)return!1;let c=Object.keys(u.spec.attrs||{}),d=s?Object.fromEntries(Object.entries(s).filter(([p])=>c.includes(p))):{},f;if(a){let p=Jd(a,r.schema);f=u.createAndFill(d,p)}else f=u.createAndFill(d);return f?(n&&(e.insert(l.pos,f),i&&$2(e,e.steps.length-1,-1)),!0):!1},yW=()=>({state:t,dispatch:e})=>Uv(t,e),bW=()=>({state:t,dispatch:e})=>jv(t,e),vW=()=>({state:t,dispatch:e})=>wm(t,e),xW=()=>({state:t,dispatch:e})=>km(t,e),j2=(t,e)=>{let n=t.resolve(e),r=n.nodeBefore,o=n.nodeAfter;return!r||!o?!1:!r.type.spec.isolating&&!o.type.spec.isolating},wW=()=>({state:t,dispatch:e,tr:n})=>{try{let r=La(t.doc,t.selection.$from.pos,-1);return r==null||!j2(t.doc,r)?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},SW=()=>({state:t,dispatch:e,tr:n})=>{try{let r=La(t.doc,t.selection.$from.pos,1);return r==null||!j2(t.doc,r)?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},kW=()=>({state:t,dispatch:e})=>Hv(t,e),CW=()=>({state:t,dispatch:e})=>$v(t,e);function q2(){return typeof navigator<\"u\"?/Mac/.test(navigator.platform):!1}function LW(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n===\"Space\"&&(n=\" \");let r,o,s,a;for(let i=0;i<e.length-1;i+=1){let l=e[i];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))ku()||q2()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var AW=t=>({editor:e,view:n,tr:r,dispatch:o})=>{let s=LW(t).split(/-(?!$)/),a=s.find(u=>![\"Alt\",\"Ctrl\",\"Meta\",\"Shift\"].includes(u)),i=new KeyboardEvent(\"keydown\",{key:a===\"Space\"?\" \":a,altKey:s.includes(\"Alt\"),ctrlKey:s.includes(\"Ctrl\"),metaKey:s.includes(\"Meta\"),shiftKey:s.includes(\"Shift\"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp(\"handleKeyDown\",u=>u(n,i))});return l?.steps.forEach(u=>{let c=u.map(r.mapping);c&&o&&r.maybeStep(c)}),!0};function Ts(t,e,n={}){let{from:r,to:o,empty:s}=t.selection,a=e?tn(e,t.schema):null,i=[];t.doc.nodesBetween(r,o,(c,d)=>{if(c.isText)return;let f=Math.max(r,d),p=Math.min(o,d+c.nodeSize);i.push({node:c,from:f,to:p})});let l=o-r,u=i.filter(c=>a?a.name===c.node.type.name:!0).filter(c=>xx(c.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((c,d)=>c+d.to-d.from,0)>=l}var EW=(t,e={})=>({state:n,dispatch:r})=>Ts(n,tn(t,n.schema),e)?qv(n,r):!1,TW=()=>({state:t,dispatch:e})=>Tm(t,e),RW=t=>({state:e,dispatch:n})=>{let r=tn(t,e.schema);return Wv(r)(e,n)},IW=()=>({state:t,dispatch:e})=>Lm(t,e);function kx(t,e){return e.nodes[t]?\"node\":e.marks[t]?\"mark\":null}function k2(t,e){let n=typeof e==\"string\"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}var MW=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,a=null,i=kx(typeof t==\"string\"?t:t.name,r.schema);if(!i)return!1;i===\"node\"&&(s=tn(t,r.schema)),i===\"mark\"&&(a=_a(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,d)=>{s&&s===c.type&&(l=!0,o&&n.setNodeMarkup(d,void 0,k2(c.attrs,e))),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&(l=!0,o&&n.addMark(d,d+c.nodeSize,a.create(k2(f.attrs,e))))})})}),l},_W=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),OW=()=>({tr:t,dispatch:e})=>{if(e){let n=new Mn(t.doc);t.setSelection(n)}return!0},DW=()=>({state:t,dispatch:e})=>Sm(t,e),NW=()=>({state:t,dispatch:e})=>Cm(t,e),PW=()=>({state:t,dispatch:e})=>Vv(t,e),BW=()=>({state:t,dispatch:e})=>Im(t,e),zW=()=>({state:t,dispatch:e})=>Rm(t,e);function H1(t,e,n={},r={}){return Jd(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var FW=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:a,commands:i})=>{let{doc:l}=s;if(r.preserveWhitespace!==\"full\"){let u=H1(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});if(a){let c=H2(u)?u.content:[u];s.replaceWith(0,l.content.size,c).setMeta(\"preventUpdate\",!n)}return!0}return a&&s.setMeta(\"preventUpdate\",!n),i.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function V2(t,e){let n=_a(e,t.schema),{from:r,to:o,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{a.push(...l.marks)});let i=a.find(l=>l.type.name===n.name);return i?{...i.attrs}:{}}function V1(t,e){let n=new Oi(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function K2(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function HW(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Cx(t){return e=>HW(e.$from,t)}function le(t,e,n){return t.config[e]===void 0&&t.parent?le(t.parent,e,n):typeof t.config[e]==\"function\"?t.config[e].bind({...n,parent:t.parent?le(t.parent,e,n):null}):t.config[e]}function K1(t){return t.map(e=>{let n=le(e,\"addExtensions\",{name:e.name,options:e.options,storage:e.storage});return n?[e,...K1(n())]:e}).flat(10)}function G1(t,e){let n=Wo.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement(\"div\");return r.appendChild(n),r.innerHTML}function $1(t){return typeof t==\"function\"}function ut(t,e=void 0,...n){return $1(t)?e?t.bind(e)(...n):t(...n):t}function $W(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Yd(t){return{baseExtensions:t.filter(e=>e.type===\"extension\"),nodeExtensions:t.filter(e=>e.type===\"node\"),markExtensions:t.filter(e=>e.type===\"mark\")}}function G2(t){let e=[],{nodeExtensions:n,markExtensions:r}=Yd(t),o=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},a=n.filter(u=>u.name!==\"text\").map(u=>u.name),i=r.map(u=>u.name),l=[...a,...i];return t.forEach(u=>{let c=le(u,\"addGlobalAttributes\",{name:u.name,options:u.options,storage:u.storage,extensions:o});c&&c().forEach(d=>{let f;Array.isArray(d.types)?f=d.types:d.types===\"*\"?f=l:d.types===\"nodes\"?f=a:d.types===\"marks\"?f=i:f=[],f.forEach(p=>{Object.entries(d.attributes).forEach(([h,g])=>{e.push({type:p,name:h,attribute:{...s,...g}})})})})}),o.forEach(u=>{let c=le(u,\"addAttributes\",{name:u.name,options:u.options,storage:u.storage});if(!c)return;let d=c();Object.entries(d).forEach(([f,p])=>{let h={...s,...p};typeof h?.default==\"function\"&&(h.default=h.default()),h?.isRequired&&h?.default===void 0&&delete h.default,e.push({type:u.name,name:f,attribute:h})})}),e}function UW(t){let e=[],n=\"\",r=!1,o=!1,s=0,a=t.length;for(let i=0;i<a;i+=1){let l=t[i];if(l===\"'\"&&!o){r=!r,n+=l;continue}if(l==='\"'&&!r){o=!o,n+=l;continue}if(!r&&!o){if(l===\"(\"){s+=1,n+=l;continue}if(l===\")\"&&s>0){s-=1,n+=l;continue}if(l===\";\"&&s===0){e.push(n),n=\"\";continue}}n+=l}return n&&e.push(n),e}function C2(t){let e=[],n=UW(t||\"\"),r=n.length;for(let o=0;o<r;o+=1){let s=n[o],a=s.indexOf(\":\");if(a===-1)continue;let i=s.slice(0,a).trim(),l=s.slice(a+1).trim();i&&l&&e.push([i,l])}return e}function Vt(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([o,s])=>{if(o===\"__proto__\"){Object.defineProperty(r,o,{configurable:!0,enumerable:!0,value:s,writable:!0});return}if(!r[o]){r[o]=s;return}if(o===\"class\"){let a=s?String(s).split(\" \"):[],i=r[o]?r[o].split(\" \"):[],l=a.filter(u=>!i.includes(u));r[o]=[...i,...l].join(\" \")}else if(o===\"style\"){let a=new Map([...C2(r[o]),...C2(s)]);r[o]=Array.from(a.entries()).map(([i,l])=>`${i}: ${l}`).join(\"; \")}else r[o]=s}),r},{})}function Ui(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Vt(n,r),{})}function jW(t){return typeof t!=\"string\"?t:t.match(/^[+-]?(?:\\d*\\.)?\\d+$/)?Number(t):t===\"true\"?!0:t===\"false\"?!1:t}function L2(t,e){return\"style\"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let o=e.reduce((s,a)=>{let i=a.attribute.parseHTML?a.attribute.parseHTML(n):jW(n.getAttribute(a.name));return i==null?s:{...s,[a.name]:i}},{});return{...r,...o}}}}function A2(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e===\"attrs\"&&$W(n)?!1:n!=null))}function E2(t){var e,n;let r={};return!(!(t==null||(e=t.attribute)===null||e===void 0)&&e.isRequired)&&\"default\"in(t?.attribute||{})&&(r.default=t.attribute.default),(t==null||(n=t.attribute)===null||n===void 0?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function qW(t,e){var n;let r=G2(t),{nodeExtensions:o,markExtensions:s}=Yd(t),a=(n=o.find(u=>le(u,\"topNode\")))===null||n===void 0?void 0:n.name,i=Object.fromEntries(o.map(u=>{let c=r.filter(m=>m.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=A2({...t.reduce((m,y)=>{let b=le(y,\"extendNodeSchema\",d);return{...m,...b?b(u):{}}},{}),content:ut(le(u,\"content\",d)),marks:ut(le(u,\"marks\",d)),group:ut(le(u,\"group\",d)),inline:ut(le(u,\"inline\",d)),atom:ut(le(u,\"atom\",d)),selectable:ut(le(u,\"selectable\",d)),draggable:ut(le(u,\"draggable\",d)),code:ut(le(u,\"code\",d)),whitespace:ut(le(u,\"whitespace\",d)),linebreakReplacement:ut(le(u,\"linebreakReplacement\",d)),defining:ut(le(u,\"defining\",d)),isolating:ut(le(u,\"isolating\",d)),attrs:Object.fromEntries(c.map(E2))}),p=ut(le(u,\"parseHTML\",d));p&&(f.parseDOM=p.map(m=>L2(m,c)));let h=le(u,\"renderHTML\",d);h&&(f.toDOM=m=>h({node:m,HTMLAttributes:Ui(m,c)}));let g=le(u,\"renderText\",d);return g&&(f.toText=g),[u.name,f]})),l=Object.fromEntries(s.map(u=>{let c=r.filter(g=>g.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=A2({...t.reduce((g,m)=>{let y=le(m,\"extendMarkSchema\",d);return{...g,...y?y(u):{}}},{}),inclusive:ut(le(u,\"inclusive\",d)),excludes:ut(le(u,\"excludes\",d)),group:ut(le(u,\"group\",d)),spanning:ut(le(u,\"spanning\",d)),code:ut(le(u,\"code\",d)),attrs:Object.fromEntries(c.map(E2))}),p=ut(le(u,\"parseHTML\",d));p&&(f.parseDOM=p.map(g=>L2(g,c)));let h=le(u,\"renderHTML\",d);return h&&(f.toDOM=g=>h({mark:g,HTMLAttributes:Ui(g,c)})),[u.name,f]}));return new _i({topNode:a,nodes:i,marks:l})}function VW(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function jm(t){return t.sort((n,r)=>{let o=le(n,\"priority\")||100,s=le(r,\"priority\")||100;return o>s?-1:o<s?1:0})}function W2(t){let e=jm(K1(t)),n=VW(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(\", \")}]. This can lead to issues.`),e}function X2(t,e,n){let{from:r,to:o}=e,{blockSeparator:s=`\n\n`,textSerializers:a={}}=n||{},i=\"\";return t.nodesBetween(r,o,(l,u,c,d)=>{l.isBlock&&u>r&&(i+=s);let f=a?.[l.type.name];if(f)return c&&(i+=f({node:l,pos:u,parent:c,index:d,range:e})),!1;if(l.isText){var p;i+=l==null||(p=l.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,o-u)}}),i}function KW(t,e){return X2(t,{from:0,to:t.content.size},e)}function J2(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function GW(t,e){let n=tn(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,i=>{s.push(i)});let a=s.reverse().find(i=>i.type.name===n.name);return a?{...a.attrs}:{}}function W1(t,e){let n=kx(typeof e==\"string\"?e:e.name,t.schema);return n===\"node\"?GW(t,e):n===\"mark\"?V2(t,e):{}}function WW(t,e=JSON.stringify){let n={};return t.filter(r=>{let o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function XW(t){let e=WW(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function Lx(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{let a=[];if(o.ranges.length)o.forEach((i,l)=>{a.push({from:i,to:l})});else{let{from:i,to:l}=n[s];if(i===void 0||l===void 0)return;a.push({from:i,to:l})}a.forEach(({from:i,to:l})=>{let u=e.slice(s).map(i,-1),c=e.slice(s).map(l),d=e.invert().map(u,-1),f=e.invert().map(c);r.push({oldRange:{from:d,to:f},newRange:{from:u,to:c}})})}),XW(r)}function Vm(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(o=>{let s=q1(n.resolve(t),o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,s)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(a=>({from:s,to:s+o.nodeSize,mark:a})))}),r}var Y2=(t,e,n,r=20)=>{let o=t.doc.resolve(n),s=r,a=null;for(;s>0&&a===null;){let i=o.node(s);i?.type.name===e?a=i:s-=1}return[a,s]},Z2=t=>{let e=t.depth-1;if(e<0)return null;let n=t.index(e);return n===0?null:t.node(e).child(n-1)};function Vd(t,e){return e.nodes[t]||e.marks[t]||null}function vx(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}var JW=(t,e=500)=>{let n=\"\",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,a,i)=>{var l,u;let c=((l=(u=o.type.spec).toText)===null||l===void 0?void 0:l.call(u,{node:o,pos:s,parent:a,index:i}))||o.textContent||\"%leaf%\";n+=o.isAtom&&!o.isText?c:c.slice(0,Math.max(0,r-s))}),n};function U1(t,e,n={}){let{empty:r,ranges:o}=t.selection,s=e?_a(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(c=>s?s.name===c.type.name:!0).find(c=>xx(c.attrs,n,{strict:!1}));let a=0,i=[];if(o.forEach(({$from:c,$to:d})=>{let f=c.pos,p=d.pos;t.doc.nodesBetween(f,p,(h,g)=>{if(s&&h.inlineContent&&!h.type.allowsMarkType(s))return!1;if(!h.isText&&!h.marks.length)return;let m=Math.max(f,g),y=Math.min(p,g+h.nodeSize),b=y-m;a+=b,i.push(...h.marks.map(x=>({mark:x,from:m,to:y})))})}),a===0)return!1;let l=i.filter(c=>s?s.name===c.mark.type.name:!0).filter(c=>xx(c.mark.attrs,n,{strict:!1})).reduce((c,d)=>c+d.to-d.from,0),u=i.filter(c=>s?c.mark.type!==s&&c.mark.type.excludes(s):!0).reduce((c,d)=>c+d.to-d.from,0);return(l>0?l+u:l)>=a}function YW(t,e,n={}){if(!e)return Ts(t,null,n)||U1(t,null,n);let r=kx(e,t.schema);return r===\"node\"?Ts(t,e,n):r===\"mark\"?U1(t,e,n):!1}var Q2=(t,e)=>{let{$from:n,$to:r,$anchor:o}=t.selection;if(e){let s=Cx(i=>i.type.name===e)(t.selection);if(!s)return!1;let a=t.doc.resolve(s.pos+1);return o.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},eB=t=>{let{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function T2(t,e){return Array.isArray(e)?e.some(n=>(typeof n==\"string\"?n:n.name)===t.name):e}function P1(t,e){let{nodeExtensions:n}=Yd(e),r=n.find(s=>s.name===t);if(!r)return!1;let o=ut(le(r,\"group\",{name:r.name,options:r.options,storage:r.storage}));return typeof o!=\"string\"?!1:o.split(\" \").includes(\"list\")}function X1(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){if(n){if(t.type.name===\"hardBreak\")return!0;if(t.isText){var r;return!/\\S/.test((r=t.text)!==null&&r!==void 0?r:\"\")}}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(s=>{o!==!1&&(X1(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}var tB=class nB{constructor(e){this.position=e}static fromJSON(e){return new nB(e.position)}toJSON(){return{position:this.position}}};function ZW(t,e){let n=e.mapping.mapResult(t.position);return{position:new tB(n.pos),mapResult:n}}function QW(t){return new tB(t)}function e7(t,e,n){let{selection:r}=e,o=null;if(Sx(r)&&(o=r.$cursor),o){var s;let i=(s=t.storedMarks)!==null&&s!==void 0?s:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(i)||!i.some(l=>l.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:i,$to:l})=>{let u=i.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(i.pos,l.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){let p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(c.marks)||!c.marks.some(g=>g.type.excludes(n));u=p&&h}return!u}),u})}var t7=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let{selection:s}=n,{empty:a,ranges:i}=s,l=_a(t,r.schema);if(o)if(a){let u=V2(r,l);n.addStoredMark(l.create({...u,...e}))}else i.forEach(u=>{let c=u.$from.pos,d=u.$to.pos;r.doc.nodesBetween(c,d,(f,p)=>{let h=Math.max(p,c),g=Math.min(p+f.nodeSize,d);f.marks.find(m=>m.type===l)?f.marks.forEach(m=>{l===m.type&&n.addMark(h,g,l.create({...m.attrs,...e}))}):n.addMark(h,g,l.create(e))})});return e7(r,n,l)},n7=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),r7=(t,e={})=>({state:n,dispatch:r,chain:o})=>{let s=tn(t,n.schema),a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:i})=>zd(s,{...a,...e})(n)?!0:i.clearNodes()).command(({state:i})=>zd(s,{...a,...e})(i,r)).run():(console.warn('[tiptap warn]: Currently \"setNode()\" only supports text block nodes.'),!1)},o7=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,o=Su(t,0,r.content.size),s=oe.create(r,o);e.setSelection(s)}return!0},s7=(t,e)=>({tr:n,state:r,dispatch:o})=>{let{selection:s}=r,a,i;return typeof e==\"number\"?(a=e,i=e):e&&\"from\"in e&&\"to\"in e?(a=e.from,i=e.to):(a=s.from,i=s.to),o&&n.doc.nodesBetween(a,i,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},a7=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:o,to:s}=typeof t==\"number\"?{from:t,to:t}:t,a=J.atStart(r).from,i=J.atEnd(r).to,l=Su(o,a,i),u=Su(s,a,i),c=J.create(r,l,u);e.setSelection(c)}return!0},i7=t=>({state:e,dispatch:n})=>{let r=tn(t,e.schema);return Xv(r)(e,n)};function R2(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}var l7=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{let{selection:s,doc:a}=e,{$from:i,$to:l}=s,u=o.extensionManager.attributes,c=vx(u,i.node().type.name,i.node().attrs);if(s instanceof oe&&s.node.isBlock)return!i.parentOffset||!In(a,i.pos)?!1:(r&&(t&&R2(n,o.extensionManager.splittableMarks),e.split(i.pos).scrollIntoView()),!0);if(!i.parent.isBlock)return!1;let d=l.parentOffset===l.parent.content.size,f=i.depth===0?void 0:U2(i.node(-1).contentMatchAt(i.indexAfter(-1))),p=d&&f?[{type:f,attrs:c}]:void 0,h=s instanceof J&&!s.empty?Cs.create({doc:e.doc,selection:s}).tr.deleteSelection():null,g=h?h.doc:e.doc,m=h?h.mapping.map(i.pos):i.pos,y=In(g,m,1,p);if(!p&&!y&&In(g,m,1,f?[{type:f}]:void 0)&&(y=!0,p=f?[{type:f,attrs:c}]:void 0),r){if(y){let b=e.steps.length;if(s instanceof J&&e.deleteSelection(),e.split(e.mapping.slice(b).map(i.pos),1,p),f&&!d&&!i.parentOffset&&i.parent.type!==f){let x=e.mapping.slice(b).map(i.before()),v=e.doc.resolve(x);i.node(-1).canReplaceWith(v.index(),v.index()+1,f)&&e.setNodeMarkup(e.mapping.slice(b).map(i.before()),f)}}t&&R2(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return y},u7=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{let a=tn(t,r.schema),{$from:i,$to:l}=r.selection,u=r.selection.node;if(u&&u.isBlock||i.depth<2||!i.sameParent(l))return!1;let c=i.node(-1);if(c.type!==a)return!1;let d=s.extensionManager.attributes;if(i.parent.content.size===0&&i.node(-1).childCount===i.indexAfter(-1)){if(i.depth===2||i.node(-3).type!==a||i.index(-2)!==i.node(-2).childCount-1)return!1;if(o){var f;let v=H.empty,S=i.index(-1)?1:i.index(-2)?2:3;for(let _=i.depth-S;_>=i.depth-3;_-=1)v=H.from(i.node(_).copy(v));let E=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3,w={...vx(d,i.node().type.name,i.node().attrs),...e},k=((f=a.contentMatch.defaultType)===null||f===void 0?void 0:f.createAndFill(w))||void 0;v=v.append(H.from(a.createAndFill(null,k)||void 0));let A=i.before(i.depth-(S-1));n.replace(A,i.after(-E),new G(v,4-S,0));let L=-1;n.doc.nodesBetween(A,n.doc.content.size,(_,P)=>{if(L>-1)return!1;_.isTextblock&&_.content.size===0&&(L=P+1)}),L>-1&&n.setSelection(J.near(n.doc.resolve(L))),n.scrollIntoView()}return!0}let p=l.pos===i.end()?c.contentMatchAt(0).defaultType:null,h={...vx(d,c.type.name,c.attrs),...e},g={...vx(d,i.node().type.name,i.node().attrs),...e},m=i.parentOffset===0&&i.index(-1)===0,y=i.before(-1);n.delete(i.pos,l.pos);let b=m?c.attrs:h,x=p?[{type:a,attrs:b},{type:p,attrs:g}]:[{type:a,attrs:b}];if(!In(n.doc,i.pos,2))return!1;if(o){let{selection:v,storedMarks:S}=r,{splittableMarks:E}=s.extensionManager,w=S||v.$to.parentOffset&&v.$from.marks();if(n.split(i.pos,2,x).scrollIntoView(),m&&n.setNodeMarkup(y,void 0,h),!w||!o)return!0;let k=w.filter(A=>E.includes(A.type.name));n.ensureMarks(k)}return!0};function I2(t){return!t||t===\"1\"?null:t}function rB(t,e){return I2(t)===I2(e)}var B1=(t,e)=>{let n=Cx(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let o=t.doc.nodeAt(r);return!(n.node.type===o?.type&&ir(t.doc,n.pos))||!rB(n.node.attrs.type,o?.attrs.type)||t.join(n.pos),!0},z1=(t,e)=>{let n=Cx(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let o=t.doc.nodeAt(r);return!(n.node.type===o?.type&&ir(t.doc,r))||!rB(n.node.attrs.type,o?.attrs.type)||t.join(r),!0};function c7(t){let e=t.doc,n=e.firstChild;if(!n)return null;let r=e.resolve(1),o=e.resolve(n.nodeSize-1);return J.between(r,o)}var d7=(t,e,n,r={})=>({editor:o,tr:s,state:a,dispatch:i,chain:l,commands:u,can:c})=>{let{extensions:d,splittableMarks:f}=o.extensionManager,p=tn(t,a.schema),h=tn(e,a.schema),{selection:g,storedMarks:m}=a,{$from:y,$to:b}=g,x=y.blockRange(b),v=m||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let S=Cx(D=>P1(D.type.name,d))(g),E=g.from===0&&g.to===a.doc.content.size,w=a.doc.content.content,k=w.length===1?w[0]:null,A=E&&k&&P1(k.type.name,d)?{node:k,pos:0,depth:0}:null,L=S??A,_=!!S&&x.depth>=1&&x.depth-S.depth<=1,P=!!A;if((_||P)&&L){if(L.node.type===p)return E&&P?l().command(({tr:D,dispatch:F})=>{let j=c7(D);return j?(D.setSelection(j),F&&F(D),!0):!1}).liftListItem(h).run():u.liftListItem(h);if(P1(L.node.type.name,d)&&p.validContent(L.node.content))return l().command(()=>(s.setNodeMarkup(L.pos,p),!0)).command(()=>B1(s,p)).command(()=>z1(s,p)).run()}return!n||!v||!i?l().command(()=>c().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>B1(s,p)).command(()=>z1(s,p)).run():l().command(()=>{let D=c().wrapInList(p,r),F=v.filter(j=>f.includes(j.type.name));return s.ensureMarks(F),D?!0:u.clearNodes()}).wrapInList(p,r).command(()=>B1(s,p)).command(()=>z1(s,p)).run()},f7=(t,e={},n={})=>({state:r,commands:o})=>{let{extendEmptyMarkRange:s=!1}=n,a=_a(t,r.schema);return U1(r,a,e)?o.unsetMark(a,{extendEmptyMarkRange:s}):o.setMark(a,e)},p7=(t,e,n={})=>({state:r,commands:o})=>{let s=tn(t,r.schema),a=tn(e,r.schema),i=Ts(r,s,n),l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),i?o.setNode(a,l):o.setNode(s,{...l,...n})},h7=(t,e={})=>({state:n,commands:r})=>{let o=tn(t,n.schema);return Ts(n,o,e)?r.lift(o):r.wrapIn(o,e)},m7=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r<n.length;r+=1){let o=n[r],s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){let a=t.tr,i=s.transform;for(let l=i.steps.length-1;l>=0;l-=1)a.step(i.steps[l].invert(i.docs[l]));if(s.text){let l=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else a.delete(s.from,s.to)}return!0}}return!1},g7=(t={})=>({tr:e,dispatch:n,editor:r})=>{let{ignoreClearable:o=!1}=t,{selection:s}=e,{empty:a,ranges:i}=s;if(a)return!0;let{nonClearableMarks:l}=r.extensionManager;if(n){let u=Object.values(r.schema.marks).filter(c=>o||!l.includes(c.name));i.forEach(c=>{for(let d of u)e.removeMark(c.$from.pos,c.$to.pos,d)})}return!0},y7=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,i=_a(t,r.schema),{$from:l,empty:u,ranges:c}=a;if(!o)return!0;if(u&&s){var d;let{from:f,to:p}=a,h=q1(l,i,(d=l.marks().find(g=>g.type===i))===null||d===void 0?void 0:d.attrs);h&&(f=h.from,p=h.to),n.removeMark(f,p,i)}else c.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,i)});return n.removeStoredMark(i),!0},b7=t=>({tr:e,state:n,dispatch:r})=>{let{selection:o}=n,s,a;return typeof t==\"number\"?(s=t,a=t):t&&\"from\"in t&&\"to\"in t?(s=t.from,a=t.to):(s=o.from,a=o.to),r&&e.doc.nodesBetween(s,a,(i,l)=>{if(i.isText)return;let u={...i.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},v7=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,a=null,i=kx(typeof t==\"string\"?t:t.name,r.schema);if(!i)return!1;i===\"node\"&&(s=tn(t,r.schema)),i===\"mark\"&&(a=_a(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{let c=u.$from.pos,d=u.$to.pos,f,p,h,g;n.selection.empty?r.doc.nodesBetween(c,d,(m,y)=>{s&&s===m.type&&(l=!0,h=Math.max(y,c),g=Math.min(y+m.nodeSize,d),f=y,p=m)}):r.doc.nodesBetween(c,d,(m,y)=>{y<c&&s&&s===m.type&&(l=!0,h=Math.max(y,c),g=Math.min(y+m.nodeSize,d),f=y,p=m),y>=c&&y<=d&&(s&&s===m.type&&(l=!0,o&&n.setNodeMarkup(y,void 0,{...m.attrs,...e})),a&&m.marks.length&&m.marks.forEach(b=>{if(a===b.type&&(l=!0,o)){let x=Math.max(y,c),v=Math.min(y+m.nodeSize,d);n.addMark(x,v,a.create({...b.attrs,...e}))}}))}),p&&(f!==void 0&&o&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),a&&p.marks.length&&p.marks.forEach(m=>{a===m.type&&o&&n.addMark(h,g,a.create({...m.attrs,...e}))}))}),l},Gd=new we(\"__tiptap_decorations__\"),x7=t=>({tr:e,dispatch:n})=>(n&&e.setMeta(Gd,{type:\"force\",name:t}),!0),w7=(t,e={})=>({state:n,dispatch:r})=>{let o=tn(t,n.schema);return Kv(o,e)(n,r)},S7=(t,e={})=>({state:n,dispatch:r})=>{let o=tn(t,n.schema);return Gv(o,e)(n,r)},k7=QN({blur:()=>XG,clearContent:()=>JG,clearNodes:()=>YG,command:()=>ZG,createParagraphNear:()=>QG,cut:()=>eW,deleteCurrentNode:()=>tW,deleteNode:()=>nW,deleteRange:()=>rW,deleteSelection:()=>aW,enter:()=>iW,exitCode:()=>lW,extendMarkRange:()=>uW,first:()=>cW,focus:()=>fW,forEach:()=>pW,insertContent:()=>hW,insertContentAt:()=>mW,insertDefaultBlock:()=>gW,joinBackward:()=>vW,joinDown:()=>bW,joinForward:()=>xW,joinItemBackward:()=>wW,joinItemForward:()=>SW,joinTextblockBackward:()=>kW,joinTextblockForward:()=>CW,joinUp:()=>yW,keyboardShortcut:()=>AW,lift:()=>EW,liftEmptyBlock:()=>TW,liftListItem:()=>RW,newlineInCode:()=>IW,resetAttributes:()=>MW,scrollIntoView:()=>_W,selectAll:()=>OW,selectNodeBackward:()=>DW,selectNodeForward:()=>NW,selectParentNode:()=>PW,selectTextblockEnd:()=>BW,selectTextblockStart:()=>zW,setContent:()=>FW,setMark:()=>t7,setMeta:()=>n7,setNode:()=>r7,setNodeSelection:()=>o7,setTextDirection:()=>s7,setTextSelection:()=>a7,sinkListItem:()=>i7,splitBlock:()=>l7,splitListItem:()=>u7,toggleList:()=>d7,toggleMark:()=>f7,toggleNode:()=>p7,toggleWrap:()=>h7,undoInputRule:()=>m7,unsetAllMarks:()=>g7,unsetMark:()=>y7,unsetTextDirection:()=>b7,updateAttributes:()=>v7,updateDecorations:()=>x7,wrapIn:()=>w7,wrapInList:()=>S7}),Wd=new WeakMap;function C7(t,e){var n;Wd.set(t,((n=Wd.get(t))!==null&&n!==void 0?n:0)+1);try{return e()}finally{var r;let o=((r=Wd.get(t))!==null&&r!==void 0?r:1)-1;o>0?Wd.set(t,o):Wd.delete(t)}}function L7(t){return Wd.has(t)}var A7=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){let n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){let n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){let n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},oB=typeof process<\"u\"&&!1;function E7(t){return t.kind===\"widget\"}function sB(t,e){let n=[],r=new Set;for(let o of t)o.kind===\"widget\"&&E7(o)&&r.add(o.key),n.push(o.toPMDecoration(e));return{decorations:n,widgetKeys:r}}function T7(t,e,n){let{decorations:r,widgetKeys:o}=sB(e,n);return{set:He.create(t,r),widgetKeys:o}}function aB({position:t,from:e,to:n,docSize:r}){return t<e?!1:t<n?!0:t===n&&n===r}function R7({decorations:t,from:e,to:n,docSize:r,extensionName:o,warnedExtensions:s}){return t.filter(a=>aB({position:a.anchor,from:e,to:n,docSize:r})?!0:(a.anchor===n||s.has(o)||(s.add(o),console.warn(`[tiptap warn]: Extension \"${o}\" returned a decoration outside the requested range [${e}, ${n}). It was ignored.`)),!1))}function iB(t){var e;let n=(e=t.spec)===null||e===void 0?void 0:e.key;return typeof n==\"string\"?n:void 0}function I7(t){let e=new Map,n=new Map;for(let a of t.find()){var r,o,s;let i=iB(a);if(!i)continue;let l=(r=a.spec.extensionName)!==null&&r!==void 0?r:\"unknown\",u=(o=e.get(i))!==null&&o!==void 0?o:new Set;u.add(l),e.set(i,u),n.set(i,((s=n.get(i))!==null&&s!==void 0?s:0)+1)}return Array.from(e,([a,i])=>({key:a,extensions:i})).filter(({key:a})=>{var i;return((i=n.get(a))!==null&&i!==void 0?i:0)>1})}function lB(t){return t.jsonID===\"attr\"}function M7(t){let e=!1;if(t.getMap().forEach(()=>{e=!0}),e||lB(t))return!0;let n=t;return typeof n.from==\"number\"&&typeof n.to==\"number\"}function _7(t,e){let n=null,r=0,o=0;for(let s=0;s<t.childCount&&!(o>e.to);s+=1){let a=o+t.child(s).nodeSize;a>=e.from&&(n===null&&(n=o),r=a),o=a}return n===null?null:{from:n,to:r}}function O7(t,e){if(t.steps.some(s=>!M7(s)))return{type:\"full\"};let n=Lx(t).map(({newRange:s})=>s);t.steps.forEach((s,a)=>{if(!lB(s))return;let i=t.mapping.slice(a);n.push({from:i.map(s.pos,-1),to:i.map(s.pos+1)})});let r=[];for(let s of n){let a=_7(e,s);a&&r.push(a)}r.sort((s,a)=>s.from-a.from);let o=[];for(let s of r){let a=o[o.length-1];a&&s.from<=a.to?a.to=Math.max(a.to,s.to):o.push({...s})}return{type:\"ranges\",ranges:o}}function uB(t,e,n,r){return t.map(e,n,{onRemove:o=>{let s=o?.key;typeof s==\"string\"&&r.delete(s)}})}function D7(t,e,n){var r,o;let s=(r=e.decorationSetsByExtension[t])!==null&&r!==void 0?r:He.empty,a=new Set((o=e.widgetKeysByExtension[t])!==null&&o!==void 0?o:[]);return{set:uB(s,n.mapping,n.doc,a),widgetKeys:a}}function M2(t,e){let n=Object.values(e).flatMap(r=>r.find());return He.create(t,n)}function _2(t){let e=new Set;for(let n of Object.values(t))for(let r of n)e.add(r);return e}function N7(t,e){var n;switch((n=e.update)!==null&&n!==void 0?n:\"document\"){case\"document\":if(e.createInRange)throw new Error(`[tiptap error]: Extension \"${t}\" provides createInRange() but does not use the \"changedRanges\" decoration update strategy.`);return;case\"changedRanges\":if(!e.createInRange)throw new Error(`[tiptap error]: Extension \"${t}\" uses the \"changedRanges\" decoration update strategy but does not provide createInRange().`);return;case\"manual\":if(e.createInRange)throw new Error(`[tiptap error]: Extension \"${t}\" uses the \"manual\" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the \"changedRanges\" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension \"${t}\" cannot combine the \"manual\" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension \"${t}\" uses an unknown decoration update strategy. Expected \"document\", \"changedRanges\", or \"manual\".`)}}function P7(t,e,n){return n?!0:t.update===\"manual\"?!1:t.shouldUpdate?t.shouldUpdate(e):e.tr.docChanged}var B7=new Set;var z7=class{constructor(t){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let n=Gd.getState(e);n&&this.warnDuplicateWidgetKeys(n)},this.editor=t.editor,this.entries=this.resolveEntries(t.entries),this.entries.forEach(({name:e,spec:n})=>N7(e,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(\"beforeTransaction\",this.handleBeforeTransaction)}destroy(){this.editor.off(\"beforeTransaction\",this.handleBeforeTransaction)}liveWidgetKeys(){var t,e;return(t=(e=Gd.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&t!==void 0?t:B7}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(t){let e=[];for(let{name:n,addDecorations:r}of t){let o=r();o&&e.push({name:n,spec:o})}return e}createPlugin(){let{editor:t,entries:e}=this;return new ie({key:Gd,state:{init:(n,r)=>{let o={},s={};for(let{name:i,spec:l}of e){let{set:u,widgetKeys:c}=this.buildFullSet(i,l,r);o[i]=u,s[i]=c}let a={decorationSetsByExtension:o,widgetKeysByExtension:s,mergedDecorationSet:this.buildMergedSet(r.doc,o),widgetKeys:_2(s)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,o,s)=>{let a=n.getMeta(Gd),i=a?.type===\"force\"&&!a.name,l=a?.type===\"force\"?a.name:void 0,u={},c={},d=new Set;return C7(t,()=>{for(let{name:f,spec:p}of e){let h=i||l===f;if(P7(p,{editor:t,tr:n,oldState:o,newState:s},h))if(p.update===\"changedRanges\"&&n.docChanged&&!h){let g=this.applyChangedRangesRecompute(f,p,r,n,s);u[f]=g.set,c[f]=g.widgetKeys,d.add(f)}else{let{set:g,widgetKeys:m}=this.buildFullSet(f,p,s);u[f]=g,c[f]=m,d.add(f)}else{let g=D7(f,r,n);u[f]=g.set,c[f]=g.widgetKeys}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:u,widgetKeysByExtension:c,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:r,tr:n,decorationSetsByExtension:u,recomputedNames:d}),widgetKeys:_2(c)}}},props:{decorations(n){var r,o;return(r=(o=Gd.getState(n))===null||o===void 0?void 0:o.mergedDecorationSet)!==null&&r!==void 0?r:He.empty}}})}applyChangedRangesRecompute(t,e,n,r,o){let s=O7(r,o.doc);return s.type===\"full\"?this.buildFullSet(t,e,o):this.rebuildRanges(t,e,n,r,o,s.ranges)}rebuildRanges(t,e,n,r,o,s){var a,i;let l=(a=n.decorationSetsByExtension[t])!==null&&a!==void 0?a:He.empty,u=new Set((i=n.widgetKeysByExtension[t])!==null&&i!==void 0?i:[]),c=uB(l,r.mapping,r.doc,u),d=o.doc.content.size;for(let{from:f,to:p}of s){let h=c.find(f,p).filter(y=>aB({position:y.from,from:f,to:p,docSize:d}));for(let y of h){let b=iB(y);b&&u.delete(b)}c=c.remove(h);let{decorations:g,widgetKeys:m}=sB(R7({decorations:this.runCreate(t,\"createInRange\",()=>e.createInRange({editor:this.editor,state:o,view:this.mountedView,from:f,to:p})),from:f,to:p,docSize:d,extensionName:t,warnedExtensions:this.warnedOutOfRangeExtensions}),t);c=c.add(o.doc,g);for(let y of m)u.add(y)}return{set:c,widgetKeys:u}}buildFullSet(t,e,n){let r=this.runCreate(t,\"create\",()=>e.create({editor:this.editor,state:n,view:this.mountedView}));return T7(n.doc,r,t)}runCreate(t,e,n){try{return n()}catch(r){return console.error(`[tiptap error]: Extension \"${t}\" threw in \\`addDecorations().${e}()\\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(t){if(!oB)return;if(t.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let e=I7(t.mergedDecorationSet),n=new Set(e.map(({key:r})=>r));for(let{key:r,extensions:o}of e){if(this.warnedWidgetKeys.has(r))continue;let s=Array.from(o).map(a=>`\"${a}\"`).join(\", \");console.warn(`[tiptap warn]: Duplicate widget decoration key \"${r}\" in extension${o.size===1?\"\":\"s\"} ${s}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \\`comment-\\${id}\\`).`)}this.warnedWidgetKeys=n}buildMergedSet(t,e){let n=Object.keys(e);return n.length===1?e[n[0]]:M2(t,e)}mergeAfterApply({entries:t,previous:e,tr:n,decorationSetsByExtension:r,recomputedNames:o}){return t.length===1?r[t[0].name]:o.size===0?e.mergedDecorationSet.map(n.mapping,n.doc):M2(n.doc,r)}};function F7(t,e,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:\"\"}]`);if(r!==null)return r;let o=document.createElement(\"style\");return e&&o.setAttribute(\"nonce\",e),o.setAttribute(`data-tiptap-style${n?`-${n}`:\"\"}`,\"\"),o.innerHTML=t,document.getElementsByTagName(\"head\")[0].appendChild(o),o}function cB(t){return t.replace(/[-/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")}function H7(t){return typeof t==\"number\"}function $7(t){return Object.prototype.toString.call(t).slice(8,-1)}function yx(t){return $7(t)!==\"Object\"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function J1(t,e,n){let r=t.split(`\n`),o=[],s=\"\",a=0,i=e.baseIndentSize||2;for(;a<r.length;){let c=r[a],d=c.match(e.itemPattern);if(!d){if(o.length>0)break;if(c.trim()===\"\"){a+=1,s=`${s}${c}\n`;continue}else return}let f=e.extractItemData(d),{indentLevel:p,mainContent:h}=f;s=`${s}${c}\n`;let g=[h];for(a+=1;a<r.length;){var l;let x=r[a];if(x.trim()===\"\"){var u;let v=r.slice(a+1).findIndex(S=>S.trim()!==\"\");if(v===-1)break;if((((u=r[a+1+v].match(/^(\\s*)/))===null||u===void 0||(u=u[1])===null||u===void 0?void 0:u.length)||0)>p){g.push(x),s=`${s}${x}\n`,a+=1;continue}else break}if((((l=x.match(/^(\\s*)/))===null||l===void 0||(l=l[1])===null||l===void 0?void 0:l.length)||0)>p)g.push(x),s=`${s}${x}\n`,a+=1;else break}let m,y=g.slice(1);if(y.length>0){let x=y.map(v=>v.slice(p+i)).join(`\n`);x.trim()&&(e.customNestedParser?m=e.customNestedParser(x):m=n.blockTokens(x))}let b=e.createToken(f,m);o.push(b)}if(o.length!==0)return{items:o,raw:s}}var O2=4;function D2(t){let e=0;for(let n of t)e=n===\"\t\"?e+O2-e%O2:e+1;return e}function Y1(t,e,n,r,o){if(!t||!Array.isArray(t.content))return\"\";let s=typeof n==\"function\"?n(r):n,[a,...i]=t.content,l=`${s}${e.renderChildren([a])}`;return i&&i.length>0&&i.forEach((u,c)=>{var d,f;let p=(d=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,u,c+1))!==null&&d!==void 0?d:e.renderChildren([u]);if(p!=null){let h=m=>{if(!o?.alignNestedToPrefix)return e.indent(m);let y=e.indent(\"\"),b=D2(s);return(D2(y)>=b?y:\" \".repeat(b))+m},g=p.split(`\n`).map(m=>h(m||\"\")).join(`\n`);l+=u.type===\"paragraph\"?`\n\n${g}`:`\n${g}`}}),l}function dB(t,e){let n={...t};return yx(t)&&yx(e)&&Object.keys(e).forEach(r=>{yx(e[r])&&yx(t[r])?n[r]=dB(t[r],e[r]):n[r]=e[r]}),n}function U7(t,e,n={}){let{state:r}=e,{doc:o,tr:s}=r,a=t;o.descendants((i,l)=>{let u=s.mapping.map(l),c=s.mapping.map(l)+i.nodeSize,d=null;if(i.marks.forEach(p=>{if(p!==a)return!1;d=p}),!d)return;let f=!1;if(Object.keys(n).forEach(p=>{n[p]!==d.attrs[p]&&(f=!0)}),f){let p=t.type.create({...t.attrs,...n});s.removeMark(u,c,t.type),s.addMark(u,c,p)}}),s.docChanged&&e.view.dispatch(s)}var Km=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}},j7=(t,e)=>{if(j1(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: \"inputRuleMatch.replaceWith\" must be part of \"inputRuleMatch.text\".'),r.push(n.replaceWith)),r};function q7(t){let{editor:e,from:n,to:r,text:o,insertText:s}=t;if(!s)return{inputTransaction:null,tr:e.view.state.tr};let a=e.view.state.tr.insertText(o,n,r);return{inputTransaction:a,tr:Cs.create({doc:a.doc,selection:a.selection,storedMarks:a.storedMarks}).tr}}function V7(t){let{editor:e,from:n,to:r,text:o,rule:s,match:a,plugin:i,insertText:l}=t,{view:u}=e,{inputTransaction:c,tr:d}=q7({editor:e,from:n,to:r,text:o,insertText:l}),f=c?n+o.length:r,p=wx({state:u.state,transaction:d}),h={from:n-(a[0].length-o.length),to:f},{commands:g,chain:m,can:y}=new Xd({editor:e,state:p});return s.handler({state:p,range:h,match:a,commands:g,chain:m,can:y})===null||!d.steps.length?!1:(c&&(u.dispatch(c),!u.state.doc.eq(c.doc))||(px(d),d.setMeta(\"inputRule\",!0),s.undoable&&d.setMeta(i,{transform:d,from:n,to:f,text:o}),u.dispatch(d)),!0)}function K7(t,e,n){let r=e[0].length-n.length;if(r<=0)return!0;let o=t.parentOffset-r;return o>=0&&t.parent.textBetween(o,t.parentOffset)===e[0].slice(0,r)}function bx(t){var e;let{editor:n,from:r,to:o,text:s,rules:a,plugin:i,insertText:l}=t,{view:u}=n;if(u.composing)return!1;let c=u.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=JW(c)+s;for(let f of a){let p=j7(d,f.find);if(!(!p||!K7(c,p,s))&&V7({editor:n,from:r,to:o,text:s,rule:f,match:p,plugin:i,insertText:l}))return!0}return!1}function G7(t){let{editor:e,rules:n}=t,r=new ie({state:{init(){return null},apply(o,s,a){let i=o.getMeta(r);if(i)return i;let l=o.getMeta(\"applyInputRules\");return l&&setTimeout(()=>{let{text:u}=l;typeof u==\"string\"?u=u:u=G1(H.from(u),a.schema);let{from:c}=l,d=c+u.length;bx({editor:e,from:c,to:d,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,a,i){return bx({editor:e,from:s,to:a,text:i,rules:n,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{let{$cursor:s}=o.state.selection;s&&bx({editor:e,from:s.pos,to:s.pos,text:\"\",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!==\"Enter\")return!1;let{$cursor:a}=o.state.selection;return a?bx({editor:e,from:a.pos,to:a.pos,text:`\n`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Z1=class{constructor(t={}){this.type=\"extendable\",this.parent=null,this.child=null,this.name=\"\",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...ut(le(this,\"addOptions\",{name:this.name}))}}get storage(){return{...ut(le(this,\"addStorage\",{name:this.name,options:this.options}))}}configure(t={}){let e=this.extend({...this.config,addOptions:()=>dB(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){let e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name=\"name\"in t?t.name:e.parent.name,e}},Cu=class fB extends Z1{constructor(...e){super(...e),this.type=\"mark\"}static create(e={}){let n=typeof e==\"function\"?e():e;return new fB(n)}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){let s=o.marks();if(!s.find(i=>i?.type.name===n.name))return!1;let a=s.find(i=>i?.type.name===n.name);return a&&r.removeStoredMark(a),r.insertText(\" \",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){let n=typeof e==\"function\"?e():e;return super.extend(n)}},Q1=class{constructor(t){this.find=t.find,this.handler=t.handler}},W7=(t,e,n)=>{if(j1(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(o=>{let s=[o.text];return s.index=o.index,s.input=t,s.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: \"pasteRuleMatch.replaceWith\" must be part of \"pasteRuleMatch.text\".'),s.push(o.replaceWith)),s}):[]};function X7(t){let{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:a,dropEvent:i}=t,{commands:l,chain:u,can:c}=new Xd({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(f,p)=>{var h,g,m,y;if(!((h=f.type)===null||h===void 0||(h=h.spec)===null||h===void 0)&&h.code||!(f.isText||f.isTextblock||f.isInline))return;let b=(g=(m=(y=f.content)===null||y===void 0?void 0:y.size)!==null&&m!==void 0?m:f.nodeSize)!==null&&g!==void 0?g:0,x=Math.max(r,p),v=Math.min(o,p+b);if(x>=v)return;let S=f.isText?f.text||\"\":f.textBetween(x-p,v-p,void 0,\"\\uFFFC\");W7(S,s.find,a).forEach(E=>{if(E.index===void 0)return;let w=x+E.index+1,k=w+E[0].length,A={from:n.tr.mapping.map(w),to:n.tr.mapping.map(k)},L=s.handler({state:n,range:A,match:E,commands:l,chain:u,can:c,pasteEvent:a,dropEvent:i});d.push(L)})}),d.every(f=>f!==null)}var Kd=null,J7=t=>{var e;let n=new ClipboardEvent(\"paste\",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData(\"text/html\",t),n};function Y7(t){let{editor:e,rules:n}=t,r=null,o=!1,s=!1,a=typeof ClipboardEvent<\"u\"?new ClipboardEvent(\"paste\"):null,i;try{i=typeof DragEvent<\"u\"?new DragEvent(\"drop\"):null}catch{i=null}let l=({state:u,from:c,to:d,rule:f,pasteEvt:p})=>{let h=u.tr,g=wx({state:u,transaction:h});if(!(!X7({editor:e,state:g,from:Math.max(c-1,0),to:d.b-1,rule:f,pasteEvent:p,dropEvent:i})||!h.steps.length)){try{i=typeof DragEvent<\"u\"?new DragEvent(\"drop\"):null}catch{i=null}return a=typeof ClipboardEvent<\"u\"?new ClipboardEvent(\"paste\"):null,h}};return e.on(\"destroy\",()=>{Kd===e&&(Kd=null)}),n.map(u=>new ie({view(c){let d=p=>{var h;r=!((h=c.dom.parentElement)===null||h===void 0)&&h.contains(p.target)?c.dom.parentElement:null,r&&(Kd=e)},f=()=>{Kd&&(Kd=null)};return window.addEventListener(\"dragstart\",d),window.addEventListener(\"dragend\",f),{destroy(){window.removeEventListener(\"dragstart\",d),window.removeEventListener(\"dragend\",f)}}},props:{handleDOMEvents:{drop:(c,d)=>{if(s=r===c.dom.parentElement,i=d,!s){let f=Kd;f?.isEditable&&setTimeout(()=>{if(f.isDestroyed)return;let p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(c,d)=>{var f;let p=(f=d.clipboardData)===null||f===void 0?void 0:f.getData(\"text/html\");return a=d,o=!!p?.includes(\"data-pm-slice\"),!1}}},appendTransaction:(c,d,f)=>{let p=c[0],h=p.getMeta(\"uiEvent\")===\"paste\"&&!o,g=p.getMeta(\"uiEvent\")===\"drop\"&&!s,m=p.getMeta(\"applyPasteRules\"),y=!!m;if(!h&&!g&&!y)return;if(y){let{text:v}=m;typeof v==\"string\"?v=v:v=G1(H.from(v),f.schema);let{from:S}=m,E=S+v.length,w=J7(v);return l({rule:u,state:f,from:S,to:{b:E},pasteEvt:w})}let b=d.doc.content.findDiffStart(f.doc.content),x=d.doc.content.findDiffEnd(f.doc.content);if(!(!H7(b)||!x||b===x.b))return l({rule:u,state:f,from:b,to:x,pasteEvt:a})}}))}var Ax=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=t,this.extensions=W2(t),this.schema=qW(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{let n=le(e,\"addCommands\",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Vd(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){let{editor:t}=this,e=jm([...this.extensions].reverse()).flatMap(r=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Vd(r.name,this.schema)},s=[],a=le(r,\"addKeyboardShortcuts\",o),i={};if(r.type===\"mark\"&&le(r,\"exitable\",o)&&(i.ArrowRight=()=>Cu.handleExit({editor:t,mark:r})),a){let f=Object.fromEntries(Object.entries(a()).map(([p,h])=>[p,()=>h({editor:t})]));i={...i,...f}}let l=cx(i);s.push(l);let u=le(r,\"addInputRules\",o);if(T2(r,t.options.enableInputRules)&&u){let f=u();if(f&&f.length){let p=G7({editor:t,rules:f}),h=Array.isArray(p)?p:[p];s.push(...h)}}let c=le(r,\"addPasteRules\",o);if(T2(r,t.options.enablePasteRules)&&c){let f=c();if(f&&f.length){let p=Y7({editor:t,rules:f});s.push(...p)}}let d=le(r,\"addProseMirrorPlugins\",o);if(d){let f=d();s.push(...f)}return s}),n=this.createDecorationPlugin();return n&&e.push(n),e}createDecorationPlugin(){var t;let{editor:e}=this;(t=this.decorationManager)===null||t===void 0||t.destroy();let n=[];return this.extensions.forEach(r=>{let o=le(r,\"addDecorations\",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Vd(r.name,this.schema)});o&&n.push({name:r.name,addDecorations:o})}),this.decorationManager=new z7({editor:e,entries:n}),this.decorationManager.plugin}get attributes(){return G2(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:e}=Yd(this.extensions);return Object.fromEntries(e.filter(n=>!!le(n,\"addNodeView\")).map(n=>{let r=this.attributes.filter(i=>i.type===n.name),o=le(n,\"addNodeView\",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:tn(n.name,this.schema)});if(!o)return[];let s=o();if(!s)return[];let a=(i,l,u,c,d)=>{let f=Ui(i,r);return s({node:i,view:l,getPos:u,decorations:c,innerDecorations:d,editor:t,extension:n,HTMLAttributes:f})};return[n.name,a]}))}dispatchTransaction(t){let{editor:e}=this;return jm([...this.extensions].reverse()).reduceRight((n,r)=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Vd(r.name,this.schema)},s=le(r,\"dispatchTransaction\",o);return s?a=>{s.call(o,{transaction:a,next:n})}:n},t)}transformPastedHTML(t){let{editor:e}=this;return jm([...this.extensions]).reduce((n,r)=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Vd(r.name,this.schema)},s=le(r,\"transformPastedHTML\",o);return s?(a,i)=>{let l=n(a,i);return s.call(o,l)}:n},t||(n=>n))}get markViews(){let{editor:t}=this,{markExtensions:e}=Yd(this.extensions);return Object.fromEntries(e.filter(n=>!!le(n,\"addMarkView\")).map(n=>{let r=this.attributes.filter(a=>a.type===n.name),o=le(n,\"addMarkView\",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:_a(n.name,this.schema)});if(!o)return[];let s=(a,i,l)=>{let u=Ui(a,r);return o()({mark:a,view:i,inline:l,editor:t,extension:n,HTMLAttributes:u,updateAttributes:c=>{U7(a,t,c)}})};return[n.name,s]}))}destroy(){var t;(t=this.decorationManager)===null||t===void 0||t.destroy(),this.extensions.forEach(e=>{let n=e;for(;n.parent;){let r=n.parent;r.child===n&&(r.child=null),n=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Vd(e.name,this.schema)};if(e.type===\"mark\"){var r,o;(!((r=ut(le(e,\"keepOnSplit\",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name),!((o=ut(le(e,\"clearable\",n)))!==null&&o!==void 0)||o||this.nonClearableMarks.push(e.name)}let s=le(e,\"onBeforeCreate\",n),a=le(e,\"onCreate\",n),i=le(e,\"onUpdate\",n),l=le(e,\"onSelectionUpdate\",n),u=le(e,\"onTransaction\",n),c=le(e,\"onFocus\",n),d=le(e,\"onBlur\",n),f=le(e,\"onDestroy\",n);s&&this.editor.on(\"beforeCreate\",s),a&&this.editor.on(\"create\",a),i&&this.editor.on(\"update\",i),l&&this.editor.on(\"selectionUpdate\",l),u&&this.editor.on(\"transaction\",u),c&&this.editor.on(\"focus\",c),d&&this.editor.on(\"blur\",d),f&&this.editor.on(\"destroy\",f)})}};Ax.resolve=W2;Ax.sort=jm;Ax.flatten=K1;var bn=class pB extends Z1{constructor(...e){super(...e),this.type=\"extension\"}static create(e={}){let n=typeof e==\"function\"?e():e;return new pB(n)}configure(e){return super.configure(e)}extend(e){let n=typeof e==\"function\"?e():e;return super.extend(n)}},Z7=bn.create({name:\"clipboardTextSerializer\",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ie({key:new we(\"clipboardTextSerializer\"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,s=J2(n),{blockSeparator:a}=this.options,i={...a!==void 0?{blockSeparator:a}:{},textSerializers:s};return[...o.ranges].sort((l,u)=>l.$from.pos-u.$from.pos).map(({$from:l,$to:u})=>X2(r,{from:l.pos,to:u.pos},i)).join(a??`\n\n`)}}})]}}),Q7=bn.create({name:\"commands\",addCommands(){return{...k7}}}),eX=bn.create({name:\"delete\",onUpdate({transaction:t,appendedTransactions:e}){var n,r;let o=()=>{var s,a,i;if((s=(a=this.editor.options.coreExtensionOptions)===null||a===void 0||(a=a.delete)===null||a===void 0||(i=a.filterTransaction)===null||i===void 0?void 0:i.call(a,t))!==null&&s!==void 0?s:t.getMeta(\"y-sync$\"))return;let l=V1(t.before,[t,...e]);Lx(l).forEach(c=>{l.mapping.mapResult(c.oldRange.from).deletedAfter&&l.mapping.mapResult(c.oldRange.to).deletedBefore&&l.before.nodesBetween(c.oldRange.from,c.oldRange.to,(d,f)=>{let p=f+d.nodeSize-2,h=c.oldRange.from<=f&&p<=c.oldRange.to;this.editor.emit(\"delete\",{type:\"node\",node:d,from:f,to:p,newFrom:l.mapping.map(f),newTo:l.mapping.map(p),deletedRange:c.oldRange,newRange:c.newRange,partial:!h,editor:this.editor,transaction:t,combinedTransform:l})})});let u=l.mapping;l.steps.forEach((c,d)=>{if(c instanceof Xo){var f,p;let h=u.slice(d).map(c.from,-1),g=u.slice(d).map(c.to),m=u.invert().map(h,-1),y=u.invert().map(g),b=h>0?(f=l.doc.nodeAt(h-1))===null||f===void 0?void 0:f.marks.some(v=>v.eq(c.mark)):!1,x=(p=l.doc.nodeAt(g))===null||p===void 0?void 0:p.marks.some(v=>v.eq(c.mark));this.editor.emit(\"delete\",{type:\"mark\",mark:c.mark,from:c.from,to:c.to,deletedRange:{from:m,to:y},newRange:{from:h,to:g},partial:!!(x||b),editor:this.editor,transaction:t,combinedTransform:l})}})};!((n=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&n!==void 0)||n?setTimeout(o,0):o()}}),tX=bn.create({name:\"drop\",addProseMirrorPlugins(){return[new ie({key:new we(\"tiptapDrop\"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit(\"drop\",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),nX=bn.create({name:\"editable\",addProseMirrorPlugins(){return[new ie({key:new we(\"editable\"),props:{editable:()=>this.editor.options.editable}})]}}),rX=new we(\"focusEvents\"),oX=bn.create({name:\"focusEvents\",addProseMirrorPlugins(){let{editor:t}=this;return[new ie({key:rX,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta(\"focus\",{event:n}).setMeta(\"addToHistory\",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta(\"blur\",{event:n}).setMeta(\"addToHistory\",!1);return e.dispatch(r),!1}}}})]}}),sX=bn.create({name:\"keymap\",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:i})=>{let{selection:l,doc:u}=i,{empty:c,$anchor:d}=l,{pos:f,parent:p}=d,h=d.parent.isTextblock&&f>0?i.doc.resolve(f-1):d,g=h.parent.type.spec.isolating,m=d.pos-d.parentOffset,y=g&&h.parent.childCount===1?m===d.pos:pe.atStart(u).from===f;return!c||!p.type.isTextblock||p.textContent.length||!y||y&&d.parent.type.name===\"paragraph\"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),\"Mod-Enter\":()=>this.editor.commands.exitCode(),Backspace:t,\"Mod-Backspace\":t,\"Shift-Backspace\":t,Delete:e,\"Mod-Delete\":e,\"Mod-a\":()=>this.editor.commands.selectAll()},o={...r},s={...r,\"Ctrl-h\":t,\"Alt-Backspace\":t,\"Ctrl-d\":e,\"Ctrl-Alt-Backspace\":e,\"Alt-Delete\":e,\"Alt-d\":e,\"Ctrl-a\":()=>this.editor.commands.selectTextblockStart(),\"Ctrl-e\":()=>this.editor.commands.selectTextblockEnd()};return ku()||q2()?s:o},addProseMirrorPlugins(){return[new ie({key:new we(\"clearDocument\"),appendTransaction:(t,e,n)=>{if(t.some(p=>p.getMeta(\"composition\")))return;let r=t.some(p=>p.docChanged)&&!e.doc.eq(n.doc),o=t.some(p=>p.getMeta(\"preventClearDocument\"));if(!r||o)return;let{empty:s,from:a,to:i}=e.selection,l=pe.atStart(e.doc).from,u=pe.atEnd(e.doc).to;if(s||!(a===l&&i===u)||!X1(n.doc))return;let c=n.tr,d=wx({state:n,transaction:c}),{commands:f}=new Xd({editor:this.editor,state:d});if(f.clearNodes(),!!c.steps.length)return c}})]}}),aX=bn.create({name:\"paste\",addProseMirrorPlugins(){return[new ie({key:new we(\"tiptapPaste\"),props:{handlePaste:(t,e,n)=>{this.editor.emit(\"paste\",{editor:this.editor,event:e,slice:n})}}})]}}),iX=bn.create({name:\"tabindex\",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new ie({key:new we(\"tabindex\"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!==null&&t!==void 0?t:\"0\"}}}})]}}),lX=bn.create({name:\"textDirection\",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:t}=Yd(this.extensions);return[{types:t.filter(e=>e.name!==\"text\").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let n=e.getAttribute(\"dir\");return n&&(n===\"ltr\"||n===\"rtl\"||n===\"auto\")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new ie({key:new we(\"textDirection\"),props:{attributes:()=>{let t=this.options.direction;return t?{dir:t}:{}}}})]}});var N2=!1;function uX(t){if(N2)return;N2=!0;let e;try{e=Rt.fromJSON(t,{from:0,to:0}).slice.content}catch{return}e instanceof H||console.warn(\"[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.\")}var cX=class Um{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Um(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Um(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Um(e,this.editor)}get children(){let e=[];return this.node.content.forEach((n,r)=>{let o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=n.isInline,i=this.pos+r+(s?0:1);if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;let l=this.resolvedPos.doc.resolve(i);if(!o&&!a&&l.depth<=this.depth)return;let u=new Um(l,this.editor,o,o||a?n:null);o&&(u.actualDepth=this.depth+1),e.push(u)}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){let s=o.node.attrs,a=Object.keys(n);for(let i=0;i<a.length;i+=1){let l=a[i];if(s[l]!==n[l])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;let s=Object.keys(n);return this.children.forEach(a=>{r&&o.length>0||(a.node.type.name===e&&s.every(i=>n[i]===a.node.attrs[i])&&o.push(a),!(r&&o.length>0)&&(o=o.concat(a.querySelectorAll(e,n,r))))}),o}setAttribute(e){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},dX=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}`,hB=class extends A7{constructor(t={}){super(),this.css=null,this.className=\"tiptap\",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<\"u\"?document.createElement(\"div\"):null,content:\"\",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:ZW,createMappablePosition:QW},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(\"beforeCreate\",this.options.onBeforeCreate),this.emit(\"beforeCreate\",{editor:this}),this.on(\"mount\",this.options.onMount),this.on(\"unmount\",this.options.onUnmount),this.on(\"contentError\",this.options.onContentError),this.on(\"create\",this.options.onCreate),this.on(\"update\",this.options.onUpdate),this.on(\"selectionUpdate\",this.options.onSelectionUpdate),this.on(\"transaction\",this.options.onTransaction),this.on(\"focus\",this.options.onFocus),this.on(\"blur\",this.options.onBlur),this.on(\"destroy\",this.options.onDestroy),this.on(\"drop\",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on(\"paste\",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on(\"delete\",this.options.onDelete);let e=this.createDoc();if(!this.editorState){let n=F1(e,this.options.autofocus);this.editorState=Cs.create({doc:e,schema:this.schema,selection:n||void 0})}uX(this.schema),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>\"u\")throw new Error(\"[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.\");this.createView(t),this.emit(\"mount\",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(\"create\",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==\"function\"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn(\"Failed to remove CSS element:\",t)}this.css=null,this.emit(\"unmount\",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Xd.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Xd.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<\"u\"&&(this.css=F7(dX,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit(\"update\",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e===\"state\")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return oB&&!this.hasWarnedStaleDecorationRead&&L7(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn(\"[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.\")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){let n=$1(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;let e=this.state.plugins,n=e;if([].concat(t).forEach(o=>{let s=typeof o==\"string\"?`${o}$`:o.key;n=n.filter(a=>!a.key.startsWith(s))}),e.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;let n=[...this.options.enableCoreExtensions?[nX,Z7.configure({blockSeparator:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),Q7,oX,sX,iX.configure({value:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.tabindex)===null||e===void 0?void 0:e.value}),tX,aX,eX,lX.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions==\"object\"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>[\"extension\",\"node\",\"mark\"].includes(r?.type));this.extensionManager=new Ax(n,this)}createCommandManager(){this.commandManager=new Xd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=H1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![\"[tiptap error]: Invalid JSON content\",\"[tiptap error]: Invalid HTML content\"].includes(e.message))throw e;let n=H1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Cs.create({doc:n,schema:this.schema,selection:F1(n,this.options.autofocus)||void 0}),this.emit(\"contentError\",{editor:this,error:e,disableCollaboration:()=>{\"collaboration\"in this.storage&&typeof this.storage.collaboration==\"object\"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!==\"collaboration\"),this.createExtensionManager()}}),this.editorState.doc}return t}getEditorViewAttributes(){var t;let e=(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes;return $1(e)?n=>({role:\"textbox\",...e(n)}):{role:\"textbox\",...e}}createView(t){let{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,a=this.extensionManager.transformPastedHTML(s);this.editorView=new qd(t,{...e,attributes:this.getEditorViewAttributes(),dispatchTransaction:o,transformPastedHTML:a,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.prependClass(),this.injectCSS();let l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;let e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var c;return(c=this.capturedTransaction)===null||c===void 0?void 0:c.step(u)});return}let{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),o=n.includes(t),s=this.state;if(this.emit(\"beforeTransaction\",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit(\"transaction\",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit(\"selectionUpdate\",{editor:this,transaction:t});let a=n.findLast(u=>u.getMeta(\"focus\")||u.getMeta(\"blur\")),i=a?.getMeta(\"focus\"),l=a?.getMeta(\"blur\");i&&this.emit(\"focus\",{editor:this,event:i.event,transaction:a}),l&&this.emit(\"blur\",{editor:this,event:l.event,transaction:a}),!(t.getMeta(\"preventUpdate\")||!n.some(u=>u.docChanged)||s.doc.eq(e.doc))&&this.emit(\"update\",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return W1(this.state,t)}isActive(t,e){let n=typeof t==\"string\"?t:null,r=typeof t==\"string\"?e:t;return YW(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return G1(this.state.doc.content,this.schema)}getText(t){let{blockSeparator:e=`\n\n`,textSerializers:n={}}=t||{};return KW(this.state.doc,{blockSeparator:e,textSerializers:{...J2(this.schema),...n}})}get isEmpty(){return X1(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(\"destroy\"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(t=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&t!==void 0?t:!0}$node(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(t,e))||null}$pos(t){let e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new cX(e,this,!1,n)}get $doc(){return this.$pos(0)}};function ji(t){return new Km({find:t.find,handler:({state:e,range:n,match:r})=>{let o=ut(t.getAttributes,void 0,r);if(o===!1||o===null)return null;let{tr:s}=e,a=r[r.length-1],i=r[0];if(a){let l=i.search(/\\S/),u=n.from+i.indexOf(a),c=u+a.length;if(Vm(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(p=>p===t.type&&p!==f.mark.type)).filter(f=>f.to>u).length)return null;c<n.to&&s.delete(c,n.to),u>n.from&&s.delete(n.from+l,u);let d=n.from+l+a.length;s.addMark(n.from+l,d,t.type.create(o||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function Ex(t){return new Km({find:t.find,handler:({state:e,range:n,match:r})=>{let o=e.doc.resolve(n.from),s=ut(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function qi(t){return new Km({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{let s=ut(t.getAttributes,void 0,r)||{},a=e.tr.delete(n.from,n.to),i=a.doc.resolve(n.from).blockRange(),l=i&&Di(i,t.type,s);if(!l)return null;if(a.wrap(i,l),t.keepMarks&&t.editor){let{selection:c,storedMarks:d}=e,{splittableMarks:f}=t.editor.extensionManager,p=d||c.$to.parentOffset&&c.$from.marks();if(p){let h=p.filter(g=>f.includes(g.type.name));a.ensureMarks(h)}}if(t.keepAttributes){let c=t.type.name===\"bulletList\"||t.type.name===\"orderedList\"?\"listItem\":\"taskList\";o().updateAttributes(c,s).run()}let u=a.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&ir(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&a.join(n.from-1)},undoable:t.undoable})}var Jr=class mB extends Z1{constructor(...e){super(...e),this.type=\"node\"}static create(e={}){let n=typeof e==\"function\"?e():e;return new mB(n)}configure(e){return super.configure(e)}extend(e){let n=typeof e==\"function\"?e():e;return super.extend(n)}},gB=class{constructor(t,e,n){this.isDragging=!1,this.component=t,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=()=>{try{return e.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var e,n;let{view:r}=this.editor,o=t.target,s=o.nodeType===3?(e=o.parentElement)===null||e===void 0?void 0:e.closest(\"[data-drag-handle]\"):o.closest(\"[data-drag-handle]\");if(!this.dom||!((n=this.contentDOM)===null||n===void 0)&&n.contains(o)||!s)return;let a=0,i=0;if(this.dom!==s){var l,u,c,d;let b=this.dom.getBoundingClientRect(),x=s.getBoundingClientRect(),v=(l=t.offsetX)!==null&&l!==void 0?l:(u=t.nativeEvent)===null||u===void 0?void 0:u.offsetX,S=(c=t.offsetY)!==null&&c!==void 0?c:(d=t.nativeEvent)===null||d===void 0?void 0:d.offsetY;a=x.x-b.x+v,i=x.y-b.y+S}let f=this.dom.cloneNode(!0);try{let b=this.dom.getBoundingClientRect();f.style.width=`${Math.round(b.width)}px`,f.style.height=`${Math.round(b.height)}px`,f.style.boxSizing=\"border-box\",f.style.pointerEvents=\"none\"}catch{}let p=null;try{var h;p=document.createElement(\"div\"),p.style.position=\"absolute\",p.style.top=\"-9999px\",p.style.left=\"-9999px\",p.style.pointerEvents=\"none\",p.appendChild(f),document.body.appendChild(p),(h=t.dataTransfer)===null||h===void 0||h.setDragImage(f,a,i)}finally{p&&setTimeout(()=>{try{p?.remove()}catch{}},0)}let g=this.getPos();if(typeof g!=\"number\")return;let m=oe.create(r.state.doc,g),y=r.state.tr.setSelection(m);r.dispatch(y)}stopEvent(t){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent==\"function\")return this.options.stopEvent({event:t});let n=t.target;if(!(this.dom.contains(n)&&!(!((e=this.contentDOM)===null||e===void 0)&&e.contains(n))))return!1;let r=t.type.startsWith(\"drag\"),o=t.type===\"dragover\"||t.type===\"dragenter\",s=t.type===\"drop\";if(([\"INPUT\",\"BUTTON\",\"SELECT\",\"TEXTAREA\"].includes(n.tagName)||n.isContentEditable)&&!s&&!r)return!0;let{isEditable:a}=this.editor,{isDragging:i}=this,l=!!this.node.type.spec.draggable,u=oe.isSelectable(this.node),c=t.type===\"copy\",d=t.type===\"paste\",f=t.type===\"cut\",p=t.type===\"mousedown\";if(!l&&u&&r&&t.target===this.dom&&t.preventDefault(),l&&r&&!i&&t.target===this.dom)return t.preventDefault(),!1;if(l&&a&&!i&&p){let h=n.closest(\"[data-drag-handle]\");h&&(this.dom===h||this.dom.contains(h))&&(this.isDragging=!0,document.addEventListener(\"dragend\",()=>{this.isDragging=!1},{once:!0}),document.addEventListener(\"drop\",()=>{this.isDragging=!1},{once:!0}),document.addEventListener(\"mouseup\",()=>{this.isDragging=!1},{once:!0}))}return!(i||o||s||c||d||f||p&&u)}ignoreMutation(t){return this.dom?this.contentDOM?typeof this.options.ignoreMutation==\"function\"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type===\"selection\"||this.contentDOM.contains(t.target)&&t.type===\"childList\"&&(ku()||qm())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===t.target&&t.type===\"attributes\"?!0:!this.contentDOM.contains(t.target):t.type!==\"selection\":!0}updateAttributes(t){this.editor.commands.command(({tr:e})=>{let n=this.getPos();return typeof n!=\"number\"?!1:(e.setNodeMarkup(n,void 0,{...this.node.attrs,...t}),!0)})}deleteNode(){let t=this.getPos();if(typeof t!=\"number\")return;let e=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:e})}};function Oa(t){return new Q1({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{let s=ut(t.getAttributes,void 0,r,o);if(s===!1||s===null)return null;let{tr:a}=e,i=r[r.length-1],l=r[0],u=n.to;if(i){let c=l.search(/\\S/),d=n.from+l.indexOf(i),f=d+i.length;if(Vm(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(h=>h===t.type&&h!==p.mark.type)).filter(p=>p.to>d).length)return null;f<n.to&&a.delete(f,n.to),d>n.from&&a.delete(n.from+c,d),u=n.from+c+i.length,a.addMark(n.from+c,u,t.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||a.removeStoredMark(t.type)}}})}var cr=T(O(),1);var{getOwnPropertyNames:fX,getOwnPropertySymbols:pX}=Object,{hasOwnProperty:hX}=Object.prototype;function Gm(t,e){return function(r,o,s){return t(r,o,s)&&e(r,o,s)}}function Wm(t){return function(n,r,o){if(!n||!r||typeof n!=\"object\"||typeof r!=\"object\")return t(n,r,o);let{cache:s}=o,a=s.get(n),i=s.get(r);if(a&&i)return a===r&&i===n;s.set(n,r),s.set(r,n);let l=t(n,r,o);return s.delete(n),s.delete(r),l}}function mX(t){return t?.[Symbol.toStringTag]}function yB(t){return fX(t).concat(pX(t))}var gX=Object.hasOwn||((t,e)=>hX.call(t,e));function Lu(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var yX=\"__v\",bX=\"__o\",vX=\"_owner\",xX=typeof Float16Array<\"u\",{getOwnPropertyDescriptor:bB,keys:vB}=Object;function wX(t,e){return t.byteLength===e.byteLength&&Tx(new Uint8Array(t),new Uint8Array(e))}function SX(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function kX(t,e){return t.byteLength===e.byteLength&&Tx(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function CX(t,e){return Lu(t.getTime(),e.getTime())}function xB(t,e,n){return t.name===e.name&&t.message===e.message&&t.stack===e.stack&&n.equals(t.cause,e.cause,\"cause\",\"cause\",t,e,n)}function LX(t,e){return t===e}function wB(t,e,n){let r=t.size;if(r!==e.size)return!1;if(!r)return!0;let o=new Array(r),s=t.entries(),a,i,l=0;for(;(a=s.next())&&!a.done;){let u=e.entries(),c=!1,d=0;for(;(i=u.next())&&!i.done;){if(o[d]){d++;continue}let f=a.value,p=i.value;if(n.equals(f[0],p[0],l,d,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){c=o[d]=!0;break}d++}if(!c)return!1;l++}return!0}var AX=Lu;function SB(t,e,n){let r=vB(t),o=r.length;if(vB(e).length!==o)return!1;for(;o-- >0;)if(!LB(t,e,n,r[o]))return!1;return!0}function Zd(t,e,n){let r=yB(t),o=r.length;if(yB(e).length!==o)return!1;let s,a,i;for(;o-- >0;)if(s=r[o],!LB(t,e,n,s)||(a=bB(t,s),i=bB(e,s),(a||i)&&(!a||!i||a.configurable!==i.configurable||a.enumerable!==i.enumerable||a.writable!==i.writable)))return!1;return!0}function EX(t,e){return Lu(t.valueOf(),e.valueOf())}function TX(t,e){return t.source===e.source&&t.flags===e.flags}function kB(t,e,n){let r=t.size;if(r!==e.size)return!1;if(!r)return!0;let o=new Array(r),s=t.values(),a,i;for(;(a=s.next())&&!a.done;){let l=e.values(),u=!1,c=0;for(;(i=l.next())&&!i.done;){if(!o[c]&&n.equals(a.value,i.value,a.value,i.value,t,e,n)){u=o[c]=!0;break}c++}if(!u)return!1}return!0}function Tx(t,e){let n=t.length;if(e.length!==n||t.byteOffset!==e.byteOffset)return!1;if(t instanceof Float64Array||t instanceof Float32Array||xX&&t instanceof Float16Array){for(;n-- >0;)if(t[n]!==e[n]&&(t[n]===t[n]||e[n]===e[n]))return!1;return!0}for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function RX(t,e){return t.href===e.href?!0:t.protocol===e.protocol&&t.username===e.username&&t.password===e.password&&t.host===e.host&&t.pathname===e.pathname&&t.hash===e.hash&&IX(t.searchParams,e.searchParams)}function IX(t,e){let n=t.toString(),r=e.toString();return n===r||CB(n)===CB(r)}function CB(t){return t.split(\"&\").sort().join(\"&\")}function LB(t,e,n,r){return(r===vX||r===bX||r===yX)&&(t.$$typeof||e.$$typeof)?!0:gX(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var MX=\"[object ArrayBuffer]\",_X=\"[object Arguments]\",OX=\"[object Boolean]\",DX=\"[object DataView]\",NX=\"[object Date]\",PX=\"[object Error]\",BX=\"[object Map]\",zX=\"[object Number]\",FX=\"[object Object]\",HX=\"[object RegExp]\",$X=\"[object Set]\",UX=\"[object String]\",jX={\"[object Int8Array]\":!0,\"[object Uint8Array]\":!0,\"[object Uint8ClampedArray]\":!0,\"[object Int16Array]\":!0,\"[object Uint16Array]\":!0,\"[object Int32Array]\":!0,\"[object Uint32Array]\":!0,\"[object Float16Array]\":!0,\"[object Float32Array]\":!0,\"[object Float64Array]\":!0,\"[object BigInt64Array]\":!0,\"[object BigUint64Array]\":!0},qX=\"[object URL]\",VX=Object.prototype.toString;function KX({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:s,areMapsEqual:a,areNumbersEqual:i,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:h}){return function(m,y,b){if(m===y)return!0;if(m==null||y==null)return!1;let x=typeof m;if(x!==typeof y)return!1;if(x!==\"object\")return x===\"number\"?i(m,y,b):x===\"function\"?s(m,y,b):!1;let v=m.constructor;if(v!==y.constructor)return!1;if(v===Object)return l(m,y,b);if(Array.isArray(m))return e(m,y,b);if(v===Date)return r(m,y,b);if(v===RegExp)return c(m,y,b);if(v===Map)return a(m,y,b);if(v===Set)return d(m,y,b);let S=VX.call(m);if(S===NX)return r(m,y,b);if(S===HX)return c(m,y,b);if(S===BX)return a(m,y,b);if(S===$X)return d(m,y,b);if(S===FX)return typeof m.then!=\"function\"&&typeof y.then!=\"function\"&&l(m,y,b);if(S===qX)return p(m,y,b);if(S===PX)return o(m,y,b);if(S===_X)return l(m,y,b);if(jX[S])return f(m,y,b);if(S===MX)return t(m,y,b);if(S===DX)return n(m,y,b);if(S===OX||S===zX||S===UX)return u(m,y,b);if(h){let E=h[S];if(!E){let w=mX(m);w&&(E=h[w])}if(E)return E(m,y,b)}return!1}}function GX({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:wX,areArraysEqual:n?Zd:SX,areDataViewsEqual:kX,areDatesEqual:CX,areErrorsEqual:n?Gm(xB,Zd):Gm(xB,SB),areFunctionsEqual:LX,areMapsEqual:n?Gm(wB,Zd):wB,areNumbersEqual:AX,areObjectsEqual:n?Zd:SB,arePrimitiveWrappersEqual:EX,areRegExpsEqual:TX,areSetsEqual:n?Gm(kB,Zd):kB,areTypedArraysEqual:n?Gm(Tx,Zd):Tx,areUrlsEqual:RX,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){let o=Wm(r.areArraysEqual),s=Wm(r.areErrorsEqual),a=Wm(r.areMapsEqual),i=Wm(r.areObjectsEqual),l=Wm(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areErrorsEqual:s,areMapsEqual:a,areObjectsEqual:i,areSetsEqual:l})}return r}function WX(t){return function(e,n,r,o,s,a,i){return t(e,n,i)}}function XX({circular:t,comparator:e,createState:n,equals:r,strict:o}){if(n)return function(i,l){let{cache:u=t?new WeakMap:void 0,meta:c}=n();return e(i,l,{cache:u,equals:r,meta:c,strict:o})};if(t)return function(i,l){return e(i,l,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};let s={cache:void 0,equals:r,meta:void 0,strict:o};return function(i,l){return e(i,l,s)}}var AB=Vi(),nfe=Vi({strict:!0}),rfe=Vi({circular:!0}),ofe=Vi({circular:!0,strict:!0}),sfe=Vi({createInternalComparator:()=>Lu}),afe=Vi({strict:!0,createInternalComparator:()=>Lu}),ife=Vi({circular:!0,createInternalComparator:()=>Lu}),lfe=Vi({circular:!0,createInternalComparator:()=>Lu,strict:!0});function Vi(t={}){let{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,s=GX(t),a=KX(s),i=n?n(a):WX(a);return XX({circular:e,comparator:a,createState:r,equals:i,strict:o})}var BB=T(IB(),1);function oJ(t,e){var n,r;if(t.isDestroyed||e.defaultPrevented||!e.cancelable||!t.isEditable||e.inputType!==\"insertParagraph\"&&e.inputType!==\"insertLineBreak\"||!ku()&&!qm())return;let o=t.view,s=o.root,a=(n=(r=s.getSelection)===null||r===void 0?void 0:r.call(s))!==null&&n!==void 0?n:o.dom.ownerDocument.getSelection(),i=a?.anchorNode,l=i?.nodeType===1?i:i?.parentElement,u=l?.closest(\"[data-node-view-content-react]\");if(!u||!o.dom.contains(u))return;let c=o.input.lastKeyCode;c===13&&(o.input.lastKeyCode=null),o.domObserver.forceFlush(),o.domObserver.flush();let d=new KeyboardEvent(\"keydown\",{key:\"Enter\",code:\"Enter\",keyCode:13,shiftKey:e.inputType===\"insertLineBreak\",bubbles:!0,cancelable:!0});o.someProp(\"handleKeyDown\",f=>f(o,d))?(e.preventDefault(),o.input.lastIOSEnter=0,clearTimeout(o.input.lastIOSEnterFallbackTimeout)):c===13&&(o.input.lastKeyCode=c)}var MB=new we(\"reactMobileEnter\"),sJ=(...t)=>e=>{t.forEach(n=>{typeof n==\"function\"?n(e):n&&(n.current=e)})},aJ=({contentComponent:t})=>{let e=(0,eA.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot);return(0,cr.jsx)(cr.Fragment,{children:Object.values(e)})};function iJ(){let t=new Set,e={},n=!1,r=()=>{n||!t.size||(n=!0,queueMicrotask(()=>{n=!1,t.forEach(o=>o())}))};return{subscribe(o){return t.add(o),()=>{t.delete(o)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(o,s){e={...e,[o]:Ix.default.createPortal(s.reactElement,s.element,o)},r()},removeRenderer(o){let s={...e};delete s[o],e=s,r()}}}var lJ=class extends Ee.default.Component{constructor(t){super(t),this.editorContentRef=Ee.default.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;let e=this.props.editor;if(e&&!e.isDestroyed&&(!((t=e.view.dom)===null||t===void 0)&&t.parentNode)){if(e.contentComponent)return;let n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=iJ(),e.createNodeViews(),e.registerPlugin(new ie({key:MB,props:{handleDOMEvents:{beforeinput:(r,o)=>oJ(e,o)}}})),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||(t.unregisterPlugin(MB),t.view.setProps({nodeViews:{}})),t.contentComponent=null;try{var e;if(!(!((e=t.view.dom)===null||e===void 0)&&e.parentNode))return;let n=document.createElement(\"div\");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:t,innerRef:e,...n}=this.props;return(0,cr.jsxs)(cr.Fragment,{children:[(0,cr.jsx)(\"div\",{ref:sJ(e,this.editorContentRef),...n}),t?.contentComponent&&(0,cr.jsx)(aJ,{contentComponent:t.contentComponent})]})}},uJ=(0,Ee.forwardRef)((t,e)=>{let n=Ee.default.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Ee.default.createElement(lJ,{key:n,innerRef:e,...t})}),Xm=Ee.default.memo(uJ),cJ=typeof window<\"u\"?Ee.useLayoutEffect:Ee.useEffect,dJ=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let e,n=o=>{o?.transaction!==void 0&&o.transaction===e||(e=o?.transaction,this.transactionNumber+=1,this.subscribers.forEach(s=>s()))},r=this.editor;return r.on(\"transaction\",n),r.on(\"update\",n),()=>{r.off(\"transaction\",n),r.off(\"update\",n)}}}};function Jm(t){var e;let[n]=(0,Ee.useState)(()=>new dJ(t.editor)),r=(0,BB.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:AB);return cJ(()=>n.watch(t.editor),[t.editor,n]),(0,Ee.useDebugValue)(r),r}var _B=!1,zB=typeof window>\"u\",fJ=zB||!!(typeof window<\"u\"&&window.next),pJ=class FB{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=\"\",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){let e=this.options.current.immediatelyRender,n=e??!0;return zB?(n&&_B&&console.warn(\"SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches\"),n=!1):fJ&&e===void 0&&(n=!1,_B&&console.warn(\"Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.\")),n?this.createEditor():null}createEditor(){let e={...this.options.current,onBeforeCreate:(...n)=>{var r,o;return(r=(o=this.options.current).onBeforeCreate)===null||r===void 0?void 0:r.call(o,...n)},onBlur:(...n)=>{var r,o;return(r=(o=this.options.current).onBlur)===null||r===void 0?void 0:r.call(o,...n)},onCreate:(...n)=>{var r,o;return(r=(o=this.options.current).onCreate)===null||r===void 0?void 0:r.call(o,...n)},onDestroy:(...n)=>{var r,o;return(r=(o=this.options.current).onDestroy)===null||r===void 0?void 0:r.call(o,...n)},onFocus:(...n)=>{var r,o;return(r=(o=this.options.current).onFocus)===null||r===void 0?void 0:r.call(o,...n)},onSelectionUpdate:(...n)=>{var r,o;return(r=(o=this.options.current).onSelectionUpdate)===null||r===void 0?void 0:r.call(o,...n)},onTransaction:(...n)=>{var r,o;return(r=(o=this.options.current).onTransaction)===null||r===void 0?void 0:r.call(o,...n)},onUpdate:(...n)=>{var r,o;return(r=(o=this.options.current).onUpdate)===null||r===void 0?void 0:r.call(o,...n)},onContentError:(...n)=>{var r,o;return(r=(o=this.options.current).onContentError)===null||r===void 0?void 0:r.call(o,...n)},onDrop:(...n)=>{var r,o;return(r=(o=this.options.current).onDrop)===null||r===void 0?void 0:r.call(o,...n)},onPaste:(...n)=>{var r,o;return(r=(o=this.options.current).onPaste)===null||r===void 0?void 0:r.call(o,...n)},onDelete:(...n)=>{var r,o;return(r=(o=this.options.current).onDelete)===null||r===void 0?void 0:r.call(o,...n)},onMount:(...n)=>{var r,o;return(r=(o=this.options.current).onMount)===null||r===void 0?void 0:r.call(o,...n)},onUnmount:(...n)=>{var r,o;return(r=(o=this.options.current).onUnmount)===null||r===void 0?void 0:r.call(o,...n)}};return new hB(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>[\"onCreate\",\"onBeforeCreate\",\"onDestroy\",\"onUpdate\",\"onTransaction\",\"onFocus\",\"onBlur\",\"onSelectionUpdate\",\"onContentError\",\"onDrop\",\"onPaste\"].includes(r)?!0:r===\"extensions\"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((o,s)=>{var a;return o===((a=n.extensions)===null||a===void 0?void 0:a[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?FB.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,r)=>n===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function HB(t={},e=[]){let n=(0,Ee.useRef)(t);n.current=t;let[r]=(0,Ee.useState)(()=>new pJ(n)),o=(0,eA.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,Ee.useDebugValue)(o),(0,Ee.useEffect)(r.onRender(e)),Jm({editor:o,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),o}var $B=(0,Ee.createContext)({editor:null}),yfe=$B.Consumer;var UB=(0,Ee.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});var hJ=()=>(0,Ee.useContext)(UB);var Mx=Ee.default.forwardRef((t,e)=>{let{onDragStart:n}=hJ(),r=t.as||\"div\";return(0,cr.jsx)(r,{...t,ref:e,\"data-node-view-wrapper\":\"\",onDragStart:n,style:{whiteSpace:\"normal\",...t.style}})});function OB(t){return!!(typeof t==\"function\"&&t.prototype&&t.prototype.isReactComponent)}function DB(t){return!!(typeof t==\"object\"&&t.$$typeof&&(t.$$typeof.toString()===\"Symbol(react.forward_ref)\"||t.$$typeof.description===\"react.forward_ref\"))}function mJ(t){return!!(typeof t==\"object\"&&t.$$typeof&&(t.$$typeof.toString()===\"Symbol(react.memo)\"||t.$$typeof.description===\"react.memo\"))}function gJ(t){if(OB(t)||DB(t))return!0;if(mJ(t)){let e=t.type;if(e)return OB(e)||DB(e)}return!1}function yJ(){try{if(Ee.version)return parseInt(Ee.version.split(\".\")[0],10)>=19}catch{}return!1}var bJ=class{constructor(t,{editor:e,props:n={},as:r=\"div\",className:o=\"\"}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=e,this.props=n,this.element=document.createElement(r),this.element.classList.add(\"react-renderer\"),o&&this.element.classList.add(...o.split(\" \")),this.editor.isEditorContentInitialized?(0,Ix.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var t;if(this.destroyed)return;let e=this.component,n=this.props,r=this.editor,o=yJ(),s=gJ(e),a={...n};a.ref&&!(o||s)&&delete a.ref,!a.ref&&(o||s)&&(a.ref=i=>{this.ref=i}),this.reactElement=(0,cr.jsx)(e,{...a}),r==null||(t=r.contentComponent)===null||t===void 0||t.setRenderer(this.id,this)}updateProps(t={}){if(this.destroyed)return;let e=!1,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let o=n[r];if(t[o]!==this.props[o]){e=!0;break}}e&&(this.props={...this.props,...t},this.render())}destroy(){var t;this.destroyed=!0;let e=this.editor;e==null||(t=e.contentComponent)===null||t===void 0||t.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(t){Object.keys(t).forEach(e=>{this.element.setAttribute(e,t[e])})}},bfe=Ee.default.createContext({markViewContentRef:()=>{}});function vJ(t){var e;let n=t.getRootNode(),r=typeof n.getSelection==\"function\"?n.getSelection():(e=t.ownerDocument)===null||e===void 0||(e=e.defaultView)===null||e===void 0?void 0:e.getSelection();if(!r||r.rangeCount===0)return null;let{anchorNode:o,anchorOffset:s,focusNode:a,focusOffset:i}=r;return!o||!a||!t.contains(o)||!t.contains(a)?null:()=>{try{r.setBaseAndExtent(o,s,a,i)}catch{}}}function xJ(t,e,n){return t.node(n)===e.node(n)&&t.before(n)===e.before(n)}function jB(t){if(!Sx(t))return[];let{$from:e,$to:n}=t,r=[],o=Math.min(e.depth,n.depth);for(let s=1;s<=o&&xJ(e,n,s);s+=1)r.push(e.before(s));return r}var wJ=class{constructor(t){this.views=new WeakMap,this.viewCount=0,this.insideViews=new Set,this.syncQueued=!1,this.scheduleSync=()=>{this.syncQueued||(this.syncQueued=!0,queueMicrotask(()=>{this.syncQueued=!1,this.sync()}))},this.handleTransaction=()=>this.scheduleSync(),this.editor=t}register(t){this.viewCount===0&&this.editor.on(\"transaction\",this.handleTransaction),this.views.set(t.dom,t),this.viewCount+=1,this.scheduleSync()}unregister(t){this.views.delete(t.dom),this.viewCount-=1,this.insideViews.delete(t),this.viewCount===0&&this.editor.off(\"transaction\",this.handleTransaction)}sync(){if(this.viewCount===0||this.editor.isDestroyed)return;let t=this.findInsideViews();this.updateViews(this.insideViews,t,!1),this.updateViews(t,this.insideViews,!0),this.insideViews=t}updateViews(t,e,n){for(let r of t)e.has(r)||r.setSelectionInside(n)}findInsideViews(){let t=new Set;for(let e of jB(this.editor.state.selection)){let n=this.editor.view.nodeDOM(e),r=n?this.views.get(n):void 0;r&&t.add(r)}return t}},NB=new WeakMap;function PB(t){let e=NB.get(t);return e||(e=new wJ(t),NB.set(t,e)),e}var SJ=class extends gB{constructor(t,e,n){if(super(t,e,n),this.nodeSelected=!1,this.handlePositionUpdate=()=>{let r=this.getPos();typeof r!=\"number\"||r===this.currentPos||(this.currentPos=r,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==\"function\"&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?\"span\":\"div\"),this.contentDOMElement.dataset.nodeViewContentReact=\"\",this.contentDOMElement.dataset.nodeViewWrapper=\"\",this.contentDOMElement.style.whiteSpace=\"inherit\";let r=this.dom.querySelector(\"[data-node-view-content]\");r?r.appendChild(this.contentDOMElement):this.dom.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on(\"update\",this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let t=this.editor,e=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(e,{get(n,r,o){if(r===\"storage\"){var s;return(s=t.storage[e.name])!==null&&s!==void 0?s:{}}return Reflect.get(n,r,o)}})}return this.cachedExtensionWithSyncedStorage}mount(){let t={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,selectionInside:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(l={})=>this.updateAttributes(l),deleteNode:()=>this.deleteNode(),ref:(0,Ee.createRef)()};if(!this.component.displayName){let l=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=l(this.extension.name)}let r={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:l=>{if(l&&this.contentDOMElement&&l.firstChild!==this.contentDOMElement){l.hasAttribute(\"data-node-view-wrapper\")&&l.removeAttribute(\"data-node-view-wrapper\");let u=vJ(this.contentDOMElement);l.appendChild(this.contentDOMElement),u?.()}}},o=this.component,s=(0,Ee.memo)(l=>(0,cr.jsx)(UB.Provider,{value:r,children:(0,Ee.createElement)(o,l)}));s.displayName=\"ReactNodeView\";let a=this.node.isInline?\"span\":\"div\";this.options.as&&(a=this.options.as);let{className:i=\"\"}=this.options;this.renderer=new bJ(s,{editor:this.editor,props:t,as:a,className:`node-${this.node.type.name} ${i}`.trim()}),PB(this.editor).register(this),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!((t=this.renderer.element.firstElementChild)===null||t===void 0)&&t.hasAttribute(\"data-node-view-wrapper\")))throw Error(\"Please use the NodeViewWrapper component for your node view.\");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(t,e,n){let r=a=>{this.renderer.updateProps(a),typeof this.options.attrs==\"function\"&&this.updateElementAttributes()};if(t.type!==this.node.type)return!1;if(typeof this.options.update==\"function\"){let a=this.node,i=this.decorations,l=this.innerDecorations;return this.node=t,this.decorations=e,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:a,oldDecorations:i,newNode:t,newDecorations:e,oldInnerDecorations:l,innerDecorations:n,updateProps:()=>r({node:t,decorations:e,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(t===this.node)return this.node=t,this.decorations=e,this.innerDecorations=n,!0;let o=this.getPos();this.node=t,this.decorations=e,this.innerDecorations=n,this.currentPos=o;let s={node:t,decorations:e,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(s.getPos=()=>this.getPos()),r(s),!0}selectNode(){this.nodeSelected=!0,this.updateSelectedState(!0)}deselectNode(){this.nodeSelected=!1,this.updateSelectedState(this.options.selectedOnTextSelection===!0&&this.isTextSelectionInside())}setSelectionInside(t){let e=this.nodeSelected||this.options.selectedOnTextSelection===!0&&t;this.renderer.updateProps({selectionInside:t,selected:e}),this.renderer.element.classList.toggle(\"ProseMirror-selectednode\",e)}updateSelectedState(t){this.renderer.updateProps({selected:t}),this.renderer.element.classList.toggle(\"ProseMirror-selectednode\",t)}isTextSelectionInside(){let t=this.getPos();return typeof t==\"number\"&&jB(this.editor.state.selection).includes(t)}destroy(){this.renderer.destroy(),PB(this.editor).unregister(this),this.options.trackNodeViewPosition&&this.editor.off(\"update\",this.handlePositionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let t={};if(typeof this.options.attrs==\"function\"){let e=this.editor.extensionManager.attributes,n=Ui(this.node,e);t=this.options.attrs({node:this.node,HTMLAttributes:n})}else t=this.options.attrs;this.renderer.updateAttributes(t)}}};function tA(t,e){return n=>n.editor.contentComponent?new SJ(t,n,e):{dom:document.createElement(\"span\"),contentDOM:null,update:()=>!1,destroy:()=>{},selectNode:()=>{},deselectNode:()=>{},stopEvent:()=>!1,ignoreMutation:()=>!0}}var nA=(0,Ee.createContext)({get editor(){throw new Error(\"useTiptap must be used within a <Tiptap> provider\")}});nA.displayName=\"TiptapContext\";var kJ=()=>(0,Ee.useContext)(nA);function qB({children:t,...e}){let n=\"editor\"in e?e.editor:e.instance;if(!n)throw new Error(\"Tiptap: An editor instance is required. Pass a non-null `editor` prop.\");let r=(0,Ee.useMemo)(()=>({editor:n}),[n]),o=(0,Ee.useMemo)(()=>({editor:n}),[n]);return(0,cr.jsx)($B.Provider,{value:o,children:(0,cr.jsx)(nA.Provider,{value:r,children:t})})}qB.displayName=\"Tiptap\";function VB({...t}){let{editor:e}=kJ();return(0,cr.jsx)(Xm,{editor:e,...t})}VB.displayName=\"Tiptap.Content\";var vfe=Object.assign(qB,{Content:VB});var Au=T(O(),1),rA={bold:!1,italic:!1,link:!1,bulletList:!1,orderedList:!1,blockquote:!1,heading:null},CJ={1:Ih,2:Mh,3:_h,4:Oh,5:Dh,6:Nh},LJ=14,AJ=t=>t.preventDefault();function _x({allowed:t,active:e,canInsert:n,onCommand:r}){let o=(u,c,d,f)=>(0,Au.jsx)(nt,{label:u,\"aria-pressed\":c,onMouseDown:AJ,onClick:()=>r(d),children:(0,Au.jsx)(f,{size:LJ,\"aria-hidden\":\"true\"})},u),s=[],a=[t.marks.has(\"bold\")&&o(\"Bold\",e.bold,\"bold\",wh),t.marks.has(\"italic\")&&o(\"Italic\",e.italic,\"italic\",Bh),t.marks.has(\"link\")&&o(\"Link\",e.link,\"link\",Fh)].filter(Boolean);a.length>0&&s.push(a);let i=t.headingLevels.filter(u=>u>=1&&u<=6).map(u=>o(`Heading ${u}`,e.heading===u,{heading:u},CJ[u]));i.length>0&&s.push(i);let l=[t.nodes.has(\"bulletList\")&&o(\"Bullet list\",e.bulletList,\"bulletList\",$h),t.nodes.has(\"orderedList\")&&o(\"Numbered list\",e.orderedList,\"orderedList\",Hh),t.nodes.has(\"blockquote\")&&o(\"Quote\",e.blockquote,\"blockquote\",Kh)].filter(Boolean);return l.length>0&&s.push(l),n&&s.push([o(\"Insert\",!1,\"insert\",Vh)]),s.length===0?null:(0,Au.jsx)(\"div\",{className:\"sm-richtext__bar\",role:\"toolbar\",\"aria-label\":\"Formatting\",children:s.map((u,c)=>(0,Au.jsxs)(\"span\",{style:{display:\"contents\"},children:[c>0&&(0,Au.jsx)(\"span\",{className:\"sm-richtext__sep\",\"aria-hidden\":\"true\"}),u]},c))})}var Eu=T(O(),1),EJ=t=>t.preventDefault();function Qd({items:t,active:e,onPick:n}){return(0,Eu.jsxs)(\"div\",{className:\"sm-picker sm-richtext__insert\",role:\"listbox\",\"aria-label\":\"Insert\",children:[t.length===0&&(0,Eu.jsx)(\"div\",{className:\"sm-richtext__insert-empty\",children:\"Nothing matches\"}),t.map((r,o)=>(0,Eu.jsxs)(\"button\",{type:\"button\",role:\"option\",\"aria-selected\":o===e,className:o===e?\"sm-picker__item sm-picker__item--active\":\"sm-picker__item\",onMouseDown:EJ,onClick:()=>n(r),children:[(0,Eu.jsx)(\"span\",{className:\"sm-picker__icon\",children:r.icon}),(0,Eu.jsx)(\"span\",{style:{fontWeight:600},children:r.title})]},`${r.kind}-${r.title}`))]})}var Da=T(O(),1);function Ox({menu:t}){return(0,Da.jsxs)(\"div\",{className:\"sm-richtext__menu\",onBlur:t.dismiss,children:[(0,Da.jsx)(\"input\",{className:\"sm-input\",placeholder:\"Filter\\u2026\",value:t.query,autoFocus:!0,\"aria-label\":\"Insert filter\",onChange:e=>t.setQuery(e.target.value),onKeyDown:t.onKeyDown}),(0,Da.jsx)(Qd,{items:t.items,active:t.active,onPick:t.pick})]})}function Dx({link:t}){return(0,Da.jsxs)(\"div\",{className:\"sm-richtext__link\",children:[(0,Da.jsx)(\"input\",{className:\"sm-input\",placeholder:\"https://\\u2026 or /path\",value:t.href,autoFocus:!0,\"aria-label\":\"Link URL\",onChange:e=>t.setHref(e.target.value),onKeyDown:e=>{e.key===\"Enter\"&&(e.preventDefault(),t.apply()),e.key===\"Escape\"&&(e.preventDefault(),e.stopPropagation(),t.close())}}),(0,Da.jsx)(Q,{onClick:t.apply,children:\"Apply\"}),(0,Da.jsx)(Q,{variant:\"secondary\",onClick:t.remove,children:\"Remove\"})]})}var Nx=T(te(),1),WB=T(O(),1),KB=(0,Nx.createContext)({path:\"\"});function Px({value:t,children:e}){return(0,WB.jsx)(KB.Provider,{value:t,children:e})}function ef(){return(0,Nx.useContext)(KB)}function Bx(t,e){return[\"sm-rtcard\",t&&\"sm-rtcard--selected\",e&&\"sm-admin not-prose\"].filter(Boolean).join(\" \")}function GB(t,e,n){return{unknown:!e,outside:e&&n!==void 0&&!n.includes(t)}}var Ms=T(te(),1);var zx=T(te(),1),XB=T(Tl(),1);var Na=T(O(),1);function TJ(){return typeof document>\"u\"?null:document.querySelector(\".sm-admin\")??document.body}function Rs({title:t,width:e=720,height:n,flush:r=!1,onClose:o,children:s,footer:a}){let[i]=(0,zx.useState)(TJ);(0,zx.useEffect)(()=>{let u=c=>{c.key===\"Escape\"&&o()};return window.addEventListener(\"keydown\",u),()=>window.removeEventListener(\"keydown\",u)},[o]);let l=(0,Na.jsx)(\"div\",{className:\"sm-modal\",onClick:o,children:(0,Na.jsxs)(\"div\",{className:\"sm-modal__panel\",role:\"dialog\",\"aria-label\":t,style:{width:e,...n!==void 0?{height:n}:{}},onClick:u=>u.stopPropagation(),children:[(0,Na.jsxs)(\"div\",{className:\"sm-modal__head\",children:[(0,Na.jsx)(\"span\",{className:\"sm-title\",children:t}),(0,Na.jsx)(nt,{label:\"Close\",onClick:o,children:\"\\xD7\"})]}),(0,Na.jsx)(\"div\",{className:Ie(\"sm-modal__body\",r&&\"sm-modal__body--flush\"),children:s}),a&&(0,Na.jsx)(\"div\",{className:\"sm-modal__foot\",children:a})]})});return i?(0,XB.createPortal)(l,i):l}var Ki=T(te(),1);var RJ=t=>t.replace(/\\.[^.]+$/,\"\");async function Tu(t,e,n){let r=await t.beginUpload({name:e.name,mime:e.type,size:e.size});if(!r.ok)return r;try{await n.put(r.data.uploadUrl,e,e.type)}catch(a){return{ok:!1,code:\"internal\",message:`smoodly: upload failed \\u2014 ${a instanceof Error?a.message:String(a)}`}}let o=await n.measure(e,e.type),s;if(o.poster){let a=await Tu(t,new File([o.poster],`${RJ(e.name)}-poster.jpg`,{type:\"image/jpeg\"}),n);a.ok&&(s=a.data.id)}return t.finishUpload(r.data.id,{width:o.width,height:o.height,duration:o.duration,posterId:s})}async function JB(t,e,n){let r=await fetch(t,{method:\"PUT\",headers:{\"content-type\":n,\"x-upsert\":\"false\",\"cache-control\":`max-age=${FD}`},body:e});if(!r.ok)throw new Error(`${r.status} ${(await r.text()).slice(0,200)}`)}var YB=t=>URL.createObjectURL(t);function IJ(t){return new Promise(e=>{let n=YB(t),r=new Image;r.onload=()=>{e({width:r.naturalWidth,height:r.naturalHeight}),URL.revokeObjectURL(n)},r.onerror=()=>{e({}),URL.revokeObjectURL(n)},r.src=n})}function MJ(t){return new Promise(e=>{let n=YB(t),r=document.createElement(\"video\");r.preload=\"metadata\",r.muted=!0;let o=s=>{e(s),URL.revokeObjectURL(n)};r.onerror=()=>o({}),r.onloadedmetadata=()=>{let s={width:r.videoWidth,height:r.videoHeight,duration:r.duration};r.onseeked=()=>{let a=document.createElement(\"canvas\");a.width=r.videoWidth,a.height=r.videoHeight,a.getContext(\"2d\")?.drawImage(r,0,0),a.toBlob(i=>o(i?{...s,poster:i}:s),\"image/jpeg\",.85)},r.currentTime=Math.min(1,r.duration/2)},r.src=n})}function ZB(t,e){return e.startsWith(\"image/\")?IJ(t):e.startsWith(\"video/\")?MJ(t):Promise.resolve({})}var tz=T(O(),1),QB=(0,Ki.createContext)(null);function ez({ops:t,media:e,upload:n,children:r}){let o=(0,Ki.useRef)(new Map),s=(0,Ki.useMemo)(()=>({ops:t.assets,media:e,upload:n??{put:JB,measure:ZB},remember:a=>{o.current.set(a.id,a)},get:async a=>{let i=o.current.get(a);if(i)return i;let l=await t.assets.get(a);return l.ok?(o.current.set(a,l.data),l.data):null}}),[t,e,n]);return(0,tz.jsx)(QB.Provider,{value:s,children:r})}function Is(){let t=(0,Ki.useContext)(QB);if(!t)throw new Error(\"smoodly: useAssets() needs an <AssetsProvider> above it.\");return t}var Fx=[\"All\",\"Images\",\"Video\",\"Files\"],Hx=t=>t===\"Images\"?\"image\":t===\"Video\"?\"video\":t===\"Files\"?\"file\":void 0;function tf(t){return t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${Math.round(t/(1024*1024)*10)/10} MB`}var nz=t=>t===0?\"Not used\":t===1?\"Used in 1 place\":`Used in ${t} places`;function nf(t,e){return e.filter(n=>t.some(r=>r===\"file\"?!n.startsWith(\"image/\")&&!n.startsWith(\"video/\"):n.startsWith(`${r}/`))).join(\",\")}var Yr=T(O(),1);function oA({asset:t,className:e}){return t.kind===\"image\"?(0,Yr.jsx)(\"img\",{className:e,src:t.url,alt:\"\",loading:\"lazy\"}):t.kind===\"video\"?t.posterId?(0,Yr.jsx)(\"video\",{className:e,src:t.url,muted:!0,playsInline:!0,preload:\"metadata\"}):(0,Yr.jsx)(\"span\",{className:`${e??\"\"} sm-thumb--chip`,children:\"Video\"}):(0,Yr.jsx)(\"span\",{className:`${e??\"\"} sm-thumb--chip`,children:t.filename.split(\".\").pop()?.toUpperCase()??\"File\"})}function $x({items:t,selectedId:e,onSelect:n}){return(0,Yr.jsxs)(\"div\",{className:\"sm-mediagrid\",children:[t.map(r=>(0,Yr.jsxs)(\"button\",{type:\"button\",className:\"sm-mediacard\",\"aria-pressed\":r.id===e,onClick:()=>n(r),children:[(0,Yr.jsx)(\"span\",{className:\"sm-mediacard__thumb\",children:(0,Yr.jsx)(oA,{asset:r,className:\"sm-mediacard__img\"})}),(0,Yr.jsx)(\"span\",{className:\"sm-mediacard__name\",children:r.title??r.filename}),(0,Yr.jsxs)(\"span\",{className:\"sm-mediacard__meta\",children:[r.width&&r.height?`${r.width}\\xD7${r.height} \\xB7 `:\"\",tf(r.size)]})]},r.id)),t.length===0&&(0,Yr.jsx)(\"div\",{className:\"sm-empty\",children:\"No media yet.\"})]})}var Zo=T(O(),1);function Gi({kinds:t,onPick:e,onClose:n,initialItems:r=[]}){let o=Is(),[s,a]=(0,Ms.useState)(r),[i,l]=(0,Ms.useState)(\"\"),[u,c]=(0,Ms.useState)(t.length===1?t[0]===\"image\"?\"Images\":t[0]===\"video\"?\"Video\":\"Files\":\"All\"),[d,f]=(0,Ms.useState)(!1),[p,h]=(0,Ms.useState)(null),g=t.length===1?[u]:Fx,m=(0,Ms.useCallback)(()=>{o.ops.list({kind:Hx(u),search:i||void 0}).then(b=>b.ok?a(b.data.items.filter(x=>t.includes(x.kind))):h(b.message)).catch(()=>h(\"Couldn't reach the server.\"))},[o,u,i,t]);(0,Ms.useEffect)(m,[m]);let y=async b=>{let x=b?.[0];if(!x)return;f(!0),h(null);let v=await Tu(o.ops,x,o.upload);if(f(!1),!v.ok){h(v.message);return}o.remember(v.data),e(v.data)};return(0,Zo.jsxs)(Rs,{title:\"Media\",onClose:n,children:[(0,Zo.jsxs)(\"div\",{className:\"sm-picker-bar\",children:[(0,Zo.jsx)(\"input\",{className:\"sm-input\",placeholder:\"Search media\",value:i,onChange:b=>l(b.target.value),style:{maxWidth:260}}),g.length>1&&(0,Zo.jsx)(ba,{options:g,value:u,onChange:c}),(0,Zo.jsxs)(\"label\",{className:\"sm-btn sm-btn--primary\",style:{marginLeft:\"auto\"},children:[d?\"Uploading\\u2026\":\"Upload\",(0,Zo.jsx)(\"input\",{type:\"file\",accept:nf(t,o.media.accept),hidden:!0,disabled:d,onChange:b=>{y(b.target.files)}})]})]}),p&&(0,Zo.jsx)(Me,{tone:\"error\",onDismiss:()=>h(null),children:p}),(0,Zo.jsx)(\"div\",{className:\"sm-dropzone sm-dropzone--bar\",onDragOver:b=>b.preventDefault(),onDrop:b=>{b.preventDefault(),y(b.dataTransfer.files)},children:\"Drop a file here to upload it\"}),(0,Zo.jsx)($x,{items:s,onSelect:e})]})}var ln=T(te(),1);var rz=Object.defineProperty,oz=(t,e)=>{let n={};for(var r in t)rz(n,r,{get:t[r],enumerable:!0});return e||rz(n,Symbol.toStringTag,{value:\"Module\"}),n};function Wx(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}var lA=class xz{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:s}=r,a=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([i,l])=>[i,(...c)=>{let d=l(...c)(a);return!s.getMeta(\"preventDispatch\")&&!this.hasCustomState&&o.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:o,state:s}=this,{view:a}=o,i=[],l=!!e,u=e||s.tr,c=()=>(!l&&n&&!u.getMeta(\"preventDispatch\")&&!this.hasCustomState&&a.dispatch(u),i.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...g)=>{let m=this.buildProps(u,n),y=p(...g)(m);return i.push(y),d}])),run:c};return d}static createFakeChain(){let e=new Proxy({},{get:(n,r)=>{if(r!==\"then\")return r===\"run\"?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:n,state:r}=this,o=!1,s=e||r.tr,a=this.buildProps(s,o);return{...Object.fromEntries(Object.entries(n).map(([i,l])=>[i,(...u)=>l(...u)({...a,dispatch:void 0})])),chain:()=>this.createChain(s,o)}}static createFallbackCan(){let e=xz.createFakeChain();return new Proxy({chain:()=>e},{get:(n,r)=>{if(r!==\"then\")return r===\"chain\"?n.chain:()=>!1}})}buildProps(e,n=!0){let{rawCommands:r,editor:o,state:s}=this,{view:a}=o,i={tr:e,editor:o,view:a,state:Wx({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...c)=>u(...c)(i)]))}};return i}},_J=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{if(!t.isDestroyed){var n;e.dom.blur(),(n=window)===null||n===void 0||(n=n.getSelection())===null||n===void 0||n.removeAllRanges()}}),!0),OJ=(t=!0)=>({commands:e})=>e.setContent(\"\",{emitUpdate:t}),DJ=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(i,l)=>{if(i.type.isText)return;let{doc:u,mapping:c}=e,d=u.resolve(c.map(l)),f=u.resolve(c.map(l+i.nodeSize)),p=d.blockRange(f);if(!p)return;let h=Jo(p);if(i.type.isTextblock){let{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,g)}(h||h===0)&&e.lift(p,h)})}),!0},NJ=t=>e=>t(e),PJ=()=>({state:t,dispatch:e})=>Em(t,e),BJ=(t,e)=>({editor:n,tr:r})=>{let{state:o}=n,s=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new J(r.doc.resolve(Math.max(a-1,0)))),!0},zJ=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){let a=o.before(s),i=o.after(s);t.delete(a,i).scrollIntoView()}return!0}return!1};function nn(t,e){if(typeof t==\"string\"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var FJ=t=>({tr:e,state:n,dispatch:r})=>{let o=nn(t,n.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===o){if(r){let i=s.before(a),l=s.after(a);e.delete(i,l).scrollIntoView()}return!0}return!1},HJ=t=>({tr:e,dispatch:n})=>{let{from:r,to:o}=t;return n&&e.delete(r,o),!0},$J=t=>t.content?/^text(\\*|\\+)/.test(t.content):!1,sz=(t,e,n)=>{if(!t.parent.isInline||n===\"left\"&&t.pos>t.start()||n===\"right\"&&t.pos<t.end())return t.pos;let r=e.nodes[t.parent.type.name].spec;return $J(r)?n===\"left\"?t.start()-1:t.end()+1:t.pos},UJ=(t,e,n)=>({from:sz(t,n,\"left\"),to:sz(e,n,\"right\")}),jJ=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){let n=t.tr,{ranges:r}=t.selection,o=n.steps.length;r.forEach(s=>{let a=n.mapping.slice(o),i=n.doc.resolve(a.map(s.$from.pos)),l=n.doc.resolve(a.map(s.$to.pos)),{from:u,to:c}=UJ(i,l,t.schema);n.deleteRange(u,c)}),n.selection.empty||n.setSelection(J.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},qJ=()=>({commands:t})=>t.keyboardShortcut(\"Enter\"),VJ=()=>({state:t,dispatch:e})=>Am(t,e);function uA(t){return Object.prototype.toString.call(t)===\"[object RegExp]\"}function Kx(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:uA(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function wz(t,e,n={}){return t.find(r=>r.type===e&&Kx(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function az(t,e,n={}){return!!wz(t,e,n)}function cA(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(l=>l.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(l=>l.type===e))return;if(!n){let l=r.node.marks.find(u=>u.type===e);l&&(n=l.attrs)}if(!wz([...r.node.marks],e,n))return;let o=r.index,s=t.start()+r.offset,a=o+1,i=s+r.node.nodeSize;for(;o>0&&az([...t.parent.child(o-1).marks],e,n);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&az([...t.parent.child(a).marks],e,n);)i+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:i}}function Pa(t,e){if(typeof t==\"string\"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var KJ=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=Pa(t,r.schema),{doc:a,selection:i}=n,{$from:l,from:u,to:c}=i;if(o){let d=cA(l,s,e);if(d&&d.from<=u&&d.to>=c){let f=J.create(a,d.from,d.to);n.setSelection(f)}}return!0},GJ=t=>e=>{let n=typeof t==\"function\"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Sz(t){return t instanceof J}function Ru(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function WJ(t,e=null){if(!e)return null;let n=pe.atStart(t),r=pe.atEnd(t);if(e===\"start\"||e===!0)return n;if(e===\"end\")return r;let o=n.from,s=r.to;return e===\"all\"?J.create(t,Ru(0,o,s),Ru(t.content.size,o,s)):J.create(t,Ru(e,o,s),Ru(e,o,s))}function iz(){return[\"Android\"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function Gx(){return[\"iPad Simulator\",\"iPhone Simulator\",\"iPod Simulator\",\"iPad\",\"iPhone\",\"iPod\"].includes(navigator.platform)||navigator.userAgent.includes(\"Mac\")&&\"ontouchend\"in document}function XJ(){return typeof navigator<\"u\"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var JJ=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};let a=()=>{(Gx()||iz())&&r.dom.focus(),XJ()&&!Gx()&&!iz()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!Sz(n.state.selection))return a(),!0;let i=WJ(o.doc,t)||n.state.selection,l=n.state.selection.eq(i);return s&&(l||o.setSelection(i),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},YJ=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),ZJ=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),kz=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\\n\\s\\s|\\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&kz(r)}return t};function Ux(t){if(typeof window>\"u\")throw new Error(\"[tiptap error]: there is no window object available, so this function cannot be used\");let e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,\"text/html\").body;return kz(n)}function Cz(t){return typeof t?.nodesBetween==\"function\"}function af(t,e,n){if(Cz(t))return t;let r=typeof t==\"object\"&&t!==null;n={slice:!0,parseOptions:{},...n};let o=typeof t==\"string\";if(r)try{if(Array.isArray(t)&&t.length>0)return H.fromArray(t.map(a=>e.nodeFromJSON(a)));let s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(s){if(n.errorOnInvalidContent)throw new Error(\"[tiptap error]: Invalid JSON content\",{cause:s});return console.warn(\"[tiptap warn]: Invalid content.\",\"Passed value:\",t,\"Error:\",s),af(\"\",e,n)}if(o){if(n.errorOnInvalidContent){let a=!1,i=\"\",l=new _i({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:\"inline*\",group:\"block\",parseDOM:[{tag:\"*\",getAttrs:u=>(a=!0,i=typeof u==\"string\"?u:u.outerHTML,null)}]}})});if(n.slice?Xr.fromSchema(l).parseSlice(Ux(t),n.parseOptions):Xr.fromSchema(l).parse(Ux(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error(\"[tiptap error]: Invalid HTML content\",{cause:new Error(`Invalid element found: ${i}`)})}let s=Xr.fromSchema(e);return n.slice?s.parseSlice(Ux(t),n.parseOptions).content:s.parse(Ux(t),n.parseOptions)}return af(\"\",e,n)}function Lz(t){return!(\"type\"in t)}function Az(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Rt||o instanceof Bt))return;let s=t.mapping.maps[r],a=0;s.forEach((i,l,u,c)=>{a===0&&(a=c)}),t.setSelection(pe.near(t.doc.resolve(a),n))}var QJ=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,l=m=>{s.emit(\"contentError\",{editor:s,error:m,disableCollaboration:()=>{\"collaboration\"in s.storage&&typeof s.storage.collaboration==\"object\"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:\"full\",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{af(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(m){l(m)}try{var a;i=af(e,s.schema,{parseOptions:u,errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck})}catch(m){return l(m),!1}let{from:c,to:d}=typeof t==\"number\"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0,h=Lz(i)?i.content:[i];if(h.forEach(m=>{m.check(),f=f?m.isText&&m.marks.length===0:!1,p=p?m.isBlock:!1}),c===d&&p){let{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,d+=1)}let g;if(f)Array.isArray(e)?g=e.map(m=>m.text||\"\").join(\"\"):Cz(e)?g=h.map(m=>{var y;return(y=m.text)!==null&&y!==void 0?y:\"\"}).join(\"\"):typeof e==\"object\"&&e&&e.text?g=e.text:g=e,r.insertText(g,c,d);else{g=H.from(h);let m=r.doc.resolve(c),y=m.node(),b=m.parentOffset===0,x=y.isText||y.isTextblock,v=y.content.size>0;b&&x&&v&&p&&(c=Math.max(0,c-1)),r.replaceWith(c,d,h)}n.updateSelection&&Az(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(\"applyInputRules\",{from:c,text:g}),n.applyPasteRules&&r.setMeta(\"applyPasteRules\",{from:c,text:g})}return!0};function Ez(t){for(let e=0;e<t.edgeCount;e+=1){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var eY=(t={})=>({tr:e,dispatch:n,editor:r})=>{let{pos:o,attrs:s,content:a,updateSelection:i=!0}=t,l;typeof o==\"number\"?l=e.doc.resolve(o):o?l=o:l=e.selection.$from;let u=Ez(l.parent.contentMatchAt(l.index()));if(!u)return!1;let c=Object.keys(u.spec.attrs||{}),d=s?Object.fromEntries(Object.entries(s).filter(([p])=>c.includes(p))):{},f;if(a){let p=af(a,r.schema);f=u.createAndFill(d,p)}else f=u.createAndFill(d);return f?(n&&(e.insert(l.pos,f),i&&Az(e,e.steps.length-1,-1)),!0):!1},tY=()=>({state:t,dispatch:e})=>Uv(t,e),nY=()=>({state:t,dispatch:e})=>jv(t,e),rY=()=>({state:t,dispatch:e})=>wm(t,e),oY=()=>({state:t,dispatch:e})=>km(t,e),Tz=(t,e)=>{let n=t.resolve(e),r=n.nodeBefore,o=n.nodeAfter;return!r||!o?!1:!r.type.spec.isolating&&!o.type.spec.isolating},sY=()=>({state:t,dispatch:e,tr:n})=>{try{let r=La(t.doc,t.selection.$from.pos,-1);return r==null||!Tz(t.doc,r)?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},aY=()=>({state:t,dispatch:e,tr:n})=>{try{let r=La(t.doc,t.selection.$from.pos,1);return r==null||!Tz(t.doc,r)?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},iY=()=>({state:t,dispatch:e})=>Hv(t,e),lY=()=>({state:t,dispatch:e})=>$v(t,e);function Rz(){return typeof navigator<\"u\"?/Mac/.test(navigator.platform):!1}function uY(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n===\"Space\"&&(n=\" \");let r,o,s,a;for(let i=0;i<e.length-1;i+=1){let l=e[i];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Gx()||Rz()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var cY=t=>({editor:e,view:n,tr:r,dispatch:o})=>{let s=uY(t).split(/-(?!$)/),a=s.find(u=>![\"Alt\",\"Ctrl\",\"Meta\",\"Shift\"].includes(u)),i=new KeyboardEvent(\"keydown\",{key:a===\"Space\"?\" \":a,altKey:s.includes(\"Alt\"),ctrlKey:s.includes(\"Ctrl\"),metaKey:s.includes(\"Meta\"),shiftKey:s.includes(\"Shift\"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp(\"handleKeyDown\",u=>u(n,i))});return l?.steps.forEach(u=>{let c=u.map(r.mapping);c&&o&&r.maybeStep(c)}),!0};function Wi(t,e,n={}){let{from:r,to:o,empty:s}=t.selection,a=e?nn(e,t.schema):null,i=[];t.doc.nodesBetween(r,o,(c,d)=>{if(c.isText)return;let f=Math.max(r,d),p=Math.min(o,d+c.nodeSize);i.push({node:c,from:f,to:p})});let l=o-r,u=i.filter(c=>a?a.name===c.node.type.name:!0).filter(c=>Kx(c.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((c,d)=>c+d.to-d.from,0)>=l}var dY=(t,e={})=>({state:n,dispatch:r})=>Wi(n,nn(t,n.schema),e)?qv(n,r):!1,fY=()=>({state:t,dispatch:e})=>Tm(t,e),pY=t=>({state:e,dispatch:n})=>{let r=nn(t,e.schema);return Wv(r)(e,n)},hY=()=>({state:t,dispatch:e})=>Lm(t,e);function dA(t,e){return e.nodes[t]?\"node\":e.marks[t]?\"mark\":null}function lz(t,e){let n=typeof e==\"string\"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}var mY=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,a=null,i=dA(typeof t==\"string\"?t:t.name,r.schema);if(!i)return!1;i===\"node\"&&(s=nn(t,r.schema)),i===\"mark\"&&(a=Pa(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,d)=>{s&&s===c.type&&(l=!0,o&&n.setNodeMarkup(d,void 0,lz(c.attrs,e))),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&(l=!0,o&&n.addMark(d,d+c.nodeSize,a.create(lz(f.attrs,e))))})})}),l},gY=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),yY=()=>({tr:t,dispatch:e})=>{if(e){let n=new Mn(t.doc);t.setSelection(n)}return!0},bY=()=>({state:t,dispatch:e})=>Sm(t,e),vY=()=>({state:t,dispatch:e})=>Cm(t,e),xY=()=>({state:t,dispatch:e})=>Vv(t,e),wY=()=>({state:t,dispatch:e})=>Im(t,e),SY=()=>({state:t,dispatch:e})=>Rm(t,e);function kY(t,e,n={},r={}){return af(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var CY=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:a,commands:i})=>{let{doc:l}=s;if(r.preserveWhitespace!==\"full\"){let u=kY(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});if(a){let c=Lz(u)?u.content:[u];s.replaceWith(0,l.content.size,c).setMeta(\"preventUpdate\",!n)}return!0}return a&&s.setMeta(\"preventUpdate\",!n),i.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function Iz(t,e){let n=Pa(e,t.schema),{from:r,to:o,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{a.push(...l.marks)});let i=a.find(l=>l.type.name===n.name);return i?{...i.attrs}:{}}function fA(t,e){let n=new Oi(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function Mz(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function LY(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Xx(t){return e=>LY(e.$from,t)}function se(t,e,n){return t.config[e]===void 0&&t.parent?se(t.parent,e,n):typeof t.config[e]==\"function\"?t.config[e].bind({...n,parent:t.parent?se(t.parent,e,n):null}):t.config[e]}function pA(t){return t.map(e=>{let n=se(e,\"addExtensions\",{name:e.name,options:e.options,storage:e.storage});return n?[e,...pA(n())]:e}).flat(10)}function _z(t,e){let n=Wo.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement(\"div\");return r.appendChild(n),r.innerHTML}function AY(t){return typeof t==\"function\"}function Ze(t,e=void 0,...n){return AY(t)?e?t.bind(e)(...n):t(...n):t}function EY(t={}){return Object.keys(t).length===0&&t.constructor===Object}function lf(t){return{baseExtensions:t.filter(e=>e.type===\"extension\"),nodeExtensions:t.filter(e=>e.type===\"node\"),markExtensions:t.filter(e=>e.type===\"mark\")}}function Oz(t){let e=[],{nodeExtensions:n,markExtensions:r}=lf(t),o=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},a=n.filter(u=>u.name!==\"text\").map(u=>u.name),i=r.map(u=>u.name),l=[...a,...i];return t.forEach(u=>{let c=se(u,\"addGlobalAttributes\",{name:u.name,options:u.options,storage:u.storage,extensions:o});c&&c().forEach(d=>{let f;Array.isArray(d.types)?f=d.types:d.types===\"*\"?f=l:d.types===\"nodes\"?f=a:d.types===\"marks\"?f=i:f=[],f.forEach(p=>{Object.entries(d.attributes).forEach(([h,g])=>{e.push({type:p,name:h,attribute:{...s,...g}})})})})}),o.forEach(u=>{let c=se(u,\"addAttributes\",{name:u.name,options:u.options,storage:u.storage});if(!c)return;let d=c();Object.entries(d).forEach(([f,p])=>{let h={...s,...p};typeof h?.default==\"function\"&&(h.default=h.default()),h?.isRequired&&h?.default===void 0&&delete h.default,e.push({type:u.name,name:f,attribute:h})})}),e}function TY(t){let e=[],n=\"\",r=!1,o=!1,s=0,a=t.length;for(let i=0;i<a;i+=1){let l=t[i];if(l===\"'\"&&!o){r=!r,n+=l;continue}if(l==='\"'&&!r){o=!o,n+=l;continue}if(!r&&!o){if(l===\"(\"){s+=1,n+=l;continue}if(l===\")\"&&s>0){s-=1,n+=l;continue}if(l===\";\"&&s===0){e.push(n),n=\"\";continue}}n+=l}return n&&e.push(n),e}function uz(t){let e=[],n=TY(t||\"\"),r=n.length;for(let o=0;o<r;o+=1){let s=n[o],a=s.indexOf(\":\");if(a===-1)continue;let i=s.slice(0,a).trim(),l=s.slice(a+1).trim();i&&l&&e.push([i,l])}return e}function We(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([o,s])=>{if(o===\"__proto__\"){Object.defineProperty(r,o,{configurable:!0,enumerable:!0,value:s,writable:!0});return}if(!r[o]){r[o]=s;return}if(o===\"class\"){let a=s?String(s).split(\" \"):[],i=r[o]?r[o].split(\" \"):[],l=a.filter(u=>!i.includes(u));r[o]=[...i,...l].join(\" \")}else if(o===\"style\"){let a=new Map([...uz(r[o]),...uz(s)]);r[o]=Array.from(a.entries()).map(([i,l])=>`${i}: ${l}`).join(\"; \")}else r[o]=s}),r},{})}function uf(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>We(n,r),{})}function RY(t){return typeof t!=\"string\"?t:t.match(/^[+-]?(?:\\d*\\.)?\\d+$/)?Number(t):t===\"true\"?!0:t===\"false\"?!1:t}function cz(t,e){return\"style\"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let o=e.reduce((s,a)=>{let i=a.attribute.parseHTML?a.attribute.parseHTML(n):RY(n.getAttribute(a.name));return i==null?s:{...s,[a.name]:i}},{});return{...r,...o}}}}function dz(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e===\"attrs\"&&EY(n)?!1:n!=null))}function fz(t){var e,n;let r={};return!(!(t==null||(e=t.attribute)===null||e===void 0)&&e.isRequired)&&\"default\"in(t?.attribute||{})&&(r.default=t.attribute.default),(t==null||(n=t.attribute)===null||n===void 0?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function IY(t,e){var n;let r=Oz(t),{nodeExtensions:o,markExtensions:s}=lf(t),a=(n=o.find(u=>se(u,\"topNode\")))===null||n===void 0?void 0:n.name,i=Object.fromEntries(o.map(u=>{let c=r.filter(m=>m.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=dz({...t.reduce((m,y)=>{let b=se(y,\"extendNodeSchema\",d);return{...m,...b?b(u):{}}},{}),content:Ze(se(u,\"content\",d)),marks:Ze(se(u,\"marks\",d)),group:Ze(se(u,\"group\",d)),inline:Ze(se(u,\"inline\",d)),atom:Ze(se(u,\"atom\",d)),selectable:Ze(se(u,\"selectable\",d)),draggable:Ze(se(u,\"draggable\",d)),code:Ze(se(u,\"code\",d)),whitespace:Ze(se(u,\"whitespace\",d)),linebreakReplacement:Ze(se(u,\"linebreakReplacement\",d)),defining:Ze(se(u,\"defining\",d)),isolating:Ze(se(u,\"isolating\",d)),attrs:Object.fromEntries(c.map(fz))}),p=Ze(se(u,\"parseHTML\",d));p&&(f.parseDOM=p.map(m=>cz(m,c)));let h=se(u,\"renderHTML\",d);h&&(f.toDOM=m=>h({node:m,HTMLAttributes:uf(m,c)}));let g=se(u,\"renderText\",d);return g&&(f.toText=g),[u.name,f]})),l=Object.fromEntries(s.map(u=>{let c=r.filter(g=>g.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=dz({...t.reduce((g,m)=>{let y=se(m,\"extendMarkSchema\",d);return{...g,...y?y(u):{}}},{}),inclusive:Ze(se(u,\"inclusive\",d)),excludes:Ze(se(u,\"excludes\",d)),group:Ze(se(u,\"group\",d)),spanning:Ze(se(u,\"spanning\",d)),code:Ze(se(u,\"code\",d)),attrs:Object.fromEntries(c.map(fz))}),p=Ze(se(u,\"parseHTML\",d));p&&(f.parseDOM=p.map(g=>cz(g,c)));let h=se(u,\"renderHTML\",d);return h&&(f.toDOM=g=>h({mark:g,HTMLAttributes:uf(g,c)})),[u.name,f]}));return new _i({topNode:a,nodes:i,marks:l})}function MY(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Zm(t){return t.sort((n,r)=>{let o=se(n,\"priority\")||100,s=se(r,\"priority\")||100;return o>s?-1:o<s?1:0})}function Dz(t){let e=Zm(pA(t)),n=MY(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(\", \")}]. This can lead to issues.`),e}function _Y(t,e,n){let{from:r,to:o}=e,{blockSeparator:s=`\n\n`,textSerializers:a={}}=n||{},i=\"\";return t.nodesBetween(r,o,(l,u,c,d)=>{l.isBlock&&u>r&&(i+=s);let f=a?.[l.type.name];if(f)return c&&(i+=f({node:l,pos:u,parent:c,index:d,range:e})),!1;if(l.isText){var p;i+=l==null||(p=l.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,o-u)}}),i}function OY(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function DY(t,e){let n=nn(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,i=>{s.push(i)});let a=s.reverse().find(i=>i.type.name===n.name);return a?{...a.attrs}:{}}function Nz(t,e){let n=dA(typeof e==\"string\"?e:e.name,t.schema);return n===\"node\"?DY(t,e):n===\"mark\"?Iz(t,e):{}}function NY(t,e=JSON.stringify){let n={};return t.filter(r=>{let o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function PY(t){let e=NY(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function cf(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{let a=[];if(o.ranges.length)o.forEach((i,l)=>{a.push({from:i,to:l})});else{let{from:i,to:l}=n[s];if(i===void 0||l===void 0)return;a.push({from:i,to:l})}a.forEach(({from:i,to:l})=>{let u=e.slice(s).map(i,-1),c=e.slice(s).map(l),d=e.invert().map(u,-1),f=e.invert().map(c);r.push({oldRange:{from:d,to:f},newRange:{from:u,to:c}})})}),PY(r)}function Qm(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(o=>{let s=cA(n.resolve(t),o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,s)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(a=>({from:s,to:s+o.nodeSize,mark:a})))}),r}var Pz=(t,e,n,r=20)=>{let o=t.doc.resolve(n),s=r,a=null;for(;s>0&&a===null;){let i=o.node(s);i?.type.name===e?a=i:s-=1}return[a,s]},Bz=t=>{let e=t.depth-1;if(e<0)return null;let n=t.index(e);return n===0?null:t.node(e).child(n-1)};function rf(t,e){return e.nodes[t]||e.marks[t]||null}function Vx(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}var BY=(t,e=500)=>{let n=\"\",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,a,i)=>{var l,u;let c=((l=(u=o.type.spec).toText)===null||l===void 0?void 0:l.call(u,{node:o,pos:s,parent:a,index:i}))||o.textContent||\"%leaf%\";n+=o.isAtom&&!o.isText?c:c.slice(0,Math.max(0,r-s))}),n};function zY(t,e,n={}){let{empty:r,ranges:o}=t.selection,s=e?Pa(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(c=>s?s.name===c.type.name:!0).find(c=>Kx(c.attrs,n,{strict:!1}));let a=0,i=[];if(o.forEach(({$from:c,$to:d})=>{let f=c.pos,p=d.pos;t.doc.nodesBetween(f,p,(h,g)=>{if(s&&h.inlineContent&&!h.type.allowsMarkType(s))return!1;if(!h.isText&&!h.marks.length)return;let m=Math.max(f,g),y=Math.min(p,g+h.nodeSize),b=y-m;a+=b,i.push(...h.marks.map(x=>({mark:x,from:m,to:y})))})}),a===0)return!1;let l=i.filter(c=>s?s.name===c.mark.type.name:!0).filter(c=>Kx(c.mark.attrs,n,{strict:!1})).reduce((c,d)=>c+d.to-d.from,0),u=i.filter(c=>s?c.mark.type!==s&&c.mark.type.excludes(s):!0).reduce((c,d)=>c+d.to-d.from,0);return(l>0?l+u:l)>=a}var zz=(t,e)=>{let{$from:n,$to:r,$anchor:o}=t.selection;if(e){let s=Xx(i=>i.type.name===e)(t.selection);if(!s)return!1;let a=t.doc.resolve(s.pos+1);return o.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Fz=t=>{let{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function pz(t,e){return Array.isArray(e)?e.some(n=>(typeof n==\"string\"?n:n.name)===t.name):e}function sA(t,e){let{nodeExtensions:n}=lf(e),r=n.find(s=>s.name===t);if(!r)return!1;let o=Ze(se(r,\"group\",{name:r.name,options:r.options,storage:r.storage}));return typeof o!=\"string\"?!1:o.split(\" \").includes(\"list\")}function eg(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){if(n){if(t.type.name===\"hardBreak\")return!0;if(t.isText){var r;return!/\\S/.test((r=t.text)!==null&&r!==void 0?r:\"\")}}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(s=>{o!==!1&&(eg(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function Jx(t){return t instanceof oe}function FY(t,e,n){let{selection:r}=e,o=null;if(Sz(r)&&(o=r.$cursor),o){var s;let i=(s=t.storedMarks)!==null&&s!==void 0?s:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(i)||!i.some(l=>l.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:i,$to:l})=>{let u=i.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(i.pos,l.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){let p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(c.marks)||!c.marks.some(g=>g.type.excludes(n));u=p&&h}return!u}),u})}var HY=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let{selection:s}=n,{empty:a,ranges:i}=s,l=Pa(t,r.schema);if(o)if(a){let u=Iz(r,l);n.addStoredMark(l.create({...u,...e}))}else i.forEach(u=>{let c=u.$from.pos,d=u.$to.pos;r.doc.nodesBetween(c,d,(f,p)=>{let h=Math.max(p,c),g=Math.min(p+f.nodeSize,d);f.marks.find(m=>m.type===l)?f.marks.forEach(m=>{l===m.type&&n.addMark(h,g,l.create({...m.attrs,...e}))}):n.addMark(h,g,l.create(e))})});return FY(r,n,l)},$Y=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),UY=(t,e={})=>({state:n,dispatch:r,chain:o})=>{let s=nn(t,n.schema),a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:i})=>zd(s,{...a,...e})(n)?!0:i.clearNodes()).command(({state:i})=>zd(s,{...a,...e})(i,r)).run():(console.warn('[tiptap warn]: Currently \"setNode()\" only supports text block nodes.'),!1)},jY=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,o=Ru(t,0,r.content.size),s=oe.create(r,o);e.setSelection(s)}return!0},qY=(t,e)=>({tr:n,state:r,dispatch:o})=>{let{selection:s}=r,a,i;return typeof e==\"number\"?(a=e,i=e):e&&\"from\"in e&&\"to\"in e?(a=e.from,i=e.to):(a=s.from,i=s.to),o&&n.doc.nodesBetween(a,i,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},VY=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:o,to:s}=typeof t==\"number\"?{from:t,to:t}:t,a=J.atStart(r).from,i=J.atEnd(r).to,l=Ru(o,a,i),u=Ru(s,a,i),c=J.create(r,l,u);e.setSelection(c)}return!0},KY=t=>({state:e,dispatch:n})=>{let r=nn(t,e.schema);return Xv(r)(e,n)};function hz(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}var GY=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{let{selection:s,doc:a}=e,{$from:i,$to:l}=s,u=o.extensionManager.attributes,c=Vx(u,i.node().type.name,i.node().attrs);if(s instanceof oe&&s.node.isBlock)return!i.parentOffset||!In(a,i.pos)?!1:(r&&(t&&hz(n,o.extensionManager.splittableMarks),e.split(i.pos).scrollIntoView()),!0);if(!i.parent.isBlock)return!1;let d=l.parentOffset===l.parent.content.size,f=i.depth===0?void 0:Ez(i.node(-1).contentMatchAt(i.indexAfter(-1))),p=d&&f?[{type:f,attrs:c}]:void 0,h=s instanceof J&&!s.empty?Cs.create({doc:e.doc,selection:s}).tr.deleteSelection():null,g=h?h.doc:e.doc,m=h?h.mapping.map(i.pos):i.pos,y=In(g,m,1,p);if(!p&&!y&&In(g,m,1,f?[{type:f}]:void 0)&&(y=!0,p=f?[{type:f,attrs:c}]:void 0),r){if(y){let b=e.steps.length;if(s instanceof J&&e.deleteSelection(),e.split(e.mapping.slice(b).map(i.pos),1,p),f&&!d&&!i.parentOffset&&i.parent.type!==f){let x=e.mapping.slice(b).map(i.before()),v=e.doc.resolve(x);i.node(-1).canReplaceWith(v.index(),v.index()+1,f)&&e.setNodeMarkup(e.mapping.slice(b).map(i.before()),f)}}t&&hz(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return y},WY=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{let a=nn(t,r.schema),{$from:i,$to:l}=r.selection,u=r.selection.node;if(u&&u.isBlock||i.depth<2||!i.sameParent(l))return!1;let c=i.node(-1);if(c.type!==a)return!1;let d=s.extensionManager.attributes;if(i.parent.content.size===0&&i.node(-1).childCount===i.indexAfter(-1)){if(i.depth===2||i.node(-3).type!==a||i.index(-2)!==i.node(-2).childCount-1)return!1;if(o){var f;let v=H.empty,S=i.index(-1)?1:i.index(-2)?2:3;for(let _=i.depth-S;_>=i.depth-3;_-=1)v=H.from(i.node(_).copy(v));let E=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3,w={...Vx(d,i.node().type.name,i.node().attrs),...e},k=((f=a.contentMatch.defaultType)===null||f===void 0?void 0:f.createAndFill(w))||void 0;v=v.append(H.from(a.createAndFill(null,k)||void 0));let A=i.before(i.depth-(S-1));n.replace(A,i.after(-E),new G(v,4-S,0));let L=-1;n.doc.nodesBetween(A,n.doc.content.size,(_,P)=>{if(L>-1)return!1;_.isTextblock&&_.content.size===0&&(L=P+1)}),L>-1&&n.setSelection(J.near(n.doc.resolve(L))),n.scrollIntoView()}return!0}let p=l.pos===i.end()?c.contentMatchAt(0).defaultType:null,h={...Vx(d,c.type.name,c.attrs),...e},g={...Vx(d,i.node().type.name,i.node().attrs),...e},m=i.parentOffset===0&&i.index(-1)===0,y=i.before(-1);n.delete(i.pos,l.pos);let b=m?c.attrs:h,x=p?[{type:a,attrs:b},{type:p,attrs:g}]:[{type:a,attrs:b}];if(!In(n.doc,i.pos,2))return!1;if(o){let{selection:v,storedMarks:S}=r,{splittableMarks:E}=s.extensionManager,w=S||v.$to.parentOffset&&v.$from.marks();if(n.split(i.pos,2,x).scrollIntoView(),m&&n.setNodeMarkup(y,void 0,h),!w||!o)return!0;let k=w.filter(A=>E.includes(A.type.name));n.ensureMarks(k)}return!0};function mz(t){return!t||t===\"1\"?null:t}function Hz(t,e){return mz(t)===mz(e)}var aA=(t,e)=>{let n=Xx(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let o=t.doc.nodeAt(r);return!(n.node.type===o?.type&&ir(t.doc,n.pos))||!Hz(n.node.attrs.type,o?.attrs.type)||t.join(n.pos),!0},iA=(t,e)=>{let n=Xx(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let o=t.doc.nodeAt(r);return!(n.node.type===o?.type&&ir(t.doc,r))||!Hz(n.node.attrs.type,o?.attrs.type)||t.join(r),!0};function XY(t){let e=t.doc,n=e.firstChild;if(!n)return null;let r=e.resolve(1),o=e.resolve(n.nodeSize-1);return J.between(r,o)}var JY=(t,e,n,r={})=>({editor:o,tr:s,state:a,dispatch:i,chain:l,commands:u,can:c})=>{let{extensions:d,splittableMarks:f}=o.extensionManager,p=nn(t,a.schema),h=nn(e,a.schema),{selection:g,storedMarks:m}=a,{$from:y,$to:b}=g,x=y.blockRange(b),v=m||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let S=Xx(D=>sA(D.type.name,d))(g),E=g.from===0&&g.to===a.doc.content.size,w=a.doc.content.content,k=w.length===1?w[0]:null,A=E&&k&&sA(k.type.name,d)?{node:k,pos:0,depth:0}:null,L=S??A,_=!!S&&x.depth>=1&&x.depth-S.depth<=1,P=!!A;if((_||P)&&L){if(L.node.type===p)return E&&P?l().command(({tr:D,dispatch:F})=>{let j=XY(D);return j?(D.setSelection(j),F&&F(D),!0):!1}).liftListItem(h).run():u.liftListItem(h);if(sA(L.node.type.name,d)&&p.validContent(L.node.content))return l().command(()=>(s.setNodeMarkup(L.pos,p),!0)).command(()=>aA(s,p)).command(()=>iA(s,p)).run()}return!n||!v||!i?l().command(()=>c().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>aA(s,p)).command(()=>iA(s,p)).run():l().command(()=>{let D=c().wrapInList(p,r),F=v.filter(j=>f.includes(j.type.name));return s.ensureMarks(F),D?!0:u.clearNodes()}).wrapInList(p,r).command(()=>aA(s,p)).command(()=>iA(s,p)).run()},YY=(t,e={},n={})=>({state:r,commands:o})=>{let{extendEmptyMarkRange:s=!1}=n,a=Pa(t,r.schema);return zY(r,a,e)?o.unsetMark(a,{extendEmptyMarkRange:s}):o.setMark(a,e)},ZY=(t,e,n={})=>({state:r,commands:o})=>{let s=nn(t,r.schema),a=nn(e,r.schema),i=Wi(r,s,n),l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),i?o.setNode(a,l):o.setNode(s,{...l,...n})},QY=(t,e={})=>({state:n,commands:r})=>{let o=nn(t,n.schema);return Wi(n,o,e)?r.lift(o):r.wrapIn(o,e)},eZ=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r<n.length;r+=1){let o=n[r],s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){let a=t.tr,i=s.transform;for(let l=i.steps.length-1;l>=0;l-=1)a.step(i.steps[l].invert(i.docs[l]));if(s.text){let l=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else a.delete(s.from,s.to)}return!0}}return!1},tZ=(t={})=>({tr:e,dispatch:n,editor:r})=>{let{ignoreClearable:o=!1}=t,{selection:s}=e,{empty:a,ranges:i}=s;if(a)return!0;let{nonClearableMarks:l}=r.extensionManager;if(n){let u=Object.values(r.schema.marks).filter(c=>o||!l.includes(c.name));i.forEach(c=>{for(let d of u)e.removeMark(c.$from.pos,c.$to.pos,d)})}return!0},nZ=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,i=Pa(t,r.schema),{$from:l,empty:u,ranges:c}=a;if(!o)return!0;if(u&&s){var d;let{from:f,to:p}=a,h=cA(l,i,(d=l.marks().find(g=>g.type===i))===null||d===void 0?void 0:d.attrs);h&&(f=h.from,p=h.to),n.removeMark(f,p,i)}else c.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,i)});return n.removeStoredMark(i),!0},rZ=t=>({tr:e,state:n,dispatch:r})=>{let{selection:o}=n,s,a;return typeof t==\"number\"?(s=t,a=t):t&&\"from\"in t&&\"to\"in t?(s=t.from,a=t.to):(s=o.from,a=o.to),r&&e.doc.nodesBetween(s,a,(i,l)=>{if(i.isText)return;let u={...i.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},oZ=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,a=null,i=dA(typeof t==\"string\"?t:t.name,r.schema);if(!i)return!1;i===\"node\"&&(s=nn(t,r.schema)),i===\"mark\"&&(a=Pa(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{let c=u.$from.pos,d=u.$to.pos,f,p,h,g;n.selection.empty?r.doc.nodesBetween(c,d,(m,y)=>{s&&s===m.type&&(l=!0,h=Math.max(y,c),g=Math.min(y+m.nodeSize,d),f=y,p=m)}):r.doc.nodesBetween(c,d,(m,y)=>{y<c&&s&&s===m.type&&(l=!0,h=Math.max(y,c),g=Math.min(y+m.nodeSize,d),f=y,p=m),y>=c&&y<=d&&(s&&s===m.type&&(l=!0,o&&n.setNodeMarkup(y,void 0,{...m.attrs,...e})),a&&m.marks.length&&m.marks.forEach(b=>{if(a===b.type&&(l=!0,o)){let x=Math.max(y,c),v=Math.min(y+m.nodeSize,d);n.addMark(x,v,a.create({...b.attrs,...e}))}}))}),p&&(f!==void 0&&o&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),a&&p.marks.length&&p.marks.forEach(m=>{a===m.type&&o&&n.addMark(h,g,a.create({...m.attrs,...e}))}))}),l},sf=new we(\"__tiptap_decorations__\"),sZ=t=>({tr:e,dispatch:n})=>(n&&e.setMeta(sf,{type:\"force\",name:t}),!0),aZ=(t,e={})=>({state:n,dispatch:r})=>{let o=nn(t,n.schema);return Kv(o,e)(n,r)},iZ=(t,e={})=>({state:n,dispatch:r})=>{let o=nn(t,n.schema);return Gv(o,e)(n,r)},lZ=oz({blur:()=>_J,clearContent:()=>OJ,clearNodes:()=>DJ,command:()=>NJ,createParagraphNear:()=>PJ,cut:()=>BJ,deleteCurrentNode:()=>zJ,deleteNode:()=>FJ,deleteRange:()=>HJ,deleteSelection:()=>jJ,enter:()=>qJ,exitCode:()=>VJ,extendMarkRange:()=>KJ,first:()=>GJ,focus:()=>JJ,forEach:()=>YJ,insertContent:()=>ZJ,insertContentAt:()=>QJ,insertDefaultBlock:()=>eY,joinBackward:()=>rY,joinDown:()=>nY,joinForward:()=>oY,joinItemBackward:()=>sY,joinItemForward:()=>aY,joinTextblockBackward:()=>iY,joinTextblockForward:()=>lY,joinUp:()=>tY,keyboardShortcut:()=>cY,lift:()=>dY,liftEmptyBlock:()=>fY,liftListItem:()=>pY,newlineInCode:()=>hY,resetAttributes:()=>mY,scrollIntoView:()=>gY,selectAll:()=>yY,selectNodeBackward:()=>bY,selectNodeForward:()=>vY,selectParentNode:()=>xY,selectTextblockEnd:()=>wY,selectTextblockStart:()=>SY,setContent:()=>CY,setMark:()=>HY,setMeta:()=>$Y,setNode:()=>UY,setNodeSelection:()=>jY,setTextDirection:()=>qY,setTextSelection:()=>VY,sinkListItem:()=>KY,splitBlock:()=>GY,splitListItem:()=>WY,toggleList:()=>JY,toggleMark:()=>YY,toggleNode:()=>ZY,toggleWrap:()=>QY,undoInputRule:()=>eZ,unsetAllMarks:()=>tZ,unsetMark:()=>nZ,unsetTextDirection:()=>rZ,updateAttributes:()=>oZ,updateDecorations:()=>sZ,wrapIn:()=>aZ,wrapInList:()=>iZ}),Ym=new WeakMap;function uZ(t,e){var n;Ym.set(t,((n=Ym.get(t))!==null&&n!==void 0?n:0)+1);try{return e()}finally{var r;let o=((r=Ym.get(t))!==null&&r!==void 0?r:1)-1;o>0?Ym.set(t,o):Ym.delete(t)}}var cZ=typeof process<\"u\"&&!1;function dZ(t){return t.kind===\"widget\"}function $z(t,e){let n=[],r=new Set;for(let o of t)o.kind===\"widget\"&&dZ(o)&&r.add(o.key),n.push(o.toPMDecoration(e));return{decorations:n,widgetKeys:r}}function fZ(t,e,n){let{decorations:r,widgetKeys:o}=$z(e,n);return{set:He.create(t,r),widgetKeys:o}}function Uz({position:t,from:e,to:n,docSize:r}){return t<e?!1:t<n?!0:t===n&&n===r}function pZ({decorations:t,from:e,to:n,docSize:r,extensionName:o,warnedExtensions:s}){return t.filter(a=>Uz({position:a.anchor,from:e,to:n,docSize:r})?!0:(a.anchor===n||s.has(o)||(s.add(o),console.warn(`[tiptap warn]: Extension \"${o}\" returned a decoration outside the requested range [${e}, ${n}). It was ignored.`)),!1))}function jz(t){var e;let n=(e=t.spec)===null||e===void 0?void 0:e.key;return typeof n==\"string\"?n:void 0}function hZ(t){let e=new Map,n=new Map;for(let a of t.find()){var r,o,s;let i=jz(a);if(!i)continue;let l=(r=a.spec.extensionName)!==null&&r!==void 0?r:\"unknown\",u=(o=e.get(i))!==null&&o!==void 0?o:new Set;u.add(l),e.set(i,u),n.set(i,((s=n.get(i))!==null&&s!==void 0?s:0)+1)}return Array.from(e,([a,i])=>({key:a,extensions:i})).filter(({key:a})=>{var i;return((i=n.get(a))!==null&&i!==void 0?i:0)>1})}function qz(t){return t.jsonID===\"attr\"}function mZ(t){let e=!1;if(t.getMap().forEach(()=>{e=!0}),e||qz(t))return!0;let n=t;return typeof n.from==\"number\"&&typeof n.to==\"number\"}function gZ(t,e){let n=null,r=0,o=0;for(let s=0;s<t.childCount&&!(o>e.to);s+=1){let a=o+t.child(s).nodeSize;a>=e.from&&(n===null&&(n=o),r=a),o=a}return n===null?null:{from:n,to:r}}function yZ(t,e){if(t.steps.some(s=>!mZ(s)))return{type:\"full\"};let n=cf(t).map(({newRange:s})=>s);t.steps.forEach((s,a)=>{if(!qz(s))return;let i=t.mapping.slice(a);n.push({from:i.map(s.pos,-1),to:i.map(s.pos+1)})});let r=[];for(let s of n){let a=gZ(e,s);a&&r.push(a)}r.sort((s,a)=>s.from-a.from);let o=[];for(let s of r){let a=o[o.length-1];a&&s.from<=a.to?a.to=Math.max(a.to,s.to):o.push({...s})}return{type:\"ranges\",ranges:o}}function Vz(t,e,n,r){return t.map(e,n,{onRemove:o=>{let s=o?.key;typeof s==\"string\"&&r.delete(s)}})}function bZ(t,e,n){var r,o;let s=(r=e.decorationSetsByExtension[t])!==null&&r!==void 0?r:He.empty,a=new Set((o=e.widgetKeysByExtension[t])!==null&&o!==void 0?o:[]);return{set:Vz(s,n.mapping,n.doc,a),widgetKeys:a}}function gz(t,e){let n=Object.values(e).flatMap(r=>r.find());return He.create(t,n)}function yz(t){let e=new Set;for(let n of Object.values(t))for(let r of n)e.add(r);return e}function vZ(t,e){var n;switch((n=e.update)!==null&&n!==void 0?n:\"document\"){case\"document\":if(e.createInRange)throw new Error(`[tiptap error]: Extension \"${t}\" provides createInRange() but does not use the \"changedRanges\" decoration update strategy.`);return;case\"changedRanges\":if(!e.createInRange)throw new Error(`[tiptap error]: Extension \"${t}\" uses the \"changedRanges\" decoration update strategy but does not provide createInRange().`);return;case\"manual\":if(e.createInRange)throw new Error(`[tiptap error]: Extension \"${t}\" uses the \"manual\" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the \"changedRanges\" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension \"${t}\" cannot combine the \"manual\" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension \"${t}\" uses an unknown decoration update strategy. Expected \"document\", \"changedRanges\", or \"manual\".`)}}function xZ(t,e,n){return n?!0:t.update===\"manual\"?!1:t.shouldUpdate?t.shouldUpdate(e):e.tr.docChanged}var wZ=new Set;var SZ=class{constructor(t){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let n=sf.getState(e);n&&this.warnDuplicateWidgetKeys(n)},this.editor=t.editor,this.entries=this.resolveEntries(t.entries),this.entries.forEach(({name:e,spec:n})=>vZ(e,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(\"beforeTransaction\",this.handleBeforeTransaction)}destroy(){this.editor.off(\"beforeTransaction\",this.handleBeforeTransaction)}liveWidgetKeys(){var t,e;return(t=(e=sf.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&t!==void 0?t:wZ}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(t){let e=[];for(let{name:n,addDecorations:r}of t){let o=r();o&&e.push({name:n,spec:o})}return e}createPlugin(){let{editor:t,entries:e}=this;return new ie({key:sf,state:{init:(n,r)=>{let o={},s={};for(let{name:i,spec:l}of e){let{set:u,widgetKeys:c}=this.buildFullSet(i,l,r);o[i]=u,s[i]=c}let a={decorationSetsByExtension:o,widgetKeysByExtension:s,mergedDecorationSet:this.buildMergedSet(r.doc,o),widgetKeys:yz(s)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,o,s)=>{let a=n.getMeta(sf),i=a?.type===\"force\"&&!a.name,l=a?.type===\"force\"?a.name:void 0,u={},c={},d=new Set;return uZ(t,()=>{for(let{name:f,spec:p}of e){let h=i||l===f;if(xZ(p,{editor:t,tr:n,oldState:o,newState:s},h))if(p.update===\"changedRanges\"&&n.docChanged&&!h){let g=this.applyChangedRangesRecompute(f,p,r,n,s);u[f]=g.set,c[f]=g.widgetKeys,d.add(f)}else{let{set:g,widgetKeys:m}=this.buildFullSet(f,p,s);u[f]=g,c[f]=m,d.add(f)}else{let g=bZ(f,r,n);u[f]=g.set,c[f]=g.widgetKeys}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:u,widgetKeysByExtension:c,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:r,tr:n,decorationSetsByExtension:u,recomputedNames:d}),widgetKeys:yz(c)}}},props:{decorations(n){var r,o;return(r=(o=sf.getState(n))===null||o===void 0?void 0:o.mergedDecorationSet)!==null&&r!==void 0?r:He.empty}}})}applyChangedRangesRecompute(t,e,n,r,o){let s=yZ(r,o.doc);return s.type===\"full\"?this.buildFullSet(t,e,o):this.rebuildRanges(t,e,n,r,o,s.ranges)}rebuildRanges(t,e,n,r,o,s){var a,i;let l=(a=n.decorationSetsByExtension[t])!==null&&a!==void 0?a:He.empty,u=new Set((i=n.widgetKeysByExtension[t])!==null&&i!==void 0?i:[]),c=Vz(l,r.mapping,r.doc,u),d=o.doc.content.size;for(let{from:f,to:p}of s){let h=c.find(f,p).filter(y=>Uz({position:y.from,from:f,to:p,docSize:d}));for(let y of h){let b=jz(y);b&&u.delete(b)}c=c.remove(h);let{decorations:g,widgetKeys:m}=$z(pZ({decorations:this.runCreate(t,\"createInRange\",()=>e.createInRange({editor:this.editor,state:o,view:this.mountedView,from:f,to:p})),from:f,to:p,docSize:d,extensionName:t,warnedExtensions:this.warnedOutOfRangeExtensions}),t);c=c.add(o.doc,g);for(let y of m)u.add(y)}return{set:c,widgetKeys:u}}buildFullSet(t,e,n){let r=this.runCreate(t,\"create\",()=>e.create({editor:this.editor,state:n,view:this.mountedView}));return fZ(n.doc,r,t)}runCreate(t,e,n){try{return n()}catch(r){return console.error(`[tiptap error]: Extension \"${t}\" threw in \\`addDecorations().${e}()\\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(t){if(!cZ)return;if(t.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let e=hZ(t.mergedDecorationSet),n=new Set(e.map(({key:r})=>r));for(let{key:r,extensions:o}of e){if(this.warnedWidgetKeys.has(r))continue;let s=Array.from(o).map(a=>`\"${a}\"`).join(\", \");console.warn(`[tiptap warn]: Duplicate widget decoration key \"${r}\" in extension${o.size===1?\"\":\"s\"} ${s}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \\`comment-\\${id}\\`).`)}this.warnedWidgetKeys=n}buildMergedSet(t,e){let n=Object.keys(e);return n.length===1?e[n[0]]:gz(t,e)}mergeAfterApply({entries:t,previous:e,tr:n,decorationSetsByExtension:r,recomputedNames:o}){return t.length===1?r[t[0].name]:o.size===0?e.mergedDecorationSet.map(n.mapping,n.doc):gz(n.doc,r)}};function Kz(t,e){let{selection:n}=t,{$from:r}=n;if(n instanceof oe){let s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let o=r.depth;for(;o>=0;){let s=r.index(o);if(r.node(o).contentMatchAt(s).matchType(e))return!0;o-=1}return!1}function kZ(t){return typeof t==\"number\"}function CZ(t){return Object.prototype.toString.call(t).slice(8,-1)}function jx(t){return CZ(t)!==\"Object\"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function hA(t,e,n){let r=t.split(`\n`),o=[],s=\"\",a=0,i=e.baseIndentSize||2;for(;a<r.length;){let c=r[a],d=c.match(e.itemPattern);if(!d){if(o.length>0)break;if(c.trim()===\"\"){a+=1,s=`${s}${c}\n`;continue}else return}let f=e.extractItemData(d),{indentLevel:p,mainContent:h}=f;s=`${s}${c}\n`;let g=[h];for(a+=1;a<r.length;){var l;let x=r[a];if(x.trim()===\"\"){var u;let v=r.slice(a+1).findIndex(S=>S.trim()!==\"\");if(v===-1)break;if((((u=r[a+1+v].match(/^(\\s*)/))===null||u===void 0||(u=u[1])===null||u===void 0?void 0:u.length)||0)>p){g.push(x),s=`${s}${x}\n`,a+=1;continue}else break}if((((l=x.match(/^(\\s*)/))===null||l===void 0||(l=l[1])===null||l===void 0?void 0:l.length)||0)>p)g.push(x),s=`${s}${x}\n`,a+=1;else break}let m,y=g.slice(1);if(y.length>0){let x=y.map(v=>v.slice(p+i)).join(`\n`);x.trim()&&(e.customNestedParser?m=e.customNestedParser(x):m=n.blockTokens(x))}let b=e.createToken(f,m);o.push(b)}if(o.length!==0)return{items:o,raw:s}}var bz=4;function vz(t){let e=0;for(let n of t)e=n===\"\t\"?e+bz-e%bz:e+1;return e}function mA(t,e,n,r,o){if(!t||!Array.isArray(t.content))return\"\";let s=typeof n==\"function\"?n(r):n,[a,...i]=t.content,l=`${s}${e.renderChildren([a])}`;return i&&i.length>0&&i.forEach((u,c)=>{var d,f;let p=(d=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,u,c+1))!==null&&d!==void 0?d:e.renderChildren([u]);if(p!=null){let h=m=>{if(!o?.alignNestedToPrefix)return e.indent(m);let y=e.indent(\"\"),b=vz(s);return(vz(y)>=b?y:\" \".repeat(b))+m},g=p.split(`\n`).map(m=>h(m||\"\")).join(`\n`);l+=u.type===\"paragraph\"?`\n\n${g}`:`\n${g}`}}),l}function Gz(t,e){let n={...t};return jx(t)&&jx(e)&&Object.keys(e).forEach(r=>{jx(e[r])&&jx(t[r])?n[r]=Gz(t[r],e[r]):n[r]=e[r]}),n}function LZ(t,e,n={}){let{state:r}=e,{doc:o,tr:s}=r,a=t;o.descendants((i,l)=>{let u=s.mapping.map(l),c=s.mapping.map(l)+i.nodeSize,d=null;if(i.marks.forEach(p=>{if(p!==a)return!1;d=p}),!d)return;let f=!1;if(Object.keys(n).forEach(p=>{n[p]!==d.attrs[p]&&(f=!0)}),f){let p=t.type.create({...t.attrs,...n});s.removeMark(u,c,t.type),s.addMark(u,c,p)}}),s.docChanged&&e.view.dispatch(s)}var df=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}},AZ=(t,e)=>{if(uA(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: \"inputRuleMatch.replaceWith\" must be part of \"inputRuleMatch.text\".'),r.push(n.replaceWith)),r};function EZ(t){let{editor:e,from:n,to:r,text:o,insertText:s}=t;if(!s)return{inputTransaction:null,tr:e.view.state.tr};let a=e.view.state.tr.insertText(o,n,r);return{inputTransaction:a,tr:Cs.create({doc:a.doc,selection:a.selection,storedMarks:a.storedMarks}).tr}}function TZ(t){let{editor:e,from:n,to:r,text:o,rule:s,match:a,plugin:i,insertText:l}=t,{view:u}=e,{inputTransaction:c,tr:d}=EZ({editor:e,from:n,to:r,text:o,insertText:l}),f=c?n+o.length:r,p=Wx({state:u.state,transaction:d}),h={from:n-(a[0].length-o.length),to:f},{commands:g,chain:m,can:y}=new lA({editor:e,state:p});return s.handler({state:p,range:h,match:a,commands:g,chain:m,can:y})===null||!d.steps.length?!1:(c&&(u.dispatch(c),!u.state.doc.eq(c.doc))||(px(d),d.setMeta(\"inputRule\",!0),s.undoable&&d.setMeta(i,{transform:d,from:n,to:f,text:o}),u.dispatch(d)),!0)}function RZ(t,e,n){let r=e[0].length-n.length;if(r<=0)return!0;let o=t.parentOffset-r;return o>=0&&t.parent.textBetween(o,t.parentOffset)===e[0].slice(0,r)}function qx(t){var e;let{editor:n,from:r,to:o,text:s,rules:a,plugin:i,insertText:l}=t,{view:u}=n;if(u.composing)return!1;let c=u.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=BY(c)+s;for(let f of a){let p=AZ(d,f.find);if(!(!p||!RZ(c,p,s))&&TZ({editor:n,from:r,to:o,text:s,rule:f,match:p,plugin:i,insertText:l}))return!0}return!1}function IZ(t){let{editor:e,rules:n}=t,r=new ie({state:{init(){return null},apply(o,s,a){let i=o.getMeta(r);if(i)return i;let l=o.getMeta(\"applyInputRules\");return l&&setTimeout(()=>{let{text:u}=l;typeof u==\"string\"?u=u:u=_z(H.from(u),a.schema);let{from:c}=l,d=c+u.length;qx({editor:e,from:c,to:d,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,a,i){return qx({editor:e,from:s,to:a,text:i,rules:n,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{let{$cursor:s}=o.state.selection;s&&qx({editor:e,from:s.pos,to:s.pos,text:\"\",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!==\"Enter\")return!1;let{$cursor:a}=o.state.selection;return a?qx({editor:e,from:a.pos,to:a.pos,text:`\n`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var gA=class{constructor(t={}){this.type=\"extendable\",this.parent=null,this.child=null,this.name=\"\",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...Ze(se(this,\"addOptions\",{name:this.name}))}}get storage(){return{...Ze(se(this,\"addStorage\",{name:this.name,options:this.options}))}}configure(t={}){let e=this.extend({...this.config,addOptions:()=>Gz(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){let e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name=\"name\"in t?t.name:e.parent.name,e}},Zr=class Wz extends gA{constructor(...e){super(...e),this.type=\"mark\"}static create(e={}){let n=typeof e==\"function\"?e():e;return new Wz(n)}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){let s=o.marks();if(!s.find(i=>i?.type.name===n.name))return!1;let a=s.find(i=>i?.type.name===n.name);return a&&r.removeStoredMark(a),r.insertText(\" \",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){let n=typeof e==\"function\"?e():e;return super.extend(n)}},yA=class{constructor(t){this.find=t.find,this.handler=t.handler}},MZ=(t,e,n)=>{if(uA(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(o=>{let s=[o.text];return s.index=o.index,s.input=t,s.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: \"pasteRuleMatch.replaceWith\" must be part of \"pasteRuleMatch.text\".'),s.push(o.replaceWith)),s}):[]};function _Z(t){let{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:a,dropEvent:i}=t,{commands:l,chain:u,can:c}=new lA({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(f,p)=>{var h,g,m,y;if(!((h=f.type)===null||h===void 0||(h=h.spec)===null||h===void 0)&&h.code||!(f.isText||f.isTextblock||f.isInline))return;let b=(g=(m=(y=f.content)===null||y===void 0?void 0:y.size)!==null&&m!==void 0?m:f.nodeSize)!==null&&g!==void 0?g:0,x=Math.max(r,p),v=Math.min(o,p+b);if(x>=v)return;let S=f.isText?f.text||\"\":f.textBetween(x-p,v-p,void 0,\"\\uFFFC\");MZ(S,s.find,a).forEach(E=>{if(E.index===void 0)return;let w=x+E.index+1,k=w+E[0].length,A={from:n.tr.mapping.map(w),to:n.tr.mapping.map(k)},L=s.handler({state:n,range:A,match:E,commands:l,chain:u,can:c,pasteEvent:a,dropEvent:i});d.push(L)})}),d.every(f=>f!==null)}var of=null,OZ=t=>{var e;let n=new ClipboardEvent(\"paste\",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData(\"text/html\",t),n};function DZ(t){let{editor:e,rules:n}=t,r=null,o=!1,s=!1,a=typeof ClipboardEvent<\"u\"?new ClipboardEvent(\"paste\"):null,i;try{i=typeof DragEvent<\"u\"?new DragEvent(\"drop\"):null}catch{i=null}let l=({state:u,from:c,to:d,rule:f,pasteEvt:p})=>{let h=u.tr,g=Wx({state:u,transaction:h});if(!(!_Z({editor:e,state:g,from:Math.max(c-1,0),to:d.b-1,rule:f,pasteEvent:p,dropEvent:i})||!h.steps.length)){try{i=typeof DragEvent<\"u\"?new DragEvent(\"drop\"):null}catch{i=null}return a=typeof ClipboardEvent<\"u\"?new ClipboardEvent(\"paste\"):null,h}};return e.on(\"destroy\",()=>{of===e&&(of=null)}),n.map(u=>new ie({view(c){let d=p=>{var h;r=!((h=c.dom.parentElement)===null||h===void 0)&&h.contains(p.target)?c.dom.parentElement:null,r&&(of=e)},f=()=>{of&&(of=null)};return window.addEventListener(\"dragstart\",d),window.addEventListener(\"dragend\",f),{destroy(){window.removeEventListener(\"dragstart\",d),window.removeEventListener(\"dragend\",f)}}},props:{handleDOMEvents:{drop:(c,d)=>{if(s=r===c.dom.parentElement,i=d,!s){let f=of;f?.isEditable&&setTimeout(()=>{if(f.isDestroyed)return;let p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(c,d)=>{var f;let p=(f=d.clipboardData)===null||f===void 0?void 0:f.getData(\"text/html\");return a=d,o=!!p?.includes(\"data-pm-slice\"),!1}}},appendTransaction:(c,d,f)=>{let p=c[0],h=p.getMeta(\"uiEvent\")===\"paste\"&&!o,g=p.getMeta(\"uiEvent\")===\"drop\"&&!s,m=p.getMeta(\"applyPasteRules\"),y=!!m;if(!h&&!g&&!y)return;if(y){let{text:v}=m;typeof v==\"string\"?v=v:v=_z(H.from(v),f.schema);let{from:S}=m,E=S+v.length,w=OZ(v);return l({rule:u,state:f,from:S,to:{b:E},pasteEvt:w})}let b=d.doc.content.findDiffStart(f.doc.content),x=d.doc.content.findDiffEnd(f.doc.content);if(!(!kZ(b)||!x||b===x.b))return l({rule:u,state:f,from:b,to:x,pasteEvt:a})}}))}var bA=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=t,this.extensions=Dz(t),this.schema=IY(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{let n=se(e,\"addCommands\",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:rf(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){let{editor:t}=this,e=Zm([...this.extensions].reverse()).flatMap(r=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:rf(r.name,this.schema)},s=[],a=se(r,\"addKeyboardShortcuts\",o),i={};if(r.type===\"mark\"&&se(r,\"exitable\",o)&&(i.ArrowRight=()=>Zr.handleExit({editor:t,mark:r})),a){let f=Object.fromEntries(Object.entries(a()).map(([p,h])=>[p,()=>h({editor:t})]));i={...i,...f}}let l=cx(i);s.push(l);let u=se(r,\"addInputRules\",o);if(pz(r,t.options.enableInputRules)&&u){let f=u();if(f&&f.length){let p=IZ({editor:t,rules:f}),h=Array.isArray(p)?p:[p];s.push(...h)}}let c=se(r,\"addPasteRules\",o);if(pz(r,t.options.enablePasteRules)&&c){let f=c();if(f&&f.length){let p=DZ({editor:t,rules:f});s.push(...p)}}let d=se(r,\"addProseMirrorPlugins\",o);if(d){let f=d();s.push(...f)}return s}),n=this.createDecorationPlugin();return n&&e.push(n),e}createDecorationPlugin(){var t;let{editor:e}=this;(t=this.decorationManager)===null||t===void 0||t.destroy();let n=[];return this.extensions.forEach(r=>{let o=se(r,\"addDecorations\",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:rf(r.name,this.schema)});o&&n.push({name:r.name,addDecorations:o})}),this.decorationManager=new SZ({editor:e,entries:n}),this.decorationManager.plugin}get attributes(){return Oz(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:e}=lf(this.extensions);return Object.fromEntries(e.filter(n=>!!se(n,\"addNodeView\")).map(n=>{let r=this.attributes.filter(i=>i.type===n.name),o=se(n,\"addNodeView\",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:nn(n.name,this.schema)});if(!o)return[];let s=o();if(!s)return[];let a=(i,l,u,c,d)=>{let f=uf(i,r);return s({node:i,view:l,getPos:u,decorations:c,innerDecorations:d,editor:t,extension:n,HTMLAttributes:f})};return[n.name,a]}))}dispatchTransaction(t){let{editor:e}=this;return Zm([...this.extensions].reverse()).reduceRight((n,r)=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:rf(r.name,this.schema)},s=se(r,\"dispatchTransaction\",o);return s?a=>{s.call(o,{transaction:a,next:n})}:n},t)}transformPastedHTML(t){let{editor:e}=this;return Zm([...this.extensions]).reduce((n,r)=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:rf(r.name,this.schema)},s=se(r,\"transformPastedHTML\",o);return s?(a,i)=>{let l=n(a,i);return s.call(o,l)}:n},t||(n=>n))}get markViews(){let{editor:t}=this,{markExtensions:e}=lf(this.extensions);return Object.fromEntries(e.filter(n=>!!se(n,\"addMarkView\")).map(n=>{let r=this.attributes.filter(a=>a.type===n.name),o=se(n,\"addMarkView\",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Pa(n.name,this.schema)});if(!o)return[];let s=(a,i,l)=>{let u=uf(a,r);return o()({mark:a,view:i,inline:l,editor:t,extension:n,HTMLAttributes:u,updateAttributes:c=>{LZ(a,t,c)}})};return[n.name,s]}))}destroy(){var t;(t=this.decorationManager)===null||t===void 0||t.destroy(),this.extensions.forEach(e=>{let n=e;for(;n.parent;){let r=n.parent;r.child===n&&(r.child=null),n=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:rf(e.name,this.schema)};if(e.type===\"mark\"){var r,o;(!((r=Ze(se(e,\"keepOnSplit\",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name),!((o=Ze(se(e,\"clearable\",n)))!==null&&o!==void 0)||o||this.nonClearableMarks.push(e.name)}let s=se(e,\"onBeforeCreate\",n),a=se(e,\"onCreate\",n),i=se(e,\"onUpdate\",n),l=se(e,\"onSelectionUpdate\",n),u=se(e,\"onTransaction\",n),c=se(e,\"onFocus\",n),d=se(e,\"onBlur\",n),f=se(e,\"onDestroy\",n);s&&this.editor.on(\"beforeCreate\",s),a&&this.editor.on(\"create\",a),i&&this.editor.on(\"update\",i),l&&this.editor.on(\"selectionUpdate\",l),u&&this.editor.on(\"transaction\",u),c&&this.editor.on(\"focus\",c),d&&this.editor.on(\"blur\",d),f&&this.editor.on(\"destroy\",f)})}};bA.resolve=Dz;bA.sort=Zm;bA.flatten=pA;var St=class Xz extends gA{constructor(...e){super(...e),this.type=\"extension\"}static create(e={}){let n=typeof e==\"function\"?e():e;return new Xz(n)}configure(e){return super.configure(e)}extend(e){let n=typeof e==\"function\"?e():e;return super.extend(n)}},Lpe=St.create({name:\"clipboardTextSerializer\",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ie({key:new we(\"clipboardTextSerializer\"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,s=OY(n),{blockSeparator:a}=this.options,i={...a!==void 0?{blockSeparator:a}:{},textSerializers:s};return[...o.ranges].sort((l,u)=>l.$from.pos-u.$from.pos).map(({$from:l,$to:u})=>_Y(r,{from:l.pos,to:u.pos},i)).join(a??`\n\n`)}}})]}}),Ape=St.create({name:\"commands\",addCommands(){return{...lZ}}}),Epe=St.create({name:\"delete\",onUpdate({transaction:t,appendedTransactions:e}){var n,r;let o=()=>{var s,a,i;if((s=(a=this.editor.options.coreExtensionOptions)===null||a===void 0||(a=a.delete)===null||a===void 0||(i=a.filterTransaction)===null||i===void 0?void 0:i.call(a,t))!==null&&s!==void 0?s:t.getMeta(\"y-sync$\"))return;let l=fA(t.before,[t,...e]);cf(l).forEach(c=>{l.mapping.mapResult(c.oldRange.from).deletedAfter&&l.mapping.mapResult(c.oldRange.to).deletedBefore&&l.before.nodesBetween(c.oldRange.from,c.oldRange.to,(d,f)=>{let p=f+d.nodeSize-2,h=c.oldRange.from<=f&&p<=c.oldRange.to;this.editor.emit(\"delete\",{type:\"node\",node:d,from:f,to:p,newFrom:l.mapping.map(f),newTo:l.mapping.map(p),deletedRange:c.oldRange,newRange:c.newRange,partial:!h,editor:this.editor,transaction:t,combinedTransform:l})})});let u=l.mapping;l.steps.forEach((c,d)=>{if(c instanceof Xo){var f,p;let h=u.slice(d).map(c.from,-1),g=u.slice(d).map(c.to),m=u.invert().map(h,-1),y=u.invert().map(g),b=h>0?(f=l.doc.nodeAt(h-1))===null||f===void 0?void 0:f.marks.some(v=>v.eq(c.mark)):!1,x=(p=l.doc.nodeAt(g))===null||p===void 0?void 0:p.marks.some(v=>v.eq(c.mark));this.editor.emit(\"delete\",{type:\"mark\",mark:c.mark,from:c.from,to:c.to,deletedRange:{from:m,to:y},newRange:{from:h,to:g},partial:!!(x||b),editor:this.editor,transaction:t,combinedTransform:l})}})};!((n=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&n!==void 0)||n?setTimeout(o,0):o()}}),Tpe=St.create({name:\"drop\",addProseMirrorPlugins(){return[new ie({key:new we(\"tiptapDrop\"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit(\"drop\",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Rpe=St.create({name:\"editable\",addProseMirrorPlugins(){return[new ie({key:new we(\"editable\"),props:{editable:()=>this.editor.options.editable}})]}}),NZ=new we(\"focusEvents\"),Ipe=St.create({name:\"focusEvents\",addProseMirrorPlugins(){let{editor:t}=this;return[new ie({key:NZ,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta(\"focus\",{event:n}).setMeta(\"addToHistory\",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta(\"blur\",{event:n}).setMeta(\"addToHistory\",!1);return e.dispatch(r),!1}}}})]}}),Mpe=St.create({name:\"keymap\",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:i})=>{let{selection:l,doc:u}=i,{empty:c,$anchor:d}=l,{pos:f,parent:p}=d,h=d.parent.isTextblock&&f>0?i.doc.resolve(f-1):d,g=h.parent.type.spec.isolating,m=d.pos-d.parentOffset,y=g&&h.parent.childCount===1?m===d.pos:pe.atStart(u).from===f;return!c||!p.type.isTextblock||p.textContent.length||!y||y&&d.parent.type.name===\"paragraph\"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),\"Mod-Enter\":()=>this.editor.commands.exitCode(),Backspace:t,\"Mod-Backspace\":t,\"Shift-Backspace\":t,Delete:e,\"Mod-Delete\":e,\"Mod-a\":()=>this.editor.commands.selectAll()},o={...r},s={...r,\"Ctrl-h\":t,\"Alt-Backspace\":t,\"Ctrl-d\":e,\"Ctrl-Alt-Backspace\":e,\"Alt-Delete\":e,\"Alt-d\":e,\"Ctrl-a\":()=>this.editor.commands.selectTextblockStart(),\"Ctrl-e\":()=>this.editor.commands.selectTextblockEnd()};return Gx()||Rz()?s:o},addProseMirrorPlugins(){return[new ie({key:new we(\"clearDocument\"),appendTransaction:(t,e,n)=>{if(t.some(p=>p.getMeta(\"composition\")))return;let r=t.some(p=>p.docChanged)&&!e.doc.eq(n.doc),o=t.some(p=>p.getMeta(\"preventClearDocument\"));if(!r||o)return;let{empty:s,from:a,to:i}=e.selection,l=pe.atStart(e.doc).from,u=pe.atEnd(e.doc).to;if(s||!(a===l&&i===u)||!eg(n.doc))return;let c=n.tr,d=Wx({state:n,transaction:c}),{commands:f}=new lA({editor:this.editor,state:d});if(f.clearNodes(),!!c.steps.length)return c}})]}}),_pe=St.create({name:\"paste\",addProseMirrorPlugins(){return[new ie({key:new we(\"tiptapPaste\"),props:{handlePaste:(t,e,n)=>{this.editor.emit(\"paste\",{editor:this.editor,event:e,slice:n})}}})]}}),Ope=St.create({name:\"tabindex\",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new ie({key:new we(\"tabindex\"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!==null&&t!==void 0?t:\"0\"}}}})]}}),Dpe=St.create({name:\"textDirection\",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:t}=lf(this.extensions);return[{types:t.filter(e=>e.name!==\"text\").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let n=e.getAttribute(\"dir\");return n&&(n===\"ltr\"||n===\"rtl\"||n===\"auto\")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new ie({key:new we(\"textDirection\"),props:{attributes:()=>{let t=this.options.direction;return t?{dir:t}:{}}}})]}});function Do(t){return new df({find:t.find,handler:({state:e,range:n,match:r})=>{let o=Ze(t.getAttributes,void 0,r);if(o===!1||o===null)return null;let{tr:s}=e,a=r[r.length-1],i=r[0];if(a){let l=i.search(/\\S/),u=n.from+i.indexOf(a),c=u+a.length;if(Qm(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(p=>p===t.type&&p!==f.mark.type)).filter(f=>f.to>u).length)return null;c<n.to&&s.delete(c,n.to),u>n.from&&s.delete(n.from+l,u);let d=n.from+l+a.length;s.addMark(n.from+l,d,t.type.create(o||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function Jz(t){return new df({find:t.find,handler:({state:e,range:n,match:r})=>{let o=Ze(t.getAttributes,void 0,r)||{},{tr:s}=e,a=n.from,i=n.to,l=t.type.create(o);if(r[1]){let u=a+r[0].lastIndexOf(r[1]);u>i?u=i:i=u+r[1].length;let c=r[0][r[0].length-1];s.insertText(c,a+r[0].length-1),s.replaceWith(u,i,l)}else if(r[0]){let u=t.type.isInline?a:a-1;s.insert(u,t.type.create(o)).delete(s.mapping.map(a),s.mapping.map(i))}s.scrollIntoView()},undoable:t.undoable})}function tg(t){return new df({find:t.find,handler:({state:e,range:n,match:r})=>{let o=e.doc.resolve(n.from),s=Ze(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function Xi(t){return new df({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{let s=Ze(t.getAttributes,void 0,r)||{},a=e.tr.delete(n.from,n.to),i=a.doc.resolve(n.from).blockRange(),l=i&&Di(i,t.type,s);if(!l)return null;if(a.wrap(i,l),t.keepMarks&&t.editor){let{selection:c,storedMarks:d}=e,{splittableMarks:f}=t.editor.extensionManager,p=d||c.$to.parentOffset&&c.$from.marks();if(p){let h=p.filter(g=>f.includes(g.type.name));a.ensureMarks(h)}}if(t.keepAttributes){let c=t.type.name===\"bulletList\"||t.type.name===\"orderedList\"?\"listItem\":\"taskList\";o().updateAttributes(c,s).run()}let u=a.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&ir(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&a.join(n.from-1)},undoable:t.undoable})}var zt=class Yz extends gA{constructor(...e){super(...e),this.type=\"node\"}static create(e={}){let n=typeof e==\"function\"?e():e;return new Yz(n)}configure(e){return super.configure(e)}extend(e){let n=typeof e==\"function\"?e():e;return super.extend(n)}};function Qr(t){return new yA({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{let s=Ze(t.getAttributes,void 0,r,o);if(s===!1||s===null)return null;let{tr:a}=e,i=r[r.length-1],l=r[0],u=n.to;if(i){let c=l.search(/\\S/),d=n.from+l.indexOf(i),f=d+i.length;if(Qm(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(h=>h===t.type&&h!==p.mark.type)).filter(p=>p.to>d).length)return null;f<n.to&&a.delete(f,n.to),d>n.from&&a.delete(n.from+c,d),u=n.from+c+i.length,a.addMark(n.from+c,u,t.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||a.removeStoredMark(t.type)}}})}var Zz=new WeakSet,Qz=new WeakSet;function Iu(t){let e=t;return Zz.add(e),e}function vA(t){return Array.isArray(t)&&Zz.has(t)}function eF(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&Qz.has(e)&&!vA(e)?eF(e):[e])}function PZ(t,e){if(t===\"slot\")return 0;if(t instanceof Function){let o=t(e);return Array.isArray(o)&&!vA(o)&&!Qz.has(o)?Iu(o):o}let{children:n,...r}=e??{};if(t===\"svg\")throw new Error(\"SVG elements are not supported in the JSX syntax, use the array syntax instead\");if(Array.isArray(n)){if(vA(n))return Iu([t,r,n]);if(n.length===0)return Iu([t,r]);let o=eF(n);return o.length===0?Iu([t,r]):Iu([t,r,...o])}return n!=null?Iu([t,r,n]):Iu([t,r])}var ff=(t,e)=>PZ(t,e);var BZ=(t,e)=>{var n;let{state:r}=t,{selection:o}=r;if(!o.empty)return!1;let{$from:s}=o;if(s.parentOffset!==0)return!1;let a=s.depth-1;if(a<0)return!1;let i=s.node(a),l=s.index(a);if(l===0)return!1;if(i.type===e)return t.commands.lift(e.name);let u=i.child(l-1);if(u.type!==e||!(!((n=u.lastChild)===null||n===void 0)&&n.isTextblock))return!1;let c=s.before()-1-1;return t.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;let p=s.parent.content,h=new G(p,0,0);return d.replace(c,s.after(),h),d.setSelection(J.create(d.doc,c+p.size)),d.scrollIntoView(),f(d),!0})},zZ=/^\\s*>\\s$/,tF=zt.create({name:\"blockquote\",addOptions(){return{HTMLAttributes:{}}},content:\"block+\",group:\"block\",defining:!0,parseHTML(){return[{tag:\"blockquote\"}]},renderHTML({HTMLAttributes:t}){return ff(\"blockquote\",{...We(this.options.HTMLAttributes,t),children:ff(\"slot\",{})})},parseMarkdown:(t,e)=>{var n;let r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren;return e.createNode(\"blockquote\",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return\"\";let n=\">\",r=[];return t.content.forEach((o,s)=>{var a,i;let l=((a=(i=e.renderChild)===null||i===void 0?void 0:i.call(e,o,s))!==null&&a!==void 0?a:e.renderChildren([o])).split(`\n`).map(u=>u.trim()===\"\"?n:`${n} ${u}`);r.push(l.join(`\n`))}),r.join(`\n${n}\n`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{\"Mod-Shift-b\":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>BZ(this.editor,this.type)}},addInputRules(){return[Xi({find:zZ,type:this.type})]}});var FZ=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/,HZ=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g,$Z=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/,UZ=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g,nF=Zr.create({name:\"bold\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"strong\"},{tag:\"b\",getAttrs:t=>t.style.fontWeight!==\"normal\"&&null},{style:\"font-weight=400\",clearMark:t=>t.type.name===this.name},{style:\"font-weight\",getAttrs:t=>/^(bold(er)?|[5-9]\\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return ff(\"strong\",{...We(this.options.HTMLAttributes,t),children:ff(\"slot\",{})})},markdownTokenName:\"strong\",parseMarkdown:(t,e)=>e.applyMark(\"bold\",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:\"<strong>\",close:\"</strong>\"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-b\":()=>this.editor.commands.toggleBold(),\"Mod-B\":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Do({find:FZ,type:this.type}),Do({find:$Z,type:this.type})]},addPasteRules(){return[Qr({find:HZ,type:this.type}),Qr({find:UZ,type:this.type})]}});var jZ=t=>{let e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]===\"`\"?null:{index:e.index,text:e[0],replaceWith:e[1]}},qZ=t=>{let e=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]===\"`\"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n};function VZ(t){let e=new Set((t.match(/`+/g)||[]).map(r=>r.length)),n=1;for(;e.has(n);)n+=1;return n}var rF=Zr.create({name:\"code\",addOptions(){return{HTMLAttributes:{}}},excludes:\"_\",code:!0,exitable:!0,parseHTML(){return[{tag:\"code\"}]},renderHTML({HTMLAttributes:t}){return[\"code\",We(this.options.HTMLAttributes,t),0]},markdownTokenName:\"codespan\",parseMarkdown:(t,e)=>e.applyMark(\"code\",[{type:\"text\",text:t.text||\"\"}]),renderMarkdown:(t,e,n)=>{var r;if(!t.content)return\"\";let o=typeof(n==null||(r=n.meta)===null||r===void 0?void 0:r.markText)==\"string\"?n.meta.markText:\"\",s=\"`\".repeat(VZ(o)),a=o.startsWith(\"`\")||o.endsWith(\"`\")?\" \":\"\";return`${s}${a}${e.renderChildren(t.content)}${a}${s}`},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-e\":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Do({find:jZ,type:this.type})]},addPasteRules(){return[Qr({find:qZ,type:this.type})]}});var xA=4,KZ=/^```([a-z]+)?[\\s\\n]$/,GZ=/^~~~([a-z]+)?[\\s\\n]$/,oF=zt.create({name:\"codeBlock\",addOptions(){return{languageClassPrefix:\"language-\",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:xA,HTMLAttributes:{}}},content:\"text*\",marks:\"\",group:\"block\",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,\"\"))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:\"pre\",preserveWhitespace:\"full\"}]},renderHTML({node:t,HTMLAttributes:e}){return[\"pre\",We(this.options.HTMLAttributes,e),[\"code\",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:\"code\",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)===null||n===void 0?void 0:n.startsWith(\"```\"))===!1&&((r=t.raw)===null||r===void 0?void 0:r.startsWith(\"~~~\"))===!1&&t.codeBlockStyle!==\"indented\"?[]:e.createNode(\"codeBlock\",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r=\"\",o=((n=t.attrs)===null||n===void 0?void 0:n.language)||\"\";return t.content?r=[`\\`\\`\\`${o}`,e.renderChildren(t.content),\"```\"].join(`\n`):r=`\\`\\`\\`${o}\n\n\\`\\`\\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,\"paragraph\",t)}},addKeyboardShortcuts(){return{\"Mod-Alt-c\":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!==null&&e!==void 0?e:xA,{state:r}=t,{selection:o}=r,{$from:s,empty:a}=o;if(s.parent.type!==this.type)return!1;let i=\" \".repeat(n);return a?t.commands.insertContent(i):t.commands.command(({tr:l})=>{let{from:u,to:c}=o,d=r.doc.textBetween(u,c,`\n`,`\n`).split(`\n`).map(f=>i+f).join(`\n`);return l.replaceWith(u,c,r.schema.text(d)),!0})},\"Shift-Tab\":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!==null&&e!==void 0?e:xA,{state:r}=t,{selection:o}=r,{$from:s,empty:a}=o;return s.parent.type!==this.type?!1:a?t.commands.command(({tr:i})=>{var l;let{pos:u}=s,c=s.start(),d=s.end(),f=r.doc.textBetween(c,d,`\n`,`\n`).split(`\n`),p=0,h=0,g=u-c;for(let x=0;x<f.length;x+=1){if(h+f[x].length>=g){p=x;break}h+=f[x].length+1}let m=((l=f[p].match(/^ */))===null||l===void 0?void 0:l[0])||\"\",y=Math.min(m.length,n);if(y===0)return!0;let b=c;for(let x=0;x<p;x+=1)b+=f[x].length+1;return i.delete(b,b+y),u-b<=y&&i.setSelection(J.create(i.doc,b)),!0}):t.commands.command(({tr:i})=>{let{from:l,to:u}=o,c=r.doc.textBetween(l,u,`\n`,`\n`).split(`\n`).map(d=>{var f;let p=((f=d.match(/^ */))===null||f===void 0?void 0:f[0])||\"\",h=Math.min(p.length,n);return d.slice(h)}).join(`\n`);return i.replaceWith(l,u,r.schema.text(c)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;let s=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`\n\n`);return!s||!a?!1:t.chain().command(({tr:i})=>(i.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type||r.parentOffset!==0)return!1;let s=r.before();return s>0?!1:t.commands.insertDefaultBlock({pos:s})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:s}=n;if(!s||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let a=o.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:i})=>(i.setSelection(pe.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[tg({find:KZ,type:this.type,getAttributes:t=>({language:t[1]})}),tg({find:GZ,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ie({key:new we(\"codeBlockVSCodeHandler\"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData(\"text/plain\"),r=e.clipboardData.getData(\"vscode-editor-data\"),o=r?JSON.parse(r):void 0,s=o?.mode;if(!n||!s)return!1;let{tr:a,schema:i}=t.state,l=i.text(n.replace(/\\r\\n?/g,`\n`));return a.replaceSelectionWith(this.type.create({language:s},l)),a.selection.$from.parent.type!==this.type&&a.setSelection(J.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(\"paste\",!0),t.dispatch(a),!0}}})]}});var sF=zt.create({name:\"doc\",topNode:!0,content:\"block+\",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`\n\n`):\"\"});var aF=zt.create({name:\"hardBreak\",markdownTokenName:\"br\",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:\"inline\",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:\"br\"}]},renderHTML({HTMLAttributes:t}){return[\"br\",We(this.options.HTMLAttributes,t)]},renderText(){return`\n`},renderMarkdown:()=>` \n`,parseMarkdown:()=>({type:\"hardBreak\"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:i}=r.extensionManager,l=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&a){let d=l.filter(f=>i.includes(f.type.name));u.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{\"Mod-Enter\":()=>this.editor.commands.setHardBreak(),\"Shift-Enter\":()=>this.editor.commands.setHardBreak()}}});var iF=zt.create({name:\"heading\",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:\"inline*\",group:\"block\",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,We(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode(\"heading\",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;let r=!((n=t.attrs)===null||n===void 0)&&n.level?parseInt(t.attrs.level,10):1,o=\"#\".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:\"\"},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,\"paragraph\",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>tg({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\\\s$`),type:this.type,getAttributes:{level:t}}))}});var lF=zt.create({name:\"horizontalRule\",addOptions(){return{HTMLAttributes:{},nextNodeType:\"paragraph\"}},group:\"block\",parseHTML(){return[{tag:\"hr\"}]},renderHTML({HTMLAttributes:t}){return[\"hr\",We(this.options.HTMLAttributes,t)]},markdownTokenName:\"hr\",parseMarkdown:(t,e)=>e.createNode(\"horizontalRule\"),renderMarkdown:()=>\"---\",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Kz(e,e.schema.nodes[this.name]))return!1;let{selection:n}=e,{$to:r}=n,o=t();return Jx(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:s,tr:a,dispatch:i})=>{if(i){let{$to:l}=a.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?a.setSelection(J.create(a.doc,l.pos+1)):l.nodeAfter.isBlock?a.setSelection(oe.create(a.doc,l.pos)):a.setSelection(J.create(a.doc,l.pos));else{let c=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=c?.create();d&&(a.insert(u,d),a.setSelection(J.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Jz({find:/^(?:---|—-|___\\s|\\*\\*\\*\\s)$/,type:this.type})]}});var WZ=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))$/,XZ=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))/g,JZ=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))$/,YZ=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))/g,uF=Zr.create({name:\"italic\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"em\"},{tag:\"i\",getAttrs:t=>t.style.fontStyle!==\"normal\"&&null},{style:\"font-style=normal\",clearMark:t=>t.type.name===this.name},{style:\"font-style=italic\"}]},renderHTML({HTMLAttributes:t}){return[\"em\",We(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:\"em\",parseMarkdown:(t,e)=>e.applyMark(\"italic\",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:\"<em>\",close:\"</em>\"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{\"Mod-i\":()=>this.editor.commands.toggleItalic(),\"Mod-I\":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Do({find:WZ,type:this.type}),Do({find:JZ,type:this.type})]},addPasteRules(){return[Qr({find:XZ,type:this.type}),Qr({find:YZ,type:this.type})]}});var ZZ=\"aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2\",QZ=\"\\u03B5\\u03BB1\\u03C52\\u0431\\u04331\\u0435\\u043B3\\u0434\\u0435\\u0442\\u04384\\u0435\\u044E2\\u043A\\u0430\\u0442\\u043E\\u043B\\u0438\\u043A6\\u043E\\u043C3\\u043C\\u043A\\u04342\\u043E\\u043D1\\u0441\\u043A\\u0432\\u04306\\u043E\\u043D\\u043B\\u0430\\u0439\\u043D5\\u0440\\u04333\\u0440\\u0443\\u04412\\u04442\\u0441\\u0430\\u0439\\u04423\\u0440\\u04313\\u0443\\u043A\\u04403\\u049B\\u0430\\u04373\\u0570\\u0561\\u05753\\u05D9\\u05E9\\u05E8\\u05D0\\u05DC5\\u05E7\\u05D5\\u05DD3\\u0627\\u0628\\u0648\\u0638\\u0628\\u064A5\\u0631\\u0627\\u0645\\u0643\\u06485\\u0644\\u0627\\u0631\\u062F\\u06464\\u0628\\u062D\\u0631\\u064A\\u06465\\u062C\\u0632\\u0627\\u0626\\u06315\\u0633\\u0639\\u0648\\u062F\\u064A\\u06296\\u0639\\u0644\\u064A\\u0627\\u06465\\u0645\\u063A\\u0631\\u06285\\u0645\\u0627\\u0631\\u0627\\u062A5\\u06CC\\u0631\\u0627\\u06465\\u0628\\u0627\\u0631\\u062A2\\u0632\\u0627\\u06314\\u064A\\u062A\\u06433\\u06BE\\u0627\\u0631\\u062A5\\u062A\\u0648\\u0646\\u06334\\u0633\\u0648\\u062F\\u0627\\u06463\\u0631\\u064A\\u06295\\u0634\\u0628\\u0643\\u06294\\u0639\\u0631\\u0627\\u06422\\u06282\\u0645\\u0627\\u06464\\u0641\\u0644\\u0633\\u0637\\u064A\\u06466\\u0642\\u0637\\u06313\\u0643\\u0627\\u062B\\u0648\\u0644\\u064A\\u06436\\u0648\\u06453\\u0645\\u0635\\u06312\\u0644\\u064A\\u0633\\u064A\\u06275\\u0648\\u0631\\u064A\\u062A\\u0627\\u0646\\u064A\\u06277\\u0642\\u06394\\u0647\\u0645\\u0631\\u0627\\u06475\\u067E\\u0627\\u06A9\\u0633\\u062A\\u0627\\u06467\\u0680\\u0627\\u0631\\u062A4\\u0915\\u0949\\u092E3\\u0928\\u0947\\u091F3\\u092D\\u093E\\u0930\\u09240\\u092E\\u094D3\\u094B\\u09245\\u0938\\u0902\\u0917\\u0920\\u09285\\u09AC\\u09BE\\u0982\\u09B2\\u09BE5\\u09AD\\u09BE\\u09B0\\u09A42\\u09F0\\u09A44\\u0A2D\\u0A3E\\u0A30\\u0A244\\u0AAD\\u0ABE\\u0AB0\\u0AA44\\u0B2D\\u0B3E\\u0B30\\u0B244\\u0B87\\u0BA8\\u0BCD\\u0BA4\\u0BBF\\u0BAF\\u0BBE6\\u0BB2\\u0B99\\u0BCD\\u0B95\\u0BC86\\u0B9A\\u0BBF\\u0B99\\u0BCD\\u0B95\\u0BAA\\u0BCD\\u0BAA\\u0BC2\\u0BB0\\u0BCD11\\u0C2D\\u0C3E\\u0C30\\u0C24\\u0C4D5\\u0CAD\\u0CBE\\u0CB0\\u0CA44\\u0D2D\\u0D3E\\u0D30\\u0D24\\u0D025\\u0DBD\\u0D82\\u0D9A\\u0DCF4\\u0E04\\u0E2D\\u0E213\\u0E44\\u0E17\\u0E223\\u0EA5\\u0EB2\\u0EA73\\u10D2\\u10D42\\u307F\\u3093\\u306A3\\u30A2\\u30DE\\u30BE\\u30F34\\u30AF\\u30E9\\u30A6\\u30C94\\u30B0\\u30FC\\u30B0\\u30EB4\\u30B3\\u30E02\\u30B9\\u30C8\\u30A23\\u30BB\\u30FC\\u30EB3\\u30D5\\u30A1\\u30C3\\u30B7\\u30E7\\u30F36\\u30DD\\u30A4\\u30F3\\u30C84\\u4E16\\u754C2\\u4E2D\\u4FE11\\u56FD1\\u570B1\\u6587\\u7F513\\u4E9A\\u9A6C\\u900A3\\u4F01\\u4E1A2\\u4F5B\\u5C712\\u4FE1\\u606F2\\u5065\\u5EB72\\u516B\\u53662\\u516C\\u53F81\\u76CA2\\u53F0\\u6E7E1\\u70632\\u5546\\u57CE1\\u5E971\\u68072\\u5609\\u91CC0\\u5927\\u9152\\u5E975\\u5728\\u7EBF2\\u5927\\u62FF2\\u5929\\u4E3B\\u65593\\u5A31\\u4E502\\u5BB6\\u96FB2\\u5E7F\\u4E1C2\\u5FAE\\u535A2\\u6148\\u55842\\u6211\\u7231\\u4F603\\u624B\\u673A2\\u62DB\\u80582\\u653F\\u52A11\\u5E9C2\\u65B0\\u52A0\\u57612\\u95FB2\\u65F6\\u5C1A2\\u66F8\\u7C4D2\\u673A\\u67842\\u6DE1\\u9A6C\\u95213\\u6E38\\u620F2\\u6FB3\\u95802\\u70B9\\u770B2\\u79FB\\u52A82\\u7EC4\\u7EC7\\u673A\\u67844\\u7F51\\u57401\\u5E971\\u7AD91\\u7EDC2\\u8054\\u901A2\\u8C37\\u6B4C2\\u8D2D\\u72692\\u901A\\u8CA92\\u96C6\\u56E22\\u96FB\\u8A0A\\u76C8\\u79D14\\u98DE\\u5229\\u6D663\\u98DF\\u54C12\\u9910\\u53852\\u9999\\u683C\\u91CC\\u62C93\\u6E2F2\\uB2F7\\uB1371\\uCEF42\\uC0BC\\uC1312\\uD55C\\uAD6D2\",EA=\"numeric\",TA=\"ascii\",RA=\"alpha\",og=\"asciinumeric\",rg=\"alphanumeric\",IA=\"domain\",mF=\"emoji\",eQ=\"scheme\",tQ=\"slashscheme\",wA=\"whitespace\";function nQ(t,e){return t in e||(e[t]=[]),e[t]}function Mu(t,e,n){e[EA]&&(e[og]=!0,e[rg]=!0),e[TA]&&(e[og]=!0,e[RA]=!0),e[og]&&(e[rg]=!0),e[RA]&&(e[rg]=!0),e[rg]&&(e[IA]=!0),e[mF]&&(e[IA]=!0);for(let r in e){let o=nQ(r,n);o.indexOf(t)<0&&o.push(t)}}function rQ(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Er(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Er.groups={};Er.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){let o=e.jr[r][0],s=e.jr[r][1];if(s&&o.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||Er.groups;let o;return e&&e.j?o=e:(o=new Er(e),n&&r&&Mu(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this,s=t.length;if(!s)return o;for(let a=0;a<s-1;a++)o=o.tt(t[a]);return o.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||Er.groups;let o=this;if(e&&e.j)return o.j[t]=e,e;let s=e,a,i=o.go(t);if(i?(a=new Er,Object.assign(a.j,i.j),a.jr.push.apply(a.jr,i.jr),a.jd=i.jd,a.t=i.t):a=new Er,s){if(r)if(a.t&&typeof a.t==\"string\"){let l=Object.assign(rQ(a.t,r),n);Mu(s,l,r)}else n&&Mu(s,n,r);a.t=s}return o.j[t]=a,a}};var _e=(t,e,n,r,o)=>t.ta(e,n,r,o),Ft=(t,e,n,r,o)=>t.tr(e,n,r,o),cF=(t,e,n,r,o)=>t.ts(e,n,r,o),q=(t,e,n,r,o)=>t.tt(e,n,r,o),Fa=\"WORD\",MA=\"UWORD\",gF=\"ASCIINUMERICAL\",yF=\"ALPHANUMERICAL\",cg=\"LOCALHOST\",_A=\"TLD\",OA=\"UTLD\",e0=\"SCHEME\",pf=\"SLASH_SCHEME\",NA=\"NUM\",DA=\"WS\",PA=\"NL\",sg=\"OPENBRACE\",ag=\"CLOSEBRACE\",t0=\"OPENBRACKET\",n0=\"CLOSEBRACKET\",r0=\"OPENPAREN\",o0=\"CLOSEPAREN\",s0=\"OPENANGLEBRACKET\",a0=\"CLOSEANGLEBRACKET\",i0=\"FULLWIDTHLEFTPAREN\",l0=\"FULLWIDTHRIGHTPAREN\",u0=\"LEFTCORNERBRACKET\",c0=\"RIGHTCORNERBRACKET\",d0=\"LEFTWHITECORNERBRACKET\",f0=\"RIGHTWHITECORNERBRACKET\",p0=\"FULLWIDTHLESSTHAN\",h0=\"FULLWIDTHGREATERTHAN\",m0=\"AMPERSAND\",g0=\"APOSTROPHE\",y0=\"ASTERISK\",Yi=\"AT\",b0=\"BACKSLASH\",v0=\"BACKTICK\",x0=\"CARET\",_u=\"COLON\",BA=\"COMMA\",w0=\"DOLLAR\",_s=\"DOT\",S0=\"EQUALS\",zA=\"EXCLAMATION\",Po=\"HYPHEN\",ig=\"PERCENT\",k0=\"PIPE\",C0=\"PLUS\",L0=\"POUND\",lg=\"QUERY\",FA=\"QUOTE\",bF=\"FULLWIDTHMIDDLEDOT\",HA=\"SEMI\",Os=\"SLASH\",ug=\"TILDE\",A0=\"UNDERSCORE\",vF=\"EMOJI\",E0=\"SYM\",xF=Object.freeze({__proto__:null,ALPHANUMERICAL:yF,AMPERSAND:m0,APOSTROPHE:g0,ASCIINUMERICAL:gF,ASTERISK:y0,AT:Yi,BACKSLASH:b0,BACKTICK:v0,CARET:x0,CLOSEANGLEBRACKET:a0,CLOSEBRACE:ag,CLOSEBRACKET:n0,CLOSEPAREN:o0,COLON:_u,COMMA:BA,DOLLAR:w0,DOT:_s,EMOJI:vF,EQUALS:S0,EXCLAMATION:zA,FULLWIDTHGREATERTHAN:h0,FULLWIDTHLEFTPAREN:i0,FULLWIDTHLESSTHAN:p0,FULLWIDTHMIDDLEDOT:bF,FULLWIDTHRIGHTPAREN:l0,HYPHEN:Po,LEFTCORNERBRACKET:u0,LEFTWHITECORNERBRACKET:d0,LOCALHOST:cg,NL:PA,NUM:NA,OPENANGLEBRACKET:s0,OPENBRACE:sg,OPENBRACKET:t0,OPENPAREN:r0,PERCENT:ig,PIPE:k0,PLUS:C0,POUND:L0,QUERY:lg,QUOTE:FA,RIGHTCORNERBRACKET:c0,RIGHTWHITECORNERBRACKET:f0,SCHEME:e0,SEMI:HA,SLASH:Os,SLASH_SCHEME:pf,SYM:E0,TILDE:ug,TLD:_A,UNDERSCORE:A0,UTLD:OA,UWORD:MA,WORD:Fa,WS:DA}),Ba=/[a-z]/,ng=/\\p{L}/u,SA=/\\p{Emoji}/u;var za=/\\d/,kA=/\\s/;var dF=\"\\r\",CA=`\n`,oQ=\"\\uFE0F\",sQ=\"\\u200D\",LA=\"\\uFFFC\",Yx=null,Zx=null;function aQ(t=[]){let e={};Er.groups=e;let n=new Er;Yx==null&&(Yx=fF(ZZ)),Zx==null&&(Zx=fF(QZ)),q(n,\"'\",g0),q(n,\"{\",sg),q(n,\"}\",ag),q(n,\"[\",t0),q(n,\"]\",n0),q(n,\"(\",r0),q(n,\")\",o0),q(n,\"<\",s0),q(n,\">\",a0),q(n,\"\\uFF08\",i0),q(n,\"\\uFF09\",l0),q(n,\"\\u300C\",u0),q(n,\"\\u300D\",c0),q(n,\"\\u300E\",d0),q(n,\"\\u300F\",f0),q(n,\"\\uFF1C\",p0),q(n,\"\\uFF1E\",h0),q(n,\"&\",m0),q(n,\"*\",y0),q(n,\"@\",Yi),q(n,\"`\",v0),q(n,\"^\",x0),q(n,\":\",_u),q(n,\",\",BA),q(n,\"$\",w0),q(n,\".\",_s),q(n,\"=\",S0),q(n,\"!\",zA),q(n,\"-\",Po),q(n,\"%\",ig),q(n,\"|\",k0),q(n,\"+\",C0),q(n,\"#\",L0),q(n,\"?\",lg),q(n,'\"',FA),q(n,\"/\",Os),q(n,\";\",HA),q(n,\"~\",ug),q(n,\"_\",A0),q(n,\"\\\\\",b0),q(n,\"\\u30FB\",bF);let r=Ft(n,za,NA,{[EA]:!0});Ft(r,za,r);let o=Ft(r,Ba,gF,{[og]:!0}),s=Ft(r,ng,yF,{[rg]:!0}),a=Ft(n,Ba,Fa,{[TA]:!0});Ft(a,za,o),Ft(a,Ba,a),Ft(o,za,o),Ft(o,Ba,o);let i=Ft(n,ng,MA,{[RA]:!0});Ft(i,Ba),Ft(i,za,s),Ft(i,ng,i),Ft(s,za,s),Ft(s,Ba),Ft(s,ng,s);let l=q(n,CA,PA,{[wA]:!0}),u=q(n,dF,DA,{[wA]:!0}),c=Ft(n,kA,DA,{[wA]:!0});q(n,LA,c),q(u,CA,l),q(u,LA,c),Ft(u,kA,c),q(c,dF),q(c,CA),Ft(c,kA,c),q(c,LA,c);let d=Ft(n,SA,vF,{[mF]:!0});q(d,\"#\"),Ft(d,SA,d),q(d,oQ,d);let f=q(d,sQ);q(f,\"#\"),Ft(f,SA,d);let p=[[Ba,a],[za,o]],h=[[Ba,null],[ng,i],[za,s]];for(let g=0;g<Yx.length;g++)Ji(n,Yx[g],_A,Fa,p);for(let g=0;g<Zx.length;g++)Ji(n,Zx[g],OA,MA,h);Mu(_A,{tld:!0,ascii:!0},e),Mu(OA,{utld:!0,alpha:!0},e),Ji(n,\"file\",e0,Fa,p),Ji(n,\"mailto\",e0,Fa,p),Ji(n,\"http\",pf,Fa,p),Ji(n,\"https\",pf,Fa,p),Ji(n,\"ftp\",pf,Fa,p),Ji(n,\"ftps\",pf,Fa,p),Mu(e0,{scheme:!0,ascii:!0},e),Mu(pf,{slashscheme:!0,ascii:!0},e),t=t.sort((g,m)=>g[0]>m[0]?1:-1);for(let g=0;g<t.length;g++){let m=t[g][0],b=t[g][1]?{[eQ]:!0}:{[tQ]:!0};m.indexOf(\"-\")>=0?b[IA]=!0:Ba.test(m)?za.test(m)?b[og]=!0:b[TA]=!0:b[EA]=!0,cF(n,m,m,b)}return cF(n,\"localhost\",cg,{ascii:!0}),n.jd=new Er(E0),{start:n,tokens:Object.assign({groups:e},xF)}}function wF(t,e){let n=iQ(e.replace(/[A-Z]/g,i=>i.toLowerCase())),r=n.length,o=[],s=0,a=0;for(;a<r;){let i=t,l=null,u=0,c=null,d=-1,f=-1;for(;a<r&&(l=i.go(n[a]));)i=l,i.accepts()?(d=0,f=0,c=i):d>=0&&(d+=n[a].length,f++),u+=n[a].length,s+=n[a].length,a++;s-=d,a-=f,u-=d,o.push({t:c.t,v:e.slice(s-u,s),s:s-u,e:s})}return o}function iQ(t){let e=[],n=t.length,r=0;for(;r<n;){let o=t.charCodeAt(r),s,a=o<55296||o>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(a),r+=a.length}return e}function Ji(t,e,n,r,o){let s,a=e.length;for(let i=0;i<a-1;i++){let l=e[i];t.j[l]?s=t.j[l]:(s=new Er(r),s.jr=o.slice(),t.j[l]=s),t=s}return s=new Er(n),s.jr=o.slice(),t.j[e[a-1]]=s,s}function fF(t){let e=[],n=[],r=0,o=\"0123456789\";for(;r<t.length;){let s=0;for(;o.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(\"\"));for(let a=parseInt(t.substring(r,r+s),10);a>0;a--)n.pop();r+=s}else n.push(t[r]),r++}return e}var dg={defaultProtocol:\"http\",events:null,format:pF,formatHref:pF,nl2br:!1,tagName:\"a\",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function $A(t,e=null){let n=Object.assign({},dg);t&&(n=Object.assign(n,t instanceof $A?t.o:t));let r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}$A.prototype={o:dg,ignoreTags:[],defaultRender(t){return t},check(t){return this.get(\"validate\",t.toString(),t)},get(t,e,n){let r=e!=null,o=this.o[t];return o&&(typeof o==\"object\"?(o=n.t in o?o[n.t]:dg[t],typeof o==\"function\"&&r&&(o=o(e,n))):typeof o==\"function\"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r==\"function\"&&e!=null&&(r=r(e,n.t,n)),r},render(t){let e=t.render(this);return(this.get(\"render\",null,t)||this.defaultRender)(e,t.t,t)}};function pF(t){return t}function SF(t,e){this.t=\"token\",this.v=t,this.tk=e}SF.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),n=t.get(\"truncate\",e,this),r=t.get(\"format\",e,this);return n&&r.length>n?r.substring(0,n)+\"\\u2026\":r},toFormattedHref(t){return t.get(\"formatHref\",this.toHref(t.get(\"defaultProtocol\")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=dg.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get(\"validate\",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get(\"defaultProtocol\")),r=t.get(\"formatHref\",n,this),o=t.get(\"tagName\",n,e),s=this.toFormattedString(t),a={},i=t.get(\"className\",n,e),l=t.get(\"target\",n,e),u=t.get(\"rel\",n,e),c=t.getObj(\"attributes\",n,e),d=t.getObj(\"events\",n,e);return a.href=r,i&&(a.class=i),l&&(a.target=l),u&&(a.rel=u),c&&Object.assign(a,c),{tagName:o,attributes:a,content:s,eventListeners:d}}};function T0(t,e){class n extends SF{constructor(o,s){super(o,s),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var lQ=T0(\"email\",{isLink:!0,toHref(){return\"mailto:\"+this.toString()}}),hF=T0(\"text\"),uQ=T0(\"nl\"),Qx=T0(\"url\",{isLink:!0,toHref(t=dg.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==cg&&t[1].t===_u}});var No=t=>new Er(t);function cQ({groups:t}){let e=t.domain.concat([m0,y0,Yi,b0,v0,x0,w0,S0,Po,NA,ig,k0,C0,L0,Os,E0,ug,A0]),n=[g0,_u,BA,_s,zA,ig,lg,FA,HA,s0,a0,sg,ag,n0,t0,r0,o0,i0,l0,u0,c0,d0,f0,p0,h0],r=[m0,g0,y0,b0,v0,x0,w0,S0,Po,sg,ag,ig,k0,C0,L0,lg,Os,E0,ug,A0],o=No(),s=q(o,ug);_e(s,r,s),_e(s,t.domain,s);let a=No(),i=No(),l=No();_e(o,t.domain,a),_e(o,t.scheme,i),_e(o,t.slashscheme,l),_e(a,r,s),_e(a,t.domain,a);let u=q(a,Yi);q(s,Yi,u),q(i,Yi,u),q(l,Yi,u);let c=q(s,_s);_e(c,r,s),_e(c,t.domain,s);let d=No();_e(u,t.domain,d),_e(d,t.domain,d);let f=q(d,_s);_e(f,t.domain,d);let p=No(lQ);_e(f,t.tld,p),_e(f,t.utld,p),q(u,cg,p);let h=q(d,Po);q(h,Po,h),_e(h,t.domain,d),_e(p,t.domain,d),q(p,_s,f),q(p,Po,h);let g=q(a,Po),m=q(a,_s);q(g,Po,g),_e(g,t.domain,a),_e(m,r,s),_e(m,t.domain,a);let y=No(Qx);_e(m,t.tld,y),_e(m,t.utld,y),_e(y,t.domain,a),_e(y,r,s),q(y,_s,m),q(y,Po,g),q(y,Yi,u);let b=q(y,_u),x=No(Qx);_e(b,t.numeric,x);let v=No(Qx),S=No();_e(v,e,v),_e(v,n,S),_e(S,e,v),_e(S,n,S),q(y,Os,v),q(x,Os,v);let E=q(i,_u),w=q(l,_u),k=q(w,Os),A=q(k,Os);_e(i,t.domain,a),q(i,_s,m),q(i,Po,g),_e(l,t.domain,a),q(l,_s,m),q(l,Po,g),_e(E,t.domain,v),q(E,Os,v),q(E,lg,v),_e(A,t.domain,v),_e(A,e,v),q(A,Os,v);let L=[[sg,ag],[t0,n0],[r0,o0],[s0,a0],[i0,l0],[u0,c0],[d0,f0],[p0,h0]];for(let _=0;_<L.length;_++){let[P,D]=L[_],F=q(v,P);q(S,P,F);let j=No(Qx);_e(F,e,j);let K=No();_e(F,n,K),q(F,D,v),_e(j,e,j),_e(j,n,K),_e(K,e,j),_e(K,n,K),q(j,D,v),q(K,D,v)}return q(o,cg,y),q(o,PA,uQ),{start:o,tokens:xF}}function dQ(t,e,n){let r=n.length,o=0,s=[],a=[];for(;o<r;){let i=t,l=null,u=null,c=0,d=null,f=-1;for(;o<r&&!(l=i.go(n[o].t));)a.push(n[o++]);for(;o<r&&(u=l||i.go(n[o].t));)l=null,i=u,i.accepts()?(f=0,d=i):f>=0&&f++,o++,c++;if(f<0)o-=c,o<r&&(a.push(n[o]),o++);else{a.length>0&&(s.push(AA(hF,e,a)),a=[]),o-=f,c-=f;let p=d.t,h=n.slice(o-c,o);s.push(AA(p,e,h))}}return a.length>0&&s.push(AA(hF,e,a)),s}function AA(t,e,n){let r=n[0].s,o=n[n.length-1].e,s=e.slice(r,o);return new t(s,n)}var fQ=typeof console<\"u\"&&console&&console.warn||(()=>{}),pQ=\"until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.\",kt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function R0(){return Er.groups={},kt.scanner=null,kt.parser=null,kt.tokenQueue=[],kt.pluginQueue=[],kt.customSchemes=[],kt.initialized=!1,kt}function hf(t,e=!1){if(kt.initialized&&fQ(`linkifyjs: already initialized - will not register custom scheme \"${t}\" ${pQ}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or \"-\"\n2. Cannot start or end with \"-\"\n3. \"-\" cannot repeat`);kt.customSchemes.push([t,e])}function hQ(){kt.scanner=aQ(kt.customSchemes);for(let t=0;t<kt.tokenQueue.length;t++)kt.tokenQueue[t][1]({scanner:kt.scanner});kt.parser=cQ(kt.scanner.tokens);for(let t=0;t<kt.pluginQueue.length;t++)kt.pluginQueue[t][1]({scanner:kt.scanner,parser:kt.parser});return kt.initialized=!0,kt}function mf(t){return kt.initialized||hQ(),dQ(kt.parser.start,t,wF(kt.scanner.start,t))}mf.scan=wF;function gf(t,e=null,n=null){if(e&&typeof e==\"object\"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}let r=new $A(n),o=mf(t),s=[];for(let a=0;a<o.length;a++){let i=o[a];i.isLink&&(!e||i.t===e)&&r.check(i)&&s.push(i.toFormattedObject(r))}return s}var I0=\"[\\0- \\xA0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]\",mQ=new RegExp(I0),gQ=new RegExp(`${I0}$`),yQ=new RegExp(`${I0}+$`),bQ=new RegExp(I0,\"g\");function vQ(t,e,n){var r,o;let s=t.doc.resolve(e.to);if(!(!((r=s.nodeBefore)===null||r===void 0)&&r.isText))return;let a=(o=t.doc.textBetween(e.from,e.to,\"\\uFFFC\",\"\\uFFFC\").match(yQ))===null||o===void 0?void 0:o[0];if(!a)return;let i=e.to-a.length,l=Qm(i,e.to,t.doc).filter(d=>d.mark.type===n);if(!l.length)return;let{nodeAfter:u}=s;if(u&&l.some(d=>d.mark.isInSet(u.marks)))return;let c=t.storedMarks;t.removeMark(i,e.to,n),t.setStoredMarks(c),t.selection.empty&&t.selection.from===e.to&&t.removeStoredMark(n)}function xQ(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?[\"()\",\"[]\"].includes(t[0].value+t[2].value):!1}function wQ(t){return new ie({key:new we(\"autolink\"),appendTransaction:(e,n,r)=>{let o=e.some(l=>l.docChanged)&&!n.doc.eq(r.doc),s=e.some(l=>l.getMeta(\"preventAutolink\"));if(!o||s)return;let{tr:a}=r,i=fA(n.doc,[...e]);if(!e.some(mx)){let l=[];i.steps.forEach((u,c)=>{if(!(u instanceof Rt)||!u.slice.size)return;let d=i.mapping.slice(c+1),f=d.map(u.from,1),p=d.map(u.from+u.slice.size,-1);f<p&&l.push({from:f,to:p})}),l.sort((u,c)=>c.to-u.to),l.forEach(u=>vQ(a,u,t.type))}if(cf(i).forEach(({newRange:l})=>{let u=Mz(r.doc,l,f=>f.isTextblock),c,d;if(u.length>1)c=u[0],d=r.doc.textBetween(c.pos,c.pos+c.node.nodeSize,void 0,\" \");else if(u.length){let f=r.doc.textBetween(l.from,l.to,\" \",\" \");if(!gQ.test(f))return;c=u[0],d=r.doc.textBetween(c.pos,l.to,void 0,\" \")}if(c&&d){let f=d.split(mQ).filter(Boolean);if(f.length<=0)return!1;let p=f[f.length-1],h=c.pos+d.lastIndexOf(p);if(!p)return!1;let g=mf(p).map(m=>m.toObject(t.defaultProtocol));if(!xQ(g))return!1;g.filter(m=>m.isLink).map(m=>({...m,from:h+m.start+1,to:h+m.end+1})).filter(m=>r.schema.marks.code?!r.doc.rangeHasMark(m.from,m.to,r.schema.marks.code):!0).filter(m=>t.validate(m.value)).filter(m=>t.shouldAutoLink(m.value)).forEach(m=>{Qm(m.from,m.to,r.doc).some(y=>y.mark.type===t.type)||a.addMark(m.from,m.to,t.type.create({href:m.href}))})}}),!!a.steps.length)return a}})}function SQ(t){return new ie({key:new we(\"handleClickLink\"),props:{handleClick:(e,n,r)=>{if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{let l=r.target;if(!l)return!1;let u=t.editor.view.dom;o=l.closest(\"a\"),o&&!u.contains(o)&&(o=null)}if(!o)return!1;let s=!1;if(t.enableClickSelection&&(s=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var a,i;let l=Nz(e.state,t.type.name),u=(a=o.href)!==null&&a!==void 0?a:l.href,c=(i=o.target)!==null&&i!==void 0?i:l.target;u&&(window.open(u,c),s=!0)}return s}}})}var kQ=/\\[([^[\\]]+)\\]\\(((?:[^\\s()]|\\([^\\s()]*\\))+)(?:\\s+(?:([\"'])(.*?)\\3|“(.*?)”|‘(.*?)’))?\\)$/,CQ=/\\[([^[\\]]+)\\]\\(((?:[^\\s()]|\\([^\\s()]*\\))+)(?:\\s+(?:([\"'])(.*?)\\3|“(.*?)”|‘(.*?)’))?\\)/g;function kF(t,e){let n=0;for(let r=e-1;r>=0&&t[r]===\"\\\\\";r-=1)n+=1;return n%2===1}function LQ(t,e){let n=0,r=0;for(;r<e;){if(t[r]!==\"`\"){r+=1;continue}if(n===0&&kF(t,r)){r+=1;continue}let o=0;for(;r<e&&t[r]===\"`\";)o+=1,r+=1;n===0?n=o:o===n&&(n=0)}return n>0}function CF(t,e,n){var r,o;let[,s,a]=e;return(e.index?t[e.index-1]:void 0)===\"!\"||kF(t,(r=e.index)!==null&&r!==void 0?r:0)||LQ(t,(o=e.index)!==null&&o!==void 0?o:0)?!1:!!s.trim()&&n(a)}function LF(t){var e,n;let[r,o,s,,a,i,l]=t,u=(e=a??i)!==null&&e!==void 0?e:l;return{index:(n=t.index)!==null&&n!==void 0?n:0,text:r,replaceWith:o,data:{href:s,title:u||null,markdown:!0}}}function AQ(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function AF(t){var e,n,r;return{href:(e=t.data)===null||e===void 0?void 0:e.href,title:(n=(r=t.data)===null||r===void 0?void 0:r.title)!==null&&n!==void 0?n:null}}function EQ(t){let e=Do({find:n=>{let r=kQ.exec(n);return!r||!CF(n,r,t.isAllowedHref)?null:LF(r)},type:t.type,getAttributes:AF});return new df({find:e.find,handler:n=>{let r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta(\"preventAutolink\",!0),r}})}function TQ(t){let e=Qr({find:n=>{var r,o;let s=[];for(let i of n.matchAll(CQ))CF(n,i,t.isAllowedHref)&&s.push(LF(i));let a=((r=(o=t.findPlainUrls)===null||o===void 0?void 0:o.call(t,n))!==null&&r!==void 0?r:[]).filter(i=>!s.some(l=>AQ(l,i)));return[...s,...a]},type:t.type,getAttributes:AF});return new yA({find:e.find,handler:n=>{var r;let o=e.handler(n);return o!==null&&n.state.tr.steps.length&&(!((r=n.match.data)===null||r===void 0)&&r.markdown)&&n.state.tr.setMeta(\"preventAutolink\",!0),o}})}function RQ(t){return new ie({key:new we(\"handlePasteLink\"),props:{handlePaste:(e,n,r)=>{let{shouldAutoLink:o}=t,{state:s}=e,{selection:a}=s,{empty:i}=a;if(i)return!1;let l=\"\";r.content.forEach(c=>{l+=c.textContent});let u=gf(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!u||o!==void 0&&!o(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function Ha(t,e){let n=[\"http\",\"https\",\"ftp\",\"ftps\",\"mailto\",\"tel\",\"callto\",\"sms\",\"cid\",\"xmpp\"];return e&&e.forEach(r=>{let o=typeof r==\"string\"?r:r.scheme;o&&n.push(o)}),!t||t.replace(bQ,\"\").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")).join(\"|\")}):|[^a-z]|[a-z0-9+.\\\\-]+(?:[^a-z+.\\\\-:]|$))`,\"i\"))}var EF=Zr.create({name:\"link\",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn(\"The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.\")),this.options.protocols.forEach(t=>{if(typeof t==\"string\"){hf(t);return}hf(t.scheme,t.optionalSlashes)})},onDestroy(){R0()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:\"http\",HTMLAttributes:{target:\"_blank\",rel:\"noopener noreferrer nofollow\",class:null},isAllowedUri:(t,e)=>!!Ha(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{let e=/^[a-z][a-z0-9+.-]*:\\/\\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes(\"@\"))return!0;let r=(t.includes(\"@\")?t.split(\"@\").pop():t).split(/[/?#:]/)[0];return!(/^\\d{1,3}(\\.\\d{1,3}){3}$/.test(r)||!/\\./.test(r))}}},addAttributes(){var t,e,n;return{href:{default:null,parseHTML(r){return r.getAttribute(\"href\")}},target:{default:(t=this.options.HTMLAttributes.target)!==null&&t!==void 0?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(n=this.options.HTMLAttributes.class)!==null&&n!==void 0?n:null},title:{default:null}}},parseHTML(){return[{tag:\"a[href]\",getAttrs:t=>{let e=t.getAttribute(\"href\");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Ha(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Ha(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[\"a\",We(this.options.HTMLAttributes,t),0]:[\"a\",We(this.options.HTMLAttributes,{...t,href:\"\"}),0]},markdownTokenName:\"link\",parseMarkdown:(t,e)=>e.applyMark(\"link\",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,o,s;let a=(n=(r=t.attrs)===null||r===void 0?void 0:r.href)!==null&&n!==void 0?n:\"\",i=(o=(s=t.attrs)===null||s===void 0?void 0:s.title)!==null&&o!==void 0?o:\"\",l=e.renderChildren(t);return i?`[${l}](${a} \"${i}\")`:`[${l}](${a})`},addCommands(){return{setLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ha(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta(\"preventAutolink\",!0).run():!1},toggleLink:t=>({chain:e})=>{let{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Ha(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta(\"preventAutolink\",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(\"preventAutolink\",!0).run()}},addInputRules(){return this.options.markdownLinks?[EQ({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Ha(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let t=e=>{let n=[];if(e){let{protocols:r,defaultProtocol:o}=this.options;gf(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!Ha(a,r),protocols:r,defaultProtocol:o})).forEach(s=>{this.options.shouldAutoLink(s.value)&&n.push({text:s.value,data:{href:s.href},index:s.start})})}return n};return this.options.markdownLinks?[TQ({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!Ha(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[Qr({find:t,type:this.type,getAttributes:e=>{var n;return{href:(n=e.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){let t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(wQ({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Ha(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(SQ({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===\"whenNotEditable\"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(RQ({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}});var IQ=\"listItem\",TF=\"textStyle\",RF=/^\\s*([-+*])\\s$/,UA=zt.create({name:\"bulletList\",addOptions(){return{itemTypeName:\"listItem\",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:\"block list\",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:\"ul\"}]},renderHTML({HTMLAttributes:t}){return[\"ul\",We(this.options.HTMLAttributes,t),0]},markdownTokenName:\"list\",parseMarkdown:(t,e)=>t.type!==\"list\"||t.ordered?[]:{type:\"bulletList\",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`\n`):\"\",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(IQ,this.editor.getAttributes(TF)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-8\":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Xi({find:RF,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Xi({find:RF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(TF),editor:this.editor})),[t]}}),MQ=(t,e,n)=>{let{selection:r}=t;if(!r.empty)return null;let{$from:o}=r;if(!o.parent.isTextblock||o.parentOffset!==o.parent.content.size)return null;let s=-1;for(let p=o.depth;p>0;p-=1)if(o.node(p).type.name===e){s=p;break}if(s<0)return null;let a=o.node(s),i=o.index(s);if(i+1>=a.childCount)return null;let l=a.child(i+1);if(!n.includes(l.type.name))return null;let u=t.schema.nodes[e],c=!1;if(l.forEach(p=>{p.type===u&&p.childCount>1&&(c=!0)}),!c)return null;let d=t.doc.resolve(o.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:s,nestedList:d,nestedListPos:o.after(),insertPos:o.after(s),items:f}},_Q=(t,e,n,r)=>{let o=MQ(t,n,r);if(!o)return!1;let{selection:s}=t,{nestedList:a,nestedListPos:i,insertPos:l,items:u}=o,c=t.tr;c.delete(i,i+a.nodeSize);let d=c.mapping.map(l);return c.insert(d,H.from(u)),c.setSelection(s.map(c.doc,c.mapping)),e&&e(c),!0},OQ=(t,e,n)=>_Q(t.state,t.view.dispatch,e,n),BF=(t,e)=>St.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>OQ(this.editor,t,e);return{Delete:n,\"Mod-Delete\":n}}}),zF=[[1e3,\"m\"],[900,\"cm\"],[500,\"d\"],[400,\"cd\"],[100,\"c\"],[90,\"xc\"],[50,\"l\"],[40,\"xl\"],[10,\"x\"],[9,\"ix\"],[5,\"v\"],[4,\"iv\"],[1,\"i\"]],M0=\"abcdefghijklmnopqrstuvwxyz\",FF=String.raw`\\d+|[ivxlcdmIVXLCDM]+|${\"[a-zA-Z]{1,2}\"}`;function D0(t){let e=t,n=\"\";for(let[r,o]of zF)for(;e>=r;)n+=o,e-=r;return n}function jA(t){return D0(t).toUpperCase()}function HF(t){let e=t.toLowerCase(),n=0,r=0;for(;n<e.length;){let o=!1;for(let[s,a]of zF)if(e.startsWith(a,n)){r+=s,n+=a.length,o=!0;break}if(!o)return 0}return r}function DQ(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;let e=HF(t);return e<=0?!1:(t===t.toLowerCase()?D0(e):jA(e))===t}function NQ(t){let e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){let n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function _0(t){if(t<=26)return M0[t-1];let e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?M0[n]:M0[e]+M0[n]}function N0(t){if(!(!t||/^\\d+$/.test(t))){if(DQ(t))return t===t.toLowerCase()?\"i\":\"I\";if(/^[a-z]{1,2}$/.test(t))return\"a\";if(/^[A-Z]{1,2}$/.test(t))return\"A\"}}function qA(t){if(/^\\d+$/.test(t))return parseInt(t,10);let e=N0(t);if(e===\"i\"||e===\"I\")return HF(t);if(e===\"a\"||e===\"A\"){let r=NQ(t);return r>0?r:1}let n=parseInt(t,10);return Number.isNaN(n)?1:n}function PQ(t,e){if(t===\"numeric\")return String(e);switch(t){case\"a\":return _0(e);case\"A\":return _0(e).toUpperCase();case\"i\":return D0(e);case\"I\":return jA(e);default:return String(e)}}function BQ(t){var e;if(t.length===0)return!1;let n=(e=N0(t[0]))!==null&&e!==void 0?e:\"numeric\",r=qA(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){let s=PQ(n,r+o);if(t[o]!==s)return!1}return!0}function zQ(t){return{type:N0(t),start:qA(t)}}function FQ(t){let{type:e,start:n}=zQ(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function HQ(t,e,n=\". \"){let r=e+1;if(!t||t===\"1\")return`${r}${n}`;switch(t){case\"a\":return`${_0(r)}${n}`;case\"A\":return`${_0(r).toUpperCase()}${n}`;case\"i\":return`${D0(r)}${n}`;case\"I\":return`${jA(r)}${n}`;default:return`${r}${n}`}}function $Q(t){var e,n;let r=(e=t.tokens)===null||e===void 0?void 0:e[0];return!!(t.text&&((n=t.tokens)===null||n===void 0?void 0:n.length)===1&&r?.type===\"list\"&&r.ordered&&r.raw===t.text)}function UQ(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:\"text\",raw:t,text:t}])}var VA=zt.create({name:\"listItem\",addOptions(){return{HTMLAttributes:{},bulletListTypeName:\"bulletList\",orderedListTypeName:\"orderedList\"}},content:\"paragraph block*\",defining:!0,parseHTML(){return[{tag:\"li\"}]},renderHTML({HTMLAttributes:t}){return[\"li\",We(this.options.HTMLAttributes,t),0]},markdownTokenName:\"list_item\",parseMarkdown:(t,e)=>{var n;if(t.type!==\"list_item\")return[];let r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren,o=[];if(t.tokens&&t.tokens.length>0){if($Q(t))return{type:\"listItem\",content:[{type:\"paragraph\",content:UQ(t.text||\"\",e)}]};if(t.tokens.some(s=>s.type===\"paragraph\"))o=r(t.tokens);else{let s=t.tokens[0];if(s&&s.type===\"text\"&&s.tokens&&s.tokens.length>0){if(o=[{type:\"paragraph\",content:e.parseInline(s.tokens)}],t.tokens.length>1){let a=r(t.tokens.slice(1));o.push(...a)}}else o=r(t.tokens)}}return o.length===0&&(o=[{type:\"paragraph\",content:[]}]),{type:\"listItem\",content:o}},renderMarkdown:(t,e,n)=>mA(t,e,r=>{if(r.parentType===\"bulletList\")return\"- \";if(r.parentType===\"orderedList\"){var o,s;let a=((o=r.meta)===null||o===void 0||(o=o.parentAttrs)===null||o===void 0?void 0:o.start)||1;return HQ((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.type,a-1+(r.index||0),\". \")}return\"- \"},n,{alignNestedToPrefix:n?.parentType===\"orderedList\"}),addExtensions(){return[BF(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),\"Shift-Tab\":()=>this.editor.commands.liftListItem(this.name)}}}),KA=(t,e)=>{let{$from:n}=e.selection,r=nn(t,e.schema),o=null,s=n.depth,a=n.pos,i=null;for(;s>0&&i===null;)o=n.node(s),o.type===r?i=s:(s-=1,a-=1);return i===null?null:{$pos:e.doc.resolve(a),depth:i}},$F=(t,e)=>{let n=KA(t,e);if(!n)return!1;let[,r]=Pz(e,t,n.$pos.pos+4);return r},jQ=(t,e,n)=>{let{$anchor:r}=t.selection,o=Math.max(0,r.pos-2),s=t.doc.resolve(o).node();return!(!s||!n.includes(s.type.name))},IF=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Wi(t.state,e)&&jQ(t.state,e,n)){let{$anchor:s}=t.state.selection,a=t.state.doc.resolve(s.before()-1),i=[];a.node().descendants((c,d)=>{c.type.name===e&&i.push({node:c,pos:d})});let l=i.at(-1);if(!l)return!1;let u=t.state.doc.resolve(a.start()+l.pos+1);return t.chain().cut({from:s.start()-1,to:s.end()+1},u.end()).joinForward().run()}if(!Wi(t.state,e)||!Fz(t.state))return!1;let{$from:r}=t.state.selection,o=r.depth-1;return r.node(o).type!==t.schema.nodes[e]||r.index(o)!==0?!1:t.chain().liftListItem(e).run()},qQ=(t,e)=>{let n=$F(t,e),r=KA(t,e);return!r||!n?!1:n>r.depth},VQ=(t,e)=>{let n=$F(t,e),r=KA(t,e);return!r||!n?!1:n<r.depth},MF=(t,e)=>{if(!Wi(t.state,e)||!zz(t.state,e))return!1;let{selection:n}=t.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:qQ(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():VQ(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},KQ=(t,e,n)=>{let{state:r}=t,{selection:o}=r;if(!o.empty)return!1;let{$from:s}=o;if(s.parentOffset!==0||!s.parent.isTextblock||Wi(r,e))return!1;let a=Bz(s);if(!a||!n.includes(a.type.name))return!1;let i=a.lastChild;if(!i||i.type.name!==e)return!1;let l=s.parent;if(!i.canReplace(i.childCount,i.childCount,H.from(l)))return!1;let u=s.before(),c=s.after(),d=u-2;return t.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(u,c).insert(d,H.from(l)),f.setSelection(J.create(f.doc,d+1)),f.scrollIntoView()),!0))};var GA=St.create({name:\"listKeymap\",addOptions(){return{listTypes:[{itemName:\"listItem\",wrapperNames:[\"bulletList\",\"orderedList\"]},{itemName:\"taskItem\",wrapperNames:[\"taskList\"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&MF(t,n)&&(e=!0)}),e},\"Mod-Delete\":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&MF(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&IF(t,n,r)&&(e=!0)}),e},\"Mod-Backspace\":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&IF(t,n,r)&&(e=!0)}),e},Tab:({editor:t})=>{for(let{itemName:e,wrapperNames:n}of this.options.listTypes)if(t.state.schema.nodes[e]!==void 0&&KQ(t,e,n))return!0;return!1}}}}),O0=new RegExp(`^(\\\\s*)(${FF})([.)])\\\\s+(.*)$`),GQ=/^\\s/,yf={heading:/^#{1,6}(?:\\s|$)/,bulletItem:/^[-+*]\\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\\$\\$/,thematicBreak:/^(?:(?:-[ \\t]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})$/};function WQ(t){return O0.test(t.trimStart())}function XQ(t){let e=t.trimStart();return yf.bulletItem.test(e)||WQ(e)||yf.heading.test(e)||yf.thematicBreak.test(e)&&!e.startsWith(\"-\")||/^>\\s?/.test(e)||yf.codeFence.test(e)||yf.blockMath.test(e)}function JQ(t){return Object.values(yf).some(e=>e.test(t))}function YQ(t){let e=[],n=[],r=!1;return t.forEach(o=>{if(r){n.push(o);return}if(o.trim()===\"\"){r=!0,n.push(o);return}if(e.length>0&&XQ(o)){r=!0,n.push(o);return}e.push(o)}),{paragraphLines:e,blockLines:n}}function _F(t){let e=[],n=0,r=0;for(;n<t.length;){let o=t[n],s=o.match(O0);if(!s)break;let[,a,i,l,u]=s,c=a.length,d=parseInt(i,10),f=isNaN(d)?N0(i):void 0,p=isNaN(d)?qA(i):d,h=[u],g=n+1,m=[o],y=!1;for(;g<t.length;){let b=t[g];if(b.match(O0))break;if(b.trim()===\"\")m.push(b),h.push(\"\"),y=!0,g+=1;else if(b.match(GQ)){let x=b.length-b.trimStart().length,v=c+i.length+1;m.push(b),h.push(b.slice(Math.min(x,v))),g+=1}else{if(y||JQ(b))break;m.push(b),h.push(b),g+=1}}e.push({indent:c,number:p,type:f,content:h.join(`\n`).trim(),contentLines:h,raw:m.join(`\n`)}),r=g,n=g}return[e,r]}var ZQ=new RegExp(`^(${FF})([.)])\\\\s+(.+)$`);function QQ(t){let e=t.split(`\n`).filter(r=>r.trim().length>0);if(e.length===0)return null;let n=[];for(let r of e){let o=r.trim().match(ZQ);if(!o)return null;n.push({marker:o[1],content:o[3]})}return BQ(n.map(r=>r.marker))?{type:\"orderedList\",attrs:FQ(n[0].marker),content:n.map(r=>({type:\"listItem\",content:[{type:\"paragraph\",content:[{type:\"text\",text:r.content}]}]}))}:null}function UF(t,e,n){let r=[],o=0;for(;o<t.length;){let s=t[o];if(s.indent===e){let{paragraphLines:a,blockLines:i}=YQ(s.contentLines),l=a.join(`\n`).trim(),u=[];l&&u.push({type:\"paragraph\",raw:l,tokens:n.inlineTokens(l)});let c=i.join(`\n`).trim();if(c){let p=n.blockTokens(c);u.push(...p)}let d=o+1,f=[];for(;d<t.length&&t[d].indent>e;)f.push(t[d]),d+=1;if(f.length>0){let p=UF(f,Math.min(...f.map(h=>h.indent)),n);u.push({type:\"list\",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(h=>h.raw).join(`\n`)})}r.push({type:\"list_item\",raw:s.raw,tokens:u}),o=d}else o+=1}return r}function eee(t,e){return t.map(n=>{if(n.type!==\"list_item\")return e.parseChildren([n])[0];let r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type===\"paragraph\"||o.type===\"list\"||o.type===\"blockquote\"||o.type===\"code\")r.push(...e.parseChildren([o]));else if(o.type===\"text\"&&o.tokens){let s=e.parseChildren([o]);r.push({type:\"paragraph\",content:s})}else{let s=e.parseChildren([o]);s.length>0&&r.push(...s)}}),{type:\"listItem\",content:r}})}var tee=64;function OF(t,e){let n=[],r=0;for(;n.length<e;){let o=t.indexOf(`\n`,r);if(o===-1)return n.push(t.slice(r)),n;n.push(t.slice(r,o)),r=o+1}return n}function nee(t){let e=t.indexOf(`\n`),n=e===-1?t:t.slice(0,e);if(!O0.test(n))return[[],0,[]];let r=tee,o=OF(t,r),s=_F(o);for(;s[1]===o.length&&o.length===r;)r*=2,o=OF(t,r),s=_F(o);return[s[0],s[1],o]}var ree=\"listItem\",DF=\"textStyle\",NF=/^(\\d+)\\.\\s$/;function PF(t){let e=t.match(/list-style-type\\s*:\\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case\"upper-roman\":return\"I\";case\"lower-roman\":return\"i\";case\"upper-alpha\":case\"upper-latin\":return\"A\";case\"lower-alpha\":case\"lower-latin\":return\"a\";default:return null}}var WA=zt.create({name:\"orderedList\",addOptions(){return{itemTypeName:\"listItem\",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:\"block list\",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute(\"start\")?parseInt(t.getAttribute(\"start\")||\"\",10):1},type:{default:null,parseHTML:t=>{let e=t.getAttribute(\"type\");if(e)return e;let n=t.getAttribute(\"style\");if(n){let o=PF(n);if(o)return o}let r=t.querySelector(\"li\");if(r){let o=r.getAttribute(\"style\");if(o){let s=PF(o);if(s)return s}}return null}}}},parseHTML(){return[{tag:\"ol\"}]},renderHTML({HTMLAttributes:t}){let{start:e,type:n,...r}=t,o=We(this.options.HTMLAttributes,r);return e!==1&&(o.start=e),n&&n!==\"1\"&&(o.type=n),[\"ol\",o,0]},markdownTokenName:\"list\",parseMarkdown:(t,e)=>{if(t.type!==\"list\"||!t.ordered)return[];let n=t.start||1,r=t.typeMarker,o=t.items?eee(t.items,e):[],s={};return n!==1&&(s.start=n),r&&(s.type=r),Object.keys(s).length>0?{type:\"orderedList\",attrs:s,content:o}:{type:\"orderedList\",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`\n`):\"\",markdownTokenizer:{name:\"orderedList\",level:\"block\",start:()=>-1,tokenize:(t,e,n)=>{var r,o;let[s,a,i]=nee(t);if(s.length===0)return;let l=UF(s,s[0].indent,n);if(l.length!==0)return{type:\"list\",ordered:!0,start:((r=s[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(o=s[0])===null||o===void 0?void 0:o.type,items:l,raw:i.slice(0,a).join(`\n`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ree,this.editor.getAttributes(DF)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-7\":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new ie({props:{handlePaste:(t,e)=>{var n,r;let o=(n=e.clipboardData)===null||n===void 0?void 0:n.getData(\"text/html\");if(o?.trim())return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData(\"text/plain\");if(!s)return!1;let a=QQ(s);if(!a)return!1;try{let i=t.state.schema.nodeFromJSON(a),l=t.state.tr.replaceSelectionWith(i);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){let t=(n,r)=>(!r.attrs.type||r.attrs.type===\"1\")&&r.childCount+r.attrs.start===+n[1],e=Xi({find:NF,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Xi({find:NF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(DF)}),joinPredicate:t,editor:this.editor})),[e]}}),oee=/^\\s*(\\[([( |x])?\\])\\s$/,see=\"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0\",aee=(t,e,n)=>{var r;return(n==null||(r=n.checkboxLabel)===null||r===void 0?void 0:r.call(n,t,e))||`Task item checkbox for ${t.textContent||\"empty task item\"}`},iee=zt.create({name:\"taskItem\",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:\"taskList\",a11y:void 0}},content(){return this.options.nested?\"paragraph block*\":\"paragraph+\"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute(\"data-checked\");return e===\"\"||e===\"true\"},renderHTML:t=>({\"data-checked\":t.checked})}}},parseHTML(){return[{tag:`li[data-type=\"${this.name}\"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector(\"div\"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return[\"li\",We(this.options.HTMLAttributes,e,{\"data-type\":this.name}),[\"label\",[\"input\",{type:\"checkbox\",checked:t.attrs.checked?\"checked\":null}],[\"span\"]],[\"div\",0]]},parseMarkdown:(t,e)=>{let n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode(\"paragraph\",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode(\"paragraph\",{},[e.createNode(\"text\",{text:t.text})])):n.push(e.createNode(\"paragraph\",{},[])),t.nestedTokens&&t.nestedTokens.length>0){let r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode(\"taskItem\",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;let r=`- [${!((n=t.attrs)===null||n===void 0)&&n.checked?\"x\":\" \"}] `;return mA(t,e,r)},addExtensions(){return this.options.nested?[BF(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),\"Shift-Tab\":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{let o=document.createElement(\"li\"),s=document.createElement(\"label\"),a=document.createElement(\"span\"),i=document.createElement(\"input\"),l=document.createElement(\"div\");a.style.cssText=see;let u=d=>{let f=aee(d,d.attrs.checked,this.options.a11y);i.setAttribute(\"aria-label\",f),a.textContent=f};u(t),s.contentEditable=\"false\",i.type=\"checkbox\",i.addEventListener(\"mousedown\",d=>d.preventDefault()),i.addEventListener(\"change\",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){i.checked=!i.checked;return}let{checked:f}=d.target;r.isEditable&&typeof n==\"function\"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{let h=n();if(typeof h!=\"number\")return!1;let g=p.doc.nodeAt(h);return p.setNodeMarkup(h,void 0,{...g?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(i.checked=!i.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{o.setAttribute(d,f)}),o.dataset.checked=t.attrs.checked,i.checked=t.attrs.checked,s.append(i,a),o.append(s,l),Object.entries(e).forEach(([d,f])=>{o.setAttribute(d,f)});let c=new Set(Object.keys(e));return{dom:o,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;o.dataset.checked=d.attrs.checked,i.checked=d.attrs.checked,u(d);let f=r.extensionManager.attributes,p=uf(d,f),h=new Set(Object.keys(p)),g=this.options.HTMLAttributes;return c.forEach(m=>{h.has(m)||(m in g?o.setAttribute(m,g[m]):o.removeAttribute(m))}),Object.entries(p).forEach(([m,y])=>{y==null?m in g?o.setAttribute(m,g[m]):o.removeAttribute(m):o.setAttribute(m,y)}),c=h,!0}}}},addInputRules(){return[Xi({find:oee,type:this.type,getAttributes:t=>({checked:t[t.length-1]===\"x\"})})]}}),lee=zt.create({name:\"taskList\",addOptions(){return{itemTypeName:\"taskItem\",HTMLAttributes:{}}},group:\"block list\",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type=\"${this.name}\"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return[\"ul\",We(this.options.HTMLAttributes,t,{\"data-type\":this.name}),0]},parseMarkdown:(t,e)=>e.createNode(\"taskList\",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`\n`):\"\",markdownTokenizer:{name:\"taskList\",level:\"block\",start(t){var e;let n=(e=t.match(/^\\s*[-+*]\\s+\\[([ xX])\\]\\s+/))===null||e===void 0?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){let r=s=>{let a=hA(s,{itemPattern:/^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()===\"x\"}),createToken:(i,l)=>({type:\"taskItem\",raw:\"\",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:l}),customNestedParser:r},n);if(a){let i={type:\"taskList\",raw:a.raw,items:a.items},l=s.slice(a.raw.length);return l.trim()?[i,...n.blockTokens(l)]:[i]}return n.blockTokens(s)},o=hA(t,{itemPattern:/^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()===\"x\"}),createToken:(s,a)=>({type:\"taskItem\",raw:\"\",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:r},n);if(o)return{type:\"taskList\",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{\"Mod-Shift-9\":()=>this.editor.commands.toggleTaskList()}}}),Lhe=St.create({name:\"listKit\",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(UA.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(VA.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(GA.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(WA.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(iee.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(lee.configure(this.options.taskList)),t}});var P0=\" \",XA=\"\\xA0\",jF=zt.create({name:\"paragraph\",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:\"block\",content:\"inline*\",parseHTML(){return[{tag:\"p\"}]},renderHTML({HTMLAttributes:t}){return[\"p\",We(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{let n=t.tokens||[];if(n.length===1&&n[0].type===\"image\")return e.parseChildren([n[0]]);let r=e.parseInline(n);return n.length===1&&n[0].type===\"text\"&&(n[0].raw===P0||n[0].text===P0||n[0].raw===XA||n[0].text===XA)&&r.length===1&&r[0].type===\"text\"&&(r[0].text===P0||r[0].text===XA)?e.createNode(\"paragraph\",void 0,[]):e.createNode(\"paragraph\",void 0,r)},renderMarkdown:(t,e,n)=>{if(!t)return\"\";let r=Array.isArray(t.content)?t.content:[];if(r.length===0){var o,s;let a=Array.isArray(n==null||(o=n.previousNode)===null||o===void 0?void 0:o.content)?n.previousNode.content:[];return(n==null||(s=n.previousNode)===null||s===void 0?void 0:s.type)===\"paragraph\"&&a.length===0?P0:\"\"}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{\"Mod-Alt-0\":()=>this.editor.commands.setParagraph()}}});var uee=/(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))$/,cee=/(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))/g,qF=Zr.create({name:\"strike\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"s\"},{tag:\"del\"},{tag:\"strike\"},{style:\"text-decoration\",consuming:!1,getAttrs:t=>t.includes(\"line-through\")?{}:!1}]},renderHTML({HTMLAttributes:t}){return[\"s\",We(this.options.HTMLAttributes,t),0]},markdownTokenName:\"del\",parseMarkdown:(t,e)=>e.applyMark(\"strike\",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-Shift-s\":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Do({find:uee,type:this.type})]},addPasteRules(){return[Qr({find:cee,type:this.type})]}});var VF=zt.create({name:\"text\",group:\"inline\",parseMarkdown:t=>({type:\"text\",text:t.text||\"\"}),renderMarkdown:t=>t.text||\"\"});var KF=Zr.create({name:\"underline\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"u\"},{style:\"text-decoration\",consuming:!1,getAttrs:t=>t.includes(\"underline\")?{}:!1}]},renderHTML({HTMLAttributes:t}){return[\"u\",We(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||\"underline\",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:\"underline\",level:\"inline\",start(t){return t.indexOf(\"++\")},tokenize(t,e,n){let r=/^(\\+\\+)([\\s\\S]+?)(\\+\\+)/.exec(t);if(!r)return;let o=r[2].trim();return{type:\"underline\",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-u\":()=>this.editor.commands.toggleUnderline(),\"Mod-U\":()=>this.editor.commands.toggleUnderline()}}});function GF(t={}){return new ie({view(e){return new JA(e,t)}})}var JA=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||\"black\",this.class=n.class,this.handlers=[\"dragover\",\"dragend\",\"drop\",\"dragleave\"].map(o=>{let s=a=>{this[o](a)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){if(this.cursorPos!=null&&n.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,o=this.editorView.dom,s=o.getBoundingClientRect(),a=s.width/o.offsetWidth,i=s.height/o.offsetHeight;if(n){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let h=p.getBoundingClientRect(),g=d?h.bottom:h.top;d&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*i;r={left:h.left,right:h.right,top:g-m,bottom:g+m}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*a;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement(\"div\")),this.class&&(this.element.className=this.class),this.element.style.cssText=\"position: absolute; z-index: 50; pointer-events: none;\",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(\"prosemirror-dropcursor-block\",n),this.element.classList.toggle(\"prosemirror-dropcursor-inline\",!n);let u,c;if(!l||l==document.body&&getComputedStyle(l).position==\"static\")u=-pageXOffset,c=-pageYOffset;else{let d=l.getBoundingClientRect(),f=d.width/l.offsetWidth,p=d.height/l.offsetHeight;u=d.left-l.scrollLeft*f,c=d.top-l.scrollTop*p}this.element.style.left=(r.left-u)/a+\"px\",this.element.style.top=(r.top-c)/i+\"px\",this.element.style.width=(r.right-r.left)/a+\"px\",this.element.style.height=(r.bottom-r.top)/i+\"px\"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o==\"function\"?o(this.editorView,n,e):o;if(!n||s)return null;let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let i=Pv(this.editorView.state.doc,a,this.editorView.dragging.slice);i!=null&&(a=i)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let n=this.computeTarget(e);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};var Wn=class t extends pe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):pe.near(r)}content(){return G.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:\"gapcursor\",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!=\"number\")throw new RangeError(\"Invalid input for GapCursor.fromJSON\");return new t(e.resolve(n.pos))}getBookmark(){return new YA(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!dee(e)||!fee(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&t.valid(e))return e;let o=e.pos,s=null;for(let a=e.depth;;a--){let i=e.node(a);if(n>0?e.indexAfter(a)<i.childCount:e.index(a)>0){s=i.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;o+=n;let l=e.doc.resolve(o);if(t.valid(l))return l}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!oe.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=a,o+=n;let i=e.doc.resolve(o);if(t.valid(i))return i}return null}}};Wn.prototype.visible=!1;Wn.findFrom=Wn.findGapCursorFrom;pe.jsonID(\"gapcursor\",Wn);var YA=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Wn.valid(n)?new Wn(n):pe.near(n)}};function WF(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function dee(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||WF(o.type))return!0;if(o.inlineContent)return!1}}return!0}function fee(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||WF(o.type))return!0;if(o.inlineContent)return!1}}return!0}function XF(){return new ie({props:{decorations:gee,createSelectionBetween(t,e,n){return e.pos==n.pos&&Wn.valid(n)?new Wn(n):null},handleClick:hee,handleKeyDown:pee,handleDOMEvents:{beforeinput:mee}}})}var pee=I1({ArrowLeft:B0(\"horiz\",-1),ArrowRight:B0(\"horiz\",1),ArrowUp:B0(\"vert\",-1),ArrowDown:B0(\"vert\",1)});function B0(t,e){let n=t==\"vert\"?e>0?\"down\":\"up\":e>0?\"right\":\"left\";return function(r,o,s){let a=r.selection,i=e>0?a.$to:a.$from,l=a.empty;if(a instanceof J){if(!s.endOfTextblock(n)||i.depth==0)return!1;l=!1,i=r.doc.resolve(e>0?i.after():i.before())}let u=Wn.findGapCursorFrom(i,e,l);return u?(o&&o(r.tr.setSelection(new Wn(u))),!0):!1}}function hee(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Wn.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&oe.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Wn(r))),!0)}function mee(t,e){if(e.inputType!=\"insertCompositionText\"||!(t.state.selection instanceof Wn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=H.empty;for(let a=r.length-1;a>=0;a--)o=H.from(r[a].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new G(o,0,0));return s.setSelection(J.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function gee(t){if(!(t.selection instanceof Wn))return null;let e=document.createElement(\"div\");return e.className=\"ProseMirror-gapcursor\",He.create(t.doc,[yn.widget(t.selection.head,e,{key:\"gapcursor\"})])}var Qhe=St.create({name:\"characterCount\",addOptions(){return{limit:null,autoTrim:!0,mode:\"textSize\",textCounter:t=>t.length,wordCounter:t=>t.split(\" \").filter(e=>e!==\"\").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{let e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)===\"textSize\"){let n=e.textBetween(0,e.content.size,void 0,\" \");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{let e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size,\" \",\" \");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new ie({key:new we(\"characterCount\"),appendTransaction:(e,n,r)=>{if(t)return;let o=this.options.limit,s=this.options.autoTrim;if(o==null||o===0||s===!1){t=!0;return}let a=this.storage.characters({node:r.doc});if(a>o){let i=a-o,l=0,u=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);let c=r.tr.deleteRange(l,u);return t=!0,c}t=!0},filterTransaction:(e,n)=>{let r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;let o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta(\"paste\"))return!1;let a=e.selection.$head.pos,i=a-(s-r),l=a;return e.deleteRange(i,l),!(this.storage.characters({node:e.doc})>r)}})]}}),ZF=St.create({name:\"dropCursor\",addOptions(){return{color:\"currentColor\",width:1,class:void 0}},addProseMirrorPlugins(){return[GF(this.options)]}}),eme=St.create({name:\"focus\",addOptions(){return{className:\"has-focus\",mode:\"all\"}},addProseMirrorPlugins(){return[new ie({key:new we(\"focus\"),props:{decorations:({doc:t,selection:e})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return He.create(t,[]);let a=0;this.options.mode===\"deepest\"&&t.descendants((l,u)=>{if(!l.isText){if(!(o>=u&&o<=u+l.nodeSize-1))return!1;a+=1}});let i=0;return t.descendants((l,u)=>{if(l.isText||!(o>=u&&o<=u+l.nodeSize-1))return!1;if(i+=1,this.options.mode===\"deepest\"&&a-i>0||this.options.mode===\"shallowest\"&&i>1)return this.options.mode===\"deepest\";s.push(yn.node(u,u+l.nodeSize,{class:this.options.className}))}),He.create(t,s)}}})]}}),QF=St.create({name:\"gapCursor\",addProseMirrorPlugins(){return[XF()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ze(se(t,\"allowGapCursor\",n)))!==null&&e!==void 0?e:null}}}),eH=\"placeholder\",JF=new we(\"tiptap__placeholder\");function tH(t){let{editor:e,placeholder:n,dataAttribute:r,pos:o,node:s,isEmptyDoc:a,hasAnchor:i,classes:{emptyNode:l,emptyEditor:u}}=t,c=[l];return a&&c.push(u),yn.node(o,o+s.nodeSize,{class:c.join(\" \"),[r]:typeof n==\"function\"?n({editor:e,node:s,pos:o,hasAnchor:i}):n})}function nH(t,e){return typeof t==\"function\"?t(e):t}function rH({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:s,to:a}){let{anchor:i}=o,l=[],u=t.isEmpty;return r.nodesBetween(s,a,(c,d)=>{let f=i>=d&&i<=d+c.nodeSize,p=!c.isLeaf&&eg(c);return c.type.isTextblock&&(f||!e.showOnlyCurrent)&&p&&l.push(tH({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:nH(e.emptyNodeClass,{editor:t,node:c,pos:d,hasAnchor:f})},node:c,pos:d})),e.includeChildren}),l}function oH({editor:t,options:e,dataAttribute:n,doc:r,selection:o}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;let{anchor:s}=o,a=[],i=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){let l=r.resolve(s),u=l.depth>0?l.node(1):l.nodeAfter,c=l.depth>0?l.before(1):s;if(u&&u.type.isTextblock&&eg(u)){let d=s>=c&&s<=c+u.nodeSize;a.push(tH({editor:t,isEmptyDoc:i,dataAttribute:n,hasAnchor:d,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:nH(e.emptyNodeClass,{editor:t,node:u,pos:c,hasAnchor:d})},node:u,pos:c}))}}else a.push(...rH({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:0,to:r.content.size}));return He.create(r,a)}function fg(t,e){let n=t.resolve(e);if(n.depth===0){var r;let s=(r=n.nodeAfter)!==null&&r!==void 0?r:n.nodeBefore;if(!s)return{from:e,to:e};let a=n.nodeAfter?e:e-s.nodeSize;return{from:a,to:a+s.nodeSize}}let o=n.before(1);return{from:o,to:o+n.node(1).nodeSize}}function pg(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function yee(t,e,n){let r=[];return t.forEach((o,s)=>{let a=s,i=a+o.nodeSize,l=a+1,u=i+1;l<n&&u>e&&r.push({from:a,to:i})}),r}function bee(t){if(t.length===0)return[];let e=[...t].sort((r,o)=>r.from-o.from),n=[{...e[0]}];for(let r=1;r<e.length;r+=1){let o=n[n.length-1],s=e[r];s.from<=o.to?o.to=Math.max(o.to,s.to):n.push({...s})}return n}function vee(t,e){let n=yee(t,e.from,e.to);return n.push(pg(t,fg(t,e.from))),e.to>e.from?n.push(pg(t,fg(t,Math.min(e.to,t.content.size+1)-1))):e.from<t.content.size+1&&n.push(pg(t,fg(t,Math.min(e.from+1,t.content.size)))),n}function xee(t,e,n){let r=[];if(t.docChanged){let o=cf(t);for(let s of o)r.push(...vee(n.doc,s.newRange))}return t.selectionSet&&(r.push(pg(n.doc,fg(n.doc,t.mapping.map(e.selection.anchor)))),r.push(pg(n.doc,fg(n.doc,n.selection.anchor)))),bee(r)}function wee(t,e,n){let r=Math.max(0,Math.min(t,n.content.size));return{from:r,to:Math.max(r,Math.min(e,n.content.size))}}function See({decorations:t,ranges:e,editor:n,options:r,dataAttribute:o,doc:s,selection:a}){let i=t;for(let l of e){let{from:u,to:c}=wee(l.from,l.to,s),d=i.find(u,c).filter(p=>p.from>=u&&p.to<=c);d.length&&(i=i.remove(d));let f=rH({editor:n,options:r,dataAttribute:o,doc:s,selection:a,from:u,to:c});f.length&&(i=i.add(s,f))}return i}function kee({editor:t,options:e,dataAttribute:n}){return{init(r,o){let s=oH({editor:t,options:e,dataAttribute:n,doc:o.doc,selection:o.selection});return s??He.empty},apply(r,o,s,a){return!r.docChanged&&!r.selectionSet?o:See({decorations:o.map(r.mapping,r.doc),ranges:xee(r,s,a),editor:t,options:e,dataAttribute:n,doc:a.doc,selection:a.selection})}}}function Cee(t){return t.replace(/\\s+/g,\"-\").replace(/[^a-zA-Z0-9-]/g,\"\").replace(/^[0-9-]+/,\"\").replace(/^-+/,\"\").toLowerCase()}function Lee({editor:t,options:e}){let n=e.dataAttribute?`data-${Cee(e.dataAttribute)}`:`data-${eH}`,r=e.showOnlyCurrent&&!e.includeChildren;return new ie({key:JF,...r?{}:{state:kee({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:o,selection:s})=>oH({editor:t,options:e,dataAttribute:n,doc:o,selection:s}):o=>{var s;return e.showOnlyWhenEditable&&!t.isEditable?He.empty:(s=JF.getState(o))!==null&&s!==void 0?s:He.empty}}})}var tme=St.create({name:\"placeholder\",addOptions(){return{emptyEditorClass:\"is-editor-empty\",emptyNodeClass:\"is-empty\",dataAttribute:eH,placeholder:\"Write something \\u2026\",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[Lee({editor:this.editor,options:this.options})]}});function ZA(t,e){return!t.selection.empty&&!Jx(t.selection)&&e.isEditable}function Aee(t,e){return ZA(t,e)&&!e.isFocused&&!e.view.dragging}function Eee(){var t;(t=window.getSelection())===null||t===void 0||t.removeAllRanges()}function Tee(t){t.focus()}var nme=St.create({name:\"selection\",addOptions(){return{className:\"selection\"}},addProseMirrorPlugins(){let{editor:t,options:e}=this;return[new ie({key:new we(\"selection\"),props:{decorations(n){return Aee(n,t)?He.create(n.doc,[yn.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return ZA(n.state,t)&&Eee(),!1},focus(n){return ZA(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&Tee(n)}),!1}}}})]}});function YF({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var sH=St.create({name:\"trailingNode\",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;let e=new we(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)===null||t===void 0?void 0:t.name)||\"paragraph\",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(n).includes(o.name));return[new ie({key:e,appendTransaction:(o,s,a)=>{let{doc:i,tr:l,schema:u}=a,c=e.getState(a),d=i.content.size,f=u.nodes[n];if(!o.some(p=>p.getMeta(\"skipTrailingNode\"))&&c)return l.insert(d,f.create())},state:{init:(o,s)=>{let a=s.tr.doc.lastChild;return!YF({node:a,types:r})},apply:(o,s)=>{if(!o.docChanged||o.getMeta(\"__uniqueIDTransaction\"))return s;let a=o.doc.lastChild;return!YF({node:a,types:r})}}})]}}),aH=St.create({name:\"undoRedo\",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>D1(t,e),redo:()=>({state:t,dispatch:e})=>N1(t,e)}},addProseMirrorPlugins(){return[x2(this.options)]},addKeyboardShortcuts(){return{\"Mod-z\":()=>this.editor.commands.undo(),\"Shift-Mod-z\":()=>this.editor.commands.redo(),\"Mod-y\":()=>this.editor.commands.redo(),\"Mod-\\u044F\":()=>this.editor.commands.undo(),\"Shift-Mod-\\u044F\":()=>this.editor.commands.redo()}}});var Ree=St.create({name:\"starterKit\",addExtensions(){let t=[];if(this.options.bold!==!1&&t.push(nF.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(tF.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(UA.configure(this.options.bulletList)),this.options.code!==!1&&t.push(rF.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(oF.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(sF.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(ZF.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(QF.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(aF.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(iF.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(aH.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(lF.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(uF.configure(this.options.italic)),this.options.listItem!==!1&&t.push(VA.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(GA.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var n;t.push(EF.configure((n=this.options)===null||n===void 0?void 0:n.link))}if(this.options.orderedList!==!1&&t.push(WA.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(jF.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(qF.configure(this.options.strike)),this.options.text!==!1&&t.push(VF.configure(this.options.text)),this.options.underline!==!1){var r;t.push(KF.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var o;t.push(sH.configure((o=this.options)===null||o===void 0?void 0:o.trailingNode))}return t}}),iH=Ree;var Iee=Jr.create({name:\"heading\",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:\"inline*\",group:\"block\",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Vt(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode(\"heading\",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;let r=!((n=t.attrs)===null||n===void 0)&&n.level?parseInt(t.attrs.level,10):1,o=\"#\".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:\"\"},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,\"paragraph\",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Ex({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\\\s$`),type:this.type,getAttributes:{level:t}}))}}),lH=Iee;var uH=new WeakSet,cH=new WeakSet;function Ou(t){let e=t;return uH.add(e),e}function QA(t){return Array.isArray(t)&&uH.has(t)}function dH(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&cH.has(e)&&!QA(e)?dH(e):[e])}function Mee(t,e){if(t===\"slot\")return 0;if(t instanceof Function){let o=t(e);return Array.isArray(o)&&!QA(o)&&!cH.has(o)?Ou(o):o}let{children:n,...r}=e??{};if(t===\"svg\")throw new Error(\"SVG elements are not supported in the JSX syntax, use the array syntax instead\");if(Array.isArray(n)){if(QA(n))return Ou([t,r,n]);if(n.length===0)return Ou([t,r]);let o=dH(n);return o.length===0?Ou([t,r]):Ou([t,r,...o])}return n!=null?Ou([t,r,n]):Ou([t,r])}var bf=(t,e)=>Mee(t,e);var _ee=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/,Oee=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g,Dee=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/,Nee=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g,Pee=Cu.create({name:\"bold\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"strong\"},{tag:\"b\",getAttrs:t=>t.style.fontWeight!==\"normal\"&&null},{style:\"font-weight=400\",clearMark:t=>t.type.name===this.name},{style:\"font-weight\",getAttrs:t=>/^(bold(er)?|[5-9]\\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return bf(\"strong\",{...Vt(this.options.HTMLAttributes,t),children:bf(\"slot\",{})})},markdownTokenName:\"strong\",parseMarkdown:(t,e)=>e.applyMark(\"bold\",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:\"<strong>\",close:\"</strong>\"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-b\":()=>this.editor.commands.toggleBold(),\"Mod-B\":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ji({find:_ee,type:this.type}),ji({find:Dee,type:this.type})]},addPasteRules(){return[Oa({find:Oee,type:this.type}),Oa({find:Nee,type:this.type})]}}),fH=Pee;var Bee=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))$/,zee=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))/g,Fee=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))$/,Hee=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))/g,$ee=Cu.create({name:\"italic\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"em\"},{tag:\"i\",getAttrs:t=>t.style.fontStyle!==\"normal\"&&null},{style:\"font-style=normal\",clearMark:t=>t.type.name===this.name},{style:\"font-style=italic\"}]},renderHTML({HTMLAttributes:t}){return[\"em\",Vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:\"em\",parseMarkdown:(t,e)=>e.applyMark(\"italic\",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:\"<em>\",close:\"</em>\"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{\"Mod-i\":()=>this.editor.commands.toggleItalic(),\"Mod-I\":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ji({find:Bee,type:this.type}),ji({find:Fee,type:this.type})]},addPasteRules(){return[Oa({find:zee,type:this.type}),Oa({find:Hee,type:this.type})]}}),pH=$ee;var z0=\"[\\0- \\xA0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]\",Uee=new RegExp(z0),jee=new RegExp(`${z0}$`),qee=new RegExp(`${z0}+$`),Vee=new RegExp(z0,\"g\");function Kee(t,e,n){var r,o;let s=t.doc.resolve(e.to);if(!(!((r=s.nodeBefore)===null||r===void 0)&&r.isText))return;let a=(o=t.doc.textBetween(e.from,e.to,\"\\uFFFC\",\"\\uFFFC\").match(qee))===null||o===void 0?void 0:o[0];if(!a)return;let i=e.to-a.length,l=Vm(i,e.to,t.doc).filter(d=>d.mark.type===n);if(!l.length)return;let{nodeAfter:u}=s;if(u&&l.some(d=>d.mark.isInSet(u.marks)))return;let c=t.storedMarks;t.removeMark(i,e.to,n),t.setStoredMarks(c),t.selection.empty&&t.selection.from===e.to&&t.removeStoredMark(n)}function Gee(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?[\"()\",\"[]\"].includes(t[0].value+t[2].value):!1}function Wee(t){return new ie({key:new we(\"autolink\"),appendTransaction:(e,n,r)=>{let o=e.some(l=>l.docChanged)&&!n.doc.eq(r.doc),s=e.some(l=>l.getMeta(\"preventAutolink\"));if(!o||s)return;let{tr:a}=r,i=V1(n.doc,[...e]);if(!e.some(mx)){let l=[];i.steps.forEach((u,c)=>{if(!(u instanceof Rt)||!u.slice.size)return;let d=i.mapping.slice(c+1),f=d.map(u.from,1),p=d.map(u.from+u.slice.size,-1);f<p&&l.push({from:f,to:p})}),l.sort((u,c)=>c.to-u.to),l.forEach(u=>Kee(a,u,t.type))}if(Lx(i).forEach(({newRange:l})=>{let u=K2(r.doc,l,f=>f.isTextblock),c,d;if(u.length>1)c=u[0],d=r.doc.textBetween(c.pos,c.pos+c.node.nodeSize,void 0,\" \");else if(u.length){let f=r.doc.textBetween(l.from,l.to,\" \",\" \");if(!jee.test(f))return;c=u[0],d=r.doc.textBetween(c.pos,l.to,void 0,\" \")}if(c&&d){let f=d.split(Uee).filter(Boolean);if(f.length<=0)return!1;let p=f[f.length-1],h=c.pos+d.lastIndexOf(p);if(!p)return!1;let g=mf(p).map(m=>m.toObject(t.defaultProtocol));if(!Gee(g))return!1;g.filter(m=>m.isLink).map(m=>({...m,from:h+m.start+1,to:h+m.end+1})).filter(m=>r.schema.marks.code?!r.doc.rangeHasMark(m.from,m.to,r.schema.marks.code):!0).filter(m=>t.validate(m.value)).filter(m=>t.shouldAutoLink(m.value)).forEach(m=>{Vm(m.from,m.to,r.doc).some(y=>y.mark.type===t.type)||a.addMark(m.from,m.to,t.type.create({href:m.href}))})}}),!!a.steps.length)return a}})}function Xee(t){return new ie({key:new we(\"handleClickLink\"),props:{handleClick:(e,n,r)=>{if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{let l=r.target;if(!l)return!1;let u=t.editor.view.dom;o=l.closest(\"a\"),o&&!u.contains(o)&&(o=null)}if(!o)return!1;let s=!1;if(t.enableClickSelection&&(s=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var a,i;let l=W1(e.state,t.type.name),u=(a=o.href)!==null&&a!==void 0?a:l.href,c=(i=o.target)!==null&&i!==void 0?i:l.target;u&&(window.open(u,c),s=!0)}return s}}})}var Jee=/\\[([^[\\]]+)\\]\\(((?:[^\\s()]|\\([^\\s()]*\\))+)(?:\\s+(?:([\"'])(.*?)\\3|“(.*?)”|‘(.*?)’))?\\)$/,Yee=/\\[([^[\\]]+)\\]\\(((?:[^\\s()]|\\([^\\s()]*\\))+)(?:\\s+(?:([\"'])(.*?)\\3|“(.*?)”|‘(.*?)’))?\\)/g;function hH(t,e){let n=0;for(let r=e-1;r>=0&&t[r]===\"\\\\\";r-=1)n+=1;return n%2===1}function Zee(t,e){let n=0,r=0;for(;r<e;){if(t[r]!==\"`\"){r+=1;continue}if(n===0&&hH(t,r)){r+=1;continue}let o=0;for(;r<e&&t[r]===\"`\";)o+=1,r+=1;n===0?n=o:o===n&&(n=0)}return n>0}function mH(t,e,n){var r,o;let[,s,a]=e;return(e.index?t[e.index-1]:void 0)===\"!\"||hH(t,(r=e.index)!==null&&r!==void 0?r:0)||Zee(t,(o=e.index)!==null&&o!==void 0?o:0)?!1:!!s.trim()&&n(a)}function gH(t){var e,n;let[r,o,s,,a,i,l]=t,u=(e=a??i)!==null&&e!==void 0?e:l;return{index:(n=t.index)!==null&&n!==void 0?n:0,text:r,replaceWith:o,data:{href:s,title:u||null,markdown:!0}}}function Qee(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function yH(t){var e,n,r;return{href:(e=t.data)===null||e===void 0?void 0:e.href,title:(n=(r=t.data)===null||r===void 0?void 0:r.title)!==null&&n!==void 0?n:null}}function ete(t){let e=ji({find:n=>{let r=Jee.exec(n);return!r||!mH(n,r,t.isAllowedHref)?null:gH(r)},type:t.type,getAttributes:yH});return new Km({find:e.find,handler:n=>{let r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta(\"preventAutolink\",!0),r}})}function tte(t){let e=Oa({find:n=>{var r,o;let s=[];for(let i of n.matchAll(Yee))mH(n,i,t.isAllowedHref)&&s.push(gH(i));let a=((r=(o=t.findPlainUrls)===null||o===void 0?void 0:o.call(t,n))!==null&&r!==void 0?r:[]).filter(i=>!s.some(l=>Qee(l,i)));return[...s,...a]},type:t.type,getAttributes:yH});return new Q1({find:e.find,handler:n=>{var r;let o=e.handler(n);return o!==null&&n.state.tr.steps.length&&(!((r=n.match.data)===null||r===void 0)&&r.markdown)&&n.state.tr.setMeta(\"preventAutolink\",!0),o}})}function nte(t){return new ie({key:new we(\"handlePasteLink\"),props:{handlePaste:(e,n,r)=>{let{shouldAutoLink:o}=t,{state:s}=e,{selection:a}=s,{empty:i}=a;if(i)return!1;let l=\"\";r.content.forEach(c=>{l+=c.textContent});let u=gf(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!u||o!==void 0&&!o(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function $a(t,e){let n=[\"http\",\"https\",\"ftp\",\"ftps\",\"mailto\",\"tel\",\"callto\",\"sms\",\"cid\",\"xmpp\"];return e&&e.forEach(r=>{let o=typeof r==\"string\"?r:r.scheme;o&&n.push(o)}),!t||t.replace(Vee,\"\").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")).join(\"|\")}):|[^a-z]|[a-z0-9+.\\\\-]+(?:[^a-z+.\\\\-:]|$))`,\"i\"))}var rte=Cu.create({name:\"link\",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn(\"The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.\")),this.options.protocols.forEach(t=>{if(typeof t==\"string\"){hf(t);return}hf(t.scheme,t.optionalSlashes)})},onDestroy(){R0()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:\"http\",HTMLAttributes:{target:\"_blank\",rel:\"noopener noreferrer nofollow\",class:null},isAllowedUri:(t,e)=>!!$a(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{let e=/^[a-z][a-z0-9+.-]*:\\/\\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes(\"@\"))return!0;let r=(t.includes(\"@\")?t.split(\"@\").pop():t).split(/[/?#:]/)[0];return!(/^\\d{1,3}(\\.\\d{1,3}){3}$/.test(r)||!/\\./.test(r))}}},addAttributes(){var t,e,n;return{href:{default:null,parseHTML(r){return r.getAttribute(\"href\")}},target:{default:(t=this.options.HTMLAttributes.target)!==null&&t!==void 0?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(n=this.options.HTMLAttributes.class)!==null&&n!==void 0?n:null},title:{default:null}}},parseHTML(){return[{tag:\"a[href]\",getAttrs:t=>{let e=t.getAttribute(\"href\");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!$a(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!$a(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[\"a\",Vt(this.options.HTMLAttributes,t),0]:[\"a\",Vt(this.options.HTMLAttributes,{...t,href:\"\"}),0]},markdownTokenName:\"link\",parseMarkdown:(t,e)=>e.applyMark(\"link\",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,o,s;let a=(n=(r=t.attrs)===null||r===void 0?void 0:r.href)!==null&&n!==void 0?n:\"\",i=(o=(s=t.attrs)===null||s===void 0?void 0:s.title)!==null&&o!==void 0?o:\"\",l=e.renderChildren(t);return i?`[${l}](${a} \"${i}\")`:`[${l}](${a})`},addCommands(){return{setLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!$a(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta(\"preventAutolink\",!0).run():!1},toggleLink:t=>({chain:e})=>{let{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!$a(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta(\"preventAutolink\",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(\"preventAutolink\",!0).run()}},addInputRules(){return this.options.markdownLinks?[ete({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!$a(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let t=e=>{let n=[];if(e){let{protocols:r,defaultProtocol:o}=this.options;gf(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!$a(a,r),protocols:r,defaultProtocol:o})).forEach(s=>{this.options.shouldAutoLink(s.value)&&n.push({text:s.value,data:{href:s.href},index:s.start})})}return n};return this.options.markdownLinks?[tte({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!$a(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[Oa({find:t,type:this.type,getAttributes:e=>{var n;return{href:(n=e.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){let t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(Wee({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!$a(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(Xee({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===\"whenNotEditable\"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(nte({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),bH=rte;var ote=(t,e)=>{var n;let{state:r}=t,{selection:o}=r;if(!o.empty)return!1;let{$from:s}=o;if(s.parentOffset!==0)return!1;let a=s.depth-1;if(a<0)return!1;let i=s.node(a),l=s.index(a);if(l===0)return!1;if(i.type===e)return t.commands.lift(e.name);let u=i.child(l-1);if(u.type!==e||!(!((n=u.lastChild)===null||n===void 0)&&n.isTextblock))return!1;let c=s.before()-1-1;return t.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;let p=s.parent.content,h=new G(p,0,0);return d.replace(c,s.after(),h),d.setSelection(J.create(d.doc,c+p.size)),d.scrollIntoView(),f(d),!0})},ste=/^\\s*>\\s$/,ate=Jr.create({name:\"blockquote\",addOptions(){return{HTMLAttributes:{}}},content:\"block+\",group:\"block\",defining:!0,parseHTML(){return[{tag:\"blockquote\"}]},renderHTML({HTMLAttributes:t}){return bf(\"blockquote\",{...Vt(this.options.HTMLAttributes,t),children:bf(\"slot\",{})})},parseMarkdown:(t,e)=>{var n;let r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren;return e.createNode(\"blockquote\",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return\"\";let n=\">\",r=[];return t.content.forEach((o,s)=>{var a,i;let l=((a=(i=e.renderChild)===null||i===void 0?void 0:i.call(e,o,s))!==null&&a!==void 0?a:e.renderChildren([o])).split(`\n`).map(u=>u.trim()===\"\"?n:`${n} ${u}`);r.push(l.join(`\n`))}),r.join(`\n${n}\n`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{\"Mod-Shift-b\":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>ote(this.editor,this.type)}},addInputRules(){return[qi({find:ste,type:this.type})]}}),vH=ate;var ite=\"listItem\",xH=\"textStyle\",wH=/^\\s*([-+*])\\s$/,eE=Jr.create({name:\"bulletList\",addOptions(){return{itemTypeName:\"listItem\",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:\"block list\",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:\"ul\"}]},renderHTML({HTMLAttributes:t}){return[\"ul\",Vt(this.options.HTMLAttributes,t),0]},markdownTokenName:\"list\",parseMarkdown:(t,e)=>t.type!==\"list\"||t.ordered?[]:{type:\"bulletList\",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`\n`):\"\",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ite,this.editor.getAttributes(xH)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-8\":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=qi({find:wH,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=qi({find:wH,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(xH),editor:this.editor})),[t]}}),lte=(t,e,n)=>{let{selection:r}=t;if(!r.empty)return null;let{$from:o}=r;if(!o.parent.isTextblock||o.parentOffset!==o.parent.content.size)return null;let s=-1;for(let p=o.depth;p>0;p-=1)if(o.node(p).type.name===e){s=p;break}if(s<0)return null;let a=o.node(s),i=o.index(s);if(i+1>=a.childCount)return null;let l=a.child(i+1);if(!n.includes(l.type.name))return null;let u=t.schema.nodes[e],c=!1;if(l.forEach(p=>{p.type===u&&p.childCount>1&&(c=!0)}),!c)return null;let d=t.doc.resolve(o.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:s,nestedList:d,nestedListPos:o.after(),insertPos:o.after(s),items:f}},ute=(t,e,n,r)=>{let o=lte(t,n,r);if(!o)return!1;let{selection:s}=t,{nestedList:a,nestedListPos:i,insertPos:l,items:u}=o,c=t.tr;c.delete(i,i+a.nodeSize);let d=c.mapping.map(l);return c.insert(d,H.from(u)),c.setSelection(s.map(c.doc,c.mapping)),e&&e(c),!0},cte=(t,e,n)=>ute(t.state,t.view.dispatch,e,n),RH=(t,e)=>bn.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>cte(this.editor,t,e);return{Delete:n,\"Mod-Delete\":n}}}),IH=[[1e3,\"m\"],[900,\"cm\"],[500,\"d\"],[400,\"cd\"],[100,\"c\"],[90,\"xc\"],[50,\"l\"],[40,\"xl\"],[10,\"x\"],[9,\"ix\"],[5,\"v\"],[4,\"iv\"],[1,\"i\"]],F0=\"abcdefghijklmnopqrstuvwxyz\",MH=String.raw`\\d+|[ivxlcdmIVXLCDM]+|${\"[a-zA-Z]{1,2}\"}`;function U0(t){let e=t,n=\"\";for(let[r,o]of IH)for(;e>=r;)n+=o,e-=r;return n}function tE(t){return U0(t).toUpperCase()}function _H(t){let e=t.toLowerCase(),n=0,r=0;for(;n<e.length;){let o=!1;for(let[s,a]of IH)if(e.startsWith(a,n)){r+=s,n+=a.length,o=!0;break}if(!o)return 0}return r}function dte(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;let e=_H(t);return e<=0?!1:(t===t.toLowerCase()?U0(e):tE(e))===t}function fte(t){let e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){let n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function H0(t){if(t<=26)return F0[t-1];let e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?F0[n]:F0[e]+F0[n]}function j0(t){if(!(!t||/^\\d+$/.test(t))){if(dte(t))return t===t.toLowerCase()?\"i\":\"I\";if(/^[a-z]{1,2}$/.test(t))return\"a\";if(/^[A-Z]{1,2}$/.test(t))return\"A\"}}function nE(t){if(/^\\d+$/.test(t))return parseInt(t,10);let e=j0(t);if(e===\"i\"||e===\"I\")return _H(t);if(e===\"a\"||e===\"A\"){let r=fte(t);return r>0?r:1}let n=parseInt(t,10);return Number.isNaN(n)?1:n}function pte(t,e){if(t===\"numeric\")return String(e);switch(t){case\"a\":return H0(e);case\"A\":return H0(e).toUpperCase();case\"i\":return U0(e);case\"I\":return tE(e);default:return String(e)}}function hte(t){var e;if(t.length===0)return!1;let n=(e=j0(t[0]))!==null&&e!==void 0?e:\"numeric\",r=nE(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){let s=pte(n,r+o);if(t[o]!==s)return!1}return!0}function mte(t){return{type:j0(t),start:nE(t)}}function gte(t){let{type:e,start:n}=mte(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function yte(t,e,n=\". \"){let r=e+1;if(!t||t===\"1\")return`${r}${n}`;switch(t){case\"a\":return`${H0(r)}${n}`;case\"A\":return`${H0(r).toUpperCase()}${n}`;case\"i\":return`${U0(r)}${n}`;case\"I\":return`${tE(r)}${n}`;default:return`${r}${n}`}}function bte(t){var e,n;let r=(e=t.tokens)===null||e===void 0?void 0:e[0];return!!(t.text&&((n=t.tokens)===null||n===void 0?void 0:n.length)===1&&r?.type===\"list\"&&r.ordered&&r.raw===t.text)}function vte(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:\"text\",raw:t,text:t}])}var xte=Jr.create({name:\"listItem\",addOptions(){return{HTMLAttributes:{},bulletListTypeName:\"bulletList\",orderedListTypeName:\"orderedList\"}},content:\"paragraph block*\",defining:!0,parseHTML(){return[{tag:\"li\"}]},renderHTML({HTMLAttributes:t}){return[\"li\",Vt(this.options.HTMLAttributes,t),0]},markdownTokenName:\"list_item\",parseMarkdown:(t,e)=>{var n;if(t.type!==\"list_item\")return[];let r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren,o=[];if(t.tokens&&t.tokens.length>0){if(bte(t))return{type:\"listItem\",content:[{type:\"paragraph\",content:vte(t.text||\"\",e)}]};if(t.tokens.some(s=>s.type===\"paragraph\"))o=r(t.tokens);else{let s=t.tokens[0];if(s&&s.type===\"text\"&&s.tokens&&s.tokens.length>0){if(o=[{type:\"paragraph\",content:e.parseInline(s.tokens)}],t.tokens.length>1){let a=r(t.tokens.slice(1));o.push(...a)}}else o=r(t.tokens)}}return o.length===0&&(o=[{type:\"paragraph\",content:[]}]),{type:\"listItem\",content:o}},renderMarkdown:(t,e,n)=>Y1(t,e,r=>{if(r.parentType===\"bulletList\")return\"- \";if(r.parentType===\"orderedList\"){var o,s;let a=((o=r.meta)===null||o===void 0||(o=o.parentAttrs)===null||o===void 0?void 0:o.start)||1;return yte((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.type,a-1+(r.index||0),\". \")}return\"- \"},n,{alignNestedToPrefix:n?.parentType===\"orderedList\"}),addExtensions(){return[RH(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),\"Shift-Tab\":()=>this.editor.commands.liftListItem(this.name)}}}),rE=(t,e)=>{let{$from:n}=e.selection,r=tn(t,e.schema),o=null,s=n.depth,a=n.pos,i=null;for(;s>0&&i===null;)o=n.node(s),o.type===r?i=s:(s-=1,a-=1);return i===null?null:{$pos:e.doc.resolve(a),depth:i}},OH=(t,e)=>{let n=rE(t,e);if(!n)return!1;let[,r]=Y2(e,t,n.$pos.pos+4);return r},wte=(t,e,n)=>{let{$anchor:r}=t.selection,o=Math.max(0,r.pos-2),s=t.doc.resolve(o).node();return!(!s||!n.includes(s.type.name))},SH=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Ts(t.state,e)&&wte(t.state,e,n)){let{$anchor:s}=t.state.selection,a=t.state.doc.resolve(s.before()-1),i=[];a.node().descendants((c,d)=>{c.type.name===e&&i.push({node:c,pos:d})});let l=i.at(-1);if(!l)return!1;let u=t.state.doc.resolve(a.start()+l.pos+1);return t.chain().cut({from:s.start()-1,to:s.end()+1},u.end()).joinForward().run()}if(!Ts(t.state,e)||!eB(t.state))return!1;let{$from:r}=t.state.selection,o=r.depth-1;return r.node(o).type!==t.schema.nodes[e]||r.index(o)!==0?!1:t.chain().liftListItem(e).run()},Ste=(t,e)=>{let n=OH(t,e),r=rE(t,e);return!r||!n?!1:n>r.depth},kte=(t,e)=>{let n=OH(t,e),r=rE(t,e);return!r||!n?!1:n<r.depth},kH=(t,e)=>{if(!Ts(t.state,e)||!Q2(t.state,e))return!1;let{selection:n}=t.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:Ste(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():kte(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},Cte=(t,e,n)=>{let{state:r}=t,{selection:o}=r;if(!o.empty)return!1;let{$from:s}=o;if(s.parentOffset!==0||!s.parent.isTextblock||Ts(r,e))return!1;let a=Z2(s);if(!a||!n.includes(a.type.name))return!1;let i=a.lastChild;if(!i||i.type.name!==e)return!1;let l=s.parent;if(!i.canReplace(i.childCount,i.childCount,H.from(l)))return!1;let u=s.before(),c=s.after(),d=u-2;return t.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(u,c).insert(d,H.from(l)),f.setSelection(J.create(f.doc,d+1)),f.scrollIntoView()),!0))};var Lte=bn.create({name:\"listKeymap\",addOptions(){return{listTypes:[{itemName:\"listItem\",wrapperNames:[\"bulletList\",\"orderedList\"]},{itemName:\"taskItem\",wrapperNames:[\"taskList\"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&kH(t,n)&&(e=!0)}),e},\"Mod-Delete\":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&kH(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&SH(t,n,r)&&(e=!0)}),e},\"Mod-Backspace\":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&SH(t,n,r)&&(e=!0)}),e},Tab:({editor:t})=>{for(let{itemName:e,wrapperNames:n}of this.options.listTypes)if(t.state.schema.nodes[e]!==void 0&&Cte(t,e,n))return!0;return!1}}}}),$0=new RegExp(`^(\\\\s*)(${MH})([.)])\\\\s+(.*)$`),Ate=/^\\s/,vf={heading:/^#{1,6}(?:\\s|$)/,bulletItem:/^[-+*]\\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\\$\\$/,thematicBreak:/^(?:(?:-[ \\t]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})$/};function Ete(t){return $0.test(t.trimStart())}function Tte(t){let e=t.trimStart();return vf.bulletItem.test(e)||Ete(e)||vf.heading.test(e)||vf.thematicBreak.test(e)&&!e.startsWith(\"-\")||/^>\\s?/.test(e)||vf.codeFence.test(e)||vf.blockMath.test(e)}function Rte(t){return Object.values(vf).some(e=>e.test(t))}function Ite(t){let e=[],n=[],r=!1;return t.forEach(o=>{if(r){n.push(o);return}if(o.trim()===\"\"){r=!0,n.push(o);return}if(e.length>0&&Tte(o)){r=!0,n.push(o);return}e.push(o)}),{paragraphLines:e,blockLines:n}}function CH(t){let e=[],n=0,r=0;for(;n<t.length;){let o=t[n],s=o.match($0);if(!s)break;let[,a,i,l,u]=s,c=a.length,d=parseInt(i,10),f=isNaN(d)?j0(i):void 0,p=isNaN(d)?nE(i):d,h=[u],g=n+1,m=[o],y=!1;for(;g<t.length;){let b=t[g];if(b.match($0))break;if(b.trim()===\"\")m.push(b),h.push(\"\"),y=!0,g+=1;else if(b.match(Ate)){let x=b.length-b.trimStart().length,v=c+i.length+1;m.push(b),h.push(b.slice(Math.min(x,v))),g+=1}else{if(y||Rte(b))break;m.push(b),h.push(b),g+=1}}e.push({indent:c,number:p,type:f,content:h.join(`\n`).trim(),contentLines:h,raw:m.join(`\n`)}),r=g,n=g}return[e,r]}var Mte=new RegExp(`^(${MH})([.)])\\\\s+(.+)$`);function _te(t){let e=t.split(`\n`).filter(r=>r.trim().length>0);if(e.length===0)return null;let n=[];for(let r of e){let o=r.trim().match(Mte);if(!o)return null;n.push({marker:o[1],content:o[3]})}return hte(n.map(r=>r.marker))?{type:\"orderedList\",attrs:gte(n[0].marker),content:n.map(r=>({type:\"listItem\",content:[{type:\"paragraph\",content:[{type:\"text\",text:r.content}]}]}))}:null}function DH(t,e,n){let r=[],o=0;for(;o<t.length;){let s=t[o];if(s.indent===e){let{paragraphLines:a,blockLines:i}=Ite(s.contentLines),l=a.join(`\n`).trim(),u=[];l&&u.push({type:\"paragraph\",raw:l,tokens:n.inlineTokens(l)});let c=i.join(`\n`).trim();if(c){let p=n.blockTokens(c);u.push(...p)}let d=o+1,f=[];for(;d<t.length&&t[d].indent>e;)f.push(t[d]),d+=1;if(f.length>0){let p=DH(f,Math.min(...f.map(h=>h.indent)),n);u.push({type:\"list\",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(h=>h.raw).join(`\n`)})}r.push({type:\"list_item\",raw:s.raw,tokens:u}),o=d}else o+=1}return r}function Ote(t,e){return t.map(n=>{if(n.type!==\"list_item\")return e.parseChildren([n])[0];let r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type===\"paragraph\"||o.type===\"list\"||o.type===\"blockquote\"||o.type===\"code\")r.push(...e.parseChildren([o]));else if(o.type===\"text\"&&o.tokens){let s=e.parseChildren([o]);r.push({type:\"paragraph\",content:s})}else{let s=e.parseChildren([o]);s.length>0&&r.push(...s)}}),{type:\"listItem\",content:r}})}var Dte=64;function LH(t,e){let n=[],r=0;for(;n.length<e;){let o=t.indexOf(`\n`,r);if(o===-1)return n.push(t.slice(r)),n;n.push(t.slice(r,o)),r=o+1}return n}function Nte(t){let e=t.indexOf(`\n`),n=e===-1?t:t.slice(0,e);if(!$0.test(n))return[[],0,[]];let r=Dte,o=LH(t,r),s=CH(o);for(;s[1]===o.length&&o.length===r;)r*=2,o=LH(t,r),s=CH(o);return[s[0],s[1],o]}var Pte=\"listItem\",AH=\"textStyle\",EH=/^(\\d+)\\.\\s$/;function TH(t){let e=t.match(/list-style-type\\s*:\\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case\"upper-roman\":return\"I\";case\"lower-roman\":return\"i\";case\"upper-alpha\":case\"upper-latin\":return\"A\";case\"lower-alpha\":case\"lower-latin\":return\"a\";default:return null}}var oE=Jr.create({name:\"orderedList\",addOptions(){return{itemTypeName:\"listItem\",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:\"block list\",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute(\"start\")?parseInt(t.getAttribute(\"start\")||\"\",10):1},type:{default:null,parseHTML:t=>{let e=t.getAttribute(\"type\");if(e)return e;let n=t.getAttribute(\"style\");if(n){let o=TH(n);if(o)return o}let r=t.querySelector(\"li\");if(r){let o=r.getAttribute(\"style\");if(o){let s=TH(o);if(s)return s}}return null}}}},parseHTML(){return[{tag:\"ol\"}]},renderHTML({HTMLAttributes:t}){let{start:e,type:n,...r}=t,o=Vt(this.options.HTMLAttributes,r);return e!==1&&(o.start=e),n&&n!==\"1\"&&(o.type=n),[\"ol\",o,0]},markdownTokenName:\"list\",parseMarkdown:(t,e)=>{if(t.type!==\"list\"||!t.ordered)return[];let n=t.start||1,r=t.typeMarker,o=t.items?Ote(t.items,e):[],s={};return n!==1&&(s.start=n),r&&(s.type=r),Object.keys(s).length>0?{type:\"orderedList\",attrs:s,content:o}:{type:\"orderedList\",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`\n`):\"\",markdownTokenizer:{name:\"orderedList\",level:\"block\",start:()=>-1,tokenize:(t,e,n)=>{var r,o;let[s,a,i]=Nte(t);if(s.length===0)return;let l=DH(s,s[0].indent,n);if(l.length!==0)return{type:\"list\",ordered:!0,start:((r=s[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(o=s[0])===null||o===void 0?void 0:o.type,items:l,raw:i.slice(0,a).join(`\n`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Pte,this.editor.getAttributes(AH)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-7\":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new ie({props:{handlePaste:(t,e)=>{var n,r;let o=(n=e.clipboardData)===null||n===void 0?void 0:n.getData(\"text/html\");if(o?.trim())return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData(\"text/plain\");if(!s)return!1;let a=_te(s);if(!a)return!1;try{let i=t.state.schema.nodeFromJSON(a),l=t.state.tr.replaceSelectionWith(i);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){let t=(n,r)=>(!r.attrs.type||r.attrs.type===\"1\")&&r.childCount+r.attrs.start===+n[1],e=qi({find:EH,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=qi({find:EH,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(AH)}),joinPredicate:t,editor:this.editor})),[e]}}),Bte=/^\\s*(\\[([( |x])?\\])\\s$/,zte=\"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0\",Fte=(t,e,n)=>{var r;return(n==null||(r=n.checkboxLabel)===null||r===void 0?void 0:r.call(n,t,e))||`Task item checkbox for ${t.textContent||\"empty task item\"}`},Hte=Jr.create({name:\"taskItem\",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:\"taskList\",a11y:void 0}},content(){return this.options.nested?\"paragraph block*\":\"paragraph+\"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute(\"data-checked\");return e===\"\"||e===\"true\"},renderHTML:t=>({\"data-checked\":t.checked})}}},parseHTML(){return[{tag:`li[data-type=\"${this.name}\"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector(\"div\"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return[\"li\",Vt(this.options.HTMLAttributes,e,{\"data-type\":this.name}),[\"label\",[\"input\",{type:\"checkbox\",checked:t.attrs.checked?\"checked\":null}],[\"span\"]],[\"div\",0]]},parseMarkdown:(t,e)=>{let n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode(\"paragraph\",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode(\"paragraph\",{},[e.createNode(\"text\",{text:t.text})])):n.push(e.createNode(\"paragraph\",{},[])),t.nestedTokens&&t.nestedTokens.length>0){let r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode(\"taskItem\",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;let r=`- [${!((n=t.attrs)===null||n===void 0)&&n.checked?\"x\":\" \"}] `;return Y1(t,e,r)},addExtensions(){return this.options.nested?[RH(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),\"Shift-Tab\":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{let o=document.createElement(\"li\"),s=document.createElement(\"label\"),a=document.createElement(\"span\"),i=document.createElement(\"input\"),l=document.createElement(\"div\");a.style.cssText=zte;let u=d=>{let f=Fte(d,d.attrs.checked,this.options.a11y);i.setAttribute(\"aria-label\",f),a.textContent=f};u(t),s.contentEditable=\"false\",i.type=\"checkbox\",i.addEventListener(\"mousedown\",d=>d.preventDefault()),i.addEventListener(\"change\",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){i.checked=!i.checked;return}let{checked:f}=d.target;r.isEditable&&typeof n==\"function\"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{let h=n();if(typeof h!=\"number\")return!1;let g=p.doc.nodeAt(h);return p.setNodeMarkup(h,void 0,{...g?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(i.checked=!i.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{o.setAttribute(d,f)}),o.dataset.checked=t.attrs.checked,i.checked=t.attrs.checked,s.append(i,a),o.append(s,l),Object.entries(e).forEach(([d,f])=>{o.setAttribute(d,f)});let c=new Set(Object.keys(e));return{dom:o,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;o.dataset.checked=d.attrs.checked,i.checked=d.attrs.checked,u(d);let f=r.extensionManager.attributes,p=Ui(d,f),h=new Set(Object.keys(p)),g=this.options.HTMLAttributes;return c.forEach(m=>{h.has(m)||(m in g?o.setAttribute(m,g[m]):o.removeAttribute(m))}),Object.entries(p).forEach(([m,y])=>{y==null?m in g?o.setAttribute(m,g[m]):o.removeAttribute(m):o.setAttribute(m,y)}),c=h,!0}}}},addInputRules(){return[qi({find:Bte,type:this.type,getAttributes:t=>({checked:t[t.length-1]===\"x\"})})]}}),$te=Jr.create({name:\"taskList\",addOptions(){return{itemTypeName:\"taskItem\",HTMLAttributes:{}}},group:\"block list\",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type=\"${this.name}\"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return[\"ul\",Vt(this.options.HTMLAttributes,t,{\"data-type\":this.name}),0]},parseMarkdown:(t,e)=>e.createNode(\"taskList\",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`\n`):\"\",markdownTokenizer:{name:\"taskList\",level:\"block\",start(t){var e;let n=(e=t.match(/^\\s*[-+*]\\s+\\[([ xX])\\]\\s+/))===null||e===void 0?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){let r=s=>{let a=J1(s,{itemPattern:/^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()===\"x\"}),createToken:(i,l)=>({type:\"taskItem\",raw:\"\",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:l}),customNestedParser:r},n);if(a){let i={type:\"taskList\",raw:a.raw,items:a.items},l=s.slice(a.raw.length);return l.trim()?[i,...n.blockTokens(l)]:[i]}return n.blockTokens(s)},o=J1(t,{itemPattern:/^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()===\"x\"}),createToken:(s,a)=>({type:\"taskItem\",raw:\"\",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:r},n);if(o)return{type:\"taskList\",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{\"Mod-Shift-9\":()=>this.editor.commands.toggleTaskList()}}}),Gme=bn.create({name:\"listKit\",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(eE.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(xte.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Lte.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(oE.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Hte.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push($te.configure(this.options.taskList)),t}});var q0=t=>t.split(\".\").filter(e=>e!==\"\"),Ute=t=>/^\\d+$/.test(t);function V0(t,e){let n=q0(e);if(n.length===0)return null;let r=t.fields[n[0]];for(let o of n.slice(1)){if(!r)return null;if(r.type===\"list\")r=Ute(o)?r.item??{type:\"text\"}:void 0;else if(r.type===\"object\")r=r.fields?.[o];else return null}return r??null}function sE(t,e){let n=t;for(let r of q0(e)){if(n===null||typeof n!=\"object\")return;n=n[r]}return n}function K0(t,e,n){let r=(o,s)=>{if(s.length===0)return n;let[a,...i]=s;if(Array.isArray(o)){let u=o.slice();return u[Number(a)]=r(o[Number(a)],i),u}let l=o!==null&&typeof o==\"object\"?o:{};return{...l,[a]:r(l[a],i)}};return r(t??{},q0(e))}function Zi(t,e){let n=(r,o)=>{if(r===null||typeof r!=\"object\")return r;let[s,...a]=o;if(Array.isArray(r)){let l=Number(s);if(a.length===0||!(l in r))return r;let u=r.slice();return u[l]=n(r[l],a),u}let i=r;if(!(s in i))return i;if(a.length===0){let{[s]:l,...u}=i;return u}return{...i,[s]:n(i[s],a)}};return n(t??{},q0(e))}function Qo(t,e){for(let[n,r]of Object.entries(t.zones))if(r.some(o=>o.id===e))return n;return null}function Nu(t,e){for(let n of Object.values(t.zones)){let r=n.find(o=>o.id===e);if(r)return r}return null}var Qi=(t,e,n)=>({...t,zones:{...t.zones,[e]:n}});function hg(t,e,n,r){let o=t.zones[e]??[];return Qi(t,e,[...o.slice(0,n),r,...o.slice(n)])}function NH(t,e){let n=Qo(t,e);return n?Qi(t,n,t.zones[n].filter(r=>r.id!==e)):t}function PH(t,e,n){let r=Qo(t,e);if(!r)return t;let o=[...t.zones[r]],s=o.findIndex(i=>i.id===e),a=s+n;return a<0||a>=o.length?t:([o[s],o[a]]=[o[a],o[s]],Qi(t,r,o))}function BH(t,e,n){let r=Qo(t,e);if(!r)return t;let o=t.zones[r],s=o.findIndex(u=>u.id===e),a=Math.max(0,Math.min(n,o.length-1));if(s===a)return t;let i=[...o],[l]=i.splice(s,1);return i.splice(a,0,l),Qi(t,r,i)}function zH(t,e,n,r,o){let s=Qo(t,e);return s?Qi(t,s,t.zones[s].map(a=>a.id===e?{...a,[n]:{...a[n]??{},[r]:o}}:a)):t}function FH(t,e,n){let r=Qo(t,e);return r?Qi(t,r,t.zones[r].map(o=>{if(o.id!==e)return o;let{css:s,...a}=o;return n===void 0||n===\"\"?a:{...a,css:n}})):t}function aE(t,e,n,r){let o=Qo(t,e);return o?Qi(t,o,t.zones[o].map(s=>s.id===e?{...s,fields:K0(s.fields,n,r)}:s)):t}function HH(t,e){return!(!t||t.kind===\"locked\"||t.kind===\"sections\"&&t.max!=null&&e>=t.max)}function G0(t,e){if(!t||t.kind===\"locked\")return[];if(t.allow===\"*\")return e;let n=new Set(t.allow);return e.filter(r=>n.has(r.name))}function $H(t,e,n){return!t||t.kind===\"locked\"?[]:e.filter(r=>r.section===void 0||n[r.name]===void 0?!1:t.allow===\"*\"||t.allow.includes(r.section))}function iE(t,e,n){return{id:n,type:ka,fields:{item:t.name,ref:e}}}var jte={refList:[],object:{}},qte=new Set([\"image\",\"video\",\"file\",\"number\"]);function mg(t,e){let n={},r={};for(let[o,s]of Object.entries(t.fields)){let a=t.sample?.[o]??s.default??(s.type===\"boolean\"?!1:void 0);if(a!==void 0)n[o]=a;else{if(qte.has(s.type))continue;if(s.type===\"object\"&&s.optional===!0)continue;n[o]=jte[s.type]??\"\"}}for(let[o,s]of Object.entries(t.settings)){let a=t.sample?.[o]??s.default;a!==void 0&&(r[o]=a)}return{id:e,type:t.name,fields:n,settings:r}}function lE(t,e,n,r={}){let o=null;for(let[s,a]of Object.entries(e)){if(a.kind!==\"locked\"||(t.zones[s]??[]).length>0)continue;let i=null;if(a.global!==void 0){let l=r[a.global];if(l===void 0)continue;i=iE({name:a.global},l,Du(ka))}else{let l=n.find(u=>u.name===a.component);if(!l)continue;i=mg(l,Du(l.name))}o??(o={...t,zones:{...t.zones}}),o.zones[s]=[i]}return o??t}function Du(t){return`${t}-${crypto.randomUUID().slice(0,8)}`}function UH(t,e,n,r){return{...t,[e]:{...t[e]??{},[n]:r}}}function jH(t,e){let{[e]:n,...r}=t.zones;return{...t,zones:r}}function qH(t,e,n){let r=Qo(t,e);if(!r)return t;let o=n.startsWith(\"settings.\")?\"settings\":n.startsWith(\"styles.\")?\"styles\":\"fields\",s=o===\"fields\"?n:n.slice(o.length+1);return Qi(t,r,t.zones[r].map(a=>a.id===e?{...a,[o]:Zi(a[o]??{},s)}:a))}function W0(t,e){let n=new Map(e.map(o=>[o.name,o])),r=[];t.image&&r.push({kind:\"image\",title:\"Image\",icon:\"\\u25A3\"});for(let o of t.elements){let s=n.get(o);s&&r.push({kind:\"element\",title:s.title,icon:s.icon??\"\\u25A4\",element:s})}return r}function X0(t,e){let n=e.trim().toLowerCase();return n===\"\"?t:t.filter(r=>r.title.toLowerCase().includes(n))}function VH(t){let{fields:e,settings:n}=mg(t,\"\");return{type:\"element\",attrs:{name:t.name,fields:e,settings:n??{}}}}function KH(t){return{type:\"image\",attrs:{image:{asset:t},caption:\"\"}}}function GH(t,e){let n=0;return t.descendants((r,o)=>o>=e?!1:(r.type.name===\"element\"&&n++,!0)),n}var yg=Math.min,el=Math.max,bg=Math.round,vg=Math.floor,Ds=t=>({x:t,y:t}),Vte={left:\"right\",right:\"left\",bottom:\"top\",top:\"bottom\"};function Y0(t,e){return typeof t==\"function\"?t(e):t}function Pu(t){return t.split(\"-\")[0]}function xg(t){return t.split(\"-\")[1]}function JH(t){return t===\"x\"?\"y\":\"x\"}function uE(t){return t===\"y\"?\"height\":\"width\"}function tl(t){let e=t[0];return e===\"t\"||e===\"b\"?\"y\":\"x\"}function cE(t){return JH(tl(t))}function YH(t,e,n){n===void 0&&(n=!1);let r=xg(t),o=cE(t),s=uE(o),a=o===\"x\"?r===(n?\"end\":\"start\")?\"right\":\"left\":r===\"start\"?\"bottom\":\"top\";return e.reference[s]>e.floating[s]&&(a=gg(a)),[a,gg(a)]}function ZH(t){let e=gg(t);return[J0(t),e,J0(e)]}function J0(t){return t.includes(\"start\")?t.replace(\"start\",\"end\"):t.replace(\"end\",\"start\")}var WH=[\"left\",\"right\"],XH=[\"right\",\"left\"],Kte=[\"top\",\"bottom\"],Gte=[\"bottom\",\"top\"];function Wte(t,e,n){switch(t){case\"top\":case\"bottom\":return n?e?XH:WH:e?WH:XH;case\"left\":case\"right\":return e?Kte:Gte;default:return[]}}function QH(t,e,n,r){let o=xg(t),s=Wte(Pu(t),n===\"start\",r);return o&&(s=s.map(a=>a+\"-\"+o),e&&(s=s.concat(s.map(J0)))),s}function gg(t){let e=Pu(t);return Vte[e]+t.slice(e.length)}function Xte(t){var e,n,r,o;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(o=t.left)!=null?o:0}}function e$(t){return typeof t!=\"number\"?Xte(t):{top:t,right:t,bottom:t,left:t}}function Bu(t){let{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function t$(t,e,n){let{reference:r,floating:o}=t,s=tl(e),a=cE(e),i=uE(a),l=Pu(e),u=s===\"y\",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[i]/2-o[i]/2,p;switch(l){case\"top\":p={x:c,y:r.y-o.height};break;case\"bottom\":p={x:c,y:r.y+r.height};break;case\"right\":p={x:r.x+r.width,y:d};break;case\"left\":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}let h=xg(e);return h&&(p[a]+=f*(h===\"end\"?1:-1)*(n&&u?-1:1)),p}async function n$(t,e){var n;e===void 0&&(e={});let{x:r,y:o,platform:s,rects:a,elements:i,strategy:l}=t,{boundary:u=\"clippingAncestors\",rootBoundary:c=\"viewport\",elementContext:d=\"floating\",altBoundary:f=!1,padding:p=0}=Y0(e,t),h=e$(p),m=i[f?d===\"floating\"?\"reference\":\"floating\":d],y=Bu(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d===\"floating\"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),v=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},S=Bu(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:b,offsetParent:x,strategy:l}):b);return{top:(y.top-S.top+h.top)/v.y,bottom:(S.bottom-y.bottom+h.bottom)/v.y,left:(y.left-S.left+h.left)/v.x,right:(S.right-y.right+h.right)/v.x}}var Jte=50,r$=async(t,e,n)=>{let{placement:r=\"bottom\",strategy:o=\"absolute\",middleware:s=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:n$},l=await(a.isRTL==null?void 0:a.isRTL(e)),u=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:c,y:d}=t$(u,r,l),f=r,p=0,h={};for(let g=0;g<s.length;g++){let m=s[g];if(!m)continue;let{name:y,fn:b}=m,{x,y:v,data:S,reset:E}=await b({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:t,floating:e}});c=x??c,d=v??d,h[y]={...h[y],...S},E&&p<Jte&&(p++,typeof E==\"object\"&&(E.placement&&(f=E.placement),E.rects&&(u=E.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:o}):E.rects),{x:c,y:d}=t$(u,f,l)),g=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}};var o$=function(t){return t===void 0&&(t={}),{name:\"flip\",options:t,async fn(e){var n,r;let{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=\"bestFit\",fallbackAxisSideDirection:h=\"none\",flipAlignment:g=!0,...m}=Y0(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let y=Pu(o),b=tl(i),x=Pu(i)===i,v=await(l.isRTL==null?void 0:l.isRTL(u.floating)),S=f||(x||!g?[gg(i)]:ZH(i)),E=h!==\"none\";!f&&E&&S.push(...QH(i,g,h,v));let w=[i,...S],k=await l.detectOverflow(e,m),A=[],L=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&A.push(k[y]),d){let F=YH(o,a,v);A.push(k[F[0]],k[F[1]])}if(L=[...L,{placement:o,overflows:A}],!A.every(F=>F<=0)){var _,P;let F=(((_=s.flip)==null?void 0:_.index)||0)+1,j=w[F];if(j&&(!(d===\"alignment\"?b!==tl(j):!1)||L.every(ue=>tl(ue.placement)===b?ue.overflows[0]>0:!0)))return{data:{index:F,overflows:L},reset:{placement:j}};let K=(P=L.filter(ve=>ve.overflows[0]<=0).sort((ve,ue)=>ve.overflows[1]-ue.overflows[1])[0])==null?void 0:P.placement;if(!K)switch(p){case\"bestFit\":{var D;let ve=(D=L.filter(ue=>{if(E){let Ue=tl(ue.placement);return Ue===b||Ue===\"y\"}return!0}).map(ue=>[ue.placement,ue.overflows.filter(Ue=>Ue>0).reduce((Ue,Re)=>Ue+Re,0)]).sort((ue,Ue)=>ue[1]-Ue[1])[0])==null?void 0:D[0];ve&&(K=ve);break}case\"initialPlacement\":K=i;break}if(o!==K)return{reset:{placement:K}}}return{}}}};var Yte=new Set([\"left\",\"top\"]);async function Zte(t,e){let{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Pu(n),i=xg(n),l=tl(n)===\"y\",u=Yte.has(a)?-1:1,c=s&&l?-1:1,d=Y0(e,t),{mainAxis:f,crossAxis:p,alignmentAxis:h}=typeof d==\"number\"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof h==\"number\"&&(p=i===\"end\"?h*-1:h),l?{x:p*c,y:f*u}:{x:f*u,y:p*c}}var s$=function(t){return t===void 0&&(t=0),{name:\"offset\",options:t,async fn(e){var n,r;let{x:o,y:s,placement:a,middlewareData:i}=e,l=await Zte(e,t);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:a}}}}};function Z0(){return typeof window<\"u\"}function Fu(t){return i$(t)?(t.nodeName||\"\").toLowerCase():\"#document\"}function dr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ns(t){var e;return(e=(i$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function i$(t){return Z0()?t instanceof Node||t instanceof dr(t).Node:!1}function es(t){return Z0()?t instanceof Element||t instanceof dr(t).Element:!1}function Ua(t){return Z0()?t instanceof HTMLElement||t instanceof dr(t).HTMLElement:!1}function a$(t){return!Z0()||typeof ShadowRoot>\"u\"?!1:t instanceof ShadowRoot||t instanceof dr(t).ShadowRoot}function wg(t){let{overflow:e,overflowX:n,overflowY:r,display:o}=ts(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!==\"inline\"&&o!==\"contents\"}function l$(t){return/^(table|td|th)$/.test(Fu(t))}function Sg(t){try{if(t.matches(\":popover-open\"))return!0}catch{}try{return t.matches(\":modal\")}catch{return!1}}var Qte=/transform|translate|scale|rotate|perspective|filter/,ene=/paint|layout|strict|content/,zu=t=>!!t&&t!==\"none\",dE;function Q0(t){let e=es(t)?ts(t):t;return zu(e.transform)||zu(e.translate)||zu(e.scale)||zu(e.rotate)||zu(e.perspective)||!ew()&&(zu(e.backdropFilter)||zu(e.filter))||Qte.test(e.willChange||\"\")||ene.test(e.contain||\"\")}function u$(t){let e=nl(t);for(;Ua(e)&&!wf(e);){if(Q0(e))return e;if(Sg(e))return null;e=nl(e)}return null}function ew(){return dE==null&&(dE=typeof CSS<\"u\"&&CSS.supports&&CSS.supports(\"-webkit-backdrop-filter\",\"none\")),dE}function wf(t){return/^(html|body|#document)$/.test(Fu(t))}function ts(t){return dr(t).getComputedStyle(t)}function kg(t){return es(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function nl(t){if(Fu(t)===\"html\")return t;let e=t.assignedSlot||t.parentNode||a$(t)&&t.host||Ns(t);return a$(e)?e.host:e}function c$(t){let e=nl(t);return wf(e)?(t.ownerDocument||t).body:Ua(e)&&wg(e)?e:c$(e)}function xf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=c$(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),a=dr(o);if(s){let i=tw(a);return e.concat(a,a.visualViewport||[],wg(o)?o:[],i&&n?xf(i):[])}else return e.concat(o,xf(o,[],n))}function tw(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function p$(t){let e=ts(t),n=parseFloat(e.width)||0,r=parseFloat(e.height)||0,o=Ua(t),s=o?t.offsetWidth:n,a=o?t.offsetHeight:r,i=bg(n)!==s||bg(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function pE(t){return es(t)?t:t.contextElement}function Sf(t){let e=pE(t);if(!Ua(e))return Ds(1);let n=e.getBoundingClientRect(),{width:r,height:o,$:s}=p$(e),a=(s?bg(n.width):n.width)/r,i=(s?bg(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}var tne=Ds(0);function h$(t){let e=dr(t);return!ew()||!e.visualViewport?tne:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function nne(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===dr(t)}function Hu(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=pE(t),a=Ds(1);e&&(r?es(r)&&(a=Sf(r)):a=Sf(t));let i=nne(s,n,r)?h$(s):Ds(0),l=(o.left+i.x)/a.x,u=(o.top+i.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(s&&r){let f=dr(s),p=es(r)?dr(r):r,h=f,g=tw(h);for(;g&&p!==h;){let m=Sf(g),y=g.getBoundingClientRect(),b=ts(g),x=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*m.x,v=y.top+(g.clientTop+parseFloat(b.paddingTop))*m.y;l*=m.x,u*=m.y,c*=m.x,d*=m.y,l+=x,u+=v,h=dr(g),g=tw(h)}}return Bu({width:c,height:d,x:l,y:u})}function nw(t,e){let n=kg(t).scrollLeft;return e?e.left+n:Hu(Ns(t)).left+n}function m$(t,e){let n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-nw(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function rne(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t,s=o===\"fixed\",a=Ns(r),i=e?Sg(e.floating):!1;if(r===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Ds(1),c=Ds(0),d=Ua(r);if((d||!s)&&((Fu(r)!==\"body\"||wg(a))&&(l=kg(r)),d)){let p=Hu(r);u=Sf(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}let f=a&&!d&&!s?m$(a,l):Ds(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function one(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function sne(t){let e=kg(t),n=t.ownerDocument.body,r=el(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=el(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),s=-e.scrollLeft+nw(t),a=-e.scrollTop;return ts(n).direction===\"rtl\"&&(s+=el(t.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:a}}var ane=25;function ine(t,e,n){n===void 0&&(n=\"viewport\");let r=n===\"layoutViewport\",o=dr(t),s=Ns(t),a=o.visualViewport,i=s.clientWidth,l=s.clientHeight,u=0,c=0;if(a){let f=!ew()||e===\"fixed\";r?f||(u=-a.offsetLeft,c=-a.offsetTop):(i=a.width,l=a.height,f&&(u=a.offsetLeft,c=a.offsetTop))}if(nw(s)<=0){let f=s.ownerDocument,p=f.body,h=getComputedStyle(p),g=f.compatMode===\"CSS1Compat\"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(s.clientWidth-p.clientWidth-g),y=getComputedStyle(s).scrollbarGutter===\"stable both-edges\"?m/2:m;y<=ane&&(i-=y)}return{width:i,height:l,x:u,y:c}}function lne(t,e){let n=Hu(t,!0,e===\"fixed\"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Sf(t),a=t.clientWidth*s.x,i=t.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:a,height:i,x:l,y:u}}function d$(t,e,n){let r;if(e===\"viewport\"||e===\"layoutViewport\")r=ine(t,n,e);else if(e===\"document\")r=sne(Ns(t));else if(es(e))r=lne(e,n);else{let o=h$(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Bu(r)}function une(t,e){let n=e.get(t);if(n)return n;let r=xf(t,[],!1).filter(i=>es(i)&&Fu(i)!==\"body\"),o=null,s=ts(t).position===\"fixed\",a=s?nl(t):t;for(;es(a)&&!wf(a);){let i=ts(a),l=Q0(a),u=o?o.position:s?\"fixed\":\"\";!l&&(u===\"fixed\"||u===\"absolute\"&&i.position===\"static\")?r=r.filter(d=>d!==a):o=i,a=nl(a)}return e.set(t,r),r}function cne(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t,a=[...n===\"clippingAncestors\"?Sg(e)?[]:une(e,this._c):[].concat(n),r],i=d$(e,a[0],o),l=i.top,u=i.right,c=i.bottom,d=i.left;for(let f=1;f<a.length;f++){let p=d$(e,a[f],o);l=el(p.top,l),u=yg(p.right,u),c=yg(p.bottom,c),d=el(p.left,d)}return{width:u-d,height:c-l,x:d,y:l}}function dne(t){let{width:e,height:n}=p$(t);return{width:e,height:n}}function fne(t,e,n){let r=Ua(e),o=Ns(e),s=n===\"fixed\",a=Hu(t,!0,s,e),i={scrollLeft:0,scrollTop:0},l=Ds(0);if((r||!s)&&((Fu(e)!==\"body\"||wg(o))&&(i=kg(e)),r)){let f=Hu(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}!r&&o&&(l.x=nw(o));let u=o&&!r&&!s?m$(o,i):Ds(0),c=a.left+i.scrollLeft-l.x-u.x,d=a.top+i.scrollTop-l.y-u.y;return{x:c,y:d,width:a.width,height:a.height}}function fE(t){return ts(t).position===\"static\"}function f$(t,e){if(!Ua(t)||ts(t).position===\"fixed\")return null;if(e)return e(t);let n=t.offsetParent;return Ns(t)===n&&(n=n.ownerDocument.body),n}function g$(t,e){let n=dr(t);if(Sg(t))return n;if(!Ua(t)){let o=nl(t);for(;o&&!wf(o);){if(es(o)&&!fE(o))return o;o=nl(o)}return n}let r=f$(t,e);for(;r&&l$(r)&&fE(r);)r=f$(r,e);return r&&wf(r)&&fE(r)&&!Q0(r)?n:r||u$(t)||n}var pne=async function(t){let e=this.getOffsetParent||g$,n=this.getDimensions,r=await n(t.floating);return{reference:fne(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hne(t){return ts(t).direction===\"rtl\"}var mne={convertOffsetParentRelativeRectToViewportRelativeRect:rne,getDocumentElement:Ns,getClippingRect:cne,getOffsetParent:g$,getElementRects:pne,getClientRects:one,getDimensions:dne,getScale:Sf,isElement:es,isRTL:hne};function y$(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function gne(t,e,n){let r=null,o,s=Ns(t);function a(){var c;clearTimeout(o),(c=r)==null||c.disconnect(),r=null}function i(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();let f=t.getBoundingClientRect(),{left:p,top:h,width:g,height:m}=f;if(c||e(),!g||!m)return;let y=vg(h),b=vg(s.clientWidth-(p+g)),x=vg(s.clientHeight-(h+m)),v=vg(p),E={rootMargin:-y+\"px \"+-b+\"px \"+-x+\"px \"+-v+\"px\",threshold:el(0,yg(1,d))||1},w=!0;function k(A){let L=A[0].intersectionRatio;if(!y$(f,t.getBoundingClientRect()))return i();if(L!==d){if(!w)return i();L?i(!1,L):o=setTimeout(()=>{i(!1,1e-7)},1e3)}w=!1}try{r=new IntersectionObserver(k,{...E,root:s.ownerDocument})}catch{r=new IntersectionObserver(k,E)}r.observe(t)}let l=dr(t),u=()=>i(n);return l.addEventListener(\"resize\",u),i(!0),()=>{l.removeEventListener(\"resize\",u),a()}}function b$(t,e,n,r){r===void 0&&(r={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver==\"function\",layoutShift:i=typeof IntersectionObserver==\"function\",animationFrame:l=!1}=r,u=pE(t),c=o||s?[...u?xf(u):[],...e?xf(e):[]]:[];c.forEach(y=>{o&&y.addEventListener(\"scroll\",n),s&&y.addEventListener(\"resize\",n)});let d=u&&i?gne(u,n,s):null,f=-1,p=null;a&&(p=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&p&&e&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(e)})),n()}),u&&!l&&p.observe(u),e&&p.observe(e));let h,g=l?Hu(t):null;l&&m();function m(){let y=Hu(t);g&&!y$(g,y)&&n(),g=y,h=requestAnimationFrame(m)}return n(),()=>{var y;c.forEach(b=>{o&&b.removeEventListener(\"scroll\",n),s&&b.removeEventListener(\"resize\",n)}),d?.(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var v$=s$;var x$=o$;var w$=(t,e,n)=>{let r=new Map,o=n??{},s={...mne,...o.platform,_c:r};return r$(t,e,{...o,platform:s})};function yne(t){var e;let{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:i}=t,l=r&&!o,u=cB(n),c=new RegExp(`\\\\s${u}$`),d=a?\"^\":\"\",f=o?\"\":u,p=l?new RegExp(`${d}${u}.*?(?=\\\\s${f}|$)`,\"gm\"):new RegExp(`${d}(?:^)?${u}[^\\\\s${f}]*`,\"gm\"),h=((e=i.nodeBefore)===null||e===void 0?void 0:e.isText)&&i.nodeBefore.text;if(!h)return null;let g=i.pos-h.length,m=Array.from(h.matchAll(p)).pop();if(!m||m.input===void 0||m.index===void 0)return null;let y=m.input.slice(Math.max(0,m.index-1),m.index),b=new RegExp(`^[${s?.join(\"\")}\\0]?$`).test(y);if(s!==null&&!b)return null;let x=g+m.index,v=x+m[0].length;return l&&c.test(h.slice(v-1,v+1))&&(m[0]+=\" \",v+=1),x<i.pos&&v>=i.pos?{range:{from:x,to:v},query:m[0].slice(n.length),text:m[0]}:null}function bne(t){return t.docChanged?t.steps.some(e=>{let n=e.slice;if(!n?.content)return!1;let r=n.content.textBetween(0,n.content.size,`\n`);return/\\s/.test(r)}):!1}function vne(t){return()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:o,left:s}=t.view.coordsAtPos(e);try{return new DOMRect(s,n,r-s,o-n)}catch{return null}}}function xne(t,e,n,r){return n?()=>{let o=r.getState(t.state),s=o?.decorationId,a=e.dom.querySelector(`[data-decoration-id=\"${s}\"]`);return a?.getBoundingClientRect()||null}:vne(t)}function wne({match:t,dismissedRange:e,state:n,transaction:r,editor:o,shouldResetDismissed:s,effectiveAllowSpaces:a}){return s?.({editor:o,state:n,range:e,match:t,transaction:r,allowSpaces:a})?!1:a?t.range.from===e.from:t.range.from===e.from&&!bne(r)}function Sne({view:t,pluginKeyRef:e}){let n=t.state.tr.setMeta(e,{exit:!0});t.dispatch(n)}function kne({pluginKey:t,decorationTag:e,decorationClass:n,decorationContent:r,decorationEmptyClass:o,renderer:s,dispatchExit:a}){return{handleKeyDown(i,l){var u;let c=t.getState(i.state);if(!c.active)return!1;if(l.key===\"Escape\"||l.key===\"Esc\"){var d;return s==null||(d=s.onKeyDown)===null||d===void 0||d.call(s,{view:i,event:l,range:c.range}),a(i),!0}return(s==null||(u=s.onKeyDown)===null||u===void 0?void 0:u.call(s,{view:i,event:l,range:c.range}))||!1},decorations(i){let{active:l,range:u,decorationId:c,query:d}=t.getState(i);if(!l)return null;let f=!d?.length,p=[n];return f&&p.push(o),He.create(i.doc,[yn.inline(u.from,u.to,{nodeName:e,class:p.join(\" \"),\"data-decoration-id\":c||void 0,\"data-decoration-content\":r})])}}}function Cne({editor:t,char:e,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:s,findSuggestionMatch:a,allow:i,shouldShow:l,shouldKeepDismissed:u,pluginKey:c}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,h){let{isEditable:g}=t,{composing:m}=t.view,{selection:y}=d,{empty:b,from:x}=y,v={...f},S=d.getMeta(c);if(S&&S.exit)return v.active=!1,v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null,v.dismissedRange=f.active?{...f.range}:f.dismissedRange,v;if(v.composing=m,d.docChanged&&v.dismissedRange!==null&&(v.dismissedRange={from:d.mapping.map(v.dismissedRange.from),to:d.mapping.map(v.dismissedRange.to)}),g&&(b||t.view.composing)){(x<f.range.from||x>f.range.to)&&!m&&!f.composing&&(v.active=!1);let E=a({char:e,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:s,$position:y.$from}),w=`id_${Math.floor(Math.random()*4294967295)}`;E&&i({editor:t,state:h,range:E.range,isActive:f.active})&&(!l||l({editor:t,range:E.range,query:E.query,text:E.text,transaction:d}))?(v.dismissedRange!==null&&!u({match:E,dismissedRange:v.dismissedRange,state:h,transaction:d})&&(v.dismissedRange=null),v.dismissedRange===null?(v.active=!0,v.decorationId=f.decorationId||w,v.range=E.range,v.query=E.query,v.text=E.text):v.active=!1):(E||(v.dismissedRange=null),v.active=!1)}else v.active=!1;return v.active||(v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null),v}}}function Lne({editor:t,items:e}){let n=null,r=null,o=null,s=()=>{r!==null&&(clearTimeout(r),r=null),o?.(),o=null},a=u=>new Promise(c=>{o=c,r=setTimeout(()=>{r=null;let d=o;o=null,d?.()},u)}),i=()=>{n?.abort(),s(),n=null};return{abort:i,fetch:async(u,c)=>{i(),n=new AbortController;let d=n;if(c>0&&await a(c),n!==d||d.signal.aborted)return{status:\"aborted\"};try{let f=await e({editor:t,query:u,signal:d.signal});return n!==d||d.signal.aborted?{status:\"aborted\"}:{status:\"resolved\",items:f}}catch{return n!==d||d.signal.aborted?{status:\"aborted\"}:{status:\"error\"}}}}}function Ane({placement:t,offset:e,flip:n,floatingUi:r}){var o,s,a,i;let l=[v$({mainAxis:(o=e.mainAxis)!==null&&o!==void 0?o:4,crossAxis:(s=e.crossAxis)!==null&&s!==void 0?s:0})];return n&&l.push(x$()),!(r==null||(a=r.middleware)===null||a===void 0)&&a.length&&l.push(...r.middleware),{placement:t,strategy:(i=r?.strategy)!==null&&i!==void 0?i:\"absolute\",middleware:l}}function Ene(t){if(t instanceof HTMLElement)return t;if(typeof t==\"string\")try{let e=document.querySelector(t);if(e)return e}catch{return document.body}return document.body}function Tne({getReferenceRect:t,contextElement:e,config:n,container:r,dismissOnOutsideClick:o,dismiss:s}){return(a,i={})=>{let l={getBoundingClientRect:()=>{var h;return(h=t())!==null&&h!==void 0?h:new DOMRect},contextElement:e},u=!1,c=!a.isConnected;c&&Ene(r).appendChild(a),i.onPosition||(a.style.visibility=\"hidden\",a.style.width=\"max-content\");let f=b$(l,a,()=>{w$(l,a,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:h,y:g,placement:m,strategy:y})=>{if(i.onPosition){i.onPosition({x:h,y:g,placement:m,strategy:y});return}Object.assign(a.style,{position:y,left:`${h}px`,top:`${g}px`}),u||(u=!0,a.style.visibility=\"\")})},i.autoUpdate),p;return o&&(p=h=>{let g=h.target;!(g instanceof Node)||a.contains(g)||e.contains(g)||s()},document.addEventListener(\"pointerdown\",p,!0)),()=>{f(),p&&document.removeEventListener(\"pointerdown\",p,!0),c&&a.remove()}}}function Rne({editor:t,pluginKey:e,items:n,renderer:r,minQueryLength:o,debounce:s,initialItems:a,placement:i,offset:l,container:u,flip:c,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:h,dispatchExit:g}){let m,y=Lne({editor:t,items:n}),b=Ane({placement:i,offset:l,flip:c,floatingUi:d});function x(v,S){switch(v){case\"started\":var E;r==null||(E=r.onStart)===null||E===void 0||E.call(r,S);break;case\"updated\":var w;r==null||(w=r.onUpdate)===null||w===void 0||w.call(r,S);break;case\"stopped\":var k;r==null||(k=r.onExit)===null||k===void 0||k.call(r,S)}}return{update:async(v,S)=>{var E,w;let k=e.getState(S),A=e.getState(v.state);if(!k||!A)return;let L=null,_=k.query!==A.query,P=k.text!==A.text,D=k.range.from!==A.range.from||k.range.to!==A.range.to,F=_||P||D;if(!k.active&&A.active)L=\"started\";else if(k.active&&!A.active)L=\"stopped\";else if(A.active&&F)L=\"updated\";else return;let j=L===\"stopped\"?k:A,K=v.dom.querySelector(`[data-decoration-id=\"${j.decorationId}\"]`),ve=h(v,K),ue=o===0||(j.query?j.query.length>=o:!1),Ue=(L===\"started\"||L===\"updated\")&&ue;if(m={editor:t,range:j.range,query:j.query||\"\",text:j.text||\"\",items:a??[],command:Ke=>p({editor:t,range:j.range,props:Ke}),decorationNode:K,clientRect:ve,loading:Ue,placement:i,offset:{mainAxis:(E=l.mainAxis)!==null&&E!==void 0?E:4,crossAxis:(w=l.crossAxis)!==null&&w!==void 0?w:0},container:u,flip:c,floatingUi:b,mount:Tne({getReferenceRect:ve,contextElement:v.dom,config:b,container:u,dismissOnOutsideClick:f,dismiss:()=>g(t.view)})},L===\"started\"){var Re;r==null||(Re=r.onBeforeStart)===null||Re===void 0||Re.call(r,m)}if(L===\"updated\"){var je;r==null||(je=r.onBeforeUpdate)===null||je===void 0||je.call(r,m)}if(L===\"started\"&&x(L,m),L===\"started\"||L===\"updated\")if(!Ue)y.abort(),m={...m,items:a??[],loading:!1};else{m={...m,items:a??[],loading:!0},L=\"updated\",x(L,m);let Ke=await y.fetch(j.query||\"\",s);if(Ke.status===\"aborted\")return;let M=e.getState(v.state);if(!M?.active){y.abort();return}m=Ke.status===\"resolved\"?{...m,items:Ke.items,loading:!1}:{...m,loading:!1}}if(L===\"stopped\"){y.abort(),x(L,m),m=void 0;return}L===\"updated\"&&x(L,m)},destroy:()=>{var v;y.abort(),m&&(r==null||(v=r.onExit)===null||v===void 0||v.call(r,m))}}}var Ine=new we(\"suggestion\");function Mne({pluginKey:t=Ine,editor:e,char:n=\"@\",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:s=[\" \"],startOfLine:a=!1,decorationTag:i=\"span\",decorationClass:l=\"suggestion\",decorationContent:u=\"\",decorationEmptyClass:c=\"is-empty\",command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:h=0,initialItems:g,placement:m=\"bottom-start\",offset:y={},container:b,flip:x=!0,floatingUi:v,dismissOnOutsideClick:S=!0,render:E=()=>({}),allow:w=()=>!0,findSuggestionMatch:k=yne,shouldShow:A,shouldResetDismissed:L}){let _=E?.(),P=r&&!o,D=(K,ve)=>xne(e,K,ve,t);function F(K){return wne({...K,editor:e,shouldResetDismissed:L,effectiveAllowSpaces:P})}let j=K=>Sne({view:K,pluginKeyRef:t});return new ie({key:t,view:()=>Rne({editor:e,pluginKey:t,items:f,renderer:_,minQueryLength:p,debounce:h,initialItems:g,placement:m,offset:y,container:b,flip:x,floatingUi:v,dismissOnOutsideClick:S,command:d,clientRectFor:D,dispatchExit:j}),state:Cne({editor:e,char:n,effectiveAllowSpaces:P,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,findSuggestionMatch:k,allow:w,shouldShow:A,shouldKeepDismissed:F,pluginKey:t}),props:kne({pluginKey:t,decorationTag:i,decorationClass:l,decorationContent:u,decorationEmptyClass:c,renderer:_,dispatchExit:j})})}var S$=Mne;var Cg={image:null,element:null};function k$(t){Object.assign(Cg,t)}var hE=(t,e)=>({default:e,parseHTML:n=>{try{return JSON.parse(n.getAttribute(`data-${t}`)??\"\")}catch{return e}},renderHTML:n=>({[`data-${t}`]:JSON.stringify(n[t]??e)})}),C$=Jr.create({name:\"image\",group:\"block\",atom:!0,draggable:!0,addAttributes(){return{image:hE(\"image\",null),caption:{default:\"\"}}},parseHTML(){return[{tag:\"div[data-smoodly-image]\"}]},renderHTML({HTMLAttributes:t}){return[\"div\",Vt({\"data-smoodly-image\":\"\"},t)]},addNodeView(){return Cg.image?tA(Cg.image):null}}),L$=Jr.create({name:\"element\",group:\"block\",atom:!0,draggable:!0,addAttributes(){return{name:{default:\"\"},fields:hE(\"fields\",{}),settings:hE(\"settings\",{})}},parseHTML(){return[{tag:\"div[data-smoodly-element]\"}]},renderHTML({HTMLAttributes:t}){return[\"div\",Vt({\"data-smoodly-element\":\"\"},t)]},addNodeView(){return Cg.element?tA(Cg.element):null}});function mE(t,e,n){let r=n??t.state.selection.to;t.chain().insertContentAt(r,[e,{type:\"paragraph\"}]).focus().run()}var A$=bn.create({name:\"smoodlySlash\",addOptions(){return{items:()=>[],onState:()=>{},onKeyDown:()=>!1,onPick:()=>{}}},addProseMirrorPlugins(){let{options:t}=this;return[S$({editor:this.editor,char:\"/\",startOfLine:!0,allow:({state:e,range:n})=>{let r=e.doc.resolve(n.from);return r.parent.type.name===\"paragraph\"&&r.parentOffset===0},items:({query:e})=>t.items(e),command:({editor:e,range:n,props:r})=>{e.chain().focus().deleteRange(n).run(),t.onState(null),t.onPick(r)},render:()=>({onStart:e=>t.onState({items:e.items,rect:e.clientRect?.()??null,pick:n=>e.command(n)}),onUpdate:e=>t.onState({items:e.items,rect:e.clientRect?.()??null,pick:n=>e.command(n)}),onKeyDown:e=>t.onKeyDown(e.event),onExit:()=>t.onState(null)})})]}});function gE(t){return{addInputRules(){return t?this.parent?.()??[]:[]},addPasteRules(){return t?this.parent?.()??[]:[]},addKeyboardShortcuts(){return t?this.parent?.()??{}:{}}}}function yE(t){return{addInputRules(){return t?this.parent?.()??[]:[]},addPasteRules(){return t?this.parent?.()??[]:[]},addKeyboardShortcuts(){return t?this.parent?.()??{}:{}}}}var _ne=[1,2,3,4,5,6];function E$(t,e){let n=t.marks.has(\"link\"),r=t.headingLevels,o=e.slash?W0(t,e.slash.elements):[],s=e.slash;return[iH.configure({heading:!1,bold:!1,italic:!1,link:!1,blockquote:!1,bulletList:!1,orderedList:!1,code:!1,codeBlock:!1,strike:!1,underline:!1,horizontalRule:!1,dropcursor:!1,gapcursor:!1,trailingNode:!1}),lH.extend({addInputRules(){return r.map(a=>Ex({find:new RegExp(`^(#{${a}})\\\\s$`),type:this.type,getAttributes:{level:a}}))},addKeyboardShortcuts(){return Object.fromEntries(r.map(a=>[`Mod-Alt-${a}`,()=>this.editor.commands.toggleHeading({level:a})]))}}).configure({levels:_ne}),fH.extend(gE(t.marks.has(\"bold\"))),pH.extend(gE(t.marks.has(\"italic\"))),bH.extend({...gE(n),addAttributes(){return{href:{default:null}}}}).configure({openOnClick:!1,autolink:n,linkOnPaste:n,isAllowedUri:(a,i)=>/^[/#?.]/.test(a)||i.defaultValidate(a)}),vH.extend(yE(t.nodes.has(\"blockquote\"))),eE.extend(yE(t.nodes.has(\"bulletList\"))),oE.extend(yE(t.nodes.has(\"orderedList\"))),bn.create({name:\"smoodlyLinkShortcut\",addKeyboardShortcuts(){return n?{\"Mod-k\":()=>(e.onLink(),!0)}:{}}}),C$,L$,...s&&o.length>0?[A$.configure({items:a=>X0(o,a),onState:s.onState,onKeyDown:s.onKeyDown,onPick:s.onPick})]:[]]}function One(t,e){if(e.length===0)return null;let n=e[0];for(let r of e){let o=Math.abs(r-t),s=Math.abs(n-t);(o<s||o===s&&r<n)&&(n=r)}return n}function R$(t,e){return t.flatMap(n=>Dne(n,e))}function Dne(t,e){if(t.type===\"text\"){let o=(t.marks??[]).filter(i=>e.marks.has(i.type)),{marks:s,...a}=t;return[o.length>0?{...a,marks:o}:a]}if(t.type===\"image\")return e.image?[t]:[];if(t.type===\"element\")return e.elements.includes(String(t.attrs?.name))?[t]:[];let n=t.content?R$(t.content,e):void 0,r=o=>n?{...o,content:n}:o;if(t.type===\"heading\"){let o=One(Number(t.attrs?.level??1),e.headingLevels);return o===null?[r({type:\"paragraph\"})]:[r({...t,attrs:{...t.attrs,level:o}})]}return t.type===\"blockquote\"&&!e.nodes.has(\"blockquote\")?n??[]:t.type===\"bulletList\"&&!e.nodes.has(\"bulletList\")||t.type===\"orderedList\"&&!e.nodes.has(\"orderedList\")?(n??[]).flatMap(o=>o.content??[]):[r(t)]}function T$(t,e){let n=0,r=t;for(;r.length>0;){let o=e===\"first\"?r[0]:r[r.length-1];if(o.type===\"text\")break;n++,r=o.content??[]}return n}function I$(t,e){let n=R$(t.content??[],e);return{content:n,openStart:Math.min(t.openStart??0,T$(n,\"first\")),openEnd:Math.min(t.openEnd??0,T$(n,\"last\"))}}var Cf=T(te(),1);var rl=T(te(),1);function M$(t,e){if(e)return ou(e);if(t.aspect)return ou(t.aspect);let n=t.width/t.height;return t.crop?wL(t.crop,n):n}function rw(t,e){let n=t.crop??gv,r=t.hotspot??yv,o=t.width/t.height,s=wL(n,o),a,i;s>=e?(i=1/n.height,a=i*o):(a=e/n.width,i=a/o);let l=n.width*a,u=n.height*i,c=Td((r.x-n.left)/n.width),d=Td((r.y-n.top)/n.height),f=Math.min(Math.max(c*l-e/2,0),Math.max(l-e,0)),p=Math.min(Math.max(d*u-.5,0),Math.max(u-1,0)),h=-(n.left*a)-f,g=-(n.top*i)-p;return{left:h/e*100,top:g*100,width:a/e*100,height:i*100}}var Nne=.05;function Pne(t,e){let n=t/e,r=n<=1?n:1,o=n<=1?1:1/n;return{left:(1-r)/2,top:(1-o)/2,width:r,height:o}}function _$(t,e,n){return{...t,left:Math.min(Math.max(t.left+e,0),1-t.width),top:Math.min(Math.max(t.top+n,0),1-t.height)}}function O$(t,e,n,r,o,s=Nne){let a=t.left+t.width,i=t.top+t.height,l=e.includes(\"w\")?a:t.left,u=e.includes(\"n\")?i:t.top,c=Td((e.includes(\"w\")?t.left:a)+n),d=Td((e.includes(\"n\")?t.top:i)+r),f=Math.max(e.includes(\"w\")?l-c:c-l,s),p=Math.max(e.includes(\"n\")?u-d:d-u,s),h=e.includes(\"w\")?l:1-l,g=e.includes(\"n\")?u:1-u;return o!==void 0?(p=f/o,p>g&&(p=g,f=p*o),f>h&&(f=h,p=f/o),p<s&&(p=s,f=p*o)):(f=Math.min(f,h),p=Math.min(p,g)),{left:e.includes(\"w\")?l-f:l,top:e.includes(\"n\")?u-p:u,width:f,height:p}}function kf(t,e){return{x:Math.min(Math.max(t.x,e.left),e.left+e.width),y:Math.min(Math.max(t.y,e.top),e.top+e.height)}}var Bne=(t,e)=>Math.abs(t.width/t.height-e)<.001;function bE(t,e,n){if(e===void 0)return{crop:t.crop,hotspot:kf(t.hotspot,t.crop)};let r=e/n,o=Bne(t.crop,r)?t.crop:Pne(e,n);return{crop:o,hotspot:kf(t.hotspot,o)}}function D$(t,e,n){return bE({crop:t?.crop??gv,hotspot:t?.hotspot??yv},e,n)}var Ct=T(O(),1),Xn=t=>`${t*100}%`;function ow({asset:t,descriptor:e,value:n,caption:r,onSave:o,onClose:s}){let a=e.aspect,i=Array.isArray(a)?a:typeof a==\"string\"?[a]:[],l=t.width??1,u=t.height??1,c=l/u,[d,f]=(0,rl.useState)(i.includes(n.aspect??\"\")?n.aspect:i[0]),p=d?ou(d):void 0,[h,g]=(0,rl.useState)(()=>D$(n,p,c)),[m,y]=(0,rl.useState)(n.alt??\"\"),[b,x]=(0,rl.useState)(r??\"\"),v=(0,rl.useRef)(null),S=(0,rl.useRef)(null),E=j=>{f(j),g(K=>bE(K,ou(j),c))},w=j=>K=>{K.preventDefault(),K.stopPropagation(),K.currentTarget.setPointerCapture(K.pointerId),S.current={kind:j,x:K.clientX,y:K.clientY,start:h}},k=j=>{let K=S.current,ve=v.current;if(!K||!ve)return;let ue=(j.clientX-K.x)/ve.clientWidth,Ue=(j.clientY-K.y)/ve.clientHeight,Re=p===void 0?void 0:p/c;if(K.kind===\"move\"){let je=_$(K.start.crop,ue,Ue);g({crop:je,hotspot:kf(K.start.hotspot,je)})}else if(K.kind===\"hotspot\")g({crop:K.start.crop,hotspot:kf({x:K.start.hotspot.x+ue,y:K.start.hotspot.y+Ue},K.start.crop)});else{let je=O$(K.start.crop,K.kind,ue,Ue,Re);g({crop:je,hotspot:kf(K.start.hotspot,je)})}},A=()=>{S.current=null},{crop:L,hotspot:_}=h,P=p??L.width*c/L.height,D=rw({width:l,height:u,crop:L,hotspot:_},P);return(0,Ct.jsx)(Rs,{title:\"Crop and focus\",width:900,onClose:s,footer:(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsx)(Q,{variant:\"secondary\",onClick:s,children:\"Cancel\"}),(0,Ct.jsx)(Q,{onClick:()=>o({...n,crop:L,hotspot:_,...m.trim()?{alt:m.trim()}:{alt:void 0},...i.length>1&&d?{aspect:d}:{aspect:void 0}},r===void 0?void 0:b),children:\"Save\"})]}),children:(0,Ct.jsxs)(\"div\",{className:\"sm-crop\",children:[(0,Ct.jsxs)(\"div\",{className:\"sm-crop__stage\",ref:v,onPointerMove:k,onPointerUp:A,onPointerCancel:A,children:[(0,Ct.jsx)(\"img\",{src:t.url,alt:\"\",draggable:!1}),(0,Ct.jsx)(\"div\",{className:\"sm-crop__shade\",style:{clipPath:`polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 ${Xn(L.top)}, ${Xn(L.left)} ${Xn(L.top)}, ${Xn(L.left)} ${Xn(L.top+L.height)}, ${Xn(L.left+L.width)} ${Xn(L.top+L.height)}, ${Xn(L.left+L.width)} ${Xn(L.top)}, 0 ${Xn(L.top)})`}}),(0,Ct.jsx)(\"div\",{className:\"sm-crop__rect\",style:{left:Xn(L.left),top:Xn(L.top),width:Xn(L.width),height:Xn(L.height)},onPointerDown:w(\"move\"),children:[\"nw\",\"ne\",\"sw\",\"se\"].map(j=>(0,Ct.jsx)(\"span\",{className:`sm-crop__handle sm-crop__handle--${j}`,onPointerDown:w(j)},j))}),(0,Ct.jsx)(\"div\",{className:\"sm-crop__hotspot\",title:\"Focus point\",style:{left:Xn(_.x),top:Xn(_.y)},onPointerDown:w(\"hotspot\")})]}),(0,Ct.jsxs)(\"div\",{className:\"sm-crop__side\",children:[i.length>1&&(0,Ct.jsx)(xe,{label:\"Aspect\",asDiv:!0,children:(0,Ct.jsx)(ba,{options:i,value:d??i[0],onChange:E})}),(0,Ct.jsx)(xe,{label:\"Preview\",asDiv:!0,children:(0,Ct.jsx)(\"div\",{className:\"sm-crop__preview\",style:{aspectRatio:String(P)},children:(0,Ct.jsx)(\"img\",{src:t.url,alt:\"\",style:{left:`${D.left}%`,top:`${D.top}%`,width:`${D.width}%`,height:`${D.height}%`}})})}),(0,Ct.jsx)(xe,{label:\"Alt text for this use\",hint:\"Empty uses the asset's own alt.\",children:(0,Ct.jsx)(\"input\",{className:\"sm-input\",value:m,placeholder:t.alt??\"\",onChange:j=>y(j.target.value)})}),r!==void 0&&(0,Ct.jsx)(xe,{label:\"Caption\",hint:\"Shown under the image.\",children:(0,Ct.jsx)(\"input\",{className:\"sm-input\",value:b,onChange:j=>x(j.target.value)})})]})]})})}var sw=T(O(),1);function aw({asset:t,value:e,aspect:n,height:r}){if(!t.width||!t.height)return null;let o={url:t.url,width:t.width,height:t.height,mime:t.mime,alt:\"\",crop:e.crop,hotspot:e.hotspot,aspect:e.aspect??n},s=M$(o),a=rw(o,s);return(0,sw.jsx)(\"div\",{className:\"sm-media__canvas\",style:{maxHeight:r},children:(0,sw.jsx)(\"div\",{className:\"sm-media__thumb\",style:{aspectRatio:String(s),width:`calc(${r}px * ${s})`,maxHeight:r},children:(0,sw.jsx)(\"img\",{src:t.url,alt:\"\",style:{left:`${a.left}%`,top:`${a.top}%`,width:`${a.width}%`,height:`${a.height}%`}})})})}var Jn=T(O(),1);function N$({node:t,editor:e,getPos:n,updateAttributes:r,deleteNode:o,selected:s}){let a=Is(),i=ef(),l=t.attrs.image??{},u=typeof t.attrs.caption==\"string\"?t.attrs.caption:\"\",c=typeof l.asset==\"string\"?l.asset:null,[d,f]=(0,Cf.useState)(null),[p,h]=(0,Cf.useState)(!1),[g,m]=(0,Cf.useState)(!1);(0,Cf.useEffect)(()=>{if(!c){f(null);return}let v=!0;return a.get(c).then(S=>{v&&f(S)}),()=>{v=!1}},[c,a]);let y=()=>{let v=n();typeof v==\"number\"&&e.commands.setNodeSelection(v)},b=v=>{a.remember(v),h(!1),r({image:l.alt?{asset:v.id,alt:l.alt}:{asset:v.id}})},x=d!==null&&d.kind===\"image\"&&!!d.width&&!!d.height;return(0,Jn.jsxs)(Mx,{className:Bx(s,i.canvas),\"data-theme\":i.canvas?\"light\":void 0,\"data-drag-handle\":!0,children:[(0,Jn.jsxs)(\"div\",{className:\"sm-rtcard__head\",onClick:y,children:[(0,Jn.jsx)(\"span\",{className:\"sm-rtcard__icon\",\"aria-hidden\":\"true\",children:\"\\u25A3\"}),(0,Jn.jsx)(\"span\",{className:\"sm-rtcard__title\",children:\"Image\"}),(0,Jn.jsxs)(\"span\",{className:\"sm-field__actions\",children:[x&&(0,Jn.jsx)(\"button\",{type:\"button\",className:\"sm-field__action\",onClick:()=>m(!0),children:\"Edit\"}),(0,Jn.jsx)(\"button\",{type:\"button\",className:\"sm-field__action\",onClick:()=>h(!0),children:\"Replace\"}),(0,Jn.jsx)(\"button\",{type:\"button\",className:\"sm-field__action\",onClick:()=>o(),children:\"Remove\"})]})]}),(0,Jn.jsxs)(\"div\",{className:\"sm-rtcard__body\",contentEditable:!1,children:[d&&c?(0,Jn.jsx)(aw,{asset:d,value:{...l,asset:c},height:160}):(0,Jn.jsx)(\"div\",{className:\"sm-rtcard__thumb\",style:{height:80}}),u!==\"\"&&(0,Jn.jsx)(\"span\",{className:\"sm-rtcard__caption\",children:u})]}),p&&(0,Jn.jsx)(Gi,{kinds:[\"image\"],onPick:b,onClose:()=>h(!1)}),g&&d&&c&&(0,Jn.jsx)(ow,{asset:d,descriptor:{type:\"image\"},value:{...l,asset:c},caption:u,onSave:(v,S)=>{r({image:v,caption:S??\"\"}),m(!1)},onClose:()=>m(!1)})]})}var F$=T(te(),1);var Lf=T(te(),1),z$=T(O(),1),P$=(0,Lf.createContext)([]);function B$({elements:t,children:e}){let n=JSON.stringify(t),r=(0,Lf.useMemo)(()=>t,[n]);return(0,z$.jsx)(P$.Provider,{value:r,children:e})}function iw(){return(0,Lf.useContext)(P$)}var Nn=T(O(),1);function zne(t){return Object.values(t).every(e=>e==null||e===\"\")}function H$({node:t,editor:e,getPos:n,updateAttributes:r,deleteNode:o,selected:s}){let a=iw(),i=ef(),l=String(t.attrs.name??\"\"),u=a.find(w=>w.name===l),c=t.attrs.fields&&typeof t.attrs.fields==\"object\"?t.attrs.fields:{},d=t.attrs.settings&&typeof t.attrs.settings==\"object\"?t.attrs.settings:{},[f,p]=(0,F$.useState)(()=>zne(c)),h=i.elements?.filter(w=>a.find(k=>k.name===w)?.contexts.includes(\"richtext\")),g=GB(l,!!u,h),m=n(),y=typeof m==\"number\"?GH(e.state.doc,m):0,b=`${i.path}.elements.${y}`,x=()=>{typeof m==\"number\"&&e.commands.setNodeSelection(m)},v={fields:c,settings:d},S=Object.entries(u?.fields??{}).filter(([,w])=>!Wr(w,{self:c,...v})),E=Object.entries(u?.settings??{}).filter(([,w])=>!Wr(w,{self:d,...v}));return(0,Nn.jsxs)(Mx,{className:Ie(Bx(s,i.canvas),g.unknown&&\"sm-rtcard--broken\"),\"data-theme\":i.canvas?\"light\":void 0,children:[(0,Nn.jsxs)(\"div\",{className:\"sm-rtcard__head\",\"data-drag-handle\":!0,onClick:x,children:[(0,Nn.jsx)(\"span\",{className:\"sm-rtcard__icon\",\"aria-hidden\":\"true\",children:u?.icon??\"\\u25A4\"}),(0,Nn.jsx)(\"span\",{className:\"sm-rtcard__title\",children:u?.title??`Unknown element \"${l}\"`}),g.outside&&(0,Nn.jsx)(\"span\",{className:\"sm-hint\",children:\"Not in this field's toolset\"}),(0,Nn.jsx)(nt,{label:f?\"Collapse\":\"Expand\",onClick:w=>{w.stopPropagation(),p(k=>!k)},children:f?\"\\u25BE\":\"\\u25B8\"}),(0,Nn.jsx)(nt,{label:\"Delete element\",onClick:w=>{w.stopPropagation(),o()},children:\"\\xD7\"})]}),f&&!u&&(0,Nn.jsx)(\"div\",{className:\"sm-rtcard__body\",contentEditable:!1,children:Object.entries(c).map(([w,k])=>(0,Nn.jsxs)(\"div\",{className:\"sm-orphans__row\",children:[(0,Nn.jsx)(\"code\",{children:w}),(0,Nn.jsx)(\"span\",{className:\"sm-orphans__value\",children:typeof k==\"string\"?k:JSON.stringify(k)})]},w))}),f&&u&&(0,Nn.jsxs)(\"div\",{className:\"sm-rtcard__body\",contentEditable:!1,children:[S.map(([w,k])=>(0,Nn.jsx)(Pn,{fieldKey:w,descriptor:k,value:c[w],errors:i.errors,path:`${b}.${w}`,scope:v,onChange:A=>r({fields:{...c,[w]:A}})},w)),E.length>0&&(0,Nn.jsx)(Zt,{caps:!0,children:\"Settings\"}),E.map(([w,k])=>(0,Nn.jsx)(Pn,{fieldKey:w,descriptor:k,value:d[w],errors:i.errors,path:`${b}.settings.${w}`,scope:v,onChange:A=>r({settings:{...d,[w]:A}})},`setting-${w}`))]})]})}k$({image:N$,element:H$});var $$={type:\"doc\",content:[{type:\"paragraph\"}]},Fne=[1,2,3,4,5,6],U$=t=>!!t&&typeof t==\"object\"&&t.type===\"doc\";function lw({value:t,toolset:e,onChange:n,contentClass:r,onEscape:o}){let s=JSON.stringify(e??null),a=(0,ln.useMemo)(()=>Ii(e),[s]),i=iw(),l=Is(),u=(0,ln.useMemo)(()=>W0(a,i),[a,i]),c=(0,ln.useRef)(n);c.current=n;let d=(0,ln.useRef)(o);d.current=o;let f=(0,ln.useRef)(t),[p,h]=(0,ln.useState)({open:!1,href:\"\"}),g=(0,ln.useRef)(()=>{}),[m,y]=(0,ln.useState)({open:!1,query:\"\",active:0}),[b,x]=(0,ln.useState)(null),[v,S]=(0,ln.useState)(0),E=(0,ln.useRef)({state:null,active:0,dismissed:!1}),[w,k]=(0,ln.useState)(!1),A=(0,ln.useRef)(()=>{}),L=(0,ln.useRef)(null),_=HB({immediatelyRender:!1,extensions:E$(a,{onLink:()=>g.current(),slash:{elements:i,onState:I=>{let U=E.current;if(I===null){U.dismissed=!1,U.state=null,x(null);return}U.state===null&&(U.dismissed=!1,U.active=0),U.state=I,U.active=Math.min(U.active,Math.max(0,I.items.length-1)),S(U.active),x(U.dismissed?null:I)},onKeyDown:I=>{let U=E.current;if(!U.state||U.dismissed)return!1;let me=Math.max(1,U.state.items.length);if(I.key===\"Escape\")return U.dismissed=!0,x(null),!0;if(I.key===\"ArrowDown\")return U.active=(U.active+1)%me,S(U.active),!0;if(I.key===\"ArrowUp\")return U.active=(U.active-1+me)%me,S(U.active),!0;if(I.key===\"Enter\"){let Oe=U.state.items[U.active];return Oe&&U.state.pick(Oe),!0}return!1},onPick:I=>A.current(I)}}),content:U$(t)?t:$$,editorProps:{attributes:{class:r},transformPasted:(I,U)=>G.fromJSON(U.state.schema,I$(I.toJSON(),a)),handleKeyDown:(I,U)=>{if(U.key!==\"Escape\"||!d.current)return!1;let me=E.current;return me.state&&!me.dismissed?!1:(d.current(),!0)}},onUpdate:({editor:I})=>{let U=wD(I.getJSON());f.current=U,c.current(U)}},[a,i]);(0,ln.useEffect)(()=>{if(!_||t===f.current)return;f.current=t;let I=U$(t)?t:$$;queueMicrotask(()=>{_.isDestroyed||_.commands.setContent(I,{emitUpdate:!1})})},[_,t]);let P=Jm({editor:_,selector:({editor:I})=>I?{bold:I.isActive(\"bold\"),italic:I.isActive(\"italic\"),link:I.isActive(\"link\"),bulletList:I.isActive(\"bulletList\"),orderedList:I.isActive(\"orderedList\"),blockquote:I.isActive(\"blockquote\"),heading:Fne.find(U=>I.isActive(\"heading\",{level:U}))??null}:rA}),D=I=>{if(y({open:!1,query:\"\",active:0}),!_)return;let U=L.current??_.state.selection.to;if(I.kind===\"image\"){L.current=U,k(!0);return}L.current=null,mE(_,VH(I.element),U)};A.current=D;let F=I=>{l.remember(I),k(!1);let U=L.current??void 0;L.current=null,_&&mE(_,KH(I.id),U)},j=()=>{k(!1);let I=L.current??void 0;L.current=null,_?.commands.focus(I)},K=()=>h({open:!0,href:_?.getAttributes(\"link\").href??\"\"});g.current=K;let ve=()=>{h({open:!1,href:\"\"}),_?.commands.focus()},ue=()=>{if(!_)return;let I=p.href.trim(),U=_.chain().focus().extendMarkRange(\"link\");I===\"\"?U.unsetLink().run():U.setLink({href:I}).run(),h({open:!1,href:\"\"})},Ue=()=>{_?.chain().focus().extendMarkRange(\"link\").unsetLink().run(),h({open:!1,href:\"\"})},Re=I=>{if(!_)return;if(I===\"link\"){K();return}if(I===\"insert\"){L.current=m.open?null:_.state.selection.to,y(me=>({open:!me.open,query:\"\",active:0}));return}let U=_.chain().focus();typeof I==\"object\"?U.toggleHeading({level:I.heading}).run():I===\"bold\"?U.toggleBold().run():I===\"italic\"?U.toggleItalic().run():I===\"bulletList\"?U.toggleBulletList().run():I===\"orderedList\"?U.toggleOrderedList().run():I===\"blockquote\"&&U.toggleBlockquote().run()},je=X0(u,m.query),Ke=()=>{y({open:!1,query:\"\",active:0});let I=L.current??void 0;L.current=null,_?.commands.focus(I)},M=I=>{I.currentTarget.contains(I.relatedTarget)||(y({open:!1,query:\"\",active:0}),L.current=null)},V=I=>{let U=Math.max(1,je.length);if(I.key===\"Escape\"&&(I.preventDefault(),I.stopPropagation(),Ke()),I.key===\"ArrowDown\"&&(I.preventDefault(),y(me=>({...me,active:(me.active+1)%U}))),I.key===\"ArrowUp\"&&(I.preventDefault(),y(me=>({...me,active:(me.active-1+U)%U}))),I.key===\"Enter\"){I.preventDefault();let me=je[m.active];me&&D(me)}};return{editor:_,allowed:a,active:P??rA,canInsert:u.length>0,run:Re,link:{open:p.open,href:p.href,setHref:I=>h({open:!0,href:I}),apply:ue,remove:Ue,close:ve},menu:{open:m.open,query:m.query,active:m.active,items:je,setQuery:I=>y({open:!0,query:I,active:0}),onKeyDown:V,pick:D,close:Ke,dismiss:M},slash:b?{state:b,active:v}:null,picker:{open:w,pick:F,close:j}}}var eo=T(O(),1);function uw({value:t,toolset:e,onChange:n,errors:r,path:o=\"\"}){let s=lw({value:t,toolset:e,onChange:n,contentClass:\"sm-richtext__content\"}),a=ef(),i=(0,vE.useMemo)(()=>Ii(e).elements,[e]),l=(0,vE.useMemo)(()=>({errors:r,path:o,canvas:a.canvas,elements:i}),[r,o,a.canvas,i]);return(0,eo.jsx)(Px,{value:l,children:(0,eo.jsxs)(\"div\",{className:\"sm-richtext\",children:[(0,eo.jsxs)(\"div\",{className:\"sm-richtext__head\",children:[(0,eo.jsx)(_x,{allowed:s.allowed,active:s.active,canInsert:s.canInsert,onCommand:s.run}),s.menu.open&&(0,eo.jsx)(Ox,{menu:s.menu})]}),s.link.open&&(0,eo.jsx)(Dx,{link:s.link}),(0,eo.jsxs)(\"div\",{className:\"sm-richtext__body\",children:[(0,eo.jsx)(Xm,{editor:s.editor}),s.slash&&(0,eo.jsx)(\"div\",{className:\"sm-richtext__slash\",style:{top:s.slash.state.rect?s.slash.state.rect.bottom-(Hne(s.editor)??0)+4:0},children:(0,eo.jsx)(Qd,{items:s.slash.state.items,active:s.slash.active,onPick:u=>s.slash?.state.pick(u)})})]}),s.picker.open&&(0,eo.jsx)(Gi,{kinds:[\"image\"],onPick:s.picker.pick,onClose:s.picker.close})]})})}function Hne(t){return t?.view.dom.parentElement?.getBoundingClientRect().top}var ol=T(te(),1);var dt=T(O(),1),j$=300;function Lg({descriptor:t,value:e,onChange:n,asset:r,label:o,mark:s,hint:a,error:i,path:l}){let u=Is(),c=t.type,d=typeof e?.asset==\"string\"?e.asset:null,[f,p]=(0,ol.useState)(r??null),[h,g]=(0,ol.useState)(!1),[m,y]=(0,ol.useState)(null),[b,x]=(0,ol.useState)(!1),[v,S]=(0,ol.useState)(!1);(0,ol.useEffect)(()=>{if(!d){p(null);return}if(r?.id===d){p(r);return}let P=!0;return u.get(d).then(D=>{P&&p(D)}),()=>{P=!1}},[d,u,r]);let E=P=>{u.remember(P),p(P),x(!1),n({asset:P.id})},w=async P=>{let D=P?.[0];if(!D)return;g(!0),y(null);let F=await Tu(u.ops,D,u.upload);if(g(!1),!F.ok){y(F.message);return}E(F.data)},k=nf([c],u.media.accept),A=(P,D=\"secondary\")=>(0,dt.jsxs)(\"label\",{className:`sm-btn sm-btn--${D}`,children:[h?\"Uploading\\u2026\":P,(0,dt.jsx)(\"input\",{type:\"file\",accept:k,hidden:!0,disabled:h,onChange:F=>{w(F.target.files)}})]}),L;if(!d)L=(0,dt.jsxs)(\"div\",{className:\"sm-dropzone\",onDragOver:P=>P.preventDefault(),onDrop:P=>{P.preventDefault(),w(P.dataTransfer.files)},children:[(0,dt.jsx)(\"span\",{children:\"Drop a file here\"}),(0,dt.jsxs)(\"div\",{className:\"sm-media__actions\",children:[A(\"Upload\",\"primary\"),(0,dt.jsx)(Q,{variant:\"secondary\",onClick:()=>x(!0),children:\"Choose from library\"})]})]});else if(!f)L=(0,dt.jsx)(\"div\",{className:\"sm-media__chip\",children:\"Loading\\u2026\"});else if(f.status===\"pending\")L=(0,dt.jsx)(\"div\",{className:\"sm-media__chip\",children:\"Uploading\\u2026\"});else{let P=e,D=f.kind===\"image\"&&f.width&&f.height?(0,dt.jsx)(aw,{asset:f,value:P,aspect:typeof t.aspect==\"string\"?t.aspect:void 0,height:j$}):f.kind===\"video\"?(()=>{let F=f.width&&f.height?f.width/f.height:1.7777777777777777;return(0,dt.jsx)(\"div\",{className:\"sm-media__canvas\",children:(0,dt.jsx)(\"div\",{className:\"sm-media__thumb\",style:{aspectRatio:String(F),width:`calc(${j$}px * ${F})`},children:(0,dt.jsx)(oA,{asset:f,className:\"sm-mediacard__img\"})})})})():(0,dt.jsxs)(\"div\",{className:\"sm-media__chip\",children:[(0,dt.jsx)(\"span\",{style:{fontWeight:500},children:f.filename}),(0,dt.jsx)(\"span\",{className:\"sm-media__alt\",children:tf(f.size)})]});L=(0,dt.jsxs)(\"div\",{className:\"sm-media\",children:[D,f.kind===\"image\"&&(0,dt.jsx)(\"span\",{className:\"sm-media__alt\",children:P.alt??f.alt??\"No alt text\"})]})}let _=d&&f?(0,dt.jsxs)(\"span\",{className:\"sm-field__actions\",children:[f.kind===\"image\"&&f.width&&f.height&&(0,dt.jsx)(\"button\",{type:\"button\",className:\"sm-field__action\",onClick:()=>S(!0),children:\"Edit\"}),(0,dt.jsx)(\"button\",{type:\"button\",className:\"sm-field__action\",onClick:()=>x(!0),children:\"Replace\"}),(0,dt.jsx)(\"button\",{type:\"button\",className:\"sm-field__action\",onClick:()=>n(void 0),children:\"Remove\"})]}):void 0;return(0,dt.jsxs)(xe,{label:o,mark:s,hint:a,error:i,path:l,action:_,asDiv:!0,children:[L,m&&(0,dt.jsx)(\"span\",{className:\"sm-error\",children:m}),b&&(0,dt.jsx)(Gi,{kinds:[c],onPick:E,onClose:()=>x(!1)}),v&&f&&(0,dt.jsx)(ow,{asset:f,descriptor:t,value:e,onSave:P=>{n(P),S(!1)},onClose:()=>S(!1)})]})}var Y$=T(te(),1);function V$(t){if(t.type===\"object\"){let e={};for(let[n,r]of Object.entries(t.fields??{})){let o=V$(r);o!==void 0&&(e[n]=o)}return e}if(t.default!==void 0)return t.default;if((t.type===\"select\"||t.type===\"radio\")&&t.optional!==!0)return su(t.options)[0]?.value}function K$(t,e){return typeof e.max==\"number\"&&t.length>=e.max?t:[...t,e.item?V$(e.item):void 0]}function cw(t,e){return t.filter((n,r)=>r!==e)}function $u(t,e,n){if(n<0||n>=t.length||e===n)return t;let r=[...t],[o]=r.splice(e,1);return r.splice(n,0,o),r}function G$(t,e,n){let r=new Set;for(let o of t)o===e?r.add(n):e<n&&o>e&&o<=n?r.add(o-1):n<e&&o>=n&&o<e?r.add(o+1):r.add(o);return r}function W$(t,e){let n=new Set;for(let r of t)r!==e&&n.add(r>e?r-1:r);return n}var q$=t=>typeof t==\"string\"&&t.trim()!==\"\";function X$(t,e){if(q$(t))return t;if(t&&typeof t==\"object\"&&!Array.isArray(t)){let n=Object.values(t).find(q$);if(n)return n}return`Item ${e+1}`}function J$(t,e,n,r){let o={...t};if(n===void 0?delete o[e]:o[e]=n,!(r&&Object.values(o).every(s=>s===void 0)))return o}var Bn=T(O(),1);function Z$({descriptor:t,items:e,onChange:n,renderItem:r,path:o,head:s}){let[a,i]=(0,Y$.useState)(()=>new Set),l=typeof t.max==\"number\"&&e.length>=t.max,u=(h,g)=>{let m=$u(e,h,g);m!==e&&(n(m),i(y=>G$(y,h,g)))},c=vs({count:e.length,onDrop:u}),d=e.length>0&&e.every((h,g)=>a.has(g)),f=e.length>1&&(0,Bn.jsx)(\"button\",{type:\"button\",className:\"sm-field__action\",onClick:()=>i(d?new Set:new Set(e.map((h,g)=>g))),children:d?\"Expand all\":\"Collapse all\"}),p=(0,Bn.jsxs)(\"div\",{className:\"sm-list\",ref:c.containerRef,children:[e.map((h,g)=>(0,Bn.jsx)($ne,{index:g,count:e.length,summary:X$(h,g),open:!a.has(g),path:o===void 0?void 0:`${o}.${g}`,style:c.rowStyle(g),className:c.rowClass(g),grip:(0,Bn.jsx)(Ei,{...c.handleProps(g)}),onToggle:()=>i(m=>{let y=new Set(m);return y.has(g)?y.delete(g):y.add(g),y}),onMove:m=>u(g,m),onRemove:()=>{n(cw(e,g)),i(m=>W$(m,g))},children:r(h,g)},g)),(0,Bn.jsx)(Q,{variant:\"secondary\",disabled:l,onClick:()=>n(K$(e,t)),children:\"Add\"})]});return s?(0,Bn.jsx)(xe,{label:s.label,mark:s.mark,counter:s.counter,action:f||void 0,error:s.error,asDiv:!0,path:o,children:p}):p}function $ne({index:t,count:e,summary:n,open:r,style:o,className:s,grip:a,path:i,onToggle:l,onMove:u,onRemove:c,children:d}){return(0,Bn.jsxs)(\"div\",{className:s?`sm-listrow ${s}`:\"sm-listrow\",style:o,\"data-sm-path\":i,children:[(0,Bn.jsxs)(\"div\",{className:\"sm-listrow__head\",children:[a,(0,Bn.jsxs)(\"button\",{type:\"button\",className:\"sm-listrow__toggle\",\"aria-expanded\":r,onClick:l,children:[(0,Bn.jsx)(\"span\",{\"aria-hidden\":\"true\",children:r?\"\\u25BE\":\"\\u25B8\"}),(0,Bn.jsx)(\"span\",{className:\"sm-listrow__summary\",children:n})]}),(0,Bn.jsx)(nt,{label:\"Move up\",disabled:t===0,onClick:()=>u(t-1),children:\"\\u2191\"}),(0,Bn.jsx)(nt,{label:\"Move down\",disabled:t===e-1,onClick:()=>u(t+1),children:\"\\u2193\"}),(0,Bn.jsx)(nt,{label:\"Remove\",onClick:c,children:\"\\xD7\"})]}),r&&(0,Bn.jsx)(\"div\",{className:\"sm-listrow__body\",children:d})]})}var vn=T(te(),1),r3=T(Tl(),1);var xE=t=>t.trim().toLocaleLowerCase();function Q$(t,e){let n=xE(e);return n===\"\"?t:t.filter(r=>r.label.toLocaleLowerCase().includes(n))}function e3(t,e){let n=xE(e);return n!==\"\"&&!t.some(r=>xE(r.label)===n)}function t3(t,e,n){return e===0?-1:t<0?n===1?0:e-1:(t+n+e)%e}var Ag=t=>t.height>t.below&&t.above>t.below;function n3(t,e,n){let r={left:t.left,width:t.width};return Ag({below:e-t.bottom-4,above:t.top-4,height:n})?{...r,bottom:e-t.top+4}:{...r,top:t.bottom+4}}var Ps=T(O(),1),wE=t=>t.preventDefault();function o3(t){let e=0,n=window.innerHeight;for(let r=t.parentElement;r;r=r.parentElement)if(/(auto|scroll|hidden|clip)/.test(getComputedStyle(r).overflowY)){let o=r.getBoundingClientRect();e=Math.max(e,o.top),n=Math.min(n,o.bottom);break}return{top:e,bottom:n}}function Af({options:t,onPick:e,label:n,placeholder:r,disabled:o,keepOpen:s,emptyText:a,renderOption:i,onSubmit:l,createRow:u,onQueryChange:c,onInputKey:d,onClose:f,autoFocus:p,initialOpen:h=!1,className:g,selected:m,suffix:y,listClassName:b}){let x=l?-1:0,[v,S]=(0,vn.useState)(null),E=v??\"\",[w,k]=(0,vn.useState)(h),[A,L]=(0,vn.useState)(x),_=(0,vn.useRef)(null),P=(0,vn.useRef)(null),[D,F]=(0,vn.useState)(null),[j,K]=(0,vn.useState)(null),ve=(0,vn.useId)();(0,vn.useLayoutEffect)(()=>{let X=_.current;X&&F(X.closest(\".sm-admin\")??X.ownerDocument.body)},[]);let ue=Q$(t,E),Ue=l!==void 0&&u===!0&&e3(t,E),Re=ue.length+(Ue?1:0),je=w&&!o&&(Re>0||!l),Ke=(0,vn.useCallback)(()=>{let X=_.current;if(!X||!P.current)return;let dn=X.getBoundingClientRect();K(n3(dn,X.ownerDocument.defaultView?.innerHeight??0,P.current.offsetHeight))},[]);(0,vn.useLayoutEffect)(()=>{je&&D?Ke():K(null)},[je,D,Re,Ke]),(0,vn.useEffect)(()=>{let X=_.current?.ownerDocument.defaultView;if(!je||!X)return;let dn=er=>{er.target!==P.current&&Ke()};return X.addEventListener(\"scroll\",dn,!0),X.addEventListener(\"resize\",Ke),()=>{X.removeEventListener(\"scroll\",dn,!0),X.removeEventListener(\"resize\",Ke)}},[je,Ke]);let M=()=>{S(null),L(x)},V=X=>{k(!1),f?.(E,X),M()},I=X=>{X<ue.length?e(ue[X].value):l?.(E),M(),s||k(!1)},U=X=>{d?.(X,E)||(X.key===\"ArrowDown\"||X.key===\"ArrowUp\"?(X.preventDefault(),k(!0),L(dn=>t3(dn,Re,X.key===\"ArrowDown\"?1:-1))):X.key===\"Enter\"?(X.preventDefault(),w&&A>=0&&A<Re?I(A):l&&E.trim()!==\"\"&&(l(E),M())):X.key===\"Escape\"&&(w&&X.stopPropagation(),V(\"escape\")))},me=D?{left:j?.left,top:j?.top,bottom:j?.bottom,\"--combo-w\":j?`${j.width}px`:void 0,visibility:j?void 0:\"hidden\"}:void 0,Oe=je&&(0,Ps.jsxs)(\"div\",{ref:P,id:`${ve}-list`,role:\"listbox\",\"aria-label\":n,onMouseDown:wE,className:Ie(\"sm-picker sm-combo__list\",D&&\"sm-combo__list--floating\",b),style:me,children:[Re===0&&(0,Ps.jsx)(\"div\",{className:\"sm-combo__empty\",children:t.length===0?a??\"No matches\":\"No matches\"}),ue.map((X,dn)=>(0,Ps.jsx)(\"button\",{id:`${ve}-opt-${dn}`,type:\"button\",role:\"option\",\"aria-selected\":dn===A,className:Ie(\"sm-picker__item\",dn===A&&\"sm-picker__item--active\"),onMouseDown:wE,onClick:()=>I(dn),children:i?i(X):X.label},X.value)),Ue&&(0,Ps.jsxs)(\"button\",{id:`${ve}-opt-${ue.length}`,type:\"button\",role:\"option\",\"aria-selected\":A===ue.length,className:Ie(\"sm-picker__item\",A===ue.length&&\"sm-picker__item--active\"),onMouseDown:wE,onClick:()=>I(ue.length),children:[\"Create \\u201C\",E.trim(),\"\\u201D\"]})]});return(0,Ps.jsxs)(\"div\",{ref:_,className:Ie(\"sm-combo\",y!=null&&\"sm-combo--suffix\",g),children:[(0,Ps.jsx)(\"input\",{className:\"sm-input\",role:\"combobox\",\"aria-label\":n,\"aria-autocomplete\":\"list\",\"aria-expanded\":je,\"aria-controls\":`${ve}-list`,\"aria-activedescendant\":je&&A>=0?`${ve}-opt-${A}`:void 0,placeholder:r,disabled:o,autoFocus:p,value:v??m??\"\",onFocus:X=>{k(!0),v===null&&m&&X.currentTarget.select()},onClick:()=>k(!0),onChange:X=>{S(c?c(X.target.value):X.target.value),L(x),k(!0)},onKeyDown:U,onBlur:X=>{w&&!_.current?.contains(X.relatedTarget)&&V(\"blur\")}}),y!=null&&(0,Ps.jsx)(\"span\",{className:\"sm-combo__suffix\",children:y}),(0,Ps.jsx)(kh,{className:\"sm-combo__chevron\",size:14,strokeWidth:1.75,\"aria-hidden\":\"true\"}),Oe&&D?(0,r3.createPortal)(Oe,D):Oe]})}var s3=(t,e)=>e?Array.isArray(t)?t.filter(n=>typeof n==\"string\"):[]:typeof t==\"string\"&&t!==\"\"?[t]:[],a3=(t,e)=>e?t:t[0];function i3(t,e,n,r){return n?t.includes(e)||typeof r==\"number\"&&t.length>=r?t:[...t,e]:[e]}var l3=(t,e)=>(e??[]).filter(n=>!n.absent&&!t.includes(n.id));function u3(t,e){if(e===void 0)return t.map(r=>({id:r,title:\"\\u2026\",status:\"\",state:\"loading\"}));let n=new Map(e.map(r=>[r.id,r]));return t.map(r=>{let o=n.get(r);return o?{id:r,title:o.title,status:o.status,state:o.absent?\"absent\":\"ok\"}:{id:r,title:\"Missing entry\",status:\"\",state:\"missing\"}})}var c3=t=>t===\"published\"?\"published\":t===\"draft edits\"?\"changes\":\"draft\";var Mt=T(O(),1),d3=\"Not available in this locale\",f3=t=>t.replace(/^./,e=>e.toUpperCase());function SE({status:t}){return t===\"\"?null:(0,Mt.jsx)(\"span\",{className:\"sm-dot\",title:bs(t),style:{background:`var(--status-${c3(t)}-fg)`}})}function p3({value:t,onChange:e,options:n,multiple:r,max:o,target:s}){let a=Qe(),i=s3(t,r),l=u3(i,n),u=l3(i,n),c=new Map(u.map(y=>[y.id,y])),d=r&&typeof o==\"number\"&&i.length>=o,f=y=>e(a3(y,r)),p=vs({count:r?l.length:0,onDrop:(y,b)=>f($u(i,y,b))}),h=(n??[]).filter(y=>!y.absent).length,g=y=>(y.state===\"ok\"||y.state===\"absent\")&&(0,Mt.jsx)(\"a\",{className:\"sm-iconbtn\",href:a(`/${s}/${y.id}`),target:\"_blank\",rel:\"noreferrer\",\"aria-label\":\"Open entry\",title:\"Open entry\",children:(0,Mt.jsx)(Ah,{size:13,strokeWidth:1.75,\"aria-hidden\":\"true\"})}),m=r?void 0:l[0];return(0,Mt.jsxs)(\"div\",{className:\"sm-refpicker\",children:[(0,Mt.jsx)(Af,{label:`Search ${f3(s)}`,keepOpen:r,options:u.map(y=>({value:y.id,label:y.title})),disabled:n===void 0||d,placeholder:d?`Maximum ${o}`:n===void 0?\"Loading\\u2026\":\"Type to search\",emptyText:h===0?`No entries in ${f3(s)} yet`:\"Every entry is already picked\",renderOption:y=>(0,Mt.jsxs)(Mt.Fragment,{children:[(0,Mt.jsx)(\"span\",{className:\"sm-refpicker__title\",children:y.label}),(0,Mt.jsx)(SE,{status:c.get(y.value)?.status??\"\"})]}),selected:m&&`${m.title}${m.state===\"absent\"?` \\xB7 ${d3}`:\"\"}`,suffix:m&&(0,Mt.jsxs)(Mt.Fragment,{children:[(0,Mt.jsx)(SE,{status:m.status}),g(m),(0,Mt.jsx)(nt,{label:\"Remove\",onClick:()=>f([]),children:\"\\xD7\"})]}),onPick:y=>f(i3(i,y,r,o))}),r&&l.length>0&&(0,Mt.jsx)(\"div\",{className:\"sm-refpicker__rows\",ref:p.containerRef,children:l.map((y,b)=>(0,Mt.jsxs)(\"div\",{style:r?p.rowStyle(b):void 0,className:Ie(\"sm-refrow\",y.state!==\"ok\"&&\"sm-refrow--muted\",r&&p.rowClass(b)),children:[r&&(0,Mt.jsx)(Ei,{...p.handleProps(b)}),(0,Mt.jsxs)(\"span\",{className:\"sm-refpicker__title\",children:[y.title,y.state===\"absent\"&&(0,Mt.jsxs)(\"span\",{className:\"sm-refrow__note\",children:[\" \\xB7 \",d3]})]}),(0,Mt.jsx)(SE,{status:y.status}),g(y),(0,Mt.jsx)(nt,{label:\"Remove\",onClick:()=>f(i.filter((x,v)=>v!==b)),children:\"\\xD7\"})]},`${y.id}-${b}`))})]})}var ju=T(te(),1);var Uu=T(O(),1);function h3({value:t,onChange:e,max:n,suggestions:r,label:o,initialAdding:s=!1}){let a=Array.isArray(t)?t.filter(h=>typeof h==\"string\"):[],[i,l]=(0,ju.useState)(s),[u,c]=(0,ju.useState)(null),d=(0,ju.useRef)(null);(0,ju.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]);let f=typeof n==\"number\"&&a.length>=n,p=h=>{let g=xD(a,h,{max:n,known:r});g.tags.length!==a.length&&e(g.tags),g.duplicate!==null&&(c(g.duplicate),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>c(null),600))};return(0,Uu.jsxs)(\"div\",{className:\"sm-tags\",children:[a.map((h,g)=>(0,Uu.jsxs)(\"span\",{className:Ie(\"sm-tag\",u===h&&\"sm-tag--flash\"),children:[h,(0,Uu.jsx)(\"button\",{type:\"button\",className:\"sm-tag__x\",\"aria-label\":`Remove ${h}`,onClick:()=>e(a.filter((m,y)=>y!==g)),children:\"\\xD7\"})]},h)),i&&!f&&(0,Uu.jsx)(Af,{className:\"sm-combo--tag\",listClassName:\"sm-combo__list--tag\",label:`Add to ${o}`,placeholder:\"Add a tag\",autoFocus:!0,keepOpen:!0,initialOpen:!0,options:(r??[]).filter(h=>!a.some(g=>Ed(g,h))).map(h=>({value:h,label:h})),onPick:p,onSubmit:p,createRow:r!==void 0,onQueryChange:h=>h.includes(\",\")?(p(h),\"\"):h,onInputKey:(h,g)=>h.key!==\"Backspace\"||g!==\"\"||a.length===0?!1:(e(a.slice(0,-1)),!0),onClose:(h,g)=>{g===\"blur\"&&h.trim()!==\"\"&&p(h),l(!1)}}),!i&&!f&&(0,Uu.jsx)(\"button\",{type:\"button\",className:\"sm-tag sm-tag--add\",onClick:()=>l(!0),children:\"+ Add\"})]})}var m3=T(te(),1);var Eg=T(O(),1);function g3({spans:t,onChange:e}){let n=(0,m3.useRef)(null),r=s=>a=>{let i=n.current;if(!i)return;a.preventDefault(),a.currentTarget.setPointerCapture(a.pointerId);let l=i.getBoundingClientRect(),u=t,c=f=>{let p=bL(u,s,LD(f.clientX-l.left,l.width,u,s));p[s]!==u[s]&&(u=p,e(p))},d=()=>{window.removeEventListener(\"pointermove\",c),window.removeEventListener(\"pointerup\",d)};window.addEventListener(\"pointermove\",c),window.addEventListener(\"pointerup\",d)},o=s=>a=>{let i=a.key===\"ArrowLeft\"?-1:a.key===\"ArrowRight\"?1:0;i!==0&&(a.preventDefault(),e(bL(t,s,t[s]+i)))};return(0,Eg.jsx)(\"div\",{className:\"sm-spanbar\",ref:n,children:t.map((s,a)=>(0,Eg.jsxs)(\"div\",{className:\"sm-spanbar__col\",style:{flex:s},children:[s,a<t.length-1&&(0,Eg.jsx)(\"button\",{type:\"button\",className:\"sm-spanbar__handle\",role:\"slider\",\"aria-label\":`Resize columns ${a+1} and ${a+2}`,\"aria-valuemin\":1,\"aria-valuemax\":s+t[a+1]-1,\"aria-valuenow\":s,onPointerDown:r(a),onKeyDown:o(a)})]},`c${a}`))})}var ot=T(O(),1),Une=t=>typeof t==\"object\"&&t!==null&&Array.isArray(t.columns)&&Array.isArray(t.spans);function y3({descriptor:t,value:e,onChange:n,errors:r,path:o,inlinePath:s,onEditHere:a}){let i=Array.isArray(e)?e.filter(Une):[],l=t.item?.fields??{},u=l.columns?.item??{type:\"richtext\"},c=(d,f)=>n(i.map((p,h)=>h===d?f:p));return(0,ot.jsxs)(\"div\",{className:\"sm-rowcards\",children:[i.map((d,f)=>{let p=d.columns.length,h=`${o}.${f}`,g=AD(p);return(0,ot.jsxs)(\"div\",{className:\"sm-rowcard\",\"data-sm-path\":h,children:[(0,ot.jsxs)(\"div\",{className:\"sm-rowcard__head\",children:[(0,ot.jsxs)(\"span\",{className:\"sm-rowcard__title\",children:[\"Row \",f+1]}),(0,ot.jsx)(nt,{label:\"Move up\",disabled:f===0,onClick:()=>n($u(i,f,f-1)),children:\"\\u2191\"}),(0,ot.jsx)(nt,{label:\"Move down\",disabled:f===i.length-1,onClick:()=>n($u(i,f,f+1)),children:\"\\u2193\"}),(0,ot.jsx)(nt,{label:\"Remove row\",disabled:i.length===1,onClick:()=>n(cw(i,f)),children:\"\\xD7\"})]}),(0,ot.jsx)(xe,{label:\"Columns\",asDiv:!0,error:r?.[`${h}.columns`]??r?.[`${h}.spans`],children:(0,ot.jsxs)(\"div\",{className:\"sm-stepper\",children:[(0,ot.jsx)(nt,{label:\"Fewer columns\",disabled:p<=1,onClick:()=>c(f,yL(d,p-1)),children:\"\\u2212\"}),(0,ot.jsx)(\"span\",{className:\"sm-stepper__value\",children:p}),(0,ot.jsx)(nt,{label:\"More columns\",disabled:p>=rm,onClick:()=>c(f,yL(d,p+1)),children:\"+\"})]})}),p>1&&(0,ot.jsxs)(ot.Fragment,{children:[(0,ot.jsxs)(xe,{label:\"Widths\",asDiv:!0,path:`${h}.spans`,children:[(0,ot.jsx)(g3,{spans:d.spans,onChange:m=>c(f,{...d,spans:m})}),g.length>0&&(0,ot.jsx)(\"div\",{className:\"sm-rowcard__presets\",children:g.map(m=>(0,ot.jsx)(Q,{variant:\"secondary\",onClick:()=>c(f,{...d,spans:m.spans}),children:m.label},m.label))})]}),(0,ot.jsx)(Pn,{fieldKey:\"gap\",descriptor:l.gap,value:d.gap,path:`${h}.gap`,onChange:m=>c(f,{...d,gap:m})}),(0,ot.jsx)(Pn,{fieldKey:\"verticalAlign\",descriptor:l.align,value:d.align,path:`${h}.align`,onChange:m=>c(f,{...d,align:m})}),(0,ot.jsx)(xe,{label:\"Reverse on mobile\",asDiv:!0,path:`${h}.reverse`,children:(0,ot.jsx)(dd,{checked:d.reverse===!0,onChange:m=>c(f,{...d,reverse:m}),label:\"Reverse on mobile\"})})]}),d.columns.map((m,y)=>{let b=`${h}.columns.${y}`;return(0,ot.jsx)(xe,{label:`Column ${y+1}`,asDiv:!0,path:b,error:r?.[b],children:s===b?(0,ot.jsx)(kE,{onEditHere:a}):(0,ot.jsx)(uw,{value:m,toolset:u.toolset,errors:r,path:b,onChange:x=>c(f,{...d,columns:d.columns.map((v,S)=>S===y?x:v)})})},y)})]},f)}),(0,ot.jsx)(Q,{variant:\"secondary\",onClick:()=>n([...i,CD()]),children:\"+ Add row\"})]})}var to=T(te(),1);function b3(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||\"UTC\"}catch{return\"UTC\"}}var dw=T(te(),1),S3=T(O(),1),v3=(0,dw.createContext)(void 0);function x3({zone:t,children:e}){return(0,S3.jsx)(v3.Provider,{value:t,children:e})}function w3(){return(0,dw.useContext)(v3)}var st=T(O(),1),jne=9,k3=t=>t.preventDefault(),C3=t=>String(t).padStart(2,\"0\");function L3({kind:t,value:e,onChange:n,label:r,initialOpen:o=!1}){let s=w3(),a=s??b3(),i=typeof e==\"string\"?e:\"\",l=t===\"datetime\"?PD(i,a):null,u=t===\"date\"?am(i):l?.day??null,c=t===\"date\"?i:l?im(l.day):\"\",d=l?.hour??jne,f=l?.minute??0,[p,h]=(0,to.useState)(null),[g,m]=(0,to.useState)(o),[y,b]=(0,to.useState)(()=>{let I=u??lm(a);return{y:I.y,m:I.m}}),[x,v]=(0,to.useState)(null),[S,E]=(0,to.useState)(!1),w=(0,to.useRef)(null),k=(0,to.useRef)(null),A=(0,to.useRef)(null),[L,_]=(0,to.useState)(0);(0,to.useLayoutEffect)(()=>{if(!g||!w.current||!k.current)return;let I=w.current.getBoundingClientRect(),U=o3(w.current);E(Ag({below:U.bottom-I.bottom-4,above:I.top-U.top-4,height:k.current.offsetHeight}));let me=A.current?.getBoundingClientRect();me&&_(Math.max(0,Math.round(me.right-I.left-k.current.offsetWidth)))},[g,y]);let P=I=>{if(I===null){n(void 0);return}n(t===\"date\"?im(I):xL(I,d,f,a))},D=I=>b({y:I.y,m:I.m}),F=I=>{let U=I??lm(a);D(U),v(U),m(!0)},j=()=>{m(!1),v(null)},K=I=>{P(I),h(null),j()},ve=I=>{v(I),D(I)},ue=I=>b(U=>{let me=sm({...U,d:1},\"month\",I);return{y:me.y,m:me.m}}),Ue=I=>{if(t===\"date\"){n(I===\"\"?void 0:I);return}if(I===\"\"){h(null),n(void 0);return}let U=am(I);U?(h(null),P(U)):h(I)},Re=I=>{if(!g){I.key===\"ArrowDown\"&&(I.preventDefault(),F(u));return}let U=x??u??lm(a),me={ArrowLeft:[\"day\",-1],ArrowRight:[\"day\",1],ArrowUp:[\"week\",-1],ArrowDown:[\"week\",1],PageUp:[\"month\",-1],PageDown:[\"month\",1]};if(I.key in me){I.preventDefault();let[Oe,X]=me[I.key];ve(sm(U,Oe,X));return}if(I.key===\"Enter\"){I.preventDefault(),K(U);return}I.key===\"Escape\"&&(I.preventDefault(),j())},je=I=>{w.current&&I.relatedTarget instanceof Node&&w.current.contains(I.relatedTarget)||(h(null),j())},Ke=(I,U)=>{u&&n(xL(u,I,U,a))},M=lm(a),V=t===\"datetime\"?s?`${a} time \\xB7 stored as UTC`:`Your browser's time (${a}) \\xB7 stored as UTC \\u2014 set timeZone in smoodly.config`:null;return(0,st.jsxs)(\"div\",{ref:w,className:Ie(\"sm-date\",t===\"datetime\"&&\"sm-date--time\"),onBlur:je,children:[(0,st.jsxs)(\"div\",{className:\"sm-date__row\",children:[(0,st.jsxs)(\"span\",{className:\"sm-inputwrap sm-date__wrap\",children:[(0,st.jsx)(\"input\",{className:\"sm-input\",\"aria-label\":r??\"Date\",placeholder:\"YYYY-MM-DD\",value:p??c,onChange:I=>Ue(I.target.value),onKeyDown:Re}),(0,st.jsx)(\"button\",{ref:A,type:\"button\",className:\"sm-date__btn\",\"aria-label\":\"Open calendar\",\"aria-expanded\":g,onMouseDown:k3,onClick:()=>g?j():F(u),children:(0,st.jsx)(Sh,{size:16,strokeWidth:1.75,\"aria-hidden\":\"true\"})})]}),t===\"datetime\"&&(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)(\"select\",{className:\"sm-select sm-date__time\",\"aria-label\":\"Hour\",value:d,disabled:!u,onChange:I=>Ke(Number(I.target.value),f),children:BD.map(I=>(0,st.jsx)(\"option\",{value:I,children:C3(I)},I))}),(0,st.jsx)(\"span\",{className:\"sm-date__colon\",\"aria-hidden\":\"true\",children:\":\"}),(0,st.jsx)(\"select\",{className:\"sm-select sm-date__time\",\"aria-label\":\"Minute\",value:f,disabled:!u,onChange:I=>Ke(d,Number(I.target.value)),children:zD(l?l.minute:null).map(I=>(0,st.jsx)(\"option\",{value:I,children:C3(I)},I))})]})]}),V&&(0,st.jsx)(\"span\",{className:\"sm-hint\",children:V}),g&&(0,st.jsxs)(\"div\",{ref:k,className:Ie(\"sm-cal\",S&&\"sm-cal--up\"),style:{left:L},role:\"dialog\",\"aria-label\":\"Calendar\",onMouseDown:k3,children:[(0,st.jsxs)(\"div\",{className:\"sm-cal__head\",children:[(0,st.jsx)(\"button\",{type:\"button\",className:\"sm-cal__nav\",\"aria-label\":\"Previous month\",onClick:()=>ue(-1),children:(0,st.jsx)(Ch,{size:14,strokeWidth:1.75,\"aria-hidden\":\"true\"})}),(0,st.jsx)(\"span\",{className:\"sm-cal__month\",children:_D(y.y,y.m)}),(0,st.jsx)(\"button\",{type:\"button\",className:\"sm-cal__nav\",\"aria-label\":\"Next month\",onClick:()=>ue(1),children:(0,st.jsx)(Lh,{size:14,strokeWidth:1.75,\"aria-hidden\":\"true\"})})]}),(0,st.jsxs)(\"div\",{className:\"sm-cal__grid\",role:\"grid\",children:[OD().map(I=>(0,st.jsx)(\"span\",{className:\"sm-cal__wd\",role:\"columnheader\",children:I},I)),MD(y.y,y.m).flat().map(I=>(0,st.jsx)(\"button\",{type:\"button\",role:\"gridcell\",className:Ie(\"sm-cal__day\",I.m!==y.m&&\"sm-cal__day--out\",mv(I,M)&&\"sm-cal__day--today\",x!==null&&mv(I,x)&&\"sm-cal__day--focus\"),\"aria-pressed\":u!==null&&mv(I,u),tabIndex:-1,onClick:()=>K(I),children:I.d},im(I)))]}),(0,st.jsx)(\"div\",{className:\"sm-cal__foot\",children:(0,st.jsx)(\"button\",{type:\"button\",className:\"sm-field__action\",onClick:()=>K(M),children:\"Today\"})})]})]})}var A3=t=>t===\"css\"?\"Custom CSS\":t.replace(/([A-Z])/g,e=>` ${e.toLowerCase()}`).replace(/^./,e=>e.toUpperCase());var Te=T(O(),1),qu=A3;function Pn({descriptor:t,value:e,onChange:n,errors:r,path:o,bare:s,refOptions:a,suggestions:i,fieldKey:l,prefix:u,mark:c,inlinePath:d,onEditHere:f,scope:p,emptyLabel:h,hint:g,onBlur:m}){let y=o??l,b=t.type===\"tags\"&&r?Object.keys(r).find(k=>k.startsWith(`${y}.`)):void 0,x=r?.[y]??(b?r?.[b]:void 0),v=e===void 0&&t.default!==void 0?t.default:e;if(t.widget===\"rows\"){let k=(0,Te.jsx)(y3,{descriptor:t,value:v,onChange:n,errors:r,path:y,inlinePath:d,onEditHere:f});return s?k:(0,Te.jsx)(xe,{label:qu(l),error:x,asDiv:!0,path:y,children:k})}let S,E,w=!1;switch(t.type){case\"text\":case\"link\":case\"slug\":{let k=(0,Te.jsx)(\"input\",{className:t.type===\"slug\"?\"sm-input sm-input--mono\":\"sm-input\",value:String(v??\"\"),onChange:A=>n(A.target.value),onBlur:t.type===\"slug\"?A=>{let L=xa(A.target.value);L!==A.target.value&&n(L),m?.()}:void 0});S=t.type===\"slug\"&&u?(0,Te.jsxs)(\"span\",{className:\"sm-inputwrap\",children:[(0,Te.jsx)(\"span\",{className:\"sm-prefix\",children:u}),k]}):k;break}case\"date\":case\"datetime\":w=!0,S=(0,Te.jsx)(L3,{kind:t.type,value:v,onChange:n,label:qu(l)});break;case\"number\":S=(0,Te.jsx)(\"input\",{className:\"sm-input\",type:\"number\",value:v==null?\"\":String(v),onChange:k=>n(k.target.value===\"\"?void 0:Number(k.target.value))});break;case\"boolean\":S=(0,Te.jsx)(dd,{checked:v===!0,onChange:n});break;case\"select\":{let k=su(t.options);S=(0,Te.jsxs)(\"select\",{className:\"sm-select\",value:String(v??\"\"),onChange:A=>n(A.target.value),children:[t.optional===!0&&(0,Te.jsx)(\"option\",{value:\"\",children:\"\\u2014\"}),k.map(A=>(0,Te.jsx)(\"option\",{value:A.value,children:A.label},A.value))]});break}case\"radio\":{w=!0;let k=v===void 0||v===\"\",A=[...t.optional===!0?[{value:void 0,label:h??\"None\"}]:[],...su(t.options)];S=(0,Te.jsx)(\"div\",{className:\"sm-pills\",role:\"radiogroup\",children:A.map(L=>(0,Te.jsx)(\"button\",{type:\"button\",className:\"sm-pill\",\"aria-pressed\":L.value===void 0?k:v===L.value,onClick:()=>n(L.value),children:L.label},L.value??\"\"))});break}case\"css\":{let k=typeof v==\"string\"?v:\"\",A=k===\"\"?null:cv(k);if(S=(0,Te.jsx)(\"textarea\",{className:\"sm-textarea sm-css\",rows:6,spellCheck:!1,value:k,onChange:L=>n(L.target.value===\"\"?void 0:L.target.value)}),A)return(0,Te.jsx)(xe,{label:qu(l),error:A,path:y,children:S});break}case\"checkboxes\":{w=!0;let k=Array.isArray(v)?v:[],A=su(t.options),L=(_,P)=>n(A.map(D=>D.value).filter(D=>D===_?P:k.includes(D)));S=(0,Te.jsx)(\"div\",{className:\"sm-choices\",children:A.map(_=>(0,Te.jsxs)(\"label\",{className:\"sm-choice\",children:[(0,Te.jsx)(\"input\",{type:\"checkbox\",checked:k.includes(_.value),onChange:P=>L(_.value,P.target.checked)}),_.label]},_.value))});break}case\"tags\":{w=!0;let k=typeof t.max==\"number\"?t.max:void 0;k!==void 0&&(E=`${Array.isArray(v)?v.length:0} of ${k}`),S=(0,Te.jsx)(h3,{value:v,onChange:n,max:k,suggestions:i,label:qu(l)});break}case\"richtext\":w=!0,S=d===y?(0,Te.jsx)(kE,{onEditHere:f}):(0,Te.jsx)(uw,{value:v,toolset:t.toolset,onChange:n,errors:r,path:y});break;case\"image\":case\"video\":case\"file\":return s?(0,Te.jsx)(Lg,{descriptor:t,value:v,onChange:n,error:x,path:y}):(0,Te.jsx)(Lg,{descriptor:t,value:v,onChange:n,label:qu(l),mark:c,error:x,path:y});case\"ref\":case\"refList\":{w=!0;let k=t.type===\"refList\",A=typeof t.max==\"number\"?t.max:void 0;k&&A!==void 0&&(E=`${Array.isArray(v)?v.length:0} of ${A}`),S=(0,Te.jsx)(p3,{value:v,onChange:n,options:a,multiple:k,max:A,target:typeof t.target==\"string\"?t.target:\"\"});break}case\"object\":{w=!0;let k=v&&typeof v==\"object\"&&!Array.isArray(v)?v:{};S=(0,Te.jsx)(\"div\",{className:\"sm-group\",children:Object.entries(t.fields??{}).filter(([,A])=>!Wr(A,{self:k,fields:p?.fields,settings:p?.settings})).map(([A,L])=>(0,Te.jsx)(Pn,{fieldKey:A,descriptor:L,value:k[A],errors:r,path:`${y}.${A}`,inlinePath:d,onEditHere:f,scope:p,onChange:_=>n(J$(k,A,_,t.optional===!0))},A))});break}case\"list\":{let k=Array.isArray(v)?v:[],A=t.item??{type:\"text\"},L=typeof t.max==\"number\"?`${k.length} of ${t.max}`:void 0,_=(0,Te.jsx)(Z$,{descriptor:t,items:k,onChange:n,path:y,head:s?void 0:{label:qu(l),mark:c,counter:L,error:x},renderItem:(P,D)=>(0,Te.jsx)(Pn,{fieldKey:String(D),descriptor:A,value:P,errors:r,path:`${y}.${D}`,bare:!0,inlinePath:d,onEditHere:f,scope:p,onChange:F=>n(k.map((j,K)=>K===D?F:j))})});return s?(0,Te.jsxs)(Te.Fragment,{children:[_,x&&(0,Te.jsx)(\"span\",{className:\"sm-error\",children:x})]}):_}default:S=(0,Te.jsx)(\"textarea\",{className:\"sm-textarea\",disabled:!0,value:JSON.stringify(v??null,null,2),rows:2})}return s?(0,Te.jsxs)(Te.Fragment,{children:[S,x&&(0,Te.jsx)(\"span\",{className:\"sm-error\",children:x})]}):(0,Te.jsx)(xe,{label:qu(l),mark:c,counter:E,hint:g,error:x,asDiv:w,path:y,children:S})}function kE({onEditHere:t}){return(0,Te.jsxs)(\"div\",{className:\"sm-inline-note\",children:[(0,Te.jsx)(\"span\",{children:\"Editing in the canvas\"}),(0,Te.jsx)(Q,{variant:\"secondary\",onClick:t,children:\"Edit here\"})]})}var CE=\"sm-field--reveal\",qne=\"data-sm-path\";function Vne(t){let e=t.split(\".\").filter(r=>r!==\"\"),n=[];for(let r=e.length;r>=1;r--)n.push(e.slice(0,r).join(\".\"));return n}function Vu(t,e){let n=o=>t.querySelector(`[${qne}=\"${CSS.escape(o)}\"]`),r=n(e);if(r){E3(r);return}for(let o of Vne(e).slice(1)){let s=n(o);if(!s)continue;let a=s.querySelector('[aria-expanded=\"false\"]');a?(a.click(),requestAnimationFrame(()=>Vu(t,e))):E3(s);return}}function E3(t){t.scrollIntoView({block:\"center\",behavior:\"smooth\"}),t.classList.remove(CE),t.offsetWidth,t.classList.add(CE),t.addEventListener(\"animationend\",()=>t.classList.remove(CE),{once:!0}),(t.querySelector(\"input,textarea,select,[contenteditable]\")??t.querySelector(\"button\"))?.focus({preventScroll:!0})}var Ef=T(te(),1);function Kne(t,e,n,r){return t.map(o=>{let s=o.locales[r],a=e?Ld(o,e,n,r):o.id;return s?{id:o.id,title:a,status:ar(s)}:{id:o.id,title:a,status:\"\",absent:!0}})}function Gne(t,e,n){let r=[...new Set(n)].sort(),o=r.map(s=>t.collections.find(a=>a.name===s)??null);return JSON.stringify([e,t.locales.default,r,o])}function Tf(t,e,n,r){let[o,s]=(0,Ef.useState)({}),a=Gne(e,n,r),i=(0,Ef.useRef)({registry:e,locale:n,targets:r});return i.current={registry:e,locale:n,targets:r},(0,Ef.useEffect)(()=>{let{registry:l,locale:u,targets:c}=i.current,d=!1;s({});for(let f of new Set(c)){let p=l.collections.find(h=>h.name===f);t.entries.list(f).then(h=>{d||s(g=>({...g,[f]:h.ok?Kne(h.data,p,l,u):[]}))}).catch(h=>{console.error(h),d||s(g=>({...g,[f]:[]}))})}return()=>{d=!0}},[t,a]),o}var fw=T(te(),1),Wne=t=>Object.entries(t).filter(([,e])=>e.type===\"tags\").map(([e])=>e);function T3(t,e,n,r){let[o,s]=(0,fw.useState)({}),a=Wne(n).join(`\n`);return(0,fw.useEffect)(()=>{let i=!1;s({});for(let l of a===\"\"?[]:a.split(`\n`))t.entries.distinct(e,l,r).then(u=>{i||s(c=>({...c,[l]:u.ok?u.data:[]}))}).catch(console.error);return()=>{i=!0}},[t,e,r,a]),o}var sl=T(te(),1);function LE(t){let e=t.debounceMs??800,n=t.retryBaseMs??1e3,r=t.retryCapMs??1e4,o=null,s=null,a=n,i=0,l=0,u=\"saved\",c=!1,d=null,f=new Set,p=m=>{u=m;for(let y of f)y()},h=()=>{let m=g();d=m;let y=()=>{d===m&&(d=null)};return m.then(y,y),m},g=async()=>{let m=t.read();if(m===null)return!0;s&&(clearTimeout(s),s=null);let y=i;p(\"saving\");let b;try{b=await t.persist(m)}catch(x){console.error(x),b={ok:!1,code:\"internal\",message:\"\"}}if(b.ok)return l=y,a=n,p(\"saved\"),t.onSaved?.(),!0;if(b.code===\"conflict\"&&b.stale)return p(\"stale\"),!1;if(b.code===\"validation\")return p(\"refused\"),!1;{if(c)return p(\"error\"),!1;p(\"error\");let x=a;return a=Math.min(x*2,r),s=setTimeout(()=>{s=null,h()},x),!1}};return{getState:()=>u,subscribe(m){return f.add(m),()=>{f.delete(m)}},mark(){u!==\"stale\"&&(i+=1,o&&clearTimeout(o),o=setTimeout(()=>{o=null,h()},e))},flush(){return u===\"stale\"?Promise.resolve(!1):i===l?Promise.resolve(!0):(o&&(clearTimeout(o),o=null),h())},dispose(){o&&(clearTimeout(o),o=null),s&&(clearTimeout(s),s=null)},close(){c=!0,o&&(clearTimeout(o),o=null),s&&(clearTimeout(s),s=null);let m=()=>u===\"stale\"?Promise.resolve(!1):i===l?Promise.resolve(!0):h();return d?d.then(m):m()},reopen(){c=!1},reset(){o&&(clearTimeout(o),o=null),s&&(clearTimeout(s),s=null),l=i,a=n,p(\"saved\")}}}function Rf(t){let e=(0,sl.useRef)(t);e.current=t;let[n]=(0,sl.useState)(()=>LE({read:()=>e.current.read(),persist:o=>e.current.persist(o),onSaved:()=>e.current.onSaved?.(),debounceMs:t.debounceMs,retryBaseMs:t.retryBaseMs,retryCapMs:t.retryCapMs}));return(0,sl.useEffect)(()=>(n.reopen(),()=>{n.close()}),[n]),{saveState:(0,sl.useSyncExternalStore)(n.subscribe,n.getState,n.getState),mark:n.mark,flush:n.flush,reset:n.reset}}var ns=T(te(),1);var If=T(O(),1),R3=(t,e)=>({top:t.top,bottom:t.bottom,right:e-t.right}),Xne=(t,e)=>t.top!==e.top||t.bottom!==e.bottom||t.right!==e.right;function Jne(t,e,n){return Ag({below:e-t.bottom-6,above:t.top-6,height:n})?{right:t.right,bottom:e-t.top+6}:{right:t.right,top:t.bottom+6}}function Mf({label:t,items:e,disabled:n,small:r=!1}){let[o,s]=(0,ns.useState)(null),[a,i]=(0,ns.useState)(null),l=(0,ns.useRef)(null),u=(0,ns.useRef)(null),c=(0,ns.useRef)(null);(0,ns.useLayoutEffect)(()=>{i(o&&c.current?Jne(o,window.innerHeight,c.current.offsetHeight):null)},[o]);let d=()=>{if(o){s(null);return}let f=u.current?.getBoundingClientRect();f&&s(R3(f,window.innerWidth))};return(0,ns.useEffect)(()=>{if(!o)return;let f=()=>s(null),p=m=>{l.current?.contains(m.target)||f()},h=m=>{m.key===\"Escape\"&&f()},g=()=>{let m=u.current?.getBoundingClientRect();(!m||Xne(o,R3(m,window.innerWidth)))&&f()};return document.addEventListener(\"pointerdown\",p),document.addEventListener(\"keydown\",h),document.addEventListener(\"scroll\",g,!0),()=>{document.removeEventListener(\"pointerdown\",p),document.removeEventListener(\"keydown\",h),document.removeEventListener(\"scroll\",g,!0)}},[o]),(0,If.jsxs)(\"div\",{ref:l,style:{position:\"relative\",flex:\"none\"},children:[(0,If.jsx)(\"button\",{ref:u,type:\"button\",className:Ie(\"sm-dotmenu\",r&&\"sm-dotmenu--sm\"),\"aria-label\":t,title:t,\"aria-haspopup\":\"menu\",\"aria-expanded\":o!==null,disabled:n,onClick:d,children:\"\\xB7\\xB7\\xB7\"}),o&&(0,If.jsx)(\"div\",{ref:c,role:\"menu\",className:\"sm-picker sm-picker--menu\",style:a??{top:o.bottom+6,right:o.right,visibility:\"hidden\"},children:e.map(f=>(0,If.jsx)(\"button\",{type:\"button\",role:\"menuitem\",className:Ie(\"sm-picker__item\",f.danger&&\"sm-picker__item--danger\"),disabled:f.disabled,onClick:()=>{s(null),f.run()},children:f.label},f.label))})]})}var _f=T(O(),1),Yne={publish:\"Publishing\\u2026\",discard:\"Discarding\\u2026\",unpublish:\"Unpublishing\\u2026\"};function Zne(t){return[...t.onHistory?[{label:\"History\",run:t.onHistory}]:[],{label:\"Discard changes\",danger:!0,disabled:!t.can.discard,run:t.onDiscard},{label:\"Unpublish\",disabled:!t.can.unpublish,run:t.onUnpublish}]}function al({status:t,pending:e=!1,busy:n=null,flash:r=!1,disabled:o=!1,compact:s=!1,onPublish:a,onDiscard:i,onUnpublish:l,onHistory:u}){let c=qO(t,e),d=o||n!==null,f=n?Yne[n]:r?\"Published \\u2713\":\"Publish\";return(0,_f.jsxs)(\"span\",{style:{display:\"inline-flex\",alignItems:\"center\",gap:8},children:[t&&(0,_f.jsx)(gs,{status:bs(t)}),(0,_f.jsx)(Q,{variant:r&&!n?\"ok\":\"primary\",size:s?\"sm\":\"md\",disabled:d||!c.publish,onClick:a,children:f}),(0,_f.jsx)(Mf,{label:\"More actions\",disabled:d||t===null,small:s,items:Zne({can:c,onDiscard:i,onUnpublish:l,onHistory:u})})]})}var Tg=T(te(),1);var fr=T(O(),1),Qne={title:\"Restore this version?\",body:\"The current draft is replaced by this version. Nothing goes live until you publish.\",confirmLabel:\"Restore\"};function Of(t,e){let n=e.status===\"published\";return t.map(r=>({...r,tag:r.id===e.draftVersionId&&(r.id!==e.publishedVersionId||!n)?\"Draft\":r.id===e.publishedVersionId&&n?\"Live\":null}))}function Df({rows:t,draftId:e,render:n,onSelect:r,onRestore:o,onClose:s}){let[a,i]=(0,Tg.useState)(t[0]?.id??null),[l,u]=(0,Tg.useState)(!1);(0,Tg.useEffect)(()=>{a&&r?.(a)},[a]);let c=async()=>{if(!a||!await rt(Qne))return;u(!0);let d=await o(a);u(!1),d&&s()};return(0,fr.jsx)(Rs,{title:\"History\",width:1200,height:\"85vh\",flush:!0,onClose:s,footer:(0,fr.jsxs)(fr.Fragment,{children:[(0,fr.jsx)(Q,{variant:\"secondary\",onClick:s,children:\"Close\"}),(0,fr.jsx)(Q,{disabled:l||!a||a===e,onClick:()=>{c()},children:l?\"Restoring\\u2026\":\"Restore\"})]}),children:(0,fr.jsxs)(\"div\",{className:\"sm-history\",children:[(0,fr.jsxs)(\"div\",{className:\"sm-history__list\",role:\"listbox\",\"aria-label\":\"Versions\",children:[t.length===0&&(0,fr.jsx)(\"span\",{className:\"sm-hint\",style:{padding:12},children:\"No versions yet.\"}),t.map(d=>(0,fr.jsxs)(\"button\",{type:\"button\",role:\"option\",\"aria-selected\":d.id===a,className:Ie(\"sm-history__row\",d.id===a&&\"sm-history__row--active\"),onClick:()=>i(d.id),children:[(0,fr.jsx)(\"span\",{children:uv(d.savedAt)}),d.tag&&(0,fr.jsx)(\"span\",{className:Ie(\"sm-history__tag\",d.tag===\"Live\"&&\"sm-history__tag--live\"),children:d.tag})]},d.id))]}),(0,fr.jsx)(\"div\",{className:\"sm-history__main\",children:a?n(a):null})]})})}var Gu=T(te(),1);var _3=T(O(),1),Ku=t=>{let e=t.closest(\".sm-admin\"),n=t.parentElement,r=t.nextElementSibling;return{admin:e instanceof HTMLElement?e:null,grid:n instanceof HTMLElement?n:null,aside:r instanceof HTMLElement?r:null}},M3=(t,e)=>t.style.setProperty(\"--inspector-w\",`${e}px`),AE=t=>{try{t===null?localStorage.removeItem(Xh):localStorage.setItem(Xh,String(t))}catch{}};function Nf(){let t=(0,Gu.useRef)(null),e=(0,Gu.useRef)(null),[n,r]=(0,Gu.useState)(null),o=()=>{let d=t.current;if(!d)return;let{aside:f}=Ku(d);f&&f.offsetWidth>0&&r(f.offsetWidth)};(0,Gu.useEffect)(o,[]);let s=d=>{let f=t.current;if(!f)return;let{admin:p,grid:h}=Ku(f);if(!p||!h)return;let g=eL(d,h.clientWidth,f.offsetWidth);M3(p,g),AE(g),r(g)},a=()=>{let d=t.current;if(!d)return;let{admin:f}=Ku(d);f&&(f.style.removeProperty(\"--inspector-w\"),AE(null),o())},i=d=>{if(d.button!==0||e.current)return;let{admin:f,grid:p,aside:h}=Ku(d.currentTarget);!f||!p||!h||(d.preventDefault(),d.currentTarget.setPointerCapture(d.pointerId),e.current={id:d.pointerId,startX:d.clientX,startW:h.offsetWidth,rowW:p.clientWidth,handleW:d.currentTarget.offsetWidth,last:h.offsetWidth},f.classList.add(\"sm-admin--resizing\"))},l=d=>{let f=e.current;if(!f||d.pointerId!==f.id)return;let{admin:p}=Ku(d.currentTarget);p&&(f.last=eL(f.startW-(d.clientX-f.startX),f.rowW,f.handleW),M3(p,f.last))},u=d=>{let f=e.current;if(!f||d.pointerId!==f.id)return;e.current=null;let{admin:p}=Ku(d.currentTarget);d.currentTarget.hasPointerCapture(f.id)&&d.currentTarget.releasePointerCapture(f.id),p?.classList.remove(\"sm-admin--resizing\"),AE(f.last),r(f.last)};return(0,_3.jsx)(\"div\",{ref:t,className:\"sm-resize\",role:\"separator\",\"aria-orientation\":\"vertical\",\"aria-label\":\"Resize inspector\",\"aria-valuemin\":260,\"aria-valuenow\":n??void 0,title:\"Drag to resize \\xB7 double-click to reset\",tabIndex:0,onPointerDown:i,onPointerMove:l,onPointerUp:u,onPointerCancel:u,onLostPointerCapture:u,onDoubleClick:a,onKeyDown:d=>{let{grid:f,aside:p}=Ku(d.currentTarget);if(!f||!p||e.current)return;let h=p.offsetWidth,g=null;d.key===\"ArrowLeft\"?g=h+16:d.key===\"ArrowRight\"?g=h-16:d.key===\"Home\"?g=260:d.key===\"End\"&&(g=QC(f.clientWidth,d.currentTarget.offsetWidth)),g!==null&&(d.preventDefault(),d.stopPropagation(),s(g))},onFocus:o})}function ere(t,e,n=e.default){let r=new URLSearchParams(t).get(\"locale\");return r&&e.supported.includes(r)?r:n}function tre(t,e){let n=new URL(t);return n.searchParams.set(\"locale\",e),n.toString()}function il(t){try{let e=ere(window.location.search,t.locales,xs(t.locales));return Vo(e),e}catch{return t.locales.default}}function Wu(t){Vo(t);try{sr(tre(window.location.href,t),{replace:!0})}catch{}}function Bs(t){return t.draftVersionId===null?null:{versionId:t.draftVersionId,savedAt:t.draftSavedAt??\"\"}}var Yn=t=>!t.ok&&t.code===\"conflict\"&&t.stale===!0,nre=t=>t?t.split(\"@\")[0]:\"someone\";function O3(t,e=Date.now()){let n=new Date(t.at),r=new Date(e),s=n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()?`${String(n.getHours()).padStart(2,\"0\")}:${String(n.getMinutes()).padStart(2,\"0\")}`:uv(t.at);return`${nre(t.by)} saved a newer version at ${s}.`}var D3=\"Your unsaved changes here will be discarded.\",N3=\"Load their version\",pr=t=>({by:t.by??null,at:t.at??Date.now()});var Xu=T(O(),1);function Pf({info:t,onReload:e}){return(0,Xu.jsx)(\"div\",{className:\"sm-stale\",\"data-testid\":\"stale-banner\",children:(0,Xu.jsxs)(Me,{tone:\"error\",children:[(0,Xu.jsx)(\"p\",{style:{margin:0},children:O3(t)}),(0,Xu.jsx)(\"p\",{style:{margin:\"4px 0 10px\",color:\"inherit\",opacity:.85},children:D3}),(0,Xu.jsx)(Q,{onClick:e,children:N3})]})})}function rre(t){let e;try{e=JSON.stringify(t)??String(t)}catch{e=String(t)}return e.length>60?`${e.slice(0,60)}\\u2026`:e}function Rg(t){switch(t.kind){case\"unknown-section\":return t.subject.scope===\"global\"?\"The code no longer registers this global item.\":\"The code no longer registers this section.\";case\"unknown-element\":return\"The code no longer registers this element.\";case\"unknown-shape\":return\"The code no longer registers this page type.\";case\"unknown-collection\":return\"The code no longer registers this collection.\";case\"misfit\":return`The stored value doesn't fit this field: ${rre(t.value)}`;case\"zone-disallowed\":return`Zone \\`${t.subject.name}\\` no longer allows \\`${t.subject.field}\\`. Remove or move it to publish.`;case\"zone-over-max\":return`Zone \\`${t.subject.name}\\` allows ${t.detail?.max} sections and has ${t.detail?.count}.`;case\"orphan-field\":return\"No longer in the schema.\";case\"orphan-zone\":return`Removed zone \\`${t.subject.name}\\` \\xB7 ${t.detail?.count} ${t.detail?.count===1?\"section\":\"sections\"}`;case\"element-outside-toolset\":return\"Not in this field's toolset\";case\"localization-on\":return`\\`${t.subject.field}\\` is now translated per language. Its shared value shows in every language until it's saved there.`;case\"localization-off\":return`\\`${t.subject.field}\\` is now shared. Saving here makes this language's value the one every language shows.`}}var ore={section:\"section\",element:\"element\",collection:\"collection\",global:\"global item\",page:\"page type\",zone:\"zone\"};function B3(t,e){let n=t.subject,r=`${ore[n.scope]} \\`${n.name}\\``;switch(t.kind){case\"unknown-section\":return n.scope===\"global\"?`Unknown global item \\`${n.name}\\``:`Unknown section \\`${n.name}\\``;case\"unknown-element\":return`Unknown element \\`${n.name}\\``;case\"unknown-shape\":return`Unknown page type \\`${n.name}\\``;case\"unknown-collection\":return`Collection \\`${n.name}\\` no longer registered`;case\"misfit\":return`\\`${n.field}\\` in ${r} doesn't fit f.${t.detail?.type}()`;case\"zone-disallowed\":return`Zone \\`${n.name}\\` of \\`${n.within}\\` no longer allows \\`${n.field}\\``;case\"zone-over-max\":return`Zone \\`${n.name}\\` of \\`${n.within}\\` holds more than its max`;case\"orphan-field\":return`Field \\`${n.field}\\` no longer in ${r}`;case\"orphan-zone\":return`Zone \\`${n.name}\\` no longer on page type \\`${n.within}\\``;case\"element-outside-toolset\":return`Element \\`${n.name}\\` not in the toolset of \\`${n.field}\\``;case\"localization-on\":return`\\`${n.field}\\` in ${r} is now translated \\u2014 a shared value is left`;case\"localization-off\":return`\\`${n.field}\\` in ${r} is now shared \\u2014 languages still hold their own`}}var P3=(t,e,n)=>`${t} ${t===1?e:n}`;function z3(t,e){let n=t.filter(xv).length,r=t.length-n,o=[n>0?`${P3(n,\"problem blocks\",\"problems block\")} publishing`:null,r>0?`${r} left over from an older schema`:null].filter(Boolean),s=new Set(t.map(i=>`${i.kind}|${i.path}`)),a=e.filter(i=>!s.has(`${i.kind}|${i.path}`)).length;return{summary:o.length>0?o.join(\" \\xB7 \"):null,liveOnly:a>0?`The live version has ${P3(a,\"problem\",\"problems\")} the draft has already fixed \\u2014 publish to clear it.`:null,sentences:t.filter(i=>i.kind===\"localization-on\"||i.kind===\"localization-off\").map(Rg)}}function ll(t,e){let n={};for(let r of t){if(r.kind!==\"misfit\")continue;let o=e&&r.path.startsWith(`${e}.`)?r.path.slice(e.length+1):r.path;n[o]=Rg(r)}return n}var Ju=T(O(),1);function Bf({draft:t,live:e}){let{summary:n,liveOnly:r,sentences:o}=z3(t,e);return!n&&!r&&o.length===0?null:(0,Ju.jsx)(\"div\",{className:\"sm-drift\",\"data-testid\":\"drift-notice\",children:(0,Ju.jsxs)(Me,{tone:\"warn\",children:[n&&(0,Ju.jsx)(\"p\",{style:{margin:0},children:n}),r&&(0,Ju.jsx)(\"p\",{style:{margin:0},children:r}),o.map(s=>(0,Ju.jsx)(\"p\",{style:{margin:0},children:s},s))]})})}var ja=T(O(),1),F3=t=>typeof t==\"string\"?t:JSON.stringify(t);function ul({orphans:t,strip:e,onClear:n}){let r=t.filter(s=>s.kind===\"orphan-field\");if(r.length===0)return null;let o=s=>e&&s.startsWith(`${e}.`)?s.slice(e.length+1):s;return(0,ja.jsxs)(\"details\",{className:\"sm-orphans\",\"data-testid\":\"orphan-fields\",children:[(0,ja.jsx)(\"summary\",{className:\"sm-orphans__head\",children:\"No longer in the schema\"}),r.map(s=>(0,ja.jsxs)(\"div\",{className:\"sm-orphans__row\",children:[(0,ja.jsx)(\"code\",{children:o(s.path)}),(0,ja.jsx)(\"span\",{className:\"sm-orphans__value\",children:F3(s.value)}),(0,ja.jsx)(Q,{variant:\"secondary\",onClick:()=>{navigator.clipboard?.writeText(F3(s.value))},children:\"Copy\"}),(0,ja.jsx)(Q,{variant:\"secondary\",onClick:()=>n(o(s.path)),children:\"Clear\"})]},s.path))]})}var H3=T(O(),1);function sre(t,e){return`${t.length===1?t[0]:`${t.slice(0,-1).join(\", \")} and ${t[t.length-1]}`} ${t.length===1?\"is\":\"are\"} also editing this ${e}.`}function zf({names:t,noun:e}){return t.length===0?null:(0,H3.jsx)(\"p\",{className:\"sm-presence\",role:\"status\",children:sre(t,e)})}var no=T(O(),1),are=60,ire=160,$3=t=>typeof t==\"string\"?t:\"\";function U3({n:t,max:e}){return(0,no.jsxs)(\"span\",{className:t>e?\"sm-counter--over\":void 0,children:[t,\"/\",e]})}function pw({meta:t,onPatch:e,titleHint:n,descriptionHint:r,imageHint:o}){let s=$3(t.title),a=$3(t.description);return(0,no.jsxs)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:14},children:[(0,no.jsx)(xe,{label:\"Title\",counter:(0,no.jsx)(U3,{n:s.length,max:are}),hint:`Used in search results and link previews. ${n??\"Empty: the page title.\"}`,children:(0,no.jsx)(\"input\",{className:\"sm-input\",value:s,onChange:i=>e(\"title\",i.target.value)})}),(0,no.jsx)(xe,{label:\"Description\",counter:(0,no.jsx)(U3,{n:a.length,max:ire}),hint:r,children:(0,no.jsx)(\"textarea\",{className:\"sm-textarea\",rows:3,value:a,onChange:i=>e(\"description\",i.target.value)})}),(0,no.jsx)(Lg,{descriptor:{type:\"image\"},value:t.ogImage,onChange:i=>e(\"ogImage\",i),label:\"Social image\",hint:o?`1200\\xD7630 recommended. ${o}`:\"1200\\xD7630 recommended\"}),(0,no.jsx)(xe,{label:\"Hide from search engines\",asDiv:!0,children:(0,no.jsx)(dd,{checked:t.noindex===!0,onChange:i=>e(\"noindex\",i),label:\"Hide from search engines\"})})]})}var de=T(O(),1),lre={},ure=()=>typeof document<\"u\"&&document.activeElement instanceof HTMLElement&&document.activeElement.closest('[data-sm-path=\"slug\"]')!==null;function j3({ops:t,registry:e,collection:n,id:r}){let o=Qe(),s=e.collections.find(N=>N.name===n),a=e.locales.supported.length>1,[i,l]=(0,Pe.useState)(()=>il(e)),[u,c]=(0,Pe.useState)(null),[d,f]=(0,Pe.useState)(null),[p,h]=(0,Pe.useState)({}),[g,m]=(0,Pe.useState)({}),[y,b]=(0,Pe.useState)(e.locales.supported),[x,v]=(0,Pe.useState)(null),[S,E]=(0,Pe.useState)({}),[w,k]=(0,Pe.useState)({}),[A,L]=(0,Pe.useState)(!1),[_,P]=(0,Pe.useState)(0),[D,F]=(0,Pe.useState)(!1),[j,K]=(0,Pe.useState)(!1),[ve,ue]=(0,Pe.useState)(null),[Ue,Re]=(0,Pe.useState)(!1),[je,Ke]=(0,Pe.useState)(null),[M,V]=(0,Pe.useState)(null),[I,U]=(0,Pe.useState)(null),[me,Oe]=(0,Pe.useState)([]),X=(0,Pe.useRef)(null),dn=(0,Pe.useRef)(d);dn.current=d;let er=(0,Pe.useRef)(u);er.current=u;let dc=(0,Pe.useRef)(null),wn=(0,Pe.useRef)(!0),_r=(0,Pe.useRef)(!1),is=()=>{let N=er.current?.locales[i];return N?Bs(N):null},It={kind:\"entry\",id:r,locale:i};Sd(It);let{others:bl}=Ao(),mr=Sa(),Ws=async()=>{let N=await t.entries.get(n,r,i).catch(()=>null);N?.ok&&(h(N.data.urls),m(N.data.redirects),Oe(N.data.liveFindings))},{saveState:Ho,mark:gr,flush:lo,reset:Xa}=Rf({read:()=>dn.current,persist:async N=>{let re=er.current?.locales[i],Le=re?.slug??null,Gt=typeof N.slug==\"string\"?N.slug:null;if(tm({status:re?.status,from:Le,to:Gt})&&ure()&&(_r.current=!0,N={...N,slug:Le},Gt=Le),Gt!==null&&tm({status:re?.status,from:Le,to:Gt})){let yr=xa(Gt);yr!==Gt&&(Gt=yr,N={...N,slug:yr},f(dp=>({...dp??{},slug:yr})))}if(Gt!==dc.current&&tm({status:re?.status,from:Le,to:Gt})){let yr=er.current,dp=yr&&s?{name:Ld(yr,s,e,i),path:co&&Le?`${co}${Le}`:null}:void 0,{yes:pc,checked:tS}=await bd({...em,option:{...uL},subject:dp});pc?(dc.current=Gt,wn.current=tS):(N={...N,slug:Le},f(nS=>({...nS??{},slug:Le})))}let Sn=await t.entries.save(n,r,i,N,is(),{redirect:wn.current});if(Sn.ok){let yr=er.current?.locales[i]?.slug;wn.current=!0,er.current=Sn.data,c(Sn.data),k({}),mr?.announce(It,Sn.data.locales[i]?.draftSavedAt??null),Sn.data.locales[i]?.slug!==yr&&Ws()}else Yn(Sn)?U(pr(Sn)):Sn.code===\"validation\"&&Sn.fields&&k(Object.fromEntries(Sn.fields.map(yr=>[yr.field,yr.message])));return Sn},onSaved:()=>{_r.current||F(!1)}});ld(D||Ho!==\"saved\");let $o=(0,Pe.useMemo)(()=>{let N={};for(let[re,Le]of Object.entries(s?.fields??{}))(Le.type===\"ref\"||Le.type===\"refList\")&&typeof Le.target==\"string\"&&(N[re]=Le.target);return N},[s]),fc=(0,Pe.useMemo)(()=>Object.values($o),[$o]),Xs=Tf(t,e,i,fc),Js=T3(t,n,s?.fields??lre,i),vl=(0,Pe.useMemo)(()=>s?hD(s):[],[s]);(0,Pe.useEffect)(()=>{let N=!1;return f(null),E({}),k({}),_r.current=!1,F(!1),U(null),K(!1),t.entries.get(n,r,i).then(re=>{N||(re.ok?(c(re.data.record),f(re.data.fields),h(re.data.urls),m(re.data.redirects),b(re.data.parentLocales),Oe(re.data.liveFindings)):v({tone:\"error\",text:re.message}))}).catch(()=>{N||v({tone:\"error\",text:\"Couldn't reach the server.\"})}),()=>{N=!0}},[t,n,r,i,_]);let Or=(0,Pe.useMemo)(()=>d&&u?.locales[i]?wv(e,n,{fields:d,shared:u.fields,own:u.locales[i].fields}):[],[d,u,i,e,n]),xl=(0,Pe.useMemo)(()=>({...ll(Or),...S,...w}),[Or,S,w]);if(!s)return(0,de.jsx)(\"p\",{style:{padding:32},children:\"No such collection.\"});let pt=u?.locales[i],Dr=pt?ar(pt):null,wl=(0,Pe.useMemo)(()=>fv(e.elements),[e]),Ja=Object.keys(S).length>0;(0,Pe.useEffect)(()=>{if(!Ja||!d||!s)return;let N=kv(d,s.fields,wl);E(re=>Cv(re,N)),v(re=>{if(!re?.fields)return re;let Le=re.fields.filter(Gt=>N.some(Sn=>Sn.field===Gt.field));return Le.length===0?null:Le.length===re.fields.length?re:{...re,fields:Le}})},[d,Ja,s,wl]);let Un=N=>{if(Yn(N)){U(pr(N));return}N.code===\"validation\"&&N.fields&&N.fields.length>0?(E(Object.fromEntries(N.fields.map(re=>[re.field,re.message]))),v({tone:\"warn\",text:N.message,fields:N.fields})):v({tone:\"error\",text:N.message})},$=()=>{U(null),Xa(),P(N=>N+1)};kd(It,N=>{I||(D||Ho!==\"saved\"?U({by:N.email,at:Date.now()}):P(re=>re+1))});let ge=async()=>{if(v(null),ue(\"publish\"),!await lo()){ue(null),v({tone:\"error\",text:\"Couldn't save your latest changes \\u2014 publish cancelled.\"});return}let N;try{N=await t.entries.setStatus(n,r,i,\"published\",is())}catch{N={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(ue(null),!N.ok){Un(N);return}c(N.data),mr?.announce(It,N.data.locales[i]?.draftSavedAt??null),E({}),Ws(),Re(!0),setTimeout(()=>Re(!1),1600)},Kt=async()=>{v(null),ue(\"unpublish\");let N;try{N=await t.entries.setStatus(n,r,i,\"draft\")}catch{N={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}ue(null),N.ok?(c(N.data),Ws()):Un(N)},ls=async()=>{if(!await rt({...eu,subject:Za()}))return;if(v(null),ue(\"discard\"),!await lo()){ue(null),v({tone:\"error\",text:\"Couldn't save your latest changes \\u2014 discard cancelled.\"});return}let N;try{N=await t.entries.discardDraft(n,r,i,is())}catch{N={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(ue(null),!N.ok){Un(N);return}c(N.data),mr?.announce(It,N.data.locales[i]?.draftSavedAt??null),P(re=>re+1),v({tone:\"ok\",text:\"Changes discarded.\"})},ke=async()=>{if(!pt)return;if(!await lo()){v({tone:\"error\",text:\"Couldn't save your latest changes \\u2014 history not opened.\"});return}let N=await t.entries.listVersions(n,r,i);if(!N.ok){Un(N);return}V(null),Ke(Of(N.data,pt))},uo=async N=>{let re=await t.entries.getVersion(n,r,N);re.ok?V({id:re.data.id,fields:re.data.fields}):Un(re)},Ya=async N=>{let re=await t.entries.restore(n,r,i,N,is());return re.ok?(c(re.data),mr?.announce(It,re.data.locales[i]?.draftSavedAt??null),P(Le=>Le+1),v({tone:\"ok\",text:\"Version restored.\"}),!0):(Un(re),!1)},ce=N=>{N!==i&&(Wu(N),v(null),l(N))},lp=async N=>{if(N!==i){if(!await lo()){v({tone:\"error\",text:\"Couldn't save your latest changes \\u2014 stayed on this locale.\"});return}ce(N)}},up=async N=>{if(!u||A)return;if(!await lo()){v({tone:\"error\",text:\"Couldn't save your latest changes \\u2014 locale not added.\"});return}let re=u.locales[i]?i:tu(u,e);L(!0);let Le;try{Le=await t.entries.addLocale(n,r,N,{from:re})}catch{Le={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(L(!1),!Le.ok){Un(Le);return}c(Le.data),N===i?P(Gt=>Gt+1):ce(N)},dy=async()=>{if(!u)return;let N=Object.keys(u.locales).filter(Gt=>Gt!==i);if(N.length===0||!await rt({title:`Remove this entry from ${i}?`,body:`Its ${i} fields and history are deleted. Other languages are not affected.`,confirmLabel:`Remove from ${i}`,destructive:!0,subject:Za()}))return;let Le;try{Le=await t.entries.removeLocale(n,r,i)}catch{Le={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(!Le.ok){Un(Le);return}c(Le.data),ce(N.includes(e.locales.default)?e.locales.default:N[0])},eS=async()=>{if(!await rt({title:\"Delete this entry?\",body:`The entry${a?\" in every language\":\"\"} and its history are removed. Anything referencing it loses the reference. This cannot be undone.`,confirmLabel:\"Delete entry\",destructive:!0,subject:Za()}))return;let re=await t.entries.delete(n,r);re.ok?sr(o(`/${n}`)):Un(re)},Sl=u?Ld(u,s,e,i):\"\\u2026\",fy=s.path?.[i],co=fy?`/${fy}/`:void 0,Za=()=>{let N=u?.locales[i]?.slug;return u?{name:Sl,path:co&&N?`${co}${N}`:null}:void 0},cp=u?e.locales.supported.filter(N=>u.locales[N]):[i],py=s.fields.slug?.from,kl=typeof py==\"string\"?py:void 0,Cl=([N,re])=>(0,de.jsx)(Pn,{fieldKey:N,descriptor:re,value:d?.[N],errors:xl,refOptions:$o[N]?Xs[$o[N]]:void 0,suggestions:Js[N],prefix:re.type===\"slug\"?co:void 0,hint:N===\"slug\"&&kl&&!d?.slug?iv(d?.[kl]):void 0,onBlur:N===\"slug\"?()=>{_r.current&&(_r.current=!1,F(!0),gr())}:void 0,mark:a&&!vl.includes(N)?(0,de.jsx)(ov,{}):void 0,onChange:Le=>{let Gt=(er.current?.locales[i]?.publishedVersionId??null)===null;f(Sn=>aD(Sn??{},N,Le,kl,Gt)),F(!0),K(!0),gr()}},N),hy=u!==null&&d===null&&!u.locales[i];return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(ko,{left:(0,de.jsx)(de.Fragment,{children:(0,de.jsx)(fd,{backHref:o(`/${n}`),items:[{label:s.title,href:o(`/${n}`),trailing:a&&(0,de.jsx)(md,{registry:e,present:cp,parentLocales:y,value:i,adding:A,onSwitch:N=>{lp(N)},onAdd:N=>{up(N)}})},{label:Sl}]})}),right:(0,de.jsxs)(de.Fragment,{children:[(j||Ho===\"error\"||Ho===\"refused\")&&(0,de.jsx)(Yl,{state:Ho,pending:D}),p[i]&&(0,de.jsx)(rv,{icon:!0,href:p[i],target:\"_blank\",rel:\"noreferrer\",\"aria-label\":\"View live\",title:\"View live \\u2014 opens the site route. While the admin's draft-mode cookie is on, this shows the DRAFT \\u2014 open it in a private window to see what visitors see.\",children:(0,de.jsx)(Xl,{size:16,strokeWidth:1.5,\"aria-hidden\":\"true\"})}),(0,de.jsx)(al,{status:Dr,pending:D||Ho!==\"saved\",busy:ve,flash:Ue,disabled:!pt,onPublish:()=>{ge()},onUnpublish:()=>{Kt()},onDiscard:()=>{ls()},onHistory:()=>{ke()}})]})}),je&&pt&&(0,de.jsx)(Df,{rows:je,draftId:pt.draftVersionId,onSelect:N=>{uo(N)},onClose:()=>Ke(null),onRestore:Ya,render:N=>M?.id===N?(0,de.jsx)(\"fieldset\",{disabled:!0,className:\"sm-history__form\",children:Object.entries(s.fields).map(([re,Le])=>(0,de.jsx)(Pn,{fieldKey:re,descriptor:Le,value:M.fields[re],refOptions:$o[re]?Xs[$o[re]]:void 0,prefix:Le.type===\"slug\"?co:void 0,onChange:()=>{}},re))}):(0,de.jsx)(\"p\",{className:\"sm-hint\",style:{padding:16},children:\"Loading\\u2026\"})}),(0,de.jsx)(zf,{names:Eo(bl,It),noun:\"entry\"}),I&&(0,de.jsx)(Pf,{info:I,onReload:$}),(0,de.jsx)(Bf,{draft:Or,live:me}),(0,de.jsxs)(\"div\",{className:\"sm-editor\",inert:I?!0:void 0,children:[(0,de.jsxs)(\"div\",{className:\"sm-form\",ref:X,children:[x&&(0,de.jsxs)(Me,{tone:x.tone,onDismiss:()=>v(null),revealKey:`${x.tone}:${x.text}`,children:[(0,de.jsx)(\"p\",{style:{margin:0},children:x.text}),(0,de.jsx)(pd,{fields:x.fields??[],onReveal:N=>{X.current&&Vu(X.current,N)}})]}),hy?(0,de.jsxs)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:12},children:[(0,de.jsxs)(\"p\",{children:[\"This entry doesn't exist in \",i,\" yet. Adding it copies the \",tu(u,e),\" fields as the first \",i,\" draft.\"]}),(0,de.jsxs)(\"div\",{style:{display:\"flex\",gap:8},children:[(0,de.jsxs)(Q,{onClick:()=>{up(i)},disabled:A||!y.includes(i),title:y.includes(i)?void 0:`add ${i} to the parent first`,children:[\"Add \",i]}),(0,de.jsxs)(Q,{variant:\"secondary\",onClick:()=>{lp(tu(u,e))},children:[\"Back to \",tu(u,e)]})]})]}):d!==null?(0,de.jsxs)(de.Fragment,{children:[Object.entries(s.fields).map(Cl),(0,de.jsx)(ul,{orphans:Or,onClear:N=>{f(re=>Zi(re??{},N)),F(!0),K(!0),gr()}})]}):!x&&(0,de.jsx)(\"p\",{style:{color:\"var(--text-muted)\"},children:\"Loading\\u2026\"})]}),(0,de.jsx)(Nf,{}),(0,de.jsxs)(\"aside\",{className:\"sm-inspector\",children:[u&&pt&&(0,de.jsxs)(\"div\",{className:\"sm-card\",children:[(0,de.jsx)(Zt,{children:\"Document info\"}),(0,de.jsx)(Kr,{label:\"Created\",value:nu(u.createdAt)}),(0,de.jsx)(Kr,{label:\"Updated\",value:Ad(pt.updatedAt,pt.updatedBy)}),(g[i]??[]).length>0&&(0,de.jsx)(Kr,{label:\"Redirects from\",value:g[i].join(\", \"),mono:!0}),a&&(0,de.jsx)(Kr,{label:\"Languages\",value:Object.keys(u.locales).join(\", \")}),(0,de.jsx)(Kr,{label:\"ID\",value:r,mono:!0})]}),u&&pt&&s.seo&&(0,de.jsxs)(\"div\",{className:\"sm-card\",children:[(0,de.jsx)(Zt,{children:\"SEO & Social\"}),(0,de.jsx)(pw,{meta:d?.[au]??{},titleHint:`Empty: the ${s.seo.titleLabel}.`,descriptionHint:s.seo.descriptionLabel?`Empty: the ${s.seo.descriptionLabel}.`:void 0,imageHint:s.seo.imageLabel?`Empty: the ${s.seo.imageLabel}.`:void 0,onPatch:(N,re)=>{f(Le=>({...Le??{},[au]:{...Le?.[au]??{},[N]:re}})),F(!0),K(!0),gr()}})]}),u&&(0,de.jsxs)(\"div\",{className:\"sm-card\",children:[a&&pt&&Object.keys(u.locales).length>1&&(0,de.jsxs)(Q,{variant:\"secondary\",onClick:()=>{dy()},children:[\"Remove from \",i]}),(0,de.jsx)(Q,{variant:\"danger\",onClick:eS,children:\"Delete\"})]})]})]})]})}var cl=T(te(),1);function q3(t,e,n){let r=new Map(t.map(o=>[o.name,o.record]));return e.globals.flatMap(o=>{let s=r.get(o.name),a=s?.locales[n];return!s||!a?[]:[{name:o.name,title:o.title,flavour:o.section!==void 0?\"Visual\":\"Fields\",status:ar(a),updatedAt:a.updatedAt}]})}var zs=T(O(),1);function V3({ops:t,registry:e}){let n=Qe(),[r,o]=(0,cl.useState)(null),[s,a]=(0,cl.useState)(null),[i,l]=(0,cl.useState)(()=>xs(e.locales)),{others:u}=Ao(),c=e.locales.supported.length>1,d=h=>{l(h),Vo(h)},f=(0,cl.useCallback)(()=>{t.globals.list().then(h=>h.ok?o(h.data):a(h.message)).catch(()=>a(\"Couldn't reach the server.\"))},[t]);if((0,cl.useEffect)(f,[f]),s)return(0,zs.jsx)(an,{message:s});let p=r?q3(r,e,i):[];return(0,zs.jsx)(ys,{title:\"Site\",titleTrailing:c&&(0,zs.jsx)(Ti,{locales:e.locales.supported,value:i,onChange:d}),columns:[{label:\"Title\",width:\"minmax(160px,1fr)\"},{label:\"Kind\",width:\"90px\"},{label:\"Updated\",width:\"minmax(110px,160px)\"},{label:\"Status\",width:\"170px\"}],empty:r?\"No globals are registered.\":\"Loading\\u2026\",rows:p.map(h=>({key:h.name,href:n(`/globals/${encodeURIComponent(h.name)}?locale=${encodeURIComponent(i)}`),cells:[(0,zs.jsxs)(\"span\",{className:\"sm-cell sm-cell--title\",children:[h.title,(0,zs.jsx)(Cd,{names:Eo(u,{kind:\"global\",id:h.name,locale:i})})]},\"t\"),(0,zs.jsx)(\"span\",{className:\"sm-cell sm-cell--muted\",children:h.flavour},\"k\"),(0,zs.jsx)(\"span\",{className:\"sm-cell sm-cell--muted\",children:nu(h.updatedAt)},\"u\"),(0,zs.jsx)(gs,{status:bs(h.status)},\"s\")]}))})}var at=T(te(),1);var cre={type:\"css\"},EE=(t,e)=>Object.entries(e??{}).map(([n,r])=>({key:n,ns:t,descriptor:r}));function Ig(t){let e=[{entries:EE(\"fields\",t.fields)}],n=[{entries:EE(\"settings\",t.settings)},{title:\"Spacing & layout\",entries:EE(\"styles\",t.styles)},{title:\"Advanced\",entries:t.css===!0?[{key:\"css\",ns:\"css\",descriptor:cre}]:[]}];return[[\"Content\",e],[\"Settings\",n]].map(([r,o])=>({tab:r,groups:o.filter(s=>s.entries.length>0)})).filter(r=>r.groups.length>0)}function K3(t,e){let n=e.split(\".\")[0];if(n in t.fields)return\"Content\";if(n in(t.settings??{})||n in(t.styles??{})||n===\"css\"&&t.css===!0)return\"Settings\"}var Yu=T(O(),1);function dre(t,e){return t.filter(({ns:n,descriptor:r})=>n===\"css\"||!Wr(r,{self:e[n],fields:e.fields,settings:e.settings}))}function hw(t,e){return e.ns===\"css\"?t.css:t[e.ns]?.[e.key]}function mw({groups:t,values:e,render:n}){let r={fields:e.fields,settings:e.settings};return(0,Yu.jsx)(Yu.Fragment,{children:t.map((o,s)=>{let a=dre(o.entries,e);return a.length===0?null:(0,Yu.jsxs)(\"div\",{className:\"sm-inspector__group\",children:[o.title&&(0,Yu.jsx)(Zt,{caps:!0,children:o.title}),a.map(i=>n(i,{emptyLabel:i.ns===\"styles\"?\"Default\":void 0,scope:r}))]},o.title??s)})})}var gw=T(O(),1);function fre(t){let e=n=>t[n]&&typeof t[n]==\"object\"?t[n]:{};return{fields:t,settings:e(Go),styles:e(Ss),css:typeof t[To]==\"string\"?t[To]:void 0}}function Zu({item:t,groups:e,fields:n,errors:r,refOptions:o,multilingual:s,inlinePath:a,onEditHere:i,onChange:l}){let u=fre(n);return(0,gw.jsx)(mw,{groups:e,values:u,render:({key:c,ns:d,descriptor:f},{emptyLabel:p,scope:h})=>{let g=(f.type===\"ref\"||f.type===\"refList\")&&typeof f.target==\"string\"?f.target:null,m=d===\"fields\"&&t.fields[c]?.localized===!0;return(0,gw.jsx)(Pn,{fieldKey:c,descriptor:f,value:hw(u,{key:c,ns:d,descriptor:f}),emptyLabel:p,scope:h,errors:r,refOptions:g?o[g]:void 0,mark:d===\"fields\"&&s&&!m?(0,gw.jsx)(ov,{}):void 0,inlinePath:d===\"fields\"?a:void 0,onEditHere:i,onChange:y=>l(d,c,y)},`${d}.${c}`)}})}var ye=T(O(),1);function G3({ops:t,registry:e,name:n}){let r=Qe(),o=e.globals.find($=>$.name===n),s=e.locales.supported.length>1,[a,i]=(0,at.useState)(()=>il(e)),[l,u]=(0,at.useState)(null),[c,d]=(0,at.useState)(null),[f,p]=(0,at.useState)([]),[h,g]=(0,at.useState)(null),[m,y]=(0,at.useState)({}),[b,x]=(0,at.useState)(!1),[v,S]=(0,at.useState)(!1),[E,w]=(0,at.useState)(null),[k,A]=(0,at.useState)(!1),[L,_]=(0,at.useState)(0),[P,D]=(0,at.useState)(null),[F,j]=(0,at.useState)(null),[K,ve]=(0,at.useState)(null),[ue,Ue]=(0,at.useState)([]),Re=(0,at.useRef)(null),je=(0,at.useRef)(c);je.current=c;let Ke=(0,at.useRef)(l);Ke.current=l;let M=()=>{let $=Ke.current?.locales[a];return $?Bs($):null},V={kind:\"global\",id:n,locale:a};Sd(V);let{others:I}=Ao(),U=Sa(),{saveState:me,mark:Oe,flush:X,reset:dn}=Rf({read:()=>je.current,persist:async $=>{let ge=await t.globals.save(n,a,$,M());return ge.ok?(Ke.current=ge.data,u(ge.data),U?.announce(V,ge.data.locales[a]?.draftSavedAt??null)):Yn(ge)&&ve(pr(ge)),ge},onSaved:()=>x(!1)});ld(b||me!==\"saved\");let er=(0,at.useMemo)(()=>{let $={};for(let[ge,Kt]of Object.entries(o?.fields??{}))(Kt.type===\"ref\"||Kt.type===\"refList\")&&typeof Kt.target==\"string\"&&($[ge]=Kt.target);return $},[o]),dc=(0,at.useMemo)(()=>Object.values(er),[er]),wn=Tf(t,e,a,dc);(0,at.useEffect)(()=>{let $=!1;return d(null),y({}),x(!1),ve(null),S(!1),t.globals.get(n,a).then(ge=>{$||(ge.ok?(u(ge.data.record),d(ge.data.fields),p(ge.data.usage),Ue(ge.data.liveFindings)):g({tone:\"error\",text:ge.message}))}).catch(()=>{$||g({tone:\"error\",text:\"Couldn't reach the server.\"})}),()=>{$=!0}},[t,n,a,L]);let _r=(0,at.useMemo)(()=>c&&l?.locales[a]?wv(e,n,{fields:c,shared:l.fields,own:l.locales[a].fields}):[],[c,l,a,e,n]),is=(0,at.useMemo)(()=>({...ll(_r),...m}),[_r,m]);if(!o)return(0,ye.jsx)(\"p\",{style:{padding:32},children:\"No such global item.\"});let It=l?.locales[a],bl=It?ar(It):null,mr=$=>{if(Yn($)){ve(pr($));return}$.code===\"validation\"&&$.fields&&$.fields.length>0?(y(Object.fromEntries($.fields.map(ge=>[ge.field,ge.message]))),g({tone:\"warn\",text:$.message,fields:$.fields})):g({tone:\"error\",text:$.message})},Ws=(0,at.useMemo)(()=>fv(e.elements),[e]),Ho=Object.keys(m).length>0;(0,at.useEffect)(()=>{if(!Ho||!c||!o)return;let{[Go]:$,[To]:ge,...Kt}=c,ls=YD({fields:Kt,settings:$!==null&&typeof $==\"object\"?$:{},css:ge},{fields:o.fields,settings:o.section!==void 0?o.settings:void 0},Ws);y(ke=>Cv(ke,ls)),g(ke=>{if(!ke?.fields)return ke;let uo=ke.fields.filter(Ya=>ls.some(ce=>ce.field===Ya.field));return uo.length===0?null:uo.length===ke.fields.length?ke:{...ke,fields:uo}})},[c,Ho,o,Ws]);let gr=async()=>{if(g(null),w(\"publish\"),!await X()){w(null),g({tone:\"error\",text:\"Couldn't save your latest changes \\u2014 publish cancelled.\"});return}let $;try{$=await t.globals.setStatus(n,a,\"published\",M())}catch{$={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(w(null),!$.ok){mr($);return}u($.data),U?.announce(V,$.data.locales[a]?.draftSavedAt??null),y({}),A(!0),setTimeout(()=>A(!1),1600)},lo=async()=>{g(null),w(\"unpublish\");let $;try{$=await t.globals.setStatus(n,a,\"draft\")}catch{$={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}w(null),$.ok?u($.data):mr($)},Xa=async()=>{if(!await rt({...eu,subject:{name:o.title}}))return;if(g(null),w(\"discard\"),!await X()){w(null),g({tone:\"error\",text:\"Couldn't save your latest changes \\u2014 discard cancelled.\"});return}let $;try{$=await t.globals.discardDraft(n,a,M())}catch{$={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(w(null),!$.ok){mr($);return}u($.data),U?.announce(V,$.data.locales[a]?.draftSavedAt??null),_(ge=>ge+1),g({tone:\"ok\",text:\"Changes discarded.\"})},$o=async()=>{if(!It)return;if(!await X()){g({tone:\"error\",text:\"Couldn't save your latest changes \\u2014 history not opened.\"});return}let $=await t.globals.listVersions(n,a);if(!$.ok){mr($);return}j(null),D(Of($.data,It))},fc=async $=>{let ge=await t.globals.getVersion(n,$);ge.ok?j({id:ge.data.id,fields:ge.data.fields}):mr(ge)},Xs=()=>{ve(null),dn(),_($=>$+1)};kd(V,$=>{K||(b||me!==\"saved\"?ve({by:$.email,at:Date.now()}):_(ge=>ge+1))});let Js=async $=>{let ge=await t.globals.restore(n,a,$,M());return ge.ok?(u(ge.data),U?.announce(V,ge.data.locales[a]?.draftSavedAt??null),_(Kt=>Kt+1),g({tone:\"ok\",text:\"Version restored.\"}),!0):(mr(ge),!1)},vl=async $=>{if($!==a){if(!await X()){g({tone:\"error\",text:\"Couldn't save your latest changes \\u2014 stayed on this locale.\"});return}Wu($),g(null),i($)}},Or=new Set(f.filter($=>$.sourceKind===\"page\").map($=>$.sourceId)),xl=Ig(o),pt=xl.find($=>$.tab===\"Content\")?.groups??[],Dr=xl.find($=>$.tab===\"Settings\")?.groups??[],wl=($,ge,Kt)=>{d(ls=>{let ke=ls??{};if($===\"fields\")return{...ke,[ge]:Kt};if($===\"css\"){let{[To]:Ya,...ce}=ke;return Kt===void 0||Kt===\"\"?ce:{...ce,[To]:Kt}}let uo=$===\"settings\"?Go:Ss;return{...ke,[uo]:{...ke[uo]??{},[ge]:Kt}}}),x(!0),S(!0),Oe()},Ja=$=>$.startsWith(\"settings.\")?`${Go}.${$.slice(9)}`:$.startsWith(\"styles.\")?`${Ss}.${$.slice(7)}`:$,Un=$=>{d(ge=>Zi(ge??{},Ja($))),x(!0),S(!0),Oe()};return(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(ko,{left:(0,ye.jsx)(ye.Fragment,{children:(0,ye.jsx)(fd,{backHref:r(\"/globals\"),items:[{label:\"Site\",href:r(\"/globals\"),trailing:s&&(0,ye.jsx)(md,{registry:e,present:e.locales.supported,parentLocales:[],value:a,adding:!1,onSwitch:$=>{vl($)},onAdd:()=>{}})},{label:o.title}]})}),right:(0,ye.jsxs)(ye.Fragment,{children:[(v||me===\"error\"||me===\"refused\")&&(0,ye.jsx)(Yl,{state:me,pending:b}),(0,ye.jsx)(al,{status:bl,pending:b||me!==\"saved\",busy:E,flash:k,disabled:!It,onPublish:()=>{gr()},onUnpublish:()=>{lo()},onDiscard:()=>{Xa()},onHistory:()=>{$o()}})]})}),P&&It&&(0,ye.jsx)(Df,{rows:P,draftId:It.draftVersionId,onSelect:$=>{fc($)},onClose:()=>D(null),onRestore:Js,render:$=>F?.id===$?(0,ye.jsxs)(\"fieldset\",{disabled:!0,className:\"sm-history__form\",children:[(0,ye.jsx)(Zu,{item:o,groups:pt,fields:F.fields,refOptions:wn,multilingual:s,onChange:()=>{}}),Dr.length>0&&(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Zt,{children:\"Settings\"}),(0,ye.jsx)(Zu,{item:o,groups:Dr,fields:F.fields,refOptions:wn,multilingual:s,onChange:()=>{}})]})]}):(0,ye.jsx)(\"p\",{className:\"sm-hint\",style:{padding:16},children:\"Loading\\u2026\"})}),(0,ye.jsx)(zf,{names:Eo(I,V),noun:\"item\"}),K&&(0,ye.jsx)(Pf,{info:K,onReload:Xs}),(0,ye.jsx)(Bf,{draft:_r,live:ue}),(0,ye.jsxs)(\"div\",{className:\"sm-editor\",inert:K?!0:void 0,children:[(0,ye.jsxs)(\"div\",{className:\"sm-form\",ref:Re,children:[h&&(0,ye.jsxs)(Me,{tone:h.tone,onDismiss:()=>g(null),revealKey:`${h.tone}:${h.text}`,children:[(0,ye.jsx)(\"p\",{style:{margin:0},children:h.text}),(0,ye.jsx)(pd,{fields:h.fields??[],onReveal:$=>{Re.current&&Vu(Re.current,$)}})]}),l&&(0,ye.jsxs)(\"p\",{className:\"sm-hint\",children:[Or.size===0?\"Not placed on any page yet.\":`Used on ${Or.size} page${Or.size===1?\"\":\"s\"}: `,[...Or].map(($,ge)=>(0,ye.jsxs)(\"span\",{children:[ge>0&&\", \",(0,ye.jsx)(\"a\",{href:r(`/pages/${encodeURIComponent($)}?locale=${encodeURIComponent(a)}`),children:$})]},$))]}),c!==null?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Zu,{item:o,groups:pt,fields:c,errors:is,refOptions:wn,multilingual:s,onChange:wl}),Dr.length>0&&(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Zt,{children:\"Settings\"}),(0,ye.jsx)(Zu,{item:o,groups:Dr,fields:c,errors:is,refOptions:wn,multilingual:s,onChange:wl})]}),(0,ye.jsx)(ul,{orphans:_r,onClear:Un})]}):!h&&(0,ye.jsx)(\"p\",{style:{color:\"var(--text-muted)\"},children:\"Loading\\u2026\"})]}),(0,ye.jsx)(Nf,{}),(0,ye.jsx)(\"aside\",{className:\"sm-inspector\",children:l&&It&&(0,ye.jsxs)(\"div\",{className:\"sm-card\",children:[(0,ye.jsx)(Zt,{children:\"Document info\"}),(0,ye.jsx)(Kr,{label:\"Kind\",value:o.section!==void 0?`Visual \\xB7 ${o.section}`:\"Fields\"}),(0,ye.jsx)(Kr,{label:\"Updated\",value:Ad(It.updatedAt,It.updatedBy)}),(0,ye.jsx)(Kr,{label:\"ID\",value:l.id,mono:!0})]})})]})]})}var Y=T(te(),1);var W3=T(te(),1);var mt=T(O(),1),pre=14;function X3({emptyZones:t,hoverRect:e,hoverGlobal:n,selection:r,plusButtons:o,fieldHover:s,editing:a,onPlus:i,onMove:l,onDuplicate:u,onRemove:c}){let[d,f]=(0,W3.useState)(null);return(0,mt.jsxs)(\"div\",{style:{position:\"absolute\",inset:0,pointerEvents:\"none\"},children:[t.map(p=>(0,mt.jsxs)(\"div\",{className:\"sm-dashed\",style:{position:\"absolute\",left:p.x+12,top:p.y,width:Math.max(0,p.w-24),height:Math.max(56,p.h)},children:[p.zone,\" \\xB7 empty\"]},`empty-${p.zone}`)),e&&(0,mt.jsx)(\"div\",{style:{position:\"absolute\",left:e.x,top:e.y,width:e.w,height:e.h,outline:`1.5px solid color-mix(in srgb, var(${n?\"--selection-global\":\"--selection\"}) 45%, transparent)`,outlineOffset:-1.5,borderRadius:\"var(--selection-radius)\"}}),s&&!(a&&a.node===s.node&&a.path===s.path)&&(0,mt.jsx)(\"div\",{className:\"sm-fieldhover\",style:{position:\"absolute\",left:s.x,top:s.y,width:s.w,height:s.h}}),a&&(0,mt.jsx)(\"div\",{className:\"sm-fieldedit\",style:{position:\"absolute\",left:a.x,top:a.y,width:a.w,height:a.h}}),r&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(\"div\",{style:{position:\"absolute\",left:r.rect.x,top:r.rect.y,width:r.rect.w,height:r.rect.h,outline:r.global?\"var(--outline-selection-global)\":\"var(--outline-selection)\",outlineOffset:-1.5,borderRadius:\"var(--selection-radius)\"}}),(0,mt.jsxs)(\"span\",{className:Ie(\"sm-blocktag\",r.global&&\"sm-blocktag--global\",r.rect.y<pre&&\"sm-blocktag--inside\"),style:{position:\"absolute\",left:r.rect.x,top:r.rect.y},children:[r.title,r.global&&\" \\xB7 global\",r.locked&&\" \\xB7 locked\"]}),!r.layout&&(0,mt.jsx)(\"div\",{className:\"sm-blocktoolbar\",style:{position:\"absolute\",left:r.rect.x+r.rect.w-8,top:r.rect.y+8,transform:\"translateX(-100%)\",pointerEvents:\"auto\"},children:r.locked?(0,mt.jsx)(\"span\",{className:\"sm-blocktoolbar__note\",children:\"fields only\"}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(nt,{label:\"Move up\",tone:\"inverse\",onClick:()=>l(r.node.id,-1),children:\"\\u2191\"}),(0,mt.jsx)(nt,{label:\"Move down\",tone:\"inverse\",onClick:()=>l(r.node.id,1),children:\"\\u2193\"}),(0,mt.jsx)(nt,{label:\"Duplicate\",tone:\"inverse\",onClick:()=>u(r.node),children:\"\\u29C9\"}),(0,mt.jsx)(nt,{label:\"Remove\",tone:\"inverse\",onClick:()=>c(r.node.id),children:\"\\xD7\"})]})})]}),o.map(p=>{let h=`${p.zone}-${p.index}`,g=d===h;return(0,mt.jsxs)(\"div\",{style:{position:\"absolute\",left:0,right:0,top:p.y},children:[g&&(0,mt.jsx)(\"div\",{className:\"sm-guide\",style:{margin:\"0 12px\"}}),(0,mt.jsx)(\"div\",{style:{position:\"absolute\",left:\"50%\",top:0,transform:\"translate(-50%,-50%)\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:6,pointerEvents:\"auto\"},children:(0,mt.jsxs)(\"button\",{className:\"sm-plus\",\"aria-label\":`Add to ${p.zone}`,onMouseEnter:()=>f(h),onMouseLeave:()=>f(m=>m===h?null:m),onClick:m=>i(p,m.clientX,m.clientY),children:[(0,mt.jsx)(\"span\",{className:\"sm-plus__icon\",children:\"+\"}),(0,mt.jsx)(\"span\",{className:\"sm-plus__label\",children:\"Add section\"})]})})]},h)})]})}var Qu=T(te(),1),Y3=T(Tl(),1);var yw=T(O(),1),hre=340,mre=10,gre=56;function J3({x:t,top:e,bottom:n,pageWidth:r,allowed:o,active:s,canInsert:a,onCommand:i,popover:l}){let u=Math.max(8,Math.min(t,r-hre-8)),d=e<gre?{left:u,top:n+8}:{left:u,top:e-mre,transform:\"translateY(-100%)\"};return(0,yw.jsxs)(\"div\",{className:\"sm-floatbar\",style:d,children:[(0,yw.jsx)(_x,{allowed:o,active:s,canInsert:a,onCommand:i}),l]})}var Fs=T(O(),1);function Z3({mount:t,value:e,toolset:n,pageWidth:r,onChange:o,onEscape:s}){let a=lw({value:e,toolset:n,onChange:o,contentClass:\"sm-inline-richtext\",onEscape:s}),{editor:i}=a,l=(0,Qu.useMemo)(()=>Ii(n).elements,[n]),u=(0,Qu.useMemo)(()=>({path:t.session.path,canvas:!0,elements:l}),[t.session.path,l]);(0,Qu.useEffect)(()=>{if(!i)return;let p=t.at?i.view.posAtCoords({left:t.at.x,top:t.at.y})?.pos:void 0;i.commands.focus(p??\"end\")},[i,t.at]),(0,Qu.useEffect)(()=>{if(!i)return;let p=i.view.dom;for(let h=p.parentElement;h&&h!==t.root;h=h.parentElement)h.style.display=\"contents\";for(let[h,g]of Object.entries(t.layout))p.style.setProperty(h,g)},[i,t.root,t.layout]),(0,Qu.useEffect)(()=>{i?.setEditable(!t.closing)},[i,t.closing]);let c=Jm({editor:i,selector:({editor:p})=>p?.state.selection.from??null}),d=i&&c!==null&&i.view.dom.isConnected?i.view.coordsAtPos(c):null,f=a.slash?.state.rect??null;return(0,Fs.jsxs)(Px,{value:u,children:[(0,Y3.createPortal)((0,Fs.jsx)(Xm,{editor:i}),t.root),!t.closing&&d&&(0,Fs.jsx)(J3,{x:d.left,top:d.top,bottom:d.bottom,pageWidth:r,allowed:a.allowed,active:a.active,canInsert:a.canInsert,onCommand:a.run,popover:a.menu.open?(0,Fs.jsx)(Ox,{menu:a.menu}):a.link.open?(0,Fs.jsx)(Dx,{link:a.link}):null}),!t.closing&&a.slash&&(0,Fs.jsx)(\"div\",{className:\"sm-richtext__slash\",style:{left:f?.left??0,top:(f?.bottom??0)+4,pointerEvents:\"auto\"},children:(0,Fs.jsx)(Qd,{items:a.slash.state.items,active:a.slash.active,onPick:p=>a.slash?.state.pick(p)})}),a.picker.open&&(0,Fs.jsx)(Gi,{kinds:[\"image\"],onPick:a.picker.pick,onClose:a.picker.close})]})}var Ff=T(te(),1);var Q3=t=>t.custom,eU=t=>t?.kind===\"freeform\"&&t.custom===!0;function tU(t,e){return{id:e,type:ws,fields:structuredClone(t.custom.sample??{rows:[]})}}var nU=t=>ED(t.fields?.rows);var Lt=T(O(),1),yre=300,bw=12,rU=24;function oU(t,e,n){let r=Math.max(bw,Math.min(t.x,n.width-yre-bw)),o=n.height-bw-t.y,s=t.y-rU-bw;return e<=o||o>=s?{left:r,top:t.y,maxHeight:Math.max(o,0)}:{left:r,bottom:n.height-(t.y-rU),maxHeight:s}}function bre(t){return typeof window>\"u\"?{left:t.x,top:t.y}:oU(t,0,{width:window.innerWidth,height:window.innerHeight})}function sU({at:t,policy:e,registry:n,globalIds:r,onInsert:o,onInsertGlobal:s,onInsertCustom:a,onClose:i}){let l=G0(e,n.sections),u=$H(e,n.globals,r),c=eU(e),d=(0,Ff.useRef)(null),[f,p]=(0,Ff.useState)(()=>bre(t));return(0,Ff.useLayoutEffect)(()=>{let h=d.current;h&&p(oU(t,h.scrollHeight+2,{width:window.innerWidth,height:window.innerHeight}))},[t]),(0,Lt.jsx)(\"div\",{style:{position:\"fixed\",inset:0,zIndex:60},onClick:i,children:(0,Lt.jsxs)(\"div\",{ref:d,className:\"sm-picker\",onClick:h=>h.stopPropagation(),style:{position:\"absolute\",overflowY:\"auto\",...f},children:[(0,Lt.jsxs)(Zt,{caps:!0,style:{padding:\"6px 8px 8px\"},children:[\"Add to \",t.zone]}),l.map(h=>(0,Lt.jsxs)(\"button\",{type:\"button\",className:\"sm-picker__item\",onClick:()=>o(h),children:[(0,Lt.jsx)(\"span\",{className:\"sm-picker__icon\",children:h.icon??\"\\u25A4\"}),(0,Lt.jsxs)(\"span\",{style:{minWidth:0},children:[(0,Lt.jsx)(\"span\",{style:{display:\"block\",fontWeight:600},children:h.title}),h.description&&(0,Lt.jsx)(\"span\",{style:{display:\"block\",fontSize:\"var(--text-sm)\",color:\"var(--text-muted)\"},children:h.description})]})]},h.name)),c&&(0,Lt.jsxs)(\"button\",{type:\"button\",className:\"sm-picker__item\",onClick:a,children:[(0,Lt.jsx)(\"span\",{className:\"sm-picker__icon\",children:\"\\u25A6\"}),(0,Lt.jsxs)(\"span\",{style:{minWidth:0},children:[(0,Lt.jsx)(\"span\",{style:{display:\"block\",fontWeight:600},children:n.custom.title}),(0,Lt.jsx)(\"span\",{style:{display:\"block\",fontSize:\"var(--text-sm)\",color:\"var(--text-muted)\"},children:n.custom.description})]})]}),u.length>0&&(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(Zt,{caps:!0,style:{padding:\"8px 8px 4px\"},children:\"Site\"}),u.map(h=>(0,Lt.jsxs)(\"button\",{type:\"button\",className:\"sm-picker__item\",onClick:()=>s(h),children:[(0,Lt.jsx)(\"span\",{className:\"sm-picker__icon\",children:\"\\u26D3\"}),(0,Lt.jsxs)(\"span\",{style:{minWidth:0},children:[(0,Lt.jsx)(\"span\",{style:{display:\"block\",fontWeight:600},children:h.title}),(0,Lt.jsx)(\"span\",{style:{display:\"block\",fontSize:\"var(--text-sm)\",color:\"var(--text-muted)\"},children:\"Global \\xB7 edited in one place\"})]})]},`global-${h.name}`))]}),l.length===0&&u.length===0&&!c&&(0,Lt.jsx)(\"p\",{style:{color:\"var(--text-muted)\",padding:10},children:\"This zone doesn't accept insertions.\"})]})})}var Mg=T(O(),1);function vw({children:t}){let e=Qe();return(0,Mg.jsx)(\"div\",{style:{display:\"grid\",placeItems:\"center\",flex:1,padding:40,background:\"var(--bg)\"},children:(0,Mg.jsxs)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:12,maxWidth:420},children:[t,(0,Mg.jsx)(\"a\",{href:e(\"/pages\"),children:\"\\u2190 Back to pages\"})]})})}var At=T(O(),1);function aU({zones:t,...e}){return(0,At.jsxs)(At.Fragment,{children:[(0,At.jsx)(Zt,{children:\"Page Outline\"}),t.map(n=>(0,At.jsx)(vre,{...n,...e},n.zone))]})}function vre({zone:t,locked:e,canTake:n,nodes:r,removed:o,note:s,selectedId:a,onSelect:i,onAddFirst:l,onMoveTo:u,onRemove:c,onClearZone:d}){let f=vs({count:e||o?0:r.length,onDrop:(p,h)=>u(r[p].node.id,h)});return o?(0,At.jsx)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:4},\"data-testid\":\"removed-zone\",children:(0,At.jsxs)(\"div\",{className:\"sm-outline-row sm-outline-row--orphan sm-outline-row--removed\",children:[(0,At.jsxs)(\"span\",{className:\"sm-outline-row__label\",children:[\"Removed zone `\",t,\"` \\xB7 \",r.length,\" \",r.length===1?\"section\":\"sections\"]}),(0,At.jsx)(Q,{variant:\"danger\",size:\"sm\",onClick:()=>d?.(t),children:\"Clear zone\"})]})}):(0,At.jsxs)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:4},children:[(0,At.jsxs)(Zt,{caps:!0,children:[t,e&&\" \\xB7 locked\"]}),s&&(0,At.jsx)(\"p\",{className:\"sm-outline-note\",children:s}),r.length===0&&(0,At.jsxs)(\"div\",{className:Ie(\"sm-outline-row\",\"sm-outline-row--empty\",n&&\"sm-outline-row--clickable\"),onClick:()=>{n&&l(t)},children:[(0,At.jsx)(\"span\",{className:\"sm-outline-row__label\",children:\"Empty\"}),n&&(0,At.jsx)(\"span\",{className:\"sm-outline-row__add\",children:\"+ Add\"})]}),e&&r.map(({node:p,label:h,mark:g})=>(0,At.jsxs)(\"div\",{className:Ie(\"sm-outline-row sm-outline-row--locked sm-outline-row--clickable\",g&&`sm-outline-row--${g}`),\"data-testid\":\"outline-row\",onClick:()=>i(p.id),children:[(0,At.jsx)(\"span\",{className:\"sm-outline-row__label\",children:h}),(0,At.jsx)(\"span\",{className:\"sm-outline-row__note\",children:\"Locked\"})]},p.id)),!e&&r.length>0&&(0,At.jsx)(\"div\",{ref:f.containerRef,style:{display:\"flex\",flexDirection:\"column\",gap:4},children:r.map(({node:p,label:h,mark:g},m)=>(0,At.jsxs)(\"div\",{onClick:()=>i(p.id),style:f.rowStyle(m),\"data-testid\":\"outline-row\",className:Ie(\"sm-outline-row\",\"sm-outline-row--clickable\",\"sm-outline-row--grip\",p.id===a&&\"sm-outline-row--selected\",g&&`sm-outline-row--${g}`,f.rowClass(m)),children:[(0,At.jsx)(Ei,{...f.handleProps(m)}),(0,At.jsx)(\"span\",{className:\"sm-outline-row__label\",children:h}),(0,At.jsx)(nt,{label:\"Remove\",size:22,onClick:y=>{y.stopPropagation(),c(p.id)},children:\"\\xD7\"})]},p.id))})]})}var xw=T(te(),1);var ec=T(te(),1);var rn=T(O(),1);function iU({record:t,locale:e,registry:n,path:r,fixed:o,redirects:s,onRename:a}){let i=t.locales[e],[l,u]=(0,ec.useState)({title:i?.title??\"\",slug:i?.slug??\"\"}),[c,d]=(0,ec.useState)(null),f=Qe(),p=(0,ec.useRef)(!1),h=t.parentId===null&&t.locales[n.locales.default]?.slug===n.homePageSlug;if((0,ec.useEffect)(()=>{u({title:i?.title??\"\",slug:i?.slug??\"\"})},[t,e]),!i)return null;let g=async y=>{if(!p.current){p.current=!0;try{d(null);let b=y===\"slug\"?xa(l.slug):l[y];if(b!==l[y]&&u(v=>({...v,[y]:b})),b===i[y])return;if(b===\"\"){d(`A ${y} is required \\u2014 nothing falls back to another locale.`);return}let x=!0;if(y===\"slug\"){let v=await nm({status:i.status,from:i.slug,to:b},{name:i.title,path:r},Zh(r??null,n,e));if(!v.ok){u(S=>({...S,slug:i.slug}));return}x=v.redirect}d(await a(y===\"slug\"?{slug:b,redirect:x}:{title:b}))}finally{p.current=!1}}},m=y=>b=>{b.key===\"Enter\"&&(b.preventDefault(),g(y))};return(0,rn.jsxs)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:14},children:[(0,rn.jsxs)(Zt,{children:[\"Page \\xB7 \",e]}),o&&(0,rn.jsx)(\"span\",{className:\"sm-hint\",children:\"Owned by code \\u2014 change it in the registration.\"}),c&&(0,rn.jsx)(\"span\",{className:\"sm-error\",children:c}),(0,rn.jsx)(xe,{label:\"Title\",children:(0,rn.jsx)(\"input\",{className:\"sm-input\",disabled:o,value:l.title,onChange:y=>u(b=>({...b,title:y.target.value})),onBlur:()=>{g(\"title\")},onKeyDown:m(\"title\")})}),(0,rn.jsx)(xe,{label:\"Slug\",hint:r??\"\",children:(0,rn.jsx)(\"input\",{className:\"sm-input sm-input--mono\",disabled:o||h,value:l.slug,onChange:y=>u(b=>({...b,slug:y.target.value})),onBlur:()=>{g(\"slug\")},onKeyDown:m(\"slug\")})}),s&&s.length>0&&(0,rn.jsx)(xe,{label:\"Redirects from\",asDiv:!0,hint:(0,rn.jsxs)(rn.Fragment,{children:[\"Old addresses that send visitors here. Manage them in \",(0,rn.jsx)(qn,{href:f(\"/settings/redirects\"),children:\"Settings \\u203A Redirects\"}),\".\"]}),children:(0,rn.jsx)(\"div\",{className:\"sm-redirects-from\",children:s.map(y=>(0,rn.jsx)(\"code\",{children:y},y))})}),(0,rn.jsx)(Zt,{children:\"Document info\"}),(0,rn.jsx)(Kr,{label:\"Updated\",value:Ad(i.updatedAt,i.updatedBy)}),(0,rn.jsx)(Kr,{label:\"ID\",value:t.id,mono:!0})]})}var zn=T(O(),1);function lU(t){return t?.seo?[\"SEO & Social\",\"Settings\"]:[\"Settings\"]}function uU({record:t,locale:e,registry:n,tree:r,path:o,fixed:s,redirects:a,drift:i=[],onRename:l,onRemoveLocale:u,onPatch:c,onClearPageField:d}){let f=n.pages.find(b=>b.name===t.template),p=lU(f),[h,g]=(0,xw.useState)(p[0]);(0,xw.useEffect)(()=>{g(lU(f)[0])},[t.id]);let m=p.includes(h)?h:p[0],y=t.locales[e]?.title??\"\";return(0,zn.jsxs)(zn.Fragment,{children:[(0,zn.jsx)(\"div\",{className:\"sm-inspector__head\",children:(0,zn.jsxs)(\"span\",{style:{display:\"flex\",alignItems:\"center\",gap:8,minWidth:0},children:[(0,zn.jsx)(\"span\",{className:\"sm-pageglyph\"}),(0,zn.jsx)(\"span\",{className:\"sm-title\",style:{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\"},children:y})]})}),p.length>1&&(0,zn.jsx)(Yh,{tabs:p,value:m,onChange:g}),(0,zn.jsx)(\"div\",{className:\"sm-inspector__body\",children:m===\"SEO & Social\"?(0,zn.jsx)(pw,{meta:r?.meta??{},onPatch:(b,x)=>c(\"meta\",b,x)}):(0,zn.jsxs)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:14},children:[(0,zn.jsx)(iU,{record:t,locale:e,registry:n,path:o,fixed:s,redirects:a,onRename:l}),Object.entries(f?.fields??{}).map(([b,x])=>(0,zn.jsx)(Pn,{fieldKey:b,descriptor:x,value:r?.fields?.[b],errors:ll(i,\"page.fields\"),onChange:v=>c(\"fields\",b,v)},b)),d&&(0,zn.jsx)(ul,{orphans:i,strip:\"page.fields\",onClear:d}),u&&(0,zn.jsxs)(Q,{variant:\"secondary\",onClick:u,children:[\"Remove from \",e]})]})})]})}var rs=T(O(),1);function cU({item:t,edit:e,locale:n,groups:r,multilingual:o,refOptions:s,inlinePath:a,onEditHere:i,onChange:l,pending:u,busy:c,onPublish:d,onDiscard:f,onUnpublish:p,tabs:h}){let g=Qe(),m=e?.record.locales[n],y=m?ar(m):\"draft\",b=e?[...new Set(e.usage.filter(x=>x.sourceKind===\"page\").map(x=>x.sourceId))]:[];return(0,rs.jsxs)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:12},children:[(0,rs.jsx)(\"p\",{className:\"sm-hint\",children:\"Global content \\u2014 changes every page it is used on.\"}),b.length>0&&(0,rs.jsxs)(\"p\",{className:\"sm-hint\",children:[`Used on ${b.length} page${b.length===1?\"\":\"s\"}: `,b.map((x,v)=>(0,rs.jsxs)(\"span\",{children:[v>0&&\", \",(0,rs.jsx)(\"a\",{href:g(`/pages/${encodeURIComponent(x)}?locale=${encodeURIComponent(n)}`),children:x})]},x))]}),(0,rs.jsx)(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"flex-end\",gap:8,flexWrap:\"wrap\"},children:(0,rs.jsx)(al,{status:m?y:null,pending:u,busy:c,disabled:!e,compact:!0,onPublish:d,onDiscard:f,onUnpublish:p})}),h,e?(0,rs.jsx)(Zu,{item:t,groups:r,fields:e.fields,errors:e.errors,refOptions:s,multilingual:o,inlinePath:a,onEditHere:i,onChange:l}):(0,rs.jsx)(\"p\",{style:{color:\"var(--text-muted)\"},children:\"Loading\\u2026\"})]})}function dU({zoneOrder:t,canTake:e,nodesIn:n,rects:r,emptyZones:o}){let s=[];for(let a of t){if(!e(a))continue;let i=n(a).map((l,u)=>({rect:r.get(l.id),treeIndex:u})).filter(l=>!!l.rect);if(i.length===0){let l=o.find(u=>u.zone===a);l&&s.push({zone:a,index:0,y:l.y+l.h/2})}else i.forEach(({rect:l,treeIndex:u},c)=>{s.push({zone:a,index:u,y:l.y-1}),c===i.length-1&&s.push({zone:a,index:u+1,y:l.y+l.h+1})})}return s}var un=T(te(),1);function fU(t,e,n){if(!e||t.source!==e||t.origin!==n)return null;let r=t.data;return typeof r==\"object\"&&r?.source===\"smoodly\"?r:null}var xre=4e3;function pU({iframeRef:t,iframeSrc:e,onSelect:n,onHover:r,onRendered:o}){let[s,a]=(0,un.useState)([]),[i,l]=(0,un.useState)([]),[u,c]=(0,un.useState)([]),[d,f]=(0,un.useState)([]),[p,h]=(0,un.useState)(900),[g,m]=(0,un.useState)(\"waiting\"),[y,b]=(0,un.useState)(!1),x=(0,un.useRef)({onSelect:n,onHover:r,onRendered:o});x.current={onSelect:n,onHover:r,onRendered:o};let v=(0,un.useRef)(!1),S=(0,un.useRef)(!1);(0,un.useEffect)(()=>{m(\"waiting\"),b(!1),a([]),l([]),c([]),f([]),v.current=!1,S.current=!1},[e]);let E=(0,un.useCallback)(k=>{k.kind===\"refresh\"&&!v.current&&(S.current=!0),t.current?.contentWindow?.postMessage(k,window.location.origin)},[t]);(0,un.useEffect)(()=>{let k=A=>{let L=fU(A,t.current?.contentWindow,window.location.origin);L&&(m(\"ok\"),v.current||(v.current=!0,S.current&&(S.current=!1,E({source:\"smoodly\",kind:\"refresh\"}))),L.kind===\"rects\"?(a(L.nodes),l(L.emptyZones),c(L.fields),h(L.docH),f(L.crashed??[])):L.kind===\"select\"?x.current.onSelect(L.id,L.path,L.x,L.y):L.kind===\"hover\"?x.current.onHover(L.id,L.path):L.kind===\"rendered\"&&x.current.onRendered())};return window.addEventListener(\"message\",k),()=>window.removeEventListener(\"message\",k)},[t,E]),(0,un.useEffect)(()=>{if(!e||!y||g!==\"waiting\")return;let k=setTimeout(()=>m(A=>A===\"waiting\"?\"missing\":A),xre);return()=>clearTimeout(k)},[e,y,g]);let w=(0,un.useCallback)(()=>b(!0),[]);return{rects:s,emptyZones:i,fields:u,docH:p,geometry:g,postToCanvas:E,onFrameLoad:w,crashed:d}}var ww=T(te(),1);var wre=\"smoodly-draft\",Sre=\"data-smoodly-bridge\";async function hU(t,e){return{kind:\"response\",requested:t,url:e.url||t,status:e.status,redirected:e.redirected,html:await e.text(),frameOptions:e.headers.get(\"x-frame-options\"),csp:e.headers.get(\"content-security-policy\")}}function mU(t){if(t.kind===\"failed\")return{kind:\"unreachable\"};if(t.redirected)return{kind:\"redirect\",to:kre(t.url,t.requested)};if(t.status===404)return{kind:\"notFound\"};if(t.status>=500)return{kind:\"crashed\",status:t.status};if(t.status<200||t.status>299)return{kind:\"refused\",status:t.status};if(!t.html.includes(`name=\"${wre}\"`))return{kind:\"shadowed\"};if(!t.html.includes(`${Sre}=`))return{kind:\"noSearchParams\"};let e=Cre(t.frameOptions,t.csp,new URL(t.requested).origin);return e?{kind:\"framing\",...e}:{kind:\"script\"}}function kre(t,e){let n=new URL(t);return n.searchParams.delete(\"smoodly-editor\"),n.origin===new URL(e).origin?n.pathname+n.search:n.href}function Cre(t,e,n){if(t?.trim().toLowerCase()===\"deny\")return{header:\"X-Frame-Options\",value:t};let r=e?.split(\";\").map(a=>a.trim()).find(a=>/^frame-ancestors(\\s|$)/i.test(a));return r?r.split(/\\s+/).slice(1).some(a=>a.toLowerCase()===\"'self'\"||a===\"*\"||a.replace(/\\/$/,\"\")===n)?null:{header:\"Content-Security-Policy\",value:r}:null}function gU(t,e){switch(t.kind){case\"shadowed\":return{editor:`This page can't be shown here \\u2014 another route in the site's code answers ${e}.`,developer:`A route other than Smoodly's catch-all answers ${e} (the response has no Smoodly draft marker). Rename the page, or move or remove that route.`};case\"noSearchParams\":return{editor:\"This page can't be shown in the editor \\u2014 its route is missing a setting.\",developer:`Smoodly rendered ${e} without the editor bridge. The route file must pass searchParams: renderSmoodlyPath(path, { searchParams }).`};case\"crashed\":return{editor:\"This page failed to render.\",developer:`${e} answered ${t.status}. The server log has the error \\u2014 often the page shape, or a component inside a section, throwing.`};case\"notFound\":return{editor:`Nothing on the site answers ${e}.`,developer:`${e} answered 404. Check that the locale is in the app's routing and that the catch-all route file is in place.`};case\"redirect\":return{editor:`${e} sends visitors to another address, so this page can't be shown.`,developer:`${e} redirects to ${t.to}. Check middleware and the i18n routing.`};case\"refused\":return{editor:`The site refused to show ${e}.`,developer:`${e} answered ${t.status}. Middleware or the host refused the request; the draft-mode cookie must reach the page.`};case\"framing\":return{editor:\"The site doesn't allow its pages to be shown inside the editor.\",developer:`${e} sends ${t.header}: ${t.value}, which blocks the canvas iframe. Allow the site's own origin (SAMEORIGIN, frame-ancestors 'self').`};case\"script\":return{editor:\"The page loaded but didn't connect to the editor.\",developer:`${e} rendered with the editor bridge, but its script never reached the editor. Look for an error in the canvas's browser console.`};case\"unreachable\":return{editor:\"The site didn't answer.\",developer:`The request for ${e} failed before any response \\u2014 is the site running? A redirect to another origin fails this way too.`}}}function yU(t,e){let[n,r]=(0,ww.useState)(null);return(0,ww.useEffect)(()=>{if(r(null),!t||e!==\"missing\")return;let o=!0,s=new URL(t,window.location.href);return fetch(s.href,{cache:\"no-store\"}).then(a=>hU(s.href,a)).catch(()=>({kind:\"failed\"})).then(a=>{o&&r({cause:mU(a),path:s.pathname})}),()=>{o=!1}},[t,e]),n}var Hf=T(O(),1);function bU({cause:t,path:e}){let{editor:n,developer:r}=gU(t,e);return(0,Hf.jsxs)(Me,{tone:\"warn\",children:[(0,Hf.jsx)(\"p\",{children:n}),(0,Hf.jsxs)(\"p\",{children:[(0,Hf.jsx)(\"strong\",{children:\"For your developer:\"}),\" \",r]})]})}function vU(t,e){return t.map(({id:n,live:r})=>r===\"left-out\"?`\\u201C${e(n)}\\u201D failed to render in the preview \\u2014 on the live site it is left out.`:`\\u201C${e(n)}\\u201D failed to render in the preview \\u2014 on the live site the whole page would fail to load.`)}function xU(t){let e=t.length;return{title:e===1?\"Publish with 1 broken section?\":`Publish with ${e} broken sections?`,body:[...t,`Fix or remove ${e===1?\"it\":\"them\"} in the editor, or publish anyway.`].join(\" \"),confirmLabel:\"Publish anyway\"}}var ft=T(te(),1);var wU=\"data-smd-node\";var Lre=\"data-smd-blank\",Hwe=`html{overflow:hidden}[${wU}][${Lre}]{min-height:7rem}`,TE=\"data-smd-field\",Are=\"data-smd-item\",RE=\"data-smd-editor\";function SU(t){let e=t.getAttribute(TE);if(!e)return null;let n=[e];for(let r=t;r;r=r.parentElement){let o=r.getAttribute(wU);if(o)return{node:o,path:n.join(\".\")};let s=r.getAttribute(Are);s&&n.unshift(s)}return null}var IE=t=>t.childElementCount===0;function kU(t,e){if(!IE(t))return!1;let n=t.firstChild;return n&&n.nodeType===3&&n.nextSibling===null?n.nodeValue!==e&&(n.nodeValue=e):t.textContent=e,!0}var Ere=[\"display\",\"flex-direction\",\"gap\",\"row-gap\",\"column-gap\",\"grid-template-columns\",\"grid-auto-flow\",\"align-items\",\"justify-content\"];function CU(t){let e=t.getPropertyValue(\"display\");if(e!==\"flex\"&&e!==\"grid\")return{};let n={};for(let r of Ere){let o=t.getPropertyValue(r);o&&(n[r]=o)}return n}var Sw={session:null,pendingRefresh:!1};function LU(t,e){switch(e.type){case\"start\":return{state:{session:e.session,pendingRefresh:t.pendingRefresh},refresh:!1};case\"end\":return t.session?{state:Sw,refresh:t.pendingRefresh}:{state:t,refresh:!1};case\"saved\":return t.session?{state:{session:t.session,pendingRefresh:!0},refresh:!1}:{state:t,refresh:!0};case\"canvas\":return{state:Sw,refresh:!1}}}var Tre=4e3,ME=\"data-smd-hidden\";function AU({iframeRef:t,postToCanvas:e,patch:n}){let[r,o]=(0,ft.useState)(Sw),s=(0,ft.useRef)(r),[a,i]=(0,ft.useState)(null),l=(0,ft.useRef)(null),u=(0,ft.useRef)(!1),c=(0,ft.useRef)(null),d=(0,ft.useRef)(null),f=(0,ft.useRef)(n);f.current=n;let p=(0,ft.useCallback)(_=>{let{state:P,refresh:D}=LU(s.current,_);s.current=P,o(P),D&&e({source:\"smoodly\",kind:\"refresh\"})},[e]),h=(0,ft.useCallback)((_,P,D)=>Array.from(_.querySelectorAll(`[${TE}]`)).filter(F=>{if(F.closest(`[${RE}]`))return!1;let j=SU(F);return j!==null&&j.node===P&&j.path===D}),[]),g=(0,ft.useCallback)(_=>{d.current&&(clearTimeout(d.current),d.current=null),_.unlisten?.(),l.current=null,i(null),_.root.remove();for(let P of Array.from(_.container.children)){let D=P.getAttribute(ME);D!==null&&(P.style.display=D,P.removeAttribute(ME))}},[]),m=(0,ft.useRef)(()=>{}),y=(0,ft.useCallback)((_,P,D)=>{let F=h(_,P.node,P.path)[0];if(!F)return!1;Rre(_);let j=_.createElement(\"div\");j.setAttribute(RE,\"\"),j.style.display=\"contents\";let K=_.defaultView,ve=K?CU(K.getComputedStyle(F)):{};for(let Re of Array.from(F.children))Re.setAttribute(ME,Re.style.display),Re.style.display=\"none\";F.appendChild(j);let ue=Re=>{Re.key!==\"Escape\"||l.current?.closing||j.contains(Re.target)||(Re.preventDefault(),Re.stopPropagation(),m.current())};_.addEventListener(\"keydown\",ue,!0);let Ue={session:P,container:F,root:j,at:D,closing:!1,layout:ve,unlisten:()=>_.removeEventListener(\"keydown\",ue,!0)};return l.current=Ue,i(Ue),u.current=!1,!0},[h]),b=(0,ft.useCallback)((_,P,D)=>{let F=h(_,P.node,P.path).find(IE);if(!F)return!1;F.setAttribute(\"contenteditable\",\"plaintext-only\");let j=()=>f.current(P.node,P.path,F.textContent??\"\"),K=ue=>{(ue.key===\"Enter\"||ue.key===\"Escape\")&&(ue.preventDefault(),ue.stopPropagation(),m.current())},ve=()=>m.current();return F.addEventListener(\"input\",j),F.addEventListener(\"keydown\",K),F.addEventListener(\"blur\",ve),c.current={el:F,teardown:()=>{F.removeEventListener(\"input\",j),F.removeEventListener(\"keydown\",K),F.removeEventListener(\"blur\",ve),F.removeAttribute(\"contenteditable\"),F.childNodes.length===1&&F.firstChild?.nodeType===3||(F.textContent=F.textContent??\"\")}},F.focus({preventScroll:!0}),D&&Ire(_,D.x,D.y),!0},[h]),x=(0,ft.useCallback)(()=>{if(!s.current.session)return;let _=c.current,P=l.current,D=u.current;if(p({type:\"end\"}),_&&(c.current=null,_.teardown()),P&&!P.closing)if(D){let F={...P,closing:!0};l.current=F,i(F),d.current=setTimeout(()=>{l.current===F&&g(F)},Tre)}else g(P)},[p,g]);m.current=x;let v=(0,ft.useCallback)((_,P)=>{let D=t.current?.contentDocument;if(!D)return!1;let F=l.current;if(F?.closing){if(F.session.node===_.node&&F.session.path===_.path)return!1;g(F)}x();let j=_.kind===\"text\"?b(D,_,P):y(D,_,P);return j&&p({type:\"start\",session:_}),j},[t,p,x,g,b,y]),S=(0,ft.useCallback)((_,P,D)=>{let F=t.current?.contentDocument;if(F)for(let j of h(F,_,P))c.current?.el!==j&&kU(j,D)},[t,h]),E=(0,ft.useCallback)(()=>{u.current=!0},[]),w=(0,ft.useCallback)(()=>p({type:\"saved\"}),[p]),k=(0,ft.useCallback)(()=>{let _=l.current;_?.closing&&g(_)},[g]),A=(0,ft.useCallback)(_=>{let P=s.current.session;P&&P.node!==_&&x()},[x]),L=(0,ft.useCallback)(()=>{let _=c.current;if(c.current=null,_)try{_.teardown()}catch{}let P=l.current;P&&g(P),p({type:\"canvas\"})},[p,g]);return(0,ft.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]),{session:r.session,richtext:a,start:v,end:x,writeText:S,markChanged:E,onSaved:w,onRendered:k,onSelection:A,onCanvasChange:L}}function Rre(t){if(t.querySelector(\"style[data-smoodly-admin-styles]\"))return;let e=t.createElement(\"style\");e.setAttribute(\"data-smoodly-admin-styles\",\"\"),e.textContent=document.querySelector(\"style[data-smoodly-admin-styles]\")?.textContent??ev,t.head.appendChild(e)}function Ire(t,e,n){let r=t.getSelection();if(!r)return;let o=t,s=o.caretPositionFromPoint?.(e,n);if(s){r.collapse(s.offsetNode,s.offset);return}let a=o.caretRangeFromPoint?.(e,n);a&&(r.removeAllRanges(),r.addRange(a))}var _E=T(te(),1);function EU({registry:t,ops:e,id:n,record:r,setRecord:o,flush:s,fail:a,clearBanner:i,reload:l}){let[u,c]=(0,_E.useState)(()=>il(t)),[d,f]=(0,_E.useState)(!1),p=async m=>{if(m===u)return;if(!await s()){a(\"Couldn't save your latest changes \\u2014 switch cancelled.\");return}Wu(m),i(),c(m)};return{locale:u,adding:d,switchLocale:p,doAddLocale:async m=>{if(!r||d)return;let y=r.locales[u]?u:hd(r,t);if(y===u&&!await s()){a(\"Couldn't save your latest changes \\u2014 add cancelled.\");return}f(!0);let b;try{b=await e.pages.addLocale(n,m,{from:y})}catch{b={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(f(!1),!b.ok){a(b.message);return}o(b.data),m===u?l():p(m)},doRemoveLocale:async()=>{if(!r)return;let m=Object.keys(r.locales).filter(S=>S!==u);if(m.length===0||!await rt({title:`Remove this page from ${u}?`,body:`Its ${u} content and history are deleted. Other languages are not affected.`,confirmLabel:`Remove from ${u}`,destructive:!0,subject:{name:r.locales[u]?.title??n}}))return;if(!await s()){a(\"Couldn't save your latest changes \\u2014 removal cancelled.\");return}let x;try{x=await e.pages.removeLocale(n,u)}catch{x={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(!x.ok){a(x.message);return}let v=m.includes(t.locales.default)?t.locales.default:m[0];Wu(v),c(v)}}}var dl=T(te(),1);function TU(t){let e={},n=null,r=null,o=0,s=new Set,a=new Map,i=new Map,l=new Set,u=null,c=()=>{u=null;for(let h of l)h()},d=()=>Object.values(e).filter(h=>(a.get(h.name)??0)>(i.get(h.name)??0)),f=LE({read:()=>{let h=d();return h.length>0?h:null},persist:async h=>{let g=null;for(let m of h){let y=a.get(m.name)??0,b;try{b=await t.ops.globals.save(m.name,m.locale,m.fields,Bs(m.record.locales[m.locale]))}catch{b={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}let x=e[m.name];b.ok?(i.set(m.name,y),x&&(e={...e,[m.name]:{...x,record:b.data,errors:{}}}),t.onSaved?.(m.name)):(Yn(b)&&(r=pr(b)),g??(g=b),x&&(e={...e,[m.name]:{...x,errors:Object.fromEntries((b.fields??[]).map(v=>[v.field,v.message]))}}))}return c(),g??{ok:!0,data:null}},debounceMs:t.debounceMs,retryBaseMs:t.retryBaseMs,retryCapMs:t.retryCapMs});return f.subscribe(c),{getState:()=>u??(u={items:e,saveState:f.getState(),loadError:n,stale:r}),subscribe(h){return l.add(h),()=>{l.delete(h)}},async load(h,g){let m=`${h}/${g}`;if(e[h]?.locale===g||s.has(m))return;s.add(m);let y=o,b;try{b=await t.ops.globals.get(h,g)}catch{b={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(s.delete(m),y===o){if(!b.ok){n=b.message,c();return}e={...e,[h]:{name:h,locale:g,record:b.data.record,fields:b.data.fields,usage:b.data.usage,errors:{}}},n=null,c()}},patch(h,g,m){let y=e[h];y&&(e={...e,[h]:{...y,fields:K0(y.fields,g,m)}},a.set(h,(a.get(h)??0)+1),c(),f.mark())},flush:f.flush,async setStatus(h,g){let m=e[h];if(!m)return{ok:!1,code:\"not_found\",message:\"This item hasn't loaded yet.\"};if(!await f.flush())return{ok:!1,code:\"internal\",message:\"Couldn't save your latest changes \\u2014 publish cancelled.\"};let y;try{y=await t.ops.globals.setStatus(h,m.locale,g,Bs(m.record.locales[m.locale]))}catch{y={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}return y.ok&&e[h]?(e={...e,[h]:{...e[h],record:y.data}},c()):Yn(y)&&(r=pr(y),c()),y},reset(){o+=1,e={},a.clear(),i.clear(),s.clear(),n=null,r=null,f.reset(),c()},dispose:f.dispose}}function RU({ops:t,onSaved:e}){let n=(0,dl.useRef)(e);n.current=e;let[r]=(0,dl.useState)(()=>TU({ops:t,onSaved:s=>n.current?.(s)}));return(0,dl.useEffect)(()=>()=>{r.flush(),r.dispose()},[r]),{...(0,dl.useSyncExternalStore)(r.subscribe,r.getState,r.getState),load:r.load,patch:r.patch,flush:r.flush,setStatus:r.setStatus,reset:r.reset}}var Tr=T(O(),1),IU=t=>typeof t==\"string\"?t:JSON.stringify(t);function MU({node:t,label:e,onRemove:n}){let r=Object.entries(t.fields??{});return(0,Tr.jsxs)(Tr.Fragment,{children:[(0,Tr.jsx)(\"div\",{className:\"sm-inspector__head\",children:(0,Tr.jsx)(\"span\",{className:\"sm-title\",children:e})}),(0,Tr.jsxs)(\"div\",{className:\"sm-inspector__body\",\"data-testid\":\"unknown-node\",children:[(0,Tr.jsxs)(\"p\",{className:\"sm-hint\",children:[\"The code no longer registers `\",t.type,\"`, so it can't be edited or shown on the site.\"]}),r.map(([o,s])=>(0,Tr.jsxs)(\"div\",{className:\"sm-orphans__row\",children:[(0,Tr.jsx)(\"code\",{children:o}),(0,Tr.jsx)(\"span\",{className:\"sm-orphans__value\",children:IU(s)}),(0,Tr.jsx)(Q,{variant:\"secondary\",onClick:()=>{navigator.clipboard?.writeText(IU(s))},children:\"Copy\"})]},o)),(0,Tr.jsx)(Q,{variant:\"danger\",style:{alignSelf:\"flex-start\"},onClick:n,children:\"Remove section\"})]})]})}var ee=T(O(),1),Mre=t=>t.includes(\"?\")?`${t}&smoodly-editor=1`:`${t}?smoodly-editor=1`,_re=(t,e)=>`${t}${t.includes(\"?\")?\"&\":\"?\"}smoodly-version=${encodeURIComponent(e)}`;function _U({ops:t,registry:e,id:n}){let r=Qe(),[o,s]=(0,Y.useState)(null),a=(0,Y.useRef)(o);a.current=o;let[i,l]=(0,Y.useState)(null),[u,c]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(null),[p,h]=(0,Y.useState)(!1),[g,m]=(0,Y.useState)(!1),[y,b]=(0,Y.useState)(0),[x,v]=(0,Y.useState)({}),[S,E]=(0,Y.useState)({}),[w,k]=(0,Y.useState)([]),[A,L]=(0,Y.useState)({}),[_,P]=(0,Y.useState)([]),[D,F]=(0,Y.useState)(null),j=(0,Y.useRef)(!1),[K,ve]=(0,Y.useState)(null),[ue,Ue]=(0,Y.useState)(null),[Re,je]=(0,Y.useState)(null),Ke=(0,Y.useRef)(null),M=(0,Y.useRef)(null),[V,I]=(0,Y.useState)(null),[U,me]=(0,Y.useState)(\"Content\"),[Oe,X]=(0,Y.useState)(null),[dn,er]=(0,Y.useState)(!1),[dc,wn]=(0,Y.useState)(null),[_r,is]=(0,Y.useState)(null),[It,bl]=(0,Y.useState)(!1),[mr,Ws]=(0,Y.useState)(!1),[Ho,gr]=(0,Y.useState)(null),[lo,Xa]=(0,Y.useState)(!1),[$o,fc]=(0,Y.useState)(!1),Xs=(0,Y.useRef)(!1);Xs.current=mr||$o;let[Js,vl]=(0,Y.useState)(null),Or=(0,Y.useRef)(null),xl=(0,Y.useRef)(null),pt=(0,Y.useRef)(null),Dr=(0,Y.useRef)(e);Dr.current=e;let[wl]=(0,Y.useState)(()=>il(e)),Ja=(0,Y.useRef)(wl),Un=()=>{let C=a.current?.locales[Ja.current];return C?Bs(C):null},{saveState:$,mark:ge,flush:Kt,reset:ls}=Rf({read:()=>pt.current,persist:async C=>{let R=Ja.current,z=await t.pages.saveDraft(n,R,C,Un());if(z.ok){let Z=a.current;if(Z?.locales[R]){let ze={...Z,locales:{...Z.locales,[R]:{...Z.locales[R],draftVersionId:z.data.versionId,draftSavedAt:z.data.draft?.savedAt??null}}};a.current=ze,s(ze)}bl(!1),co?.announce(Za(R),z.data.draft?.savedAt??null)}else Yn(z)&&Xs.current&&l(pr(z));return z},onSaved:()=>M.current?.onSaved()}),ke=RU({ops:t,onSaved:C=>{Xa(!1),M.current?.onSaved(),co?.announce({kind:\"global\",id:C,locale:ce},null)}});ld(It||$!==\"saved\"||lo||ke.saveState!==\"saved\");let uo=(C,R,z)=>{ke.patch(C,R,z),Xa(!0),fc(!0)},Ya=(0,Y.useCallback)(async()=>await Kt()&&await ke.flush(),[Kt,ke.flush]),{locale:ce,adding:lp,switchLocale:up,doAddLocale:dy,doRemoveLocale:eS}=EU({registry:e,ops:t,id:n,record:o,setRecord:s,flush:Ya,fail:C=>X({text:C}),clearBanner:()=>X(null),reload:()=>b(C=>C+1)}),Sl=o?{kind:\"page\",id:n,locale:ce}:null;Sd(Sl);let{others:fy}=Ao(),co=Sa(),Za=C=>({kind:\"page\",id:n,locale:C}),cp=x[ce]??\"/\",py=cp,kl=A[ce]??cp,Cl=p?Mre(YC(kl)):null,{rects:hy,emptyZones:N,fields:re,docH:Le,geometry:Gt,postToCanvas:Sn,onFrameLoad:yr,crashed:dp}=pU({iframeRef:Or,iframeSrc:Cl,onSelect:(C,R,z,Z)=>V4(C,R,z,Z),onHover:(C,R)=>{ve(C),Ue(z=>z&&z.node===C&&z.path===R?z:C&&R?{node:C,path:R}:null)},onRendered:()=>M.current?.onRendered()}),pc=yU(Cl,Gt);(0,Y.useEffect)(()=>{let C=!1;return(async()=>{h(!1),c(null),pt.current=null;let R=j.current;j.current=!1,R||(F(null),ve(null)),m(!1),ke.reset(),R&&hp&&ke.load(hp,ce),bl(!1),l(null),Ws(!1),Xa(!1),fc(!1);let z;try{z=await t.preview.enable()}catch{z={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(C)return;if(!z.ok){f(z.message);return}let Z;try{Z=await t.pages.get(n,ce)}catch{Z={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(C)return;if(!Z.ok){f(Z.message);return}if(s(Z.data.record),v(Z.data.paths),E(Z.data.redirects),k(Z.data.liveFindings),L(Z.data.urls),P(Z.data.parentLocales),!Z.data.record.locales[ce])return;if(Z.data.draft===null){m(!0);return}let ze=Dr.current,kn=ze.pages.find(bp=>bp.name===Z.data.record.template),Ys=lE(Z.data.draft,kn?.zones??{},ze.sections);Ja.current=ce,c(Ys),pt.current=Ys,Ys!==Z.data.draft&&ge(),h(!0)})(),()=>{C=!0}},[t,n,ce,y]),(0,Y.useEffect)(()=>{pt.current=u},[u]);let tS=(0,Y.useCallback)(async()=>{let C=await t.pages.get(n,ce).catch(()=>null);!C||!C.ok||(s(C.data.record),v(C.data.paths),E(C.data.redirects),k(C.data.liveFindings),L(C.data.urls),P(C.data.parentLocales))},[t,n,ce]),nS=async C=>{let R;try{R=await t.pages.rename(n,{locale:ce,...C})}catch{R={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}return R.ok?(await tS(),null):R.message},my=(0,Y.useMemo)(()=>o?e.pages.find(C=>C.name===o.template)??null:null,[o,e]),rS=(0,Y.useMemo)(()=>Object.keys(my?.zones??{}),[my]),Ll=(0,Y.useCallback)(C=>C?my?.zones[C]:void 0,[my]),fp=(0,Y.useCallback)(C=>C===ws?Q3(e):e.sections.find(R=>R.name===C)??null,[e]),gy=(0,Y.useCallback)(C=>C.type!==ka?null:e.globals.find(R=>R.name===C.fields?.item)??null,[e]),Al=(0,Y.useCallback)(C=>{let R=pt.current?Nu(pt.current,C):null;if(R)return gy(R);let z=HD(C);return z?Dr.current.globals.find(Z=>Z.name===z)??null:null},[gy]),pp=vU(dp,C=>{let R=pt.current?Nu(pt.current,C):null;return R?Al(C)?.title??fp(R.type)?.title??R.type:\"Section\"}),oS=(0,Y.useMemo)(()=>{let C={};for(let R of e.sections)for(let z of[\"fields\",\"settings\"])for(let[Z,ze]of Object.entries(R[z]??{}))(ze.type===\"ref\"||ze.type===\"refList\")&&typeof ze.target==\"string\"&&(C[`${R.name}.${z}.${Z}`]=ze.target);return C},[e]),j4=(0,Y.useMemo)(()=>{let C=Object.values(oS);for(let R of e.globals)for(let z of Object.values(R.fields??{}))(z.type===\"ref\"||z.type===\"refList\")&&typeof z.target==\"string\"&&C.push(z.target);return C},[oS,e]),bT=Tf(t,e,ce,j4);(0,Y.useEffect)(()=>{if(Dr.current.globals.length===0){vl({});return}let C=!1;return t.globals.list().then(R=>{C||(R.ok||console.error(R.message),vl(R.ok?Object.fromEntries(R.data.map(z=>[z.name,z.record.id])):{}))}).catch(R=>{console.error(R),C||vl({})}),()=>{C=!0}},[t]);let hp=D?Al(D)?.name??null:null;(0,Y.useEffect)(()=>{hp&&ke.load(hp,ce)},[hp,ce]),(0,Y.useEffect)(()=>{ke.loadError&&X({text:ke.loadError})},[ke.loadError]),(0,Y.useEffect)(()=>{ke.stale&&l(ke.stale)},[ke.stale]);let q4=()=>{l(null),ls(),b(C=>C+1)},sS=(0,Y.useCallback)(()=>{ls(),j.current=!0,b(C=>C+1)},[ls]);(0,Y.useEffect)(()=>{$===\"stale\"&&!Xs.current&&sS()},[$,sS]),kd(Sl,C=>{if(i)return;(It||lo||$!==\"saved\"||ke.saveState!==\"saved\")&&Xs.current?l({by:C.email,at:Date.now()}):sS()});let vT=(0,Y.useRef)(()=>{}),mp=(0,Y.useCallback)(C=>{F(C),C&&vT.current(C)},[]),tr=(0,Y.useCallback)(C=>{c(R=>{if(!R)return R;let z=C(R);return pt.current=z,z}),ge(),bl(!0),Ws(!0)},[ge]),Dt=AU({iframeRef:Or,postToCanvas:Sn,patch:(C,R,z)=>{let Z=Al(C);Z?uo(Z.name,R,z):tr(ze=>aE(ze,C,R,z)),typeof z==\"string\"&&M.current?.writeText(C,R,z)}});M.current=Dt,(0,Y.useEffect)(()=>{Dt.onSelection(D)},[D]),(0,Y.useEffect)(()=>{Dt.onCanvasChange()},[Cl]);let xT=(C,R,z)=>{for(let Z of re){if(Z.node!==C)continue;let ze=V0(R,Z.path),kn=sE(z,Z.path);ze?.type===\"text\"&&typeof kn==\"string\"&&Dt.writeText(C,Z.path,kn)}},aS=(C,R)=>je(z=>({path:C,tab:K3(R,C)??\"Content\",n:(z?.n??0)+1}));(0,Y.useEffect)(()=>{if(!Re)return;me(Re.tab);let C=requestAnimationFrame(()=>{Ke.current&&Vu(Ke.current,Re.path)});return()=>cancelAnimationFrame(C)},[Re]);let V4=(C,R,z,Z)=>{if(C&&C===D&&R){K4(C,R,z,Z);return}F(C)},K4=(C,R,z,Z)=>{let ze=u?Nu(u,C):null,Ys=Al(C)??(ze?fp(ze.type):null);if(!Ys)return;let bp=V0(Ys,R);if(!bp||Dt.session&&Dt.session.node===C&&Dt.session.path===R)return;let CT=ze?.type===ws?null:bp.type===\"text\"?\"text\":bp.type===\"richtext\"?\"richtext\":null;CT&&Dt.start({node:C,path:R,kind:CT},{x:z,y:Z})||aS(R,Ys)};(0,Y.useEffect)(()=>{if(!u||!Js||!o)return;let C=Dr.current.pages.find(z=>z.name===o.template),R=lE(u,C?.zones??{},Dr.current.sections,Js);R!==u&&(c(R),pt.current=R,ge())},[Js,o,ge,u===null]);let gp=(0,Y.useCallback)(C=>u?.zones[C]??[],[u]),iS=(0,Y.useCallback)(C=>HH(Ll(C),gp(C).length),[Ll,gp]),lS=(0,Y.useMemo)(()=>o&&u?VD(e,o.template,u):[],[o,u,e]),hc=(0,Y.useMemo)(()=>{let C=new Map;for(let R of lS){let z=R.path.split(\".\")[0];C.set(z,[...C.get(z)??[],R])}return C},[lS]),G4=C=>{let R=hc.get(C);return R?R.some(xv)?\"broken\":\"orphan\":void 0},wT=(C,R,z)=>{let Z=mg(z,Du(z.name));tr(ze=>hg(ze,C,R,Z)),I(null),mp(Z.id)},W4=(C,R)=>{let z=tU(e,Du(ws));tr(Z=>hg(Z,C,R,z)),I(null),mp(z.id)},X4=(C,R,z)=>{let Z=Js?.[z.name];if(!Z)return;let ze=iE(z,Z,Du(ka));tr(kn=>hg(kn,C,R,ze)),I(null),mp(ze.id)},J4=C=>{if(!u)return;let R=Qo(u,C.id);if(!R||!iS(R))return;let z=gp(R).findIndex(ze=>ze.id===C.id)+1,Z={...C,id:Du(C.type),fields:structuredClone(C.fields),settings:C.settings?structuredClone(C.settings):void 0,styles:C.styles?structuredClone(C.styles):void 0};C.css===void 0&&delete Z.css,tr(ze=>hg(ze,R,z,Z)),mp(Z.id)},uS=async(C,R=!0)=>{if(!u||Ll(Qo(u,C))?.kind===\"locked\")return;let z=Nu(u,C);R&&!await rt({title:\"Delete this section?\",body:\"It is removed from the page draft. Nothing changes on the live site until you publish.\",confirmLabel:\"Delete section\",destructive:!0,subject:z?{name:yp(z)}:void 0})||(tr(Z=>NH(Z,C)),F(Z=>Z===C?null:Z))},Y4=(C,R)=>tr(z=>PH(z,C,R)),Z4=(C,R)=>tr(z=>BH(z,C,R)),Q4=(C,R,z,Z)=>tr(ze=>zH(ze,C,R,z,Z)),eq=(C,R)=>tr(z=>FH(z,C,R)),tq=(C,R,z)=>tr(Z=>UH(Z,C,R,z)),nq=async()=>{if(pp.length>0&&!await rt(xU(pp)))return;if(X(null),wn(\"publish\"),!await Kt()){wn(null),X({text:\"Couldn't save your latest changes \\u2014 publish cancelled.\"});return}let R;try{R=await t.pages.publish(n,ce,Un())}catch(z){console.error(z),R={ok:!1,code:\"internal\",message:\"Publish failed \\u2014 check your connection and try again.\"}}wn(null),R.ok?(s(R.data),co?.announce(Za(ce),R.data.locales[ce]?.draftSavedAt??null),er(!0),setTimeout(()=>er(!1),1600)):Yn(R)?l(pr(R)):X({text:R.message,fields:R.fields})},rq=async()=>{let C=o?.locales[ce];if(!await rt({...eu,subject:C?{name:C.title,path:cp}:void 0}))return;if(X(null),wn(\"discard\"),!await Ya()){wn(null),X({text:\"Couldn't save your latest changes \\u2014 discard cancelled.\"});return}let R;try{R=await t.pages.discardDraft(n,ce,Un())}catch{R={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(wn(null),!R.ok){Yn(R)?l(pr(R)):X({text:R.message});return}s(R.data),co?.announce(Za(ce),R.data.locales[ce]?.draftSavedAt??null),b(z=>z+1)},oq=async()=>{X(null),wn(\"unpublish\");let C;try{C=await t.pages.unpublish(n,ce)}catch{C={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(wn(null),!C.ok){X({text:C.message});return}s(C.data)},sq=async()=>{X(null);let C=o?.locales[ce];if(!C)return;if(!await Ya()){X({text:\"Couldn't save your latest changes \\u2014 history not opened.\"});return}let R;try{R=await t.pages.listVersions(n,ce)}catch{R={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(!R.ok){X({text:R.message});return}is(Of(R.data,C))},aq=async C=>{let R;try{R=await t.pages.restore(n,ce,C,Un())}catch{R={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}return R.ok?(s(R.data),co?.announce(Za(ce),R.data.locales[ce]?.draftSavedAt??null),b(z=>z+1),!0):(Yn(R)?l(pr(R)):X({text:R.message}),!1)},iq=async C=>{X(null),gr(\"publish\");let R=await ke.setStatus(C,\"published\");gr(null),!R.ok&&!Yn(R)&&X({text:R.message,fields:R.fields})},lq=async C=>{X(null),gr(\"unpublish\");let R=await ke.setStatus(C,\"draft\");gr(null),R.ok||X({text:R.message,fields:R.fields})},uq=async C=>{let R=e.globals.find(ze=>ze.name===C);if(!await rt({...eu,subject:R?{name:`${R.title} \\xB7 global`}:void 0}))return;if(X(null),gr(\"discard\"),!await ke.flush()){gr(null),X({text:\"Couldn't save your latest changes \\u2014 discard cancelled.\"});return}let z,Z=ke.items[C]?.record.locales[ce];try{z=await t.globals.discardDraft(C,ce,Z?Bs(Z):null)}catch{z={ok:!1,code:\"internal\",message:\"Couldn't reach the server.\"}}if(gr(null),!z.ok){Yn(z)?l(pr(z)):X({text:z.message});return}ke.reset(),Xa(!1),ke.load(C,ce),M.current?.onSaved()};if((0,Y.useEffect)(()=>{let C=R=>{R.key===\"Escape\"&&(I(null),F(null))};return window.addEventListener(\"keydown\",C),()=>window.removeEventListener(\"keydown\",C)},[]),d)return(0,ee.jsx)(vw,{children:(0,ee.jsx)(Me,{tone:\"error\",children:d})});if(g)return(0,ee.jsx)(vw,{children:(0,ee.jsx)(Me,{tone:\"warn\",children:\"This is a path \\u2014 it has a title and a place in the tree, but no page. Use \\u201CAdd page here\\u201D in the Pages list to give it one.\"})});if(o&&!o.locales[ce]){let C=hd(o,e);return(0,ee.jsxs)(vw,{children:[Oe&&(0,ee.jsx)(Me,{tone:\"error\",onDismiss:()=>X(null),children:Oe.text}),(0,ee.jsxs)(Me,{tone:\"warn\",children:[\"This page doesn't exist in \",ce,\" yet. Adding it copies the \",C,\" draft as the first \",ce,\" version.\"]}),(0,ee.jsxs)(\"div\",{style:{display:\"flex\",gap:8},children:[(0,ee.jsxs)(Q,{onClick:()=>{dy(ce)},disabled:lp,children:[\"Add \",ce]}),(0,ee.jsxs)(Q,{variant:\"secondary\",onClick:()=>{up(C)},children:[\"Back to \",C]})]})]})}let Xe=u&&D?Nu(u,D):null,Nr=Xe?fp(Xe.type):null,cS=Xe?gy(Xe):null,yy=D&&!Xe?Al(D):null,fn=cS??yy,cq=u&&Xe?Qo(u,Xe.id):null,dq=Ll(cq)?.kind===\"locked\",by=new Map(hy.map(C=>[C.id,C])),vy=D?by.get(D):void 0,fq=K&&K!==D?by.get(K):void 0,pq=K?Al(K)!==null:!1,ST=C=>C?re.find(R=>R.node===C.node&&R.path===C.path):void 0,hq=ue&&ue.node===D?ST(ue):void 0,mq=ST(Dt.session),gq=hy.reduce((C,R)=>Math.max(C,R.x+R.w),320),yq=Xe&&vy?{node:Xe,rect:vy,title:Nr?.title??cS?.title??yp(Xe),global:!!cS,locked:dq}:yy&&D&&vy?{node:{id:D,type:ka,fields:{item:yy.name}},rect:vy,title:yy.title,global:!0,locked:!1,layout:!0}:null;function yp(C){if(C.type===ws)return nU(C);let R=gy(C);return fp(C.type)?.title??(R?`${R.title} \\xB7 global`:`Unknown section \\`${C.type}\\``)}vT.current=C=>{let R=by.get(C),z=xl.current;if(!R||!z)return;let Z=R.y-Math.max(0,(z.clientHeight-R.h)/2);z.scrollTo({top:Math.max(0,Z),behavior:\"smooth\"})};let bq=dU({zoneOrder:rS,canTake:iS,nodesIn:gp,rects:by,emptyZones:N}),El=Nr?Ig(Nr):fn?Ig(fn):[],dS=El.some(C=>C.tab===U)?U:El[0]?.tab,kT=El.find(C=>C.tab===dS)?.groups??[];return(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(ko,{left:(0,ee.jsx)(ee.Fragment,{children:(0,ee.jsx)(fd,{backHref:r(\"/pages\"),items:[{label:\"Pages\",href:r(\"/pages\"),trailing:e.locales.supported.length>1&&(0,ee.jsx)(md,{registry:e,present:o?e.locales.supported.filter(C=>o.locales[C]):[ce],parentLocales:_,value:ce,adding:lp,onSwitch:C=>{up(C)},onAdd:C=>{dy(C)}})},{label:py}]})}),right:(0,ee.jsxs)(ee.Fragment,{children:[(mr||$===\"error\"||$===\"refused\")&&(0,ee.jsx)(Yl,{state:$,pending:It}),p&&(0,ee.jsx)(rv,{icon:!0,href:kl,target:\"_blank\",rel:\"noreferrer\",\"aria-label\":\"View live\",title:\"View live \\u2014 opens the site route. While the admin's draft-mode cookie is on, this shows the DRAFT \\u2014 open it in a private window to see what visitors see.\",children:(0,ee.jsx)(Xl,{size:16,strokeWidth:1.5,\"aria-hidden\":\"true\"})}),(0,ee.jsx)(al,{status:o?.locales[ce]?ar(o.locales[ce]):null,pending:It||$!==\"saved\",busy:dc,flash:dn,onPublish:()=>{nq()},onDiscard:()=>{rq()},onUnpublish:()=>{oq()},onHistory:()=>{sq()}})]})}),Sl&&(0,ee.jsx)(zf,{names:Eo(fy,Sl),noun:\"page\"}),i&&(0,ee.jsx)(Pf,{info:i,onReload:q4}),(0,ee.jsx)(Bf,{draft:lS,live:w}),_r&&o?.locales[ce]&&(0,ee.jsx)(Df,{rows:_r,draftId:o.locales[ce].draftVersionId,onClose:()=>is(null),onRestore:aq,render:C=>(0,ee.jsx)(\"iframe\",{className:\"sm-history__frame\",title:\"Version preview\",src:_re(YC(kl),C)})}),(0,ee.jsxs)(\"div\",{className:\"sm-editor\",inert:i?!0:void 0,children:[(0,ee.jsxs)(\"div\",{className:\"sm-canvas\",children:[(Oe||pc||pp.length>0)&&(0,ee.jsxs)(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:8,padding:\"0 20px 10px\"},children:[Oe&&(0,ee.jsxs)(Me,{tone:Oe.fields&&Oe.fields.length>0?\"warn\":\"error\",onDismiss:()=>X(null),children:[(0,ee.jsx)(\"p\",{children:Oe.text}),(0,ee.jsx)(pd,{fields:Oe.fields??[]})]}),pc&&(0,ee.jsx)(bU,{cause:pc.cause,path:pc.path}),pp.length>0&&(0,ee.jsx)(Me,{tone:\"warn\",children:pp.map((C,R)=>(0,ee.jsx)(\"p\",{children:C},R))})]}),(0,ee.jsx)(\"div\",{className:\"sm-canvas__scroll\",ref:xl,onClick:C=>{C.target===C.currentTarget&&F(null)},children:(0,ee.jsxs)(\"div\",{className:\"sm-page\",style:{overflow:\"hidden\"},children:[Cl?(0,ee.jsx)(\"iframe\",{ref:Or,src:Cl,title:\"Page canvas\",onLoad:yr,style:{width:\"100%\",height:Le,border:0,display:\"block\"}}):(0,ee.jsx)(\"div\",{className:\"sm-canvas__loading\",children:\"Loading canvas\\u2026\"}),(0,ee.jsx)(X3,{emptyZones:N,hoverRect:fq,hoverGlobal:pq,selection:yq,fieldHover:hq,editing:mq,plusButtons:bq,onPlus:(C,R,z)=>I({zone:C.zone,index:C.index,x:R-150,y:z+12}),onMove:Y4,onDuplicate:J4,onRemove:uS}),Dt.richtext&&(()=>{let{session:C}=Dt.richtext,R=Al(C.node),z=!R&&u?Nu(u,C.node):null,Z=R??(z?fp(z.type):null),ze=R?ke.items[R.name]?.fields:z?.fields;return!Z||!ze?null:(0,ee.jsx)(Z3,{mount:Dt.richtext,pageWidth:gq,value:sE(ze,C.path),toolset:V0(Z,C.path)?.toolset,onChange:kn=>{Dt.markChanged(),R?uo(R.name,C.path,kn):tr(Ys=>aE(Ys,C.node,C.path,kn))},onEscape:Dt.end})})()]})})]}),(0,ee.jsx)(Nf,{}),(0,ee.jsxs)(\"aside\",{className:\"sm-inspector\",ref:Ke,children:[(0,ee.jsxs)(\"div\",{className:\"sm-card\",children:[Xe&&!Nr&&!fn?(0,ee.jsx)(MU,{node:Xe,label:yp(Xe),onRemove:()=>{uS(Xe.id,!0)}}):Nr||fn?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)(\"div\",{className:\"sm-inspector__head\",children:[(0,ee.jsxs)(\"span\",{style:{display:\"flex\",alignItems:\"center\",gap:8,minWidth:0},children:[(0,ee.jsx)(\"span\",{className:\"sm-blockglyph\"}),(0,ee.jsx)(\"span\",{className:\"sm-title\",style:{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\"},children:Nr?.title??(fn?`${fn.title} \\xB7 global`:null)}),fn&&($o||ke.saveState===\"error\"||ke.saveState===\"refused\")&&(0,ee.jsx)(Yl,{state:ke.saveState,pending:lo})]}),(0,ee.jsx)(nt,{label:\"Clear selection\",onClick:()=>F(null),children:\"\\xD7\"})]}),El.length>0&&Nr&&(0,ee.jsx)(Yh,{tabs:El.map(C=>C.tab),value:dS,onChange:C=>me(C)})]}):o?(0,ee.jsx)(uU,{record:o,locale:ce,registry:e,tree:u,path:x[ce],redirects:S[ce]??[],fixed:aL(o,e)||!!o.fixed,onRename:nS,onPatch:tq,drift:hc.get(\"page\")??[],onClearPageField:C=>tr(R=>({...R,fields:Zi(R.fields??{},C)})),onRemoveLocale:Object.keys(o.locales).length>1&&!o.fixed&&!(o.parentId===null&&o.locales[e.locales.default]?.slug===e.homePageSlug)?()=>{eS()}:void 0}):null,(Nr||fn)&&(0,ee.jsxs)(\"div\",{className:\"sm-inspector__body\",children:[Xe&&hc.get(Xe.id)?.filter(C=>C.kind===\"zone-disallowed\").map(C=>(0,ee.jsx)(\"p\",{className:\"sm-outline-note\",children:Rg(C)},C.path)),Xe&&Nr&&(0,ee.jsx)(mw,{groups:kT,values:Xe,render:({key:C,ns:R,descriptor:z},{emptyLabel:Z,scope:ze})=>(0,ee.jsx)(Pn,{fieldKey:C,descriptor:z,value:hw(Xe,{key:C,ns:R,descriptor:z}),emptyLabel:Z,scope:ze,errors:R===\"css\"?void 0:Ore(hc.get(Xe.id)??[],Xe.id,R),refOptions:R===\"fields\"||R===\"settings\"?Nre(bT,oS,Nr,R,C,z):void 0,inlinePath:R===\"fields\"&&Dt.session?.node===Xe.id?Dt.session.path:void 0,onEditHere:()=>{let kn=Dt.session?.path;Dt.end(),kn&&aS(kn,Nr)},onChange:kn=>{R===\"css\"?eq(Xe.id,kn):Q4(Xe.id,R,C,kn),R===\"fields\"&&xT(Xe.id,Nr,{...Xe.fields,[C]:kn})}},`${Xe.id}.${R}.${C}`)}),Xe&&Nr&&(0,ee.jsx)(ul,{orphans:(hc.get(Xe.id)??[]).filter(C=>!C.path.includes(\".elements.\")),strip:Xe.id,onClear:C=>tr(R=>qH(R,Xe.id,C))}),fn&&D&&(0,ee.jsx)(cU,{item:fn,edit:ke.items[fn.name]??null,locale:ce,groups:kT,multilingual:e.locales.supported.length>1,refOptions:bT,tabs:El.length>0?(0,ee.jsx)(Yh,{tabs:El.map(C=>C.tab),value:dS,onChange:C=>me(C)}):void 0,pending:lo||ke.saveState!==\"saved\",busy:Ho,inlinePath:Dt.session?.node===D?Dt.session.path:void 0,onEditHere:()=>{let C=Dt.session?.path;Dt.end(),C&&aS(C,fn)},onChange:(C,R,z)=>{if(uo(fn.name,Dre(C,R),z),C===\"fields\"){let Z=ke.items[fn.name];Z&&xT(D,fn,{...Z.fields,[R]:z})}},onPublish:()=>{iq(fn.name)},onDiscard:()=>{uq(fn.name)},onUnpublish:()=>{lq(fn.name)}})]})]}),(0,ee.jsx)(\"div\",{className:\"sm-card\",children:(0,ee.jsx)(aU,{selectedId:D,onSelect:mp,onMoveTo:Z4,onRemove:uS,zones:[...rS.map(C=>({zone:C,locked:Ll(C)?.kind===\"locked\",canTake:iS(C),note:hc.get(`zone:${C}`)?.map(Rg)[0],nodes:gp(C).map(R=>({node:R,label:yp(R),mark:G4(R.id)}))})),...Object.keys(u?.zones??{}).filter(C=>!rS.includes(C)&&(u.zones[C]?.length??0)>0).map(C=>({zone:C,locked:!1,canTake:!1,removed:!0,nodes:u.zones[C].map(R=>({node:R,label:yp(R)}))}))],onClearZone:async C=>{let R=u?.zones[C]?.length??0;await rt({title:\"Clear this zone?\",body:`Its ${R===1?\"section is\":`${R} sections are`} removed from the draft. The live page keeps ${R===1?\"it\":\"them\"} until you publish.`,confirmLabel:\"Clear zone\",destructive:!0})&&tr(z=>jH(z,C))},onAddFirst:C=>{let R=G0(Ll(C),e.sections)[0];R&&wT(C,0,R)}})})]})]}),V&&(0,ee.jsx)(sU,{at:V,policy:Ll(V.zone),registry:e,globalIds:Js??{},onInsert:C=>wT(V.zone,V.index,C),onInsertGlobal:C=>X4(V.zone,V.index,C),onInsertCustom:()=>W4(V.zone,V.index),onClose:()=>I(null)})]})}function Ore(t,e,n){let r=ll(t,e),o={};for(let[s,a]of Object.entries(r))n===\"fields\"&&!s.startsWith(\"settings.\")&&!s.startsWith(\"styles.\")?o[s]=a:n!==\"fields\"&&s.startsWith(`${n}.`)&&(o[s.slice(n.length+1)]=a);return o}function Dre(t,e){return t===\"fields\"?e:t===\"settings\"?`${Go}.${e}`:t===\"styles\"?`${Ss}.${e}`:To}function Nre(t,e,n,r,o,s){if(s.type!==\"ref\"&&s.type!==\"refList\")return;let a=e[`${n.name}.${r}.${o}`];return a?t[a]:[]}var $f=T(te(),1);var _t=T(O(),1),Pre={google:\"Continue with Google\",github:\"Continue with GitHub\"},OE={width:320,display:\"flex\",flexDirection:\"column\",gap:14,background:\"var(--surface)\",padding:28,borderRadius:\"var(--radius-card-lg)\",border:\"var(--menu-border)\",boxShadow:\"var(--shadow-page)\"};function OU({client:t,providers:e=[]}){let[n,r]=(0,$f.useState)(\"signin\"),[o,s]=(0,$f.useState)(\"\"),[a,i]=(0,$f.useState)(\"\"),[l,u]=(0,$f.useState)(null),[c,d]=(0,$f.useState)(!1),f=async y=>{y.preventDefault(),d(!0),u(null);try{let b=await t.auth.signInWithPassword({email:o,password:a});b.error&&u(b.error.message)}catch(b){u(b instanceof Error?b.message:String(b))}finally{d(!1)}},p=async y=>{y.preventDefault(),d(!0),u(null);try{await t.auth.resetPasswordForEmail(o,{redirectTo:window.location.origin+window.location.pathname})}catch{}finally{d(!1),r(\"sent\")}},h=async y=>{d(!0),u(null);try{let b=await t.auth.signInWithOAuth({provider:y,options:{redirectTo:window.location.href}});b.error&&u(b.error.message)}catch(b){u(b instanceof Error?b.message:String(b))}finally{d(!1)}},g=(0,_t.jsx)(Q,{variant:\"secondary\",size:\"lg\",disabled:c,onClick:()=>{u(null),r(\"signin\")},children:\"Back to sign in\"}),m;return n===\"sent\"?m=(0,_t.jsxs)(\"div\",{style:OE,children:[(0,_t.jsx)(cd,{height:20}),(0,_t.jsx)(\"span\",{children:\"Check your email for a link to choose a new password.\"}),g]}):n===\"forgot\"?m=(0,_t.jsxs)(\"form\",{onSubmit:p,style:OE,children:[(0,_t.jsx)(cd,{height:20}),(0,_t.jsx)(xe,{label:\"Email\",children:(0,_t.jsx)(\"input\",{className:\"sm-input\",type:\"email\",value:o,required:!0,autoComplete:\"email\",autoFocus:!0,onChange:y=>s(y.target.value)})}),l&&(0,_t.jsx)(Me,{tone:\"error\",children:l}),(0,_t.jsx)(\"button\",{type:\"submit\",disabled:c,className:\"sm-btn sm-btn--primary sm-btn--lg\",children:c?\"Sending\\u2026\":\"Send reset link\"}),g]}):m=(0,_t.jsxs)(\"form\",{onSubmit:f,style:OE,children:[(0,_t.jsx)(cd,{height:20}),(0,_t.jsx)(xe,{label:\"Email\",children:(0,_t.jsx)(\"input\",{className:\"sm-input\",type:\"email\",value:o,required:!0,autoComplete:\"email\",onChange:y=>s(y.target.value)})}),(0,_t.jsx)(xe,{label:\"Password\",children:(0,_t.jsx)(\"input\",{className:\"sm-input\",type:\"password\",value:a,required:!0,autoComplete:\"current-password\",onChange:y=>i(y.target.value)})}),l&&(0,_t.jsx)(Me,{tone:\"error\",children:l}),(0,_t.jsx)(\"button\",{type:\"submit\",disabled:c,className:\"sm-btn sm-btn--primary sm-btn--lg\",children:c?\"Signing in\\u2026\":\"Sign in\"}),e.map(y=>(0,_t.jsx)(Q,{variant:\"secondary\",size:\"lg\",disabled:c,onClick:()=>h(y),children:Pre[y]},y)),(0,_t.jsx)(\"button\",{type:\"button\",className:\"sm-link\",disabled:c,onClick:()=>{u(null),r(\"forgot\")},style:{background:\"transparent\",border:0,color:\"var(--text-muted)\",cursor:\"pointer\",font:\"inherit\",padding:0},children:\"Forgot password?\"})]}),(0,_t.jsx)(\"div\",{style:{minHeight:\"100vh\",display:\"grid\",placeItems:\"center\",background:\"var(--bg)\"},children:m})}var _g=T(te(),1);var ro=T(O(),1);function DU({client:t,mode:e,onDone:n}){let[r,o]=(0,_g.useState)(\"\"),[s,a]=(0,_g.useState)(\"\"),[i,l]=(0,_g.useState)(null),[u,c]=(0,_g.useState)(!1);return(0,ro.jsx)(\"div\",{style:{minHeight:\"100vh\",display:\"grid\",placeItems:\"center\",background:\"var(--bg)\"},children:(0,ro.jsxs)(\"form\",{onSubmit:async f=>{if(f.preventDefault(),r!==s){l(\"The two passwords differ.\");return}c(!0),l(null);try{let p=await t.auth.updateUser({password:r});p.error?l(p.error.message):n()}catch(p){l(p instanceof Error?p.message:String(p))}finally{c(!1)}},style:{width:320,display:\"flex\",flexDirection:\"column\",gap:14,background:\"var(--surface)\",padding:28,borderRadius:\"var(--radius-card-lg)\",border:\"var(--menu-border)\",boxShadow:\"var(--shadow-page)\"},children:[(0,ro.jsx)(cd,{height:20}),(0,ro.jsx)(\"span\",{className:\"sm-title\",children:e===\"invite\"?\"Set your password\":\"Choose a new password\"}),(0,ro.jsx)(xe,{label:\"Password\",children:(0,ro.jsx)(\"input\",{className:\"sm-input\",type:\"password\",required:!0,minLength:8,autoComplete:\"new-password\",value:r,onChange:f=>o(f.target.value)})}),(0,ro.jsx)(xe,{label:\"Again\",children:(0,ro.jsx)(\"input\",{className:\"sm-input\",type:\"password\",required:!0,autoComplete:\"new-password\",value:s,onChange:f=>a(f.target.value)})}),i&&(0,ro.jsx)(Me,{tone:\"error\",children:i}),(0,ro.jsx)(\"button\",{type:\"submit\",disabled:u,className:\"sm-btn sm-btn--primary sm-btn--lg\",children:u?\"Saving\\u2026\":\"Save\"}),e===\"recovery\"&&(0,ro.jsx)(Q,{variant:\"secondary\",size:\"lg\",onClick:n,children:\"Skip\"})]})})}var gl=T(te(),1);var Bre=Symbol.for(\"@supabase/supabase-js.traceContextExtractor\");function NU(){return globalThis[Bre]}function tc(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols==\"function\")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function PU(t,e,n,r){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function i(c){try{u(r.next(c))}catch(d){a(d)}}function l(c){try{u(r.throw(c))}catch(d){a(d)}}function u(c){c.done?s(c.value):o(c.value).then(i,l)}u((r=r.apply(t,e||[])).next())})}var BU=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);var Uf=class extends Error{constructor(e,n=\"FunctionsError\",r){super(e),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}},Og=class extends Uf{constructor(e){super(\"Failed to send a request to the Edge Function\",\"FunctionsFetchError\",e)}},jf=class extends Uf{constructor(e){super(\"Relay Error invoking the Edge Function\",\"FunctionsRelayError\",e)}},qf=class extends Uf{constructor(e){super(\"Edge Function returned a non-2xx status code\",\"FunctionsHttpError\",e)}},Dg;(function(t){t.Any=\"any\",t.ApNortheast1=\"ap-northeast-1\",t.ApNortheast2=\"ap-northeast-2\",t.ApSouth1=\"ap-south-1\",t.ApSoutheast1=\"ap-southeast-1\",t.ApSoutheast2=\"ap-southeast-2\",t.CaCentral1=\"ca-central-1\",t.EuCentral1=\"eu-central-1\",t.EuWest1=\"eu-west-1\",t.EuWest2=\"eu-west-2\",t.EuWest3=\"eu-west-3\",t.SaEast1=\"sa-east-1\",t.UsEast1=\"us-east-1\",t.UsWest1=\"us-west-1\",t.UsWest2=\"us-west-2\"})(Dg||(Dg={}));var Ng=class{constructor(e,{headers:n={},customFetch:r,region:o=Dg.Any}={}){this.url=e,this.headers=n,this.region=o,this.fetch=BU(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return PU(this,arguments,void 0,function*(n,r={}){var o,s;let a,i,l;try{let{headers:u,method:c,body:d,signal:f,timeout:p}=r,h={},{region:g}=r;g||(g=this.region);let m=new URL(`${this.url}/${n}`);g&&g!==\"any\"&&(h[\"x-region\"]=g,m.searchParams.set(\"forceFunctionRegion\",g));let y,b=!!u&&Object.keys(u).some(k=>k.toLowerCase()===\"content-type\");d&&!b?typeof Blob<\"u\"&&d instanceof Blob||d instanceof ArrayBuffer?(h[\"Content-Type\"]=\"application/octet-stream\",y=d):typeof d==\"string\"?(h[\"Content-Type\"]=\"text/plain\",y=d):typeof FormData<\"u\"&&d instanceof FormData?y=d:(h[\"Content-Type\"]=\"application/json\",y=JSON.stringify(d)):d&&typeof d!=\"string\"&&!(typeof Blob<\"u\"&&d instanceof Blob)&&!(d instanceof ArrayBuffer)&&!(typeof FormData<\"u\"&&d instanceof FormData)?y=JSON.stringify(d):y=d;let x=f;p&&(i=new AbortController,a=setTimeout(()=>i.abort(),p),f?(x=i.signal,l=()=>i.abort(),f.addEventListener(\"abort\",l)):x=i.signal);let v=yield this.fetch(m.toString(),{method:c||\"POST\",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),u),body:y,signal:x}).catch(k=>{throw new Og(k)}),S=v.headers.get(\"x-relay-error\");if(S&&S===\"true\")throw new jf(v);if(!v.ok)throw new qf(v);let E=((o=v.headers.get(\"Content-Type\"))!==null&&o!==void 0?o:\"text/plain\").split(\";\")[0].trim().toLowerCase(),w;return E===\"application/json\"?w=yield v.json():E===\"application/octet-stream\"||E===\"application/pdf\"?w=yield v.blob():E===\"text/event-stream\"?w=v:E===\"multipart/form-data\"?w=yield v.formData():w=yield v.text(),{data:w,error:null,response:v}}catch(u){return{data:null,error:u,response:u instanceof qf||u instanceof jf?u.context:void 0}}finally{a&&clearTimeout(a),l&&((s=r.signal)===null||s===void 0||s.removeEventListener(\"abort\",l))}})}};var zU=t=>Math.min(1e3*2**t,3e4),zre=[520,503],UU=[\"GET\",\"HEAD\",\"OPTIONS\"],kw=class extends Error{constructor(t){super(t.message),this.name=\"PostgrestError\",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Pg(t){\"@babel/helpers - typeof\";return Pg=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(e){return typeof e}:function(e){return e&&typeof Symbol==\"function\"&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Pg(t)}function Fre(t,e){if(Pg(t)!=\"object\"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||\"default\");if(Pg(r)!=\"object\")return r;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(e===\"string\"?String:Number)(t)}function Hre(t){var e=Fre(t,\"string\");return Pg(e)==\"symbol\"?e:e+\"\"}function $re(t,e,n){return(e=Hre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FU(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Kf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?FU(Object(n),!0).forEach(function(r){$re(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):FU(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function HU(t,e){return new Promise(n=>{if(e?.aborted){n();return}let r=setTimeout(()=>{e?.removeEventListener(\"abort\",o),n()},t);function o(){clearTimeout(r),n()}e?.addEventListener(\"abort\",o)})}function Ure(t,e,n,r){return!(!r||n>=3||!UU.includes(t)||!zre.includes(e))}var jre=class{constructor(t){var e,n,r,o,s;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=t.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(o=t.urlLengthLimit)!==null&&o!==void 0?o:8e3,this.retryEnabled=(s=t.retry)!==null&&s!==void 0?s:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get(\"Accept\")===\"text/csv\")throw new Error(\"stripNulls() cannot be used with csv()\");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var n=this;if(this.schema===void 0||([\"GET\",\"HEAD\"].includes(this.method)?this.headers.set(\"Accept-Profile\",this.schema):this.headers.set(\"Content-Profile\",this.schema)),this.method!==\"GET\"&&this.method!==\"HEAD\"&&this.headers.set(\"Content-Type\",\"application/json\"),this.shouldStripNulls){let a=this.headers.get(\"Accept\");a===\"application/vnd.pgrst.object+json\"?this.headers.set(\"Accept\",\"application/vnd.pgrst.object+json;nulls=stripped\"):(!a||a===\"application/json\")&&this.headers.set(\"Accept\",\"application/vnd.pgrst.array+json;nulls=stripped\")}let r=this.fetch,s=(async()=>{let a=0;for(;;){let u={};n.headers.forEach((d,f)=>{u[f]=d}),a>0&&(u[\"X-Retry-Count\"]=String(a));let c;try{c=await r(n.url.toString(),{method:n.method,headers:u,body:JSON.stringify(n.body,(d,f)=>typeof f==\"bigint\"?f.toString():f),signal:n.signal})}catch(d){if(d?.name===\"AbortError\"||d?.code===\"ABORT_ERR\"||!UU.includes(n.method))throw d;if(n.retryEnabled&&a<3){let f=zU(a);a++,await HU(f,n.signal);continue}throw d}if(Ure(n.method,c.status,a,n.retryEnabled)){var i,l;let d=(i=(l=c.headers)===null||l===void 0?void 0:l.get(\"Retry-After\"))!==null&&i!==void 0?i:null,f=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:zU(a);await c.text(),a++,await HU(f,n.signal);continue}return await n.processResponse(c)}})();return this.shouldThrowOnError||(s=s.catch(a=>{var i;let l=\"\",u=\"\",c=\"\",d=a?.cause;if(d){var f,p,h,g;let b=(f=d?.message)!==null&&f!==void 0?f:\"\",x=(p=d?.code)!==null&&p!==void 0?p:\"\";l=`${(h=a?.name)!==null&&h!==void 0?h:\"FetchError\"}: ${a?.message}`,l+=`\n\nCaused by: ${(g=d?.name)!==null&&g!==void 0?g:\"Error\"}: ${b}`,x&&(l+=` (${x})`),d?.stack&&(l+=`\n${d.stack}`)}else{var m;l=(m=a?.stack)!==null&&m!==void 0?m:\"\"}let y=this.url.toString().length;return a?.name===\"AbortError\"||a?.code===\"ABORT_ERR\"?(c=\"\",u=\"Request was aborted (timeout or manual cancellation)\",y>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${y} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(d?.name===\"HeadersOverflowError\"||d?.code===\"UND_ERR_HEADERS_OVERFLOW\")&&(c=\"\",u=\"HTTP headers exceeded server limits (typically 16KB)\",y>this.urlLengthLimit&&(u+=`. Your request URL is ${y} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(i=a?.name)!==null&&i!==void 0?i:\"FetchError\"}: ${a?.message}`,details:l,hint:u,code:c},data:null,count:null,status:0,statusText:\"\"}})),s.then(t,e)}async processResponse(t){var e=this;let n=null,r=null,o=null,s=t.status,a=t.statusText;if(t.ok){var i,l;if(e.method!==\"HEAD\"){var u;let p=await t.text();if(p!==\"\")if(e.headers.get(\"Accept\")===\"text/csv\")r=p;else if(e.headers.get(\"Accept\")&&(!((u=e.headers.get(\"Accept\"))===null||u===void 0)&&u.includes(\"application/vnd.pgrst.plan+text\")))r=p;else try{r=JSON.parse(p)}catch{if(n={message:p},r=null,e.shouldThrowOnError)throw new kw({message:p,details:\"\",hint:\"\",code:\"\"})}}let d=(i=e.headers.get(\"Prefer\"))===null||i===void 0?void 0:i.match(/count=(exact|planned|estimated)/),f=(l=t.headers.get(\"content-range\"))===null||l===void 0?void 0:l.split(\"/\");if(d&&f&&f.length>1&&(o=parseInt(f[1])),e.isMaybeSingle&&Array.isArray(r))if(r.length>1){if(n={code:\"PGRST116\",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:\"JSON object requested, multiple (or no) rows returned\"},r=null,o=null,s=406,a=\"Not Acceptable\",e.shouldThrowOnError){var c;throw new kw(Kf(Kf({},n),{},{hint:(c=n.hint)!==null&&c!==void 0?c:\"\"}))}}else r.length===1?r=r[0]:r=null}else{let d=await t.text();try{n=JSON.parse(d),Array.isArray(n)&&t.status===404&&(r=[],n=null,s=200,a=\"OK\")}catch{t.status===404&&d===\"\"?(s=204,a=\"No Content\"):n={message:d}}if(n&&e.shouldThrowOnError)throw new kw(n)}return{success:n===null,error:n,data:r,count:o,status:s,statusText:a}}returns(){return this}overrideTypes(){return this}},qre=class extends jre{throwOnError(){return super.throwOnError()}select(t){let e=!1,n=(t??\"*\").split(\"\").map(r=>/\\s/.test(r)&&!e?\"\":(r==='\"'&&(e=!e),r)).join(\"\");return this.url.searchParams.set(\"select\",n),this.headers.append(\"Prefer\",\"return=representation\"),this}order(t,{ascending:e=!0,nullsFirst:n,foreignTable:r,referencedTable:o=r}={}){let s=o?`${o}.order`:\"order\",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:\"\"}${t}.${e?\"asc\":\"desc\"}${n===void 0?\"\":n?\".nullsfirst\":\".nullslast\"}`),this}limit(t,{foreignTable:e,referencedTable:n=e}={}){let r=typeof n>\"u\"?\"limit\":`${n}.limit`;return this.url.searchParams.set(r,`${t}`),this}range(t,e,{foreignTable:n,referencedTable:r=n}={}){let o=typeof r>\"u\"?\"offset\":`${r}.offset`,s=typeof r>\"u\"?\"limit\":`${r}.limit`;return this.url.searchParams.set(o,`${t}`),this.url.searchParams.set(s,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set(\"Accept\",\"application/vnd.pgrst.object+json\"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set(\"Accept\",\"text/csv\"),this}geojson(){return this.headers.set(\"Accept\",\"application/geo+json\"),this}explain({analyze:t=!1,verbose:e=!1,settings:n=!1,buffers:r=!1,wal:o=!1,format:s=\"text\"}={}){var a;let i=[t?\"analyze\":null,e?\"verbose\":null,n?\"settings\":null,r?\"buffers\":null,o?\"wal\":null].filter(Boolean).join(\"|\"),l=(a=this.headers.get(\"Accept\"))!==null&&a!==void 0?a:\"application/json\";return this.headers.set(\"Accept\",`application/vnd.pgrst.plan+${s}; for=\"${l}\"; options=${i};`),s===\"json\"?this:this}rollback(){return this.headers.append(\"Prefer\",\"tx=rollback\"),this}returns(){return this}maxAffected(t){return this.headers.append(\"Prefer\",\"handling=strict\"),this.headers.append(\"Prefer\",`max-affected=${t}`),this}},$U=new RegExp(\"[,()]\"),Vf=class extends qre{throwOnError(){return super.throwOnError()}eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(\",\")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(\",\")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(\",\")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(\",\")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){let n=Array.from(new Set(e)).map(r=>typeof r==\"string\"&&$U.test(r)?`\"${r}\"`:`${r}`).join(\",\");return this.url.searchParams.append(t,`in.(${n})`),this}notIn(t,e){let n=Array.from(new Set(e)).map(r=>typeof r==\"string\"&&$U.test(r)?`\"${r}\"`:`${r}`).join(\",\");return this.url.searchParams.append(t,`not.in.(${n})`),this}contains(t,e){return typeof e==\"string\"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(\",\")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e==\"string\"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(\",\")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e==\"string\"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(\",\")}}`),this}textSearch(t,e,{config:n,type:r}={}){let o=\"\";r===\"plain\"?o=\"pl\":r===\"phrase\"?o=\"ph\":r===\"websearch\"&&(o=\"w\");let s=n===void 0?\"\":`(${n})`;return this.url.searchParams.append(t,`${o}fts${s}.${e}`),this}match(t){return Object.entries(t).filter(([e,n])=>n!==void 0).forEach(([e,n])=>{this.url.searchParams.append(e,`eq.${n}`)}),this}not(t,e,n){return this.url.searchParams.append(t,`not.${e}.${n}`),this}or(t,{foreignTable:e,referencedTable:n=e}={}){let r=n?`${n}.or`:\"or\";return this.url.searchParams.append(r,`(${t})`),this}filter(t,e,n){return this.url.searchParams.append(t,`${e}.${n}`),this}},Vre=class{constructor(t,{headers:e={},schema:n,fetch:r,urlLengthLimit:o=8e3,retry:s}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r,this.urlLengthLimit=o,this.retry=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){let{head:n=!1,count:r}=e??{},o=n?\"HEAD\":\"GET\",s=!1,a=(t??\"*\").split(\"\").map(u=>/\\s/.test(u)&&!s?\"\":(u==='\"'&&(s=!s),u)).join(\"\"),{url:i,headers:l}=this.cloneRequestState();return i.searchParams.set(\"select\",a),r&&l.append(\"Prefer\",`count=${r}`),new Vf({method:o,url:i,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:n=!0}={}){var r;let o=\"POST\",{url:s,headers:a}=this.cloneRequestState();if(e&&a.append(\"Prefer\",`count=${e}`),n||a.append(\"Prefer\",\"missing=default\"),Array.isArray(t)){let i=t.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(i.length>0){let l=[...new Set(i)].map(u=>`\"${u}\"`);s.searchParams.set(\"columns\",l.join(\",\"))}}return new Vf({method:o,url:s,headers:a,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:n=!1,count:r,defaultToNull:o=!0}={}){var s;let a=\"POST\",{url:i,headers:l}=this.cloneRequestState();if(l.append(\"Prefer\",`resolution=${n?\"ignore\":\"merge\"}-duplicates`),e!==void 0&&i.searchParams.set(\"on_conflict\",e),r&&l.append(\"Prefer\",`count=${r}`),o||l.append(\"Prefer\",\"missing=default\"),Array.isArray(t)){let u=t.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){let c=[...new Set(u)].map(d=>`\"${d}\"`);i.searchParams.set(\"columns\",c.join(\",\"))}}return new Vf({method:a,url:i,headers:l,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var n;let r=\"PATCH\",{url:o,headers:s}=this.cloneRequestState();return e&&s.append(\"Prefer\",`count=${e}`),new Vf({method:r,url:o,headers:s,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;let n=\"DELETE\",{url:r,headers:o}=this.cloneRequestState();return t&&o.append(\"Prefer\",`count=${t}`),new Vf({method:n,url:r,headers:o,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},jU=class qU{constructor(e,{headers:n={},schema:r,fetch:o,timeout:s,urlLengthLimit:a=8e3,retry:i}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=a;let l=o??globalThis.fetch;s!==void 0&&s>0?this.fetch=(u,c)=>{let d=new AbortController,f=setTimeout(()=>d.abort(),s),p=c?.signal;if(p){if(p.aborted)return clearTimeout(f),l(u,c);let h=()=>{clearTimeout(f),d.abort()};return p.addEventListener(\"abort\",h,{once:!0}),l(u,Kf(Kf({},c),{},{signal:d.signal})).finally(()=>{clearTimeout(f),p.removeEventListener(\"abort\",h)})}return l(u,Kf(Kf({},c),{},{signal:d.signal})).finally(()=>clearTimeout(f))}:this.fetch=l,this.retry=i}from(e){if(!e||typeof e!=\"string\"||e.trim()===\"\")throw new Error(\"Invalid relation name: relation must be a non-empty string.\");return new Vre(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new qU(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,n={},{head:r=!1,get:o=!1,count:s}={}){var a;let i,l=new URL(`${this.url}/rpc/${e}`),u,c=p=>p!==null&&typeof p==\"object\"&&(!Array.isArray(p)||p.some(c)),d=r&&Object.values(n).some(c);d?(i=\"POST\",u=n):r||o?(i=r?\"HEAD\":\"GET\",Object.entries(n).filter(([p,h])=>h!==void 0).map(([p,h])=>[p,Array.isArray(h)?`{${h.join(\",\")}}`:`${h}`]).forEach(([p,h])=>{l.searchParams.append(p,h)})):(i=\"POST\",u=n);let f=new Headers(this.headers);return d?f.set(\"Prefer\",s?`count=${s},return=minimal`:\"return=minimal\"):s&&f.set(\"Prefer\",`count=${s}`),new Vf({method:i,url:l,headers:f,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};var DE=class{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<\"u\")return{type:\"native\",wsConstructor:WebSocket};let n=globalThis;if(typeof globalThis<\"u\"&&typeof n.WebSocket<\"u\")return{type:\"native\",wsConstructor:n.WebSocket};let r=typeof global<\"u\"?global:void 0;if(r&&typeof r.WebSocket<\"u\")return{type:\"native\",wsConstructor:r.WebSocket};if(typeof globalThis<\"u\"&&typeof n.WebSocketPair<\"u\"&&typeof globalThis.WebSocket>\"u\")return{type:\"cloudflare\",error:\"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.\",workaround:\"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime.\"};if(typeof globalThis<\"u\"&&n.EdgeRuntime||typeof navigator<\"u\"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes(\"Vercel-Edge\")))return{type:\"unsupported\",error:\"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.\",workaround:\"Use serverless functions or a different deployment target for WebSocket functionality.\"};let o=globalThis.process;if(o){let s=o.versions;if(s&&s.node)return{type:\"unsupported\",error:\"Node.js detected but native WebSocket not found.\",workaround:\"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option.\"}}return{type:\"unsupported\",error:\"Unknown JavaScript runtime without WebSocket support.\",workaround:\"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation.\"}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let n=e.error||\"WebSocket not supported in this environment.\";throw e.workaround&&(n+=`\n\nSuggested solution: ${e.workaround}`),new Error(n)}static isWebSocketSupported(){try{return this.detectEnvironment().type===\"native\"}catch{return!1}}},NE=DE;var VU=\"2.113.0\";var KU=`realtime-js/${VU}`,GU=\"1.0.0\",PE=\"2.0.0\",WU=PE;var XU=1e4,JU=15e3,YU=1e4;var ZU=100;var Hs={closed:\"closed\",errored:\"errored\",joined:\"joined\",joining:\"joining\",leaving:\"leaving\"},Cw={close:\"phx_close\",error:\"phx_error\",join:\"phx_join\",reply:\"phx_reply\",leave:\"phx_leave\",access_token:\"access_token\"};var Bg={connecting:\"connecting\",open:\"open\",closing:\"closing\",closed:\"closed\"};var zg=class{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT=\"broadcast\",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event==\"string\")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r;let o=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(e){var n,r;let o=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(e,n,r){var o,s;let a=new TextEncoder,i=a.encode(e.topic),l=a.encode((o=e.ref)!==null&&o!==void 0?o:\"\"),u=a.encode((s=e.join_ref)!==null&&s!==void 0?s:\"\"),c=a.encode(e.payload.event),d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},f=a.encode(Object.keys(d).length===0?\"\":JSON.stringify(d));if(u.length>255)throw new Error(`joinRef length ${u.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);let p=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+l.length+i.length+c.length+f.length,h=new ArrayBuffer(this.HEADER_LENGTH+p),g=new DataView(h),m=new Uint8Array(h),y=0;g.setUint8(y++,this.KINDS.userBroadcastPush),g.setUint8(y++,u.length),g.setUint8(y++,l.length),g.setUint8(y++,i.length),g.setUint8(y++,c.length),g.setUint8(y++,f.length),g.setUint8(y++,n),m.set(u,y),y+=u.length,m.set(l,y),y+=l.length,m.set(i,y),y+=i.length,m.set(c,y),y+=c.length,m.set(f,y),y+=f.length;var b=new Uint8Array(h.byteLength+r.byteLength);return b.set(new Uint8Array(h),0),b.set(new Uint8Array(r),h.byteLength),b.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e==\"string\"){let r=JSON.parse(e),[o,s,a,i,l]=r;return n({join_ref:o,ref:s,topic:a,event:i,payload:l})}return n({})}_binaryDecode(e){let n=new DataView(e),r=n.getUint8(0),o=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,n,o)}_decodeUserBroadcast(e,n,r){let o=n.getUint8(1),s=n.getUint8(2),a=n.getUint8(3),i=n.getUint8(4),l=this.HEADER_LENGTH+4,u=r.decode(e.slice(l,l+o));l=l+o;let c=r.decode(e.slice(l,l+s));l=l+s;let d=r.decode(e.slice(l,l+a));l=l+a;let f=e.slice(l,e.byteLength),p=i===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,h={type:this.BROADCAST_EVENT,event:c,payload:p};return a>0&&(h.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:h}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e?.constructor)===null||n===void 0?void 0:n.name)===\"ArrayBuffer\"}_pick(e,n){return!e||typeof e!=\"object\"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}};var gt;(function(t){t.abstime=\"abstime\",t.bool=\"bool\",t.date=\"date\",t.daterange=\"daterange\",t.float4=\"float4\",t.float8=\"float8\",t.int2=\"int2\",t.int4=\"int4\",t.int4range=\"int4range\",t.int8=\"int8\",t.int8range=\"int8range\",t.json=\"json\",t.jsonb=\"jsonb\",t.money=\"money\",t.numeric=\"numeric\",t.oid=\"oid\",t.reltime=\"reltime\",t.text=\"text\",t.time=\"time\",t.timestamp=\"timestamp\",t.timestamptz=\"timestamptz\",t.timetz=\"timetz\",t.tsrange=\"tsrange\",t.tstzrange=\"tstzrange\"})(gt||(gt={}));var zE=(t,e,n={})=>{var r;let o=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((s,a)=>(s[a]=Kre(a,t,e,o),s),{}):{}},Kre=(t,e,n,r)=>{let o=e.find(i=>i.name===t),s=o?.type,a=n[t];return s&&!r.includes(s)?QU(s,a):BE(a)},QU=(t,e)=>{if(t.charAt(0)===\"_\"){let n=t.slice(1,t.length);return Jre(e,n)}switch(t){case gt.bool:return Gre(e);case gt.float4:case gt.float8:case gt.int2:case gt.int4:case gt.int8:case gt.numeric:case gt.oid:return Wre(e);case gt.json:case gt.jsonb:return Xre(e);case gt.timestamp:return Yre(e);case gt.abstime:case gt.date:case gt.daterange:case gt.int4range:case gt.int8range:case gt.money:case gt.reltime:case gt.text:case gt.time:case gt.timestamptz:case gt.timetz:case gt.tsrange:case gt.tstzrange:return BE(e);default:return BE(e)}},BE=t=>t,Gre=t=>{switch(t){case\"t\":return!0;case\"f\":return!1;default:return t}},Wre=t=>{if(typeof t==\"string\"){let e=parseFloat(t);if(!Number.isNaN(e))return e}return t},Xre=t=>{if(typeof t==\"string\")try{return JSON.parse(t)}catch{return t}return t},Jre=(t,e)=>{if(typeof t!=\"string\")return t;let n=t.length-1,r=t[n];if(t[0]===\"{\"&&r===\"}\"){let s,a=t.slice(1,n);try{s=JSON.parse(\"[\"+a+\"]\")}catch{s=a?a.split(\",\"):[]}return s.map(i=>QU(e,i))}return t},Yre=t=>typeof t==\"string\"?t.replace(\" \",\"T\"):t,Lw=t=>{let e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,\"http\"),e.pathname=e.pathname.replace(/\\/+$/,\"\").replace(/\\/socket\\/websocket$/i,\"\").replace(/\\/socket$/i,\"\").replace(/\\/websocket$/i,\"\"),e.pathname===\"\"||e.pathname===\"/\"?e.pathname=\"/api/broadcast\":e.pathname=e.pathname+\"/api/broadcast\",e.href};var Xf=t=>typeof t==\"function\"?t:function(){return t},Qre=typeof self<\"u\"?self:null,Wf=typeof window<\"u\"?window:null,$s=Qre||Wf||globalThis,eoe=\"2.0.0\",toe=1e4,noe=1e3,roe=100,Us={connecting:0,open:1,closing:2,closed:3},Rr={closed:\"closed\",errored:\"errored\",joined:\"joined\",joining:\"joining\",leaving:\"leaving\"},qa={close:\"phx_close\",error:\"phx_error\",join:\"phx_join\",reply:\"phx_reply\",leave:\"phx_leave\"},FE={longpoll:\"longpoll\",websocket:\"websocket\"},ooe={complete:4},HE=\"base64url.bearer.phx.\",Aw=class{constructor(t,e,n,r){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived(\"timeout\")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger(\"timeout\",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},ej=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},soe=class{constructor(t,e,n){this.state=Rr.closed,this.topic=t,this.params=Xf(e||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Aw(this,qa.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new ej(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive(\"ok\",()=>{this.state=Rr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive(\"error\",r=>{this.state=Rr.errored,this.socket.hasLogger()&&this.socket.log(\"channel\",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log(\"channel\",`close ${this.topic}`),this.state=Rr.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log(\"channel\",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=Rr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive(\"timeout\",()=>{this.socket.hasLogger()&&this.socket.log(\"channel\",`timeout ${this.topic}`,this.joinPush.timeout),new Aw(this,qa.leave,Xf({}),this.timeout).send(),this.state=Rr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(qa.reply,(r,o)=>{this.trigger(this.replyEventName(o),r)})}join(t=this.timeout){if(this.joinedOnce)throw new Error(\"tried to join multiple times. 'join' can only be called a single time per channel instance\");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Rr.closed,this.bindings=[]}onClose(t){this.on(qa.close,t)}onError(t){return this.on(qa.error,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(typeof e>\"u\"||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Aw(this,t,function(){return e},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Rr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log(\"channel\",`leave ${this.topic}`),this.trigger(qa.close,\"leave\")},n=new Aw(this,qa.leave,Xf({}),t);return n.receive(\"ok\",()=>e()).receive(\"timeout\",()=>e()),n.send(),this.canPush()||n.trigger(\"ok\",{}),n}onMessage(t,e,n){return e}filterBindings(t,e,n){return!0}isMember(t,e,n,r){return this.topic!==t?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log(\"channel\",\"dropping outdated message\",{topic:t,event:e,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Rr.joining,this.joinPush.resend(t))}trigger(t,e,n,r){let o=this.onMessage(t,e,n,r);if(e&&!o)throw new Error(\"channel onMessage callbacks must return the payload, modified or unmodified\");let s=this.bindings.filter(a=>a.event===t&&this.filterBindings(a,e,n));for(let a=0;a<s.length;a++)s[a].callback(o,n,r||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Rr.closed}isErrored(){return this.state===Rr.errored}isJoined(){return this.state===Rr.joined}isJoining(){return this.state===Rr.joining}isLeaving(){return this.state===Rr.leaving}},Tw=class{static request(t,e,n,r,o,s,a){if($s.XDomainRequest){let i=new $s.XDomainRequest;return this.xdomainRequest(i,t,e,r,o,s,a)}else if($s.XMLHttpRequest){let i=new $s.XMLHttpRequest;return this.xhrRequest(i,t,e,n,r,o,s,a)}else{if($s.fetch&&$s.AbortController)return this.fetchRequest(t,e,n,r,o,s,a);throw new Error(\"No suitable XMLHttpRequest implementation found\")}}static fetchRequest(t,e,n,r,o,s,a){let i={method:t,headers:n,body:r},l=null;if(o){l=new AbortController;let u=setTimeout(()=>l.abort(),o);i.signal=l.signal}return $s.fetch(e,i).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>a&&a(u)).catch(u=>{u.name===\"AbortError\"&&s?s():a&&a(null)}),l}static xdomainRequest(t,e,n,r,o,s,a){return t.timeout=o,t.open(e,n),t.onload=()=>{let i=this.parseJSON(t.responseText);a&&a(i)},s&&(t.ontimeout=s),t.onprogress=()=>{},t.send(r),t}static xhrRequest(t,e,n,r,o,s,a,i){t.open(e,n,!0),t.timeout=s;for(let[l,u]of Object.entries(r))t.setRequestHeader(l,u);return t.onerror=()=>i&&i(null),t.onreadystatechange=()=>{if(t.readyState===ooe.complete&&i){let l=this.parseJSON(t.responseText);i(l)}},a&&(t.ontimeout=a),t.send(o),t}static parseJSON(t){if(!t||t===\"\")return null;try{return JSON.parse(t)}catch{return console&&console.log(\"failed to parse JSON response\",t),null}}static serialize(t,e){let n=[];for(var r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let o=e?`${e}[${r}]`:r,s=t[r];typeof s==\"object\"?n.push(this.serialize(s,o)):n.push(encodeURIComponent(o)+\"=\"+encodeURIComponent(s))}return n.join(\"&\")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let n=t.match(/\\?/)?\"&\":\"?\";return`${t}${n}${this.serialize(e)}`}},aoe=t=>{let e=\"\",n=new Uint8Array(t),r=n.byteLength;for(let o=0;o<r;o++)e+=String.fromCharCode(n[o]);return btoa(e)},Gf=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(HE)&&(this.authToken=atob(e[1].slice(HE.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=Us.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace(\"ws://\",\"http://\").replace(\"wss://\",\"https://\").replace(new RegExp(\"(.*)/\"+FE.websocket),\"$1/\"+FE.longpoll)}endpointURL(){return Tw.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=Us.connecting}ontimeout(){this.onerror(\"timeout\"),this.closeAndRetry(1005,\"timeout\",!1)}isActive(){return this.readyState===Us.open||this.readyState===Us.connecting}poll(){let t={Accept:\"application/json\"};this.authToken&&(t[\"X-Phoenix-AuthToken\"]=this.authToken),this.ajax(\"GET\",t,null,()=>this.ontimeout(),e=>{if(e){var{status:n,token:r,messages:o}=e;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,\"session_gone\",!1);return}this.token=r}else n=0;switch(n){case 200:o.forEach(s=>{setTimeout(()=>this.onmessage({data:s}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Us.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,\"forbidden\",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,\"internal server error\",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(t){typeof t!=\"string\"&&(t=aoe(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t,e=0){this.awaitingBatchAck=!0;let n=e+roe,r=t.slice(e,n);this.ajax(\"POST\",{\"Content-Type\":\"application/x-ndjson\"},r.join(`\n`),()=>this.onerror(\"timeout\"),o=>{!o||o.status!==200?(this.awaitingBatchAck=!1,this.onerror(o&&o.status),this.closeAndRetry(1011,\"internal server error\",!1)):n<t.length?this.batchSend(t,n):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(t,e,n){for(let o of this.reqs)o.abort();this.readyState=Us.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<\"u\"?this.onclose(new CloseEvent(\"close\",r)):this.onclose(r)}ajax(t,e,n,r,o){let s,a=()=>{this.reqs.delete(s),r()};s=Tw.request(t,this.endpointURL(),e,n,this.timeout,a,i=>{this.reqs.delete(s),this.isActive()&&o(i)}),this.reqs.add(s)}},tj=class Fg{constructor(e,n={}){let r=n.events||{state:\"presence_state\",diff:\"presence_diff\"};this.state=Object.create(null),this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,o=>{let{onJoin:s,onLeave:a,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Fg.syncState(this.state,o,s,a),this.pendingDiffs.forEach(l=>{this.state=Fg.syncDiff(this.state,l,s,a)}),this.pendingDiffs=[],i()}),this.channel.on(r.diff,o=>{let{onJoin:s,onLeave:a,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=Fg.syncDiff(this.state,o,s,a),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Fg.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,n,r,o){let s=this.toNullProtoObj(this.clone(e));n=this.toNullProtoObj(n);let a=Object.create(null),i=Object.create(null);return this.map(s,(l,u)=>{n[l]||(i[l]=u)}),this.map(n,(l,u)=>{let c=s[l];if(c){let d=u.metas.map(g=>g.phx_ref),f=c.metas.map(g=>g.phx_ref),p=u.metas.filter(g=>f.indexOf(g.phx_ref)<0),h=c.metas.filter(g=>d.indexOf(g.phx_ref)<0);p.length>0&&(a[l]=u,a[l].metas=p),h.length>0&&(i[l]=this.clone(c),i[l].metas=h)}else a[l]=u}),this.syncDiff(s,{joins:a,leaves:i},r,o)}static syncDiff(e,n,r,o){e=this.toNullProtoObj(e);let{joins:s,leaves:a}=this.clone(n);return r||(r=function(){}),o||(o=function(){}),this.map(s,(i,l)=>{let u=e[i];if(e[i]=this.clone(l),u){let c=e[i].metas.map(f=>f.phx_ref),d=u.metas.filter(f=>c.indexOf(f.phx_ref)<0);e[i].metas.unshift(...d)}r(i,u,l)}),this.map(a,(i,l)=>{let u=e[i];if(!u)return;let c=l.metas.map(d=>d.phx_ref);u.metas=u.metas.filter(d=>c.indexOf(d.phx_ref)<0),o(i,u,l),u.metas.length===0&&delete e[i]}),e}static list(e,n){return n||(n=function(r,o){return o}),this.map(e,(r,o)=>n(r,o))}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static toNullProtoObj(e){if(Object.getPrototypeOf(e)===null)return e;let n=Object.create(null);return Object.getOwnPropertyNames(e).forEach(r=>{n[r]=e[r]}),n}static clone(e){return JSON.parse(JSON.stringify(e))}},Ew={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,r,o,s,a]=JSON.parse(t);return e({join_ref:n,ref:r,topic:o,event:s,payload:a})}},binaryEncode(t){let{join_ref:e,ref:n,event:r,topic:o,payload:s}=t,a=new TextEncoder,i=a.encode(e),l=a.encode(n),u=a.encode(o),c=a.encode(r);this.assertFieldSize(i.byteLength,\"join_ref\"),this.assertFieldSize(l.byteLength,\"ref\"),this.assertFieldSize(u.byteLength,\"topic\"),this.assertFieldSize(c.byteLength,\"event\");let d=this.META_LENGTH+i.byteLength+l.byteLength+u.byteLength+c.byteLength,f=new ArrayBuffer(this.HEADER_LENGTH+d),p=new Uint8Array(f),h=new DataView(f),g=0;h.setUint8(g++,this.KINDS.push),h.setUint8(g++,i.byteLength),h.setUint8(g++,l.byteLength),h.setUint8(g++,u.byteLength),h.setUint8(g++,c.byteLength),p.set(i,g),g+=i.byteLength,p.set(l,g),g+=l.byteLength,p.set(u,g),g+=u.byteLength,p.set(c,g),g+=c.byteLength;var m=new Uint8Array(f.byteLength+s.byteLength);return m.set(p,0),m.set(new Uint8Array(s),f.byteLength),m.buffer},assertFieldSize(t,e){if(t>255)throw new Error(`unable to convert ${e} to binary: must be less than or equal to 255 bytes, but is ${t} bytes`)},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,r);case this.KINDS.reply:return this.decodeReply(t,e,r);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,r)}},decodePush(t,e,n){let r=e.getUint8(1),o=e.getUint8(2),s=e.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,i=n.decode(t.slice(a,a+r));a=a+r;let l=n.decode(t.slice(a,a+o));a=a+o;let u=n.decode(t.slice(a,a+s));a=a+s;let c=t.slice(a,t.byteLength);return{join_ref:i,ref:null,topic:l,event:u,payload:c}},decodeReply(t,e,n){let r=e.getUint8(1),o=e.getUint8(2),s=e.getUint8(3),a=e.getUint8(4),i=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(t.slice(i,i+r));i=i+r;let u=n.decode(t.slice(i,i+o));i=i+o;let c=n.decode(t.slice(i,i+s));i=i+s;let d=n.decode(t.slice(i,i+a));i=i+a;let f=t.slice(i,t.byteLength),p={status:d,response:f};return{join_ref:l,ref:u,topic:c,event:qa.reply,payload:p}},decodeBroadcast(t,e,n){let r=e.getUint8(1),o=e.getUint8(2),s=this.HEADER_LENGTH+2,a=n.decode(t.slice(s,s+r));s=s+r;let i=n.decode(t.slice(s,s+o));s=s+o;let l=t.slice(s,t.byteLength);return{join_ref:null,ref:null,topic:a,event:i,payload:l}}},nj=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||toe,this.transport=e.transport||$s.WebSocket||Gf,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=$s&&$s.sessionStorage}catch{}this.sessionStore=e.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=Ew.encode.bind(Ew),this.defaultDecoder=Ew.decode.bind(Ew),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||\"arraybuffer\",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Gf?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Wf&&Wf.addEventListener&&(Wf.addEventListener(\"pagehide\",o=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Wf.addEventListener(\"pageshow\",o=>{r===this.connectClock&&(r=null,this.connect())}),Wf.addEventListener(\"visibilitychange\",()=>{document.visibilityState===\"hidden\"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=o=>e.rejoinAfterMs?e.rejoinAfterMs(o):[1e3,2e3,5e3][o-1]||1e4,this.reconnectAfterMs=o=>e.reconnectAfterMs?e.reconnectAfterMs(o):[10,50,100,150,200,250,500,1e3,2e3][o-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(o,s,a)=>{console.log(`${o}: ${s}`,a)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Xf(e.params||{}),this.endPoint=`${t}/${FE.websocket}`,this.vsn=e.vsn||eoe,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new ej(()=>{if(this.pageHidden){this.log(\"Not reconnecting as page is hidden!\"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken&&Xf(e.authToken)}getLongPollTransport(){return Gf}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?\"wss\":\"ws\"}endPointURL(){let t=Tw.appendParams(Tw.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!==\"/\"?t:t.charAt(1)===\"/\"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,n)}connect(t){t&&(console&&console.log(\"passing params to connect is deprecated. Instead pass :params to the Socket constructor\"),this.params=Xf(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Gf?this.connectWithFallback(Gf,this.longPollFallbackMs):this.transportConnect())}log(t,e,n){this.logger&&this.logger(t,e,n)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),n=Date.now();this.push({topic:\"phoenix\",event:\"heartbeat\",payload:{},ref:e});let r=this.onMessage(o=>{o.ref===e&&(this.off([r]),t(Date.now()-n))});return!0}transportName(t){return t===Gf?\"LongPoll\":t.name}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=[\"phoenix\",`${HE}${btoa(this.authToken()).replace(/=/g,\"\")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,o,s,a=this.transportName(t),i=l=>{this.log(\"transport\",`falling back to ${a}...`,l),this.off([o,s]),r=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return i(\"memorized\");this.fallbackTimer=setTimeout(i,e),s=this.onError(l=>{this.log(\"transport\",\"error\",l),r&&!n&&(clearTimeout(this.fallbackTimer),i(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let l=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,\"true\"),this.log(\"transport\",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(i,e),this.ping(l=>{this.log(\"transport\",\"connected to primary after\",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log(\"transport\",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks(\"open\")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log(\"transport\",\"heartbeat timeout. Attempting to re-establish connection\");try{this.heartbeatCallback(\"timeout\")}catch(t){this.log(\"error\",\"error in heartbeat callback\",t)}this.triggerChanError(new Error(\"heartbeat timeout\")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),noe,\"heartbeat timeout\")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();let r=this.conn;this.waitForBufferDone(r,()=>{e?r.close(e,n||\"\"):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,n=1){if(n===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,n+1)},150*n)}waitForSocketClosed(t,e,n=1){if(n===5||t.readyState===Us.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,n+1)},150*n)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log(\"transport\",\"close\",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks(\"close\",t)}onConnError(t){this.hasLogger()&&this.log(\"transport\",\"error\",t);let e=this.transport,n=this.establishedConnections;this.triggerStateCallbacks(\"error\",t,e,n),(e===this.transport||n>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(qa.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case Us.connecting:return\"connecting\";case Us.open:return\"open\";case Us.closing:return\"closing\";default:return\"closed\"}}isConnected(){return this.connectionState()===\"open\"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([n])=>t.indexOf(n)===-1)}channel(t,e={}){let n=new soe(t,e,this);return this.channels.push(n),n}push(t){if(this.hasLogger()){let{topic:e,event:n,payload:r,ref:o,join_ref:s}=t;this.log(\"push\",`${e} ${n} (${s}, ${o})`,r)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback(\"disconnected\")}catch(t){this.log(\"error\",\"error in heartbeat callback\",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:\"phoenix\",event:\"heartbeat\",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback(\"sent\")}catch(t){this.log(\"error\",\"error in heartbeat callback\",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:n,event:r,payload:o,ref:s,join_ref:a}=e;if(s&&s===this.pendingHeartbeatRef){let i=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(o.status===\"ok\"?\"ok\":\"error\",i)}catch(l){this.log(\"error\",\"error in heartbeat callback\",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log(\"receive\",`${o.status||\"\"} ${n} ${r} ${s&&\"(\"+s+\")\"||\"\"}`.trim(),o);for(let i=0;i<this.channels.length;i++){let l=this.channels[i];l.isMember(n,r,o,a)&&l.trigger(r,o,s,a)}this.triggerStateCallbacks(\"message\",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([n,r])=>{try{r(...e)}catch(o){this.log(\"error\",`error in ${t} callback`,o)}})}catch(n){this.log(\"error\",`error triggering ${t} callbacks`,n)}}leaveOpenTopic(t){let e=this.channels.find(n=>n.topic===t&&(n.isJoined()||n.isJoining()));e&&(this.hasLogger()&&this.log(\"transport\",`leaving duplicate topic \"${t}\"`),e.leave())}};var Hg=class t{constructor(e,n){let r=loe(n);this.presence=new tj(e.getChannel(),r),this.presence.onJoin((o,s,a)=>{let i=t.onJoinPayload(o,s,a);e.getChannel().trigger(\"presence\",i)}),this.presence.onLeave((o,s,a)=>{let i=t.onLeavePayload(o,s,a);e.getChannel().trigger(\"presence\",i)}),this.presence.onSync(()=>{e.getChannel().trigger(\"presence\",{event:\"sync\"})})}get state(){return t.transformState(this.presence.state)}static transformState(e){return e=ioe(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{let o=e[r];return n[r]=Rw(o),n},{})}static onJoinPayload(e,n,r){let o=rj(n),s=Rw(r);return{event:\"join\",key:e,currentPresences:o,newPresences:s}}static onLeavePayload(e,n,r){let o=rj(n),s=Rw(r);return{event:\"leave\",key:e,currentPresences:o,leftPresences:s}}};function Rw(t){return t.metas.map(e=>{let n=Object.getOwnPropertyDescriptors(e),r=Object.defineProperties({},n);return r.presence_ref=r.phx_ref,delete r.phx_ref,delete r.phx_ref_prev,r})}function ioe(t){return JSON.parse(JSON.stringify(t))}function loe(t){return t?.events&&{events:t.events}}function rj(t){return t?.metas?Rw(t):[]}var $E;(function(t){t.SYNC=\"sync\",t.JOIN=\"join\",t.LEAVE=\"leave\"})($E||($E={}));var Jf=class{get state(){return this.presenceAdapter.state}constructor(e,n){this.channel=e,this.presenceAdapter=new Hg(this.channel.channelAdapter,n)}};function oj(t){if(t instanceof Error)return t;if(typeof t==\"string\")return new Error(t);if(t&&typeof t==\"object\"){let e=t;if(typeof e.code==\"number\"){let n=typeof e.reason==\"string\"&&e.reason?` (${e.reason})`:\"\";return new Error(`socket closed: ${e.code}${n}`,{cause:t})}return new Error(\"channel error: transport failure\",{cause:t})}return new Error(\"channel error: connection lost\")}var $g=class{constructor(e,n,r){let o=uoe(r);this.channel=e.getSocket().channel(n,o),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,n){return this.channel.on(e,n)}off(e,n){this.channel.off(e,n)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,n,r){let o;try{o=this.channel.push(e,n,r)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>ZU){let s=this.channel.pushBuffer.shift();s.cancelTimeout(),this.socket.log(\"channel\",`discarded push due to buffer overflow: ${s.event}`,s.payload())}return o}updateJoinPayload(e){let n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),e)}canPush(){return this.socket.isConnected()&&this.state===Hs.joined}isJoined(){return this.state===Hs.joined}isJoining(){return this.state===Hs.joining}isClosed(){return this.state===Hs.closed}isLeaving(){return this.state===Hs.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function uoe(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:\"\",enabled:!1},private:!1},t.config)}}var coe=/[,()\"\\\\]/,doe=t=>coe.test(t)||t!==t.trim(),foe=t=>`\"${t.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"')}\"`,sj=t=>{let e=t===null?\"null\":String(t);return doe(e)?foe(e):e},poe=t=>t===null?\"null\":String(t),hoe=(t,e)=>{if(t===\"in\"){let n=Array.isArray(e)?e:[e];if(n.length===0)throw new Error(\"Realtime `in` filter requires at least one value.\");return`in.(${Array.from(new Set(n)).map(o=>sj(o)).join(\",\")})`}return t===\"is\"?`is.${poe(e)}`:`${t}.${sj(e)}`},Yf=class{constructor(){this.filters=[]}add(e,n,r,o=!1){let s=o?\"not.\":\"\";return this.filters.push(`${e}=${s}${hoe(n,r)}`),this}eq(e,n){return this.add(e,\"eq\",n)}neq(e,n){return this.add(e,\"neq\",n)}gt(e,n){return this.add(e,\"gt\",n)}gte(e,n){return this.add(e,\"gte\",n)}lt(e,n){return this.add(e,\"lt\",n)}lte(e,n){return this.add(e,\"lte\",n)}in(e,n){return this.add(e,\"in\",n)}like(e,n){return this.add(e,\"like\",n)}ilike(e,n){return this.add(e,\"ilike\",n)}match(e,n){return this.add(e,\"match\",n)}imatch(e,n){return this.add(e,\"imatch\",n)}is(e,n){return this.add(e,\"is\",n)}isDistinct(e,n){return this.add(e,\"isdistinct\",n)}not(e,n,r){return this.add(e,n,r,!0)}build(){return this.filters.join(\",\")}toString(){return this.build()}};var UE;(function(t){t.ALL=\"*\",t.INSERT=\"INSERT\",t.UPDATE=\"UPDATE\",t.DELETE=\"DELETE\"})(UE||(UE={}));var fl;(function(t){t.BROADCAST=\"broadcast\",t.PRESENCE=\"presence\",t.POSTGRES_CHANGES=\"postgres_changes\",t.SYSTEM=\"system\"})(fl||(fl={}));var js;(function(t){t.SUBSCRIBED=\"SUBSCRIBED\",t.TIMED_OUT=\"TIMED_OUT\",t.CLOSED=\"CLOSED\",t.CHANNEL_ERROR=\"CHANNEL_ERROR\"})(js||(js={}));var Zf=class t{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,n={config:{}},r){var o,s;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,\"\"),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:\"\",enabled:!1},private:!1},n.config),this.channelAdapter=new $g(this.socket.socketAdapter,e,this.params),this.presence=new Jf(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Lw(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((s=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||s===void 0)&&s.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,n=this.timeout){var r,o,s,a;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:i,presence:l,private:u,postgres_changes_options:c}}=this.params,d=(o=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(m=>m.filter))!==null&&o!==void 0?o:[],f=!!this.bindings[fl.PRESENCE]&&this.bindings[fl.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,p={},h=Object.assign({broadcast:i,presence:Object.assign(Object.assign({},l),{enabled:f}),postgres_changes:d,private:u},c?{postgres_changes_options:c}:{});this.socket.accessTokenValue&&(p.access_token=this.socket.accessTokenValue),this._onError(m=>{e?.(js.CHANNEL_ERROR,oj(m))}),this._onClose(()=>e?.(js.CLOSED)),this.updateJoinPayload(Object.assign({config:h},p)),this._updateFilterMessage();let g=c?.wait&&d.length>0?Math.max(n,((a=c.timeout)!==null&&a!==void 0?a:JU)+YU):n;this.channelAdapter.subscribe(g).receive(\"ok\",async({postgres_changes:m})=>{if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){e?.(js.SUBSCRIBED);return}this._updatePostgresBindings(m,e)}).receive(\"error\",m=>{this.state=Hs.errored;let y=Object.values(m).join(\", \")||\"error\";e?.(js.CHANNEL_ERROR,new Error(y,{cause:m}))}).receive(\"timeout\",()=>{e?.(js.TIMED_OUT)})}return this}_updatePostgresBindings(e,n){var r;let o=this.bindings.postgres_changes,s=(r=o?.length)!==null&&r!==void 0?r:0,a=[];for(let i=0;i<s;i++){let l=o[i],{filter:{event:u,schema:c,table:d,filter:f}}=l,p=e&&e[i];if(p&&p.event===u&&t.isFilterValueEqual(p.schema,c)&&t.isFilterValueEqual(p.table,d)&&t.isFilterValueEqual(p.filter,f))a.push(Object.assign(Object.assign({},l),{id:p.id}));else{this.unsubscribe(),this.state=Hs.errored,n?.(js.CHANNEL_ERROR,new Error(\"mismatch between server and client bindings for postgres changes\"));return}}this.bindings.postgres_changes=a,this.state!=Hs.errored&&n&&n(js.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:\"presence\",event:\"track\",payload:e},n)}async untrack(e={}){return await this.send({type:\"presence\",event:\"untrack\"},e)}on(e,n,r){let o=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=e===fl.PRESENCE||e===fl.POSTGRES_CHANGES;if(o&&s)throw this.socket.log(\"channel\",`cannot add \\`${e}\\` callbacks for ${this.topic} after \\`subscribe()\\`.`),new Error(`cannot add \\`${e}\\` callbacks for ${this.topic} after \\`subscribe()\\`.`);return this._on(e,n,r)}async httpSend(e,n,r={}){var o;if(n==null)return Promise.reject(new Error(\"Payload is required for httpSend()\"));let s=n instanceof ArrayBuffer||ArrayBuffer.isView(n),a={apikey:this.socket.apiKey?this.socket.apiKey:\"\",\"Content-Type\":s?\"application/octet-stream\":\"application/json\"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);let i=new URL(this.broadcastEndpointURL);i.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&i.searchParams.set(\"private\",\"true\");let l={method:\"POST\",headers:a,body:s?n:JSON.stringify(n)},u=await this._fetchWithTimeout(i.toString(),l,(o=r.timeout)!==null&&o!==void 0?o:this.timeout);if(u.status===202)return{success:!0};if(u.status===404)return Promise.reject(new Error(\"httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md\"));let c=u.statusText;try{let d=await u.json();c=d.error||d.message||c}catch{}return Promise.reject(new Error(c))}async send(e,n={}){var r,o;if(!this.channelAdapter.canPush()&&e.type===\"broadcast\"){let s=\"Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.\";this.socket.hasLogger()?this.socket.log(\"channel\",s):console.warn(s);let{event:a,payload:i}=e,l={apikey:this.socket.apiKey?this.socket.apiKey:\"\",\"Content-Type\":\"application/json\"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);let u={method:\"POST\",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:i,private:this.private}]})};try{let c=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((o=c.body)===null||o===void 0?void 0:o.cancel()),c.ok?\"ok\":\"error\"}catch(c){return c instanceof Error&&c.name===\"AbortError\"?\"timed out\":\"error\"}}else return new Promise(s=>{var a,i,l;let u=this.channelAdapter.push(e.type,e,n.timeout||this.timeout);e.type===\"broadcast\"&&!(!((l=(i=(a=this.params)===null||a===void 0?void 0:a.config)===null||i===void 0?void 0:i.broadcast)===null||l===void 0)&&l.ack)&&s(\"ok\"),u.receive(\"ok\",()=>s(\"ok\")),u.receive(\"error\",()=>s(\"error\")),u.receive(\"timeout\",()=>s(\"timed out\"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(e).receive(\"ok\",()=>n(\"ok\")).receive(\"timeout\",()=>n(\"timed out\")).receive(\"error\",()=>n(\"error\"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,n,r){let o=new AbortController,s=setTimeout(()=>o.abort(),r),a=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:o.signal}));return clearTimeout(s),a}_on(e,n,r){var o;let s=e.toLocaleLowerCase(),a=n?.filter;if((a instanceof Yf||typeof a==\"object\"&&a!==null&&typeof a.build==\"function\")&&(n=Object.assign(Object.assign({},n),{filter:a.build()})),s===fl.POSTGRES_CHANGES&&((o=this.bindings[s])===null||o===void 0?void 0:o.find(c=>t.isSamePostgresFilter(c.filter,n))))return this.socket.log(\"error\",`duplicate \\`postgres_changes\\` binding for ${this.topic} ignored`,n),this;let i=this.channelAdapter.on(e,r),l={type:s,filter:n,callback:r,ref:i};return this.bindings[s]?this.bindings[s].push(l):this.bindings[s]=[l],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,n,r)=>{var o,s,a,i,l,u,c;let d=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,r))return!1;let f=(o=this.bindings[d])===null||o===void 0?void 0:o.find(p=>p.ref===e.ref);if(!f)return!0;if([\"broadcast\",\"presence\",\"postgres_changes\"].includes(d))if(\"id\"in f){let p=f.id,h=(s=f.filter)===null||s===void 0?void 0:s.event;return p&&((a=n.ids)===null||a===void 0?void 0:a.includes(p))&&(h===\"*\"||h?.toLocaleLowerCase()===((i=n.data)===null||i===void 0?void 0:i.type.toLocaleLowerCase()))}else{let p=(u=(l=f?.filter)===null||l===void 0?void 0:l.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return p===\"*\"||p===((c=n?.event)===null||c===void 0?void 0:c.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===d})}_notThisChannelEvent(e,n){let{close:r,error:o,leave:s,join:a}=Cw;return n&&[r,o,s,a].includes(e)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,n,r)=>{if(typeof n==\"object\"&&\"ids\"in n){let o=n.data,{schema:s,table:a,commit_timestamp:i,type:l,errors:u}=o;return Object.assign(Object.assign({},{schema:s,table:a,commit_timestamp:i,eventType:l,new:{},old:{},errors:u}),this._getPayloadRecords(o))}return n})}copyBindings(e){if(this.joinedOnce)throw new Error(\"cannot copy bindings into joined channel\");for(let n in e.bindings)for(let r of e.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}static isSamePostgresFilter(e,n){var r,o,s,a;let i=(o=(r=e?.select)===null||r===void 0?void 0:r.join())!==null&&o!==void 0?o:void 0,l=(a=(s=n?.select)===null||s===void 0?void 0:s.join())!==null&&a!==void 0?a:void 0;return e?.event===n?.event&&t.isFilterValueEqual(e?.schema,n?.schema)&&t.isFilterValueEqual(e?.table,n?.table)&&t.isFilterValueEqual(e?.filter,n?.filter)&&i===l}_getPayloadRecords(e){let n={new:{},old:{}};return(e.type===\"INSERT\"||e.type===\"UPDATE\")&&(n.new=zE(e.columns,e.record)),(e.type===\"UPDATE\"||e.type===\"DELETE\")&&(n.old=zE(e.columns,e.old_record)),n}};var Ug=class{constructor(e,n){this.socket=new nj(e,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,n,r,o=1e4){return new Promise(s=>{setTimeout(()=>s(\"timeout\"),o),this.socket.disconnect(()=>{e(),s(\"ok\")},n,r)})}push(e){this.socket.push(e)}log(e,n,r){this.socket.log(e,n,r)}hasLogger(){return this.socket.hasLogger()}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Bg.connecting}isDisconnecting(){return this.socket.connectionState()==Bg.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}};var aj={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},goe=[1e3,2e3,5e3,1e4],yoe=1e4;function boe(){let t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var n;return(n=Array.from(t.keys())[e])!==null&&n!==void 0?n:null},removeItem(e){t.delete(e)},setItem(e,n){t.set(e,String(n))}}}function voe(){try{if(typeof globalThis<\"u\"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return boe()}var xoe=`\n addEventListener(\"message\", (e) => {\n if (e.data.event === \"start\") {\n setInterval(() => postMessage({ event: \"keepAlive\" }), e.data.interval);\n }\n });`,Qf=class{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint=\"\",this.headers={},this.params={},this.ref=0,this.serializer=new zg,this._manuallySetToken=!1,this._authPromise=null,this._authGeneration=0,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=s=>s?(...a)=>s(...a):(...a)=>fetch(...a),!(!((r=n?.params)===null||r===void 0)&&r.apikey))throw new Error(\"API key is required to connect to Realtime\");this.apiKey=n.params.apikey;let o=this._initializeOptions(n);this.socketAdapter=new Ug(e,o),this.httpEndpoint=Lw(e),this.fetch=this._resolveFetch(n?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely(\"connect\"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let n=e.message;throw new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,n){return this._cancelPendingDisconnect(),this.isDisconnecting()?\"ok\":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,n)}getChannels(){return this.channels}async removeChannel(e){let n=await e.unsubscribe();return n===\"ok\"&&e.teardown(),n}async removeAllChannels(){let e=this.channels.map(async r=>{let o=await r.unsubscribe();return r.teardown(),o}),n=await Promise.all(e);return await this.disconnect(),n}log(e,n,r){this.socketAdapter.log(e,n,r)}hasLogger(){return this.socketAdapter.hasLogger()}connectionState(){return this.socketAdapter.connectionState()||Bg.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,n={config:{}}){let r=`realtime:${e}`,o=this.getChannels().find(s=>s.topic===r);if(o)return o;{let s=new Zf(`realtime:${e}`,n,this);return this._cancelPendingDisconnect(),this.channels.push(s),s}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){let n=++this._authGeneration,r=this._performAuth(e,n);n===this._authGeneration&&(this._authPromise=r);try{await r}finally{this._authPromise===r&&(this._authPromise=null)}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic),this.channels.length===0&&(this.log(\"transport\",\"no channels remaining, scheduling disconnect\"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log(\"transport\",\"disconnecting immediately - no channels\"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log(\"transport\",\"deferred disconnect fired - no channels, disconnecting\"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log(\"transport\",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log(\"transport\",\"pending disconnect cancelled - channel activity detected\"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e,n){let r,o=!1;if(e)r=e,o=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log(\"error\",\"Error fetching access token from callback\",s),r=this.accessTokenValue}else r=this.accessTokenValue;n===this._authGeneration&&(this.accessToken?this._manuallySetToken=!1:o&&(this._manuallySetToken=!0),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{let a={access_token:r,version:KU};s.updateJoinPayload(a),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(Cw.access_token,{access_token:r})})))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e=\"general\"){this._isManualToken()||this.setAuth().catch(n=>{this.log(\"error\",`Error setting auth in ${e}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log(\"error\",\"error waiting for auth on connect\",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(n,r)=>{n!==\"disconnected\"&&(n==\"sent\"&&this._setAuthSafely(),e&&e(n,r))}}_startWorkerHeartbeat(){this.workerUrl?this.log(\"worker\",`starting worker for from ${this.workerUrl}`):this.log(\"worker\",\"starting default worker\");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log(\"worker\",\"worker error\",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event===\"keepAlive\"&&this.sendHeartbeat()},this.workerRef.postMessage({event:\"start\",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log(\"worker\",\"terminating worker\"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let n;if(e)n=e;else{let r=new Blob([xoe],{type:\"application/javascript\"});n=URL.createObjectURL(r)}return n}_initializeOptions(e){var n,r,o,s,a,i,l,u,c,d,f,p;this.worker=(n=e?.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=e?.accessToken)!==null&&r!==void 0?r:null;let h={};h.timeout=(o=e?.timeout)!==null&&o!==void 0?o:XU,h.heartbeatIntervalMs=(s=e?.heartbeatIntervalMs)!==null&&s!==void 0?s:aj.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(a=e?.disconnectOnEmptyChannelsAfterMs)!==null&&a!==void 0?a:2*((i=e?.heartbeatIntervalMs)!==null&&i!==void 0?i:aj.HEARTBEAT_INTERVAL),h.transport=(l=e?.transport)!==null&&l!==void 0?l:NE.getWebSocketConstructor(),h.params=e?.params,h.logger=e?.logger,h.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),h.sessionStorage=(u=e?.sessionStorage)!==null&&u!==void 0?u:voe(),h.reconnectAfterMs=(c=e?.reconnectAfterMs)!==null&&c!==void 0?c:(b=>goe[b-1]||yoe);let g,m,y=(d=e?.vsn)!==null&&d!==void 0?d:WU;switch(y){case GU:g=(b,x)=>x(JSON.stringify(b)),m=(b,x)=>x(JSON.parse(b));break;case PE:g=this.serializer.encode.bind(this.serializer),m=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${h.vsn}`)}if(h.vsn=y,h.encode=(f=e?.encode)!==null&&f!==void 0?f:g,h.decode=(p=e?.decode)!==null&&p!==void 0?p:m,h.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,h.params=Object.assign(Object.assign({},h.params),{log_level:this.logLevel})),this.worker){if(typeof window<\"u\"&&!window.Worker)throw new Error(\"Web Worker is not supported\");this.workerUrl=e?.workerUrl,h.autoSendHeartbeat=!this.worker}return h}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}};var jg=class extends Error{constructor(t,e){super(t),this.name=\"IcebergError\",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType===\"CommitStateUnknownException\"||[500,502,504].includes(e.status)&&e.icebergType?.includes(\"CommitState\")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function woe(t,e,n){let r=new URL(e,t);if(n)for(let[o,s]of Object.entries(n))s!==void 0&&r.searchParams.set(o,s);return r.toString()}async function Soe(t){return!t||t.type===\"none\"?{}:t.type===\"bearer\"?{Authorization:`Bearer ${t.token}`}:t.type===\"header\"?{[t.name]:t.value}:t.type===\"custom\"?await t.getHeaders():{}}function koe(t){let e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:o,body:s,headers:a}){let i=woe(t.baseUrl,r,o),l=await Soe(t.auth),u=await e(i,{method:n,headers:{...s?{\"Content-Type\":\"application/json\"}:{},...l,...a},body:s?JSON.stringify(s):void 0}),c=await u.text(),d=(u.headers.get(\"content-type\")||\"\").includes(\"application/json\"),f=d&&c?JSON.parse(c):c;if(!u.ok){let p=d?f:void 0,h=p?.error;throw new jg(h?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:h?.type,icebergCode:h?.code,details:p})}return{status:u.status,headers:u.headers,data:f}}}}function Iw(t){return t.join(\"\u001f\")}var Coe=class{constructor(t,e=\"\"){this.client=t,this.prefix=e}async listNamespaces(t){let e=t?{parent:Iw(t.namespace)}:void 0;return(await this.client.request({method:\"GET\",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(t,e){let n={namespace:t.namespace,properties:e?.properties};return(await this.client.request({method:\"POST\",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(t){await this.client.request({method:\"DELETE\",path:`${this.prefix}/namespaces/${Iw(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:\"GET\",path:`${this.prefix}/namespaces/${Iw(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:\"HEAD\",path:`${this.prefix}/namespaces/${Iw(t.namespace)}`}),!0}catch(e){if(e instanceof jg&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof jg&&n.status===409)return;throw n}}};function ep(t){return t.join(\"\u001f\")}var Loe=class{constructor(t,e=\"\",n){this.client=t,this.prefix=e,this.accessDelegation=n}async listTables(t){return(await this.client.request({method:\"GET\",path:`${this.prefix}/namespaces/${ep(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){let n={};return this.accessDelegation&&(n[\"X-Iceberg-Access-Delegation\"]=this.accessDelegation),(await this.client.request({method:\"POST\",path:`${this.prefix}/namespaces/${ep(t.namespace)}/tables`,body:e,headers:n})).data.metadata}async updateTable(t,e){let n=await this.client.request({method:\"POST\",path:`${this.prefix}/namespaces/${ep(t.namespace)}/tables/${t.name}`,body:e});return{\"metadata-location\":n.data[\"metadata-location\"],metadata:n.data.metadata}}async dropTable(t,e){await this.client.request({method:\"DELETE\",path:`${this.prefix}/namespaces/${ep(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String(e?.purge??!1)}})}async loadTable(t){let e={};return this.accessDelegation&&(e[\"X-Iceberg-Access-Delegation\"]=this.accessDelegation),(await this.client.request({method:\"GET\",path:`${this.prefix}/namespaces/${ep(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){let e={};this.accessDelegation&&(e[\"X-Iceberg-Access-Delegation\"]=this.accessDelegation);try{return await this.client.request({method:\"HEAD\",path:`${this.prefix}/namespaces/${ep(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof jg&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof jg&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},ij=class{constructor(t){let e=\"v1\";t.catalogName&&(e+=`/${t.catalogName}`);let n=t.baseUrl.endsWith(\"/\")?t.baseUrl:`${t.baseUrl}/`;this.client=koe({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=t.accessDelegation?.join(\",\"),this.namespaceOps=new Coe(this.client,e),this.tableOps=new Loe(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function Vg(t){\"@babel/helpers - typeof\";return Vg=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(e){return typeof e}:function(e){return e&&typeof Symbol==\"function\"&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Vg(t)}function Aoe(t,e){if(Vg(t)!=\"object\"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||\"default\");if(Vg(r)!=\"object\")return r;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(e===\"string\"?String:Number)(t)}function Eoe(t){var e=Aoe(t,\"string\");return Vg(e)==\"symbol\"?e:e+\"\"}function Toe(t,e,n){return(e=Eoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lj(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function he(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lj(Object(n),!0).forEach(function(r){Toe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lj(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Ow=class extends Error{constructor(t,e=\"storage\",n,r){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e===\"vectors\"?\"StorageVectorsError\":\"StorageError\",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Dw(t){return typeof t==\"object\"&&t!==null&&\"__isStorageError\"in t}var Mw=class extends Ow{constructor(t,e,n,r=\"storage\",o){super(t,r,e,n),this.name=r===\"vectors\"?\"StorageVectorsApiError\":\"StorageApiError\",this.status=e,this.statusCode=n,this.code=o}toJSON(){return he(he({},super.toJSON()),{},{code:this.code})}},dj=class extends Ow{constructor(t,e,n=\"storage\"){super(t,n),this.name=n===\"vectors\"?\"StorageVectorsUnknownError\":\"StorageUnknownError\",this.originalError=e}};function _w(t,e,n){let r=he({},t),o=e.toLowerCase();for(let s of Object.keys(r))s.toLowerCase()===o&&delete r[s];return r[o]=n,r}function Roe(t){let e={};for(let[n,r]of Object.entries(t))e[n.toLowerCase()]=r;return e}var Ioe=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Moe=t=>{if(typeof t!=\"object\"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},qE=t=>{if(Array.isArray(t))return t.map(n=>qE(n));if(typeof t==\"function\"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([n,r])=>{let o=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,\"\"));e[o]=qE(r)}),e},_oe=t=>!t||typeof t!=\"string\"||t.length===0||t.length>100||t.trim()!==t||t.includes(\"/\")||t.includes(\"\\\\\")?!1:/^[\\w!.\\*'() &$@=;:+,?-]+$/.test(t),fj=t=>t.split(\"/\").map(encodeURIComponent).join(\"/\"),uj=t=>{if(typeof t==\"object\"&&t!==null){let e=t;if(typeof e.msg==\"string\")return e.msg;if(typeof e.message==\"string\")return e.message;if(typeof e.error_description==\"string\")return e.error_description;if(typeof e.error==\"string\")return e.error;if(typeof e.error==\"object\"&&e.error!==null){let n=e.error;if(typeof n.message==\"string\")return n.message}}return JSON.stringify(t)},Ooe=async(t,e,n,r)=>{if(t!==null&&typeof t==\"object\"&&\"json\"in t&&typeof t.json==\"function\"){let o=t,s=parseInt(String(o.status),10);Number.isFinite(s)||(s=500),o.json().then(a=>{let i=a?.statusCode||a?.code||s+\"\";e(new Mw(uj(a),s,i,r,a?.code))}).catch(()=>{let a=s+\"\";e(new Mw(o.statusText||`HTTP ${s} error`,s,a,r))})}else e(new dj(uj(t),t,r))},Doe=(t,e,n,r)=>{let o={method:t,headers:e?.headers||{}};if(t===\"GET\"||t===\"HEAD\"||!r)return he(he({},o),n);if(Moe(r)){var s;let a=e?.headers||{},i;for(let[l,u]of Object.entries(a))l.toLowerCase()===\"content-type\"&&(i=u);o.headers=_w(a,\"Content-Type\",(s=i)!==null&&s!==void 0?s:\"application/json\"),o.body=JSON.stringify(r)}else o.body=r;return e?.duplex&&(o.duplex=e.duplex),he(he({},o),n)};async function qg(t,e,n,r,o,s,a){return new Promise((i,l)=>{t(n,Doe(e,r,o,s)).then(u=>{if(!u.ok)throw u;if(r?.noResolveJson)return u;if(a===\"vectors\"){let c=u.headers.get(\"content-type\");if(u.headers.get(\"content-length\")===\"0\"||u.status===204)return{};if(!c||!c.includes(\"application/json\"))return{}}return u.json()}).then(u=>i(u)).catch(u=>Ooe(u,l,r,a))})}function pj(t=\"storage\"){return{get:async(e,n,r,o)=>qg(e,\"GET\",n,r,o,void 0,t),post:async(e,n,r,o,s)=>qg(e,\"POST\",n,o,s,r,t),put:async(e,n,r,o,s)=>qg(e,\"PUT\",n,o,s,r,t),head:async(e,n,r,o)=>qg(e,\"HEAD\",n,he(he({},r),{},{noResolveJson:!0}),o,void 0,t),remove:async(e,n,r,o,s)=>qg(e,\"DELETE\",n,o,s,r,t)}}var Noe=pj(\"storage\"),{get:Kg,post:ss,put:VE,head:Poe,remove:Gg}=Noe,oo=pj(\"vectors\"),tp=class{constructor(t,e={},n,r=\"storage\"){this.shouldThrowOnError=!1,this.url=t,this.headers=Roe(e),this.fetch=Ioe(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=_w(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Dw(n))return{data:null,error:n};throw n}}},hj;hj=Symbol.toStringTag;var Boe=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[hj]=\"StreamDownloadBuilder\",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Dw(e))return{data:null,error:e};throw e}}},mj;mj=Symbol.toStringTag;var zoe=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[mj]=\"BlobDownloadBuilder\",this.promise=null}asStream(){return new Boe(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Dw(e))return{data:null,error:e};throw e}}},jE={limit:100,offset:0,sortBy:{column:\"name\",order:\"asc\"}},cj={cacheControl:\"3600\",contentType:\"text/plain;charset=UTF-8\",upsert:!1},Foe=class extends tp{constructor(t,e={},n,r){super(t,e,r,\"storage\"),this.bucketId=n}async uploadOrUpdate(t,e,n,r){var o=this;return o.handleOperation(async()=>{let s,a=he(he({},cj),r),i=he(he({},o.headers),t===\"POST\"&&{\"x-upsert\":String(a.upsert)}),l=a.metadata;if(typeof Blob<\"u\"&&n instanceof Blob?(s=new FormData,s.append(\"cacheControl\",a.cacheControl),l&&s.append(\"metadata\",o.encodeMetadata(l)),s.append(\"\",n)):typeof FormData<\"u\"&&n instanceof FormData?(s=n,s.has(\"cacheControl\")||s.append(\"cacheControl\",a.cacheControl),l&&!s.has(\"metadata\")&&s.append(\"metadata\",o.encodeMetadata(l))):(s=n,i[\"cache-control\"]=`max-age=${a.cacheControl}`,i[\"content-type\"]=a.contentType,l&&(i[\"x-metadata\"]=o.toBase64(o.encodeMetadata(l))),(typeof ReadableStream<\"u\"&&s instanceof ReadableStream||s&&typeof s==\"object\"&&\"pipe\"in s&&typeof s.pipe==\"function\")&&!a.duplex&&(a.duplex=\"half\")),r?.headers)for(let[f,p]of Object.entries(r.headers))i=_w(i,f,p);let u=o._removeEmptyFolders(e),c=o._getFinalPath(u),d=await(t==\"PUT\"?VE:ss)(o.fetch,`${o.url}/object/${c}`,s,he({headers:i},a?.duplex?{duplex:a.duplex}:{}));return{path:u,id:d.Id,fullPath:d.Key}})}async upload(t,e,n){return this.uploadOrUpdate(\"POST\",t,e,n)}async uploadToSignedUrl(t,e,n,r){var o=this;let s=o._removeEmptyFolders(t),a=o._getFinalPath(s),i=new URL(o.url+`/object/upload/sign/${a}`);return i.searchParams.set(\"token\",e),o.handleOperation(async()=>{let l,u=he(he({},cj),r),c=he(he({},o.headers),{\"x-upsert\":String(u.upsert)}),d=u.metadata;if(typeof Blob<\"u\"&&n instanceof Blob?(l=new FormData,l.append(\"cacheControl\",u.cacheControl),d&&l.append(\"metadata\",o.encodeMetadata(d)),l.append(\"\",n)):typeof FormData<\"u\"&&n instanceof FormData?(l=n,l.has(\"cacheControl\")||l.append(\"cacheControl\",u.cacheControl),d&&!l.has(\"metadata\")&&l.append(\"metadata\",o.encodeMetadata(d))):(l=n,c[\"cache-control\"]=`max-age=${u.cacheControl}`,c[\"content-type\"]=u.contentType,d&&(c[\"x-metadata\"]=o.toBase64(o.encodeMetadata(d))),(typeof ReadableStream<\"u\"&&l instanceof ReadableStream||l&&typeof l==\"object\"&&\"pipe\"in l&&typeof l.pipe==\"function\")&&!u.duplex&&(u.duplex=\"half\")),r?.headers)for(let[f,p]of Object.entries(r.headers))c=_w(c,f,p);return{path:s,fullPath:(await VE(o.fetch,i.toString(),l,he({headers:c},u?.duplex?{duplex:u.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(t),o=he({},n.headers);e?.upsert&&(o[\"x-upsert\"]=\"true\");let s=await ss(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:o}),a=new URL(n.url+s.url),i=a.searchParams.get(\"token\");if(!i)throw new Ow(\"No token returned by API\");return{signedUrl:a.toString(),path:t,token:i}})}async update(t,e,n){return this.uploadOrUpdate(\"PUT\",t,e,n)}async move(t,e,n){var r=this;return r.handleOperation(async()=>await ss(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n?.destinationBucket},{headers:r.headers}))}async copy(t,e,n){var r=this;return r.handleOperation(async()=>({path:(await ss(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(t,e,n){var r=this;return r.handleOperation(async()=>{let o=r._getFinalPath(t),s=typeof n?.transform==\"object\"&&n.transform!==null&&Object.keys(n.transform).length>0,a=await ss(r.fetch,`${r.url}/object/sign/${o}`,he({expiresIn:e},s?{transform:n.transform}:{}),{headers:r.headers}),i=new URLSearchParams;n?.download&&i.set(\"download\",n.download===!0?\"\":n.download),n?.cacheNonce!=null&&i.set(\"cacheNonce\",String(n.cacheNonce));let l=i.toString();return{signedUrl:encodeURI(`${r.url}${a.signedURL}${l?`&${l}`:\"\"}`)}})}async createSignedUrls(t,e,n){var r=this;return r.handleOperation(async()=>{let o=await ss(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:t},{headers:r.headers}),s=new URLSearchParams;n?.download&&s.set(\"download\",n.download===!0?\"\":n.download),n?.cacheNonce!=null&&s.set(\"cacheNonce\",String(n.cacheNonce));let a=s.toString();return o.map(i=>he(he({},i),{},{signedUrl:i.signedURL?encodeURI(`${r.url}${i.signedURL}${a?`&${a}`:\"\"}`):null}))})}download(t,e,n){let r=typeof e?.transform==\"object\"&&e.transform!==null&&Object.keys(e.transform).length>0?\"render/image/authenticated\":\"object\",o=new URLSearchParams;e?.transform&&this.applyTransformOptsToQuery(o,e.transform),e?.cacheNonce!=null&&o.set(\"cacheNonce\",String(e.cacheNonce));let s=o.toString(),a=this._getFinalPath(t),i=()=>Kg(this.fetch,`${this.url}/${r}/${a}${s?`?${s}`:\"\"}`,{headers:this.headers,noResolveJson:!0},n);return new zoe(i,this.shouldThrowOnError)}async info(t){var e=this;let n=e._getFinalPath(t);return e.handleOperation(async()=>qE(await Kg(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})))}async exists(t){var e=this;let n=e._getFinalPath(t);try{return await Poe(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(o){if(e.shouldThrowOnError)throw o;if(Dw(o)){var r;let s=o instanceof Mw?o.status:o instanceof dj?(r=o.originalError)===null||r===void 0?void 0:r.status:void 0;if(s!==void 0&&[400,404].includes(s))return{data:!1,error:o}}throw o}}getPublicUrl(t,e){let n=this._getFinalPath(t),r=new URLSearchParams;e?.download&&r.set(\"download\",e.download===!0?\"\":e.download),e?.transform&&this.applyTransformOptsToQuery(r,e.transform),e?.cacheNonce!=null&&r.set(\"cacheNonce\",String(e.cacheNonce));let o=r.toString(),s=typeof e?.transform==\"object\"&&e.transform!==null&&Object.keys(e.transform).length>0?\"render/image\":\"object\";return{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}`)+(o?`?${o}`:\"\")}}}async remove(t){var e=this;return e.handleOperation(async()=>await Gg(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async purgeCache(t,e,n){var r=this;return r.handleOperation(async()=>{let o=fj(r._getFinalPath(t)),s=new URLSearchParams;e?.transformations&&s.set(\"transformations\",\"true\");let a=s.toString();return await Gg(r.fetch,`${r.url}/cdn/${o}${a?`?${a}`:\"\"}`,{},{headers:r.headers},n)})}async list(t,e,n){var r=this;return r.handleOperation(async()=>{let o=e?.sortBy?he(he({},jE.sortBy),e.sortBy):jE.sortBy,s=he(he(he({},jE),e),{},{sortBy:o,prefix:t||\"\"});return await ss(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(t,e){var n=this;return n.handleOperation(async()=>{let r=he({},t);return await ss(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<\"u\"?Buffer.from(t).toString(\"base64\"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\\/+/,\"\")}`}_removeEmptyFolders(t){return t.replace(/^\\/|\\/$/g,\"\").replace(/\\/+/g,\"/\")}applyTransformOptsToQuery(t,e){return e.width&&t.set(\"width\",e.width.toString()),e.height&&t.set(\"height\",e.height.toString()),e.resize&&t.set(\"resize\",e.resize),e.format&&t.set(\"format\",e.format),e.quality&&t.set(\"quality\",e.quality.toString()),t}},Hoe=\"2.113.0\",Wg={\"X-Client-Info\":`storage-js/${Hoe}`},$oe=class extends tp{constructor(t,e={},n,r){let o=new URL(t);r?.useNewHostname&&/supabase\\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes(\"storage.supabase.\")&&(o.hostname=o.hostname.replace(\"supabase.\",\"storage.supabase.\"));let s=o.href.replace(/\\/$/,\"\"),a=he(he({},Wg),e);super(s,a,n,\"storage\")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{let n=e.listBucketOptionsToQueryString(t);return await Kg(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Kg(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var n=this;return n.handleOperation(async()=>await ss(n.fetch,`${n.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async updateBucket(t,e){var n=this;return n.handleOperation(async()=>await VE(n.fetch,`${n.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await ss(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Gg(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}async purgeBucketCache(t,e,n){var r=this;return r.handleOperation(async()=>{let o=new URLSearchParams;e?.transformations&&o.set(\"transformations\",\"true\");let s=o.toString();return await Gg(r.fetch,`${r.url}/cdn/${fj(t)}${s?`?${s}`:\"\"}`,{},{headers:r.headers},n)})}listBucketOptionsToQueryString(t){let e={};return t&&(\"limit\"in t&&(e.limit=String(t.limit)),\"offset\"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?\"?\"+new URLSearchParams(e).toString():\"\"}},Uoe=class extends tp{constructor(t,e={},n){let r=t.replace(/\\/$/,\"\"),o=he(he({},Wg),e);super(r,o,n,\"storage\")}async createBucket(t){var e=this;return e.handleOperation(async()=>await ss(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{let n=new URLSearchParams;t?.limit!==void 0&&n.set(\"limit\",t.limit.toString()),t?.offset!==void 0&&n.set(\"offset\",t.offset.toString()),t?.sortColumn&&n.set(\"sortColumn\",t.sortColumn),t?.sortOrder&&n.set(\"sortOrder\",t.sortOrder),t?.search&&n.set(\"search\",t.search);let r=n.toString(),o=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await Kg(e.fetch,o,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Gg(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!_oe(t))throw new Ow(\"Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.\");let n=new ij({baseUrl:this.url,catalogName:t,auth:{type:\"custom\",getHeaders:async()=>e.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(o,s){let a=o[s];return typeof a!=\"function\"?a:async(...i)=>{try{return{data:await a.apply(o,i),error:null}}catch(l){if(r)throw l;return{data:null,error:l}}}}})}},joe=class extends tp{constructor(t,e={},n){let r=t.replace(/\\/$/,\"\"),o=he(he({},Wg),{},{\"Content-Type\":\"application/json\"},e);super(r,o,n,\"vectors\")}async createIndex(t){var e=this;return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var n=this;return n.handleOperation(async()=>await oo.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var n=this;return n.handleOperation(async()=>await oo.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{})}},qoe=class extends tp{constructor(t,e={},n){let r=t.replace(/\\/$/,\"\"),o=he(he({},Wg),{},{\"Content-Type\":\"application/json\"},e);super(r,o,n,\"vectors\")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error(\"Vector batch size must be between 1 and 500 items\");return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error(\"segmentCount must be between 1 and 16\");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error(\"Keys batch size must be between 1 and 500 items\");return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},Voe=class extends tp{constructor(t,e={},n){let r=t.replace(/\\/$/,\"\"),o=he(he({},Wg),{},{\"Content-Type\":\"application/json\"},e);super(r,o,n,\"vectors\")}async createBucket(t){var e=this;return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await oo.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},Koe=class extends Voe{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new Goe(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,n=this;return e().call(n,t)}async getBucket(t){var e=()=>super.getBucket,n=this;return e().call(n,t)}async listBuckets(t={}){var e=()=>super.listBuckets,n=this;return e().call(n,t)}async deleteBucket(t){var e=()=>super.deleteBucket,n=this;return e().call(n,t)}},Goe=class extends joe{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,he(he({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,he(he({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new Woe(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},Woe=class extends qoe{constructor(t,e,n,r,o){super(t,e,o),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,he(he({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,he(he({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,he(he({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,he(he({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,he(he({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},gj=class extends $oe{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new Foe(this.url,this.headers,t,this.fetch)}get vectors(){return new Koe(this.url+\"/vector\",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Uoe(this.url+\"/iceberg\",this.headers,this.fetch)}};var Nw=\"2.113.0\";var qs=30*1e3,np=3,Pw=np*qs,yj=2*qs,bj=\"http://localhost:9999\",vj=\"supabase.auth.token\";var xj={\"X-Client-Info\":`gotrue-js/${Nw}`};var Xg=\"X-Supabase-Api-Version\",KE={\"2024-01-01\":{timestamp:Date.parse(\"2024-01-01T00:00:00.0Z\"),name:\"2024-01-01\"}},wj=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Va=\"sb_flow_id\",Sj=5,kj=600*1e3;var pl=class extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name=\"AuthError\",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}};function W(t){return typeof t==\"object\"&&t!==null&&\"__isAuthError\"in t}var Bw=class extends pl{constructor(e,n,r){super(e,n,r),this.name=\"AuthApiError\",this.status=n,this.code=r}};function GE(t){return W(t)&&t.name===\"AuthApiError\"}var Zn=class extends pl{constructor(e,n){super(e),this.name=\"AuthUnknownError\",this.originalError=n}},Bo=class extends pl{constructor(e,n,r,o){super(e,r,o),this.name=n,this.status=r}},Ht=class extends Bo{constructor(){super(\"Auth session missing!\",\"AuthSessionMissingError\",400,void 0)}};function Qg(t){return W(t)&&t.name===\"AuthSessionMissingError\"}var Ka=class extends Bo{constructor(){super(\"Auth session or user missing\",\"AuthInvalidTokenResponseError\",500,void 0)}},nc=class extends Bo{constructor(e){super(e,\"AuthInvalidCredentialsError\",400,void 0)}},rc=class extends Bo{constructor(e,n=null){super(e,\"AuthImplicitGrantRedirectError\",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};function Cj(t){return W(t)&&t.name===\"AuthImplicitGrantRedirectError\"}var Jg=class extends Bo{constructor(e,n=null){super(e,\"AuthPKCEGrantCodeExchangeError\",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}},zw=class extends Bo{constructor(){super(\"PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.\",\"AuthPKCECodeVerifierMissingError\",400,\"pkce_code_verifier_not_found\")}};var oc=class extends Bo{constructor(e,n){super(e,\"AuthRetryableFetchError\",n,void 0)}};function ey(t){return W(t)&&t.name===\"AuthRetryableFetchError\"}var Yg=class extends Bo{constructor(e=\"Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)\"){super(e,\"AuthRefreshDiscardedError\",409,void 0)}};function Lj(t){return W(t)&&t.name===\"AuthRefreshDiscardedError\"}var Zg=class extends Bo{constructor(e,n,r){super(e,\"AuthWeakPasswordError\",n,\"weak_password\"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}};var hl=class extends Bo{constructor(e){super(e,\"AuthInvalidJwtError\",400,\"invalid_jwt\")}};var Fw=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\".split(\"\"),Aj=` \t\n\\r=`.split(\"\"),Xoe=(()=>{let t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<Aj.length;e+=1)t[Aj[e].charCodeAt(0)]=-2;for(let e=0;e<Fw.length;e+=1)t[Fw[e].charCodeAt(0)]=e;return t})();function Ej(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){let r=e.queue>>e.queuedBits-6&63;n(Fw[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){let r=e.queue>>e.queuedBits-6&63;n(Fw[r]),e.queuedBits-=6}}function Tj(t,e,n){let r=Xoe[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character \"${String.fromCharCode(t)}\"`)}}function WE(t){let e=[],n=a=>{e.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},s=a=>{Zoe(a,r,n)};for(let a=0;a<t.length;a+=1)Tj(t.charCodeAt(a),o,s);return e.join(\"\")}function Joe(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function Yoe(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){let o=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|o)+65536,n+=1}Joe(r,e)}}function Zoe(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if((t>>7-r&1)===0){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error(\"Invalid UTF-8 sequence\");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error(\"Invalid UTF-8 sequence\");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function ml(t){let e=[],n={queue:0,queuedBits:0},r=o=>{e.push(o)};for(let o=0;o<t.length;o+=1)Tj(t.charCodeAt(o),n,r);return new Uint8Array(e)}function Rj(t){let e=[];return Yoe(t,n=>e.push(n)),new Uint8Array(e)}function Ga(t){let e=[],n={queue:0,queuedBits:0},r=o=>{e.push(o)};return t.forEach(o=>Ej(o,n,r)),Ej(null,n,r),e.join(\"\")}function Ij(t){return Math.round(Date.now()/1e3)+t}function Mj(){return Symbol(\"auth-callback\")}var cn=()=>typeof window<\"u\"&&typeof document<\"u\",sc={tested:!1,writable:!1},Hw=()=>{if(!cn())return!1;try{if(typeof globalThis.localStorage!=\"object\")return!1}catch{return!1}if(sc.tested)return sc.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),sc.tested=!0,sc.writable=!0}catch{sc.tested=!0,sc.writable=!1}return sc.writable};function XE(t){let e={},n=new URL(t);if(n.hash&&n.hash[0]===\"#\")try{new URLSearchParams(n.hash.substring(1)).forEach((o,s)=>{e[s]=o})}catch{}return n.searchParams.forEach((r,o)=>{e[o]=r}),e}var $w=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),_j=t=>typeof t==\"object\"&&t!==null&&\"status\"in t&&\"ok\"in t&&\"json\"in t&&typeof t.json==\"function\",Vs=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},Fn=async(t,e)=>{let n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return null}},hr=async(t,e)=>{await t.removeItem(e)},ty=class t{constructor(){this.promise=new t.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}};ty.promiseConstructor=Promise;function ry(t){let e=t.split(\".\");if(e.length!==3)throw new hl(\"Invalid JWT structure\");for(let r=0;r<e.length;r++)if(!wj.test(e[r]))throw new hl(\"JWT not in base64url format\");return{header:JSON.parse(WE(e[0])),payload:JSON.parse(WE(e[1])),signature:ml(e[2]),raw:{header:e[0],payload:e[1]}}}async function Oj(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function Dj(t,e){return new Promise((r,o)=>{(async()=>{for(let s=0;s<1/0;s++)try{let a=await t(s);if(!e(s,null,a)){r(a);return}}catch(a){if(!e(s,a)){o(a);return}}})()})}function Nj(t){return(\"0\"+t.toString(16)).substr(-2)}function Qoe(){let e=new Uint32Array(56);if(typeof crypto>\"u\"){let n=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~\",r=n.length,o=\"\";for(let s=0;s<56;s++)o+=n.charAt(Math.floor(Math.random()*r));return o}return crypto.getRandomValues(e),Array.from(e,Nj).join(\"\")}async function ese(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest(\"SHA-256\",n),o=new Uint8Array(r);return Array.from(o).map(s=>String.fromCharCode(s)).join(\"\")}async function tse(t){if(!(typeof crypto<\"u\"&&typeof crypto.subtle<\"u\"&&typeof TextEncoder<\"u\"))return console.warn(\"WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.\"),t;let n=await ese(t);return btoa(n).replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=+$/,\"\")}var nse=/^[a-zA-Z0-9_-]{8,64}$/;function oy(t){return typeof t==\"string\"&&nse.test(t)?t:null}function rse(){if(typeof crypto<\"u\"&&typeof crypto.getRandomValues==\"function\"){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,Nj).join(\"\")}let t=\"\";for(let e=0;e<32;e++)t+=Math.floor(Math.random()*16).toString(16);return t}var ac=(t,e)=>`${t}-flow-${e}-code-verifier`,ny=t=>`${t}-flows-code-verifier`;async function JE(t,e){let n=await Fn(t,ny(e));return Array.isArray(n)?n.filter(r=>oy(r)!==null):[]}async function ose(t,e,n,r,o){await Vs(t,ac(e,n),r);let s=(await JE(t,e)).filter(a=>a!==n);for(s.push(n);s.length>Sj;){let a=s.shift();await hr(t,ac(e,a)),o?.(a)}await Vs(t,ny(e),s),await Vs(t,`${e}-code-verifier`,r)}async function Pj(t,e,n){if(n){let o=await Fn(t,ac(e,n));return{verifier:typeof o==\"string\"?o:null,flowId:n}}let r=await Fn(t,`${e}-code-verifier`);return{verifier:typeof r==\"string\"?r:null,flowId:null}}async function zo(t,e,n){let r=`${e}-code-verifier`;if(!n){await hr(t,r);return}let o=ac(e,n),s=await Fn(t,o);await hr(t,o);let a=await JE(t,e),i=a.filter(l=>l!==n);i.length!==a.length&&(i.length>0?await Vs(t,ny(e),i):await hr(t,ny(e))),s!=null&&s===await Fn(t,r)&&await hr(t,r)}async function Bj(t,e){let n=await JE(t,e);for(let r of n)await hr(t,ac(e,r));await hr(t,ny(e)),await hr(t,`${e}-code-verifier`)}function zj(t,e){let n=t.indexOf(\"#\"),r=n===-1?t:t.slice(0,n),o=n===-1?\"\":t.slice(n),s=r.indexOf(\"?\");if(s!==-1){let i=r.slice(0,s),l=r.slice(s+1).split(\"&\").filter(u=>u!==\"\"&&u!==Va&&!u.startsWith(`${Va}=`));r=l.length>0?`${i}?${l.join(\"&\")}`:i}let a=r.includes(\"?\")?\"&\":\"?\";return`${r}${a}${Va}=${encodeURIComponent(e)}${o}`}async function Fj(t,e,n=!1,r){let o=Qoe(),s=o;n&&(s+=\"/recovery\");let a=rse();await ose(t,e,a,s,r);let i=await tse(o);return[i,o===i?\"plain\":\"s256\",a]}var sse=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Hj(t){let e=t.headers.get(Xg);if(!e||!e.match(sse))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function $j(t){if(!t)throw new Error(\"Missing exp claim\");let e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error(\"JWT has expired\")}function Uj(t){switch(t){case\"RS256\":return{name:\"RSASSA-PKCS1-v1_5\",hash:{name:\"SHA-256\"}};case\"ES256\":return{name:\"ECDSA\",namedCurve:\"P-256\",hash:{name:\"SHA-256\"}};default:throw new Error(\"Invalid alg claim\")}}var ase=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ks(t){if(!ase.test(t))throw new Error(\"@supabase/auth-js: Expected parameter to be UUID but is not\")}function so(t){if(!t.passkey)throw new Error(\"@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).\")}function Uw(){let t={};return new Proxy(t,{get:(e,n)=>{if(n===\"__isUserNotAvailableProxy\")return!0;if(typeof n==\"symbol\"){let r=n.toString();if(r===\"Symbol(Symbol.toPrimitive)\"||r===\"Symbol(Symbol.toStringTag)\"||r===\"Symbol(util.inspect.custom)\")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the \"${n}\" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the \"${n}\" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the \"${n}\" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function jj(t,e){return new Proxy(t,{get:(n,r,o)=>{if(r===\"__isInsecureUserWarningProxy\")return!0;if(typeof r==\"symbol\"){let s=r.toString();if(s===\"Symbol(Symbol.toPrimitive)\"||s===\"Symbol(Symbol.toStringTag)\"||s===\"Symbol(util.inspect.custom)\"||s===\"Symbol(nodejs.util.inspect.custom)\")return Reflect.get(n,r,o)}return!e.value&&typeof r==\"string\"&&(console.warn(\"Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server.\"),e.value=!0),Reflect.get(n,r,o)}})}function YE(t){return JSON.parse(JSON.stringify(t))}var ic=t=>{if(typeof t==\"object\"&&t!==null){let e=t;if(typeof e.msg==\"string\")return e.msg;if(typeof e.message==\"string\")return e.message;if(typeof e.error_description==\"string\")return e.error_description;if(typeof e.error==\"string\")return e.error}return JSON.stringify(t)},qj=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Vj(t){var e;if(!_j(t))throw new oc(ic(t),0);let n;try{n=await t.json()}catch(s){throw qj.includes(t.status)?new oc(t.statusText||`HTTP ${t.status}`,t.status):new Zn(ic(s),s)}if(qj.includes(t.status))throw new oc(ic(n),t.status);let r,o=Hj(t);if(o&&o.getTime()>=KE[\"2024-01-01\"].timestamp&&typeof n==\"object\"&&n&&typeof n.code==\"string\"?r=n.code:typeof n==\"object\"&&n&&typeof n.error_code==\"string\"&&(r=n.error_code),r){if(r===\"weak_password\")throw new Zg(ic(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r===\"session_not_found\")throw new Ht}else if(typeof n==\"object\"&&n&&typeof n.weak_password==\"object\"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,a)=>s&&typeof a==\"string\",!0))throw new Zg(ic(n),t.status,n.weak_password.reasons);throw new Bw(ic(n),t.status||500,r)}var ise=(t,e,n,r)=>{let o={method:t,headers:e?.headers||{}};return t===\"GET\"?o:(o.headers=Object.assign({\"Content-Type\":\"application/json;charset=UTF-8\"},e?.headers),o.body=JSON.stringify(r),Object.assign(Object.assign({},o),n))};async function ne(t,e,n,r){var o;let s=Object.assign({},r?.headers);s[Xg]||(s[Xg]=KE[\"2024-01-01\"].name),r?.jwt&&(s.Authorization=`Bearer ${r.jwt}`);let a=(o=r?.query)!==null&&o!==void 0?o:{};r?.redirectTo&&(a.redirect_to=r.redirectTo);let i=Object.keys(a).length?\"?\"+new URLSearchParams(a).toString():\"\",l=await lse(t,e,n+i,{headers:s,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(l):{data:Object.assign({},l),error:null}}async function lse(t,e,n,r,o,s){let a=ise(e,r,o,s),i;try{i=await t(n,Object.assign({},a))}catch(l){throw new oc(ic(l),0)}if(i.ok||await Vj(i),r?.noResolveJson)return i;try{return await i.json()}catch(l){await Vj(l)}}function ao(t){var e;let n=null;use(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=Ij(t.expires_in)));let r=(e=t.user)!==null&&e!==void 0?e:typeof t?.id==\"string\"?t:null;return{data:{session:n,user:r},error:null}}function ZE(t){let e=ao(t);return!e.error&&t.weak_password&&typeof t.weak_password==\"object\"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message==\"string\"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r==\"string\",!0)&&(e.data.weak_password=t.weak_password),e}function Gs(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function Kj(t){return{data:t,error:null}}function Gj(t){let{action_link:e,email_otp:n,hashed_token:r,redirect_to:o,verification_type:s}=t,a=tc(t,[\"action_link\",\"email_otp\",\"hashed_token\",\"redirect_to\",\"verification_type\"]),i={action_link:e,email_otp:n,hashed_token:r,redirect_to:o,verification_type:s},l=Object.assign({},a);return{data:{properties:i,user:l},error:null}}function QE(t){return t}function use(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}var jw=[\"global\",\"local\",\"others\"];var lc=class{constructor({url:e=\"\",headers:n={},fetch:r,experimental:o}){this.url=e,this.headers=n,this.fetch=$w(r),this.experimental=o??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,n=jw[0]){if(jw.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${jw.join(\", \")}`);try{return await ne(this.fetch,\"POST\",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(W(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await ne(this.fetch,\"POST\",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Gs})}catch(r){if(W(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{let{options:n}=e,r=tc(e,[\"options\"]),o=Object.assign(Object.assign({},r),n);return\"newEmail\"in r&&(o.new_email=r?.newEmail,delete o.newEmail),await ne(this.fetch,\"POST\",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:Gj,redirectTo:n?.redirectTo})}catch(n){if(W(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await ne(this.fetch,\"POST\",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Gs})}catch(n){if(W(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,o,s,a,i,l;try{let u={nextPage:null,lastPage:0,total:0},c=await ne(this.fetch,\"GET\",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e?.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:\"\",per_page:(s=(o=e?.perPage)===null||o===void 0?void 0:o.toString())!==null&&s!==void 0?s:\"\"},xform:QE});if(c.error)throw c.error;let d=await c.json(),f=(a=c.headers.get(\"x-total-count\"))!==null&&a!==void 0?a:0,p=(l=(i=c.headers.get(\"link\"))===null||i===void 0?void 0:i.split(\",\"))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(h=>{let g=parseInt(h.split(\";\")[0].split(\"=\")[1].substring(0,1)),m=JSON.parse(h.split(\";\")[1].split(\"=\")[1]);u[`${m}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(W(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){Ks(e);try{return await ne(this.fetch,\"GET\",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Gs})}catch(n){if(W(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){Ks(e);try{return await ne(this.fetch,\"PUT\",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:Gs})}catch(r){if(W(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){Ks(e);try{return await ne(this.fetch,\"DELETE\",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:Gs})}catch(r){if(W(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){Ks(e.userId);try{let{data:n,error:r}=await ne(this.fetch,\"GET\",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:n,error:r}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _deleteFactor(e){Ks(e.userId),Ks(e.id);try{return{data:await ne(this.fetch,\"DELETE\",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,o,s,a,i,l;try{let u={nextPage:null,lastPage:0,total:0},c=await ne(this.fetch,\"GET\",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e?.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:\"\",per_page:(s=(o=e?.perPage)===null||o===void 0?void 0:o.toString())!==null&&s!==void 0?s:\"\"},xform:QE});if(c.error)throw c.error;let d=await c.json(),f=(a=c.headers.get(\"x-total-count\"))!==null&&a!==void 0?a:0,p=(l=(i=c.headers.get(\"link\"))===null||i===void 0?void 0:i.split(\",\"))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(h=>{let g=parseInt(h.split(\";\")[0].split(\"=\")[1].substring(0,1)),m=JSON.parse(h.split(\";\")[1].split(\"=\")[1]);u[`${m}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(W(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await ne(this.fetch,\"POST\",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await ne(this.fetch,\"GET\",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await ne(this.fetch,\"PUT\",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(W(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await ne(this.fetch,\"DELETE\",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await ne(this.fetch,\"POST\",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _listCustomProviders(e){try{let n={};return e?.type&&(n.type=e.type),await ne(this.fetch,\"GET\",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var o;return{data:{providers:(o=r?.providers)!==null&&o!==void 0?o:[]},error:null}}})}catch(n){if(W(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(e){try{return await ne(this.fetch,\"POST\",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _getCustomProvider(e){try{return await ne(this.fetch,\"GET\",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _updateCustomProvider(e,n){try{return await ne(this.fetch,\"PUT\",`${this.url}/admin/custom-providers/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(W(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(e){try{return await ne(this.fetch,\"DELETE\",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _adminListPasskeys(e){so(this.experimental),Ks(e.userId);try{return await ne(this.fetch,\"GET\",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _adminDeletePasskey(e){so(this.experimental),Ks(e.userId),Ks(e.passkeyId);try{return await ne(this.fetch,\"DELETE\",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}};function eT(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}var cse={debug:!!(globalThis&&Hw()&&globalThis.localStorage&&globalThis.localStorage.getItem(\"supabase.gotrue-js.locks.debug\")===\"true\")},qw=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};function Wj(){if(typeof globalThis!=\"object\")try{Object.defineProperty(Object.prototype,\"__magic__\",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<\"u\"&&(self.globalThis=self)}}function tT(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address \"${t}\" is invalid.`);return t.toLowerCase()}function Xj(t){return parseInt(t,16)}function Jj(t){let e=new TextEncoder().encode(t);return\"0x\"+Array.from(e,r=>r.toString(16).padStart(2,\"0\")).join(\"\")}function Yj(t){var e;let{chainId:n,domain:r,expirationTime:o,issuedAt:s=new Date,nonce:a,notBefore:i,requestId:l,resources:u,scheme:c,uri:d,version:f}=t;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field \"chainId\". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field \"domain\". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field \"nonce\". Nonce must be at least 8 characters. Provided value: ${a}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field \"uri\". URI must be provided.');if(f!==\"1\")throw new Error(`@supabase/auth-js: Invalid SIWE message field \"version\". Version must be '1'. Provided value: ${f}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`\n`))throw new Error(`@supabase/auth-js: Invalid SIWE message field \"statement\". Statement must not include '\\\\n'. Provided value: ${t.statement}`)}let p=tT(t.address),h=c?`${c}://${r}`:r,g=t.statement?`${t.statement}\n`:\"\",m=`${h} wants you to sign in with your Ethereum account:\n${p}\n\n${g}`,y=`URI: ${d}\nVersion: ${f}\nChain ID: ${n}${a?`\nNonce: ${a}`:\"\"}\nIssued At: ${s.toISOString()}`;if(o&&(y+=`\nExpiration Time: ${o.toISOString()}`),i&&(y+=`\nNot Before: ${i.toISOString()}`),l&&(y+=`\nRequest ID: ${l}`),u){let b=`\nResources:`;for(let x of u){if(!x||typeof x!=\"string\")throw new Error(`@supabase/auth-js: Invalid SIWE message field \"resources\". Every resource must be a valid string. Provided value: ${x}`);b+=`\n- ${x}`}y+=b}return`${m}\n${y}`}var Ot=class extends Error{constructor({message:e,code:n,cause:r,name:o}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=o??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:\"Unknown Error\",this.code=n}toJSON(){return{name:this.name,message:this.message,code:this.code}}},uc=class extends Ot{constructor(e,n){super({code:\"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY\",cause:n,message:e}),this.name=\"WebAuthnUnknownError\",this.originalError=n}};function Zj({error:t,options:e}){var n,r,o;let{publicKey:s}=e;if(!s)throw Error(\"options was missing required publicKey property\");if(t.name===\"AbortError\"){if(e.signal instanceof AbortSignal)return new Ot({message:\"Registration ceremony was sent an abort signal\",code:\"ERROR_CEREMONY_ABORTED\",cause:t})}else if(t.name===\"ConstraintError\"){if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Ot({message:\"Discoverable credentials were required but no available authenticator supported it\",code:\"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT\",cause:t});if(e.mediation===\"conditional\"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)===\"required\")return new Ot({message:\"User verification was required during automatic registration but it could not be performed\",code:\"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE\",cause:t});if(((o=s.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)===\"required\")return new Ot({message:\"User verification was required but no available authenticator supported it\",code:\"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT\",cause:t})}else{if(t.name===\"InvalidStateError\")return new Ot({message:\"The authenticator was previously registered\",code:\"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED\",cause:t});if(t.name===\"NotAllowedError\")return new Ot({message:t.message,code:\"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY\",cause:t});if(t.name===\"NotSupportedError\")return s.pubKeyCredParams.filter(i=>i.type===\"public-key\").length===0?new Ot({message:'No entry in pubKeyCredParams was of type \"public-key\"',code:\"ERROR_MALFORMED_PUBKEYCREDPARAMS\",cause:t}):new Ot({message:\"No available authenticator supported any of the specified pubKeyCredParams algorithms\",code:\"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG\",cause:t});if(t.name===\"SecurityError\"){let a=window.location.hostname;if(nT(a)){if(s.rp.id!==a)return new Ot({message:`The RP ID \"${s.rp.id}\" is invalid for this domain`,code:\"ERROR_INVALID_RP_ID\",cause:t})}else return new Ot({message:`${window.location.hostname} is an invalid domain`,code:\"ERROR_INVALID_DOMAIN\",cause:t})}else if(t.name===\"TypeError\"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new Ot({message:\"User ID was not between 1 and 64 characters\",code:\"ERROR_INVALID_USER_ID_LENGTH\",cause:t})}else if(t.name===\"UnknownError\")return new Ot({message:\"The authenticator was unable to process the specified options, or could not create a new credential\",code:\"ERROR_AUTHENTICATOR_GENERAL_ERROR\",cause:t})}return new Ot({message:\"a Non-Webauthn related error has occurred\",code:\"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY\",cause:t})}function Qj({error:t,options:e}){let{publicKey:n}=e;if(!n)throw Error(\"options was missing required publicKey property\");if(t.name===\"AbortError\"){if(e.signal instanceof AbortSignal)return new Ot({message:\"Authentication ceremony was sent an abort signal\",code:\"ERROR_CEREMONY_ABORTED\",cause:t})}else{if(t.name===\"NotAllowedError\")return new Ot({message:t.message,code:\"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY\",cause:t});if(t.name===\"SecurityError\"){let r=window.location.hostname;if(nT(r)){if(n.rpId!==r)return new Ot({message:`The RP ID \"${n.rpId}\" is invalid for this domain`,code:\"ERROR_INVALID_RP_ID\",cause:t})}else return new Ot({message:`${window.location.hostname} is an invalid domain`,code:\"ERROR_INVALID_DOMAIN\",cause:t})}else if(t.name===\"UnknownError\")return new Ot({message:\"The authenticator was unable to process the specified options, or could not create a new assertion signature\",code:\"ERROR_AUTHENTICATOR_GENERAL_ERROR\",cause:t})}return new Ot({message:\"a Non-Webauthn related error has occurred\",code:\"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY\",cause:t})}var rT=class{createNewAbortSignal(){if(this.controller){let n=new Error(\"Cancelling existing WebAuthn API call for new one\");n.name=\"AbortError\",this.controller.abort(n)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=new Error(\"Manually cancelling existing WebAuthn API call\");e.name=\"AbortError\",this.controller.abort(e),this.controller=void 0}}},Gw=new rT;function oT(t){if(!t)throw new Error(\"Credential creation options are required\");if(typeof PublicKeyCredential<\"u\"&&\"parseCreationOptionsFromJSON\"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON==\"function\")return PublicKeyCredential.parseCreationOptionsFromJSON(t);let{challenge:e,user:n,excludeCredentials:r}=t,o=tc(t,[\"challenge\",\"user\",\"excludeCredentials\"]),s=ml(e).buffer,a=Object.assign(Object.assign({},n),{id:ml(n.id).buffer}),i=Object.assign(Object.assign({},o),{challenge:s,user:a});if(r&&r.length>0){i.excludeCredentials=new Array(r.length);for(let l=0;l<r.length;l++){let u=r[l];i.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:ml(u.id).buffer,type:u.type||\"public-key\",transports:u.transports})}}return i}function sT(t){if(!t)throw new Error(\"Credential request options are required\");if(typeof PublicKeyCredential<\"u\"&&\"parseRequestOptionsFromJSON\"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON==\"function\")return PublicKeyCredential.parseRequestOptionsFromJSON(t);let{challenge:e,allowCredentials:n}=t,r=tc(t,[\"challenge\",\"allowCredentials\"]),o=ml(e).buffer,s=Object.assign(Object.assign({},r),{challenge:o});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){let i=n[a];s.allowCredentials[a]=Object.assign(Object.assign({},i),{id:ml(i.id).buffer,type:i.type||\"public-key\",transports:i.transports})}}return s}function aT(t){var e;if(\"toJSON\"in t&&typeof t.toJSON==\"function\")return t.toJSON();let n=t;return{id:t.id,rawId:t.id,response:{attestationObject:Ga(new Uint8Array(t.response.attestationObject)),clientDataJSON:Ga(new Uint8Array(t.response.clientDataJSON))},type:\"public-key\",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function iT(t){var e;if(\"toJSON\"in t&&typeof t.toJSON==\"function\")return t.toJSON();let n=t,r=t.getClientExtensionResults(),o=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:Ga(new Uint8Array(o.authenticatorData)),clientDataJSON:Ga(new Uint8Array(o.clientDataJSON)),signature:Ga(new Uint8Array(o.signature)),userHandle:o.userHandle?Ga(new Uint8Array(o.userHandle)):void 0},type:\"public-key\",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function nT(t){return t===\"localhost\"||/^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,}$/i.test(t)}function sy(){var t,e;return!!(cn()&&\"PublicKeyCredential\"in window&&window.PublicKeyCredential&&\"credentials\"in navigator&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.create)==\"function\"&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.get)==\"function\")}async function lT(t){try{let e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new uc(\"Browser returned unexpected credential type\",e)}:{data:null,error:new uc(\"Empty credential response\",e)}}catch(e){return{data:null,error:Zj({error:e,options:t})}}}async function uT(t){try{let e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new uc(\"Browser returned unexpected credential type\",e)}:{data:null,error:new uc(\"Empty credential response\",e)}}catch(e){return{data:null,error:Qj({error:e,options:t})}}}var dse={hints:[\"security-key\"],authenticatorSelection:{authenticatorAttachment:\"cross-platform\",requireResidentKey:!1,userVerification:\"preferred\",residentKey:\"discouraged\"},attestation:\"direct\"},fse={userVerification:\"preferred\",hints:[\"security-key\"],attestation:\"direct\"};function Vw(...t){let e=o=>o!==null&&typeof o==\"object\"&&!Array.isArray(o),n=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),r={};for(let o of t)if(o)for(let s in o){let a=o[s];if(a!==void 0)if(Array.isArray(a))r[s]=a;else if(n(a))r[s]=a;else if(e(a)){let i=r[s];e(i)?r[s]=Vw(i,a):r[s]=Vw(a)}else r[s]=a}return r}function pse(t,e){return Vw(dse,t,e||{})}function hse(t,e){return Vw(fse,t,e||{})}var Kw=class{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:\"webauthn\"}))}async _challenge({factorId:e,webauthn:n,friendlyName:r,signal:o},s){var a;try{let{data:i,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!i)return{data:null,error:l};let u=o??Gw.createNewAbortSignal();if(i.webauthn.type===\"create\"){let{user:c}=i.webauthn.credential_options.publicKey;if(!c.name){let d=r;if(d)c.name=`${c.id}:${d}`;else{let p=(await this.client.getUser()).data.user,h=((a=p?.user_metadata)===null||a===void 0?void 0:a.name)||p?.email||p?.id||\"User\";c.name=`${c.id}:${h}`}}c.displayName||(c.displayName=c.name)}switch(i.webauthn.type){case\"create\":{let c=pse(i.webauthn.credential_options.publicKey,s?.create),{data:d,error:f}=await lT({publicKey:c,signal:u});return d?{data:{factorId:e,challengeId:i.id,webauthn:{type:i.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}case\"request\":{let c=hse(i.webauthn.credential_options.publicKey,s?.request),{data:d,error:f}=await uT(Object.assign(Object.assign({},i.webauthn.credential_options),{publicKey:c,signal:u}));return d?{data:{factorId:e,challengeId:i.id,webauthn:{type:i.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}}}catch(i){return W(i)?{data:null,error:i}:{data:null,error:new Zn(\"Unexpected error in challenge\",i)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<\"u\"?window.location.hostname:void 0,rpOrigins:r=typeof window<\"u\"?[window.location.origin]:void 0,signal:o}={}},s){if(!n)return{data:null,error:new pl(\"rpId is required for WebAuthn authentication\")};try{if(!sy())return{data:null,error:new Zn(\"Browser does not support WebAuthn\",null)};let{data:a,error:i}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:o},{request:s});if(!a)return{data:null,error:i};let{webauthn:l}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:r,credential_response:l.credential_response}})}catch(a){return W(a)?{data:null,error:a}:{data:null,error:new Zn(\"Unexpected error in authenticate\",a)}}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<\"u\"?window.location.hostname:void 0,rpOrigins:r=typeof window<\"u\"?[window.location.origin]:void 0,signal:o}={}},s){if(!n)return{data:null,error:new pl(\"rpId is required for WebAuthn registration\")};try{if(!sy())return{data:null,error:new Zn(\"Browser does not support WebAuthn\",null)};let{data:a,error:i}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(c=>{var d;return(d=c.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type===\"webauthn\"&&f.friendly_name===e&&f.status!==\"unverified\")}).then(c=>c?this.client.mfa.unenroll({factorId:c?.id}):void 0),{data:null,error:i};let{data:l,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:o},{create:s});return l?this._verify({factorId:a.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(a){return W(a)?{data:null,error:a}:{data:null,error:new Zn(\"Unexpected error in register\",a)}}}};Wj();var mse={url:bj,storageKey:vj,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:xj,flowType:\"implicit\",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};var rp={},e4=!1,Ww=class t{get jwks(){var e,n;return(n=(e=rp[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){rp[this.storageKey]=Object.assign(Object.assign({},rp[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=rp[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){rp[this.storageKey]=Object.assign(Object.assign({},rp[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let s=Object.assign(Object.assign({},mse),e);if(this.storageKey=s.storageKey,this.instanceID=(n=t.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,t.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug==\"function\"&&(this.logger=s.debug),this.instanceID>0&&cn()){let a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.experimental=(r=s.experimental)!==null&&r!==void 0?r:{},this.admin=new lc({url:s.url,headers:s.headers,fetch:s.fetch,experimental:this.experimental}),this.url=s.url,this.headers=s.headers,this.fetch=$w(s.fetch),this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock!=null&&(this.lock=s.lock,e4||(e4=!0,console.warn(`${this._logPrefix()} The \"lock\" option is deprecated and will be removed in v3. The client now coordinates session refreshes without a lock, so most apps can drop the option. See https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/migrations/lockless-coordination.md`))),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Kw(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:Hw()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=eT(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=eT(this.memoryStorage)),cn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error(\"Failed to create a new BroadcastChannel, multi-tab state changes will not be available\",a)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener(\"message\",async a=>{this._debug(\"received broadcast notification from other tab or client\",a),(a.data.event===\"TOKEN_REFRESHED\"||a.data.event===\"SIGNED_IN\")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(i){this._debug(\"#broadcastChannel\",\"error\",i)}})}s.skipAutoInitialize||this.initialize().catch(a=>{this._debug(\"#initialize()\",\"error\",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Nw}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){var e;if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())();let n=await this.initializePromise,r=(e=this._pendingInitNotifications)!==null&&e!==void 0?e:[];this._pendingInitNotifications=null;for(let o of r)await this._notifyAllSubscribers(o.event,o.session,o.broadcast);return n}async _initialize(){var e;try{let n={},r=\"none\";if(cn()&&(n=XE(window.location.href),this._isImplicitGrantCallback(n)?r=\"implicit\":await this._isPKCECallback(n)&&(r=\"pkce\")),cn()&&this.detectSessionInUrl&&r!==\"none\"){let{data:o,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug(\"#_initialize()\",\"error detecting session from URL\",s),Cj(s)){let l=(e=s.details)===null||e===void 0?void 0:e.code;if(l===\"identity_already_exists\"||l===\"identity_not_found\"||l===\"single_identity_not_deletable\")return{error:s}}return{error:s}}let{session:a,redirectType:i}=o;return this._debug(\"#_initialize()\",\"detected session in URL\",a,\"redirect type\",i),await this._saveSession(a),setTimeout(async()=>{i===\"recovery\"?await this._notifyAllSubscribers(\"PASSWORD_RECOVERY\",a):await this._notifyAllSubscribers(\"SIGNED_IN\",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return W(n)?this._returnResult({error:n}):this._returnResult({error:new Zn(\"Unexpected error during initialization\",n)})}finally{await this._handleVisibilityChange(),this._debug(\"#_initialize()\",\"end\")}}async signInAnonymously(e){var n,r,o;try{let s=await ne(this.fetch,\"POST\",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e?.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(o=e?.options)===null||o===void 0?void 0:o.captchaToken}},xform:ao}),{data:a,error:i}=s;if(i||!a)return this._returnResult({data:{user:null,session:null},error:i});let l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers(\"SIGNED_IN\",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(W(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var n,r,o;let s=null;try{let a;if(\"email\"in e){let{email:d,password:f,options:p}=e,h=null,g=null;this.flowType===\"pkce\"&&([h,g,s]=await this._getCodeChallengeAndMethod()),a=await ne(this.fetch,\"POST\",`${this.url}/signup`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(p?.emailRedirectTo,s),body:{email:d,password:f,data:(n=p?.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:p?.captchaToken},code_challenge:h,code_challenge_method:g},xform:ao})}else if(\"phone\"in e){let{phone:d,password:f,options:p}=e;a=await ne(this.fetch,\"POST\",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(r=p?.data)!==null&&r!==void 0?r:{},channel:(o=p?.channel)!==null&&o!==void 0?o:\"sms\",gotrue_meta_security:{captcha_token:p?.captchaToken}},xform:ao})}else throw new nc(\"You must provide either an email or phone number and a password\");let{data:i,error:l}=a;if(l||!i)return await zo(this.storage,this.storageKey,s),this._returnResult({data:{user:null,session:null},error:l});let u=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers(\"SIGNED_IN\",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(a){if(await zo(this.storage,this.storageKey,s),W(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(e){try{let n;if(\"email\"in e){let{email:s,password:a,options:i}=e;n=await ne(this.fetch,\"POST\",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:ZE})}else if(\"phone\"in e){let{phone:s,password:a,options:i}=e;n=await ne(this.fetch,\"POST\",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:ZE})}else throw new nc(\"You must provide either an email or phone number and a password\");let{data:r,error:o}=n;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!r||!r.session||!r.user){let s=new Ka;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(\"SIGNED_IN\",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:o})}catch(n){if(W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,o,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(o=e.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e,n){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e,n)):this._exchangeCodeForSession(e,n)}async signInWithWeb3(e){let{chain:n}=e;switch(n){case\"ethereum\":return await this.signInWithEthereum(e);case\"solana\":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain \"${n}\"`)}}async signInWithEthereum(e){var n,r,o,s,a,i,l,u,c,d,f;let p,h;if(\"message\"in e)p=e.message,h=e.signature;else{let{chain:g,wallet:m,statement:y,options:b}=e,x;if(cn())if(typeof m==\"object\")x=m;else{let A=window;if(\"ethereum\"in A&&typeof A.ethereum==\"object\"&&\"request\"in A.ethereum&&typeof A.ethereum.request==\"function\")x=A.ethereum;else throw new Error(\"@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.\")}else{if(typeof m!=\"object\"||!b?.url)throw new Error(\"@supabase/auth-js: Both wallet and url must be specified in non-browser environments.\");x=m}let v=new URL((n=b?.url)!==null&&n!==void 0?n:window.location.href),S=await x.request({method:\"eth_requestAccounts\"}).then(A=>A).catch(()=>{throw new Error(\"@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid\")});if(!S||S.length===0)throw new Error(\"@supabase/auth-js: No accounts available. Please ensure the wallet is connected.\");let E=tT(S[0]),w=(r=b?.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!w){let A=await x.request({method:\"eth_chainId\"});w=Xj(A)}let k={domain:v.host,address:E,statement:y,uri:v.href,version:\"1\",chainId:w,nonce:(o=b?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(a=(s=b?.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(i=b?.signInWithEthereum)===null||i===void 0?void 0:i.expirationTime,notBefore:(l=b?.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=b?.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=b?.signInWithEthereum)===null||c===void 0?void 0:c.resources};p=Yj(k),h=await x.request({method:\"personal_sign\",params:[Jj(p),E]})}try{let{data:g,error:m}=await ne(this.fetch,\"POST\",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:\"ethereum\",message:p,signature:h},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:ao});if(m)throw m;if(!g||!g.session||!g.user){let y=new Ka;return this._returnResult({data:{user:null,session:null},error:y})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers(\"SIGNED_IN\",g.session)),this._returnResult({data:Object.assign({},g),error:m})}catch(g){if(W(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var n,r,o,s,a,i,l,u,c,d,f,p;let h,g;if(\"message\"in e)h=e.message,g=e.signature;else{let{chain:m,wallet:y,statement:b,options:x}=e,v;if(cn())if(typeof y==\"object\")v=y;else{let E=window;if(\"solana\"in E&&typeof E.solana==\"object\"&&(\"signIn\"in E.solana&&typeof E.solana.signIn==\"function\"||\"signMessage\"in E.solana&&typeof E.solana.signMessage==\"function\"))v=E.solana;else throw new Error(\"@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.\")}else{if(typeof y!=\"object\"||!x?.url)throw new Error(\"@supabase/auth-js: Both wallet and url must be specified in non-browser environments.\");v=y}let S=new URL((n=x?.url)!==null&&n!==void 0?n:window.location.href);if(\"signIn\"in v&&v.signIn){let E=await v.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x?.signInWithSolana),{version:\"1\",domain:S.host,uri:S.href}),b?{statement:b}:null)),w;if(Array.isArray(E)&&E[0]&&typeof E[0]==\"object\")w=E[0];else if(E&&typeof E==\"object\"&&\"signedMessage\"in E&&\"signature\"in E)w=E;else throw new Error(\"@supabase/auth-js: Wallet method signIn() returned unrecognized value\");if(\"signedMessage\"in w&&\"signature\"in w&&(typeof w.signedMessage==\"string\"||w.signedMessage instanceof Uint8Array)&&w.signature instanceof Uint8Array)h=typeof w.signedMessage==\"string\"?w.signedMessage:new TextDecoder().decode(w.signedMessage),g=w.signature;else throw new Error(\"@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields\")}else{if(!(\"signMessage\"in v)||typeof v.signMessage!=\"function\"||!(\"publicKey\"in v)||typeof v!=\"object\"||!v.publicKey||!(\"toBase58\"in v.publicKey)||typeof v.publicKey.toBase58!=\"function\")throw new Error(\"@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API\");h=[`${S.host} wants you to sign in with your Solana account:`,v.publicKey.toBase58(),...b?[\"\",b,\"\"]:[\"\"],\"Version: 1\",`URI: ${S.href}`,`Issued At: ${(o=(r=x?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((s=x?.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((a=x?.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((i=x?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((l=x?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((u=x?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((d=(c=x?.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?[\"Resources\",...x.signInWithSolana.resources.map(w=>`- ${w}`)]:[]].join(`\n`);let E=await v.signMessage(new TextEncoder().encode(h),\"utf8\");if(!E||!(E instanceof Uint8Array))throw new Error(\"@supabase/auth-js: Wallet signMessage() API returned an recognized value\");g=E}}try{let{data:m,error:y}=await ne(this.fetch,\"POST\",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:\"solana\",message:h,signature:Ga(g)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:ao});if(y)throw y;if(!m||!m.session||!m.user){let b=new Ka;return this._returnResult({data:{user:null,session:null},error:b})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers(\"SIGNED_IN\",m.session)),this._returnResult({data:Object.assign({},m),error:y})}catch(m){if(W(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async _exchangeCodeForSession(e,n){let r=n?.flowId!=null,o=r?oy(n?.flowId):cn()?oy(XE(window.location.href)[Va]):null;r&&!o&&this._debug(\"#_exchangeCodeForSession()\",\"provided flowId is not a valid flow id\",n?.flowId);let{verifier:s,flowId:a}=r&&!o?{verifier:null,flowId:null}:await Pj(this.storage,this.storageKey,o),[i,l]=(s??\"\").split(\"/\");try{if(!i&&this.flowType===\"pkce\")throw new zw;let{data:u,error:c}=await ne(this.fetch,\"POST\",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:i},xform:ao});if(await zo(this.storage,this.storageKey,a),c)throw c;if(!u||!u.session||!u.user){let d=new Ka;return this._returnResult({data:{user:null,session:null,redirectType:null},error:d})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers(l===\"recovery\"?\"PASSWORD_RECOVERY\":\"SIGNED_IN\",u.session)),this._returnResult({data:Object.assign(Object.assign({},u),{redirectType:l??null}),error:c})}catch(u){if(await zo(this.storage,this.storageKey,a),W(u))return this._returnResult({data:{user:null,session:null,redirectType:null},error:u});throw u}}async signInWithIdToken(e){try{let{options:n,provider:r,token:o,access_token:s,nonce:a}=e,i=await ne(this.fetch,\"POST\",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:o,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:n?.captchaToken}},xform:ao}),{data:l,error:u}=i;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){let c=new Ka;return this._returnResult({data:{user:null,session:null},error:c})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(\"SIGNED_IN\",l.session)),this._returnResult({data:l,error:u})}catch(n){if(W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,o,s,a;let i=null;try{if(\"email\"in e){let{email:l,options:u}=e,c=null,d=null;this.flowType===\"pkce\"&&([c,d,i]=await this._getCodeChallengeAndMethod());let{error:f}=await ne(this.fetch,\"POST\",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=u?.data)!==null&&n!==void 0?n:{},create_user:(r=u?.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:d},redirectTo:this._maybeAppendFlowIdToRedirect(u?.emailRedirectTo,i)});return this._returnResult({data:{user:null,session:null},error:f})}if(\"phone\"in e){let{phone:l,options:u}=e,{data:c,error:d}=await ne(this.fetch,\"POST\",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(o=u?.data)!==null&&o!==void 0?o:{},create_user:(s=u?.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(a=u?.channel)!==null&&a!==void 0?a:\"sms\"}});return this._returnResult({data:{user:null,session:null,messageId:c?.message_id},error:d})}throw new nc(\"You must provide either an email or phone number.\")}catch(l){if(await zo(this.storage,this.storageKey,i),W(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(e){var n,r;try{let o,s;\"options\"in e&&(o=(n=e.options)===null||n===void 0?void 0:n.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);let{data:a,error:i}=await ne(this.fetch,\"POST\",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:o,xform:ao});if(i)throw i;if(!a)throw new Error(\"An error occurred on token verification.\");let l=a.session,u=a.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type==\"recovery\"?\"PASSWORD_RECOVERY\":\"SIGNED_IN\",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(o){if(W(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(e){var n,r,o,s;let a=null;try{let i=null,l=null;this.flowType===\"pkce\"&&([i,l,a]=await this._getCodeChallengeAndMethod());let u=await ne(this.fetch,\"POST\",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},\"providerId\"in e?{provider_id:e.providerId}:null),\"domain\"in e?{domain:e.domain}:null),{redirect_to:this._maybeAppendFlowIdToRedirect((n=e.options)===null||n===void 0?void 0:n.redirectTo,a)}),!((r=e?.options)===null||r===void 0)&&r.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:l}),headers:this.headers,xform:Kj});return!((o=u.data)===null||o===void 0)&&o.url&&cn()&&!(!((s=e.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(i){if(await zo(this.storage,this.storageKey,a),W(i))return this._returnResult({data:null,error:i});throw i}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new Ht;let{error:o}=await ne(this.fetch,\"GET\",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(e){if(W(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){let n=null;try{let r=`${this.url}/resend`;if(\"email\"in e){let{email:o,type:s,options:a}=e,i=null,l=null;this.flowType===\"pkce\"&&([i,l,n]=await this._getCodeChallengeAndMethod());let{error:u}=await ne(this.fetch,\"POST\",r,{headers:this.headers,body:{email:o,type:s,gotrue_meta_security:{captcha_token:a?.captchaToken},code_challenge:i,code_challenge_method:l},redirectTo:this._maybeAppendFlowIdToRedirect(a?.emailRedirectTo,n)});return u&&await zo(this.storage,this.storageKey,n),this._returnResult({data:{user:null,session:null},error:u})}else if(\"phone\"in e){let{phone:o,type:s,options:a}=e,{data:i,error:l}=await ne(this.fetch,\"POST\",r,{headers:this.headers,body:{phone:o,type:s,gotrue_meta_security:{captcha_token:a?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i?.message_id},error:l})}throw new nc(\"You must provide either an email or phone number and a type\")}catch(r){if(await zo(this.storage,this.storageKey,n),W(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,n){this._debug(\"#_acquireLock\",\"begin\",e);try{if(this.lockAcquired){let r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(\"#_acquireLock\",\"lock acquired for storage key\",this.storageKey);try{this.lockAcquired=!0;let r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){let o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await r}finally{this._debug(\"#_acquireLock\",\"lock released for storage key\",this.storageKey),this.lockAcquired=!1}})}finally{this._debug(\"#_acquireLock\",\"end\")}}async _useSession(e){this._debug(\"#_useSession\",\"begin\");try{let n=await this.__loadSession();return await e(n)}finally{this._debug(\"#_useSession\",\"end\")}}async __loadSession(){this._debug(\"#__loadSession()\",\"begin\"),this.lock!=null&&!this.lockAcquired&&this._debug(\"#__loadSession()\",\"used outside of an acquired lock!\",new Error().stack);try{let e=null,n=await Fn(this.storage,this.storageKey);if(this._debug(\"#getSession()\",\"session from storage\",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug(\"#getSession()\",\"session from storage is not valid\"),await this._removeSession())),!e)return{data:{session:null},error:null};let r=e.expires_at?e.expires_at*1e3-Date.now()<Pw:!1;if(this._debug(\"#__loadSession()\",`session has${r?\"\":\" not\"} expired`,\"expires_at\",e.expires_at),!r){if(this.userStorage){let a=await Fn(this.userStorage,this.storageKey+\"-user\");a?.user?e.user=a.user:e.user=Uw()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let a={value:this.suppressGetSessionWarning};e.user=jj(e.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:o,error:s}=await this._callRefreshToken(e.refresh_token);if(s){if(!!(e.expires_at&&e.expires_at*1e3>Date.now())){let i=await Fn(this.storage,this.storageKey);if(i&&i.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:s})}return this._returnResult({data:{session:o},error:null})}finally{this._debug(\"#__loadSession()\",\"end\")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let n;return this.lock!=null?n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):n=await this._getUser(),n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(e){try{return e?await ne(this.fetch,\"GET\",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Gs}):await this._useSession(async n=>{var r,o,s;let{data:a,error:i}=n;if(i)throw i;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ht}:await ne(this.fetch,\"GET\",`${this.url}/user`,{headers:this.headers,jwt:(s=(o=a.session)===null||o===void 0?void 0:o.access_token)!==null&&s!==void 0?s:void 0,xform:Gs})})}catch(n){if(W(n))return Qg(n)&&await this._removeSession(),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,n)):await this._updateUser(e,n)}async _updateUser(e,n={}){let r=null;try{return await this._useSession(async o=>{let{data:s,error:a}=o;if(a)throw a;if(!s.session)throw new Ht;let i=s.session,l=null,u=null;this.flowType===\"pkce\"&&e.email!=null&&([l,u,r]=await this._getCodeChallengeAndMethod());let{data:c,error:d}=await ne(this.fetch,\"PUT\",`${this.url}/user`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(n?.emailRedirectTo,r),body:Object.assign(Object.assign({},e),{code_challenge:l,code_challenge_method:u}),jwt:i.access_token,xform:Gs});if(d)throw d;return i.user=c.user,await this._saveSession(i),await this._notifyAllSubscribers(\"USER_UPDATED\",i),this._returnResult({data:{user:i.user},error:null})})}catch(o){if(await zo(this.storage,this.storageKey,r),W(o))return this._returnResult({data:{user:null},error:o});throw o}}async setSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Ht;let n=Date.now()/1e3,r=n,o=!0,s=null,{payload:a}=ry(e.access_token);if(a.exp&&(r=a.exp,o=r<=n),o){let{data:i,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!i)return{data:{user:null,session:null},error:null};s=i}else{let{data:i,error:l}=await this._getUser(e.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});s={access_token:e.access_token,refresh_token:e.refresh_token,user:i.user,token_type:\"bearer\",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers(\"SIGNED_IN\",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(n){if(W(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){let{data:a,error:i}=n;if(i)throw i;e=(r=a.session)!==null&&r!==void 0?r:void 0}if(!e?.refresh_token)throw new Ht;let{data:o,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){var r;try{if(!cn())throw new rc(\"No browser detected.\");if(e.error||e.error_description||e.error_code)throw new rc(e.error_description||\"Error in URL with unspecified error_description\",{error:e.error||\"unspecified_error\",code:e.error_code||\"unspecified_code\"});switch(n){case\"implicit\":if(this.flowType===\"pkce\")throw new Jg(\"Not a valid PKCE flow url.\");break;case\"pkce\":if(this.flowType===\"implicit\")throw new rc(\"Not a valid implicit grant flow url.\");break;default:}if(n===\"pkce\"){if(this._debug(\"#_initialize()\",\"begin\",\"is PKCE flow\",!0),!e.code)throw new Jg(\"No code detected.\");let{data:x,error:v}=await this._exchangeCodeForSession(e.code,{flowId:e[Va]});if(v)throw v;let S=new URL(window.location.href);return S.searchParams.delete(\"code\"),S.searchParams.delete(Va),window.history.replaceState(window.history.state,\"\",S.toString()),{data:{session:x.session,redirectType:(r=x.redirectType)!==null&&r!==void 0?r:null},error:null}}let{provider_token:o,provider_refresh_token:s,access_token:a,refresh_token:i,expires_in:l,expires_at:u,token_type:c}=e;if(!a||!l||!i||!c)throw new rc(\"No session defined in URL\");let d=Math.round(Date.now()/1e3),f=parseInt(l),p=d+f;u&&(p=parseInt(u));let h=p-d;h*1e3<=qs&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${f}s`);let g=p-f;d-g>=120?console.warn(\"@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale\",g,p,d):d-g<0&&console.warn(\"@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew\",g,p,d);let{data:m,error:y}=await this._getUser(a);if(y)throw y;let b={provider_token:o,provider_refresh_token:s,access_token:a,expires_in:f,expires_at:p,refresh_token:i,token_type:c,user:m.user};return window.location.hash=\"\",this._debug(\"#_getSessionFromURL()\",\"clearing window.location.hash\"),this._returnResult({data:{session:b,redirectType:e.type},error:null})}catch(o){if(W(o))return this._returnResult({data:{session:null,redirectType:null},error:o});throw o}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==\"function\"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){if(!e.code)return!1;let n=oy(e[Va]);return n&&await Fn(this.storage,ac(this.storageKey,n))?!0:!!await Fn(this.storage,`${this.storageKey}-code-verifier`)}async signOut(e={scope:\"global\"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:\"global\"}){return await this._useSession(async n=>{var r;let o=async()=>{await this._removeSession()},{data:s,error:a}=n;if(a&&!Qg(a))return this._returnResult({error:a});let i=(r=s.session)===null||r===void 0?void 0:r.access_token;if(i){let{error:l}=await this.admin.signOut(i,e);if(l&&!(GE(l)&&(l.status===404||l.status===401||l.status===403)||Qg(l)))return e!==\"others\"&&await o(),this._returnResult({error:l})}return e!==\"others\"&&await o(),this._returnResult({error:null})})}onAuthStateChange(e){let n=Mj(),r={id:n,callback:e,unsubscribe:()=>{this._debug(\"#unsubscribe()\",\"state change callback with id removed\",n),this.stateChangeEmitters.delete(n)}};return this._debug(\"#onAuthStateChange()\",\"registered callback with id\",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)}):await this._emitInitialSession(n)))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,o;try{let{data:{session:s},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback(\"INITIAL_SESSION\",s)),this._debug(\"INITIAL_SESSION\",\"callback id\",e,\"session\",s)}catch(s){await((o=this.stateChangeEmitters.get(e))===null||o===void 0?void 0:o.callback(\"INITIAL_SESSION\",null)),this._debug(\"INITIAL_SESSION\",\"callback id\",e,\"error\",s),Qg(s)||ey(s)||GE(s)&&(s.code===\"refresh_token_not_found\"||s.code===\"refresh_token_already_used\"||s.code===\"session_expired\")?console.warn(s):console.error(s)}})}async resetPasswordForEmail(e,n={}){let r=null,o=null,s=null;this.flowType===\"pkce\"&&([r,o,s]=await this._getCodeChallengeAndMethod(!0));try{return await ne(this.fetch,\"POST\",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:o,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(n.redirectTo,s)})}catch(a){if(await zo(this.storage,this.storageKey,s),W(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var e;try{let{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return\"token\"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;let r=null;try{let{data:o,error:s}=await this._useSession(async a=>{var i,l,u,c,d;let{data:f,error:p}=a;if(p)throw p;let{url:h,flowId:g}=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(i=e.options)===null||i===void 0?void 0:i.redirectTo,scopes:(l=e.options)===null||l===void 0?void 0:l.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return r=g,await ne(this.fetch,\"GET\",h,{headers:this.headers,jwt:(d=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return cn()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(o?.url),this._returnResult({data:{provider:e.provider,url:o?.url,flowId:r},error:null})}catch(o){if(W(o))return this._returnResult({data:{provider:e.provider,url:null,flowId:r},error:o});throw o}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{let{error:o,data:{session:s}}=n;if(o)throw o;let{options:a,provider:i,token:l,access_token:u,nonce:c}=e,d=await ne(this.fetch,\"POST\",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s?.access_token)!==null&&r!==void 0?r:void 0,body:{provider:i,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ao}),{data:f,error:p}=d;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new Ka}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers(\"USER_UPDATED\",f.session)),this._returnResult({data:f,error:p}))}catch(o){if(await zo(this.storage,this.storageKey,null),W(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,o;let{data:s,error:a}=n;if(a)throw a;return await ne(this.fetch,\"DELETE\",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(o=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&o!==void 0?o:void 0})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){let n=\"#_refreshAccessToken()\";this._debug(n,\"begin\");try{let r=Date.now();return await Dj(async o=>(o>0&&await Oj(200*Math.pow(2,o-1)),this._debug(n,\"refreshing attempt\",o),await ne(this.fetch,\"POST\",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ao})),(o,s)=>{let a=200*Math.pow(2,o);return s&&ey(s)&&Date.now()+a-r<qs})}catch(r){if(this._debug(n,\"error\",r),W(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,\"end\")}}_isValidSession(e){return typeof e==\"object\"&&e!==null&&\"access_token\"in e&&\"refresh_token\"in e&&\"expires_at\"in e}async _handleProviderSignIn(e,n){let{url:r,flowId:o}=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug(\"#_handleProviderSignIn()\",\"provider\",e,\"options\",n,\"url\",r),cn()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r,flowId:o},error:null}}async _recoverAndRefresh(){var e,n;let r=\"#_recoverAndRefresh()\";this._debug(r,\"begin\");try{let o=await Fn(this.storage,this.storageKey);if(o&&this.userStorage){let a=await Fn(this.userStorage,this.storageKey+\"-user\");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:o.user},await Vs(this.userStorage,this.storageKey+\"-user\",a)),o.user=(e=a?.user)!==null&&e!==void 0?e:Uw()}else if(o&&!o.user&&!o.user){let a=await Fn(this.storage,this.storageKey+\"-user\");a&&a?.user?(o.user=a.user,await hr(this.storage,this.storageKey+\"-user\"),await Vs(this.storage,this.storageKey,o)):o.user=Uw()}if(this._debug(r,\"session from storage\",o),!this._isValidSession(o)){this._debug(r,\"session is not valid\"),o!==null&&await this._removeSession();return}let s=((n=o.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Pw;if(this._debug(r,`session has${s?\"\":\" not\"} expired with margin of ${Pw}s`),s){if(this.autoRefreshToken&&o.refresh_token){let{error:a}=await this._callRefreshToken(o.refresh_token);a&&(Lj(a)?this._debug(r,\"refresh discarded by commit guard\",a):this._debug(r,\"refresh failed\",a))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{let{data:a,error:i}=await this._getUser(o.access_token);!i&&a?.user?(o.user=a.user,await this._saveSession(o),await this._notifyAllSubscribers(\"SIGNED_IN\",o)):this._debug(r,\"could not get user data, skipping SIGNED_IN notification\")}catch(a){console.error(\"Error getting user data:\",a),this._debug(r,\"error getting user data, skipping SIGNED_IN notification\",a)}else await this._notifyAllSubscribers(\"SIGNED_IN\",o)}catch(o){this._debug(r,\"error\",o),ey(o)?console.warn(o):console.error(o);return}finally{this._debug(r,\"end\")}}async _callRefreshToken(e){var n,r;if(!e)throw new Ht;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug(\"#_callRefreshToken()\",\"returning cached failure (cooldown active)\"),this.lastRefreshFailure.result;let o=\"#_callRefreshToken()\";this._debug(o,\"begin\");try{this.refreshingDeferred=new ty,this.refreshingDeferred.promise.then(void 0,()=>{});let s=await Fn(this.storage,this.storageKey),{data:a,error:i}=await this._refreshAccessToken(e);if(i)throw i;if(!a.session)throw new Ht;let l=await Fn(this.storage,this.storageKey);if(s!==null&&(l===null||l.refresh_token!==s.refresh_token)){this._debug(o,\"commit guard: storage changed since refresh started, discarding rotated tokens\",{startedWith:\"present\",nowHolds:l?\"replaced\":\"cleared\"});let f={data:null,error:new Yg};return this.refreshingDeferred.resolve(f),f}let c=this._sessionRemovalEpoch;if(await this._saveSession(a.session),this._sessionRemovalEpoch!==c){this._debug(o,\"commit guard (post-save): _removeSession ran during _saveSession, undoing write\"),await hr(this.storage,this.storageKey),this.userStorage&&await hr(this.userStorage,this.storageKey+\"-user\");let f={data:null,error:new Yg};return this.refreshingDeferred.resolve(f),f}await this._notifyAllSubscribers(\"TOKEN_REFRESHED\",a.session);let d={data:a.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(d),d}catch(s){if(this._debug(o,\"error\",s),W(s)){let a={data:null,error:s};if(!ey(s)){let i=await Fn(this.storage,this.storageKey);!!(i?.expires_at&&i.expires_at*1e3>Date.now())?this._debug(o,\"proactive refresh failed, access token still valid \\u2014 preserving session\"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:a,expiresAt:Date.now()+yj},(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(o,\"end\")}}async _notifyAllSubscribers(e,n,r=!0){if(this._pendingInitNotifications!==null&&r){this._pendingInitNotifications.push({event:e,session:n,broadcast:r});return}let o=`#_notifyAllSubscribers(${e})`;this._debug(o,\"begin\",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});let s=[],a=Array.from(this.stateChangeEmitters.values()).map(async i=>{try{await i.callback(e,n)}catch(l){s.push(l)}});if(await Promise.all(a),s.length>0){for(let i=0;i<s.length;i+=1)console.error(s[i]);throw s[0]}}finally{this._debug(o,\"end\")}}async _saveSession(e){this._debug(\"#_saveSession()\",e),this.suppressGetSessionWarning=!0;let n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Vs(this.userStorage,this.storageKey+\"-user\",{user:n.user});let o=Object.assign({},n);delete o.user;let s=YE(o);await Vs(this.storage,this.storageKey,s)}else{let o=YE(n);await Vs(this.storage,this.storageKey,o)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug(\"#_removeSession()\"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await hr(this.storage,this.storageKey),await Bj(this.storage,this.storageKey),await hr(this.storage,this.storageKey+\"-user\"),this.userStorage&&await hr(this.userStorage,this.storageKey+\"-user\"),await this._notifyAllSubscribers(\"SIGNED_OUT\",null)}_removeVisibilityChangedCallback(){this._debug(\"#_removeVisibilityChangedCallback()\");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&cn()&&window?.removeEventListener&&window.removeEventListener(\"visibilitychange\",e)}catch(n){console.error(\"removing visibilitychange callback failed\",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug(\"#_startAutoRefresh()\");let e=setInterval(()=>this._autoRefreshTokenTick(),qs);this.autoRefreshTicker=e,e&&typeof e==\"object\"&&typeof e.unref==\"function\"?e.unref():typeof Deno<\"u\"&&typeof Deno.unrefTimer==\"function\"&&Deno.unrefTimer(e);let n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n==\"object\"&&typeof n.unref==\"function\"?n.unref():typeof Deno<\"u\"&&typeof Deno.unrefTimer==\"function\"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug(\"#_stopAutoRefresh()\");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)===null||e===void 0||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug(\"#_autoRefreshTokenTick()\",\"begin\"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async n=>{let{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug(\"#_autoRefreshTokenTick()\",\"no session\");return}let o=Math.floor((r.expires_at*1e3-e)/qs);this._debug(\"#_autoRefreshTokenTick()\",`access token expires in ${o} ticks, a tick lasts ${qs}ms, refresh threshold is ${np} ticks`),o<=np&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error(\"Auto refresh tick failed with error. This is likely a transient error.\",n)}}finally{this._debug(\"#_autoRefreshTokenTick()\",\"end\")}})}catch(e){if(e instanceof qw)this._debug(\"auto refresh token tick lock not available\");else throw e}return}if(this.refreshingDeferred!==null){this._debug(\"#_autoRefreshTokenTick()\",\"refresh already in flight, skipping\");return}try{let e=Date.now();try{await this._useSession(async n=>{let{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug(\"#_autoRefreshTokenTick()\",\"no session\");return}let o=Math.floor((r.expires_at*1e3-e)/qs);this._debug(\"#_autoRefreshTokenTick()\",`access token expires in ${o} ticks, a tick lasts ${qs}ms, refresh threshold is ${np} ticks`),o<=np&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error(\"Auto refresh tick failed with error. This is likely a transient error.\",n)}}finally{this._debug(\"#_autoRefreshTokenTick()\",\"end\")}}async _handleVisibilityChange(){if(this._debug(\"#_handleVisibilityChange()\"),!cn()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(\"#visibilityChangedCallback\",\"error\",e)}},window?.addEventListener(\"visibilitychange\",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(\"_handleVisibilityChange\",e)}}async _onVisibilityChanged(e){let n=`#_onVisibilityChanged(${e})`;if(this._debug(n,\"visibilityState\",document.visibilityState),document.visibilityState===\"visible\"){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!==\"visible\"){this._debug(n,\"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting\");return}await this._recoverAndRefresh()});else{if(document.visibilityState!==\"visible\"){this._debug(n,\"visibilityState is no longer visible, skipping recovery\");return}await this._recoverAndRefresh()}}else document.visibilityState===\"hidden\"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){let o=r?.redirectTo,s=null,a=null,i=null;this.flowType===\"pkce\"&&([s,a,i]=await this._getCodeChallengeAndMethod(),o=this._maybeAppendFlowIdToRedirect(o,i));let l=[`provider=${encodeURIComponent(n)}`];if(o&&l.push(`redirect_to=${encodeURIComponent(o)}`),r?.scopes&&l.push(`scopes=${encodeURIComponent(r.scopes)}`),s!=null&&a!=null){let u=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});l.push(u.toString())}if(r?.queryParams){let u=new URLSearchParams(r.queryParams);l.push(u.toString())}return r?.skipBrowserRedirect&&l.push(`skip_http_redirect=${r.skipBrowserRedirect}`),{url:`${e}?${l.join(\"&\")}`,flowId:i}}_maybeAppendFlowIdToRedirect(e,n){return!e||!n||!this.experimental.appendPkceFlowIdToRedirects?e??void 0:zj(e,n)}async _getCodeChallengeAndMethod(e=!1){return Fj(this.storage,this.storageKey,e,n=>this._debug(\"#_getCodeChallengeAndMethod()\",\"evicted oldest pending PKCE verifier slot\",n))}async _unenroll(e){try{return await this._useSession(async n=>{var r;let{data:o,error:s}=n;return s?this._returnResult({data:null,error:s}):await ne(this.fetch,\"DELETE\",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,o;let{data:s,error:a}=n;if(a)return this._returnResult({data:null,error:a});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===\"phone\"?{phone:e.phone}:e.factorType===\"totp\"?{issuer:e.issuer}:{}),{data:l,error:u}=await ne(this.fetch,\"POST\",`${this.url}/factors`,{body:i,headers:this.headers,jwt:(r=s?.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType===\"totp\"&&l.type===\"totp\"&&(!((o=l?.totp)===null||o===void 0)&&o.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){let n=async()=>{try{return await this._useSession(async r=>{var o;let{data:s,error:a}=r;if(a)return this._returnResult({data:null,error:a});let i=Object.assign({challenge_id:e.challengeId},\"webauthn\"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===\"create\"?aT(e.webauthn.credential_response):iT(e.webauthn.credential_response)})}:{code:e.code}),{data:l,error:u}=await ne(this.fetch,\"POST\",`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:(o=s?.session)===null||o===void 0?void 0:o.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers(\"MFA_CHALLENGE_VERIFIED\",l),this._returnResult({data:l,error:u}))})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,n):n()}async _challenge(e){let n=async()=>{try{return await this._useSession(async r=>{var o;let{data:s,error:a}=r;if(a)return this._returnResult({data:null,error:a});let i=await ne(this.fetch,\"POST\",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(o=s?.session)===null||o===void 0?void 0:o.access_token});if(i.error)return i;let{data:l}=i;if(l.type!==\"webauthn\")return{data:l,error:null};switch(l.webauthn.type){case\"create\":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:oT(l.webauthn.credential_options.publicKey)})})}),error:null};case\"request\":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:sT(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,n):n()}async _challengeAndVerify(e){let{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;let{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};let o={all:[],phone:[],totp:[],webauthn:[]};for(let s of(e=n?.factors)!==null&&e!==void 0?e:[])o.all.push(s),s.status===\"verified\"&&o[s.factor_type].push(s);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(e){var n,r,o,s;if(e)try{let{payload:p}=ry(e),h=null;p.aal&&(h=p.aal);let g=h,{data:{user:m},error:y}=await this.getUser(e);if(y)return this._returnResult({data:null,error:y});((r=(n=m?.factors)===null||n===void 0?void 0:n.filter(v=>v.status===\"verified\"))!==null&&r!==void 0?r:[]).length>0&&(g=\"aal2\");let x=p.amr||[];return{data:{currentLevel:h,nextLevel:g,currentAuthenticationMethods:x},error:null}}catch(p){if(W(p))return this._returnResult({data:null,error:p});throw p}let{data:{session:a},error:i}=await this.getSession();if(i)return this._returnResult({data:null,error:i});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:l}=ry(a.access_token),u=null;l.aal&&(u=l.aal);let c=u;((s=(o=a.user.factors)===null||o===void 0?void 0:o.filter(p=>p.status===\"verified\"))!==null&&s!==void 0?s:[]).length>0&&(c=\"aal2\");let f=l.amr||[];return{data:{currentLevel:u,nextLevel:c,currentAuthenticationMethods:f},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{let{data:{session:r},error:o}=n;return o?this._returnResult({data:null,error:o}):r?await ne(this.fetch,\"GET\",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Ht})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{let{data:{session:o},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!o)return this._returnResult({data:null,error:new Ht});let a=await ne(this.fetch,\"POST\",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:\"approve\"},xform:i=>({data:i,error:null})});return a.data&&a.data.redirect_url&&cn()&&!n?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{let{data:{session:o},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!o)return this._returnResult({data:null,error:new Ht});let a=await ne(this.fetch,\"POST\",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:\"deny\"},xform:i=>({data:i,error:null})});return a.data&&a.data.redirect_url&&cn()&&!n?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await ne(this.fetch,\"GET\",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new Ht})})}catch(e){if(W(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{let{data:{session:r},error:o}=n;return o?this._returnResult({data:null,error:o}):r?(await ne(this.fetch,\"DELETE\",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Ht})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(i=>i.kid===e);if(r)return r;let o=Date.now();if(r=this.jwks.keys.find(i=>i.kid===e),r&&this.jwks_cached_at+kj>o)return r;let{data:s,error:a}=await ne(this.fetch,\"GET\",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=o,r=s.keys.find(i=>i.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){let{data:p,error:h}=await this.getSession();if(h||!p.session)return this._returnResult({data:null,error:h});r=p.session.access_token}let{header:o,payload:s,signature:a,raw:{header:i,payload:l}}=ry(r);if(!n?.allowExpired)try{$j(s.exp)}catch(p){throw new hl(p instanceof Error?p.message:\"JWT validation failed\")}let u=!o.alg||o.alg.startsWith(\"HS\")||!o.kid||!(\"crypto\"in globalThis&&\"subtle\"in globalThis.crypto)?null:await this.fetchJwk(o.kid,n?.keys?{keys:n.keys}:n?.jwks);if(!u){let{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:s,header:o,signature:a},error:null}}let c=Uj(o.alg),d=await crypto.subtle.importKey(\"jwk\",u,c,!0,[\"verify\"]);if(!await crypto.subtle.verify(c,d,a,Rj(`${i}.${l}`)))throw new hl(\"Invalid JWT signature\");return{data:{claims:s,header:o,signature:a},error:null}}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(e){var n,r,o;so(this.experimental);try{if(!sy())return this._returnResult({data:null,error:new Zn(\"Browser does not support WebAuthn\",null)});let{data:s,error:a}=await this._startPasskeyAuthentication({options:{captchaToken:(n=e?.options)===null||n===void 0?void 0:n.captchaToken}});if(a||!s)return this._returnResult({data:null,error:a});let i=sT(s.options),l=(o=(r=e?.options)===null||r===void 0?void 0:r.signal)!==null&&o!==void 0?o:Gw.createNewAbortSignal(),{data:u,error:c}=await uT({publicKey:i,signal:l});if(c||!u)return this._returnResult({data:null,error:c??new Zn(\"WebAuthn ceremony failed\",null)});let d=iT(u);return this._verifyPasskeyAuthentication({challengeId:s.challenge_id,credential:d})}catch(s){if(W(s))return this._returnResult({data:null,error:s});throw s}}async registerPasskey(e){var n,r;so(this.experimental);try{if(!sy())return this._returnResult({data:null,error:new Zn(\"Browser does not support WebAuthn\",null)});let{data:o,error:s}=await this._startPasskeyRegistration();if(s||!o)return this._returnResult({data:null,error:s});let a=oT(o.options),i=(r=(n=e?.options)===null||n===void 0?void 0:n.signal)!==null&&r!==void 0?r:Gw.createNewAbortSignal(),{data:l,error:u}=await lT({publicKey:a,signal:i});if(u||!l)return this._returnResult({data:null,error:u??new Zn(\"WebAuthn ceremony failed\",null)});let c=aT(l);return this._verifyPasskeyRegistration({challengeId:o.challenge_id,credential:c})}catch(o){if(W(o))return this._returnResult({data:null,error:o});throw o}}async _startPasskeyRegistration(){so(this.experimental);try{return await this._useSession(async e=>{let{data:{session:n},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Ht});let{data:o,error:s}=await ne(this.fetch,\"POST\",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:n.access_token,body:{}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:o,error:null})})}catch(e){if(W(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){so(this.experimental);try{return await this._useSession(async n=>{let{data:{session:r},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!r)return this._returnResult({data:null,error:new Ht});let{data:s,error:a}=await ne(this.fetch,\"POST\",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:s,error:null})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyAuthentication(e){var n;so(this.experimental);try{let{data:r,error:o}=await ne(this.fetch,\"POST\",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(n=e?.options)===null||n===void 0?void 0:n.captchaToken}}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:r,error:null})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(e){so(this.experimental);try{let{data:n,error:r}=await ne(this.fetch,\"POST\",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:ao});return r?this._returnResult({data:null,error:r}):(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(\"SIGNED_IN\",n.session)),this._returnResult({data:n,error:null}))}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _listPasskeys(){so(this.experimental);try{return await this._useSession(async e=>{let{data:{session:n},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Ht});let{data:o,error:s}=await ne(this.fetch,\"GET\",`${this.url}/passkeys`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})});return s?this._returnResult({data:null,error:s}):this._returnResult({data:o,error:null})})}catch(e){if(W(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){so(this.experimental);try{return await this._useSession(async n=>{let{data:{session:r},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!r)return this._returnResult({data:null,error:new Ht});let{data:s,error:a}=await ne(this.fetch,\"PATCH\",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:s,error:null})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _deletePasskey(e){so(this.experimental);try{return await this._useSession(async n=>{let{data:{session:r},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!r)return this._returnResult({data:null,error:new Ht});let{error:s}=await ne(this.fetch,\"DELETE\",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return s?this._returnResult({data:null,error:s}):this._returnResult({data:null,error:null})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}};Ww.nextInstanceID={};var cT=Ww;var gse=cT,dT=gse;var yse=\"2.113.0\",ay=\"\",Yw;if(typeof Deno<\"u\")ay=\"deno\",Yw=(Xw=Deno.version)===null||Xw===void 0?void 0:Xw.deno;else if(typeof document<\"u\")ay=\"web\";else if(typeof navigator<\"u\"&&navigator.product===\"ReactNative\")ay=\"react-native\";else{ay=\"node\";let t=globalThis.process;Yw=t==null||(Jw=t.version)===null||Jw===void 0?void 0:Jw.replace(/^v/,\"\")}var Xw,Jw,i4=[`runtime=${ay}`];Yw&&i4.push(`runtime-version=${Yw}`);var bse={\"X-Client-Info\":`supabase-js/${yse}; ${i4.join(\"; \")}`},vse={headers:bse},xse={schema:\"public\"},wse={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:\"implicit\"},Sse={},kse={enabled:!1,respectSamplingDecision:!0};function Cse(t){if(!t||typeof t!=\"string\")return null;let e=t.split(\"-\");if(e.length!==4)return null;let[n,r,o,s]=e;if(n.length!==2||r.length!==32||o.length!==16||s.length!==2)return null;let a=/^[0-9a-f]+$/i;return!a.test(n)||!a.test(r)||!a.test(o)||!a.test(s)||r===\"00000000000000000000000000000000\"||o===\"0000000000000000\"?null:{version:n,traceId:r,parentId:o,traceFlags:s,isSampled:(parseInt(s,16)&1)===1}}function Lse(t,e){if(!t||!e||e.length===0)return!1;let n;if(t instanceof URL)n=t;else try{n=new URL(t)}catch{return!1}for(let r of e)try{if(typeof r==\"string\"){if(Ase(n.hostname,r))return!0}else if(r instanceof RegExp){if(r.test(n.hostname))return!0}else if(typeof r==\"function\"&&r(n))return!0}catch{continue}return!1}function Ase(t,e){if(e===t)return!0;if(e.startsWith(\"*.\")){let n=e.slice(2);if(t.endsWith(n)&&(t===n||t.endsWith(\".\"+n)))return!0}return!1}function Ese(t){let e=[];try{let n=new URL(t);e.push(n.hostname)}catch{}return e.push(\"*.supabase.co\",\"*.supabase.in\"),e.push(\"localhost\",\"127.0.0.1\",\"[::1]\"),e}function iy(t){\"@babel/helpers - typeof\";return iy=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(e){return typeof e}:function(e){return e&&typeof Symbol==\"function\"&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},iy(t)}function Tse(t,e){if(iy(t)!=\"object\"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||\"default\");if(iy(r)!=\"object\")return r;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(e===\"string\"?String:Number)(t)}function Rse(t){var e=Tse(t,\"string\");return iy(e)==\"symbol\"?e:e+\"\"}function Ise(t,e,n){return(e=Rse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function t4(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function $t(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?t4(Object(n),!0).forEach(function(r){Ise(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):t4(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Mse=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),_se=()=>Headers,l4=t=>t.startsWith(\"sb_publishable_\")||t.startsWith(\"sb_secret_\"),Ose=\"sb_temp_\",n4=new Set,Dse=t=>{var e,n;if(!t.startsWith(\"sb_\")||l4(t)||t.startsWith(Ose))return;let r=(e=(n=t.match(/^sb_[a-zA-Z0-9]+_/))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:\"unknown\";n4.has(r)||(n4.add(r),console.warn(\"@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type.\"))},r4=(t,e,n,r,o,s)=>{let a=Mse(r),i=_se(),l=o?.enabled===!0,u=o?.respectSamplingDecision!==!1,c=l?Ese(e):null,d=!(s?.omitApiKeyAsBearer&&l4(t));return async(f,p)=>{let h=await n(),g=new i(p?.headers);if(g.has(\"apikey\")||g.set(\"apikey\",t),!g.has(\"Authorization\")){let m=h??(d?t:null);m&&g.set(\"Authorization\",`Bearer ${m}`)}if(c){let m=Nse(f,c,u);m&&(m.traceparent&&!g.has(\"traceparent\")&&g.set(\"traceparent\",m.traceparent),m.tracestate&&!g.has(\"tracestate\")&&g.set(\"tracestate\",m.tracestate),m.baggage&&!g.has(\"baggage\")&&g.set(\"baggage\",m.baggage))}return a(f,$t($t({},p),{},{headers:g}))}},o4=!1,s4=!1;function Nse(t,e,n){let r=NU();if(!r)return o4||(o4=!0,console.warn(\"@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at your application entry point (requires the OpenTelemetry API package to be installed). The CDN/UMD build does not support trace propagation.\")),null;if(!Lse(typeof t==\"string\"||t instanceof URL?t:t.url,e))return null;let o=r();if(!o||!o.traceparent){var s;if(!(o==null||(s=o.carrierKeys)===null||s===void 0)&&s.length&&!s4){s4=!0;let a=o.carrierKeys.includes(\"sentry-trace\")?\" Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.\":\" Configure your tracing SDK to emit W3C trace context on outgoing requests.\";console.warn(`@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its propagator wrote [${o.carrierKeys.join(\", \")}] and no W3C traceparent header, so trace headers will not be attached.`+a)}return null}if(n){let a=Cse(o.traceparent);if(a&&!a.isSampled)return{traceparent:o.traceparent}}return o}function a4(t){return typeof t==\"boolean\"?{enabled:t}:t}function Pse(t){return t.endsWith(\"/\")?t:t+\"/\"}function Bse(t,e){var n,r,o,s,a,i;let{db:l,auth:u,realtime:c,global:d}=t,{db:f,auth:p,realtime:h,global:g}=e,m=a4(t.tracePropagation),y=a4(e.tracePropagation),b={db:$t($t({},f),l),auth:$t($t({},p),u),realtime:$t($t({},h),c),storage:{},global:$t($t($t({},g),d),{},{headers:$t($t({},(n=g?.headers)!==null&&n!==void 0?n:{}),(r=d?.headers)!==null&&r!==void 0?r:{})}),tracePropagation:{enabled:(o=(s=m?.enabled)!==null&&s!==void 0?s:y?.enabled)!==null&&o!==void 0?o:!1,respectSamplingDecision:(a=(i=m?.respectSamplingDecision)!==null&&i!==void 0?i:y?.respectSamplingDecision)!==null&&a!==void 0?a:!0},accessToken:async()=>\"\"};return t.accessToken?b.accessToken=t.accessToken:delete b.accessToken,b}function zse(t){let e=t?.trim();if(!e)throw new Error(\"supabaseUrl is required.\");if(!e.match(/^https?:\\/\\//i))throw new Error(\"Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.\");try{return new URL(Pse(e))}catch{throw Error(\"Invalid supabaseUrl: Provided URL is malformed.\")}}var Fse=class extends dT{constructor(t){super(t)}},Hse=class{constructor(t,e,n){var r,o;this.supabaseUrl=t,this.supabaseKey=e;let s=zse(t);if(!e)throw new Error(\"supabaseKey is required.\");Dse(e),this.realtimeUrl=new URL(\"realtime/v1\",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(\"http\",\"ws\"),this.authUrl=new URL(\"auth/v1\",s),this.storageUrl=new URL(\"storage/v1\",s),this.functionsUrl=new URL(\"functions/v1\",s);let a=`sb-${s.hostname.split(\".\")[0]}-auth-token`,i={db:xse,realtime:Sse,auth:$t($t({},wse),{},{storageKey:a}),global:vse,tracePropagation:kse},l=Bse(n??{},i);if(this.settings=l,this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:\"\",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(c,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=r4(e,t,this._getSessionToken.bind(this),l.global.fetch,l.tracePropagation),this.functionsFetch=r4(e,t,this._getSessionToken.bind(this),l.global.fetch,l.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient($t({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(c=>this.realtime.setAuth(c)).catch(c=>console.warn(\"Failed to set initial Realtime auth token:\",c)),this.rest=new jU(new URL(\"rest/v1\",s).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit,retry:l.db.retry}),this.storage=new gj(this.storageUrl.href,this.headers,this.fetch,n?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new Ng(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,n)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var t=this,e,n;if(t.accessToken)return await t.accessToken();let{data:r}=await t.auth.getSession();return(e=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&e!==void 0?e:null}async _getAccessToken(){var t=this,e;return(e=await t._getSessionToken())!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:o,storageKey:s,flowType:a,lock:i,debug:l,throwOnError:u,experimental:c,lockAcquireTimeout:d,skipAutoInitialize:f},p,h){let g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Fse({url:this.authUrl.href,headers:$t($t({},g),p),storageKey:s,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:o,flowType:a,lock:i,debug:l,throwOnError:u,experimental:c,fetch:h,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()===\"authorization\")})}_initRealtimeClient(t){return new Qf(this.realtimeUrl.href,$t($t({},t),{},{params:$t($t({},{apikey:this.supabaseKey}),t?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,\"CLIENT\",e?.access_token)})}_handleTokenChanged(t,e,n){(t===\"TOKEN_REFRESHED\"||t===\"SIGNED_IN\"||t===\"INITIAL_SESSION\")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t===\"SIGNED_OUT\"&&(this.realtime.setAuth(),e==\"STORAGE\"&&this.auth.signOut(),this.changedAccessToken=void 0)}},Zw=(t,e,n)=>new Hse(t,e,n);function $se(){if(typeof window<\"u\"||globalThis.Deno!==void 0)return!1;let t=globalThis.process;if(!t)return!1;let e=t.version;if(e==null)return!1;let n=e.match(/^v(\\d+)\\./);return n?parseInt(n[1],10)<=20:!1}$se()&&console.warn(\"\\u26A0\\uFE0F Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715\");function Use(t,e){let r=new URLSearchParams(t.replace(/^#/,\"\")).get(\"type\")??new URLSearchParams(e).get(\"type\");return r===\"invite\"||r===\"recovery\"?r:null}function u4(t){let e=typeof window<\"u\",[n,r]=(0,gl.useState)(()=>e?Use(window.location.hash,window.location.search):null),[o]=(0,gl.useState)(()=>Zw(t.url,t.key,{auth:{autoRefreshToken:e,persistSession:e,detectSessionInUrl:e,storageKey:\"smoodly-auth\"}})),[s,a]=(0,gl.useState)({status:\"loading\"}),i=(0,gl.useRef)(null);return(0,gl.useEffect)(()=>{let l=!0,u=d=>{i.current=d,a(d?{status:\"signed_in\",session:d}:{status:\"signed_out\"})};o.auth.getSession().then(({data:d})=>{l&&u(d.session)}).catch(()=>{l&&u(null)});let{data:c}=o.auth.onAuthStateChange((d,f)=>{d===\"PASSWORD_RECOVERY\"&&r(\"recovery\"),u(f)});return()=>{l=!1,c.subscription.unsubscribe()}},[o]),{client:o,state:s,token:()=>i.current?.access_token??null,arrival:n,clearArrival:()=>r(null)}}var Wa=T(te(),1);var Ve=T(O(),1),ly={size:18,strokeWidth:2,\"aria-hidden\":!0};function jse(){return(0,Ve.jsxs)(\"svg\",{className:\"sm-rail__logo\",viewBox:\"0 0 28 27\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",role:\"img\",\"aria-label\":\"Smoodly\",children:[(0,Ve.jsx)(\"path\",{style:{fill:\"var(--logo-outer)\"},d:\"M0 16.1859C0 7.6335 7.88106 0 16.5324 0H16.6037C23.429 0 28 4.59428 28 10.8141C28 19.3666 20.2618 27 11.3279 27C4.43425 27 0 22.2645 0 16.1859Z\"}),(0,Ve.jsx)(\"path\",{style:{fill:\"var(--logo-inner)\"},d:\"M7 14.7932C7 10.6754 10.6591 7 14.6757 7H14.7089C17.8777 7 20 9.21206 20 12.2068C20 16.3247 16.4072 20 12.2594 20C9.05876 20 7 17.7199 7 14.7932Z\"})]})}function c4({registry:t,active:e,email:n,settings:r=!0,onSignOut:o}){let s=Qe(),a=(0,Wa.useRef)(null),i=(0,Wa.useId)(),[l,u]=(0,Wa.useState)(null),[c,d]=(0,Wa.useState)(!1),f=w=>`sm-rail-menu${i}${w}`,p=w=>u(k=>k===w?null:w),h=()=>u(null),g=()=>d(!1);(0,Wa.useEffect)(()=>{if(!l||!a.current)return;c||a.current.querySelector(`#${CSS.escape(f(l))} [role=menuitem]`)?.focus();let w=k=>{if(!(k.target instanceof Node))return;let A=a.current?.querySelector(`#${CSS.escape(f(l))}`),L=a.current?.querySelector(`[aria-controls=\"${f(l)}\"]`);A?.contains(k.target)||L?.contains(k.target)||h()};return document.addEventListener(\"pointerdown\",w),()=>document.removeEventListener(\"pointerdown\",w)},[l]);let m=w=>{if(!(!l||!a.current)){if(w.key===\"Escape\")h(),a.current.querySelector(`[aria-controls=\"${f(l)}\"]`)?.focus();else if(w.key===\"ArrowDown\"||w.key===\"ArrowUp\"){let k=Array.from(a.current.querySelectorAll(`#${CSS.escape(f(l))} [role=menuitem]`));if(!k.length)return;w.preventDefault();let A=k.indexOf(document.activeElement);k[(A+(w.key===\"ArrowDown\"?1:-1)+k.length)%k.length].focus()}}},y=(w,k,A,L)=>(0,Ve.jsx)(\"li\",{className:\"sm-rail__item\",children:(0,Ve.jsxs)(qn,{className:\"sm-rail__btn\",href:L,\"aria-current\":w===e?\"page\":void 0,onClick:h,children:[(0,Ve.jsx)(\"span\",{className:\"sm-rail__tile\",children:A}),(0,Ve.jsx)(\"span\",{className:\"sm-rail__label\",children:k})]})}),b=t.collections,x=b.some(w=>w.name===e),v=l===\"collections\"||c&&l===null,S=n?.split(\"@\")[0]??\"Editor\",E=S.slice(0,2).toUpperCase();return(0,Ve.jsxs)(\"nav\",{className:\"sm-rail\",\"aria-label\":\"Primary\",ref:a,onKeyDown:m,children:[(0,Ve.jsx)(jse,{}),(0,Ve.jsxs)(\"ul\",{className:\"sm-rail__list\",children:[y(\"pages\",\"Pages\",(0,Ve.jsx)(qh,{...ly}),s(\"/pages\")),b.length>0&&(0,Ve.jsxs)(\"li\",{className:\"sm-rail__item\",onMouseEnter:()=>d(!0),onMouseLeave:g,children:[(0,Ve.jsxs)(\"button\",{type:\"button\",className:\"sm-rail__btn\",\"aria-current\":x?\"page\":void 0,\"aria-haspopup\":\"menu\",\"aria-expanded\":v,\"aria-controls\":f(\"collections\"),onClick:()=>p(\"collections\"),children:[(0,Ve.jsx)(\"span\",{className:\"sm-rail__tile\",children:(0,Ve.jsx)(zh,{...ly})}),(0,Ve.jsx)(\"span\",{className:\"sm-rail__label\",children:\"Collections\"})]}),(0,Ve.jsx)(\"ul\",{className:\"sm-rail__menu sm-rail__menu--collections\",role:\"menu\",id:f(\"collections\"),\"data-open\":v,children:b.map(w=>(0,Ve.jsx)(\"li\",{role:\"none\",children:(0,Ve.jsx)(qn,{role:\"menuitem\",className:\"sm-rail__menu-item\",href:s(`/${w.name}`),\"aria-current\":w.name===e?\"page\":void 0,onClick:()=>{h(),g()},children:(0,Ve.jsx)(\"span\",{children:w.title})})},w.name))})]}),y(\"media\",\"Media\",(0,Ve.jsx)(Ph,{...ly}),s(\"/media\")),t.globals.length>0&&y(\"globals\",\"Site\",(0,Ve.jsx)(Th,{...ly}),s(\"/globals\")),r&&y(\"settings\",\"Settings\",(0,Ve.jsx)(Gh,{...ly}),s(\"/settings\"))]}),(0,Ve.jsxs)(\"div\",{className:\"sm-rail__item sm-rail__foot\",children:[(0,Ve.jsx)(\"button\",{type:\"button\",className:\"sm-rail__user\",title:S,\"aria-haspopup\":\"menu\",\"aria-expanded\":l===\"user\",\"aria-controls\":f(\"user\"),onClick:()=>p(\"user\"),children:E}),(0,Ve.jsxs)(\"ul\",{className:\"sm-rail__menu sm-rail__menu--up\",role:\"menu\",id:f(\"user\"),\"data-open\":l===\"user\",children:[(0,Ve.jsx)(\"li\",{className:\"sm-rail__menu-title\",role:\"presentation\",children:S}),(0,Ve.jsx)(\"li\",{role:\"none\",children:(0,Ve.jsx)(zO,{})}),(0,Ve.jsx)(\"li\",{role:\"none\",children:(0,Ve.jsx)(\"button\",{type:\"button\",role:\"menuitem\",className:\"sm-rail__menu-item\",onClick:()=>{h(),o()},children:\"Sign out\"})})]})]})]})}var op=T(te(),1);var Qn=T(O(),1);function qse({options:t,onAnswer:e}){let{title:n,body:r,confirmLabel:o,cancelLabel:s=\"Cancel\",destructive:a=!1,subject:i,option:l,single:u=!1}=t,[c,d]=(0,op.useState)(l?.checked??!1),p=`sm-confirm-body${(0,op.useId)()}`,h=()=>e(!1);return(0,Qn.jsxs)(av,{title:n,role:\"alertdialog\",describedBy:r?p:void 0,onClose:h,className:\"sm-confirm\",actions:(0,Qn.jsxs)(Qn.Fragment,{children:[!u&&(0,Qn.jsx)(Q,{variant:\"secondary\",autoFocus:a,onClick:h,children:s}),(0,Qn.jsx)(Q,{variant:a?\"destructive\":\"primary\",autoFocus:!a,onClick:()=>e(!0,c),children:o})]}),children:[r&&(0,Qn.jsx)(\"p\",{className:\"sm-dialog__body\",id:p,children:r}),l&&(0,Qn.jsxs)(\"label\",{className:\"sm-choice sm-confirm__option\",children:[(0,Qn.jsx)(\"input\",{type:\"checkbox\",checked:c,onChange:g=>d(g.target.checked)}),(0,Qn.jsx)(\"span\",{children:l.label})]}),i&&(0,Qn.jsxs)(\"div\",{className:\"sm-dialog__context\",children:[(0,Qn.jsx)(\"strong\",{children:i.name}),i.path&&(0,Qn.jsx)(\"code\",{children:i.path})]})]})}function d4(){let t=(0,op.useSyncExternalStore)(oD,rD,()=>null);return t?(0,Qn.jsx)(qse,{options:t.options,onAnswer:t.answer},t.id):null}var Ir=T(te(),1);var Se=T(O(),1),Vse=[\"title\",\"alt\",\"caption\",\"credit\"];function f4({initialItems:t=[],initialSelected:e=null,initialUsage:n=[]}){let r=Is(),[o,s]=(0,Ir.useState)(t),[a,i]=(0,Ir.useState)(\"\"),[l,u]=(0,Ir.useState)(\"All\"),[c,d]=(0,Ir.useState)(e),[f,p]=(0,Ir.useState)(n),[h,g]=(0,Ir.useState)({title:e?.title??\"\",alt:e?.alt??\"\",caption:e?.caption??\"\",credit:e?.credit??\"\"}),[m,y]=(0,Ir.useState)(!1),[b,x]=(0,Ir.useState)(null),v=(0,Ir.useCallback)(()=>{r.ops.list({kind:Hx(l),search:a||void 0}).then(k=>k.ok?s(k.data.items):x(k.message)).catch(()=>x(\"Couldn't reach the server.\"))},[r,l,a]);(0,Ir.useEffect)(v,[v]),(0,Ir.useEffect)(()=>{c&&(g({title:c.title??\"\",alt:c.alt??\"\",caption:c.caption??\"\",credit:c.credit??\"\"}),e?.id!==c.id&&r.ops.usage(c.id).then(k=>p(k.ok?k.data:[])).catch(()=>p([])))},[c,r,e]);let S=async k=>{if(!c)return;let A=h[k].trim()||null;if((c[k]??null)===A)return;let L=await r.ops.update(c.id,{[k]:A});if(!L.ok){x(L.message);return}r.remember(L.data),d(L.data),s(_=>_.map(P=>P.id===L.data.id?L.data:P))},E=async k=>{let A=k?.[0];if(!A)return;y(!0),x(null);let L=await Tu(r.ops,A,r.upload);if(y(!1),!L.ok){x(L.message);return}r.remember(L.data),d(L.data),v()},w=async()=>{if(!c||!await rt({title:\"Delete this file?\",body:\"The file is removed from the media library and from storage. This cannot be undone.\",confirmLabel:\"Delete file\",destructive:!0,subject:{name:c.title??c.filename}}))return;let A=await r.ops.delete(c.id);if(!A.ok){x(A.message);return}d(null),v()};return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(ko,{left:(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(\"span\",{className:\"sm-title\",children:\"Media\"}),(0,Se.jsx)(\"span\",{className:\"sm-count\",children:o.length})]}),right:(0,Se.jsxs)(\"div\",{className:\"sm-picker-bar\",children:[(0,Se.jsx)(\"input\",{className:\"sm-input\",placeholder:\"Search media\",value:a,onChange:k=>i(k.target.value),style:{width:220}}),(0,Se.jsx)(ba,{options:Fx,value:l,onChange:u}),(0,Se.jsxs)(\"label\",{className:\"sm-btn sm-btn--primary\",children:[m?\"Uploading\\u2026\":\"Upload\",(0,Se.jsx)(\"input\",{type:\"file\",accept:nf([\"image\",\"video\",\"file\"],r.media.accept),hidden:!0,disabled:m,onChange:k=>{E(k.target.files)}})]})]})}),b&&(0,Se.jsx)(Me,{tone:\"error\",onDismiss:()=>x(null),children:b}),(0,Se.jsxs)(\"div\",{className:\"sm-mediascreen\",style:c?void 0:{gridTemplateColumns:\"1fr\"},children:[(0,Se.jsx)(\"div\",{className:\"sm-mediascreen__grid\",children:(0,Se.jsx)($x,{items:o,selectedId:c?.id,onSelect:k=>d(k.id===c?.id?null:k)})}),c&&(0,Se.jsxs)(\"aside\",{className:\"sm-mediascreen__inspector\",children:[(0,Se.jsx)(\"div\",{className:\"sm-media__thumb\",style:{aspectRatio:c.width&&c.height?`${c.width} / ${c.height}`:\"4 / 3\"},children:c.kind===\"image\"&&(0,Se.jsx)(\"img\",{src:c.url,alt:\"\",style:{left:0,top:0,width:\"100%\",height:\"100%\"}})}),Vse.map(k=>(0,Se.jsx)(xe,{label:k===\"alt\"?\"Alt text\":k[0].toUpperCase()+k.slice(1),children:(0,Se.jsx)(\"input\",{className:\"sm-input\",value:h[k],onChange:A=>g(L=>({...L,[k]:A.target.value})),onBlur:()=>{S(k)}})},k)),(0,Se.jsxs)(\"div\",{className:\"sm-facts\",children:[(0,Se.jsx)(\"span\",{children:\"File\"}),(0,Se.jsx)(\"span\",{children:c.filename}),(0,Se.jsx)(\"span\",{children:\"Type\"}),(0,Se.jsx)(\"span\",{children:c.mime}),(0,Se.jsx)(\"span\",{children:\"Size\"}),(0,Se.jsx)(\"span\",{children:tf(c.size)}),c.width&&c.height&&(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(\"span\",{children:\"Dimensions\"}),(0,Se.jsxs)(\"span\",{children:[c.width,\"\\xD7\",c.height]})]}),c.duration!==null&&(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(\"span\",{children:\"Duration\"}),(0,Se.jsxs)(\"span\",{children:[Math.round(c.duration),\" s\"]})]})]}),(0,Se.jsxs)(\"div\",{className:\"sm-usage\",children:[(0,Se.jsx)(\"span\",{className:\"sm-label\",children:nz(f.length)}),f.map((k,A)=>k.href?(0,Se.jsxs)(qn,{href:k.href,children:[k.title,\" \\xB7 \",k.sourceField]},`${k.sourceId}-${A}`):(0,Se.jsxs)(\"span\",{children:[k.title,\" \\xB7 \",k.sourceField]},`${k.sourceId}-${A}`))]}),(0,Se.jsx)(Q,{variant:\"secondary\",disabled:f.length>0,title:f.length>0?\"Remove it from those places first.\":void 0,onClick:()=>{w()},children:\"Delete\"})]})]})]})}var _4=T(te(),1);var sp=T(te(),1);var fT=10,Kse=(t,e)=>t.kind===\"page\"?\"Page\":t.kind===\"global\"?\"Site\":e.collections.find(n=>n.name===t.collection)?.title??t.collection??\"\",Gse=(t,e)=>{let n=`?locale=${encodeURIComponent(e)}`;return t.kind===\"page\"?`/pages/${encodeURIComponent(t.id)}${n}`:t.kind===\"global\"?`/globals/${encodeURIComponent(t.collection??\"\")}${n}`:`/${t.collection}/${encodeURIComponent(t.id)}${n}`};function p4(t,e){let n=new Map;for(let s of t.documents)for(let a of s.findings){let i=KD(a),l=n.get(i);l||n.set(i,l={severity:kL[a.kind],headline:B3(a,e),rows:new Map});let u=`${s.kind}:${s.id}`,c=l.rows.get(u);c?(c.locales.includes(a.locale)||c.locales.push(a.locale),c.draft||(c.draft=a.draft),c.live||(c.live=a.live)):l.rows.set(u,{key:u,title:s.title,kind:Kse(s,e),locales:[a.locale],draft:a.draft,live:a.live,href:Gse(s,a.locale)})}let r=e.locales.supported,o=s=>[...n].filter(([,a])=>a.severity===s).map(([a,i])=>({key:a,headline:i.headline,rows:[...i.rows.values()].map(l=>({...l,locales:[...l.locales].sort((u,c)=>r.indexOf(u)-r.indexOf(c))}))})).sort((a,i)=>i.rows.length-a.rows.length||a.headline.localeCompare(i.headline));return{broken:o(\"broken\"),orphan:o(\"orphan\"),collections:t.collections.map(({name:s,count:a})=>({name:s,headline:`Collection \\`${s}\\` no longer registered \\xB7 ${a} ${a===1?\"entry\":\"entries\"}. Register it again or delete its ${a} ${a===1?\"entry\":\"entries\"}.`}))}}var Be=T(O(),1);function m4({ops:t,registry:e,initial:n=null}){let[r,o]=(0,sp.useState)(n),[s,a]=(0,sp.useState)(null),i=()=>{a(null),o(null),t.health.scan().then(c=>c.ok?o(c.data):a(c.message)).catch(()=>a(\"Couldn't reach the server.\"))};if((0,sp.useEffect)(()=>{n||i()},[t,n]),s)return(0,Be.jsx)(an,{message:s,back:!1,onRetry:i});let l=r?p4(r,e):null,u=l?l.broken.length+l.collections.length:0;return(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)(ko,{left:(0,Be.jsx)(\"span\",{className:\"sm-title\",children:\"Content health\"}),right:(0,Be.jsxs)(Be.Fragment,{children:[r&&(0,Be.jsx)(\"span\",{className:\"sm-hint\",children:\"Checked just now\"}),(0,Be.jsx)(Q,{variant:\"secondary\",onClick:i,disabled:!r,children:\"Rescan\"})]})}),(0,Be.jsx)(\"div\",{className:\"sm-listwrap\",children:(0,Be.jsxs)(\"div\",{className:\"sm-table sm-health\",children:[!l&&(0,Be.jsx)(\"div\",{className:\"sm-empty\",children:\"Checking content\\u2026\"}),l&&u===0&&l.orphan.length===0&&(0,Be.jsx)(\"div\",{className:\"sm-empty\",children:\"Everything matches the code.\"}),l&&u>0&&(0,Be.jsxs)(\"section\",{children:[(0,Be.jsxs)(\"h2\",{className:\"sm-health__section\",children:[\"Blocks publishing \\xB7 \",u]}),l.collections.map(c=>(0,Be.jsx)(\"p\",{className:\"sm-health__headline\",children:c.headline},c.name)),l.broken.map(c=>(0,Be.jsx)(h4,{group:c},c.key))]}),l&&l.orphan.length>0&&(0,Be.jsxs)(\"section\",{children:[(0,Be.jsxs)(\"h2\",{className:\"sm-health__section\",children:[\"Left over \\xB7 \",l.orphan.length]}),l.orphan.map(c=>(0,Be.jsx)(h4,{group:c},c.key))]})]})})]})}function h4({group:t}){let e=Qe(),[n,r]=(0,sp.useState)(!1),o=n?t.rows:t.rows.slice(0,fT),s=t.rows.length;return(0,Be.jsxs)(\"div\",{className:\"sm-health__group\",children:[(0,Be.jsxs)(\"div\",{className:\"sm-health__headline\",children:[(0,Be.jsx)(\"span\",{children:t.headline}),(0,Be.jsxs)(\"span\",{className:\"sm-hint\",children:[s,\" \",s===1?\"document\":\"documents\"]})]}),o.map(a=>(0,Be.jsxs)(\"div\",{className:\"sm-row sm-health__row\",children:[(0,Be.jsx)(\"span\",{className:\"sm-cell\",children:a.title}),(0,Be.jsx)(\"span\",{className:\"sm-cell sm-hint\",children:a.kind}),(0,Be.jsx)(\"span\",{className:\"sm-cell\",children:a.locales.join(\" \")}),(0,Be.jsxs)(\"span\",{className:\"sm-cell\",children:[a.draft&&(0,Be.jsx)(\"span\",{className:\"sm-badge\",style:{background:\"var(--status-draft-bg)\",color:\"var(--status-draft-fg)\"},children:\"Draft\"}),a.live&&(0,Be.jsx)(\"span\",{className:\"sm-badge\",style:{background:\"var(--status-published-bg)\",color:\"var(--status-published-fg)\"},children:\"Live\"})]}),(0,Be.jsx)(\"span\",{className:\"sm-cell\",children:(0,Be.jsx)(qn,{href:e(a.href),children:\"Open \\u2192\"})})]},a.key)),!n&&s>fT&&(0,Be.jsxs)(Q,{variant:\"secondary\",onClick:()=>r(!0),children:[\"Show all \",s]})]})}var cc=T(te(),1);var uy=T(te(),1);var pT=[\"admin\",\"editor\"],Wse={admin:[\"content.write\",\"settings\",\"members.manage\"],editor:[\"content.write\"]};function g4(t,e){return Wse[t].includes(e)}var Xse=t=>typeof t==\"string\"&&pT.includes(t);function hT(t){return t===\"owner\"?\"admin\":Xse(t)?t:\"editor\"}var ap=t=>t?t[0].toUpperCase()+t.slice(1):\"\",Qw={editor:\"Edits, publishes and deletes content and media, and manages redirects.\",admin:\"Everything an editor can, and Settings: invites, re-roles and removes members.\"};function y4(t,e){let n=t.filter(r=>hT(r.role)===\"admin\").length;return t.map(r=>{let o=hT(r.role);return{key:r.userId,email:r.email??r.userId,fallback:r.email===null,role:ap(o),value:o,own:r.userId===e.me,lastAdmin:o===\"admin\"&&n<=1}})}var mT={own:\"You cannot change your own membership.\",lastAdmin:\"This site needs at least one admin.\"};var Hn=T(O(),1);function b4({onClose:t,onInvite:e}){let[n,r]=(0,uy.useState)(\"\"),[o,s]=(0,uy.useState)(\"editor\"),[a,i]=(0,uy.useState)(null),[l,u]=(0,uy.useState)(!1),c=async f=>{f.preventDefault(),u(!0),i(await e({email:n.trim(),role:o})),u(!1)},d=[...pT].reverse();return(0,Hn.jsx)(Rs,{title:\"Invite a member\",width:420,onClose:t,children:(0,Hn.jsxs)(\"form\",{onSubmit:c,style:{display:\"flex\",flexDirection:\"column\",gap:14},children:[(0,Hn.jsx)(xe,{label:\"Email\",children:(0,Hn.jsx)(\"input\",{className:\"sm-input\",type:\"email\",required:!0,autoFocus:!0,value:n,onChange:f=>r(f.target.value)})}),(0,Hn.jsx)(xe,{label:\"Role\",asDiv:!0,children:(0,Hn.jsx)(\"div\",{className:\"sm-choices\",role:\"radiogroup\",children:d.map(f=>(0,Hn.jsxs)(\"label\",{className:\"sm-choice sm-choice--desc\",children:[(0,Hn.jsx)(\"input\",{type:\"radio\",name:\"role\",value:f,checked:o===f,onChange:()=>s(f)}),(0,Hn.jsxs)(\"span\",{children:[(0,Hn.jsx)(\"span\",{className:\"sm-choice__label\",children:ap(f)}),(0,Hn.jsx)(\"span\",{className:\"sm-choice__desc\",children:Qw[f]})]})]},f))})}),a&&(0,Hn.jsx)(Me,{tone:\"error\",children:a}),(0,Hn.jsxs)(\"div\",{style:{display:\"flex\",justifyContent:\"flex-end\",gap:8},children:[(0,Hn.jsx)(Q,{variant:\"secondary\",onClick:t,children:\"Cancel\"}),(0,Hn.jsx)(\"button\",{type:\"submit\",className:\"sm-btn sm-btn--primary\",disabled:l,children:l?\"Sending\\u2026\":\"Send invite\"})]})]})})}var xn=T(O(),1);function v4({ops:t,userId:e,initial:n=null}){let[r,o]=(0,cc.useState)(n),[s,a]=(0,cc.useState)(null),[i,l]=(0,cc.useState)(null),[u,c]=(0,cc.useState)(!1),d=()=>t.members.list().then(b=>b.ok?o(b.data):a(b.message)).catch(()=>a(\"Couldn't reach the server.\"));(0,cc.useEffect)(()=>{n||d()},[t,n]);let f=async b=>{let x=window.location.origin+window.location.pathname.replace(/\\/settings(\\/.*)?$/,\"\"),v=await t.members.invite({...b,redirectTo:x});return v.ok?(c(!1),l({tone:\"ok\",text:v.data.invited?`Invite sent to ${b.email}.`:`${b.email} added \\u2014 they can sign in with their existing account.`}),d(),null):v.message},p=async b=>{let x=b.value===\"admin\"?\"editor\":\"admin\";if(!await rt({title:`Change role to ${ap(x).toLowerCase()}?`,body:`${ap(x)}: ${Qw[x]}`,confirmLabel:\"Change role\",subject:{name:b.email}}))return;let S=await t.members.setRole(b.key,x);if(!S.ok){l({tone:\"error\",text:S.message});return}o(E=>E&&{...E,members:E.members.map(w=>w.userId===b.key?S.data:w)})},h=async b=>{if(!await rt({title:\"Remove this member?\",body:\"They keep their account and lose access to this site's admin. You can invite them again later.\",confirmLabel:\"Remove member\",destructive:!0,subject:{name:b.email}}))return;let v=await t.members.remove(b.key);if(!v.ok){l({tone:\"error\",text:v.message});return}d()};if(s)return(0,xn.jsx)(an,{message:s});let g=!!r?.consoleUrl,m=r?y4(r.members,{me:e}):[],y=b=>b.own?mT.own:b.lastAdmin?mT.lastAdmin:void 0;return(0,xn.jsxs)(xn.Fragment,{children:[(0,xn.jsx)(ys,{title:\"Members\",actions:!g&&r&&(0,xn.jsx)(Q,{onClick:()=>c(!0),children:\"Invite\"}),notice:(0,xn.jsxs)(xn.Fragment,{children:[r?.consoleUrl&&(0,xn.jsxs)(Me,{tone:\"ok\",children:[\"Members are managed at smoodly.io.\",\" \",(0,xn.jsx)(\"a\",{href:r.consoleUrl,target:\"_blank\",rel:\"noreferrer\",children:\"Open the console\"})]}),i&&(0,xn.jsx)(Me,{tone:i.tone,onDismiss:()=>l(null),children:i.text})]}),columns:[{label:\"Email\",width:\"minmax(200px,1fr)\"},{label:\"Role\",width:\"120px\"},...g?[]:[{label:\"\",width:\"48px\"}]],rows:m.map(b=>({key:b.key,cells:[b.fallback?(0,xn.jsx)(\"span\",{style:{color:\"var(--text-muted)\"},children:b.email}):b.email,(0,xn.jsx)(gs,{status:b.role}),...g?[]:[(0,xn.jsx)(\"span\",{title:y(b),children:(0,xn.jsx)(Mf,{label:\"Member actions\",small:!0,disabled:b.own||b.lastAdmin,items:[{label:\"Change role\",run:()=>{p(b)}},{label:\"Remove member\",danger:!0,run:()=>{h(b)}}]})})]]})),empty:\"No members yet\"}),u&&(0,xn.jsx)(b4,{onClose:()=>c(!1),onInvite:f})]})}var yl=T(te(),1);var cy=T(te(),1);var x4=t=>t.split(\"/\").map(EO).join(\"/\"),w4={empty:\"Enter the old address.\",\"leading-slash\":\"Start with a slash: /old-address.\",root:\"The site root cannot redirect.\",\"trailing-slash\":\"Leave out the trailing slash.\",\"double-slash\":\"An address cannot have an empty part.\",whitespace:\"An address cannot contain spaces.\",\"query-or-hash\":\"Leave out the query string and the hash: they are not part of the address.\",admin:\"That is the admin's address.\",extension:\"An address with a file extension never reaches Smoodly on a multilingual site \\u2014 redirect it in next.config instead.\"};function S4(t,e){if(t===\"\")return\"empty\";if(/\\s/.test(t))return\"whitespace\";if(/[?#]/.test(t))return\"query-or-hash\";if(!t.startsWith(\"/\"))return\"leading-slash\";if(t===\"/\")return\"root\";if(t.endsWith(\"/\"))return\"trailing-slash\";if(t.includes(\"//\"))return\"double-slash\";if(t===e.adminPath||t.startsWith(`${e.adminPath}/`))return\"admin\";let n=t.slice(t.lastIndexOf(\"/\")+1);return e.multilingual&&/\\.[A-Za-z0-9]+$/.test(n)?\"extension\":null}var k4=t=>t.map(e=>({value:`${e.target.kind}:${e.target.id}`,label:`${e.title} \\xB7 ${e.path}`}));function C4(t){let e=/^(page|entry):(.+)$/.exec(t);return e?{kind:e[1],id:e[2]}:null}var L4=(t,e)=>t.target.kind===\"page\"?`/pages/${encodeURIComponent(t.target.id)}?locale=${encodeURIComponent(e)}`:`/${t.collection}/${encodeURIComponent(t.target.id)}?locale=${encodeURIComponent(e)}`,A4={title:\"Remove this redirect?\",body:\"Visitors who open the old address get a Not found page. Browsers that already followed the redirect may keep going to the new address for a while.\",confirmLabel:\"Remove redirect\",destructive:!0};var Fo=T(O(),1);function E4({locale:t,registry:e,targets:n,onClose:r,onAdd:o}){let[s,a]=(0,cy.useState)(\"\"),[i,l]=(0,cy.useState)(null),[u,c]=(0,cy.useState)(null),[d,f]=(0,cy.useState)(!1),p=S4(x4(s),{adminPath:e.adminPath,multilingual:e.locales.supported.length>1}),h=i?n.find(m=>m.target.kind===i.kind&&m.target.id===i.id):void 0;return(0,Fo.jsx)(Rs,{title:\"Add redirect\",width:480,onClose:r,children:(0,Fo.jsxs)(\"form\",{onSubmit:async m=>{m.preventDefault(),!(!i||p)&&(f(!0),c(await o(s,i)),f(!1))},style:{display:\"flex\",flexDirection:\"column\",gap:14},children:[(0,Fo.jsx)(xe,{label:\"Old address\",error:s!==\"\"&&p?w4[p]:void 0,children:(0,Fo.jsx)(\"input\",{className:\"sm-input sm-input--mono\",autoFocus:!0,placeholder:\"/old-address\",value:s,onChange:m=>a(m.target.value)})}),(0,Fo.jsx)(xe,{label:\"Redirects to\",asDiv:!0,hint:`A page or entry that is live in ${t}.`,children:(0,Fo.jsx)(Af,{label:\"Redirects to\",options:k4(n),placeholder:\"Type a title or an address\",emptyText:`Nothing is live in ${t} yet.`,selected:h?`${h.title} \\xB7 ${h.path}`:void 0,onPick:m=>l(C4(m))})}),u&&(0,Fo.jsx)(Me,{tone:\"error\",children:u}),(0,Fo.jsxs)(\"div\",{style:{display:\"flex\",justifyContent:\"flex-end\",gap:8},children:[(0,Fo.jsx)(Q,{variant:\"secondary\",onClick:r,children:\"Cancel\"}),(0,Fo.jsx)(\"button\",{type:\"submit\",className:\"sm-btn sm-btn--primary\",disabled:d||!i||s===\"\"||p!==null,children:d?\"Saving\\u2026\":\"Save redirect\"})]})]})})}var $n=T(O(),1);function T4({ops:t,registry:e,initial:n=null}){let r=Qe(),o=e.locales.supported.length>1,[s,a]=(0,yl.useState)(n?.locale??xs(e.locales)),[i,l]=(0,yl.useState)(n?.items??null),[u,c]=(0,yl.useState)(null),[d,f]=(0,yl.useState)(null),[p,h]=(0,yl.useState)(null),g=v=>t.redirects.list(v).then(S=>S.ok?l(S.data):c(S.message)).catch(()=>c(\"Couldn't reach the server.\"));(0,yl.useEffect)(()=>{n||g(s)},[t,s,n]);let m=v=>{Vo(v),a(v),l(null)},y=async()=>{let v=await t.redirects.targets(s);if(!v.ok){f({tone:\"error\",text:v.message});return}h(v.data)},b=async(v,S)=>{let E=await t.redirects.add(s,v,S);return E.ok?(h(null),f({tone:\"ok\",text:`${v} now redirects.`}),g(s),null):E.message},x=async v=>{if(!await rt({...A4,subject:{name:v.title,path:v.path}}))return;let S=await t.redirects.remove(s,v.path);if(!S.ok){f({tone:\"error\",text:S.message});return}f(null),g(s)};return u?(0,$n.jsx)(an,{message:u}):(0,$n.jsxs)($n.Fragment,{children:[(0,$n.jsx)(ys,{title:\"Redirects\",titleTrailing:o&&(0,$n.jsx)(Ti,{locales:e.locales.supported,value:s,onChange:m}),actions:(0,$n.jsx)(Q,{onClick:()=>{y()},children:\"Add redirect\"}),notice:d&&(0,$n.jsx)(Me,{tone:d.tone,onDismiss:()=>f(null),children:d.text}),columns:[{label:\"Old address\",width:\"minmax(200px,1fr)\"},{label:\"Redirects to\",width:\"minmax(200px,1fr)\"},{label:\"\",width:\"48px\"}],rows:(i??[]).map(v=>({key:v.path,cells:[(0,$n.jsx)(\"code\",{children:v.path}),(0,$n.jsxs)(\"span\",{style:{display:\"flex\",gap:8,alignItems:\"baseline\",minWidth:0},children:[(0,$n.jsx)(qn,{href:r(L4(v,s)),children:v.title}),v.currentPath?(0,$n.jsx)(\"code\",{children:v.currentPath}):(0,$n.jsxs)(\"span\",{className:\"sm-hint\",children:[\"not published in \",s]})]}),(0,$n.jsx)(Mf,{label:\"Redirect actions\",small:!0,items:[{label:\"Remove redirect\",danger:!0,run:()=>{x(v)}}]})]})),empty:i===null?\"Loading\\u2026\":`No redirects in ${s}`}),p&&(0,$n.jsx)(E4,{locale:s,registry:e,targets:p,onClose:()=>h(null),onAdd:b})]})}var R4=[{id:\"members\",title:\"Members\",capability:\"settings\"},{id:\"redirects\",title:\"Redirects\",capability:\"content.write\"},{id:\"health\",title:\"Content health\",capability:\"content.write\"}],gT=t=>R4.filter(e=>g4(t,e.capability)),I4=t=>gT(t)[0].id;function M4(t){return R4.some(e=>e.id===t)?t:null}var io=T(O(),1);function O4({ops:t,registry:e,tail:n,role:r,userId:o}){let s=Qe(),a=M4(n);if((0,_4.useEffect)(()=>{n===void 0&&r!==null&&sr(s(`/settings/${I4(r)}`),{replace:!0})},[n,r,s]),r===null)return(0,io.jsx)(\"div\",{className:\"sm-empty\",children:\"Loading\\u2026\"});let i=gT(r);return n===void 0?(0,io.jsx)(\"div\",{className:\"sm-empty\",children:\"Loading\\u2026\"}):a?i.some(l=>l.id===a)?(0,io.jsxs)(\"div\",{className:\"sm-settings\",children:[(0,io.jsx)(\"nav\",{className:\"sm-settings__nav\",\"aria-label\":\"Settings\",children:i.map(l=>(0,io.jsx)(qn,{className:\"sm-settings__link\",href:s(`/settings/${l.id}`),\"aria-current\":l.id===a?\"page\":void 0,children:l.title},l.id))}),(0,io.jsx)(\"section\",{className:\"sm-settings__page\",children:a===\"members\"?(0,io.jsx)(v4,{ops:t,userId:o}):a===\"redirects\"?(0,io.jsx)(T4,{ops:t,registry:e}):(0,io.jsx)(m4,{ops:t,registry:e})})]}):(0,io.jsx)(an,{message:\"Settings are for admins.\"}):(0,io.jsx)(an,{message:\"Not found.\"})}var Mr=T(O(),1);function D4({status:t}){return(0,Mr.jsx)(\"div\",{style:{height:\"100vh\",display:\"grid\",placeItems:\"center\",padding:24,color:\"var(--text)\"},children:(0,Mr.jsxs)(\"div\",{style:{maxWidth:520,display:\"grid\",gap:12},children:[(0,Mr.jsx)(\"h1\",{className:\"sm-title\",style:{fontSize:22,margin:0},children:\"The database needs an update\"}),(0,Mr.jsxs)(\"p\",{style:{margin:0},children:[\"The database schema is at version \",t.database??\"none\",\". This version of Smoodly needs version \",t.required,\".\"]}),(0,Mr.jsx)(\"p\",{style:{margin:0},children:\"From the site's folder:\"}),(0,Mr.jsx)(\"pre\",{className:\"sm-code\",children:(0,Mr.jsx)(\"code\",{children:\"npx smoodly migrate\"})}),(0,Mr.jsx)(\"p\",{style:{margin:0},children:\"then apply it:\"}),(0,Mr.jsx)(\"pre\",{className:\"sm-code\",children:(0,Mr.jsx)(\"code\",{children:\"supabase db push\"})}),(0,Mr.jsxs)(\"p\",{style:{margin:0,color:\"var(--text-muted)\"},children:[\"That is for a hosted project; for the local stack run \",(0,Mr.jsx)(\"code\",{children:\"supabase migration up\"}),\", which keeps the content. Reload this page afterwards.\"]})]})})}var N4=(t,e=9)=>t===null||t<e;function P4(t,e,n){let r=n,o=Zw(t.url,t.key,{accessToken:async()=>r}),s=o.realtime.setAuth(n).catch(()=>{}),a=o.channel(`space:${t.spaceId}`,{config:{private:!0,presence:{key:e}}});return{subscribe:i=>{s.then(()=>{a.subscribe(l=>i(l))})},setAuth:i=>(r=i,o.realtime.setAuth(i)),track:i=>a.track(i),untrack:()=>a.untrack(),send:i=>a.send(i),onSync:i=>{a.on(\"presence\",{event:\"sync\"},i)},presenceState:()=>a.presenceState(),onBroadcast:(i,l)=>{a.on(\"broadcast\",{event:i},u=>l(u.payload))},unsubscribe:async()=>{await a.unsubscribe(),await o.removeAllChannels()}}}var yt=T(O(),1);function B4({registry:t,op:e,auth:n,presenceConfig:r}){let o=u4(n),[s]=(0,as.useState)(()=>vO(e,o.token,()=>{o.client.auth.signOut({scope:\"local\"})})),a=_O(t.adminPath),[i=\"pages\",l]=a.segments.length?a.segments:[\"pages\"],u=t.collections.some(L=>L.name===i),c=o.state.status===\"signed_in\"?o.state.session.user.email:void 0,d=o.state.status===\"signed_in\",[f,p]=(0,as.useState)(null);(0,as.useEffect)(()=>{if(!d){p(null);return}let L=!0;return s.members.me().then(_=>{L&&p(_.ok?_.data.role:\"editor\")}).catch(()=>{L&&p(\"editor\")}),()=>{L=!1}},[d,s]);let[h,g]=(0,as.useState)(null);(0,as.useEffect)(()=>{if(!d){g(null);return}let L=!0;return s.schema.status().then(_=>{L&&_.ok&&g(_.data)}).catch(()=>{}),()=>{L=!1}},[d,s]);let m=o.state.status===\"signed_in\"?o.state.session.user.id:\"\",[y,b]=(0,as.useState)(null),x=(0,as.useRef)(o.token);x.current=o.token;let v=o.client,S=r?.url,E=r?.key,w=r?.spaceId;if((0,as.useEffect)(()=>{if(!d||!S||!E||!w||!c){b(null);return}let L={url:S,key:E,spaceId:w},_=dD({email:c,connect:()=>{let D=x.current();if(!D)throw new Error(\"smoodly: no session token for presence\");return P4(L,c,D)}});_.join(),b(_);let P=fD(v.auth,_);return()=>{P(),_.dispose(),b(null)}},[d,S,E,w,c,v]),o.state.status===\"loading\")return(0,yt.jsx)(\"div\",{style:{height:\"100vh\",display:\"grid\",placeItems:\"center\",color:\"var(--text-muted)\"},children:\"Loading\\u2026\"});let k=IO(a.pathname,t.adminPath);if(k)return(0,yt.jsx)(\"div\",{style:{height:\"100vh\",display:\"flex\"},children:(0,yt.jsx)(an,{message:k,back:!1})});if(o.state.status===\"signed_out\")return(0,yt.jsx)(OU,{client:o.client,providers:n.providers});if(o.arrival)return(0,yt.jsx)(DU,{client:o.client,mode:o.arrival,onDone:o.clearArrival});if(h&&N4(h.database,h.required))return(0,yt.jsx)(D4,{status:h});let A;return i===\"pages\"&&!l?A=(0,yt.jsx)(pD,{ops:s,registry:t}):i===\"pages\"&&l?A=(0,yt.jsx)(_U,{ops:s,registry:t,id:decodeURIComponent(l)}):u&&!l?A=(0,yt.jsx)(yD,{ops:s,registry:t,collection:i}):u&&l?A=(0,yt.jsx)(j3,{ops:s,registry:t,collection:i,id:decodeURIComponent(l)}):i===\"globals\"&&!l?A=(0,yt.jsx)(V3,{ops:s,registry:t}):i===\"globals\"&&l?A=(0,yt.jsx)(G3,{ops:s,registry:t,name:decodeURIComponent(l)}):i===\"settings\"?A=(0,yt.jsx)(O4,{ops:s,registry:t,tail:l,role:f,userId:m}):i===\"media\"?A=(0,yt.jsx)(f4,{}):A=(0,yt.jsx)(an,{message:\"Not found.\"}),(0,yt.jsx)(eD,{value:t.adminPath,children:(0,yt.jsx)(uD,{value:y,children:(0,yt.jsx)(B$,{elements:t.elements,children:(0,yt.jsx)(x3,{zone:t.timeZone,children:(0,yt.jsxs)(ez,{ops:s,media:t.media,children:[(0,yt.jsxs)(\"div\",{className:\"sm-shell\",children:[(0,yt.jsx)(c4,{registry:t,active:i,email:c,settings:f!==null,onSignOut:()=>o.client.auth.signOut()}),(0,yt.jsx)(\"main\",{className:\"sm-main\",children:A},`${i}/${l??\"\"}`)]}),(0,yt.jsx)(d4,{})]})})})})})}var Jse=[{file:\"public-sans-latin.woff2\",source:\"public-sans-latin-wght-normal.woff2\",range:\"U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD\"},{file:\"public-sans-latin-ext.woff2\",source:\"public-sans-latin-ext-wght-normal.woff2\",range:\"U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF\"}];function z4(t){return Jse.map(e=>`@font-face{font-family:'Public Sans';font-style:normal;font-display:swap;font-weight:100 900;src:url(${t}/${e.file}) format('woff2');unicode-range:${e.range}}`).join(`\n`)}function Yse(t){let e=t.length;for(;e>0&&t[e-1]===void 0;)e--;let n=t.slice(0,e);if(n.some(r=>r===void 0))throw new Error(\"smoodly: an operation argument is undefined between two others \\u2014 pass null or a value; JSON cannot carry undefined.\");return n}var F4=t=>({ok:!1,code:\"internal\",message:`smoodly: the admin's endpoint answered ${t} without a result \\u2014 see the server log.`});function H4(t,e=fetch){let n=async o=>{let s=await e(t,{method:\"POST\",credentials:\"same-origin\",headers:{\"content-type\":\"application/json\",...o.token?{authorization:`Bearer ${o.token}`}:{}},body:JSON.stringify({path:o.path,args:Yse(o.args)})}),a;try{a=await s.json()}catch{return F4(s.status)}return typeof a==\"object\"&&a!==null&&typeof a.ok==\"boolean\"?a:F4(s.status)},r=Promise.resolve();return o=>{let s=r.then(()=>n(o));return r=s.catch(()=>{}),s}}var U4=T(O(),1),ip=JSON.parse(document.getElementById(mO).textContent??\"\");bO(ip.previewBase??\"\");var yT=document.createElement(\"style\");yT.setAttribute(\"data-smoodly-admin-styles\",\"\");yT.textContent=`${z4(ip.filesBase)}\n${ev}`;document.head.appendChild(yT);document.querySelector(\"style[data-smoodly-boot]\")?.remove();(0,$4.createRoot)(document.getElementById(gO)).render((0,U4.jsx)(B4,{registry:ip.registry,op:H4(ip.opUrl),auth:ip.auth,presenceConfig:ip.presence??void 0}));\n"},"bridge.js":{"type":"text/javascript; charset=utf-8","body":"function w(r,i){if(r.source!==i.parent||r.origin!==i.location.origin)return null;let t=r.data;return typeof t==\"object\"&&t?.source===\"smoodly\"&&t.kind===\"refresh\"?{source:\"smoodly\",kind:\"refresh\"}:null}var l=\"data-smd-node\",f=\"data-smd-zone\";var m=\"data-smd-blank\",$=`html{overflow:hidden}[${l}][${m}]{min-height:7rem}`,p=\"data-smd-field\",D=\"data-smd-item\",B=\"data-smd-editor\";function T(r){let i=r.getAttribute(p);if(!i)return null;let t=[i];for(let o=r;o;o=o.parentElement){let s=o.getAttribute(l);if(s)return{node:s,path:t.join(\".\")};let c=o.getAttribute(D);c&&t.unshift(c)}return null}var y=\"data-smd-crashed\";function _(r){let i=[];for(let t of r){let o=t.getAttribute(l),s=t.getAttribute(y);o&&(s===\"section\"||s===\"page\")&&i.push({id:o,live:s===\"section\"?\"left-out\":\"page-fails\"})}return i}var F=\"img,picture,video,audio,svg,canvas,iframe,object\",C=r=>r.innerText.trim()===\"\"&&r.querySelector(F)===null;function N(r={}){let i=r.refresh??(()=>window.location.reload()),t=e=>window.parent.postMessage(e,window.location.origin),o=e=>{let d=e.getBoundingClientRect();return{x:d.left+window.scrollX,y:d.top+window.scrollY,w:d.width,h:d.height}},s=e=>Array.from(document.querySelectorAll(e)),c=e=>!!e?.closest?.(`[${B}]`),g=()=>{let e=s(`[${l}]`);for(let n of e){let u=C(n);u!==n.hasAttribute(m)&&(u?n.setAttribute(m,\"\"):n.removeAttribute(m))}let d=e.map(n=>({id:n.getAttribute(l),...o(n)})),L=s(`[${f}]`).map(n=>({zone:n.getAttribute(f),...o(n)})),R=[];for(let n of s(`[${p}]`)){if(c(n))continue;let u=T(n);u&&R.push({...u,...o(n)})}let K=Math.ceil(Math.max(document.documentElement.scrollHeight,document.documentElement.getBoundingClientRect().height)),O=_(s(`[${y}]`));t({source:\"smoodly\",kind:\"rects\",nodes:d,emptyZones:L,fields:R,docH:K,crashed:O})},h=()=>requestAnimationFrame(g),b=new ResizeObserver(h);b.observe(document.documentElement);let E=new MutationObserver(h);E.observe(document.body,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let a=e=>e,k=e=>a(e)?.closest?.(`[${l}]`)?.getAttribute(l)??null,x=e=>{let d=a(e)?.closest?.(`[${p}]`);return d?T(d)?.path??null:null},v=e=>{a(e.target)?.closest?.(\"a\")&&e.preventDefault(),!c(a(e.target))&&t({source:\"smoodly\",kind:\"select\",id:k(e.target),path:x(e.target),x:e.clientX,y:e.clientY})},A=e=>{c(a(e.target))||t({source:\"smoodly\",kind:\"hover\",id:k(e.target),path:x(e.target)})},M=e=>{w(e,window)&&i()};document.addEventListener(\"click\",v,!0),document.addEventListener(\"mousemove\",A,!0),window.addEventListener(\"message\",M),t({source:\"smoodly\",kind:\"rendered\"}),g();let S=setTimeout(g,500);return{rendered:()=>t({source:\"smoodly\",kind:\"rendered\"}),stop(){b.disconnect(),E.disconnect(),clearTimeout(S),document.removeEventListener(\"click\",v,!0),document.removeEventListener(\"mousemove\",A,!0),window.removeEventListener(\"message\",M)}}}N();\n"},"public-sans-latin.woff2":{"type":"font/woff2","body":"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","encoding":"base64"},"public-sans-latin-ext.woff2":{"type":"font/woff2","body":"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","encoding":"base64"}}};
|