@yama-cms/theme-toolbar 0.3.1 → 0.4.0

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.
@@ -1,140 +1,140 @@
1
- (function(f,Ke){typeof exports=="object"&&typeof module<"u"?Ke(require("react"),require("react-dom/client"),require("react-dom"),require("react-fontpicker-ts"),require("react-fontpicker-ts/dist/index.css")):typeof define=="function"&&define.amd?define(["react","react-dom/client","react-dom","react-fontpicker-ts","react-fontpicker-ts/dist/index.css"],Ke):(f=typeof globalThis<"u"?globalThis:f||self,Ke(f.React,f.client,f.ReactDOM,f.FontPicker))})(this,(function(f,Ke,$n,jn){"use strict";function Rs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ht={exports:{}},Xe={};var Rn;function Ns(){if(Rn)return Xe;Rn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:o}}return Xe.Fragment=t,Xe.jsx=n,Xe.jsxs=n,Xe}var Qe={};var Nn;function Os(){return Nn||(Nn=1,process.env.NODE_ENV!=="production"&&(function(){function e(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===ut?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case S:return"Fragment";case ce:return"Profiler";case z:return"StrictMode";case V:return"Suspense";case ge:return"SuspenseList";case Ve:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case L:return"Portal";case j:return g.displayName||"Context";case B:return(g._context.displayName||"Context")+".Consumer";case P:var x=g.render;return g=g.displayName,g||(g=x.displayName||x.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case ue:return x=g.displayName||null,x!==null?x:e(g.type)||"Memo";case Pe:x=g._payload,g=g._init;try{return e(g(x))}catch{}}return null}function t(g){return""+g}function n(g){try{t(g);var x=!1}catch{x=!0}if(x){x=console;var w=x.error,y=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return w.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",y),t(g)}}function r(g){if(g===S)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===Pe)return"<...>";try{var x=e(g);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var g=ye.A;return g===null?null:g.getOwner()}function o(){return Error("react-stack-top-frame")}function i(g){if(te.call(g,"key")){var x=Object.getOwnPropertyDescriptor(g,"key").get;if(x&&x.isReactWarning)return!1}return g.key!==void 0}function a(g,x){function w(){N||(N=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}w.isReactWarning=!0,Object.defineProperty(g,"key",{get:w,configurable:!0})}function u(){var g=e(this.type);return G[g]||(G[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function l(g,x,w,y,I,q){var Z=w.ref;return g={$$typeof:_,type:g,key:x,props:w,_owner:y},(Z!==void 0?Z:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:u}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:I}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function h(g,x,w,y,I,q){var Z=x.children;if(Z!==void 0)if(y)if(Ge(Z)){for(y=0;y<Z.length;y++)c(Z[y]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else c(Z);if(te.call(x,"key")){Z=e(g);var R=Object.keys(x).filter(function(Ye){return Ye!=="key"});y=0<R.length?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}",ee[Z+y]||(R=0<R.length?"{"+R.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(h,Ke){typeof exports=="object"&&typeof module<"u"?Ke(require("react"),require("react-dom/client"),require("react-dom"),require("react-fontpicker-ts"),require("react-fontpicker-ts/dist/index.css")):typeof define=="function"&&define.amd?define(["react","react-dom/client","react-dom","react-fontpicker-ts","react-fontpicker-ts/dist/index.css"],Ke):(h=typeof globalThis<"u"?globalThis:h||self,Ke(h.React,h.client,h.ReactDOM,h.FontPicker))})(this,(function(h,Ke,$n,Nn){"use strict";function Ao(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ht={exports:{}},Xe={};var On;function Po(){if(On)return Xe;On=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:s}}return Xe.Fragment=t,Xe.jsx=n,Xe.jsxs=n,Xe}var Qe={};var jn;function Io(){return jn||(jn=1,process.env.NODE_ENV!=="production"&&(function(){function e(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===ut?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case z:return"Fragment";case ce:return"Profiler";case w:return"StrictMode";case V:return"Suspense";case ge:return"SuspenseList";case Ve:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case D:return"Portal";case $:return g.displayName||"Context";case B:return(g._context.displayName||"Context")+".Consumer";case I:var k=g.render;return g=g.displayName,g||(g=k.displayName||k.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case ue:return k=g.displayName||null,k!==null?k:e(g.type)||"Memo";case Ie:k=g._payload,g=g._init;try{return e(g(k))}catch{}}return null}function t(g){return""+g}function n(g){try{t(g);var k=!1}catch{k=!0}if(k){k=console;var y=k.error,x=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return y.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",x),t(g)}}function r(g){if(g===z)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===Ie)return"<...>";try{var k=e(g);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function o(){var g=we.A;return g===null?null:g.getOwner()}function s(){return Error("react-stack-top-frame")}function i(g){if(te.call(g,"key")){var k=Object.getOwnPropertyDescriptor(g,"key").get;if(k&&k.isReactWarning)return!1}return g.key!==void 0}function a(g,k){function y(){A||(A=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",k))}y.isReactWarning=!0,Object.defineProperty(g,"key",{get:y,configurable:!0})}function u(){var g=e(this.type);return Y[g]||(Y[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function l(g,k,y,x,Z,q){var C=y.ref;return g={$$typeof:v,type:g,key:k,props:y,_owner:x},(C!==void 0?C:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:u}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function d(g,k,y,x,Z,q){var C=k.children;if(C!==void 0)if(x)if(Ye(C)){for(x=0;x<C.length;x++)c(C[x]);Object.freeze&&Object.freeze(C)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else c(C);if(te.call(k,"key")){C=e(g);var N=Object.keys(k).filter(function(Ge){return Ge!=="key"});x=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",ee[C+x]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,y,Z,R,Z),ee[Z+y]=!0)}if(Z=null,w!==void 0&&(n(w),Z=""+w),i(x)&&(n(x.key),Z=""+x.key),"key"in x){w={};for(var _e in x)_e!=="key"&&(w[_e]=x[_e])}else w=x;return Z&&a(w,typeof g=="function"?g.displayName||g.name||"Unknown":g),l(g,Z,w,s(),I,q)}function c(g){m(g)?g._store&&(g._store.validated=1):typeof g=="object"&&g!==null&&g.$$typeof===Pe&&(g._payload.status==="fulfilled"?m(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function m(g){return typeof g=="object"&&g!==null&&g.$$typeof===_}var b=f,_=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),ce=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),j=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),Pe=Symbol.for("react.lazy"),Ve=Symbol.for("react.activity"),ut=Symbol.for("react.client.reference"),ye=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,Ge=Array.isArray,ke=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(g){return g()}};var N,G={},de=b.react_stack_bottom_frame.bind(b,o)(),be=ke(r(o)),ee={};Qe.Fragment=S,Qe.jsx=function(g,x,w){var y=1e4>ye.recentlyCreatedOwnerStacks++;return h(g,x,w,!1,y?Error("react-stack-top-frame"):de,y?ke(r(g)):be)},Qe.jsxs=function(g,x,w){var y=1e4>ye.recentlyCreatedOwnerStacks++;return h(g,x,w,!0,y?Error("react-stack-top-frame"):de,y?ke(r(g)):be)}})()),Qe}var On;function As(){return On||(On=1,process.env.NODE_ENV==="production"?ht.exports=Ns():ht.exports=Os()),ht.exports}var d=As();const Ps=180;function Is(e){const[t,n]=f.useState(e),r=f.useRef(e);return r.current=t,f.useEffect(()=>{if(e===r.current)return;if(!(r.current!==A.NONE&&e!==A.NONE)){n(e);return}n(A.NONE);const o=window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:Ps,i=window.setTimeout(()=>n(e),o);return()=>window.clearTimeout(i)},[e]),t}function Zs(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Cs=e=>{switch(e){case"success":return Ms;case"info":return Bs;case"warning":return Fs;case"error":return Us;default:return null}},Ls=Array(12).fill(0),Ds=({visible:e,className:t})=>f.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},f.createElement("div",{className:"sonner-spinner"},Ls.map((n,r)=>f.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Ms=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Fs=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Bs=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Us=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Vs=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},f.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Gs=()=>{const[e,t]=f.useState(document.hidden);return f.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Vt=1;class Ys{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Vt++,i=this.toasts.find(u=>u.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...t,id:o,title:r}),{...u,...t,id:o,dismissible:a,title:r}):u):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async l=>{if(i=["resolve",l],f.isValidElement(l))o=!1,this.create({id:r,type:"default",message:l});else if(Js(l)&&!l.ok){o=!1;const c=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,_=typeof c=="object"&&!f.isValidElement(c)?c:{message:c};this.create({id:r,type:"error",description:m,..._})}else if(l instanceof Error){o=!1;const c=typeof n.error=="function"?await n.error(l):n.error,m=typeof n.description=="function"?await n.description(l):n.description,_=typeof c=="object"&&!f.isValidElement(c)?c:{message:c};this.create({id:r,type:"error",description:m,..._})}else if(n.success!==void 0){o=!1;const c=typeof n.success=="function"?await n.success(l):n.success,m=typeof n.description=="function"?await n.description(l):n.description,_=typeof c=="object"&&!f.isValidElement(c)?c:{message:c};this.create({id:r,type:"success",description:m,..._})}}).catch(async l=>{if(i=["reject",l],n.error!==void 0){o=!1;const h=typeof n.error=="function"?await n.error(l):n.error,c=typeof n.description=="function"?await n.description(l):n.description,b=typeof h=="object"&&!f.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:c,...b})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((l,h)=>a.then(()=>i[0]==="reject"?h(i[1]):l(i[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=n?.id||Vt++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const X=new Ys,Hs=(e,t)=>{const n=t?.id||Vt++;return X.addToast({title:e,...t,id:n}),n},Js=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",qs=Hs,Ws=()=>X.toasts,Ks=()=>X.getActiveToasts(),Gt=Object.assign(qs,{success:X.success,info:X.info,warning:X.warning,error:X.error,custom:X.custom,message:X.message,promise:X.promise,dismiss:X.dismiss,loading:X.loading},{getHistory:Ws,getToasts:Ks});Zs("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ft(e){return e.label!==void 0}const Xs=3,Qs="24px",eo="16px",An=4e3,to=356,no=14,ro=45,so=200;function pe(...e){return e.filter(Boolean).join(" ")}function oo(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const io=e=>{var t,n,r,s,o,i,a,u,l;const{invert:h,toast:c,unstyled:m,interacting:b,setHeights:_,visibleToasts:L,heights:S,index:z,toasts:ce,expanded:B,removeToast:j,defaultRichColors:P,closeButton:V,style:ge,cancelButtonStyle:ue,actionButtonStyle:Pe,className:Ve="",descriptionClassName:ut="",duration:ye,position:te,gap:Ge,expandByDefault:ke,classNames:N,icons:G,closeButtonAriaLabel:de="Close toast"}=e,[be,ee]=f.useState(null),[g,x]=f.useState(null),[w,y]=f.useState(!1),[I,q]=f.useState(!1),[Z,R]=f.useState(!1),[_e,Ye]=f.useState(!1),[Mt,He]=f.useState(!1),[Ad,kn]=f.useState(0),[Pd,xs]=f.useState(0),dt=f.useRef(c.duration||ye||An),ys=f.useRef(null),ze=f.useRef(null),Id=z===0,Zd=z+1<=L,ne=c.type,Je=c.dismissible!==!1,Cd=c.className||"",Ld=c.descriptionClassName||"",Ft=f.useMemo(()=>S.findIndex(k=>k.toastId===c.id)||0,[S,c.id]),Dd=f.useMemo(()=>{var k;return(k=c.closeButton)!=null?k:V},[c.closeButton,V]),ks=f.useMemo(()=>c.duration||ye||An,[c.duration,ye]),zn=f.useRef(0),qe=f.useRef(0),zs=f.useRef(0),We=f.useRef(null),[Md,Fd]=te.split("-"),Es=f.useMemo(()=>S.reduce((k,Y,W)=>W>=Ft?k:k+Y.height,0),[S,Ft]),Ts=Gs(),Bd=c.invert||h,En=ne==="loading";qe.current=f.useMemo(()=>Ft*Ge+Es,[Ft,Es]),f.useEffect(()=>{dt.current=ks},[ks]),f.useEffect(()=>{y(!0)},[]),f.useEffect(()=>{const k=ze.current;if(k){const Y=k.getBoundingClientRect().height;return xs(Y),_(W=>[{toastId:c.id,height:Y,position:c.position},...W]),()=>_(W=>W.filter(re=>re.toastId!==c.id))}},[_,c.id]),f.useLayoutEffect(()=>{if(!w)return;const k=ze.current,Y=k.style.height;k.style.height="auto";const W=k.getBoundingClientRect().height;k.style.height=Y,xs(W),_(re=>re.find(H=>H.toastId===c.id)?re.map(H=>H.toastId===c.id?{...H,height:W}:H):[{toastId:c.id,height:W,position:c.position},...re])},[w,c.title,c.description,_,c.id,c.jsx,c.action,c.cancel]);const je=f.useCallback(()=>{q(!0),kn(qe.current),_(k=>k.filter(Y=>Y.toastId!==c.id)),setTimeout(()=>{j(c)},so)},[c,j,_,qe]);f.useEffect(()=>{if(c.promise&&ne==="loading"||c.duration===1/0||c.type==="loading")return;let k;return B||b||Ts?(()=>{if(zs.current<zn.current){const re=new Date().getTime()-zn.current;dt.current=dt.current-re}zs.current=new Date().getTime()})():dt.current!==1/0&&(zn.current=new Date().getTime(),k=setTimeout(()=>{c.onAutoClose==null||c.onAutoClose.call(c,c),je()},dt.current)),()=>clearTimeout(k)},[B,b,c,ne,Ts,je]),f.useEffect(()=>{c.delete&&(je(),c.onDismiss==null||c.onDismiss.call(c,c))},[je,c.delete]);function Ud(){var k;if(G?.loading){var Y;return f.createElement("div",{className:pe(N?.loader,c==null||(Y=c.classNames)==null?void 0:Y.loader,"sonner-loader"),"data-visible":ne==="loading"},G.loading)}return f.createElement(Ds,{className:pe(N?.loader,c==null||(k=c.classNames)==null?void 0:k.loader),visible:ne==="loading"})}const Vd=c.icon||G?.[ne]||Cs(ne);var Ss,$s;return f.createElement("li",{tabIndex:0,ref:ze,className:pe(Ve,Cd,N?.toast,c==null||(t=c.classNames)==null?void 0:t.toast,N?.default,N?.[ne],c==null||(n=c.classNames)==null?void 0:n[ne]),"data-sonner-toast":"","data-rich-colors":(Ss=c.richColors)!=null?Ss:P,"data-styled":!(c.jsx||c.unstyled||m),"data-mounted":w,"data-promise":!!c.promise,"data-swiped":Mt,"data-removed":I,"data-visible":Zd,"data-y-position":Md,"data-x-position":Fd,"data-index":z,"data-front":Id,"data-swiping":Z,"data-dismissible":Je,"data-type":ne,"data-invert":Bd,"data-swipe-out":_e,"data-swipe-direction":g,"data-expanded":!!(B||ke&&w),"data-testid":c.testId,style:{"--index":z,"--toasts-before":z,"--z-index":ce.length-z,"--offset":`${I?Ad:qe.current}px`,"--initial-height":ke?"auto":`${Pd}px`,...ge,...c.style},onDragEnd:()=>{R(!1),ee(null),We.current=null},onPointerDown:k=>{k.button!==2&&(En||!Je||(ys.current=new Date,kn(qe.current),k.target.setPointerCapture(k.pointerId),k.target.tagName!=="BUTTON"&&(R(!0),We.current={x:k.clientX,y:k.clientY})))},onPointerUp:()=>{var k,Y,W;if(_e||!Je)return;We.current=null;const re=Number(((k=ze.current)==null?void 0:k.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Bt=Number(((Y=ze.current)==null?void 0:Y.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),H=new Date().getTime()-((W=ys.current)==null?void 0:W.getTime()),oe=be==="x"?re:Bt,Ut=Math.abs(oe)/H;if(Math.abs(oe)>=ro||Ut>.11){kn(qe.current),c.onDismiss==null||c.onDismiss.call(c,c),x(be==="x"?re>0?"right":"left":Bt>0?"down":"up"),je(),Ye(!0);return}else{var he,fe;(he=ze.current)==null||he.style.setProperty("--swipe-amount-x","0px"),(fe=ze.current)==null||fe.style.setProperty("--swipe-amount-y","0px")}He(!1),R(!1),ee(null)},onPointerMove:k=>{var Y,W,re;if(!We.current||!Je||((Y=window.getSelection())==null?void 0:Y.toString().length)>0)return;const H=k.clientY-We.current.y,oe=k.clientX-We.current.x;var Ut;const he=(Ut=e.swipeDirections)!=null?Ut:oo(te);!be&&(Math.abs(oe)>1||Math.abs(H)>1)&&ee(Math.abs(oe)>Math.abs(H)?"x":"y");let fe={x:0,y:0};const js=Ie=>1/(1.5+Math.abs(Ie)/20);if(be==="y"){if(he.includes("top")||he.includes("bottom"))if(he.includes("top")&&H<0||he.includes("bottom")&&H>0)fe.y=H;else{const Ie=H*js(H);fe.y=Math.abs(Ie)<Math.abs(H)?Ie:H}}else if(be==="x"&&(he.includes("left")||he.includes("right")))if(he.includes("left")&&oe<0||he.includes("right")&&oe>0)fe.x=oe;else{const Ie=oe*js(oe);fe.x=Math.abs(Ie)<Math.abs(oe)?Ie:oe}(Math.abs(fe.x)>0||Math.abs(fe.y)>0)&&He(!0),(W=ze.current)==null||W.style.setProperty("--swipe-amount-x",`${fe.x}px`),(re=ze.current)==null||re.style.setProperty("--swipe-amount-y",`${fe.y}px`)}},Dd&&!c.jsx&&ne!=="loading"?f.createElement("button",{"aria-label":de,"data-disabled":En,"data-close-button":!0,onClick:En||!Je?()=>{}:()=>{je(),c.onDismiss==null||c.onDismiss.call(c,c)},className:pe(N?.closeButton,c==null||(r=c.classNames)==null?void 0:r.closeButton)},($s=G?.close)!=null?$s:Vs):null,(ne||c.icon||c.promise)&&c.icon!==null&&(G?.[ne]!==null||c.icon)?f.createElement("div",{"data-icon":"",className:pe(N?.icon,c==null||(s=c.classNames)==null?void 0:s.icon)},c.promise||c.type==="loading"&&!c.icon?c.icon||Ud():null,c.type!=="loading"?Vd:null):null,f.createElement("div",{"data-content":"",className:pe(N?.content,c==null||(o=c.classNames)==null?void 0:o.content)},f.createElement("div",{"data-title":"",className:pe(N?.title,c==null||(i=c.classNames)==null?void 0:i.title)},c.jsx?c.jsx:typeof c.title=="function"?c.title():c.title),c.description?f.createElement("div",{"data-description":"",className:pe(ut,Ld,N?.description,c==null||(a=c.classNames)==null?void 0:a.description)},typeof c.description=="function"?c.description():c.description):null),f.isValidElement(c.cancel)?c.cancel:c.cancel&&ft(c.cancel)?f.createElement("button",{"data-button":!0,"data-cancel":!0,style:c.cancelButtonStyle||ue,onClick:k=>{ft(c.cancel)&&Je&&(c.cancel.onClick==null||c.cancel.onClick.call(c.cancel,k),je())},className:pe(N?.cancelButton,c==null||(u=c.classNames)==null?void 0:u.cancelButton)},c.cancel.label):null,f.isValidElement(c.action)?c.action:c.action&&ft(c.action)?f.createElement("button",{"data-button":!0,"data-action":!0,style:c.actionButtonStyle||Pe,onClick:k=>{ft(c.action)&&(c.action.onClick==null||c.action.onClick.call(c.action,k),!k.defaultPrevented&&je())},className:pe(N?.actionButton,c==null||(l=c.classNames)==null?void 0:l.actionButton)},c.action.label):null)};function Pn(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ao(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,i=o?"--mobile-offset":"--offset",a=o?eo:Qs;function u(l){["top","right","bottom","left"].forEach(h=>{n[`${i}-${h}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${i}-${l}`]=a:n[`${i}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):u(a)}),n}const lo=f.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:u,className:l,offset:h,mobileOffset:c,theme:m="light",richColors:b,duration:_,style:L,visibleToasts:S=Xs,toastOptions:z,dir:ce=Pn(),gap:B=no,icons:j,containerAriaLabel:P="Notifications"}=t,[V,ge]=f.useState([]),ue=f.useMemo(()=>r?V.filter(w=>w.toasterId===r):V.filter(w=>!w.toasterId),[V,r]),Pe=f.useMemo(()=>Array.from(new Set([o].concat(ue.filter(w=>w.position).map(w=>w.position)))),[ue,o]),[Ve,ut]=f.useState([]),[ye,te]=f.useState(!1),[Ge,ke]=f.useState(!1),[N,G]=f.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),de=f.useRef(null),be=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=f.useRef(null),g=f.useRef(!1),x=f.useCallback(w=>{ge(y=>{var I;return(I=y.find(q=>q.id===w.id))!=null&&I.delete||X.dismiss(w.id),y.filter(({id:q})=>q!==w.id)})},[]);return f.useEffect(()=>X.subscribe(w=>{if(w.dismiss){requestAnimationFrame(()=>{ge(y=>y.map(I=>I.id===w.id?{...I,delete:!0}:I))});return}setTimeout(()=>{$n.flushSync(()=>{ge(y=>{const I=y.findIndex(q=>q.id===w.id);return I!==-1?[...y.slice(0,I),{...y[I],...w},...y.slice(I+1)]:[w,...y]})})})}),[V]),f.useEffect(()=>{if(m!=="system"){G(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const w=window.matchMedia("(prefers-color-scheme: dark)");try{w.addEventListener("change",({matches:y})=>{G(y?"dark":"light")})}catch{w.addListener(({matches:I})=>{try{G(I?"dark":"light")}catch(q){console.error(q)}})}},[m]),f.useEffect(()=>{V.length<=1&&te(!1)},[V]),f.useEffect(()=>{const w=y=>{var I;if(i.every(R=>y[R]||y.code===R)){var Z;te(!0),(Z=de.current)==null||Z.focus()}y.code==="Escape"&&(document.activeElement===de.current||(I=de.current)!=null&&I.contains(document.activeElement))&&te(!1)};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[i]),f.useEffect(()=>{if(de.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,g.current=!1)}},[de.current]),f.createElement("section",{ref:n,"aria-label":`${P} ${be}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Pe.map((w,y)=>{var I;const[q,Z]=w.split("-");return ue.length?f.createElement("ol",{key:w,dir:ce==="auto"?Pn():ce,tabIndex:-1,ref:de,className:l,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":q,"data-x-position":Z,style:{"--front-toast-height":`${((I=Ve[0])==null?void 0:I.height)||0}px`,"--width":`${to}px`,"--gap":`${B}px`,...L,...ao(h,c)},onBlur:R=>{g.current&&!R.currentTarget.contains(R.relatedTarget)&&(g.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||g.current||(g.current=!0,ee.current=R.relatedTarget)},onMouseEnter:()=>te(!0),onMouseMove:()=>te(!0),onMouseLeave:()=>{Ge||te(!1)},onDragEnd:()=>te(!1),onPointerDown:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||ke(!0)},onPointerUp:()=>ke(!1)},ue.filter(R=>!R.position&&y===0||R.position===w).map((R,_e)=>{var Ye,Mt;return f.createElement(io,{key:R.id,icons:j,index:_e,toast:R,defaultRichColors:b,duration:(Ye=z?.duration)!=null?Ye:_,className:z?.className,descriptionClassName:z?.descriptionClassName,invert:s,visibleToasts:S,closeButton:(Mt=z?.closeButton)!=null?Mt:u,interacting:Ge,position:w,style:z?.style,unstyled:z?.unstyled,classNames:z?.classNames,cancelButtonStyle:z?.cancelButtonStyle,actionButtonStyle:z?.actionButtonStyle,closeButtonAriaLabel:z?.closeButtonAriaLabel,removeToast:x,toasts:ue.filter(He=>He.position==R.position),heights:Ve.filter(He=>He.position==R.position),setHeights:ut,expandByDefault:a,gap:B,expanded:ye,swipeDirections:t.swipeDirections})})):null}))});var In;function p(e,t,n){function r(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);const l=i.prototype,h=Object.keys(l);for(let c=0;c<h.length;c++){const m=h[c];m in a||(a[m]=l[m].bind(a))}}const s=n?.Parent??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(a){var u;const l=n?.Parent?new o:this;r(l,a),(u=l._zod).deferred??(u.deferred=[]);for(const h of l._zod.deferred)h();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Ze extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Zn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(In=globalThis).__zod_globalConfig??(In.__zod_globalConfig={});const Yt=globalThis.__zod_globalConfig;function ve(e){return Yt}function Cn(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function Ht(e,t){return typeof t=="bigint"?t.toString():t}function Jt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function qt(e){return e==null}function Wt(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function co(e,t){const n=e/t,r=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}const Ln=Symbol("evaluating");function O(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ln)return r===void 0&&(r=Ln,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Re(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ee(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Dn(e){return JSON.stringify(e)}function uo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Mn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function pt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ho=Jt(()=>{if(Yt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ce(e){if(pt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(pt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Fn(e){return Ce(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const fo=new Set(["string","number","symbol"]);function mt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Te(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function v(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function po(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const mo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function go(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ee(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return Re(this,"shape",i),i},checks:[]});return Te(e,o)}function bo(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ee(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Re(this,"shape",i),i},checks:[]});return Te(e,o)}function _o(e,t){if(!Ce(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ee(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Re(this,"shape",o),o}});return Te(e,s)}function vo(e,t){if(!Ce(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ee(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Re(this,"shape",r),r}});return Te(e,n)}function wo(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Ee(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Re(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Te(e,n)}function xo(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Ee(t._zod.def,{get shape(){const a=t._zod.def.shape,u={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)u[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return Re(this,"shape",u),u},checks:[]});return Te(t,i)}function yo(e,t,n){const r=Ee(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return Re(this,"shape",o),o}});return Te(t,r)}function Le(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ko(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function De(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function gt(e){return typeof e=="string"?e:e?.message}function we(e,t,n){const r=e.message?e.message:gt(e.inst?._zod.def?.error?.(e))??gt(t?.error?.(e))??gt(n.customError?.(e))??gt(n.localeError?.(e))??"Invalid input",{inst:s,continue:o,input:i,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=i),a}function Kt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function et(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Bn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ht,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Un=p("$ZodError",Bn),Vn=p("$ZodError",Bn,{Parent:Error});function zo(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function Eo(e,t=n=>n.message){const n={_errors:[]},r=(s,o=[])=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...o,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...o,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...o,...i.path]);else{const a=[...o,...i.path];if(a.length===0)n._errors.push(t(i));else{let u=n,l=0;for(;l<a.length;){const h=a[l];l===a.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(i))):u[h]=u[h]||{_errors:[]},u=u[h],l++}}}};return r(e),n}const Xt=e=>(t,n,r,s)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Ze;if(i.issues.length){const a=new(s?.Err??e)(i.issues.map(u=>we(u,o,ve())));throw Mn(a,s?.callee),a}return i.value},Qt=e=>async(t,n,r,s)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(s?.Err??e)(i.issues.map(u=>we(u,o,ve())));throw Mn(a,s?.callee),a}return i.value},bt=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new Ze;return o.issues.length?{success:!1,error:new(e??Un)(o.issues.map(i=>we(i,s,ve())))}:{success:!0,data:o.value}},To=bt(Vn),_t=e=>async(t,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>we(i,s,ve())))}:{success:!0,data:o.value}},So=_t(Vn),$o=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Xt(e)(t,n,s)},jo=e=>(t,n,r)=>Xt(e)(t,n,r),Ro=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Qt(e)(t,n,s)},No=e=>async(t,n,r)=>Qt(e)(t,n,r),Oo=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return bt(e)(t,n,s)},Ao=e=>(t,n,r)=>bt(e)(t,n,r),Po=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return _t(e)(t,n,s)},Io=e=>async(t,n,r)=>_t(e)(t,n,r),Zo=/^[cC][0-9a-z]{6,}$/,Co=/^[0-9a-z]+$/,Lo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Do=/^[0-9a-vA-V]{20}$/,Mo=/^[A-Za-z0-9]{27}$/,Fo=/^[a-zA-Z0-9_-]{21}$/,Bo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Uo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Gn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Vo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Go="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Yo(){return new RegExp(Go,"u")}const Ho=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Jo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,qo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Wo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ko=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yn=/^[A-Za-z0-9_-]*$/,Xo=/^https?$/,Qo=/^\+[1-9]\d{6,14}$/,Hn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ei=new RegExp(`^${Hn}$`);function Jn(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ti(e){return new RegExp(`^${Jn(e)}$`)}function ni(e){const t=Jn({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Hn}T(?:${r})$`)}const ri=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},si=/^-?\d+$/,qn=/^-?\d+(?:\.\d+)?$/,oi=/^[^A-Z]*$/,ii=/^[^a-z]*$/,Q=p("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Wn={number:"number",bigint:"bigint",object:"date"},Kn=p("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);const n=Wn[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xn=p("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);const n=Wn[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ai=p("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):co(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),li=p("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,o]=mo[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=s,a.maximum=o,n&&(a.pattern=si)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<s&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>o&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),ci=p("$ZodCheckMaxLength",(e,t)=>{var n;Q.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!qt(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const i=Kt(s);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ui=p("$ZodCheckMinLength",(e,t)=>{var n;Q.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!qt(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const i=Kt(s);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),di=p("$ZodCheckLengthEquals",(e,t)=>{var n;Q.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!qt(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,o=s.length;if(o===t.length)return;const i=Kt(s),a=o>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),vt=p("$ZodCheckStringFormat",(e,t)=>{var n,r;Q.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),hi=p("$ZodCheckRegex",(e,t)=>{vt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fi=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=oi),vt.init(e,t)}),pi=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ii),vt.init(e,t)}),mi=p("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);const n=mt(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),gi=p("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);const n=new RegExp(`^${mt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),bi=p("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);const n=new RegExp(`.*${mt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),_i=p("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class vi{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
7
- `).filter(i=>i),s=Math.min(...r.map(i=>i.length-i.trimStart().length)),o=r.map(i=>i.slice(s)).map(i=>" ".repeat(this.indent*2)+i);for(const i of o)this.content.push(i)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...n,s.join(`
8
- `))}}const wi={major:4,minor:4,patch:3},M=p("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wi;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const o of s._zod.onattach)o(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(i,a,u)=>{let l=Le(i),h;for(const c of a){if(c._zod.def.when){if(ko(i)||!c._zod.def.when(i))continue}else if(l)continue;const m=i.issues.length,b=c._zod.check(i);if(b instanceof Promise&&u?.async===!1)throw new Ze;if(h||b instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await b,i.issues.length!==m&&(l||(l=Le(i,m)))});else{if(i.issues.length===m)continue;l||(l=Le(i,m))}}return h?h.then(()=>i):i},o=(i,a,u)=>{if(Le(i))return i.aborted=!0,i;const l=s(a,r,u);if(l instanceof Promise){if(u.async===!1)throw new Ze;return l.then(h=>e._zod.parse(h,u))}return e._zod.parse(l,u)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const l=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(h=>o(h,i,a)):o(l,i,a)}const u=e._zod.parse(i,a);if(u instanceof Promise){if(a.async===!1)throw new Ze;return u.then(l=>s(l,r,a))}return s(u,r,a)}}O(e,"~standard",()=>({validate:s=>{try{const o=To(e,s);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return So(e,s).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),en=p("$ZodString",(e,t)=>{M.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ri(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),C=p("$ZodStringFormat",(e,t)=>{vt.init(e,t),en.init(e,t)}),xi=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Uo),C.init(e,t)}),yi=p("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Gn(r))}else t.pattern??(t.pattern=Gn());C.init(e,t)}),ki=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vo),C.init(e,t)}),zi=p("$ZodURL",(e,t)=>{C.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===Xo.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const s=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ei=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Yo()),C.init(e,t)}),Ti=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Fo),C.init(e,t)}),Si=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zo),C.init(e,t)}),$i=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Co),C.init(e,t)}),ji=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Lo),C.init(e,t)}),Ri=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Do),C.init(e,t)}),Ni=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Mo),C.init(e,t)}),Oi=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ni(t)),C.init(e,t)}),Ai=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ei),C.init(e,t)}),Pi=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ti(t)),C.init(e,t)}),Ii=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Bo),C.init(e,t)}),Zi=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ho),C.init(e,t),e._zod.bag.format="ipv4"}),Ci=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Jo),C.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Li=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=qo),C.init(e,t)}),Di=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Wo),C.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,o]=r;if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Qn(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Mi=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ko),C.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Qn(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Fi(e){if(!Yn.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Qn(n)}const Bi=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yn),C.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Fi(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ui=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Qo),C.init(e,t)});function Vi(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const Gi=p("$ZodJWT",(e,t)=>{C.init(e,t),e._zod.check=n=>{Vi(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),er=p("$ZodNumber",(e,t)=>{M.init(e,t),e._zod.pattern=e._zod.bag.pattern??qn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const o=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...o?{received:o}:{}}),n}}),Yi=p("$ZodNumberFormat",(e,t)=>{li.init(e,t),er.init(e,t)}),Hi=p("$ZodUnknown",(e,t)=>{M.init(e,t),e._zod.parse=n=>n}),Ji=p("$ZodNever",(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function tr(e,t,n){e.issues.length&&t.issues.push(...De(n,e.issues)),t.value[n]=e.value}const qi=p("$ZodArray",(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const o=[];for(let i=0;i<s.length;i++){const a=s[i],u=t.element._zod.run({value:a,issues:[]},r);u instanceof Promise?o.push(u.then(l=>tr(l,n,i))):tr(u,n,i)}return o.length?Promise.all(o).then(()=>n):n}});function wt(e,t,n,r,s,o){const i=n in r;if(e.issues.length){if(s&&o&&!i)return;t.issues.push(...De(n,e.issues))}if(!i&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?i&&(t.value[n]=void 0):t.value[n]=e.value}function nr(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=po(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function rr(e,t,n,r,s,o){const i=[],a=s.keySet,u=s.catchall._zod,l=u.def.type,h=u.optin==="optional",c=u.optout==="optional";for(const m in t){if(m==="__proto__"||a.has(m))continue;if(l==="never"){i.push(m);continue}const b=u.run({value:t[m],issues:[]},r);b instanceof Promise?e.push(b.then(_=>wt(_,n,m,t,h,c))):wt(b,n,m,t,h,c)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const Wi=p("$ZodObject",(e,t)=>{if(M.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...a};return Object.defineProperty(t,"shape",{value:u}),u}})}const r=Jt(()=>nr(t));O(e._zod,"propValues",()=>{const a=t.shape,u={};for(const l in a){const h=a[l]._zod;if(h.values){u[l]??(u[l]=new Set);for(const c of h.values)u[l].add(c)}}return u});const s=pt,o=t.catchall;let i;e._zod.parse=(a,u)=>{i??(i=r.value);const l=a.value;if(!s(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const h=[],c=i.shape;for(const m of i.keys){const b=c[m],_=b._zod.optin==="optional",L=b._zod.optout==="optional",S=b._zod.run({value:l[m],issues:[]},u);S instanceof Promise?h.push(S.then(z=>wt(z,a,m,l,_,L))):wt(S,a,m,l,_,L)}return o?rr(h,l,a,u,r.value,e):h.length?Promise.all(h).then(()=>a):a}}),Ki=p("$ZodObjectJIT",(e,t)=>{Wi.init(e,t);const n=e._zod.parse,r=Jt(()=>nr(t)),s=m=>{const b=new vi(["shape","payload","ctx"]),_=r.value,L=B=>{const j=Dn(B);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};b.write("const input = payload.value;");const S=Object.create(null);let z=0;for(const B of _.keys)S[B]=`key_${z++}`;b.write("const newResult = {};");for(const B of _.keys){const j=S[B],P=Dn(B),V=m[B],ge=V?._zod?.optin==="optional",ue=V?._zod?.optout==="optional";b.write(`const ${j} = ${L(B)};`),ge&&ue?b.write(`
9
- if (${j}.issues.length) {
10
- if (${P} in input) {
11
- payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
6
+ <%s key={someKey} {...props} />`,x,C,N,C),ee[C+x]=!0)}if(C=null,y!==void 0&&(n(y),C=""+y),i(k)&&(n(k.key),C=""+k.key),"key"in k){y={};for(var ve in k)ve!=="key"&&(y[ve]=k[ve])}else y=k;return C&&a(y,typeof g=="function"?g.displayName||g.name||"Unknown":g),l(g,C,y,o(),Z,q)}function c(g){m(g)?g._store&&(g._store.validated=1):typeof g=="object"&&g!==null&&g.$$typeof===Ie&&(g._payload.status==="fulfilled"?m(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function m(g){return typeof g=="object"&&g!==null&&g.$$typeof===v}var b=h,v=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),ce=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),$=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),Ie=Symbol.for("react.lazy"),Ve=Symbol.for("react.activity"),ut=Symbol.for("react.client.reference"),we=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,Ye=Array.isArray,xe=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(g){return g()}};var A,Y={},de=b.react_stack_bottom_frame.bind(b,s)(),be=xe(r(s)),ee={};Qe.Fragment=z,Qe.jsx=function(g,k,y){var x=1e4>we.recentlyCreatedOwnerStacks++;return d(g,k,y,!1,x?Error("react-stack-top-frame"):de,x?xe(r(g)):be)},Qe.jsxs=function(g,k,y){var x=1e4>we.recentlyCreatedOwnerStacks++;return d(g,k,y,!0,x?Error("react-stack-top-frame"):de,x?xe(r(g)):be)}})()),Qe}var An;function Zo(){return An||(An=1,process.env.NODE_ENV==="production"?ht.exports=Po():ht.exports=Io()),ht.exports}var p=Zo();const Co=180;function Ro(e){const[t,n]=h.useState(e),r=h.useRef(e);return r.current=t,h.useEffect(()=>{if(e===r.current)return;if(!(r.current!==O.NONE&&e!==O.NONE)){n(e);return}n(O.NONE);const s=window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:Co,i=window.setTimeout(()=>n(e),s);return()=>window.clearTimeout(i)},[e]),t}function Lo(e){return/^\s*<!doctype html>/i.test(e)}async function Do(e){const t=[...new Set([document.documentElement.lang,e].filter(n=>!!n))];for(const n of t)try{const r=await fetch(`/guide/guide.${n}.md`);if(!r.ok)continue;const o=await r.text();if(Lo(o)){console.info("No guide found for language",n);continue}return o}catch{continue}return null}function Mo(e){const[t,n]=h.useState(null),[r,o]=h.useState(!1);return h.useEffect(()=>{let s=!1;return(async()=>{const i=await Do(e);s||(n(i),o(i!==null))})(),()=>{s=!0}},[e]),{exists:r,markdown:t}}function Fo(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Bo=e=>{switch(e){case"success":return Yo;case"info":return Ho;case"warning":return Go;case"error":return Jo;default:return null}},Uo=Array(12).fill(0),Vo=({visible:e,className:t})=>h.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},h.createElement("div",{className:"sonner-spinner"},Uo.map((n,r)=>h.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Yo=h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},h.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Go=h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},h.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Ho=h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},h.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Jo=h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},h.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),qo=h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},h.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Wo=()=>{const[e,t]=h.useState(document.hidden);return h.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Vt=1;class Ko{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Vt++,i=this.toasts.find(u=>u.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...t,id:s,title:r}),{...u,...t,id:s,dismissible:a,title:r}):u):this.addToast({title:r,...o,dismissible:a,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const a=o.then(async l=>{if(i=["resolve",l],h.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(Qo(l)&&!l.ok){s=!1;const c=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,v=typeof c=="object"&&!h.isValidElement(c)?c:{message:c};this.create({id:r,type:"error",description:m,...v})}else if(l instanceof Error){s=!1;const c=typeof n.error=="function"?await n.error(l):n.error,m=typeof n.description=="function"?await n.description(l):n.description,v=typeof c=="object"&&!h.isValidElement(c)?c:{message:c};this.create({id:r,type:"error",description:m,...v})}else if(n.success!==void 0){s=!1;const c=typeof n.success=="function"?await n.success(l):n.success,m=typeof n.description=="function"?await n.description(l):n.description,v=typeof c=="object"&&!h.isValidElement(c)?c:{message:c};this.create({id:r,type:"success",description:m,...v})}}).catch(async l=>{if(i=["reject",l],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(l):n.error,c=typeof n.description=="function"?await n.description(l):n.description,b=typeof d=="object"&&!h.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:c,...b})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((l,d)=>a.then(()=>i[0]==="reject"?d(i[1]):l(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=n?.id||Vt++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const X=new Ko,Xo=(e,t)=>{const n=t?.id||Vt++;return X.addToast({title:e,...t,id:n}),n},Qo=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",es=Xo,ts=()=>X.toasts,ns=()=>X.getActiveToasts(),Yt=Object.assign(es,{success:X.success,info:X.info,warning:X.warning,error:X.error,custom:X.custom,message:X.message,promise:X.promise,dismiss:X.dismiss,loading:X.loading},{getHistory:ts,getToasts:ns});Fo("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function pt(e){return e.label!==void 0}const rs=3,os="24px",ss="16px",Pn=4e3,is=356,as=14,ls=45,cs=200;function fe(...e){return e.filter(Boolean).join(" ")}function us(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const ds=e=>{var t,n,r,o,s,i,a,u,l;const{invert:d,toast:c,unstyled:m,interacting:b,setHeights:v,visibleToasts:D,heights:z,index:w,toasts:ce,expanded:B,removeToast:$,defaultRichColors:I,closeButton:V,style:ge,cancelButtonStyle:ue,actionButtonStyle:Ie,className:Ve="",descriptionClassName:ut="",duration:we,position:te,gap:Ye,expandByDefault:xe,classNames:A,icons:Y,closeButtonAriaLabel:de="Close toast"}=e,[be,ee]=h.useState(null),[g,k]=h.useState(null),[y,x]=h.useState(!1),[Z,q]=h.useState(!1),[C,N]=h.useState(!1),[ve,Ge]=h.useState(!1),[Mt,He]=h.useState(!1),[Rd,xn]=h.useState(0),[Ld,xo]=h.useState(0),dt=h.useRef(c.duration||we||Pn),Eo=h.useRef(null),Ee=h.useRef(null),Dd=w===0,Md=w+1<=D,ne=c.type,Je=c.dismissible!==!1,Fd=c.className||"",Bd=c.descriptionClassName||"",Ft=h.useMemo(()=>z.findIndex(E=>E.toastId===c.id)||0,[z,c.id]),Ud=h.useMemo(()=>{var E;return(E=c.closeButton)!=null?E:V},[c.closeButton,V]),zo=h.useMemo(()=>c.duration||we||Pn,[c.duration,we]),En=h.useRef(0),qe=h.useRef(0),So=h.useRef(0),We=h.useRef(null),[Vd,Yd]=te.split("-"),To=h.useMemo(()=>z.reduce((E,G,W)=>W>=Ft?E:E+G.height,0),[z,Ft]),$o=Wo(),Gd=c.invert||d,zn=ne==="loading";qe.current=h.useMemo(()=>Ft*Ye+To,[Ft,To]),h.useEffect(()=>{dt.current=zo},[zo]),h.useEffect(()=>{x(!0)},[]),h.useEffect(()=>{const E=Ee.current;if(E){const G=E.getBoundingClientRect().height;return xo(G),v(W=>[{toastId:c.id,height:G,position:c.position},...W]),()=>v(W=>W.filter(re=>re.toastId!==c.id))}},[v,c.id]),h.useLayoutEffect(()=>{if(!y)return;const E=Ee.current,G=E.style.height;E.style.height="auto";const W=E.getBoundingClientRect().height;E.style.height=G,xo(W),v(re=>re.find(H=>H.toastId===c.id)?re.map(H=>H.toastId===c.id?{...H,height:W}:H):[{toastId:c.id,height:W,position:c.position},...re])},[y,c.title,c.description,v,c.id,c.jsx,c.action,c.cancel]);const Ne=h.useCallback(()=>{q(!0),xn(qe.current),v(E=>E.filter(G=>G.toastId!==c.id)),setTimeout(()=>{$(c)},cs)},[c,$,v,qe]);h.useEffect(()=>{if(c.promise&&ne==="loading"||c.duration===1/0||c.type==="loading")return;let E;return B||b||$o?(()=>{if(So.current<En.current){const re=new Date().getTime()-En.current;dt.current=dt.current-re}So.current=new Date().getTime()})():dt.current!==1/0&&(En.current=new Date().getTime(),E=setTimeout(()=>{c.onAutoClose==null||c.onAutoClose.call(c,c),Ne()},dt.current)),()=>clearTimeout(E)},[B,b,c,ne,$o,Ne]),h.useEffect(()=>{c.delete&&(Ne(),c.onDismiss==null||c.onDismiss.call(c,c))},[Ne,c.delete]);function Hd(){var E;if(Y?.loading){var G;return h.createElement("div",{className:fe(A?.loader,c==null||(G=c.classNames)==null?void 0:G.loader,"sonner-loader"),"data-visible":ne==="loading"},Y.loading)}return h.createElement(Vo,{className:fe(A?.loader,c==null||(E=c.classNames)==null?void 0:E.loader),visible:ne==="loading"})}const Jd=c.icon||Y?.[ne]||Bo(ne);var No,Oo;return h.createElement("li",{tabIndex:0,ref:Ee,className:fe(Ve,Fd,A?.toast,c==null||(t=c.classNames)==null?void 0:t.toast,A?.default,A?.[ne],c==null||(n=c.classNames)==null?void 0:n[ne]),"data-sonner-toast":"","data-rich-colors":(No=c.richColors)!=null?No:I,"data-styled":!(c.jsx||c.unstyled||m),"data-mounted":y,"data-promise":!!c.promise,"data-swiped":Mt,"data-removed":Z,"data-visible":Md,"data-y-position":Vd,"data-x-position":Yd,"data-index":w,"data-front":Dd,"data-swiping":C,"data-dismissible":Je,"data-type":ne,"data-invert":Gd,"data-swipe-out":ve,"data-swipe-direction":g,"data-expanded":!!(B||xe&&y),"data-testid":c.testId,style:{"--index":w,"--toasts-before":w,"--z-index":ce.length-w,"--offset":`${Z?Rd:qe.current}px`,"--initial-height":xe?"auto":`${Ld}px`,...ge,...c.style},onDragEnd:()=>{N(!1),ee(null),We.current=null},onPointerDown:E=>{E.button!==2&&(zn||!Je||(Eo.current=new Date,xn(qe.current),E.target.setPointerCapture(E.pointerId),E.target.tagName!=="BUTTON"&&(N(!0),We.current={x:E.clientX,y:E.clientY})))},onPointerUp:()=>{var E,G,W;if(ve||!Je)return;We.current=null;const re=Number(((E=Ee.current)==null?void 0:E.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Bt=Number(((G=Ee.current)==null?void 0:G.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),H=new Date().getTime()-((W=Eo.current)==null?void 0:W.getTime()),se=be==="x"?re:Bt,Ut=Math.abs(se)/H;if(Math.abs(se)>=ls||Ut>.11){xn(qe.current),c.onDismiss==null||c.onDismiss.call(c,c),k(be==="x"?re>0?"right":"left":Bt>0?"down":"up"),Ne(),Ge(!0);return}else{var he,pe;(he=Ee.current)==null||he.style.setProperty("--swipe-amount-x","0px"),(pe=Ee.current)==null||pe.style.setProperty("--swipe-amount-y","0px")}He(!1),N(!1),ee(null)},onPointerMove:E=>{var G,W,re;if(!We.current||!Je||((G=window.getSelection())==null?void 0:G.toString().length)>0)return;const H=E.clientY-We.current.y,se=E.clientX-We.current.x;var Ut;const he=(Ut=e.swipeDirections)!=null?Ut:us(te);!be&&(Math.abs(se)>1||Math.abs(H)>1)&&ee(Math.abs(se)>Math.abs(H)?"x":"y");let pe={x:0,y:0};const jo=Ze=>1/(1.5+Math.abs(Ze)/20);if(be==="y"){if(he.includes("top")||he.includes("bottom"))if(he.includes("top")&&H<0||he.includes("bottom")&&H>0)pe.y=H;else{const Ze=H*jo(H);pe.y=Math.abs(Ze)<Math.abs(H)?Ze:H}}else if(be==="x"&&(he.includes("left")||he.includes("right")))if(he.includes("left")&&se<0||he.includes("right")&&se>0)pe.x=se;else{const Ze=se*jo(se);pe.x=Math.abs(Ze)<Math.abs(se)?Ze:se}(Math.abs(pe.x)>0||Math.abs(pe.y)>0)&&He(!0),(W=Ee.current)==null||W.style.setProperty("--swipe-amount-x",`${pe.x}px`),(re=Ee.current)==null||re.style.setProperty("--swipe-amount-y",`${pe.y}px`)}},Ud&&!c.jsx&&ne!=="loading"?h.createElement("button",{"aria-label":de,"data-disabled":zn,"data-close-button":!0,onClick:zn||!Je?()=>{}:()=>{Ne(),c.onDismiss==null||c.onDismiss.call(c,c)},className:fe(A?.closeButton,c==null||(r=c.classNames)==null?void 0:r.closeButton)},(Oo=Y?.close)!=null?Oo:qo):null,(ne||c.icon||c.promise)&&c.icon!==null&&(Y?.[ne]!==null||c.icon)?h.createElement("div",{"data-icon":"",className:fe(A?.icon,c==null||(o=c.classNames)==null?void 0:o.icon)},c.promise||c.type==="loading"&&!c.icon?c.icon||Hd():null,c.type!=="loading"?Jd:null):null,h.createElement("div",{"data-content":"",className:fe(A?.content,c==null||(s=c.classNames)==null?void 0:s.content)},h.createElement("div",{"data-title":"",className:fe(A?.title,c==null||(i=c.classNames)==null?void 0:i.title)},c.jsx?c.jsx:typeof c.title=="function"?c.title():c.title),c.description?h.createElement("div",{"data-description":"",className:fe(ut,Bd,A?.description,c==null||(a=c.classNames)==null?void 0:a.description)},typeof c.description=="function"?c.description():c.description):null),h.isValidElement(c.cancel)?c.cancel:c.cancel&&pt(c.cancel)?h.createElement("button",{"data-button":!0,"data-cancel":!0,style:c.cancelButtonStyle||ue,onClick:E=>{pt(c.cancel)&&Je&&(c.cancel.onClick==null||c.cancel.onClick.call(c.cancel,E),Ne())},className:fe(A?.cancelButton,c==null||(u=c.classNames)==null?void 0:u.cancelButton)},c.cancel.label):null,h.isValidElement(c.action)?c.action:c.action&&pt(c.action)?h.createElement("button",{"data-button":!0,"data-action":!0,style:c.actionButtonStyle||Ie,onClick:E=>{pt(c.action)&&(c.action.onClick==null||c.action.onClick.call(c.action,E),!E.defaultPrevented&&Ne())},className:fe(A?.actionButton,c==null||(l=c.classNames)==null?void 0:l.actionButton)},c.action.label):null)};function In(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function hs(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",a=s?ss:os;function u(l){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${i}-${l}`]=a:n[`${i}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):u(a)}),n}const ps=h.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:u,className:l,offset:d,mobileOffset:c,theme:m="light",richColors:b,duration:v,style:D,visibleToasts:z=rs,toastOptions:w,dir:ce=In(),gap:B=as,icons:$,containerAriaLabel:I="Notifications"}=t,[V,ge]=h.useState([]),ue=h.useMemo(()=>r?V.filter(y=>y.toasterId===r):V.filter(y=>!y.toasterId),[V,r]),Ie=h.useMemo(()=>Array.from(new Set([s].concat(ue.filter(y=>y.position).map(y=>y.position)))),[ue,s]),[Ve,ut]=h.useState([]),[we,te]=h.useState(!1),[Ye,xe]=h.useState(!1),[A,Y]=h.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),de=h.useRef(null),be=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=h.useRef(null),g=h.useRef(!1),k=h.useCallback(y=>{ge(x=>{var Z;return(Z=x.find(q=>q.id===y.id))!=null&&Z.delete||X.dismiss(y.id),x.filter(({id:q})=>q!==y.id)})},[]);return h.useEffect(()=>X.subscribe(y=>{if(y.dismiss){requestAnimationFrame(()=>{ge(x=>x.map(Z=>Z.id===y.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{$n.flushSync(()=>{ge(x=>{const Z=x.findIndex(q=>q.id===y.id);return Z!==-1?[...x.slice(0,Z),{...x[Z],...y},...x.slice(Z+1)]:[y,...x]})})})}),[V]),h.useEffect(()=>{if(m!=="system"){Y(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const y=window.matchMedia("(prefers-color-scheme: dark)");try{y.addEventListener("change",({matches:x})=>{Y(x?"dark":"light")})}catch{y.addListener(({matches:Z})=>{try{Y(Z?"dark":"light")}catch(q){console.error(q)}})}},[m]),h.useEffect(()=>{V.length<=1&&te(!1)},[V]),h.useEffect(()=>{const y=x=>{var Z;if(i.every(N=>x[N]||x.code===N)){var C;te(!0),(C=de.current)==null||C.focus()}x.code==="Escape"&&(document.activeElement===de.current||(Z=de.current)!=null&&Z.contains(document.activeElement))&&te(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[i]),h.useEffect(()=>{if(de.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,g.current=!1)}},[de.current]),h.createElement("section",{ref:n,"aria-label":`${I} ${be}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Ie.map((y,x)=>{var Z;const[q,C]=y.split("-");return ue.length?h.createElement("ol",{key:y,dir:ce==="auto"?In():ce,tabIndex:-1,ref:de,className:l,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":q,"data-x-position":C,style:{"--front-toast-height":`${((Z=Ve[0])==null?void 0:Z.height)||0}px`,"--width":`${is}px`,"--gap":`${B}px`,...D,...hs(d,c)},onBlur:N=>{g.current&&!N.currentTarget.contains(N.relatedTarget)&&(g.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:N=>{N.target instanceof HTMLElement&&N.target.dataset.dismissible==="false"||g.current||(g.current=!0,ee.current=N.relatedTarget)},onMouseEnter:()=>te(!0),onMouseMove:()=>te(!0),onMouseLeave:()=>{Ye||te(!1)},onDragEnd:()=>te(!1),onPointerDown:N=>{N.target instanceof HTMLElement&&N.target.dataset.dismissible==="false"||xe(!0)},onPointerUp:()=>xe(!1)},ue.filter(N=>!N.position&&x===0||N.position===y).map((N,ve)=>{var Ge,Mt;return h.createElement(ds,{key:N.id,icons:$,index:ve,toast:N,defaultRichColors:b,duration:(Ge=w?.duration)!=null?Ge:v,className:w?.className,descriptionClassName:w?.descriptionClassName,invert:o,visibleToasts:z,closeButton:(Mt=w?.closeButton)!=null?Mt:u,interacting:Ye,position:y,style:w?.style,unstyled:w?.unstyled,classNames:w?.classNames,cancelButtonStyle:w?.cancelButtonStyle,actionButtonStyle:w?.actionButtonStyle,closeButtonAriaLabel:w?.closeButtonAriaLabel,removeToast:k,toasts:ue.filter(He=>He.position==N.position),heights:Ve.filter(He=>He.position==N.position),setHeights:ut,expandByDefault:a,gap:B,expanded:we,swipeDirections:t.swipeDirections})})):null}))});var Zn;function f(e,t,n){function r(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);const l=i.prototype,d=Object.keys(l);for(let c=0;c<d.length;c++){const m=d[c];m in a||(a[m]=l[m].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var u;const l=n?.Parent?new s:this;r(l,a),(u=l._zod).deferred??(u.deferred=[]);for(const d of l._zod.deferred)d();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Ce extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Cn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Zn=globalThis).__zod_globalConfig??(Zn.__zod_globalConfig={});const Gt=globalThis.__zod_globalConfig;function _e(e){return Gt}function Rn(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Ht(e,t){return typeof t=="bigint"?t.toString():t}function Jt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function qt(e){return e==null}function Wt(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function fs(e,t){const n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}const Ln=Symbol("evaluating");function P(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ln)return r===void 0&&(r=Ln,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Oe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ze(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Dn(e){return JSON.stringify(e)}function ms(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Mn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ft(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const gs=Jt(()=>{if(Gt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Re(e){if(ft(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ft(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Fn(e){return Re(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const bs=new Set(["string","number","symbol"]);function mt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Se(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function _(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function vs(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _s={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ys(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=ze(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return Oe(this,"shape",i),i},checks:[]});return Se(e,s)}function ks(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=ze(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Oe(this,"shape",i),i},checks:[]});return Se(e,s)}function ws(e,t){if(!Re(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=ze(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Oe(this,"shape",s),s}});return Se(e,o)}function xs(e,t){if(!Re(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ze(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Oe(this,"shape",r),r}});return Se(e,n)}function Es(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=ze(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Oe(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Se(e,n)}function zs(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=ze(t._zod.def,{get shape(){const a=t._zod.def.shape,u={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)u[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return Oe(this,"shape",u),u},checks:[]});return Se(t,i)}function Ss(e,t,n){const r=ze(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Oe(this,"shape",s),s}});return Se(t,r)}function Le(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ts(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function De(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function gt(e){return typeof e=="string"?e:e?.message}function ye(e,t,n){const r=e.message?e.message:gt(e.inst?._zod.def?.error?.(e))??gt(t?.error?.(e))??gt(n.customError?.(e))??gt(n.localeError?.(e))??"Invalid input",{inst:o,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=i),a}function Kt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function et(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Bn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ht,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Un=f("$ZodError",Bn),Vn=f("$ZodError",Bn,{Parent:Error});function $s(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Ns(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let u=n,l=0;for(;l<a.length;){const d=a[l];l===a.length-1?(u[d]=u[d]||{_errors:[]},u[d]._errors.push(t(i))):u[d]=u[d]||{_errors:[]},u=u[d],l++}}}};return r(e),n}const Xt=e=>(t,n,r,o)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Ce;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(u=>ye(u,s,_e())));throw Mn(a,o?.callee),a}return i.value},Qt=e=>async(t,n,r,o)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(u=>ye(u,s,_e())));throw Mn(a,o?.callee),a}return i.value},bt=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Ce;return s.issues.length?{success:!1,error:new(e??Un)(s.issues.map(i=>ye(i,o,_e())))}:{success:!0,data:s.value}},Os=bt(Vn),vt=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>ye(i,o,_e())))}:{success:!0,data:s.value}},js=vt(Vn),As=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Xt(e)(t,n,o)},Ps=e=>(t,n,r)=>Xt(e)(t,n,r),Is=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Qt(e)(t,n,o)},Zs=e=>async(t,n,r)=>Qt(e)(t,n,r),Cs=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return bt(e)(t,n,o)},Rs=e=>(t,n,r)=>bt(e)(t,n,r),Ls=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return vt(e)(t,n,o)},Ds=e=>async(t,n,r)=>vt(e)(t,n,r),Ms=/^[cC][0-9a-z]{6,}$/,Fs=/^[0-9a-z]+$/,Bs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Us=/^[0-9a-vA-V]{20}$/,Vs=/^[A-Za-z0-9]{27}$/,Ys=/^[a-zA-Z0-9_-]{21}$/,Gs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Yn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Js=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ws(){return new RegExp(qs,"u")}const Ks=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Xs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qs=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ei=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ti=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Gn=/^[A-Za-z0-9_-]*$/,ni=/^https?$/,ri=/^\+[1-9]\d{6,14}$/,Hn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",oi=new RegExp(`^${Hn}$`);function Jn(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function si(e){return new RegExp(`^${Jn(e)}$`)}function ii(e){const t=Jn({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Hn}T(?:${r})$`)}const ai=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},li=/^-?\d+$/,qn=/^-?\d+(?:\.\d+)?$/,ci=/^[^A-Z]*$/,ui=/^[^a-z]*$/,Q=f("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Wn={number:"number",bigint:"bigint",object:"date"},Kn=f("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);const n=Wn[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xn=f("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);const n=Wn[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),di=f("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):fs(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),hi=f("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=_s[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,n&&(a.pattern=li)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),pi=f("$ZodCheckMaxLength",(e,t)=>{var n;Q.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!qt(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Kt(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),fi=f("$ZodCheckMinLength",(e,t)=>{var n;Q.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!qt(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Kt(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),mi=f("$ZodCheckLengthEquals",(e,t)=>{var n;Q.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!qt(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=Kt(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),_t=f("$ZodCheckStringFormat",(e,t)=>{var n,r;Q.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),gi=f("$ZodCheckRegex",(e,t)=>{_t.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),bi=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ci),_t.init(e,t)}),vi=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ui),_t.init(e,t)}),_i=f("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);const n=mt(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),yi=f("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);const n=new RegExp(`^${mt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ki=f("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);const n=new RegExp(`.*${mt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),wi=f("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class xi{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
7
+ `).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
8
+ `))}}const Ei={major:4,minor:4,patch:3},M=f("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ei;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,u)=>{let l=Le(i),d;for(const c of a){if(c._zod.def.when){if(Ts(i)||!c._zod.def.when(i))continue}else if(l)continue;const m=i.issues.length,b=c._zod.check(i);if(b instanceof Promise&&u?.async===!1)throw new Ce;if(d||b instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await b,i.issues.length!==m&&(l||(l=Le(i,m)))});else{if(i.issues.length===m)continue;l||(l=Le(i,m))}}return d?d.then(()=>i):i},s=(i,a,u)=>{if(Le(i))return i.aborted=!0,i;const l=o(a,r,u);if(l instanceof Promise){if(u.async===!1)throw new Ce;return l.then(d=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const l=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(d=>s(d,i,a)):s(l,i,a)}const u=e._zod.parse(i,a);if(u instanceof Promise){if(a.async===!1)throw new Ce;return u.then(l=>o(l,r,a))}return o(u,r,a)}}P(e,"~standard",()=>({validate:o=>{try{const s=Os(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return js(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),en=f("$ZodString",(e,t)=>{M.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ai(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),R=f("$ZodStringFormat",(e,t)=>{_t.init(e,t),en.init(e,t)}),zi=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Hs),R.init(e,t)}),Si=f("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Yn(r))}else t.pattern??(t.pattern=Yn());R.init(e,t)}),Ti=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Js),R.init(e,t)}),$i=f("$ZodURL",(e,t)=>{R.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===ni.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ni=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ws()),R.init(e,t)}),Oi=f("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ys),R.init(e,t)}),ji=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ms),R.init(e,t)}),Ai=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Fs),R.init(e,t)}),Pi=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Bs),R.init(e,t)}),Ii=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Us),R.init(e,t)}),Zi=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Vs),R.init(e,t)}),Ci=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ii(t)),R.init(e,t)}),Ri=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=oi),R.init(e,t)}),Li=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=si(t)),R.init(e,t)}),Di=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Gs),R.init(e,t)}),Mi=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ks),R.init(e,t),e._zod.bag.format="ipv4"}),Fi=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Xs),R.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Bi=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Qs),R.init(e,t)}),Ui=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ei),R.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Qn(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Vi=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ti),R.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Qn(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Yi(e){if(!Gn.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Qn(n)}const Gi=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Gn),R.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Yi(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Hi=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ri),R.init(e,t)});function Ji(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const qi=f("$ZodJWT",(e,t)=>{R.init(e,t),e._zod.check=n=>{Ji(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),er=f("$ZodNumber",(e,t)=>{M.init(e,t),e._zod.pattern=e._zod.bag.pattern??qn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),Wi=f("$ZodNumberFormat",(e,t)=>{hi.init(e,t),er.init(e,t)}),Ki=f("$ZodUnknown",(e,t)=>{M.init(e,t),e._zod.parse=n=>n}),Xi=f("$ZodNever",(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function tr(e,t,n){e.issues.length&&t.issues.push(...De(n,e.issues)),t.value[n]=e.value}const Qi=f("$ZodArray",(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],u=t.element._zod.run({value:a,issues:[]},r);u instanceof Promise?s.push(u.then(l=>tr(l,n,i))):tr(u,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function yt(e,t,n,r,o,s){const i=n in r;if(e.issues.length){if(o&&s&&!i)return;t.issues.push(...De(n,e.issues))}if(!i&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?i&&(t.value[n]=void 0):t.value[n]=e.value}function nr(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=vs(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function rr(e,t,n,r,o,s){const i=[],a=o.keySet,u=o.catchall._zod,l=u.def.type,d=u.optin==="optional",c=u.optout==="optional";for(const m in t){if(m==="__proto__"||a.has(m))continue;if(l==="never"){i.push(m);continue}const b=u.run({value:t[m],issues:[]},r);b instanceof Promise?e.push(b.then(v=>yt(v,n,m,t,d,c))):yt(b,n,m,t,d,c)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const ea=f("$ZodObject",(e,t)=>{if(M.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...a};return Object.defineProperty(t,"shape",{value:u}),u}})}const r=Jt(()=>nr(t));P(e._zod,"propValues",()=>{const a=t.shape,u={};for(const l in a){const d=a[l]._zod;if(d.values){u[l]??(u[l]=new Set);for(const c of d.values)u[l].add(c)}}return u});const o=ft,s=t.catchall;let i;e._zod.parse=(a,u)=>{i??(i=r.value);const l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const d=[],c=i.shape;for(const m of i.keys){const b=c[m],v=b._zod.optin==="optional",D=b._zod.optout==="optional",z=b._zod.run({value:l[m],issues:[]},u);z instanceof Promise?d.push(z.then(w=>yt(w,a,m,l,v,D))):yt(z,a,m,l,v,D)}return s?rr(d,l,a,u,r.value,e):d.length?Promise.all(d).then(()=>a):a}}),ta=f("$ZodObjectJIT",(e,t)=>{ea.init(e,t);const n=e._zod.parse,r=Jt(()=>nr(t)),o=m=>{const b=new xi(["shape","payload","ctx"]),v=r.value,D=B=>{const $=Dn(B);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};b.write("const input = payload.value;");const z=Object.create(null);let w=0;for(const B of v.keys)z[B]=`key_${w++}`;b.write("const newResult = {};");for(const B of v.keys){const $=z[B],I=Dn(B),V=m[B],ge=V?._zod?.optin==="optional",ue=V?._zod?.optout==="optional";b.write(`const ${$} = ${D(B)};`),ge&&ue?b.write(`
9
+ if (${$}.issues.length) {
10
+ if (${I} in input) {
11
+ payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
12
12
  ...iss,
13
- path: iss.path ? [${P}, ...iss.path] : [${P}]
13
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
14
14
  })));
15
15
  }
16
16
  }
17
17
 
18
- if (${j}.value === undefined) {
19
- if (${P} in input) {
20
- newResult[${P}] = undefined;
18
+ if (${$}.value === undefined) {
19
+ if (${I} in input) {
20
+ newResult[${I}] = undefined;
21
21
  }
22
22
  } else {
23
- newResult[${P}] = ${j}.value;
23
+ newResult[${I}] = ${$}.value;
24
24
  }
25
25
 
26
26
  `):ge?b.write(`
27
- if (${j}.issues.length) {
28
- payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
27
+ if (${$}.issues.length) {
28
+ payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
29
29
  ...iss,
30
- path: iss.path ? [${P}, ...iss.path] : [${P}]
30
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
31
31
  })));
32
32
  }
33
33
 
34
- if (${j}.value === undefined) {
35
- if (${P} in input) {
36
- newResult[${P}] = undefined;
34
+ if (${$}.value === undefined) {
35
+ if (${I} in input) {
36
+ newResult[${I}] = undefined;
37
37
  }
38
38
  } else {
39
- newResult[${P}] = ${j}.value;
39
+ newResult[${I}] = ${$}.value;
40
40
  }
41
41
 
42
42
  `):b.write(`
43
- const ${j}_present = ${P} in input;
44
- if (${j}.issues.length) {
45
- payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
43
+ const ${$}_present = ${I} in input;
44
+ if (${$}.issues.length) {
45
+ payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
46
46
  ...iss,
47
- path: iss.path ? [${P}, ...iss.path] : [${P}]
47
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
48
48
  })));
49
49
  }
50
- if (!${j}_present && !${j}.issues.length) {
50
+ if (!${$}_present && !${$}.issues.length) {
51
51
  payload.issues.push({
52
52
  code: "invalid_type",
53
53
  expected: "nonoptional",
54
54
  input: undefined,
55
- path: [${P}]
55
+ path: [${I}]
56
56
  });
57
57
  }
58
58
 
59
- if (${j}_present) {
60
- if (${j}.value === undefined) {
61
- newResult[${P}] = undefined;
59
+ if (${$}_present) {
60
+ if (${$}.value === undefined) {
61
+ newResult[${I}] = undefined;
62
62
  } else {
63
- newResult[${P}] = ${j}.value;
63
+ newResult[${I}] = ${$}.value;
64
64
  }
65
65
  }
66
66
 
67
- `)}b.write("payload.value = newResult;"),b.write("return payload;");const ce=b.compile();return(B,j)=>ce(m,B,j)};let o;const i=pt,a=!Yt.jitless,l=a&&ho.value,h=t.catchall;let c;e._zod.parse=(m,b)=>{c??(c=r.value);const _=m.value;return i(_)?a&&l&&b?.async===!1&&b.jitless!==!0?(o||(o=s(t.shape)),m=o(m,b),h?rr([],_,m,b,c,e):m):n(m,b):(m.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),m)}});function sr(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!Le(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(i=>we(i,r,ve())))}),t)}const Xi=p("$ZodUnion",(e,t)=>{M.init(e,t),O(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),O(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),O(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),O(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>Wt(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(n)return n(r,s);let o=!1;const i=[];for(const a of t.options){const u=a._zod.run({value:r.value,issues:[]},s);if(u instanceof Promise)i.push(u),o=!0;else{if(u.issues.length===0)return u;i.push(u)}}return o?Promise.all(i).then(a=>sr(a,r,e,s)):sr(i,r,e,s)}}),Qi=p("$ZodIntersection",(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,o=t.left._zod.run({value:s,issues:[]},r),i=t.right._zod.run({value:s,issues:[]},r);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([u,l])=>or(n,u,l)):or(n,o,i)}});function tn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ce(e)&&Ce(t)){const n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),s={...e,...t};for(const o of r){const i=tn(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};s[o]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],o=t[r],i=tn(s,o);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function or(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const u of a.keys)r.has(u)||r.set(u,{}),r.get(u).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const u of a.keys)r.has(u)||r.set(u,{}),r.get(u).r=!0;else e.issues.push(a);const o=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&s&&e.issues.push({...s,keys:o}),Le(e))return e;const i=tn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const ea=p("$ZodRecord",(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Ce(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const o=[],i=t.keyType._zod.values;if(i){n.value={};const a=new Set;for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);const h=t.keyType._zod.run({value:l,issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(b=>we(b,r,ve())),input:l,path:[l],inst:e});continue}const c=h.value,m=t.valueType._zod.run({value:s[l],issues:[]},r);m instanceof Promise?o.push(m.then(b=>{b.issues.length&&n.issues.push(...De(l,b.issues)),n.value[c]=b.value})):(m.issues.length&&n.issues.push(...De(l,m.issues)),n.value[c]=m.value)}let u;for(const l in s)a.has(l)||(u=u??[],u.push(l));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,a))continue;let u=t.keyType._zod.run({value:a,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&qn.test(a)&&u.issues.length){const c=t.keyType._zod.run({value:Number(a),issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");c.issues.length===0&&(u=c)}if(u.issues.length){t.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(c=>we(c,r,ve())),input:a,path:[a],inst:e});continue}const h=t.valueType._zod.run({value:s[a],issues:[]},r);h instanceof Promise?o.push(h.then(c=>{c.issues.length&&n.issues.push(...De(a,c.issues)),n.value[u.value]=c.value})):(h.issues.length&&n.issues.push(...De(a,h.issues)),n.value[u.value]=h.value)}}return o.length?Promise.all(o).then(()=>n):n}}),ta=p("$ZodEnum",(e,t)=>{M.init(e,t);const n=Cn(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>fo.has(typeof s)).map(s=>typeof s=="string"?mt(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const i=s.value;return r.has(i)||s.issues.push({code:"invalid_value",values:n,input:i,inst:e}),s}}),na=p("$ZodTransform",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Zn(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(n.value=i,n.fallback=!0,n));if(s instanceof Promise)throw new Ze;return n.value=s,n.fallback=!0,n}});function ir(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const ar=p("$ZodOptional",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.optout="optional",O(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),O(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Wt(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ir(i,s)):ir(o,s)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),ra=p("$ZodExactOptional",(e,t)=>{ar.init(e,t),O(e._zod,"values",()=>t.innerType._zod.values),O(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),sa=p("$ZodNullable",(e,t)=>{M.init(e,t),O(e._zod,"optin",()=>t.innerType._zod.optin),O(e._zod,"optout",()=>t.innerType._zod.optout),O(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Wt(n.source)}|null)$`):void 0}),O(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),oa=p("$ZodDefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>lr(o,t)):lr(s,t)}});function lr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ia=p("$ZodPrefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),aa=p("$ZodNonOptional",(e,t)=>{M.init(e,t),O(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>cr(o,e)):cr(s,e)}});function cr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const la=p("$ZodCatch",(e,t)=>{M.init(e,t),e._zod.optin="optional",O(e._zod,"optout",()=>t.innerType._zod.optout),O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>we(i,r,ve()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>we(o,r,ve()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),ca=p("$ZodPipe",(e,t)=>{M.init(e,t),O(e._zod,"values",()=>t.in._zod.values),O(e._zod,"optin",()=>t.in._zod.optin),O(e._zod,"optout",()=>t.out._zod.optout),O(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(i=>xt(i,t.in,r)):xt(o,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(o=>xt(o,t.out,r)):xt(s,t.out,r)}});function xt(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const ua=p("$ZodReadonly",(e,t)=>{M.init(e,t),O(e._zod,"propValues",()=>t.innerType._zod.propValues),O(e._zod,"values",()=>t.innerType._zod.values),O(e._zod,"optin",()=>t.innerType?._zod?.optin),O(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(ur):ur(s)}});function ur(e){return e.value=Object.freeze(e.value),e}const da=p("$ZodCustom",(e,t)=>{Q.init(e,t),M.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(o=>dr(o,n,r,e));dr(s,n,r,e)}});function dr(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(et(s))}}var hr;class ha{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fa(){return new ha}(hr=globalThis).__zod_globalRegistry??(hr.__zod_globalRegistry=fa());const tt=globalThis.__zod_globalRegistry;function pa(e,t){return new e({type:"string",...v(t)})}function ma(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function fr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...v(t)})}function ga(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function ba(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...v(t)})}function _a(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...v(t)})}function va(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...v(t)})}function wa(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function xa(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...v(t)})}function ya(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...v(t)})}function ka(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...v(t)})}function za(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...v(t)})}function Ea(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...v(t)})}function Ta(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...v(t)})}function Sa(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...v(t)})}function $a(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function ja(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function Ra(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...v(t)})}function Na(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...v(t)})}function Oa(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...v(t)})}function Aa(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...v(t)})}function Pa(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...v(t)})}function Ia(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...v(t)})}function Za(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function Ca(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function La(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function Da(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function Ma(e,t){return new e({type:"number",checks:[],...v(t)})}function Fa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function Ba(e){return new e({type:"unknown"})}function Ua(e,t){return new e({type:"never",...v(t)})}function pr(e,t){return new Kn({check:"less_than",...v(t),value:e,inclusive:!1})}function nn(e,t){return new Kn({check:"less_than",...v(t),value:e,inclusive:!0})}function mr(e,t){return new Xn({check:"greater_than",...v(t),value:e,inclusive:!1})}function rn(e,t){return new Xn({check:"greater_than",...v(t),value:e,inclusive:!0})}function gr(e,t){return new ai({check:"multiple_of",...v(t),value:e})}function br(e,t){return new ci({check:"max_length",...v(t),maximum:e})}function yt(e,t){return new ui({check:"min_length",...v(t),minimum:e})}function _r(e,t){return new di({check:"length_equals",...v(t),length:e})}function Va(e,t){return new hi({check:"string_format",format:"regex",...v(t),pattern:e})}function Ga(e){return new fi({check:"string_format",format:"lowercase",...v(e)})}function Ya(e){return new pi({check:"string_format",format:"uppercase",...v(e)})}function Ha(e,t){return new mi({check:"string_format",format:"includes",...v(t),includes:e})}function Ja(e,t){return new gi({check:"string_format",format:"starts_with",...v(t),prefix:e})}function qa(e,t){return new bi({check:"string_format",format:"ends_with",...v(t),suffix:e})}function Me(e){return new _i({check:"overwrite",tx:e})}function Wa(e){return Me(t=>t.normalize(e))}function Ka(){return Me(e=>e.trim())}function Xa(){return Me(e=>e.toLowerCase())}function Qa(){return Me(e=>e.toUpperCase())}function el(){return Me(e=>uo(e))}function tl(e,t,n){return new e({type:"array",element:t,...v(n)})}function nl(e,t,n){return new e({type:"custom",check:"custom",fn:t,...v(n)})}function rl(e,t){const n=sl(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(et(s,r.value,n._zod.def));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),r.issues.push(et(o))}},e(r.value,r)),t);return n}function sl(e,t){const n=new Q({check:"custom",...v(t)});return n._zod.check=e,n}function vr(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??tt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function U(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const h={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,h);else{const m=i.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,m,h)}const c=e._zod.parent;c&&(i.ref||(i.ref=c),U(c,t,h),t.seen.get(c).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(i.schema,u),t.io==="input"&&K(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function wr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const u=r.get(a);if(u&&u!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const s=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const c=e.external.registry.get(i[0])?.id,m=e.external.uri??(_=>_);if(c)return{ref:m(c)};const b=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=b,{defId:b,ref:`${m("__shared")}#/${a}/${b}`}}if(i[1]===n)return{ref:"#"};const l=`#/${a}/`,h=i[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:l+h}},o=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:u,defId:l}=s(i);a.def={...a.schema},l&&(a.defId=l);const h=a.schema;for(const c in h)delete h[c];h.$ref=u};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
67
+ `)}b.write("payload.value = newResult;"),b.write("return payload;");const ce=b.compile();return(B,$)=>ce(m,B,$)};let s;const i=ft,a=!Gt.jitless,l=a&&gs.value,d=t.catchall;let c;e._zod.parse=(m,b)=>{c??(c=r.value);const v=m.value;return i(v)?a&&l&&b?.async===!1&&b.jitless!==!0?(s||(s=o(t.shape)),m=s(m,b),d?rr([],v,m,b,c,e):m):n(m,b):(m.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),m)}});function or(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Le(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>ye(i,r,_e())))}),t)}const na=f("$ZodUnion",(e,t)=>{M.init(e,t),P(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),P(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),P(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),P(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Wt(o.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const a of t.options){const u=a._zod.run({value:r.value,issues:[]},o);if(u instanceof Promise)i.push(u),s=!0;else{if(u.issues.length===0)return u;i.push(u)}}return s?Promise.all(i).then(a=>or(a,r,e,o)):or(i,r,e,o)}}),ra=f("$ZodIntersection",(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([u,l])=>sr(n,u,l)):sr(n,s,i)}});function tn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Re(e)&&Re(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=tn(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=tn(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function sr(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const u of a.keys)r.has(u)||r.set(u,{}),r.get(u).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const u of a.keys)r.has(u)||r.set(u,{}),r.get(u).r=!0;else e.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),Le(e))return e;const i=tn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const oa=f("$ZodRecord",(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Re(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],i=t.keyType._zod.values;if(i){n.value={};const a=new Set;for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);const d=t.keyType._zod.run({value:l,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(b=>ye(b,r,_e())),input:l,path:[l],inst:e});continue}const c=d.value,m=t.valueType._zod.run({value:o[l],issues:[]},r);m instanceof Promise?s.push(m.then(b=>{b.issues.length&&n.issues.push(...De(l,b.issues)),n.value[c]=b.value})):(m.issues.length&&n.issues.push(...De(l,m.issues)),n.value[c]=m.value)}let u;for(const l in o)a.has(l)||(u=u??[],u.push(l));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:u})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,a))continue;let u=t.keyType._zod.run({value:a,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&qn.test(a)&&u.issues.length){const c=t.keyType._zod.run({value:Number(a),issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");c.issues.length===0&&(u=c)}if(u.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(c=>ye(c,r,_e())),input:a,path:[a],inst:e});continue}const d=t.valueType._zod.run({value:o[a],issues:[]},r);d instanceof Promise?s.push(d.then(c=>{c.issues.length&&n.issues.push(...De(a,c.issues)),n.value[u.value]=c.value})):(d.issues.length&&n.issues.push(...De(a,d.issues)),n.value[u.value]=d.value)}}return s.length?Promise.all(s).then(()=>n):n}}),sa=f("$ZodEnum",(e,t)=>{M.init(e,t);const n=Rn(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>bs.has(typeof o)).map(o=>typeof o=="string"?mt(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),ia=f("$ZodTransform",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Cn(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n.fallback=!0,n));if(o instanceof Promise)throw new Ce;return n.value=o,n.fallback=!0,n}});function ir(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const ar=f("$ZodOptional",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.optout="optional",P(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),P(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Wt(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=n.value,s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>ir(i,o)):ir(s,o)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),aa=f("$ZodExactOptional",(e,t)=>{ar.init(e,t),P(e._zod,"values",()=>t.innerType._zod.values),P(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),la=f("$ZodNullable",(e,t)=>{M.init(e,t),P(e._zod,"optin",()=>t.innerType._zod.optin),P(e._zod,"optout",()=>t.innerType._zod.optout),P(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Wt(n.source)}|null)$`):void 0}),P(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),ca=f("$ZodDefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",P(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>lr(s,t)):lr(o,t)}});function lr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ua=f("$ZodPrefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",P(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),da=f("$ZodNonOptional",(e,t)=>{M.init(e,t),P(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>cr(s,e)):cr(o,e)}});function cr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ha=f("$ZodCatch",(e,t)=>{M.init(e,t),e._zod.optin="optional",P(e._zod,"optout",()=>t.innerType._zod.optout),P(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>ye(i,r,_e()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>ye(s,r,_e()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),pa=f("$ZodPipe",(e,t)=>{M.init(e,t),P(e._zod,"values",()=>t.in._zod.values),P(e._zod,"optin",()=>t.in._zod.optin),P(e._zod,"optout",()=>t.out._zod.optout),P(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>kt(i,t.in,r)):kt(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>kt(s,t.out,r)):kt(o,t.out,r)}});function kt(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const fa=f("$ZodReadonly",(e,t)=>{M.init(e,t),P(e._zod,"propValues",()=>t.innerType._zod.propValues),P(e._zod,"values",()=>t.innerType._zod.values),P(e._zod,"optin",()=>t.innerType?._zod?.optin),P(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(ur):ur(o)}});function ur(e){return e.value=Object.freeze(e.value),e}const ma=f("$ZodCustom",(e,t)=>{Q.init(e,t),M.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>dr(s,n,r,e));dr(o,n,r,e)}});function dr(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(et(o))}}var hr;class ga{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ba(){return new ga}(hr=globalThis).__zod_globalRegistry??(hr.__zod_globalRegistry=ba());const tt=globalThis.__zod_globalRegistry;function va(e,t){return new e({type:"string",..._(t)})}function _a(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._(t)})}function pr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._(t)})}function ya(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._(t)})}function ka(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._(t)})}function wa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._(t)})}function xa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._(t)})}function Ea(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._(t)})}function za(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._(t)})}function Sa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._(t)})}function Ta(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._(t)})}function $a(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._(t)})}function Na(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._(t)})}function Oa(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._(t)})}function ja(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._(t)})}function Aa(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._(t)})}function Pa(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._(t)})}function Ia(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._(t)})}function Za(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._(t)})}function Ca(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._(t)})}function Ra(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._(t)})}function La(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._(t)})}function Da(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._(t)})}function Ma(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._(t)})}function Fa(e,t){return new e({type:"string",format:"date",check:"string_format",..._(t)})}function Ba(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._(t)})}function Ua(e,t){return new e({type:"string",format:"duration",check:"string_format",..._(t)})}function Va(e,t){return new e({type:"number",checks:[],..._(t)})}function Ya(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._(t)})}function Ga(e){return new e({type:"unknown"})}function Ha(e,t){return new e({type:"never",..._(t)})}function fr(e,t){return new Kn({check:"less_than",..._(t),value:e,inclusive:!1})}function nn(e,t){return new Kn({check:"less_than",..._(t),value:e,inclusive:!0})}function mr(e,t){return new Xn({check:"greater_than",..._(t),value:e,inclusive:!1})}function rn(e,t){return new Xn({check:"greater_than",..._(t),value:e,inclusive:!0})}function gr(e,t){return new di({check:"multiple_of",..._(t),value:e})}function br(e,t){return new pi({check:"max_length",..._(t),maximum:e})}function wt(e,t){return new fi({check:"min_length",..._(t),minimum:e})}function vr(e,t){return new mi({check:"length_equals",..._(t),length:e})}function Ja(e,t){return new gi({check:"string_format",format:"regex",..._(t),pattern:e})}function qa(e){return new bi({check:"string_format",format:"lowercase",..._(e)})}function Wa(e){return new vi({check:"string_format",format:"uppercase",..._(e)})}function Ka(e,t){return new _i({check:"string_format",format:"includes",..._(t),includes:e})}function Xa(e,t){return new yi({check:"string_format",format:"starts_with",..._(t),prefix:e})}function Qa(e,t){return new ki({check:"string_format",format:"ends_with",..._(t),suffix:e})}function Me(e){return new wi({check:"overwrite",tx:e})}function el(e){return Me(t=>t.normalize(e))}function tl(){return Me(e=>e.trim())}function nl(){return Me(e=>e.toLowerCase())}function rl(){return Me(e=>e.toUpperCase())}function ol(){return Me(e=>ms(e))}function sl(e,t,n){return new e({type:"array",element:t,..._(n)})}function il(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._(n)})}function al(e,t){const n=ll(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(et(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(et(s))}},e(r.value,r)),t);return n}function ll(e,t){const n=new Q({check:"custom",..._(t)});return n._zod.check=e,n}function _r(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??tt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function U(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{const m=i.schema,b=t.processors[o.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);b(e,t,m,d)}const c=e._zod.parent;c&&(i.ref||(i.ref=c),U(c,t,d),t.seen.get(c).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(i.schema,u),t.io==="input"&&K(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function yr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const u=r.get(a);if(u&&u!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const o=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const c=e.external.registry.get(i[0])?.id,m=e.external.uri??(v=>v);if(c)return{ref:m(c)};const b=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=b,{defId:b,ref:`${m("__shared")}#/${a}/${b}`}}if(i[1]===n)return{ref:"#"};const l=`#/${a}/`,d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:l+d}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:u,defId:l}=o(i);a.def={...a.schema},l&&(a.defId=l);const d=a.schema;for(const c in d)delete d[c];d.$ref=u};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
68
68
 
69
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){o(i);continue}if(e.external){const l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}if(a.count>1&&e.reused==="ref"){o(i);continue}}}function xr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const u=e.seen.get(a);if(u.ref===null)return;const l=u.def??u.schema,h={...l},c=u.ref;if(u.ref=null,c){r(c);const b=e.seen.get(c),_=b.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(_)):Object.assign(l,_),Object.assign(l,h),a._zod.parent===c)for(const S in l)S==="$ref"||S==="allOf"||S in h||delete l[S];if(_.$ref&&b.def)for(const S in l)S==="$ref"||S==="allOf"||S in b.def&&JSON.stringify(l[S])===JSON.stringify(b.def[S])&&delete l[S]}const m=a._zod.parent;if(m&&m!==c){r(m);const b=e.seen.get(m);if(b?.schema.$ref&&(l.$ref=b.schema.$ref,b.def))for(const _ in l)_==="$ref"||_==="allOf"||_ in b.def&&JSON.stringify(l[_])===JSON.stringify(b.def[_])&&delete l[_]}e.override({zodSchema:a,jsonSchema:l,path:u.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(a)}Object.assign(s,n.def??n.schema);const o=e.metadataRegistry.get(t)?.id;o!==void 0&&s.id===o&&delete s.id;const i=e.external?.defs??{};for(const a of e.seen.entries()){const u=a[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const a=JSON.parse(JSON.stringify(s));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:kt(t,"input",e.processors),output:kt(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function K(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return K(r.element,n);if(r.type==="set")return K(r.valueType,n);if(r.type==="lazy")return K(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return K(r.innerType,n);if(r.type==="intersection")return K(r.left,n)||K(r.right,n);if(r.type==="record"||r.type==="map")return K(r.keyType,n)||K(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:K(r.in,n)||K(r.out,n);if(r.type==="object"){for(const s in r.shape)if(K(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(K(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(K(s,n))return!0;return!!(r.rest&&K(r.rest,n))}return!1}const ol=(e,t={})=>n=>{const r=vr({...n,processors:t});return U(e,r),wr(r,e),xr(r,e)},kt=(e,t,n={})=>r=>{const{libraryOptions:s,target:o}=r??{},i=vr({...s??{},target:o,io:t,processors:n});return U(e,i),wr(i,e),xr(i,e)},il={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},al=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:o,maximum:i,format:a,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=il[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),l&&(s.contentEncoding=l),u&&u.size>0){const h=[...u];h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(c=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:c.source}))])}},ll=(e,t,n,r)=>{const s=n,{minimum:o,maximum:i,format:a,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:h}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number";const c=typeof h=="number"&&h>=(o??Number.NEGATIVE_INFINITY),m=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),b=t.target==="draft-04"||t.target==="openapi-3.0";c?b?(s.minimum=h,s.exclusiveMinimum=!0):s.exclusiveMinimum=h:typeof o=="number"&&(s.minimum=o),m?b?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l:typeof i=="number"&&(s.maximum=i),typeof u=="number"&&(s.multipleOf=u)},cl=(e,t,n,r)=>{n.not={}},ul=(e,t,n,r)=>{},dl=(e,t,n,r)=>{const s=e._zod.def,o=Cn(s.entries);o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),n.enum=o},hl=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},fl=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pl=(e,t,n,r)=>{const s=n,o=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=U(o.element,t,{...r,path:[...r.path,"items"]})},ml=(e,t,n,r)=>{const s=n,o=e._zod.def;s.type="object",s.properties={};const i=o.shape;for(const l in i)s.properties[l]=U(i[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(i)),u=new Set([...a].filter(l=>{const h=o.shape[l]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));u.size>0&&(s.required=Array.from(u)),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=U(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},gl=(e,t,n,r)=>{const s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,u)=>U(a,t,{...r,path:[...r.path,o?"oneOf":"anyOf",u]}));o?n.oneOf=i:n.anyOf=i},bl=(e,t,n,r)=>{const s=e._zod.def,o=U(s.left,t,{...r,path:[...r.path,"allOf",0]}),i=U(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,u=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];n.allOf=u},_l=(e,t,n,r)=>{const s=n,o=e._zod.def;s.type="object";const i=o.keyType,u=i._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){const h=U(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const c of u)s.patternProperties[c.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=U(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=U(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const l=i._zod.values;if(l){const h=[...l].filter(c=>typeof c=="string"||typeof c=="number");h.length>0&&(s.required=h)}},vl=(e,t,n,r)=>{const s=e._zod.def,o=U(s.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},wl=(e,t,n,r)=>{const s=e._zod.def;U(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType},xl=(e,t,n,r)=>{const s=e._zod.def;U(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},yl=(e,t,n,r)=>{const s=e._zod.def;U(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},kl=(e,t,n,r)=>{const s=e._zod.def;U(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},zl=(e,t,n,r)=>{const s=e._zod.def,o=s.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?o?s.out:s.in:s.out;U(i,t,r);const a=t.seen.get(e);a.ref=i},El=(e,t,n,r)=>{const s=e._zod.def;U(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,n.readOnly=!0},yr=(e,t,n,r)=>{const s=e._zod.def;U(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType},Tl=p("ZodISODateTime",(e,t)=>{Oi.init(e,t),D.init(e,t)});function Sl(e){return Za(Tl,e)}const $l=p("ZodISODate",(e,t)=>{Ai.init(e,t),D.init(e,t)});function jl(e){return Ca($l,e)}const Rl=p("ZodISOTime",(e,t)=>{Pi.init(e,t),D.init(e,t)});function Nl(e){return La(Rl,e)}const Ol=p("ZodISODuration",(e,t)=>{Ii.init(e,t),D.init(e,t)});function Al(e){return Da(Ol,e)}const se=p("ZodError",(e,t)=>{Un.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Eo(e,n)},flatten:{value:n=>zo(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ht,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ht,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Pl=Xt(se),Il=Qt(se),Zl=bt(se),Cl=_t(se),Ll=$o(se),Dl=jo(se),Ml=Ro(se),Fl=No(se),Bl=Oo(se),Ul=Ao(se),Vl=Po(se),Gl=Io(se),kr=new WeakMap;function nt(e,t,n){const r=Object.getPrototypeOf(e);let s=kr.get(r);if(s||(s=new Set,kr.set(r,s)),!s.has(t)){s.add(t);for(const o in n){const i=n[o];Object.defineProperty(r,o,{configurable:!0,enumerable:!1,get(){const a=i.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const F=p("ZodType",(e,t)=>(M.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:kt(e,"input"),output:kt(e,"output")}}),e.toJSONSchema=ol(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>Pl(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Zl(e,n,r),e.parseAsync=async(n,r)=>Il(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Cl(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Ll(e,n,r),e.decode=(n,r)=>Dl(e,n,r),e.encodeAsync=async(n,r)=>Ml(e,n,r),e.decodeAsync=async(n,r)=>Fl(e,n,r),e.safeEncode=(n,r)=>Bl(e,n,r),e.safeDecode=(n,r)=>Ul(e,n,r),e.safeEncodeAsync=async(n,r)=>Vl(e,n,r),e.safeDecodeAsync=async(n,r)=>Gl(e,n,r),nt(e,"ZodType",{check(...n){const r=this.def;return this.clone(Ee(r,{checks:[...r.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Te(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(Pc(n,r))},superRefine(n,r){return this.check(Ic(n,r))},overwrite(n){return this.check(Me(n))},optional(){return Zr(this)},exactOptional(){return xc(this)},nullable(){return Cr(this)},nullish(){return Zr(Cr(this))},nonoptional(n){return Sc(this,n)},array(){return pc(this)},or(n){return Or([this,n])},and(n){return bc(this,n)},transform(n){return Dr(this,vc(n))},default(n){return zc(this,n)},prefault(n){return Tc(this,n)},catch(n){return jc(this,n)},pipe(n){return Dr(this,n)},readonly(){return Oc(this)},describe(n){const r=this.clone();return tt.add(r,{description:n}),r},meta(...n){if(n.length===0)return tt.get(this);const r=this.clone();return tt.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return tt.get(e)?.description},configurable:!0}),e)),zr=p("_ZodString",(e,t)=>{en.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,s,o)=>al(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,nt(e,"_ZodString",{regex(...r){return this.check(Va(...r))},includes(...r){return this.check(Ha(...r))},startsWith(...r){return this.check(Ja(...r))},endsWith(...r){return this.check(qa(...r))},min(...r){return this.check(yt(...r))},max(...r){return this.check(br(...r))},length(...r){return this.check(_r(...r))},nonempty(...r){return this.check(yt(1,...r))},lowercase(r){return this.check(Ga(r))},uppercase(r){return this.check(Ya(r))},trim(){return this.check(Ka())},normalize(...r){return this.check(Wa(...r))},toLowerCase(){return this.check(Xa())},toUpperCase(){return this.check(Qa())},slugify(){return this.check(el())}})}),Yl=p("ZodString",(e,t)=>{en.init(e,t),zr.init(e,t),e.email=n=>e.check(ma(Hl,n)),e.url=n=>e.check(wa(Jl,n)),e.jwt=n=>e.check(Ia(cc,n)),e.emoji=n=>e.check(xa(ql,n)),e.guid=n=>e.check(fr(Er,n)),e.uuid=n=>e.check(ga(zt,n)),e.uuidv4=n=>e.check(ba(zt,n)),e.uuidv6=n=>e.check(_a(zt,n)),e.uuidv7=n=>e.check(va(zt,n)),e.nanoid=n=>e.check(ya(Wl,n)),e.guid=n=>e.check(fr(Er,n)),e.cuid=n=>e.check(ka(Kl,n)),e.cuid2=n=>e.check(za(Xl,n)),e.ulid=n=>e.check(Ea(Ql,n)),e.base64=n=>e.check(Oa(ic,n)),e.base64url=n=>e.check(Aa(ac,n)),e.xid=n=>e.check(Ta(ec,n)),e.ksuid=n=>e.check(Sa(tc,n)),e.ipv4=n=>e.check($a(nc,n)),e.ipv6=n=>e.check(ja(rc,n)),e.cidrv4=n=>e.check(Ra(sc,n)),e.cidrv6=n=>e.check(Na(oc,n)),e.e164=n=>e.check(Pa(lc,n)),e.datetime=n=>e.check(Sl(n)),e.date=n=>e.check(jl(n)),e.time=n=>e.check(Nl(n)),e.duration=n=>e.check(Al(n))});function xe(e){return pa(Yl,e)}const D=p("ZodStringFormat",(e,t)=>{C.init(e,t),zr.init(e,t)}),Hl=p("ZodEmail",(e,t)=>{ki.init(e,t),D.init(e,t)}),Er=p("ZodGUID",(e,t)=>{xi.init(e,t),D.init(e,t)}),zt=p("ZodUUID",(e,t)=>{yi.init(e,t),D.init(e,t)}),Jl=p("ZodURL",(e,t)=>{zi.init(e,t),D.init(e,t)}),ql=p("ZodEmoji",(e,t)=>{Ei.init(e,t),D.init(e,t)}),Wl=p("ZodNanoID",(e,t)=>{Ti.init(e,t),D.init(e,t)}),Kl=p("ZodCUID",(e,t)=>{Si.init(e,t),D.init(e,t)}),Xl=p("ZodCUID2",(e,t)=>{$i.init(e,t),D.init(e,t)}),Ql=p("ZodULID",(e,t)=>{ji.init(e,t),D.init(e,t)}),ec=p("ZodXID",(e,t)=>{Ri.init(e,t),D.init(e,t)}),tc=p("ZodKSUID",(e,t)=>{Ni.init(e,t),D.init(e,t)}),nc=p("ZodIPv4",(e,t)=>{Zi.init(e,t),D.init(e,t)}),rc=p("ZodIPv6",(e,t)=>{Ci.init(e,t),D.init(e,t)}),sc=p("ZodCIDRv4",(e,t)=>{Li.init(e,t),D.init(e,t)}),oc=p("ZodCIDRv6",(e,t)=>{Di.init(e,t),D.init(e,t)}),ic=p("ZodBase64",(e,t)=>{Mi.init(e,t),D.init(e,t)}),ac=p("ZodBase64URL",(e,t)=>{Bi.init(e,t),D.init(e,t)}),lc=p("ZodE164",(e,t)=>{Ui.init(e,t),D.init(e,t)}),cc=p("ZodJWT",(e,t)=>{Gi.init(e,t),D.init(e,t)}),Tr=p("ZodNumber",(e,t)=>{er.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,s,o)=>ll(e,r,s),nt(e,"ZodNumber",{gt(r,s){return this.check(mr(r,s))},gte(r,s){return this.check(rn(r,s))},min(r,s){return this.check(rn(r,s))},lt(r,s){return this.check(pr(r,s))},lte(r,s){return this.check(nn(r,s))},max(r,s){return this.check(nn(r,s))},int(r){return this.check(Sr(r))},safe(r){return this.check(Sr(r))},positive(r){return this.check(mr(0,r))},nonnegative(r){return this.check(rn(0,r))},negative(r){return this.check(pr(0,r))},nonpositive(r){return this.check(nn(0,r))},multipleOf(r,s){return this.check(gr(r,s))},step(r,s){return this.check(gr(r,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function rt(e){return Ma(Tr,e)}const uc=p("ZodNumberFormat",(e,t)=>{Yi.init(e,t),Tr.init(e,t)});function Sr(e){return Fa(uc,e)}const dc=p("ZodUnknown",(e,t)=>{Hi.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ul()});function $r(){return Ba(dc)}const hc=p("ZodNever",(e,t)=>{Ji.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>cl(e,n,r)});function jr(e){return Ua(hc,e)}const fc=p("ZodArray",(e,t)=>{qi.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>pl(e,n,r,s),e.element=t.element,nt(e,"ZodArray",{min(n,r){return this.check(yt(n,r))},nonempty(n){return this.check(yt(1,n))},max(n,r){return this.check(br(n,r))},length(n,r){return this.check(_r(n,r))},unwrap(){return this.element}})});function pc(e,t){return tl(fc,e,t)}const Rr=p("ZodObject",(e,t)=>{Ki.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ml(e,n,r,s),O(e,"shape",()=>t.shape),nt(e,"ZodObject",{keyof(){return Pr(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:$r()})},loose(){return this.clone({...this._zod.def,catchall:$r()})},strict(){return this.clone({...this._zod.def,catchall:jr()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return _o(this,n)},safeExtend(n){return vo(this,n)},merge(n){return wo(this,n)},pick(n){return go(this,n)},omit(n){return bo(this,n)},partial(...n){return xo(Ir,this,n[0])},required(...n){return yo(Lr,this,n[0])}})});function Nr(e,t){const n={type:"object",shape:e??{},...v(t)};return new Rr(n)}function sn(e,t){return new Rr({type:"object",shape:e,catchall:jr(),...v(t)})}const mc=p("ZodUnion",(e,t)=>{Xi.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>gl(e,n,r,s),e.options=t.options});function Or(e,t){return new mc({type:"union",options:e,...v(t)})}const gc=p("ZodIntersection",(e,t)=>{Qi.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bl(e,n,r,s)});function bc(e,t){return new gc({type:"intersection",left:e,right:t})}const Ar=p("ZodRecord",(e,t)=>{ea.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>_l(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function on(e,t,n){return!t||!t._zod?new Ar({type:"record",keyType:xe(),valueType:e,...v(t)}):new Ar({type:"record",keyType:e,valueType:t,...v(n)})}const an=p("ZodEnum",(e,t)=>{ta.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,s,o)=>dl(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const o={};for(const i of r)if(n.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new an({...t,checks:[],...v(s),entries:o})},e.exclude=(r,s)=>{const o={...t.entries};for(const i of r)if(n.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new an({...t,checks:[],...v(s),entries:o})}});function Pr(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new an({type:"enum",entries:n,...v(t)})}const _c=p("ZodTransform",(e,t)=>{na.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>fl(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Zn(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(et(o,n.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(et(i))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(o=>(n.value=o,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function vc(e){return new _c({type:"transform",transform:e})}const Ir=p("ZodOptional",(e,t)=>{ar.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yr(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Zr(e){return new Ir({type:"optional",innerType:e})}const wc=p("ZodExactOptional",(e,t)=>{ra.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yr(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function xc(e){return new wc({type:"optional",innerType:e})}const yc=p("ZodNullable",(e,t)=>{sa.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>vl(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Cr(e){return new yc({type:"nullable",innerType:e})}const kc=p("ZodDefault",(e,t)=>{oa.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>xl(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zc(e,t){return new kc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Fn(t)}})}const Ec=p("ZodPrefault",(e,t)=>{ia.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yl(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Tc(e,t){return new Ec({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Fn(t)}})}const Lr=p("ZodNonOptional",(e,t)=>{aa.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>wl(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Sc(e,t){return new Lr({type:"nonoptional",innerType:e,...v(t)})}const $c=p("ZodCatch",(e,t)=>{la.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>kl(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jc(e,t){return new $c({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Rc=p("ZodPipe",(e,t)=>{ca.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>zl(e,n,r,s),e.in=t.in,e.out=t.out});function Dr(e,t){return new Rc({type:"pipe",in:e,out:t})}const Nc=p("ZodReadonly",(e,t)=>{ua.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>El(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Oc(e){return new Nc({type:"readonly",innerType:e})}const Ac=p("ZodCustom",(e,t)=>{da.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,s)=>hl(e,n)});function Pc(e,t={}){return nl(Ac,e,t)}function Ic(e,t){return rl(e,t)}const Zc=Pr(["color","range"]),Cc=Nr({min:rt().optional(),max:rt().optional(),step:rt().optional()}),Lc=sn({value:Or([xe(),rt()]),widget:Zc,widgetOptions:Cc.optional()}),Dc=on(xe(),Lc),Mc=on(xe(),Dc),ln={min:0,max:100,step:1};function Fc(e){return{min:e?.min??ln.min,max:e?.max??ln.max,step:e?.step??ln.step}}function Bc(e){const t=Object.entries(e);if(t.length===0)return"";const n=s=>Object.entries(s).map(([o,i])=>` --${o}: ${i.value};`).join(`
70
- `);let r="";for(const[s,o]of t){if(s==="default"){r+=`:root {
71
- ${n(o)}
69
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function kr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const u=e.seen.get(a);if(u.ref===null)return;const l=u.def??u.schema,d={...l},c=u.ref;if(u.ref=null,c){r(c);const b=e.seen.get(c),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(v)):Object.assign(l,v),Object.assign(l,d),a._zod.parent===c)for(const z in l)z==="$ref"||z==="allOf"||z in d||delete l[z];if(v.$ref&&b.def)for(const z in l)z==="$ref"||z==="allOf"||z in b.def&&JSON.stringify(l[z])===JSON.stringify(b.def[z])&&delete l[z]}const m=a._zod.parent;if(m&&m!==c){r(m);const b=e.seen.get(m);if(b?.schema.$ref&&(l.$ref=b.schema.$ref,b.def))for(const v in l)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(l[v])===JSON.stringify(b.def[v])&&delete l[v]}e.override({zodSchema:a,jsonSchema:l,path:u.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&o.id===s&&delete o.id;const i=e.external?.defs??{};for(const a of e.seen.entries()){const u=a[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:xt(t,"input",e.processors),output:xt(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function K(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return K(r.element,n);if(r.type==="set")return K(r.valueType,n);if(r.type==="lazy")return K(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return K(r.innerType,n);if(r.type==="intersection")return K(r.left,n)||K(r.right,n);if(r.type==="record"||r.type==="map")return K(r.keyType,n)||K(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:K(r.in,n)||K(r.out,n);if(r.type==="object"){for(const o in r.shape)if(K(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(K(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(K(o,n))return!0;return!!(r.rest&&K(r.rest,n))}return!1}const cl=(e,t={})=>n=>{const r=_r({...n,processors:t});return U(e,r),yr(r,e),kr(r,e)},xt=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=_r({...o??{},target:s,io:t,processors:n});return U(e,i),yr(i,e),kr(i,e)},ul={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},dl=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=ul[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),l&&(o.contentEncoding=l),u&&u.size>0){const d=[...u];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(c=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:c.source}))])}},hl=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,format:a,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number";const c=typeof d=="number"&&d>=(s??Number.NEGATIVE_INFINITY),m=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),b=t.target==="draft-04"||t.target==="openapi-3.0";c?b?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d:typeof s=="number"&&(o.minimum=s),m?b?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l:typeof i=="number"&&(o.maximum=i),typeof u=="number"&&(o.multipleOf=u)},pl=(e,t,n,r)=>{n.not={}},fl=(e,t,n,r)=>{},ml=(e,t,n,r)=>{const o=e._zod.def,s=Rn(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},gl=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bl=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},vl=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=U(s.element,t,{...r,path:[...r.path,"items"]})},_l=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const l in i)o.properties[l]=U(i[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(i)),u=new Set([...a].filter(l=>{const d=s.shape[l]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(o.required=Array.from(u)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=U(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},yl=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,u)=>U(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",u]}));s?n.oneOf=i:n.anyOf=i},kl=(e,t,n,r)=>{const o=e._zod.def,s=U(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=U(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,u=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=u},wl=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const i=s.keyType,u=i._zod.bag?.patterns;if(s.mode==="loose"&&u&&u.size>0){const d=U(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const c of u)o.patternProperties[c.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=U(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=U(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const l=i._zod.values;if(l){const d=[...l].filter(c=>typeof c=="string"||typeof c=="number");d.length>0&&(o.required=d)}},xl=(e,t,n,r)=>{const o=e._zod.def,s=U(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},El=(e,t,n,r)=>{const o=e._zod.def;U(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},zl=(e,t,n,r)=>{const o=e._zod.def;U(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Sl=(e,t,n,r)=>{const o=e._zod.def;U(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Tl=(e,t,n,r)=>{const o=e._zod.def;U(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},$l=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;U(i,t,r);const a=t.seen.get(e);a.ref=i},Nl=(e,t,n,r)=>{const o=e._zod.def;U(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},wr=(e,t,n,r)=>{const o=e._zod.def;U(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Ol=f("ZodISODateTime",(e,t)=>{Ci.init(e,t),L.init(e,t)});function jl(e){return Ma(Ol,e)}const Al=f("ZodISODate",(e,t)=>{Ri.init(e,t),L.init(e,t)});function Pl(e){return Fa(Al,e)}const Il=f("ZodISOTime",(e,t)=>{Li.init(e,t),L.init(e,t)});function Zl(e){return Ba(Il,e)}const Cl=f("ZodISODuration",(e,t)=>{Di.init(e,t),L.init(e,t)});function Rl(e){return Ua(Cl,e)}const oe=f("ZodError",(e,t)=>{Un.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Ns(e,n)},flatten:{value:n=>$s(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ht,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ht,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ll=Xt(oe),Dl=Qt(oe),Ml=bt(oe),Fl=vt(oe),Bl=As(oe),Ul=Ps(oe),Vl=Is(oe),Yl=Zs(oe),Gl=Cs(oe),Hl=Rs(oe),Jl=Ls(oe),ql=Ds(oe),xr=new WeakMap;function nt(e,t,n){const r=Object.getPrototypeOf(e);let o=xr.get(r);if(o||(o=new Set,xr.set(r,o)),!o.has(t)){o.add(t);for(const s in n){const i=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){const a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const F=f("ZodType",(e,t)=>(M.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:xt(e,"input"),output:xt(e,"output")}}),e.toJSONSchema=cl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>Ll(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Ml(e,n,r),e.parseAsync=async(n,r)=>Dl(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Fl(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Bl(e,n,r),e.decode=(n,r)=>Ul(e,n,r),e.encodeAsync=async(n,r)=>Vl(e,n,r),e.decodeAsync=async(n,r)=>Yl(e,n,r),e.safeEncode=(n,r)=>Gl(e,n,r),e.safeDecode=(n,r)=>Hl(e,n,r),e.safeEncodeAsync=async(n,r)=>Jl(e,n,r),e.safeDecodeAsync=async(n,r)=>ql(e,n,r),nt(e,"ZodType",{check(...n){const r=this.def;return this.clone(ze(r,{checks:[...r.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Se(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(Lc(n,r))},superRefine(n,r){return this.check(Dc(n,r))},overwrite(n){return this.check(Me(n))},optional(){return Cr(this)},exactOptional(){return zc(this)},nullable(){return Rr(this)},nullish(){return Cr(Rr(this))},nonoptional(n){return jc(this,n)},array(){return vc(this)},or(n){return Ar([this,n])},and(n){return kc(this,n)},transform(n){return Dr(this,xc(n))},default(n){return $c(this,n)},prefault(n){return Oc(this,n)},catch(n){return Pc(this,n)},pipe(n){return Dr(this,n)},readonly(){return Cc(this)},describe(n){const r=this.clone();return tt.add(r,{description:n}),r},meta(...n){if(n.length===0)return tt.get(this);const r=this.clone();return tt.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return tt.get(e)?.description},configurable:!0}),e)),Er=f("_ZodString",(e,t)=>{en.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,o,s)=>dl(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,nt(e,"_ZodString",{regex(...r){return this.check(Ja(...r))},includes(...r){return this.check(Ka(...r))},startsWith(...r){return this.check(Xa(...r))},endsWith(...r){return this.check(Qa(...r))},min(...r){return this.check(wt(...r))},max(...r){return this.check(br(...r))},length(...r){return this.check(vr(...r))},nonempty(...r){return this.check(wt(1,...r))},lowercase(r){return this.check(qa(r))},uppercase(r){return this.check(Wa(r))},trim(){return this.check(tl())},normalize(...r){return this.check(el(...r))},toLowerCase(){return this.check(nl())},toUpperCase(){return this.check(rl())},slugify(){return this.check(ol())}})}),Wl=f("ZodString",(e,t)=>{en.init(e,t),Er.init(e,t),e.email=n=>e.check(_a(Kl,n)),e.url=n=>e.check(Ea(Xl,n)),e.jwt=n=>e.check(Da(pc,n)),e.emoji=n=>e.check(za(Ql,n)),e.guid=n=>e.check(pr(zr,n)),e.uuid=n=>e.check(ya(Et,n)),e.uuidv4=n=>e.check(ka(Et,n)),e.uuidv6=n=>e.check(wa(Et,n)),e.uuidv7=n=>e.check(xa(Et,n)),e.nanoid=n=>e.check(Sa(ec,n)),e.guid=n=>e.check(pr(zr,n)),e.cuid=n=>e.check(Ta(tc,n)),e.cuid2=n=>e.check($a(nc,n)),e.ulid=n=>e.check(Na(rc,n)),e.base64=n=>e.check(Ca(uc,n)),e.base64url=n=>e.check(Ra(dc,n)),e.xid=n=>e.check(Oa(oc,n)),e.ksuid=n=>e.check(ja(sc,n)),e.ipv4=n=>e.check(Aa(ic,n)),e.ipv6=n=>e.check(Pa(ac,n)),e.cidrv4=n=>e.check(Ia(lc,n)),e.cidrv6=n=>e.check(Za(cc,n)),e.e164=n=>e.check(La(hc,n)),e.datetime=n=>e.check(jl(n)),e.date=n=>e.check(Pl(n)),e.time=n=>e.check(Zl(n)),e.duration=n=>e.check(Rl(n))});function ke(e){return va(Wl,e)}const L=f("ZodStringFormat",(e,t)=>{R.init(e,t),Er.init(e,t)}),Kl=f("ZodEmail",(e,t)=>{Ti.init(e,t),L.init(e,t)}),zr=f("ZodGUID",(e,t)=>{zi.init(e,t),L.init(e,t)}),Et=f("ZodUUID",(e,t)=>{Si.init(e,t),L.init(e,t)}),Xl=f("ZodURL",(e,t)=>{$i.init(e,t),L.init(e,t)}),Ql=f("ZodEmoji",(e,t)=>{Ni.init(e,t),L.init(e,t)}),ec=f("ZodNanoID",(e,t)=>{Oi.init(e,t),L.init(e,t)}),tc=f("ZodCUID",(e,t)=>{ji.init(e,t),L.init(e,t)}),nc=f("ZodCUID2",(e,t)=>{Ai.init(e,t),L.init(e,t)}),rc=f("ZodULID",(e,t)=>{Pi.init(e,t),L.init(e,t)}),oc=f("ZodXID",(e,t)=>{Ii.init(e,t),L.init(e,t)}),sc=f("ZodKSUID",(e,t)=>{Zi.init(e,t),L.init(e,t)}),ic=f("ZodIPv4",(e,t)=>{Mi.init(e,t),L.init(e,t)}),ac=f("ZodIPv6",(e,t)=>{Fi.init(e,t),L.init(e,t)}),lc=f("ZodCIDRv4",(e,t)=>{Bi.init(e,t),L.init(e,t)}),cc=f("ZodCIDRv6",(e,t)=>{Ui.init(e,t),L.init(e,t)}),uc=f("ZodBase64",(e,t)=>{Vi.init(e,t),L.init(e,t)}),dc=f("ZodBase64URL",(e,t)=>{Gi.init(e,t),L.init(e,t)}),hc=f("ZodE164",(e,t)=>{Hi.init(e,t),L.init(e,t)}),pc=f("ZodJWT",(e,t)=>{qi.init(e,t),L.init(e,t)}),Sr=f("ZodNumber",(e,t)=>{er.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,o,s)=>hl(e,r,o),nt(e,"ZodNumber",{gt(r,o){return this.check(mr(r,o))},gte(r,o){return this.check(rn(r,o))},min(r,o){return this.check(rn(r,o))},lt(r,o){return this.check(fr(r,o))},lte(r,o){return this.check(nn(r,o))},max(r,o){return this.check(nn(r,o))},int(r){return this.check(Tr(r))},safe(r){return this.check(Tr(r))},positive(r){return this.check(mr(0,r))},nonnegative(r){return this.check(rn(0,r))},negative(r){return this.check(fr(0,r))},nonpositive(r){return this.check(nn(0,r))},multipleOf(r,o){return this.check(gr(r,o))},step(r,o){return this.check(gr(r,o))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function rt(e){return Va(Sr,e)}const fc=f("ZodNumberFormat",(e,t)=>{Wi.init(e,t),Sr.init(e,t)});function Tr(e){return Ya(fc,e)}const mc=f("ZodUnknown",(e,t)=>{Ki.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fl()});function $r(){return Ga(mc)}const gc=f("ZodNever",(e,t)=>{Xi.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pl(e,n,r)});function Nr(e){return Ha(gc,e)}const bc=f("ZodArray",(e,t)=>{Qi.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vl(e,n,r,o),e.element=t.element,nt(e,"ZodArray",{min(n,r){return this.check(wt(n,r))},nonempty(n){return this.check(wt(1,n))},max(n,r){return this.check(br(n,r))},length(n,r){return this.check(vr(n,r))},unwrap(){return this.element}})});function vc(e,t){return sl(bc,e,t)}const Or=f("ZodObject",(e,t)=>{ta.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_l(e,n,r,o),P(e,"shape",()=>t.shape),nt(e,"ZodObject",{keyof(){return Ir(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:$r()})},loose(){return this.clone({...this._zod.def,catchall:$r()})},strict(){return this.clone({...this._zod.def,catchall:Nr()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return ws(this,n)},safeExtend(n){return xs(this,n)},merge(n){return Es(this,n)},pick(n){return ys(this,n)},omit(n){return ks(this,n)},partial(...n){return zs(Zr,this,n[0])},required(...n){return Ss(Lr,this,n[0])}})});function jr(e,t){const n={type:"object",shape:e??{},..._(t)};return new Or(n)}function on(e,t){return new Or({type:"object",shape:e,catchall:Nr(),..._(t)})}const _c=f("ZodUnion",(e,t)=>{na.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yl(e,n,r,o),e.options=t.options});function Ar(e,t){return new _c({type:"union",options:e,..._(t)})}const yc=f("ZodIntersection",(e,t)=>{ra.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kl(e,n,r,o)});function kc(e,t){return new yc({type:"intersection",left:e,right:t})}const Pr=f("ZodRecord",(e,t)=>{oa.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wl(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function sn(e,t,n){return!t||!t._zod?new Pr({type:"record",keyType:ke(),valueType:e,..._(t)}):new Pr({type:"record",keyType:e,valueType:t,..._(n)})}const an=f("ZodEnum",(e,t)=>{sa.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,o,s)=>ml(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new an({...t,checks:[],..._(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new an({...t,checks:[],..._(o),entries:s})}});function Ir(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new an({type:"enum",entries:n,..._(t)})}const wc=f("ZodTransform",(e,t)=>{ia.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bl(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Cn(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(et(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(et(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});function xc(e){return new wc({type:"transform",transform:e})}const Zr=f("ZodOptional",(e,t)=>{ar.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wr(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Cr(e){return new Zr({type:"optional",innerType:e})}const Ec=f("ZodExactOptional",(e,t)=>{aa.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wr(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function zc(e){return new Ec({type:"optional",innerType:e})}const Sc=f("ZodNullable",(e,t)=>{la.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xl(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Rr(e){return new Sc({type:"nullable",innerType:e})}const Tc=f("ZodDefault",(e,t)=>{ca.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zl(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $c(e,t){return new Tc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Fn(t)}})}const Nc=f("ZodPrefault",(e,t)=>{ua.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sl(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Oc(e,t){return new Nc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Fn(t)}})}const Lr=f("ZodNonOptional",(e,t)=>{da.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>El(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function jc(e,t){return new Lr({type:"nonoptional",innerType:e,..._(t)})}const Ac=f("ZodCatch",(e,t)=>{ha.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Tl(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Pc(e,t){return new Ac({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ic=f("ZodPipe",(e,t)=>{pa.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$l(e,n,r,o),e.in=t.in,e.out=t.out});function Dr(e,t){return new Ic({type:"pipe",in:e,out:t})}const Zc=f("ZodReadonly",(e,t)=>{fa.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Nl(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Cc(e){return new Zc({type:"readonly",innerType:e})}const Rc=f("ZodCustom",(e,t)=>{ma.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gl(e,n)});function Lc(e,t={}){return il(Rc,e,t)}function Dc(e,t){return al(e,t)}const Mc=Ir(["color","range"]),Fc=jr({min:rt().optional(),max:rt().optional(),step:rt().optional()}),Bc=on({value:Ar([ke(),rt()]),widget:Mc,widgetOptions:Fc.optional()}),Uc=sn(ke(),Bc),Vc=sn(ke(),Uc),ln={min:0,max:100,step:1};function Yc(e){return{min:e?.min??ln.min,max:e?.max??ln.max,step:e?.step??ln.step}}function Gc(e){const t=Object.entries(e);if(t.length===0)return"";const n=o=>Object.entries(o).map(([s,i])=>` --${s}: ${i.value};`).join(`
70
+ `);let r="";for(const[o,s]of t){if(o==="default"){r+=`:root {
71
+ ${n(s)}
72
72
  }
73
- `;continue}r+=`[data-theme="${s}"] {
74
- ${n(o)}
73
+ `;continue}r+=`[data-theme="${o}"] {
74
+ ${n(s)}
75
75
  }
76
- `}return r}function Uc(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e.trim())}function Mr(e){if(typeof e=="number"&&Number.isFinite(e))return{amount:e,unit:"px"};const t=String(e).trim().match(/^(-?\d*\.?\d+)\s*([a-z%]*)/i);return t?{amount:Number(t[1]),unit:t[2]||"px"}:{amount:0,unit:"px"}}const Vc={fr:{"guide.open":"Guide","guide.empty":"Ce thème ne dispose pour l'instant d'aucun guide utilisateur.","guide.fullscreen.enter":"Plein écran","guide.fullscreen.exit":"Quitter le plein écran","toolbar.label":"Barre d'outils Yama","panel.close":"Fermer le panneau","themes.open":"Apparence","themes.active_theme":"Thème actif","themes.switch_theme":"Changer de thème","themes.copy_theme":"Copier l'apparence","themes.copy_theme.success":"Apparence copiée","themes.copy_theme.success.description":"Vous pouvez maintenant coller l'apparence sauvegardée au niveau de l'édition de votre site sur Yama CMS","themes.copy_theme.error":"Impossible de copier l'apparence","fonts.open":"Polices","fonts.title":"Polices","fonts.no_matches":"Aucune police","logos.open":"Logos","logos.title":"Logos","logos.choose":"Choisir un fichier","logos.height":"Hauteur","logos.height.favicon":"Le navigateur impose la taille du favicon","logos.empty":"Aucun logo","logos.too_large":"Fichier trop volumineux (max 300 Ko)","logos.invalid_type":"Format d'image non pris en charge"},en:{"guide.open":"Guide","guide.empty":"This theme does not have a user guide yet.","guide.fullscreen.enter":"Full screen","guide.fullscreen.exit":"Exit full screen","toolbar.label":"Yama Toolbar","panel.close":"Close panel","themes.open":"Appearance","themes.active_theme":"Active theme","themes.switch_theme":"Switch theme","themes.copy_theme":"Copy appearance","themes.copy_theme.success":"Appearance copied","themes.copy_theme.success.description":"You can now paste the saved appearance when editing your site on Yama CMS","themes.copy_theme.error":"Unable to copy appearance","fonts.open":"Fonts","fonts.title":"Fonts","fonts.no_matches":"No fonts found","logos.open":"Logos","logos.title":"Logos","logos.choose":"Choose a file","logos.height":"Height","logos.height.favicon":"The browser controls the favicon size","logos.empty":"No logo","logos.too_large":"File is too large (max 300 KB)","logos.invalid_type":"Unsupported image format"},es:{"guide.open":"Guide","guide.empty":"Este tema aún no tiene guía de usuario.","guide.fullscreen.enter":"Pantalla completa","guide.fullscreen.exit":"Salir de pantalla completa","toolbar.label":"Barra de herramientas Yama","panel.close":"Cerrar el panel","themes.open":"Apariencia","themes.active_theme":"Tema activo","themes.switch_theme":"Cambiar de tema","themes.copy_theme":"Copiar la apariencia","themes.copy_theme.success":"Apariencia copiada","themes.copy_theme.success.description":"Ahora puede pegar la apariencia guardada al editar su sitio en Yama CMS","themes.copy_theme.error":"No se puede copiar la apariencia","fonts.open":"Fuentes","fonts.title":"Fuentes","fonts.no_matches":"Ninguna fuente","logos.open":"Logos","logos.title":"Logos","logos.choose":"Elegir un archivo","logos.height":"Altura","logos.height.favicon":"El navegador impone el tamaño del favicon","logos.empty":"Ningún logo","logos.too_large":"El archivo es demasiado grande (máx. 300 KB)","logos.invalid_type":"Formato de imagen no compatible"},it:{"guide.open":"Guide","guide.empty":"Questo tema non dispone ancora di una guida utente.","guide.fullscreen.enter":"Schermo intero","guide.fullscreen.exit":"Esci dallo schermo intero","toolbar.label":"Barra degli strumenti Yama","panel.close":"Chiudi il pannello","themes.open":"Aspetto","themes.active_theme":"Tema attivo","themes.switch_theme":"Cambia tema","themes.copy_theme":"Copia l'aspetto","themes.copy_theme.success":"Aspetto copiato","themes.copy_theme.success.description":"Ora puoi incollare l'aspetto salvato durante la modifica del tuo sito su Yama CMS","themes.copy_theme.error":"Impossibile copiare l'aspetto","fonts.open":"Caratteri","fonts.title":"Caratteri","fonts.no_matches":"Nessun carattere","logos.open":"Loghi","logos.title":"Loghi","logos.choose":"Scegli un file","logos.height":"Altezza","logos.height.favicon":"Il browser imposta la dimensione della favicon","logos.empty":"Nessun logo","logos.too_large":"File troppo grande (max 300 KB)","logos.invalid_type":"Formato immagine non supportato"},de:{"guide.open":"Guide","guide.empty":"Für dieses Theme gibt es noch keinen Benutzerleitfaden.","guide.fullscreen.enter":"Vollbild","guide.fullscreen.exit":"Vollbild beenden","toolbar.label":"Yama-Werkzeugleiste","panel.close":"Panel schließen","themes.open":"Erscheinungsbild","themes.active_theme":"Aktives Theme","themes.switch_theme":"Theme wechseln","themes.copy_theme":"Erscheinungsbild kopieren","themes.copy_theme.success":"Erscheinungsbild kopiert","themes.copy_theme.success.description":"Sie können das gespeicherte Erscheinungsbild jetzt in der Bearbeitung Ihrer Website auf Yama CMS einfügen","themes.copy_theme.error":"Erscheinungsbild nicht kopierbar","fonts.open":"Schriften","fonts.title":"Schriften","fonts.no_matches":"Keine Schrift gefunden","logos.open":"Logos","logos.title":"Logos","logos.choose":"Datei wählen","logos.height":"Höhe","logos.height.favicon":"Die Favicon-Größe legt der Browser fest","logos.empty":"Kein Logo","logos.too_large":"Datei ist zu groß (max. 300 KB)","logos.invalid_type":"Nicht unterstütztes Bildformat"}},E=(e,t,n)=>Vc[t]?.[e]??n??e;var Et={exports:{}},Fr;function Gc(){if(Fr)return Et.exports;Fr=1;function e(t,n=100,r={}){if(typeof t!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(n<0)throw new RangeError("`wait` must not be negative.");const{immediate:s}=typeof r=="boolean"?{immediate:r}:r;let o,i,a,u,l;function h(){const b=o,_=i;return o=void 0,i=void 0,l=t.apply(b,_),l}function c(){const b=Date.now()-u;b<n&&b>=0?a=setTimeout(c,n-b):(a=void 0,s||(l=h()))}const m=function(...b){if(o&&this!==o&&Object.getPrototypeOf(this)===Object.getPrototypeOf(o))throw new Error("Debounced method called with different contexts of the same prototype.");o=this,i=b,u=Date.now();const _=s&&!a;return a||(a=setTimeout(c,n)),_&&(l=h()),l};return Object.defineProperty(m,"isPending",{get(){return a!==void 0}}),m.clear=()=>{a&&(clearTimeout(a),a=void 0)},m.flush=()=>{a&&m.trigger()},m.trigger=()=>{l=h(),m.clear()},m}return Et.exports.debounce=e,Et.exports=e,Et.exports}var Yc=Gc();const Hc=Rs(Yc),st=Symbol("clean");let ie=[],Se=0;const Tt=4,St=globalThis.nanostoresGlobal||={epoch:0};let Jc=()=>{let e;for(Se=0;Se<ie.length;Se+=Tt)try{ie[Se](ie[Se+1].value,ie[Se+2],ie[Se+3])}catch(t){e=t}if(ie.length=0,e)throw e};const $t=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(r){return n.lc=t.push(r),()=>{for(let o=Se+Tt;o<ie.length;)ie[o]===r?ie.splice(o,Tt):o+=Tt;let s=t.indexOf(r);~s&&(t.splice(s,1),--n.lc||n.off())}},notify(r,s){St.epoch++;let o=!ie.length&&!0;for(let i of t)ie.push(i,n,r,s);o&&Jc()},off(){},set(r){let s=n.value;n.eq(s,r)||(n.value=r,n.notify(s))},subscribe(r){let s=n.listen(r);return r(n.value),s},value:e};return process.env.NODE_ENV!=="production"&&(n[st]=()=>{t=[],n.lc=0,n.off()}),n},qc=5,Fe=6,jt=10;let Wc=(e,t,n,r)=>(e.events=e.events||{},e.events[n+jt]||(e.events[n+jt]=r(s=>{e.events[n].reduceRight((o,i)=>(i(o),o),{shared:{},...s})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let s=e.events[n],o=s.indexOf(t);s.splice(o,1),s.length||(delete e.events[n],e.events[n+jt](),delete e.events[n+jt])});const Kc=1e3;let Xc=(e,t)=>Wc(e,r=>{let s=t(r);s&&e.events[Fe].push(s)},qc,r=>{let s=e.listen;e.listen=(...i)=>(!e.lc&&!e.active&&(e.active=!0,r()),s(...i));let o=e.off;if(e.events[Fe]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let i of e.events[Fe])i();e.events[Fe]=[]}},Kc)},process.env.NODE_ENV!=="production"){let i=e[st];e[st]=()=>{for(let a of e.events[Fe])a();e.events[Fe]=[],e.active=!1,i()}}return()=>{e.listen=s,e.off=o}}),Br={};function Qc(e){Br[e]||(Br[e]=!0,typeof console<"u"&&console.warn&&(console.groupCollapsed("Nano Stores: "+e),console.trace("Source of deprecated call"),console.groupEnd()))}let eu=(e,t,n)=>{Array.isArray(e)||(e=[e]);let r,s,o=()=>{if(s===St.epoch)return;s=St.epoch;let l=e.map(h=>h.get());if(!r||l.some((h,c)=>h!==r[c])){r=l;let h=t(...l);h&&h.then&&h.t?(process.env.NODE_ENV!=="production"&&Qc("Use @nanostores/async for async computed. We will remove Promise support in computed() in Nano Stores 2.0"),h.then(c=>{r===l&&i.set(c)})):(i.set(h),s=St.epoch)}},i=$t(void 0),a=i.get;if(i.get=()=>(o(),a()),process.env.NODE_ENV!=="production"){let l=i[st];i[st]=()=>{r=void 0,s=void 0,i.value=void 0,l()}}let u=o;return Xc(i,()=>{let l=e.map(h=>h.listen(u));return o(),()=>{for(let h of l)h()}}),i};const tu=(e,t)=>eu(e,t);function Ur(e,t){let n=nu(t),r=e;for(let s of n){if(r==null)return;r=r[s]}return r}const Vr=/(.*)\[(\d+)\]/;function nu(e){return e.split(".").flatMap(t=>Gr(t))}function Gr(e){if(Vr.test(e)){let[,t,n]=e.match(Vr);return[...Gr(t),n]}return[e]}function ru(e,t,n){let r=new Set(t);return e.listen((s,o,i)=>{(i===void 0?t.some(a=>o===void 0||s[a]!==o[a]||Ur(s,a)!==Ur(o,a)):r.has(i)||r.has(i.split(/\.|\[/)[0]))&&n(s,o,i)})}let cn=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function un(e,{keys:t,deps:n=[e,t],ssr:r}={}){let s=f.useRef();s.current=e.get();let o=f.useCallback(u=>(cn(s,u)(e.value),t?.length>0?ru(e,t,cn(s,u)):e.listen(cn(s,u))),n),i=()=>s.current,a=i;return r&&"init"in e&&(a=r==="initial"?()=>e.init:r),f.useSyncExternalStore(o,i,a)}const su=sn({filename:xe(),src:xe(),height:rt().optional()}),ou=on(xe(),su),iu=Nr({embeddedCode:xe().optional()}).catchall(xe()),au=sn({logo:ou.optional(),fonts:iu.optional(),themes:Mc.optional()}),lu=['<link rel="preconnect" href="https://fonts.googleapis.com">','<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>'],Yr="data-yama-fonts";function dn(e={}){return Object.entries(e).filter(t=>t[0]!=="embeddedCode"&&!!t[1])}function cu(e,t){const n=e.replaceAll(" ","+"),r=t.map(jn.toString).sort();return r.length?`family=${n}:ital,wght@${r.join(";")}`:`family=${n}`}function uu(e,t){const n=dn(e).map(([s,o])=>{const i=t[s];return cu(i?.fontName??o,i?.variants??[])});if(!n.length)return e.embeddedCode??"";const r=`https://fonts.googleapis.com/css2?${n.join("&")}&display=swap`;return[...lu,`<link href="${r}" rel="stylesheet">`].join(`
77
- `)}function du(e){for(const[n,r]of dn(e))document.body.style.setProperty(`--font-${n}`,`"${r}", sans-serif`);if(document.querySelectorAll(`link[${Yr}]`).forEach(n=>n.remove()),!e.embeddedCode)return;const t=document.createElement("template");t.innerHTML=e.embeddedCode;for(const n of t.content.querySelectorAll("link"))n.setAttribute(Yr,""),document.head.append(n)}const hu=300*1024,Hr=["image/svg+xml","image/png","image/webp","image/jpeg","image/x-icon","image/vnd.microsoft.icon"],fu=Hr.join(","),pu=/\.(svg|png|webp|jpe?g|ico)$/i;function Jr(e={}){return Object.entries(e).filter(t=>!!t[1]?.src)}function mu(e,t){if(e instanceof HTMLImageElement){e.src=t.src,t.height?(e.style.height=`${t.height}px`,e.style.width="auto"):e.style.removeProperty("height");return}e instanceof HTMLLinkElement&&(e.href=t.src)}function gu(e){let t=document.querySelector('link[rel="icon"]');t||(t=document.createElement("link"),t.rel="icon",document.head.append(t)),t.href=e}function qr(e){for(const[t,n]of Jr(e))document.querySelectorAll(`[data-yama-logo="${CSS.escape(t)}"]`).forEach(r=>{mu(r,n)});e.favicon?.src&&gu(e.favicon.src)}function bu(e){return Hr.includes(e.type)||pu.test(e.name)}function _u(e){return bu(e)?e.size>hu?Promise.reject("too_large"):new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t({filename:e.name,src:String(r.result??"")}),r.onerror=()=>n("invalid_type"),r.readAsDataURL(e)}):Promise.reject("invalid_type")}const Rt=$t(void 0),Nt=$t(void 0),ot=$t({}),Wr={},vu=tu([Rt,Nt,ot],(e,t,n)=>({logo:e,fonts:t,themes:n}));function wu(e){const t=au.safeParse(e);return t.success?(Kr(t.data.logo),Qr(t.data.fonts),ot.set(t.data.themes??{}),!0):(console.error("[yama-toolbar] invalid config",t.error),!1)}function Kr(e){Rt.set(e),e&&(qr(e),requestAnimationFrame(()=>qr(e)))}function Xr(e,t){const n=Rt.get(),r=n?.[e];!n||!r||Kr({...n,[e]:{...r,...t}})}function Qr(e){Nt.set(e),e&&du(e)}function xu(e,t,n){const r=ot.get(),s=r[e]?.[t];s&&ot.set({...r,[e]:{...r[e],[t]:{...s,value:n}}})}function yu(e,t){const n=Nt.get();if(!n)return;const r=n[e]!==t.fontName;if(Wr[e]=t,!r)return;const s={...n,[e]:t.fontName};s.embeddedCode=uu(s,Wr),Qr(s)}function ku(){return JSON.stringify(vu.get(),null,2)}const es="yama-toolbar-overrides";function zu(e={}){const t=un(ot),n=Object.keys(t),[r,s]=f.useState(()=>n[0]??"default"),o=f.useRef(r);o.current=r;const i=t[r]??{};f.useEffect(()=>{const l=Object.keys(t);l.length!==0&&(l.includes(r)||s(l[0]))},[t,r]),f.useEffect(()=>{r==="default"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",r)},[r]),f.useEffect(()=>{let l=document.getElementById(es);l||(l=document.createElement("style"),l.id=es,document.head.appendChild(l)),l.textContent=Bc(t)},[t]);const a=f.useMemo(()=>Hc((l,h)=>{xu(o.current,l,h)},50),[]);return f.useEffect(()=>()=>a.clear(),[a]),{themes:t,activeTheme:r,themeNames:n,activeVars:i,changeTheme:l=>{if(n.length<=1)return;const h=l&&n.includes(l)?l:n[(n.indexOf(r)+1)%n.length];s(h),e.onThemeChanged?.(h)},updateVar:a}}function hn(...e){return e.filter(Boolean).join(" ")}function Ot(e){const{isOpen:t,title:n,titleAdditional:r,children:s,headerButtons:o,className:i,...a}=e;return d.jsxs("div",{...a,className:hn("panel",t?"panel--open":"panel--closed",i),"aria-hidden":!t,inert:!t,children:[d.jsxs("div",{className:"panel__header",children:[d.jsxs("p",{className:"panel__title",children:[n,r&&r]}),d.jsx("div",{className:"panel__spacer"}),o&&d.jsx("div",{className:"panel__buttons",children:o})]}),d.jsx("div",{className:"panel__body",children:s})]})}function At({label:e,placement:t="top",className:n,children:r}){return d.jsxs("div",{className:hn("tooltip",`tooltip--${t}`,n),children:[r,d.jsx("span",{className:"tooltip__bubble",role:"tooltip",children:e})]})}function ts(e){const{children:t,onClick:n,className:r,icon:s,iconPosition:o,...i}=e;return d.jsxs("button",{className:hn("button",r),onClick:n,...i,children:[s&&o==="left"&&s,t,s&&o==="right"&&s]})}function Eu(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24","aria-hidden":!0,children:d.jsx("path",{fill:"currentColor",d:"M7.5 2c-1.79 1.15-3 3.18-3 5.5s1.21 4.35 3.03 5.5C4.46 13 2 10.54 2 7.5A5.5 5.5 0 0 1 7.5 2m11.57 1.5l1.43 1.43L4.93 20.5L3.5 19.07zm-6.18 2.43L11.41 5L9.97 6l.42-1.7L9 3.24l1.75-.12l.58-1.65L12 3.1l1.73.03l-1.35 1.13zm-3.3 3.61l-1.16-.73l-1.12.78l.34-1.32l-1.09-.83l1.36-.09l.45-1.29l.51 1.27l1.36.03l-1.05.87zM19 13.5a5.5 5.5 0 0 1-5.5 5.5c-1.22 0-2.35-.4-3.26-1.07l7.69-7.69c.67.91 1.07 2.04 1.07 3.26m-4.4 6.58l2.77-1.15l-.24 3.35zm4.33-2.7l1.15-2.77l2.2 2.54zm1.15-4.96l-1.14-2.78l3.34.24zM9.63 18.93l2.77 1.15l-2.53 2.19z"})})}function Tu({name:e,entry:t,onUpdateVar:n}){const r=Mr(t.value),s=Fc(t.widgetOptions),o=Math.max(s.max,r.amount),i=f.useRef(!1),[a,u]=f.useState(r.amount);f.useEffect(()=>{i.current||u(Mr(t.value).amount)},[t.value]);const l=c=>{u(c),n(e,`${c}${r.unit}`)},h=o===s.min?0:(a-s.min)/(o-s.min)*100;return d.jsxs("div",{className:"theme-var__inputs theme-var__inputs--range",children:[d.jsx("input",{"aria-label":e,"aria-valuetext":`${a}${r.unit}`,type:"range",min:s.min,max:o,step:s.step,value:a,onChange:c=>l(c.target.valueAsNumber),onPointerDown:c=>{c.currentTarget.setPointerCapture(c.pointerId),i.current=!0},onLostPointerCapture:()=>{i.current=!1},className:"theme-var__range",style:{"--theme-range-progress":`${h}%`}}),d.jsxs("span",{className:"theme-var__value",children:[a,r.unit]})]})}function Su({name:e,entry:t,onUpdateVar:n}){const r=String(t.value);return d.jsxs("div",{className:"theme-var",children:[d.jsxs("div",{className:"theme-var__header",children:[d.jsx("div",{className:"theme-var__label",children:e}),d.jsx("div",{className:"theme-var__type",children:t.widget})]}),t.widget==="range"?d.jsx(Tu,{name:e,entry:t,onUpdateVar:n}):d.jsxs("div",{className:"theme-var__inputs",children:[t.widget==="color"&&d.jsx("input",{"aria-label":e,type:"color",value:Uc(r)?r:"#000000",onChange:s=>n(e,s.target.value),className:"theme-var__swatch"}),d.jsx("input",{"aria-label":e,type:"text",value:r,onChange:s=>n(e,s.target.value),className:"theme-var__text"})]})]})}function $u({isOpen:e,lang:t}){const{activeTheme:n,themeNames:r,activeVars:s,changeTheme:o,updateVar:i}=zu(),a=r.length;return d.jsx(Ot,{className:"themes-panel",isOpen:e,title:E("themes.active_theme",t),titleAdditional:d.jsx("span",{className:"themes-panel__active-theme",children:n}),headerButtons:a>1&&d.jsx(At,{label:E("themes.switch_theme",t),placement:"top-right",children:d.jsx(ts,{onClick:()=>o(),disabled:a<=1,"aria-label":E("themes.switch_theme",t),children:d.jsx(Eu,{})})}),children:d.jsx("div",{className:"themes-panel__grid",children:Object.entries(s).map(([u,l])=>d.jsx(Su,{name:u,entry:l,onUpdateVar:i},u))})})}function ju(){return d.jsxs("svg",{id:"Groupe_113","data-name":"Groupe 113",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"42.933",height:"49.48",viewBox:"0 0 42.933 49.48",className:"",children:[d.jsxs("defs",{children:[d.jsxs("radialGradient",{id:"radial-gradient",cx:"0.087",cy:"0.573",r:"1.574",gradientUnits:"objectBoundingBox",children:[d.jsx("stop",{offset:"0",stopColor:"#30a484"}),d.jsx("stop",{offset:"0.537",stopColor:"#0885a0"}),d.jsx("stop",{offset:"1",stopColor:"#00519e"})]}),d.jsx("clipPath",{id:"clipPath",children:d.jsx("path",{id:"Tracé_22","data-name":"Tracé 22",d:"M225.747,118.38l1.034-.593.025-9.36-8.094-4.7-.966.555-4.123-2.381,0-1.21-8.216-4.772-8.241,4.729,0,1.242L193,104.3l-.981-.57-8.119,4.659-.024,9.36,1.149.667v4.652l-1.124.645-.024,9.36,8.094,4.7,1.17-.671,4.011,2.316,0,1.211,8.216,4.772,8.241-4.729,0-1.244,3.966-2.29,1.093.635,8.118-4.659.025-9.36-1.058-.615Zm-2.21,12.831-18.28,10.553-18.28-10.553V110.1l18.28-10.554,18.28,10.554Z",transform:"translate(-183.872 -95.917)",fill:"none"})}),d.jsx("radialGradient",{id:"radial-gradient-2",cx:"-1.203",cy:"0.581",r:"1.539",xlinkHref:"#radial-gradient"}),d.jsx("radialGradient",{id:"radial-gradient-3",cx:"-0.029",cy:"1.899",r:"3.575",xlinkHref:"#radial-gradient"})]}),d.jsx("path",{id:"Tracé_19","data-name":"Tracé 19",d:"M201.981,152.243l.058,4.585,5.535,3.1,4,2.242.139,11.013,4,2.243-.2-15.6Z",transform:"translate(-196.072 -133.864)",fill:"url(#radial-gradient)"}),d.jsx("path",{id:"Tracé_20","data-name":"Tracé 20",d:"M280.224,188.7l5.615-3.337-.082-6.532-5.615,3.337Z",transform:"translate(-248.73 -151.778)",fill:"#006da3"}),d.jsx("path",{id:"Tracé_21","data-name":"Tracé 21",d:"M202.335,180.346l.081,6.428,5.535,3.1-.081-6.428Z",transform:"translate(-196.311 -152.798)",fill:"#2aa287"}),d.jsx("g",{id:"Groupe_8","data-name":"Groupe 8",children:d.jsx("g",{id:"Groupe_7","data-name":"Groupe 7",clipPath:"url(#clipPath)",children:d.jsxs("g",{id:"Groupe_6","data-name":"Groupe 6",transform:"translate(-10.442 -9.059)",children:[d.jsx("rect",{id:"Rectangle_3","data-name":"Rectangle 3",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 0, 14.522)",fill:"#2aa387"}),d.jsx("rect",{id:"Rectangle_4","data-name":"Rectangle 4",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 0.565, 14.348)",fill:"#29a288"}),d.jsx("rect",{id:"Rectangle_5","data-name":"Rectangle 5",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 1.13, 14.174)",fill:"#28a189"}),d.jsx("rect",{id:"Rectangle_6","data-name":"Rectangle 6",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 1.695, 14)",fill:"#27a08a"}),d.jsx("rect",{id:"Rectangle_7","data-name":"Rectangle 7",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 2.261, 13.826)",fill:"#279f8b"}),d.jsx("rect",{id:"Rectangle_8","data-name":"Rectangle 8",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 2.826, 13.653)",fill:"#269e8c"}),d.jsx("rect",{id:"Rectangle_9","data-name":"Rectangle 9",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 3.391, 13.479)",fill:"#259e8d"}),d.jsx("rect",{id:"Rectangle_10","data-name":"Rectangle 10",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 3.956, 13.305)",fill:"#249d8e"}),d.jsx("rect",{id:"Rectangle_11","data-name":"Rectangle 11",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 4.521, 13.131)",fill:"#249c8f"}),d.jsx("rect",{id:"Rectangle_12","data-name":"Rectangle 12",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 5.086, 12.957)",fill:"#239b90"}),d.jsx("rect",{id:"Rectangle_13","data-name":"Rectangle 13",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 5.651, 12.783)",fill:"#229a90"}),d.jsx("rect",{id:"Rectangle_14","data-name":"Rectangle 14",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 6.217, 12.609)",fill:"#229991"}),d.jsx("rect",{id:"Rectangle_15","data-name":"Rectangle 15",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 6.782, 12.436)",fill:"#219892"}),d.jsx("rect",{id:"Rectangle_16","data-name":"Rectangle 16",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 7.347, 12.262)",fill:"#209793"}),d.jsx("rect",{id:"Rectangle_17","data-name":"Rectangle 17",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 7.912, 12.088)",fill:"#1f9694"}),d.jsx("rect",{id:"Rectangle_18","data-name":"Rectangle 18",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 8.477, 11.914)",fill:"#1f9594"}),d.jsx("rect",{id:"Rectangle_19","data-name":"Rectangle 19",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 9.042, 11.74)",fill:"#1e9495"}),d.jsx("rect",{id:"Rectangle_20","data-name":"Rectangle 20",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 9.608, 11.566)",fill:"#1d9396"}),d.jsx("rect",{id:"Rectangle_21","data-name":"Rectangle 21",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 10.173, 11.393)",fill:"#1c9397"}),d.jsx("rect",{id:"Rectangle_22","data-name":"Rectangle 22",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 10.738, 11.219)",fill:"#1c9297"}),d.jsx("rect",{id:"Rectangle_23","data-name":"Rectangle 23",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 11.303, 11.045)",fill:"#1b9198"}),d.jsx("rect",{id:"Rectangle_24","data-name":"Rectangle 24",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 11.868, 10.871)",fill:"#1a9099"}),d.jsx("rect",{id:"Rectangle_25","data-name":"Rectangle 25",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 12.433, 10.697)",fill:"#198f99"}),d.jsx("rect",{id:"Rectangle_26","data-name":"Rectangle 26",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 12.998, 10.523)",fill:"#198e9a"}),d.jsx("rect",{id:"Rectangle_27","data-name":"Rectangle 27",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 13.564, 10.35)",fill:"#188d9b"}),d.jsx("rect",{id:"Rectangle_28","data-name":"Rectangle 28",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 14.129, 10.176)",fill:"#178c9b"}),d.jsx("rect",{id:"Rectangle_29","data-name":"Rectangle 29",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 14.694, 10.002)",fill:"#178b9c"}),d.jsx("rect",{id:"Rectangle_30","data-name":"Rectangle 30",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 15.259, 9.828)",fill:"#168a9c"}),d.jsx("rect",{id:"Rectangle_31","data-name":"Rectangle 31",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 15.824, 9.654)",fill:"#15899d"}),d.jsx("rect",{id:"Rectangle_32","data-name":"Rectangle 32",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 16.389, 9.48)",fill:"#14899e"}),d.jsx("rect",{id:"Rectangle_33","data-name":"Rectangle 33",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 16.954, 9.307)",fill:"#14889e"}),d.jsx("rect",{id:"Rectangle_34","data-name":"Rectangle 34",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 17.52, 9.133)",fill:"#13879f"}),d.jsx("rect",{id:"Rectangle_35","data-name":"Rectangle 35",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 18.085, 8.959)",fill:"#12869f"}),d.jsx("rect",{id:"Rectangle_36","data-name":"Rectangle 36",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 18.65, 8.785)",fill:"#1185a0"}),d.jsx("rect",{id:"Rectangle_37","data-name":"Rectangle 37",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 19.215, 8.611)",fill:"#1084a0"}),d.jsx("rect",{id:"Rectangle_38","data-name":"Rectangle 38",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 19.78, 8.437)",fill:"#1083a1"}),d.jsx("rect",{id:"Rectangle_39","data-name":"Rectangle 39",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 20.345, 8.264)",fill:"#0f82a1"}),d.jsx("rect",{id:"Rectangle_40","data-name":"Rectangle 40",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 20.91, 8.09)",fill:"#0e81a2"}),d.jsx("rect",{id:"Rectangle_41","data-name":"Rectangle 41",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 21.476, 7.916)",fill:"#0e80a2"}),d.jsx("rect",{id:"Rectangle_42","data-name":"Rectangle 42",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 22.041, 7.742)",fill:"#0d7fa2"}),d.jsx("rect",{id:"Rectangle_43","data-name":"Rectangle 43",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 22.606, 7.568)",fill:"#0c7ea3"}),d.jsx("rect",{id:"Rectangle_44","data-name":"Rectangle 44",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 23.171, 7.394)",fill:"#0c7da3"}),d.jsx("rect",{id:"Rectangle_45","data-name":"Rectangle 45",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 23.736, 7.22)",fill:"#0a7ca3"}),d.jsx("rect",{id:"Rectangle_46","data-name":"Rectangle 46",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 24.301, 7.047)",fill:"#087ba3"}),d.jsx("rect",{id:"Rectangle_47","data-name":"Rectangle 47",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 24.867, 6.873)",fill:"#077aa4"}),d.jsx("rect",{id:"Rectangle_48","data-name":"Rectangle 48",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 25.432, 6.699)",fill:"#0479a4"}),d.jsx("rect",{id:"Rectangle_49","data-name":"Rectangle 49",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 25.997, 6.525)",fill:"#0078a4"}),d.jsx("rect",{id:"Rectangle_50","data-name":"Rectangle 50",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 26.562, 6.351)",fill:"#0077a4"}),d.jsx("rect",{id:"Rectangle_51","data-name":"Rectangle 51",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 27.127, 6.177)",fill:"#0076a4"}),d.jsx("rect",{id:"Rectangle_52","data-name":"Rectangle 52",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 27.692, 6.004)",fill:"#0075a4"}),d.jsx("rect",{id:"Rectangle_53","data-name":"Rectangle 53",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 28.257, 5.83)",fill:"#0074a4"}),d.jsx("rect",{id:"Rectangle_54","data-name":"Rectangle 54",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 28.823, 5.656)",fill:"#0073a4"}),d.jsx("rect",{id:"Rectangle_55","data-name":"Rectangle 55",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 29.388, 5.482)",fill:"#0072a4"}),d.jsx("rect",{id:"Rectangle_56","data-name":"Rectangle 56",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 29.953, 5.308)",fill:"#0071a3"}),d.jsx("rect",{id:"Rectangle_57","data-name":"Rectangle 57",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 30.518, 5.134)",fill:"#0070a3"}),d.jsx("rect",{id:"Rectangle_58","data-name":"Rectangle 58",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 31.083, 4.961)",fill:"#006fa3"}),d.jsx("rect",{id:"Rectangle_59","data-name":"Rectangle 59",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 31.648, 4.787)",fill:"#006ea3"}),d.jsx("rect",{id:"Rectangle_60","data-name":"Rectangle 60",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 32.213, 4.613)",fill:"#006da3"}),d.jsx("rect",{id:"Rectangle_61","data-name":"Rectangle 61",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 32.779, 4.439)",fill:"#006ca3"}),d.jsx("rect",{id:"Rectangle_62","data-name":"Rectangle 62",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 33.344, 4.265)",fill:"#006aa3"}),d.jsx("rect",{id:"Rectangle_63","data-name":"Rectangle 63",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 33.909, 4.091)",fill:"#0069a3"}),d.jsx("rect",{id:"Rectangle_64","data-name":"Rectangle 64",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 34.474, 3.918)",fill:"#0068a3"}),d.jsx("rect",{id:"Rectangle_65","data-name":"Rectangle 65",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 35.039, 3.744)",fill:"#0067a3"}),d.jsx("rect",{id:"Rectangle_66","data-name":"Rectangle 66",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 35.604, 3.57)",fill:"#0066a2"}),d.jsx("rect",{id:"Rectangle_67","data-name":"Rectangle 67",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 36.169, 3.396)",fill:"#0065a2"}),d.jsx("rect",{id:"Rectangle_68","data-name":"Rectangle 68",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 36.735, 3.222)",fill:"#0064a2"}),d.jsx("rect",{id:"Rectangle_69","data-name":"Rectangle 69",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 37.3, 3.048)",fill:"#0063a2"}),d.jsx("rect",{id:"Rectangle_70","data-name":"Rectangle 70",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 37.865, 2.875)",fill:"#0062a2"}),d.jsx("rect",{id:"Rectangle_71","data-name":"Rectangle 71",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 38.43, 2.701)",fill:"#0061a2"}),d.jsx("rect",{id:"Rectangle_72","data-name":"Rectangle 72",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 38.995, 2.527)",fill:"#0060a2"}),d.jsx("rect",{id:"Rectangle_73","data-name":"Rectangle 73",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 39.56, 2.353)",fill:"#005fa1"}),d.jsx("rect",{id:"Rectangle_74","data-name":"Rectangle 74",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 40.126, 2.179)",fill:"#005ea1"}),d.jsx("rect",{id:"Rectangle_75","data-name":"Rectangle 75",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 40.691, 2.005)",fill:"#005da1"}),d.jsx("rect",{id:"Rectangle_76","data-name":"Rectangle 76",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 41.256, 1.831)",fill:"#005ca1"}),d.jsx("rect",{id:"Rectangle_77","data-name":"Rectangle 77",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 41.821, 1.658)",fill:"#005ba0"}),d.jsx("rect",{id:"Rectangle_78","data-name":"Rectangle 78",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 42.386, 1.484)",fill:"#005aa0"}),d.jsx("rect",{id:"Rectangle_79","data-name":"Rectangle 79",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 42.951, 1.31)",fill:"#0058a0"}),d.jsx("rect",{id:"Rectangle_80","data-name":"Rectangle 80",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 43.516, 1.136)",fill:"#00579f"}),d.jsx("rect",{id:"Rectangle_81","data-name":"Rectangle 81",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 44.082, 0.962)",fill:"#00569f"}),d.jsx("rect",{id:"Rectangle_82","data-name":"Rectangle 82",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 44.647, 0.788)",fill:"#00559f"}),d.jsx("rect",{id:"Rectangle_83","data-name":"Rectangle 83",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 45.212, 0.615)",fill:"#00549e"}),d.jsx("rect",{id:"Rectangle_84","data-name":"Rectangle 84",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 45.777, 0.441)",fill:"#00539e"}),d.jsx("rect",{id:"Rectangle_85","data-name":"Rectangle 85",width:"0.908",height:"53.205",transform:"matrix(0.956, -0.294, 0.294, 0.956, 46.342, 0.267)",fill:"#00529e"})]})})}),d.jsx("path",{id:"Tracé_23","data-name":"Tracé 23",d:"M255.825,174.453l3.942-2.342-.14-11.116,9.557-5.679-.058-4.585-13.5,8.022Z",transform:"translate(-232.215 -132.845)",fill:"url(#radial-gradient-2)"}),d.jsx("path",{id:"Tracé_24","data-name":"Tracé 24",d:"M231.994,120.436l5.664,3.255,5.65-3.278-5.663-3.255Z",transform:"translate(-216.292 -110.228)",fill:"#0072a2"}),d.jsx("path",{id:"Tracé_25","data-name":"Tracé 25",d:"M217.519,136.926l-5.535-3.1-3.942,2.342,13.534,7.588,13.41-7.969-4-2.242-9.468,5.627Z",transform:"translate(-200.156 -121.265)",fill:"url(#radial-gradient-3)"}),d.jsx("path",{id:"Tracé_26","data-name":"Tracé 26",d:"M193.392,117.6V138.71l18.28,10.553,18.28-10.553V117.6l-18.28-10.554Zm3,19.79-.081-6.428,5.535,3.1.081,6.428Zm9.534,5.346-.139-11.013-4-2.242-5.535-3.1-.058-4.585,13.534,7.588.2,15.6ZM227.4,137l-5.615,3.337-.082-6.532,5.615-3.337Zm-.14-11.116-9.557,5.679.14,11.116-3.942,2.342-.2-15.7,13.5-8.022Zm-2.139-7.951-13.41,7.969-13.534-7.588,3.942-2.342,5.535,3.1,4,2.243,9.468-5.627Zm-13.465-1.056-5.663-3.255,5.65-3.278L217.3,113.6Z",transform:"translate(-190.286 -103.417)",fill:"#fff"}),d.jsxs("g",{id:"Groupe_9","data-name":"Groupe 9",transform:"translate(5.909 12.276)",children:[d.jsx("path",{id:"Tracé_27","data-name":"Tracé 27",d:"M230.987,133.542l-9.468,5.627-4-2.242-5.535-3.1-3.942,2.342,13.534,7.588,13.41-7.969Z",transform:"translate(-206.065 -133.542)",fill:"#1e1e1f",fillRule:"evenodd"}),d.jsx("path",{id:"Tracé_28","data-name":"Tracé 28",d:"M269.184,155.315l-.058-4.585-13.5,8.022.2,15.7,3.942-2.342-.14-11.116Z",transform:"translate(-238.124 -145.122)",fill:"#1e1e1f",fillRule:"evenodd"}),d.jsx("path",{id:"Tracé_29","data-name":"Tracé 29",d:"M201.981,152.243l.058,4.585,5.535,3.1,4,2.242.139,11.013,4,2.243-.2-15.6Z",transform:"translate(-201.981 -146.141)",fill:"#1e1e1f",fillRule:"evenodd"})]})]})}function Ru(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:d.jsxs("g",{fill:"none",children:[d.jsx("path",{fill:"currentColor",d:"M8.6 1.418a.64.64 0 0 0-1.2 0l-.167.45a4 4 0 0 1-2.366 2.365l-.449.166a.64.64 0 0 0 0 1.202l.45.166a4 4 0 0 1 2.365 2.366l.166.449a.64.64 0 0 0 1.202 0l.166-.45a4 4 0 0 1 2.366-2.365l.449-.166a.64.64 0 0 0 0-1.202l-.45-.166a4 4 0 0 1-2.365-2.366zM3.876 7.261a.4.4 0 0 0-.752 0l-.103.281a2.5 2.5 0 0 1-1.479 1.479l-.28.103a.4.4 0 0 0 0 .752l.28.103a2.5 2.5 0 0 1 1.479 1.479l.103.28a.4.4 0 0 0 .752 0l.103-.28a2.5 2.5 0 0 1 1.479-1.479l.28-.103a.4.4 0 0 0 0-.752l-.28-.103a2.5 2.5 0 0 1-1.479-1.479z"}),d.jsx("path",{stroke:"currentColor",strokeLinejoin:"round",strokeWidth:1.5,d:"M10.781 11.832A4.795 4.795 0 0 0 4.75 16.46v3.79a1 1 0 0 0 1 1h3.79a4.79 4.79 0 0 0 4.628-6.03m-3.387-3.388a4.8 4.8 0 0 1 3.387 3.387m-3.387-3.387l3.19-3.19m.197 6.577l3.19-3.19m-3.387-3.387l3.19-3.19a2.395 2.395 0 0 1 3.387 3.387l-3.19 3.19m-3.387-3.387l3.387 3.387"})]})})}function Nu(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:d.jsx("path",{fill:"currentColor",d:"M10.414 15H3.586l-1.631 4.505a.75.75 0 1 1-1.41-.51l5.08-14.03a1.463 1.463 0 0 1 2.75 0l5.08 14.03a.75.75 0 1 1-1.411.51Zm4.532-5.098c.913-1.683 2.703-2.205 4.284-2.205c1.047 0 2.084.312 2.878.885c.801.577 1.392 1.455 1.392 2.548v8.12a.75.75 0 0 1-1.5 0v-.06l-.044.025c-.893.52-2.096.785-3.451.785c-1.051 0-2.048-.315-2.795-.948c-.76-.643-1.217-1.578-1.217-2.702c0-.919.349-1.861 1.168-2.563c.81-.694 2-1.087 3.569-1.087H22v-1.57c0-.503-.263-.967-.769-1.332c-.513-.37-1.235-.6-2.001-.6c-1.319 0-2.429.43-2.966 1.42a.75.75 0 0 1-1.318-.716M9.87 13.5L7 5.572L4.13 13.5Zm12.13.7h-2.77c-1.331 0-2.134.333-2.593.726a1.82 1.82 0 0 0-.644 1.424c0 .689.267 1.203.686 1.557c.43.365 1.065.593 1.826.593c1.183 0 2.102-.235 2.697-.581c.582-.34.798-.74.798-1.134Z"})})}function Ou(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:d.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2.25 15.75l5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5m10.5-11.25h.008v.008h-.008zm.375 0a.375.375 0 1 1-.75 0a.375.375 0 0 1 .75 0"})})}function Au(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:d.jsx("path",{fill:"currentColor",d:"M7 7h3v3h12V7h3v11h2V7a2.006 2.006 0 0 0-2-2h-3V4a2.006 2.006 0 0 0-2-2h-8a2.006 2.006 0 0 0-2 2v1H7a2.006 2.006 0 0 0-2 2v21a2.006 2.006 0 0 0 2 2h9v-2H7zm5-3h8v4h-8zm18 20h-8.172l2.586-2.586L23 20l-5 5l5 5l1.414-1.414L21.828 26H30zM12 13h-2v2h2zm10 0h-8v2h8zm-10 5h-2v2h2zm-2 7h2v-2h-2zm4-5h4v-2h-4z"})})}function it({label:e,onClick:t,disabled:n,children:r}){return d.jsx(At,{label:e,className:"toolbar__item",children:d.jsx("button",{type:"button",onClick:t,disabled:n,"aria-label":e,className:"toolbar__button",children:d.jsx("span",{className:"toolbar__icon",children:r})})})}function Pu({activePanel:e,onToggleGuidePanel:t,onToggleThemesPanel:n,onToggleFontsPanel:r,onToggleLogosPanel:s,lang:o}){return d.jsxs("div",{className:"toolbar__toolbar",id:"dev-bar",tabIndex:0,role:"toolbar","aria-label":E("toolbar.label",o),children:[d.jsx(it,{label:e===A.GUIDE?E("panel.close",o):E("guide.open",o),onClick:t,children:d.jsx(ju,{})}),d.jsx(it,{label:e===A.THEMES?E("panel.close",o):E("themes.open",o),onClick:n,children:d.jsx(Ru,{})}),d.jsx(it,{label:e===A.FONTS?E("panel.close",o):E("fonts.open",o),onClick:r,children:d.jsx(Nu,{})}),d.jsx(it,{label:e===A.LOGOS?E("panel.close",o):E("logos.open",o),onClick:s,children:d.jsx(Ou,{})}),d.jsx(it,{label:E("themes.copy_theme",o),onClick:async()=>{try{await navigator.clipboard.writeText(ku()),Gt.success(E("themes.copy_theme.success",o),{description:E("themes.copy_theme.success.description",o),duration:6e3})}catch{Gt.error(E("themes.copy_theme.error",o))}},children:d.jsx(Au,{})})]})}function fn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ne=fn();function ns(e){Ne=e}var Oe={exec:()=>null};function Be(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),s=t[r];return s||(s=e(r),t[r]=s),s}}function T(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(J.caret,"$1"),n=n.replace(s,i),r},getRegex:()=>new RegExp(n,t)};return r}var Iu=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),J={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Be(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Be(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Be(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Be(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Be(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Be(e=>new RegExp(`^ {0,${e}}>`))},Zu=/^(?:[ \t]*(?:\n|$))+/,Cu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Lu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,at=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Du=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,pn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,rs=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ss=T(rs).replace(/bull/g,pn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Mu=T(rs).replace(/bull/g,pn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Fu=/^[^\n]+/,gn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Bu=T(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Uu=T(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,pn).getRegex(),Pt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vu=T("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",bn).replace("tag",Pt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),os=T(mn).replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pt).getRegex(),Gu=T(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",os).getRegex(),_n={blockquote:Gu,code:Cu,def:Bu,fences:Lu,heading:Du,hr:at,html:Vu,lheading:ss,list:Uu,newline:Zu,paragraph:os,table:Oe,text:Fu},is=T("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pt).getRegex(),Yu={..._n,lheading:Mu,table:is,paragraph:T(mn).replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",is).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pt).getRegex()},Hu={..._n,html:T(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Oe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:T(mn).replace("hr",at).replace("heading",` *#{1,6} *[^
78
- ]`).replace("lheading",ss).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ju=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,as=/^( {2,}|\\)\n(?!\s*$)/,Wu=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ue=/[\p{P}\p{S}]/u,It=/[\s\p{P}\p{S}]/u,vn=/[^\s\p{P}\p{S}]/u,Ku=T(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,It).getRegex(),ls=/(?!~)[\p{P}\p{S}]/u,Xu=/(?!~)[\s\p{P}\p{S}]/u,Qu=/(?:[^\s\p{P}\p{S}]|~)/u,ed=T(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Iu?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),cs=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,td=T(cs,"u").replace(/punct/g,Ue).getRegex(),nd=T(cs,"u").replace(/punct/g,ls).getRegex(),us="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",rd=T(us,"gu").replace(/notPunctSpace/g,vn).replace(/punctSpace/g,It).replace(/punct/g,Ue).getRegex(),sd=T(us,"gu").replace(/notPunctSpace/g,Qu).replace(/punctSpace/g,Xu).replace(/punct/g,ls).getRegex(),od=T("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vn).replace(/punctSpace/g,It).replace(/punct/g,Ue).getRegex(),id=T(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ue).getRegex(),ad="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ld=T(ad,"gu").replace(/notPunctSpace/g,vn).replace(/punctSpace/g,It).replace(/punct/g,Ue).getRegex(),cd=T(/\\(punct)/,"gu").replace(/punct/g,Ue).getRegex(),ud=T(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),dd=T(bn).replace("(?:-->|$)","-->").getRegex(),hd=T("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",dd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,fd=T(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Zt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ds=T(/^!?\[(label)\]\[(ref)\]/).replace("label",Zt).replace("ref",gn).getRegex(),hs=T(/^!?\[(ref)\](?:\[\])?/).replace("ref",gn).getRegex(),pd=T("reflink|nolink(?!\\()","g").replace("reflink",ds).replace("nolink",hs).getRegex(),fs=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,wn={_backpedal:Oe,anyPunctuation:cd,autolink:ud,blockSkip:ed,br:as,code:qu,del:Oe,delLDelim:Oe,delRDelim:Oe,emStrongLDelim:td,emStrongRDelimAst:rd,emStrongRDelimUnd:od,escape:Ju,link:fd,nolink:hs,punctuation:Ku,reflink:ds,reflinkSearch:pd,tag:hd,text:Wu,url:Oe},md={...wn,link:T(/^!?\[(label)\]\((.*?)\)/).replace("label",Zt).getRegex(),reflink:T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zt).getRegex()},xn={...wn,emStrongRDelimAst:sd,emStrongLDelim:nd,delLDelim:id,delRDelim:ld,url:T(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",fs).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:T(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",fs).getRegex()},gd={...xn,br:T(as).replace("{2,}","*").getRegex(),text:T(xn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ct={normal:_n,gfm:Yu,pedantic:Hu},lt={normal:wn,gfm:xn,breaks:gd,pedantic:md},bd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ps=e=>bd[e];function me(e,t){if(t){if(J.escapeTest.test(e))return e.replace(J.escapeReplace,ps)}else if(J.escapeTestNoEncode.test(e))return e.replace(J.escapeReplaceNoEncode,ps);return e}function ms(e){try{e=encodeURI(e).replace(J.percentDecode,"%")}catch{return null}return e}function gs(e,t){let n=e.replace(J.findPipe,(o,i,a)=>{let u=!1,l=i;for(;--l>=0&&a[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(J.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(J.slashPipe,"|");return r}function $e(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function bs(e){let t=e.split(`
76
+ `}return r}function Hc(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e.trim())}function Mr(e){if(typeof e=="number"&&Number.isFinite(e))return{amount:e,unit:"px"};const t=String(e).trim().match(/^(-?\d*\.?\d+)\s*([a-z%]*)/i);return t?{amount:Number(t[1]),unit:t[2]||"px"}:{amount:0,unit:"px"}}const Jc={fr:{"guide.open":"Guide","guide.empty":"Ce thème ne dispose pour l'instant d'aucun guide utilisateur.","guide.fullscreen.enter":"Plein écran","guide.fullscreen.exit":"Quitter le plein écran","toolbar.label":"Barre d'outils Yama","panel.close":"Fermer le panneau","themes.open":"Apparence","themes.active_theme":"Thème actif","themes.switch_theme":"Changer de thème","themes.copy_theme":"Copier l'apparence","themes.copy_theme.success":"Apparence copiée","themes.copy_theme.success.description":"Vous pouvez maintenant coller l'apparence sauvegardée au niveau de l'édition de votre site sur Yama CMS","themes.copy_theme.error":"Impossible de copier l'apparence","fonts.open":"Polices","fonts.title":"Polices","fonts.no_matches":"Aucune police","logos.open":"Logos","logos.title":"Logos","logos.choose":"Choisir un fichier","logos.height":"Hauteur","logos.height.favicon":"Le navigateur impose la taille du favicon","logos.empty":"Aucun logo","logos.too_large":"Fichier trop volumineux (max 300 Ko)","logos.invalid_type":"Format d'image non pris en charge"},en:{"guide.open":"Guide","guide.empty":"This theme does not have a user guide yet.","guide.fullscreen.enter":"Full screen","guide.fullscreen.exit":"Exit full screen","toolbar.label":"Yama Toolbar","panel.close":"Close panel","themes.open":"Appearance","themes.active_theme":"Active theme","themes.switch_theme":"Switch theme","themes.copy_theme":"Copy appearance","themes.copy_theme.success":"Appearance copied","themes.copy_theme.success.description":"You can now paste the saved appearance when editing your site on Yama CMS","themes.copy_theme.error":"Unable to copy appearance","fonts.open":"Fonts","fonts.title":"Fonts","fonts.no_matches":"No fonts found","logos.open":"Logos","logos.title":"Logos","logos.choose":"Choose a file","logos.height":"Height","logos.height.favicon":"The browser controls the favicon size","logos.empty":"No logo","logos.too_large":"File is too large (max 300 KB)","logos.invalid_type":"Unsupported image format"},es:{"guide.open":"Guide","guide.empty":"Este tema aún no tiene guía de usuario.","guide.fullscreen.enter":"Pantalla completa","guide.fullscreen.exit":"Salir de pantalla completa","toolbar.label":"Barra de herramientas Yama","panel.close":"Cerrar el panel","themes.open":"Apariencia","themes.active_theme":"Tema activo","themes.switch_theme":"Cambiar de tema","themes.copy_theme":"Copiar la apariencia","themes.copy_theme.success":"Apariencia copiada","themes.copy_theme.success.description":"Ahora puede pegar la apariencia guardada al editar su sitio en Yama CMS","themes.copy_theme.error":"No se puede copiar la apariencia","fonts.open":"Fuentes","fonts.title":"Fuentes","fonts.no_matches":"Ninguna fuente","logos.open":"Logos","logos.title":"Logos","logos.choose":"Elegir un archivo","logos.height":"Altura","logos.height.favicon":"El navegador impone el tamaño del favicon","logos.empty":"Ningún logo","logos.too_large":"El archivo es demasiado grande (máx. 300 KB)","logos.invalid_type":"Formato de imagen no compatible"},it:{"guide.open":"Guide","guide.empty":"Questo tema non dispone ancora di una guida utente.","guide.fullscreen.enter":"Schermo intero","guide.fullscreen.exit":"Esci dallo schermo intero","toolbar.label":"Barra degli strumenti Yama","panel.close":"Chiudi il pannello","themes.open":"Aspetto","themes.active_theme":"Tema attivo","themes.switch_theme":"Cambia tema","themes.copy_theme":"Copia l'aspetto","themes.copy_theme.success":"Aspetto copiato","themes.copy_theme.success.description":"Ora puoi incollare l'aspetto salvato durante la modifica del tuo sito su Yama CMS","themes.copy_theme.error":"Impossibile copiare l'aspetto","fonts.open":"Caratteri","fonts.title":"Caratteri","fonts.no_matches":"Nessun carattere","logos.open":"Loghi","logos.title":"Loghi","logos.choose":"Scegli un file","logos.height":"Altezza","logos.height.favicon":"Il browser imposta la dimensione della favicon","logos.empty":"Nessun logo","logos.too_large":"File troppo grande (max 300 KB)","logos.invalid_type":"Formato immagine non supportato"},de:{"guide.open":"Guide","guide.empty":"Für dieses Theme gibt es noch keinen Benutzerleitfaden.","guide.fullscreen.enter":"Vollbild","guide.fullscreen.exit":"Vollbild beenden","toolbar.label":"Yama-Werkzeugleiste","panel.close":"Panel schließen","themes.open":"Erscheinungsbild","themes.active_theme":"Aktives Theme","themes.switch_theme":"Theme wechseln","themes.copy_theme":"Erscheinungsbild kopieren","themes.copy_theme.success":"Erscheinungsbild kopiert","themes.copy_theme.success.description":"Sie können das gespeicherte Erscheinungsbild jetzt in der Bearbeitung Ihrer Website auf Yama CMS einfügen","themes.copy_theme.error":"Erscheinungsbild nicht kopierbar","fonts.open":"Schriften","fonts.title":"Schriften","fonts.no_matches":"Keine Schrift gefunden","logos.open":"Logos","logos.title":"Logos","logos.choose":"Datei wählen","logos.height":"Höhe","logos.height.favicon":"Die Favicon-Größe legt der Browser fest","logos.empty":"Kein Logo","logos.too_large":"Datei ist zu groß (max. 300 KB)","logos.invalid_type":"Nicht unterstütztes Bildformat"}},T=(e,t,n)=>Jc[t]?.[e]??n??e;var zt={exports:{}},Fr;function qc(){if(Fr)return zt.exports;Fr=1;function e(t,n=100,r={}){if(typeof t!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(n<0)throw new RangeError("`wait` must not be negative.");const{immediate:o}=typeof r=="boolean"?{immediate:r}:r;let s,i,a,u,l;function d(){const b=s,v=i;return s=void 0,i=void 0,l=t.apply(b,v),l}function c(){const b=Date.now()-u;b<n&&b>=0?a=setTimeout(c,n-b):(a=void 0,o||(l=d()))}const m=function(...b){if(s&&this!==s&&Object.getPrototypeOf(this)===Object.getPrototypeOf(s))throw new Error("Debounced method called with different contexts of the same prototype.");s=this,i=b,u=Date.now();const v=o&&!a;return a||(a=setTimeout(c,n)),v&&(l=d()),l};return Object.defineProperty(m,"isPending",{get(){return a!==void 0}}),m.clear=()=>{a&&(clearTimeout(a),a=void 0)},m.flush=()=>{a&&m.trigger()},m.trigger=()=>{l=d(),m.clear()},m}return zt.exports.debounce=e,zt.exports=e,zt.exports}var Wc=qc();const Kc=Ao(Wc),ot=Symbol("clean");let ie=[],Te=0;const St=4,Tt=globalThis.nanostoresGlobal||={epoch:0};let Xc=()=>{let e;for(Te=0;Te<ie.length;Te+=St)try{ie[Te](ie[Te+1].value,ie[Te+2],ie[Te+3])}catch(t){e=t}if(ie.length=0,e)throw e};const $t=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(r){return n.lc=t.push(r),()=>{for(let s=Te+St;s<ie.length;)ie[s]===r?ie.splice(s,St):s+=St;let o=t.indexOf(r);~o&&(t.splice(o,1),--n.lc||n.off())}},notify(r,o){Tt.epoch++;let s=!ie.length&&!0;for(let i of t)ie.push(i,n,r,o);s&&Xc()},off(){},set(r){let o=n.value;n.eq(o,r)||(n.value=r,n.notify(o))},subscribe(r){let o=n.listen(r);return r(n.value),o},value:e};return process.env.NODE_ENV!=="production"&&(n[ot]=()=>{t=[],n.lc=0,n.off()}),n},Qc=5,Fe=6,Nt=10;let eu=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Nt]||(e.events[n+Nt]=r(o=>{e.events[n].reduceRight((s,i)=>(i(s),s),{shared:{},...o})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let o=e.events[n],s=o.indexOf(t);o.splice(s,1),o.length||(delete e.events[n],e.events[n+Nt](),delete e.events[n+Nt])});const tu=1e3;let nu=(e,t)=>eu(e,r=>{let o=t(r);o&&e.events[Fe].push(o)},Qc,r=>{let o=e.listen;e.listen=(...i)=>(!e.lc&&!e.active&&(e.active=!0,r()),o(...i));let s=e.off;if(e.events[Fe]=[],e.off=()=>{s(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let i of e.events[Fe])i();e.events[Fe]=[]}},tu)},process.env.NODE_ENV!=="production"){let i=e[ot];e[ot]=()=>{for(let a of e.events[Fe])a();e.events[Fe]=[],e.active=!1,i()}}return()=>{e.listen=o,e.off=s}}),Br={};function ru(e){Br[e]||(Br[e]=!0,typeof console<"u"&&console.warn&&(console.groupCollapsed("Nano Stores: "+e),console.trace("Source of deprecated call"),console.groupEnd()))}let ou=(e,t,n)=>{Array.isArray(e)||(e=[e]);let r,o,s=()=>{if(o===Tt.epoch)return;o=Tt.epoch;let l=e.map(d=>d.get());if(!r||l.some((d,c)=>d!==r[c])){r=l;let d=t(...l);d&&d.then&&d.t?(process.env.NODE_ENV!=="production"&&ru("Use @nanostores/async for async computed. We will remove Promise support in computed() in Nano Stores 2.0"),d.then(c=>{r===l&&i.set(c)})):(i.set(d),o=Tt.epoch)}},i=$t(void 0),a=i.get;if(i.get=()=>(s(),a()),process.env.NODE_ENV!=="production"){let l=i[ot];i[ot]=()=>{r=void 0,o=void 0,i.value=void 0,l()}}let u=s;return nu(i,()=>{let l=e.map(d=>d.listen(u));return s(),()=>{for(let d of l)d()}}),i};const su=(e,t)=>ou(e,t);function Ur(e,t){let n=iu(t),r=e;for(let o of n){if(r==null)return;r=r[o]}return r}const Vr=/(.*)\[(\d+)\]/;function iu(e){return e.split(".").flatMap(t=>Yr(t))}function Yr(e){if(Vr.test(e)){let[,t,n]=e.match(Vr);return[...Yr(t),n]}return[e]}function au(e,t,n){let r=new Set(t);return e.listen((o,s,i)=>{(i===void 0?t.some(a=>s===void 0||o[a]!==s[a]||Ur(o,a)!==Ur(s,a)):r.has(i)||r.has(i.split(/\.|\[/)[0]))&&n(o,s,i)})}let cn=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function un(e,{keys:t,deps:n=[e,t],ssr:r}={}){let o=h.useRef();o.current=e.get();let s=h.useCallback(u=>(cn(o,u)(e.value),t?.length>0?au(e,t,cn(o,u)):e.listen(cn(o,u))),n),i=()=>o.current,a=i;return r&&"init"in e&&(a=r==="initial"?()=>e.init:r),h.useSyncExternalStore(s,i,a)}const lu=on({filename:ke(),src:ke(),height:rt().optional()}),cu=sn(ke(),lu),uu=jr({embeddedCode:ke().optional()}).catchall(ke()),du=on({logo:cu.optional(),fonts:uu.optional(),themes:Vc.optional()}),hu=['<link rel="preconnect" href="https://fonts.googleapis.com">','<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>'],Gr="data-yama-fonts";function dn(e={}){return Object.entries(e).filter(t=>t[0]!=="embeddedCode"&&!!t[1])}function pu(e,t){const n=e.replaceAll(" ","+"),r=t.map(Nn.toString).sort();return r.length?`family=${n}:ital,wght@${r.join(";")}`:`family=${n}`}function fu(e,t){const n=dn(e).map(([o,s])=>{const i=t[o];return pu(i?.fontName??s,i?.variants??[])});if(!n.length)return e.embeddedCode??"";const r=`https://fonts.googleapis.com/css2?${n.join("&")}&display=swap`;return[...hu,`<link href="${r}" rel="stylesheet">`].join(`
77
+ `)}function mu(e){for(const[n,r]of dn(e))document.body.style.setProperty(`--font-${n}`,`"${r}", sans-serif`);if(document.querySelectorAll(`link[${Gr}]`).forEach(n=>n.remove()),!e.embeddedCode)return;const t=document.createElement("template");t.innerHTML=e.embeddedCode;for(const n of t.content.querySelectorAll("link"))n.setAttribute(Gr,""),document.head.append(n)}const gu=300*1024,Hr=["image/svg+xml","image/png","image/webp","image/jpeg","image/x-icon","image/vnd.microsoft.icon"],bu=Hr.join(","),vu=/\.(svg|png|webp|jpe?g|ico)$/i;function Jr(e={}){return Object.entries(e).filter(t=>!!t[1]?.src)}function _u(e,t){if(e instanceof HTMLImageElement){e.src=t.src,t.height?(e.style.height=`${t.height}px`,e.style.width="auto"):e.style.removeProperty("height");return}e instanceof HTMLLinkElement&&(e.href=t.src)}function yu(e){let t=document.querySelector('link[rel="icon"]');t||(t=document.createElement("link"),t.rel="icon",document.head.append(t)),t.href=e}function qr(e){for(const[t,n]of Jr(e))document.querySelectorAll(`[data-yama-logo="${CSS.escape(t)}"]`).forEach(r=>{_u(r,n)});e.favicon?.src&&yu(e.favicon.src)}function ku(e){return Hr.includes(e.type)||vu.test(e.name)}function wu(e){return ku(e)?e.size>gu?Promise.reject("too_large"):new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t({filename:e.name,src:String(r.result??"")}),r.onerror=()=>n("invalid_type"),r.readAsDataURL(e)}):Promise.reject("invalid_type")}const Ot=$t(void 0),jt=$t(void 0),st=$t({}),Wr={},xu=su([Ot,jt,st],(e,t,n)=>({logo:e,fonts:t,themes:n}));function Eu(e){const t=du.safeParse(e);return t.success?(Kr(t.data.logo),Qr(t.data.fonts),st.set(t.data.themes??{}),!0):(console.error("[yama-toolbar] invalid config",t.error),!1)}function Kr(e){Ot.set(e),e&&(qr(e),requestAnimationFrame(()=>qr(e)))}function Xr(e,t){const n=Ot.get(),r=n?.[e];!n||!r||Kr({...n,[e]:{...r,...t}})}function Qr(e){jt.set(e),e&&mu(e)}function zu(e,t,n){const r=st.get(),o=r[e]?.[t];o&&st.set({...r,[e]:{...r[e],[t]:{...o,value:n}}})}function Su(e,t){const n=jt.get();if(!n)return;const r=n[e]!==t.fontName;if(Wr[e]=t,!r)return;const o={...n,[e]:t.fontName};o.embeddedCode=fu(o,Wr),Qr(o)}function Tu(){return JSON.stringify(xu.get(),null,2)}const eo="yama-toolbar-overrides";function $u(e={}){const t=un(st),n=Object.keys(t),[r,o]=h.useState(()=>n[0]??"default"),s=h.useRef(r);s.current=r;const i=t[r]??{};h.useEffect(()=>{const l=Object.keys(t);l.length!==0&&(l.includes(r)||o(l[0]))},[t,r]),h.useEffect(()=>{r==="default"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",r)},[r]),h.useEffect(()=>{let l=document.getElementById(eo);l||(l=document.createElement("style"),l.id=eo,document.head.appendChild(l)),l.textContent=Gc(t)},[t]);const a=h.useMemo(()=>Kc((l,d)=>{zu(s.current,l,d)},50),[]);return h.useEffect(()=>()=>a.clear(),[a]),{themes:t,activeTheme:r,themeNames:n,activeVars:i,changeTheme:l=>{if(n.length<=1)return;const d=l&&n.includes(l)?l:n[(n.indexOf(r)+1)%n.length];o(d),e.onThemeChanged?.(d)},updateVar:a}}function hn(...e){return e.filter(Boolean).join(" ")}function At(e){const{isOpen:t,title:n,titleAdditional:r,children:o,headerButtons:s,className:i,...a}=e;return p.jsxs("div",{...a,className:hn("panel",t?"panel--open":"panel--closed",i),"aria-hidden":!t,inert:!t,children:[p.jsxs("div",{className:"panel__header",children:[p.jsxs("p",{className:"panel__title",children:[n,r&&r]}),p.jsx("div",{className:"panel__spacer"}),s&&p.jsx("div",{className:"panel__buttons",children:s})]}),p.jsx("div",{className:"panel__body",children:o})]})}function Pt({label:e,placement:t="top",className:n,children:r}){return p.jsxs("div",{className:hn("tooltip",`tooltip--${t}`,n),children:[r,p.jsx("span",{className:"tooltip__bubble",role:"tooltip",children:e})]})}function to(e){const{children:t,onClick:n,className:r,icon:o,iconPosition:s,...i}=e;return p.jsxs("button",{className:hn("button",r),onClick:n,...i,children:[o&&s==="left"&&o,t,o&&s==="right"&&o]})}function Nu(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24","aria-hidden":!0,children:p.jsx("path",{fill:"currentColor",d:"M7.5 2c-1.79 1.15-3 3.18-3 5.5s1.21 4.35 3.03 5.5C4.46 13 2 10.54 2 7.5A5.5 5.5 0 0 1 7.5 2m11.57 1.5l1.43 1.43L4.93 20.5L3.5 19.07zm-6.18 2.43L11.41 5L9.97 6l.42-1.7L9 3.24l1.75-.12l.58-1.65L12 3.1l1.73.03l-1.35 1.13zm-3.3 3.61l-1.16-.73l-1.12.78l.34-1.32l-1.09-.83l1.36-.09l.45-1.29l.51 1.27l1.36.03l-1.05.87zM19 13.5a5.5 5.5 0 0 1-5.5 5.5c-1.22 0-2.35-.4-3.26-1.07l7.69-7.69c.67.91 1.07 2.04 1.07 3.26m-4.4 6.58l2.77-1.15l-.24 3.35zm4.33-2.7l1.15-2.77l2.2 2.54zm1.15-4.96l-1.14-2.78l3.34.24zM9.63 18.93l2.77 1.15l-2.53 2.19z"})})}function Ou({name:e,entry:t,onUpdateVar:n}){const r=Mr(t.value),o=Yc(t.widgetOptions),s=Math.max(o.max,r.amount),i=h.useRef(!1),[a,u]=h.useState(r.amount);h.useEffect(()=>{i.current||u(Mr(t.value).amount)},[t.value]);const l=c=>{u(c),n(e,`${c}${r.unit}`)},d=s===o.min?0:(a-o.min)/(s-o.min)*100;return p.jsxs("div",{className:"theme-var__inputs theme-var__inputs--range",children:[p.jsx("input",{"aria-label":e,"aria-valuetext":`${a}${r.unit}`,type:"range",min:o.min,max:s,step:o.step,value:a,onChange:c=>l(c.target.valueAsNumber),onPointerDown:c=>{c.currentTarget.setPointerCapture(c.pointerId),i.current=!0},onLostPointerCapture:()=>{i.current=!1},className:"theme-var__range",style:{"--theme-range-progress":`${d}%`}}),p.jsxs("span",{className:"theme-var__value",children:[a,r.unit]})]})}function ju({name:e,entry:t,onUpdateVar:n}){const r=String(t.value);return p.jsxs("div",{className:"theme-var",children:[p.jsxs("div",{className:"theme-var__header",children:[p.jsx("div",{className:"theme-var__label",children:e}),p.jsx("div",{className:"theme-var__type",children:t.widget})]}),t.widget==="range"?p.jsx(Ou,{name:e,entry:t,onUpdateVar:n}):p.jsxs("div",{className:"theme-var__inputs",children:[t.widget==="color"&&p.jsx("input",{"aria-label":e,type:"color",value:Hc(r)?r:"#000000",onChange:o=>n(e,o.target.value),className:"theme-var__swatch"}),p.jsx("input",{"aria-label":e,type:"text",value:r,onChange:o=>n(e,o.target.value),className:"theme-var__text"})]})]})}function Au({isOpen:e,lang:t}){const{activeTheme:n,themeNames:r,activeVars:o,changeTheme:s,updateVar:i}=$u(),a=r.length;return p.jsx(At,{className:"themes-panel",isOpen:e,title:T("themes.active_theme",t),titleAdditional:p.jsx("span",{className:"themes-panel__active-theme",children:n}),headerButtons:a>1&&p.jsx(Pt,{label:T("themes.switch_theme",t),placement:"top-right",children:p.jsx(to,{onClick:()=>s(),disabled:a<=1,"aria-label":T("themes.switch_theme",t),children:p.jsx(Nu,{})})}),children:p.jsx("div",{className:"themes-panel__grid",children:Object.entries(o).map(([u,l])=>p.jsx(ju,{name:u,entry:l,onUpdateVar:i},u))})})}function Pu(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:p.jsxs("g",{fill:"none",children:[p.jsx("path",{fill:"currentColor",d:"M8.6 1.418a.64.64 0 0 0-1.2 0l-.167.45a4 4 0 0 1-2.366 2.365l-.449.166a.64.64 0 0 0 0 1.202l.45.166a4 4 0 0 1 2.365 2.366l.166.449a.64.64 0 0 0 1.202 0l.166-.45a4 4 0 0 1 2.366-2.365l.449-.166a.64.64 0 0 0 0-1.202l-.45-.166a4 4 0 0 1-2.365-2.366zM3.876 7.261a.4.4 0 0 0-.752 0l-.103.281a2.5 2.5 0 0 1-1.479 1.479l-.28.103a.4.4 0 0 0 0 .752l.28.103a2.5 2.5 0 0 1 1.479 1.479l.103.28a.4.4 0 0 0 .752 0l.103-.28a2.5 2.5 0 0 1 1.479-1.479l.28-.103a.4.4 0 0 0 0-.752l-.28-.103a2.5 2.5 0 0 1-1.479-1.479z"}),p.jsx("path",{stroke:"currentColor",strokeLinejoin:"round",strokeWidth:1.5,d:"M10.781 11.832A4.795 4.795 0 0 0 4.75 16.46v3.79a1 1 0 0 0 1 1h3.79a4.79 4.79 0 0 0 4.628-6.03m-3.387-3.388a4.8 4.8 0 0 1 3.387 3.387m-3.387-3.387l3.19-3.19m.197 6.577l3.19-3.19m-3.387-3.387l3.19-3.19a2.395 2.395 0 0 1 3.387 3.387l-3.19 3.19m-3.387-3.387l3.387 3.387"})]})})}function Iu(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:p.jsx("path",{fill:"currentColor",d:"M10.414 15H3.586l-1.631 4.505a.75.75 0 1 1-1.41-.51l5.08-14.03a1.463 1.463 0 0 1 2.75 0l5.08 14.03a.75.75 0 1 1-1.411.51Zm4.532-5.098c.913-1.683 2.703-2.205 4.284-2.205c1.047 0 2.084.312 2.878.885c.801.577 1.392 1.455 1.392 2.548v8.12a.75.75 0 0 1-1.5 0v-.06l-.044.025c-.893.52-2.096.785-3.451.785c-1.051 0-2.048-.315-2.795-.948c-.76-.643-1.217-1.578-1.217-2.702c0-.919.349-1.861 1.168-2.563c.81-.694 2-1.087 3.569-1.087H22v-1.57c0-.503-.263-.967-.769-1.332c-.513-.37-1.235-.6-2.001-.6c-1.319 0-2.429.43-2.966 1.42a.75.75 0 0 1-1.318-.716M9.87 13.5L7 5.572L4.13 13.5Zm12.13.7h-2.77c-1.331 0-2.134.333-2.593.726a1.82 1.82 0 0 0-.644 1.424c0 .689.267 1.203.686 1.557c.43.365 1.065.593 1.826.593c1.183 0 2.102-.235 2.697-.581c.582-.34.798-.74.798-1.134Z"})})}function Zu(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:p.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2.25 15.75l5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5m10.5-11.25h.008v.008h-.008zm.375 0a.375.375 0 1 1-.75 0a.375.375 0 0 1 .75 0"})})}function Cu(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:p.jsx("path",{fill:"currentColor",d:"M7 7h3v3h12V7h3v11h2V7a2.006 2.006 0 0 0-2-2h-3V4a2.006 2.006 0 0 0-2-2h-8a2.006 2.006 0 0 0-2 2v1H7a2.006 2.006 0 0 0-2 2v21a2.006 2.006 0 0 0 2 2h9v-2H7zm5-3h8v4h-8zm18 20h-8.172l2.586-2.586L23 20l-5 5l5 5l1.414-1.414L21.828 26H30zM12 13h-2v2h2zm10 0h-8v2h8zm-10 5h-2v2h2zm-2 7h2v-2h-2zm4-5h4v-2h-4z"})})}function Ru(){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024",children:[p.jsx("path",{fill:"currentColor",d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372"}),p.jsx("path",{fill:"currentColor",d:"M464 336a48 48 0 1 0 96 0a48 48 0 1 0-96 0m72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8"})]})}function it({label:e,onClick:t,disabled:n,children:r}){return p.jsx(Pt,{label:e,className:"toolbar__item",children:p.jsx("button",{type:"button",onClick:t,disabled:n,"aria-label":e,className:"toolbar__button",children:p.jsx("span",{className:"toolbar__icon",children:r})})})}function no({children:e}){return p.jsx("div",{className:"toolbar__group",children:e})}function Lu({activePanel:e,onToggleGuidePanel:t,onToggleThemesPanel:n,onToggleFontsPanel:r,onToggleLogosPanel:o,lang:s,guideExists:i}){return p.jsxs("div",{className:"toolbar__toolbar",id:"dev-bar",tabIndex:0,role:"toolbar","aria-label":T("toolbar.label",s),children:[i&&p.jsx(no,{children:p.jsx(it,{label:e===O.GUIDE?T("panel.close",s):T("guide.open",s),onClick:t,children:p.jsx(Ru,{})})}),p.jsxs(no,{children:[p.jsx(it,{label:e===O.THEMES?T("panel.close",s):T("themes.open",s),onClick:n,children:p.jsx(Pu,{})}),p.jsx(it,{label:e===O.FONTS?T("panel.close",s):T("fonts.open",s),onClick:r,children:p.jsx(Iu,{})}),p.jsx(it,{label:e===O.LOGOS?T("panel.close",s):T("logos.open",s),onClick:o,children:p.jsx(Zu,{})}),p.jsx(it,{label:T("themes.copy_theme",s),onClick:async()=>{try{await navigator.clipboard.writeText(Tu()),Yt.success(T("themes.copy_theme.success",s),{description:T("themes.copy_theme.success.description",s),duration:6e3})}catch{Yt.error(T("themes.copy_theme.error",s))}},children:p.jsx(Cu,{})})]})]})}function pn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var je=pn();function ro(e){je=e}var Ae={exec:()=>null};function Be(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),o=t[r];return o||(o=e(r),t[r]=o),o}}function S(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(o,s)=>{let i=typeof s=="string"?s:s.source;return i=i.replace(J.caret,"$1"),n=n.replace(o,i),r},getRegex:()=>new RegExp(n,t)};return r}var Du=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),J={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Be(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Be(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Be(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Be(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Be(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Be(e=>new RegExp(`^ {0,${e}}>`))},Mu=/^(?:[ \t]*(?:\n|$))+/,Fu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,at=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Uu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,oo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,so=S(oo).replace(/bull/g,fn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vu=S(oo).replace(/bull/g,fn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Yu=/^[^\n]+/,gn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Gu=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Hu=S(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,fn).getRegex(),It="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ju=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",bn).replace("tag",It).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),io=S(mn).replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",It).getRegex(),qu=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",io).getRegex(),vn={blockquote:qu,code:Fu,def:Gu,fences:Bu,heading:Uu,hr:at,html:Ju,lheading:so,list:Hu,newline:Mu,paragraph:io,table:Ae,text:Yu},ao=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",It).getRegex(),Wu={...vn,lheading:Vu,table:ao,paragraph:S(mn).replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ao).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",It).getRegex()},Ku={...vn,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ae,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(mn).replace("hr",at).replace("heading",` *#{1,6} *[^
78
+ ]`).replace("lheading",so).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Qu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lo=/^( {2,}|\\)\n(?!\s*$)/,ed=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ue=/[\p{P}\p{S}]/u,Zt=/[\s\p{P}\p{S}]/u,_n=/[^\s\p{P}\p{S}]/u,td=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zt).getRegex(),co=/(?!~)[\p{P}\p{S}]/u,nd=/(?!~)[\s\p{P}\p{S}]/u,rd=/(?:[^\s\p{P}\p{S}]|~)/u,od=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Du?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),uo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,sd=S(uo,"u").replace(/punct/g,Ue).getRegex(),id=S(uo,"u").replace(/punct/g,co).getRegex(),ho="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ad=S(ho,"gu").replace(/notPunctSpace/g,_n).replace(/punctSpace/g,Zt).replace(/punct/g,Ue).getRegex(),ld=S(ho,"gu").replace(/notPunctSpace/g,rd).replace(/punctSpace/g,nd).replace(/punct/g,co).getRegex(),cd=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_n).replace(/punctSpace/g,Zt).replace(/punct/g,Ue).getRegex(),ud=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ue).getRegex(),dd="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",hd=S(dd,"gu").replace(/notPunctSpace/g,_n).replace(/punctSpace/g,Zt).replace(/punct/g,Ue).getRegex(),pd=S(/\\(punct)/,"gu").replace(/punct/g,Ue).getRegex(),fd=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),md=S(bn).replace("(?:-->|$)","-->").getRegex(),gd=S("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",md).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ct=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bd=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ct).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),po=S(/^!?\[(label)\]\[(ref)\]/).replace("label",Ct).replace("ref",gn).getRegex(),fo=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",gn).getRegex(),vd=S("reflink|nolink(?!\\()","g").replace("reflink",po).replace("nolink",fo).getRegex(),mo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,yn={_backpedal:Ae,anyPunctuation:pd,autolink:fd,blockSkip:od,br:lo,code:Qu,del:Ae,delLDelim:Ae,delRDelim:Ae,emStrongLDelim:sd,emStrongRDelimAst:ad,emStrongRDelimUnd:cd,escape:Xu,link:bd,nolink:fo,punctuation:td,reflink:po,reflinkSearch:vd,tag:gd,text:ed,url:Ae},_d={...yn,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",Ct).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ct).getRegex()},kn={...yn,emStrongRDelimAst:ld,emStrongLDelim:id,delLDelim:ud,delRDelim:hd,url:S(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",mo).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:S(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",mo).getRegex()},yd={...kn,br:S(lo).replace("{2,}","*").getRegex(),text:S(kn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Rt={normal:vn,gfm:Wu,pedantic:Ku},lt={normal:yn,gfm:kn,breaks:yd,pedantic:_d},kd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},go=e=>kd[e];function me(e,t){if(t){if(J.escapeTest.test(e))return e.replace(J.escapeReplace,go)}else if(J.escapeTestNoEncode.test(e))return e.replace(J.escapeReplaceNoEncode,go);return e}function bo(e){try{e=encodeURI(e).replace(J.percentDecode,"%")}catch{return null}return e}function vo(e,t){let n=e.replace(J.findPipe,(s,i,a)=>{let u=!1,l=i;for(;--l>=0&&a[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(J.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(J.slashPipe,"|");return r}function $e(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function _o(e){let t=e.split(`
79
79
  `),n=t.length-1;for(;n>=0&&J.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
80
- `)}function _d(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function vd(e,t=0){let n=t,r="";for(let s of e)if(s===" "){let o=4-n%4;r+=" ".repeat(o),n+=o}else r+=s,n++;return r}function _s(e,t,n,r,s){let o=t.href,i=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,u}function wd(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
81
- `).map(o=>{let i=o.match(n.other.beginningSpace);if(i===null)return o;let[a]=i;return a.length>=s.length?o.slice(s.length):o}).join(`
82
- `)}var Lt=class{options;rules;lexer;constructor(e){this.options=e||Ne}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:bs(t[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=wd(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=$e(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:$e(t[0],`
80
+ `)}function wd(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function xd(e,t=0){let n=t,r="";for(let o of e)if(o===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=o,n++;return r}function yo(e,t,n,r,o){let s=t.href,i=t.title||null,a=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,u}function Ed(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let o=r[1];return t.split(`
81
+ `).map(s=>{let i=s.match(n.other.beginningSpace);if(i===null)return s;let[a]=i;return a.length>=o.length?s.slice(o.length):s}).join(`
82
+ `)}var Lt=class{options;rules;lexer;constructor(e){this.options=e||je}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:_o(t[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Ed(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=$e(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:$e(t[0],`
83
83
  `),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:$e(t[0],`
84
84
  `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=$e(t[0],`
85
85
  `).split(`
86
- `),r="",s="",o=[];for(;n.length>0;){let i=!1,a=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))a.push(n[u]),i=!0;else if(!i)a.push(n[u]);else break;n=n.slice(u);let l=a.join(`
87
- `),h=l.replace(this.rules.other.blockquoteSetextReplace,`
86
+ `),r="",o="",s=[];for(;n.length>0;){let i=!1,a=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))a.push(n[u]),i=!0;else if(!i)a.push(n[u]);else break;n=n.slice(u);let l=a.join(`
87
+ `),d=l.replace(this.rules.other.blockquoteSetextReplace,`
88
88
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
89
- ${l}`:l,s=s?`${s}
90
- ${h}`:h;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,o,!0),this.lexer.state.top=c,n.length===0)break;let m=o.at(-1);if(m?.type==="code")break;if(m?.type==="blockquote"){let b=m,_=b.raw+`
89
+ ${l}`:l,o=o?`${o}
90
+ ${d}`:d;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=c,n.length===0)break;let m=s.at(-1);if(m?.type==="code")break;if(m?.type==="blockquote"){let b=m,v=b.raw+`
91
91
  `+n.join(`
92
- `),L=this.blockquote(_);o[o.length-1]=L,r=r.substring(0,r.length-b.raw.length)+L.raw,s=s.substring(0,s.length-b.text.length)+L.text;break}else if(m?.type==="list"){let b=m,_=b.raw+`
92
+ `),D=this.blockquote(v);s[s.length-1]=D,r=r.substring(0,r.length-b.raw.length)+D.raw,o=o.substring(0,o.length-b.text.length)+D.text;break}else if(m?.type==="list"){let b=m,v=b.raw+`
93
93
  `+n.join(`
94
- `),L=this.list(_);o[o.length-1]=L,r=r.substring(0,r.length-m.raw.length)+L.raw,s=s.substring(0,s.length-b.raw.length)+L.raw,n=_.substring(o.at(-1).raw.length).split(`
95
- `);continue}}return{type:"blockquote",raw:r,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let o=this.rules.other.listItemRegex(n),i=!1;for(;e;){let u=!1,l="",h="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let c=vd(t[2].split(`
94
+ `),D=this.list(v);s[s.length-1]=D,r=r.substring(0,r.length-m.raw.length)+D.raw,o=o.substring(0,o.length-b.raw.length)+D.raw,n=v.substring(s.at(-1).raw.length).split(`
95
+ `);continue}}return{type:"blockquote",raw:r,tokens:s,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),i=!1;for(;e;){let u=!1,l="",d="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let c=xd(t[2].split(`
96
96
  `,1)[0],t[1].length),m=e.split(`
97
- `,1)[0],b=!c.trim(),_=0;if(this.options.pedantic?(_=2,h=c.trimStart()):b?_=t[1].length+1:(_=c.search(this.rules.other.nonSpaceChar),_=_>4?1:_,h=c.slice(_),_+=t[1].length),b&&this.rules.other.blankLine.test(m)&&(l+=m+`
98
- `,e=e.substring(m.length+1),u=!0),!u){let L=this.rules.other.nextBulletRegex(_),S=this.rules.other.hrRegex(_),z=this.rules.other.fencesBeginRegex(_),ce=this.rules.other.headingBeginRegex(_),B=this.rules.other.htmlBeginRegex(_),j=this.rules.other.blockquoteBeginRegex(_);for(;e;){let P=e.split(`
99
- `,1)[0],V;if(m=P,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),V=m):V=m.replace(this.rules.other.tabCharGlobal," "),z.test(m)||ce.test(m)||B.test(m)||j.test(m)||L.test(m)||S.test(m))break;if(V.search(this.rules.other.nonSpaceChar)>=_||!m.trim())h+=`
100
- `+V.slice(_);else{if(b||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||z.test(c)||ce.test(c)||S.test(c))break;h+=`
101
- `+m}b=!m.trim(),l+=P+`
102
- `,e=e.substring(P.length+1),c=V.slice(_)}}s.loose||(i?s.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(i=!0)),s.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),s.raw+=l}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let u of s.items){this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]);let l=u.tokens[0];if(u.task&&(l?.type==="text"||l?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),l.raw=l.raw.replace(this.rules.other.listReplaceTask,""),l.text=l.text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(u.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};u.checked=c.checked,s.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=c.raw+u.tokens[0].raw,u.tokens[0].text=c.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(c)):u.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):u.tokens.unshift(c)}}else u.task&&(u.task=!1);if(!s.loose){let h=u.tokens.filter(m=>m.type==="space"),c=h.length>0&&h.some(m=>this.rules.other.anyLine.test(m.raw));s.loose=c}}if(s.loose)for(let u of s.items){u.loose=!0;for(let l of u.tokens)l.type==="text"&&(l.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=bs(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:$e(t[0],`
103
- `),href:r,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=gs(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
104
- `):[],o={type:"table",raw:$e(t[0],`
105
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let i of r)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<n.length;i++)o.header.push({text:n[i],tokens:this.lexer.inline(n[i]),header:!0,align:o.align[i]});for(let i of s)o.rows.push(gs(i,o.header.length).map((a,u)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:o.align[u]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:$e(t[0],`
97
+ `,1)[0],b=!c.trim(),v=0;if(this.options.pedantic?(v=2,d=c.trimStart()):b?v=t[1].length+1:(v=c.search(this.rules.other.nonSpaceChar),v=v>4?1:v,d=c.slice(v),v+=t[1].length),b&&this.rules.other.blankLine.test(m)&&(l+=m+`
98
+ `,e=e.substring(m.length+1),u=!0),!u){let D=this.rules.other.nextBulletRegex(v),z=this.rules.other.hrRegex(v),w=this.rules.other.fencesBeginRegex(v),ce=this.rules.other.headingBeginRegex(v),B=this.rules.other.htmlBeginRegex(v),$=this.rules.other.blockquoteBeginRegex(v);for(;e;){let I=e.split(`
99
+ `,1)[0],V;if(m=I,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),V=m):V=m.replace(this.rules.other.tabCharGlobal," "),w.test(m)||ce.test(m)||B.test(m)||$.test(m)||D.test(m)||z.test(m))break;if(V.search(this.rules.other.nonSpaceChar)>=v||!m.trim())d+=`
100
+ `+V.slice(v);else{if(b||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(c)||ce.test(c)||z.test(c))break;d+=`
101
+ `+m}b=!m.trim(),l+=I+`
102
+ `,e=e.substring(I.length+1),c=V.slice(v)}}o.loose||(i?o.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(i=!0)),o.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),o.raw+=l}let a=o.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let u of o.items){this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]);let l=u.tokens[0];if(u.task&&(l?.type==="text"||l?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),l.raw=l.raw.replace(this.rules.other.listReplaceTask,""),l.text=l.text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(u.raw);if(d){let c={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};u.checked=c.checked,o.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=c.raw+u.tokens[0].raw,u.tokens[0].text=c.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(c)):u.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):u.tokens.unshift(c)}}else u.task&&(u.task=!1);if(!o.loose){let d=u.tokens.filter(m=>m.type==="space"),c=d.length>0&&d.some(m=>this.rules.other.anyLine.test(m.raw));o.loose=c}}if(o.loose)for(let u of o.items){u.loose=!0;for(let l of u.tokens)l.type==="text"&&(l.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=_o(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:$e(t[0],`
103
+ `),href:r,title:o}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=vo(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
104
+ `):[],s={type:"table",raw:$e(t[0],`
105
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let i of r)this.rules.other.tableAlignRight.test(i)?s.align.push("right"):this.rules.other.tableAlignCenter.test(i)?s.align.push("center"):this.rules.other.tableAlignLeft.test(i)?s.align.push("left"):s.align.push(null);for(let i=0;i<n.length;i++)s.header.push({text:n[i],tokens:this.lexer.inline(n[i]),header:!0,align:s.align[i]});for(let i of o)s.rows.push(vo(i,s.header.length).map((a,u)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[u]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:$e(t[0],`
106
106
  `),depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
107
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let o=$e(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{let o=_d(t[2],"()");if(o===-2)return;if(o>-1){let i=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),_s(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return _s(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,o,i,a=s,u=0,l=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+s);(r=l.exec(t))!==null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=[...o].length,r[3]||r[4]){a+=i;continue}else if((r[5]||r[6])&&s%3&&!((s+i)%3)){u+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+u);let h=[...r[0]][0].length,c=e.slice(0,s+r.index+h+i);if(Math.min(s,i)%2){let b=c.slice(1,-1);return{type:"em",raw:c,text:b,tokens:this.lexer.inlineTokens(b)}}let m=c.slice(2,-2);return{type:"strong",raw:c,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,o,i,a=s,u=this.rules.inline.delRDelim;for(u.lastIndex=0,t=t.slice(-1*e.length+s);(r=u.exec(t))!==null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o||(i=[...o].length,i!==s))continue;if(r[3]||r[4]){a+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a);let l=[...r[0]][0].length,h=e.slice(0,s+r.index+l+i),c=h.slice(s,-s);return{type:"del",raw:h,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},ae=class Tn{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ne,this.options.tokenizer=this.options.tokenizer||new Lt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:J,block:Ct.normal,inline:lt.normal};this.options.pedantic?(n.block=Ct.pedantic,n.inline=lt.pedantic):this.options.gfm&&(n.block=Ct.gfm,this.options.breaks?n.inline=lt.breaks:n.inline=lt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ct,inline:lt}}static lex(t,n){return new Tn(n).lex(t)}static lexInline(t,n){return new Tn(n).inlineTokens(t)}lex(t){t=t.replace(J.carriageReturn,`
108
- `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(J.tabCharGlobal," ").replace(J.spaceLine,""));let s=1/0;for(;t;){if(t.length<s)s=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=n.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
109
- `:n.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
107
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=$e(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=wd(t[2],"()");if(s===-2)return;if(s>-1){let i=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let r=t[2],o="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),yo(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[r.toLowerCase()];if(!o){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return yo(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,s,i,a=o,u=0,l=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+o);(r=l.exec(t))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=[...s].length,r[3]||r[4]){a+=i;continue}else if((r[5]||r[6])&&o%3&&!((o+i)%3)){u+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+u);let d=[...r[0]][0].length,c=e.slice(0,o+r.index+d+i);if(Math.min(o,i)%2){let b=c.slice(1,-1);return{type:"em",raw:c,text:b,tokens:this.lexer.inlineTokens(b)}}let m=c.slice(2,-2);return{type:"strong",raw:c,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,s,i,a=o,u=this.rules.inline.delRDelim;for(u.lastIndex=0,t=t.slice(-1*e.length+o);(r=u.exec(t))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(i=[...s].length,i!==o))continue;if(r[3]||r[4]){a+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a);let l=[...r[0]][0].length,d=e.slice(0,o+r.index+l+i),c=d.slice(o,-o);return{type:"del",raw:d,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let o;do o=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(o!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},ae=class Sn{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||je,this.options.tokenizer=this.options.tokenizer||new Lt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:J,block:Rt.normal,inline:lt.normal};this.options.pedantic?(n.block=Rt.pedantic,n.inline=lt.pedantic):this.options.gfm&&(n.block=Rt.gfm,this.options.breaks?n.inline=lt.breaks:n.inline=lt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Rt,inline:lt}}static lex(t,n){return new Sn(n).lex(t)}static lexInline(t,n){return new Sn(n).inlineTokens(t)}lex(t){t=t.replace(J.carriageReturn,`
108
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(J.tabCharGlobal," ").replace(J.spaceLine,""));let o=1/0;for(;t;){if(t.length<o)o=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},t,n))?(t=t.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let a=n.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
109
+ `:n.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
110
110
  `)?"":`
111
- `)+o.raw,a.text+=`
112
- `+o.text,this.inlineQueue.at(-1).src=a.text):n.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
111
+ `)+s.raw,a.text+=`
112
+ `+s.text,this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
113
113
  `)?"":`
114
- `)+o.raw,a.text+=`
115
- `+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},n.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),n.push(o);continue}let i=t;if(this.options.extensions?.startBlock){let a=1/0,u=t.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},u),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(i=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(i))){let a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
114
+ `)+s.raw,a.text+=`
115
+ `+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),n.push(s);continue}let i=t;if(this.options.extensions?.startBlock){let a=1/0,u=t.slice(1),l;this.options.extensions.startBlock.forEach(d=>{l=d.call({lexer:this},u),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(i=t.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){let a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
116
116
  `)?"":`
117
- `)+o.raw,a.text+=`
118
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(o),r=i.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
117
+ `)+s.raw,a.text+=`
118
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s),r=i.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
119
119
  `)?"":`
120
- `)+o.raw,a.text+=`
121
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)o=s[2]?s[2].length:0,r=r.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,a="",u=1/0;for(;t;){if(t.length<u)u=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}i||(a=""),i=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let c=n.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(t,r,a)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(t,r,a)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),n.push(l);continue}let h=t;if(this.options.extensions?.startInline){let c=1/0,m=t.slice(1),b;this.options.extensions.startInline.forEach(_=>{b=_.call({lexer:this},m),typeof b=="number"&&b>=0&&(c=Math.min(c,b))}),c<1/0&&c>=0&&(h=t.substring(0,c+1))}if(l=this.tokenizer.inlineText(h)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):n.push(l);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(this.options.silent)console.error(n);else throw new Error(n)}},Dt=class{options;parser;constructor(e){this.options=e||Ne}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(J.notSpaceStart)?.[0],s=e.replace(J.endingNewline,"")+`
122
- `;return r?'<pre><code class="language-'+me(r)+'">'+(n?s:me(s,!0))+`</code></pre>
123
- `:"<pre><code>"+(n?s:me(s,!0))+`</code></pre>
120
+ `)+s.raw,a.text+=`
121
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)s=o[2]?o[2].length:0,r=r.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,a="",u=1/0;for(;t;){if(t.length<u)u=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}i||(a=""),i=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let c=n.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(t,r,a)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(t,r,a)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),n.push(l);continue}let d=t;if(this.options.extensions?.startInline){let c=1/0,m=t.slice(1),b;this.options.extensions.startInline.forEach(v=>{b=v.call({lexer:this},m),typeof b=="number"&&b>=0&&(c=Math.min(c,b))}),c<1/0&&c>=0&&(d=t.substring(0,c+1))}if(l=this.tokenizer.inlineText(d)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):n.push(l);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(this.options.silent)console.error(n);else throw new Error(n)}},Dt=class{options;parser;constructor(e){this.options=e||je}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(J.notSpaceStart)?.[0],o=e.replace(J.endingNewline,"")+`
122
+ `;return r?'<pre><code class="language-'+me(r)+'">'+(n?o:me(o,!0))+`</code></pre>
123
+ `:"<pre><code>"+(n?o:me(o,!0))+`</code></pre>
124
124
  `}blockquote({tokens:e}){return`<blockquote>
125
125
  ${this.parser.parse(e)}</blockquote>
126
126
  `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
127
127
  `}hr(e){return`<hr>
128
- `}list(e){let t=e.ordered,n=e.start,r="";for(let i=0;i<e.items.length;i++){let a=e.items[i];r+=this.listitem(a)}let s=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+s+o+`>
129
- `+r+"</"+s+`>
128
+ `}list(e){let t=e.ordered,n=e.start,r="";for(let i=0;i<e.items.length;i++){let a=e.items[i];r+=this.listitem(a)}let o=t?"ol":"ul",s=t&&n!==1?' start="'+n+'"':"";return"<"+o+s+`>
129
+ `+r+"</"+o+`>
130
130
  `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
131
131
  `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
132
- `}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){let o=e.rows[s];n="";for(let i=0;i<o.length;i++)n+=this.tablecell(o[i]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
132
+ `}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let r="";for(let o=0;o<e.rows.length;o++){let s=e.rows[o];n="";for(let i=0;i<s.length;i++)n+=this.tablecell(s[i]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
133
133
  <thead>
134
134
  `+t+`</thead>
135
135
  `+r+`</table>
136
136
  `}tablerow({text:e}){return`<tr>
137
137
  ${e}</tr>
138
138
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
139
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${me(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),s=ms(e);if(s===null)return r;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+me(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=ms(e);if(s===null)return me(n);e=s;let o=`<img src="${e}" alt="${me(n)}"`;return t&&(o+=` title="${me(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:me(e.text)}},yn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},le=class Sn{options;renderer;textRenderer;constructor(t){this.options=t||Ne,this.options.renderer=this.options.renderer||new Dt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new yn}static parse(t,n){return new Sn(n).parse(t)}static parseInline(t,n){return new Sn(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let s=t[r];if(this.options.extensions?.renderers?.[s.type]){let i=s,a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){n+=a||"";continue}}let o=s;switch(o.type){case"space":{n+=this.renderer.space(o);break}case"hr":{n+=this.renderer.hr(o);break}case"heading":{n+=this.renderer.heading(o);break}case"code":{n+=this.renderer.code(o);break}case"table":{n+=this.renderer.table(o);break}case"blockquote":{n+=this.renderer.blockquote(o);break}case"list":{n+=this.renderer.list(o);break}case"checkbox":{n+=this.renderer.checkbox(o);break}case"html":{n+=this.renderer.html(o);break}case"def":{n+=this.renderer.def(o);break}case"paragraph":{n+=this.renderer.paragraph(o);break}case"text":{n+=this.renderer.text(o);break}default:{let i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<t.length;s++){let o=t[s];if(this.options.extensions?.renderers?.[o.type]){let a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=a||"";continue}}let i=o;switch(i.type){case"escape":{r+=n.text(i);break}case"html":{r+=n.html(i);break}case"link":{r+=n.link(i);break}case"image":{r+=n.image(i);break}case"checkbox":{r+=n.checkbox(i);break}case"strong":{r+=n.strong(i);break}case"em":{r+=n.em(i);break}case"codespan":{r+=n.codespan(i);break}case"br":{r+=n.br(i);break}case"del":{r+=n.del(i);break}case"text":{r+=n.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ct=class{options;block;constructor(e){this.options=e||Ne}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ae.lex:ae.lexInline}provideParser(e=this.block){return e?le.parse:le.parseInline}},xd=class{defaults=fn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=le;Renderer=Dt;TextRenderer=yn;Lexer=ae;Tokenizer=Lt;Hooks=ct;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let s=r;for(let o of s.header)n=n.concat(this.walkTokens(o.tokens,t));for(let o of s.rows)for(let i of o)n=n.concat(this.walkTokens(i.tokens,t));break}case"list":{let s=r;n=n.concat(this.walkTokens(s.items,t));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let i=s[o].flat(1/0);n=n.concat(this.walkTokens(i,t))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=t.renderers[s.name];o?t.renderers[s.name]=function(...i){let a=s.renderer.apply(this,i);return a===!1&&(a=o.apply(this,i)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){let s=this.defaults.renderer||new Dt(this.defaults);for(let o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,a=n.renderer[i],u=s[i];s[i]=(...l)=>{let h=a.apply(s,l);return h===!1&&(h=u.apply(s,l)),h||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new Lt(this.defaults);for(let o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,a=n.tokenizer[i],u=s[i];s[i]=(...l)=>{let h=a.apply(s,l);return h===!1&&(h=u.apply(s,l)),h}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new ct;for(let o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,a=n.hooks[i],u=s[i];ct.passThroughHooks.has(o)?s[i]=l=>{if(this.defaults.async&&ct.passThroughHooksRespectAsync.has(o))return(async()=>{let c=await a.call(s,l);return u.call(s,c)})();let h=a.call(s,l);return u.call(s,h)}:s[i]=(...l)=>{if(this.defaults.async)return(async()=>{let c=await a.apply(s,l);return c===!1&&(c=await u.apply(s,l)),c})();let h=a.apply(s,l);return h===!1&&(h=u.apply(s,l)),h}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(i){let a=[];return a.push(o.call(this,i)),s&&(a=a.concat(s.call(this,i))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ae.lex(e,t??this.defaults)}parser(e,t){return le.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},s={...this.defaults,...r},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let i=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(e):e?ae.lex:ae.lexInline)(i,s),u=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let l=await(s.hooks?await s.hooks.provideParser(e):e?le.parse:le.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(l):l})().catch(o);try{s.hooks&&(t=s.hooks.preprocess(t));let i=(s.hooks?s.hooks.provideLexer(e):e?ae.lex:ae.lexInline)(t,s);s.hooks&&(i=s.hooks.processAllTokens(i)),s.walkTokens&&this.walkTokens(i,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(e):e?le.parse:le.parseInline)(i,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(i){return o(i)}}}onError(e,t){return n=>{if(n.message+=`
140
- Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+me(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Ae=new xd;function $(e,t){return Ae.parse(e,t)}$.options=$.setOptions=function(e){return Ae.setOptions(e),$.defaults=Ae.defaults,ns($.defaults),$},$.getDefaults=fn,$.defaults=Ne,$.use=function(...e){return Ae.use(...e),$.defaults=Ae.defaults,ns($.defaults),$},$.walkTokens=function(e,t){return Ae.walkTokens(e,t)},$.parseInline=Ae.parseInline,$.Parser=le,$.parser=le.parse,$.Renderer=Dt,$.TextRenderer=yn,$.Lexer=ae,$.lexer=ae.lex,$.Tokenizer=Lt,$.Hooks=ct,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,le.parse,ae.lex;function yd(){const e={fill:"none",stroke:"currentColor",strokeWidth:1.5};return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":!0,...e,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})})}function kd(){const e={fill:"none",stroke:"currentColor",strokeWidth:1.5};return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":!0,...e,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"})})}const zd="[data-yama-guide-fullscreen]",Ed=f.memo(function({isOpen:t,guideFallbackLang:n,lang:r}){const[s,o]=f.useState(""),[i,a]=f.useState(!1),u=f.useMemo(()=>({__html:s}),[s]);f.useEffect(()=>{t||a(!1)},[t]),f.useEffect(()=>{if(!t||!i)return;const h=c=>{c.key==="Escape"&&a(!1)};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,i]),f.useEffect(()=>{if(!i||!t)return;const h=document.documentElement,c=h.style.overflow;return h.style.overflow="hidden",()=>{h.style.overflow=c}},[i,t]),f.useEffect(()=>{if(!t||s)return;let h=!1;return(async()=>{try{let c="";const m=[document.documentElement.lang,n].filter(b=>!!b);for(const b of m){const _=await fetch(`/guide/guide.${b}.md`);if(_.ok){let L=await _.text();if(L.startsWith("<!doctype html>")){console.info("No guide found for language",b);continue}c=L;break}}if(!c){o($.parse(E("guide.empty",r)));return}h||o($.parse(c))}catch{h||o($.parse(E("guide.empty",r)))}})(),()=>{h=!0}},[t,s,n,r]);const l=d.jsx(Ot,{isOpen:t,title:E("guide.open",r),className:"main-panel","data-yama-guide-fullscreen":i?"":void 0,headerButtons:d.jsxs(At,{label:E(i?"guide.fullscreen.exit":"guide.fullscreen.enter",r),placement:i?"bottom-right":"top-right",children:[" ",d.jsx(ts,{onClick:()=>a(h=>!h),"aria-pressed":i,"aria-label":E(i?"guide.fullscreen.exit":"guide.fullscreen.enter",r),children:i?d.jsx(kd,{}):d.jsx(yd,{})})]}),children:s&&d.jsx("div",{className:"main-panel__prose-container",children:d.jsx("div",{className:"main-panel__prose",dangerouslySetInnerHTML:u})})});if(t&&i){const h=document.getElementById("yama-toolbar");if(h)return $n.createPortal(l,h)}return l}),vs="Lorem ipsum dolor sit amet",Td="Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.";function Sd(e){return`"${e}", var(--font-sans)`}function $d({area:e,family:t,lang:n}){const r=Sd(t);return d.jsxs("div",{className:"font-family",children:[d.jsxs("div",{className:"font-family__header",children:[d.jsx("div",{className:"font-family__label",children:e}),d.jsx("div",{className:"font-family__name",children:t})]}),d.jsxs("div",{className:"font-family__inputs",children:[d.jsx("span",{className:"font-family__specimen",style:{fontFamily:r},"aria-hidden":!0,children:"Aa"}),d.jsx(jn,{autoLoad:!0,defaultValue:t,inputId:`yama-font-${e}`,noMatches:E("fonts.no_matches",n),fontVariants:s=>yu(e,s)})]}),d.jsxs("div",{className:"font-family__sample",style:{fontFamily:r},children:[d.jsx("p",{className:"font-family__sample-title",children:vs}),d.jsx("p",{className:"font-family__sample-subtitle",children:vs}),d.jsx("p",{className:"font-family__sample-body",children:Td})]})]})}function jd({isOpen:e,lang:t}){const n=un(Nt),r=dn(n);return d.jsx(Ot,{className:"fonts-panel",isOpen:e,title:E("fonts.title",t),children:d.jsx("div",{className:"fonts-panel__grid",children:r.map(([s,o])=>d.jsx($d,{area:s,family:o,lang:t},s))})})}function Rd({slot:e,filename:t,src:n,height:r,lang:s}){const o=async h=>{if(h)try{Xr(e,await _u(h))}catch(c){Gt.error(E(c==="too_large"?"logos.too_large":"logos.invalid_type",s))}},i=h=>{!Number.isFinite(h)||h<1||Xr(e,{height:Math.round(h)})},a=`yama-logo-${e}`,u=e==="favicon",l=d.jsxs("label",{className:"logo-slot__height",children:[d.jsx("span",{className:"logo-slot__height-label",children:E("logos.height",s)}),d.jsxs("span",{className:"logo-slot__height-value",children:[d.jsx("input",{type:"number",min:1,step:1,value:r??"",disabled:u,"aria-label":E("logos.height",s),onChange:h=>i(h.target.valueAsNumber)}),d.jsx("span",{className:"logo-slot__height-unit",children:"px"})]})]});return d.jsxs("div",{className:"logo-slot",children:[d.jsx("div",{className:"logo-slot__header",children:d.jsx("div",{className:"logo-slot__label",children:e})}),d.jsx("label",{className:"logo-slot__preview",htmlFor:a,children:n?d.jsx("img",{src:n,alt:"",className:"logo-slot__image"}):d.jsx("span",{className:"logo-slot__empty",children:E("logos.empty",s)})}),d.jsxs("div",{className:"logo-slot__inputs",children:[d.jsxs("label",{className:"logo-slot__file",htmlFor:a,children:[d.jsx("input",{id:a,type:"file",accept:fu,"aria-label":E("logos.choose",s),onChange:h=>{o(h.target.files?.[0]),h.currentTarget.value=""}}),d.jsx("span",{children:t||E("logos.choose",s)})]}),u?d.jsx(At,{label:E("logos.height.favicon",s),placement:"top-right",className:"logo-slot__height-tip",children:l}):l]})]})}function Nd({isOpen:e,lang:t}){const n=un(Rt),r=Jr(n);return d.jsx(Ot,{className:"logos-panel",isOpen:e,title:E("logos.title",t),children:r.length?d.jsx("div",{className:"logos-panel__grid",children:r.map(([s,o])=>d.jsx(Rd,{slot:s,filename:o.filename,src:o.src,height:o.height,lang:t},s))}):d.jsx("p",{className:"logos-panel__empty",children:E("logos.empty",t)})})}const A={NONE:"none",GUIDE:"guide",THEMES:"themes",FONTS:"fonts",LOGOS:"logos"};function Od({guideDisplayOnMount:e,guideFallbackLang:t}){const[n,r]=f.useState(()=>e?A.GUIDE:A.NONE),s=Is(n),o=f.useRef(null),i=document.documentElement.lang;f.useEffect(()=>{if(n===A.NONE)return;const c=m=>{const b=o.current,_=m.target;!b||!(_ instanceof Node)||_ instanceof Element&&_.closest(zd)||b.contains(_)||r(A.NONE)};return document.addEventListener("pointerdown",c,!0),()=>document.removeEventListener("pointerdown",c,!0)},[n]);const a=()=>r(c=>c===A.GUIDE?A.NONE:A.GUIDE),u=()=>r(c=>c===A.THEMES?A.NONE:A.THEMES),l=()=>r(c=>c===A.FONTS?A.NONE:A.FONTS),h=()=>r(c=>c===A.LOGOS?A.NONE:A.LOGOS);return d.jsxs(d.Fragment,{children:[d.jsx(lo,{position:"top-center",richColors:!0}),d.jsx("div",{className:"toolbar","data-placement":"bottom-center","data-panel-open":n!==A.NONE?"":void 0,children:d.jsxs("div",{className:"toolbar__content",children:[d.jsxs("div",{className:"toolbar__inner",ref:o,children:[d.jsx(Pu,{activePanel:n,onToggleGuidePanel:a,onToggleThemesPanel:u,onToggleFontsPanel:l,onToggleLogosPanel:h,lang:i}),d.jsx(Ed,{isOpen:s===A.GUIDE,guideFallbackLang:t,lang:i}),d.jsx($u,{isOpen:s===A.THEMES,lang:i}),d.jsx(jd,{isOpen:s===A.FONTS,lang:i}),d.jsx(Nd,{isOpen:s===A.LOGOS,lang:i})]}),d.jsx("div",{className:"toolbar__spacer","aria-hidden":!0})]})})]})}const ws=()=>{try{const t=JSON.parse(document.body.dataset.yttConfig??"{}");if(!wu(t))return}catch(t){console.error("[yama-toolbar] invalid data-ytt-config",t);return}const e=document.createElement("div");e.id="yama-toolbar",document.body.appendChild(e),Ke.createRoot(e).render(d.jsx(Od,{guideDisplayOnMount:document.body.dataset.yttDisplayGuide==="true",guideFallbackLang:document.body.dataset.yttGuideFallbackLang}))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ws):ws()}));
139
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${me(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),o=bo(e);if(o===null)return r;e=o;let s='<a href="'+e+'"';return t&&(s+=' title="'+me(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=bo(e);if(o===null)return me(n);e=o;let s=`<img src="${e}" alt="${me(n)}"`;return t&&(s+=` title="${me(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:me(e.text)}},wn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},le=class Tn{options;renderer;textRenderer;constructor(t){this.options=t||je,this.options.renderer=this.options.renderer||new Dt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wn}static parse(t,n){return new Tn(n).parse(t)}static parseInline(t,n){return new Tn(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let o=t[r];if(this.options.extensions?.renderers?.[o.type]){let i=o,a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){n+=a||"";continue}}let s=o;switch(s.type){case"space":{n+=this.renderer.space(s);break}case"hr":{n+=this.renderer.hr(s);break}case"heading":{n+=this.renderer.heading(s);break}case"code":{n+=this.renderer.code(s);break}case"table":{n+=this.renderer.table(s);break}case"blockquote":{n+=this.renderer.blockquote(s);break}case"list":{n+=this.renderer.list(s);break}case"checkbox":{n+=this.renderer.checkbox(s);break}case"html":{n+=this.renderer.html(s);break}case"def":{n+=this.renderer.def(s);break}case"paragraph":{n+=this.renderer.paragraph(s);break}case"text":{n+=this.renderer.text(s);break}default:{let i='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}let i=s;switch(i.type){case"escape":{r+=n.text(i);break}case"html":{r+=n.html(i);break}case"link":{r+=n.link(i);break}case"image":{r+=n.image(i);break}case"checkbox":{r+=n.checkbox(i);break}case"strong":{r+=n.strong(i);break}case"em":{r+=n.em(i);break}case"codespan":{r+=n.codespan(i);break}case"br":{r+=n.br(i);break}case"del":{r+=n.del(i);break}case"text":{r+=n.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ct=class{options;block;constructor(e){this.options=e||je}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ae.lex:ae.lexInline}provideParser(e=this.block){return e?le.parse:le.parseInline}},zd=class{defaults=pn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=le;Renderer=Dt;TextRenderer=wn;Lexer=ae;Tokenizer=Lt;Hooks=ct;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let o=r;for(let s of o.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of o.rows)for(let i of s)n=n.concat(this.walkTokens(i.tokens,t));break}case"list":{let o=r;n=n.concat(this.walkTokens(o.items,t));break}default:{let o=r;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(s=>{let i=o[s].flat(1/0);n=n.concat(this.walkTokens(i,t))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let s=t.renderers[o.name];s?t.renderers[o.name]=function(...i){let a=o.renderer.apply(this,i);return a===!1&&(a=s.apply(this,i)),a}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[o.level];s?s.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){let o=this.defaults.renderer||new Dt(this.defaults);for(let s in n.renderer){if(!(s in o))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let i=s,a=n.renderer[i],u=o[i];o[i]=(...l)=>{let d=a.apply(o,l);return d===!1&&(d=u.apply(o,l)),d||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new Lt(this.defaults);for(let s in n.tokenizer){if(!(s in o))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let i=s,a=n.tokenizer[i],u=o[i];o[i]=(...l)=>{let d=a.apply(o,l);return d===!1&&(d=u.apply(o,l)),d}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new ct;for(let s in n.hooks){if(!(s in o))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let i=s,a=n.hooks[i],u=o[i];ct.passThroughHooks.has(s)?o[i]=l=>{if(this.defaults.async&&ct.passThroughHooksRespectAsync.has(s))return(async()=>{let c=await a.call(o,l);return u.call(o,c)})();let d=a.call(o,l);return u.call(o,d)}:o[i]=(...l)=>{if(this.defaults.async)return(async()=>{let c=await a.apply(o,l);return c===!1&&(c=await u.apply(o,l)),c})();let d=a.apply(o,l);return d===!1&&(d=u.apply(o,l)),d}}r.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(i){let a=[];return a.push(s.call(this,i)),o&&(a=a.concat(o.call(this,i))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ae.lex(e,t??this.defaults)}parser(e,t){return le.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},o={...this.defaults,...r},s=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let i=o.hooks?await o.hooks.preprocess(t):t,a=await(o.hooks?await o.hooks.provideLexer(e):e?ae.lex:ae.lexInline)(i,o),u=o.hooks?await o.hooks.processAllTokens(a):a;o.walkTokens&&await Promise.all(this.walkTokens(u,o.walkTokens));let l=await(o.hooks?await o.hooks.provideParser(e):e?le.parse:le.parseInline)(u,o);return o.hooks?await o.hooks.postprocess(l):l})().catch(s);try{o.hooks&&(t=o.hooks.preprocess(t));let i=(o.hooks?o.hooks.provideLexer(e):e?ae.lex:ae.lexInline)(t,o);o.hooks&&(i=o.hooks.processAllTokens(i)),o.walkTokens&&this.walkTokens(i,o.walkTokens);let a=(o.hooks?o.hooks.provideParser(e):e?le.parse:le.parseInline)(i,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(i){return s(i)}}}onError(e,t){return n=>{if(n.message+=`
140
+ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+me(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Pe=new zd;function j(e,t){return Pe.parse(e,t)}j.options=j.setOptions=function(e){return Pe.setOptions(e),j.defaults=Pe.defaults,ro(j.defaults),j},j.getDefaults=pn,j.defaults=je,j.use=function(...e){return Pe.use(...e),j.defaults=Pe.defaults,ro(j.defaults),j},j.walkTokens=function(e,t){return Pe.walkTokens(e,t)},j.parseInline=Pe.parseInline,j.Parser=le,j.parser=le.parse,j.Renderer=Dt,j.TextRenderer=wn,j.Lexer=ae,j.lexer=ae.lex,j.Tokenizer=Lt,j.Hooks=ct,j.parse=j,j.options,j.setOptions,j.use,j.walkTokens,j.parseInline,le.parse,ae.lex;function Sd(){const e={fill:"none",stroke:"currentColor",strokeWidth:1.5};return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":!0,...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})})}function Td(){const e={fill:"none",stroke:"currentColor",strokeWidth:1.5};return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":!0,...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"})})}const $d="[data-yama-guide-fullscreen]",Nd=h.memo(function({isOpen:t,markdown:n,lang:r}){const o=h.useMemo(()=>n?j.parse(n):"",[n]),[s,i]=h.useState(!1),a=h.useMemo(()=>({__html:o}),[o]);h.useEffect(()=>{t||i(!1)},[t]),h.useEffect(()=>{if(!t||!s)return;const l=d=>{d.key==="Escape"&&i(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[t,s]),h.useEffect(()=>{if(!s||!t)return;const l=document.documentElement,d=l.style.overflow;return l.style.overflow="hidden",()=>{l.style.overflow=d}},[s,t]);const u=p.jsx(At,{isOpen:t,title:T("guide.open",r),className:"main-panel","data-yama-guide-fullscreen":s?"":void 0,headerButtons:p.jsxs(Pt,{label:T(s?"guide.fullscreen.exit":"guide.fullscreen.enter",r),placement:s?"bottom-right":"top-right",children:[" ",p.jsx(to,{onClick:()=>i(l=>!l),"aria-pressed":s,"aria-label":T(s?"guide.fullscreen.exit":"guide.fullscreen.enter",r),children:s?p.jsx(Td,{}):p.jsx(Sd,{})})]}),children:o&&p.jsx("div",{className:"main-panel__prose-container",children:p.jsx("div",{className:"main-panel__prose",dangerouslySetInnerHTML:a})})});if(t&&s){const l=document.getElementById("yama-toolbar");if(l)return $n.createPortal(u,l)}return u}),ko="Lorem ipsum dolor sit amet",Od="Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.";function jd(e){return`"${e}", var(--font-sans)`}function Ad({area:e,family:t,lang:n}){const r=jd(t);return p.jsxs("div",{className:"font-family",children:[p.jsxs("div",{className:"font-family__header",children:[p.jsx("div",{className:"font-family__label",children:e}),p.jsx("div",{className:"font-family__name",children:t})]}),p.jsxs("div",{className:"font-family__inputs",children:[p.jsx("span",{className:"font-family__specimen",style:{fontFamily:r},"aria-hidden":!0,children:"Aa"}),p.jsx(Nn,{autoLoad:!0,defaultValue:t,inputId:`yama-font-${e}`,noMatches:T("fonts.no_matches",n),fontVariants:o=>Su(e,o)})]}),p.jsxs("div",{className:"font-family__sample",style:{fontFamily:r},children:[p.jsx("p",{className:"font-family__sample-title",children:ko}),p.jsx("p",{className:"font-family__sample-subtitle",children:ko}),p.jsx("p",{className:"font-family__sample-body",children:Od})]})]})}function Pd({isOpen:e,lang:t}){const n=un(jt),r=dn(n);return p.jsx(At,{className:"fonts-panel",isOpen:e,title:T("fonts.title",t),children:p.jsx("div",{className:"fonts-panel__grid",children:r.map(([o,s])=>p.jsx(Ad,{area:o,family:s,lang:t},o))})})}function Id({slot:e,filename:t,src:n,height:r,lang:o}){const s=async d=>{if(d)try{Xr(e,await wu(d))}catch(c){Yt.error(T(c==="too_large"?"logos.too_large":"logos.invalid_type",o))}},i=d=>{!Number.isFinite(d)||d<1||Xr(e,{height:Math.round(d)})},a=`yama-logo-${e}`,u=e==="favicon",l=p.jsxs("label",{className:"logo-slot__height",children:[p.jsx("span",{className:"logo-slot__height-label",children:T("logos.height",o)}),p.jsxs("span",{className:"logo-slot__height-value",children:[p.jsx("input",{type:"number",min:1,step:1,value:r??"",disabled:u,"aria-label":T("logos.height",o),onChange:d=>i(d.target.valueAsNumber)}),p.jsx("span",{className:"logo-slot__height-unit",children:"px"})]})]});return p.jsxs("div",{className:"logo-slot",children:[p.jsx("div",{className:"logo-slot__header",children:p.jsx("div",{className:"logo-slot__label",children:e})}),p.jsx("label",{className:"logo-slot__preview",htmlFor:a,children:n?p.jsx("img",{src:n,alt:"",className:"logo-slot__image"}):p.jsx("span",{className:"logo-slot__empty",children:T("logos.empty",o)})}),p.jsxs("div",{className:"logo-slot__inputs",children:[p.jsxs("label",{className:"logo-slot__file",htmlFor:a,children:[p.jsx("input",{id:a,type:"file",accept:bu,"aria-label":T("logos.choose",o),onChange:d=>{s(d.target.files?.[0]),d.currentTarget.value=""}}),p.jsx("span",{children:t||T("logos.choose",o)})]}),u?p.jsx(Pt,{label:T("logos.height.favicon",o),placement:"top-right",className:"logo-slot__height-tip",children:l}):l]})]})}function Zd({isOpen:e,lang:t}){const n=un(Ot),r=Jr(n);return p.jsx(At,{className:"logos-panel",isOpen:e,title:T("logos.title",t),children:r.length?p.jsx("div",{className:"logos-panel__grid",children:r.map(([o,s])=>p.jsx(Id,{slot:o,filename:s.filename,src:s.src,height:s.height,lang:t},o))}):p.jsx("p",{className:"logos-panel__empty",children:T("logos.empty",t)})})}const O={NONE:"none",GUIDE:"guide",THEMES:"themes",FONTS:"fonts",LOGOS:"logos"};function Cd({guideDisplayOnMount:e,guideFallbackLang:t}){const[n,r]=h.useState(O.NONE),{exists:o,markdown:s}=Mo(t),i=Ro(n),a=h.useRef(null),u=h.useRef(!1),l=document.documentElement.lang;h.useEffect(()=>{if(!o){r(v=>v===O.GUIDE?O.NONE:v);return}e&&!u.current&&(u.current=!0,r(O.GUIDE))},[o,e]),h.useEffect(()=>{if(n===O.NONE)return;const v=D=>{const z=a.current,w=D.target;!z||!(w instanceof Node)||w instanceof Element&&w.closest($d)||z.contains(w)||r(O.NONE)};return document.addEventListener("pointerdown",v,!0),()=>document.removeEventListener("pointerdown",v,!0)},[n]);const d=()=>{o&&r(v=>v===O.GUIDE?O.NONE:O.GUIDE)},c=()=>r(v=>v===O.THEMES?O.NONE:O.THEMES),m=()=>r(v=>v===O.FONTS?O.NONE:O.FONTS),b=()=>r(v=>v===O.LOGOS?O.NONE:O.LOGOS);return p.jsxs(p.Fragment,{children:[p.jsx(ps,{position:"top-center",richColors:!0}),p.jsx("div",{className:"toolbar","data-placement":"bottom-center","data-panel-open":n!==O.NONE?"":void 0,children:p.jsxs("div",{className:"toolbar__content",children:[p.jsxs("div",{className:"toolbar__inner",ref:a,children:[p.jsx(Lu,{activePanel:n,onToggleGuidePanel:d,onToggleThemesPanel:c,onToggleFontsPanel:m,onToggleLogosPanel:b,guideExists:o,lang:l}),p.jsx(Nd,{isOpen:i===O.GUIDE&&o,markdown:s,lang:l}),p.jsx(Au,{isOpen:i===O.THEMES,lang:l}),p.jsx(Pd,{isOpen:i===O.FONTS,lang:l}),p.jsx(Zd,{isOpen:i===O.LOGOS,lang:l})]}),p.jsx("div",{className:"toolbar__spacer","aria-hidden":!0})]})})]})}const wo=()=>{try{const t=JSON.parse(document.body.dataset.yttConfig??"{}");if(!Eu(t))return}catch(t){console.error("[yama-toolbar] invalid data-ytt-config",t);return}const e=document.createElement("div");e.id="yama-toolbar",document.body.appendChild(e),Ke.createRoot(e).render(p.jsx(Cd,{guideDisplayOnMount:document.body.dataset.yttDisplayGuide==="true",guideFallbackLang:document.body.dataset.yttGuideFallbackLang}))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",wo):wo()}));