@sockethub/examples 1.0.0-beta.0 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/build/_app/immutable/assets/0.DiwDnc-u.css +1 -0
  2. package/build/_app/immutable/chunks/BDxEtWDn.js +1 -0
  3. package/build/_app/immutable/chunks/{1CEAjNji.js → BFJazgM-.js} +1 -1
  4. package/build/_app/immutable/chunks/BKtlB-ZE.js +37 -0
  5. package/build/_app/immutable/chunks/BRcKhWZZ.js +1 -0
  6. package/build/_app/immutable/chunks/{OZH1Z0a6.js → BymJmDWJ.js} +1 -1
  7. package/build/_app/immutable/chunks/{CdjPbSmN.js → C7zmhnYM.js} +1 -1
  8. package/build/_app/immutable/chunks/{CQSki_LV.js → CH5OY5MF.js} +1 -1
  9. package/build/_app/immutable/chunks/CbO4bo1j.js +1 -0
  10. package/build/_app/immutable/chunks/CgjHsrhs.js +2 -0
  11. package/build/_app/immutable/chunks/{Fuku2EMA.js → Cko76dBZ.js} +1 -1
  12. package/build/_app/immutable/chunks/{BgSSi_nq.js → D5R3T3gW.js} +1 -1
  13. package/build/_app/immutable/chunks/{DmF1jPXz.js → FpM_-oX5.js} +1 -1
  14. package/build/_app/immutable/chunks/wMyiGnQa.js +1 -0
  15. package/build/_app/immutable/entry/{app.B5l5H9Jr.js → app.C88mAu2e.js} +2 -2
  16. package/build/_app/immutable/entry/start.B1PB6bga.js +1 -0
  17. package/build/_app/immutable/nodes/{0.CsTQ1Eeu.js → 0.BwQUhEGu.js} +2 -2
  18. package/build/_app/immutable/nodes/{1.C0f2sebm.js → 1.C-zkRZjk.js} +1 -1
  19. package/build/_app/immutable/nodes/{2.UFZ_HUkg.js → 2.8bzWQILm.js} +1 -1
  20. package/build/_app/immutable/nodes/{5.BHW8yhED.js → 3.DrGIkVu0.js} +1 -1
  21. package/build/_app/immutable/nodes/{8.DYw6a0EN.js → 4.Clpm2HdH.js} +1 -1
  22. package/build/_app/immutable/nodes/5.D6ttn0N8.js +1 -0
  23. package/build/_app/immutable/nodes/{4.2xkip1qG.js → 6.CkpDg7i6.js} +1 -1
  24. package/build/_app/immutable/nodes/{9.DyF8lTV5.js → 7.DrKGjs0l.js} +1 -1
  25. package/build/_app/immutable/nodes/{7.isUySRo5.js → 8.2NG23_e4.js} +1 -1
  26. package/build/_app/immutable/nodes/9.D7zgVgYt.js +2 -0
  27. package/build/_app/version.json +1 -1
  28. package/build/caldav.html +10 -10
  29. package/build/carddav.html +10 -10
  30. package/build/dummy.html +10 -10
  31. package/build/feeds.html +10 -10
  32. package/build/index.html +10 -10
  33. package/build/irc.html +10 -10
  34. package/build/metadata.html +10 -10
  35. package/build/xmpp.html +10 -10
  36. package/package.json +4 -4
  37. package/build/_app/immutable/assets/0.D81t2HYN.css +0 -1
  38. package/build/_app/immutable/chunks/C8dk2-j7.js +0 -1
  39. package/build/_app/immutable/chunks/ChAAmblw.js +0 -1
  40. package/build/_app/immutable/chunks/D6O50hAO.js +0 -1
  41. package/build/_app/immutable/chunks/DQqZ5wJX.js +0 -37
  42. package/build/_app/immutable/chunks/YlCvXWJE.js +0 -2
  43. package/build/_app/immutable/chunks/mJhlxSRc.js +0 -1
  44. package/build/_app/immutable/entry/start.DvXUWyvA.js +0 -1
  45. package/build/_app/immutable/nodes/3.QCGY1WED.js +0 -1
  46. package/build/_app/immutable/nodes/6.BM3C0ZGx.js +0 -1
