@inpageedit/core 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.umd.js CHANGED
@@ -1,34 +1,34 @@
1
- (function(he,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(he=typeof globalThis<"u"?globalThis:he||self,Ee(he.InPageEditBundle={}))})(this,function(he){"use strict";var Bv=Object.defineProperty;var hf=he=>{throw TypeError(he)};var Uv=(he,Ee,We)=>Ee in he?Bv(he,Ee,{enumerable:!0,configurable:!0,writable:!0,value:We}):he[Ee]=We;var Z=(he,Ee,We)=>Uv(he,typeof Ee!="symbol"?Ee+"":Ee,We),ya=(he,Ee,We)=>Ee.has(he)||hf("Cannot "+We);var pf=(he,Ee,We)=>(ya(he,Ee,"read from private field"),We?We.call(he):Ee.get(he)),va=(he,Ee,We)=>Ee.has(he)?hf("Cannot add the same private member more than once"):Ee instanceof WeakSet?Ee.add(he):Ee.set(he,We),mf=(he,Ee,We,se)=>(ya(he,Ee,"write to private field"),se?se.call(he,We):Ee.set(he,We),We),ws=(he,Ee,We)=>(ya(he,Ee,"access private method"),We);var _t,Gr,Sr,Qr,Xr,Zr,en,Fe,dt,Er,tn,rn,nn,sn,lr,gf,yf,vf,Wn;const Ee=()=>{let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}};Promise.withResolvers||(Promise.withResolvers=Ee);var We=Object.defineProperty,se=(t,e)=>We(t,"name",{value:e,configurable:!0});function bf(){}se(bf,"noop");function Re(t){return t==null}se(Re,"isNullable");function _f(t){return!Re(t)}se(_f,"isNonNullable");function Zn(t){return t&&typeof t=="object"&&!Array.isArray(t)}se(Zn,"isPlainObject");function ba(t,e){return Object.fromEntries(Object.entries(t).filter(([r,n])=>e(r,n)))}se(ba,"filterKeys");function qt(t,e){return Object.fromEntries(Object.entries(t).map(([r,n])=>[r,e(n,r)]))}se(qt,"mapValues");function _a(t,e,r){if(!e)return{...t};const n={};for(const i of e)(r||t[i]!==void 0)&&(n[i]=t[i]);return n}se(_a,"pick");function wf(t,e){if(!e)return{...t};const r={...t};for(const n of e)Reflect.deleteProperty(r,n);return r}se(wf,"omit");function qe(t,e,r){return Object.defineProperty(t,e,{writable:!0,value:r,enumerable:!1})}se(qe,"defineProperty");function xf(t,e){return e.every(r=>t.includes(r))}se(xf,"contain");function Sf(t,e){return t.filter(r=>e.includes(r))}se(Sf,"intersection");function Ef(t,e){return t.filter(r=>!e.includes(r))}se(Ef,"difference");function Of(t,e){return Array.from(new Set([...t,...e]))}se(Of,"union");function Cf(t){return[...new Set(t)]}se(Cf,"deduplicate");function Et(t,e){const r=t?.indexOf(e);return r>=0?(t.splice(r,1),!0):!1}se(Et,"remove");function Pf(t){return Array.isArray(t)?t:Re(t)?[]:[t]}se(Pf,"makeArray");function Zt(t,e){return arguments.length===1?r=>Zt(t,r):t in globalThis&&e instanceof globalThis[t]||Object.prototype.toString.call(e).slice(8,-1)===t}se(Zt,"is");function fn(t){return Zt("ArrayBuffer",t)||Zt("SharedArrayBuffer",t)}se(fn,"isArrayBufferLike");function wa(t){return fn(t)||ArrayBuffer.isView(t)}se(wa,"isArrayBufferSource");var Ot;(t=>{t.is=fn,t.isSource=wa;function e(o){return ArrayBuffer.isView(o)?o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength):o}t.fromSource=e,se(e,"fromSource");function r(o){if(typeof Buffer<"u")return Buffer.from(o).toString("base64");let a="";const c=new Uint8Array(o);for(let l=0;l<c.byteLength;l++)a+=String.fromCharCode(c[l]);return btoa(a)}t.toBase64=r,se(r,"toBase64");function n(o){return typeof Buffer<"u"?e(Buffer.from(o,"base64")):Uint8Array.from(atob(o),a=>a.charCodeAt(0))}t.fromBase64=n,se(n,"fromBase64");function i(o){return typeof Buffer<"u"?Buffer.from(o).toString("hex"):Array.from(new Uint8Array(o),a=>a.toString(16).padStart(2,"0")).join("")}t.toHex=i,se(i,"toHex");function s(o){if(typeof Buffer<"u")return e(Buffer.from(o,"hex"));const a=o.length%2===0?o:o.slice(0,o.length-1),c=[];for(let l=0;l<a.length;l+=2)c.push(parseInt(`${a[l]}${a[l+1]}`,16));return Uint8Array.from(c).buffer}t.fromHex=s,se(s,"fromHex")})(Ot||(Ot={})),Ot.fromBase64,Ot.toBase64,Ot.fromHex,Ot.toHex;function ei(t,e=new Map){if(!t||typeof t!="object")return t;if(Zt("Date",t))return new Date(t.valueOf());if(Zt("RegExp",t))return new RegExp(t.source,t.flags);if(fn(t))return t.slice(0);if(ArrayBuffer.isView(t))return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);const r=e.get(t);if(r)return r;if(Array.isArray(t)){const i=[];return e.set(t,i),t.forEach((s,o)=>{i[o]=Reflect.apply(ei,null,[s,e])}),i}const n=Object.create(Object.getPrototypeOf(t));e.set(t,n);for(const i of Reflect.ownKeys(t)){const s={...Reflect.getOwnPropertyDescriptor(t,i)};"value"in s&&(s.value=Reflect.apply(ei,null,[s.value,e])),Reflect.defineProperty(n,i,s)}return n}se(ei,"clone");function hr(t,e,r){if(t===e||!r&&Re(t)&&Re(e))return!0;if(typeof t!=typeof e||typeof t!="object"||!t||!e)return!1;function n(i,s){return i(t)?i(e)?s(t,e):!1:i(e)?!1:void 0}return se(n,"check"),n(Array.isArray,(i,s)=>i.length===s.length&&i.every((o,a)=>hr(o,s[a])))??n(Zt("Date"),(i,s)=>i.valueOf()===s.valueOf())??n(Zt("RegExp"),(i,s)=>i.source===s.source&&i.flags===s.flags)??n(fn,(i,s)=>{if(i.byteLength!==s.byteLength)return!1;const o=new Uint8Array(i),a=new Uint8Array(s);for(let c=0;c<o.length;c++)if(o[c]!==a[c])return!1;return!0})??Object.keys({...t,...e}).every(i=>hr(t[i],e[i],r))}se(hr,"deepEqual");function $f(t){return t.charAt(0).toUpperCase()+t.slice(1)}se($f,"capitalize");function kf(t){return t.charAt(0).toLowerCase()+t.slice(1)}se(kf,"uncapitalize");function If(t){return t.replace(/[_-][a-z]/g,e=>e.slice(1).toUpperCase())}se(If,"camelCase");function xs(t,e,r){const n=[];let i=0;for(let s=0;s<t.length;s++){const o=t.charCodeAt(s);if(o>=65&&o<=90){if(i===1){const a=t.charCodeAt(s+1);a>=97&&a<=122&&n.push(r),n.push(o+32)}else i!==0&&n.push(r),n.push(o+32);i=1}else o>=97&&o<=122?(n.push(o),i=2):e.includes(o)?(i!==0&&n.push(r),i=0):n.push(o)}return String.fromCharCode(...n)}se(xs,"tokenize");function Af(t){return xs(t,[45,95],45)}se(Af,"paramCase");function Tf(t){return xs(t,[45,95],95)}se(Tf,"snakeCase");function Rf(t){return typeof t!="string"?`[${t.toString()}]`:/^[a-z_$][\w$]*$/i.test(t)?`.${t}`:`[${JSON.stringify(t)}]`}se(Rf,"formatProperty");function xa(t){return t.replace(/\/$/,"")}se(xa,"trimSlash");function Df(t){return t.startsWith("/")||(t="/"+t),xa(t)}se(Df,"sanitize");var ti;(t=>{t.millisecond=1,t.second=1e3,t.minute=t.second*60,t.hour=t.minute*60,t.day=t.hour*24,t.week=t.day*7;let e=new Date().getTimezoneOffset();function r(y){e=y}t.setTimezoneOffset=r,se(r,"setTimezoneOffset");function n(){return e}t.getTimezoneOffset=n,se(n,"getTimezoneOffset");function i(y=new Date,b){return typeof y=="number"&&(y=new Date(y)),b===void 0&&(b=e),Math.floor((y.valueOf()/t.minute-b)/1440)}t.getDateNumber=i,se(i,"getDateNumber");function s(y,b){const R=new Date(y*t.day);return b===void 0&&(b=e),new Date(+R+b*t.minute)}t.fromDateNumber=s,se(s,"fromDateNumber");const o=/\d+(?:\.\d+)?/.source,a=new RegExp(`^${["w(?:eek(?:s)?)?","d(?:ay(?:s)?)?","h(?:our(?:s)?)?","m(?:in(?:ute)?(?:s)?)?","s(?:ec(?:ond)?(?:s)?)?"].map(y=>`(${o}${y})?`).join("")}$`);function c(y){const b=a.exec(y);return b?(parseFloat(b[1])*t.week||0)+(parseFloat(b[2])*t.day||0)+(parseFloat(b[3])*t.hour||0)+(parseFloat(b[4])*t.minute||0)+(parseFloat(b[5])*t.second||0):0}t.parseTime=c,se(c,"parseTime");function l(y){const b=c(y);return b?y=Date.now()+b:/^\d{1,2}(:\d{1,2}){1,2}$/.test(y)?y=`${new Date().toLocaleDateString()}-${y}`:/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(y)&&(y=`${new Date().getFullYear()}-${y}`),y?new Date(y):new Date}t.parseDate=l,se(l,"parseDate");function u(y){const b=Math.abs(y);return b>=t.day-t.hour/2?Math.round(y/t.day)+"d":b>=t.hour-t.minute/2?Math.round(y/t.hour)+"h":b>=t.minute-t.second/2?Math.round(y/t.minute)+"m":b>=t.second?Math.round(y/t.second)+"s":y+"ms"}t.format=u,se(u,"format");function f(y,b=2){return y.toString().padStart(b,"0")}t.toDigits=f,se(f,"toDigits");function v(y,b=new Date){return y.replace("yyyy",b.getFullYear().toString()).replace("yy",b.getFullYear().toString().slice(2)).replace("MM",f(b.getMonth()+1)).replace("dd",f(b.getDate())).replace("hh",f(b.getHours())).replace("mm",f(b.getMinutes())).replace("ss",f(b.getSeconds())).replace("SSS",f(b.getMilliseconds(),3))}t.template=v,se(v,"template")})(ti||(ti={}));var Nf=Object.defineProperty,oe=(t,e)=>Nf(t,"name",{value:e,configurable:!0}),Q={shadow:Symbol.for("cordis.shadow"),receiver:Symbol.for("cordis.receiver"),original:Symbol.for("cordis.original"),store:Symbol.for("cordis.store"),events:Symbol.for("cordis.events"),static:Symbol.for("cordis.static"),filter:Symbol.for("cordis.filter"),expose:Symbol.for("cordis.expose"),isolate:Symbol.for("cordis.isolate"),internal:Symbol.for("cordis.internal"),intercept:Symbol.for("cordis.intercept"),setup:Symbol.for("cordis.setup"),invoke:Symbol.for("cordis.invoke"),extend:Symbol.for("cordis.extend"),tracker:Symbol.for("cordis.tracker"),provide:Symbol.for("cordis.provide"),immediate:Symbol.for("cordis.immediate")},Lf=function*(){}.constructor,Sa=async function*(){}.constructor;function Ss(t){return!(!t.prototype||t instanceof Lf||Sa!==Function&&t instanceof Sa)}oe(Ss,"isConstructor");function dn(t,e){const r=t.Config||t.schema;return r&&t.schema!==!1&&(e=r(e)),e??{}}oe(dn,"resolveConfig");function Ea(t){return[Map,Set,Date,Promise].some(e=>t instanceof e)}oe(Ea,"isUnproxyable");function Es(t,e){if(t===Object.prototype)return e;const r=Object.create(Es(Object.getPrototypeOf(t),e));for(const n of Reflect.ownKeys(t))Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n));return r}oe(Es,"joinPrototype");function Os(t){return t&&(typeof t=="object"||typeof t=="function")}oe(Os,"isObject");function Ct(t,e,r){if(!Os(e))return e;if(Object.hasOwn(e,Q.shadow))return Object.getPrototypeOf(e);const n=e[Q.tracker];return n?ni(t,e,n,r):e}oe(Ct,"getTraceable");function hn(t,e){return e?new Proxy(t,{get:oe((r,n,i)=>n in e&&n!=="constructor"?Reflect.get(e,n,i):Reflect.get(r,n,i),"get"),set:oe((r,n,i,s)=>n in e&&n!=="constructor"?Reflect.set(e,n,i,s):Reflect.set(r,n,i,s),"set")}):t}oe(hn,"withProps");function ri(t,e,r){return hn(t,Object.defineProperty(Object.create(null),e,{value:r,writable:!1}))}oe(ri,"withProp");function Cs(t,e,r,n){if(!r)return n;const i=Reflect.getOwnPropertyDescriptor(e,r)?.value;return i?ri(n,r,t.extend({[Q.shadow]:i})):n}oe(Cs,"createShadow");function Oa(t,e,r,n){return new Proxy(e,{apply:oe((i,s,o)=>(s===r&&(s=n),o=o.map(a=>typeof a!="function"||a[Q.original]?a:new Proxy(a,{get:oe((c,l,u)=>{if(l===Q.original)return c;const f=Reflect.get(c,l,u);return l==="toString"&&f===Function.prototype.toString?function(...v){return Reflect.apply(f,this===u?c:this,v)}:f},"get"),apply:oe((c,l,u)=>Reflect.apply(c,Ct(t,l),u.map(f=>Ct(t,f))),"apply"),construct:oe((c,l,u)=>Reflect.construct(c,l.map(f=>Ct(t,f)),u),"construct")})),Ct(t,Reflect.apply(i,s,o))),"apply")})}oe(Oa,"createShadowMethod");function ni(t,e,r,n){t[Q.shadow]&&(t=Object.getPrototypeOf(t));const i=new Proxy(e,{get:oe((s,o,a)=>{if(o===Q.original)return s;if(o===r.property)return t;if(typeof o=="symbol")return Reflect.get(s,o,a);if(r.associate&&t[Q.internal][`${r.associate}.${o}`])return Reflect.get(t,`${r.associate}.${o}`,ri(t,Q.receiver,a));const c=Cs(t,s,r.property,a),l=Reflect.get(s,o,c),u=l?.[Q.tracker];return u?ni(t,l,u):!n&&typeof l=="function"?Oa(t,l,a,c):l},"get"),set:oe((s,o,a,c)=>{if(o===Q.original||o===r.property)return!1;if(typeof o=="symbol")return Reflect.set(s,o,a,c);if(r.associate&&t[Q.internal][`${r.associate}.${o}`])return Reflect.set(t,`${r.associate}.${o}`,a,ri(t,Q.receiver,c));const l=Cs(t,s,r.property,c);return Reflect.set(s,o,a,l)},"set"),apply:oe((s,o,a)=>Ps(i,s,o,a),"apply")});return i}oe(ni,"createTraceable");function Ps(t,e,r,n){return e[Q.invoke]?e[Q.invoke].apply(t,n):Reflect.apply(e,r,n)}oe(Ps,"applyTraceable");function $s(t,e,r){const n=oe(function(...i){const s=ni(n.ctx,n,r);return Ps(s,n,this,i)},"self");return qe(n,"name",t),Object.setPrototypeOf(n,e)}oe($s,"createCallable");var Mf=(_t=class{constructor(e){this.ctx=e,qe(this,Q.tracker,{associate:"reflect",property:"ctx"}),this._mixin("reflect",["get","set","provide","accessor","mixin","alias"]),this._mixin("scope",["config","runtime","effect","collect","accept","decline"]),this._mixin("registry",["using","inject","plugin"]),this._mixin("lifecycle",["on","once","parallel","emit","serial","bail","start","stop"])}static resolveInject(e,r){let n=e[Q.internal][r];for(;n?.type==="alias";)r=n.name,n=e[Q.internal][r];return[r,n]}static checkInject(e,r,n){if(e=e[Q.shadow]??e,["prototype","then","registry","lifecycle"].includes(r)||r[0]==="$"||r[0]==="_"||!e.runtime.plugin||e.bail(e,"internal/inject",r))return;const i=n.stack.split(`
1
+ (function(he,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(he=typeof globalThis<"u"?globalThis:he||self,Ee(he.InPageEditBundle={}))})(this,function(he){"use strict";var qv=Object.defineProperty;var kf=he=>{throw TypeError(he)};var Hv=(he,Ee,qe)=>Ee in he?qv(he,Ee,{enumerable:!0,configurable:!0,writable:!0,value:qe}):he[Ee]=qe;var Z=(he,Ee,qe)=>Hv(he,typeof Ee!="symbol"?Ee+"":Ee,qe),va=(he,Ee,qe)=>Ee.has(he)||kf("Cannot "+qe);var $f=(he,Ee,qe)=>(va(he,Ee,"read from private field"),qe?qe.call(he):Ee.get(he)),ba=(he,Ee,qe)=>Ee.has(he)?kf("Cannot add the same private member more than once"):Ee instanceof WeakSet?Ee.add(he):Ee.set(he,qe),If=(he,Ee,qe,se)=>(va(he,Ee,"write to private field"),se?se.call(he,qe):Ee.set(he,qe),qe),ws=(he,Ee,qe)=>(va(he,Ee,"access private method"),qe);var wt,Gr,Er,Qr,Xr,Zr,en,Fe,ht,Or,tn,rn,nn,sn,ur,Af,Tf,Rf,Wn;const Ee=()=>{let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}};Promise.withResolvers||(Promise.withResolvers=Ee);var qe=Object.defineProperty,se=(t,e)=>qe(t,"name",{value:e,configurable:!0});function Nf(){}se(Nf,"noop");function Ne(t){return t==null}se(Ne,"isNullable");function Df(t){return!Ne(t)}se(Df,"isNonNullable");function Zn(t){return t&&typeof t=="object"&&!Array.isArray(t)}se(Zn,"isPlainObject");function _a(t,e){return Object.fromEntries(Object.entries(t).filter(([r,n])=>e(r,n)))}se(_a,"filterKeys");function Ht(t,e){return Object.fromEntries(Object.entries(t).map(([r,n])=>[r,e(n,r)]))}se(Ht,"mapValues");function wa(t,e,r){if(!e)return{...t};const n={};for(const i of e)(r||t[i]!==void 0)&&(n[i]=t[i]);return n}se(wa,"pick");function Lf(t,e){if(!e)return{...t};const r={...t};for(const n of e)Reflect.deleteProperty(r,n);return r}se(Lf,"omit");function He(t,e,r){return Object.defineProperty(t,e,{writable:!0,value:r,enumerable:!1})}se(He,"defineProperty");function Mf(t,e){return e.every(r=>t.includes(r))}se(Mf,"contain");function jf(t,e){return t.filter(r=>e.includes(r))}se(jf,"intersection");function Ff(t,e){return t.filter(r=>!e.includes(r))}se(Ff,"difference");function Bf(t,e){return Array.from(new Set([...t,...e]))}se(Bf,"union");function Uf(t){return[...new Set(t)]}se(Uf,"deduplicate");function Ot(t,e){const r=t?.indexOf(e);return r>=0?(t.splice(r,1),!0):!1}se(Ot,"remove");function Wf(t){return Array.isArray(t)?t:Ne(t)?[]:[t]}se(Wf,"makeArray");function er(t,e){return arguments.length===1?r=>er(t,r):t in globalThis&&e instanceof globalThis[t]||Object.prototype.toString.call(e).slice(8,-1)===t}se(er,"is");function fn(t){return er("ArrayBuffer",t)||er("SharedArrayBuffer",t)}se(fn,"isArrayBufferLike");function xa(t){return fn(t)||ArrayBuffer.isView(t)}se(xa,"isArrayBufferSource");var Pt;(t=>{t.is=fn,t.isSource=xa;function e(o){return ArrayBuffer.isView(o)?o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength):o}t.fromSource=e,se(e,"fromSource");function r(o){if(typeof Buffer<"u")return Buffer.from(o).toString("base64");let a="";const c=new Uint8Array(o);for(let u=0;u<c.byteLength;u++)a+=String.fromCharCode(c[u]);return btoa(a)}t.toBase64=r,se(r,"toBase64");function n(o){return typeof Buffer<"u"?e(Buffer.from(o,"base64")):Uint8Array.from(atob(o),a=>a.charCodeAt(0))}t.fromBase64=n,se(n,"fromBase64");function i(o){return typeof Buffer<"u"?Buffer.from(o).toString("hex"):Array.from(new Uint8Array(o),a=>a.toString(16).padStart(2,"0")).join("")}t.toHex=i,se(i,"toHex");function s(o){if(typeof Buffer<"u")return e(Buffer.from(o,"hex"));const a=o.length%2===0?o:o.slice(0,o.length-1),c=[];for(let u=0;u<a.length;u+=2)c.push(parseInt(`${a[u]}${a[u+1]}`,16));return Uint8Array.from(c).buffer}t.fromHex=s,se(s,"fromHex")})(Pt||(Pt={})),Pt.fromBase64,Pt.toBase64,Pt.fromHex,Pt.toHex;function ei(t,e=new Map){if(!t||typeof t!="object")return t;if(er("Date",t))return new Date(t.valueOf());if(er("RegExp",t))return new RegExp(t.source,t.flags);if(fn(t))return t.slice(0);if(ArrayBuffer.isView(t))return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);const r=e.get(t);if(r)return r;if(Array.isArray(t)){const i=[];return e.set(t,i),t.forEach((s,o)=>{i[o]=Reflect.apply(ei,null,[s,e])}),i}const n=Object.create(Object.getPrototypeOf(t));e.set(t,n);for(const i of Reflect.ownKeys(t)){const s={...Reflect.getOwnPropertyDescriptor(t,i)};"value"in s&&(s.value=Reflect.apply(ei,null,[s.value,e])),Reflect.defineProperty(n,i,s)}return n}se(ei,"clone");function pr(t,e,r){if(t===e||!r&&Ne(t)&&Ne(e))return!0;if(typeof t!=typeof e||typeof t!="object"||!t||!e)return!1;function n(i,s){return i(t)?i(e)?s(t,e):!1:i(e)?!1:void 0}return se(n,"check"),n(Array.isArray,(i,s)=>i.length===s.length&&i.every((o,a)=>pr(o,s[a])))??n(er("Date"),(i,s)=>i.valueOf()===s.valueOf())??n(er("RegExp"),(i,s)=>i.source===s.source&&i.flags===s.flags)??n(fn,(i,s)=>{if(i.byteLength!==s.byteLength)return!1;const o=new Uint8Array(i),a=new Uint8Array(s);for(let c=0;c<o.length;c++)if(o[c]!==a[c])return!1;return!0})??Object.keys({...t,...e}).every(i=>pr(t[i],e[i],r))}se(pr,"deepEqual");function qf(t){return t.charAt(0).toUpperCase()+t.slice(1)}se(qf,"capitalize");function Hf(t){return t.charAt(0).toLowerCase()+t.slice(1)}se(Hf,"uncapitalize");function zf(t){return t.replace(/[_-][a-z]/g,e=>e.slice(1).toUpperCase())}se(zf,"camelCase");function Ss(t,e,r){const n=[];let i=0;for(let s=0;s<t.length;s++){const o=t.charCodeAt(s);if(o>=65&&o<=90){if(i===1){const a=t.charCodeAt(s+1);a>=97&&a<=122&&n.push(r),n.push(o+32)}else i!==0&&n.push(r),n.push(o+32);i=1}else o>=97&&o<=122?(n.push(o),i=2):e.includes(o)?(i!==0&&n.push(r),i=0):n.push(o)}return String.fromCharCode(...n)}se(Ss,"tokenize");function Vf(t){return Ss(t,[45,95],45)}se(Vf,"paramCase");function Kf(t){return Ss(t,[45,95],95)}se(Kf,"snakeCase");function Jf(t){return typeof t!="string"?`[${t.toString()}]`:/^[a-z_$][\w$]*$/i.test(t)?`.${t}`:`[${JSON.stringify(t)}]`}se(Jf,"formatProperty");function Sa(t){return t.replace(/\/$/,"")}se(Sa,"trimSlash");function Yf(t){return t.startsWith("/")||(t="/"+t),Sa(t)}se(Yf,"sanitize");var ti;(t=>{t.millisecond=1,t.second=1e3,t.minute=t.second*60,t.hour=t.minute*60,t.day=t.hour*24,t.week=t.day*7;let e=new Date().getTimezoneOffset();function r(y){e=y}t.setTimezoneOffset=r,se(r,"setTimezoneOffset");function n(){return e}t.getTimezoneOffset=n,se(n,"getTimezoneOffset");function i(y=new Date,b){return typeof y=="number"&&(y=new Date(y)),b===void 0&&(b=e),Math.floor((y.valueOf()/t.minute-b)/1440)}t.getDateNumber=i,se(i,"getDateNumber");function s(y,b){const T=new Date(y*t.day);return b===void 0&&(b=e),new Date(+T+b*t.minute)}t.fromDateNumber=s,se(s,"fromDateNumber");const o=/\d+(?:\.\d+)?/.source,a=new RegExp(`^${["w(?:eek(?:s)?)?","d(?:ay(?:s)?)?","h(?:our(?:s)?)?","m(?:in(?:ute)?(?:s)?)?","s(?:ec(?:ond)?(?:s)?)?"].map(y=>`(${o}${y})?`).join("")}$`);function c(y){const b=a.exec(y);return b?(parseFloat(b[1])*t.week||0)+(parseFloat(b[2])*t.day||0)+(parseFloat(b[3])*t.hour||0)+(parseFloat(b[4])*t.minute||0)+(parseFloat(b[5])*t.second||0):0}t.parseTime=c,se(c,"parseTime");function u(y){const b=c(y);return b?y=Date.now()+b:/^\d{1,2}(:\d{1,2}){1,2}$/.test(y)?y=`${new Date().toLocaleDateString()}-${y}`:/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(y)&&(y=`${new Date().getFullYear()}-${y}`),y?new Date(y):new Date}t.parseDate=u,se(u,"parseDate");function l(y){const b=Math.abs(y);return b>=t.day-t.hour/2?Math.round(y/t.day)+"d":b>=t.hour-t.minute/2?Math.round(y/t.hour)+"h":b>=t.minute-t.second/2?Math.round(y/t.minute)+"m":b>=t.second?Math.round(y/t.second)+"s":y+"ms"}t.format=l,se(l,"format");function f(y,b=2){return y.toString().padStart(b,"0")}t.toDigits=f,se(f,"toDigits");function v(y,b=new Date){return y.replace("yyyy",b.getFullYear().toString()).replace("yy",b.getFullYear().toString().slice(2)).replace("MM",f(b.getMonth()+1)).replace("dd",f(b.getDate())).replace("hh",f(b.getHours())).replace("mm",f(b.getMinutes())).replace("ss",f(b.getSeconds())).replace("SSS",f(b.getMilliseconds(),3))}t.template=v,se(v,"template")})(ti||(ti={}));var Gf=Object.defineProperty,oe=(t,e)=>Gf(t,"name",{value:e,configurable:!0}),Q={shadow:Symbol.for("cordis.shadow"),receiver:Symbol.for("cordis.receiver"),original:Symbol.for("cordis.original"),store:Symbol.for("cordis.store"),events:Symbol.for("cordis.events"),static:Symbol.for("cordis.static"),filter:Symbol.for("cordis.filter"),expose:Symbol.for("cordis.expose"),isolate:Symbol.for("cordis.isolate"),internal:Symbol.for("cordis.internal"),intercept:Symbol.for("cordis.intercept"),setup:Symbol.for("cordis.setup"),invoke:Symbol.for("cordis.invoke"),extend:Symbol.for("cordis.extend"),tracker:Symbol.for("cordis.tracker"),provide:Symbol.for("cordis.provide"),immediate:Symbol.for("cordis.immediate")},Qf=function*(){}.constructor,Ea=async function*(){}.constructor;function Es(t){return!(!t.prototype||t instanceof Qf||Ea!==Function&&t instanceof Ea)}oe(Es,"isConstructor");function dn(t,e){const r=t.Config||t.schema;return r&&t.schema!==!1&&(e=r(e)),e??{}}oe(dn,"resolveConfig");function Oa(t){return[Map,Set,Date,Promise].some(e=>t instanceof e)}oe(Oa,"isUnproxyable");function Os(t,e){if(t===Object.prototype)return e;const r=Object.create(Os(Object.getPrototypeOf(t),e));for(const n of Reflect.ownKeys(t))Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n));return r}oe(Os,"joinPrototype");function Ps(t){return t&&(typeof t=="object"||typeof t=="function")}oe(Ps,"isObject");function Ct(t,e,r){if(!Ps(e))return e;if(Object.hasOwn(e,Q.shadow))return Object.getPrototypeOf(e);const n=e[Q.tracker];return n?ni(t,e,n,r):e}oe(Ct,"getTraceable");function hn(t,e){return e?new Proxy(t,{get:oe((r,n,i)=>n in e&&n!=="constructor"?Reflect.get(e,n,i):Reflect.get(r,n,i),"get"),set:oe((r,n,i,s)=>n in e&&n!=="constructor"?Reflect.set(e,n,i,s):Reflect.set(r,n,i,s),"set")}):t}oe(hn,"withProps");function ri(t,e,r){return hn(t,Object.defineProperty(Object.create(null),e,{value:r,writable:!1}))}oe(ri,"withProp");function Cs(t,e,r,n){if(!r)return n;const i=Reflect.getOwnPropertyDescriptor(e,r)?.value;return i?ri(n,r,t.extend({[Q.shadow]:i})):n}oe(Cs,"createShadow");function Pa(t,e,r,n){return new Proxy(e,{apply:oe((i,s,o)=>(s===r&&(s=n),o=o.map(a=>typeof a!="function"||a[Q.original]?a:new Proxy(a,{get:oe((c,u,l)=>{if(u===Q.original)return c;const f=Reflect.get(c,u,l);return u==="toString"&&f===Function.prototype.toString?function(...v){return Reflect.apply(f,this===l?c:this,v)}:f},"get"),apply:oe((c,u,l)=>Reflect.apply(c,Ct(t,u),l.map(f=>Ct(t,f))),"apply"),construct:oe((c,u,l)=>Reflect.construct(c,u.map(f=>Ct(t,f)),l),"construct")})),Ct(t,Reflect.apply(i,s,o))),"apply")})}oe(Pa,"createShadowMethod");function ni(t,e,r,n){t[Q.shadow]&&(t=Object.getPrototypeOf(t));const i=new Proxy(e,{get:oe((s,o,a)=>{if(o===Q.original)return s;if(o===r.property)return t;if(typeof o=="symbol")return Reflect.get(s,o,a);if(r.associate&&t[Q.internal][`${r.associate}.${o}`])return Reflect.get(t,`${r.associate}.${o}`,ri(t,Q.receiver,a));const c=Cs(t,s,r.property,a),u=Reflect.get(s,o,c),l=u?.[Q.tracker];return l?ni(t,u,l):!n&&typeof u=="function"?Pa(t,u,a,c):u},"get"),set:oe((s,o,a,c)=>{if(o===Q.original||o===r.property)return!1;if(typeof o=="symbol")return Reflect.set(s,o,a,c);if(r.associate&&t[Q.internal][`${r.associate}.${o}`])return Reflect.set(t,`${r.associate}.${o}`,a,ri(t,Q.receiver,c));const u=Cs(t,s,r.property,c);return Reflect.set(s,o,a,u)},"set"),apply:oe((s,o,a)=>ks(i,s,o,a),"apply")});return i}oe(ni,"createTraceable");function ks(t,e,r,n){return e[Q.invoke]?e[Q.invoke].apply(t,n):Reflect.apply(e,r,n)}oe(ks,"applyTraceable");function $s(t,e,r){const n=oe(function(...i){const s=ni(n.ctx,n,r);return ks(s,n,this,i)},"self");return He(n,"name",t),Object.setPrototypeOf(n,e)}oe($s,"createCallable");var Xf=(wt=class{constructor(e){this.ctx=e,He(this,Q.tracker,{associate:"reflect",property:"ctx"}),this._mixin("reflect",["get","set","provide","accessor","mixin","alias"]),this._mixin("scope",["config","runtime","effect","collect","accept","decline"]),this._mixin("registry",["using","inject","plugin"]),this._mixin("lifecycle",["on","once","parallel","emit","serial","bail","start","stop"])}static resolveInject(e,r){let n=e[Q.internal][r];for(;n?.type==="alias";)r=n.name,n=e[Q.internal][r];return[r,n]}static checkInject(e,r,n){if(e=e[Q.shadow]??e,["prototype","then","registry","lifecycle"].includes(r)||r[0]==="$"||r[0]==="_"||!e.runtime.plugin||e.bail(e,"internal/inject",r))return;const i=n.stack.split(`
2
2
  `);i.splice(1,1),n.stack=i.join(`
3
- `),e.emit(e,"internal/warning",n)}get(e){if(this.ctx[Q.internal][e]?.type!=="service")return;const n=this.ctx[Q.isolate][e],i=this.ctx[Q.store][n]?.value;return Ct(this.ctx,i)}set(e,r){this.provide(e);const n=this.ctx[Q.isolate][e],i=this.ctx[Q.store][n]?.value;r??(r=void 0);let s=oe(()=>{},"dispose");if(i===r)return s;if(!Re(r)&&!Re(i))throw new Error(`service ${e} has been registered`);const o=this.ctx;Re(r)||(s=o.effect(()=>()=>{o.set(e,void 0)})),Ea(r)&&o.emit(o,"internal/warning",new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));const a=Object.create(o);return a[Q.filter]=c=>o[Q.isolate][e]===c[Q.isolate][e],o.emit(a,"internal/before-service",e,r),o[Q.store][n]={value:r,source:o},o.emit(a,"internal/service",e,i),s}provide(e,r,n){const i=this.ctx.root[Q.internal];if(e in i)return;const s=Symbol(e);i[e]={type:"service",builtin:n},this.ctx.root[Q.isolate][e]=s,Os(r)&&(this.ctx[Q.store][s]={value:r,source:null},qe(r,Q.tracker,{associate:e,property:"ctx"}))}_accessor(e,r){const n=this.ctx.root[Q.internal];return e in n?()=>{}:(n[e]={type:"accessor",...r},()=>delete this.ctx.root[Q.isolate][e])}accessor(e,r){this.ctx.scope.effect(()=>this._accessor(e,r))}alias(e,r){const n=this.ctx.root[Q.internal];if(!(e in n))for(const i of r)n[i]||(n[i]={type:"alias",name:e})}_mixin(e,r){const n=Array.isArray(r)?r.map(o=>[o,o]):Object.entries(r),i=typeof e=="string"?o=>o[e]:()=>e,s=n.map(([o,a])=>this._accessor(a,{get(c){const l=i(this);if(Re(l))return l;const u=c?hn(c,l):l,f=Reflect.get(l,o,u);return typeof f!="function"?f:f.bind(u??l)},set(c,l){const u=i(this),f=l?hn(l,u):u;return Reflect.set(u,o,c,f)}}));return()=>s.forEach(o=>o())}mixin(e,r){this.ctx.scope.effect(()=>this._mixin(e,r))}trace(e){return Ct(this.ctx,e)}bind(e){return new Proxy(e,{apply:oe((r,n,i)=>r.apply(this.trace(n),i.map(s=>this.trace(s))),"apply")})}},oe(_t,"ReflectService"),Z(_t,"handler",{get:oe((e,r,n)=>{if(typeof r!="string")return Reflect.get(e,r,n);if(Reflect.has(e,r))return Ct(n,Reflect.get(e,r,n),!0);const[i,s]=_t.resolveInject(e,r),o=new Error(`property ${i} is not registered, declare it as \`inject\` to suppress this warning`);return s?s.type==="accessor"?s.get.call(n,n[Q.receiver]):(s.builtin||_t.checkInject(n,i,o),n.reflect.get(i)):(_t.checkInject(n,i,o),Reflect.get(e,i,n))},"get"),set:oe((e,r,n,i)=>{if(typeof r!="string")return Reflect.set(e,r,n,i);const[s,o]=_t.resolveInject(e,r);return o?o.type==="accessor"?o.set?o.set.call(i,n,i[Q.receiver]):!1:(i.reflect.set(s,n),!0):Reflect.set(e,s,n,i)},"set"),has:oe((e,r)=>{if(typeof r!="string")return Reflect.has(e,r);if(Reflect.has(e,r))return!0;const[,n]=_t.resolveInject(e,r);return!!n},"has")}),_t),ks=Mf;function Is(t){return t!==null&&t!==!1&&t!==void 0}oe(Is,"isBailed");var Ff=(Gr=class{constructor(e){Z(this,"isActive",!1);Z(this,"_tasks",new Set);Z(this,"_hooks",{});this.ctx=e,qe(this,Q.tracker,{associate:"lifecycle",property:"ctx"}),qe(this.on("internal/listener",function(n,i,s){const o=s.prepend?"unshift":"push";if(n==="ready")return this.lifecycle.isActive?(this.scope.ensure(async()=>i()),()=>!1):void 0;if(n==="dispose")return this.scope.disposables[o](i),qe(i,"name","event <dispose>"),()=>Et(this.scope.disposables,i);if(n==="fork")return this.scope.runtime.forkables[o](i),this.scope.collect("event <fork>",()=>Et(this.scope.runtime.forkables,i))}),He.static,e.scope);for(const n of["info","error","warning"])qe(this.on(`internal/${n}`,(i,...s)=>{this._hooks[`internal/${n}`].length>1||console.info(i,...s)}),He.static,e.scope);qe(this.on("internal/before-service",function(n){for(const i of this.registry.values()){if(!i.inject[n]?.required)continue;const s=i.isReusable?i.children:[i];for(const o of s)this[Q.filter](o.ctx)&&(o.updateStatus(),o.reset())}},{global:!0}),He.static,e.scope),qe(this.on("internal/service",function(n){for(const i of this.registry.values()){if(!i.inject[n]?.required)continue;const s=i.isReusable?i.children:[i];for(const o of s)this[Q.filter](o.ctx)&&o.start()}},{global:!0}),He.static,e.scope);const r=oe((n,i)=>{if(!n.runtime.plugin)return!1;for(const s in n.runtime.inject)if(i===ks.resolveInject(n.ctx,s)[0])return!0;return r(n.parent.scope,i)},"checkInject");qe(this.on("internal/inject",function(n){return r(this.scope,n)},{global:!0}),He.static,e.scope)}async flush(){for(;this._tasks.size;)await Promise.all(Array.from(this._tasks))}filterHooks(e,r){return r=Ct(this.ctx,r),e.slice().filter(n=>{const i=r?.[He.filter];return n.global||!i||i.call(r,n.ctx)})}*dispatch(e,r){const n=typeof r[0]=="object"||typeof r[0]=="function"?r.shift():null,i=r.shift();i!=="internal/event"&&this.emit("internal/event",e,i,r,n);for(const s of this.filterHooks(this._hooks[i]||[],n))yield s.callback.apply(n,r)}async parallel(...e){await Promise.all(this.dispatch("emit",e))}emit(...e){Array.from(this.dispatch("emit",e))}async serial(...e){for await(const r of this.dispatch("serial",e))if(Is(r))return r}bail(...e){for(const r of this.dispatch("bail",e))if(Is(r))return r}register(e,r,n,i){const s=i.prepend?"unshift":"push";return r[s]({ctx:this.ctx,callback:n,...i}),this.ctx.state.collect(e,()=>this.unregister(r,n))}unregister(e,r){const n=e.findIndex(i=>i.callback===r);if(n>=0)return e.splice(n,1),!0}on(e,r,n){var a;typeof n!="object"&&(n={prepend:n}),this.ctx.scope.assertActive(),r=this.ctx.reflect.bind(r);const i=this.bail(this.ctx,"internal/listener",e,r,n);if(i)return i;const s=(a=this._hooks)[e]||(a[e]=[]),o=typeof e=="string"?`event <${e}>`:"event (Symbol)";return this.register(o,s,r,n)}once(e,r,n){const i=this.on(e,function(...s){return i(),r.apply(this,s)},n);return i}async start(){this.isActive=!0;const e=this._hooks.ready||[];for(;e.length;){const{ctx:r,callback:n}=e.shift();r.scope.ensure(async()=>n())}await this.flush()}async stop(){this.isActive=!1,this.ctx.scope.reset()}},oe(Gr,"Lifecycle"),Gr),jf=Ff,As=(Sr=class extends Error{constructor(e,r){super(r??Sr.Code[e]),this.code=e}},oe(Sr,"CordisError"),Sr);(t=>{t.Code={INACTIVE_EFFECT:"cannot create effect on inactive context"}})(As||(As={}));var Ca=(Qr=class{constructor(e,r){Z(this,"uid");Z(this,"ctx");Z(this,"disposables",[]);Z(this,"error");Z(this,"status",0);Z(this,"isActive",!1);Z(this,"context");Z(this,"proxy");Z(this,"acceptors",[]);Z(this,"tasks",new Set);Z(this,"hasError",!1);this.parent=e,this.config=r,this.uid=e.registry?e.registry.counter:0,this.ctx=this.context=e.extend({scope:this}),this.proxy=new Proxy({},{get:oe((n,i)=>Reflect.get(this.config,i),"get")})}get _config(){return this.runtime.isReactive?this.proxy:this.config}assertActive(){if(!(this.uid!==null||this.isActive))throw new As("INACTIVE_EFFECT")}effect(e,r){this.assertActive();const n=Ss(e)?new e(this.ctx,r):e(this.ctx,r);let i=!1;const s=typeof n=="function"?n:n.dispose.bind(n),o=oe((...a)=>{if(!i)return i=!0,Et(this.disposables,o),s(...a)},"wrapped");return this.disposables.push(o),typeof n=="function"?o:(n.dispose=o,n)}collect(e,r){const n=qe(()=>(Et(this.disposables,n),r()),"name",e);return this.disposables.push(n),n}restart(){this.reset(),this.error=null,this.hasError=!1,this.status=0,this.start()}_getStatus(){return this.uid===null?4:this.hasError?3:this.tasks.size?1:this.ready?2:0}updateStatus(e){const r=this.status;e?.(),this.status=this._getStatus(),r!==this.status&&this.context.emit("internal/status",this,r)}ensure(e){const r=e().catch(n=>{this.context.emit(this.ctx,"internal/error",n),this.cancel(n)}).finally(()=>{this.updateStatus(()=>this.tasks.delete(r)),this.context.events._tasks.delete(r)});this.updateStatus(()=>this.tasks.add(r)),this.context.events._tasks.add(r)}cancel(e){this.error=e,this.updateStatus(()=>this.hasError=!0),this.reset()}get ready(){return Object.entries(this.runtime.inject).every(([e,r])=>!r.required||!Re(this.ctx.get(e)))}reset(){this.isActive=!1,this.disposables=this.disposables.splice(0).filter(e=>{if(this.uid!==null&&e[He.static]===this)return!0;(async()=>e())().catch(r=>{this.context.emit(this.ctx,"internal/error",r)})})}init(e){this.config?this.start():this.cancel(e)}start(){if(!this.ready||this.isActive||this.uid===null)return!0;this.isActive=!0,this.updateStatus(()=>this.hasError=!1)}accept(...e){const n={keys:Array.isArray(e[0])?e.shift():null,callback:e[0],...e[1]};return this.effect(()=>(this.acceptors.push(n),n.immediate&&n.callback?.(this.config),()=>Et(this.acceptors,n)))}decline(e){return this.accept(e,()=>!0)}checkUpdate(e,r){if(r||!this.config)return[!0,!0];if(r===!1)return[!1,!1];const n=Object.create(null),i=oe(l=>{const u=n[l]??(n[l]=!hr(this.config[l],e[l]));return o||(o=u),u},"checkPropertyUpdate"),s=new Set;let o=!1,a=!1,c=this.runtime.isReactive||null;for(const{keys:l,callback:u,passive:f}of this.acceptors){if(!l)c||(c=!f);else if(f)l?.forEach(y=>s.add(y));else{let y=!1;for(const b of l)y||(y=i(b));if(!y)continue}u?.(e)&&(a=!0)}for(const l in{...this.config,...e})if(c!==!1&&!(l in n)&&!s.has(l)){const u=i(l);c===null&&(a||(a=u))}return[o,a]}},oe(Qr,"EffectScope"),Qr),Bf=(Xr=class extends Ca{constructor(r,n,i,s){super(r,i);Z(this,"dispose");this.runtime=n,this.dispose=qe(r.scope.collect(`fork <${r.runtime.name}>`,()=>{this.uid=null,this.reset(),this.context.emit("internal/fork",this);const o=Et(n.disposables,this.dispose);return Et(n.children,this)&&!n.children.length&&r.registry.delete(n.plugin),o}),He.static,n),n.children.push(this),n.disposables.push(this.dispose),this.context.emit("internal/fork",this),this.init(s)}start(){if(super.start())return!0;for(const r of this.runtime.forkables)this.ensure(async()=>r(this.context,this._config))}update(r,n){const i=this.config,s=this.runtime.isForkable?this:this.runtime;if(s.config!==i)return;let o;try{o=dn(this.runtime.plugin,r)}catch(l){return this.context.emit("internal/error",l),this.cancel(l)}const[a,c]=s.checkUpdate(o,n);this.context.emit("internal/before-update",this,r),this.config=o,s.config=o,a&&this.context.emit("internal/update",this,i),c&&s.restart()}},oe(Xr,"ForkScope"),Xr),Pa=(Zr=class extends Ca{constructor(r,n,i,s){super(r,i);Z(this,"value");Z(this,"runtime",this);Z(this,"schema");Z(this,"name");Z(this,"inject",Object.create(null));Z(this,"forkables",[]);Z(this,"children",[]);Z(this,"isReusable",!1);Z(this,"isReactive",!1);Z(this,"apply",oe((r,n)=>{if(typeof this.plugin!="function")return this.plugin.apply(r,n);if(Ss(this.plugin)){const i=new this.plugin(r,n),s=i[He.expose];return s&&r.set(s,i),i.fork&&this.forkables.push(i.fork.bind(i)),i}else return this.plugin(r,n)},"apply"));this.plugin=n,n?(this.setup(),this.init(s)):(this.name="root",this.isActive=!0)}get isForkable(){return this.forkables.length>0}fork(r,n,i){return new Bf(r,this,n,i)}dispose(){return this.uid=null,this.reset(),this.context.emit("internal/runtime",this),!0}setup(){const{name:r}=this.plugin;r&&r!=="apply"&&(this.name=r),this.schema=this.plugin.Config||this.plugin.schema,this.inject=st.resolve(this.plugin.using||this.plugin.inject),this.isReusable=this.plugin.reusable,this.isReactive=this.plugin.reactive,this.context.emit("internal/runtime",this),this.isReusable&&this.forkables.push(this.apply)}reset(){super.reset();for(const r of this.children)r.reset()}start(){if(super.start())return!0;!this.isReusable&&this.plugin&&this.ensure(async()=>this.value=this.apply(this.ctx,this._config));for(const r of this.children)r.start()}update(r,n){if(this.isForkable){const l=new Error(`attempting to update forkable plugin "${this.plugin.name}", which may lead to unexpected behavior`);this.context.emit(this.ctx,"internal/warning",l)}const i=this.config;let s;try{s=dn(this.runtime.plugin||this.context.constructor,r)}catch(l){return this.context.emit("internal/error",l),this.cancel(l)}const[o,a]=this.checkUpdate(s,n),c=this.children.find(l=>l.config===i);this.config=s,c&&(this.context.emit("internal/before-update",c,r),c.config=s,o&&this.context.emit("internal/update",c,i)),a&&this.restart()}},oe(Zr,"MainScope"),Zr);function $a(t){return t&&typeof t=="object"&&typeof t.apply=="function"}oe($a,"isApplicable");function st(t){return function(e,r){if(r.kind==="class")e.inject=t;else if(r.kind==="method")r.addInitializer(function(){const n=this[Q.tracker]?.property;if(!n)throw new Error("missing context tracker");this[n].inject(t,i=>{e.call(hn(this,{[n]:i}))})});else throw new Error("@Inject can only be used on class or class methods")}}oe(st,"Inject"),(t=>{function e(r){if(!r)return{};if(Array.isArray(r))return Object.fromEntries(r.map(o=>[o,{required:!0}]));const{required:n,optional:i,...s}=r;return Array.isArray(n)&&Object.assign(s,Object.fromEntries(n.map(o=>[o,{required:!0}]))),Array.isArray(i)&&Object.assign(s,Object.fromEntries(i.map(o=>[o,{required:!1}]))),s}t.resolve=e,oe(e,"resolve")})(st||(st={}));var Uf=(en=class{constructor(e,r){Z(this,"_counter",0);Z(this,"_internal",new Map);Z(this,"context");this.ctx=e,qe(this,Q.tracker,{associate:"registry",property:"ctx"}),this.context=e;const n=new Pa(e,null,r);e.scope=n,n.ctx=e,this.set(null,n)}get counter(){return++this._counter}get size(){return this._internal.size}resolve(e,r=!1){if(e===null||typeof e=="function")return e;if($a(e))return e.apply;if(r)throw new Error('invalid plugin, expect function or object with an "apply" method, received '+typeof e)}get(e){const r=this.resolve(e);return r&&this._internal.get(r)}has(e){const r=this.resolve(e);return!!r&&this._internal.has(r)}set(e,r){const n=this.resolve(e);this._internal.set(n,r)}delete(e){const r=this.resolve(e),n=r&&this._internal.get(r);if(n)return this._internal.delete(r),n.dispose(),n}keys(){return this._internal.keys()}values(){return this._internal.values()}entries(){return this._internal.entries()}forEach(e){return this._internal.forEach(e)}using(e,r){return this.inject(e,r)}inject(e,r){return this.plugin({inject:e,apply:r,name:r.name})}plugin(e,r,n){if(this.resolve(e,!0),this.ctx.scope.assertActive(),!n)try{r=dn(e,r)}catch(s){this.context.emit(this.ctx,"internal/error",s),n=s,r=null}let i=this.get(e);return i?(i.isForkable||this.context.emit(this.ctx,"internal/warning",new Error(`duplicate plugin detected: ${e.name}`)),i.fork(this.ctx,r,n)):(i=new Pa(this.ctx,e,r,n),this.set(e,i),i.fork(this.ctx,r,n))}},oe(en,"Registry"),en),Wf=Uf,He=(Fe=class{static is(e){return!!e?.[Fe.is]}static associate(e,r){return e}constructor(e){e=dn(this.constructor,e),this[Q.store]=Object.create(null),this[Q.isolate]=Object.create(null),this[Q.internal]=Object.create(null),this[Q.intercept]=Object.create(null);const r=new Proxy(this,ks.handler);r.root=r,r.reflect=new ks(r),r.registry=new Wf(r,e),r.lifecycle=new jf(r);const n=oe(i=>{if(i){n(Object.getPrototypeOf(i));for(const s of Object.getOwnPropertyNames(i)){const o=i[s].prototype?.constructor;o&&(r[i[s].key]=new o(r,e),qe(r[i[s].key],"ctx",r))}}},"attach");return n(this[Q.internal]),r}[Symbol.for("nodejs.util.inspect.custom")](){return`Context <${this.name}>`}get name(){let e=this.runtime;for(;e&&!e.name;)e=e.parent.runtime;return e?.name}get events(){return this.lifecycle}get state(){return this.scope}extend(e={}){const r=Reflect.getOwnPropertyDescriptor(this,Q.shadow)?.value,n=Object.assign(Object.create(Ct(this,this)),e);return r?Object.assign(Object.create(n),{[Q.shadow]:r}):n}isolate(e,r){const n=Object.create(this[Q.isolate]);return n[e]=r??Symbol(e),this.extend({[Q.isolate]:n})}intercept(e,r){const n=Object.create(this[Q.intercept]);return n[e]=r,this.extend({[Q.intercept]:n})}},oe(Fe,"Context"),Z(Fe,"store",Q.store),Z(Fe,"events",Q.events),Z(Fe,"static",Q.static),Z(Fe,"filter",Q.filter),Z(Fe,"expose",Q.expose),Z(Fe,"isolate",Q.isolate),Z(Fe,"internal",Q.internal),Z(Fe,"intercept",Q.intercept),Z(Fe,"origin","ctx"),Z(Fe,"current","ctx"),Fe.is[Symbol.toPrimitive]=()=>Symbol.for("cordis.is"),Fe.prototype[Fe.is]=!0,Fe);He.prototype[He.internal]=Object.create(null);var kr=(dt=class{constructor(...e){Z(this,"ctx");Z(this,"name");Z(this,"config");let r,n,i,s;He.is(e[0])?(r=e[0],typeof e[1]=="string"?(n=e[1],i=e[2]):s=e[1]):s=e[0],n??(n=this.constructor[Q.provide]),i??(i=this.constructor[Q.immediate]);let o=this;const a={associate:n,property:"ctx"};return o[Q.invoke]&&(o=$s(n,Es(Object.getPrototypeOf(this),Function.prototype),a)),r?o.ctx=r:o[Q.setup](),o.name=n,o.config=s,qe(o,Q.tracker,a),o.ctx.provide(n),o.ctx.runtime.name=n,i&&(r?o[Q.expose]=n:o.ctx.set(n,o)),o.ctx.on("ready",async()=>{await Promise.resolve(),await o.start(),i||o.ctx.set(n,o)}),o.ctx.on("dispose",()=>o.stop()),o}start(){}stop(){}[Q.filter](e){return e[Q.isolate][this.name]===this.ctx[Q.isolate][this.name]}[Q.setup](){this.ctx=new He}[Q.extend](e){let r;return this[dt.invoke]?r=$s(this.name,this,this[Q.tracker]):r=Object.create(this),Object.assign(r,e)}static[Symbol.hasInstance](e){let r=e.constructor;for(;r;){if(r=r.prototype?.constructor,r===this)return!0;r=Object.getPrototypeOf(r)}return!1}},oe(dt,"Service"),Z(dt,"setup",Q.setup),Z(dt,"invoke",Q.invoke),Z(dt,"extend",Q.extend),Z(dt,"tracker",Q.tracker),Z(dt,"provide",Q.provide),Z(dt,"immediate",Q.immediate),dt),Ir=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ka(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function qf(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Ts,Ia;function Hf(){if(Ia)return Ts;Ia=1;function t(){const r=/(Chrome|Chromium)\/(?<chromeVersion>\d+)\./.exec(navigator.userAgent);if(r)return Number.parseInt(r.groups.chromeVersion,10)}const e=t()>=69?{level:1,hasBasic:!0,has256:!1,has16m:!1}:!1;return Ts={stdout:e,stderr:e},Ts}var Aa=Hf();const zf=qf(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Rs,Ta;function Vf(){if(Ta)return Rs;Ta=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=t&&e&&typeof e.get=="function"?e.get:null,n=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&s&&typeof s.get=="function"?s.get:null,a=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,l=c?WeakMap.prototype.has:null,u=typeof WeakSet=="function"&&WeakSet.prototype,f=u?WeakSet.prototype.has:null,v=typeof WeakRef=="function"&&WeakRef.prototype,y=v?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,R=Object.prototype.toString,H=Function.prototype.toString,B=String.prototype.match,N=String.prototype.slice,g=String.prototype.replace,m=String.prototype.toUpperCase,h=String.prototype.toLowerCase,C=RegExp.prototype.test,I=Array.prototype.concat,T=Array.prototype.join,J=Array.prototype.slice,re=Math.floor,ke=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ne=Object.getOwnPropertySymbols,Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ht=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ge||!0)?Symbol.toStringTag:null,Te=Object.prototype.propertyIsEnumerable,ve=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(k){return k.__proto__}:null);function _e(k,A){if(k===1/0||k===-1/0||k!==k||k&&k>-1e3&&k<1e3||C.call(/e/,A))return A;var de=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof k=="number"){var Ce=k<0?-re(-k):re(k);if(Ce!==k){var ge=String(Ce),le=N.call(A,ge.length+1);return g.call(ge,de,"$&_")+"."+g.call(g.call(le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(A,de,"$&_")}var pt=zf,Qt=pt.custom,je=D(Qt)?Qt:null,Qe={__proto__:null,double:'"',single:"'"},an={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Rs=function k(A,de,Ce,ge){var le=de||{};if(M(le,"quoteStyle")&&!M(Qe,le.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(M(le,"maxStringLength")&&(typeof le.maxStringLength=="number"?le.maxStringLength<0&&le.maxStringLength!==1/0:le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Bt=M(le,"customInspect")?le.customInspect:!0;if(typeof Bt!="boolean"&&Bt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(M(le,"indent")&&le.indent!==null&&le.indent!==" "&&!(parseInt(le.indent,10)===le.indent&&le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(M(le,"numericSeparator")&&typeof le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ut=le.numericSeparator;if(typeof A>"u")return"undefined";if(A===null)return"null";if(typeof A=="boolean")return A?"true":"false";if(typeof A=="string")return we(A,le);if(typeof A=="number"){if(A===0)return 1/0/A>0?"0":"-0";var it=String(A);return Ut?_e(A,it):it}if(typeof A=="bigint"){var Wt=String(A)+"n";return Ut?_e(A,Wt):Wt}var Hn=typeof le.depth>"u"?5:le.depth;if(typeof Ce>"u"&&(Ce=0),Ce>=Hn&&Hn>0&&typeof A=="object")return Mt(A)?"[Array]":"[Object]";var ur=Ft(le,Ce);if(typeof ge>"u")ge=[];else if(V(ge,A)>=0)return"[Circular]";function mt(fr,ln,da){if(ln&&(ge=J.call(ge),ge.push(ln)),da){var bs={depth:le.depth};return M(le,"quoteStyle")&&(bs.quoteStyle=le.quoteStyle),k(fr,bs,Ce+1,ge)}return k(fr,le,Ce+1,ge)}if(typeof A=="function"&&!Cr(A)){var ds=Y(A),hs=Be(A,mt);return"[Function"+(ds?": "+ds:" (anonymous)")+"]"+(hs.length>0?" { "+T.call(hs,", ")+" }":"")}if(D(A)){var ps=Ge?g.call(String(A),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ve.call(A);return typeof A=="object"&&!Ge?Ae(ps):ps}if(ue(A)){for(var Pr="<"+h.call(String(A.nodeName)),zn=A.attributes||[],$r=0;$r<zn.length;$r++)Pr+=" "+zn[$r].name+"="+cn(qn(zn[$r].value),"double",le);return Pr+=">",A.childNodes&&A.childNodes.length&&(Pr+="..."),Pr+="</"+h.call(String(A.nodeName))+">",Pr}if(Mt(A)){if(A.length===0)return"[]";var Vn=Be(A,mt);return ur&&!nt(Vn)?"["+jt(Vn,ur)+"]":"[ "+T.call(Vn,", ")+" ]"}if(Xt(A)){var Kn=Be(A,mt);return!("cause"in Error.prototype)&&"cause"in A&&!Te.call(A,"cause")?"{ ["+String(A)+"] "+T.call(I.call("[cause]: "+mt(A.cause),Kn),", ")+" }":Kn.length===0?"["+String(A)+"]":"{ ["+String(A)+"] "+T.call(Kn,", ")+" }"}if(typeof A=="object"&&Bt){if(je&&typeof A[je]=="function"&&pt)return pt(A,{depth:Hn-Ce});if(Bt!=="symbol"&&typeof A.inspect=="function")return A.inspect()}if(U(A)){var ms=[];return n&&n.call(A,function(fr,ln){ms.push(mt(ln,A,!0)+" => "+mt(fr,A))}),Xe("Map",r.call(A),ms,ur)}if(te(A)){var gs=[];return a&&a.call(A,function(fr){gs.push(mt(fr,A))}),Xe("Set",o.call(A),gs,ur)}if(ne(A))return Le("WeakMap");if(ie(A))return Le("WeakSet");if(X(A))return Le("WeakRef");if(_(A))return Ae(mt(Number(A)));if(F(A))return Ae(mt(ke.call(A)));if(S(A))return Ae(b.call(A));if(fs(A))return Ae(mt(String(A)));if(typeof window<"u"&&A===window)return"{ [object Window] }";if(typeof globalThis<"u"&&A===globalThis||typeof Ir<"u"&&A===Ir)return"{ [object globalThis] }";if(!Or(A)&&!Cr(A)){var Jn=Be(A,mt),ys=ve?ve(A)===Object.prototype:A instanceof Object||A.constructor===Object,Yn=A instanceof Object?"":"null prototype",vs=!ys&&ht&&Object(A)===A&&ht in A?N.call(K(A),8,-1):Yn?"Object":"",fa=ys||typeof A.constructor!="function"?"":A.constructor.name?A.constructor.name+" ":"",Gn=fa+(vs||Yn?"["+T.call(I.call([],vs||[],Yn||[]),": ")+"] ":"");return Jn.length===0?Gn+"{}":ur?Gn+"{"+jt(Jn,ur)+"}":Gn+"{ "+T.call(Jn,", ")+" }"}return String(A)};function cn(k,A,de){var Ce=de.quoteStyle||A,ge=Qe[Ce];return ge+k+ge}function qn(k){return g.call(String(k),/"/g,"&quot;")}function rt(k){return!ht||!(typeof k=="object"&&(ht in k||typeof k[ht]<"u"))}function Mt(k){return K(k)==="[object Array]"&&rt(k)}function Or(k){return K(k)==="[object Date]"&&rt(k)}function Cr(k){return K(k)==="[object RegExp]"&&rt(k)}function Xt(k){return K(k)==="[object Error]"&&rt(k)}function fs(k){return K(k)==="[object String]"&&rt(k)}function _(k){return K(k)==="[object Number]"&&rt(k)}function S(k){return K(k)==="[object Boolean]"&&rt(k)}function D(k){if(Ge)return k&&typeof k=="object"&&k instanceof Symbol;if(typeof k=="symbol")return!0;if(!k||typeof k!="object"||!Ve)return!1;try{return Ve.call(k),!0}catch{}return!1}function F(k){if(!k||typeof k!="object"||!ke)return!1;try{return ke.call(k),!0}catch{}return!1}var j=Object.prototype.hasOwnProperty||function(k){return k in this};function M(k,A){return j.call(k,A)}function K(k){return R.call(k)}function Y(k){if(k.name)return k.name;var A=B.call(H.call(k),/^function\s*([\w$]+)/);return A?A[1]:null}function V(k,A){if(k.indexOf)return k.indexOf(A);for(var de=0,Ce=k.length;de<Ce;de++)if(k[de]===A)return de;return-1}function U(k){if(!r||!k||typeof k!="object")return!1;try{r.call(k);try{o.call(k)}catch{return!0}return k instanceof Map}catch{}return!1}function ne(k){if(!l||!k||typeof k!="object")return!1;try{l.call(k,l);try{f.call(k,f)}catch{return!0}return k instanceof WeakMap}catch{}return!1}function X(k){if(!y||!k||typeof k!="object")return!1;try{return y.call(k),!0}catch{}return!1}function te(k){if(!o||!k||typeof k!="object")return!1;try{o.call(k);try{r.call(k)}catch{return!0}return k instanceof Set}catch{}return!1}function ie(k){if(!f||!k||typeof k!="object")return!1;try{f.call(k,f);try{l.call(k,l)}catch{return!0}return k instanceof WeakSet}catch{}return!1}function ue(k){return!k||typeof k!="object"?!1:typeof HTMLElement<"u"&&k instanceof HTMLElement?!0:typeof k.nodeName=="string"&&typeof k.getAttribute=="function"}function we(k,A){if(k.length>A.maxStringLength){var de=k.length-A.maxStringLength,Ce="... "+de+" more character"+(de>1?"s":"");return we(N.call(k,0,A.maxStringLength),A)+Ce}var ge=an[A.quoteStyle||"single"];ge.lastIndex=0;var le=g.call(g.call(k,ge,"\\$1"),/[\x00-\x1f]/g,me);return cn(le,"single",A)}function me(k){var A=k.charCodeAt(0),de={8:"b",9:"t",10:"n",12:"f",13:"r"}[A];return de?"\\"+de:"\\x"+(A<16?"0":"")+m.call(A.toString(16))}function Ae(k){return"Object("+k+")"}function Le(k){return k+" { ? }"}function Xe(k,A,de,Ce){var ge=Ce?jt(de,Ce):T.call(de,", ");return k+" ("+A+") {"+ge+"}"}function nt(k){for(var A=0;A<k.length;A++)if(V(k[A],`
4
- `)>=0)return!1;return!0}function Ft(k,A){var de;if(k.indent===" ")de=" ";else if(typeof k.indent=="number"&&k.indent>0)de=T.call(Array(k.indent+1)," ");else return null;return{base:de,prev:T.call(Array(A+1),de)}}function jt(k,A){if(k.length===0)return"";var de=`
5
- `+A.prev+A.base;return de+T.call(k,","+de)+`
6
- `+A.prev}function Be(k,A){var de=Mt(k),Ce=[];if(de){Ce.length=k.length;for(var ge=0;ge<k.length;ge++)Ce[ge]=M(k,ge)?A(k[ge],k):""}var le=typeof Ne=="function"?Ne(k):[],Bt;if(Ge){Bt={};for(var Ut=0;Ut<le.length;Ut++)Bt["$"+le[Ut]]=le[Ut]}for(var it in k)M(k,it)&&(de&&String(Number(it))===it&&it<k.length||Ge&&Bt["$"+it]instanceof Symbol||(C.call(/[^\w$]/,it)?Ce.push(A(it,k)+": "+A(k[it],k)):Ce.push(it+": "+A(k[it],k))));if(typeof Ne=="function")for(var Wt=0;Wt<le.length;Wt++)Te.call(k,le[Wt])&&Ce.push("["+A(le[Wt])+"]: "+A(k[le[Wt]],k));return Ce}return Rs}var Kf=Vf();const Jf=ka(Kf);var Yf=Object.create,Ds=Object.defineProperty,Gf=Object.getOwnPropertyDescriptor,Ra=Object.getOwnPropertyNames,Qf=Object.getPrototypeOf,Xf=Object.prototype.hasOwnProperty,ii=(t,e)=>Ds(t,"name",{value:e,configurable:!0}),Da=(t,e)=>function(){return e||(0,t[Ra(t)[0]])((e={exports:{}}).exports,e),e.exports},Zf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ra(e))!Xf.call(t,i)&&i!==r&&Ds(t,i,{get:()=>e[i],enumerable:!(n=Gf(e,i))||n.enumerable});return t},ed=(t,e,r)=>(r=t!=null?Yf(Qf(t)):{},Zf(!t||!t.__esModule?Ds(r,"default",{value:t,enumerable:!0}):r,t)),td=Da({"src/shared.ts"(t,e){var o;var r=[6,2,3,4,5,1],n=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221];function i(a){return a instanceof Error&&Array.isArray(a.errors)}ii(i,"isAggregateError");var s=(o=class{constructor(c,l){Z(this,"extend",ii(c=>new o(`${this.name}:${c}`,this.meta),"extend"));Z(this,"warning",ii((c,...l)=>{this.warn(c,...l)},"warning"));this.name=c,this.meta=l,this.createMethod("success",o.SUCCESS),this.createMethod("error",o.ERROR),this.createMethod("info",o.INFO),this.createMethod("warn",o.WARN),this.createMethod("debug",o.DEBUG)}static format(c,l){this.formatters[c]=l}static color(c,l,u,f=""){return c.colors?`\x1B[3${l<8?l:"8;5;"+l}${c.colors>=2?f:""}m${u}\x1B[0m`:""+u}static code(c,l){let u=0;for(let v=0;v<c.length;v++)u=(u<<3)-u+c.charCodeAt(v)+13,u|=0;const f=l.colors?l.colors>=2?n:r:[];return f[Math.abs(u)%f.length]}static render(c,l){const u=`[${l.type[0].toUpperCase()}]`,f=" ".repeat(c.label?.margin??1);let v=3+f.length,y="";c.showTime&&(v+=c.showTime.length+f.length,y+=o.color(c,8,ti.template(c.showTime))+f);const b=o.code(l.name,c),R=o.color(c,b,l.name,";1"),H=(c.label?.width??0)+R.length-l.name.length;if(c.label?.align==="right"?(y+=R.padStart(H)+f+u+f,v+=(c.label.width??0)+f.length):y+=u+f+R.padEnd(H)+f,y+=l.content.replace(/\n/g,`
7
- `+" ".repeat(v)),c.showDiff&&c.timestamp){const B=l.timestamp-c.timestamp;y+=o.color(c,b," +"+ti.format(B))}return y}createMethod(c,l){this[c]=(...u)=>{if(u.length===1&&u[0]instanceof Error){if(u[0].cause)this[c](u[0].cause);else if(i(u[0])){u[0].errors.forEach(y=>this[c](y));return}}const f=++o.id,v=Date.now();for(const y of o.targets){if(this.getLevel(y)<l)continue;const b=this.format(y,...u),R={id:f,type:c,level:l,name:this.name,meta:this.meta,content:b,timestamp:v};if(y.record)y.record(R);else{const{print:H=console.log}=y;H(o.render(y,R))}y.timestamp=v}}}format(c,...l){l[0]instanceof Error?(l[0]=l[0].stack||l[0].message,l.unshift("%s")):typeof l[0]!="string"&&l.unshift("%o");let u=l.shift();u=u.replace(/%([a-zA-Z%])/g,(v,y)=>{if(v==="%%")return"%";const b=o.formatters[y];if(typeof b=="function"){const R=l.shift();return b(R,c,this)}return v});for(let v of l)typeof v=="object"&&v&&(v=o.formatters.o(v,c,this)),u+=" "+v;const{maxLength:f=10240}=c;return u.split(/\r?\n/g).map(v=>v.slice(0,f)+(v.length>f?"...":"")).join(`
8
- `)}getLevel(c){const l=this.name.split(":");let u=c?.levels||o.levels;do u=u[l.shift()]??u.base;while(l.length&&typeof u=="object");return u}get level(){return this.getLevel()}set level(c){const l=this.name.split(":");let u=o.levels;for(;l.length>1;){const f=l.shift(),v=u[f];typeof v=="object"?u=v:u=u[f]={base:v??u.base}}u[l[0]]=c}},ii(o,"Logger"),Z(o,"SILENT",0),Z(o,"SUCCESS",1),Z(o,"ERROR",1),Z(o,"INFO",2),Z(o,"WARN",2),Z(o,"DEBUG",3),Z(o,"id",0),Z(o,"targets",[{colors:Aa.stdout&&Aa.stdout.level,print(c){console.log(c)}}]),Z(o,"formatters",Object.create(null)),Z(o,"levels",{base:2}),o);s.format("s",a=>a),s.format("d",a=>+a),s.format("j",a=>JSON.stringify(a)),s.format("c",(a,c,l)=>s.color(c,s.code(l.name,c),a)),s.format("C",(a,c)=>s.color(c,15,a,";1")),e.exports=s}}),rd=Da({"src/browser.ts"(t,e){var r=ed(td());r.default.format("o",(n,i)=>Jf(n,{depth:1/0}).replace(/\s*\n\s*/g," ")),e.exports=r.default}});const nd=rd();var id=Object.defineProperty,sd=(t,e)=>id(t,"name",{value:e,configurable:!0}),od=(Er=class extends kr{constructor(e){super(e,"logger",!0),e.on("internal/info",function(r,...n){this.logger("app").info(r,...n)}),e.on("internal/error",function(r,...n){this.logger("app").error(r,...n)}),e.on("internal/warning",function(r,...n){this.logger("app").warn(r,...n)})}[kr.invoke](e){return new nd(e,qe({},"ctx",this.ctx))}},sd(Er,"LoggerService"),(()=>{for(const e of["success","error","info","warn","debug","extend"])Er.prototype[e]=function(...r){return this(this.ctx.name)[e](...r)}})(),Er),ad=Object.defineProperty,cd=Object.getOwnPropertyNames,pe=(t,e)=>ad(t,"name",{value:e,configurable:!0}),ld=(t,e)=>function(){return e||(0,t[cd(t)[0]])((e={exports:{}}).exports,e),e.exports},ud=ld({"src/index.ts"(t,e){var N;var r=Symbol.for("schemastery"),n=Symbol.for("ValidationError");globalThis.__schemastery_index__??(globalThis.__schemastery_index__=0);var i=(N=class extends TypeError{constructor(h,C){let I="$";for(const T of C.path||[])typeof T=="string"?I+="."+T:typeof T=="number"?I+="["+T+"]":typeof T=="symbol"&&(I+=`[Symbol(${T.toString()})]`);I.startsWith(".")&&(I=I.slice(1));super((I==="$"?"":`${I} `)+h);Z(this,"name","ValidationError");this.options=C}static is(h){return!!h?.[n]}},pe(N,"ValidationError"),N);Object.defineProperty(i.prototype,n,{value:!0});var s=pe(function(g){const m=pe(function(h,C={}){return s.resolve(h,m,C)[0]},"schema");if(g.refs){const h=qt(g.refs,I=>new s(I)),C=pe(I=>h[I],"getRef");for(const I in h){const T=h[I];T.sKey=C(T.sKey),T.inner=C(T.inner),T.list=T.list&&T.list.map(C),T.dict=T.dict&&qt(T.dict,C)}return h[g.uid]}if(Object.assign(m,g),typeof m.callback=="string")try{m.callback=new Function("return "+m.callback)()}catch{}return Object.defineProperty(m,"uid",{value:globalThis.__schemastery_index__++}),Object.setPrototypeOf(m,s.prototype),m.meta||(m.meta={}),m.toString=m.toString.bind(m),m},"Schema");s.prototype=Object.create(Function.prototype),s.prototype[r]=!0,s.ValidationError=i;var o;s.prototype.toJSON=pe(function(){var h;if(o)return o[h=this.uid]??(o[h]=JSON.parse(JSON.stringify({...this}))),this.uid;o={[this.uid]:{...this}},o[this.uid]=JSON.parse(JSON.stringify({...this}));const m={uid:this.uid,refs:o};return o=void 0,m},"toJSON"),s.prototype.set=pe(function(m,h){return this.dict[m]=h,this},"set"),s.prototype.push=pe(function(m){return this.list.push(m),this},"push");function a(g,m){const h=typeof g=="string"?{"":g}:{...g};for(const C in m){const I=m[C];I?.$description||I?.$desc?h[C]=I.$description||I.$desc:typeof I=="string"&&(h[C]=I)}return h}pe(a,"mergeDesc");function c(g){return g?.$value??g?.$inner}pe(c,"getInner");function l(g){return ba(g??{},m=>!m.startsWith("$"))}pe(l,"extractKeys"),s.prototype.i18n=pe(function(m){const h=s(this),C=a(h.meta.description,m);return Object.keys(C).length&&(h.meta.description=C),h.dict&&(h.dict=qt(h.dict,(I,T)=>I.i18n(qt(m,J=>c(J)?.[T]??J?.[T])))),h.list&&(h.list=h.list.map((I,T)=>I.i18n(qt(m,(J={})=>Array.isArray(c(J))?c(J)[T]:Array.isArray(J)?J[T]:l(J))))),h.inner&&(h.inner=h.inner.i18n(qt(m,I=>c(I)?c(I):l(I)))),h.sKey&&(h.sKey=h.sKey.i18n(qt(m,I=>I?.$key))),h},"i18n"),s.prototype.extra=pe(function(m,h){const C=s(this);return C.meta={...C.meta,[m]:h},C},"extra");for(const g of["required","disabled","collapse","hidden","loose"])Object.assign(s.prototype,{[g](m=!0){const h=s(this);return h.meta={...h.meta,[g]:m},h}});s.prototype.deprecated=pe(function(){var h;const m=s(this);return(h=m.meta).badges||(h.badges=[]),m.meta.badges.push({text:"deprecated",type:"danger"}),m},"deprecated"),s.prototype.experimental=pe(function(){var h;const m=s(this);return(h=m.meta).badges||(h.badges=[]),m.meta.badges.push({text:"experimental",type:"warning"}),m},"experimental"),s.prototype.pattern=pe(function(m){const h=s(this),C=_a(m,["source","flags"]);return h.meta={...h.meta,pattern:C},h},"pattern"),s.prototype.simplify=pe(function(m){if(hr(m,this.meta.default,this.type==="dict"))return null;if(Re(m))return m;if(this.type==="object"||this.type==="dict"){const h={};for(const C in m){const T=(this.type==="object"?this.dict[C]:this.inner)?.simplify(m[C]);(this.type==="dict"||!Re(T))&&(h[C]=T)}return hr(h,this.meta.default,this.type==="dict")?null:h}else if(this.type==="array"||this.type==="tuple"){const h=[];return m.forEach((C,I)=>{const T=this.type==="array"?this.inner:this.list[I],J=T?T.simplify(C):C;h.push(J)}),h}else if(this.type==="intersect"){const h={};for(const C of this.list)Object.assign(h,C.simplify(m));return h}else if(this.type==="union")for(const h of this.list)try{return s.resolve(m,h,{}),h.simplify(m)}catch{}return m},"simplify"),s.prototype.toString=pe(function(m){return H[this.type]?.(this,m)??`Schema<${this.type}>`},"toString"),s.prototype.role=pe(function(g,m){const h=s(this);return h.meta={...h.meta,role:g,extra:m},h},"role");for(const g of["default","link","comment","description","max","min","step"])Object.assign(s.prototype,{[g](m){const h=s(this);return h.meta={...h.meta,[g]:m},h}});var u={};s.extend=pe(function(m,h){u[m]=h},"extend"),s.resolve=pe(function(m,h,C={},I=!1){if(!h)return[m];if(C.ignore?.(m,h))return[m];if(Re(m)&&h.type!=="lazy"){if(h.meta.required)throw new i("missing required value",C);let J=h,re=h.meta.default;for(;J?.type==="intersect"&&Re(re);)J=J.list[0],re=J?.meta.default;if(Re(re))return[m];m=ei(re)}const T=u[h.type];if(!T)throw new i(`unsupported type "${h.type}"`,C);try{return T(m,h,C,I)}catch(J){if(!h.meta.loose)throw J;return[h.meta.default]}},"resolve"),s.from=pe(function(m){if(Re(m))return s.any();if(["string","number","boolean"].includes(typeof m))return s.const(m).required();if(m[r])return m;if(typeof m=="function")switch(m){case String:return s.string().required();case Number:return s.number().required();case Boolean:return s.boolean().required();case Function:return s.function().required();default:return s.is(m).required()}else throw new TypeError(`cannot infer schema from ${m}`)},"from"),s.lazy=pe(function(m){const h=pe(()=>(C.inner[r]||(C.inner=C.builder(),C.inner.meta={...C.meta,...C.inner.meta}),C.inner.toJSON()),"toJSON"),C=new s({type:"lazy",builder:m,inner:{toJSON:h}});return C},"lazy"),s.natural=pe(function(){return s.number().step(1).min(0)},"natural"),s.percent=pe(function(){return s.number().step(.01).min(0).max(1).role("slider")},"percent"),s.date=pe(function(){return s.union([s.is(Date),s.transform(s.string().role("datetime"),(m,h)=>{const C=new Date(m);if(isNaN(+C))throw new i(`invalid date "${m}"`,h);return C},!0)])},"date"),s.regExp=pe(function(m=""){return s.union([s.is(RegExp),s.transform(s.string().role("regexp",{flag:m}),(h,C)=>{try{return new RegExp(h,m)}catch(I){throw new i(I.message,C)}},!0)])},"regExp"),s.arrayBuffer=pe(function(m){return s.union([s.is(ArrayBuffer),s.is(SharedArrayBuffer),s.transform(s.any(),(h,C)=>{if(Ot.isSource(h))return Ot.fromSource(h);throw new i(`expected ArrayBufferSource but got ${h}`,C)},!0),...m?[s.transform(s.string(),(h,C)=>{try{return m==="base64"?Ot.fromBase64(h):Ot.fromHex(h)}catch(I){throw new i(I.message,C)}},!0)]:[]])},"arrayBuffer"),s.extend("lazy",(g,m,h,C)=>(m.inner[r]||(m.inner=m.builder(),m.inner.meta={...m.meta,...m.inner.meta}),s.resolve(g,m.inner,h,C))),s.extend("any",g=>[g]),s.extend("never",(g,m,h)=>{throw new i(`expected nullable but got ${g}`,h)}),s.extend("const",(g,{value:m},h)=>{if(hr(g,m))return[m];throw new i(`expected ${m} but got ${g}`,h)});function f(g,m,h,C,I=!1){const{max:T=1/0,min:J=-1/0}=m;if(g>T)throw new i(`expected ${h} <= ${T} but got ${g}`,C);if(g<J&&!I)throw new i(`expected ${h} >= ${J} but got ${g}`,C)}pe(f,"checkWithinRange"),s.extend("string",(g,{meta:m},h)=>{if(typeof g!="string")throw new i(`expected string but got ${g}`,h);if(m.pattern){const C=new RegExp(m.pattern.source,m.pattern.flags);if(!C.test(g))throw new i(`expect string to match regexp ${C}`,h)}return f(g.length,m,"string length",h),[g]});function v(g,m){const h=g.toString();if(h.includes("e"))return g*Math.pow(10,m);const C=h.indexOf(".");if(C===-1)return g*Math.pow(10,m);const I=h.slice(C+1),T=h.slice(0,C);return I.length<=m?+(T+I.padEnd(m,"0")):+(T+I.slice(0,m)+"."+I.slice(m))}pe(v,"decimalShift");function y(g,m,h){if(h=Math.abs(h),!/^\d+\.\d+$/.test(h.toString()))return(g-m)%h===0;const C=h.toString().indexOf("."),I=h.toString().slice(C+1).length;return Math.abs(v(g,I)-v(m,I))%v(h,I)===0}pe(y,"isMultipleOf"),s.extend("number",(g,{meta:m},h)=>{if(typeof g!="number")throw new i(`expected number but got ${g}`,h);f(g,m,"number",h);const{step:C}=m;if(C&&!y(g,m.min??0,C))throw new i(`expected number multiple of ${C} but got ${g}`,h);return[g]}),s.extend("boolean",(g,m,h)=>{if(typeof g=="boolean")return[g];throw new i(`expected boolean but got ${g}`,h)}),s.extend("bitset",(g,{bits:m,meta:h},C)=>{let I=0,T=[];if(typeof g=="number"){I=g;for(const J in m)g&m[J]&&T.push(J)}else if(Array.isArray(g)){T=g;for(const J of T){if(typeof J!="string")throw new i(`expected string but got ${J}`,C);J in m&&(I|=m[J])}}else throw new i(`expected number or array but got ${g}`,C);return I===h.default?[I]:[I,T]}),s.extend("function",(g,m,h)=>{if(typeof g=="function")return[g];throw new i(`expected function but got ${g}`,h)}),s.extend("is",(g,{constructor:m},h)=>{if(typeof m=="function"){if(g instanceof m)return[g];throw new i(`expected ${m.name} but got ${g}`,h)}else{if(Re(g))throw new i(`expected ${m} but got ${g}`,h);let C=Object.getPrototypeOf(g);for(;C;){if(C.constructor?.name===m)return[g];C=Object.getPrototypeOf(C)}throw new i(`expected ${m} but got ${g}`,h)}});function b(g,m,h,C){try{const[I,T]=s.resolve(g[m],h,{...C,path:[...C.path||[],m]});return T!==void 0&&(g[m]=T),I}catch(I){if(!C?.autofix)throw I;return delete g[m],h.meta.default}}pe(b,"property"),s.extend("array",(g,{inner:m,meta:h},C)=>{if(!Array.isArray(g))throw new i(`expected array but got ${g}`,C);return f(g.length,h,"array length",C,!Re(m.meta.default)),[g.map((I,T)=>b(g,T,m,C))]}),s.extend("dict",(g,{inner:m,sKey:h},C,I)=>{if(!Zn(g))throw new i(`expected object but got ${g}`,C);const T={};for(const J in g){let re;try{re=s.resolve(J,h,C)[0]}catch(ke){if(I)continue;throw ke}T[re]=b(g,J,m,C),g[re]=g[J],J!==re&&delete g[J]}return[T]}),s.extend("tuple",(g,{list:m},h,C)=>{if(!Array.isArray(g))throw new i(`expected array but got ${g}`,h);const I=m.map((T,J)=>b(g,J,T,h));return C?[I]:(I.push(...g.slice(m.length)),[I])});function R(g,m){for(const h in m)h in g||(g[h]=m[h])}pe(R,"merge"),s.extend("object",(g,{dict:m},h,C)=>{if(!Zn(g))throw new i(`expected object but got ${g}`,h);const I={};for(const T in m){const J=b(g,T,m[T],h);(!Re(J)||T in g)&&(I[T]=J)}return C||R(I,g),[I]}),s.extend("union",(g,{list:m,toString:h},C,I)=>{for(const T of m)try{return s.resolve(g,T,C,I)}catch{}throw new i(`expected ${h()} but got ${JSON.stringify(g)}`,C)}),s.extend("intersect",(g,{list:m,toString:h},C,I)=>{let T;for(const J of m){const re=s.resolve(g,J,C,!0)[0];if(!Re(re))if(Re(T))T=re;else{if(typeof T!=typeof re)throw new i(`expected ${h()} but got ${JSON.stringify(g)}`,C);if(typeof re=="object")R(T??(T={}),re);else if(T!==re)throw new i(`expected ${h()} but got ${JSON.stringify(g)}`,C)}}return!I&&Zn(g)&&R(T,g),[T]}),s.extend("transform",(g,{inner:m,callback:h,preserve:C},I)=>{const[T,J=g]=s.resolve(g,m,I,!0);return C?[h(T)]:[h(T),h(J)]});var H={};function B(g,m,h){H[g]=h,Object.assign(s,{[g](...C){const I=new s({type:g});return m.forEach((T,J)=>{switch(T){case"sKey":I.sKey=C[J]??s.string();break;case"inner":I.inner=s.from(C[J]);break;case"list":I.list=C[J].map(s.from);break;case"dict":I.dict=qt(C[J],s.from);break;case"bits":{I.bits={};for(const re in C[J])typeof C[J][re]=="number"&&(I.bits[re]=C[J][re]);break}case"callback":{const re=I.callback=C[J];re.toJSON||(re.toJSON=()=>re.toString());break}case"constructor":{const re=I.constructor=C[J];typeof re=="function"&&(re.toJSON||(re.toJSON=()=>re.name));break}default:I[T]=C[J]}}),g==="object"||g==="dict"?I.meta.default={}:g==="array"||g==="tuple"?I.meta.default=[]:g==="bitset"&&(I.meta.default=0),I}})}pe(B,"defineMethod"),B("is",["constructor"],({constructor:g})=>typeof g=="function"?g.name:g),B("any",[],()=>"any"),B("never",[],()=>"never"),B("const",["value"],({value:g})=>typeof g=="string"?JSON.stringify(g):g),B("string",[],()=>"string"),B("number",[],()=>"number"),B("boolean",[],()=>"boolean"),B("bitset",["bits"],()=>"bitset"),B("function",[],()=>"function"),B("array",["inner"],({inner:g})=>`${g.toString(!0)}[]`),B("dict",["inner","sKey"],({inner:g,sKey:m})=>`{ [key: ${m.toString()}]: ${g.toString()} }`),B("tuple",["list"],({list:g})=>`[${g.map(m=>m.toString()).join(", ")}]`),B("object",["dict"],({dict:g})=>Object.keys(g).length===0?"{}":`{ ${Object.entries(g).map(([m,h])=>`${m}${h.meta.required?"":"?"}: ${h.toString()}`).join(", ")} }`),B("union",["list"],({list:g},m)=>{const h=g.map(({toString:C})=>C()).join(" | ");return m?`(${h})`:h}),B("intersect",["list"],({list:g})=>`${g.map(m=>m.toString(!0)).join(" & ")}`),B("transform",["inner","callback","preserve"],({inner:g},m)=>g.toString(m)),e.exports=s}});const Pe=ud();var fd=Object.defineProperty,dd=(t,e)=>fd(t,"name",{value:e,configurable:!0}),Na=Symbol("cordis.schema.order"),hd=(tn=class{constructor(e){Z(this,"_data",Pe.intersect([]));this.ctx=e,qe(this,kr.tracker,{property:"ctx"})}extend(e,r=0){const n=this._data.list.findIndex(i=>i[Na]<r);return e[Na]=r,this.ctx.effect(()=>(n>=0?this._data.list.splice(n,0,e):this._data.list.push(e),this.ctx.emit("internal/service-schema"),()=>{Et(this._data.list,e),this.ctx.emit("internal/service-schema")}))}toJSON(){return this._data.toJSON()}},dd(tn,"SchemaService"),tn),pd=Object.defineProperty,si=(t,e)=>pd(t,"name",{value:e,configurable:!0}),md=(rn=class extends kr{constructor(e){super(e,"timer",!0),e.mixin("timer",["setTimeout","setInterval","sleep","throttle","debounce"])}setTimeout(e,r){const n=this[He.current].effect(()=>{const i=setTimeout(()=>{n(),e()},r);return()=>clearTimeout(i)});return n}setInterval(e,r){return this[He.current].effect(()=>{const n=setInterval(e,r);return()=>clearInterval(n)})}sleep(e){const r=this[He.current];return new Promise((n,i)=>{const s=this.setTimeout(()=>{s(),o(),n()},e),o=r.on("dispose",()=>{s(),o(),i(new Error("Context has been disposed"))})})}createWrapper(e,r=!1){const n=this[He.current];n.scope.assertActive();let i;const s=si(()=>{r=!0,Et(n.scope.disposables,s),clearTimeout(i)},"dispose"),o=si((...a)=>{clearTimeout(i),i=e(a,()=>!r&&n.scope.isActive)},"wrapper");return o.dispose=s,n.scope.disposables.push(s),o}throttle(e,r,n){let i=-1/0;const s=si((...o)=>{i=Date.now(),e(...o)},"execute");return this.createWrapper((o,a)=>{const c=Date.now(),l=r-(c-i);if(l<=0)s(...o);else if(a())return setTimeout(s,l,...o)},n)}debounce(e,r){return this.createWrapper((n,i)=>{if(i())return setTimeout(e,r,...n)})}},si(rn,"TimerService"),rn),gd=Object.defineProperty,Ns=(t,e)=>gd(t,"name",{value:e,configurable:!0}),La=(nn=class extends He{constructor(r){super(r);Z(this,"baseDir");this.baseDir=globalThis.process?.cwd?.()||"",this.provide("logger",void 0,!0),this.provide("timer",void 0,!0),this.plugin(od),this.plugin(md)}},Ns(nn,"Context"),nn),Ar=(sn=class extends kr{constructor(...r){super(...r);Z(this,"logger");Z(this,"schema");this.logger=this.ctx.logger(this.name),this.schema=new hd(this.ctx)}[kr.setup](){this.ctx=new La}},Ns(sn,"Service"),sn);function yd(){}Ns(yd,"default");var lt=(t=>(t.BODY_USED="BODY_USED",t.NO_BODY_READER="NO_BODY_READER",t.TIMEOUT="TIMEOUT",t.NETWORK_ERROR="NETWORK_ERROR",t.BODY_NOT_ALLOWED="BODY_NOT_ALLOWED",t.HOOK_CONTEXT_CHANGED="HOOK_CONTEXT_CHANGED",t.ABORTED_BY_HOOK="ABORTED_BY_HOOK",t.INVALID_HOOK_CALLBACK="INVALID_HOOK_CALLBACK",t.UNEXPECTED_HOOK_RETURN="UNEXPECTED_HOOK_RETURN",t))(lt||{});class ot extends Error{constructor(e,r,n,i){super(r,i),this.code=e,this.context=n,this.name="FexiosError"}}class vd extends ot{constructor(e,r,n){super(r.statusText,e,void 0,n),this.response=r,this.name="FexiosResponseError"}}function bd(t,e=2048){if(!(t instanceof Uint8Array))throw new TypeError("Input must be a Uint8Array");if(t.length===0)return!0;const r=Math.min(Math.max(t.length,256),e),n=t.slice(0,r);if(_d(n))return!1;const i=wd(n);if(i.nullByteRatio>.05||i.highByteRatio>.95)return!1;const s=["utf-8","utf-16le","utf-16be","iso-8859-1"];let o=-1,a=!1;for(const c of s)try{const l=new TextDecoder(c,{fatal:!0}).decode(n),u=xd(l);u>o&&(o=u,a=u>.7)}catch{continue}return a}function _d(t){if(t.length<4)return!1;const e=[[137,80,78,71],[255,216,255],[71,73,70],[37,80,68,70],[80,75,3,4],[80,75,5,6],[80,75,7,8],[127,69,76,70],[77,90],[202,254,186,190],[0,0,1,0],[82,73,70,70]];for(const r of e)if(t.length>=r.length){let n=!0;for(let i=0;i<r.length;i++)if(t[i]!==r[i]){n=!1;break}if(n)return!0}return!1}function wd(t){let e=0,r=0,n=0;for(const i of t)i===0&&e++,i>127&&r++,(i<32&&i!==9&&i!==10&&i!==13||i===127)&&n++;return{nullByteRatio:e/t.length,highByteRatio:r/t.length,controlCharRatio:n/t.length}}function xd(t){if(t.length===0)return 1;let e=1,r=0;for(let i=0;i<t.length;i++){const s=t[i].charCodeAt(0);s>=32&&s<=126||s===9||s===10||s===13||s===32?r++:s>127&&s<65534?!Sd(s)&&!Ed(s)&&r++:e-=.1}const n=r/t.length;return e*=n,Od(t)&&(e*=1.1),Math.max(0,Math.min(1,e))}function Sd(t){return t>=0&&t<=31||t>=127&&t<=159}function Ed(t){return t>=57344&&t<=63743||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function Od(t){return[/\b\w+\b/,/[.!?]+\s/,/\s+/,/[a-zA-Z]{3,}/,/[\u4e00-\u9fa5]+/,/\d+/].some(e=>e.test(t))}function Ls(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function Ma(t,e={}){const r={};return Object.entries(t).forEach(([n,i])=>{i!=null&&(e.dropEmptyString&&i===""||(r[n]=i))}),r}class pn{constructor(e,r,n){this.rawResponse=e,this.data=r,this.ok=e.ok,this.status=e.status,this.statusText=e.statusText,this.headers=e.headers,Object.entries(n||{}).forEach(([i,s])=>{this[i]=s})}}async function Cd(t,e,r){var n;if(t.bodyUsed)throw new ot(lt.BODY_USED,"Response body has already been used or locked");const i=t.headers.get("content-type")||"",s=Number(t.headers.get("content-length"))||0,o=(c,l)=>l==="json"||c.startsWith("application/json"),a=(c,l,u)=>u==="blob"||c.startsWith("image/")&&!c.startsWith("image/svg")||c.startsWith("video/")||c.startsWith("audio/")||!bd(l);if((t.status===101||t.status===426||t.headers.get("upgrade"))&&typeof globalThis.WebSocket<"u"){const c=new WebSocket(t.url);return await new Promise((l,u)=>{c.onopen=l,c.onerror=u}),new pn(t,c,{ok:!0,status:101,statusText:"Switching Protocols"})}else if(i.startsWith("text/event-stream")&&!["text","json"].includes(e||"")&&typeof globalThis.EventSource<"u"){const c=new EventSource(t.url);return await new Promise((l,u)=>{c.onopen=l,c.onerror=u}),new pn(t,c)}else{if(e==="stream")return new pn(t,t.body);{const c=(n=t.clone().body)==null?void 0:n.getReader();if(!c)throw new ot(lt.NO_BODY_READER,"Failed to get ReadableStream from response body");let l=new Uint8Array;for(;;){const{done:f,value:v}=await c.read();if(f)break;if(v&&(l=new Uint8Array([...l,...v]),r&&s>0)){const y=Math.min(l.length/s,1);r(y,l)}}const u=new pn(t,void 0);if(e==="arrayBuffer")return u.data=l.buffer,u;if(o(i,e))try{const f=new TextDecoder().decode(l);u.data=JSON.parse(f)}catch{}if(typeof u.data!="string"&&a(i,l,e)?u.data=new Blob([l],{type:t.headers.get("content-type")||void 0}):u.data=new TextDecoder().decode(l),typeof u.data=="string"&&e!=="text"){const f=u.data.trim(),v=f[0],y=f[f.length-1];if(v==="{"&&y==="}"||v==="["&&y==="]")try{u.data=JSON.parse(u.data)}catch{}}if(typeof u.data>"u"&&(u.data=l.length>0?l:void 0),u.ok)return u;throw new vd(`Request failed with status code ${t.status}`,u)}}}class Pd{static makeSearchParams(e){const r=new URLSearchParams;return Object.entries(e).forEach(([n,i])=>{Array.isArray(i)?i.forEach(s=>r.append(n,String(s))):r.set(n,String(i))}),r}static makeQueryString(e){return this.makeSearchParams(e).toString()}}function $d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ms,Fa;function kd(){if(Fa)return Ms;Fa=1;function t(e){var r=this.constructor.prototype[e],n=function(){return r.apply(n,arguments)};return Object.setPrototypeOf(n,this.constructor.prototype),Object.getOwnPropertyNames(r).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(r,i))}),n}return t.prototype=Object.create(Function.prototype),Ms=t,Ms}var Id=kd();const Ad=$d(Id);class Tr extends Ad{constructor(e={}){super("request"),this.baseConfigs=e,this.hooks=[],this.DEFAULT_CONFIGS={baseURL:"",timeout:60*1e3,credentials:"same-origin",headers:{},query:{},responseType:void 0},this.ALL_METHODS=["get","post","put","patch","delete","head","options","trace"],this.METHODS_WITHOUT_BODY=["get","head","options","trace"],this.interceptors={request:this.createInterceptor("beforeRequest"),response:this.createInterceptor("afterResponse")},this.create=Tr.create,this.dropUndefinedAndNull=Ma,this.checkIsPlainObject=Ls,this.ALL_METHODS.forEach(this.createMethodShortcut.bind(this))}async request(e,r){var n,i,s,o;let a=r=r||{};typeof e=="string"||e instanceof URL?a.url=e.toString():typeof e=="object"&&(a={...e,...a}),a=await this.emit("beforeInit",a);const c=r.baseURL||this.baseConfigs.baseURL||((n=globalThis.location)==null?void 0:n.href),l=c?new URL(c,(i=globalThis.location)==null?void 0:i.href):void 0,u=new URL(a.url.toString(),l);a.url=u.href,a.baseURL=l?l.href:u.origin,a.headers=this.mergeHeaders(this.baseConfigs.headers,r.headers);const f=l?.searchParams,v=new URLSearchParams(u.searchParams);if(u.search="",a.url=u.href,a.query=this.mergeQuery(f,this.baseConfigs.query,v,r.query),u.search=Pd.makeQueryString(a.query),a.url=u.toString(),this.METHODS_WITHOUT_BODY.includes((s=a.method)==null?void 0:s.toLocaleLowerCase())&&a.body)throw new ot(lt.BODY_NOT_ALLOWED,`Request method "${a.method}" does not allow body`);a=await this.emit("beforeRequest",a);let y;typeof a.body<"u"&&a.body!==null&&(a.body instanceof Blob||a.body instanceof FormData||a.body instanceof URLSearchParams?y=a.body:typeof a.body=="object"&&a.body!==null?(y=JSON.stringify(a.body),a.headers["content-type"]="application/json"):y=a.body),!((o=r.headers)!=null&&o["content-type"])&&y&&(y instanceof FormData||y instanceof URLSearchParams?delete a.headers["content-type"]:typeof y=="string"&&typeof a.body=="object"?a.headers["content-type"]="application/json":y instanceof Blob&&(a.headers["content-type"]=y.type)),a.body=y,a=await this.emit("afterBodyTransformed",a);const b=a.abortController||globalThis.AbortController?new AbortController:void 0,R=new Request(a.url,{method:a.method||"GET",credentials:a.credentials,cache:a.cache,mode:a.mode,headers:a.headers,body:a.body,signal:b?.signal});a.rawRequest=R,a=await this.emit("beforeActualFetch",a);const H=a.timeout||this.baseConfigs.timeout||60*1e3;if(a.url.startsWith("ws"))try{const N=new WebSocket(a.url);return await new Promise((g,m)=>{const h=setTimeout(()=>{m(new ot(lt.TIMEOUT,`WebSocket connection timed out after ${H}ms`,a))},H);N.onopen=()=>{clearTimeout(h),g()},N.onerror=C=>{clearTimeout(h),m(new ot(lt.NETWORK_ERROR,"WebSocket connection failed",a))},N.onclose=C=>{C.code!==1e3&&(clearTimeout(h),m(new ot(lt.NETWORK_ERROR,`WebSocket closed with code ${C.code}`,a)))}}),a.rawResponse=new Response,a.response=new pn(a.rawResponse,N,{ok:!0,status:101,statusText:"Switching Protocols"}),a.data=N,a.headers=new Headers,this.emit("afterResponse",a)}catch(N){throw N instanceof ot?N:new ot(lt.NETWORK_ERROR,`WebSocket creation failed: ${N}`,a)}let B;try{b&&(B=setTimeout(()=>{b.abort()},H));const N=await fetch(a.rawRequest).catch(g=>{throw B&&clearTimeout(B),b!=null&&b.signal.aborted?new ot(lt.TIMEOUT,`Request timed out after ${H}ms`,a):new ot(lt.NETWORK_ERROR,g.message,a)});return B&&clearTimeout(B),a.rawResponse=N,a.response=await Cd(N,a.responseType,(g,m)=>{var h;(h=r?.onProgress)==null||h.call(r,g,m)}),a.data=a.response.data,a.headers=a.response.headers,this.emit("afterResponse",a)}catch(N){throw B&&clearTimeout(B),N}}mergeQuery(e,...r){const n={},i=s=>{s&&(Ls(s)?Object.entries(s).forEach(([o,a])=>{a==null?delete n[o]:Array.isArray(a)?(o.endsWith("[]"),n[o]=a.map(String)):n[o]=String(a)}):new URLSearchParams(s).forEach((o,a)=>{n[a]=o}))};return i(e),r.forEach(i),n}mergeHeaders(e,...r){const n={},i=new Headers(e);for(const s of r)if(s!=null)if(Ls(s)){const o=Ma(s);if(Object.keys(o).length===0)continue;new Headers(o).forEach((a,c)=>{i.set(c,a)})}else new Headers(s).forEach((o,a)=>{i.set(a,o)});return i.forEach((s,o)=>{n[o]=s}),n}async emit(e,r){const n=this.hooks.filter(i=>i.event===e);try{let i=0;for(const s of n){const o=`${e}#${s.action.name||`anonymous#${i}`}`,a=Symbol("FexiosHookContext");r[a]=a;const c=await s.action.call(this,r);if(c===!1)throw new ot(lt.ABORTED_BY_HOOK,`Request aborted by hook "${o}"`,r);if(typeof c=="object"&&c[a]===a)r=c;else{const l=globalThis["".concat("console")];try{throw new ot(lt.HOOK_CONTEXT_CHANGED,`Hook "${o}" should return the original FexiosContext or return false to abort the request, but got "${c}".`)}catch(u){l.warn(u.stack||u)}}delete r[a],i++}}catch(i){return Promise.reject(i)}return r}on(e,r,n=!1){if(typeof r!="function")throw new ot(lt.INVALID_HOOK_CALLBACK,`Hook should be a function, but got "${typeof r}"`);return this.hooks[n?"unshift":"push"]({event:e,action:r}),this}off(e,r){return e==="*"||!e?this.hooks=this.hooks.filter(n=>n.action!==r):this.hooks=this.hooks.filter(n=>n.event!==e||n.action!==r),this}createInterceptor(e){return{handlers:()=>this.hooks.filter(r=>r.event===e).map(r=>r.action),use:(r,n=!1)=>this.on(e,r,n),clear:()=>{this.hooks=this.hooks.filter(r=>r.event!==e)}}}createMethodShortcut(e){return Object.defineProperty(this,e,{value:(r,n,i)=>(this.METHODS_WITHOUT_BODY.includes(e.toLocaleLowerCase())?i=n:(i=i||{},i.body=n),this.request(r,{...i,method:e}))}),this}extends(e){const r=new Tr({...this.baseConfigs,...e});return r.hooks=[...this.hooks],r}static create(e){return new Tr(e)}}/**
3
+ `),e.emit(e,"internal/warning",n)}get(e){if(this.ctx[Q.internal][e]?.type!=="service")return;const n=this.ctx[Q.isolate][e],i=this.ctx[Q.store][n]?.value;return Ct(this.ctx,i)}set(e,r){this.provide(e);const n=this.ctx[Q.isolate][e],i=this.ctx[Q.store][n]?.value;r??(r=void 0);let s=oe(()=>{},"dispose");if(i===r)return s;if(!Ne(r)&&!Ne(i))throw new Error(`service ${e} has been registered`);const o=this.ctx;Ne(r)||(s=o.effect(()=>()=>{o.set(e,void 0)})),Oa(r)&&o.emit(o,"internal/warning",new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));const a=Object.create(o);return a[Q.filter]=c=>o[Q.isolate][e]===c[Q.isolate][e],o.emit(a,"internal/before-service",e,r),o[Q.store][n]={value:r,source:o},o.emit(a,"internal/service",e,i),s}provide(e,r,n){const i=this.ctx.root[Q.internal];if(e in i)return;const s=Symbol(e);i[e]={type:"service",builtin:n},this.ctx.root[Q.isolate][e]=s,Ps(r)&&(this.ctx[Q.store][s]={value:r,source:null},He(r,Q.tracker,{associate:e,property:"ctx"}))}_accessor(e,r){const n=this.ctx.root[Q.internal];return e in n?()=>{}:(n[e]={type:"accessor",...r},()=>delete this.ctx.root[Q.isolate][e])}accessor(e,r){this.ctx.scope.effect(()=>this._accessor(e,r))}alias(e,r){const n=this.ctx.root[Q.internal];if(!(e in n))for(const i of r)n[i]||(n[i]={type:"alias",name:e})}_mixin(e,r){const n=Array.isArray(r)?r.map(o=>[o,o]):Object.entries(r),i=typeof e=="string"?o=>o[e]:()=>e,s=n.map(([o,a])=>this._accessor(a,{get(c){const u=i(this);if(Ne(u))return u;const l=c?hn(c,u):u,f=Reflect.get(u,o,l);return typeof f!="function"?f:f.bind(l??u)},set(c,u){const l=i(this),f=u?hn(u,l):l;return Reflect.set(l,o,c,f)}}));return()=>s.forEach(o=>o())}mixin(e,r){this.ctx.scope.effect(()=>this._mixin(e,r))}trace(e){return Ct(this.ctx,e)}bind(e){return new Proxy(e,{apply:oe((r,n,i)=>r.apply(this.trace(n),i.map(s=>this.trace(s))),"apply")})}},oe(wt,"ReflectService"),Z(wt,"handler",{get:oe((e,r,n)=>{if(typeof r!="string")return Reflect.get(e,r,n);if(Reflect.has(e,r))return Ct(n,Reflect.get(e,r,n),!0);const[i,s]=wt.resolveInject(e,r),o=new Error(`property ${i} is not registered, declare it as \`inject\` to suppress this warning`);return s?s.type==="accessor"?s.get.call(n,n[Q.receiver]):(s.builtin||wt.checkInject(n,i,o),n.reflect.get(i)):(wt.checkInject(n,i,o),Reflect.get(e,i,n))},"get"),set:oe((e,r,n,i)=>{if(typeof r!="string")return Reflect.set(e,r,n,i);const[s,o]=wt.resolveInject(e,r);return o?o.type==="accessor"?o.set?o.set.call(i,n,i[Q.receiver]):!1:(i.reflect.set(s,n),!0):Reflect.set(e,s,n,i)},"set"),has:oe((e,r)=>{if(typeof r!="string")return Reflect.has(e,r);if(Reflect.has(e,r))return!0;const[,n]=wt.resolveInject(e,r);return!!n},"has")}),wt),Is=Xf;function As(t){return t!==null&&t!==!1&&t!==void 0}oe(As,"isBailed");var Zf=(Gr=class{constructor(e){Z(this,"isActive",!1);Z(this,"_tasks",new Set);Z(this,"_hooks",{});this.ctx=e,He(this,Q.tracker,{associate:"lifecycle",property:"ctx"}),He(this.on("internal/listener",function(n,i,s){const o=s.prepend?"unshift":"push";if(n==="ready")return this.lifecycle.isActive?(this.scope.ensure(async()=>i()),()=>!1):void 0;if(n==="dispose")return this.scope.disposables[o](i),He(i,"name","event <dispose>"),()=>Ot(this.scope.disposables,i);if(n==="fork")return this.scope.runtime.forkables[o](i),this.scope.collect("event <fork>",()=>Ot(this.scope.runtime.forkables,i))}),ze.static,e.scope);for(const n of["info","error","warning"])He(this.on(`internal/${n}`,(i,...s)=>{this._hooks[`internal/${n}`].length>1||console.info(i,...s)}),ze.static,e.scope);He(this.on("internal/before-service",function(n){for(const i of this.registry.values()){if(!i.inject[n]?.required)continue;const s=i.isReusable?i.children:[i];for(const o of s)this[Q.filter](o.ctx)&&(o.updateStatus(),o.reset())}},{global:!0}),ze.static,e.scope),He(this.on("internal/service",function(n){for(const i of this.registry.values()){if(!i.inject[n]?.required)continue;const s=i.isReusable?i.children:[i];for(const o of s)this[Q.filter](o.ctx)&&o.start()}},{global:!0}),ze.static,e.scope);const r=oe((n,i)=>{if(!n.runtime.plugin)return!1;for(const s in n.runtime.inject)if(i===Is.resolveInject(n.ctx,s)[0])return!0;return r(n.parent.scope,i)},"checkInject");He(this.on("internal/inject",function(n){return r(this.scope,n)},{global:!0}),ze.static,e.scope)}async flush(){for(;this._tasks.size;)await Promise.all(Array.from(this._tasks))}filterHooks(e,r){return r=Ct(this.ctx,r),e.slice().filter(n=>{const i=r?.[ze.filter];return n.global||!i||i.call(r,n.ctx)})}*dispatch(e,r){const n=typeof r[0]=="object"||typeof r[0]=="function"?r.shift():null,i=r.shift();i!=="internal/event"&&this.emit("internal/event",e,i,r,n);for(const s of this.filterHooks(this._hooks[i]||[],n))yield s.callback.apply(n,r)}async parallel(...e){await Promise.all(this.dispatch("emit",e))}emit(...e){Array.from(this.dispatch("emit",e))}async serial(...e){for await(const r of this.dispatch("serial",e))if(As(r))return r}bail(...e){for(const r of this.dispatch("bail",e))if(As(r))return r}register(e,r,n,i){const s=i.prepend?"unshift":"push";return r[s]({ctx:this.ctx,callback:n,...i}),this.ctx.state.collect(e,()=>this.unregister(r,n))}unregister(e,r){const n=e.findIndex(i=>i.callback===r);if(n>=0)return e.splice(n,1),!0}on(e,r,n){var a;typeof n!="object"&&(n={prepend:n}),this.ctx.scope.assertActive(),r=this.ctx.reflect.bind(r);const i=this.bail(this.ctx,"internal/listener",e,r,n);if(i)return i;const s=(a=this._hooks)[e]||(a[e]=[]),o=typeof e=="string"?`event <${e}>`:"event (Symbol)";return this.register(o,s,r,n)}once(e,r,n){const i=this.on(e,function(...s){return i(),r.apply(this,s)},n);return i}async start(){this.isActive=!0;const e=this._hooks.ready||[];for(;e.length;){const{ctx:r,callback:n}=e.shift();r.scope.ensure(async()=>n())}await this.flush()}async stop(){this.isActive=!1,this.ctx.scope.reset()}},oe(Gr,"Lifecycle"),Gr),ed=Zf,Ts=(Er=class extends Error{constructor(e,r){super(r??Er.Code[e]),this.code=e}},oe(Er,"CordisError"),Er);(t=>{t.Code={INACTIVE_EFFECT:"cannot create effect on inactive context"}})(Ts||(Ts={}));var Ca=(Qr=class{constructor(e,r){Z(this,"uid");Z(this,"ctx");Z(this,"disposables",[]);Z(this,"error");Z(this,"status",0);Z(this,"isActive",!1);Z(this,"context");Z(this,"proxy");Z(this,"acceptors",[]);Z(this,"tasks",new Set);Z(this,"hasError",!1);this.parent=e,this.config=r,this.uid=e.registry?e.registry.counter:0,this.ctx=this.context=e.extend({scope:this}),this.proxy=new Proxy({},{get:oe((n,i)=>Reflect.get(this.config,i),"get")})}get _config(){return this.runtime.isReactive?this.proxy:this.config}assertActive(){if(!(this.uid!==null||this.isActive))throw new Ts("INACTIVE_EFFECT")}effect(e,r){this.assertActive();const n=Es(e)?new e(this.ctx,r):e(this.ctx,r);let i=!1;const s=typeof n=="function"?n:n.dispose.bind(n),o=oe((...a)=>{if(!i)return i=!0,Ot(this.disposables,o),s(...a)},"wrapped");return this.disposables.push(o),typeof n=="function"?o:(n.dispose=o,n)}collect(e,r){const n=He(()=>(Ot(this.disposables,n),r()),"name",e);return this.disposables.push(n),n}restart(){this.reset(),this.error=null,this.hasError=!1,this.status=0,this.start()}_getStatus(){return this.uid===null?4:this.hasError?3:this.tasks.size?1:this.ready?2:0}updateStatus(e){const r=this.status;e?.(),this.status=this._getStatus(),r!==this.status&&this.context.emit("internal/status",this,r)}ensure(e){const r=e().catch(n=>{this.context.emit(this.ctx,"internal/error",n),this.cancel(n)}).finally(()=>{this.updateStatus(()=>this.tasks.delete(r)),this.context.events._tasks.delete(r)});this.updateStatus(()=>this.tasks.add(r)),this.context.events._tasks.add(r)}cancel(e){this.error=e,this.updateStatus(()=>this.hasError=!0),this.reset()}get ready(){return Object.entries(this.runtime.inject).every(([e,r])=>!r.required||!Ne(this.ctx.get(e)))}reset(){this.isActive=!1,this.disposables=this.disposables.splice(0).filter(e=>{if(this.uid!==null&&e[ze.static]===this)return!0;(async()=>e())().catch(r=>{this.context.emit(this.ctx,"internal/error",r)})})}init(e){this.config?this.start():this.cancel(e)}start(){if(!this.ready||this.isActive||this.uid===null)return!0;this.isActive=!0,this.updateStatus(()=>this.hasError=!1)}accept(...e){const n={keys:Array.isArray(e[0])?e.shift():null,callback:e[0],...e[1]};return this.effect(()=>(this.acceptors.push(n),n.immediate&&n.callback?.(this.config),()=>Ot(this.acceptors,n)))}decline(e){return this.accept(e,()=>!0)}checkUpdate(e,r){if(r||!this.config)return[!0,!0];if(r===!1)return[!1,!1];const n=Object.create(null),i=oe(u=>{const l=n[u]??(n[u]=!pr(this.config[u],e[u]));return o||(o=l),l},"checkPropertyUpdate"),s=new Set;let o=!1,a=!1,c=this.runtime.isReactive||null;for(const{keys:u,callback:l,passive:f}of this.acceptors){if(!u)c||(c=!f);else if(f)u?.forEach(y=>s.add(y));else{let y=!1;for(const b of u)y||(y=i(b));if(!y)continue}l?.(e)&&(a=!0)}for(const u in{...this.config,...e})if(c!==!1&&!(u in n)&&!s.has(u)){const l=i(u);c===null&&(a||(a=l))}return[o,a]}},oe(Qr,"EffectScope"),Qr),td=(Xr=class extends Ca{constructor(r,n,i,s){super(r,i);Z(this,"dispose");this.runtime=n,this.dispose=He(r.scope.collect(`fork <${r.runtime.name}>`,()=>{this.uid=null,this.reset(),this.context.emit("internal/fork",this);const o=Ot(n.disposables,this.dispose);return Ot(n.children,this)&&!n.children.length&&r.registry.delete(n.plugin),o}),ze.static,n),n.children.push(this),n.disposables.push(this.dispose),this.context.emit("internal/fork",this),this.init(s)}start(){if(super.start())return!0;for(const r of this.runtime.forkables)this.ensure(async()=>r(this.context,this._config))}update(r,n){const i=this.config,s=this.runtime.isForkable?this:this.runtime;if(s.config!==i)return;let o;try{o=dn(this.runtime.plugin,r)}catch(u){return this.context.emit("internal/error",u),this.cancel(u)}const[a,c]=s.checkUpdate(o,n);this.context.emit("internal/before-update",this,r),this.config=o,s.config=o,a&&this.context.emit("internal/update",this,i),c&&s.restart()}},oe(Xr,"ForkScope"),Xr),ka=(Zr=class extends Ca{constructor(r,n,i,s){super(r,i);Z(this,"value");Z(this,"runtime",this);Z(this,"schema");Z(this,"name");Z(this,"inject",Object.create(null));Z(this,"forkables",[]);Z(this,"children",[]);Z(this,"isReusable",!1);Z(this,"isReactive",!1);Z(this,"apply",oe((r,n)=>{if(typeof this.plugin!="function")return this.plugin.apply(r,n);if(Es(this.plugin)){const i=new this.plugin(r,n),s=i[ze.expose];return s&&r.set(s,i),i.fork&&this.forkables.push(i.fork.bind(i)),i}else return this.plugin(r,n)},"apply"));this.plugin=n,n?(this.setup(),this.init(s)):(this.name="root",this.isActive=!0)}get isForkable(){return this.forkables.length>0}fork(r,n,i){return new td(r,this,n,i)}dispose(){return this.uid=null,this.reset(),this.context.emit("internal/runtime",this),!0}setup(){const{name:r}=this.plugin;r&&r!=="apply"&&(this.name=r),this.schema=this.plugin.Config||this.plugin.schema,this.inject=ot.resolve(this.plugin.using||this.plugin.inject),this.isReusable=this.plugin.reusable,this.isReactive=this.plugin.reactive,this.context.emit("internal/runtime",this),this.isReusable&&this.forkables.push(this.apply)}reset(){super.reset();for(const r of this.children)r.reset()}start(){if(super.start())return!0;!this.isReusable&&this.plugin&&this.ensure(async()=>this.value=this.apply(this.ctx,this._config));for(const r of this.children)r.start()}update(r,n){if(this.isForkable){const u=new Error(`attempting to update forkable plugin "${this.plugin.name}", which may lead to unexpected behavior`);this.context.emit(this.ctx,"internal/warning",u)}const i=this.config;let s;try{s=dn(this.runtime.plugin||this.context.constructor,r)}catch(u){return this.context.emit("internal/error",u),this.cancel(u)}const[o,a]=this.checkUpdate(s,n),c=this.children.find(u=>u.config===i);this.config=s,c&&(this.context.emit("internal/before-update",c,r),c.config=s,o&&this.context.emit("internal/update",c,i)),a&&this.restart()}},oe(Zr,"MainScope"),Zr);function $a(t){return t&&typeof t=="object"&&typeof t.apply=="function"}oe($a,"isApplicable");function ot(t){return function(e,r){if(r.kind==="class")e.inject=t;else if(r.kind==="method")r.addInitializer(function(){const n=this[Q.tracker]?.property;if(!n)throw new Error("missing context tracker");this[n].inject(t,i=>{e.call(hn(this,{[n]:i}))})});else throw new Error("@Inject can only be used on class or class methods")}}oe(ot,"Inject"),(t=>{function e(r){if(!r)return{};if(Array.isArray(r))return Object.fromEntries(r.map(o=>[o,{required:!0}]));const{required:n,optional:i,...s}=r;return Array.isArray(n)&&Object.assign(s,Object.fromEntries(n.map(o=>[o,{required:!0}]))),Array.isArray(i)&&Object.assign(s,Object.fromEntries(i.map(o=>[o,{required:!1}]))),s}t.resolve=e,oe(e,"resolve")})(ot||(ot={}));var rd=(en=class{constructor(e,r){Z(this,"_counter",0);Z(this,"_internal",new Map);Z(this,"context");this.ctx=e,He(this,Q.tracker,{associate:"registry",property:"ctx"}),this.context=e;const n=new ka(e,null,r);e.scope=n,n.ctx=e,this.set(null,n)}get counter(){return++this._counter}get size(){return this._internal.size}resolve(e,r=!1){if(e===null||typeof e=="function")return e;if($a(e))return e.apply;if(r)throw new Error('invalid plugin, expect function or object with an "apply" method, received '+typeof e)}get(e){const r=this.resolve(e);return r&&this._internal.get(r)}has(e){const r=this.resolve(e);return!!r&&this._internal.has(r)}set(e,r){const n=this.resolve(e);this._internal.set(n,r)}delete(e){const r=this.resolve(e),n=r&&this._internal.get(r);if(n)return this._internal.delete(r),n.dispose(),n}keys(){return this._internal.keys()}values(){return this._internal.values()}entries(){return this._internal.entries()}forEach(e){return this._internal.forEach(e)}using(e,r){return this.inject(e,r)}inject(e,r){return this.plugin({inject:e,apply:r,name:r.name})}plugin(e,r,n){if(this.resolve(e,!0),this.ctx.scope.assertActive(),!n)try{r=dn(e,r)}catch(s){this.context.emit(this.ctx,"internal/error",s),n=s,r=null}let i=this.get(e);return i?(i.isForkable||this.context.emit(this.ctx,"internal/warning",new Error(`duplicate plugin detected: ${e.name}`)),i.fork(this.ctx,r,n)):(i=new ka(this.ctx,e,r,n),this.set(e,i),i.fork(this.ctx,r,n))}},oe(en,"Registry"),en),nd=rd,ze=(Fe=class{static is(e){return!!e?.[Fe.is]}static associate(e,r){return e}constructor(e){e=dn(this.constructor,e),this[Q.store]=Object.create(null),this[Q.isolate]=Object.create(null),this[Q.internal]=Object.create(null),this[Q.intercept]=Object.create(null);const r=new Proxy(this,Is.handler);r.root=r,r.reflect=new Is(r),r.registry=new nd(r,e),r.lifecycle=new ed(r);const n=oe(i=>{if(i){n(Object.getPrototypeOf(i));for(const s of Object.getOwnPropertyNames(i)){const o=i[s].prototype?.constructor;o&&(r[i[s].key]=new o(r,e),He(r[i[s].key],"ctx",r))}}},"attach");return n(this[Q.internal]),r}[Symbol.for("nodejs.util.inspect.custom")](){return`Context <${this.name}>`}get name(){let e=this.runtime;for(;e&&!e.name;)e=e.parent.runtime;return e?.name}get events(){return this.lifecycle}get state(){return this.scope}extend(e={}){const r=Reflect.getOwnPropertyDescriptor(this,Q.shadow)?.value,n=Object.assign(Object.create(Ct(this,this)),e);return r?Object.assign(Object.create(n),{[Q.shadow]:r}):n}isolate(e,r){const n=Object.create(this[Q.isolate]);return n[e]=r??Symbol(e),this.extend({[Q.isolate]:n})}intercept(e,r){const n=Object.create(this[Q.intercept]);return n[e]=r,this.extend({[Q.intercept]:n})}},oe(Fe,"Context"),Z(Fe,"store",Q.store),Z(Fe,"events",Q.events),Z(Fe,"static",Q.static),Z(Fe,"filter",Q.filter),Z(Fe,"expose",Q.expose),Z(Fe,"isolate",Q.isolate),Z(Fe,"internal",Q.internal),Z(Fe,"intercept",Q.intercept),Z(Fe,"origin","ctx"),Z(Fe,"current","ctx"),Fe.is[Symbol.toPrimitive]=()=>Symbol.for("cordis.is"),Fe.prototype[Fe.is]=!0,Fe);ze.prototype[ze.internal]=Object.create(null);var Ir=(ht=class{constructor(...e){Z(this,"ctx");Z(this,"name");Z(this,"config");let r,n,i,s;ze.is(e[0])?(r=e[0],typeof e[1]=="string"?(n=e[1],i=e[2]):s=e[1]):s=e[0],n??(n=this.constructor[Q.provide]),i??(i=this.constructor[Q.immediate]);let o=this;const a={associate:n,property:"ctx"};return o[Q.invoke]&&(o=$s(n,Os(Object.getPrototypeOf(this),Function.prototype),a)),r?o.ctx=r:o[Q.setup](),o.name=n,o.config=s,He(o,Q.tracker,a),o.ctx.provide(n),o.ctx.runtime.name=n,i&&(r?o[Q.expose]=n:o.ctx.set(n,o)),o.ctx.on("ready",async()=>{await Promise.resolve(),await o.start(),i||o.ctx.set(n,o)}),o.ctx.on("dispose",()=>o.stop()),o}start(){}stop(){}[Q.filter](e){return e[Q.isolate][this.name]===this.ctx[Q.isolate][this.name]}[Q.setup](){this.ctx=new ze}[Q.extend](e){let r;return this[ht.invoke]?r=$s(this.name,this,this[Q.tracker]):r=Object.create(this),Object.assign(r,e)}static[Symbol.hasInstance](e){let r=e.constructor;for(;r;){if(r=r.prototype?.constructor,r===this)return!0;r=Object.getPrototypeOf(r)}return!1}},oe(ht,"Service"),Z(ht,"setup",Q.setup),Z(ht,"invoke",Q.invoke),Z(ht,"extend",Q.extend),Z(ht,"tracker",Q.tracker),Z(ht,"provide",Q.provide),Z(ht,"immediate",Q.immediate),ht),Ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ia(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function id(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Rs,Aa;function sd(){if(Aa)return Rs;Aa=1;function t(){const r=/(Chrome|Chromium)\/(?<chromeVersion>\d+)\./.exec(navigator.userAgent);if(r)return Number.parseInt(r.groups.chromeVersion,10)}const e=t()>=69?{level:1,hasBasic:!0,has256:!1,has16m:!1}:!1;return Rs={stdout:e,stderr:e},Rs}var Ta=sd();const od=id(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ns,Ra;function ad(){if(Ra)return Ns;Ra=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=t&&e&&typeof e.get=="function"?e.get:null,n=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&s&&typeof s.get=="function"?s.get:null,a=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,u=c?WeakMap.prototype.has:null,l=typeof WeakSet=="function"&&WeakSet.prototype,f=l?WeakSet.prototype.has:null,v=typeof WeakRef=="function"&&WeakRef.prototype,y=v?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,T=Object.prototype.toString,H=Function.prototype.toString,B=String.prototype.match,R=String.prototype.slice,m=String.prototype.replace,p=String.prototype.toUpperCase,h=String.prototype.toLowerCase,P=RegExp.prototype.test,I=Array.prototype.concat,N=Array.prototype.join,J=Array.prototype.slice,re=Math.floor,$e=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Le=Object.getOwnPropertySymbols,Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",pt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qe||!0)?Symbol.toStringTag:null,Re=Object.prototype.propertyIsEnumerable,ve=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(k){return k.__proto__}:null);function _e(k,A){if(k===1/0||k===-1/0||k!==k||k&&k>-1e3&&k<1e3||P.call(/e/,A))return A;var de=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof k=="number"){var Pe=k<0?-re(-k):re(k);if(Pe!==k){var ge=String(Pe),le=R.call(A,ge.length+1);return m.call(ge,de,"$&_")+"."+m.call(m.call(le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(A,de,"$&_")}var mt=od,Xt=mt.custom,Be=D(Xt)?Xt:null,Xe={__proto__:null,double:'"',single:"'"},an={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Ns=function k(A,de,Pe,ge){var le=de||{};if(M(le,"quoteStyle")&&!M(Xe,le.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(M(le,"maxStringLength")&&(typeof le.maxStringLength=="number"?le.maxStringLength<0&&le.maxStringLength!==1/0:le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ut=M(le,"customInspect")?le.customInspect:!0;if(typeof Ut!="boolean"&&Ut!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(M(le,"indent")&&le.indent!==null&&le.indent!==" "&&!(parseInt(le.indent,10)===le.indent&&le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(M(le,"numericSeparator")&&typeof le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Wt=le.numericSeparator;if(typeof A>"u")return"undefined";if(A===null)return"null";if(typeof A=="boolean")return A?"true":"false";if(typeof A=="string")return we(A,le);if(typeof A=="number"){if(A===0)return 1/0/A>0?"0":"-0";var st=String(A);return Wt?_e(A,st):st}if(typeof A=="bigint"){var qt=String(A)+"n";return Wt?_e(A,qt):qt}var Hn=typeof le.depth>"u"?5:le.depth;if(typeof Pe>"u"&&(Pe=0),Pe>=Hn&&Hn>0&&typeof A=="object")return jt(A)?"[Array]":"[Object]";var fr=Ft(le,Pe);if(typeof ge>"u")ge=[];else if(V(ge,A)>=0)return"[Circular]";function gt(dr,ln,ha){if(ln&&(ge=J.call(ge),ge.push(ln)),ha){var bs={depth:le.depth};return M(le,"quoteStyle")&&(bs.quoteStyle=le.quoteStyle),k(dr,bs,Pe+1,ge)}return k(dr,le,Pe+1,ge)}if(typeof A=="function"&&!Cr(A)){var ds=Y(A),hs=Ue(A,gt);return"[Function"+(ds?": "+ds:" (anonymous)")+"]"+(hs.length>0?" { "+N.call(hs,", ")+" }":"")}if(D(A)){var ps=Qe?m.call(String(A),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ke.call(A);return typeof A=="object"&&!Qe?Ae(ps):ps}if(ue(A)){for(var kr="<"+h.call(String(A.nodeName)),zn=A.attributes||[],$r=0;$r<zn.length;$r++)kr+=" "+zn[$r].name+"="+cn(qn(zn[$r].value),"double",le);return kr+=">",A.childNodes&&A.childNodes.length&&(kr+="..."),kr+="</"+h.call(String(A.nodeName))+">",kr}if(jt(A)){if(A.length===0)return"[]";var Vn=Ue(A,gt);return fr&&!it(Vn)?"["+Bt(Vn,fr)+"]":"[ "+N.call(Vn,", ")+" ]"}if(Zt(A)){var Kn=Ue(A,gt);return!("cause"in Error.prototype)&&"cause"in A&&!Re.call(A,"cause")?"{ ["+String(A)+"] "+N.call(I.call("[cause]: "+gt(A.cause),Kn),", ")+" }":Kn.length===0?"["+String(A)+"]":"{ ["+String(A)+"] "+N.call(Kn,", ")+" }"}if(typeof A=="object"&&Ut){if(Be&&typeof A[Be]=="function"&&mt)return mt(A,{depth:Hn-Pe});if(Ut!=="symbol"&&typeof A.inspect=="function")return A.inspect()}if(U(A)){var ms=[];return n&&n.call(A,function(dr,ln){ms.push(gt(ln,A,!0)+" => "+gt(dr,A))}),Ze("Map",r.call(A),ms,fr)}if(te(A)){var gs=[];return a&&a.call(A,function(dr){gs.push(gt(dr,A))}),Ze("Set",o.call(A),gs,fr)}if(ne(A))return Me("WeakMap");if(ie(A))return Me("WeakSet");if(X(A))return Me("WeakRef");if(_(A))return Ae(gt(Number(A)));if(j(A))return Ae(gt($e.call(A)));if(S(A))return Ae(b.call(A));if(fs(A))return Ae(gt(String(A)));if(typeof window<"u"&&A===window)return"{ [object Window] }";if(typeof globalThis<"u"&&A===globalThis||typeof Ar<"u"&&A===Ar)return"{ [object globalThis] }";if(!Pr(A)&&!Cr(A)){var Jn=Ue(A,gt),ys=ve?ve(A)===Object.prototype:A instanceof Object||A.constructor===Object,Yn=A instanceof Object?"":"null prototype",vs=!ys&&pt&&Object(A)===A&&pt in A?R.call(K(A),8,-1):Yn?"Object":"",da=ys||typeof A.constructor!="function"?"":A.constructor.name?A.constructor.name+" ":"",Gn=da+(vs||Yn?"["+N.call(I.call([],vs||[],Yn||[]),": ")+"] ":"");return Jn.length===0?Gn+"{}":fr?Gn+"{"+Bt(Jn,fr)+"}":Gn+"{ "+N.call(Jn,", ")+" }"}return String(A)};function cn(k,A,de){var Pe=de.quoteStyle||A,ge=Xe[Pe];return ge+k+ge}function qn(k){return m.call(String(k),/"/g,"&quot;")}function nt(k){return!pt||!(typeof k=="object"&&(pt in k||typeof k[pt]<"u"))}function jt(k){return K(k)==="[object Array]"&&nt(k)}function Pr(k){return K(k)==="[object Date]"&&nt(k)}function Cr(k){return K(k)==="[object RegExp]"&&nt(k)}function Zt(k){return K(k)==="[object Error]"&&nt(k)}function fs(k){return K(k)==="[object String]"&&nt(k)}function _(k){return K(k)==="[object Number]"&&nt(k)}function S(k){return K(k)==="[object Boolean]"&&nt(k)}function D(k){if(Qe)return k&&typeof k=="object"&&k instanceof Symbol;if(typeof k=="symbol")return!0;if(!k||typeof k!="object"||!Ke)return!1;try{return Ke.call(k),!0}catch{}return!1}function j(k){if(!k||typeof k!="object"||!$e)return!1;try{return $e.call(k),!0}catch{}return!1}var F=Object.prototype.hasOwnProperty||function(k){return k in this};function M(k,A){return F.call(k,A)}function K(k){return T.call(k)}function Y(k){if(k.name)return k.name;var A=B.call(H.call(k),/^function\s*([\w$]+)/);return A?A[1]:null}function V(k,A){if(k.indexOf)return k.indexOf(A);for(var de=0,Pe=k.length;de<Pe;de++)if(k[de]===A)return de;return-1}function U(k){if(!r||!k||typeof k!="object")return!1;try{r.call(k);try{o.call(k)}catch{return!0}return k instanceof Map}catch{}return!1}function ne(k){if(!u||!k||typeof k!="object")return!1;try{u.call(k,u);try{f.call(k,f)}catch{return!0}return k instanceof WeakMap}catch{}return!1}function X(k){if(!y||!k||typeof k!="object")return!1;try{return y.call(k),!0}catch{}return!1}function te(k){if(!o||!k||typeof k!="object")return!1;try{o.call(k);try{r.call(k)}catch{return!0}return k instanceof Set}catch{}return!1}function ie(k){if(!f||!k||typeof k!="object")return!1;try{f.call(k,f);try{u.call(k,u)}catch{return!0}return k instanceof WeakSet}catch{}return!1}function ue(k){return!k||typeof k!="object"?!1:typeof HTMLElement<"u"&&k instanceof HTMLElement?!0:typeof k.nodeName=="string"&&typeof k.getAttribute=="function"}function we(k,A){if(k.length>A.maxStringLength){var de=k.length-A.maxStringLength,Pe="... "+de+" more character"+(de>1?"s":"");return we(R.call(k,0,A.maxStringLength),A)+Pe}var ge=an[A.quoteStyle||"single"];ge.lastIndex=0;var le=m.call(m.call(k,ge,"\\$1"),/[\x00-\x1f]/g,me);return cn(le,"single",A)}function me(k){var A=k.charCodeAt(0),de={8:"b",9:"t",10:"n",12:"f",13:"r"}[A];return de?"\\"+de:"\\x"+(A<16?"0":"")+p.call(A.toString(16))}function Ae(k){return"Object("+k+")"}function Me(k){return k+" { ? }"}function Ze(k,A,de,Pe){var ge=Pe?Bt(de,Pe):N.call(de,", ");return k+" ("+A+") {"+ge+"}"}function it(k){for(var A=0;A<k.length;A++)if(V(k[A],`
4
+ `)>=0)return!1;return!0}function Ft(k,A){var de;if(k.indent===" ")de=" ";else if(typeof k.indent=="number"&&k.indent>0)de=N.call(Array(k.indent+1)," ");else return null;return{base:de,prev:N.call(Array(A+1),de)}}function Bt(k,A){if(k.length===0)return"";var de=`
5
+ `+A.prev+A.base;return de+N.call(k,","+de)+`
6
+ `+A.prev}function Ue(k,A){var de=jt(k),Pe=[];if(de){Pe.length=k.length;for(var ge=0;ge<k.length;ge++)Pe[ge]=M(k,ge)?A(k[ge],k):""}var le=typeof Le=="function"?Le(k):[],Ut;if(Qe){Ut={};for(var Wt=0;Wt<le.length;Wt++)Ut["$"+le[Wt]]=le[Wt]}for(var st in k)M(k,st)&&(de&&String(Number(st))===st&&st<k.length||Qe&&Ut["$"+st]instanceof Symbol||(P.call(/[^\w$]/,st)?Pe.push(A(st,k)+": "+A(k[st],k)):Pe.push(st+": "+A(k[st],k))));if(typeof Le=="function")for(var qt=0;qt<le.length;qt++)Re.call(k,le[qt])&&Pe.push("["+A(le[qt])+"]: "+A(k[le[qt]],k));return Pe}return Ns}var cd=ad();const ld=Ia(cd);var ud=Object.create,Ds=Object.defineProperty,fd=Object.getOwnPropertyDescriptor,Na=Object.getOwnPropertyNames,dd=Object.getPrototypeOf,hd=Object.prototype.hasOwnProperty,ii=(t,e)=>Ds(t,"name",{value:e,configurable:!0}),Da=(t,e)=>function(){return e||(0,t[Na(t)[0]])((e={exports:{}}).exports,e),e.exports},pd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Na(e))!hd.call(t,i)&&i!==r&&Ds(t,i,{get:()=>e[i],enumerable:!(n=fd(e,i))||n.enumerable});return t},md=(t,e,r)=>(r=t!=null?ud(dd(t)):{},pd(!t||!t.__esModule?Ds(r,"default",{value:t,enumerable:!0}):r,t)),gd=Da({"src/shared.ts"(t,e){var o;var r=[6,2,3,4,5,1],n=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221];function i(a){return a instanceof Error&&Array.isArray(a.errors)}ii(i,"isAggregateError");var s=(o=class{constructor(c,u){Z(this,"extend",ii(c=>new o(`${this.name}:${c}`,this.meta),"extend"));Z(this,"warning",ii((c,...u)=>{this.warn(c,...u)},"warning"));this.name=c,this.meta=u,this.createMethod("success",o.SUCCESS),this.createMethod("error",o.ERROR),this.createMethod("info",o.INFO),this.createMethod("warn",o.WARN),this.createMethod("debug",o.DEBUG)}static format(c,u){this.formatters[c]=u}static color(c,u,l,f=""){return c.colors?`\x1B[3${u<8?u:"8;5;"+u}${c.colors>=2?f:""}m${l}\x1B[0m`:""+l}static code(c,u){let l=0;for(let v=0;v<c.length;v++)l=(l<<3)-l+c.charCodeAt(v)+13,l|=0;const f=u.colors?u.colors>=2?n:r:[];return f[Math.abs(l)%f.length]}static render(c,u){const l=`[${u.type[0].toUpperCase()}]`,f=" ".repeat(c.label?.margin??1);let v=3+f.length,y="";c.showTime&&(v+=c.showTime.length+f.length,y+=o.color(c,8,ti.template(c.showTime))+f);const b=o.code(u.name,c),T=o.color(c,b,u.name,";1"),H=(c.label?.width??0)+T.length-u.name.length;if(c.label?.align==="right"?(y+=T.padStart(H)+f+l+f,v+=(c.label.width??0)+f.length):y+=l+f+T.padEnd(H)+f,y+=u.content.replace(/\n/g,`
7
+ `+" ".repeat(v)),c.showDiff&&c.timestamp){const B=u.timestamp-c.timestamp;y+=o.color(c,b," +"+ti.format(B))}return y}createMethod(c,u){this[c]=(...l)=>{if(l.length===1&&l[0]instanceof Error){if(l[0].cause)this[c](l[0].cause);else if(i(l[0])){l[0].errors.forEach(y=>this[c](y));return}}const f=++o.id,v=Date.now();for(const y of o.targets){if(this.getLevel(y)<u)continue;const b=this.format(y,...l),T={id:f,type:c,level:u,name:this.name,meta:this.meta,content:b,timestamp:v};if(y.record)y.record(T);else{const{print:H=console.log}=y;H(o.render(y,T))}y.timestamp=v}}}format(c,...u){u[0]instanceof Error?(u[0]=u[0].stack||u[0].message,u.unshift("%s")):typeof u[0]!="string"&&u.unshift("%o");let l=u.shift();l=l.replace(/%([a-zA-Z%])/g,(v,y)=>{if(v==="%%")return"%";const b=o.formatters[y];if(typeof b=="function"){const T=u.shift();return b(T,c,this)}return v});for(let v of u)typeof v=="object"&&v&&(v=o.formatters.o(v,c,this)),l+=" "+v;const{maxLength:f=10240}=c;return l.split(/\r?\n/g).map(v=>v.slice(0,f)+(v.length>f?"...":"")).join(`
8
+ `)}getLevel(c){const u=this.name.split(":");let l=c?.levels||o.levels;do l=l[u.shift()]??l.base;while(u.length&&typeof l=="object");return l}get level(){return this.getLevel()}set level(c){const u=this.name.split(":");let l=o.levels;for(;u.length>1;){const f=u.shift(),v=l[f];typeof v=="object"?l=v:l=l[f]={base:v??l.base}}l[u[0]]=c}},ii(o,"Logger"),Z(o,"SILENT",0),Z(o,"SUCCESS",1),Z(o,"ERROR",1),Z(o,"INFO",2),Z(o,"WARN",2),Z(o,"DEBUG",3),Z(o,"id",0),Z(o,"targets",[{colors:Ta.stdout&&Ta.stdout.level,print(c){console.log(c)}}]),Z(o,"formatters",Object.create(null)),Z(o,"levels",{base:2}),o);s.format("s",a=>a),s.format("d",a=>+a),s.format("j",a=>JSON.stringify(a)),s.format("c",(a,c,u)=>s.color(c,s.code(u.name,c),a)),s.format("C",(a,c)=>s.color(c,15,a,";1")),e.exports=s}}),yd=Da({"src/browser.ts"(t,e){var r=md(gd());r.default.format("o",(n,i)=>ld(n,{depth:1/0}).replace(/\s*\n\s*/g," ")),e.exports=r.default}});const vd=yd();var bd=Object.defineProperty,_d=(t,e)=>bd(t,"name",{value:e,configurable:!0}),wd=(Or=class extends Ir{constructor(e){super(e,"logger",!0),e.on("internal/info",function(r,...n){this.logger("app").info(r,...n)}),e.on("internal/error",function(r,...n){this.logger("app").error(r,...n)}),e.on("internal/warning",function(r,...n){this.logger("app").warn(r,...n)})}[Ir.invoke](e){return new vd(e,He({},"ctx",this.ctx))}},_d(Or,"LoggerService"),(()=>{for(const e of["success","error","info","warn","debug","extend"])Or.prototype[e]=function(...r){return this(this.ctx.name)[e](...r)}})(),Or),xd=Object.defineProperty,Sd=Object.getOwnPropertyNames,pe=(t,e)=>xd(t,"name",{value:e,configurable:!0}),Ed=(t,e)=>function(){return e||(0,t[Sd(t)[0]])((e={exports:{}}).exports,e),e.exports},Od=Ed({"src/index.ts"(t,e){var R;var r=Symbol.for("schemastery"),n=Symbol.for("ValidationError");globalThis.__schemastery_index__??(globalThis.__schemastery_index__=0);var i=(R=class extends TypeError{constructor(h,P){let I="$";for(const N of P.path||[])typeof N=="string"?I+="."+N:typeof N=="number"?I+="["+N+"]":typeof N=="symbol"&&(I+=`[Symbol(${N.toString()})]`);I.startsWith(".")&&(I=I.slice(1));super((I==="$"?"":`${I} `)+h);Z(this,"name","ValidationError");this.options=P}static is(h){return!!h?.[n]}},pe(R,"ValidationError"),R);Object.defineProperty(i.prototype,n,{value:!0});var s=pe(function(m){const p=pe(function(h,P={}){return s.resolve(h,p,P)[0]},"schema");if(m.refs){const h=Ht(m.refs,I=>new s(I)),P=pe(I=>h[I],"getRef");for(const I in h){const N=h[I];N.sKey=P(N.sKey),N.inner=P(N.inner),N.list=N.list&&N.list.map(P),N.dict=N.dict&&Ht(N.dict,P)}return h[m.uid]}if(Object.assign(p,m),typeof p.callback=="string")try{p.callback=new Function("return "+p.callback)()}catch{}return Object.defineProperty(p,"uid",{value:globalThis.__schemastery_index__++}),Object.setPrototypeOf(p,s.prototype),p.meta||(p.meta={}),p.toString=p.toString.bind(p),p},"Schema");s.prototype=Object.create(Function.prototype),s.prototype[r]=!0,s.ValidationError=i;var o;s.prototype.toJSON=pe(function(){var h;if(o)return o[h=this.uid]??(o[h]=JSON.parse(JSON.stringify({...this}))),this.uid;o={[this.uid]:{...this}},o[this.uid]=JSON.parse(JSON.stringify({...this}));const p={uid:this.uid,refs:o};return o=void 0,p},"toJSON"),s.prototype.set=pe(function(p,h){return this.dict[p]=h,this},"set"),s.prototype.push=pe(function(p){return this.list.push(p),this},"push");function a(m,p){const h=typeof m=="string"?{"":m}:{...m};for(const P in p){const I=p[P];I?.$description||I?.$desc?h[P]=I.$description||I.$desc:typeof I=="string"&&(h[P]=I)}return h}pe(a,"mergeDesc");function c(m){return m?.$value??m?.$inner}pe(c,"getInner");function u(m){return _a(m??{},p=>!p.startsWith("$"))}pe(u,"extractKeys"),s.prototype.i18n=pe(function(p){const h=s(this),P=a(h.meta.description,p);return Object.keys(P).length&&(h.meta.description=P),h.dict&&(h.dict=Ht(h.dict,(I,N)=>I.i18n(Ht(p,J=>c(J)?.[N]??J?.[N])))),h.list&&(h.list=h.list.map((I,N)=>I.i18n(Ht(p,(J={})=>Array.isArray(c(J))?c(J)[N]:Array.isArray(J)?J[N]:u(J))))),h.inner&&(h.inner=h.inner.i18n(Ht(p,I=>c(I)?c(I):u(I)))),h.sKey&&(h.sKey=h.sKey.i18n(Ht(p,I=>I?.$key))),h},"i18n"),s.prototype.extra=pe(function(p,h){const P=s(this);return P.meta={...P.meta,[p]:h},P},"extra");for(const m of["required","disabled","collapse","hidden","loose"])Object.assign(s.prototype,{[m](p=!0){const h=s(this);return h.meta={...h.meta,[m]:p},h}});s.prototype.deprecated=pe(function(){var h;const p=s(this);return(h=p.meta).badges||(h.badges=[]),p.meta.badges.push({text:"deprecated",type:"danger"}),p},"deprecated"),s.prototype.experimental=pe(function(){var h;const p=s(this);return(h=p.meta).badges||(h.badges=[]),p.meta.badges.push({text:"experimental",type:"warning"}),p},"experimental"),s.prototype.pattern=pe(function(p){const h=s(this),P=wa(p,["source","flags"]);return h.meta={...h.meta,pattern:P},h},"pattern"),s.prototype.simplify=pe(function(p){if(pr(p,this.meta.default,this.type==="dict"))return null;if(Ne(p))return p;if(this.type==="object"||this.type==="dict"){const h={};for(const P in p){const N=(this.type==="object"?this.dict[P]:this.inner)?.simplify(p[P]);(this.type==="dict"||!Ne(N))&&(h[P]=N)}return pr(h,this.meta.default,this.type==="dict")?null:h}else if(this.type==="array"||this.type==="tuple"){const h=[];return p.forEach((P,I)=>{const N=this.type==="array"?this.inner:this.list[I],J=N?N.simplify(P):P;h.push(J)}),h}else if(this.type==="intersect"){const h={};for(const P of this.list)Object.assign(h,P.simplify(p));return h}else if(this.type==="union")for(const h of this.list)try{return s.resolve(p,h,{}),h.simplify(p)}catch{}return p},"simplify"),s.prototype.toString=pe(function(p){return H[this.type]?.(this,p)??`Schema<${this.type}>`},"toString"),s.prototype.role=pe(function(m,p){const h=s(this);return h.meta={...h.meta,role:m,extra:p},h},"role");for(const m of["default","link","comment","description","max","min","step"])Object.assign(s.prototype,{[m](p){const h=s(this);return h.meta={...h.meta,[m]:p},h}});var l={};s.extend=pe(function(p,h){l[p]=h},"extend"),s.resolve=pe(function(p,h,P={},I=!1){if(!h)return[p];if(P.ignore?.(p,h))return[p];if(Ne(p)&&h.type!=="lazy"){if(h.meta.required)throw new i("missing required value",P);let J=h,re=h.meta.default;for(;J?.type==="intersect"&&Ne(re);)J=J.list[0],re=J?.meta.default;if(Ne(re))return[p];p=ei(re)}const N=l[h.type];if(!N)throw new i(`unsupported type "${h.type}"`,P);try{return N(p,h,P,I)}catch(J){if(!h.meta.loose)throw J;return[h.meta.default]}},"resolve"),s.from=pe(function(p){if(Ne(p))return s.any();if(["string","number","boolean"].includes(typeof p))return s.const(p).required();if(p[r])return p;if(typeof p=="function")switch(p){case String:return s.string().required();case Number:return s.number().required();case Boolean:return s.boolean().required();case Function:return s.function().required();default:return s.is(p).required()}else throw new TypeError(`cannot infer schema from ${p}`)},"from"),s.lazy=pe(function(p){const h=pe(()=>(P.inner[r]||(P.inner=P.builder(),P.inner.meta={...P.meta,...P.inner.meta}),P.inner.toJSON()),"toJSON"),P=new s({type:"lazy",builder:p,inner:{toJSON:h}});return P},"lazy"),s.natural=pe(function(){return s.number().step(1).min(0)},"natural"),s.percent=pe(function(){return s.number().step(.01).min(0).max(1).role("slider")},"percent"),s.date=pe(function(){return s.union([s.is(Date),s.transform(s.string().role("datetime"),(p,h)=>{const P=new Date(p);if(isNaN(+P))throw new i(`invalid date "${p}"`,h);return P},!0)])},"date"),s.regExp=pe(function(p=""){return s.union([s.is(RegExp),s.transform(s.string().role("regexp",{flag:p}),(h,P)=>{try{return new RegExp(h,p)}catch(I){throw new i(I.message,P)}},!0)])},"regExp"),s.arrayBuffer=pe(function(p){return s.union([s.is(ArrayBuffer),s.is(SharedArrayBuffer),s.transform(s.any(),(h,P)=>{if(Pt.isSource(h))return Pt.fromSource(h);throw new i(`expected ArrayBufferSource but got ${h}`,P)},!0),...p?[s.transform(s.string(),(h,P)=>{try{return p==="base64"?Pt.fromBase64(h):Pt.fromHex(h)}catch(I){throw new i(I.message,P)}},!0)]:[]])},"arrayBuffer"),s.extend("lazy",(m,p,h,P)=>(p.inner[r]||(p.inner=p.builder(),p.inner.meta={...p.meta,...p.inner.meta}),s.resolve(m,p.inner,h,P))),s.extend("any",m=>[m]),s.extend("never",(m,p,h)=>{throw new i(`expected nullable but got ${m}`,h)}),s.extend("const",(m,{value:p},h)=>{if(pr(m,p))return[p];throw new i(`expected ${p} but got ${m}`,h)});function f(m,p,h,P,I=!1){const{max:N=1/0,min:J=-1/0}=p;if(m>N)throw new i(`expected ${h} <= ${N} but got ${m}`,P);if(m<J&&!I)throw new i(`expected ${h} >= ${J} but got ${m}`,P)}pe(f,"checkWithinRange"),s.extend("string",(m,{meta:p},h)=>{if(typeof m!="string")throw new i(`expected string but got ${m}`,h);if(p.pattern){const P=new RegExp(p.pattern.source,p.pattern.flags);if(!P.test(m))throw new i(`expect string to match regexp ${P}`,h)}return f(m.length,p,"string length",h),[m]});function v(m,p){const h=m.toString();if(h.includes("e"))return m*Math.pow(10,p);const P=h.indexOf(".");if(P===-1)return m*Math.pow(10,p);const I=h.slice(P+1),N=h.slice(0,P);return I.length<=p?+(N+I.padEnd(p,"0")):+(N+I.slice(0,p)+"."+I.slice(p))}pe(v,"decimalShift");function y(m,p,h){if(h=Math.abs(h),!/^\d+\.\d+$/.test(h.toString()))return(m-p)%h===0;const P=h.toString().indexOf("."),I=h.toString().slice(P+1).length;return Math.abs(v(m,I)-v(p,I))%v(h,I)===0}pe(y,"isMultipleOf"),s.extend("number",(m,{meta:p},h)=>{if(typeof m!="number")throw new i(`expected number but got ${m}`,h);f(m,p,"number",h);const{step:P}=p;if(P&&!y(m,p.min??0,P))throw new i(`expected number multiple of ${P} but got ${m}`,h);return[m]}),s.extend("boolean",(m,p,h)=>{if(typeof m=="boolean")return[m];throw new i(`expected boolean but got ${m}`,h)}),s.extend("bitset",(m,{bits:p,meta:h},P)=>{let I=0,N=[];if(typeof m=="number"){I=m;for(const J in p)m&p[J]&&N.push(J)}else if(Array.isArray(m)){N=m;for(const J of N){if(typeof J!="string")throw new i(`expected string but got ${J}`,P);J in p&&(I|=p[J])}}else throw new i(`expected number or array but got ${m}`,P);return I===h.default?[I]:[I,N]}),s.extend("function",(m,p,h)=>{if(typeof m=="function")return[m];throw new i(`expected function but got ${m}`,h)}),s.extend("is",(m,{constructor:p},h)=>{if(typeof p=="function"){if(m instanceof p)return[m];throw new i(`expected ${p.name} but got ${m}`,h)}else{if(Ne(m))throw new i(`expected ${p} but got ${m}`,h);let P=Object.getPrototypeOf(m);for(;P;){if(P.constructor?.name===p)return[m];P=Object.getPrototypeOf(P)}throw new i(`expected ${p} but got ${m}`,h)}});function b(m,p,h,P){try{const[I,N]=s.resolve(m[p],h,{...P,path:[...P.path||[],p]});return N!==void 0&&(m[p]=N),I}catch(I){if(!P?.autofix)throw I;return delete m[p],h.meta.default}}pe(b,"property"),s.extend("array",(m,{inner:p,meta:h},P)=>{if(!Array.isArray(m))throw new i(`expected array but got ${m}`,P);return f(m.length,h,"array length",P,!Ne(p.meta.default)),[m.map((I,N)=>b(m,N,p,P))]}),s.extend("dict",(m,{inner:p,sKey:h},P,I)=>{if(!Zn(m))throw new i(`expected object but got ${m}`,P);const N={};for(const J in m){let re;try{re=s.resolve(J,h,P)[0]}catch($e){if(I)continue;throw $e}N[re]=b(m,J,p,P),m[re]=m[J],J!==re&&delete m[J]}return[N]}),s.extend("tuple",(m,{list:p},h,P)=>{if(!Array.isArray(m))throw new i(`expected array but got ${m}`,h);const I=p.map((N,J)=>b(m,J,N,h));return P?[I]:(I.push(...m.slice(p.length)),[I])});function T(m,p){for(const h in p)h in m||(m[h]=p[h])}pe(T,"merge"),s.extend("object",(m,{dict:p},h,P)=>{if(!Zn(m))throw new i(`expected object but got ${m}`,h);const I={};for(const N in p){const J=b(m,N,p[N],h);(!Ne(J)||N in m)&&(I[N]=J)}return P||T(I,m),[I]}),s.extend("union",(m,{list:p,toString:h},P,I)=>{for(const N of p)try{return s.resolve(m,N,P,I)}catch{}throw new i(`expected ${h()} but got ${JSON.stringify(m)}`,P)}),s.extend("intersect",(m,{list:p,toString:h},P,I)=>{let N;for(const J of p){const re=s.resolve(m,J,P,!0)[0];if(!Ne(re))if(Ne(N))N=re;else{if(typeof N!=typeof re)throw new i(`expected ${h()} but got ${JSON.stringify(m)}`,P);if(typeof re=="object")T(N??(N={}),re);else if(N!==re)throw new i(`expected ${h()} but got ${JSON.stringify(m)}`,P)}}return!I&&Zn(m)&&T(N,m),[N]}),s.extend("transform",(m,{inner:p,callback:h,preserve:P},I)=>{const[N,J=m]=s.resolve(m,p,I,!0);return P?[h(N)]:[h(N),h(J)]});var H={};function B(m,p,h){H[m]=h,Object.assign(s,{[m](...P){const I=new s({type:m});return p.forEach((N,J)=>{switch(N){case"sKey":I.sKey=P[J]??s.string();break;case"inner":I.inner=s.from(P[J]);break;case"list":I.list=P[J].map(s.from);break;case"dict":I.dict=Ht(P[J],s.from);break;case"bits":{I.bits={};for(const re in P[J])typeof P[J][re]=="number"&&(I.bits[re]=P[J][re]);break}case"callback":{const re=I.callback=P[J];re.toJSON||(re.toJSON=()=>re.toString());break}case"constructor":{const re=I.constructor=P[J];typeof re=="function"&&(re.toJSON||(re.toJSON=()=>re.name));break}default:I[N]=P[J]}}),m==="object"||m==="dict"?I.meta.default={}:m==="array"||m==="tuple"?I.meta.default=[]:m==="bitset"&&(I.meta.default=0),I}})}pe(B,"defineMethod"),B("is",["constructor"],({constructor:m})=>typeof m=="function"?m.name:m),B("any",[],()=>"any"),B("never",[],()=>"never"),B("const",["value"],({value:m})=>typeof m=="string"?JSON.stringify(m):m),B("string",[],()=>"string"),B("number",[],()=>"number"),B("boolean",[],()=>"boolean"),B("bitset",["bits"],()=>"bitset"),B("function",[],()=>"function"),B("array",["inner"],({inner:m})=>`${m.toString(!0)}[]`),B("dict",["inner","sKey"],({inner:m,sKey:p})=>`{ [key: ${p.toString()}]: ${m.toString()} }`),B("tuple",["list"],({list:m})=>`[${m.map(p=>p.toString()).join(", ")}]`),B("object",["dict"],({dict:m})=>Object.keys(m).length===0?"{}":`{ ${Object.entries(m).map(([p,h])=>`${p}${h.meta.required?"":"?"}: ${h.toString()}`).join(", ")} }`),B("union",["list"],({list:m},p)=>{const h=m.map(({toString:P})=>P()).join(" | ");return p?`(${h})`:h}),B("intersect",["list"],({list:m})=>`${m.map(p=>p.toString(!0)).join(" & ")}`),B("transform",["inner","callback","preserve"],({inner:m},p)=>m.toString(p)),e.exports=s}});const ke=Od();var Pd=Object.defineProperty,Cd=(t,e)=>Pd(t,"name",{value:e,configurable:!0}),La=Symbol("cordis.schema.order"),kd=(tn=class{constructor(e){Z(this,"_data",ke.intersect([]));this.ctx=e,He(this,Ir.tracker,{property:"ctx"})}extend(e,r=0){const n=this._data.list.findIndex(i=>i[La]<r);return e[La]=r,this.ctx.effect(()=>(n>=0?this._data.list.splice(n,0,e):this._data.list.push(e),this.ctx.emit("internal/service-schema"),()=>{Ot(this._data.list,e),this.ctx.emit("internal/service-schema")}))}toJSON(){return this._data.toJSON()}},Cd(tn,"SchemaService"),tn),$d=Object.defineProperty,si=(t,e)=>$d(t,"name",{value:e,configurable:!0}),Id=(rn=class extends Ir{constructor(e){super(e,"timer",!0),e.mixin("timer",["setTimeout","setInterval","sleep","throttle","debounce"])}setTimeout(e,r){const n=this[ze.current].effect(()=>{const i=setTimeout(()=>{n(),e()},r);return()=>clearTimeout(i)});return n}setInterval(e,r){return this[ze.current].effect(()=>{const n=setInterval(e,r);return()=>clearInterval(n)})}sleep(e){const r=this[ze.current];return new Promise((n,i)=>{const s=this.setTimeout(()=>{s(),o(),n()},e),o=r.on("dispose",()=>{s(),o(),i(new Error("Context has been disposed"))})})}createWrapper(e,r=!1){const n=this[ze.current];n.scope.assertActive();let i;const s=si(()=>{r=!0,Ot(n.scope.disposables,s),clearTimeout(i)},"dispose"),o=si((...a)=>{clearTimeout(i),i=e(a,()=>!r&&n.scope.isActive)},"wrapper");return o.dispose=s,n.scope.disposables.push(s),o}throttle(e,r,n){let i=-1/0;const s=si((...o)=>{i=Date.now(),e(...o)},"execute");return this.createWrapper((o,a)=>{const c=Date.now(),u=r-(c-i);if(u<=0)s(...o);else if(a())return setTimeout(s,u,...o)},n)}debounce(e,r){return this.createWrapper((n,i)=>{if(i())return setTimeout(e,r,...n)})}},si(rn,"TimerService"),rn),Ad=Object.defineProperty,Ls=(t,e)=>Ad(t,"name",{value:e,configurable:!0}),Ma=(nn=class extends ze{constructor(r){super(r);Z(this,"baseDir");this.baseDir=globalThis.process?.cwd?.()||"",this.provide("logger",void 0,!0),this.provide("timer",void 0,!0),this.plugin(wd),this.plugin(Id)}},Ls(nn,"Context"),nn),Tr=(sn=class extends Ir{constructor(...r){super(...r);Z(this,"logger");Z(this,"schema");this.logger=this.ctx.logger(this.name),this.schema=new kd(this.ctx)}[Ir.setup](){this.ctx=new Ma}},Ls(sn,"Service"),sn);function Td(){}Ls(Td,"default");var ut=(t=>(t.BODY_USED="BODY_USED",t.NO_BODY_READER="NO_BODY_READER",t.TIMEOUT="TIMEOUT",t.NETWORK_ERROR="NETWORK_ERROR",t.BODY_NOT_ALLOWED="BODY_NOT_ALLOWED",t.HOOK_CONTEXT_CHANGED="HOOK_CONTEXT_CHANGED",t.ABORTED_BY_HOOK="ABORTED_BY_HOOK",t.INVALID_HOOK_CALLBACK="INVALID_HOOK_CALLBACK",t.UNEXPECTED_HOOK_RETURN="UNEXPECTED_HOOK_RETURN",t))(ut||{});class at extends Error{constructor(e,r,n,i){super(r,i),this.code=e,this.context=n,this.name="FexiosError"}}let Rd=class extends at{constructor(e,r,n){super(r.statusText,e,void 0,n),this.response=r,this.name="FexiosResponseError"}};function Nd(t,e=2048){if(!(t instanceof Uint8Array))throw new TypeError("Input must be a Uint8Array");if(t.length===0)return!0;const r=Math.min(Math.max(t.length,256),e),n=t.slice(0,r);if(Dd(n))return!1;const i=Ld(n);if(i.nullByteRatio>.05||i.highByteRatio>.95)return!1;const s=["utf-8","utf-16le","utf-16be","iso-8859-1"];let o=-1,a=!1;for(const c of s)try{const u=new TextDecoder(c,{fatal:!0}).decode(n),l=Md(u);l>o&&(o=l,a=l>.7)}catch{continue}return a}function Dd(t){if(t.length<4)return!1;const e=[[137,80,78,71],[255,216,255],[71,73,70],[37,80,68,70],[80,75,3,4],[80,75,5,6],[80,75,7,8],[127,69,76,70],[77,90],[202,254,186,190],[0,0,1,0],[82,73,70,70]];for(const r of e)if(t.length>=r.length){let n=!0;for(let i=0;i<r.length;i++)if(t[i]!==r[i]){n=!1;break}if(n)return!0}return!1}function Ld(t){let e=0,r=0,n=0;for(const i of t)i===0&&e++,i>127&&r++,(i<32&&i!==9&&i!==10&&i!==13||i===127)&&n++;return{nullByteRatio:e/t.length,highByteRatio:r/t.length,controlCharRatio:n/t.length}}function Md(t){if(t.length===0)return 1;let e=1,r=0;for(let i=0;i<t.length;i++){const s=t[i].charCodeAt(0);s>=32&&s<=126||s===9||s===10||s===13||s===32?r++:s>127&&s<65534?!jd(s)&&!Fd(s)&&r++:e-=.1}const n=r/t.length;return e*=n,Bd(t)&&(e*=1.1),Math.max(0,Math.min(1,e))}function jd(t){return t>=0&&t<=31||t>=127&&t<=159}function Fd(t){return t>=57344&&t<=63743||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function Bd(t){return[/\b\w+\b/,/[.!?]+\s/,/\s+/,/[a-zA-Z]{3,}/,/[\u4e00-\u9fa5]+/,/\d+/].some(e=>e.test(t))}function Ms(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function ja(t,e={}){const r={};return Object.entries(t).forEach(([n,i])=>{i!=null&&(e.dropEmptyString&&i===""||(r[n]=i))}),r}let pn=class{constructor(e,r,n){this.rawResponse=e,this.data=r,this.ok=e.ok,this.status=e.status,this.statusText=e.statusText,this.headers=e.headers,Object.entries(n||{}).forEach(([i,s])=>{this[i]=s})}};async function Ud(t,e,r){var n;if(t.bodyUsed)throw new at(ut.BODY_USED,"Response body has already been used or locked");const i=t.headers.get("content-type")||"",s=Number(t.headers.get("content-length"))||0,o=(c,u)=>u==="json"||c.startsWith("application/json"),a=(c,u,l)=>l==="blob"||c.startsWith("image/")&&!c.startsWith("image/svg")||c.startsWith("video/")||c.startsWith("audio/")||!Nd(u);if((t.status===101||t.status===426||t.headers.get("upgrade"))&&typeof globalThis.WebSocket<"u"){const c=new WebSocket(t.url);return await new Promise((u,l)=>{c.onopen=u,c.onerror=l}),new pn(t,c,{ok:!0,status:101,statusText:"Switching Protocols"})}else if(i.startsWith("text/event-stream")&&!["text","json"].includes(e||"")&&typeof globalThis.EventSource<"u"){const c=new EventSource(t.url);return await new Promise((u,l)=>{c.onopen=u,c.onerror=l}),new pn(t,c)}else{if(e==="stream")return new pn(t,t.body);{const c=(n=t.clone().body)==null?void 0:n.getReader();if(!c)throw new at(ut.NO_BODY_READER,"Failed to get ReadableStream from response body");let u=new Uint8Array;for(;;){const{done:f,value:v}=await c.read();if(f)break;if(v&&(u=new Uint8Array([...u,...v]),r&&s>0)){const y=Math.min(u.length/s,1);r(y,u)}}const l=new pn(t,void 0);if(e==="arrayBuffer")return l.data=u.buffer,l;if(o(i,e))try{const f=new TextDecoder().decode(u);l.data=JSON.parse(f)}catch{}if(typeof l.data!="string"&&a(i,u,e)?l.data=new Blob([u],{type:t.headers.get("content-type")||void 0}):l.data=new TextDecoder().decode(u),typeof l.data=="string"&&e!=="text"){const f=l.data.trim(),v=f[0],y=f[f.length-1];if(v==="{"&&y==="}"||v==="["&&y==="]")try{l.data=JSON.parse(l.data)}catch{}}if(typeof l.data>"u"&&(l.data=u.length>0?u:void 0),l.ok)return l;throw new Rd(`Request failed with status code ${t.status}`,l)}}}let Wd=class{static makeSearchParams(e){const r=new URLSearchParams;return Object.entries(e).forEach(([n,i])=>{Array.isArray(i)?i.forEach(s=>r.append(n,String(s))):r.set(n,String(i))}),r}static makeQueryString(e){return this.makeSearchParams(e).toString()}};function qd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var js,Fa;function Hd(){if(Fa)return js;Fa=1;function t(e){var r=this.constructor.prototype[e],n=function(){return r.apply(n,arguments)};return Object.setPrototypeOf(n,this.constructor.prototype),Object.getOwnPropertyNames(r).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(r,i))}),n}return t.prototype=Object.create(Function.prototype),js=t,js}var zd=Hd();const Vd=qd(zd);let Ba=class xs extends Vd{constructor(e={}){super("request"),this.baseConfigs=e,this.hooks=[],this.DEFAULT_CONFIGS={baseURL:"",timeout:60*1e3,credentials:"same-origin",headers:{},query:{},responseType:void 0},this.ALL_METHODS=["get","post","put","patch","delete","head","options","trace"],this.METHODS_WITHOUT_BODY=["get","head","options","trace"],this.interceptors={request:this.createInterceptor("beforeRequest"),response:this.createInterceptor("afterResponse")},this.create=xs.create,this.dropUndefinedAndNull=ja,this.checkIsPlainObject=Ms,this.ALL_METHODS.forEach(this.createMethodShortcut.bind(this))}async request(e,r){var n,i,s,o;let a=r=r||{};typeof e=="string"||e instanceof URL?a.url=e.toString():typeof e=="object"&&(a={...e,...a}),a=await this.emit("beforeInit",a);const c=r.baseURL||this.baseConfigs.baseURL||((n=globalThis.location)==null?void 0:n.href),u=c?new URL(c,(i=globalThis.location)==null?void 0:i.href):void 0,l=new URL(a.url.toString(),u);a.url=l.href,a.baseURL=u?u.href:l.origin,a.headers=this.mergeHeaders(this.baseConfigs.headers,r.headers);const f=u?.searchParams,v=new URLSearchParams(l.searchParams);if(l.search="",a.url=l.href,a.query=this.mergeQuery(f,this.baseConfigs.query,v,r.query),l.search=Wd.makeQueryString(a.query),a.url=l.toString(),this.METHODS_WITHOUT_BODY.includes((s=a.method)==null?void 0:s.toLocaleLowerCase())&&a.body)throw new at(ut.BODY_NOT_ALLOWED,`Request method "${a.method}" does not allow body`);a=await this.emit("beforeRequest",a);let y;typeof a.body<"u"&&a.body!==null&&(a.body instanceof Blob||a.body instanceof FormData||a.body instanceof URLSearchParams?y=a.body:typeof a.body=="object"&&a.body!==null?(y=JSON.stringify(a.body),a.headers["content-type"]="application/json"):y=a.body),!((o=r.headers)!=null&&o["content-type"])&&y&&(y instanceof FormData||y instanceof URLSearchParams?delete a.headers["content-type"]:typeof y=="string"&&typeof a.body=="object"?a.headers["content-type"]="application/json":y instanceof Blob&&(a.headers["content-type"]=y.type)),a.body=y,a=await this.emit("afterBodyTransformed",a);const b=a.abortController||globalThis.AbortController?new AbortController:void 0,T=new Request(a.url,{method:a.method||"GET",credentials:a.credentials,cache:a.cache,mode:a.mode,headers:a.headers,body:a.body,signal:b?.signal});a.rawRequest=T,a=await this.emit("beforeActualFetch",a);const H=a.timeout||this.baseConfigs.timeout||60*1e3;if(a.url.startsWith("ws"))try{const R=new WebSocket(a.url);return await new Promise((m,p)=>{const h=setTimeout(()=>{p(new at(ut.TIMEOUT,`WebSocket connection timed out after ${H}ms`,a))},H);R.onopen=()=>{clearTimeout(h),m()},R.onerror=P=>{clearTimeout(h),p(new at(ut.NETWORK_ERROR,"WebSocket connection failed",a))},R.onclose=P=>{P.code!==1e3&&(clearTimeout(h),p(new at(ut.NETWORK_ERROR,`WebSocket closed with code ${P.code}`,a)))}}),a.rawResponse=new Response,a.response=new pn(a.rawResponse,R,{ok:!0,status:101,statusText:"Switching Protocols"}),a.data=R,a.headers=new Headers,this.emit("afterResponse",a)}catch(R){throw R instanceof at?R:new at(ut.NETWORK_ERROR,`WebSocket creation failed: ${R}`,a)}let B;try{b&&(B=setTimeout(()=>{b.abort()},H));const R=await fetch(a.rawRequest).catch(m=>{throw B&&clearTimeout(B),b!=null&&b.signal.aborted?new at(ut.TIMEOUT,`Request timed out after ${H}ms`,a):new at(ut.NETWORK_ERROR,m.message,a)});return B&&clearTimeout(B),a.rawResponse=R,a.response=await Ud(R,a.responseType,(m,p)=>{var h;(h=r?.onProgress)==null||h.call(r,m,p)}),a.data=a.response.data,a.headers=a.response.headers,this.emit("afterResponse",a)}catch(R){throw B&&clearTimeout(B),R}}mergeQuery(e,...r){const n={},i=s=>{s&&(Ms(s)?Object.entries(s).forEach(([o,a])=>{a==null?delete n[o]:Array.isArray(a)?(o.endsWith("[]"),n[o]=a.map(String)):n[o]=String(a)}):new URLSearchParams(s).forEach((o,a)=>{n[a]=o}))};return i(e),r.forEach(i),n}mergeHeaders(e,...r){const n={},i=new Headers(e);for(const s of r)if(s!=null)if(Ms(s)){const o=ja(s);if(Object.keys(o).length===0)continue;new Headers(o).forEach((a,c)=>{i.set(c,a)})}else new Headers(s).forEach((o,a)=>{i.set(a,o)});return i.forEach((s,o)=>{n[o]=s}),n}async emit(e,r){const n=this.hooks.filter(i=>i.event===e);try{let i=0;for(const s of n){const o=`${e}#${s.action.name||`anonymous#${i}`}`,a=Symbol("FexiosHookContext");r[a]=a;const c=await s.action.call(this,r);if(c===!1)throw new at(ut.ABORTED_BY_HOOK,`Request aborted by hook "${o}"`,r);if(typeof c=="object"&&c[a]===a)r=c;else{const u=globalThis["".concat("console")];try{throw new at(ut.HOOK_CONTEXT_CHANGED,`Hook "${o}" should return the original FexiosContext or return false to abort the request, but got "${c}".`)}catch(l){u.warn(l.stack||l)}}delete r[a],i++}}catch(i){return Promise.reject(i)}return r}on(e,r,n=!1){if(typeof r!="function")throw new at(ut.INVALID_HOOK_CALLBACK,`Hook should be a function, but got "${typeof r}"`);return this.hooks[n?"unshift":"push"]({event:e,action:r}),this}off(e,r){return e==="*"||!e?this.hooks=this.hooks.filter(n=>n.action!==r):this.hooks=this.hooks.filter(n=>n.event!==e||n.action!==r),this}createInterceptor(e){return{handlers:()=>this.hooks.filter(r=>r.event===e).map(r=>r.action),use:(r,n=!1)=>this.on(e,r,n),clear:()=>{this.hooks=this.hooks.filter(r=>r.event!==e)}}}createMethodShortcut(e){return Object.defineProperty(this,e,{value:(r,n,i)=>(this.METHODS_WITHOUT_BODY.includes(e.toLocaleLowerCase())?i=n:(i=i||{},i.body=n),this.request(r,{...i,method:e}))}),this}extends(e){const r=new xs({...this.baseConfigs,...e});return r.hooks=[...this.hooks],r}static create(e){return new xs(e)}};/**
9
9
  * Fexios
10
10
  * @desc Fetch based HTTP client with similar API to axios for browser and Node.js
11
11
  *
12
12
  * @license MIT
13
13
  * @author dragon-fish <dragon-fish@qq.com>
14
- */const Td=Tr.create,ja=Td();typeof globalThis<"u"?globalThis.fexios=ja:typeof window<"u"&&(window.fexios=ja);/**
14
+ */const Kd=Ba.create,Ua=Kd();typeof globalThis<"u"?globalThis.fexios=Ua:typeof window<"u"&&(window.fexios=Ua);/**
15
15
  * MediaWiki Api
16
16
  * Provides the API call methods similar to `mw.Api` at non-mw environments
17
17
  *
18
18
  * @author Dragon-Fish <dragon-fish@qq.com>
19
19
  * @license MIT
20
- */const Ba=class dr{constructor(e,r,n){if(this.baseURL=e,this.version="5.0.0",!e&&typeof window=="object"&&window.mediaWiki){const{wgServer:i,wgScriptPath:s}=window.mediaWiki?.config?.get(["wgServer","wgScriptPath"])||{};typeof i=="string"&&typeof s=="string"&&(e=`${i}${s}/api.php`)}if(typeof e!="string")throw new Error("baseURL is undefined");this.baseURL=e,this.tokens={},this.defaultParams={...dr.INIT_DEFAULT_PARAMS,...n},this.defaultOptions={responseType:"json",...r},this.request=dr.createRequestHandler(this.baseURL)}setBaseURL(e){return this.request.baseConfigs.baseURL=e,this}static normalizeParamValue(e){return Array.isArray(e)?e.join("|"):typeof e=="boolean"?e?"1":void 0:typeof e=="number"?""+e:e}static createRequestHandler(e){const r=new Tr({baseURL:e,responseType:"json"});return r.on("beforeInit",n=>{if(n.method?.toLowerCase()!=="post")return n;if(typeof n.body=="object"&&n.body!==null&&!(n.body instanceof URLSearchParams)&&!(n.body instanceof FormData)){const i=n.body;Object.keys(i).forEach(s=>{const o=dr.normalizeParamValue(i[s]);typeof o>"u"||o===null?delete i[s]:o!==i[s]&&(i[s]=o)}),n.body=new URLSearchParams(n.body)}if(globalThis.FormData&&n.body instanceof FormData||n.body instanceof URLSearchParams){const i=n.body;i.forEach((o,a)=>{const c=dr.normalizeParamValue(o);typeof c>"u"||c===null?i.delete(a):c!==o&&i.set(a,c)});const s=new URLSearchParams(n.query);!s.has("format")&&s.set("format",""+(i.get("format")||"json")),!s.has("formatversion")&&s.set("formatversion",""+(i.get("formatversion")||"2")),i.has("origin")&&s.set("origin",""+i.get("origin")),n.query=Object.fromEntries(s.entries()),i.has("action")&&(n.query.action=""+i.get("action"))}return n}),r.on("beforeInit",n=>{n.query=n.query;for(const i in n.query){const s=dr.normalizeParamValue(n.query[i]);typeof s>"u"||s===null?delete n.query[i]:s!==n.query[i]&&(n.query[i]=""+s)}return n}),r.on("beforeRequest",n=>{const i=new URL(n.url),s=i.searchParams;if(globalThis.location&&(!s.has("origin")&&location.origin!==new URL(e).origin?(s.set("origin",location.origin),r.baseConfigs.credentials="include",r.baseConfigs.mode="cors"):location.origin===new URL(e).origin&&(s.delete("origin"),r.baseConfigs.credentials=void 0,r.baseConfigs.mode=void 0)),i.searchParams.has("origin")){const o=encodeURIComponent(i.searchParams.get("origin")||"").replace(/\./g,"%2E");n.query={},i.searchParams.delete("origin"),n.url=`${i}${i.search?"&":"?"}origin=${o}`}return n}),r}get(e,r){return this.request.get("",{...this.defaultOptions,query:{...this.defaultParams,...this.defaultOptions.query,...e},...r})}post(e,r){return this.request.post("",e,{...this.defaultOptions,query:{...this.defaultParams,...this.defaultOptions.query},...r})}async login(e,r,n,i){if(this.defaultOptions.credentials="include",i=i||{},i.retry??(i.retry=3),i.retry<1)throw new Rr("LOGIN_RETRY_LIMIT_EXCEEDED","The limit of the number of times to automatically re-login has been exceeded");let s;try{const o=await this.postWithToken("login",{action:"login",lgname:e,lgpassword:r,...n},{tokenName:"lgtoken",...i});if(o?.data?.login)s=o.data;else throw o}catch(o){if(o instanceof Rr)throw o;if(o?.ok===!1)return this.login(e,r,n,{...i,noCache:!0,retry:i.retry-1});throw new Rr("HTTP_ERROR","The server returns an error, but it doesn't seem to be caused by MediaWiki",o)}if(s?.login?.result!=="Success")throw new Rr("LOGIN_FAILED",s?.login?.reason?.text||s?.login?.result||"Login failed with unknown reason",s);return s.login}async getUserInfo(){const{data:e}=await this.get({action:"query",meta:"userinfo",uiprop:["groups","rights","blockinfo"]});return e?.query?.userinfo}async getTokens(e=["csrf"]){this.defaultOptions.credentials="include";const{data:r}=await this.get({action:"query",meta:"tokens",type:e});return this.tokens={...this.tokens,...r.query.tokens},this.tokens}async token(e="csrf",r=!1){return(!this.tokens[`${e}token`]||r)&&(delete this.tokens[`${e}token`],await this.getTokens([e])),this.tokens[`${e}token`]}async postWithToken(e,r,n){const{tokenName:i="token",retry:s=3,noCache:o=!1}=n||{};if(s<1)throw new Rr("TOKEN_RETRY_LIMIT_EXCEEDED","The limit of the number of times to automatically re-acquire the token has been exceeded");const a=await this.token(e,o),c=()=>this.postWithToken(e,r,{tokenName:i,retry:s-1,noCache:!0});return this.post({[i]:a,...r}).then(l=>{const u=l.data;return dr.isBadTokenError(u)?c():l}).catch(l=>{const u=l.data;if(dr.isBadTokenError(u)||l?.ok===!1)return c();if(typeof u=="object"&&u!==null)return Promise.reject(u);throw new Rr("HTTP_ERROR","The server returns an error, but it doesn’t seem to be caused by MediaWiki",l)})}postWithEditToken(e){return this.postWithToken("csrf",e)}static isBadTokenError(e){return e?.error?.code==="badtoken"||e?.errors?.some(r=>r.code==="badtoken")||["NeedToken","WrongToken"].includes(e?.login?.result)}async getMessages(e,r="zh",n){const{data:i}=await this.get({action:"query",meta:"allmessages",ammessages:e,amlang:r,...n}),s={};return i.query.allmessages.forEach(function(o){o.missing||(s[o.name]=o.content)}),s}async parseWikitext(e,r,n,i){const{data:s}=await this.post({action:"parse",title:r,text:e,...n},i);return s.parse.text}};Ba.INIT_DEFAULT_PARAMS={action:"query",errorformat:"plaintext",format:"json",formatversion:2};let Rd=Ba;class Rr extends Error{constructor(e,r="",n){super(),this.code=e,this.message=r,this.cause=n,this.name="WikiSaikouError"}}/**
20
+ */const Wa=class hr{constructor(e,r,n){if(this.baseURL=e,this.version="5.0.0",!e&&typeof window=="object"&&window.mediaWiki){const{wgServer:i,wgScriptPath:s}=window.mediaWiki?.config?.get(["wgServer","wgScriptPath"])||{};typeof i=="string"&&typeof s=="string"&&(e=`${i}${s}/api.php`)}if(typeof e!="string")throw new Error("baseURL is undefined");this.baseURL=e,this.tokens={},this.defaultParams={...hr.INIT_DEFAULT_PARAMS,...n},this.defaultOptions={responseType:"json",...r},this.request=hr.createRequestHandler(this.baseURL)}setBaseURL(e){return this.request.baseConfigs.baseURL=e,this}static normalizeParamValue(e){return Array.isArray(e)?e.join("|"):typeof e=="boolean"?e?"1":void 0:typeof e=="number"?""+e:e}static createRequestHandler(e){const r=new Ba({baseURL:e,responseType:"json"});return r.on("beforeInit",n=>{if(n.method?.toLowerCase()!=="post")return n;if(typeof n.body=="object"&&n.body!==null&&!(n.body instanceof URLSearchParams)&&!(n.body instanceof FormData)){const i=n.body;Object.keys(i).forEach(s=>{const o=hr.normalizeParamValue(i[s]);typeof o>"u"||o===null?delete i[s]:o!==i[s]&&(i[s]=o)}),n.body=new URLSearchParams(n.body)}if(globalThis.FormData&&n.body instanceof FormData||n.body instanceof URLSearchParams){const i=n.body;i.forEach((o,a)=>{const c=hr.normalizeParamValue(o);typeof c>"u"||c===null?i.delete(a):c!==o&&i.set(a,c)});const s=new URLSearchParams(n.query);!s.has("format")&&s.set("format",""+(i.get("format")||"json")),!s.has("formatversion")&&s.set("formatversion",""+(i.get("formatversion")||"2")),i.has("origin")&&s.set("origin",""+i.get("origin")),n.query=Object.fromEntries(s.entries()),i.has("action")&&(n.query.action=""+i.get("action"))}return n}),r.on("beforeInit",n=>{n.query=n.query;for(const i in n.query){const s=hr.normalizeParamValue(n.query[i]);typeof s>"u"||s===null?delete n.query[i]:s!==n.query[i]&&(n.query[i]=""+s)}return n}),r.on("beforeRequest",n=>{const i=new URL(n.url),s=i.searchParams;if(globalThis.location&&(!s.has("origin")&&location.origin!==new URL(e).origin?(s.set("origin",location.origin),r.baseConfigs.credentials="include",r.baseConfigs.mode="cors"):location.origin===new URL(e).origin&&(s.delete("origin"),r.baseConfigs.credentials=void 0,r.baseConfigs.mode=void 0)),i.searchParams.has("origin")){const o=encodeURIComponent(i.searchParams.get("origin")||"").replace(/\./g,"%2E");n.query={},i.searchParams.delete("origin"),n.url=`${i}${i.search?"&":"?"}origin=${o}`}return n}),r}get(e,r){return this.request.get("",{...this.defaultOptions,query:{...this.defaultParams,...this.defaultOptions.query,...e},...r})}post(e,r){return this.request.post("",e,{...this.defaultOptions,query:{...this.defaultParams,...this.defaultOptions.query},...r})}async login(e,r,n,i){if(this.defaultOptions.credentials="include",i=i||{},i.retry??(i.retry=3),i.retry<1)throw new Rr("LOGIN_RETRY_LIMIT_EXCEEDED","The limit of the number of times to automatically re-login has been exceeded");let s;try{const o=await this.postWithToken("login",{action:"login",lgname:e,lgpassword:r,...n},{tokenName:"lgtoken",...i});if(o?.data?.login)s=o.data;else throw o}catch(o){if(o instanceof Rr)throw o;if(o?.ok===!1)return this.login(e,r,n,{...i,noCache:!0,retry:i.retry-1});throw new Rr("HTTP_ERROR","The server returns an error, but it doesn't seem to be caused by MediaWiki",o)}if(s?.login?.result!=="Success")throw new Rr("LOGIN_FAILED",s?.login?.reason?.text||s?.login?.result||"Login failed with unknown reason",s);return s.login}async getUserInfo(){const{data:e}=await this.get({action:"query",meta:"userinfo",uiprop:["groups","rights","blockinfo"]});return e?.query?.userinfo}async getTokens(e=["csrf"]){this.defaultOptions.credentials="include";const{data:r}=await this.get({action:"query",meta:"tokens",type:e});return this.tokens={...this.tokens,...r.query.tokens},this.tokens}async token(e="csrf",r=!1){return(!this.tokens[`${e}token`]||r)&&(delete this.tokens[`${e}token`],await this.getTokens([e])),this.tokens[`${e}token`]}async postWithToken(e,r,n){const{tokenName:i="token",retry:s=3,noCache:o=!1}=n||{};if(s<1)throw new Rr("TOKEN_RETRY_LIMIT_EXCEEDED","The limit of the number of times to automatically re-acquire the token has been exceeded");const a=await this.token(e,o),c=()=>this.postWithToken(e,r,{tokenName:i,retry:s-1,noCache:!0});return this.post({[i]:a,...r}).then(u=>{const l=u.data;return hr.isBadTokenError(l)?c():u}).catch(u=>{const l=u.data;if(hr.isBadTokenError(l)||u?.ok===!1)return c();if(typeof l=="object"&&l!==null)return Promise.reject(l);throw new Rr("HTTP_ERROR","The server returns an error, but it doesn’t seem to be caused by MediaWiki",u)})}postWithEditToken(e){return this.postWithToken("csrf",e)}static isBadTokenError(e){return e?.error?.code==="badtoken"||e?.errors?.some(r=>r.code==="badtoken")||["NeedToken","WrongToken"].includes(e?.login?.result)}async getMessages(e,r="zh",n){const{data:i}=await this.get({action:"query",meta:"allmessages",ammessages:e,amlang:r,...n}),s={};return i.query.allmessages.forEach(function(o){o.missing||(s[o.name]=o.content)}),s}async parseWikitext(e,r,n,i){const{data:s}=await this.post({action:"parse",title:r,text:e,...n},i);return s.parse.text}};Wa.INIT_DEFAULT_PARAMS={action:"query",errorformat:"plaintext",format:"json",formatversion:2};let Jd=Wa,Rr=class extends Error{constructor(e,r="",n){super(),this.code=e,this.message=r,this.cause=n,this.name="WikiSaikouError"}};/**
21
21
  * MediaWiki Api
22
22
  * Provides the API call methods similar to `mw.Api` at non-mw environments
23
23
  *
24
24
  * @author Dragon-Fish <dragon-fish@qq.com>
25
25
  * @license MIT
26
- */class Ua extends Rd{}class Dd{constructor(e,r){this.ctx=e;let n=typeof r?.baseURL=="string"?r.baseURL:r?.baseURL?.toString();n?.startsWith("/")&&(n=new URL(n,location.origin).href);const i=new Ua(n,{headers:{"x-api-user-agent":`InPageEdit-NEXT ${e.version}`}});e.set("api",i)}}class Nd extends Ar{constructor(e){super(e,"resourceLoader",!0),this.ctx=e}stop(){}loadScript(e,r){if(!e)return Promise.resolve(null);const n=`script:${e}`,i=document.querySelector(`[data-ipe="${n}"]`);return i?Promise.resolve(i):new Promise((o,a)=>{const c=document.createElement("script");c.src=e,c.dataset.ipe=n,r&&Object.entries(r).forEach(([l,u])=>{typeof u>"u"||u===!1||u===null?c.removeAttribute(l):c.setAttribute(l,u)}),document.body.appendChild(c),c.onload=()=>o(c),c.onerror=l=>a(l)})}loadStyle(e,r){if(!e)return Promise.resolve(null);const n=`style:${e}`,i=document.querySelector(`[data-ipe="${n}"]`);return i?Promise.resolve(i):new Promise((o,a)=>{const c=document.createElement("link");c.rel="stylesheet",c.href=e,c.dataset.ipe=n,r&&Object.entries(r).forEach(([u,f])=>{typeof f>"u"||f===!1||f===null?c.removeAttribute(u):c.setAttribute(u,f)}),(document.querySelector('meta[name="ipe-styles"]')||(()=>{const u=document.createElement("meta");return u.id="ipe-styles",u.name="ipe-styles",document.head.insertAdjacentElement("afterbegin",u),u})()).before(c),c.onload=()=>o(c),c.onerror=u=>a(u)})}resolveImportPath(e){if(e.startsWith("http")||e.startsWith("//"))return e;const r=document.currentScript?.src;if(!r)return`https://unpkg.com/mediawiki-inpageedit@latest/dist/${e}`;const n=new URL(r);return n.pathname.endsWith(".js")||(n.pathname=n.pathname+"/"),new URL(e,n.toString()).toString()}}const oi=Object.keys;function Ld(t){return typeof t=="boolean"}function Md(t){return t&&typeof t.nodeType=="number"}function ai(t){return typeof t=="string"}function Wa(t){return typeof t=="number"}function pr(t){return typeof t=="object"?t!==null:mn(t)}function mn(t){return typeof t=="function"}function Fd(t){return!!(t&&t.isComponent)}function jd(t){return pr(t)&&typeof t.length=="number"&&typeof t.nodeType!="number"}function Fs(t,e){if(t)for(const r of oi(t))e(t[r],r)}function Bd(t){return pr(t)&&"current"in t}const js={animationIterationCount:0,borderImageOutset:0,borderImageSlice:0,borderImageWidth:0,boxFlex:0,boxFlexGroup:0,boxOrdinalGroup:0,columnCount:0,columns:0,flex:0,flexGrow:0,flexPositive:0,flexShrink:0,flexNegative:0,flexOrder:0,gridArea:0,gridRow:0,gridRowEnd:0,gridRowSpan:0,gridRowStart:0,gridColumn:0,gridColumnEnd:0,gridColumnSpan:0,gridColumnStart:0,fontWeight:0,lineClamp:0,lineHeight:0,opacity:0,order:0,orphans:0,tabSize:0,widows:0,zIndex:0,zoom:0,fillOpacity:0,floodOpacity:0,stopOpacity:0,strokeDasharray:0,strokeDashoffset:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0};function Ud(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}const Wd=["Webkit","ms","Moz","O"];oi(js).forEach(t=>{Wd.forEach(e=>{js[Ud(e,t)]=0})});const qd=Symbol.for("jsx-dom:type");var qa=function(t){return t.ShadowRoot="ShadowRoot",t}(qa||{});function Hd(t){return t!=null&&t[qd]===qa.ShadowRoot}const zd="http://www.w3.org/2000/svg",Vd="http://www.w3.org/1999/xlink",Kd="http://www.w3.org/XML/1998/namespace";function Ha(t){return!Ld(t)&&t!=null}function Bs(t){return Array.isArray(t)?t.map(Bs).filter(Boolean).join(" "):pr(t)?Symbol.iterator in t?Bs(Array.from(t)):oi(t).filter(e=>t[e]).join(" "):Ha(t)?""+t:""}const Jd={animate:0,circle:0,clipPath:0,defs:0,desc:0,ellipse:0,feBlend:0,feColorMatrix:0,feComponentTransfer:0,feComposite:0,feConvolveMatrix:0,feDiffuseLighting:0,feDisplacementMap:0,feDistantLight:0,feFlood:0,feFuncA:0,feFuncB:0,feFuncG:0,feFuncR:0,feGaussianBlur:0,feImage:0,feMerge:0,feMergeNode:0,feMorphology:0,feOffset:0,fePointLight:0,feSpecularLighting:0,feSpotLight:0,feTile:0,feTurbulence:0,filter:0,foreignObject:0,g:0,image:0,line:0,linearGradient:0,marker:0,mask:0,metadata:0,path:0,pattern:0,polygon:0,polyline:0,radialGradient:0,rect:0,stop:0,svg:0,switch:0,symbol:0,text:0,textPath:0,tspan:0,use:0,view:0},Yd=/^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;function ci(t){const e=document.createDocumentFragment();return li(t.children,e),e}function Gd(t,e,r){e={...e,children:r};const n=new t(e),i=n.render();return"ref"in e&&Us(e.ref,n),i}function O(t,e){let{children:r,...n}=e;!n.namespaceURI&&Jd[t]===0&&(n={...n,namespaceURI:zd});let i;if(ai(t)){if(i=n.namespaceURI?document.createElementNS(n.namespaceURI,t):document.createElement(t),eh(n,i),li(r,i),i instanceof window.HTMLSelectElement&&n.value!=null)if(n.multiple===!0&&Array.isArray(n.value)){const s=n.value.map(o=>String(o));i.querySelectorAll("option").forEach(o=>o.selected=s.includes(o.value))}else i.value=n.value;Us(n.ref,i)}else if(mn(t))pr(t.defaultProps)&&(n={...t.defaultProps,...n}),i=Fd(t)?Gd(t,n,r):t({...n,children:r});else throw new TypeError(`Invalid JSX element type: ${t}`);return i}function Qd(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return(ai(e)||Array.isArray(e))&&(n.unshift(e),e={}),e=e||{},e.children!=null&&!n.length&&({children:n,...e}=e),O(t,{...e,children:n},e.key)}function Us(t,e){Bd(t)?t.current=e:mn(t)&&t(e)}function li(t,e){if(jd(t))Xd(t,e);else if(ai(t)||Wa(t))Ws(document.createTextNode(t),e);else if(t===null)Ws(document.createComment(""),e);else if(Md(t))Ws(t,e);else if(Hd(t)){const r=e.attachShadow(t.attr);li(t.children,r),Us(t.ref,r)}}function Xd(t,e){for(const r of[...t])li(r,e);return e}function Ws(t,e){e instanceof window.HTMLTemplateElement?e.content.appendChild(t):e.appendChild(t)}function ui(t,e){return t.replace(/[A-Z]/g,r=>e+r.toLowerCase())}function za(t,e){e==null||e===!1||(Array.isArray(e)?e.forEach(r=>za(t,r)):ai(e)?t.setAttribute("style",e):pr(e)&&Fs(e,(r,n)=>{n.indexOf("-")===0?t.style.setProperty(n,r):Wa(r)&&js[n]!==0?t.style[n]=r+"px":t.style[n]=r}))}function Zd(t,e,r){switch(t){case"xlinkActuate":case"xlinkArcrole":case"xlinkHref":case"xlinkRole":case"xlinkShow":case"xlinkTitle":case"xlinkType":Va(r,Vd,ui(t,":"),e);return;case"xmlnsXlink":Dr(r,ui(t,":"),e);return;case"xmlBase":case"xmlLang":case"xmlSpace":Va(r,Kd,ui(t,":"),e);return}switch(t){case"htmlFor":Dr(r,"for",e);return;case"dataset":Fs(e,(n,i)=>{n!=null&&(r.dataset[i]=n)});return;case"innerHTML":case"innerText":case"textContent":Ha(e)&&(r[t]=e);return;case"dangerouslySetInnerHTML":pr(e)&&(r.innerHTML=e.__html);return;case"value":if(e==null||r instanceof window.HTMLSelectElement)return;if(r instanceof window.HTMLTextAreaElement){r.value=e;return}break;case"spellCheck":r.spellcheck=e;return;case"class":case"className":mn(e)?e(r):Dr(r,"class",Bs(e));return;case"ref":case"namespaceURI":return;case"style":za(r,e);return;case"on":case"onCapture":Fs(e,(n,i)=>{r.addEventListener(i,n,t==="onCapture")});return}if(mn(e)){if(t[0]==="o"&&t[1]==="n"){let n=t.toLowerCase();const i=n.endsWith("capture");if(n==="ondoubleclick"?n="ondblclick":i&&n==="ondoubleclickcapture"&&(n="ondblclickcapture"),!i&&r[n]===null)r[n]=e;else if(i)r.addEventListener(n.substring(2,n.length-7),e,!0);else{let s;n in window?s=n.substring(2):s=n[2]+t.slice(3),r.addEventListener(s,e)}}}else pr(e)?r[t]=e:e===!0?Dr(r,t,""):e!==!1&&e!=null&&(r instanceof SVGElement&&!Yd.test(t)?Dr(r,ui(t,"-"),e):Dr(r,t,e))}function Dr(t,e,r){t.setAttribute(e,r)}function Va(t,e,r,n){t.setAttributeNS(e,r,n)}function eh(t,e){for(const r of oi(t))Zd(r,t[r],e);return e}var Nr=(t=>(t.ANALYTICS_API_BASE="https://analytics.ipe.wiki/api",t.ANALYTICS_DASH_URL="https://analytics.ipe.wiki",t.GITHUB_URL="https://github.com/inpageedit/inpageedit-v2",t.HOME_URL="https://www.ipe.wiki/",t.PLUGIN_CDN_BASE="https://ipe-plugins.js.org",t.PLUGIN_HOME_URL="https://github.com/inpageedit/Plugins",t.SPECIAL_NOTICE_JSON="https://ipe-plugins.js.org/specialNotice.json",t.UPDATE_LOGS_URL="https://www.ipe.wiki/update/",t))(Nr||{});const th={ipe_progress:"_ipe_progress_so6hn_1"},mr=t=>{const e=t.indeterminate??!0,r=O("div",{class:`${th.ipe_progress}`,"data-indeterminate":`${e}`,style:{width:"100%","--progress":t.progress?`${t.progress}%`:"0%"},...t});return r.setProgress=n=>{typeof n=="number"?(r.dataset.indeterminate="false",r.style.setProperty("--progress",`${n}%`)):(r.dataset.indeterminate="true",r.style.setProperty("--progress","0%"))},r},aa=class aa{constructor(e){this.ctx=e,this.start(),this.ctx.on("dispose",()=>{this.stop()})}start(){const{promise:e,resolve:r}=Promise.withResolvers();return window.ssi_modal&&typeof window.ssi_modal.show=="function"?r(window.ssi_modal):(this.ctx.resourceLoader.loadStyle(`${Nr.PLUGIN_CDN_BASE}/lib/ssi-modal/ssi-modal.css`),this.ctx.resourceLoader.loadScript(`${Nr.PLUGIN_CDN_BASE}/lib/ssi-modal/ssi-modal.js`,{async:""}).then(()=>{r(window.ssi_modal)})),e.then(n=>{this.hackSsiModal(n),this.ctx.set("modal",n),this.modal=n})}stop(){this.modal?.closeAll()}hackSsiModal(e){const r=this,n=e.proto.init;e.proto.init=function(){var o;return console.log("init",this),(o=this.options).className||(o.className=""),this.options.className+=" in-page-edit theme-ipe",n.call(this)};const i=e.proto.show;e.proto.show=function(){return r.ctx.emit("modal/show",{modal:this}),i.call(this)};const s=e.proto.close;return e.proto.close=function(){return r.ctx.emit("modal/close",{modal:this}),s.call(this)},e.proto.setLoadingState=function(o){if(this.get$window().toggleClass("loading",o),o){const a=this.get$window().find("input:not([disabled]),button:not([disabled])");this.get$modal().data("inputsAndButtons",a),a.prop("disabled",!0),this.get$window().append(O("div",{id:"ssi-modalLoadingWrapper",style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.5)",zIndex:2e3},children:O(mr,{style:{width:"80%",maxWidth:"800px"}})}))}else{this.get$window().find("#ssi-modalLoadingWrapper").remove();const a=this.get$modal().data("inputsAndButtons");a&&a.prop("disabled",!1)}},e}};aa.inject=["resourceLoader"];let qs=aa;function fi(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hs={exports:{}};/*!
26
+ */let qa=class extends Jd{};class Yd{constructor(e,r){this.ctx=e;let n=typeof r?.baseURL=="string"?r.baseURL:r?.baseURL?.toString();n?.startsWith("/")&&(n=new URL(n,location.origin).href);const i=new qa(n,{headers:{"x-api-user-agent":`InPageEdit-NEXT ${e.version}`}});e.set("api",i)}}class Gd extends Tr{constructor(e){super(e,"resourceLoader",!0),this.ctx=e}stop(){}loadScript(e,r){if(!e)return Promise.resolve(null);const n=`script:${e}`,i=document.querySelector(`[data-ipe="${n}"]`);return i?Promise.resolve(i):new Promise((o,a)=>{const c=document.createElement("script");c.src=e,c.dataset.ipe=n,r&&Object.entries(r).forEach(([u,l])=>{typeof l>"u"||l===!1||l===null?c.removeAttribute(u):c.setAttribute(u,l)}),document.body.appendChild(c),c.onload=()=>o(c),c.onerror=u=>a(u)})}loadStyle(e,r){if(!e)return Promise.resolve(null);const n=`style:${e}`,i=document.querySelector(`[data-ipe="${n}"]`);return i?Promise.resolve(i):new Promise((o,a)=>{const c=document.createElement("link");c.rel="stylesheet",c.href=e,c.dataset.ipe=n,r&&Object.entries(r).forEach(([l,f])=>{typeof f>"u"||f===!1||f===null?c.removeAttribute(l):c.setAttribute(l,f)}),(document.querySelector('meta[name="ipe-styles"]')||(()=>{const l=document.createElement("meta");return l.id="ipe-styles",l.name="ipe-styles",document.head.insertAdjacentElement("afterbegin",l),l})()).before(c),c.onload=()=>o(c),c.onerror=l=>a(l)})}resolveImportPath(e){if(e.startsWith("http")||e.startsWith("//"))return e;const r=document.currentScript?.src;if(!r)return`https://unpkg.com/mediawiki-inpageedit@latest/dist/${e}`;const n=new URL(r);return n.pathname.endsWith(".js")||(n.pathname=n.pathname+"/"),new URL(e,n.toString()).toString()}}const oi=Object.keys;function Qd(t){return typeof t=="boolean"}function Xd(t){return t&&typeof t.nodeType=="number"}function ai(t){return typeof t=="string"}function Ha(t){return typeof t=="number"}function mr(t){return typeof t=="object"?t!==null:mn(t)}function mn(t){return typeof t=="function"}function Zd(t){return!!(t&&t.isComponent)}function eh(t){return mr(t)&&typeof t.length=="number"&&typeof t.nodeType!="number"}function Fs(t,e){if(t)for(const r of oi(t))e(t[r],r)}function th(t){return mr(t)&&"current"in t}const Bs={animationIterationCount:0,borderImageOutset:0,borderImageSlice:0,borderImageWidth:0,boxFlex:0,boxFlexGroup:0,boxOrdinalGroup:0,columnCount:0,columns:0,flex:0,flexGrow:0,flexPositive:0,flexShrink:0,flexNegative:0,flexOrder:0,gridArea:0,gridRow:0,gridRowEnd:0,gridRowSpan:0,gridRowStart:0,gridColumn:0,gridColumnEnd:0,gridColumnSpan:0,gridColumnStart:0,fontWeight:0,lineClamp:0,lineHeight:0,opacity:0,order:0,orphans:0,tabSize:0,widows:0,zIndex:0,zoom:0,fillOpacity:0,floodOpacity:0,stopOpacity:0,strokeDasharray:0,strokeDashoffset:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0};function rh(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}const nh=["Webkit","ms","Moz","O"];oi(Bs).forEach(t=>{nh.forEach(e=>{Bs[rh(e,t)]=0})});const ih=Symbol.for("jsx-dom:type");var za=function(t){return t.ShadowRoot="ShadowRoot",t}(za||{});function sh(t){return t!=null&&t[ih]===za.ShadowRoot}const oh="http://www.w3.org/2000/svg",ah="http://www.w3.org/1999/xlink",ch="http://www.w3.org/XML/1998/namespace";function Va(t){return!Qd(t)&&t!=null}function Us(t){return Array.isArray(t)?t.map(Us).filter(Boolean).join(" "):mr(t)?Symbol.iterator in t?Us(Array.from(t)):oi(t).filter(e=>t[e]).join(" "):Va(t)?""+t:""}const lh={animate:0,circle:0,clipPath:0,defs:0,desc:0,ellipse:0,feBlend:0,feColorMatrix:0,feComponentTransfer:0,feComposite:0,feConvolveMatrix:0,feDiffuseLighting:0,feDisplacementMap:0,feDistantLight:0,feFlood:0,feFuncA:0,feFuncB:0,feFuncG:0,feFuncR:0,feGaussianBlur:0,feImage:0,feMerge:0,feMergeNode:0,feMorphology:0,feOffset:0,fePointLight:0,feSpecularLighting:0,feSpotLight:0,feTile:0,feTurbulence:0,filter:0,foreignObject:0,g:0,image:0,line:0,linearGradient:0,marker:0,mask:0,metadata:0,path:0,pattern:0,polygon:0,polyline:0,radialGradient:0,rect:0,stop:0,svg:0,switch:0,symbol:0,text:0,textPath:0,tspan:0,use:0,view:0},uh=/^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;function ci(t){const e=document.createDocumentFragment();return li(t.children,e),e}function fh(t,e,r){e={...e,children:r};const n=new t(e),i=n.render();return"ref"in e&&Ws(e.ref,n),i}function O(t,e){let{children:r,...n}=e;!n.namespaceURI&&lh[t]===0&&(n={...n,namespaceURI:oh});let i;if(ai(t)){if(i=n.namespaceURI?document.createElementNS(n.namespaceURI,t):document.createElement(t),mh(n,i),li(r,i),i instanceof window.HTMLSelectElement&&n.value!=null)if(n.multiple===!0&&Array.isArray(n.value)){const s=n.value.map(o=>String(o));i.querySelectorAll("option").forEach(o=>o.selected=s.includes(o.value))}else i.value=n.value;Ws(n.ref,i)}else if(mn(t))mr(t.defaultProps)&&(n={...t.defaultProps,...n}),i=Zd(t)?fh(t,n,r):t({...n,children:r});else throw new TypeError(`Invalid JSX element type: ${t}`);return i}function dh(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return(ai(e)||Array.isArray(e))&&(n.unshift(e),e={}),e=e||{},e.children!=null&&!n.length&&({children:n,...e}=e),O(t,{...e,children:n},e.key)}function Ws(t,e){th(t)?t.current=e:mn(t)&&t(e)}function li(t,e){if(eh(t))hh(t,e);else if(ai(t)||Ha(t))qs(document.createTextNode(t),e);else if(t===null)qs(document.createComment(""),e);else if(Xd(t))qs(t,e);else if(sh(t)){const r=e.attachShadow(t.attr);li(t.children,r),Ws(t.ref,r)}}function hh(t,e){for(const r of[...t])li(r,e);return e}function qs(t,e){e instanceof window.HTMLTemplateElement?e.content.appendChild(t):e.appendChild(t)}function ui(t,e){return t.replace(/[A-Z]/g,r=>e+r.toLowerCase())}function Ka(t,e){e==null||e===!1||(Array.isArray(e)?e.forEach(r=>Ka(t,r)):ai(e)?t.setAttribute("style",e):mr(e)&&Fs(e,(r,n)=>{n.indexOf("-")===0?t.style.setProperty(n,r):Ha(r)&&Bs[n]!==0?t.style[n]=r+"px":t.style[n]=r}))}function ph(t,e,r){switch(t){case"xlinkActuate":case"xlinkArcrole":case"xlinkHref":case"xlinkRole":case"xlinkShow":case"xlinkTitle":case"xlinkType":Ja(r,ah,ui(t,":"),e);return;case"xmlnsXlink":Nr(r,ui(t,":"),e);return;case"xmlBase":case"xmlLang":case"xmlSpace":Ja(r,ch,ui(t,":"),e);return}switch(t){case"htmlFor":Nr(r,"for",e);return;case"dataset":Fs(e,(n,i)=>{n!=null&&(r.dataset[i]=n)});return;case"innerHTML":case"innerText":case"textContent":Va(e)&&(r[t]=e);return;case"dangerouslySetInnerHTML":mr(e)&&(r.innerHTML=e.__html);return;case"value":if(e==null||r instanceof window.HTMLSelectElement)return;if(r instanceof window.HTMLTextAreaElement){r.value=e;return}break;case"spellCheck":r.spellcheck=e;return;case"class":case"className":mn(e)?e(r):Nr(r,"class",Us(e));return;case"ref":case"namespaceURI":return;case"style":Ka(r,e);return;case"on":case"onCapture":Fs(e,(n,i)=>{r.addEventListener(i,n,t==="onCapture")});return}if(mn(e)){if(t[0]==="o"&&t[1]==="n"){let n=t.toLowerCase();const i=n.endsWith("capture");if(n==="ondoubleclick"?n="ondblclick":i&&n==="ondoubleclickcapture"&&(n="ondblclickcapture"),!i&&r[n]===null)r[n]=e;else if(i)r.addEventListener(n.substring(2,n.length-7),e,!0);else{let s;n in window?s=n.substring(2):s=n[2]+t.slice(3),r.addEventListener(s,e)}}}else mr(e)?r[t]=e:e===!0?Nr(r,t,""):e!==!1&&e!=null&&(r instanceof SVGElement&&!uh.test(t)?Nr(r,ui(t,"-"),e):Nr(r,t,e))}function Nr(t,e,r){t.setAttribute(e,r)}function Ja(t,e,r,n){t.setAttributeNS(e,r,n)}function mh(t,e){for(const r of oi(t))ph(r,t[r],e);return e}var Dr=(t=>(t.ANALYTICS_API_BASE="https://analytics.ipe.wiki/api",t.ANALYTICS_DASH_URL="https://analytics.ipe.wiki",t.GITHUB_URL="https://github.com/inpageedit/inpageedit-v2",t.HOME_URL="https://www.ipe.wiki/",t.PLUGIN_CDN_BASE="https://ipe-plugins.js.org",t.PLUGIN_HOME_URL="https://github.com/inpageedit/Plugins",t.SPECIAL_NOTICE_JSON="https://ipe-plugins.js.org/specialNotice.json",t.UPDATE_LOGS_URL="https://www.ipe.wiki/update/",t))(Dr||{});const gh={ipe_progress:"_ipe_progress_so6hn_1"},gr=t=>{const e=t.indeterminate??!0,r=O("div",{class:`${gh.ipe_progress}`,"data-indeterminate":`${e}`,style:{width:"100%","--progress":t.progress?`${t.progress}%`:"0%"},...t});return r.setProgress=n=>{typeof n=="number"?(r.dataset.indeterminate="false",r.style.setProperty("--progress",`${n}%`)):(r.dataset.indeterminate="true",r.style.setProperty("--progress","0%"))},r},ca=class ca{constructor(e){this.ctx=e,this.start(),this.ctx.on("dispose",()=>{this.stop()})}start(){const{promise:e,resolve:r}=Promise.withResolvers();return window.ssi_modal&&typeof window.ssi_modal.show=="function"?r(window.ssi_modal):(this.ctx.resourceLoader.loadStyle(`${Dr.PLUGIN_CDN_BASE}/lib/ssi-modal/ssi-modal.css`),this.ctx.resourceLoader.loadScript(`${Dr.PLUGIN_CDN_BASE}/lib/ssi-modal/ssi-modal.js`,{async:""}).then(()=>{r(window.ssi_modal)})),e.then(n=>{this.hackSsiModal(n),this.ctx.set("modal",n),this.modal=n})}stop(){this.modal?.closeAll()}hackSsiModal(e){const r=this,n=e.proto.init;e.proto.init=function(){var o;return console.log("init",this),(o=this.options).className||(o.className=""),this.options.className+=" in-page-edit theme-ipe",n.call(this)};const i=e.proto.show;e.proto.show=function(){return r.ctx.emit("modal/show",{modal:this}),i.call(this)};const s=e.proto.close;return e.proto.close=function(){return r.ctx.emit("modal/close",{modal:this}),s.call(this)},e.proto.setLoadingState=function(o){if(this.get$window().toggleClass("loading",o),o){const a=this.get$window().find("input:not([disabled]),button:not([disabled])");this.get$modal().data("inputsAndButtons",a),a.prop("disabled",!0),this.get$window().append(O("div",{id:"ssi-modalLoadingWrapper",style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.5)",zIndex:2e3},children:O(gr,{style:{width:"80%",maxWidth:"800px"}})}))}else{this.get$window().find("#ssi-modalLoadingWrapper").remove();const a=this.get$modal().data("inputsAndButtons");a&&a.prop("disabled",!1)}},e}};ca.inject=["resourceLoader"];let Hs=ca;function fi(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zs={exports:{}};/*!
27
27
  localForage -- Offline Storage, Improved
28
28
  Version 1.10.0
29
29
  https://localforage.github.io/localForage
30
30
  (c) 2013-2017 Mozilla, Apache License 2.0
31
- */var Ka;function rh(){return Ka||(Ka=1,function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,s){function o(l,u){if(!i[l]){if(!n[l]){var f=typeof fi=="function"&&fi;if(!u&&f)return f(l,!0);if(a)return a(l,!0);var v=new Error("Cannot find module '"+l+"'");throw v.code="MODULE_NOT_FOUND",v}var y=i[l]={exports:{}};n[l][0].call(y.exports,function(b){var R=n[l][1][b];return o(R||b)},y,y.exports,r,n,i,s)}return i[l].exports}for(var a=typeof fi=="function"&&fi,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(r,n,i){(function(s){var o=s.MutationObserver||s.WebKitMutationObserver,a;if(o){var c=0,l=new o(b),u=s.document.createTextNode("");l.observe(u,{characterData:!0}),a=function(){u.data=c=++c%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var f=new s.MessageChannel;f.port1.onmessage=b,a=function(){f.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?a=function(){var H=s.document.createElement("script");H.onreadystatechange=function(){b(),H.onreadystatechange=null,H.parentNode.removeChild(H),H=null},s.document.documentElement.appendChild(H)}:a=function(){setTimeout(b,0)};var v,y=[];function b(){v=!0;for(var H,B,N=y.length;N;){for(B=y,y=[],H=-1;++H<N;)B[H]();N=y.length}v=!1}n.exports=R;function R(H){y.push(H)===1&&!v&&a()}}).call(this,typeof Ir<"u"?Ir:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var s=r(1);function o(){}var a={},c=["REJECTED"],l=["FULFILLED"],u=["PENDING"];n.exports=f;function f(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,h!==o&&R(this,h)}f.prototype.catch=function(h){return this.then(null,h)},f.prototype.then=function(h,C){if(typeof h!="function"&&this.state===l||typeof C!="function"&&this.state===c)return this;var I=new this.constructor(o);if(this.state!==u){var T=this.state===l?h:C;y(I,T,this.outcome)}else this.queue.push(new v(I,h,C));return I};function v(h,C,I){this.promise=h,typeof C=="function"&&(this.onFulfilled=C,this.callFulfilled=this.otherCallFulfilled),typeof I=="function"&&(this.onRejected=I,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(h){a.resolve(this.promise,h)},v.prototype.otherCallFulfilled=function(h){y(this.promise,this.onFulfilled,h)},v.prototype.callRejected=function(h){a.reject(this.promise,h)},v.prototype.otherCallRejected=function(h){y(this.promise,this.onRejected,h)};function y(h,C,I){s(function(){var T;try{T=C(I)}catch(J){return a.reject(h,J)}T===h?a.reject(h,new TypeError("Cannot resolve promise with itself")):a.resolve(h,T)})}a.resolve=function(h,C){var I=H(b,C);if(I.status==="error")return a.reject(h,I.value);var T=I.value;if(T)R(h,T);else{h.state=l,h.outcome=C;for(var J=-1,re=h.queue.length;++J<re;)h.queue[J].callFulfilled(C)}return h},a.reject=function(h,C){h.state=c,h.outcome=C;for(var I=-1,T=h.queue.length;++I<T;)h.queue[I].callRejected(C);return h};function b(h){var C=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof C=="function")return function(){C.apply(h,arguments)}}function R(h,C){var I=!1;function T(Ne){I||(I=!0,a.reject(h,Ne))}function J(Ne){I||(I=!0,a.resolve(h,Ne))}function re(){C(J,T)}var ke=H(re);ke.status==="error"&&T(ke.value)}function H(h,C){var I={};try{I.value=h(C),I.status="success"}catch(T){I.status="error",I.value=T}return I}f.resolve=B;function B(h){return h instanceof this?h:a.resolve(new this(o),h)}f.reject=N;function N(h){var C=new this(o);return a.reject(C,h)}f.all=g;function g(h){var C=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var I=h.length,T=!1;if(!I)return this.resolve([]);for(var J=new Array(I),re=0,ke=-1,Ne=new this(o);++ke<I;)Ve(h[ke],ke);return Ne;function Ve(Ge,ht){C.resolve(Ge).then(Te,function(ve){T||(T=!0,a.reject(Ne,ve))});function Te(ve){J[ht]=ve,++re===I&&!T&&(T=!0,a.resolve(Ne,J))}}}f.race=m;function m(h){var C=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var I=h.length,T=!1;if(!I)return this.resolve([]);for(var J=-1,re=new this(o);++J<I;)ke(h[J]);return re;function ke(Ne){C.resolve(Ne).then(function(Ve){T||(T=!0,a.resolve(re,Ve))},function(Ve){T||(T=!0,a.reject(re,Ve))})}}},{1:1}],3:[function(r,n,i){(function(s){typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof Ir<"u"?Ir:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};function o(d,w){if(!(d instanceof w))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=a();function l(){try{if(!c||!c.open)return!1;var d=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),w=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!d||w)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function u(d,w){d=d||[],w=w||{};try{return new Blob(d,w)}catch(x){if(x.name!=="TypeError")throw x;for(var p=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,E=new p,P=0;P<d.length;P+=1)E.append(d[P]);return E.getBlob(w.type)}}typeof Promise>"u"&&r(3);var f=Promise;function v(d,w){w&&d.then(function(p){w(null,p)},function(p){w(p)})}function y(d,w,p){typeof w=="function"&&d.then(w),typeof p=="function"&&d.catch(p)}function b(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}function R(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var H="local-forage-detect-blob-support",B=void 0,N={},g=Object.prototype.toString,m="readonly",h="readwrite";function C(d){for(var w=d.length,p=new ArrayBuffer(w),E=new Uint8Array(p),P=0;P<w;P++)E[P]=d.charCodeAt(P);return p}function I(d){return new f(function(w){var p=d.transaction(H,h),E=u([""]);p.objectStore(H).put(E,"key"),p.onabort=function(P){P.preventDefault(),P.stopPropagation(),w(!1)},p.oncomplete=function(){var P=navigator.userAgent.match(/Chrome\/(\d+)/),x=navigator.userAgent.match(/Edge\//);w(x||!P||parseInt(P[1],10)>=43)}}).catch(function(){return!1})}function T(d){return typeof B=="boolean"?f.resolve(B):I(d).then(function(w){return B=w,B})}function J(d){var w=N[d.name],p={};p.promise=new f(function(E,P){p.resolve=E,p.reject=P}),w.deferredOperations.push(p),w.dbReady?w.dbReady=w.dbReady.then(function(){return p.promise}):w.dbReady=p.promise}function re(d){var w=N[d.name],p=w.deferredOperations.pop();if(p)return p.resolve(),p.promise}function ke(d,w){var p=N[d.name],E=p.deferredOperations.pop();if(E)return E.reject(w),E.promise}function Ne(d,w){return new f(function(p,E){if(N[d.name]=N[d.name]||Qe(),d.db)if(w)J(d),d.db.close();else return p(d.db);var P=[d.name];w&&P.push(d.version);var x=c.open.apply(c,P);w&&(x.onupgradeneeded=function(L){var W=x.result;try{W.createObjectStore(d.storeName),L.oldVersion<=1&&W.createObjectStore(H)}catch(q){if(q.name==="ConstraintError")console.warn('The database "'+d.name+'" has been upgraded from version '+L.oldVersion+" to version "+L.newVersion+', but the storage "'+d.storeName+'" already exists.');else throw q}}),x.onerror=function(L){L.preventDefault(),E(x.error)},x.onsuccess=function(){var L=x.result;L.onversionchange=function(W){W.target.close()},p(L),re(d)}})}function Ve(d){return Ne(d,!1)}function Ge(d){return Ne(d,!0)}function ht(d,w){if(!d.db)return!0;var p=!d.db.objectStoreNames.contains(d.storeName),E=d.version<d.db.version,P=d.version>d.db.version;if(E&&(d.version!==w&&console.warn('The database "'+d.name+`" can't be downgraded from version `+d.db.version+" to version "+d.version+"."),d.version=d.db.version),P||p){if(p){var x=d.db.version+1;x>d.version&&(d.version=x)}return!0}return!1}function Te(d){return new f(function(w,p){var E=new FileReader;E.onerror=p,E.onloadend=function(P){var x=btoa(P.target.result||"");w({__local_forage_encoded_blob:!0,data:x,type:d.type})},E.readAsBinaryString(d)})}function ve(d){var w=C(atob(d.data));return u([w],{type:d.type})}function _e(d){return d&&d.__local_forage_encoded_blob}function pt(d){var w=this,p=w._initReady().then(function(){var E=N[w._dbInfo.name];if(E&&E.dbReady)return E.dbReady});return y(p,d,d),p}function Qt(d){J(d);for(var w=N[d.name],p=w.forages,E=0;E<p.length;E++){var P=p[E];P._dbInfo.db&&(P._dbInfo.db.close(),P._dbInfo.db=null)}return d.db=null,Ve(d).then(function(x){return d.db=x,ht(d)?Ge(d):x}).then(function(x){d.db=w.db=x;for(var L=0;L<p.length;L++)p[L]._dbInfo.db=x}).catch(function(x){throw ke(d,x),x})}function je(d,w,p,E){E===void 0&&(E=1);try{var P=d.db.transaction(d.storeName,w);p(null,P)}catch(x){if(E>0&&(!d.db||x.name==="InvalidStateError"||x.name==="NotFoundError"))return f.resolve().then(function(){if(!d.db||x.name==="NotFoundError"&&!d.db.objectStoreNames.contains(d.storeName)&&d.version<=d.db.version)return d.db&&(d.version=d.db.version+1),Ge(d)}).then(function(){return Qt(d).then(function(){je(d,w,p,E-1)})}).catch(p);p(x)}}function Qe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function an(d){var w=this,p={db:null};if(d)for(var E in d)p[E]=d[E];var P=N[p.name];P||(P=Qe(),N[p.name]=P),P.forages.push(w),w._initReady||(w._initReady=w.ready,w.ready=pt);var x=[];function L(){return f.resolve()}for(var W=0;W<P.forages.length;W++){var q=P.forages[W];q!==w&&x.push(q._initReady().catch(L))}var z=P.forages.slice(0);return f.all(x).then(function(){return p.db=P.db,Ve(p)}).then(function(G){return p.db=G,ht(p,w._defaultConfig.version)?Ge(p):G}).then(function(G){p.db=P.db=G,w._dbInfo=p;for(var ee=0;ee<z.length;ee++){var fe=z[ee];fe!==w&&(fe._dbInfo.db=p.db,fe._dbInfo.version=p.version)}})}function cn(d,w){var p=this;d=b(d);var E=new f(function(P,x){p.ready().then(function(){je(p._dbInfo,m,function(L,W){if(L)return x(L);try{var q=W.objectStore(p._dbInfo.storeName),z=q.get(d);z.onsuccess=function(){var G=z.result;G===void 0&&(G=null),_e(G)&&(G=ve(G)),P(G)},z.onerror=function(){x(z.error)}}catch(G){x(G)}})}).catch(x)});return v(E,w),E}function qn(d,w){var p=this,E=new f(function(P,x){p.ready().then(function(){je(p._dbInfo,m,function(L,W){if(L)return x(L);try{var q=W.objectStore(p._dbInfo.storeName),z=q.openCursor(),G=1;z.onsuccess=function(){var ee=z.result;if(ee){var fe=ee.value;_e(fe)&&(fe=ve(fe));var Se=d(fe,ee.key,G++);Se!==void 0?P(Se):ee.continue()}else P()},z.onerror=function(){x(z.error)}}catch(ee){x(ee)}})}).catch(x)});return v(E,w),E}function rt(d,w,p){var E=this;d=b(d);var P=new f(function(x,L){var W;E.ready().then(function(){return W=E._dbInfo,g.call(w)==="[object Blob]"?T(W.db).then(function(q){return q?w:Te(w)}):w}).then(function(q){je(E._dbInfo,h,function(z,G){if(z)return L(z);try{var ee=G.objectStore(E._dbInfo.storeName);q===null&&(q=void 0);var fe=ee.put(q,d);G.oncomplete=function(){q===void 0&&(q=null),x(q)},G.onabort=G.onerror=function(){var Se=fe.error?fe.error:fe.transaction.error;L(Se)}}catch(Se){L(Se)}})}).catch(L)});return v(P,p),P}function Mt(d,w){var p=this;d=b(d);var E=new f(function(P,x){p.ready().then(function(){je(p._dbInfo,h,function(L,W){if(L)return x(L);try{var q=W.objectStore(p._dbInfo.storeName),z=q.delete(d);W.oncomplete=function(){P()},W.onerror=function(){x(z.error)},W.onabort=function(){var G=z.error?z.error:z.transaction.error;x(G)}}catch(G){x(G)}})}).catch(x)});return v(E,w),E}function Or(d){var w=this,p=new f(function(E,P){w.ready().then(function(){je(w._dbInfo,h,function(x,L){if(x)return P(x);try{var W=L.objectStore(w._dbInfo.storeName),q=W.clear();L.oncomplete=function(){E()},L.onabort=L.onerror=function(){var z=q.error?q.error:q.transaction.error;P(z)}}catch(z){P(z)}})}).catch(P)});return v(p,d),p}function Cr(d){var w=this,p=new f(function(E,P){w.ready().then(function(){je(w._dbInfo,m,function(x,L){if(x)return P(x);try{var W=L.objectStore(w._dbInfo.storeName),q=W.count();q.onsuccess=function(){E(q.result)},q.onerror=function(){P(q.error)}}catch(z){P(z)}})}).catch(P)});return v(p,d),p}function Xt(d,w){var p=this,E=new f(function(P,x){if(d<0){P(null);return}p.ready().then(function(){je(p._dbInfo,m,function(L,W){if(L)return x(L);try{var q=W.objectStore(p._dbInfo.storeName),z=!1,G=q.openKeyCursor();G.onsuccess=function(){var ee=G.result;if(!ee){P(null);return}d===0||z?P(ee.key):(z=!0,ee.advance(d))},G.onerror=function(){x(G.error)}}catch(ee){x(ee)}})}).catch(x)});return v(E,w),E}function fs(d){var w=this,p=new f(function(E,P){w.ready().then(function(){je(w._dbInfo,m,function(x,L){if(x)return P(x);try{var W=L.objectStore(w._dbInfo.storeName),q=W.openKeyCursor(),z=[];q.onsuccess=function(){var G=q.result;if(!G){E(z);return}z.push(G.key),G.continue()},q.onerror=function(){P(q.error)}}catch(G){P(G)}})}).catch(P)});return v(p,d),p}function _(d,w){w=R.apply(this,arguments);var p=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||p.name,d.storeName=d.storeName||p.storeName);var E=this,P;if(!d.name)P=f.reject("Invalid arguments");else{var x=d.name===p.name&&E._dbInfo.db,L=x?f.resolve(E._dbInfo.db):Ve(d).then(function(W){var q=N[d.name],z=q.forages;q.db=W;for(var G=0;G<z.length;G++)z[G]._dbInfo.db=W;return W});d.storeName?P=L.then(function(W){if(W.objectStoreNames.contains(d.storeName)){var q=W.version+1;J(d);var z=N[d.name],G=z.forages;W.close();for(var ee=0;ee<G.length;ee++){var fe=G[ee];fe._dbInfo.db=null,fe._dbInfo.version=q}var Se=new f(function(Oe,Ue){var Me=c.open(d.name,q);Me.onerror=function(wt){var Xn=Me.result;Xn.close(),Ue(wt)},Me.onupgradeneeded=function(){var wt=Me.result;wt.deleteObjectStore(d.storeName)},Me.onsuccess=function(){var wt=Me.result;wt.close(),Oe(wt)}});return Se.then(function(Oe){z.db=Oe;for(var Ue=0;Ue<G.length;Ue++){var Me=G[Ue];Me._dbInfo.db=Oe,re(Me._dbInfo)}}).catch(function(Oe){throw(ke(d,Oe)||f.resolve()).catch(function(){}),Oe})}}):P=L.then(function(W){J(d);var q=N[d.name],z=q.forages;W.close();for(var G=0;G<z.length;G++){var ee=z[G];ee._dbInfo.db=null}var fe=new f(function(Se,Oe){var Ue=c.deleteDatabase(d.name);Ue.onerror=function(){var Me=Ue.result;Me&&Me.close(),Oe(Ue.error)},Ue.onblocked=function(){console.warn('dropInstance blocked for database "'+d.name+'" until all open connections are closed')},Ue.onsuccess=function(){var Me=Ue.result;Me&&Me.close(),Se(Me)}});return fe.then(function(Se){q.db=Se;for(var Oe=0;Oe<z.length;Oe++){var Ue=z[Oe];re(Ue._dbInfo)}}).catch(function(Se){throw(ke(d,Se)||f.resolve()).catch(function(){}),Se})})}return v(P,w),P}var S={_driver:"asyncStorage",_initStorage:an,_support:l(),iterate:qn,getItem:cn,setItem:rt,removeItem:Mt,clear:Or,length:Cr,key:Xt,keys:fs,dropInstance:_};function D(){return typeof openDatabase=="function"}var F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="~~local_forage_type~",M=/^~~local_forage_type~([^~]+)~/,K="__lfsc__:",Y=K.length,V="arbf",U="blob",ne="si08",X="ui08",te="uic8",ie="si16",ue="si32",we="ur16",me="ui32",Ae="fl32",Le="fl64",Xe=Y+V.length,nt=Object.prototype.toString;function Ft(d){var w=d.length*.75,p=d.length,E,P=0,x,L,W,q;d[d.length-1]==="="&&(w--,d[d.length-2]==="="&&w--);var z=new ArrayBuffer(w),G=new Uint8Array(z);for(E=0;E<p;E+=4)x=F.indexOf(d[E]),L=F.indexOf(d[E+1]),W=F.indexOf(d[E+2]),q=F.indexOf(d[E+3]),G[P++]=x<<2|L>>4,G[P++]=(L&15)<<4|W>>2,G[P++]=(W&3)<<6|q&63;return z}function jt(d){var w=new Uint8Array(d),p="",E;for(E=0;E<w.length;E+=3)p+=F[w[E]>>2],p+=F[(w[E]&3)<<4|w[E+1]>>4],p+=F[(w[E+1]&15)<<2|w[E+2]>>6],p+=F[w[E+2]&63];return w.length%3===2?p=p.substring(0,p.length-1)+"=":w.length%3===1&&(p=p.substring(0,p.length-2)+"=="),p}function Be(d,w){var p="";if(d&&(p=nt.call(d)),d&&(p==="[object ArrayBuffer]"||d.buffer&&nt.call(d.buffer)==="[object ArrayBuffer]")){var E,P=K;d instanceof ArrayBuffer?(E=d,P+=V):(E=d.buffer,p==="[object Int8Array]"?P+=ne:p==="[object Uint8Array]"?P+=X:p==="[object Uint8ClampedArray]"?P+=te:p==="[object Int16Array]"?P+=ie:p==="[object Uint16Array]"?P+=we:p==="[object Int32Array]"?P+=ue:p==="[object Uint32Array]"?P+=me:p==="[object Float32Array]"?P+=Ae:p==="[object Float64Array]"?P+=Le:w(new Error("Failed to get type for BinaryArray"))),w(P+jt(E))}else if(p==="[object Blob]"){var x=new FileReader;x.onload=function(){var L=j+d.type+"~"+jt(this.result);w(K+U+L)},x.readAsArrayBuffer(d)}else try{w(JSON.stringify(d))}catch(L){console.error("Couldn't convert value into a JSON string: ",d),w(null,L)}}function k(d){if(d.substring(0,Y)!==K)return JSON.parse(d);var w=d.substring(Xe),p=d.substring(Y,Xe),E;if(p===U&&M.test(w)){var P=w.match(M);E=P[1],w=w.substring(P[0].length)}var x=Ft(w);switch(p){case V:return x;case U:return u([x],{type:E});case ne:return new Int8Array(x);case X:return new Uint8Array(x);case te:return new Uint8ClampedArray(x);case ie:return new Int16Array(x);case we:return new Uint16Array(x);case ue:return new Int32Array(x);case me:return new Uint32Array(x);case Ae:return new Float32Array(x);case Le:return new Float64Array(x);default:throw new Error("Unkown type: "+p)}}var A={serialize:Be,deserialize:k,stringToBuffer:Ft,bufferToString:jt};function de(d,w,p,E){d.executeSql("CREATE TABLE IF NOT EXISTS "+w.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],p,E)}function Ce(d){var w=this,p={db:null};if(d)for(var E in d)p[E]=typeof d[E]!="string"?d[E].toString():d[E];var P=new f(function(x,L){try{p.db=openDatabase(p.name,String(p.version),p.description,p.size)}catch(W){return L(W)}p.db.transaction(function(W){de(W,p,function(){w._dbInfo=p,x()},function(q,z){L(z)})},L)});return p.serializer=A,P}function ge(d,w,p,E,P,x){d.executeSql(p,E,P,function(L,W){W.code===W.SYNTAX_ERR?L.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[w.storeName],function(q,z){z.rows.length?x(q,W):de(q,w,function(){q.executeSql(p,E,P,x)},x)},x):x(L,W)},x)}function le(d,w){var p=this;d=b(d);var E=new f(function(P,x){p.ready().then(function(){var L=p._dbInfo;L.db.transaction(function(W){ge(W,L,"SELECT * FROM "+L.storeName+" WHERE key = ? LIMIT 1",[d],function(q,z){var G=z.rows.length?z.rows.item(0).value:null;G&&(G=L.serializer.deserialize(G)),P(G)},function(q,z){x(z)})})}).catch(x)});return v(E,w),E}function Bt(d,w){var p=this,E=new f(function(P,x){p.ready().then(function(){var L=p._dbInfo;L.db.transaction(function(W){ge(W,L,"SELECT * FROM "+L.storeName,[],function(q,z){for(var G=z.rows,ee=G.length,fe=0;fe<ee;fe++){var Se=G.item(fe),Oe=Se.value;if(Oe&&(Oe=L.serializer.deserialize(Oe)),Oe=d(Oe,Se.key,fe+1),Oe!==void 0){P(Oe);return}}P()},function(q,z){x(z)})})}).catch(x)});return v(E,w),E}function Ut(d,w,p,E){var P=this;d=b(d);var x=new f(function(L,W){P.ready().then(function(){w===void 0&&(w=null);var q=w,z=P._dbInfo;z.serializer.serialize(w,function(G,ee){ee?W(ee):z.db.transaction(function(fe){ge(fe,z,"INSERT OR REPLACE INTO "+z.storeName+" (key, value) VALUES (?, ?)",[d,G],function(){L(q)},function(Se,Oe){W(Oe)})},function(fe){if(fe.code===fe.QUOTA_ERR){if(E>0){L(Ut.apply(P,[d,q,p,E-1]));return}W(fe)}})})}).catch(W)});return v(x,p),x}function it(d,w,p){return Ut.apply(this,[d,w,p,1])}function Wt(d,w){var p=this;d=b(d);var E=new f(function(P,x){p.ready().then(function(){var L=p._dbInfo;L.db.transaction(function(W){ge(W,L,"DELETE FROM "+L.storeName+" WHERE key = ?",[d],function(){P()},function(q,z){x(z)})})}).catch(x)});return v(E,w),E}function Hn(d){var w=this,p=new f(function(E,P){w.ready().then(function(){var x=w._dbInfo;x.db.transaction(function(L){ge(L,x,"DELETE FROM "+x.storeName,[],function(){E()},function(W,q){P(q)})})}).catch(P)});return v(p,d),p}function ur(d){var w=this,p=new f(function(E,P){w.ready().then(function(){var x=w._dbInfo;x.db.transaction(function(L){ge(L,x,"SELECT COUNT(key) as c FROM "+x.storeName,[],function(W,q){var z=q.rows.item(0).c;E(z)},function(W,q){P(q)})})}).catch(P)});return v(p,d),p}function mt(d,w){var p=this,E=new f(function(P,x){p.ready().then(function(){var L=p._dbInfo;L.db.transaction(function(W){ge(W,L,"SELECT key FROM "+L.storeName+" WHERE id = ? LIMIT 1",[d+1],function(q,z){var G=z.rows.length?z.rows.item(0).key:null;P(G)},function(q,z){x(z)})})}).catch(x)});return v(E,w),E}function ds(d){var w=this,p=new f(function(E,P){w.ready().then(function(){var x=w._dbInfo;x.db.transaction(function(L){ge(L,x,"SELECT key FROM "+x.storeName,[],function(W,q){for(var z=[],G=0;G<q.rows.length;G++)z.push(q.rows.item(G).key);E(z)},function(W,q){P(q)})})}).catch(P)});return v(p,d),p}function hs(d){return new f(function(w,p){d.transaction(function(E){E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(P,x){for(var L=[],W=0;W<x.rows.length;W++)L.push(x.rows.item(W).name);w({db:d,storeNames:L})},function(P,x){p(x)})},function(E){p(E)})})}function ps(d,w){w=R.apply(this,arguments);var p=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||p.name,d.storeName=d.storeName||p.storeName);var E=this,P;return d.name?P=new f(function(x){var L;d.name===p.name?L=E._dbInfo.db:L=openDatabase(d.name,"","",0),d.storeName?x({db:L,storeNames:[d.storeName]}):x(hs(L))}).then(function(x){return new f(function(L,W){x.db.transaction(function(q){function z(Se){return new f(function(Oe,Ue){q.executeSql("DROP TABLE IF EXISTS "+Se,[],function(){Oe()},function(Me,wt){Ue(wt)})})}for(var G=[],ee=0,fe=x.storeNames.length;ee<fe;ee++)G.push(z(x.storeNames[ee]));f.all(G).then(function(){L()}).catch(function(Se){W(Se)})},function(q){W(q)})})}):P=f.reject("Invalid arguments"),v(P,w),P}var Pr={_driver:"webSQLStorage",_initStorage:Ce,_support:D(),iterate:Bt,getItem:le,setItem:it,removeItem:Wt,clear:Hn,length:ur,key:mt,keys:ds,dropInstance:ps};function zn(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function $r(d,w){var p=d.name+"/";return d.storeName!==w.storeName&&(p+=d.storeName+"/"),p}function Vn(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function Kn(){return!Vn()||localStorage.length>0}function ms(d){var w=this,p={};if(d)for(var E in d)p[E]=d[E];return p.keyPrefix=$r(d,w._defaultConfig),Kn()?(w._dbInfo=p,p.serializer=A,f.resolve()):f.reject()}function gs(d){var w=this,p=w.ready().then(function(){for(var E=w._dbInfo.keyPrefix,P=localStorage.length-1;P>=0;P--){var x=localStorage.key(P);x.indexOf(E)===0&&localStorage.removeItem(x)}});return v(p,d),p}function Jn(d,w){var p=this;d=b(d);var E=p.ready().then(function(){var P=p._dbInfo,x=localStorage.getItem(P.keyPrefix+d);return x&&(x=P.serializer.deserialize(x)),x});return v(E,w),E}function ys(d,w){var p=this,E=p.ready().then(function(){for(var P=p._dbInfo,x=P.keyPrefix,L=x.length,W=localStorage.length,q=1,z=0;z<W;z++){var G=localStorage.key(z);if(G.indexOf(x)===0){var ee=localStorage.getItem(G);if(ee&&(ee=P.serializer.deserialize(ee)),ee=d(ee,G.substring(L),q++),ee!==void 0)return ee}}});return v(E,w),E}function Yn(d,w){var p=this,E=p.ready().then(function(){var P=p._dbInfo,x;try{x=localStorage.key(d)}catch{x=null}return x&&(x=x.substring(P.keyPrefix.length)),x});return v(E,w),E}function vs(d){var w=this,p=w.ready().then(function(){for(var E=w._dbInfo,P=localStorage.length,x=[],L=0;L<P;L++){var W=localStorage.key(L);W.indexOf(E.keyPrefix)===0&&x.push(W.substring(E.keyPrefix.length))}return x});return v(p,d),p}function fa(d){var w=this,p=w.keys().then(function(E){return E.length});return v(p,d),p}function Gn(d,w){var p=this;d=b(d);var E=p.ready().then(function(){var P=p._dbInfo;localStorage.removeItem(P.keyPrefix+d)});return v(E,w),E}function fr(d,w,p){var E=this;d=b(d);var P=E.ready().then(function(){w===void 0&&(w=null);var x=w;return new f(function(L,W){var q=E._dbInfo;q.serializer.serialize(w,function(z,G){if(G)W(G);else try{localStorage.setItem(q.keyPrefix+d,z),L(x)}catch(ee){(ee.name==="QuotaExceededError"||ee.name==="NS_ERROR_DOM_QUOTA_REACHED")&&W(ee),W(ee)}})})});return v(P,p),P}function ln(d,w){if(w=R.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var p=this.config();d.name=d.name||p.name,d.storeName=d.storeName||p.storeName}var E=this,P;return d.name?P=new f(function(x){d.storeName?x($r(d,E._defaultConfig)):x(d.name+"/")}).then(function(x){for(var L=localStorage.length-1;L>=0;L--){var W=localStorage.key(L);W.indexOf(x)===0&&localStorage.removeItem(W)}}):P=f.reject("Invalid arguments"),v(P,w),P}var da={_driver:"localStorageWrapper",_initStorage:ms,_support:zn(),iterate:ys,getItem:Jn,setItem:fr,removeItem:Gn,clear:gs,length:fa,key:Yn,keys:vs,dropInstance:ln},bs=function(w,p){return w===p||typeof w=="number"&&typeof p=="number"&&isNaN(w)&&isNaN(p)},Av=function(w,p){for(var E=w.length,P=0;P<E;){if(bs(w[P],p))return!0;P++}return!1},uf=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},Qn={},ff={},un={INDEXEDDB:S,WEBSQL:Pr,LOCALSTORAGE:da},Tv=[un.INDEXEDDB._driver,un.WEBSQL._driver,un.LOCALSTORAGE._driver],_s=["dropInstance"],ha=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_s),Rv={description:"",driver:Tv.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Dv(d,w){d[w]=function(){var p=arguments;return d.ready().then(function(){return d[w].apply(d,p)})}}function pa(){for(var d=1;d<arguments.length;d++){var w=arguments[d];if(w)for(var p in w)w.hasOwnProperty(p)&&(uf(w[p])?arguments[0][p]=w[p].slice():arguments[0][p]=w[p])}return arguments[0]}var Nv=function(){function d(w){o(this,d);for(var p in un)if(un.hasOwnProperty(p)){var E=un[p],P=E._driver;this[p]=P,Qn[P]||this.defineDriver(E)}this._defaultConfig=pa({},Rv),this._config=pa({},this._defaultConfig,w),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return d.prototype.config=function(p){if((typeof p>"u"?"undefined":s(p))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var E in p){if(E==="storeName"&&(p[E]=p[E].replace(/\W/g,"_")),E==="version"&&typeof p[E]!="number")return new Error("Database version must be a number.");this._config[E]=p[E]}return"driver"in p&&p.driver?this.setDriver(this._config.driver):!0}else return typeof p=="string"?this._config[p]:this._config},d.prototype.defineDriver=function(p,E,P){var x=new f(function(L,W){try{var q=p._driver,z=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!p._driver){W(z);return}for(var G=ha.concat("_initStorage"),ee=0,fe=G.length;ee<fe;ee++){var Se=G[ee],Oe=!Av(_s,Se);if((Oe||p[Se])&&typeof p[Se]!="function"){W(z);return}}var Ue=function(){for(var Xn=function(Fv){return function(){var jv=new Error("Method "+Fv+" is not implemented by the current driver"),df=f.reject(jv);return v(df,arguments[arguments.length-1]),df}},ma=0,Mv=_s.length;ma<Mv;ma++){var ga=_s[ma];p[ga]||(p[ga]=Xn(ga))}};Ue();var Me=function(Xn){Qn[q]&&console.info("Redefining LocalForage driver: "+q),Qn[q]=p,ff[q]=Xn,L()};"_support"in p?p._support&&typeof p._support=="function"?p._support().then(Me,W):Me(!!p._support):Me(!0)}catch(wt){W(wt)}});return y(x,E,P),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(p,E,P){var x=Qn[p]?f.resolve(Qn[p]):f.reject(new Error("Driver not found."));return y(x,E,P),x},d.prototype.getSerializer=function(p){var E=f.resolve(A);return y(E,p),E},d.prototype.ready=function(p){var E=this,P=E._driverSet.then(function(){return E._ready===null&&(E._ready=E._initDriver()),E._ready});return y(P,p,p),P},d.prototype.setDriver=function(p,E,P){var x=this;uf(p)||(p=[p]);var L=this._getSupportedDrivers(p);function W(){x._config.driver=x.driver()}function q(ee){return x._extend(ee),W(),x._ready=x._initStorage(x._config),x._ready}function z(ee){return function(){var fe=0;function Se(){for(;fe<ee.length;){var Oe=ee[fe];return fe++,x._dbInfo=null,x._ready=null,x.getDriver(Oe).then(q).catch(Se)}W();var Ue=new Error("No available storage method found.");return x._driverSet=f.reject(Ue),x._driverSet}return Se()}}var G=this._driverSet!==null?this._driverSet.catch(function(){return f.resolve()}):f.resolve();return this._driverSet=G.then(function(){var ee=L[0];return x._dbInfo=null,x._ready=null,x.getDriver(ee).then(function(fe){x._driver=fe._driver,W(),x._wrapLibraryMethodsWithReady(),x._initDriver=z(L)})}).catch(function(){W();var ee=new Error("No available storage method found.");return x._driverSet=f.reject(ee),x._driverSet}),y(this._driverSet,E,P),this._driverSet},d.prototype.supports=function(p){return!!ff[p]},d.prototype._extend=function(p){pa(this,p)},d.prototype._getSupportedDrivers=function(p){for(var E=[],P=0,x=p.length;P<x;P++){var L=p[P];this.supports(L)&&E.push(L)}return E},d.prototype._wrapLibraryMethodsWithReady=function(){for(var p=0,E=ha.length;p<E;p++)Dv(this,ha[p])},d.prototype.createInstance=function(p){return new d(p)},d}(),Lv=new Nv;n.exports=Lv},{3:3}]},{},[4])(4)})}(Hs)),Hs.exports}var nh=rh();const Ja=ka(nh);class ih extends Ar{constructor(e){super(e,"storage",!1),e.set("localforage",Ja)}get StorageManager(){return di}createDatabse(e,r,n){return new di("InPageEdit",e,r,n)}}const on=class on{constructor(e,r,n=on.DEFAULT_TTL,i){this.dbName=e,this.storeName=r,this.ttl=n,this.version=i,this.db=on.createDatabase(e,r),this.keys=this.db.keys.bind(this.db)}static createDatabase(e,r){const n=`${e}:${r}`;if(this._cached_db_instances.has(n))return this._cached_db_instances.get(n);const i=Ja.createInstance({name:e,storeName:r});return this._cached_db_instances.set(n,i),i}async get(e,r=this.ttl,n){const i=await this.loadFromDB(e),s=this.checkIfExpired(i,r);if(!i||s){if(typeof n=="function"){const o=await n();return this.set(e,o).then(()=>o)}return null}return i.value}async set(e,r){return r===null||typeof r>"u"?this.delete(e):this.db.setItem(e,{time:Date.now(),value:r,version:this.version})}async has(e,r=this.ttl){const n=await this.loadFromDB(e),i=this.checkIfExpired(n,r);return n!==null&&!i}async delete(e){return this.db.removeItem(e)}async iterate(e){return await this.db.iterate((r,n)=>{e(r.value,n)})}async loadFromDB(e){const r=await this.db.getItem(e);if(!r)return null;if(typeof r.time!="number"||typeof r.value>"u"){try{this.delete(e)}catch{}return null}if(typeof this.version=="number"&&r.version!==this.version){try{this.delete(e)}catch{}return null}return r}checkIfExpired(e,r=this.ttl){return e?Date.now()-e.time>r:!1}async clear(){return await this.db.clear(),this}};on.DEFAULT_TTL=1/0,on._cached_db_instances=new Map;let di=on;var sh=Object.create,zs=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,Ya=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ga=t=>{throw TypeError(t)},ah=(t,e,r)=>e in t?zs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ch=(t,e)=>zs(t,"name",{value:e,configurable:!0}),lh=t=>[,,,sh(t?.[Ya("metadata")]??null)],uh=["class","method","getter","setter","accessor","field","value","get","set"],Qa=t=>t!==void 0&&typeof t!="function"?Ga("Function expected"):t,fh=(t,e,r,n,i)=>({kind:uh[t],name:e,metadata:n,addInitializer:s=>r._?Ga("Already initialized"):i.push(Qa(s||null))}),dh=(t,e)=>ah(e,Ya("metadata"),t[3]),hh=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},ph=(t,e,r,n,i,s)=>{var o,a,c,l=e&7,u=!1,f=0,v=t[f]||(t[f]=[]),y=l&&(i=i.prototype,l<5&&(l>3||!u)&&oh(i,r));ch(i,r);for(var b=n.length-1;b>=0;b--)c=fh(l,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,Qa(o)&&(i=o);return dh(t,i),y&&zs(i,r,y),u?l^4?s:y:i},Xa,Vs,Za;Xa=[st(["api","storage"])];class hi extends(Za=Ar){constructor(e){super(e,"sitemeta",!1),this.ctx=e,this._data=void 0,this.siteIdentity=void 0,this.CACHE_TTL=1e3*60*60*24,this.VERSION=2,this.db=void 0,this.queryData={meta:"siteinfo|userinfo",siprop:"general|specialpagealiases|namespacealiases|namespaces|magicwords",uiprop:"groups|rights|blockinfo|options"},this.db=e.storage.createDatabse("sitemeta",this.CACHE_TTL,this.VERSION)}get api(){return this.ctx.api}get mwConfig(){return mw.config.values}async start(){const e=await this.fetchFromCache();if(e){this.ctx.logger("SiteMetadataService").info("Using cached metadata"),this._data=e;return}const r=await this.fetchFromApi();this.saveToCache(r),this._data=r}async computeSiteIdentity(){if(this.siteIdentity)return this.siteIdentity;let e;if(!window.mw?.config)e=new URL(location.href).origin;else{const{wgServer:r,wgArticlePath:n}=window.mw.config.get();e=`${r}${n}`}return this.siteIdentity=e,this.siteIdentity}async fetchFromApi(){return this.api.get({action:"query",...this.queryData}).then(({data:e})=>{if(typeof e?.query?.general>"u")throw new Error("Invalid siteinfo");return e.query}).catch(e=>(this.ctx.logger.error("[InPageEdit]","fetchMetadata error",e),Promise.reject(e)))}async fetchFromCache(){const e=await this.computeSiteIdentity();return this.db.get(e)}async saveToCache(e){const r=await this.computeSiteIdentity();return this.db.set(r,e)}get _raw(){return this._data}get siteInfo(){return this._data.general}get specialPageAliases(){return this._data.specialpagealiases}get namespaceAliases(){return this._data.namespacealiases}get namespaces(){return this._data.namespaces}get namespaceMap(){const e=Object.values(this.namespaces).map(r=>({id:r.id,canonical:r.canonical,aliases:this.namespaceAliases.filter(n=>n.id===r.id).map(n=>n.alias)})).sort((r,n)=>r.id-n.id);return Reflect.defineProperty(this,"namespaceMap",{value:e,writable:!1,configurable:!1,enumerable:!0}),e}get magicWords(){return this._data.magicwords}get userInfo(){return this._data.userinfo}get userOptions(){return this.userInfo.options}get isUserBlocked(){return this.userInfo.blockedbyid&&this.userInfo.blockexpiry&&new Date(this.userInfo.blockexpiry).getTime()>Date.now()}get userGroups(){return this.userInfo.groups}get userRights(){return this.userInfo.rights}hasRight(e){return this.userRights.includes(e)}hasAnyRight(...e){return e.some(r=>this.hasRight(r))}hasEveryRights(...e){return e.every(r=>this.hasRight(r))}inGroup(e){return this.userGroups.includes(e)}inAnyGroup(...e){return this.userGroups.some(r=>e.includes(r))}getBlockInfo(){return this.isUserBlocked?{blockid:this.userInfo.blockid,blockedby:this.userInfo.blockedbyid,blockedbyid:this.userInfo.blockedbyid,blockreason:this.userInfo.blockreason,blockedtimestamp:this.userInfo.blockedtimestamp,blockexpiry:this.userInfo.blockexpiry}:null}}Vs=lh(Za),hi=ph(Vs,0,"SiteMetadataService",Xa,hi),hh(Vs,1,hi);const ls=class ls{constructor(e,r){this.pageInfo={...ls.DEFAULT_PAGE_INFO,...e},this.api=r||new Ua}async getPageInfo(e){const{data:{query:{pages:[r]}}}=await this.api.get({action:"query",prop:"info|templates|transcludedin|images|pageimages|revisions",inprop:"protection|url|varianttitles",intestactions:"edit|move|delete",tllimit:"max",tilimit:"max",imlimit:"max",piprop:"thumbnail|name|original",pithumbsize:"200",pilimit:"max",rvprop:"ids|timestamp|flags|comment|user|content",...e});return r.revisions?.forEach(n=>{if(typeof n.slots=="object"){const i=n.slots.main;i&&(n.content=i.content,n.contentmodel=i.contentmodel,n.contentformat=i.contentformat)}}),r}async parse(e){return this.api.post({action:"parse",page:this.pageInfo.title,prop:"text|langlinks|categories|links|templates|images|externallinks|sections|revid|displaytitle|iwlinks|properties|parsewarnings",...e})}async preview(e,r){return this.parse({action:"parse",page:void 0,title:this.title,text:e,pst:1,preview:1,disableeditsection:1,disablelimitreport:1,...r})}async edit(e,r){const{text:n,prependtext:i,appendtext:s,summary:o="",watchlist:a="preferences"}=e;return this.api.postWithEditToken({action:"edit",title:this.title,starttimestamp:this.pageInfo.touched,basetimestamp:this.revisions[0]?.timestamp,text:n,prependtext:i,appendtext:s,summary:o,watchlist:a,...r})}async createOnly(e,r){return this.edit(e,{createonly:1,...r})}async delete(e,r){return this.api.postWithEditToken({action:"delete",pageid:this.pageInfo.pageid,reason:e,...r})}async moveTo(e,r,n){return this.api.postWithEditToken({action:"move",from:this.pageInfo.title,to:e,reason:r,movetalk:1,movesubpages:1,...n})}userCan(e){return this.pageInfo?.actions?.[e]}userCanEdit(){return this.userCan("edit")}async refetch(){const e=await this.getPageInfo({pageids:this.pageInfo.pageid,titles:this.pageInfo.title}),r=(this.pageInfo.revisions||[]).concat(e.revisions||[]).sort((n,i)=>n.revid-i.revid).reduce((n,i)=>(n.find(s=>s.revid===i.revid)||n.push(i),n),[]);return this.pageInfo=e,this.pageInfo.revisions=r,this}get pageid(){return this.pageInfo.pageid}get title(){return this.pageInfo.title}get ns(){return this.pageInfo.ns}get contentmodel(){return this.pageInfo.contentmodel}get fullurl(){return this.pageInfo.fullurl}get canonicalurl(){return this.pageInfo.canonicalurl}get editurl(){return this.pageInfo.editurl}get revisions(){return this.pageInfo.revisions||[]}get templates(){return this.pageInfo.templates||[]}get images(){return this.pageInfo.images||[]}};ls.DEFAULT_PAGE_INFO={pageid:0,ns:0,title:"",contentmodel:"wikitext",pagelanguage:"",pagelanguagehtmlcode:"",pagelanguagedir:"ltr",touched:new Date().toISOString(),lastrevid:0,length:0,protection:[],restrictiontypes:[],fullurl:"",canonicalurl:"",editurl:"",varianttitles:{},actions:{edit:!0,move:!1,delete:!1},revisions:[],templates:[],images:[]};let gn=ls;const ca=class ca extends Ar{constructor(e){super(e,"wikiPage",!0),this.ctx=e}get WikiPage(){return gn}async createInstance(e){const{data:{query:{pages:[r]}}}=await this.ctx.api.get({action:"query",prop:"info|templates|transcludedin|images|pageimages|revisions",inprop:"protection|url|varianttitles",intestactions:"edit|move|delete",tllimit:"max",tilimit:"max",imlimit:"max",piprop:"thumbnail|name|original",pithumbsize:"200",pilimit:"max",rvprop:"ids|timestamp|user|userid|content",...e});return new gn(r,this.ctx.api)}async newFromTitle(e,r=!1,n){return this.createInstance({titles:e,converttitles:r,rvsection:n})}async newFromPageId(e,r){return this.createInstance({pageids:e,rvsection:r})}async newFromRevision(e,r){return this.createInstance({revids:e,rvsection:r})}newBlankPage(e={}){return new gn(e,this.ctx.api)}};ca.inject=["api"];let Ks=ca;/**
31
+ */var Ya;function yh(){return Ya||(Ya=1,function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,s){function o(u,l){if(!i[u]){if(!n[u]){var f=typeof fi=="function"&&fi;if(!l&&f)return f(u,!0);if(a)return a(u,!0);var v=new Error("Cannot find module '"+u+"'");throw v.code="MODULE_NOT_FOUND",v}var y=i[u]={exports:{}};n[u][0].call(y.exports,function(b){var T=n[u][1][b];return o(T||b)},y,y.exports,r,n,i,s)}return i[u].exports}for(var a=typeof fi=="function"&&fi,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(r,n,i){(function(s){var o=s.MutationObserver||s.WebKitMutationObserver,a;if(o){var c=0,u=new o(b),l=s.document.createTextNode("");u.observe(l,{characterData:!0}),a=function(){l.data=c=++c%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var f=new s.MessageChannel;f.port1.onmessage=b,a=function(){f.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?a=function(){var H=s.document.createElement("script");H.onreadystatechange=function(){b(),H.onreadystatechange=null,H.parentNode.removeChild(H),H=null},s.document.documentElement.appendChild(H)}:a=function(){setTimeout(b,0)};var v,y=[];function b(){v=!0;for(var H,B,R=y.length;R;){for(B=y,y=[],H=-1;++H<R;)B[H]();R=y.length}v=!1}n.exports=T;function T(H){y.push(H)===1&&!v&&a()}}).call(this,typeof Ar<"u"?Ar:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var s=r(1);function o(){}var a={},c=["REJECTED"],u=["FULFILLED"],l=["PENDING"];n.exports=f;function f(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,h!==o&&T(this,h)}f.prototype.catch=function(h){return this.then(null,h)},f.prototype.then=function(h,P){if(typeof h!="function"&&this.state===u||typeof P!="function"&&this.state===c)return this;var I=new this.constructor(o);if(this.state!==l){var N=this.state===u?h:P;y(I,N,this.outcome)}else this.queue.push(new v(I,h,P));return I};function v(h,P,I){this.promise=h,typeof P=="function"&&(this.onFulfilled=P,this.callFulfilled=this.otherCallFulfilled),typeof I=="function"&&(this.onRejected=I,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(h){a.resolve(this.promise,h)},v.prototype.otherCallFulfilled=function(h){y(this.promise,this.onFulfilled,h)},v.prototype.callRejected=function(h){a.reject(this.promise,h)},v.prototype.otherCallRejected=function(h){y(this.promise,this.onRejected,h)};function y(h,P,I){s(function(){var N;try{N=P(I)}catch(J){return a.reject(h,J)}N===h?a.reject(h,new TypeError("Cannot resolve promise with itself")):a.resolve(h,N)})}a.resolve=function(h,P){var I=H(b,P);if(I.status==="error")return a.reject(h,I.value);var N=I.value;if(N)T(h,N);else{h.state=u,h.outcome=P;for(var J=-1,re=h.queue.length;++J<re;)h.queue[J].callFulfilled(P)}return h},a.reject=function(h,P){h.state=c,h.outcome=P;for(var I=-1,N=h.queue.length;++I<N;)h.queue[I].callRejected(P);return h};function b(h){var P=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof P=="function")return function(){P.apply(h,arguments)}}function T(h,P){var I=!1;function N(Le){I||(I=!0,a.reject(h,Le))}function J(Le){I||(I=!0,a.resolve(h,Le))}function re(){P(J,N)}var $e=H(re);$e.status==="error"&&N($e.value)}function H(h,P){var I={};try{I.value=h(P),I.status="success"}catch(N){I.status="error",I.value=N}return I}f.resolve=B;function B(h){return h instanceof this?h:a.resolve(new this(o),h)}f.reject=R;function R(h){var P=new this(o);return a.reject(P,h)}f.all=m;function m(h){var P=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var I=h.length,N=!1;if(!I)return this.resolve([]);for(var J=new Array(I),re=0,$e=-1,Le=new this(o);++$e<I;)Ke(h[$e],$e);return Le;function Ke(Qe,pt){P.resolve(Qe).then(Re,function(ve){N||(N=!0,a.reject(Le,ve))});function Re(ve){J[pt]=ve,++re===I&&!N&&(N=!0,a.resolve(Le,J))}}}f.race=p;function p(h){var P=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var I=h.length,N=!1;if(!I)return this.resolve([]);for(var J=-1,re=new this(o);++J<I;)$e(h[J]);return re;function $e(Le){P.resolve(Le).then(function(Ke){N||(N=!0,a.resolve(re,Ke))},function(Ke){N||(N=!0,a.reject(re,Ke))})}}},{1:1}],3:[function(r,n,i){(function(s){typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof Ar<"u"?Ar:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};function o(d,w){if(!(d instanceof w))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=a();function u(){try{if(!c||!c.open)return!1;var d=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),w=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!d||w)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function l(d,w){d=d||[],w=w||{};try{return new Blob(d,w)}catch(x){if(x.name!=="TypeError")throw x;for(var g=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,E=new g,C=0;C<d.length;C+=1)E.append(d[C]);return E.getBlob(w.type)}}typeof Promise>"u"&&r(3);var f=Promise;function v(d,w){w&&d.then(function(g){w(null,g)},function(g){w(g)})}function y(d,w,g){typeof w=="function"&&d.then(w),typeof g=="function"&&d.catch(g)}function b(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}function T(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var H="local-forage-detect-blob-support",B=void 0,R={},m=Object.prototype.toString,p="readonly",h="readwrite";function P(d){for(var w=d.length,g=new ArrayBuffer(w),E=new Uint8Array(g),C=0;C<w;C++)E[C]=d.charCodeAt(C);return g}function I(d){return new f(function(w){var g=d.transaction(H,h),E=l([""]);g.objectStore(H).put(E,"key"),g.onabort=function(C){C.preventDefault(),C.stopPropagation(),w(!1)},g.oncomplete=function(){var C=navigator.userAgent.match(/Chrome\/(\d+)/),x=navigator.userAgent.match(/Edge\//);w(x||!C||parseInt(C[1],10)>=43)}}).catch(function(){return!1})}function N(d){return typeof B=="boolean"?f.resolve(B):I(d).then(function(w){return B=w,B})}function J(d){var w=R[d.name],g={};g.promise=new f(function(E,C){g.resolve=E,g.reject=C}),w.deferredOperations.push(g),w.dbReady?w.dbReady=w.dbReady.then(function(){return g.promise}):w.dbReady=g.promise}function re(d){var w=R[d.name],g=w.deferredOperations.pop();if(g)return g.resolve(),g.promise}function $e(d,w){var g=R[d.name],E=g.deferredOperations.pop();if(E)return E.reject(w),E.promise}function Le(d,w){return new f(function(g,E){if(R[d.name]=R[d.name]||Xe(),d.db)if(w)J(d),d.db.close();else return g(d.db);var C=[d.name];w&&C.push(d.version);var x=c.open.apply(c,C);w&&(x.onupgradeneeded=function(L){var W=x.result;try{W.createObjectStore(d.storeName),L.oldVersion<=1&&W.createObjectStore(H)}catch(q){if(q.name==="ConstraintError")console.warn('The database "'+d.name+'" has been upgraded from version '+L.oldVersion+" to version "+L.newVersion+', but the storage "'+d.storeName+'" already exists.');else throw q}}),x.onerror=function(L){L.preventDefault(),E(x.error)},x.onsuccess=function(){var L=x.result;L.onversionchange=function(W){W.target.close()},g(L),re(d)}})}function Ke(d){return Le(d,!1)}function Qe(d){return Le(d,!0)}function pt(d,w){if(!d.db)return!0;var g=!d.db.objectStoreNames.contains(d.storeName),E=d.version<d.db.version,C=d.version>d.db.version;if(E&&(d.version!==w&&console.warn('The database "'+d.name+`" can't be downgraded from version `+d.db.version+" to version "+d.version+"."),d.version=d.db.version),C||g){if(g){var x=d.db.version+1;x>d.version&&(d.version=x)}return!0}return!1}function Re(d){return new f(function(w,g){var E=new FileReader;E.onerror=g,E.onloadend=function(C){var x=btoa(C.target.result||"");w({__local_forage_encoded_blob:!0,data:x,type:d.type})},E.readAsBinaryString(d)})}function ve(d){var w=P(atob(d.data));return l([w],{type:d.type})}function _e(d){return d&&d.__local_forage_encoded_blob}function mt(d){var w=this,g=w._initReady().then(function(){var E=R[w._dbInfo.name];if(E&&E.dbReady)return E.dbReady});return y(g,d,d),g}function Xt(d){J(d);for(var w=R[d.name],g=w.forages,E=0;E<g.length;E++){var C=g[E];C._dbInfo.db&&(C._dbInfo.db.close(),C._dbInfo.db=null)}return d.db=null,Ke(d).then(function(x){return d.db=x,pt(d)?Qe(d):x}).then(function(x){d.db=w.db=x;for(var L=0;L<g.length;L++)g[L]._dbInfo.db=x}).catch(function(x){throw $e(d,x),x})}function Be(d,w,g,E){E===void 0&&(E=1);try{var C=d.db.transaction(d.storeName,w);g(null,C)}catch(x){if(E>0&&(!d.db||x.name==="InvalidStateError"||x.name==="NotFoundError"))return f.resolve().then(function(){if(!d.db||x.name==="NotFoundError"&&!d.db.objectStoreNames.contains(d.storeName)&&d.version<=d.db.version)return d.db&&(d.version=d.db.version+1),Qe(d)}).then(function(){return Xt(d).then(function(){Be(d,w,g,E-1)})}).catch(g);g(x)}}function Xe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function an(d){var w=this,g={db:null};if(d)for(var E in d)g[E]=d[E];var C=R[g.name];C||(C=Xe(),R[g.name]=C),C.forages.push(w),w._initReady||(w._initReady=w.ready,w.ready=mt);var x=[];function L(){return f.resolve()}for(var W=0;W<C.forages.length;W++){var q=C.forages[W];q!==w&&x.push(q._initReady().catch(L))}var z=C.forages.slice(0);return f.all(x).then(function(){return g.db=C.db,Ke(g)}).then(function(G){return g.db=G,pt(g,w._defaultConfig.version)?Qe(g):G}).then(function(G){g.db=C.db=G,w._dbInfo=g;for(var ee=0;ee<z.length;ee++){var fe=z[ee];fe!==w&&(fe._dbInfo.db=g.db,fe._dbInfo.version=g.version)}})}function cn(d,w){var g=this;d=b(d);var E=new f(function(C,x){g.ready().then(function(){Be(g._dbInfo,p,function(L,W){if(L)return x(L);try{var q=W.objectStore(g._dbInfo.storeName),z=q.get(d);z.onsuccess=function(){var G=z.result;G===void 0&&(G=null),_e(G)&&(G=ve(G)),C(G)},z.onerror=function(){x(z.error)}}catch(G){x(G)}})}).catch(x)});return v(E,w),E}function qn(d,w){var g=this,E=new f(function(C,x){g.ready().then(function(){Be(g._dbInfo,p,function(L,W){if(L)return x(L);try{var q=W.objectStore(g._dbInfo.storeName),z=q.openCursor(),G=1;z.onsuccess=function(){var ee=z.result;if(ee){var fe=ee.value;_e(fe)&&(fe=ve(fe));var Se=d(fe,ee.key,G++);Se!==void 0?C(Se):ee.continue()}else C()},z.onerror=function(){x(z.error)}}catch(ee){x(ee)}})}).catch(x)});return v(E,w),E}function nt(d,w,g){var E=this;d=b(d);var C=new f(function(x,L){var W;E.ready().then(function(){return W=E._dbInfo,m.call(w)==="[object Blob]"?N(W.db).then(function(q){return q?w:Re(w)}):w}).then(function(q){Be(E._dbInfo,h,function(z,G){if(z)return L(z);try{var ee=G.objectStore(E._dbInfo.storeName);q===null&&(q=void 0);var fe=ee.put(q,d);G.oncomplete=function(){q===void 0&&(q=null),x(q)},G.onabort=G.onerror=function(){var Se=fe.error?fe.error:fe.transaction.error;L(Se)}}catch(Se){L(Se)}})}).catch(L)});return v(C,g),C}function jt(d,w){var g=this;d=b(d);var E=new f(function(C,x){g.ready().then(function(){Be(g._dbInfo,h,function(L,W){if(L)return x(L);try{var q=W.objectStore(g._dbInfo.storeName),z=q.delete(d);W.oncomplete=function(){C()},W.onerror=function(){x(z.error)},W.onabort=function(){var G=z.error?z.error:z.transaction.error;x(G)}}catch(G){x(G)}})}).catch(x)});return v(E,w),E}function Pr(d){var w=this,g=new f(function(E,C){w.ready().then(function(){Be(w._dbInfo,h,function(x,L){if(x)return C(x);try{var W=L.objectStore(w._dbInfo.storeName),q=W.clear();L.oncomplete=function(){E()},L.onabort=L.onerror=function(){var z=q.error?q.error:q.transaction.error;C(z)}}catch(z){C(z)}})}).catch(C)});return v(g,d),g}function Cr(d){var w=this,g=new f(function(E,C){w.ready().then(function(){Be(w._dbInfo,p,function(x,L){if(x)return C(x);try{var W=L.objectStore(w._dbInfo.storeName),q=W.count();q.onsuccess=function(){E(q.result)},q.onerror=function(){C(q.error)}}catch(z){C(z)}})}).catch(C)});return v(g,d),g}function Zt(d,w){var g=this,E=new f(function(C,x){if(d<0){C(null);return}g.ready().then(function(){Be(g._dbInfo,p,function(L,W){if(L)return x(L);try{var q=W.objectStore(g._dbInfo.storeName),z=!1,G=q.openKeyCursor();G.onsuccess=function(){var ee=G.result;if(!ee){C(null);return}d===0||z?C(ee.key):(z=!0,ee.advance(d))},G.onerror=function(){x(G.error)}}catch(ee){x(ee)}})}).catch(x)});return v(E,w),E}function fs(d){var w=this,g=new f(function(E,C){w.ready().then(function(){Be(w._dbInfo,p,function(x,L){if(x)return C(x);try{var W=L.objectStore(w._dbInfo.storeName),q=W.openKeyCursor(),z=[];q.onsuccess=function(){var G=q.result;if(!G){E(z);return}z.push(G.key),G.continue()},q.onerror=function(){C(q.error)}}catch(G){C(G)}})}).catch(C)});return v(g,d),g}function _(d,w){w=T.apply(this,arguments);var g=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||g.name,d.storeName=d.storeName||g.storeName);var E=this,C;if(!d.name)C=f.reject("Invalid arguments");else{var x=d.name===g.name&&E._dbInfo.db,L=x?f.resolve(E._dbInfo.db):Ke(d).then(function(W){var q=R[d.name],z=q.forages;q.db=W;for(var G=0;G<z.length;G++)z[G]._dbInfo.db=W;return W});d.storeName?C=L.then(function(W){if(W.objectStoreNames.contains(d.storeName)){var q=W.version+1;J(d);var z=R[d.name],G=z.forages;W.close();for(var ee=0;ee<G.length;ee++){var fe=G[ee];fe._dbInfo.db=null,fe._dbInfo.version=q}var Se=new f(function(Oe,We){var je=c.open(d.name,q);je.onerror=function(xt){var Xn=je.result;Xn.close(),We(xt)},je.onupgradeneeded=function(){var xt=je.result;xt.deleteObjectStore(d.storeName)},je.onsuccess=function(){var xt=je.result;xt.close(),Oe(xt)}});return Se.then(function(Oe){z.db=Oe;for(var We=0;We<G.length;We++){var je=G[We];je._dbInfo.db=Oe,re(je._dbInfo)}}).catch(function(Oe){throw($e(d,Oe)||f.resolve()).catch(function(){}),Oe})}}):C=L.then(function(W){J(d);var q=R[d.name],z=q.forages;W.close();for(var G=0;G<z.length;G++){var ee=z[G];ee._dbInfo.db=null}var fe=new f(function(Se,Oe){var We=c.deleteDatabase(d.name);We.onerror=function(){var je=We.result;je&&je.close(),Oe(We.error)},We.onblocked=function(){console.warn('dropInstance blocked for database "'+d.name+'" until all open connections are closed')},We.onsuccess=function(){var je=We.result;je&&je.close(),Se(je)}});return fe.then(function(Se){q.db=Se;for(var Oe=0;Oe<z.length;Oe++){var We=z[Oe];re(We._dbInfo)}}).catch(function(Se){throw($e(d,Se)||f.resolve()).catch(function(){}),Se})})}return v(C,w),C}var S={_driver:"asyncStorage",_initStorage:an,_support:u(),iterate:qn,getItem:cn,setItem:nt,removeItem:jt,clear:Pr,length:Cr,key:Zt,keys:fs,dropInstance:_};function D(){return typeof openDatabase=="function"}var j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",F="~~local_forage_type~",M=/^~~local_forage_type~([^~]+)~/,K="__lfsc__:",Y=K.length,V="arbf",U="blob",ne="si08",X="ui08",te="uic8",ie="si16",ue="si32",we="ur16",me="ui32",Ae="fl32",Me="fl64",Ze=Y+V.length,it=Object.prototype.toString;function Ft(d){var w=d.length*.75,g=d.length,E,C=0,x,L,W,q;d[d.length-1]==="="&&(w--,d[d.length-2]==="="&&w--);var z=new ArrayBuffer(w),G=new Uint8Array(z);for(E=0;E<g;E+=4)x=j.indexOf(d[E]),L=j.indexOf(d[E+1]),W=j.indexOf(d[E+2]),q=j.indexOf(d[E+3]),G[C++]=x<<2|L>>4,G[C++]=(L&15)<<4|W>>2,G[C++]=(W&3)<<6|q&63;return z}function Bt(d){var w=new Uint8Array(d),g="",E;for(E=0;E<w.length;E+=3)g+=j[w[E]>>2],g+=j[(w[E]&3)<<4|w[E+1]>>4],g+=j[(w[E+1]&15)<<2|w[E+2]>>6],g+=j[w[E+2]&63];return w.length%3===2?g=g.substring(0,g.length-1)+"=":w.length%3===1&&(g=g.substring(0,g.length-2)+"=="),g}function Ue(d,w){var g="";if(d&&(g=it.call(d)),d&&(g==="[object ArrayBuffer]"||d.buffer&&it.call(d.buffer)==="[object ArrayBuffer]")){var E,C=K;d instanceof ArrayBuffer?(E=d,C+=V):(E=d.buffer,g==="[object Int8Array]"?C+=ne:g==="[object Uint8Array]"?C+=X:g==="[object Uint8ClampedArray]"?C+=te:g==="[object Int16Array]"?C+=ie:g==="[object Uint16Array]"?C+=we:g==="[object Int32Array]"?C+=ue:g==="[object Uint32Array]"?C+=me:g==="[object Float32Array]"?C+=Ae:g==="[object Float64Array]"?C+=Me:w(new Error("Failed to get type for BinaryArray"))),w(C+Bt(E))}else if(g==="[object Blob]"){var x=new FileReader;x.onload=function(){var L=F+d.type+"~"+Bt(this.result);w(K+U+L)},x.readAsArrayBuffer(d)}else try{w(JSON.stringify(d))}catch(L){console.error("Couldn't convert value into a JSON string: ",d),w(null,L)}}function k(d){if(d.substring(0,Y)!==K)return JSON.parse(d);var w=d.substring(Ze),g=d.substring(Y,Ze),E;if(g===U&&M.test(w)){var C=w.match(M);E=C[1],w=w.substring(C[0].length)}var x=Ft(w);switch(g){case V:return x;case U:return l([x],{type:E});case ne:return new Int8Array(x);case X:return new Uint8Array(x);case te:return new Uint8ClampedArray(x);case ie:return new Int16Array(x);case we:return new Uint16Array(x);case ue:return new Int32Array(x);case me:return new Uint32Array(x);case Ae:return new Float32Array(x);case Me:return new Float64Array(x);default:throw new Error("Unkown type: "+g)}}var A={serialize:Ue,deserialize:k,stringToBuffer:Ft,bufferToString:Bt};function de(d,w,g,E){d.executeSql("CREATE TABLE IF NOT EXISTS "+w.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],g,E)}function Pe(d){var w=this,g={db:null};if(d)for(var E in d)g[E]=typeof d[E]!="string"?d[E].toString():d[E];var C=new f(function(x,L){try{g.db=openDatabase(g.name,String(g.version),g.description,g.size)}catch(W){return L(W)}g.db.transaction(function(W){de(W,g,function(){w._dbInfo=g,x()},function(q,z){L(z)})},L)});return g.serializer=A,C}function ge(d,w,g,E,C,x){d.executeSql(g,E,C,function(L,W){W.code===W.SYNTAX_ERR?L.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[w.storeName],function(q,z){z.rows.length?x(q,W):de(q,w,function(){q.executeSql(g,E,C,x)},x)},x):x(L,W)},x)}function le(d,w){var g=this;d=b(d);var E=new f(function(C,x){g.ready().then(function(){var L=g._dbInfo;L.db.transaction(function(W){ge(W,L,"SELECT * FROM "+L.storeName+" WHERE key = ? LIMIT 1",[d],function(q,z){var G=z.rows.length?z.rows.item(0).value:null;G&&(G=L.serializer.deserialize(G)),C(G)},function(q,z){x(z)})})}).catch(x)});return v(E,w),E}function Ut(d,w){var g=this,E=new f(function(C,x){g.ready().then(function(){var L=g._dbInfo;L.db.transaction(function(W){ge(W,L,"SELECT * FROM "+L.storeName,[],function(q,z){for(var G=z.rows,ee=G.length,fe=0;fe<ee;fe++){var Se=G.item(fe),Oe=Se.value;if(Oe&&(Oe=L.serializer.deserialize(Oe)),Oe=d(Oe,Se.key,fe+1),Oe!==void 0){C(Oe);return}}C()},function(q,z){x(z)})})}).catch(x)});return v(E,w),E}function Wt(d,w,g,E){var C=this;d=b(d);var x=new f(function(L,W){C.ready().then(function(){w===void 0&&(w=null);var q=w,z=C._dbInfo;z.serializer.serialize(w,function(G,ee){ee?W(ee):z.db.transaction(function(fe){ge(fe,z,"INSERT OR REPLACE INTO "+z.storeName+" (key, value) VALUES (?, ?)",[d,G],function(){L(q)},function(Se,Oe){W(Oe)})},function(fe){if(fe.code===fe.QUOTA_ERR){if(E>0){L(Wt.apply(C,[d,q,g,E-1]));return}W(fe)}})})}).catch(W)});return v(x,g),x}function st(d,w,g){return Wt.apply(this,[d,w,g,1])}function qt(d,w){var g=this;d=b(d);var E=new f(function(C,x){g.ready().then(function(){var L=g._dbInfo;L.db.transaction(function(W){ge(W,L,"DELETE FROM "+L.storeName+" WHERE key = ?",[d],function(){C()},function(q,z){x(z)})})}).catch(x)});return v(E,w),E}function Hn(d){var w=this,g=new f(function(E,C){w.ready().then(function(){var x=w._dbInfo;x.db.transaction(function(L){ge(L,x,"DELETE FROM "+x.storeName,[],function(){E()},function(W,q){C(q)})})}).catch(C)});return v(g,d),g}function fr(d){var w=this,g=new f(function(E,C){w.ready().then(function(){var x=w._dbInfo;x.db.transaction(function(L){ge(L,x,"SELECT COUNT(key) as c FROM "+x.storeName,[],function(W,q){var z=q.rows.item(0).c;E(z)},function(W,q){C(q)})})}).catch(C)});return v(g,d),g}function gt(d,w){var g=this,E=new f(function(C,x){g.ready().then(function(){var L=g._dbInfo;L.db.transaction(function(W){ge(W,L,"SELECT key FROM "+L.storeName+" WHERE id = ? LIMIT 1",[d+1],function(q,z){var G=z.rows.length?z.rows.item(0).key:null;C(G)},function(q,z){x(z)})})}).catch(x)});return v(E,w),E}function ds(d){var w=this,g=new f(function(E,C){w.ready().then(function(){var x=w._dbInfo;x.db.transaction(function(L){ge(L,x,"SELECT key FROM "+x.storeName,[],function(W,q){for(var z=[],G=0;G<q.rows.length;G++)z.push(q.rows.item(G).key);E(z)},function(W,q){C(q)})})}).catch(C)});return v(g,d),g}function hs(d){return new f(function(w,g){d.transaction(function(E){E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(C,x){for(var L=[],W=0;W<x.rows.length;W++)L.push(x.rows.item(W).name);w({db:d,storeNames:L})},function(C,x){g(x)})},function(E){g(E)})})}function ps(d,w){w=T.apply(this,arguments);var g=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||g.name,d.storeName=d.storeName||g.storeName);var E=this,C;return d.name?C=new f(function(x){var L;d.name===g.name?L=E._dbInfo.db:L=openDatabase(d.name,"","",0),d.storeName?x({db:L,storeNames:[d.storeName]}):x(hs(L))}).then(function(x){return new f(function(L,W){x.db.transaction(function(q){function z(Se){return new f(function(Oe,We){q.executeSql("DROP TABLE IF EXISTS "+Se,[],function(){Oe()},function(je,xt){We(xt)})})}for(var G=[],ee=0,fe=x.storeNames.length;ee<fe;ee++)G.push(z(x.storeNames[ee]));f.all(G).then(function(){L()}).catch(function(Se){W(Se)})},function(q){W(q)})})}):C=f.reject("Invalid arguments"),v(C,w),C}var kr={_driver:"webSQLStorage",_initStorage:Pe,_support:D(),iterate:Ut,getItem:le,setItem:st,removeItem:qt,clear:Hn,length:fr,key:gt,keys:ds,dropInstance:ps};function zn(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function $r(d,w){var g=d.name+"/";return d.storeName!==w.storeName&&(g+=d.storeName+"/"),g}function Vn(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function Kn(){return!Vn()||localStorage.length>0}function ms(d){var w=this,g={};if(d)for(var E in d)g[E]=d[E];return g.keyPrefix=$r(d,w._defaultConfig),Kn()?(w._dbInfo=g,g.serializer=A,f.resolve()):f.reject()}function gs(d){var w=this,g=w.ready().then(function(){for(var E=w._dbInfo.keyPrefix,C=localStorage.length-1;C>=0;C--){var x=localStorage.key(C);x.indexOf(E)===0&&localStorage.removeItem(x)}});return v(g,d),g}function Jn(d,w){var g=this;d=b(d);var E=g.ready().then(function(){var C=g._dbInfo,x=localStorage.getItem(C.keyPrefix+d);return x&&(x=C.serializer.deserialize(x)),x});return v(E,w),E}function ys(d,w){var g=this,E=g.ready().then(function(){for(var C=g._dbInfo,x=C.keyPrefix,L=x.length,W=localStorage.length,q=1,z=0;z<W;z++){var G=localStorage.key(z);if(G.indexOf(x)===0){var ee=localStorage.getItem(G);if(ee&&(ee=C.serializer.deserialize(ee)),ee=d(ee,G.substring(L),q++),ee!==void 0)return ee}}});return v(E,w),E}function Yn(d,w){var g=this,E=g.ready().then(function(){var C=g._dbInfo,x;try{x=localStorage.key(d)}catch{x=null}return x&&(x=x.substring(C.keyPrefix.length)),x});return v(E,w),E}function vs(d){var w=this,g=w.ready().then(function(){for(var E=w._dbInfo,C=localStorage.length,x=[],L=0;L<C;L++){var W=localStorage.key(L);W.indexOf(E.keyPrefix)===0&&x.push(W.substring(E.keyPrefix.length))}return x});return v(g,d),g}function da(d){var w=this,g=w.keys().then(function(E){return E.length});return v(g,d),g}function Gn(d,w){var g=this;d=b(d);var E=g.ready().then(function(){var C=g._dbInfo;localStorage.removeItem(C.keyPrefix+d)});return v(E,w),E}function dr(d,w,g){var E=this;d=b(d);var C=E.ready().then(function(){w===void 0&&(w=null);var x=w;return new f(function(L,W){var q=E._dbInfo;q.serializer.serialize(w,function(z,G){if(G)W(G);else try{localStorage.setItem(q.keyPrefix+d,z),L(x)}catch(ee){(ee.name==="QuotaExceededError"||ee.name==="NS_ERROR_DOM_QUOTA_REACHED")&&W(ee),W(ee)}})})});return v(C,g),C}function ln(d,w){if(w=T.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var g=this.config();d.name=d.name||g.name,d.storeName=d.storeName||g.storeName}var E=this,C;return d.name?C=new f(function(x){d.storeName?x($r(d,E._defaultConfig)):x(d.name+"/")}).then(function(x){for(var L=localStorage.length-1;L>=0;L--){var W=localStorage.key(L);W.indexOf(x)===0&&localStorage.removeItem(W)}}):C=f.reject("Invalid arguments"),v(C,w),C}var ha={_driver:"localStorageWrapper",_initStorage:ms,_support:zn(),iterate:ys,getItem:Jn,setItem:dr,removeItem:Gn,clear:gs,length:da,key:Yn,keys:vs,dropInstance:ln},bs=function(w,g){return w===g||typeof w=="number"&&typeof g=="number"&&isNaN(w)&&isNaN(g)},Nv=function(w,g){for(var E=w.length,C=0;C<E;){if(bs(w[C],g))return!0;C++}return!1},Of=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},Qn={},Pf={},un={INDEXEDDB:S,WEBSQL:kr,LOCALSTORAGE:ha},Dv=[un.INDEXEDDB._driver,un.WEBSQL._driver,un.LOCALSTORAGE._driver],_s=["dropInstance"],pa=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_s),Lv={description:"",driver:Dv.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Mv(d,w){d[w]=function(){var g=arguments;return d.ready().then(function(){return d[w].apply(d,g)})}}function ma(){for(var d=1;d<arguments.length;d++){var w=arguments[d];if(w)for(var g in w)w.hasOwnProperty(g)&&(Of(w[g])?arguments[0][g]=w[g].slice():arguments[0][g]=w[g])}return arguments[0]}var jv=function(){function d(w){o(this,d);for(var g in un)if(un.hasOwnProperty(g)){var E=un[g],C=E._driver;this[g]=C,Qn[C]||this.defineDriver(E)}this._defaultConfig=ma({},Lv),this._config=ma({},this._defaultConfig,w),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return d.prototype.config=function(g){if((typeof g>"u"?"undefined":s(g))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var E in g){if(E==="storeName"&&(g[E]=g[E].replace(/\W/g,"_")),E==="version"&&typeof g[E]!="number")return new Error("Database version must be a number.");this._config[E]=g[E]}return"driver"in g&&g.driver?this.setDriver(this._config.driver):!0}else return typeof g=="string"?this._config[g]:this._config},d.prototype.defineDriver=function(g,E,C){var x=new f(function(L,W){try{var q=g._driver,z=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver){W(z);return}for(var G=pa.concat("_initStorage"),ee=0,fe=G.length;ee<fe;ee++){var Se=G[ee],Oe=!Nv(_s,Se);if((Oe||g[Se])&&typeof g[Se]!="function"){W(z);return}}var We=function(){for(var Xn=function(Uv){return function(){var Wv=new Error("Method "+Uv+" is not implemented by the current driver"),Cf=f.reject(Wv);return v(Cf,arguments[arguments.length-1]),Cf}},ga=0,Bv=_s.length;ga<Bv;ga++){var ya=_s[ga];g[ya]||(g[ya]=Xn(ya))}};We();var je=function(Xn){Qn[q]&&console.info("Redefining LocalForage driver: "+q),Qn[q]=g,Pf[q]=Xn,L()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(je,W):je(!!g._support):je(!0)}catch(xt){W(xt)}});return y(x,E,C),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(g,E,C){var x=Qn[g]?f.resolve(Qn[g]):f.reject(new Error("Driver not found."));return y(x,E,C),x},d.prototype.getSerializer=function(g){var E=f.resolve(A);return y(E,g),E},d.prototype.ready=function(g){var E=this,C=E._driverSet.then(function(){return E._ready===null&&(E._ready=E._initDriver()),E._ready});return y(C,g,g),C},d.prototype.setDriver=function(g,E,C){var x=this;Of(g)||(g=[g]);var L=this._getSupportedDrivers(g);function W(){x._config.driver=x.driver()}function q(ee){return x._extend(ee),W(),x._ready=x._initStorage(x._config),x._ready}function z(ee){return function(){var fe=0;function Se(){for(;fe<ee.length;){var Oe=ee[fe];return fe++,x._dbInfo=null,x._ready=null,x.getDriver(Oe).then(q).catch(Se)}W();var We=new Error("No available storage method found.");return x._driverSet=f.reject(We),x._driverSet}return Se()}}var G=this._driverSet!==null?this._driverSet.catch(function(){return f.resolve()}):f.resolve();return this._driverSet=G.then(function(){var ee=L[0];return x._dbInfo=null,x._ready=null,x.getDriver(ee).then(function(fe){x._driver=fe._driver,W(),x._wrapLibraryMethodsWithReady(),x._initDriver=z(L)})}).catch(function(){W();var ee=new Error("No available storage method found.");return x._driverSet=f.reject(ee),x._driverSet}),y(this._driverSet,E,C),this._driverSet},d.prototype.supports=function(g){return!!Pf[g]},d.prototype._extend=function(g){ma(this,g)},d.prototype._getSupportedDrivers=function(g){for(var E=[],C=0,x=g.length;C<x;C++){var L=g[C];this.supports(L)&&E.push(L)}return E},d.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,E=pa.length;g<E;g++)Mv(this,pa[g])},d.prototype.createInstance=function(g){return new d(g)},d}(),Fv=new jv;n.exports=Fv},{3:3}]},{},[4])(4)})}(zs)),zs.exports}var vh=yh();const Ga=Ia(vh);class bh extends Tr{constructor(e){super(e,"storage",!1),e.set("localforage",Ga)}get StorageManager(){return di}createDatabse(e,r,n){return new di("InPageEdit",e,r,n)}}const on=class on{constructor(e,r,n=on.DEFAULT_TTL,i){this.dbName=e,this.storeName=r,this.ttl=n,this.version=i,this.db=on.createDatabase(e,r),this.keys=this.db.keys.bind(this.db)}static createDatabase(e,r){const n=`${e}:${r}`;if(this._cached_db_instances.has(n))return this._cached_db_instances.get(n);const i=Ga.createInstance({name:e,storeName:r});return this._cached_db_instances.set(n,i),i}async get(e,r=this.ttl,n){const i=await this.loadFromDB(e),s=this.checkIfExpired(i,r);if(!i||s){if(typeof n=="function"){const o=await n();return this.set(e,o).then(()=>o)}return null}return i.value}async set(e,r){return r===null||typeof r>"u"?this.delete(e):this.db.setItem(e,{time:Date.now(),value:r,version:this.version})}async has(e,r=this.ttl){const n=await this.loadFromDB(e),i=this.checkIfExpired(n,r);return n!==null&&!i}async delete(e){return this.db.removeItem(e)}async iterate(e){return await this.db.iterate((r,n)=>{e(r.value,n)})}async loadFromDB(e){const r=await this.db.getItem(e);if(!r)return null;if(typeof r.time!="number"||typeof r.value>"u"){try{this.delete(e)}catch{}return null}if(typeof this.version=="number"&&r.version!==this.version){try{this.delete(e)}catch{}return null}return r}checkIfExpired(e,r=this.ttl){return e?Date.now()-e.time>r:!1}async clear(){return await this.db.clear(),this}};on.DEFAULT_TTL=1/0,on._cached_db_instances=new Map;let di=on;var _h=Object.create,Vs=Object.defineProperty,wh=Object.getOwnPropertyDescriptor,Qa=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Xa=t=>{throw TypeError(t)},xh=(t,e,r)=>e in t?Vs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sh=(t,e)=>Vs(t,"name",{value:e,configurable:!0}),Eh=t=>[,,,_h(t?.[Qa("metadata")]??null)],Oh=["class","method","getter","setter","accessor","field","value","get","set"],Za=t=>t!==void 0&&typeof t!="function"?Xa("Function expected"):t,Ph=(t,e,r,n,i)=>({kind:Oh[t],name:e,metadata:n,addInitializer:s=>r._?Xa("Already initialized"):i.push(Za(s||null))}),Ch=(t,e)=>xh(e,Qa("metadata"),t[3]),kh=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},$h=(t,e,r,n,i,s)=>{var o,a,c,u=e&7,l=!1,f=0,v=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!l)&&wh(i,r));Sh(i,r);for(var b=n.length-1;b>=0;b--)c=Ph(u,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,Za(o)&&(i=o);return Ch(t,i),y&&Vs(i,r,y),l?u^4?s:y:i},ec,Ks,tc;ec=[ot(["api","storage"])];class hi extends(tc=Tr){constructor(e){super(e,"sitemeta",!1),this.ctx=e,this._data=void 0,this.siteIdentity=void 0,this.CACHE_TTL=1e3*60*60*24,this.VERSION=2,this.db=void 0,this.queryData={meta:"siteinfo|userinfo",siprop:"general|specialpagealiases|namespacealiases|namespaces|magicwords",uiprop:"groups|rights|blockinfo|options"},this.db=e.storage.createDatabse("sitemeta",this.CACHE_TTL,this.VERSION)}get api(){return this.ctx.api}get mwConfig(){return mw.config.values}async start(){const e=await this.fetchFromCache();if(e){this.ctx.logger("SiteMetadataService").info("Using cached metadata"),this._data=e;return}const r=await this.fetchFromApi();this.saveToCache(r),this._data=r}async computeSiteIdentity(){if(this.siteIdentity)return this.siteIdentity;let e;if(!window.mw?.config)e=new URL(location.href).origin;else{const{wgServer:r,wgArticlePath:n}=window.mw.config.get();e=`${r}${n}`}return this.siteIdentity=e,this.siteIdentity}async fetchFromApi(){return this.api.get({action:"query",...this.queryData}).then(({data:e})=>{if(typeof e?.query?.general>"u")throw new Error("Invalid siteinfo");return e.query}).catch(e=>(this.ctx.logger.error("[InPageEdit]","fetchMetadata error",e),Promise.reject(e)))}async fetchFromCache(){const e=await this.computeSiteIdentity();return this.db.get(e)}async saveToCache(e){const r=await this.computeSiteIdentity();return this.db.set(r,e)}get _raw(){return this._data}get siteInfo(){return this._data.general}get specialPageAliases(){return this._data.specialpagealiases}get namespaceAliases(){return this._data.namespacealiases}get namespaces(){return this._data.namespaces}get namespaceMap(){const e=Object.values(this.namespaces).map(r=>({id:r.id,canonical:r.canonical,aliases:this.namespaceAliases.filter(n=>n.id===r.id).map(n=>n.alias)})).sort((r,n)=>r.id-n.id);return Reflect.defineProperty(this,"namespaceMap",{value:e,writable:!1,configurable:!1,enumerable:!0}),e}get magicWords(){return this._data.magicwords}get userInfo(){return this._data.userinfo}get userOptions(){return this.userInfo.options}get isUserBlocked(){return this.userInfo.blockedbyid&&this.userInfo.blockexpiry&&new Date(this.userInfo.blockexpiry).getTime()>Date.now()}get userGroups(){return this.userInfo.groups}get userRights(){return this.userInfo.rights}hasRight(e){return this.userRights.includes(e)}hasAnyRight(...e){return e.some(r=>this.hasRight(r))}hasEveryRights(...e){return e.every(r=>this.hasRight(r))}inGroup(e){return this.userGroups.includes(e)}inAnyGroup(...e){return this.userGroups.some(r=>e.includes(r))}getBlockInfo(){return this.isUserBlocked?{blockid:this.userInfo.blockid,blockedby:this.userInfo.blockedbyid,blockedbyid:this.userInfo.blockedbyid,blockreason:this.userInfo.blockreason,blockedtimestamp:this.userInfo.blockedtimestamp,blockexpiry:this.userInfo.blockexpiry}:null}}Ks=Eh(tc),hi=$h(Ks,0,"SiteMetadataService",ec,hi),kh(Ks,1,hi);const ls=class ls{constructor(e,r){this.pageInfo={...ls.DEFAULT_PAGE_INFO,...e},this.api=r||new qa}async getPageInfo(e){const{data:{query:{pages:[r]}}}=await this.api.get({action:"query",prop:"info|templates|transcludedin|images|pageimages|revisions",inprop:"protection|url|varianttitles",intestactions:"edit|move|delete",tllimit:"max",tilimit:"max",imlimit:"max",piprop:"thumbnail|name|original",pithumbsize:"200",pilimit:"max",rvprop:"ids|timestamp|flags|comment|user|content",...e});return r.revisions?.forEach(n=>{if(typeof n.slots=="object"){const i=n.slots.main;i&&(n.content=i.content,n.contentmodel=i.contentmodel,n.contentformat=i.contentformat)}}),r}async parse(e){return this.api.post({action:"parse",page:this.pageInfo.title,prop:"text|langlinks|categories|links|templates|images|externallinks|sections|revid|displaytitle|iwlinks|properties|parsewarnings",...e})}async preview(e,r){return this.parse({action:"parse",page:void 0,title:this.title,text:e,pst:1,preview:1,disableeditsection:1,disablelimitreport:1,...r})}async edit(e,r){const{text:n,prependtext:i,appendtext:s,summary:o="",watchlist:a="preferences"}=e;return this.api.postWithEditToken({action:"edit",title:this.title,starttimestamp:this.pageInfo.touched,basetimestamp:this.revisions[0]?.timestamp,text:n,prependtext:i,appendtext:s,summary:o,watchlist:a,...r})}async createOnly(e,r){return this.edit(e,{createonly:1,...r})}async delete(e,r){return this.api.postWithEditToken({action:"delete",pageid:this.pageInfo.pageid,reason:e,...r})}async moveTo(e,r,n){return this.api.postWithEditToken({action:"move",from:this.pageInfo.title,to:e,reason:r,movetalk:1,movesubpages:1,...n})}userCan(e){return this.pageInfo?.actions?.[e]}userCanEdit(){return this.userCan("edit")}async refetch(){const e=await this.getPageInfo({pageids:this.pageInfo.pageid,titles:this.pageInfo.title}),r=(this.pageInfo.revisions||[]).concat(e.revisions||[]).sort((n,i)=>n.revid-i.revid).reduce((n,i)=>(n.find(s=>s.revid===i.revid)||n.push(i),n),[]);return this.pageInfo=e,this.pageInfo.revisions=r,this}get pageid(){return this.pageInfo.pageid}get title(){return this.pageInfo.title}get ns(){return this.pageInfo.ns}get contentmodel(){return this.pageInfo.contentmodel}get fullurl(){return this.pageInfo.fullurl}get canonicalurl(){return this.pageInfo.canonicalurl}get editurl(){return this.pageInfo.editurl}get revisions(){return this.pageInfo.revisions||[]}get templates(){return this.pageInfo.templates||[]}get images(){return this.pageInfo.images||[]}};ls.DEFAULT_PAGE_INFO={pageid:0,ns:0,title:"",contentmodel:"wikitext",pagelanguage:"",pagelanguagehtmlcode:"",pagelanguagedir:"ltr",touched:new Date().toISOString(),lastrevid:0,length:0,protection:[],restrictiontypes:[],fullurl:"",canonicalurl:"",editurl:"",varianttitles:{},actions:{edit:!0,move:!1,delete:!1},revisions:[],templates:[],images:[]};let gn=ls;const la=class la extends Tr{constructor(e){super(e,"wikiPage",!0),this.ctx=e}get WikiPage(){return gn}async createInstance(e){const{data:{query:{pages:[r]}}}=await this.ctx.api.get({action:"query",prop:"info|templates|transcludedin|images|pageimages|revisions",inprop:"protection|url|varianttitles",intestactions:"edit|move|delete",tllimit:"max",tilimit:"max",imlimit:"max",piprop:"thumbnail|name|original",pithumbsize:"200",pilimit:"max",rvprop:"ids|timestamp|user|userid|content",...e});return new gn(r,this.ctx.api)}async newFromTitle(e,r=!1,n){return this.createInstance({titles:e,converttitles:r,rvsection:n})}async newFromPageId(e,r){return this.createInstance({pageids:e,rvsection:r})}async newFromRevision(e,r){return this.createInstance({revids:e,rvsection:r})}newBlankPage(e={}){return new gn(e,this.ctx.api)}};la.inject=["api"];let Js=la;/**
32
32
  * ✏️ InPageEdit NEXT
33
33
  *
34
34
  * 🚀 Modular, Extensible Supercharged Plugin for MediaWiki
@@ -36,53 +36,53 @@
36
36
  * @author dragon-fish <dragon-fish@qq.com>
37
37
  * @license MIT
38
38
  * @see https://github.com/inpageedit/inpageedit-next
39
- */const us=class us extends La{constructor(r){super();va(this,lr);this.Endpoints=Nr,this.Schema=Pe,this.version="0.0.0",this.config={...us.DEFAULT_CONFIG,...r},ws(this,lr,gf).call(this),ws(this,lr,yf).call(this),ws(this,lr,vf).call(this)}async useScope(r){const{promise:n,resolve:i}=Ee();return this.inject(r,s=>{i(s)}),n}};lr=new WeakSet,gf=async function(){this.plugin(Dd,{baseURL:this.config.baseURL}),this.plugin(Nd),this.plugin(qs),this.plugin(ih),this.plugin(hi),this.plugin(Ks)},yf=async function(){[Promise.resolve().then(()=>kh).then(({PluginPreferences:n})=>n),Promise.resolve().then(()=>Gh).then(({PluginQuickEdit:n})=>n),Promise.resolve().then(()=>ap).then(({PluginQuickMove:n})=>n),Promise.resolve().then(()=>vp).then(({PluginQuickPreview:n})=>n),Promise.resolve().then(()=>am).then(({PluginQuickDiff:n})=>n),Promise.resolve().then(()=>cm).then(({PluginQuickRedirect:n})=>n),Promise.resolve().then(()=>bm).then(({PluginToolbox:n})=>n)].forEach(async n=>{this.plugin(await n)})},vf=async function(){this.inject(["resourceLoader"],r=>{r.resourceLoader.loadStyle((void 0)("./style.css")),r.resourceLoader.loadStyle(`${Nr.PLUGIN_CDN_BASE}/skins/ipe-default.css`)})},us.DEFAULT_CONFIG={baseURL:"",legacyPreferences:{}};let gr=us;function mh(t){return t.charAt(0).toLowerCase()+t.slice(1)}function gh(t){return mh(t).replace(/-/g,"_").replace(/.[A-Z]+/g,e=>e[0]+"_"+e.slice(1).toLowerCase())}class Pt{constructor(e,r=void 0,n){va(this,Wn);this.ctx=e,this.disposeHandlers=[],this.name=n||this.constructor.name,this.config=r||{};const{promise:i,resolve:s,reject:o}=Promise.withResolvers();queueMicrotask(()=>{try{const a=this.start();a&&typeof a.then=="function"?a.then(()=>s()).catch(c=>{this.logger.error("Plugin start failed",c),o(c)}):s()}catch(a){this.logger.error("Plugin start threw synchronously",a),o(a)}i.then(()=>{this.logger.info("Plugin started")}),i.catch(a=>{this.logger.error("Plugin start failed",a),this.ctx.scope.dispose()})}),this.ctx.once("dispose",()=>{this.disposeHandlers.forEach(a=>a(this.ctx)),this.stop(),this.logger.info("Plugin disposed")})}start(){}stop(){}addDisposeHandler(e){this.disposeHandlers.push(e)}removeDisposeHandler(e){this.disposeHandlers=this.disposeHandlers.filter(r=>r!==e)}set name(e){mf(this,Wn,gh(e).toUpperCase())}get name(){return pf(this,Wn)}get logger(){return this.ctx.logger(this.name)}}Wn=new WeakMap,window.RLQ||(window.RLQ=[]),window.__IPE_MODULES__||(window.__IPE_MODULES__=[]),window.RLQ.push(yh);async function yh(){typeof window?.ipe?.stop=="function"&&(console.warn("[InPageEdit] Plugin already loaded, disposing..."),await window.ipe.stop());const t=window.InPageEdit||{},e=new gr({baseURL:window.mw?.util.wikiScript("api"),legacyPreferences:t?.myPreferences||{}});if(window.InPageEdit=gr,window.ipe=e,window.mw.hook("InPageEdit.ready").fire(e),await e.start(),Array.isArray(window.__IPE_MODULES__)){const r=[];for(;window.__IPE_MODULES__.length;)try{const n=window.__IPE_MODULES__.shift();typeof n=="function"&&n?.(e),r.push(n)}catch(n){console.error("[InPageEdit] Failed to initialize module:",n)}window.__IPE_MODULES__={push:n=>{typeof n=="function"&&n(e),r.push(n)}},e.on("dispose",()=>{window.__IPE_MODULES__=r})}e.logger("AUTOLOAD").info(`${Nr.HOME_URL}
39
+ */const us=class us extends Ma{constructor(r){super();ba(this,ur);this.Endpoints=Dr,this.Schema=ke,this.version="0.3.1",this.config={...us.DEFAULT_CONFIG,...r},ws(this,ur,Af).call(this),ws(this,ur,Tf).call(this),ws(this,ur,Rf).call(this)}async useScope(r){const{promise:n,resolve:i}=Ee();return this.inject(r,s=>{i(s)}),n}};ur=new WeakSet,Af=async function(){this.plugin(Yd,{baseURL:this.config.baseURL}),this.plugin(Gd),this.plugin(Hs),this.plugin(bh),this.plugin(hi),this.plugin(Js)},Tf=async function(){[Promise.resolve().then(()=>Hh).then(({PluginPreferences:n})=>n),Promise.resolve().then(()=>fp).then(({PluginQuickEdit:n})=>n),Promise.resolve().then(()=>xp).then(({PluginQuickMove:n})=>n),Promise.resolve().then(()=>Rp).then(({PluginQuickPreview:n})=>n),Promise.resolve().then(()=>xm).then(({PluginQuickDiff:n})=>n),Promise.resolve().then(()=>Sm).then(({PluginQuickRedirect:n})=>n),Promise.resolve().then(()=>Nm).then(({PluginToolbox:n})=>n)].forEach(async n=>{this.plugin(await n)})},Rf=async function(){this.inject(["resourceLoader"],r=>{r.resourceLoader.loadStyle(`${Dr.PLUGIN_CDN_BASE}/skins/ipe-default.css`)})},us.DEFAULT_CONFIG={baseURL:"",legacyPreferences:{}};let yr=us;function Ih(t){return t.charAt(0).toLowerCase()+t.slice(1)}function Ah(t){return Ih(t).replace(/-/g,"_").replace(/.[A-Z]+/g,e=>e[0]+"_"+e.slice(1).toLowerCase())}class kt{constructor(e,r=void 0,n){ba(this,Wn);this.ctx=e,this.disposeHandlers=[],this.name=n||this.constructor.name,this.config=r||{};const{promise:i,resolve:s,reject:o}=Promise.withResolvers();queueMicrotask(()=>{try{const a=this.start();a&&typeof a.then=="function"?a.then(()=>s()).catch(c=>{this.logger.error("Plugin start failed",c),o(c)}):s()}catch(a){this.logger.error("Plugin start threw synchronously",a),o(a)}i.then(()=>{this.logger.info("Plugin started")}),i.catch(a=>{this.logger.error("Plugin start failed",a),this.ctx.scope.dispose()})}),this.ctx.once("dispose",()=>{this.disposeHandlers.forEach(a=>a(this.ctx)),this.stop(),this.logger.info("Plugin disposed")})}start(){}stop(){}addDisposeHandler(e){this.disposeHandlers.push(e)}removeDisposeHandler(e){this.disposeHandlers=this.disposeHandlers.filter(r=>r!==e)}set name(e){If(this,Wn,Ah(e).toUpperCase())}get name(){return $f(this,Wn)}get logger(){return this.ctx.logger(this.name)}}Wn=new WeakMap,window.RLQ||(window.RLQ=[]),window.__IPE_MODULES__||(window.__IPE_MODULES__=[]),window.RLQ.push(Th);async function Th(){typeof window?.ipe?.stop=="function"&&(console.warn("[InPageEdit] Plugin already loaded, disposing..."),await window.ipe.stop());const t=window.InPageEdit||{},e=new yr({baseURL:window.mw?.util.wikiScript("api"),legacyPreferences:t?.myPreferences||{}});if(window.InPageEdit=yr,window.ipe=e,window.mw.hook("InPageEdit.ready").fire(e),await e.start(),Array.isArray(window.__IPE_MODULES__)){const r=[];for(;window.__IPE_MODULES__.length;)try{const n=window.__IPE_MODULES__.shift();typeof n=="function"&&n?.(e),r.push(n)}catch(n){console.error("[InPageEdit] Failed to initialize module:",n)}window.__IPE_MODULES__={push:n=>{typeof n=="function"&&n(e),r.push(n)}},e.on("dispose",()=>{window.__IPE_MODULES__=r})}e.logger("AUTOLOAD").info(`${Dr.HOME_URL}
40
40
  ____ ____ ______ ___ __
41
41
  / _/___ / __ \\____ _____ ____ / ____/___/ (_) /_
42
42
  / // __ \\/ /_/ / __ \`/ __ \`/ _ \\/ __/ / __ / / __/
43
43
  _/ // / / / ____/ /_/ / /_/ / __/ /___/ /_/ / / /_
44
44
  /___/_/ /_/_/ \\__,_/\\__, /\\___/_____/\\__,_/_/\\__/
45
- /____/ v`+e.version)}const vh=window?.location?.origin,pi=({type:t,tag:e,href:r,target:n,children:i,...s})=>(e=e||(r?"a":"button"),typeof n>"u"&&r&&r.startsWith("http")&&!r.startsWith(vh)&&(n="_blank"),Qd(e,{className:`theme-ipe ipe-action-button btn btn-${t||"default"}`,href:e==="a"?r:void 0,target:e==="a"?n:void 0,"data-href":e!=="a"?r:void 0,...s},i));var bh=Object.create,Js=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,ec=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),tc=t=>{throw TypeError(t)},wh=(t,e,r)=>e in t?Js(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xh=(t,e)=>Js(t,"name",{value:e,configurable:!0}),Sh=t=>[,,,bh(t?.[ec("metadata")]??null)],Eh=["class","method","getter","setter","accessor","field","value","get","set"],rc=t=>t!==void 0&&typeof t!="function"?tc("Function expected"):t,Oh=(t,e,r,n,i)=>({kind:Eh[t],name:e,metadata:n,addInitializer:s=>r._?tc("Already initialized"):i.push(rc(s||null))}),Ch=(t,e)=>wh(e,ec("metadata"),t[3]),Ph=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},$h=(t,e,r,n,i,s)=>{var o,a,c,l=e&7,u=!1,f=0,v=t[f]||(t[f]=[]),y=l&&(i=i.prototype,l<5&&(l>3||!u)&&_h(i,r));xh(i,r);for(var b=n.length-1;b>=0;b--)c=Oh(l,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,rc(o)&&(i=o);return Ch(t,i),y&&Js(i,r,y),u?l^4?s:y:i},nc,Ys,ic;nc=[st(["sitemeta","storage"])];class mi extends(ic=Pt){constructor(e){super(e,{},"preferences"),this.ctx=e,this.db=void 0,this.customRegistries=[],this.categoryDefinitions=[],this._defaultPreferences={},this.db=e.storage.createDatabse("preferences",1/0),this.ctx.set("preferences",this)}async start(){this.defineCategory({name:"general",label:"General",description:"General settings"}),this.defineCategory({name:"edit",label:"Editing",description:"Settings related to editing content"}),this.defineCategory({name:"about",label:"About",description:"About InPageEdit",index:99}),this.registerCustomConfig("about",Pe.object({about:Pe.string().role("html-info").description(O("div",{className:"prose",children:[O("h2",{children:"✏️ InPageEdit NEXT"}),O("i",{children:["v",this.ctx.version]}),O("h2",{children:"Portal"}),O("div",{style:"display: flex; flex-direction: column; gap: 1rem",children:[O(pi,{href:"https://www.ipe.wiki",style:{display:"block",width:"100%"},children:"Official Website & Help Center"}),O(pi,{href:"https://www.ipe.wiki/update/",style:{display:"block",width:"100%"},children:"Update Logs"})]}),O("h2",{children:"Join us"}),O("ul",{children:[O("li",{children:[O("strong",{children:"GitHub"}),":"," ",O("a",{href:"https://github.com/inpageedit/inpageedit-next",target:"_blank",children:"inpageedit/inpageedit-next"})]}),O("li",{children:[O("strong",{children:"QQ Group"}),": 1026023666"]})]}),O("hr",{}),O("p",{children:"🚀 Modular, Extensible Supercharged Plugin for MediaWiki."}),O("p",{children:"InPageEdit-NEXT Copyright © 2025-present dragon-fish"})]}).outerHTML).default("")}).description(""),"about",{}),Promise.resolve().then(()=>Iv).then(e=>{const r=this.ctx.plugin(e.PluginPreferencesUI);this.addDisposeHandler(()=>{r.dispose()})})}get(e,r){return r||(r=()=>{const i=this.getDefaultValue(e);return this.logger.info("default value used",i),i}),this.db.get(e,void 0,r)}getDefaultValue(e){var r;return(r=this._defaultPreferences)[e]??(r[e]=this.loadDefaultConfigs()[e])}set(e,r){const n=this.getDefaultValue(e);return r===n?this.db.delete(e):this.db.set(e,r)}async getAll(){const e=this.loadDefaultConfigs();return await this.db.iterate((r,n)=>{e[n]=r}),e}loadDefaultConfigs(){const e={};return this.getConfigRegistries().forEach(r=>{r.defaults&&Object.entries(r.defaults).forEach(([n,i])=>{e[n]=i,this._defaultPreferences[n]=i})}),e}registerCustomConfig(e,r,n,i){return this.customRegistries.push({name:e,schema:r,category:n,defaults:i}),this}getConfigRegistries(e){return Array.from(this.ctx.registry.entries()).map(([r,n])=>r===null?{name:"root",schema:gr?.PreferencesSchema||null,defaults:gr?.PreferencesDefaults||{}}:{name:r.name,schema:r?.PreferencesSchema||null,defaults:r?.PreferencesDefaults||{}}).filter(r=>r.schema!==null).map(r=>({...r,category:r.schema.meta.category||"general"})).concat(this.customRegistries).filter(r=>!e||r.category===e)}defineCategory(e){const r=this.categoryDefinitions.findIndex(n=>n.name===e.name);return r<0?this.categoryDefinitions.push(e):this.categoryDefinitions[r]=e,this.categoryDefinitions.sort((n,i)=>(n.index??0)-(i.index??0)),this}getConfigCategories(){return this.categoryDefinitions}}Ys=Sh(ic),mi=$h(Ys,0,"PluginPreferences",nc,mi),Ph(Ys,1,mi);const kh=Object.freeze(Object.defineProperty({__proto__:null,get PluginPreferences(){return mi}},Symbol.toStringTag,{value:"Module"}));var gt=(t=>(t.preferences="preferences",t.watch="watch",t.unwatch="unwatch",t.nochange="nochange",t))(gt||{});function gi(t,e){return function(r){return r.PreferencesSchema=t,r.PreferencesDefaults=e,r}}var Ih=Object.create,Gs=Object.defineProperty,Ah=Object.getOwnPropertyDescriptor,sc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),oc=t=>{throw TypeError(t)},Th=(t,e,r)=>e in t?Gs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rh=(t,e)=>Gs(t,"name",{value:e,configurable:!0}),Dh=t=>[,,,Ih(t?.[sc("metadata")]??null)],Nh=["class","method","getter","setter","accessor","field","value","get","set"],ac=t=>t!==void 0&&typeof t!="function"?oc("Function expected"):t,Lh=(t,e,r,n,i)=>({kind:Nh[t],name:e,metadata:n,addInitializer:s=>r._?oc("Already initialized"):i.push(ac(s||null))}),Mh=(t,e)=>Th(e,sc("metadata"),t[3]),Fh=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},jh=(t,e,r,n,i,s)=>{var o,a,c,l=e&7,u=!1,f=0,v=t[f]||(t[f]=[]),y=l&&(i=i.prototype,l<5&&(l>3||!u)&&Ah(i,r));Rh(i,r);for(var b=n.length-1;b>=0;b--)c=Lh(l,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,ac(o)&&(i=o);return Mh(t,i),y&&Gs(i,r,y),u?l^4?s:y:i},cc,Qs,lc;cc=[st(["sitemeta","quickEdit"]),gi(Pe.object({redLinkEdit:Pe.boolean().description("Show quick edit entry after red links").default(!0)}).description("In-article quick edit links"),{redLinkEdit:!0})];class yi extends(lc=Pt){constructor(e){const r=e.sitemeta.mwConfig,n=r.wgArticlePath.replace("$1",""),i=`${location.protocol}//${r.wgServer.split("//")[1]}`;super(e,{wikiBaseUrl:i,wikiArticlePath:n,wikiArticleBaseUrl:`${i}${n}`,wikiScriptBaseUrl:`${i}${r.wgScriptPath}`,linkClassName:"ipe-quickEdit__in-article-link"},"QuickEditInArticleLinks")}async start(){mw.hook("wikipage.content").add(()=>{document.querySelectorAll("#mw-content-text a[href]").forEach(r=>{const n=this.checkEditAnchor(r);if(!n||r.dataset.ipeQuickEditLink)return;const i=O("a",{href:`#/IPE/quickEdit/${n.title}`,className:this.config.linkClassName,style:{userSelect:"none",marginLeft:"0.2em",verticalAlign:"middle"},onClick:s=>{s.preventDefault(),this.ctx.quickEdit(n)},children:O("svg",{style:"width: 1em; height: 1em",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-pencil-bolt",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),O("path",{d:"M13.5 6.5l4 4"}),O("path",{d:"M19 16l-2 3h4l-2 3"})]})});r.insertAdjacentElement("afterend",i),r.dataset.ipeQuickEditLink="true"})})}stop(){document.querySelectorAll(`.${this.config.linkClassName}`).forEach(e=>e.remove())}checkEditAnchor(e){if(!(e instanceof HTMLAnchorElement))return null;const r=e.href||"";if(!r.startsWith(this.config.wikiArticleBaseUrl)&&!r.startsWith(this.config.wikiScriptBaseUrl))return null;const n=new URL(r),i=n.searchParams,s=i.get("action")||"view",o=i.get("title")||decodeURI(n.pathname.substring(this.config.wikiArticlePath.length))||"",a=i.get("section")?.replace(/^T-/,"")||void 0,c=i.get("oldid");if(!o||o.endsWith(".php")||!["edit","editsource","editredlink","submit"].includes(s)||i.get("undo")||i.get("preload"))return null;let l;return a==="new"?l="new":a&&/^\d+$/.test(a)&&(l=parseInt(a,10)),{title:o,section:l,revision:parseInt(""+c,10)||0,createOnly:!!i.get("redlink")}}}Qs=Dh(lc),yi=jh(Qs,0,"PluginQuickEditInArticleLinks",cc,yi),Fh(Qs,1,yi);const vi={mbox:"_mbox_v5fz5_1",title:"_title_v5fz5_12",content:"_content_v5fz5_19",close:"_close_v5fz5_27"},uc=t=>{const{type:e="default",title:r,content:n,closeable:i=!0,titleProps:s,contentProps:o,children:a,...c}=t;let l=r;typeof r>"u"&&e!=="default"&&(l=e[0].toUpperCase()+e.slice(1).toLowerCase());const u=async()=>{if(!f)return Promise.resolve();const{promise:v,resolve:y}=Promise.withResolvers();return f.animate([{opacity:"1",height:f.clientHeight+"px"},{opacity:"0",height:"0px",margin:"0px"}],{duration:300,easing:"ease"}).addEventListener("finish",()=>{f.remove(),y()}),v},f=O("div",{className:`theme-ipe ipe-mbox mbox-type-${e||"default"} ${vi.mbox}`,...c,children:[l&&O("div",{className:`ipe-mbox-title ${vi.title}`,...s,children:l}),O("div",{className:`ipe-mbox-content ${vi.content}`,...o,children:a||n}),i&&O("a",{onClick:u,className:`ipe-mbox-close ${vi.close}`,children:"×"})]});return f.close=u,f},Xs=t=>{const{label:e,id:r,name:n,value:i,disabled:s,labelProps:o,inputProps:a,...c}=t;return O("div",{className:"theme-ipe ipe-input-box",...c,children:[O("label",{htmlFor:r,style:{display:"block"},...o,children:e}),O("input",{id:r,name:n,value:i,disabled:s,style:{width:"100%"},...a})]})},fc=t=>{const{id:e,name:r,value:n,label:i,inputProps:s,labelProps:o,children:a,...c}=t;return O("label",{className:"theme-ipe ipe-radio-box",...c,children:[O("input",{type:"radio",id:e,name:r,value:n,...s}),O("span",{className:"ipe-checkbox-box"}),O("span",{...o,children:i||a})]})},Lr=t=>{const{id:e,name:r,label:n,checked:i,inputProps:s,labelProps:o,children:a,...c}=t;return O("label",{className:"theme-ipe ipe-checkbox",...c,children:[O("input",{type:"checkbox",id:e,name:r,checked:i,...s}),O("span",{className:"ipe-checkbox-box"}),O("span",{...o,children:n||a})]})},dc=()=>{},hc=(t=0)=>new Promise(e=>setTimeout(e,t));var Bh=Object.create,Zs=Object.defineProperty,Uh=Object.getOwnPropertyDescriptor,pc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),mc=t=>{throw TypeError(t)},Wh=(t,e,r)=>e in t?Zs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qh=(t,e)=>Zs(t,"name",{value:e,configurable:!0}),Hh=t=>[,,,Bh(t?.[pc("metadata")]??null)],zh=["class","method","getter","setter","accessor","field","value","get","set"],gc=t=>t!==void 0&&typeof t!="function"?mc("Function expected"):t,Vh=(t,e,r,n,i)=>({kind:zh[t],name:e,metadata:n,addInitializer:s=>r._?mc("Already initialized"):i.push(gc(s||null))}),Kh=(t,e)=>Wh(e,pc("metadata"),t[3]),Jh=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},Yh=(t,e,r,n,i,s)=>{var o,a,c,l=e&7,u=!1,f=0,v=t[f]||(t[f]=[]),y=l&&(i=i.prototype,l<5&&(l>3||!u)&&Uh(i,r));qh(i,r);for(var b=n.length-1;b>=0;b--)c=Vh(l,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,gc(o)&&(i=o);return Kh(t,i),y&&Zs(i,r,y),u?l^4?s:y:i},yc,eo,vc;yc=[st(["api","wikiPage","modal","preferences"]),gi(Pe.object({editSummary:Pe.string().description("Default edit summary for quick edits").default("[IPE-NEXT] Quick edit"),editMinor:Pe.boolean().description("Whether to mark the edit as minor").default(!1),outSideClose:Pe.boolean().description("Whether to close the modal outside").default(!0),watchList:Pe.union([Pe.const(gt.preferences).description("Follow my preferences"),Pe.const(gt.nochange).description("Keep the current watchlist status"),Pe.const(gt.watch).description("Add the page to watchlist"),Pe.const(gt.unwatch).description("Remove the page from watchlist")]).description("Watchlist options").default(gt.preferences)}).description("Quick edit options").extra("category","edit"),{editSummary:"[IPE-NEXT] Quick edit",editMinor:!1,outSideClose:!0,watchList:gt.preferences})];class bi extends(vc=Pt){constructor(e){super(e,{},"quick-edit"),this.ctx=e,this.DEFAULT_OPTIONS={title:"",pageId:0,revision:0,section:void 0,editMinor:!1,editSummary:"",createOnly:!1,reloadAfterSave:!0}}start(){this.ctx.root.set("quickEdit",this.quickEdit.bind(this)),this.ctx.inject(["toolbox"],e=>{this.injectToolbox(e),e.on("dispose",()=>{this.removeToolbox(e)})}),this.ctx.plugin(yi)}async quickEdit(e){typeof e>"u"?e={}:typeof e=="string"&&(e={title:e}),e?.page&&(e.title=e.page,delete e.page),!e.title&&!e.pageId&&!e.revision&&(this.logger.warn("None of the title, pageId or revision provided. Using defaults."),e={...e,title:mw.config.get("wgPageName"),pageId:mw.config.get("wgArticleId"),revision:mw.config.get("wgRevisionId")});const r=await this.ctx.preferences.get("outSideClose"),n=await this.ctx.preferences.get("watchList"),i=typeof e.editSummary=="string"?e.editSummary:await this.ctx.preferences.get("editSummary"),s=typeof e.editMinor=="boolean"?e.editMinor:await this.ctx.preferences.get("editMinor"),o={...this.DEFAULT_OPTIONS,editSummary:i,editMinor:s,...e};o.editSummary||(o.editSummary=await this.ctx.preferences.get("editSummary")||""),o||this.ctx.emit("quickEdit/initOptions",{ctx:this.ctx,options:o});const a=this.ctx.modal.createObject({className:"in-page-edit ipe-quickEdit ipe-editor",sizeClass:"large",outSideClose:r}).init();a.setTitle(O(ci,{children:["Loading: ",O("u",{children:o.title})]})),a.setContent(O("section",{className:"ipe-quickEdit-loading",style:{height:"70vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:O(mr,{})})),a.setButtons([{side:"right",type:"button",className:"btn btn-danger btn-secondary",label:"Cancel",method(){a.close()}}]),a.show(),this.ctx.emit("quickEdit/showModal",{ctx:this.ctx,modal:a,options:o});let c;try{c=await this.getWikiPageFromPayload(o)}catch(f){a.close(),this.ctx.modal.notify("error",{title:"Error",content:f instanceof Error?f.message:String(f)});return}a.setTitle(O(ci,{children:["Quick ",c.pageInfo.pageid===0?"Create":"Edit",":"," ",O("u",{children:c.pageInfo.title})]}));const l=O("form",{className:"ipe-quickEdit-form",children:[c.pageInfo.pageid===0&&O(uc,{title:"Attention",type:"important",children:O("p",{children:"This page does not exist."})}),O("textarea",{className:"editArea",name:"text",id:"wpTextbox1",children:c.revisions[0]?.content||""}),O("div",{class:"ipe-quickEdit-options",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[O(Xs,{label:"Summary",id:"summary",name:"summary",value:o.editSummary}),O("div",{children:[O("label",{htmlFor:"watchlist",style:{display:"block"},children:"Watchlist"}),O("div",{style:{display:"flex",gap:"1rem"},children:[gt.preferences,gt.nochange,gt.watch,gt.unwatch].map(f=>O(fc,{name:"watchlist",value:f,inputProps:{checked:n===f},children:f},f))})]}),O("div",{style:{display:"flex",gap:"1rem"},children:[O(Lr,{name:"minor",id:"minor",checked:o.editMinor,children:"Minor edit"}),O(Lr,{name:"reloadAfterSave",id:"reloadAfterSave",checked:o.reloadAfterSave,children:"Reload after save"})]})]}),!1]});a.setContent(l);const u=a.generateButton({side:"left",className:"btn btn-primary submit-btn",label:"Submit",method:()=>{const f=new FormData(l);console.info(c,l,{text:f.get("text"),summary:f.get("summary"),minor:f.get("minor")==="on"}),a.setLoadingState(!0),this.handleSubmit({ctx:this.ctx,modal:a,wikiPage:c,options:o},{text:f.get("text"),summary:f.get("summary"),minor:f.get("minor")==="on"}).then(async()=>{a.setOptions({beforeClose:dc}),a.close(),this.ctx.modal.notify("success",{title:"Submission Successful",content:"Your changes have been saved."}),f.get("reloadAfterSave")&&(await hc(500),location.reload())}).catch(v=>{this.ctx.modal.notify("error",{title:"Submission Error",content:v instanceof Error?v.message:String(v)}),a.setLoadingState(!1)})}});a.get$buttons("leftButtons").prepend(u),a.setOptions({beforeClose:()=>{const f=c.revisions[0]?.content||"";return(l.querySelector("textarea")?.value||"")===f?!0:(this.ctx.modal.confirm({className:"in-page-edit",title:"Unsaved Changes",content:"All edit contents will be lost after closing the modal. Are you sure you want to close?",center:!0,okBtn:{label:"Give Up",className:"btn btn-danger"},cancelBtn:{label:"Continue",className:"btn"}},y=>(y&&(a.setOptions({beforeClose:dc}),a.close()),!0)),!1)}}),this.ctx.emit("quickEdit/wikiPage",{ctx:this.ctx,options:o,modal:a,wikiPage:c})}handleSubmit(e,r){const n=r.summary||"",i=r.text||"",s=r.minor||!1,o=r.createonly||!1,a=r.watchlist||gt.nochange;return e.wikiPage.edit({summary:n,text:i,watchlist:a},{minor:s,createonly:o})}injectToolbox(e){e.toolbox.addButton({id:"quick-edit",group:"group1",index:0,icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-edit",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"}),O("path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z"}),O("path",{d:"M16 5l3 3"})]}),tooltip:"Edit this page quickly",onClick:()=>this.quickEdit()})}async getWikiPageFromPayload(e){if(e.revision)return this.ctx.wikiPage.newFromRevision(e.revision,e.section);if(e.pageId)return this.ctx.wikiPage.newFromPageId(e.pageId,e.section);if(e.title)return this.ctx.wikiPage.newFromTitle(e.title,!1,e.section);throw new Error("Invalid payload")}removeToolbox(e){e.toolbox.removeButton("quick-edit")}}eo=Hh(vc),bi=Yh(eo,0,"PluginQuickEdit",yc,bi),Jh(eo,1,bi);const Gh=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickEdit(){return bi}},Symbol.toStringTag,{value:"Module"})),yn={twinSwapInput:"_twinSwapInput_1gdgl_9",inputWrapper:"_inputWrapper_1gdgl_23",inputLeft:"_inputLeft_1gdgl_27",inputRight:"_inputRight_1gdgl_30",swapButton:"_swapButton_1gdgl_46"},bc=t=>{const{inputs:e,enableSwap:r=!0,...n}=t,i=e?.length===2?e:[e?.[0]??{},e?.[1]??{}],s=[null,null];let o=0,a=null,c=null;const l=()=>s.some(b=>b&&b.disabled),u=()=>{if(!s[0]||!s[1]||l())return;const b=s[0],R=s[1],H=b.value,B=R.value;b.value=B,R.value=H,b.dispatchEvent(new Event("change")),R.dispatchEvent(new Event("change")),o++,c&&(c.style.transform=`rotateY(${o*-180}deg)`,c.style.transition="transform 200ms ease")},f=b=>{if(!a)return;const R=b??!a.disabled;a.disabled=!R,R&&s.forEach(H=>{H&&(H.disabled=!1)})},v=O("button",{type:"button","aria-label":"Swap values",onClick:u,disabled:l()||!r,ref:b=>a=b,children:O("svg",{ref:b=>c=b,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon-tabler icons-tabler-outline icon-tabler-transfer",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M20 10h-16l5.5 -6"}),O("path",{d:"M4 14h16l-5.5 6"})]})}),y=O("div",{className:`twin-swap-input ${yn.twinSwapInput}`,...n,children:[i.map((b,R)=>{const{label:H,id:B,name:N,value:g,disabled:m,inputProps:h}=b,C=R===0,I=B||N;return O("div",{className:`${yn.inputWrapper} ${C?yn.inputLeft:yn.inputRight}`,children:[H&&O("label",{htmlFor:I,children:H}),O("input",{ref:T=>s[R]=T,type:"text",id:I,name:N,value:g,disabled:m,...h})]})}),O("div",{className:yn.swapButton,children:v})]});return y.swap=u,y.toggleEnableSwap=f,y};var Qh=Object.create,to=Object.defineProperty,Xh=Object.getOwnPropertyDescriptor,_c=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),wc=t=>{throw TypeError(t)},Zh=(t,e,r)=>e in t?to(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ep=(t,e)=>to(t,"name",{value:e,configurable:!0}),tp=t=>[,,,Qh(t?.[_c("metadata")]??null)],rp=["class","method","getter","setter","accessor","field","value","get","set"],xc=t=>t!==void 0&&typeof t!="function"?wc("Function expected"):t,np=(t,e,r,n,i)=>({kind:rp[t],name:e,metadata:n,addInitializer:s=>r._?wc("Already initialized"):i.push(xc(s||null))}),ip=(t,e)=>Zh(e,_c("metadata"),t[3]),sp=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},op=(t,e,r,n,i,s)=>{var o,a,c,l=e&7,u=!1,f=0,v=t[f]||(t[f]=[]),y=l&&(i=i.prototype,l<5&&(l>3||!u)&&Xh(i,r));ep(i,r);for(var b=n.length-1;b>=0;b--)c=np(l,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,xc(o)&&(i=o);return ip(t,i),y&&to(i,r,y),u?l^4?s:y:i},Sc,ro,Ec;Sc=[st(["modal","sitemeta"])];class _i extends(Ec=Pt){constructor(e){super(e,{},"quick-move"),this.ctx=e,e.set("quickMove",this.quickMove.bind(this)),e.set("movePage",this.movePage.bind(this))}start(){this.ctx.inject(["toolbox"],e=>{this.injectToolbox(e)})}injectToolbox(e){const r=window.mw?.config.get("wgPageName")||"",n=window.mw?.config.get("wgIsProbablyEditable");e.toolbox.addButton({id:"quick-move",icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-forms",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3"}),O("path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3"}),O("path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7"}),O("path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1"}),O("path",{d:"M17 12h.01"}),O("path",{d:"M13 12h.01"})]}),tooltip:"Quick Move",group:"group2",onClick:()=>{this.quickMove(n?{lockFromField:!0,from:r}:{})}})}quickMove(e){const r=this.ctx.modal.createObject({title:"Quick Move",content:O(mr,{}),className:"quick-move",sizeClass:"medium",center:!0}).init();let n=null;return r.setContent(O("form",{ref:i=>n=i,style:{display:"flex",flexDirection:"column",gap:"1rem"},onSubmit:i=>{i.preventDefault();const s=new FormData(n),o={from:s.get("from"),to:s.get("to"),reason:s.get("reason")||"",movetalk:s.get("movetalk")==="on",movesubpages:s.get("movesubpages")==="on",noredirect:s.get("noredirect")==="on"};r.setLoadingState(!0),this.movePage(o).then(()=>{location.reload()}).catch(a=>{r.setLoadingState(!1),this.ctx.modal.notify("error",{title:"Failed to move",content:a instanceof Error?a.message:String(a)})})},children:[O(bc,{inputs:[{label:"Move from",name:"from",value:e?.from},{label:"Move to",name:"to",value:e?.to}]}),O("div",{children:O(Lr,{name:"movetalk",id:"movetalk",checked:e?.movetalk,children:"Move talk page"})}),O("div",{children:O(Lr,{name:"movesubpages",id:"movesubpages",checked:e?.movesubpages,children:"Move subpage(s) (up to 100)"})}),this.ctx.sitemeta.hasRight("suppressredirect")&&O("div",{children:O(Lr,{name:"noredirect",id:"noredirect",checked:e?.noredirect,children:"Move without leaving a redirect"})}),O(Xs,{label:"Reason",id:"reason",name:"reason",value:e?.reason}),O("div",{children:O(pi,{type:"primary",style:{width:"100%"},children:"Move"})})]})),r.show()}async movePage(e){const{from:r,to:n,reason:i="",...s}=e;if(!r||!n)throw new Error("From and to titles are required.");if(r===n)throw new Error("From and to titles cannot be the same.");return(await this.ctx.wikiPage.newFromTitle(r)).moveTo(n,i,s)}}ro=tp(Ec),_i=op(ro,0,"PluginQuickMove",Sc,_i),sp(ro,1,_i);const ap=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickMove(){return _i}},Symbol.toStringTag,{value:"Module"}));var cp=Object.create,no=Object.defineProperty,lp=Object.getOwnPropertyDescriptor,Oc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Cc=t=>{throw TypeError(t)},up=(t,e,r)=>e in t?no(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fp=(t,e)=>no(t,"name",{value:e,configurable:!0}),dp=t=>[,,,cp(t?.[Oc("metadata")]??null)],hp=["class","method","getter","setter","accessor","field","value","get","set"],Pc=t=>t!==void 0&&typeof t!="function"?Cc("Function expected"):t,pp=(t,e,r,n,i)=>({kind:hp[t],name:e,metadata:n,addInitializer:s=>r._?Cc("Already initialized"):i.push(Pc(s||null))}),mp=(t,e)=>up(e,Oc("metadata"),t[3]),gp=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},yp=(t,e,r,n,i,s)=>{var o,a,c,l=e&7,u=!1,f=0,v=t[f]||(t[f]=[]),y=l&&(i=i.prototype,l<5&&(l>3||!u)&&lp(i,r));fp(i,r);for(var b=n.length-1;b>=0;b--)c=pp(l,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,Pc(o)&&(i=o);return mp(t,i),y&&no(i,r,y),u?l^4?s:y:i},$c,io,kc;$c=[st(["api","wikiPage","modal"])];class wi extends(kc=Pt){constructor(e){super(e,{},"quickPreview"),this.ctx=e}start(){this.ctx.set("quickPreview",this.quickPreview.bind(this)),this.ctx.on("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}stop(){this.ctx.off("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}injectQuickEdit({ctx:e,modal:r,wikiPage:n}){r.setButtons([{label:"Preview",side:"left",className:"btn btn-secondary",method:()=>{this.quickPreview(r.get$content().find("textarea.editArea").val()||"",void 0,n)}}])}async quickPreview(e,r,n){n||(n=this.ctx.wikiPage.newBlankPage({title:"API"}));const i=this.ctx.modal.createObject({className:"in-page-edit ipe-quickPreview",sizeClass:"large"}).init();i.setTitle("Preview loading..."),i.setContent(O("section",{children:O(mr,{})})),i.show(),this.ctx.emit("quickPreview/showModal",{ctx:this.ctx,text:e,modal:i,wikiPage:n});const{data:{parse:s}}=await n.preview(e,r);i.setTitle(`Preview - ${s.title}`);let o=null;i.setContent(O("section",{children:O("div",{ref:a=>o=a,className:"mw-parser-output",innerHTML:s.text})})),window.mw?.hook("wikipage.content").fire($(o)),this.ctx.emit("quickPreview/loaded",{ctx:this.ctx,modal:i,wikiPage:n,text:e,parseData:s})}}io=dp(kc),wi=yp(io,0,"PluginQuickPreview",$c,wi),gp(io,1,wi);const vp=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickPreview(){return wi}},Symbol.toStringTag,{value:"Module"}));class Ht{diff(e,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);const s=this.castInput(e,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,i)}diffWithOptionsObj(e,r,n,i){var s;const o=N=>{if(N=this.postProcess(N,n),i){setTimeout(function(){i(N)},0);return}else return N},a=r.length,c=e.length;let l=1,u=a+c;n.maxEditLength!=null&&(u=Math.min(u,n.maxEditLength));const f=(s=n.timeout)!==null&&s!==void 0?s:1/0,v=Date.now()+f,y=[{oldPos:-1,lastComponent:void 0}];let b=this.extractCommon(y[0],r,e,0,n);if(y[0].oldPos+1>=c&&b+1>=a)return o(this.buildValues(y[0].lastComponent,r,e));let R=-1/0,H=1/0;const B=()=>{for(let N=Math.max(R,-l);N<=Math.min(H,l);N+=2){let g;const m=y[N-1],h=y[N+1];m&&(y[N-1]=void 0);let C=!1;if(h){const T=h.oldPos-N;C=h&&0<=T&&T<a}const I=m&&m.oldPos+1<c;if(!C&&!I){y[N]=void 0;continue}if(!I||C&&m.oldPos<h.oldPos?g=this.addToPath(h,!0,!1,0,n):g=this.addToPath(m,!1,!0,1,n),b=this.extractCommon(g,r,e,N,n),g.oldPos+1>=c&&b+1>=a)return o(this.buildValues(g.lastComponent,r,e))||!0;y[N]=g,g.oldPos+1>=c&&(H=Math.min(H,N-1)),b+1>=a&&(R=Math.max(R,N+1))}l++};if(i)(function N(){setTimeout(function(){if(l>u||Date.now()>v)return i(void 0);B()||N()},0)})();else for(;l<=u&&Date.now()<=v;){const N=B();if(N)return N}}addToPath(e,r,n,i,s){const o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(e,r,n,i,s){const o=r.length,a=n.length;let c=e.oldPos,l=c-i,u=0;for(;l+1<o&&c+1<a&&this.equals(n[c+1],r[l+1],s);)l++,c++,u++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,l}equals(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){const r=[];for(let n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,n){const i=[];let s;for(;e;)i.push(e),s=e.previousComponent,delete e.previousComponent,e=s;i.reverse();const o=i.length;let a=0,c=0,l=0;for(;a<o;a++){const u=i[a];if(u.removed)u.value=this.join(n.slice(l,l+u.count)),l+=u.count;else{if(!u.added&&this.useLongestToken){let f=r.slice(c,c+u.count);f=f.map(function(v,y){const b=n[l+y];return b.length>v.length?b:v}),u.value=this.join(f)}else u.value=this.join(r.slice(c,c+u.count));c+=u.count,u.added||(l+=u.count)}}return i}}class bp extends Ht{}const Ic=new bp;function Ac(t,e,r){return Ic.diff(t,e,r)}function Tc(t,e){let r;for(r=0;r<t.length&&r<e.length;r++)if(t[r]!=e[r])return t.slice(0,r);return t.slice(0,r)}function Rc(t,e){let r;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(r=0;r<t.length&&r<e.length;r++)if(t[t.length-(r+1)]!=e[e.length-(r+1)])return t.slice(-r);return t.slice(-r)}function so(t,e,r){if(t.slice(0,e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't start with prefix ${JSON.stringify(e)}; this is a bug`);return r+t.slice(e.length)}function oo(t,e,r){if(!e)return t+r;if(t.slice(-e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't end with suffix ${JSON.stringify(e)}; this is a bug`);return t.slice(0,-e.length)+r}function vn(t,e){return so(t,e,"")}function xi(t,e){return oo(t,e,"")}function Dc(t,e){return e.slice(0,_p(t,e))}function _p(t,e){let r=0;t.length>e.length&&(r=t.length-e.length);let n=e.length;t.length<e.length&&(n=t.length);const i=Array(n);let s=0;i[0]=0;for(let o=1;o<n;o++){for(e[o]==e[s]?i[o]=i[s]:i[o]=s;s>0&&e[o]!=e[s];)s=i[s];e[o]==e[s]&&s++}s=0;for(let o=r;o<t.length;o++){for(;s>0&&t[o]!=e[s];)s=i[s];t[o]==e[s]&&s++}return s}function wp(t){return t.includes(`\r
45
+ /____/ v`+e.version)}const Rh=window?.location?.origin,pi=({type:t,tag:e,href:r,target:n,children:i,...s})=>(e=e||(r?"a":"button"),typeof n>"u"&&r&&r.startsWith("http")&&!r.startsWith(Rh)&&(n="_blank"),dh(e,{className:`theme-ipe ipe-action-button btn btn-${t||"default"}`,href:e==="a"?r:void 0,target:e==="a"?n:void 0,"data-href":e!=="a"?r:void 0,...s},i));var Nh=Object.create,Ys=Object.defineProperty,Dh=Object.getOwnPropertyDescriptor,rc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),nc=t=>{throw TypeError(t)},Lh=(t,e,r)=>e in t?Ys(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Mh=(t,e)=>Ys(t,"name",{value:e,configurable:!0}),jh=t=>[,,,Nh(t?.[rc("metadata")]??null)],Fh=["class","method","getter","setter","accessor","field","value","get","set"],ic=t=>t!==void 0&&typeof t!="function"?nc("Function expected"):t,Bh=(t,e,r,n,i)=>({kind:Fh[t],name:e,metadata:n,addInitializer:s=>r._?nc("Already initialized"):i.push(ic(s||null))}),Uh=(t,e)=>Lh(e,rc("metadata"),t[3]),Wh=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},qh=(t,e,r,n,i,s)=>{var o,a,c,u=e&7,l=!1,f=0,v=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!l)&&Dh(i,r));Mh(i,r);for(var b=n.length-1;b>=0;b--)c=Bh(u,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,ic(o)&&(i=o);return Uh(t,i),y&&Ys(i,r,y),l?u^4?s:y:i},sc,Gs,oc;sc=[ot(["sitemeta","storage"])];class mi extends(oc=kt){constructor(e){super(e,{},"preferences"),this.ctx=e,this.db=void 0,this.customRegistries=[],this.categoryDefinitions=[],this._defaultPreferences={},this.db=e.storage.createDatabse("preferences",1/0),this.ctx.set("preferences",this)}async start(){this.defineCategory({name:"general",label:"General",description:"General settings"}),this.defineCategory({name:"edit",label:"Editing",description:"Settings related to editing content"}),this.defineCategory({name:"about",label:"About",description:"About InPageEdit",index:99}),this.registerCustomConfig("about",ke.object({about:ke.string().role("html-info").description(O("div",{className:"prose",children:[O("h2",{children:"✏️ InPageEdit NEXT"}),O("i",{children:["v",this.ctx.version]}),O("h2",{children:"Portal"}),O("div",{style:"display: flex; flex-direction: column; gap: 1rem",children:[O(pi,{href:"https://www.ipe.wiki",style:{display:"block",width:"100%"},children:"Official Website & Help Center"}),O(pi,{href:"https://www.ipe.wiki/update/",style:{display:"block",width:"100%"},children:"Update Logs"})]}),O("h2",{children:"Join us"}),O("ul",{children:[O("li",{children:[O("strong",{children:"GitHub"}),":"," ",O("a",{href:"https://github.com/inpageedit/inpageedit-next",target:"_blank",children:"inpageedit/inpageedit-next"})]}),O("li",{children:[O("strong",{children:"QQ Group"}),": 1026023666"]})]}),O("hr",{}),O("p",{children:"🚀 Modular, Extensible Supercharged Plugin for MediaWiki."}),O("p",{children:"InPageEdit-NEXT Copyright © 2025-present dragon-fish"})]}).outerHTML).default("")}).description(""),"about",{}),Promise.resolve().then(()=>Rv).then(e=>{const r=this.ctx.plugin(e.PluginPreferencesUI);this.addDisposeHandler(()=>{r.dispose()})})}get(e,r){return r||(r=()=>{const i=this.getDefaultValue(e);return this.logger.info("default value used",i),i}),this.db.get(e,void 0,r)}getDefaultValue(e){var r;return(r=this._defaultPreferences)[e]??(r[e]=this.loadDefaultConfigs()[e])}set(e,r){const n=this.getDefaultValue(e);return r===n?this.db.delete(e):this.db.set(e,r)}async getAll(){const e=this.loadDefaultConfigs();return await this.db.iterate((r,n)=>{e[n]=r}),e}loadDefaultConfigs(){const e={};return this.getConfigRegistries().forEach(r=>{r.defaults&&Object.entries(r.defaults).forEach(([n,i])=>{e[n]=i,this._defaultPreferences[n]=i})}),e}registerCustomConfig(e,r,n,i){return this.customRegistries.push({name:e,schema:r,category:n,defaults:i}),this}getConfigRegistries(e){return Array.from(this.ctx.registry.entries()).map(([r,n])=>r===null?{name:"root",schema:yr?.PreferencesSchema||null,defaults:yr?.PreferencesDefaults||{}}:{name:r.name,schema:r?.PreferencesSchema||null,defaults:r?.PreferencesDefaults||{}}).filter(r=>r.schema!==null).map(r=>({...r,category:r.schema.meta.category||"general"})).concat(this.customRegistries).filter(r=>!e||r.category===e)}defineCategory(e){const r=this.categoryDefinitions.findIndex(n=>n.name===e.name);return r<0?this.categoryDefinitions.push(e):this.categoryDefinitions[r]=e,this.categoryDefinitions.sort((n,i)=>(n.index??0)-(i.index??0)),this}getConfigCategories(){return this.categoryDefinitions}}Gs=jh(oc),mi=qh(Gs,0,"PluginPreferences",sc,mi),Wh(Gs,1,mi);const Hh=Object.freeze(Object.defineProperty({__proto__:null,get PluginPreferences(){return mi}},Symbol.toStringTag,{value:"Module"}));var yt=(t=>(t.preferences="preferences",t.watch="watch",t.unwatch="unwatch",t.nochange="nochange",t))(yt||{});function gi(t,e){return function(r){return r.PreferencesSchema=t,r.PreferencesDefaults=e,r}}var zh=Object.create,Qs=Object.defineProperty,Vh=Object.getOwnPropertyDescriptor,ac=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),cc=t=>{throw TypeError(t)},Kh=(t,e,r)=>e in t?Qs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Jh=(t,e)=>Qs(t,"name",{value:e,configurable:!0}),Yh=t=>[,,,zh(t?.[ac("metadata")]??null)],Gh=["class","method","getter","setter","accessor","field","value","get","set"],lc=t=>t!==void 0&&typeof t!="function"?cc("Function expected"):t,Qh=(t,e,r,n,i)=>({kind:Gh[t],name:e,metadata:n,addInitializer:s=>r._?cc("Already initialized"):i.push(lc(s||null))}),Xh=(t,e)=>Kh(e,ac("metadata"),t[3]),Zh=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},ep=(t,e,r,n,i,s)=>{var o,a,c,u=e&7,l=!1,f=0,v=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!l)&&Vh(i,r));Jh(i,r);for(var b=n.length-1;b>=0;b--)c=Qh(u,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,lc(o)&&(i=o);return Xh(t,i),y&&Qs(i,r,y),l?u^4?s:y:i},uc,Xs,fc;uc=[ot(["sitemeta","quickEdit"]),gi(ke.object({redLinkEdit:ke.boolean().description("Show quick edit entry after red links").default(!0)}).description("In-article quick edit links"),{redLinkEdit:!0})];class yi extends(fc=kt){constructor(e){const r=e.sitemeta.mwConfig,n=r.wgArticlePath.replace("$1",""),i=`${location.protocol}//${r.wgServer.split("//")[1]}`;super(e,{wikiBaseUrl:i,wikiArticlePath:n,wikiArticleBaseUrl:`${i}${n}`,wikiScriptBaseUrl:`${i}${r.wgScriptPath}`,linkClassName:"ipe-quickEdit__in-article-link"},"QuickEditInArticleLinks")}async start(){mw.hook("wikipage.content").add(()=>{document.querySelectorAll("#mw-content-text a[href]").forEach(r=>{const n=this.checkEditAnchor(r);if(!n||r.dataset.ipeQuickEditLink)return;const i=O("a",{href:`#/IPE/quickEdit/${n.title}`,className:this.config.linkClassName,style:{userSelect:"none",marginLeft:"0.2em",verticalAlign:"middle"},onClick:s=>{s.preventDefault(),this.ctx.quickEdit(n)},children:O("svg",{style:"width: 1em; height: 1em",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-pencil-bolt",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),O("path",{d:"M13.5 6.5l4 4"}),O("path",{d:"M19 16l-2 3h4l-2 3"})]})});r.insertAdjacentElement("afterend",i),r.dataset.ipeQuickEditLink="true"})})}stop(){document.querySelectorAll(`.${this.config.linkClassName}`).forEach(e=>e.remove())}checkEditAnchor(e){if(!(e instanceof HTMLAnchorElement))return null;const r=e.href||"";if(!r.startsWith(this.config.wikiArticleBaseUrl)&&!r.startsWith(this.config.wikiScriptBaseUrl))return null;const n=new URL(r),i=n.searchParams,s=i.get("action")||"view",o=i.get("title")||decodeURI(n.pathname.substring(this.config.wikiArticlePath.length))||"",a=i.get("section")?.replace(/^T-/,"")||void 0,c=i.get("oldid");if(!o||o.endsWith(".php")||!["edit","editsource","editredlink","submit"].includes(s)||i.get("undo")||i.get("preload"))return null;let u;return a==="new"?u="new":a&&/^\d+$/.test(a)&&(u=parseInt(a,10)),{title:o,section:u,revision:parseInt(""+c,10)||0,createOnly:!!i.get("redlink")}}}Xs=Yh(fc),yi=ep(Xs,0,"PluginQuickEditInArticleLinks",uc,yi),Zh(Xs,1,yi);const vi={mbox:"_mbox_v5fz5_1",title:"_title_v5fz5_12",content:"_content_v5fz5_19",close:"_close_v5fz5_27"},dc=t=>{const{type:e="default",title:r,content:n,closeable:i=!0,titleProps:s,contentProps:o,children:a,...c}=t;let u=r;typeof r>"u"&&e!=="default"&&(u=e[0].toUpperCase()+e.slice(1).toLowerCase());const l=async()=>{if(!f)return Promise.resolve();const{promise:v,resolve:y}=Promise.withResolvers();return f.animate([{opacity:"1",height:f.clientHeight+"px"},{opacity:"0",height:"0px",margin:"0px"}],{duration:300,easing:"ease"}).addEventListener("finish",()=>{f.remove(),y()}),v},f=O("div",{className:`theme-ipe ipe-mbox mbox-type-${e||"default"} ${vi.mbox}`,...c,children:[u&&O("div",{className:`ipe-mbox-title ${vi.title}`,...s,children:u}),O("div",{className:`ipe-mbox-content ${vi.content}`,...o,children:a||n}),i&&O("a",{onClick:l,className:`ipe-mbox-close ${vi.close}`,children:"×"})]});return f.close=l,f},Zs=t=>{const{label:e,id:r,name:n,value:i,disabled:s,labelProps:o,inputProps:a,...c}=t;return O("div",{className:"theme-ipe ipe-input-box",...c,children:[O("label",{htmlFor:r,style:{display:"block"},...o,children:e}),O("input",{id:r,name:n,value:i,disabled:s,style:{width:"100%"},...a})]})},hc=t=>{const{id:e,name:r,value:n,label:i,inputProps:s,labelProps:o,children:a,...c}=t;return O("label",{className:"theme-ipe ipe-radio-box",...c,children:[O("input",{type:"radio",id:e,name:r,value:n,...s}),O("span",{className:"ipe-checkbox-box"}),O("span",{...o,children:i||a})]})},Lr=t=>{const{id:e,name:r,label:n,checked:i,inputProps:s,labelProps:o,children:a,...c}=t;return O("label",{className:"theme-ipe ipe-checkbox",...c,children:[O("input",{type:"checkbox",id:e,name:r,checked:i,...s}),O("span",{className:"ipe-checkbox-box"}),O("span",{...o,children:n||a})]})},pc=()=>{},mc=(t=0)=>new Promise(e=>setTimeout(e,t));var tp=Object.create,eo=Object.defineProperty,rp=Object.getOwnPropertyDescriptor,gc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),yc=t=>{throw TypeError(t)},np=(t,e,r)=>e in t?eo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ip=(t,e)=>eo(t,"name",{value:e,configurable:!0}),sp=t=>[,,,tp(t?.[gc("metadata")]??null)],op=["class","method","getter","setter","accessor","field","value","get","set"],vc=t=>t!==void 0&&typeof t!="function"?yc("Function expected"):t,ap=(t,e,r,n,i)=>({kind:op[t],name:e,metadata:n,addInitializer:s=>r._?yc("Already initialized"):i.push(vc(s||null))}),cp=(t,e)=>np(e,gc("metadata"),t[3]),lp=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},up=(t,e,r,n,i,s)=>{var o,a,c,u=e&7,l=!1,f=0,v=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!l)&&rp(i,r));ip(i,r);for(var b=n.length-1;b>=0;b--)c=ap(u,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,vc(o)&&(i=o);return cp(t,i),y&&eo(i,r,y),l?u^4?s:y:i},bc,to,_c;bc=[ot(["api","wikiPage","modal","preferences"]),gi(ke.object({editSummary:ke.string().description("Default edit summary for quick edits").default("[IPE-NEXT] Quick edit"),editMinor:ke.boolean().description("Whether to mark the edit as minor").default(!1),outSideClose:ke.boolean().description("Whether to close the modal outside").default(!0),watchList:ke.union([ke.const(yt.preferences).description("Follow my preferences"),ke.const(yt.nochange).description("Keep the current watchlist status"),ke.const(yt.watch).description("Add the page to watchlist"),ke.const(yt.unwatch).description("Remove the page from watchlist")]).description("Watchlist options").default(yt.preferences)}).description("Quick edit options").extra("category","edit"),{editSummary:"[IPE-NEXT] Quick edit",editMinor:!1,outSideClose:!0,watchList:yt.preferences})];class bi extends(_c=kt){constructor(e){super(e,{},"quick-edit"),this.ctx=e,this.DEFAULT_OPTIONS={title:"",pageId:0,revision:0,section:void 0,editMinor:!1,editSummary:"",createOnly:!1,reloadAfterSave:!0}}start(){this.ctx.root.set("quickEdit",this.quickEdit.bind(this)),this.ctx.inject(["toolbox"],e=>{this.injectToolbox(e),e.on("dispose",()=>{this.removeToolbox(e)})}),this.ctx.plugin(yi)}async quickEdit(e){typeof e>"u"?e={}:typeof e=="string"&&(e={title:e}),e?.page&&(e.title=e.page,delete e.page),!e.title&&!e.pageId&&!e.revision&&(this.logger.warn("None of the title, pageId or revision provided. Using defaults."),e={...e,title:mw.config.get("wgPageName"),pageId:mw.config.get("wgArticleId"),revision:mw.config.get("wgRevisionId")});const r=await this.ctx.preferences.get("outSideClose"),n=await this.ctx.preferences.get("watchList"),i=typeof e.editSummary=="string"?e.editSummary:await this.ctx.preferences.get("editSummary"),s=typeof e.editMinor=="boolean"?e.editMinor:await this.ctx.preferences.get("editMinor"),o={...this.DEFAULT_OPTIONS,editSummary:i,editMinor:s,...e};o.editSummary||(o.editSummary=await this.ctx.preferences.get("editSummary")||""),o||this.ctx.emit("quickEdit/initOptions",{ctx:this.ctx,options:o});const a=this.ctx.modal.createObject({className:"in-page-edit ipe-quickEdit ipe-editor",sizeClass:"large",outSideClose:r}).init();a.setTitle(O(ci,{children:["Loading: ",O("u",{children:o.title})]})),a.setContent(O("section",{className:"ipe-quickEdit-loading",style:{height:"70vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:O(gr,{})})),a.setButtons([{side:"right",type:"button",className:"btn btn-danger btn-secondary",label:"Cancel",method(){a.close()}}]),a.show(),this.ctx.emit("quickEdit/showModal",{ctx:this.ctx,modal:a,options:o});let c;try{c=await this.getWikiPageFromPayload(o)}catch(f){a.close(),this.ctx.modal.notify("error",{title:"Error",content:f instanceof Error?f.message:String(f)});return}a.setTitle(O(ci,{children:["Quick ",c.pageInfo.pageid===0?"Create":"Edit",":"," ",O("u",{children:c.pageInfo.title})]}));const u=O("form",{className:"ipe-quickEdit-form",children:[c.pageInfo.pageid===0&&O(dc,{title:"Attention",type:"important",children:O("p",{children:"This page does not exist."})}),O("textarea",{className:"editArea",name:"text",id:"wpTextbox1",children:c.revisions[0]?.content||""}),O("div",{class:"ipe-quickEdit-options",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[O(Zs,{label:"Summary",id:"summary",name:"summary",value:o.editSummary}),O("div",{children:[O("label",{htmlFor:"watchlist",style:{display:"block"},children:"Watchlist"}),O("div",{style:{display:"flex",gap:"1rem"},children:[yt.preferences,yt.nochange,yt.watch,yt.unwatch].map(f=>O(hc,{name:"watchlist",value:f,inputProps:{checked:n===f},children:f},f))})]}),O("div",{style:{display:"flex",gap:"1rem"},children:[O(Lr,{name:"minor",id:"minor",checked:o.editMinor,children:"Minor edit"}),O(Lr,{name:"reloadAfterSave",id:"reloadAfterSave",checked:o.reloadAfterSave,children:"Reload after save"})]})]}),!1]});a.setContent(u);const l=a.generateButton({side:"left",className:"btn btn-primary submit-btn",label:"Submit",method:()=>{const f=new FormData(u);console.info(c,u,{text:f.get("text"),summary:f.get("summary"),minor:f.get("minor")==="on"}),a.setLoadingState(!0),this.handleSubmit({ctx:this.ctx,modal:a,wikiPage:c,options:o},{text:f.get("text"),summary:f.get("summary"),minor:f.get("minor")==="on"}).then(async()=>{a.setOptions({beforeClose:pc}),a.close(),this.ctx.modal.notify("success",{title:"Submission Successful",content:"Your changes have been saved."}),f.get("reloadAfterSave")&&(await mc(500),location.reload())}).catch(v=>{this.ctx.modal.notify("error",{title:"Submission Error",content:v instanceof Error?v.message:String(v)}),a.setLoadingState(!1)})}});a.get$buttons("leftButtons").prepend(l),a.setOptions({beforeClose:()=>{const f=c.revisions[0]?.content||"";return(u.querySelector("textarea")?.value||"")===f?!0:(this.ctx.modal.confirm({className:"in-page-edit",title:"Unsaved Changes",content:"All edit contents will be lost after closing the modal. Are you sure you want to close?",center:!0,okBtn:{label:"Give Up",className:"btn btn-danger"},cancelBtn:{label:"Continue",className:"btn"}},y=>(y&&(a.setOptions({beforeClose:pc}),a.close()),!0)),!1)}}),this.ctx.emit("quickEdit/wikiPage",{ctx:this.ctx,options:o,modal:a,wikiPage:c})}handleSubmit(e,r){const n=r.summary||"",i=r.text||"",s=r.minor||!1,o=r.createonly||!1,a=r.watchlist||yt.nochange;return e.wikiPage.edit({summary:n,text:i,watchlist:a},{minor:s,createonly:o})}injectToolbox(e){e.toolbox.addButton({id:"quick-edit",group:"group1",index:0,icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-edit",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"}),O("path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z"}),O("path",{d:"M16 5l3 3"})]}),tooltip:"Edit this page quickly",onClick:()=>this.quickEdit()})}async getWikiPageFromPayload(e){if(e.revision)return this.ctx.wikiPage.newFromRevision(e.revision,e.section);if(e.pageId)return this.ctx.wikiPage.newFromPageId(e.pageId,e.section);if(e.title)return this.ctx.wikiPage.newFromTitle(e.title,!1,e.section);throw new Error("Invalid payload")}removeToolbox(e){e.toolbox.removeButton("quick-edit")}}to=sp(_c),bi=up(to,0,"PluginQuickEdit",bc,bi),lp(to,1,bi);const fp=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickEdit(){return bi}},Symbol.toStringTag,{value:"Module"})),yn={twinSwapInput:"_twinSwapInput_1gdgl_9",inputWrapper:"_inputWrapper_1gdgl_23",inputLeft:"_inputLeft_1gdgl_27",inputRight:"_inputRight_1gdgl_30",swapButton:"_swapButton_1gdgl_46"},wc=t=>{const{inputs:e,enableSwap:r=!0,...n}=t,i=e?.length===2?e:[e?.[0]??{},e?.[1]??{}],s=[null,null];let o=0,a=null,c=null;const u=()=>s.some(b=>b&&b.disabled),l=()=>{if(!s[0]||!s[1]||u())return;const b=s[0],T=s[1],H=b.value,B=T.value;b.value=B,T.value=H,b.dispatchEvent(new Event("change")),T.dispatchEvent(new Event("change")),o++,c&&(c.style.transform=`rotateY(${o*-180}deg)`,c.style.transition="transform 200ms ease")},f=b=>{if(!a)return;const T=b??!a.disabled;a.disabled=!T,T&&s.forEach(H=>{H&&(H.disabled=!1)})},v=O("button",{type:"button","aria-label":"Swap values",onClick:l,disabled:u()||!r,ref:b=>a=b,children:O("svg",{ref:b=>c=b,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon-tabler icons-tabler-outline icon-tabler-transfer",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M20 10h-16l5.5 -6"}),O("path",{d:"M4 14h16l-5.5 6"})]})}),y=O("div",{className:`twin-swap-input ${yn.twinSwapInput}`,...n,children:[i.map((b,T)=>{const{label:H,id:B,name:R,value:m,disabled:p,inputProps:h}=b,P=T===0,I=B||R;return O("div",{className:`${yn.inputWrapper} ${P?yn.inputLeft:yn.inputRight}`,children:[H&&O("label",{htmlFor:I,children:H}),O("input",{ref:N=>s[T]=N,type:"text",id:I,name:R,value:m,disabled:p,...h})]})}),O("div",{className:yn.swapButton,children:v})]});return y.swap=l,y.toggleEnableSwap=f,y};var dp=Object.create,ro=Object.defineProperty,hp=Object.getOwnPropertyDescriptor,xc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Sc=t=>{throw TypeError(t)},pp=(t,e,r)=>e in t?ro(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mp=(t,e)=>ro(t,"name",{value:e,configurable:!0}),gp=t=>[,,,dp(t?.[xc("metadata")]??null)],yp=["class","method","getter","setter","accessor","field","value","get","set"],Ec=t=>t!==void 0&&typeof t!="function"?Sc("Function expected"):t,vp=(t,e,r,n,i)=>({kind:yp[t],name:e,metadata:n,addInitializer:s=>r._?Sc("Already initialized"):i.push(Ec(s||null))}),bp=(t,e)=>pp(e,xc("metadata"),t[3]),_p=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},wp=(t,e,r,n,i,s)=>{var o,a,c,u=e&7,l=!1,f=0,v=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!l)&&hp(i,r));mp(i,r);for(var b=n.length-1;b>=0;b--)c=vp(u,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,Ec(o)&&(i=o);return bp(t,i),y&&ro(i,r,y),l?u^4?s:y:i},Oc,no,Pc;Oc=[ot(["modal","sitemeta"])];class _i extends(Pc=kt){constructor(e){super(e,{},"quick-move"),this.ctx=e,e.set("quickMove",this.quickMove.bind(this)),e.set("movePage",this.movePage.bind(this))}start(){this.ctx.inject(["toolbox"],e=>{this.injectToolbox(e)})}injectToolbox(e){const r=window.mw?.config.get("wgPageName")||"",n=window.mw?.config.get("wgIsProbablyEditable");e.toolbox.addButton({id:"quick-move",icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-forms",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3"}),O("path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3"}),O("path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7"}),O("path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1"}),O("path",{d:"M17 12h.01"}),O("path",{d:"M13 12h.01"})]}),tooltip:"Quick Move",group:"group2",onClick:()=>{this.quickMove(n?{lockFromField:!0,from:r}:{})}})}quickMove(e){const r=this.ctx.modal.createObject({title:"Quick Move",content:O(gr,{}),className:"quick-move",sizeClass:"medium",center:!0}).init();let n=null;return r.setContent(O("form",{ref:i=>n=i,style:{display:"flex",flexDirection:"column",gap:"1rem"},onSubmit:i=>{i.preventDefault();const s=new FormData(n),o={from:s.get("from"),to:s.get("to"),reason:s.get("reason")||"",movetalk:s.get("movetalk")==="on",movesubpages:s.get("movesubpages")==="on",noredirect:s.get("noredirect")==="on"};r.setLoadingState(!0),this.movePage(o).then(()=>{location.reload()}).catch(a=>{r.setLoadingState(!1),this.ctx.modal.notify("error",{title:"Failed to move",content:a instanceof Error?a.message:String(a)})})},children:[O(wc,{inputs:[{label:"Move from",name:"from",value:e?.from},{label:"Move to",name:"to",value:e?.to}]}),O("div",{children:O(Lr,{name:"movetalk",id:"movetalk",checked:e?.movetalk,children:"Move talk page"})}),O("div",{children:O(Lr,{name:"movesubpages",id:"movesubpages",checked:e?.movesubpages,children:"Move subpage(s) (up to 100)"})}),this.ctx.sitemeta.hasRight("suppressredirect")&&O("div",{children:O(Lr,{name:"noredirect",id:"noredirect",checked:e?.noredirect,children:"Move without leaving a redirect"})}),O(Zs,{label:"Reason",id:"reason",name:"reason",value:e?.reason}),O("div",{children:O(pi,{type:"primary",style:{width:"100%"},children:"Move"})})]})),r.show()}async movePage(e){const{from:r,to:n,reason:i="",...s}=e;if(!r||!n)throw new Error("From and to titles are required.");if(r===n)throw new Error("From and to titles cannot be the same.");return(await this.ctx.wikiPage.newFromTitle(r)).moveTo(n,i,s)}}no=gp(Pc),_i=wp(no,0,"PluginQuickMove",Oc,_i),_p(no,1,_i);const xp=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickMove(){return _i}},Symbol.toStringTag,{value:"Module"}));var Sp=Object.create,io=Object.defineProperty,Ep=Object.getOwnPropertyDescriptor,Cc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),kc=t=>{throw TypeError(t)},Op=(t,e,r)=>e in t?io(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pp=(t,e)=>io(t,"name",{value:e,configurable:!0}),Cp=t=>[,,,Sp(t?.[Cc("metadata")]??null)],kp=["class","method","getter","setter","accessor","field","value","get","set"],$c=t=>t!==void 0&&typeof t!="function"?kc("Function expected"):t,$p=(t,e,r,n,i)=>({kind:kp[t],name:e,metadata:n,addInitializer:s=>r._?kc("Already initialized"):i.push($c(s||null))}),Ip=(t,e)=>Op(e,Cc("metadata"),t[3]),Ap=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},Tp=(t,e,r,n,i,s)=>{var o,a,c,u=e&7,l=!1,f=0,v=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!l)&&Ep(i,r));Pp(i,r);for(var b=n.length-1;b>=0;b--)c=$p(u,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,$c(o)&&(i=o);return Ip(t,i),y&&io(i,r,y),l?u^4?s:y:i},Ic,so,Ac;Ic=[ot(["api","wikiPage","modal"])];class wi extends(Ac=kt){constructor(e){super(e,{},"quickPreview"),this.ctx=e}start(){this.ctx.set("quickPreview",this.quickPreview.bind(this)),this.ctx.on("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}stop(){this.ctx.off("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}injectQuickEdit({ctx:e,modal:r,wikiPage:n}){r.setButtons([{label:"Preview",side:"left",className:"btn btn-secondary",method:()=>{this.quickPreview(r.get$content().find("textarea.editArea").val()||"",void 0,n)}}])}async quickPreview(e,r,n){n||(n=this.ctx.wikiPage.newBlankPage({title:"API"}));const i=this.ctx.modal.createObject({className:"in-page-edit ipe-quickPreview",sizeClass:"large"}).init();i.setTitle("Preview loading..."),i.setContent(O("section",{children:O(gr,{})})),i.show(),this.ctx.emit("quickPreview/showModal",{ctx:this.ctx,text:e,modal:i,wikiPage:n});const{data:{parse:s}}=await n.preview(e,r);i.setTitle(`Preview - ${s.title}`);let o=null;i.setContent(O("section",{children:O("div",{ref:a=>o=a,className:"mw-parser-output",innerHTML:s.text})})),window.mw?.hook("wikipage.content").fire($(o)),this.ctx.emit("quickPreview/loaded",{ctx:this.ctx,modal:i,wikiPage:n,text:e,parseData:s})}}so=Cp(Ac),wi=Tp(so,0,"PluginQuickPreview",Ic,wi),Ap(so,1,wi);const Rp=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickPreview(){return wi}},Symbol.toStringTag,{value:"Module"}));class zt{diff(e,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);const s=this.castInput(e,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,i)}diffWithOptionsObj(e,r,n,i){var s;const o=R=>{if(R=this.postProcess(R,n),i){setTimeout(function(){i(R)},0);return}else return R},a=r.length,c=e.length;let u=1,l=a+c;n.maxEditLength!=null&&(l=Math.min(l,n.maxEditLength));const f=(s=n.timeout)!==null&&s!==void 0?s:1/0,v=Date.now()+f,y=[{oldPos:-1,lastComponent:void 0}];let b=this.extractCommon(y[0],r,e,0,n);if(y[0].oldPos+1>=c&&b+1>=a)return o(this.buildValues(y[0].lastComponent,r,e));let T=-1/0,H=1/0;const B=()=>{for(let R=Math.max(T,-u);R<=Math.min(H,u);R+=2){let m;const p=y[R-1],h=y[R+1];p&&(y[R-1]=void 0);let P=!1;if(h){const N=h.oldPos-R;P=h&&0<=N&&N<a}const I=p&&p.oldPos+1<c;if(!P&&!I){y[R]=void 0;continue}if(!I||P&&p.oldPos<h.oldPos?m=this.addToPath(h,!0,!1,0,n):m=this.addToPath(p,!1,!0,1,n),b=this.extractCommon(m,r,e,R,n),m.oldPos+1>=c&&b+1>=a)return o(this.buildValues(m.lastComponent,r,e))||!0;y[R]=m,m.oldPos+1>=c&&(H=Math.min(H,R-1)),b+1>=a&&(T=Math.max(T,R+1))}u++};if(i)(function R(){setTimeout(function(){if(u>l||Date.now()>v)return i(void 0);B()||R()},0)})();else for(;u<=l&&Date.now()<=v;){const R=B();if(R)return R}}addToPath(e,r,n,i,s){const o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(e,r,n,i,s){const o=r.length,a=n.length;let c=e.oldPos,u=c-i,l=0;for(;u+1<o&&c+1<a&&this.equals(n[c+1],r[u+1],s);)u++,c++,l++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!s.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,u}equals(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){const r=[];for(let n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,n){const i=[];let s;for(;e;)i.push(e),s=e.previousComponent,delete e.previousComponent,e=s;i.reverse();const o=i.length;let a=0,c=0,u=0;for(;a<o;a++){const l=i[a];if(l.removed)l.value=this.join(n.slice(u,u+l.count)),u+=l.count;else{if(!l.added&&this.useLongestToken){let f=r.slice(c,c+l.count);f=f.map(function(v,y){const b=n[u+y];return b.length>v.length?b:v}),l.value=this.join(f)}else l.value=this.join(r.slice(c,c+l.count));c+=l.count,l.added||(u+=l.count)}}return i}}class Np extends zt{}const Tc=new Np;function Rc(t,e,r){return Tc.diff(t,e,r)}function Nc(t,e){let r;for(r=0;r<t.length&&r<e.length;r++)if(t[r]!=e[r])return t.slice(0,r);return t.slice(0,r)}function Dc(t,e){let r;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(r=0;r<t.length&&r<e.length;r++)if(t[t.length-(r+1)]!=e[e.length-(r+1)])return t.slice(-r);return t.slice(-r)}function oo(t,e,r){if(t.slice(0,e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't start with prefix ${JSON.stringify(e)}; this is a bug`);return r+t.slice(e.length)}function ao(t,e,r){if(!e)return t+r;if(t.slice(-e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't end with suffix ${JSON.stringify(e)}; this is a bug`);return t.slice(0,-e.length)+r}function vn(t,e){return oo(t,e,"")}function xi(t,e){return ao(t,e,"")}function Lc(t,e){return e.slice(0,Dp(t,e))}function Dp(t,e){let r=0;t.length>e.length&&(r=t.length-e.length);let n=e.length;t.length<e.length&&(n=t.length);const i=Array(n);let s=0;i[0]=0;for(let o=1;o<n;o++){for(e[o]==e[s]?i[o]=i[s]:i[o]=s;s>0&&e[o]!=e[s];)s=i[s];e[o]==e[s]&&s++}s=0;for(let o=r;o<t.length;o++){for(;s>0&&t[o]!=e[s];)s=i[s];t[o]==e[s]&&s++}return s}function Lp(t){return t.includes(`\r
46
46
  `)&&!t.startsWith(`
47
- `)&&!t.match(/[^\r]\n/)}function xp(t){return!t.includes(`\r
47
+ `)&&!t.match(/[^\r]\n/)}function Mp(t){return!t.includes(`\r
48
48
  `)&&t.includes(`
49
- `)}function bn(t){let e;for(e=t.length-1;e>=0&&t[e].match(/\s/);e--);return t.substring(e+1)}function er(t){const e=t.match(/^\s*/);return e?e[0]:""}const Si="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Sp=new RegExp(`[${Si}]+|\\s+|[^${Si}]`,"ug");class Ep extends Ht{equals(e,r,n){return n.ignoreCase&&(e=e.toLowerCase(),r=r.toLowerCase()),e.trim()===r.trim()}tokenize(e,r={}){let n;if(r.intlSegmenter){const o=r.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(o.segment(e),a=>a.segment)}else n=e.match(Sp)||[];const i=[];let s=null;return n.forEach(o=>{/\s/.test(o)?s==null?i.push(o):i.push(i.pop()+o):s!=null&&/\s/.test(s)?i[i.length-1]==s?i.push(i.pop()+o):i.push(s+o):i.push(o),s=o}),i}join(e){return e.map((r,n)=>n==0?r:r.replace(/^\s+/,"")).join("")}postProcess(e,r){if(!e||r.oneChangePerToken)return e;let n=null,i=null,s=null;return e.forEach(o=>{o.added?i=o:o.removed?s=o:((i||s)&&Mc(n,s,i,o),n=o,i=null,s=null)}),(i||s)&&Mc(n,s,i,null),e}}const Nc=new Ep;function Lc(t,e,r){return r?.ignoreWhitespace!=null&&!r.ignoreWhitespace?ao(t,e,r):Nc.diff(t,e,r)}function Mc(t,e,r,n){if(e&&r){const i=er(e.value),s=bn(e.value),o=er(r.value),a=bn(r.value);if(t){const c=Tc(i,o);t.value=oo(t.value,o,c),e.value=vn(e.value,c),r.value=vn(r.value,c)}if(n){const c=Rc(s,a);n.value=so(n.value,a,c),e.value=xi(e.value,c),r.value=xi(r.value,c)}}else if(r){if(t){const i=er(r.value);r.value=r.value.substring(i.length)}if(n){const i=er(n.value);n.value=n.value.substring(i.length)}}else if(t&&n){const i=er(n.value),s=er(e.value),o=bn(e.value),a=Tc(i,s);e.value=vn(e.value,a);const c=Rc(vn(i,a),o);e.value=xi(e.value,c),n.value=so(n.value,i,c),t.value=oo(t.value,i,i.slice(0,i.length-c.length))}else if(n){const i=er(n.value),s=bn(e.value),o=Dc(s,i);e.value=xi(e.value,o)}else if(t){const i=bn(t.value),s=er(e.value),o=Dc(i,s);e.value=vn(e.value,o)}}class Op extends Ht{tokenize(e){const r=new RegExp(`(\\r?\\n)|[${Si}]+|[^\\S\\n\\r]+|[^${Si}]`,"ug");return e.match(r)||[]}}const Fc=new Op;function ao(t,e,r){return Fc.diff(t,e,r)}function Cp(t,e){if(typeof t=="function")e.callback=t;else if(t)for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}class Pp extends Ht{constructor(){super(...arguments),this.tokenize=Bc}equals(e,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
49
+ `)}function bn(t){let e;for(e=t.length-1;e>=0&&t[e].match(/\s/);e--);return t.substring(e+1)}function tr(t){const e=t.match(/^\s*/);return e?e[0]:""}const Si="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",jp=new RegExp(`[${Si}]+|\\s+|[^${Si}]`,"ug");class Fp extends zt{equals(e,r,n){return n.ignoreCase&&(e=e.toLowerCase(),r=r.toLowerCase()),e.trim()===r.trim()}tokenize(e,r={}){let n;if(r.intlSegmenter){const o=r.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(o.segment(e),a=>a.segment)}else n=e.match(jp)||[];const i=[];let s=null;return n.forEach(o=>{/\s/.test(o)?s==null?i.push(o):i.push(i.pop()+o):s!=null&&/\s/.test(s)?i[i.length-1]==s?i.push(i.pop()+o):i.push(s+o):i.push(o),s=o}),i}join(e){return e.map((r,n)=>n==0?r:r.replace(/^\s+/,"")).join("")}postProcess(e,r){if(!e||r.oneChangePerToken)return e;let n=null,i=null,s=null;return e.forEach(o=>{o.added?i=o:o.removed?s=o:((i||s)&&Fc(n,s,i,o),n=o,i=null,s=null)}),(i||s)&&Fc(n,s,i,null),e}}const Mc=new Fp;function jc(t,e,r){return r?.ignoreWhitespace!=null&&!r.ignoreWhitespace?co(t,e,r):Mc.diff(t,e,r)}function Fc(t,e,r,n){if(e&&r){const i=tr(e.value),s=bn(e.value),o=tr(r.value),a=bn(r.value);if(t){const c=Nc(i,o);t.value=ao(t.value,o,c),e.value=vn(e.value,c),r.value=vn(r.value,c)}if(n){const c=Dc(s,a);n.value=oo(n.value,a,c),e.value=xi(e.value,c),r.value=xi(r.value,c)}}else if(r){if(t){const i=tr(r.value);r.value=r.value.substring(i.length)}if(n){const i=tr(n.value);n.value=n.value.substring(i.length)}}else if(t&&n){const i=tr(n.value),s=tr(e.value),o=bn(e.value),a=Nc(i,s);e.value=vn(e.value,a);const c=Dc(vn(i,a),o);e.value=xi(e.value,c),n.value=oo(n.value,i,c),t.value=ao(t.value,i,i.slice(0,i.length-c.length))}else if(n){const i=tr(n.value),s=bn(e.value),o=Lc(s,i);e.value=xi(e.value,o)}else if(t){const i=bn(t.value),s=tr(e.value),o=Lc(i,s);e.value=vn(e.value,o)}}class Bp extends zt{tokenize(e){const r=new RegExp(`(\\r?\\n)|[${Si}]+|[^\\S\\n\\r]+|[^${Si}]`,"ug");return e.match(r)||[]}}const Bc=new Bp;function co(t,e,r){return Bc.diff(t,e,r)}function Up(t,e){if(typeof t=="function")e.callback=t;else if(t)for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}class Wp extends zt{constructor(){super(...arguments),this.tokenize=Wc}equals(e,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
50
50
  `))&&(e=e.trim()),(!n.newlineIsToken||!r.includes(`
51
51
  `))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
52
52
  `)&&(e=e.slice(0,-1)),r.endsWith(`
53
- `)&&(r=r.slice(0,-1))),super.equals(e,r,n)}}const co=new Pp;function Ei(t,e,r){return co.diff(t,e,r)}function jc(t,e,r){return r=Cp(r,{ignoreWhitespace:!0}),co.diff(t,e,r)}function Bc(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
54
- `));const r=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let i=0;i<n.length;i++){const s=n[i];i%2&&!e.newlineIsToken?r[r.length-1]+=s:r.push(s)}return r}function $p(t){return t=="."||t=="!"||t=="?"}class kp extends Ht{tokenize(e){var r;const n=[];let i=0;for(let s=0;s<e.length;s++){if(s==e.length-1){n.push(e.slice(i));break}if($p(e[s])&&e[s+1].match(/\s/)){for(n.push(e.slice(i,s+1)),s=i=s+1;!((r=e[s+1])===null||r===void 0)&&r.match(/\s/);)s++;n.push(e.slice(i,s+1)),i=s+1}}return n}}const Uc=new kp;function Wc(t,e,r){return Uc.diff(t,e,r)}class Ip extends Ht{tokenize(e){return e.split(/([{}:;,]|\s+)/)}}const qc=new Ip;function Hc(t,e,r){return qc.diff(t,e,r)}class Ap extends Ht{constructor(){super(...arguments),this.tokenize=Bc}get useLongestToken(){return!0}castInput(e,r){const{undefinedReplacement:n,stringifyReplacer:i=(s,o)=>typeof o>"u"?n:o}=r;return typeof e=="string"?e:JSON.stringify(Oi(e,null,null,i),null," ")}equals(e,r,n){return super.equals(e.replace(/,([\r\n])/g,"$1"),r.replace(/,([\r\n])/g,"$1"),n)}}const zc=new Ap;function Vc(t,e,r){return zc.diff(t,e,r)}function Oi(t,e,r,n,i){e=e||[],r=r||[],n&&(t=n(i===void 0?"":i,t));let s;for(s=0;s<e.length;s+=1)if(e[s]===t)return r[s];let o;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),o=new Array(t.length),r.push(o),s=0;s<t.length;s+=1)o[s]=Oi(t[s],e,r,n,String(s));return e.pop(),r.pop(),o}if(t&&t.toJSON&&(t=t.toJSON()),typeof t=="object"&&t!==null){e.push(t),o={},r.push(o);const a=[];let c;for(c in t)Object.prototype.hasOwnProperty.call(t,c)&&a.push(c);for(a.sort(),s=0;s<a.length;s+=1)c=a[s],o[c]=Oi(t[c],e,r,n,c);e.pop(),r.pop()}else o=t;return o}class Tp extends Ht{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}}const Kc=new Tp;function Jc(t,e,r){return Kc.diff(t,e,r)}function Yc(t){return Array.isArray(t)?t.map(e=>Yc(e)):Object.assign(Object.assign({},t),{hunks:t.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((r,n)=>{var i;return r.startsWith("\\")||r.endsWith("\r")||!((i=e.lines[n+1])===null||i===void 0)&&i.startsWith("\\")?r:r+"\r"})}))})}function Gc(t){return Array.isArray(t)?t.map(e=>Gc(e)):Object.assign(Object.assign({},t),{hunks:t.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(r=>r.endsWith("\r")?r.substring(0,r.length-1):r)}))})}function Rp(t){return Array.isArray(t)||(t=[t]),!t.some(e=>e.hunks.some(r=>r.lines.some(n=>!n.startsWith("\\")&&n.endsWith("\r"))))}function Dp(t){return Array.isArray(t)||(t=[t]),t.some(e=>e.hunks.some(r=>r.lines.some(n=>n.endsWith("\r"))))&&t.every(e=>e.hunks.every(r=>r.lines.every((n,i)=>{var s;return n.startsWith("\\")||n.endsWith("\r")||((s=r.lines[i+1])===null||s===void 0?void 0:s.startsWith("\\"))})))}function lo(t){const e=t.split(/\n/),r=[];let n=0;function i(){const a={};for(r.push(a);n<e.length;){const c=e[n];if(/^(---|\+\+\+|@@)\s/.test(c))break;const l=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(c);l&&(a.index=l[1]),n++}for(s(a),s(a),a.hunks=[];n<e.length;){const c=e[n];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(c))break;if(/^@@/.test(c))a.hunks.push(o());else{if(c)throw new Error("Unknown line "+(n+1)+" "+JSON.stringify(c));n++}}}function s(a){const c=/^(---|\+\+\+)\s+(.*)\r?$/.exec(e[n]);if(c){const l=c[2].split(" ",2),u=(l[1]||"").trim();let f=l[0].replace(/\\\\/g,"\\");/^".*"$/.test(f)&&(f=f.substr(1,f.length-2)),c[1]==="---"?(a.oldFileName=f,a.oldHeader=u):(a.newFileName=f,a.newHeader=u),n++}}function o(){var a;const c=n,l=e[n++],u=l.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),f={oldStart:+u[1],oldLines:typeof u[2]>"u"?1:+u[2],newStart:+u[3],newLines:typeof u[4]>"u"?1:+u[4],lines:[]};f.oldLines===0&&(f.oldStart+=1),f.newLines===0&&(f.newStart+=1);let v=0,y=0;for(;n<e.length&&(y<f.oldLines||v<f.newLines||!((a=e[n])===null||a===void 0)&&a.startsWith("\\"));n++){const b=e[n].length==0&&n!=e.length-1?" ":e[n][0];if(b==="+"||b==="-"||b===" "||b==="\\")f.lines.push(e[n]),b==="+"?v++:b==="-"?y++:b===" "&&(v++,y++);else throw new Error(`Hunk at line ${c+1} contained invalid line ${e[n]}`)}if(!v&&f.newLines===1&&(f.newLines=0),!y&&f.oldLines===1&&(f.oldLines=0),v!==f.newLines)throw new Error("Added line count did not match for hunk at line "+(c+1));if(y!==f.oldLines)throw new Error("Removed line count did not match for hunk at line "+(c+1));return f}for(;n<e.length;)i();return r}function Np(t,e,r){let n=!0,i=!1,s=!1,o=1;return function a(){if(n&&!s){if(i?o++:n=!1,t+o<=r)return t+o;s=!0}if(!i)return s||(n=!0),e<=t-o?t-o++:(i=!0,a())}}function Qc(t,e,r={}){let n;if(typeof e=="string"?n=lo(e):Array.isArray(e)?n=e:n=[e],n.length>1)throw new Error("applyPatch only works with a single input.");return Lp(t,n[0],r)}function Lp(t,e,r={}){(r.autoConvertLineEndings||r.autoConvertLineEndings==null)&&(wp(t)&&Rp(e)?e=Yc(e):xp(t)&&Dp(e)&&(e=Gc(e)));const n=t.split(`
55
- `),i=e.hunks,s=r.compareLine||((b,R,H,B)=>R===B),o=r.fuzzFactor||0;let a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!i.length)return t;let c="",l=!1,u=!1;for(let b=0;b<i[i.length-1].lines.length;b++){const R=i[i.length-1].lines[b];R[0]=="\\"&&(c[0]=="+"?l=!0:c[0]=="-"&&(u=!0)),c=R}if(l){if(u){if(!o&&n[n.length-1]=="")return!1}else if(n[n.length-1]=="")n.pop();else if(!o)return!1}else if(u){if(n[n.length-1]!="")n.push("");else if(!o)return!1}function f(b,R,H,B=0,N=!0,g=[],m=0){let h=0,C=!1;for(;B<b.length;B++){const I=b[B],T=I.length>0?I[0]:" ",J=I.length>0?I.substr(1):I;if(T==="-")if(s(R+1,n[R],T,J))R++,h=0;else return!H||n[R]==null?null:(g[m]=n[R],f(b,R+1,H-1,B,!1,g,m+1));if(T==="+"){if(!N)return null;g[m]=J,m++,h=0,C=!0}if(T===" ")if(h++,g[m]=n[R],s(R+1,n[R],T,J))m++,N=!0,C=!1,R++;else return C||!H?null:n[R]&&(f(b,R+1,H-1,B+1,!1,g,m+1)||f(b,R+1,H-1,B,!1,g,m+1))||f(b,R,H-1,B+1,!1,g,m)}return m-=h,R-=h,g.length=m,{patchedLines:g,oldLineLastI:R-1}}const v=[];let y=0;for(let b=0;b<i.length;b++){const R=i[b];let H;const B=n.length-R.oldLines+o;let N;for(let g=0;g<=o;g++){N=R.oldStart+y-1;const m=Np(N,a,B);for(;N!==void 0&&(H=f(R.lines,N,g),!H);N=m());if(H)break}if(!H)return!1;for(let g=a;g<N;g++)v.push(n[g]);for(let g=0;g<H.patchedLines.length;g++){const m=H.patchedLines[g];v.push(m)}a=H.oldLineLastI+1,y=N+1-R.oldStart}for(let b=a;b<n.length;b++)v.push(n[b]);return v.join(`
56
- `)}function Mp(t,e){const r=typeof t=="string"?lo(t):t;let n=0;function i(){const s=r[n++];if(!s)return e.complete();e.loadFile(s,function(o,a){if(o)return e.complete(o);const c=Qc(a,s,e);e.patched(s,c,function(l){if(l)return e.complete(l);i()})})}i()}function Xc(t){return Array.isArray(t)?t.map(e=>Xc(e)).reverse():Object.assign(Object.assign({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map(e=>({oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(r=>r.startsWith("-")?`+${r.slice(1)}`:r.startsWith("+")?`-${r.slice(1)}`:r)}))})}function uo(t,e,r,n,i,s,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);const c=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:u}=a;Ei(r,n,Object.assign(Object.assign({},a),{callback:f=>{const v=l(f);u(v)}}))}else return l(Ei(r,n,a));function l(u){if(!u)return;u.push({value:"",lines:[]});function f(N){return N.map(function(g){return" "+g})}const v=[];let y=0,b=0,R=[],H=1,B=1;for(let N=0;N<u.length;N++){const g=u[N],m=g.lines||jp(g.value);if(g.lines=m,g.added||g.removed){if(!y){const h=u[N-1];y=H,b=B,h&&(R=c>0?f(h.lines.slice(-c)):[],y-=R.length,b-=R.length)}for(const h of m)R.push((g.added?"+":"-")+h);g.added?B+=m.length:H+=m.length}else{if(y)if(m.length<=c*2&&N<u.length-2)for(const h of f(m))R.push(h);else{const h=Math.min(m.length,c);for(const I of f(m.slice(0,h)))R.push(I);const C={oldStart:y,oldLines:H-y+h,newStart:b,newLines:B-b+h,lines:R};v.push(C),y=0,b=0,R=[]}H+=m.length,B+=m.length}}for(const N of v)for(let g=0;g<N.lines.length;g++)N.lines[g].endsWith(`
57
- `)?N.lines[g]=N.lines[g].slice(0,-1):(N.lines.splice(g+1,0,"\"),g++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:s,hunks:v}}}function Ci(t){if(Array.isArray(t))return t.map(Ci).join(`
53
+ `)&&(r=r.slice(0,-1))),super.equals(e,r,n)}}const lo=new Wp;function Ei(t,e,r){return lo.diff(t,e,r)}function Uc(t,e,r){return r=Up(r,{ignoreWhitespace:!0}),lo.diff(t,e,r)}function Wc(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
54
+ `));const r=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let i=0;i<n.length;i++){const s=n[i];i%2&&!e.newlineIsToken?r[r.length-1]+=s:r.push(s)}return r}function qp(t){return t=="."||t=="!"||t=="?"}class Hp extends zt{tokenize(e){var r;const n=[];let i=0;for(let s=0;s<e.length;s++){if(s==e.length-1){n.push(e.slice(i));break}if(qp(e[s])&&e[s+1].match(/\s/)){for(n.push(e.slice(i,s+1)),s=i=s+1;!((r=e[s+1])===null||r===void 0)&&r.match(/\s/);)s++;n.push(e.slice(i,s+1)),i=s+1}}return n}}const qc=new Hp;function Hc(t,e,r){return qc.diff(t,e,r)}class zp extends zt{tokenize(e){return e.split(/([{}:;,]|\s+)/)}}const zc=new zp;function Vc(t,e,r){return zc.diff(t,e,r)}class Vp extends zt{constructor(){super(...arguments),this.tokenize=Wc}get useLongestToken(){return!0}castInput(e,r){const{undefinedReplacement:n,stringifyReplacer:i=(s,o)=>typeof o>"u"?n:o}=r;return typeof e=="string"?e:JSON.stringify(Oi(e,null,null,i),null," ")}equals(e,r,n){return super.equals(e.replace(/,([\r\n])/g,"$1"),r.replace(/,([\r\n])/g,"$1"),n)}}const Kc=new Vp;function Jc(t,e,r){return Kc.diff(t,e,r)}function Oi(t,e,r,n,i){e=e||[],r=r||[],n&&(t=n(i===void 0?"":i,t));let s;for(s=0;s<e.length;s+=1)if(e[s]===t)return r[s];let o;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),o=new Array(t.length),r.push(o),s=0;s<t.length;s+=1)o[s]=Oi(t[s],e,r,n,String(s));return e.pop(),r.pop(),o}if(t&&t.toJSON&&(t=t.toJSON()),typeof t=="object"&&t!==null){e.push(t),o={},r.push(o);const a=[];let c;for(c in t)Object.prototype.hasOwnProperty.call(t,c)&&a.push(c);for(a.sort(),s=0;s<a.length;s+=1)c=a[s],o[c]=Oi(t[c],e,r,n,c);e.pop(),r.pop()}else o=t;return o}class Kp extends zt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}}const Yc=new Kp;function Gc(t,e,r){return Yc.diff(t,e,r)}function Qc(t){return Array.isArray(t)?t.map(e=>Qc(e)):Object.assign(Object.assign({},t),{hunks:t.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((r,n)=>{var i;return r.startsWith("\\")||r.endsWith("\r")||!((i=e.lines[n+1])===null||i===void 0)&&i.startsWith("\\")?r:r+"\r"})}))})}function Xc(t){return Array.isArray(t)?t.map(e=>Xc(e)):Object.assign(Object.assign({},t),{hunks:t.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(r=>r.endsWith("\r")?r.substring(0,r.length-1):r)}))})}function Jp(t){return Array.isArray(t)||(t=[t]),!t.some(e=>e.hunks.some(r=>r.lines.some(n=>!n.startsWith("\\")&&n.endsWith("\r"))))}function Yp(t){return Array.isArray(t)||(t=[t]),t.some(e=>e.hunks.some(r=>r.lines.some(n=>n.endsWith("\r"))))&&t.every(e=>e.hunks.every(r=>r.lines.every((n,i)=>{var s;return n.startsWith("\\")||n.endsWith("\r")||((s=r.lines[i+1])===null||s===void 0?void 0:s.startsWith("\\"))})))}function uo(t){const e=t.split(/\n/),r=[];let n=0;function i(){const a={};for(r.push(a);n<e.length;){const c=e[n];if(/^(---|\+\+\+|@@)\s/.test(c))break;const u=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(c);u&&(a.index=u[1]),n++}for(s(a),s(a),a.hunks=[];n<e.length;){const c=e[n];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(c))break;if(/^@@/.test(c))a.hunks.push(o());else{if(c)throw new Error("Unknown line "+(n+1)+" "+JSON.stringify(c));n++}}}function s(a){const c=/^(---|\+\+\+)\s+(.*)\r?$/.exec(e[n]);if(c){const u=c[2].split(" ",2),l=(u[1]||"").trim();let f=u[0].replace(/\\\\/g,"\\");/^".*"$/.test(f)&&(f=f.substr(1,f.length-2)),c[1]==="---"?(a.oldFileName=f,a.oldHeader=l):(a.newFileName=f,a.newHeader=l),n++}}function o(){var a;const c=n,u=e[n++],l=u.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),f={oldStart:+l[1],oldLines:typeof l[2]>"u"?1:+l[2],newStart:+l[3],newLines:typeof l[4]>"u"?1:+l[4],lines:[]};f.oldLines===0&&(f.oldStart+=1),f.newLines===0&&(f.newStart+=1);let v=0,y=0;for(;n<e.length&&(y<f.oldLines||v<f.newLines||!((a=e[n])===null||a===void 0)&&a.startsWith("\\"));n++){const b=e[n].length==0&&n!=e.length-1?" ":e[n][0];if(b==="+"||b==="-"||b===" "||b==="\\")f.lines.push(e[n]),b==="+"?v++:b==="-"?y++:b===" "&&(v++,y++);else throw new Error(`Hunk at line ${c+1} contained invalid line ${e[n]}`)}if(!v&&f.newLines===1&&(f.newLines=0),!y&&f.oldLines===1&&(f.oldLines=0),v!==f.newLines)throw new Error("Added line count did not match for hunk at line "+(c+1));if(y!==f.oldLines)throw new Error("Removed line count did not match for hunk at line "+(c+1));return f}for(;n<e.length;)i();return r}function Gp(t,e,r){let n=!0,i=!1,s=!1,o=1;return function a(){if(n&&!s){if(i?o++:n=!1,t+o<=r)return t+o;s=!0}if(!i)return s||(n=!0),e<=t-o?t-o++:(i=!0,a())}}function Zc(t,e,r={}){let n;if(typeof e=="string"?n=uo(e):Array.isArray(e)?n=e:n=[e],n.length>1)throw new Error("applyPatch only works with a single input.");return Qp(t,n[0],r)}function Qp(t,e,r={}){(r.autoConvertLineEndings||r.autoConvertLineEndings==null)&&(Lp(t)&&Jp(e)?e=Qc(e):Mp(t)&&Yp(e)&&(e=Xc(e)));const n=t.split(`
55
+ `),i=e.hunks,s=r.compareLine||((b,T,H,B)=>T===B),o=r.fuzzFactor||0;let a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!i.length)return t;let c="",u=!1,l=!1;for(let b=0;b<i[i.length-1].lines.length;b++){const T=i[i.length-1].lines[b];T[0]=="\\"&&(c[0]=="+"?u=!0:c[0]=="-"&&(l=!0)),c=T}if(u){if(l){if(!o&&n[n.length-1]=="")return!1}else if(n[n.length-1]=="")n.pop();else if(!o)return!1}else if(l){if(n[n.length-1]!="")n.push("");else if(!o)return!1}function f(b,T,H,B=0,R=!0,m=[],p=0){let h=0,P=!1;for(;B<b.length;B++){const I=b[B],N=I.length>0?I[0]:" ",J=I.length>0?I.substr(1):I;if(N==="-")if(s(T+1,n[T],N,J))T++,h=0;else return!H||n[T]==null?null:(m[p]=n[T],f(b,T+1,H-1,B,!1,m,p+1));if(N==="+"){if(!R)return null;m[p]=J,p++,h=0,P=!0}if(N===" ")if(h++,m[p]=n[T],s(T+1,n[T],N,J))p++,R=!0,P=!1,T++;else return P||!H?null:n[T]&&(f(b,T+1,H-1,B+1,!1,m,p+1)||f(b,T+1,H-1,B,!1,m,p+1))||f(b,T,H-1,B+1,!1,m,p)}return p-=h,T-=h,m.length=p,{patchedLines:m,oldLineLastI:T-1}}const v=[];let y=0;for(let b=0;b<i.length;b++){const T=i[b];let H;const B=n.length-T.oldLines+o;let R;for(let m=0;m<=o;m++){R=T.oldStart+y-1;const p=Gp(R,a,B);for(;R!==void 0&&(H=f(T.lines,R,m),!H);R=p());if(H)break}if(!H)return!1;for(let m=a;m<R;m++)v.push(n[m]);for(let m=0;m<H.patchedLines.length;m++){const p=H.patchedLines[m];v.push(p)}a=H.oldLineLastI+1,y=R+1-T.oldStart}for(let b=a;b<n.length;b++)v.push(n[b]);return v.join(`
56
+ `)}function Xp(t,e){const r=typeof t=="string"?uo(t):t;let n=0;function i(){const s=r[n++];if(!s)return e.complete();e.loadFile(s,function(o,a){if(o)return e.complete(o);const c=Zc(a,s,e);e.patched(s,c,function(u){if(u)return e.complete(u);i()})})}i()}function el(t){return Array.isArray(t)?t.map(e=>el(e)).reverse():Object.assign(Object.assign({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map(e=>({oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(r=>r.startsWith("-")?`+${r.slice(1)}`:r.startsWith("+")?`-${r.slice(1)}`:r)}))})}function fo(t,e,r,n,i,s,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);const c=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:l}=a;Ei(r,n,Object.assign(Object.assign({},a),{callback:f=>{const v=u(f);l(v)}}))}else return u(Ei(r,n,a));function u(l){if(!l)return;l.push({value:"",lines:[]});function f(R){return R.map(function(m){return" "+m})}const v=[];let y=0,b=0,T=[],H=1,B=1;for(let R=0;R<l.length;R++){const m=l[R],p=m.lines||em(m.value);if(m.lines=p,m.added||m.removed){if(!y){const h=l[R-1];y=H,b=B,h&&(T=c>0?f(h.lines.slice(-c)):[],y-=T.length,b-=T.length)}for(const h of p)T.push((m.added?"+":"-")+h);m.added?B+=p.length:H+=p.length}else{if(y)if(p.length<=c*2&&R<l.length-2)for(const h of f(p))T.push(h);else{const h=Math.min(p.length,c);for(const I of f(p.slice(0,h)))T.push(I);const P={oldStart:y,oldLines:H-y+h,newStart:b,newLines:B-b+h,lines:T};v.push(P),y=0,b=0,T=[]}H+=p.length,B+=p.length}}for(const R of v)for(let m=0;m<R.lines.length;m++)R.lines[m].endsWith(`
57
+ `)?R.lines[m]=R.lines[m].slice(0,-1):(R.lines.splice(m+1,0,"\"),m++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:s,hunks:v}}}function Pi(t){if(Array.isArray(t))return t.map(Pi).join(`
58
58
  `);const e=[];t.oldFileName==t.newFileName&&e.push("Index: "+t.oldFileName),e.push("==================================================================="),e.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),e.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader));for(let r=0;r<t.hunks.length;r++){const n=t.hunks[r];n.oldLines===0&&(n.oldStart-=1),n.newLines===0&&(n.newStart-=1),e.push("@@ -"+n.oldStart+","+n.oldLines+" +"+n.newStart+","+n.newLines+" @@");for(const i of n.lines)e.push(i)}return e.join(`
59
59
  `)+`
60
- `}function fo(t,e,r,n,i,s,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){const{callback:a}=o;uo(t,e,r,n,i,s,Object.assign(Object.assign({},o),{callback:c=>{a(c?Ci(c):void 0)}}))}else{const a=uo(t,e,r,n,i,s,o);return a?Ci(a):void 0}}function Fp(t,e,r,n,i,s){return fo(t,t,e,r,n,i,s)}function jp(t){const e=t.endsWith(`
60
+ `}function ho(t,e,r,n,i,s,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){const{callback:a}=o;fo(t,e,r,n,i,s,Object.assign(Object.assign({},o),{callback:c=>{a(c?Pi(c):void 0)}}))}else{const a=fo(t,e,r,n,i,s,o);return a?Pi(a):void 0}}function Zp(t,e,r,n,i,s){return ho(t,t,e,r,n,i,s)}function em(t){const e=t.endsWith(`
61
61
  `),r=t.split(`
62
62
  `).map(n=>n+`
63
- `);return e?r.pop():r.push(r.pop().slice(0,-1)),r}function Bp(t){const e=[];let r,n;for(let i=0;i<t.length;i++)r=t[i],r.added?n=1:r.removed?n=-1:n=0,e.push([n,r.value]);return e}function Up(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r];n.added?e.push("<ins>"):n.removed&&e.push("<del>"),e.push(Wp(n.value)),n.added?e.push("</ins>"):n.removed&&e.push("</del>")}return e.join("")}function Wp(t){let e=t;return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e}const qp=Object.freeze(Object.defineProperty({__proto__:null,Diff:Ht,applyPatch:Qc,applyPatches:Mp,arrayDiff:Kc,canonicalize:Oi,characterDiff:Ic,convertChangesToDMP:Bp,convertChangesToXML:Up,createPatch:Fp,createTwoFilesPatch:fo,cssDiff:qc,diffArrays:Jc,diffChars:Ac,diffCss:Hc,diffJson:Vc,diffLines:Ei,diffSentences:Wc,diffTrimmedLines:jc,diffWords:Lc,diffWordsWithSpace:ao,formatPatch:Ci,jsonDiff:zc,lineDiff:co,parsePatch:lo,reversePatch:Xc,sentenceDiff:Uc,structuredPatch:uo,wordDiff:Nc,wordsWithSpaceDiff:Fc},Symbol.toStringTag,{value:"Module"}));class Hp{constructor(e){this.ctx=e,this.JsDiff=qp,this.diffChars=Ac,this.diffWords=Lc,this.diffWordsWithSpace=ao,this.diffLines=Ei,this.diffTrimmedLines=jc,this.diffSentences=Wc,this.diffCss=Hc,this.diffJson=Vc,this.diffArrays=Jc,this.createTwoFilesPatch=fo,this.ctx.set("jsdiff",this)}}const zp={"diff-container":"_diff-container_lq0si_2"},Vp=t=>{let{user:e,target:r}=t;const n=window.mw?.config?.get("wgArticlePath")||"/$1",i=s=>n.replace("$1",s);return O("span",{className:"mw-userlinks",children:[O("a",{href:i(`User:${e}`),className:"mw-userlink",target:r,children:e})," ",O("span",{className:"mw-usertoollinks",children:["(",O("a",{href:i(`User_talk:${e}`),className:"mw-usertoollinks-talk",target:r,children:"talk"})," | ",O("a",{href:i(`Special:Contributions/${e}`),className:"mw-usertoollinks-contribs",target:r,children:"contribs"})," | ",O("a",{href:i(`Special:Block/${e}`),className:"mw-usertoollinks-block",target:r,children:"block"}),")"]})]})},Kp=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format,Zc=t=>{let e=["diff-title"];return t.type==="from"?e.push("diff-otitle"):t.type==="to"&&e.push("diff-ntitle"),!t.pageid||!t.userid?O("td",{colSpan:2,className:e,children:O("div",{className:"mw-diff-title--title",children:t.type==="from"?"Original content":t.type==="to"?"Your content":""})}):O("td",{colSpan:2,className:e,children:[O("div",{className:"mw-diff-title--title",children:t.pagetitle||t.timestamp}),O("div",{className:"mw-diff-title--user",children:t.username&&O(Vp,{user:t.username,target:"_blank"})}),O("div",{className:"mw-diff-title--timestamp",children:t.timestamp&&Kp(new Date(t.timestamp))}),O("div",{className:"mw-diff-title--comment",children:t.parsedcomment&&O(ci,{children:["(",O("i",{innerHTML:t.parsedcomment}),")"]})}),O("div",{className:"mw-diff-title--navigation"})]})},Jp=t=>{const{data:e,...r}=t,n=O("table",{className:"theme-ipe diff diff-type-table","data-mw":"interface",...r,children:[O("colgroup",{children:[O("col",{className:"diff-marker"}),O("col",{className:"diff-content"}),O("col",{className:"diff-marker"}),O("col",{className:"diff-content"})]}),O("tbody",{children:[O("tr",{children:[O(Zc,{type:"from",pageid:e.fromid,pagetitle:e.fromtitle,revid:e.fromrevid,size:e.fromsize,timestamp:e.fromtimestamp,username:e.fromuser,userid:e.fromuserid,comment:e.fromcomment,parsedcomment:e.fromparsedcomment}),O(Zc,{type:"to",pageid:e.toid,pagetitle:e.totitle,revid:e.torevid,size:e.tosize,timestamp:e.totimestamp,username:e.touser,userid:e.touserid,comment:e.tocomment,parsedcomment:e.toparsedcomment})]}),O("div",{id:"diffbody"}),O("tr",{className:"diff-size",style:{textAlign:"center"},children:[O("td",{colSpan:2,className:"diff-size-old",children:e.fromsize!==void 0&&`${e.fromsize} bytes`}),O("td",{colSpan:2,className:"diff-size-new",children:e.tosize!==void 0&&`${e.tosize} bytes`})]})]})]});return n.querySelector("#diffbody").outerHTML=e.body||O("tr",{children:O("td",{colSpan:4,children:O("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"5rem"},children:O("i",{children:"No changes"})})})}).outerHTML,n},Yp=(t,e=document)=>e.querySelector(t),Gp=(t,e=document)=>e.querySelectorAll(t);var Qp=Object.create,ho=Object.defineProperty,Xp=Object.getOwnPropertyDescriptor,el=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),tl=t=>{throw TypeError(t)},Zp=(t,e,r)=>e in t?ho(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,em=(t,e)=>ho(t,"name",{value:e,configurable:!0}),tm=t=>[,,,Qp(t?.[el("metadata")]??null)],rm=["class","method","getter","setter","accessor","field","value","get","set"],rl=t=>t!==void 0&&typeof t!="function"?tl("Function expected"):t,nm=(t,e,r,n,i)=>({kind:rm[t],name:e,metadata:n,addInitializer:s=>r._?tl("Already initialized"):i.push(rl(s||null))}),im=(t,e)=>Zp(e,el("metadata"),t[3]),sm=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},om=(t,e,r,n,i,s)=>{var o,a,c,l=e&7,u=!1,f=0,v=t[f]||(t[f]=[]),y=l&&(i=i.prototype,l<5&&(l>3||!u)&&Xp(i,r));em(i,r);for(var b=n.length-1;b>=0;b--)c=nm(l,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,rl(o)&&(i=o);return im(t,i),y&&ho(i,r,y),u?l^4?s:y:i},nl,po,il;const sl=["diffChars","diffWords","diffSentences","diffLines","createTwoFilesPatch"];nl=[st(["jsdiff"]),gi(Pe.object({"quickDiff.preferredCompareMode":Pe.union([Pe.const("jsDiff"),Pe.const("mwApi")]).description("The preferred comparison mode for quick diff").default("mwApi"),"quickDiff.jsDiff.defaultType":Pe.union(sl.map(t=>Pe.const(t))).description("The default diff type for JsDiff").default("diffSentences")}).description("Quick Diff Preferences"),{"quickDiff.preferredCompareMode":"mwApi","quickDiff.jsDiff.defaultType":"diffSentences"})];class Pi extends(il=Pt){constructor(e){super(e,{},"quick-diff"),this.ctx=e,this.VALID_DIFF_TYPES=sl,this.COMPARE_API_DEFAULT_OPTIONS={prop:["comment","diff","diffsize","ids","parsedcomment","size","timestamp","title","user"].join("|"),difftype:"table"}}start(){this.ctx.set("quickDiff",this),this.ctx.on("quickEdit/wikiPage",this.injectQuickEdit.bind(this)),window.RLQ.push(this.injectHistoryPage.bind(this))}stop(){this.ctx.off("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}injectHistoryPage(){const e=Yp("#mw-history-compare");if(!e)return;Gp(".mw-history-compareselectedversions-button",e).forEach(n=>{n.after(O("button",{className:"cdx-button",onClick:i=>{i.preventDefault();const s=new FormData(e),o=Number(s.get("oldid"))||0,a=Number(s.get("diff"))||0;if(!s.get("title")||!o||!a)return this.logger.warn("Missing title or revision IDs");this.comparePages({fromrev:o,torev:a})},children:"Quick Diff"}))})}injectQuickEdit({modal:e,wikiPage:r}){e.setButtons([{label:"Diff",side:"left",className:"btn btn-secondary",method:()=>{const n=r.title,i=r.revisions?.[0]?.content||"",s=e.get$content().find('textarea[name="text"]').prop("value")||"";return this.comparePages({fromtitle:n,fromtext:i,totitle:n,totext:s})}}])}simpleTextDiff(e,r){const n=this.ctx.modal.show({title:"Quick Diff",className:"in-page-edit ipe-quickDiff"});n.show();const i=O("pre",{className:zp["diff-container"]}),s=O("div",{style:{display:"flex",gap:"1em"},children:this.VALID_DIFF_TYPES.map((o,a)=>O(fc,{name:"diffType",value:o,label:o,inputProps:{checked:a===0}}))});n.setContent(O("section",{children:[s,i]})),s.querySelectorAll('input[name="diffType"]').forEach(o=>{o.addEventListener("change",()=>{const a=this.renderJsDiff(e,r,o.value);i.textContent="",i.appendChild(a)})}),s.querySelector('input[name="diffType"]').dispatchEvent(new Event("change"))}renderJsDiff(e,r,n="diffSentences"){const i=document.createDocumentFragment();let s;if(n==="createTwoFilesPatch"){let o=!1;s=this.ctx.jsdiff.createTwoFilesPatch("original.txt","modified.txt",e,r).split(`
63
+ `);return e?r.pop():r.push(r.pop().slice(0,-1)),r}function tm(t){const e=[];let r,n;for(let i=0;i<t.length;i++)r=t[i],r.added?n=1:r.removed?n=-1:n=0,e.push([n,r.value]);return e}function rm(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r];n.added?e.push("<ins>"):n.removed&&e.push("<del>"),e.push(nm(n.value)),n.added?e.push("</ins>"):n.removed&&e.push("</del>")}return e.join("")}function nm(t){let e=t;return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e}const im=Object.freeze(Object.defineProperty({__proto__:null,Diff:zt,applyPatch:Zc,applyPatches:Xp,arrayDiff:Yc,canonicalize:Oi,characterDiff:Tc,convertChangesToDMP:tm,convertChangesToXML:rm,createPatch:Zp,createTwoFilesPatch:ho,cssDiff:zc,diffArrays:Gc,diffChars:Rc,diffCss:Vc,diffJson:Jc,diffLines:Ei,diffSentences:Hc,diffTrimmedLines:Uc,diffWords:jc,diffWordsWithSpace:co,formatPatch:Pi,jsonDiff:Kc,lineDiff:lo,parsePatch:uo,reversePatch:el,sentenceDiff:qc,structuredPatch:fo,wordDiff:Mc,wordsWithSpaceDiff:Bc},Symbol.toStringTag,{value:"Module"}));class sm{constructor(e){this.ctx=e,this.JsDiff=im,this.diffChars=Rc,this.diffWords=jc,this.diffWordsWithSpace=co,this.diffLines=Ei,this.diffTrimmedLines=Uc,this.diffSentences=Hc,this.diffCss=Vc,this.diffJson=Jc,this.diffArrays=Gc,this.createTwoFilesPatch=ho,this.ctx.set("jsdiff",this)}}const om={"diff-container":"_diff-container_lq0si_2"},am=t=>{let{user:e,target:r}=t;const n=window.mw?.config?.get("wgArticlePath")||"/$1",i=s=>n.replace("$1",s);return O("span",{className:"mw-userlinks",children:[O("a",{href:i(`User:${e}`),className:"mw-userlink",target:r,children:e})," ",O("span",{className:"mw-usertoollinks",children:["(",O("a",{href:i(`User_talk:${e}`),className:"mw-usertoollinks-talk",target:r,children:"talk"})," | ",O("a",{href:i(`Special:Contributions/${e}`),className:"mw-usertoollinks-contribs",target:r,children:"contribs"})," | ",O("a",{href:i(`Special:Block/${e}`),className:"mw-usertoollinks-block",target:r,children:"block"}),")"]})]})},cm=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format,tl=t=>{let e=["diff-title"];return t.type==="from"?e.push("diff-otitle"):t.type==="to"&&e.push("diff-ntitle"),!t.pageid||!t.userid?O("td",{colSpan:2,className:e,children:O("div",{className:"mw-diff-title--title",children:t.type==="from"?"Original content":t.type==="to"?"Your content":""})}):O("td",{colSpan:2,className:e,children:[O("div",{className:"mw-diff-title--title",children:t.pagetitle||t.timestamp}),O("div",{className:"mw-diff-title--user",children:t.username&&O(am,{user:t.username,target:"_blank"})}),O("div",{className:"mw-diff-title--timestamp",children:t.timestamp&&cm(new Date(t.timestamp))}),O("div",{className:"mw-diff-title--comment",children:t.parsedcomment&&O(ci,{children:["(",O("i",{innerHTML:t.parsedcomment}),")"]})}),O("div",{className:"mw-diff-title--navigation"})]})},lm=t=>{const{data:e,...r}=t,n=O("table",{className:"theme-ipe diff diff-type-table","data-mw":"interface",...r,children:[O("colgroup",{children:[O("col",{className:"diff-marker"}),O("col",{className:"diff-content"}),O("col",{className:"diff-marker"}),O("col",{className:"diff-content"})]}),O("tbody",{children:[O("tr",{children:[O(tl,{type:"from",pageid:e.fromid,pagetitle:e.fromtitle,revid:e.fromrevid,size:e.fromsize,timestamp:e.fromtimestamp,username:e.fromuser,userid:e.fromuserid,comment:e.fromcomment,parsedcomment:e.fromparsedcomment}),O(tl,{type:"to",pageid:e.toid,pagetitle:e.totitle,revid:e.torevid,size:e.tosize,timestamp:e.totimestamp,username:e.touser,userid:e.touserid,comment:e.tocomment,parsedcomment:e.toparsedcomment})]}),O("div",{id:"diffbody"}),O("tr",{className:"diff-size",style:{textAlign:"center"},children:[O("td",{colSpan:2,className:"diff-size-old",children:e.fromsize!==void 0&&`${e.fromsize} bytes`}),O("td",{colSpan:2,className:"diff-size-new",children:e.tosize!==void 0&&`${e.tosize} bytes`})]})]})]});return n.querySelector("#diffbody").outerHTML=e.body||O("tr",{children:O("td",{colSpan:4,children:O("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"5rem"},children:O("i",{children:"No changes"})})})}).outerHTML,n},um=(t,e=document)=>e.querySelector(t),fm=(t,e=document)=>e.querySelectorAll(t);var dm=Object.create,po=Object.defineProperty,hm=Object.getOwnPropertyDescriptor,rl=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),nl=t=>{throw TypeError(t)},pm=(t,e,r)=>e in t?po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mm=(t,e)=>po(t,"name",{value:e,configurable:!0}),gm=t=>[,,,dm(t?.[rl("metadata")]??null)],ym=["class","method","getter","setter","accessor","field","value","get","set"],il=t=>t!==void 0&&typeof t!="function"?nl("Function expected"):t,vm=(t,e,r,n,i)=>({kind:ym[t],name:e,metadata:n,addInitializer:s=>r._?nl("Already initialized"):i.push(il(s||null))}),bm=(t,e)=>pm(e,rl("metadata"),t[3]),_m=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},wm=(t,e,r,n,i,s)=>{var o,a,c,u=e&7,l=!1,f=0,v=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!l)&&hm(i,r));mm(i,r);for(var b=n.length-1;b>=0;b--)c=vm(u,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,il(o)&&(i=o);return bm(t,i),y&&po(i,r,y),l?u^4?s:y:i},sl,mo,ol;const al=["diffChars","diffWords","diffSentences","diffLines","createTwoFilesPatch"];sl=[ot(["jsdiff"]),gi(ke.object({"quickDiff.preferredCompareMode":ke.union([ke.const("jsDiff"),ke.const("mwApi")]).description("The preferred comparison mode for quick diff").default("mwApi"),"quickDiff.jsDiff.defaultType":ke.union(al.map(t=>ke.const(t))).description("The default diff type for JsDiff").default("diffSentences")}).description("Quick Diff Preferences"),{"quickDiff.preferredCompareMode":"mwApi","quickDiff.jsDiff.defaultType":"diffSentences"})];class Ci extends(ol=kt){constructor(e){super(e,{},"quick-diff"),this.ctx=e,this.VALID_DIFF_TYPES=al,this.COMPARE_API_DEFAULT_OPTIONS={prop:["comment","diff","diffsize","ids","parsedcomment","size","timestamp","title","user"].join("|"),difftype:"table"}}start(){this.ctx.set("quickDiff",this),this.ctx.on("quickEdit/wikiPage",this.injectQuickEdit.bind(this)),window.RLQ.push(this.injectHistoryPage.bind(this))}stop(){this.ctx.off("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}injectHistoryPage(){const e=um("#mw-history-compare");if(!e)return;fm(".mw-history-compareselectedversions-button",e).forEach(n=>{n.after(O("button",{className:"cdx-button",onClick:i=>{i.preventDefault();const s=new FormData(e),o=Number(s.get("oldid"))||0,a=Number(s.get("diff"))||0;if(!s.get("title")||!o||!a)return this.logger.warn("Missing title or revision IDs");this.comparePages({fromrev:o,torev:a})},children:"Quick Diff"}))})}injectQuickEdit({modal:e,wikiPage:r}){e.setButtons([{label:"Diff",side:"left",className:"btn btn-secondary",method:()=>{const n=r.title,i=r.revisions?.[0]?.content||"",s=e.get$content().find('textarea[name="text"]').prop("value")||"";return this.comparePages({fromtitle:n,fromtext:i,totitle:n,totext:s})}}])}simpleTextDiff(e,r){const n=this.ctx.modal.show({title:"Quick Diff",className:"in-page-edit ipe-quickDiff"});n.show();const i=O("pre",{className:om["diff-container"]}),s=O("div",{style:{display:"flex",gap:"1em"},children:this.VALID_DIFF_TYPES.map((o,a)=>O(hc,{name:"diffType",value:o,label:o,inputProps:{checked:a===0}}))});n.setContent(O("section",{children:[s,i]})),s.querySelectorAll('input[name="diffType"]').forEach(o=>{o.addEventListener("change",()=>{const a=this.renderJsDiff(e,r,o.value);i.textContent="",i.appendChild(a)})}),s.querySelector('input[name="diffType"]').dispatchEvent(new Event("change"))}renderJsDiff(e,r,n="diffSentences"){const i=document.createDocumentFragment();let s;if(n==="createTwoFilesPatch"){let o=!1;s=this.ctx.jsdiff.createTwoFilesPatch("original.txt","modified.txt",e,r).split(`
64
64
  `).map(function(a){const c={value:a+`
65
- `};return a.startsWith("@@")?(c.chunkHeader=!0,o=!0):o&&(a.startsWith("-")?c.removed=!0:a.startsWith("+")&&(c.added=!0)),c})}else{const o=this.ctx.jsdiff[n];if(!o)throw new Error(`Missing DiffEngine for ${n}`);s=o(e,r)}if(!Array.isArray(s))throw new Error("Missing diff result");for(let o=0;o<s.length;o++){if(s[o].added&&s[o+1]&&s[o+1].removed){const c=s[o];s[o]=s[o+1],s[o+1]=c}let a;s[o].removed?(a=document.createElement("del"),a.appendChild(document.createTextNode(s[o].value))):s[o].added?(a=document.createElement("ins"),a.appendChild(document.createTextNode(s[o].value))):s[o].chunkHeader?(a=document.createElement("span"),a.setAttribute("class","chunk-header"),a.appendChild(document.createTextNode(s[o].value))):a=document.createTextNode(s[o].value),i.appendChild(a)}return i}comparePages(e){const r=this.ctx.modal.createObject({title:"Loading diff...",content:O(mr,{}),className:"quick-diff"}).init();return window.mw&&mw.loader.getState("mediawiki.diff.styles")!=="ready"&&mw.loader.load(["mediawiki.diff.styles"]),this.ctx.api.post({...this.COMPARE_API_DEFAULT_OPTIONS,...e,action:"compare",format:"json",formatversion:2}).then(n=>{if(n.data?.error||n.data?.errors){const s=[n.data?.error,...n.data?.errors||[]].filter(Boolean);throw new Error(s.map(o=>o.info).join(`
66
- `),{cause:n})}if(!n.data.compare)throw new Error("No compare data received",{cause:n});const{data:{compare:i}}=n;r.setTitle(i.fromtitle&&i.totitle?`${i.fromtitle} ⇔ ${i.totitle}`:"Differences"),r.setContent(O("section",{children:O(Jp,{data:i})}))}).catch(n=>{r.setContent(O(uc,{title:"Failed to load diff",type:"error",children:O("pre",{children:n instanceof Error?n.message:String(n)})}))}),r.show()}}po=tm(il),Pi=om(po,0,"PluginQuickDiffCore",nl,Pi),sm(po,1,Pi);const la=class la extends Pt{constructor(e){super(e,{},"quick-diff-loader"),this.ctx=e,e.plugin(Hp),e.plugin(Pi)}};la.inject=["api","wikiPage","modal"];let mo=la;const am=Object.freeze(Object.defineProperty({__proto__:null,PluginQuickDiff:mo},Symbol.toStringTag,{value:"Module"})),ua=class ua extends Pt{constructor(e){super(e,{},"quick-redirect"),this.ctx=e}start(){this.ctx.set("quickRedirect",this.quickRedirect.bind(this)),this.ctx.set("redirectPage",this.redirectPage.bind(this));const e=window.mw?.config.get("wgPageName")||"",r=window.mw?.config.get("wgIsProbablyEditable");this.ctx.inject(["toolbox"],n=>{this.ctx=n,n.toolbox.addButton({id:"quick-redirect",icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file-symlink",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M4 21v-4a3 3 0 0 1 3 -3h5"}),O("path",{d:"M9 17l3 -3l-3 -3"}),O("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),O("path",{d:"M5 11v-6a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-9.5"})]}),tooltip:"Quick Redirect",group:"group1",onClick:()=>{this.quickRedirect(r?{to:e}:{})}}),this.addDisposeHandler(i=>{i.toolbox.removeButton("quick-redirect")})})}stop(){}quickRedirect(e){const r=this.ctx.modal.createObject({title:"Quick Redirect",content:O(mr,{}),className:"quick-redirect",sizeClass:"medium",center:!0}).init();let n=null;return r.setContent(O("form",{ref:i=>n=i,style:{display:"flex",flexDirection:"column",gap:"1rem"},onSubmit:i=>{i.preventDefault();const s=new FormData(n),o={from:s.get("from"),to:s.get("to"),reason:s.get("reason")||"",overwrite:s.get("overwrite")==="on"};r.setLoadingState(!0),this.redirectPage(o).then(a=>{r.close(),this.ctx.modal.notify("success",{title:"Redirect successful",content:"The redirect has been created."})}).catch(a=>{r.setLoadingState(!1),this.ctx.modal.notify("error",{title:"Failed to redirect",content:a instanceof Error?a.message:String(a)})})},children:[O(bc,{inputs:[{label:"From",name:"from",value:e?.from},{label:"To",name:"to",value:e?.to}]}),O(Xs,{label:"Reason",id:"reason",name:"reason",value:e?.reason}),O("div",{children:O(Lr,{name:"overwrite",id:"overwrite",checked:e?.overwrite,children:"Force create redirect even if the from page already exists"})}),O(pi,{type:"primary",style:{width:"100%"},children:"Create Redirect"})]})),r.show()}async redirectPage(e){const{from:r,to:n,reason:i="",overwrite:s=!1}=e,o=await this.ctx.wikiPage.newBlankPage({title:r}),a=`#REDIRECT [[:${n}]]`,c=await o.edit({text:a,summary:i},{createonly:!s});if(c.data?.errors)throw new Error(c.data.errors[0].text,{cause:c});return c}};ua.inject=["api","wikiPage","modal"];let go=ua;const cm=Object.freeze(Object.defineProperty({__proto__:null,PluginQuickRedirect:go},Symbol.toStringTag,{value:"Module"}));var lm=Object.create,yo=Object.defineProperty,um=Object.getOwnPropertyDescriptor,ol=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),al=t=>{throw TypeError(t)},fm=(t,e,r)=>e in t?yo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dm=(t,e)=>yo(t,"name",{value:e,configurable:!0}),hm=t=>[,,,lm(t?.[ol("metadata")]??null)],pm=["class","method","getter","setter","accessor","field","value","get","set"],cl=t=>t!==void 0&&typeof t!="function"?al("Function expected"):t,mm=(t,e,r,n,i)=>({kind:pm[t],name:e,metadata:n,addInitializer:s=>r._?al("Already initialized"):i.push(cl(s||null))}),gm=(t,e)=>fm(e,ol("metadata"),t[3]),ym=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},vm=(t,e,r,n,i,s)=>{var o,a,c,l=e&7,u=!1,f=0,v=t[f]||(t[f]=[]),y=l&&(i=i.prototype,l<5&&(l>3||!u)&&um(i,r));dm(i,r);for(var b=n.length-1;b>=0;b--)c=mm(l,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,cl(o)&&(i=o);return gm(t,i),y&&yo(i,r,y),u?l^4?s:y:i},ll,vo,ul;ll=[gi(Pe.object({toolboxAlwaysShow:Pe.boolean().description("Make the toolbox opened by default").default(!1)}),{toolboxAlwaysShow:!1}),st(["preferences"])];class $i extends(ul=Ar){constructor(e){super(e,"toolbox",!1),this.ctx=e,this.container=void 0,this.forceShow=!1}async start(){mw&&mw.config.get("wgIsArticle")===!1&&!this.forceShow?this.container=this.createIndicatorForNotArticlePage():this.container=this.createToolbox(),document.body.appendChild(this.container),await hc(0),this.ctx.preferences.get("toolboxAlwaysShow").then(e=>{e&&(this.container.querySelector("#toolbox-toggle")?.classList.add("opened"),this.container.querySelectorAll(".btn-group").forEach(r=>{r.classList.add("opened")}))})}stop(){this.container?.remove()}createToolbox(){const r=O("div",{id:"ipe-edit-toolbox",children:[O("ul",{className:"btn-group group1",style:{display:"flex",flexDirection:"column"}}),O("ul",{className:"btn-group group2",style:{display:"flex",flexDirection:"row"}}),O("button",{className:"ipe-toolbox-btn",id:"toolbox-toggle",onClick:function(n){const i=this.classList.contains("opened");this.classList.toggle("opened",!i),r.querySelectorAll(".btn-group").forEach(s=>{s.classList.toggle("opened",!i)})},children:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M12 5l0 14"}),O("path",{d:"M5 12l14 0"})]})})]});return r}createIndicatorForNotArticlePage(){return O("div",{id:"ipe-edit-toolbox",children:O("div",{id:"ipe-toolbox-placeholder",style:"width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #3f51b5; color: #fff; pointer-events: none;",children:O("svg",{style:"width: 0.5em; height: 0.5em; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M5 12l5 5l10 -10"})]})})})}normalizeButtonId(e){return e||(e=Math.random().toString(36).substring(2,8)),`ipe-toolbox__${e.trim()}`.replace(/\s\.#/g,"-")}addButton(e){let{id:r,group:n,icon:i,tooltip:s,buttonProps:o,onClick:a,index:c}=e;r=this.normalizeButtonId(r);const l=this.container.querySelector(`#${r}`);l&&(this.ctx.logger("toolbox").warn(`Button with id ${r} already exists, replacing it.`),l.remove());let u=null;if(typeof n>"u"||n==="auto"){const v=this.container.querySelector(".btn-group.group1"),y=this.container.querySelector(".btn-group.group2"),b=v?.children.length||0,R=y?.children.length||0;u=b<=R?v:y}else u=this.container.querySelector(`.btn-group.${n}`);if(!u)throw new Error(`Button group ${n} not found`);const f=O("li",{class:"btn-tip-group",id:r,onClick:a,children:[O("div",{class:"btn-tip",children:s}),O("button",{id:`${r}-btn`,class:"ipe-toolbox-btn",...o,children:i})]});return typeof c=="number"?c<=0?u.prepend(f):c>=u.children.length?u.appendChild(f):u.children[c]?.before(f):u.appendChild(f),this.ctx.emit("toolbox/button/added",{ctx:this.ctx,button:f}),f}removeButton(e){this.container.querySelector(`.ipe-toolbox-btn#${e}`)?.remove(),this.ctx.emit("toolbox/button/removed",{ctx:this.ctx,id:e})}}vo=hm(ul),$i=vm(vo,0,"PluginToolbox",ll,$i),ym(vo,1,$i);const bm=Object.freeze(Object.defineProperty({__proto__:null,get PluginToolbox(){return $i}},Symbol.toStringTag,{value:"Module"}));/**
65
+ `};return a.startsWith("@@")?(c.chunkHeader=!0,o=!0):o&&(a.startsWith("-")?c.removed=!0:a.startsWith("+")&&(c.added=!0)),c})}else{const o=this.ctx.jsdiff[n];if(!o)throw new Error(`Missing DiffEngine for ${n}`);s=o(e,r)}if(!Array.isArray(s))throw new Error("Missing diff result");for(let o=0;o<s.length;o++){if(s[o].added&&s[o+1]&&s[o+1].removed){const c=s[o];s[o]=s[o+1],s[o+1]=c}let a;s[o].removed?(a=document.createElement("del"),a.appendChild(document.createTextNode(s[o].value))):s[o].added?(a=document.createElement("ins"),a.appendChild(document.createTextNode(s[o].value))):s[o].chunkHeader?(a=document.createElement("span"),a.setAttribute("class","chunk-header"),a.appendChild(document.createTextNode(s[o].value))):a=document.createTextNode(s[o].value),i.appendChild(a)}return i}comparePages(e){const r=this.ctx.modal.createObject({title:"Loading diff...",content:O(gr,{}),className:"quick-diff"}).init();return window.mw&&mw.loader.getState("mediawiki.diff.styles")!=="ready"&&mw.loader.load(["mediawiki.diff.styles"]),this.ctx.api.post({...this.COMPARE_API_DEFAULT_OPTIONS,...e,action:"compare",format:"json",formatversion:2}).then(n=>{if(n.data?.error||n.data?.errors){const s=[n.data?.error,...n.data?.errors||[]].filter(Boolean);throw new Error(s.map(o=>o.info).join(`
66
+ `),{cause:n})}if(!n.data.compare)throw new Error("No compare data received",{cause:n});const{data:{compare:i}}=n;r.setTitle(i.fromtitle&&i.totitle?`${i.fromtitle} ⇔ ${i.totitle}`:"Differences"),r.setContent(O("section",{children:O(lm,{data:i})}))}).catch(n=>{r.setContent(O(dc,{title:"Failed to load diff",type:"error",children:O("pre",{children:n instanceof Error?n.message:String(n)})}))}),r.show()}}mo=gm(ol),Ci=wm(mo,0,"PluginQuickDiffCore",sl,Ci),_m(mo,1,Ci);const ua=class ua extends kt{constructor(e){super(e,{},"quick-diff-loader"),this.ctx=e,e.plugin(sm),e.plugin(Ci)}};ua.inject=["api","wikiPage","modal"];let go=ua;const xm=Object.freeze(Object.defineProperty({__proto__:null,PluginQuickDiff:go},Symbol.toStringTag,{value:"Module"})),fa=class fa extends kt{constructor(e){super(e,{},"quick-redirect"),this.ctx=e}start(){this.ctx.set("quickRedirect",this.quickRedirect.bind(this)),this.ctx.set("redirectPage",this.redirectPage.bind(this));const e=window.mw?.config.get("wgPageName")||"",r=window.mw?.config.get("wgIsProbablyEditable");this.ctx.inject(["toolbox"],n=>{this.ctx=n,n.toolbox.addButton({id:"quick-redirect",icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file-symlink",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M4 21v-4a3 3 0 0 1 3 -3h5"}),O("path",{d:"M9 17l3 -3l-3 -3"}),O("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),O("path",{d:"M5 11v-6a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-9.5"})]}),tooltip:"Quick Redirect",group:"group1",onClick:()=>{this.quickRedirect(r?{to:e}:{})}}),this.addDisposeHandler(i=>{i.toolbox.removeButton("quick-redirect")})})}stop(){}quickRedirect(e){const r=this.ctx.modal.createObject({title:"Quick Redirect",content:O(gr,{}),className:"quick-redirect",sizeClass:"medium",center:!0}).init();let n=null;return r.setContent(O("form",{ref:i=>n=i,style:{display:"flex",flexDirection:"column",gap:"1rem"},onSubmit:i=>{i.preventDefault();const s=new FormData(n),o={from:s.get("from"),to:s.get("to"),reason:s.get("reason")||"",overwrite:s.get("overwrite")==="on"};r.setLoadingState(!0),this.redirectPage(o).then(a=>{r.close(),this.ctx.modal.notify("success",{title:"Redirect successful",content:"The redirect has been created."})}).catch(a=>{r.setLoadingState(!1),this.ctx.modal.notify("error",{title:"Failed to redirect",content:a instanceof Error?a.message:String(a)})})},children:[O(wc,{inputs:[{label:"From",name:"from",value:e?.from},{label:"To",name:"to",value:e?.to}]}),O(Zs,{label:"Reason",id:"reason",name:"reason",value:e?.reason}),O("div",{children:O(Lr,{name:"overwrite",id:"overwrite",checked:e?.overwrite,children:"Force create redirect even if the from page already exists"})}),O(pi,{type:"primary",style:{width:"100%"},children:"Create Redirect"})]})),r.show()}async redirectPage(e){const{from:r,to:n,reason:i="",overwrite:s=!1}=e,o=await this.ctx.wikiPage.newBlankPage({title:r}),a=`#REDIRECT [[:${n}]]`,c=await o.edit({text:a,summary:i},{createonly:!s});if(c.data?.errors)throw new Error(c.data.errors[0].text,{cause:c});return c}};fa.inject=["api","wikiPage","modal"];let yo=fa;const Sm=Object.freeze(Object.defineProperty({__proto__:null,PluginQuickRedirect:yo},Symbol.toStringTag,{value:"Module"}));var Em=Object.create,vo=Object.defineProperty,Om=Object.getOwnPropertyDescriptor,cl=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),ll=t=>{throw TypeError(t)},Pm=(t,e,r)=>e in t?vo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cm=(t,e)=>vo(t,"name",{value:e,configurable:!0}),km=t=>[,,,Em(t?.[cl("metadata")]??null)],$m=["class","method","getter","setter","accessor","field","value","get","set"],ul=t=>t!==void 0&&typeof t!="function"?ll("Function expected"):t,Im=(t,e,r,n,i)=>({kind:$m[t],name:e,metadata:n,addInitializer:s=>r._?ll("Already initialized"):i.push(ul(s||null))}),Am=(t,e)=>Pm(e,cl("metadata"),t[3]),Tm=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},Rm=(t,e,r,n,i,s)=>{var o,a,c,u=e&7,l=!1,f=0,v=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!l)&&Om(i,r));Cm(i,r);for(var b=n.length-1;b>=0;b--)c=Im(u,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,ul(o)&&(i=o);return Am(t,i),y&&vo(i,r,y),l?u^4?s:y:i},fl,bo,dl;fl=[gi(ke.object({toolboxAlwaysShow:ke.boolean().description("Make the toolbox opened by default").default(!1)}),{toolboxAlwaysShow:!1}),ot(["preferences"])];class ki extends(dl=Tr){constructor(e){super(e,"toolbox",!1),this.ctx=e,this.container=void 0,this.forceShow=!1}async start(){mw&&mw.config.get("wgIsArticle")===!1&&!this.forceShow?this.container=this.createIndicatorForNotArticlePage():this.container=this.createToolbox(),document.body.appendChild(this.container),await mc(0),this.ctx.preferences.get("toolboxAlwaysShow").then(e=>{e&&(this.container.querySelector("#toolbox-toggle")?.classList.add("opened"),this.container.querySelectorAll(".btn-group").forEach(r=>{r.classList.add("opened")}))})}stop(){this.container?.remove()}createToolbox(){const r=O("div",{id:"ipe-edit-toolbox",children:[O("ul",{className:"btn-group group1",style:{display:"flex",flexDirection:"column"}}),O("ul",{className:"btn-group group2",style:{display:"flex",flexDirection:"row"}}),O("button",{className:"ipe-toolbox-btn",id:"toolbox-toggle",onClick:function(n){const i=this.classList.contains("opened");this.classList.toggle("opened",!i),r.querySelectorAll(".btn-group").forEach(s=>{s.classList.toggle("opened",!i)})},children:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M12 5l0 14"}),O("path",{d:"M5 12l14 0"})]})})]});return r}createIndicatorForNotArticlePage(){return O("div",{id:"ipe-edit-toolbox",children:O("div",{id:"ipe-toolbox-placeholder",style:"width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #3f51b5; color: #fff; pointer-events: none;",children:O("svg",{style:"width: 0.5em; height: 0.5em; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M5 12l5 5l10 -10"})]})})})}normalizeButtonId(e){return e||(e=Math.random().toString(36).substring(2,8)),`ipe-toolbox__${e.trim()}`.replace(/\s\.#/g,"-")}addButton(e){let{id:r,group:n,icon:i,tooltip:s,buttonProps:o,onClick:a,index:c}=e;r=this.normalizeButtonId(r);const u=this.container.querySelector(`#${r}`);u&&(this.ctx.logger("toolbox").warn(`Button with id ${r} already exists, replacing it.`),u.remove());let l=null;if(typeof n>"u"||n==="auto"){const v=this.container.querySelector(".btn-group.group1"),y=this.container.querySelector(".btn-group.group2"),b=v?.children.length||0,T=y?.children.length||0;l=b<=T?v:y}else l=this.container.querySelector(`.btn-group.${n}`);if(!l)throw new Error(`Button group ${n} not found`);const f=O("li",{class:"btn-tip-group",id:r,onClick:a,children:[O("div",{class:"btn-tip",children:s}),O("button",{id:`${r}-btn`,class:"ipe-toolbox-btn",...o,children:i})]});return typeof c=="number"?c<=0?l.prepend(f):c>=l.children.length?l.appendChild(f):l.children[c]?.before(f):l.appendChild(f),this.ctx.emit("toolbox/button/added",{ctx:this.ctx,button:f}),f}removeButton(e){this.container.querySelector(`.ipe-toolbox-btn#${e}`)?.remove(),this.ctx.emit("toolbox/button/removed",{ctx:this.ctx,id:e})}}bo=km(dl),ki=Rm(bo,0,"PluginToolbox",fl,ki),Tm(bo,1,ki);const Nm=Object.freeze(Object.defineProperty({__proto__:null,get PluginToolbox(){return ki}},Symbol.toStringTag,{value:"Module"}));/**
67
67
  * @vue/shared v3.5.21
68
68
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
69
69
  * @license MIT
70
- **/function bo(t){const e=Object.create(null);for(const r of t.split(","))e[r]=1;return r=>r in e}const be={},Mr=[],$t=()=>{},fl=()=>!1,ki=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),_o=t=>t.startsWith("onUpdate:"),Ke=Object.assign,wo=(t,e)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)},_m=Object.prototype.hasOwnProperty,xe=(t,e)=>_m.call(t,e),ae=Array.isArray,Fr=t=>Ii(t)==="[object Map]",dl=t=>Ii(t)==="[object Set]",ce=t=>typeof t=="function",De=t=>typeof t=="string",tr=t=>typeof t=="symbol",Ie=t=>t!==null&&typeof t=="object",hl=t=>(Ie(t)||ce(t))&&ce(t.then)&&ce(t.catch),pl=Object.prototype.toString,Ii=t=>pl.call(t),wm=t=>Ii(t).slice(8,-1),ml=t=>Ii(t)==="[object Object]",xo=t=>De(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,_n=bo(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ai=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},xm=/-\w/g,zt=Ai(t=>t.replace(xm,e=>e.slice(1).toUpperCase())),Sm=/\B([A-Z])/g,rr=Ai(t=>t.replace(Sm,"-$1").toLowerCase()),gl=Ai(t=>t.charAt(0).toUpperCase()+t.slice(1)),So=Ai(t=>t?`on${gl(t)}`:""),at=(t,e)=>!Object.is(t,e),Eo=(t,...e)=>{for(let r=0;r<t.length;r++)t[r](...e)},yl=(t,e,r,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:r})},Em=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let vl;const Ti=()=>vl||(vl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Oo(t){if(ae(t)){const e={};for(let r=0;r<t.length;r++){const n=t[r],i=De(n)?$m(n):Oo(n);if(i)for(const s in i)e[s]=i[s]}return e}else if(De(t)||Ie(t))return t}const Om=/;(?![^(]*\))/g,Cm=/:([^]+)/,Pm=/\/\*[^]*?\*\//g;function $m(t){const e={};return t.replace(Pm,"").split(Om).forEach(r=>{if(r){const n=r.split(Cm);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function Ri(t){let e="";if(De(t))e=t;else if(ae(t))for(let r=0;r<t.length;r++){const n=Ri(t[r]);n&&(e+=n+" ")}else if(Ie(t))for(const r in t)t[r]&&(e+=r+" ");return e.trim()}const km=bo("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function bl(t){return!!t||t===""}const _l=t=>!!(t&&t.__v_isRef===!0),Di=t=>De(t)?t:t==null?"":ae(t)||Ie(t)&&(t.toString===pl||!ce(t.toString))?_l(t)?Di(t.value):JSON.stringify(t,wl,2):String(t),wl=(t,e)=>_l(e)?wl(t,e.value):Fr(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((r,[n,i],s)=>(r[Co(n,s)+" =>"]=i,r),{})}:dl(e)?{[`Set(${e.size})`]:[...e.values()].map(r=>Co(r))}:tr(e)?Co(e):Ie(e)&&!ae(e)&&!ml(e)?String(e):e,Co=(t,e="")=>{var r;return tr(t)?`Symbol(${(r=t.description)!=null?r:e})`:t};/**
70
+ **/function _o(t){const e=Object.create(null);for(const r of t.split(","))e[r]=1;return r=>r in e}const be={},Mr=[],$t=()=>{},hl=()=>!1,$i=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),wo=t=>t.startsWith("onUpdate:"),Je=Object.assign,xo=(t,e)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)},Dm=Object.prototype.hasOwnProperty,xe=(t,e)=>Dm.call(t,e),ae=Array.isArray,jr=t=>Ii(t)==="[object Map]",pl=t=>Ii(t)==="[object Set]",ce=t=>typeof t=="function",De=t=>typeof t=="string",rr=t=>typeof t=="symbol",Ie=t=>t!==null&&typeof t=="object",ml=t=>(Ie(t)||ce(t))&&ce(t.then)&&ce(t.catch),gl=Object.prototype.toString,Ii=t=>gl.call(t),Lm=t=>Ii(t).slice(8,-1),yl=t=>Ii(t)==="[object Object]",So=t=>De(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,_n=_o(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ai=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},Mm=/-\w/g,Vt=Ai(t=>t.replace(Mm,e=>e.slice(1).toUpperCase())),jm=/\B([A-Z])/g,nr=Ai(t=>t.replace(jm,"-$1").toLowerCase()),vl=Ai(t=>t.charAt(0).toUpperCase()+t.slice(1)),Eo=Ai(t=>t?`on${vl(t)}`:""),ct=(t,e)=>!Object.is(t,e),Oo=(t,...e)=>{for(let r=0;r<t.length;r++)t[r](...e)},bl=(t,e,r,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:r})},Fm=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let _l;const Ti=()=>_l||(_l=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Po(t){if(ae(t)){const e={};for(let r=0;r<t.length;r++){const n=t[r],i=De(n)?qm(n):Po(n);if(i)for(const s in i)e[s]=i[s]}return e}else if(De(t)||Ie(t))return t}const Bm=/;(?![^(]*\))/g,Um=/:([^]+)/,Wm=/\/\*[^]*?\*\//g;function qm(t){const e={};return t.replace(Wm,"").split(Bm).forEach(r=>{if(r){const n=r.split(Um);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function Ri(t){let e="";if(De(t))e=t;else if(ae(t))for(let r=0;r<t.length;r++){const n=Ri(t[r]);n&&(e+=n+" ")}else if(Ie(t))for(const r in t)t[r]&&(e+=r+" ");return e.trim()}const Hm=_o("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function wl(t){return!!t||t===""}const xl=t=>!!(t&&t.__v_isRef===!0),Ni=t=>De(t)?t:t==null?"":ae(t)||Ie(t)&&(t.toString===gl||!ce(t.toString))?xl(t)?Ni(t.value):JSON.stringify(t,Sl,2):String(t),Sl=(t,e)=>xl(e)?Sl(t,e.value):jr(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((r,[n,i],s)=>(r[Co(n,s)+" =>"]=i,r),{})}:pl(e)?{[`Set(${e.size})`]:[...e.values()].map(r=>Co(r))}:rr(e)?Co(e):Ie(e)&&!ae(e)&&!yl(e)?String(e):e,Co=(t,e="")=>{var r;return rr(t)?`Symbol(${(r=t.description)!=null?r:e})`:t};/**
71
71
  * @vue/reactivity v3.5.21
72
72
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
73
73
  * @license MIT
74
- **/let ct;class Im{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ct,!e&&ct&&(this.index=(ct.scopes||(ct.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e<r;e++)this.scopes[e].pause();for(e=0,r=this.effects.length;e<r;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e<r;e++)this.scopes[e].resume();for(e=0,r=this.effects.length;e<r;e++)this.effects[e].resume()}}run(e){if(this._active){const r=ct;try{return ct=this,e()}finally{ct=r}}}on(){++this._on===1&&(this.prevScope=ct,ct=this)}off(){this._on>0&&--this._on===0&&(ct=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(this.effects.length=0,r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.cleanups.length=0,this.scopes){for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Am(){return ct}let $e;const Po=new WeakSet;class xl{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ct&&ct.active&&ct.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Po.has(this)&&(Po.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||El(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,kl(this),Ol(this);const e=$e,r=xt;$e=this,xt=!0;try{return this.fn()}finally{Cl(this),$e=e,xt=r,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ao(e);this.deps=this.depsTail=void 0,kl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Po.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Io(this)&&this.run()}get dirty(){return Io(this)}}let Sl=0,wn,xn;function El(t,e=!1){if(t.flags|=8,e){t.next=xn,xn=t;return}t.next=wn,wn=t}function $o(){Sl++}function ko(){if(--Sl>0)return;if(xn){let e=xn;for(xn=void 0;e;){const r=e.next;e.next=void 0,e.flags&=-9,e=r}}let t;for(;wn;){let e=wn;for(wn=void 0;e;){const r=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){t||(t=n)}e=r}}if(t)throw t}function Ol(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Cl(t){let e,r=t.depsTail,n=r;for(;n;){const i=n.prevDep;n.version===-1?(n===r&&(r=i),Ao(n),Tm(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}t.deps=e,t.depsTail=r}function Io(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Pl(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Pl(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Sn)||(t.globalVersion=Sn,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Io(t))))return;t.flags|=2;const e=t.dep,r=$e,n=xt;$e=t,xt=!0;try{Ol(t);const i=t.fn(t._value);(e.version===0||at(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(i){throw e.version++,i}finally{$e=r,xt=n,Cl(t),t.flags&=-3}}function Ao(t,e=!1){const{dep:r,prevSub:n,nextSub:i}=t;if(n&&(n.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=n,t.nextSub=void 0),r.subs===t&&(r.subs=n,!n&&r.computed)){r.computed.flags&=-5;for(let s=r.computed.deps;s;s=s.nextDep)Ao(s,!0)}!e&&!--r.sc&&r.map&&r.map.delete(r.key)}function Tm(t){const{prevDep:e,nextDep:r}=t;e&&(e.nextDep=r,t.prevDep=void 0),r&&(r.prevDep=e,t.nextDep=void 0)}let xt=!0;const $l=[];function kt(){$l.push(xt),xt=!1}function It(){const t=$l.pop();xt=t===void 0?!0:t}function kl(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const r=$e;$e=void 0;try{e()}finally{$e=r}}}let Sn=0;class Rm{constructor(e,r){this.sub=e,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ni{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!$e||!xt||$e===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==$e)r=this.activeLink=new Rm($e,this),$e.deps?(r.prevDep=$e.depsTail,$e.depsTail.nextDep=r,$e.depsTail=r):$e.deps=$e.depsTail=r,Il(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const n=r.nextDep;n.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=n),r.prevDep=$e.depsTail,r.nextDep=void 0,$e.depsTail.nextDep=r,$e.depsTail=r,$e.deps===r&&($e.deps=n)}return r}trigger(e){this.version++,Sn++,this.notify(e)}notify(e){$o();try{for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{ko()}}}function Il(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let n=e.deps;n;n=n.nextDep)Il(n)}const r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}const To=new WeakMap,yr=Symbol(""),Ro=Symbol(""),En=Symbol("");function Ye(t,e,r){if(xt&&$e){let n=To.get(t);n||To.set(t,n=new Map);let i=n.get(r);i||(n.set(r,i=new Ni),i.map=n,i.key=r),i.track()}}function Vt(t,e,r,n,i,s){const o=To.get(t);if(!o){Sn++;return}const a=c=>{c&&c.trigger()};if($o(),e==="clear")o.forEach(a);else{const c=ae(t),l=c&&xo(r);if(c&&r==="length"){const u=Number(n);o.forEach((f,v)=>{(v==="length"||v===En||!tr(v)&&v>=u)&&a(f)})}else switch((r!==void 0||o.has(void 0))&&a(o.get(r)),l&&a(o.get(En)),e){case"add":c?l&&a(o.get("length")):(a(o.get(yr)),Fr(t)&&a(o.get(Ro)));break;case"delete":c||(a(o.get(yr)),Fr(t)&&a(o.get(Ro)));break;case"set":Fr(t)&&a(o.get(yr));break}}ko()}function jr(t){const e=ye(t);return e===t?e:(Ye(e,"iterate",En),yt(t)?e:e.map(Je))}function Li(t){return Ye(t=ye(t),"iterate",En),t}const Dm={__proto__:null,[Symbol.iterator](){return Do(this,Symbol.iterator,Je)},concat(...t){return jr(this).concat(...t.map(e=>ae(e)?jr(e):e))},entries(){return Do(this,"entries",t=>(t[1]=Je(t[1]),t))},every(t,e){return Kt(this,"every",t,e,void 0,arguments)},filter(t,e){return Kt(this,"filter",t,e,r=>r.map(Je),arguments)},find(t,e){return Kt(this,"find",t,e,Je,arguments)},findIndex(t,e){return Kt(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Kt(this,"findLast",t,e,Je,arguments)},findLastIndex(t,e){return Kt(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Kt(this,"forEach",t,e,void 0,arguments)},includes(...t){return No(this,"includes",t)},indexOf(...t){return No(this,"indexOf",t)},join(t){return jr(this).join(t)},lastIndexOf(...t){return No(this,"lastIndexOf",t)},map(t,e){return Kt(this,"map",t,e,void 0,arguments)},pop(){return On(this,"pop")},push(...t){return On(this,"push",t)},reduce(t,...e){return Al(this,"reduce",t,e)},reduceRight(t,...e){return Al(this,"reduceRight",t,e)},shift(){return On(this,"shift")},some(t,e){return Kt(this,"some",t,e,void 0,arguments)},splice(...t){return On(this,"splice",t)},toReversed(){return jr(this).toReversed()},toSorted(t){return jr(this).toSorted(t)},toSpliced(...t){return jr(this).toSpliced(...t)},unshift(...t){return On(this,"unshift",t)},values(){return Do(this,"values",Je)}};function Do(t,e,r){const n=Li(t),i=n[e]();return n!==t&&!yt(t)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.value&&(s.value=r(s.value)),s}),i}const Nm=Array.prototype;function Kt(t,e,r,n,i,s){const o=Li(t),a=o!==t&&!yt(t),c=o[e];if(c!==Nm[e]){const f=c.apply(t,s);return a?Je(f):f}let l=r;o!==t&&(a?l=function(f,v){return r.call(this,Je(f),v,t)}:r.length>2&&(l=function(f,v){return r.call(this,f,v,t)}));const u=c.call(o,l,n);return a&&i?i(u):u}function Al(t,e,r,n){const i=Li(t);let s=r;return i!==t&&(yt(t)?r.length>3&&(s=function(o,a,c){return r.call(this,o,a,c,t)}):s=function(o,a,c){return r.call(this,o,Je(a),c,t)}),i[e](s,...n)}function No(t,e,r){const n=ye(t);Ye(n,"iterate",En);const i=n[e](...r);return(i===-1||i===!1)&&Fo(r[0])?(r[0]=ye(r[0]),n[e](...r)):i}function On(t,e,r=[]){kt(),$o();const n=ye(t)[e].apply(t,r);return ko(),It(),n}const Lm=bo("__proto__,__v_isRef,__isVue"),Tl=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(tr));function Mm(t){tr(t)||(t=String(t));const e=ye(this);return Ye(e,"has",t),e.hasOwnProperty(t)}class Rl{constructor(e=!1,r=!1){this._isReadonly=e,this._isShallow=r}get(e,r,n){if(r==="__v_skip")return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if(r==="__v_isReactive")return!i;if(r==="__v_isReadonly")return i;if(r==="__v_isShallow")return s;if(r==="__v_raw")return n===(i?s?jl:Fl:s?Ml:Ll).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=ae(e);if(!i){let c;if(o&&(c=Dm[r]))return c;if(r==="hasOwnProperty")return Mm}const a=Reflect.get(e,r,ze(e)?e:n);return(tr(r)?Tl.has(r):Lm(r))||(i||Ye(e,"get",r),s)?a:ze(a)?o&&xo(r)?a:a.value:Ie(a)?i?Bl(a):Mo(a):a}}class Dl extends Rl{constructor(e=!1){super(!1,e)}set(e,r,n,i){let s=e[r];if(!this._isShallow){const c=nr(s);if(!yt(n)&&!nr(n)&&(s=ye(s),n=ye(n)),!ae(e)&&ze(s)&&!ze(n))return c||(s.value=n),!0}const o=ae(e)&&xo(r)?Number(r)<e.length:xe(e,r),a=Reflect.set(e,r,n,ze(e)?e:i);return e===ye(i)&&(o?at(n,s)&&Vt(e,"set",r,n):Vt(e,"add",r,n)),a}deleteProperty(e,r){const n=xe(e,r);e[r];const i=Reflect.deleteProperty(e,r);return i&&n&&Vt(e,"delete",r,void 0),i}has(e,r){const n=Reflect.has(e,r);return(!tr(r)||!Tl.has(r))&&Ye(e,"has",r),n}ownKeys(e){return Ye(e,"iterate",ae(e)?"length":yr),Reflect.ownKeys(e)}}class Nl extends Rl{constructor(e=!1){super(!0,e)}set(e,r){return!0}deleteProperty(e,r){return!0}}const Fm=new Dl,jm=new Nl,Bm=new Dl(!0),Um=new Nl(!0),Lo=t=>t,Mi=t=>Reflect.getPrototypeOf(t);function Wm(t,e,r){return function(...n){const i=this.__v_raw,s=ye(i),o=Fr(s),a=t==="entries"||t===Symbol.iterator&&o,c=t==="keys"&&o,l=i[t](...n),u=r?Lo:e?Ui:Je;return!e&&Ye(s,"iterate",c?Ro:yr),{next(){const{value:f,done:v}=l.next();return v?{value:f,done:v}:{value:a?[u(f[0]),u(f[1])]:u(f),done:v}},[Symbol.iterator](){return this}}}}function Fi(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function qm(t,e){const r={get(i){const s=this.__v_raw,o=ye(s),a=ye(i);t||(at(i,a)&&Ye(o,"get",i),Ye(o,"get",a));const{has:c}=Mi(o),l=e?Lo:t?Ui:Je;if(c.call(o,i))return l(s.get(i));if(c.call(o,a))return l(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!t&&Ye(ye(i),"iterate",yr),i.size},has(i){const s=this.__v_raw,o=ye(s),a=ye(i);return t||(at(i,a)&&Ye(o,"has",i),Ye(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,c=ye(a),l=e?Lo:t?Ui:Je;return!t&&Ye(c,"iterate",yr),a.forEach((u,f)=>i.call(s,l(u),l(f),o))}};return Ke(r,t?{add:Fi("add"),set:Fi("set"),delete:Fi("delete"),clear:Fi("clear")}:{add(i){!e&&!yt(i)&&!nr(i)&&(i=ye(i));const s=ye(this);return Mi(s).has.call(s,i)||(s.add(i),Vt(s,"add",i,i)),this},set(i,s){!e&&!yt(s)&&!nr(s)&&(s=ye(s));const o=ye(this),{has:a,get:c}=Mi(o);let l=a.call(o,i);l||(i=ye(i),l=a.call(o,i));const u=c.call(o,i);return o.set(i,s),l?at(s,u)&&Vt(o,"set",i,s):Vt(o,"add",i,s),this},delete(i){const s=ye(this),{has:o,get:a}=Mi(s);let c=o.call(s,i);c||(i=ye(i),c=o.call(s,i)),a&&a.call(s,i);const l=s.delete(i);return c&&Vt(s,"delete",i,void 0),l},clear(){const i=ye(this),s=i.size!==0,o=i.clear();return s&&Vt(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{r[i]=Wm(i,t,e)}),r}function ji(t,e){const r=qm(t,e);return(n,i,s)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?n:Reflect.get(xe(r,i)&&i in n?r:n,i,s)}const Hm={get:ji(!1,!1)},zm={get:ji(!1,!0)},Vm={get:ji(!0,!1)},Km={get:ji(!0,!0)},Ll=new WeakMap,Ml=new WeakMap,Fl=new WeakMap,jl=new WeakMap;function Jm(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ym(t){return t.__v_skip||!Object.isExtensible(t)?0:Jm(wm(t))}function Mo(t){return nr(t)?t:Bi(t,!1,Fm,Hm,Ll)}function Gm(t){return Bi(t,!1,Bm,zm,Ml)}function Bl(t){return Bi(t,!0,jm,Vm,Fl)}function tb(t){return Bi(t,!0,Um,Km,jl)}function Bi(t,e,r,n,i){if(!Ie(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=Ym(t);if(s===0)return t;const o=i.get(t);if(o)return o;const a=new Proxy(t,s===2?n:r);return i.set(t,a),a}function Br(t){return nr(t)?Br(t.__v_raw):!!(t&&t.__v_isReactive)}function nr(t){return!!(t&&t.__v_isReadonly)}function yt(t){return!!(t&&t.__v_isShallow)}function Fo(t){return t?!!t.__v_raw:!1}function ye(t){const e=t&&t.__v_raw;return e?ye(e):t}function Qm(t){return!xe(t,"__v_skip")&&Object.isExtensible(t)&&yl(t,"__v_skip",!0),t}const Je=t=>Ie(t)?Mo(t):t,Ui=t=>Ie(t)?Bl(t):t;function ze(t){return t?t.__v_isRef===!0:!1}function Wi(t){return Ul(t,!1)}function Xm(t){return Ul(t,!0)}function Ul(t,e){return ze(t)?t:new Zm(t,e)}class Zm{constructor(e,r){this.dep=new Ni,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?e:ye(e),this._value=r?e:Je(e),this.__v_isShallow=r}get value(){return this.dep.track(),this._value}set value(e){const r=this._rawValue,n=this.__v_isShallow||yt(e)||nr(e);e=n?e:ye(e),at(e,r)&&(this._rawValue=e,this._value=n?e:Je(e),this.dep.trigger())}}function eg(t){return ze(t)?t.value:t}const tg={get:(t,e,r)=>e==="__v_raw"?t:eg(Reflect.get(t,e,r)),set:(t,e,r,n)=>{const i=t[e];return ze(i)&&!ze(r)?(i.value=r,!0):Reflect.set(t,e,r,n)}};function Wl(t){return Br(t)?t:new Proxy(t,tg)}class rg{constructor(e){this.__v_isRef=!0,this._value=void 0;const r=this.dep=new Ni,{get:n,set:i}=e(r.track.bind(r),r.trigger.bind(r));this._get=n,this._set=i}get value(){return this._value=this._get()}set value(e){this._set(e)}}function ng(t){return new rg(t)}class ig{constructor(e,r,n){this.fn=e,this.setter=r,this._value=void 0,this.dep=new Ni(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Sn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&$e!==this)return El(this,!0),!0}get value(){const e=this.dep.track();return Pl(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function sg(t,e,r=!1){let n,i;return ce(t)?n=t:(n=t.get,i=t.set),new ig(n,i,r)}const qi={},Hi=new WeakMap;let vr;function og(t,e=!1,r=vr){if(r){let n=Hi.get(r);n||Hi.set(r,n=[]),n.push(t)}}function ag(t,e,r=be){const{immediate:n,deep:i,once:s,scheduler:o,augmentJob:a,call:c}=r,l=m=>i?m:yt(m)||i===!1||i===0?Jt(m,1):Jt(m);let u,f,v,y,b=!1,R=!1;if(ze(t)?(f=()=>t.value,b=yt(t)):Br(t)?(f=()=>l(t),b=!0):ae(t)?(R=!0,b=t.some(m=>Br(m)||yt(m)),f=()=>t.map(m=>{if(ze(m))return m.value;if(Br(m))return l(m);if(ce(m))return c?c(m,2):m()})):ce(t)?e?f=c?()=>c(t,2):t:f=()=>{if(v){kt();try{v()}finally{It()}}const m=vr;vr=u;try{return c?c(t,3,[y]):t(y)}finally{vr=m}}:f=$t,e&&i){const m=f,h=i===!0?1/0:i;f=()=>Jt(m(),h)}const H=Am(),B=()=>{u.stop(),H&&H.active&&wo(H.effects,u)};if(s&&e){const m=e;e=(...h)=>{m(...h),B()}}let N=R?new Array(t.length).fill(qi):qi;const g=m=>{if(!(!(u.flags&1)||!u.dirty&&!m))if(e){const h=u.run();if(i||b||(R?h.some((C,I)=>at(C,N[I])):at(h,N))){v&&v();const C=vr;vr=u;try{const I=[h,N===qi?void 0:R&&N[0]===qi?[]:N,y];N=h,c?c(e,3,I):e(...I)}finally{vr=C}}}else u.run()};return a&&a(g),u=new xl(f),u.scheduler=o?()=>o(g,!1):g,y=m=>og(m,!1,u),v=u.onStop=()=>{const m=Hi.get(u);if(m){if(c)c(m,4);else for(const h of m)h();Hi.delete(u)}},e?n?g(!0):N=u.run():o?o(g.bind(null,!0),!0):u.run(),B.pause=u.pause.bind(u),B.resume=u.resume.bind(u),B.stop=B,B}function Jt(t,e=1/0,r){if(e<=0||!Ie(t)||t.__v_skip||(r=r||new Map,(r.get(t)||0)>=e))return t;if(r.set(t,e),e--,ze(t))Jt(t.value,e,r);else if(ae(t))for(let n=0;n<t.length;n++)Jt(t[n],e,r);else if(dl(t)||Fr(t))t.forEach(n=>{Jt(n,e,r)});else if(ml(t)){for(const n in t)Jt(t[n],e,r);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Jt(t[n],e,r)}return t}/**
74
+ **/let lt;class zm{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=lt,!e&&lt&&(this.index=(lt.scopes||(lt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e<r;e++)this.scopes[e].pause();for(e=0,r=this.effects.length;e<r;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e<r;e++)this.scopes[e].resume();for(e=0,r=this.effects.length;e<r;e++)this.effects[e].resume()}}run(e){if(this._active){const r=lt;try{return lt=this,e()}finally{lt=r}}}on(){++this._on===1&&(this.prevScope=lt,lt=this)}off(){this._on>0&&--this._on===0&&(lt=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(this.effects.length=0,r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.cleanups.length=0,this.scopes){for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Vm(){return lt}let Ce;const ko=new WeakSet;class El{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,lt&&lt.active&&lt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ko.has(this)&&(ko.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Pl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Al(this),Cl(this);const e=Ce,r=St;Ce=this,St=!0;try{return this.fn()}finally{kl(this),Ce=e,St=r,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)To(e);this.deps=this.depsTail=void 0,Al(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ko.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ao(this)&&this.run()}get dirty(){return Ao(this)}}let Ol=0,wn,xn;function Pl(t,e=!1){if(t.flags|=8,e){t.next=xn,xn=t;return}t.next=wn,wn=t}function $o(){Ol++}function Io(){if(--Ol>0)return;if(xn){let e=xn;for(xn=void 0;e;){const r=e.next;e.next=void 0,e.flags&=-9,e=r}}let t;for(;wn;){let e=wn;for(wn=void 0;e;){const r=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){t||(t=n)}e=r}}if(t)throw t}function Cl(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function kl(t){let e,r=t.depsTail,n=r;for(;n;){const i=n.prevDep;n.version===-1?(n===r&&(r=i),To(n),Km(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}t.deps=e,t.depsTail=r}function Ao(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&($l(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function $l(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Sn)||(t.globalVersion=Sn,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Ao(t))))return;t.flags|=2;const e=t.dep,r=Ce,n=St;Ce=t,St=!0;try{Cl(t);const i=t.fn(t._value);(e.version===0||ct(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(i){throw e.version++,i}finally{Ce=r,St=n,kl(t),t.flags&=-3}}function To(t,e=!1){const{dep:r,prevSub:n,nextSub:i}=t;if(n&&(n.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=n,t.nextSub=void 0),r.subs===t&&(r.subs=n,!n&&r.computed)){r.computed.flags&=-5;for(let s=r.computed.deps;s;s=s.nextDep)To(s,!0)}!e&&!--r.sc&&r.map&&r.map.delete(r.key)}function Km(t){const{prevDep:e,nextDep:r}=t;e&&(e.nextDep=r,t.prevDep=void 0),r&&(r.prevDep=e,t.nextDep=void 0)}let St=!0;const Il=[];function It(){Il.push(St),St=!1}function At(){const t=Il.pop();St=t===void 0?!0:t}function Al(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const r=Ce;Ce=void 0;try{e()}finally{Ce=r}}}let Sn=0;class Jm{constructor(e,r){this.sub=e,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Di{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Ce||!St||Ce===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==Ce)r=this.activeLink=new Jm(Ce,this),Ce.deps?(r.prevDep=Ce.depsTail,Ce.depsTail.nextDep=r,Ce.depsTail=r):Ce.deps=Ce.depsTail=r,Tl(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const n=r.nextDep;n.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=n),r.prevDep=Ce.depsTail,r.nextDep=void 0,Ce.depsTail.nextDep=r,Ce.depsTail=r,Ce.deps===r&&(Ce.deps=n)}return r}trigger(e){this.version++,Sn++,this.notify(e)}notify(e){$o();try{for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{Io()}}}function Tl(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let n=e.deps;n;n=n.nextDep)Tl(n)}const r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}const Ro=new WeakMap,vr=Symbol(""),No=Symbol(""),En=Symbol("");function Ge(t,e,r){if(St&&Ce){let n=Ro.get(t);n||Ro.set(t,n=new Map);let i=n.get(r);i||(n.set(r,i=new Di),i.map=n,i.key=r),i.track()}}function Kt(t,e,r,n,i,s){const o=Ro.get(t);if(!o){Sn++;return}const a=c=>{c&&c.trigger()};if($o(),e==="clear")o.forEach(a);else{const c=ae(t),u=c&&So(r);if(c&&r==="length"){const l=Number(n);o.forEach((f,v)=>{(v==="length"||v===En||!rr(v)&&v>=l)&&a(f)})}else switch((r!==void 0||o.has(void 0))&&a(o.get(r)),u&&a(o.get(En)),e){case"add":c?u&&a(o.get("length")):(a(o.get(vr)),jr(t)&&a(o.get(No)));break;case"delete":c||(a(o.get(vr)),jr(t)&&a(o.get(No)));break;case"set":jr(t)&&a(o.get(vr));break}}Io()}function Fr(t){const e=ye(t);return e===t?e:(Ge(e,"iterate",En),vt(t)?e:e.map(Ye))}function Li(t){return Ge(t=ye(t),"iterate",En),t}const Ym={__proto__:null,[Symbol.iterator](){return Do(this,Symbol.iterator,Ye)},concat(...t){return Fr(this).concat(...t.map(e=>ae(e)?Fr(e):e))},entries(){return Do(this,"entries",t=>(t[1]=Ye(t[1]),t))},every(t,e){return Jt(this,"every",t,e,void 0,arguments)},filter(t,e){return Jt(this,"filter",t,e,r=>r.map(Ye),arguments)},find(t,e){return Jt(this,"find",t,e,Ye,arguments)},findIndex(t,e){return Jt(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Jt(this,"findLast",t,e,Ye,arguments)},findLastIndex(t,e){return Jt(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Jt(this,"forEach",t,e,void 0,arguments)},includes(...t){return Lo(this,"includes",t)},indexOf(...t){return Lo(this,"indexOf",t)},join(t){return Fr(this).join(t)},lastIndexOf(...t){return Lo(this,"lastIndexOf",t)},map(t,e){return Jt(this,"map",t,e,void 0,arguments)},pop(){return On(this,"pop")},push(...t){return On(this,"push",t)},reduce(t,...e){return Rl(this,"reduce",t,e)},reduceRight(t,...e){return Rl(this,"reduceRight",t,e)},shift(){return On(this,"shift")},some(t,e){return Jt(this,"some",t,e,void 0,arguments)},splice(...t){return On(this,"splice",t)},toReversed(){return Fr(this).toReversed()},toSorted(t){return Fr(this).toSorted(t)},toSpliced(...t){return Fr(this).toSpliced(...t)},unshift(...t){return On(this,"unshift",t)},values(){return Do(this,"values",Ye)}};function Do(t,e,r){const n=Li(t),i=n[e]();return n!==t&&!vt(t)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.value&&(s.value=r(s.value)),s}),i}const Gm=Array.prototype;function Jt(t,e,r,n,i,s){const o=Li(t),a=o!==t&&!vt(t),c=o[e];if(c!==Gm[e]){const f=c.apply(t,s);return a?Ye(f):f}let u=r;o!==t&&(a?u=function(f,v){return r.call(this,Ye(f),v,t)}:r.length>2&&(u=function(f,v){return r.call(this,f,v,t)}));const l=c.call(o,u,n);return a&&i?i(l):l}function Rl(t,e,r,n){const i=Li(t);let s=r;return i!==t&&(vt(t)?r.length>3&&(s=function(o,a,c){return r.call(this,o,a,c,t)}):s=function(o,a,c){return r.call(this,o,Ye(a),c,t)}),i[e](s,...n)}function Lo(t,e,r){const n=ye(t);Ge(n,"iterate",En);const i=n[e](...r);return(i===-1||i===!1)&&Fo(r[0])?(r[0]=ye(r[0]),n[e](...r)):i}function On(t,e,r=[]){It(),$o();const n=ye(t)[e].apply(t,r);return Io(),At(),n}const Qm=_o("__proto__,__v_isRef,__isVue"),Nl=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(rr));function Xm(t){rr(t)||(t=String(t));const e=ye(this);return Ge(e,"has",t),e.hasOwnProperty(t)}class Dl{constructor(e=!1,r=!1){this._isReadonly=e,this._isShallow=r}get(e,r,n){if(r==="__v_skip")return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if(r==="__v_isReactive")return!i;if(r==="__v_isReadonly")return i;if(r==="__v_isShallow")return s;if(r==="__v_raw")return n===(i?s?Ul:Bl:s?Fl:jl).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=ae(e);if(!i){let c;if(o&&(c=Ym[r]))return c;if(r==="hasOwnProperty")return Xm}const a=Reflect.get(e,r,Ve(e)?e:n);return(rr(r)?Nl.has(r):Qm(r))||(i||Ge(e,"get",r),s)?a:Ve(a)?o&&So(r)?a:a.value:Ie(a)?i?Wl(a):jo(a):a}}class Ll extends Dl{constructor(e=!1){super(!1,e)}set(e,r,n,i){let s=e[r];if(!this._isShallow){const c=ir(s);if(!vt(n)&&!ir(n)&&(s=ye(s),n=ye(n)),!ae(e)&&Ve(s)&&!Ve(n))return c||(s.value=n),!0}const o=ae(e)&&So(r)?Number(r)<e.length:xe(e,r),a=Reflect.set(e,r,n,Ve(e)?e:i);return e===ye(i)&&(o?ct(n,s)&&Kt(e,"set",r,n):Kt(e,"add",r,n)),a}deleteProperty(e,r){const n=xe(e,r);e[r];const i=Reflect.deleteProperty(e,r);return i&&n&&Kt(e,"delete",r,void 0),i}has(e,r){const n=Reflect.has(e,r);return(!rr(r)||!Nl.has(r))&&Ge(e,"has",r),n}ownKeys(e){return Ge(e,"iterate",ae(e)?"length":vr),Reflect.ownKeys(e)}}class Ml extends Dl{constructor(e=!1){super(!0,e)}set(e,r){return!0}deleteProperty(e,r){return!0}}const Zm=new Ll,eg=new Ml,tg=new Ll(!0),rg=new Ml(!0),Mo=t=>t,Mi=t=>Reflect.getPrototypeOf(t);function ng(t,e,r){return function(...n){const i=this.__v_raw,s=ye(i),o=jr(s),a=t==="entries"||t===Symbol.iterator&&o,c=t==="keys"&&o,u=i[t](...n),l=r?Mo:e?Ui:Ye;return!e&&Ge(s,"iterate",c?No:vr),{next(){const{value:f,done:v}=u.next();return v?{value:f,done:v}:{value:a?[l(f[0]),l(f[1])]:l(f),done:v}},[Symbol.iterator](){return this}}}}function ji(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function ig(t,e){const r={get(i){const s=this.__v_raw,o=ye(s),a=ye(i);t||(ct(i,a)&&Ge(o,"get",i),Ge(o,"get",a));const{has:c}=Mi(o),u=e?Mo:t?Ui:Ye;if(c.call(o,i))return u(s.get(i));if(c.call(o,a))return u(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!t&&Ge(ye(i),"iterate",vr),i.size},has(i){const s=this.__v_raw,o=ye(s),a=ye(i);return t||(ct(i,a)&&Ge(o,"has",i),Ge(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,c=ye(a),u=e?Mo:t?Ui:Ye;return!t&&Ge(c,"iterate",vr),a.forEach((l,f)=>i.call(s,u(l),u(f),o))}};return Je(r,t?{add:ji("add"),set:ji("set"),delete:ji("delete"),clear:ji("clear")}:{add(i){!e&&!vt(i)&&!ir(i)&&(i=ye(i));const s=ye(this);return Mi(s).has.call(s,i)||(s.add(i),Kt(s,"add",i,i)),this},set(i,s){!e&&!vt(s)&&!ir(s)&&(s=ye(s));const o=ye(this),{has:a,get:c}=Mi(o);let u=a.call(o,i);u||(i=ye(i),u=a.call(o,i));const l=c.call(o,i);return o.set(i,s),u?ct(s,l)&&Kt(o,"set",i,s):Kt(o,"add",i,s),this},delete(i){const s=ye(this),{has:o,get:a}=Mi(s);let c=o.call(s,i);c||(i=ye(i),c=o.call(s,i)),a&&a.call(s,i);const u=s.delete(i);return c&&Kt(s,"delete",i,void 0),u},clear(){const i=ye(this),s=i.size!==0,o=i.clear();return s&&Kt(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{r[i]=ng(i,t,e)}),r}function Fi(t,e){const r=ig(t,e);return(n,i,s)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?n:Reflect.get(xe(r,i)&&i in n?r:n,i,s)}const sg={get:Fi(!1,!1)},og={get:Fi(!1,!0)},ag={get:Fi(!0,!1)},cg={get:Fi(!0,!0)},jl=new WeakMap,Fl=new WeakMap,Bl=new WeakMap,Ul=new WeakMap;function lg(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ug(t){return t.__v_skip||!Object.isExtensible(t)?0:lg(Lm(t))}function jo(t){return ir(t)?t:Bi(t,!1,Zm,sg,jl)}function fg(t){return Bi(t,!1,tg,og,Fl)}function Wl(t){return Bi(t,!0,eg,ag,Bl)}function ib(t){return Bi(t,!0,rg,cg,Ul)}function Bi(t,e,r,n,i){if(!Ie(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=ug(t);if(s===0)return t;const o=i.get(t);if(o)return o;const a=new Proxy(t,s===2?n:r);return i.set(t,a),a}function Br(t){return ir(t)?Br(t.__v_raw):!!(t&&t.__v_isReactive)}function ir(t){return!!(t&&t.__v_isReadonly)}function vt(t){return!!(t&&t.__v_isShallow)}function Fo(t){return t?!!t.__v_raw:!1}function ye(t){const e=t&&t.__v_raw;return e?ye(e):t}function dg(t){return!xe(t,"__v_skip")&&Object.isExtensible(t)&&bl(t,"__v_skip",!0),t}const Ye=t=>Ie(t)?jo(t):t,Ui=t=>Ie(t)?Wl(t):t;function Ve(t){return t?t.__v_isRef===!0:!1}function Wi(t){return ql(t,!1)}function hg(t){return ql(t,!0)}function ql(t,e){return Ve(t)?t:new pg(t,e)}class pg{constructor(e,r){this.dep=new Di,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?e:ye(e),this._value=r?e:Ye(e),this.__v_isShallow=r}get value(){return this.dep.track(),this._value}set value(e){const r=this._rawValue,n=this.__v_isShallow||vt(e)||ir(e);e=n?e:ye(e),ct(e,r)&&(this._rawValue=e,this._value=n?e:Ye(e),this.dep.trigger())}}function Hl(t){return Ve(t)?t.value:t}const mg={get:(t,e,r)=>e==="__v_raw"?t:Hl(Reflect.get(t,e,r)),set:(t,e,r,n)=>{const i=t[e];return Ve(i)&&!Ve(r)?(i.value=r,!0):Reflect.set(t,e,r,n)}};function zl(t){return Br(t)?t:new Proxy(t,mg)}class gg{constructor(e){this.__v_isRef=!0,this._value=void 0;const r=this.dep=new Di,{get:n,set:i}=e(r.track.bind(r),r.trigger.bind(r));this._get=n,this._set=i}get value(){return this._value=this._get()}set value(e){this._set(e)}}function yg(t){return new gg(t)}class vg{constructor(e,r,n){this.fn=e,this.setter=r,this._value=void 0,this.dep=new Di(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Sn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Ce!==this)return Pl(this,!0),!0}get value(){const e=this.dep.track();return $l(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function bg(t,e,r=!1){let n,i;return ce(t)?n=t:(n=t.get,i=t.set),new vg(n,i,r)}const qi={},Hi=new WeakMap;let br;function _g(t,e=!1,r=br){if(r){let n=Hi.get(r);n||Hi.set(r,n=[]),n.push(t)}}function wg(t,e,r=be){const{immediate:n,deep:i,once:s,scheduler:o,augmentJob:a,call:c}=r,u=p=>i?p:vt(p)||i===!1||i===0?Yt(p,1):Yt(p);let l,f,v,y,b=!1,T=!1;if(Ve(t)?(f=()=>t.value,b=vt(t)):Br(t)?(f=()=>u(t),b=!0):ae(t)?(T=!0,b=t.some(p=>Br(p)||vt(p)),f=()=>t.map(p=>{if(Ve(p))return p.value;if(Br(p))return u(p);if(ce(p))return c?c(p,2):p()})):ce(t)?e?f=c?()=>c(t,2):t:f=()=>{if(v){It();try{v()}finally{At()}}const p=br;br=l;try{return c?c(t,3,[y]):t(y)}finally{br=p}}:f=$t,e&&i){const p=f,h=i===!0?1/0:i;f=()=>Yt(p(),h)}const H=Vm(),B=()=>{l.stop(),H&&H.active&&xo(H.effects,l)};if(s&&e){const p=e;e=(...h)=>{p(...h),B()}}let R=T?new Array(t.length).fill(qi):qi;const m=p=>{if(!(!(l.flags&1)||!l.dirty&&!p))if(e){const h=l.run();if(i||b||(T?h.some((P,I)=>ct(P,R[I])):ct(h,R))){v&&v();const P=br;br=l;try{const I=[h,R===qi?void 0:T&&R[0]===qi?[]:R,y];R=h,c?c(e,3,I):e(...I)}finally{br=P}}}else l.run()};return a&&a(m),l=new El(f),l.scheduler=o?()=>o(m,!1):m,y=p=>_g(p,!1,l),v=l.onStop=()=>{const p=Hi.get(l);if(p){if(c)c(p,4);else for(const h of p)h();Hi.delete(l)}},e?n?m(!0):R=l.run():o?o(m.bind(null,!0),!0):l.run(),B.pause=l.pause.bind(l),B.resume=l.resume.bind(l),B.stop=B,B}function Yt(t,e=1/0,r){if(e<=0||!Ie(t)||t.__v_skip||(r=r||new Map,(r.get(t)||0)>=e))return t;if(r.set(t,e),e--,Ve(t))Yt(t.value,e,r);else if(ae(t))for(let n=0;n<t.length;n++)Yt(t[n],e,r);else if(pl(t)||jr(t))t.forEach(n=>{Yt(n,e,r)});else if(yl(t)){for(const n in t)Yt(t[n],e,r);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Yt(t[n],e,r)}return t}/**
75
75
  * @vue/runtime-core v3.5.21
76
76
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
77
77
  * @license MIT
78
- **/const Cn=[];let jo=!1;function rb(t,...e){if(jo)return;jo=!0,kt();const r=Cn.length?Cn[Cn.length-1].component:null,n=r&&r.appContext.config.warnHandler,i=cg();if(n)Ur(n,r,11,[t+e.map(s=>{var o,a;return(a=(o=s.toString)==null?void 0:o.call(s))!=null?a:JSON.stringify(s)}).join(""),r&&r.proxy,i.map(({vnode:s})=>`at <${Bu(r,s.type)}>`).join(`
78
+ **/const Pn=[];let Bo=!1;function sb(t,...e){if(Bo)return;Bo=!0,It();const r=Pn.length?Pn[Pn.length-1].component:null,n=r&&r.appContext.config.warnHandler,i=xg();if(n)Ur(n,r,11,[t+e.map(s=>{var o,a;return(a=(o=s.toString)==null?void 0:o.call(s))!=null?a:JSON.stringify(s)}).join(""),r&&r.proxy,i.map(({vnode:s})=>`at <${Hu(r,s.type)}>`).join(`
79
79
  `),i]);else{const s=[`[Vue warn]: ${t}`,...e];i.length&&s.push(`
80
- `,...lg(i)),console.warn(...s)}It(),jo=!1}function cg(){let t=Cn[Cn.length-1];if(!t)return[];const e=[];for(;t;){const r=e[0];r&&r.vnode===t?r.recurseCount++:e.push({vnode:t,recurseCount:0});const n=t.component&&t.component.parent;t=n&&n.vnode}return e}function lg(t){const e=[];return t.forEach((r,n)=>{e.push(...n===0?[]:[`
81
- `],...ug(r))}),e}function ug({vnode:t,recurseCount:e}){const r=e>0?`... (${e} recursive calls)`:"",n=t.component?t.component.parent==null:!1,i=` at <${Bu(t.component,t.type,n)}`,s=">"+r;return t.props?[i,...fg(t.props),s]:[i+s]}function fg(t){const e=[],r=Object.keys(t);return r.slice(0,3).forEach(n=>{e.push(...ql(n,t[n]))}),r.length>3&&e.push(" ..."),e}function ql(t,e,r){return De(e)?(e=JSON.stringify(e),r?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?r?e:[`${t}=${e}`]:ze(e)?(e=ql(t,ye(e.value),!0),r?e:[`${t}=Ref<`,e,">"]):ce(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=ye(e),r?e:[`${t}=`,e])}function Ur(t,e,r,n){try{return n?t(...n):t()}catch(i){zi(i,e,r)}}function At(t,e,r,n){if(ce(t)){const i=Ur(t,e,r,n);return i&&hl(i)&&i.catch(s=>{zi(s,e,r)}),i}if(ae(t)){const i=[];for(let s=0;s<t.length;s++)i.push(At(t[s],e,r,n));return i}}function zi(t,e,r,n=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||be;if(e){let a=e.parent;const c=e.proxy,l=`https://vuejs.org/error-reference/#runtime-${r}`;for(;a;){const u=a.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](t,c,l)===!1)return}a=a.parent}if(s){kt(),Ur(s,null,10,[t,c,l]),It();return}}dg(t,r,i,n,o)}function dg(t,e,r,n=!0,i=!1){if(i)throw t;console.error(t)}const Ze=[];let Tt=-1;const Wr=[];let ir=null,qr=0;const Hl=Promise.resolve();let Vi=null;function Ki(t){const e=Vi||Hl;return t?e.then(this?t.bind(this):t):e}function hg(t){let e=Tt+1,r=Ze.length;for(;e<r;){const n=e+r>>>1,i=Ze[n],s=Pn(i);s<t||s===t&&i.flags&2?e=n+1:r=n}return e}function Bo(t){if(!(t.flags&1)){const e=Pn(t),r=Ze[Ze.length-1];!r||!(t.flags&2)&&e>=Pn(r)?Ze.push(t):Ze.splice(hg(e),0,t),t.flags|=1,zl()}}function zl(){Vi||(Vi=Hl.then(Jl))}function pg(t){ae(t)?Wr.push(...t):ir&&t.id===-1?ir.splice(qr+1,0,t):t.flags&1||(Wr.push(t),t.flags|=1),zl()}function Vl(t,e,r=Tt+1){for(;r<Ze.length;r++){const n=Ze[r];if(n&&n.flags&2){if(t&&n.id!==t.uid)continue;Ze.splice(r,1),r--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Kl(t){if(Wr.length){const e=[...new Set(Wr)].sort((r,n)=>Pn(r)-Pn(n));if(Wr.length=0,ir){ir.push(...e);return}for(ir=e,qr=0;qr<ir.length;qr++){const r=ir[qr];r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2}ir=null,qr=0}}const Pn=t=>t.id==null?t.flags&2?-1:1/0:t.id;function Jl(t){try{for(Tt=0;Tt<Ze.length;Tt++){const e=Ze[Tt];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Ur(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Tt<Ze.length;Tt++){const e=Ze[Tt];e&&(e.flags&=-2)}Tt=-1,Ze.length=0,Kl(),Vi=null,(Ze.length||Wr.length)&&Jl()}}let vt=null,Yl=null;function Ji(t){const e=vt;return vt=t,Yl=t&&t.type.__scopeId||null,e}function mg(t,e=vt,r){if(!e||t._n)return t;const n=(...i)=>{n._d&&Au(-1);const s=Ji(e);let o;try{o=t(...i)}finally{Ji(s),n._d&&Au(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function gg(t,e){if(vt===null)return t;const r=is(vt),n=t.dirs||(t.dirs=[]);for(let i=0;i<e.length;i++){let[s,o,a,c=be]=e[i];s&&(ce(s)&&(s={mounted:s,updated:s}),s.deep&&Jt(o),n.push({dir:s,instance:r,value:o,oldValue:void 0,arg:a,modifiers:c}))}return t}function br(t,e,r,n){const i=t.dirs,s=e&&e.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let c=a.dir[n];c&&(kt(),At(c,r,8,[t.el,a,t,e]),It())}}const yg=Symbol("_vte"),vg=t=>t.__isTeleport,bg=Symbol("_leaveCb");function Uo(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Uo(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Gl(t,e){return ce(t)?Ke({name:t.name},e,{setup:t}):t}function Ql(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function _g(t){const e=Zo(),r=Xm(null);if(e){const i=e.refs===be?e.refs={}:e.refs;Object.defineProperty(i,t,{enumerable:!0,get:()=>r.value,set:s=>r.value=s})}return r}const Yi=new WeakMap;function $n(t,e,r,n,i=!1){if(ae(t)){t.forEach((b,R)=>$n(b,e&&(ae(e)?e[R]:e),r,n,i));return}if(kn(n)&&!i){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&$n(t,e,r,n.component.subTree);return}const s=n.shapeFlag&4?is(n.component):n.el,o=i?null:s,{i:a,r:c}=t,l=e&&e.r,u=a.refs===be?a.refs={}:a.refs,f=a.setupState,v=ye(f),y=f===be?fl:b=>xe(v,b);if(l!=null&&l!==c){if(Xl(e),De(l))u[l]=null,y(l)&&(f[l]=null);else if(ze(l)){l.value=null;const b=e;b.k&&(u[b.k]=null)}}if(ce(c))Ur(c,a,12,[o,u]);else{const b=De(c),R=ze(c);if(b||R){const H=()=>{if(t.f){const B=b?y(c)?f[c]:u[c]:c.value;if(i)ae(B)&&wo(B,s);else if(ae(B))B.includes(s)||B.push(s);else if(b)u[c]=[s],y(c)&&(f[c]=u[c]);else{const N=[s];c.value=N,t.k&&(u[t.k]=N)}}else b?(u[c]=o,y(c)&&(f[c]=o)):R&&(c.value=o,t.k&&(u[t.k]=o))};if(o){const B=()=>{H(),Yi.delete(t)};B.id=-1,Yi.set(t,B),ut(B,r)}else Xl(t),H()}}}function Xl(t){const e=Yi.get(t);e&&(e.flags|=8,Yi.delete(t))}Ti().requestIdleCallback,Ti().cancelIdleCallback;const kn=t=>!!t.type.__asyncLoader,Zl=t=>t.type.__isKeepAlive;function wg(t,e){eu(t,"a",e)}function xg(t,e){eu(t,"da",e)}function eu(t,e,r=tt){const n=t.__wdc||(t.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(Gi(e,n,r),r){let i=r.parent;for(;i&&i.parent;)Zl(i.parent.vnode)&&Sg(n,e,r,i),i=i.parent}}function Sg(t,e,r,n){const i=Gi(e,t,n,!0);ru(()=>{wo(n[e],i)},r)}function Gi(t,e,r=tt,n=!1){if(r){const i=r[t]||(r[t]=[]),s=e.__weh||(e.__weh=(...o)=>{kt();const a=Fn(r),c=At(e,r,t,o);return a(),It(),c});return n?i.unshift(s):i.push(s),s}}const Yt=t=>(e,r=tt)=>{(!jn||t==="sp")&&Gi(t,(...n)=>e(...n),r)},Eg=Yt("bm"),Wo=Yt("m"),Og=Yt("bu"),Cg=Yt("u"),tu=Yt("bum"),ru=Yt("um"),Pg=Yt("sp"),$g=Yt("rtg"),kg=Yt("rtc");function Ig(t,e=tt){Gi("ec",t,e)}const Ag=Symbol.for("v-ndc");function nu(t,e,r,n){let i;const s=r,o=ae(t);if(o||De(t)){const a=o&&Br(t);let c=!1,l=!1;a&&(c=!yt(t),l=nr(t),t=Li(t)),i=new Array(t.length);for(let u=0,f=t.length;u<f;u++)i[u]=e(c?l?Ui(Je(t[u])):Je(t[u]):t[u],u,void 0,s)}else if(typeof t=="number"){i=new Array(t);for(let a=0;a<t;a++)i[a]=e(a+1,a,void 0,s)}else if(Ie(t))if(t[Symbol.iterator])i=Array.from(t,(a,c)=>e(a,c,void 0,s));else{const a=Object.keys(t);i=new Array(a.length);for(let c=0,l=a.length;c<l;c++){const u=a[c];i[c]=e(t[u],u,c,s)}}else i=[];return i}const qo=t=>t?Mu(t)?is(t):qo(t.parent):null,In=Ke(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>qo(t.parent),$root:t=>qo(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>au(t),$forceUpdate:t=>t.f||(t.f=()=>{Bo(t.update)}),$nextTick:t=>t.n||(t.n=Ki.bind(t.proxy)),$watch:t=>ey.bind(t)}),Ho=(t,e)=>t!==be&&!t.__isScriptSetup&&xe(t,e),Tg={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:r,setupState:n,data:i,props:s,accessCache:o,type:a,appContext:c}=t;let l;if(e[0]!=="$"){const y=o[e];if(y!==void 0)switch(y){case 1:return n[e];case 2:return i[e];case 4:return r[e];case 3:return s[e]}else{if(Ho(n,e))return o[e]=1,n[e];if(i!==be&&xe(i,e))return o[e]=2,i[e];if((l=t.propsOptions[0])&&xe(l,e))return o[e]=3,s[e];if(r!==be&&xe(r,e))return o[e]=4,r[e];zo&&(o[e]=0)}}const u=In[e];let f,v;if(u)return e==="$attrs"&&Ye(t.attrs,"get",""),u(t);if((f=a.__cssModules)&&(f=f[e]))return f;if(r!==be&&xe(r,e))return o[e]=4,r[e];if(v=c.config.globalProperties,xe(v,e))return v[e]},set({_:t},e,r){const{data:n,setupState:i,ctx:s}=t;return Ho(i,e)?(i[e]=r,!0):n!==be&&xe(n,e)?(n[e]=r,!0):xe(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=r,!0)},has({_:{data:t,setupState:e,accessCache:r,ctx:n,appContext:i,propsOptions:s,type:o}},a){let c,l;return!!(r[a]||t!==be&&a[0]!=="$"&&xe(t,a)||Ho(e,a)||(c=s[0])&&xe(c,a)||xe(n,a)||xe(In,a)||xe(i.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(t,e,r){return r.get!=null?t._.accessCache[e]=0:xe(r,"value")&&this.set(t,e,r.value,null),Reflect.defineProperty(t,e,r)}};function Qi(t){return ae(t)?t.reduce((e,r)=>(e[r]=null,e),{}):t}function iu(t,e){return!t||!e?t||e:ae(t)&&ae(e)?t.concat(e):Ke({},Qi(t),Qi(e))}let zo=!0;function Rg(t){const e=au(t),r=t.proxy,n=t.ctx;zo=!1,e.beforeCreate&&su(e.beforeCreate,t,"bc");const{data:i,computed:s,methods:o,watch:a,provide:c,inject:l,created:u,beforeMount:f,mounted:v,beforeUpdate:y,updated:b,activated:R,deactivated:H,beforeDestroy:B,beforeUnmount:N,destroyed:g,unmounted:m,render:h,renderTracked:C,renderTriggered:I,errorCaptured:T,serverPrefetch:J,expose:re,inheritAttrs:ke,components:Ne,directives:Ve,filters:Ge}=e;if(l&&Dg(l,n,null),o)for(const ve in o){const _e=o[ve];ce(_e)&&(n[ve]=_e.bind(r))}if(i){const ve=i.call(r,r);Ie(ve)&&(t.data=Mo(ve))}if(zo=!0,s)for(const ve in s){const _e=s[ve],pt=ce(_e)?_e.bind(r,r):ce(_e.get)?_e.get.bind(r,r):$t,Qt=!ce(_e)&&ce(_e.set)?_e.set.bind(r):$t,je=Uu({get:pt,set:Qt});Object.defineProperty(n,ve,{enumerable:!0,configurable:!0,get:()=>je.value,set:Qe=>je.value=Qe})}if(a)for(const ve in a)ou(a[ve],n,r,ve);if(c){const ve=ce(c)?c.call(r):c;Reflect.ownKeys(ve).forEach(_e=>{fu(_e,ve[_e])})}u&&su(u,t,"c");function Te(ve,_e){ae(_e)?_e.forEach(pt=>ve(pt.bind(r))):_e&&ve(_e.bind(r))}if(Te(Eg,f),Te(Wo,v),Te(Og,y),Te(Cg,b),Te(wg,R),Te(xg,H),Te(Ig,T),Te(kg,C),Te($g,I),Te(tu,N),Te(ru,m),Te(Pg,J),ae(re))if(re.length){const ve=t.exposed||(t.exposed={});re.forEach(_e=>{Object.defineProperty(ve,_e,{get:()=>r[_e],set:pt=>r[_e]=pt,enumerable:!0})})}else t.exposed||(t.exposed={});h&&t.render===$t&&(t.render=h),ke!=null&&(t.inheritAttrs=ke),Ne&&(t.components=Ne),Ve&&(t.directives=Ve),J&&Ql(t)}function Dg(t,e,r=$t){ae(t)&&(t=Vo(t));for(const n in t){const i=t[n];let s;Ie(i)?"default"in i?s=Tn(i.from||n,i.default,!0):s=Tn(i.from||n):s=Tn(i),ze(s)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[n]=s}}function su(t,e,r){At(ae(t)?t.map(n=>n.bind(e.proxy)):t.bind(e.proxy),e,r)}function ou(t,e,r,n){let i=n.includes(".")?Eu(r,n):()=>r[n];if(De(t)){const s=e[t];ce(s)&&Rn(i,s)}else if(ce(t))Rn(i,t.bind(r));else if(Ie(t))if(ae(t))t.forEach(s=>ou(s,e,r,n));else{const s=ce(t.handler)?t.handler.bind(r):e[t.handler];ce(s)&&Rn(i,s,t)}}function au(t){const e=t.type,{mixins:r,extends:n}=e,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let c;return a?c=a:!i.length&&!r&&!n?c=e:(c={},i.length&&i.forEach(l=>Xi(c,l,o,!0)),Xi(c,e,o)),Ie(e)&&s.set(e,c),c}function Xi(t,e,r,n=!1){const{mixins:i,extends:s}=e;s&&Xi(t,s,r,!0),i&&i.forEach(o=>Xi(t,o,r,!0));for(const o in e)if(!(n&&o==="expose")){const a=Ng[o]||r&&r[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const Ng={data:cu,props:lu,emits:lu,methods:An,computed:An,beforeCreate:et,created:et,beforeMount:et,mounted:et,beforeUpdate:et,updated:et,beforeDestroy:et,beforeUnmount:et,destroyed:et,unmounted:et,activated:et,deactivated:et,errorCaptured:et,serverPrefetch:et,components:An,directives:An,watch:Mg,provide:cu,inject:Lg};function cu(t,e){return e?t?function(){return Ke(ce(t)?t.call(this,this):t,ce(e)?e.call(this,this):e)}:e:t}function Lg(t,e){return An(Vo(t),Vo(e))}function Vo(t){if(ae(t)){const e={};for(let r=0;r<t.length;r++)e[t[r]]=t[r];return e}return t}function et(t,e){return t?[...new Set([].concat(t,e))]:e}function An(t,e){return t?Ke(Object.create(null),t,e):e}function lu(t,e){return t?ae(t)&&ae(e)?[...new Set([...t,...e])]:Ke(Object.create(null),Qi(t),Qi(e??{})):e}function Mg(t,e){if(!t)return e;if(!e)return t;const r=Ke(Object.create(null),t);for(const n in e)r[n]=et(t[n],e[n]);return r}function uu(){return{app:null,config:{isNativeTag:fl,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Fg=0;function jg(t,e){return function(n,i=null){ce(n)||(n=Ke({},n)),i!=null&&!Ie(i)&&(i=null);const s=uu(),o=new WeakSet,a=[];let c=!1;const l=s.app={_uid:Fg++,_component:n,_props:i,_container:null,_context:s,_instance:null,version:Ey,get config(){return s.config},set config(u){},use(u,...f){return o.has(u)||(u&&ce(u.install)?(o.add(u),u.install(l,...f)):ce(u)&&(o.add(u),u(l,...f))),l},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),l},component(u,f){return f?(s.components[u]=f,l):s.components[u]},directive(u,f){return f?(s.directives[u]=f,l):s.directives[u]},mount(u,f,v){if(!c){const y=l._ceVNode||sr(n,i);return y.appContext=s,v===!0?v="svg":v===!1&&(v=void 0),t(y,u,v),c=!0,l._container=u,u.__vue_app__=l,is(y.component)}},onUnmount(u){a.push(u)},unmount(){c&&(At(a,l._instance,16),t(null,l._container),delete l._container.__vue_app__)},provide(u,f){return s.provides[u]=f,l},runWithContext(u){const f=Hr;Hr=l;try{return u()}finally{Hr=f}}};return l}}let Hr=null;function fu(t,e){if(tt){let r=tt.provides;const n=tt.parent&&tt.parent.provides;n===r&&(r=tt.provides=Object.create(n)),r[t]=e}}function Tn(t,e,r=!1){const n=Zo();if(n||Hr){let i=Hr?Hr._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(i&&t in i)return i[t];if(arguments.length>1)return r&&ce(e)?e.call(n&&n.proxy):e}}const du={},hu=()=>Object.create(du),pu=t=>Object.getPrototypeOf(t)===du;function Bg(t,e,r,n=!1){const i={},s=hu();t.propsDefaults=Object.create(null),mu(t,e,i,s);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);r?t.props=n?i:Gm(i):t.type.props?t.props=i:t.props=s,t.attrs=s}function Ug(t,e,r,n){const{props:i,attrs:s,vnode:{patchFlag:o}}=t,a=ye(i),[c]=t.propsOptions;let l=!1;if((n||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let f=0;f<u.length;f++){let v=u[f];if(es(t.emitsOptions,v))continue;const y=e[v];if(c)if(xe(s,v))y!==s[v]&&(s[v]=y,l=!0);else{const b=zt(v);i[b]=Ko(c,a,b,y,t,!1)}else y!==s[v]&&(s[v]=y,l=!0)}}}else{mu(t,e,i,s)&&(l=!0);let u;for(const f in a)(!e||!xe(e,f)&&((u=rr(f))===f||!xe(e,u)))&&(c?r&&(r[f]!==void 0||r[u]!==void 0)&&(i[f]=Ko(c,a,f,void 0,t,!0)):delete i[f]);if(s!==a)for(const f in s)(!e||!xe(e,f))&&(delete s[f],l=!0)}l&&Vt(t.attrs,"set","")}function mu(t,e,r,n){const[i,s]=t.propsOptions;let o=!1,a;if(e)for(let c in e){if(_n(c))continue;const l=e[c];let u;i&&xe(i,u=zt(c))?!s||!s.includes(u)?r[u]=l:(a||(a={}))[u]=l:es(t.emitsOptions,c)||(!(c in n)||l!==n[c])&&(n[c]=l,o=!0)}if(s){const c=ye(r),l=a||be;for(let u=0;u<s.length;u++){const f=s[u];r[f]=Ko(i,c,f,l[f],t,!xe(l,f))}}return o}function Ko(t,e,r,n,i,s){const o=t[r];if(o!=null){const a=xe(o,"default");if(a&&n===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&ce(c)){const{propsDefaults:l}=i;if(r in l)n=l[r];else{const u=Fn(i);n=l[r]=c.call(null,e),u()}}else n=c;i.ce&&i.ce._setProp(r,n)}o[0]&&(s&&!a?n=!1:o[1]&&(n===""||n===rr(r))&&(n=!0))}return n}const Wg=new WeakMap;function gu(t,e,r=!1){const n=r?Wg:e.propsCache,i=n.get(t);if(i)return i;const s=t.props,o={},a=[];let c=!1;if(!ce(t)){const u=f=>{c=!0;const[v,y]=gu(f,e,!0);Ke(o,v),y&&a.push(...y)};!r&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!s&&!c)return Ie(t)&&n.set(t,Mr),Mr;if(ae(s))for(let u=0;u<s.length;u++){const f=zt(s[u]);yu(f)&&(o[f]=be)}else if(s)for(const u in s){const f=zt(u);if(yu(f)){const v=s[u],y=o[f]=ae(v)||ce(v)?{type:v}:Ke({},v),b=y.type;let R=!1,H=!0;if(ae(b))for(let B=0;B<b.length;++B){const N=b[B],g=ce(N)&&N.name;if(g==="Boolean"){R=!0;break}else g==="String"&&(H=!1)}else R=ce(b)&&b.name==="Boolean";y[0]=R,y[1]=H,(R||xe(y,"default"))&&a.push(f)}}const l=[o,a];return Ie(t)&&n.set(t,l),l}function yu(t){return t[0]!=="$"&&!_n(t)}const Jo=t=>t==="_"||t==="_ctx"||t==="$stable",Yo=t=>ae(t)?t.map(Rt):[Rt(t)],qg=(t,e,r)=>{if(e._n)return e;const n=mg((...i)=>Yo(e(...i)),r);return n._c=!1,n},vu=(t,e,r)=>{const n=t._ctx;for(const i in t){if(Jo(i))continue;const s=t[i];if(ce(s))e[i]=qg(i,s,n);else if(s!=null){const o=Yo(s);e[i]=()=>o}}},bu=(t,e)=>{const r=Yo(e);t.slots.default=()=>r},_u=(t,e,r)=>{for(const n in e)(r||!Jo(n))&&(t[n]=e[n])},Hg=(t,e,r)=>{const n=t.slots=hu();if(t.vnode.shapeFlag&32){const i=e._;i?(_u(n,e,r),r&&yl(n,"_",i,!0)):vu(e,n)}else e&&bu(t,e)},zg=(t,e,r)=>{const{vnode:n,slots:i}=t;let s=!0,o=be;if(n.shapeFlag&32){const a=e._;a?r&&a===1?s=!1:_u(i,e,r):(s=!e.$stable,vu(e,i)),o=e}else e&&(bu(t,e),o={default:1});if(s)for(const a in i)!Jo(a)&&o[a]==null&&delete i[a]},ut=ay;function Vg(t){return Kg(t)}function Kg(t,e){const r=Ti();r.__VUE__=!0;const{insert:n,remove:i,patchProp:s,createElement:o,createText:a,createComment:c,setText:l,setElementText:u,parentNode:f,nextSibling:v,setScopeId:y=$t,insertStaticContent:b}=t,R=(_,S,D,F=null,j=null,M=null,K=void 0,Y=null,V=!!S.dynamicChildren)=>{if(_===S)return;_&&!Mn(_,S)&&(F=Mt(_),Qe(_,j,M,!0),_=null),S.patchFlag===-2&&(V=!1,S.dynamicChildren=null);const{type:U,ref:ne,shapeFlag:X}=S;switch(U){case ts:H(_,S,D,F);break;case zr:B(_,S,D,F);break;case Qo:_==null&&N(S,D,F,K);break;case St:Ne(_,S,D,F,j,M,K,Y,V);break;default:X&1?h(_,S,D,F,j,M,K,Y,V):X&6?Ve(_,S,D,F,j,M,K,Y,V):(X&64||X&128)&&U.process(_,S,D,F,j,M,K,Y,V,Xt)}ne!=null&&j?$n(ne,_&&_.ref,M,S||_,!S):ne==null&&_&&_.ref!=null&&$n(_.ref,null,M,_,!0)},H=(_,S,D,F)=>{if(_==null)n(S.el=a(S.children),D,F);else{const j=S.el=_.el;S.children!==_.children&&l(j,S.children)}},B=(_,S,D,F)=>{_==null?n(S.el=c(S.children||""),D,F):S.el=_.el},N=(_,S,D,F)=>{[_.el,_.anchor]=b(_.children,S,D,F,_.el,_.anchor)},g=({el:_,anchor:S},D,F)=>{let j;for(;_&&_!==S;)j=v(_),n(_,D,F),_=j;n(S,D,F)},m=({el:_,anchor:S})=>{let D;for(;_&&_!==S;)D=v(_),i(_),_=D;i(S)},h=(_,S,D,F,j,M,K,Y,V)=>{S.type==="svg"?K="svg":S.type==="math"&&(K="mathml"),_==null?C(S,D,F,j,M,K,Y,V):J(_,S,j,M,K,Y,V)},C=(_,S,D,F,j,M,K,Y)=>{let V,U;const{props:ne,shapeFlag:X,transition:te,dirs:ie}=_;if(V=_.el=o(_.type,M,ne&&ne.is,ne),X&8?u(V,_.children):X&16&&T(_.children,V,null,F,j,Go(_,M),K,Y),ie&&br(_,null,F,"created"),I(V,_,_.scopeId,K,F),ne){for(const we in ne)we!=="value"&&!_n(we)&&s(V,we,null,ne[we],M,F);"value"in ne&&s(V,"value",null,ne.value,M),(U=ne.onVnodeBeforeMount)&&Dt(U,F,_)}ie&&br(_,null,F,"beforeMount");const ue=Jg(j,te);ue&&te.beforeEnter(V),n(V,S,D),((U=ne&&ne.onVnodeMounted)||ue||ie)&&ut(()=>{U&&Dt(U,F,_),ue&&te.enter(V),ie&&br(_,null,F,"mounted")},j)},I=(_,S,D,F,j)=>{if(D&&y(_,D),F)for(let M=0;M<F.length;M++)y(_,F[M]);if(j){let M=j.subTree;if(S===M||Iu(M.type)&&(M.ssContent===S||M.ssFallback===S)){const K=j.vnode;I(_,K,K.scopeId,K.slotScopeIds,j.parent)}}},T=(_,S,D,F,j,M,K,Y,V=0)=>{for(let U=V;U<_.length;U++){const ne=_[U]=Y?or(_[U]):Rt(_[U]);R(null,ne,S,D,F,j,M,K,Y)}},J=(_,S,D,F,j,M,K)=>{const Y=S.el=_.el;let{patchFlag:V,dynamicChildren:U,dirs:ne}=S;V|=_.patchFlag&16;const X=_.props||be,te=S.props||be;let ie;if(D&&_r(D,!1),(ie=te.onVnodeBeforeUpdate)&&Dt(ie,D,S,_),ne&&br(S,_,D,"beforeUpdate"),D&&_r(D,!0),(X.innerHTML&&te.innerHTML==null||X.textContent&&te.textContent==null)&&u(Y,""),U?re(_.dynamicChildren,U,Y,D,F,Go(S,j),M):K||_e(_,S,Y,null,D,F,Go(S,j),M,!1),V>0){if(V&16)ke(Y,X,te,D,j);else if(V&2&&X.class!==te.class&&s(Y,"class",null,te.class,j),V&4&&s(Y,"style",X.style,te.style,j),V&8){const ue=S.dynamicProps;for(let we=0;we<ue.length;we++){const me=ue[we],Ae=X[me],Le=te[me];(Le!==Ae||me==="value")&&s(Y,me,Ae,Le,j,D)}}V&1&&_.children!==S.children&&u(Y,S.children)}else!K&&U==null&&ke(Y,X,te,D,j);((ie=te.onVnodeUpdated)||ne)&&ut(()=>{ie&&Dt(ie,D,S,_),ne&&br(S,_,D,"updated")},F)},re=(_,S,D,F,j,M,K)=>{for(let Y=0;Y<S.length;Y++){const V=_[Y],U=S[Y],ne=V.el&&(V.type===St||!Mn(V,U)||V.shapeFlag&198)?f(V.el):D;R(V,U,ne,null,F,j,M,K,!0)}},ke=(_,S,D,F,j)=>{if(S!==D){if(S!==be)for(const M in S)!_n(M)&&!(M in D)&&s(_,M,S[M],null,j,F);for(const M in D){if(_n(M))continue;const K=D[M],Y=S[M];K!==Y&&M!=="value"&&s(_,M,Y,K,j,F)}"value"in D&&s(_,"value",S.value,D.value,j)}},Ne=(_,S,D,F,j,M,K,Y,V)=>{const U=S.el=_?_.el:a(""),ne=S.anchor=_?_.anchor:a("");let{patchFlag:X,dynamicChildren:te,slotScopeIds:ie}=S;ie&&(Y=Y?Y.concat(ie):ie),_==null?(n(U,D,F),n(ne,D,F),T(S.children||[],D,ne,j,M,K,Y,V)):X>0&&X&64&&te&&_.dynamicChildren?(re(_.dynamicChildren,te,D,j,M,K,Y),(S.key!=null||j&&S===j.subTree)&&wu(_,S,!0)):_e(_,S,D,ne,j,M,K,Y,V)},Ve=(_,S,D,F,j,M,K,Y,V)=>{S.slotScopeIds=Y,_==null?S.shapeFlag&512?j.ctx.activate(S,D,F,K,V):Ge(S,D,F,j,M,K,V):ht(_,S,V)},Ge=(_,S,D,F,j,M,K)=>{const Y=_.component=my(_,F,j);if(Zl(_)&&(Y.ctx.renderer=Xt),gy(Y,!1,K),Y.asyncDep){if(j&&j.registerDep(Y,Te,K),!_.el){const V=Y.subTree=sr(zr);B(null,V,S,D),_.placeholder=V.el}}else Te(Y,_,S,D,j,M,K)},ht=(_,S,D)=>{const F=S.component=_.component;if(sy(_,S,D))if(F.asyncDep&&!F.asyncResolved){ve(F,S,D);return}else F.next=S,F.update();else S.el=_.el,F.vnode=S},Te=(_,S,D,F,j,M,K)=>{const Y=()=>{if(_.isMounted){let{next:X,bu:te,u:ie,parent:ue,vnode:we}=_;{const nt=xu(_);if(nt){X&&(X.el=we.el,ve(_,X,K)),nt.asyncDep.then(()=>{_.isUnmounted||Y()});return}}let me=X,Ae;_r(_,!1),X?(X.el=we.el,ve(_,X,K)):X=we,te&&Eo(te),(Ae=X.props&&X.props.onVnodeBeforeUpdate)&&Dt(Ae,ue,X,we),_r(_,!0);const Le=$u(_),Xe=_.subTree;_.subTree=Le,R(Xe,Le,f(Xe.el),Mt(Xe),_,j,M),X.el=Le.el,me===null&&oy(_,Le.el),ie&&ut(ie,j),(Ae=X.props&&X.props.onVnodeUpdated)&&ut(()=>Dt(Ae,ue,X,we),j)}else{let X;const{el:te,props:ie}=S,{bm:ue,m:we,parent:me,root:Ae,type:Le}=_,Xe=kn(S);_r(_,!1),ue&&Eo(ue),!Xe&&(X=ie&&ie.onVnodeBeforeMount)&&Dt(X,me,S),_r(_,!0);{Ae.ce&&Ae.ce._def.shadowRoot!==!1&&Ae.ce._injectChildStyle(Le);const nt=_.subTree=$u(_);R(null,nt,D,F,_,j,M),S.el=nt.el}if(we&&ut(we,j),!Xe&&(X=ie&&ie.onVnodeMounted)){const nt=S;ut(()=>Dt(X,me,nt),j)}(S.shapeFlag&256||me&&kn(me.vnode)&&me.vnode.shapeFlag&256)&&_.a&&ut(_.a,j),_.isMounted=!0,S=D=F=null}};_.scope.on();const V=_.effect=new xl(Y);_.scope.off();const U=_.update=V.run.bind(V),ne=_.job=V.runIfDirty.bind(V);ne.i=_,ne.id=_.uid,V.scheduler=()=>Bo(ne),_r(_,!0),U()},ve=(_,S,D)=>{S.component=_;const F=_.vnode.props;_.vnode=S,_.next=null,Ug(_,S.props,F,D),zg(_,S.children,D),kt(),Vl(_),It()},_e=(_,S,D,F,j,M,K,Y,V=!1)=>{const U=_&&_.children,ne=_?_.shapeFlag:0,X=S.children,{patchFlag:te,shapeFlag:ie}=S;if(te>0){if(te&128){Qt(U,X,D,F,j,M,K,Y,V);return}else if(te&256){pt(U,X,D,F,j,M,K,Y,V);return}}ie&8?(ne&16&&rt(U,j,M),X!==U&&u(D,X)):ne&16?ie&16?Qt(U,X,D,F,j,M,K,Y,V):rt(U,j,M,!0):(ne&8&&u(D,""),ie&16&&T(X,D,F,j,M,K,Y,V))},pt=(_,S,D,F,j,M,K,Y,V)=>{_=_||Mr,S=S||Mr;const U=_.length,ne=S.length,X=Math.min(U,ne);let te;for(te=0;te<X;te++){const ie=S[te]=V?or(S[te]):Rt(S[te]);R(_[te],ie,D,null,j,M,K,Y,V)}U>ne?rt(_,j,M,!0,!1,X):T(S,D,F,j,M,K,Y,V,X)},Qt=(_,S,D,F,j,M,K,Y,V)=>{let U=0;const ne=S.length;let X=_.length-1,te=ne-1;for(;U<=X&&U<=te;){const ie=_[U],ue=S[U]=V?or(S[U]):Rt(S[U]);if(Mn(ie,ue))R(ie,ue,D,null,j,M,K,Y,V);else break;U++}for(;U<=X&&U<=te;){const ie=_[X],ue=S[te]=V?or(S[te]):Rt(S[te]);if(Mn(ie,ue))R(ie,ue,D,null,j,M,K,Y,V);else break;X--,te--}if(U>X){if(U<=te){const ie=te+1,ue=ie<ne?S[ie].el:F;for(;U<=te;)R(null,S[U]=V?or(S[U]):Rt(S[U]),D,ue,j,M,K,Y,V),U++}}else if(U>te)for(;U<=X;)Qe(_[U],j,M,!0),U++;else{const ie=U,ue=U,we=new Map;for(U=ue;U<=te;U++){const Be=S[U]=V?or(S[U]):Rt(S[U]);Be.key!=null&&we.set(Be.key,U)}let me,Ae=0;const Le=te-ue+1;let Xe=!1,nt=0;const Ft=new Array(Le);for(U=0;U<Le;U++)Ft[U]=0;for(U=ie;U<=X;U++){const Be=_[U];if(Ae>=Le){Qe(Be,j,M,!0);continue}let k;if(Be.key!=null)k=we.get(Be.key);else for(me=ue;me<=te;me++)if(Ft[me-ue]===0&&Mn(Be,S[me])){k=me;break}k===void 0?Qe(Be,j,M,!0):(Ft[k-ue]=U+1,k>=nt?nt=k:Xe=!0,R(Be,S[k],D,null,j,M,K,Y,V),Ae++)}const jt=Xe?Yg(Ft):Mr;for(me=jt.length-1,U=Le-1;U>=0;U--){const Be=ue+U,k=S[Be],A=S[Be+1],de=Be+1<ne?A.el||A.placeholder:F;Ft[U]===0?R(null,k,D,de,j,M,K,Y,V):Xe&&(me<0||U!==jt[me]?je(k,D,de,2):me--)}}},je=(_,S,D,F,j=null)=>{const{el:M,type:K,transition:Y,children:V,shapeFlag:U}=_;if(U&6){je(_.component.subTree,S,D,F);return}if(U&128){_.suspense.move(S,D,F);return}if(U&64){K.move(_,S,D,Xt);return}if(K===St){n(M,S,D);for(let X=0;X<V.length;X++)je(V[X],S,D,F);n(_.anchor,S,D);return}if(K===Qo){g(_,S,D);return}if(F!==2&&U&1&&Y)if(F===0)Y.beforeEnter(M),n(M,S,D),ut(()=>Y.enter(M),j);else{const{leave:X,delayLeave:te,afterLeave:ie}=Y,ue=()=>{_.ctx.isUnmounted?i(M):n(M,S,D)},we=()=>{M._isLeaving&&M[bg](!0),X(M,()=>{ue(),ie&&ie()})};te?te(M,ue,we):we()}else n(M,S,D)},Qe=(_,S,D,F=!1,j=!1)=>{const{type:M,props:K,ref:Y,children:V,dynamicChildren:U,shapeFlag:ne,patchFlag:X,dirs:te,cacheIndex:ie}=_;if(X===-2&&(j=!1),Y!=null&&(kt(),$n(Y,null,D,_,!0),It()),ie!=null&&(S.renderCache[ie]=void 0),ne&256){S.ctx.deactivate(_);return}const ue=ne&1&&te,we=!kn(_);let me;if(we&&(me=K&&K.onVnodeBeforeUnmount)&&Dt(me,S,_),ne&6)qn(_.component,D,F);else{if(ne&128){_.suspense.unmount(D,F);return}ue&&br(_,null,S,"beforeUnmount"),ne&64?_.type.remove(_,S,D,Xt,F):U&&!U.hasOnce&&(M!==St||X>0&&X&64)?rt(U,S,D,!1,!0):(M===St&&X&384||!j&&ne&16)&&rt(V,S,D),F&&an(_)}(we&&(me=K&&K.onVnodeUnmounted)||ue)&&ut(()=>{me&&Dt(me,S,_),ue&&br(_,null,S,"unmounted")},D)},an=_=>{const{type:S,el:D,anchor:F,transition:j}=_;if(S===St){cn(D,F);return}if(S===Qo){m(_);return}const M=()=>{i(D),j&&!j.persisted&&j.afterLeave&&j.afterLeave()};if(_.shapeFlag&1&&j&&!j.persisted){const{leave:K,delayLeave:Y}=j,V=()=>K(D,M);Y?Y(_.el,M,V):V()}else M()},cn=(_,S)=>{let D;for(;_!==S;)D=v(_),i(_),_=D;i(S)},qn=(_,S,D)=>{const{bum:F,scope:j,job:M,subTree:K,um:Y,m:V,a:U}=_;Su(V),Su(U),F&&Eo(F),j.stop(),M&&(M.flags|=8,Qe(K,_,S,D)),Y&&ut(Y,S),ut(()=>{_.isUnmounted=!0},S)},rt=(_,S,D,F=!1,j=!1,M=0)=>{for(let K=M;K<_.length;K++)Qe(_[K],S,D,F,j)},Mt=_=>{if(_.shapeFlag&6)return Mt(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();const S=v(_.anchor||_.el),D=S&&S[yg];return D?v(D):S};let Or=!1;const Cr=(_,S,D)=>{_==null?S._vnode&&Qe(S._vnode,null,null,!0):R(S._vnode||null,_,S,null,null,null,D),S._vnode=_,Or||(Or=!0,Vl(),Kl(),Or=!1)},Xt={p:R,um:Qe,m:je,r:an,mt:Ge,mc:T,pc:_e,pbc:re,n:Mt,o:t};return{render:Cr,hydrate:void 0,createApp:jg(Cr)}}function Go({type:t,props:e},r){return r==="svg"&&t==="foreignObject"||r==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:r}function _r({effect:t,job:e},r){r?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Jg(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function wu(t,e,r=!1){const n=t.children,i=e.children;if(ae(n)&&ae(i))for(let s=0;s<n.length;s++){const o=n[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=or(i[s]),a.el=o.el),!r&&a.patchFlag!==-2&&wu(o,a)),a.type===ts&&a.patchFlag!==-1&&(a.el=o.el),a.type===zr&&!a.el&&(a.el=o.el)}}function Yg(t){const e=t.slice(),r=[0];let n,i,s,o,a;const c=t.length;for(n=0;n<c;n++){const l=t[n];if(l!==0){if(i=r[r.length-1],t[i]<l){e[n]=i,r.push(n);continue}for(s=0,o=r.length-1;s<o;)a=s+o>>1,t[r[a]]<l?s=a+1:o=a;l<t[r[s]]&&(s>0&&(e[n]=r[s-1]),r[s]=n)}}for(s=r.length,o=r[s-1];s-- >0;)r[s]=o,o=e[o];return r}function xu(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:xu(e)}function Su(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}const Gg=Symbol.for("v-scx"),Qg=()=>Tn(Gg);function Xg(t,e){return Zi(t,null,e)}function Zg(t,e){return Zi(t,null,{flush:"sync"})}function Rn(t,e,r){return Zi(t,e,r)}function Zi(t,e,r=be){const{immediate:n,deep:i,flush:s,once:o}=r,a=Ke({},r),c=e&&n||!e&&s!=="post";let l;if(jn){if(s==="sync"){const y=Qg();l=y.__watcherHandles||(y.__watcherHandles=[])}else if(!c){const y=()=>{};return y.stop=$t,y.resume=$t,y.pause=$t,y}}const u=tt;a.call=(y,b,R)=>At(y,u,b,R);let f=!1;s==="post"?a.scheduler=y=>{ut(y,u&&u.suspense)}:s!=="sync"&&(f=!0,a.scheduler=(y,b)=>{b?y():Bo(y)}),a.augmentJob=y=>{e&&(y.flags|=4),f&&(y.flags|=2,u&&(y.id=u.uid,y.i=u))};const v=ag(t,e,a);return jn&&(l?l.push(v):c&&v()),v}function ey(t,e,r){const n=this.proxy,i=De(t)?t.includes(".")?Eu(n,t):()=>n[t]:t.bind(n,n);let s;ce(e)?s=e:(s=e.handler,r=e);const o=Fn(this),a=Zi(i,s.bind(n),r);return o(),a}function Eu(t,e){const r=e.split(".");return()=>{let n=t;for(let i=0;i<r.length&&n;i++)n=n[r[i]];return n}}function Ou(t,e,r=be){const n=Zo(),i=zt(e),s=rr(e),o=Cu(t,i),a=ng((c,l)=>{let u,f=be,v;return Zg(()=>{const y=t[i];at(u,y)&&(u=y,l())}),{get(){return c(),r.get?r.get(u):u},set(y){const b=r.set?r.set(y):y;if(!at(b,u)&&!(f!==be&&at(y,f)))return;const R=n.vnode.props;R&&(e in R||i in R||s in R)&&(`onUpdate:${e}`in R||`onUpdate:${i}`in R||`onUpdate:${s}`in R)||(u=y,l()),n.emit(`update:${e}`,b),at(y,b)&&at(y,f)&&!at(b,v)&&l(),f=y,v=b}}});return a[Symbol.iterator]=()=>{let c=0;return{next(){return c<2?{value:c++?o||be:a,done:!1}:{done:!0}}}},a}const Cu=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${zt(e)}Modifiers`]||t[`${rr(e)}Modifiers`];function ty(t,e,...r){if(t.isUnmounted)return;const n=t.vnode.props||be;let i=r;const s=e.startsWith("update:"),o=s&&Cu(n,e.slice(7));o&&(o.trim&&(i=r.map(u=>De(u)?u.trim():u)),o.number&&(i=r.map(Em)));let a,c=n[a=So(e)]||n[a=So(zt(e))];!c&&s&&(c=n[a=So(rr(e))]),c&&At(c,t,6,i);const l=n[a+"Once"];if(l){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,At(l,t,6,i)}}const ry=new WeakMap;function Pu(t,e,r=!1){const n=r?ry:e.emitsCache,i=n.get(t);if(i!==void 0)return i;const s=t.emits;let o={},a=!1;if(!ce(t)){const c=l=>{const u=Pu(l,e,!0);u&&(a=!0,Ke(o,u))};!r&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}return!s&&!a?(Ie(t)&&n.set(t,null),null):(ae(s)?s.forEach(c=>o[c]=null):Ke(o,s),Ie(t)&&n.set(t,o),o)}function es(t,e){return!t||!ki(e)?!1:(e=e.slice(2).replace(/Once$/,""),xe(t,e[0].toLowerCase()+e.slice(1))||xe(t,rr(e))||xe(t,e))}function nb(){}function $u(t){const{type:e,vnode:r,proxy:n,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:c,render:l,renderCache:u,props:f,data:v,setupState:y,ctx:b,inheritAttrs:R}=t,H=Ji(t);let B,N;try{if(r.shapeFlag&4){const m=i||n,h=m;B=Rt(l.call(h,m,u,f,y,v,b)),N=a}else{const m=e;B=Rt(m.length>1?m(f,{attrs:a,slots:o,emit:c}):m(f,null)),N=e.props?a:ny(a)}}catch(m){Dn.length=0,zi(m,t,1),B=sr(zr)}let g=B;if(N&&R!==!1){const m=Object.keys(N),{shapeFlag:h}=g;m.length&&h&7&&(s&&m.some(_o)&&(N=iy(N,s)),g=Kr(g,N,!1,!0))}return r.dirs&&(g=Kr(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(r.dirs):r.dirs),r.transition&&Uo(g,r.transition),B=g,Ji(H),B}const ny=t=>{let e;for(const r in t)(r==="class"||r==="style"||ki(r))&&((e||(e={}))[r]=t[r]);return e},iy=(t,e)=>{const r={};for(const n in t)(!_o(n)||!(n.slice(9)in e))&&(r[n]=t[n]);return r};function sy(t,e,r){const{props:n,children:i,component:s}=t,{props:o,children:a,patchFlag:c}=e,l=s.emitsOptions;if(e.dirs||e.transition)return!0;if(r&&c>=0){if(c&1024)return!0;if(c&16)return n?ku(n,o,l):!!o;if(c&8){const u=e.dynamicProps;for(let f=0;f<u.length;f++){const v=u[f];if(o[v]!==n[v]&&!es(l,v))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:n===o?!1:n?o?ku(n,o,l):!0:!!o;return!1}function ku(t,e,r){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let i=0;i<n.length;i++){const s=n[i];if(e[s]!==t[s]&&!es(r,s))return!0}return!1}function oy({vnode:t,parent:e},r){for(;e;){const n=e.subTree;if(n.suspense&&n.suspense.activeBranch===t&&(n.el=t.el),n===t)(t=e.vnode).el=r,e=e.parent;else break}}const Iu=t=>t.__isSuspense;function ay(t,e){e&&e.pendingBranch?ae(t)?e.effects.push(...t):e.effects.push(t):pg(t)}const St=Symbol.for("v-fgt"),ts=Symbol.for("v-txt"),zr=Symbol.for("v-cmt"),Qo=Symbol.for("v-stc"),Dn=[];let ft=null;function Vr(t=!1){Dn.push(ft=t?null:[])}function cy(){Dn.pop(),ft=Dn[Dn.length-1]||null}let Nn=1;function Au(t,e=!1){Nn+=t,t<0&&ft&&e&&(ft.hasOnce=!0)}function Tu(t){return t.dynamicChildren=Nn>0?ft||Mr:null,cy(),Nn>0&&ft&&ft.push(t),t}function Ln(t,e,r,n,i,s){return Tu(wr(t,e,r,n,i,s,!0))}function ly(t,e,r,n,i){return Tu(sr(t,e,r,n,i,!0))}function Ru(t){return t?t.__v_isVNode===!0:!1}function Mn(t,e){return t.type===e.type&&t.key===e.key}const Du=({key:t})=>t??null,rs=({ref:t,ref_key:e,ref_for:r})=>(typeof t=="number"&&(t=""+t),t!=null?De(t)||ze(t)||ce(t)?{i:vt,r:t,k:e,f:!!r}:t:null);function wr(t,e=null,r=null,n=0,i=null,s=t===St?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Du(e),ref:e&&rs(e),scopeId:Yl,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:vt};return a?(Xo(c,r),s&128&&t.normalize(c)):r&&(c.shapeFlag|=De(r)?8:16),Nn>0&&!o&&ft&&(c.patchFlag>0||s&6)&&c.patchFlag!==32&&ft.push(c),c}const sr=uy;function uy(t,e=null,r=null,n=0,i=null,s=!1){if((!t||t===Ag)&&(t=zr),Ru(t)){const a=Kr(t,e,!0);return r&&Xo(a,r),Nn>0&&!s&&ft&&(a.shapeFlag&6?ft[ft.indexOf(t)]=a:ft.push(a)),a.patchFlag=-2,a}if(Sy(t)&&(t=t.__vccOpts),e){e=fy(e);let{class:a,style:c}=e;a&&!De(a)&&(e.class=Ri(a)),Ie(c)&&(Fo(c)&&!ae(c)&&(c=Ke({},c)),e.style=Oo(c))}const o=De(t)?1:Iu(t)?128:vg(t)?64:Ie(t)?4:ce(t)?2:0;return wr(t,e,r,n,i,o,s,!0)}function fy(t){return t?Fo(t)||pu(t)?Ke({},t):t:null}function Kr(t,e,r=!1,n=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:c}=t,l=e?Nu(i||{},e):i,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&Du(l),ref:e&&e.ref?r&&s?ae(s)?s.concat(rs(e)):[s,rs(e)]:rs(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==St?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Kr(t.ssContent),ssFallback:t.ssFallback&&Kr(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&n&&Uo(u,c.clone(u)),u}function dy(t=" ",e=0){return sr(ts,null,t,e)}function Rt(t){return t==null||typeof t=="boolean"?sr(zr):ae(t)?sr(St,null,t.slice()):Ru(t)?or(t):sr(ts,null,String(t))}function or(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Kr(t)}function Xo(t,e){let r=0;const{shapeFlag:n}=t;if(e==null)e=null;else if(ae(e))r=16;else if(typeof e=="object")if(n&65){const i=e.default;i&&(i._c&&(i._d=!1),Xo(t,i()),i._c&&(i._d=!0));return}else{r=32;const i=e._;!i&&!pu(e)?e._ctx=vt:i===3&&vt&&(vt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ce(e)?(e={default:e,_ctx:vt},r=32):(e=String(e),n&64?(r=16,e=[dy(e)]):r=8);t.children=e,t.shapeFlag|=r}function Nu(...t){const e={};for(let r=0;r<t.length;r++){const n=t[r];for(const i in n)if(i==="class")e.class!==n.class&&(e.class=Ri([e.class,n.class]));else if(i==="style")e.style=Oo([e.style,n.style]);else if(ki(i)){const s=e[i],o=n[i];o&&s!==o&&!(ae(s)&&s.includes(o))&&(e[i]=s?[].concat(s,o):o)}else i!==""&&(e[i]=n[i])}return e}function Dt(t,e,r,n=null){At(t,e,7,[r,n])}const hy=uu();let py=0;function my(t,e,r){const n=t.type,i=(e?e.appContext:t.appContext)||hy,s={uid:py++,vnode:t,type:n,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Im(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:gu(n,i),emitsOptions:Pu(n,i),emit:null,emitted:null,propsDefaults:be,inheritAttrs:n.inheritAttrs,ctx:be,data:be,props:be,attrs:be,slots:be,refs:be,setupState:be,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=ty.bind(null,s),t.ce&&t.ce(s),s}let tt=null;const Zo=()=>tt||vt;let ns,ea;{const t=Ti(),e=(r,n)=>{let i;return(i=t[r])||(i=t[r]=[]),i.push(n),s=>{i.length>1?i.forEach(o=>o(s)):i[0](s)}};ns=e("__VUE_INSTANCE_SETTERS__",r=>tt=r),ea=e("__VUE_SSR_SETTERS__",r=>jn=r)}const Fn=t=>{const e=tt;return ns(t),t.scope.on(),()=>{t.scope.off(),ns(e)}},Lu=()=>{tt&&tt.scope.off(),ns(null)};function Mu(t){return t.vnode.shapeFlag&4}let jn=!1;function gy(t,e=!1,r=!1){e&&ea(e);const{props:n,children:i}=t.vnode,s=Mu(t);Bg(t,n,s,e),Hg(t,i,r||e);const o=s?yy(t,e):void 0;return e&&ea(!1),o}function yy(t,e){const r=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Tg);const{setup:n}=r;if(n){kt();const i=t.setupContext=n.length>1?by(t):null,s=Fn(t),o=Ur(n,t,0,[t.props,i]),a=hl(o);if(It(),s(),(a||t.sp)&&!kn(t)&&Ql(t),a){if(o.then(Lu,Lu),e)return o.then(c=>{Fu(t,c)}).catch(c=>{zi(c,t,0)});t.asyncDep=o}else Fu(t,o)}else ju(t)}function Fu(t,e,r){ce(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Ie(e)&&(t.setupState=Wl(e)),ju(t)}function ju(t,e,r){const n=t.type;t.render||(t.render=n.render||$t);{const i=Fn(t);kt();try{Rg(t)}finally{It(),i()}}}const vy={get(t,e){return Ye(t,"get",""),t[e]}};function by(t){const e=r=>{t.exposed=r||{}};return{attrs:new Proxy(t.attrs,vy),slots:t.slots,emit:t.emit,expose:e}}function is(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Wl(Qm(t.exposed)),{get(e,r){if(r in e)return e[r];if(r in In)return In[r](t)},has(e,r){return r in e||r in In}})):t.proxy}const _y=/(?:^|[-_])\w/g,wy=t=>t.replace(_y,e=>e.toUpperCase()).replace(/[-_]/g,"");function xy(t,e=!0){return ce(t)?t.displayName||t.name:t.name||e&&t.__name}function Bu(t,e,r=!1){let n=xy(e);if(!n&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(n=i[1])}if(!n&&t&&t.parent){const i=s=>{for(const o in s)if(s[o]===e)return o};n=i(t.components||t.parent.type.components)||i(t.appContext.components)}return n?wy(n):r?"App":"Anonymous"}function Sy(t){return ce(t)&&"__vccOpts"in t}const Uu=(t,e)=>sg(t,e,jn),Ey="3.5.21";/**
80
+ `,...Sg(i)),console.warn(...s)}At(),Bo=!1}function xg(){let t=Pn[Pn.length-1];if(!t)return[];const e=[];for(;t;){const r=e[0];r&&r.vnode===t?r.recurseCount++:e.push({vnode:t,recurseCount:0});const n=t.component&&t.component.parent;t=n&&n.vnode}return e}function Sg(t){const e=[];return t.forEach((r,n)=>{e.push(...n===0?[]:[`
81
+ `],...Eg(r))}),e}function Eg({vnode:t,recurseCount:e}){const r=e>0?`... (${e} recursive calls)`:"",n=t.component?t.component.parent==null:!1,i=` at <${Hu(t.component,t.type,n)}`,s=">"+r;return t.props?[i,...Og(t.props),s]:[i+s]}function Og(t){const e=[],r=Object.keys(t);return r.slice(0,3).forEach(n=>{e.push(...Vl(n,t[n]))}),r.length>3&&e.push(" ..."),e}function Vl(t,e,r){return De(e)?(e=JSON.stringify(e),r?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?r?e:[`${t}=${e}`]:Ve(e)?(e=Vl(t,ye(e.value),!0),r?e:[`${t}=Ref<`,e,">"]):ce(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=ye(e),r?e:[`${t}=`,e])}function Ur(t,e,r,n){try{return n?t(...n):t()}catch(i){zi(i,e,r)}}function Tt(t,e,r,n){if(ce(t)){const i=Ur(t,e,r,n);return i&&ml(i)&&i.catch(s=>{zi(s,e,r)}),i}if(ae(t)){const i=[];for(let s=0;s<t.length;s++)i.push(Tt(t[s],e,r,n));return i}}function zi(t,e,r,n=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||be;if(e){let a=e.parent;const c=e.proxy,u=`https://vuejs.org/error-reference/#runtime-${r}`;for(;a;){const l=a.ec;if(l){for(let f=0;f<l.length;f++)if(l[f](t,c,u)===!1)return}a=a.parent}if(s){It(),Ur(s,null,10,[t,c,u]),At();return}}Pg(t,r,i,n,o)}function Pg(t,e,r,n=!0,i=!1){if(i)throw t;console.error(t)}const et=[];let Rt=-1;const Wr=[];let sr=null,qr=0;const Kl=Promise.resolve();let Vi=null;function Ki(t){const e=Vi||Kl;return t?e.then(this?t.bind(this):t):e}function Cg(t){let e=Rt+1,r=et.length;for(;e<r;){const n=e+r>>>1,i=et[n],s=Cn(i);s<t||s===t&&i.flags&2?e=n+1:r=n}return e}function Uo(t){if(!(t.flags&1)){const e=Cn(t),r=et[et.length-1];!r||!(t.flags&2)&&e>=Cn(r)?et.push(t):et.splice(Cg(e),0,t),t.flags|=1,Jl()}}function Jl(){Vi||(Vi=Kl.then(Ql))}function kg(t){ae(t)?Wr.push(...t):sr&&t.id===-1?sr.splice(qr+1,0,t):t.flags&1||(Wr.push(t),t.flags|=1),Jl()}function Yl(t,e,r=Rt+1){for(;r<et.length;r++){const n=et[r];if(n&&n.flags&2){if(t&&n.id!==t.uid)continue;et.splice(r,1),r--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Gl(t){if(Wr.length){const e=[...new Set(Wr)].sort((r,n)=>Cn(r)-Cn(n));if(Wr.length=0,sr){sr.push(...e);return}for(sr=e,qr=0;qr<sr.length;qr++){const r=sr[qr];r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2}sr=null,qr=0}}const Cn=t=>t.id==null?t.flags&2?-1:1/0:t.id;function Ql(t){try{for(Rt=0;Rt<et.length;Rt++){const e=et[Rt];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Ur(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Rt<et.length;Rt++){const e=et[Rt];e&&(e.flags&=-2)}Rt=-1,et.length=0,Gl(),Vi=null,(et.length||Wr.length)&&Ql()}}let bt=null,Xl=null;function Ji(t){const e=bt;return bt=t,Xl=t&&t.type.__scopeId||null,e}function $g(t,e=bt,r){if(!e||t._n)return t;const n=(...i)=>{n._d&&Du(-1);const s=Ji(e);let o;try{o=t(...i)}finally{Ji(s),n._d&&Du(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function Ig(t,e){if(bt===null)return t;const r=is(bt),n=t.dirs||(t.dirs=[]);for(let i=0;i<e.length;i++){let[s,o,a,c=be]=e[i];s&&(ce(s)&&(s={mounted:s,updated:s}),s.deep&&Yt(o),n.push({dir:s,instance:r,value:o,oldValue:void 0,arg:a,modifiers:c}))}return t}function _r(t,e,r,n){const i=t.dirs,s=e&&e.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let c=a.dir[n];c&&(It(),Tt(c,r,8,[t.el,a,t,e]),At())}}const Ag=Symbol("_vte"),Tg=t=>t.__isTeleport,Rg=Symbol("_leaveCb");function Wo(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Wo(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Zl(t,e){return ce(t)?Je({name:t.name},e,{setup:t}):t}function eu(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Ng(t){const e=ea(),r=hg(null);if(e){const i=e.refs===be?e.refs={}:e.refs;Object.defineProperty(i,t,{enumerable:!0,get:()=>r.value,set:s=>r.value=s})}return r}const Yi=new WeakMap;function kn(t,e,r,n,i=!1){if(ae(t)){t.forEach((b,T)=>kn(b,e&&(ae(e)?e[T]:e),r,n,i));return}if($n(n)&&!i){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&kn(t,e,r,n.component.subTree);return}const s=n.shapeFlag&4?is(n.component):n.el,o=i?null:s,{i:a,r:c}=t,u=e&&e.r,l=a.refs===be?a.refs={}:a.refs,f=a.setupState,v=ye(f),y=f===be?hl:b=>xe(v,b);if(u!=null&&u!==c){if(tu(e),De(u))l[u]=null,y(u)&&(f[u]=null);else if(Ve(u)){u.value=null;const b=e;b.k&&(l[b.k]=null)}}if(ce(c))Ur(c,a,12,[o,l]);else{const b=De(c),T=Ve(c);if(b||T){const H=()=>{if(t.f){const B=b?y(c)?f[c]:l[c]:c.value;if(i)ae(B)&&xo(B,s);else if(ae(B))B.includes(s)||B.push(s);else if(b)l[c]=[s],y(c)&&(f[c]=l[c]);else{const R=[s];c.value=R,t.k&&(l[t.k]=R)}}else b?(l[c]=o,y(c)&&(f[c]=o)):T&&(c.value=o,t.k&&(l[t.k]=o))};if(o){const B=()=>{H(),Yi.delete(t)};B.id=-1,Yi.set(t,B),ft(B,r)}else tu(t),H()}}}function tu(t){const e=Yi.get(t);e&&(e.flags|=8,Yi.delete(t))}Ti().requestIdleCallback,Ti().cancelIdleCallback;const $n=t=>!!t.type.__asyncLoader,ru=t=>t.type.__isKeepAlive;function Dg(t,e){nu(t,"a",e)}function Lg(t,e){nu(t,"da",e)}function nu(t,e,r=rt){const n=t.__wdc||(t.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(Gi(e,n,r),r){let i=r.parent;for(;i&&i.parent;)ru(i.parent.vnode)&&Mg(n,e,r,i),i=i.parent}}function Mg(t,e,r,n){const i=Gi(e,t,n,!0);ou(()=>{xo(n[e],i)},r)}function Gi(t,e,r=rt,n=!1){if(r){const i=r[t]||(r[t]=[]),s=e.__weh||(e.__weh=(...o)=>{It();const a=jn(r),c=Tt(e,r,t,o);return a(),At(),c});return n?i.unshift(s):i.push(s),s}}const Gt=t=>(e,r=rt)=>{(!Fn||t==="sp")&&Gi(t,(...n)=>e(...n),r)},iu=Gt("bm"),qo=Gt("m"),jg=Gt("bu"),Fg=Gt("u"),su=Gt("bum"),ou=Gt("um"),Bg=Gt("sp"),Ug=Gt("rtg"),Wg=Gt("rtc");function qg(t,e=rt){Gi("ec",t,e)}const Hg=Symbol.for("v-ndc");function au(t,e,r,n){let i;const s=r,o=ae(t);if(o||De(t)){const a=o&&Br(t);let c=!1,u=!1;a&&(c=!vt(t),u=ir(t),t=Li(t)),i=new Array(t.length);for(let l=0,f=t.length;l<f;l++)i[l]=e(c?u?Ui(Ye(t[l])):Ye(t[l]):t[l],l,void 0,s)}else if(typeof t=="number"){i=new Array(t);for(let a=0;a<t;a++)i[a]=e(a+1,a,void 0,s)}else if(Ie(t))if(t[Symbol.iterator])i=Array.from(t,(a,c)=>e(a,c,void 0,s));else{const a=Object.keys(t);i=new Array(a.length);for(let c=0,u=a.length;c<u;c++){const l=a[c];i[c]=e(t[l],l,c,s)}}else i=[];return i}const Ho=t=>t?Uu(t)?is(t):Ho(t.parent):null,In=Je(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Ho(t.parent),$root:t=>Ho(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>fu(t),$forceUpdate:t=>t.f||(t.f=()=>{Uo(t.update)}),$nextTick:t=>t.n||(t.n=Ki.bind(t.proxy)),$watch:t=>hy.bind(t)}),zo=(t,e)=>t!==be&&!t.__isScriptSetup&&xe(t,e),zg={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:r,setupState:n,data:i,props:s,accessCache:o,type:a,appContext:c}=t;let u;if(e[0]!=="$"){const y=o[e];if(y!==void 0)switch(y){case 1:return n[e];case 2:return i[e];case 4:return r[e];case 3:return s[e]}else{if(zo(n,e))return o[e]=1,n[e];if(i!==be&&xe(i,e))return o[e]=2,i[e];if((u=t.propsOptions[0])&&xe(u,e))return o[e]=3,s[e];if(r!==be&&xe(r,e))return o[e]=4,r[e];Vo&&(o[e]=0)}}const l=In[e];let f,v;if(l)return e==="$attrs"&&Ge(t.attrs,"get",""),l(t);if((f=a.__cssModules)&&(f=f[e]))return f;if(r!==be&&xe(r,e))return o[e]=4,r[e];if(v=c.config.globalProperties,xe(v,e))return v[e]},set({_:t},e,r){const{data:n,setupState:i,ctx:s}=t;return zo(i,e)?(i[e]=r,!0):n!==be&&xe(n,e)?(n[e]=r,!0):xe(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=r,!0)},has({_:{data:t,setupState:e,accessCache:r,ctx:n,appContext:i,propsOptions:s,type:o}},a){let c,u;return!!(r[a]||t!==be&&a[0]!=="$"&&xe(t,a)||zo(e,a)||(c=s[0])&&xe(c,a)||xe(n,a)||xe(In,a)||xe(i.config.globalProperties,a)||(u=o.__cssModules)&&u[a])},defineProperty(t,e,r){return r.get!=null?t._.accessCache[e]=0:xe(r,"value")&&this.set(t,e,r.value,null),Reflect.defineProperty(t,e,r)}};function Qi(t){return ae(t)?t.reduce((e,r)=>(e[r]=null,e),{}):t}function cu(t,e){return!t||!e?t||e:ae(t)&&ae(e)?t.concat(e):Je({},Qi(t),Qi(e))}let Vo=!0;function Vg(t){const e=fu(t),r=t.proxy,n=t.ctx;Vo=!1,e.beforeCreate&&lu(e.beforeCreate,t,"bc");const{data:i,computed:s,methods:o,watch:a,provide:c,inject:u,created:l,beforeMount:f,mounted:v,beforeUpdate:y,updated:b,activated:T,deactivated:H,beforeDestroy:B,beforeUnmount:R,destroyed:m,unmounted:p,render:h,renderTracked:P,renderTriggered:I,errorCaptured:N,serverPrefetch:J,expose:re,inheritAttrs:$e,components:Le,directives:Ke,filters:Qe}=e;if(u&&Kg(u,n,null),o)for(const ve in o){const _e=o[ve];ce(_e)&&(n[ve]=_e.bind(r))}if(i){const ve=i.call(r,r);Ie(ve)&&(t.data=jo(ve))}if(Vo=!0,s)for(const ve in s){const _e=s[ve],mt=ce(_e)?_e.bind(r,r):ce(_e.get)?_e.get.bind(r,r):$t,Xt=!ce(_e)&&ce(_e.set)?_e.set.bind(r):$t,Be=zu({get:mt,set:Xt});Object.defineProperty(n,ve,{enumerable:!0,configurable:!0,get:()=>Be.value,set:Xe=>Be.value=Xe})}if(a)for(const ve in a)uu(a[ve],n,r,ve);if(c){const ve=ce(c)?c.call(r):c;Reflect.ownKeys(ve).forEach(_e=>{mu(_e,ve[_e])})}l&&lu(l,t,"c");function Re(ve,_e){ae(_e)?_e.forEach(mt=>ve(mt.bind(r))):_e&&ve(_e.bind(r))}if(Re(iu,f),Re(qo,v),Re(jg,y),Re(Fg,b),Re(Dg,T),Re(Lg,H),Re(qg,N),Re(Wg,P),Re(Ug,I),Re(su,R),Re(ou,p),Re(Bg,J),ae(re))if(re.length){const ve=t.exposed||(t.exposed={});re.forEach(_e=>{Object.defineProperty(ve,_e,{get:()=>r[_e],set:mt=>r[_e]=mt,enumerable:!0})})}else t.exposed||(t.exposed={});h&&t.render===$t&&(t.render=h),$e!=null&&(t.inheritAttrs=$e),Le&&(t.components=Le),Ke&&(t.directives=Ke),J&&eu(t)}function Kg(t,e,r=$t){ae(t)&&(t=Ko(t));for(const n in t){const i=t[n];let s;Ie(i)?"default"in i?s=Tn(i.from||n,i.default,!0):s=Tn(i.from||n):s=Tn(i),Ve(s)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[n]=s}}function lu(t,e,r){Tt(ae(t)?t.map(n=>n.bind(e.proxy)):t.bind(e.proxy),e,r)}function uu(t,e,r,n){let i=n.includes(".")?ku(r,n):()=>r[n];if(De(t)){const s=e[t];ce(s)&&Rn(i,s)}else if(ce(t))Rn(i,t.bind(r));else if(Ie(t))if(ae(t))t.forEach(s=>uu(s,e,r,n));else{const s=ce(t.handler)?t.handler.bind(r):e[t.handler];ce(s)&&Rn(i,s,t)}}function fu(t){const e=t.type,{mixins:r,extends:n}=e,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let c;return a?c=a:!i.length&&!r&&!n?c=e:(c={},i.length&&i.forEach(u=>Xi(c,u,o,!0)),Xi(c,e,o)),Ie(e)&&s.set(e,c),c}function Xi(t,e,r,n=!1){const{mixins:i,extends:s}=e;s&&Xi(t,s,r,!0),i&&i.forEach(o=>Xi(t,o,r,!0));for(const o in e)if(!(n&&o==="expose")){const a=Jg[o]||r&&r[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const Jg={data:du,props:hu,emits:hu,methods:An,computed:An,beforeCreate:tt,created:tt,beforeMount:tt,mounted:tt,beforeUpdate:tt,updated:tt,beforeDestroy:tt,beforeUnmount:tt,destroyed:tt,unmounted:tt,activated:tt,deactivated:tt,errorCaptured:tt,serverPrefetch:tt,components:An,directives:An,watch:Gg,provide:du,inject:Yg};function du(t,e){return e?t?function(){return Je(ce(t)?t.call(this,this):t,ce(e)?e.call(this,this):e)}:e:t}function Yg(t,e){return An(Ko(t),Ko(e))}function Ko(t){if(ae(t)){const e={};for(let r=0;r<t.length;r++)e[t[r]]=t[r];return e}return t}function tt(t,e){return t?[...new Set([].concat(t,e))]:e}function An(t,e){return t?Je(Object.create(null),t,e):e}function hu(t,e){return t?ae(t)&&ae(e)?[...new Set([...t,...e])]:Je(Object.create(null),Qi(t),Qi(e??{})):e}function Gg(t,e){if(!t)return e;if(!e)return t;const r=Je(Object.create(null),t);for(const n in e)r[n]=tt(t[n],e[n]);return r}function pu(){return{app:null,config:{isNativeTag:hl,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Qg=0;function Xg(t,e){return function(n,i=null){ce(n)||(n=Je({},n)),i!=null&&!Ie(i)&&(i=null);const s=pu(),o=new WeakSet,a=[];let c=!1;const u=s.app={_uid:Qg++,_component:n,_props:i,_container:null,_context:s,_instance:null,version:My,get config(){return s.config},set config(l){},use(l,...f){return o.has(l)||(l&&ce(l.install)?(o.add(l),l.install(u,...f)):ce(l)&&(o.add(l),l(u,...f))),u},mixin(l){return s.mixins.includes(l)||s.mixins.push(l),u},component(l,f){return f?(s.components[l]=f,u):s.components[l]},directive(l,f){return f?(s.directives[l]=f,u):s.directives[l]},mount(l,f,v){if(!c){const y=u._ceVNode||or(n,i);return y.appContext=s,v===!0?v="svg":v===!1&&(v=void 0),t(y,l,v),c=!0,u._container=l,l.__vue_app__=u,is(y.component)}},onUnmount(l){a.push(l)},unmount(){c&&(Tt(a,u._instance,16),t(null,u._container),delete u._container.__vue_app__)},provide(l,f){return s.provides[l]=f,u},runWithContext(l){const f=Hr;Hr=u;try{return l()}finally{Hr=f}}};return u}}let Hr=null;function mu(t,e){if(rt){let r=rt.provides;const n=rt.parent&&rt.parent.provides;n===r&&(r=rt.provides=Object.create(n)),r[t]=e}}function Tn(t,e,r=!1){const n=ea();if(n||Hr){let i=Hr?Hr._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(i&&t in i)return i[t];if(arguments.length>1)return r&&ce(e)?e.call(n&&n.proxy):e}}const gu={},yu=()=>Object.create(gu),vu=t=>Object.getPrototypeOf(t)===gu;function Zg(t,e,r,n=!1){const i={},s=yu();t.propsDefaults=Object.create(null),bu(t,e,i,s);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);r?t.props=n?i:fg(i):t.type.props?t.props=i:t.props=s,t.attrs=s}function ey(t,e,r,n){const{props:i,attrs:s,vnode:{patchFlag:o}}=t,a=ye(i),[c]=t.propsOptions;let u=!1;if((n||o>0)&&!(o&16)){if(o&8){const l=t.vnode.dynamicProps;for(let f=0;f<l.length;f++){let v=l[f];if(es(t.emitsOptions,v))continue;const y=e[v];if(c)if(xe(s,v))y!==s[v]&&(s[v]=y,u=!0);else{const b=Vt(v);i[b]=Jo(c,a,b,y,t,!1)}else y!==s[v]&&(s[v]=y,u=!0)}}}else{bu(t,e,i,s)&&(u=!0);let l;for(const f in a)(!e||!xe(e,f)&&((l=nr(f))===f||!xe(e,l)))&&(c?r&&(r[f]!==void 0||r[l]!==void 0)&&(i[f]=Jo(c,a,f,void 0,t,!0)):delete i[f]);if(s!==a)for(const f in s)(!e||!xe(e,f))&&(delete s[f],u=!0)}u&&Kt(t.attrs,"set","")}function bu(t,e,r,n){const[i,s]=t.propsOptions;let o=!1,a;if(e)for(let c in e){if(_n(c))continue;const u=e[c];let l;i&&xe(i,l=Vt(c))?!s||!s.includes(l)?r[l]=u:(a||(a={}))[l]=u:es(t.emitsOptions,c)||(!(c in n)||u!==n[c])&&(n[c]=u,o=!0)}if(s){const c=ye(r),u=a||be;for(let l=0;l<s.length;l++){const f=s[l];r[f]=Jo(i,c,f,u[f],t,!xe(u,f))}}return o}function Jo(t,e,r,n,i,s){const o=t[r];if(o!=null){const a=xe(o,"default");if(a&&n===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&ce(c)){const{propsDefaults:u}=i;if(r in u)n=u[r];else{const l=jn(i);n=u[r]=c.call(null,e),l()}}else n=c;i.ce&&i.ce._setProp(r,n)}o[0]&&(s&&!a?n=!1:o[1]&&(n===""||n===nr(r))&&(n=!0))}return n}const ty=new WeakMap;function _u(t,e,r=!1){const n=r?ty:e.propsCache,i=n.get(t);if(i)return i;const s=t.props,o={},a=[];let c=!1;if(!ce(t)){const l=f=>{c=!0;const[v,y]=_u(f,e,!0);Je(o,v),y&&a.push(...y)};!r&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}if(!s&&!c)return Ie(t)&&n.set(t,Mr),Mr;if(ae(s))for(let l=0;l<s.length;l++){const f=Vt(s[l]);wu(f)&&(o[f]=be)}else if(s)for(const l in s){const f=Vt(l);if(wu(f)){const v=s[l],y=o[f]=ae(v)||ce(v)?{type:v}:Je({},v),b=y.type;let T=!1,H=!0;if(ae(b))for(let B=0;B<b.length;++B){const R=b[B],m=ce(R)&&R.name;if(m==="Boolean"){T=!0;break}else m==="String"&&(H=!1)}else T=ce(b)&&b.name==="Boolean";y[0]=T,y[1]=H,(T||xe(y,"default"))&&a.push(f)}}const u=[o,a];return Ie(t)&&n.set(t,u),u}function wu(t){return t[0]!=="$"&&!_n(t)}const Yo=t=>t==="_"||t==="_ctx"||t==="$stable",Go=t=>ae(t)?t.map(Nt):[Nt(t)],ry=(t,e,r)=>{if(e._n)return e;const n=$g((...i)=>Go(e(...i)),r);return n._c=!1,n},xu=(t,e,r)=>{const n=t._ctx;for(const i in t){if(Yo(i))continue;const s=t[i];if(ce(s))e[i]=ry(i,s,n);else if(s!=null){const o=Go(s);e[i]=()=>o}}},Su=(t,e)=>{const r=Go(e);t.slots.default=()=>r},Eu=(t,e,r)=>{for(const n in e)(r||!Yo(n))&&(t[n]=e[n])},ny=(t,e,r)=>{const n=t.slots=yu();if(t.vnode.shapeFlag&32){const i=e._;i?(Eu(n,e,r),r&&bl(n,"_",i,!0)):xu(e,n)}else e&&Su(t,e)},iy=(t,e,r)=>{const{vnode:n,slots:i}=t;let s=!0,o=be;if(n.shapeFlag&32){const a=e._;a?r&&a===1?s=!1:Eu(i,e,r):(s=!e.$stable,xu(e,i)),o=e}else e&&(Su(t,e),o={default:1});if(s)for(const a in i)!Yo(a)&&o[a]==null&&delete i[a]},ft=_y;function sy(t){return oy(t)}function oy(t,e){const r=Ti();r.__VUE__=!0;const{insert:n,remove:i,patchProp:s,createElement:o,createText:a,createComment:c,setText:u,setElementText:l,parentNode:f,nextSibling:v,setScopeId:y=$t,insertStaticContent:b}=t,T=(_,S,D,j=null,F=null,M=null,K=void 0,Y=null,V=!!S.dynamicChildren)=>{if(_===S)return;_&&!Mn(_,S)&&(j=jt(_),Xe(_,F,M,!0),_=null),S.patchFlag===-2&&(V=!1,S.dynamicChildren=null);const{type:U,ref:ne,shapeFlag:X}=S;switch(U){case ts:H(_,S,D,j);break;case zr:B(_,S,D,j);break;case Xo:_==null&&R(S,D,j,K);break;case Et:Le(_,S,D,j,F,M,K,Y,V);break;default:X&1?h(_,S,D,j,F,M,K,Y,V):X&6?Ke(_,S,D,j,F,M,K,Y,V):(X&64||X&128)&&U.process(_,S,D,j,F,M,K,Y,V,Zt)}ne!=null&&F?kn(ne,_&&_.ref,M,S||_,!S):ne==null&&_&&_.ref!=null&&kn(_.ref,null,M,_,!0)},H=(_,S,D,j)=>{if(_==null)n(S.el=a(S.children),D,j);else{const F=S.el=_.el;S.children!==_.children&&u(F,S.children)}},B=(_,S,D,j)=>{_==null?n(S.el=c(S.children||""),D,j):S.el=_.el},R=(_,S,D,j)=>{[_.el,_.anchor]=b(_.children,S,D,j,_.el,_.anchor)},m=({el:_,anchor:S},D,j)=>{let F;for(;_&&_!==S;)F=v(_),n(_,D,j),_=F;n(S,D,j)},p=({el:_,anchor:S})=>{let D;for(;_&&_!==S;)D=v(_),i(_),_=D;i(S)},h=(_,S,D,j,F,M,K,Y,V)=>{S.type==="svg"?K="svg":S.type==="math"&&(K="mathml"),_==null?P(S,D,j,F,M,K,Y,V):J(_,S,F,M,K,Y,V)},P=(_,S,D,j,F,M,K,Y)=>{let V,U;const{props:ne,shapeFlag:X,transition:te,dirs:ie}=_;if(V=_.el=o(_.type,M,ne&&ne.is,ne),X&8?l(V,_.children):X&16&&N(_.children,V,null,j,F,Qo(_,M),K,Y),ie&&_r(_,null,j,"created"),I(V,_,_.scopeId,K,j),ne){for(const we in ne)we!=="value"&&!_n(we)&&s(V,we,null,ne[we],M,j);"value"in ne&&s(V,"value",null,ne.value,M),(U=ne.onVnodeBeforeMount)&&Dt(U,j,_)}ie&&_r(_,null,j,"beforeMount");const ue=ay(F,te);ue&&te.beforeEnter(V),n(V,S,D),((U=ne&&ne.onVnodeMounted)||ue||ie)&&ft(()=>{U&&Dt(U,j,_),ue&&te.enter(V),ie&&_r(_,null,j,"mounted")},F)},I=(_,S,D,j,F)=>{if(D&&y(_,D),j)for(let M=0;M<j.length;M++)y(_,j[M]);if(F){let M=F.subTree;if(S===M||Nu(M.type)&&(M.ssContent===S||M.ssFallback===S)){const K=F.vnode;I(_,K,K.scopeId,K.slotScopeIds,F.parent)}}},N=(_,S,D,j,F,M,K,Y,V=0)=>{for(let U=V;U<_.length;U++){const ne=_[U]=Y?ar(_[U]):Nt(_[U]);T(null,ne,S,D,j,F,M,K,Y)}},J=(_,S,D,j,F,M,K)=>{const Y=S.el=_.el;let{patchFlag:V,dynamicChildren:U,dirs:ne}=S;V|=_.patchFlag&16;const X=_.props||be,te=S.props||be;let ie;if(D&&wr(D,!1),(ie=te.onVnodeBeforeUpdate)&&Dt(ie,D,S,_),ne&&_r(S,_,D,"beforeUpdate"),D&&wr(D,!0),(X.innerHTML&&te.innerHTML==null||X.textContent&&te.textContent==null)&&l(Y,""),U?re(_.dynamicChildren,U,Y,D,j,Qo(S,F),M):K||_e(_,S,Y,null,D,j,Qo(S,F),M,!1),V>0){if(V&16)$e(Y,X,te,D,F);else if(V&2&&X.class!==te.class&&s(Y,"class",null,te.class,F),V&4&&s(Y,"style",X.style,te.style,F),V&8){const ue=S.dynamicProps;for(let we=0;we<ue.length;we++){const me=ue[we],Ae=X[me],Me=te[me];(Me!==Ae||me==="value")&&s(Y,me,Ae,Me,F,D)}}V&1&&_.children!==S.children&&l(Y,S.children)}else!K&&U==null&&$e(Y,X,te,D,F);((ie=te.onVnodeUpdated)||ne)&&ft(()=>{ie&&Dt(ie,D,S,_),ne&&_r(S,_,D,"updated")},j)},re=(_,S,D,j,F,M,K)=>{for(let Y=0;Y<S.length;Y++){const V=_[Y],U=S[Y],ne=V.el&&(V.type===Et||!Mn(V,U)||V.shapeFlag&198)?f(V.el):D;T(V,U,ne,null,j,F,M,K,!0)}},$e=(_,S,D,j,F)=>{if(S!==D){if(S!==be)for(const M in S)!_n(M)&&!(M in D)&&s(_,M,S[M],null,F,j);for(const M in D){if(_n(M))continue;const K=D[M],Y=S[M];K!==Y&&M!=="value"&&s(_,M,Y,K,F,j)}"value"in D&&s(_,"value",S.value,D.value,F)}},Le=(_,S,D,j,F,M,K,Y,V)=>{const U=S.el=_?_.el:a(""),ne=S.anchor=_?_.anchor:a("");let{patchFlag:X,dynamicChildren:te,slotScopeIds:ie}=S;ie&&(Y=Y?Y.concat(ie):ie),_==null?(n(U,D,j),n(ne,D,j),N(S.children||[],D,ne,F,M,K,Y,V)):X>0&&X&64&&te&&_.dynamicChildren?(re(_.dynamicChildren,te,D,F,M,K,Y),(S.key!=null||F&&S===F.subTree)&&Ou(_,S,!0)):_e(_,S,D,ne,F,M,K,Y,V)},Ke=(_,S,D,j,F,M,K,Y,V)=>{S.slotScopeIds=Y,_==null?S.shapeFlag&512?F.ctx.activate(S,D,j,K,V):Qe(S,D,j,F,M,K,V):pt(_,S,V)},Qe=(_,S,D,j,F,M,K)=>{const Y=_.component=ky(_,j,F);if(ru(_)&&(Y.ctx.renderer=Zt),$y(Y,!1,K),Y.asyncDep){if(F&&F.registerDep(Y,Re,K),!_.el){const V=Y.subTree=or(zr);B(null,V,S,D),_.placeholder=V.el}}else Re(Y,_,S,D,F,M,K)},pt=(_,S,D)=>{const j=S.component=_.component;if(vy(_,S,D))if(j.asyncDep&&!j.asyncResolved){ve(j,S,D);return}else j.next=S,j.update();else S.el=_.el,j.vnode=S},Re=(_,S,D,j,F,M,K)=>{const Y=()=>{if(_.isMounted){let{next:X,bu:te,u:ie,parent:ue,vnode:we}=_;{const it=Pu(_);if(it){X&&(X.el=we.el,ve(_,X,K)),it.asyncDep.then(()=>{_.isUnmounted||Y()});return}}let me=X,Ae;wr(_,!1),X?(X.el=we.el,ve(_,X,K)):X=we,te&&Oo(te),(Ae=X.props&&X.props.onVnodeBeforeUpdate)&&Dt(Ae,ue,X,we),wr(_,!0);const Me=Tu(_),Ze=_.subTree;_.subTree=Me,T(Ze,Me,f(Ze.el),jt(Ze),_,F,M),X.el=Me.el,me===null&&by(_,Me.el),ie&&ft(ie,F),(Ae=X.props&&X.props.onVnodeUpdated)&&ft(()=>Dt(Ae,ue,X,we),F)}else{let X;const{el:te,props:ie}=S,{bm:ue,m:we,parent:me,root:Ae,type:Me}=_,Ze=$n(S);wr(_,!1),ue&&Oo(ue),!Ze&&(X=ie&&ie.onVnodeBeforeMount)&&Dt(X,me,S),wr(_,!0);{Ae.ce&&Ae.ce._def.shadowRoot!==!1&&Ae.ce._injectChildStyle(Me);const it=_.subTree=Tu(_);T(null,it,D,j,_,F,M),S.el=it.el}if(we&&ft(we,F),!Ze&&(X=ie&&ie.onVnodeMounted)){const it=S;ft(()=>Dt(X,me,it),F)}(S.shapeFlag&256||me&&$n(me.vnode)&&me.vnode.shapeFlag&256)&&_.a&&ft(_.a,F),_.isMounted=!0,S=D=j=null}};_.scope.on();const V=_.effect=new El(Y);_.scope.off();const U=_.update=V.run.bind(V),ne=_.job=V.runIfDirty.bind(V);ne.i=_,ne.id=_.uid,V.scheduler=()=>Uo(ne),wr(_,!0),U()},ve=(_,S,D)=>{S.component=_;const j=_.vnode.props;_.vnode=S,_.next=null,ey(_,S.props,j,D),iy(_,S.children,D),It(),Yl(_),At()},_e=(_,S,D,j,F,M,K,Y,V=!1)=>{const U=_&&_.children,ne=_?_.shapeFlag:0,X=S.children,{patchFlag:te,shapeFlag:ie}=S;if(te>0){if(te&128){Xt(U,X,D,j,F,M,K,Y,V);return}else if(te&256){mt(U,X,D,j,F,M,K,Y,V);return}}ie&8?(ne&16&&nt(U,F,M),X!==U&&l(D,X)):ne&16?ie&16?Xt(U,X,D,j,F,M,K,Y,V):nt(U,F,M,!0):(ne&8&&l(D,""),ie&16&&N(X,D,j,F,M,K,Y,V))},mt=(_,S,D,j,F,M,K,Y,V)=>{_=_||Mr,S=S||Mr;const U=_.length,ne=S.length,X=Math.min(U,ne);let te;for(te=0;te<X;te++){const ie=S[te]=V?ar(S[te]):Nt(S[te]);T(_[te],ie,D,null,F,M,K,Y,V)}U>ne?nt(_,F,M,!0,!1,X):N(S,D,j,F,M,K,Y,V,X)},Xt=(_,S,D,j,F,M,K,Y,V)=>{let U=0;const ne=S.length;let X=_.length-1,te=ne-1;for(;U<=X&&U<=te;){const ie=_[U],ue=S[U]=V?ar(S[U]):Nt(S[U]);if(Mn(ie,ue))T(ie,ue,D,null,F,M,K,Y,V);else break;U++}for(;U<=X&&U<=te;){const ie=_[X],ue=S[te]=V?ar(S[te]):Nt(S[te]);if(Mn(ie,ue))T(ie,ue,D,null,F,M,K,Y,V);else break;X--,te--}if(U>X){if(U<=te){const ie=te+1,ue=ie<ne?S[ie].el:j;for(;U<=te;)T(null,S[U]=V?ar(S[U]):Nt(S[U]),D,ue,F,M,K,Y,V),U++}}else if(U>te)for(;U<=X;)Xe(_[U],F,M,!0),U++;else{const ie=U,ue=U,we=new Map;for(U=ue;U<=te;U++){const Ue=S[U]=V?ar(S[U]):Nt(S[U]);Ue.key!=null&&we.set(Ue.key,U)}let me,Ae=0;const Me=te-ue+1;let Ze=!1,it=0;const Ft=new Array(Me);for(U=0;U<Me;U++)Ft[U]=0;for(U=ie;U<=X;U++){const Ue=_[U];if(Ae>=Me){Xe(Ue,F,M,!0);continue}let k;if(Ue.key!=null)k=we.get(Ue.key);else for(me=ue;me<=te;me++)if(Ft[me-ue]===0&&Mn(Ue,S[me])){k=me;break}k===void 0?Xe(Ue,F,M,!0):(Ft[k-ue]=U+1,k>=it?it=k:Ze=!0,T(Ue,S[k],D,null,F,M,K,Y,V),Ae++)}const Bt=Ze?cy(Ft):Mr;for(me=Bt.length-1,U=Me-1;U>=0;U--){const Ue=ue+U,k=S[Ue],A=S[Ue+1],de=Ue+1<ne?A.el||A.placeholder:j;Ft[U]===0?T(null,k,D,de,F,M,K,Y,V):Ze&&(me<0||U!==Bt[me]?Be(k,D,de,2):me--)}}},Be=(_,S,D,j,F=null)=>{const{el:M,type:K,transition:Y,children:V,shapeFlag:U}=_;if(U&6){Be(_.component.subTree,S,D,j);return}if(U&128){_.suspense.move(S,D,j);return}if(U&64){K.move(_,S,D,Zt);return}if(K===Et){n(M,S,D);for(let X=0;X<V.length;X++)Be(V[X],S,D,j);n(_.anchor,S,D);return}if(K===Xo){m(_,S,D);return}if(j!==2&&U&1&&Y)if(j===0)Y.beforeEnter(M),n(M,S,D),ft(()=>Y.enter(M),F);else{const{leave:X,delayLeave:te,afterLeave:ie}=Y,ue=()=>{_.ctx.isUnmounted?i(M):n(M,S,D)},we=()=>{M._isLeaving&&M[Rg](!0),X(M,()=>{ue(),ie&&ie()})};te?te(M,ue,we):we()}else n(M,S,D)},Xe=(_,S,D,j=!1,F=!1)=>{const{type:M,props:K,ref:Y,children:V,dynamicChildren:U,shapeFlag:ne,patchFlag:X,dirs:te,cacheIndex:ie}=_;if(X===-2&&(F=!1),Y!=null&&(It(),kn(Y,null,D,_,!0),At()),ie!=null&&(S.renderCache[ie]=void 0),ne&256){S.ctx.deactivate(_);return}const ue=ne&1&&te,we=!$n(_);let me;if(we&&(me=K&&K.onVnodeBeforeUnmount)&&Dt(me,S,_),ne&6)qn(_.component,D,j);else{if(ne&128){_.suspense.unmount(D,j);return}ue&&_r(_,null,S,"beforeUnmount"),ne&64?_.type.remove(_,S,D,Zt,j):U&&!U.hasOnce&&(M!==Et||X>0&&X&64)?nt(U,S,D,!1,!0):(M===Et&&X&384||!F&&ne&16)&&nt(V,S,D),j&&an(_)}(we&&(me=K&&K.onVnodeUnmounted)||ue)&&ft(()=>{me&&Dt(me,S,_),ue&&_r(_,null,S,"unmounted")},D)},an=_=>{const{type:S,el:D,anchor:j,transition:F}=_;if(S===Et){cn(D,j);return}if(S===Xo){p(_);return}const M=()=>{i(D),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(_.shapeFlag&1&&F&&!F.persisted){const{leave:K,delayLeave:Y}=F,V=()=>K(D,M);Y?Y(_.el,M,V):V()}else M()},cn=(_,S)=>{let D;for(;_!==S;)D=v(_),i(_),_=D;i(S)},qn=(_,S,D)=>{const{bum:j,scope:F,job:M,subTree:K,um:Y,m:V,a:U}=_;Cu(V),Cu(U),j&&Oo(j),F.stop(),M&&(M.flags|=8,Xe(K,_,S,D)),Y&&ft(Y,S),ft(()=>{_.isUnmounted=!0},S)},nt=(_,S,D,j=!1,F=!1,M=0)=>{for(let K=M;K<_.length;K++)Xe(_[K],S,D,j,F)},jt=_=>{if(_.shapeFlag&6)return jt(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();const S=v(_.anchor||_.el),D=S&&S[Ag];return D?v(D):S};let Pr=!1;const Cr=(_,S,D)=>{_==null?S._vnode&&Xe(S._vnode,null,null,!0):T(S._vnode||null,_,S,null,null,null,D),S._vnode=_,Pr||(Pr=!0,Yl(),Gl(),Pr=!1)},Zt={p:T,um:Xe,m:Be,r:an,mt:Qe,mc:N,pc:_e,pbc:re,n:jt,o:t};return{render:Cr,hydrate:void 0,createApp:Xg(Cr)}}function Qo({type:t,props:e},r){return r==="svg"&&t==="foreignObject"||r==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:r}function wr({effect:t,job:e},r){r?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function ay(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Ou(t,e,r=!1){const n=t.children,i=e.children;if(ae(n)&&ae(i))for(let s=0;s<n.length;s++){const o=n[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=ar(i[s]),a.el=o.el),!r&&a.patchFlag!==-2&&Ou(o,a)),a.type===ts&&a.patchFlag!==-1&&(a.el=o.el),a.type===zr&&!a.el&&(a.el=o.el)}}function cy(t){const e=t.slice(),r=[0];let n,i,s,o,a;const c=t.length;for(n=0;n<c;n++){const u=t[n];if(u!==0){if(i=r[r.length-1],t[i]<u){e[n]=i,r.push(n);continue}for(s=0,o=r.length-1;s<o;)a=s+o>>1,t[r[a]]<u?s=a+1:o=a;u<t[r[s]]&&(s>0&&(e[n]=r[s-1]),r[s]=n)}}for(s=r.length,o=r[s-1];s-- >0;)r[s]=o,o=e[o];return r}function Pu(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Pu(e)}function Cu(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}const ly=Symbol.for("v-scx"),uy=()=>Tn(ly);function fy(t,e){return Zi(t,null,e)}function dy(t,e){return Zi(t,null,{flush:"sync"})}function Rn(t,e,r){return Zi(t,e,r)}function Zi(t,e,r=be){const{immediate:n,deep:i,flush:s,once:o}=r,a=Je({},r),c=e&&n||!e&&s!=="post";let u;if(Fn){if(s==="sync"){const y=uy();u=y.__watcherHandles||(y.__watcherHandles=[])}else if(!c){const y=()=>{};return y.stop=$t,y.resume=$t,y.pause=$t,y}}const l=rt;a.call=(y,b,T)=>Tt(y,l,b,T);let f=!1;s==="post"?a.scheduler=y=>{ft(y,l&&l.suspense)}:s!=="sync"&&(f=!0,a.scheduler=(y,b)=>{b?y():Uo(y)}),a.augmentJob=y=>{e&&(y.flags|=4),f&&(y.flags|=2,l&&(y.id=l.uid,y.i=l))};const v=wg(t,e,a);return Fn&&(u?u.push(v):c&&v()),v}function hy(t,e,r){const n=this.proxy,i=De(t)?t.includes(".")?ku(n,t):()=>n[t]:t.bind(n,n);let s;ce(e)?s=e:(s=e.handler,r=e);const o=jn(this),a=Zi(i,s.bind(n),r);return o(),a}function ku(t,e){const r=e.split(".");return()=>{let n=t;for(let i=0;i<r.length&&n;i++)n=n[r[i]];return n}}function $u(t,e,r=be){const n=ea(),i=Vt(e),s=nr(e),o=Iu(t,i),a=yg((c,u)=>{let l,f=be,v;return dy(()=>{const y=t[i];ct(l,y)&&(l=y,u())}),{get(){return c(),r.get?r.get(l):l},set(y){const b=r.set?r.set(y):y;if(!ct(b,l)&&!(f!==be&&ct(y,f)))return;const T=n.vnode.props;T&&(e in T||i in T||s in T)&&(`onUpdate:${e}`in T||`onUpdate:${i}`in T||`onUpdate:${s}`in T)||(l=y,u()),n.emit(`update:${e}`,b),ct(y,b)&&ct(y,f)&&!ct(b,v)&&u(),f=y,v=b}}});return a[Symbol.iterator]=()=>{let c=0;return{next(){return c<2?{value:c++?o||be:a,done:!1}:{done:!0}}}},a}const Iu=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Vt(e)}Modifiers`]||t[`${nr(e)}Modifiers`];function py(t,e,...r){if(t.isUnmounted)return;const n=t.vnode.props||be;let i=r;const s=e.startsWith("update:"),o=s&&Iu(n,e.slice(7));o&&(o.trim&&(i=r.map(l=>De(l)?l.trim():l)),o.number&&(i=r.map(Fm)));let a,c=n[a=Eo(e)]||n[a=Eo(Vt(e))];!c&&s&&(c=n[a=Eo(nr(e))]),c&&Tt(c,t,6,i);const u=n[a+"Once"];if(u){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,Tt(u,t,6,i)}}const my=new WeakMap;function Au(t,e,r=!1){const n=r?my:e.emitsCache,i=n.get(t);if(i!==void 0)return i;const s=t.emits;let o={},a=!1;if(!ce(t)){const c=u=>{const l=Au(u,e,!0);l&&(a=!0,Je(o,l))};!r&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}return!s&&!a?(Ie(t)&&n.set(t,null),null):(ae(s)?s.forEach(c=>o[c]=null):Je(o,s),Ie(t)&&n.set(t,o),o)}function es(t,e){return!t||!$i(e)?!1:(e=e.slice(2).replace(/Once$/,""),xe(t,e[0].toLowerCase()+e.slice(1))||xe(t,nr(e))||xe(t,e))}function ob(){}function Tu(t){const{type:e,vnode:r,proxy:n,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:c,render:u,renderCache:l,props:f,data:v,setupState:y,ctx:b,inheritAttrs:T}=t,H=Ji(t);let B,R;try{if(r.shapeFlag&4){const p=i||n,h=p;B=Nt(u.call(h,p,l,f,y,v,b)),R=a}else{const p=e;B=Nt(p.length>1?p(f,{attrs:a,slots:o,emit:c}):p(f,null)),R=e.props?a:gy(a)}}catch(p){Nn.length=0,zi(p,t,1),B=or(zr)}let m=B;if(R&&T!==!1){const p=Object.keys(R),{shapeFlag:h}=m;p.length&&h&7&&(s&&p.some(wo)&&(R=yy(R,s)),m=Kr(m,R,!1,!0))}return r.dirs&&(m=Kr(m,null,!1,!0),m.dirs=m.dirs?m.dirs.concat(r.dirs):r.dirs),r.transition&&Wo(m,r.transition),B=m,Ji(H),B}const gy=t=>{let e;for(const r in t)(r==="class"||r==="style"||$i(r))&&((e||(e={}))[r]=t[r]);return e},yy=(t,e)=>{const r={};for(const n in t)(!wo(n)||!(n.slice(9)in e))&&(r[n]=t[n]);return r};function vy(t,e,r){const{props:n,children:i,component:s}=t,{props:o,children:a,patchFlag:c}=e,u=s.emitsOptions;if(e.dirs||e.transition)return!0;if(r&&c>=0){if(c&1024)return!0;if(c&16)return n?Ru(n,o,u):!!o;if(c&8){const l=e.dynamicProps;for(let f=0;f<l.length;f++){const v=l[f];if(o[v]!==n[v]&&!es(u,v))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:n===o?!1:n?o?Ru(n,o,u):!0:!!o;return!1}function Ru(t,e,r){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let i=0;i<n.length;i++){const s=n[i];if(e[s]!==t[s]&&!es(r,s))return!0}return!1}function by({vnode:t,parent:e},r){for(;e;){const n=e.subTree;if(n.suspense&&n.suspense.activeBranch===t&&(n.el=t.el),n===t)(t=e.vnode).el=r,e=e.parent;else break}}const Nu=t=>t.__isSuspense;function _y(t,e){e&&e.pendingBranch?ae(t)?e.effects.push(...t):e.effects.push(t):kg(t)}const Et=Symbol.for("v-fgt"),ts=Symbol.for("v-txt"),zr=Symbol.for("v-cmt"),Xo=Symbol.for("v-stc"),Nn=[];let dt=null;function Vr(t=!1){Nn.push(dt=t?null:[])}function wy(){Nn.pop(),dt=Nn[Nn.length-1]||null}let Dn=1;function Du(t,e=!1){Dn+=t,t<0&&dt&&e&&(dt.hasOnce=!0)}function Lu(t){return t.dynamicChildren=Dn>0?dt||Mr:null,wy(),Dn>0&&dt&&dt.push(t),t}function Ln(t,e,r,n,i,s){return Lu(xr(t,e,r,n,i,s,!0))}function xy(t,e,r,n,i){return Lu(or(t,e,r,n,i,!0))}function Mu(t){return t?t.__v_isVNode===!0:!1}function Mn(t,e){return t.type===e.type&&t.key===e.key}const ju=({key:t})=>t??null,rs=({ref:t,ref_key:e,ref_for:r})=>(typeof t=="number"&&(t=""+t),t!=null?De(t)||Ve(t)||ce(t)?{i:bt,r:t,k:e,f:!!r}:t:null);function xr(t,e=null,r=null,n=0,i=null,s=t===Et?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&ju(e),ref:e&&rs(e),scopeId:Xl,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:bt};return a?(Zo(c,r),s&128&&t.normalize(c)):r&&(c.shapeFlag|=De(r)?8:16),Dn>0&&!o&&dt&&(c.patchFlag>0||s&6)&&c.patchFlag!==32&&dt.push(c),c}const or=Sy;function Sy(t,e=null,r=null,n=0,i=null,s=!1){if((!t||t===Hg)&&(t=zr),Mu(t)){const a=Kr(t,e,!0);return r&&Zo(a,r),Dn>0&&!s&&dt&&(a.shapeFlag&6?dt[dt.indexOf(t)]=a:dt.push(a)),a.patchFlag=-2,a}if(Ly(t)&&(t=t.__vccOpts),e){e=Ey(e);let{class:a,style:c}=e;a&&!De(a)&&(e.class=Ri(a)),Ie(c)&&(Fo(c)&&!ae(c)&&(c=Je({},c)),e.style=Po(c))}const o=De(t)?1:Nu(t)?128:Tg(t)?64:Ie(t)?4:ce(t)?2:0;return xr(t,e,r,n,i,o,s,!0)}function Ey(t){return t?Fo(t)||vu(t)?Je({},t):t:null}function Kr(t,e,r=!1,n=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:c}=t,u=e?Fu(i||{},e):i,l={__v_isVNode:!0,__v_skip:!0,type:t.type,props:u,key:u&&ju(u),ref:e&&e.ref?r&&s?ae(s)?s.concat(rs(e)):[s,rs(e)]:rs(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Et?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Kr(t.ssContent),ssFallback:t.ssFallback&&Kr(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&n&&Wo(l,c.clone(l)),l}function Oy(t=" ",e=0){return or(ts,null,t,e)}function Nt(t){return t==null||typeof t=="boolean"?or(zr):ae(t)?or(Et,null,t.slice()):Mu(t)?ar(t):or(ts,null,String(t))}function ar(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Kr(t)}function Zo(t,e){let r=0;const{shapeFlag:n}=t;if(e==null)e=null;else if(ae(e))r=16;else if(typeof e=="object")if(n&65){const i=e.default;i&&(i._c&&(i._d=!1),Zo(t,i()),i._c&&(i._d=!0));return}else{r=32;const i=e._;!i&&!vu(e)?e._ctx=bt:i===3&&bt&&(bt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ce(e)?(e={default:e,_ctx:bt},r=32):(e=String(e),n&64?(r=16,e=[Oy(e)]):r=8);t.children=e,t.shapeFlag|=r}function Fu(...t){const e={};for(let r=0;r<t.length;r++){const n=t[r];for(const i in n)if(i==="class")e.class!==n.class&&(e.class=Ri([e.class,n.class]));else if(i==="style")e.style=Po([e.style,n.style]);else if($i(i)){const s=e[i],o=n[i];o&&s!==o&&!(ae(s)&&s.includes(o))&&(e[i]=s?[].concat(s,o):o)}else i!==""&&(e[i]=n[i])}return e}function Dt(t,e,r,n=null){Tt(t,e,7,[r,n])}const Py=pu();let Cy=0;function ky(t,e,r){const n=t.type,i=(e?e.appContext:t.appContext)||Py,s={uid:Cy++,vnode:t,type:n,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new zm(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:_u(n,i),emitsOptions:Au(n,i),emit:null,emitted:null,propsDefaults:be,inheritAttrs:n.inheritAttrs,ctx:be,data:be,props:be,attrs:be,slots:be,refs:be,setupState:be,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=py.bind(null,s),t.ce&&t.ce(s),s}let rt=null;const ea=()=>rt||bt;let ns,ta;{const t=Ti(),e=(r,n)=>{let i;return(i=t[r])||(i=t[r]=[]),i.push(n),s=>{i.length>1?i.forEach(o=>o(s)):i[0](s)}};ns=e("__VUE_INSTANCE_SETTERS__",r=>rt=r),ta=e("__VUE_SSR_SETTERS__",r=>Fn=r)}const jn=t=>{const e=rt;return ns(t),t.scope.on(),()=>{t.scope.off(),ns(e)}},Bu=()=>{rt&&rt.scope.off(),ns(null)};function Uu(t){return t.vnode.shapeFlag&4}let Fn=!1;function $y(t,e=!1,r=!1){e&&ta(e);const{props:n,children:i}=t.vnode,s=Uu(t);Zg(t,n,s,e),ny(t,i,r||e);const o=s?Iy(t,e):void 0;return e&&ta(!1),o}function Iy(t,e){const r=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,zg);const{setup:n}=r;if(n){It();const i=t.setupContext=n.length>1?Ty(t):null,s=jn(t),o=Ur(n,t,0,[t.props,i]),a=ml(o);if(At(),s(),(a||t.sp)&&!$n(t)&&eu(t),a){if(o.then(Bu,Bu),e)return o.then(c=>{Wu(t,c)}).catch(c=>{zi(c,t,0)});t.asyncDep=o}else Wu(t,o)}else qu(t)}function Wu(t,e,r){ce(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Ie(e)&&(t.setupState=zl(e)),qu(t)}function qu(t,e,r){const n=t.type;t.render||(t.render=n.render||$t);{const i=jn(t);It();try{Vg(t)}finally{At(),i()}}}const Ay={get(t,e){return Ge(t,"get",""),t[e]}};function Ty(t){const e=r=>{t.exposed=r||{}};return{attrs:new Proxy(t.attrs,Ay),slots:t.slots,emit:t.emit,expose:e}}function is(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(zl(dg(t.exposed)),{get(e,r){if(r in e)return e[r];if(r in In)return In[r](t)},has(e,r){return r in e||r in In}})):t.proxy}const Ry=/(?:^|[-_])\w/g,Ny=t=>t.replace(Ry,e=>e.toUpperCase()).replace(/[-_]/g,"");function Dy(t,e=!0){return ce(t)?t.displayName||t.name:t.name||e&&t.__name}function Hu(t,e,r=!1){let n=Dy(e);if(!n&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(n=i[1])}if(!n&&t&&t.parent){const i=s=>{for(const o in s)if(s[o]===e)return o};n=i(t.components||t.parent.type.components)||i(t.appContext.components)}return n?Ny(n):r?"App":"Anonymous"}function Ly(t){return ce(t)&&"__vccOpts"in t}const zu=(t,e)=>bg(t,e,Fn),My="3.5.21";/**
82
82
  * @vue/runtime-dom v3.5.21
83
83
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
84
84
  * @license MIT
85
- **/let ta;const Wu=typeof window<"u"&&window.trustedTypes;if(Wu)try{ta=Wu.createPolicy("vue",{createHTML:t=>t})}catch{}const qu=ta?t=>ta.createHTML(t):t=>t,Oy="http://www.w3.org/2000/svg",Cy="http://www.w3.org/1998/Math/MathML",Gt=typeof document<"u"?document:null,Hu=Gt&&Gt.createElement("template"),Py={insert:(t,e,r)=>{e.insertBefore(t,r||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,r,n)=>{const i=e==="svg"?Gt.createElementNS(Oy,t):e==="mathml"?Gt.createElementNS(Cy,t):r?Gt.createElement(t,{is:r}):Gt.createElement(t);return t==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:t=>Gt.createTextNode(t),createComment:t=>Gt.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Gt.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,r,n,i,s){const o=r?r.previousSibling:e.lastChild;if(i&&(i===s||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),r),!(i===s||!(i=i.nextSibling)););else{Hu.innerHTML=qu(n==="svg"?`<svg>${t}</svg>`:n==="mathml"?`<math>${t}</math>`:t);const a=Hu.content;if(n==="svg"||n==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,r)}return[o?o.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}},$y=Symbol("_vtc");function ky(t,e,r){const n=t[$y];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):r?t.setAttribute("class",e):t.className=e}const ss=Symbol("_vod"),zu=Symbol("_vsh"),Iy={name:"show",beforeMount(t,{value:e},{transition:r}){t[ss]=t.style.display==="none"?"":t.style.display,r&&e?r.beforeEnter(t):Bn(t,e)},mounted(t,{value:e},{transition:r}){r&&e&&r.enter(t)},updated(t,{value:e,oldValue:r},{transition:n}){!e!=!r&&(n?e?(n.beforeEnter(t),Bn(t,!0),n.enter(t)):n.leave(t,()=>{Bn(t,!1)}):Bn(t,e))},beforeUnmount(t,{value:e}){Bn(t,e)}};function Bn(t,e){t.style.display=e?t[ss]:"none",t[zu]=!e}const Ay=Symbol(""),Ty=/(?:^|;)\s*display\s*:/;function Ry(t,e,r){const n=t.style,i=De(r);let s=!1;if(r&&!i){if(e)if(De(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();r[a]==null&&os(n,a,"")}else for(const o in e)r[o]==null&&os(n,o,"");for(const o in r)o==="display"&&(s=!0),os(n,o,r[o])}else if(i){if(e!==r){const o=n[Ay];o&&(r+=";"+o),n.cssText=r,s=Ty.test(r)}}else e&&t.removeAttribute("style");ss in t&&(t[ss]=s?n.display:"",t[zu]&&(n.display="none"))}const Vu=/\s*!important$/;function os(t,e,r){if(ae(r))r.forEach(n=>os(t,e,n));else if(r==null&&(r=""),e.startsWith("--"))t.setProperty(e,r);else{const n=Dy(t,e);Vu.test(r)?t.setProperty(rr(n),r.replace(Vu,""),"important"):t[n]=r}}const Ku=["Webkit","Moz","ms"],ra={};function Dy(t,e){const r=ra[e];if(r)return r;let n=zt(e);if(n!=="filter"&&n in t)return ra[e]=n;n=gl(n);for(let i=0;i<Ku.length;i++){const s=Ku[i]+n;if(s in t)return ra[e]=s}return e}const Ju="http://www.w3.org/1999/xlink";function Yu(t,e,r,n,i,s=km(e)){n&&e.startsWith("xlink:")?r==null?t.removeAttributeNS(Ju,e.slice(6,e.length)):t.setAttributeNS(Ju,e,r):r==null||s&&!bl(r)?t.removeAttribute(e):t.setAttribute(e,s?"":tr(r)?String(r):r)}function Gu(t,e,r,n,i){if(e==="innerHTML"||e==="textContent"){r!=null&&(t[e]=e==="innerHTML"?qu(r):r);return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?t.getAttribute("value")||"":t.value,c=r==null?t.type==="checkbox"?"on":"":String(r);(a!==c||!("_value"in t))&&(t.value=c),r==null&&t.removeAttribute(e),t._value=r;return}let o=!1;if(r===""||r==null){const a=typeof t[e];a==="boolean"?r=bl(r):r==null&&a==="string"?(r="",o=!0):a==="number"&&(r=0,o=!0)}try{t[e]=r}catch{}o&&t.removeAttribute(i||e)}function Ny(t,e,r,n){t.addEventListener(e,r,n)}function Ly(t,e,r,n){t.removeEventListener(e,r,n)}const Qu=Symbol("_vei");function My(t,e,r,n,i=null){const s=t[Qu]||(t[Qu]={}),o=s[e];if(n&&o)o.value=n;else{const[a,c]=Fy(e);if(n){const l=s[e]=Uy(n,i);Ny(t,a,l,c)}else o&&(Ly(t,a,o,c),s[e]=void 0)}}const Xu=/(?:Once|Passive|Capture)$/;function Fy(t){let e;if(Xu.test(t)){e={};let n;for(;n=t.match(Xu);)t=t.slice(0,t.length-n[0].length),e[n[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):rr(t.slice(2)),e]}let na=0;const jy=Promise.resolve(),By=()=>na||(jy.then(()=>na=0),na=Date.now());function Uy(t,e){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;At(Wy(n,r.value),e,5,[n])};return r.value=t,r.attached=By(),r}function Wy(t,e){if(ae(e)){const r=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{r.call(t),t._stopped=!0},e.map(n=>i=>!i._stopped&&n&&n(i))}else return e}const Zu=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,qy=(t,e,r,n,i,s)=>{const o=i==="svg";e==="class"?ky(t,n,o):e==="style"?Ry(t,r,n):ki(e)?_o(e)||My(t,e,r,n,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Hy(t,e,n,o))?(Gu(t,e,n),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Yu(t,e,n,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!De(n))?Gu(t,zt(e),n,s,e):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),Yu(t,e,n,o))};function Hy(t,e,r,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in t&&Zu(e)&&ce(r));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Zu(e)&&De(r)?!1:e in t}const zy=Ke({patchProp:qy},Py);let ef;function Vy(){return ef||(ef=Vg(zy))}const Ky=(...t)=>{const e=Vy().createApp(...t),{mount:r}=e;return e.mount=n=>{const i=Yy(n);if(!i)return;const s=e._component;!ce(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=r(i,!1,Jy(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function Jy(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Yy(t){return De(t)?document.querySelector(t):t}const ia=Symbol("IPEInjectKey"),Gy=(t,e)=>(e?e.provide(ia,t):fu(ia,t),t),Qy=()=>Tn(ia),bt=":host{all:initial;font-family:var(--schema-font-family, ui-sans-serif, system-ui, -apple-system)}*,*:before,*:after{box-sizing:border-box}:host{color:var(--schema-color-fg, #111827)}:host{--schema-radius: var(--schema-radius, 10px)}.wrapper{display:block;background:var(--schema-color-bg, #ffffff)}.form{display:grid;gap:12px}.field{display:grid;gap:6px;padding:8px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);border-radius:var(--schema-radius);background:var(--schema-surface, #fff)}.label{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.input,select,textarea{width:100%;padding:8px 10px;border-radius:8px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-input-bg, #fff);color:inherit}.checkbox{display:inline-flex;align-items:center;gap:8px}.helper{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.row{display:grid;gap:8px}.actions{display:flex;gap:8px}.btn{padding:6px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-btn-bg, #f8fafc);border-radius:8px;cursor:pointer}.btn.primary{background:var(--schema-color-primary, #2563eb);color:#fff;border-color:transparent}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.danger{background:var(--schema-color-danger, #dc2626);color:#fff;border-color:transparent}.group{display:grid;gap:10px;border-left:3px solid var(--schema-color-muted, #e5e7eb);padding-left:10px}.kv{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center}.badge{display:inline-flex;padding:2px 6px;border-radius:999px;font-size:11px;background:var(--schema-badge-bg, #eef2ff);color:var(--schema-badge-fg, #4f46e5)}.hidden{display:none!important}.toolbar{display:flex;gap:6px}";/**
85
+ **/let ra;const Vu=typeof window<"u"&&window.trustedTypes;if(Vu)try{ra=Vu.createPolicy("vue",{createHTML:t=>t})}catch{}const Ku=ra?t=>ra.createHTML(t):t=>t,jy="http://www.w3.org/2000/svg",Fy="http://www.w3.org/1998/Math/MathML",Qt=typeof document<"u"?document:null,Ju=Qt&&Qt.createElement("template"),By={insert:(t,e,r)=>{e.insertBefore(t,r||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,r,n)=>{const i=e==="svg"?Qt.createElementNS(jy,t):e==="mathml"?Qt.createElementNS(Fy,t):r?Qt.createElement(t,{is:r}):Qt.createElement(t);return t==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:t=>Qt.createTextNode(t),createComment:t=>Qt.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Qt.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,r,n,i,s){const o=r?r.previousSibling:e.lastChild;if(i&&(i===s||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),r),!(i===s||!(i=i.nextSibling)););else{Ju.innerHTML=Ku(n==="svg"?`<svg>${t}</svg>`:n==="mathml"?`<math>${t}</math>`:t);const a=Ju.content;if(n==="svg"||n==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,r)}return[o?o.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}},Uy=Symbol("_vtc");function Wy(t,e,r){const n=t[Uy];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):r?t.setAttribute("class",e):t.className=e}const ss=Symbol("_vod"),Yu=Symbol("_vsh"),qy={name:"show",beforeMount(t,{value:e},{transition:r}){t[ss]=t.style.display==="none"?"":t.style.display,r&&e?r.beforeEnter(t):Bn(t,e)},mounted(t,{value:e},{transition:r}){r&&e&&r.enter(t)},updated(t,{value:e,oldValue:r},{transition:n}){!e!=!r&&(n?e?(n.beforeEnter(t),Bn(t,!0),n.enter(t)):n.leave(t,()=>{Bn(t,!1)}):Bn(t,e))},beforeUnmount(t,{value:e}){Bn(t,e)}};function Bn(t,e){t.style.display=e?t[ss]:"none",t[Yu]=!e}const Hy=Symbol(""),zy=/(?:^|;)\s*display\s*:/;function Vy(t,e,r){const n=t.style,i=De(r);let s=!1;if(r&&!i){if(e)if(De(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();r[a]==null&&os(n,a,"")}else for(const o in e)r[o]==null&&os(n,o,"");for(const o in r)o==="display"&&(s=!0),os(n,o,r[o])}else if(i){if(e!==r){const o=n[Hy];o&&(r+=";"+o),n.cssText=r,s=zy.test(r)}}else e&&t.removeAttribute("style");ss in t&&(t[ss]=s?n.display:"",t[Yu]&&(n.display="none"))}const Gu=/\s*!important$/;function os(t,e,r){if(ae(r))r.forEach(n=>os(t,e,n));else if(r==null&&(r=""),e.startsWith("--"))t.setProperty(e,r);else{const n=Ky(t,e);Gu.test(r)?t.setProperty(nr(n),r.replace(Gu,""),"important"):t[n]=r}}const Qu=["Webkit","Moz","ms"],na={};function Ky(t,e){const r=na[e];if(r)return r;let n=Vt(e);if(n!=="filter"&&n in t)return na[e]=n;n=vl(n);for(let i=0;i<Qu.length;i++){const s=Qu[i]+n;if(s in t)return na[e]=s}return e}const Xu="http://www.w3.org/1999/xlink";function Zu(t,e,r,n,i,s=Hm(e)){n&&e.startsWith("xlink:")?r==null?t.removeAttributeNS(Xu,e.slice(6,e.length)):t.setAttributeNS(Xu,e,r):r==null||s&&!wl(r)?t.removeAttribute(e):t.setAttribute(e,s?"":rr(r)?String(r):r)}function ef(t,e,r,n,i){if(e==="innerHTML"||e==="textContent"){r!=null&&(t[e]=e==="innerHTML"?Ku(r):r);return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?t.getAttribute("value")||"":t.value,c=r==null?t.type==="checkbox"?"on":"":String(r);(a!==c||!("_value"in t))&&(t.value=c),r==null&&t.removeAttribute(e),t._value=r;return}let o=!1;if(r===""||r==null){const a=typeof t[e];a==="boolean"?r=wl(r):r==null&&a==="string"?(r="",o=!0):a==="number"&&(r=0,o=!0)}try{t[e]=r}catch{}o&&t.removeAttribute(i||e)}function Jy(t,e,r,n){t.addEventListener(e,r,n)}function Yy(t,e,r,n){t.removeEventListener(e,r,n)}const tf=Symbol("_vei");function Gy(t,e,r,n,i=null){const s=t[tf]||(t[tf]={}),o=s[e];if(n&&o)o.value=n;else{const[a,c]=Qy(e);if(n){const u=s[e]=ev(n,i);Jy(t,a,u,c)}else o&&(Yy(t,a,o,c),s[e]=void 0)}}const rf=/(?:Once|Passive|Capture)$/;function Qy(t){let e;if(rf.test(t)){e={};let n;for(;n=t.match(rf);)t=t.slice(0,t.length-n[0].length),e[n[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):nr(t.slice(2)),e]}let ia=0;const Xy=Promise.resolve(),Zy=()=>ia||(Xy.then(()=>ia=0),ia=Date.now());function ev(t,e){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;Tt(tv(n,r.value),e,5,[n])};return r.value=t,r.attached=Zy(),r}function tv(t,e){if(ae(e)){const r=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{r.call(t),t._stopped=!0},e.map(n=>i=>!i._stopped&&n&&n(i))}else return e}const nf=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,rv=(t,e,r,n,i,s)=>{const o=i==="svg";e==="class"?Wy(t,n,o):e==="style"?Vy(t,r,n):$i(e)?wo(e)||Gy(t,e,r,n,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):nv(t,e,n,o))?(ef(t,e,n),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Zu(t,e,n,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!De(n))?ef(t,Vt(e),n,s,e):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),Zu(t,e,n,o))};function nv(t,e,r,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in t&&nf(e)&&ce(r));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return nf(e)&&De(r)?!1:e in t}const iv=Je({patchProp:rv},By);let sf;function sv(){return sf||(sf=sy(iv))}const ov=(...t)=>{const e=sv().createApp(...t),{mount:r}=e;return e.mount=n=>{const i=cv(n);if(!i)return;const s=e._component;!ce(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=r(i,!1,av(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function av(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function cv(t){return De(t)?document.querySelector(t):t}const sa=Symbol("IPEInjectKey"),lv=(t,e)=>(e?e.provide(sa,t):mu(sa,t),t),uv=()=>Tn(sa),_t=":host{all:initial;font-family:var(--schema-font-family, ui-sans-serif, system-ui, -apple-system)}*,*:before,*:after{box-sizing:border-box}:host{color:var(--schema-color-fg, #111827)}:host{--schema-radius: var(--schema-radius, 10px)}.wrapper{display:block;background:var(--schema-color-bg, #ffffff)}.form{display:grid;gap:12px}.field{display:grid;gap:6px;padding:8px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);border-radius:var(--schema-radius);background:var(--schema-surface, #fff)}.label{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.input,select,textarea{width:100%;padding:8px 10px;border-radius:8px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-input-bg, #fff);color:inherit}.checkbox{display:inline-flex;align-items:center;gap:8px}.helper{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.row{display:grid;gap:8px}.actions{display:flex;gap:8px}.btn{padding:6px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-btn-bg, #f8fafc);border-radius:8px;cursor:pointer}.btn.primary{background:var(--schema-color-primary, #2563eb);color:#fff;border-color:transparent}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.danger{background:var(--schema-color-danger, #dc2626);color:#fff;border-color:transparent}.group{display:grid;gap:10px;border-left:3px solid var(--schema-color-muted, #e5e7eb);padding-left:10px}.kv{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center}.badge{display:inline-flex;padding:2px 6px;border-radius:999px;font-size:11px;background:var(--schema-badge-bg, #eef2ff);color:var(--schema-badge-fg, #4f46e5)}.hidden{display:none!important}.toolbar{display:flex;gap:6px}";/**
86
86
  * SchemaForm
87
87
  * 一个基于 Schemastery 的 Web Components 表单生成器
88
88
  *
@@ -99,5 +99,5 @@
99
99
  * @license MIT
100
100
  * @author dragon-fish
101
101
  * @author @openai/gpt-5
102
- */const tf={arrayAdd:"+",arrayMoveUp:"↑",arrayMoveDown:"↓",arrayRemove:"×",dictAdd:"+",dictRemove:"×",rootLabel:"root"},Xy=(t,e,r)=>{if(!e.length)return;let n=t;for(let i=0;i<e.length-1;i++){const s=e[i];n[s]==null&&(n[s]=typeof e[i+1]=="number"?[]:{}),n=n[s]}n[e[e.length-1]]=r},Un=t=>t.map(String).join("."),Zy=t=>t.replace(/[^a-zA-Z0-9_-]/g,"_"),ar=t=>`schema_${Zy(Un(t)||"root")}`,cr=t=>Un(t);function as(t,e){if(e==null)return e;switch(t){case"number":case"natural":case"percent":{if(e==="")return;const r=Number(e);return Number.isNaN(r)?void 0:r}case"boolean":return!!e;case"date":{if(!e)return;const r=new Date(e);return Number.isNaN(+r)?void 0:r}case"const":case"string":default:return e}}function rf(t){return typeof t=="function"&&!!t?.type}function nf(t){if(!t)throw new Error("schema is required");if(rf(t))return t;try{const e=Pe.from(t);if(rf(e))return e}catch{}if(t?.type){const e=t.type;if(Pe[e])return Pe[e](t.inner??t.list??t.dict)}throw new Error("无法从传入对象生成 Schemastery 实例,请传入 schema 或 schema.toJSON() 的结果。")}function Nt(t){return t?.meta??{}}function ev(t){return t.length>0&&t.every(e=>e?.type==="const")}function Jr(t){if(!t)return;const e=t,r=e.meta||{};if(Object.prototype.hasOwnProperty.call(r,"default"))return r.default;const n=e.type;try{const i=t();if(i!==void 0)return i}catch{}switch(n){case"string":return"";case"number":case"natural":case"percent":return 0;case"boolean":return!1;case"array":return[];case"tuple":return[];case"object":return{};case"dict":return{};case"union":{const i=e.list||[];return i.length?Jr(i[0]):void 0}case"const":return e.value;case"date":return;default:return}}class Lt extends HTMLElement{constructor(){super(),this._path=[],this._i18n=tf,this.$root=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=bt,this.$root.appendChild(e)}makeFieldContainer(e,r){const n=document.createElement("div");if(n.className=`field schema-form-item schema-type-${e}`,n.setAttribute("data-path",Un(this._path)),this._label){const i=document.createElement("label");i.className="label",i.textContent=this._label,n.appendChild(i)}if(r){const i=document.createElement("div");i.className="helper",i.textContent=r,n.appendChild(i)}return n}set schema(e){this._schema=nf(e),this.render()}get schema(){return this._schema}set path(e){this._path=e??[],this.render()}get path(){return this._path}set label(e){this._label=e,this.render()}get label(){return this._label}set i18n(e){e&&(this._i18n={...this._i18n,...e}),this.render()}get i18n(){return this._i18n}setValue(e){this._value=e,this.render()}getValue(){return this._value}emitChange(e){this._value=e,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{path:this._path,value:e}}))}}class tv extends Lt{render(){if(this.$input&&this.$root.contains(this.$input)){const s=this._value??"";this.$input.value!==s&&document.activeElement!==this.$input&&(this.$input.value=s);return}this.$root.innerHTML=`<style>${bt}</style>`;const e=Nt(this._schema),r=this.makeFieldContainer("string",e.description),n=document.createElement("input");this.$input=n,n.className="input",n.type="text",n.name=cr(this._path),n.id=ar(this._path),e?.pattern?.source&&(n.pattern=e.pattern.source),e?.max!=null&&(n.maxLength=e.max),n.value=this._value??"",n.oninput=()=>this.emitChange(as("string",n.value));const i=r.querySelector("label.label");i&&(i.htmlFor=n.id),r.appendChild(n),this.$root.appendChild(r)}}customElements.get("schema-form-string")||customElements.define("schema-form-string",tv);class rv extends Lt{render(){if(this.$input&&this.$root.contains(this.$input)){const o=this._value??"";this.$input.value!==String(o)&&document.activeElement!==this.$input&&(this.$input.value=o);return}this.$root.innerHTML=`<style>${bt}</style>`;const e=this._schema?.type??"number",r=Nt(this._schema),n=this.makeFieldContainer("number",r.description),i=document.createElement("input");this.$input=i,i.className="input",i.type="number",i.name=cr(this._path),i.id=ar(this._path),r?.min!=null&&(i.min=String(r.min)),r?.max!=null&&(i.max=String(r.max)),r?.step!=null&&(i.step=String(r.step)),e==="percent"&&!i.step&&(i.step="0.01"),i.value=this._value??"",i.oninput=()=>this.emitChange(as(e,i.value));const s=n.querySelector("label.label");s&&(s.htmlFor=i.id),n.appendChild(i),this.$root.appendChild(n)}}customElements.get("schema-form-number")||customElements.define("schema-form-number",rv);class nv extends Lt{render(){this.$root.innerHTML=`<style>${bt}</style>`;const e=Nt(this._schema),r=this.makeFieldContainer("boolean",e.description),n=document.createElement("label");n.className="checkbox";const i=document.createElement("input");i.type="checkbox",i.checked=!!this._value,i.name=cr(this._path),i.id=ar(this._path);const s=document.createElement("span");s.textContent=this._label??"",i.onchange=()=>this.emitChange(i.checked);const o=r.querySelector("label.label");o&&(o.htmlFor=i.id),n.append(i,s),r.appendChild(n),this.$root.appendChild(r)}}customElements.get("schema-form-boolean")||customElements.define("schema-form-boolean",nv);class iv extends Lt{render(){if(this.$input&&this.$root.contains(this.$input)){const s=this._value??null;document.activeElement!==this.$input&&(this.$input.valueAsDate=s);return}this.$root.innerHTML=`<style>${bt}</style>`;const e=Nt(this._schema),r=this.makeFieldContainer("date",e.description),n=document.createElement("input");this.$input=n,n.className="input",n.type="date",n.name=cr(this._path),n.id=ar(this._path),n.valueAsDate=this._value??null,n.oninput=()=>this.emitChange(as("date",n.value));const i=r.querySelector("label.label");i&&(i.htmlFor=n.id),r.appendChild(n),this.$root.appendChild(r)}}customElements.get("schema-form-date")||customElements.define("schema-form-date",iv);class sv extends Lt{render(){this.$root.innerHTML=`<style>${bt}</style>`;const e=Nt(this._schema),r=this.makeFieldContainer("const",e.description),n=document.createElement("input");n.className="input",n.readOnly=!0,n.value=String(this._schema.value),n.name=cr(this._path),n.id=ar(this._path);const i=r.querySelector("label.label");i&&(i.htmlFor=n.id),r.appendChild(n),this.$root.appendChild(r)}}customElements.get("schema-form-const")||customElements.define("schema-form-const",sv);function ov(t){switch(t.type){case"string":return"schema-form-string";case"number":case"natural":case"percent":return"schema-form-number";case"boolean":return"schema-form-boolean";case"date":return"schema-form-date";case"const":return"schema-form-const";case"array":return"schema-form-array";case"object":return"schema-form-object";case"tuple":return"schema-form-tuple";case"dict":return"schema-form-dict";case"union":return"schema-form-union";default:return"schema-form-string"}}function Yr(t,e,r,n,i){const s=ov(t),o=document.createElement(s);return o.schema=t,o.path=e,o.label=n,i&&(o.i18n=i),o.setValue?.(r),o}class av extends Lt{render(){this.$root.innerHTML=`<style>${bt}</style>`;const e=Nt(this._schema),r=this.makeFieldContainer("union",e.description),n=this._schema.list||[];if(ev(n)){const i=document.createElement("select");i.className="input",i.name=cr(this._path),i.id=ar(this._path),n.forEach(o=>{const a=document.createElement("option");a.value=String(o.value),a.textContent=String(o.value),this._value===o.value&&(a.selected=!0),i.appendChild(a)}),i.onchange=()=>this.emitChange(as("string",i.value));const s=r.querySelector("label.label");s&&(s.htmlFor=i.id),r.appendChild(i)}else{const i=document.createElement("div");i.className="toolbar";const s=document.createElement("select");s.className="input",s.name=cr(this._path)+".__type",s.id=ar(this._path)+"__type";let o=0;n.forEach((u,f)=>{const v=document.createElement("option");v.value=String(f),v.textContent=u.type,s.appendChild(v)}),s.onchange=()=>{o=Number(s.value);const u=n[o],f=Jr(u);this.emitChange(f),l()};const a=r.querySelector("label.label");a&&(a.htmlFor=s.id),i.appendChild(s),r.appendChild(i);const c=document.createElement("div");c.className="group";const l=()=>{c.innerHTML="";const u=n[o],f=Yr(u,this._path,this._value,this._label);f.addEventListener("change",v=>this.emitChange(v.detail.value)),c.appendChild(f)};l(),r.appendChild(c)}this.$root.appendChild(r)}}customElements.get("schema-form-union")||customElements.define("schema-form-union",av);class cv extends Lt{render(){this.$root.innerHTML=`<style>${bt}</style>`;const e=Nt(this._schema),r=this.makeFieldContainer("tuple",e.description),n=document.createElement("div");n.className="group";const i=Array.isArray(this._value)?this._value:[];(this._schema.list||[]).forEach((s,o)=>{const a=Yr(s,[...this._path,o],i[o],`${this._label??""}[${o}]`);a.addEventListener("change",c=>{const l=i.slice();l[o]=c.detail.value,this.emitChange(l)}),n.appendChild(a)}),r.appendChild(n),this.$root.appendChild(r)}}customElements.get("schema-form-tuple")||customElements.define("schema-form-tuple",cv);class lv extends Lt{render(){this.$root.innerHTML=`<style>${bt}</style>`;const e=Nt(this._schema),r=this.makeFieldContainer("object",e.description),n=document.createElement("div");n.className="group";const i=this._value??{},s=this._schema.dict||{};Object.keys(s).forEach(o=>{if(s[o]?.meta?.hidden)return;const a=Yr(s[o],[...this._path,o],i[o],o);a.addEventListener("change",c=>{const l={...i};l[o]=c.detail.value,this.emitChange(l)}),n.appendChild(a)}),r.appendChild(n),this.$root.appendChild(r)}}customElements.get("schema-form-object")||customElements.define("schema-form-object",lv);class uv extends Lt{render(){this.$root.innerHTML=`<style>${bt}</style>`;const e=Nt(this._schema),r=this.makeFieldContainer("array",e.description),n=document.createElement("div");n.className="group";const i=Array.isArray(this._value)?this._value:[],s=()=>{n.innerHTML="",i.forEach((c,l)=>{const u=[...this._path,l],f=document.createElement("div");f.className="row",f.setAttribute("data-path",Un(u));const v=Yr(this._schema.inner,u,c,`${this._label??""}[${l}]`);v.addEventListener("change",B=>{i[l]=B.detail.value,this.emitChange(i.slice())});const y=document.createElement("div");y.className="actions";const b=document.createElement("button");b.type="button",b.className="btn",b.textContent=this._i18n.arrayMoveUp??"↑";const R=document.createElement("button");R.type="button",R.className="btn",R.textContent=this._i18n.arrayMoveDown??"↓";const H=document.createElement("button");H.type="button",H.className="btn danger",H.textContent=this._i18n.arrayRemove??"×",b.onclick=()=>{if(l>0){const B=i[l-1];i[l-1]=i[l],i[l]=B,s(),this.emitChange(i.slice())}},R.onclick=()=>{if(l<i.length-1){const B=i[l+1];i[l+1]=i[l],i[l]=B,s(),this.emitChange(i.slice())}},H.onclick=()=>{i.splice(l,1),s(),this.emitChange(i.slice())},y.append(b,R,H),f.appendChild(v),f.appendChild(y),n.appendChild(f)})};s();const o=document.createElement("button");o.type="button",o.className="btn primary",o.textContent=this._i18n.arrayAdd??"+",o.onclick=()=>{i.push(Jr(this._schema.inner)),s(),this.emitChange(i.slice())};const a=document.createElement("div");a.className="actions",a.appendChild(o),r.appendChild(n),r.appendChild(a),this.$root.appendChild(r)}}customElements.get("schema-form-array")||customElements.define("schema-form-array",uv);class fv extends Lt{render(){this.$root.innerHTML=`<style>${bt}</style>`;const e=Nt(this._schema),r=this.makeFieldContainer("dict",e.description),n=document.createElement("div");n.className="group";const i=this._value??{};Object.keys(i).forEach(a=>{const c=[...this._path,a],l=document.createElement("div");l.className="kv",l.setAttribute("data-path",Un(c));const u=document.createElement("input");u.className="input",u.value=a,u.name=cr(c)+".__key",u.id=ar(c)+"__key";const f=Yr(this._schema.inner,c,i[a],`${this._label??""}[${a}]`),v=document.createElement("button");v.type="button",v.className="btn danger",v.textContent=this._i18n.dictRemove??"×",v.onclick=()=>{delete i[a],this.emitChange({...i})},u.onchange=()=>{const y=u.value;if(!y||y===a)return;const b={...i};b[y]=b[a],delete b[a],this.emitChange(b)},f.addEventListener("change",y=>{const b={...i};b[a]=y.detail.value,this.emitChange(b)}),l.append(u,f,v),n.appendChild(l)});const s=document.createElement("button");s.type="button",s.className="btn primary",s.textContent=this._i18n.dictAdd??"+",s.onclick=()=>{const a=`k${Object.keys(i).length+1}`,c=Jr(this._schema.inner),l={...i,[a]:c};this.emitChange(l)};const o=document.createElement("div");o.className="actions",o.appendChild(s),r.appendChild(n),r.appendChild(o),this.$root.appendChild(r)}}customElements.get("schema-form-dict")||customElements.define("schema-form-dict",fv);class dv extends HTMLElement{constructor(){super(),this._i18n={...tf},this.$root=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=bt,this.$root.appendChild(e);const r=document.createElement("div");r.className="wrapper",r.innerHTML='<form class="form" part="form"></form>',this.$root.appendChild(r),this.addEventListener("change",n=>{if(!n?.detail)return;const{path:i,value:s}=n.detail;Xy(this._state??(this._state={}),i,s),this.dispatchEvent(new CustomEvent("form-change",{detail:{path:i,value:s,state:this._state}}))})}set schema(e){this._schema=nf(e),this._state=Jr(this._schema),this.render()}get schema(){return this._schema}set schemaJSON(e){this.schema=e}get schemaJSON(){return this._schema?.toJSON?.()}setData(e,r={validate:!0,autofix:!0}){if(!this._schema)throw new Error("请先设置 schema");const n=r.validate?this._schema(e??null,{autofix:r.autofix}):e;this._state=n,this.render()}getData(e={validate:!0,autofix:!0}){if(!this._schema)throw new Error("请先设置 schema");const r=this._state;return e.validate?this._schema(r??null,{autofix:e.autofix}):r}reset(){this._state=Jr(this._schema),this.render()}refresh(){this.render()}set i18n(e){this._i18n={...this._i18n,...e},this.render()}get i18n(){return this._i18n}render(){if(!this._schema)return;const e=this.$root.querySelector("form");e.innerHTML="";const r=Yr(this._schema,[],this._state,this._i18n.rootLabel,this._i18n);e.appendChild(r)}}customElements.get("schema-form")||customElements.define("schema-form",dv);const hv=Gl({__name:"SchemaFormVue",props:iu({schema:{},value:{},validateOnChange:{type:Boolean,default:!1}},{schema:{required:!0},schemaModifiers:{},value:{required:!1,default:{}},valueModifiers:{}}),emits:iu(["change"],["update:schema","update:value"]),setup(t,{expose:e,emit:r}){const n=Ou(t,"schema"),i=Ou(t,"value"),s=r,o=_g("elRef");let a=!1,c=!1;const l=u=>{if(c)return;const f=o.value,v=t.validateOnChange?f.getData({validate:!0}):f.getData({validate:!1,autofix:!0});a=!0,i.value=v,Ki(()=>{a=!1}),s("change",u.detail)};return Wo(()=>{const u=o.value;n.value&&(u.schema=n.value),i.value!==void 0&&u.setData(i.value,{validate:!1,autofix:!0}),u.addEventListener("form-change",l)}),tu(()=>{o.value?.removeEventListener("form-change",l)}),Rn(()=>n,u=>{a||o.value&&u&&o.value.schema!==u.value&&(c=!0,o.value.schema=u.value,Ki(()=>{c=!1}))},{deep:!1}),Rn(()=>i,u=>{if(a||!o.value||u.value===void 0)return;const f=o.value.getData({validate:!1});JSON.stringify(f)!==JSON.stringify(u.value)&&(c=!0,o.value.setData(u.value,{validate:!1}),Ki(()=>{c=!1}))},{deep:!0}),e({setData(u,f){const v=o.value;v.setData(u,{validate:!!f?.validate}),f?.emit&&(i.value=v.getData({validate:!!f?.validate}))},getData(u){return o.value.getData(u)},setSchema(u,f=!0){o.value.schema=u,f&&(n.value=u)},refresh(){o.value.refresh()},reset(){o.value.reset()},el:o}),(u,f)=>(Vr(),Ln("schema-form",Nu({ref_key:"elRef",ref:o},u.$attrs),null,16))}});function xr(t,e=new WeakMap){if(ze(t))return xr(t.value,e);if(t===null||typeof t!="object")return t;if(e.has(t))return e.get(t);if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);if(t instanceof Map){const i=new Map;return e.set(t,i),Array.from(t.entries()).forEach(([s,o])=>{i.set(s,xr(o,e))}),i}if(t instanceof Set){const i=new Set;return e.set(t,i),Array.from(t).forEach(s=>{i.add(xr(s,e))}),i}if(Array.isArray(t)){const i=[];e.set(t,i);for(const s of t)i.push(xr(s,e));return i}const r=ye(t),n={};e.set(t,n);for(const i of Object.keys(r))n[i]=xr(r[i],e);for(const i of Object.getOwnPropertySymbols(r))n[i]=xr(r[i],e);return n}const pv={class:"preferences-ui-app"},mv={class:"tabs"},gv=["onClick","data-value"],yv={style:{"max-height":"20em",overflow:"auto"}},vv={style:{"max-height":"20em",overflow:"auto"}},bv=((t,e)=>{const r=t.__vccOpts||t;for(const[n,i]of e)r[n]=i;return r})(Gl({__name:"PreferencesForm",setup(t,{expose:e}){const r=Qy(),n=Wi([]),i=Wi(""),s=Uu(()=>a.value.find(c=>c.category===i.value)?.schema),o=Wi({}),a=Wi([]);return e({getValue(){return xr(o)}}),Xg(()=>{i.value&&(a.value=r.preferences.getConfigRegistries(i.value))}),Wo(async()=>{r.inject(["preferences"],async c=>{o.value=await c.preferences.getAll(),n.value=c.preferences.getConfigCategories(),i.value=n.value[0].name})}),(c,l)=>(Vr(),Ln("div",pv,[wr("div",mv,[(Vr(!0),Ln(St,null,nu(n.value,u=>(Vr(),Ln("a",{class:Ri(["tab",{active:i.value===u.name}]),key:u.name,onClick:f=>i.value=u.name,"data-value":u.name},Di(u.label),11,gv))),128))]),(Vr(!0),Ln(St,null,nu(a.value,u=>gg((Vr(),ly(hv,{key:u.name,schema:u.schema,value:o.value,"onUpdate:value":l[0]||(l[0]=f=>o.value=f),"validate-on-change":!1,i18n:{rootLabel:""}},null,8,["schema","value"])),[[Iy,i.value===u.category]])),128)),wr("details",null,[l[1]||(l[1]=wr("summary",null,"Debug Info",-1)),wr("pre",yv,Di(s.value),1),wr("pre",vv,Di(o.value),1)])]))}}),[["__scopeId","data-v-f3a2bfc1"]]);var _v=Object.create,sa=Object.defineProperty,wv=Object.getOwnPropertyDescriptor,sf=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),of=t=>{throw TypeError(t)},xv=(t,e,r)=>e in t?sa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sv=(t,e)=>sa(t,"name",{value:e,configurable:!0}),Ev=t=>[,,,_v(t?.[sf("metadata")]??null)],Ov=["class","method","getter","setter","accessor","field","value","get","set"],af=t=>t!==void 0&&typeof t!="function"?of("Function expected"):t,Cv=(t,e,r,n,i)=>({kind:Ov[t],name:e,metadata:n,addInitializer:s=>r._?of("Already initialized"):i.push(af(s||null))}),Pv=(t,e)=>xv(e,sf("metadata"),t[3]),$v=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},kv=(t,e,r,n,i,s)=>{var o,a,c,l=e&7,u=!1,f=0,v=t[f]||(t[f]=[]),y=l&&(i=i.prototype,l<5&&(l>3||!u)&&wv(i,r));Sv(i,r);for(var b=n.length-1;b>=0;b--)c=Cv(l,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,af(o)&&(i=o);return Pv(t,i),y&&sa(i,r,y),u?l^4?s:y:i},cf,oa,lf;cf=[st(["preferences","modal"])];class cs extends(lf=Pt){constructor(e){super(e,{},"preferences-ui"),this.ctx=e,e.set("preferencesUI",this),e.inject(["toolbox"],r=>{r.toolbox.addButton({id:"preferences",icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-settings",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M14.647 4.081a.724 .724 0 0 0 1.08 .448c2.439 -1.485 5.23 1.305 3.745 3.744a.724 .724 0 0 0 .447 1.08c2.775 .673 2.775 4.62 0 5.294a.724 .724 0 0 0 -.448 1.08c1.485 2.439 -1.305 5.23 -3.744 3.745a.724 .724 0 0 0 -1.08 .447c-.673 2.775 -4.62 2.775 -5.294 0a.724 .724 0 0 0 -1.08 -.448c-2.439 1.485 -5.23 -1.305 -3.745 -3.744a.724 .724 0 0 0 -.447 -1.08c-2.775 -.673 -2.775 -4.62 0 -5.294a.724 .724 0 0 0 .448 -1.08c-1.485 -2.439 1.305 -5.23 3.744 -3.745a.722 .722 0 0 0 1.08 -.447c.673 -2.775 4.62 -2.775 5.294 0zm-2.647 4.919a3 3 0 1 0 0 6a3 3 0 0 0 0 -6z"})]}),tooltip:"Open preferences",group:"group2",index:1/0,onClick:()=>this.showModal()}),this.addDisposeHandler(()=>{r.toolbox.removeButton("preferences")})})}showModal(){const e=this.ctx.modal.show({className:"in-page-edit",sizeClass:"small",outSideClose:!1,center:!0,title:"InPageEdit Prefrences",content:O(ci,{children:O(mr,{})})});e.get$wrapper().addClass("dialog");const r=O("div",{id:"ipe-preferences-app",style:{minHeight:"65vh"}});e.setContent(r);const n=this.createFormApp(),i=n.mount(r);e.setButtons([{label:"Save",className:"btn",method:()=>{const s=i.getValue();Object.entries(s).forEach(([o,a])=>{this.ctx.preferences.set(o,a).catch(console.error)}),e.close()}},{label:"Cancel",className:"btn btn-danger",method:()=>{e.close()}}]),e.get$modal().on("onClose.ssi-modal",()=>{n.unmount()})}createFormApp(){const e=Ky(bv);return Gy(this.ctx,e),e}}oa=Ev(lf),cs=kv(oa,0,"PluginPreferencesUI",cf,cs),$v(oa,1,cs);const Iv=Object.freeze(Object.defineProperty({__proto__:null,get PluginPreferencesUI(){return cs}},Symbol.toStringTag,{value:"Module"}));he.BasePlugin=Pt,he.InPageEdit=gr,he.Inject=st,he.Schema=Pe,he.Service=Ar,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
102
+ */const of={arrayAdd:"+",arrayMoveUp:"↑",arrayMoveDown:"↓",arrayRemove:"×",dictAdd:"+",dictRemove:"×",rootLabel:"root"},Te=(t,e)=>{customElements.get(t)||customElements.define(t,e)},fv=(t,e,r)=>{if(!e.length)return;let n=t,i=null,s=null;for(let a=0;a<e.length-1;a++){const c=e[a];let u=n?.[c];u==null?(u=typeof e[a+1]=="number"?[]:{},n[c]=u):typeof u!="object"&&(u=typeof e[a+1]=="number"?[]:{},n[c]=u),i=n,s=c,n=u}const o=e[e.length-1];if(n==null||typeof n!="object"){const a=typeof o=="number"?[]:{};if(i)i[s]=a,n=a;else return}try{n[o]=r}catch{try{const a=Array.isArray(n)?n.slice():{...n};a[o]=r,i&&(i[s]=a)}catch{}}},Un=t=>t.map(String).join("."),dv=t=>t.replace(/[^a-zA-Z0-9_-]/g,"_"),cr=t=>`schema_${dv(Un(t)||"root")}`,lr=t=>Un(t);function as(t,e){if(e==null)return e;switch(t){case"number":case"natural":case"percent":{if(e==="")return;const r=Number(e);return Number.isNaN(r)?void 0:r}case"boolean":return!!e;case"date":{if(!e)return;const r=new Date(e);return Number.isNaN(+r)?void 0:r}case"const":case"string":default:return e}}function af(t){return typeof t=="function"&&!!t?.type}function cf(t){if(!t)throw new Error("schema is required");if(af(t))return t;try{const e=Schema.from(t);if(af(e))return e}catch{}if(t?.type){const e=t.type;if(Schema[e])return Schema[e](t.inner??t.list??t.dict)}throw new Error("无法从传入对象生成 Schemastery 实例,请传入 schema 或 schema.toJSON() 的结果。")}function Lt(t){return t?.meta??{}}function hv(t){return t.length>0&&t.every(e=>e?.type==="const")}function Jr(t){if(!t)return;const e=t,r=e.meta||{};if(Object.prototype.hasOwnProperty.call(r,"default"))return r.default;const n=e.type;try{const i=t();if(i!==void 0)return i}catch{}switch(n){case"string":return"";case"number":case"natural":case"percent":return 0;case"boolean":return!1;case"array":return[];case"tuple":return[];case"object":return{};case"dict":return{};case"union":{const i=e.list||[];return i.length?Jr(i[0]):void 0}case"const":return e.value;case"date":return;default:return}}class Mt extends HTMLElement{constructor(){super(),this._path=[],this._i18n=of,this.$root=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=_t,this.$root.appendChild(e)}makeFieldContainer(e,r){const n=document.createElement("div");if(n.className=`field schema-form-item schema-type-${e}`,n.setAttribute("data-path",Un(this._path)),this._label){const i=document.createElement("label");i.className="label",i.textContent=this._label,n.appendChild(i)}if(r){const i=document.createElement("div");i.className="helper",i.textContent=r,n.appendChild(i)}return n}set schema(e){this._schema=cf(e),this.render()}get schema(){return this._schema}set path(e){this._path=e??[],this.render()}get path(){return this._path}set label(e){this._label=e,this.render()}get label(){return this._label}set i18n(e){e&&(this._i18n={...this._i18n,...e}),this.render()}get i18n(){return this._i18n}setValue(e){this._value=e,this.render()}getValue(){return this._value}emitChange(e){this._value=e,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{path:this._path,value:e}}))}}class lf extends Mt{render(){if(this.$input&&this.$root.contains(this.$input)){const s=this._value??"";this.$input.value!==s&&document.activeElement!==this.$input&&(this.$input.value=s);return}this.$root.innerHTML=`<style>${_t}</style>`;const e=Lt(this._schema),r=this.makeFieldContainer("string",e.description),n=document.createElement("input");this.$input=n,n.className="input",n.type="text",n.name=lr(this._path),n.id=cr(this._path),e?.pattern?.source&&(n.pattern=e.pattern.source),e?.max!=null&&(n.maxLength=e.max),n.value=this._value??"",n.oninput=()=>this.emitChange(as("string",n.value));const i=r.querySelector("label.label");i&&(i.htmlFor=n.id),r.appendChild(n),this.$root.appendChild(r)}}Te("schema-form-string",lf);class uf extends Mt{render(){if(this.$input&&this.$root.contains(this.$input)){const o=this._value??"";this.$input.value!==String(o)&&document.activeElement!==this.$input&&(this.$input.value=o);return}this.$root.innerHTML=`<style>${_t}</style>`;const e=this._schema?.type??"number",r=Lt(this._schema),n=this.makeFieldContainer("number",r.description),i=document.createElement("input");this.$input=i,i.className="input",i.type="number",i.name=lr(this._path),i.id=cr(this._path),r?.min!=null&&(i.min=String(r.min)),r?.max!=null&&(i.max=String(r.max)),r?.step!=null&&(i.step=String(r.step)),e==="percent"&&!i.step&&(i.step="0.01"),i.value=this._value??"",i.oninput=()=>this.emitChange(as(e,i.value));const s=n.querySelector("label.label");s&&(s.htmlFor=i.id),n.appendChild(i),this.$root.appendChild(n)}}Te("schema-form-number",uf);class ff extends Mt{render(){this.$root.innerHTML=`<style>${_t}</style>`;const e=Lt(this._schema),r=this.makeFieldContainer("boolean",e.description),n=document.createElement("label");n.className="checkbox";const i=document.createElement("input");i.type="checkbox",i.checked=!!this._value,i.name=lr(this._path),i.id=cr(this._path);const s=document.createElement("span");s.textContent=this._label??"",i.onchange=()=>this.emitChange(i.checked);const o=r.querySelector("label.label");o&&(o.htmlFor=i.id),n.append(i,s),r.appendChild(n),this.$root.appendChild(r)}}Te("schema-form-boolean",ff);class df extends Mt{render(){if(this.$input&&this.$root.contains(this.$input)){const s=this._value??null;document.activeElement!==this.$input&&(this.$input.valueAsDate=s);return}this.$root.innerHTML=`<style>${_t}</style>`;const e=Lt(this._schema),r=this.makeFieldContainer("date",e.description),n=document.createElement("input");this.$input=n,n.className="input",n.type="date",n.name=lr(this._path),n.id=cr(this._path),n.valueAsDate=this._value??null,n.oninput=()=>this.emitChange(as("date",n.value));const i=r.querySelector("label.label");i&&(i.htmlFor=n.id),r.appendChild(n),this.$root.appendChild(r)}}Te("schema-form-date",df);class hf extends Mt{render(){this.$root.innerHTML=`<style>${_t}</style>`;const e=Lt(this._schema),r=this.makeFieldContainer("const",e.description),n=document.createElement("input");n.className="input",n.readOnly=!0,n.value=String(this._schema.value),n.name=lr(this._path),n.id=cr(this._path);const i=r.querySelector("label.label");i&&(i.htmlFor=n.id),r.appendChild(n),this.$root.appendChild(r)}}Te("schema-form-const",hf);function pv(t){switch(t.type){case"string":return"schema-form-string";case"number":case"natural":case"percent":return"schema-form-number";case"boolean":return"schema-form-boolean";case"date":return"schema-form-date";case"const":return"schema-form-const";case"array":return"schema-form-array";case"object":return"schema-form-object";case"tuple":return"schema-form-tuple";case"dict":return"schema-form-dict";case"union":return"schema-form-union";default:return"schema-form-string"}}function Yr(t,e,r,n,i){const s=pv(t),o=document.createElement(s);return o.schema=t,o.path=e,o.label=n,i&&(o.i18n=i),o.setValue?.(r),o}class pf extends Mt{render(){this.$root.innerHTML=`<style>${_t}</style>`;const e=Lt(this._schema),r=this.makeFieldContainer("union",e.description),n=this._schema.list||[];if(hv(n)){const i=document.createElement("select");i.className="input",i.name=lr(this._path),i.id=cr(this._path),n.forEach(o=>{const a=document.createElement("option");a.value=String(o.value),a.textContent=String(o.value),this._value===o.value&&(a.selected=!0),i.appendChild(a)}),i.onchange=()=>this.emitChange(as("string",i.value));const s=r.querySelector("label.label");s&&(s.htmlFor=i.id),r.appendChild(i)}else{const i=document.createElement("div");i.className="toolbar";const s=document.createElement("select");s.className="input",s.name=lr(this._path)+".__type",s.id=cr(this._path)+"__type";let o=0;n.forEach((l,f)=>{const v=document.createElement("option");v.value=String(f),v.textContent=l.type,s.appendChild(v)}),s.onchange=()=>{o=Number(s.value);const l=n[o],f=Jr(l);this.emitChange(f),u()};const a=r.querySelector("label.label");a&&(a.htmlFor=s.id),i.appendChild(s),r.appendChild(i);const c=document.createElement("div");c.className="group";const u=()=>{c.innerHTML="";const l=n[o],f=Yr(l,this._path,this._value,this._label);f.addEventListener("change",v=>{v.stopPropagation(),this.emitChange(v.detail.value)}),c.appendChild(f)};u(),r.appendChild(c)}this.$root.appendChild(r)}}Te("schema-form-union",pf);class mf extends Mt{render(){this.$root.innerHTML=`<style>${_t}</style>`;const e=Lt(this._schema),r=this.makeFieldContainer("tuple",e.description),n=document.createElement("div");n.className="group";const i=Array.isArray(this._value)?this._value:[];(this._schema.list||[]).forEach((s,o)=>{const a=Yr(s,[...this._path,o],i[o],`${this._label??""}[${o}]`);a.addEventListener("change",c=>{c.stopPropagation();const u=Array.isArray(this._value)?this._value.slice():[];u[o]=c.detail.value,this.emitChange(u)}),n.appendChild(a)}),r.appendChild(n),this.$root.appendChild(r)}}Te("schema-form-tuple",mf);class gf extends Mt{render(){this.$root.innerHTML=`<style>${_t}</style>`;const e=Lt(this._schema),r=this.makeFieldContainer("object",e.description),n=document.createElement("div");n.className="group";const i=this._schema.dict||{};Object.keys(i).forEach(s=>{if(i[s]?.meta?.hidden)return;const o=(this._value??{})[s],a=Yr(i[s],[...this._path,s],o,s);a.addEventListener("change",c=>{c.stopPropagation();const u={...this._value??{}};u[s]=c.detail.value,this.emitChange(u)}),n.appendChild(a)}),r.appendChild(n),this.$root.appendChild(r)}}Te("schema-form-object",gf);class yf extends Mt{render(){this.$root.innerHTML=`<style>${_t}</style>`;const e=Lt(this._schema),r=this.makeFieldContainer("array",e.description),n=document.createElement("div");n.className="group";const i=this._schema.inner,s=()=>Array.isArray(this._value)?this._value:[],o=()=>{n.innerHTML="",s().forEach((u,l)=>{const f=[...this._path,l],v=document.createElement("div");v.className="row",v.setAttribute("data-path",Un(f));const y=Yr(i,f,u,`${this._label??""}[${l}]`);y.addEventListener("change",R=>{R.stopPropagation();const m=s().slice();m[l]=R.detail.value,this.emitChange(m)});const b=document.createElement("div");b.className="actions";const T=document.createElement("button");T.type="button",T.className="btn",T.textContent=this._i18n.arrayMoveUp??"↑",T.onclick=()=>{if(l>0){const R=s().slice();[R[l-1],R[l]]=[R[l],R[l-1]],this.emitChange(R),o()}};const H=document.createElement("button");H.type="button",H.className="btn",H.textContent=this._i18n.arrayMoveDown??"↓",H.onclick=()=>{const R=s();if(l<R.length-1){const m=R.slice();[m[l+1],m[l]]=[m[l],m[l+1]],this.emitChange(m),o()}};const B=document.createElement("button");B.type="button",B.className="btn danger",B.textContent=this._i18n.arrayRemove??"×",B.onclick=()=>{const R=s().filter((m,p)=>p!==l);this.emitChange(R),o()},b.append(T,H,B),v.appendChild(y),v.appendChild(b),n.appendChild(v)})};o();const a=document.createElement("button");a.type="button",a.className="btn primary",a.textContent=this._i18n.arrayAdd??"+",a.onclick=()=>{const u=s().slice();u.push(Jr(i)),this.emitChange(u),o()};const c=document.createElement("div");c.className="actions",c.appendChild(a),r.appendChild(n),r.appendChild(c),this.$root.appendChild(r)}}Te("schema-form-array",yf);class vf extends Mt{render(){this.$root.innerHTML=`<style>${_t}</style>`;const e=Lt(this._schema),r=this.makeFieldContainer("dict",e.description),n=document.createElement("div");n.className="group";const i=this._value??{},s=this._schema.inner;Object.keys(i).forEach(c=>{const u=[...this._path,c],l=document.createElement("div");l.className="kv",l.setAttribute("data-path",Un(u));const f=document.createElement("input");f.className="input",f.value=c,f.name=lr(u)+".__key",f.id=cr(u)+"__key";const v=Yr(s,u,i[c],`${this._label??""}[${c}]`),y=document.createElement("button");y.type="button",y.className="btn danger",y.textContent=this._i18n.dictRemove??"×",y.onclick=()=>{const b={...this._value??{}};delete b[c],this.emitChange(b),this.render()},f.onchange=()=>{const b=f.value;if(!b||b===c)return;const T={...this._value??{}};T[b]=T[c],delete T[c],this.emitChange(T),this.render()},v.addEventListener("change",b=>{b.stopPropagation();const T={...this._value??{}};T[c]=b.detail.value,this.emitChange(T)}),l.append(f,v,y),n.appendChild(l)});const o=document.createElement("button");o.type="button",o.className="btn primary",o.textContent=this._i18n.dictAdd??"+",o.onclick=()=>{const c=`k${Object.keys(this._value??{}).length+1}`,u=Jr(s),l={...this._value??{},[c]:u};this.emitChange(l),this.render()};const a=document.createElement("div");a.className="actions",a.appendChild(o),r.appendChild(n),r.appendChild(a),this.$root.appendChild(r)}}Te("schema-form-dict",vf);class bf extends HTMLElement{constructor(){super(),this._i18n={...of},this.$root=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=_t,this.$root.appendChild(e);const r=document.createElement("div");r.className="wrapper",r.innerHTML='<form class="form" part="form"></form>',this.$root.appendChild(r),this.addEventListener("change",n=>{if(!n?.detail)return;const{path:i,value:s}=n.detail;Array.isArray(i)&&i.length===0?this._state=s:fv(this._state??(this._state={}),i,s),this.dispatchEvent(new CustomEvent("form-change",{detail:{path:i,value:s,state:this._state}}))})}set schema(e){this._schema=cf(e);try{this._state=this._schema(null,{autofix:!0})}catch{this._state=Jr(this._schema)}this.render()}get schema(){return this._schema}set schemaJSON(e){this.schema=e}get schemaJSON(){return this._schema?.toJSON?.()}setData(e,r={validate:!0,autofix:!0}){if(!this._schema)throw new Error("请先设置 schema");const n=r.validate?this._schema(e??null,{autofix:r.autofix}):e;this._state=n,this.render()}getData(e={validate:!0,autofix:!0}){if(!this._schema)throw new Error("请先设置 schema");const r=this._state;return e.validate?this._schema(r??null,{autofix:e.autofix}):r}reset(){try{this._state=this._schema(null,{autofix:!0})}catch{this._state=Jr(this._schema)}this.render()}refresh(){this.render()}set i18n(e){this._i18n={...this._i18n,...e},this.render()}get i18n(){return this._i18n}render(){if(!this._schema)return;const e=this.$root.querySelector("form");e.innerHTML="";const r=Yr(this._schema,[],this._state,this._i18n.rootLabel,this._i18n);e.appendChild(r)}}Te("schema-form",bf);function mv(){Te("schema-form",bf),Te("schema-form-string",lf),Te("schema-form-number",uf),Te("schema-form-boolean",ff),Te("schema-form-date",df),Te("schema-form-const",hf),Te("schema-form-union",pf),Te("schema-form-tuple",mf),Te("schema-form-object",gf),Te("schema-form-array",yf),Te("schema-form-dict",vf)}const gv=Zl({__name:"SchemasteryFormVue",props:cu({schema:{},value:{},validateOnChange:{type:Boolean,default:!1}},{schema:{required:!0},schemaModifiers:{},value:{required:!1,default:{}},valueModifiers:{}}),emits:cu(["change"],["update:schema","update:value"]),setup(t,{expose:e,emit:r}){const n=$u(t,"schema"),i=$u(t,"value"),s=r,o=Ng("elRef");let a=!1,c=!1;const u=l=>{if(c)return;console.info("Form changed:",l.detail);const f=o.value,v=t.validateOnChange?f.getData({validate:!0}):l.detail.state;a=!0,i.value=v,Ki(()=>{a=!1}),s("change",l.detail)};return iu(()=>{mv()}),qo(()=>{const l=o.value;n.value&&(l.schema=n.value),i.value!==void 0&&l.setData(i.value,{validate:!1,autofix:!0}),l.addEventListener("form-change",u)}),su(()=>{o.value?.removeEventListener("form-change",u)}),Rn(()=>n,l=>{a||o.value&&l&&o.value.schema!==l.value&&(c=!0,o.value.schema=l.value,Ki(()=>{c=!1}))},{deep:!1}),Rn(()=>i,l=>{if(a||!o.value||l.value===void 0)return;const f=o.value.getData({validate:!1});JSON.stringify(f)!==JSON.stringify(l.value)&&(c=!0,o.value.setData(l.value,{validate:!1}),Ki(()=>{c=!1}))},{deep:!0}),e({setData(l,f){const v=o.value;v.setData(l,{validate:!!f?.validate}),f?.emit&&(i.value=v.getData({validate:!!f?.validate}))},getData(l){return o.value.getData(l)},setSchema(l,f=!0){o.value.schema=l,f&&(n.value=l)},refresh(){o.value.refresh()},reset(){o.value.reset()},el:o}),(l,f)=>(Vr(),Ln("schema-form",Fu({ref_key:"elRef",ref:o},l.$attrs),null,16))}});function Sr(t,e=new WeakMap){if(Ve(t))return Sr(t.value,e);if(t===null||typeof t!="object")return t;if(e.has(t))return e.get(t);if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);if(t instanceof Map){const i=new Map;return e.set(t,i),Array.from(t.entries()).forEach(([s,o])=>{i.set(s,Sr(o,e))}),i}if(t instanceof Set){const i=new Set;return e.set(t,i),Array.from(t).forEach(s=>{i.add(Sr(s,e))}),i}if(Array.isArray(t)){const i=[];e.set(t,i);for(const s of t)i.push(Sr(s,e));return i}const r=ye(t),n={};e.set(t,n);for(const i of Object.keys(r))n[i]=Sr(r[i],e);for(const i of Object.getOwnPropertySymbols(r))n[i]=Sr(r[i],e);return n}const yv={class:"preferences-ui-app"},vv={class:"tabs"},bv=["onClick","data-value"],_v={style:{"max-height":"20em",overflow:"auto"}},wv={style:{"max-height":"20em",overflow:"auto"}},xv=((t,e)=>{const r=t.__vccOpts||t;for(const[n,i]of e)r[n]=i;return r})(Zl({__name:"PreferencesForm",setup(t,{expose:e}){const r=uv(),n=Wi([]),i=Wi(""),s=zu(()=>a.value.find(c=>c.category===i.value)?.schema),o=Wi({}),a=Wi([]);return e({getValue(){return Sr(o)}}),fy(()=>{i.value&&(a.value=r.preferences.getConfigRegistries(i.value))}),qo(async()=>{r.inject(["preferences"],async c=>{o.value=await c.preferences.getAll(),n.value=c.preferences.getConfigCategories(),i.value=n.value[0].name})}),(c,u)=>(Vr(),Ln("div",yv,[xr("div",vv,[(Vr(!0),Ln(Et,null,au(n.value,l=>(Vr(),Ln("a",{class:Ri(["tab",{active:i.value===l.name}]),key:l.name,onClick:f=>i.value=l.name,"data-value":l.name},Ni(l.label),11,bv))),128))]),(Vr(!0),Ln(Et,null,au(a.value,l=>Ig((Vr(),xy(Hl(gv),{key:l.name,schema:l.schema,value:o.value,"onUpdate:value":u[0]||(u[0]=f=>o.value=f),"validate-on-change":!1,i18n:{rootLabel:""}},null,8,["schema","value"])),[[qy,i.value===l.category]])),128)),xr("details",null,[u[1]||(u[1]=xr("summary",null,"Debug Info",-1)),xr("pre",_v,Ni(s.value),1),xr("pre",wv,Ni(o.value),1)])]))}}),[["__scopeId","data-v-46564df3"]]);var Sv=Object.create,oa=Object.defineProperty,Ev=Object.getOwnPropertyDescriptor,_f=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),wf=t=>{throw TypeError(t)},Ov=(t,e,r)=>e in t?oa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pv=(t,e)=>oa(t,"name",{value:e,configurable:!0}),Cv=t=>[,,,Sv(t?.[_f("metadata")]??null)],kv=["class","method","getter","setter","accessor","field","value","get","set"],xf=t=>t!==void 0&&typeof t!="function"?wf("Function expected"):t,$v=(t,e,r,n,i)=>({kind:kv[t],name:e,metadata:n,addInitializer:s=>r._?wf("Already initialized"):i.push(xf(s||null))}),Iv=(t,e)=>Ov(e,_f("metadata"),t[3]),Av=(t,e,r,n)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(r);return n},Tv=(t,e,r,n,i,s)=>{var o,a,c,u=e&7,l=!1,f=0,v=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!l)&&Ev(i,r));Pv(i,r);for(var b=n.length-1;b>=0;b--)c=$v(u,r,a={},t[3],v),o=(0,n[b])(i,c),a._=1,xf(o)&&(i=o);return Iv(t,i),y&&oa(i,r,y),l?u^4?s:y:i},Sf,aa,Ef;Sf=[ot(["preferences","modal"])];class cs extends(Ef=kt){constructor(e){super(e,{},"preferences-ui"),this.ctx=e,e.set("preferencesUI",this),e.inject(["toolbox"],r=>{r.toolbox.addButton({id:"preferences",icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-settings",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M14.647 4.081a.724 .724 0 0 0 1.08 .448c2.439 -1.485 5.23 1.305 3.745 3.744a.724 .724 0 0 0 .447 1.08c2.775 .673 2.775 4.62 0 5.294a.724 .724 0 0 0 -.448 1.08c1.485 2.439 -1.305 5.23 -3.744 3.745a.724 .724 0 0 0 -1.08 .447c-.673 2.775 -4.62 2.775 -5.294 0a.724 .724 0 0 0 -1.08 -.448c-2.439 1.485 -5.23 -1.305 -3.745 -3.744a.724 .724 0 0 0 -.447 -1.08c-2.775 -.673 -2.775 -4.62 0 -5.294a.724 .724 0 0 0 .448 -1.08c-1.485 -2.439 1.305 -5.23 3.744 -3.745a.722 .722 0 0 0 1.08 -.447c.673 -2.775 4.62 -2.775 5.294 0zm-2.647 4.919a3 3 0 1 0 0 6a3 3 0 0 0 0 -6z"})]}),tooltip:"Open preferences",group:"group2",index:1/0,onClick:()=>this.showModal()}),this.addDisposeHandler(()=>{r.toolbox.removeButton("preferences")})})}showModal(){const e=this.ctx.modal.show({className:"in-page-edit",sizeClass:"small",outSideClose:!1,center:!0,title:"InPageEdit Prefrences",content:O(ci,{children:O(gr,{})})});e.get$wrapper().addClass("dialog");const r=O("div",{id:"ipe-preferences-app",style:{minHeight:"65vh"}});e.setContent(r);const n=this.createFormApp(),i=n.mount(r);e.setButtons([{label:"Save",className:"btn",method:()=>{const s=i.getValue();Object.entries(s).forEach(([o,a])=>{this.ctx.preferences.set(o,a).catch(console.error)}),e.close()}},{label:"Cancel",className:"btn btn-danger",method:()=>{e.close()}}]),e.get$modal().on("onClose.ssi-modal",()=>{n.unmount()})}createFormApp(){const e=ov(xv);return lv(this.ctx,e),e}}aa=Cv(Ef),cs=Tv(aa,0,"PluginPreferencesUI",Sf,cs),Av(aa,1,cs);const Rv=Object.freeze(Object.defineProperty({__proto__:null,get PluginPreferencesUI(){return cs}},Symbol.toStringTag,{value:"Module"}));he.BasePlugin=kt,he.InPageEdit=yr,he.Inject=ot,he.Schema=ke,he.Service=Tr,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
103
103
  //# sourceMappingURL=index.umd.js.map