612 lines
770 KiB
HTML
612 lines
770 KiB
HTML
|
|
<!doctype html>
|
||
|
|
<head>
|
||
|
|
<title>Nuxt Server Data</title>
|
||
|
|
<meta charset="utf-8"/>
|
||
|
|
<meta name="viewport">
|
||
|
|
<meta name="format-detection" content="telephone=no">
|
||
|
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABBDSURBVHhe7Z13cBT3FcdNnDjNaZ5xnMkfKZNJ4iROJhMnY0+axuhO5e4QSLuHqDJFgDGiGVGMAQECBLYpMkWIYgHGFIGNMcjCgITpmGowcCqIYkyHiCLACEm/vLf31hx37057Rbo7+H1mvmOs++2vvLe/fb99u/e7RyQSiUQikUgkEolEIpFIJBKJRCKRSCQSiUQikUgkwZOVlfWNOEvKCyarUmC2KKdAl0xWdUpMzIvfoSKSB5GWCeofzVZ1ouZ0qyo8ZFHHU1HJg0LLVu2eAocPhNm+l3W6i6DMNZvN9j06VBKtPK+q341NVDvAjC4yWZQ6ztneNHhywcHZpeU9qSpJtIBx3WRTYjGumyzqdc65RtQ54zUxu7RM5JU4GmaVOk7lbXJ0oSYkkYjZmvwMOG4izPQv3J0ZiOJatRW5a/dqJ4GuvNKympmbK16iJiXhJsZi/xnGdXDYfncH+qOEpFT275lvFtx3Arjo3JKd55+ibkiaE1ycxVnVjnC79pG/cd1VqZ17iLy5C8SxqhPi3WXvsWXs3fpxzteEoWHGRscg6pakKcG4HmtNMUFMXwAz/gbnLCOyJXcQOW/kit179ov6+nqhc/7CRRFns7PHvL5iC3sC6JpTUj6TuikJNbCC/zPM8kng9C855xgROnbI8DHi4w2bxK3bt8nlngwaOoo9PmPMW6zjXZVX6lhKXZYEiymp3c+1+3WL+hnnEKNK7z1QLFuxSly8dJlc7Jvij0vYelq36w5Odng43V35n5SNoiFI/CXGbn8c4zrcr68LJq7bO3bX4npFZRW51Tg3b97SQgRXb/bCYtbproKrgMj9uCKOhiRpDLvd/ijGdZjtC4ON6xNenyY+3bPvvrgeCOMmTmHbSB+awzrdXbAwvE3Dk3gDU7Imq/I6OP0MZ2wjwrieOSxLi+s1NTfJfcGDJxHXXmJyRzFz/ees0901q6SskIYqcSc+Xv09XOarOSMbUbde/cXSwvfFhYuXyGWhpa6uTgsjXNsj8lawDvdQSVlD1qZNj9OQJa6AIZe7G7YxoUNm5r8dUFwPhFnQFtePtL7O1LARzdroKKIhS1yBlf1hzrjuwriO8XjX7n3i7t06ck3zUHmsiu0Tlxr2oToassQVWOGv4IyLwrj+CtyL4+1YKON6IKT3HsD20UdqmJF8kugBnABtOcOiyiuOkfnDz9LCVWwf23bvzziaV37p0SM0bIkOvmrlbRH4/uoiMn/4weSRt9TwGyu2sg73UInjLg1b4gqcAHM4w/buN4TMHxkMHj7ao4+ovmOn8w5nREOWuBJvVf7DGRZ18tRpMn/4wRwD18fW7dPBuY2nhlFz1x56loYtcaEFrAWOc8adV7CYzB9+bt26JWwpHT36iMpetI51uLvySsvH0pglrsDt4AzOsG3saaKhoYFcEH5y3pjm0UdUj2HGUsP5JeWTaciSuDj1CZNVzTBblB2cUXWt/rCYzB9+du89wPbRmRo+zDrdVQ/9CZCQkPBtMJgK+sBsVWpdjehNaekZZP7wg6nh1E7pbD+NpIbzNx59nUzxUNECF3oQ5/NB/+OM51t2cfXqNXJB+Jk9dwHTR1V07td4anhmydEUssmDj8ma8luI7WPhNq+KM5g/mj5rLpk//OA7g1wf45MaTw1nZYnHyDwPJkbjur9SO3Ql80cGPfu8wvYzc/IC1vFOOerJTA8WgcR1TviUb+SYiexnqKoTp8j84adw5Wq2j6ndBjCOd2pWSdl5MtkDQZBx3SlLm/YiO2ey2LFrj/aUD6V26MaWHTl2Ipk//Fy6fMXv1HBeSVk+2S56CUVcR8MNHDJSFBVvYJ/yzcibxx5nS+lAJcJLXX29uHi1RmRkjmD7yaaGS8rE8uWHnyAzRhehiusvwu3c4qUrxNlz58mUPI6yCvZ41Nbtu6hU84KpqOobt0Xlmcvi07LTYqfjC5G3mH9CyKaGNzqqyJzRQajiekq7LuKtmXPEEUe505IG6dqzL1tfxsChVKJ5qLl9R5y8UC32Vp7RnO6qzQcrhdXbW8PuqeEt5c+RaSMfc6LaEmb8aW5gRoRxPSt7kti+81NRW1tLpvSPd5euZOuOb9U26Dd9G+NObZ04c/ma+Oz4OQ+nu2vwqBy2n66p4bxSx3EybeRjtXb4icmqXOEG1Zj6DxouPly7Tly/foNMGTgYJrwtspYXrqJSoaOuvkGL60e/uMg62pveWb2B7aOeGgbnN+R+VPEkmTfygZmfxA3Im9K69xEL3lkmvjxzlkwZOgYO5hdZad1fphLBwcV1f7XjyEmR0p6/a8HU8KyNlVPItNEBbqTADcZVbdqmianTZ4tDnx9p0id1eJfAtR8Hqq4OPDXsK64HolGTprP9bN8rs5rMGj3gFiq4Hw43IMx+bd66Q9y5E1hc95cbN2q09QTXl9wZ+VTKGHfuOuP6QQNx3Yi2HKoS85atEX0GjxIJSW3ZPuLiGUMqmTZ6gBNgHjegjIHDyJxND8bkS9duiswR4zz6gVLaNZ4aDjSue9OOo6fEsqJNYtjYN0UrtRPbL3eZEpKfJ7NGDyabGsMNBnX69Bkyb+jBYHK1BmLy2Stid7kzJhesLGL7gaqsOuE80AUtrmMdQcR1d63ZvFeMnzpH2Dv1YPvhQw24YwmZNapoAVeBE8yARMGiJU5Lh5CbX9WKUxCT9zExedvhEyLJnubRD9SI0ROoBozrtSGN6xv3OsS0eUtE196D2LYNyaJMI3tGHxC/xnGD6tStd0gWfhiTz1657jMmr926T5t53k4ATMKEMq5v+/y4Ftf7DR3tI64b0h5wficwYwunNaOQ2MTU3zED07T/wCFyo3/ocd0BMXkX4wBU6b4ykTt/qej2cibbtruWrC1l6zEqLa5/9Il4NRviutKZbcOQnDuMToyzpTxNJoxeTJbUP8AVIMdkVb/yGCjopb6DyaXGwLh+zCWuuwtnHsZ6bea1bufRni8Nz57M1tmY9KtLalovtl5Dsig3IFQW4J4GuGcRma/5wEZDtX2p2Zz8U3B4fxhQo9umxtvsjaZ4tbh+kY/rugrXbRGvjZ/q9RJvRJiEwWQMV7+78OqCcd3o1YWTCXcrsagbcPcS3MWEzNe82O32x+DsmwrOqtE6ZFWK0YH0sWHwnj/OpqbCgIr8feCzZdtOcvU9jMT1om0HRM70eTDzXmLrDUSLVq1n20Lh1WV+4VqK6/zef8akHAJbD8X9ish84cPLAu09+tgnzm1T1RiTRZ0P9Vxl6jEkfNiD1BuI65v2V4jpBYUiPWOI1/y+MfEJqkEjc+5rD+N6YfEW8eq4yUFdXeCKeAE0Jc5qj6xv84AhjjIdbnjBkvJLKuIBLk5gpo+nxYr7sX4rEWL1wcpT3uP64ZMQ14vFgOHZfsf1+2RRq/AFFFyUwonblSuDdwObP6sQRVsPiAm5c0Xqi0HEdatyG/5bGGtRrc8+2/NbZL7IAgyyxbPj2pbmw6mIBoYFGEhf+GyPe1mjopjHhofc+cs8HL9y/XYxYsI00aZdF4/yRoWvmIHy8ZUzGMbXt1IJCR1/CGO/yR2Di7kgri4NaFOY6T1NJvuPqLnIBR3NDAKkHMG4Dv+2w6VrDfx/wC9yaItB3HNXWxwqM7kyuJhCp6/beVBMmvG2aN/1ZY8yxqX19QOQii+j0FA9gM+X3DsmWCnHwPGjXkhI/Q1VHx2YbPZfwAyp9zKogLdXgzpxV+2J8a2UP1FTGpjPdi+LwhmXnjE4uLhuUXbAyZqBr51Rcz4xJyqJbD1GZVGr8eoSZ1H+CdVFb6IGZmUJO0A/BTPgOtRVgG8B+bqXBcNVcMcHJJe4TtUbJiYm5ptwkp9j6/UqpRba+xD+bfd1dYkqYq1qmudAjQlmAMb1IryXxZBBVfoEyo/g6jIqaJON64GAK3OuDXdRGOsXy
|
||
|
|
<style type="discovery/style" src="model.css">.view-button{position:relative;display:inline-block;box-sizing:border-box;padding:8px 12px;outline:none;margin:0;color:var(--discovery-view-button-color);background-color:var(--discovery-view-button-background-color);border:1px solid var(--discovery-view-button-border-color);border-radius:3px;font-family:inherit;font-size:inherit;line-height:1.2;text-align:center;cursor:pointer;--discovery-view-button-color: var(--discovery-color);--discovery-view-button-background-color: rgba(255, 255, 255, .1);--discovery-view-button-border-color: rgba(127, 127, 127, .4);--discovery-view-button-hover-background-color: rgba(221, 221, 221, .3);--discovery-view-button-hover-border-color: rgba(170, 170, 170, .6);--discovery-view-button-active-background-color: rgba(131, 131, 131, .25);--discovery-view-button-active-border-color: var(--discovery-view-button-border-color);--discovery-view-button-focus-background-color: var(--discovery-view-button-background-color);--discovery-view-button-focus-border-color: rgba(128, 128, 128, .6)}.view-button:empty:before{content:"\200b";float:left}.view-button:focus-visible{box-shadow:0 0 1px 3px #0af3;background-color:var(--discovery-view-button-focus-background-color);border-color:var(--discovery-view-button-focus-border-color);z-index:1}.view-button:hover,.view-button.discovery-view-popup-active{background-color:var(--discovery-view-button-hover-background-color);border-color:var(--discovery-view-button-hover-border-color)}.view-button:active{background-color:var(--discovery-view-button-active-background-color);border-color:var(--discovery-view-button-active-border-color)}.view-button[disabled]{opacity:.5;pointer-events:none;cursor:default}.view-button+.view-button{margin-left:1ex}.view-button-primary{--discovery-view-button-color: white;--discovery-view-button-background-color: #00aaff;--discovery-view-button-border-color: transparent;--discovery-view-button-hover-background-color: #009cf0;--discovery-view-button-hover-border-color: transparent;--discovery-view-button-active-background-color: #008ee0;--discovery-view-button-focus-border-color: transparent}.discovery-root-darkmode .view-button-primary{--discovery-view-button-color: #fffd;--discovery-view-button-background-color: #006aa3e6;--discovery-view-button-hover-background-color: #0074b3e6;--discovery-view-button-active-background-color: #006aa3d0}.view-button-danger{--discovery-view-button-color: white;--discovery-view-button-background-color: #ff6163;--discovery-view-button-border-color: transparent;--discovery-view-button-hover-background-color: #f05456;--discovery-view-button-hover-border-color: transparent;--discovery-view-button-active-background-color: #e34449;--discovery-view-button-focus-border-color: transparent}.discovery-root-darkmode .view-button-danger{--discovery-view-button-color: #fffd;--discovery-view-button-background-color: #c32224bf;--discovery-view-button-hover-background-color: #d02528bf;--discovery-view-button-active-background-color: #c32224a6}.view-button-warning{--discovery-view-button-color: rgba(0, 0, 0, .84);--discovery-view-button-background-color: #ffcf21;--discovery-view-button-border-color: transparent;--discovery-view-button-hover-background-color: #fcbd00;--discovery-view-button-hover-border-color: transparent;--discovery-view-button-active-background-color: #f7ad00;--discovery-view-button-focus-border-color: transparent}.discovery-root-darkmode .view-button-warning{--discovery-view-button-color: #eeee;--discovery-view-button-background-color: #ffd40199;--discovery-view-button-hover-background-color: #ffd91aa6;--discovery-view-button-active-background-color: #ffd4018e}.view-checkbox-list>.view-checkbox{display:block}.view-checkbox{--discovery-checkbox-size: max(1em, 14px);padding-left:var(--discovery-checkbox-size)}.view-checkbox>input{-webkit-appearance:none;appearance:none;content:"";font-size:inherit;display:inline-block;position:relative;top:2px;box-sizing:border-box;height:var(--discovery-checkbox-size);width:var(--discovery-checkbox-size);margin:0;margin-l
|
||
|
|
</style>
|
||
|
|
<style type="discovery/style" src="model-loader.css">.view-progress{max-width:300px;z-index:1;pointer-events:none}.view-progress.skip-fast-track{transition:opacity .25s var(--appearance-delay, .5s);will-change:opacity;contain:paint;@starting-style{opacity:0}}.view-progress.skip-fast-track.done:not(.error){display:none}.view-progress>.progress{content:"";display:block;position:relative;overflow:hidden;margin-top:4px;box-sizing:border-box;height:3px;background:#c6c6c64d;border-radius:2px}.view-progress>.progress:before{content:"";display:block;height:100%;width:100%;position:absolute;left:0;top:0;transform:scaleX(var(--progress, 0));transform-origin:left;background-color:var(--color, #1f7ec5)}.view-progress>.content.main-secondary{display:flex;white-space:nowrap;gap:1ex}.view-progress>.content>.secondary{flex:1;overflow:hidden;text-overflow:ellipsis;color:#888}:host{position:absolute;z-index:1001!important;padding:35px 40px;width:100%}.view-button{position:relative;display:inline-block;box-sizing:border-box;padding:8px 12px;outline:none;margin:0;color:var(--discovery-view-button-color);background-color:var(--discovery-view-button-background-color);border:1px solid var(--discovery-view-button-border-color);border-radius:3px;font-family:inherit;font-size:inherit;line-height:1.2;text-align:center;cursor:pointer;--discovery-view-button-color: var(--discovery-color);--discovery-view-button-background-color: rgba(255, 255, 255, .1);--discovery-view-button-border-color: rgba(127, 127, 127, .4);--discovery-view-button-hover-background-color: rgba(221, 221, 221, .3);--discovery-view-button-hover-border-color: rgba(170, 170, 170, .6);--discovery-view-button-active-background-color: rgba(131, 131, 131, .25);--discovery-view-button-active-border-color: var(--discovery-view-button-border-color);--discovery-view-button-focus-background-color: var(--discovery-view-button-background-color);--discovery-view-button-focus-border-color: rgba(128, 128, 128, .6)}.view-button:empty:before{content:"\200b";float:left}.view-button:focus-visible{box-shadow:0 0 1px 3px #0af3;background-color:var(--discovery-view-button-focus-background-color);border-color:var(--discovery-view-button-focus-border-color);z-index:1}.view-button:hover,.view-button.discovery-view-popup-active{background-color:var(--discovery-view-button-hover-background-color);border-color:var(--discovery-view-button-hover-border-color)}.view-button:active{background-color:var(--discovery-view-button-active-background-color);border-color:var(--discovery-view-button-active-border-color)}.view-button[disabled]{opacity:.5;pointer-events:none;cursor:default}.view-button+.view-button{margin-left:1ex}.view-button-primary{--discovery-view-button-color: white;--discovery-view-button-background-color: #00aaff;--discovery-view-button-border-color: transparent;--discovery-view-button-hover-background-color: #009cf0;--discovery-view-button-hover-border-color: transparent;--discovery-view-button-active-background-color: #008ee0;--discovery-view-button-focus-border-color: transparent}.discovery-root-darkmode .view-button-primary{--discovery-view-button-color: #fffd;--discovery-view-button-background-color: #006aa3e6;--discovery-view-button-hover-background-color: #0074b3e6;--discovery-view-button-active-background-color: #006aa3d0}.view-button-danger{--discovery-view-button-color: white;--discovery-view-button-background-color: #ff6163;--discovery-view-button-border-color: transparent;--discovery-view-button-hover-background-color: #f05456;--discovery-view-button-hover-border-color: transparent;--discovery-view-button-active-background-color: #e34449;--discovery-view-button-focus-border-color: transparent}.discovery-root-darkmode .view-button-danger{--discovery-view-button-color: #fffd;--discovery-view-button-background-color: #c32224bf;--discovery-view-button-hover-background-color: #d02528bf;--discovery-view-button-active-background-color: #c32224a6}.view-button-warning{--discovery-view-button-color: rgba(0, 0, 0, .84);--discovery-view-button-background-color: #ffcf21;--discovery-view-button-bor
|
||
|
|
</style>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<style>
|
||
|
|
html,
|
||
|
|
body {
|
||
|
|
height: 100%;
|
||
|
|
margin: 0;
|
||
|
|
padding: 0;
|
||
|
|
border: none;
|
||
|
|
-webkit-text-size-adjust: 100%;
|
||
|
|
}
|
||
|
|
.discovery {
|
||
|
|
height: 100dvh;
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<noscript type="discovery-noscript">
|
||
|
|
<style>body { margin: 16px }</style>
|
||
|
|
<p>Sorry, but this page requires JavaScript to display properly.</p>
|
||
|
|
<p>Please enable JavaScript in your browser settings or upgrade to a browser that supports JavaScript.</p>
|
||
|
|
</noscript>
|
||
|
|
<script>(()=>{var s1=Object.create;var ru=Object.defineProperty;var a1=Object.getOwnPropertyDescriptor;var l1=Object.getOwnPropertyNames;var u1=Object.getPrototypeOf,c1=Object.prototype.hasOwnProperty;var z=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ct=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Fe=(n,e)=>{for(var i in e)ru(n,i,{get:e[i],enumerable:!0})},f1=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of l1(e))!c1.call(n,l)&&l!==i&&ru(n,l,{get:()=>e[l],enumerable:!(o=a1(e,l))||o.enumerable});return n};var dn=(n,e,i)=>(i=n!=null?s1(u1(n)):{},f1(e||!n||!n.__esModule?ru(i,"default",{value:n,enumerable:!0}):i,n));var Vs,iu=z(()=>{Vs=[]});var d1,p1,pn,Ae,st=z(()=>{({toString:d1,hasOwnProperty:p1}=Object.prototype),pn=n=>d1.call(n),Ae=Object.hasOwn||((n,e)=>p1.call(n,e))});function gi(){return[performance.timeOrigin.toString(16),(1e4*performance.now()).toString(16),Math.random().toString(16).slice(2)].join("-")}var Ys=z(()=>{});var Et,er=z(()=>{Et=class{subscriber;value;constructor(e,i){this.subscriber=null,this.value=e,this.shouldUpdate=typeof i=="function"?i:this.shouldUpdate}get readonly(){let e=this;return{subscribe:this.subscribe.bind(this),subscribeSync:this.subscribeSync.bind(this),unsubscribe:this.unsubscribe.bind(this),get value(){return e.value}}}subscribe(e){return this.subscriber={callback:e,subscriber:this.subscriber},()=>this.unsubscribe(e)}subscribeSync(e){let i=this.subscribe(e);return e(this.value,i),i}unsubscribe(e){let i=this,o=this.subscriber;for(;o!==null;){if(o.callback===e){o.callback=null,i.subscriber=o.subscriber;break}i=o,o=o.subscriber}}shouldUpdate(e,i){return e!==i}set(e){return this.#e(e)!==!1}asyncSet(e){let i=this.#e(e);return i===!1?Promise.resolve(!1):Promise.all(i).then(()=>!0)}#e(e){if(!this.shouldUpdate(e,this.value))return!1;let i=[],o=this.subscriber;for(this.value=e;o!==null;){let{callback:l}=o;l!==null&&i.push(l(e,()=>this.unsubscribe(l))),o=o.subscriber}return i}}});function h1(n){let e=lh(n),i=new Map;return function(l){let c=i.get(l);return c===void 0&&(c=new Ks(e,l),i.set(l,c),m1(e,i)),c}}function g1(n){let e=lh(n);return function(o){return e?.getItem(o)??null}}function lh(n){let e="__storage_test__"+Math.random(),i;try{i=window[n]}catch{return null}try{i.setItem(e,e),i.removeItem(e)}catch(o){if(!(o instanceof DOMException&&(o.code===22||o.code===1014||o.name==="QuotaExceededError"||o.name==="NS_ERROR_DOM_QUOTA_REACHED")&&i.length!==0))return null}return i}function m1(n,e){n!==null&&!Qs.has(n)&&(Qs.set(n,e),Qs.size===1&&addEventListener("storage",i=>{let o=Qs.get(i.storageArea);if(o!==void 0){let l=o.get(i.key);l&&l.forceSync()}}))}var ou,su,Qs,Ks,au=z(()=>{er();ou=h1("localStorage"),su=g1("localStorage"),Qs=new Map;Ks=class extends Et{#e;#t;constructor(e,i){super(e?.getItem(i)??null),this.#e=e,this.#t=i}#n(){return this.#e?.getItem(this.#t)??null}get storage(){return this.#e}get key(){return this.#t}get(){return this.value}set(e){if(this.#e){let i=this.#n();if(e!==i)return this.#e.setItem(this.#t,e),super.set(e)}return!1}delete(){this.#e&&this.#e.removeItem(this.#t)}forceSync(){return this.#e?super.set(this.#n()):!1}}});function ch(n){return y1.includes(n)}function xo(){return matchMedia("(prefers-color-scheme:dark)")}function fh(n,e){let i=n;switch(n){case!0:n="dark";break;case!1:n="light";break;case"disabled":case"disable":case"off":n="light-only";break;case"only":n="dark-only";break}if(i!==n&&console.warn(`Used legacy value "${i}" for ColorSheme, value replaced for "${n}"`),n!=="light-only"&&n!=="dark-only"&&e){let o=su(uh);ch(o)&&(n=o)}return n}function v1(n){switch(n){case"light":case"dark":return"manual";case"light-only":case"dark-only":return"only";case"auto":return"auto";default:return n}}function lu(n){let e=mi(n);return e==="auto"?xo().matches?"dark":"light":e}function mi(n){switch(n){case"auto":return"auto";case"dark":case"dark-only":return"dark";case"light":case"light-only":default:return"light"}}function Xs(n="auto",e=!1){return lu(fh(n,e))}var uh,y1,Js,Zs,yi=z(()=>{au();uh="discoveryjs:color-scheme",y1=Object.freeze(["auto","light","dark
|
||
|
|
`+M.replace(/^[\r\n]+/,""):"")),f.progressbar.el.replaceWith(y)}f.disposeEmbed?.(),f.progressbar.dispose(),g&&g.remove()})}function LD(){let{discoveryLoader:n}=window,{push:e,finish:i}=n||{};if(typeof e=="function"){let f=function(){c=null,e(o.shift()),o.length>0?c=setTimeout(f,10):l!==null&&i(...l)},d=function(g){o.push(g),c||(c=setTimeout(f,10))},o=[],l=null,c=null;n.push=function(g){n.push=n.discoveryCliBase64?m=>d(Hh(m)):d,n.push(g)},n.finish=function(...g){l=g}}}function TD(){let n=document.createElement("div");return n.className="data-status",n.innerHTML='<div class="header">Getting data: <span class="elapsed-time"></span></div><div class="output"></div>',n.firstChild.addEventListener("click",function(){n.classList.toggle("collapsed")},!0),n.elapsedTimeEl=n.querySelector(":scope > .header > .elapsed-time"),n}function FD(n,e){let i=!1,o=!0,l=!1,c=TD(),f=()=>{n.progressbar.value.stage==="request"&&!c.parentNode&&n.progressbar.el.getRootNode().append(c)},d=setTimeout(()=>{if(n.progressbar.value.stage!=="request")return;n.progressbar.subscribe(({stage:N},A)=>{N!=="request"&&(A(),c.classList.add("finished"),g.close(),o=!1)});let g=new EventSource("data-status?data-request-id="+e),m=null,y,k,C,M,E,F=N=>{if(!(!o||!isFinite(N)||k!==void 0&&N<=k)){if(clearTimeout(C),k=Number(N),y&&k-y>=1e3&&(c.elapsedTimeEl.textContent=Mu(k-y,i?1:0)),m)for(let{started:A,elapsedTimeEl:b}of m.values())A&&(b.textContent=Mu(k-A,1));M=Date.now(),C=setTimeout(()=>F(k+(Date.now()-M)-5),42)}};g.addEventListener("message",N=>{try{let A=JSON.parse(N.data);switch(A.type){case"start":setTimeout(f,3e3),y=A.timestamp,l=!0;break;case"finish":break;case"crash":if(i=!0,f(),m)for(let{started:b,el:L}of m.values())b&&(L.classList.add("crashed"),L.classList.remove("started"),L.classList.toggle("collapsed",L!==E));break;case"stderr":case"stdout":{let b=document.createElement("div");if(b.className=A.type,b.append(String(A.chunk)),!m)f(),c.lastChild.append(b),Eu(b);else{let L=m.get(A.stepId);L&&(L.contentEl.append(b),L.el.classList.add("has-output"),Eu(b),A.type=="stderr"&&(E=L.el))}break}case"plan":{let b=Wh(A.plan.steps);m=b.map,c.lastChild.innerHTML="",c.lastChild.appendChild(b.el),m&&f();break}case"plan-step-event":{let b=m.get(A.stepId);if(b)switch(A.stepEvent){case"start":b.started=A.timestamp,b.el.classList.add("started"),Eu(b.el);break;case"finish":b.elapsedTimeEl.textContent=Mu(A.timestamp-b.started),b.started=!1,b.el.classList.remove("started"),b.el.classList.add("finished");break;case"summary":b.summaryEl.innerHTML=OD(A.data);break;default:console.warn("Unhandled data status SSE pipeline step event",A)}else console.warn("Pipeline step not found",A);break}default:console.warn("Unhandled data status SSE event",A)}F(A.timestamp)}catch(A){console.error("SSE message parse error",A)}}),g.addEventListener("server-time",({data:N})=>{F(N)}),g.addEventListener("done",()=>{g.close(),o=!1})},150);n.then(()=>clearTimeout(d),g=>{if(o=!1,!!l){i?(g.supressLoadDataError=!0,n.el.classList.add("generate-data-crash")):c.classList.add("compliment-error","collapsed");for(let m of c.querySelectorAll(".plan-step.started"))m.classList.remove("started");c.classList.add("crashed"),c.firstChild.firstChild.textContent="Retrieving data failed "+(c.elapsedTimeEl.textContent?"in ":"")}})}function Eu(n){try{typeof n.scrollIntoViewIfNeeded=="function"?n.scrollIntoViewIfNeeded(!1):n.scrollIntoView({block:"nearest"})}catch{}}function Wh(n,e=0,i=new Map){let o=document.createElement("ul");o.className="plan-step-list",o.style.setProperty("--level",e);for(let l of n){let c=o.appendChild(document.createElement("li")),f=c.appendChild(document.createElement("div")),d=f.appendChild(document.createElement("span")),g=f.appendChild(document.createElement("span")),m=f.appendChild(document.createElement("span")),y=f.appendChild(document.createElement("span")),k=f.appendChild(document.createElement("span")),C=c.appendChild(document.createElement("div"));i.set(l.id,{step:l,el:c,elapsedTimeEl:k,summaryEl:y,contentEl:C,started:!1}),c.className="plan-step collapsed",f.className="plan-step__header",f.addE
|
||
|
|
`+this.showPosition(),{text:i.yytext,token:"BAD_TOKEN"});break}case 68:return 5}},setInput(e,i){return this.yy=i||this.yy||{},this._input=e,this._more=!1,this._backtrack=!1,this.done=!1,this.currentCondition="INITIAL",this.conditionStack=["INITIAL"],this.offset=0,this.yytext=this.match="",this.yyleng=0,this.yylineno=0,this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.yylloc.range=[0,0],this},parseError(e,i){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,i)},input(){let e=this._input[this.offset],i=/\n|\r\n?|\u2028|\u2029/g.test(e);return this.offset++,this.yyleng++,this.yytext=this.match=this.yytext+e,i?(this.yylineno++,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++,this.yylloc.range[1]++,e},lineColumnForOffset(e=this.offset,i=this._input,o=1,l=0){let c=/\n|\r\n?|\u2028|\u2029/g,f=o,d=l,g=0,m;for(;(m=c.exec(i))!==null;)if(m.index<e)f++,d=0,g=m.index+m[0].length;else{d+=e-g,g=-1;break}return g!==-1&&(d+=e-g),{line:f,column:d}},setMatch(e,i){let o=this._input.slice(e,i),l=e!==this.offset?this.lineColumnForOffset(e):{line:this.yylloc.last_line,column:this.yylloc.last_column},c=e!==i?this.lineColumnForOffset(i-e,o,l.line,l.column):l;this.yytext=this.match=o,this.yyleng=i-e,this.offset=i,this.yylineno=c.line-1,this.yylloc={first_line:l.line,first_column:l.column,last_line:c.line,last_column:c.column},this.yylloc.range=[e,i]},less(e){let i=this.offset-this.match.length;this.setMatch(i,i+e)},unput(e){let i=this.match.length-e.length;if(!this.match.startsWith(e,i))throw new Error("Lexer#unput() should receive a part of matched text only");this.less(i)},more(){this._more=!0},reject(){throw new Error("reject() is allowed only when options.backtrack_lexer = true")},showPosition(e=this.offset-this.match.length){let i=this._input,o=Math.max(e-20,0),l=Math.min(e+20,i.length),c=(o===0?"":"...")+i.slice(o,e).replace(/\n|\r\n?|\u2028|\u2029/g,"\\n"),f=i.slice(e,l).replace(/\n|\r\n?|\u2028|\u2029/g,"\\n")+(l===i.length?"":"...");return c+f+`
|
||
|
|
${"-".repeat(c.length)}^`},test_match(e,i){let o;this._more=!1,this._backtrack=!1,this.setMatch(this.offset,this.offset+e[0].length),this.matches=e;let l=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]);return!l&&this._backtrack?(Object.assign(this,o),!1):(this.eof()||(this.done=!1),typeof l=="number"&&this.yy.parser?this.yy.parser.terminals_[l]:l||!1)},eof(){return this.offset===this._input.length},next(){if(this.done)return 1;this.eof()&&(this.done=!0),this._more||(this.yytext="",this.match="");let e,i;for(let o of this.conditions[this.currentCondition].rules){let l=this.rules[o],c=this._input.slice(this.offset),f;if(typeof l=="function"){let d=l(c,this.currentCondition);switch(typeof d){case"string":f=[d];break;case"number":f=[c.slice(0,d)];break;default:f=d}}else f=c.match(l);if(f&&(!e||f[0].length>e[0].length)){e=f,i=o;break}}if(e)return this.test_match(e,i);if(this.eof())return 1;this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
||
|
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex(){let e;for(;!e;)e=this.next();return e},begin(e){this.currentCondition=e,this.conditionStack.push(e)},pushState(e){this.begin(e)},popState(){return this.conditionStack.pop(),this.currentCondition=this.conditionStack.length?this.conditionStack[this.conditionStack.length-1]:"INITIAL"},topState(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},stateStackSize(){return this.conditionStack.length}}})();Bu.prototype={Parser:Bu,lexer:ID,symbols_:{error:2,root:3,block:4,EOF:5,definitions:6,e:7,def:8,$:9,";":10,":":11,$ident:12,ident:13,IDENT:14,$IDENT:15,condConsequent:16,"?":17,condAlternate:18,query:19,"=>":20,"(":21,")":22,functionArgs:23,compareFunction:24,NOT:25,NO:26,"-":27,"+":28,"|":29,IS:30,assertion:31,IN:32,HAS:33,NOTIN:34,HASNO:35,AND:36,OR:37,"??":38,"*":39,"/":40,"%":41,"=":42,"!=":43,"<":44,"<=":45,">":46,">=":47,"~=":48,queryRoot:49,relativePath:50,"@":51,"#":52,$$:53,STRING:54,NUMBER:55,REGEXP:56,LITERAL:57,template:58,object:59,array:60,"[":61,sliceNotation:62,"]":63,"method()":64,".":65,".(":66,".[":67,"..":68,"..(":69,"METHOD(":70,arguments:71,"$METHOD(":72,",":73,functionArg:74,templateString:75,templateStart:76,templateTail:77,templateEnd:78,templateContinue:79,TEMPLATE:80,TPL_START:81,TPL_CONTINUE:82,TPL_END:83,"{":84,"}":85,objectEntries:86,objectEntry:87,objectEntryKeyLiteral:88,"...":89,arrayElements:90,arrayElement:91,assertionTerm:92,assertionList:93,compareExpr:94,ORDER:95,sliceNotationComponent:96,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",9:"$",10:";",11:":",14:"IDENT",15:"$IDENT",17:"?",20:"=>",21:"(",22:")",25:"NOT",26:"NO",27:"-",28:"+",29:"|",30:"IS",32:"IN",33:"HAS",34:"NOTIN",35:"HASNO",36:"AND",37:"OR",38:"??",39:"*",40:"/",41:"%",42:"=",43:"!=",44:"<",45:"<=",46:">",47:">=",48:"~=",51:"@",52:"#",53:"$$",54:"STRING",55:"NUMBER",56:"REGEXP",57:"LITERAL",61:"[",63:"]",65:".",66:".(",67:".[",68:"..",69:"..(",70:"METHOD(",72:"$METHOD(",73:",",80:"TEMPLATE",81:"TPL_START",82:"TPL_CONTINUE",83:"TPL_END",84:"{",85:"}",89:"...",95:"ORDER"},productions_:[0,[3,2],[4,2],[4,1],[4,1],[4,0],[6,1],[6,2],[8,2],[8,4],[8,2],[8,4],[13,1],[12,1],[16,2],[16,1],[18,2],[18,1],[18,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,1],[7,2],[7,2],[7,2],[7,2],[7,3],[7,4],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[19,1],[19,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,3],[49,2],[49,2],[49,1],[49,1],[49,3],[49,4],[49,2],[49,2],[49,3],[49,3],[49,2],[49,2],[49,3],[49,2],[49,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[64,2],[64,3],[64,2],[64,3],[71,1],[71,3],[74,1],[23,1],[23,3],[58,1],[58,2],[77,1],[77,2],[77,2],[77,3],[75,1],[76,1],[79,1],[78,1],[59,2],[59,3],[59,4],[59,3],[59,4],[59,5],[86,1],[86,3],[88,1],[88,1],[88,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,3],[87,3],[87,3],[87,2],[87,2],[87,2],[87,5],[87,1],[87,2],[90,1],[90,3],[91,1],[91,1],[91,2],[60,2],[60,3],[60,4],[31,1],[31,2],[31,3],[31,4],[92,1],[92,1],[92,1],[92,1],[93,1],[93,3],[93,3],[24,1],[24,3],[94,2],[62,1],[62,2],[62,2],[62,3],[96,1],[96,2]],table:(function(e){function i(C){let M=C.match(/[\x20-\x2f]/g),E=M?Math.max(...M.map(F=>F.charCodeAt()-32)):-1;for(let F=E;F>=0;F--){let N=(32+F).toString(16),A;C=C.replace(new RegExp("\\[\\x"+N+"(.+?)\\]"),(b,L)=>A=L).replace(new RegExp("\\x"+N,"g"),A)}return C=C.replace(/<([^>]+?)>/g,(F,N)=>{let A=c[N[0]],b=1;return A>>5===1&&(A=A&31|c[N[1]]<<5,b=2),N.slice(b).repeat(A)}),C}function o(C){let M=[];for(let E=0;E<C.length;E++){let F=c[C[E]];if(F&32){let N=c[C[++E]];M.push(F&31|N<<5)}else M.push(F)}return M}let c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~|=".split("").reduce((C,M,E)=>(C[M]=E,C),Object.create(null)),[f,d,...g]=e.split("=").map(i),m=d.split(";").map(C=>{let M=[];for(let E=0;E<C.length;E++)for(let F=0,N=c[C[E]];F<3;F++)M.push(N>>F*2&3);return M}),y=g.map(o),k=o(f).map(C=>{let M=m[C],E=Object.create(null);for(let F=0;F<M.l
|
||
|
|
`+m.showPosition()+`
|
||
|
|
Expecting `+X.join(", ")+", got '"+(this.terminals_[R]||R)+"'":"Parse error on line "+(T+1)+": Unexpected "+(R===1?"end of input":"'"+(this.terminals_[R]||R)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[R]||R,line:m.yylineno,loc:E,expected:X})}if(I===3){if(R===1||U===1)throw new Error(Z||"Parsing halted while starting to recover from another error.");B=m.yyleng,L=m.yytext,T=m.yylineno,E=m.yylloc,R=g()}if(q===!1)throw new Error(Z||"Parsing halted. No suitable error recovery rule available.");d(q),U=R==2?null:R,R=2,W=F[F.length-1],ne=C[W]&&C[W][2],I=3}if(Array.isArray(ne[0])&&ne.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+R);switch(ne[0]){case 1:F.push(R),N.push(m.yytext),A.push(m.yylloc),F.push(ne[1]),R=null,U?(R=U,U=null):(B=m.yyleng,L=m.yytext,T=m.yylineno,E=m.yylloc,I>0&&I--);break;case 2:{let q=this.productions_[ne[1]][1],Z=A[A.length-(q||1)],S=A[A.length-1];M.$=N[N.length-q],M._$={first_line:Z.first_line,last_line:S.last_line,first_column:Z.first_column,last_column:S.last_column},y&&(M._$.range=[Z.range[0],S.range[1]]);let X=this.performAction.call(M,L,B,T,k,ne[1],N,A,...e);if(typeof X<"u")return X;q&&d(q),F.push(this.productions_[ne[1]][0]),N.push(M.$),A.push(M._$),F.push(C[F[F.length-2]][F[F.length-1]]);break}case 3:return!0}}}};PD=(function(e){function i(b,L){Object.entries(L).forEach(([T,B])=>b[T]=B(b[T]))}let o=new Map([["EOF",["<end of input>"]],["IDENT",["ident"]],["$IDENT",["$ident"]],["NOT",["'not'"]],["NO",["'no'"]],["IS",["'is'"]],["IN",["'in'"]],["HAS",["'has'"]],["NOTIN",["'not in'"]],["HASNO",["'has no'"]],["AND",["'and'"]],["OR",["'or'"]],["STRING",["string"]],["TPL_START",["template"]],["TEMPLATE",["template"]],["NUMBER",["number"]],["REGEXP",["regexp"]],["LITERAL",["'true'","'false'","'null'","'undefined'","'NaN'","'Infinity'"]],["ORDER",["'asc'","'desc'","'ascN'","'descN'"]],["METHOD(",["'method('"]],["$METHOD(",["'$method('"]]]),l=b=>o.get(b)||`'${b}'`,c=function(b,L={},T){if(L.recoverable)this.trace(b);else{if(Array.isArray(L.inside)){let W=T.lexer.offset-T.lexer.match.length;T.lexer.setMatch(W+L.inside[0],W+L.inside[1])}let B=T.lexer.yylloc,I=[b.split(/\n/)[0],"",T.lexer.showPosition()],R=Array.isArray(L.expected)?[...new Set([].concat(...L.expected.map(W=>l(W.slice(1,-1)))))]:null;R&&I.push("","Expecting "+R.join(", ")+" got "+l(L.token));let U=new SyntaxError(I.join(`
|
||
|
|
`));throw U.details={rawMessage:b,text:L.text,token:L.token,expected:R,loc:{range:B.range,start:{line:B.first_line,column:B.first_column,offset:B.range[0]},end:{line:B.last_line,column:B.last_column,offset:B.range[1]}}},U}},f=new Set([`
|
||
|
|
`,"\r","\u2028","\u2029"]),d=new Map([["undefined",void 0],["null",null],["false",!1],["true",!0],["Infinity",1/0],["NaN",NaN]]);Object.assign(e.lexer,{ident:b=>b.replace(/\\u[0-9a-fA-F]{4}/g,L=>String.fromCharCode(parseInt(L.slice(2),16))),toLiteral:b=>d.get(b),toNumberLiteral(b,L,T=!1){if(L){let B=b.match(T?/(?:^|[^0-9a-fA-F])_|_(?:[^0-9a-fA-F]|$)/:/(?:^|\D)_|_(?:\D|$)/);if(B){let I=B[0],R=B.index+ +(I[1]==="_"),U=I==="__"?"Only one underscore is allowed":"Wrong underscore";this.parseError(U+" as numeric separator",{inside:[R,R+1]})}b=b.replace(/_/g,"")}return T?parseInt(b,16):parseFloat(b)},toStringLiteral(b,L=!1,T=1){let B=b.length-T,I="";for(let R=1;R<B;R++){if(!L&&f.has(b[R])&&this.parseError("Invalid line terminator",{inside:[R,R+1]}),b[R]!=="\\"){I+=b[R];continue}R===B-1&&this.parseError("Invalid backslash",{inside:[R,R+1]});let U=b[++R];switch(U){case"\r":R+=b[R+1]===`
|
||
|
|
`;break;case`
|
||
|
|
`:case"\u2028":case"\u2029":break;case"0":I+="\0";break;case"b":I+="\b";break;case"n":I+=`
|
||
|
|
`;break;case"r":I+="\r";break;case"f":I+="\f";break;case"t":I+=" ";break;case"v":I+="\v";break;case"u":{let[W=""]=b.slice(R+1,R+5).match(/^[0-9a-f]*/i)||[];if(W.length===4){I+=String.fromCharCode(parseInt(W,16)),R+=4;break}this.parseError("Invalid Unicode escape sequence",{inside:[R-1,Math.min(R+1+W.length,B)]});break}case"x":{let[W=""]=b.slice(R+1,R+3).match(/^[0-9a-f]*/i)||[];if(W.length===2){I+=String.fromCharCode(parseInt(W,16)),R+=2;break}this.parseError("Invalid hexadecimal escape sequence",{inside:[R-1,Math.min(R+1+W.length,B)]});break}default:I+=U}}return I},toRegExp(b){let L=b.lastIndexOf("/")+1,T=b.substr(L);return T.split("").forEach((B,I,R)=>{let U=R.indexOf(B,I+1);U!==-1&&this.parseError("Duplicate flag in regexp",{inside:[L+U,L+U+1]})}),new RegExp(b.substr(1,b.lastIndexOf("/")-1),T)}}),i(e.lexer,{setInput:b=>function(L,T){let B=[];return T.commentRanges=B,T.buildResult=I=>({ast:I,commentRanges:B}),T.parseError=function(...I){return c.call(this,...I,T)},T.pks=()=>{this.eof()||this.begin("preventKeyword")},T.pps=()=>{this.eof()||this.begin("preventPrimitive")},this.bracketStack=[],this.prevToken=null,this.prevYylloc={first_line:1,last_line:1,first_column:0,last_column:0,range:[0,0]},b.call(this,L,T)}});let g=new e.Parser;g.lexer={...e.lexer},g.yy={...e.yy};let m=["AND","OR","IN","NOTIN","HAS","HASNO","IS"],y=[...m,"NOT","NO","ORDER"],k=["+","-","*","/","%","|","=","!=","~=",">=","<=","<",">"],C=[null,"?",":",";",",",".","..","(",".(","..(","METHOD(","$METHOD(","[",".[","=>",...k,...m,"NOT","NO"],M=[",","?",":",";","EOF","]",")","}","TPL_CONTINUE","TPL_END",...k,...m,"ORDER"],E=new Map(C.map(b=>[b,new Set(M)]));for(let b of[".(","..(","METHOD(","$METHOD("])E.get(b).delete(")");for(let b of["[",".["])E.get(b).delete("]");i(g.lexer,{lex:b=>function(){let T=this.offset,B=b.call(this);if(E.has(this.prevToken)&&E.get(this.prevToken).has(B)){let I={first_line:this.prevYylloc.last_line,last_line:this.yylloc.first_line,first_column:this.prevYylloc.last_column,last_column:this.yylloc.first_column,range:[this.prevYylloc.range[1],this.yylloc.range[0]]};if(this.unput(this.match),this.pushState("preventPrimitive"),this.done=!1,this.yytext="",this.yylloc=this.prevYylloc=I,T!==this.offset&&y.includes(B))switch(this._input[T]){case" ":case" ":I.last_column--,I.range[1]--;break;case`
|
||
|
|
`:{let R=this._input.lastIndexOf(`
|
||
|
|
`,T-1);I.last_line--,I.last_column=R===-1?I.last_column-1:T-R,I.range[1]--;break}}return this.prevToken="IDENT"}if(this.prevYylloc=this.yylloc,y.includes(B))switch(this._input[this.offset]){case" ":case" ":this.prevYylloc={...this.prevYylloc,last_column:this.prevYylloc.last_column+1,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]};break;case`
|
||
|
|
`:this.prevYylloc={...this.prevYylloc,last_line:this.prevYylloc.last_line+1,last_column:0,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]};break}return this.prevToken=B}});let F=new Map([["(",")"],[".(",")"],["..(",")"],["METHOD(",")"],["$METHOD(",")"],["[","]"],[".[","]"],["{","}"],["TPL_START","TPL_END"]]),N=new Set([")","]","}","TPL_END"]),A=b=>function(){let T=b.call(this);if(N.has(T)){let B=this.bracketStack.pop();B!==T&&this.parseError(`Expected "${B}" got "${T}"`)}return F.has(T)&&this.bracketStack.push(F.get(T)),T};return i(e.lexer,{lex:A}),i(g.lexer,{lex:A}),{parse(b,L){return L?g.parse(b):e.parse(b)},*tokenize(b,L,T){let B=L?g:e,I=Object.create(B.lexer);for(I.setInput(b,{parser:B});!I.done;){let R={type:I.lex(),value:I.match,offset:I.yylloc.range[0]};T&&(R.loc={range:I.yylloc.range,start:{line:I.yylloc.first_line,column:I.yylloc.first_column},end:{line:I.yylloc.last_line,column:I.yylloc.last_column}}),yield R}}}})(new Bu),ma=PD});var Iu={};Fe(Iu,{compile:()=>jD,stringify:()=>RD,walk:()=>zD});function jD(n,e){e.put(e.scope.arg1?"arguments[1]":"undefined")}function zD(){}function RD(n,e){e.put("$$")}var Xh=z(()=>{});var Pu={};Fe(Pu,{compile:()=>qD,stringify:()=>WD,suggest:()=>HD,walk:()=>_D});function HD(n,e){n.elements.length===0&&e.queryRoot(n.range[0]+1,n.range[1]-1)}function qD(n,e){e.put("["),e.list(n.elements,","),e.put("]")}function _D(n,e){e.list(n.elements)}function WD(n,e){e.put("["),e.list(n.elements,","),e.put("]")}var eg=z(()=>{});var ju={};Fe(ju,{compile:()=>UD,stringify:()=>VD,suggest:()=>$D,walk:()=>GD});function $D(n,e){Array.isArray(n.assertion)||(e.range(n.assertion.range,"var"),e.range(n.assertion.range,"assertion"))}function UD(n,e){if(Array.isArray(n.assertion)){e.put(n.negation?"!(":"(");for(let i=0;i<n.assertion.length;i++)if(i%2===0)e.node(n.assertion[i]);else switch(n.assertion[i]){case"and":e.put("&&");break;case"or":e.put("||");break;default:e.error("Bad conjuction operator in assertion",n)}e.put(")")}else switch(n.negation&&e.put("!"),n.assertion.type){case"Identifier":n.assertion.name?(e.put("!!"),e.tolerant&&e.put("(typeof "),e.put("a."),e.put(n.assertion.name),e.tolerant&&(e.put('==="function"?a.'),e.put(n.assertion.name)),e.put(".call(mctx,"),e.nodeOrCurrent(),e.put(")"),e.tolerant&&e.put(":false)"),e.usedAssertions.has(n.assertion.name)?e.usedAssertions.get(n.assertion.name).push(n.assertion.range):e.usedAssertions.set(n.assertion.name,n.assertion.range)):e.put("false");break;case"Method":e.put("!!"),e.node(n.assertion);break;default:e.error('Unknown assertion node type "'+n.assertion.type+'"',n.assertion)}}function GD(n,e){if(Array.isArray(n.assertion))for(let i=0;i<n.assertion.length;i++)i%2===0&&e.node(n.assertion[i]);else e.node(n.assertion)}function VD(n,e){if(n.negation&&e.put("not "),Array.isArray(n.assertion)){e.put("(");for(let i=0;i<n.assertion.length;i++)i%2===0?e.node(n.assertion[i]):(e.put(" "),e.put(n.assertion[i]),e.put(" "));e.put(")")}else e.node(n.assertion)}var tg=z(()=>{});var zu={};Fe(zu,{compile:()=>QD,stringify:()=>ZD,suggest:()=>YD,walk:()=>KD});function ya(n,e,i){if(i.type==="Array"){if(i.elements.length===0){n.range([i.range[0]+1,i.range[1]-1],"value-subset",e,!1);return}let o=[];for(let{type:c,range:f,value:d}of i.elements)f&&(c==="Literal"||c==="Identifier")&&o.push(d);let l=o.length?n.literalList(o):!1;for(let{type:c,range:f,value:d}of i.elements)f&&(c==="Literal"||c==="Identifier"||c==="GetProperty"&&d===null)&&n.range(f,"value-subset",e,l)}}function YD(n,e){switch(n.operator){case"in":e.range(n.left.range,"in-value",n.right,null),ya(e,n.left,n.right);break;case"not in":ya(e,n.left,n.right);break;case"has":e.range(n.right.range,"in-value",n.left,null),ya(e,n.right,n.left);break;case"has no":ya(e,n.right,n.left);break;case"=":case"!=":e.range(n.right.range,"value",n.left,null);break}}function QD(n,e){if(!(n.operator in ng)){e.error('Unknown operator "'+n.operator+'"',n);return}switch(n.operator){case"and":e.put("!");case"or":{let i=e.allocateVar();e.put(`${e.buildinFn("bool")}(${i}=`),e.node(n.left),e.put(`)?${i}:`),e.createScope(()=>e.no
|
||
|
|
`,"\\n"],["\r","\\r"],["\f","\\f"],[" ","\\t"],["\v","\\v"],["\u2028","\\u2028"],["\u2029","\\u2029"],["\\","\\\\"],['"','\\"']]),QS=new Map([["\b","\\b"],["\f","\\f"],[" ","\\t"],["\v","\\v"],["\\","\\\\"],["$","\\$"]])});var KS,Oo,ZS,mc,yc,vc,wc,Bo=z(()=>{Xh();eg();tg();rg();ig();sg();ag();lg();ug();cg();fg();dg();pg();hg();gg();mg();yg();vg();wg();bg();xg();kg();Cg();Dg();Ag();Sg();Eg();Mg();Lg();Tg();Fg();Ng();Og();Ig();KS={Arg1:Iu,Array:Pu,Assertion:ju,Binary:zu,Block:Ru,Compare:Hu,Conditional:_u,Context:Wu,Current:$u,Data:Uu,Declarator:Gu,Definition:Yu,Filter:Qu,Function:Ku,GetProperty:Zu,Identifier:Ju,Literal:Xu,Map:ec,MapRecursive:tc,Method:nc,MethodCall:rc,Object:ic,ObjectEntry:oc,Parentheses:sc,Pick:ac,Pipeline:lc,Placeholder:uc,Postfix:cc,Prefix:fc,Reference:dc,SliceNotation:pc,CompareFunction:qu,Spread:hc,Template:gc},Oo=n=>new Map(Object.entries(KS).map(([e,i])=>[e,i[n]]).filter(([,e])=>typeof e=="function")),ZS={};Oo("build").forEach((n,e)=>ZS[e]=n);mc=Oo("compile"),yc=Oo("walk"),vc=Oo("stringify"),wc=Oo("suggest")});function Io(n,e){function i(f){if(yc.has(f.type))l(f),yc.get(f.type)(f,o),c(f);else throw new Error('Unknown node type "'+f.type+'"')}let o={node:i,nodeOrNothing(f){f!==null&&i(f)},list(f){f.forEach(i)}},l=()=>{},c=()=>{};typeof e=="function"&&(e={enter:e}),e&&(typeof e.enter=="function"&&(l=e.enter),typeof e.leave=="function"&&(c=e.leave)),i(n)}var bc=z(()=>{Bo()});function Pg(n,e){return e>=0&&e<n.length&&/[a-zA-Z_$0-9]/.test(n[e])}function xc(n,e){let i=n.charCodeAt(e);return i===9||i===10||i===13||i===32}function JS(n,e,i){for(;e<i;e++)if(!xc(n,e))return!1;return!0}function XS(n,e,i,o,l){let c=[];for(let f=0;f<o.length;f++){let[d,g]=o[f];if(d>=e)break;d<n||(c.push(n,d),n=g)}return(n!==i.length||!l)&&c.push(n,e),c}function eE(n,e,i,o){let l=[];for(let c=0;c<n.length;c++){let[f,d,g,m]=n[c];if(JS(e,f,d)){for(;f>=0&&xc(e,f-1);)f--;for(;d<e.length&&xc(e,d);)d++;if(Pg(e,f-1)){if(f===d)continue;f++}if(Pg(e,d)){if(f===d)continue;d--}}let y=XS(f,d,e,i,o);for(let k=0;k<y.length;k+=2)l.push([y[k],y[k+1],g,m])}return l}function tE(n){let e=null,i=[],o=Object.assign(new Map,{literalList:i}),l=(f,d)=>{o.has(f)?o.get(f).push(d):o.set(f,[d])},c={range(f,d,g=e,m=!0){l(g,[...f,d,m])},literalList(f){let d="l"+i.length;return i.push([d,f]),d},queryRoot(f,d=f){l(e,[f,d,"var",!0]),l(e,[f,d,"path",!0])}};return Io(n,f=>{if(wc.has(f.type)){let d=e;e=f,wc.get(f.type)(f,c),e=d}}),o}function va(n,{ast:e,commentRanges:i}){let o=tE(e),l=i.length&&i[i.length-1][1]===n.length&&!/[\r\n]$/.test(n);for(let[c,f]of o)o.set(c,eE(f,n,i,l));return o}var jg=z(()=>{Bo();bc()});function nE(n){return n.type==="GetProperty"}function rE(n){return n.type==="MethodCall"}function wa(n){function e(l){if(vc.has(l.type))vc.get(l.type)(l,o);else throw new Error('Unknown node type "'+l.type+'"')}let i=[],o={isSimpleGetPropertyQuery:nE,isSimpleMethodCallQuery:rE,put(l){i.push(l)},node:e,nodeOrNothing(l){if(l!==null)return e(l),!0},list(l,c){if(!c){l.forEach(e);return}l.forEach((f,d)=>{d>0&&o.put(c),e(f)})}};return e(n),i.join("")}var zg=z(()=>{Bo()});function kc(n,e,i){let o=Object.assign(Object.create(SyntaxError.prototype),i),l=new Error;return o.name=n,o.message=e,Object.defineProperty(o,"stack",{get:function(){return(l.stack||"").replace(/^(.+\n){1,3}/,n+": "+e+`
|
||
|
|
`)}}),o}var Rg=z(()=>{});function Dc(n,e,i){return Hg(n,"query",e,i)}function Ac(n,e,i){return Hg(n,"method",e,i)}function Hg(n,e,i=!1,o=null){function l(A){let b="s"+m.length;return m.push(A?[b,A]:[b]),b}function c(A){let b=y.get(A);return b||y.set(A,b=l()),b}function f(A,b,L,T,B){let I=[A,b,JSON.stringify(L)];if(L==="var"){if(!N.scope.size)return;I.push(JSON.stringify([...N.scope]))}else T||(T=l()),I.push(T),B&&I.push(typeof B=="string"?B:c(B));return C.push(I),T}function d(A,b,L="$"){let T=N.scope,B=M.length-1;if(N.scope=T.spawn(T.arg1||e==="method",L),A(),N.scope.captureCurrent.length){let R="stat("+N.scope.captureCurrent.reduce((U,W)=>f(...W,U),void 0)+","+N.scope.$ref+")";N.scope.firstCurrent?M[N.scope.firstCurrent]=R:M[B]+=b(R)}N.scope=T}function g(A,b){let L=!1;if(o!==null){if(o.has(A))for(let[T,B,I,R]of o.get(A))I==="var"?f(T,B,I):R===!0?N.scope.captureCurrent.push([T,B,I]):(L||(L=c(A),M.push("stat("+L+",")),I&&f(T,B,I,L,R));A.type==="Current"&&N.scope.firstCurrent===null&&(N.scope.firstCurrent=M.length)}if(mc.has(A.type))mc.get(A.type)(A,N,b);else throw new Error('Unknown node type "'+A.type+'"');L&&M.push(")")}let m=[],y=new WeakMap,k=[],C=[],M=[{toString(){if(e==="query")return["((data,context)=>{",...N.usedMethods.size||N.usedAssertions.size?["const method = (name,...args)=>m[name].apply(mctx,args);","const assertion = (name,...args)=>a[name].apply(mctx,args);","const mctx = Object.freeze({context,method,assertion});"]:[]].join(`
|
||
|
|
`)+`
|
||
|
|
`;if(e==="method")return["(function(data){","const mctx = this;","const context = mctx.context;"].join(`
|
||
|
|
`)+`
|
||
|
|
`;throw new Error("Unknown kind: "+e)}},{toString(){return k.length>0?"let "+k+`;
|
||
|
|
`:""}},{toString(){return m.length>0?[`const stat=(s,v)=>(s.add(v),v);
|
||
|
|
`,"const "+m.map(([A,b])=>A+"=new Set("+(b?JSON.stringify(b):"")+")")+`;
|
||
|
|
`].join(""):""}},{toString(){let A=o&&Array.isArray(o.literalList)&&o.literalList.map(([b,L])=>b+"="+JSON.stringify(L));return A&&A.length?"const "+A+`;
|
||
|
|
`:""}},o===null?"return ":`return{
|
||
|
|
value: `],E={},F=new Set,N={tolerant:i,usedAssertions:new Map,usedMethods:new Map,suggestions:o!==null,buildinFn(A){return F.add(A),"f."+A},scope:new Cc,createScope:d,error:(A,b)=>{let L=new SyntaxError(A);if(b&&b.range&&(L.details={loc:{range:b.range}}),!i)throw L},allocateVar(){let A="tmp"+k.length;return k.push(A),A},put:A=>M.push(A),node:g,nodeOrCurrent(A,b){g(A||{type:"Current"},b)},list(A,b,L){A.forEach((T,B)=>{B>0&&M.push(b),g(T,L)})}};if(d(()=>g(n),A=>(M.push(")"),"("+A+","),"data"),!i){let{usedMethods:A,usedAssertions:b}=N;b.size&&(M.unshift(" this.assertAssertions(a)||"),E.assertAssertions=function(L){for(let[T,B]of b.entries())if(!Mt(L,T))return()=>{throw Object.assign(new Error(`Assertion "${T}" is not defined`),{details:{loc:{range:B}}})}}),A.size&&(M.unshift(" this.assertMethods(m)||"),E.assertMethods=function(L){for(let[T,B]of A.entries())if(!Mt(L,T))return()=>{throw Object.assign(new Error(`Method "${T}" is not defined. If that's a custom method make sure you added it with "methods" section in options`),{details:{loc:{range:B[0]}}})}})}o!==null&&M.push(`,
|
||
|
|
stats: [`+C.map(A=>"["+A+"]")+`],
|
||
|
|
methods: m,
|
||
|
|
assertions: a
|
||
|
|
}`);try{let A=new Function("f,m,a","return"+M.join("")+"})");return Object.assign(A.bind(E),{toString(){return A.toString().replace(/^(\S+\s+)anonymous([^)\s]+)\s*\)/,"$1query$2)")}})}catch(A){throw kc("SyntaxError","Jora query compilation error",{compiledSource:M.join(""),details:A})}}var Cc,qg=z(()=>{jn();Rg();Bo();Cc=class n extends Set{constructor(e,i=[],o=!1,l="$"){super(e),this.own=new Set,this.awaitInit=new Set(i),this.firstCurrent=null,this.captureCurrent=[],this.arg1=o,this.$ref=l}spawn(e,i){return new n(this,this.awaitInit,e,i)}}});var _g,Yt,Po,gn,Sc,Ec,iE,oE,xi,sE,Wg,aE,$g,Ug,Gg,Vg=z(()=>{_g=n=>typeof n=="number"||typeof n=="string",Yt=(n,e)=>e<n.length?n.charCodeAt(e):0,Po=n=>n===43||n===45,gn=n=>n>=48&&n<=57,Sc=n=>n===9||n===10||n===12||n===13||n===32,Ec=n=>n>32&&n<256&&(n<65||n>90)&&(n<97||n>122)&&!gn(n)&&!Po(n)||n===8470,iE=n=>n&&!Sc(n)&&!Ec(n)&&!gn(n),oE=(n,e,i)=>Po(n)?gn(e)?2:e===46&&gn(i)?3:0:gn(n)?1:0,xi=(n,e,i)=>{for(;i(Yt(n,++e)););return e},sE=(n,e,i)=>{let o=Yt(n,e);if(Po(o)&&(o=Yt(n,e+=1)),gn(o)&&(e=xi(n,e,gn),o=Yt(n,e)),o===46&&gn(Yt(n,e+1))){if(i)return e;let l=xi(n,e+1,gn);if(o=Yt(n,l),o===46)return e;e=l}if(o===69||o===101){let l=1;o=Yt(n,e+1),Po(o)&&(l=2,o=Yt(n,e+2)),gn(o)&&(e=xi(n,e+l,gn))}return e},Wg=(n,e,i,o)=>{if(e>=n.length)return 0;let l=Yt(n,e);return Sc(l)?1|xi(n,e,Sc)-e<<4:Ec(l)||o&&Po(l)?2|xi(n,e,Ec)-e<<4:oE(l,Yt(n,e+1),Yt(n,e+2))?4|sE(n,e,i)-e<<4:8|xi(n,e,iE)-e<<4},aE=(n,e,i)=>{let o=0,l=0,c=!1,f=!1,d=0,g=0,m=!0;for(;;){let y=Wg(n,o,c,f),k=Wg(e,l,c,f),C=y&15,M=y>>4,E=k&15,F=k>>4;if(C!==E){if(m&&C&3&&E&12){d=1,g=C,o+=M;continue}if(m&&E&3&&C&12){d=-1,g=E,l+=F;continue}return C-E}if(C===0)return d;m=!1,c=!1,f=!1;let N=M<F?M:F,A=M-F,b="",L="";for(let T=0;T<N;T++)if(b=n[o+T],L=e[l+T],b!==L){A=b<L?-1:1;break}if(C&3)c=n[o+M-1]===".",A!==0&&C>g&&(g=C,d=A);else if(C&4){if(f=!0,A!==0){let T=n.substr(o,M)-e.substr(l,F);if(T!==0)return i?-T:T;if(C>g){let B=Yt(n,o),I=Yt(e,l),R=B===45?-1:1;g=C,d=B!==I&&(B===45||I===43)?-1:B!==I&&(B===43||I===45)?1:(M-F||A)<0?-R:R,i&&(d=-d)}}}else if(A!==0){if(b!==L){let T=n.substr(o,M),B=e.substr(l,F),I=T.toLowerCase(),R=B.toLowerCase();return I!==R?I<R?-1:1:T<B?-1:1}return A}o+=M,l+=F}},$g=n=>(e,i)=>_g(e)&&_g(i)?Math.sign(aE(String(e),String(i),n)):0,Ug=$g(!1),Gg=$g(!0)});function nr(n){switch(typeof n){case"boolean":return lE;case"number":return n!==n?uE:ki;case"string":return jo;case"object":return n===null?cE:fE;case"undefined":return pE;default:return dE}}function Ci(n,e){let i=nr(n),o=nr(e);return i!==o?i<o?-1:1:n<e?-1:n>e?1:0}function Yg(n,e){let i=nr(n),o=nr(e);return i!==o?i<o?-1:1:i===ki?e-n:n<e?-1:n>e?1:0}function Er(n,e){let i=nr(n),o=nr(e);return(i===ki||i===jo)&&(o===ki||o===jo)?Ug(n,e):i!==o?i<o?-1:1:n<e?-1:n>e?1:0}function Qg(n,e){let i=nr(n),o=nr(e);return(i===ki||i===jo)&&(o===ki||o===jo)?Gg(n,e,!0):i!==o?i<o?-1:1:n<e?-1:n>e?1:0}function Mc(n,e){return n.length===1?(i,o)=>e(n(i),n(o)):n}var lE,uE,ki,jo,cE,fE,dE,pE,ba=z(()=>{Vg();lE=1,uE=2,ki=3,jo=4,cE=5,fE=6,dE=7,pE=8});function hE(n,e,i){try{return n()}catch{if(e)throw Object.assign(new ReferenceError(`Cannot access $${e} before initialization`),{details:{name:e,loc:{range:i}}})}}function gE(n){return Re(n)?n:[n]}function mE(n,e){return Re(n)||Re(e)?[...new Set([...Re(n)?n:[n],...Re(e)?e:[e]])]:n+e}function yE(n,e){if(Re(n)){let i=new Set(n);return Re(e)?e.forEach(o=>i.delete(o)):i.delete(e),[...i]}return n-e}function vE(n,e){return n*e}function wE(n,e){return n/e}function bE(n,e){return n%e}function xE(n,e){return Object.is(n,e)}function kE(n,e){return!Object.is(n,e)}function CE(n,e){return n<e}function DE(n,e){return n<=e}function AE(n,e){return n>e}function SE(n,e){return n>=e}function xa(n,e){return hn(e)?Mt(e,n):e?Kg(e,n)!==-1:!1}function EE(n,e){return typeof e=="function"?Tc(n,e):tr(e)?Tc(n,e.test.bind(e)):e==null}function ME(n,e=()=>!0){if(n){if(typeof e=="function"){if(Re(n)||typeof n=="string"){for(let i=0;i<n.length;i++)if(Vt(e(n[i],i)))return n[i]}for(let i in n)if(Mt(n,i)&&Vt(e(n[i],i)))return n[i];return}return Re(n)||typeof n=="string"?isFinite(e)?n[e<0?n.length+Number(e):Numb
|
||
|
|
`+k}return b+" ["+N+"] on "+C.type+(A===!0?" (current)":A&&A.type?" & "+A.type:"")}).join(`
|
||
|
|
`))}let d=e==="method"?Ac(c.ast,o,f):Dc(c.ast,o,f);return l&&l("Compiled code",d.toString()),d}function XE(n,e){e=e||{};let i=!!e.stat,o=!!e.tolerant,l=i?o?ZE:QE:o?KE:YE,{methods:c,assertions:f}=e||{},{queryMethods:d,queryAssertions:g}=bm(c,f),m;return n=String(n),l.has(n)&&!e.debug?m=l.get(n):(m=Ic(n,"query",i,o,e.debug),l.set(n,m)),m=m(Ht,d,g),i?Object.assign((y,k)=>Bc(n,m(y,k)),{query:m}):m}function eM(n){let e=new Map,i=new Map,o=new Map,l=new Map,{methods:c,assertions:f}=n||{},{queryMethods:d,queryAssertions:g}=bm(c,f);return function(y,k){k=k||{};let C=!!k.stat,M=!!k.tolerant,E=C?M?l:i:M?o:e,F;if(y=String(y),E.has(y)&&!k.debug)F=E.get(y);else{let N=Ic(y,"query",C,M,k.debug)(Ht,d,g);F=C?Object.assign((A,b)=>Bc(y,N(A,b)),{query:N}):N,E.set(y,F)}return F}}var YE,QE,KE,ZE,Xt,Ho=z(()=>{Kh();jn();Jh();jg();bc();zg();qg();ka();pm();hm();vm();YE=new Map,QE=new Map,KE=new Map,ZE=new Map;Xt=Object.assign(XE,{version:Qh,buildin:Ht,methods:zo,assertions:Ro,setup:eM,syntax:{tokenize:ma.tokenize,parse:ma.parse,suggest:va,walk:Io,stringify:wa,compile:Dc,compileMethod:Ac}})});var ir,Ea=z(()=>{ir=class{listeners;constructor(){this.listeners=Object.create(null)}on(e,i){return this.listeners[e]={callback:i,next:this.listeners[e]||null},this}once(e,i){return this.on(e,function o(...l){i.apply(this,l),this.off(e,o)})}off(e,i){let o=this.listeners[e]||null,l=null;for(;o!==null;){if(o.callback===i){o.callback=null,l?l.next=o.next:this.listeners[e]=o.next;break}l=o,o=o.next}return this}emit(e,...i){let o=this.listeners[e]||null,l=!1;for(;o!==null;)typeof o.callback=="function"&&o.callback.apply(this,i),l=!0,o=o.next;return l}}});var en,Ai=z(()=>{Ea();en=class extends ir{#e;#t;static define(e,i,o){return e.#e.set(i,o),e.emit("define",i,o),o}constructor(e){super(),this.#e=new Map,this.#t=!!e}revoke(e){if(!this.#t)throw new Error("Entry revoking is not allowed");this.#e.delete(e),this.emit("revoke",e)}isDefined(e){return this.#e.has(e)}has(e){return this.#e.has(e)}get(e){return this.#e.get(e)}get names(){return[...this.#e.keys()]}get keys(){return this.#e.keys()}get values(){return this.#e.values()}get entries(){return this.#e.entries()}}});var Ma,xm=z(()=>{Ai();Ma=class n extends en{#e;constructor(){super(!0),this.#e=Object.create(null)}define(e,i){if(typeof i!="function")throw new Error("callback is not a function");return this.#e=Object.freeze({...this.#e,[e]:i}),n.define(this,e,Object.freeze({name:e,callback:i}))}revoke(e){if(this.has(e)){let i={...this.#e};delete i[e],this.#e=Object.freeze(i)}super.revoke(e)}get actionMap(){return this.#e}call(e,...i){let o=this.get(e);if(o===void 0)throw new Error(`action "${e}" doesn't exist`);let{callback:l}=o;return l(...i)}}});function tM(n){Pc=null;for(let[e,i]of qo.entries())n.warn.groupCollapsed(`${e} (${i.length})`,i);qo.clear()}function nM(n,e,...i){Pc===null&&qo.size===0&&(Pc=setTimeout(()=>tM(n),1));let o=qo.get(e);o!==void 0?o.push(i):qo.set(e,[i])}function Am(n,e,i){switch(typeof e){case"function":return e;case"string":return Object.assign(o=>o&&Ae(o,e)?o[e]:void 0,{getterFromString:`object[${JSON.stringify(e)}]`});default:throw new Error(`[Discovery] Bad type "${typeof e}" for ${i} in object marker "${n}" config (must be a string or a function)`)}}function km(n,e,i,o){let l=e&&Ae(e,i)?e[i]:void 0;return l!==void 0?Am(n,l,`"${i}" option`):o}function Cm(n,e,i){return(Array.isArray(e[i])?e[i]||[]:[]).map(l=>Am(n,l,`"${i}" option`))}function Dm(n,e=!1){return n===null?!1:e?typeof n=="object":typeof n=="object"||typeof n=="number"||typeof n=="string"}function rM(n,e){let{name:i,indexRefs:o,lookupRefs:l,annotateScalars:c,page:f,getRef:d,getTitle:g}=e;d!==null&&o.unshift(d),f&&d===null&&n.warn(`Option "ref" for "${i}" marker must be specified when "page" options is defined ("page" option ignored)`),o.length>0&&l.unshift(N=>N);let m=new Set,y=new Map,k=new Map,C=new WeakMap;return{name:i,page:d!==null?f:null,mark:N=>{if(N===null||typeof N!="object"){n.warn(`Invalid value used for "${i}" marker (should be an object)`);return}m.add(N);for(let A of o){let b=A(N);if(Dm(b)){if(!y.has(b)){y.set(b,N);c
|
||
|
|
`);let e=n.split(/\n+/),i=+(n.match(/^\s/)===null),o=1e3;for(var l=i;l<e.length;l++){let c=e[l].match(/^\s*/);if(c[0].length<o&&(o=c[0].length),o==0)break}return o>0&&(n=n.replace(new RegExp("^ {"+o+"}","gm"),"")),n}var Xc=z(()=>{});var ay,ly=z(()=>{Xc();ay={view:"block",className:["content","props-config"],data:"#.view | view or viewRoot",content:[{view:"block",className:"content-section skip",when:"skipped",content:'block{ content: "badge:{ text: skipped }" }'},{view:"block",className:"content-section render",when:"config.view is not string",content:'source:{ content: config.view + "", syntax: "js" }'},{view:"block",when:"props != undefined",className:"content-section props",content:[{view:"struct",expanded:1,data:"props"},{view:"context",data:(n,e)=>e.host.view.getViewPropsTransition(n.props),whenData:!0,content:[{view:"block",className:"transition-fn",data:n=>({...n,query:typeof n.query=="string"?za(n.query):void 0}),content:{view:"switch",content:[{when:"query is string",content:{view:"source",data:'{ content: query, syntax: "jora", lineNum: false }'}},{content:"struct:fn"}]}},{view:"struct",expanded:2,data:"props"}]}]},{view:"block",className:"content-section config",content:[{view:"struct",expanded:1,data:"config"},{view:"tree",data:(n,e)=>e.host.view.getViewConfigTransitionTree(n.config).deps,whenData:!0,expanded:3,children:"deps",item:{view:"struct",expanded:1,data:"value"}}]}]}});var uy,cy,fy=z(()=>{Xc();uy={view:"list",className:"data-flow-transitions",limit:1,when:".[view]",data:`
|
||
|
|
[null] // to show empty list on first render
|
||
|
|
+ .[view] // filter viewRoot
|
||
|
|
.(
|
||
|
|
$parent;
|
||
|
|
$parentName: parent.view.config.view;
|
||
|
|
$queryData: view | inputDataIndex != undefined ? inputData[inputDataIndex] : inputData;
|
||
|
|
|
||
|
|
view | [
|
||
|
|
...'data' in config ? { inputData: $queryData, transition: config.data, name: config.view, view: $, $parent } : [],
|
||
|
|
...inputDataIndex != undefined ? { inputData, transition: \`$[\${inputDataIndex}]\`, name: \`\${$parentName} \u2192 \${config.view}\`, view: $, $parent } : []
|
||
|
|
]
|
||
|
|
)
|
||
|
|
`,whenData:"size() > 1",itemConfig:{when:!0},item:[{view:"block",className:"root-data",when:"inputData = ..parent.viewRoot[].data",content:'badge:"Root data"'},{view:"struct",data:"inputData"},{view:"block",className:"data-flow-transition",content:[{view:"switch",content:[{when:"transition is (string or undefined)",content:{view:"context",data(n){return{content:za(n.transition),refs:[]}},content:{view:"source",data:`{
|
||
|
|
...,
|
||
|
|
syntax: "jora",
|
||
|
|
lineNum: false
|
||
|
|
}`}}},{content:{view:"struct",data:"transition"}}]},{view:"block",className:"view-name",content:"text:name"}]}]},cy={view:"block",className:"content-section data",data:"#.view",content:[{view:"context",data:"..parent",content:uy},{view:"context",content:{...uy,limit:!1}},{view:"block",className:"root-data",when:"view or viewRoot | data = ([@] + @..parent).viewRoot[].data",content:'badge:"Root data"'},{view:"struct",expanded:1,data:"view or viewRoot | data"}]}});function kM(n,e){if(n===null)return!0;for(let i of["top","left","width","height"])if(n[i]!==e[i])return!0;return!1}var ef,tf=z(()=>{Oe();Fr();ja();Yo();sy();ly();fy();ef=n=>{let e=!1,i=null,o=null,l=null,c=null,f,d=new Set,g=new Map,m=new Map,y=$("div","cancel-hint view-alert view-alert-warning"),k=$("div",{class:"discovery-view-inspector-overlay",onclick:I=>{if((I.metaKey||I.ctrlKey)&&o){let R=o.view.config.view;N(),n.setPage("views-showcase",R);return}A(o&&!l?o:null)}},[y]),C=Nr(()=>{if(!e||l!==null)return;let I=n.view.getViewTree([T.el]),R=new Set([...m.keys()]);(function W(ne,q){for(let Z of ne){if(!Z.node||!Z.view&&!Z.viewRoot){Z.children.length&&W(Z.children,q);continue}let S=qt(Z.node,q),X=m.get(Z.node)||null;X===null?(X={el:q.appendChild($("div",Z.viewRoot?"overlay view-root":"overlay")),box:null},Z.node.nodeType===1&&(X.el.style.zIndex=getComputedStyle(Z.node).zIndex),Z.viewRoot&&Z.viewRoot.inspectable!==!1&&(X.el.dataset.inspectable=!0),m.set(Z.node,X),g.set(X.el,Z)):R.delete(Z.node),kM(X.box,S)&&(X.el.style.top=`${S.top}px`,X.el.style.left=`${S.left}px`,X.el.style.width=`${S.width}px`,X.el.style.height=`${S.height}px`,X.box=S),Z.children.length&&(Z.node.nodeType===1&&(X.el.style.overflow=getComputedStyle(Z.node).overflow!=="visible"?"hidden":"visible"),W(Z.children,X.el))}})(I,k);for(let W of R)m.get(W).el.remove(),m.delete(W);M()},{maxWait:0,wait:50}),M=()=>{let{x:I,y:R}=or.value;L([...n.dom.container.parentNode.elementsFromPoint(I|0,R|0)||[]].find(U=>g.has(U))||null)},E=I=>{(I.key==="Escape"||I.keyCode===27||I.which===27)&&n.inspectMode.set(!1)},F=()=>{e||(e=!0,document.addEventListener("scroll",C,Rt),document.addEventListener("keydown",E,!0),or.subscribe(C),f=setInterval(C,500),n.dom.container.append(k),C(),n.inspectMode.set(!0))},N=()=>{e&&(e=!1,clearInterval(f),document.removeEventListener("scroll",C,Rt),document.removeEventListener("keydown",E,!0),or.unsubscribe(C),B=!1,delete y.dataset.alt,k.remove(),k.replaceChildren(y),m.clear(),b(),n.inspectMode.set(!1))},A=I=>{if(l=I||null,I){let{innerWidth:R,innerHeight:U}=window,{left:W,top:ne,width:q,height:Z}=T.el.getBoundingClientRect();T.el.style.top=`${ne}px`,T.el.style.left=`${W}px`,T.el.style.right=`${R-(W+q)}px`,T.el.style.bottom=`${U-(ne+Z)}px`,T.frozen=!0,requestAnimationFrame(()=>{L(m.get(I.node)?.el||null),clearTimeout(c),T.show(),T.freeze()}),delete y.dataset.alt}else B?n.inspectMode.set(!1):(d.clear(),iy(),b(),C())},b=()=>{i&&i.classList.remove("hovered"),i=null,o=null,l=null,T.hide()},L=I=>{if(I===i)return;if(i!==null&&i.classList.remove("hovered"),i=I,I===null){c=setTimeout(b,100);return}I.classList.add("hovered");let R=g.get(I)||null;if(R===null){o=null;return}o!==null&&R.view===o.view||(o=R,clearTimeout(c),T.show())},T=new n.view.Popup({className:"discovery-inspect-details-popup",position:"pointer",hideIfEventOutside:!1,hideOnResize:!1,render(I){let R=l||o,U=[],W=R;for(;W!==null&&(W.view||W.viewRoot);)W!==R&&l!==null&&d.add(W),U.unshift(W),W=W.parent;return n.view.render(I,{view:"context",modifiers:[oy(I,{selectTreeViewLeaf:A,detailsSidebarLeafExpanded:d})],content:{view:"context",modifiers:{view:"block",className:"toolbar",content:[{view:"toggle-group",className:"stack-view-chain",name:"view",data:".({ value: $ })",value:"=$[-1].value",toggleConfig:{className:[ne=>ne.value.viewRoot?"view-root":!1,ne=>ne.value.view&&ne.value.view.skipped?"skipped":!1],content:['text:value | viewRoot.name or view.config.view | is string ?: "\u0192n"']}},{view:"button",when:l!==null,content:'text:"Close inspector"',onClick(){n.inspectMode.set(!1)}}]},content:[ay,{view:"block"
|
||
|
|
`)},highlightProps:["data"],demo:{view:n,data:{text:"demo",href:"#example",external:!0}}}]})});function py(n){function e(i,o,l,c){let{text:f,content:d,disabled:g,href:m,external:y,onClick:k}=o;if(i.classList.add("view-button"),g?i.disabled=!0:typeof k=="function"?(i.addEventListener("click",()=>k(i,l,c)),i.classList.add("onclick")):m&&i.addEventListener("click",()=>$("a",{href:m,target:y?"_blank":""}).click()),d)return n.view.render(i,d,l,c);i.textContent=f}n.view.define("button",e,{tag:"button",props:Ra,usage:Qo}),n.view.define("button-primary",e,{tag:"button",props:Ra,usage:Qo}),n.view.define("button-danger",e,{tag:"button",props:Ra,usage:Qo}),n.view.define("button-warning",e,{tag:"button",props:Ra,usage:Qo})}var Ra,hy=z(()=>{dy();Oe();Ra=`is not array? | {
|
||
|
|
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
||
|
|
content: undefined,
|
||
|
|
disabled: false,
|
||
|
|
href,
|
||
|
|
external,
|
||
|
|
onClick: undefined
|
||
|
|
} | overrideProps()`});var gy,my=z(()=>{gy={demo:{view:"checkbox-list",checkbox:{content:"text"},data:["one","two","three"]}}});function yy(n){n.view.define("checkbox-list",function(e,i,o,l){let{name:c="filter",checkbox:f,checkboxValue:d="$",emptyText:g,limit:m,onChange:y,onInit:k}=i,C=new Set;if(g!==!1&&g!==""&&e.setAttribute("emptyText",g||"Empty list"),!Array.isArray(o)&&o&&(o=[o]),Array.isArray(o))return n.view.renderList(e,this.composeConfig({view:"checkbox",...f,onInit:(M,E,F,N)=>{M&&C.add(n.query(d,F,N))},onChange:(M,E,F,N)=>{let A=C.size,b=n.query(d,F,N);M?C.add(b):C.delete(b),A!==C.size&&typeof y=="function"&&y([...C],c)}}),o,l,0,n.view.listLimit(m,25)).then(()=>{typeof k=="function"&&k([...C],c)})},{usage:gy})}var vy=z(()=>{my()});var wy,by=z(()=>{wy={demo:{view:"checkbox",content:'text:"checkbox caption"'},examples:[{title:"Checked state",beforeDemo:"Checked state is set up with `checked` property. Its value can be a query",demo:[{view:"checkbox",checked:!0,content:'text:"should be checked"'},{view:"checkbox",checked:"1 > 5",content:`text:"shouldn't be checked"`},{view:"checkbox",checked:"1 < 5",content:'text:"should be checked"'}]},{title:"Readonly checkbox",demo:{view:"checkbox",readonly:!0,content:'text:"checkbox caption"'}},{title:"On change",demo:{view:"checkbox",onChange:Function("return (value, name, data, context) => alert(`Changed to ${value}!`)")(),content:'text:"click me!"'}}]}});function xy(n){function e(i,o,l,c,f,d){if(i===null)return;let g=f?{...c,[f]:d.checked}:c;return i.innerHTML="",n.view.render(i,o,l,g)}n.view.define("checkbox",function(i,o,l,c){let{name:f,checked:d,readonly:g,content:m,onInit:y,onChange:k}=o,C=i.appendChild($("input")),M=m?i.appendChild($("span","view-checkbox__label")):null;return C.type="checkbox",C.checked=d!==void 0?n.queryBool(d,l,c):!!c[f],C.readOnly=g,C.addEventListener("click",E=>{g&&E.preventDefault()}),C.addEventListener("change",()=>{typeof k=="function"&&(k(C.checked,f,l,c),e(M,m,l,c,f,C))}),typeof y=="function"&&y(C.checked,f,l,c),e(M,m,l,c,f,C)},{tag:"label",usage:wy})}var ky=z(()=>{Oe();by()});var Cy,Dy=z(()=>{Cy={demo:{view:"content-filter",data:["foo","bar","baz"],content:{view:"list",data:".[$ ~= #.filter]"}},examples:[{title:"Using with text-match",demo:{view:"content-filter",data:[{name:"foo"},{name:"bar"},{name:"baz"}],name:"customName",content:{view:"list",data:".[name ~= #.customName]",item:"text-match:{ text: name, match: #.customName }"}}}]}});function Ay(n){n.view.define("content-filter",function(e,i,o,l){let{name:c="filter",type:f="regexp",placeholder:d,content:g,onInit:m,onChange:y}=i;return n.view.render(e,{view:"context",modifiers:{view:"input",name:c,type:f,placeholder:d||"Filter"},content:{view:"block",className:"content",content:g,onInit:m,onChange:y}},o,l)},{usage:Cy})}var Sy=z(()=>{Dy()});var Ey,My=z(()=>{Ey={demo:{view:"context",modifiers:{view:"dropdown",name:"demo",value:{foo:"two",bar:"hello"},resetValue:{foo:"one",bar:""},caption:"text:`${#.demo.foo} / ${#.demo.bar}`",content:[{view:"select",name:"foo",data:["one","two","three","four"]},{view:"input",name:"bar"}]},content:[{view:"block",content:'text:"Modified context (see values in \\"demo\\" section):"'},{view:"struct",expanded:1,data:"#"}]}}});function CM(n,e){if(!n||!e||typeof n!="object"||typeof e!="object")return n===e;for(let i in n)if(Ae(n,i)&&n[i]!==e[i])return!1;for(let i in e)if(Ae(e,i)&&n[i]!==e[i])return!1;return!0}function Ly(n){n.view.define("dropdown",function(e,i,o,l){function c(I,R){return typeof F=="function"?F(I,R):CM(I,R)}function f(){return T.innerHTML="",n.view.render(T,M||"text",o,{...l,[m||"__self"]:b})}function d(I){b=I,typeof A=="function"&&A(b,m,o,l),L.hide(),f()}function g(I,R){if(B){let U={changed:!c(I,R)};B.innerHTML="",n.view.render(B,[{view:"button-primary",disabled:"=not changed",content:'text:"Apply"',onClick(W,ne,q){d(q)}},{view:"button",when:()=>y&&!c(y,b),content:'text:"Reset"',onClick(){d(y)}},{view:"button",disabled:"=not changed",content:'text:"Cancel"',onClick(){L.hide()}}],U,R)}}let{name:m,resetValue:y,value:k,placeholder:C,caption:M,content
|
||
|
|
name,
|
||
|
|
value: $ has no 'value' and name is string ? #.context[name] : value | is (string or number) ?: '',
|
||
|
|
type ?: 'text',
|
||
|
|
placeholder,
|
||
|
|
onInit,
|
||
|
|
onChange,
|
||
|
|
htmlType ?: 'text',
|
||
|
|
htmlMin,
|
||
|
|
htmlMax,
|
||
|
|
htmlStep,
|
||
|
|
debounce
|
||
|
|
}`});var SM,Py,jy=z(()=>{SM=Function("return (value) => alert(`Changed to ${value.text}!`)")(),Py={demo:{view:"menu",data:[{text:"one",href:"#"},{text:"two",href:"#"},{text:"three",href:"#"}]},examples:[{title:"With limit",demo:{view:"menu",data:[{text:"one",href:"#"},{text:"two",href:"#"},{text:"three",href:"#"}],limit:2}},{title:"With custom item",demo:{view:"menu",data:[{text:"one",href:"#"},{text:"two",href:"#"},{text:"three",href:"#"}],item:"h1:text"}},{title:"On chage handler",demo:{view:"menu",onChange:SM,data:[{text:"one",href:"#"},{text:"two",href:"#"},{text:"three",href:"#"}]}}]}});function zy(n){n.view.define("menu",function(e,i,o,l){let{name:c="filter",item:f,itemConfig:d,limit:g,emptyText:m,onClick:y,onInit:k,onChange:C}=i;if(m!==!1&&m!==""&&e.setAttribute("emptyText",m||"No items"),Array.isArray(o)){let M=this.composeConfig({view:"menu-item",content:f,onClick:typeof y=="function"?y:typeof C=="function"?E=>C(E,c):void 0},d);return n.view.renderList(e,M,o,l,0,n.view.listLimit(g,25)).then(()=>{typeof k=="function"&&k(n.query(".[selected].pick()",o,l),c)})}},{usage:Py})}var Ry=z(()=>{jy()});var Hy,qy=z(()=>{Hy={demo:{view:"menu",data:[{text:"one",href:"#"},{text:"two",href:"#"},{text:"three",href:"#"}]},examples:[{title:"Preselected item",demo:{view:"menu",data:[{text:"one",href:"#"},{text:"two",href:"#",selected:!0},{text:"three",href:"#"}]}},{title:"Disabled item",demo:{view:"menu",data:[{text:"one",href:"#"},{text:"two",href:"#",disabled:!0},{text:"three",href:"#"}]}},{title:"External links",demo:{view:"menu",data:[{text:"one",external:!0,href:"https://github.com/discoveryjs/discovery"},{text:"two",external:!0,href:"https://github.com/discoveryjs/discovery"},{text:"three",external:!0,href:"https://github.com/discoveryjs/discovery"}]}}]}});function _y(n){n.view.define("menu-item",function(e,i,o,l){let{content:c,onClick:f}=i,{text:d,selected:g=!1,disabled:m=!1,href:y,external:k}=o||{};if(m?e.classList.add("disabled"):typeof f=="function"?(e.addEventListener("click",()=>f(o,l)),e.classList.add("onclick")):y&&(e.href=y,e.target=k?"_blank":""),g&&e.classList.add("selected"),c)return n.view.render(e,c,o,l);e.textContent=typeof o=="string"?o:d||"Untitled item"},{tag:"a",usage:Hy})}var Wy=z(()=>{qy()});var EM,$y,Uy=z(()=>{EM=()=>alert("changed!"),$y={demo:{view:"nav-button",data:{text:"I am nav button"}},examples:[{title:"With href",demo:{view:"nav-button",data:{text:"I am nav button",href:"#"}}},{title:"External link",demo:{view:"nav-button",data:{text:"I am nav button",external:!0,href:"https://github.com/discoveryjs/discovery"}}},{title:"On click handler",demo:{view:"nav-button",data:{text:"I am nav button"},onClick:EM}}]}});function Gy(n){n.view.define("nav-button",function(e,i,o,l){let{name:c,text:f,content:d,disabled:g,href:m,external:y,onClick:k}=i;if(c&&(e.dataset.name=c),g?e.classList.add("disabled"):typeof k=="function"?(e.addEventListener("click",C=>k(e,o,l,C)),e.classList.add("onclick")):m&&(e.href=m,e.target=y?"_blank":""),d)return n.view.render(e,d,o,l);e.textContent=f},{tag:"a",props:MM,usage:$y})}var MM,Vy=z(()=>{Uy();MM=`is not array? | {
|
||
|
|
name: undefined,
|
||
|
|
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
||
|
|
content: undefined,
|
||
|
|
disabled: false,
|
||
|
|
href,
|
||
|
|
external,
|
||
|
|
onClick: undefined
|
||
|
|
} | overrideProps()`});var Yy,Qy=z(()=>{Yy={demo:{view:"progress",progress:.5,content:'text:"Loading..."'},examples:[{title:"With no label (content)",demo:{view:"progress",progress:.25}},{title:"Custom color",demo:{view:"progress",progress:.85,color:"#bdab77",content:'text:"Yellow progress"'}}]}});function Ky(n){n.view.define("progress",function(e,i,o,l){let{content:c,progress:f,color:d}=i;if(e.append($("div",{class:"progress",style:`--progress: ${Math.max(0,Math.min(1,Number(f)))};--color: ${d||"unset"};`})),c){let g=$("div","content");return e.prepend(g),n.view.render(g,c,o,l)}},{usage:Yy})}var Zy=z(()=>{Oe();Qy()});var LM,Jy,Xy=z(()=>{LM=Function("return (value) => alert(`Changed to ${value}!`)")(),Jy={demo:{view:"select",data:["one","two","three","four"]},examples:[{title:"Select with value",demo:{view:"select",value:'"three"',data:["one","two","three","four"]}},{title:"Select with reset option",demo:{view:"select",resetItem:!0,value:'"three"',data:["one","two","three","four"]}},{title:"Select with placeholder",demo:{view:"select",placeholder:"placeholder",data:["one","two","three","four"]}},{title:"Select with onChange",demo:{view:"select",onChange:LM,data:["one","two","three","four"]}},{title:"Select with custom options",demo:{view:"select",item:"h1:text",data:["one","two","three","four"]}}]}});function ev(n){let e="text-match:{ text, match: #.filter }",i="{ value: $, text: #.selectVariantTextQuery.query($, #) }",o=new n.view.Popup({className:"view-select-popup"});n.view.define("select",function(l,c,f,d){function g(){if(l.innerHTML="",I!==void 0)return n.view.render(l,n.view.composeConfig({view:"menu-item",data:i,content:N},A),I,R)}let{name:m,value:y,text:k="$",placeholder:C,limit:M,minItemsFilter:E=10,resetItem:F=!1,item:N=e,itemConfig:A,beforeItems:b,afterItems:L,onInit:T,onChange:B}=c,I=y?n.query(y,f,d):d[m],R={...d,selectMinItemsFilter:E,selectCurrentValue:I,selectVariantTextQuery:k,selectResetItem:F?[{value:void 0,text:"",...F,resetItem:!0}]:[]},U=[];return b&&U.push(n.view.composeConfig(b,{onInit:T,onChange:B})),U.push({view:"context",data:`.(${i})`,modifiers:{view:"input",when:"size() >= #.selectMinItemsFilter",type:"regexp",name:"filter",className:"view-select__filter",placeholder:"Filter"},content:{view:"menu",className:"view-select__variants",data:"#.selectResetItem + .[no #.filter or text~=#.filter]",limit:M,itemConfig:n.view.composeConfig({className:[W=>W.resetItem?"reset-item":"",W=>W.value===I?"selected":""]},A),item:N,onClick(W){o.hide(),I!==W.value&&(I=W.value,R={...R,selectCurrentValue:I},g(),typeof B=="function"&&B(W.value,m,W,d))}}}),L&&U.push(n.view.composeConfig(L,{onInit:T,onChange:B})),C&&(l.dataset.placeholder=C),l.tabIndex=0,l.addEventListener("click",()=>{o.toggle(l,W=>n.view.render(W,U,f,R).then(()=>(W.querySelector(".view-select__filter input")||{focus(){}}).focus()))}),typeof T=="function"&&T(I,m,f,d),g()},{usage:Jy})}var tv=z(()=>{Xy()});var nv,rv=z(()=>{nv={demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}},examples:[{title:"With before and after content",demo:{view:"tabs",name:"example",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],beforeTabs:'text:"<Content before tabs>"',afterTabs:'text:"<Content after tabs>"',content:'text:"Selected: " + #.example'}},{title:"On change handler",demo:{view:"tabs",name:"example",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],onChange:Function('return (value) => alert("changed to " + value)')(),content:'text:"Selected: " + #.example'}}]}});function iv(n){n.view.define("tabs",function(e,i,o,l){async function c(B){let I=b?y:m;if(L===B)return;let R=d||g||f?{...l,[k]:B}:null;L=B,b=!0,Array.isArray(C)&&(E.innerHTML="",d&&(N.innerHTML="",await n.view.render(N,d,o,R),E.appendChild(N)),await Promise.all(C.map(U=>n.view.render(E,n.view.composeConfig(U,{
|
||
|
|
|
||
|
|
b`.split(/\n/).length!=3?function(t){for(var r=0,a=[],s=t.length;r<=s;){var u=t.indexOf(`
|
||
|
|
`,r);u==-1&&(u=t.length);var p=t.slice(r,t.charAt(u-1)=="\r"?u-1:u),h=p.indexOf("\r");h!=-1?(a.push(p.slice(0,h)),r+=h+1):(a.push(p),r=u+1)}return a}:function(t){return t.split(/\r\n?|\n/)},Wn=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch{return!1}}:function(t){var r;try{r=t.ownerDocument.selection.createRange()}catch{}return!r||r.parentElement()!=t?!1:r.compareEndPoints("StartToEnd",r)!=0},ms=(function(){var t=S("div");return"oncopy"in t?!0:(t.setAttribute("oncopy","return;"),typeof t.oncopy=="function")})(),on=null;function ul(t){if(on!=null)return on;var r=Z(t,S("span","x")),a=r.getBoundingClientRect(),s=ee(r,0,1).getBoundingClientRect();return on=Math.abs(a.left-s.left)>1}var Wr={},sn={};function an(t,r){arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),Wr[t]=r}function dr(t,r){sn[t]=r}function $r(t){if(typeof t=="string"&&sn.hasOwnProperty(t))t=sn[t];else if(t&&typeof t.name=="string"&&sn.hasOwnProperty(t.name)){var r=sn[t.name];typeof r=="string"&&(r={name:r}),t=K(r,t),t.name=r.name}else{if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return $r("application/xml");if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return $r("application/json")}return typeof t=="string"?{name:t}:t||{name:"null"}}function Ur(t,r){r=$r(r);var a=Wr[r.name];if(!a)return Ur(t,"text/plain");var s=a(t,r);if($n.hasOwnProperty(r.name)){var u=$n[r.name];for(var p in u)u.hasOwnProperty(p)&&(s.hasOwnProperty(p)&&(s["_"+p]=s[p]),s[p]=u[p])}if(s.name=r.name,r.helperType&&(s.helperType=r.helperType),r.modeProps)for(var h in r.modeProps)s[h]=r.modeProps[h];return s}var $n={};function Gr(t,r){var a=$n.hasOwnProperty(t)?$n[t]:$n[t]={};V(r,a)}function bn(t,r){if(r===!0)return r;if(t.copyState)return t.copyState(r);var a={};for(var s in r){var u=r[s];u instanceof Array&&(u=u.concat([])),a[s]=u}return a}function Ui(t,r){for(var a;t.innerMode&&(a=t.innerMode(r),!(!a||a.mode==t));)r=a.state,t=a.mode;return a||{mode:t,state:r}}function Vr(t,r,a){return t.startState?t.startState(r,a):!0}var Ze=function(t,r,a){this.pos=this.start=0,this.string=t,this.tabSize=r||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};Ze.prototype.eol=function(){return this.pos>=this.string.length},Ze.prototype.sol=function(){return this.pos==this.lineStart},Ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ze.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ze.prototype.eat=function(t){var r=this.string.charAt(this.pos),a;if(typeof t=="string"?a=r==t:a=r&&(t.test?t.test(r):t(r)),a)return++this.pos,r},Ze.prototype.eatWhile=function(t){for(var r=this.pos;this.eat(t););return this.pos>r},Ze.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Ze.prototype.skipToEnd=function(){this.pos=this.string.length},Ze.prototype.skipTo=function(t){var r=this.string.indexOf(t,this.pos);if(r>-1)return this.pos=r,!0},Ze.prototype.backUp=function(t){this.pos-=t},Ze.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?le(this.string,this.lineStart,this.tabSize):0)},Ze.prototype.indentation=function(){return le(this.string,null,this.tabSize)-(this.lineStart?le(this.string,this.lineStart,this.tabSize):0)},Ze.prototype.match=function(t,r,a){if(typeof t=="string"){var s=function(h){return a?h.toLowerCase():h},u=this.string.substr(this.pos,t.length);if(s(u)==s(t))return r!==!1&&(this.pos+=t.length),!0}else{var p=this.string.slice(this.pos).match(t);return p&&p.index>0?null:(p&&r!==!1&&(this.pos+=p[0].length),p)}},Ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ze.prototype.hideFirstChars=function(t,r){this.lineStart+=t;try{return r()}finally{this.lineStart-=t}},Ze.prototype.lookAhead=function(t){var r=this.lineOracle;return r&&r.lookAhead(t)},Ze.
|
||
|
|
`?(te=O.appendChild(S("span",_[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),te.setAttribute("cm-text",_[0]),t.col+=1):(te=t.cm.options.specialCharPlaceholder(_[0]),te.setAttribute("cm-text",_[0]),f&&d<9?O.appendChild(S("span",[te])):O.appendChild(te),t.col+=1);t.map.push(t.pos,t.pos+1,te),t.pos++}}if(t.trailingSpace=v.charCodeAt(r.length-1)==32,a||s||u||x||p||h){var de=a||"";s&&(de+=s),u&&(de+=u);var ce=S("span",[O],de,p);if(h)for(var he in h)h.hasOwnProperty(he)&&he!="style"&&he!="class"&&ce.setAttribute(he,h[he]);return t.content.appendChild(ce)}t.content.appendChild(O)}}function Sk(t,r){if(t.length>1&&!/ /.test(t))return t;for(var a=r,s="",u=0;u<t.length;u++){var p=t.charAt(u);p==" "&&a&&(u==t.length-1||t.charCodeAt(u+1)==32)&&(p="\xA0"),s+=p,a=p==" "}return s}function Ek(t,r){return function(a,s,u,p,h,v,w){u=u?u+" cm-force-border":"cm-force-border";for(var x=a.pos,O=x+s.length;;){for(var j=void 0,_=0;_<r.length&&(j=r[_],!(j.to>x&&j.from<=x));_++);if(j.to>=O)return t(a,s,u,p,h,v,w);t(a,s.slice(0,j.to-x),u,p,null,v,w),p=null,s=s.slice(j.to-x),x=j.to}}}function Md(t,r,a,s){var u=!s&&a.widgetNode;u&&t.map.push(t.pos,t.pos+r,u),!s&&t.cm.display.input.needsContentAttribute&&(u||(u=t.content.appendChild(document.createElement("span"))),u.setAttribute("cm-marker",a.id)),u&&(t.cm.display.input.setUneditable(u),t.content.appendChild(u)),t.pos+=r,t.trailingSpace=!1}function Mk(t,r,a){var s=t.markedSpans,u=t.text,p=0;if(!s){for(var h=1;h<a.length;h+=2)r.addToken(r,u.slice(p,p=a[h]),Sd(a[h+1],r.cm.options));return}for(var v=u.length,w=0,x=1,O="",j,_,H=0,Q,te,se,ue,de;;){if(H==w){Q=te=se=_="",de=null,ue=null,H=1/0;for(var ce=[],he=void 0,ve=0;ve<s.length;++ve){var me=s[ve],Se=me.marker;if(Se.type=="bookmark"&&me.from==w&&Se.widgetNode)ce.push(Se);else if(me.from<=w&&(me.to==null||me.to>w||Se.collapsed&&me.to==w&&me.from==w)){if(me.to!=null&&me.to!=w&&H>me.to&&(H=me.to,te=""),Se.className&&(Q+=" "+Se.className),Se.css&&(_=(_?_+";":"")+Se.css),Se.startStyle&&me.from==w&&(se+=" "+Se.startStyle),Se.endStyle&&me.to==H&&(he||(he=[])).push(Se.endStyle,me.to),Se.title&&((de||(de={})).title=Se.title),Se.attributes)for(var qe in Se.attributes)(de||(de={}))[qe]=Se.attributes[qe];Se.collapsed&&(!ue||pl(ue.marker,Se)<0)&&(ue=me)}else me.from>w&&H>me.from&&(H=me.from)}if(he)for(var ht=0;ht<he.length;ht+=2)he[ht+1]==H&&(te+=" "+he[ht]);if(!ue||ue.from==w)for(var Ve=0;Ve<ce.length;++Ve)Md(r,0,ce[Ve]);if(ue&&(ue.from||0)==w){if(Md(r,(ue.to==null?v+1:ue.to)-w,ue.marker,ue.from==null),ue.to==null)return;ue.to==w&&(ue=!1)}}if(w>=v)break;for(var zt=Math.min(v,H);;){if(O){var Ot=w+O.length;if(!ue){var it=Ot>zt?O.slice(0,zt-w):O;r.addToken(r,it,j?j+Q:Q,se,w+it.length==H?te:"",_,de)}if(Ot>=zt){O=O.slice(zt-w),w=zt;break}w=Ot,se=""}O=u.slice(p,p=a[x++]),j=Sd(a[x++],r.cm.options)}}}function Ld(t,r,a){this.line=r,this.rest=wk(r),this.size=this.rest?D(Te(this.rest))-a+1:1,this.node=this.text=null,this.hidden=Un(t,r)}function Cs(t,r,a){for(var s=[],u,p=r;p<a;p=u){var h=new Ld(t.doc,ge(t.doc,p),p);u=p+h.size,s.push(h)}return s}var Kr=null;function Lk(t){Kr?Kr.ops.push(t):t.ownsGroup=Kr={ops:[t],delayedCallbacks:[]}}function Tk(t){var r=t.delayedCallbacks,a=0;do{for(;a<r.length;a++)r[a].call(null);for(var s=0;s<t.ops.length;s++){var u=t.ops[s];if(u.cursorActivityHandlers)for(;u.cursorActivityCalled<u.cursorActivityHandlers.length;)u.cursorActivityHandlers[u.cursorActivityCalled++].call(null,u.cm)}}while(a<r.length)}function Fk(t,r){var a=t.ownsGroup;if(a)try{Tk(a)}finally{Kr=null,r(a)}}var Qi=null;function ft(t,r){var a=Mn(t,r);if(a.length){var s=Array.prototype.slice.call(arguments,2),u;Kr?u=Kr.delayedCallbacks:Qi?u=Qi:(u=Qi=[],setTimeout(Nk,0));for(var p=function(v){u.push(function(){return a[v].apply(null,s)})},h=0;h<a.length;++h)p(h)}}function Nk(){var t=Qi;Qi=null;for(var r=0;r<t.length;++r)t[r]()}function Td(t,r,a,s){for(var u=0;u<r.changes.length;u++){var p=r.changes[u];p=="text"?Bk(t,r):p=="gutter"?Nd(t,r,a,s):p=="class"?yl(t,r):p=="widget"&&Ik(t,r,s)}r.changes=null}function Ki(t){return t.node==t.text&&(t.node=S("div",null,null,"position: relative")
|
||
|
|
top: `+he+"px; width: "+(ve??w-ce)+`px;
|
||
|
|
height: `+(me-he)+"px"))}function j(ce,he,ve){var me=ge(u,ce),Se=me.text.length,qe,ht;function Ve(it,Bt){return Ss(t,Y(ce,it),"div",me,Bt)}function zt(it,Bt,mt){var lt=Vd(t,me,null,it),ot=Bt=="ltr"==(mt=="after")?"left":"right",Je=mt=="after"?lt.begin:lt.end-(/\s/.test(me.text.charAt(lt.end-1))?2:1);return Ve(Je,ot)[ot]}var Ot=Le(me,u.direction);return Rn(Ot,he||0,ve??Se,function(it,Bt,mt,lt){var ot=mt=="ltr",Je=Ve(it,ot?"left":"right"),It=Ve(Bt-1,ot?"right":"left"),di=he==null&&it==0,Xn=ve==null&&Bt==Se,kt=lt==0,Dn=!Ot||lt==Ot.length-1;if(It.top-Je.top<=3){var gt=(x?di:Xn)&&kt,tu=(x?Xn:di)&&Dn,In=gt?v:(ot?Je:It).left,xr=tu?w:(ot?It:Je).right;O(In,Je.top,xr-In,Je.bottom)}else{var kr,St,pi,nu;ot?(kr=x&&di&&kt?v:Je.left,St=x?w:zt(it,mt,"before"),pi=x?v:zt(Bt,mt,"after"),nu=x&&Xn&&Dn?w:It.right):(kr=x?zt(it,mt,"before"):v,St=!x&&di&&kt?w:Je.right,pi=!x&&Xn&&Dn?v:It.left,nu=x?zt(Bt,mt,"after"):w),O(kr,Je.top,St-kr,Je.bottom),Je.bottom<It.top&&O(v,Je.bottom,null,It.top),O(pi,It.top,nu-pi,It.bottom)}(!qe||Ms(Je,qe)<0)&&(qe=Je),Ms(It,qe)<0&&(qe=It),(!ht||Ms(Je,ht)<0)&&(ht=Je),Ms(It,ht)<0&&(ht=It)}),{start:qe,end:ht}}var _=r.from(),H=r.to();if(_.line==H.line)j(_.line,_.ch,H.ch);else{var Q=ge(u,_.line),te=ge(u,H.line),se=ln(Q)==ln(te),ue=j(_.line,_.ch,se?Q.text.length+1:null).end,de=j(H.line,se?0:null,H.ch).start;se&&(ue.top<de.top-2?(O(ue.right,ue.top,null,ue.bottom),O(v,de.top,de.left,de.bottom)):O(ue.right,ue.top,de.left-ue.right,ue.bottom)),ue.bottom<de.top&&O(v,ue.bottom,null,de.top)}a.appendChild(p)}function Ll(t){if(t.state.focused){var r=t.display;clearInterval(r.blinker);var a=!0;r.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?r.blinker=setInterval(function(){t.hasFocus()||ei(t),r.cursorDiv.style.visibility=(a=!a)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(r.cursorDiv.style.visibility="hidden")}}function Zd(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Fl(t))}function Tl(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&ei(t))},100)}function Fl(t,r){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),t.options.readOnly!="nocursor"&&(t.state.focused||(Qe(t,"focus",t,r),t.state.focused=!0,Pe(t.display.wrapper,"CodeMirror-focused"),!t.curOp&&t.display.selForContextMenu!=t.doc.sel&&(t.display.input.reset(),g&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),Ll(t))}function ei(t,r){t.state.delayingBlurEvent||(t.state.focused&&(Qe(t,"blur",t,r),t.state.focused=!1,ne(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function Ls(t){for(var r=t.display,a=r.lineDiv.offsetTop,s=Math.max(0,r.scroller.getBoundingClientRect().top),u=r.lineDiv.getBoundingClientRect().top,p=0,h=0;h<r.view.length;h++){var v=r.view[h],w=t.options.lineWrapping,x=void 0,O=0;if(!v.hidden){if(u+=v.line.height,f&&d<8){var j=v.node.offsetTop+v.node.offsetHeight;x=j-a,a=j}else{var _=v.node.getBoundingClientRect();x=_.bottom-_.top,!w&&v.text.firstChild&&(O=v.text.firstChild.getBoundingClientRect().right-_.left-1)}var H=v.line.height-x;if((H>.005||H<-.005)&&(u<s&&(p-=H),Ut(v.line,x),Jd(v.line),v.rest))for(var Q=0;Q<v.rest.length;Q++)Jd(v.rest[Q]);if(O>t.display.sizerWidth){var te=Math.ceil(O/Xr(t.display));te>t.display.maxLineLength&&(t.display.maxLineLength=te,t.display.maxLine=v.line,t.display.maxLineChanged=!0)}}}Math.abs(p)>2&&(r.scroller.scrollTop+=p)}function Jd(t){if(t.widgets)for(var r=0;r<t.widgets.length;++r){var a=t.widgets[r],s=a.node.parentNode;s&&(a.height=s.offsetHeight)}}function Ts(t,r,a){var s=a&&a.top!=null?Math.max(0,a.top):t.scroller.scrollTop;s=Math.floor(s-Ds(t));var u=a&&a.bottom!=null?a.bottom:s+t.wrapper.clientHeight,p=P(r,s),h=P(r,u);if(a&&a.ensure){var v=a.ensure.from.line,w=a.ensure.to.line;v<p?(p=v,h=P(r,Fn(ge(r,v))+t.wrapper.clientHeight)):Math.min(w,r.lastLine())>=h&&(p=P(r,Fn(ge(r,w))-t.wrapper.clientHeight),h=w)
|
||
|
|
top: `+(r.top-a.viewOffset-Ds(t.display))+`px;
|
||
|
|
height: `+(r.bottom-r.top+kn(t)+a.barHeight)+`px;
|
||
|
|
left: `+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;");t.display.lineSpace.appendChild(h),h.scrollIntoView(u),t.display.lineSpace.removeChild(h)}}}function Qk(t,r,a,s){s==null&&(s=0);var u;!t.options.lineWrapping&&r==a&&(a=r.sticky=="before"?Y(r.line,r.ch+1,"before"):r,r=r.ch?Y(r.line,r.sticky=="before"?r.ch-1:r.ch,"after"):r);for(var p=0;p<5;p++){var h=!1,v=un(t,r),w=!a||a==r?v:un(t,a);u={left:Math.min(v.left,w.left),top:Math.min(v.top,w.top)-s,right:Math.max(v.left,w.left),bottom:Math.max(v.bottom,w.bottom)+s};var x=Nl(t,u),O=t.doc.scrollTop,j=t.doc.scrollLeft;if(x.scrollTop!=null&&(to(t,x.scrollTop),Math.abs(t.doc.scrollTop-O)>1&&(h=!0)),x.scrollLeft!=null&&(yr(t,x.scrollLeft),Math.abs(t.doc.scrollLeft-j)>1&&(h=!0)),!h)break}return u}function Kk(t,r){var a=Nl(t,r);a.scrollTop!=null&&to(t,a.scrollTop),a.scrollLeft!=null&&yr(t,a.scrollLeft)}function Nl(t,r){var a=t.display,s=Jr(t.display);r.top<0&&(r.top=0);var u=t.curOp&&t.curOp.scrollTop!=null?t.curOp.scrollTop:a.scroller.scrollTop,p=wl(t),h={};r.bottom-r.top>p&&(r.bottom=r.top+p);var v=t.doc.height+vl(a),w=r.top<s,x=r.bottom>v-s;if(r.top<u)h.scrollTop=w?0:r.top;else if(r.bottom>u+p){var O=Math.min(r.top,(x?v:r.bottom)-p);O!=u&&(h.scrollTop=O)}var j=t.options.fixedGutter?0:a.gutters.offsetWidth,_=t.curOp&&t.curOp.scrollLeft!=null?t.curOp.scrollLeft:a.scroller.scrollLeft-j,H=pr(t)-a.gutters.offsetWidth,Q=r.right-r.left>H;return Q&&(r.right=r.left+H),r.left<10?h.scrollLeft=0:r.left<_?h.scrollLeft=Math.max(0,r.left+j-(Q?0:10)):r.right>H+_-3&&(h.scrollLeft=r.right+(Q?0:10)-H),h}function Ol(t,r){r!=null&&(Fs(t),t.curOp.scrollTop=(t.curOp.scrollTop==null?t.doc.scrollTop:t.curOp.scrollTop)+r)}function ti(t){Fs(t);var r=t.getCursor();t.curOp.scrollToPos={from:r,to:r,margin:t.options.cursorScrollMargin}}function eo(t,r,a){(r!=null||a!=null)&&Fs(t),r!=null&&(t.curOp.scrollLeft=r),a!=null&&(t.curOp.scrollTop=a)}function Zk(t,r){Fs(t),t.curOp.scrollToPos=r}function Fs(t){var r=t.curOp.scrollToPos;if(r){t.curOp.scrollToPos=null;var a=Ud(t,r.from),s=Ud(t,r.to);Xd(t,a,s,r.margin)}}function Xd(t,r,a,s){var u=Nl(t,{left:Math.min(r.left,a.left),top:Math.min(r.top,a.top)-s,right:Math.max(r.right,a.right),bottom:Math.max(r.bottom,a.bottom)+s});eo(t,u.scrollLeft,u.scrollTop)}function to(t,r){Math.abs(t.doc.scrollTop-r)<2||(i||Il(t,{top:r}),ep(t,r,!0),i&&Il(t),io(t,100))}function ep(t,r,a){r=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,r)),!(t.display.scroller.scrollTop==r&&!a)&&(t.doc.scrollTop=r,t.display.scrollbars.setScrollTop(r),t.display.scroller.scrollTop!=r&&(t.display.scroller.scrollTop=r))}function yr(t,r,a,s){r=Math.max(0,Math.min(r,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),!((a?r==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-r)<2)&&!s)&&(t.doc.scrollLeft=r,op(t),t.display.scroller.scrollLeft!=r&&(t.display.scroller.scrollLeft=r),t.display.scrollbars.setScrollLeft(r))}function no(t){var r=t.display,a=r.gutters.offsetWidth,s=Math.round(t.doc.height+vl(t.display));return{clientHeight:r.scroller.clientHeight,viewHeight:r.wrapper.clientHeight,scrollWidth:r.scroller.scrollWidth,clientWidth:r.scroller.clientWidth,viewWidth:r.wrapper.clientWidth,barLeft:t.options.fixedGutter?a:0,docHeight:s,scrollHeight:s+kn(t)+r.barHeight,nativeBarWidth:r.nativeBarWidth,gutterWidth:a}}var vr=function(t,r,a){this.cm=a;var s=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),u=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");s.tabIndex=u.tabIndex=-1,t(s),t(u),ye(s,"scroll",function(){s.clientHeight&&r(s.scrollTop,"vertical")}),ye(u,"scroll",function(){u.clientWidth&&r(u.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,f&&d<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vr.prototype.update=function(t){var r=t.scrollWidth>t.clientWidth+1,a=t.scrollHeight>t.clientHeight+1,s=t.nativeBarWidth;if(a){this.vert.style.display="block",this.vert.style.bottom=r?s+"px":"0";var u=t.viewHeight-(r?s:0);this.vert.firstChild.style.h
|
||
|
|
`},setDirection:pt(function(t){t!="rtl"&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter(function(r){return r.order=null}),this.cm&&pC(this.cm))})}),Nt.prototype.eachLine=Nt.prototype.iter;var Pp=0;function SC(t){var r=this;if(jp(r),!(Ke(r,t)||Nn(r.display,t))){bt(t),f&&(Pp=+new Date);var a=gr(r,t,!0),s=t.dataTransfer.files;if(!(!a||r.isReadOnly()))if(s&&s.length&&window.FileReader&&window.File)for(var u=s.length,p=Array(u),h=0,v=function(){++h==u&&dt(r,function(){a=ke(r.doc,a);var H={from:a,to:a,text:r.doc.splitLines(p.filter(function(Q){return Q!=null}).join(r.doc.lineSeparator())),origin:"paste"};oi(r.doc,H),xp(r.doc,Yn(ke(r.doc,a),ke(r.doc,Qn(H))))})()},w=function(H,Q){if(r.options.allowDropFileTypes&&ie(r.options.allowDropFileTypes,H.type)==-1){v();return}var te=new FileReader;te.onerror=function(){return v()},te.onload=function(){var se=te.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(se)){v();return}p[Q]=se,v()},te.readAsText(H)},x=0;x<s.length;x++)w(s[x],x);else{if(r.state.draggingText&&r.doc.sel.contains(a)>-1){r.state.draggingText(t),setTimeout(function(){return r.display.input.focus()},20);return}try{var O=t.dataTransfer.getData("Text");if(O){var j;if(r.state.draggingText&&!r.state.draggingText.copy&&(j=r.listSelections()),js(r.doc,Yn(a,a)),j)for(var _=0;_<j.length;++_)si(r.doc,"",j[_].anchor,j[_].head,"drag");r.replaceSelection(O,"around","paste"),r.display.input.focus()}}catch{}}}}function EC(t,r){if(f&&(!t.state.draggingText||+new Date-Pp<100)){qn(r);return}if(!(Ke(t,r)||Nn(t.display,r))&&(r.dataTransfer.setData("Text",t.getSelection()),r.dataTransfer.effectAllowed="copyMove",r.dataTransfer.setDragImage&&!M)){var a=S("img",null,null,"position: fixed; left: 0; top: 0;");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",C&&(a.width=a.height=1,t.display.wrapper.appendChild(a),a._top=a.offsetTop),r.dataTransfer.setDragImage(a,0,0),C&&a.parentNode.removeChild(a)}}function MC(t,r){var a=gr(t,r);if(a){var s=document.createDocumentFragment();Ml(t,a,s),t.display.dragCursor||(t.display.dragCursor=S("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),Z(t.display.dragCursor,s)}}function jp(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function zp(t){if(document.getElementsByClassName){for(var r=document.getElementsByClassName("CodeMirror"),a=[],s=0;s<r.length;s++){var u=r[s].CodeMirror;u&&a.push(u)}a.length&&a[0].operation(function(){for(var p=0;p<a.length;p++)t(a[p])})}}var Rp=!1;function LC(){Rp||(TC(),Rp=!0)}function TC(){var t;ye(window,"resize",function(){t==null&&(t=setTimeout(function(){t=null,zp(FC)},100))}),ye(window,"blur",function(){return zp(ei)})}function FC(t){var r=t.display;r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.scrollbarsClipped=!1,t.setSize()}for(var Jn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ho=0;ho<10;ho++)Jn[ho+48]=Jn[ho+96]=String(ho);for(var Hs=65;Hs<=90;Hs++)Jn[Hs]=String.fromCharCode(Hs);for(var go=1;go<=12;go++)Jn[go+111]=Jn[go+63235]="F"+go;var Bn={};Bn.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Bn.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ct
|
||
|
|
`,"start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function Wp(t,r){var a=ge(t.doc,r),s=ln(a);return s!=a&&(r=D(s)),Vl(!0,t,s,r,1)}function IC(t,r){var a=ge(t.doc,r),s=vk(a);return s!=a&&(r=D(s)),Vl(!0,t,a,r,-1)}function $p(t,r){var a=Wp(t,r.line),s=ge(t.doc,a.line),u=Le(s,t.doc.direction);if(!u||u[0].level==0){var p=Math.max(a.ch,s.text.search(/\S/)),h=r.line==a.line&&r.ch<=p&&r.ch;return Y(a.line,h?0:p,a.sticky)}return a}function _s(t,r,a){if(typeof r=="string"&&(r=mo[r],!r))return!1;t.display.input.ensurePolled();var s=t.display.shift,u=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),a&&(t.display.shift=!1),u=r(t)!=Ce}finally{t.display.shift=s,t.state.suppressEdits=!1}return u}function PC(t,r,a){for(var s=0;s<t.state.keyMaps.length;s++){var u=li(r,t.state.keyMaps[s],a,t);if(u)return u}return t.options.extraKeys&&li(r,t.options.extraKeys,a,t)||li(r,t.options.keyMap,a,t)}var jC=new re;function yo(t,r,a,s){var u=t.state.keySeq;if(u){if(Hp(r))return"handled";if(/\'$/.test(r)?t.state.keySeq=null:jC.set(50,function(){t.state.keySeq==u&&(t.state.keySeq=null,t.display.input.reset())}),Up(t,u+" "+r,a,s))return!0}return Up(t,r,a,s)}function Up(t,r,a,s){var u=PC(t,r,s);return u=="multi"&&(t.state.keySeq=r),u=="handled"&&ft(t,"keyHandled",t,r,a),(u=="handled"||u=="multi")&&(bt(a),Ll(t)),!!u}function Gp(t,r){var a=_p(r,!0);return a?r.shiftKey&&!t.state.keySeq?yo(t,"Shift-"+a,r,function(s){return _s(t,s,!0)})||yo(t,a,r,function(s){if(typeof s=="string"?/^go[A-Z]/.test(s):s.motion)return _s(t,s)}):yo(t,a,r,function(s){return _s(t,s)}):!1}function zC(t,r,a){return yo(t,"'"+a+"'",r,function(s){return _s(t,s,!0)})}var Yl=null;function Vp(t){var r=this;if(!(t.target&&t.target!=r.display.input.getField())&&(r.curOp.focus=De(yt(r)),!Ke(r,t))){f&&d<11&&t.keyCode==27&&(t.returnValue=!1);var a=t.keyCode;r.display.shift=a==16||t.shiftKey;var s=Gp(r,t);C&&(Yl=s?a:null,!s&&a==88&&!ms&&(L?t.metaKey:t.ctrlKey)&&r.replaceSelection("",null,"cut")),i&&!L&&!s&&a==46&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),a==18&&!/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)&&RC(r)}}function RC(t){var r=t.display.lineDiv;Pe(r,"CodeMirror-crosshair");function a(s){(s.keyCode==18||!s.altKey)&&(ne(r,"CodeMirror-crosshair"),wt(document,"keyup",a),wt(document,"mouseover",a))}ye(document,"keyup",a),ye(document,"mouseover",a)}function Yp(t){t.keyCode==16&&(this.doc.sel.shift=!1),Ke(this,t)}function Qp(t){var r=this;if(!(t.target&&t.target!=r.display.input.getField())&&!(Nn(r.display,t)||Ke(r,t)||t.ctrlKey&&!t.altKey||L&&t.metaKey)){var a=t.keyCode,s=t.charCode;if(C&&a==Yl){Yl=null,bt(t);return}if(!(C&&(!t.which||t.which<10)&&Gp(r,t))){var u=String.fromCharCode(s??a);u!="\b"&&(zC(r,t,u)||r.display.input.onKeyPress(t))}}}var HC=400,Ql=function(t,r,a){this.time=t,this.pos=r,this.button=a};Ql.prototype.compare=function(t,r,a){return this.time+HC>t&&fe(r,this.pos)==0&&a==this.button};var vo,wo;function qC(t,r){var a=+new Date;return wo&&wo.compare(a,t,r)?(vo=wo=null,"triple"):vo&&vo.compare(a,t,r)?(wo=new Ql(a,t,r),vo=null,"double"):(vo=new Ql(a,t,r),wo=null,"single")}function Kp(t){var r=this,a=r.display;if(!(Ke(r,t)||a.activeTouch&&a.input.supportsTouch())){if(a.input.ensurePolled(),a.shift=t.shiftKey,Nn(a,t)){g||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if(!Kl(r,t)){var s=gr(r,t),u=rn(t),p=s?qC(s,u):"single";xe(r).focus(),u==1&&r.state.selectingText&&r.state.selectingText(t),!(s&&_C(r,u,s,p,t))&&(u==1?s?$C(r,s,p,t):Wi(t)==a.scroller&&bt(t):u==2?(s&&Ps(r.doc,s),setTimeout(function(){return a.input.focus()},20)):u==3&&(U?r.display.input.onContextMenu(t):Tl(r)))}}}function _C(t,r,a,s,u){var p="Click";return s=="double"?p="Double"+p:s=="triple"&&(p="Triple"+p),p=(r==1?"Left":r==2?"Middle":"Right")+p,yo(t,qp(p,u),u,function(h){if(typeof h=="string"&&(h=mo[h]),!h)return!1;var v=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),v=h(t,a)!=Ce}finally{t.state.suppressEdits=!1}return v})}function WC(t,r,a){var s=t.getOption("configureMouse"),u=s?s(t,r,a):{};if(u.unit=
|
||
|
|
`)==r){if(s.ranges.length%fn.text.length==0){x=[];for(var O=0;O<fn.text.length;O++)x.push(p.splitLines(fn.text[O]))}}else w.length==s.ranges.length&&t.options.pasteLinesPerSelection&&(x=He(w,function(ue){return[ue]}));for(var j=t.curOp.updateInput,_=s.ranges.length-1;_>=0;_--){var H=s.ranges[_],Q=H.from(),te=H.to();H.empty()&&(a&&a>0?Q=Y(Q.line,Q.ch-a):t.state.overwrite&&!v?te=Y(te.line,Math.min(ge(p,te.line).text.length,te.ch+Te(w).length)):v&&fn&&fn.lineWise&&fn.text.join(`
|
||
|
|
`)==w.join(`
|
||
|
|
`)&&(Q=te=Y(Q.line,0)));var se={from:Q,to:te,text:x?x[_%x.length]:w,origin:u||(v?"paste":t.state.cutIncoming>h?"cut":"+input")};oi(t.doc,se),ft(t,"inputRead",t,se)}r&&!v&&rh(t,r),ti(t),t.curOp.updateInput<2&&(t.curOp.updateInput=j),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function nh(t,r){var a=t.clipboardData&&t.clipboardData.getData("Text");if(a)return t.preventDefault(),!r.isReadOnly()&&!r.options.disableInput&&r.hasFocus()&&jt(r,function(){return Jl(r,a,0,null,"paste")}),!0}function rh(t,r){if(!(!t.options.electricChars||!t.options.smartIndent))for(var a=t.doc.sel,s=a.ranges.length-1;s>=0;s--){var u=a.ranges[s];if(!(u.head.ch>100||s&&a.ranges[s-1].head.line==u.head.line)){var p=t.getModeAt(u.head),h=!1;if(p.electricChars){for(var v=0;v<p.electricChars.length;v++)if(r.indexOf(p.electricChars.charAt(v))>-1){h=bo(t,u.head.line,"smart");break}}else p.electricInput&&p.electricInput.test(ge(t.doc,u.head.line).text.slice(0,u.head.ch))&&(h=bo(t,u.head.line,"smart"));h&&ft(t,"electricInput",t,u.head.line)}}}function ih(t){for(var r=[],a=[],s=0;s<t.doc.sel.ranges.length;s++){var u=t.doc.sel.ranges[s].head.line,p={anchor:Y(u,0),head:Y(u+1,0)};a.push(p),r.push(t.getRange(p.anchor,p.head))}return{text:r,ranges:a}}function Xl(t,r,a,s){t.setAttribute("autocorrect",a?"on":"off"),t.setAttribute("autocapitalize",s?"on":"off"),t.setAttribute("spellcheck",!!r)}function oh(){var t=S("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),r=S("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?t.style.width="1000px":t.setAttribute("wrap","off"),N&&(t.style.border="1px solid black"),r}function XC(t){var r=t.optionHandlers,a=t.helpers={};t.prototype={constructor:t,focus:function(){xe(this).focus(),this.display.input.focus()},setOption:function(s,u){var p=this.options,h=p[s];p[s]==u&&s!="mode"||(p[s]=u,r.hasOwnProperty(s)&&dt(this,r[s])(this,u,h),Qe(this,"optionChange",this,s))},getOption:function(s){return this.options[s]},getDoc:function(){return this.doc},addKeyMap:function(s,u){this.state.keyMaps[u?"push":"unshift"](qs(s))},removeKeyMap:function(s){for(var u=this.state.keyMaps,p=0;p<u.length;++p)if(u[p]==s||u[p].name==s)return u.splice(p,1),!0},addOverlay:At(function(s,u){var p=s.token?s:t.getMode(this.options,s);if(p.startState)throw new Error("Overlays may not be stateful.");G(this.state.overlays,{mode:p,modeSpec:s,opaque:u&&u.opaque,priority:u&&u.priority||0},function(h){return h.priority}),this.state.modeGen++,Ft(this)}),removeOverlay:At(function(s){for(var u=this.state.overlays,p=0;p<u.length;++p){var h=u[p].modeSpec;if(h==s||typeof s=="string"&&h.name==s){u.splice(p,1),this.state.modeGen++,Ft(this);return}}}),indentLine:At(function(s,u,p){typeof u!="string"&&typeof u!="number"&&(u==null?u=this.options.smartIndent?"smart":"prev":u=u?"add":"subtract"),J(this.doc,s)&&bo(this,s,u,p)}),indentSelection:At(function(s){for(var u=this.doc.sel.ranges,p=-1,h=0;h<u.length;h++){var v=u[h];if(v.empty())v.head.line>p&&(bo(this,v.head.line,s,!0),p=v.head.line,h==this.doc.sel.primIndex&&ti(this));else{var w=v.from(),x=v.to(),O=Math.max(p,w.line);p=Math.min(this.lastLine(),x.line-(x.ch?0:1))+1;for(var j=O;j<p;++j)bo(this,j,s);var _=this.doc.sel.ranges;w.ch==0&&u.length==_.length&&_[h].from().ch>0&&$l(this.doc,h,new Ie(w,_[h].to()),be)}}}),getTokenAt:function(s,u){return gd(this,s,u)},getLineTokens:function(s,u){return gd(this,Y(s),u,!0)},getTokenTypeAt:function(s){s=ke(this.doc,s);var u=dd(this,ge(this.doc,s.line)),p=0,h=(u.length-1)/2,v=s.ch,w;if(v==0)w=u[2];else for(;;){var x=p+h>>1;if((x?u[x*2-1]:0)>=v)h=x;else if(u[x*2+1]<v)p=x+1;else{w=u[x*2+2];break}}var O=w?w.indexOf("overlay "):-1;return O<0?w:O==0?null:w.slice(0,O-1)},getModeAt:function(s){var u=this.doc.mode;return u.innerMode?t.innerMode(u,this.getTokenAt(s).state).mode:u},getHelper:function(s,u){return this.getHelpers(s,u)[0]},getHelpers:function(s,u){var p=[];if(!a.hasOwnProperty(u))return p;var h=a[u],v=this.getModeAt(s);if(typeof v[u]=="string")h[v[u]]&&p.
|
||
|
|
`,se=Sn(te,H)?"w":_&&te==`
|
||
|
|
`?"n":!_||/\s/.test(te)?null:"p";if(_&&!Q&&!se&&(se="s"),j&&j!=se){a<0&&(a=1,O(),r.sticky="after");break}if(se&&(j=se),a>0&&!O(!Q))break}var ue=zs(t,r,p,h,!0);return Be(p,ue)&&(ue.hitSide=!0),ue}function sh(t,r,a,s){var u=t.doc,p=r.left,h;if(s=="page"){var v=Math.min(t.display.wrapper.clientHeight,xe(t).innerHeight||u(t).documentElement.clientHeight),w=Math.max(v-.5*Jr(t.display),3);h=(a>0?r.bottom:r.top)+a*w}else s=="line"&&(h=a>0?r.bottom+3:r.top-3);for(var x;x=Cl(t,p,h),!!x.outside;){if(a<0?h<=0:h>=u.height){x.hitSide=!0;break}h+=a*5}return x}var ze=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new re,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ze.prototype.init=function(t){var r=this,a=this,s=a.cm,u=a.div=t.lineDiv;u.contentEditable=!0,Xl(u,s.options.spellcheck,s.options.autocorrect,s.options.autocapitalize);function p(v){for(var w=v.target;w;w=w.parentNode){if(w==u)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(w.className))break}return!1}ye(u,"paste",function(v){!p(v)||Ke(s,v)||nh(v,s)||d<=11&&setTimeout(dt(s,function(){return r.updateFromDOM()}),20)}),ye(u,"compositionstart",function(v){r.composing={data:v.data,done:!1}}),ye(u,"compositionupdate",function(v){r.composing||(r.composing={data:v.data,done:!1})}),ye(u,"compositionend",function(v){r.composing&&(v.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),ye(u,"touchstart",function(){return a.forceCompositionEnd()}),ye(u,"input",function(){r.composing||r.readFromDOMSoon()});function h(v){if(!(!p(v)||Ke(s,v))){if(s.somethingSelected())$s({lineWise:!1,text:s.getSelections()}),v.type=="cut"&&s.replaceSelection("",null,"cut");else if(s.options.lineWiseCopyCut){var w=ih(s);$s({lineWise:!0,text:w.text}),v.type=="cut"&&s.operation(function(){s.setSelections(w.ranges,0,be),s.replaceSelection("",null,"cut")})}else return;if(v.clipboardData){v.clipboardData.clearData();var x=fn.text.join(`
|
||
|
|
`);if(v.clipboardData.setData("Text",x),v.clipboardData.getData("Text")==x){v.preventDefault();return}}var O=oh(),j=O.firstChild;Xl(j),s.display.lineSpace.insertBefore(O,s.display.lineSpace.firstChild),j.value=fn.text.join(`
|
||
|
|
`);var _=De(je(u));nt(j),setTimeout(function(){s.display.lineSpace.removeChild(O),_.focus(),_==u&&a.showPrimarySelection()},50)}}ye(u,"copy",h),ye(u,"cut",h)},ze.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},ze.prototype.prepareSelection=function(){var t=Kd(this.cm,!1);return t.focus=De(je(this.div))==this.div,t},ze.prototype.showSelection=function(t,r){!t||!this.cm.display.view.length||((t.focus||r)&&this.showPrimarySelection(),this.showMultipleSelections(t))},ze.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ze.prototype.showPrimarySelection=function(){var t=this.getSelection(),r=this.cm,a=r.doc.sel.primary(),s=a.from(),u=a.to();if(r.display.viewTo==r.display.viewFrom||s.line>=r.display.viewTo||u.line<r.display.viewFrom){t.removeAllRanges();return}var p=Us(r,t.anchorNode,t.anchorOffset),h=Us(r,t.focusNode,t.focusOffset);if(!(p&&!p.bad&&h&&!h.bad&&fe(Yr(p,h),s)==0&&fe(Tt(p,h),u)==0)){var v=r.display.view,w=s.line>=r.display.viewFrom&&ah(r,s)||{node:v[0].measure.map[2],offset:0},x=u.line<r.display.viewTo&&ah(r,u);if(!x){var O=v[v.length-1].measure,j=O.maps?O.maps[O.maps.length-1]:O.map;x={node:j[j.length-1],offset:j[j.length-2]-j[j.length-3]}}if(!w||!x){t.removeAllRanges();return}var _=t.rangeCount&&t.getRangeAt(0),H;try{H=ee(w.node,w.offset,x.offset,x.node)}catch{}H&&(!i&&r.state.focused?(t.collapse(w.node,w.offset),H.collapsed||(t.removeAllRanges(),t.addRange(H))):(t.removeAllRanges(),t.addRange(H)),_&&t.anchorNode==null?t.addRange(_):i&&this.startGracePeriod()),this.rememberSelection()}},ze.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation(function(){return t.cm.curOp.selectionChanged=!0})},20)},ze.prototype.showMultipleSelections=function(t){Z(this.cm.display.cursorDiv,t.cursors),Z(this.cm.display.selectionDiv,t.selection)},ze.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},ze.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var r=t.getRangeAt(0).commonAncestorContainer;return pe(this.div,r)},ze.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||De(je(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ze.prototype.blur=function(){this.div.blur()},ze.prototype.getField=function(){return this.div},ze.prototype.supportsTouch=function(){return!0},ze.prototype.receivedFocus=function(){var t=this,r=this;this.selectionInEditor()?setTimeout(function(){return t.pollSelection()},20):jt(this.cm,function(){return r.cm.curOp.selectionChanged=!0});function a(){r.cm.state.focused&&(r.pollSelection(),r.polling.set(r.cm.options.pollInterval,a))}this.polling.set(this.cm.options.pollInterval,a)},ze.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},ze.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var t=this.getSelection(),r=this.cm;if(A&&y&&this.cm.display.gutterSpecs.length&&e1(t.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var a=Us(r,t.anchorNode,t.anchorOffset),s=Us(r,t.focusNode,t.focusOffset);a&&s&&jt(r,function(){xt(r.doc,Yn(a,s),be),(a.bad||s.bad)&&(r.curOp.selectionChanged=!0)})}}},ze.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t=this.cm,r=t.display,a=t.doc.sel.primary(),s=a.from(),u=a.to();if(s.ch==0&&s.line>t.firstLine()&&(s=Y(s.line-1,ge(t.doc,s.line-1).length)),u.ch==ge(t.doc,u.l
|
||
|
|
`),nt(u))}else return;h.type=="cut"&&(s.state.cutIncoming=+new Date)}}ye(u,"cut",p),ye(u,"copy",p),ye(t.scroller,"paste",function(h){if(!(Nn(t,h)||Ke(s,h))){if(!u.dispatchEvent){s.state.pasteIncoming=+new Date,a.focus();return}var v=new Event("paste");v.clipboardData=h.clipboardData,u.dispatchEvent(v)}}),ye(t.lineSpace,"selectstart",function(h){Nn(t,h)||bt(h)}),ye(u,"compositionstart",function(){var h=s.getCursor("from");a.composing&&a.composing.range.clear(),a.composing={start:h,range:s.markText(h,s.getCursor("to"),{className:"CodeMirror-composing"})}}),ye(u,"compositionend",function(){a.composing&&(a.poll(),a.composing.range.clear(),a.composing=null)})},tt.prototype.createField=function(t){this.wrapper=oh(),this.textarea=this.wrapper.firstChild;var r=this.cm.options;Xl(this.textarea,r.spellcheck,r.autocorrect,r.autocapitalize)},tt.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},tt.prototype.prepareSelection=function(){var t=this.cm,r=t.display,a=t.doc,s=Kd(t);if(t.options.moveInputWithCursor){var u=un(t,a.sel.primary().head,"div"),p=r.wrapper.getBoundingClientRect(),h=r.lineDiv.getBoundingClientRect();s.teTop=Math.max(0,Math.min(r.wrapper.clientHeight-10,u.top+h.top-p.top)),s.teLeft=Math.max(0,Math.min(r.wrapper.clientWidth-10,u.left+h.left-p.left))}return s},tt.prototype.showSelection=function(t){var r=this.cm,a=r.display;Z(a.cursorDiv,t.cursors),Z(a.selectionDiv,t.selection),t.teTop!=null&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},tt.prototype.reset=function(t){if(!(this.contextMenuPending||this.composing&&t)){var r=this.cm;if(this.resetting=!0,r.somethingSelected()){this.prevInput="";var a=r.getSelection();this.textarea.value=a,r.state.focused&&nt(this.textarea),f&&d>=9&&(this.hasSelection=a)}else t||(this.prevInput=this.textarea.value="",f&&d>=9&&(this.hasSelection=null));this.resetting=!1}},tt.prototype.getField=function(){return this.textarea},tt.prototype.supportsTouch=function(){return!1},tt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!b||De(je(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},tt.prototype.blur=function(){this.textarea.blur()},tt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},tt.prototype.receivedFocus=function(){this.slowPoll()},tt.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},tt.prototype.fastPoll=function(){var t=!1,r=this;r.pollingFast=!0;function a(){var s=r.poll();!s&&!t?(t=!0,r.polling.set(60,a)):(r.pollingFast=!1,r.slowPoll())}r.polling.set(20,a)},tt.prototype.poll=function(){var t=this,r=this.cm,a=this.textarea,s=this.prevInput;if(this.contextMenuPending||this.resetting||!r.state.focused||Wn(a)&&!s&&!this.composing||r.isReadOnly()||r.options.disableInput||r.state.keySeq)return!1;var u=a.value;if(u==s&&!r.somethingSelected())return!1;if(f&&d>=9&&this.hasSelection===u||L&&/[\uf700-\uf7ff]/.test(u))return r.display.input.reset(),!1;if(r.doc.sel==r.display.selForContextMenu){var p=u.charCodeAt(0);if(p==8203&&!s&&(s="\u200B"),p==8666)return this.reset(),this.cm.execCommand("undo")}for(var h=0,v=Math.min(s.length,u.length);h<v&&s.charCodeAt(h)==u.charCodeAt(h);)++h;return jt(r,function(){Jl(r,u.slice(h),s.length-h,null,t.composing?"*compose":null),u.length>1e3||u.indexOf(`
|
||
|
|
`)>-1?a.value=t.prevInput="":t.prevInput=u,t.composing&&(t.composing.range.clear(),t.composing.range=r.markText(t.composing.start,r.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},tt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},tt.prototype.onKeyPress=function(){f&&d>=9&&(this.hasSelection=null),this.fastPoll()},tt.prototype.onContextMenu=function(t){var r=this,a=r.cm,s=a.display,u=r.textarea;r.contextMenuPending&&r.contextMenuPending();var p=gr(a,t),h=s.scroller.scrollTop;if(!p||C)return;var v=a.options.resetSelectionOnContextMenu;v&&a.doc.sel.contains(p)==-1&&dt(a,xt)(a.doc,Yn(p),be);var w=u.style.cssText,x=r.wrapper.style.cssText,O=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static",u.style.cssText=`position: absolute; width: 30px; height: 30px;
|
||
|
|
top: `+(t.clientY-O.top-5)+"px; left: "+(t.clientX-O.left-5)+`px;
|
||
|
|
z-index: 1000; background: `+(f?"rgba(255, 255, 255, .05)":"transparent")+`;
|
||
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var j;g&&(j=u.ownerDocument.defaultView.scrollY),s.input.focus(),g&&u.ownerDocument.defaultView.scrollTo(null,j),s.input.reset(),a.somethingSelected()||(u.value=r.prevInput=" "),r.contextMenuPending=H,s.selForContextMenu=a.doc.sel,clearTimeout(s.detectingSelectAll);function _(){if(u.selectionStart!=null){var te=a.somethingSelected(),se="\u200B"+(te?u.value:"");u.value="\u21DA",u.value=se,r.prevInput=te?"":"\u200B",u.selectionStart=1,u.selectionEnd=se.length,s.selForContextMenu=a.doc.sel}}function H(){if(r.contextMenuPending==H&&(r.contextMenuPending=!1,r.wrapper.style.cssText=x,u.style.cssText=w,f&&d<9&&s.scrollbars.setScrollTop(s.scroller.scrollTop=h),u.selectionStart!=null)){(!f||f&&d<9)&&_();var te=0,se=function(){s.selForContextMenu==a.doc.sel&&u.selectionStart==0&&u.selectionEnd>0&&r.prevInput=="\u200B"?dt(a,Sp)(a):te++<10?s.detectingSelectAll=setTimeout(se,500):(s.selForContextMenu=null,s.input.reset())};s.detectingSelectAll=setTimeout(se,200)}}if(f&&d>=9&&_(),U){qn(t);var Q=function(){wt(window,"mouseup",Q),setTimeout(H,20)};ye(window,"mouseup",Q)}else setTimeout(H,50)},tt.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled=t=="nocursor",this.textarea.readOnly=!!t},tt.prototype.setUneditable=function(){},tt.prototype.needsContentAttribute=!1;function r1(t,r){if(r=r?V(r):{},r.value=t.value,!r.tabindex&&t.tabIndex&&(r.tabindex=t.tabIndex),!r.placeholder&&t.placeholder&&(r.placeholder=t.placeholder),r.autofocus==null){var a=De(je(t));r.autofocus=a==t||t.getAttribute("autofocus")!=null&&a==document.body}function s(){t.value=v.getValue()}var u;if(t.form&&(ye(t.form,"submit",s),!r.leaveSubmitMethodAlone)){var p=t.form;u=p.submit;try{var h=p.submit=function(){s(),p.submit=u,p.submit(),p.submit=h}}catch{}}r.finishInit=function(w){w.save=s,w.getTextArea=function(){return t},w.toTextArea=function(){w.toTextArea=isNaN,s(),t.parentNode.removeChild(w.getWrapperElement()),t.style.display="",t.form&&(wt(t.form,"submit",s),!r.leaveSubmitMethodAlone&&typeof t.form.submit=="function"&&(t.form.submit=u))}},t.style.display="none";var v=Ge(function(w){return t.parentNode.insertBefore(w,t.nextSibling)},r);return v}function i1(t){t.off=wt,t.on=ye,t.wheelEventPixels=fC,t.Doc=Nt,t.splitLines=Jt,t.countColumn=le,t.findColumn=Ue,t.isWordChar=vt,t.Pass=Ce,t.signal=Qe,t.Line=Qr,t.changeEnd=Qn,t.scrollbarModel=np,t.Pos=Y,t.cmpPos=fe,t.modes=Wr,t.mimeModes=sn,t.resolveMode=$r,t.getMode=Ur,t.modeExtensions=$n,t.extendMode=Gr,t.copyState=bn,t.startState=Vr,t.innerMode=Ui,t.commands=mo,t.keyMap=Bn,t.keyName=_p,t.isModifierKey=Hp,t.lookupKey=li,t.normalizeKeyMap=OC,t.StringStream=Ze,t.SharedTextMarker=po,t.TextMarker=Zn,t.LineWidget=fo,t.e_preventDefault=bt,t.e_stopPropagation=qr,t.e_stop=qn,t.addClass=Pe,t.contains=pe,t.rmClass=ne,t.keyNames=Jn}QC(Ge),XC(Ge);var o1="iter insert remove copy getEditor constructor".split(" ");for(var Gs in Nt.prototype)Nt.prototype.hasOwnProperty(Gs)&&ie(o1,Gs)<0&&(Ge.prototype[Gs]=(function(t){return function(){return t.apply(this.doc,arguments)}})(Nt.prototype[Gs]));return nn(Nt),Ge.inputStyles={textarea:tt,contenteditable:ze},Ge.defineMode=function(t){!Ge.defaults.mode&&t!="null"&&(Ge.defaults.mode=t),an.apply(this,arguments)},Ge.defineMIME=dr,Ge.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Ge.defineMIME("text/plain","null"),Ge.defineExtension=function(t,r){Ge.prototype[t]=r},Ge.defineDocExtension=function(t,r){Nt.prototype[t]=r},Ge.fromTextArea=r1,i1(Ge),Ge.version="5.65.18",Ge}))});function cf(n){let e=new Set(["has","in","no","not","and","or","is","asc","ascN","ascA","ascAN","ascNA","desc","descN","descA","descAN","descNA"]),i=uf.default.getMode(n,{name:"javascript",json:!0});return{...i,indent(o,l){return o.indented+n.indentUnit*(o.lastType==="{"&&l.trim()[0]!=="}"||o.lastType==="("&&l.trim()[0]!==")"||o.lastType==="["&&l.trim()[0]!=="]")},token(o,l){let c=o.peek();if(c==="#"||c==="@")return i.token(new uf.default.StringStream("$",4,o.lineOr
|
||
|
|
`)===-1)return i+o;let f=o.split(/\n/),d=f[f.length-1].match(/^\s*/)?.[0].length||0,g=new RegExp("^\\s{0,"+d+"}");return i+f.map((m,y)=>y&&m.length?m.replace(g,e):m).join(`
|
||
|
|
`)}function GM(n,e,i){return typeof n=="function"?UM(n,e,i):n instanceof Date?`${i}new Date("${n.toISOString()}")`:i+String(n)}function ar(n,e,i=4){let o=[];return String(JSON.stringify(n,e||function(c,f){return typeof f=="string"&&pn(this[c])==="[object Date]"&&(f=this[c]),f!==null&&VM.has(pn(f))?(o.push(f),"{{{__placeholder__}}}"):f},i)).replace(/"((?:\\.|[^"])*)"(:?)/g,(c,f,d)=>d&&/^[a-z$_][a-z$_\d]*$/i.test(f)?f+d:`'${f.replace(/\\"/g,'"').replace(/'/g,"\\'")}'`+d).replace(/(^|\n)([ \t]*)(.*?)([a-zA-Z$_][a-zA-Z0-9$_]+:\s*)?'{{{__placeholder__}}}'/g,(c,f,d,g,m)=>f+d+g+GM(o.shift(),d,m))}var VM,es=z(()=>{st();wu();VM=new Set(["[object Function]","[object RegExp]","[object Date]"])});function bf(n,e){let i=globalThis.location,o=[],l=({newURL:c,oldURL:f})=>{let d=new URL(c).hash||"#",g=new URL(f).hash||"#";d!==o.shift()&&(e?.debug("locationSync onChange:",g,"->",d),o.length=0,n(d,g))};return addEventListener("hashchange",l),{set(c,f){let d=c||"#";(i.hash||"#")!==d&&(e?.debug("locationSync set:",d,f),o.push(c),f?i.replace(c):i.hash=c)},dispose(){removeEventListener("hashchange",l)}}}var xf=z(()=>{});function YM(n,e,i=0){let o=i!==0?n.slice(i).search(e):n.search(e);return o!==-1?{offset:i+o,length:RegExp.lastMatch.length}:null}function QM(n,e,i){let o=n.indexOf(e,i);return o!==-1?{offset:o,length:e.length}:null}function lr(n,e,i,o,l=!1){if(!Xo(e)&&typeof e!="string"){i(n,!0);return}let c=String(n);l&&(typeof e=="string"?(c=c.toLowerCase(),e=e.toLowerCase()):e.ignoreCase||(e=new RegExp(e,e.flags+"i")));let f=0,d=!1;do{let g=d?null:typeof e=="string"?QM(c,e,f):YM(c,e,f);if(g===null||g.length===0&&g.offset===f){i(f>0?n.slice(f):n,!0);break}g.length!==0&&(g.offset!==f&&i(n.slice(f,g.offset),!1),d=o(n.substr(g.offset,g.length),pw)===pw),f=g.offset+g.length}while(f!==n.length)}var pw,ts=z(()=>{Br();pw=Symbol("stop-match")});var kf=z(()=>{wf();Wo();cu();Jo();Yo();Oe();Ys();Qt();ea();Br();es();Fr();wi();xf();Rc();st();ts();au();ja();da();rf();Na()});var hw,gw=z(()=>{hw={demo:{view:"app-header",name:"My app",version:"1.2.3",description:"The best of the best app"},examples:[{title:"Variations",demo:["app-header",'app-header{ name: "Only name" }','app-header{ name: "Name and version", version: "1.2.3" }','app-header{ name: "Name and description", description: "Some description" }','app-header{ name: "Everything set", version: "1.2.3", description: "Very useful description" }']}]}});function mw(n){n.view.define("app-header",function(e,i){let{name:o,icon:l,version:c,description:f}=i,d=$("h1",null,c?[o,$("span","version",c)]:[o]);l&&e.style.setProperty("--icon",/^(?:\.|\/|data:|https?:)/.test(l)?`url(${JSON.stringify(l)})`:l),e.append($("div","icon"),$("div","content",f?[d,$("div","description",f)]:[d]))},{props:ZM,usage:hw})}var ZM,yw=z(()=>{kf();gw();ZM=`is not array? | {
|
||
|
|
name: name or "Untitled app",
|
||
|
|
icon,
|
||
|
|
version,
|
||
|
|
description
|
||
|
|
} | overrideProps() | {
|
||
|
|
...,
|
||
|
|
icon is string and $ ~= /\\S/?,
|
||
|
|
version is string and $ ~= /\\S/?,
|
||
|
|
description is string and $ ~= /\\S/?
|
||
|
|
}`});function vw(n){n.view.define("auto-link",function(e,i,o,l){let{content:c,fallback:f,href:d}=i;if(!o)return;let g=n.resolveValueLinks(o),y=g?(typeof d=="function"?d:k=>k)(g[0].href,o,l):null;return y?n.view.render(e,{view:"link",content:c},{...g[0],href:y},l):n.view.render(e,f||c||"text",o,l)},{tag:!1})}var ww=z(()=>{});var Cf,bw=z(()=>{Cf=(n,e)=>({demo:{view:n,text:"hello world"},examples:[{title:"Variations",demo:e.map(i=>`${i}:"${i}"`)},{title:"Displaying content",beforeDemo:{view:"md",source:["There are several ways to specify the main content of a badge:","- `content` option \u2013 allows to specify any renderable content and has the highest precedence","- `text` option \u2013 used when `content` is omitted or falsy; it renders as plain text","- When both `content` and `text` options are omitted, the `data` is used for content:"," - If `data` is a string, a number, or a boolean value, it is used as the `text` value"," - If `data` is an object, the value of `text` property of `data` coerced to a string is used"," - Otherwise, render an undefined"].join(`
|
||
|
|
`)},demo:[{view:n,data:'"data"',text:"text",content:'text:"RENDER"'},{view:n,data:'"data"',text:"RENDER",content:"=undefined"},{view:n,data:'"data"',content:"=undefined"},{view:n,data:'"data"',text:"RENDER"},{view:n,data:'"data"',text:"=undefined"},{view:n,data:'"RENDER"'},{view:n,data:'{ text: "RENDER" }'},{view:n,data:"{}"},{view:n,data:[1,2,3]}]},{title:"Using data as source of options",beforeDemo:{view:"md",source:["The following properties are taken from the data when the appropriate options are not specified for a legacy reasons (is subject to remove in the future):","- `color`","- `textColor`","- `darkColor`","- `darkTextColor`","- `text`","- `href`","- `external`","- `prefix`","- `postfix`"].join(`
|
||
|
|
`)},highlightProps:["data"],demo:{view:n,data:{text:"demo",href:"#example"}}},{title:"Custom colors",beforeDemo:{view:"md",source:["Data properties to setup a custom colors:","* `color` \u2013 default background color","* `textColor` \u2013 default text color","* `darkColor` \u2013 background color in dark mode","* `darkTextColor` \u2013 text color in dark mode"].join(`
|
||
|
|
`)},demo:{view:n,text:"Colored badge",color:"rgba(237, 177, 9, 0.35)",textColor:"orange",darkColor:"#ffff00",darkTextColor:"black"}},{title:"As a link",highlightProps:["href","external"],demo:{view:n,text:"Link to something",href:"#",external:!0}},{title:"Using onClick handler",highlightProps:["onClick"],demo:{view:n,text:'Show "Hello world"',onClick:Function('return () => alert("Hello world!")')()}},{title:"Prefix and postfix",highlightProps:["prefix","postfix"],demo:{view:n,prefix:"prefix",text:"link",postfix:"postfix"}},{title:"Complex content",highlightProps:["content"],demo:{view:n,content:['text:"text "','link{ href: "#example" }']}}]})});function kw(n,e,i){if(!i)return;let o=n.appendChild(document.createElement("span"));o.className=e,o.textContent=i}function Cw(n){function e(i,o,l,c){let{color:f,textColor:d,darkColor:g,darkTextColor:m,text:y,content:k,href:C,external:M,onClick:E,prefix:F,postfix:N}=o,A;return f&&i.style.setProperty("--discovery-view-badge-color",f),g&&i.style.setProperty("--discovery-view-badge-dark-color",g),d&&i.style.setProperty("--discovery-view-badge-text-color",d),m&&i.style.setProperty("--discovery-view-badge-dark-text-color",m),C&&(i.href=C),M&&i.setAttribute("target","_blank"),typeof E=="function"&&(i.classList.add("onclick"),i.addEventListener("click",b=>{b.preventDefault(),E(i,l,c)})),kw(i,"prefix",F),k?A=this.render(i,k,l,c):i.append(document.createTextNode(y)),kw(i,"postfix",N),A}n.view.define("badge",e,{tag:"a",props:xw,usage:Cf}),n.view.define("pill-badge",e,{tag:"a",props:xw,usage:Cf})}var xw,Dw=z(()=>{bw();xw=`is not array? | {
|
||
|
|
color,
|
||
|
|
textColor,
|
||
|
|
darkColor,
|
||
|
|
darkTextColor,
|
||
|
|
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
||
|
|
content: undefined,
|
||
|
|
href,
|
||
|
|
external,
|
||
|
|
onClick: undefined,
|
||
|
|
prefix,
|
||
|
|
postfix
|
||
|
|
} | overrideProps()`});var Aw,Sw=z(()=>{Aw=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF
|
||
|
|
`)},highlightProps:["data"],demo:{view:"link",data:{text:"demo",href:"#example"}}},{title:"Complex content",highlightProps:["content"],demo:{view:"link",href:"#example",content:['text:"text "','html:"<b>bold</b>"']}}]}});function Vw(n){n.view.define("link",function(e,i,o,l){let{text:c,content:f,href:d,external:g,onClick:m}=i;if(d&&(e.href=d),g&&e.setAttribute("target","_blank"),typeof m=="function"&&(e.classList.add("onclick"),e.addEventListener("click",y=>{y.preventDefault(),m(e,o,l)})),f)return n.view.render(e,f,o,l);e.textContent=c},{tag:"a",props:JM,usage:Uw})}var JM,Yw=z(()=>{Gw();JM=`is not array? | {
|
||
|
|
text: #.props.content is undefined ? is string ?: text,
|
||
|
|
content: undefined,
|
||
|
|
href,
|
||
|
|
external,
|
||
|
|
onClick: undefined
|
||
|
|
} | overrideProps() | {
|
||
|
|
$text; $href;
|
||
|
|
...,
|
||
|
|
text: $text | is not undefined or no $href ?: $href,
|
||
|
|
href: $href | is not undefined or no $text ?: $text
|
||
|
|
}`});function Mf(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function eb(n){jr=n}function Kt(n,e){if(e){if(tb.test(n))return n.replace(XM,Qw)}else if(nb.test(n))return n.replace(eL,Qw);return n}function We(n,e){let i=typeof n=="string"?n:n.source;e=e||"";let o={replace:(l,c)=>{let f=typeof c=="string"?c:c.source;return f=f.replace(nL,"$1"),i=i.replace(l,f),o},getRegex:()=>new RegExp(i,e)};return o}function Kw(n){try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}function Zw(n,e){let i=n.replace(/\|/g,(c,f,d)=>{let g=!1,m=f;for(;--m>=0&&d[m]==="\\";)g=!g;return g?"|":" |"}),o=i.split(/ \|/),l=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),e)if(o.length>e)o.splice(e);else for(;o.length<e;)o.push("");for(;l<o.length;l++)o[l]=o[l].trim().replace(/\\\|/g,"|");return o}function ns(n,e,i){let o=n.length;if(o===0)return"";let l=0;for(;l<o;){let c=n.charAt(o-l-1);if(c===e&&!i)l++;else if(c!==e&&i)l++;else break}return n.slice(0,o-l)}function rL(n,e){if(n.indexOf(e[1])===-1)return-1;let i=0;for(let o=0;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===e[0])i++;else if(n[o]===e[1]&&(i--,i<0))return o;return-1}function Jw(n,e,i,o){let l=e.href,c=e.title?Kt(e.title):null,f=n[1].replace(/\\([\[\]])/g,"$1");if(n[0].charAt(0)!=="!"){o.state.inLink=!0;let d={type:"link",raw:i,href:l,title:c,text:f,tokens:o.inlineTokens(f)};return o.state.inLink=!1,d}return{type:"image",raw:i,href:l,title:c,text:Kt(f)}}function iL(n,e){let i=n.match(/^(\s+)(?:```)/);if(i===null)return e;let o=i[1];return e.split(`
|
||
|
|
`).map(l=>{let c=l.match(/^\s+/);if(c===null)return l;let[f]=c;return f.length>=o.length?l.slice(o.length):l}).join(`
|
||
|
|
`)}function _e(n,e){return Pr.parse(n,e)}var jr,tb,XM,nb,eL,tL,Qw,nL,is,Fi,oL,sL,aL,as,lL,rb,ib,Lf,uL,Tf,cL,fL,Ga,Ff,dL,ob,pL,Nf,Xw,hL,gL,sb,mL,ab,yL,ls,vL,wL,bL,xL,kL,CL,DL,AL,SL,Ua,EL,lb,ub,ML,Of,LL,Ef,TL,$a,rs,yn,ur,os,vn,Ti,ss,Pr,SP,EP,MP,LP,TP,FP,NP,Bf=z(()=>{jr=Mf();tb=/[&<>"']/,XM=new RegExp(tb.source,"g"),nb=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,eL=new RegExp(nb.source,"g"),tL={"&":"&","<":"<",">":">",'"':""","'":"'"},Qw=n=>tL[n];nL=/(^|[^\[])\^/g;is={exec:()=>null};Fi=class{options;rules;lexer;constructor(e){this.options=e||jr}space(e){let i=this.rules.block.newline.exec(e);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(e){let i=this.rules.block.code.exec(e);if(i){let o=i[0].replace(/^(?: {1,4}| {0,3}\t)/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?o:ns(o,`
|
||
|
|
`)}}}fences(e){let i=this.rules.block.fences.exec(e);if(i){let o=i[0],l=iL(o,i[3]||"");return{type:"code",raw:o,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:l}}}heading(e){let i=this.rules.block.heading.exec(e);if(i){let o=i[2].trim();if(/#$/.test(o)){let l=ns(o,"#");(this.options.pedantic||!l||/ $/.test(l))&&(o=l.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(e){let i=this.rules.block.hr.exec(e);if(i)return{type:"hr",raw:ns(i[0],`
|
||
|
|
`)}}blockquote(e){let i=this.rules.block.blockquote.exec(e);if(i){let o=ns(i[0],`
|
||
|
|
`).split(`
|
||
|
|
`),l="",c="",f=[];for(;o.length>0;){let d=!1,g=[],m;for(m=0;m<o.length;m++)if(/^ {0,3}>/.test(o[m]))g.push(o[m]),d=!0;else if(!d)g.push(o[m]);else break;o=o.slice(m);let y=g.join(`
|
||
|
|
`),k=y.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
||
|
|
$1`).replace(/^ {0,3}>[ \t]?/gm,"");l=l?`${l}
|
||
|
|
${y}`:y,c=c?`${c}
|
||
|
|
${k}`:k;let C=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(k,f,!0),this.lexer.state.top=C,o.length===0)break;let M=f[f.length-1];if(M?.type==="code")break;if(M?.type==="blockquote"){let E=M,F=E.raw+`
|
||
|
|
`+o.join(`
|
||
|
|
`),N=this.blockquote(F);f[f.length-1]=N,l=l.substring(0,l.length-E.raw.length)+N.raw,c=c.substring(0,c.length-E.text.length)+N.text;break}else if(M?.type==="list"){let E=M,F=E.raw+`
|
||
|
|
`+o.join(`
|
||
|
|
`),N=this.list(F);f[f.length-1]=N,l=l.substring(0,l.length-M.raw.length)+N.raw,c=c.substring(0,c.length-E.raw.length)+N.raw,o=F.substring(f[f.length-1].raw.length).split(`
|
||
|
|
`);continue}}return{type:"blockquote",raw:l,tokens:f,text:c}}}list(e){let i=this.rules.block.list.exec(e);if(i){let o=i[1].trim(),l=o.length>1,c={type:"list",raw:"",ordered:l,start:l?+o.slice(0,-1):"",loose:!1,items:[]};o=l?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=l?o:"[*+-]");let f=new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),d=!1;for(;e;){let g=!1,m="",y="";if(!(i=f.exec(e))||this.rules.block.hr.test(e))break;m=i[0],e=e.substring(m.length);let k=i[2].split(`
|
||
|
|
`,1)[0].replace(/^\t+/,A=>" ".repeat(3*A.length)),C=e.split(`
|
||
|
|
`,1)[0],M=!k.trim(),E=0;if(this.options.pedantic?(E=2,y=k.trimStart()):M?E=i[1].length+1:(E=i[2].search(/[^ ]/),E=E>4?1:E,y=k.slice(E),E+=i[1].length),M&&/^[ \t]*$/.test(C)&&(m+=C+`
|
||
|
|
`,e=e.substring(C.length+1),g=!0),!g){let A=new RegExp(`^ {0,${Math.min(3,E-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),b=new RegExp(`^ {0,${Math.min(3,E-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),L=new RegExp(`^ {0,${Math.min(3,E-1)}}(?:\`\`\`|~~~)`),T=new RegExp(`^ {0,${Math.min(3,E-1)}}#`),B=new RegExp(`^ {0,${Math.min(3,E-1)}}<(?:[a-z].*>|!--)`,"i");for(;e;){let I=e.split(`
|
||
|
|
`,1)[0],R;if(C=I,this.options.pedantic?(C=C.replace(/^ {1,4}(?=( {4})*[^ ])/g," "),R=C):R=C.replace(/\t/g," "),L.test(C)||T.test(C)||B.test(C)||A.test(C)||b.test(C))break;if(R.search(/[^ ]/)>=E||!C.trim())y+=`
|
||
|
|
`+R.slice(E);else{if(M||k.replace(/\t/g," ").search(/[^ ]/)>=4||L.test(k)||T.test(k)||b.test(k))break;y+=`
|
||
|
|
`+C}!M&&!C.trim()&&(M=!0),m+=I+`
|
||
|
|
`,e=e.substring(I.length+1),k=R.slice(E)}}c.loose||(d?c.loose=!0:/\n[ \t]*\n[ \t]*$/.test(m)&&(d=!0));let F=null,N;this.options.gfm&&(F=/^\[[ xX]\] /.exec(y),F&&(N=F[0]!=="[ ] ",y=y.replace(/^\[[ xX]\] +/,""))),c.items.push({type:"list_item",raw:m,task:!!F,checked:N,loose:!1,text:y,tokens:[]}),c.raw+=m}c.items[c.items.length-1].raw=c.items[c.items.length-1].raw.trimEnd(),c.items[c.items.length-1].text=c.items[c.items.length-1].text.trimEnd(),c.raw=c.raw.trimEnd();for(let g=0;g<c.items.length;g++)if(this.lexer.state.top=!1,c.items[g].tokens=this.lexer.blockTokens(c.items[g].text,[]),!c.loose){let m=c.items[g].tokens.filter(k=>k.type==="space"),y=m.length>0&&m.some(k=>/\n.*\n/.test(k.raw));c.loose=y}if(c.loose)for(let g=0;g<c.items.length;g++)c.items[g].loose=!0;return c}}html(e){let i=this.rules.block.html.exec(e);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(e){let i=this.rules.block.def.exec(e);if(i){let o=i[1].toLowerCase().replace(/\s+/g," "),l=i[2]?i[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",c=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:o,raw:i[0],href:l,title:c}}}table(e){let i=this.rules.block.table.exec(e);if(!i||!/[:|]/.test(i[2]))return;let o=Zw(i[1]),l=i[2].replace(/^\||\| *$/g,"").split("|"),c=i[3]&&i[3].trim()?i[3].replace(/\n[ \t]*$/,"").split(`
|
||
|
|
`):[],f={type:"table",raw:i[0],header:[],align:[],rows:[]};if(o.length===l.length){for(let d of l)/^ *-+: *$/.test(d)?f.align.push("right"):/^ *:-+: *$/.test(d)?f.align.push("center"):/^ *:-+ *$/.test(d)?f.align.push("left"):f.align.push(null);for(let d=0;d<o.length;d++)f.header.push({text:o[d],tokens:this.lexer.inline(o[d]),header:!0,align:f.align[d]});for(let d of c)f.rows.push(Zw(d,f.header.length).map((g,m)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:f.align[m]})));return f}}lheading(e){let i=this.rules.block.lheading.exec(e);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(e){let i=this.rules.block.paragraph.exec(e);if(i){let o=i[1].charAt(i[1].length-1)===`
|
||
|
|
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:o,tokens:this.lexer.inline(o)}}}text(e){let i=this.rules.block.text.exec(e);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(e){let i=this.rules.inline.escape.exec(e);if(i)return{type:"escape",raw:i[0],text:Kt(i[1])}}tag(e){let i=this.rules.inline.tag.exec(e);if(i)return!this.lexer.state.inLink&&/^<a /i.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(e){let i=this.rules.inline.link.exec(e);if(i){let o=i[2].trim();if(!this.options.pedantic&&/^</.test(o)){if(!/>$/.test(o))return;let f=ns(o.slice(0,-1),"\\");if((o.length-f.length)%2===0)return}else{let f=rL(i[2],"()");if(f>-1){let g=(i[0].indexOf("!")===0?5:4)+i[1].length+f;i[2]=i[2].substring(0,f),i[0]=i[0].substring(0,g).trim(),i[3]=""}}let l=i[2],c="";if(this.options.pedantic){let f=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(l);f&&(l=f[1],c=f[3])}else c=i[3]?i[3].slice(1,-1):"";return l=l.trim(),/^</.test(l)&&(this.options.pedantic&&!/>$/.test(o)?l=l.slice(1):l=l.slice(1,-1)),Jw(i,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:c&&c.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer)}}reflink(e,i){let o;if((o=this.rules.inline.reflink.exec(e))||(o=this.rules.inline.nolink.exec(e))){let l=(o[2]||o[1]).replace(/\s+/g," "),c=i[l.toLowerCase()];if(!c){let f=o[0].charAt(0);return{type:"text",raw:f,text:f}}return Jw(o,c,o[0],this.lexer)}}emStrong(e,i,o=""){let l=this.rules.inline.emStrongLDelim.exec(e);if(!l||l[3]&&o.match(/[\p{L}\p{N}]/u))return;if(!(l[1]||l[2]||"")||!o||this.rules.inline.punctuation.exec(o)){let f=[...l[0]].length-1,d,g,m=f,y=0,k=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(k.lastIndex=0,i=i.slice(-1*e.length+f);(l=k.exec(i))!=null;){if(d=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!d)continue;if(g=[...d].length,l[3]||l[4]){m+=g;continue}else if((l[5]||l[6])&&f%3&&!((f+g)%3)){y+=g;continue}if(m-=g,m>0)continue;g=Math.min(g,g+m+y);let C=[...l[0]][0].length,M=e.slice(0,f+l.index+C+g);if(Math.min(f,g)%2){let F=M.slice(1,-1);return{type:"em",raw:M,text:F,tokens:this.lexer.inlineTokens(F)}}let E=M.slice(2,-2);return{type:"strong",raw:M,text:E,tokens:this.lexer.inlineTokens(E)}}}}codespan(e){let i=this.rules.inline.code.exec(e);if(i){let o=i[2].replace(/\n/g," "),l=/[^ ]/.test(o),c=/^ /.test(o)&&/ $/.test(o);return l&&c&&(o=o.substring(1,o.length-1)),o=Kt(o,!0),{type:"codespan",raw:i[0],text:o}}}br(e){let i=this.rules.inline.br.exec(e);if(i)return{type:"br",raw:i[0]}}del(e){let i=this.rules.inline.del.exec(e);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(e){let i=this.rules.inline.autolink.exec(e);if(i){let o,l;return i[2]==="@"?(o=Kt(i[1]),l="mailto:"+o):(o=Kt(i[1]),l=o),{type:"link",raw:i[0],text:o,href:l,tokens:[{type:"text",raw:o,text:o}]}}}url(e){let i;if(i=this.rules.inline.url.exec(e)){let o,l;if(i[2]==="@")o=Kt(i[0]),l="mailto:"+o;else{let c;do c=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(c!==i[0]);o=Kt(i[0]),i[1]==="www."?l="http://"+i[0]:l=i[0]}return{type:"link",raw:i[0],text:o,href:l,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(e){let i=this.rules.inline.text.exec(e);if(i){let o;return this.lexer.state.inRawBlock?o=i[0]:o=Kt(i[0]),{type:"text",raw:i[0],text:o}}}},oL=/^(?:[ \t]*(?:\n|$))+/,sL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,aL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,as=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,rb=/(?:[*+-]|\d{1,9}[.)])/,ib=We(/^(?!bull |blockCode|fences|blockquote|hea
|
||
|
|
]`).replace("lheading",ib).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sb=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,mL=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ab=/^( {2,}|\\)\n(?!\s*$)/,yL=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ls="\\p{P}\\p{S}",vL=We(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,ls).getRegex(),wL=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,bL=We(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ls).getRegex(),xL=We("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ls).getRegex(),kL=We("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ls).getRegex(),CL=We(/\\([punct])/,"gu").replace(/punct/g,ls).getRegex(),DL=We(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),AL=We(Ff).replace("(?:-->|$)","-->").getRegex(),SL=We("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",AL).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ua=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,EL=We(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ua).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lb=We(/^!?\[(label)\]\[(ref)\]/).replace("label",Ua).replace("ref",Tf).getRegex(),ub=We(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tf).getRegex(),ML=We("reflink|nolink(?!\\()","g").replace("reflink",lb).replace("nolink",ub).getRegex(),Of={_backpedal:is,anyPunctuation:CL,autolink:DL,blockSkip:wL,br:ab,code:mL,del:is,emStrongLDelim:bL,emStrongRDelimAst:xL,emStrongRDelimUnd:kL,escape:sb,link:EL,nolink:ub,punctuation:vL,reflink:lb,reflinkSearch:ML,tag:SL,text:yL,url:is},LL={...Of,link:We(/^!?\[(label)\]\((.*?)\)/).replace("label",Ua).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ua).getRegex()},Ef={...Of,escape:We(sb).replace("])","~|])").getRegex(),url:We(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},TL={...Ef,br:We(ab).replace("{2,}","*").getRegex(),text:We(Ef.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$a={normal:Nf,gfm:hL,pedantic:gL},rs={normal:Of,gfm:Ef,breaks:TL,pedantic:LL},yn=class n{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||jr,this.options.tokenizer=this.options.tokenizer||new Fi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={block:$a.normal,inline:rs.normal};this.options.pedantic?(i.block=$a.pedantic,i.inline=rs.pedantic):this.o
|
||
|
|
`),this.blockTokens(e,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let o=this.inlineQueue[i];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,i=[],o=!1){this.options.pedantic&&(e=e.replace(/\t/g," ").replace(/^ +$/gm,""));let l,c,f;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(d=>(l=d.call({lexer:this},e,i))?(e=e.substring(l.raw.length),i.push(l),!0):!1))){if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length),l.raw.length===1&&i.length>0?i[i.length-1].raw+=`
|
||
|
|
`:i.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length),c=i[i.length-1],c&&(c.type==="paragraph"||c.type==="text")?(c.raw+=`
|
||
|
|
`+l.raw,c.text+=`
|
||
|
|
`+l.text,this.inlineQueue[this.inlineQueue.length-1].src=c.text):i.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length),c=i[i.length-1],c&&(c.type==="paragraph"||c.type==="text")?(c.raw+=`
|
||
|
|
`+l.raw,c.text+=`
|
||
|
|
`+l.raw,this.inlineQueue[this.inlineQueue.length-1].src=c.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),i.push(l);continue}if(f=e,this.options.extensions&&this.options.extensions.startBlock){let d=1/0,g=e.slice(1),m;this.options.extensions.startBlock.forEach(y=>{m=y.call({lexer:this},g),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(f=e.substring(0,d+1))}if(this.state.top&&(l=this.tokenizer.paragraph(f))){c=i[i.length-1],o&&c?.type==="paragraph"?(c.raw+=`
|
||
|
|
`+l.raw,c.text+=`
|
||
|
|
`+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=c.text):i.push(l),o=f.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length),c=i[i.length-1],c&&c.type==="text"?(c.raw+=`
|
||
|
|
`+l.raw,c.text+=`
|
||
|
|
`+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=c.text):i.push(l);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,i}inline(e,i=[]){return this.inlineQueue.push({src:e,tokens:i}),i}inlineTokens(e,i=[]){let o,l,c,f=e,d,g,m;if(this.tokens.links){let y=Object.keys(this.tokens.links);if(y.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(f))!=null;)y.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(f=f.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+f.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.blockSkip.exec(f))!=null;)f=f.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+f.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(f))!=null;)f=f.slice(0,d.index)+"++"+f.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(g||(m=""),g=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(y=>(o=y.call({lexer:this},e,i))?(e=e.substring(o.raw.length),i.push(o),!0):!1))){if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),l=i[i.length-1],l&&o.type==="text"&&l.type==="text"?(l.raw+=o.raw,l.text+=o.text):i.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length),l=i[i.length-1],l&&o.type==="text"&&l.type==="text"?(l.raw+=o.raw,l.text+=o.text):i.push(o);continue}if(o=this.tokenizer.emStrong(e,f,m)){e=e.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),i.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),i.push(o);continue}if(c=e,this.options.extensions&&this.options.extensions.startInline){let y=1/0,k=e.slice(1),C;this.options.extensions.startInline.forEach(M=>{C=M.call({lexer:this},k),typeof C=="number"&&C>=0&&(y=Math.min(y,C))}),y<1/0&&y>=0&&(c=e.substring(0,y+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(m=o.raw.slice(-1)),g=!0,l=i[i.length-1],l&&l.type==="text"?(l.raw+=o.raw,l.text+=o.text):i.push(o);continue}if(e){let y="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return i}},ur=class{options;parser;constructor(e){this.options=e||jr}space(e){return""}code({text:e,lang:i,escaped:o}){let l=(i||"").match(/^\S*/)?.[0],c=e.replace(/\n$/,"")+`
|
||
|
|
`;return l?'<pre><code class="language-'+Kt(l)+'">'+(o?c:Kt(c,!0))+`</code></pre>
|
||
|
|
`:"<pre><code>"+(o?c:Kt(c,!0))+`</code></pre>
|
||
|
|
`}blockquote({tokens:e}){return`<blockquote>
|
||
|
|
${this.parser.parse(e)}</blockquote>
|
||
|
|
`}html({text:e}){return e}heading({tokens:e,depth:i}){return`<h${i}>${this.parser.parseInline(e)}</h${i}>
|
||
|
|
`}hr(e){return`<hr>
|
||
|
|
`}list(e){let i=e.ordered,o=e.start,l="";for(let d=0;d<e.items.length;d++){let g=e.items[d];l+=this.listitem(g)}let c=i?"ol":"ul",f=i&&o!==1?' start="'+o+'"':"";return"<"+c+f+`>
|
||
|
|
`+l+"</"+c+`>
|
||
|
|
`}listitem(e){let i="";if(e.task){let o=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=o+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=o+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:o+" ",text:o+" "}):i+=o+" "}return i+=this.parser.parse(e.tokens,!!e.loose),`<li>${i}</li>
|
||
|
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
||
|
|
`}table(e){let i="",o="";for(let c=0;c<e.header.length;c++)o+=this.tablecell(e.header[c]);i+=this.tablerow({text:o});let l="";for(let c=0;c<e.rows.length;c++){let f=e.rows[c];o="";for(let d=0;d<f.length;d++)o+=this.tablecell(f[d]);l+=this.tablerow({text:o})}return l&&(l=`<tbody>${l}</tbody>`),`<table>
|
||
|
|
<thead>
|
||
|
|
`+i+`</thead>
|
||
|
|
`+l+`</table>
|
||
|
|
`}tablerow({text:e}){return`<tr>
|
||
|
|
${e}</tr>
|
||
|
|
`}tablecell(e){let i=this.parser.parseInline(e.tokens),o=e.header?"th":"td";return(e.align?`<${o} align="${e.align}">`:`<${o}>`)+i+`</${o}>
|
||
|
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:i,tokens:o}){let l=this.parser.parseInline(o),c=Kw(e);if(c===null)return l;e=c;let f='<a href="'+e+'"';return i&&(f+=' title="'+i+'"'),f+=">"+l+"</a>",f}image({href:e,title:i,text:o}){let l=Kw(e);if(l===null)return o;e=l;let c=`<img src="${e}" alt="${o}"`;return i&&(c+=` title="${i}"`),c+=">",c}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}},os=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},vn=class n{options;renderer;textRenderer;constructor(e){this.options=e||jr,this.options.renderer=this.options.renderer||new ur,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new os}static parse(e,i){return new n(i).parse(e)}static parseInline(e,i){return new n(i).parseInline(e)}parse(e,i=!0){let o="";for(let l=0;l<e.length;l++){let c=e[l];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[c.type]){let d=c,g=this.options.extensions.renderers[d.type].call({parser:this},d);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)){o+=g||"";continue}}let f=c;switch(f.type){case"space":{o+=this.renderer.space(f);continue}case"hr":{o+=this.renderer.hr(f);continue}case"heading":{o+=this.renderer.heading(f);continue}case"code":{o+=this.renderer.code(f);continue}case"table":{o+=this.renderer.table(f);continue}case"blockquote":{o+=this.renderer.blockquote(f);continue}case"list":{o+=this.renderer.list(f);continue}case"html":{o+=this.renderer.html(f);continue}case"paragraph":{o+=this.renderer.paragraph(f);continue}case"text":{let d=f,g=this.renderer.text(d);for(;l+1<e.length&&e[l+1].type==="text";)d=e[++l],g+=`
|
||
|
|
`+this.renderer.text(d);i?o+=this.renderer.paragraph({type:"paragraph",raw:g,text:g,tokens:[{type:"text",raw:g,text:g}]}):o+=g;continue}default:{let d='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return o}parseInline(e,i){i=i||this.renderer;let o="";for(let l=0;l<e.length;l++){let c=e[l];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[c.type]){let d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){o+=d||"";continue}}let f=c;switch(f.type){case"escape":{o+=i.text(f);break}case"html":{o+=i.html(f);break}case"link":{o+=i.link(f);break}case"image":{o+=i.image(f);break}case"strong":{o+=i.strong(f);break}case"em":{o+=i.em(f);break}case"codespan":{o+=i.codespan(f);break}case"br":{o+=i.br(f);break}case"del":{o+=i.del(f);break}case"text":{o+=i.text(f);break}default:{let d='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return o}},Ti=class{options;block;constructor(e){this.options=e||jr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?yn.lex:yn.lexInline}provideParser(){return this.block?vn.parse:vn.parseInline}},ss=class{defaults=Mf();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=vn;Renderer=ur;TextRenderer=os;Lexer=yn;Tokenizer=Fi;Hooks=Ti;constructor(...e){this.use(...e)}walkTokens(e,i){let o=[];for(let l of e)switch(o=o.concat(i.call(this,l)),l.type){case"table":{let c=l;for(let f of c.header)o=o.concat(this.walkTokens(f.tokens,i));for(let f of c.rows)for(let d of f)o=o.concat(this.walkTokens(d.tokens,i));break}case"list":{let c=l;o=o.concat(this.walkTokens(c.items,i));break}default:{let c=l;this.defaults.extensions?.childTokens?.[c.type]?this.defaults.extensions.childTokens[c.type].forEach(f=>{let d=c[f].flat(1/0);o=o.concat(this.walkTokens(d,i))}):c.tokens&&(o=o.concat(this.walkTokens(c.tokens,i)))}}return o}use(...e){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(o=>{let l={...o};if(l.async=this.defaults.async||l.async||!1,o.extensions&&(o.extensions.forEach(c=>{if(!c.name)throw new Error("extension name required");if("renderer"in c){let f=i.renderers[c.name];f?i.renderers[c.name]=function(...d){let g=c.renderer.apply(this,d);return g===!1&&(g=f.apply(this,d)),g}:i.renderers[c.name]=c.renderer}if("tokenizer"in c){if(!c.level||c.level!=="block"&&c.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let f=i[c.level];f?f.unshift(c.tokenizer):i[c.level]=[c.tokenizer],c.start&&(c.level==="block"?i.startBlock?i.startBlock.push(c.start):i.startBlock=[c.start]:c.level==="inline"&&(i.startInline?i.startInline.push(c.start):i.startInline=[c.start]))}"childTokens"in c&&c.childTokens&&(i.childTokens[c.name]=c.childTokens)}),l.extensions=i),o.renderer){let c=this.defaults.renderer||new ur(this.defaults);for(let f in o.renderer){if(!(f in c))throw new Error(`renderer '${f}' does not exist`);if(["options","parser"].includes(f))continue;let d=f,g=o.renderer[d],m=c[d];c[d]=(...y)=>{let k=g.apply(c,y);return k===!1&&(k=m.apply(c,y)),k||""}}l.renderer=c}if(o.tokenizer){let c=this.defaults.tokenizer||new Fi(this.defaults);for(let f in o.tokenizer){if(!(f in c))throw new Error(`tokenizer '${f}' does not exist`);if(["options","rules","lexer"].includes(f))continue;let d=f,g=o.tokenizer[d],m=c[d];c[d]=(...y)=>{let k=g.apply(c,y);return k===!1&&(k=m.apply(c,y)),k}}l.tokenizer=c}if(o.hooks){let c=this.defaults.hooks||new Ti;for(let f in o.hooks){if(!(f in c))throw new Error(`hook '${f}' does not exist`);if(["options","block"].includes(f))continue;let d=f,g=o.hooks[d],m=c[d];Ti.passThroughHooks.has(f)?c[d]=y=>{if(this.defaults.async)return Promise.resolve(g.call(c,y)).then(C=>m.call(c,C));let k=g.ca
|
||
|
|
Please report this to https://github.com/markedjs/marked.`,e){let l="<p>An error occurred:</p><pre>"+Kt(o.message+"",!0)+"</pre>";return i?Promise.resolve(l):l}if(i)return Promise.reject(o);throw o}}},Pr=new ss;_e.options=_e.setOptions=function(n){return Pr.setOptions(n),_e.defaults=Pr.defaults,eb(_e.defaults),_e};_e.getDefaults=Mf;_e.defaults=jr;_e.use=function(...n){return Pr.use(...n),_e.defaults=Pr.defaults,eb(_e.defaults),_e};_e.walkTokens=function(n,e){return Pr.walkTokens(n,e)};_e.parseInline=Pr.parseInline;_e.Parser=vn;_e.parser=vn.parse;_e.Renderer=ur;_e.TextRenderer=os;_e.Lexer=yn;_e.lexer=yn.lex;_e.Tokenizer=Fi;_e.Hooks=Ti;_e.parse=_e;SP=_e.options,EP=_e.setOptions,MP=_e.use,LP=_e.walkTokens,TP=_e.parseInline,FP=vn.parse,NP=yn.lex});var Va,cb=z(()=>{Bf();Df();Qt();Va=class extends ur{heading({tokens:e,depth:i,text:o}){let{discoveryjs:{host:l,useAnchors:c}}=this.options,f=Wa(o.replace(/<!--.*?-->/g,"")),d="";if(c){let g=l.encodePageHash(l.pageId,l.pageRef,l.pageParams,f);d=`<a class="view-header__anchor" id="!anchor:${Xe(f)}" href="${g}"></a>`}return`<h${i} class="view-header view-h${i}" data-slug="${f}">${d}${this.parser.parseInline(e)}</h${i}>
|
||
|
|
`}code({text:e,lang:i}){let{discoveryjs:{codes:o}}=this.options;return`<code class="discoveryjs-code" data-id="${o.push({syntax:i,source:e})-1}"></code>`}link({tokens:e,href:i,title:o}){let l=this.parser.parseInline(e);if(i===null)return l;let c='<a class="view-link md-rendered-link" href="'+Xe(i)+'"';return o&&(c+=' title="'+Xe(o)+'"'),c+=">"+l+"</a>",c}checkbox({checked:e}){return'<label class="view-checkbox"><input type="checkbox" disabled'+(e?" checked":"")+"/></label> "}list({items:e,ordered:i,start:o}){let l=i?"ol":"ul",c=i&&o!==1?` start="${o}"`:"";return`<${l} class="view-${l}"${c}>
|
||
|
|
`+e.map(this.listitem,this).join(`
|
||
|
|
`)+`
|
||
|
|
</${l}>
|
||
|
|
`}listitem(e){let i="";if(e.task){let o=this.checkbox({checked:!!e.checked});if(e.loose){let l=e.tokens[0];l?.type==="paragraph"?(l.text=o+l.text,Array.isArray(l.tokens)&&l.tokens[0]?.type==="text"&&(l.tokens[0].text=o+l.tokens[0].text)):e.tokens.unshift({type:"text",raw:o,text:o})}else i+=o}return`<li class="view-list-item${e.task?" check-list-item":""}">${i}${this.parser.parse(e.tokens,!!e.loose)}</li>
|
||
|
|
`}table({header:e,rows:i}){let o=i.map(l=>'<tr class="view-table-row">'+l.map(this.tablecell,this).join("")+"</tr>").join(`
|
||
|
|
`);return`<table class="view-table">
|
||
|
|
<thead>
|
||
|
|
`+e.map(this.tablecell,this).join("")+`
|
||
|
|
</thead>
|
||
|
|
`+(o?`<tbody>
|
||
|
|
`+o+`
|
||
|
|
</tbody>
|
||
|
|
`:"")+`</table>
|
||
|
|
`}tablecell({tokens:e,header:i,align:o}){let l=i?"th":"td";return`<${l} class="${i?"view-table-header-cell":"view-table-cell"}"${o?` align="${o}"`:""}>`+this.parser.parseInline(e)+`</${l}>
|
||
|
|
`}}});var If,fb=z(()=>{If={demo:{view:"markdown",source:`# Markdown example
|
||
|
|
|
||
|
|
> NOTE: The \`markdown\` view is based on [marked](https://github.com/markedjs/marked) package
|
||
|
|
|
||
|
|
Markdown is good because:
|
||
|
|
* You'll get **formatted** *text* with _no tags_
|
||
|
|
* It's much simpler than \`HTML\`
|
||
|
|
|
||
|
|
\`\`\`html
|
||
|
|
<b>bold</b><i>italic</i>
|
||
|
|
\`\`\`
|
||
|
|
[Read more](https://guides.github.com/features/mastering-markdown/)`},examples:[{title:"Inline config",demo:'markdown{ source: "**Hello** `world`!" }'},{title:"Shorthand syntax",beforeDemo:['md:"You can use `md` as an alias for `markdown` with a string as data. That\'s a **shortest** definition for a marked text"'],demo:'md:"**Hello** `world`!"'},{title:"Array of strings as a source",beforeDemo:['md:"Array of strings might be passed as a value for `source` property which is useful for a long sources\\n> NOTE: This doesn\'t work a source passed via data"'],demo:{view:"markdown",source:["Array","of","`strings`"]}},{title:"Interpolation",beforeDemo:['md:"Interpolation can be used almost anywhere in a markdown to embed the result of a jora query into resulting HTML. Just place a jora query between `{{`{{`}}` and `{{`}`+`}`}}`:"'],demo:{view:"md",source:["Simple evaluation: 2 + 2 = `{{ 2 + 2 }}`","","Markdown view has {{ #.options.usage.examples.size() }} examples"]}},{title:"Disable anchors for headers",highlightProps:["anchors"],beforeDemo:"Hover a header to see a chain icon on the left side of header when anchors are enabled:",demo:[{view:"markdown",source:"## header with default settings"},{view:"markdown",anchors:!1,source:"## header with disabled anchor"}]},{title:"Sections prelude and postlude",highlightProps:["sectionPrelude","sectionPostlude"],demo:{view:"markdown",sectionPrelude:"struct:#.section",sectionPostlude:{view:"link",href:"#top",text:"Scroll to top \u2191"},source:`Section without a header
|
||
|
|
|
||
|
|
## Header level 2
|
||
|
|
|
||
|
|
Section 1
|
||
|
|
|
||
|
|
### Header level 3
|
||
|
|
|
||
|
|
Section 2
|
||
|
|
|
||
|
|
## Header level 2
|
||
|
|
|
||
|
|
Section 3`}},{title:"Configuration for code blocks",highlightProps:["codeConfig"],beforeDemo:['md:"Use `codeConfig` to specify any settings for code blocks available for `source` view."'],demo:{view:"markdown",codeConfig:{prelude:{view:"block",content:["badge:syntax",'text:"Length: " + content.size()']},postlude:"struct:#.section",actionButtons:[{view:"button",text:'Say "Hello world"',onClick:Function('return () => alert("Hello world!")')()}]},source:`# Header 1
|
||
|
|
|
||
|
|
\`\`\`js
|
||
|
|
console.log("Hello world")
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
## Header 2
|
||
|
|
|
||
|
|
text
|
||
|
|
|
||
|
|
## Header 3
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
\`\`\`jora
|
||
|
|
foo.bar.baz
|
||
|
|
\`\`\``}},{title:"Showcase",demo:{view:"markdown",source:`
|
||
|
|
# Header
|
||
|
|
## Header
|
||
|
|
### Header
|
||
|
|
#### Header
|
||
|
|
##### Header
|
||
|
|
* One
|
||
|
|
* Two
|
||
|
|
* Three
|
||
|
|
|
||
|
|
4. Four
|
||
|
|
5. Five
|
||
|
|
6. Six
|
||
|
|
- [{{ true }}] Task 1
|
||
|
|
- [x] Task 2
|
||
|
|
|
||
|
|
Interpolation in text: 2 + 2 = \`{{ 2 + 2 }}\`, or in attribute: [link](#dummy-link/{{"exam" + "ple"}} "{{ "example" + " title" }}")
|
||
|
|
|
||
|
|
Paragraph **bold** __bold__ *italic* _italic_ ~line-through~ \`code\` [link](#href)
|
||
|
|
|
||
|
|
>Blockquote
|
||
|
|
> > Line 2
|
||
|
|
|
||
|
|
\`\`\`js
|
||
|
|
var some = "code";
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
foo | bar
|
||
|
|
----|-----
|
||
|
|
1 | A
|
||
|
|
2 | C
|
||
|
|
3 | E
|
||
|
|
`.trim().split(/\n/)}}]}});function db(n,e){let{nodeValue:i}=n,o=i.replace(/{{(\d+)}}/gs,(l,c)=>e[c]);o!==i&&(n.nodeValue=o)}function hb(n,e){for(let i of n.childNodes)switch(i.nodeType){case document.ELEMENT_NODE:if(!i.classList.contains("view-source")){hb(i,e);for(let o of i.attributes)db(o,e)}break;case document.TEXT_NODE:db(i,e);break}}function FL(n){let e=new Map,i={after:n.prepend.bind(n)},o={next:null,data:{sectionIdx:0,slug:null,text:null,href:null}};e.set(i,o);for(let l of[...n.querySelectorAll(":scope > :is(h1, h2, h3, h4, h5, h6)")]){l===n.firstElementChild&&(e.delete(i),i=l,o=null);let c=l.querySelector(':scope > a[id^="!anchor:"]'),f={next:null,data:{sectionIdx:e.size,slug:l.dataset.slug,text:l.textContent.trim(),href:c?.hash}};e.set(l,f),o&&(o.next=l),o=f}return{sectionByHeaderEl:e,findSectionByEl(l){let c=e.get(i);for(;l!==null&&l!==n;){if(e.has(l)){c=e.get(l);break}l=l.previousSibling||l.parentNode}return c?.data||null}}}function gb(n){let e=new ss().setOptions({smartLists:!0,renderer:new Va});function i(o,l,c,f){let d=new Map,g=[],m=[],{anchors:y=!0,sectionPrelude:k,sectionPostlude:C}=l,{source:M,codeConfig:E}=l;if(Array.isArray(M)&&(M=M.join(`
|
||
|
|
`)),M=M.replace(/{{(.+?)}}/gs,(A,b)=>(b=b.trim(),d.has(b)||d.set(b,d.size),`{{${d.get(b)}}}`)),o.classList.add("view-markdown"),o.innerHTML=e.parse(M,{discoveryjs:{host:n,useAnchors:y,codes:g}}),d.size>0){let A=new Array(d.size);for(let[b,L]of d.entries())try{A[L]=n.query(b,c,f)}catch(T){n.logger.error("Interpolation query error in markdown:",T.message)}hb(o,A)}for(let A of o.querySelectorAll(".md-rendered-link"))A.getAttribute("href").startsWith("#")||A.setAttribute("target","_blank");let{sectionByHeaderEl:F,findSectionByEl:N}=g.length||k||C?FL(o):{sectionByHeaderEl:new Map,findSectionByEl:()=>null};{E=typeof E=="object"?{view:"source",...E}:E||"source";for(let A of[...o.querySelectorAll(".discoveryjs-code")]){let b=N(A),L=document.createDocumentFragment(),T=A.dataset.id,{syntax:B,source:I}=g[T];m.push(this.render(L,E,{syntax:B,source:I},{...f,section:b}).then(()=>A.replaceWith(L)))}}if(k||C){let A=(b,L,T)=>{let B=document.createDocumentFragment();m.push(this.render(B,b,c,{...f,section:L.data}).then(()=>T(B)))};for(let[b,L]of F)k&&A(k,L,T=>b.after(T)),C&&A(C,L,T=>L.next?L.next.before(T):o.append(T))}return Promise.all(m)}n.view.define("markdown",i,{props:pb,usage:If}),n.view.define("md",i,{props:pb,usage:If})}var pb,mb=z(()=>{Bf();cb();fb();pb=`is not array? | {
|
||
|
|
source: #.props has no 'source' ? is (string or array) ?,
|
||
|
|
anchors: true,
|
||
|
|
sectionPrelude: undefined,
|
||
|
|
sectionPostlude: undefined,
|
||
|
|
codeConfig: undefined
|
||
|
|
} | overrideProps()`});var Ya=Ct((WP,yb)=>{function NL(n,e){switch(n.charCodeAt(e)){default:return 0;case 10:return 1;case 13:return e+1<n.length&&n.charCodeAt(e+1)===10?2:1}}yb.exports={newLineLength:NL}});var wb=Ct(($P,vb)=>{var{newLineLength:OL}=Ya();vb.exports=(n,e)=>{let i=1,o=0;for(let l=0;l<n.length;l++){let c=OL(n,l);c!==0&&(e(o,l+c,i++),o=l+c,l+=c-1)}e(o,n.length,i++)}});var xb=Ct((UP,bb)=>{var{newLineLength:BL}=Ya();bb.exports=(n,e)=>{let i=1,o=0;for(let l=0;l<n.length;l++){let c=BL(n,l);c!==0&&(e(o,l,i++),o=l+c,l+=c-1)}e(o,n.length,i++)}});var Cb=Ct((GP,kb)=>{kb.exports=function(n){if(n instanceof RegExp){let e=n.flags.indexOf("g")!==-1?n.flags:n.flags+"g",i=new RegExp(n,e);return function(o,l){let c;for(;c=i.exec(o);)l(c.index,c.index+c[0].length)}}return n=String(n),function(e,i){let o=-1;for(;o=e.indexOf(n,o+1),o!==-1;)i(o,o+n.length)}}});var Ab=Ct((VP,Db)=>{var{newLineLength:IL}=Ya();Db.exports=(n,e)=>{let i=1;for(let o=0;o<n.length;o++){let l=IL(n,o);l!==0&&(e(o,o+l,i++),o+=l-1)}}});var Eb=Ct((YP,Sb)=>{Sb.exports={lines:wb(),lineContents:xb(),matches:Cb(),newlines:Ab()}});var Qa=Ct((QP,Tb)=>{function Mb(n){return Pf.call(null,n)}function Pf(n){let e=this===globalThis?{}:this||{},i={};return Object.assign(i,e,n,{fork:Pf.bind(i),ranges:Object.assign({},e.ranges,n&&n.ranges)}),typeof i.createHook!="function"&&(i.createHook=o=>o()),i}function Lb(n){let e=Object.assign({},this);for(let i in n){let o=n[i];if(!(!o||typeof o!="object"))if(hasOwnProperty.call(e,i)){let l=e[i];e[i]=l&&typeof l.fork=="function"?l.fork(n[i]):l}else e[i]=Mb(n[i])}return e.fork=Lb.bind(e),e}Tb.exports={createPrinter:Mb,forkPrinter:Pf,forkPrinterSet:Lb}});var jf=Ct((KP,Fb)=>{Fb.exports=Qa().createPrinter()});var Ob=Ct((ZP,Nb)=>{var{createPrinter:PL}=Qa();Nb.exports=PL({print:n=>n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")})});var Ib=Ct((JP,Bb)=>{var{forkPrinterSet:jL}=Qa();Bb.exports=jL.call({},{noop:jf(),html:Ob(),tty:jf()})});var jb=Ct((XP,Pb)=>{Pb.exports=function(e,i){let o=[];return i.forEach(({generate:l,marker:c})=>l(e,(f,d,g)=>o.push({type:c,start:f,end:d,data:g}))),o}});var Rb=Ct((ej,zb)=>{var Ka=()=>"",zL=function(){};function zr(n,e){return typeof n=="function"?n:e||zL}zb.exports=function(e,i,o){let l=zr(o.print,L=>L),c=Object.assign(Object.defineProperties(Object.create(null),{offset:{get:()=>k},line:{get:()=>C},column:{get:()=>M},start:{get:()=>d.start},end:{get:()=>d.end},data:{get:()=>d.data}}),zr(o.createContext)()),f=[],d={start:0,end:e.length},g=o.ranges||{},m=[],y=1/0,k=0,C=1,M=1,E="";E+=zr(o.open,Ka)(c),g=[].concat(Object.getOwnPropertyNames(g),Object.getOwnPropertySymbols(g)).reduce((L,T)=>{let B=g[T];return typeof B=="function"&&(g[T]=B=o.createHook(B)),B&&(m.push(T),L[T]={open:zr(B.open,Ka),close:zr(B.close,Ka),print:zr(B.print,l)}),L},{}),i=i.slice().sort((L,T)=>L.start-T.start||T.end-L.end||m.indexOf(L.type)-m.indexOf(T.type));let F=L=>g[(d=f[L]).type].open(c)||"",N=L=>g[(d=f[L]).type].close(c)||"",A=L=>{if(k!==L){let T=e.substring(k,L),B=f.length?g[f[f.length-1].type].print:l;for(let I=k;I<L;I++){let R=e.charCodeAt(I);R===10||R===13&&(I>=e.length||e.charCodeAt(I+1)!==10)?(C++,M=1):M++}E+=B(T,c),k=L}},b=L=>{for(;y<=L;){A(y);for(let T=f.length-1;T>=0&&f[T].end===y;T--)E+=N(T),f.pop();y=1/0;for(let T=0;T<f.length;T++)f[T].end<y&&(y=f[T].end)}};for(let L=0;L<i.length;L++){let T=i[L],B=0;if(g.hasOwnProperty(T.type)!==!1&&!(T.start>T.end||!Number.isFinite(T.start)||!Number.isFinite(T.end))){for(b(T.start),A(T.start),B=0;B<f.length;B++)if(f[B].end<T.end){for(let I=f.length-1;I>=B;I--)E+=N(I);break}for(f.splice(B,0,T);B<f.length;B++)E+=F(B);T.end<y&&(y=T.end)}}b(e.length),A(e.length);for(let L=f.length-1;L>=0;L--)E+=N(L);return E+=zr(o.close,Ka)(c)||"",E}});var _b=Ct((tj,qb)=>{var RL=Eb(),Hf=Ib(),Hb=jb(),HL=Rb();function qL(n,e){return{marker:n,generate:e}}function _L(n,e){let i={};for(let o in e)i[o]={ranges:{[n]:e[o]}};return i}function Rf(n,e,i){let o=(l,c)=>{let f=e[c||i]||Hf.noop,d=Hb(l,n);return HL(l,d,f)};return Object.assign(o,{print:o,generateRanges(l){return Hb(l,n)},use(l,c){let f=Symbo
|
||
|
|
source: #.props has no 'source' ? is string ?: content is string ? content : source,
|
||
|
|
syntax,
|
||
|
|
lineNum is function ?: is not undefined ? bool() : true,
|
||
|
|
refs is array ?: null,
|
||
|
|
maxSourceSizeToHighlight is number ?: 250 * 1024, // 250Kb
|
||
|
|
actionButtons: undefined,
|
||
|
|
actionCopySource is undefined ? true,
|
||
|
|
prelude: undefined,
|
||
|
|
postlude: undefined
|
||
|
|
} | overrideProps()`});var t0,n0=z(()=>{t0={demo:{view:"text",data:'"Hello world!"'},examples:[{title:"Shorthand usage",view:'text:"Hello world!"'}]}});function r0(n){n.view.define("text",function(e,{text:i}){e.appendChild(document.createTextNode(String(i)))},{tag:!1,props:(...e)=>n.query(KL,...e),usage:t0})}var KL,i0=z(()=>{n0();KL=`{
|
||
|
|
text: #.props has no 'text'?
|
||
|
|
} | overrideProps()`});var o0,s0=z(()=>{o0={demo:{view:"text-match",data:{text:"I am matched text or a text with matches!",match:/match/}},examples:[{title:"Raw string as match",demo:{view:"text-match",data:{text:"I am matched text or a text with matches!",match:"match"}}},{title:"Using with a link",demo:{view:"link",data:{href:"#"},content:'text-match:{ text: "Test link", match: /\\w+/i }'}},{title:"Various configurations",demo:{view:"table",cols:[{header:"text-match",content:"text-match"},{header:"Config",content:"struct"}],data:[null,{},{},{match:"test"},{match:"Test"},{match:"test",ignoreCase:!0},{match:"Test",ignoreCase:!0},{match:/test/},{match:/test/g},{match:/test/i},{match:/test/,ignoreCase:!0},{match:/test/g,ignoreCase:!0}].map((n,e)=>e>1?{text:"test Test",...n}:n)}}]}});function a0(n){n.view.define("text-match",function(e,i){let{text:o,match:l,ignoreCase:c}=i;lr(String(o),l,f=>e.append(f),f=>e.appendChild(ZL.cloneNode()).append(f),c)},{tag:!1,props:JL,usage:o0})}var ZL,JL,l0=z(()=>{Oe();ts();s0();ZL=$("span","view-text-match"),JL=`is not array? | {
|
||
|
|
text: #.props has no 'text' ? text,
|
||
|
|
match,
|
||
|
|
ignoreCase: ignoreCase or false
|
||
|
|
} | overrideProps()`});var u0,c0=z(()=>{u0={demo:{view:"text-numeric",data:'"Like a `text` view but adds a thousands separator to integer part of numbers, e.g. 12345678 or 12345.67890"'},examples:[{title:"Shorthand usage",view:"text-numeric:1234567"}]}});function f0(n){n.view.define("text-numeric",function(e,{text:i}){e.innerHTML=Dt(i)},{tag:"span",props:XL,usage:u0})}var XL,d0=z(()=>{Qt();c0();XL=`{
|
||
|
|
text: #.props has no 'text'?
|
||
|
|
} | overrideProps()`});var p0,h0=z(()=>{p0={demo:{view:"context",data:{name:"text",demo:123},content:["text:name","table"]},examples:[{title:"Using with modifiers",demo:{view:"context",modifiers:['h2:"Modifiers"',{view:"input",name:"inputValue"},{view:"select",name:"selectValue",data:["foo","bar","baz"]}],content:['h2:"Values"',"struct:#"]}}]}});function g0(n){n.view.define("context",async function(e,i,o,l){let{modifiers:c=[],content:f=[],proxy:d,onInit:g,onChange:m}=i,y=l,k=null,C=!1;await this.render(e,this.composeConfig(c,{onInit:N,onChange:N}),o,l);let M=e.appendChild(document.createComment('{ view: "context" } content start')),E=e.appendChild(document.createComment('{ view: "context" } content end'));d&&(g||m)&&(f=this.composeConfig(f,{onInit:g,onChange:m})),C=!0,await F();async function F(){let A=E.previousSibling;for(;A&&A!==M;)A=A.previousSibling,A.nextSibling.remove();let b=k=document.createDocumentFragment();await n.view.render(b,f,o,y),b===k&&(n.view.adoptFragment(b,M),M.after(b),k=null)}function N(A,b){b&&(!Ae(y,b)||y[b]!==A)&&(y={...y,[b]:A},C?(F(),d&&typeof m=="function"&&m(A,b)):typeof g=="function"&&g(A,b))}},{tag:!1,props:eT,usage:p0})}var eT,m0=z(()=>{st();h0();eT=`#.props | {
|
||
|
|
modifiers is array ?: is truthy ? [$] : [],
|
||
|
|
content,
|
||
|
|
proxy.bool(),
|
||
|
|
onInit,
|
||
|
|
onChange
|
||
|
|
}`});var y0,v0=z(()=>{y0={demo:{view:"switch",data:{enabled:!0},content:[{when:"not enabled",content:'text:"I am disabled"'},{when:"enabled",content:'text:"I am enabled"'}]},examples:[{title:"Using with tabs",demo:{view:"context",modifiers:{view:"tabs",tabs:["foo","bar","baz"],name:"section"},content:{view:"switch",content:[{when:'#.section="foo"',content:'text:"FOO!"'},{when:'#.section="bar"',content:'text:"BAR!!"'},{content:'text:"When no other conditions are met"'}]}}}]}});function w0(n){n.view.define("switch",function(e,i,o,l){let{content:c}=i,f='alert-warning:"No case choosen"';if(Array.isArray(c))for(let d=0;d<c.length;d++){let g=c[d];if(g&&n.queryBool(g.when||!0,o,l)){f="data"in g?{view:"context",data:g.data,content:g.content}:g.content;break}}return n.view.render(e,f,o,l)},{tag:!1,usage:y0})}var b0=z(()=>{v0()});function qf(n,e,i){for(let o in n){if(!Ae(n,o))continue;let l;i.dictMode?(l=i.dictMode,l.count++,l.keys.add(o)):i.properties.has(o)?(l=i.properties.get(o),l.count++):(l={count:1,map:Object.create(null)},i.properties.set(o,l)),Oi(n[o],e-1,l.map)}}function Oi(n,e,i=Object.create(null)){let o=n===null?"null":mn(n)?"array":sr(n)?"set":typeof n;switch(o){default:o in i||(i[o]=new Map),i[o].set(n,(i[o].get(n)||0)+1);break;case"object":"object"in i||(i.object=new Map,i.object.count=0,i.object.properties=e?new Map:null,i.object.dictMode=null,i.object.sortKeys=!1),i.object.count++,i.object.has(n)?i.object.set(n,i.object.get(n)+1):(i.object.set(n,1),e&&qf(n,e,i.object));break;case"array":"array"in i||(i.array=new Map,i.array.count=0,i.array.map=Object.create(null)),i.array.count++,i.array.set(n,(i.array.get(n)||0)+1);for(let l=0;l<n.length;l++)Oi(n[l],e,i.array.map);break;case"set":"set"in i||(i.set=new Map,i.set.count++,i.set.map=Object.create(null)),i.set.count++,i.set.set(n,(i.set.get(n)||0)+1);for(let l of n)Oi(l,e,i.set.map);break}return i}var x0=z(()=>{Br();st()});var Za,us,_f=z(()=>{Za=["rgba(83,211,75,0.75)","rgba(241,235,44,0.75)","rgba(244,152,99,0.75)","rgba(148,99,244,0.75)","rgba(44,132,241,0.75)","rgba(233,117,117,0.75)","rgba(85,187,155,0.75)","rgba(151,147,99,0.75)","rgba(216,107,196,0.75)","rgba(108,204,227,0.75)","rgba(164,164,164,0.75)"],us=["null","undefined","string","number","bigint","boolean","symbol","function","array","set","object"]});function Bi(n,e,i,o,l=[],c="",f=null){Object.keys(e).sort((d,g)=>us.indexOf(d)-us.indexOf(g)).forEach((d,g,m)=>{switch(g>0&&n.append(" | "),d){default:{let y=n.appendChild($("span","type",d));i.set(y,{type:"type",context:o,path:l,stat:e,name:d});break}case"object":{let y=e[d],{properties:k,dictMode:C,sortKeys:M}=y;if(k===null){i.set(n.appendChild($("span","expand","{\u2026}")),{type:"expand",context:o,path:l,stat:e,map:e[d],offset:c});break}if(k.size===0){n.appendChild($("span","object","{}"));break}let E=y.size,F=C?[["[key]",C]]:[...k.entries()],N=c+" ",A=n.appendChild($("span","object",["{",$("span",{"data-action":"collapse"})])),b=$("div",{class:"object-entries",style:`--object-entries-offset: ${c.length}`});k.size>1&&(A.appendChild($("span",{title:"Toggle dictionary mode (collapse all the values in a single signature)","data-action":"dict-mode","data-enabled":C!==null})),F.some(([L],T)=>T!==0&&L<F[T-1][0])&&A.appendChild($("span",{title:"Toggle keys sorting","data-action":"sort-keys","data-enabled":M})),M&&F.sort(([L],[T])=>L<T?-1:L>T?1:0)),i.set(A,{type:"shape",context:o,path:l,map:e[d],offset:c}),(E>1||m.length>1||f!==null&&Object.keys(f).length>1)&&(A.appendChild($("span","count")).dataset.value=String(E));for(let[L,{count:T,map:B}]of F){let I=$("span","property",[L]);i.set(I,{type:"property",context:o,path:l,stat:e,name:L,map:B}),b.append(N),b.append(I),T!==E&&C===null&&I.append($("span","optional","?")),b.append(": "),Bi(b,B,i,o,l.concat(C?"*":L),N),b.append(`;
|
||
|
|
`)}A.append(b),A.append(c,"}");break}case"array":n.append("["),Bi(n,e[d].map,i,o,l,c),n.append("]");break;case"set":n.append("Set("),Bi(n,e[d].map,i,o,l,c),n.append(")");break}})}var k0=z(()=>{Oe();_f()});function Ii(n,e){return n.toFixed(e).replace(/\.?0+$/,"")}function C0(n){let e=Math.cos(2*Math.PI*n),i=Math.sin(2*Math.PI*n);return[e,i]}function D0(n){let e=0;return['<svg viewBox="-1 -1 2 2" class="pie">',...n.map(i=>{let[o,l]=C0(e),[c,f]=C0(e+=i.percent),d=i.percent>.5?1:0;return`<path d="${[`M ${o} ${l}`,`A 1 1 0 ${d} 1 ${c} ${f}`,"L 0 0"].join(" ")}" fill="${i.color}" stroke="black" stroke-width=".0025"/>`}),"</svg>"].join(`
|
||
|
|
`)}function tT(n){let e=0;for(let i in n)n[i].forEach(o=>e+=o);return e}function nT(n){let e=Object.create(null);for(let i in n)e[i]=0,n[i].forEach(o=>e[i]+=o);return e}function A0(n,e,i){let{context:o,path:l,stat:c,name:f}=e,d=c.object,{map:g,count:m}=d.dictMode||d.properties.get(f),y=d.dictMode?d.dictMode.count:d.size,k={name:f,path:i.pathToQuery(l),total:y,count:m,percent:Ii(100*m/y,1)+"%"};i.view.render(n,[{view:"block",when:"path",className:"path",content:"text:path"},{view:"h1",className:"property",content:["text:name",{view:"html",when:"count != total",data:`"<span class=\\"usage-stat optional\\">" + (
|
||
|
|
"(in <span class=\\"num\\">" + count + "</span> of <span class=\\"num\\">" + total + "</span> objects, <span class=\\"num\\">" + percent + "</span>)"
|
||
|
|
) + "</span>"`}]}],k,o),S0(n,{context:o,map:g,count:m},i)}function S0(n,{context:e,map:i,count:o},l){let c=nT(i),f=[],d=us.filter(g=>g in i);Object.entries(c).sort(([,g],[,m])=>m-g).forEach(([g,m],y)=>{f.push({name:Xe(g),count:m,percent:m/o,percent100:Ii(100*m/o,1),color:Za[y]})}),l.view.render(n,{view:"block",when:"typeStat.size() > 1",data:"typeStat",className:"pie-stat",content:[{view:"block",content:{view:"html",data:D0}},{view:"block",content:['html:"<span class=\\"list-header\\">Types usage:</span>"',{view:"list",item:`html:
|
||
|
|
"<span class=\\"dot\\" style=\\"--size: 10px; background-color: " + color + "\\"></span> " +
|
||
|
|
"<span class=\\"caption\\">" + name + "</span>" +
|
||
|
|
"<span class=\\"times\\"> \xD7 " + count + " (" + percent100 + "%)</span>"
|
||
|
|
`}]}]},f,e),d.forEach(g=>Wf(n,{context:e,name:g,stat:i},l))}function Wf(n,e,i){let o=e.context,l=e.stat[e.name],c=tT(e.stat),f=[],d=[],g;switch(e.name){case"number":{let m=[],y=0,k=0,C=0,M=1/0,E=-1/0;l.forEach((F,N)=>{m.push({count:F,value:N}),y+=N*F,k+=F,F>1&&C++,N<M&&(M=N),N>E&&(E=N)}),g={type:e.name,count:k,distinct:l.size,duplicated:C,min:M,max:E,sum:y,avg:Ii(y/k,3),values:m.sort((F,N)=>N.count-F.count||F.value-N.value)},g.distinct>1&&f.push({view:"block",className:"overview-stat",content:`html:
|
||
|
|
"range: (min) <span class=\\"num\\">" + min + "</span> ... " +
|
||
|
|
"<span class=\\"num\\">" + max + "</span> (max), " +
|
||
|
|
"avg: <span class=\\"num\\">" + avg + "</span>"
|
||
|
|
`});break}default:{let m=[],y=0,k=0;l.forEach((C,M)=>{m.push({count:C,value:M}),y+=C,C>1&&k++}),g={type:e.name,count:y,distinct:l.size,duplicated:k,values:e.name==="object"||e.name==="array"||e.name==="set"?m.sort((C,M)=>M.count-C.count):m.sort((C,M)=>M.count-C.count||C.value>M.value||-(C.value<M.value))};break}}if(e.name!=="undefined"&&e.name!=="null"){if(f.unshift({view:"block",className:"overview-stat",content:['html:"<span class=\\"num\\">" + count + "</span> " + (count > 1 ? "values, " : "value")',{view:"switch",when:"count > 1",content:[{when:"distinct = 1",content:'text:"a single unique value:"'},{when:"distinct = count",content:'text:"all unique, no duplicates"'},{content:['html:"<span class=\\"num\\">" + distinct + "</span> unique, "','html:duplicated = distinct ? "all occur more than once" : "<span class=\\"num\\">" + duplicated + "</span> occur more than once"']}]}]}),g.values.length>1&&g.duplicated&&e.name!=="object"&&e.name!=="set"&&e.name!=="array"){let m=[],y=g.values.length===10?10:Math.min(9,g.values.length),k=0;for(let C=0;C<y;C++){let{count:M,value:E}=g.values[C];k+=M,m.push({name:Xe(String(E)),count:M,percent:M/g.count,percent100:Ii(100*M/g.count,1),color:Za[C]})}if(m.length){let C=g.count-k;C>0&&m.push({name:"...",count:C,percent:C/g.count,percent100:Ii(100*C/g.count,1),color:Za[m.length]}),d.push({view:"button",className:"group",when:"#.actions | queryAcceptChanges and querySubquery",onClick(M,E,F){let N=E.path?[...E.path]:[],A=N.pop(),b=i.pathToQuery(N),L=F.rootData;F.actions.queryAcceptChanges(L)&&F.actions.querySubquery(`${b}${b?".group(":"group("}=>${i.pathToQuery([A])}).sort(value.size() desc)`,L)}}),f.push({view:"block",className:"pie-stat",data:m,content:[{view:"block",content:{view:"html",data:D0}},{view:"block",content:['html:"<span class=\\"list-header\\">Dominators:</span>"',{view:"list",item:`html:
|
||
|
|
"<span class=\\"dot\\" style=\\"--size: 10px; background-color: " + color + "\\"></span> " +
|
||
|
|
"<span class=\\"caption\\" title=\\"" + name + "\\">" + name + "</span>" +
|
||
|
|
"<span class=\\"times\\"> \xD7 " + count + " (" + percent100 + "%)</span>"
|
||
|
|
`}]}]})}}g.values.length>1?(e.name==="number"||e.name==="string")&&f.push({view:"content-filter",name:"filter",data:"values.sort(value ascN)",content:{view:e.name==="string"?"list":"menu",className:"struct-list",data:".[no #.filter or value~=#.filter]",emptyText:"Nothing matched",item:[e.name==="string"?{view:"struct",data:"value",match:"=#.filter"}:{view:"block",className:"caption",content:"text-match:{ text: value, match: #.filter }"},{view:"block",when:"count > 1",className:"count",content:'text:" \xD7 " + count'}]}}):(e.name==="number"||e.name==="string"||e.name==="boolean")&&f.push({view:"struct",data:"values[].value"}),e.name==="object"&&f.push({view:"list",className:"struct-list",data:"values",item:["struct:value",{view:"block",when:"count > 1",className:"count",content:'text:" \xD7 " + count'}]}),(e.name==="array"||e.name==="set")&&Object.keys(l.map).length&&f.push({view:"block",className:e.name==="array"?"array-types":"set-types",postRender(m){S0(m,{...l,context:o},i)}})}i.view.render(n,[{view:"block",when:"path",className:"path",data:m=>i.pathToQuery(m.path),content:"text"},{view:"block",className:"signature-action-buttons",content:d},{view:"h1",className:"type",content:["text:name",`html:"<span class=\\"usage-stat\\">" + (
|
||
|
|
count = total
|
||
|
|
? "only this type is used"
|
||
|
|
: "used in <span class=\\"num\\">" + count + "</span> of <span class=\\"num\\">" + total + "</span> cases (<span class=\\"num\\">" + percent + "</span>)"
|
||
|
|
) + "</span>"`]},...f],{...g,name:e.name,path:e.path,total:c,percent:Ii(100*g.count/c,1)+"%"},o)}var E0=z(()=>{Qt();_f()});var M0,L0=z(()=>{M0={beforeDemo:['md:"The `signature` view is used to output a type definition for current data using TypeScript like style:"'],demo:{view:"signature",expanded:!0}}});function T0(n){let e=new WeakMap,i=({target:o})=>{let l="expand",c=o.closest(`
|
||
|
|
.view-signature .expand,
|
||
|
|
.view-signature [data-action]
|
||
|
|
`);if(!c)return;c.dataset.action&&(l=c.dataset.action,c=c.parentNode);let f=e.get(c);if(f){let{context:d,path:g,stat:m,map:y,offset:k}=f,C=document.createDocumentFragment();switch(l){case"sort-keys":y.sortKeys=!y.sortKeys;break;case"dict-mode":if(y.dictMode)y.dictMode=null;else{let M=y.dictMode={keys:new Set,count:0,map:Object.create(null)};y.forEach((E,F)=>{for(let N in F)Ae(F,N)&&(M.keys.add(N),M.count++,Oi(F[N],1,M.map))})}break;default:y.properties===null?(y.properties=new Map,y.forEach((M,E)=>qf(E,1,y))):y.properties=null}Bi(C,{object:y},e,d,g,k,m),c.replaceWith(C)}};n.addHostElEventListener("click",i,!1),new n.view.Popup({className:"signature-details",hoverPin:"trigger-click",hoverTriggers:`
|
||
|
|
.view-signature .property,
|
||
|
|
.view-signature .type
|
||
|
|
`,render(o,l){let c=e.get(l);switch(c.type){case"property":return A0(o,c,n);case"type":return Wf(o,c,n)}}}),n.view.define("signature",function(o,l,c,f){let{expanded:d,path:g}=l,m=Oi(c,d),y=Array.isArray(g)?g:void 0,k="rootData"in l?l.rootData:!y||y.length===0?c:void 0;Bi(o,m,e,{...f,rootData:k},y)},{usage:M0})}var F0=z(()=>{st();x0();k0();E0();L0()});function $t(n,e){return`<span class="${n}">${e}</span>`}function $f(n){return $t("more",`\u2026 ${Dt(n)} more`)}function Pi(n){return Xe(ji(n))}function ji(n){return/[^\x20\x21\x23-\x5B\x5D-\uD799]/.test(n)?JSON.stringify(n).slice(1,-1):n}function Hr(n,e,i){switch(typeof n){case"boolean":case"undefined":return $t("keyword",String(n));case"number":case"bigint":return $t("number",Dt(n));case"symbol":return $t("symbol",String(n));case"function":return"\u0192n";case"string":{let o=n.length,l=e?i.maxCompactStringLength:i.maxStringLength,c=o>l+i.allowedExcessStringLength,f="",d="",g="";if(c){if(i.match){let m=[],y=l>30?10:5,k=l-y,C=0,M=-1;if(lr(n,i.match,E=>{C+=E.length},(E,F)=>{if(M===-1&&(M=C+k),C<M&&m.push({start:C,end:C+E.length}),C+=E.length,C>M)return F}),m.length>0){let E=m[0].start,F=l;if(E!==0){let N=ji(n.slice(0,E));if(E>y){let b=y-2;d=$t("more prefix",""),f=N.slice(-b),F-=y}else f=N}for(let N=0;N<m.length&&F>0;N++){let{start:A,end:b}=m[N],L=Math.min(b-A,F);if(f+=$t("match",Pi(n.slice(A,A+L))),F-=L,F>0){let T=N+1>=m.length,B=T?n.length:m[N+1].start,I=Math.min(B-b,F);if(T){let R=n.length-(b+I);R>0&&(g=$t("more suffix",Dt(R)))}I>0&&(f+=Pi(n.slice(b,b+I)),F-=I)}}}}f===""&&(f=Pi(n.slice(0,l)),g=$t("more suffix",Dt(o-l)))}else i.match?lr(n,i.match,m=>{f+=Pi(m)},m=>{f+=$t("match",Pi(m))}):f=Pi(n);return $t("string",!e&&(n[0]==="h"||n[0]==="/")&&rT.test(n)?`"${d}<a href="${Xe(n)}" target="_blank">${f}</a>${g}"`:`"${d}${f}${g}"`)}case"object":{if(n===null)return $t("keyword","null");if(mn(n)){let f=n.length,d=i.limitCollapsed===!1||i.limitCollapsed>f?f:i.limitCollapsed,g=Array.from({length:d},(m,y)=>Hr(n[y],!0,i));return f>d&&g.push(`${$f(f-d)} `),`[${g.join(", ")}]`}switch(pn(n)){case"[object Set]":{let f=n.size,d=i.limitCollapsed===!1||i.limitCollapsed>f?f:i.limitCollapsed,g=n.values(),m=Array.from({length:d},()=>Hr(g.next().value,!0,i));return f>d&&m.push(`${$f(f-d)} `),`[${m.join(", ")}]`}case"[object Date]":return $t("date",String(n));case"[object RegExp]":return $t("regexp",String(n))}if(e&&i.limitCompactObjectEntries===0){for(let f in n)if(Ae(n,f))return"{\u2026}";return"{}"}let o=e?i.limitCompactObjectEntries===!1?1/0:i.limitCompactObjectEntries:i.limitCollapsed===!1?1/0:i.limitCollapsed,l=[],c=0;for(let f in n)if(Ae(n,f)){if(c<o){let d=Xe(f.length>i.maxCompactPropertyLength?f.slice(0,i.maxCompactPropertyLength)+"\u2026":f);l.push(`${$t("property",d)}: ${Hr(n[f],!0,i)}`)}c++}return c>o&&l.push($f(c-o)),l.length?`{ ${l.join(", ")} }`:"{}"}default:return`unknown type "${typeof n}"`}}var rT,Uf=z(()=>{Qt();st();Br();ts();rT=/^(?:https?:)?\/\/(?:[a-z0-9\-]+(?:\.[a-z0-9\-]+)+|\d+(?:\.\d+){3})(?:\:\d+)?(?:\/\S*?)?$/i});var N0,O0=z(()=>{Uf();N0=(n,e,i,o,l,c,f)=>({target:d})=>{let g="expand",m=d.closest(`
|
||
|
|
.view-struct.struct-expand,
|
||
|
|
.view-struct .struct-expand-value,
|
||
|
|
.view-struct .struct-action-button
|
||
|
|
`);if(m)switch(m.dataset.action&&(g=m.dataset.action),g){case"expand":m.classList.contains("struct-expand")&&(m=m.lastChild),n(m,0),i(),m.parentNode.classList.add("struct-expanded-value"),l.has(m.parentNode)&&m.parentNode.classList.remove("struct-expand");break;case"collapse":m=m.parentNode,e(m),i(),m.parentNode.classList.remove("struct-expanded-value"),m.classList.remove("view-as-table"),l.has(m.parentNode)&&m.parentNode.classList.add("struct-expand");break;case"show-signature":f.show(m);break;case"value-actions":c.show(m);break;case"toggle-sort-keys":n(m.parentNode,0,m.parentNode.classList.toggle("sort-keys")),i();break;case"toggle-string-mode":{m=m.parentNode;let y=m.classList.toggle("string-value-as-text");for(let k=m.querySelector(".string-text").firstChild;k!==null;k=k.nextSibling){let C=k.nodeType===3?k:k.firstChild,M=C.nodeValue;if(y)M.indexOf("\\")!==-1&&(C.nodeValue=JSON.parse(`"${M}"`));else{let E=ji(M);E!==M&&(C.nodeValue=E)}}break}case"toggle-view-as-table":m=m.parentNode,m.classList.toggle("view-as-table")?o(m):m.querySelector(":scope > .view-table")?.remove();break}}});function B0(n){return n?", "+Dt(n)+" bytes":""}function iT(n){for(;n.parent!==null;)n=n.parent;return n.host[""]}function I0(n,e,i,o){return new n.view.Popup({className:"view-struct-actions-popup",render(l,c,f){let d=c.parentNode,g=e.get(d),m=[];if(typeof g=="string")m=[{text:"Copy as quoted string",action:()=>Wt(JSON.stringify(g))},{text:"Copy as unquoted string",action:()=>Wt(JSON.stringify(g).slice(1,-1))},{text:"Copy a value (unescaped)",action:()=>Wt(g)}];else{let y=n.pathToQuery(o(d)),k=1024*1024*1024,C=!1,M=!1,E=0,F=0;try{let{bytes:N,spaceBytes:A,circular:b}=Ao(g,{space:4});b.length?(C="Converting circular structure to JSON",M="Converting circular structure to JSON"):(E=N-A,F=N+2,E>k&&(M="Resulting JSON is over 1 Gb"),F>k&&(C="Resulting JSON is over 1 Gb"))}catch(N){M=C=/Maximum call stack size|too much recursion/i.test(N.message)?"Too much nested structure":N.message}if(M&&(M="Can't be copied: "+M),C&&(C="Can't be copied: "+C),y){m.push({text:"Copy path:",notes:Xe(y),action:()=>Wt(y)});let N=i.get(d),A=iT(N);n.action.has("queryAcceptChanges")&&n.action.call("queryAcceptChanges",A)&&(n.action.has("querySubquery")&&m.push({groupStart:!0,text:"Create a subquery from the path",action:()=>n.action.call("querySubquery",y,A)}),n.action.has("queryAppend")&&m.push({text:"Append path to current query",action:()=>n.action.call("queryAppend",y,A)}))}m.push({groupStart:!0,text:"Copy as JSON",notes:`(formatted${B0(F)})`,error:C,disabled:!!C,action:()=>Wt(JSON.stringify(g,null,4))}),m.push({text:"Copy as JSON",notes:`(compact${B0(E)})`,error:M,disabled:!!M,action:()=>Wt(JSON.stringify(g))})}n.view.render(l,{view:"menu",onClick(y){f(),y.action()},itemConfig:{className:'=groupStart ? "group-start" : null'},item:["html:text",{view:"block",when:"notes",className:"notes",content:"html:notes"},{view:"block",when:"error",className:"error",content:"text:error"}]},m)}})}var P0=z(()=>{Qt();es();Jo()});function Gf(n,e){return Array.isArray(n)?Array.isArray(e)?n.concat(e):n:e}function Ja(n){return Array.isArray(n)&&n.length>0?n.map(e=>typeof e=="string"||typeof e=="function"?{query:e}:e):!1}function z0(n){return Ja([...n.objectMarkers.values].map(({name:e,lookup:i})=>(o,l)=>{let c=i(o,!0);if(c!==null&&c.object!==l.host)return{place:"before",style:"badge",text:e,href:c.href}}))}function R0(n,e){return Gf(e,Ja(n))}function sT(n){return oT.includes(n)}function H0(n){let e=Date.now()+8,i=0;for(;i<n.length&&!(Date.now()>e);i++){let{el:o,config:l,renderer:c,data:f,context:d}=n[i],{place:g="after",className:m,text:y,icon:k,href:C,external:M,tooltip:E}=l,F=sT(l.style)?l.style:g==="before"?"none":"default",N=y===void 0?typeof l!="object"?String(l):"":String(y),A=N!=="",b=["value-annotation","style-"+F,g==="before"?"before":"after",A?"has-text":"",m||""].join(" "),L=$(C?"a":"span",{class:b,href:typeof C=="string"?C:void 0,target:M?"_blank":void 0});if(A&&(/\d{4}/.test(N)?L.innerHTML=Dt(N):L.append(N)),typeof k=="string"&&(L.classList.add("icon"),/^[a-z_$][a-z0-9_$-
|
||
|
|
`)},afterDemo:["struct:#.id.pageLink(#.page, #.params)"],highlightProps:["cols"],demo:{view:"table",cols:{age:'text:age + " y.o."',occupation:!1,extraColumn:{header:"Extra column",content:'text:age >= 21 ? "Adult" : "Child"'}}},demoData:zi},{title:"Sorting",beforeDemo:{view:"md",source:['To specify a sorting function, use the `sorting` property in the column options. When a value for `sorting` is set, the column becomes sortable, allowing users to toggle sorting by clicking the column header. The value can be a function `(a, b) => number` or a string representing a jora query that returns a [comparator function](https://discoveryjs.github.io/jora/#article:jora-syntax-functions&!anchor=comparator-functions) (e.g., "name asc, complex.expression desc"), otherwise the value ignores. The function should take two rows\' data (`a` and `b`) and return a negative number if `a` is less than `b`, a positive number if `a` is greater than `b`, or zero otherwise.',"","> The `table` view automatically displays a sorting direction indicator (icon) on a column when a comparator function returns `<= 0` or `>= 0` for each pair of consecutive rows.","","> Note: A sorting (comparator) function has no access to the table's context, so any attempt to access context (`#`) values within a comparator function produced by a query will return `undefined`.","","The `table` view attempts to infer a sorting function for a column when the `sorting` option is not explicitly specified, by executing the following steps:","- Use `data` if it is a string or function to extract column values from row data; otherwise, use the row's data.",'- If `content` is a string formatted as `"view-name:query"`, use the `query` to extract a value from the previous step.',' > To prevent sorting inference from the `content` value, specify content in another format, often by wrapping it in an array, e.g., `{ content: "text:name" }` \u2192 `{ content: ["text:name"] }`.',"- If any condition is met, construct a sorting (comparator) function."," > If neither `data` nor `content` options meet the conditions, a sorting function cannot be inferred, and the column becomes non-sortable.","","> Note: When inferring a comparator function, the when, whenData, and contentWhen options are not considered for now. If these options are needed to affect sorting, an explicit sorting function should be specified."].join(`
|
||
|
|
`)},highlightProps:["sorting","data","content"],demo:{view:"table",cols:[{header:"Sorting from data",data:"name"},{header:"Sorting from content",content:"text:age"},{header:"Sorting from data&content",data:"{ name, age }",content:"text:`${age} ${name}`"},{header:"Explicit sorting",sorting:"name asc, age desc",content:["text:`${name} ${age}`"]}]},demoData:zi},{title:"Displaying non-object values",beforeDemo:['md:"When input data (an array) contains non-object values, such values are display using `struct` view in a single cell spanning all the columns"'],highlightProps:["data","valueCol"],demo:['h3:"Table with non-object values"',{view:"table",data:[123,"string",null,{foo:1,bar:2},[1,2,3]]},'h3:"Enforce displaying of a [value] column"',{view:"table",valueCol:!0}],demoData:zi},{title:"Setup cell display",beforeDemo:{view:"md",source:["To manage cell display, the following options are available in the `cols` setting:","- `colWhen` (similar to `when` and `whenData` options) allows disabling column rendering based on the table's data.","- `when` and `whenData` apply to `table-cell` and behave the same way as they do for any view, to disabling rendering of the cell itself.","- `contentWhen` (similar to `when` and `whenData` options) allows disabling cell content rendering based on the cell's data.","- `colSpan` allows setting a relevant attribute for a table cell. (Note: subsequent cells should be disabled using `when` or `whenData`)."].join(`
|
||
|
|
`)},highlightProps:["contentWhen","colWhen","colSpan","when"],demo:{view:"table",data:'.({ name, age, fare: age > 21 ? "Full" : age > 12 ? "Half" })',cols:{name:{contentWhen:'$ != "Bob"'},age:{colWhen:"size() > 10"},fare:{colSpan:"=fare ? 1 : 2",content:{data:"fare",view:"switch",content:[{when:"$",content:"text"},{content:'text:"Not applicable"'}]}},price:{when:"fare",data:'fare = "Full" ? 50 : 25',content:'text:"$" + $'}}},demoData:zi},{title:"Cell details",beforeDemo:{view:"md",source:["Table cells can display an additional detail view of their content when clicked. Clicking the same cell again, or a different cell with details, will hide the view. To enable and customize the detail view, use the `details` option.","","By default, if the `details` option is not explicitly defined, it will automatically activate for cells containing an object or a non-empty array, as long as no custom `content` is specified. In this case, a default `struct` view will be used to display the data.","","You can control the visibility of detail views using the `detailsWhen` option. This option accepts a function that checks the cell's data and disables the details view if the function returns a falsy value."]},highlightProps:["details","detailsWhen"],demo:{view:"table",cols:[{header:"Group",data:"group"},{header:"Default",data:"peoples"},{header:"Custom details",data:"peoples",details:['h2:"Custom detail views"',"table"]},{header:"Disable default details",data:"peoples",details:!1},{header:"Conditional details",data:"peoples",detailsWhen:"size() > 2"}]},demoData:[{group:"Kids",max:21},{group:"Adults",min:21},{group:"All"}].map(({group:n,min:e=0,max:i=100})=>({group:n,peoples:zi.filter(o=>o.age>e&&o.age<i)}))}]}});function Yf(n,e){return{header:n,sorting:`${e} ascN`,view:"table-cell",data:e}}function yT(n,e,i){let o="",l="";if("data"in n&&n.data!==void 0)switch(typeof n.data){case"string":l=`(${n.data||"$"})`;break;case"function":o="$dataQuery;",l="$dataQuery(#)";break;default:o="$dataQuery;",l="$dataQuery"}if(typeof n.content=="string"){let c=n.content.indexOf(":"),f=n.content.slice(0,c);if(c===-1||!e.view.has(f))return;let d=n.content.slice(c+1);d&&(l=l?`(${l} | ${d})`:`(${d})`)}return l?e.query(`${o} ${l} ascN`,{dataQuery:n.data},i):!1}function vT(n,e,i){return typeof e=="string"&&(e={content:e}),Ae(e,"content")||Ae(e,"data")?{header:n,view:"table-cell",...e}:{...Yf(n,i),...e}}function lx(n){return Array.isArray(n)?n.length:n}function ux(n,e,i){if(typeof i!="function")return!1;let o=0;try{for(let l=1,c=lx(e[0]);l<e.length;l++){let f=lx(e[l]),d=Math.sign(i(c,f));if(d){if(o&&d!==o)return!1;o=d}c=f}}catch(l){return n.logger.error("Error on column order detection in table view",l),0}return-o}function cx(n){let e=n.queryFn("is not object");n.view.define("table",function(i,o,l,c){let{rows:f,cols:d,rowConfig:g,limit:m,valueCol:y=!1}=o,k;"rows"in o||(f=l),sr(f)&&(f=[...f]),mn(f)||(f=f?[f]:[]);let C=i.appendChild($("thead")).appendChild($("tr")),M=[],E=i.appendChild($("tbody")),F=i.appendChild($("tbody")),N=F.appendChild($("tr")).appendChild($("td")),A=b=>{E.innerHTML="",N.innerHTML="";for(let L of M){let T=ux(n,b,L.sorting);L.el.classList.toggle("asc",T===1),L.el.classList.toggle("desc",T===-1)}return n.view.renderList(E,k,b,{...c,cols:d},0,n.view.listLimit(m,25),N).then(()=>F.hidden=!N.firstChild)};if(Array.isArray(d))d=d.map((b,L)=>typeof b=="string"?Yf(b,n.pathToQuery([b])):{header:"col"+L,view:"table-cell",...b});else{let b=new Set,L=d&&typeof d=="object"?d:{};d=[];for(let T of f)if(e(T))y=!0;else for(let B of Object.keys(T))b.add(B);for(let T of Object.keys(L))L[T]?b.add(T):b.delete(T);for(let T of b)d.push(Ae(L,T)?vT(T,L[T],n.pathToQuery([T])):Yf(T,n.pathToQuery([T])))}y&&d.unshift({header:"[value]",view:"table-cell",sorting:"$ ascN",colSpan:"=is not object ? #.cols.size() : 1",content:'=is not object ? "struct"',details:!1}),d=d.filter(b=>!Ae(b,"colWhen")||n.queryBool(b.colWhen,l,c));for(let b of d){let L=Ae(b,"sorting")?n.query(b.sorting,null,c):yT(b,n,c),T=typeof L=="function"?ux(n,f,L):0,B=C.appendChild($("th","view-table-header-cell"
|
||
|
|
$items: children.query(@, #.context) | is array?;
|
||
|
|
|
||
|
|
itemConfig,
|
||
|
|
content is not undefined ?: 'text',
|
||
|
|
collapsible is not undefined ?: true,
|
||
|
|
onToggle,
|
||
|
|
expanded,
|
||
|
|
last,
|
||
|
|
hasChildren: hasChildren or $items.size() > 0,
|
||
|
|
children,
|
||
|
|
$items,
|
||
|
|
limit: limit | $ = false or is int ?: 25
|
||
|
|
}`});var Xa={};Fe(Xa,{alerts:()=>aw,appHeader:()=>mw,autoLink:()=>vw,badges:()=>Cw,block:()=>Sv,button:()=>py,checkbox:()=>xy,checkboxList:()=>yy,column:()=>Mv,columns:()=>Tv,contentFilter:()=>Ay,context:()=>g0,dropdown:()=>Ly,editors:()=>kv,expand:()=>Bv,headers:()=>Mw,hstack:()=>zv,html:()=>Nw,image:()=>Iw,imagePreview:()=>Rw,indicator:()=>Ww,input:()=>By,link:()=>Vw,listItem:()=>Hv,lists:()=>Wv,markdown:()=>gb,menu:()=>zy,menuItem:()=>_y,navButton:()=>Gy,pageHeader:()=>Vv,popup:()=>Jv,progressbar:()=>Ky,section:()=>nw,select:()=>ev,signature:()=>T0,source:()=>Xb,struct:()=>ix,switchView:()=>w0,tab:()=>lv,table:()=>cx,tableCell:()=>hx,tableRow:()=>dx,tabs:()=>iv,text:()=>r0,textMatch:()=>a0,textNumeric:()=>f0,tocSection:()=>iw,toggle:()=>cv,toggleGroup:()=>dv,tree:()=>wx,treeItem:()=>xx});var Qf=z(()=>{hy();vy();ky();Sy();Ty();Iy();Ry();Wy();Vy();Zy();tv();ov();uv();fv();pv();Cv();Ev();Lv();Fv();Iv();Rv();qv();$v();Yv();Xv();rw();ow();lw();yw();ww();Dw();Lw();Ow();Pw();Hw();$w();Yw();mb();e0();i0();l0();d0();m0();b0();F0();ox();fx();px();gx();bx();kx()});function Cx(n){n.page.define("default",{view:"switch",content:[{when:"no #.datasets",content:"preset/welcome-block"},{content:['page-header{ content: "h1:#.name" }',{view:"struct",expanded:1}]}]}),n.preset.define("welcome-block",{view:"block",className:"welcome-block",data:"#.model",content:["app-header",{view:"block",className:"upload-data",when:"#.actions.uploadFile",content:["preset/upload",{view:"block",className:"upload-notes",content:'html:name + " is a server-less application that securely opens and analyzes your data directly on your device,<br>ensuring all processing is done locally without transmitting your data elsewhere."'}]}]})}var Dx=z(()=>{});function Ax(n){n.page.define("not-found",['alert-warning:"Page `" + name + "` not found"'])}var Sx=z(()=>{});function el(n,e=""){return typeof n=="string"?n:e}function Mx(n){let e=typeof n=="string"?{query:n}:n,{query:i,graph:o,view:l,viewEditorHidden:c,title:f,dzen:d,noedit:g,...m}=e,y=[];d&&y.push(["dzen"]),g&&y.push(["noedit"]),f&&y.push(["title",f]),i&&y.push(["q",Ko(i)]),o&&y.push(["graph",Ko(JSON.stringify(o))]),typeof l=="string"&&y.push(l?["v",Ko(l)]:["v"]),c&&y.push(["vh"]);for(let[k,C]of Object.keys(m||{}).sort())Ex.includes(k)||y.push([k,k.endsWith("-b64")&&typeof C=="string"?Ko(C):C]);return y}function Lx(n){let e=Object.fromEntries(n),i={title:el(e.title),query:Zo(el(e.q)),graph:JSON.parse(Zo(el(e.graph))||"null"),view:"v"in e?Zo(el(e.v)):void 0,viewEditorHidden:"vh"in e,dzen:"dzen"in e,noedit:"noedit"in e};for(let[o,l]of Object.entries(e))CT.includes(o)||(i[o]=o.endsWith("-b64")&&typeof l=="string"?Zo(l):e[o]);return i}function DT(n){return Object.fromEntries(Object.entries(n).filter(([e])=>!Ex.includes(e)))}function Kf(n,e,...i){for(let o of Object.keys(n))if(n[o]!==e[o]&&!i.includes(o))return!1;for(let o of Object.keys(e))if(n[o]!==e[o]&&!i.includes(o))return!1;return!0}function tl(n,e={}){let i={...n,params:DT(n.params)};return!Kf(e,i,"params","actions")||!Kf(e.params,i.params)||!Kf(e.actions,i.actions)?i:e}function Ri(n){return n&&typeof n=="object"&&"params"in n?n.params:{}}var Ex,CT,fs=z(()=>{wf();Ex=["query","graph","view","viewEditorHidden","title","dzen","noedit"],CT=["q","graph","v","vh","title","dzen","noedit"]});function AT(n){return n.replace(/\\/g,"\\\\").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/'/g,"\\'")}function ST(n){let{title:e,query:i,view:o}=n,l={title:e,query:i,view:o};return`{
|
||
|
|
${Object.keys(l).reduce((c,f)=>typeof l[f]=="string"?c.concat(` ${f}: '${AT(l[f])}'`):c,[]).join(`,
|
||
|
|
`)}
|
||
|
|
}`}function ET(n){if(n&&(typeof n=="number"||typeof n=="string")){let e=new Date(n);return isNaN(Number(e))?null:e}return n instanceof Date?n:null}function Tx(n){let e=ET(n);return e?e.toISOString().replace(/^(\d{4})-(\d{2})-(\d{2})T([\d:]+).*/,"$3/$2/$1 $4 UTC"):null}function Fx(n,e){let i,o,l,c,f=new n.view.Popup({render:(y,k,C)=>n.view.render(y,{view:"menu",data:()=>[{text:"Copy page permalink",disabled:!n.action.has("permalink"),action:async()=>Wt(await n.action.call("permalink",n.pageHash))},{text:"Copy page hash",action:()=>Wt(n.pageHash)},{text:"Copy page as JSON",action:()=>Wt(ST(n.pageParams))}],onClick(M){C(),M.action()}})}),d=$("div","discovery-actions",[c=$("button",{class:"edit-mode discovery-hidden-in-dzen",title:"Toggle edit mode",onclick(){this.blur(),e({noedit:!n.pageParams.noedit})}}),$("button",{class:"share",title:"Sharing",onclick(){this.blur(),f.show(this)}}),$("button",{class:"toggle-fullscreen",title:"Toggle full page mode",onclick(){this.blur(),e({dzen:!n.pageParams.dzen})}})]),g=y=>{y.parentNode.dataset.title=y.value||y.placeholder},m=$("div","discovery-header",[$("div",{class:"discovery-header-text","data-title":"\xA0"},[i=$("input",{class:"discovery-hidden-in-dzen",placeholder:"Untitled discovery",oninput(){g(this)},onchange(){g(this),e({title:this.value},!0)},onkeypress(y){y.key==="Enter"&&this.blur()}}),$("span","timestamp",[o=$("span",null," "),l=$("span")])])]);return{el:[d,m],render(y,k){let{title:C,noedit:M}=Ri(k),E=Tx(k?.datasets?.[0]?.resource?.createdAt);i.value=C||"",g(i),c.classList.toggle("disabled",M),o.innerText=E?"Data collected at "+E+" | ":"",l.innerText="Rendered at "+Tx(new Date)}}}var Nx=z(()=>{Oe();Jo();fs()});function Ox(n,e,i){return n.length?`${n.length} ${n.length===1?e:i}`:"empty"}function Zf(n){return Array.isArray(n)?`Array (${Ox(n,"element","elements")})`:n&&typeof n=="object"?`Object (${Ox(Object.keys(n),"entry","entries")})`:`Scalar (${n===null?"null":typeof n})`}function Jf(n,e){let i=document.createElementNS("http://www.w3.org/2000/svg",n);if(e)for(let[o,l]of Object.entries(e))i.setAttribute(o,String(l));return i}function MT(n,e,i){function o(){return n.appendChild($("div","query-graph-box"))}function l(f,d,g,m){Array.isArray(m)||(m=[]),f||(f=o());let y=m.length===1,k=m.length>1,C=f.appendChild($("div",{"data-path":g.join(" "),tabindex:-1,class:`query-graph-node${y?" target":k?" current":""}`}));if(i.view.attachTooltip(C,{className:"query-graph-tooltip",content:y?'badge:"Current query"':{view:"source",syntax:'=query ? "jora" : false',source:'=query or "<empty query>"',actionCopySource:!1,lineNumber:!1}},{query:d.query}),Array.isArray(d.children))for(let M=0;M<d.children.length;M++){let E=l(f.nextSibling,d.children[M],g.concat(M),m[1]===M?m.slice(1):[]);c.push([C,E])}return C}let c=[];for(let f=0;f<e.children.length;f++)l(n.firstChild,e.children[f],[f],e.current[0]===f?e.current:[]);requestAnimationFrame(()=>{let f=n.appendChild(Jf("svg"));for(let[d,g]of c){let m=qt(d,f),y=qt(g,f),k=m.right-2,C=m.top+m.height/2,M=y.left+2,E=y.top+y.height/2,F=(M-k)/3;f.append(C===E?Jf("line",{stroke:"#888",x1:k,y1:C,x2:M,y2:E}):Jf("path",{stroke:"#888",fill:"none",d:`M ${k} ${C} C ${k+2*F} ${C} ${M-2*F} ${E} ${M} ${E}`}))}})}function Bx(n){let e={current:Array.isArray(n.current)?n.current:[],children:Array.isArray(n.children)?n.children:[]};return e.current.length===0&&e.current.push(0),e.children.length===0&&e.children.push({}),e}function nl(n,e){let i=[n],o=n;for(let l=0;l<e.length;l++)o=o.children?.[e[l]],i.push(o);return i}function Ix(n,e){let i=n.view.QueryEditor,o={},l,c=NaN,f=!1,d=NaN,g,m,y=Bx({}),k,C=null,M=null,E=[],F,N,A=(V,le,re,ie)=>F.checked?n.querySuggestions(V,le,re,ie):null,b=new i(A).on("change",V=>N.checked&&e({query:V},!0)),L=n.getQueryEngineInfo(),T=$("div","query-graph-actions"),B=$("div","buttons"),I=$("div","query-input"),R=$("div","query-input-details"),U=$("div","data-query-result"),W=$("div","data-query-result-details"),ne=$("div","query-graph"),q=$("div","query-path"),Z=$("div","form query-editor-form",[ne,q,$("div","query-editor",[b.el])]);b.inp
|
||
|
|
`?ie.setBookmark(ie.posFromIndex(Ee),{widget:$("span","discovery-editor-error"," ")}):ie.markText(ie.posFromIndex(Ee),ie.posFromIndex(Ce),{className:"discovery-editor-error"})}b.setValue(V.query,V.data,V.context),nt(V,"Error",[le.message.split(/\n/)[0].replace(/^(Parse error|Bad input).+/s,"Parse error")]);break}}yt(V)}function yt(V){if(b.outputPanelEl.classList.toggle("details-expanded",f),f){let le=V.state!=="awaiting"&&V.state!=="canceled"&&V.state!=="computing"?V.error||V.computed:NaN;if(le!==d)switch(d=le,V.state){case"awaiting":W.innerHTML='<div class="state-message">Awaiting for all of ancestor queries done<div>';break;case"canceled":W.innerHTML='<div class="state-message">Not available because one of ancestor queries failed<div>';break;case"failed":W.innerHTML='<div class="discovery-error query-error">'+Xe(V.error?.message||"")+"</div>";break;case"successful":W.innerHTML="",n.view.render(W,{view:"struct",expanded:1},d);break}}else d=NaN,W.innerHTML=""}function je(V){let le=V.path.join(" "),re=ne.querySelector(`[data-path="${le}"]`);re&&(re.dataset.state=V.state),E[y.current.length-1]===V&&(Pe(V),Ye(V))}function xe(V,le,re,ie=!1){M&&(M.cancel(),M.computation.state="canceled",M=null);let Ee=!1;if(ie)for(let Ce=V;Ce<y.current.length;Ce++){let be=E[Ce];be.state!=="computing"&&je(be)}for(let Ce=V;Ce<y.current.length;Ce++){let be=E[Ce],$e=Ce===y.current.length-1;if(be.state==="awaiting"&&(be.state="computing"),be.state==="failed"?Ee=!0:Ee&&(be.state="canceled"),be.state!=="computing"){if(le=be.computed,re=be.context,je(be),$e)return Promise.resolve(be);continue}return new Promise((Me,Ue)=>{be.data=le,be.context=re,je(be),M={computation:be,cancel:De(()=>{let ut=Date.now();M=null;try{be.computed=n.query(be.query,be.data,be.context),be.state="successful"}catch(at){be.error=at,be.state="failed"}be.duration=Date.now()-ut,xe(Ce,le,re).then(Me,Ue)})}})}return Promise.reject("No computation found")}function we(V,le){let re=nl(y,y.current).slice(1),ie=-1,Ee=null;for(let Ce=0;Ce<y.current.length;Ce++){let be=re[Ce],$e=E[Ce]||{},Ue=Ce===y.current.length-1?g:be.query,ut=y.current.slice(0,Ce+1);if(ie===-1&&$e.query===Ue&&$e.data===V&&$e.context===le&&String($e.path)===String(ut)){V=$e.computed,Ee=$e.error;continue}let at=E[Ce]={state:"awaiting",path:y.current.slice(0,Ce+1),query:Ue||"",data:void 0,context:void 0,computed:void 0,error:null,duration:0};if(Ee){at.state="canceled";continue}if(ie===-1){ie=Ce,at.state="computing",at.data=V,at.context=le;continue}}return ie!==-1?E.slice(ie,y.current.length):[]}return{el:Z,createSubquery:X,appendToQuery(V){let le=typeof g=="string"&&g.trimRight()!==""?g.replace(/(\n[ \t]*)*$/,()=>`
|
||
|
|
| `+V):V;ee({query:le},!0,!0)},perform(V,le){let re=tl(le,k),ie=Ri(le),Ee=ie.query,Ce=ie.view,be=Bx({...ie.graph||o});T.classList.toggle("root",be.current.length<2),ne.innerHTML="",MT(ne,be,n),q.innerHTML="";for(let $e of nl(be,be.current).slice(1,-1))q.append($("div","query",$e.query||""));return y=be,k=re,g=Ee,m=Ce,we(V,re),xe(0,V,re,!0)}}}var Px=z(()=>{Oe();Qt();Fr();fs()});function rl(n){return!!(n&&n.nodeType===Node.TEXT_NODE)}function Xf(n,e=`
|
||
|
|
`){let i="";for(let o of n.childNodes)!rl(o)&&o.previousSibling&&!rl(o.previousSibling)&&(i+=e),i+=LT(o,e);return i}function LT(n,e=`
|
||
|
|
`){switch(n.nodeType){case Node.ELEMENT_NODE:let[i,o=""]=n.cloneNode().outerHTML.split(/(?=<\/[^>]+>$)/);return i+(n.firstChild&&!rl(n.firstChild)?e+" ":"")+Xf(n,e+" ")+(n.lastChild&&!rl(n.lastChild)?e:"")+o;case Node.TEXT_NODE:return n.nodeValue;case Node.COMMENT_NODE:return"<!--"+n.nodeValue+"-->";case Node.DOCUMENT_FRAGMENT_NODE:return Xf(n,e)}return""}function jx(n,e){let i=[],o=[...Array.isArray(n.highlight)?n.highlight:n.highlight?[n.highlight]:[]];Array.isArray(n.highlightProps)&&o.push(`(")?(?:${n.highlightProps.join("|")})\\1(?=:)`);for(let l of o){let c=new RegExp(l,"gm"),f;for(;f=c.exec(e);)i.push({range:[f.index,f.index+f[0].length]})}return i}function il(n){let e={view:"context",modifiers:[{view:"switch",when:"beforeDemo",content:[{when:({beforeDemo:i})=>typeof i=="string",content:'html:"<p>" + beforeDemo + "</p>"'},{content:{view:"render",config:"beforeDemo",context:"{ __demoContext: true, ...(viewDef | { name, group, options }) }"}}]},{view:"block",when:"demo or view",className:"usage-render",postRender:(i,{onInit:o},{demoFixed:l})=>{l&&(i.classList.add("demo-fixed"),i.style.height=l+"px"),o(i,"root")},content:{view:"render",config:"demo or view",data:"demoData",context:"{ __demoContext: true, ...(viewDef | { name, group, options }) }"}},{view:"switch",when:"afterDemo",content:[{when:({afterDemo:i})=>typeof i=="string",content:'html:"<p>" + afterDemo + "</p>"'},{content:{view:"render",config:"afterDemo",context:"{ __demoContext: true, ...(viewDef | { name, group, options }) }"}}]}],content:{view:"tabs",when:"source != false",className:"usage-sources",name:"code",tabs:[{value:"config",text:"Config (JS)"},{value:"config-json",text:"Config (JSON)"},{value:"html",text:"Rendered HTML"}],content:{view:"switch",content:[{when:'#.code="config"',content:[{view:"expand",when:'"demoData" in $',header:'text:"Input data"',content:{view:"struct",expanded:2,data:"demoData"}},{view:"source",className:"first-tab",data:i=>{let o=ar(i.demo||i.view);return{syntax:"discovery-view",content:o,refs:jx(i,o)}}}]},{when:'#.code="config-json"',content:[{view:"expand",when:'"demoData" in $',header:'text:"Input data"',content:{view:"struct",expanded:2,data:"demoData"}},{view:"source",data:i=>{let o=JSON.stringify(i.demo||i.view,null,4);return{syntax:"json",content:o,refs:jx(i,o)}}}]},{when:'#.code="html"',content:{view:"source",data:(i,o)=>({syntax:"html",content:Xf(o.root)})}}]}}};return{view:"block",className:"discovery-view-usage",data({name:i,options:o},l){let c=[...n.view.values].filter(f=>f.options.usage===o.usage).map(f=>f.name);return c.includes(i)||c.unshift(i),l.viewDef={demo:{view:i,data:'"'+i+'"'},...typeof o.usage=="function"?o.usage(i,c):Array.isArray(o.usage)?{examples:o.usage}:o.usage,name:i,group:c,options:o}},content:["h1:name",e,{view:"list",data:"examples",whenData:!0,itemConfig:{className:"usage-section"},item:["h2{ anchor: true, data: title }",e]}]}}var ed=z(()=>{es()});function FT(n,e,i){return $("div",{class:"discovery-editor-tab",onclick:()=>i({view:e})},n||"Untitled preset")}function Rx(n,e){let i=n.view.ViewEditor,o=TT,l={},c,f,d,g,m,y=new i().on("change",E=>m.checked&&e({view:E},!0)),k=$("div","buttons"),C=$("div","form view-editor-form",[$("div","view-editor-form-header",[$("div","discovery-editor-tabs view-mode",g=["Default","Custom"].map(E=>$("div",{class:"discovery-editor-tab","data-mode":E.toLowerCase(),onclick(){this.classList.contains("active")?e({viewEditorHidden:!C.classList.contains("hide-editor")},!0):e({view:E==="Default"?void 0:zx,viewEditorHidden:!1},!0)}},E==="Custom"?[E,$("span","show-view-editor-toggle")]:E))),$("div","discovery-editor-tabs presets",o.map(({name:E,content:F})=>FT(E,F,e))),$("div","view-editor-form-header-links",'<a href="#views-showcase" class="view-link">Views showcase</a>')]),$("div","view-editor-form-content",[$("button",{class:"view-button formatting",title:"Prettify (input should be a JSON)",onclick(){y.focus();try{let E=y.getValue().trim(),F=new Function("return 0,"+E)();e({view:ar(F)})}catch(E){n.logger.error("View editor prettify failed:",E)}}}),y.el,$("div","edit
|
||
|
|
view: 'struct',
|
||
|
|
expanded: 1
|
||
|
|
}`,TT=[{name:"Table",content:ar({view:"table"})},{name:"Auto-link list",content:ar({view:"ol",item:"auto-link"})},{name:"Signature",content:ar({view:"signature",expanded:2})}]});function qx(n){function e(m,y){return n.setPageParams({...n.pageParams,...m},y)}function i(){if(f!==null)return f;let m=Fx(n,e),y=Ix(n,e),k=Rx(n,e),C=$("div",{class:"discovery-editor discovery-hidden-in-dzen",hidden:!0},[y.el,k.el]),M=$("div","discovery-render-content"),E=[...m.el,C,M];return f={header:m,queryEditor:y,viewEditor:k,discoverEditorEl:C,discoverContentEl:M,layout:E}}function o(m){return m===g}function l(m,y){o(y)&&i().queryEditor.createSubquery(m)}function c(m,y){o(y)&&i().queryEditor.appendToQuery(m)}let f=null,d=null,g=NaN;n.on("pageStateChange",m=>{n.pageId!==m.id&&(n.pageId===n.discoveryPageId?(n.action.define("queryAcceptChanges",o),n.action.define("querySubquery",l),n.action.define("queryAppend",c)):(n.action.revoke("queryAcceptChanges"),n.action.revoke("querySubquery"),n.action.revoke("queryAppend")))}),n.page.define("discovery",function(m,y,k){let{header:C,queryEditor:M,viewEditor:E,discoverEditorEl:F,discoverContentEl:N}=i();F.hidden=k.params.noedit,C.render(y,k),g=NaN;let A=d=Symbol("last-query-request");M.perform(y,k).then(b=>{if(d===A){if(b.error){E.el.hidden=!0,N.hidden=!0;return}g=b.computed,E.el.hidden=!1,N.hidden=!1,E.render(g,k,N)}})},{reuseEl:!0,init(m){i().layout.forEach(y=>m.appendChild(y))},encodeParams:Mx,decodeParams:Lx})}var _x=z(()=>{Oe();fs();Nx();Px();Hx()});var Wx,$x=z(()=>{Wx=`
|
||
|
|
## Working with views
|
||
|
|
|
||
|
|
In Discovery.js, presentations are organized as a tree of views. Views are defined using object notation, where the \`view\` property specifies the type, and additional properties allow further customization.
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: "view-name"
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
A view definition takes \`data\` and \`context\` values, which can be used to define properties and control rendering. Views can transform data and context (using the \`data\` and \`context\` properties) for use by the view and its descendant views, enabling clear data flow. Views are rendered by calling the render method:
|
||
|
|
|
||
|
|
\`\`\`js
|
||
|
|
discovery.render(containerEl, viewDefinition, data, context)
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
Discovery.js is designed to be declarative. For dynamic calculations or event handling, [jora](https://discoveryjs.github.io/jora/) queries are preferred over JavaScript functions.
|
||
|
|
|
||
|
|
Each view can use the following properties:
|
||
|
|
|
||
|
|
- \`view\` (required) \u2014 Specifies the view type.
|
||
|
|
- \`when\` \u2014 Controls whether the view should be rendered. Evaluated before \`data\` transformation.
|
||
|
|
- \`context\` \u2014 Transforms the input context for the view and its nested views.
|
||
|
|
- \`data\` \u2014 Transforms the input data for the view and its nested views.
|
||
|
|
- \`whenData\` \u2014 Controls rendering based on the computed \`data\`. Evaluated after \`context\` and \`data\` are set.
|
||
|
|
- \`className\` \u2014 Adds CSS class name(s) to the root element of the view (see [ClassName](#!classname)).
|
||
|
|
- \`postRender\` \u2014 A function executed after rendering the view but before placing it in the DOM.
|
||
|
|
- \`tooltip\` \u2014 Sets up a tooltip for the view (only applicable to views with a container element, see [Tooltips](#!tooltips)).
|
||
|
|
|
||
|
|
The sequence of property evaluation during rendering (view render lifecycle):
|
||
|
|
|
||
|
|
\`\`\`
|
||
|
|
[start] render(data, context)
|
||
|
|
\\ | |
|
||
|
|
* when() | | stop rendering when value is falsy
|
||
|
|
|\\ | |
|
||
|
|
| * context() ------------|-----* (async) replace \`context\` with new value
|
||
|
|
| \\ | |
|
||
|
|
| * data() -------------* | (async) replace \`data\` with new value
|
||
|
|
| \\ | |
|
||
|
|
| * whenData() | | stop rendering when value is falsy
|
||
|
|
| |\\ | |
|
||
|
|
| | * (render) | | (async) main render logic
|
||
|
|
| | \\ | |
|
||
|
|
| | * postRender() | | do something once (render) is done
|
||
|
|
| | \\ | |
|
||
|
|
| | * className() | | compute className and apply to root element
|
||
|
|
| | \\ V V
|
||
|
|
+-----+-----> * [finish render]
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
- \`context\` and \`data\` \u2014 Modify the flow of context or data based on the provided value:
|
||
|
|
- **String** \u2014 Treated as a jora query, and its result is used.
|
||
|
|
- **Function** (\`fn(data, context)\`) \u2014 The result of the function invocation is used.
|
||
|
|
- **Other values** \u2014 Directly used as a new value for data or context.
|
||
|
|
- \`when\` and \`whenData\` \u2014 Determine if a view should be rendered:
|
||
|
|
- **String** \u2014 Treated as a jora query.
|
||
|
|
- \`true\` \u2014 Evaluated as an empty query, meaning the data itself is tested for truthiness.
|
||
|
|
- \`undefined\` \u2014 Treated as not specified, allowing rendering.
|
||
|
|
- **Function** (\`fn(data, context)\`) or other values \u2014 Evaluated for truthiness.
|
||
|
|
> Note: In jora, empty arrays and objects with no own keys are falsy, unlike JavaScript where they are truthy.
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: 'list',
|
||
|
|
data: 'some.list.sort(name asc)', // Fetch an array for the list view, based on current data
|
||
|
|
whenData: 'size() > 0', // Check if the array has elements, skip rendering if empty
|
||
|
|
item: 'text:name' // Render each element as text, displaying the name
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
## Computable property values
|
||
|
|
|
||
|
|
If a property starts with \`=\`, it indicates a jora query used to compute the property's value before a rendering.
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: 'list',
|
||
|
|
limit: '=size() <= 12 ? false : 10' // Dynamically computes the limit based on flow data
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
> To pass a literal string that starts with \`=\`, use a query like \`'="=some string"'\`.
|
||
|
|
|
||
|
|
## Shorthand notations
|
||
|
|
|
||
|
|
Discovery.js supports shorthand notations for defining views, making the configuration more concise:
|
||
|
|
|
||
|
|
| Shorthand notation | Expanded form |
|
||
|
|
| --------------------------------------- | -------------------------------------------------- |
|
||
|
|
| \`'name'\` | \`{ view: 'name' }\` |
|
||
|
|
| \`'name:<query>'\` | \`{ view: 'name', data: '<query>' }\` |
|
||
|
|
| \`'name{ foo: size() / 2, bar: "qux" }'\` | \`{ view: 'name', foo: '=size() / 2', bar: 'qux' }\` |
|
||
|
|
|
||
|
|
## Lists of views
|
||
|
|
|
||
|
|
Multiple views can be combined into a list using an array:
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: 'list',
|
||
|
|
item: [ // render two views as a content of a list item
|
||
|
|
'text:name',
|
||
|
|
{ view: 'badge', data: 'something.size()' }
|
||
|
|
]
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
## ClassName
|
||
|
|
|
||
|
|
The \`className\` property uses a sequence of transformations to convert its input into a final array of class names. This process can start from different input forms \u2014 such as a jora query, a function, a string, or an array \u2014 and move through each step until a definitive result is obtained. At each stage, the current value is examined and transformed if applicable; if not, the process continues to the next step:
|
||
|
|
|
||
|
|
1. **Jora Query (String Starting with \`=\`)**
|
||
|
|
If the initial value begins with \`=\`, it is treated as a jora query and compiled into a function. That function is then processed as described in the next step.
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: "text",
|
||
|
|
className: "=isValid ? 'valid' : 'invalid'"
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
<br>
|
||
|
|
|
||
|
|
2. **Function**
|
||
|
|
Once a function is available (either provided directly or obtained from a jora query) it is called with \`(data, context)\`. The return value can be a string or an array, otherwise discarded.
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: "text",
|
||
|
|
className: (data, context) => data.flag ? "highlighted" : null
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
<br>
|
||
|
|
|
||
|
|
3. **String**
|
||
|
|
Any string (obtained from the previous steps or provided directly) is trimmed and split by whitespace to produce an array of class names, excluding empty entries.
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: "text",
|
||
|
|
className: "primary emphasized"
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
<br>
|
||
|
|
|
||
|
|
4. **Array**
|
||
|
|
When the value is or becomes an array, each element is processed:
|
||
|
|
- If an element is a function, it is called with \`(data, context)\` and its result replaces the function.
|
||
|
|
- All falsy or empty results are removed.
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: "text",
|
||
|
|
className: [
|
||
|
|
"base-class",
|
||
|
|
data => data.error && "error-indicator",
|
||
|
|
""
|
||
|
|
]
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
If \`data.error\` is true, this may result in \`class="base-class error-indicator"\`. If \`data.error\` is false, the array would become \`["base-class", false, ""]\`, and after filtering out falsy and empty values, it results in \`class="base-class"\`.
|
||
|
|
|
||
|
|
If, after all steps, there are no valid class names, the \`class\` attribute is not applied. This cascading process ensures any initial input \u2014 jora query, function, string, or array \u2014 is consistently transformed into a meaningful final list of class names.
|
||
|
|
|
||
|
|
## Tooltips
|
||
|
|
|
||
|
|
Tooltips can be configured using a simple view definition or an object with additional settings. When the \`tooltip\` value is a view definition, it becomes the \`content\` of the tooltip.
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: 'button',
|
||
|
|
tooltip: 'md:"Some **content**"'
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
\`\`\`discovery-view
|
||
|
|
{
|
||
|
|
view: 'button',
|
||
|
|
tooltip: {
|
||
|
|
position: 'trigger',
|
||
|
|
content: 'md:"Some **content**"'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
| Tooltip value | Normalized tooltip config |
|
||
|
|
| --------------------------------- | ---------------------------------------------- |
|
||
|
|
| \`'shorthand-view-notation'\` | \`{ content: 'shorthand-view-notation' }\` |
|
||
|
|
| \`{ view: 'name', ... }\` | \`{ content: { view: 'name', ... } }\` |
|
||
|
|
| \`['view', { view: 'name', ... }]\` | \`{ content: ['view', { view: 'name', ... }] }\` |
|
||
|
|
|
||
|
|
Tooltip options:
|
||
|
|
|
||
|
|
- \`className\` \u2014 Additional class names for the tooltip element.
|
||
|
|
- \`position\` \u2014 Where the tooltip is positioned. Options are \`'trigger'\` or \`'pointer'\` (default).
|
||
|
|
- \`positionMode\` \u2014 Positioning mode. Options are \`'natural'\` (default) or \`'safe'\`.
|
||
|
|
- \`pointerOffsetX\` \u2014 Horizontal offset from the pointer (default: 3).
|
||
|
|
- \`pointerOffsetY\` \u2014 Vertical offset from the pointer (default: 3).
|
||
|
|
- \`showDelay\` \u2014 Delay before showing the tooltip. Options are \`true\` (300ms, default), \`false\` (0ms), a number, or a function that returns a boolean or numeric value.
|
||
|
|
- \`content\` \u2014 View configuration for tooltip content.
|
||
|
|
`});function Ux(n){n.on("pageAnchorChange",e=>{if(n.pageId==="views-showcase"&&e&&!n.pageAnchor){let i=n.dom.content.querySelector(".page-views-showcase > .content");i&&(i.scrollTop=0)}}),n.page.define("views-showcase",{view:"context",data:()=>[...n.view.values],modifiers:[{view:"block",className:"sidebar",content:[{view:"link",className:"index-page-link",href:'="".pageLink(#.page)',text:"Index page"},{view:"content-filter",content:{view:"menu",name:"view",limit:!1,emptyText:"Nothing matched",item:"text-match:{ text: name, match: #.filter }",data:`
|
||
|
|
.[name ~= #.filter]
|
||
|
|
.sort(name asc)
|
||
|
|
.({ ..., disabled: no options.usage })
|
||
|
|
`}}]}],content:{view:"block",className:"content",data:"$[=> name=(#.view.name or #.id)]",content:{view:"switch",content:[{when:"no $ and #.id",content:'alert-warning:"View \\"" + #.id + "\\" not found"'},{when:"no $",content:['h1:"Views showcase"','alert:"\u2190 Select a view to get details"',{view:"markdown",source:Wx}]},{content:[{view:"context",postRender(e,i,o,l){n.overridePageHashStateWithAnchor({ref:o.name,anchor:n.pageRef===o.name?n.pageAnchor:null}),n.cancelScheduledRender(),l.id=n.pageRef}},il(n)]}]}}},{sidebar:!1})}var Gx=z(()=>{ed();$x()});var ol={};Fe(ol,{default:()=>Cx,discovery:()=>qx,notFound:()=>Ax,viewsShowcase:()=>Ux});var td=z(()=>{Dx();Sx();_x();Gx()});function nd(n,e,i){i?n.dataset[e]=i:delete n.dataset[e]}function IT(n,e,i,o){let l=n.page.get(e)?.options;return l!==void 0&&Ae(l,i)?l[i]:o}function Yx(n,e,i,o){let l=IT(n,e,i,o);return typeof l=="function"?l:o}var NT,Vx,OT,BT,ds,rd=z(()=>{Oe();ea();Wo();st();Hc();er();yi();Wc();ey();Qc();ty();tf();Qf();td();Ho();NT=["nav","sidebar","page"],Vx=()=>{},OT=n=>n,BT=n=>Object.fromEntries(n);ds=class extends $o{compact;colorScheme;inspectMode;view;nav;preset;page;#e;#t;defaultPageId;discoveryPageId;reportToDiscoveryRedirect;pageId;pageRef;pageParams;pageAnchor;pageHash;dom;queryExtensions;constructor(e){let{container:i,styles:o,extensions:l,logLevel:c,compact:f,darkmode:d="light-only",darkmodePersistent:g=!1,colorScheme:m=d,colorSchemePersistent:y=g,defaultPage:k,defaultPageId:C,discoveryPageId:M,reportToDiscoveryRedirect:E=!0,inspector:F=!1}=e||{};super({...e,logLevel:c||"perf",extensions:void 0}),("darkmode"in e||"darkmodePersistent"in e)&&this.logger.warn('ViewModel "darkmode" option is deprecated, use "colorScheme" instead'),this.compact=!!f,this.colorScheme=new Zs(m,y),this.inspectMode=new Et(!1),this.initDom(o),this.view=new Ba(this),this.nav=new Oa(this),this.preset=new Pa(this.view),this.page=new Ia(this,this.view),this.#e=new Set,this.#t=16,this.defaultPageId=C||"default",this.discoveryPageId=M||"discovery",this.reportToDiscoveryRedirect=!!E,this.pageId=this.defaultPageId,this.pageRef=null,this.pageParams={},this.pageAnchor=null,this.pageHash=this.encodePageHash(this.pageId,this.pageRef,this.pageParams,this.pageAnchor),this.apply(Xa),this.apply(ol),k&&this.page.define(this.defaultPageId,k),F&&this.apply(ef),this.apply(l),this.setPageHash(this.pageHash),this.setContainer(i),this.scheduleRender();for(let{name:N,page:A}of this.objectMarkers.values)A&&!this.page.isDefined(A)&&this.logger.error(`Page reference "${A}" in object marker "${N}" doesn't exist`)}initRenderTriggers(){this.on("context",()=>this.scheduleRender()),this.on("unloadData",()=>this.scheduleRender()),this.on("pageStateChange",()=>this.scheduleRender()),this.on("pageAnchorChange",()=>this.applyPageAnchor()),this.action.on("define",()=>this.scheduleRender()).on("revoke",()=>this.scheduleRender()),this.page.on("define",e=>{this.pageId===e&&(this.setPageHash(this.pageHash),this.scheduleRender("page"))})}async setData(e,i){let{render:o=!0}=i||{};await super.setData(e,i),o&&this.scheduleRender()}async setDataProgress(e,i,o){let{dataset:l,progressbar:c}=o||{};this.cancelScheduledRender(),this.emit("startSetData",(...f)=>c?.subscribeSync(...f)||(()=>{})),await c?.setState({stage:"prepare"}),await this.setData(e,{dataset:l,setPrepareWorkTitle:c?.setStateStep.bind(c),render:!1}),await c?.setState({stage:"initui"}),this.scheduleRender(),await Promise.all([this.dom.wrapper.parentNode?this.dom.ready:!0,this.enforceScheduledRenders()]),c?.finish()}queryToConfig(e,i){let{ast:o}=Xt.syntax.parse(i),l={view:e};if(o.type!=="Block")throw new SyntaxError('[Discovery] ViewModel#queryToConfig(): query root must be a "Block"');if(o.body.type!=="Object")throw new SyntaxError('[Discovery] ViewModel#queryToConfig(): query root must return an "Object"');for(let c of o.body.properties){if(c.type!=="ObjectEntry")throw new SyntaxError('[Discovery] ViewModel#queryToConfig(): unsupported object entry type "'+c.type+'"');let f,d=c.value;switch(c.key.type){case"Literal":f=c.key.value;break;cas
|
||
|
|
</script>
|
||
|
|
</body>
|