@htmlbricks/hb-stylus-notebook 0.20.18 → 0.50.0-alpha.9

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/main.iife.js ADDED
@@ -0,0 +1,2 @@
1
+ var ai=Object.defineProperty;var xr=E=>{throw TypeError(E)};var oi=(E,N,T)=>N in E?ai(E,N,{enumerable:!0,configurable:!0,writable:!0,value:T}):E[N]=T;var G=(E,N,T)=>oi(E,typeof N!="symbol"?N+"":N,T),Sr=(E,N,T)=>N.has(E)||xr("Cannot "+T);var L=(E,N,T)=>(Sr(E,N,"read from private field"),T?T.call(E):N.get(E)),Tt=(E,N,T)=>N.has(E)?xr("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(E):N.set(E,T),Ot=(E,N,T,Pe)=>(Sr(E,N,"write to private field"),Pe?Pe.call(E,T):N.set(E,T),T);(function(E){"use strict";var le,B;const N="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(N);const T=2,Pe="[",kr="]",Ne={},j=Symbol(),it=!1,U=2,xt=4,Ie=8,lt=16,ae=32,ve=64,Le=128,V=256,je=512,D=1024,oe=2048,he=4096,De=8192,Fe=16384,Rr=32768,Ar=65536,Cr=1<<19,St=1<<20,st=Symbol("$state"),Pr=Symbol("legacy props"),Ir=Symbol("");var kt=Array.isArray,Lr=Array.prototype.indexOf,jr=Array.from,Me=Object.keys,qe=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,Dr=Object.getOwnPropertyDescriptors,Fr=Object.prototype,Mr=Array.prototype,Rt=Object.getPrototypeOf;function qr(e){for(var t=0;t<e.length;t++)e[t]()}let Ve=!1,at=[];function At(){Ve=!1;const e=at.slice();at=[],qr(e)}function Ct(e){Ve||(Ve=!0,queueMicrotask(At)),at.push(e)}function Vr(){Ve&&At()}function Pt(e){return e===this.v}function Yr(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Br(e){return!Yr(e,this.v)}function Hr(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ur(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Jr(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Gr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Wr(){throw new Error("https://svelte.dev/e/hydration_failed")}function Xr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Kr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function zr(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function Zr(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Qr=!1;function W(e,t){var r={f:0,v:e,reactions:null,equals:Pt,rv:0,wv:0};return r}function Y(e){return en(W(e))}function It(e,t=!1){const r=W(e);return t||(r.equals=Br),r}function en(e){return y!==null&&!X&&y.f&U&&(Z===null?un([e]):Z.push(e)),e}function b(e,t){return y!==null&&!X&&fr()&&y.f&(U|lt)&&(Z===null||!Z.includes(e))&&Zr(),tn(e,t)}function tn(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=zt(),Lt(e,oe),w!==null&&w.f&D&&!(w.f&(ae|ve))&&(ne===null?fn([e]):ne.push(e))),t}function rn(e,t=1){var r=_(e),i=t===1?r++:r--;return b(e,r),i}function Lt(e,t){var r=e.reactions;if(r!==null)for(var i=r.length,n=0;n<i;n++){var l=r[n],s=l.f;s&oe||(ie(l,t),s&(D|V)&&(s&U?Lt(l,he):_t(l)))}}function jt(e){var t=U|oe,r=y!==null&&y.f&U?y:null;return w===null||r!==null&&r.f&V?t|=V:w.f|=St,{ctx:q,deps:null,effects:null,equals:Pt,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??w}}function Dt(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)fe(t[r])}}function nn(e){for(var t=e.parent;t!==null;){if(!(t.f&U))return t;t=t.parent}return null}function ln(e){var t,r=w;z(nn(e));try{Dt(e),t=Qt(e)}finally{z(r)}return t}function Ft(e){var t=ln(e),r=(ue||e.f&V)&&e.deps!==null?he:D;ie(e,r),e.equals(t)||(e.v=t,e.wv=zt())}function ot(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let C=!1;function pe(e){C=e}let x;function $e(e){if(e===null)throw ot(),Ne;return x=e}function Mt(){return $e(me(x))}function qt(e){if(C){if(me(x)!==null)throw ot(),Ne;x=e}}function F(e,t=null,r){if(typeof e!="object"||e===null||st in e)return e;const i=Rt(e);if(i!==Fr&&i!==Mr)return e;var n=new Map,l=kt(e),s=W(0);l&&n.set("length",W(e.length));var u;return new Proxy(e,{defineProperty(f,a,o){(!("value"in o)||o.configurable===!1||o.enumerable===!1||o.writable===!1)&&Xr();var c=n.get(a);return c===void 0?(c=W(o.value),n.set(a,c)):b(c,F(o.value,u)),!0},deleteProperty(f,a){var o=n.get(a);if(o===void 0)a in f&&n.set(a,W(j));else{if(l&&typeof a=="string"){var c=n.get("length"),d=Number(a);Number.isInteger(d)&&d<c.v&&b(c,d)}b(o,j),Vt(s)}return!0},get(f,a,o){var $;if(a===st)return e;var c=n.get(a),d=a in f;if(c===void 0&&(!d||($=ge(f,a))!=null&&$.writable)&&(c=W(F(d?f[a]:j,u)),n.set(a,c)),c!==void 0){var v=_(c);return v===j?void 0:v}return Reflect.get(f,a,o)},getOwnPropertyDescriptor(f,a){var o=Reflect.getOwnPropertyDescriptor(f,a);if(o&&"value"in o){var c=n.get(a);c&&(o.value=_(c))}else if(o===void 0){var d=n.get(a),v=d==null?void 0:d.v;if(d!==void 0&&v!==j)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return o},has(f,a){var v;if(a===st)return!0;var o=n.get(a),c=o!==void 0&&o.v!==j||Reflect.has(f,a);if(o!==void 0||w!==null&&(!c||(v=ge(f,a))!=null&&v.writable)){o===void 0&&(o=W(c?F(f[a],u):j),n.set(a,o));var d=_(o);if(d===j)return!1}return c},set(f,a,o,c){var P;var d=n.get(a),v=a in f;if(l&&a==="length")for(var $=o;$<d.v;$+=1){var h=n.get($+"");h!==void 0?b(h,j):$ in f&&(h=W(j),n.set($+"",h))}d===void 0?(!v||(P=ge(f,a))!=null&&P.writable)&&(d=W(void 0),b(d,F(o,u)),n.set(a,d)):(v=d.v!==j,b(d,F(o,u)));var S=Reflect.getOwnPropertyDescriptor(f,a);if(S!=null&&S.set&&S.set.call(c,o),!v){if(l&&typeof a=="string"){var A=n.get("length"),O=Number(a);Number.isInteger(O)&&O>=A.v&&b(A,O+1)}Vt(s)}return!0},ownKeys(f){_(s);var a=Reflect.ownKeys(f).filter(d=>{var v=n.get(d);return v===void 0||v.v!==j});for(var[o,c]of n)c.v!==j&&!(o in f)&&a.push(o);return a},setPrototypeOf(){Kr()}})}function Vt(e,t=1){b(e,e.v+t)}var Yt,Bt,Ht,Ut;function ut(){if(Yt===void 0){Yt=window,Bt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype;Ht=ge(t,"firstChild").get,Ut=ge(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function ft(e=""){return document.createTextNode(e)}function Te(e){return Ht.call(e)}function me(e){return Ut.call(e)}function Jt(e,t){if(!C)return Te(e);var r=Te(x);return r===null&&(r=x.appendChild(ft())),$e(r),r}function sn(e,t){if(!C){var r=Te(e);return r instanceof Comment&&r.data===""?me(r):r}return x}function re(e,t=1,r=!1){let i=C?x:e;for(var n;t--;)n=i,i=me(i);if(!C)return i;var l=i==null?void 0:i.nodeType;if(r&&l!==3){var s=ft();return i===null?n==null||n.after(s):i.before(s),$e(s),s}return $e(i),i}function an(e){e.textContent=""}const Gt=0,on=1;let Ye=!1,Be=Gt,Oe=!1,xe=null,ye=!1,ct=!1;function Wt(e){ye=e}function Xt(e){ct=e}let ce=[],we=0,ui=[],y=null,X=!1;function K(e){y=e}let w=null;function z(e){w=e}let Z=null;function un(e){Z=e}let k=null,M=0,ne=null;function fn(e){ne=e}let Kt=1,He=0,ue=!1;function zt(){return++Kt}function Ue(e){var c;var t=e.f;if(t&oe)return!0;if(t&he){var r=e.deps,i=(t&V)!==0;if(r!==null){var n,l,s=(t&je)!==0,u=i&&w!==null&&!ue,f=r.length;if(s||u){var a=e,o=a.parent;for(n=0;n<f;n++)l=r[n],(s||!((c=l==null?void 0:l.reactions)!=null&&c.includes(a)))&&(l.reactions??(l.reactions=[])).push(a);s&&(a.f^=je),u&&o!==null&&!(o.f&V)&&(a.f^=V)}for(n=0;n<f;n++)if(l=r[n],Ue(l)&&Ft(l),l.wv>e.wv)return!0}(!i||w!==null&&!ue)&&ie(e,D)}return!1}function cn(e,t){for(var r=t;r!==null;){if(r.f&Le)try{r.fn(e);return}catch{r.f^=Le}r=r.parent}throw Ye=!1,e}function dn(e){return(e.f&Fe)===0&&(e.parent===null||(e.parent.f&Le)===0)}function Je(e,t,r,i){if(Ye){if(r===null&&(Ye=!1),dn(t))throw e;return}r!==null&&(Ye=!0);{cn(e,t);return}}function Zt(e,t,r=!0){var i=e.reactions;if(i!==null)for(var n=0;n<i.length;n++){var l=i[n];l.f&U?Zt(l,t,!1):t===l&&(r?ie(l,oe):l.f&D&&ie(l,he),_t(l))}}function Qt(e){var v;var t=k,r=M,i=ne,n=y,l=ue,s=Z,u=q,f=X,a=e.f;k=null,M=0,ne=null,y=a&(ae|ve)?null:e,ue=(a&V)!==0&&(!ye||n===null||f),Z=null,ar(e.ctx),X=!1,He++;try{var o=(0,e.fn)(),c=e.deps;if(k!==null){var d;if(Ge(e,M),c!==null&&M>0)for(c.length=M+k.length,d=0;d<k.length;d++)c[M+d]=k[d];else e.deps=c=k;if(!ue)for(d=M;d<c.length;d++)((v=c[d]).reactions??(v.reactions=[])).push(e)}else c!==null&&M<c.length&&(Ge(e,M),c.length=M);if(fr()&&ne!==null&&!X&&c!==null&&!(e.f&(U|he|oe)))for(d=0;d<ne.length;d++)Zt(ne[d],e);return n!==null&&He++,o}finally{k=t,M=r,ne=i,y=n,ue=l,Z=s,ar(u),X=f}}function _n(e,t){let r=t.reactions;if(r!==null){var i=Lr.call(r,e);if(i!==-1){var n=r.length-1;n===0?r=t.reactions=null:(r[i]=r[n],r.pop())}}r===null&&t.f&U&&(k===null||!k.includes(t))&&(ie(t,he),t.f&(V|je)||(t.f^=je),Dt(t),Ge(t,0))}function Ge(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)_n(e,r[i])}function dt(e){var t=e.f;if(!(t&Fe)){ie(e,D);var r=w,i=q;w=e;try{t&lt?Sn(e):ir(e),nr(e);var n=Qt(e);e.teardown=typeof n=="function"?n:null,e.wv=Kt;var l=e.deps,s;it&&Qr&&e.f&oe}catch(u){Je(u,e,r,i||e.ctx)}finally{w=r}}}function er(){if(we>1e3){we=0;try{Gr()}catch(e){if(xe!==null)Je(e,xe,null);else throw e}}we++}function tr(e){var t=e.length;if(t!==0){er();var r=ye;ye=!0;try{for(var i=0;i<t;i++){var n=e[i];n.f&D||(n.f^=D);var l=gn(n);vn(l)}}finally{ye=r}}}function vn(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var i=e[r];if(!(i.f&(Fe|De)))try{Ue(i)&&(dt(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?lr(i):i.fn=null))}catch(n){Je(n,i,null,i.ctx)}}}function hn(){if(Oe=!1,we>1001)return;const e=ce;ce=[],tr(e),Oe||(we=0,xe=null)}function _t(e){Be===Gt&&(Oe||(Oe=!0,queueMicrotask(hn))),xe=e;for(var t=e;t.parent!==null;){t=t.parent;var r=t.f;if(r&(ve|ae)){if(!(r&D))return;t.f^=D}}ce.push(t)}function gn(e){var t=[],r=e.first;e:for(;r!==null;){var i=r.f,n=(i&ae)!==0,l=n&&(i&D)!==0,s=r.next;if(!l&&!(i&De)){if(i&xt)t.push(r);else if(n)r.f^=D;else{var u=y;try{y=r,Ue(r)&&dt(r)}catch(o){Je(o,r,null,r.ctx)}finally{y=u}}var f=r.first;if(f!==null){r=f;continue}}if(s===null){let o=r.parent;for(;o!==null;){if(e===o)break e;var a=o.next;if(a!==null){r=a;continue e}o=o.parent}}r=s}return t}function Se(e){var t=Be,r=ce;try{er();const n=[];Be=on,ce=n,Oe=!1,tr(r);var i=e==null?void 0:e();return Vr(),(ce.length>0||n.length>0)&&Se(),we=0,xe=null,i}finally{Be=t,ce=r}}function _(e){var t=e.f,r=(t&U)!==0;if(y!==null&&!X){Z!==null&&Z.includes(e)&&zr();var i=y.deps;e.rv<He&&(e.rv=He,k===null&&i!==null&&i[M]===e?M++:k===null?k=[e]:(!ue||!k.includes(e))&&k.push(e))}else if(r&&e.deps===null&&e.effects===null){var n=e,l=n.parent;l!==null&&!(l.f&V)&&(n.f^=V)}return r&&(n=e,Ue(n)&&Ft(n)),e.v}function pn(e){var t=X;try{return X=!0,e()}finally{X=t}}const $n=-7169;function ie(e,t){e.f=e.f&$n|t}function mn(e){w===null&&y===null&&Jr(),y!==null&&y.f&V&&w===null&&Ur(),ct&&Hr()}function yn(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function de(e,t,r,i=!0){var n=(e&ve)!==0,l=w,s={ctx:q,deps:null,nodes_start:null,nodes_end:null,f:e|oe,first:null,fn:t,last:null,next:null,parent:n?null:l,prev:null,teardown:null,transitions:null,wv:0};if(r){var u=ye;try{Wt(!0),dt(s),s.f|=Rr}catch(o){throw fe(s),o}finally{Wt(u)}}else t!==null&&_t(s);var f=r&&s.deps===null&&s.first===null&&s.nodes_start===null&&s.teardown===null&&(s.f&(St|Le))===0;if(!f&&!n&&i&&(l!==null&&yn(s,l),y!==null&&y.f&U)){var a=y;(a.effects??(a.effects=[])).push(s)}return s}function wn(e){const t=de(Ie,null,!1);return ie(t,D),t.teardown=e,t}function bn(e){mn();var t=w!==null&&(w.f&ae)!==0&&q!==null&&!q.m;if(t){var r=q;(r.e??(r.e=[])).push({fn:e,effect:w,reaction:y})}else{var i=rr(e);return i}}function En(e){const t=de(ve,e,!0);return()=>{fe(t)}}function Nn(e){const t=de(ve,e,!0);return(r={})=>new Promise(i=>{r.outro?kn(t,()=>{fe(t),i(void 0)}):(fe(t),i(void 0))})}function rr(e){return de(xt,e,!1)}function Tn(e){return de(Ie,e,!0)}function Q(e,t=[],r=jt){const i=t.map(r);return On(()=>e(...i.map(_)))}function On(e,t=0){return de(Ie|lt|t,e,!0)}function xn(e,t=!0){return de(Ie|ae,e,!0,t)}function nr(e){var t=e.teardown;if(t!==null){const r=ct,i=y;Xt(!0),K(null);try{t.call(null)}finally{Xt(r),K(i)}}}function ir(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var i=r.next;fe(r,t),r=i}}function Sn(e){for(var t=e.first;t!==null;){var r=t.next;t.f&ae||fe(t),t=r}}function fe(e,t=!0){var r=!1;if((t||e.f&Cr)&&e.nodes_start!==null){for(var i=e.nodes_start,n=e.nodes_end;i!==null;){var l=i===n?null:me(i);i.remove(),i=l}r=!0}ir(e,t&&!r),Ge(e,0),ie(e,Fe);var s=e.transitions;if(s!==null)for(const f of s)f.stop();nr(e);var u=e.parent;u!==null&&u.first!==null&&lr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function lr(e){var t=e.parent,r=e.prev,i=e.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=r))}function kn(e,t){var r=[];sr(e,r,!0),Rn(r,()=>{fe(e),t&&t()})}function Rn(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var n of e)n.out(i)}else t()}function sr(e,t,r){if(!(e.f&De)){if(e.f^=De,e.transitions!==null)for(const s of e.transitions)(s.is_global||r)&&t.push(s);for(var i=e.first;i!==null;){var n=i.next,l=(i.f&Ar)!==0||(i.f&ae)!==0;sr(i,t,l?r:!1),i=n}}}let q=null;function ar(e){q=e}function or(e,t=!1,r){q={p:q,c:null,e:null,m:!1,s:e,x:null,l:null}}function ur(e){const t=q;if(t!==null){e!==void 0&&(t.x=e);const s=t.e;if(s!==null){var r=w,i=y;t.e=null;try{for(var n=0;n<s.length;n++){var l=s[n];z(l.effect),K(l.reaction),rr(l.fn)}}finally{z(r),K(i)}}q=t.p,t.m=!0}return e||{}}function fr(){return!0}const An=["touchstart","touchmove"];function Cn(e){return An.includes(e)}function Pn(e){var t=y,r=w;K(null),z(null);try{return e()}finally{K(t),z(r)}}const cr=new Set,vt=new Set;function In(e,t,r,i={}){function n(l){if(i.capture||ke.call(t,l),!l.cancelBubble)return Pn(()=>r==null?void 0:r.call(this,l))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ct(()=>{t.addEventListener(e,n,i)}):t.addEventListener(e,n,i),n}function We(e,t,r,i,n){var l={capture:i,passive:n},s=In(e,t,r,l);(t===document.body||t===window||t===document)&&wn(()=>{t.removeEventListener(e,s,l)})}function Ln(e){for(var t=0;t<e.length;t++)cr.add(e[t]);for(var r of vt)r(e)}function ke(e){var O;var t=this,r=t.ownerDocument,i=e.type,n=((O=e.composedPath)==null?void 0:O.call(e))||[],l=n[0]||e.target,s=0,u=e.__root;if(u){var f=n.indexOf(u);if(f!==-1&&(t===document||t===window)){e.__root=t;return}var a=n.indexOf(t);if(a===-1)return;f<=a&&(s=f)}if(l=n[s]||e.target,l!==t){qe(e,"currentTarget",{configurable:!0,get(){return l||r}});var o=y,c=w;K(null),z(null);try{for(var d,v=[];l!==null;){var $=l.assignedSlot||l.parentNode||l.host||null;try{var h=l["__"+i];if(h!==void 0&&!l.disabled)if(kt(h)){var[S,...A]=h;S.apply(l,[e,...A])}else h.call(l,e)}catch(P){d?v.push(P):d=P}if(e.cancelBubble||$===t||$===null)break;l=$}if(d){for(let P of v)queueMicrotask(()=>{throw P});throw d}}finally{e.__root=t,delete e.currentTarget,K(o),z(c)}}}function jn(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function ht(e,t){var r=w;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function Dn(e,t){var r=(t&T)!==0,i,n=!e.startsWith("<!>");return()=>{if(C)return ht(x,null),x;i===void 0&&(i=jn(n?e:"<!>"+e));var l=r||Bt?document.importNode(i,!0):i.cloneNode(!0);{var s=Te(l),u=l.lastChild;ht(s,u)}return l}}function dr(e,t){if(C){w.nodes_end=x,Mt();return}e!==null&&e.before(t)}function _r(e,t){return vr(e,t)}function Fn(e,t){ut(),t.intro=t.intro??!1;const r=t.target,i=C,n=x;try{for(var l=Te(r);l&&(l.nodeType!==8||l.data!==Pe);)l=me(l);if(!l)throw Ne;pe(!0),$e(l),Mt();const s=vr(e,{...t,anchor:l});if(x===null||x.nodeType!==8||x.data!==kr)throw ot(),Ne;return pe(!1),s}catch(s){if(s===Ne)return t.recover===!1&&Wr(),ut(),an(r),pe(!1),_r(e,t);throw s}finally{pe(i),$e(n)}}const be=new Map;function vr(e,{target:t,anchor:r,props:i={},events:n,context:l,intro:s=!0}){ut();var u=new Set,f=c=>{for(var d=0;d<c.length;d++){var v=c[d];if(!u.has(v)){u.add(v);var $=Cn(v);t.addEventListener(v,ke,{passive:$});var h=be.get(v);h===void 0?(document.addEventListener(v,ke,{passive:$}),be.set(v,1)):be.set(v,h+1)}}};f(jr(cr)),vt.add(f);var a=void 0,o=Nn(()=>{var c=r??t.appendChild(ft());return xn(()=>{if(l){or({});var d=q;d.c=l}n&&(i.$$events=n),C&&ht(c,null),a=e(c,i)||{},C&&(w.nodes_end=x),l&&ur()}),()=>{var $;for(var d of u){t.removeEventListener(d,ke);var v=be.get(d);--v===0?(document.removeEventListener(d,ke),be.delete(d)):be.set(d,v)}vt.delete(f),c!==r&&(($=c.parentNode)==null||$.removeChild(c))}});return gt.set(a,o),a}let gt=new WeakMap;function Mn(e,t){const r=gt.get(e);return r?(gt.delete(e),r(t)):Promise.resolve()}function qn(e,t){Ct(()=>{var r=e.getRootNode(),i=r.host?r:r.head??r.ownerDocument.head;if(!i.querySelector("#"+t.hash)){const n=document.createElement("style");n.id=t.hash,n.textContent=t.code,i.appendChild(n)}})}function Vn(e,t,r,i){var n=e.__attributes??(e.__attributes={});C&&(n[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||n[t]!==(n[t]=r)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[Ir]=r),r==null?e.removeAttribute(t):typeof r!="string"&&hr(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function R(e,t,r){var i=y,n=w;let l=C;C&&pe(!1),K(null),z(null);try{(pt.has(e.nodeName)||!customElements||customElements.get(e.tagName.toLowerCase())?hr(e).includes(t):r&&typeof r=="object")?e[t]=r:Vn(e,t,r==null?r:String(r))}finally{K(i),z(n),l&&pe(!0)}}var pt=new Map;function hr(e){var t=pt.get(e.nodeName);if(t)return t;pt.set(e.nodeName,t=[]);for(var r,i=e,n=Element.prototype;n!==i;){r=Dr(i);for(var l in r)r[l].set&&t.push(l);i=Rt(i)}return t}function $t(e,t,r,i){var n;n=e[t];var l=i,s=!0,u=!1,f=()=>(u=!0,s&&(s=!1,l=i),l);n===void 0&&i!==void 0&&(n=f());var a;a=()=>{var v=e[t];return v===void 0?f():(s=!0,u=!1,v)};var o=!1,c=It(n),d=jt(()=>{var v=a(),$=_(c);return o?(o=!1,$):c.v=v});return function(v,$){if(arguments.length>0){const h=$?_(d):v;return d.equals(h)||(o=!0,b(c,h),u&&l!==void 0&&(l=h),pn(()=>_(d))),v}return _(d)}}function Yn(e){return new Bn(e)}class Bn{constructor(t){Tt(this,le);Tt(this,B);var l;var r=new Map,i=(s,u)=>{var f=It(u);return r.set(s,f),f};const n=new Proxy({...t.props||{},$$events:{}},{get(s,u){return _(r.get(u)??i(u,Reflect.get(s,u)))},has(s,u){return u===Pr?!0:(_(r.get(u)??i(u,Reflect.get(s,u))),Reflect.has(s,u))},set(s,u,f){return b(r.get(u)??i(u,f),f),Reflect.set(s,u,f)}});Ot(this,B,(t.hydrate?Fn:_r)(t.component,{target:t.target,anchor:t.anchor,props:n,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&Se(),Ot(this,le,n.$$events);for(const s of Object.keys(L(this,B)))s==="$set"||s==="$destroy"||s==="$on"||qe(this,s,{get(){return L(this,B)[s]},set(u){L(this,B)[s]=u},enumerable:!0});L(this,B).$set=s=>{Object.assign(n,s)},L(this,B).$destroy=()=>{Mn(L(this,B))}}$set(t){L(this,B).$set(t)}$on(t,r){L(this,le)[t]=L(this,le)[t]||[];const i=(...n)=>r.call(this,...n);return L(this,le)[t].push(i),()=>{L(this,le)[t]=L(this,le)[t].filter(n=>n!==i)}}$destroy(){L(this,B).$destroy()}}le=new WeakMap,B=new WeakMap;let gr;typeof HTMLElement=="function"&&(gr=class extends HTMLElement{constructor(t,r,i){super();G(this,"$$ctor");G(this,"$$s");G(this,"$$c");G(this,"$$cn",!1);G(this,"$$d",{});G(this,"$$r",!1);G(this,"$$p_d",{});G(this,"$$l",{});G(this,"$$l_u",new Map);G(this,"$$me");this.$$ctor=t,this.$$s=r,i&&this.attachShadow({mode:"open"})}addEventListener(t,r,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(r),this.$$c){const n=this.$$c.$on(t,r);this.$$l_u.set(r,n)}super.addEventListener(t,r,i)}removeEventListener(t,r,i){if(super.removeEventListener(t,r,i),this.$$c){const n=this.$$l_u.get(r);n&&(n(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return l=>{const s=document.createElement("slot");n!=="default"&&(s.name=n),dr(l,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=Hn(this);for(const n of this.$$s)n in i&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),r.default=!0):r[n]=t(n));for(const n of this.attributes){const l=this.$$g_p(n.name);l in this.$$d||(this.$$d[l]=Xe(l,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Yn({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=En(()=>{Tn(()=>{var n;this.$$r=!0;for(const l of Me(this.$$c)){if(!((n=this.$$p_d[l])!=null&&n.reflect))continue;this.$$d[l]=this.$$c[l];const s=Xe(l,this.$$d[l],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,s)}this.$$r=!1})});for(const n in this.$$l)for(const l of this.$$l[n]){const s=this.$$c.$on(n,l);this.$$l_u.set(l,s)}this.$$l={}}}attributeChangedCallback(t,r,i){var n;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Xe(t,i,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Me(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function Xe(e,t,r,i){var l;const n=(l=r[e])==null?void 0:l.type;if(t=n==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!r[e])return t;if(i==="toAttribute")switch(n){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(n){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Hn(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function Un(e,t,r,i,n,l){let s=class extends gr{constructor(){super(e,r,n),this.$$p_d=t}static get observedAttributes(){return Me(t).map(u=>(t[u].attribute||u).toLowerCase())}};return Me(t).forEach(u=>{qe(s.prototype,u,{get(){return this.$$c&&u in this.$$c?this.$$c[u]:this.$$d[u]},set(f){var c;f=Xe(u,f,t),this.$$d[u]=f;var a=this.$$c;if(a){var o=(c=ge(a,u))==null?void 0:c.get;o?a[u]=f:a.$set({[u]:f})}}})}),i.forEach(u=>{qe(s.prototype,u,{get(){var f;return(f=this.$$c)==null?void 0:f[u]}})}),e.element=s,s}const pr={version:"0.50.0-alpha.009"};function Jn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={},mt,$r;function Gn(){if($r)return mt;$r=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,n=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,f=`
2
+ `,a="/",o="*",c="",d="comment",v="declaration";mt=function(h,S){if(typeof h!="string")throw new TypeError("First argument must be a string");if(!h)return[];S=S||{};var A=1,O=1;function P(m){var g=m.match(t);g&&(A+=g.length);var I=m.lastIndexOf(f);O=~I?m.length-I:O+m.length}function Ke(){var m={line:A,column:O};return function(g){return g.position=new ze(m),Qe(),g}}function ze(m){this.start=m,this.end={line:A,column:O},this.source=S.source}ze.prototype.content=h;function Ze(m){var g=new Error(S.source+":"+A+":"+O+": "+m);if(g.reason=m,g.filename=S.source,g.line=A,g.column=O,g.source=h,!S.silent)throw g}function _e(m){var g=m.exec(h);if(g){var I=g[0];return P(I),h=h.slice(I.length),g}}function Qe(){_e(r)}function et(m){var g;for(m=m||[];g=tt();)g!==!1&&m.push(g);return m}function tt(){var m=Ke();if(!(a!=h.charAt(0)||o!=h.charAt(1))){for(var g=2;c!=h.charAt(g)&&(o!=h.charAt(g)||a!=h.charAt(g+1));)++g;if(g+=2,c===h.charAt(g-1))return Ze("End of comment missing");var I=h.slice(2,g-2);return O+=2,P(I),h=h.slice(g),O+=2,m({type:d,comment:I})}}function rt(){var m=Ke(),g=_e(i);if(g){if(tt(),!_e(n))return Ze("property missing ':'");var I=_e(l),Ae=m({type:v,property:$(g[0].replace(e,c)),value:I?$(I[0].replace(e,c)):c});return _e(s),Ae}}function Re(){var m=[];et(m);for(var g;g=rt();)g!==!1&&(m.push(g),et(m));return m}return Qe(),Re()};function $(h){return h?h.replace(u,c):c}return mt}var mr;function Wn(){if(mr)return Ee;mr=1;var e=Ee&&Ee.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.default=r;var t=e(Gn());function r(i,n){var l=null;if(!i||typeof i!="string")return l;var s=(0,t.default)(i),u=typeof n=="function";return s.forEach(function(f){if(f.type==="declaration"){var a=f.property,o=f.value;u?n(a,o,f):o&&(l=l||{},l[a]=o)}}),l}return Ee}var Xn=Wn();const yr=Jn(Xn),Kn=yr.default||yr;function wr(e,t){var i,n;let r="";if(e&&(t!=null&&t.length)&&((i=Object.keys(e))!=null&&i.length)&&((n=t==null?void 0:t.filter(l=>Object.keys(e).includes(l.name)))!=null&&n.length))for(const l of Object.keys(e))(t==null?void 0:t.filter(u=>u.name===l&&u.defaultValue!==e[l]))&&(r+=`${l}:${e[l]};`);return r}function br(e){var i;const t=((i=e==null?void 0:e.repoName.split("/"))==null?void 0:i[1])||(e==null?void 0:e.repoName);if(!t)throw new Error("wrong componentPath "+(e==null?void 0:e.repoName));if(!(e!=null&&e.version))throw new Error("wrong version "+(e==null?void 0:e.version));const r=(e==null?void 0:e.iifePath)||"main.iife.js";if(!document.getElementById(t+"-script"))try{const n=document.createElement("script");n.id=t+"-script",n.src=`https://cdn.jsdelivr.net/npm/${e.repoName}@${e.version}/${r}`,e!=null&&e.local&&location.href.includes("localhost")&&(n.src=`${e.local}`),document.head.appendChild(n)}catch(n){console.warn(n)}}const yt={vars:[]},wt={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}]};var zn=(e,t)=>t("eraser"),Zn=(e,t)=>t("select"),Qn=(e,t)=>t("draw"),ei=(e,t)=>t(),ti=(e,t)=>t(),ri=(e,t)=>t(),ni=Dn('<div part="controller" id="controller" class="svelte-14wiqdf"><button>clear</button> <button>select</button> <button>draw</button> <button>undo</button> <button>redo</button> <button>save</button> <button>brush</button> <br>load:<hb-input-file></hb-input-file> insert:<hb-input-file></hb-input-file></div> <div part="paper-container" id="paper-container" style="position:relative" class="svelte-14wiqdf"><hb-stylus-paper></hb-stylus-paper></div>',3);const ii={hash:"svelte-14wiqdf",code:'@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host {font-family:"Roboto", sans-serif;position:absolute;width:100%;height:100%;display:block;display:grid;grid-template-areas:"header" "paper";grid-template-columns:1fr;grid-template-rows:auto 1fr;}#controller.svelte-14wiqdf {grid-area:header;}#paper-container.svelte-14wiqdf {grid-area:paper;background:green;}'};function Er(e,t){or(t,!0),qn(e,ii);let r=$t(t,"id",7,""),i=$t(t,"style"),n=$t(t,"load_draw"),l=Y("draw"),s=Y(F({})),u=Y(""),f=Y(""),a=Y(0),o=Y(void 0),c=Y(!1),d=Y(!1),v=Y(!1),$=Y(void 0),h=Y(void 0),S=Y(void 0),A;bn(()=>{var p;if(i()&&(b(s,F(Kn(i()))),b(u,F(wr(_(s),yt==null?void 0:yt.vars))),b(f,F(wr(_(s),wt==null?void 0:wt.vars)))),(_(o)===0||_(o))&&_(o)<_(a)?b(d,!0):b(d,!1),(_(a)||_(a)===0)&&_(v)&&(!_(o)||_(o)!==-1)&&(!A||A<_(a)&&(!_(o)||_(o)<A))?b(c,!0):b(c,!1),typeof n()=="string"&&((p=n())!=null&&p.length))try{n(JSON.parse(n()))}catch(ee){console.error("error parsing json",ee)}}),br({repoName:"@htmlbricks/hb-stylus-paper",version:pr.version}),br({repoName:"@htmlbricks/hb-input-file",version:pr.version});function O(p,ee){var te="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(p)),H=document.createElement("a");H.setAttribute("href",te),H.setAttribute("download",ee),document.body.appendChild(H),H.click(),H.remove()}function P(p){b(l,F(p))}function Ke(){console.log("ch",_(a),_(o)),_(a)>=0&&(!_(o)||_(o)>-1)&&(b(o,F(_(o)||_(o)===0?_(o)-1:_(a)-1)),console.log("undo",_(a),_(o)))}function ze(){console.log(_(a),_(o)),(_(o)||_(o)===0)&&_(o)<=_(a)&&(rn(o),console.log("redo",_(a),_(o)))}function Ze(p){_(v)||b(v,!0),console.log("h",p),b(a,p.index-1),p.start_index&&(A=p.start_index),b(o,void 0)}function _e(){b($,F({name:"test",type:"json"}))}function Qe(p){var te;const ee=(te=p.value)==null?void 0:te.name;if(ee){const H=new FileReader;H.readAsDataURL(p.value),H.onload=function(se){var Nt,Or;try{if(console.log("insert file",se.target,(Nt=se.target)==null?void 0:Nt.result),(Or=se.target)!=null&&Or.result){const si=se.target.result.toString().split(";")[0].split("/")[1];b(h,F({base64:se.target.result.toString(),type:si,name:ee}))}}catch{console.error("error loading file")}},H.onerror=function(se){console.error("error reading file")}}}function et(p){console.log("save",p),b($,void 0),O(p,p.name+".json")}function tt(p){if(console.log("file",p),p.value.name){const ee=new FileReader;ee.readAsText(p.value,"UTF-8"),ee.onload=function(te){var H,se;if((se=(H=te==null?void 0:te.target)==null?void 0:H.result)!=null&&se.toString())try{n(JSON.parse(te.target.result.toString()))}catch{console.error("error loading file")}},ee.onerror=function(te){console.error("error reading file")}}}var rt=ni(),Re=sn(rt),m=Jt(Re);m.__click=[zn,P];var g=re(m,2);g.__click=[Zn,P];var I=re(g,2);I.__click=[Qn,P];var Ae=re(I,2);Ae.__click=[ei,Ke];var bt=re(Ae,2);bt.__click=[ti,ze];var Et=re(bt,2);Et.__click=[ri,_e];var Nr=re(Et,2),Ce=re(Nr,4);R(Ce,"id","loadfile"),Q(()=>R(Ce,"style",_(f))),R(Ce,"schemaentry",JSON.stringify({label:"ciao",id:"xxxxxxx"}));var nt=re(Ce,2);R(nt,"id","insertfile"),Q(()=>R(nt,"style",_(f))),R(nt,"schemaentry",JSON.stringify({label:"ciao"})),qt(Re);var Tr=re(Re,2),J=Jt(Tr);return R(J,"id","stylus-paper"),Q(()=>R(J,"goto",_(o))),Q(()=>R(J,"style",_(u))),R(J,"background_color","green"),Q(()=>R(J,"mode",_(l))),Q(()=>R(J,"save_as",_($)?JSON.stringify(_($)):"")),Q(()=>R(J,"load_draw",n()?JSON.stringify(n()):null)),Q(()=>R(J,"insert_image",_(h)?JSON.stringify(_(h)):null)),Q(()=>R(J,"insert_text",_(S)?JSON.stringify(_(S)):null)),qt(Tr),Q(()=>{Ae.disabled=!_(c),bt.disabled=!_(d),Et.disabled=!_(c),Nr.disabled=_(l)!=="draw"}),We("setValue",Ce,p=>tt(p.detail)),We("setValue",nt,p=>Qe(p.detail)),We("historyIndex",J,p=>Ze(p.detail)),We("save",J,p=>et(p.detail)),dr(e,rt),ur({get id(){return r()},set id(p=""){r(p),Se()},get style(){return i()},set style(p){i(p),Se()},get load_draw(){return n()},set load_draw(p){n(p),Se()}})}Ln(["click"]),customElements.define("hb-stylus-notebook",Un(Er,{id:{},style:{},load_draw:{}},[],[],!0)),E.Component=Er,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})})(this["stylus-notebook"]=this["stylus-notebook"]||{});
@@ -205,6 +205,7 @@
205
205
  }
206
206
  }
207
207
  },
208
+ "description": "",
208
209
  "storybookArgs": {
209
210
  "load_draw": {
210
211
  "control": {
@@ -238,9 +239,7 @@
238
239
  }
239
240
  ]
240
241
  },
241
- "author": "Dario Caruso <dev@dariocaruso.info> (https://dariocaruso.info)",
242
242
  "contributors": [],
243
- "owner": "Dario Caruso <dev@dariocaruso.info> (https://dariocaruso.info)",
244
243
  "htmlSlots": [
245
244
  {
246
245
  "name": "skelcontent",
@@ -334,7 +333,7 @@
334
333
  "size": {
335
334
  "layout": "fullscreen"
336
335
  },
337
- "iifePath": "release/release.js",
336
+ "iifePath": "main.iife.js",
338
337
  "repoName": "@htmlbricks/hb-stylus-notebook",
339
- "version": "0.20.18"
338
+ "version": "0.50.0-alpha.009"
340
339
  }
package/package.json CHANGED
@@ -1,84 +1,16 @@
1
1
  {
2
- "name": "@htmlbricks/hb-stylus-notebook",
3
- "displayName": "Svelte-Bootstrap stylus-notebook",
4
- "description": "Svelte-Bootstrap stylus-notebook",
5
- "version": "0.20.18",
6
- "main": "release/release.js",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
- "author": "Dario Caruso <dev@dariocaruso.info> (https://dariocaruso.info)",
11
- "authorUrl": "https://dariocaruso.info",
12
- "license": "MIT",
13
- "license-docs": "CC BY 4.0",
14
- "license-translations": "CC BY 4.0",
15
- "license-images": "CC BY-NC 4.0",
16
- "engines": {
17
- "node": ">=16.0.0"
18
- },
19
- "scripts": {
20
- "start": "sirv dist",
21
- "dev": "rm -rf ./dist && rollup -c -w",
22
- "build": "rm -rf ./dist && rollup -c",
23
- "generate-manifest": "npm run generate-schemes && monorepo-wc-packages-manifester --dir $PWD",
24
- "generate-component-schema": "ts-json-schema-generator --type 'Component' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent.type.d.json",
25
- "generate-events-schema": "ts-json-schema-generator --type 'Events' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent_events.type.d.json",
26
- "generate-schemes": "npm run generate-events-schema && npm run generate-component-schema",
27
- "copydest": "rsync -avh dist/* ./release/ --delete",
28
- "build-extra": "tsc --moduleResolution node --module es2020 --esModuleInterop true --outDir dist --sourceMap --skipLibCheck extra/*",
29
- "build:release": "PRODUCTION=true npm run build && npm run build-extra && npm run generate-manifest && npm run copydest",
30
- "prepublish": "npm run build:release"
31
- },
32
- "devDependencies": {
33
- "@rollup/plugin-alias": "^3.1.2",
34
- "@rollup/plugin-commonjs": "^18.0.0",
35
- "@rollup/plugin-json": "^4.1.0",
36
- "@rollup/plugin-node-resolve": "^11.2.1",
37
- "@rollup/plugin-replace": "^4.0.0",
38
- "@rollup/plugin-typescript": "^8.2.1",
39
- "@tsconfig/svelte": "^1.0.10",
40
- "@types/node": "^16.7.1",
41
- "@typescript-eslint/eslint-plugin": "^4.22.0",
42
- "@typescript-eslint/parser": "^4.22.0",
43
- "eslint": "^7.25.0",
44
- "eslint-plugin-jsdoc": "^33.0.0",
45
- "eslint-plugin-svelte3": "^3.2.0",
46
- "monorepo-wc-packages-manifester": "^0.0.3",
47
- "node-sass": "^9.0.0",
48
- "postcss": "^8.2.13",
49
- "postcss-load-config": "^3.0.1",
50
- "prettier": "^2.8.4",
51
- "rollup": "^2.46.0",
52
- "rollup-plugin-copy": "^3.4.0",
53
- "rollup-plugin-css-only": "^3.1.0",
54
- "rollup-plugin-livereload": "^2.0.0",
55
- "rollup-plugin-svelte": "^7.1.0",
56
- "rollup-plugin-terser": "^7.0.2",
57
- "rollup-plugin-ts-paths": "^1.0.5",
58
- "rollup-plugin-typescript2": "^0.31.1",
59
- "sass": "^1.32.12",
60
- "sirv-cli": "^1.0.11",
61
- "svelte": "^3.46.2",
62
- "svelte-check": "^1.5.2",
63
- "svelte-preprocess": "^4.7.2",
64
- "ts-json-schema-generator": "^0.98.0",
65
- "ts-node": "^9.1.1",
66
- "tslib": "^2.2.0",
67
- "ttypescript": "^1.5.12",
68
- "typescript": "^4.3.5",
69
- "typescript-transform-paths": "^2.2.3",
70
- "wc-js-utils": "^0.0.1"
71
- },
72
- "keywords": [
73
- "svelte",
74
- "svelte-webcomponents",
75
- "webcomponents"
76
- ],
77
- "contributors": [],
78
- "gitHead": "89b0885aff646abbcaebdf63ab8602aa87d3e218",
79
- "dependencies": {
80
- "@htmlbricks/hb-input-file": "^0.20.18",
81
- "@htmlbricks/hb-stylus-paper": "^0.20.18",
82
- "style-to-object": "^0.3.0"
83
- }
84
- }
2
+ "name": "@htmlbricks/hb-stylus-notebook",
3
+ "version": "0.50.0-alpha.009",
4
+ "contributors": [],
5
+ "description": "",
6
+ "licenses": [
7
+ {
8
+ "type": "Apache-2.0",
9
+ "path": "LICENSE.md",
10
+ "cost": 0,
11
+ "currency": "EUR"
12
+ }
13
+ ],
14
+ "main": "main.iife.js",
15
+ "dependencies": []
16
+ }
@@ -0,0 +1,177 @@
1
+ {
2
+ "$ref": "#/definitions/Component",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "Component": {
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "debug": {
9
+ "enum": [
10
+ "yes",
11
+ "no"
12
+ ],
13
+ "type": "string"
14
+ },
15
+ "id": {
16
+ "type": "string"
17
+ },
18
+ "load_draw": {
19
+ "$ref": "#/definitions/TSave"
20
+ },
21
+ "save": {
22
+ "additionalProperties": false,
23
+ "properties": {
24
+ "name": {
25
+ "type": "string"
26
+ },
27
+ "type": {
28
+ "enum": [
29
+ "pdf",
30
+ "json",
31
+ "png",
32
+ "svg",
33
+ "jpg"
34
+ ],
35
+ "type": "string"
36
+ }
37
+ },
38
+ "required": [
39
+ "name",
40
+ "type"
41
+ ],
42
+ "type": "object"
43
+ },
44
+ "style": {
45
+ "type": "string"
46
+ }
47
+ },
48
+ "type": "object"
49
+ },
50
+ "IStroke": {
51
+ "additionalProperties": false,
52
+ "properties": {
53
+ "actionIndex": {
54
+ "type": "number"
55
+ },
56
+ "color": {
57
+ "type": "string"
58
+ },
59
+ "erasedAtIndex": {
60
+ "type": "number"
61
+ },
62
+ "id": {
63
+ "type": "string"
64
+ },
65
+ "max": {
66
+ "items": {
67
+ "type": "number"
68
+ },
69
+ "maxItems": 2,
70
+ "minItems": 2,
71
+ "type": "array"
72
+ },
73
+ "min": {
74
+ "items": {
75
+ "type": "number"
76
+ },
77
+ "maxItems": 2,
78
+ "minItems": 2,
79
+ "type": "array"
80
+ },
81
+ "multipath": {
82
+ "items": {
83
+ "$ref": "#/definitions/IStroke"
84
+ },
85
+ "type": "array"
86
+ },
87
+ "opacity": {
88
+ "type": "number"
89
+ },
90
+ "path": {
91
+ "$ref": "#/definitions/TPath"
92
+ },
93
+ "pathData": {
94
+ "type": "string"
95
+ },
96
+ "selected": {
97
+ "type": "boolean"
98
+ },
99
+ "type": {
100
+ "enum": [
101
+ "stroke",
102
+ "multiplestroke",
103
+ "eraser",
104
+ "move"
105
+ ],
106
+ "type": "string"
107
+ },
108
+ "visible": {
109
+ "type": "boolean"
110
+ }
111
+ },
112
+ "required": [
113
+ "actionIndex",
114
+ "visible",
115
+ "id",
116
+ "type"
117
+ ],
118
+ "type": "object"
119
+ },
120
+ "TPath": {
121
+ "items": {
122
+ "items": {
123
+ "type": "number"
124
+ },
125
+ "maxItems": 3,
126
+ "minItems": 3,
127
+ "type": "array"
128
+ },
129
+ "type": "array"
130
+ },
131
+ "TSave": {
132
+ "additionalProperties": false,
133
+ "properties": {
134
+ "draw": {
135
+ "items": {
136
+ "$ref": "#/definitions/IStroke"
137
+ },
138
+ "type": "array"
139
+ },
140
+ "draw_id": {
141
+ "type": "string"
142
+ },
143
+ "id": {
144
+ "type": "string"
145
+ },
146
+ "name": {
147
+ "type": "string"
148
+ },
149
+ "type": {
150
+ "$ref": "#/definitions/TSaveType"
151
+ },
152
+ "version": {
153
+ "type": "number"
154
+ }
155
+ },
156
+ "required": [
157
+ "type",
158
+ "draw",
159
+ "id",
160
+ "draw_id",
161
+ "name",
162
+ "version"
163
+ ],
164
+ "type": "object"
165
+ },
166
+ "TSaveType": {
167
+ "enum": [
168
+ "pdf",
169
+ "json",
170
+ "png",
171
+ "svg",
172
+ "jpg"
173
+ ],
174
+ "type": "string"
175
+ }
176
+ }
177
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$ref": "#/definitions/Events",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "Events": {
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "event": {
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "test": {
12
+ "type": "boolean"
13
+ }
14
+ },
15
+ "required": [
16
+ "test"
17
+ ],
18
+ "type": "object"
19
+ }
20
+ },
21
+ "required": [
22
+ "event"
23
+ ],
24
+ "type": "object"
25
+ }
26
+ }
27
+ }
package/LICENSE.md DELETED
@@ -1,68 +0,0 @@
1
- ## MIT License
2
-
3
- > Code and Contributions
4
-
5
- Copyright (c) 2021 Dario Caruso (dottgonzo)
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in all
15
- copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- SOFTWARE.
24
-
25
- ##### https://choosealicense.com/licenses/mit/
26
-
27
- ## Creative Commons BY-NC 4.0 License
28
-
29
- > Images, assets and logos
30
-
31
- Copyleft (c) 2021 Dario Caruso (dottgonzo)
32
-
33
- #### You are free to:
34
-
35
- - Share — copy and redistribute the material in any medium or format
36
- - Adapt — remix, transform, and build upon the material
37
-
38
- The licensor cannot revoke these freedoms as long as you follow the license terms.
39
-
40
- #### Under the following terms:
41
-
42
- - Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that - suggests the licensor endorses you or your use.
43
- - NonCommercial — You may not use the material for commercial purposes.
44
-
45
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
46
-
47
- ##### https://creativecommons.org/licenses/by-nc/4.0/
48
-
49
- ## Creative Commons BY 4.0 License
50
-
51
- > Documentation and Translations
52
-
53
- Copyleft (c) 2021 Dario Caruso (dottgonzo)
54
-
55
- #### You are free to:
56
-
57
- - Share — copy and redistribute the material in any medium or format
58
- - Adapt — remix, transform, and build upon the material for any purpose, even commercially.
59
-
60
- The licensor cannot revoke these freedoms as long as you follow the license terms.
61
-
62
- #### Under the following terms:
63
-
64
- - Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
65
-
66
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
67
-
68
- ##### https://creativecommons.org/licenses/by/4.0/
package/README.md DELETED
@@ -1 +0,0 @@
1
- # stylus-notebook
package/extra/docs.ts DELETED
@@ -1,83 +0,0 @@
1
- import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup, ComponentSetup } from "wc-js-utils/main";
2
- import type { Component } from "../app/types/webcomponent.type";
3
-
4
- export const storybookArgs = {
5
- load_draw: { control: { type: "object" } },
6
- save: { control: { type: "object" } },
7
- debug: {
8
- options: ["yes", "no"],
9
- control: { type: "select" }, // Automatically inferred when 'options' is defined
10
- },
11
- event: { action: "eventEvent" },
12
- };
13
-
14
- const cssVars: CssVar[] = [];
15
- export const cssParts: CssPart[] = [{ name: "testpart", description: "test css part on 2 div tag" }];
16
- export const htmlSlots: HtmlSlot[] = [{ name: "skelcontent", description: "test slot" }];
17
- export const i18nLanguages: i18nLang[] = [];
18
-
19
- export const styleSetup: StyleSetup = {
20
- vars: cssVars,
21
- parts: cssParts,
22
- };
23
-
24
- const examples: { name: string; description?: string; data: Component }[] = [
25
- {
26
- name: "default",
27
- data: {},
28
- },
29
- {
30
- name: "withLoadDraw",
31
- data: {
32
- load_draw: {
33
- type: "json",
34
- draw: [
35
- {
36
- path: [
37
- [196, 57, 0.5],
38
- [198, 57, 0.5],
39
- [202, 57, 0.5],
40
- [219, 57, 0.5],
41
- [223, 57, 0.5],
42
- ],
43
- color: "rgb(0,0,0)",
44
- id: "1671124484963",
45
- pathData:
46
- "M 196 54.28875 Q 196 54.28875 202.6125 54.537796875 209.225 54.78684375 209.57834293663552 54.84477326089788 209.93168587327105 54.90270277179576 210.24803371116735 55.07042606940648 210.56438154906365 55.2381493670172 210.81061258608528 55.49810577780627 211.05684362310691 55.75806218859534 211.20717740467902 56.083034207731316 211.35751118625112 56.408006226867286 211.3962077257588 56.76396919816234 211.43490426526654 57.11993216945741 211.3579120248085 57.46961667585187 211.2809197843505 57.81930118224632 211.09629987182666 58.12609516361293 210.91167995930283 58.43288914497954 210.6387621282894 58.664671190483475 210.3658442972759 58.8964532359874 210.03320311672323 59.02895570427987 209.70056193617054 59.161458172572345 209.34302502549124 59.18080802024588 208.98548811481194 59.200157867919415 208.64048968293474 59.104329160814736 208.29549125105754 59.008500453710056 207.99915272487073 58.80752648275734 207.7028141986839 58.60655251180463 207.48616230010498 58.3214753048146 207.26951040152608 58.03639809782457 207.15522864152683 57.69706531362217 207.0409468815276 57.35773252941976 207.0410005905474 56.999672400086126 207.0410542995672 56.64161227075248 207.1554378542575 56.30231378634754 207.2698214089478 55.96301530194259 207.48655882093817 55.67800310334964 207.70329623292858 55.39299090475669 207.99969503797055 55.192105844404324 208.29609384301253 54.99122078405196 208.6411210079765 54.89549558078758 208.98614817294046 54.7997703775232 209.34367926257636 54.81922748539759 209.70121035221229 54.838684593271985 210.03381176705625 54.97128684795452 210.36641318190019 55.10388910263704 210.63926146601972 55.335753013058856 210.91210975013928 55.56761692348067 211.09663761616218 55.87446627701448 211.2811654821851 56.18131563054828 211.35805281382812 56.53102321887873 211.43494014547116 56.880730807209176 211.396136818815 57.23668215352423 211.35733349215883 57.59263349983927 211.20690222574746 57.91756040421771 211.0564709593361 58.24248730859615 210.81016194647282 58.50236983837718 210.56385293360952 58.762252368158215 210.24745479296035 58.929880753871444 209.93105665231116 59.097509139584666 209.57769635272305 59.15533264499632 209.22433605313495 59.21315615040797 209.22466802656749 59.21315620020398 209.225 59.21315625 202.6125 59.462203125 196 59.71125 195.67556757774054 59.67185550565311 195.35113515548107 59.63246101130623 195.04555876084675 59.51656713812797 194.7399823662124 59.400673264949695 194.47102211361675 59.215015770294414 194.2020618610211 59.02935827563913 193.98534973298206 58.78472758181928 193.76863760494302 58.54009688799943 193.6167689205244 58.25071094243375 193.46490023610576 57.961324996868065 193.38670161038146 57.64400292430956 193.3085029846572 57.326680851751064 193.3085193254285 56.99986542596616 193.30853566619982 56.673050000181256 193.3867660237403 56.355735749071926 193.4649963812808 56.038421497962595 193.61689400353458 55.749050740712256 193.76879162578837 55.45967998346192 193.9855282158132 55.21507096207799 194.202264805838 54.97046194069406 194.4712436228383 54.78483134299228 194.74022243983856 54.5992007452905 195.04581042233232 54.48333743033112 195.35139840482609 54.36747411537173 195.67583476491282 54.328112064463994 196.00027112499956 54.28875001355625 196.0001355624998 54.28875000677813 Z",
47
- min: [196, 57],
48
- max: [223, 57],
49
- visible: true,
50
- actionIndex: 0,
51
- opacity: 1,
52
- type: "stroke",
53
- },
54
- ],
55
- id: "stylus-paper",
56
- draw_id: "0.wh3036wc7x0.fevf9p1uqkg1671124483602",
57
- name: "test",
58
- version: 0,
59
- },
60
- },
61
- },
62
- ];
63
- export const componentSetup: ComponentSetup & { examples: { name: string; description?: string; data: Component }[] } = {
64
- definitions: null as any,
65
- storybookArgs,
66
- styleSetup,
67
- author: null as any,
68
- contributors: [],
69
- owner: null as any,
70
- htmlSlots,
71
- i18n: i18nLanguages,
72
- examples,
73
- screenshots: [],
74
- licenses: [{ type: "Apache-2.0", path: "LICENSE.md", cost: 0, currency: "EUR" }],
75
- readmePath: "README.md",
76
- name: "hb-stylus-notebook",
77
- category: "editor",
78
- tags: ["editor", "draw", "input", "stylus", "notebook"],
79
- size: { layout: "fullscreen" },
80
- iifePath: "release/release.js",
81
- repoName: "@htmlbricks/hb-stylus-notebook",
82
- version: null as any,
83
- };
package/release/docs.js DELETED
@@ -1,77 +0,0 @@
1
- export var storybookArgs = {
2
- load_draw: { control: { type: "object" } },
3
- save: { control: { type: "object" } },
4
- debug: {
5
- options: ["yes", "no"],
6
- control: { type: "select" }
7
- },
8
- event: { action: "eventEvent" }
9
- };
10
- var cssVars = [];
11
- export var cssParts = [{ name: "testpart", description: "test css part on 2 div tag" }];
12
- export var htmlSlots = [{ name: "skelcontent", description: "test slot" }];
13
- export var i18nLanguages = [];
14
- export var styleSetup = {
15
- vars: cssVars,
16
- parts: cssParts
17
- };
18
- var examples = [
19
- {
20
- name: "default",
21
- data: {}
22
- },
23
- {
24
- name: "withLoadDraw",
25
- data: {
26
- load_draw: {
27
- type: "json",
28
- draw: [
29
- {
30
- path: [
31
- [196, 57, 0.5],
32
- [198, 57, 0.5],
33
- [202, 57, 0.5],
34
- [219, 57, 0.5],
35
- [223, 57, 0.5],
36
- ],
37
- color: "rgb(0,0,0)",
38
- id: "1671124484963",
39
- pathData: "M 196 54.28875 Q 196 54.28875 202.6125 54.537796875 209.225 54.78684375 209.57834293663552 54.84477326089788 209.93168587327105 54.90270277179576 210.24803371116735 55.07042606940648 210.56438154906365 55.2381493670172 210.81061258608528 55.49810577780627 211.05684362310691 55.75806218859534 211.20717740467902 56.083034207731316 211.35751118625112 56.408006226867286 211.3962077257588 56.76396919816234 211.43490426526654 57.11993216945741 211.3579120248085 57.46961667585187 211.2809197843505 57.81930118224632 211.09629987182666 58.12609516361293 210.91167995930283 58.43288914497954 210.6387621282894 58.664671190483475 210.3658442972759 58.8964532359874 210.03320311672323 59.02895570427987 209.70056193617054 59.161458172572345 209.34302502549124 59.18080802024588 208.98548811481194 59.200157867919415 208.64048968293474 59.104329160814736 208.29549125105754 59.008500453710056 207.99915272487073 58.80752648275734 207.7028141986839 58.60655251180463 207.48616230010498 58.3214753048146 207.26951040152608 58.03639809782457 207.15522864152683 57.69706531362217 207.0409468815276 57.35773252941976 207.0410005905474 56.999672400086126 207.0410542995672 56.64161227075248 207.1554378542575 56.30231378634754 207.2698214089478 55.96301530194259 207.48655882093817 55.67800310334964 207.70329623292858 55.39299090475669 207.99969503797055 55.192105844404324 208.29609384301253 54.99122078405196 208.6411210079765 54.89549558078758 208.98614817294046 54.7997703775232 209.34367926257636 54.81922748539759 209.70121035221229 54.838684593271985 210.03381176705625 54.97128684795452 210.36641318190019 55.10388910263704 210.63926146601972 55.335753013058856 210.91210975013928 55.56761692348067 211.09663761616218 55.87446627701448 211.2811654821851 56.18131563054828 211.35805281382812 56.53102321887873 211.43494014547116 56.880730807209176 211.396136818815 57.23668215352423 211.35733349215883 57.59263349983927 211.20690222574746 57.91756040421771 211.0564709593361 58.24248730859615 210.81016194647282 58.50236983837718 210.56385293360952 58.762252368158215 210.24745479296035 58.929880753871444 209.93105665231116 59.097509139584666 209.57769635272305 59.15533264499632 209.22433605313495 59.21315615040797 209.22466802656749 59.21315620020398 209.225 59.21315625 202.6125 59.462203125 196 59.71125 195.67556757774054 59.67185550565311 195.35113515548107 59.63246101130623 195.04555876084675 59.51656713812797 194.7399823662124 59.400673264949695 194.47102211361675 59.215015770294414 194.2020618610211 59.02935827563913 193.98534973298206 58.78472758181928 193.76863760494302 58.54009688799943 193.6167689205244 58.25071094243375 193.46490023610576 57.961324996868065 193.38670161038146 57.64400292430956 193.3085029846572 57.326680851751064 193.3085193254285 56.99986542596616 193.30853566619982 56.673050000181256 193.3867660237403 56.355735749071926 193.4649963812808 56.038421497962595 193.61689400353458 55.749050740712256 193.76879162578837 55.45967998346192 193.9855282158132 55.21507096207799 194.202264805838 54.97046194069406 194.4712436228383 54.78483134299228 194.74022243983856 54.5992007452905 195.04581042233232 54.48333743033112 195.35139840482609 54.36747411537173 195.67583476491282 54.328112064463994 196.00027112499956 54.28875001355625 196.0001355624998 54.28875000677813 Z",
40
- min: [196, 57],
41
- max: [223, 57],
42
- visible: true,
43
- actionIndex: 0,
44
- opacity: 1,
45
- type: "stroke"
46
- },
47
- ],
48
- id: "stylus-paper",
49
- draw_id: "0.wh3036wc7x0.fevf9p1uqkg1671124483602",
50
- name: "test",
51
- version: 0
52
- }
53
- }
54
- },
55
- ];
56
- export var componentSetup = {
57
- definitions: null,
58
- storybookArgs: storybookArgs,
59
- styleSetup: styleSetup,
60
- author: null,
61
- contributors: [],
62
- owner: null,
63
- htmlSlots: htmlSlots,
64
- i18n: i18nLanguages,
65
- examples: examples,
66
- screenshots: [],
67
- licenses: [{ type: "Apache-2.0", path: "LICENSE.md", cost: 0, currency: "EUR" }],
68
- readmePath: "README.md",
69
- name: "hb-stylus-notebook",
70
- category: "editor",
71
- tags: ["editor", "draw", "input", "stylus", "notebook"],
72
- size: { layout: "fullscreen" },
73
- iifePath: "release/release.js",
74
- repoName: "@htmlbricks/hb-stylus-notebook",
75
- version: null
76
- };
77
- //# sourceMappingURL=docs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../extra/docs.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,IAAM,aAAa,GAAG;IAC5B,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC1C,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACrC,KAAK,EAAE;QACN,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;QACtB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC3B;IACD,KAAK,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;CAC/B,CAAC;AAEF,IAAM,OAAO,GAAa,EAAE,CAAC;AAC7B,MA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AACF,MAAM,CAAC,IAAM,cAAc,GAA6F;IACvH,WAAW,EAAE,IAAW;IACxB,aAAa,eAAA;IACb,UAAU,YAAA;IACV,MAAM,EAAE,IAAW;IACnB,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE,IAAW;IAClB,SAAS,WAAA;IACT,IAAI,EAAE,aAAa;IACnB,QAAQ,UAAA;IACR,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAChF,UAAU,EAAE,WAAW;IACvB,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC;IACvD,IAAI,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;IAC9B,QAAQ,EAAE,oBAAoB;IAC9B,QAAQ,EAAE,gCAAgC;IAC1C,OAAO,EAAE,IAAW;CACpB,CAAC"}
package/release/docs.ts DELETED
@@ -1,83 +0,0 @@
1
- import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup, ComponentSetup } from "wc-js-utils/main";
2
- import type { Component } from "../app/types/webcomponent.type";
3
-
4
- export const storybookArgs = {
5
- load_draw: { control: { type: "object" } },
6
- save: { control: { type: "object" } },
7
- debug: {
8
- options: ["yes", "no"],
9
- control: { type: "select" }, // Automatically inferred when 'options' is defined
10
- },
11
- event: { action: "eventEvent" },
12
- };
13
-
14
- const cssVars: CssVar[] = [];
15
- export const cssParts: CssPart[] = [{ name: "testpart", description: "test css part on 2 div tag" }];
16
- export const htmlSlots: HtmlSlot[] = [{ name: "skelcontent", description: "test slot" }];
17
- export const i18nLanguages: i18nLang[] = [];
18
-
19
- export const styleSetup: StyleSetup = {
20
- vars: cssVars,
21
- parts: cssParts,
22
- };
23
-
24
- const examples: { name: string; description?: string; data: Component }[] = [
25
- {
26
- name: "default",
27
- data: {},
28
- },
29
- {
30
- name: "withLoadDraw",
31
- data: {
32
- load_draw: {
33
- type: "json",
34
- draw: [
35
- {
36
- path: [
37
- [196, 57, 0.5],
38
- [198, 57, 0.5],
39
- [202, 57, 0.5],
40
- [219, 57, 0.5],
41
- [223, 57, 0.5],
42
- ],
43
- color: "rgb(0,0,0)",
44
- id: "1671124484963",
45
- pathData:
46
- "M 196 54.28875 Q 196 54.28875 202.6125 54.537796875 209.225 54.78684375 209.57834293663552 54.84477326089788 209.93168587327105 54.90270277179576 210.24803371116735 55.07042606940648 210.56438154906365 55.2381493670172 210.81061258608528 55.49810577780627 211.05684362310691 55.75806218859534 211.20717740467902 56.083034207731316 211.35751118625112 56.408006226867286 211.3962077257588 56.76396919816234 211.43490426526654 57.11993216945741 211.3579120248085 57.46961667585187 211.2809197843505 57.81930118224632 211.09629987182666 58.12609516361293 210.91167995930283 58.43288914497954 210.6387621282894 58.664671190483475 210.3658442972759 58.8964532359874 210.03320311672323 59.02895570427987 209.70056193617054 59.161458172572345 209.34302502549124 59.18080802024588 208.98548811481194 59.200157867919415 208.64048968293474 59.104329160814736 208.29549125105754 59.008500453710056 207.99915272487073 58.80752648275734 207.7028141986839 58.60655251180463 207.48616230010498 58.3214753048146 207.26951040152608 58.03639809782457 207.15522864152683 57.69706531362217 207.0409468815276 57.35773252941976 207.0410005905474 56.999672400086126 207.0410542995672 56.64161227075248 207.1554378542575 56.30231378634754 207.2698214089478 55.96301530194259 207.48655882093817 55.67800310334964 207.70329623292858 55.39299090475669 207.99969503797055 55.192105844404324 208.29609384301253 54.99122078405196 208.6411210079765 54.89549558078758 208.98614817294046 54.7997703775232 209.34367926257636 54.81922748539759 209.70121035221229 54.838684593271985 210.03381176705625 54.97128684795452 210.36641318190019 55.10388910263704 210.63926146601972 55.335753013058856 210.91210975013928 55.56761692348067 211.09663761616218 55.87446627701448 211.2811654821851 56.18131563054828 211.35805281382812 56.53102321887873 211.43494014547116 56.880730807209176 211.396136818815 57.23668215352423 211.35733349215883 57.59263349983927 211.20690222574746 57.91756040421771 211.0564709593361 58.24248730859615 210.81016194647282 58.50236983837718 210.56385293360952 58.762252368158215 210.24745479296035 58.929880753871444 209.93105665231116 59.097509139584666 209.57769635272305 59.15533264499632 209.22433605313495 59.21315615040797 209.22466802656749 59.21315620020398 209.225 59.21315625 202.6125 59.462203125 196 59.71125 195.67556757774054 59.67185550565311 195.35113515548107 59.63246101130623 195.04555876084675 59.51656713812797 194.7399823662124 59.400673264949695 194.47102211361675 59.215015770294414 194.2020618610211 59.02935827563913 193.98534973298206 58.78472758181928 193.76863760494302 58.54009688799943 193.6167689205244 58.25071094243375 193.46490023610576 57.961324996868065 193.38670161038146 57.64400292430956 193.3085029846572 57.326680851751064 193.3085193254285 56.99986542596616 193.30853566619982 56.673050000181256 193.3867660237403 56.355735749071926 193.4649963812808 56.038421497962595 193.61689400353458 55.749050740712256 193.76879162578837 55.45967998346192 193.9855282158132 55.21507096207799 194.202264805838 54.97046194069406 194.4712436228383 54.78483134299228 194.74022243983856 54.5992007452905 195.04581042233232 54.48333743033112 195.35139840482609 54.36747411537173 195.67583476491282 54.328112064463994 196.00027112499956 54.28875001355625 196.0001355624998 54.28875000677813 Z",
47
- min: [196, 57],
48
- max: [223, 57],
49
- visible: true,
50
- actionIndex: 0,
51
- opacity: 1,
52
- type: "stroke",
53
- },
54
- ],
55
- id: "stylus-paper",
56
- draw_id: "0.wh3036wc7x0.fevf9p1uqkg1671124483602",
57
- name: "test",
58
- version: 0,
59
- },
60
- },
61
- },
62
- ];
63
- export const componentSetup: ComponentSetup & { examples: { name: string; description?: string; data: Component }[] } = {
64
- definitions: null as any,
65
- storybookArgs,
66
- styleSetup,
67
- author: null as any,
68
- contributors: [],
69
- owner: null as any,
70
- htmlSlots,
71
- i18n: i18nLanguages,
72
- examples,
73
- screenshots: [],
74
- licenses: [{ type: "Apache-2.0", path: "LICENSE.md", cost: 0, currency: "EUR" }],
75
- readmePath: "README.md",
76
- name: "hb-stylus-notebook",
77
- category: "editor",
78
- tags: ["editor", "draw", "input", "stylus", "notebook"],
79
- size: { layout: "fullscreen" },
80
- iifePath: "release/release.js",
81
- repoName: "@htmlbricks/hb-stylus-notebook",
82
- version: null as any,
83
- };
@@ -1,2 +0,0 @@
1
- var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){t.appendChild(e)}function l(t,e,n){t.insertBefore(e,n||null)}function s(t){t.parentNode&&t.parentNode.removeChild(t)}function c(t){return document.createElement(t)}function u(t){return document.createTextNode(t)}function d(){return u(" ")}function f(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function p(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function h(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:p(t,e,n)}function g(t){const e={};for(const n of t)e[n.name]=n.value;return e}let v;function m(t){v=t}function y(){if(!v)throw new Error("Function called outside component initialization");return v}function b(){const t=y();return(e,n,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[e];if(r){const i=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(e,n,{cancelable:o});return r.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}const $=[],w=[];let _=[];const x=[],E=Promise.resolve();let k=!1;function C(t){_.push(t)}const N=new Set;let S=0;function O(){if(0!==S)return;const t=v;do{try{for(;S<$.length;){const t=$[S];S++,m(t),T(t.$$)}}catch(t){throw $.length=0,S=0,t}for(m(null),$.length=0,S=0;w.length;)w.pop()();for(let t=0;t<_.length;t+=1){const e=_[t];N.has(e)||(N.add(e),e())}_.length=0}while($.length);for(;x.length;)x.pop()();k=!1,N.clear(),m(t)}function T(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(C)}}const A=new Set;function L(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];_.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),_=e}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function j(t,e){-1===t.$$.dirty[0]&&($.push(t),k||(k=!0,E.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function J(i,a,l,c,u,d,f,p=[-1]){const h=v;m(i);const g=i.$$={fragment:null,ctx:[],props:d,update:t,not_equal:u,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(h?h.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:a.target||h.$$.root};f&&f(g.root);let y=!1;if(g.ctx=l?l(i,a.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return g.ctx&&u(g.ctx[t],g.ctx[t]=o)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](o),y&&j(i,t)),e})):[],g.update(),y=!0,o(g.before_update),g.fragment=!!c&&c(g.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);g.fragment&&g.fragment.l(t),t.forEach(s)}else g.fragment&&g.fragment.c();a.intro&&((b=i.$$.fragment)&&b.i&&(A.delete(b),b.i($))),function(t,n,i,a){const{fragment:l,after_update:s}=t.$$;l&&l.m(n,i),a||C((()=>{const n=t.$$.on_mount.map(e).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),s.forEach(C)}(i,a.target,a.anchor,a.customElement),O()}var b,$;m(h)}let D;"function"==typeof HTMLElement&&(D=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){L(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var P="0.20.18",R=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,V=/\n/g,F=/^\s*/,I=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,M=/^:\s*/,B=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,U=/^[;\s]*/,W=/^\s+|\s+$/g,z="";function H(t){return t?t.replace(W,z):z}var q=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var r,i,a=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function r(t){var e=t.match(V);e&&(n+=e.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function i(){var t={line:n,column:o};return function(e){return e.position=new a(t),c(),e}}function a(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function l(r){var i=new Error(e.source+":"+n+":"+o+": "+r);if(i.reason=r,i.filename=e.source,i.line=n,i.column=o,i.source=t,!e.silent)throw i}function s(e){var n=e.exec(t);if(n){var o=n[0];return r(o),t=t.slice(o.length),n}}function c(){s(F)}function u(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=i();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;z!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,z===t.charAt(n-1))return l("End of comment missing");var a=t.slice(2,n-2);return o+=2,r(a),t=t.slice(n),o+=2,e({type:"comment",comment:a})}}function f(){var t=i(),e=s(I);if(e){if(d(),!s(M))return l("property missing ':'");var n=s(B),o=t({type:"declaration",property:H(e[0].replace(R,z)),value:n?H(n[0].replace(R,z)):z});return s(U),o}}return a.prototype.content=t,c(),function(){var t,e=[];for(u(e);t=f();)!1!==t&&(e.push(t),u(e));return e}()}(t),l="function"==typeof e,s=0,c=a.length;s<c;s++)r=(n=a[s]).property,i=n.value,l?e(r,i,n):i&&(o||(o={}),o[r]=i);return o};var K,G=(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var i=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},a=0,l=Object.keys(t);a<l.length;a++)i(l[a]);return r},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var r=document.createElement("script");r.id=n+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,i="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(i=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),i},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var i="",a=t.getDefaultLang();if(!o||a!==o){var l=null==n?void 0:n[a];(null==l?void 0:l[e])&&(i=l[e])}return i},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n}(K={exports:{}},K.exports),K.exports),Q={vars:[],parts:[]},X={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}],parts:[{name:"invalid-feedback",description:""}]};function Y(e){let n,r,i,g,v,m,y,b,$,w,_,x,E,k,C,N,S,O,T,A,L,j,J,D,P,R,V,F,I,M,B,U,W,z,H,q;return{c(){var o,a,l,s;n=c("div"),r=c("button"),r.textContent="clear",i=d(),g=c("button"),g.textContent="select",v=d(),m=c("button"),m.textContent="draw",y=d(),b=c("button"),$=u("undo"),_=d(),x=c("button"),E=u("redo"),C=d(),N=c("button"),S=u("save"),T=d(),A=c("button"),L=u("brush"),J=d(),D=c("br"),P=u("load:"),R=c("hb-input-file"),V=u("\n\tinsert:"),F=c("hb-input-file"),I=d(),M=c("div"),B=c("hb-stylus-paper"),this.c=t,b.disabled=w=!e[5],x.disabled=k=!e[6],N.disabled=O=!e[5],A.disabled=j="draw"!==e[2],h(R,"id","loadfile"),h(R,"style",e[4]),h(R,"schemaentry",JSON.stringify({label:"ciao",id:"xxxxxxx"})),h(F,"id","insertfile"),h(F,"style",e[4]),h(F,"schemaentry",JSON.stringify({label:"ciao"})),p(n,"part","controller"),p(n,"id","controller"),h(B,"id","stylus-paper"),h(B,"goto",e[1]),h(B,"style",e[3]),h(B,"background_color","green"),h(B,"mode",e[2]),h(B,"save_as",U=JSON.stringify(e[7])),h(B,"load_draw",W=e[0]?JSON.stringify(e[0]):null),h(B,"insert_image",z=e[8]?JSON.stringify(e[8]):null),h(B,"insert_text",e[9]?JSON.stringify(e[9]):null),p(M,"part","paper-container"),p(M,"id","paper-container"),o=M,a="position",null==(l="relative")?o.style.removeProperty(a):o.style.setProperty(a,l,s?"important":"")},m(t,o){l(t,n,o),a(n,r),a(n,i),a(n,g),a(n,v),a(n,m),a(n,y),a(n,b),a(b,$),a(n,_),a(n,x),a(x,E),a(n,C),a(n,N),a(N,S),a(n,T),a(n,A),a(A,L),a(n,J),a(n,D),a(n,P),a(n,R),a(n,V),a(n,F),l(t,I,o),l(t,M,o),a(M,B),H||(q=[f(r,"click",e[24]),f(g,"click",e[25]),f(m,"click",e[26]),f(b,"click",e[27]),f(x,"click",e[28]),f(N,"click",e[29]),f(R,"setValue",e[30]),f(F,"setValue",e[31]),f(B,"historyIndex",e[32]),f(B,"save",e[33])],H=!0)},p(t,e){32&e[0]&&w!==(w=!t[5])&&(b.disabled=w),64&e[0]&&k!==(k=!t[6])&&(x.disabled=k),32&e[0]&&O!==(O=!t[5])&&(N.disabled=O),4&e[0]&&j!==(j="draw"!==t[2])&&(A.disabled=j),16&e[0]&&h(R,"style",t[4]),16&e[0]&&h(F,"style",t[4]),2&e[0]&&h(B,"goto",t[1]),8&e[0]&&h(B,"style",t[3]),4&e[0]&&h(B,"mode",t[2]),128&e[0]&&U!==(U=JSON.stringify(t[7]))&&h(B,"save_as",U),1&e[0]&&W!==(W=t[0]?JSON.stringify(t[0]):null)&&h(B,"load_draw",W),256&e[0]&&z!==(z=t[8]?JSON.stringify(t[8]):null)&&h(B,"insert_image",z)},i:t,o:t,d(t){t&&s(n),t&&s(I),t&&s(M),H=!1,o(q)}}}function Z(t,e,n){const o=y();b();let r,i,a,l,s,c,u,{id:d}=e,{style:f}=e,p="draw",h="",g="",v=!1,m=!1,{load_draw:$}=e;function w(t){n(2,p=t)}function _(){console.log("ch",i,a),i>=0&&(!a||a>-1)&&(n(1,a=a||0===a?a-1:i-1),console.log("undo",i,a))}function x(){console.log(i,a),(a||0===a)&&a<=i&&(n(1,a++,a),console.log("redo",i,a))}function E(t){m||n(22,m=!0),console.log("h",t),n(21,i=t.index-1),t.start_index&&n(23,u=t.start_index),n(1,a=null)}function k(){n(7,s={name:"test",type:"json"})}function C(t){var e;const o=null===(e=t.value)||void 0===e?void 0:e.name;if(o){const e=new FileReader;e.readAsDataURL(t.value),e.onload=function(t){var e,r;try{if(console.log("insert file",t.target,null===(e=t.target)||void 0===e?void 0:e.result),null===(r=t.target)||void 0===r?void 0:r.result){const e=t.target.result.toString().split(";")[0].split("/")[1];n(8,c={base64:t.target.result.toString(),type:e,name:o})}}catch(t){console.error("error loading file")}},e.onerror=function(t){console.error("error reading file")}}}function N(t){var e,o,r,i;console.log("save",t),n(7,s=null),e=t,o=t.name+".json",r="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e)),(i=document.createElement("a")).setAttribute("href",r),i.setAttribute("download",o),document.body.appendChild(i),i.click(),i.remove()}function S(t){if(console.log("file",t),t.value.name){const e=new FileReader;e.readAsText(t.value,"UTF-8"),e.onload=function(t){try{n(0,$=JSON.parse(t.target.result.toString()))}catch(t){console.error("error loading file")}},e.onerror=function(t){console.error("error reading file")}}}G.addComponent({repoName:"@htmlbricks/hb-stylus-paper",version:P}),G.addComponent({repoName:"@htmlbricks/hb-input-file",version:P}),function(t){y().$$.on_mount.push(t)}((()=>{console.log(o.shadowRoot.getElementById("skeletontest"))}));return t.$$set=t=>{"id"in t&&n(18,d=t.id),"style"in t&&n(19,f=t.style),"load_draw"in t&&n(0,$=t.load_draw)},t.$$.update=()=>{if(16515075&t.$$.dirty[0])if(d||n(18,d=""),f&&(n(20,r=q(f)),n(3,h=G.getChildStyleToPass(r,null==Q?void 0:Q.vars)),n(4,g=G.getChildStyleToPass(r,null==X?void 0:X.vars))),i||0===i||n(21,i=0),n(6,l=!(0!==a&&!a||!(a<i))),n(5,v=!(!i&&0!==i||!m||a&&-1===a||u&&!(u<i&&(!a||a<u)))),"string"==typeof $&&(null==$?void 0:$.length))try{n(0,$=JSON.parse($))}catch(t){console.error("error parsing json",t)}else $||n(0,$=null)},[$,a,p,h,g,v,l,s,c,undefined,w,_,x,E,k,C,N,S,d,f,r,i,m,u,()=>w("eraser"),()=>w("select"),()=>w("draw"),()=>_(),()=>x(),()=>k(),t=>S(t.detail),t=>C(t.detail),t=>E(t.detail),t=>N(t.detail)]}class tt extends D{constructor(t){super();const e=document.createElement("style");e.textContent='@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host{font-family:"Roboto", sans-serif;position:absolute;width:100%;height:100%;display:block;display:grid;grid-template-areas:"header" "paper";grid-template-columns:1fr;grid-template-rows:auto 1fr}#controller{grid-area:header}#paper-container{grid-area:paper;background:green}',this.shadowRoot.appendChild(e),J(this,{target:this.shadowRoot,props:g(this.attributes),customElement:!0},Z,Y,i,{id:18,style:19,load_draw:0},null,[-1,-1]),t&&(t.target&&l(t.target,this,t.anchor),t.props&&(this.$set(t.props),O()))}static get observedAttributes(){return["id","style","load_draw"]}get id(){return this.$$.ctx[18]}set id(t){this.$$set({id:t}),O()}get style(){return this.$$.ctx[19]}set style(t){this.$$set({style:t}),O()}get load_draw(){return this.$$.ctx[0]}set load_draw(t){this.$$set({load_draw:t}),O()}}return customElements.define("hb-stylus-notebook",tt),tt}();
2
- //# sourceMappingURL=release.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"release.js","sources":["../../../node_modules/svelte/internal/index.mjs","../../../node_modules/inline-style-parser/index.js","../../../node_modules/style-to-object/index.js","../../../node_modules/wc-js-utils/main.js","../../stylus-paper/release/docs.js","../../input-file/release/docs.js","../app/html/webcomponent.svelte"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\nfunction is_promise(value) {\n return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nlet src_url_equal_anchor;\nfunction src_url_equal(element_src, url) {\n if (!src_url_equal_anchor) {\n src_url_equal_anchor = document.createElement('a');\n }\n src_url_equal_anchor.href = url;\n return element_src === src_url_equal_anchor.href;\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\nfunction get_all_dirty_from_scope($$scope) {\n if ($$scope.ctx.length > 32) {\n const dirty = [];\n const length = $$scope.ctx.length / 32;\n for (let i = 0; i < length; i++) {\n dirty[i] = -1;\n }\n return dirty;\n }\n return -1;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\nfunction split_css_unit(value) {\n const split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n return split ? [parseFloat(split[1]), split[2] || 'px'] : [value, 'px'];\n}\nconst contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\n/**\n * Resize observer singleton.\n * One listener per element only!\n * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ\n */\nclass ResizeObserverSingleton {\n constructor(options) {\n this.options = options;\n this._listeners = 'WeakMap' in globals ? new WeakMap() : undefined;\n }\n observe(element, listener) {\n this._listeners.set(element, listener);\n this._getObserver().observe(element, this.options);\n return () => {\n this._listeners.delete(element);\n this._observer.unobserve(element); // this line can probably be removed\n };\n }\n _getObserver() {\n var _a;\n return (_a = this._observer) !== null && _a !== void 0 ? _a : (this._observer = new ResizeObserver((entries) => {\n var _a;\n for (const entry of entries) {\n ResizeObserverSingleton.entries.set(entry.target, entry);\n (_a = this._listeners.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);\n }\n }));\n }\n}\n// Needs to be written like this to pass the tree-shake-test\nResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined;\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\nfunction start_hydrating() {\n is_hydrating = true;\n}\nfunction end_hydrating() {\n is_hydrating = false;\n}\nfunction upper_bound(low, high, key, value) {\n // Return first index of value larger than input value in the range [low, high)\n while (low < high) {\n const mid = low + ((high - low) >> 1);\n if (key(mid) <= value) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction init_hydrate(target) {\n if (target.hydrate_init)\n return;\n target.hydrate_init = true;\n // We know that all children have claim_order values since the unclaimed have been detached if target is not <head>\n let children = target.childNodes;\n // If target is <head>, there may be children without claim_order\n if (target.nodeName === 'HEAD') {\n const myChildren = [];\n for (let i = 0; i < children.length; i++) {\n const node = children[i];\n if (node.claim_order !== undefined) {\n myChildren.push(node);\n }\n }\n children = myChildren;\n }\n /*\n * Reorder claimed children optimally.\n * We can reorder claimed children optimally by finding the longest subsequence of\n * nodes that are already claimed in order and only moving the rest. The longest\n * subsequence of nodes that are claimed in order can be found by\n * computing the longest increasing subsequence of .claim_order values.\n *\n * This algorithm is optimal in generating the least amount of reorder operations\n * possible.\n *\n * Proof:\n * We know that, given a set of reordering operations, the nodes that do not move\n * always form an increasing subsequence, since they do not move among each other\n * meaning that they must be already ordered among each other. Thus, the maximal\n * set of nodes that do not move form a longest increasing subsequence.\n */\n // Compute longest increasing subsequence\n // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n const m = new Int32Array(children.length + 1);\n // Predecessor indices + 1\n const p = new Int32Array(children.length);\n m[0] = -1;\n let longest = 0;\n for (let i = 0; i < children.length; i++) {\n const current = children[i].claim_order;\n // Find the largest subsequence length such that it ends in a value less than our current value\n // upper_bound returns first greater value, so we subtract one\n // with fast path for when we are on the current longest subsequence\n const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;\n p[i] = m[seqLen] + 1;\n const newLen = seqLen + 1;\n // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n m[newLen] = i;\n longest = Math.max(newLen, longest);\n }\n // The longest increasing subsequence of nodes (initially reversed)\n const lis = [];\n // The rest of the nodes, nodes that will be moved\n const toMove = [];\n let last = children.length - 1;\n for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n lis.push(children[cur - 1]);\n for (; last >= cur; last--) {\n toMove.push(children[last]);\n }\n last--;\n }\n for (; last >= 0; last--) {\n toMove.push(children[last]);\n }\n lis.reverse();\n // We sort the nodes being moved to guarantee that their insertion order matches the claim order\n toMove.sort((a, b) => a.claim_order - b.claim_order);\n // Finally, we move the nodes\n for (let i = 0, j = 0; i < toMove.length; i++) {\n while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {\n j++;\n }\n const anchor = j < lis.length ? lis[j] : null;\n target.insertBefore(toMove[i], anchor);\n }\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction append_styles(target, style_sheet_id, styles) {\n const append_styles_to = get_root_for_style(target);\n if (!append_styles_to.getElementById(style_sheet_id)) {\n const style = element('style');\n style.id = style_sheet_id;\n style.textContent = styles;\n append_stylesheet(append_styles_to, style);\n }\n}\nfunction get_root_for_style(node) {\n if (!node)\n return document;\n const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n if (root && root.host) {\n return root;\n }\n return node.ownerDocument;\n}\nfunction append_empty_stylesheet(node) {\n const style_element = element('style');\n append_stylesheet(get_root_for_style(node), style_element);\n return style_element.sheet;\n}\nfunction append_stylesheet(node, style) {\n append(node.head || node, style);\n return style.sheet;\n}\nfunction append_hydration(target, node) {\n if (is_hydrating) {\n init_hydrate(target);\n if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) {\n target.actual_end_child = target.firstChild;\n }\n // Skip nodes of undefined ordering\n while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {\n target.actual_end_child = target.actual_end_child.nextSibling;\n }\n if (node !== target.actual_end_child) {\n // We only insert if the ordering of this node should be modified or the parent node is not target\n if (node.claim_order !== undefined || node.parentNode !== target) {\n target.insertBefore(node, target.actual_end_child);\n }\n }\n else {\n target.actual_end_child = node.nextSibling;\n }\n }\n else if (node.parentNode !== target || node.nextSibling !== null) {\n target.appendChild(node);\n }\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction insert_hydration(target, node, anchor) {\n if (is_hydrating && !anchor) {\n append_hydration(target, node);\n }\n else if (node.parentNode !== target || node.nextSibling != anchor) {\n target.insertBefore(node, anchor || null);\n }\n}\nfunction detach(node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction comment(content) {\n return document.createComment(content);\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_immediate_propagation(fn) {\n return function (event) {\n event.stopImmediatePropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction trusted(fn) {\n return function (event) {\n // @ts-ignore\n if (event.isTrusted)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data_map(node, data_map) {\n Object.keys(data_map).forEach((key) => {\n set_custom_element_data(node, key, data_map[key]);\n });\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction set_dynamic_element_data(tag) {\n return (/-/.test(tag)) ? set_custom_element_data_map : set_attributes;\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction init_binding_group(group) {\n let _inputs;\n return {\n /* push */ p(...inputs) {\n _inputs = inputs;\n _inputs.forEach(input => group.push(input));\n },\n /* remove */ r() {\n _inputs.forEach(input => group.splice(group.indexOf(input), 1));\n }\n };\n}\nfunction init_binding_group_dynamic(group, indexes) {\n let _group = get_binding_group(group);\n let _inputs;\n function get_binding_group(group) {\n for (let i = 0; i < indexes.length; i++) {\n group = group[indexes[i]] = group[indexes[i]] || [];\n }\n return group;\n }\n function push() {\n _inputs.forEach(input => _group.push(input));\n }\n function remove() {\n _inputs.forEach(input => _group.splice(_group.indexOf(input), 1));\n }\n return {\n /* update */ u(new_indexes) {\n indexes = new_indexes;\n const new_group = get_binding_group(group);\n if (new_group !== _group) {\n remove();\n _group = new_group;\n push();\n }\n },\n /* push */ p(...inputs) {\n _inputs = inputs;\n push();\n },\n /* remove */ r: remove\n };\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction init_claim_info(nodes) {\n if (nodes.claim_info === undefined) {\n nodes.claim_info = { last_index: 0, total_claimed: 0 };\n }\n}\nfunction claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {\n // Try to find nodes in an order such that we lengthen the longest increasing subsequence\n init_claim_info(nodes);\n const resultNode = (() => {\n // We first try to find an element after the previous one\n for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n return node;\n }\n }\n // Otherwise, we try to find one before\n // We iterate in reverse so that we don't go too far back\n for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n else if (replacement === undefined) {\n // Since we spliced before the last_index, we decrease it\n nodes.claim_info.last_index--;\n }\n return node;\n }\n }\n // If we can't find any matching node, we create a new one\n return createNode();\n })();\n resultNode.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n return resultNode;\n}\nfunction claim_element_base(nodes, name, attributes, create_element) {\n return claim_node(nodes, (node) => node.nodeName === name, (node) => {\n const remove = [];\n for (let j = 0; j < node.attributes.length; j++) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n remove.forEach(v => node.removeAttribute(v));\n return undefined;\n }, () => create_element(name));\n}\nfunction claim_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, element);\n}\nfunction claim_svg_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, svg_element);\n}\nfunction claim_text(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 3, (node) => {\n const dataStr = '' + data;\n if (node.data.startsWith(dataStr)) {\n if (node.data.length !== dataStr.length) {\n return node.splitText(dataStr.length);\n }\n }\n else {\n node.data = dataStr;\n }\n }, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n );\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction claim_comment(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 8, (node) => {\n node.data = '' + data;\n return undefined;\n }, () => comment(data), true);\n}\nfunction find_comment(nodes, text, start) {\n for (let i = start; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n return i;\n }\n }\n return nodes.length;\n}\nfunction claim_html_tag(nodes, is_svg) {\n // find html opening tag\n const start_index = find_comment(nodes, 'HTML_TAG_START', 0);\n const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);\n if (start_index === end_index) {\n return new HtmlTagHydration(undefined, is_svg);\n }\n init_claim_info(nodes);\n const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n detach(html_tag_nodes[0]);\n detach(html_tag_nodes[html_tag_nodes.length - 1]);\n const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n for (const n of claimed_nodes) {\n n.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n }\n return new HtmlTagHydration(claimed_nodes, is_svg);\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n text.data = data;\n}\nfunction set_data_contenteditable(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n text.data = data;\n}\nfunction set_data_maybe_contenteditable(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable(text, data);\n }\n else {\n set_data(text, data);\n }\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n if (value == null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value, important ? 'important' : '');\n }\n}\nfunction select_option(select, value, mounting) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n if (!mounting || value !== undefined) {\n select.selectedIndex = -1; // no option should be selected\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked');\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_iframe_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n // see https://github.com/sveltejs/svelte/issues/4233\n fn();\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nconst resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'content-box' });\nconst resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'border-box' });\nconst resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'device-pixel-content-box' });\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nfunction head_selector(nodeId, head) {\n const result = [];\n let started = 0;\n for (const node of head.childNodes) {\n if (node.nodeType === 8 /* comment node */) {\n const comment = node.textContent.trim();\n if (comment === `HEAD_${nodeId}_END`) {\n started -= 1;\n result.push(node);\n }\n else if (comment === `HEAD_${nodeId}_START`) {\n started += 1;\n result.push(node);\n }\n }\n else if (started > 0) {\n result.push(node);\n }\n }\n return result;\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n /** #7364 target for <template> may be provided as #document-fragment(11) */\n else\n this.e = element((target.nodeType === 11 ? 'TEMPLATE' : target.nodeName));\n this.t = target.tagName !== 'TEMPLATE' ? target : target.content;\n this.c(html);\n }\n this.i(anchor);\n }\n h(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.nodeName === 'TEMPLATE' ? this.e.content.childNodes : this.e.childNodes);\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(this.t, this.n[i], anchor);\n }\n }\n p(html) {\n this.d();\n this.h(html);\n this.i(this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\nclass HtmlTagHydration extends HtmlTag {\n constructor(claimed_nodes, is_svg = false) {\n super(is_svg);\n this.e = this.n = null;\n this.l = claimed_nodes;\n }\n c(html) {\n if (this.l) {\n this.n = this.l;\n }\n else {\n super.c(html);\n }\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert_hydration(this.t, this.n[i], anchor);\n }\n }\n}\nfunction attribute_to_object(attributes) {\n const result = {};\n for (const attribute of attributes) {\n result[attribute.name] = attribute.value;\n }\n return result;\n}\nfunction get_custom_elements_slots(element) {\n const result = {};\n element.childNodes.forEach((node) => {\n result[node.slot || 'default'] = true;\n });\n return result;\n}\nfunction construct_svelte_component(component, props) {\n return new component(props);\n}\n\n// we need to store the information for multiple documents because a Svelte application could also contain iframes\n// https://github.com/sveltejs/svelte/issues/3624\nconst managed_styles = new Map();\nlet active = 0;\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_style_information(doc, node) {\n const info = { stylesheet: append_empty_stylesheet(node), rules: {} };\n managed_styles.set(doc, info);\n return info;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n const doc = get_root_for_style(node);\n const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node);\n if (!rules[name]) {\n rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n const previous = (node.style.animation || '').split(', ');\n const next = previous.filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n );\n const deleted = previous.length - next.length;\n if (deleted) {\n node.style.animation = next.join(', ');\n active -= deleted;\n if (!active)\n clear_rules();\n }\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n managed_styles.forEach(info => {\n const { ownerNode } = info.stylesheet;\n // there is no ownerNode if it runs on jsdom.\n if (ownerNode)\n detach(ownerNode);\n });\n managed_styles.clear();\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error('Function called outside component initialization');\n return current_component;\n}\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`\n *\n * https://svelte.dev/docs#run-time-svelte-beforeupdate\n */\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\n/**\n * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.\n * It must be called during the component's initialisation (but doesn't need to live *inside* the component;\n * it can be called from an external module).\n *\n * `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).\n *\n * https://svelte.dev/docs#run-time-svelte-onmount\n */\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`\n */\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * https://svelte.dev/docs#run-time-svelte-ondestroy\n */\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * https://svelte.dev/docs#run-time-svelte-createeventdispatcher\n */\nfunction createEventDispatcher() {\n const component = get_current_component();\n return (type, detail, { cancelable = false } = {}) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail, { cancelable });\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n return !event.defaultPrevented;\n }\n return true;\n };\n}\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-setcontext\n */\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n return context;\n}\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-getcontext\n */\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * https://svelte.dev/docs#run-time-svelte-getallcontexts\n */\nfunction getAllContexts() {\n return get_current_component().$$.context;\n}\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-hascontext\n */\nfunction hasContext(key) {\n return get_current_component().$$.context.has(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n // @ts-ignore\n callbacks.slice().forEach(fn => fn.call(this, event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nlet render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = /* @__PURE__ */ Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\nlet flushidx = 0; // Do *not* move this inside the flush() function\nfunction flush() {\n // Do not reenter flush while dirty components are updated, as this can\n // result in an infinite loop. Instead, let the inner flush handle it.\n // Reentrancy is ok afterwards for bindings etc.\n if (flushidx !== 0) {\n return;\n }\n const saved_component = current_component;\n do {\n // first, call beforeUpdate functions\n // and update components\n try {\n while (flushidx < dirty_components.length) {\n const component = dirty_components[flushidx];\n flushidx++;\n set_current_component(component);\n update(component.$$);\n }\n }\n catch (e) {\n // reset dirty state to not end up in a deadlocked state and then rethrow\n dirty_components.length = 0;\n flushidx = 0;\n throw e;\n }\n set_current_component(null);\n dirty_components.length = 0;\n flushidx = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n seen_callbacks.clear();\n set_current_component(saved_component);\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n/**\n * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.\n */\nfunction flush_render_callbacks(fns) {\n const filtered = [];\n const targets = [];\n render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));\n targets.forEach((c) => c());\n render_callbacks = filtered;\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n else if (callback) {\n callback();\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n const options = { direction: 'in' };\n let config = fn(node, params, options);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n started = true;\n delete_rule(node);\n if (is_function(config)) {\n config = config(options);\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n const options = { direction: 'out' };\n let config = fn(node, params, options);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config(options);\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n const options = { direction: 'both' };\n let config = fn(node, params, options);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = (program.b - t);\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program || pending_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config(options);\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = value;\n let child_ctx = info.ctx;\n if (key !== undefined) {\n child_ctx = child_ctx.slice();\n child_ctx[key] = value;\n }\n const block = type && (info.current = type)(child_ctx);\n let needs_flush = false;\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n if (info.blocks[i] === block) {\n info.blocks[i] = null;\n }\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n needs_flush = true;\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n if (needs_flush) {\n flush();\n }\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n if (!info.hasCatch) {\n throw error;\n }\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = promise;\n }\n}\nfunction update_await_block_branch(info, ctx, dirty) {\n const child_ctx = ctx.slice();\n const { resolved } = info;\n if (info.current === info.then) {\n child_ctx[info.value] = resolved;\n }\n if (info.current === info.catch) {\n child_ctx[info.error] = resolved;\n }\n info.block.p(child_ctx, dirty);\n}\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n const updates = [];\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n // defer updates until all the DOM shuffling is done\n updates.push(() => block.p(child_ctx, dirty));\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n run_all(updates);\n return new_blocks;\n}\nfunction validate_each_keys(ctx, list, get_context, get_key) {\n const keys = new Set();\n for (let i = 0; i < list.length; i++) {\n const key = get_key(get_context(ctx, list, i));\n if (keys.has(key)) {\n throw new Error('Cannot have duplicate keys in a keyed each');\n }\n keys.add(key);\n }\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\nconst _boolean_attributes = [\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected'\n];\n/**\n * List of HTML boolean attributes (e.g. `<input disabled>`).\n * Source: https://html.spec.whatwg.org/multipage/indices.html\n */\nconst boolean_attributes = new Set([..._boolean_attributes]);\n\n/** regex of all html void element names */\nconst void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;\nfunction is_void(name) {\n return void_element_names.test(name) || name.toLowerCase() === '!doctype';\n}\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args, attrs_to_add) {\n const attributes = Object.assign({}, ...args);\n if (attrs_to_add) {\n const classes_to_add = attrs_to_add.classes;\n const styles_to_add = attrs_to_add.styles;\n if (classes_to_add) {\n if (attributes.class == null) {\n attributes.class = classes_to_add;\n }\n else {\n attributes.class += ' ' + classes_to_add;\n }\n }\n if (styles_to_add) {\n if (attributes.style == null) {\n attributes.style = style_object_to_string(styles_to_add);\n }\n else {\n attributes.style = style_object_to_string(merge_ssr_styles(attributes.style, styles_to_add));\n }\n }\n }\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === true)\n str += ' ' + name;\n else if (boolean_attributes.has(name.toLowerCase())) {\n if (value)\n str += ' ' + name;\n }\n else if (value != null) {\n str += ` ${name}=\"${value}\"`;\n }\n });\n return str;\n}\nfunction merge_ssr_styles(style_attribute, style_directive) {\n const style_object = {};\n for (const individual_style of style_attribute.split(';')) {\n const colon_index = individual_style.indexOf(':');\n const name = individual_style.slice(0, colon_index).trim();\n const value = individual_style.slice(colon_index + 1).trim();\n if (!name)\n continue;\n style_object[name] = value;\n }\n for (const name in style_directive) {\n const value = style_directive[name];\n if (value) {\n style_object[name] = value;\n }\n else {\n delete style_object[name];\n }\n }\n return style_object;\n}\nconst ATTR_REGEX = /[&\"]/g;\nconst CONTENT_REGEX = /[&<]/g;\n/**\n * Note: this method is performance sensitive and has been optimized\n * https://github.com/sveltejs/svelte/pull/5701\n */\nfunction escape(value, is_attr = false) {\n const str = String(value);\n const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;\n pattern.lastIndex = 0;\n let escaped = '';\n let last = 0;\n while (pattern.test(str)) {\n const i = pattern.lastIndex - 1;\n const ch = str[i];\n escaped += str.substring(last, i) + (ch === '&' ? '&amp;' : (ch === '\"' ? '&quot;' : '&lt;'));\n last = i + 1;\n }\n return escaped + str.substring(last);\n}\nfunction escape_attribute_value(value) {\n // keep booleans, null, and undefined for the sake of `spread`\n const should_escape = typeof value === 'string' || (value && typeof value === 'object');\n return should_escape ? escape(value, true) : value;\n}\nfunction escape_object(obj) {\n const result = {};\n for (const key in obj) {\n result[key] = escape_attribute_value(obj[key]);\n }\n return result;\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots, context) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(context || (parent_component ? parent_component.$$.context : [])),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, { $$slots = {}, context = new Map() } = {}) => {\n on_destroy = [];\n const result = { title: '', head: '', css: new Set() };\n const html = $$render(result, props, {}, $$slots, context);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n const assignment = (boolean && value === true) ? '' : `=\"${escape(value, true)}\"`;\n return ` ${name}${assignment}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : '';\n}\nfunction style_object_to_string(style_object) {\n return Object.keys(style_object)\n .filter(key => style_object[key])\n .map(key => `${key}: ${escape_attribute_value(style_object[key])};`)\n .join(' ');\n}\nfunction add_styles(style_object) {\n const styles = style_object_to_string(style_object);\n return styles ? ` style=\"${styles}\"` : '';\n}\n\nfunction bind(component, name, callback) {\n const index = component.$$.props[name];\n if (index !== undefined) {\n component.$$.bound[index] = callback;\n callback(component.$$.ctx[index]);\n }\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction claim_component(block, parent_nodes) {\n block && block.l(parent_nodes);\n}\nfunction mount_component(component, target, anchor, customElement) {\n const { fragment, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n if (!customElement) {\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);\n // if the component was destroyed immediately\n // it will update the `$$.on_destroy` reference to `null`.\n // the destructured on_destroy may still reference to the old array\n if (component.$$.on_destroy) {\n component.$$.on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n }\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n flush_render_callbacks($$.after_update);\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const $$ = component.$$ = {\n fragment: null,\n ctx: [],\n // state\n props,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n on_disconnect: [],\n before_update: [],\n after_update: [],\n context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n // everything else\n callbacks: blank_object(),\n dirty,\n skip_bound: false,\n root: options.target || parent_component.$$.root\n };\n append_styles && append_styles($$.root);\n let ready = false;\n $$.ctx = instance\n ? instance(component, options.props || {}, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if (!$$.skip_bound && $$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n if (options.hydrate) {\n start_hydrating();\n const nodes = children(options.target);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.l(nodes);\n nodes.forEach(detach);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor, options.customElement);\n end_hydrating();\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement === 'function') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n const { on_mount } = this.$$;\n this.$$.on_disconnect = on_mount.map(run).filter(is_function);\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n disconnectedCallback() {\n run_all(this.$$.on_disconnect);\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n if (!is_function(callback)) {\n return noop;\n }\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n };\n}\n/**\n * Base class for Svelte components. Used when dev=false.\n */\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n if (!is_function(callback)) {\n return noop;\n }\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, Object.assign({ version: '3.59.2' }, detail), { bubbles: true }));\n}\nfunction append_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append(target, node);\n}\nfunction append_hydration_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append_hydration(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction insert_hydration_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert_hydration(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev('SvelteDOMRemove', { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation, has_stop_immediate_propagation) {\n const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n if (has_stop_immediate_propagation)\n modifiers.push('stopImmediatePropagation');\n dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });\n else\n dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev('SvelteDOMSetProperty', { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev('SvelteDOMSetDataset', { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction set_data_contenteditable_dev(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction set_data_maybe_contenteditable_dev(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable_dev(text, data);\n }\n else {\n set_data_dev(text, data);\n }\n}\nfunction validate_each_argument(arg) {\n if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {\n let msg = '{#each} only iterates over array-like objects.';\n if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {\n msg += ' You can use a spread to convert this iterable into an array.';\n }\n throw new Error(msg);\n }\n}\nfunction validate_slots(name, slot, keys) {\n for (const slot_key of Object.keys(slot)) {\n if (!~keys.indexOf(slot_key)) {\n console.warn(`<${name}> received an unexpected slot \"${slot_key}\".`);\n }\n }\n}\nfunction validate_dynamic_element(tag) {\n const is_string = typeof tag === 'string';\n if (tag && !is_string) {\n throw new Error('<svelte:element> expects \"this\" attribute to be a string.');\n }\n}\nfunction validate_void_dynamic_element(tag) {\n if (tag && is_void(tag)) {\n console.warn(`<svelte:element this=\"${tag}\"> is self-closing and cannot have content.`);\n }\n}\nfunction construct_svelte_component_dev(component, props) {\n const error_message = 'this={...} of <svelte:component> should specify a Svelte component.';\n try {\n const instance = new component(props);\n if (!instance.$$ || !instance.$set || !instance.$on || !instance.$destroy) {\n throw new Error(error_message);\n }\n return instance;\n }\n catch (err) {\n const { message } = err;\n if (typeof message === 'string' && message.indexOf('is not a constructor') !== -1) {\n throw new Error(error_message);\n }\n else {\n throw err;\n }\n }\n}\n/**\n * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.\n */\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(\"'target' is a required option\");\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn('Component was already destroyed'); // eslint-disable-line no-console\n };\n }\n $capture_state() { }\n $inject_state() { }\n}\n/**\n * Base class to create strongly typed Svelte components.\n * This only exists for typing purposes and should be used in `.d.ts` files.\n *\n * ### Example:\n *\n * You have component library on npm called `component-library`, from which\n * you export a component called `MyComponent`. For Svelte+TypeScript users,\n * you want to provide typings. Therefore you create a `index.d.ts`:\n * ```ts\n * import { SvelteComponentTyped } from \"svelte\";\n * export class MyComponent extends SvelteComponentTyped<{foo: string}> {}\n * ```\n * Typing this makes it possible for IDEs like VS Code with the Svelte extension\n * to provide intellisense and to use the component like this in a Svelte file\n * with TypeScript:\n * ```svelte\n * <script lang=\"ts\">\n * \timport { MyComponent } from \"component-library\";\n * </script>\n * <MyComponent foo={'bar'} />\n * ```\n *\n * #### Why not make this part of `SvelteComponent(Dev)`?\n * Because\n * ```ts\n * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}\n * const component: typeof SvelteComponent = ASubclassOfSvelteComponent;\n * ```\n * will throw a type error, so we need to separate the more strictly typed class.\n */\nclass SvelteComponentTyped extends SvelteComponentDev {\n constructor(options) {\n super(options);\n }\n}\nfunction loop_guard(timeout) {\n const start = Date.now();\n return () => {\n if (Date.now() - start > timeout) {\n throw new Error('Infinite loop detected');\n }\n };\n}\n\nexport { HtmlTag, HtmlTagHydration, ResizeObserverSingleton, SvelteComponent, SvelteComponentDev, SvelteComponentTyped, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_iframe_resize_listener, add_location, add_render_callback, add_styles, add_transform, afterUpdate, append, append_dev, append_empty_stylesheet, append_hydration, append_hydration_dev, append_styles, assign, attr, attr_dev, attribute_to_object, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_comment, claim_component, claim_element, claim_html_tag, claim_space, claim_svg_element, claim_text, clear_loops, comment, component_subscribe, compute_rest_props, compute_slots, construct_svelte_component, construct_svelte_component_dev, contenteditable_truthy_values, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, end_hydrating, escape, escape_attribute_value, escape_object, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, flush_render_callbacks, getAllContexts, getContext, get_all_dirty_from_scope, get_binding_group_value, get_current_component, get_custom_elements_slots, get_root_for_style, get_slot_changes, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, hasContext, has_prop, head_selector, identity, init, init_binding_group, init_binding_group_dynamic, insert, insert_dev, insert_hydration, insert_hydration_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, is_void, listen, listen_dev, loop, loop_guard, merge_ssr_styles, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, resize_observer_border_box, resize_observer_content_box, resize_observer_device_pixel_content_box, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_custom_element_data_map, set_data, set_data_contenteditable, set_data_contenteditable_dev, set_data_dev, set_data_maybe_contenteditable, set_data_maybe_contenteditable_dev, set_dynamic_element_data, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, split_css_unit, spread, src_url_equal, start_hydrating, stop_immediate_propagation, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, trusted, update_await_block_branch, update_keyed_each, update_slot, update_slot_base, validate_component, validate_dynamic_element, validate_each_argument, validate_each_keys, validate_slots, validate_store, validate_void_dynamic_element, xlink_attr };\n","// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nmodule.exports = function(style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function(node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n var errorsList = [];\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) {\n errorsList.push(err);\n } else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n};\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n","var parse = require('inline-style-parser');\n\n/**\n * Parses inline style to object.\n *\n * @example\n * // returns { 'line-height': '42' }\n * StyleToObject('line-height: 42;');\n *\n * @param {String} style - The inline style.\n * @param {Function} [iterator] - The iterator function.\n * @return {null|Object}\n */\nfunction StyleToObject(style, iterator) {\n var output = null;\n if (!style || typeof style !== 'string') {\n return output;\n }\n\n var declaration;\n var declarations = parse(style);\n var hasIterator = typeof iterator === 'function';\n var property;\n var value;\n\n for (var i = 0, len = declarations.length; i < len; i++) {\n declaration = declarations[i];\n property = declaration.property;\n value = declaration.value;\n\n if (hasIterator) {\n iterator(property, value, declaration);\n } else if (value) {\n output || (output = {});\n output[property] = value;\n }\n }\n\n return output;\n}\n\nmodule.exports = StyleToObject;\n","\"use strict\";\nexports.__esModule = true;\nexports.LanguageTranslator = exports.addComponent = exports.getChildStyleToPass = void 0;\nfunction getChildStyleToPass(parsedStyle, vars) {\n var _a, _b;\n var toreturn = \"\";\n if (parsedStyle &&\n (vars === null || vars === void 0 ? void 0 : vars.length) &&\n ((_a = Object.keys(parsedStyle)) === null || _a === void 0 ? void 0 : _a.length) &&\n ((_b = vars === null || vars === void 0 ? void 0 : vars.filter(function (f) { return Object.keys(parsedStyle).includes(f.name); })) === null || _b === void 0 ? void 0 : _b.length)) {\n var _loop_1 = function (k) {\n var isPresent = vars === null || vars === void 0 ? void 0 : vars.filter(function (f) { return f.name === k && f.defaultValue !== parsedStyle[k]; });\n if (isPresent) {\n toreturn += \"\".concat(k, \":\").concat(parsedStyle[k], \";\");\n }\n };\n for (var _i = 0, _c = Object.keys(parsedStyle); _i < _c.length; _i++) {\n var k = _c[_i];\n _loop_1(k);\n }\n }\n return toreturn;\n}\nexports.getChildStyleToPass = getChildStyleToPass;\nfunction addComponent(opts) {\n var _a;\n var componentName = ((_a = opts === null || opts === void 0 ? void 0 : opts.repoName.split(\"/\")) === null || _a === void 0 ? void 0 : _a[1]) || (opts === null || opts === void 0 ? void 0 : opts.repoName);\n if (!componentName)\n throw new Error(\"wrong componentPath \" + (opts === null || opts === void 0 ? void 0 : opts.repoName));\n if (!(opts === null || opts === void 0 ? void 0 : opts.version))\n throw new Error(\"wrong version \" + (opts === null || opts === void 0 ? void 0 : opts.version));\n var iifePath = (opts === null || opts === void 0 ? void 0 : opts.iifePath) || \"release/release.js\";\n if (!document.getElementById(componentName + \"-script\")) {\n try {\n var script = document.createElement(\"script\");\n script.id = componentName + \"-script\";\n script.src = \"https://cdn.jsdelivr.net/npm/\".concat(opts.repoName, \"@\").concat(opts.version, \"/\").concat(iifePath);\n if ((opts === null || opts === void 0 ? void 0 : opts.local) && location.href.includes(\"localhost\")) {\n script.src = \"\".concat(opts.local);\n }\n document.head.appendChild(script);\n }\n catch (err) {\n console.warn(err);\n }\n }\n}\nexports.addComponent = addComponent;\nvar LanguageTranslator = /** @class */ (function () {\n function LanguageTranslator(opts) {\n if (!(opts === null || opts === void 0 ? void 0 : opts.dictionary))\n throw new Error(\"no dictionary provided\");\n this.dictionary = opts.dictionary;\n this.setLang(opts === null || opts === void 0 ? void 0 : opts.lang);\n }\n LanguageTranslator.prototype.setLang = function (lang) {\n if (!lang)\n lang = LanguageTranslator.getDefaultLang();\n this.lang = lang;\n };\n LanguageTranslator.prototype.translateWord = function (wordKey, lang) {\n return LanguageTranslator.getDictionaryWord(wordKey, this.dictionary, lang || this.lang);\n };\n LanguageTranslator.prototype.translateDate = function (dateISOString, timeOptions, lang) {\n return LanguageTranslator.formatDate(dateISOString, timeOptions, lang || this.lang);\n };\n LanguageTranslator.getDefaultLang = function () {\n var _a, _b, _c, _d, _e;\n var browserLang = \"en\";\n if ((navigator === null || navigator === void 0 ? void 0 : navigator.languages) &&\n ((_c = (_b = (_a = navigator.languages[0]) === null || _a === void 0 ? void 0 : _a.split(\"-\")[0]) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === null || _c === void 0 ? void 0 : _c.length)) {\n browserLang = (_e = (_d = navigator.languages[0]) === null || _d === void 0 ? void 0 : _d.split(\"-\")[0]) === null || _e === void 0 ? void 0 : _e.toLowerCase();\n }\n return browserLang;\n };\n LanguageTranslator.getDictionaryWord = function (wordKey, dictionary, lang) {\n var _a;\n if (!wordKey)\n throw new Error(\"no wordKey provided\");\n if (!dictionary)\n throw new Error(\"no dictionary provided\");\n if (lang && ((_a = dictionary[lang]) === null || _a === void 0 ? void 0 : _a[wordKey]))\n return dictionary[lang][wordKey];\n var w = \"\";\n var defLng = LanguageTranslator.getDefaultLang();\n if (!lang || defLng !== lang) {\n var defaultLng = dictionary === null || dictionary === void 0 ? void 0 : dictionary[defLng];\n if (defaultLng === null || defaultLng === void 0 ? void 0 : defaultLng[wordKey]) {\n w = defaultLng[wordKey];\n }\n }\n return w;\n };\n LanguageTranslator.formatDate = function (dateISOString, timeOptions, lang) {\n if (!dateISOString)\n throw new Error(\"no date provided\");\n if (typeof dateISOString.getMonth !== \"function\") {\n throw new Error(\"wrong date format\");\n }\n var dayDateFormat = new Intl.DateTimeFormat(lang || LanguageTranslator.getDefaultLang(), timeOptions);\n return dayDateFormat.format(dateISOString);\n };\n return LanguageTranslator;\n}());\nexports.LanguageTranslator = LanguageTranslator;\n//# sourceMappingURL=main.js.map","export var storybookArgs = {\n background_color: { control: { type: \"text\" } },\n pen_color: { control: { type: \"text\" } },\n pen_opacity: { control: { type: \"range\", min: 0, max: 1, step: 0.1 } },\n debug: {\n options: [\"yes\", \"no\"],\n control: { type: \"select\" }\n },\n save_as: { control: { type: \"object\" } },\n options: { control: { type: \"object\" } },\n size: { control: { type: \"object\" } },\n view: { control: { type: \"object\" } },\n goto: { control: { type: \"number\" } },\n mode: {\n options: [\"eraser\", \"draw\", \"select\"],\n control: { type: \"radio\" }\n },\n load_draw: { control: { type: \"object\" } },\n insert_text: { control: { type: \"object\" } },\n insert_image: { control: { type: \"object\" } },\n startStroke: { action: \"startStrokeEvent\" },\n beginStroke: { action: \"beginStrokeEvent\" },\n endStroke: { action: \"endStrokeEvent\" },\n selection: { action: \"selectionEvent\" },\n historyIndex: { action: \"historyIndexEvent\" },\n changeIndex: { action: \"changeIndexEvent\" },\n save: { action: \"saveEvent\" },\n drawLoaded: { action: \"drawLoadedEvent\" },\n imageLoaded: { action: \"imageLoadedEvent\" },\n txtLoaded: { action: \"txtLoadedEvent\" }\n};\nvar cssVars = [];\nexport var cssParts = [];\nexport var htmlSlots = [];\nexport var i18nLanguages = [];\nexport var styleSetup = {\n vars: cssVars,\n parts: cssParts\n};\nvar examples = [\n {\n name: \"default\",\n data: {}\n },\n {\n name: \"withPressure\",\n data: {\n options: {\n simulatePressure: false\n }\n }\n },\n {\n name: \"withSimulatePressure\",\n data: {\n options: {\n simulatePressure: true\n }\n }\n },\n {\n name: \"ThinBrushOnBackground\",\n data: {\n background_color: \"rgb(200,200,200)\",\n pen_color: \"rgb(100,100,100)\",\n options: {\n size: 2,\n thinning: 0.7,\n smoothing: 0.5,\n streamline: 0.5\n }\n }\n },\n {\n name: \"BigBrushColor\",\n data: {\n pen_color: \"rgb(100,100,100)\",\n options: {\n size: 16,\n thinning: 0.7,\n smoothing: 0.5,\n streamline: 0.5\n }\n }\n },\n {\n name: \"LoadDraw\",\n data: {\n load_draw: {\n type: \"json\",\n draw: [\n {\n path: [\n [196, 57, 0.5],\n [198, 57, 0.5],\n [202, 57, 0.5],\n [219, 57, 0.5],\n [223, 57, 0.5],\n ],\n color: \"rgb(0,0,0)\",\n id: \"1671124484963\",\n pathData: \"M 196 54.28875 Q 196 54.28875 202.6125 54.537796875 209.225 54.78684375 209.57834293663552 54.84477326089788 209.93168587327105 54.90270277179576 210.24803371116735 55.07042606940648 210.56438154906365 55.2381493670172 210.81061258608528 55.49810577780627 211.05684362310691 55.75806218859534 211.20717740467902 56.083034207731316 211.35751118625112 56.408006226867286 211.3962077257588 56.76396919816234 211.43490426526654 57.11993216945741 211.3579120248085 57.46961667585187 211.2809197843505 57.81930118224632 211.09629987182666 58.12609516361293 210.91167995930283 58.43288914497954 210.6387621282894 58.664671190483475 210.3658442972759 58.8964532359874 210.03320311672323 59.02895570427987 209.70056193617054 59.161458172572345 209.34302502549124 59.18080802024588 208.98548811481194 59.200157867919415 208.64048968293474 59.104329160814736 208.29549125105754 59.008500453710056 207.99915272487073 58.80752648275734 207.7028141986839 58.60655251180463 207.48616230010498 58.3214753048146 207.26951040152608 58.03639809782457 207.15522864152683 57.69706531362217 207.0409468815276 57.35773252941976 207.0410005905474 56.999672400086126 207.0410542995672 56.64161227075248 207.1554378542575 56.30231378634754 207.2698214089478 55.96301530194259 207.48655882093817 55.67800310334964 207.70329623292858 55.39299090475669 207.99969503797055 55.192105844404324 208.29609384301253 54.99122078405196 208.6411210079765 54.89549558078758 208.98614817294046 54.7997703775232 209.34367926257636 54.81922748539759 209.70121035221229 54.838684593271985 210.03381176705625 54.97128684795452 210.36641318190019 55.10388910263704 210.63926146601972 55.335753013058856 210.91210975013928 55.56761692348067 211.09663761616218 55.87446627701448 211.2811654821851 56.18131563054828 211.35805281382812 56.53102321887873 211.43494014547116 56.880730807209176 211.396136818815 57.23668215352423 211.35733349215883 57.59263349983927 211.20690222574746 57.91756040421771 211.0564709593361 58.24248730859615 210.81016194647282 58.50236983837718 210.56385293360952 58.762252368158215 210.24745479296035 58.929880753871444 209.93105665231116 59.097509139584666 209.57769635272305 59.15533264499632 209.22433605313495 59.21315615040797 209.22466802656749 59.21315620020398 209.225 59.21315625 202.6125 59.462203125 196 59.71125 195.67556757774054 59.67185550565311 195.35113515548107 59.63246101130623 195.04555876084675 59.51656713812797 194.7399823662124 59.400673264949695 194.47102211361675 59.215015770294414 194.2020618610211 59.02935827563913 193.98534973298206 58.78472758181928 193.76863760494302 58.54009688799943 193.6167689205244 58.25071094243375 193.46490023610576 57.961324996868065 193.38670161038146 57.64400292430956 193.3085029846572 57.326680851751064 193.3085193254285 56.99986542596616 193.30853566619982 56.673050000181256 193.3867660237403 56.355735749071926 193.4649963812808 56.038421497962595 193.61689400353458 55.749050740712256 193.76879162578837 55.45967998346192 193.9855282158132 55.21507096207799 194.202264805838 54.97046194069406 194.4712436228383 54.78483134299228 194.74022243983856 54.5992007452905 195.04581042233232 54.48333743033112 195.35139840482609 54.36747411537173 195.67583476491282 54.328112064463994 196.00027112499956 54.28875001355625 196.0001355624998 54.28875000677813 Z\",\n min: [196, 57],\n max: [223, 57],\n visible: true,\n actionIndex: 0,\n opacity: 1,\n type: \"stroke\"\n },\n ],\n id: \"stylus-paper\",\n draw_id: \"0.wh3036wc7x0.fevf9p1uqkg1671124483602\",\n name: \"test\",\n version: 0,\n size: { paperSize: \"A4\" }\n },\n options: {\n size: 16,\n thinning: 0.7,\n smoothing: 0.5,\n streamline: 0.5\n }\n }\n },\n {\n name: \"LoadImage\",\n data: {\n insert_image: {\n name: \"test\",\n type: \"jpeg\",\n base64: \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD//gATQ3JlYXRlZCB3aXRoIEdJTVD/4gKwSUNDX1BST0ZJTEUAAQEAAAKgbGNtcwQwAABtbnRyUkdCIFhZWiAH5gAMABMAFgA1ACZhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1kZXNjAAABIAAAAEBjcHJ0AAABYAAAADZ3dHB0AAABmAAAABRjaGFkAAABrAAAACxyWFlaAAAB2AAAABRiWFlaAAAB7AAAABRnWFlaAAACAAAAABRyVFJDAAACFAAAACBnVFJDAAACFAAAACBiVFJDAAACFAAAACBjaHJtAAACNAAAACRkbW5kAAACWAAAACRkbWRkAAACfAAAACRtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACQAAAAcAEcASQBNAFAAIAB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yHA0G8Or6EGSICypqS0/wD/2gAMAwEAAgADAAAAEJJJJJJJJBJJIBJJJJJJJJJJJJ//xAAUEQEAAAAAAAAAAAAAAAAAAABQ/9oACAEDAQE/EEf/xAAUEQEAAAAAAAAAAAAAAAAAAABQ/9oACAECAQE/EEf/xAAaEAEBAAIDAAAAAAAAAAAAAAABEQAhIEBB/9oACAEBAAE/EOgST/W2CARo+8WozTj3oIJEXW8dSmNrygthen//2Q==\"\n }\n }\n },\n {\n name: \"LoadTxt\",\n data: {\n insert_text: {\n name: \"test\",\n content: \"ciao\"\n }\n }\n },\n];\nexport var componentSetup = {\n definitions: null,\n storybookArgs: storybookArgs,\n styleSetup: styleSetup,\n author: null,\n contributors: [],\n owner: null,\n htmlSlots: htmlSlots,\n i18n: i18nLanguages,\n examples: examples,\n screenshots: [],\n licenses: [{ type: \"Apache-2.0\", path: \"LICENSE.md\", cost: 0, currency: \"EUR\" }],\n readmePath: \"README.md\",\n name: \"hb-stylus-paper\",\n category: \"input\",\n tags: [\"draw\", \"input\", \"stylus\", \"paper\"],\n size: { layout: \"fullscreen\" },\n iifePath: \"release/release.js\",\n repoName: \"@htmlbricks/hb-stylus-paper\",\n version: null\n};\n//# sourceMappingURL=docs.js.map","export var storybookArgs = {\n schemaentry: { control: { type: \"object\" } },\n show_validation: { control: { type: \"boolean\" } },\n set_valid: { control: { type: \"boolean\" } },\n set_value: { control: { type: \"boolean\" } },\n setValid: { action: \"setValid\" },\n setValue: { action: \"setValue\" }\n};\nvar cssVars = [\n { name: \"--bs-primary\", valueType: \"color\", theme: \"bootstrap\", defaultValue: \"#07689f\" },\n { name: \"--bs-secondary\", valueType: \"color\", theme: \"bootstrap\", defaultValue: \"#c9d6df\" },\n { name: \"--bs-success\", valueType: \"color\", theme: \"bootstrap\", defaultValue: \"#11d3bc\" },\n { name: \"--bs-info\", valueType: \"color\", theme: \"bootstrap\", defaultValue: \"#a2d5f2\" },\n { name: \"--bs-warning\", valueType: \"color\", theme: \"bootstrap\", defaultValue: \"#ffc107\" },\n { name: \"--bs-danger\", valueType: \"color\", theme: \"bootstrap\", defaultValue: \"#f67280\" },\n];\nexport var cssParts = [{ name: \"invalid-feedback\", description: \"\" }];\nexport var htmlSlots = [];\nexport var i18nLanguages = [];\nexport var styleSetup = {\n vars: cssVars,\n parts: cssParts\n};\nvar examples = [\n {\n name: \"default\",\n data: {\n schemaentry: {\n placeholder: \"Insert your last name here...\",\n id: \"lastName\",\n required: true,\n label: \"Last Name\",\n validationTip: \"This field cannot be empty.\"\n }\n }\n },\n {\n name: \"image\",\n data: {\n schemaentry: {\n placeholder: \"Insert your last name here...\",\n id: \"lastName\",\n required: true,\n label: \"Last Name\",\n validationTip: \"This field cannot be empty.\",\n params: {\n accept: \"image/*\",\n placeHolderImage: { src: \"https://via.placeholder.com/150\", width: 300, height: 300 }\n }\n }\n }\n },\n];\nexport var componentSetup = {\n definitions: null,\n storybookArgs: storybookArgs,\n styleSetup: styleSetup,\n author: null,\n contributors: [],\n owner: null,\n htmlSlots: htmlSlots,\n i18n: i18nLanguages,\n examples: examples,\n screenshots: [],\n licenses: [{ type: \"Apache-2.0\", path: \"LICENSE.md\", cost: 0, currency: \"EUR\" }],\n readmePath: \"README.md\",\n name: \"hb-input-file\",\n category: \"input\",\n tags: [\"input\"],\n size: {},\n iifePath: \"release/release.js\",\n repoName: \"@htmlbricks/hb-input-file\",\n version: null\n};\n//# sourceMappingURL=docs.js.map","<svelte:options tag=\"hb-stylus-notebook\" />\n\n<script lang=\"ts\">\n\timport { get_current_component, onDestroy, onMount } from \"svelte/internal\";\n\timport pkg from \"../../package.json\";\n\n\timport { createEventDispatcher } from \"svelte\";\n\timport parseStyle from \"style-to-object\";\n\timport { addComponent, getChildStyleToPass } from \"wc-js-utils/main\";\n\timport type { Component } from \"@app/types/webcomponent.type\";\n\timport { styleSetup as stylePaperSetup } from \"@htmlbricks/hb-stylus-paper/release/docs\";\n\timport { styleSetup as styleInputFileSetup } from \"@htmlbricks/hb-input-file/release/docs\";\n\timport type { Component as paperComponent, Events as paperEvents } from \"@htmlbricks/hb-stylus-paper/release/webcomponent.type\";\n\timport type { Component as inputFileComponent, Events as inputFileEvents } from \"@htmlbricks/hb-input-file/release/webcomponent.type\";\n\n\tconst component = get_current_component();\n\tconst svelteDispatch = createEventDispatcher();\n\n\tfunction dispatch(name: string, detail: any) {\n\t\tsvelteDispatch(name, detail);\n\t\tcomponent.dispatchEvent && component.dispatchEvent(new CustomEvent(name, { detail }));\n\t}\n\n\texport let id: string;\n\texport let style: string;\n\n\tlet mode: paperComponent[\"mode\"] = \"draw\";\n\n\tlet parsedStyle: { [x: string]: string };\n\tlet stylusPaperStyleToSet: string = \"\";\n\tlet inputFileStyleToSet: string = \"\";\n\n\tlet historyIndex: number;\n\tlet changeHistoryIndex: number;\n\n\tlet enableUndo: boolean = false;\n\tlet enableRedo: boolean;\n\tlet started = false;\n\tlet save_as: paperComponent[\"save_as\"];\n\tlet insert_image: paperComponent[\"insert_image\"];\n\tlet insert_text: paperComponent[\"insert_text\"];\n\n\texport let load_draw: Component[\"load_draw\"];\n\tlet start_index: number;\n\n\t$: {\n\t\tif (!id) id = \"\";\n\t\tif (style) {\n\t\t\tparsedStyle = parseStyle(style);\n\t\t\tstylusPaperStyleToSet = getChildStyleToPass(parsedStyle, stylePaperSetup?.vars);\n\t\t\tinputFileStyleToSet = getChildStyleToPass(parsedStyle, styleInputFileSetup?.vars);\n\t\t}\n\n\t\tif (!historyIndex && historyIndex !== 0) historyIndex = 0;\n\n\t\tif ((changeHistoryIndex === 0 || changeHistoryIndex) && changeHistoryIndex < historyIndex) enableRedo = true;\n\t\telse enableRedo = false;\n\n\t\tif (\n\t\t\t(historyIndex || historyIndex === 0) &&\n\t\t\tstarted &&\n\t\t\t(!changeHistoryIndex || changeHistoryIndex !== -1) &&\n\t\t\t(!start_index || (start_index < historyIndex && (!changeHistoryIndex || changeHistoryIndex < start_index)))\n\t\t)\n\t\t\tenableUndo = true;\n\t\telse enableUndo = false;\n\n\t\tif (typeof load_draw === \"string\" && (load_draw as string)?.length) {\n\t\t\ttry {\n\t\t\t\tload_draw = JSON.parse(load_draw);\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(\"error parsing json\", err);\n\t\t\t}\n\t\t} else if (!load_draw) {\n\t\t\tload_draw = null;\n\t\t}\n\t}\n\taddComponent({ repoName: \"@htmlbricks/hb-stylus-paper\", version: pkg.version });\n\taddComponent({ repoName: \"@htmlbricks/hb-input-file\", version: pkg.version });\n\n\tonMount(() => {\n\t\tconsole.log(component.shadowRoot.getElementById(\"skeletontest\"));\n\t});\n\n\tfunction downloadObjectAsJson(exportObj: any, exportName: string) {\n\t\tvar dataStr = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(exportObj));\n\t\tvar downloadAnchorNode = document.createElement(\"a\");\n\t\tdownloadAnchorNode.setAttribute(\"href\", dataStr);\n\t\tdownloadAnchorNode.setAttribute(\"download\", exportName);\n\t\tdocument.body.appendChild(downloadAnchorNode); // required for firefox\n\t\tdownloadAnchorNode.click();\n\t\tdownloadAnchorNode.remove();\n\t}\n\n\tfunction changeMode(name: paperComponent[\"mode\"]) {\n\t\tmode = name;\n\t}\n\tfunction undo() {\n\t\tconsole.log(\"ch\", historyIndex, changeHistoryIndex);\n\t\tif (historyIndex >= 0 && (!changeHistoryIndex || changeHistoryIndex > -1)) {\n\t\t\tchangeHistoryIndex = changeHistoryIndex || changeHistoryIndex === 0 ? changeHistoryIndex - 1 : historyIndex - 1;\n\t\t\tconsole.log(\"undo\", historyIndex, changeHistoryIndex);\n\t\t}\n\t}\n\tfunction redo() {\n\t\tconsole.log(historyIndex, changeHistoryIndex);\n\n\t\tif ((changeHistoryIndex || changeHistoryIndex === 0) && changeHistoryIndex <= historyIndex) {\n\t\t\tchangeHistoryIndex++;\n\t\t\t// if (changeHistoryIndex === historyIndex - 2) changeHistoryIndex = historyIndex - 1;\n\t\t\tconsole.log(\"redo\", historyIndex, changeHistoryIndex);\n\t\t}\n\t}\n\tfunction onHistoryIndexChange(details: { index: number; start_index?: number }) {\n\t\tif (!started) started = true;\n\t\tconsole.log(\"h\", details);\n\t\thistoryIndex = details.index - 1;\n\t\tif (details.start_index) start_index = details.start_index;\n\n\t\tchangeHistoryIndex = null;\n\t}\n\tfunction save() {\n\t\tsave_as = {\n\t\t\tname: \"test\",\n\t\t\ttype: \"json\",\n\t\t};\n\t}\n\n\tfunction onFileInsertLoaded(e: inputFileEvents[\"setValue\"]) {\n\t\tconst fileName = (e.value as unknown as File)?.name;\n\t\tif (fileName) {\n\t\t\tconst reader = new FileReader();\n\t\t\treader.readAsDataURL(e.value as unknown as Blob);\n\n\t\t\treader.onload = function (evt) {\n\t\t\t\ttry {\n\t\t\t\t\t// load_draw = evt.target.result.toString();\n\t\t\t\t\tconsole.log(\"insert file\", evt.target, evt.target?.result);\n\t\t\t\t\tif (evt.target?.result) {\n\t\t\t\t\t\tconst imageBase64 = evt.target.result.toString();\n\t\t\t\t\t\tconst imageType = imageBase64.split(\";\")[0].split(\"/\")[1] as \"png\" | \"jpg\";\n\n\t\t\t\t\t\tinsert_image = {\n\t\t\t\t\t\t\tbase64: evt.target.result.toString(),\n\t\t\t\t\t\t\ttype: imageType,\n\t\t\t\t\t\t\tname: fileName,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\t// insert_object=\"\"\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.error(\"error loading file\");\n\t\t\t\t}\n\t\t\t};\n\t\t\treader.onerror = function (evt) {\n\t\t\t\tconsole.error(\"error reading file\");\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction onPaperSave(e: paperEvents[\"save\"]) {\n\t\tconsole.log(\"save\", e);\n\t\tsave_as = null;\n\t\tdownloadObjectAsJson(e, e.name + \".json\");\n\t}\n\n\tfunction onDrawLoaded(e: inputFileEvents[\"setValue\"]) {\n\t\tconsole.log(\"file\", e);\n\t\tif ((e.value as unknown as File).name) {\n\t\t\tconst reader = new FileReader();\n\t\t\treader.readAsText(e.value as unknown as Blob, \"UTF-8\");\n\n\t\t\treader.onload = function (evt) {\n\t\t\t\ttry {\n\t\t\t\t\tload_draw = JSON.parse(evt.target.result.toString());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.error(\"error loading file\");\n\t\t\t\t}\n\t\t\t};\n\t\t\treader.onerror = function (evt) {\n\t\t\t\tconsole.error(\"error reading file\");\n\t\t\t};\n\t\t}\n\t}\n</script>\n\n<div part=\"controller\" id=\"controller\">\n\t<button on:click={() => changeMode(\"eraser\")}>clear</button>\n\t<button on:click={() => changeMode(\"select\")}>select</button>\n\t<button on:click={() => changeMode(\"draw\")}>draw</button>\n\t<button on:click={() => undo()} disabled={!enableUndo}>undo</button>\n\t<button on:click={() => redo()} disabled={!enableRedo}>redo</button>\n\t<!-- <button on:click={() => load()}>load</button> -->\n\t<button on:click={() => save()} disabled={!enableUndo}>save</button>\n\t<button disabled={mode !== \"draw\"}>brush</button>\n\t<br />load:<hb-input-file\n\t\tid=\"loadfile\"\n\t\tstyle={inputFileStyleToSet}\n\t\ton:setValue={(e) => onDrawLoaded(e.detail)}\n\t\tschemaentry={JSON.stringify({ label: \"ciao\", id: \"xxxxxxx\" })}\n\t/>\n\tinsert:<hb-input-file\n\t\tid=\"insertfile\"\n\t\tstyle={inputFileStyleToSet}\n\t\ton:setValue={(e) => onFileInsertLoaded(e.detail)}\n\t\tschemaentry={JSON.stringify({ label: \"ciao\" })}\n\t/>\n</div>\n<div part=\"paper-container\" id=\"paper-container\" style=\"position:relative\">\n\t<hb-stylus-paper\n\t\tid=\"stylus-paper\"\n\t\tgoto={changeHistoryIndex}\n\t\tstyle={stylusPaperStyleToSet}\n\t\tbackground_color=\"green\"\n\t\t{mode}\n\t\tsave_as={JSON.stringify(save_as)}\n\t\tload_draw={load_draw ? JSON.stringify(load_draw) : null}\n\t\tinsert_image={insert_image ? JSON.stringify(insert_image) : null}\n\t\tinsert_text={insert_text ? JSON.stringify(insert_text) : null}\n\t\ton:historyIndex={(e) => onHistoryIndexChange(e.detail)}\n\t\ton:save={(e) => onPaperSave(e.detail)}\n\t/>\n</div>\n\n<style lang=\"scss\">\n\t@import \"../styles/webcomponent.scss\";\n\t// @import \"../styles/bootstrap.scss\";\n</style>\n"],"names":["noop","run","fn","blank_object","Object","create","run_all","fns","forEach","is_function","thing","safe_not_equal","a","b","append","target","node","appendChild","insert","anchor","insertBefore","detach","parentNode","removeChild","element","name","document","createElement","text","data","createTextNode","space","listen","event","handler","options","addEventListener","removeEventListener","attr","attribute","value","removeAttribute","getAttribute","setAttribute","set_custom_element_data","prop","attribute_to_object","attributes","result","current_component","set_current_component","component","get_current_component","Error","createEventDispatcher","type","detail","cancelable","callbacks","$$","bubbles","e","createEvent","initCustomEvent","custom_event","slice","call","defaultPrevented","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","Promise","resolve","update_scheduled","add_render_callback","push","seen_callbacks","Set","flushidx","flush","saved_component","length","update","pop","i","callback","has","add","clear","fragment","before_update","dirty","p","ctx","after_update","outroing","destroy_component","detaching","filtered","targets","c","indexOf","flush_render_callbacks","on_destroy","d","make_dirty","then","fill","init","instance","create_fragment","not_equal","props","append_styles","parent_component","bound","on_mount","on_disconnect","context","Map","skip_bound","root","ready","ret","rest","hydrate","nodes","Array","from","childNodes","children","l","intro","block","delete","local","customElement","m","new_on_destroy","map","filter","mount_component","SvelteElement","HTMLElement","constructor","super","this","attachShadow","mode","connectedCallback","key","slotted","attributeChangedCallback","_oldValue","newValue","disconnectedCallback","$destroy","$on","index","splice","$set","$$props","obj","$$set","keys","COMMENT_REGEX","NEWLINE_REGEX","WHITESPACE_REGEX","PROPERTY_REGEX","COLON_REGEX","VALUE_REGEX","SEMICOLON_REGEX","TRIM_REGEX","EMPTY_STRING","trim","str","replace","styleToObject","style","iterator","declaration","output","property","declarations","TypeError","lineno","column","updatePosition","lines","match","lastIndexOf","position","start","line","Position","whitespace","end","source","error","msg","err","reason","filename","silent","re","exec","comments","rules","comment","pos","charAt","val","prototype","content","decl","decls","parse","hasIterator","len","exports","__esModule","LanguageTranslator","addComponent","getChildStyleToPass","parsedStyle","vars","_a","_b","toreturn","f","includes","_loop_1","k","defaultValue","concat","_i","_c","opts","componentName","repoName","split","version","iifePath","getElementById","script","id","src","location","href","head","console","warn","dictionary","setLang","lang","getDefaultLang","translateWord","wordKey","getDictionaryWord","translateDate","dateISOString","timeOptions","formatDate","_d","_e","browserLang","navigator","languages","toLowerCase","w","defLng","defaultLng","getMonth","Intl","DateTimeFormat","format","styleSetup","parts","valueType","theme","description","important","button6","disabled","button6_disabled_value","JSON","stringify","label","hb_input_file1","removeProperty","setProperty","div0","button0","button1","button2","button3","button4","button5","br","hb_input_file0","div1","hb_stylus_paper","historyIndex","changeHistoryIndex","enableRedo","save_as","insert_image","start_index","stylusPaperStyleToSet","inputFileStyleToSet","enableUndo","started","load_draw","changeMode","$$invalidate","undo","log","redo","onHistoryIndexChange","details","save","onFileInsertLoaded","fileName","reader","FileReader","readAsDataURL","onload","evt","imageType","toString","base64","onerror","onPaperSave","exportObj","exportName","dataStr","downloadAnchorNode","encodeURIComponent","body","click","remove","onDrawLoaded","readAsText","pkg","onMount","shadowRoot","parseStyle","stylePaperSetup","styleInputFileSetup","insert_text"],"mappings":"oCAAA,SAASA,IAAU,CAkBnB,SAASC,EAAIC,GACT,OAAOA,GACX,CACA,SAASC,IACL,OAAOC,OAAOC,OAAO,KACzB,CACA,SAASC,EAAQC,GACbA,EAAIC,QAAQP,EAChB,CACA,SAASQ,EAAYC,GACjB,MAAwB,mBAAVA,CAClB,CACA,SAASC,EAAeC,EAAGC,GACvB,OAAOD,GAAKA,EAAIC,GAAKA,EAAID,IAAMC,GAAOD,GAAkB,iBAANA,GAAgC,mBAANA,CAChF,CAgUA,SAASE,EAAOC,EAAQC,GACpBD,EAAOE,YAAYD,EACvB,CAoDA,SAASE,EAAOH,EAAQC,EAAMG,GAC1BJ,EAAOK,aAAaJ,EAAMG,GAAU,K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