@sockethub/examples 1.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +165 -0
- package/README.md +174 -0
- package/build/_app/env.js +1 -0
- package/build/_app/immutable/assets/0.BzjUWlsR.css +1 -0
- package/build/_app/immutable/assets/_layout.BzjUWlsR.css +1 -0
- package/build/_app/immutable/assets/sockethub.CMYouZ3z.css +1 -0
- package/build/_app/immutable/chunks/B38kwwg4.js +1 -0
- package/build/_app/immutable/chunks/B6g3iar1.js +1 -0
- package/build/_app/immutable/chunks/BRC80mQd.js +1 -0
- package/build/_app/immutable/chunks/BeYzO5Mt.js +1 -0
- package/build/_app/immutable/chunks/BoR-lgka.js +1 -0
- package/build/_app/immutable/chunks/CLEQVYcW.js +2 -0
- package/build/_app/immutable/chunks/CN8LF06-.js +1 -0
- package/build/_app/immutable/chunks/CZFJHIMN.js +1 -0
- package/build/_app/immutable/chunks/CfqRDpBM.js +1 -0
- package/build/_app/immutable/chunks/D3w1dc5i.js +8 -0
- package/build/_app/immutable/chunks/DEHNjQUQ.js +1 -0
- package/build/_app/immutable/chunks/DOX7w-st.js +4 -0
- package/build/_app/immutable/chunks/DPf-AoMq.js +3 -0
- package/build/_app/immutable/chunks/Dd_3LBWN.js +1 -0
- package/build/_app/immutable/chunks/Dkd6l8cV.js +1 -0
- package/build/_app/immutable/entry/app.DyZOSd3E.js +2 -0
- package/build/_app/immutable/entry/start.D446A-gj.js +1 -0
- package/build/_app/immutable/nodes/0.B3I8sqxJ.js +39 -0
- package/build/_app/immutable/nodes/1.T9u7GlsR.js +1 -0
- package/build/_app/immutable/nodes/2.C82p4PuU.js +5 -0
- package/build/_app/immutable/nodes/3.BOQ3BB3w.js +1 -0
- package/build/_app/immutable/nodes/4.iuW-HqsR.js +1 -0
- package/build/_app/immutable/nodes/5.DyVFGAXq.js +1 -0
- package/build/_app/immutable/nodes/6.DJAHzi0b.js +1 -0
- package/build/_app/immutable/nodes/7.CLSdyL18.js +1 -0
- package/build/_app/version.json +1 -0
- package/build/config.json +9 -0
- package/build/dummy.html +37 -0
- package/build/favicon.ico +0 -0
- package/build/feed.xml +29 -0
- package/build/feeds.html +37 -0
- package/build/index.html +37 -0
- package/build/irc.html +37 -0
- package/build/metadata.html +37 -0
- package/build/sockethub-logo.svg +147 -0
- package/build/xmpp.html +37 -0
- package/package.json +63 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{p as jn,q as vr,t as re,a as K,s as le,c as He,b as rs,d as is,k as _r}from"./Dkd6l8cV.js";import"./CZFJHIMN.js";import{ap as mr,H as os,N as gt,w as xe,ak as as,I as wt,g as z,_ as cs,L as br,M as Un,O as Ht,T as Ue,ax as wr,P as ls,Q as un,R as Er,aC as qt,aA as hs,D as Hn,aD as qn,X as xr,A as Fn,G as kr,aE as fn,aF as Or,al as Ar,aG as Sr,ab as us,aH as dn,aI as Rr,ar as fs,aJ as ds,ah as Tr,aK as Nr,ay as Cr,aw as Mr,p as Le,s as G,c as B,r as C,n as ps,a as Ie,t as ue,f as ye,aL as Br,aM as Lr,aN as Ir,b as qe,m as Vn,e as ut,d as tt}from"./B6g3iar1.js";import{i as gs}from"./BeYzO5Mt.js";import{b as Pr,s as Dr,i as he,l as Et,d as Fe,e as jr,p as Ft}from"./CfqRDpBM.js";import{w as pn,g as Ur,c as Hr,a as qr}from"./BoR-lgka.js";import{s as Fr,a as gn,d as Vr,C as Kr}from"./CLEQVYcW.js";function Qt(n,e){return e}function Wr(n,e,t,s){for(var i=[],o=e.length,a=0;a<o;a++)Or(e[a].e,i,!0);var h=o>0&&i.length===0&&t!==null;if(h){var l=t.parentNode;Ar(l),l.append(t),s.clear(),Me(n,e[0].prev,e[o-1].next)}Sr(i,()=>{for(var f=0;f<o;f++){var u=e[f];h||(s.delete(u.k),Me(n,u.prev,u.next)),us(u.e,!h)}})}function Zt(n,e,t,s,i,o=null){var a=n,h={flags:e,items:new Map,first:null},l=(e&ds)!==0;if(l){var f=n;a=xe?gt(as(f)):f.appendChild(mr())}xe&&wt();var u=null,y=!1,b=cs(()=>{var k=t();return kr(k)?k:k==null?[]:hs(k)});os(()=>{var k=z(b),p=k.length;if(y&&p===0)return;y=p===0;let S=!1;if(xe){var m=a.data===br;m!==(p===0)&&(a=Un(),gt(a),Ht(!1),S=!0)}if(xe){for(var q=null,F,O=0;O<p;O++){if(Ue.nodeType===8&&Ue.data===wr){a=Ue,S=!0,Ht(!1);break}var T=k[O],M=s(T,O);F=ys(Ue,h,q,null,T,M,O,i,e,t),h.items.set(M,F),q=F}p>0&>(Un())}xe||zr(k,h,a,i,e,s,t),o!==null&&(p===0?u?ls(u):u=un(()=>o(a)):u!==null&&Er(u,()=>{u=null})),S&&Ht(!0),z(b)}),xe&&(a=Ue)}function zr(n,e,t,s,i,o,a){var te,de,ne,ie;var h=(i&Nr)!==0,l=(i&(dn|fn))!==0,f=n.length,u=e.items,y=e.first,b=y,k,p=null,S,m=[],q=[],F,O,T,M;if(h)for(M=0;M<f;M+=1)F=n[M],O=o(F,M),T=u.get(O),T!==void 0&&((te=T.a)==null||te.measure(),(S??(S=new Set)).add(T));for(M=0;M<f;M+=1){if(F=n[M],O=o(F,M),T=u.get(O),T===void 0){var Ae=b?b.e.nodes_start:t;p=ys(Ae,e,p,p===null?e.first:p.next,F,O,M,s,i,a),u.set(O,p),m=[],q=[],b=p.next;continue}if(l&&Gr(T,F,M,i),(T.e.f&qt)!==0&&(ls(T.e),h&&((de=T.a)==null||de.unfix(),(S??(S=new Set)).delete(T))),T!==b){if(k!==void 0&&k.has(T)){if(m.length<q.length){var fe=q[0],I;p=fe.prev;var X=m[0],D=m[m.length-1];for(I=0;I<m.length;I+=1)Kn(m[I],fe,t);for(I=0;I<q.length;I+=1)k.delete(q[I]);Me(e,X.prev,D.next),Me(e,p,X),Me(e,D,fe),b=fe,p=D,M-=1,m=[],q=[]}else k.delete(T),Kn(T,b,t),Me(e,T.prev,T.next),Me(e,T,p===null?e.first:p.next),Me(e,p,T),p=T;continue}for(m=[],q=[];b!==null&&b.k!==O;)(b.e.f&qt)===0&&(k??(k=new Set)).add(b),q.push(b),b=b.next;if(b===null)continue;T=b}m.push(T),p=T,b=T.next}if(b!==null||k!==void 0){for(var j=k===void 0?[]:hs(k);b!==null;)(b.e.f&qt)===0&&j.push(b),b=b.next;var P=j.length;if(P>0){var W=(i&ds)!==0&&f===0?t:null;if(h){for(M=0;M<P;M+=1)(ne=j[M].a)==null||ne.measure();for(M=0;M<P;M+=1)(ie=j[M].a)==null||ie.fix()}Wr(e,j,W,u)}}h&&Tr(()=>{var pe;if(S!==void 0)for(T of S)(pe=T.a)==null||pe.apply()}),Hn.first=e.first&&e.first.e,Hn.last=p&&p.e}function Gr(n,e,t,s){(s&dn)!==0&&qn(n.v,e),(s&fn)!==0?qn(n.i,t):n.i=t}function ys(n,e,t,s,i,o,a,h,l,f){var u=(l&dn)!==0,y=(l&Rr)===0,b=u?y?xr(i):Fn(i):i,k=(l&fn)===0?a:Fn(a),p={i:k,v:b,k:o,a:null,e:null,prev:t,next:s};try{return p.e=un(()=>h(n,b,k,f),xe),p.e.prev=t&&t.e,p.e.next=s&&s.e,t===null?e.first=p:(t.next=p,t.e.next=p.e),s!==null&&(s.prev=p,s.e.prev=p.e),p}finally{}}function Kn(n,e,t){for(var s=n.next?n.next.e.nodes_start:t,i=e?e.e.nodes_start:t,o=n.e.nodes_start;o!==s;){var a=fs(o);i.before(o),o=a}}function Me(n,e,t){e===null?n.first=t:(e.next=t,e.e.next=t&&t.e),t!==null&&(t.prev=e,t.e.prev=e&&e.e)}function vs(n,e,t,s,i){var o=n,a="",h;os(()=>{if(a===(a=e()??"")){xe&&wt();return}h!==void 0&&(us(h),h=void 0),a!==""&&(h=un(()=>{if(xe){Ue.data;for(var l=wt(),f=l;l!==null&&(l.nodeType!==8||l.data!=="");)f=l,l=fs(l);if(l===null)throw Cr(),Mr;jn(Ue,f),o=gt(l);return}var u=a+"",y=vr(u);jn(as(y),y.lastChild),o.before(y)}))})}function Xr(n,e,t,s,i){var h;xe&&wt();var o=(h=e.$$slots)==null?void 0:h[t],a=!1;o===!0&&(o=e.children,a=!0),o===void 0?i!==null&&i(n):o(n,a?()=>s:s)}const $t=pn([]),ft=new Map;function _s(n,e=!1){var t,s,i;if(console.log("displayMessage called:",{type:n.type,context:n.context,isResponse:e,actor:n.actor,content:(t=n.object)==null?void 0:t.content}),n.type==="send"&&((s=n.object)==null?void 0:s.type)==="message"){const o=typeof n.actor=="string"?n.actor:((i=n.actor)==null?void 0:i.name)||"",a=n.object.content||"",h=`${o}:${a}`,l=Date.now(),f=ft.get(h);if(f&&l-f<2e3){console.log("Skipping duplicate message:",h);return}ft.set(h,l);for(const[u,y]of ft)l-y>5e3&&ft.delete(u);$t.set([...Ur($t),[o,a]]),console.log("Message displayed:",{actorName:o,content:a,isResponse:e,context:n.context})}}var Yr=re("<li> </li>"),Jr=re('<div><label for="incomingMessagesContainer" class="text-gray-900 font-bold">Incoming Messages</label> <div id="incomingMessagesContainer" class="incoming-messages-container w-full"><ui class="incoming-messages"></ui> <div class="incoming-messages-anchor"></div></div></div>');function Lo(n,e){Le(e,!1);const[t,s]=Dr(),i=()=>Pr($t,"$messages",t);gs();var o=Jr(),a=G(B(o),2),h=B(a);Zt(h,5,i,Qt,(l,f)=>{var u=Yr(),y=B(u);C(u),ue(()=>le(y,`${z(f)[0]??""}: ${z(f)[1]??""}`)),K(l,u)}),C(h),ps(2),C(a),C(o),K(n,o),Ie(),s()}var Qr=re("<span> </span>");function yn(n,e){Le(e,!0);var t=Qr(),s=B(t);C(t),ue(()=>le(s,`[${e.entry.context??""}:${e.entry.type??""}]`)),K(n,t),Ie()}var Zr=re("<!> <span> </span> <span> </span>",1);function $r(n,e){Le(e,!0);var t=Zr(),s=ye(t);yn(s,{get entry(){return e.entry}});var i=G(s,2),o=B(i);C(i);var a=G(i,2),h=B(a,!0);C(a),ue(()=>{var l,f,u;le(o,`#${e.id??""}
|
|
2
|
+
${(typeof e.entry.actor=="string"?e.entry.actor:((l=e.entry.actor)==null?void 0:l.name)||((f=e.entry.actor)==null?void 0:f.id))??""}:`),le(h,((u=e.entry.object)==null?void 0:u.content)||"")}),K(n,t),Ie()}var ei=re('<span class="font-medium">📰 Fetched feed:</span> <span></span> <span class="text-gray-500"> </span>',1),ti=re("<span></span>"),ni=re('<span class="text-gray-500 text-xs italic"> </span>'),si=re('<span class="text-gray-500"> </span> <!> <span><a rel="noreferrer" target="_blank" class="text-blue-600 hover:text-blue-800 underline"><!></a></span> <!>',1),ri=re("<!> <!>",1);function ii(n,e){var u,y,b;Le(e,!0);const t=e.entry.totalItems!==void 0,s=t?e.entry.summary:(u=e.entry.object)==null?void 0:u.url,i=typeof e.entry.actor=="string"?e.entry.actor:((y=e.entry.actor)==null?void 0:y.name)||((b=e.entry.actor)==null?void 0:b.id);var o=ri(),a=ye(o);yn(a,{get entry(){return e.entry}});var h=G(a,2);{var l=k=>{var p=ei(),S=G(ye(p),2);S.textContent=s;var m=G(S,2),q=B(m);C(m),ue(()=>le(q,`(${e.entry.totalItems??""} ${(e.entry.totalItems===1?"item":"items")??""})`)),K(k,p)},f=k=>{var p=si(),S=ye(p),m=B(S);C(S);var q=G(S,2);{var F=D=>{var j=ti();j.textContent=`${i??""}:`,K(D,j)};he(q,D=>{i&&D(F)})}var O=G(q,2),T=B(O),M=B(T);{var Ae=D=>{var j=He(),P=ye(j);vs(P,()=>{var W;return(W=e.entry.object)==null?void 0:W.title}),K(D,j)},fe=D=>{var j=rs();ue(()=>{var P,W;return le(j,(P=e.entry.object)!=null&&P.title||typeof e.entry.target=="string"?e.entry.target:(W=e.entry.target)==null?void 0:W.id)}),K(D,j)};he(M,D=>{var j;((j=e.entry.object)==null?void 0:j.contentType)==="html"?D(Ae):D(fe,!1)})}C(T),C(O);var I=G(O,2);{var X=D=>{var j=ni(),P=B(j,!0);C(j),ue(W=>le(P,W),[()=>{var W;return(W=e.entry.object)==null?void 0:W.published.split("T")[0]}]),K(D,j)};he(I,D=>{var j;(j=e.entry.object)!=null&&j.published&&D(X)})}ue(()=>{var D;le(m,`#${e.id??""}`),Fr(T,"href",(D=e.entry.object)==null?void 0:D.url)}),K(k,p)};he(h,k=>{t?k(l):k(f,!1)})}K(n,o),Ie()}var oi=re("<!> <span> </span>",1);function ai(n,e){Le(e,!0);var t=oi(),s=ye(t);yn(s,{get entry(){return e.entry}});var i=G(s,2),o=B(i);C(i),ue(()=>{var a,h;return le(o,`#${e.id??""}
|
|
3
|
+
${(typeof e.entry.actor=="string"?e.entry.actor:((a=e.entry.actor)==null?void 0:a.name)||((h=e.entry.actor)==null?void 0:h.id))??""}`)}),K(n,t),Ie()}var ci=re('<span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs font-medium rounded-full"> </span>'),li=re('<span class="px-2 py-1 bg-purple-100 text-purple-800 text-xs font-medium rounded-full"> </span>'),hi=re('<div class="mt-2 p-3 bg-red-50 border border-red-200 rounded-lg"><div class="flex items-center space-x-2"><svg class="w-4 h-4 text-red-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="text-red-800 font-medium text-sm">Error:</span> <span class="text-red-700 text-sm"> </span></div></div>'),ui=re('<li class="p-4 hover:bg-gray-50 transition-colors"><div class="flex items-start space-x-3"><div class="flex flex-col items-center space-y-1 mt-1"><div></div> <div class="text-xs text-gray-400 font-mono"> </div></div> <div class="flex-1 min-w-0"><div class="flex items-center justify-between mb-2"><div class="flex items-center space-x-2"><span class="text-sm font-semibold text-gray-700"> </span> <!> <!></div> <button class="px-3 py-1 text-xs font-medium text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50 rounded-md transition-colors flex items-center space-x-1"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg> <span>View Details</span></button></div> <div class="text-sm text-gray-600"><!></div> <!></div></div></li>');function Vt(n,e){Le(e,!0);var t=ui(),s=B(t),i=B(s),o=B(i),a=G(o,2),h=B(a);C(a),C(i);var l=G(i,2),f=B(l),u=B(f),y=B(u),b=B(y,!0);C(y);var k=G(y,2);{var p=I=>{var X=ci(),D=B(X,!0);C(X),ue(j=>le(D,j),[()=>e.entry.context.toUpperCase()]),K(I,X)};he(k,I=>{e.entry.context&&I(p)})}var S=G(k,2);{var m=I=>{var X=li(),D=B(X,!0);C(X),ue(()=>le(D,e.entry.type)),K(I,X)};he(S,I=>{e.entry.type&&I(m)})}C(u);var q=G(u,2);q.__click=function(...I){var X;(X=e.buttonAction)==null||X.apply(this,I)},C(f);var F=G(f,2),O=B(F);{var T=I=>{$r(I,{get id(){return e.id},get entry(){return e.entry}})},M=(I,X)=>{{var D=P=>{ii(P,{get id(){return e.id},get entry(){return e.entry}})},j=P=>{ai(P,{get id(){return e.id},get entry(){return e.entry}})};he(I,P=>{e.entry.context==="feeds"?P(D):P(j,!1)},X)}};he(O,I=>{e.entry.context==="dummy"?I(T):I(M,!1)})}C(F);var Ae=G(F,2);{var fe=I=>{var X=hi(),D=B(X),j=G(B(D),4),P=B(j,!0);C(j),C(D),C(X),ue(()=>le(P,e.entry.error)),K(I,X)};he(Ae,I=>{e.entry.error&&I(fe)})}C(l),C(s),C(t),ue(()=>{gn(o,1,`w-3 h-3 ${(e.response?"bg-green-500":"bg-orange-400")??""} rounded-full`),le(h,`#${e.id??""}`),le(b,e.response?"📥 Response":"📤 Sent")}),K(n,t),Ie()}is(["click"]);function ms(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Kt,Wn;function fi(){if(Wn)return Kt;Wn=1;function n(r){return r instanceof Map?r.clear=r.delete=r.set=function(){throw new Error("map is read-only")}:r instanceof Set&&(r.add=r.clear=r.delete=function(){throw new Error("set is read-only")}),Object.freeze(r),Object.getOwnPropertyNames(r).forEach(c=>{const g=r[c],R=typeof g;(R==="object"||R==="function")&&!Object.isFrozen(g)&&n(g)}),r}class e{constructor(c){c.data===void 0&&(c.data={}),this.data=c.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(r,...c){const g=Object.create(null);for(const R in r)g[R]=r[R];return c.forEach(function(R){for(const Q in R)g[Q]=R[Q]}),g}const i="</span>",o=r=>!!r.scope,a=(r,{prefix:c})=>{if(r.startsWith("language:"))return r.replace("language:","language-");if(r.includes(".")){const g=r.split(".");return[`${c}${g.shift()}`,...g.map((R,Q)=>`${R}${"_".repeat(Q+1)}`)].join(" ")}return`${c}${r}`};class h{constructor(c,g){this.buffer="",this.classPrefix=g.classPrefix,c.walk(this)}addText(c){this.buffer+=t(c)}openNode(c){if(!o(c))return;const g=a(c.scope,{prefix:this.classPrefix});this.span(g)}closeNode(c){o(c)&&(this.buffer+=i)}value(){return this.buffer}span(c){this.buffer+=`<span class="${c}">`}}const l=(r={})=>{const c={children:[]};return Object.assign(c,r),c};class f{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(c){this.top.children.push(c)}openNode(c){const g=l({scope:c});this.add(g),this.stack.push(g)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(c){return this.constructor._walk(c,this.rootNode)}static _walk(c,g){return typeof g=="string"?c.addText(g):g.children&&(c.openNode(g),g.children.forEach(R=>this._walk(c,R)),c.closeNode(g)),c}static _collapse(c){typeof c!="string"&&c.children&&(c.children.every(g=>typeof g=="string")?c.children=[c.children.join("")]:c.children.forEach(g=>{f._collapse(g)}))}}class u extends f{constructor(c){super(),this.options=c}addText(c){c!==""&&this.add(c)}startScope(c){this.openNode(c)}endScope(){this.closeNode()}__addSublanguage(c,g){const R=c.root;g&&(R.scope=`language:${g}`),this.add(R)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function y(r){return r?typeof r=="string"?r:r.source:null}function b(r){return S("(?=",r,")")}function k(r){return S("(?:",r,")*")}function p(r){return S("(?:",r,")?")}function S(...r){return r.map(g=>y(g)).join("")}function m(r){const c=r[r.length-1];return typeof c=="object"&&c.constructor===Object?(r.splice(r.length-1,1),c):{}}function q(...r){return"("+(m(r).capture?"":"?:")+r.map(R=>y(R)).join("|")+")"}function F(r){return new RegExp(r.toString()+"|").exec("").length-1}function O(r,c){const g=r&&r.exec(c);return g&&g.index===0}const T=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(r,{joinWith:c}){let g=0;return r.map(R=>{g+=1;const Q=g;let Z=y(R),w="";for(;Z.length>0;){const _=T.exec(Z);if(!_){w+=Z;break}w+=Z.substring(0,_.index),Z=Z.substring(_.index+_[0].length),_[0][0]==="\\"&&_[1]?w+="\\"+String(Number(_[1])+Q):(w+=_[0],_[0]==="("&&g++)}return w}).map(R=>`(${R})`).join(c)}const Ae=/\b\B/,fe="[a-zA-Z]\\w*",I="[a-zA-Z_]\\w*",X="\\b\\d+(\\.\\d+)?",D="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",j="\\b(0b[01]+)",P="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",W=(r={})=>{const c=/^#![ ]*\//;return r.binary&&(r.begin=S(c,/.*\b/,r.binary,/\b.*/)),s({scope:"meta",begin:c,end:/$/,relevance:0,"on:begin":(g,R)=>{g.index!==0&&R.ignoreMatch()}},r)},te={begin:"\\\\[\\s\\S]",relevance:0},de={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[te]},ne={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[te]},ie={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},pe=function(r,c,g={}){const R=s({scope:"comment",begin:r,end:c,contains:[]},g);R.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Q=q("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return R.contains.push({begin:S(/[ ]+/,"(",Q,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),R},Pe=pe("//","$"),At=pe("/\\*","\\*/"),St=pe("#","$"),Re={scope:"number",begin:X,relevance:0},Ve={scope:"number",begin:D,relevance:0},Qe={scope:"number",begin:j,relevance:0},Ze={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[te,{begin:/\[/,end:/\]/,relevance:0,contains:[te]}]},_e={scope:"title",begin:fe,relevance:0},Te={scope:"title",begin:I,relevance:0},rt={begin:"\\.\\s*"+I,relevance:0};var Ke=Object.freeze({__proto__:null,APOS_STRING_MODE:de,BACKSLASH_ESCAPE:te,BINARY_NUMBER_MODE:Qe,BINARY_NUMBER_RE:j,COMMENT:pe,C_BLOCK_COMMENT_MODE:At,C_LINE_COMMENT_MODE:Pe,C_NUMBER_MODE:Ve,C_NUMBER_RE:D,END_SAME_AS_BEGIN:function(r){return Object.assign(r,{"on:begin":(c,g)=>{g.data._beginMatch=c[1]},"on:end":(c,g)=>{g.data._beginMatch!==c[1]&&g.ignoreMatch()}})},HASH_COMMENT_MODE:St,IDENT_RE:fe,MATCH_NOTHING_RE:Ae,METHOD_GUARD:rt,NUMBER_MODE:Re,NUMBER_RE:X,PHRASAL_WORDS_MODE:ie,QUOTE_STRING_MODE:ne,REGEXP_MODE:Ze,RE_STARTERS_RE:P,SHEBANG:W,TITLE_MODE:_e,UNDERSCORE_IDENT_RE:I,UNDERSCORE_TITLE_MODE:Te});function Tt(r,c){r.input[r.index-1]==="."&&c.ignoreMatch()}function $e(r,c){r.className!==void 0&&(r.scope=r.className,delete r.className)}function Nt(r,c){c&&r.beginKeywords&&(r.begin="\\b("+r.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",r.__beforeBegin=Tt,r.keywords=r.keywords||r.beginKeywords,delete r.beginKeywords,r.relevance===void 0&&(r.relevance=0))}function Ct(r,c){Array.isArray(r.illegal)&&(r.illegal=q(...r.illegal))}function Mt(r,c){if(r.match){if(r.begin||r.end)throw new Error("begin & end are not supported with match");r.begin=r.match,delete r.match}}function js(r,c){r.relevance===void 0&&(r.relevance=1)}const Us=(r,c)=>{if(!r.beforeMatch)return;if(r.starts)throw new Error("beforeMatch cannot be used with starts");const g=Object.assign({},r);Object.keys(r).forEach(R=>{delete r[R]}),r.keywords=g.keywords,r.begin=S(g.beforeMatch,b(g.begin)),r.starts={relevance:0,contains:[Object.assign(g,{endsParent:!0})]},r.relevance=0,delete g.beforeMatch},Hs=["of","and","for","in","not","or","if","then","parent","list","value"],qs="keyword";function En(r,c,g=qs){const R=Object.create(null);return typeof r=="string"?Q(g,r.split(" ")):Array.isArray(r)?Q(g,r):Object.keys(r).forEach(function(Z){Object.assign(R,En(r[Z],c,Z))}),R;function Q(Z,w){c&&(w=w.map(_=>_.toLowerCase())),w.forEach(function(_){const A=_.split("|");R[A[0]]=[Z,Fs(A[0],A[1])]})}}function Fs(r,c){return c?Number(c):Vs(r)?0:1}function Vs(r){return Hs.includes(r.toLowerCase())}const xn={},De=r=>{console.error(r)},kn=(r,...c)=>{console.log(`WARN: ${r}`,...c)},We=(r,c)=>{xn[`${r}/${c}`]||(console.log(`Deprecated as of ${r}. ${c}`),xn[`${r}/${c}`]=!0)},it=new Error;function On(r,c,{key:g}){let R=0;const Q=r[g],Z={},w={};for(let _=1;_<=c.length;_++)w[_+R]=Q[_],Z[_+R]=!0,R+=F(c[_-1]);r[g]=w,r[g]._emit=Z,r[g]._multi=!0}function Ks(r){if(Array.isArray(r.begin)){if(r.skip||r.excludeBegin||r.returnBegin)throw De("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),it;if(typeof r.beginScope!="object"||r.beginScope===null)throw De("beginScope must be object"),it;On(r,r.begin,{key:"beginScope"}),r.begin=M(r.begin,{joinWith:""})}}function Ws(r){if(Array.isArray(r.end)){if(r.skip||r.excludeEnd||r.returnEnd)throw De("skip, excludeEnd, returnEnd not compatible with endScope: {}"),it;if(typeof r.endScope!="object"||r.endScope===null)throw De("endScope must be object"),it;On(r,r.end,{key:"endScope"}),r.end=M(r.end,{joinWith:""})}}function zs(r){r.scope&&typeof r.scope=="object"&&r.scope!==null&&(r.beginScope=r.scope,delete r.scope)}function Gs(r){zs(r),typeof r.beginScope=="string"&&(r.beginScope={_wrap:r.beginScope}),typeof r.endScope=="string"&&(r.endScope={_wrap:r.endScope}),Ks(r),Ws(r)}function Xs(r){function c(w,_){return new RegExp(y(w),"m"+(r.case_insensitive?"i":"")+(r.unicodeRegex?"u":"")+(_?"g":""))}class g{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(_,A){A.position=this.position++,this.matchIndexes[this.matchAt]=A,this.regexes.push([A,_]),this.matchAt+=F(_)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const _=this.regexes.map(A=>A[1]);this.matcherRe=c(M(_,{joinWith:"|"}),!0),this.lastIndex=0}exec(_){this.matcherRe.lastIndex=this.lastIndex;const A=this.matcherRe.exec(_);if(!A)return null;const oe=A.findIndex((et,Lt)=>Lt>0&&et!==void 0),$=this.matchIndexes[oe];return A.splice(0,oe),Object.assign(A,$)}}class R{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(_){if(this.multiRegexes[_])return this.multiRegexes[_];const A=new g;return this.rules.slice(_).forEach(([oe,$])=>A.addRule(oe,$)),A.compile(),this.multiRegexes[_]=A,A}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(_,A){this.rules.push([_,A]),A.type==="begin"&&this.count++}exec(_){const A=this.getMatcher(this.regexIndex);A.lastIndex=this.lastIndex;let oe=A.exec(_);if(this.resumingScanAtSamePosition()&&!(oe&&oe.index===this.lastIndex)){const $=this.getMatcher(0);$.lastIndex=this.lastIndex+1,oe=$.exec(_)}return oe&&(this.regexIndex+=oe.position+1,this.regexIndex===this.count&&this.considerAll()),oe}}function Q(w){const _=new R;return w.contains.forEach(A=>_.addRule(A.begin,{rule:A,type:"begin"})),w.terminatorEnd&&_.addRule(w.terminatorEnd,{type:"end"}),w.illegal&&_.addRule(w.illegal,{type:"illegal"}),_}function Z(w,_){const A=w;if(w.isCompiled)return A;[$e,Mt,Gs,Us].forEach($=>$(w,_)),r.compilerExtensions.forEach($=>$(w,_)),w.__beforeBegin=null,[Nt,Ct,js].forEach($=>$(w,_)),w.isCompiled=!0;let oe=null;return typeof w.keywords=="object"&&w.keywords.$pattern&&(w.keywords=Object.assign({},w.keywords),oe=w.keywords.$pattern,delete w.keywords.$pattern),oe=oe||/\w+/,w.keywords&&(w.keywords=En(w.keywords,r.case_insensitive)),A.keywordPatternRe=c(oe,!0),_&&(w.begin||(w.begin=/\B|\b/),A.beginRe=c(A.begin),!w.end&&!w.endsWithParent&&(w.end=/\B|\b/),w.end&&(A.endRe=c(A.end)),A.terminatorEnd=y(A.end)||"",w.endsWithParent&&_.terminatorEnd&&(A.terminatorEnd+=(w.end?"|":"")+_.terminatorEnd)),w.illegal&&(A.illegalRe=c(w.illegal)),w.contains||(w.contains=[]),w.contains=[].concat(...w.contains.map(function($){return Ys($==="self"?w:$)})),w.contains.forEach(function($){Z($,A)}),w.starts&&Z(w.starts,_),A.matcher=Q(A),A}if(r.compilerExtensions||(r.compilerExtensions=[]),r.contains&&r.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return r.classNameAliases=s(r.classNameAliases||{}),Z(r)}function An(r){return r?r.endsWithParent||An(r.starts):!1}function Ys(r){return r.variants&&!r.cachedVariants&&(r.cachedVariants=r.variants.map(function(c){return s(r,{variants:null},c)})),r.cachedVariants?r.cachedVariants:An(r)?s(r,{starts:r.starts?s(r.starts):null}):Object.isFrozen(r)?s(r):r}var Js="11.11.1";class Qs extends Error{constructor(c,g){super(c),this.name="HTMLInjectionError",this.html=g}}const Bt=t,Sn=s,Rn=Symbol("nomatch"),Zs=7,Tn=function(r){const c=Object.create(null),g=Object.create(null),R=[];let Q=!0;const Z="Could not find the language '{}', did you forget to load/include a language module?",w={disableAutodetect:!0,name:"Plain text",contains:[]};let _={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function A(d){return _.noHighlightRe.test(d)}function oe(d){let x=d.className+" ";x+=d.parentNode?d.parentNode.className:"";const U=_.languageDetectRe.exec(x);if(U){const Y=Ne(U[1]);return Y||(kn(Z.replace("{}",U[1])),kn("Falling back to no-highlight mode for this block.",d)),Y?U[1]:"no-highlight"}return x.split(/\s+/).find(Y=>A(Y)||Ne(Y))}function $(d,x,U){let Y="",se="";typeof x=="object"?(Y=d,U=x.ignoreIllegals,se=x.language):(We("10.7.0","highlight(lang, code, ...args) has been deprecated."),We("10.7.0",`Please use highlight(code, options) instead.
|
|
4
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),se=d,Y=x),U===void 0&&(U=!0);const me={code:Y,language:se};at("before:highlight",me);const Ce=me.result?me.result:et(me.language,me.code,U);return Ce.code=me.code,at("after:highlight",Ce),Ce}function et(d,x,U,Y){const se=Object.create(null);function me(v,E){return v.keywords[E]}function Ce(){if(!N.keywords){ae.addText(J);return}let v=0;N.keywordPatternRe.lastIndex=0;let E=N.keywordPatternRe.exec(J),L="";for(;E;){L+=J.substring(v,E.index);const V=Ee.case_insensitive?E[0].toLowerCase():E[0],ce=me(N,V);if(ce){const[Se,gr]=ce;if(ae.addText(L),L="",se[V]=(se[V]||0)+1,se[V]<=Zs&&(ht+=gr),Se.startsWith("_"))L+=E[0];else{const yr=Ee.classNameAliases[Se]||Se;we(E[0],yr)}}else L+=E[0];v=N.keywordPatternRe.lastIndex,E=N.keywordPatternRe.exec(J)}L+=J.substring(v),ae.addText(L)}function ct(){if(J==="")return;let v=null;if(typeof N.subLanguage=="string"){if(!c[N.subLanguage]){ae.addText(J);return}v=et(N.subLanguage,J,!0,Dn[N.subLanguage]),Dn[N.subLanguage]=v._top}else v=It(J,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(ht+=v.relevance),ae.__addSublanguage(v._emitter,v.language)}function ge(){N.subLanguage!=null?ct():Ce(),J=""}function we(v,E){v!==""&&(ae.startScope(E),ae.addText(v),ae.endScope())}function Bn(v,E){let L=1;const V=E.length-1;for(;L<=V;){if(!v._emit[L]){L++;continue}const ce=Ee.classNameAliases[v[L]]||v[L],Se=E[L];ce?we(Se,ce):(J=Se,Ce(),J=""),L++}}function Ln(v,E){return v.scope&&typeof v.scope=="string"&&ae.openNode(Ee.classNameAliases[v.scope]||v.scope),v.beginScope&&(v.beginScope._wrap?(we(J,Ee.classNameAliases[v.beginScope._wrap]||v.beginScope._wrap),J=""):v.beginScope._multi&&(Bn(v.beginScope,E),J="")),N=Object.create(v,{parent:{value:N}}),N}function In(v,E,L){let V=O(v.endRe,L);if(V){if(v["on:end"]){const ce=new e(v);v["on:end"](E,ce),ce.isMatchIgnored&&(V=!1)}if(V){for(;v.endsParent&&v.parent;)v=v.parent;return v}}if(v.endsWithParent)return In(v.parent,E,L)}function hr(v){return N.matcher.regexIndex===0?(J+=v[0],1):(Ut=!0,0)}function ur(v){const E=v[0],L=v.rule,V=new e(L),ce=[L.__beforeBegin,L["on:begin"]];for(const Se of ce)if(Se&&(Se(v,V),V.isMatchIgnored))return hr(E);return L.skip?J+=E:(L.excludeBegin&&(J+=E),ge(),!L.returnBegin&&!L.excludeBegin&&(J=E)),Ln(L,v),L.returnBegin?0:E.length}function fr(v){const E=v[0],L=x.substring(v.index),V=In(N,v,L);if(!V)return Rn;const ce=N;N.endScope&&N.endScope._wrap?(ge(),we(E,N.endScope._wrap)):N.endScope&&N.endScope._multi?(ge(),Bn(N.endScope,v)):ce.skip?J+=E:(ce.returnEnd||ce.excludeEnd||(J+=E),ge(),ce.excludeEnd&&(J=E));do N.scope&&ae.closeNode(),!N.skip&&!N.subLanguage&&(ht+=N.relevance),N=N.parent;while(N!==V.parent);return V.starts&&Ln(V.starts,v),ce.returnEnd?0:E.length}function dr(){const v=[];for(let E=N;E!==Ee;E=E.parent)E.scope&&v.unshift(E.scope);v.forEach(E=>ae.openNode(E))}let lt={};function Pn(v,E){const L=E&&E[0];if(J+=v,L==null)return ge(),0;if(lt.type==="begin"&&E.type==="end"&<.index===E.index&&L===""){if(J+=x.slice(E.index,E.index+1),!Q){const V=new Error(`0 width match regex (${d})`);throw V.languageName=d,V.badRule=lt.rule,V}return 1}if(lt=E,E.type==="begin")return ur(E);if(E.type==="illegal"&&!U){const V=new Error('Illegal lexeme "'+L+'" for mode "'+(N.scope||"<unnamed>")+'"');throw V.mode=N,V}else if(E.type==="end"){const V=fr(E);if(V!==Rn)return V}if(E.type==="illegal"&&L==="")return J+=`
|
|
5
|
+
`,1;if(jt>1e5&&jt>E.index*3)throw new Error("potential infinite loop, way more iterations than matches");return J+=L,L.length}const Ee=Ne(d);if(!Ee)throw De(Z.replace("{}",d)),new Error('Unknown language: "'+d+'"');const pr=Xs(Ee);let Dt="",N=Y||pr;const Dn={},ae=new _.__emitter(_);dr();let J="",ht=0,je=0,jt=0,Ut=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(x,ae);else{for(N.matcher.considerAll();;){jt++,Ut?Ut=!1:N.matcher.considerAll(),N.matcher.lastIndex=je;const v=N.matcher.exec(x);if(!v)break;const E=x.substring(je,v.index),L=Pn(E,v);je=v.index+L}Pn(x.substring(je))}return ae.finalize(),Dt=ae.toHTML(),{language:d,value:Dt,relevance:ht,illegal:!1,_emitter:ae,_top:N}}catch(v){if(v.message&&v.message.includes("Illegal"))return{language:d,value:Bt(x),illegal:!0,relevance:0,_illegalBy:{message:v.message,index:je,context:x.slice(je-100,je+100),mode:v.mode,resultSoFar:Dt},_emitter:ae};if(Q)return{language:d,value:Bt(x),illegal:!1,relevance:0,errorRaised:v,_emitter:ae,_top:N};throw v}}function Lt(d){const x={value:Bt(d),illegal:!1,relevance:0,_top:w,_emitter:new _.__emitter(_)};return x._emitter.addText(d),x}function It(d,x){x=x||_.languages||Object.keys(c);const U=Lt(d),Y=x.filter(Ne).filter(Mn).map(ge=>et(ge,d,!1));Y.unshift(U);const se=Y.sort((ge,we)=>{if(ge.relevance!==we.relevance)return we.relevance-ge.relevance;if(ge.language&&we.language){if(Ne(ge.language).supersetOf===we.language)return 1;if(Ne(we.language).supersetOf===ge.language)return-1}return 0}),[me,Ce]=se,ct=me;return ct.secondBest=Ce,ct}function $s(d,x,U){const Y=x&&g[x]||U;d.classList.add("hljs"),d.classList.add(`language-${Y}`)}function Pt(d){let x=null;const U=oe(d);if(A(U))return;if(at("before:highlightElement",{el:d,language:U}),d.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",d);return}if(d.children.length>0&&(_.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(d)),_.throwUnescapedHTML))throw new Qs("One of your code blocks includes unescaped HTML.",d.innerHTML);x=d;const Y=x.textContent,se=U?$(Y,{language:U,ignoreIllegals:!0}):It(Y);d.innerHTML=se.value,d.dataset.highlighted="yes",$s(d,U,se.language),d.result={language:se.language,re:se.relevance,relevance:se.relevance},se.secondBest&&(d.secondBest={language:se.secondBest.language,relevance:se.secondBest.relevance}),at("after:highlightElement",{el:d,result:se,text:Y})}function er(d){_=Sn(_,d)}const tr=()=>{ot(),We("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function nr(){ot(),We("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Nn=!1;function ot(){function d(){ot()}if(document.readyState==="loading"){Nn||window.addEventListener("DOMContentLoaded",d,!1),Nn=!0;return}document.querySelectorAll(_.cssSelector).forEach(Pt)}function sr(d,x){let U=null;try{U=x(r)}catch(Y){if(De("Language definition for '{}' could not be registered.".replace("{}",d)),Q)De(Y);else throw Y;U=w}U.name||(U.name=d),c[d]=U,U.rawDefinition=x.bind(null,r),U.aliases&&Cn(U.aliases,{languageName:d})}function rr(d){delete c[d];for(const x of Object.keys(g))g[x]===d&&delete g[x]}function ir(){return Object.keys(c)}function Ne(d){return d=(d||"").toLowerCase(),c[d]||c[g[d]]}function Cn(d,{languageName:x}){typeof d=="string"&&(d=[d]),d.forEach(U=>{g[U.toLowerCase()]=x})}function Mn(d){const x=Ne(d);return x&&!x.disableAutodetect}function or(d){d["before:highlightBlock"]&&!d["before:highlightElement"]&&(d["before:highlightElement"]=x=>{d["before:highlightBlock"](Object.assign({block:x.el},x))}),d["after:highlightBlock"]&&!d["after:highlightElement"]&&(d["after:highlightElement"]=x=>{d["after:highlightBlock"](Object.assign({block:x.el},x))})}function ar(d){or(d),R.push(d)}function cr(d){const x=R.indexOf(d);x!==-1&&R.splice(x,1)}function at(d,x){const U=d;R.forEach(function(Y){Y[U]&&Y[U](x)})}function lr(d){return We("10.7.0","highlightBlock will be removed entirely in v12.0"),We("10.7.0","Please use highlightElement now."),Pt(d)}Object.assign(r,{highlight:$,highlightAuto:It,highlightAll:ot,highlightElement:Pt,highlightBlock:lr,configure:er,initHighlighting:tr,initHighlightingOnLoad:nr,registerLanguage:sr,unregisterLanguage:rr,listLanguages:ir,getLanguage:Ne,registerAliases:Cn,autoDetection:Mn,inherit:Sn,addPlugin:ar,removePlugin:cr}),r.debugMode=function(){Q=!1},r.safeMode=function(){Q=!0},r.versionString=Js,r.regex={concat:S,lookahead:b,either:q,optional:p,anyNumberOfTimes:k};for(const d in Ke)typeof Ke[d]=="object"&&n(Ke[d]);return Object.assign(r,Ke),r},ze=Tn({});return ze.newInstance=()=>Tn({}),Kt=ze,ze.HighlightJS=ze,ze.default=ze,Kt}var di=fi();const zn=ms(di);var pi=re("<pre><code><!></code></pre>");function gi(n,e){const t=Et(e,["children","$$slots","$$events","$$legacy"]),s=Et(t,["code","highlighted","languageName","langtag"]);let i=Fe(e,"code",8),o=Fe(e,"highlighted",8),a=Fe(e,"languageName",8,"plaintext"),h=Fe(e,"langtag",8,!1);var l=pi();let f;var u=B(l);gn(u,1,"",null,{},{hljs:!0});var y=B(u);{var b=p=>{var S=He(),m=ye(S);vs(m,o),K(p,S)},k=p=>{var S=rs();ue(()=>le(S,i())),K(p,S)};he(y,p=>{o()?p(b):p(k,!1)})}C(u),C(l),ue(p=>f=Vr(l,f,{"data-language":a(),...s,[Kr]:p},"svelte-1w9vok"),[()=>({langtag:h()})],cs),K(n,l)}function Gn(n,e){const t=Et(e,["children","$$slots","$$events","$$legacy"]),s=Et(t,["language","code","langtag"]);Le(e,!1);let i=Fe(e,"language",8),o=Fe(e,"code",8),a=Fe(e,"langtag",8,!1);const h=Hr();let l=Ir("");qr(()=>{z(l)&&h("highlight",{highlighted:z(l)})}),Br(()=>(Vn(i()),Vn(o())),()=>{zn.registerLanguage(i().name,i().register),qe(l,zn.highlight(o(),{language:i().name}).value)}),Lr(),gs();var f=He(),u=ye(f);Xr(u,e,"default",{get highlighted(){return z(l)}},y=>{gi(y,jr(()=>s,{get languageName(){return i().name},get langtag(){return a()},get highlighted(){return z(l)},get code(){return o()}}))}),K(n,f),Ie()}function yi(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],i={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[e,t,n.QUOTE_STRING_MODE,i,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const Xn={name:"json",register:yi},bs=pn({});let Yn=0;function Wt(n,e,t=!1){let s;return e.id?s=e.id:s=`${++Yn}`,e.id=s,t&&(s=`${s}-${++Yn}`),bs.update(i=>{if(!i[s])n==="SEND"?i[s]=[e,{}]:i[s]=[{},e];else{const o=n==="SEND"?0:1;i[s][o]=e}return i}),e}var vi=re(`<style>body {
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}</style>`),_i=re('<div class="p-8 text-center text-gray-500"><div class="text-4xl mb-2">📭</div> <p class="font-medium">No activity yet</p> <p class="text-sm">Activity will appear here when you interact with Sockethub</p></div>'),mi=re('<ul class="divide-y divide-gray-100"></ul>'),bi=(n,e)=>qe(e,!1),wi=(n,e)=>qe(e,!1),Ei=re(`<div class="bg-gradient-to-r from-slate-50 to-gray-50 border border-gray-200 rounded-xl p-6 shadow-sm"><div class="flex items-center justify-between mb-4"><div><h3 class="text-xl font-bold text-gray-900 flex items-center"><span class="mr-2">📡</span> Sockethub Activity Log</h3> <p class="text-gray-600 text-sm mt-1">Real-time communication between your browser and Sockethub server</p></div> <div class="flex items-center space-x-4 text-xs"><div class="flex items-center space-x-1"><div class="w-3 h-3 bg-orange-400 rounded-full"></div> <span class="text-gray-600">Outgoing</span></div> <div class="flex items-center space-x-1"><div class="w-3 h-3 bg-green-500 rounded-full"></div> <span class="text-gray-600">Response</span></div></div></div> <div class="bg-white rounded-lg border border-gray-200 shadow-sm"><div class="p-4 border-b border-gray-200 bg-gray-50 rounded-t-lg"><p class="text-sm text-gray-700">💡 <strong>How to read this log:</strong> Each entry shows messages sent to and received from Sockethub.
|
|
8
|
+
Click "View Details" to see the full JSON data being exchanged.</p></div> <div id="messages" class="max-h-96 overflow-y-auto"><!></div></div></div> <div><div class="bg-white rounded-xl shadow-2xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col"><div class="bg-gradient-to-r from-indigo-50 to-purple-50 px-6 py-4 border-b border-gray-200"><div class="flex items-center justify-between"><h3 class="text-lg font-bold text-gray-900 flex items-center"><span class="mr-2">🔍</span> ActivityStreams Data Exchange</h3> <button class="text-gray-400 hover:text-gray-600 transition-colors"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <p class="text-gray-600 text-sm mt-1">Raw JSON data showing the ActivityStreams message exchange with Sockethub</p></div> <div class="flex-1 overflow-auto p-6 space-y-6"><div class="bg-gradient-to-r from-blue-50 to-cyan-50 border border-blue-200 rounded-lg p-4"><h4 class="font-semibold text-blue-900 mb-3 flex items-center"><span class="mr-2">📤</span> Sent to Sockethub</h4> <div class="bg-white rounded border border-blue-200 overflow-hidden"><!></div></div> <div class="bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-lg p-4"><h4 class="font-semibold text-green-900 mb-3 flex items-center"><span class="mr-2">📥</span> Response from Sockethub</h4> <div class="bg-white rounded border border-green-200 overflow-hidden"><!></div></div></div> <div class="bg-gray-50 px-6 py-4 border-t border-gray-200 flex justify-end"><button class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors font-medium">Close</button></div></div></div>`,1);function Io(n,e){Le(e,!0);let t=ut(void 0),s=ut(!1),i=ut(""),o=ut("");bs.subscribe(P=>{qe(t,Ft(P))});function a(P){return()=>{let W=P,te=P;P.includes("-")&&(W=P.split("-")[0]),console.log(`indexSend:${W} indexResp:${te}`),console.log("logs: ",z(t)),qe(s,!0),qe(i,Ft(JSON.stringify(z(t)[W][0],null,2))),qe(o,Ft(JSON.stringify(z(t)[te][1]||{},null,2)))}}var h=Ei();_r(P=>{var W=He(),te=ye(W);{var de=ne=>{var ie=vi();K(ne,ie)};he(te,ne=>{z(s)&&ne(de)})}K(P,W)});var l=ye(h),f=G(B(l),2),u=G(B(f),2),y=B(u);{var b=P=>{var W=_i();K(P,W)},k=P=>{var W=mi();Zt(W,21,()=>Object.entries(z(t)).sort((te,de)=>{let ne=te[0],ie,pe=de[0],Pe;return te[0].includes("-")&&([ne,ie]=te[0].split("-")),de[0].includes("-")&&([pe,Pe]=de[0].split("-")),ie&&Pe?parseInt(ie)>=parseInt(Pe)?-1:1:parseInt(ne)>=parseInt(pe)?-1:1}),Qt,(te,de)=>{let ne=()=>z(de)[0],ie=()=>z(de)[1];var pe=He(),Pe=ye(pe);{var At=Re=>{var Ve=He(),Qe=ye(Ve);Zt(Qe,17,()=>Object.entries(ie()[ie().length-1]),Qt,(Ze,_e)=>{let Te=()=>z(_e)[0],rt=()=>z(_e)[1];var Rt=He(),Ke=ye(Rt);{var Tt=$e=>{const Nt=tt(()=>a(`${ne()}-${Te()}`)),Ct=tt(()=>typeof z(t)[ne()][1]<"u"),Mt=tt(()=>`${ne()}-${Te()}`);Vt($e,{get buttonAction(){return z(Nt)},get response(){return z(Ct)},get id(){return z(Mt)},get entry(){return rt()}})};he(Ke,$e=>{rt()&&$e(Tt)})}K(Ze,Rt)}),K(Re,Ve)},St=(Re,Ve)=>{{var Qe=_e=>{const Te=tt(()=>a(ne()));Vt(_e,{get buttonAction(){return z(Te)},get id(){return ne()},response:!0,get entry(){return ie()[1]}})},Ze=_e=>{const Te=tt(()=>a(ne()));Vt(_e,{get buttonAction(){return z(Te)},get id(){return ne()},response:!1,get entry(){return ie()[0]}})};he(Re,_e=>{Object.prototype.hasOwnProperty.call(ie()[1],"context")?_e(Qe):_e(Ze,!1)},Ve)}};he(Pe,Re=>{Array.isArray(ie()[ie().length-1])?Re(At):Re(St,!1)})}K(te,pe)}),C(W),K(P,W)};he(y,P=>{Object.keys(z(t)).length===0?P(b):P(k,!1)})}C(u),C(f),C(l);var p=G(l,2),S=B(p),m=B(S),q=B(m),F=G(B(q),2);F.__click=[bi,s],C(q),ps(2),C(m);var O=G(m,2),T=B(O),M=G(B(T),2),Ae=B(M);Gn(Ae,{language:Xn,get code(){return z(i)}}),C(M),C(T);var fe=G(T,2),I=G(B(fe),2),X=B(I);Gn(X,{language:Xn,get code(){return z(o)}}),C(I),C(fe),C(O);var D=G(O,2),j=B(D);j.__click=[wi,s],C(D),C(S),C(p),ue(()=>gn(p,1,`${(z(s)?"flex items-center justify-center":"hidden")??""} bg-black bg-opacity-50 fixed top-0 left-0 w-full h-full z-50 p-4`)),K(n,h),Ie()}is(["click"]);var zt={exports:{}},Jn;function xi(){return Jn||(Jn=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function i(l,f,u){this.fn=l,this.context=f,this.once=u||!1}function o(l,f,u,y,b){if(typeof u!="function")throw new TypeError("The listener must be a function");var k=new i(u,y||l,b),p=t?t+f:f;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],k]:l._events[p].push(k):(l._events[p]=k,l._eventsCount++),l}function a(l,f){--l._eventsCount===0?l._events=new s:delete l._events[f]}function h(){this._events=new s,this._eventsCount=0}h.prototype.eventNames=function(){var f=[],u,y;if(this._eventsCount===0)return f;for(y in u=this._events)e.call(u,y)&&f.push(t?y.slice(1):y);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(u)):f},h.prototype.listeners=function(f){var u=t?t+f:f,y=this._events[u];if(!y)return[];if(y.fn)return[y.fn];for(var b=0,k=y.length,p=new Array(k);b<k;b++)p[b]=y[b].fn;return p},h.prototype.listenerCount=function(f){var u=t?t+f:f,y=this._events[u];return y?y.fn?1:y.length:0},h.prototype.emit=function(f,u,y,b,k,p){var S=t?t+f:f;if(!this._events[S])return!1;var m=this._events[S],q=arguments.length,F,O;if(m.fn){switch(m.once&&this.removeListener(f,m.fn,void 0,!0),q){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,u),!0;case 3:return m.fn.call(m.context,u,y),!0;case 4:return m.fn.call(m.context,u,y,b),!0;case 5:return m.fn.call(m.context,u,y,b,k),!0;case 6:return m.fn.call(m.context,u,y,b,k,p),!0}for(O=1,F=new Array(q-1);O<q;O++)F[O-1]=arguments[O];m.fn.apply(m.context,F)}else{var T=m.length,M;for(O=0;O<T;O++)switch(m[O].once&&this.removeListener(f,m[O].fn,void 0,!0),q){case 1:m[O].fn.call(m[O].context);break;case 2:m[O].fn.call(m[O].context,u);break;case 3:m[O].fn.call(m[O].context,u,y);break;case 4:m[O].fn.call(m[O].context,u,y,b);break;default:if(!F)for(M=1,F=new Array(q-1);M<q;M++)F[M-1]=arguments[M];m[O].fn.apply(m[O].context,F)}}return!0},h.prototype.on=function(f,u,y){return o(this,f,u,y,!1)},h.prototype.once=function(f,u,y){return o(this,f,u,y,!0)},h.prototype.removeListener=function(f,u,y,b){var k=t?t+f:f;if(!this._events[k])return this;if(!u)return a(this,k),this;var p=this._events[k];if(p.fn)p.fn===u&&(!b||p.once)&&(!y||p.context===y)&&a(this,k);else{for(var S=0,m=[],q=p.length;S<q;S++)(p[S].fn!==u||b&&!p[S].once||y&&p[S].context!==y)&&m.push(p[S]);m.length?this._events[k]=m.length===1?m[0]:m:a(this,k)}return this},h.prototype.removeAllListeners=function(f){var u;return f?(u=t?t+f:f,this._events[u]&&a(this,u)):(this._events=new s,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=t,h.EventEmitter=h,n.exports=h}(zt)),zt.exports}var ki=xi();const ws=ms(ki),Ye=new ws,yt={stream:["id","type","actor","target","object","context","context","published","error"],object:["id","type","context","alias","attachedTo","attachment","attributedTo","attributedWith","condition","content","contentMap","context","contextOf","name","endTime","generator","generatorOf","group","icon","image","inReplyTo","members","memberOf","message","location","locationOf","objectOf","originOf","presence","preview","previewOf","provider","providerOf","published","rating","relationship","resultOf","replies","role","scope","scopeOf","startTime","status","summary","topic","tag","tagOf","targetOf","title","titleMap","updated","url","xmpp:stanza-id"]},Es={"@id":"id","@type":"type",verb:"type",displayName:"name",objectType:"type",platform:"context"},Qn={actor:{primary:"id",props:yt},target:{primary:"id",props:yt},object:{primary:"content",props:yt}},Xe=new Map,en={};let tn=!1,nn=!0,xs=[];function Oi(n,e){return!!(en[n]instanceof Object&&en[n].includes(e))}function Ai(n,e){return n[Es[e]]=n[e],delete n[e],n}function sn(n,e,t=!1){if(e===null)throw new Error(`ActivityStreams validation failed: the "${n}" property is null. Example: { id: "user@example.com", type: "person" }`);if(e===void 0)throw new Error(`ActivityStreams validation failed: the "${n}" property is undefined. Example: { id: "user@example.com", type: "person" }`);if(typeof e=="string")throw new Error(`ActivityStreams validation failed: the "${n}" property received string "${e}" but expected an object. Use: { id: "${e}", type: "person" }`);if(typeof e!="object"||Array.isArray(e)){const o=Array.isArray(e)?"array":typeof e,a=String(e);throw new Error(`ActivityStreams validation failed: the "${n}" property must be an object, received ${o} (${a}). Example: { id: "user@example.com", type: "person" }`)}if(t&&!e.id)throw new Error(`ActivityStreams validation failed: the "${n}" property requires an 'id' property. Example: { id: "user@example.com", type: "person" }`);const i=Object.keys(e).filter(o=>!yt[n].includes(o));for(const o of i){let a=e;if(Es[o]){a=Ai(a,o);continue}if(!Oi(a.type,o)&&!xs.includes(a.type)){console.log(a);const h=typeof a[o]=="string"?`"${a[o]}"`:String(a[o]),l=`ActivityStreams validation failed: property "${o}" with value ${h} is not allowed on the "${n}" object of type "${a.type}".`;if(tn)throw new Error(l);nn&&console.warn(l)}}}function Si(n){const e={};for(const t of Object.keys(n))if(typeof n[t]=="string")e[t]=Xe.get(n[t])||n[t];else if(Array.isArray(n[t])){e[t]=[];for(const s of n[t])typeof s=="string"&&e[t].push(Xe.get(s)||s)}else e[t]=n[t];for(const t of Object.keys(Qn))if(typeof e[t]=="string"){const s=Qn[t].primary,i={};i[s]=e[t],e[t]=i}return e}function Ri(n){sn("stream",n),typeof n.object=="object"&&sn("object",n.object);const e=Si(n);return Ye.emit("activity-stream",e),e}const Ti={create:n=>{sn("object",n,!0);const e=n;return Xe.set(e.id,e),Ye.emit("activity-object-create",e),e},delete:n=>{const e=Xe.delete(n);return e&&Ye.emit("activity-object-delete",n),e},get:(n,e)=>{let t=Xe.get(n);if(!t){if(!e)return n;t={id:n}}return t},list:()=>Xe.keys()};function ks(n={}){xs=(n==null?void 0:n.specialObjs)||[],tn=typeof n.failOnUnknownObjectProperties=="boolean"?n.failOnUnknownObjectProperties:tn,nn=typeof n.warnOnUnknownObjectProperties=="boolean"?n.warnOnUnknownObjectProperties:nn;for(const e of Object.keys(n.customProps||{}))typeof n.customProps[e]=="object"&&(en[e]=n.customProps[e]);return{Stream:Ri,Object:Ti,on:(e,t)=>Ye.on(e,t),once:(e,t)=>Ye.once(e,t),off:(e,t)=>Ye.off(e,t)}}(n=>{n.ASFactor=ks})(typeof window=="object"?window:{});class xt{constructor(e){if(this.events={credentials:new Map,"activity-object":new Map,connect:new Map,join:new Map},this.debug=!0,!e)throw new Error("SockethubClient requires a socket.io instance");this._socket=e,this.socket=this.createPublicEmitter(),this.registerSocketIOHandlers(),this.initActivityStreams(),this.ActivityStreams.on("activity-object-create",t=>{e.emit("activity-object",t,s=>{s?console.error("failed to create activity-object ",s):this.eventActivityObject(t)})}),e.on("activity-object",t=>{this.ActivityStreams.Object.create(t)})}initActivityStreams(){this.ActivityStreams=ks({specialObjs:["credentials"]})}clearCredentials(){this.events.credentials.clear()}createPublicEmitter(){const e=new ws;return e._emit=e.emit,e.emit=(t,s,i)=>{t==="credentials"?this.eventCredentials(s):t==="activity-object"?this.eventActivityObject(s):t==="message"&&this.eventMessage(s),this._socket.emit(t,s,i)},e.connected=!1,e.disconnect=()=>{this._socket.disconnect()},e.connect=()=>{this._socket.connect()},e}eventActivityObject(e){e.id&&this.events["activity-object"].set(e.id,e)}eventCredentials(e){if(e.object&&e.object.type==="credentials"){const t=e.actor.id||e.actor;this.events.credentials.set(t,e)}}eventMessage(e){if(!this._socket.connected)return;const t=xt.getKey(e);e.type==="join"||e.type==="connect"?this.events[e.type].set(t,e):e.type==="leave"?this.events.join.delete(t):e.type==="disconnect"&&this.events.connect.delete(t)}static getKey(e){var i;const t=((i=e.actor)==null?void 0:i.id)||e.actor;if(!t)throw new Error(`actor property not present for message type: ${e==null?void 0:e.type}`);const s=e.target?e.target.id||e.target:"";return`${t}-${s}`}log(e,t){this.debug&&console.log(e,t)}registerSocketIOHandlers(){const e=t=>async s=>{t==="connect"?(this.socket.id=this._socket.id,this.socket.connected=!0,this.replay("activity-object",this.events["activity-object"]),this.replay("credentials",this.events.credentials),this.replay("message",this.events.connect),this.replay("message",this.events.join)):t==="disconnect"&&(this.socket.connected=!1),this.socket._emit(t,s)};this._socket.on("connect",e("connect")),this._socket.on("connect_error",e("connect_error")),this._socket.on("disconnect",e("disconnect")),this._socket.on("message",t=>{this.socket._emit("message",this.ActivityStreams.Stream(t))})}hasActorId(e){return"actor"in e&&e.actor!==null&&typeof e.actor=="object"&&"id"in e.actor&&typeof e.actor.id=="string"}replay(e,t){for(const s of t.values()){const i=this.ActivityStreams.Stream(s);let o=i==null?void 0:i.id;this.hasActorId(i)&&(o=i.actor.id),this.log(`replaying ${e} for ${o}`),this._socket.emit(e,i)}}}(n=>{n.SockethubClient=xt})(typeof window=="object"?window:{});const Oe=Object.create(null);Oe.open="0";Oe.close="1";Oe.ping="2";Oe.pong="3";Oe.message="4";Oe.upgrade="5";Oe.noop="6";const vt=Object.create(null);Object.keys(Oe).forEach(n=>{vt[Oe[n]]=n});const rn={type:"error",data:"parser error"},Os=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",As=typeof ArrayBuffer=="function",Ss=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,vn=({type:n,data:e},t,s)=>Os&&e instanceof Blob?t?s(e):Zn(e,s):As&&(e instanceof ArrayBuffer||Ss(e))?t?s(e):Zn(new Blob([e]),s):s(Oe[n]+(e||"")),Zn=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function $n(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Gt;function Ni(n,e){if(Os&&n.data instanceof Blob)return n.data.arrayBuffer().then($n).then(e);if(As&&(n.data instanceof ArrayBuffer||Ss(n.data)))return e($n(n.data));vn(n,!1,t=>{Gt||(Gt=new TextEncoder),e(Gt.encode(t))})}const es="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",st=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<es.length;n++)st[es.charCodeAt(n)]=n;const Ci=n=>{let e=n.length*.75,t=n.length,s,i=0,o,a,h,l;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const f=new ArrayBuffer(e),u=new Uint8Array(f);for(s=0;s<t;s+=4)o=st[n.charCodeAt(s)],a=st[n.charCodeAt(s+1)],h=st[n.charCodeAt(s+2)],l=st[n.charCodeAt(s+3)],u[i++]=o<<2|a>>4,u[i++]=(a&15)<<4|h>>2,u[i++]=(h&3)<<6|l&63;return f},Mi=typeof ArrayBuffer=="function",_n=(n,e)=>{if(typeof n!="string")return{type:"message",data:Rs(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:Bi(n.substring(1),e)}:vt[t]?n.length>1?{type:vt[t],data:n.substring(1)}:{type:vt[t]}:rn},Bi=(n,e)=>{if(Mi){const t=Ci(n);return Rs(t,e)}else return{base64:!0,data:n}},Rs=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},Ts="",Li=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((o,a)=>{vn(o,!1,h=>{s[a]=h,++i===t&&e(s.join(Ts))})})},Ii=(n,e)=>{const t=n.split(Ts),s=[];for(let i=0;i<t.length;i++){const o=_n(t[i],e);if(s.push(o),o.type==="error")break}return s};function Pi(){return new TransformStream({transform(n,e){Ni(n,t=>{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,s)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let Xt;function dt(n){return n.reduce((e,t)=>e+t.length,0)}function pt(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;i<e;i++)t[i]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),t}function Di(n,e){Xt||(Xt=new TextDecoder);const t=[];let s=0,i=-1,o=!1;return new TransformStream({transform(a,h){for(t.push(a);;){if(s===0){if(dt(t)<1)break;const l=pt(t,1);o=(l[0]&128)===128,i=l[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(dt(t)<2)break;const l=pt(t,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),s=3}else if(s===2){if(dt(t)<8)break;const l=pt(t,8),f=new DataView(l.buffer,l.byteOffset,l.length),u=f.getUint32(0);if(u>Math.pow(2,21)-1){h.enqueue(rn);break}i=u*Math.pow(2,32)+f.getUint32(4),s=3}else{if(dt(t)<i)break;const l=pt(t,i);h.enqueue(_n(o?l:Xt.decode(l),e)),s=0}if(i===0||i>n){h.enqueue(rn);break}}}})}const Ns=4;function ee(n){if(n)return ji(n)}function ji(n){for(var e in ee.prototype)n[e]=ee.prototype[e];return n}ee.prototype.on=ee.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};ee.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};ee.prototype.off=ee.prototype.removeListener=ee.prototype.removeAllListeners=ee.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+n],this};ee.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};ee.prototype.emitReserved=ee.prototype.emit;ee.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};ee.prototype.hasListeners=function(n){return!!this.listeners(n).length};const kt=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),ve=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ui="arraybuffer";function Cs(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const Hi=ve.setTimeout,qi=ve.clearTimeout;function Ot(n,e){e.useNativeTimers?(n.setTimeoutFn=Hi.bind(ve),n.clearTimeoutFn=qi.bind(ve)):(n.setTimeoutFn=ve.setTimeout.bind(ve),n.clearTimeoutFn=ve.clearTimeout.bind(ve))}const Fi=1.33;function Vi(n){return typeof n=="string"?Ki(n):Math.ceil((n.byteLength||n.size)*Fi)}function Ki(n){let e=0,t=0;for(let s=0,i=n.length;s<i;s++)e=n.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function Ms(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Wi(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function zi(n){let e={},t=n.split("&");for(let s=0,i=t.length;s<i;s++){let o=t[s].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class Gi extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class mn extends ee{constructor(e){super(),this.writable=!1,Ot(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new Gi(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=_n(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Wi(e);return t.length?"?"+t:""}}class Xi extends mn{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Ii(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Li(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Ms()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let Bs=!1;try{Bs=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Yi=Bs;function Ji(){}class Qi extends Xi{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}class ke extends ee{constructor(e,t,s){super(),this.createRequest=e,Ot(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=Cs(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=ke.requestsCount++,ke.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Ji,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ke.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ke.requestsCount=0;ke.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ts);else if(typeof addEventListener=="function"){const n="onpagehide"in ve?"pagehide":"unload";addEventListener(n,ts,!1)}}function ts(){for(let n in ke.requests)ke.requests.hasOwnProperty(n)&&ke.requests[n].abort()}const Zi=function(){const n=Ls({xdomain:!1});return n&&n.responseType!==null}();class $i extends Qi{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Zi&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new ke(Ls,this.uri(),e)}}function Ls(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Yi))return new XMLHttpRequest}catch{}if(!e)try{return new ve[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Is=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class eo extends mn{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=Is?{}:Cs(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],i=t===e.length-1;vn(s,this.supportsBinary,o=>{try{this.doWrite(s,o)}catch{}i&&kt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ms()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const Yt=ve.WebSocket||ve.MozWebSocket;class to extends eo{createSocket(e,t,s){return Is?new Yt(e,t,s):t?new Yt(e,t):new Yt(e)}doWrite(e,t){this.ws.send(t)}}class no extends mn{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=Di(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Pi();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const o=()=>{s.read().then(({done:h,value:l})=>{h||(this.onPacket(l),o())}).catch(h=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&kt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const so={websocket:to,webtransport:no,polling:$i},ro=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,io=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function on(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=ro.exec(n||""),o={},a=14;for(;a--;)o[io[a]]=i[a]||"";return t!=-1&&s!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=oo(o,o.path),o.queryKey=ao(o,o.query),o}function oo(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function ao(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,o){i&&(t[i]=o)}),t}const an=typeof addEventListener=="function"&&typeof removeEventListener=="function",_t=[];an&&addEventListener("offline",()=>{_t.forEach(n=>n())},!1);class Be extends ee{constructor(e,t){if(super(),this.binaryType=Ui,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=on(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=on(t.host).host);Ot(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=zi(this.opts.query)),an&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},_t.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=Ns,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Be.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",Be.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(t+=Vi(i)),s>0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,kt(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const o={type:e,data:t,options:s};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(Be.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),an&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=_t.indexOf(this._offlineEventListener);s!==-1&&_t.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}Be.protocol=Ns;class co extends Be{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;Be.priorWebsocketSuccess=!1;const i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",y=>{if(!s)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Be.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=t.name,this.emitReserved("upgradeError",b)}}))};function o(){s||(s=!0,u(),t.close(),t=null)}const a=y=>{const b=new Error("probe error: "+y);b.transport=t.name,o(),this.emitReserved("upgradeError",b)};function h(){a("transport closed")}function l(){a("socket closed")}function f(y){t&&y.name!==t.name&&o()}const u=()=>{t.removeListener("open",i),t.removeListener("error",a),t.removeListener("close",h),this.off("close",l),this.off("upgrading",f)};t.once("open",i),t.once("error",a),t.once("close",h),this.once("close",l),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}let lo=class extends co{constructor(e,t={}){const s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>so[i]).filter(i=>!!i)),super(e,s)}};function ho(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=on(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const o=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+o+":"+s.port+e,s.href=s.protocol+"://"+o+(t&&t.port===s.port?"":":"+s.port),s}const uo=typeof ArrayBuffer=="function",fo=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,Ps=Object.prototype.toString,po=typeof Blob=="function"||typeof Blob<"u"&&Ps.call(Blob)==="[object BlobConstructor]",go=typeof File=="function"||typeof File<"u"&&Ps.call(File)==="[object FileConstructor]";function bn(n){return uo&&(n instanceof ArrayBuffer||fo(n))||po&&n instanceof Blob||go&&n instanceof File}function mt(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t<s;t++)if(mt(n[t]))return!0;return!1}if(bn(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return mt(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&mt(n[t]))return!0;return!1}function yo(n){const e=[],t=n.data,s=n;return s.data=cn(t,e),s.attachments=e.length,{packet:s,buffers:e}}function cn(n,e){if(!n)return n;if(bn(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let s=0;s<n.length;s++)t[s]=cn(n[s],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=cn(n[s],e));return t}return n}function vo(n,e){return n.data=ln(n.data,e),delete n.attachments,n}function ln(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=ln(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=ln(n[t],e));return n}const _o=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],mo=5;var H;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(H||(H={}));class bo{constructor(e){this.replacer=e}encode(e){return(e.type===H.EVENT||e.type===H.ACK)&&mt(e)?this.encodeAsBinary({type:e.type===H.EVENT?H.BINARY_EVENT:H.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===H.BINARY_EVENT||e.type===H.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=yo(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}}function ns(n){return Object.prototype.toString.call(n)==="[object Object]"}class wn extends ee{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const s=t.type===H.BINARY_EVENT;s||t.type===H.BINARY_ACK?(t.type=s?H.EVENT:H.ACK,this.reconstructor=new wo(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(bn(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const s={type:Number(e.charAt(0))};if(H[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===H.BINARY_EVENT||s.type===H.BINARY_ACK){const o=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const a=e.substring(o,t);if(a!=Number(a)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(a)}if(e.charAt(t+1)==="/"){const o=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(o,t)}else s.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const o=t+1;for(;++t;){const a=e.charAt(t);if(a==null||Number(a)!=a){--t;break}if(t===e.length)break}s.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(wn.isPayloadValid(s.type,o))s.data=o;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case H.CONNECT:return ns(t);case H.DISCONNECT:return t===void 0;case H.CONNECT_ERROR:return typeof t=="string"||ns(t);case H.EVENT:case H.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&_o.indexOf(t[0])===-1);case H.ACK:case H.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class wo{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=vo(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Eo=Object.freeze(Object.defineProperty({__proto__:null,Decoder:wn,Encoder:bo,get PacketType(){return H},protocol:mo},Symbol.toStringTag,{value:"Module"}));function be(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const xo=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ds extends ee{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[be(e,"open",this.onopen.bind(this)),be(e,"packet",this.onpacket.bind(this)),be(e,"error",this.onerror.bind(this)),be(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,o;if(xo.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const a={type:H.EVENT,data:t};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const u=this.ids++,y=t.pop();this._registerAckCallback(u,y),a.id=u}const h=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!h||(l?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,t){var s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===e&&this.sendBuffer.splice(h,1);t.call(this,new Error("operation has timed out"))},i),a=(...h)=>{this.io.clearTimeoutFn(o),t.apply(this,h)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...t){return new Promise((s,i)=>{const o=(a,h)=>a?i(a):s(h);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...o)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:H.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case H.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case H.EVENT:case H.BINARY_EVENT:this.onevent(e);break;case H.ACK:case H.BINARY_ACK:this.onack(e);break;case H.DISCONNECT:this.ondisconnect();break;case H.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...i){s||(s=!0,t.packet({type:H.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:H.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const s of t)s.apply(this,e.data)}}}function Je(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}Je.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};Je.prototype.reset=function(){this.attempts=0};Je.prototype.setMin=function(n){this.ms=n};Je.prototype.setMax=function(n){this.max=n};Je.prototype.setJitter=function(n){this.jitter=n};class hn extends ee{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Ot(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Je({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||Eo;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new lo(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=be(t,"open",function(){s.onopen(),e&&e()}),o=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),e?e(h):this.maybeReconnectOnOpen()},a=be(t,"error",o);if(this._timeout!==!1){const h=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),t.close()},h);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(be(e,"ping",this.onping.bind(this)),be(e,"data",this.ondata.bind(this)),be(e,"error",this.onerror.bind(this)),be(e,"close",this.onclose.bind(this)),be(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){kt(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new Ds(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const nt={};function bt(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=ho(n,e.path||"/socket.io"),s=t.source,i=t.id,o=t.path,a=nt[i]&&o in nt[i].nsps,h=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let l;return h?l=new hn(s,e):(nt[i]||(nt[i]=new hn(s,e)),l=nt[i]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(bt,{Manager:hn,Socket:Ds,io:bt,connect:bt});let Ge;const ko=pn(!1),Oo={sockethub:{port:10550,host:"localhost",path:"/sockethub"},public:{protocol:"http",host:"localhost",port:10550,path:"/"}};async function Do(n){return console.log("sending ->",n),new Promise((e,t)=>{Ge.socket.emit("message",Wt("SEND",n),s=>{if(console.log("received <-",s),Wt("RESP",s),s.totalItems&&s.items)for(const i of s.items.reverse())Wt("RESP",i,!0);_s(s,!0),s.error?t(s.error):e(s)})})}function Jt(n){return e=>{const t=n==="connect";ko.update(()=>t),console.log(`sockethub ${n} [connected: ${t}]`,e||"")}}function Ao(n){console.log("handle incoming: ",n),_s(n,!1)}function ss(n=Oo){Ge=new xt(bt(`${n.public.protocol}://${n.public.host}:${n.public.port}`,{path:n.sockethub.path})),Ge.socket.on("connect",Jt("connect")),Ge.socket.on("error",Jt("error")),Ge.socket.on("disconnect",Jt("disconnect")),Ge.socket.on("message",Ao)}typeof window=="object"&&(console.log("connecting to sockethub"),fetch("/config.json").then(async n=>{const e=await n.json();ss(e)}).catch(()=>{ss()}));export{Lo as I,Io as L,Ge as a,ko as c,Zt as e,vs as h,Qt as i,Do as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as v,t as y,s as _,a as g}from"./Dkd6l8cV.js";import{p as h,c as d,r as u,s as x,t as w,a as F}from"./B6g3iar1.js";import{r as I,s as l,a as k}from"./CLEQVYcW.js";import{b as C}from"./CN8LF06-.js";import{d as s}from"./CfqRDpBM.js";var j=y('<div class="w-full space-y-2"><label class="block text-sm font-semibold text-gray-700"> </label> <input></div>');function E(n,e){h(e,!0);let c=s(e,"type",3,"text"),f=s(e,"placeholder",3,""),o=s(e,"value",15),m=s(e,"class",3,"");var r=j(),a=d(r),p=d(a,!0);u(a);var t=x(a,2);I(t),t.__input=function(...b){var i;(i=e.onInput?()=>e.onInput(o()):void 0)==null||i.apply(this,b)},u(r),w(()=>{l(a,"for",e.id),_(p,e.label),l(t,"id",e.id),l(t,"type",c()),l(t,"placeholder",f()),k(t,1,`w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors duration-200 text-gray-900 placeholder-gray-500 ${m()??""}`)}),C(t,o),g(n,r),F()}v(["input"]);export{E as F};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{t as y,r as C,a as v,s as A,b as R}from"./Dkd6l8cV.js";import{p as w,t as S,a as h,b as k,e as W,f as q,c as b,r as u,s as f,g as r,d as z,n as E}from"./B6g3iar1.js";import{d as _,p as F,i as G,b as H,s as I}from"./CfqRDpBM.js";import{s as O,r as K}from"./CLEQVYcW.js";import{b as T,S as L}from"./CN8LF06-.js";import{a as M}from"./D3w1dc5i.js";var Q=y(`<textarea class="form-control block w-full px-3 py-1.5 text-base font-normal
|
|
2
|
+
text-gray-700 bg-white bg-clip-padding border border-solid
|
|
3
|
+
border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700
|
|
4
|
+
focus:bg-white focus:border-blue-600 focus:outline-none" rows="5"></textarea>`);function U(s,t){w(t,!0);let o=_(t,"data",15);var e=Q();C(e),S(()=>O(e,"id",`json-object-${t.title??""}`)),T(e,o),v(s,e),h()}var V=y('<div class="w-full p-2"><label for="server" class="inline-block text-gray-900 font-bold w-32">Password</label> <input id="server" type="password" class="border-4"></div>'),X=y('<div class="w-full"><label class="form-label inline-block text-gray-900 font-bold mb-2"> </label> <!></div> <!> <div class="w-full text-right"><!></div>',1);function Y(s,t){w(t,!0);let o=_(t,"buttonText",3,"Send"),e=_(t,"obj",15),a=W("unset");e().password&&(k(a,F(e().password)),e(e().password=void 0,!0));const m=z(()=>JSON.stringify(e(),null,3));async function g(){console.log("PASSWORD: ",r(a)),r(a)!=="unset"&&e(e().password=r(a),!0),t.submitData(JSON.stringify(e()))}var i=X(),x=q(i),c=b(x),D=b(c,!0);u(c);var J=f(c,2);U(J,{get title(){return t.title},get data(){return r(m)}}),u(x);var j=f(x,2);{var N=n=>{var d=V(),l=f(b(d),2);K(l),u(d),T(l,()=>r(a),B=>k(a,B)),v(n,d)};G(j,n=>{r(a)!=="unset"&&n(N)})}var p=f(j,2),P=b(p);L(P,{get disabled(){return t.disabled},buttonAction:g,children:(n,d)=>{E();var l=R();S(()=>A(l,o())),v(n,l)}}),u(p),S(()=>{O(c,"for",`json-object-${t.title??""}`),A(D,t.title)}),v(s,i),h()}function st(s,t){w(t,!0);const[o,e]=I(),a=()=>H(t.sockethubState,"$sockethubState",o);function m(g){const i=JSON.parse(g);console.log("creating activity object: ",i),M.ActivityStreams.Object.create(i),t.sockethubState.set({actorSet:!0,credentialsSet:!1,connected:!1,joined:!1})}Y(s,{title:"Activity Stream Actor",get obj(){return t.actor},buttonText:"Activity Object Create",submitData:m,get disabled(){return a().actorSet}}),h(),e()}export{st as A,Y as T};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var Jt=t=>{throw TypeError(t)};var Pe=(t,e,n)=>e.has(t)||Jt("Cannot "+n);var A=(t,e,n)=>(Pe(t,e,"read from private field"),n?n.call(t):e.get(t)),x=(t,e,n)=>e.has(t)?Jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{e as C,g as O,b as N,aj as Ce}from"./B6g3iar1.js";import{w as Ot,o as zt}from"./BoR-lgka.js";import{a as Oe,b as P}from"./B38kwwg4.js";new URL("sveltekit-internal://");function Ne(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function je(t){return t.split("%25").map(decodeURI).join("%25")}function $e(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function It({href:t}){return t.split("#")[0]}function De(t,e,n,a=!1){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return l=>(n(l),i[o](l));e();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];a&&s.push("hash");for(const i of s)Object.defineProperty(r,i,{get(){return e(),t[i]},enumerable:!0,configurable:!0});return r}function Fe(...t){let e=5381;for(const n of t)if(typeof n=="string"){let a=n.length;for(;a;)e=e*33^n.charCodeAt(--a)}else if(ArrayBuffer.isView(n)){const a=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let r=a.length;for(;r;)e=e*33^a[--r]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}function Ve(t){const e=atob(t),n=new Uint8Array(e.length);for(let a=0;a<e.length;a++)n[a]=e.charCodeAt(a);return n.buffer}const Be=window.fetch;window.fetch=(t,e)=>((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&W.delete(Nt(t)),Be(t,e));const W=new Map;function Me(t,e){const n=Nt(t,e),a=document.querySelector(n);if(a!=null&&a.textContent){let{body:r,...s}=JSON.parse(a.textContent);const i=a.getAttribute("data-ttl");return i&&W.set(n,{body:r,init:s,ttl:1e3*Number(i)}),a.getAttribute("data-b64")!==null&&(r=Ve(r)),Promise.resolve(new Response(r,s))}return window.fetch(t,e)}function qe(t,e,n){if(W.size>0){const a=Nt(t,n),r=W.get(a);if(r){if(performance.now()<r.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(r.body,r.init);W.delete(a)}}return window.fetch(e,n)}function Nt(t,e){let a=`script[data-sveltekit-fetched][data-url=${JSON.stringify(t instanceof Request?t.url:t)}]`;if(e!=null&&e.headers||e!=null&&e.body){const r=[];e.headers&&r.push([...new Headers(e.headers)].join(",")),e.body&&(typeof e.body=="string"||ArrayBuffer.isView(e.body))&&r.push(e.body),a+=`[data-hash="${Fe(...r)}"]`}return a}const Ge=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function He(t){const e=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${We(t).map(a=>{const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(a);if(r)return e.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(a);if(s)return e.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!a)return;const i=a.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return Ut(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return Ut(String.fromCharCode(...c.slice(2).split("-").map(p=>parseInt(p,16))));const d=Ge.exec(c),[,u,w,f,m]=d;return e.push({name:f,matcher:m,optional:!!u,rest:!!w,chained:w?l===1&&i[0]==="":!1}),w?"(.*?)":u?"([^/]*)?":"([^/]+?)"}return Ut(c)}).join("")}).join("")}/?$`),params:e}}function Ke(t){return!/^\([^)]+\)$/.test(t)}function We(t){return t.slice(1).split("/").filter(Ke)}function Ye(t,e,n){const a={},r=t.slice(1),s=r.filter(o=>o!==void 0);let i=0;for(let o=0;o<e.length;o+=1){const c=e[o];let l=r[o-i];if(c.chained&&c.rest&&i&&(l=r.slice(o-i,o+1).filter(d=>d).join("/"),i=0),l===void 0){c.rest&&(a[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){a[c.name]=l;const d=e[o+1],u=r[o+1];d&&!d.rest&&d.optional&&u&&c.chained&&(i=0),!d&&!u&&Object.keys(a).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return a}function Ut(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Je({nodes:t,server_loads:e,dictionary:n,matchers:a}){const r=new Set(e);return Object.entries(n).map(([o,[c,l,d]])=>{const{pattern:u,params:w}=He(o),f={id:o,exec:m=>{const p=u.exec(m);if(p)return Ye(p,w,a)},errors:[1,...d||[]].map(m=>t[m]),layouts:[0,...l||[]].map(i),leaf:s(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(o){const c=o<0;return c&&(o=~o),[c,t[o]]}function i(o){return o===void 0?o:[r.has(o),t[o]]}}function le(t,e=JSON.parse){try{return e(sessionStorage[t])}catch{}}function Xt(t,e,n=JSON.stringify){const a=n(e);try{sessionStorage[t]=a}catch{}}const ze="1768862543412",fe="sveltekit:snapshot",ue="sveltekit:scroll",he="sveltekit:states",Xe="sveltekit:pageurl",q="sveltekit:history",z="sveltekit:navigation",F={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ft=location.origin;function de(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function jt(){return{x:pageXOffset,y:pageYOffset}}function M(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const Zt={...F,"":F.hover};function pe(t){let e=t.assignedSlot??t.parentNode;return(e==null?void 0:e.nodeType)===11&&(e=e.host),e}function ge(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=pe(t)}}function xt(t,e,n){let a;try{if(a=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&a.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";a.hash=`#${o}${a.hash}`}}catch{}const r=t instanceof SVGAElement?t.target.baseVal:t.target,s=!a||!!r||bt(a,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(a==null?void 0:a.origin)===ft&&t.hasAttribute("download");return{url:a,external:s,target:r,download:i}}function dt(t){let e=null,n=null,a=null,r=null,s=null,i=null,o=t;for(;o&&o!==document.documentElement;)a===null&&(a=M(o,"preload-code")),r===null&&(r=M(o,"preload-data")),e===null&&(e=M(o,"keepfocus")),n===null&&(n=M(o,"noscroll")),s===null&&(s=M(o,"reload")),i===null&&(i=M(o,"replacestate")),o=pe(o);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Zt[a??"off"],preload_data:Zt[r??"off"],keepfocus:c(e),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Qt(t){const e=Ot(t);let n=!0;function a(){n=!0,e.update(i=>i)}function r(i){n=!1,e.set(i)}function s(i){let o;return e.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:a,set:r,subscribe:s}}const me={v:()=>{}};function Ze(){const{set:t,subscribe:e}=Ot(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${Oe}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const i=(await r.json()).version!==ze;return i&&(t(!0),me.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:e,check:a}}function bt(t,e,n){return t.origin!==ft||!t.pathname.startsWith(e)?!0:n?!(t.pathname===e+"/"||t.pathname===e+"/index.html"||t.protocol==="file:"&&t.pathname.replace(/\/[^/]+\.html?$/,"")===e):!1}function Fn(t){}function te(t){const e=tn(t),n=new ArrayBuffer(e.length),a=new DataView(n);for(let r=0;r<n.byteLength;r++)a.setUint8(r,e.charCodeAt(r));return n}const Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function tn(t){t.length%4===0&&(t=t.replace(/==?$/,""));let e="",n=0,a=0;for(let r=0;r<t.length;r++)n<<=6,n|=Qe.indexOf(t[r]),a+=6,a===24&&(e+=String.fromCharCode((n&16711680)>>16),e+=String.fromCharCode((n&65280)>>8),e+=String.fromCharCode(n&255),n=a=0);return a===12?(n>>=4,e+=String.fromCharCode(n)):a===18&&(n>>=2,e+=String.fromCharCode((n&65280)>>8),e+=String.fromCharCode(n&255)),e}const en=-1,nn=-2,rn=-3,an=-4,on=-5,sn=-6;function cn(t,e){if(typeof t=="number")return r(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const n=t,a=Array(n.length);function r(s,i=!1){if(s===en)return;if(s===rn)return NaN;if(s===an)return 1/0;if(s===on)return-1/0;if(s===sn)return-0;if(i)throw new Error("Invalid input");if(s in a)return a[s];const o=n[s];if(!o||typeof o!="object")a[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],l=e==null?void 0:e[c];if(l)return a[s]=l(r(o[1]));switch(c){case"Date":a[s]=new Date(o[1]);break;case"Set":const d=new Set;a[s]=d;for(let f=1;f<o.length;f+=1)d.add(r(o[f]));break;case"Map":const u=new Map;a[s]=u;for(let f=1;f<o.length;f+=2)u.set(r(o[f]),r(o[f+1]));break;case"RegExp":a[s]=new RegExp(o[1],o[2]);break;case"Object":a[s]=Object(o[1]);break;case"BigInt":a[s]=BigInt(o[1]);break;case"null":const w=Object.create(null);a[s]=w;for(let f=1;f<o.length;f+=2)w[o[f]]=r(o[f+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const f=globalThis[c],m=o[1],p=te(m),h=new f(p);a[s]=h;break}case"ArrayBuffer":{const f=o[1],m=te(f);a[s]=m;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(o.length);a[s]=c;for(let l=0;l<o.length;l+=1){const d=o[l];d!==nn&&(c[l]=r(d))}}else{const c={};a[s]=c;for(const l in o){const d=o[l];c[l]=r(d)}}return a[s]}return r(0)}const we=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...we];const ln=new Set([...we]);[...ln];function fn(t){return t.filter(e=>e!=null)}class At{constructor(e,n){this.status=e,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class $t{constructor(e,n){this.status=e,this.location=n}}class Dt extends Error{constructor(e,n,a){super(a),this.status=e,this.text=n}}const un="x-sveltekit-invalidated",hn="x-sveltekit-trailing-slash";function pt(t){return t instanceof At||t instanceof Dt?t.status:500}function dn(t){return t instanceof Dt?t.text:"Internal Error"}let U,X,Lt;const pn=zt.toString().includes("$$")||/function \w+\(\) \{\}/.test(zt.toString());var tt,et,nt,rt,at,ot,st,it,se,ct,ie,lt,ce;pn?(U={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},X={current:null},Lt={current:!1}):(U=new(se=class{constructor(){x(this,tt,C({}));x(this,et,C(null));x(this,nt,C(null));x(this,rt,C({}));x(this,at,C({id:null}));x(this,ot,C({}));x(this,st,C(-1));x(this,it,C(new URL("https://example.com")))}get data(){return O(A(this,tt))}set data(e){N(A(this,tt),e)}get form(){return O(A(this,et))}set form(e){N(A(this,et),e)}get error(){return O(A(this,nt))}set error(e){N(A(this,nt),e)}get params(){return O(A(this,rt))}set params(e){N(A(this,rt),e)}get route(){return O(A(this,at))}set route(e){N(A(this,at),e)}get state(){return O(A(this,ot))}set state(e){N(A(this,ot),e)}get status(){return O(A(this,st))}set status(e){N(A(this,st),e)}get url(){return O(A(this,it))}set url(e){N(A(this,it),e)}},tt=new WeakMap,et=new WeakMap,nt=new WeakMap,rt=new WeakMap,at=new WeakMap,ot=new WeakMap,st=new WeakMap,it=new WeakMap,se),X=new(ie=class{constructor(){x(this,ct,C(null))}get current(){return O(A(this,ct))}set current(e){N(A(this,ct),e)}},ct=new WeakMap,ie),Lt=new(ce=class{constructor(){x(this,lt,C(!1))}get current(){return O(A(this,lt))}set current(e){N(A(this,lt),e)}},lt=new WeakMap,ce),me.v=()=>Lt.current=!0);function gn(t){Object.assign(U,t)}const mn="/__data.json",wn=".html__data.json";function yn(t){return t.endsWith(".html")?t.replace(/\.html$/,wn):t.replace(/\/$/,"")+mn}const _n=new Set(["icon","shortcut icon","apple-touch-icon"]),B=le(ue)??{},Z=le(fe)??{},$={url:Qt({}),page:Qt({}),navigating:Ot(null),updated:Ze()};function Ft(t){B[t]=jt()}function vn(t,e){let n=t+1;for(;B[n];)delete B[n],n+=1;for(n=e+1;Z[n];)delete Z[n],n+=1}function H(t){return location.href=t.href,new Promise(()=>{})}async function ye(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(P||"/");t&&await t.update()}}function ee(){}let Vt,Pt,gt,j,Ct,S;const mt=[],wt=[];let L=null;const ut=new Map,_e=new Set,bn=new Set,Y=new Set;let v={branch:[],error:null,url:null},Bt=!1,yt=!1,ne=!0,Q=!1,K=!1,ve=!1,Mt=!1,be,k,T,V;const J=new Set;async function qn(t,e,n){var r,s,i,o;document.URL!==location.href&&(location.href=location.href),S=t,await((s=(r=t.hooks).init)==null?void 0:s.call(r)),Vt=Je(t),j=document.documentElement,Ct=e,Pt=t.nodes[0],gt=t.nodes[1],Pt(),gt(),k=(i=history.state)==null?void 0:i[q],T=(o=history.state)==null?void 0:o[z],k||(k=T=Date.now(),history.replaceState({...history.state,[q]:k,[z]:T},""));const a=B[k];a&&(history.scrollRestoration="manual",scrollTo(a.x,a.y)),n?await Pn(Ct,n):await Ln(S.hash?On(new URL(location.href)):location.href,{replaceState:!0}),xn()}function An(){mt.length=0,Mt=!1}function Ae(t){wt.some(e=>e==null?void 0:e.snapshot)&&(Z[t]=wt.map(e=>{var n;return(n=e==null?void 0:e.snapshot)==null?void 0:n.capture()}))}function Se(t){var e;(e=Z[t])==null||e.forEach((n,a)=>{var r,s;(s=(r=wt[a])==null?void 0:r.snapshot)==null||s.restore(n)})}function re(){Ft(k),Xt(ue,B),Ae(T),Xt(fe,Z)}async function qt(t,e,n,a){return ht({type:"goto",url:de(t),keepfocus:e.keepFocus,noscroll:e.noScroll,replace_state:e.replaceState,state:e.state,redirect_count:n,nav_token:a,accept:()=>{e.invalidateAll&&(Mt=!0),e.invalidate&&e.invalidate.forEach(Tn)}})}async function Sn(t){if(t.id!==(L==null?void 0:L.id)){const e={};J.add(e),L={id:t.id,token:e,promise:Re({...t,preload:e}).then(n=>(J.delete(e),n.type==="loaded"&&n.state.error&&(L=null),n))}}return L.promise}async function Tt(t){var n;const e=(n=await Et(t,!1))==null?void 0:n.route;e&&await Promise.all([...e.layouts,e.leaf].map(a=>a==null?void 0:a[1]()))}function Ee(t,e,n){var s;v=t.state;const a=document.querySelector("style[data-sveltekit]");a&&a.remove(),Object.assign(U,t.props.page),be=new S.root({target:e,props:{...t.props,stores:$,components:wt},hydrate:n,sync:!1}),Se(T);const r={from:null,to:{params:v.params,route:{id:((s=v.route)==null?void 0:s.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};Y.forEach(i=>i(r)),yt=!0}function _t({url:t,params:e,branch:n,status:a,error:r,route:s,form:i}){let o="never";if(P&&(t.pathname===P||t.pathname===P+"/"))o="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(o=f.slash);t.pathname=Ne(t.pathname,o),t.search=t.search;const c={type:"loaded",state:{url:t,params:e,branch:n,error:r,route:s},props:{constructors:fn(n).map(f=>f.node.component),page:Kt(U)}};i!==void 0&&(c.props.form=i);let l={},d=!U,u=0;for(let f=0;f<Math.max(n.length,v.branch.length);f+=1){const m=n[f],p=v.branch[f];(m==null?void 0:m.data)!==(p==null?void 0:p.data)&&(d=!0),m&&(l={...l,...m.data},d&&(c.props[`data_${u}`]=l),u+=1)}return(!v.url||t.href!==v.url.href||v.error!==r||i!==void 0&&i!==U.form||d)&&(c.props.page={error:r,params:e,route:{id:(s==null?void 0:s.id)??null},state:{},status:a,url:new URL(t),form:i??null,data:d?l:U.data}),c}async function Gt({loader:t,parent:e,url:n,params:a,route:r,server_data_node:s}){var d,u,w;let i=null,o=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await t();if((d=l.universal)!=null&&d.load){let f=function(...p){for(const h of p){const{href:_}=new URL(h,n);c.dependencies.add(_)}};const m={route:new Proxy(r,{get:(p,h)=>(o&&(c.route=!0),p[h])}),params:new Proxy(a,{get:(p,h)=>(o&&c.params.add(h),p[h])}),data:(s==null?void 0:s.data)??null,url:De(n,()=>{o&&(c.url=!0)},p=>{o&&c.search_params.add(p)},S.hash),async fetch(p,h){p instanceof Request&&(h={body:p.method==="GET"||p.method==="HEAD"?void 0:await p.blob(),cache:p.cache,credentials:p.credentials,headers:[...p.headers].length?p.headers:void 0,integrity:p.integrity,keepalive:p.keepalive,method:p.method,mode:p.mode,redirect:p.redirect,referrer:p.referrer,referrerPolicy:p.referrerPolicy,signal:p.signal,...h});const{resolved:_,promise:R}=ke(p,h,n);return o&&f(_.href),R},setHeaders:()=>{},depends:f,parent(){return o&&(c.parent=!0),e()},untrack(p){o=!1;try{return p()}finally{o=!0}}};i=await l.universal.load.call(null,m)??null}return{node:l,loader:t,server:s,universal:(u=l.universal)!=null&&u.load?{type:"data",data:i,uses:c}:null,data:i??(s==null?void 0:s.data)??null,slash:((w=l.universal)==null?void 0:w.trailingSlash)??(s==null?void 0:s.slash)}}function ke(t,e,n){let a=t instanceof Request?t.url:t;const r=new URL(a,n);r.origin===n.origin&&(a=r.href.slice(n.origin.length));const s=yt?qe(a,r.href,e):Me(a,e);return{resolved:r,promise:s}}function ae(t,e,n,a,r,s){if(Mt)return!0;if(!r)return!1;if(r.parent&&t||r.route&&e||r.url&&n)return!0;for(const i of r.search_params)if(a.has(i))return!0;for(const i of r.params)if(s[i]!==v.params[i])return!0;for(const i of r.dependencies)if(mt.some(o=>o(new URL(i))))return!0;return!1}function Ht(t,e){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?e??null:null}function En(t,e){if(!t)return new Set(e.searchParams.keys());const n=new Set([...t.searchParams.keys(),...e.searchParams.keys()]);for(const a of n){const r=t.searchParams.getAll(a),s=e.searchParams.getAll(a);r.every(i=>s.includes(i))&&s.every(i=>r.includes(i))&&n.delete(a)}return n}function oe({error:t,url:e,route:n,params:a}){return{type:"loaded",state:{error:t,url:e,route:n,params:a,branch:[]},props:{page:Kt(U),constructors:[]}}}async function Re({id:t,invalidating:e,url:n,params:a,route:r,preload:s}){if((L==null?void 0:L.id)===t)return J.delete(L.token),L.promise;const{errors:i,layouts:o,leaf:c}=r,l=[...o,c];i.forEach(g=>g==null?void 0:g().catch(()=>{})),l.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));let d=null;const u=v.url?t!==vt(v.url):!1,w=v.route?r.id!==v.route.id:!1,f=En(v.url,n);let m=!1;const p=l.map((g,y)=>{var D;const b=v.branch[y],E=!!(g!=null&&g[0])&&((b==null?void 0:b.loader)!==g[1]||ae(m,w,u,f,(D=b.server)==null?void 0:D.uses,a));return E&&(m=!0),E});if(p.some(Boolean)){try{d=await Le(n,p)}catch(g){const y=await G(g,{url:n,params:a,route:{id:t}});return J.has(s)?oe({error:y,url:n,params:a,route:r}):St({status:pt(g),error:y,url:n,route:r})}if(d.type==="redirect")return d}const h=d==null?void 0:d.nodes;let _=!1;const R=l.map(async(g,y)=>{var kt;if(!g)return;const b=v.branch[y],E=h==null?void 0:h[y];if((!E||E.type==="skip")&&g[1]===(b==null?void 0:b.loader)&&!ae(_,w,u,f,(kt=b.universal)==null?void 0:kt.uses,a))return b;if(_=!0,(E==null?void 0:E.type)==="error")throw E;return Gt({loader:g[1],url:n,params:a,route:r,parent:async()=>{var Yt;const Wt={};for(let Rt=0;Rt<y;Rt+=1)Object.assign(Wt,(Yt=await R[Rt])==null?void 0:Yt.data);return Wt},server_data_node:Ht(E===void 0&&g[0]?{type:"skip"}:E??null,g[0]?b==null?void 0:b.server:void 0)})});for(const g of R)g.catch(()=>{});const I=[];for(let g=0;g<l.length;g+=1)if(l[g])try{I.push(await R[g])}catch(y){if(y instanceof $t)return{type:"redirect",location:y.location};if(J.has(s))return oe({error:await G(y,{params:a,url:n,route:{id:r.id}}),url:n,params:a,route:r});let b=pt(y),E;if(h!=null&&h.includes(y))b=y.status??b,E=y.error;else if(y instanceof At)E=y.body;else{if(await $.updated.check())return await ye(),await H(n);E=await G(y,{params:a,url:n,route:{id:r.id}})}const D=await kn(g,I,i);return D?_t({url:n,params:a,branch:I.slice(0,D.idx).concat(D.node),status:b,error:E,route:r}):await Ue(n,{id:r.id},E,b)}else I.push(void 0);return _t({url:n,params:a,branch:I,status:200,error:null,route:r,form:e?void 0:null})}async function kn(t,e,n){for(;t--;)if(n[t]){let a=t;for(;!e[a];)a-=1;try{return{idx:a+1,node:{node:await n[t](),loader:n[t],data:{},server:null,universal:null}}}catch{continue}}}async function St({status:t,error:e,url:n,route:a}){const r={};let s=null;if(S.server_loads[0]===0)try{const o=await Le(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==ft||n.pathname!==location.pathname||Bt)&&await H(n)}try{const o=await Gt({loader:Pt,url:n,params:r,route:a,parent:()=>Promise.resolve({}),server_data_node:Ht(s)}),c={node:await gt(),loader:gt,universal:null,server:null,data:null};return _t({url:n,params:r,branch:[o,c],status:t,error:e,route:null})}catch(o){if(o instanceof $t)return qt(new URL(o.location,location.href),{},0);throw o}}async function Rn(t){const e=t.href;if(ut.has(e))return ut.get(e);let n;try{const a=(async()=>{let r=await S.hooks.reroute({url:new URL(t),fetch:async(s,i)=>ke(s,i,t).promise})??t;if(typeof r=="string"){const s=new URL(t);S.hash?s.hash=r:s.pathname=r,r=s}return r})();ut.set(e,a),n=await a}catch{ut.delete(e);return}return n}async function Et(t,e){if(t&&!bt(t,P,S.hash)){const n=await Rn(t);if(!n)return;const a=In(n);for(const r of Vt){const s=r.exec(a);if(s)return{id:vt(t),invalidating:e,route:r,params:$e(s),url:t}}}}function In(t){return je(S.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(P.length))||"/"}function vt(t){return(S.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Ie({url:t,type:e,intent:n,delta:a}){let r=!1;const s=xe(v,n,t,e);a!==void 0&&(s.navigation.delta=a);const i={...s.navigation,cancel:()=>{r=!0,s.reject(new Error("navigation cancelled"))}};return Q||_e.forEach(o=>o(i)),r?null:s}async function ht({type:t,url:e,popped:n,keepfocus:a,noscroll:r,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:l=ee,block:d=ee}){const u=V;V=c;const w=await Et(e,!1),f=Ie({url:e,type:t,delta:n==null?void 0:n.delta,intent:w});if(!f){d(),V===c&&(V=u);return}const m=k,p=T;l(),Q=!0,yt&&$.navigating.set(X.current=f.navigation);let h=w&&await Re(w);if(!h){if(bt(e,P,S.hash))return await H(e);h=await Ue(e,{id:null},await G(new Dt(404,"Not Found",`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(w==null?void 0:w.url)||e,V!==c)return f.reject(new Error("navigation aborted")),!1;if(h.type==="redirect")if(o>=20)h=await St({status:500,error:await G(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return await qt(new URL(h.location,e).href,{},o+1,c),!1;else h.props.page.status>=400&&await $.updated.check()&&(await ye(),await H(e));if(An(),Ft(m),Ae(p),h.props.page.url.pathname!==e.pathname&&(e.pathname=h.props.page.url.pathname),i=n?n.state:i,!n){const g=s?0:1,y={[q]:k+=g,[z]:T+=g,[he]:i};(s?history.replaceState:history.pushState).call(history,y,"",e),s||vn(k,T)}if(L=null,h.props.page.state=i,yt){v=h.state,h.props.page&&(h.props.page.url=e);const g=(await Promise.all(Array.from(bn,y=>y(f.navigation)))).filter(y=>typeof y=="function");if(g.length>0){let y=function(){g.forEach(b=>{Y.delete(b)})};g.push(y),g.forEach(b=>{Y.add(b)})}be.$set(h.props),gn(h.props.page),ve=!0}else Ee(h,Ct,!1);const{activeElement:_}=document;await Ce();const R=n?n.scroll:r?jt():null;if(ne){const g=e.hash&&document.getElementById(decodeURIComponent(S.hash?e.hash.split("#")[2]??"":e.hash.slice(1)));R?scrollTo(R.x,R.y):g?g.scrollIntoView():scrollTo(0,0)}const I=document.activeElement!==_&&document.activeElement!==document.body;!a&&!I&&Cn(),ne=!0,h.props.page&&Object.assign(U,h.props.page),Q=!1,t==="popstate"&&Se(T),f.fulfil(void 0),Y.forEach(g=>g(f.navigation)),$.navigating.set(X.current=null)}async function Ue(t,e,n,a){return t.origin===ft&&t.pathname===location.pathname&&!Bt?await St({status:a,error:n,url:t,route:e}):await H(t)}function Un(){let t,e,n;j.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(t),t=setTimeout(()=>{s(c,F.hover)},20)});function a(o){o.defaultPrevented||s(o.composedPath()[0],F.tap)}j.addEventListener("mousedown",a),j.addEventListener("touchstart",a,{passive:!0});const r=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(Tt(new URL(c.target.href)),r.unobserve(c.target))},{threshold:0});async function s(o,c){const l=ge(o,j),d=l===e&&c>=n;if(!l||d)return;const{url:u,external:w,download:f}=xt(l,P,S.hash);if(w||f)return;const m=dt(l),p=u&&vt(v.url)===vt(u);if(!(m.reload||p))if(c<=m.preload_data){e=l,n=F.tap;const h=await Et(u,!1);if(!h)return;Sn(h)}else c<=m.preload_code&&(e=l,n=c,Tt(u))}function i(){r.disconnect();for(const o of j.querySelectorAll("a")){const{url:c,external:l,download:d}=xt(o,P,S.hash);if(l||d)continue;const u=dt(o);u.reload||(u.preload_code===F.viewport&&r.observe(o),u.preload_code===F.eager&&Tt(c))}}Y.add(i),i()}function G(t,e){if(t instanceof At)return t.body;const n=pt(t),a=dn(t);return S.hooks.handleError({error:t,event:e,status:n,message:a})??{message:a}}function Ln(t,e={}){return t=new URL(de(t)),t.origin!==ft?Promise.reject(new Error("goto: invalid URL")):qt(t,e,0)}function Tn(t){if(typeof t=="function")mt.push(t);else{const{href:e}=new URL(t,location.href);mt.push(n=>n.href===e)}}function xn(){var e;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let a=!1;if(re(),!Q){const r=xe(v,void 0,null,"leave"),s={...r.navigation,cancel:()=>{a=!0,r.reject(new Error("navigation cancelled"))}};_e.forEach(i=>i(s))}a?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&re()}),(e=navigator.connection)!=null&&e.saveData||Un(),j.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const a=ge(n.composedPath()[0],j);if(!a)return;const{url:r,external:s,target:i,download:o}=xt(a,P,S.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=dt(a);if(!(a instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[d,u]=(S.hash?r.hash.replace(/^#/,""):r.href).split("#"),w=d===It(location);if(s||c.reload&&(!w||!u)){Ie({url:r,type:"link"})?Q=!0:n.preventDefault();return}if(u!==void 0&&w){const[,f]=v.url.href.split("#");if(f===u){if(n.preventDefault(),u===""||u==="top"&&a.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const m=a.ownerDocument.getElementById(decodeURIComponent(u));m&&(m.scrollIntoView(),m.focus())}return}if(K=!0,Ft(k),t(r),!c.replace_state)return;K=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await ht({type:"link",url:r,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??r.href===location.href})}),j.addEventListener("submit",n=>{if(n.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(n.target),r=n.submitter;if(((r==null?void 0:r.formTarget)||a.target)==="_blank"||((r==null?void 0:r.formMethod)||a.method)!=="get")return;const o=new URL((r==null?void 0:r.hasAttribute("formaction"))&&(r==null?void 0:r.formAction)||a.action);if(bt(o,P,!1))return;const c=n.target,l=dt(c);if(l.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(c),u=r==null?void 0:r.getAttribute("name");u&&d.append(u,(r==null?void 0:r.getAttribute("value"))??""),o.search=new URLSearchParams(d).toString(),ht({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href})}),addEventListener("popstate",async n=>{var a;if((a=n.state)!=null&&a[q]){const r=n.state[q];if(V={},r===k)return;const s=B[r],i=n.state[he]??{},o=new URL(n.state[Xe]??location.href),c=n.state[z],l=v.url?It(location)===It(v.url):!1;if(c===T&&(ve||l)){i!==U.state&&(U.state=i),t(o),B[k]=jt(),s&&scrollTo(s.x,s.y),k=r;return}const u=r-k;await ht({type:"popstate",url:o,popped:{state:i,scroll:s,delta:u},accept:()=>{k=r,T=c},block:()=>{history.go(-u)},nav_token:V})}else if(!K){const r=new URL(location.href);t(r),S.hash&&location.reload()}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[q]:++k,[z]:T},"",location.href))});for(const n of document.querySelectorAll("link"))_n.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&$.navigating.set(X.current=null)});function t(n){v.url=U.url=n,$.page.set(Kt(U)),$.page.notify()}}async function Pn(t,{status:e=200,error:n,node_ids:a,params:r,route:s,server_route:i,data:o,form:c}){Bt=!0;const l=new URL(location.href);let d;({params:r={},route:s={id:null}}=await Et(l,!1)||{}),d=Vt.find(({id:f})=>f===s.id);let u,w=!0;try{const f=a.map(async(p,h)=>{const _=o[h];return _!=null&&_.uses&&(_.uses=Te(_.uses)),Gt({loader:S.nodes[p],url:l,params:r,route:s,parent:async()=>{const R={};for(let I=0;I<h;I+=1)Object.assign(R,(await f[I]).data);return R},server_data_node:Ht(_)})}),m=await Promise.all(f);if(d){const p=d.layouts;for(let h=0;h<p.length;h++)p[h]||m.splice(h,0,void 0)}u=_t({url:l,params:r,branch:m,status:e,error:n,form:c,route:d??null})}catch(f){if(f instanceof $t){await H(new URL(f.location,location.href));return}u=await St({status:pt(f),error:await G(f,{url:l,params:r,route:s}),url:l,route:s}),t.textContent="",w=!1}u.props.page&&(u.props.page.state={}),Ee(u,t,w)}async function Le(t,e){var s;const n=new URL(t);n.pathname=yn(t.pathname),t.pathname.endsWith("/")&&n.searchParams.append(hn,"1"),n.searchParams.append(un,e.map(i=>i?"1":"0").join(""));const a=window.fetch,r=await a(n.href,{});if(!r.ok){let i;throw(s=r.headers.get("content-type"))!=null&&s.includes("application/json")?i=await r.json():r.status===404?i="Not Found":r.status===500&&(i="Internal Error"),new At(r.status,i)}return new Promise(async i=>{var w;const o=new Map,c=r.body.getReader(),l=new TextDecoder;function d(f){return cn(f,{...S.decoders,Promise:m=>new Promise((p,h)=>{o.set(m,{fulfil:p,reject:h})})})}let u="";for(;;){const{done:f,value:m}=await c.read();if(f&&!u)break;for(u+=!m&&u?`
|
|
2
|
+
`:l.decode(m,{stream:!0});;){const p=u.indexOf(`
|
|
3
|
+
`);if(p===-1)break;const h=JSON.parse(u.slice(0,p));if(u=u.slice(p+1),h.type==="redirect")return i(h);if(h.type==="data")(w=h.nodes)==null||w.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=Te(_.uses),_.data=d(_.data))}),i(h);else if(h.type==="chunk"){const{id:_,data:R,error:I}=h,g=o.get(_);o.delete(_),I?g.reject(d(I)):g.fulfil(d(R))}}}})}function Te(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function Cn(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const e=document.body,n=e.getAttribute("tabindex");e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),n!==null?e.setAttribute("tabindex",n):e.removeAttribute("tabindex");const a=getSelection();if(a&&a.type!=="None"){const r=[];for(let s=0;s<a.rangeCount;s+=1)r.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===r.length){for(let s=0;s<a.rangeCount;s+=1){const i=r[s],o=a.getRangeAt(s);if(i.commonAncestorContainer!==o.commonAncestorContainer||i.startContainer!==o.startContainer||i.endContainer!==o.endContainer||i.startOffset!==o.startOffset||i.endOffset!==o.endOffset)return}a.removeAllRanges()}})}}}function xe(t,e,n,a){var c,l;let r,s;const i=new Promise((d,u)=>{r=d,s=u});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:n&&{params:(e==null?void 0:e.params)??null,route:{id:((l=e==null?void 0:e.route)==null?void 0:l.id)??null},url:n},willUnload:!e,type:a,complete:i},fulfil:r,reject:s}}function Kt(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function On(t){const e=new URL(t);return e.hash=decodeURIComponent(t.hash),e}export{qn as a,Fn as l,U as p,$ as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as l,a as p,s as g}from"./Dkd6l8cV.js";import{c as t,q as x,r as a,s as h,t as f}from"./B6g3iar1.js";import{b as c}from"./CLEQVYcW.js";var u=l('<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8"><!></div>');function y(o,e){var r=u(),s=t(r);c(s,()=>e.children??x),a(r),p(o,r)}var _=l('<div class="bg-white shadow-sm border border-gray-200 rounded-xl overflow-hidden"><div class="bg-gradient-to-r from-blue-50 to-indigo-50 px-8 py-6 border-b border-gray-200"><h1 class="text-3xl font-bold text-gray-900 tracking-tight"> </h1></div> <div class="px-8 py-6"><!></div></div>');function q(o,e){y(o,{children:(r,s)=>{var i=_(),d=t(i),v=t(d),m=t(v,!0);a(v),a(d);var n=h(d,2),b=t(n);c(b,()=>e.children??x),a(n),a(i),f(()=>g(m,e.title)),p(r,i)}})}export{q as I};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ah as W,w as d,ak as b,al as B,am as A,an as S,ao as F,D as k,W as $,G as K,V as Q,ap as T,H as J,aq as X,K as j,ar as P,O as w,N as L,T as l,as as Z,at as ee,au as te,I as q,av as R,aw as O,ax as re,ay as ae,az as ne,aA as oe,aB as ie,Q as se,p as ue,h as le,a as ce}from"./B6g3iar1.js";function be(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const de=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Te(e){return de.includes(e)}const fe={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Le(e){return e=e.toLowerCase(),fe[e]??e}const _e=["touchstart","touchmove"];function pe(e){return _e.includes(e)}function ke(e,t){if(t){const r=document.body;e.autofocus=!0,W(()=>{document.activeElement===r&&e.focus()})}}function Ne(e){d&&b(e)!==null&&B(e)}let C=!1;function ve(){C||(C=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const r of e.target.elements)(t=r.__on_r)==null||t.call(r)})},{capture:!0}))}function x(e){var t=F,r=k;A(null),S(null);try{return e()}finally{A(t),S(r)}}function Ae(e,t,r,o=r){e.addEventListener(t,()=>x(r));const n=e.__on_r;n?e.__on_r=()=>{n(),o(!0)}:e.__on_r=()=>o(!0),ve()}const G=new Set,D=new Set;function he(e,t,r,o={}){function n(a){if(o.capture||E.call(t,a),!a.cancelBubble)return x(()=>r==null?void 0:r.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?W(()=>{t.addEventListener(e,n,o)}):t.addEventListener(e,n,o),n}function Se(e,t,r,o,n){var a={capture:o,passive:n},i=he(e,t,r,a);(t===document.body||t===window||t===document)&&Q(()=>{t.removeEventListener(e,i,a)})}function Ie(e){for(var t=0;t<e.length;t++)G.add(e[t]);for(var r of D)r(e)}function E(e){var V;var t=this,r=t.ownerDocument,o=e.type,n=((V=e.composedPath)==null?void 0:V.call(e))||[],a=n[0]||e.target,i=0,v=e.__root;if(v){var _=n.indexOf(v);if(_!==-1&&(t===document||t===window)){e.__root=t;return}var y=n.indexOf(t);if(y===-1)return;_<=y&&(i=_)}if(a=n[i]||e.target,a!==t){$(e,"currentTarget",{configurable:!0,get(){return a||r}});var I=F,f=k;A(null),S(null);try{for(var s,u=[];a!==null;){var p=a.assignedSlot||a.parentNode||a.host||null;try{var m=a["__"+o];if(m!=null&&(!a.disabled||e.target===a))if(K(m)){var[Y,...z]=m;Y.apply(a,[e,...z])}else m.call(a,e)}catch(N){s?u.push(N):s=N}if(e.cancelBubble||p===t||p===null)break;a=p}if(s){for(let N of u)queueMicrotask(()=>{throw N});throw s}}finally{e.__root=t,delete e.currentTarget,A(I),S(f)}}}let c;function me(){c=void 0}function Oe(e){let t=null,r=d;var o;if(d){for(t=l,c===void 0&&(c=b(document.head));c!==null&&(c.nodeType!==8||c.data!==j);)c=P(c);c===null?w(!1):c=L(P(c))}d||(o=document.head.appendChild(T()));try{J(()=>e(o),X)}finally{r&&(w(!0),c=l,L(t))}}function ye(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function h(e,t){var r=k;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function Pe(e,t){var r=(t&ee)!==0,o=(t&te)!==0,n,a=!e.startsWith("<!>");return()=>{if(d)return h(l,null),l;n===void 0&&(n=ye(a?e:"<!>"+e),r||(n=b(n)));var i=o||Z?document.importNode(n,!0):n.cloneNode(!0);if(r){var v=b(i),_=i.lastChild;h(v,_)}else h(i,i);return i}}function Re(e=""){if(!d){var t=T(e+"");return h(t,t),t}var r=l;return r.nodeType!==3&&(r.before(r=T()),L(r)),h(r,r),r}function De(){if(d)return h(l,null),l;var e=document.createDocumentFragment(),t=document.createComment(""),r=T();return e.append(t,r),h(t,r),e}function Me(e,t){if(d){k.nodes_end=l,q();return}e!==null&&e.before(t)}function Ve(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=r,e.nodeValue=r+"")}function ge(e,t){return U(e,t)}function Ce(e,t){R(),t.intro=t.intro??!1;const r=t.target,o=d,n=l;try{for(var a=b(r);a&&(a.nodeType!==8||a.data!==j);)a=P(a);if(!a)throw O;w(!0),L(a),q();const i=U(e,{...t,anchor:a});if(l===null||l.nodeType!==8||l.data!==re)throw ae(),O;return w(!1),i}catch(i){if(i===O)return t.recover===!1&&ne(),R(),B(r),w(!1),ge(e,t);throw i}finally{w(o),L(n),me()}}const g=new Map;function U(e,{target:t,anchor:r,props:o={},events:n,context:a,intro:i=!0}){R();var v=new Set,_=f=>{for(var s=0;s<f.length;s++){var u=f[s];if(!v.has(u)){v.add(u);var p=pe(u);t.addEventListener(u,E,{passive:p});var m=g.get(u);m===void 0?(document.addEventListener(u,E,{passive:p}),g.set(u,1)):g.set(u,m+1)}}};_(oe(G)),D.add(_);var y=void 0,I=ie(()=>{var f=r??t.appendChild(T());return se(()=>{if(a){ue({});var s=le;s.c=a}n&&(o.$$events=n),d&&h(f,null),y=e(f,o)||{},d&&(k.nodes_end=l),a&&ce()}),()=>{var p;for(var s of v){t.removeEventListener(s,E);var u=g.get(s);--u===0?(document.removeEventListener(s,E),g.delete(s)):g.set(s,u)}D.delete(_),f!==r&&((p=f.parentNode)==null||p.removeChild(f))}});return M.set(y,I),y}let M=new WeakMap;function He(e,t){const r=M.get(e);return r?(M.delete(e),r(t)):Promise.resolve()}const we="5";var H;typeof window<"u"&&((H=window.__svelte??(window.__svelte={})).v??(H.v=new Set)).add(we);export{Me as a,Re as b,De as c,Ie as d,Se as e,he as f,ke as g,ve as h,be as i,Te as j,Oe as k,Ae as l,Ce as m,Le as n,ge as o,h as p,ye as q,Ne as r,Ve as s,Pe as t,He as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.B3I8sqxJ.js","../chunks/Dkd6l8cV.js","../chunks/B6g3iar1.js","../chunks/D3w1dc5i.js","../chunks/CZFJHIMN.js","../chunks/BeYzO5Mt.js","../chunks/CfqRDpBM.js","../chunks/BoR-lgka.js","../chunks/CLEQVYcW.js","../assets/sockethub.CMYouZ3z.css","../chunks/B38kwwg4.js","../chunks/DPf-AoMq.js","../assets/0.BzjUWlsR.css","../nodes/1.T9u7GlsR.js","../nodes/2.C82p4PuU.js","../chunks/Dd_3LBWN.js","../nodes/3.BOQ3BB3w.js","../chunks/DOX7w-st.js","../chunks/CN8LF06-.js","../chunks/BRC80mQd.js","../chunks/DEHNjQUQ.js","../nodes/4.iuW-HqsR.js","../nodes/5.DyVFGAXq.js","../nodes/6.DJAHzi0b.js","../nodes/7.CLSdyL18.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var W=e=>{throw TypeError(e)};var Y=(e,t,r)=>t.has(e)||W("Cannot "+r);var f=(e,t,r)=>(Y(e,t,"read from private field"),r?r.call(e):t.get(e)),I=(e,t,r)=>t.has(e)?W("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),j=(e,t,r,i)=>(Y(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r);import{w as G,I as K,H as M,J as Z,Q as $,R as tt,T as et,ag as rt,x as st,u as at,ah as nt,S as ot,b as S,a0 as it,g,ai as ct,W as ut,X as lt,p as ft,i as dt,j as mt,e as p,aj as ht,f as w,s as _t,a as vt,c as gt,r as Et,d as C,t as yt}from"../chunks/B6g3iar1.js";import{m as Pt,o as Rt,u as bt,t as N,a as T,c as D,b as Ot,s as Tt}from"../chunks/Dkd6l8cV.js";import{d as V,p as kt,i as q}from"../chunks/CfqRDpBM.js";import{o as xt}from"../chunks/BoR-lgka.js";function B(e,t,r){G&&K();var i=e,n,o;M(()=>{n!==(n=t())&&(o&&(tt(o),o=null),n&&(o=$(()=>r(i,n))))},Z),G&&(i=et)}function H(e,t){return e===t||(e==null?void 0:e[ot])===t}function F(e={},t,r,i){return rt(()=>{var n,o;return st(()=>{n=o,o=[],at(()=>{e!==r(...o)&&(t(e,...o),n&&H(r(...n),e)&&t(null,...n))})}),()=>{nt(()=>{o&&H(r(...o),e)&&t(null,...o)})}}),e}function At(e){return class extends Lt{constructor(t){super({component:e,...t})}}}var E,d;class Lt{constructor(t){I(this,E);I(this,d);var o;var r=new Map,i=(a,s)=>{var u=lt(s);return r.set(a,u),u};const n=new Proxy({...t.props||{},$$events:{}},{get(a,s){return g(r.get(s)??i(s,Reflect.get(a,s)))},has(a,s){return s===it?!0:(g(r.get(s)??i(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,u){return S(r.get(s)??i(s,u),u),Reflect.set(a,s,u)}});j(this,d,(t.hydrate?Pt:Rt)(t.component,{target:t.target,anchor:t.anchor,props:n,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((o=t==null?void 0:t.props)!=null&&o.$$host)||t.sync===!1)&&ct(),j(this,E,n.$$events);for(const a of Object.keys(f(this,d)))a==="$set"||a==="$destroy"||a==="$on"||ut(this,a,{get(){return f(this,d)[a]},set(s){f(this,d)[a]=s},enumerable:!0});f(this,d).$set=a=>{Object.assign(n,a)},f(this,d).$destroy=()=>{bt(f(this,d))}}$set(t){f(this,d).$set(t)}$on(t,r){f(this,E)[t]=f(this,E)[t]||[];const i=(...n)=>r.call(this,...n);return f(this,E)[t].push(i),()=>{f(this,E)[t]=f(this,E)[t].filter(n=>n!==i)}}$destroy(){f(this,d).$destroy()}}E=new WeakMap,d=new WeakMap;const wt="modulepreload",St=function(e,t){return new URL(e,t).href},J={},y=function(t,r,i){let n=Promise.resolve();if(r&&r.length>0){let a=function(l){return Promise.all(l.map(_=>Promise.resolve(_).then(P=>({status:"fulfilled",value:P}),P=>({status:"rejected",reason:P}))))};const s=document.getElementsByTagName("link"),u=document.querySelector("meta[property=csp-nonce]"),k=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));n=a(r.map(l=>{if(l=St(l,i),l in J)return;J[l]=!0;const _=l.endsWith(".css"),P=_?'[rel="stylesheet"]':"";if(i)for(let R=s.length-1;R>=0;R--){const c=s[R];if(c.href===l&&(!_||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${P}`))return;const h=document.createElement("link");if(h.rel=_?"stylesheet":wt,_||(h.as="script"),h.crossOrigin="",h.href=l,k&&h.setAttribute("nonce",k),document.head.appendChild(h),_)return new Promise((R,c)=>{h.addEventListener("load",R),h.addEventListener("error",()=>c(Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return n.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})},Yt={};var It=N('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),jt=N("<!> <!>",1);function pt(e,t){ft(t,!0);let r=V(t,"components",23,()=>[]),i=V(t,"data_0",3,null),n=V(t,"data_1",3,null);dt(()=>t.stores.page.set(t.page)),mt(()=>{t.stores,t.page,t.constructors,r(),t.form,i(),n(),t.stores.page.notify()});let o=p(!1),a=p(!1),s=p(null);xt(()=>{const c=t.stores.page.subscribe(()=>{g(o)&&(S(a,!0),ht().then(()=>{S(s,kt(document.title||"untitled page"))}))});return S(o,!0),c});const u=C(()=>t.constructors[1]);var k=jt(),l=w(k);{var _=c=>{var v=D();const x=C(()=>t.constructors[0]);var A=w(v);B(A,()=>g(x),(b,O)=>{F(O(b,{get data(){return i()},get form(){return t.form},children:(m,Vt)=>{var U=D(),Q=w(U);B(Q,()=>g(u),(X,z)=>{F(z(X,{get data(){return n()},get form(){return t.form}}),L=>r()[1]=L,()=>{var L;return(L=r())==null?void 0:L[1]})}),T(m,U)},$$slots:{default:!0}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),T(c,v)},P=c=>{var v=D();const x=C(()=>t.constructors[0]);var A=w(v);B(A,()=>g(x),(b,O)=>{F(O(b,{get data(){return i()},get form(){return t.form}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),T(c,v)};q(l,c=>{t.constructors[1]?c(_):c(P,!1)})}var h=_t(l,2);{var R=c=>{var v=It(),x=gt(v);{var A=b=>{var O=Ot();yt(()=>Tt(O,g(s))),T(b,O)};q(x,b=>{g(a)&&b(A)})}Et(v),T(c,v)};q(h,c=>{g(o)&&c(R)})}T(e,k),vt()}const Gt=At(pt),Ht=[()=>y(()=>import("../nodes/0.B3I8sqxJ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url),()=>y(()=>import("../nodes/1.T9u7GlsR.js"),__vite__mapDeps([13,1,2,4,5,11,7,10]),import.meta.url),()=>y(()=>import("../nodes/2.C82p4PuU.js"),__vite__mapDeps([14,1,2,4,8,10,15]),import.meta.url),()=>y(()=>import("../nodes/3.BOQ3BB3w.js"),__vite__mapDeps([16,1,2,6,7,17,8,18,3,4,5,9,15,19,20]),import.meta.url),()=>y(()=>import("../nodes/4.iuW-HqsR.js"),__vite__mapDeps([21,1,2,6,7,17,8,18,3,4,5,9,15,20]),import.meta.url),()=>y(()=>import("../nodes/5.DyVFGAXq.js"),__vite__mapDeps([22,1,2,6,7,17,8,18,3,4,5,9,15,19]),import.meta.url),()=>y(()=>import("../nodes/6.DJAHzi0b.js"),__vite__mapDeps([23,1,2,6,7,17,8,18,3,4,5,9,15,20]),import.meta.url),()=>y(()=>import("../nodes/7.CLSdyL18.js"),__vite__mapDeps([24,1,2,6,7,3,4,5,8,9,18,15,20]),import.meta.url)],Jt=[],Nt={"/":[2],"/dummy":[7],"/feeds":[4],"/irc":[3],"/metadata":[6],"/xmpp":[5]},Ct={handleError:({error:e})=>{console.error(e)},reroute:()=>{},transport:{}},Dt=Object.fromEntries(Object.entries(Ct.transport).map(([e,t])=>[e,t.decode])),Qt=!1,Xt=(e,t)=>Dt[e](t);export{Xt as decode,Dt as decoders,Nt as dictionary,Qt as hash,Ct as hooks,Yt as matchers,Ht as nodes,Gt as root,Jt as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/DPf-AoMq.js";export{o as load_css,r as start};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{t as f,a as m,s as y,k as P,c as R}from"../chunks/Dkd6l8cV.js";import{t as S,c as t,n as M,r as e,s as p,p as W,a as z,_ as D,g as x,f as E,q as B}from"../chunks/B6g3iar1.js";import{c as F,e as H,i as N,h as V}from"../chunks/D3w1dc5i.js";import{a as w,s as k,b as X}from"../chunks/CLEQVYcW.js";import{b as C}from"../chunks/B38kwwg4.js";import"../chunks/CZFJHIMN.js";import{i as G,s as A,b as I}from"../chunks/CfqRDpBM.js";import{i as J}from"../chunks/BeYzO5Mt.js";import{s as K}from"../chunks/DPf-AoMq.js";const Q=!0,U=!1,be=Object.freeze(Object.defineProperty({__proto__:null,prerender:Q,ssr:U},Symbol.toStringTag,{value:"Module"})),Y=`<style>/*!
|
|
2
|
+
Theme: Edge Light
|
|
3
|
+
Author: cjayross (https://github.com/cjayross)
|
|
4
|
+
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
5
|
+
Maintainer: @highlightjs/core-team
|
|
6
|
+
Version: 2021.09.0
|
|
7
|
+
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#5e646f;background:#fafafa}.hljs::selection,
|
|
8
|
+
.hljs ::selection{background-color:#d69822;color:#5e646f}.hljs-comment{color:#5e646f}.hljs-tag{color:#6587bf}.hljs-subst,
|
|
9
|
+
.hljs-punctuation,
|
|
10
|
+
.hljs-operator{color:#5e646f}.hljs-operator{opacity:0.7}.hljs-bullet,
|
|
11
|
+
.hljs-variable,
|
|
12
|
+
.hljs-template-variable,
|
|
13
|
+
.hljs-selector-tag,
|
|
14
|
+
.hljs-name,
|
|
15
|
+
.hljs-deletion,.hljs-symbol,
|
|
16
|
+
.hljs-number,
|
|
17
|
+
.hljs-link,
|
|
18
|
+
.hljs-attr,
|
|
19
|
+
.hljs-variable.constant_,
|
|
20
|
+
.hljs-literal{color:#db7070}.hljs-title,
|
|
21
|
+
.hljs-class .hljs-title,
|
|
22
|
+
.hljs-title.class_,.hljs-strong{color:#d69822}.hljs-strong{font-weight:bold}.hljs-code,
|
|
23
|
+
.hljs-addition,
|
|
24
|
+
.hljs-title.class_.inherited__,
|
|
25
|
+
.hljs-string{color:#7c9f4b}.hljs-built_in,
|
|
26
|
+
.hljs-doctag,
|
|
27
|
+
.hljs-quote,
|
|
28
|
+
.hljs-keyword.hljs-atrule,
|
|
29
|
+
.hljs-regexp{color:#509c93}.hljs-function .hljs-title,
|
|
30
|
+
.hljs-attribute,
|
|
31
|
+
.ruby .hljs-property,
|
|
32
|
+
.hljs-title.function_,
|
|
33
|
+
.hljs-section{color:#6587bf}.hljs-type,
|
|
34
|
+
.hljs-template-tag,
|
|
35
|
+
.diff .hljs-meta,
|
|
36
|
+
.hljs-keyword,.hljs-emphasis{color:#b870ce}.hljs-emphasis{font-style:italic}.hljs-meta,
|
|
37
|
+
.hljs-meta .hljs-keyword,
|
|
38
|
+
.hljs-meta .hljs-string{color:#509c93}.hljs-meta .hljs-keyword,
|
|
39
|
+
.hljs-meta-keyword{font-weight:bold}</style>`;var Z=f('<p class="text-xs text-gray-500 text-center mt-2">Make sure Sockethub server is running</p>'),ee=f('<div class="bg-white border border-gray-200 rounded-lg p-4 shadow-sm"><div class="flex items-center justify-center space-x-3"><div class="flex items-center space-x-2"><div></div> <span class="text-sm font-medium text-gray-700">Sockethub Connection</span></div> <span> </span></div> <!></div>');function te(s){const[h,c]=A(),l=()=>I(F,"$connected",h);var n=ee(),d=t(n),a=t(d),g=t(a);M(2),e(a);var r=p(a,2),b=t(r,!0);e(r),e(d);var v=p(d,2);{var u=i=>{var o=Z();m(i,o)};G(v,i=>{l()||i(u)})}e(n),S(()=>{w(g,1,`w-3 h-3 rounded-full ${(l()?"bg-green-400 animate-pulse":"bg-gray-300")??""}`),w(r,1,`px-3 py-1 rounded-full text-xs font-bold uppercase tracking-wide ${(l()?"bg-green-100 text-green-800":"bg-gray-100 text-gray-600")??""}`),y(b,l()?"Connected":"Disconnected")}),m(s,n),c()}const se=()=>{const s=K;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},ae={subscribe(s){return se().page.subscribe(s)}};var re=f('<a><span class="text-sm"> </span> <span class="ml-1"> </span> <div class="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-gray-800 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10"> <div class="absolute top-full left-1/2 transform -translate-x-1/2 border-2 border-transparent border-t-gray-800"></div></div></a>'),oe=f('<nav class="flex justify-center flex-wrap gap-2 p-2"></nav>');function le(s,h){W(h,!1);const[c,l]=A(),n=()=>I(ae,"$page",c),d=[["🏠","Home","/","Start here to understand Sockethub"],["🔧","Dummy","/dummy","Basic examples • Start here"],["📰","Feeds","/feeds","RSS/ATOM feed parsing"],["🔍","Metadata","/metadata","Web page metadata extraction"],["💬","IRC","/irc","Internet Relay Chat • Advanced"],["📨","XMPP","/xmpp","Extensible messaging • Advanced"]];J();var a=oe();H(a,5,()=>d,N,(g,r)=>{let b=()=>x(r)[0],v=()=>x(r)[1],u=()=>x(r)[2],i=()=>x(r)[3];var o=re(),j=t(o),T=t(j,!0);e(j);var _=p(j,2),q=t(_,!0);e(_);var $=p(_,2),L=t($);M(),e($),e(o),S(O=>{w(o,1,`group relative rounded-lg px-3 py-2 font-medium transition-all duration-200 no-underline ${O??""}`),k(o,"href",`${C??""}${u()??""}`),k(o,"title",i()),y(T,b()),y(q,v()),y(L,`${i()??""} `)},[()=>n().url.pathname.endsWith(u())?"bg-orange-600 text-blue-50 shadow-md":"text-slate-700 hover:bg-slate-200 hover:shadow-sm"],D),m(g,o)}),e(a),m(s,a),z(),l()}var ne=f('<main><div><div><img class="m-auto" alt="Sockethub"></div> <div class="col-span-2 md:mt-3"><!></div> <div class="w-full text-center"><!></div></div> <div class="pt-5"><!></div></main>');function je(s,h){var c=ne();P(i=>{var o=R(),j=E(o);V(j,()=>Y),m(i,o)});var l=t(c),n=t(l),d=t(n);k(d,"src",`${C??""}/sockethub-logo.svg`),e(n);var a=p(n,2),g=t(a);le(g,{}),e(a);var r=p(a,2),b=t(r);te(b),e(r),e(l);var v=p(l,2),u=t(v);X(u,()=>h.children??B),e(v),e(c),m(s,c)}export{je as component,be as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as g,a as h,s}from"../chunks/Dkd6l8cV.js";import"../chunks/CZFJHIMN.js";import{p as l,f as v,t as d,a as x,c as o,r as p,s as _}from"../chunks/B6g3iar1.js";import{i as $}from"../chunks/BeYzO5Mt.js";import{s as k,p as i}from"../chunks/DPf-AoMq.js";const b={get error(){return i.error},get status(){return i.status}};k.updated.check;const m=b;var E=g("<h1> </h1> <p> </p>",1);function A(c,n){l(n,!1),$();var r=E(),t=v(r),f=o(t,!0);p(t);var a=_(t,2),u=o(a,!0);p(a),d(()=>{var e;s(f,m.status),s(u,(e=m.error)==null?void 0:e.message)}),h(c,r),x()}export{A as component};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{t as x,a as f}from"../chunks/Dkd6l8cV.js";import"../chunks/CZFJHIMN.js";import{s as e,f as y,c as t,r as s,n as w}from"../chunks/B6g3iar1.js";import{s as a}from"../chunks/CLEQVYcW.js";import{b as r}from"../chunks/B38kwwg4.js";import{I as S}from"../chunks/Dd_3LBWN.js";var k=x(`<title>Sockethub Examples</title> <div class="space-y-6"><div class="bg-blue-50 border-l-4 border-blue-400 p-4 rounded-r-lg"><h2 class="text-xl font-semibold text-blue-800 mb-2">What is Sockethub?</h2> <p class="text-blue-700 mb-3">Sockethub is a <strong>protocol gateway</strong> that bridges web applications with various internet protocols
|
|
2
|
+
like IRC, XMPP, RSS/ATOM feeds, and more. Instead of implementing each protocol directly in your web app,
|
|
3
|
+
you send standardized <strong>ActivityStreams</strong> messages to Sockethub, which handles the protocol-specific details.</p> <p class="text-blue-700">Think of it as a universal translator that lets your web application communicate with
|
|
4
|
+
chat servers, feed readers, and other internet services using a single, consistent API.</p></div> <div class="bg-green-50 border-l-4 border-green-400 p-4 rounded-r-lg"><h2 class="text-xl font-semibold text-green-800 mb-2">Key Concepts</h2> <div class="space-y-3"><div><h3 class="font-semibold text-green-700">🎭 Actor</h3> <p class="text-green-600 text-sm">Your identity on a platform (e.g., IRC nickname, XMPP username, feed URL)</p></div> <div><h3 class="font-semibold text-green-700">🔧 Platform</h3> <p class="text-green-600 text-sm">A protocol handler (IRC, XMPP, Feeds, etc.) that runs as a separate process</p></div> <div><h3 class="font-semibold text-green-700">📝 ActivityStreams</h3> <p class="text-green-600 text-sm">Standardized JSON format for describing activities like "send message", "connect", "fetch"</p></div> <div><h3 class="font-semibold text-green-700">🔐 Credentials</h3> <p class="text-green-600 text-sm">Connection details securely stored per session (servers, passwords, API keys)</p></div></div></div> <div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 rounded-r-lg"><h2 class="text-xl font-semibold text-yellow-800 mb-2">How It Works</h2> <ol class="text-yellow-700 space-y-2 text-sm"><li><span class="font-semibold">1.</span> Your web app connects to Sockethub via WebSocket</li> <li><span class="font-semibold">2.</span> You send ActivityStreams messages describing what you want to do</li> <li><span class="font-semibold">3.</span> Sockethub routes messages to the appropriate platform</li> <li><span class="font-semibold">4.</span> Platform handles protocol-specific communication</li> <li><span class="font-semibold">5.</span> Results are sent back to your web app as ActivityStreams</li></ol></div> <div class="bg-purple-50 border-l-4 border-purple-400 p-4 rounded-r-lg"><h2 class="text-xl font-semibold text-purple-800 mb-2">Explore the Examples</h2> <p class="text-purple-700 mb-3">Each example demonstrates a different platform. Start with <strong>Dummy</strong> to understand
|
|
5
|
+
the basic flow, then explore real-world protocols:</p> <div class="grid gap-3 text-sm"><a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors border-l-4 border-l-green-400"><div class="flex items-center justify-between"><div><div class="font-semibold text-purple-800">🔧 Dummy Platform</div> <div class="text-purple-600">Learn the basics with simple echo/fail examples</div></div> <span class="text-xs bg-green-100 text-green-700 px-2 py-1 rounded">Start Here</span></div></a> <div class="grid md:grid-cols-2 gap-3"><a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors"><div class="font-semibold text-purple-800">📰 RSS/ATOM Feeds</div> <div class="text-purple-600">Fetch and parse web feeds</div></a> <a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors"><div class="font-semibold text-purple-800">🔍 Metadata</div> <div class="text-purple-600">Extract metadata from web pages</div></a></div> <div class="grid md:grid-cols-2 gap-3"><a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors border-l-4 border-l-orange-400"><div class="flex items-center justify-between"><div><div class="font-semibold text-purple-800">💬 IRC Chat</div> <div class="text-purple-600">Connect to IRC servers and channels</div></div> <span class="text-xs bg-orange-100 text-orange-700 px-2 py-1 rounded">Advanced</span></div></a> <a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors border-l-4 border-l-orange-400"><div class="flex items-center justify-between"><div><div class="font-semibold text-purple-800">📨 XMPP Messaging</div> <div class="text-purple-600">Send and receive XMPP messages</div></div> <span class="text-xs bg-orange-100 text-orange-700 px-2 py-1 rounded">Advanced</span></div></a></div></div></div> <div class="text-center text-gray-600 text-sm bg-gray-50 p-4 rounded-lg">💡 <strong>Tip:</strong> Watch the connection status at the top and the activity log at the bottom of each example to understand what's happening behind the scenes.</div></div>`,1);function $(m){S(m,{title:"Sockethub Examples",children:(g,P)=>{var i=k(),l=e(y(i),2),d=e(t(l),6),n=e(t(d),4),p=t(n);a(p,"href",`${r??""}/dummy`);var o=e(p,2),c=t(o);a(c,"href",`${r??""}/feeds`);var h=e(c,2);a(h,"href",`${r??""}/metadata`),s(o);var b=e(o,2),v=t(b);a(v,"href",`${r??""}/irc`);var u=e(v,2);a(u,"href",`${r??""}/xmpp`),s(b),s(n),s(d),w(2),s(l),f(g,i)}})}export{$ as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as S,a as C}from"../chunks/Dkd6l8cV.js";import{p as te,a as re,s as e,f as se,c as n,g as o,d as q,r as d,b as l,e as y,u as a}from"../chunks/B6g3iar1.js";import{s as oe,a as ae,m as ne,b as z,p as N,i as de,c as v}from"../chunks/CfqRDpBM.js";import{A as ie}from"../chunks/DOX7w-st.js";import{A as ce,C as le,P as ve,R as me,S as ge}from"../chunks/BRC80mQd.js";import{B as pe}from"../chunks/CN8LF06-.js";import{F as Y}from"../chunks/DEHNjQUQ.js";import{I as ue,s as fe}from"../chunks/D3w1dc5i.js";import{w as D}from"../chunks/BoR-lgka.js";var be=S('<div class="bg-gradient-to-r from-emerald-50 to-green-50 border border-emerald-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-emerald-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-emerald-600 text-white rounded-full flex items-center justify-center text-sm font-bold">4</span> Join Channel and Chat</h4> <div class="space-y-6"><!> <!> <!></div></div>'),he=S('<div class="bg-gradient-to-r from-gray-50 to-slate-50 border border-gray-200 rounded-xl p-6 text-center shadow-sm"><div class="flex items-center justify-center mb-3"><span class="w-8 h-8 bg-gray-400 text-white rounded-full flex items-center justify-center text-sm font-bold">4</span></div> <p class="text-gray-600 font-medium">Connect to the IRC server to access chat features</p> <p class="text-gray-500 text-sm mt-1">Complete steps 1-3 above to unlock this section</p></div>'),xe=S('<div class="bg-orange-50 border-l-4 border-orange-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-orange-800 mb-2">💬 IRC Connection Process</h3> <p class="text-orange-700 text-sm mb-3">IRC (Internet Relay Chat) requires several steps to get connected and chatting.</p> <div class="text-orange-700 text-sm space-y-1"><div><strong>1. 🎭 Set Actor:</strong> Choose your IRC nickname</div> <div><strong>2. 🔐 Set Credentials:</strong> Provide server connection details</div> <div><strong>3. 🔌 Connect:</strong> Establish connection to IRC server</div> <div><strong>4. 🏠 Join Room:</strong> Enter a channel to start chatting</div> <div><strong>5. 💬 Send Messages:</strong> Chat with other users</div></div></div> <div class="space-y-6"><div class="bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-green-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold">1</span> Choose Your IRC Nickname</h4> <div class="space-y-4"><!> <!></div></div> <div class="bg-gradient-to-r from-blue-50 to-sky-50 border border-blue-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-blue-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-bold">2</span> Configure Server Connection</h4> <div class="space-y-4"><div class="grid md:grid-cols-2 gap-4"><!> <!></div> <div class="bg-blue-100 border border-blue-200 rounded-lg p-3"><p class="text-blue-800 text-sm">💡 <strong>Popular IRC networks:</strong> irc.libera.chat, irc.oftc.net, irc.rizon.net</p></div> <!></div></div> <div class="bg-gradient-to-r from-purple-50 to-violet-50 border border-purple-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-purple-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-purple-600 text-white rounded-full flex items-center justify-center text-sm font-bold">3</span> Connect to Server</h4> <!></div> <!></div>',1);function Pe(G,H){te(H,!0);const[w,K]=oe(),i=()=>z(I,"$actorIdStore",w),r=()=>z(s,"$sockethubState",w),I=D(`sh-${(Math.random()+1).toString(36).substring(7)}`);let p=y("chat.freenode.net"),u=y(6697),R="#sh-random",m=y(!1);const s=D({actorSet:!1,credentialsSet:!1,connected:!1,joined:!1});let g=q(()=>({id:i(),type:"person",name:i()})),L=q(()=>({type:"credentials",nick:i(),server:o(p),port:o(u),secure:!0}));function k(){v(s,a(r).actorSet=!1,a(r)),v(s,a(r).credentialsSet=!1,a(r)),v(s,a(r).connected=!1,a(r)),v(s,a(r).joined=!1,a(r)),l(m,!1)}async function O(){l(m,!0),await fe({context:"irc",type:"connect",actor:i()}).catch(()=>{k()}).then(()=>{v(s,a(r).connected=!0,a(r)),l(m,!1)},f=>{console.error(f),k()})}pe(G,{title:"IRC Platform Example",description:"Connect to IRC servers, join channels, and send messages using Sockethub's IRC platform.",children:(f,_e)=>{var j=xe(),$=e(se(j),2),b=n($),P=e(n(b),2),A=n(P);ce(A,{get value(){return ne(),i()},set value(t){ae(I,t)}});var Q=e(A,2);ie(Q,{get actor(){return o(g)},sockethubState:s}),d(P),d(b);var h=e(b,2),E=e(n(h),2),x=n(E),F=n(x);Y(F,{label:"IRC Server",id:"server",placeholder:"irc.libera.chat",get value(){return o(p)},set value(t){l(p,N(t))}});var T=e(F,2);Y(T,{label:"Port",id:"port",type:"number",placeholder:"6697",get value(){return o(u)},set value(t){l(u,N(t))}}),d(x);var U=e(x,4);le(U,{context:"irc",get credentials(){return o(L)},get actor(){return o(g)},sockethubState:s}),d(E),d(h);var _=e(h,2),V=e(n(_),2);ve(V,{sockethubState:s,get connecting(){return o(m)},onConnect:O}),d(_);var W=e(_,2);{var X=t=>{var c=be(),M=e(n(c),2),B=n(M);me(B,{get actor(){return o(g)},sockethubState:s,room:R,context:"irc"});var J=e(B,2);ue(J,{});var ee=e(J,2);ge(ee,{context:"irc",get actor(){return o(g)},sockethubState:s,room:R}),d(M),d(c),C(t,c)},Z=t=>{var c=he();C(t,c)};de(W,t=>{r().connected?t(X):t(Z,!1)})}d($),C(f,j)}}),re(),K()}export{Pe as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as S,b as w,a as p}from"../chunks/Dkd6l8cV.js";import{p as A,a as F,s as o,f as k,c as f,b as R,e as T,g as e,d as _,n as O,r as m}from"../chunks/B6g3iar1.js";import{p as L}from"../chunks/CfqRDpBM.js";import{w as P}from"../chunks/BoR-lgka.js";import{A as U}from"../chunks/DOX7w-st.js";import{B as $,S as M}from"../chunks/CN8LF06-.js";import{F as j}from"../chunks/DEHNjQUQ.js";import{s as B}from"../chunks/D3w1dc5i.js";var E=S('<div class="bg-green-50 border-l-4 border-green-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-green-800 mb-2">📰 How Feed Processing Works</h3> <p class="text-green-700 text-sm mb-3">This example shows how Sockethub can fetch and parse RSS/ATOM feeds from any website.</p> <div class="text-green-700 text-sm space-y-1"><div><strong>🌐 Fetching:</strong> Sockethub downloads the feed content from the URL</div> <div><strong>🔍 Parsing:</strong> Content is parsed from RSS/ATOM format</div> <div><strong>📝 Converting:</strong> Each feed entry becomes an ActivityStreams object</div> <div><strong>📊 Results:</strong> You receive an array of structured feed entries</div></div></div> <div class="space-y-4"><!> <p class="text-gray-600 text-sm">⬆️ Try different RSS/ATOM feeds: news sites, blogs, podcasts, etc.</p> <!> <div class="bg-blue-50 border border-blue-200 p-3 rounded-lg"><p class="text-blue-700 text-sm"><strong>💡 What happens when you click Fetch:</strong><br> The feed URL becomes the "actor" (like a website identity), and Sockethub sends a "fetch" activity to download and parse the feed content.</p></div> <div class="w-full text-right"><!></div></div>',1);function K(h,v){A(v,!0);const g=P({actorSet:!1});let t=T("https://sockethub.org/feed.xml");const a=_(()=>({type:"website",id:e(t)}));function b(s){return{context:"feeds",type:s,actor:e(a)}}async function u(){B(b("fetch"))}$(h,{title:"Feeds Platform Example",description:"The feeds platform takes an RSS/ATOM feed URL, fetches and parses it, and returns an array of Activity Objects for each entry.",children:(s,C)=>{var n=E(),d=o(k(n),2),i=f(d);j(i,{label:"Feed URL",id:"URL",placeholder:"https://example.com/feed.xml",get value(){return e(t)},set value(r){R(t,L(r))}});var c=o(i,4);U(c,{get actor(){return e(a)},sockethubState:g});var l=o(c,4),x=f(l);M(x,{buttonAction:u,children:(r,W)=>{O();var y=w("Fetch Feed");p(r,y)}}),m(l),m(d),p(s,n)}}),F()}export{K as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as P,a as f}from"../chunks/Dkd6l8cV.js";import{p as L,a as N,s as r,f as O,c as n,g as o,d as x,r as c,n as Q,e as T,b as E,u as s}from"../chunks/B6g3iar1.js";import{s as V,a as W,m as Z,b as I,i as ee,c as d}from"../chunks/CfqRDpBM.js";import{A as te}from"../chunks/DOX7w-st.js";import{A as re,C as se,P as oe,R as ae,S as ne}from"../chunks/BRC80mQd.js";import{B as ce}from"../chunks/CN8LF06-.js";import{I as ie,s as de}from"../chunks/D3w1dc5i.js";import{w as j}from"../chunks/BoR-lgka.js";var le=P('<div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 4 & 5: Join Room and Chat</h4> <div class="space-y-4"><!> <!> <!></div></div>'),me=P('<div class="bg-gray-50 border border-gray-200 rounded-lg p-4 text-center"><p class="text-gray-500">Connect to the XMPP server to access chat features</p></div>'),ge=P('<div class="bg-indigo-50 border-l-4 border-indigo-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-indigo-800 mb-2">📨 XMPP Connection Process</h3> <p class="text-indigo-700 text-sm mb-3">XMPP (Extensible Messaging and Presence Protocol) is a real-time communication protocol used by services like Jabber.</p> <div class="text-indigo-700 text-sm space-y-1"><div><strong>1. 🎭 Set Actor:</strong> Your XMPP address (e.g., user@jabber.org)</div> <div><strong>2. 🔐 Set Credentials:</strong> Your XMPP login and password</div> <div><strong>3. 🔌 Connect:</strong> Establish connection to XMPP server</div> <div><strong>4. 🏠 Join Room:</strong> Enter a multi-user chat room</div> <div><strong>5. 💬 Send Messages:</strong> Chat with other users in real-time</div></div></div> <div class="space-y-6"><div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 1: Set Your XMPP Address</h4> <!> <p class="text-gray-600 text-sm mt-2">💡 Format: username@server.com (e.g., user@jabber.org, alice@conversations.im)</p> <!></div> <div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 2: Set Your Credentials</h4> <!> <p class="text-gray-600 text-sm mt-2">🔐 Use your actual XMPP account credentials to connect</p></div> <div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 3: Connect to XMPP Server</h4> <!></div> <!></div>',1);function _e(J,R){L(R,!0);const[S,Y]=V(),m=()=>I(_,"$actorIdStore",S),e=()=>I(t,"$sockethubState",S),_=j("user@jabber.org");let g=T(!1),v=x(()=>`${m()}/SockethubExample`);const y="kosmos-random@kosmos.chat",t=j({actorSet:!1,credentialsSet:!1,connected:!1,joined:!1});let l=x(()=>({id:o(v),type:"person",name:o(v)})),B=x(()=>({type:"credentials",userAddress:m(),password:"123456",resource:"SockethubExample"}));function M(){d(t,s(e).actorSet=!1,s(e)),d(t,s(e).credentialsSet=!1,s(e)),d(t,s(e).connected=!1,s(e)),d(t,s(e).joined=!1,s(e)),E(g,!1)}async function F(){return E(g,!0),await de({context:"xmpp",type:"connect",actor:o(v)}).then(()=>{d(t,s(e).connected=!0,s(e))},p=>{console.error(p),M()}).catch(()=>{M()})}ce(J,{title:"XMPP Platform Example",description:"Connect to XMPP servers (Jabber), join multi-user chats, and exchange messages using Sockethub's XMPP platform.",children:(p,ve)=>{var C=ge(),X=r(O(C),2),u=n(X),k=r(n(u),2);re(k,{get value(){return Z(),m()},set value(a){W(_,a)}});var U=r(k,4);te(U,{get actor(){return o(l)},sockethubState:t}),c(u);var b=r(u,2),q=r(n(b),2);se(q,{context:"xmpp",get credentials(){return o(B)},get actor(){return o(l)},sockethubState:t}),Q(2),c(b);var h=r(b,2),z=r(n(h),2);oe(z,{sockethubState:t,get connecting(){return o(g)},onConnect:F}),c(h);var D=r(h,2);{var G=a=>{var i=le(),w=r(n(i),2),$=n(w);ae($,{get actor(){return o(l)},sockethubState:t,room:y,context:"xmpp"});var A=r($,2);ie(A,{});var K=r(A,2);ne(K,{context:"xmpp",get actor(){return o(l)},sockethubState:t,room:y}),c(w),c(i),f(a,i)},H=a=>{var i=me();f(a,i)};ee(D,a=>{e().connected?a(G):a(H,!1)})}c(X),f(p,C)}}),N(),Y()}export{_e as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as y,b as S,a as l}from"../chunks/Dkd6l8cV.js";import{p as k,a as _,s as r,f as F,c as m,b as A,e as E,g as t,d as L,n as P,r as u}from"../chunks/B6g3iar1.js";import{p as R}from"../chunks/CfqRDpBM.js";import{w as $}from"../chunks/BoR-lgka.js";import{A as T}from"../chunks/DOX7w-st.js";import{B as U,S as B}from"../chunks/CN8LF06-.js";import{F as M}from"../chunks/DEHNjQUQ.js";import{s as O}from"../chunks/D3w1dc5i.js";var W=y('<div class="bg-purple-50 border-l-4 border-purple-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-purple-800 mb-2">🔍 How Metadata Extraction Works</h3> <p class="text-purple-700 text-sm mb-3">This example shows how Sockethub can extract structured metadata from any web page.</p> <div class="text-purple-700 text-sm space-y-1"><div><strong>🌐 Fetching:</strong> Sockethub downloads the web page content</div> <div><strong>🔍 Scanning:</strong> Searches for Open Graph, Twitter Cards, JSON-LD, and meta tags</div> <div><strong>📊 Extracting:</strong> Pulls out titles, descriptions, images, and other metadata</div> <div><strong>📋 Returning:</strong> Provides structured data about the page</div></div></div> <div class="space-y-4"><!> <p class="text-gray-600 text-sm">⬆️ Try different websites: news articles, social media posts, product pages, etc.</p> <!> <div class="bg-blue-50 border border-blue-200 p-3 rounded-lg"><p class="text-blue-700 text-sm"><strong>💡 What happens when you click Fetch:</strong><br> The website URL becomes the "actor", and Sockethub sends a "fetch" activity to download the page and extract all available metadata like page titles, descriptions, and social media preview data.</p></div> <div class="w-full text-right"><!></div></div>',1);function K(g,h){k(h,!0);const b=$({actorSet:!1});let e=E("https://sockethub.org"),o=L(()=>({id:t(e),type:"website"}));function v(a){return{context:"metadata",type:a,actor:t(o)}}async function f(){O(v("fetch"))}U(g,{title:"Metadata Platform Example",description:"Sockethub's metadata platform takes a URL, fetches and parses it for any metadata.",children:(a,j)=>{var i=W(),d=r(F(i),2),n=m(d);M(n,{label:"Website URL",id:"URL",placeholder:"https://example.com",get value(){return t(e)},set value(s){A(e,R(s))}});var c=r(n,4);T(c,{get actor(){return t(o)},sockethubState:b});var p=r(c,4),x=m(p);B(x,{buttonAction:f,children:(s,C)=>{P();var w=S("Extract Metadata");l(s,w)}}),u(p),u(d),l(a,i)}}),_()}export{K as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as L,b as o,a as r}from"../chunks/Dkd6l8cV.js";import{p as M,a as O,s,f as W,c as e,b as z,e as J,g as E,n as l,r as t}from"../chunks/B6g3iar1.js";import{p as K}from"../chunks/CfqRDpBM.js";import{s as n}from"../chunks/D3w1dc5i.js";import{B as N,S as c}from"../chunks/CN8LF06-.js";import{F as Q}from"../chunks/DEHNjQUQ.js";var U=L(`<div class="bg-gradient-to-r from-blue-50 to-blue-100 border border-blue-200 rounded-xl p-6 shadow-sm"><h3 class="text-xl font-bold text-blue-900 mb-3 flex items-center"><span class="mr-2">💡</span> What You'll Learn</h3> <p class="text-blue-800 mb-4 leading-relaxed">This example demonstrates the core Sockethub workflow with a test platform that doesn't require external connections.</p> <div class="grid md:grid-cols-2 gap-3 text-blue-800"><div class="flex items-start space-x-2"><span class="text-lg">📤</span> <div><div class="font-semibold">Sending</div> <div class="text-sm text-blue-700">How to create and send ActivityStreams messages</div></div></div> <div class="flex items-start space-x-2"><span class="text-lg">📥</span> <div><div class="font-semibold">Receiving</div> <div class="text-sm text-blue-700">How Sockethub responds with results or errors</div></div></div> <div class="flex items-start space-x-2"><span class="text-lg">🎯</span> <div><div class="font-semibold">Actor</div> <div class="text-sm text-blue-700">How your identity is represented</div></div></div> <div class="flex items-start space-x-2"><span class="text-lg">🔄</span> <div><div class="font-semibold">Types</div> <div class="text-sm text-blue-700">Different activity types (echo, greet, fail, throw)</div></div></div></div></div> <div class="space-y-4"><!> <p class="text-gray-600 text-sm">⬆️ This text will be included in the <code>object.content</code> field of your ActivityStreams message.</p> <div class="bg-gradient-to-r from-amber-50 to-yellow-50 border border-amber-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-amber-900 mb-3 flex items-center"><span class="mr-2">🚀</span> Try Different Activity Types</h4> <p class="text-amber-800 mb-4 leading-relaxed">Each button sends the same basic message structure but with a different <code class="bg-amber-100 px-1 rounded text-sm">type</code> field:</p> <div class="grid md:grid-cols-2 gap-4"><div class="space-y-4"><div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Echo</div> <p class="text-amber-700 text-sm">Returns your message back unchanged</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Greet</div> <p class="text-amber-700 text-sm">Returns a friendly greeting</p></div> <!></div></div></div> <div class="space-y-4"><div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Fail</div> <p class="text-amber-700 text-sm">Returns an error message (for testing error handling)</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Throw</div> <p class="text-amber-700 text-sm">Throws an exception (for testing exception handling)</p></div> <!></div></div></div></div></div></div>`,1);function ie(F,P){M(P,!0);const H="https://sockethub.org/examples/dummy";let v=J("");function d(m){return{context:"dummy",type:m,actor:{type:"person",id:H},object:{type:"message",content:E(v)}}}async function R(){n(d("echo"))}async function B(){n(d("fail"))}async function D(){n(d("throw"))}async function G(){n(d("greet"))}N(F,{title:"Dummy Platform Example",description:"The dummy platform is the most basic test to communicate via Sockethub to a platform, and receive a response back. You can use either the echo or fail types on your Activity Stream object.",children:(m,V)=>{var f=U(),h=s(W(f),2),g=e(h);Q(g,{label:"Message Content",id:"objectContent",placeholder:"Hello from Sockethub",get value(){return E(v)},set value(a){z(v,K(a))}});var y=s(g,4),w=s(e(y),4),b=e(w),p=e(b),_=e(p),C=s(e(_),2);c(C,{buttonAction:R,children:(a,u)=>{l();var i=o("Echo");r(a,i)}}),t(_),t(p);var S=s(p,2),$=e(S),Y=s(e($),2);c(Y,{buttonAction:G,children:(a,u)=>{l();var i=o("Greet");r(a,i)}}),t($),t(S),t(b);var A=s(b,2),x=e(A),T=e(x),q=s(e(T),2);c(q,{buttonAction:B,children:(a,u)=>{l();var i=o("Fail");r(a,i)}}),t(T),t(x);var j=s(x,2),k=e(j),I=s(e(k),2);c(I,{buttonAction:D,children:(a,u)=>{l();var i=o("Throw");r(a,i)}}),t(k),t(j),t(A),t(w),t(y),t(h),r(m,f)}}),O()}export{ie as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"1768862543412"}
|