MediaWiki:DiffTool.js: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
Created page with "(()=>{var Mt=new Proxy(()=>{},{get:()=>Mt,apply:()=>Mt}),he=Mt;var ge=new Map;async function yr(t,n){let e=await br(t,n);return ge.set(e,n),e.on("message",wr.bind(null,e)),{run:async()=>await Dr(e,"run")}}async function br(t,n){let e=new he.Worker(t);return e.on("error",()=>n.log("!Worker error!")),new Promise(r=>{let i=o=>{o?.type==="ready"&&(e.off("message",i),r(e))};e.on("message",i)})}async function wr(t,n){let e=ge.get(t),{type:r,payload:i}=n;if(typeof e[r]!="functi..."
 
No edit summary
Line 1: Line 1:
(()=>{var Mt=new Proxy(()=>{},{get:()=>Mt,apply:()=>Mt}),he=Mt;var ge=new Map;async function yr(t,n){let e=await br(t,n);return ge.set(e,n),e.on("message",wr.
//Source:

Revision as of 15:06, 13 October 2026

//Source:https://github.com/Aurelain/oe-wiki/tree/main/src/diff
(()=>{var I,d,_e,Ce,x,te,le,ie,z,D,F,se,J,Z,G,Pe,O={},H=[],Se=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$=Array.isArray;function w(t,e){for(var n in e)t[n]=e[n];return t}function K(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function je(t,e,n){var i,_,r,l={};for(r in e)r=="key"?i=e[r]:r=="ref"?_=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?I.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)l[r]===void 0&&(l[r]=t.defaultProps[r]);return W(t,l,i,_,null)}function W(t,e,n,i,_){var r={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:_??++_e,__i:-1,__u:0};return _==null&&d.vnode!=null&&d.vnode(r),r}function A(t){return t.children}function T(t,e){this.props=t,this.context=e}function S(t,e){if(e==null)return t.__?S(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?S(t):null}function Ee(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],_=[],r=w({},e);r.__v=e.__v+1,d.vnode&&d.vnode(r),Q(t.__P,r,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,n??S(e),!!(32&e.__u),_),r.__v=e.__v,r.__.__k[r.__i]=r,pe(i,r,_),e.__e=e.__=null,r.__e!=n&&ae(r)}}function ae(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),ae(t)}function ne(t){(!t.__d&&(t.__d=!0)&&x.push(t)&&!R.__r++||te!=d.debounceRendering)&&((te=d.debounceRendering)||le)(R)}function R(){try{for(var t,e=1;x.length;)x.length>e&&x.sort(ie),t=x.shift(),e=x.length,Ee(t)}finally{x.length=R.__r=0}}function ce(t,e,n,i,_,r,l,a,c,s,u){var h,o,f,m,g,v,y=i&&i.__k||H,p=e.length;for(c=Te(n,e,y,c,p),h=0;h<p;h++)(f=n.__k[h])!=null&&(o=f.__i!=-1&&y[f.__i]||O,f.__i=h,v=Q(t,f,o,_,r,l,a,c,s,u),m=f.__e,f.ref&&o.ref!=f.ref&&(o.ref&&X(o.ref,null,f),u.push(f.ref,f.__c||m,f)),g==null&&m!=null&&(g=m),4&f.__u?(c=ue(f,c,t),o.__e&&(o.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=g,c}function Te(t,e,n,i,_){var r,l,a,c,s,u=n.length,h=u,o=0;for(t.__k=new Array(_),r=0;r<_;r++)(l=e[r])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=t.__k[r]=W(null,l,null,null,null):$(l)?l=t.__k[r]=W(A,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=t.__k[r]=W(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):t.__k[r]=l,c=r+o,l.__=t,l.__b=t.__b+1,a=null,(s=l.__i=Ae(l,n,c,h))!=-1&&(h--,(a=n[s])&&(a.__u|=2)),a==null||a.__v==null?(s==-1&&(_>u?o--:_<u&&o++),typeof l.type!="function"&&(l.__u|=4)):s!=c&&(s==c-1?o--:s==c+1?o++:(s>c?o--:o++,l.__u|=4))):t.__k[r]=null;if(h)for(r=0;r<u;r++)(a=n[r])!=null&&(2&a.__u)==0&&(a.__e==i&&(i=S(a)),he(a,a));return i}function ue(t,e,n){var i,_;if(typeof t.type=="function"){for(i=t.__k,_=0;i&&_<i.length;_++)i[_]&&(i[_].__=t,e=ue(i[_],e,n));return e}t.__e!=e&&(e&&t.type&&!e.parentNode&&(e=S(t)),e=n.insertBefore(t.__e,e||null));do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Ae(t,e,n,i){var _,r,l,a=t.key,c=t.type,s=e[n],u=s!=null&&(2&s.__u)==0;if(s===null&&a==null||u&&a==s.key&&c==s.type)return n;if(i>(u?1:0)){for(_=n-1,r=n+1;_>=0||r<e.length;)if((s=e[l=_>=0?_--:r++])!=null&&(2&s.__u)==0&&a==s.key&&c==s.type)return l}return-1}function re(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Se.test(e)?n:n+"px"}function N(t,e,n,i,_){var r,l;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||re(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||re(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(se,"$1")),l=e.toLowerCase(),e=l in t||e=="onFocusOut"||e=="onFocusIn"?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?i?n[F]=i[F]:(n[F]=J,t.addEventListener(e,r?G:Z,r)):t.removeEventListener(e,r?G:Z,r);else{if(_=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function oe(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[D]==null)e[D]=J++;else if(e[D]<n[F])return;return n(d.event?d.event(e):e)}}}function Q(t,e,n,i,_,r,l,a,c,s){var u,h,o,f,m,g,v,y,p,b,M,P,U,ee,L,B,k=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),r=[a=e.__e=n.__e]),(u=d.__b)&&u(e);e:if(typeof k=="function"){h=l.length;try{if(p=e.props,b=k.prototype&&k.prototype.render,M=(u=k.contextType)&&i[u.__c],P=u?M?M.props.value:u.__:i,n.__c?y=(o=e.__c=n.__c).__=o.__E:(b?e.__c=o=new k(p,P):(e.__c=o=new T(p,P),o.constructor=k,o.render=Ue),M&&M.sub(o),o.state||(o.state={}),o.__n=i,f=o.__d=!0,o.__h=[],o._sb=[]),b&&o.__s==null&&(o.__s=o.state),b&&k.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=w({},o.__s)),w(o.__s,k.getDerivedStateFromProps(p,o.__s))),m=o.props,g=o.state,o.__v=e,f)b&&k.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),b&&o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(b&&k.getDerivedStateFromProps==null&&p!==m&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(p,P),e.__v==n.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(p,o.__s,P)===!1){e.__v!=n.__v&&(o.props=p,o.state=o.__s,o.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(E){E&&(E.__=e)}),H.push.apply(o.__h,o._sb),o._sb=[],o.__h.length&&l.push(o),a=S(n);break e}o.componentWillUpdate!=null&&o.componentWillUpdate(p,o.__s,P),b&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(m,g,v)})}if(o.context=P,o.props=p,o.__P=t,o.__e=!1,U=d.__r,ee=0,b)o.state=o.__s,o.__d=!1,U&&U(e),u=o.render(o.props,o.state,o.context),H.push.apply(o.__h,o._sb),o._sb=[];else do o.__d=!1,U&&U(e),u=o.render(o.props,o.state,o.context),o.state=o.__s;while(o.__d&&++ee<25);o.state=o.__s,o.getChildContext!=null&&(i=w(w({},i),o.getChildContext())),b&&!f&&o.getSnapshotBeforeUpdate!=null&&(v=o.getSnapshotBeforeUpdate(m,g)),L=u!=null&&u.type===A&&u.key==null?de(u.props.children):u,a=ce(t,$(L)?L:[L],e,n,i,_,r,l,a,c,s),o.base=e.__e,e.__u&=-161,o.__h.length&&l.push(o),y&&(o.__E=o.__=null)}catch(E){if(l.length=h,e.__v=null,c||r!=null){if(E.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;r!=null&&(r[r.indexOf(a)]=null),e.__e=a}else if(r!=null)for(B=r.length;B--;)K(r[B])}else e.__e=n.__e;e.__k==null&&(e.__k=n.__k||[]),E.then||fe(e),d.__e(E,e,n)}}else r==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=Me(n.__e,e,n,i,_,r,l,c,s);return(u=d.diffed)&&u(e),128&e.__u?void 0:a}function fe(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(fe))}function pe(t,e,n){for(var i=0;i<n.length;i++)X(n[i],n[++i],n[++i]);d.__c&&d.__c(e,t),t.some(function(_){try{t=_.__h,_.__h=[],t.some(function(r){r.call(_)})}catch(r){d.__e(r,_.__v)}})}function de(t){return typeof t!="object"||t==null||t.__b>0?t:$(t)?t.map(de):t.constructor!==void 0?null:w({},t)}function Me(t,e,n,i,_,r,l,a,c){var s,u,h,o,f,m,g,v=n.props||O,y=e.props,p=e.type;if(p=="svg"?_="http://www.w3.org/2000/svg":p=="math"?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),r!=null){for(s=0;s<r.length;s++)if((f=r[s])&&"setAttribute"in f==!!p&&(p?f.localName==p:f.nodeType==3)){t=f,r[s]=null;break}}if(t==null){if(p==null)return document.createTextNode(y);t=document.createElementNS(_,p,y.is&&y),a&&(d.__m&&d.__m(e,r),a=!1),r=null}if(p==null)v===y||a&&t.data==y||(t.data=y);else{if(r=p=="textarea"&&y.defaultValue!=null?null:r&&I.call(t.childNodes),!a&&r!=null)for(v={},s=0;s<t.attributes.length;s++)v[(f=t.attributes[s]).name]=f.value;for(s in v)f=v[s],s=="dangerouslySetInnerHTML"?h=f:s=="children"||s in y||s=="value"&&"defaultValue"in y||s=="checked"&&"defaultChecked"in y||N(t,s,null,f,_);for(s in y)f=y[s],s=="children"?o=f:s=="dangerouslySetInnerHTML"?u=f:s=="value"?m=f:s=="checked"?g=f:a&&typeof f!="function"||v[s]===f||N(t,s,f,v[s],_);if(u)a||h&&(u.__html==h.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(h&&(t.innerHTML=""),ce(e.type=="template"?t.content:t,$(o)?o:[o],e,n,i,p=="foreignObject"?"http://www.w3.org/1999/xhtml":_,r,l,r?r[0]:n.__k&&S(n,0),a,c),r!=null)for(s=r.length;s--;)K(r[s]);a&&p!="textarea"||(s="value",p=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[s]||p=="progress"&&!m||p=="option"&&m!=v[s])&&N(t,s,m,v[s],_),s="checked",g!=null&&g!=t[s]&&N(t,s,g,v[s],_))}return t}function X(t,e,n){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(_){d.__e(_,n)}}function he(t,e,n){var i,_;if(d.unmount&&d.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||X(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(r){d.__e(r,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(_=0;_<i.length;_++)i[_]&&he(i[_],e,n||typeof t.type!="function");n||K(t.__e),t.__c=t.__=t.__e=void 0}function Ue(t,e,n){return this.constructor(t,n)}function me(t,e,n){var i,_,r,l;e==document&&(e=document.documentElement),d.__&&d.__(t,e),_=(i=typeof n=="function")?null:n&&n.__k||e.__k,r=[],l=[],Q(e,t=(!i&&n||e).__k=je(A,null,[t]),_||O,O,e.namespaceURI,!i&&n?[n]:_?null:e.firstChild?I.call(e.childNodes):null,r,!i&&n?n:_?_.__e:e.firstChild,i,l),pe(r,t,l),t.props.children=null}I=H.slice,d={__e:function(t,e,n,i){for(var _,r,l;e=e.__;)if((_=e.__c)&&!_.__)try{if((r=_.constructor)&&r.getDerivedStateFromError!=null&&(_.setState(r.getDerivedStateFromError(t)),l=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(t,i||{}),l=_.__d),l)return _.__E=_}catch(a){t=a}throw t}},_e=0,Ce=function(t){return t!=null&&t.constructor===void 0},T.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=w({},this.state),typeof t=="function"&&(t=t(w({},n),this.props)),t&&w(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ne(this))},T.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ne(this))},T.prototype.render=A,x=[],le=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ie=function(t,e){return t.__v.__b-e.__v.__b},R.__r=0,z=Math.random().toString(8),D="__d"+z,F="__a"+z,se=/(PointerCapture)$|Capture$/i,J=0,Z=oe(!1),G=oe(!0),Pe=0;var Fe=0;function V(t,e,n,i,_,r){e||(e={});var l,a,c=e;if("ref"in c)for(a in c={},e)a=="ref"?l=e[a]:c[a]=e[a];var s={type:t,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fe,__i:-1,__u:0,__source:_,__self:r};if(typeof t=="function"&&(l=t.defaultProps))for(a in l)c[a]===void 0&&(c[a]=l[a]);return d.vnode&&d.vnode(s),s}var ye;function Le(t,e,n=0,i={}){ye={App:t,selector:e,importance:n,props:i},ge()===!1&&window.addEventListener("load",ve)}function ve(){window.removeEventListener("load",ve),ge()}function ge(){let{App:t,selector:e,importance:n,props:i}=ye,_=document.querySelector(e);if(!_)return!1;if((Number(_.dataset.importance)||0)>n){console.warn("Refused to mount, as the existing content is more important!");return}return _.dataset.importance=n,_.innerHTML="",me(V(t,{...i}),_),!0}var be=Le;var Ne={data:""},De=t=>{if(typeof window=="object"){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||Ne};var We=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Oe=/\/\*[^]*?\*\/|  +/g,ke=/\n+/g,j=(t,e)=>{let n="",i="",_="";for(let r in t){let l=t[r];r[0]=="@"?r[1]=="i"?n=r+" "+l+";":i+=r[1]=="f"?j(l,r):r+"{"+j(l,r[1]=="k"?"":e)+"}":typeof l=="object"?i+=j(l,e?e.replace(/([^,])+/g,a=>r.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):r):l!=null&&(r=r[1]=="-"?r:r.replace(/[A-Z]/g,"-$&").toLowerCase(),_+=j.p?j.p(r,l):r+":"+l+";")}return n+(e&&_?e+"{"+_+"}":_)+i},C={},we=t=>{if(typeof t=="object"){let e="";for(let n in t)e+=n+we(t[n]);return e}return t},He=(t,e,n,i,_)=>{let r=we(t),l=C[r]||(C[r]=(c=>{let s=0,u=11;for(;s<c.length;)u=101*u+c.charCodeAt(s++)>>>0;return"go"+u})(r));if(!C[l]){let c=r!==t?t:(s=>{let u,h,o=[{}];for(;u=We.exec(s.replace(Oe,""));)u[4]?o.shift():u[3]?(h=u[3].replace(ke," ").trim(),o.unshift(o[0][h]=o[0][h]||{})):o[0][u[1]]=u[2].replace(ke," ").trim();return o[0]})(t);C[l]=j(_?{["@keyframes "+l]:c}:c,n?"":"."+l)}let a=n&&C.g;return n&&(C.g=C[l]),((c,s,u,h)=>{h?s.data=s.data.replace(h,c):s.data.indexOf(c)===-1&&(s.data=u?c+s.data:s.data+c)})(C[l],e,i,a),l},Re=(t,e,n)=>t.reduce((i,_,r)=>{let l=e[r];if(l&&l.call){let a=l(n),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;l=c?"."+c:a&&typeof a=="object"?a.props?"":j(a,""):a===!1?"":a}return i+_+(l??"")},"");function q(t){let e=this||{},n=t.call?t(e.p):t;return He(n.unshift?n.raw?Re(n,[].slice.call(arguments,1),e.p):n.reduce((i,_)=>Object.assign(i,_&&_.call?_(e.p):_),{}):n,De(e.target),e.g,e.o,e.k)}var Ke=q.bind({g:1}),Qe=q.bind({k:1});var Ie=q`
    color: #fff;
`;var Y=class extends T{render(){return V("div",{class:Ie,children:"Hello"})}onPickDirectoryClick=async()=>{}},xe=Y;function $e(){be(xe,".diff-root",0)}$e();})();