@@ -1,2 +0,0 @@
1
- var Ie=Object.defineProperty;var pe=t=>{throw TypeError(t)};var Le=(t,e,r)=>e in t?Ie(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ee=(t,e,r)=>Le(t,typeof e!="symbol"?e+"":e,r),te=(t,e,r)=>e.has(t)||pe("Cannot "+r);var s=(t,e,r)=>(te(t,e,"read from private field"),r?r.call(t):e.get(t)),f=(t,e,r)=>e.has(t)?pe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),a=(t,e,r,n)=>(te(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),p=(t,e,r)=>(te(t,e,"access private method"),r);import{am as Me,g as we,a2 as Ne,E as Fe,e as Pe,an as ge,I as de,O as v,D as E,a1 as P,R as Ce,S as Re,ao as he,V as Ve,N as I,ap as z,L as re,M as U,aq as Be,a8 as J,ar as B,as as ve,at as Ye,au as ie,k as Se,P as xe,av as me,aw as We,ax as ye,ay as He,az as Ue,K as se,X as j,n as je,W as qe,aA as Ee,aB as Ge,T as ze,aC as Ke,aD as Xe,aE as $e,Z as Je,aF as Qe,aG as ne,aH as Ze,aI as et,aJ as tt,aK as rt,aL as st,aM as ae,aN as it,aO as nt,aP as oe,Y as K,aQ as at,aR as ot,aS as ut,aT as lt,p as ft,aU as ct,aV as dt,a as ht}from"./OZH1Z0a6.js";function _t(t){let e=0,r=Ne(0),n;return()=>{Me()&&(we(r),Fe(()=>(e===0&&(n=Pe(()=>t(()=>ge(r)))),e+=1,()=>{de(()=>{e-=1,e===0&&(n==null||n(),n=void 0,ge(r))})})))}}var pt=ze|Ke|Xe;function gt(t,e,r){new vt(t,e,r)}var g,q,b,L,T,y,h,w,S,k,M,A,F,Y,x,D,Q,l,Ae,ke,ue,X,$,le;class vt{constructor(e,r,n){f(this,l);ee(this,"parent");ee(this,"is_pending",!1);f(this,g);f(this,q,E?v:null);f(this,b);f(this,L);f(this,T);f(this,y,null);f(this,h,null);f(this,w,null);f(this,S,null);f(this,k,null);f(this,M,0);f(this,A,0);f(this,F,!1);f(this,Y,new Set);f(this,x,new Set);f(this,D,null);f(this,Q,_t(()=>(a(this,D,Ne(s(this,M))),()=>{a(this,D,null)})));a(this,g,e),a(this,b,r),a(this,L,n),this.parent=P.b,this.is_pending=!!s(this,b).pending,a(this,T,Ce(()=>{if(P.b=this,E){const i=s(this,q);Re(),i.nodeType===he&&i.data===Ve?p(this,l,ke).call(this):(p(this,l,Ae).call(this),s(this,A)===0&&(this.is_pending=!1))}else{var o=p(this,l,ue).call(this);try{a(this,y,I(()=>n(o)))}catch(i){this.error(i)}s(this,A)>0?p(this,l,$).call(this):this.is_pending=!1}return()=>{var i;(i=s(this,k))==null||i.remove()}},pt)),E&&a(this,g,v)}defer_effect(e){Be(e,s(this,Y),s(this,x))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!s(this,b).pending}update_pending_count(e){p(this,l,le).call(this,e),a(this,M,s(this,M)+e),s(this,D)&&Ue(s(this,D),s(this,M))}get_effect_pending(){return s(this,Q).call(this),we(s(this,D))}error(e){var r=s(this,b).onerror;let n=s(this,b).failed;if(s(this,F)||!r&&!n)throw e;s(this,y)&&(se(s(this,y)),a(this,y,null)),s(this,h)&&(se(s(this,h)),a(this,h,null)),s(this,w)&&(se(s(this,w)),a(this,w,null)),E&&(j(s(this,q)),je(),j(qe()));var o=!1,i=!1;const u=()=>{if(o){$e();return}o=!0,i&&Ge(),z.ensure(),a(this,M,0),s(this,w)!==null&&re(s(this,w),()=>{a(this,w,null)}),this.is_pending=this.has_pending_snippet(),a(this,y,p(this,l,X).call(this,()=>(a(this,F,!1),I(()=>s(this,L).call(this,s(this,g)))))),s(this,A)>0?p(this,l,$).call(this):this.is_pending=!1};var m=ie;try{B(null),i=!0,r==null||r(e,u),i=!1}catch(_){Ee(_,s(this,T)&&s(this,T).parent)}finally{B(m)}n&&de(()=>{a(this,w,p(this,l,X).call(this,()=>{z.ensure(),a(this,F,!0);try{return I(()=>{n(s(this,g),()=>e,()=>u)})}catch(_){return Ee(_,s(this,T).parent),null}finally{a(this,F,!1)}}))})}}g=new WeakMap,q=new WeakMap,b=new WeakMap,L=new WeakMap,T=new WeakMap,y=new WeakMap,h=new WeakMap,w=new WeakMap,S=new WeakMap,k=new WeakMap,M=new WeakMap,A=new WeakMap,F=new WeakMap,Y=new WeakMap,x=new WeakMap,D=new WeakMap,Q=new WeakMap,l=new WeakSet,Ae=function(){try{a(this,y,I(()=>s(this,L).call(this,s(this,g))))}catch(e){this.error(e)}},ke=function(){const e=s(this,b).pending;e&&(a(this,h,I(()=>e(s(this,g)))),z.enqueue(()=>{var r=p(this,l,ue).call(this);a(this,y,p(this,l,X).call(this,()=>(z.ensure(),I(()=>s(this,L).call(this,r))))),s(this,A)>0?p(this,l,$).call(this):(re(s(this,h),()=>{a(this,h,null)}),this.is_pending=!1)}))},ue=function(){var e=s(this,g);return this.is_pending&&(a(this,k,U()),s(this,g).before(s(this,k)),e=s(this,k)),e},X=function(e){var r=P,n=ie,o=Se;J(s(this,T)),B(s(this,T)),ve(s(this,T).ctx);try{return e()}catch(i){return Ye(i),null}finally{J(r),B(n),ve(o)}},$=function(){const e=s(this,b).pending;s(this,y)!==null&&(a(this,S,document.createDocumentFragment()),s(this,S).append(s(this,k)),xe(s(this,y),s(this,S))),s(this,h)===null&&a(this,h,I(()=>e(s(this,g))))},le=function(e){var r;if(!this.has_pending_snippet()){this.parent&&p(r=this.parent,l,le).call(r,e);return}if(a(this,A,s(this,A)+e),s(this,A)===0){this.is_pending=!1;for(const n of s(this,Y))me(n,We),ye(n);for(const n of s(this,x))me(n,He),ye(n);s(this,Y).clear(),s(this,x).clear(),s(this,h)&&re(s(this,h),()=>{a(this,h,null)}),s(this,S)&&(s(this,g).before(s(this,S)),a(this,S,null))}};function At(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const mt=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function kt(t){return mt.includes(t)}const yt={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 Dt(t){return t=t.toLowerCase(),yt[t]??t}const Et=["touchstart","touchmove"];function bt(t){return Et.includes(t)}const De=new Set,fe=new Set;function Ot(t,e,r,n={}){function o(i){if(n.capture||H.call(e,i),!i.cancelBubble)return Qe(()=>r==null?void 0:r.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?de(()=>{e.addEventListener(t,o,n)}):e.addEventListener(t,o,n),o}function It(t){for(var e=0;e<t.length;e++)De.add(t[e]);for(var r of fe)r(t)}let be=null;function H(t){var _e;var e=this,r=e.ownerDocument,n=t.type,o=((_e=t.composedPath)==null?void 0:_e.call(t))||[],i=o[0]||t.target;be=t;var u=0,m=be===t&&t.__root;if(m){var _=o.indexOf(m);if(_!==-1&&(e===document||e===window)){t.__root=e;return}var C=o.indexOf(e);if(C===-1)return;_<=C&&(u=_)}if(i=o[u]||t.target,i!==e){Je(t,"currentTarget",{configurable:!0,get(){return i||r}});var Z=ie,N=P;B(null),J(null);try{for(var c,d=[];i!==null;){var R=i.assignedSlot||i.parentNode||i.host||null;try{var W=i["__"+n];W!=null&&(!i.disabled||t.target===i)&&W.call(i,t)}catch(G){c?d.push(G):c=G}if(t.cancelBubble||R===e||R===null)break;i=R}if(c){for(let G of d)queueMicrotask(()=>{throw G});throw c}}finally{t.__root=e,delete t.currentTarget,B(Z),J(N)}}}function Tt(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function O(t,e){var r=P;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function Lt(t,e){var r=(e&et)!==0,n=(e&tt)!==0,o,i=!t.startsWith("<!>");return()=>{if(E)return O(v,null),v;o===void 0&&(o=Tt(i?t:"<!>"+t),r||(o=ne(o)));var u=n||Ze?document.importNode(o,!0):o.cloneNode(!0);if(r){var m=ne(u),_=u.lastChild;O(m,_)}else O(u,u);return u}}function Mt(t=""){if(!E){var e=U(t+"");return O(e,e),e}var r=v;return r.nodeType!==st&&(r.before(r=U()),j(r)),O(r,r),r}function Ft(){if(E)return O(v,null),v;var t=document.createDocumentFragment(),e=document.createComment(""),r=U();return t.append(e,r),O(e,r),t}function Pt(t,e){if(E){var r=P;((r.f&rt)===0||r.nodes.end===null)&&(r.nodes.end=v),Re();return}t!==null&&t.before(e)}function Ct(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=r,t.nodeValue=r+"")}function wt(t,e){return Oe(t,e)}function Vt(t,e){ae(),e.intro=e.intro??!1;const r=e.target,n=E,o=v;try{for(var i=ne(r);i&&(i.nodeType!==he||i.data!==it);)i=nt(i);if(!i)throw oe;K(!0),j(i);const u=Oe(t,{...e,anchor:i});return K(!1),u}catch(u){if(u instanceof Error&&u.message.split(`
2
- `).some(m=>m.startsWith("https://svelte.dev/e/")))throw u;return u!==oe&&console.warn("Failed to hydrate: ",u),e.recover===!1&&at(),ae(),ot(r),K(!1),wt(t,e)}finally{K(n),j(o)}}const V=new Map;function Oe(t,{target:e,anchor:r,props:n={},events:o,context:i,intro:u=!0}){ae();var m=new Set,_=N=>{for(var c=0;c<N.length;c++){var d=N[c];if(!m.has(d)){m.add(d);var R=bt(d);e.addEventListener(d,H,{passive:R});var W=V.get(d);W===void 0?(document.addEventListener(d,H,{passive:R}),V.set(d,1)):V.set(d,W+1)}}};_(ut(De)),fe.add(_);var C=void 0,Z=lt(()=>{var N=r??e.appendChild(U());return gt(N,{pending:()=>{}},c=>{if(i){ft({});var d=Se;d.c=i}if(o&&(n.$$events=o),E&&O(c,null),C=t(c,n)||{},E&&(P.nodes.end=v,v===null||v.nodeType!==he||v.data!==ct))throw dt(),oe;i&&ht()}),()=>{var R;for(var c of m){e.removeEventListener(c,H);var d=V.get(c);--d===0?(document.removeEventListener(c,H),V.delete(c)):V.set(c,d)}fe.delete(_),N!==r&&((R=N.parentNode)==null||R.removeChild(N))}});return ce.set(C,Z),C}let ce=new WeakMap;function Bt(t,e){const r=ce.get(t);return r?(ce.delete(t),r(e)):Promise.resolve()}const Nt="5";var Te;typeof window<"u"&&((Te=window.__svelte??(window.__svelte={})).v??(Te.v=new Set)).add(Nt);export{Pt as a,O as b,Ft as c,It as d,Tt as e,Lt as f,Ot as g,Vt as h,At as i,kt as j,wt as m,Dt as n,Ct as s,Mt as t,Bt as u};
@@ -1 +0,0 @@
1
- import{f as l,a as p,s as h}from"./YlCvXWJE.js";import{c as t,j as m,r as a,s as g,t as b}from"./OZH1Z0a6.js";import{m as x}from"./DQqZ5wJX.js";var u=l('<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8"><!></div>');function y(e,o){var r=u(),s=t(r);x(s,()=>o.children??m),a(r),p(e,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 k(e,o){y(e,{children:(r,s)=>{var i=_(),d=t(i),v=t(d),c=t(v,!0);a(v),a(d);var n=g(d,2),f=t(n);x(f,()=>o.children??m),a(n),a(i),b(()=>h(c,o.title)),p(r,i)}})}export{k as I};
@@ -1 +0,0 @@
1
- import{l as o,a as r}from"../chunks/CdjPbSmN.js";export{o as load_css,r as start};
@@ -1 +0,0 @@
1
- import{f as _,a as l,t as F}from"../chunks/YlCvXWJE.js";import{p as L,a as R,s,f as A,c as u,b as E,d as P,g as t,w as U,u as h,r as m,n as B}from"../chunks/OZH1Z0a6.js";import{s as M,a as O}from"../chunks/DmF1jPXz.js";import{A as T}from"../chunks/1CEAjNji.js";import{B as W,S as j}from"../chunks/Fuku2EMA.js";import{F as C}from"../chunks/D6O50hAO.js";import{s as D,a as G,c as H}from"../chunks/DQqZ5wJX.js";var J=_('<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">The page URL is the actor <code>id</code> with <code>type: "website"</code>.</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/> Sockethub sends a <code>fetch</code> activity with the page URL as the actor and returns extracted metadata.</p></div> <div class="w-full text-right"><!></div></div>',1);function Z(g,b){L(b,!0);const v=()=>O(r,"$sockethubState",x),[x,f]=M(),r=U({actorSet:!1});let e=P("https://sockethub.org");const o=h(()=>({id:t(e),type:"website",name:t(e)}));async function w(){await D({"@context":await H("metadata"),type:"fetch",actor:G(t(o))})}W(g,{title:"Metadata Platform Example",description:"Sockethub's metadata platform takes a URL, fetches and parses it for any metadata.",children:(S,N)=>{var c=J(),d=s(A(c),2),i=u(d);C(i,{label:"Website URL",id:"URL",placeholder:"https://example.com",get value(){return t(e)},set value(a){E(e,a,!0)}});var n=s(i,4);T(n,{get actor(){return t(o)},get sockethubState(){return r}});var p=s(n,4),k=u(p);{let a=h(()=>!v().actorSet);j(k,{buttonAction:w,get disabled(){return t(a)},children:(y,q)=>{B();var $=F("Extract Metadata");l(y,$)}})}m(p),m(d),l(S,c)}}),R(),f()}export{Z as component};
@@ -1 +0,0 @@
1
- import{f as m,t as j,s as p,a as u}from"../chunks/YlCvXWJE.js";import{p as ft,d,h as Re,a as gt,f as ae,s as n,c as i,b as a,g as e,n as I,t as f,u as U,r as o}from"../chunks/OZH1Z0a6.js";import{i as x}from"../chunks/DmF1jPXz.js";import{r as fe,e as Oe,b as mt,d as _t,c as re,f as bt,s as ge}from"../chunks/DQqZ5wJX.js";import{B as yt,S as le,a as Le,c as xt}from"../chunks/Fuku2EMA.js";import{F as S}from"../chunks/D6O50hAO.js";var ht=m('<div class="rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800" role="alert"> </div>'),wt=m('<div class="rounded-lg border border-green-200 bg-green-50 p-4 text-sm text-green-800" role="status"> </div>'),St=m("<option> </option>"),$t=m('<label for="caldav-calendar" class="block text-sm font-semibold text-gray-700">Calendar</label> <select id="caldav-calendar" class="w-full rounded-lg border border-gray-300 bg-white px-4 py-3"></select>',1),Ct=m("<!> <!>",1),kt=m('<div class="rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800" role="alert"> </div>'),Et=m('<div class="rounded-lg border border-green-200 bg-green-50 p-4 text-sm text-green-800" role="status"> </div>'),It=m('<div class="rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800" role="alert"> </div>'),Tt=m('<li class="flex flex-col gap-1 px-4 py-3 text-sm"><span class="font-medium text-gray-900"> </span> <span class="text-gray-600"> <!> <!></span></li>'),At=m('<h3 class="text-sm font-semibold text-gray-700"> </h3> <ul class="divide-y divide-gray-200 rounded-lg border border-gray-200 bg-white"></ul>',1),Dt=m('<section class="space-y-4"><h2 class="text-xl font-semibold text-gray-900">1. Set credentials</h2> <p class="text-sm text-gray-600">Use an app password when your calendar provider supports one. Credentials stay in this Sockethub session.</p> <!> <!> <!> <!> <div class="flex justify-end"><!></div> <!> <!></section> <section class="space-y-4 border-t border-gray-200 pt-6"><h2 class="text-xl font-semibold text-gray-900">2. Choose a calendar</h2> <div class="flex justify-end"><!></div> <!></section> <section class="space-y-4 border-t border-gray-200 pt-6"><h2 class="text-xl font-semibold text-gray-900">3. Add an item</h2> <div class="flex gap-6"><label class="flex items-center gap-2"><input type="radio"/> Event</label> <label class="flex items-center gap-2"><input type="radio"/> To-do</label></div> <!> <!> <div class="flex justify-end"><!></div></section> <!> <!> <section class="space-y-4 border-t border-gray-200 pt-6"><h2 class="text-xl font-semibold text-gray-900">Read a published iCalendar feed</h2> <p class="text-sm text-gray-600">Public .ics and webcal:// links need no credentials. Sockethub fetches the feed and lists its items.</p> <!> <label class="flex items-center gap-2 text-sm text-gray-700"><input type="checkbox"/> Upcoming items only</label> <div class="flex justify-end"><!></div> <!> <!></section>',1);function Ot(Ve,Ne){ft(Ne,!0);const me=[];let B=d("caldav:alice"),K=d(""),M=d(""),Q=d(""),T=d(!1),$=d(Re([])),R=d(""),_=d("event"),A=d(""),O=d(""),L=d(""),V=d(""),b=d(!1),D=d(null),F=d(null),N=d(null),W=d(null),X=d(""),ne=d(!0),_e=d(""),q=d(Re([])),Y=d(!1),Z=d(null);const k=U(()=>e($).find(l=>l.id===e(R))),We=U(()=>{var l;return((l=e(k))==null?void 0:l.components.includes(e(_)))??!1});function ee(){return{id:e(B),type:"person"}}function te(){e(T)&&(a(T,!1),a($,[],!0),a(R,""),a(N,null),a(W,null))}async function qe(){a(N,null),a(W,null),a(b,!0);try{await _t();const l={"@context":await re("caldav"),type:"credentials",actor:ee(),object:{type:"credentials",url:e(K),username:e(M),password:e(Q)}};await new Promise((v,h)=>{bt.socket.emit("credentials",l,C=>{if(C!=null&&C.error){h(new Error(C.error));return}v()})}),a(T,!0),a(W,"Credentials set for this Sockethub session.")}catch(l){a(N,l instanceof Error?l.message:String(l),!0)}finally{a(b,!1)}}async function ze(){var l;a(D,null),a(F,null),a(b,!0);try{const v=await ge({"@context":await re("caldav"),type:"fetch",actor:ee()});a($,(v.items??[]).filter(h=>h.type==="calendar"&&typeof h.id=="string"&&typeof h.name=="string"&&Array.isArray(h.components)),!0),a(R,((l=e($)[0])==null?void 0:l.id)??"",!0),a(F,`Found ${e($).length} calendar${e($).length===1?"":"s"}.`)}catch(v){a(D,v instanceof Error?v.message:String(v),!0)}finally{a(b,!1)}}async function Ge(){a(Z,null),a(Y,!0);try{const l=await ge({"@context":await re("caldav"),type:"read",actor:ee(),target:{id:e(X),type:"feed"},...e(ne)?{object:{startTime:new Date().toISOString()}}:{}});a(_e,typeof l.summary=="string"?l.summary:"",!0),a(q,(l.items??[]).filter(v=>(v.type==="event"||v.type==="task")&&typeof v.name=="string"),!0)}catch(l){a(q,[],!0),a(Z,l instanceof Error?l.message:String(l),!0)}finally{a(Y,!1)}}function be(l){const v=l.startTime??l.due;return v?l.allDay||!v.includes("T")?v:new Date(v).toLocaleString():""}async function He(){if(e(k)){a(D,null),a(F,null),a(b,!0);try{const l=e(_)==="event"?{type:"event",name:e(A),startTime:new Date(e(O)).toISOString(),...e(L)?{endTime:new Date(e(L)).toISOString()}:{}}:{type:"task",name:e(A),...e(V)?{due:new Date(e(V)).toISOString()}:{}};await ge({"@context":await re("caldav"),type:"create",actor:ee(),target:{id:e(k).id,type:"calendar"},object:l}),a(F,`${e(_)==="event"?"Event":"To-do"} created.`),a(A,""),a(O,""),a(L,""),a(V,"")}catch(l){a(D,l instanceof Error?l.message:String(l),!0)}finally{a(b,!1)}}}yt(Ve,{title:"CalDAV Platform Example",description:"Discover the calendars in a CalDAV account and add an event or to-do, or list the events in a published .ics feed.",children:(l,v)=>{var h=Dt(),C=ae(h),ye=n(i(C),4);S(ye,{label:"Actor ID",id:"caldav-actor",placeholder:"caldav:alice",onInput:te,get value(){return e(B)},set value(t){a(B,t,!0)}});var xe=n(ye,2);S(xe,{label:"CalDAV URL",id:"caldav-url",type:"url",placeholder:"https://calendar.example/dav/",onInput:te,get value(){return e(K)},set value(t){a(K,t,!0)}});var he=n(xe,2);S(he,{label:"Username",id:"caldav-username",onInput:te,get value(){return e(M)},set value(t){a(M,t,!0)}});var we=n(he,2);S(we,{label:"Password",id:"caldav-password",type:"password",onInput:te,get value(){return e(Q)},set value(t){a(Q,t,!0)}});var se=n(we,2),Je=i(se);{let t=U(()=>e(T)||e(b)||!e(B)||!e(K)||!e(M)||!e(Q));le(Je,{buttonAction:qe,get disabled(){return e(t)},children:(r,s)=>{I();var c=j();f(()=>p(c,e(T)?"Credentials Set":e(b)?"Setting Credentials…":"Set Credentials")),u(r,c)}})}o(se);var Se=n(se,2);{var Ke=t=>{var r=ht(),s=i(r,!0);o(r),f(()=>p(s,e(N))),u(t,r)};x(Se,t=>{e(N)&&t(Ke)})}var Me=n(Se,2);{var Qe=t=>{var r=wt(),s=i(r,!0);o(r),f(()=>p(s,e(W))),u(t,r)};x(Me,t=>{e(W)&&t(Qe)})}o(C);var oe=n(C,2),de=n(i(oe),2),Xe=i(de);{let t=U(()=>e(b)||!e(T));le(Xe,{buttonAction:ze,get disabled(){return e(t)},children:(r,s)=>{I();var c=j("Fetch Calendars");u(r,c)}})}o(de);var Ye=n(de,2);{var Ze=t=>{var r=$t(),s=n(ae(r),2);Oe(s,21,()=>e($),c=>c.id,(c,g)=>{var w=St(),y=i(w);o(w);var P={};f(H=>{p(y,`${e(g).name??""} (${H??""})`),P!==(P=e(g).id)&&(w.value=(w.__value=e(g).id)??"")},[()=>e(g).components.join(", ")]),u(c,w)}),o(s),mt(s,()=>e(R),c=>a(R,c)),u(t,r)};x(Ye,t=>{e($).length>0&&t(Ze)})}o(oe);var ie=n(oe,2),ce=n(i(ie),2),ve=i(ce),z=i(ve);fe(z),z.value=z.__value="event",I(),o(ve);var $e=n(ve,2),G=i($e);fe(G),G.value=G.__value="task",I(),o($e),o(ce);var Ce=n(ce,2);S(Ce,{label:"Name",id:"caldav-item-name",get value(){return e(A)},set value(t){a(A,t,!0)}});var ke=n(Ce,2);{var et=t=>{var r=Ct(),s=ae(r);S(s,{label:"Starts",id:"caldav-start",type:"datetime-local",get value(){return e(O)},set value(g){a(O,g,!0)}});var c=n(s,2);S(c,{label:"Ends (optional)",id:"caldav-end",type:"datetime-local",get value(){return e(L)},set value(g){a(L,g,!0)}}),u(t,r)},tt=t=>{S(t,{label:"Due (optional)",id:"caldav-due",type:"datetime-local",get value(){return e(V)},set value(r){a(V,r,!0)}})};x(ke,t=>{e(_)==="event"?t(et):t(tt,!1)})}var Ee=n(ke,2),at=i(Ee);{let t=U(()=>e(b)||!e(We)||!e(A)||e(_)==="event"&&!e(O));le(at,{buttonAction:He,get disabled(){return e(t)},children:(r,s)=>{I();var c=j();f(()=>p(c,`Add ${e(_)==="event"?"Event":"To-do"}`)),u(r,c)}})}o(Ee),o(ie);var Ie=n(ie,2);{var rt=t=>{var r=kt(),s=i(r,!0);o(r),f(()=>p(s,e(D))),u(t,r)};x(Ie,t=>{e(D)&&t(rt)})}var Te=n(Ie,2);{var lt=t=>{var r=Et(),s=i(r,!0);o(r),f(()=>p(s,e(F))),u(t,r)};x(Te,t=>{e(F)&&t(lt)})}var Ae=n(Te,2),De=n(i(Ae),4);S(De,{label:"Feed URL",id:"caldav-feed-url",type:"url",placeholder:"https://example.org/holidays.ics",get value(){return e(X)},set value(t){a(X,t,!0)}});var ue=n(De,2),Fe=i(ue);fe(Fe),I(),o(ue);var pe=n(ue,2),nt=i(pe);{let t=U(()=>e(Y)||!e(B)||!e(X));le(nt,{buttonAction:Ge,get disabled(){return e(t)},children:(r,s)=>{I();var c=j();f(()=>p(c,e(Y)?"Reading…":"Read Feed")),u(r,c)}})}o(pe);var Pe=n(pe,2);{var st=t=>{var r=It(),s=i(r,!0);o(r),f(()=>p(s,e(Z))),u(t,r)};x(Pe,t=>{e(Z)&&t(st)})}var ot=n(Pe,2);{var dt=t=>{var r=At(),s=ae(r),c=i(s);o(s);var g=n(s,2);Oe(g,23,()=>e(q),(w,y)=>`${y}:${w.id}`,(w,y)=>{var P=Tt(),H=i(P),it=i(H,!0);o(H);var je=n(H,2),Ue=i(je),Be=n(Ue);{var ct=E=>{var J=j();f(pt=>p(J,`· ${pt??""}`),[()=>be(e(y))]),u(E,J)};x(Be,E=>{be(e(y))&&E(ct)})}var vt=n(Be,2);{var ut=E=>{var J=j();f(()=>p(J,`· ${e(y).location??""}`)),u(E,J)};x(vt,E=>{e(y).location&&E(ut)})}o(je),o(P),f(()=>{p(it,e(y).name),p(Ue,`${e(y).type==="task"?"To-do":"Event"} `)}),u(w,P)}),o(g),f(()=>p(c,`${e(_e)||"Feed"} (${e(q).length??""})`)),u(t,r)};x(ot,t=>{e(q).length>0&&t(dt)})}o(Ae),f((t,r)=>{z.disabled=t,G.disabled=r},[()=>!!(e(k)&&!e(k).components.includes("event")),()=>!!(e(k)&&!e(k).components.includes("task"))]),Le(me,[],z,()=>e(_),t=>a(_,t)),Le(me,[],G,()=>e(_),t=>a(_,t)),xt(Fe,()=>e(ne),t=>a(ne,t)),u(l,h)}}),gt()}export{Ot as component};