webui: Add option to pre-encode conversation for faster next turns (#21034)
This commit is contained in:
1 parent
b54cb2e3d0
commit
75511a8d7e
7 files changed
+267
-81
No files matched your search
@@ -1,18 +1,18 @@
|
||||
var Z3=t=>{throw TypeError(t)};var iv=(t,e,r)=>e.has(t)||Z3("Cannot "+r);var ba=(t,e,r)=>(iv(t,e,"read from private field"),r?r.call(t):e.get(t)),El=(t,e,r)=>e.has(t)?Z3("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),_s=(t,e,r,n)=>(iv(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),vl=(t,e,r)=>(iv(t,e,"access private method"),r);var J3=(t,e,r,n)=>({set _(a){_s(t,e,a,r)},get _(){return ba(t,e,n)}});var Yf=Array.isArray,AV=Array.prototype.indexOf,Tp=Array.prototype.includes,eS=Array.from,W2=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,H8=Object.getOwnPropertyDescriptors,Y8=Object.prototype,RV=Array.prototype,tS=Object.getPrototypeOf,eD=Object.isExtensible;function Uh(t){return typeof t=="function"}const Ge=()=>{};function OV(t){return t()}function AA(t){for(var e=0;e<t.length;e++)t[e]()}function V8(){var t,e,r=new Promise((n,a)=>{t=n,e=a});return{promise:r,resolve:t,reject:e}}function NV(t,e,r=!1){return t===void 0?r?e():e:t}function K2(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const r=[];for(const n of t)if(r.push(n),r.length===e)break;return r}const ui=2,ff=4,Vf=8,j2=1<<24,Kl=16,Jc=32,Xu=64,Q2=128,xo=512,Yi=1024,Wi=2048,eu=4096,io=8192,xc=16384,Wf=32768,zl=65536,RA=1<<17,X2=1<<18,ch=1<<19,W8=1<<20,Oc=1<<25,eh=32768,OA=1<<21,Z2=1<<22,Du=1<<23,Fl=Symbol("$state"),J2=Symbol("legacy props"),IV=Symbol(""),Zh=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},xV=1,rS=3,tu=8;function K8(t){throw new Error("https://svelte.dev/e/experimental_async_required")}function Kp(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function DV(){throw new Error("https://svelte.dev/e/missing_context")}function MV(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function kV(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function PV(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function LV(t){throw new Error("https://svelte.dev/e/effect_orphan")}function FV(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function BV(){throw new Error("https://svelte.dev/e/fork_discarded")}function UV(){throw new Error("https://svelte.dev/e/fork_timing")}function GV(){throw new Error("https://svelte.dev/e/get_abort_signal_outside_reaction")}function qV(){throw new Error("https://svelte.dev/e/hydration_failed")}function j8(t){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function zV(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function $V(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function HV(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function YV(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function VV(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const WV=1,KV=2,Q8=4,jV=8,QV=16,XV=1,ZV=2,JV=4,eW=8,tW=16,rW=1,nW=2,aW=4,iW=1,sW=2,X8="[",nS="[!",eO="]",th={},_i=Symbol(),oW="http://www.w3.org/1999/xhtml",lW="http://www.w3.org/2000/svg",Z8="@attach";function cW(t){console.warn("https://svelte.dev/e/hydratable_missing_but_expected")}function Kf(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function uW(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function dW(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let Nr=!1;function cs(t){Nr=t}let tn;function Ga(t){if(t===null)throw Kf(),th;return tn=t}function Po(){return Ga(uo(tn))}function Y(t){if(Nr){if(uo(tn)!==null)throw Kf(),th;tn=t}}function et(t=1){if(Nr){for(var e=t,r=tn;e--;)r=uo(r);tn=r}}function L1(t=!0){for(var e=0,r=tn;;){if(r.nodeType===tu){var n=r.data;if(n===eO){if(e===0)return r;e-=1}else(n===X8||n===nS)&&(e+=1)}var a=uo(r);t&&r.remove(),r=a}}function J8(t){if(!t||t.nodeType!==tu)throw Kf(),th;return t.data}function eF(t){return t===this.v}function tO(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function tF(t){return!tO(t,this.v)}let jp=!1;function hW(){jp=!0}const pW=[];function sp(t,e=!1,r=!1){return b1(t,new Map,"",pW,null,r)}function b1(t,e,r,n,a=null,i=!1){if(typeof t=="object"&&t!==null){var s=e.get(t);if(s!==void 0)return s;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(Yf(t)){var o=Array(t.length);e.set(t,o),a!==null&&e.set(a,o);for(var l=0;l<t.length;l+=1){var c=t[l];l in t&&(o[l]=b1(c,e,r,n,null,i))}return o}if(tS(t)===Y8){o={},e.set(t,o),a!==null&&e.set(a,o);for(var u in t)o[u]=b1(t[u],e,r,n,null,i);return o}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function"&&!i)return b1(t.toJSON(),e,r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}let qn=null;function Cp(t){qn=t}function mW(){const t={};return[()=>(aS(t)||DV(),$l(t)),e=>Zu(t,e)]}function $l(t){return iS().get(t)}function Zu(t,e){return iS().set(t,e)Line truncated
|
||||
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw s;return s!==th&&console.warn("Failed to hydrate: ",s),e.recover===!1&&qV(),MA(),sO(r),cs(!1),uS(t,e)}finally{cs(n),Ga(a)}}const Rh=new Map;function zF(t,{target:e,anchor:r,props:n={},events:a,context:i,intro:s=!0}){MA();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var m=d[h];if(!o.has(m)){o.add(m);var f=$W(m);e.addEventListener(m,qm,{passive:f});var g=Rh.get(m);g===void 0?(document.addEventListener(m,qm,{passive:f}),Rh.set(m,1)):Rh.set(m,g+1)}}};l(eS(GF)),PA.add(l);var c=void 0,u=xW(()=>{var d=r??e.appendChild(Vi());return vW(d,{pending:()=>{}},h=>{if(i){ye({});var m=qn;m.c=i}if(a&&(n.$$events=a),Nr&&Ds(h,null),U1=s,c=t(h,n)||{},U1=!0,Nr&&(Pn.nodes.end=tn,tn===null||tn.nodeType!==tu||tn.data!==eO))throw Kf(),th;i&&Te()}),()=>{for(var h of o){e.removeEventListener(h,qm);var m=Rh.get(h);--m===0?(document.removeEventListener(h,qm),Rh.delete(h)):Rh.set(h,m)}PA.delete(l),d!==r&&d.parentNode?.removeChild(d)}});return LA.set(c,u),c}let LA=new WeakMap;function dO(t,e){const r=LA.get(t);return r?(LA.delete(t),r(e)):Promise.resolve()}class eg{anchor;#e=new Map;#t=new Map;#r=new Map;#n=new Set;#i=!0;constructor(e,r=!0){this.anchor=e,this.#i=r}#a=()=>{var e=Hn;if(this.#e.has(e)){var r=this.#e.get(e),n=this.#t.get(r);if(n)lO(n),this.#n.delete(r);else{var a=this.#r.get(r);a&&(this.#t.set(r,a.effect),this.#r.delete(r),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),n=a.effect)}for(const[i,s]of this.#e){if(this.#e.delete(i),i===e)break;const o=this.#r.get(s);o&&(Ei(o.effect),this.#r.delete(s))}for(const[i,s]of this.#t){if(i===r||this.#n.has(i))continue;const o=()=>{if(Array.from(this.#e.values()).includes(i)){var c=document.createDocumentFragment();xF(s,c),c.append(Vi()),this.#r.set(i,{effect:s,fragment:c})}else Ei(s);this.#n.delete(i),this.#t.delete(i)};this.#i||!n?(this.#n.add(i),Zd(s,o,!1)):o()}}};#s=e=>{this.#e.delete(e);const r=Array.from(this.#e.values());for(const[n,a]of this.#r)r.includes(n)||(Ei(a.effect),this.#r.delete(n))};ensure(e,r){var n=Hn,a=bF();if(r&&!this.#t.has(e)&&!this.#r.has(e))if(a){var i=document.createDocumentFragment(),s=Vi();i.append(s),this.#r.set(e,{effect:Rs(()=>r(s)),fragment:i})}else this.#t.set(e,Rs(()=>r(this.anchor)));if(this.#e.set(n,e),a){for(const[o,l]of this.#t)o===e?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===e?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#a),n.ondiscard(this.#s)}else Nr&&(this.anchor=tn),this.#a()}}function le(t,e,r=!1){Nr&&Po();var n=new eg(t),a=r?zl:0;function i(s,o){if(Nr){const c=J8(t)===nS;if(s===c){var l=L1();Ga(l),n.anchor=l,cs(!1),n.ensure(s,o),cs(!0);return}}n.ensure(s,o)}ed(()=>{var s=!1;e((o,l=!0)=>{s=!0,i(l,o)}),s||i(!1,null)},a)}function WW(t,e,r){Nr&&Po();var n=new eg(t),a=!Qp();ed(()=>{var i=e();a&&i!==null&&typeof i=="object"&&(i={}),n.ensure(i,r)})}function ku(t,e){return e}function KW(t,e,r){for(var n=[],a=e.length,i,s=e.length,o=0;o<a;o++){let d=e[o];Zd(d,()=>{if(i){if(i.pending.delete(d),i.done.add(d),i.pending.size===0){var h=t.outrogroups;FA(eS(i.done)),h.delete(i),h.size===0&&(t.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=n.length===0&&r!==null;if(l){var c=r,u=c.parentNode;sO(u),u.append(c),t.items.clear()}FA(e,!l)}else i={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(i)}function FA(t,e=!0){for(var r=0;r<t.length;r++)Ei(t[r],e)}var oD;function xr(t,e,r,n,a,i=null){var s=t,o=new Map,l=(e&Q8)!==0;if(l){var c=t;s=Nr?Ga(xi(c)):c.appendChild(Vi())}Nr&&Po();var u=null,d=oS(()=>{var _=r();return Yf(_)?_:_==null?[]:eS(_)}),h,m=!0;function f(){b.fallback=u,jW(b,h,s,e,n),u!==null&&(h.length===0?(u.f&Oc)===0?lO(u):(u.f^=Oc,zm(u,null,s)):Zd(u,()=>{u=null}))}var g=ed(()=>{h=p(d);var _=h.length;let S=!1;if(Nr){var E=J8(s)===nS;E!==(_===0)&&(s=L1(),Ga(s),cs(!1),S=!0)}for(var y=new Set,v=Hn,T=bF(),w=0;w<_;w+=1){Nr&&tn.nodeType===tu&&tn.data===eO&&(s=tn,S=!0,cs(!1));var A=h[w],I=n(A,w),x=m?null:o.get(I);x?(x.v&&Ap(x.v,A),x.i&&Ap(x.i,w),T&&v.skipped_effects.delete(x.e)):(x=QW(o,m?s:oD??=Vi(),A,I,w,a,e,r),m||(x.e.f|=Oc),o.set(I,x)),y.add(I)}if(_===0&&i&&!u&&(m?u=Rs(()=>i(s)):(u=Rs(()=>i(oD??=Vi())),u.f|=Oc)),Nr&&_>0&&Ga(L1()),!m)if(T){for(const[D,$]of o)y.has(D)||v.skipped_effects.add($.e);v.oncommit(f),v.ondiscard(()=>{})}else f();S&&cs(!0),p(d)}),b={effect:g,items:o,outrogroups:null,fallback:u};m=!1,Nr&&(s=tn)}function jW(t,e,r,n,a){var i=(n&jV)!==0,s=e.length,o=t.items,l=t.effect.first,c,u=null,d,h=[],m=[],f,g,b,_;if(i)for(_=0;_<s;_+=1)f=e[_],g=a(f,_),b=o.get(g).e,(b.f&Oc)===0&&(b.nodes?.a?.measure(),(d??=new Set).add(b));for(_=0;_<s;_+=1){if(f=e[_],g=a(f,_),b=o.get(g).e,t.outrogroups!==null)for(const x of t.outrogroups)x.pending.delete(b),x.done.delete(b);if((b.f&Oc)!==0)if(b.f^=Oc,b===l)zm(b,null,r);else{var S=u?u.next:l;b===t.effect.last&&(t.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),pu(t,u,b),pu(t,b,S),zm(b,S,r),u=b,h=[],m=[],l=u.next;continue}if((b.f
Line truncated
|
||||
\r\f \v\uFEFF`];function nK(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var a in r)if(r[a])n=n?n+" "+a:a;else if(n.length)for(var i=a.length,s=0;(s=n.indexOf(a,s))>=0;){var o=s+i;(s===0||cD.includes(n[s-1]))&&(o===n.length||cD.includes(n[o]))?n=(s===0?"":n.substring(0,s))+n.substring(o+1):s=o}}return n===""?null:n}function uD(t,e=!1){var r=e?" !important;":";",n="";for(var a in t){var i=t[a];i!=null&&i!==""&&(n+=" "+a+": "+i+r)}return n}function sv(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function aK(t,e){if(e){var r="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(sv)),a&&l.push(...Object.keys(a).map(sv));var c=0,u=-1;const g=t.length;for(var d=0;d<g;d++){var h=t[d];if(o?h==="/"&&t[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&t[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?s++:h===")"&&s--,!o&&i===!1&&s===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===g-1){if(u!==-1){var m=sv(t.substring(c,u).trim());if(!l.includes(m)){h!==";"&&d++;var f=t.substring(c,d).trim();r+=" "+f+";"}}c=d+1,u=-1}}}}return n&&(r+=uD(n)),a&&(r+=uD(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function Et(t,e,r,n,a,i){var s=t.__className;if(Nr||s!==r||s===void 0){var o=nK(r,n,i);(!Nr||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=r}else if(i&&a!==i)for(var l in i){var c=!!i[l];(a==null||c!==!!a[l])&&t.classList.toggle(l,c)}return i}function ov(t,e={},r,n){for(var a in r){var i=r[a];e[a]!==i&&(r[a]==null?t.style.removeProperty(a):t.style.setProperty(a,i,n))}}function ms(t,e,r,n){var a=t.__style;if(Nr||a!==e){var i=aK(e,n);(!Nr||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}else n&&(Array.isArray(n)?(ov(t,r?.[0],n[0]),ov(t,r?.[1],n[1],"important")):ov(t,r,n));return n}function UA(t,e,r=!1){if(t.multiple){if(e==null)return;if(!Yf(e))return uW();for(var n of t.options)n.selected=e.includes(dD(n));return}for(n of t.options){var a=dD(n);if(RW(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function iK(t){var e=new MutationObserver(()=>{UA(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),dh(()=>{e.disconnect()})}function dD(t){return"__value"in t?t.__value:t.value}const bm=Symbol("class"),Gh=Symbol("style"),VF=Symbol("is custom element"),WF=Symbol("is html");function sK(t){if(Nr){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;rr(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var a=t.checked;rr(t,"checked",null),t.checked=a}}};t.__on_r=r,Do(r),SF()}}function pO(t,e){var r=mO(t);r.value===(r.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function oK(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function rr(t,e,r,n){var a=mO(t);Nr&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||a[e]!==(a[e]=r)&&(e==="loading"&&(t[IV]=r),r==null?t.removeAttribute(e):typeof r!="string"&&KF(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function lK(t,e,r,n,a=!1,i=!1){if(Nr&&a&&t.tagName==="INPUT"){var s=t,o=s.type==="checkbox"?"defaultChecked":"defaultValue";o in r||sK(s)}var l=mO(t),c=l[VF],u=!l[WF];let d=Nr&&c;d&&cs(!1);var h=e||{},m=t.tagName==="OPTION";for(var f in e)f in r||(r[f]=null);r.class?r.class=Hr(r.class):(n||r[bm])&&(r.class=null),r[Gh]&&(r.style??=null);var g=KF(t);for(const T in r){let w=r[T];if(m&&T==="value"&&w==null){t.value=t.__value="",h[T]=w;continue}if(T==="class"){var b=t.namespaceURI==="http://www.w3.org/1999/xhtml";Et(t,b,w,n,e?.[bm],r[bm]),h[T]=w,h[bm]=r[bm];continue}if(T==="style"){ms(t,w,e?.[Gh],r[Gh]),h[T]=w,h[Gh]=r[Gh];continue}var _=h[T];if(!(w===_&&!(w===void 0&&t.hasAttribute(T)))){h[T]=w;var S=T[0]+T[1];if(S!=="$$")if(S==="on"){const A={},I="$$"+T;let x=T.slice(2);var E=UW(x);if(FW(x)&&(x=x.slice(0,-7),A.capture=!0),!E&&_){if(w!=null)continue;t.removeEventListener(x,h[I],A),h[I]=null}if(w!=null)if(E)t[`__${x}`]=w,Bn([x]);else{let D=function($){h[T].call(this,$)};h[I]=uO(x,t,D,A)}else E&&(t[`__${x}`]=void 0)}else if(T==="style")rr(t,T,w);else if(T==="autofocus")OW(t,!!w);else if(!c&&(T==="__value"||T==="value"&&w!=null))t.value=t.__value=w;else if(T==="selected"&&m)oK(t,w);else{var y=T;u||(y=qW(y));var v=y==="defaultValue"||y==="defaultChecked";if(w==null&&!c&&!v)if(l[T]=null,y==="value"||y==="checked"){let A=t;const I=e===void 0;if(y==="value"){let x=A.defaultValue;A.removeAttribute(y),A.defaultValue=x,A.value=A.__value=I?x:null}else{let x=A.defaultChecked;A.removeAttribute(y),A.defaultChecked=x,A.checked=I?x:!1}}else t.removeAttribute(T);else v||g.includes(y)&&(c||typeof w!="string")?(t[y]=w,y in l&&(l[y]=_i)):typeof w!="function"&&rr(t,y,w)}}}return d&&cs(!0),h}function $t(t,e,r=[],n=[],a=[],i,s=!1,o=!1){nO(a,r,n,l=>{var c=void 0,u={},d=t.nodeName=
Line truncated
|
||||
`,c="/",u="*",d="",h="comment",m="declaration";gv=function(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var _=1,S=1;function E(H){var G=H.match(e);G&&(_+=G.length);var K=H.lastIndexOf(l);S=~K?H.length-K:S+H.length}function y(){var H={line:_,column:S};return function(G){return G.position=new v(H),A(),G}}function v(H){this.start=H,this.end={line:_,column:S},this.source=b.source}v.prototype.content=g;function T(H){var G=new Error(b.source+":"+_+":"+S+": "+H);if(G.reason=H,G.filename=b.source,G.line=_,G.column=S,G.source=g,!b.silent)throw G}function w(H){var G=H.exec(g);if(G){var K=G[0];return E(K),g=g.slice(K.length),G}}function A(){w(r)}function I(H){var G;for(H=H||[];G=x();)G!==!1&&H.push(G);return H}function x(){var H=y();if(!(c!=g.charAt(0)||u!=g.charAt(1))){for(var G=2;d!=g.charAt(G)&&(u!=g.charAt(G)||c!=g.charAt(G+1));)++G;if(G+=2,d===g.charAt(G-1))return T("End of comment missing");var K=g.slice(2,G-2);return S+=2,E(K),g=g.slice(G),S+=2,H({type:h,comment:K})}}function D(){var H=y(),G=w(n);if(G){if(x(),!w(a))return T("property missing ':'");var K=w(i),z=H({type:m,property:f(G[0].replace(t,d)),value:K?f(K[0].replace(t,d)):d});return w(s),z}}function $(){var H=[];I(H);for(var G;G=D();)G!==!1&&(H.push(G),I(H));return H}return A(),$()};function f(g){return g?g.replace(o,d):d}return gv}var ID;function xQ(){if(ID)return xh;ID=1;var t=xh&&xh.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(xh,"__esModule",{value:!0}),xh.default=r;var e=t(IQ());function r(n,a){var i=null;if(!n||typeof n!="string")return i;var s=(0,e.default)(n),o=typeof a=="function";return s.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;o?a(c,u,l):u&&(i=i||{},i[c]=u)}}),i}return xh}var DQ=xQ();const xD=ph(DQ),MQ=xD.default||xD,kQ=/\d/,PQ=["-","_","/","."];function LQ(t=""){if(!kQ.test(t))return t!==t.toLowerCase()}function FQ(t){const e=[];let r="",n,a;for(const i of t){const s=PQ.includes(i);if(s===!0){e.push(r),r="",n=void 0;continue}const o=LQ(i);if(a===!1){if(n===!1&&o===!0){e.push(r),r=i,n=o;continue}if(n===!0&&o===!1&&r.length>1){const l=r.at(-1);e.push(r.slice(0,Math.max(0,r.length-1))),r=l+i,n=o;continue}}r+=i,n=o,a=s}return e.push(r),e}function PB(t){return t?FQ(t).map(e=>UQ(e)).join(""):""}function BQ(t){return GQ(PB(t||""))}function UQ(t){return t?t[0].toUpperCase()+t.slice(1):""}function GQ(t){return t?t[0].toLowerCase()+t.slice(1):""}function Ym(t){if(!t)return{};const e={};function r(n,a){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){e[PB(n)]=a;return}if(n.startsWith("--")){e[n]=a;return}e[BQ(n)]=a}return MQ(t,r),e}function Dc(...t){return(...e)=>{for(const r of t)typeof r=="function"&&r(...e)}}function qQ(t,e){const r=RegExp(t,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,e):n}}const zQ=qQ(/[A-Z]/,t=>`-${t.toLowerCase()}`);function $Q(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${zQ(e)}: ${t[e]};`).join(`
|
||||
`)}function LO(t={}){return $Q(t).replace(`
|
||||
`," ")}const HQ=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],YQ=new Set(HQ);function VQ(t){return YQ.has(t)}function Er(...t){const e={...t[0]};for(let r=1;r<t.length;r++){const n=t[r];if(n){for(const a of Object.keys(n)){const i=e[a],s=n[a],o=typeof i=="function",l=typeof s=="function";if(o&&VQ(a)){const c=i,u=s;e[a]=kB(c,u)}else if(o&&l)e[a]=Dc(i,s);else if(a==="class"){const c=ZA(i),u=ZA(s);c&&u?e[a]=nf(i,s):c?e[a]=nf(i):u&&(e[a]=nf(s))}else if(a==="style"){const c=typeof i=="object",u=typeof s=="object",d=typeof i=="string",h=typeof s=="string";if(c&&u)e[a]={...i,...s};else if(c&&h){const m=Ym(s);e[a]={...i,...m}}else if(d&&u){const m=Ym(i);e[a]={...m,...s}}else if(d&&h){const m=Ym(i),f=Ym(s);e[a]={...m,...f}}else c?e[a]=i:u?e[a]=s:d?e[a]=i:h&&(e[a]=s)}else e[a]=s!==void 0?s:i}for(const a of Object.getOwnPropertySymbols(n)){const i=e[a],s=n[a];e[a]=s!==void 0?s:i}}}return typeof e.style=="object"&&(e.style=LO(e.style).replaceAll(`
|
||||
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}const WQ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},KQ=LO(WQ),LB=typeof window<"u"?window:void 0;function jQ(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(r===e)break;e=r}return e}var QQ=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],XQ=["difference","intersection","symmetricDifference","union"],DD=!1;class ds extends Set{#e=new Map;#t=_e(0);#r=_e(0);#n=al||-1;constructor(e){if(super(),e){for(var r of e)super.add(r);this.#r.v=super.size}DD||this.#a()}#i(e){return al===this.#n?_e(e):Uc(e)}#a(){DD=!0;var e=ds.prototype,r=Set.prototype;for(const n of QQ)e[n]=function(...a){return p(this.#t),r[n].apply(this,a)};for(const n of XQ)e[n]=function(...a){p(this.#t);var i=r[n].apply(this,a);return new ds(i)}}has(e){var r=super.has(e),n=this.#e,a=n.get(e);if(a===void 0){if(!r)return p(this.#t),!1;a=this.#i(!0),n.set(e,a)}return p(a),r}add(e){return super.has(e)||(super.add(e),k(this.#r,super.size),eo(this.#t)),this}delete(e){var r=super.delete(e),n=this.#e,a=n.get(e);return a!==void 0&&(n.delete(e),k(a,!1)),r&&(k(this.#r,super.size),eo(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var r of e.values())k(r,!1);e.clear(),k(this.#r,0),eo(this.#t)}}keys(){return this.values()}values(){return p(this.#t),super.values()}entries(){return p(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return p(this.#r)}}class Ii extends Map{#e=new Map;#t=_e(0);#r=_e(0);#n=al||-1;constructor(e){if(super(),e){for(var[r,n]of e)super.set(r,n);this.#r.v=super.size}}#i(e){return al===this.#n?_e(e):Uc(e)}has(e){var r=this.#e,n=r.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),r.set(e,n);else return p(this.#t),!1}return p(n),!0}forEach(e,r){this.#a(),super.forEach(e,r)}get(e){var r=this.#e,n=r.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),r.set(e,n);else{p(this.#t);return}}return p(n),super.get(e)}set(e,r){var n=this.#e,a=n.get(e),i=super.get(e),s=super.set(e,r),o=this.#t;if(a===void 0)a=this.#i(0),n.set(e,a),k(this.#r,super.size),eo(o);else if(i!==r){eo(a);var l=o.reactions===null?null:new Set(o.reactions),c=l===null||!a.reactions?.every(u=>l.has(u));c&&eo(o)}return s}delete(e){var r=this.#e,n=r.get(e),a=super.delete(e);return n!==void 0&&(r.delete(e),k(this.#r,super.size),k(n,-1),eo(this.#t)),a}clear(){if(super.size!==0){super.clear();var e=this.#e;k(this.#r,0);for(var r of e.values())k(r,-1);eo(this.#t),e.clear()}}#a(){p(this.#t);var e=this.#e;if(this.#r.v!==e.size){for(var r of super.keys())if(!e.has(r)){var n=this.#i(0);e.set(r,n)}}for([,n]of this.#e)p(n)}keys(){return p(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return p(this.#r),super.size}}class ZQ{#e;#t;constructor(e,r){this.#e=e,this.#t=Ju(r)}get current(){return this.#t(),this.#e()}}const JQ=/\(.+\)/,eX=new Set(["all","print","screen","and","or","not","only"]);class FB extends ZQ{constructor(e,r){let n=JQ.test(e)||e.split(/[\s,]+/).some(i=>eX.has(i.trim()))?e:`(${e})`;const a=window.matchMedia(n);super(()=>a.matches,i=>Kr(a,"change",i))}}let tX=class{#e;#t;constructor(e={}){const{window:r=LB,document:n=r?.document}=e;r!==void 0&&(this.#e=n,this.#t=Ju(a=>{const i=Kr(r,"focusin",a),s=Kr(r,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?jQ(this.#e):null}};new tX;function BB(t){return typeof t=="function"}function rX(t,e){if(BB(t)){const n=t();return n===void 0?e:n}return t===void 0?e:t}let ka=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return aS(this.#t)}get(){const e=$l(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const r=$l(this.#t);return r===void 0?e:r}set(e){return Zu(this.#t,e)}};function ES(t,e){let r=_e(null);const n=F(()=>rX(e,250));function a(...i){if(p(r))p(r).timeout&&clearTimeout(p(r).timeout);else{let s,o;const l=new Promise((c,u)=>{s=c,o=u});k(r,{timeout:null,runner:null,promise:l,resolve:s,reject:o},!0)}return p(r).runner=async()=>{if(!p(r))return;const s=p(r);k(r,null);try{s.resolve(await t.apply(this,i))}catch(o){s.reject(o)}},p(r).timeout=setTimeout(p(r).runner,p(n)),p(r).promise}return a.cancel=async()=>{(!p(r)||p(r).timeout===null)&&(await new Promise(i=>setTimeout(i,0)),!p(r)||p(r).timeout===null)||(clearTimeout(p(r).timeout),p(r).reject("Cancelled"),k(r,null))},a.runScheduledNow=async()=>{(!p(r)||!p(r).timeout)&&(await new Promise(i=>setTimeout(i,0)),!p(r)||!p(r).timeout)||(clearTimeout(p(r).timeout),p(r).timeout=null,await p(r).runner?.())},Object.defineProperty(a,"pending",{enumerable:!0,get(){return!!p(r)?.timeout}}),a}function nX(t,e){switch(t){c
Line truncated
|
||||
var Z3=t=>{throw TypeError(t)};var sv=(t,e,r)=>e.has(t)||Z3("Cannot "+r);var ba=(t,e,r)=>(sv(t,e,"read from private field"),r?r.call(t):e.get(t)),vl=(t,e,r)=>e.has(t)?Z3("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),_s=(t,e,r,n)=>(sv(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),yl=(t,e,r)=>(sv(t,e,"access private method"),r);var J3=(t,e,r,n)=>({set _(a){_s(t,e,a,r)},get _(){return ba(t,e,n)}});var Yf=Array.isArray,AV=Array.prototype.indexOf,Tp=Array.prototype.includes,tS=Array.from,K2=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,H8=Object.getOwnPropertyDescriptors,Y8=Object.prototype,RV=Array.prototype,rS=Object.getPrototypeOf,eD=Object.isExtensible;function Gh(t){return typeof t=="function"}const Ge=()=>{};function OV(t){return t()}function RA(t){for(var e=0;e<t.length;e++)t[e]()}function V8(){var t,e,r=new Promise((n,a)=>{t=n,e=a});return{promise:r,resolve:t,reject:e}}function NV(t,e,r=!1){return t===void 0?r?e():e:t}function j2(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const r=[];for(const n of t)if(r.push(n),r.length===e)break;return r}const di=2,ff=4,Vf=8,Q2=1<<24,Kl=16,Jc=32,Xu=64,X2=128,Do=512,Wi=1024,ji=2048,eu=4096,io=8192,xc=16384,Wf=32768,zl=65536,OA=1<<17,Z2=1<<18,uh=1<<19,W8=1<<20,Oc=1<<25,th=32768,NA=1<<21,J2=1<<22,Du=1<<23,Fl=Symbol("$state"),eO=Symbol("legacy props"),IV=Symbol(""),Jh=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},xV=1,nS=3,tu=8;function K8(t){throw new Error("https://svelte.dev/e/experimental_async_required")}function Kp(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function DV(){throw new Error("https://svelte.dev/e/missing_context")}function MV(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function kV(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function PV(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function LV(t){throw new Error("https://svelte.dev/e/effect_orphan")}function FV(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function BV(){throw new Error("https://svelte.dev/e/fork_discarded")}function UV(){throw new Error("https://svelte.dev/e/fork_timing")}function GV(){throw new Error("https://svelte.dev/e/get_abort_signal_outside_reaction")}function qV(){throw new Error("https://svelte.dev/e/hydration_failed")}function j8(t){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function zV(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function $V(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function HV(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function YV(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function VV(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const WV=1,KV=2,Q8=4,jV=8,QV=16,XV=1,ZV=2,JV=4,eW=8,tW=16,rW=1,nW=2,aW=4,iW=1,sW=2,X8="[",aS="[!",tO="]",rh={},bi=Symbol(),oW="http://www.w3.org/1999/xhtml",lW="http://www.w3.org/2000/svg",Z8="@attach";function cW(t){console.warn("https://svelte.dev/e/hydratable_missing_but_expected")}function Kf(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function uW(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function dW(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let Nr=!1;function cs(t){Nr=t}let tn;function Ga(t){if(t===null)throw Kf(),rh;return tn=t}function Lo(){return Ga(uo(tn))}function Y(t){if(Nr){if(uo(tn)!==null)throw Kf(),rh;tn=t}}function et(t=1){if(Nr){for(var e=t,r=tn;e--;)r=uo(r);tn=r}}function L1(t=!0){for(var e=0,r=tn;;){if(r.nodeType===tu){var n=r.data;if(n===tO){if(e===0)return r;e-=1}else(n===X8||n===aS)&&(e+=1)}var a=uo(r);t&&r.remove(),r=a}}function J8(t){if(!t||t.nodeType!==tu)throw Kf(),rh;return t.data}function eF(t){return t===this.v}function rO(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function tF(t){return!rO(t,this.v)}let jp=!1;function hW(){jp=!0}const pW=[];function op(t,e=!1,r=!1){return b1(t,new Map,"",pW,null,r)}function b1(t,e,r,n,a=null,i=!1){if(typeof t=="object"&&t!==null){var s=e.get(t);if(s!==void 0)return s;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(Yf(t)){var o=Array(t.length);e.set(t,o),a!==null&&e.set(a,o);for(var l=0;l<t.length;l+=1){var c=t[l];l in t&&(o[l]=b1(c,e,r,n,null,i))}return o}if(rS(t)===Y8){o={},e.set(t,o),a!==null&&e.set(a,o);for(var u in t)o[u]=b1(t[u],e,r,n,null,i);return o}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function"&&!i)return b1(t.toJSON(),e,r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}let qn=null;function Cp(t){qn=t}function mW(){const t={};return[()=>(iS(t)||DV(),$l(t)),e=>Zu(t,e)]}function $l(t){return sS().get(t)}function Zu(t,e){return sS().set(t,e)Line truncated
|
||||
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw s;return s!==rh&&console.warn("Failed to hydrate: ",s),e.recover===!1&&qV(),kA(),oO(r),cs(!1),dS(t,e)}finally{cs(n),Ga(a)}}const Oh=new Map;function zF(t,{target:e,anchor:r,props:n={},events:a,context:i,intro:s=!0}){kA();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var m=d[h];if(!o.has(m)){o.add(m);var f=$W(m);e.addEventListener(m,qm,{passive:f});var g=Oh.get(m);g===void 0?(document.addEventListener(m,qm,{passive:f}),Oh.set(m,1)):Oh.set(m,g+1)}}};l(tS(GF)),LA.add(l);var c=void 0,u=xW(()=>{var d=r??e.appendChild(Ki());return vW(d,{pending:()=>{}},h=>{if(i){ye({});var m=qn;m.c=i}if(a&&(n.$$events=a),Nr&&Ds(h,null),U1=s,c=t(h,n)||{},U1=!0,Nr&&(Pn.nodes.end=tn,tn===null||tn.nodeType!==tu||tn.data!==tO))throw Kf(),rh;i&&Te()}),()=>{for(var h of o){e.removeEventListener(h,qm);var m=Oh.get(h);--m===0?(document.removeEventListener(h,qm),Oh.delete(h)):Oh.set(h,m)}LA.delete(l),d!==r&&d.parentNode?.removeChild(d)}});return FA.set(c,u),c}let FA=new WeakMap;function hO(t,e){const r=FA.get(t);return r?(FA.delete(t),r(e)):Promise.resolve()}class eg{anchor;#e=new Map;#t=new Map;#r=new Map;#n=new Set;#i=!0;constructor(e,r=!0){this.anchor=e,this.#i=r}#a=()=>{var e=Hn;if(this.#e.has(e)){var r=this.#e.get(e),n=this.#t.get(r);if(n)cO(n),this.#n.delete(r);else{var a=this.#r.get(r);a&&(this.#t.set(r,a.effect),this.#r.delete(r),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),n=a.effect)}for(const[i,s]of this.#e){if(this.#e.delete(i),i===e)break;const o=this.#r.get(s);o&&(vi(o.effect),this.#r.delete(s))}for(const[i,s]of this.#t){if(i===r||this.#n.has(i))continue;const o=()=>{if(Array.from(this.#e.values()).includes(i)){var c=document.createDocumentFragment();xF(s,c),c.append(Ki()),this.#r.set(i,{effect:s,fragment:c})}else vi(s);this.#n.delete(i),this.#t.delete(i)};this.#i||!n?(this.#n.add(i),Zd(s,o,!1)):o()}}};#s=e=>{this.#e.delete(e);const r=Array.from(this.#e.values());for(const[n,a]of this.#r)r.includes(n)||(vi(a.effect),this.#r.delete(n))};ensure(e,r){var n=Hn,a=bF();if(r&&!this.#t.has(e)&&!this.#r.has(e))if(a){var i=document.createDocumentFragment(),s=Ki();i.append(s),this.#r.set(e,{effect:Rs(()=>r(s)),fragment:i})}else this.#t.set(e,Rs(()=>r(this.anchor)));if(this.#e.set(n,e),a){for(const[o,l]of this.#t)o===e?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===e?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#a),n.ondiscard(this.#s)}else Nr&&(this.anchor=tn),this.#a()}}function le(t,e,r=!1){Nr&&Lo();var n=new eg(t),a=r?zl:0;function i(s,o){if(Nr){const c=J8(t)===aS;if(s===c){var l=L1();Ga(l),n.anchor=l,cs(!1),n.ensure(s,o),cs(!0);return}}n.ensure(s,o)}ed(()=>{var s=!1;e((o,l=!0)=>{s=!0,i(l,o)}),s||i(!1,null)},a)}function WW(t,e,r){Nr&&Lo();var n=new eg(t),a=!Qp();ed(()=>{var i=e();a&&i!==null&&typeof i=="object"&&(i={}),n.ensure(i,r)})}function ku(t,e){return e}function KW(t,e,r){for(var n=[],a=e.length,i,s=e.length,o=0;o<a;o++){let d=e[o];Zd(d,()=>{if(i){if(i.pending.delete(d),i.done.add(d),i.pending.size===0){var h=t.outrogroups;BA(tS(i.done)),h.delete(i),h.size===0&&(t.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=n.length===0&&r!==null;if(l){var c=r,u=c.parentNode;oO(u),u.append(c),t.items.clear()}BA(e,!l)}else i={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(i)}function BA(t,e=!0){for(var r=0;r<t.length;r++)vi(t[r],e)}var oD;function xr(t,e,r,n,a,i=null){var s=t,o=new Map,l=(e&Q8)!==0;if(l){var c=t;s=Nr?Ga(Di(c)):c.appendChild(Ki())}Nr&&Lo();var u=null,d=lS(()=>{var _=r();return Yf(_)?_:_==null?[]:tS(_)}),h,m=!0;function f(){b.fallback=u,jW(b,h,s,e,n),u!==null&&(h.length===0?(u.f&Oc)===0?cO(u):(u.f^=Oc,zm(u,null,s)):Zd(u,()=>{u=null}))}var g=ed(()=>{h=p(d);var _=h.length;let S=!1;if(Nr){var E=J8(s)===aS;E!==(_===0)&&(s=L1(),Ga(s),cs(!1),S=!0)}for(var y=new Set,v=Hn,T=bF(),w=0;w<_;w+=1){Nr&&tn.nodeType===tu&&tn.data===tO&&(s=tn,S=!0,cs(!1));var A=h[w],I=n(A,w),x=m?null:o.get(I);x?(x.v&&Ap(x.v,A),x.i&&Ap(x.i,w),T&&v.skipped_effects.delete(x.e)):(x=QW(o,m?s:oD??=Ki(),A,I,w,a,e,r),m||(x.e.f|=Oc),o.set(I,x)),y.add(I)}if(_===0&&i&&!u&&(m?u=Rs(()=>i(s)):(u=Rs(()=>i(oD??=Ki())),u.f|=Oc)),Nr&&_>0&&Ga(L1()),!m)if(T){for(const[D,$]of o)y.has(D)||v.skipped_effects.add($.e);v.oncommit(f),v.ondiscard(()=>{})}else f();S&&cs(!0),p(d)}),b={effect:g,items:o,outrogroups:null,fallback:u};m=!1,Nr&&(s=tn)}function jW(t,e,r,n,a){var i=(n&jV)!==0,s=e.length,o=t.items,l=t.effect.first,c,u=null,d,h=[],m=[],f,g,b,_;if(i)for(_=0;_<s;_+=1)f=e[_],g=a(f,_),b=o.get(g).e,(b.f&Oc)===0&&(b.nodes?.a?.measure(),(d??=new Set).add(b));for(_=0;_<s;_+=1){if(f=e[_],g=a(f,_),b=o.get(g).e,t.outrogroups!==null)for(const x of t.outrogroups)x.pending.delete(b),x.done.delete(b);if((b.f&Oc)!==0)if(b.f^=Oc,b===l)zm(b,null,r);else{var S=u?u.next:l;b===t.effect.last&&(t.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),pu(t,u,b),pu(t,b,S),zm(b,S,r),u=b,h=[],m=[],l=u.next;continue}if((b.f
Line truncated
|
||||
\r\f \v\uFEFF`];function nK(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var a in r)if(r[a])n=n?n+" "+a:a;else if(n.length)for(var i=a.length,s=0;(s=n.indexOf(a,s))>=0;){var o=s+i;(s===0||cD.includes(n[s-1]))&&(o===n.length||cD.includes(n[o]))?n=(s===0?"":n.substring(0,s))+n.substring(o+1):s=o}}return n===""?null:n}function uD(t,e=!1){var r=e?" !important;":";",n="";for(var a in t){var i=t[a];i!=null&&i!==""&&(n+=" "+a+": "+i+r)}return n}function ov(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function aK(t,e){if(e){var r="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(ov)),a&&l.push(...Object.keys(a).map(ov));var c=0,u=-1;const g=t.length;for(var d=0;d<g;d++){var h=t[d];if(o?h==="/"&&t[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&t[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?s++:h===")"&&s--,!o&&i===!1&&s===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===g-1){if(u!==-1){var m=ov(t.substring(c,u).trim());if(!l.includes(m)){h!==";"&&d++;var f=t.substring(c,d).trim();r+=" "+f+";"}}c=d+1,u=-1}}}}return n&&(r+=uD(n)),a&&(r+=uD(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function Et(t,e,r,n,a,i){var s=t.__className;if(Nr||s!==r||s===void 0){var o=nK(r,n,i);(!Nr||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=r}else if(i&&a!==i)for(var l in i){var c=!!i[l];(a==null||c!==!!a[l])&&t.classList.toggle(l,c)}return i}function lv(t,e={},r,n){for(var a in r){var i=r[a];e[a]!==i&&(r[a]==null?t.style.removeProperty(a):t.style.setProperty(a,i,n))}}function ms(t,e,r,n){var a=t.__style;if(Nr||a!==e){var i=aK(e,n);(!Nr||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}else n&&(Array.isArray(n)?(lv(t,r?.[0],n[0]),lv(t,r?.[1],n[1],"important")):lv(t,r,n));return n}function GA(t,e,r=!1){if(t.multiple){if(e==null)return;if(!Yf(e))return uW();for(var n of t.options)n.selected=e.includes(dD(n));return}for(n of t.options){var a=dD(n);if(RW(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function iK(t){var e=new MutationObserver(()=>{GA(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),hh(()=>{e.disconnect()})}function dD(t){return"__value"in t?t.__value:t.value}const bm=Symbol("class"),qh=Symbol("style"),VF=Symbol("is custom element"),WF=Symbol("is html");function sK(t){if(Nr){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;rr(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var a=t.checked;rr(t,"checked",null),t.checked=a}}};t.__on_r=r,Mo(r),SF()}}function mO(t,e){var r=fO(t);r.value===(r.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function oK(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function rr(t,e,r,n){var a=fO(t);Nr&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||a[e]!==(a[e]=r)&&(e==="loading"&&(t[IV]=r),r==null?t.removeAttribute(e):typeof r!="string"&&KF(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function lK(t,e,r,n,a=!1,i=!1){if(Nr&&a&&t.tagName==="INPUT"){var s=t,o=s.type==="checkbox"?"defaultChecked":"defaultValue";o in r||sK(s)}var l=fO(t),c=l[VF],u=!l[WF];let d=Nr&&c;d&&cs(!1);var h=e||{},m=t.tagName==="OPTION";for(var f in e)f in r||(r[f]=null);r.class?r.class=Yr(r.class):(n||r[bm])&&(r.class=null),r[qh]&&(r.style??=null);var g=KF(t);for(const T in r){let w=r[T];if(m&&T==="value"&&w==null){t.value=t.__value="",h[T]=w;continue}if(T==="class"){var b=t.namespaceURI==="http://www.w3.org/1999/xhtml";Et(t,b,w,n,e?.[bm],r[bm]),h[T]=w,h[bm]=r[bm];continue}if(T==="style"){ms(t,w,e?.[qh],r[qh]),h[T]=w,h[qh]=r[qh];continue}var _=h[T];if(!(w===_&&!(w===void 0&&t.hasAttribute(T)))){h[T]=w;var S=T[0]+T[1];if(S!=="$$")if(S==="on"){const A={},I="$$"+T;let x=T.slice(2);var E=UW(x);if(FW(x)&&(x=x.slice(0,-7),A.capture=!0),!E&&_){if(w!=null)continue;t.removeEventListener(x,h[I],A),h[I]=null}if(w!=null)if(E)t[`__${x}`]=w,Bn([x]);else{let D=function($){h[T].call(this,$)};h[I]=dO(x,t,D,A)}else E&&(t[`__${x}`]=void 0)}else if(T==="style")rr(t,T,w);else if(T==="autofocus")OW(t,!!w);else if(!c&&(T==="__value"||T==="value"&&w!=null))t.value=t.__value=w;else if(T==="selected"&&m)oK(t,w);else{var y=T;u||(y=qW(y));var v=y==="defaultValue"||y==="defaultChecked";if(w==null&&!c&&!v)if(l[T]=null,y==="value"||y==="checked"){let A=t;const I=e===void 0;if(y==="value"){let x=A.defaultValue;A.removeAttribute(y),A.defaultValue=x,A.value=A.__value=I?x:null}else{let x=A.defaultChecked;A.removeAttribute(y),A.defaultChecked=x,A.checked=I?x:!1}}else t.removeAttribute(T);else v||g.includes(y)&&(c||typeof w!="string")?(t[y]=w,y in l&&(l[y]=bi)):typeof w!="function"&&rr(t,y,w)}}}return d&&cs(!0),h}function $t(t,e,r=[],n=[],a=[],i,s=!1,o=!1){aO(a,r,n,l=>{var c=void 0,u={},d=t.nodeName=
Line truncated
|
||||
`,c="/",u="*",d="",h="comment",m="declaration";_v=function(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var _=1,S=1;function E(H){var G=H.match(e);G&&(_+=G.length);var K=H.lastIndexOf(l);S=~K?H.length-K:S+H.length}function y(){var H={line:_,column:S};return function(G){return G.position=new v(H),A(),G}}function v(H){this.start=H,this.end={line:_,column:S},this.source=b.source}v.prototype.content=g;function T(H){var G=new Error(b.source+":"+_+":"+S+": "+H);if(G.reason=H,G.filename=b.source,G.line=_,G.column=S,G.source=g,!b.silent)throw G}function w(H){var G=H.exec(g);if(G){var K=G[0];return E(K),g=g.slice(K.length),G}}function A(){w(r)}function I(H){var G;for(H=H||[];G=x();)G!==!1&&H.push(G);return H}function x(){var H=y();if(!(c!=g.charAt(0)||u!=g.charAt(1))){for(var G=2;d!=g.charAt(G)&&(u!=g.charAt(G)||c!=g.charAt(G+1));)++G;if(G+=2,d===g.charAt(G-1))return T("End of comment missing");var K=g.slice(2,G-2);return S+=2,E(K),g=g.slice(G),S+=2,H({type:h,comment:K})}}function D(){var H=y(),G=w(n);if(G){if(x(),!w(a))return T("property missing ':'");var K=w(i),z=H({type:m,property:f(G[0].replace(t,d)),value:K?f(K[0].replace(t,d)):d});return w(s),z}}function $(){var H=[];I(H);for(var G;G=D();)G!==!1&&(H.push(G),I(H));return H}return A(),$()};function f(g){return g?g.replace(o,d):d}return _v}var ID;function xQ(){if(ID)return Dh;ID=1;var t=Dh&&Dh.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Dh,"__esModule",{value:!0}),Dh.default=r;var e=t(IQ());function r(n,a){var i=null;if(!n||typeof n!="string")return i;var s=(0,e.default)(n),o=typeof a=="function";return s.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;o?a(c,u,l):u&&(i=i||{},i[c]=u)}}),i}return Dh}var DQ=xQ();const xD=mh(DQ),MQ=xD.default||xD,kQ=/\d/,PQ=["-","_","/","."];function LQ(t=""){if(!kQ.test(t))return t!==t.toLowerCase()}function FQ(t){const e=[];let r="",n,a;for(const i of t){const s=PQ.includes(i);if(s===!0){e.push(r),r="",n=void 0;continue}const o=LQ(i);if(a===!1){if(n===!1&&o===!0){e.push(r),r=i,n=o;continue}if(n===!0&&o===!1&&r.length>1){const l=r.at(-1);e.push(r.slice(0,Math.max(0,r.length-1))),r=l+i,n=o;continue}}r+=i,n=o,a=s}return e.push(r),e}function PB(t){return t?FQ(t).map(e=>UQ(e)).join(""):""}function BQ(t){return GQ(PB(t||""))}function UQ(t){return t?t[0].toUpperCase()+t.slice(1):""}function GQ(t){return t?t[0].toLowerCase()+t.slice(1):""}function Ym(t){if(!t)return{};const e={};function r(n,a){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){e[PB(n)]=a;return}if(n.startsWith("--")){e[n]=a;return}e[BQ(n)]=a}return MQ(t,r),e}function Dc(...t){return(...e)=>{for(const r of t)typeof r=="function"&&r(...e)}}function qQ(t,e){const r=RegExp(t,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,e):n}}const zQ=qQ(/[A-Z]/,t=>`-${t.toLowerCase()}`);function $Q(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${zQ(e)}: ${t[e]};`).join(`
|
||||
`)}function FO(t={}){return $Q(t).replace(`
|
||||
`," ")}const HQ=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],YQ=new Set(HQ);function VQ(t){return YQ.has(t)}function Er(...t){const e={...t[0]};for(let r=1;r<t.length;r++){const n=t[r];if(n){for(const a of Object.keys(n)){const i=e[a],s=n[a],o=typeof i=="function",l=typeof s=="function";if(o&&VQ(a)){const c=i,u=s;e[a]=kB(c,u)}else if(o&&l)e[a]=Dc(i,s);else if(a==="class"){const c=JA(i),u=JA(s);c&&u?e[a]=nf(i,s):c?e[a]=nf(i):u&&(e[a]=nf(s))}else if(a==="style"){const c=typeof i=="object",u=typeof s=="object",d=typeof i=="string",h=typeof s=="string";if(c&&u)e[a]={...i,...s};else if(c&&h){const m=Ym(s);e[a]={...i,...m}}else if(d&&u){const m=Ym(i);e[a]={...m,...s}}else if(d&&h){const m=Ym(i),f=Ym(s);e[a]={...m,...f}}else c?e[a]=i:u?e[a]=s:d?e[a]=i:h&&(e[a]=s)}else e[a]=s!==void 0?s:i}for(const a of Object.getOwnPropertySymbols(n)){const i=e[a],s=n[a];e[a]=s!==void 0?s:i}}}return typeof e.style=="object"&&(e.style=FO(e.style).replaceAll(`
|
||||
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}const WQ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},KQ=FO(WQ),LB=typeof window<"u"?window:void 0;function jQ(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(r===e)break;e=r}return e}var QQ=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],XQ=["difference","intersection","symmetricDifference","union"],DD=!1;class ds extends Set{#e=new Map;#t=_e(0);#r=_e(0);#n=il||-1;constructor(e){if(super(),e){for(var r of e)super.add(r);this.#r.v=super.size}DD||this.#a()}#i(e){return il===this.#n?_e(e):Uc(e)}#a(){DD=!0;var e=ds.prototype,r=Set.prototype;for(const n of QQ)e[n]=function(...a){return p(this.#t),r[n].apply(this,a)};for(const n of XQ)e[n]=function(...a){p(this.#t);var i=r[n].apply(this,a);return new ds(i)}}has(e){var r=super.has(e),n=this.#e,a=n.get(e);if(a===void 0){if(!r)return p(this.#t),!1;a=this.#i(!0),n.set(e,a)}return p(a),r}add(e){return super.has(e)||(super.add(e),k(this.#r,super.size),eo(this.#t)),this}delete(e){var r=super.delete(e),n=this.#e,a=n.get(e);return a!==void 0&&(n.delete(e),k(a,!1)),r&&(k(this.#r,super.size),eo(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var r of e.values())k(r,!1);e.clear(),k(this.#r,0),eo(this.#t)}}keys(){return this.values()}values(){return p(this.#t),super.values()}entries(){return p(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return p(this.#r)}}class xi extends Map{#e=new Map;#t=_e(0);#r=_e(0);#n=il||-1;constructor(e){if(super(),e){for(var[r,n]of e)super.set(r,n);this.#r.v=super.size}}#i(e){return il===this.#n?_e(e):Uc(e)}has(e){var r=this.#e,n=r.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),r.set(e,n);else return p(this.#t),!1}return p(n),!0}forEach(e,r){this.#a(),super.forEach(e,r)}get(e){var r=this.#e,n=r.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),r.set(e,n);else{p(this.#t);return}}return p(n),super.get(e)}set(e,r){var n=this.#e,a=n.get(e),i=super.get(e),s=super.set(e,r),o=this.#t;if(a===void 0)a=this.#i(0),n.set(e,a),k(this.#r,super.size),eo(o);else if(i!==r){eo(a);var l=o.reactions===null?null:new Set(o.reactions),c=l===null||!a.reactions?.every(u=>l.has(u));c&&eo(o)}return s}delete(e){var r=this.#e,n=r.get(e),a=super.delete(e);return n!==void 0&&(r.delete(e),k(this.#r,super.size),k(n,-1),eo(this.#t)),a}clear(){if(super.size!==0){super.clear();var e=this.#e;k(this.#r,0);for(var r of e.values())k(r,-1);eo(this.#t),e.clear()}}#a(){p(this.#t);var e=this.#e;if(this.#r.v!==e.size){for(var r of super.keys())if(!e.has(r)){var n=this.#i(0);e.set(r,n)}}for([,n]of this.#e)p(n)}keys(){return p(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return p(this.#r),super.size}}class ZQ{#e;#t;constructor(e,r){this.#e=e,this.#t=Ju(r)}get current(){return this.#t(),this.#e()}}const JQ=/\(.+\)/,eX=new Set(["all","print","screen","and","or","not","only"]);class FB extends ZQ{constructor(e,r){let n=JQ.test(e)||e.split(/[\s,]+/).some(i=>eX.has(i.trim()))?e:`(${e})`;const a=window.matchMedia(n);super(()=>a.matches,i=>Kr(a,"change",i))}}let tX=class{#e;#t;constructor(e={}){const{window:r=LB,document:n=r?.document}=e;r!==void 0&&(this.#e=n,this.#t=Ju(a=>{const i=Kr(r,"focusin",a),s=Kr(r,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?jQ(this.#e):null}};new tX;function BB(t){return typeof t=="function"}function rX(t,e){if(BB(t)){const n=t();return n===void 0?e:n}return t===void 0?e:t}let ka=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return iS(this.#t)}get(){const e=$l(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const r=$l(this.#t);return r===void 0?e:r}set(e){return Zu(this.#t,e)}};function vS(t,e){let r=_e(null);const n=F(()=>rX(e,250));function a(...i){if(p(r))p(r).timeout&&clearTimeout(p(r).timeout);else{let s,o;const l=new Promise((c,u)=>{s=c,o=u});k(r,{timeout:null,runner:null,promise:l,resolve:s,reject:o},!0)}return p(r).runner=async()=>{if(!p(r))return;const s=p(r);k(r,null);try{s.resolve(await t.apply(this,i))}catch(o){s.reject(o)}},p(r).timeout=setTimeout(p(r).runner,p(n)),p(r).promise}return a.cancel=async()=>{(!p(r)||p(r).timeout===null)&&(await new Promise(i=>setTimeout(i,0)),!p(r)||p(r).timeout===null)||(clearTimeout(p(r).timeout),p(r).reject("Cancelled"),k(r,null))},a.runScheduledNow=async()=>{(!p(r)||!p(r).timeout)&&(await new Promise(i=>setTimeout(i,0)),!p(r)||!p(r).timeout)||(clearTimeout(p(r).timeout),p(r).timeout=null,await p(r).runner?.())},Object.defineProperty(a,"pending",{enumerable:!0,get(){return!!p(r)?.timeout}}),a}function nX(t,e){switch(t){c
Line truncated
|
||||
`,n5="\n\n```\nTurn limit reached\n```\n",a5=`
|
||||
|
||||
\`\`\`
|
||||
Upstream LLM error:
|
||||
`,i5="\n```\n",Tv={enabled:!0,maxTurns:100,maxToolPreviewLines:25},Bre={START:"<<<reasoning_content_start>>>"},hp={COMPLETED_TOOL_CALL:/<<<AGENTIC_TOOL_CALL_START>>>\n<<<TOOL_NAME:(.+?)>>>\n<<<TOOL_ARGS_START>>>([\s\S]*?)<<<TOOL_ARGS_END>>>([\s\S]*?)<<<AGENTIC_TOOL_CALL_END>>>/g,REASONING_BLOCK:/<<<reasoning_content_start>>>[\s\S]*?<<<reasoning_content_end>>>/g,REASONING_EXTRACT:/<<<reasoning_content_start>>>([\s\S]*?)<<<reasoning_content_end>>>/,REASONING_OPEN:/<<<reasoning_content_start>>>[\s\S]*$/,AGENTIC_TOOL_CALL_OPEN:/\n*<<<AGENTIC_TOOL_CALL_START>>>[\s\S]*$/,HAS_LEGACY_MARKERS:/<<<(?:AGENTIC_TOOL_CALL_START|reasoning_content_start)>>>/},u_={LIST:"/v1/models",LOAD:"/models/load",UNLOAD:"/models/unload"},WU="/cors-proxy",Ure="PDF File",Gre="MCP Prompt",qre="MCP Resource",s5=100,zre=10,$re={prefixLength:1024*10,suspiciousCharThresholdRatio:.15,maxAbsoluteNullBytes:2},KU=300*1e3,Hre=100,Yre=600*1e3,Vre=50,Wre=50,Kre=300*1e3,jre=10,Qre=1800*1e3,Xre=0,Zre=`
|
||||
`,i5="\n```\n",Cv={enabled:!0,maxTurns:100,maxToolPreviewLines:25},Bre={START:"<<<reasoning_content_start>>>"},eh={COMPLETED_TOOL_CALL:/<<<AGENTIC_TOOL_CALL_START>>>\n<<<TOOL_NAME:(.+?)>>>\n<<<TOOL_ARGS_START>>>([\s\S]*?)<<<TOOL_ARGS_END>>>([\s\S]*?)<<<AGENTIC_TOOL_CALL_END>>>/g,REASONING_BLOCK:/<<<reasoning_content_start>>>[\s\S]*?<<<reasoning_content_end>>>/g,REASONING_EXTRACT:/<<<reasoning_content_start>>>([\s\S]*?)<<<reasoning_content_end>>>/,REASONING_OPEN:/<<<reasoning_content_start>>>[\s\S]*$/,AGENTIC_TOOL_CALL_OPEN:/\n*<<<AGENTIC_TOOL_CALL_START>>>[\s\S]*$/,HAS_LEGACY_MARKERS:/<<<(?:AGENTIC_TOOL_CALL_START|reasoning_content_start)>>>/},u_={LIST:"/v1/models",LOAD:"/models/load",UNLOAD:"/models/unload"},WU="/cors-proxy",Ure="PDF File",Gre="MCP Prompt",qre="MCP Resource",s5=100,zre=10,$re={prefixLength:1024*10,suspiciousCharThresholdRatio:.15,maxAbsoluteNullBytes:2},KU=300*1e3,Hre=100,Yre=600*1e3,Vre=50,Wre=50,Kre=300*1e3,jre=10,Qre=1800*1e3,Xre=0,Zre=`
|
||||
|
||||
`,Jre='"',o5="/",Cv="@",ene="code-block-scroll-container",tne="code-block-wrapper",rne="code-block-header",nne="code-block-actions",ane="code-language",ine="copy-code-btn",sne="preview-code-btn",one="relative",lne=`
|
||||
`,cne="text",une=/^(\w*)\n?/,dne=/&/g,hne=/</g,pne=/>/g,l5=/^```|\n```/g,mne="chat-message-edit",fne="chat-actions",gne="chat-settings-dialog",jU="border border-border/30 focus-within:border-border dark:border-border/20 dark:focus-within:border-border",OI=`
|
||||
`,Jre='"',o5="/",wv="@",ene="code-block-scroll-container",tne="code-block-wrapper",rne="code-block-header",nne="code-block-actions",ane="code-language",ine="copy-code-btn",sne="preview-code-btn",one="relative",lne=`
|
||||
`,cne="text",une=/^(\w*)\n?/,dne=/&/g,hne=/</g,pne=/>/g,l5=/^```|\n```/g,mne="chat-message-edit",fne="chat-actions",gne="chat-settings-dialog",jU="border border-border/30 focus-within:border-border dark:border-border/20 dark:focus-within:border-border",NI=`
|
||||
bg-muted/60 dark:bg-muted/75
|
||||
${jU}
|
||||
shadow-sm
|
||||
@@ -23,21 +23,21 @@ Upstream LLM error:
|
||||
border border-border/30 dark:border-border/20
|
||||
shadow-sm backdrop-blur-lg!
|
||||
rounded-t-lg!
|
||||
`,bne="max-h-80",Sne="https://www.google.com/s2/favicons",Ene=32,c5=".",u5=2,T1=1e3,d5=60,h5=3600,vne=1,yne=10,p5="0s",QU=256,XU=8192,Tne=/[\x00-\x1F\x7F]/g,Cne=/[\x00-\x08\x0A-\x0D\x0E-\x1F\x7F]/g,Xo={[kn.IMAGE]:EI,[kn.AUDIO]:TI,[kn.TEXT]:Nc,[kn.PDF]:SI},wne={[jc.VISION]:bI,[jc.AUDIO]:TI},Ane={[jc.VISION]:"Vision",[jc.AUDIO]:"Audio"},Rne=/(```[\s\S]*?```|`[^`\n]+`)/g,One=new RegExp("(```[\\S\\s]*?```|`.*?`)|(?<!\\\\)\\\\\\[([\\S\\s]*?[^\\\\])\\\\]|(?<!\\\\)\\\\\\((.*?)\\\\\\)","g"),Nne=/\$\$([\s\S]*?\\\\[\s\S]*?)\$\$/,Ine=/\r?\n/,xne=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell"]),ZU=" ",Dne=ZU.repeat(4),m5="LlamaCppWebui.config",f5="LlamaCppWebui.userOverrides",g5="LlamaCppWebui.favoriteModels",wv="LlamaCppWebui.mcpDefaultEnabled",Mne="img:not([data-error-bound])",kne="errorBound",_5="errorHandled",Av="true",JU="1.0.0",Pne=ta.PNG,Lne=new Set([ta.PNG,ta.JPEG,ta.JPG,ta.SVG,ta.WEBP]),Fne="2025-06-18",Va={protocolVersion:Fne,capabilities:{tools:{listChanged:!0}},clientInfo:{name:"llama-webui-mcp",version:JU},requestTimeoutSeconds:300,connectionTimeoutMs:1e4},NI="LlamaCpp-WebUI-MCP-Server",Bne=1e3,Une=2,Gne=3e4,b5=15e3,S5=3,qne=2,zne="url",$ne={[Is.WEBSOCKET]:"WebSocket",[Is.STREAMABLE_HTTP]:"HTTP",[Is.SSE]:"SSE"},Hne={[Is.WEBSOCKET]:AI,[Is.STREAMABLE_HTTP]:vre,[Is.SSE]:Ire},Yne="https://mcp.example.com/sse",Vne=1,eG=/\.(png|jpg|jpeg|gif|svg|webp)$/i,tG=/\.(js|ts|json|yaml|yml|xml|html|css|py|rs|go|java|cpp|c|h|rb|sh|toml)$/i,Wne=/\.(txt|md|log)$/i,Kne=/^[a-z]+:\/\//,jne=/\.[^.]+$/,Qne=/[-_]/,Xne=/^data:([^;]+);base64,([A-Za-z0-9+/]+=*)$/,Zne="mcp-attachment",Jne="res",eae="img",rG="resource.txt",tae="/",rae=`
|
||||
`,bne="max-h-80",Sne="https://www.google.com/s2/favicons",Ene=32,c5=".",u5=2,T1=1e3,d5=60,h5=3600,vne=1,yne=10,p5="0s",QU=256,XU=8192,Tne=/[\x00-\x1F\x7F]/g,Cne=/[\x00-\x08\x0A-\x0D\x0E-\x1F\x7F]/g,Zo={[kn.IMAGE]:vI,[kn.AUDIO]:CI,[kn.TEXT]:Nc,[kn.PDF]:EI},wne={[jc.VISION]:SI,[jc.AUDIO]:CI},Ane={[jc.VISION]:"Vision",[jc.AUDIO]:"Audio"},Rne=/(```[\s\S]*?```|`[^`\n]+`)/g,One=new RegExp("(```[\\S\\s]*?```|`.*?`)|(?<!\\\\)\\\\\\[([\\S\\s]*?[^\\\\])\\\\]|(?<!\\\\)\\\\\\((.*?)\\\\\\)","g"),Nne=/\$\$([\s\S]*?\\\\[\s\S]*?)\$\$/,Ine=/\r?\n/,xne=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell"]),ZU=" ",Dne=ZU.repeat(4),m5="LlamaCppWebui.config",f5="LlamaCppWebui.userOverrides",g5="LlamaCppWebui.favoriteModels",Av="LlamaCppWebui.mcpDefaultEnabled",Mne="img:not([data-error-bound])",kne="errorBound",_5="errorHandled",Rv="true",JU="1.0.0",Pne=ta.PNG,Lne=new Set([ta.PNG,ta.JPEG,ta.JPG,ta.SVG,ta.WEBP]),Fne="2025-06-18",Va={protocolVersion:Fne,capabilities:{tools:{listChanged:!0}},clientInfo:{name:"llama-webui-mcp",version:JU},requestTimeoutSeconds:300,connectionTimeoutMs:1e4},II="LlamaCpp-WebUI-MCP-Server",Bne=1e3,Une=2,Gne=3e4,b5=15e3,S5=3,qne=2,zne="url",$ne={[Is.WEBSOCKET]:"WebSocket",[Is.STREAMABLE_HTTP]:"HTTP",[Is.SSE]:"SSE"},Hne={[Is.WEBSOCKET]:RI,[Is.STREAMABLE_HTTP]:vre,[Is.SSE]:Ire},Yne="https://mcp.example.com/sse",Vne=1,eG=/\.(png|jpg|jpeg|gif|svg|webp)$/i,tG=/\.(js|ts|json|yaml|yml|xml|html|css|py|rs|go|java|cpp|c|h|rb|sh|toml)$/i,Wne=/\.(txt|md|log)$/i,Kne=/^[a-z]+:\/\//,jne=/\.[^.]+$/,Qne=/[-_]/,Xne=/^data:([^;]+);base64,([A-Za-z0-9+/]+=*)$/,Zne="mcp-attachment",Jne="res",eae="img",rG="resource.txt",tae="/",rae=`
|
||||
|
||||
`,E5="unknown type",v5="Binary content",nae={[ta.JPEG]:"jpg",[ta.JPG]:"jpg",[ta.PNG]:"png",[ta.GIF]:"gif",[ta.WEBP]:"webp"},aae=8,iae=20,sae=19,oae=/[^a-z0-9]/gi,lae="_",cae=/_+/g,nG="T",uae="_",dae=":",hae="-",lc=-1,pae="/",y5="-",mae=":",T5=/^(I?Q\d+(_[A-Z0-9]+)*|F\d+|BF\d+|MXFP\d+(_[A-Z0-9]+)*)$/i,fae=/^UD$/i,gae=/^\d+(\.\d+)?[BbMmKkTt]$/,_ae=/^[Aa]\d+(\.\d+)?[BbMmKkTt]$/,bae=new Set(["GGUF","GGML"]),C5=1e6,Sae=2e3,w5={TOKENS_PER_SECOND:"t/s"},_c={apiKey:"",systemMessage:"",showSystemMessage:!0,theme:Gl.SYSTEM,showThoughtInProgress:!1,disableReasoningParsing:!1,excludeReasoningFromContext:!1,showRawOutputSwitch:!1,keepStatsVisible:!1,showMessageStats:!0,askForTitleConfirmation:!1,pasteLongTextToFileLen:2500,copyTextAttachmentsAsPlainText:!1,pdfAsImage:!1,disableAutoScroll:!1,renderUserContentAsMarkdown:!1,alwaysShowSidebarOnDesktop:!1,autoShowSidebarOnNewChat:!0,autoMicOnEmpty:!1,fullHeightCodeBlocks:!1,showRawModelNames:!1,mcpServers:"[]",mcpServerUsageStats:"{}",agenticMaxTurns:10,agenticMaxToolPreviewLines:25,showToolCallInProgress:!1,alwaysShowAgenticTurns:!1,samplers:"",backend_sampling:!1,temperature:void 0,dynatemp_range:void 0,dynatemp_exponent:void 0,top_k:void 0,top_p:void 0,min_p:void 0,xtc_probability:void 0,xtc_threshold:void 0,typ_p:void 0,repeat_last_n:void 0,repeat_penalty:void 0,presence_penalty:void 0,frequency_penalty:void 0,dry_multiplier:void 0,dry_base:void 0,dry_allowed_length:void 0,dry_penalty_last_n:void 0,max_tokens:void 0,custom:"",pyInterpreterEnabled:!1,enableContinueGeneration:!1},fu={apiKey:"Set the API Key if you are using <code>--api-key</code> option for the server.",systemMessage:"The starting message that defines how model should behave.",showSystemMessage:"Display the system message at the top of each conversation.",theme:"Choose the color theme for the interface. You can choose between System (follows your device settings), Light, or Dark.",pasteLongTextToFileLen:"On pasting long text, it will be converted to a file. You can control the file length by setting the value of this parameter. Value 0 means disable.",copyTextAttachmentsAsPlainText:"When copying a message with text attachments, combine them into a single plain text string instead of a special format that can be pasted back as attachments.",samplers:'The order at which samplers are applied, in simplified way. Default is "top_k;typ_p;top_p;min_p;temperature": top_k->typ_p->top_p->min_p->temperature',backend_sampling:"Enable backend-based samplers. When enabled, supported samplers run on the accelerator backend for faster sampling.",temperature:"Controls the randomness of the generated text by affecting the probability distribution of the output tokens. Higher = more random, lower = more focused.",dynatemp_range:"Addon for the temperature sampler. The added value to the range of dynamic temperature, which adjusts probabilities by entropy of tokens.",dynatemp_exponent:"Addon for the temperature sampler. Smoothes out the probability redistribution based on the most probable token.",top_k:"Keeps only k top tokens.",top_p:"Limits tokens to those that together have a cumulative probability of at least p",min_p:"Limits tokens based on the minimum probability for a token to be considered, relative to the probability of the most likely token.",xtc_probability:"XTC sampler cuts out top tokens; this parameter controls the chance of cutting tokens at all. 0 disables XTC.",xtc_threshold:"XTC sampler cuts out top tokens; this parameter controls the token probability that is required to cut that token.",typ_p:"Sorts and limits tokens based on the difference between log-probability and entropy.",repeat_last_n:"Last n tokens to consider for penalizing repetition",repeat_penalty:"Controls the repetition of token sequences in the generated text",presence_penalty:"Limits tokens based on whether they appear in the output or not.",frequency_penalty:"Limits tokens based on how often they appear in the output.",dry_multiplier:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling multiplier.",dry_base:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling base value.",dry_allowed_length:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the allowed length for DRY sampling.",dry_penalty_last_n:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens.",max_tokens:"The maximum number of token per output. Use -1 for infinite (no limit).",custom:"Custom JSON parameters to send to the API. Must be valid JSON format.",showThoughtInProgress:"Expand thought process by default when generating messages.",disableReasoningParsing:"Send reasoning_format=none to prevent server-side extraction of reasoning tokens into separate field",excludeReasoningFromContext:"Strip reasoning content from previous messages
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),fa=Gt,Un=Cr),ln===void 0&&(ln=!0);const Yr={code:Un,language:fa};$o("before:highlight",Yr);const Us=Yr.result?Yr.result:On(Yr.language,Yr.code,ln);return Us.code=Yr.code,$o("after:highlight",Us),Us}function On(Gt,Cr,ln,Un){const fa=Object.create(null);function Yr(Qt,gr){return Qt.keywords[gr]}function Us(){if(!nr.keywords){ga.addText(Fn);return}let Qt=0;nr.keywordPatternRe.lastIndex=0;let gr=nr.keywordPatternRe.exec(Fn),yr="";for(;gr;){yr+=Fn.substring(Qt,gr.index);const jr=$a.case_insensitive?gr[0].toLowerCase():gr[0],Xn=Yr(nr,jr);if(Xn){const[ai,gd]=Xn;if(ga.addText(yr),yr="",fa[jr]=(fa[jr]||0)+1,fa[jr]<=Ut&&(_a+=gd),ai.startsWith("_"))yr+=gr[0];else{const Yo=$a.classNameAliases[ai]||ai;fn(gr[0],Yo)}}else yr+=gr[0];Qt=nr.keywordPatternRe.lastIndex,gr=nr.keywordPatternRe.exec(Fn)}yr+=Fn.substring(Qt),ga.addText(yr)}function nc(){if(Fn==="")return;let Qt=null;if(typeof nr.subLanguage=="string"){if(!Xe[nr.subLanguage]){ga.addText(Fn);return}Qt=On(nr.subLanguage,Fn,!0,bl[nr.subLanguage]),bl[nr.subLanguage]=Qt._top}else Qt=Ln(Fn,nr.subLanguage.length?nr.subLanguage:null);nr.relevance>0&&(_a+=Qt.relevance),ga.__addSublanguage(Qt._emitter,Qt.language)}function fi(){nr.subLanguage!=null?nc():Us(),Fn=""}function fn(Qt,gr){Qt!==""&&(ga.startScope(gr),ga.addText(Qt),ga.endScope())}function gl(Qt,gr){let yr=1;const jr=gr.length-1;for(;yr<=jr;){if(!Qt._emit[yr]){yr++;continue}const Xn=$a.classNameAliases[Qt[yr]]||Qt[yr],ai=gr[yr];Xn?fn(ai,Xn):(Fn=ai,Us(),Fn=""),yr++}}function _l(Qt,gr){return Qt.scope&&typeof Qt.scope=="string"&&ga.openNode($a.classNameAliases[Qt.scope]||Qt.scope),Qt.beginScope&&(Qt.beginScope._wrap?(fn(Fn,$a.classNameAliases[Qt.beginScope._wrap]||Qt.beginScope._wrap),Fn=""):Qt.beginScope._multi&&(gl(Qt.beginScope,gr),Fn="")),nr=Object.create(Qt,{parent:{value:nr}}),nr}function Ho(Qt,gr,yr){let jr=E(Qt.endRe,yr);if(jr){if(Qt["on:end"]){const Xn=new e(Qt);Qt["on:end"](gr,Xn),Xn.isMatchIgnored&&(jr=!1)}if(jr){for(;Qt.endsParent&&Qt.parent;)Qt=Qt.parent;return Qt}}if(Qt.endsWithParent)return Ho(Qt.parent,gr,yr)}function md(Qt){return nr.matcher.regexIndex===0?(Fn+=Qt[0],1):(Ti=!0,0)}function fd(Qt){const gr=Qt[0],yr=Qt.rule,jr=new e(yr),Xn=[yr.__beforeBegin,yr["on:begin"]];for(const ai of Xn)if(ai&&(ai(Qt,jr),jr.isMatchIgnored))return md(gr);return yr.skip?Fn+=gr:(yr.excludeBegin&&(Fn+=gr),fi(),!yr.returnBegin&&!yr.excludeBegin&&(Fn=gr)),_l(yr,Qt),yr.returnBegin?0:gr.length}function uu(Qt){const gr=Qt[0],yr=Cr.substring(Qt.index),jr=Ho(nr,Qt,yr);if(!jr)return ut;const Xn=nr;nr.endScope&&nr.endScope._wrap?(fi(),fn(gr,nr.endScope._wrap)):nr.endScope&&nr.endScope._multi?(fi(),gl(nr.endScope,Qt)):Xn.skip?Fn+=gr:(Xn.returnEnd||Xn.excludeEnd||(Fn+=gr),fi(),Xn.excludeEnd&&(Fn=gr));do nr.scope&&ga.closeNode(),!nr.skip&&!nr.subLanguage&&(_a+=nr.relevance),nr=nr.parent;while(nr!==jr.parent);return jr.starts&&_l(jr.starts,Qt),Xn.returnEnd?0:gr.length}function wh(){const Qt=[];for(let gr=nr;gr!==$a;gr=gr.parent)gr.scope&&Qt.unshift(gr.scope);Qt.forEach(gr=>ga.openNode(gr))}let Eo={};function ac(Qt,gr){const yr=gr&&gr[0];if(Fn+=Qt,yr==null)return fi(),0;if(Eo.type==="begin"&&gr.type==="end"&&Eo.index===gr.index&&yr===""){if(Fn+=Cr.slice(gr.index,gr.index+1),!Pt){const jr=new Error(`0 width match regex (${Gt})`);throw jr.languageName=Gt,jr.badRule=Eo.rule,jr}return 1}if(Eo=gr,gr.type==="begin")return fd(gr);if(gr.type==="illegal"&&!ln){const jr=new Error('Illegal lexeme "'+yr+'" for mode "'+(nr.scope||"<unnamed>")+'"');throw jr.mode=nr,jr}else if(gr.type==="end"){const jr=uu(gr);if(jr!==ut)return jr}if(gr.type==="illegal"&&yr==="")return Fn+=`
|
||||
`,1;if(vo>1e5&&vo>gr.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Fn+=yr,yr.length}const $a=Bi(Gt);if(!$a)throw st(kt.replace("{}",Gt)),new Error('Unknown language: "'+Gt+'"');const du=zt($a);let ic="",nr=Un||du;const bl={},ga=new Tt.__emitter(Tt);wh();let Fn="",_a=0,ni=0,vo=0,Ti=!1;try{if($a.__emitTokens)$a.__emitTokens(Cr,ga);else{for(nr.matcher.considerAll();;){vo++,Ti?Ti=!1:nr.matcher.considerAll(),nr.matcher.lastIndex=ni;const Qt=nr.matcher.exec(Cr);if(!Qt)break;const gr=Cr.substring(ni,Qt.index),yr=ac(gr,Qt);ni=Qt.index+yr}ac(Cr.substring(ni))}return ga.finalize(),ic=ga.toHTML(),{language:Gt,value:ic,relevance:_a,illegal:!1,_emitter:ga,_top:nr}}catch(Qt){if(Qt.message&&Qt.message.includes("Illegal"))return{language:Gt,value:Ft(Cr),illegal:!0,relevance:0,_illegalBy:{message:Qt.message,index:ni,context:Cr.slice(ni-100,ni+100),mode:Qt.mode,resultSoFar:ic},_emitter:ga};if(Pt)return{language:Gt,value:Ft(Cr),illegal:!1,relevance:0,errorRaised:Qt,_emitter:ga,_top:nr};throw Qt}}function vr(Gt){const Cr={value:Ft(Gt),illegal:!1,relevance:0,_top:bt,_emitter:new Tt.__emitter(Tt)};return Cr._emitter.addText(Gt),Cr}function Ln(Gt,Cr){Cr=Cr||Tt.languages||Object.keys(Xe);const ln=vr(Gt),Un=Cr.filter(Bi).filter(So).map(fi=>On(fi,Gt,!1));Un.unshift(ln);const fa=Un.sort((fi,fn)=>{if(fi.relevance!==fn.relevance)return fn.relevance-fi.relevance;if(fi.language&&fn.language){if(Bi(fi.language).supersetOf===fn.language)return 1;if(Bi(fn.language).supersetOf===fi.language)return-1}return 0}),[Yr,Us]=fa,nc=Yr;return nc.secondBest=Us,nc}function Fs(Gt,Cr,ln){const Un=Cr&&pt[Cr]||ln;Gt.classList.add("hljs"),Gt.classList.add(`language-${Un}`)}function mi(Gt){let Cr=null;const ln=Dt(Gt);if(St(ln))return;if($o("before:highlightElement",{el:Gt,language:ln}),Gt.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Gt);return}if(Gt.children.length>0&&(Tt.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Gt)),Tt.throwUnescapedHTML))throw new Ot("One of your code blocks includes unescaped HTML.",Gt.innerHTML);Cr=Gt;const Un=Cr.textContent,fa=ln?ur(Un,{language:ln,ignoreIllegals:!0}):Ln(Un);Gt.innerHTML=fa.value,Gt.dataset.highlighted="yes",Fs(Gt,ln,fa.language),Gt.result={language:fa.language,re:fa.relevance,relevance:fa.relevance},fa.secondBest&&(Gt.secondBest={language:fa.secondBest.language,relevance:fa.secondBest.relevance}),$o("after:highlightElement",{el:Gt,result:fa,text:Un})}function _o(Gt){Tt=Jt(Tt,Gt)}const gs=()=>{ri(),Ae("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ki(){ri(),Ae("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let bo=!1;function ri(){function Gt(){ri()}if(document.readyState==="loading"){bo||window.addEventListener("DOMContentLoaded",Gt,!1),bo=!0;return}document.querySelectorAll(Tt.cssSelector).forEach(mi)}function cu(Gt,Cr){let ln=null;try{ln=Cr(Re)}catch(Un){if(st("Language definition for '{}' could not be registered.".replace("{}",Gt)),Pt)st(Un);else throw Un;ln=bt}ln.name||(ln.name=Gt),Xe[Gt]=ln,ln.rawDefinition=Cr.bind(null,Re),ln.aliases&&ia(ln.aliases,{languageName:Gt})}function ji(Gt){delete Xe[Gt];for(const Cr of Object.keys(pt))pt[Cr]===Gt&&delete pt[Cr]}function rc(){return Object.keys(Xe)}function Bi(Gt){return Gt=(Gt||"").toLowerCase(),Xe[Gt]||Xe[pt[Gt]]}function ia(Gt,{languageName:Cr}){typeof Gt=="string"&&(Gt=[Gt]),Gt.forEach(ln=>{pt[ln.toLowerCase()]=Cr})}function So(Gt){const Cr=Bi(Gt);return Cr&&!Cr.disableAutodetect}function Bs(Gt){Gt["before:highlightBlock"]&&!Gt["before:highlightElement"]&&(Gt["before:highlightElement"]=Cr=>{Gt["before:highlightBlock"](Object.assign({block:Cr.el},Cr))}),Gt["after:highlightBlock"]&&!Gt["after:highlightElement"]&&(Gt["after:highlightElement"]=Cr=>{Gt["after:highlightBlock"](Object.assign({block:Cr.el},Cr))})}function Ch(Gt){Bs(Gt),Ct.push(Gt)}function fl(Gt){const Cr=Ct.indexOf(Gt);Cr!==-1&&Ct.splice(Cr,1)}function $o(Gt,Cr){const ln=Gt;Ct.forEach(function(Un){Un[ln]&&Un[ln](Cr)})}function pd(Gt){return Ae("10.7.0","highlightBlock will be removed entirely in v12.0"),Ae("10.7.0","Please use highlightElement now."),mi(Gt)}Object.assign(Re,{highlight:ur,highlightAuto:Ln,highlightAll:ri,highlightElement:mi,highlightBlock:pd,configure:_o,initHighlighting:gs,initHighlightingOnLoad:Ki,registerLanguage:cu,unregisterLanguage:ji,listLanguages:rc,getLanguage:Bi,registerAliases:ia,autoDetection:So,inherit:Jt,addPlugin:Ch,removePlugin:fl}),Re.debugMode=function(){Pt=!1},Re.safeMode=function(){Pt=!0},Re.versionString=lt,Re.regex={concat:g,lookahead:h,either:_,optional:f,anyNumberOfTimes:m};for(const Gt in be)typeof be[Gt]=="object"&&t(be[Gt]);return Object.assign(Re,be),Re},xt=yt({})
Line truncated
|
||||
`},f]}}return pT=a,pT}var mT,mk;function Ase(){if(mk)return mT;mk=1;function t(e){const r="[a-zA-Z_][\\w.]*",n="<\\?(lasso(script)?|=)",a="\\]|\\?>",i={$pattern:r+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},s=e.COMMENT("<!--","-->",{relevance:0}),o={className:"meta",begin:"\\[noprocess\\]",starts:{end:"\\[/noprocess\\]",returnEnd:!0,contains:[s]}},l={className:"meta",begin:"\\[/noprocess|"+n},c={className:"symbol",begin:"'"+r+"'"},u=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(e.C_NUMBER_MODE,{begin:e.C_NUMBER_RE+"|(-?infinity|NaN)\\b"}),e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"`",end:"`"},{variants:[{begin:"[#$]"+r},{begin:"#",end:"\\d+",illegal:"\\W"}]},{className:"type",begin:"::\\s*",end:r,illegal:"\\W"},{className:"params",variants:[{begin:"-(?!infinity)"+r,relevance:0},{begin:"(\\.\\.\\.)"}]},{begin:/(->|\.)\s*/,relevance:0,contains:[c]},{className:"class",beginKeywords:"define",returnEnd:!0,end:"\\(|=>",contains:[e.inherit(e.TITLE_MODE,{begin:r+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[|"+n,returnEnd:!0,relevance:0,contains:[s]}},o,l,{className:"meta",begin:"\\[no_square_brackets",starts:{end:"\\[/no_square_brackets\\]",keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[noprocess\\]|"+n,returnEnd:!0,contains:[s]}},o,l].concat(u)}},{className:"meta",begin:"\\[",relevance:0},{className:"meta",begin:"^#!",end:"lasso9$",relevance:10}].concat(u)}}return mT=t,mT}var fT,fk;function Rse(){if(fk)return fT;fk=1;function t(e){const n=e.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(D=>D+"(?![a-zA-Z@:_])")),a=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map(D=>D+"(?![a-zA-Z:_])").join("|")),i=[{begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}],s=[{begin:/\^{6}[0-9a-f]{6}/},{begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/},{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],o={className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0,begin:n},{endsParent:!0,begin:a},{endsParent:!0,variants:s},{endsParent:!0,relevance:0,variants:i}]},l={className:"params",relevance:0,begin:/#+\d?/},c={variants:s},u={className:"built_in",relevance:0,begin:/[$&^_]/},d={className:"meta",begin:/% ?!(T[eE]X|tex|BIB|bib)/,end:"$",relevance:10},h=e.COMMENT("%","$",{relevance:0}),m=[o,l,c,u,d,h],f={begin:/\{/,end:/\}/,relevance:0,contains:["self",...m]},g=e.inheri
Line truncated
|
||||
]`,g={scope:"string",variants:[d,u,h,m]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},_=["false","null","true"],S=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:S,literal:(K=>{const z=[];return K.forEach(re=>{z.push(re),re.toLowerCase()===re?z.push(re.toUpperCase()):z.push(re.toLowerCase())}),z})(_),built_in:E},T=K=>K.map(z=>z.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,r.concat(f,"+"),r.concat("(?!",T(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},A=r.concat(a,"\\b(?!\\()"),I={variants:[{match:[r.concat(/::/,r.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,r.concat(/::/,r.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[i,r.concat("::",r.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},x={scope:"attr",match:r.concat(a,r.lookahead(":"),r.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[x,o,I,e.C_BLOCK_COMMENT_MODE,g,b,w]},$={relevance:0,match:[/\b/,r.concat("(?!fn\\b|function\\b|",T(S).join("\\b|"),"|",T(E).join("\\b|"),"\\b)"),a,r.concat(f,"*"),r.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push($);const H=[x,I,e.C_BLOCK_COMMENT_MODE,g,b,w],G={begin:r.concat(/#\[\s*\\?/,r.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:_,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:_,keyword:["new","array"]},contains:["self",...H]},...H,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:v,contains:[G,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,$,I,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",G,o,I,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywor
Line truncated
|
||||
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}return RC=t,RC}var OC,O9;function Goe(){if(O9)return OC;O9=1;function t(e){const r="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},a={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:r+":",relevance:0},e.C_NUMBER_MODE,a,n,{begin:"\\|[ ]*"+r+"([ ]+"+r+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+r}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,n,e.C_NUMBER_MODE,a]}]}}return OC=t,OC}var NC,N9;function qoe(){if(N9)return NC;N9=1;function t(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}return NC=t,NC}var IC,I9;function zoe(){if(I9)return IC;I9=1;function t(e){const r={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},a={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},i=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],s=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],o=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSiLine truncated
|
||||
`,E5="unknown type",v5="Binary content",nae={[ta.JPEG]:"jpg",[ta.JPG]:"jpg",[ta.PNG]:"png",[ta.GIF]:"gif",[ta.WEBP]:"webp"},aae=8,iae=20,sae=19,oae=/[^a-z0-9]/gi,lae="_",cae=/_+/g,nG="T",uae="_",dae=":",hae="-",lc=-1,pae="/",y5="-",mae=":",T5=/^(I?Q\d+(_[A-Z0-9]+)*|F\d+|BF\d+|MXFP\d+(_[A-Z0-9]+)*)$/i,fae=/^UD$/i,gae=/^\d+(\.\d+)?[BbMmKkTt]$/,_ae=/^[Aa]\d+(\.\d+)?[BbMmKkTt]$/,bae=new Set(["GGUF","GGML"]),C5=1e6,Sae=2e3,w5={TOKENS_PER_SECOND:"t/s"},_c={apiKey:"",systemMessage:"",showSystemMessage:!0,theme:Gl.SYSTEM,showThoughtInProgress:!1,disableReasoningParsing:!1,excludeReasoningFromContext:!1,showRawOutputSwitch:!1,keepStatsVisible:!1,showMessageStats:!0,askForTitleConfirmation:!1,pasteLongTextToFileLen:2500,copyTextAttachmentsAsPlainText:!1,pdfAsImage:!1,disableAutoScroll:!1,renderUserContentAsMarkdown:!1,alwaysShowSidebarOnDesktop:!1,autoShowSidebarOnNewChat:!0,autoMicOnEmpty:!1,fullHeightCodeBlocks:!1,showRawModelNames:!1,mcpServers:"[]",mcpServerUsageStats:"{}",agenticMaxTurns:10,agenticMaxToolPreviewLines:25,showToolCallInProgress:!1,alwaysShowAgenticTurns:!1,samplers:"",backend_sampling:!1,temperature:void 0,dynatemp_range:void 0,dynatemp_exponent:void 0,top_k:void 0,top_p:void 0,min_p:void 0,xtc_probability:void 0,xtc_threshold:void 0,typ_p:void 0,repeat_last_n:void 0,repeat_penalty:void 0,presence_penalty:void 0,frequency_penalty:void 0,dry_multiplier:void 0,dry_base:void 0,dry_allowed_length:void 0,dry_penalty_last_n:void 0,max_tokens:void 0,custom:"",preEncodeConversation:!1,pyInterpreterEnabled:!1,enableContinueGeneration:!1},fu={apiKey:"Set the API Key if you are using <code>--api-key</code> option for the server.",systemMessage:"The starting message that defines how model should behave.",showSystemMessage:"Display the system message at the top of each conversation.",theme:"Choose the color theme for the interface. You can choose between System (follows your device settings), Light, or Dark.",pasteLongTextToFileLen:"On pasting long text, it will be converted to a file. You can control the file length by setting the value of this parameter. Value 0 means disable.",copyTextAttachmentsAsPlainText:"When copying a message with text attachments, combine them into a single plain text string instead of a special format that can be pasted back as attachments.",samplers:'The order at which samplers are applied, in simplified way. Default is "top_k;typ_p;top_p;min_p;temperature": top_k->typ_p->top_p->min_p->temperature',backend_sampling:"Enable backend-based samplers. When enabled, supported samplers run on the accelerator backend for faster sampling.",temperature:"Controls the randomness of the generated text by affecting the probability distribution of the output tokens. Higher = more random, lower = more focused.",dynatemp_range:"Addon for the temperature sampler. The added value to the range of dynamic temperature, which adjusts probabilities by entropy of tokens.",dynatemp_exponent:"Addon for the temperature sampler. Smoothes out the probability redistribution based on the most probable token.",top_k:"Keeps only k top tokens.",top_p:"Limits tokens to those that together have a cumulative probability of at least p",min_p:"Limits tokens based on the minimum probability for a token to be considered, relative to the probability of the most likely token.",xtc_probability:"XTC sampler cuts out top tokens; this parameter controls the chance of cutting tokens at all. 0 disables XTC.",xtc_threshold:"XTC sampler cuts out top tokens; this parameter controls the token probability that is required to cut that token.",typ_p:"Sorts and limits tokens based on the difference between log-probability and entropy.",repeat_last_n:"Last n tokens to consider for penalizing repetition",repeat_penalty:"Controls the repetition of token sequences in the generated text",presence_penalty:"Limits tokens based on whether they appear in the output or not.",frequency_penalty:"Limits tokens based on how often they appear in the output.",dry_multiplier:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling multiplier.",dry_base:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling base value.",dry_allowed_length:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the allowed length for DRY sampling.",dry_penalty_last_n:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens.",max_tokens:"The maximum number of token per output. Use -1 for infinite (no limit).",custom:"Custom JSON parameters to send to the API. Must be valid JSON format.",showThoughtInProgress:"Expand thought process by default when generating messages.",disableReasoningParsing:"Send reasoning_format=none so the server returns thinking tokens inline instead of extracting them into a separate field.",excludeReasoningFromContext:"S
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),fa=Gt,Un=Cr),ln===void 0&&(ln=!0);const Vr={code:Un,language:fa};Ho("before:highlight",Vr);const Us=Vr.result?Vr.result:On(Vr.language,Vr.code,ln);return Us.code=Vr.code,Ho("after:highlight",Us),Us}function On(Gt,Cr,ln,Un){const fa=Object.create(null);function Vr(Qt,gr){return Qt.keywords[gr]}function Us(){if(!nr.keywords){ga.addText(Fn);return}let Qt=0;nr.keywordPatternRe.lastIndex=0;let gr=nr.keywordPatternRe.exec(Fn),yr="";for(;gr;){yr+=Fn.substring(Qt,gr.index);const jr=$a.case_insensitive?gr[0].toLowerCase():gr[0],Xn=Vr(nr,jr);if(Xn){const[ai,gd]=Xn;if(ga.addText(yr),yr="",fa[jr]=(fa[jr]||0)+1,fa[jr]<=Ut&&(_a+=gd),ai.startsWith("_"))yr+=gr[0];else{const Vo=$a.classNameAliases[ai]||ai;gn(gr[0],Vo)}}else yr+=gr[0];Qt=nr.keywordPatternRe.lastIndex,gr=nr.keywordPatternRe.exec(Fn)}yr+=Fn.substring(Qt),ga.addText(yr)}function nc(){if(Fn==="")return;let Qt=null;if(typeof nr.subLanguage=="string"){if(!Xe[nr.subLanguage]){ga.addText(Fn);return}Qt=On(nr.subLanguage,Fn,!0,Sl[nr.subLanguage]),Sl[nr.subLanguage]=Qt._top}else Qt=Ln(Fn,nr.subLanguage.length?nr.subLanguage:null);nr.relevance>0&&(_a+=Qt.relevance),ga.__addSublanguage(Qt._emitter,Qt.language)}function gi(){nr.subLanguage!=null?nc():Us(),Fn=""}function gn(Qt,gr){Qt!==""&&(ga.startScope(gr),ga.addText(Qt),ga.endScope())}function _l(Qt,gr){let yr=1;const jr=gr.length-1;for(;yr<=jr;){if(!Qt._emit[yr]){yr++;continue}const Xn=$a.classNameAliases[Qt[yr]]||Qt[yr],ai=gr[yr];Xn?gn(ai,Xn):(Fn=ai,Us(),Fn=""),yr++}}function bl(Qt,gr){return Qt.scope&&typeof Qt.scope=="string"&&ga.openNode($a.classNameAliases[Qt.scope]||Qt.scope),Qt.beginScope&&(Qt.beginScope._wrap?(gn(Fn,$a.classNameAliases[Qt.beginScope._wrap]||Qt.beginScope._wrap),Fn=""):Qt.beginScope._multi&&(_l(Qt.beginScope,gr),Fn="")),nr=Object.create(Qt,{parent:{value:nr}}),nr}function Yo(Qt,gr,yr){let jr=E(Qt.endRe,yr);if(jr){if(Qt["on:end"]){const Xn=new e(Qt);Qt["on:end"](gr,Xn),Xn.isMatchIgnored&&(jr=!1)}if(jr){for(;Qt.endsParent&&Qt.parent;)Qt=Qt.parent;return Qt}}if(Qt.endsWithParent)return Yo(Qt.parent,gr,yr)}function md(Qt){return nr.matcher.regexIndex===0?(Fn+=Qt[0],1):(Ci=!0,0)}function fd(Qt){const gr=Qt[0],yr=Qt.rule,jr=new e(yr),Xn=[yr.__beforeBegin,yr["on:begin"]];for(const ai of Xn)if(ai&&(ai(Qt,jr),jr.isMatchIgnored))return md(gr);return yr.skip?Fn+=gr:(yr.excludeBegin&&(Fn+=gr),gi(),!yr.returnBegin&&!yr.excludeBegin&&(Fn=gr)),bl(yr,Qt),yr.returnBegin?0:gr.length}function uu(Qt){const gr=Qt[0],yr=Cr.substring(Qt.index),jr=Yo(nr,Qt,yr);if(!jr)return ut;const Xn=nr;nr.endScope&&nr.endScope._wrap?(gi(),gn(gr,nr.endScope._wrap)):nr.endScope&&nr.endScope._multi?(gi(),_l(nr.endScope,Qt)):Xn.skip?Fn+=gr:(Xn.returnEnd||Xn.excludeEnd||(Fn+=gr),gi(),Xn.excludeEnd&&(Fn=gr));do nr.scope&&ga.closeNode(),!nr.skip&&!nr.subLanguage&&(_a+=nr.relevance),nr=nr.parent;while(nr!==jr.parent);return jr.starts&&bl(jr.starts,Qt),Xn.returnEnd?0:gr.length}function Ah(){const Qt=[];for(let gr=nr;gr!==$a;gr=gr.parent)gr.scope&&Qt.unshift(gr.scope);Qt.forEach(gr=>ga.openNode(gr))}let Eo={};function ac(Qt,gr){const yr=gr&&gr[0];if(Fn+=Qt,yr==null)return gi(),0;if(Eo.type==="begin"&&gr.type==="end"&&Eo.index===gr.index&&yr===""){if(Fn+=Cr.slice(gr.index,gr.index+1),!Pt){const jr=new Error(`0 width match regex (${Gt})`);throw jr.languageName=Gt,jr.badRule=Eo.rule,jr}return 1}if(Eo=gr,gr.type==="begin")return fd(gr);if(gr.type==="illegal"&&!ln){const jr=new Error('Illegal lexeme "'+yr+'" for mode "'+(nr.scope||"<unnamed>")+'"');throw jr.mode=nr,jr}else if(gr.type==="end"){const jr=uu(gr);if(jr!==ut)return jr}if(gr.type==="illegal"&&yr==="")return Fn+=`
|
||||
`,1;if(vo>1e5&&vo>gr.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Fn+=yr,yr.length}const $a=Ui(Gt);if(!$a)throw st(kt.replace("{}",Gt)),new Error('Unknown language: "'+Gt+'"');const du=zt($a);let ic="",nr=Un||du;const Sl={},ga=new Tt.__emitter(Tt);Ah();let Fn="",_a=0,ni=0,vo=0,Ci=!1;try{if($a.__emitTokens)$a.__emitTokens(Cr,ga);else{for(nr.matcher.considerAll();;){vo++,Ci?Ci=!1:nr.matcher.considerAll(),nr.matcher.lastIndex=ni;const Qt=nr.matcher.exec(Cr);if(!Qt)break;const gr=Cr.substring(ni,Qt.index),yr=ac(gr,Qt);ni=Qt.index+yr}ac(Cr.substring(ni))}return ga.finalize(),ic=ga.toHTML(),{language:Gt,value:ic,relevance:_a,illegal:!1,_emitter:ga,_top:nr}}catch(Qt){if(Qt.message&&Qt.message.includes("Illegal"))return{language:Gt,value:Ft(Cr),illegal:!0,relevance:0,_illegalBy:{message:Qt.message,index:ni,context:Cr.slice(ni-100,ni+100),mode:Qt.mode,resultSoFar:ic},_emitter:ga};if(Pt)return{language:Gt,value:Ft(Cr),illegal:!1,relevance:0,errorRaised:Qt,_emitter:ga,_top:nr};throw Qt}}function vr(Gt){const Cr={value:Ft(Gt),illegal:!1,relevance:0,_top:bt,_emitter:new Tt.__emitter(Tt)};return Cr._emitter.addText(Gt),Cr}function Ln(Gt,Cr){Cr=Cr||Tt.languages||Object.keys(Xe);const ln=vr(Gt),Un=Cr.filter(Ui).filter(So).map(gi=>On(gi,Gt,!1));Un.unshift(ln);const fa=Un.sort((gi,gn)=>{if(gi.relevance!==gn.relevance)return gn.relevance-gi.relevance;if(gi.language&&gn.language){if(Ui(gi.language).supersetOf===gn.language)return 1;if(Ui(gn.language).supersetOf===gi.language)return-1}return 0}),[Vr,Us]=fa,nc=Vr;return nc.secondBest=Us,nc}function Fs(Gt,Cr,ln){const Un=Cr&&pt[Cr]||ln;Gt.classList.add("hljs"),Gt.classList.add(`language-${Un}`)}function fi(Gt){let Cr=null;const ln=Dt(Gt);if(St(ln))return;if(Ho("before:highlightElement",{el:Gt,language:ln}),Gt.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Gt);return}if(Gt.children.length>0&&(Tt.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Gt)),Tt.throwUnescapedHTML))throw new Ot("One of your code blocks includes unescaped HTML.",Gt.innerHTML);Cr=Gt;const Un=Cr.textContent,fa=ln?ur(Un,{language:ln,ignoreIllegals:!0}):Ln(Un);Gt.innerHTML=fa.value,Gt.dataset.highlighted="yes",Fs(Gt,ln,fa.language),Gt.result={language:fa.language,re:fa.relevance,relevance:fa.relevance},fa.secondBest&&(Gt.secondBest={language:fa.secondBest.language,relevance:fa.secondBest.relevance}),Ho("after:highlightElement",{el:Gt,result:fa,text:Un})}function _o(Gt){Tt=er(Tt,Gt)}const gs=()=>{ri(),Ae("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Qi(){ri(),Ae("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let bo=!1;function ri(){function Gt(){ri()}if(document.readyState==="loading"){bo||window.addEventListener("DOMContentLoaded",Gt,!1),bo=!0;return}document.querySelectorAll(Tt.cssSelector).forEach(fi)}function cu(Gt,Cr){let ln=null;try{ln=Cr(Re)}catch(Un){if(st("Language definition for '{}' could not be registered.".replace("{}",Gt)),Pt)st(Un);else throw Un;ln=bt}ln.name||(ln.name=Gt),Xe[Gt]=ln,ln.rawDefinition=Cr.bind(null,Re),ln.aliases&&ia(ln.aliases,{languageName:Gt})}function Xi(Gt){delete Xe[Gt];for(const Cr of Object.keys(pt))pt[Cr]===Gt&&delete pt[Cr]}function rc(){return Object.keys(Xe)}function Ui(Gt){return Gt=(Gt||"").toLowerCase(),Xe[Gt]||Xe[pt[Gt]]}function ia(Gt,{languageName:Cr}){typeof Gt=="string"&&(Gt=[Gt]),Gt.forEach(ln=>{pt[ln.toLowerCase()]=Cr})}function So(Gt){const Cr=Ui(Gt);return Cr&&!Cr.disableAutodetect}function Bs(Gt){Gt["before:highlightBlock"]&&!Gt["before:highlightElement"]&&(Gt["before:highlightElement"]=Cr=>{Gt["before:highlightBlock"](Object.assign({block:Cr.el},Cr))}),Gt["after:highlightBlock"]&&!Gt["after:highlightElement"]&&(Gt["after:highlightElement"]=Cr=>{Gt["after:highlightBlock"](Object.assign({block:Cr.el},Cr))})}function wh(Gt){Bs(Gt),Ct.push(Gt)}function gl(Gt){const Cr=Ct.indexOf(Gt);Cr!==-1&&Ct.splice(Cr,1)}function Ho(Gt,Cr){const ln=Gt;Ct.forEach(function(Un){Un[ln]&&Un[ln](Cr)})}function pd(Gt){return Ae("10.7.0","highlightBlock will be removed entirely in v12.0"),Ae("10.7.0","Please use highlightElement now."),fi(Gt)}Object.assign(Re,{highlight:ur,highlightAuto:Ln,highlightAll:ri,highlightElement:fi,highlightBlock:pd,configure:_o,initHighlighting:gs,initHighlightingOnLoad:Qi,registerLanguage:cu,unregisterLanguage:Xi,listLanguages:rc,getLanguage:Ui,registerAliases:ia,autoDetection:So,inherit:er,addPlugin:wh,removePlugin:gl}),Re.debugMode=function(){Pt=!1},Re.safeMode=function(){Pt=!0},Re.versionString=lt,Re.regex={concat:g,lookahead:h,either:_,optional:f,anyNumberOfTimes:m};for(const Gt in be)typeof be[Gt]=="object"&&t(be[Gt]);return Object.assign(Re,be),Re},xt=yt({})
Line truncated
|
||||
`},f]}}return mT=a,mT}var fT,mk;function Ase(){if(mk)return fT;mk=1;function t(e){const r="[a-zA-Z_][\\w.]*",n="<\\?(lasso(script)?|=)",a="\\]|\\?>",i={$pattern:r+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},s=e.COMMENT("<!--","-->",{relevance:0}),o={className:"meta",begin:"\\[noprocess\\]",starts:{end:"\\[/noprocess\\]",returnEnd:!0,contains:[s]}},l={className:"meta",begin:"\\[/noprocess|"+n},c={className:"symbol",begin:"'"+r+"'"},u=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(e.C_NUMBER_MODE,{begin:e.C_NUMBER_RE+"|(-?infinity|NaN)\\b"}),e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"`",end:"`"},{variants:[{begin:"[#$]"+r},{begin:"#",end:"\\d+",illegal:"\\W"}]},{className:"type",begin:"::\\s*",end:r,illegal:"\\W"},{className:"params",variants:[{begin:"-(?!infinity)"+r,relevance:0},{begin:"(\\.\\.\\.)"}]},{begin:/(->|\.)\s*/,relevance:0,contains:[c]},{className:"class",beginKeywords:"define",returnEnd:!0,end:"\\(|=>",contains:[e.inherit(e.TITLE_MODE,{begin:r+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[|"+n,returnEnd:!0,relevance:0,contains:[s]}},o,l,{className:"meta",begin:"\\[no_square_brackets",starts:{end:"\\[/no_square_brackets\\]",keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[noprocess\\]|"+n,returnEnd:!0,contains:[s]}},o,l].concat(u)}},{className:"meta",begin:"\\[",relevance:0},{className:"meta",begin:"^#!",end:"lasso9$",relevance:10}].concat(u)}}return fT=t,fT}var gT,fk;function Rse(){if(fk)return gT;fk=1;function t(e){const n=e.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(D=>D+"(?![a-zA-Z@:_])")),a=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map(D=>D+"(?![a-zA-Z:_])").join("|")),i=[{begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}],s=[{begin:/\^{6}[0-9a-f]{6}/},{begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/},{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],o={className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0,begin:n},{endsParent:!0,begin:a},{endsParent:!0,variants:s},{endsParent:!0,relevance:0,variants:i}]},l={className:"params",relevance:0,begin:/#+\d?/},c={variants:s},u={className:"built_in",relevance:0,begin:/[$&^_]/},d={className:"meta",begin:/% ?!(T[eE]X|tex|BIB|bib)/,end:"$",relevance:10},h=e.COMMENT("%","$",{relevance:0}),m=[o,l,c,u,d,h],f={begin:/\{/,end:/\}/,relevance:0,contains:["self",...m]},g=e.inheri
Line truncated
|
||||
]`,g={scope:"string",variants:[d,u,h,m]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},_=["false","null","true"],S=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:S,literal:(K=>{const z=[];return K.forEach(re=>{z.push(re),re.toLowerCase()===re?z.push(re.toUpperCase()):z.push(re.toLowerCase())}),z})(_),built_in:E},T=K=>K.map(z=>z.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,r.concat(f,"+"),r.concat("(?!",T(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},A=r.concat(a,"\\b(?!\\()"),I={variants:[{match:[r.concat(/::/,r.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,r.concat(/::/,r.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[i,r.concat("::",r.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},x={scope:"attr",match:r.concat(a,r.lookahead(":"),r.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[x,o,I,e.C_BLOCK_COMMENT_MODE,g,b,w]},$={relevance:0,match:[/\b/,r.concat("(?!fn\\b|function\\b|",T(S).join("\\b|"),"|",T(E).join("\\b|"),"\\b)"),a,r.concat(f,"*"),r.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push($);const H=[x,I,e.C_BLOCK_COMMENT_MODE,g,b,w],G={begin:r.concat(/#\[\s*\\?/,r.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:_,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:_,keyword:["new","array"]},contains:["self",...H]},...H,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:v,contains:[G,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,$,I,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",G,o,I,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywor
Line truncated
|
||||
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}return OC=t,OC}var NC,O9;function Goe(){if(O9)return NC;O9=1;function t(e){const r="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},a={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:r+":",relevance:0},e.C_NUMBER_MODE,a,n,{begin:"\\|[ ]*"+r+"([ ]+"+r+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+r}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,n,e.C_NUMBER_MODE,a]}]}}return NC=t,NC}var IC,N9;function qoe(){if(N9)return IC;N9=1;function t(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}return IC=t,IC}var xC,I9;function zoe(){if(I9)return xC;I9=1;function t(e){const r={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},a={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},i=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],s=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],o=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSiLine truncated
|
||||
]*?"'`},{begin:`"[^\r
|
||||
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}return MC=t,MC}var kC,k9;function Voe(){if(k9)return kC;k9=1;function t(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}return kC=t,kC}var PC,P9;function Woe(){if(P9)return PC;P9=1;const t=c=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:c.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:c.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...r],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target
Line truncated
|
||||
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}return kC=t,kC}var PC,k9;function Voe(){if(k9)return PC;k9=1;function t(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}return PC=t,PC}var LC,P9;function Woe(){if(P9)return LC;P9=1;const t=c=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:c.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:c.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...r],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target
Line truncated
|
||||
(multipart)?`,end:`\\]
|
||||
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return LC=t,LC}var FC,F9;function joe(){if(F9)return FC;F9=1;function t(A){return A?typeof A=="string"?A:A.source:null}function e(A){return r("(?=",A,")")}function r(...A){return A.map(x=>t(x)).join("")}function n(A){const I=A[A.length-1];return typeof I=="object"&&I.constructor===Object?(A.splice(A.length-1,1),I):{}}function a(...A){return"("+(n(A).capture?"":"?:")+A.map(D=>t(D)).join("|")+")"}const i=A=>r(/\b/,A,/\w$/.test(A)?/\b/:/\B/),s=["Protocol","Type"].map(i),o=["init","self"].map(i),l=["Any","Self"],c=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],u=["false","nil","true"],d=["assignment","associativity","higherThan","left","lowerThan","none","right"],h=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],m=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],f=a(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),g=a(f,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),b=r(f,g,"*"),_=a(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),S=a(_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),E=r(_,S,"*"),y=r(/[A-Z]/,S,"*"),v=["attached","autoclosure",r(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",r(/objc\(/,E,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],T=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function w(A){const I={match:/\s+/,relevance:0},x=A.COMMENT("/\\*","\\*/",{contains:["self"]}),D=[A.C_LINE_COMMENT_MODE,x],$={match:[/\./,a(...s,...o)],className:{2:"keyword"}},H={match:r(/\./,a(...c)),relevance:0},G=c.filter(ut=>typeof ut=="string").concat(["_|0"]),K=c.filter(ut=>typeof ut!="string").concat(l).map(i),z={variants:[{className:"keyword",match:a(...K,...o)}]},re={$pattern:a(/\b\w+/,/#\w+/),keyword:G.concat(h),literal:u},W=[$,H,z],ie={match:r(/\./,a(...m)),relevance:0},M={className:"built_in",match:r(/\b/,a(...m),/(?=\()/)},B=[ie,M],J={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:
Line truncated
|
||||
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return FC=t,FC}var BC,F9;function joe(){if(F9)return BC;F9=1;function t(A){return A?typeof A=="string"?A:A.source:null}function e(A){return r("(?=",A,")")}function r(...A){return A.map(x=>t(x)).join("")}function n(A){const I=A[A.length-1];return typeof I=="object"&&I.constructor===Object?(A.splice(A.length-1,1),I):{}}function a(...A){return"("+(n(A).capture?"":"?:")+A.map(D=>t(D)).join("|")+")"}const i=A=>r(/\b/,A,/\w$/.test(A)?/\b/:/\B/),s=["Protocol","Type"].map(i),o=["init","self"].map(i),l=["Any","Self"],c=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],u=["false","nil","true"],d=["assignment","associativity","higherThan","left","lowerThan","none","right"],h=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],m=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],f=a(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),g=a(f,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),b=r(f,g,"*"),_=a(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),S=a(_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),E=r(_,S,"*"),y=r(/[A-Z]/,S,"*"),v=["attached","autoclosure",r(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",r(/objc\(/,E,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],T=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function w(A){const I={match:/\s+/,relevance:0},x=A.COMMENT("/\\*","\\*/",{contains:["self"]}),D=[A.C_LINE_COMMENT_MODE,x],$={match:[/\./,a(...s,...o)],className:{2:"keyword"}},H={match:r(/\./,a(...c)),relevance:0},G=c.filter(ut=>typeof ut=="string").concat(["_|0"]),K=c.filter(ut=>typeof ut!="string").concat(l).map(i),z={variants:[{className:"keyword",match:a(...K,...o)}]},re={$pattern:a(/\b\w+/,/#\w+/),keyword:G.concat(h),literal:u},W=[$,H,z],ie={match:r(/\./,a(...m)),relevance:0},M={className:"built_in",match:r(/\b/,a(...m),/(?=\()/)},B=[ie,M],J={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:
Line truncated
|
||||
|
||||
`)}const a=n.map(i=>{if(i.type===Qr.MCP_PROMPT){const s=i;return{type:Qr.MCP_PROMPT,name:s.name,serverName:s.serverName,promptName:s.promptName,content:s.content,arguments:s.arguments}}return{type:Qr.TEXT,name:i.name,content:i.content}});return`${JSON.stringify(t)}
|
||||
${JSON.stringify(a,null,2)}`}function Ece(t){const e={message:t,textAttachments:[],mcpPromptAttachments:[]};if(!t.startsWith('"'))return e;try{let r=-1,n=!1;for(let u=1;u<t.length;u++){const d=t[u];if(n){n=!1;continue}if(d==="\\"){n=!0;continue}if(d==='"'){r=u;break}}if(r===-1)return e;const a=t.substring(0,r+1),i=t.substring(r+1).trim(),s=JSON.parse(a);if(!i||!i.startsWith("["))return{message:s,textAttachments:[],mcpPromptAttachments:[]};const o=JSON.parse(i),l=[],c=[];for(const u of o)vce(u)?c.push({type:Qr.MCP_PROMPT,name:u.name,serverName:u.serverName,promptName:u.promptName,content:u.content,arguments:u.arguments}):yce(u)&&l.push({type:Qr.TEXT,name:u.name,content:u.content});return{message:s,textAttachments:l,mcpPromptAttachments:c}}catch{return e}}function vce(t){if(typeof t!="object"||t===null)return!1;const e=t;return(e.type===Qr.MCP_PROMPT||e.type==="MCP_PROMPT")&&typeof e.name=="string"&&typeof e.serverName=="string"&&typeof e.promptName=="string"&&typeof e.content=="string"}function yce(t){if(typeof t!="object"||t===null)return!1;const e=t;return(e.type===Qr.TEXT||e.type==="TEXT")&&typeof e.name=="string"&&typeof e.content=="string"}function p_(t){if(!t)return"FILE";if(t.includes("/")){const e=t.split("/").pop();if(e)return e.includes(".")?e.split(".").pop()?.toUpperCase()||"FILE":e.toUpperCase()}if(t.includes(".")){const e=t.split(".").pop();if(e)return e.toUpperCase()}return t.toUpperCase()}function SR(t,e=150){return t.length>e?t.slice(0,e)+"...":t}function sl(t){switch(t){case ta.JPEG:case ta.PNG:case ta.GIF:case ta.WEBP:case ta.SVG:return kn.IMAGE;case ja.MP3_MPEG:case ja.MP3:case ja.MP4:case ja.WAV:case ja.WEBM:case ja.WEBM_OPUS:return kn.AUDIO;case If.PDF:return kn.PDF;case Lt.PLAIN:case Lt.MARKDOWN:case Lt.ASCIIDOC:case Lt.JAVASCRIPT:case Lt.JAVASCRIPT_APP:case Lt.TYPESCRIPT:case Lt.JSX:case Lt.TSX:case Lt.CSS:case Lt.HTML:case Lt.JSON:case Lt.XML_TEXT:case Lt.XML_APP:case Lt.YAML_TEXT:case Lt.YAML_APP:case Lt.CSV:case Lt.PYTHON:case Lt.JAVA:case Lt.CPP_SRC:case Lt.C_SRC:case Lt.C_HDR:case Lt.PHP:case Lt.RUBY:case Lt.GO:case Lt.RUST:case Lt.SHELL:case Lt.BAT:case Lt.SQL:case Lt.R:case Lt.SCALA:case Lt.KOTLIN:case Lt.SWIFT:case Lt.DART:case Lt.VUE:case Lt.SVELTE:case Lt.LATEX:case Lt.BIBTEX:case Lt.CUDA:case Lt.CPP_HDR:case Lt.CSHARP:case Lt.HASKELL:case Lt.PROPERTIES:case Lt.TEX:case Lt.TEX_APP:return kn.TEXT;default:return null}}function DI(t){switch(t.toLowerCase().substring(t.lastIndexOf("."))){case Zs.JPG:case Zs.JPEG:case Zs.PNG:case Zs.GIF:case Zs.WEBP:case Zs.SVG:return kn.IMAGE;case Nf.MP3:case Nf.WAV:return kn.AUDIO;case RI.PDF:return kn.PDF;case Wt.TXT:case Wt.MD:case Wt.ADOC:case Wt.JS:case Wt.TS:case Wt.JSX:case Wt.TSX:case Wt.CSS:case Wt.HTML:case Wt.HTM:case Wt.JSON:case Wt.XML:case Wt.YAML:case Wt.YML:case Wt.CSV:case Wt.LOG:case Wt.PY:case Wt.JAVA:case Wt.CPP:case Wt.C:case Wt.H:case Wt.PHP:case Wt.RB:case Wt.GO:case Wt.RS:case Wt.SH:case Wt.BAT:case Wt.SQL:case Wt.R:case Wt.SCALA:case Wt.KT:case Wt.SWIFT:case Wt.DART:case Wt.VUE:case Wt.SVELTE:case Wt.TEX:case Wt.BIB:case Wt.COMP:case Wt.CU:case Wt.CUH:case Wt.HPP:case Wt.HS:case Wt.PROPERTIES:return kn.TEXT;default:return null}}function Tce(t,e){if(e){const n=sl(e);if(n===kn.IMAGE||n===kn.AUDIO||n===kn.PDF)return!0}const r=DI(t);return r===kn.IMAGE||r===kn.AUDIO||r===kn.PDF,!0}function pb(t){if(typeof t!="number")return"Unknown";if(t===0)return"0 Bytes";const e=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,n)).toFixed(2))+" "+r[n]}function Cce(t){return typeof t!="number"?"Unknown":t>=1e9?`${(t/1e9).toFixed(2)}B`:t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(2)}K`:t.toString()}function m_(t){return typeof t!="number"?"Unknown":t.toLocaleString()}function u4(t){try{const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch{return t}}function wce(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function f_(t){if(t<0)return"0s";const e=t/T1;if(e<vne)return`${e.toFixed(1)}s`;if(e<yne)return`${e.toFixed(1)}s`;const r=Math.floor(e/h5),n=Math.floor(e%h5/d5),a=Math.floor(e%d5),i=[];return r>0&&i.push(`${r}h`),n>0&&i.push(`${n}min`),(a>0||i.length===0)&&i.push(`${a}s`),i.join(" ")}function wm(t,e,r,n){const a=n?`${e} (${n})`:e;return`
|
||||
${JSON.stringify(a,null,2)}`}function Ece(t){const e={message:t,textAttachments:[],mcpPromptAttachments:[]};if(!t.startsWith('"'))return e;try{let r=-1,n=!1;for(let u=1;u<t.length;u++){const d=t[u];if(n){n=!1;continue}if(d==="\\"){n=!0;continue}if(d==='"'){r=u;break}}if(r===-1)return e;const a=t.substring(0,r+1),i=t.substring(r+1).trim(),s=JSON.parse(a);if(!i||!i.startsWith("["))return{message:s,textAttachments:[],mcpPromptAttachments:[]};const o=JSON.parse(i),l=[],c=[];for(const u of o)vce(u)?c.push({type:Qr.MCP_PROMPT,name:u.name,serverName:u.serverName,promptName:u.promptName,content:u.content,arguments:u.arguments}):yce(u)&&l.push({type:Qr.TEXT,name:u.name,content:u.content});return{message:s,textAttachments:l,mcpPromptAttachments:c}}catch{return e}}function vce(t){if(typeof t!="object"||t===null)return!1;const e=t;return(e.type===Qr.MCP_PROMPT||e.type==="MCP_PROMPT")&&typeof e.name=="string"&&typeof e.serverName=="string"&&typeof e.promptName=="string"&&typeof e.content=="string"}function yce(t){if(typeof t!="object"||t===null)return!1;const e=t;return(e.type===Qr.TEXT||e.type==="TEXT")&&typeof e.name=="string"&&typeof e.content=="string"}function p_(t){if(!t)return"FILE";if(t.includes("/")){const e=t.split("/").pop();if(e)return e.includes(".")?e.split(".").pop()?.toUpperCase()||"FILE":e.toUpperCase()}if(t.includes(".")){const e=t.split(".").pop();if(e)return e.toUpperCase()}return t.toUpperCase()}function ER(t,e=150){return t.length>e?t.slice(0,e)+"...":t}function ol(t){switch(t){case ta.JPEG:case ta.PNG:case ta.GIF:case ta.WEBP:case ta.SVG:return kn.IMAGE;case ja.MP3_MPEG:case ja.MP3:case ja.MP4:case ja.WAV:case ja.WEBM:case ja.WEBM_OPUS:return kn.AUDIO;case If.PDF:return kn.PDF;case Lt.PLAIN:case Lt.MARKDOWN:case Lt.ASCIIDOC:case Lt.JAVASCRIPT:case Lt.JAVASCRIPT_APP:case Lt.TYPESCRIPT:case Lt.JSX:case Lt.TSX:case Lt.CSS:case Lt.HTML:case Lt.JSON:case Lt.XML_TEXT:case Lt.XML_APP:case Lt.YAML_TEXT:case Lt.YAML_APP:case Lt.CSV:case Lt.PYTHON:case Lt.JAVA:case Lt.CPP_SRC:case Lt.C_SRC:case Lt.C_HDR:case Lt.PHP:case Lt.RUBY:case Lt.GO:case Lt.RUST:case Lt.SHELL:case Lt.BAT:case Lt.SQL:case Lt.R:case Lt.SCALA:case Lt.KOTLIN:case Lt.SWIFT:case Lt.DART:case Lt.VUE:case Lt.SVELTE:case Lt.LATEX:case Lt.BIBTEX:case Lt.CUDA:case Lt.CPP_HDR:case Lt.CSHARP:case Lt.HASKELL:case Lt.PROPERTIES:case Lt.TEX:case Lt.TEX_APP:return kn.TEXT;default:return null}}function DI(t){switch(t.toLowerCase().substring(t.lastIndexOf("."))){case Zs.JPG:case Zs.JPEG:case Zs.PNG:case Zs.GIF:case Zs.WEBP:case Zs.SVG:return kn.IMAGE;case Nf.MP3:case Nf.WAV:return kn.AUDIO;case OI.PDF:return kn.PDF;case Wt.TXT:case Wt.MD:case Wt.ADOC:case Wt.JS:case Wt.TS:case Wt.JSX:case Wt.TSX:case Wt.CSS:case Wt.HTML:case Wt.HTM:case Wt.JSON:case Wt.XML:case Wt.YAML:case Wt.YML:case Wt.CSV:case Wt.LOG:case Wt.PY:case Wt.JAVA:case Wt.CPP:case Wt.C:case Wt.H:case Wt.PHP:case Wt.RB:case Wt.GO:case Wt.RS:case Wt.SH:case Wt.BAT:case Wt.SQL:case Wt.R:case Wt.SCALA:case Wt.KT:case Wt.SWIFT:case Wt.DART:case Wt.VUE:case Wt.SVELTE:case Wt.TEX:case Wt.BIB:case Wt.COMP:case Wt.CU:case Wt.CUH:case Wt.HPP:case Wt.HS:case Wt.PROPERTIES:return kn.TEXT;default:return null}}function Tce(t,e){if(e){const n=ol(e);if(n===kn.IMAGE||n===kn.AUDIO||n===kn.PDF)return!0}const r=DI(t);return r===kn.IMAGE||r===kn.AUDIO||r===kn.PDF,!0}function mb(t){if(typeof t!="number")return"Unknown";if(t===0)return"0 Bytes";const e=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,n)).toFixed(2))+" "+r[n]}function Cce(t){return typeof t!="number"?"Unknown":t>=1e9?`${(t/1e9).toFixed(2)}B`:t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(2)}K`:t.toString()}function m_(t){return typeof t!="number"?"Unknown":t.toLocaleString()}function u4(t){try{const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch{return t}}function wce(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function f_(t){if(t<0)return"0s";const e=t/T1;if(e<vne)return`${e.toFixed(1)}s`;if(e<yne)return`${e.toFixed(1)}s`;const r=Math.floor(e/h5),n=Math.floor(e%h5/d5),a=Math.floor(e%d5),i=[];return r>0&&i.push(`${r}h`),n>0&&i.push(`${n}min`),(a>0||i.length===0)&&i.push(`${a}s`),i.join(" ")}function wm(t,e,r,n){const a=n?`${e} (${n})`:e;return`
|
||||
|
||||
--- ${t}: ${a} ---
|
||||
${r}`}function MI(t){return t.isComposing||t.keyCode===229}function Ace(t,e){return t.includes("$")?t.split(`
|
||||
@@ -51,14 +51,14 @@ ${r}`}function MI(t){return t.isComposing||t.keyCode===229}function Ace(t,e){ret
|
||||
`)?"":`
|
||||
`;l="$$"+d+u+h+"$$"}return l}),t=Rce(t),t=t.replace(new RegExp("(?<!\\\\)\\\\\\((.+?)\\\\\\)","g"),"$$$1$").replace(new RegExp("(?<!\\\\)\\\\\\[([\\s\\S]*?)\\\\\\]","g"),(s,o)=>`$$${o}$$`),t=t.replace(/<<CODE_BLOCK_(\d+)>>/g,(s,o)=>a[parseInt(o)]),e.size>0&&(t=t.split(`
|
||||
`).map((l,c)=>{const u=e.get(c);return u?u+l:l}).join(`
|
||||
`)),t}function Oce(t,e){const r=[],n=[],a={},{hasVision:i,hasAudio:s}=e;for(const o of t){const l=sl(o.type);let c=!0,u="";switch(l){case kn.IMAGE:i||(c=!1,u="Images require a vision-capable model");break;case kn.AUDIO:s||(c=!1,u="Audio files require an audio-capable model");break;case kn.TEXT:case kn.PDF:break}c?r.push(o):(n.push(o),a[o.name]=u)}return{supportedFiles:r,unsupportedFiles:n,modalityReasons:a}}function Nce(t){const e=t.trim();if(!e)return"";const r=e.split(/[\\/]/);if(r.length===2){const[i,s]=r,o=i?.trim(),l=s?.trim();if(o&&l)return`${o}/${l}`}const a=r.pop()?.trim();return a&&a.length>0?a:e}function Cu(t){return typeof t=="number"?Math.round(t*C5)/C5:t}function SG(t){switch(t.toLowerCase().substring(t.lastIndexOf("."))){case".js":case".mjs":case".cjs":return"javascript";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascript";case".tsx":return"typescript";case".html":case".htm":return"html";case".css":return"css";case".scss":return"scss";case".less":return"less";case".vue":return"html";case".svelte":return"html";case".json":return"json";case".xml":return"xml";case".yaml":case".yml":return"yaml";case".toml":return"ini";case".csv":return"plaintext";case".py":return"python";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".cpp":case".cc":case".cxx":case".c++":return"cpp";case".c":return"c";case".h":case".hpp":return"cpp";case".cs":return"csharp";case".go":return"go";case".rs":return"rust";case".rb":return"ruby";case".php":return"php";case".swift":return"swift";case".dart":return"dart";case".r":return"r";case".lua":return"lua";case".pl":case".pm":return"perl";case".sh":case".bash":case".zsh":return"bash";case".bat":case".cmd":return"dos";case".ps1":return"powershell";case".sql":return"sql";case".md":case".markdown":return"markdown";case".tex":case".latex":return"latex";case".adoc":case".asciidoc":return"asciidoc";case".ini":case".cfg":case".conf":return"ini";case".dockerfile":return"dockerfile";case".nginx":return"nginx";case".graphql":case".gql":return"graphql";case".proto":return"protobuf";case".diff":case".patch":return"diff";case".log":return"plaintext";case".txt":return"plaintext";default:return"plaintext"}}async function Ice(t){return new Promise((e,r)=>{const n=new FileReader;n.onload=a=>{a.target?.result!==null&&a.target?.result!==void 0?e(a.target.result):r(new Error("Failed to read file"))},n.onerror=()=>r(new Error("File reading error")),n.readAsText(t)})}function xce(t,e={}){if(!t)return!0;const r={...$re,...e},n=t.substring(0,r.prefixLength);let a=0,i=0;for(let s=0;s<n.length;s++){const o=n.charCodeAt(s);if(o===0){a++;continue}o<32&&o!==9&&o!==10&&o!==13&&(o<8||o>13&&o<27)&&i++,o===65533&&i++}return!(a>r.maxAbsoluteNullBytes||i/n.length>r.suspiciousCharThresholdRatio)}function EG(t,e){let r=null;return(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>{t(...n),r=null},e)}}function Dce(t){return t.replace(Tne,"").slice(0,QU)}function Mce(t){return t.replace(Cne,"").slice(0,XU)}function kce(t){return`<div class="image-error-content">
|
||||
`)),t}function Oce(t,e){const r=[],n=[],a={},{hasVision:i,hasAudio:s}=e;for(const o of t){const l=ol(o.type);let c=!0,u="";switch(l){case kn.IMAGE:i||(c=!1,u="Images require a vision-capable model");break;case kn.AUDIO:s||(c=!1,u="Audio files require an audio-capable model");break;case kn.TEXT:case kn.PDF:break}c?r.push(o):(n.push(o),a[o.name]=u)}return{supportedFiles:r,unsupportedFiles:n,modalityReasons:a}}function Nce(t){const e=t.trim();if(!e)return"";const r=e.split(/[\\/]/);if(r.length===2){const[i,s]=r,o=i?.trim(),l=s?.trim();if(o&&l)return`${o}/${l}`}const a=r.pop()?.trim();return a&&a.length>0?a:e}function Cu(t){return typeof t=="number"?Math.round(t*C5)/C5:t}function SG(t){switch(t.toLowerCase().substring(t.lastIndexOf("."))){case".js":case".mjs":case".cjs":return"javascript";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascript";case".tsx":return"typescript";case".html":case".htm":return"html";case".css":return"css";case".scss":return"scss";case".less":return"less";case".vue":return"html";case".svelte":return"html";case".json":return"json";case".xml":return"xml";case".yaml":case".yml":return"yaml";case".toml":return"ini";case".csv":return"plaintext";case".py":return"python";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".cpp":case".cc":case".cxx":case".c++":return"cpp";case".c":return"c";case".h":case".hpp":return"cpp";case".cs":return"csharp";case".go":return"go";case".rs":return"rust";case".rb":return"ruby";case".php":return"php";case".swift":return"swift";case".dart":return"dart";case".r":return"r";case".lua":return"lua";case".pl":case".pm":return"perl";case".sh":case".bash":case".zsh":return"bash";case".bat":case".cmd":return"dos";case".ps1":return"powershell";case".sql":return"sql";case".md":case".markdown":return"markdown";case".tex":case".latex":return"latex";case".adoc":case".asciidoc":return"asciidoc";case".ini":case".cfg":case".conf":return"ini";case".dockerfile":return"dockerfile";case".nginx":return"nginx";case".graphql":case".gql":return"graphql";case".proto":return"protobuf";case".diff":case".patch":return"diff";case".log":return"plaintext";case".txt":return"plaintext";default:return"plaintext"}}async function Ice(t){return new Promise((e,r)=>{const n=new FileReader;n.onload=a=>{a.target?.result!==null&&a.target?.result!==void 0?e(a.target.result):r(new Error("Failed to read file"))},n.onerror=()=>r(new Error("File reading error")),n.readAsText(t)})}function xce(t,e={}){if(!t)return!0;const r={...$re,...e},n=t.substring(0,r.prefixLength);let a=0,i=0;for(let s=0;s<n.length;s++){const o=n.charCodeAt(s);if(o===0){a++;continue}o<32&&o!==9&&o!==10&&o!==13&&(o<8||o>13&&o<27)&&i++,o===65533&&i++}return!(a>r.maxAbsoluteNullBytes||i/n.length>r.suspiciousCharThresholdRatio)}function EG(t,e){let r=null;return(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>{t(...n),r=null},e)}}function Dce(t){return t.replace(Tne,"").slice(0,QU)}function Mce(t){return t.replace(Cne,"").slice(0,XU)}function kce(t){return`<div class="image-error-content">
|
||||
<span>Image cannot be displayed</span>
|
||||
<a href="${t}" target="_blank" rel="noopener noreferrer">(open link)</a>
|
||||
</div>`}function h4(t){const e=t.trim().toLowerCase();return e.startsWith(ho.WEBSOCKET)||e.startsWith(ho.WEBSOCKET_SECURE)?Is.WEBSOCKET:Is.STREAMABLE_HTTP}function p4(t){if(!t)return[];let e;if(typeof t=="string"){const r=t.trim();if(!r)return[];try{e=JSON.parse(r)}catch(n){return console.warn("[MCP] Failed to parse mcpServers JSON, ignoring value:",n),[]}}else e=t;return Array.isArray(e)?e.map((r,n)=>{const a=typeof r?.url=="string"?r.url.trim():"",i=typeof r?.headers=="string"?r.headers.trim():void 0;return{id:typeof r?.id=="string"&&r.id?.trim()?r.id.trim():`${NI}-${n+1}`,enabled:!!r?.enabled,url:a,name:r?.name,requestTimeoutSeconds:Va.requestTimeoutSeconds,headers:i||void 0,useProxy:!!r?.useProxy}}):[]}function Pce(t){switch(t){case qu.ERROR:return FU;case qu.WARN:return Kc;default:return vI}}function Lce(t){switch(t){case qu.ERROR:return"text-destructive";case qu.WARN:return"text-yellow-600 dark:text-yellow-500";default:return"text-muted-foreground"}}function Fce(t){return t?.startsWith(Pp.IMAGE)??!1}function mb(t){try{return t.replace(Kne,"").split(tae).filter(r=>r.length>0)}catch{return[t]}}function Bce(t){return t.replace(jne,"").split(Qne).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function ER(t){try{const e=mb(t.uri);return e[e.length-1]||t.name||t.uri}catch{return t.name||t.uri}}function Uce(t,e){const r=t?.toLowerCase()||"",n=e?.toLowerCase()||"";return r.includes(Js.JSON)||r.includes(Js.JAVASCRIPT)||r.includes(Js.TYPESCRIPT)||tG.test(n)}function Gce(t,e){const r=t?.toLowerCase()||"",n=e?.toLowerCase()||"";return r.startsWith(Pp.IMAGE)||eG.test(n)}function vG(t,e){const r=t?.toLowerCase()||"",n=e?.toLowerCase()||"";return r.startsWith(Pp.IMAGE)||eG.test(n)?EI:r.includes(Js.JSON)||r.includes(Js.JAVASCRIPT)||r.includes(Js.TYPESCRIPT)||tG.test(n)?BU:r.includes(Pp.TEXT)||Wne.test(n)?Nc:n.includes(fR.DATABASE_KEYWORD)||n.includes(fR.DATABASE_SCHEME)?_I:SI}function Am(t){return t?t.filter(e=>"text"in e).map(e=>e.text).join(rae):""}function qce(t){return t?t.filter(e=>"blob"in e):[]}function yG(t,e=Lt.PLAIN,r=rG){const n=new Blob([t],{type:e}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=r,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}function g_(t){const e=t.indexOf(Rv);if(e===-1)return t;const r=t.substring(0,e),n=t.substring(e+Rv.length).replace(Rae,"");return`${r}${Rv}${n}`}function TG(t){const e=[],r=new Set;let n;for(db.lastIndex=0;(n=db.exec(t))!==null;){const a=n[1]||"",i=n[2];for(const s of i.split(",")){const o=s.replace(iG,"").replace(sG,"").trim();o&&!r.has(o)&&(r.add(o),e.push({name:o,operator:a}))}}return e}function zce(t,e){return db.lastIndex=0,t.replace(db,(r,n,a)=>{const i=a.split(",").map(o=>o.replace(iG,"").replace(sG,"").trim()),s=i.map(o=>e[o]??"").filter(o=>o!=="");if(s.length===0)return"";switch(n){case gu.RESERVED:return s.join(To.COMMA);case gu.FRAGMENT:return gu.FRAGMENT+s.join(To.COMMA);case gu.PATH_SEGMENT:return To.SLASH+s.join(To.SLASH);case gu.LABEL:return To.PERIOD+s.join(To.PERIOD);case gu.PATH_PARAM:return i.filter((o,l)=>s[l]).map((o,l)=>`${To.SEMICOLON}${o}=${s[l]}`).join("");case gu.FORM_QUERY:return To.QUERY_PREFIX+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(To.COMMA);case gu.FORM_CONTINUATION:return To.QUERY_CONTINUATION+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(To.COMMA);default:return s.map(o=>encodeURIComponent(o)).join(To.COMMA)}})}function $ce(t,e){return TG(t).every(n=>(e[n.name]??"").trim()!=="")}function fb(t,e){return`data:${t};base64,${e}`}function Hce(t){if(!t?.trim())return[];try{const e=JSON.parse(t);if(typeof e=="object"&&e!==null&&!Array.isArray(e))return Object.entries(e).map(([r,n])=>({key:r,value:String(n)}))}catch{return[]}return[]}function Yce(t){const e=t.filter(n=>n.key.trim());if(e.length===0)return"";const r={};for(const n of e)r[n.key.trim()]=n.value;return JSON.stringify(r)}function Vce(t,e=!0){try{const r=new URL(t),n=r.hostname.split(c5),a=n.length>=u5?n.slice(-u5).join(c5):r.hostname,i=`${Sne}?domain=${a}&sz=${Ene}`;return e?gG(i):i}catch{return null}}function ow(t,e=[],r=[],n=!1){const a=[];if(t.reasoningContent){const s=vR(t.toolCalls),o=!!t.content?.trim()||s.length>0||r.length>0,l=n&&!o;a.push({type:l?Ka.REASONING_PENDING:Ka.REASONING,content:t.reasoningContent})}t.content?.trim()&&a.push({type:Ka.TEXT,content:t.content});const i=vR(t.toolCalls);for(const s of i){const o=e.find(l=>l.toolCallId===s.id);a.push({type:o?Ka.TOOL_CALL:Ka.TOOL_CALL_PENDING,content:o?.content||"",toolName:s.function?.name,toolArgs:s.function?.arguments,toolResult:o?.content,toolResultExtras:o?.extra})}for(const s of r)s.id&&i.find(o=>o.id===s.id)||a.push({type:Ka.TOOL_CALL_STREAMING,content:"",toolName:s.function?.name,toolArgs:s.function?.arguments});return a}function Wce(t,e=[],r=[],n=!1){if(!e.some(l=>l.role===tr.ASSISTANT))return ow(t,e,r,n);const i=[],s=m4(e,0);iLine truncated
|
||||
</div>`}function h4(t){const e=t.trim().toLowerCase();return e.startsWith(ho.WEBSOCKET)||e.startsWith(ho.WEBSOCKET_SECURE)?Is.WEBSOCKET:Is.STREAMABLE_HTTP}function p4(t){if(!t)return[];let e;if(typeof t=="string"){const r=t.trim();if(!r)return[];try{e=JSON.parse(r)}catch(n){return console.warn("[MCP] Failed to parse mcpServers JSON, ignoring value:",n),[]}}else e=t;return Array.isArray(e)?e.map((r,n)=>{const a=typeof r?.url=="string"?r.url.trim():"",i=typeof r?.headers=="string"?r.headers.trim():void 0;return{id:typeof r?.id=="string"&&r.id?.trim()?r.id.trim():`${II}-${n+1}`,enabled:!!r?.enabled,url:a,name:r?.name,requestTimeoutSeconds:Va.requestTimeoutSeconds,headers:i||void 0,useProxy:!!r?.useProxy}}):[]}function Pce(t){switch(t){case qu.ERROR:return FU;case qu.WARN:return Kc;default:return yI}}function Lce(t){switch(t){case qu.ERROR:return"text-destructive";case qu.WARN:return"text-yellow-600 dark:text-yellow-500";default:return"text-muted-foreground"}}function Fce(t){return t?.startsWith(Pp.IMAGE)??!1}function fb(t){try{return t.replace(Kne,"").split(tae).filter(r=>r.length>0)}catch{return[t]}}function Bce(t){return t.replace(jne,"").split(Qne).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function vR(t){try{const e=fb(t.uri);return e[e.length-1]||t.name||t.uri}catch{return t.name||t.uri}}function Uce(t,e){const r=t?.toLowerCase()||"",n=e?.toLowerCase()||"";return r.includes(Js.JSON)||r.includes(Js.JAVASCRIPT)||r.includes(Js.TYPESCRIPT)||tG.test(n)}function Gce(t,e){const r=t?.toLowerCase()||"",n=e?.toLowerCase()||"";return r.startsWith(Pp.IMAGE)||eG.test(n)}function vG(t,e){const r=t?.toLowerCase()||"",n=e?.toLowerCase()||"";return r.startsWith(Pp.IMAGE)||eG.test(n)?vI:r.includes(Js.JSON)||r.includes(Js.JAVASCRIPT)||r.includes(Js.TYPESCRIPT)||tG.test(n)?BU:r.includes(Pp.TEXT)||Wne.test(n)?Nc:n.includes(gR.DATABASE_KEYWORD)||n.includes(gR.DATABASE_SCHEME)?bI:EI}function Am(t){return t?t.filter(e=>"text"in e).map(e=>e.text).join(rae):""}function qce(t){return t?t.filter(e=>"blob"in e):[]}function yG(t,e=Lt.PLAIN,r=rG){const n=new Blob([t],{type:e}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=r,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}function g_(t){const e=t.indexOf(Ov);if(e===-1)return t;const r=t.substring(0,e),n=t.substring(e+Ov.length).replace(Rae,"");return`${r}${Ov}${n}`}function TG(t){const e=[],r=new Set;let n;for(db.lastIndex=0;(n=db.exec(t))!==null;){const a=n[1]||"",i=n[2];for(const s of i.split(",")){const o=s.replace(iG,"").replace(sG,"").trim();o&&!r.has(o)&&(r.add(o),e.push({name:o,operator:a}))}}return e}function zce(t,e){return db.lastIndex=0,t.replace(db,(r,n,a)=>{const i=a.split(",").map(o=>o.replace(iG,"").replace(sG,"").trim()),s=i.map(o=>e[o]??"").filter(o=>o!=="");if(s.length===0)return"";switch(n){case gu.RESERVED:return s.join(To.COMMA);case gu.FRAGMENT:return gu.FRAGMENT+s.join(To.COMMA);case gu.PATH_SEGMENT:return To.SLASH+s.join(To.SLASH);case gu.LABEL:return To.PERIOD+s.join(To.PERIOD);case gu.PATH_PARAM:return i.filter((o,l)=>s[l]).map((o,l)=>`${To.SEMICOLON}${o}=${s[l]}`).join("");case gu.FORM_QUERY:return To.QUERY_PREFIX+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(To.COMMA);case gu.FORM_CONTINUATION:return To.QUERY_CONTINUATION+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(To.COMMA);default:return s.map(o=>encodeURIComponent(o)).join(To.COMMA)}})}function $ce(t,e){return TG(t).every(n=>(e[n.name]??"").trim()!=="")}function gb(t,e){return`data:${t};base64,${e}`}function Hce(t){if(!t?.trim())return[];try{const e=JSON.parse(t);if(typeof e=="object"&&e!==null&&!Array.isArray(e))return Object.entries(e).map(([r,n])=>({key:r,value:String(n)}))}catch{return[]}return[]}function Yce(t){const e=t.filter(n=>n.key.trim());if(e.length===0)return"";const r={};for(const n of e)r[n.key.trim()]=n.value;return JSON.stringify(r)}function Vce(t,e=!0){try{const r=new URL(t),n=r.hostname.split(c5),a=n.length>=u5?n.slice(-u5).join(c5):r.hostname,i=`${Sne}?domain=${a}&sz=${Ene}`;return e?gG(i):i}catch{return null}}function lw(t,e=[],r=[],n=!1){const a=[];if(t.reasoningContent){const s=yR(t.toolCalls),o=!!t.content?.trim()||s.length>0||r.length>0,l=n&&!o;a.push({type:l?Ka.REASONING_PENDING:Ka.REASONING,content:t.reasoningContent})}t.content?.trim()&&a.push({type:Ka.TEXT,content:t.content});const i=yR(t.toolCalls);for(const s of i){const o=e.find(l=>l.toolCallId===s.id);a.push({type:o?Ka.TOOL_CALL:Ka.TOOL_CALL_PENDING,content:o?.content||"",toolName:s.function?.name,toolArgs:s.function?.arguments,toolResult:o?.content,toolResultExtras:o?.extra})}for(const s of r)s.id&&i.find(o=>o.id===s.id)||a.push({type:Ka.TOOL_CALL_STREAMING,content:"",toolName:s.function?.name,toolArgs:s.function?.arguments});return a}function Wce(t,e=[],r=[],n=!1){if(!e.some(l=>l.role===Jt.ASSISTANT))return lw(t,e,r,n);const i=[],s=m4(e,0);iLine truncated
|
||||
`)}function U(R,P,ee,ce){this.failures=P,this.failedKeys=ce,this.successCount=ee,this.message=O(R,P)}function X(R,P){this.name="BulkError",this.failures=Object.keys(P).map(function(ee){return P[ee]}),this.failuresByPos=P,this.message=O(R,this.failures)}g(N).from(Error).extend({toString:function(){return this.name+": "+this.message}}),g(U).from(N),g(X).from(N);var ne=yo.reduce(function(R,P){return R[P]=P+"Error",R},{}),ue=N,he=yo.reduce(function(R,P){var ee=P+"Error";function ce(de,Se){this.name=ee,de?typeof de=="string"?(this.message="".concat(de).concat(Se?`
|
||||
`+Se:""),this.inner=Se||null):typeof de=="object"&&(this.message="".concat(de.name," ").concat(de.message),this.inner=de):(this.message=J[P]||ee,this.inner=null)}return g(ce).from(ue),R[P]=ce,R},{});he.Syntax=SyntaxError,he.Type=TypeError,he.Range=RangeError;var be=dt.reduce(function(R,P){return R[P+"Error"]=he[P],R},{}),Z=yo.reduce(function(R,P){return["Syntax","Type","Range"].indexOf(P)===-1&&(R[P+"Error"]=he[P]),R},{});function ae(){}function pe(R){return R}function me(R,P){return R==null||R===pe?P:function(ee){return P(R(ee))}}function Ee(R,P){return function(){R.apply(this,arguments),P.apply(this,arguments)}}function Ce(R,P){return R===ae?P:function(){var ee=R.apply(this,arguments);ee!==void 0&&(arguments[0]=ee);var ce=this.onsuccess,de=this.onerror;this.onsuccess=null,this.onerror=null;var Se=P.apply(this,arguments);return ce&&(this.onsuccess=this.onsuccess?Ee(ce,this.onsuccess):ce),de&&(this.onerror=this.onerror?Ee(de,this.onerror):de),Se!==void 0?Se:ee}}function Ne(R,P){return R===ae?P:function(){R.apply(this,arguments);var ee=this.onsuccess,ce=this.onerror;this.onsuccess=this.onerror=null,P.apply(this,arguments),ee&&(this.onsuccess=this.onsuccess?Ee(ee,this.onsuccess):ee),ce&&(this.onerror=this.onerror?Ee(ce,this.onerror):ce)}}function Ie(R,P){return R===ae?P:function(ee){var ce=R.apply(this,arguments);l(ee,ce);var de=this.onsuccess,Se=this.onerror;return this.onsuccess=null,this.onerror=null,ee=P.apply(this,arguments),de&&(this.onsuccess=this.onsuccess?Ee(de,this.onsuccess):de),Se&&(this.onerror=this.onerror?Ee(Se,this.onerror):Se),ce===void 0?ee===void 0?void 0:ee:l(ce,ee)}}function Ue(R,P){return R===ae?P:function(){return P.apply(this,arguments)!==!1&&R.apply(this,arguments)}}function Fe(R,P){return R===ae?P:function(){var ee=R.apply(this,arguments);if(ee&&typeof ee.then=="function"){for(var ce=this,de=arguments.length,Se=new Array(de);de--;)Se[de]=arguments[de];return ee.then(function(){return P.apply(ce,Se)})}return P.apply(this,arguments)}}Z.ModifyError=U,Z.DexieError=N,Z.BulkError=X;var je=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function He(R){je=R}var at={},st=100,Ae=typeof Promise>"u"?[]:function(){var R=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[R,c(R),R];var P=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[P,c(P),R]}(),dt=Ae[0],yo=Ae[1],Ae=Ae[2],yo=yo&&yo.then,Le=dt&&dt.constructor,ht=!!Ae,ze=function(R,P){Ot.push([R,P]),At&&(queueMicrotask(Ct),At=!1)},ft=!0,At=!0,Rt=[],zt=[],ir=pe,hr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ae,pgp:!1,env:{},finalize:ae},lt=hr,Ot=[],Ft=0,Jt=[];function ut(R){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var P=this._PSD=lt;if(typeof R!="function"){if(R!==at)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&xt(this,this._value))}this._state=null,this._value=null,++P.ref,function ee(ce,de){try{de(function(Se){if(ce._state===null){if(Se===ce)throw new TypeError("A promise cannot be resolved with itself.");var Oe=ce._lib&&Pt();Se&&typeof Se.then=="function"?ee(ce,function(ke,Ye){Se instanceof ut?Se._then(ke,Ye):Se.then(ke,Ye)}):(ce._state=!0,ce._value=Se,Re(ce)),Oe&&kt()}},xt.bind(null,ce))}catch(Se){xt(ce,Se)}}(this,R)}var Ut={get:function(){var R=lt,P=Ln;function ee(ce,de){var Se=this,Oe=!R.global&&(R!==lt||P!==Ln),ke=Oe&&!gs(),Ye=new ut(function(Qe,tt){Xe(Se,new yt(rc(ce,R,Oe,ke),rc(de,R,Oe,ke),Qe,tt,R))});return this._consoleTask&&(Ye._consoleTask=this._consoleTask),Ye}return ee.prototype=at,ee},set:function(R){f(this,"then",R&&R.prototype===at?Ut:{get:function(){return R},set:Ut.set})}};function yt(R,P,ee,ce,de){this.onFulfilled=typeof R=="function"?R:null,this.onRejected=typeof P=="function"?P:null,this.resolve=ee,this.reject=ce,this.psd=de}function xt(R,P){var ee,ce;zt.push(P),R._state===null&&(ee=R._lib&&Pt(),P=ir(P),R._state=!1,R._value=P,ce=R,Rt.some(function(de){return de._value===ce._value})||Rt.push(ce),Re(R),ee&&kt())}function Re(R){var P=R._listeners;R._listeners=[];for(var ee=0,ce=P.length;ee<ce;++ee)Xe(R,P[ee]);var de=R._PSD;--de.ref||de.finalize(),Ft===0&&(++Ft,ze(function(){--Ft==0&&bt()},[]))}function Xe(R,P){if(R._state!==null){var ee=R._state?P.onFulfilled:P.onRejected;if(ee===null)return(R._state?P.resolve:P.reject)(R._value);++P.psd.ref,++Ft,ze(pt,[ee,R,P])}else R._listeners.push(P)}function pt(R,P,ee){try{var ce,de=P._value;!P._state&&zt.length&&(zt=[]),ce=je&&P._consoleTask?P._consoleTask.run(function(){return R(de)}):R(de),P._state||zt.indexOf(de)!==-1||function(Se){for(var Oe=Rt.length;Oe;)if(Rt[--Oe]._value===Se._value)return Rt.splice(Oe,1)}(P),ee.resolve(ce)}catch(Se){ee.reject(Se)}finally{--Ft==0&&bt(),--ee.psd.ref||ee.psd.finalize()}}function Ct(){ji(hr,function(){Pt()&&kt()})}function Pt(){var R=ft;return At=ft=!1,R}function kt(){var R,P,ee;do for(;0<Ot.length;)for(R=Ot,Ot=[],ee=R.length,P=0;P<ee;
Line truncated
|
||||
`+Se:""),this.inner=Se||null):typeof de=="object"&&(this.message="".concat(de.name," ").concat(de.message),this.inner=de):(this.message=J[P]||ee,this.inner=null)}return g(ce).from(ue),R[P]=ce,R},{});he.Syntax=SyntaxError,he.Type=TypeError,he.Range=RangeError;var be=dt.reduce(function(R,P){return R[P+"Error"]=he[P],R},{}),Z=yo.reduce(function(R,P){return["Syntax","Type","Range"].indexOf(P)===-1&&(R[P+"Error"]=he[P]),R},{});function ae(){}function pe(R){return R}function me(R,P){return R==null||R===pe?P:function(ee){return P(R(ee))}}function Ee(R,P){return function(){R.apply(this,arguments),P.apply(this,arguments)}}function Ce(R,P){return R===ae?P:function(){var ee=R.apply(this,arguments);ee!==void 0&&(arguments[0]=ee);var ce=this.onsuccess,de=this.onerror;this.onsuccess=null,this.onerror=null;var Se=P.apply(this,arguments);return ce&&(this.onsuccess=this.onsuccess?Ee(ce,this.onsuccess):ce),de&&(this.onerror=this.onerror?Ee(de,this.onerror):de),Se!==void 0?Se:ee}}function Ne(R,P){return R===ae?P:function(){R.apply(this,arguments);var ee=this.onsuccess,ce=this.onerror;this.onsuccess=this.onerror=null,P.apply(this,arguments),ee&&(this.onsuccess=this.onsuccess?Ee(ee,this.onsuccess):ee),ce&&(this.onerror=this.onerror?Ee(ce,this.onerror):ce)}}function Ie(R,P){return R===ae?P:function(ee){var ce=R.apply(this,arguments);l(ee,ce);var de=this.onsuccess,Se=this.onerror;return this.onsuccess=null,this.onerror=null,ee=P.apply(this,arguments),de&&(this.onsuccess=this.onsuccess?Ee(de,this.onsuccess):de),Se&&(this.onerror=this.onerror?Ee(Se,this.onerror):Se),ce===void 0?ee===void 0?void 0:ee:l(ce,ee)}}function Ue(R,P){return R===ae?P:function(){return P.apply(this,arguments)!==!1&&R.apply(this,arguments)}}function Fe(R,P){return R===ae?P:function(){var ee=R.apply(this,arguments);if(ee&&typeof ee.then=="function"){for(var ce=this,de=arguments.length,Se=new Array(de);de--;)Se[de]=arguments[de];return ee.then(function(){return P.apply(ce,Se)})}return P.apply(this,arguments)}}Z.ModifyError=U,Z.DexieError=N,Z.BulkError=X;var je=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function He(R){je=R}var at={},st=100,Ae=typeof Promise>"u"?[]:function(){var R=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[R,c(R),R];var P=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[P,c(P),R]}(),dt=Ae[0],yo=Ae[1],Ae=Ae[2],yo=yo&&yo.then,Le=dt&&dt.constructor,ht=!!Ae,ze=function(R,P){Ot.push([R,P]),At&&(queueMicrotask(Ct),At=!1)},ft=!0,At=!0,Rt=[],zt=[],ir=pe,hr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ae,pgp:!1,env:{},finalize:ae},lt=hr,Ot=[],Ft=0,er=[];function ut(R){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var P=this._PSD=lt;if(typeof R!="function"){if(R!==at)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&xt(this,this._value))}this._state=null,this._value=null,++P.ref,function ee(ce,de){try{de(function(Se){if(ce._state===null){if(Se===ce)throw new TypeError("A promise cannot be resolved with itself.");var Oe=ce._lib&&Pt();Se&&typeof Se.then=="function"?ee(ce,function(ke,Ye){Se instanceof ut?Se._then(ke,Ye):Se.then(ke,Ye)}):(ce._state=!0,ce._value=Se,Re(ce)),Oe&&kt()}},xt.bind(null,ce))}catch(Se){xt(ce,Se)}}(this,R)}var Ut={get:function(){var R=lt,P=Ln;function ee(ce,de){var Se=this,Oe=!R.global&&(R!==lt||P!==Ln),ke=Oe&&!gs(),Ye=new ut(function(Qe,tt){Xe(Se,new yt(rc(ce,R,Oe,ke),rc(de,R,Oe,ke),Qe,tt,R))});return this._consoleTask&&(Ye._consoleTask=this._consoleTask),Ye}return ee.prototype=at,ee},set:function(R){f(this,"then",R&&R.prototype===at?Ut:{get:function(){return R},set:Ut.set})}};function yt(R,P,ee,ce,de){this.onFulfilled=typeof R=="function"?R:null,this.onRejected=typeof P=="function"?P:null,this.resolve=ee,this.reject=ce,this.psd=de}function xt(R,P){var ee,ce;zt.push(P),R._state===null&&(ee=R._lib&&Pt(),P=ir(P),R._state=!1,R._value=P,ce=R,Rt.some(function(de){return de._value===ce._value})||Rt.push(ce),Re(R),ee&&kt())}function Re(R){var P=R._listeners;R._listeners=[];for(var ee=0,ce=P.length;ee<ce;++ee)Xe(R,P[ee]);var de=R._PSD;--de.ref||de.finalize(),Ft===0&&(++Ft,ze(function(){--Ft==0&&bt()},[]))}function Xe(R,P){if(R._state!==null){var ee=R._state?P.onFulfilled:P.onRejected;if(ee===null)return(R._state?P.resolve:P.reject)(R._value);++P.psd.ref,++Ft,ze(pt,[ee,R,P])}else R._listeners.push(P)}function pt(R,P,ee){try{var ce,de=P._value;!P._state&&zt.length&&(zt=[]),ce=je&&P._consoleTask?P._consoleTask.run(function(){return R(de)}):R(de),P._state||zt.indexOf(de)!==-1||function(Se){for(var Oe=Rt.length;Oe;)if(Rt[--Oe]._value===Se._value)return Rt.splice(Oe,1)}(P),ee.resolve(ce)}catch(Se){ee.reject(Se)}finally{--Ft==0&&bt(),--ee.psd.ref||ee.psd.finalize()}}function Ct(){Xi(hr,function(){Pt()&&kt()})}function Pt(){var R=ft;return At=ft=!1,R}function kt(){var R,P,ee;do for(;0<Ot.length;)for(R=Ot,Ot=[],ee=R.length,P=0;P<ee;
Line truncated
|
||||
`).filter(s=>s),a=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(a)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const e=Function,r=this?.args,a=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...r,a.join(`
|
||||
`))}}const Nde={major:4,minor:2,patch:1},pa=vt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Nde;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const a of n)for(const i of a._zod.onattach)i(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const a=(s,o,l)=>{let c=Jh(s),u;for(const d of o){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(c)continue;const h=s.issues.length,m=d._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new fp;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(c||(c=Jh(s,h)))});else{if(s.issues.length===h)continue;c||(c=Jh(s,h))}}return u?u.then(()=>s):s},i=(s,o,l)=>{if(Jh(s))return s.aborted=!0,s;const c=a(o,n,l);if(c instanceof Promise){if(l.async===!1)throw new fp;return c.then(u=>t._zod.parse(u,l))}return t._zod.parse(c,l)};t._zod.run=(s,o)=>{if(o.skipChecks)return t._zod.parse(s,o);if(o.direction==="backward"){const c=t._zod.parse({value:s.value,issues:[]},{...o,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,s,o)):i(c,s,o)}const l=t._zod.parse(s,o);if(l instanceof Promise){if(o.async===!1)throw new fp;return l.then(c=>a(c,n,o))}return a(l,n,o)}}t["~standard"]={validate:a=>{try{const i=PG(t,a);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return kue(t,a).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),UI=vt("$ZodString",(t,e)=>{pa.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??cde(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ya=vt("$ZodStringFormat",(t,e)=>{KS.init(t,e),UI.init(t,e)}),Ide=vt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Que),ya.init(t,e)}),xde=vt("$ZodUUID",(t,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=y4(n))}else e.pattern??(e.pattern=y4());ya.init(t,e)}),Dde=vt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Xue),ya.init(t,e)}),Mde=vt("$ZodURL",(t,e)=>{ya.init(t,e),t._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=a.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),kde=vt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Jue()),ya.init(t,e)}),Pde=vt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Kue),ya.init(t,e)}),Lde=vt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=$ue),ya.init(t,e)}),Fde=vt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Hue),ya.init(t,e)}),Bde=vt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Yue),ya.init(t,e)}),Ude=vt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Vue),ya.init(t,e)}),Gde=vt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Wue),ya.init(t,e)}),qde=vt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=lde(e)),ya.init(t,e)}),zde=vt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=sde),ya.init(t,e)}),$de=vt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=ode(e)),ya.init(t,e)}),Hde=vt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=jue),ya.init(t,e)}),Yde=vt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=ede),ya.init(t,e),t._zod.bag.format="ipv4"}),Vde=vt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=tde),ya.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Wde=vt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=rde),ya.init(t,e)}),Kde=vt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=nde),ya.init(t,e),t._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[a,i]=n;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${a}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function zG(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const jde=vt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=ade),ya.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{zG(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Qde(t){if(!LG.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=
Line truncated
|
||||
`))}}const Nde={major:4,minor:2,patch:1},pa=vt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Nde;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const a of n)for(const i of a._zod.onattach)i(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const a=(s,o,l)=>{let c=ep(s),u;for(const d of o){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(c)continue;const h=s.issues.length,m=d._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new fp;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(c||(c=ep(s,h)))});else{if(s.issues.length===h)continue;c||(c=ep(s,h))}}return u?u.then(()=>s):s},i=(s,o,l)=>{if(ep(s))return s.aborted=!0,s;const c=a(o,n,l);if(c instanceof Promise){if(l.async===!1)throw new fp;return c.then(u=>t._zod.parse(u,l))}return t._zod.parse(c,l)};t._zod.run=(s,o)=>{if(o.skipChecks)return t._zod.parse(s,o);if(o.direction==="backward"){const c=t._zod.parse({value:s.value,issues:[]},{...o,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,s,o)):i(c,s,o)}const l=t._zod.parse(s,o);if(l instanceof Promise){if(o.async===!1)throw new fp;return l.then(c=>a(c,n,o))}return a(l,n,o)}}t["~standard"]={validate:a=>{try{const i=PG(t,a);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return kue(t,a).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),UI=vt("$ZodString",(t,e)=>{pa.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??cde(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ya=vt("$ZodStringFormat",(t,e)=>{jS.init(t,e),UI.init(t,e)}),Ide=vt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Que),ya.init(t,e)}),xde=vt("$ZodUUID",(t,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=y4(n))}else e.pattern??(e.pattern=y4());ya.init(t,e)}),Dde=vt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Xue),ya.init(t,e)}),Mde=vt("$ZodURL",(t,e)=>{ya.init(t,e),t._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=a.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),kde=vt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Jue()),ya.init(t,e)}),Pde=vt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Kue),ya.init(t,e)}),Lde=vt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=$ue),ya.init(t,e)}),Fde=vt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Hue),ya.init(t,e)}),Bde=vt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Yue),ya.init(t,e)}),Ude=vt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Vue),ya.init(t,e)}),Gde=vt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Wue),ya.init(t,e)}),qde=vt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=lde(e)),ya.init(t,e)}),zde=vt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=sde),ya.init(t,e)}),$de=vt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=ode(e)),ya.init(t,e)}),Hde=vt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=jue),ya.init(t,e)}),Yde=vt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=ede),ya.init(t,e),t._zod.bag.format="ipv4"}),Vde=vt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=tde),ya.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Wde=vt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=rde),ya.init(t,e)}),Kde=vt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=nde),ya.init(t,e),t._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[a,i]=n;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${a}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function zG(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const jde=vt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=ade),ya.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{zG(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Qde(t){if(!LG.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=
Line truncated
|
||||
if (${y}.issues.length) {
|
||||
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
||||
...iss,
|
||||
@@ -75,87 +75,87 @@ ${r}`}function MI(t){return t.isComposing||t.keyCode===229}function Ace(t,e){ret
|
||||
newResult[${v}] = ${y}.value;
|
||||
}
|
||||
|
||||
`)}m.write("payload.value = newResult;"),m.write("return payload;");const S=m.compile();return(E,y)=>S(h,E,y)};let i;const s=Mf,o=!OG.jitless,c=o&&vue.value,u=e.catchall;let d;t._zod.parse=(h,m)=>{d??(d=n.value);const f=h.value;return s(f)?o&&c&&m?.async===!1&&m.jitless!==!0?(i||(i=a(e.shape)),h=i(h,m),u?YG([],f,h,m,d,t):h):r(h,m):(h.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),h)}});function C4(t,e,r,n){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;const a=t.filter(i=>!Jh(i));return a.length===1?(e.value=a[0].value,a[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(i=>i.issues.map(s=>$u(s,n,zu())))}),e)}const VG=vt("$ZodUnion",(t,e)=>{pa.init(t,e),ra(t._zod,"optin",()=>e.options.some(a=>a._zod.optin==="optional")?"optional":void 0),ra(t._zod,"optout",()=>e.options.some(a=>a._zod.optout==="optional")?"optional":void 0),ra(t._zod,"values",()=>{if(e.options.every(a=>a._zod.values))return new Set(e.options.flatMap(a=>Array.from(a._zod.values)))}),ra(t._zod,"pattern",()=>{if(e.options.every(a=>a._zod.pattern)){const a=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${a.map(i=>PI(i.source)).join("|")})$`)}});const r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(a,i)=>{if(r)return n(a,i);let s=!1;const o=[];for(const l of e.options){const c=l._zod.run({value:a.value,issues:[]},i);if(c instanceof Promise)o.push(c),s=!0;else{if(c.issues.length===0)return c;o.push(c)}}return s?Promise.all(o).then(l=>C4(l,a,t,i)):C4(o,a,t,i)}}),uhe=vt("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,VG.init(t,e);const r=t._zod.parse;ra(t._zod,"propValues",()=>{const a={};for(const i of e.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const[o,l]of Object.entries(s)){a[o]||(a[o]=new Set);for(const c of l)a[o].add(c)}}return a});const n=YS(()=>{const a=e.options,i=new Map;for(const s of a){const o=s._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const l of o){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});t._zod.parse=(a,i)=>{const s=a.value;if(!Mf(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),a;const o=n.value.get(s?.[e.discriminator]);return o?o._zod.run(a,i):e.unionFallback?r(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),a)}}),dhe=vt("$ZodIntersection",(t,e)=>{pa.init(t,e),t._zod.parse=(r,n)=>{const a=r.value,i=e.left._zod.run({value:a,issues:[]},n),s=e.right._zod.run({value:a,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>w4(r,l,c)):w4(r,i,s)}});function wR(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Bp(t)&&Bp(e)){const r=Object.keys(e),n=Object.keys(t).filter(i=>r.indexOf(i)!==-1),a={...t,...e};for(const i of n){const s=wR(t[i],e[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};a[i]=s.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<t.length;n++){const a=t[n],i=e[n],s=wR(a,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function w4(t,e,r){if(e.issues.length&&t.issues.push(...e.issues),r.issues.length&&t.issues.push(...r.issues),Jh(t))return t;const n=wR(e.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return t.value=n.data,t}const hhe=vt("$ZodRecord",(t,e)=>{pa.init(t,e),t._zod.parse=(r,n)=>{const a=r.value;if(!Bp(a))return r.issues.push({expected:"record",code:"invalid_type",input:a,inst:t}),r;const i=[],s=e.keyType._zod.values;if(s){r.value={};const o=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){o.add(typeof c=="number"?c.toString():c);const u=e.valueType._zod.run({value:a[c],issues:[]},n);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&r.issues.push(...ep(c,d.issues)),r.value[c]=d.value})):(u.issues.length&&r.issues.push(...ep(c,u.issues)),r.value[c]=u.value)}let l;for(const c in a)o.has(c)||(l=l??[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:a,inst:t,keys:l})}else{r.value={};for(const o of Reflect.ownKeys(a)){if(o==="__proto__")continue;const l=e.keyType._zod.run({value:o,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?r.value[o]=a[o]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>$u(u,n,zu())),input:o,path:[o],inst:t});continue}c
Line truncated
|
||||
`)}m.write("payload.value = newResult;"),m.write("return payload;");const S=m.compile();return(E,y)=>S(h,E,y)};let i;const s=Mf,o=!OG.jitless,c=o&&vue.value,u=e.catchall;let d;t._zod.parse=(h,m)=>{d??(d=n.value);const f=h.value;return s(f)?o&&c&&m?.async===!1&&m.jitless!==!0?(i||(i=a(e.shape)),h=i(h,m),u?YG([],f,h,m,d,t):h):r(h,m):(h.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),h)}});function C4(t,e,r,n){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;const a=t.filter(i=>!ep(i));return a.length===1?(e.value=a[0].value,a[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(i=>i.issues.map(s=>$u(s,n,zu())))}),e)}const VG=vt("$ZodUnion",(t,e)=>{pa.init(t,e),ra(t._zod,"optin",()=>e.options.some(a=>a._zod.optin==="optional")?"optional":void 0),ra(t._zod,"optout",()=>e.options.some(a=>a._zod.optout==="optional")?"optional":void 0),ra(t._zod,"values",()=>{if(e.options.every(a=>a._zod.values))return new Set(e.options.flatMap(a=>Array.from(a._zod.values)))}),ra(t._zod,"pattern",()=>{if(e.options.every(a=>a._zod.pattern)){const a=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${a.map(i=>PI(i.source)).join("|")})$`)}});const r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(a,i)=>{if(r)return n(a,i);let s=!1;const o=[];for(const l of e.options){const c=l._zod.run({value:a.value,issues:[]},i);if(c instanceof Promise)o.push(c),s=!0;else{if(c.issues.length===0)return c;o.push(c)}}return s?Promise.all(o).then(l=>C4(l,a,t,i)):C4(o,a,t,i)}}),uhe=vt("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,VG.init(t,e);const r=t._zod.parse;ra(t._zod,"propValues",()=>{const a={};for(const i of e.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const[o,l]of Object.entries(s)){a[o]||(a[o]=new Set);for(const c of l)a[o].add(c)}}return a});const n=VS(()=>{const a=e.options,i=new Map;for(const s of a){const o=s._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const l of o){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});t._zod.parse=(a,i)=>{const s=a.value;if(!Mf(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),a;const o=n.value.get(s?.[e.discriminator]);return o?o._zod.run(a,i):e.unionFallback?r(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),a)}}),dhe=vt("$ZodIntersection",(t,e)=>{pa.init(t,e),t._zod.parse=(r,n)=>{const a=r.value,i=e.left._zod.run({value:a,issues:[]},n),s=e.right._zod.run({value:a,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>w4(r,l,c)):w4(r,i,s)}});function AR(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Bp(t)&&Bp(e)){const r=Object.keys(e),n=Object.keys(t).filter(i=>r.indexOf(i)!==-1),a={...t,...e};for(const i of n){const s=AR(t[i],e[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};a[i]=s.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<t.length;n++){const a=t[n],i=e[n],s=AR(a,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function w4(t,e,r){if(e.issues.length&&t.issues.push(...e.issues),r.issues.length&&t.issues.push(...r.issues),ep(t))return t;const n=AR(e.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return t.value=n.data,t}const hhe=vt("$ZodRecord",(t,e)=>{pa.init(t,e),t._zod.parse=(r,n)=>{const a=r.value;if(!Bp(a))return r.issues.push({expected:"record",code:"invalid_type",input:a,inst:t}),r;const i=[],s=e.keyType._zod.values;if(s){r.value={};const o=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){o.add(typeof c=="number"?c.toString():c);const u=e.valueType._zod.run({value:a[c],issues:[]},n);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&r.issues.push(...tp(c,d.issues)),r.value[c]=d.value})):(u.issues.length&&r.issues.push(...tp(c,u.issues)),r.value[c]=u.value)}let l;for(const c in a)o.has(c)||(l=l??[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:a,inst:t,keys:l})}else{r.value={};for(const o of Reflect.ownKeys(a)){if(o==="__proto__")continue;const l=e.keyType._zod.run({value:o,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?r.value[o]=a[o]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>$u(u,n,zu())),input:o,path:[o],inst:t});continue}c
Line truncated
|
||||
|
||||
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of t.seen.entries()){const s=i[1];if(e===i[0]){a(i);continue}if(t.external){const l=t.external.registry.get(i[0])?.id;if(e!==i[0]&&l){a(i);continue}}if(t.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&t.reused==="ref"){a(i);continue}}}function ZG(t,e){const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const o=t.seen.get(s),l=o.def??o.schema,c={...l};if(o.ref===null)return;const u=o.ref;if(o.ref=null,u){n(u);const d=t.seen.get(u).schema;d.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(d)):(Object.assign(l,d),Object.assign(l,c))}o.isParent||t.override({zodSchema:s,jsonSchema:l,path:o.path??[]})};for(const s of[...t.seen.entries()].reverse())n(s[0]);const a={};if(t.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");a.$id=t.external.uri(s)}Object.assign(a,r.def??r.schema);const i=t.external?.defs??{};for(const s of t.seen.entries()){const o=s[1];o.def&&o.defId&&(i[o.defId]=o.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{const s=JSON.parse(JSON.stringify(a));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Sb(e,"input"),output:Sb(e,"output")}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function es(t,e){const r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);const n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return es(n.element,r);if(n.type==="set")return es(n.valueType,r);if(n.type==="lazy")return es(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return es(n.innerType,r);if(n.type==="intersection")return es(n.left,r)||es(n.right,r);if(n.type==="record"||n.type==="map")return es(n.keyType,r)||es(n.valueType,r);if(n.type==="pipe")return es(n.in,r)||es(n.out,r);if(n.type==="object"){for(const a in n.shape)if(es(n.shape[a],r))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(es(a,r))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(es(a,r))return!0;return!!(n.rest&&es(n.rest,r))}return!1}const ype=(t,e={})=>r=>{const n=QG({...r,processors:e});return di(t,n),XG(n,t),ZG(n,t)},Sb=(t,e)=>r=>{const{libraryOptions:n,target:a}=r??{},i=QG({...n??{},target:a,io:e,processors:{}});return di(t,i),XG(i,t),ZG(i,t)},Tpe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cpe=(t,e,r,n)=>{const a=r;a.type="string";const{minimum:i,maximum:s,format:o,patterns:l,contentEncoding:c}=t._zod.bag;if(typeof i=="number"&&(a.minLength=i),typeof s=="number"&&(a.maxLength=s),o&&(a.format=Tpe[o]??o,a.format===""&&delete a.format),c&&(a.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?a.pattern=u[0].source:u.length>1&&(a.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},wpe=(t,e,r,n)=>{const a=r,{minimum:i,maximum:s,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=t._zod.bag;typeof o=="string"&&o.includes("int")?a.type="integer":a.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.minimum=u,a.exclusiveMinimum=!0):a.exclusiveMinimum=u),typeof i=="number"&&(a.minimum=i,typeof u=="number"&&e.target!=="draft-04"&&(u>=i?delete a.minimum:delete a.exclusiveMinimum)),typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.maximum=c,a.exclusiveMaximum=!0):a.exclusiveMaximum=c),typeof s=="number"&&(a.maximum=s,typeof c=="number"&&e.target!=="draft-04"&&(c<=s?delete a.maximum:delete a.exclusiveMaximum)),typeof l=="number"&&(a.multipleOf=l)},Ape=(t,e,r,n)=>{r.type="boolean"},Rpe=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Ope=(t,e,r,n)=>{r.not={}},Npe=(t,e,r,n)=>{},Ipe=(t,e,r,n)=>{},xpe=(t,e,r,n)=>{const a=t._zod.def,i=NG(a.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},Dpe=(t,e,r,n)=>{const a=t._zod.def,i=[];for(const s of a.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];r.type=s===null?"null":typeof s,e.Line truncated
|
||||
`:""},this._extScope=O,this._scope=new r.Scope({parent:O}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(O){return this._scope.name(O)}scopeName(O){return this._extScope.name(O)}scopeValue(O,U){const X=this._extScope.value(O,U);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue(O,U){return this._extScope.getValue(O,U)}scopeRefs(O){return this._extScope.scopeRefs(O,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(O,U,X,ne){const ue=this._scope.toName(U);return X!==void 0&&ne&&(this._constants[ue.str]=X),this._leafNode(new s(O,ue,X)),ue}const(O,U,X){return this._def(r.varKinds.const,O,U,X)}let(O,U,X){return this._def(r.varKinds.let,O,U,X)}var(O,U,X){return this._def(r.varKinds.var,O,U,X)}assign(O,U,X){return this._leafNode(new o(O,U,X))}add(O,U){return this._leafNode(new l(O,t.operators.ADD,U))}code(O){return typeof O=="function"?O():O!==e.nil&&this._leafNode(new h(O)),this}object(...O){const U=["{"];for(const[X,ne]of O)U.length>1&&U.push(","),U.push(X),(X!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(O,U,X){if(this._blockNode(new _(O)),U&&X)this.code(U).else().code(X).endIf();else if(U)this.code(U).endIf();else if(X)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(O){return this._elseNode(new _(O))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(O,U){return this._blockNode(O),U&&this.code(U).endFor(),this}for(O,U){return this._for(new E(O),U)}forRange(O,U,X,ne,ue=this.opts.es5?r.varKinds.var:r.varKinds.let){const he=this._scope.toName(O);return this._for(new y(ue,he,U,X),()=>ne(he))}forOf(O,U,X,ne=r.varKinds.const){const ue=this._scope.toName(O);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),X(ue)})}return this._for(new v("of",ne,ue,U),()=>X(ue))}forIn(O,U,X,ne=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(O,(0,e._)`Object.keys(${U})`,X);const ue=this._scope.toName(O);return this._for(new v("in",ne,ue,U),()=>X(ue))}endFor(){return this._endBlockNode(S)}label(O){return this._leafNode(new c(O))}break(O){return this._leafNode(new u(O))}return(O){const U=new w;if(this._blockNode(U),this.code(O),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(O,U,X){if(!U&&!X)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new A;if(this._blockNode(ne),this.code(O),U){const ue=this.name("e");this._currNode=ne.catch=new I(ue),U(ue)}return X&&(this._currNode=ne.finally=new x,this.code(X)),this._endBlockNode(I,x)}throw(O){return this._leafNode(new d(O))}block(O,U){return this._blockStarts.push(this._nodes.length),O&&this.code(O).endBlock(U),this}endBlock(O){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const X=this._nodes.length-U;if(X<0||O!==void 0&&X!==O)throw new Error(`CodeGen: wrong number of nodes: ${X} vs ${O} expected`);return this._nodes.length=U,this}func(O,U=e.nil,X,ne){return this._blockNode(new T(O,U,X)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(O=1){for(;O-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(O){return this._currNode.nodes.push(O),this}_blockNode(O){this._currNode.nodes.push(O),this._nodes.push(O)}_endBlockNode(O,U){const X=this._currNode;if(X instanceof O||U&&X instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${O.kind}/${U.kind}`:O.kind}"`)}_elseNode(O){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=O,this}get _root(){return this._nodes[0]}get _currNode(){const O=this._nodes;return O[O.length-1]}set _currNode(O){const U=this._nodes;U[U.length-1]=O}}t.CodeGen=D;function $(N,O){for(const U in O)N[U]=(N[U]||0)+(O[U]||0);return N}function H(N,O){return O instanceof e._CodeOrName?$(N,O.names):N}function G(N,O,U){if(N instanceof e.Name)return X(N);if(!ne(N))return N;return new e._Code(N._items.reduce((ue,he)=>(he instanceof e.Name&&(he=X(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function X(ue){const he=U[ue.str];return he===void 0||O[ue.str]!==1?ue:(delete O[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&O[he.str]===1&&U[he.str]!==void 0)}}function K(N,O){for(const U in O)N[U]=(N[U]||0)-(O[U]||0)}function z(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,e._)`!${J(N)}`}t.not=z;const re=B(t.operators.AND);function W(...N){return N.reduce(re)}t.and=W;const ie=B(t.operators.OR);function M(...N){return N.reduce(ie)}t.or=M;function B(N){return(O,U)=>O===e.nil?U:U===e.nil?O:(0,e._)`${J(O)} ${N} ${J(U)}`}function J(N){return N i
Line truncated
|
||||
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of t.seen.entries()){const s=i[1];if(e===i[0]){a(i);continue}if(t.external){const l=t.external.registry.get(i[0])?.id;if(e!==i[0]&&l){a(i);continue}}if(t.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&t.reused==="ref"){a(i);continue}}}function ZG(t,e){const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const o=t.seen.get(s),l=o.def??o.schema,c={...l};if(o.ref===null)return;const u=o.ref;if(o.ref=null,u){n(u);const d=t.seen.get(u).schema;d.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(d)):(Object.assign(l,d),Object.assign(l,c))}o.isParent||t.override({zodSchema:s,jsonSchema:l,path:o.path??[]})};for(const s of[...t.seen.entries()].reverse())n(s[0]);const a={};if(t.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");a.$id=t.external.uri(s)}Object.assign(a,r.def??r.schema);const i=t.external?.defs??{};for(const s of t.seen.entries()){const o=s[1];o.def&&o.defId&&(i[o.defId]=o.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{const s=JSON.parse(JSON.stringify(a));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Eb(e,"input"),output:Eb(e,"output")}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function rs(t,e){const r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);const n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return rs(n.element,r);if(n.type==="set")return rs(n.valueType,r);if(n.type==="lazy")return rs(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return rs(n.innerType,r);if(n.type==="intersection")return rs(n.left,r)||rs(n.right,r);if(n.type==="record"||n.type==="map")return rs(n.keyType,r)||rs(n.valueType,r);if(n.type==="pipe")return rs(n.in,r)||rs(n.out,r);if(n.type==="object"){for(const a in n.shape)if(rs(n.shape[a],r))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(rs(a,r))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(rs(a,r))return!0;return!!(n.rest&&rs(n.rest,r))}return!1}const ype=(t,e={})=>r=>{const n=QG({...r,processors:e});return hi(t,n),XG(n,t),ZG(n,t)},Eb=(t,e)=>r=>{const{libraryOptions:n,target:a}=r??{},i=QG({...n??{},target:a,io:e,processors:{}});return hi(t,i),XG(i,t),ZG(i,t)},Tpe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cpe=(t,e,r,n)=>{const a=r;a.type="string";const{minimum:i,maximum:s,format:o,patterns:l,contentEncoding:c}=t._zod.bag;if(typeof i=="number"&&(a.minLength=i),typeof s=="number"&&(a.maxLength=s),o&&(a.format=Tpe[o]??o,a.format===""&&delete a.format),c&&(a.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?a.pattern=u[0].source:u.length>1&&(a.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},wpe=(t,e,r,n)=>{const a=r,{minimum:i,maximum:s,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=t._zod.bag;typeof o=="string"&&o.includes("int")?a.type="integer":a.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.minimum=u,a.exclusiveMinimum=!0):a.exclusiveMinimum=u),typeof i=="number"&&(a.minimum=i,typeof u=="number"&&e.target!=="draft-04"&&(u>=i?delete a.minimum:delete a.exclusiveMinimum)),typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.maximum=c,a.exclusiveMaximum=!0):a.exclusiveMaximum=c),typeof s=="number"&&(a.maximum=s,typeof c=="number"&&e.target!=="draft-04"&&(c<=s?delete a.maximum:delete a.exclusiveMaximum)),typeof l=="number"&&(a.multipleOf=l)},Ape=(t,e,r,n)=>{r.type="boolean"},Rpe=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Ope=(t,e,r,n)=>{r.not={}},Npe=(t,e,r,n)=>{},Ipe=(t,e,r,n)=>{},xpe=(t,e,r,n)=>{const a=t._zod.def,i=NG(a.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},Dpe=(t,e,r,n)=>{const a=t._zod.def,i=[];for(const s of a.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];r.type=s===null?"null":typeof s,e.Line truncated
|
||||
`:""},this._extScope=O,this._scope=new r.Scope({parent:O}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(O){return this._scope.name(O)}scopeName(O){return this._extScope.name(O)}scopeValue(O,U){const X=this._extScope.value(O,U);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue(O,U){return this._extScope.getValue(O,U)}scopeRefs(O){return this._extScope.scopeRefs(O,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(O,U,X,ne){const ue=this._scope.toName(U);return X!==void 0&&ne&&(this._constants[ue.str]=X),this._leafNode(new s(O,ue,X)),ue}const(O,U,X){return this._def(r.varKinds.const,O,U,X)}let(O,U,X){return this._def(r.varKinds.let,O,U,X)}var(O,U,X){return this._def(r.varKinds.var,O,U,X)}assign(O,U,X){return this._leafNode(new o(O,U,X))}add(O,U){return this._leafNode(new l(O,t.operators.ADD,U))}code(O){return typeof O=="function"?O():O!==e.nil&&this._leafNode(new h(O)),this}object(...O){const U=["{"];for(const[X,ne]of O)U.length>1&&U.push(","),U.push(X),(X!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(O,U,X){if(this._blockNode(new _(O)),U&&X)this.code(U).else().code(X).endIf();else if(U)this.code(U).endIf();else if(X)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(O){return this._elseNode(new _(O))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(O,U){return this._blockNode(O),U&&this.code(U).endFor(),this}for(O,U){return this._for(new E(O),U)}forRange(O,U,X,ne,ue=this.opts.es5?r.varKinds.var:r.varKinds.let){const he=this._scope.toName(O);return this._for(new y(ue,he,U,X),()=>ne(he))}forOf(O,U,X,ne=r.varKinds.const){const ue=this._scope.toName(O);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),X(ue)})}return this._for(new v("of",ne,ue,U),()=>X(ue))}forIn(O,U,X,ne=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(O,(0,e._)`Object.keys(${U})`,X);const ue=this._scope.toName(O);return this._for(new v("in",ne,ue,U),()=>X(ue))}endFor(){return this._endBlockNode(S)}label(O){return this._leafNode(new c(O))}break(O){return this._leafNode(new u(O))}return(O){const U=new w;if(this._blockNode(U),this.code(O),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(O,U,X){if(!U&&!X)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new A;if(this._blockNode(ne),this.code(O),U){const ue=this.name("e");this._currNode=ne.catch=new I(ue),U(ue)}return X&&(this._currNode=ne.finally=new x,this.code(X)),this._endBlockNode(I,x)}throw(O){return this._leafNode(new d(O))}block(O,U){return this._blockStarts.push(this._nodes.length),O&&this.code(O).endBlock(U),this}endBlock(O){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const X=this._nodes.length-U;if(X<0||O!==void 0&&X!==O)throw new Error(`CodeGen: wrong number of nodes: ${X} vs ${O} expected`);return this._nodes.length=U,this}func(O,U=e.nil,X,ne){return this._blockNode(new T(O,U,X)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(O=1){for(;O-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(O){return this._currNode.nodes.push(O),this}_blockNode(O){this._currNode.nodes.push(O),this._nodes.push(O)}_endBlockNode(O,U){const X=this._currNode;if(X instanceof O||U&&X instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${O.kind}/${U.kind}`:O.kind}"`)}_elseNode(O){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=O,this}get _root(){return this._nodes[0]}get _currNode(){const O=this._nodes;return O[O.length-1]}set _currNode(O){const U=this._nodes;U[U.length-1]=O}}t.CodeGen=D;function $(N,O){for(const U in O)N[U]=(N[U]||0)+(O[U]||0);return N}function H(N,O){return O instanceof e._CodeOrName?$(N,O.names):N}function G(N,O,U){if(N instanceof e.Name)return X(N);if(!ne(N))return N;return new e._Code(N._items.reduce((ue,he)=>(he instanceof e.Name&&(he=X(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function X(ue){const he=U[ue.str];return he===void 0||O[ue.str]!==1?ue:(delete O[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&O[he.str]===1&&U[he.str]!==void 0)}}function K(N,O){for(const U in O)N[U]=(N[U]||0)-(O[U]||0)}function z(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,e._)`!${J(N)}`}t.not=z;const re=B(t.operators.AND);function W(...N){return N.reduce(re)}t.and=W;const ie=B(t.operators.OR);function M(...N){return N.reduce(ie)}t.or=M;function B(N){return(O,U)=>O===e.nil?U:U===e.nil?O:(0,e._)`${J(O)} ${N} ${J(U)}`}function J(N){return N i
Line truncated
|
||||
|| (${A} == "string" && ${T} && ${T} == +${T})`).assign(I,(0,n._)`+${T}`);return;case"integer":v.elseIf((0,n._)`${A} === "boolean" || ${T} === null
|
||||
|| (${A} === "string" && ${T} && ${T} == +${T} && !(${T} % 1))`).assign(I,(0,n._)`+${T}`);return;case"boolean":v.elseIf((0,n._)`${T} === "false" || ${T} === 0 || ${T} === null`).assign(I,!1).elseIf((0,n._)`${T} === "true" || ${T} === 1`).assign(I,!0);return;case"null":v.elseIf((0,n._)`${T} === "" || ${T} === 0 || ${T} === false`),v.assign(I,null);return;case"array":v.elseIf((0,n._)`${A} === "string" || ${A} === "number"
|
||||
|| ${A} === "boolean" || ${T} === null`).assign(I,(0,n._)`[${T}]`)}}}function h({gen:S,parentData:E,parentDataProperty:y},v){S.if((0,n._)`${E} !== undefined`,()=>S.assign((0,n._)`${E}[${y}]`,v))}function m(S,E,y,v=i.Correct){const T=v===i.Correct?n.operators.EQ:n.operators.NEQ;let w;switch(S){case"null":return(0,n._)`${E} ${T} null`;case"array":w=(0,n._)`Array.isArray(${E})`;break;case"object":w=(0,n._)`${E} && typeof ${E} == "object" && !Array.isArray(${E})`;break;case"integer":w=A((0,n._)`!(${E} % 1) && !isNaN(${E})`);break;case"number":w=A();break;default:return(0,n._)`typeof ${E} ${T} ${S}`}return v===i.Correct?w:(0,n.not)(w);function A(I=n.nil){return(0,n.and)((0,n._)`typeof ${E} == "number"`,I,y?(0,n._)`isFinite(${E})`:n.nil)}}Ci.checkDataType=m;function f(S,E,y,v){if(S.length===1)return m(S[0],E,y,v);let T;const w=(0,a.toHash)(S);if(w.array&&w.object){const A=(0,n._)`typeof ${E} != "object"`;T=w.null?A:(0,n._)`!${E} || ${A}`,delete w.null,delete w.array,delete w.object}else T=n.nil;w.number&&delete w.integer;for(const A in w)T=(0,n.and)(T,m(A,E,y,v));return T}Ci.checkDataTypes=f;const g={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:E})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${E}}`};function b(S){const E=_(S);(0,r.reportError)(E,g)}Ci.reportTypeError=b;function _(S){const{gen:E,data:y,schema:v}=S,T=(0,a.schemaRefOrVal)(S,v,"type");return{gen:E,keyword:"type",data:y,schema:v.type,schemaCode:T,schemaValue:T,parentSchema:v,params:{},it:S}}return Ci}var Rm={},J4;function Yge(){if(J4)return Rm;J4=1,Object.defineProperty(Rm,"__esModule",{value:!0}),Rm.assignDefaults=void 0;const t=Rn(),e=zn();function r(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Rm.assignDefaults=r;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,t._)`${c}${(0,t.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,t._)`${d} = ${(0,t.stringify)(s)}`)}return Rm}var Vo={},Wn={},eP;function hl(){if(eP)return Wn;eP=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.validateUnion=Wn.validateArray=Wn.usePattern=Wn.callValidateCode=Wn.schemaProperties=Wn.allSchemaProperties=Wn.noPropertyInData=Wn.propertyInData=Wn.isOwnProperty=Wn.hasPropFunc=Wn.reportMissingProp=Wn.checkMissingProp=Wn.checkReportMissingProp=void 0;const t=Rn(),e=zn(),r=nd(),n=zn();function a(S,E){const{gen:y,data:v,it:T}=S;y.if(u(y,v,E,T.opts.ownProperties),()=>{S.setParams({missingProperty:(0,t._)`${E}`},!0),S.error()})}Wn.checkReportMissingProp=a;function i({gen:S,data:E,it:{opts:y}},v,T){return(0,t.or)(...v.map(w=>(0,t.and)(u(S,E,w,y.ownProperties),(0,t._)`${T} = ${w}`)))}Wn.checkMissingProp=i;function s(S,E){S.setParams({missingProperty:E},!0),S.error()}Wn.reportMissingProp=s;function o(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}Wn.hasPropFunc=o;function l(S,E,y){return(0,t._)`${o(S)}.call(${E}, ${y})`}Wn.isOwnProperty=l;function c(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} !== undefined`;return v?(0,t._)`${T} && ${l(S,E,y)}`:T}Wn.propertyInData=c;function u(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} === undefined`;return v?(0,t.or)(T,(0,t.not)(l(S,E,y))):T}Wn.noPropertyInData=u;function d(S){return S?Object.keys(S).filter(E=>E!=="__proto__"):[]}Wn.allSchemaProperties=d;function h(S,E){return d(E).filter(y=>!(0,e.alwaysValidSchema)(S,E[y]))}Wn.schemaProperties=h;function m({schemaCode:S,data:E,it:{gen:y,topSchemaRef:v,schemaPath:T,errorPath:w},it:A},I,x,D){const $=D?(0,t._)`${S}, ${E}, ${v}${T}`:E,H=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,w)],[r.default.parentData,A.parentData],[r.default.parentDataProperty,A.parentDataProperty],[r.default.rootData,r.default.rootData]];A.opts.dynamicRef&&H.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const G=(0,t._)`${$}, ${y.object(...H)}`;return x!==t.nil?(0,t._)`${I}.call(${x}, ${G})`:(0,t._)`${I}(${G})`}Wn.callValidateCode=m;const f=(0,t._)`new RegExp`;function g({gen:S,it:{opts:E}},y){const v=E.unicodeRegExp?"u":"",{regExp:T}=E.code,w=T(y,v);return S.scopeValue("pattern",{key:w.toString(),ref:w,code:(0,t._)`${T.code==="new RegExp"?f:(0,n.useFunc)(S,T)}(${y}, ${v})`})}Wn.usePattern=g;function b(S){const{gen:E,data:y,keyword:v,it:T}=S,w=E.name("valid");if(T.allErrors){const I=E.let("valid",!0);return A(()=>E.assign(I,!1)),I}return E.var(w,!0),A(()=>E.break()),w;function A(I){const x=E.const("len",(0,t._)`${y}.length`);E.forRange("i",0,x,D=>{S.subschema({keyword:v,dataProp:D,dataPropType:e.Type.Num},w),E.if((0,t.not)(w),I)})}}Wn.validateArray=b;function _(S){const{gen:E,schema:y,keyword:v,it:T}=S;if(!Array.isArray(y))throw new Error("ajv
Line truncated
|
||||
|| ${A} === "boolean" || ${T} === null`).assign(I,(0,n._)`[${T}]`)}}}function h({gen:S,parentData:E,parentDataProperty:y},v){S.if((0,n._)`${E} !== undefined`,()=>S.assign((0,n._)`${E}[${y}]`,v))}function m(S,E,y,v=i.Correct){const T=v===i.Correct?n.operators.EQ:n.operators.NEQ;let w;switch(S){case"null":return(0,n._)`${E} ${T} null`;case"array":w=(0,n._)`Array.isArray(${E})`;break;case"object":w=(0,n._)`${E} && typeof ${E} == "object" && !Array.isArray(${E})`;break;case"integer":w=A((0,n._)`!(${E} % 1) && !isNaN(${E})`);break;case"number":w=A();break;default:return(0,n._)`typeof ${E} ${T} ${S}`}return v===i.Correct?w:(0,n.not)(w);function A(I=n.nil){return(0,n.and)((0,n._)`typeof ${E} == "number"`,I,y?(0,n._)`isFinite(${E})`:n.nil)}}wi.checkDataType=m;function f(S,E,y,v){if(S.length===1)return m(S[0],E,y,v);let T;const w=(0,a.toHash)(S);if(w.array&&w.object){const A=(0,n._)`typeof ${E} != "object"`;T=w.null?A:(0,n._)`!${E} || ${A}`,delete w.null,delete w.array,delete w.object}else T=n.nil;w.number&&delete w.integer;for(const A in w)T=(0,n.and)(T,m(A,E,y,v));return T}wi.checkDataTypes=f;const g={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:E})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${E}}`};function b(S){const E=_(S);(0,r.reportError)(E,g)}wi.reportTypeError=b;function _(S){const{gen:E,data:y,schema:v}=S,T=(0,a.schemaRefOrVal)(S,v,"type");return{gen:E,keyword:"type",data:y,schema:v.type,schemaCode:T,schemaValue:T,parentSchema:v,params:{},it:S}}return wi}var Rm={},J4;function Yge(){if(J4)return Rm;J4=1,Object.defineProperty(Rm,"__esModule",{value:!0}),Rm.assignDefaults=void 0;const t=Rn(),e=zn();function r(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Rm.assignDefaults=r;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,t._)`${c}${(0,t.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,t._)`${d} = ${(0,t.stringify)(s)}`)}return Rm}var Wo={},Wn={},eP;function pl(){if(eP)return Wn;eP=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.validateUnion=Wn.validateArray=Wn.usePattern=Wn.callValidateCode=Wn.schemaProperties=Wn.allSchemaProperties=Wn.noPropertyInData=Wn.propertyInData=Wn.isOwnProperty=Wn.hasPropFunc=Wn.reportMissingProp=Wn.checkMissingProp=Wn.checkReportMissingProp=void 0;const t=Rn(),e=zn(),r=nd(),n=zn();function a(S,E){const{gen:y,data:v,it:T}=S;y.if(u(y,v,E,T.opts.ownProperties),()=>{S.setParams({missingProperty:(0,t._)`${E}`},!0),S.error()})}Wn.checkReportMissingProp=a;function i({gen:S,data:E,it:{opts:y}},v,T){return(0,t.or)(...v.map(w=>(0,t.and)(u(S,E,w,y.ownProperties),(0,t._)`${T} = ${w}`)))}Wn.checkMissingProp=i;function s(S,E){S.setParams({missingProperty:E},!0),S.error()}Wn.reportMissingProp=s;function o(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}Wn.hasPropFunc=o;function l(S,E,y){return(0,t._)`${o(S)}.call(${E}, ${y})`}Wn.isOwnProperty=l;function c(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} !== undefined`;return v?(0,t._)`${T} && ${l(S,E,y)}`:T}Wn.propertyInData=c;function u(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} === undefined`;return v?(0,t.or)(T,(0,t.not)(l(S,E,y))):T}Wn.noPropertyInData=u;function d(S){return S?Object.keys(S).filter(E=>E!=="__proto__"):[]}Wn.allSchemaProperties=d;function h(S,E){return d(E).filter(y=>!(0,e.alwaysValidSchema)(S,E[y]))}Wn.schemaProperties=h;function m({schemaCode:S,data:E,it:{gen:y,topSchemaRef:v,schemaPath:T,errorPath:w},it:A},I,x,D){const $=D?(0,t._)`${S}, ${E}, ${v}${T}`:E,H=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,w)],[r.default.parentData,A.parentData],[r.default.parentDataProperty,A.parentDataProperty],[r.default.rootData,r.default.rootData]];A.opts.dynamicRef&&H.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const G=(0,t._)`${$}, ${y.object(...H)}`;return x!==t.nil?(0,t._)`${I}.call(${x}, ${G})`:(0,t._)`${I}(${G})`}Wn.callValidateCode=m;const f=(0,t._)`new RegExp`;function g({gen:S,it:{opts:E}},y){const v=E.unicodeRegExp?"u":"",{regExp:T}=E.code,w=T(y,v);return S.scopeValue("pattern",{key:w.toString(),ref:w,code:(0,t._)`${T.code==="new RegExp"?f:(0,n.useFunc)(S,T)}(${y}, ${v})`})}Wn.usePattern=g;function b(S){const{gen:E,data:y,keyword:v,it:T}=S,w=E.name("valid");if(T.allErrors){const I=E.let("valid",!0);return A(()=>E.assign(I,!1)),I}return E.var(w,!0),A(()=>E.break()),w;function A(I){const x=E.const("len",(0,t._)`${y}.length`);E.forRange("i",0,x,D=>{S.subschema({keyword:v,dataProp:D,dataPropType:e.Type.Num},w),E.if((0,t.not)(w),I)})}}Wn.validateArray=b;function _(S){const{gen:E,schema:y,keyword:v,it:T}=S;if(!Array.isArray(y))throw new Error("ajv
Line truncated
|
||||
missingProperty: ${d},
|
||||
depsCount: ${c},
|
||||
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const m=u.let("missing");for(const f in c){const g=c[f];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,f,h.opts.ownProperties);l.setParams({property:f,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,m)})`),(0,n.reportMissingProp)(l,m),u.else())}}t.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:m}=l,f=u.name("valid");for(const g in c)(0,r.alwaysValidSchema)(m,c[g])||(u.if((0,n.propertyInData)(u,d,g,m.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},f);l.mergeValidEvaluated(b,f)},()=>u.var(f,!0)),l.ok(f))}t.validateSchemaDeps=o,t.default=a}(Sw)),Sw}var Y_={},FP;function C_e(){if(FP)return Y_;FP=1,Object.defineProperty(Y_,"__esModule",{value:!0});const t=Rn(),e=zn(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,t._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,t.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return Y_.default=n,Y_}var V_={},BP;function Vq(){if(BP)return V_;BP=1,Object.defineProperty(V_,"__esModule",{value:!0});const t=hl(),e=Rn(),r=nd(),n=zn(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:m,opts:f}=h;if(h.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,t.allSchemaProperties)(c.properties),b=(0,t.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${r.default.errors}`);function _(){o.forIn("key",u,T=>{!g.length&&!b.length?y(T):o.if(S(T),()=>y(T))})}function S(T){let w;if(g.length>8){const A=(0,n.schemaRefOrVal)(h,c.properties,"properties");w=(0,t.isOwnProperty)(o,A,T)}else g.length?w=(0,e.or)(...g.map(A=>(0,e._)`${T} === ${A}`)):w=e.nil;return b.length&&(w=(0,e.or)(w,...b.map(A=>(0,e._)`${(0,t.usePattern)(s,A)}.test(${T})`))),(0,e.not)(w)}function E(T){o.code((0,e._)`delete ${u}[${T}]`)}function y(T){if(f.removeAdditional==="all"||f.removeAdditional&&l===!1){E(T);return}if(l===!1){s.setParams({additionalProperty:T}),s.error(),m||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const w=o.name("valid");f.removeAdditional==="failing"?(v(T,w,!1),o.if((0,e.not)(w),()=>{s.reset(),E(T)})):(v(T,w),m||o.if((0,e.not)(w),()=>o.break()))}}function v(T,w,A){const I={keyword:"additionalProperties",dataProp:T,dataPropType:n.Type.Str};A===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(I,w)}}};return V_.default=i,V_}var W_={},UP;function w_e(){if(UP)return W_;UP=1,Object.defineProperty(W_,"__esModule",{value:!0});const t=nE(),e=hl(),r=zn(),n=Vq(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=r.mergeEvaluated.props(s,(0,r.toHash)(d),u.props));const h=d.filter(b=>!(0,r.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const m=s.name("valid");for(const b of h)f(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(m,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(m);function f(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},m)}}};return W_.default=a,W_}var K_={},GP;function A_e(){if(GP)return K_;GP=1,Object.defineProperty(K_,"__esModule",{value:!0});const t=hl(),e=Rn(),r=zn(),n=zn(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,t.allSchemaProperties)(o),m=h.filter(y=>(0,r.alwaysValidSchema)(u,o[y]));if(h.length===0||m.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const f=d.strictSchema&&!d.allowMatch
Line truncated
|
||||
`:""},this._extScope=O,this._scope=new r.Scope({parent:O}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(O){return this._scope.name(O)}scopeName(O){return this._extScope.name(O)}scopeValue(O,U){const X=this._extScope.value(O,U);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue(O,U){return this._extScope.getValue(O,U)}scopeRefs(O){return this._extScope.scopeRefs(O,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(O,U,X,ne){const ue=this._scope.toName(U);return X!==void 0&&ne&&(this._constants[ue.str]=X),this._leafNode(new s(O,ue,X)),ue}const(O,U,X){return this._def(r.varKinds.const,O,U,X)}let(O,U,X){return this._def(r.varKinds.let,O,U,X)}var(O,U,X){return this._def(r.varKinds.var,O,U,X)}assign(O,U,X){return this._leafNode(new o(O,U,X))}add(O,U){return this._leafNode(new l(O,t.operators.ADD,U))}code(O){return typeof O=="function"?O():O!==e.nil&&this._leafNode(new h(O)),this}object(...O){const U=["{"];for(const[X,ne]of O)U.length>1&&U.push(","),U.push(X),(X!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(O,U,X){if(this._blockNode(new _(O)),U&&X)this.code(U).else().code(X).endIf();else if(U)this.code(U).endIf();else if(X)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(O){return this._elseNode(new _(O))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(O,U){return this._blockNode(O),U&&this.code(U).endFor(),this}for(O,U){return this._for(new E(O),U)}forRange(O,U,X,ne,ue=this.opts.es5?r.varKinds.var:r.varKinds.let){const he=this._scope.toName(O);return this._for(new y(ue,he,U,X),()=>ne(he))}forOf(O,U,X,ne=r.varKinds.const){const ue=this._scope.toName(O);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),X(ue)})}return this._for(new v("of",ne,ue,U),()=>X(ue))}forIn(O,U,X,ne=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(O,(0,e._)`Object.keys(${U})`,X);const ue=this._scope.toName(O);return this._for(new v("in",ne,ue,U),()=>X(ue))}endFor(){return this._endBlockNode(S)}label(O){return this._leafNode(new c(O))}break(O){return this._leafNode(new u(O))}return(O){const U=new w;if(this._blockNode(U),this.code(O),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(O,U,X){if(!U&&!X)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new A;if(this._blockNode(ne),this.code(O),U){const ue=this.name("e");this._currNode=ne.catch=new I(ue),U(ue)}return X&&(this._currNode=ne.finally=new x,this.code(X)),this._endBlockNode(I,x)}throw(O){return this._leafNode(new d(O))}block(O,U){return this._blockStarts.push(this._nodes.length),O&&this.code(O).endBlock(U),this}endBlock(O){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const X=this._nodes.length-U;if(X<0||O!==void 0&&X!==O)throw new Error(`CodeGen: wrong number of nodes: ${X} vs ${O} expected`);return this._nodes.length=U,this}func(O,U=e.nil,X,ne){return this._blockNode(new T(O,U,X)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(O=1){for(;O-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(O){return this._currNode.nodes.push(O),this}_blockNode(O){this._currNode.nodes.push(O),this._nodes.push(O)}_endBlockNode(O,U){const X=this._currNode;if(X instanceof O||U&&X instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${O.kind}/${U.kind}`:O.kind}"`)}_elseNode(O){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=O,this}get _root(){return this._nodes[0]}get _currNode(){const O=this._nodes;return O[O.length-1]}set _currNode(O){const U=this._nodes;U[U.length-1]=O}}t.CodeGen=D;function $(N,O){for(const U in O)N[U]=(N[U]||0)+(O[U]||0);return N}function H(N,O){return O instanceof e._CodeOrName?$(N,O.names):N}function G(N,O,U){if(N instanceof e.Name)return X(N);if(!ne(N))return N;return new e._Code(N._items.reduce((ue,he)=>(he instanceof e.Name&&(he=X(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function X(ue){const he=U[ue.str];return he===void 0||O[ue.str]!==1?ue:(delete O[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&O[he.str]===1&&U[he.str]!==void 0)}}function K(N,O){for(const U in O)N[U]=(N[U]||0)-(O[U]||0)}function z(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,e._)`!${J(N)}`}t.not=z;const re=B(t.operators.AND);function W(...N){return N.reduce(re)}t.and=W;const ie=B(t.operators.OR);function M(...N){return N.reduce(ie)}t.or=M;function B(N){return(O,U)=>O===e.nil?U:U===e.nil?O:(0,e._)`${J(O)} ${N} ${J(U)}`}function J(N){return N i
Line truncated
|
||||
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const m=u.let("missing");for(const f in c){const g=c[f];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,f,h.opts.ownProperties);l.setParams({property:f,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,m)})`),(0,n.reportMissingProp)(l,m),u.else())}}t.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:m}=l,f=u.name("valid");for(const g in c)(0,r.alwaysValidSchema)(m,c[g])||(u.if((0,n.propertyInData)(u,d,g,m.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},f);l.mergeValidEvaluated(b,f)},()=>u.var(f,!0)),l.ok(f))}t.validateSchemaDeps=o,t.default=a}(Ew)),Ew}var Y_={},FP;function C_e(){if(FP)return Y_;FP=1,Object.defineProperty(Y_,"__esModule",{value:!0});const t=Rn(),e=zn(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,t._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,t.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return Y_.default=n,Y_}var V_={},BP;function Vq(){if(BP)return V_;BP=1,Object.defineProperty(V_,"__esModule",{value:!0});const t=pl(),e=Rn(),r=nd(),n=zn(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:m,opts:f}=h;if(h.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,t.allSchemaProperties)(c.properties),b=(0,t.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${r.default.errors}`);function _(){o.forIn("key",u,T=>{!g.length&&!b.length?y(T):o.if(S(T),()=>y(T))})}function S(T){let w;if(g.length>8){const A=(0,n.schemaRefOrVal)(h,c.properties,"properties");w=(0,t.isOwnProperty)(o,A,T)}else g.length?w=(0,e.or)(...g.map(A=>(0,e._)`${T} === ${A}`)):w=e.nil;return b.length&&(w=(0,e.or)(w,...b.map(A=>(0,e._)`${(0,t.usePattern)(s,A)}.test(${T})`))),(0,e.not)(w)}function E(T){o.code((0,e._)`delete ${u}[${T}]`)}function y(T){if(f.removeAdditional==="all"||f.removeAdditional&&l===!1){E(T);return}if(l===!1){s.setParams({additionalProperty:T}),s.error(),m||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const w=o.name("valid");f.removeAdditional==="failing"?(v(T,w,!1),o.if((0,e.not)(w),()=>{s.reset(),E(T)})):(v(T,w),m||o.if((0,e.not)(w),()=>o.break()))}}function v(T,w,A){const I={keyword:"additionalProperties",dataProp:T,dataPropType:n.Type.Str};A===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(I,w)}}};return V_.default=i,V_}var W_={},UP;function w_e(){if(UP)return W_;UP=1,Object.defineProperty(W_,"__esModule",{value:!0});const t=aE(),e=pl(),r=zn(),n=Vq(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=r.mergeEvaluated.props(s,(0,r.toHash)(d),u.props));const h=d.filter(b=>!(0,r.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const m=s.name("valid");for(const b of h)f(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(m,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(m);function f(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},m)}}};return W_.default=a,W_}var K_={},GP;function A_e(){if(GP)return K_;GP=1,Object.defineProperty(K_,"__esModule",{value:!0});const t=pl(),e=Rn(),r=zn(),n=zn(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,t.allSchemaProperties)(o),m=h.filter(y=>(0,r.alwaysValidSchema)(u,o[y]));if(h.length===0||m.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const f=d.strictSchema&&!d.allowMatch
Line truncated
|
||||
`:""},this._extScope=O,this._scope=new r.Scope({parent:O}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(O){return this._scope.name(O)}scopeName(O){return this._extScope.name(O)}scopeValue(O,U){const X=this._extScope.value(O,U);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue(O,U){return this._extScope.getValue(O,U)}scopeRefs(O){return this._extScope.scopeRefs(O,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(O,U,X,ne){const ue=this._scope.toName(U);return X!==void 0&&ne&&(this._constants[ue.str]=X),this._leafNode(new s(O,ue,X)),ue}const(O,U,X){return this._def(r.varKinds.const,O,U,X)}let(O,U,X){return this._def(r.varKinds.let,O,U,X)}var(O,U,X){return this._def(r.varKinds.var,O,U,X)}assign(O,U,X){return this._leafNode(new o(O,U,X))}add(O,U){return this._leafNode(new l(O,t.operators.ADD,U))}code(O){return typeof O=="function"?O():O!==e.nil&&this._leafNode(new h(O)),this}object(...O){const U=["{"];for(const[X,ne]of O)U.length>1&&U.push(","),U.push(X),(X!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(O,U,X){if(this._blockNode(new _(O)),U&&X)this.code(U).else().code(X).endIf();else if(U)this.code(U).endIf();else if(X)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(O){return this._elseNode(new _(O))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(O,U){return this._blockNode(O),U&&this.code(U).endFor(),this}for(O,U){return this._for(new E(O),U)}forRange(O,U,X,ne,ue=this.opts.es5?r.varKinds.var:r.varKinds.let){const he=this._scope.toName(O);return this._for(new y(ue,he,U,X),()=>ne(he))}forOf(O,U,X,ne=r.varKinds.const){const ue=this._scope.toName(O);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),X(ue)})}return this._for(new v("of",ne,ue,U),()=>X(ue))}forIn(O,U,X,ne=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(O,(0,e._)`Object.keys(${U})`,X);const ue=this._scope.toName(O);return this._for(new v("in",ne,ue,U),()=>X(ue))}endFor(){return this._endBlockNode(S)}label(O){return this._leafNode(new c(O))}break(O){return this._leafNode(new u(O))}return(O){const U=new w;if(this._blockNode(U),this.code(O),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(O,U,X){if(!U&&!X)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new A;if(this._blockNode(ne),this.code(O),U){const ue=this.name("e");this._currNode=ne.catch=new I(ue),U(ue)}return X&&(this._currNode=ne.finally=new x,this.code(X)),this._endBlockNode(I,x)}throw(O){return this._leafNode(new d(O))}block(O,U){return this._blockStarts.push(this._nodes.length),O&&this.code(O).endBlock(U),this}endBlock(O){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const X=this._nodes.length-U;if(X<0||O!==void 0&&X!==O)throw new Error(`CodeGen: wrong number of nodes: ${X} vs ${O} expected`);return this._nodes.length=U,this}func(O,U=e.nil,X,ne){return this._blockNode(new T(O,U,X)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(O=1){for(;O-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(O){return this._currNode.nodes.push(O),this}_blockNode(O){this._currNode.nodes.push(O),this._nodes.push(O)}_endBlockNode(O,U){const X=this._currNode;if(X instanceof O||U&&X instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${O.kind}/${U.kind}`:O.kind}"`)}_elseNode(O){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=O,this}get _root(){return this._nodes[0]}get _currNode(){const O=this._nodes;return O[O.length-1]}set _currNode(O){const U=this._nodes;U[U.length-1]=O}}t.CodeGen=D;function $(N,O){for(const U in O)N[U]=(N[U]||0)+(O[U]||0);return N}function H(N,O){return O instanceof e._CodeOrName?$(N,O.names):N}function G(N,O,U){if(N instanceof e.Name)return X(N);if(!ne(N))return N;return new e._Code(N._items.reduce((ue,he)=>(he instanceof e.Name&&(he=X(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function X(ue){const he=U[ue.str];return he===void 0||O[ue.str]!==1?ue:(delete O[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&O[he.str]===1&&U[he.str]!==void 0)}}function K(N,O){for(const U in O)N[U]=(N[U]||0)-(O[U]||0)}function z(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,e._)`!${J(N)}`}t.not=z;const re=B(t.operators.AND);function W(...N){return N.reduce(re)}t.and=W;const ie=B(t.operators.OR);function M(...N){return N.reduce(ie)}t.or=M;function B(N){return(O,U)=>O===e.nil?U:U===e.nil?O:(0,e._)`${J(O)} ${N} ${J(U)}`}function J(N){return N i
Line truncated
|
||||
|| (${A} == "string" && ${T} && ${T} == +${T})`).assign(I,(0,n._)`+${T}`);return;case"integer":v.elseIf((0,n._)`${A} === "boolean" || ${T} === null
|
||||
|| (${A} === "string" && ${T} && ${T} == +${T} && !(${T} % 1))`).assign(I,(0,n._)`+${T}`);return;case"boolean":v.elseIf((0,n._)`${T} === "false" || ${T} === 0 || ${T} === null`).assign(I,!1).elseIf((0,n._)`${T} === "true" || ${T} === 1`).assign(I,!0);return;case"null":v.elseIf((0,n._)`${T} === "" || ${T} === 0 || ${T} === false`),v.assign(I,null);return;case"array":v.elseIf((0,n._)`${A} === "string" || ${A} === "number"
|
||||
|| ${A} === "boolean" || ${T} === null`).assign(I,(0,n._)`[${T}]`)}}}function h({gen:S,parentData:E,parentDataProperty:y},v){S.if((0,n._)`${E} !== undefined`,()=>S.assign((0,n._)`${E}[${y}]`,v))}function m(S,E,y,v=i.Correct){const T=v===i.Correct?n.operators.EQ:n.operators.NEQ;let w;switch(S){case"null":return(0,n._)`${E} ${T} null`;case"array":w=(0,n._)`Array.isArray(${E})`;break;case"object":w=(0,n._)`${E} && typeof ${E} == "object" && !Array.isArray(${E})`;break;case"integer":w=A((0,n._)`!(${E} % 1) && !isNaN(${E})`);break;case"number":w=A();break;default:return(0,n._)`typeof ${E} ${T} ${S}`}return v===i.Correct?w:(0,n.not)(w);function A(I=n.nil){return(0,n.and)((0,n._)`typeof ${E} == "number"`,I,y?(0,n._)`isFinite(${E})`:n.nil)}}wi.checkDataType=m;function f(S,E,y,v){if(S.length===1)return m(S[0],E,y,v);let T;const w=(0,a.toHash)(S);if(w.array&&w.object){const A=(0,n._)`typeof ${E} != "object"`;T=w.null?A:(0,n._)`!${E} || ${A}`,delete w.null,delete w.array,delete w.object}else T=n.nil;w.number&&delete w.integer;for(const A in w)T=(0,n.and)(T,m(A,E,y,v));return T}wi.checkDataTypes=f;const g={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:E})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${E}}`};function b(S){const E=_(S);(0,r.reportError)(E,g)}wi.reportTypeError=b;function _(S){const{gen:E,data:y,schema:v}=S,T=(0,a.schemaRefOrVal)(S,v,"type");return{gen:E,keyword:"type",data:y,schema:v.type,schemaCode:T,schemaValue:T,parentSchema:v,params:{},it:S}}return wi}var Im={},p6;function Z_e(){if(p6)return Im;p6=1,Object.defineProperty(Im,"__esModule",{value:!0}),Im.assignDefaults=void 0;const t=mn(),e=$n();function r(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Im.assignDefaults=r;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,t._)`${c}${(0,t.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,t._)`${d} = ${(0,t.stringify)(s)}`)}return Im}var Wo={},Kn={},m6;function pl(){if(m6)return Kn;m6=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.validateUnion=Kn.validateArray=Kn.usePattern=Kn.callValidateCode=Kn.schemaProperties=Kn.allSchemaProperties=Kn.noPropertyInData=Kn.propertyInData=Kn.isOwnProperty=Kn.hasPropFunc=Kn.reportMissingProp=Kn.checkMissingProp=Kn.checkReportMissingProp=void 0;const t=mn(),e=$n(),r=ad(),n=$n();function a(S,E){const{gen:y,data:v,it:T}=S;y.if(u(y,v,E,T.opts.ownProperties),()=>{S.setParams({missingProperty:(0,t._)`${E}`},!0),S.error()})}Kn.checkReportMissingProp=a;function i({gen:S,data:E,it:{opts:y}},v,T){return(0,t.or)(...v.map(w=>(0,t.and)(u(S,E,w,y.ownProperties),(0,t._)`${T} = ${w}`)))}Kn.checkMissingProp=i;function s(S,E){S.setParams({missingProperty:E},!0),S.error()}Kn.reportMissingProp=s;function o(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}Kn.hasPropFunc=o;function l(S,E,y){return(0,t._)`${o(S)}.call(${E}, ${y})`}Kn.isOwnProperty=l;function c(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} !== undefined`;return v?(0,t._)`${T} && ${l(S,E,y)}`:T}Kn.propertyInData=c;function u(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} === undefined`;return v?(0,t.or)(T,(0,t.not)(l(S,E,y))):T}Kn.noPropertyInData=u;function d(S){return S?Object.keys(S).filter(E=>E!=="__proto__"):[]}Kn.allSchemaProperties=d;function h(S,E){return d(E).filter(y=>!(0,e.alwaysValidSchema)(S,E[y]))}Kn.schemaProperties=h;function m({schemaCode:S,data:E,it:{gen:y,topSchemaRef:v,schemaPath:T,errorPath:w},it:A},I,x,D){const $=D?(0,t._)`${S}, ${E}, ${v}${T}`:E,H=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,w)],[r.default.parentData,A.parentData],[r.default.parentDataProperty,A.parentDataProperty],[r.default.rootData,r.default.rootData]];A.opts.dynamicRef&&H.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const G=(0,t._)`${$}, ${y.object(...H)}`;return x!==t.nil?(0,t._)`${I}.call(${x}, ${G})`:(0,t._)`${I}(${G})`}Kn.callValidateCode=m;const f=(0,t._)`new RegExp`;function g({gen:S,it:{opts:E}},y){const v=E.unicodeRegExp?"u":"",{regExp:T}=E.code,w=T(y,v);return S.scopeValue("pattern",{key:w.toString(),ref:w,code:(0,t._)`${T.code==="new RegExp"?f:(0,n.useFunc)(S,T)}(${y}, ${v})`})}Kn.usePattern=g;function b(S){const{gen:E,data:y,keyword:v,it:T}=S,w=E.name("valid");if(T.allErrors){const I=E.let("valid",!0);return A(()=>E.assign(I,!1)),I}return E.var(w,!0),A(()=>E.break()),w;function A(I){const x=E.const("len",(0,t._)`${y}.length`);E.forRange("i",0,x,D=>{S.subschema({keyword:v,dataProp:D,dataPropType:e.Type.Num},w),E.if((0,t.not)(w),I)})}}Kn.validateArray=b;function _(S){const{gen:E,schema:y,keyword:v,it:T}=S;if(!Array.isArray(y))throw new Error("ajv
Line truncated
|
||||
|| ${A} === "boolean" || ${T} === null`).assign(I,(0,n._)`[${T}]`)}}}function h({gen:S,parentData:E,parentDataProperty:y},v){S.if((0,n._)`${E} !== undefined`,()=>S.assign((0,n._)`${E}[${y}]`,v))}function m(S,E,y,v=i.Correct){const T=v===i.Correct?n.operators.EQ:n.operators.NEQ;let w;switch(S){case"null":return(0,n._)`${E} ${T} null`;case"array":w=(0,n._)`Array.isArray(${E})`;break;case"object":w=(0,n._)`${E} && typeof ${E} == "object" && !Array.isArray(${E})`;break;case"integer":w=A((0,n._)`!(${E} % 1) && !isNaN(${E})`);break;case"number":w=A();break;default:return(0,n._)`typeof ${E} ${T} ${S}`}return v===i.Correct?w:(0,n.not)(w);function A(I=n.nil){return(0,n.and)((0,n._)`typeof ${E} == "number"`,I,y?(0,n._)`isFinite(${E})`:n.nil)}}Ai.checkDataType=m;function f(S,E,y,v){if(S.length===1)return m(S[0],E,y,v);let T;const w=(0,a.toHash)(S);if(w.array&&w.object){const A=(0,n._)`typeof ${E} != "object"`;T=w.null?A:(0,n._)`!${E} || ${A}`,delete w.null,delete w.array,delete w.object}else T=n.nil;w.number&&delete w.integer;for(const A in w)T=(0,n.and)(T,m(A,E,y,v));return T}Ai.checkDataTypes=f;const g={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:E})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${E}}`};function b(S){const E=_(S);(0,r.reportError)(E,g)}Ai.reportTypeError=b;function _(S){const{gen:E,data:y,schema:v}=S,T=(0,a.schemaRefOrVal)(S,v,"type");return{gen:E,keyword:"type",data:y,schema:v.type,schemaCode:T,schemaValue:T,parentSchema:v,params:{},it:S}}return Ai}var Im={},p6;function Z_e(){if(p6)return Im;p6=1,Object.defineProperty(Im,"__esModule",{value:!0}),Im.assignDefaults=void 0;const t=fn(),e=$n();function r(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Im.assignDefaults=r;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,t._)`${c}${(0,t.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,t._)`${d} = ${(0,t.stringify)(s)}`)}return Im}var Ko={},Kn={},m6;function ml(){if(m6)return Kn;m6=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.validateUnion=Kn.validateArray=Kn.usePattern=Kn.callValidateCode=Kn.schemaProperties=Kn.allSchemaProperties=Kn.noPropertyInData=Kn.propertyInData=Kn.isOwnProperty=Kn.hasPropFunc=Kn.reportMissingProp=Kn.checkMissingProp=Kn.checkReportMissingProp=void 0;const t=fn(),e=$n(),r=ad(),n=$n();function a(S,E){const{gen:y,data:v,it:T}=S;y.if(u(y,v,E,T.opts.ownProperties),()=>{S.setParams({missingProperty:(0,t._)`${E}`},!0),S.error()})}Kn.checkReportMissingProp=a;function i({gen:S,data:E,it:{opts:y}},v,T){return(0,t.or)(...v.map(w=>(0,t.and)(u(S,E,w,y.ownProperties),(0,t._)`${T} = ${w}`)))}Kn.checkMissingProp=i;function s(S,E){S.setParams({missingProperty:E},!0),S.error()}Kn.reportMissingProp=s;function o(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}Kn.hasPropFunc=o;function l(S,E,y){return(0,t._)`${o(S)}.call(${E}, ${y})`}Kn.isOwnProperty=l;function c(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} !== undefined`;return v?(0,t._)`${T} && ${l(S,E,y)}`:T}Kn.propertyInData=c;function u(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} === undefined`;return v?(0,t.or)(T,(0,t.not)(l(S,E,y))):T}Kn.noPropertyInData=u;function d(S){return S?Object.keys(S).filter(E=>E!=="__proto__"):[]}Kn.allSchemaProperties=d;function h(S,E){return d(E).filter(y=>!(0,e.alwaysValidSchema)(S,E[y]))}Kn.schemaProperties=h;function m({schemaCode:S,data:E,it:{gen:y,topSchemaRef:v,schemaPath:T,errorPath:w},it:A},I,x,D){const $=D?(0,t._)`${S}, ${E}, ${v}${T}`:E,H=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,w)],[r.default.parentData,A.parentData],[r.default.parentDataProperty,A.parentDataProperty],[r.default.rootData,r.default.rootData]];A.opts.dynamicRef&&H.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const G=(0,t._)`${$}, ${y.object(...H)}`;return x!==t.nil?(0,t._)`${I}.call(${x}, ${G})`:(0,t._)`${I}(${G})`}Kn.callValidateCode=m;const f=(0,t._)`new RegExp`;function g({gen:S,it:{opts:E}},y){const v=E.unicodeRegExp?"u":"",{regExp:T}=E.code,w=T(y,v);return S.scopeValue("pattern",{key:w.toString(),ref:w,code:(0,t._)`${T.code==="new RegExp"?f:(0,n.useFunc)(S,T)}(${y}, ${v})`})}Kn.usePattern=g;function b(S){const{gen:E,data:y,keyword:v,it:T}=S,w=E.name("valid");if(T.allErrors){const I=E.let("valid",!0);return A(()=>E.assign(I,!1)),I}return E.var(w,!0),A(()=>E.break()),w;function A(I){const x=E.const("len",(0,t._)`${y}.length`);E.forRange("i",0,x,D=>{S.subschema({keyword:v,dataProp:D,dataPropType:e.Type.Num},w),E.if((0,t.not)(w),I)})}}Kn.validateArray=b;function _(S){const{gen:E,schema:y,keyword:v,it:T}=S;if(!Array.isArray(y))throw new Error("ajv
Line truncated
|
||||
missingProperty: ${d},
|
||||
depsCount: ${c},
|
||||
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const m=u.let("missing");for(const f in c){const g=c[f];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,f,h.opts.ownProperties);l.setParams({property:f,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,m)})`),(0,n.reportMissingProp)(l,m),u.else())}}t.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:m}=l,f=u.name("valid");for(const g in c)(0,r.alwaysValidSchema)(m,c[g])||(u.if((0,n.propertyInData)(u,d,g,m.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},f);l.mergeValidEvaluated(b,f)},()=>u.var(f,!0)),l.ok(f))}t.validateSchemaDeps=o,t.default=a}(Ow)),Ow}var I0={},W6;function I0e(){if(W6)return I0;W6=1,Object.defineProperty(I0,"__esModule",{value:!0});const t=mn(),e=$n(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,t._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,t.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return I0.default=n,I0}var x0={},K6;function Xq(){if(K6)return x0;K6=1,Object.defineProperty(x0,"__esModule",{value:!0});const t=pl(),e=mn(),r=ad(),n=$n(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:m,opts:f}=h;if(h.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,t.allSchemaProperties)(c.properties),b=(0,t.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${r.default.errors}`);function _(){o.forIn("key",u,T=>{!g.length&&!b.length?y(T):o.if(S(T),()=>y(T))})}function S(T){let w;if(g.length>8){const A=(0,n.schemaRefOrVal)(h,c.properties,"properties");w=(0,t.isOwnProperty)(o,A,T)}else g.length?w=(0,e.or)(...g.map(A=>(0,e._)`${T} === ${A}`)):w=e.nil;return b.length&&(w=(0,e.or)(w,...b.map(A=>(0,e._)`${(0,t.usePattern)(s,A)}.test(${T})`))),(0,e.not)(w)}function E(T){o.code((0,e._)`delete ${u}[${T}]`)}function y(T){if(f.removeAdditional==="all"||f.removeAdditional&&l===!1){E(T);return}if(l===!1){s.setParams({additionalProperty:T}),s.error(),m||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const w=o.name("valid");f.removeAdditional==="failing"?(v(T,w,!1),o.if((0,e.not)(w),()=>{s.reset(),E(T)})):(v(T,w),m||o.if((0,e.not)(w),()=>o.break()))}}function v(T,w,A){const I={keyword:"additionalProperties",dataProp:T,dataPropType:n.Type.Str};A===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(I,w)}}};return x0.default=i,x0}var D0={},j6;function x0e(){if(j6)return D0;j6=1,Object.defineProperty(D0,"__esModule",{value:!0});const t=oE(),e=pl(),r=$n(),n=Xq(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=r.mergeEvaluated.props(s,(0,r.toHash)(d),u.props));const h=d.filter(b=>!(0,r.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const m=s.name("valid");for(const b of h)f(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(m,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(m);function f(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},m)}}};return D0.default=a,D0}var M0={},Q6;function D0e(){if(Q6)return M0;Q6=1,Object.defineProperty(M0,"__esModule",{value:!0});const t=pl(),e=mn(),r=$n(),n=$n(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,t.allSchemaProperties)(o),m=h.filter(y=>(0,r.alwaysValidSchema)(u,o[y]));if(h.length===0||m.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const f=d.strictSchema&&!d.allowMatch
Line truncated
|
||||
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const m=u.let("missing");for(const f in c){const g=c[f];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,f,h.opts.ownProperties);l.setParams({property:f,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,m)})`),(0,n.reportMissingProp)(l,m),u.else())}}t.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:m}=l,f=u.name("valid");for(const g in c)(0,r.alwaysValidSchema)(m,c[g])||(u.if((0,n.propertyInData)(u,d,g,m.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},f);l.mergeValidEvaluated(b,f)},()=>u.var(f,!0)),l.ok(f))}t.validateSchemaDeps=o,t.default=a}(Nw)),Nw}var I0={},W6;function I0e(){if(W6)return I0;W6=1,Object.defineProperty(I0,"__esModule",{value:!0});const t=fn(),e=$n(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,t._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,t.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return I0.default=n,I0}var x0={},K6;function Xq(){if(K6)return x0;K6=1,Object.defineProperty(x0,"__esModule",{value:!0});const t=ml(),e=fn(),r=ad(),n=$n(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:m,opts:f}=h;if(h.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,t.allSchemaProperties)(c.properties),b=(0,t.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${r.default.errors}`);function _(){o.forIn("key",u,T=>{!g.length&&!b.length?y(T):o.if(S(T),()=>y(T))})}function S(T){let w;if(g.length>8){const A=(0,n.schemaRefOrVal)(h,c.properties,"properties");w=(0,t.isOwnProperty)(o,A,T)}else g.length?w=(0,e.or)(...g.map(A=>(0,e._)`${T} === ${A}`)):w=e.nil;return b.length&&(w=(0,e.or)(w,...b.map(A=>(0,e._)`${(0,t.usePattern)(s,A)}.test(${T})`))),(0,e.not)(w)}function E(T){o.code((0,e._)`delete ${u}[${T}]`)}function y(T){if(f.removeAdditional==="all"||f.removeAdditional&&l===!1){E(T);return}if(l===!1){s.setParams({additionalProperty:T}),s.error(),m||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const w=o.name("valid");f.removeAdditional==="failing"?(v(T,w,!1),o.if((0,e.not)(w),()=>{s.reset(),E(T)})):(v(T,w),m||o.if((0,e.not)(w),()=>o.break()))}}function v(T,w,A){const I={keyword:"additionalProperties",dataProp:T,dataPropType:n.Type.Str};A===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(I,w)}}};return x0.default=i,x0}var D0={},j6;function x0e(){if(j6)return D0;j6=1,Object.defineProperty(D0,"__esModule",{value:!0});const t=lE(),e=ml(),r=$n(),n=Xq(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=r.mergeEvaluated.props(s,(0,r.toHash)(d),u.props));const h=d.filter(b=>!(0,r.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const m=s.name("valid");for(const b of h)f(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(m,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(m);function f(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},m)}}};return D0.default=a,D0}var M0={},Q6;function D0e(){if(Q6)return M0;Q6=1,Object.defineProperty(M0,"__esModule",{value:!0});const t=ml(),e=fn(),r=$n(),n=$n(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,t.allSchemaProperties)(o),m=h.filter(y=>(0,r.alwaysValidSchema)(u,o[y]));if(h.length===0||m.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const f=d.strictSchema&&!d.allowMatch
Line truncated
|
||||
`;break;case"id":o=b.includes("\0")?void 0:b;break;case"retry":/^\d+$/.test(b)?n(parseInt(b,10)):r(new f7(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:_}));break;default:r(new f7(`Unknown field "${g.length>20?`${g.slice(0,20)}…`:g}"`,{type:"unknown-field",field:g,value:b,line:_}));break}}function m(){l.length>0&&e({id:o,event:c||void 0,data:l.endsWith(`
|
||||
`)?l.slice(0,-1):l}),o=void 0,l="",c=""}function f(g={}){i&&g.consume&&d(i),s=!0,o=void 0,l="",c="",i=""}return{feed:u,reset:f}}function V1e(t){const e=[];let r="",n=0;for(;n<t.length;){const a=t.indexOf("\r",n),i=t.indexOf(`
|
||||
`,n);let s=-1;if(a!==-1&&i!==-1?s=Math.min(a,i):a!==-1?a===t.length-1?s=-1:s=a:i!==-1&&(s=i),s===-1){r=t.slice(n);break}else{const o=t.slice(n,s);e.push(o),n=s+1,t[n-1]==="\r"&&t[n]===`
|
||||
`&&n++}}return[e,r]}class W1e extends TransformStream{constructor({onError:e,onRetry:r,onComment:n}={}){let a;super({start(i){a=rz({onEvent:s=>{i.enqueue(s)},onError(s){e==="terminate"?i.error(s):typeof e=="function"&&e(s)},onRetry:r,onComment:n})},transform(i){a.feed(i)}})}}const K1e={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Fd extends Error{constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}}class j1e{constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Zq(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??K1e}async _authThenStart(){if(!this._authProvider)throw new Jo("No auth provider");let e;try{e=await Yd(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new Jo;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const r=Ab(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){const{resumptionToken:r}=e;try{const n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Fd(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),a)}_scheduleReconnection(e,r=0){const n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}const a=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(e,r+1)})},a)}_handleSseStream(e,r,n){if(!e)return;const{onresumptiontoken:a,replayMessageId:i}=r;let s,o=!1,l=!1;(async()=>{try{const u=e.pipeThrough(new TextDecoderStream).pipeThrough(new W1e({onRetry:m=>{this._serverRetryMs=m}})).getReader();for(;;){const{value:m,done:f}=await u.read();if(f)break;if(m.id&&(s=m.id,o=!0,a?.(m.id)),!!m.data&&(!m.event||m.event==="message"))try{const g=lf.parse(JSON.parse(m.data));jm(g)&&(l=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(u){if(this.onerror?.(new Error(`SSE stream disconnected: ${u}`)),(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(m){this.onerror?.(new Error(`Failed to reconnect: ${m instanceof Error?m.message:String(m)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Jo("No auth provider");if(await Yd(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Jo("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{const{resumptionToken:n,onresumptiontoken:a}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:OR(e)?e.id:void 0}).catch(h=>this.onerror?.(h));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,s),l=o.headers.get("mcp-session-id");if(l&&(this._sessionId=l),!o.ok){const h=await o.t
Line truncated
|
||||
`):""}static formatSingleContent(e){if(e.type===y1.TEXT&&e.text)return e.text;if(e.type===y1.IMAGE&&e.data)return fb(e.mimeType??Pne,e.data);if(e.type===y1.RESOURCE&&e.resource){const r=e.resource;return r.text?r.text:r.blob?r.blob:JSON.stringify(r)}return e.data&&e.mimeType?fb(e.mimeType,e.data):JSON.stringify(e)}static async complete(e,r,n){try{return(await e.client.complete({ref:r,argument:n})).completion}catch(a){return console.error("[MCPService] Failed to get completions:",a),null}}static async listResources(e,r){try{const n=await e.client.listResources(r?{cursor:r}:void 0);return{resources:n.resources??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resources:`,n),{resources:[]}}}static async listAllResources(e){const r=[];let n;do{const a=await this.listResources(e,n);r.push(...a.resources),n=a.nextCursor}while(n);return r}static async listResourceTemplates(e,r){try{const n=await e.client.listResourceTemplates(r?{cursor:r}:void 0);return{resourceTemplates:n.resourceTemplates??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resource templates:`,n),{resourceTemplates:[]}}}static async listAllResourceTemplates(e){const r=[];let n;do{const a=await this.listResourceTemplates(e,n);r.push(...a.resourceTemplates),n=a.nextCursor}while(n);return r}static async readResource(e,r){try{const n=await e.client.readResource({uri:r});return{contents:n.contents??[],_meta:n._meta}}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to read resource:`,n),n}}static async subscribeResource(e,r){try{await e.client.subscribeResource({uri:r}),console.log(`[MCPService][${e.serverName}] Subscribed to resource: ${r}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to subscribe to resource:`,n),n}}static async unsubscribeResource(e,r){try{await e.client.unsubscribeResource({uri:r}),console.log(`[MCPService][${e.serverName}] Unsubscribed from resource: ${r}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to unsubscribe from resource:`,n),n}}static supportsResources(e){return e.serverCapabilities?.resources!==void 0}static supportsResourceSubscriptions(e){return!!e.serverCapabilities?.resources?.subscribe}}function rbe(){return`${Jne}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}class nbe{#e=_e(Tr(new Ii));get _serverResources(){return p(this.#e)}set _serverResources(e){k(this.#e,e,!0)}#t=_e(Tr(new Ii));get _cachedResources(){return p(this.#t)}set _cachedResources(e){k(this.#t,e,!0)}#r=_e(Tr(new Ii));get _subscriptions(){return p(this.#r)}set _subscriptions(e){k(this.#r,e,!0)}#n=_e(Tr([]));get _attachments(){return p(this.#n)}set _attachments(e){k(this.#n,e,!0)}#i=_e(!1);get _isLoading(){return p(this.#i)}set _isLoading(e){k(this.#i,e,!0)}get serverResources(){return this._serverResources}get cachedResources(){return this._cachedResources}get subscriptions(){return this._subscriptions}get attachments(){return this._attachments}get isLoading(){return this._isLoading}get totalResourceCount(){let e=0;for(const r of this._serverResources.values())e+=r.resources.length;return e}get totalTemplateCount(){let e=0;for(const r of this._serverResources.values())e+=r.templates.length;return e}get attachmentCount(){return this._attachments.length}get hasAttachments(){return this._attachments.length>0}setServerResources(e,r,n){this._serverResources.set(e,{serverName:e,resources:r,templates:n,lastFetched:new Date,loading:!1,error:void 0}),console.log(`[MCPResources][${e}] Set ${r.length} resources, ${n.length} templates`)}setServerLoading(e,r){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:r}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:r,error:void 0})}setServerError(e,r){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:!1,error:r}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:!1,error:r})}getServerResources(e){return this._serverResources.get(e)}getAllResourceInfos(){const e=[];for(const[r,n]of this._serverResources)for(const a of n.resources)e.push({uri:a.uri,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:r,annotations:a.annotations,icons:a.icons});return e}getAllTemplateInfos(){const e=[];for(const[r,n]of this._serverResources)for(const a of n.templates)e.push({uriTemplate:a.uriTemplate,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:r,annotations:a.annotations,icons:a.icons});return e}clearServerResources(e){this._serverResources.delete(e);for(const[r,n]of this._cachedResources)n.resource.serverName===e&&this._cachedResources.delete(r);for(const[r,n]of this._subscriptions)n.serverName===e&&this._subscriptions.delete(r);console.log(`[MCPResources][${e}] Cleared all resources`)}cacheReso
Line truncated
|
||||
`&&n++}}return[e,r]}class W1e extends TransformStream{constructor({onError:e,onRetry:r,onComment:n}={}){let a;super({start(i){a=rz({onEvent:s=>{i.enqueue(s)},onError(s){e==="terminate"?i.error(s):typeof e=="function"&&e(s)},onRetry:r,onComment:n})},transform(i){a.feed(i)}})}}const K1e={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Fd extends Error{constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}}class j1e{constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Zq(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??K1e}async _authThenStart(){if(!this._authProvider)throw new el("No auth provider");let e;try{e=await Yd(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new el;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const r=Rb(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){const{resumptionToken:r}=e;try{const n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Fd(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),a)}_scheduleReconnection(e,r=0){const n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}const a=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(e,r+1)})},a)}_handleSseStream(e,r,n){if(!e)return;const{onresumptiontoken:a,replayMessageId:i}=r;let s,o=!1,l=!1;(async()=>{try{const u=e.pipeThrough(new TextDecoderStream).pipeThrough(new W1e({onRetry:m=>{this._serverRetryMs=m}})).getReader();for(;;){const{value:m,done:f}=await u.read();if(f)break;if(m.id&&(s=m.id,o=!0,a?.(m.id)),!!m.data&&(!m.event||m.event==="message"))try{const g=lf.parse(JSON.parse(m.data));jm(g)&&(l=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(u){if(this.onerror?.(new Error(`SSE stream disconnected: ${u}`)),(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(m){this.onerror?.(new Error(`Failed to reconnect: ${m instanceof Error?m.message:String(m)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new el("No auth provider");if(await Yd(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new el("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{const{resumptionToken:n,onresumptiontoken:a}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:NR(e)?e.id:void 0}).catch(h=>this.onerror?.(h));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,s),l=o.headers.get("mcp-session-id");if(l&&(this._sessionId=l),!o.ok){const h=await o.t
Line truncated
|
||||
`):""}static formatSingleContent(e){if(e.type===y1.TEXT&&e.text)return e.text;if(e.type===y1.IMAGE&&e.data)return gb(e.mimeType??Pne,e.data);if(e.type===y1.RESOURCE&&e.resource){const r=e.resource;return r.text?r.text:r.blob?r.blob:JSON.stringify(r)}return e.data&&e.mimeType?gb(e.mimeType,e.data):JSON.stringify(e)}static async complete(e,r,n){try{return(await e.client.complete({ref:r,argument:n})).completion}catch(a){return console.error("[MCPService] Failed to get completions:",a),null}}static async listResources(e,r){try{const n=await e.client.listResources(r?{cursor:r}:void 0);return{resources:n.resources??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resources:`,n),{resources:[]}}}static async listAllResources(e){const r=[];let n;do{const a=await this.listResources(e,n);r.push(...a.resources),n=a.nextCursor}while(n);return r}static async listResourceTemplates(e,r){try{const n=await e.client.listResourceTemplates(r?{cursor:r}:void 0);return{resourceTemplates:n.resourceTemplates??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resource templates:`,n),{resourceTemplates:[]}}}static async listAllResourceTemplates(e){const r=[];let n;do{const a=await this.listResourceTemplates(e,n);r.push(...a.resourceTemplates),n=a.nextCursor}while(n);return r}static async readResource(e,r){try{const n=await e.client.readResource({uri:r});return{contents:n.contents??[],_meta:n._meta}}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to read resource:`,n),n}}static async subscribeResource(e,r){try{await e.client.subscribeResource({uri:r}),console.log(`[MCPService][${e.serverName}] Subscribed to resource: ${r}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to subscribe to resource:`,n),n}}static async unsubscribeResource(e,r){try{await e.client.unsubscribeResource({uri:r}),console.log(`[MCPService][${e.serverName}] Unsubscribed from resource: ${r}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to unsubscribe from resource:`,n),n}}static supportsResources(e){return e.serverCapabilities?.resources!==void 0}static supportsResourceSubscriptions(e){return!!e.serverCapabilities?.resources?.subscribe}}function rbe(){return`${Jne}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}class nbe{#e=_e(Tr(new xi));get _serverResources(){return p(this.#e)}set _serverResources(e){k(this.#e,e,!0)}#t=_e(Tr(new xi));get _cachedResources(){return p(this.#t)}set _cachedResources(e){k(this.#t,e,!0)}#r=_e(Tr(new xi));get _subscriptions(){return p(this.#r)}set _subscriptions(e){k(this.#r,e,!0)}#n=_e(Tr([]));get _attachments(){return p(this.#n)}set _attachments(e){k(this.#n,e,!0)}#i=_e(!1);get _isLoading(){return p(this.#i)}set _isLoading(e){k(this.#i,e,!0)}get serverResources(){return this._serverResources}get cachedResources(){return this._cachedResources}get subscriptions(){return this._subscriptions}get attachments(){return this._attachments}get isLoading(){return this._isLoading}get totalResourceCount(){let e=0;for(const r of this._serverResources.values())e+=r.resources.length;return e}get totalTemplateCount(){let e=0;for(const r of this._serverResources.values())e+=r.templates.length;return e}get attachmentCount(){return this._attachments.length}get hasAttachments(){return this._attachments.length>0}setServerResources(e,r,n){this._serverResources.set(e,{serverName:e,resources:r,templates:n,lastFetched:new Date,loading:!1,error:void 0}),console.log(`[MCPResources][${e}] Set ${r.length} resources, ${n.length} templates`)}setServerLoading(e,r){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:r}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:r,error:void 0})}setServerError(e,r){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:!1,error:r}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:!1,error:r})}getServerResources(e){return this._serverResources.get(e)}getAllResourceInfos(){const e=[];for(const[r,n]of this._serverResources)for(const a of n.resources)e.push({uri:a.uri,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:r,annotations:a.annotations,icons:a.icons});return e}getAllTemplateInfos(){const e=[];for(const[r,n]of this._serverResources)for(const a of n.templates)e.push({uriTemplate:a.uriTemplate,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:r,annotations:a.annotations,icons:a.icons});return e}clearServerResources(e){this._serverResources.delete(e);for(const[r,n]of this._cachedResources)n.resource.serverName===e&&this._cachedResources.delete(r);for(const[r,n]of this._subscriptions)n.serverName===e&&this._subscriptions.delete(r);console.log(`[MCPResources][${e}] Cleared all resources`)}cacheReso
Line truncated
|
||||
|
||||
--- Resource: ${n} (from ${a}) ---
|
||||
${i.text}`):"blob"in i&&i.blob&&e.push(`
|
||||
|
||||
--- Resource: ${n} (from ${a}) ---
|
||||
[${v5}: ${i.mimeType||E5}]`)}return e.join("")}toMessageExtras(){const e=[];for(const r of this._attachments){if(r.error||!r.content||r.content.length===0)continue;const n=r.resource.title||r.resource.name,a=[];for(const i of r.content)"text"in i&&i.text?a.push(i.text):"blob"in i&&i.blob&&a.push(`[${v5}: ${i.mimeType||E5}]`);a.length>0&&e.push({type:Qr.MCP_RESOURCE,name:n,uri:r.resource.uri,serverName:r.resource.serverName,content:a.join(ub),mimeType:r.resource.mimeType})}return e}}const bn=new nbe,az=()=>bn.serverResources,abe=()=>bn.attachments,iz=()=>bn.hasAttachments,ibe=()=>bn.totalResourceCount,sbe=()=>bn.isLoading,sz=typeof window<"u"?window:void 0;function obe(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(r===e)break;e=r}return e}let lbe=class{#e;#t;constructor(e={}){const{window:r=sz,document:n=r?.document}=e;r!==void 0&&(this.#e=n,this.#t=Ju(a=>{const i=Kr(r,"focusin",a),s=Kr(r,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?obe(this.#e):null}};new lbe;function cbe(t,e){switch(t){case"post":It(e);break;case"pre":$i(e);break}}function oz(t,e,r,n={}){const{lazy:a=!1}=n;let i=!a,s=Array.isArray(t)?[]:void 0;cbe(e,()=>{const o=Array.isArray(t)?t.map(c=>c()):t();if(!i){i=!0,s=o;return}const l=Nn(()=>r(o,s));return s=o,l})}function fx(t,e,r){oz(t,"post",e,r)}function ube(t,e,r){oz(t,"pre",e,r)}fx.pre=ube;function dbe(t,e){switch(t){case"local":return e.localStorage;case"session":return e.sessionStorage}}class lz{#e;#t;#r;#n;#i;#a=_e(0);constructor(e,r,n={}){const{storage:a="local",serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:s=!0,window:o=sz}=n;if(this.#e=r,this.#t=e,this.#r=i,o===void 0)return;const l=dbe(a,o);this.#n=l;const c=l.getItem(e);c!==null?this.#e=this.#o(c):this.#l(r),s&&a==="local"&&(this.#i=Ju(()=>Kr(o,"storage",this.#s)))}get current(){this.#i?.(),p(this.#a);const e=this.#o(this.#n?.getItem(this.#t))??this.#e,r=new WeakMap,n=a=>{if(a===null||a?.constructor.name==="Date"||typeof a!="object")return a;let i=r.get(a);return i||(i=new Proxy(a,{get:(s,o)=>(p(this.#a),n(Reflect.get(s,o))),set:(s,o,l)=>(k(this.#a,p(this.#a)+1),Reflect.set(s,o,l),this.#l(e),!0)}),r.set(a,i)),i};return n(e)}set current(e){this.#l(e),k(this.#a,p(this.#a)+1)}#s=e=>{e.key!==this.#t||e.newValue===null||(this.#e=this.#o(e.newValue),k(this.#a,p(this.#a)+1))};#o(e){try{return this.#r.deserialize(e)}catch(r){console.error(`Error when parsing "${e}" from persisted store "${this.#t}"`,r);return}}#l(e){try{e!=null&&this.#n?.setItem(this.#t,this.#r.serialize(e))}catch(r){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,r)}}}function S7(t){return t.filter(e=>e.length>0)}const cz={getItem:t=>null,setItem:(t,e)=>{}},Tg=typeof document<"u";function hbe(t){return typeof t=="function"}function pbe(t){return t!==null&&typeof t=="object"}const Lf=Symbol("box"),gx=Symbol("is-writable");function mbe(t){return pbe(t)&&Lf in t}function fbe(t){return Ja.isBox(t)&&gx in t}function Ja(t){let e=_e(Tr(t));return{[Lf]:!0,[gx]:!0,get current(){return p(e)},set current(r){k(e,r,!0)}}}function gbe(t,e){const r=F(t);return e?{[Lf]:!0,[gx]:!0,get current(){return p(r)},set current(n){e(n)}}:{[Lf]:!0,get current(){return t()}}}function _be(t){return Ja.isBox(t)?t:hbe(t)?Ja.with(t):Ja(t)}function bbe(t){return Object.entries(t).reduce((e,[r,n])=>Ja.isBox(n)?(Ja.isWritableBox(n)?Object.defineProperty(e,r,{get(){return n.current},set(a){n.current=a}}):Object.defineProperty(e,r,{get(){return n.current}}),e):Object.assign(e,{[r]:n}),{})}function Sbe(t){return Ja.isWritableBox(t)?{[Lf]:!0,get current(){return t.current}}:t}Ja.from=_be;Ja.with=gbe;Ja.flatten=bbe;Ja.readonly=Sbe;Ja.isBox=mbe;Ja.isWritableBox=fbe;function Ebe(t,e){const r=RegExp(t,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,e):n}}const vbe=Ebe(/[A-Z]/,t=>`-${t.toLowerCase()}`);function ybe(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${vbe(e)}: ${t[e]};`).join(`
|
||||
[${v5}: ${i.mimeType||E5}]`)}return e.join("")}toMessageExtras(){const e=[];for(const r of this._attachments){if(r.error||!r.content||r.content.length===0)continue;const n=r.resource.title||r.resource.name,a=[];for(const i of r.content)"text"in i&&i.text?a.push(i.text):"blob"in i&&i.blob&&a.push(`[${v5}: ${i.mimeType||E5}]`);a.length>0&&e.push({type:Qr.MCP_RESOURCE,name:n,uri:r.resource.uri,serverName:r.resource.serverName,content:a.join(ub),mimeType:r.resource.mimeType})}return e}}const Sn=new nbe,az=()=>Sn.serverResources,abe=()=>Sn.attachments,iz=()=>Sn.hasAttachments,ibe=()=>Sn.totalResourceCount,sbe=()=>Sn.isLoading,sz=typeof window<"u"?window:void 0;function obe(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(r===e)break;e=r}return e}let lbe=class{#e;#t;constructor(e={}){const{window:r=sz,document:n=r?.document}=e;r!==void 0&&(this.#e=n,this.#t=Ju(a=>{const i=Kr(r,"focusin",a),s=Kr(r,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?obe(this.#e):null}};new lbe;function cbe(t,e){switch(t){case"post":It(e);break;case"pre":Yi(e);break}}function oz(t,e,r,n={}){const{lazy:a=!1}=n;let i=!a,s=Array.isArray(t)?[]:void 0;cbe(e,()=>{const o=Array.isArray(t)?t.map(c=>c()):t();if(!i){i=!0,s=o;return}const l=Nn(()=>r(o,s));return s=o,l})}function fx(t,e,r){oz(t,"post",e,r)}function ube(t,e,r){oz(t,"pre",e,r)}fx.pre=ube;function dbe(t,e){switch(t){case"local":return e.localStorage;case"session":return e.sessionStorage}}class lz{#e;#t;#r;#n;#i;#a=_e(0);constructor(e,r,n={}){const{storage:a="local",serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:s=!0,window:o=sz}=n;if(this.#e=r,this.#t=e,this.#r=i,o===void 0)return;const l=dbe(a,o);this.#n=l;const c=l.getItem(e);c!==null?this.#e=this.#o(c):this.#l(r),s&&a==="local"&&(this.#i=Ju(()=>Kr(o,"storage",this.#s)))}get current(){this.#i?.(),p(this.#a);const e=this.#o(this.#n?.getItem(this.#t))??this.#e,r=new WeakMap,n=a=>{if(a===null||a?.constructor.name==="Date"||typeof a!="object")return a;let i=r.get(a);return i||(i=new Proxy(a,{get:(s,o)=>(p(this.#a),n(Reflect.get(s,o))),set:(s,o,l)=>(k(this.#a,p(this.#a)+1),Reflect.set(s,o,l),this.#l(e),!0)}),r.set(a,i)),i};return n(e)}set current(e){this.#l(e),k(this.#a,p(this.#a)+1)}#s=e=>{e.key!==this.#t||e.newValue===null||(this.#e=this.#o(e.newValue),k(this.#a,p(this.#a)+1))};#o(e){try{return this.#r.deserialize(e)}catch(r){console.error(`Error when parsing "${e}" from persisted store "${this.#t}"`,r);return}}#l(e){try{e!=null&&this.#n?.setItem(this.#t,this.#r.serialize(e))}catch(r){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,r)}}}function S7(t){return t.filter(e=>e.length>0)}const cz={getItem:t=>null,setItem:(t,e)=>{}},Tg=typeof document<"u";function hbe(t){return typeof t=="function"}function pbe(t){return t!==null&&typeof t=="object"}const Lf=Symbol("box"),gx=Symbol("is-writable");function mbe(t){return pbe(t)&&Lf in t}function fbe(t){return Ja.isBox(t)&&gx in t}function Ja(t){let e=_e(Tr(t));return{[Lf]:!0,[gx]:!0,get current(){return p(e)},set current(r){k(e,r,!0)}}}function gbe(t,e){const r=F(t);return e?{[Lf]:!0,[gx]:!0,get current(){return p(r)},set current(n){e(n)}}:{[Lf]:!0,get current(){return t()}}}function _be(t){return Ja.isBox(t)?t:hbe(t)?Ja.with(t):Ja(t)}function bbe(t){return Object.entries(t).reduce((e,[r,n])=>Ja.isBox(n)?(Ja.isWritableBox(n)?Object.defineProperty(e,r,{get(){return n.current},set(a){n.current=a}}):Object.defineProperty(e,r,{get(){return n.current}}),e):Object.assign(e,{[r]:n}),{})}function Sbe(t){return Ja.isWritableBox(t)?{[Lf]:!0,get current(){return t.current}}:t}Ja.from=_be;Ja.with=gbe;Ja.flatten=bbe;Ja.readonly=Sbe;Ja.isBox=mbe;Ja.isWritableBox=fbe;function Ebe(t,e){const r=RegExp(t,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,e):n}}const vbe=Ebe(/[A-Z]/,t=>`-${t.toLowerCase()}`);function ybe(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${vbe(e)}: ${t[e]};`).join(`
|
||||
`)}function Tbe(t={}){return ybe(t).replace(`
|
||||
`," ")}const Cbe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};Tbe(Cbe);const wbe=typeof window<"u"?window:void 0;function Abe(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(r===e)break;e=r}return e}class Rbe{#e;#t;constructor(e={}){const{window:r=wbe,document:n=r?.document}=e;r!==void 0&&(this.#e=n,this.#t=Ju(a=>{const i=Kr(r,"focusin",a),s=Kr(r,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?Abe(this.#e):null}}new Rbe;const Vd=Ja("mode-watcher-mode"),Wd=Ja("mode-watcher-theme"),Obe=["dark","light","system"];function jR(t){return typeof t!="string"?!1:Obe.includes(t)}class Nbe{#e="system";#t=Tg?localStorage:cz;#r=this.#t.getItem(Vd.current);#n=jR(this.#r)?this.#r:this.#e;#i=_e(Tr(this.#a()));#a(e=this.#n){return new lz(Vd.current,e,{serializer:{serialize:r=>r,deserialize:r=>jR(r)?r:this.#e}})}constructor(){Xf(()=>fx.pre(()=>Vd.current,(e,r)=>{const n=p(this.#i).current;k(this.#i,this.#a(n),!0),r&&localStorage.removeItem(r)}))}get current(){return p(this.#i).current}set current(e){p(this.#i).current=e}}class Ibe{#e=void 0;#t=!0;#r=_e(Tr(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new FB("prefers-color-scheme: light"):{current:!1};query(){Tg&&k(this.#r,this.#n.current?"light":"dark",!0)}tracking(e){this.#t=e}constructor(){Xf(()=>{$i(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return p(this.#r)}}const QR=new Nbe,XR=new Ibe;class xbe{#e=Tg?localStorage:cz;#t=this.#e.getItem(Wd.current);#r=this.#t===null||this.#t===void 0?"":this.#t;#n=_e(Tr(this.#i()));#i(e=this.#r){return new lz(Wd.current,e,{serializer:{serialize:r=>typeof r!="string"?"":r,deserialize:r=>r}})}constructor(){Xf(()=>fx.pre(()=>Wd.current,(e,r)=>{const n=p(this.#n).current;k(this.#n,this.#i(n),!0),r&&localStorage.removeItem(r)}))}get current(){return p(this.#n).current}set current(e){p(this.#n).current=e}}const O1=new xbe;let E7,v7,y7=!1,Dm=null;function Dbe(){return Dm||(Dm=document.createElement("style"),Dm.appendChild(document.createTextNode(`* {
|
||||
`," ")}const Cbe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};Tbe(Cbe);const wbe=typeof window<"u"?window:void 0;function Abe(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(r===e)break;e=r}return e}class Rbe{#e;#t;constructor(e={}){const{window:r=wbe,document:n=r?.document}=e;r!==void 0&&(this.#e=n,this.#t=Ju(a=>{const i=Kr(r,"focusin",a),s=Kr(r,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?Abe(this.#e):null}}new Rbe;const Vd=Ja("mode-watcher-mode"),Wd=Ja("mode-watcher-theme"),Obe=["dark","light","system"];function QR(t){return typeof t!="string"?!1:Obe.includes(t)}class Nbe{#e="system";#t=Tg?localStorage:cz;#r=this.#t.getItem(Vd.current);#n=QR(this.#r)?this.#r:this.#e;#i=_e(Tr(this.#a()));#a(e=this.#n){return new lz(Vd.current,e,{serializer:{serialize:r=>r,deserialize:r=>QR(r)?r:this.#e}})}constructor(){Xf(()=>fx.pre(()=>Vd.current,(e,r)=>{const n=p(this.#i).current;k(this.#i,this.#a(n),!0),r&&localStorage.removeItem(r)}))}get current(){return p(this.#i).current}set current(e){p(this.#i).current=e}}class Ibe{#e=void 0;#t=!0;#r=_e(Tr(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new FB("prefers-color-scheme: light"):{current:!1};query(){Tg&&k(this.#r,this.#n.current?"light":"dark",!0)}tracking(e){this.#t=e}constructor(){Xf(()=>{Yi(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return p(this.#r)}}const XR=new Nbe,ZR=new Ibe;class xbe{#e=Tg?localStorage:cz;#t=this.#e.getItem(Wd.current);#r=this.#t===null||this.#t===void 0?"":this.#t;#n=_e(Tr(this.#i()));#i(e=this.#r){return new lz(Wd.current,e,{serializer:{serialize:r=>typeof r!="string"?"":r,deserialize:r=>r}})}constructor(){Xf(()=>fx.pre(()=>Wd.current,(e,r)=>{const n=p(this.#n).current;k(this.#n,this.#i(n),!0),r&&localStorage.removeItem(r)}))}get current(){return p(this.#n).current}set current(e){p(this.#n).current=e}}const O1=new xbe;let E7,v7,y7=!1,Dm=null;function Dbe(){return Dm||(Dm=document.createElement("style"),Dm.appendChild(document.createTextNode(`* {
|
||||
-webkit-transition: none !important;
|
||||
-moz-transition: none !important;
|
||||
-o-transition: none !important;
|
||||
-ms-transition: none !important;
|
||||
transition: none !important;
|
||||
}`)),Dm)}function uz(t,e=!1){if(typeof document>"u")return;if(!y7){y7=!0,t();return}if(typeof window<"u"&&window.__vitest_worker__){t();return}clearTimeout(E7),clearTimeout(v7);const n=Dbe(),a=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function s(){t(),window.requestAnimationFrame(i)}if(typeof window.requestAnimationFrame<"u"){a(),e?s():window.requestAnimationFrame(()=>{s()});return}a(),E7=window.setTimeout(()=>{t(),v7=window.setTimeout(i,16)},16)}const Nu=Ja(void 0),Mb=Ja(!0),kb=Ja(!1),ZR=Ja([]),JR=Ja([]);function Mbe(){const t=F(()=>{if(!Tg)return;const e=QR.current==="system"?XR.current:QR.current,r=S7(ZR.current),n=S7(JR.current);function a(){const i=document.documentElement,s=document.querySelector('meta[name="theme-color"]');e==="light"?(r.length&&i.classList.remove(...r),n.length&&i.classList.add(...n),i.style.colorScheme="light",s&&Nu.current&&s.setAttribute("content",Nu.current.light)):(n.length&&i.classList.remove(...n),r.length&&i.classList.add(...r),i.style.colorScheme="dark",s&&Nu.current&&s.setAttribute("content",Nu.current.dark))}return Mb.current?uz(a,kb.current):a(),e});return{get current(){return p(t)}}}function kbe(){const t=F(()=>{if(O1.current,!Tg)return;function e(){document.documentElement.setAttribute("data-theme",O1.current)}return Mb.current?uz(e,Nn(()=>kb.current)):e(),O1.current});return{get current(){return p(t)}}}const cE=Mbe(),Pbe=kbe();function e2(t){QR.current=t}function Lbe(t){O1.current=t}function Fbe({defaultMode:t="system",themeColors:e,darkClassNames:r=["dark"],lightClassNames:n=[],defaultTheme:a="",modeStorageKey:i="mode-watcher-mode",themeStorageKey:s="mode-watcher-theme"}){const o=document.documentElement,l=localStorage.getItem(i)??t,c=localStorage.getItem(s)??a,u=l==="light"||l==="system"&&window.matchMedia("(prefers-color-scheme: light)").matches;if(u?(r.length&&o.classList.remove(...r.filter(Boolean)),n.length&&o.classList.add(...n.filter(Boolean))):(n.length&&o.classList.remove(...n.filter(Boolean)),r.length&&o.classList.add(...r.filter(Boolean))),o.style.colorScheme=u?"light":"dark",e){const d=document.querySelector('meta[name="theme-color"]');d&&d.setAttribute("content",l==="light"?e.light:e.dark)}c&&(o.setAttribute("data-theme",c),localStorage.setItem(s,c)),localStorage.setItem(i,l)}var Bbe=q('<meta name="theme-color"/>');function Ube(t,e){ye(e,!0);var r=se(),n=L(r);{var a=i=>{var s=Bbe();we(()=>rr(s,"content",e.themeColors.dark)),C(i,s)};le(n,i=>{e.themeColors&&i(a)})}C(t,r),Te()}var Gbe=q('<meta name="theme-color"/>'),qbe=q("<!> <!>",1);function zbe(t,e){ye(e,!0);let r=V(e,"trueNonce",3,"");dS("1funsus",n=>{var a=qbe(),i=L(a);{var s=l=>{var c=Gbe();we(()=>rr(c,"content",e.themeColors.dark)),C(l,c)};le(i,l=>{e.themeColors&&l(s)})}var o=te(i,2);op(o,()=>`<script${r()?` nonce=${r()}`:""}>(`+Fbe.toString()+")("+JSON.stringify(e.initConfig)+");<\/script>"),C(n,a)}),Te()}function $be(t,e){ye(e,!0);let r=V(e,"track",3,!0),n=V(e,"defaultMode",3,"system"),a=V(e,"disableTransitions",3,!0),i=V(e,"darkClassNames",19,()=>["dark"]),s=V(e,"lightClassNames",19,()=>[]),o=V(e,"defaultTheme",3,""),l=V(e,"nonce",3,""),c=V(e,"themeStorageKey",3,"mode-watcher-theme"),u=V(e,"modeStorageKey",3,"mode-watcher-mode"),d=V(e,"disableHeadScriptInjection",3,!1),h=V(e,"synchronousModeChanges",3,!1);Vd.current=u(),Wd.current=c(),ZR.current=i(),JR.current=s(),Mb.current=a(),Nu.current=e.themeColors,kb.current=h(),$i(()=>{kb.current=h()}),$i(()=>{Mb.current=a()}),$i(()=>{Nu.current=e.themeColors}),$i(()=>{ZR.current=i()}),$i(()=>{JR.current=s()}),$i(()=>{Vd.current=u()}),$i(()=>{Wd.current=c()}),$i(()=>{cE.current,Vd.current,Wd.current,Pbe.current}),vi(()=>{XR.tracking(r()),XR.query();const E=localStorage.getItem(Vd.current);e2(jR(E)?E:n());const y=localStorage.getItem(Wd.current);Lbe(y||o())});const m={defaultMode:n(),themeColors:e.themeColors,darkClassNames:i(),lightClassNames:s(),defaultTheme:o(),modeStorageKey:u(),themeStorageKey:c()},f=F(()=>typeof window>"u"?l():"");var g=se(),b=L(g);{var _=E=>{Ube(E,{get themeColors(){return Nu.current}})},S=E=>{zbe(E,{get trueNonce(){return p(f)},get initConfig(){return m},get themeColors(){return Nu.current}})};le(b,E=>{d()?E(_):E(S,!1)})}C(t,g),Te()}class Hbe{#e=_e(!1);get _isInitializing(){return p(this.#e)}set _isInitializing(e){k(this.#e,e,!0)}#t=_e(null);get _error(){return p(this.#t)}set _error(e){k(this.#t,e,!0)}#r=_e(0);get _toolCount(){return p(this.#r)}set _toolCount(e){k(this.#r,e,!0)}#n=_e(Tr([]));get _connectedServers(){return p(this.#n)}set _connectedServers(e){k(this.#n,e,!0)}#i=_e(Tr({}));get _healthChecks(){return p(this.#i)}set _healthChecks(e){k(this.#i,e,!0)}#a=_e(!1);get _proxyAvailable(){return p(this.#a)}set _proxyAvailable(e){k(this.#a,e,!0)}connections=new Map;toolsIndex=new Map;serverConfigs=new Map;reconnectingServers=new Set;configSignature=null;initPromise=null;activeFlowCount=0;constructor(){this.probeProxy()}async probeProxy(){try{const e=await fetch(`${qa}${WU}`,{method:"HEAD"
Line truncated
|
||||
`);return e.join("")}}function Zm(t,e){const r=e?URL.parse(t,e):URL.parse(t);return r?.protocol==="http:"||r?.protocol==="https:"}function Fo(t){t.preventDefault()}function Qa(t){t.preventDefault(),t.stopPropagation()}function SSe(t){console.log("Deprecated API usage: "+t)}class o2{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const r=this.#e.exec(e);if(!r)return null;const n=parseInt(r[1],10);let a=parseInt(r[2],10);a=a>=1&&a<=12?a-1:0;let i=parseInt(r[3],10);i=i>=1&&i<=31?i:1;let s=parseInt(r[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(r[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(r[6],10);l=l>=0&&l<=59?l:0;const c=r[7]||"Z";let u=parseInt(r[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(r[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(s+=u,o+=d):c==="+"&&(s-=u,o-=d),new Date(Date.UTC(n,a,i,s,o,l))}}function ESe(t,{scale:e=1,rotation:r=0}){const{width:n,height:a}=t.attributes.style,i=[0,0,parseInt(n),parseInt(a)];return new Ag({viewBox:i,userUnit:1,scale:e,rotation:r})}function mE(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(en(`Not a valid color format: "${t}"`),[0,0,0])}function vSe(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const r of t.keys()){e.style.color=r;const n=window.getComputedStyle(e).color;t.set(r,mE(n))}e.remove()}function wa(t){const{a:e,b:r,c:n,d:a,e:i,f:s}=t.getTransform();return[e,r,n,a,i,s]}function yl(t){const{a:e,b:r,c:n,d:a,e:i,f:s}=t.getTransform().invertSelf();return[e,r,n,a,i,s]}function ih(t,e,r=!1,n=!0){if(e instanceof Ag){const{pageWidth:a,pageHeight:i}=e.rawDims,{style:s}=t,o=ki.isCSSRoundSupported,l=`var(--total-scale-factor) * ${a}px`,c=`var(--total-scale-factor) * ${i}px`,u=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,d=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!r||e.rotation%180===0?(s.width=u,s.height=d):(s.width=d,s.height=u)}n&&t.setAttribute("data-main-rotation",e.rotation)}class Wl{constructor(){const{pixelRatio:e}=Wl;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,r,n,a,i=-1){let s=1/0,o=1/0,l=1/0;n=Wl.capPixels(n,i),n>0&&(s=Math.sqrt(n/(e*r))),a!==-1&&(o=a/e,l=a/r);const c=Math.min(s,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,r){if(r>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+r/100));return e>0?Math.min(e,n):n}return e}}const l2=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class df{#e=null;#t=null;#r;#n=null;#i=null;#a=null;#s=null;static#o=null;constructor(e){this.#r=e,df.#o||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const r=this.#r._uiManager._signal;e.addEventListener("contextmenu",Fo,{signal:r}),e.addEventListener("pointerdown",df.#l,{signal:r});const n=this.#n=document.createElement("div");n.className="buttons",e.append(n);const a=this.#r.toolbarPosition;if(a){const{style:i}=e,s=this.#r._uiManager.direction==="ltr"?1-a[0]:a[0];i.insetInlineEnd=`${100*s}%`,i.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#l(e){e.stopPropagation()}#c(e){this.#r._focusEventsAllowed=!1,Qa(e)}#d(e){this.#r._focusEventsAllowed=!0,Qa(e)}#u(e){const r=this.#r._uiManager._signal;e.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:r}),e.addEventListener("focusout",this.#d.bind(this),{capture:!0,signal:r}),e.addEventListener("contextmenu",Fo,{signal:r})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){const{editorType:e,_uiManager:r}=this.#r,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",df.#o[e]),this.#u(n),n.addEventListener("click",a=>{r.delete()},{signal:r._signal}),this.#n.append(n)}get#m(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const r=await e.render();this.#u(r),this.#n.append(r,this.#m),this.#i=e}addComment(e){if(this.#a)return;const r=e.render();r&&(this.#u(r),this.#n.prepend(r,this.#m),this.#a=e,e.toolbar=this)}addColorPicker(
Line truncated
|
||||
`)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",o??i),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),sh.add(n),n.setAttribute("data-element-id",r),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;const{datetimeFormat:c,datetimeType:u,timeStep:d}=this.data,h=!!u&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",f=>{e.setValue(r,{value:f.target.value}),this.setPropertyOnSiblings(n,"value",f.target.value,"value"),l.formattedValue=null}),n.addEventListener("resetform",f=>{const g=this.data.defaultFieldValue??"";n.value=l.userValue=g,l.formattedValue=null});let m=f=>{const{formattedValue:g}=l;g!=null&&(f.target.value=g),f.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",g=>{if(l.focused)return;const{target:b}=g;if(h&&(b.type=u,d&&(b.step=d)),l.userValue){const _=l.userValue;if(h)if(u==="time"){const S=new Date(_),E=[S.getHours(),S.getMinutes(),S.getSeconds()];b.value=E.map(y=>y.toString().padStart(2,"0")).join(":")}else b.value=new Date(_-OEe).toISOString().split(u==="date"?"T":".",1)[0];else b.value=_}l.lastCommittedValue=b.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),n.addEventListener("updatefromsandbox",g=>{this.showElementAndHideCanvas(g.target);const b={value(_){l.userValue=_.detail.value??"",h||e.setValue(r,{value:l.userValue.toString()}),_.target.value=l.userValue},formattedValue(_){const{formattedValue:S}=_.detail;l.formattedValue=S,S!=null&&_.target!==document.activeElement&&(_.target.value=S);const E={formattedValue:S};h&&(E.value=S),e.setValue(r,E)},selRange(_){_.target.setSelectionRange(..._.detail.selRange)},charLimit:_=>{const{charLimit:S}=_.detail,{target:E}=_;if(S===0){E.removeAttribute("maxLength");return}E.setAttribute("maxLength",S);let y=l.userValue;!y||y.length<=S||(y=y.slice(0,S),E.value=l.userValue=y,e.setValue(r,{value:y}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:y,willCommit:!0,commitKey:1,selStart:E.selectionStart,selEnd:E.selectionEnd}}))}};this._dispatchEventFromSandbox(b,g)}),n.addEventListener("keydown",g=>{l.commitKey=1;let b=-1;if(g.key==="Escape"?b=0:g.key==="Enter"&&!this.data.multiLine?b=2:g.key==="Tab"&&(l.commitKey=3),b===-1)return;const{value:_}=g.target;l.lastCommittedValue!==_&&(l.lastCommittedValue=_,l.userValue=_,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:_,willCommit:!0,commitKey:b,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}))});const f=m;m=null,n.addEventListener("blur",g=>{if(!l.focused||!g.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:b}=g;let{value:_}=b;if(h){if(_&&u==="time"){const S=_.split(":").map(E=>parseInt(E,10));_=new Date(2e3,0,1,S[0],S[1],S[2]||0).valueOf(),b.step=""}else _=new Date(_).valueOf();b.type="text"}l.userValue=_,l.lastCommittedValue!==_&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:_,willCommit:!0,commitKey:l.commitKey,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}),f(g)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",g=>{l.lastCommittedValue=null;const{data:b,target:_}=g,{value:S,selectionStart:E,selectionEnd:y}=_;let v=E,T=y;switch(g.inputType){case"deleteWordBackward":{const w=S.substring(0,E).match(/\w*[^\w]*$/);w&&(v-=w[0].length);break}case"deleteWordForward":{const w=S.substring(E).match(/^[^\w]*\w*/);w&&(T+=w[0].length);break}case"deleteContentBackward":E===y&&(v-=1);break;case"deleteContentForward":E===y&&(T+=1);break}g.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:S,change:b||"",willCommit:!1,selStart:v,selEnd:T}})}),this._setEventListeners(n,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],g=>g.target.value)}if(m&&n.addEventListener("blur",m),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${g}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class xEe extends _h{constructor(e){super(e,{isRenderable:!!e.data.has
Line truncated
|
||||
`))r.push({name:"span",value:i,attributes:a});return n}_formatContents({str:e,dir:r}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=r;const a=e.split(/(?:\r\n?|\n)/);for(let i=0,s=a.length;i<s;++i){const o=a[i];n.append(document.createTextNode(o)),i<s-1&&n.append(document.createElement("br"))}return n}#I(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#u)&&this.#O()}updateEdited({rect:e,popup:r,deleted:n}){if(n||r?.deleted){this.remove();return}this.#v(),this.#_||={contentsObj:this.#s,richText:this.#g},e&&(this.#p=null),r&&(this.#g=this.#w(r.text),this.#o=o2.toDateObject(r.date),this.#s=null),this.#m?.remove(),this.#m=null}resetEdited(){this.#_&&({contentsObj:this.#s,richText:this.#g}=this.#_,this.#_=null,this.#m?.remove(),this.#m=null,this.#p=null)}remove(){this.#f?.abort(),this.#f=null,this.#m?.remove(),this.#m=null,this.#E=!1,this.#u=!1;for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#N(){if(this.#p!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:r,pageHeight:n,pageX:a,pageY:i}}}=this.#c;let s=!!this.#d,o=s?this.#d:this.#h;for(const f of this.#l)if(!o||kr.intersect(f.data.rect,o)!==null){o=f.data.rect,s=!0;break}const l=kr.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=s?o[2]-o[0]+5:0,d=l[0]+u,h=l[1];this.#p=[100*(d-a)/r,100*(h-i)/n];const{style:m}=this.#a;m.left=`${this.#p[0]}%`,m.top=`${this.#p[1]}%`}#O(){this.#u=!this.#u,this.#u?(this.#R(),this.#a.addEventListener("click",this.#n),this.#a.addEventListener("keydown",this.#e)):(this.#D(),this.#a.removeEventListener("click",this.#n),this.#a.removeEventListener("keydown",this.#e))}#R(){this.#m||this.render(),this.isVisible?this.#u&&this.#a.classList.add("focused"):(this.#N(),this.#a.hidden=!1,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)+1e3)}#D(){this.#a.classList.remove("focused"),!(this.#u||!this.isVisible)&&(this.#a.hidden=!0,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)-1e3)}forceHide(){this.#E=this.isVisible,this.#E&&(this.#a.hidden=!0)}maybeShow(){this.#v(),this.#E&&(this.#m||this.#R(),this.#E=!1,this.#a.hidden=!1)}get isVisible(){return this.#a.hidden===!1}}class Fz extends za{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Jr.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const r of this.textContent){const n=document.createElement("span");n.textContent=r,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class LEe extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:r,height:n}=this,a=this.svgFactory.create(r,n,!0),i=this.#e=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),a.append(i),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class FEe extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:r,height:n}=this,a=this.svgFactory.create(r,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",i/2),s.setAttribute("y",i/2),s.setAttribute("width",r-i),s.setAttribute("height",n-i),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class BEe extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:r,height:n}=this,a=this.svgFactory.create(r,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",r/2),s.setAttribute("cy",n/2),s.setAttribute("rx",r/2-i/2),s.setAttribute("ry",n/2-i/2),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return
Line truncated
|
||||
}`)),Dm)}function uz(t,e=!1){if(typeof document>"u")return;if(!y7){y7=!0,t();return}if(typeof window<"u"&&window.__vitest_worker__){t();return}clearTimeout(E7),clearTimeout(v7);const n=Dbe(),a=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function s(){t(),window.requestAnimationFrame(i)}if(typeof window.requestAnimationFrame<"u"){a(),e?s():window.requestAnimationFrame(()=>{s()});return}a(),E7=window.setTimeout(()=>{t(),v7=window.setTimeout(i,16)},16)}const Nu=Ja(void 0),kb=Ja(!0),Pb=Ja(!1),JR=Ja([]),e2=Ja([]);function Mbe(){const t=F(()=>{if(!Tg)return;const e=XR.current==="system"?ZR.current:XR.current,r=S7(JR.current),n=S7(e2.current);function a(){const i=document.documentElement,s=document.querySelector('meta[name="theme-color"]');e==="light"?(r.length&&i.classList.remove(...r),n.length&&i.classList.add(...n),i.style.colorScheme="light",s&&Nu.current&&s.setAttribute("content",Nu.current.light)):(n.length&&i.classList.remove(...n),r.length&&i.classList.add(...r),i.style.colorScheme="dark",s&&Nu.current&&s.setAttribute("content",Nu.current.dark))}return kb.current?uz(a,Pb.current):a(),e});return{get current(){return p(t)}}}function kbe(){const t=F(()=>{if(O1.current,!Tg)return;function e(){document.documentElement.setAttribute("data-theme",O1.current)}return kb.current?uz(e,Nn(()=>Pb.current)):e(),O1.current});return{get current(){return p(t)}}}const uE=Mbe(),Pbe=kbe();function t2(t){XR.current=t}function Lbe(t){O1.current=t}function Fbe({defaultMode:t="system",themeColors:e,darkClassNames:r=["dark"],lightClassNames:n=[],defaultTheme:a="",modeStorageKey:i="mode-watcher-mode",themeStorageKey:s="mode-watcher-theme"}){const o=document.documentElement,l=localStorage.getItem(i)??t,c=localStorage.getItem(s)??a,u=l==="light"||l==="system"&&window.matchMedia("(prefers-color-scheme: light)").matches;if(u?(r.length&&o.classList.remove(...r.filter(Boolean)),n.length&&o.classList.add(...n.filter(Boolean))):(n.length&&o.classList.remove(...n.filter(Boolean)),r.length&&o.classList.add(...r.filter(Boolean))),o.style.colorScheme=u?"light":"dark",e){const d=document.querySelector('meta[name="theme-color"]');d&&d.setAttribute("content",l==="light"?e.light:e.dark)}c&&(o.setAttribute("data-theme",c),localStorage.setItem(s,c)),localStorage.setItem(i,l)}var Bbe=q('<meta name="theme-color"/>');function Ube(t,e){ye(e,!0);var r=se(),n=L(r);{var a=i=>{var s=Bbe();we(()=>rr(s,"content",e.themeColors.dark)),C(i,s)};le(n,i=>{e.themeColors&&i(a)})}C(t,r),Te()}var Gbe=q('<meta name="theme-color"/>'),qbe=q("<!> <!>",1);function zbe(t,e){ye(e,!0);let r=V(e,"trueNonce",3,"");hS("1funsus",n=>{var a=qbe(),i=L(a);{var s=l=>{var c=Gbe();we(()=>rr(c,"content",e.themeColors.dark)),C(l,c)};le(i,l=>{e.themeColors&&l(s)})}var o=te(i,2);lp(o,()=>`<script${r()?` nonce=${r()}`:""}>(`+Fbe.toString()+")("+JSON.stringify(e.initConfig)+");<\/script>"),C(n,a)}),Te()}function $be(t,e){ye(e,!0);let r=V(e,"track",3,!0),n=V(e,"defaultMode",3,"system"),a=V(e,"disableTransitions",3,!0),i=V(e,"darkClassNames",19,()=>["dark"]),s=V(e,"lightClassNames",19,()=>[]),o=V(e,"defaultTheme",3,""),l=V(e,"nonce",3,""),c=V(e,"themeStorageKey",3,"mode-watcher-theme"),u=V(e,"modeStorageKey",3,"mode-watcher-mode"),d=V(e,"disableHeadScriptInjection",3,!1),h=V(e,"synchronousModeChanges",3,!1);Vd.current=u(),Wd.current=c(),JR.current=i(),e2.current=s(),kb.current=a(),Nu.current=e.themeColors,Pb.current=h(),Yi(()=>{Pb.current=h()}),Yi(()=>{kb.current=a()}),Yi(()=>{Nu.current=e.themeColors}),Yi(()=>{JR.current=i()}),Yi(()=>{e2.current=s()}),Yi(()=>{Vd.current=u()}),Yi(()=>{Wd.current=c()}),Yi(()=>{uE.current,Vd.current,Wd.current,Pbe.current}),yi(()=>{ZR.tracking(r()),ZR.query();const E=localStorage.getItem(Vd.current);t2(QR(E)?E:n());const y=localStorage.getItem(Wd.current);Lbe(y||o())});const m={defaultMode:n(),themeColors:e.themeColors,darkClassNames:i(),lightClassNames:s(),defaultTheme:o(),modeStorageKey:u(),themeStorageKey:c()},f=F(()=>typeof window>"u"?l():"");var g=se(),b=L(g);{var _=E=>{Ube(E,{get themeColors(){return Nu.current}})},S=E=>{zbe(E,{get trueNonce(){return p(f)},get initConfig(){return m},get themeColors(){return Nu.current}})};le(b,E=>{d()?E(_):E(S,!1)})}C(t,g),Te()}class Hbe{#e=_e(!1);get _isInitializing(){return p(this.#e)}set _isInitializing(e){k(this.#e,e,!0)}#t=_e(null);get _error(){return p(this.#t)}set _error(e){k(this.#t,e,!0)}#r=_e(0);get _toolCount(){return p(this.#r)}set _toolCount(e){k(this.#r,e,!0)}#n=_e(Tr([]));get _connectedServers(){return p(this.#n)}set _connectedServers(e){k(this.#n,e,!0)}#i=_e(Tr({}));get _healthChecks(){return p(this.#i)}set _healthChecks(e){k(this.#i,e,!0)}#a=_e(!1);get _proxyAvailable(){return p(this.#a)}set _proxyAvailable(e){k(this.#a,e,!0)}connections=new Map;toolsIndex=new Map;serverConfigs=new Map;reconnectingServers=new Set;configSignature=null;initPromise=null;activeFlowCount=0;constructor(){this.probeProxy()}async probeProxy(){try{const e=await fetch(`${qa}${WU}`,{method:"HEAD"
Line truncated
|
||||
`);return e.join("")}}function Zm(t,e){const r=e?URL.parse(t,e):URL.parse(t);return r?.protocol==="http:"||r?.protocol==="https:"}function Bo(t){t.preventDefault()}function Qa(t){t.preventDefault(),t.stopPropagation()}function SSe(t){console.log("Deprecated API usage: "+t)}class l2{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const r=this.#e.exec(e);if(!r)return null;const n=parseInt(r[1],10);let a=parseInt(r[2],10);a=a>=1&&a<=12?a-1:0;let i=parseInt(r[3],10);i=i>=1&&i<=31?i:1;let s=parseInt(r[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(r[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(r[6],10);l=l>=0&&l<=59?l:0;const c=r[7]||"Z";let u=parseInt(r[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(r[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(s+=u,o+=d):c==="+"&&(s-=u,o-=d),new Date(Date.UTC(n,a,i,s,o,l))}}function ESe(t,{scale:e=1,rotation:r=0}){const{width:n,height:a}=t.attributes.style,i=[0,0,parseInt(n),parseInt(a)];return new Ag({viewBox:i,userUnit:1,scale:e,rotation:r})}function fE(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(en(`Not a valid color format: "${t}"`),[0,0,0])}function vSe(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const r of t.keys()){e.style.color=r;const n=window.getComputedStyle(e).color;t.set(r,fE(n))}e.remove()}function wa(t){const{a:e,b:r,c:n,d:a,e:i,f:s}=t.getTransform();return[e,r,n,a,i,s]}function Tl(t){const{a:e,b:r,c:n,d:a,e:i,f:s}=t.getTransform().invertSelf();return[e,r,n,a,i,s]}function sh(t,e,r=!1,n=!0){if(e instanceof Ag){const{pageWidth:a,pageHeight:i}=e.rawDims,{style:s}=t,o=Pi.isCSSRoundSupported,l=`var(--total-scale-factor) * ${a}px`,c=`var(--total-scale-factor) * ${i}px`,u=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,d=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!r||e.rotation%180===0?(s.width=u,s.height=d):(s.width=d,s.height=u)}n&&t.setAttribute("data-main-rotation",e.rotation)}class Wl{constructor(){const{pixelRatio:e}=Wl;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,r,n,a,i=-1){let s=1/0,o=1/0,l=1/0;n=Wl.capPixels(n,i),n>0&&(s=Math.sqrt(n/(e*r))),a!==-1&&(o=a/e,l=a/r);const c=Math.min(s,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,r){if(r>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+r/100));return e>0?Math.min(e,n):n}return e}}const c2=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class df{#e=null;#t=null;#r;#n=null;#i=null;#a=null;#s=null;static#o=null;constructor(e){this.#r=e,df.#o||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const r=this.#r._uiManager._signal;e.addEventListener("contextmenu",Bo,{signal:r}),e.addEventListener("pointerdown",df.#l,{signal:r});const n=this.#n=document.createElement("div");n.className="buttons",e.append(n);const a=this.#r.toolbarPosition;if(a){const{style:i}=e,s=this.#r._uiManager.direction==="ltr"?1-a[0]:a[0];i.insetInlineEnd=`${100*s}%`,i.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#l(e){e.stopPropagation()}#c(e){this.#r._focusEventsAllowed=!1,Qa(e)}#d(e){this.#r._focusEventsAllowed=!0,Qa(e)}#u(e){const r=this.#r._uiManager._signal;e.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:r}),e.addEventListener("focusout",this.#d.bind(this),{capture:!0,signal:r}),e.addEventListener("contextmenu",Bo,{signal:r})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){const{editorType:e,_uiManager:r}=this.#r,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",df.#o[e]),this.#u(n),n.addEventListener("click",a=>{r.delete()},{signal:r._signal}),this.#n.append(n)}get#m(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const r=await e.render();this.#u(r),this.#n.append(r,this.#m),this.#i=e}addComment(e){if(this.#a)return;const r=e.render();r&&(this.#u(r),this.#n.prepend(r,this.#m),this.#a=e,e.toolbar=this)}addColorPicker(
Line truncated
|
||||
`)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",o??i),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),oh.add(n),n.setAttribute("data-element-id",r),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;const{datetimeFormat:c,datetimeType:u,timeStep:d}=this.data,h=!!u&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",f=>{e.setValue(r,{value:f.target.value}),this.setPropertyOnSiblings(n,"value",f.target.value,"value"),l.formattedValue=null}),n.addEventListener("resetform",f=>{const g=this.data.defaultFieldValue??"";n.value=l.userValue=g,l.formattedValue=null});let m=f=>{const{formattedValue:g}=l;g!=null&&(f.target.value=g),f.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",g=>{if(l.focused)return;const{target:b}=g;if(h&&(b.type=u,d&&(b.step=d)),l.userValue){const _=l.userValue;if(h)if(u==="time"){const S=new Date(_),E=[S.getHours(),S.getMinutes(),S.getSeconds()];b.value=E.map(y=>y.toString().padStart(2,"0")).join(":")}else b.value=new Date(_-OEe).toISOString().split(u==="date"?"T":".",1)[0];else b.value=_}l.lastCommittedValue=b.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),n.addEventListener("updatefromsandbox",g=>{this.showElementAndHideCanvas(g.target);const b={value(_){l.userValue=_.detail.value??"",h||e.setValue(r,{value:l.userValue.toString()}),_.target.value=l.userValue},formattedValue(_){const{formattedValue:S}=_.detail;l.formattedValue=S,S!=null&&_.target!==document.activeElement&&(_.target.value=S);const E={formattedValue:S};h&&(E.value=S),e.setValue(r,E)},selRange(_){_.target.setSelectionRange(..._.detail.selRange)},charLimit:_=>{const{charLimit:S}=_.detail,{target:E}=_;if(S===0){E.removeAttribute("maxLength");return}E.setAttribute("maxLength",S);let y=l.userValue;!y||y.length<=S||(y=y.slice(0,S),E.value=l.userValue=y,e.setValue(r,{value:y}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:y,willCommit:!0,commitKey:1,selStart:E.selectionStart,selEnd:E.selectionEnd}}))}};this._dispatchEventFromSandbox(b,g)}),n.addEventListener("keydown",g=>{l.commitKey=1;let b=-1;if(g.key==="Escape"?b=0:g.key==="Enter"&&!this.data.multiLine?b=2:g.key==="Tab"&&(l.commitKey=3),b===-1)return;const{value:_}=g.target;l.lastCommittedValue!==_&&(l.lastCommittedValue=_,l.userValue=_,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:_,willCommit:!0,commitKey:b,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}))});const f=m;m=null,n.addEventListener("blur",g=>{if(!l.focused||!g.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:b}=g;let{value:_}=b;if(h){if(_&&u==="time"){const S=_.split(":").map(E=>parseInt(E,10));_=new Date(2e3,0,1,S[0],S[1],S[2]||0).valueOf(),b.step=""}else _=new Date(_).valueOf();b.type="text"}l.userValue=_,l.lastCommittedValue!==_&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:_,willCommit:!0,commitKey:l.commitKey,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}),f(g)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",g=>{l.lastCommittedValue=null;const{data:b,target:_}=g,{value:S,selectionStart:E,selectionEnd:y}=_;let v=E,T=y;switch(g.inputType){case"deleteWordBackward":{const w=S.substring(0,E).match(/\w*[^\w]*$/);w&&(v-=w[0].length);break}case"deleteWordForward":{const w=S.substring(E).match(/^[^\w]*\w*/);w&&(T+=w[0].length);break}case"deleteContentBackward":E===y&&(v-=1);break;case"deleteContentForward":E===y&&(T+=1);break}g.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:S,change:b||"",willCommit:!1,selStart:v,selEnd:T}})}),this._setEventListeners(n,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],g=>g.target.value)}if(m&&n.addEventListener("blur",m),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${g}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class xEe extends bh{constructor(e){super(e,{isRenderable:!!e.data.has
Line truncated
|
||||
`))r.push({name:"span",value:i,attributes:a});return n}_formatContents({str:e,dir:r}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=r;const a=e.split(/(?:\r\n?|\n)/);for(let i=0,s=a.length;i<s;++i){const o=a[i];n.append(document.createTextNode(o)),i<s-1&&n.append(document.createElement("br"))}return n}#I(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#u)&&this.#O()}updateEdited({rect:e,popup:r,deleted:n}){if(n||r?.deleted){this.remove();return}this.#v(),this.#_||={contentsObj:this.#s,richText:this.#g},e&&(this.#p=null),r&&(this.#g=this.#w(r.text),this.#o=l2.toDateObject(r.date),this.#s=null),this.#m?.remove(),this.#m=null}resetEdited(){this.#_&&({contentsObj:this.#s,richText:this.#g}=this.#_,this.#_=null,this.#m?.remove(),this.#m=null,this.#p=null)}remove(){this.#f?.abort(),this.#f=null,this.#m?.remove(),this.#m=null,this.#E=!1,this.#u=!1;for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#N(){if(this.#p!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:r,pageHeight:n,pageX:a,pageY:i}}}=this.#c;let s=!!this.#d,o=s?this.#d:this.#h;for(const f of this.#l)if(!o||kr.intersect(f.data.rect,o)!==null){o=f.data.rect,s=!0;break}const l=kr.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=s?o[2]-o[0]+5:0,d=l[0]+u,h=l[1];this.#p=[100*(d-a)/r,100*(h-i)/n];const{style:m}=this.#a;m.left=`${this.#p[0]}%`,m.top=`${this.#p[1]}%`}#O(){this.#u=!this.#u,this.#u?(this.#R(),this.#a.addEventListener("click",this.#n),this.#a.addEventListener("keydown",this.#e)):(this.#D(),this.#a.removeEventListener("click",this.#n),this.#a.removeEventListener("keydown",this.#e))}#R(){this.#m||this.render(),this.isVisible?this.#u&&this.#a.classList.add("focused"):(this.#N(),this.#a.hidden=!1,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)+1e3)}#D(){this.#a.classList.remove("focused"),!(this.#u||!this.isVisible)&&(this.#a.hidden=!0,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)-1e3)}forceHide(){this.#E=this.isVisible,this.#E&&(this.#a.hidden=!0)}maybeShow(){this.#v(),this.#E&&(this.#m||this.#R(),this.#E=!1,this.#a.hidden=!1)}get isVisible(){return this.#a.hidden===!1}}class Fz extends za{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Jr.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const r of this.textContent){const n=document.createElement("span");n.textContent=r,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class LEe extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:r,height:n}=this,a=this.svgFactory.create(r,n,!0),i=this.#e=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),a.append(i),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class FEe extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:r,height:n}=this,a=this.svgFactory.create(r,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",i/2),s.setAttribute("y",i/2),s.setAttribute("width",r-i),s.setAttribute("height",n-i),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class BEe extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:r,height:n}=this,a=this.svgFactory.create(r,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",r/2),s.setAttribute("cy",n/2),s.setAttribute("rx",r/2-i/2),s.setAttribute("ry",n/2-i/2),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return
Line truncated
|
||||
`)}#l(){const[e,r]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:a,div:i}=this,s=i.style.display,o=i.classList.contains("hidden");i.classList.remove("hidden"),i.style.display="hidden",a.div.append(this.div),n=i.getBoundingClientRect(),i.remove(),i.style.display=s,i.classList.toggle("hidden",o)}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/r):(this.width=n.height/e,this.height=n.width/r),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#t,r=this.#t=this.#o().trimEnd();if(e===r)return;const n=a=>{if(this.#t=a,!a){this.remove();return}this.#d(),this._uiManager.rebuild(this),this.#l()};this.addCommands({cmd:()=>{n(r)},undo:()=>{n(e)},mustExec:!1}),this.#l()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){oi._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,r;(this._isCopy||this.annotationElementId)&&(e=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#r),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,n.color=this.#e,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[a,i]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);const[c,u]=this.pageDimensions,[d,h]=this.pageTranslation;let m,f;switch(this.rotation){case 0:m=e+(s[0]-d)/c,f=r+this.height-(s[1]-h)/u;break;case 90:m=e+(s[0]-d)/c,f=r-(s[1]-h)/u,[o,l]=[l,-o];break;case 180:m=e-this.width+(s[0]-d)/c,f=r-(s[1]-h)/u,[o,l]=[-o,-l];break;case 270:m=e+(s[0]-d-this.height*u)/c,f=r+(s[1]-h-this.width*c)/u,[o,l]=[-l,o];break}this.setAt(m*a,f*i,o,l)}else this._moveAfterPaste(e,r);this.#d(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(j0,"")}editorDivPaste(e){const r=e.clipboardData||window.clipboardData,{types:n}=r;if(n.length===1&&n[0]==="text/plain")return;e.preventDefault();const a=oi.#m(r.getData("text")||"").replaceAll(j0,`
|
||||
`);if(!a)return;const i=window.getSelection();if(!i.rangeCount)return;this.editorDiv.normalize(),i.deleteFromDocument();const s=i.getRangeAt(0);if(!a.includes(`
|
||||
`)){s.insertNode(document.createTextNode(a)),this.editorDiv.normalize(),i.collapseToStart();return}const{startContainer:o,startOffset:l}=s,c=[],u=[];if(o.nodeType===Node.TEXT_NODE){const m=o.parentElement;if(u.push(o.nodeValue.slice(l).replaceAll(j0,"")),m!==this.editorDiv){let f=c;for(const g of this.editorDiv.childNodes){if(g===m){f=u;continue}f.push(oi.#c(g))}}c.push(o.nodeValue.slice(0,l).replaceAll(j0,""))}else if(o===this.editorDiv){let m=c,f=0;for(const g of this.editorDiv.childNodes)f++===l&&(m=u),m.push(oi.#c(g))}this.#t=`${c.join(`
|
||||
`)}${a}${u.join(`
|
||||
`)}`,this.#d();const d=new Range;let h=Math.sumPrecise(c.map(m=>m.length));for(const{firstChild:m}of this.editorDiv.childNodes)if(m.nodeType===Node.TEXT_NODE){const f=m.nodeValue.length;if(h<=f){d.setStart(m,h),d.setEnd(m,h);break}h-=f}i.removeAllRanges(),i.addRange(d)}#d(){if(this.editorDiv.replaceChildren(),!!this.#t)for(const e of this.#t.split(`
|
||||
`)){const r=document.createElement("div");r.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(r)}}#u(){return this.#t.replaceAll(" "," ")}static#m(e){return e.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(e,r,n){let a=null;if(e instanceof Fz){const{data:{defaultAppearanceData:{fontSize:s,fontColor:o},rect:l,rotation:c,id:u,popupRef:d,contentsObj:h},textContent:m,textPosition:f,parent:{page:{pageNumber:g}}}=e;if(!m||m.length===0)return null;a=e={annotationType:Jr.FREETEXT,color:Array.from(o),fontSize:s,value:m.join(`
|
||||
`),position:f,pageIndex:g-1,rect:l.slice(0),rotation:c,annotationElementId:u,id:u,deleted:!1,popupRef:d,comment:h?.str||null}}const i=await super.deserialize(e,r,n);return i.#i=e.fontSize,i.#e=kr.makeHexColor(...e.color),i.#t=oi.#m(e.value),i._initialData=a,e.comment&&i.setCommentData(e.comment),i}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r=oi._internalPadding*this.parentScale,n=this.getRect(r,r),a=Fr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),i={annotationType:Jr.FREETEXT,color:a,fontSize:this.#i,value:this.#u(),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!this.#f(i)?null:(i.id=this.annotationElementId,i)}#f(e){const{value:r,fontSize:n,color:a,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==r||e.fontSize!==n||e.color.some((s,o)=>s!==a[o])||e.pageIndex!==i}renderAnnotationElement(e){const r=super.renderAnnotationElement(e),{style:n}=r;n.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,n.color=this.#e,r.replaceChildren();for(const s of this.#t.split(`
|
||||
`)){const o=document.createElement("div");o.append(s?document.createTextNode(s):document.createElement("br")),r.append(o)}const a=oi._internalPadding*this.parentScale,i={rect:this.getRect(a,a)};return i.popup=this.hasEditedComment?this.comment:{text:this.#t},e.updateEdited(i),r}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class Sr{static PRECISION=1e-4;toSVGPath(){Jn("Abstract method `toSVGPath` must be implemented.")}get box(){Jn("Abstract getter `box` must be implemented.")}serialize(e,r){Jn("Abstract method `serialize` must be implemented.")}static _rescale(e,r,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=r+e[o]*a,s[o+1]=n+e[o+1]*i;return s}static _rescaleAndSwap(e,r,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=r+e[o+1]*a,s[o+1]=n+e[o]*i;return s}static _translate(e,r,n,a){a||=new Float32Array(e.length);for(let i=0,s=e.length;i<s;i+=2)a[i]=r+e[i],a[i+1]=n+e[i+1];return a}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,r,n,a,i){switch(i){case 90:return[1-r/n,e/a];case 180:return[1-e/n,1-r/a];case 270:return[r/n,1-e/a];default:return[e/n,r/a]}}static _normalizePagePoint(e,r,n){switch(n){case 90:return[1-r,e];case 180:return[1-e,1-r];case 270:return[r,1-e];default:return[e,r]}}static createBezierPoints(e,r,n,a,i,s){return[(e+5*n)/6,(r+5*a)/6,(5*n+i)/6,(5*a+s)/6,(n+i)/2,(a+s)/2]}}class Kd{#e;#t=[];#r;#n;#i=[];#a=new Float32Array(18);#s;#o;#l;#c;#d;#u;#m=[];static#f=8;static#p=2;static#h=Kd.#f+Kd.#p;constructor({x:e,y:r},n,a,i,s,o=0){this.#e=n,this.#u=i*a,this.#n=s,this.#a.set([NaN,NaN,NaN,NaN,e,r],6),this.#r=o,this.#c=Kd.#f*a,this.#l=Kd.#h*a,this.#d=a,this.#m.push(e,r)}isEmpty(){return isNaN(this.#a[8])}#g(){const e=this.#a.subarray(4,6),r=this.#a.subarray(16,18),[n,a,i,s]=this.#e;return[(this.#s+(e[0]-r[0])/2-n)/i,(this.#o+(e[1]-r[1])/2-a)/s,(this.#s+(r[0]-e[0])/2-n)/i,(this.#o+(r[1]-e[1])/2-a)/s]}add({x:e,y:r}){this.#s=e,this.#o=r;const[n,a,i,s]=this.#e;let[o,l,c,u]=this.#a.subarray(8,12);const d=e-c,h=r-u,m=Math.hypot(d,h);if(m<this.#l)return!1;const f=m-this.#c,g=f/m,b=g*d,_=g*h;let S=o,E=l;o=c,l=u,c+=b,u+=_,this.#m?.push(e,r);const y=-_/f,v=b/f,T=y*this.#u,w=v*this.#u;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+T,u+w],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-T,u-w],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+T,l+w],2),this.#i.push(NaN,NaN,NaN,NaN,(o+T-n)/i,(l+w-a)/s),this.#a.set([o-T,l-w],14),this.#t.push(NaN,NaN,NaN,NaN,(o-T-n)/i,(l-w-a)/s)),this.#a.set([S,E,o,l,c,u],6),!this.isEmpty()):(this.#a.set([S,E,o,l,c,u],6),Math.abs(Math.atan2(E-l,S-o)-Math.atan2(_,b))<Math.PI/2?([o,l,c,u]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((l+u)/2-a)/s),[o,l,S,E]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((S+o)/2-n)/i,((E+l)/2-a)/s),!0):([S,E,o,l,c,u]=this.#a.subarray(0,6),this.#i.push(((S+5*o)/6-n)/i,((E+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),[c,u,o,l,S,E]=this.#a.subarray(12,18),this.#t.push(((S+5*o)/6-n)/i,((E+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#i,r=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#S();const n=[];n.push(`M${e[4]} ${e[5]}`);for(let a=6;a<e.length;a+=6)isNaN(e[a])?n.push(`L${e[a+4]} ${e[a+5]}`):n.push(`C${e[a]} ${e[a+1]} ${e[a+2]} ${e[a+3]} ${e[a+4]} ${e[a+5]}`);this.#E(n);for(let a=r.length-6;a>=6;a-=6)isNaN(r[a])?n.push(`L${r[a+4]} ${r[a+5]}`):n.push(`C${r[a]} ${r[a+1]} ${r[a+2]} ${r[a+3]} ${r[a+4]} ${r[a+5]}`);return this.#_(n),n.join(" ")}#S(){const[e,r,n,a]=this.#e,[i,s,o,l]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-r)/a} L${(this.#a[4]-e)/n} ${(this.#a[5]-r)/a} L${i} ${s} L${o} ${l} L${(this.#a[16]-e)/n} ${(this.#a[17]-r)/a} L${(this.#a[14]-e)/n} ${(this.#a[15]-r)/a} Z`}#_(e){const r=this.#t;e.push(`L${r[4]} ${r[5]} Z`)}#E(e){const[r,n,a,i]=this.#e,s=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[l,c,u,d]=this.#g();e.push(`L${(s[0]-r)/a} ${(s[1]-n)/i} L${l} ${c} L${u} ${d} L${(o[0]-r)/a} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,r,n,a,i,s){return new qz(e,r,n,a,i,s)}getOutlines(){const e=this.#i,r=this.#t,n=this.#a,[a,i,s,o]=this.#e,l=new Float32Array((this.#m?.length??0)+2);for(let d=0,h=l.length-2;d<h;d+=2)l[d]=(this.#m[d]-a)/s,l[d+1]=(this.#m[d+1]-i)/o;if(l[l.length-2]=(this.#s-a)/s,l[l.length-1]=(this.#o-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#v(l);const c=new Float32Array(this.#i.length+24+this.#t.length);let u=e.length;for(let d=0;d<u;d+=2){if(isNaN(e[d])){c[d]=c[d+1]=NaN;continue}c[d]=e[d],c[d+1]=e[d+1]}u=this.#T(c,u);for(let d=r.length-6;d>=6;d-=6)for(let h=0;h<6;h+=2){if(isNaN(r[d+h])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=r[d+h],c[u+1]=r[d+h+1],u+=2}return this.#b(c,u),this.newFreeDrawOutline(c,l,this.#e,this.#d,this.#r,this.#n)}#v(e){const r=this.#a,[n,a,i,s]=this.#e,[o,l,c,u]=this.#g(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(r[2]
Line truncated
|
||||
`)}catch(e){throw console.error("Error converting PDF to text:",e),new Error(`Failed to convert PDF to text: ${e instanceof Error?e.message:"Unknown error"}`)}}async function Hz(t,e=1.5){try{const r=await $z(t),n=await Ax(r).promise,a=[];for(let i=1;i<=n.numPages;i++){const s=await n.getPage(i),o=s.getViewport({scale:e}),l=document.createElement("canvas"),c=l.getContext("2d");if(l.width=o.width,l.height=o.height,!c)throw new Error("Failed to get 2D context from canvas");const u=s.render({canvasContext:c,viewport:o,canvas:l});a.push(u.promise.then(()=>l.toDataURL(ta.PNG)))}return await Promise.all(a)}catch(r){throw console.error("Error converting PDF to images:",r),new Error(`Failed to convert PDF to images: ${r instanceof Error?r.message:"Unknown error"}`)}}function Yz(t,e="white"){return new Promise((r,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),r(i.toDataURL(ta.PNG))},a.onerror=()=>{n(new Error("Failed to load SVG image. Ensure the SVG data is valid."))},a.src=t}catch(a){const s=`Error converting SVG to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function Vz(t){return t===ta.SVG}function Wz(t,e="white"){return new Promise((r,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),r(i.toDataURL(ta.PNG))},a.onerror=()=>{n(new Error("Failed to load WebP image. Ensure the WebP data is valid."))},a.src=t}catch(a){const s=`Error converting WebP to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function Kz(t){return t===ta.WEBP}class is{static async sendMessage(e,r={},n,a){const{stream:i,onChunk:s,onComplete:o,onError:l,onReasoningChunk:c,onToolCallChunk:u,onModel:d,onTimings:h,tools:m,temperature:f,max_tokens:g,dynatemp_range:b,dynatemp_exponent:_,top_k:S,top_p:E,min_p:y,xtc_probability:v,xtc_threshold:T,typ_p:w,repeat_last_n:A,repeat_penalty:I,presence_penalty:x,frequency_penalty:D,dry_multiplier:$,dry_base:H,dry_allowed_length:G,dry_penalty_last_n:K,samplers:z,backend_sampling:re,custom:W,timings_per_token:ie,disableReasoningParsing:M,excludeReasoningFromContext:B}=r,J=e.map(O=>{if("id"in O&&"convId"in O&&"timestamp"in O){const U=O;return is.convertDbMessageToApiChatMessageData(U)}else return O}).filter(O=>O.role===tr.SYSTEM?(typeof O.content=="string"?O.content:"").trim().length>0:!0);r.model&&!ar.modelSupportsVision(r.model)&&J.forEach(O=>{Array.isArray(O.content)&&(O.content=O.content.filter(U=>U.type===ts.IMAGE_URL?(console.info(`[ChatService] Skipping image attachment in message history (model "${r.model}" does not support vision)`),!1):!0),O.content.length===1&&O.content[0].type===ts.TEXT&&(O.content=O.content[0].text))});const N={messages:J.map(O=>{const U={role:O.role,content:O.content,tool_calls:O.tool_calls,tool_call_id:O.tool_call_id};return!B&&O.reasoning_content&&(U.reasoning_content=O.reasoning_content),U}),stream:i,return_progress:i?!0:void 0,tools:m&&m.length>0?m:void 0};if(r.model&&(N.model=r.model),N.reasoning_format=M?pR.NONE:pR.AUTO,f!==void 0&&(N.temperature=f),g!==void 0&&(N.max_tokens=g!==null&&g!==0?g:-1),b!==void 0&&(N.dynatemp_range=b),_!==void 0&&(N.dynatemp_exponent=_),S!==void 0&&(N.top_k=S),E!==void 0&&(N.top_p=E),y!==void 0&&(N.min_p=y),v!==void 0&&(N.xtc_probability=v),T!==void 0&&(N.xtc_threshold=T),w!==void 0&&(N.typ_p=w),A!==void 0&&(N.repeat_last_n=A),I!==void 0&&(N.repeat_penalty=I),x!==void 0&&(N.presence_penalty=x),D!==void 0&&(N.frequency_penalty=D),$!==void 0&&(N.dry_multiplier=$),H!==void 0&&(N.dry_base=H),G!==void 0&&(N.dry_allowed_length=G),K!==void 0&&(N.dry_penalty_last_n=K),z!==void 0&&(N.samplers=typeof z=="string"?z.split(";").filter(O=>O.trim()):z),re!==void 0&&(N.backend_sampling=re),ie!==void 0&&(N.timings_per_token=ie),W)try{const O=typeof W=="string"?JSON.parse(W):W;Object.assign(N,O)}catch(O){console.warn("Failed to parse custom parameters:",O)}try{const O=await fetch("./v1/chat/completions",{method:"POST",headers:xI(),body:JSON.stringify(N),signal:a});if(!O.ok){const U=await is.parseErrorResponse(O);throw l&&l(U),U}if(i){await is.handleStreamResponse(O,s,o,l,c,u,d,h,n,a);return}else return is.handleNonStreamResponse(O,o,l,u,d)}catch(O){if(Rl(O)){console.log("Chat completion request was aborted");return}let U;throw O instanceof Error?O.name==="TypeError"&&O.message.includes("fetch")?(U=new Error("Unable to connect to server - please check if the server is running"),U.name="NetworkError"):O.message.includes("ECONNREFUSED")?(U=new Error("Connection refused - se
Line truncated
|
||||
`);w=x.pop()||"";for(const D of x){if(u?.aborted)break;if(D.startsWith(ho.DATA)){const $=D.slice(6);if($==="[DONE]"){_=!0;continue}try{const H=JSON.parse($),G=H.choices[0]?.delta?.content,K=H.choices[0]?.delta?.reasoning_content,z=H.choices[0]?.delta?.tool_calls,re=H.timings,W=H.prompt_progress,ie=is.extractModelName(H);ie&&!S&&(S=!0,o?.(ie)),W&&is.notifyTimings(void 0,W,l),re&&(is.notifyTimings(re,W,l),b=re),G&&(v(),m+=G,u?.aborted||r?.(G)),K&&(v(),f+=K,u?.aborted||i?.(K)),T(z)}catch(H){console.error("Error parsing JSON chunk:",H)}}}if(u?.aborted)break}if(u?.aborted)return;if(_){v();const A=g.length>0?JSON.stringify(g):void 0;n?.(m,f||void 0,b,A)}}catch(w){const A=w instanceof Error?w:new Error("Stream error");throw a?.(A),A}finally{d.releaseLock()}}static async handleNonStreamResponse(e,r,n,a,i){try{const s=await e.text();if(!s.trim())throw new Error("No response received from server. Please try again.");const o=JSON.parse(s),l=is.extractModelName(o);l&&i?.(l);const c=o.choices[0]?.message?.content||"",u=o.choices[0]?.message?.reasoning_content,d=o.choices[0]?.message?.tool_calls;let h;if(d&&d.length>0){const m=is.mergeToolCallDeltas([],d);m.length>0&&(h=JSON.stringify(m),h&&a?.(h))}if(!c.trim()&&!h)throw new Error("No response received from server. Please try again.");return r?.(c,u,void 0,h),c}catch(s){const o=s instanceof Error?s:new Error("Parse error");throw n?.(o),o}}static mergeToolCallDeltas(e,r,n=0){const a=e.map(i=>({...i,function:i.function?{...i.function}:void 0}));for(const i of r){const s=typeof i.index=="number"&&i.index>=0?i.index+n:a.length;for(;a.length<=s;)a.push({function:void 0});const o=a[s];if(i.id&&(o.id=i.id),i.type&&(o.type=i.type),i.function){const l=o.function?{...o.function}:{};i.function.name&&(l.name=i.function.name),i.function.arguments&&(l.arguments=(l.arguments??"")+i.function.arguments),o.function=l}}return a}static convertDbMessageToApiChatMessageData(e){if(e.role===tr.TOOL&&e.toolCallId)return{role:tr.TOOL,content:e.content,tool_call_id:e.toolCallId};let r;if(e.toolCalls)try{r=JSON.parse(e.toolCalls)}catch{}if(!e.extra||e.extra.length===0){const h={role:e.role,content:e.content};return e.reasoningContent&&(h.reasoning_content=e.reasoningContent),r&&r.length>0&&(h.tool_calls=r),h}const n=[];e.content&&n.push({type:ts.TEXT,text:e.content});const a=e.extra.filter(h=>h.type===Qr.IMAGE);for(const h of a)n.push({type:ts.IMAGE_URL,image_url:{url:h.base64Url}});const i=e.extra.filter(h=>h.type===Qr.TEXT);for(const h of i)n.push({type:ts.TEXT,text:wm("File",h.name,h.content)});const s=e.extra.filter(h=>h.type===Qr.LEGACY_CONTEXT);for(const h of s)n.push({type:ts.TEXT,text:wm("File",h.name,h.content)});const o=e.extra.filter(h=>h.type===Qr.AUDIO);for(const h of o)n.push({type:ts.INPUT_AUDIO,input_audio:{data:h.base64Data,format:h.mimeType.includes("wav")?"wav":"mp3"}});const l=e.extra.filter(h=>h.type===Qr.PDF);for(const h of l)if(h.processedAsImages&&h.images)for(let m=0;m<h.images.length;m++)n.push({type:ts.IMAGE_URL,image_url:{url:h.images[m]}});else n.push({type:ts.TEXT,text:wm(Ure,h.name,h.content)});const c=e.extra.filter(h=>h.type===Qr.MCP_PROMPT);for(const h of c)n.push({type:ts.TEXT,text:wm(Gre,h.name,h.content,h.serverName)});const u=e.extra.filter(h=>h.type===Qr.MCP_RESOURCE);for(const h of u)n.push({type:ts.TEXT,text:wm(qre,h.name,h.content,h.serverName)});const d={role:e.role,content:n};return e.reasoningContent&&(d.reasoning_content=e.reasoningContent),r&&r.length>0&&(d.tool_calls=r),d}static async parseErrorResponse(e){try{const r=await e.text(),n=JSON.parse(r),a=n.error?.message||"Unknown server error",i=new Error(a);return i.name=e.status===400?"ServerError":"HttpError",n.error&&"n_prompt_tokens"in n.error&&"n_ctx"in n.error&&(i.contextInfo={n_prompt_tokens:n.error.n_prompt_tokens,n_ctx:n.error.n_ctx}),i}catch{const r=new Error(`Server error (${e.status}): ${e.statusText}`);return r.name="HttpError",r}}static extractModelName(e){const r=c=>typeof c=="object"&&c!==null?c:void 0,n=c=>typeof c=="string"&&c.trim()?c.trim():void 0,a=r(e);if(!a)return;const i=n(a.model);if(i)return i;const s=Array.isArray(a.choices)?r(a.choices[0]):void 0;if(!s)return;const o=n(r(s.delta)?.model);if(o)return o;const l=n(r(s.message)?.model);if(l)return l}static notifyTimings(e,r,n){!n||!e&&!r||n(e,r)}}class Kh{static async list(){return bR(u_.LIST)}static async listRouter(){return bR(u_.LIST)}static async load(e,r){const n={model:e};return r&&r.length>0&&(n.extra_args=r),R5(u_.LOAD,n)}static async unload(e){return R5(u_.UNLOAD,{model:e})}static isModelLoaded(e){return e.status.value===bi.LOADED}static isModelLoading(e){return e.status.value===bi.LOADING}static parseModelId(e){const r={raw:e,orgName:null,modelName:null,params:null,activatedParams:null,quantization:null,tags:[]},n=e.indexOf(mae);let a;n!==lc?(r.quantization=e.slice(n+1)||null,a=e.slice(0,n)):a=e;const i=a.indexOf(pae);let s;i!==lc?(r.orgName=a.slice(0,i),s=a.slice(i+1)):s=a;const o=s.lastIndexOf(".");if(o!==lc&&!r.quan
Line truncated
|
||||
p-0 md:h-[64vh] md:max-h-[64vh] md:min-h-0 md:rounded-lg`,children:(b,_)=>{mr(fOe(b,{onSave:i,get initialSection(){return e.initialSection}}),S=>k(n,S,!0),()=>p(n))},$$slots:{default:!0}})}),C(u,h)},$$slots:{default:!0}})}),C(t,s),Te()}function id(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("text-lg font-semibold",e.class));fe(i,()=>WO,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-title",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}function Eh(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt(Cf(),e.class));fe(i,()=>xX,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-action",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}function Ux(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt(Cf({variant:"outline"}),e.class));fe(i,()=>MX,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-cancel",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}var Vve=q("<div><!></div>");function sd(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Vve();$t(a,s=>({"data-slot":"alert-dialog-footer",class:s,...n}),[()=>jt("mt-6 flex flex-row gap-2 sm:mt-0 sm:justify-end [&>*]:flex-1 sm:[&>*]:flex-none",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var Wve=q("<div><!></div>");function od(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Wve();$t(a,s=>({"data-slot":"alert-dialog-header",class:s,...n}),[()=>jt("flex flex-col gap-2 text-center sm:text-left",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}function Zz(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e.class));fe(i,()=>NS,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-overlay",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}var Kve=q("<!> <!>",1);function ld(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","portalProps"]);var a=se(),i=L(a);fe(i,()=>iu,(s,o)=>{o(s,ot(()=>e.portalProps,{children:(l,c)=>{var u=Kve(),d=L(u);Zz(d,{});var h=te(d,2);{let m=F(()=>jt("fixed z-[999999] grid w-full gap-4 border bg-background p-6 shadow-lg duration-200","right-0 bottom-0 left-0 max-h-[100dvh] translate-x-0 translate-y-0 overflow-y-auto rounded-t-lg","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-full","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-full","sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:max-h-[100vh] sm:max-w-lg sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg","sm:data-[state=closed]:slide-out-to-bottom-0 sm:data-[state=closed]:zoom-out-95","sm:data-[state=open]:slide-in-from-bottom-0 sm:data-[state=open]:zoom-in-95",e.class));fe(h,()=>UZ,(f,g)=>{g(f,ot({"data-slot":"alert-dialog-content",get class(){return p(m)}},()=>n,{get ref(){return r()},set ref(b){r(b)}}))})}C(l,u)},$$slots:{default:!0}}))}),C(t,a),Te()}function cd(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("text-sm text-muted-foreground",e.class));fe(i,()=>hN,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-description",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}const ud=OX,jve=iu;var Qve=q("<!> ",1),Xve=q("<!> <!>",1),Zve=q("<!> <!>",1),Jve=q("<!> <!> <!>",1);function oh(t,e){ye(e,!0);let r=V(e,"confirmText",3,"Confirm"),n=V(e,"cancelText",3,"Cancel"),a=V(e,"variant",3,"default");function i(c){c.key===Cn.ENTER&&(c.preventDefault(),e.onConfirm()),e.onKeydown?.(c)}function s(c){c||e.onCancel()}var o=se(),l=L(o);fe(l,()=>ud,(c,u)=>{u(c,{get open(){return e.open},onOpenChange:s,children:(d,h)=>{var m=se(),f=L(m);fe(f,()=>ld,(g,b)=>{b(g,{onkeydown:i,children:(_,S)=>{var E=Jve(),y=L(E);fe(y,()=>od,(A,I)=>{I(A,{children:(x,D)=>{var $=Xve(),H=L($);fe(H,()=>id,(K,z)=>{z(K,{class:"flex items-center gap-2",children:(re,W)=>{var ie=Qve(),M=L(ie);{var B=N=>{const O=F(()=>e.icon);var U=se(),X=L(U);{let ne=F(()=>a()==="destructive"?"text-destructive":"");fe(X,()=>p(O),(ue,he)=>{he(ue,{get class(){return`h-5 w-5 ${p(ne)??""}`}})})}C(N,U)};le(M,N=>{e.icon&&N(B)})}var J=te(M);we(()=>qe(J,` ${e.title??""}`)),C(re,ie)},$$slots:{default:!0}})});var G=te(H,2);fe(G,()=>cd,(K,z)=>{z(K,{children:(re,W)=>{et();var ie=Nt();we(()=>qe(ie,e.descr
Line truncated
|
||||
`),position:f,pageIndex:g-1,rect:l.slice(0),rotation:c,annotationElementId:u,id:u,deleted:!1,popupRef:d,comment:h?.str||null}}const i=await super.deserialize(e,r,n);return i.#i=e.fontSize,i.#e=kr.makeHexColor(...e.color),i.#t=oi.#m(e.value),i._initialData=a,e.comment&&i.setCommentData(e.comment),i}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r=oi._internalPadding*this.parentScale,n=this.getRect(r,r),a=Br._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),i={annotationType:Jr.FREETEXT,color:a,fontSize:this.#i,value:this.#u(),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!this.#f(i)?null:(i.id=this.annotationElementId,i)}#f(e){const{value:r,fontSize:n,color:a,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==r||e.fontSize!==n||e.color.some((s,o)=>s!==a[o])||e.pageIndex!==i}renderAnnotationElement(e){const r=super.renderAnnotationElement(e),{style:n}=r;n.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,n.color=this.#e,r.replaceChildren();for(const s of this.#t.split(`
|
||||
`)){const o=document.createElement("div");o.append(s?document.createTextNode(s):document.createElement("br")),r.append(o)}const a=oi._internalPadding*this.parentScale,i={rect:this.getRect(a,a)};return i.popup=this.hasEditedComment?this.comment:{text:this.#t},e.updateEdited(i),r}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class Sr{static PRECISION=1e-4;toSVGPath(){Jn("Abstract method `toSVGPath` must be implemented.")}get box(){Jn("Abstract getter `box` must be implemented.")}serialize(e,r){Jn("Abstract method `serialize` must be implemented.")}static _rescale(e,r,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=r+e[o]*a,s[o+1]=n+e[o+1]*i;return s}static _rescaleAndSwap(e,r,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=r+e[o+1]*a,s[o+1]=n+e[o]*i;return s}static _translate(e,r,n,a){a||=new Float32Array(e.length);for(let i=0,s=e.length;i<s;i+=2)a[i]=r+e[i],a[i+1]=n+e[i+1];return a}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,r,n,a,i){switch(i){case 90:return[1-r/n,e/a];case 180:return[1-e/n,1-r/a];case 270:return[r/n,1-e/a];default:return[e/n,r/a]}}static _normalizePagePoint(e,r,n){switch(n){case 90:return[1-r,e];case 180:return[1-e,1-r];case 270:return[r,1-e];default:return[e,r]}}static createBezierPoints(e,r,n,a,i,s){return[(e+5*n)/6,(r+5*a)/6,(5*n+i)/6,(5*a+s)/6,(n+i)/2,(a+s)/2]}}class Kd{#e;#t=[];#r;#n;#i=[];#a=new Float32Array(18);#s;#o;#l;#c;#d;#u;#m=[];static#f=8;static#p=2;static#h=Kd.#f+Kd.#p;constructor({x:e,y:r},n,a,i,s,o=0){this.#e=n,this.#u=i*a,this.#n=s,this.#a.set([NaN,NaN,NaN,NaN,e,r],6),this.#r=o,this.#c=Kd.#f*a,this.#l=Kd.#h*a,this.#d=a,this.#m.push(e,r)}isEmpty(){return isNaN(this.#a[8])}#g(){const e=this.#a.subarray(4,6),r=this.#a.subarray(16,18),[n,a,i,s]=this.#e;return[(this.#s+(e[0]-r[0])/2-n)/i,(this.#o+(e[1]-r[1])/2-a)/s,(this.#s+(r[0]-e[0])/2-n)/i,(this.#o+(r[1]-e[1])/2-a)/s]}add({x:e,y:r}){this.#s=e,this.#o=r;const[n,a,i,s]=this.#e;let[o,l,c,u]=this.#a.subarray(8,12);const d=e-c,h=r-u,m=Math.hypot(d,h);if(m<this.#l)return!1;const f=m-this.#c,g=f/m,b=g*d,_=g*h;let S=o,E=l;o=c,l=u,c+=b,u+=_,this.#m?.push(e,r);const y=-_/f,v=b/f,T=y*this.#u,w=v*this.#u;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+T,u+w],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-T,u-w],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+T,l+w],2),this.#i.push(NaN,NaN,NaN,NaN,(o+T-n)/i,(l+w-a)/s),this.#a.set([o-T,l-w],14),this.#t.push(NaN,NaN,NaN,NaN,(o-T-n)/i,(l-w-a)/s)),this.#a.set([S,E,o,l,c,u],6),!this.isEmpty()):(this.#a.set([S,E,o,l,c,u],6),Math.abs(Math.atan2(E-l,S-o)-Math.atan2(_,b))<Math.PI/2?([o,l,c,u]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((l+u)/2-a)/s),[o,l,S,E]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((S+o)/2-n)/i,((E+l)/2-a)/s),!0):([S,E,o,l,c,u]=this.#a.subarray(0,6),this.#i.push(((S+5*o)/6-n)/i,((E+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),[c,u,o,l,S,E]=this.#a.subarray(12,18),this.#t.push(((S+5*o)/6-n)/i,((E+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#i,r=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#S();const n=[];n.push(`M${e[4]} ${e[5]}`);for(let a=6;a<e.length;a+=6)isNaN(e[a])?n.push(`L${e[a+4]} ${e[a+5]}`):n.push(`C${e[a]} ${e[a+1]} ${e[a+2]} ${e[a+3]} ${e[a+4]} ${e[a+5]}`);this.#E(n);for(let a=r.length-6;a>=6;a-=6)isNaN(r[a])?n.push(`L${r[a+4]} ${r[a+5]}`):n.push(`C${r[a]} ${r[a+1]} ${r[a+2]} ${r[a+3]} ${r[a+4]} ${r[a+5]}`);return this.#_(n),n.join(" ")}#S(){const[e,r,n,a]=this.#e,[i,s,o,l]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-r)/a} L${(this.#a[4]-e)/n} ${(this.#a[5]-r)/a} L${i} ${s} L${o} ${l} L${(this.#a[16]-e)/n} ${(this.#a[17]-r)/a} L${(this.#a[14]-e)/n} ${(this.#a[15]-r)/a} Z`}#_(e){const r=this.#t;e.push(`L${r[4]} ${r[5]} Z`)}#E(e){const[r,n,a,i]=this.#e,s=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[l,c,u,d]=this.#g();e.push(`L${(s[0]-r)/a} ${(s[1]-n)/i} L${l} ${c} L${u} ${d} L${(o[0]-r)/a} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,r,n,a,i,s){return new qz(e,r,n,a,i,s)}getOutlines(){const e=this.#i,r=this.#t,n=this.#a,[a,i,s,o]=this.#e,l=new Float32Array((this.#m?.length??0)+2);for(let d=0,h=l.length-2;d<h;d+=2)l[d]=(this.#m[d]-a)/s,l[d+1]=(this.#m[d+1]-i)/o;if(l[l.length-2]=(this.#s-a)/s,l[l.length-1]=(this.#o-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#v(l);const c=new Float32Array(this.#i.length+24+this.#t.length);let u=e.length;for(let d=0;d<u;d+=2){if(isNaN(e[d])){c[d]=c[d+1]=NaN;continue}c[d]=e[d],c[d+1]=e[d+1]}u=this.#T(c,u);for(let d=r.length-6;d>=6;d-=6)for(let h=0;h<6;h+=2){if(isNaN(r[d+h])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=r[d+h],c[u+1]=r[d+h+1],u+=2}return this.#b(c,u),this.newFreeDrawOutline(c,l,this.#e,this.#d,this.#r,this.#n)}#v(e){const r=this.#a,[n,a,i,s]=this.#e,[o,l,c,u]=this.#g(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(r[2]
Line truncated
|
||||
`)}catch(e){throw console.error("Error converting PDF to text:",e),new Error(`Failed to convert PDF to text: ${e instanceof Error?e.message:"Unknown error"}`)}}async function Hz(t,e=1.5){try{const r=await $z(t),n=await Ax(r).promise,a=[];for(let i=1;i<=n.numPages;i++){const s=await n.getPage(i),o=s.getViewport({scale:e}),l=document.createElement("canvas"),c=l.getContext("2d");if(l.width=o.width,l.height=o.height,!c)throw new Error("Failed to get 2D context from canvas");const u=s.render({canvasContext:c,viewport:o,canvas:l});a.push(u.promise.then(()=>l.toDataURL(ta.PNG)))}return await Promise.all(a)}catch(r){throw console.error("Error converting PDF to images:",r),new Error(`Failed to convert PDF to images: ${r instanceof Error?r.message:"Unknown error"}`)}}function Yz(t,e="white"){return new Promise((r,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),r(i.toDataURL(ta.PNG))},a.onerror=()=>{n(new Error("Failed to load SVG image. Ensure the SVG data is valid."))},a.src=t}catch(a){const s=`Error converting SVG to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function Vz(t){return t===ta.SVG}function Wz(t,e="white"){return new Promise((r,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),r(i.toDataURL(ta.PNG))},a.onerror=()=>{n(new Error("Failed to load WebP image. Ensure the WebP data is valid."))},a.src=t}catch(a){const s=`Error converting WebP to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function Kz(t){return t===ta.WEBP}class li{static async sendMessage(e,r={},n,a){const{stream:i,onChunk:s,onComplete:o,onError:l,onReasoningChunk:c,onToolCallChunk:u,onModel:d,onTimings:h,tools:m,temperature:f,max_tokens:g,dynatemp_range:b,dynatemp_exponent:_,top_k:S,top_p:E,min_p:y,xtc_probability:v,xtc_threshold:T,typ_p:w,repeat_last_n:A,repeat_penalty:I,presence_penalty:x,frequency_penalty:D,dry_multiplier:$,dry_base:H,dry_allowed_length:G,dry_penalty_last_n:K,samplers:z,backend_sampling:re,custom:W,timings_per_token:ie,disableReasoningParsing:M,excludeReasoningFromContext:B}=r,J=e.map(O=>{if("id"in O&&"convId"in O&&"timestamp"in O){const U=O;return li.convertDbMessageToApiChatMessageData(U)}else return O}).filter(O=>O.role===Jt.SYSTEM?(typeof O.content=="string"?O.content:"").trim().length>0:!0);r.model&&!ar.modelSupportsVision(r.model)&&J.forEach(O=>{Array.isArray(O.content)&&(O.content=O.content.filter(U=>U.type===Hi.IMAGE_URL?(console.info(`[ChatService] Skipping image attachment in message history (model "${r.model}" does not support vision)`),!1):!0),O.content.length===1&&O.content[0].type===Hi.TEXT&&(O.content=O.content[0].text))});const N={messages:J.map(O=>{const U={role:O.role,content:O.content,tool_calls:O.tool_calls,tool_call_id:O.tool_call_id};return!B&&O.reasoning_content&&(U.reasoning_content=O.reasoning_content),U}),stream:i,return_progress:i?!0:void 0,tools:m&&m.length>0?m:void 0};if(r.model&&(N.model=r.model),N.reasoning_format=M?mR.NONE:mR.AUTO,f!==void 0&&(N.temperature=f),g!==void 0&&(N.max_tokens=g!==null&&g!==0?g:-1),b!==void 0&&(N.dynatemp_range=b),_!==void 0&&(N.dynatemp_exponent=_),S!==void 0&&(N.top_k=S),E!==void 0&&(N.top_p=E),y!==void 0&&(N.min_p=y),v!==void 0&&(N.xtc_probability=v),T!==void 0&&(N.xtc_threshold=T),w!==void 0&&(N.typ_p=w),A!==void 0&&(N.repeat_last_n=A),I!==void 0&&(N.repeat_penalty=I),x!==void 0&&(N.presence_penalty=x),D!==void 0&&(N.frequency_penalty=D),$!==void 0&&(N.dry_multiplier=$),H!==void 0&&(N.dry_base=H),G!==void 0&&(N.dry_allowed_length=G),K!==void 0&&(N.dry_penalty_last_n=K),z!==void 0&&(N.samplers=typeof z=="string"?z.split(";").filter(O=>O.trim()):z),re!==void 0&&(N.backend_sampling=re),ie!==void 0&&(N.timings_per_token=ie),W)try{const O=typeof W=="string"?JSON.parse(W):W;Object.assign(N,O)}catch(O){console.warn("Failed to parse custom parameters:",O)}try{const O=await fetch("./v1/chat/completions",{method:"POST",headers:hb(),body:JSON.stringify(N),signal:a});if(!O.ok){const U=await li.parseErrorResponse(O);throw l&&l(U),U}if(i){await li.handleStreamResponse(O,s,o,l,c,u,d,h,n,a);return}else return li.handleNonStreamResponse(O,o,l,u,d)}catch(O){if(Oo(O)){console.log("Chat completion request was aborted");return}let U;throw O instanceof Error?O.name==="TypeError"&&O.message.includes("fetch")?(U=new Error("Unable to connect to server - please check if the server is running"),U.name="NetworkError"):O.message.includes("ECONNREFUSED")?(U=new Error("Connection refused - se
Line truncated
|
||||
`);w=x.pop()||"";for(const D of x){if(u?.aborted)break;if(D.startsWith(ho.DATA)){const $=D.slice(6);if($==="[DONE]"){_=!0;continue}try{const H=JSON.parse($),G=H.choices[0]?.delta?.content,K=H.choices[0]?.delta?.reasoning_content,z=H.choices[0]?.delta?.tool_calls,re=H.timings,W=H.prompt_progress,ie=li.extractModelName(H);ie&&!S&&(S=!0,o?.(ie)),W&&li.notifyTimings(void 0,W,l),re&&(li.notifyTimings(re,W,l),b=re),G&&(v(),m+=G,u?.aborted||r?.(G)),K&&(v(),f+=K,u?.aborted||i?.(K)),T(z)}catch(H){console.error("Error parsing JSON chunk:",H)}}}if(u?.aborted)break}if(u?.aborted)return;if(_){v();const A=g.length>0?JSON.stringify(g):void 0;n?.(m,f||void 0,b,A)}}catch(w){const A=w instanceof Error?w:new Error("Stream error");throw a?.(A),A}finally{d.releaseLock()}}static async handleNonStreamResponse(e,r,n,a,i){try{const s=await e.text();if(!s.trim())throw new Error("No response received from server. Please try again.");const o=JSON.parse(s),l=li.extractModelName(o);l&&i?.(l);const c=o.choices[0]?.message?.content||"",u=o.choices[0]?.message?.reasoning_content,d=o.choices[0]?.message?.tool_calls;let h;if(d&&d.length>0){const m=li.mergeToolCallDeltas([],d);m.length>0&&(h=JSON.stringify(m),h&&a?.(h))}if(!c.trim()&&!h)throw new Error("No response received from server. Please try again.");return r?.(c,u,void 0,h),c}catch(s){const o=s instanceof Error?s:new Error("Parse error");throw n?.(o),o}}static mergeToolCallDeltas(e,r,n=0){const a=e.map(i=>({...i,function:i.function?{...i.function}:void 0}));for(const i of r){const s=typeof i.index=="number"&&i.index>=0?i.index+n:a.length;for(;a.length<=s;)a.push({function:void 0});const o=a[s];if(i.id&&(o.id=i.id),i.type&&(o.type=i.type),i.function){const l=o.function?{...o.function}:{};i.function.name&&(l.name=i.function.name),i.function.arguments&&(l.arguments=(l.arguments??"")+i.function.arguments),o.function=l}}return a}static convertDbMessageToApiChatMessageData(e){if(e.role===Jt.TOOL&&e.toolCallId)return{role:Jt.TOOL,content:e.content,tool_call_id:e.toolCallId};let r;if(e.toolCalls)try{r=JSON.parse(e.toolCalls)}catch{}if(!e.extra||e.extra.length===0){const h={role:e.role,content:e.content};return e.reasoningContent&&(h.reasoning_content=e.reasoningContent),r&&r.length>0&&(h.tool_calls=r),h}const n=[];e.content&&n.push({type:Hi.TEXT,text:e.content});const a=e.extra.filter(h=>h.type===Qr.IMAGE);for(const h of a)n.push({type:Hi.IMAGE_URL,image_url:{url:h.base64Url}});const i=e.extra.filter(h=>h.type===Qr.TEXT);for(const h of i)n.push({type:Hi.TEXT,text:wm("File",h.name,h.content)});const s=e.extra.filter(h=>h.type===Qr.LEGACY_CONTEXT);for(const h of s)n.push({type:Hi.TEXT,text:wm("File",h.name,h.content)});const o=e.extra.filter(h=>h.type===Qr.AUDIO);for(const h of o)n.push({type:Hi.INPUT_AUDIO,input_audio:{data:h.base64Data,format:h.mimeType.includes("wav")?"wav":"mp3"}});const l=e.extra.filter(h=>h.type===Qr.PDF);for(const h of l)if(h.processedAsImages&&h.images)for(let m=0;m<h.images.length;m++)n.push({type:Hi.IMAGE_URL,image_url:{url:h.images[m]}});else n.push({type:Hi.TEXT,text:wm(Ure,h.name,h.content)});const c=e.extra.filter(h=>h.type===Qr.MCP_PROMPT);for(const h of c)n.push({type:Hi.TEXT,text:wm(Gre,h.name,h.content,h.serverName)});const u=e.extra.filter(h=>h.type===Qr.MCP_RESOURCE);for(const h of u)n.push({type:Hi.TEXT,text:wm(qre,h.name,h.content,h.serverName)});const d={role:e.role,content:n};return e.reasoningContent&&(d.reasoning_content=e.reasoningContent),r&&r.length>0&&(d.tool_calls=r),d}static stripReasoningContent(e){const r=n=>n.replace(eh.REASONING_BLOCK,"").trim();return typeof e=="string"?r(e):e.map(n=>n.type===Hi.TEXT&&n.text?{...n,text:r(n.text)}:n)}static async parseErrorResponse(e){try{const r=await e.text(),n=JSON.parse(r),a=n.error?.message||"Unknown server error",i=new Error(a);return i.name=e.status===400?"ServerError":"HttpError",n.error&&"n_prompt_tokens"in n.error&&"n_ctx"in n.error&&(i.contextInfo={n_prompt_tokens:n.error.n_prompt_tokens,n_ctx:n.error.n_ctx}),i}catch{const r=new Error(`Server error (${e.status}): ${e.statusText}`);return r.name="HttpError",r}}static extractModelName(e){const r=c=>typeof c=="object"&&c!==null?c:void 0,n=c=>typeof c=="string"&&c.trim()?c.trim():void 0,a=r(e);if(!a)return;const i=n(a.model);if(i)return i;const s=Array.isArray(a.choices)?r(a.choices[0]):void 0;if(!s)return;const o=n(r(s.delta)?.model);if(o)return o;const l=n(r(s.message)?.model);if(l)return l}static notifyTimings(e,r,n){!n||!e&&!r||n(e,r)}}class jh{static async list(){return SR(u_.LIST)}static async listRouter(){return SR(u_.LIST)}static async load(e,r){const n={model:e};return r&&r.length>0&&(n.extra_args=r),R5(u_.LOAD,n)}static async unload(e){return R5(u_.UNLOAD,{model:e})}static isModelLoaded(e){return e.status.value===Si.LOADED}static isModelLoading(e){return e.status.value===Si.LOADING}static parseModelId(e){const r={raw:e,orgName:null,modelName:null,params:null,activatedParams:null,quantization:null,tags:[]},n=e.indexOf(mae);let a;n!==lc?(r.quan
Line truncated
|
||||
p-0 md:h-[64vh] md:max-h-[64vh] md:min-h-0 md:rounded-lg`,children:(b,_)=>{mr(fOe(b,{onSave:i,get initialSection(){return e.initialSection}}),S=>k(n,S,!0),()=>p(n))},$$slots:{default:!0}})}),C(u,h)},$$slots:{default:!0}})}),C(t,s),Te()}function id(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("text-lg font-semibold",e.class));fe(i,()=>KO,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-title",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}function vh(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt(Cf(),e.class));fe(i,()=>xX,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-action",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}function Ux(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt(Cf({variant:"outline"}),e.class));fe(i,()=>MX,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-cancel",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}var Vve=q("<div><!></div>");function sd(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Vve();$t(a,s=>({"data-slot":"alert-dialog-footer",class:s,...n}),[()=>jt("mt-6 flex flex-row gap-2 sm:mt-0 sm:justify-end [&>*]:flex-1 sm:[&>*]:flex-none",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var Wve=q("<div><!></div>");function od(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Wve();$t(a,s=>({"data-slot":"alert-dialog-header",class:s,...n}),[()=>jt("flex flex-col gap-2 text-center sm:text-left",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}function Zz(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e.class));fe(i,()=>IS,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-overlay",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}var Kve=q("<!> <!>",1);function ld(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","portalProps"]);var a=se(),i=L(a);fe(i,()=>iu,(s,o)=>{o(s,ot(()=>e.portalProps,{children:(l,c)=>{var u=Kve(),d=L(u);Zz(d,{});var h=te(d,2);{let m=F(()=>jt("fixed z-[999999] grid w-full gap-4 border bg-background p-6 shadow-lg duration-200","right-0 bottom-0 left-0 max-h-[100dvh] translate-x-0 translate-y-0 overflow-y-auto rounded-t-lg","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-full","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-full","sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:max-h-[100vh] sm:max-w-lg sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg","sm:data-[state=closed]:slide-out-to-bottom-0 sm:data-[state=closed]:zoom-out-95","sm:data-[state=open]:slide-in-from-bottom-0 sm:data-[state=open]:zoom-in-95",e.class));fe(h,()=>UZ,(f,g)=>{g(f,ot({"data-slot":"alert-dialog-content",get class(){return p(m)}},()=>n,{get ref(){return r()},set ref(b){r(b)}}))})}C(l,u)},$$slots:{default:!0}}))}),C(t,a),Te()}function cd(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("text-sm text-muted-foreground",e.class));fe(i,()=>pN,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-description",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}const ud=OX,jve=iu;var Qve=q("<!> ",1),Xve=q("<!> <!>",1),Zve=q("<!> <!>",1),Jve=q("<!> <!> <!>",1);function lh(t,e){ye(e,!0);let r=V(e,"confirmText",3,"Confirm"),n=V(e,"cancelText",3,"Cancel"),a=V(e,"variant",3,"default");function i(c){c.key===wn.ENTER&&(c.preventDefault(),e.onConfirm()),e.onKeydown?.(c)}function s(c){c||e.onCancel()}var o=se(),l=L(o);fe(l,()=>ud,(c,u)=>{u(c,{get open(){return e.open},onOpenChange:s,children:(d,h)=>{var m=se(),f=L(m);fe(f,()=>ld,(g,b)=>{b(g,{onkeydown:i,children:(_,S)=>{var E=Jve(),y=L(E);fe(y,()=>od,(A,I)=>{I(A,{children:(x,D)=>{var $=Xve(),H=L($);fe(H,()=>id,(K,z)=>{z(K,{class:"flex items-center gap-2",children:(re,W)=>{var ie=Qve(),M=L(ie);{var B=N=>{const O=F(()=>e.icon);var U=se(),X=L(U);{let ne=F(()=>a()==="destructive"?"text-destructive":"");fe(X,()=>p(O),(ue,he)=>{he(ue,{get class(){return`h-5 w-5 ${p(ne)??""}`}})})}C(N,U)};le(M,N=>{e.icon&&N(B)})}var J=te(M);we(()=>qe(J,` ${e.title??""}`)),C(re,ie)},$$slots:{default:!0}})});var G=te(H,2);fe(G,()=>cd,(K,z)=>{z(K,{children:(re,W)=>{et();var ie=Nt();we(()=>qe(ie,e.descr
Line truncated
|
||||
as a JSON file.`);C(ne,ue)},X=ne=>{var ue=Nt(`Choose which conversations you want to import. Selected conversations will be merged
|
||||
with your existing conversations.`);C(ne,ue)};le(O,ne=>{e.mode==="export"?ne(U):ne(X,!1)})}C(B,N)},$$slots:{default:!0}})}),C(G,z)},$$slots:{default:!0}})});var D=te(x,2);mr(nRe(D,{get conversations(){return e.conversations},get messageCountMap(){return r()},get mode(){return e.mode},get onCancel(){return e.onCancel},get onConfirm(){return e.onConfirm}}),$=>k(a,$,!0),()=>p(a)),C(w,I)},$$slots:{default:!0}})}),C(b,S)},$$slots:{default:!0}})}),C(u,h)},$$slots:{default:!0}})}),C(t,s),Te()}var Mye=q('<div data-slot="table-container" class="relative w-full overflow-x-auto"><table><!></table></div>');function kye(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Mye(),i=j(a);$t(i,o=>({"data-slot":"table",class:o,...n}),[()=>jt("w-full caption-bottom text-sm",e.class)]);var s=j(i);De(s,()=>e.children??Ge),Y(i),mr(i,o=>r(o),()=>r()),Y(a),C(t,a),Te()}var Pye=q("<tbody><!></tbody>");function Lye(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Pye();$t(a,s=>({"data-slot":"table-body",class:s,...n}),[()=>jt("[&_tr:last-child]:border-0",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var Fye=q("<td><!></td>");function sa(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Fye();$t(a,s=>({"data-slot":"table-cell",class:s,...n}),[()=>jt("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var Bye=q("<th><!></th>");function W7(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Bye();$t(a,s=>({"data-slot":"table-head",class:s,...n}),[()=>jt("h-10 bg-clip-padding px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pe-0",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var Uye=q("<thead><!></thead>");function Gye(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Uye();$t(a,s=>({"data-slot":"table-header",class:s,...n}),[()=>jt("[&_tr]:border-b",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var qye=q("<tr><!></tr>");function bs(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=qye();$t(a,s=>({"data-slot":"table-row",class:s,...n}),[()=>jt("border-b transition-colors data-[state=selected]:bg-muted hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var zye=q("<!> <!>",1),$ye=q('<div class="flex items-center justify-center py-8"><div class="text-sm text-muted-foreground">Loading model information...</div></div>'),Hye=q('<div class="inline-flex items-center gap-2"><span class="resizable-text-container min-w-0 flex-1 truncate"> </span> <!></div>'),Yye=q("<!> <!>",1),Vye=q('<span class="resizable-text-container min-w-0 flex-1 truncate"> </span> <!>',1),Wye=q("<!> <!>",1),Kye=q("<!> <!>",1),jye=q("<!> <!>",1),Qye=q("<!> <!>",1),Xye=q("<!> <!>",1),Zye=q("<!> <!>",1),Jye=q("<!> <!>",1),eTe=q("<!> <!>",1),tTe=q("<!> <!>",1),rTe=q("<!> <!>",1),nTe=q('<div class="flex flex-wrap gap-1"><!></div>'),aTe=q("<!> <!>",1),iTe=q("<!> <!>",1),sTe=q('<div class="rounded-md bg-muted p-4"><pre class="font-mono text-xs whitespace-pre-wrap"> </pre></div>'),oTe=q("<!> <!>",1),lTe=q("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),cTe=q("<!> <!>",1),uTe=q('<div class="flex items-center justify-center py-8"><div class="text-sm text-muted-foreground">No model information available</div></div>'),dTe=q(`<style>@container (max-width: 56rem) {
|
||||
.resizable-text-container {
|
||||
max-width: calc(100vw - var(--threshold));
|
||||
}
|
||||
}</style> <!> <div class="space-y-6 py-4"><!></div>`,1);function t$(t,e){ye(e,!0);let r=V(e,"open",15),n=V(e,"modelId",3,null),a=F(()=>Qn.isRouterMode),i=_e(null),s=_e(!1),o=F(()=>p(a)&&n()?p(i):Qn.props),l=F(()=>p(a)&&n()?n():ar.singleModelName),c=F(ao),u=F(Px),d=F(()=>p(a)&&n()?p(c).find(g=>g.model===n())??null:p(c)[0]??null),h=F(()=>p(d)?.id?ar.getModelModalitiesArray(p(d).id):[]);It(()=>{r()&&p(c).length===0&&ar.fetch()}),It(()=>{r()&&p(a)&&n()&&(k(s,!0),ar.fetchModelProps(n()).then(g=>{k(i,g,!0)}).catch(()=>{k(i,null)}).finally(()=>{k(s,!1)})),r()||k(i,null)});var m=se(),f=L(m);fe(f,()=>Sh,(g,b)=>{b(g,{get onOpenChange(){return e.onOpenChange},get open(){return r()},set open(_){r(_)},children:(_,S)=>{var E=se(),y=L(E);fe(y,()=>bh,(v,T)=>{T(v,{class:"@container z-9999 !max-h-[80dvh] !max-w-[60rem] max-w-full",children:(w,A)=>{var I=dTe(),x=te(L(I),2);fe(x,()=>om,(K,z)=>{z(K,{children:(re,W)=>{var ie=zye(),M=L(ie);fe(M,()=>sm,(J,N)=>{N(J,{children:(O,U)=>{et();var X=Nt("Model Information");C(O,X)},$$slots:{default:!0}})});var B=te(M,2);fe(B,()=>lm,(J,N)=>{N(J,{children:(O,U)=>{et();var X=Nt("Current model details and capabilities");C(O,X)},$$slots:{default:!0}})}),C(re,ie)},$$slots:{default:!0}})});var D=te(x,2),$=j(D);{var H=K=>{var z=$ye();C(K,z)},G=K=>{var z=se(),re=L(z);{var W=M=>{const B=F(()=>p(d).meta);var J=se(),N=L(J);{var O=U=>{var X=se(),ne=L(X);fe(ne,()=>kye,(ue,he)=>{he(ue,{children:(be,Z)=>{var ae=cTe(),pe=L(ae);fe(pe,()=>Gye,(Ee,Ce)=>{Ce(Ee,{children:(Ne,Ie)=>{var Ue=se(),Fe=L(Ue);fe(Fe,()=>bs,(je,He)=>{He(je,{children:(at,st)=>{var dt=Yye(),Ae=L(dt);fe(Ae,()=>W7,(ht,ze)=>{ze(ht,{class:"w-[10rem]",children:(ft,At)=>{et();var Rt=Nt("Model");C(ft,Rt)},$$slots:{default:!0}})});var Le=te(Ae,2);fe(Le,()=>W7,(ht,ze)=>{ze(ht,{children:(ft,At)=>{var Rt=Hye(),zt=j(Rt);ms(zt,"",{},{"--threshold":"12rem"});var ir=j(zt,!0);Y(zt);var hr=te(zt,2);{let lt=F(()=>p(l)||""),Ot=F(()=>!!p(l));Fp(hr,{get text(){return p(lt)},get canCopy(){return p(Ot)},ariaLabel:"Copy model name to clipboard"})}Y(Rt),we(()=>qe(ir,p(l))),C(ft,Rt)},$$slots:{default:!0}})}),C(at,dt)},$$slots:{default:!0}})}),C(Ne,Ue)},$$slots:{default:!0}})});var me=te(pe,2);fe(me,()=>Lye,(Ee,Ce)=>{Ce(Ee,{children:(Ne,Ie)=>{var Ue=lTe(),Fe=L(Ue);fe(Fe,()=>bs,(yt,xt)=>{xt(yt,{children:(Re,Xe)=>{var pt=Wye(),Ct=L(pt);fe(Ct,()=>sa,(kt,bt)=>{bt(kt,{class:"h-10 align-middle font-medium",children:(Tt,St)=>{et();var Dt=Nt("File Path");C(Tt,Dt)},$$slots:{default:!0}})});var Pt=te(Ct,2);fe(Pt,()=>sa,(kt,bt)=>{bt(kt,{class:"inline-flex h-10 items-center gap-2 align-middle font-mono text-xs",children:(Tt,St)=>{var Dt=Vye(),ur=L(Dt);ms(ur,"",{},{"--threshold":"14rem"});var On=j(ur,!0);Y(ur);var vr=te(ur,2);Fp(vr,{get text(){return p(o).model_path},ariaLabel:"Copy model path to clipboard"}),we(()=>qe(On,p(o).model_path)),C(Tt,Dt)},$$slots:{default:!0}})}),C(Re,pt)},$$slots:{default:!0}})});var je=te(Fe,2);{var He=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=Kye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium",children:(ur,On)=>{et();var vr=Nt("Context Size");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{children:(ur,On)=>{et();var vr=Nt();we(Ln=>qe(vr,`${Ln??""} tokens`),[()=>m_(p(o).default_generation_settings.n_ctx)]),C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)},at=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=jye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium text-red-500",children:(ur,On)=>{et();var vr=Nt("Context Size");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{class:"text-red-500",children:(ur,On)=>{et();var vr=Nt("Not available");C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)};le(je,yt=>{p(o)?.default_generation_settings?.n_ctx?yt(He):yt(at,!1)})}var st=te(je,2);{var dt=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=Qye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium",children:(ur,On)=>{et();var vr=Nt("Training Context");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{children:(ur,On)=>{et();var vr=Nt();we(Ln=>qe(vr,`${Ln??""} tokens`),[()=>m_(p(B).n_ctx_train)]),C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)};le(st,yt=>{p(B)?.n_ctx_train&&yt(dt)})}var Ae=te(st,2);{var Le=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=Xye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium",children:(ur,On)=>{et();var vr=Nt("Model Size");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{children:(ur,On)=>{et();var vr=Nt();we(Ln=>qe(vr,Ln),[()=>pb(p(B).size)]),C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)};le(Ae,yt=>{p(B)?.size&&yt(Le)})}var ht=tLine truncated
|
||||
}</style> <!> <div class="space-y-6 py-4"><!></div>`,1);function t$(t,e){ye(e,!0);let r=V(e,"open",15),n=V(e,"modelId",3,null),a=F(()=>Qn.isRouterMode),i=_e(null),s=_e(!1),o=F(()=>p(a)&&n()?p(i):Qn.props),l=F(()=>p(a)&&n()?n():ar.singleModelName),c=F(ao),u=F(Px),d=F(()=>p(a)&&n()?p(c).find(g=>g.model===n())??null:p(c)[0]??null),h=F(()=>p(d)?.id?ar.getModelModalitiesArray(p(d).id):[]);It(()=>{r()&&p(c).length===0&&ar.fetch()}),It(()=>{r()&&p(a)&&n()&&(k(s,!0),ar.fetchModelProps(n()).then(g=>{k(i,g,!0)}).catch(()=>{k(i,null)}).finally(()=>{k(s,!1)})),r()||k(i,null)});var m=se(),f=L(m);fe(f,()=>Eh,(g,b)=>{b(g,{get onOpenChange(){return e.onOpenChange},get open(){return r()},set open(_){r(_)},children:(_,S)=>{var E=se(),y=L(E);fe(y,()=>Sh,(v,T)=>{T(v,{class:"@container z-9999 !max-h-[80dvh] !max-w-[60rem] max-w-full",children:(w,A)=>{var I=dTe(),x=te(L(I),2);fe(x,()=>om,(K,z)=>{z(K,{children:(re,W)=>{var ie=zye(),M=L(ie);fe(M,()=>sm,(J,N)=>{N(J,{children:(O,U)=>{et();var X=Nt("Model Information");C(O,X)},$$slots:{default:!0}})});var B=te(M,2);fe(B,()=>lm,(J,N)=>{N(J,{children:(O,U)=>{et();var X=Nt("Current model details and capabilities");C(O,X)},$$slots:{default:!0}})}),C(re,ie)},$$slots:{default:!0}})});var D=te(x,2),$=j(D);{var H=K=>{var z=$ye();C(K,z)},G=K=>{var z=se(),re=L(z);{var W=M=>{const B=F(()=>p(d).meta);var J=se(),N=L(J);{var O=U=>{var X=se(),ne=L(X);fe(ne,()=>kye,(ue,he)=>{he(ue,{children:(be,Z)=>{var ae=cTe(),pe=L(ae);fe(pe,()=>Gye,(Ee,Ce)=>{Ce(Ee,{children:(Ne,Ie)=>{var Ue=se(),Fe=L(Ue);fe(Fe,()=>bs,(je,He)=>{He(je,{children:(at,st)=>{var dt=Yye(),Ae=L(dt);fe(Ae,()=>W7,(ht,ze)=>{ze(ht,{class:"w-[10rem]",children:(ft,At)=>{et();var Rt=Nt("Model");C(ft,Rt)},$$slots:{default:!0}})});var Le=te(Ae,2);fe(Le,()=>W7,(ht,ze)=>{ze(ht,{children:(ft,At)=>{var Rt=Hye(),zt=j(Rt);ms(zt,"",{},{"--threshold":"12rem"});var ir=j(zt,!0);Y(zt);var hr=te(zt,2);{let lt=F(()=>p(l)||""),Ot=F(()=>!!p(l));Fp(hr,{get text(){return p(lt)},get canCopy(){return p(Ot)},ariaLabel:"Copy model name to clipboard"})}Y(Rt),we(()=>qe(ir,p(l))),C(ft,Rt)},$$slots:{default:!0}})}),C(at,dt)},$$slots:{default:!0}})}),C(Ne,Ue)},$$slots:{default:!0}})});var me=te(pe,2);fe(me,()=>Lye,(Ee,Ce)=>{Ce(Ee,{children:(Ne,Ie)=>{var Ue=lTe(),Fe=L(Ue);fe(Fe,()=>bs,(yt,xt)=>{xt(yt,{children:(Re,Xe)=>{var pt=Wye(),Ct=L(pt);fe(Ct,()=>sa,(kt,bt)=>{bt(kt,{class:"h-10 align-middle font-medium",children:(Tt,St)=>{et();var Dt=Nt("File Path");C(Tt,Dt)},$$slots:{default:!0}})});var Pt=te(Ct,2);fe(Pt,()=>sa,(kt,bt)=>{bt(kt,{class:"inline-flex h-10 items-center gap-2 align-middle font-mono text-xs",children:(Tt,St)=>{var Dt=Vye(),ur=L(Dt);ms(ur,"",{},{"--threshold":"14rem"});var On=j(ur,!0);Y(ur);var vr=te(ur,2);Fp(vr,{get text(){return p(o).model_path},ariaLabel:"Copy model path to clipboard"}),we(()=>qe(On,p(o).model_path)),C(Tt,Dt)},$$slots:{default:!0}})}),C(Re,pt)},$$slots:{default:!0}})});var je=te(Fe,2);{var He=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=Kye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium",children:(ur,On)=>{et();var vr=Nt("Context Size");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{children:(ur,On)=>{et();var vr=Nt();we(Ln=>qe(vr,`${Ln??""} tokens`),[()=>m_(p(o).default_generation_settings.n_ctx)]),C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)},at=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=jye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium text-red-500",children:(ur,On)=>{et();var vr=Nt("Context Size");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{class:"text-red-500",children:(ur,On)=>{et();var vr=Nt("Not available");C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)};le(je,yt=>{p(o)?.default_generation_settings?.n_ctx?yt(He):yt(at,!1)})}var st=te(je,2);{var dt=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=Qye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium",children:(ur,On)=>{et();var vr=Nt("Training Context");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{children:(ur,On)=>{et();var vr=Nt();we(Ln=>qe(vr,`${Ln??""} tokens`),[()=>m_(p(B).n_ctx_train)]),C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)};le(st,yt=>{p(B)?.n_ctx_train&&yt(dt)})}var Ae=te(st,2);{var Le=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=Xye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium",children:(ur,On)=>{et();var vr=Nt("Model Size");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{children:(ur,On)=>{et();var vr=Nt();we(Ln=>qe(vr,Ln),[()=>mb(p(B).size)]),C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)};le(Ae,yt=>{p(B)?.size&&yt(Le)})}var ht=tLine truncated
|
||||
transform: ${c} translate(${(1-g)*d}${h}, ${(1-g)*m}${f});
|
||||
opacity: ${l-u*b}`}}function Swe(t,{delay:e=0,duration:r=400,easing:n=Kx,axis:a="y"}={}){const i=getComputedStyle(t),s=+i.opacity,o=a==="y"?"height":"width",l=parseFloat(i[o]),c=a==="y"?["top","bottom"]:["left","right"],u=c.map(_=>`${_[0].toUpperCase()}${_.slice(1)}`),d=parseFloat(i[`padding${u[0]}`]),h=parseFloat(i[`padding${u[1]}`]),m=parseFloat(i[`margin${u[0]}`]),f=parseFloat(i[`margin${u[1]}`]),g=parseFloat(i[`border${u[0]}Width`]),b=parseFloat(i[`border${u[1]}Width`]);return{delay:e,duration:r,easing:n,css:_=>`overflow: hidden;opacity: ${Math.min(_*20,1)*s};${o}: ${_*l}px;padding-${c[0]}: ${_*d}px;padding-${c[1]}: ${_*h}px;margin-${c[0]}: ${_*m}px;margin-${c[1]}: ${_*f}px;border-${c[0]}-width: ${_*g}px;border-${c[1]}-width: ${_*b}px;min-${o}: 0`}}function X7(t,{delay:e=0,duration:r=400,easing:n=Kx,start:a=0,opacity:i=0}={}){const s=getComputedStyle(t),o=+s.opacity,l=s.transform==="none"?"":s.transform,c=1-a,u=o*(1-i);return{delay:e,duration:r,easing:n,css:(d,h)=>`
|
||||
transform: ${l} scale(${1-c*h});
|
||||
opacity: ${o-u*h}
|
||||
`}}var Ewe=q("<input/>"),vwe=q("<input/>");function ml(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=V(e,"value",15),a=V(e,"files",15),i=Ve(e,["$$slots","$$events","$$legacy","ref","value","type","files","class"]);var s=se(),o=L(s);{var l=u=>{var d=Ewe();$t(d,h=>({"data-slot":"input",class:h,type:"file",...i}),[()=>jt("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),mr(d,h=>r(h),()=>r()),cK(d,a),bf(d,n),C(u,d)},c=u=>{var d=vwe();$t(d,h=>({"data-slot":"input",class:h,style:"backdrop-filter: blur(0.5rem);",type:e.type,...i}),[()=>jt("flex h-9 w-full min-w-0 rounded-md border border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),mr(d,h=>r(h),()=>r()),bf(d,n),C(u,d)};le(o,u=>{e.type==="file"?u(l):u(c,!1)})}C(t,s),Te()}function rl(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));fe(i,()=>dte,(o,l)=>{l(o,ot({"data-slot":"label",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}var ywe=q('<span class="text-destructive">*</span>'),Twe=q('<span class="text-xs text-muted-foreground/50">...</span>'),Cwe=q("<span> <!></span> <!>",1),wwe=q('<button type="button"> </button>'),Awe=q('<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-lg"></div>'),Rwe=q('<div class="relative grid gap-1"><!> <!> <!></div>');function Owe(t,e){ye(e,!0);let r=V(e,"value",3,""),n=V(e,"suggestions",19,()=>[]),a=V(e,"isLoadingSuggestions",3,!1),i=V(e,"isAutocompleteActive",3,!1),s=V(e,"autocompleteIndex",3,0);var o=Rwe(),l=j(o);rl(l,{get for(){return`arg-${e.argument.name??""}`},class:"mb-1 text-muted-foreground",children:(h,m)=>{var f=Cwe(),g=L(f),b=j(g),_=te(b);{var S=v=>{var T=ywe();C(v,T)};le(_,v=>{e.argument.required&&v(S)})}Y(g);var E=te(g,2);{var y=v=>{var T=Twe();C(v,T)};le(E,v=>{a()&&v(y)})}we(()=>qe(b,`${e.argument.name??""} `)),C(h,f)},$$slots:{default:!0}});var c=te(l,2);{let h=F(()=>e.argument.description||e.argument.name);ml(c,{get id(){return`arg-${e.argument.name??""}`},type:"text",get value(){return r()},oninput:m=>e.onInput(m.currentTarget.value),get onkeydown(){return e.onKeydown},get onblur(){return e.onBlur},get onfocus(){return e.onFocus},get placeholder(){return p(h)},get required(){return e.argument.required},autocomplete:"off"})}var u=te(c,2);{var d=h=>{var m=Awe();xr(m,22,n,f=>f,(f,g,b)=>{var _=wwe();_.__mousedown=()=>e.onSelectSuggestion(g);var S=j(_,!0);Y(_),we(()=>{Et(_,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-accent ${p(b)===s()?"bg-accent":""}`),qe(S,g)}),C(f,_)}),Y(m),li(3,m,()=>el,()=>({y:-5,duration:100})),C(h,m)};le(u,h=>{i()&&n().length>0&&h(d)})}Y(o),C(t,o),Te()}Bn(["mousedown"]);var Nwe=q('<div class="flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive" role="alert"><span class="shrink-0">⚠</span> <span> </span></div>'),Iwe=q('<form class="space-y-3 pt-4"><!> <!> <div class="mt-8 flex justify-end gap-2"><!> <!></div></form>');function xwe(t,e){ye(e,!0);var r=Iwe(),n=j(r);xr(n,17,()=>e.prompt.arguments??[],c=>c.name,(c,u)=>{{let d=F(()=>e.promptArgs[p(u).name]??""),h=F(()=>e.suggestions[p(u).name]??[]),m=F(()=>e.loadingSuggestions[p(u).name]??!1),f=F(()=>e.activeAutocomplete===p(u).name),g=F(()=>e.activeAutocomplete===p(u).name?e.autocompleteIndex:0);Owe(c,{get argument(){return p(u)},get value(){return p(d)},get suggestions(){return p(h)},get isLoadingSuggestions(){return p(m)},get isAutocompleteActive(){return p(f)},get autocompleteIndex(){return p(g)},onInput:b=>e.onArgInput(p(u).name,b),onKeydown:b=>e.onArgKeydown(b,p(u).name),onBlur:()=>e.onArgBlur(p(u).name),onFocus:()=>e.onArgFocus(p(u).name),onSelectSuggestion:b=>e.onSelectSuggestion(p(u).name,b)})}});var a=te
Line truncated
|
||||
`)&&k(o,!0);const E=new ResizeObserver(y=>{for(const v of y){const T=v.target;k(o,T.offsetHeight>24*1.5),k(u,T.scrollHeight,!0)}});return E.observe(p(l)),()=>{E.disconnect()}});function f(){k(c,!p(c))}var g=FRe(),b=j(g);{var _=E=>{var y=ORe(),v=j(y);Qf(v),v.__keydown=s,v.__input=I=>i.setContent(I.currentTarget.value),mr(v,I=>a(I),()=>a());var T=te(v,2),w=j(T);Dr(w,{class:"h-8 px-3",get onclick(){return i.cancel},size:"sm",variant:"outline",children:(I,x)=>{var D=ARe(),$=L(D);Xl($,{class:"mr-1 h-3 w-3"}),et(),C(I,D)},$$slots:{default:!0}});var A=te(w,2);{let I=F(()=>!i.editedContent.trim());Dr(A,{class:"h-8 px-3",get onclick(){return i.save},get disabled(){return p(I)},size:"sm",children:(x,D)=>{var $=RRe(),H=L($);US(H,{class:"mr-1 h-3 w-3"}),et(),C(x,$)},$$slots:{default:!0}})}Y(T),Y(y),we(()=>{pO(v,i.editedContent),Et(v,1,`min-h-[60px] w-full resize-none rounded-2xl px-3 py-2 text-sm ${OI??""}`)}),C(E,y)},S=E=>{var y=LRe(),v=L(y);{var T=I=>{var x=kRe(),D=j(x);D.__click=function(...H){(p(m)&&!p(c)?f:void 0)?.apply(this,H)};var $=j(D);{let H=F(()=>p(o)?"":void 0);Pc($,{class:"overflow-y-auto rounded-[1.125rem] !border-2 !border-dashed !border-border/50 bg-muted px-3.75 py-1.5 data-[multiline]:py-2.5",get"data-multiline"(){return p(H)},style:"border: 2px dashed hsl(var(--border)); max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:(G,K)=>{var z=MRe(),re=L(z),W=j(re);{var ie=U=>{var X=NRe(),ne=j(X);k3(ne,{class:"markdown-system-content -my-4",get content(){return e.message.content}}),Y(X),mr(X,ue=>k(l,ue),()=>p(l)),we(()=>Et(X,1,Hr(p(c)?"cursor-text":""))),C(U,X)},M=U=>{var X=IRe(),ne=j(X,!0);Y(X),mr(X,ue=>k(l,ue),()=>p(l)),we(()=>{Et(X,1,`text-md whitespace-pre-wrap ${p(c)?"cursor-text":""}`),qe(ne,e.message.content)}),C(U,X)};le(W,U=>{h.renderUserContentAsMarkdown?U(ie):U(M,!1)})}var B=te(W,2);{var J=U=>{var X=xRe(),ne=te(L(X),2),ue=j(ne);Dr(ue,{class:"rounded-full px-4 py-1.5 text-xs shadow-md",size:"sm",variant:"outline",children:(he,be)=>{et();var Z=Nt("Show full system message");C(he,Z)},$$slots:{default:!0}}),Y(ne),C(U,X)};le(B,U=>{!p(c)&&p(m)&&U(J)})}Y(re);var N=te(re,2);{var O=U=>{var X=DRe(),ne=j(X);Dr(ne,{class:"rounded-full px-4 py-1.5 text-xs",onclick:ue=>{ue.stopPropagation(),f()},size:"sm",variant:"outline",children:(ue,he)=>{et();var be=Nt("Collapse System Message");C(ue,be)},$$slots:{default:!0}}),Y(X),C(U,X)};le(N,U=>{p(c)&&p(m)&&U(O)})}we(()=>{Et(re,1,`relative transition-all duration-300 ${p(c)?"cursor-text select-text":"select-none"}`),ms(re,!p(c)&&p(m)?`max-height: ${d}px;`:"max-height: none;")}),C(G,z)},$$slots:{default:!0}})}Y(D),Y(x),we(()=>Et(D,1,`group/expand w-full text-left ${!p(c)&&p(m)?"cursor-pointer":"cursor-auto"}`)),C(I,x)};le(v,I=>{e.message.content.trim()&&I(T)})}var w=te(v,2);{var A=I=>{var x=PRe(),D=j(x);yE(D,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return tr.USER}}),Y(x),C(I,x)};le(w,I=>{e.message.timestamp&&I(A)})}C(E,y)};le(b,E=>{i.isEditing?E(_):E(S,!1)})}Y(g),we(()=>Et(g,1,`group flex flex-col items-end gap-3 md:gap-2 ${r()??""}`)),C(t,g),Te()}Bn(["keydown","input","click"]);var URe=q('<div class="flex items-center gap-2"><!> <label for="save-only-switch" class="cursor-pointer text-xs text-muted-foreground">Update without re-sending</label></div>'),GRe=q("<div></div>"),qRe=q("<!> Cancel",1),zRe=q('<div class="relative w-full max-w-[80%]"><!></div> <div class="mt-2 flex w-full max-w-[80%] items-center justify-between"><!> <!></div> <!>',1);function p$(t,e){ye(e,!0);const r=Ig();let n=_e(void 0),a=_e(!1),i=_e(!1),s=F(()=>!!(r.editedContent!==r.originalContent||r.editedUploadedFiles.length>0||r.editedExtras.length!==r.originalExtras.length||r.editedExtras.some((x,D)=>x!==r.originalExtras[D]))),o=F(()=>r.editedExtras&&r.editedExtras.length>0||r.editedUploadedFiles&&r.editedUploadedFiles.length>0),l=F(()=>r.editedContent.trim().length>0||p(o));function c(I){I.key===Cn.ESCAPE&&(I.preventDefault(),u())}function u(){p(s)?k(i,!0):r.cancel()}function d(){p(l)&&(p(a)&&r.showSaveOnlyOption?r.saveOnly():r.save(),k(a,!1))}function h(I){const x=[...r.editedExtras];x.splice(I,1),r.setExtras(x)}function m(I){const x=r.editedUploadedFiles.filter(D=>D.id!==I);r.setUploadedFiles(x)}async function f(I){const x=await Xz(I);r.setUploadedFiles([...r.editedUploadedFiles,...x])}function g(I){r.setUploadedFiles(I)}It(()=>(pn.setEditModeActive(f),()=>{pn.clearEditMode()}));var b=zRe();hn("keydown",Rp,c);var _=L(b),S=j(_);mr(r$(S,{get value(){return r.editedContent},get attachments(){return r.editedExtras},get uploadedFiles(){return r.editedUploadedFiles},place
Line truncated
|
||||
`)){k(i,!0);return}const h=new ResizeObserver(m=>{for(const f of m){const g=f.target;k(i,g.offsetHeight>24*1.5)}});return h.observe(p(s)),()=>{h.disconnect()}});var l=KRe(),c=j(l);{var u=h=>{p$(h,{})},d=h=>{var m=WRe(),f=L(m);{var g=y=>{var v=$Re(),T=j(v);AG(T,{get attachments(){return e.message.extra},readonly:!0,imageHeight:"h-80"}),Y(v),C(y,v)};le(f,y=>{e.message.extra&&e.message.extra.length>0&&y(g)})}var b=te(f,2);{var _=y=>{{let v=F(()=>p(i)?"":void 0);Pc(y,{class:"max-w-[80%] overflow-y-auto rounded-[1.125rem] border-none bg-primary/5 px-3.75 py-1.5 text-foreground backdrop-blur-md data-[multiline]:py-2.5 dark:bg-primary/15",get"data-multiline"(){return p(v)},style:"max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:(T,w)=>{var A=se(),I=L(A);{var x=$=>{var H=HRe(),G=j(H);k3(G,{class:"markdown-user-content -my-4",get content(){return e.message.content}}),Y(H),mr(H,K=>k(s,K),()=>p(s)),C($,H)},D=$=>{var H=YRe(),G=j(H,!0);Y(H),mr(H,K=>k(s,K),()=>p(s)),we(()=>qe(G,e.message.content)),C($,H)};le(I,$=>{o.renderUserContentAsMarkdown?$(x):$(D,!1)})}C(T,A)},$$slots:{default:!0}})}};le(b,y=>{e.message.content.trim()&&y(_)})}var S=te(b,2);{var E=y=>{var v=VRe(),T=j(v);yE(T,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onForkConversation(){return e.onForkConversation},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return tr.USER}}),Y(v),C(y,v)};le(S,y=>{e.message.timestamp&&y(E)})}C(h,m)};le(c,h=>{a.isEditing?h(u):h(d,!1)})}Y(l),we(()=>Et(l,1,`group flex flex-col items-end gap-3 md:gap-2 ${r()??""}`)),C(t,l),Te()}function m$(){let t=_e(!1),e=_e(null),r=_e(null);const n=F(()=>p(t)?zTe():p(e));It(()=>{p(n)&&p(t)&&k(e,p(n),!0)}),It(()=>{if(p(n)?.promptProgress){const{processed:f,total:g,time_ms:b,cache:_}=p(n).promptProgress,S=f-_,E=g-_;if(S>0&&b>0){const y=S/(b/1e3);k(r,{tokensProcessed:S,totalTokens:E,timeMs:b,tokensPerSecond:y},!0)}}});function a(f,g,b){const _=b/1e3;return f===0||_<.5?void 0:_*(g/f-1)}function i(){p(t)||k(t,!0)}function s(){if(!p(t))return;k(t,!1),An().keepStatsVisible||(k(e,null),k(r,null))}function o(){if(!p(n))return"Processing...";switch(p(n).status){case"initializing":return"Initializing...";case"preparing":return p(n).progressPercent!==void 0?`Processing (${p(n).progressPercent}%)`:"Preparing response...";case"generating":return"";default:return"Processing..."}}function l(){const f=p(n)||p(e);if(!f)return[];const g=[];if(f.promptProgress){const{processed:b,total:_,time_ms:S,cache:E}=f.promptProgress,y=b-E,v=_-E;if(y<v&&y>0){const T=Math.round(y/v*100),w=a(y,v,S);if(w!==void 0){const A=Math.ceil(w);g.push(`Processing ${T}% (ETA: ${A}s)`)}else g.push(`Processing ${T}%`)}}if(typeof f.contextTotal=="number"&&f.contextUsed>=0&&f.contextTotal>0){const b=Math.round(f.contextUsed/f.contextTotal*100);g.push(`Context: ${f.contextUsed}/${f.contextTotal} (${b}%)`)}if(f.outputTokensUsed>0)if(f.outputTokensMax<=0)g.push(`Output: ${f.outputTokensUsed}/∞`);else{const b=Math.round(f.outputTokensUsed/f.outputTokensMax*100);g.push(`Output: ${f.outputTokensUsed}/${f.outputTokensMax} (${b}%)`)}return f.tokensPerSecond&&f.tokensPerSecond>0&&g.push(`${f.tokensPerSecond.toFixed(1)} ${w5.TOKENS_PER_SECOND}`),f.speculative&&g.push("Speculative decoding enabled"),g}function c(){const f=p(n)||p(e);if(!f)return[];const g=[];if(typeof f.contextTotal=="number"&&f.contextUsed>=0&&f.contextTotal>0){const b=Math.round(f.contextUsed/f.contextTotal*100);g.push(`Context: ${f.contextUsed}/${f.contextTotal} (${b}%)`)}if(f.outputTokensUsed>0)if(f.outputTokensMax<=0)g.push(`Output: ${f.outputTokensUsed}/∞`);else{const b=Math.round(f.outputTokensUsed/f.outputTokensMax*100);g.push(`Output: ${f.outputTokensUsed}/${f.outputTokensMax} (${b}%)`)}return f.tokensPerSecond&&f.tokensPerSecond>0&&g.push(`${f.tokensPerSecond.toFixed(1)} ${w5.TOKENS_PER_SECOND}`),f.speculative&&g.push("Speculative decoding enabled"),g}function u(){return p(n)!==null&&p(n).status!=="idle"}function d(){if(!p(n)?.promptProgress)return null;const{processed:f,total:g,cache:b}=p(n).promptProgress,_=f-b,S=g-b,E=Math.round(_/S*100),y=a(_,S,p(n).promptProgress.time_ms);if(y!==void 0){const v=Math.ceil(y);return`Processing ${E}% (ETA: ${v}s)`}return`Processing ${E}%`}function h(){if(p(n)?.promptProgress){const{processed:f,total:g,time_ms:b,cache:_}=p(n).promptProgress,S=f-_,E=g-_;if(S>0&&b>0){const y=S/(b/1e3);return{tokensProcessed:S,totalTokens:E,timeMs:b,tokensPerSecond:y}}}return p(r)}function m(){if(!p(n))return null;const{tokensDecoded:f,tokensPerSecond:g}=p(n);if(f<=0)return null;const b=g&&g>0?f/g*1e3:0;return{tokensGenerated:f,timeMs:b,tokensPerSecond:g||0}}return{get
Line truncated
|
||||
`}}var Ewe=q("<input/>"),vwe=q("<input/>");function fl(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=V(e,"value",15),a=V(e,"files",15),i=Ve(e,["$$slots","$$events","$$legacy","ref","value","type","files","class"]);var s=se(),o=L(s);{var l=u=>{var d=Ewe();$t(d,h=>({"data-slot":"input",class:h,type:"file",...i}),[()=>jt("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),mr(d,h=>r(h),()=>r()),cK(d,a),bf(d,n),C(u,d)},c=u=>{var d=vwe();$t(d,h=>({"data-slot":"input",class:h,style:"backdrop-filter: blur(0.5rem);",type:e.type,...i}),[()=>jt("flex h-9 w-full min-w-0 rounded-md border border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),mr(d,h=>r(h),()=>r()),bf(d,n),C(u,d)};le(o,u=>{e.type==="file"?u(l):u(c,!1)})}C(t,s),Te()}function nl(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));fe(i,()=>dte,(o,l)=>{l(o,ot({"data-slot":"label",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}var ywe=q('<span class="text-destructive">*</span>'),Twe=q('<span class="text-xs text-muted-foreground/50">...</span>'),Cwe=q("<span> <!></span> <!>",1),wwe=q('<button type="button"> </button>'),Awe=q('<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-lg"></div>'),Rwe=q('<div class="relative grid gap-1"><!> <!> <!></div>');function Owe(t,e){ye(e,!0);let r=V(e,"value",3,""),n=V(e,"suggestions",19,()=>[]),a=V(e,"isLoadingSuggestions",3,!1),i=V(e,"isAutocompleteActive",3,!1),s=V(e,"autocompleteIndex",3,0);var o=Rwe(),l=j(o);nl(l,{get for(){return`arg-${e.argument.name??""}`},class:"mb-1 text-muted-foreground",children:(h,m)=>{var f=Cwe(),g=L(f),b=j(g),_=te(b);{var S=v=>{var T=ywe();C(v,T)};le(_,v=>{e.argument.required&&v(S)})}Y(g);var E=te(g,2);{var y=v=>{var T=Twe();C(v,T)};le(E,v=>{a()&&v(y)})}we(()=>qe(b,`${e.argument.name??""} `)),C(h,f)},$$slots:{default:!0}});var c=te(l,2);{let h=F(()=>e.argument.description||e.argument.name);fl(c,{get id(){return`arg-${e.argument.name??""}`},type:"text",get value(){return r()},oninput:m=>e.onInput(m.currentTarget.value),get onkeydown(){return e.onKeydown},get onblur(){return e.onBlur},get onfocus(){return e.onFocus},get placeholder(){return p(h)},get required(){return e.argument.required},autocomplete:"off"})}var u=te(c,2);{var d=h=>{var m=Awe();xr(m,22,n,f=>f,(f,g,b)=>{var _=wwe();_.__mousedown=()=>e.onSelectSuggestion(g);var S=j(_,!0);Y(_),we(()=>{Et(_,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-accent ${p(b)===s()?"bg-accent":""}`),qe(S,g)}),C(f,_)}),Y(m),ci(3,m,()=>tl,()=>({y:-5,duration:100})),C(h,m)};le(u,h=>{i()&&n().length>0&&h(d)})}Y(o),C(t,o),Te()}Bn(["mousedown"]);var Nwe=q('<div class="flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive" role="alert"><span class="shrink-0">⚠</span> <span> </span></div>'),Iwe=q('<form class="space-y-3 pt-4"><!> <!> <div class="mt-8 flex justify-end gap-2"><!> <!></div></form>');function xwe(t,e){ye(e,!0);var r=Iwe(),n=j(r);xr(n,17,()=>e.prompt.arguments??[],c=>c.name,(c,u)=>{{let d=F(()=>e.promptArgs[p(u).name]??""),h=F(()=>e.suggestions[p(u).name]??[]),m=F(()=>e.loadingSuggestions[p(u).name]??!1),f=F(()=>e.activeAutocomplete===p(u).name),g=F(()=>e.activeAutocomplete===p(u).name?e.autocompleteIndex:0);Owe(c,{get argument(){return p(u)},get value(){return p(d)},get suggestions(){return p(h)},get isLoadingSuggestions(){return p(m)},get isAutocompleteActive(){return p(f)},get autocompleteIndex(){return p(g)},onInput:b=>e.onArgInput(p(u).name,b),onKeydown:b=>e.onArgKeydown(b,p(u).name),onBlur:()=>e.onArgBlur(p(u).name),onFocus:()=>e.onArgFocus(p(u).name),onSelectSuggestion:b=>e.onSelectSuggestion(p(u).name,b)})}});var a=te
Line truncated
|
||||
`)&&k(o,!0);const E=new ResizeObserver(y=>{for(const v of y){const T=v.target;k(o,T.offsetHeight>24*1.5),k(u,T.scrollHeight,!0)}});return E.observe(p(l)),()=>{E.disconnect()}});function f(){k(c,!p(c))}var g=FRe(),b=j(g);{var _=E=>{var y=ORe(),v=j(y);Qf(v),v.__keydown=s,v.__input=I=>i.setContent(I.currentTarget.value),mr(v,I=>a(I),()=>a());var T=te(v,2),w=j(T);Dr(w,{class:"h-8 px-3",get onclick(){return i.cancel},size:"sm",variant:"outline",children:(I,x)=>{var D=ARe(),$=L(D);Xl($,{class:"mr-1 h-3 w-3"}),et(),C(I,D)},$$slots:{default:!0}});var A=te(w,2);{let I=F(()=>!i.editedContent.trim());Dr(A,{class:"h-8 px-3",get onclick(){return i.save},get disabled(){return p(I)},size:"sm",children:(x,D)=>{var $=RRe(),H=L($);GS(H,{class:"mr-1 h-3 w-3"}),et(),C(x,$)},$$slots:{default:!0}})}Y(T),Y(y),we(()=>{mO(v,i.editedContent),Et(v,1,`min-h-[60px] w-full resize-none rounded-2xl px-3 py-2 text-sm ${NI??""}`)}),C(E,y)},S=E=>{var y=LRe(),v=L(y);{var T=I=>{var x=kRe(),D=j(x);D.__click=function(...H){(p(m)&&!p(c)?f:void 0)?.apply(this,H)};var $=j(D);{let H=F(()=>p(o)?"":void 0);Pc($,{class:"overflow-y-auto rounded-[1.125rem] !border-2 !border-dashed !border-border/50 bg-muted px-3.75 py-1.5 data-[multiline]:py-2.5",get"data-multiline"(){return p(H)},style:"border: 2px dashed hsl(var(--border)); max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:(G,K)=>{var z=MRe(),re=L(z),W=j(re);{var ie=U=>{var X=NRe(),ne=j(X);k3(ne,{class:"markdown-system-content -my-4",get content(){return e.message.content}}),Y(X),mr(X,ue=>k(l,ue),()=>p(l)),we(()=>Et(X,1,Yr(p(c)?"cursor-text":""))),C(U,X)},M=U=>{var X=IRe(),ne=j(X,!0);Y(X),mr(X,ue=>k(l,ue),()=>p(l)),we(()=>{Et(X,1,`text-md whitespace-pre-wrap ${p(c)?"cursor-text":""}`),qe(ne,e.message.content)}),C(U,X)};le(W,U=>{h.renderUserContentAsMarkdown?U(ie):U(M,!1)})}var B=te(W,2);{var J=U=>{var X=xRe(),ne=te(L(X),2),ue=j(ne);Dr(ue,{class:"rounded-full px-4 py-1.5 text-xs shadow-md",size:"sm",variant:"outline",children:(he,be)=>{et();var Z=Nt("Show full system message");C(he,Z)},$$slots:{default:!0}}),Y(ne),C(U,X)};le(B,U=>{!p(c)&&p(m)&&U(J)})}Y(re);var N=te(re,2);{var O=U=>{var X=DRe(),ne=j(X);Dr(ne,{class:"rounded-full px-4 py-1.5 text-xs",onclick:ue=>{ue.stopPropagation(),f()},size:"sm",variant:"outline",children:(ue,he)=>{et();var be=Nt("Collapse System Message");C(ue,be)},$$slots:{default:!0}}),Y(X),C(U,X)};le(N,U=>{p(c)&&p(m)&&U(O)})}we(()=>{Et(re,1,`relative transition-all duration-300 ${p(c)?"cursor-text select-text":"select-none"}`),ms(re,!p(c)&&p(m)?`max-height: ${d}px;`:"max-height: none;")}),C(G,z)},$$slots:{default:!0}})}Y(D),Y(x),we(()=>Et(D,1,`group/expand w-full text-left ${!p(c)&&p(m)?"cursor-pointer":"cursor-auto"}`)),C(I,x)};le(v,I=>{e.message.content.trim()&&I(T)})}var w=te(v,2);{var A=I=>{var x=PRe(),D=j(x);TE(D,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return Jt.USER}}),Y(x),C(I,x)};le(w,I=>{e.message.timestamp&&I(A)})}C(E,y)};le(b,E=>{i.isEditing?E(_):E(S,!1)})}Y(g),we(()=>Et(g,1,`group flex flex-col items-end gap-3 md:gap-2 ${r()??""}`)),C(t,g),Te()}Bn(["keydown","input","click"]);var URe=q('<div class="flex items-center gap-2"><!> <label for="save-only-switch" class="cursor-pointer text-xs text-muted-foreground">Update without re-sending</label></div>'),GRe=q("<div></div>"),qRe=q("<!> Cancel",1),zRe=q('<div class="relative w-full max-w-[80%]"><!></div> <div class="mt-2 flex w-full max-w-[80%] items-center justify-between"><!> <!></div> <!>',1);function p$(t,e){ye(e,!0);const r=Ig();let n=_e(void 0),a=_e(!1),i=_e(!1),s=F(()=>!!(r.editedContent!==r.originalContent||r.editedUploadedFiles.length>0||r.editedExtras.length!==r.originalExtras.length||r.editedExtras.some((x,D)=>x!==r.originalExtras[D]))),o=F(()=>r.editedExtras&&r.editedExtras.length>0||r.editedUploadedFiles&&r.editedUploadedFiles.length>0),l=F(()=>r.editedContent.trim().length>0||p(o));function c(I){I.key===wn.ESCAPE&&(I.preventDefault(),u())}function u(){p(s)?k(i,!0):r.cancel()}function d(){p(l)&&(p(a)&&r.showSaveOnlyOption?r.saveOnly():r.save(),k(a,!1))}function h(I){const x=[...r.editedExtras];x.splice(I,1),r.setExtras(x)}function m(I){const x=r.editedUploadedFiles.filter(D=>D.id!==I);r.setUploadedFiles(x)}async function f(I){const x=await Xz(I);r.setUploadedFiles([...r.editedUploadedFiles,...x])}function g(I){r.setUploadedFiles(I)}It(()=>(pn.setEditModeActive(f),()=>{pn.clearEditMode()}));var b=zRe();hn("keydown",Rp,c);var _=L(b),S=j(_);mr(r$(S,{get value(){return r.editedContent},get attachments(){return r.editedExtras},get uploadedFiles(){return r.editedUploadedFiles},place
Line truncated
|
||||
`)){k(i,!0);return}const h=new ResizeObserver(m=>{for(const f of m){const g=f.target;k(i,g.offsetHeight>24*1.5)}});return h.observe(p(s)),()=>{h.disconnect()}});var l=KRe(),c=j(l);{var u=h=>{p$(h,{})},d=h=>{var m=WRe(),f=L(m);{var g=y=>{var v=$Re(),T=j(v);AG(T,{get attachments(){return e.message.extra},readonly:!0,imageHeight:"h-80"}),Y(v),C(y,v)};le(f,y=>{e.message.extra&&e.message.extra.length>0&&y(g)})}var b=te(f,2);{var _=y=>{{let v=F(()=>p(i)?"":void 0);Pc(y,{class:"max-w-[80%] overflow-y-auto rounded-[1.125rem] border-none bg-primary/5 px-3.75 py-1.5 text-foreground backdrop-blur-md data-[multiline]:py-2.5 dark:bg-primary/15",get"data-multiline"(){return p(v)},style:"max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:(T,w)=>{var A=se(),I=L(A);{var x=$=>{var H=HRe(),G=j(H);k3(G,{class:"markdown-user-content -my-4",get content(){return e.message.content}}),Y(H),mr(H,K=>k(s,K),()=>p(s)),C($,H)},D=$=>{var H=YRe(),G=j(H,!0);Y(H),mr(H,K=>k(s,K),()=>p(s)),we(()=>qe(G,e.message.content)),C($,H)};le(I,$=>{o.renderUserContentAsMarkdown?$(x):$(D,!1)})}C(T,A)},$$slots:{default:!0}})}};le(b,y=>{e.message.content.trim()&&y(_)})}var S=te(b,2);{var E=y=>{var v=VRe(),T=j(v);TE(T,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onForkConversation(){return e.onForkConversation},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return Jt.USER}}),Y(v),C(y,v)};le(S,y=>{e.message.timestamp&&y(E)})}C(h,m)};le(c,h=>{a.isEditing?h(u):h(d,!1)})}Y(l),we(()=>Et(l,1,`group flex flex-col items-end gap-3 md:gap-2 ${r()??""}`)),C(t,l),Te()}function m$(){let t=_e(!1),e=_e(null),r=_e(null);const n=F(()=>p(t)?zTe():p(e));It(()=>{p(n)&&p(t)&&k(e,p(n),!0)}),It(()=>{if(p(n)?.promptProgress){const{processed:f,total:g,time_ms:b,cache:_}=p(n).promptProgress,S=f-_,E=g-_;if(S>0&&b>0){const y=S/(b/1e3);k(r,{tokensProcessed:S,totalTokens:E,timeMs:b,tokensPerSecond:y},!0)}}});function a(f,g,b){const _=b/1e3;return f===0||_<.5?void 0:_*(g/f-1)}function i(){p(t)||k(t,!0)}function s(){if(!p(t))return;k(t,!1),mn().keepStatsVisible||(k(e,null),k(r,null))}function o(){if(!p(n))return"Processing...";switch(p(n).status){case"initializing":return"Initializing...";case"preparing":return p(n).progressPercent!==void 0?`Processing (${p(n).progressPercent}%)`:"Preparing response...";case"generating":return"";default:return"Processing..."}}function l(){const f=p(n)||p(e);if(!f)return[];const g=[];if(f.promptProgress){const{processed:b,total:_,time_ms:S,cache:E}=f.promptProgress,y=b-E,v=_-E;if(y<v&&y>0){const T=Math.round(y/v*100),w=a(y,v,S);if(w!==void 0){const A=Math.ceil(w);g.push(`Processing ${T}% (ETA: ${A}s)`)}else g.push(`Processing ${T}%`)}}if(typeof f.contextTotal=="number"&&f.contextUsed>=0&&f.contextTotal>0){const b=Math.round(f.contextUsed/f.contextTotal*100);g.push(`Context: ${f.contextUsed}/${f.contextTotal} (${b}%)`)}if(f.outputTokensUsed>0)if(f.outputTokensMax<=0)g.push(`Output: ${f.outputTokensUsed}/∞`);else{const b=Math.round(f.outputTokensUsed/f.outputTokensMax*100);g.push(`Output: ${f.outputTokensUsed}/${f.outputTokensMax} (${b}%)`)}return f.tokensPerSecond&&f.tokensPerSecond>0&&g.push(`${f.tokensPerSecond.toFixed(1)} ${w5.TOKENS_PER_SECOND}`),f.speculative&&g.push("Speculative decoding enabled"),g}function c(){const f=p(n)||p(e);if(!f)return[];const g=[];if(typeof f.contextTotal=="number"&&f.contextUsed>=0&&f.contextTotal>0){const b=Math.round(f.contextUsed/f.contextTotal*100);g.push(`Context: ${f.contextUsed}/${f.contextTotal} (${b}%)`)}if(f.outputTokensUsed>0)if(f.outputTokensMax<=0)g.push(`Output: ${f.outputTokensUsed}/∞`);else{const b=Math.round(f.outputTokensUsed/f.outputTokensMax*100);g.push(`Output: ${f.outputTokensUsed}/${f.outputTokensMax} (${b}%)`)}return f.tokensPerSecond&&f.tokensPerSecond>0&&g.push(`${f.tokensPerSecond.toFixed(1)} ${w5.TOKENS_PER_SECOND}`),f.speculative&&g.push("Speculative decoding enabled"),g}function u(){return p(n)!==null&&p(n).status!=="idle"}function d(){if(!p(n)?.promptProgress)return null;const{processed:f,total:g,cache:b}=p(n).promptProgress,_=f-b,S=g-b,E=Math.round(_/S*100),y=a(_,S,p(n).promptProgress.time_ms);if(y!==void 0){const v=Math.ceil(y);return`Processing ${E}% (ETA: ${v}s)`}return`Processing ${E}%`}function h(){if(p(n)?.promptProgress){const{processed:f,total:g,time_ms:b,cache:_}=p(n).promptProgress,S=f-_,E=g-_;if(S>0&&b>0){const y=S/(b/1e3);return{tokensProcessed:S,totalTokens:E,timeMs:b,tokensPerSecond:y}}}return p(r)}function m(){if(!p(n))return null;const{tokensDecoded:f,tokensPerSecond:g}=p(n);if(f<=0)return null;const b=g&&g>0?f/g*1e3:0;return{tokensGenerated:f,timeMs:b,tokensPerSecond:g||0}}return{get
Line truncated
|
||||
parameters to the values provided by the server's /props endpoint and remove all your custom
|
||||
configurations.`);C(W,M)},$$slots:{default:!0}})}),C(D,H)},$$slots:{default:!0}})});var A=te(w,2);fe(A,()=>sd,(I,x)=>{x(I,{children:(D,$)=>{var H=bOe(),G=L(H);fe(G,()=>Ux,(z,re)=>{re(z,{children:(W,ie)=>{et();var M=Nt("Cancel");C(W,M)},$$slots:{default:!0}})});var K=te(G,2);fe(K,()=>Eh,(z,re)=>{re(z,{onclick:a,children:(W,ie)=>{et();var M=Nt("Reset to Default");C(W,M)},$$slots:{default:!0}})}),C(D,H)},$$slots:{default:!0}})}),C(y,T)},$$slots:{default:!0}})}),C(f,b)},$$slots:{default:!0}})}),C(t,s),Te()}var yOe=q('<span class="absolute right-2 flex size-3.5 items-center justify-center"><!></span> <!>',1);function TOe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","value","label","children"]);var a=se(),i=L(a);{const s=(l,c)=>{let u=()=>c?.().selected,d=()=>c?.().highlighted;var h=yOe(),m=L(h),f=j(m);{var g=E=>{US(E,{class:"size-4"})};le(f,E=>{u()&&E(g)})}Y(m);var b=te(m,2);{var _=E=>{var y=se(),v=L(y);De(v,()=>e.children,()=>({selected:u(),highlighted:d()})),C(E,y)},S=E=>{var y=Nt();we(()=>qe(y,e.label||e.value)),C(E,y)};le(b,E=>{e.children?E(_):E(S,!1)})}C(l,h)};let o=F(()=>jt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e.class));fe(i,()=>Nee,(l,c)=>{c(l,ot({get value(){return e.value},"data-slot":"select-item",get class(){return p(o)}},()=>n,{get ref(){return r()},set ref(u){r(u)},children:s,$$slots:{default:!0}}))})}C(t,a),Te()}function COe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("flex cursor-default items-center justify-center py-1",e.class));fe(i,()=>Fee,(o,l)=>{l(o,ot({"data-slot":"select-scroll-up-button",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)},children:(c,u)=>{mre(c,{class:"size-4"})},$$slots:{default:!0}}))})}C(t,a),Te()}function wOe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("flex cursor-default items-center justify-center py-1",e.class));fe(i,()=>kee,(o,l)=>{l(o,ot({"data-slot":"select-scroll-down-button",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)},children:(c,u)=>{Yc(c,{class:"size-4"})},$$slots:{default:!0}}))})}C(t,a),Te()}var AOe=q("<!> <!> <!>",1);function ROe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=V(e,"sideOffset",3,4),a=Ve(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","portalProps","children"]),i;vi(()=>{const l={passive:!1},c=d=>{if(!r())return;const h=d.target;(!h||!r().contains(h))&&(d.preventDefault(),d.stopPropagation())},u=d=>{if(!r())return;const h=d.target;(!h||!r().contains(h))&&(d.preventDefault(),d.stopPropagation())};return document.addEventListener("wheel",c,l),document.addEventListener("touchmove",u,l),()=>{document.removeEventListener("wheel",c,l),document.removeEventListener("touchmove",u,l)}}),It(()=>{const l=r();if(i?.(),!l)return;const c=d=>{d.stopPropagation()},u=d=>{d.stopPropagation()};l.addEventListener("wheel",c),l.addEventListener("touchmove",u),i=()=>{l.removeEventListener("wheel",c),l.removeEventListener("touchmove",u)}}),_O(()=>{i?.()});var s=se(),o=L(s);fe(o,()=>iu,(l,c)=>{c(l,ot(()=>e.portalProps,{children:(u,d)=>{var h=se(),m=L(h);{let f=F(()=>jt("relative z-[var(--layer-popover,1000000)] max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:translate-y-1 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:-translate-x-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:translate-x-1 data-[side=right]:slide-in-from-left-2 data-[side=top]:-translate-y-1 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e.class));fe(m,()=>Aee,(g,b)=>{b(g,ot({get sideOffset(){return n()},"data-slot":"select-content",get class(){return p(f)}},()=>a,{get ref(){return r()},set ref(_){r(_)},children:(_,S)=>{var E=AOe(),y=L(E);COe(y,{});var v=te(y,2);{let w=F(()=>jt("h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1"));fe(v,()=>xee,(A,I)=>{I(A,{get class(){return p(w)},children:(x,D)=>{var $=se(),H=L($);De(H,()=>e.children??Ge),C(x,$)},$$slots:{default:!0}})})}var T=te(v,2);wOe(T,{}),C(_,E)},$$slots:{default:!0}}))})}C(u,h)},$$slots:{default:!0}}))}),C(t,s),Te()}var OOe=q("<!> <!>",1);function NOe(t,
Line truncated
|
||||
configurations.`);C(W,M)},$$slots:{default:!0}})}),C(D,H)},$$slots:{default:!0}})});var A=te(w,2);fe(A,()=>sd,(I,x)=>{x(I,{children:(D,$)=>{var H=bOe(),G=L(H);fe(G,()=>Ux,(z,re)=>{re(z,{children:(W,ie)=>{et();var M=Nt("Cancel");C(W,M)},$$slots:{default:!0}})});var K=te(G,2);fe(K,()=>vh,(z,re)=>{re(z,{onclick:a,children:(W,ie)=>{et();var M=Nt("Reset to Default");C(W,M)},$$slots:{default:!0}})}),C(D,H)},$$slots:{default:!0}})}),C(y,T)},$$slots:{default:!0}})}),C(f,b)},$$slots:{default:!0}})}),C(t,s),Te()}var yOe=q('<span class="absolute right-2 flex size-3.5 items-center justify-center"><!></span> <!>',1);function TOe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","value","label","children"]);var a=se(),i=L(a);{const s=(l,c)=>{let u=()=>c?.().selected,d=()=>c?.().highlighted;var h=yOe(),m=L(h),f=j(m);{var g=E=>{GS(E,{class:"size-4"})};le(f,E=>{u()&&E(g)})}Y(m);var b=te(m,2);{var _=E=>{var y=se(),v=L(y);De(v,()=>e.children,()=>({selected:u(),highlighted:d()})),C(E,y)},S=E=>{var y=Nt();we(()=>qe(y,e.label||e.value)),C(E,y)};le(b,E=>{e.children?E(_):E(S,!1)})}C(l,h)};let o=F(()=>jt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e.class));fe(i,()=>Nee,(l,c)=>{c(l,ot({get value(){return e.value},"data-slot":"select-item",get class(){return p(o)}},()=>n,{get ref(){return r()},set ref(u){r(u)},children:s,$$slots:{default:!0}}))})}C(t,a),Te()}function COe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("flex cursor-default items-center justify-center py-1",e.class));fe(i,()=>Fee,(o,l)=>{l(o,ot({"data-slot":"select-scroll-up-button",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)},children:(c,u)=>{mre(c,{class:"size-4"})},$$slots:{default:!0}}))})}C(t,a),Te()}function wOe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("flex cursor-default items-center justify-center py-1",e.class));fe(i,()=>kee,(o,l)=>{l(o,ot({"data-slot":"select-scroll-down-button",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)},children:(c,u)=>{Yc(c,{class:"size-4"})},$$slots:{default:!0}}))})}C(t,a),Te()}var AOe=q("<!> <!> <!>",1);function ROe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=V(e,"sideOffset",3,4),a=Ve(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","portalProps","children"]),i;yi(()=>{const l={passive:!1},c=d=>{if(!r())return;const h=d.target;(!h||!r().contains(h))&&(d.preventDefault(),d.stopPropagation())},u=d=>{if(!r())return;const h=d.target;(!h||!r().contains(h))&&(d.preventDefault(),d.stopPropagation())};return document.addEventListener("wheel",c,l),document.addEventListener("touchmove",u,l),()=>{document.removeEventListener("wheel",c,l),document.removeEventListener("touchmove",u,l)}}),It(()=>{const l=r();if(i?.(),!l)return;const c=d=>{d.stopPropagation()},u=d=>{d.stopPropagation()};l.addEventListener("wheel",c),l.addEventListener("touchmove",u),i=()=>{l.removeEventListener("wheel",c),l.removeEventListener("touchmove",u)}}),bO(()=>{i?.()});var s=se(),o=L(s);fe(o,()=>iu,(l,c)=>{c(l,ot(()=>e.portalProps,{children:(u,d)=>{var h=se(),m=L(h);{let f=F(()=>jt("relative z-[var(--layer-popover,1000000)] max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:translate-y-1 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:-translate-x-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:translate-x-1 data-[side=right]:slide-in-from-left-2 data-[side=top]:-translate-y-1 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e.class));fe(m,()=>Aee,(g,b)=>{b(g,ot({get sideOffset(){return n()},"data-slot":"select-content",get class(){return p(f)}},()=>a,{get ref(){return r()},set ref(_){r(_)},children:(_,S)=>{var E=AOe(),y=L(E);COe(y,{});var v=te(y,2);{let w=F(()=>jt("h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1"));fe(v,()=>xee,(A,I)=>{I(A,{get class(){return p(w)},children:(x,D)=>{var $=se(),H=L($);De(H,()=>e.children??Ge),C(x,$)},$$slots:{default:!0}})})}var T=te(v,2);wOe(T,{}),C(_,E)},$$slots:{default:!0}}))})}C(u,h)},$$slots:{default:!0}}))}),C(t,s),Te()}var OOe=q("<!> <!>",1);function NOe(t,
Line truncated
|
||||
conversation history.</p> <!> <!></div> <div class="grid border-t border-border/30 pt-4"><h4 class="mb-2 text-sm font-medium">Import Conversations</h4> <p class="mb-4 text-sm text-muted-foreground">Import one or more conversations from a previously exported JSON file. This will merge with
|
||||
your existing conversations.</p> <!> <!></div> <div class="grid border-t border-border/30 pt-4"><h4 class="mb-2 text-sm font-medium text-destructive">Delete All Conversations</h4> <p class="mb-4 text-sm text-muted-foreground">Permanently delete all conversations and their messages. This action cannot be undone.
|
||||
Consider exporting your conversations first if you want to keep a backup.</p> <!></div></div></div> <!> <!> <!>`,1);function oNe(t,e){ye(e,!0);let r=_e(Tr([])),n=_e(Tr([])),a=_e(!1),i=_e(!1),s=_e(!1),o=_e(!1),l=_e(Tr([])),c=_e(Tr(new Map)),u=_e(Tr([])),d=_e(!1);async function h(){try{const ie=qd();if(ie.length===0){ea.info("No conversations to export");return}const M=await Promise.all(ie.map(async B=>{const J=await rt.getConversationMessages(B.id);return{conv:B,messages:J}}));k(c,s4(M),!0),k(l,ie,!0),k(s,!0)}catch(ie){console.error("Failed to load conversations:",ie),alert("Failed to load conversations")}}async function m(ie){try{const M=await Promise.all(ie.map(async B=>{const J=await rt.getConversationMessages(B.id);return{conv:sp(B),messages:sp(J)}}));rt.downloadConversationFile(M,`${new Date().toISOString().split(nG)[0]}_conversations.json`),k(r,ie,!0),k(a,!0),k(i,!1),k(s,!1)}catch(M){console.error("Export failed:",M),alert("Failed to export conversations")}}async function f(){try{const ie=document.createElement("input");ie.type="file",ie.accept=".json",ie.onchange=async M=>{const B=M.target?.files?.[0];if(B)try{const J=await B.text(),N=JSON.parse(J);let O;if(Array.isArray(N))O=N;else if(N&&typeof N=="object"&&"conv"in N&&"messages"in N)O=[N];else throw new Error("Invalid file format: expected array of conversations or single conversation object");k(u,O,!0),k(l,O.map(U=>U.conv),!0),k(c,s4(O),!0),k(o,!0)}catch(J){const N=J instanceof Error?J.message:"Unknown error";console.error("Failed to parse file:",J),alert(`Failed to parse file: ${N}`)}},ie.click()}catch(ie){console.error("Import failed:",ie),alert("Failed to import conversations")}}async function g(ie){try{const M=new Set(ie.map(J=>J.id)),B=sp(p(u)).filter(J=>M.has(J.conv.id));await rt.importConversationsData(B),k(n,ie,!0),k(i,!0),k(a,!1),k(o,!1)}catch(M){console.error("Import failed:",M),alert("Failed to import conversations. Please check the file format.")}}async function b(){try{if(qd().length===0){ea.info("No conversations to delete");return}k(d,!0)}catch(ie){console.error("Failed to load conversations for deletion:",ie),ea.error("Failed to load conversations")}}async function _(){try{await rt.deleteAll(),k(d,!1)}catch(ie){console.error("Failed to delete conversations:",ie)}}function S(){k(d,!1)}var E=sNe(),y=L(E),v=j(y),T=j(v),w=te(j(T),4);Dr(w,{class:"w-full justify-start justify-self-start md:w-auto",onclick:h,variant:"outline",children:(ie,M)=>{var B=XOe(),J=L(B);GS(J,{class:"mr-2 h-4 w-4"}),et(),C(ie,B)},$$slots:{default:!0}});var A=te(w,2);{var I=ie=>{var M=eNe(),B=j(M),J=j(B);Y(B);var N=te(B,2),O=j(N);xr(O,17,()=>p(r).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=ZOe(),be=j(he);Y(he),we(()=>qe(be,`• ${p(ue).name||"Untitled conversation"}`)),C(ne,he)});var U=te(O,2);{var X=ne=>{var ue=JOe(),he=j(ue);Y(ue),we(()=>qe(he,`... and ${p(r).length-10} more`)),C(ne,ue)};le(U,ne=>{p(r).length>10&&ne(X)})}Y(N),Y(M),we(()=>qe(J,`Exported ${p(r).length??""} conversation${p(r).length===1?"":"s"}`)),C(ie,M)};le(A,ie=>{p(a)&&p(r).length>0&&ie(I)})}Y(T);var x=te(T,2),D=te(j(x),4);Dr(D,{class:"w-full justify-start justify-self-start md:w-auto",onclick:f,variant:"outline",children:(ie,M)=>{var B=tNe(),J=L(B);HU(J,{class:"mr-2 h-4 w-4"}),et(),C(ie,B)},$$slots:{default:!0}});var $=te(D,2);{var H=ie=>{var M=aNe(),B=j(M),J=j(B);Y(B);var N=te(B,2),O=j(N);xr(O,17,()=>p(n).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=rNe(),be=j(he);Y(he),we(()=>qe(be,`• ${p(ue).name||"Untitled conversation"}`)),C(ne,he)});var U=te(O,2);{var X=ne=>{var ue=nNe(),he=j(ue);Y(ue),we(()=>qe(he,`... and ${p(n).length-10} more`)),C(ne,ue)};le(U,ne=>{p(n).length>10&&ne(X)})}Y(N),Y(M),we(()=>qe(J,`Imported ${p(n).length??""} conversation${p(n).length===1?"":"s"}`)),C(ie,M)};le($,ie=>{p(i)&&p(n).length>0&&ie(H)})}Y(x);var G=te(x,2),K=te(j(G),4);Dr(K,{class:"text-destructive-foreground w-full justify-start justify-self-start bg-destructive hover:bg-destructive/80 md:w-auto",onclick:b,variant:"destructive",children:(ie,M)=>{var B=iNe(),J=L(B);Wc(J,{class:"mr-2 h-4 w-4"}),et(),C(ie,B)},$$slots:{default:!0}}),Y(G),Y(v),Y(y);var z=te(y,2);V7(z,{get conversations(){return p(l)},get messageCountMap(){return p(c)},mode:"export",onCancel:()=>k(s,!1),onConfirm:m,get open(){return p(s)},set open(ie){k(s,ie,!0)}});var re=te(z,2);V7(re,{get conversations(){return p(l)},get messageCountMap(){return p(c)},mode:"import",onCancel:()=>k(o,!1),onConfirm:g,get open(){return p(o)},set open(ie){k(o,ie,!0)}});var W=te(re,2);oh(W,{title:"Delete all conversations",description:"Are you sure you want to delete all conversations? This action cannot be undone and will permanently remove all your conversations and messages.",confirmText:"Delete All",cancelText:"Cancel",variant:"destructive",get icon(){return Wc},onConfirm:_,onCancel:S,get open(){return p(d)},set open(ie){k(d,ie,!0)}}),C(t,E),Te()}var lNe=q("<!> Custom",1);function tL(t,e){let r=V(e,"class",3,"");Ns(t,{variant:"secondary",get class(){return`h-5 bg-orange-100Line truncated
|
||||
Consider exporting your conversations first if you want to keep a backup.</p> <!></div></div></div> <!> <!> <!>`,1);function oNe(t,e){ye(e,!0);let r=_e(Tr([])),n=_e(Tr([])),a=_e(!1),i=_e(!1),s=_e(!1),o=_e(!1),l=_e(Tr([])),c=_e(Tr(new Map)),u=_e(Tr([])),d=_e(!1);async function h(){try{const ie=qd();if(ie.length===0){ea.info("No conversations to export");return}const M=await Promise.all(ie.map(async B=>{const J=await rt.getConversationMessages(B.id);return{conv:B,messages:J}}));k(c,s4(M),!0),k(l,ie,!0),k(s,!0)}catch(ie){console.error("Failed to load conversations:",ie),alert("Failed to load conversations")}}async function m(ie){try{const M=await Promise.all(ie.map(async B=>{const J=await rt.getConversationMessages(B.id);return{conv:op(B),messages:op(J)}}));rt.downloadConversationFile(M,`${new Date().toISOString().split(nG)[0]}_conversations.json`),k(r,ie,!0),k(a,!0),k(i,!1),k(s,!1)}catch(M){console.error("Export failed:",M),alert("Failed to export conversations")}}async function f(){try{const ie=document.createElement("input");ie.type="file",ie.accept=".json",ie.onchange=async M=>{const B=M.target?.files?.[0];if(B)try{const J=await B.text(),N=JSON.parse(J);let O;if(Array.isArray(N))O=N;else if(N&&typeof N=="object"&&"conv"in N&&"messages"in N)O=[N];else throw new Error("Invalid file format: expected array of conversations or single conversation object");k(u,O,!0),k(l,O.map(U=>U.conv),!0),k(c,s4(O),!0),k(o,!0)}catch(J){const N=J instanceof Error?J.message:"Unknown error";console.error("Failed to parse file:",J),alert(`Failed to parse file: ${N}`)}},ie.click()}catch(ie){console.error("Import failed:",ie),alert("Failed to import conversations")}}async function g(ie){try{const M=new Set(ie.map(J=>J.id)),B=op(p(u)).filter(J=>M.has(J.conv.id));await rt.importConversationsData(B),k(n,ie,!0),k(i,!0),k(a,!1),k(o,!1)}catch(M){console.error("Import failed:",M),alert("Failed to import conversations. Please check the file format.")}}async function b(){try{if(qd().length===0){ea.info("No conversations to delete");return}k(d,!0)}catch(ie){console.error("Failed to load conversations for deletion:",ie),ea.error("Failed to load conversations")}}async function _(){try{await rt.deleteAll(),k(d,!1)}catch(ie){console.error("Failed to delete conversations:",ie)}}function S(){k(d,!1)}var E=sNe(),y=L(E),v=j(y),T=j(v),w=te(j(T),4);Dr(w,{class:"w-full justify-start justify-self-start md:w-auto",onclick:h,variant:"outline",children:(ie,M)=>{var B=XOe(),J=L(B);qS(J,{class:"mr-2 h-4 w-4"}),et(),C(ie,B)},$$slots:{default:!0}});var A=te(w,2);{var I=ie=>{var M=eNe(),B=j(M),J=j(B);Y(B);var N=te(B,2),O=j(N);xr(O,17,()=>p(r).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=ZOe(),be=j(he);Y(he),we(()=>qe(be,`• ${p(ue).name||"Untitled conversation"}`)),C(ne,he)});var U=te(O,2);{var X=ne=>{var ue=JOe(),he=j(ue);Y(ue),we(()=>qe(he,`... and ${p(r).length-10} more`)),C(ne,ue)};le(U,ne=>{p(r).length>10&&ne(X)})}Y(N),Y(M),we(()=>qe(J,`Exported ${p(r).length??""} conversation${p(r).length===1?"":"s"}`)),C(ie,M)};le(A,ie=>{p(a)&&p(r).length>0&&ie(I)})}Y(T);var x=te(T,2),D=te(j(x),4);Dr(D,{class:"w-full justify-start justify-self-start md:w-auto",onclick:f,variant:"outline",children:(ie,M)=>{var B=tNe(),J=L(B);HU(J,{class:"mr-2 h-4 w-4"}),et(),C(ie,B)},$$slots:{default:!0}});var $=te(D,2);{var H=ie=>{var M=aNe(),B=j(M),J=j(B);Y(B);var N=te(B,2),O=j(N);xr(O,17,()=>p(n).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=rNe(),be=j(he);Y(he),we(()=>qe(be,`• ${p(ue).name||"Untitled conversation"}`)),C(ne,he)});var U=te(O,2);{var X=ne=>{var ue=nNe(),he=j(ue);Y(ue),we(()=>qe(he,`... and ${p(n).length-10} more`)),C(ne,ue)};le(U,ne=>{p(n).length>10&&ne(X)})}Y(N),Y(M),we(()=>qe(J,`Imported ${p(n).length??""} conversation${p(n).length===1?"":"s"}`)),C(ie,M)};le($,ie=>{p(i)&&p(n).length>0&&ie(H)})}Y(x);var G=te(x,2),K=te(j(G),4);Dr(K,{class:"text-destructive-foreground w-full justify-start justify-self-start bg-destructive hover:bg-destructive/80 md:w-auto",onclick:b,variant:"destructive",children:(ie,M)=>{var B=iNe(),J=L(B);Wc(J,{class:"mr-2 h-4 w-4"}),et(),C(ie,B)},$$slots:{default:!0}}),Y(G),Y(v),Y(y);var z=te(y,2);V7(z,{get conversations(){return p(l)},get messageCountMap(){return p(c)},mode:"export",onCancel:()=>k(s,!1),onConfirm:m,get open(){return p(s)},set open(ie){k(s,ie,!0)}});var re=te(z,2);V7(re,{get conversations(){return p(l)},get messageCountMap(){return p(c)},mode:"import",onCancel:()=>k(o,!1),onConfirm:g,get open(){return p(o)},set open(ie){k(o,ie,!0)}});var W=te(re,2);lh(W,{title:"Delete all conversations",description:"Are you sure you want to delete all conversations? This action cannot be undone and will permanently remove all your conversations and messages.",confirmText:"Delete All",cancelText:"Cancel",variant:"destructive",get icon(){return Wc},onConfirm:_,onCancel:S,get open(){return p(d)},set open(ie){k(d,ie,!0)}}),C(t,E),Te()}var lNe=q("<!> Custom",1);function tL(t,e){let r=V(e,"class",3,"");Ns(t,{variant:"secondary",get class(){return`h-5 bg-orange-100Line truncated
|
||||
`;break}case-3:{s=`\r
|
||||
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,n.push(s)}return n.join("")}function wxe(t){const n={constructs:b$([vxe,...(t||{}).extensions||[]]),content:a(GNe),defined:[],document:a(zNe),flow:a(sxe),lazy:{},string:a(cxe),text:a(uxe)};return n;function a(i){return s;function s(o){return yxe(n,i,o)}}}function Axe(t){for(;!T$(t););return t}const dL=/[\0\t\n\r]/g;function Rxe(){let t=1,e="",r=!0,n;return a;function a(i,s,o){const l=[];let c,u,d,h,m;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,e="",r&&(i.charCodeAt(0)===65279&&d++,r=void 0);d<i.length;){if(dL.lastIndex=d,c=dL.exec(i),h=c&&c.index!==void 0?c.index:i.length,m=i.charCodeAt(h),!c){e=i.slice(d);break}if(m===10&&d===h&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<h&&(l.push(i.slice(d,h)),t+=h-d),m){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:n=!0,t=1}d=h+1}return o&&(n&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Oxe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function N$(t){return t.replace(Oxe,Nxe)}function Nxe(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){const a=r.charCodeAt(1),i=a===120||a===88;return S$(r.slice(i?2:1),i?16:10)}return Xx(r)||t}function M1(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?hL(t.position):"start"in t||"end"in t?hL(t):"line"in t||"column"in t?w2(t):""}function w2(t){return pL(t&&t.line)+":"+pL(t&&t.column)}function hL(t){return w2(t&&t.start)+"-"+w2(t&&t.end)}function pL(t){return t&&typeof t=="number"?t:1}const I$={}.hasOwnProperty;function Ixe(t,e,r){return typeof e!="string"&&(r=e,e=void 0),xxe(r)(Axe(wxe(r).document().write(Rxe()(t,e,!0))))}function xxe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ue),autolinkProtocol:I,autolinkEmail:I,atxHeading:i(Ee),blockQuote:i(be),characterEscape:I,characterReference:I,codeFenced:i(Z),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Z,s),codeText:i(ae,s),codeTextData:I,data:I,codeFlowValue:I,definition:i(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(me),hardBreakEscape:i(Ce),hardBreakTrailing:i(Ce),htmlFlow:i(Ne,s),htmlFlowData:I,htmlText:i(Ne,s),htmlTextData:I,image:i(Ie),label:s,link:i(Ue),listItem:i(je),listItemValue:h,listOrdered:i(Fe,d),listUnordered:i(Fe),paragraph:i(He),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Ee),strong:i(at),thematicBreak:i(dt)},exit:{atxHeading:l(),atxHeadingSequence:v,autolink:l(),autolinkEmail:he,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:x,characterReferenceMarkerHexadecimal:U,characterReferenceMarkerNumeric:U,characterReferenceValue:X,characterReference:ne,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:f,codeFlowValue:x,codeIndented:l(_),codeText:l(K),codeTextData:x,data:x,definition:l(),definitionDestinationString:y,definitionLabelString:S,definitionTitleString:E,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(H),htmlFlowData:x,htmlText:l(G),htmlTextData:x,image:l(re),label:ie,labelText:W,lineEnding:D,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:O,resourceDestinationString:M,resourceTitleString:B,resource:J,setextHeading:l(A),setextHeadingLineSequence:w,setextHeadingText:T,strong:l(),thematicBreak:l()}};x$(e,(t||{}).mdastExtensions||[]);const r={};return n;function n(Ae){let Le={type:"root",children:[]};const ht={stack:[Le],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:r},ze=[];let ft=-1;for(;++ft<Ae.length;)if(Ae[ft][1].type==="listOrdered"||Ae[ft][1].type==="listUnordered")if(Ae[ft][0]==="enter")ze.push(ft);else{const At=ze.pop();ft=a(Ae,At,ft)}for(ft=-1;++ft<Ae.length;){const At=e[Ae[ft][0]];I$.call(At,Ae[ft][1].type)&&At[Ae[ft][1].type].call(Object.assign({sliceSerialize:Ae[ft][2].sliceSerialize},ht),Ae[ft][1])}if(ht.tokenStack.length>0){const At=ht.tokenStack[ht.tokenStack.length-1];(At[1]||mL).call(ht,void 0,At[0])}for(Le.position={start:Eu(Ae.length>0?Ae[0][1].start:{line:1,column:1,offset:0}),end:Eu(Ae.length>0?Ae[Ae.length-2][1].end:{line:1,column:1,offset:0})},ft=-1;++ft<e.transforms.length;)Le=e.transforms[ft](Le)||Le;return Le}function a(Ae,Le,ht){let ze=Le-1,ft=-1,At=!1,Rt,zt,ir,hr;for(;++ze<=ht;){const lt=Ae[ze];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?ft++:ft--,hr=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(Rt&&!hr&&!ft&&!ir&&(ir=ze),hr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hr=void 0}if(!ft&<[0]==="enter"&<[1].type==="listItemPrefix"||ft===-1&<[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(RtLine truncated
|
||||
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,n.push(s)}return n.join("")}function wxe(t){const n={constructs:b$([vxe,...(t||{}).extensions||[]]),content:a(GNe),defined:[],document:a(zNe),flow:a(sxe),lazy:{},string:a(cxe),text:a(uxe)};return n;function a(i){return s;function s(o){return yxe(n,i,o)}}}function Axe(t){for(;!T$(t););return t}const dL=/[\0\t\n\r]/g;function Rxe(){let t=1,e="",r=!0,n;return a;function a(i,s,o){const l=[];let c,u,d,h,m;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,e="",r&&(i.charCodeAt(0)===65279&&d++,r=void 0);d<i.length;){if(dL.lastIndex=d,c=dL.exec(i),h=c&&c.index!==void 0?c.index:i.length,m=i.charCodeAt(h),!c){e=i.slice(d);break}if(m===10&&d===h&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<h&&(l.push(i.slice(d,h)),t+=h-d),m){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:n=!0,t=1}d=h+1}return o&&(n&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Oxe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function N$(t){return t.replace(Oxe,Nxe)}function Nxe(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){const a=r.charCodeAt(1),i=a===120||a===88;return S$(r.slice(i?2:1),i?16:10)}return Xx(r)||t}function M1(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?hL(t.position):"start"in t||"end"in t?hL(t):"line"in t||"column"in t?A2(t):""}function A2(t){return pL(t&&t.line)+":"+pL(t&&t.column)}function hL(t){return A2(t&&t.start)+"-"+A2(t&&t.end)}function pL(t){return t&&typeof t=="number"?t:1}const I$={}.hasOwnProperty;function Ixe(t,e,r){return typeof e!="string"&&(r=e,e=void 0),xxe(r)(Axe(wxe(r).document().write(Rxe()(t,e,!0))))}function xxe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ue),autolinkProtocol:I,autolinkEmail:I,atxHeading:i(Ee),blockQuote:i(be),characterEscape:I,characterReference:I,codeFenced:i(Z),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Z,s),codeText:i(ae,s),codeTextData:I,data:I,codeFlowValue:I,definition:i(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(me),hardBreakEscape:i(Ce),hardBreakTrailing:i(Ce),htmlFlow:i(Ne,s),htmlFlowData:I,htmlText:i(Ne,s),htmlTextData:I,image:i(Ie),label:s,link:i(Ue),listItem:i(je),listItemValue:h,listOrdered:i(Fe,d),listUnordered:i(Fe),paragraph:i(He),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Ee),strong:i(at),thematicBreak:i(dt)},exit:{atxHeading:l(),atxHeadingSequence:v,autolink:l(),autolinkEmail:he,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:x,characterReferenceMarkerHexadecimal:U,characterReferenceMarkerNumeric:U,characterReferenceValue:X,characterReference:ne,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:f,codeFlowValue:x,codeIndented:l(_),codeText:l(K),codeTextData:x,data:x,definition:l(),definitionDestinationString:y,definitionLabelString:S,definitionTitleString:E,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(H),htmlFlowData:x,htmlText:l(G),htmlTextData:x,image:l(re),label:ie,labelText:W,lineEnding:D,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:O,resourceDestinationString:M,resourceTitleString:B,resource:J,setextHeading:l(A),setextHeadingLineSequence:w,setextHeadingText:T,strong:l(),thematicBreak:l()}};x$(e,(t||{}).mdastExtensions||[]);const r={};return n;function n(Ae){let Le={type:"root",children:[]};const ht={stack:[Le],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:r},ze=[];let ft=-1;for(;++ft<Ae.length;)if(Ae[ft][1].type==="listOrdered"||Ae[ft][1].type==="listUnordered")if(Ae[ft][0]==="enter")ze.push(ft);else{const At=ze.pop();ft=a(Ae,At,ft)}for(ft=-1;++ft<Ae.length;){const At=e[Ae[ft][0]];I$.call(At,Ae[ft][1].type)&&At[Ae[ft][1].type].call(Object.assign({sliceSerialize:Ae[ft][2].sliceSerialize},ht),Ae[ft][1])}if(ht.tokenStack.length>0){const At=ht.tokenStack[ht.tokenStack.length-1];(At[1]||mL).call(ht,void 0,At[0])}for(Le.position={start:Eu(Ae.length>0?Ae[0][1].start:{line:1,column:1,offset:0}),end:Eu(Ae.length>0?Ae[Ae.length-2][1].end:{line:1,column:1,offset:0})},ft=-1;++ft<e.transforms.length;)Le=e.transforms[ft](Le)||Le;return Le}function a(Ae,Le,ht){let ze=Le-1,ft=-1,At=!1,Rt,zt,ir,hr;for(;++ze<=ht;){const lt=Ae[ze];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?ft++:ft--,hr=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(Rt&&!hr&&!ft&&!ir&&(ir=ze),hr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hr=void 0}if(!ft&<[0]==="enter"&<[1].type==="listItemPrefix"||ft===-1&<[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(RtLine truncated
|
||||
`&&k$(r.stack,r.unsafe[a]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
||||
`}function P$(t,e){const r=String(t);let n=r.indexOf(e),a=n,i=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===a?++i>s&&(s=i):i=1,a=n+e.length,n=r.indexOf(e,a);return s}function A2(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Bxe(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Uxe(t,e,r,n){const a=Bxe(r),i=t.value||"",s=a==="`"?"GraveAccent":"Tilde";if(A2(t,r)){const d=r.enter("codeIndented"),h=r.indentLines(i,Gxe);return d(),h}const o=r.createTracker(n),l=a.repeat(Math.max(P$(i,a)+1,3)),c=r.enter("codeFenced");let u=o.move(l);if(t.lang){const d=r.enter(`codeFencedLang${s}`);u+=o.move(r.safe(t.lang,{before:u,after:" ",encode:["`"],...o.current()})),d()}if(t.lang&&t.meta){const d=r.enter(`codeFencedMeta${s}`);u+=o.move(" "),u+=o.move(r.safe(t.meta,{before:u,after:`
|
||||
`}function P$(t,e){const r=String(t);let n=r.indexOf(e),a=n,i=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===a?++i>s&&(s=i):i=1,a=n+e.length,n=r.indexOf(e,a);return s}function R2(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Bxe(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Uxe(t,e,r,n){const a=Bxe(r),i=t.value||"",s=a==="`"?"GraveAccent":"Tilde";if(R2(t,r)){const d=r.enter("codeIndented"),h=r.indentLines(i,Gxe);return d(),h}const o=r.createTracker(n),l=a.repeat(Math.max(P$(i,a)+1,3)),c=r.enter("codeFenced");let u=o.move(l);if(t.lang){const d=r.enter(`codeFencedLang${s}`);u+=o.move(r.safe(t.lang,{before:u,after:" ",encode:["`"],...o.current()})),d()}if(t.lang&&t.meta){const d=r.enter(`codeFencedMeta${s}`);u+=o.move(" "),u+=o.move(r.safe(t.meta,{before:u,after:`
|
||||
`,encode:["`"],...o.current()})),d()}return u+=o.move(`
|
||||
`),i&&(u+=o.move(i+`
|
||||
`)),u+=o.move(l),c(),u}function Gxe(t,e,r){return(r?"":" ")+t}function Jx(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function qxe(t,e,r,n){const a=Jx(r),i=a==='"'?"Quote":"Apostrophe",s=r.enter("definition");let o=r.enter("label");const l=r.createTracker(n);let c=l.move("[");return c+=l.move(r.safe(r.associationId(t),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=r.enter("destinationRaw"),c+=l.move(r.safe(t.url,{before:c,after:t.title?" ":`
|
||||
`,...l.current()}))),o(),t.title&&(o=r.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(r.safe(t.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),s(),c}function zxe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Wu(t){return"&#x"+t.toString(16).toUpperCase()+";"}function qb(t,e,r){const n=$p(t),a=$p(e);return n===void 0?a===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}L$.peek=$xe;function L$(t,e,r,n){const a=zxe(r),i=r.enter("emphasis"),s=r.createTracker(n),o=s.move(a);let l=s.move(r.containerPhrasing(t,{after:a,before:o,...s.current()}));const c=l.charCodeAt(0),u=qb(n.before.charCodeAt(n.before.length-1),c,a);u.inside&&(l=Wu(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=qb(n.after.charCodeAt(0),d,a);h.inside&&(l=l.slice(0,-1)+Wu(d));const m=s.move(a);return i(),r.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+m}function $xe(t,e,r){return r.options.emphasis||"*"}const Dg=function(t){if(t==null)return Wxe;if(typeof t=="function")return AE(t);if(typeof t=="object")return Array.isArray(t)?Hxe(t):Yxe(t);if(typeof t=="string")return Vxe(t);throw new Error("Expected function, string, or object as test")};function Hxe(t){const e=[];let r=-1;for(;++r<t.length;)e[r]=Dg(t[r]);return AE(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Yxe(t){const e=t;return AE(r);function r(n){const a=n;let i;for(i in t)if(a[i]!==e[i])return!1;return!0}}function Vxe(t){return AE(e);function e(r){return r&&r.type===t}}function AE(t){return e;function e(r,n,a){return!!(Kxe(r)&&t.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function Wxe(){return!0}function Kxe(t){return t!==null&&typeof t=="object"&&"type"in t}const F$=[],jxe=!0,R2=!1,B$="skip";function RE(t,e,r,n){let a;typeof e=="function"&&typeof r!="function"?(n=r,r=e):a=e;const i=Dg(a),s=n?-1:1;o(t,void 0,[])();function o(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=F$,f,g,b;if((!e||i(l,c,u[u.length-1]||void 0))&&(m=Qxe(r(l,u)),m[0]===R2))return m;if("children"in l&&l.children){const _=l;if(_.children&&m[0]!==B$)for(g=(n?_.children.length:-1)+s,b=u.concat(_);g>-1&&g<_.children.length;){const S=_.children[g];if(f=o(S,g,b)(),f[0]===R2)return f;g=typeof f[1]=="number"?f[1]:g+s}}return m}}}function Qxe(t){return Array.isArray(t)?t:typeof t=="number"?[jxe,t]:t==null?F$:[t]}function su(t,e,r,n){let a,i,s;typeof e=="function"&&typeof r!="function"?(i=void 0,s=e,a=r):(i=e,s=r,a=n),RE(t,i,o,a);function o(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}function U$(t,e){let r=!1;return su(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,R2}),!!((!t.depth||t.depth<3)&&Qx(t)&&(e.options.setext||r))}function Xxe(t,e,r,n){const a=Math.max(Math.min(6,t.depth||1),1),i=r.createTracker(n);if(U$(t,r)){const u=r.enter("headingSetext"),d=r.enter("phrasing"),h=r.containerPhrasing(t,{...i.current(),before:`
|
||||
`,...l.current()}))),o(),t.title&&(o=r.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(r.safe(t.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),s(),c}function zxe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Wu(t){return"&#x"+t.toString(16).toUpperCase()+";"}function zb(t,e,r){const n=$p(t),a=$p(e);return n===void 0?a===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}L$.peek=$xe;function L$(t,e,r,n){const a=zxe(r),i=r.enter("emphasis"),s=r.createTracker(n),o=s.move(a);let l=s.move(r.containerPhrasing(t,{after:a,before:o,...s.current()}));const c=l.charCodeAt(0),u=zb(n.before.charCodeAt(n.before.length-1),c,a);u.inside&&(l=Wu(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=zb(n.after.charCodeAt(0),d,a);h.inside&&(l=l.slice(0,-1)+Wu(d));const m=s.move(a);return i(),r.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+m}function $xe(t,e,r){return r.options.emphasis||"*"}const Dg=function(t){if(t==null)return Wxe;if(typeof t=="function")return RE(t);if(typeof t=="object")return Array.isArray(t)?Hxe(t):Yxe(t);if(typeof t=="string")return Vxe(t);throw new Error("Expected function, string, or object as test")};function Hxe(t){const e=[];let r=-1;for(;++r<t.length;)e[r]=Dg(t[r]);return RE(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Yxe(t){const e=t;return RE(r);function r(n){const a=n;let i;for(i in t)if(a[i]!==e[i])return!1;return!0}}function Vxe(t){return RE(e);function e(r){return r&&r.type===t}}function RE(t){return e;function e(r,n,a){return!!(Kxe(r)&&t.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function Wxe(){return!0}function Kxe(t){return t!==null&&typeof t=="object"&&"type"in t}const F$=[],jxe=!0,O2=!1,B$="skip";function OE(t,e,r,n){let a;typeof e=="function"&&typeof r!="function"?(n=r,r=e):a=e;const i=Dg(a),s=n?-1:1;o(t,void 0,[])();function o(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=F$,f,g,b;if((!e||i(l,c,u[u.length-1]||void 0))&&(m=Qxe(r(l,u)),m[0]===O2))return m;if("children"in l&&l.children){const _=l;if(_.children&&m[0]!==B$)for(g=(n?_.children.length:-1)+s,b=u.concat(_);g>-1&&g<_.children.length;){const S=_.children[g];if(f=o(S,g,b)(),f[0]===O2)return f;g=typeof f[1]=="number"?f[1]:g+s}}return m}}}function Qxe(t){return Array.isArray(t)?t:typeof t=="number"?[jxe,t]:t==null?F$:[t]}function su(t,e,r,n){let a,i,s;typeof e=="function"&&typeof r!="function"?(i=void 0,s=e,a=r):(i=e,s=r,a=n),OE(t,i,o,a);function o(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}function U$(t,e){let r=!1;return su(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,O2}),!!((!t.depth||t.depth<3)&&Qx(t)&&(e.options.setext||r))}function Xxe(t,e,r,n){const a=Math.max(Math.min(6,t.depth||1),1),i=r.createTracker(n);if(U$(t,r)){const u=r.enter("headingSetext"),d=r.enter("phrasing"),h=r.containerPhrasing(t,{...i.current(),before:`
|
||||
`,after:`
|
||||
`});return d(),u(),h+`
|
||||
`+(a===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
||||
`))+1))}const s="#".repeat(a),o=r.enter("headingAtx"),l=r.enter("phrasing");i.move(s+" ");let c=r.containerPhrasing(t,{before:"# ",after:`
|
||||
`,...i.current()});return/^[\t ]/.test(c)&&(c=Wu(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,r.options.closeAtx&&(c+=" "+s),l(),o(),c}G$.peek=Zxe;function G$(t){return t.value||""}function Zxe(){return"<"}q$.peek=Jxe;function q$(t,e,r,n){const a=Jx(r),i=a==='"'?"Quote":"Apostrophe",s=r.enter("image");let o=r.enter("label");const l=r.createTracker(n);let c=l.move("![");return c+=l.move(r.safe(t.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=r.enter("destinationRaw"),c+=l.move(r.safe(t.url,{before:c,after:t.title?" ":")",...l.current()}))),o(),t.title&&(o=r.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(r.safe(t.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),c+=l.move(")"),s(),c}function Jxe(){return"!"}z$.peek=e3e;function z$(t,e,r,n){const a=t.referenceType,i=r.enter("imageReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("![");const c=r.safe(t.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function e3e(){return"!"}$$.peek=t3e;function $$(t,e,r){let n=t.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(n);)a+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++i<r.unsafe.length;){const s=r.unsafe[i],o=r.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(n);){let c=l.index;n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(l.index+1)}}return a+n+a}function t3e(){return"`"}function H$(t,e){const r=Qx(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Y$.peek=r3e;function Y$(t,e,r,n){const a=Jx(r),i=a==='"'?"Quote":"Apostrophe",s=r.createTracker(n);let o,l;if(H$(t,r)){const u=r.stack;r.stack=[],o=r.enter("autolink");let d=s.move("<");return d+=s.move(r.containerPhrasing(t,{before:d,after:">",...s.current()})),d+=s.move(">"),o(),r.stack=u,d}o=r.enter("link"),l=r.enter("label");let c=s.move("[");return c+=s.move(r.containerPhrasing(t,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(r.safe(t.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=r.enter("destinationRaw"),c+=s.move(r.safe(t.url,{before:c,after:t.title?" ":")",...s.current()}))),l(),t.title&&(l=r.enter(`title${i}`),c+=s.move(" "+a),c+=s.move(r.safe(t.title,{before:c,after:a,...s.current()})),c+=s.move(a),l()),c+=s.move(")"),o(),c}function r3e(t,e,r){return H$(t,r)?"<":"["}V$.peek=n3e;function V$(t,e,r,n){const a=t.referenceType,i=r.enter("linkReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("[");const c=r.containerPhrasing(t,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function n3e(){return"["}function e3(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function a3e(t){const e=e3(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function i3e(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function W$(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function s3e(t,e,r,n){const a=r.enter("list"),i=r.bulletCurrent;let s=t.ordered?i3e(r):e3(r);const o=t.ordered?s==="."?")":".":a3e(r);let l=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){const u=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),W$(r)===s&&u){let d=-Line truncated
|
||||
`,...i.current()});return/^[\t ]/.test(c)&&(c=Wu(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,r.options.closeAtx&&(c+=" "+s),l(),o(),c}G$.peek=Zxe;function G$(t){return t.value||""}function Zxe(){return"<"}q$.peek=Jxe;function q$(t,e,r,n){const a=Jx(r),i=a==='"'?"Quote":"Apostrophe",s=r.enter("image");let o=r.enter("label");const l=r.createTracker(n);let c=l.move("![");return c+=l.move(r.safe(t.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=r.enter("destinationRaw"),c+=l.move(r.safe(t.url,{before:c,after:t.title?" ":")",...l.current()}))),o(),t.title&&(o=r.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(r.safe(t.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),c+=l.move(")"),s(),c}function Jxe(){return"!"}z$.peek=e3e;function z$(t,e,r,n){const a=t.referenceType,i=r.enter("imageReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("![");const c=r.safe(t.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function e3e(){return"!"}$$.peek=t3e;function $$(t,e,r){let n=t.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(n);)a+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++i<r.unsafe.length;){const s=r.unsafe[i],o=r.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(n);){let c=l.index;n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(l.index+1)}}return a+n+a}function t3e(){return"`"}function H$(t,e){const r=Qx(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Y$.peek=r3e;function Y$(t,e,r,n){const a=Jx(r),i=a==='"'?"Quote":"Apostrophe",s=r.createTracker(n);let o,l;if(H$(t,r)){const u=r.stack;r.stack=[],o=r.enter("autolink");let d=s.move("<");return d+=s.move(r.containerPhrasing(t,{before:d,after:">",...s.current()})),d+=s.move(">"),o(),r.stack=u,d}o=r.enter("link"),l=r.enter("label");let c=s.move("[");return c+=s.move(r.containerPhrasing(t,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(r.safe(t.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=r.enter("destinationRaw"),c+=s.move(r.safe(t.url,{before:c,after:t.title?" ":")",...s.current()}))),l(),t.title&&(l=r.enter(`title${i}`),c+=s.move(" "+a),c+=s.move(r.safe(t.title,{before:c,after:a,...s.current()})),c+=s.move(a),l()),c+=s.move(")"),o(),c}function r3e(t,e,r){return H$(t,r)?"<":"["}V$.peek=n3e;function V$(t,e,r,n){const a=t.referenceType,i=r.enter("linkReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("[");const c=r.containerPhrasing(t,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function n3e(){return"["}function e3(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function a3e(t){const e=e3(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function i3e(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function W$(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function s3e(t,e,r,n){const a=r.enter("list"),i=r.bulletCurrent;let s=t.ordered?i3e(r):e3(r);const o=t.ordered?s==="."?")":".":a3e(r);let l=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){const u=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),W$(r)===s&&u){let d=-Line truncated
|
||||
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Id},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
||||
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Id},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
||||
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Id},{atBreak:!0,character:"+",after:`(?:[ \r
|
||||
@@ -174,15 +174,15 @@ ${i.text}`):"blob"in i&&i.blob&&e.push(`
|
||||
`}const w3e=/\r?\n|\r/g;function A3e(t,e){const r=[];let n=0,a=0,i;for(;i=w3e.exec(t);)s(t.slice(n,i.index)),r.push(i[0]),n=i.index+i[0].length,a++;return s(t.slice(n)),r.join("");function s(o){r.push(e(o,a,!o))}}function R3e(t,e,r){const n=(r.before||"")+(e||"")+(r.after||""),a=[],i=[],s={};let o=-1;for(;++o<t.unsafe.length;){const u=t.unsafe[o];if(!k$(t.stack,u))continue;const d=t.compilePattern(u);let h;for(;h=d.exec(n);){const m="before"in u||!!u.atBreak,f="after"in u,g=h.index+(m?h[1].length:0);a.includes(g)?(s[g].before&&!m&&(s[g].before=!1),s[g].after&&!f&&(s[g].after=!1)):(a.push(g),s[g]={before:m,after:f})}}a.sort(O3e);let l=r.before?r.before.length:0;const c=n.length-(r.after?r.after.length:0);for(o=-1;++o<a.length;){const u=a[o];u<l||u>=c||u+1<c&&a[o+1]===u+1&&s[u].after&&!s[u+1].before&&!s[u+1].after||a[o-1]===u-1&&s[u].before&&!s[u-1].before&&!s[u-1].after||(l!==u&&i.push(SL(n.slice(l,u),"\\")),l=u,/[!-/:-@[-`{-~]/.test(n.charAt(u))&&(!r.encode||!r.encode.includes(n.charAt(u)))?i.push("\\"):(i.push(Wu(n.charCodeAt(u))),l++))}return i.push(SL(n.slice(l,c),r.after)),i.join("")}function O3e(t,e){return t-e}function SL(t,e){const r=/\\(?=[!-/:-@[-`{-~])/g,n=[],a=[],i=t+e;let s=-1,o=0,l;for(;l=r.exec(i);)n.push(l.index);for(;++s<n.length;)o!==n[s]&&a.push(t.slice(o,n[s])),a.push("\\"),o=n[s];return a.push(t.slice(o)),a.join("")}function N3e(t){const e=t||{},r=e.now||{};let n=e.lineShift||0,a=r.line||1,i=r.column||1;return{move:l,current:s,shift:o};function s(){return{now:{line:a,column:i},lineShift:n}}function o(c){n+=c}function l(c){const u=c||"",d=u.split(/\r?\n|\r/g),h=d[d.length-1];return a+=d.length-1,i=d.length===1?i+h.length:1+h.length+n,u}}function I3e(t,e){const r=e||{},n={associationId:E3e,containerPhrasing:k3e,containerFlow:P3e,createTracker:N3e,compilePattern:v3e,enter:i,handlers:{...t3},handle:void 0,indentLines:A3e,indexStack:[],join:[..._3e],options:{},safe:L3e,stack:[],unsafe:[...S3e]};M$(n,r),n.options.tightDefinitions&&n.join.push(M3e),n.handle=D$("type",{invalid:x3e,unknown:D3e,handlers:n.handlers});let a=n.handle(t,void 0,n,{before:`
|
||||
`,after:`
|
||||
`,now:{line:1,column:1},lineShift:0});return a&&a.charCodeAt(a.length-1)!==10&&a.charCodeAt(a.length-1)!==13&&(a+=`
|
||||
`),a;function i(s){return n.stack.push(s),o;function o(){n.stack.pop()}}}function x3e(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function D3e(t){const e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function M3e(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function k3e(t,e){return y3e(t,this,e)}function P3e(t,e){return T3e(t,this,e)}function L3e(t,e){return R3e(this,t,e)}function F3e(t){const e=this;e.compiler=r;function r(n){return I3e(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function EL(t){if(t)throw t}var Hw,vL;function B3e(){if(vL)return Hw;vL=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},i=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var u=t.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&t.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var h;for(h in c);return typeof h>"u"||t.call(c,h)},s=function(c,u){r&&u.name==="__proto__"?r(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},o=function(c,u){if(u==="__proto__")if(t.call(c,u)){if(n)return n(c,u).value}else return;return c[u]};return Hw=function l(){var c,u,d,h,m,f,g=arguments[0],b=1,_=arguments.length,S=!1;for(typeof g=="boolean"&&(S=g,g=arguments[1]||{},b=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});b<_;++b)if(c=arguments[b],c!=null)for(u in c)d=o(g,u),h=o(c,u),g!==h&&(S&&h&&(i(h)||(m=a(h)))?(m?(m=!1,f=d&&a(d)?d:[]):f=d&&i(d)?d:{},s(g,{name:u,newValue:l(S,f,h)})):typeof h<"u"&&s(g,{name:u,newValue:h}));return g},Hw}var U3e=B3e();const Yw=ph(U3e);function O2(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function G3e(){const t=[],e={run:r,use:n};return e;function r(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...c){const u=t[++i];let d=-1;if(l){s(l);return}for(;++d<a.length;)(c[d]===null||c[d]===void 0)&&(c[d]=a[d]);a=c,u?q3e(u,o)(...c):s(null,...c)}}function n(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return t.push(a),e}}function q3e(t,e){let r;return n;function n(...s){const o=t.length>s.length;let l;o&&s.push(a);try{l=t.apply(this,s)}catch(c){const u=c;if(o&&r)throw u;return a(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){r||(r=!0,e(s,...o))}function i(s){a(null,s)}}function z3e(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?yL(t.position):"start"in t||"end"in t?yL(t):"line"in t||"column"in t?N2(t):""}function N2(t){return TL(t&&t.line)+":"+TL(t&&t.column)}function yL(t){return N2(t&&t.start)+"-"+N2(t&&t.end)}function TL(t){return t&&typeof t=="number"?t:1}class ks extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let a="",i={},s=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof e=="string"?a=e:!i.cause&&e&&(s=!0,a=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?i.ruleId=n:(i.source=n.slice(0,l),i.ruleId=n.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=z3e(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}ks.prototype.file="";ks.prototype.name="";ks.prototype.reason="";ks.prototype.message="";ks.prototype.stack="";ks.prototype.column=void 0;ks.prototype.line=void 0;ks.prototype.ancestors=void 0;ks.prototype.cause=void 0;ks.prototype.fatal=void 0;ks.prototype.place=void 0;ks.prototype.ruleId=void 0;ks.prototype.source=void 0;const Al={basename:$3e,dirname:H3e,extname:Y3e,join:V3e,sep:"/"};function $3e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Mg(t);let r=0,n=-1,a=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;a--;)if(t.codePointAt(a)===47){if(i){r=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":t.slice(r,n)}if(e===t)return"";let s=-1,o=e.length-1;for(;a--;)if(t.codePointAt(a)===47){if(i){r=a+1;break}}else s<0&&(i=!0,s=a+1),o>-1&&(t.codePointAt(a)===e.codePointAt(o--)?o<0&&(n=
Line truncated
|
||||
`),a;function i(s){return n.stack.push(s),o;function o(){n.stack.pop()}}}function x3e(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function D3e(t){const e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function M3e(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function k3e(t,e){return y3e(t,this,e)}function P3e(t,e){return T3e(t,this,e)}function L3e(t,e){return R3e(this,t,e)}function F3e(t){const e=this;e.compiler=r;function r(n){return I3e(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function EL(t){if(t)throw t}var Yw,vL;function B3e(){if(vL)return Yw;vL=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},i=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var u=t.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&t.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var h;for(h in c);return typeof h>"u"||t.call(c,h)},s=function(c,u){r&&u.name==="__proto__"?r(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},o=function(c,u){if(u==="__proto__")if(t.call(c,u)){if(n)return n(c,u).value}else return;return c[u]};return Yw=function l(){var c,u,d,h,m,f,g=arguments[0],b=1,_=arguments.length,S=!1;for(typeof g=="boolean"&&(S=g,g=arguments[1]||{},b=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});b<_;++b)if(c=arguments[b],c!=null)for(u in c)d=o(g,u),h=o(c,u),g!==h&&(S&&h&&(i(h)||(m=a(h)))?(m?(m=!1,f=d&&a(d)?d:[]):f=d&&i(d)?d:{},s(g,{name:u,newValue:l(S,f,h)})):typeof h<"u"&&s(g,{name:u,newValue:h}));return g},Yw}var U3e=B3e();const Vw=mh(U3e);function N2(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function G3e(){const t=[],e={run:r,use:n};return e;function r(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...c){const u=t[++i];let d=-1;if(l){s(l);return}for(;++d<a.length;)(c[d]===null||c[d]===void 0)&&(c[d]=a[d]);a=c,u?q3e(u,o)(...c):s(null,...c)}}function n(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return t.push(a),e}}function q3e(t,e){let r;return n;function n(...s){const o=t.length>s.length;let l;o&&s.push(a);try{l=t.apply(this,s)}catch(c){const u=c;if(o&&r)throw u;return a(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){r||(r=!0,e(s,...o))}function i(s){a(null,s)}}function z3e(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?yL(t.position):"start"in t||"end"in t?yL(t):"line"in t||"column"in t?I2(t):""}function I2(t){return TL(t&&t.line)+":"+TL(t&&t.column)}function yL(t){return I2(t&&t.start)+"-"+I2(t&&t.end)}function TL(t){return t&&typeof t=="number"?t:1}class ks extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let a="",i={},s=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof e=="string"?a=e:!i.cause&&e&&(s=!0,a=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?i.ruleId=n:(i.source=n.slice(0,l),i.ruleId=n.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=z3e(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}ks.prototype.file="";ks.prototype.name="";ks.prototype.reason="";ks.prototype.message="";ks.prototype.stack="";ks.prototype.column=void 0;ks.prototype.line=void 0;ks.prototype.ancestors=void 0;ks.prototype.cause=void 0;ks.prototype.fatal=void 0;ks.prototype.place=void 0;ks.prototype.ruleId=void 0;ks.prototype.source=void 0;const Rl={basename:$3e,dirname:H3e,extname:Y3e,join:V3e,sep:"/"};function $3e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Mg(t);let r=0,n=-1,a=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;a--;)if(t.codePointAt(a)===47){if(i){r=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":t.slice(r,n)}if(e===t)return"";let s=-1,o=e.length-1;for(;a--;)if(t.codePointAt(a)===47){if(i){r=a+1;break}}else s<0&&(i=!0,s=a+1),o>-1&&(t.codePointAt(a)===e.codePointAt(o--)?o<0&&(n=
Line truncated
|
||||
`:" ")+i.indentLines(i.containerFlow(n,o.current()),e?Z$:BDe))),c(),l}}function BDe(t,e,r){return e===0?t:Z$(t,e,r)}function Z$(t,e,r){return(r?"":" ")+t}const UDe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];J$.peek=HDe;function GDe(){return{canContainEols:["delete"],enter:{strikethrough:zDe},exit:{strikethrough:$De}}}function qDe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:UDe}],handlers:{delete:J$}}}function zDe(t){this.enter({type:"delete",children:[]},t)}function $De(t){this.exit(t)}function J$(t,e,r,n){const a=r.createTracker(n),i=r.enter("strikethrough");let s=a.move("~~");return s+=r.containerPhrasing(t,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),i(),s}function HDe(){return"~"}function YDe(t){return t.length}function VDe(t,e){const r=e||{},n=(r.align||[]).concat(),a=r.stringLength||YDe,i=[],s=[],o=[],l=[];let c=0,u=-1;for(;++u<t.length;){const g=[],b=[];let _=-1;for(t[u].length>c&&(c=t[u].length);++_<t[u].length;){const S=WDe(t[u][_]);if(r.alignDelimiters!==!1){const E=a(S);b[_]=E,(l[_]===void 0||E>l[_])&&(l[_]=E)}g.push(S)}s[u]=g,o[u]=b}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<c;)i[d]=RL(n[d]);else{const g=RL(n);for(;++d<c;)i[d]=g}d=-1;const h=[],m=[];for(;++d<c;){const g=i[d];let b="",_="";g===99?(b=":",_=":"):g===108?b=":":g===114&&(_=":");let S=r.alignDelimiters===!1?1:Math.max(1,l[d]-b.length-_.length);const E=b+"-".repeat(S)+_;r.alignDelimiters!==!1&&(S=b.length+S+_.length,S>l[d]&&(l[d]=S),m[d]=S),h[d]=E}s.splice(1,0,h),o.splice(1,0,m),u=-1;const f=[];for(;++u<s.length;){const g=s[u],b=o[u];d=-1;const _=[];for(;++d<c;){const S=g[d]||"";let E="",y="";if(r.alignDelimiters!==!1){const v=l[d]-(b[d]||0),T=i[d];T===114?E=" ".repeat(v):T===99?v%2?(E=" ".repeat(v/2+.5),y=" ".repeat(v/2-.5)):(E=" ".repeat(v/2),y=E):y=" ".repeat(v)}r.delimiterStart!==!1&&!d&&_.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&S==="")&&(r.delimiterStart!==!1||d)&&_.push(" "),r.alignDelimiters!==!1&&_.push(E),_.push(S),r.alignDelimiters!==!1&&_.push(y),r.padding!==!1&&_.push(" "),(r.delimiterEnd!==!1||d!==c-1)&&_.push("|")}f.push(r.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return f.join(`
|
||||
`)}function WDe(t){return t==null?"":String(t)}function RL(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function KDe(){return{enter:{table:jDe,tableData:OL,tableHeader:OL,tableRow:XDe},exit:{codeText:ZDe,table:QDe,tableData:tA,tableHeader:tA,tableRow:tA}}}function jDe(t){const e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function QDe(t){this.exit(t),this.data.inTable=void 0}function XDe(t){this.enter({type:"tableRow",children:[]},t)}function tA(t){this.exit(t)}function OL(t){this.enter({type:"tableCell",children:[]},t)}function ZDe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,JDe));const r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function JDe(t,e){return e==="|"?e:t}function e5e(t){const e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,a=e.stringLength,i=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
||||
`)}function WDe(t){return t==null?"":String(t)}function RL(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function KDe(){return{enter:{table:jDe,tableData:OL,tableHeader:OL,tableRow:XDe},exit:{codeText:ZDe,table:QDe,tableData:rA,tableHeader:rA,tableRow:rA}}}function jDe(t){const e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function QDe(t){this.exit(t),this.data.inTable=void 0}function XDe(t){this.enter({type:"tableRow",children:[]},t)}function rA(t){this.exit(t)}function OL(t){this.enter({type:"tableCell",children:[]},t)}function ZDe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,JDe));const r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function JDe(t,e){return e==="|"?e:t}function e5e(t){const e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,a=e.stringLength,i=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
||||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:o}};function s(m,f,g,b){return c(u(m,g,b),m.align)}function o(m,f,g,b){const _=d(m,g,b),S=c([_]);return S.slice(0,S.indexOf(`
|
||||
`))}function l(m,f,g,b){const _=g.enter("tableCell"),S=g.enter("phrasing"),E=g.containerPhrasing(m,{...b,before:i,after:i});return S(),_(),E}function c(m,f){return VDe(m,{align:f,alignDelimiters:n,padding:r,stringLength:a})}function u(m,f,g){const b=m.children;let _=-1;const S=[],E=f.enter("table");for(;++_<b.length;)S[_]=d(b[_],f,g);return E(),S}function d(m,f,g){const b=m.children;let _=-1;const S=[],E=f.enter("tableRow");for(;++_<b.length;)S[_]=l(b[_],m,f,g);return E(),S}function h(m,f,g){let b=t3.inlineCode(m,f,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function t5e(){return{exit:{taskListCheckValueChecked:NL,taskListCheckValueUnchecked:NL,paragraph:n5e}}}function r5e(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:a5e}}}function NL(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function n5e(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const a=e.children;let i=-1,s;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){s=o;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function a5e(t,e,r,n){const a=t.children[0],i=typeof t.checked=="boolean"&&a&&a.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",o=r.createTracker(n);i&&o.move(s);let l=t3.listItem(t,e,r,{...n,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function i5e(){return[fDe(),LDe(),GDe(),KDe(),t5e()]}function s5e(t){return{extensions:[gDe(),FDe(t),qDe(),e5e(t),r5e()]}}const o5e={tokenize:p5e,partial:!0},eH={tokenize:m5e,partial:!0},tH={tokenize:f5e,partial:!0},rH={tokenize:g5e,partial:!0},l5e={tokenize:_5e,partial:!0},nH={name:"wwwAutolink",tokenize:d5e,previous:iH},aH={name:"protocolAutolink",tokenize:h5e,previous:sH},ou={name:"emailAutolink",tokenize:u5e,previous:oH},Zl={};function c5e(){return{text:Zl}}let xd=48;for(;xd<123;)Zl[xd]=ou,xd++,xd===58?xd=65:xd===91&&(xd=97);Zl[43]=ou;Zl[45]=ou;Zl[46]=ou;Zl[95]=ou;Zl[72]=[ou,aH];Zl[104]=[ou,aH];Zl[87]=[ou,nH];Zl[119]=[ou,nH];function u5e(t,e,r){const n=this;let a,i;return s;function s(d){return!x2(d)||!oH.call(n,n.previous)||n3(n.events)?r(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(d))}function o(d){return x2(d)?(t.consume(d),o):d===64?(t.consume(d),l):r(d)}function l(d){return d===46?t.check(l5e,u,c)(d):d===45||d===95||Hi(d)?(i=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),a=!0,l}function u(d){return i&&a&&ls(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):r(d)}}function d5e(t,e,r){const n=this;return a;function a(s){return s!==87&&s!==119||!iH.call(n,n.previous)||n3(n.events)?r(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(o5e,t.attempt(eH,t.attempt(tH,i),r),r)(s))}function i(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function h5e(t,e,r){const n=this;let a="",i=!1;return s;function s(d){return(d===72||d===104)&&sH.call(n,n.previous)&&!n3(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),t.consume(d),o):r(d)}function o(d){if(ls(d)&&a.length<5)return a+=String.fromCodePoint(d),t.consume(d),o;if(d===58){const h=a.toLowerCase();if(h==="http"||h==="https")return t.consume(d),l}return r(d)}function l(d){return d===47?(t.consume(d),i?c:(i=!0,l)):r(d)}function c(d){return d===null||Gb(d)||na(d)||lh(d)||CE(d)?r(d):t.attempt(eH,t.attempt(tH,u),r)(d)}function u(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function p5e(t,e,r){let n=0;return a;function a(s){return(s===87||s===119)&&n<3?(n++,t.consume(s),a):s===46&&n===3?(t.consume(s),i):r(s)}function i(s){return s===null?r(s):e(s)}}function m5e(t,e,r){let n,a,i;return s;function s(c){return c===46||c===95?t.check(rH,l,o)(c):c===null||na(c)||lh(c)||c!==45&&CE(c)?l(c):(i=!0,t.consume(c),s)}function o(c){return c===95?n=!0:(a=n,n=void 0),t.consume(c),s}function l(c){return a||n||!i?r(c):e(c)}}function f5e(t,e){let r=0,n=0;return a;function a(s){return s===40?(r++,t.consume(s),a):s===41&&n<r?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(rH,e,i)(s):s===null||na(s)||lh(s)?e(s):(t.consume(s),a)}function i(s){return s===41&&n++,t.consume(s),a}}function g5e(t,e,r){return n;function n(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),n):o===38?(t.consume(o),i):o===93?(t.consume(o),a):o===60||o===null||na(o)||lh(o)?e(o):r(o)}function a(o){return o===null||o===40||o===91||na(o)||lh(o)?e(o):n(o)}function i(o){
Line truncated
|
||||
`))}function l(m,f,g,b){const _=g.enter("tableCell"),S=g.enter("phrasing"),E=g.containerPhrasing(m,{...b,before:i,after:i});return S(),_(),E}function c(m,f){return VDe(m,{align:f,alignDelimiters:n,padding:r,stringLength:a})}function u(m,f,g){const b=m.children;let _=-1;const S=[],E=f.enter("table");for(;++_<b.length;)S[_]=d(b[_],f,g);return E(),S}function d(m,f,g){const b=m.children;let _=-1;const S=[],E=f.enter("tableRow");for(;++_<b.length;)S[_]=l(b[_],m,f,g);return E(),S}function h(m,f,g){let b=t3.inlineCode(m,f,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function t5e(){return{exit:{taskListCheckValueChecked:NL,taskListCheckValueUnchecked:NL,paragraph:n5e}}}function r5e(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:a5e}}}function NL(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function n5e(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const a=e.children;let i=-1,s;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){s=o;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function a5e(t,e,r,n){const a=t.children[0],i=typeof t.checked=="boolean"&&a&&a.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",o=r.createTracker(n);i&&o.move(s);let l=t3.listItem(t,e,r,{...n,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function i5e(){return[fDe(),LDe(),GDe(),KDe(),t5e()]}function s5e(t){return{extensions:[gDe(),FDe(t),qDe(),e5e(t),r5e()]}}const o5e={tokenize:p5e,partial:!0},eH={tokenize:m5e,partial:!0},tH={tokenize:f5e,partial:!0},rH={tokenize:g5e,partial:!0},l5e={tokenize:_5e,partial:!0},nH={name:"wwwAutolink",tokenize:d5e,previous:iH},aH={name:"protocolAutolink",tokenize:h5e,previous:sH},ou={name:"emailAutolink",tokenize:u5e,previous:oH},Zl={};function c5e(){return{text:Zl}}let xd=48;for(;xd<123;)Zl[xd]=ou,xd++,xd===58?xd=65:xd===91&&(xd=97);Zl[43]=ou;Zl[45]=ou;Zl[46]=ou;Zl[95]=ou;Zl[72]=[ou,aH];Zl[104]=[ou,aH];Zl[87]=[ou,nH];Zl[119]=[ou,nH];function u5e(t,e,r){const n=this;let a,i;return s;function s(d){return!D2(d)||!oH.call(n,n.previous)||n3(n.events)?r(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(d))}function o(d){return D2(d)?(t.consume(d),o):d===64?(t.consume(d),l):r(d)}function l(d){return d===46?t.check(l5e,u,c)(d):d===45||d===95||Vi(d)?(i=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),a=!0,l}function u(d){return i&&a&&ls(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):r(d)}}function d5e(t,e,r){const n=this;return a;function a(s){return s!==87&&s!==119||!iH.call(n,n.previous)||n3(n.events)?r(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(o5e,t.attempt(eH,t.attempt(tH,i),r),r)(s))}function i(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function h5e(t,e,r){const n=this;let a="",i=!1;return s;function s(d){return(d===72||d===104)&&sH.call(n,n.previous)&&!n3(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),t.consume(d),o):r(d)}function o(d){if(ls(d)&&a.length<5)return a+=String.fromCodePoint(d),t.consume(d),o;if(d===58){const h=a.toLowerCase();if(h==="http"||h==="https")return t.consume(d),l}return r(d)}function l(d){return d===47?(t.consume(d),i?c:(i=!0,l)):r(d)}function c(d){return d===null||qb(d)||na(d)||ch(d)||wE(d)?r(d):t.attempt(eH,t.attempt(tH,u),r)(d)}function u(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function p5e(t,e,r){let n=0;return a;function a(s){return(s===87||s===119)&&n<3?(n++,t.consume(s),a):s===46&&n===3?(t.consume(s),i):r(s)}function i(s){return s===null?r(s):e(s)}}function m5e(t,e,r){let n,a,i;return s;function s(c){return c===46||c===95?t.check(rH,l,o)(c):c===null||na(c)||ch(c)||c!==45&&wE(c)?l(c):(i=!0,t.consume(c),s)}function o(c){return c===95?n=!0:(a=n,n=void 0),t.consume(c),s}function l(c){return a||n||!i?r(c):e(c)}}function f5e(t,e){let r=0,n=0;return a;function a(s){return s===40?(r++,t.consume(s),a):s===41&&n<r?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(rH,e,i)(s):s===null||na(s)||ch(s)?e(s):(t.consume(s),a)}function i(s){return s===41&&n++,t.consume(s),a}}function g5e(t,e,r){return n;function n(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),n):o===38?(t.consume(o),i):o===93?(t.consume(o),a):o===60||o===null||na(o)||ch(o)?e(o):r(o)}function a(o){return o===null||o===40||o===91||na(o)||ch(o)?e(o):n(o)}function i(o){
Line truncated
|
||||
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(i,s,o,l){const c=i.value||"",u=o.createTracker(l),d="$".repeat(Math.max(P$(c,"$")+1,2)),h=o.enter("mathFlow");let m=u.move(d);if(i.meta){const f=o.enter("mathFlowMeta");m+=u.move(o.safe(i.meta,{after:`
|
||||
`,before:m,encode:["$"],...u.current()})),f()}return m+=u.move(`
|
||||
`),c&&(m+=u.move(c+`
|
||||
`)),m+=u.move(d),h(),m}function n(i,s,o){let l=i.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const u="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<o.unsafe.length;){const h=o.unsafe[d];if(!h.atBreak)continue;const m=o.compilePattern(h);let f;for(;f=m.exec(l);){let g=f.index;l.codePointAt(g)===10&&l.codePointAt(g-1)===13&&g--,l=l.slice(0,g)+" "+l.slice(f.index+1)}}return u+l+u}function a(){return"$"}}const $5e={tokenize:H5e,concrete:!0,name:"mathFlow"},xL={tokenize:Y5e,partial:!0};function H5e(t,e,r){const n=this,a=n.events[n.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0;let s=0;return o;function o(S){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),l(S)}function l(S){return S===36?(t.consume(S),s++,l):s<2?r(S):(t.exit("mathFlowFenceSequence"),En(t,c,"whitespace")(S))}function c(S){return S===null||Ir(S)?d(S):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),u(S))}function u(S){return S===null||Ir(S)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),d(S)):S===36?r(S):(t.consume(S),u)}function d(S){return t.exit("mathFlowFence"),n.interrupt?e(S):t.attempt(xL,h,b)(S)}function h(S){return t.attempt({tokenize:_,partial:!0},b,m)(S)}function m(S){return(i?En(t,f,"linePrefix",i+1):f)(S)}function f(S){return S===null?b(S):Ir(S)?t.attempt(xL,h,b)(S):(t.enter("mathFlowValue"),g(S))}function g(S){return S===null||Ir(S)?(t.exit("mathFlowValue"),f(S)):(t.consume(S),g)}function b(S){return t.exit("mathFlow"),e(S)}function _(S,E,y){let v=0;return En(S,T,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function T(I){return S.enter("mathFlowFence"),S.enter("mathFlowFenceSequence"),w(I)}function w(I){return I===36?(v++,S.consume(I),w):v<s?y(I):(S.exit("mathFlowFenceSequence"),En(S,A,"whitespace")(I))}function A(I){return I===null||Ir(I)?(S.exit("mathFlowFence"),E(I)):y(I)}}}function Y5e(t,e,r){const n=this;return a;function a(s){return s===null?e(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function V5e(t){let r=(t||{}).singleDollarTextMath;return r==null&&(r=!0),{tokenize:n,resolve:W5e,previous:K5e,name:"mathText"};function n(a,i,s){let o=0,l,c;return u;function u(g){return a.enter("mathText"),a.enter("mathTextSequence"),d(g)}function d(g){return g===36?(a.consume(g),o++,d):o<2&&!r?s(g):(a.exit("mathTextSequence"),h(g))}function h(g){return g===null?s(g):g===36?(c=a.enter("mathTextSequence"),l=0,f(g)):g===32?(a.enter("space"),a.consume(g),a.exit("space"),h):Ir(g)?(a.enter("lineEnding"),a.consume(g),a.exit("lineEnding"),h):(a.enter("mathTextData"),m(g))}function m(g){return g===null||g===32||g===36||Ir(g)?(a.exit("mathTextData"),h(g)):(a.consume(g),m)}function f(g){return g===36?(a.consume(g),l++,f):l===o?(a.exit("mathTextSequence"),a.exit("mathText"),i(g)):(c.type="mathTextData",m(g))}}}function W5e(t){let e=t.length-4,r=3,n,a;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[r][1].type="mathTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)a===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(a=n):(n===e||t[n][1].type==="lineEnding")&&(t[a][1].type="mathTextData",n!==a+2&&(t[a][1].end=t[n-1][1].end,t.splice(a+2,n-a-2),e-=n-a-2,n=a+2),a=void 0);return t}function K5e(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function j5e(t){return{flow:{36:$5e},text:{36:V5e(t)}}}class Qs{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new Qs(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}}class ko{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new ko(r,Qs.range(this,e))}}class qt{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,a,i,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;a=s.start,i=s.end,a===o.length?n+=" at end of input: ":n+=" at position "+(a+1)+": ";var l=o.slice(a,i).replace(/[^]/g,"$&̲"),c;a>15?c="…"+o.slice(a-15,a):c=o.slice(0,a);var u;i+15<o.length?u=o.slice(i,i+15)+"…":u=o.slice(i),n+=c+l+u}var d=new Error(n);return d.name="ParseError",d.__proto__=qt.prototype,d.position=a,a!=null&&i!=null&&(d.length=i-a),d.rawMessage=e,d}}qt.prototype.__proto__=Error.prototype;var Q5e=function(e,r){return e.indexOf(r)!==-1},X5e=function(e,r){return e===void 0?r:e},Z5e=/([A-Z])/g,J5e=function(e){return e.replace(Z5e,"-$1").toLowerCase()},eMe={"&":"&",">":">","<":"<",'"':""","'":"'"},tMe=/[&><"']/g;function r
Line truncated
|
||||
`)),m+=u.move(d),h(),m}function n(i,s,o){let l=i.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const u="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<o.unsafe.length;){const h=o.unsafe[d];if(!h.atBreak)continue;const m=o.compilePattern(h);let f;for(;f=m.exec(l);){let g=f.index;l.codePointAt(g)===10&&l.codePointAt(g-1)===13&&g--,l=l.slice(0,g)+" "+l.slice(f.index+1)}}return u+l+u}function a(){return"$"}}const $5e={tokenize:H5e,concrete:!0,name:"mathFlow"},xL={tokenize:Y5e,partial:!0};function H5e(t,e,r){const n=this,a=n.events[n.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0;let s=0;return o;function o(S){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),l(S)}function l(S){return S===36?(t.consume(S),s++,l):s<2?r(S):(t.exit("mathFlowFenceSequence"),vn(t,c,"whitespace")(S))}function c(S){return S===null||Ir(S)?d(S):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),u(S))}function u(S){return S===null||Ir(S)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),d(S)):S===36?r(S):(t.consume(S),u)}function d(S){return t.exit("mathFlowFence"),n.interrupt?e(S):t.attempt(xL,h,b)(S)}function h(S){return t.attempt({tokenize:_,partial:!0},b,m)(S)}function m(S){return(i?vn(t,f,"linePrefix",i+1):f)(S)}function f(S){return S===null?b(S):Ir(S)?t.attempt(xL,h,b)(S):(t.enter("mathFlowValue"),g(S))}function g(S){return S===null||Ir(S)?(t.exit("mathFlowValue"),f(S)):(t.consume(S),g)}function b(S){return t.exit("mathFlow"),e(S)}function _(S,E,y){let v=0;return vn(S,T,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function T(I){return S.enter("mathFlowFence"),S.enter("mathFlowFenceSequence"),w(I)}function w(I){return I===36?(v++,S.consume(I),w):v<s?y(I):(S.exit("mathFlowFenceSequence"),vn(S,A,"whitespace")(I))}function A(I){return I===null||Ir(I)?(S.exit("mathFlowFence"),E(I)):y(I)}}}function Y5e(t,e,r){const n=this;return a;function a(s){return s===null?e(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function V5e(t){let r=(t||{}).singleDollarTextMath;return r==null&&(r=!0),{tokenize:n,resolve:W5e,previous:K5e,name:"mathText"};function n(a,i,s){let o=0,l,c;return u;function u(g){return a.enter("mathText"),a.enter("mathTextSequence"),d(g)}function d(g){return g===36?(a.consume(g),o++,d):o<2&&!r?s(g):(a.exit("mathTextSequence"),h(g))}function h(g){return g===null?s(g):g===36?(c=a.enter("mathTextSequence"),l=0,f(g)):g===32?(a.enter("space"),a.consume(g),a.exit("space"),h):Ir(g)?(a.enter("lineEnding"),a.consume(g),a.exit("lineEnding"),h):(a.enter("mathTextData"),m(g))}function m(g){return g===null||g===32||g===36||Ir(g)?(a.exit("mathTextData"),h(g)):(a.consume(g),m)}function f(g){return g===36?(a.consume(g),l++,f):l===o?(a.exit("mathTextSequence"),a.exit("mathText"),i(g)):(c.type="mathTextData",m(g))}}}function W5e(t){let e=t.length-4,r=3,n,a;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[r][1].type="mathTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)a===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(a=n):(n===e||t[n][1].type==="lineEnding")&&(t[a][1].type="mathTextData",n!==a+2&&(t[a][1].end=t[n-1][1].end,t.splice(a+2,n-a-2),e-=n-a-2,n=a+2),a=void 0);return t}function K5e(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function j5e(t){return{flow:{36:$5e},text:{36:V5e(t)}}}class Qs{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new Qs(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}}class Po{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new Po(r,Qs.range(this,e))}}class qt{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,a,i,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;a=s.start,i=s.end,a===o.length?n+=" at end of input: ":n+=" at position "+(a+1)+": ";var l=o.slice(a,i).replace(/[^]/g,"$&̲"),c;a>15?c="…"+o.slice(a-15,a):c=o.slice(0,a);var u;i+15<o.length?u=o.slice(i,i+15)+"…":u=o.slice(i),n+=c+l+u}var d=new Error(n);return d.name="ParseError",d.__proto__=qt.prototype,d.position=a,a!=null&&i!=null&&(d.length=i-a),d.rawMessage=e,d}}qt.prototype.__proto__=Error.prototype;var Q5e=function(e,r){return e.indexOf(r)!==-1},X5e=function(e,r){return e===void 0?r:e},Z5e=/([A-Z])/g,J5e=function(e){return e.replace(Z5e,"-$1").toLowerCase()},eMe={"&":"&",">":">","<":"<",'"':""","'":"'"},tMe=/[&><"']/g;function r
Line truncated
|
||||
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
||||
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
||||
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
||||
@@ -233,7 +233,7 @@ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,1
|
||||
H742v`+a+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
||||
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
||||
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
||||
219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},vMe=function(e,r,n){r=1e3*r;var a="";switch(e){case"sqrtMain":a=mMe(r,Fh);break;case"sqrtSize1":a=fMe(r,Fh);break;case"sqrtSize2":a=gMe(r,Fh);break;case"sqrtSize3":a=_Me(r,Fh);break;case"sqrtSize4":a=bMe(r,Fh);break;case"sqrtTall":a=EMe(r,Fh,n)}return a},yMe=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},DL={doubleleftarrow:`M262 157
|
||||
219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},vMe=function(e,r,n){r=1e3*r;var a="";switch(e){case"sqrtMain":a=mMe(r,Bh);break;case"sqrtSize1":a=fMe(r,Bh);break;case"sqrtSize2":a=gMe(r,Bh);break;case"sqrtSize3":a=_Me(r,Bh);break;case"sqrtSize4":a=bMe(r,Bh);break;case"sqrtTall":a=EMe(r,Bh,n)}return a},yMe=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},DL={doubleleftarrow:`M262 157
|
||||
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
||||
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
||||
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
||||
@@ -436,32 +436,32 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6
|
||||
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
||||
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
||||
l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
||||
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class kg{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Lr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e}toMarkup(){for(var e="",r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e}toText(){var e=r=>r.toText();return this.children.map(e).join("")}}var Pl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.
Line truncated
|
||||
`+w+" children.");for(var D=0;D<w;D++){var $=new ju(E[D]),H=new Qc([$],{width:"400em",height:Xt(T),viewBox:"0 0 "+o+" "+v,preserveAspectRatio:I[D]+" slice"}),G=ct.makeSvgSpan([A[D]],[H],r);if(w===1)return{span:G,minWidth:y,height:T};G.style.height=Xt(T),_.push(G)}return{span:ct.makeSpan(["stretchy"],_,r),minWidth:y,height:T}}}var{span:a,minWidth:i,height:s}=n();return a.height=s,a.style.height=Xt(s),i>0&&(a.style.minWidth=Xt(i)),a},lke=function(e,r,n,a,i){var s,o=e.height+e.depth+n+a;if(/fbox|color|angl/.test(r)){if(s=ct.makeSpan(["stretchy",r],[],i),r==="fbox"){var l=i.color&&i.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(r)&&c.push(new k2({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&c.push(new k2({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Qc(c,{width:"100%",height:Xt(o)});s=ct.makeSvgSpan([],[u],i)}return s.height=o,s.style.height=Xt(o),s},Zc={encloseSpan:lke,mathMLnode:ake,svgSpan:oke};function on(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function d3(t){var e=IE(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function IE(t){return t&&(t.type==="atom"||MMe.hasOwnProperty(t.type))?t:null}var h3=(t,e)=>{var r,n,a;t&&t.type==="supsub"?(n=on(t.base,"accent"),r=n.base,t.base=r,a=xMe(Gn(t,e)),t.base=n):(n=on(t,"accent"),r=n.base);var i=Gn(r,e.havingCrampedStyle()),s=n.isShifty&&Lr.isCharacterBox(r),o=0;if(s){var l=Lr.getBaseElem(r),c=Gn(l,e.havingCrampedStyle());o=LL(c).skew}var u=n.label==="\\c",d=u?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=Zc.svgSpan(n,e),h=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var m,f;n.label==="\\vec"?(m=ct.staticSvg("vec",e),f=ct.svgData.vec[1]):(m=ct.makeOrd({mode:n.mode,text:n.label},e,"textord"),m=LL(m),m.italic=0,f=m.width,u&&(d+=m.depth)),h=ct.makeSpan(["accent-body"],[m]);var g=n.label==="\\textcircled";g&&(h.classes.push("accent-full"),d=i.height);var b=o;g||(b-=f/2),h.style.left=Xt(b),n.label==="\\textcircled"&&(h.style.top=".2em"),h=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var _=ct.makeSpan(["mord","accent"],[h],e);return a?(a.children[0]=_,a.height=Math.max(_.height,a.height),a.classes[0]="mord",a):_},CH=(t,e)=>{var r=t.isStretchy?Zc.mathMLnode(t.label):new Bt.MathNode("mo",[Uo(t.label,t.mode)]),n=new Bt.MathNode("mover",[aa(t.base,e),r]);return n.setAttribute("accent","true"),n},cke=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));dr({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=Wb(e[0]),n=!cke.test(t.funcName),a=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:a,base:r}},htmlBuilder:h3,mathmlBuilder:CH});dr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:h3,mathmlBuilder:CH});dr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,a=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:a}},htmlBuilder:(t,e)=>{var r=Gn(t.base,e),n=Zc.svgSpan(t,e),a=t.label==="\\utilde"?.12:0,i=ct.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:r}]},e);return ct.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var r=Zc.mathMLnode(t.label),n=new Bt.MathNode("munder",[aa(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var i1=t=>{var e=new Bt.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};dr({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLLine truncated
|
||||
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class kg{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Lr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e}toMarkup(){for(var e="",r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e}toText(){var e=r=>r.toText();return this.children.map(e).join("")}}var Pl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.
Line truncated
|
||||
`+w+" children.");for(var D=0;D<w;D++){var $=new ju(E[D]),H=new Qc([$],{width:"400em",height:Xt(T),viewBox:"0 0 "+o+" "+v,preserveAspectRatio:I[D]+" slice"}),G=ct.makeSvgSpan([A[D]],[H],r);if(w===1)return{span:G,minWidth:y,height:T};G.style.height=Xt(T),_.push(G)}return{span:ct.makeSpan(["stretchy"],_,r),minWidth:y,height:T}}}var{span:a,minWidth:i,height:s}=n();return a.height=s,a.style.height=Xt(s),i>0&&(a.style.minWidth=Xt(i)),a},lke=function(e,r,n,a,i){var s,o=e.height+e.depth+n+a;if(/fbox|color|angl/.test(r)){if(s=ct.makeSpan(["stretchy",r],[],i),r==="fbox"){var l=i.color&&i.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(r)&&c.push(new P2({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&c.push(new P2({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Qc(c,{width:"100%",height:Xt(o)});s=ct.makeSvgSpan([],[u],i)}return s.height=o,s.style.height=Xt(o),s},Zc={encloseSpan:lke,mathMLnode:ake,svgSpan:oke};function on(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function d3(t){var e=xE(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function xE(t){return t&&(t.type==="atom"||MMe.hasOwnProperty(t.type))?t:null}var h3=(t,e)=>{var r,n,a;t&&t.type==="supsub"?(n=on(t.base,"accent"),r=n.base,t.base=r,a=xMe(Gn(t,e)),t.base=n):(n=on(t,"accent"),r=n.base);var i=Gn(r,e.havingCrampedStyle()),s=n.isShifty&&Lr.isCharacterBox(r),o=0;if(s){var l=Lr.getBaseElem(r),c=Gn(l,e.havingCrampedStyle());o=LL(c).skew}var u=n.label==="\\c",d=u?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=Zc.svgSpan(n,e),h=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var m,f;n.label==="\\vec"?(m=ct.staticSvg("vec",e),f=ct.svgData.vec[1]):(m=ct.makeOrd({mode:n.mode,text:n.label},e,"textord"),m=LL(m),m.italic=0,f=m.width,u&&(d+=m.depth)),h=ct.makeSpan(["accent-body"],[m]);var g=n.label==="\\textcircled";g&&(h.classes.push("accent-full"),d=i.height);var b=o;g||(b-=f/2),h.style.left=Xt(b),n.label==="\\textcircled"&&(h.style.top=".2em"),h=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var _=ct.makeSpan(["mord","accent"],[h],e);return a?(a.children[0]=_,a.height=Math.max(_.height,a.height),a.classes[0]="mord",a):_},CH=(t,e)=>{var r=t.isStretchy?Zc.mathMLnode(t.label):new Bt.MathNode("mo",[Go(t.label,t.mode)]),n=new Bt.MathNode("mover",[aa(t.base,e),r]);return n.setAttribute("accent","true"),n},cke=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));dr({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=Kb(e[0]),n=!cke.test(t.funcName),a=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:a,base:r}},htmlBuilder:h3,mathmlBuilder:CH});dr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:h3,mathmlBuilder:CH});dr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,a=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:a}},htmlBuilder:(t,e)=>{var r=Gn(t.base,e),n=Zc.svgSpan(t,e),a=t.label==="\\utilde"?.12:0,i=ct.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:r}]},e);return ct.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var r=Zc.mathMLnode(t.label),n=new Bt.MathNode("munder",[aa(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var i1=t=>{var e=new Bt.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};dr({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLLine truncated
|
||||
]`,Lke="\\\\[a-zA-Z@]+",Fke="\\\\[^\uD800-\uDFFF]",Bke="("+Lke+")"+XH+"*",Uke=`\\\\(
|
||||
|[ \r ]+
|
||||
?)[ \r ]*`,G2="[̀-ͯ]",Gke=new RegExp(G2+"+$"),qke="("+XH+"+)|"+(Uke+"|")+"([!-\\[\\]-‧-豈-]"+(G2+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(G2+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Bke)+("|"+Fke+")");class o8{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(qke,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new ko("EOF",new Qs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new qt("Unexpected character: '"+e[r]+"'",new ko(e[r],new Qs(this,r,r+1)));var a=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=e.indexOf(`
|
||||
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new ko(a,new Qs(this,r,this.tokenRegex.lastIndex))}}class zke{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new qt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var $ke=GH;ve("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});ve("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});ve("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});ve("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});ve("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});ve("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ve("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var l8={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ve("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new qt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=l8[e.text],n==null||n>=r)throw new qt("Invalid base-"+r+" digit "+e.text);for(var a;(a=l8[t.future().text])!=null&&a<r;)n*=r,n+=a,t.popToken()}return"\\@char{"+n+"}"});var E3=(t,e,r,n)=>{var a=t.consumeArg().tokens;if(a.length!==1)throw new qt("\\newcommand's first argument must be a macro name");var i=a[0].text,s=t.isDefined(i);if(s&&!e)throw new qt("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!r)throw new qt("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(a=t.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var l="",c=t.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new qt("Invalid number of arguments: "+l);o=parseInt(l),a=t.consumeArg().tokens}return s&&n||t.macros.set(i,{tokens:a,numArgs:o}),""};ve("\\newcommand",t=>E3(t,!1,!0,!1));ve("\\renewcommand",t=>E3(t,!0,!1,!1));ve("\\providecommand",t=>E3(t,!0,!0,!0));ve("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});ve("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});ve("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Iu[r],la.math[r],la.text[r]),""});ve("\\bgroup","{");ve("\\egroup","}");ve("~","\\nobreakspace");ve("\\lq","`");ve("\\rq","'");ve("\\aa","\\r a");ve("\\AA","\\r A");ve("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ve("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ve("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ve("ℬ","\\mathscr{B}");ve("ℰ","\\mathscr{E}");ve("ℱ","\\mathscr{F}");ve("ℋ","\\mathscr{H}");ve("ℐ","\\mathscr{I}");ve("ℒ","\\mathscr{L}");ve("ℳ","\\mathscr{M}");ve("ℛ","\\mathscr{R}");ve("ℭ","\\mathfrak{C}");ve("ℌ","\\mathfrak{H}");ve("ℨ","\\mathfrak{Z}");ve("\\Bbbk","\\Bbb{k}");ve("·","\\cdotp");ve("\\llap","\\mathllap{\\textrm{#1}}");ve("\\rlap","\\mathrlap{\\textrm{#1}}");ve("\\clap","\\mathclap{\\textrm{#1}}");ve("\\mathstrut","\\vphantom{(}");ve("\\underbar","\\underline{\\text{#1}}");ve("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');ve("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ve("\\ne","\\neq");ve("≠","\\neq");ve("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\ms
Line truncated
|
||||
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:a}}d8.hasOwnProperty(r[0])&&!la[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',e),r=d8[r[0]]+r.slice(1));var i=Gke.exec(r);i&&(r=r.substring(0,i.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var s;if(la[this.mode][r]){this.settings.strict&&this.mode==="math"&&P2.indexOf(r)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=la[this.mode][r].group,l=Qs.range(e),c;if(DMe.hasOwnProperty(o)){var u=o;c={type:"atom",mode:this.mode,family:u,loc:l,text:r}}else c={type:o,mode:this.mode,loc:l,text:r};s=c}else if(r.charCodeAt(0)>=128)this.settings.strict&&(cH(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Qs.range(e),text:r};else return null;if(this.consume(),i)for(var d=0;d<i[0].length;d++){var h=i[0][d];if(!gA[h])throw new qt("Unknown accent ' "+h+"'",e);var m=gA[h][this.mode]||gA[h].text;if(!m)throw new qt("Accent "+h+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:Qs.range(e),label:m,isStretchy:!1,isShifty:!0,base:s}}return s}}kE.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var y3=function(e,r){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new kE(e,r);delete n.gullet.macros.current["\\df@tag"];var a=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new qt("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:n.subparse([new ko("\\df@tag")])}]}return a},tY=function(e,r,n){r.textContent="";var a=T3(e,n).toNode();r.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),tY=function(){throw new qt("KaTeX doesn't work in quirks mode.")});var Yke=function(e,r){var n=T3(e,r).toMarkup();return n},Vke=function(e,r){var n=new a3(r);return y3(e,n)},rY=function(e,r,n){if(n.throwOnError||!(e instanceof qt))throw e;var a=ct.makeSpan(["katex-error"],[new Bo(r)]);return a.setAttribute("title",e.toString()),a.setAttribute("style","color:"+n.errorColor),a},T3=function(e,r){var n=new a3(r);try{var a=y3(e,n);return tke(a,e,n)}catch(i){return rY(i,e,n)}},Wke=function(e,r){var n=new a3(r);try{var a=y3(e,n);return rke(a,e,n)}catch(i){return rY(i,e,n)}},Kke="0.16.22",jke={Span:Pg,Anchor:o3,SymbolNode:Bo,SvgNode:Qc,PathNode:ju,LineNode:k2},h8={version:Kke,render:tY,renderToString:Yke,ParseError:qt,SETTINGS_SCHEMA:k1,__parse:Vke,__renderToDomTree:T3,__renderToHTMLTree:Wke,__setFontMetrics:CMe,__defineSymbol:Q,__defineFunction:dr,__defineMacro:ve,__domTree:jke};const Qke={};function Xke(t){const e=this,r=t||Qke,n=e.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push(j5e(r)),i.push(q5e()),s.push(z5e(r))}const p8=function(t,e,r){const n=Dg(r);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(n(t.children[e],e,t))return t.children[e]},yh=function(t){if(t==null)return e9e;if(typeof t=="string")return Jke(t);if(typeof t=="object")return Zke(t);if(typeof t=="function")return C3(t);throw new Error("Expected function, string, or array as `test`")};function Zke(t){const e=[];let r=-1;for(;++r<t.length;)e[r]=yh(t[r]);return C3(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Jke(t){return C3(e);function e(r){return r.tagName===t}}function C3(t){return e;function e(r,n,a){return!!(t9e(r)&&t.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function e9e(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function t9e(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const m8=/\n/g,f8=/[\t ]+/g,q2=yh("br"),g8=yh(l9e),r9e=yh("p"),_8=yh("tr"),n9e=yh(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",o9e,c9e]),nY=yh(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1"
Line truncated
|
||||
`.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function iY(t,e,r){return t.type==="element"?a9e(t,e,r):t.type==="text"?r.whitespace==="normal"?sY(t,r):i9e(t):[]}function a9e(t,e,r){const n=oY(t,r),a=t.children||[];let i=-1,s=[];if(n9e(t))return s;let o,l;for(q2(t)||_8(t)&&p8(e,t,_8)?l=`
|
||||
`:r9e(t)?(o=2,l=2):nY(t)&&(o=1,l=1);++i<a.length;)s=s.concat(iY(a[i],t,{whitespace:n,breakBefore:i?void 0:o,breakAfter:i<a.length-1?q2(a[i+1]):l}));return g8(t)&&p8(e,t,g8)&&s.push(" "),o&&s.unshift(o),l&&s.push(l),s}function sY(t,e){const r=String(t.value),n=[],a=[];let i=0;for(;i<=r.length;){m8.lastIndex=i;const l=m8.exec(r),c=l&&"index"in l?l.index:r.length;n.push(s9e(r.slice(i,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,c===r.length?e.breakAfter:!0)),i=c+1}let s=-1,o;for(;++s<n.length;)n[s].charCodeAt(n[s].length-1)===8203||s<n.length-1&&n[s+1].charCodeAt(0)===8203?(a.push(n[s]),o=void 0):n[s]?(typeof o=="number"&&a.push(o),a.push(n[s]),o=0):(s===0||s===n.length-1)&&a.push(0);return a}function i9e(t){return[String(t.value)]}function s9e(t,e,r){const n=[];let a=0,i;for(;a<t.length;){f8.lastIndex=a;const s=f8.exec(t);i=s?s.index:t.length,!a&&!i&&s&&!e&&n.push(""),a!==i&&n.push(t.slice(a,i)),a=s?i+s[0].length:i}return a!==i&&!r&&n.push(""),n.join(" ")}function oY(t,e){if(t.type==="element"){const r=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function o9e(t){return!!(t.properties||{}).hidden}function l9e(t){return t.tagName==="td"||t.tagName==="th"}function c9e(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function u9e(t){const e="[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+",a="далее "+"возврат вызватьисключение выполнить для если и из или иначе иначеесли исключение каждого конецесли конецпопытки конеццикла не новый перейти перем по пока попытка прервать продолжить тогда цикл экспорт ",o="загрузитьизфайла "+"вебклиент вместо внешнеесоединение клиент конецобласти мобильноеприложениеклиент мобильноеприложениесервер наклиенте наклиентенасервере наклиентенасерверебезконтекста насервере насерверебезконтекста область перед после сервер толстыйклиентобычноеприложение толстыйклиентуправляемоеприложение тонкийклиент ",h="разделительстраниц разделительстрок символтабуляции "+"ansitooem oemtoansi ввестивидсубконто ввестиперечисление ввестипериод ввестиплансчетов выбранныйплансчетов датагод датамесяц датачисло заголовоксистемы значениевстроку значениеизстроки каталогиб каталогпользователя кодсимв конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лог лог10 максимальноеколичествосубконто названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найтиссылки началопериодаби началостандартногоинтервала начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода обработкаожидания основнойжурналрасчетов основнойплансчетов основнойязык очиститьокносообщений периодстр получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта префиксавтонумерации пропись пустоезначение разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо симв создатьобъект статусвозврата стрколичествострок сформироватьпозициюдокумента счетпокоду текущеевремя типзначения типзначениястр установитьтана установитьтапо фиксшаблон шаблон "+"acos asin atan base64значение base64строка cos exp log log10 pow sin sqrt tan xmlзначение xmlстрока xmlтип xmlтипзнч актив
Line truncated
|
||||
?)[ \r ]*`,q2="[̀-ͯ]",Gke=new RegExp(q2+"+$"),qke="("+XH+"+)|"+(Uke+"|")+"([!-\\[\\]-‧-豈-]"+(q2+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(q2+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Bke)+("|"+Fke+")");class o8{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(qke,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Po("EOF",new Qs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new qt("Unexpected character: '"+e[r]+"'",new Po(e[r],new Qs(this,r,r+1)));var a=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=e.indexOf(`
|
||||
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Po(a,new Qs(this,r,this.tokenRegex.lastIndex))}}class zke{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new qt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var $ke=GH;ve("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});ve("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});ve("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});ve("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});ve("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});ve("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ve("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var l8={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ve("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new qt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=l8[e.text],n==null||n>=r)throw new qt("Invalid base-"+r+" digit "+e.text);for(var a;(a=l8[t.future().text])!=null&&a<r;)n*=r,n+=a,t.popToken()}return"\\@char{"+n+"}"});var E3=(t,e,r,n)=>{var a=t.consumeArg().tokens;if(a.length!==1)throw new qt("\\newcommand's first argument must be a macro name");var i=a[0].text,s=t.isDefined(i);if(s&&!e)throw new qt("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!r)throw new qt("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(a=t.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var l="",c=t.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new qt("Invalid number of arguments: "+l);o=parseInt(l),a=t.consumeArg().tokens}return s&&n||t.macros.set(i,{tokens:a,numArgs:o}),""};ve("\\newcommand",t=>E3(t,!1,!0,!1));ve("\\renewcommand",t=>E3(t,!0,!1,!1));ve("\\providecommand",t=>E3(t,!0,!0,!0));ve("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});ve("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});ve("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Iu[r],la.math[r],la.text[r]),""});ve("\\bgroup","{");ve("\\egroup","}");ve("~","\\nobreakspace");ve("\\lq","`");ve("\\rq","'");ve("\\aa","\\r a");ve("\\AA","\\r A");ve("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ve("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ve("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ve("ℬ","\\mathscr{B}");ve("ℰ","\\mathscr{E}");ve("ℱ","\\mathscr{F}");ve("ℋ","\\mathscr{H}");ve("ℐ","\\mathscr{I}");ve("ℒ","\\mathscr{L}");ve("ℳ","\\mathscr{M}");ve("ℛ","\\mathscr{R}");ve("ℭ","\\mathfrak{C}");ve("ℌ","\\mathfrak{H}");ve("ℨ","\\mathfrak{Z}");ve("\\Bbbk","\\Bbb{k}");ve("·","\\cdotp");ve("\\llap","\\mathllap{\\textrm{#1}}");ve("\\rlap","\\mathrlap{\\textrm{#1}}");ve("\\clap","\\mathclap{\\textrm{#1}}");ve("\\mathstrut","\\vphantom{(}");ve("\\underbar","\\underline{\\text{#1}}");ve("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');ve("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ve("\\ne","\\neq");ve("≠","\\neq");ve("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\ms
Line truncated
|
||||
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:a}}d8.hasOwnProperty(r[0])&&!la[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',e),r=d8[r[0]]+r.slice(1));var i=Gke.exec(r);i&&(r=r.substring(0,i.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var s;if(la[this.mode][r]){this.settings.strict&&this.mode==="math"&&L2.indexOf(r)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=la[this.mode][r].group,l=Qs.range(e),c;if(DMe.hasOwnProperty(o)){var u=o;c={type:"atom",mode:this.mode,family:u,loc:l,text:r}}else c={type:o,mode:this.mode,loc:l,text:r};s=c}else if(r.charCodeAt(0)>=128)this.settings.strict&&(cH(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Qs.range(e),text:r};else return null;if(this.consume(),i)for(var d=0;d<i[0].length;d++){var h=i[0][d];if(!_A[h])throw new qt("Unknown accent ' "+h+"'",e);var m=_A[h][this.mode]||_A[h].text;if(!m)throw new qt("Accent "+h+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:Qs.range(e),label:m,isStretchy:!1,isShifty:!0,base:s}}return s}}PE.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var y3=function(e,r){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new PE(e,r);delete n.gullet.macros.current["\\df@tag"];var a=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new qt("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:n.subparse([new Po("\\df@tag")])}]}return a},tY=function(e,r,n){r.textContent="";var a=T3(e,n).toNode();r.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),tY=function(){throw new qt("KaTeX doesn't work in quirks mode.")});var Yke=function(e,r){var n=T3(e,r).toMarkup();return n},Vke=function(e,r){var n=new a3(r);return y3(e,n)},rY=function(e,r,n){if(n.throwOnError||!(e instanceof qt))throw e;var a=ct.makeSpan(["katex-error"],[new Uo(r)]);return a.setAttribute("title",e.toString()),a.setAttribute("style","color:"+n.errorColor),a},T3=function(e,r){var n=new a3(r);try{var a=y3(e,n);return tke(a,e,n)}catch(i){return rY(i,e,n)}},Wke=function(e,r){var n=new a3(r);try{var a=y3(e,n);return rke(a,e,n)}catch(i){return rY(i,e,n)}},Kke="0.16.22",jke={Span:Pg,Anchor:o3,SymbolNode:Uo,SvgNode:Qc,PathNode:ju,LineNode:P2},h8={version:Kke,render:tY,renderToString:Yke,ParseError:qt,SETTINGS_SCHEMA:k1,__parse:Vke,__renderToDomTree:T3,__renderToHTMLTree:Wke,__setFontMetrics:CMe,__defineSymbol:Q,__defineFunction:dr,__defineMacro:ve,__domTree:jke};const Qke={};function Xke(t){const e=this,r=t||Qke,n=e.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push(j5e(r)),i.push(q5e()),s.push(z5e(r))}const p8=function(t,e,r){const n=Dg(r);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(n(t.children[e],e,t))return t.children[e]},Th=function(t){if(t==null)return e9e;if(typeof t=="string")return Jke(t);if(typeof t=="object")return Zke(t);if(typeof t=="function")return C3(t);throw new Error("Expected function, string, or array as `test`")};function Zke(t){const e=[];let r=-1;for(;++r<t.length;)e[r]=Th(t[r]);return C3(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Jke(t){return C3(e);function e(r){return r.tagName===t}}function C3(t){return e;function e(r,n,a){return!!(t9e(r)&&t.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function e9e(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function t9e(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const m8=/\n/g,f8=/[\t ]+/g,z2=Th("br"),g8=Th(l9e),r9e=Th("p"),_8=Th("tr"),n9e=Th(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",o9e,c9e]),nY=Th(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1"
Line truncated
|
||||
`.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function iY(t,e,r){return t.type==="element"?a9e(t,e,r):t.type==="text"?r.whitespace==="normal"?sY(t,r):i9e(t):[]}function a9e(t,e,r){const n=oY(t,r),a=t.children||[];let i=-1,s=[];if(n9e(t))return s;let o,l;for(z2(t)||_8(t)&&p8(e,t,_8)?l=`
|
||||
`:r9e(t)?(o=2,l=2):nY(t)&&(o=1,l=1);++i<a.length;)s=s.concat(iY(a[i],t,{whitespace:n,breakBefore:i?void 0:o,breakAfter:i<a.length-1?z2(a[i+1]):l}));return g8(t)&&p8(e,t,g8)&&s.push(" "),o&&s.unshift(o),l&&s.push(l),s}function sY(t,e){const r=String(t.value),n=[],a=[];let i=0;for(;i<=r.length;){m8.lastIndex=i;const l=m8.exec(r),c=l&&"index"in l?l.index:r.length;n.push(s9e(r.slice(i,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,c===r.length?e.breakAfter:!0)),i=c+1}let s=-1,o;for(;++s<n.length;)n[s].charCodeAt(n[s].length-1)===8203||s<n.length-1&&n[s+1].charCodeAt(0)===8203?(a.push(n[s]),o=void 0):n[s]?(typeof o=="number"&&a.push(o),a.push(n[s]),o=0):(s===0||s===n.length-1)&&a.push(0);return a}function i9e(t){return[String(t.value)]}function s9e(t,e,r){const n=[];let a=0,i;for(;a<t.length;){f8.lastIndex=a;const s=f8.exec(t);i=s?s.index:t.length,!a&&!i&&s&&!e&&n.push(""),a!==i&&n.push(t.slice(a,i)),a=s?i+s[0].length:i}return a!==i&&!r&&n.push(""),n.join(" ")}function oY(t,e){if(t.type==="element"){const r=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function o9e(t){return!!(t.properties||{}).hidden}function l9e(t){return t.tagName==="td"||t.tagName==="th"}function c9e(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function u9e(t){const e="[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+",a="далее "+"возврат вызватьисключение выполнить для если и из или иначе иначеесли исключение каждого конецесли конецпопытки конеццикла не новый перейти перем по пока попытка прервать продолжить тогда цикл экспорт ",o="загрузитьизфайла "+"вебклиент вместо внешнеесоединение клиент конецобласти мобильноеприложениеклиент мобильноеприложениесервер наклиенте наклиентенасервере наклиентенасерверебезконтекста насервере насерверебезконтекста область перед после сервер толстыйклиентобычноеприложение толстыйклиентуправляемоеприложение тонкийклиент ",h="разделительстраниц разделительстрок символтабуляции "+"ansitooem oemtoansi ввестивидсубконто ввестиперечисление ввестипериод ввестиплансчетов выбранныйплансчетов датагод датамесяц датачисло заголовоксистемы значениевстроку значениеизстроки каталогиб каталогпользователя кодсимв конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лог лог10 максимальноеколичествосубконто названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найтиссылки началопериодаби началостандартногоинтервала начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода обработкаожидания основнойжурналрасчетов основнойплансчетов основнойязык очиститьокносообщений периодстр получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта префиксавтонумерации пропись пустоезначение разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо симв создатьобъект статусвозврата стрколичествострок сформироватьпозициюдокумента счетпокоду текущеевремя типзначения типзначениястр установитьтана установитьтапо фиксшаблон шаблон "+"acos asin atan base64значение base64строка cos exp log log10 pow sin sqrt tan xmlзначение xmlстрока xmlтип xmlтипзнч актив
Line truncated
|
||||
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}function WPe(t){const e="[a-z][a-zA-Z0-9_]*",r={className:"string",begin:"\\$.{1}"},n={className:"symbol",begin:"#"+t.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[t.COMMENT('"','"'),t.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:e+":",relevance:0},t.C_NUMBER_MODE,n,r,{begin:"\\|[ ]*"+e+"([ ]+"+e+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+e}]},{begin:"#\\(",end:"\\)",contains:[t.APOS_STRING_MODE,r,t.C_NUMBER_MODE,n]}]}}function KPe(t){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},t.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},t.inherit(t.APOS_STRING_MODE,{className:"string",relevance:0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}function jPe(t){const e={className:"variable",begin:/\b_+[a-zA-Z]\w*/},r={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},n={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},a=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],i=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],s=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSites","allTurrets","allUnits","allUnitsUAV","allUsers","allVariables","ambientTemperature","ammo","ammoOnPylon","and","animate","animateBay","animateDoor","animatePylon","animateLine truncated
|
||||
]*?"'`},{begin:`"[^\r
|
||||
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},t.COMMENT("^[ ]*\\*.*$",!1),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]}}function ZPe(t){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT("/\\*\\*!","\\*/"),t.C_NUMBER_MODE,t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}const JPe=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e6e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t6e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r6e=[...e6e,...t6e],n6e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),a6e=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),i6e=["after","backdrop","before","cu
Line truncated
|
||||
(multipart)?`,end:`\\]
|
||||
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}function c6e(t){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},"self"]}],relevance:10},{className:"keyword",begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:"variable",begin:/%[_a-zA-Z0-9:]+%/},{className:"symbol",begin:/\\[\\nt$%,()]/},{className:"symbol",begin:/\\u[a-fA-F0-9]{4}/}]}}function u6e(t){return{name:"Test Anything Protocol",case_insensitive:!0,contains:[t.HASH_COMMENT_MODE,{className:"meta",variants:[{begin:"^TAP version (\\d+)$"},{begin:"^1\\.\\.(\\d+)$"}]},{begin:/---$/,end:"\\.\\.\\.$",subLanguage:"yaml",relevance:0},{className:"number",begin:" (\\d+) "},{className:"symbol",variants:[{begin:"^ok"},{begin:"^not ok"}]}]}}function d6e(t){const e=t.regex,r=/[a-zA-Z_][a-zA-Z0-9_]*/,n={className:"number",variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[t.COMMENT(";[ \\t]*#","$"),t.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:e.concat(/\$/,e.optional(/::/),r,"(::",r,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[n]}]},{className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.inherit(t.QUOTE_STRING_MODE,{illegal:null})]},n]}}function h6e(t){const e=["bool","byte","i16","i32","i64","double","string","binary"];return{name:"Thrift",keywords:{keyword:["namespace","const","typedef","struct","enum","service","exception","void","oneway","set","list","map","required","optional"],type:e,literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"struct enum service exception",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:"\\b(set|list|map)\\s*<",keywords:{type:[...e,"set","list","map"]},end:">",contains:["self"]}]}}function p6e(t){const e={className:"number",begin:"[1-9][0-9]*",relevance:0},r={className:"symbol",begin:":[^\\]]+"},n={className:"built_in",begin:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",end:"\\]",contains:["self",e,r]},a={className:"built_in",begin:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",end:"\\]",contains:["self",e,t.QUOTE_STRING_MODE,r]};return{name:"TP",keywords:{keyword:["ABORT","ACC","ADJUST","AND","AP_LD","BREAK","CALL","CNT","COL","CONDITION","CONFIG","DA","DB","DIV","DETECT","ELSE","END","ENDFOR","ERR_NUM","ERROR_PROG","FINE","FOR","GP","GUARD","INC","IF","JMP","LINEAR_MAX_SPEED","LOCK","MOD","MONITOR","OFFSET","Offset","OR","OVERRIDE","PAUSE","PREG","PTH","RT_LD","RUN","SELECT","SKIP","Skip","TA","TB","TO","TOOL_OFFSET","Tool_Offset","UF","UT","UFRAME_NUM","UTOOL_NUM","UNLOCK","WAIT","X","Y","Z","W","P","R","STRLEN","SUBSTR","FINDSTR","VOFFSET","PROG","ATTR","MN","POS"],literal:["ON","OFF","max_speed","LPOS","JPOS","ENABLE","DISABLE","START","STOP","RESET"]},contains:[n,a,{className:"keyword",begin:"/(PROG|ATTR|MN|POS|END)\\b"},{className:"keyword",begin:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{className:"keyword",begin:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{className:"number",begin:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",relevance:0},t.CO
Line truncated
|
||||
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}function c6e(t){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},"self"]}],relevance:10},{className:"keyword",begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:"variable",begin:/%[_a-zA-Z0-9:]+%/},{className:"symbol",begin:/\\[\\nt$%,()]/},{className:"symbol",begin:/\\u[a-fA-F0-9]{4}/}]}}function u6e(t){return{name:"Test Anything Protocol",case_insensitive:!0,contains:[t.HASH_COMMENT_MODE,{className:"meta",variants:[{begin:"^TAP version (\\d+)$"},{begin:"^1\\.\\.(\\d+)$"}]},{begin:/---$/,end:"\\.\\.\\.$",subLanguage:"yaml",relevance:0},{className:"number",begin:" (\\d+) "},{className:"symbol",variants:[{begin:"^ok"},{begin:"^not ok"}]}]}}function d6e(t){const e=t.regex,r=/[a-zA-Z_][a-zA-Z0-9_]*/,n={className:"number",variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[t.COMMENT(";[ \\t]*#","$"),t.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:e.concat(/\$/,e.optional(/::/),r,"(::",r,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[n]}]},{className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.inherit(t.QUOTE_STRING_MODE,{illegal:null})]},n]}}function h6e(t){const e=["bool","byte","i16","i32","i64","double","string","binary"];return{name:"Thrift",keywords:{keyword:["namespace","const","typedef","struct","enum","service","exception","void","oneway","set","list","map","required","optional"],type:e,literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"struct enum service exception",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:"\\b(set|list|map)\\s*<",keywords:{type:[...e,"set","list","map"]},end:">",contains:["self"]}]}}function p6e(t){const e={className:"number",begin:"[1-9][0-9]*",relevance:0},r={className:"symbol",begin:":[^\\]]+"},n={className:"built_in",begin:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",end:"\\]",contains:["self",e,r]},a={className:"built_in",begin:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",end:"\\]",contains:["self",e,t.QUOTE_STRING_MODE,r]};return{name:"TP",keywords:{keyword:["ABORT","ACC","ADJUST","AND","AP_LD","BREAK","CALL","CNT","COL","CONDITION","CONFIG","DA","DB","DIV","DETECT","ELSE","END","ENDFOR","ERR_NUM","ERROR_PROG","FINE","FOR","GP","GUARD","INC","IF","JMP","LINEAR_MAX_SPEED","LOCK","MOD","MONITOR","OFFSET","Offset","OR","OVERRIDE","PAUSE","PREG","PTH","RT_LD","RUN","SELECT","SKIP","Skip","TA","TB","TO","TOOL_OFFSET","Tool_Offset","UF","UT","UFRAME_NUM","UTOOL_NUM","UNLOCK","WAIT","X","Y","Z","W","P","R","STRLEN","SUBSTR","FINDSTR","VOFFSET","PROG","ATTR","MN","POS"],literal:["ON","OFF","max_speed","LPOS","JPOS","ENABLE","DISABLE","START","STOP","RESET"]},contains:[n,a,{className:"keyword",begin:"/(PROG|ATTR|MN|POS|END)\\b"},{className:"keyword",begin:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{className:"keyword",begin:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{className:"number",begin:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",relevance:0},t.CO
Line truncated
|
||||
`},c]}}const e7e=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t7e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r7e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n7e=[...t7e,...r7e],a7e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),pY=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),mY=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),i7e=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-t
Line truncated
|
||||
]`,f={scope:"string",variants:[u,c,d,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],y={keyword:_,literal:(G=>{const K=[];return G.forEach(z=>{K.push(z),z.toLowerCase()===z?K.push(z.toUpperCase()):K.push(z.toLowerCase())}),K})(b),built_in:S},v=G=>G.map(K=>K.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",v(S).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},w=e.concat(n,"\\b(?!\\()"),A={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[a,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},x={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[I,s,A,t.C_BLOCK_COMMENT_MODE,f,g,T]},D={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",v(_).join("\\b|"),"|",v(S).join("\\b|"),"\\b)"),n,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[x]};x.contains.push(D);const $=[I,A,t.C_BLOCK_COMMENT_MODE,f,g,T],H={begin:e.concat(/#\[\s*\\?/,e.either(a,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...$]},...$,{scope:"meta",variants:[{match:a},{match:i}]}]};return{case_insensitive:!1,keywords:y,contains:[H,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,D,A,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",H,s,A,t.C_BLOCK_COMMENT_MODE,f,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"cl
Line truncated
|
||||
]`,f={scope:"string",variants:[u,c,d,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],y={keyword:_,literal:(G=>{const K=[];return G.forEach(z=>{K.push(z),z.toLowerCase()===z?K.push(z.toUpperCase()):K.push(z.toLowerCase())}),K})(b),built_in:S},v=G=>G.map(K=>K.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",v(S).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},w=e.concat(n,"\\b(?!\\()"),A={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[a,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},x={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[I,s,A,t.C_BLOCK_COMMENT_MODE,f,g,T]},D={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",v(_).join("\\b|"),"|",v(S).join("\\b|"),"\\b)"),n,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[x]};x.contains.push(D);const $=[I,A,t.C_BLOCK_COMMENT_MODE,f,g,T],H={begin:e.concat(/#\[\s*\\?/,e.either(a,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...$]},...$,{scope:"meta",variants:[{match:a},{match:i}]}]};return{case_insensitive:!1,keywords:y,contains:[H,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,D,A,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",H,s,A,t.C_BLOCK_COMMENT_MODE,f,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"cl
Line truncated
|
||||
`}]}function nLe(t,e){const r=e.value?e.value+`
|
||||
`:"",n={},a=e.lang?e.lang.split(/\s+/):[];a.length>0&&(n.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return e.meta&&(i.data={meta:e.meta}),t.patch(e,i),i=t.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},t.patch(e,i),i}function aLe(t,e){const r={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function iLe(t,e){const r={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function sLe(t,e){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),a=um(n.toLowerCase()),i=t.footnoteOrder.indexOf(n);let s,o=t.footnoteCounts.get(n);o===void 0?(o=0,t.footnoteOrder.push(n),s=t.footnoteOrder.length):s=i+1,o+=1,t.footnoteCounts.set(n,o);const l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,c),t.applyData(e,c)}function oLe(t,e){const r={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function lLe(t,e){if(t.options.allowDangerousHtml){const r={type:"raw",value:e.value};return t.patch(e,r),t.applyData(e,r)}}function RY(t,e){const r=e.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const a=t.all(e),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const s=a[a.length-1];return s&&s.type==="text"?s.value+=n:a.push({type:"text",value:n}),a}function cLe(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return RY(t,e);const a={src:um(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"img",properties:a,children:[]};return t.patch(e,i),t.applyData(e,i)}function uLe(t,e){const r={src:um(e.url)};e.alt!==null&&e.alt!==void 0&&(r.alt=e.alt),e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,n),t.applyData(e,n)}function dLe(t,e){const r={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return t.patch(e,n),t.applyData(e,n)}function hLe(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return RY(t,e);const a={href:um(n.url||"")};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"a",properties:a,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function pLe(t,e){const r={href:um(e.url)};e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function mLe(t,e,r){const n=t.all(e),a=r?fLe(r):OY(e),i={},s=[];if(typeof e.checked=="boolean"){const u=n[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<n.length;){const u=n[o];(a||o!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
||||
`}),u.type==="element"&&u.tagName==="p"&&!a?s.push(...u.children):s.push(u)}const l=n[n.length-1];l&&(a||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
||||
`});const c={type:"element",tagName:"li",properties:i,children:s};return t.patch(e,c),t.applyData(e,c)}function fLe(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const r=t.children;let n=-1;for(;!e&&++n<r.length;)e=OY(r[n])}return e}function OY(t){const e=t.spread;return e??t.children.length>1}function gLe(t,e){const r={},n=t.all(e);let a=-1;for(typeof e.start=="number"&&e.start!==1&&(r.start=e.start);++a<n.length;){const s=n[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:r,children:t.wrap(n,!0)};return t.patch(e,i),t.applyData(e,i)}function _Le(t,e){const r={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function bLe(t,e){const r={type:"root",children:t.wrap(t.all(e))};return t.patch(e,r),t.applyData(e,r)}function SLe(t,e){const r={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}const NY=xY("end"),IY=xY("start");function xY(t){return e;function e(r){const n=r&&r.position&&r.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function ELe(t){const e=IY(t),r=NY(t);if(e&&r)return{start:e,end:r}}function vLe(t,e){const r=t.all(e),n=r.shift(),a=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([n],!0)};t.patch(e.children[0],s),a.push(s)}if(r.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},o=IY(e.children[1]),l=NY(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(a,!0)};return t.patch(e,i),t.applyData(e,i)}function yLe(t,e,r){const n=r?r.children:void 0,i=(n?n.indexOf(e):1)===0?"th":"td",s=r&&r.type==="table"?r.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const d=e.children[l],h={},m=s?s[l]:void 0;m&&(h.align=m);let f={type:"element",tagName:i,properties:h,children:[]};d&&(f.children=t.all(d),t.patch(d,f),f=t.applyData(d,f)),c.push(f)}const u={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,u),t.applyData(e,u)}function TLe(t,e){const r={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}const C8=9,w8=32;function CLe(t){const e=String(t),r=/\r?\n|\r/g;let n=r.exec(e),a=0;const i=[];for(;n;)i.push(A8(e.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=r.exec(e);return i.push(A8(e.slice(a),a>0,!1)),i.join("")}function A8(t,e,r){let n=0,a=t.length;if(e){let i=t.codePointAt(n);for(;i===C8||i===w8;)n++,i=t.codePointAt(n)}if(r){let i=t.codePointAt(a-1);for(;i===C8||i===w8;)a--,i=t.codePointAt(a-1)}return a>n?t.slice(n,a):""}function wLe(t,e){const r={type:"text",value:CLe(String(e.value))};return t.patch(e,r),t.applyData(e,r)}function ALe(t,e){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,r),t.applyData(e,r)}const RLe={blockquote:tLe,break:rLe,code:nLe,delete:aLe,emphasis:iLe,footnoteReference:sLe,heading:oLe,html:lLe,imageReference:cLe,image:uLe,inlineCode:dLe,linkReference:hLe,link:pLe,listItem:mLe,list:gLe,paragraph:_Le,root:bLe,strong:SLe,table:vLe,tableCell:TLe,tableRow:yLe,text:wLe,thematicBreak:ALe,toml:p1,yaml:p1,definition:p1,footnoteDefinition:p1};function p1(){}const DY=-1,PE=0,mf=1,Qb=2,A3=3,R3=4,O3=5,N3=6,MY=7,kY=8,R8=typeof self=="object"?self:globalThis,OLe=(t,e)=>{const r=(a,i)=>(t.set(i,a),a),n=a=>{if(t.has(a))return t.get(a);const[i,s]=e[a];switch(i){case PE:case DY:return r(s,a);case mf:{const o=r([],a);for(const l of s)o.push(n(l));return o}case Qb:{const o=r({},a);for(const[l,c]of s)o[n(l)]=n(c);return o}case A3:return r(new Date(s),a);case R3:{const{source:o,flags:l}=s;return r(new RegExp(o,l),a)}case O3:{const o=r(new Map,a);for(const[l,c]of s)o.set(n(l),n(c));return o}case N3:{const o=r(new Set,a);for(const l of s)o.add(n(l));return o}case MY:{const{name:o,message:l}=s;return r(new R8[o](l),a)}case kY:return r(BigInt(s),a);case"BigInt":return r(Object(BigInt(s)),a);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return r(new DataView(o),s)}}return r(new R8[i](s),a)};return n},O8=t=>OLe(new Map,t)(0),Bh="",{toString:NLe}={},{keys:ILe}=Object,Gm=t=>{const e=typeof t;if(e!=="object"||!t)return[PE,e];const r=NLe.call(t).slice(8,-1);switch(r){case"Array":return[mf,Bh];case"Object":return[Qb,Bh];case"Date":return[A3,Bh];case"RegExp":return[R3,Bh];case"Map":return[O3,Bh];case"Set":return[N3,Bh];case"DataView":return[mf,r]}return r.includes("Array")?[mf,r]:r.includes("Error")?[MY,r]:[Qb,r]},m1=([t,e])=>t===PE&&(e==="function"||e==="symbol"),xLe=(t,e,r,n)=>{const a=(s,o)=>{const l=n.push(s)-1;
Line truncated
|
||||
`});const c={type:"element",tagName:"li",properties:i,children:s};return t.patch(e,c),t.applyData(e,c)}function fLe(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const r=t.children;let n=-1;for(;!e&&++n<r.length;)e=OY(r[n])}return e}function OY(t){const e=t.spread;return e??t.children.length>1}function gLe(t,e){const r={},n=t.all(e);let a=-1;for(typeof e.start=="number"&&e.start!==1&&(r.start=e.start);++a<n.length;){const s=n[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:r,children:t.wrap(n,!0)};return t.patch(e,i),t.applyData(e,i)}function _Le(t,e){const r={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function bLe(t,e){const r={type:"root",children:t.wrap(t.all(e))};return t.patch(e,r),t.applyData(e,r)}function SLe(t,e){const r={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}const NY=xY("end"),IY=xY("start");function xY(t){return e;function e(r){const n=r&&r.position&&r.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function ELe(t){const e=IY(t),r=NY(t);if(e&&r)return{start:e,end:r}}function vLe(t,e){const r=t.all(e),n=r.shift(),a=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([n],!0)};t.patch(e.children[0],s),a.push(s)}if(r.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},o=IY(e.children[1]),l=NY(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(a,!0)};return t.patch(e,i),t.applyData(e,i)}function yLe(t,e,r){const n=r?r.children:void 0,i=(n?n.indexOf(e):1)===0?"th":"td",s=r&&r.type==="table"?r.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const d=e.children[l],h={},m=s?s[l]:void 0;m&&(h.align=m);let f={type:"element",tagName:i,properties:h,children:[]};d&&(f.children=t.all(d),t.patch(d,f),f=t.applyData(d,f)),c.push(f)}const u={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,u),t.applyData(e,u)}function TLe(t,e){const r={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}const C8=9,w8=32;function CLe(t){const e=String(t),r=/\r?\n|\r/g;let n=r.exec(e),a=0;const i=[];for(;n;)i.push(A8(e.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=r.exec(e);return i.push(A8(e.slice(a),a>0,!1)),i.join("")}function A8(t,e,r){let n=0,a=t.length;if(e){let i=t.codePointAt(n);for(;i===C8||i===w8;)n++,i=t.codePointAt(n)}if(r){let i=t.codePointAt(a-1);for(;i===C8||i===w8;)a--,i=t.codePointAt(a-1)}return a>n?t.slice(n,a):""}function wLe(t,e){const r={type:"text",value:CLe(String(e.value))};return t.patch(e,r),t.applyData(e,r)}function ALe(t,e){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,r),t.applyData(e,r)}const RLe={blockquote:tLe,break:rLe,code:nLe,delete:aLe,emphasis:iLe,footnoteReference:sLe,heading:oLe,html:lLe,imageReference:cLe,image:uLe,inlineCode:dLe,linkReference:hLe,link:pLe,listItem:mLe,list:gLe,paragraph:_Le,root:bLe,strong:SLe,table:vLe,tableCell:TLe,tableRow:yLe,text:wLe,thematicBreak:ALe,toml:p1,yaml:p1,definition:p1,footnoteDefinition:p1};function p1(){}const DY=-1,LE=0,mf=1,Xb=2,A3=3,R3=4,O3=5,N3=6,MY=7,kY=8,R8=typeof self=="object"?self:globalThis,OLe=(t,e)=>{const r=(a,i)=>(t.set(i,a),a),n=a=>{if(t.has(a))return t.get(a);const[i,s]=e[a];switch(i){case LE:case DY:return r(s,a);case mf:{const o=r([],a);for(const l of s)o.push(n(l));return o}case Xb:{const o=r({},a);for(const[l,c]of s)o[n(l)]=n(c);return o}case A3:return r(new Date(s),a);case R3:{const{source:o,flags:l}=s;return r(new RegExp(o,l),a)}case O3:{const o=r(new Map,a);for(const[l,c]of s)o.set(n(l),n(c));return o}case N3:{const o=r(new Set,a);for(const l of s)o.add(n(l));return o}case MY:{const{name:o,message:l}=s;return r(new R8[o](l),a)}case kY:return r(BigInt(s),a);case"BigInt":return r(Object(BigInt(s)),a);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return r(new DataView(o),s)}}return r(new R8[i](s),a)};return n},O8=t=>OLe(new Map,t)(0),Uh="",{toString:NLe}={},{keys:ILe}=Object,Gm=t=>{const e=typeof t;if(e!=="object"||!t)return[LE,e];const r=NLe.call(t).slice(8,-1);switch(r){case"Array":return[mf,Uh];case"Object":return[Xb,Uh];case"Date":return[A3,Uh];case"RegExp":return[R3,Uh];case"Map":return[O3,Uh];case"Set":return[N3,Uh];case"DataView":return[mf,r]}return r.includes("Array")?[mf,r]:r.includes("Error")?[MY,r]:[Xb,r]},m1=([t,e])=>t===LE&&(e==="function"||e==="symbol"),xLe=(t,e,r,n)=>{const a=(s,o)=>{const l=n.push(s)-1;
Line truncated
|
||||
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
|
||||
`}]}}const z2={}.hasOwnProperty,PLe={};function LLe(t,e){const r=e||PLe,n=new Map,a=new Map,i=new Map,s={...RLe,...r.handlers},o={all:c,applyData:BLe,definitionById:n,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:r,patch:FLe,wrap:GLe};return su(t,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?n:a,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),o;function l(u,d){const h=u.type,m=o.handlers[h];if(z2.call(o.handlers,h)&&m)return m(o,u,d);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in u){const{children:g,...b}=u,_=Xb(b);return _.children=o.all(u),_}return Xb(u)}return(o.options.unknownHandler||ULe)(o,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let m=-1;for(;++m<h.length;){const f=o.one(h[m],u);if(f){if(m&&h[m-1].type==="break"&&(!Array.isArray(f)&&f.type==="text"&&(f.value=I8(f.value)),!Array.isArray(f)&&f.type==="element")){const g=f.children[0];g&&g.type==="text"&&(g.value=I8(g.value))}Array.isArray(f)?d.push(...f):d.push(f)}}}return d}}function FLe(t,e){t.position&&(e.position=ELe(t))}function BLe(t,e){let r=e;if(t&&t.data){const n=t.data.hName,a=t.data.hChildren,i=t.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const s="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:s}}r.type==="element"&&i&&Object.assign(r.properties,Xb(i)),"children"in r&&r.children&&a!==null&&a!==void 0&&(r.children=a)}return r}function ULe(t,e){const r=e.data||{},n="value"in e&&!(z2.call(r,"hProperties")||z2.call(r,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function GLe(t,e){const r=[];let n=-1;for(e&&r.push({type:"text",value:`
|
||||
`}]}}const $2={}.hasOwnProperty,PLe={};function LLe(t,e){const r=e||PLe,n=new Map,a=new Map,i=new Map,s={...RLe,...r.handlers},o={all:c,applyData:BLe,definitionById:n,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:r,patch:FLe,wrap:GLe};return su(t,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?n:a,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),o;function l(u,d){const h=u.type,m=o.handlers[h];if($2.call(o.handlers,h)&&m)return m(o,u,d);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in u){const{children:g,...b}=u,_=Zb(b);return _.children=o.all(u),_}return Zb(u)}return(o.options.unknownHandler||ULe)(o,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let m=-1;for(;++m<h.length;){const f=o.one(h[m],u);if(f){if(m&&h[m-1].type==="break"&&(!Array.isArray(f)&&f.type==="text"&&(f.value=I8(f.value)),!Array.isArray(f)&&f.type==="element")){const g=f.children[0];g&&g.type==="text"&&(g.value=I8(g.value))}Array.isArray(f)?d.push(...f):d.push(f)}}}return d}}function FLe(t,e){t.position&&(e.position=ELe(t))}function BLe(t,e){let r=e;if(t&&t.data){const n=t.data.hName,a=t.data.hChildren,i=t.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const s="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:s}}r.type==="element"&&i&&Object.assign(r.properties,Zb(i)),"children"in r&&r.children&&a!==null&&a!==void 0&&(r.children=a)}return r}function ULe(t,e){const r=e.data||{},n="value"in e&&!($2.call(r,"hProperties")||$2.call(r,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function GLe(t,e){const r=[];let n=-1;for(e&&r.push({type:"text",value:`
|
||||
`});++n<t.length;)n&&r.push({type:"text",value:`
|
||||
`}),r.push(t[n]);return e&&t.length>0&&r.push({type:"text",value:`
|
||||
`}),r}function I8(t){let e=0,r=t.charCodeAt(e);for(;r===9||r===32;)e++,r=t.charCodeAt(e);return t.slice(e)}function x8(t,e){const r=LLe(t,e),n=r.one(t,void 0),a=kLe(r),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
|
||||
`},a),i}function qLe(t,e){return t&&"run"in t?async function(r,n){const a=x8(r,{file:n,...e});await t.run(a,n)}:function(r,n){return x8(r,{file:n,...t||e})}}class Fg{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}}Fg.prototype.normal={};Fg.prototype.property={};Fg.prototype.space=void 0;function PY(t,e){const r={},n={};for(const a of t)Object.assign(r,a.property),Object.assign(n,a.normal);return new Fg(r,n,e)}function Hf(t){return t.toLowerCase()}class Ls{constructor(e,r){this.attribute=r,this.property=e}}Ls.prototype.attribute="";Ls.prototype.booleanish=!1;Ls.prototype.boolean=!1;Ls.prototype.commaOrSpaceSeparated=!1;Ls.prototype.commaSeparated=!1;Ls.prototype.defined=!1;Ls.prototype.mustUseProperty=!1;Ls.prototype.number=!1;Ls.prototype.overloadedBoolean=!1;Ls.prototype.property="";Ls.prototype.spaceSeparated=!1;Ls.prototype.space=void 0;let zLe=0;const sn=Th(),Wa=Th(),$2=Th(),Vt=Th(),oa=Th(),Ep=Th(),$s=Th();function Th(){return 2**++zLe}const H2=Object.freeze(Object.defineProperty({__proto__:null,boolean:sn,booleanish:Wa,commaOrSpaceSeparated:$s,commaSeparated:Ep,number:Vt,overloadedBoolean:$2,spaceSeparated:oa},Symbol.toStringTag,{value:"Module"})),EA=Object.keys(H2);class I3 extends Ls{constructor(e,r,n,a){let i=-1;if(super(e,r),D8(this,"space",a),typeof n=="number")for(;++i<EA.length;){const s=EA[i];D8(this,EA[i],(n&H2[s])===H2[s])}}}I3.prototype.defined=!0;function D8(t,e,r){r&&(t[e]=r)}function pm(t){const e={},r={};for(const[n,a]of Object.entries(t.properties)){const i=new I3(n,t.transform(t.attributes||{},n),a,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),e[n]=i,r[Hf(n)]=n,r[Hf(i.attribute)]=n}return new Fg(e,r,t.space)}const LY=pm({properties:{ariaActiveDescendant:null,ariaAtomic:Wa,ariaAutoComplete:null,ariaBusy:Wa,ariaChecked:Wa,ariaColCount:Vt,ariaColIndex:Vt,ariaColSpan:Vt,ariaControls:oa,ariaCurrent:null,ariaDescribedBy:oa,ariaDetails:null,ariaDisabled:Wa,ariaDropEffect:oa,ariaErrorMessage:null,ariaExpanded:Wa,ariaFlowTo:oa,ariaGrabbed:Wa,ariaHasPopup:null,ariaHidden:Wa,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:oa,ariaLevel:Vt,ariaLive:null,ariaModal:Wa,ariaMultiLine:Wa,ariaMultiSelectable:Wa,ariaOrientation:null,ariaOwns:oa,ariaPlaceholder:null,ariaPosInSet:Vt,ariaPressed:Wa,ariaReadOnly:Wa,ariaRelevant:null,ariaRequired:Wa,ariaRoleDescription:oa,ariaRowCount:Vt,ariaRowIndex:Vt,ariaRowSpan:Vt,ariaSelected:Wa,ariaSetSize:Vt,ariaSort:null,ariaValueMax:Vt,ariaValueMin:Vt,ariaValueNow:Vt,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function FY(t,e){return e in t?t[e]:e}function BY(t,e){return FY(t,e.toLowerCase())}const $Le=pm({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ep,acceptCharset:oa,accessKey:oa,action:null,allow:null,allowFullScreen:sn,allowPaymentRequest:sn,allowUserMedia:sn,alt:null,as:null,async:sn,autoCapitalize:null,autoComplete:oa,autoFocus:sn,autoPlay:sn,blocking:oa,capture:null,charSet:null,checked:sn,cite:null,className:oa,cols:Vt,colSpan:null,content:null,contentEditable:Wa,controls:sn,controlsList:oa,coords:Vt|Ep,crossOrigin:null,data:null,dateTime:null,decoding:null,default:sn,defer:sn,dir:null,dirName:null,disabled:sn,download:$2,draggable:Wa,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:sn,formTarget:null,headers:oa,height:Vt,hidden:$2,high:Vt,href:null,hrefLang:null,htmlFor:oa,httpEquiv:oa,id:null,imageSizes:null,imageSrcSet:null,inert:sn,inputMode:null,integrity:null,is:null,isMap:sn,itemId:null,itemProp:oa,itemRef:oa,itemScope:sn,itemType:oa,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:sn,low:Vt,manifest:null,max:null,maxLength:Vt,media:null,method:null,min:null,minLength:Vt,multiple:sn,muted:sn,name:null,nonce:null,noModule:sn,noValidate:sn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:n
Line truncated
|
||||
`},a),i}function qLe(t,e){return t&&"run"in t?async function(r,n){const a=x8(r,{file:n,...e});await t.run(a,n)}:function(r,n){return x8(r,{file:n,...t||e})}}class Fg{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}}Fg.prototype.normal={};Fg.prototype.property={};Fg.prototype.space=void 0;function PY(t,e){const r={},n={};for(const a of t)Object.assign(r,a.property),Object.assign(n,a.normal);return new Fg(r,n,e)}function Hf(t){return t.toLowerCase()}class Ls{constructor(e,r){this.attribute=r,this.property=e}}Ls.prototype.attribute="";Ls.prototype.booleanish=!1;Ls.prototype.boolean=!1;Ls.prototype.commaOrSpaceSeparated=!1;Ls.prototype.commaSeparated=!1;Ls.prototype.defined=!1;Ls.prototype.mustUseProperty=!1;Ls.prototype.number=!1;Ls.prototype.overloadedBoolean=!1;Ls.prototype.property="";Ls.prototype.spaceSeparated=!1;Ls.prototype.space=void 0;let zLe=0;const sn=Ch(),Wa=Ch(),H2=Ch(),Vt=Ch(),oa=Ch(),Ep=Ch(),$s=Ch();function Ch(){return 2**++zLe}const Y2=Object.freeze(Object.defineProperty({__proto__:null,boolean:sn,booleanish:Wa,commaOrSpaceSeparated:$s,commaSeparated:Ep,number:Vt,overloadedBoolean:H2,spaceSeparated:oa},Symbol.toStringTag,{value:"Module"})),vA=Object.keys(Y2);class I3 extends Ls{constructor(e,r,n,a){let i=-1;if(super(e,r),D8(this,"space",a),typeof n=="number")for(;++i<vA.length;){const s=vA[i];D8(this,vA[i],(n&Y2[s])===Y2[s])}}}I3.prototype.defined=!0;function D8(t,e,r){r&&(t[e]=r)}function pm(t){const e={},r={};for(const[n,a]of Object.entries(t.properties)){const i=new I3(n,t.transform(t.attributes||{},n),a,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),e[n]=i,r[Hf(n)]=n,r[Hf(i.attribute)]=n}return new Fg(e,r,t.space)}const LY=pm({properties:{ariaActiveDescendant:null,ariaAtomic:Wa,ariaAutoComplete:null,ariaBusy:Wa,ariaChecked:Wa,ariaColCount:Vt,ariaColIndex:Vt,ariaColSpan:Vt,ariaControls:oa,ariaCurrent:null,ariaDescribedBy:oa,ariaDetails:null,ariaDisabled:Wa,ariaDropEffect:oa,ariaErrorMessage:null,ariaExpanded:Wa,ariaFlowTo:oa,ariaGrabbed:Wa,ariaHasPopup:null,ariaHidden:Wa,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:oa,ariaLevel:Vt,ariaLive:null,ariaModal:Wa,ariaMultiLine:Wa,ariaMultiSelectable:Wa,ariaOrientation:null,ariaOwns:oa,ariaPlaceholder:null,ariaPosInSet:Vt,ariaPressed:Wa,ariaReadOnly:Wa,ariaRelevant:null,ariaRequired:Wa,ariaRoleDescription:oa,ariaRowCount:Vt,ariaRowIndex:Vt,ariaRowSpan:Vt,ariaSelected:Wa,ariaSetSize:Vt,ariaSort:null,ariaValueMax:Vt,ariaValueMin:Vt,ariaValueNow:Vt,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function FY(t,e){return e in t?t[e]:e}function BY(t,e){return FY(t,e.toLowerCase())}const $Le=pm({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ep,acceptCharset:oa,accessKey:oa,action:null,allow:null,allowFullScreen:sn,allowPaymentRequest:sn,allowUserMedia:sn,alt:null,as:null,async:sn,autoCapitalize:null,autoComplete:oa,autoFocus:sn,autoPlay:sn,blocking:oa,capture:null,charSet:null,checked:sn,cite:null,className:oa,cols:Vt,colSpan:null,content:null,contentEditable:Wa,controls:sn,controlsList:oa,coords:Vt|Ep,crossOrigin:null,data:null,dateTime:null,decoding:null,default:sn,defer:sn,dir:null,dirName:null,disabled:sn,download:H2,draggable:Wa,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:sn,formTarget:null,headers:oa,height:Vt,hidden:H2,high:Vt,href:null,hrefLang:null,htmlFor:oa,httpEquiv:oa,id:null,imageSizes:null,imageSrcSet:null,inert:sn,inputMode:null,integrity:null,is:null,isMap:sn,itemId:null,itemProp:oa,itemRef:oa,itemScope:sn,itemType:oa,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:sn,low:Vt,manifest:null,max:null,maxLength:Vt,media:null,method:null,min:null,minLength:Vt,multiple:sn,muted:sn,name:null,nonce:null,noModule:sn,noValidate:sn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:n
Line truncated
|
||||
\f\r &/=>`.split(""),`
|
||||
\f\r "&'/=>\``.split("")],[`\0
|
||||
\f\r "&'/<=>`.split(""),`\0
|
||||
@@ -469,6 +469,6 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
||||
\f\r &>`.split(""),`\0
|
||||
\f\r "&'<=>\``.split("")],[`\0
|
||||
\f\r "&'<=>\``.split(""),`\0
|
||||
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function iFe(t,e,r,n){const a=n.schema,i=a.space==="svg"?!1:n.settings.omitOptionalTags;let s=a.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(t.tagName.toLowerCase());const o=[];let l;a.space==="html"&&t.tagName==="svg"&&(n.schema=x3);const c=sFe(n,t.properties),u=n.all(a.space==="html"&&t.tagName==="template"?t.content:t);return n.schema=a,u&&(s=!1),(c||!i||!J8e(t,e,r))&&(o.push("<",t.tagName,c?" "+c:""),s&&(a.space==="svg"||n.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!i||!M3(t,e,r))&&o.push("</"+t.tagName+">"),o.join("")}function sFe(t,e){const r=[];let n=-1,a;if(e){for(a in e)if(e[a]!==null&&e[a]!==void 0){const i=oFe(t,a,e[a]);i&&r.push(i)}}for(;++n<r.length;){const i=t.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&i!=='"'&&i!=="'"&&(r[n]+=" ")}return r.join("")}function oFe(t,e,r){const n=zY(t.schema,e),a=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let s=t.quote,o;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const l=vp(n.attribute,Object.assign({},t.settings.characterReferences,{subset:g1.name[a][i]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?jLe:XLe)(r,{padLeft:!t.settings.tightCommaSeparatedLists}):String(r),t.settings.collapseEmptyAttributes&&!r)?l:(t.settings.preferUnquoted&&(o=vp(r,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:g1.unquoted[a][i]}))),o!==r&&(t.settings.quoteSmart&&zb(r,s)>zb(r,t.alternative)&&(s=t.alternative),o=s+vp(r,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?g1.single:g1.double)[a][i],attribute:!0}))+s),l+(o&&"="+o))}const lFe=["<","&"];function XY(t,e,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?t.value:vp(t.value,Object.assign({},n.settings.characterReferences,{subset:lFe}))}function cFe(t,e,r,n){return n.settings.allowDangerousHtml?t.value:XY(t,e,r,n)}function uFe(t,e,r,n){return n.all(t)}const dFe=D$("type",{invalid:hFe,unknown:pFe,handlers:{comment:L8e,doctype:F8e,element:iFe,raw:cFe,root:uFe,text:XY}});function hFe(t){throw new Error("Expected node, not `"+t+"`")}function pFe(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const mFe={},fFe={},gFe=[];function _Fe(t,e){const r=e||mFe,n=r.quote||'"',a=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:bFe,all:SFe,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||g8e,characterReferences:r.characterReferences||fFe,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?x3:$Y,quote:n,alternative:a}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function bFe(t,e,r){return dFe(t,e,r,this)}function SFe(t){const e=[],r=t&&t.children||gFe;let n=-1;for(;++n<r.length;)e[n]=this.one(r[n],n,t);return e.join("")}function EFe(t){const e=this,r={...e.data("settings"),...t};e.compiler=n;function n(a){return _Fe(a,r)}}function ZY(t){const e=[...t.matchAll(Tae)];if(!e.length)return[{type:"text",value:t}];const r=[];let n=0;for(const a of e)a.index>n&&r.push({type:"text",value:t.slice(n,a.index)}),r.push({type:"element",tagName:"br",properties:{},children:[]}),n=a.index+a[0].length;return n<t.length&&r.push({type:"text",value:t.slice(n)}),r}function vFe(t){const e=t.trim().match(Cae);if(!e)return null;const r=e[1],n=[];let a=0;for(const i of r.matchAll(wae)){if(r.slice(a,i.index).trim())return null;n.push({type:"element",tagName:"li",properties:{},children:ZY(i[1]??"")}),a=i.index+i[0].length}return!n.length||r.slice(a).trim()?null:{type:"element",tagName:"ul",properties:{},children:n}}function yFe(t){RE(t,"text",(e,r)=>{const n=r[r.length-1];if(!n||n.type!=="element")return;const i=n.children,s=i.indexOf(e);if(s===-1)return;let o="",l=s;for(let d=s;d<i.length;d++){const h=i[d];if(h.type==="text")o+=h.value,l=d;else if(h.type==="element"&&h.tagName==="br")o+=`
|
||||
`,l=d;else break}const c=vFe(o);if(c){i.splice(s,l-s+1,c);return}const u=ZY(e.value);(u.length!==1||u[0]!==e)&&i.splice(s,1,...u)})}const TFe=()=>t=>{su(t,"element",e=>{(e.tagName==="td"||e.tagName==="th")&&yFe(e)})},CFe=()=>t=>{su(t,"element",e=>{if(e.tagName!=="a")return;const r=e.properties??{};r.href&&(r.target="_blank",r.rel="noopener noreferrer",e.properties=r)})},wFe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',AFe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye lucide-eye-icon"><path d="M2.062 12.345a1 1 0 0 1 0-.69C3.5 7.73 7.36 5 12 5s8.5 2.73 9.938 6.655a1 1 0 0 1 0 .69C20.5 16.27 16.64 19 12 19s-8.5-2.73-9.938-6.655"/><circle cx="12" cy="12" r="3"/></svg>';function JY(t){return{type:"element",tagName:"span",properties:{},children:[{type:"raw",value:t}]}}function RFe(t){return{type:"element",tagName:"button",properties:{className:[ine],"data-code-id":t,title:"Copy code",type:"button"},children:[JY(wFe)]}}function OFe(t){return{type:"element",tagName:"button",properties:{className:[sne],"data-code-id":t,title:"Preview code",type:"button"},children:[JY(AFe)]}}function NFe(t,e){const r=[RFe(e)];return t.toLowerCase()==="html"&&r.push(OFe(e)),{type:"element",tagName:"div",properties:{className:[rne]},children:[{type:"element",tagName:"span",properties:{className:[ane]},children:[{type:"text",value:t}]},{type:"element",tagName:"div",properties:{className:[nne]},children:r}]}}function IFe(t){return{type:"element",tagName:"div",properties:{className:[ene]},children:[t]}}function xFe(t,e){return{type:"element",tagName:"div",properties:{className:[tne,one]},children:[t,IFe(e)]}}function DFe(t){const e=t.properties?.className;if(!Array.isArray(e))return"text";for(const r of e)if(typeof r=="string"&&r.startsWith("language-"))return r.replace("language-","");return"text"}function MFe(){return typeof window<"u"?`code-${window.idxCodeBlock=(window.idxCodeBlock??0)+1}`:`code-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}const kFe=()=>t=>{su(t,"element",(e,r,n)=>{if(e.tagName!=="pre"||!n||r===void 0)return;const a=e.children.find(c=>c.type==="element"&&c.tagName==="code");if(!a)return;const i=DFe(a),s=MFe();a.properties={...a.properties,"data-code-id":s};const o=NFe(i,s),l=xFe(o,e);n.children[r]=l})};function PFe(t){return e=>{su(e,"element",r=>{if(r.tagName==="img"&&r.properties?.src){const n=String(r.properties.src);if(n.startsWith(ho.DATA)||n.startsWith(ho.HTTP))return;const a=t.attachments?.find(i=>i.type===Qr.IMAGE&&i.name===n);a?.base64Url&&(r.properties.src=a.base64Url)}})}}const LFe=()=>t=>{su(t,"element",e=>{e.children&&e.children.length>0&&(e.properties={...e.properties,dir:"auto"})})};function FFe(t){let e=0,r="";for(;e<t.length;){const n=t[e];if(n===" "){r+=ZU,e+=1;continue}if(n===" "){r+=Dne,e+=1;continue}break}return r+t.slice(e)}function BFe(t){const e=t.split(Ine),r=[];for(const[n,a]of e.entries())n>0&&r.push({type:"break"}),r.push({type:"text",value:FFe(a)});return r.length||r.push({type:"text",value:""}),r}const UFe=()=>t=>{su(t,"html",(e,r,n)=>{if(!n||typeof r!="number")return;const a=BFe(e.value);if(!xne.has(n.type)){const i={type:"paragraph",children:a,data:{literalHtml:!0}},s=n.children;if(s.splice(r,1,i),r>0){const o=s[r-1];if(o?.type==="paragraph"&&o.data?.literalHtml){const l=o.children;return l.length&&l[l.length-1].type!=="break"&&l.push({type:"break"}),l.push(...i.children),s.splice(r,1),r}}return r+1}return n.children.splice(r,1,...a),r+a.length})},eV="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}",tV="pre code.
Line truncated
|
||||
undone.`,1),SUe=q("<!> <!>",1),EUe=q("<!> <!>",1),vUe=q("<!> <!>",1);function yUe(t,e){ye(e,!0);let r=V(e,"open",15);var n=se(),a=L(n);fe(a,()=>ud,(i,s)=>{s(i,{get onOpenChange(){return e.onOpenChange},get open(){return r()},set open(o){r(o)},children:(o,l)=>{var c=se(),u=L(c);fe(u,()=>ld,(d,h)=>{h(d,{children:(m,f)=>{var g=vUe(),b=L(g);fe(b,()=>od,(S,E)=>{E(S,{children:(y,v)=>{var T=SUe(),w=L(T);fe(w,()=>id,(I,x)=>{x(I,{children:(D,$)=>{et();var H=Nt("Delete Server");C(D,H)},$$slots:{default:!0}})});var A=te(w,2);fe(A,()=>cd,(I,x)=>{x(I,{children:(D,$)=>{et();var H=bUe(),G=te(L(H)),K=j(G,!0);Y(G),et(),we(()=>qe(K,e.displayName)),C(D,H)},$$slots:{default:!0}})}),C(y,T)},$$slots:{default:!0}})});var _=te(b,2);fe(_,()=>sd,(S,E)=>{E(S,{children:(y,v)=>{var T=EUe(),w=L(T);fe(w,()=>Ux,(I,x)=>{x(I,{children:(D,$)=>{et();var H=Nt("Cancel");C(D,H)},$$slots:{default:!0}})});var A=te(w,2);fe(A,()=>Eh,(I,x)=>{x(I,{class:"text-destructive-foreground bg-destructive hover:bg-destructive/90",get onclick(){return e.onConfirm},children:(D,$)=>{et();var H=Nt("Delete");C(D,H)},$$slots:{default:!0}})}),C(y,T)},$$slots:{default:!0}})}),C(m,g)},$$slots:{default:!0}})}),C(o,c)},$$slots:{default:!0}})}),C(t,n),Te()}var TUe=q('<div class="flex items-center justify-between gap-4"><div class="flex items-center gap-2"><!> <!> <!></div> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div> <div class="space-y-1.5"><!> <!></div> <!> <div class="flex justify-end gap-2"><!> <!> <!></div>',1);function CUe(t){Pc(t,{class:"grid gap-3 p-4",children:(e,r)=>{var n=TUe(),a=L(n),i=j(a),s=j(i);Fa(s,{class:"h-5 w-5 rounded"});var o=te(s,2);Fa(o,{class:"h-5 w-28"});var l=te(o,2);Fa(l,{class:"h-5 w-12 rounded-full"}),Y(i);var c=te(i,2);Fa(c,{class:"h-6 w-11 rounded-full"}),Y(a);var u=te(a,2),d=j(u);Fa(d,{class:"h-5 w-14 rounded-full"});var h=te(d,2);Fa(h,{class:"h-5 w-12 rounded-full"});var m=te(h,2);Fa(m,{class:"h-5 w-16 rounded-full"}),Y(u);var f=te(u,2),g=j(f);Fa(g,{class:"h-4 w-40"});var b=te(g,2);Fa(b,{class:"h-4 w-52"}),Y(f);var _=te(f,2);Fa(_,{class:"h-3.5 w-36"});var S=te(_,2),E=j(S);Fa(E,{class:"h-8 w-8 rounded"});var y=te(E,2);Fa(y,{class:"h-8 w-8 rounded"});var v=te(y,2);Fa(v,{class:"h-8 w-8 rounded"}),Y(S),C(e,n)},$$slots:{default:!0}})}var wUe=q("<!> <span>Server instructions</span>",1),AUe=q('<p class="rounded bg-muted/50 p-2 text-xs text-muted-foreground"> </p>'),RUe=q("<!> <!>",1);function OUe(t,e){let r=_e(!1);var n=se(),a=L(n);{var i=s=>{var o=se(),l=L(o);fe(l,()=>Yp,(c,u)=>{u(c,{get class(){return e.class},get open(){return p(r)},set open(d){k(r,d,!0)},children:(d,h)=>{var m=RUe(),f=L(m);fe(f,()=>Vp,(b,_)=>{_(b,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:(S,E)=>{var y=wUe(),v=L(y);{var T=A=>{Yc(A,{class:"h-3.5 w-3.5"})},w=A=>{Vc(A,{class:"h-3.5 w-3.5"})};le(v,A=>{p(r)?A(T):A(w,!1)})}et(2),C(S,y)},$$slots:{default:!0}})});var g=te(f,2);fe(g,()=>Wp,(b,_)=>{_(b,{class:"mt-2",children:(S,E)=>{var y=AUe(),v=j(y,!0);Y(y),we(()=>qe(v,e.instructions)),C(S,y)},$$slots:{default:!0}})}),C(d,m)},$$slots:{default:!0}})}),C(s,o)};le(a,s=>{e.instructions&&s(i)})}C(t,n)}var NUe=q('<div class="flex flex-col gap-2"><div class="mb-2 flex items-center gap-4"><!> <!></div> <h3 class="text-sm font-medium">Available resources</h3></div>');function IUe(t,e){ye(e,!0);let r=V(e,"searchQuery",3,"");var n=NUe(),a=j(n),i=j(a);LE(i,{placeholder:"Search resources...",get value(){return r()},onInput:o=>e.onSearch?.(o)});var s=te(i,2);Dr(s,{variant:"ghost",size:"sm",class:"h-8 w-8 p-0",get onclick(){return e.onRefresh},get disabled(){return e.isLoading},title:"Refresh resources",children:(o,l)=>{var c=se(),u=L(c);{var d=m=>{Xa(m,{class:"h-4 w-4 animate-spin"})},h=m=>{Ic(m,{class:"h-4 w-4"})};le(u,m=>{e.isLoading?m(d):m(h,!1)})}C(o,c)},$$slots:{default:!0}}),Y(a),et(2),Y(n),C(t,n),Te()}var xUe=q('<div class="py-4 text-center text-sm text-muted-foreground"><!></div>');function DUe(t,e){var r=xUe(),n=j(r);{var a=s=>{var o=Nt("Loading resources...");C(s,o)},i=s=>{var o=Nt("No resources available");C(s,o)};le(n,s=>{e.isLoading?s(a):s(i,!1)})}Y(r),C(t,r)}function MUe(t,e){return t.title?.toLowerCase().includes(e)||t.uri.toLowerCase().includes(e)}function kUe(t,e,r){const n={name:"root",children:new Map};if(!r||!r.trim()){for(const s of t){const o=mb(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map})}return n}const a=r.toLowerCase();for(const s of t){if(!MUe(s,a))continue;const o=mb(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map,isFiltered:!0}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map,isFiltered:!0})}function i(s){if(s.resource)return!0;const o=[];for(co
Line truncated
|
||||
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function iFe(t,e,r,n){const a=n.schema,i=a.space==="svg"?!1:n.settings.omitOptionalTags;let s=a.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(t.tagName.toLowerCase());const o=[];let l;a.space==="html"&&t.tagName==="svg"&&(n.schema=x3);const c=sFe(n,t.properties),u=n.all(a.space==="html"&&t.tagName==="template"?t.content:t);return n.schema=a,u&&(s=!1),(c||!i||!J8e(t,e,r))&&(o.push("<",t.tagName,c?" "+c:""),s&&(a.space==="svg"||n.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!i||!M3(t,e,r))&&o.push("</"+t.tagName+">"),o.join("")}function sFe(t,e){const r=[];let n=-1,a;if(e){for(a in e)if(e[a]!==null&&e[a]!==void 0){const i=oFe(t,a,e[a]);i&&r.push(i)}}for(;++n<r.length;){const i=t.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&i!=='"'&&i!=="'"&&(r[n]+=" ")}return r.join("")}function oFe(t,e,r){const n=zY(t.schema,e),a=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let s=t.quote,o;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const l=vp(n.attribute,Object.assign({},t.settings.characterReferences,{subset:g1.name[a][i]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?jLe:XLe)(r,{padLeft:!t.settings.tightCommaSeparatedLists}):String(r),t.settings.collapseEmptyAttributes&&!r)?l:(t.settings.preferUnquoted&&(o=vp(r,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:g1.unquoted[a][i]}))),o!==r&&(t.settings.quoteSmart&&$b(r,s)>$b(r,t.alternative)&&(s=t.alternative),o=s+vp(r,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?g1.single:g1.double)[a][i],attribute:!0}))+s),l+(o&&"="+o))}const lFe=["<","&"];function XY(t,e,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?t.value:vp(t.value,Object.assign({},n.settings.characterReferences,{subset:lFe}))}function cFe(t,e,r,n){return n.settings.allowDangerousHtml?t.value:XY(t,e,r,n)}function uFe(t,e,r,n){return n.all(t)}const dFe=D$("type",{invalid:hFe,unknown:pFe,handlers:{comment:L8e,doctype:F8e,element:iFe,raw:cFe,root:uFe,text:XY}});function hFe(t){throw new Error("Expected node, not `"+t+"`")}function pFe(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const mFe={},fFe={},gFe=[];function _Fe(t,e){const r=e||mFe,n=r.quote||'"',a=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:bFe,all:SFe,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||g8e,characterReferences:r.characterReferences||fFe,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?x3:$Y,quote:n,alternative:a}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function bFe(t,e,r){return dFe(t,e,r,this)}function SFe(t){const e=[],r=t&&t.children||gFe;let n=-1;for(;++n<r.length;)e[n]=this.one(r[n],n,t);return e.join("")}function EFe(t){const e=this,r={...e.data("settings"),...t};e.compiler=n;function n(a){return _Fe(a,r)}}function ZY(t){const e=[...t.matchAll(Tae)];if(!e.length)return[{type:"text",value:t}];const r=[];let n=0;for(const a of e)a.index>n&&r.push({type:"text",value:t.slice(n,a.index)}),r.push({type:"element",tagName:"br",properties:{},children:[]}),n=a.index+a[0].length;return n<t.length&&r.push({type:"text",value:t.slice(n)}),r}function vFe(t){const e=t.trim().match(Cae);if(!e)return null;const r=e[1],n=[];let a=0;for(const i of r.matchAll(wae)){if(r.slice(a,i.index).trim())return null;n.push({type:"element",tagName:"li",properties:{},children:ZY(i[1]??"")}),a=i.index+i[0].length}return!n.length||r.slice(a).trim()?null:{type:"element",tagName:"ul",properties:{},children:n}}function yFe(t){OE(t,"text",(e,r)=>{const n=r[r.length-1];if(!n||n.type!=="element")return;const i=n.children,s=i.indexOf(e);if(s===-1)return;let o="",l=s;for(let d=s;d<i.length;d++){const h=i[d];if(h.type==="text")o+=h.value,l=d;else if(h.type==="element"&&h.tagName==="br")o+=`
|
||||
`,l=d;else break}const c=vFe(o);if(c){i.splice(s,l-s+1,c);return}const u=ZY(e.value);(u.length!==1||u[0]!==e)&&i.splice(s,1,...u)})}const TFe=()=>t=>{su(t,"element",e=>{(e.tagName==="td"||e.tagName==="th")&&yFe(e)})},CFe=()=>t=>{su(t,"element",e=>{if(e.tagName!=="a")return;const r=e.properties??{};r.href&&(r.target="_blank",r.rel="noopener noreferrer",e.properties=r)})},wFe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',AFe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye lucide-eye-icon"><path d="M2.062 12.345a1 1 0 0 1 0-.69C3.5 7.73 7.36 5 12 5s8.5 2.73 9.938 6.655a1 1 0 0 1 0 .69C20.5 16.27 16.64 19 12 19s-8.5-2.73-9.938-6.655"/><circle cx="12" cy="12" r="3"/></svg>';function JY(t){return{type:"element",tagName:"span",properties:{},children:[{type:"raw",value:t}]}}function RFe(t){return{type:"element",tagName:"button",properties:{className:[ine],"data-code-id":t,title:"Copy code",type:"button"},children:[JY(wFe)]}}function OFe(t){return{type:"element",tagName:"button",properties:{className:[sne],"data-code-id":t,title:"Preview code",type:"button"},children:[JY(AFe)]}}function NFe(t,e){const r=[RFe(e)];return t.toLowerCase()==="html"&&r.push(OFe(e)),{type:"element",tagName:"div",properties:{className:[rne]},children:[{type:"element",tagName:"span",properties:{className:[ane]},children:[{type:"text",value:t}]},{type:"element",tagName:"div",properties:{className:[nne]},children:r}]}}function IFe(t){return{type:"element",tagName:"div",properties:{className:[ene]},children:[t]}}function xFe(t,e){return{type:"element",tagName:"div",properties:{className:[tne,one]},children:[t,IFe(e)]}}function DFe(t){const e=t.properties?.className;if(!Array.isArray(e))return"text";for(const r of e)if(typeof r=="string"&&r.startsWith("language-"))return r.replace("language-","");return"text"}function MFe(){return typeof window<"u"?`code-${window.idxCodeBlock=(window.idxCodeBlock??0)+1}`:`code-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}const kFe=()=>t=>{su(t,"element",(e,r,n)=>{if(e.tagName!=="pre"||!n||r===void 0)return;const a=e.children.find(c=>c.type==="element"&&c.tagName==="code");if(!a)return;const i=DFe(a),s=MFe();a.properties={...a.properties,"data-code-id":s};const o=NFe(i,s),l=xFe(o,e);n.children[r]=l})};function PFe(t){return e=>{su(e,"element",r=>{if(r.tagName==="img"&&r.properties?.src){const n=String(r.properties.src);if(n.startsWith(ho.DATA)||n.startsWith(ho.HTTP))return;const a=t.attachments?.find(i=>i.type===Qr.IMAGE&&i.name===n);a?.base64Url&&(r.properties.src=a.base64Url)}})}}const LFe=()=>t=>{su(t,"element",e=>{e.children&&e.children.length>0&&(e.properties={...e.properties,dir:"auto"})})};function FFe(t){let e=0,r="";for(;e<t.length;){const n=t[e];if(n===" "){r+=ZU,e+=1;continue}if(n===" "){r+=Dne,e+=1;continue}break}return r+t.slice(e)}function BFe(t){const e=t.split(Ine),r=[];for(const[n,a]of e.entries())n>0&&r.push({type:"break"}),r.push({type:"text",value:FFe(a)});return r.length||r.push({type:"text",value:""}),r}const UFe=()=>t=>{su(t,"html",(e,r,n)=>{if(!n||typeof r!="number")return;const a=BFe(e.value);if(!xne.has(n.type)){const i={type:"paragraph",children:a,data:{literalHtml:!0}},s=n.children;if(s.splice(r,1,i),r>0){const o=s[r-1];if(o?.type==="paragraph"&&o.data?.literalHtml){const l=o.children;return l.length&&l[l.length-1].type!=="break"&&l.push({type:"break"}),l.push(...i.children),s.splice(r,1),r}}return r+1}return n.children.splice(r,1,...a),r+a.length})},eV="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}",tV="pre code.
Line truncated
|
||||
undone.`,1),SUe=q("<!> <!>",1),EUe=q("<!> <!>",1),vUe=q("<!> <!>",1);function yUe(t,e){ye(e,!0);let r=V(e,"open",15);var n=se(),a=L(n);fe(a,()=>ud,(i,s)=>{s(i,{get onOpenChange(){return e.onOpenChange},get open(){return r()},set open(o){r(o)},children:(o,l)=>{var c=se(),u=L(c);fe(u,()=>ld,(d,h)=>{h(d,{children:(m,f)=>{var g=vUe(),b=L(g);fe(b,()=>od,(S,E)=>{E(S,{children:(y,v)=>{var T=SUe(),w=L(T);fe(w,()=>id,(I,x)=>{x(I,{children:(D,$)=>{et();var H=Nt("Delete Server");C(D,H)},$$slots:{default:!0}})});var A=te(w,2);fe(A,()=>cd,(I,x)=>{x(I,{children:(D,$)=>{et();var H=bUe(),G=te(L(H)),K=j(G,!0);Y(G),et(),we(()=>qe(K,e.displayName)),C(D,H)},$$slots:{default:!0}})}),C(y,T)},$$slots:{default:!0}})});var _=te(b,2);fe(_,()=>sd,(S,E)=>{E(S,{children:(y,v)=>{var T=EUe(),w=L(T);fe(w,()=>Ux,(I,x)=>{x(I,{children:(D,$)=>{et();var H=Nt("Cancel");C(D,H)},$$slots:{default:!0}})});var A=te(w,2);fe(A,()=>vh,(I,x)=>{x(I,{class:"text-destructive-foreground bg-destructive hover:bg-destructive/90",get onclick(){return e.onConfirm},children:(D,$)=>{et();var H=Nt("Delete");C(D,H)},$$slots:{default:!0}})}),C(y,T)},$$slots:{default:!0}})}),C(m,g)},$$slots:{default:!0}})}),C(o,c)},$$slots:{default:!0}})}),C(t,n),Te()}var TUe=q('<div class="flex items-center justify-between gap-4"><div class="flex items-center gap-2"><!> <!> <!></div> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div> <div class="space-y-1.5"><!> <!></div> <!> <div class="flex justify-end gap-2"><!> <!> <!></div>',1);function CUe(t){Pc(t,{class:"grid gap-3 p-4",children:(e,r)=>{var n=TUe(),a=L(n),i=j(a),s=j(i);Fa(s,{class:"h-5 w-5 rounded"});var o=te(s,2);Fa(o,{class:"h-5 w-28"});var l=te(o,2);Fa(l,{class:"h-5 w-12 rounded-full"}),Y(i);var c=te(i,2);Fa(c,{class:"h-6 w-11 rounded-full"}),Y(a);var u=te(a,2),d=j(u);Fa(d,{class:"h-5 w-14 rounded-full"});var h=te(d,2);Fa(h,{class:"h-5 w-12 rounded-full"});var m=te(h,2);Fa(m,{class:"h-5 w-16 rounded-full"}),Y(u);var f=te(u,2),g=j(f);Fa(g,{class:"h-4 w-40"});var b=te(g,2);Fa(b,{class:"h-4 w-52"}),Y(f);var _=te(f,2);Fa(_,{class:"h-3.5 w-36"});var S=te(_,2),E=j(S);Fa(E,{class:"h-8 w-8 rounded"});var y=te(E,2);Fa(y,{class:"h-8 w-8 rounded"});var v=te(y,2);Fa(v,{class:"h-8 w-8 rounded"}),Y(S),C(e,n)},$$slots:{default:!0}})}var wUe=q("<!> <span>Server instructions</span>",1),AUe=q('<p class="rounded bg-muted/50 p-2 text-xs text-muted-foreground"> </p>'),RUe=q("<!> <!>",1);function OUe(t,e){let r=_e(!1);var n=se(),a=L(n);{var i=s=>{var o=se(),l=L(o);fe(l,()=>Yp,(c,u)=>{u(c,{get class(){return e.class},get open(){return p(r)},set open(d){k(r,d,!0)},children:(d,h)=>{var m=RUe(),f=L(m);fe(f,()=>Vp,(b,_)=>{_(b,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:(S,E)=>{var y=wUe(),v=L(y);{var T=A=>{Yc(A,{class:"h-3.5 w-3.5"})},w=A=>{Vc(A,{class:"h-3.5 w-3.5"})};le(v,A=>{p(r)?A(T):A(w,!1)})}et(2),C(S,y)},$$slots:{default:!0}})});var g=te(f,2);fe(g,()=>Wp,(b,_)=>{_(b,{class:"mt-2",children:(S,E)=>{var y=AUe(),v=j(y,!0);Y(y),we(()=>qe(v,e.instructions)),C(S,y)},$$slots:{default:!0}})}),C(d,m)},$$slots:{default:!0}})}),C(s,o)};le(a,s=>{e.instructions&&s(i)})}C(t,n)}var NUe=q('<div class="flex flex-col gap-2"><div class="mb-2 flex items-center gap-4"><!> <!></div> <h3 class="text-sm font-medium">Available resources</h3></div>');function IUe(t,e){ye(e,!0);let r=V(e,"searchQuery",3,"");var n=NUe(),a=j(n),i=j(a);FE(i,{placeholder:"Search resources...",get value(){return r()},onInput:o=>e.onSearch?.(o)});var s=te(i,2);Dr(s,{variant:"ghost",size:"sm",class:"h-8 w-8 p-0",get onclick(){return e.onRefresh},get disabled(){return e.isLoading},title:"Refresh resources",children:(o,l)=>{var c=se(),u=L(c);{var d=m=>{Xa(m,{class:"h-4 w-4 animate-spin"})},h=m=>{Ic(m,{class:"h-4 w-4"})};le(u,m=>{e.isLoading?m(d):m(h,!1)})}C(o,c)},$$slots:{default:!0}}),Y(a),et(2),Y(n),C(t,n),Te()}var xUe=q('<div class="py-4 text-center text-sm text-muted-foreground"><!></div>');function DUe(t,e){var r=xUe(),n=j(r);{var a=s=>{var o=Nt("Loading resources...");C(s,o)},i=s=>{var o=Nt("No resources available");C(s,o)};le(n,s=>{e.isLoading?s(a):s(i,!1)})}Y(r),C(t,r)}function MUe(t,e){return t.title?.toLowerCase().includes(e)||t.uri.toLowerCase().includes(e)}function kUe(t,e,r){const n={name:"root",children:new Map};if(!r||!r.trim()){for(const s of t){const o=fb(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map})}return n}const a=r.toLowerCase();for(const s of t){if(!MUe(s,a))continue;const o=fb(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map,isFiltered:!0}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map,isFiltered:!0})}function i(s){if(s.resource)return!0;const o=[];for(co
Line truncated
|
||||
@@ -18,7 +18,7 @@
|
||||
<div style="display: contents">
|
||||
<script>
|
||||
{
|
||||
__sveltekit_1610ad9 = {
|
||||
__sveltekit_nl4lme = {
|
||||
base: new URL('.', location).pathname.slice(0, -1)
|
||||
};
|
||||
|
||||
|
||||
@@ -291,14 +291,19 @@
|
||||
title: SETTINGS_SECTION_TITLES.DEVELOPER,
|
||||
icon: Code,
|
||||
fields: [
|
||||
{
|
||||
key: SETTINGS_KEYS.PRE_ENCODE_CONVERSATION,
|
||||
label: 'Pre-fill KV cache after response',
|
||||
type: SettingsFieldType.CHECKBOX
|
||||
},
|
||||
{
|
||||
key: SETTINGS_KEYS.DISABLE_REASONING_PARSING,
|
||||
label: 'Disable reasoning content parsing',
|
||||
label: 'Disable server-side thinking extraction',
|
||||
type: SettingsFieldType.CHECKBOX
|
||||
},
|
||||
{
|
||||
key: SETTINGS_KEYS.EXCLUDE_REASONING_FROM_CONTEXT,
|
||||
label: 'Exclude reasoning from context',
|
||||
label: 'Strip thinking from message history',
|
||||
type: SettingsFieldType.CHECKBOX
|
||||
},
|
||||
{
|
||||
|
||||
@@ -56,6 +56,7 @@ export const SETTING_CONFIG_DEFAULT: Record<string, string | number | boolean |
|
||||
dry_penalty_last_n: undefined,
|
||||
max_tokens: undefined,
|
||||
custom: '', // custom json-stringified object
|
||||
preEncodeConversation: false,
|
||||
// experimental features
|
||||
pyInterpreterEnabled: false,
|
||||
enableContinueGeneration: false
|
||||
@@ -106,9 +107,9 @@ export const SETTING_CONFIG_INFO: Record<string, string> = {
|
||||
custom: 'Custom JSON parameters to send to the API. Must be valid JSON format.',
|
||||
showThoughtInProgress: 'Expand thought process by default when generating messages.',
|
||||
disableReasoningParsing:
|
||||
'Send reasoning_format=none to prevent server-side extraction of reasoning tokens into separate field',
|
||||
'Send reasoning_format=none so the server returns thinking tokens inline instead of extracting them into a separate field.',
|
||||
excludeReasoningFromContext:
|
||||
'Strip reasoning content from previous messages before sending to the model. When unchecked, reasoning is sent back via the reasoning_content field so the model can see its own chain-of-thought across turns.',
|
||||
'Strip thinking from previous messages before sending. When off, thinking is sent back via the reasoning_content field so the model sees its own chain-of-thought across turns.',
|
||||
showRawOutputSwitch:
|
||||
'Show toggle button to display messages as plain text instead of Markdown-formatted content',
|
||||
keepStatsVisible: 'Keep processing statistics visible after generation finishes.',
|
||||
@@ -143,6 +144,8 @@ export const SETTING_CONFIG_INFO: Record<string, string> = {
|
||||
'Automatically expand tool call details while executing and keep them expanded after completion.',
|
||||
pyInterpreterEnabled:
|
||||
'Enable Python interpreter using Pyodide. Allows running Python code in markdown code blocks.',
|
||||
preEncodeConversation:
|
||||
'After each response, re-submit the conversation to pre-fill the server KV cache. Makes the next turn faster since the prompt is already encoded while you read the response.',
|
||||
enableContinueGeneration:
|
||||
'Enable "Continue" button for assistant messages. Currently works only with non-reasoning models.'
|
||||
};
|
||||
|
||||
@@ -52,6 +52,8 @@ export const SETTINGS_KEYS = {
|
||||
ALWAYS_SHOW_AGENTIC_TURNS: 'alwaysShowAgenticTurns',
|
||||
AGENTIC_MAX_TOOL_PREVIEW_LINES: 'agenticMaxToolPreviewLines',
|
||||
SHOW_TOOL_CALL_IN_PROGRESS: 'showToolCallInProgress',
|
||||
// Performance
|
||||
PRE_ENCODE_CONVERSATION: 'preEncodeConversation',
|
||||
// Developer
|
||||
DISABLE_REASONING_PARSING: 'disableReasoningParsing',
|
||||
EXCLUDE_REASONING_FROM_CONTEXT: 'excludeReasoningFromContext',
|
||||
|
||||
@@ -4,7 +4,8 @@ import { isAbortError } from '$lib/utils/abort';
|
||||
import {
|
||||
ATTACHMENT_LABEL_PDF_FILE,
|
||||
ATTACHMENT_LABEL_MCP_PROMPT,
|
||||
ATTACHMENT_LABEL_MCP_RESOURCE
|
||||
ATTACHMENT_LABEL_MCP_RESOURCE,
|
||||
LEGACY_AGENTIC_REGEX
|
||||
} from '$lib/constants';
|
||||
import {
|
||||
AttachmentType,
|
||||
@@ -279,6 +280,107 @@ export class ChatService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether all server slots are currently idle (not processing any requests).
|
||||
* Queries the /slots endpoint (requires --slots flag on the server).
|
||||
* Returns true if all slots are idle, false if any is processing.
|
||||
* If the endpoint is unavailable or errors out, returns true (best-effort fallback).
|
||||
*
|
||||
* @param signal - Optional AbortSignal to cancel the request if needed
|
||||
* @param model - Optional model name to check slots for (required in ROUTER mode)
|
||||
* @returns {Promise<boolean>} Promise that resolves to true if all slots are idle, false if any is processing
|
||||
*/
|
||||
static async areAllSlotsIdle(model?: string | null, signal?: AbortSignal): Promise<boolean> {
|
||||
try {
|
||||
const url = model ? `./slots?model=${encodeURIComponent(model)}` : './slots';
|
||||
const res = await fetch(url, { signal });
|
||||
if (!res.ok) return true;
|
||||
|
||||
const slots: { is_processing: boolean }[] = await res.json();
|
||||
return slots.every((s) => !s.is_processing);
|
||||
} catch {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a fire-and-forget request to pre-encode the conversation in the server's KV cache.
|
||||
* After a response completes, this re-submits the full conversation
|
||||
* using n_predict=0 and stream=false so the server processes the prompt without generating tokens.
|
||||
* This warms the cache for the next turn, making it faster.
|
||||
*
|
||||
* When excludeReasoningFromContext is true, reasoning content is stripped from the messages
|
||||
* to match what sendMessage would send on the next turn (avoiding cache misses).
|
||||
* When false, reasoning_content is preserved so the cached prompt matches the next request.
|
||||
*
|
||||
* @param messages - The full conversation including the latest assistant response
|
||||
* @param model - Optional model name (required in ROUTER mode)
|
||||
* @param excludeReasoning - Whether to strip reasoning content (should match excludeReasoningFromContext setting)
|
||||
* @param signal - Optional AbortSignal to cancel the pre-encode request
|
||||
*/
|
||||
static async preEncode(
|
||||
messages: ApiChatMessageData[] | (DatabaseMessage & { extra?: DatabaseMessageExtra[] })[],
|
||||
model?: string | null,
|
||||
excludeReasoning?: boolean,
|
||||
signal?: AbortSignal
|
||||
): Promise<void> {
|
||||
const normalizedMessages: ApiChatMessageData[] = messages
|
||||
.map((msg) => {
|
||||
if ('id' in msg && 'convId' in msg && 'timestamp' in msg) {
|
||||
return ChatService.convertDbMessageToApiChatMessageData(
|
||||
msg as DatabaseMessage & { extra?: DatabaseMessageExtra[] }
|
||||
);
|
||||
}
|
||||
|
||||
return msg as ApiChatMessageData;
|
||||
})
|
||||
.filter((msg) => {
|
||||
if (msg.role === MessageRole.SYSTEM) {
|
||||
const content = typeof msg.content === 'string' ? msg.content : '';
|
||||
|
||||
return content.trim().length > 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
const requestBody: Record<string, unknown> = {
|
||||
messages: normalizedMessages.map((msg: ApiChatMessageData) => {
|
||||
const mapped: Record<string, unknown> = {
|
||||
role: msg.role,
|
||||
content: excludeReasoning ? ChatService.stripReasoningContent(msg.content) : msg.content,
|
||||
tool_calls: msg.tool_calls,
|
||||
tool_call_id: msg.tool_call_id
|
||||
};
|
||||
|
||||
if (!excludeReasoning && msg.reasoning_content) {
|
||||
mapped.reasoning_content = msg.reasoning_content;
|
||||
}
|
||||
|
||||
return mapped;
|
||||
}),
|
||||
stream: false,
|
||||
n_predict: 0
|
||||
};
|
||||
|
||||
if (model) {
|
||||
requestBody.model = model;
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(`./v1/chat/completions`, {
|
||||
method: 'POST',
|
||||
headers: getJsonHeaders(),
|
||||
body: JSON.stringify(requestBody),
|
||||
signal
|
||||
});
|
||||
} catch (error) {
|
||||
if (!isAbortError(error)) {
|
||||
console.warn('[ChatService] Pre-encode request failed:', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -799,6 +901,28 @@ export class ChatService {
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Strips legacy inline reasoning content tags from message content.
|
||||
* Handles both plain string content and multipart content arrays.
|
||||
*/
|
||||
private static stripReasoningContent(
|
||||
content: string | ApiChatMessageContentPart[]
|
||||
): string | ApiChatMessageContentPart[] {
|
||||
const stripFromString = (text: string): string =>
|
||||
text.replace(LEGACY_AGENTIC_REGEX.REASONING_BLOCK, '').trim();
|
||||
|
||||
if (typeof content === 'string') {
|
||||
return stripFromString(content);
|
||||
}
|
||||
|
||||
return content.map((part) => {
|
||||
if (part.type === ContentPartType.TEXT && part.text) {
|
||||
return { ...part, text: stripFromString(part.text) };
|
||||
}
|
||||
return part;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses error response and creates appropriate error with context information
|
||||
* @param response - HTTP response object
|
||||
|
||||
@@ -58,6 +58,7 @@ class ChatStore {
|
||||
chatLoadingStates = new SvelteMap<string, boolean>();
|
||||
chatStreamingStates = new SvelteMap<string, { response: string; messageId: string }>();
|
||||
private abortControllers = new SvelteMap<string, AbortController>();
|
||||
private preEncodeAbortController: AbortController | null = null;
|
||||
private processingStates = new SvelteMap<string, ApiProcessingState | null>();
|
||||
private conversationStateTimestamps = new SvelteMap<string, ConversationStateEntry>();
|
||||
private activeConversationId = $state<string | null>(null);
|
||||
@@ -462,6 +463,9 @@ class ChatStore {
|
||||
const activeConv = conversationsStore.activeConversation;
|
||||
if (activeConv && this.isChatLoadingInternal(activeConv.id)) return;
|
||||
|
||||
// Cancel any in-flight pre-encode request
|
||||
this.cancelPreEncode();
|
||||
|
||||
// Consume MCP resource attachments - converts them to extras and clears the live store
|
||||
const resourceExtras = mcpStore.consumeResourceAttachmentsAsExtras();
|
||||
const allExtras = resourceExtras.length > 0 ? [...(extras || []), ...resourceExtras] : extras;
|
||||
@@ -724,6 +728,16 @@ class ChatStore {
|
||||
|
||||
if (onComplete) onComplete(streamedContent);
|
||||
if (isRouterMode()) modelsStore.fetchRouterModels().catch(console.error);
|
||||
// Pre-encode conversation in KV cache for faster next turn
|
||||
if (config().preEncodeConversation) {
|
||||
this.triggerPreEncode(
|
||||
allMessages,
|
||||
assistantMessage,
|
||||
streamedContent,
|
||||
effectiveModel,
|
||||
!!config().excludeReasoningFromContext
|
||||
);
|
||||
}
|
||||
},
|
||||
onError: (error: Error) => {
|
||||
this.setStreamingActive(false);
|
||||
@@ -911,6 +925,7 @@ class ChatStore {
|
||||
async regenerateMessage(messageId: string): Promise<void> {
|
||||
const activeConv = conversationsStore.activeConversation;
|
||||
if (!activeConv || this.isChatLoadingInternal(activeConv.id)) return;
|
||||
this.cancelPreEncode();
|
||||
const result = this.getMessageByIdWithRole(messageId, MessageRole.ASSISTANT);
|
||||
if (!result) return;
|
||||
const { index: messageIndex } = result;
|
||||
@@ -940,6 +955,7 @@ class ChatStore {
|
||||
async regenerateMessageWithBranching(messageId: string, modelOverride?: string): Promise<void> {
|
||||
const activeConv = conversationsStore.activeConversation;
|
||||
if (!activeConv || this.isChatLoadingInternal(activeConv.id)) return;
|
||||
this.cancelPreEncode();
|
||||
try {
|
||||
const idx = conversationsStore.findMessageIndex(messageId);
|
||||
if (idx === -1) return;
|
||||
@@ -1616,6 +1632,42 @@ class ChatStore {
|
||||
|
||||
return apiOptions;
|
||||
}
|
||||
|
||||
private cancelPreEncode(): void {
|
||||
if (this.preEncodeAbortController) {
|
||||
this.preEncodeAbortController.abort();
|
||||
this.preEncodeAbortController = null;
|
||||
}
|
||||
}
|
||||
|
||||
private async triggerPreEncode(
|
||||
allMessages: DatabaseMessage[],
|
||||
assistantMessage: DatabaseMessage,
|
||||
assistantContent: string,
|
||||
model?: string | null,
|
||||
excludeReasoning?: boolean
|
||||
): Promise<void> {
|
||||
this.cancelPreEncode();
|
||||
this.preEncodeAbortController = new AbortController();
|
||||
|
||||
const signal = this.preEncodeAbortController.signal;
|
||||
|
||||
try {
|
||||
const allIdle = await ChatService.areAllSlotsIdle(model, signal);
|
||||
if (!allIdle || signal.aborted) return;
|
||||
|
||||
const messagesWithAssistant: DatabaseMessage[] = [
|
||||
...allMessages,
|
||||
{ ...assistantMessage, content: assistantContent }
|
||||
];
|
||||
|
||||
await ChatService.preEncode(messagesWithAssistant, model, excludeReasoning, signal);
|
||||
} catch (err) {
|
||||
if (!isAbortError(err)) {
|
||||
console.warn('[ChatStore] Pre-encode failed:', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const chatStore = new ChatStore();
|
||||
|
||||
Reference in new issue
Block a user