@htmlbricks/hb-page-invoice 0.66.0 → 0.66.2

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 CHANGED
@@ -1,5 +1,5 @@
1
- (function(un){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const Mr=1,Tr=4,Dr=8,Or=16,Nr=1,Ar=2,fn="[",Yt="[!",cn="]",Je={},B=Symbol(),Cr="http://www.w3.org/1999/xhtml",Ft=!1;var Pr=Array.isArray,Lr=Array.prototype.indexOf,Rr=Array.from,mt=Object.keys,bt=Object.defineProperty,Ie=Object.getOwnPropertyDescriptor,jr=Object.getOwnPropertyDescriptors,Ir=Object.prototype,Yr=Array.prototype,dn=Object.getPrototypeOf,hn=Object.isExtensible;function Fr(e){for(var t=0;t<e.length;t++)e[t]()}function vn(){var e,t,n=new Promise((r,s)=>{e=r,t=s});return{promise:n,resolve:e,reject:t}}const F=2,qt=4,Ht=8,pe=16,me=32,Te=64,gt=128,oe=512,U=1024,G=2048,be=4096,fe=8192,ge=16384,wt=32768,Ze=65536,_n=1<<17,pn=1<<18,Ye=1<<19,qr=1<<20,Fe=32768,Bt=1<<21,Ut=1<<22,De=1<<23,yt=Symbol("$state"),mn=Symbol("legacy props"),Hr=Symbol(""),Ge=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},$t=3,it=8;function Br(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ur(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function zr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Wr(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Vr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Jr(){throw new Error("https://svelte.dev/e/hydration_failed")}function Zr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Gr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Kr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Qr(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Xr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function xt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function ei(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let O=!1;function Oe(e){O=e}let D;function ee(e){if(e===null)throw xt(),Je;return D=e}function zt(){return ee(ye(D))}function k(e){if(O){if(ye(D)!==null)throw xt(),Je;D=e}}function ti(e=1){if(O){for(var t=e,n=D;t--;)n=ye(n);D=n}}function bn(e=!0){for(var t=0,n=D;;){if(n.nodeType===it){var r=n.data;if(r===cn){if(t===0)return n;t-=1}else(r===fn||r===Yt)&&(t+=1)}var s=ye(n);e&&n.remove(),n=s}}function ni(e){if(!e||e.nodeType!==it)throw xt(),Je;return e.data}function gn(e){return e===this.v}function ri(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function wn(e){return!ri(e,this.v)}let ii=!1,te=null;function Ke(e){te=e}function yn(e,t=!1,n){te={p:te,i:!1,c:null,e:null,s:e,x:null,l:null}}function $n(e){var t=te,n=t.e;if(n!==null){t.e=null;for(var r of n)Yn(r)}return e!==void 0&&(t.x=e),t.i=!0,te=t.p,e??{}}function xn(){return!0}let qe=[];function En(){var e=qe;qe=[],Fr(e)}function Wt(e){if(qe.length===0&&!st){var t=qe;queueMicrotask(()=>{t===qe&&En()})}qe.push(e)}function si(){for(;qe.length>0;)En()}function kn(e){var t=E;if(t===null)return $.f|=De,e;if((t.f&wt)===0){if((t.f&gt)===0)throw e;t.b.error(e)}else Qe(e,t)}function Qe(e,t){for(;t!==null;){if((t.f&gt)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e}const Et=new Set;let C=null,ne=null,re=[],kt=null,Vt=!1,st=!1;class le{committed=!1;current=new Map;previous=new Map;#t=new Set;#e=new Set;#n=0;#r=0;#l=null;#s=[];#i=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#r>0}process(t){re=[],this.apply();var n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const r of t)this.#a(r,n);this.is_fork||this.#f(),this.is_deferred()?(this.#o(n.effects),this.#o(n.render_effects),this.#o(n.block_effects)):(C=null,Mn(n.render_effects),Mn(n.effects),this.#l?.resolve()),ne=null}#a(t,n){t.f^=U;for(var r=t.first;r!==null;){var s=r.f,i=(s&(me|Te))!==0,a=i&&(s&U)!==0,o=a||(s&fe)!==0||this.skipped_effects.has(r);if((r.f&gt)!==0&&r.b?.is_pending()&&(n={parent:n,effect:r,effects:[],render_effects:[],block_effects:[]}),!o&&r.fn!==null){i?r.f^=U:(s&qt)!==0?n.effects.push(r):ct(r)&&((r.f&pe)!==0&&n.block_effects.push(r),dt(r));var l=r.first;if(l!==null){r=l;continue}}var u=r.parent;for(r=r.next;r===null&&u!==null;)u===n.effect&&(this.#o(n.effects),this.#o(n.render_effects),this.#o(n.block_effects),n=n.parent),r=u.next,u=u.parent}}#o(t){for(const n of t)((n.f&G)!==0?this.#s:this.#i).push(n),this.#u(n.deps),W(n,U)}#u(t){if(t!==null)for(const n of t)(n.f&F)===0||(n.f&Fe)===0||(n.f^=Fe,this.#u(n.deps))}capture(t,n){this.previous.has(t)||this.previous.set(t,n),(t.f&De)===0&&(this.current.set(t,t.v),ne?.set(t,t.v))}activate(){C=this,this.apply()}deactivate(){C===this&&(C=null,ne=null)}flush(){if(this.activate(),re.length>0){if(Sn(),C!==null&&C!==this)return}else this.#n===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#e)t(this);this.#e.clear()}#f(){if(this.#r===0){for(const t of this.#t)t();this.#t.clear()}this.#n===0&&this.#c()}#c(){if(Et.size>1){this.previous.clear();var t=ne,n=!0,r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of Et){if(i===this){n=!1;continue}const a=[];for(const[l,u]of this.current){if(i.current.has(l))if(n&&u!==i.current.get(l))i.current.set(l,u);else continue;a.push(l)}if(a.length===0)continue;const o=[...i.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var s=re;re=[];const l=new Set,u=new Map;for(const p of a)Tn(p,o,l,u);if(re.length>0){C=i,i.apply();for(const p of re)i.#a(p,r);i.deactivate()}re=s}}C=null,ne=t}this.committed=!0,Et.delete(this)}increment(t){this.#n+=1,t&&(this.#r+=1)}decrement(t){this.#n-=1,t&&(this.#r-=1),this.revive()}revive(){for(const t of this.#s)W(t,G),He(t);for(const t of this.#i)W(t,be),He(t);this.#s=[],this.#i=[],this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}settled(){return(this.#l??=vn()).promise}static ensure(){if(C===null){const t=C=new le;Et.add(C),st||le.enqueue(()=>{C===t&&t.flush()})}return C}static enqueue(t){Wt(t)}apply(){}}function at(e){var t=st;st=!0;try{for(var n;;){if(si(),re.length===0&&(C?.flush(),re.length===0))return kt=null,n;Sn()}}finally{st=t}}function Sn(){var e=Ae;Vt=!0;var t=null;try{var n=0;for(Ot(!0);re.length>0;){var r=le.ensure();if(n++>1e3){var s,i;ai()}r.process(re),Ne.clear()}}finally{Vt=!1,Ot(e),kt=null}}function ai(){try{Vr()}catch(e){Qe(e,kt)}}let we=null;function Mn(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(ge|fe))===0&&ct(r)&&(we=new Set,dt(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?Un(r):r.fn=null),we?.size>0)){Ne.clear();for(const s of we){if((s.f&(ge|fe))!==0)continue;const i=[s];let a=s.parent;for(;a!==null;)we.has(a)&&(we.delete(a),i.push(a)),a=a.parent;for(let o=i.length-1;o>=0;o--){const l=i[o];(l.f&(ge|fe))===0&&dt(l)}}we.clear()}}we=null}}function Tn(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const i=s.f;(i&F)!==0?Tn(s,t,n,r):(i&(Ut|pe))!==0&&(i&G)===0&&Dn(s,t,r)&&(W(s,G),He(s))}}function Dn(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(t.includes(s))return!0;if((s.f&F)!==0&&Dn(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function He(e){for(var t=kt=e;t.parent!==null;){t=t.parent;var n=t.f;if(Vt&&t===E&&(n&pe)!==0&&(n&pn)===0)return;if((n&(Te|me))!==0){if((n&U)===0)return;t.f^=U}}re.push(t)}function oi(e){let t=0,n=ot(0),r;return()=>{Dt()&&(N(n),Fn(()=>(t===0&&(r=rr(()=>e(()=>lt(n)))),t+=1,()=>{Wt(()=>{t-=1,t===0&&(r?.(),r=void 0,lt(n))})})))}}var li=Ze|Ye|gt;function ui(e,t,n){new fi(e,t,n)}class fi{parent;#t=!1;#e;#n=O?D:null;#r;#l;#s;#i=null;#a=null;#o=null;#u=null;#f=null;#c=0;#d=0;#v=!1;#h=null;#g=oi(()=>(this.#h=ot(this.#c),()=>{this.#h=null}));constructor(t,n,r){this.#e=t,this.#r=n,this.#l=r,this.parent=E.b,this.#t=!!this.#r.pending,this.#s=qn(()=>{if(E.b=this,O){const i=this.#n;zt(),i.nodeType===it&&i.data===Yt?this.#y():this.#w()}else{var s=this.#m();try{this.#i=$e(()=>r(s))}catch(i){this.error(i)}this.#d>0?this.#p():this.#t=!1}return()=>{this.#f?.remove()}},li),O&&(this.#e=D)}#w(){try{this.#i=$e(()=>this.#l(this.#e))}catch(t){this.error(t)}this.#t=!1}#y(){const t=this.#r.pending;t&&(this.#a=$e(()=>t(this.#e)),le.enqueue(()=>{var n=this.#m();this.#i=this.#_(()=>(le.ensure(),$e(()=>this.#l(n)))),this.#d>0?this.#p():(ut(this.#a,()=>{this.#a=null}),this.#t=!1)}))}#m(){var t=this.#e;return this.#t&&(this.#f=ue(),this.#e.before(this.#f),t=this.#f),t}is_pending(){return this.#t||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#r.pending}#_(t){var n=E,r=$,s=te;ie(this.#s),z(this.#s),Ke(this.#s.ctx);try{return t()}catch(i){return kn(i),null}finally{ie(n),z(r),Ke(s)}}#p(){const t=this.#r.pending;this.#i!==null&&(this.#u=document.createDocumentFragment(),this.#u.append(this.#f),Vn(this.#i,this.#u)),this.#a===null&&(this.#a=$e(()=>t(this.#e)))}#b(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#b(t);return}this.#d+=t,this.#d===0&&(this.#t=!1,this.#a&&ut(this.#a,()=>{this.#a=null}),this.#u&&(this.#e.before(this.#u),this.#u=null))}update_pending_count(t){this.#b(t),this.#c+=t,this.#h&&Tt(this.#h,this.#c)}get_effect_pending(){return this.#g(),N(this.#h)}error(t){var n=this.#r.onerror;let r=this.#r.failed;if(this.#v||!n&&!r)throw t;this.#i&&(K(this.#i),this.#i=null),this.#a&&(K(this.#a),this.#a=null),this.#o&&(K(this.#o),this.#o=null),O&&(ee(this.#n),ti(),ee(bn()));var s=!1,i=!1;const a=()=>{if(s){ei();return}s=!0,i&&Xr(),le.ensure(),this.#c=0,this.#o!==null&&ut(this.#o,()=>{this.#o=null}),this.#t=this.has_pending_snippet(),this.#i=this.#_(()=>(this.#v=!1,$e(()=>this.#l(this.#e)))),this.#d>0?this.#p():this.#t=!1};var o=$;try{z(null),i=!0,n?.(t,a),i=!1}catch(l){Qe(l,this.#s&&this.#s.parent)}finally{z(o)}r&&Wt(()=>{this.#o=this.#_(()=>{le.ensure(),this.#v=!0;try{return $e(()=>{r(this.#e,()=>t,()=>a)})}catch(l){return Qe(l,this.#s.parent),null}finally{this.#v=!1}})})}}function ci(e,t,n,r){const s=Mt;if(n.length===0&&e.length===0){r(t.map(s));return}var i=C,a=E,o=di();function l(){Promise.all(n.map(u=>hi(u))).then(u=>{o();try{r([...t.map(s),...u])}catch(p){(a.f&ge)===0&&Qe(p,a)}i?.deactivate(),St()}).catch(u=>{Qe(u,a)})}e.length>0?Promise.all(e).then(()=>{o();try{return l()}finally{i?.deactivate(),St()}}):l()}function di(){var e=E,t=$,n=te,r=C;return function(i=!0){ie(e),z(t),Ke(n),i&&r?.activate()}}function St(){ie(null),z(null),Ke(null)}function Mt(e){var t=F|G,n=$!==null&&($.f&F)!==0?$:null;return E!==null&&(E.f|=Ye),{ctx:te,deps:null,effects:null,equals:gn,f:t,fn:e,reactions:null,rv:0,v:B,wv:0,parent:n??E,ac:null}}function hi(e,t){let n=E;n===null&&Br();var r=n.b,s=void 0,i=ot(B),a=!$,o=new Map;return Ti(()=>{var l=vn();s=l.promise;try{Promise.resolve(e()).then(l.resolve,l.reject).then(()=>{u===C&&u.committed&&u.deactivate(),St()})}catch(f){l.reject(f),St()}var u=C;if(a){var p=!r.is_pending();r.update_pending_count(1),u.increment(p),o.get(u)?.reject(Ge),o.delete(u),o.set(u,l)}const h=(f,v=void 0)=>{if(u.activate(),v)v!==Ge&&(i.f|=De,Tt(i,v));else{(i.f&De)!==0&&(i.f^=De),Tt(i,f);for(const[x,I]of o){if(o.delete(x),x===u)break;I.reject(Ge)}}a&&(r.update_pending_count(-1),u.decrement(p))};l.promise.then(h,f=>h(null,f||"unknown"))}),xi(()=>{for(const l of o.values())l.reject(Ge)}),new Promise(l=>{function u(p){function h(){p===s?l(i):u(s)}p.then(h,h)}u(s)})}function Xe(e){const t=Mt(e);return Zn(t),t}function vi(e){const t=Mt(e);return t.equals=wn,t}function On(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)K(t[n])}}function _i(e){for(var t=e.parent;t!==null;){if((t.f&F)===0)return(t.f&ge)===0?t:null;t=t.parent}return null}function Jt(e){var t,n=E;ie(_i(e));try{e.f&=~Fe,On(e),t=er(e)}finally{ie(n)}return t}function Nn(e){var t=Jt(e);if(e.equals(t)||(C?.is_fork||(e.v=t),e.wv=Qn()),!Be)if(ne!==null)Dt()&&ne.set(e,t);else{var n=(e.f&oe)===0?be:U;W(e,n)}}let Zt=new Set;const Ne=new Map;let An=!1;function ot(e,t){var n={f:0,v:e,reactions:null,equals:gn,rv:0,wv:0};return n}function ce(e,t){const n=ot(e);return Zn(n),n}function pi(e,t=!1,n=!0){const r=ot(e);return t||(r.equals=wn),r}function J(e,t,n=!1){$!==null&&(!he||($.f&_n)!==0)&&xn()&&($.f&(F|pe|Ut|_n))!==0&&!xe?.includes(e)&&Qr();let r=n?et(t):t;return Tt(e,r)}function Tt(e,t){if(!e.equals(t)){var n=e.v;Be?Ne.set(e,t):Ne.set(e,n),e.v=t;var r=le.ensure();r.capture(e,n),(e.f&F)!==0&&((e.f&G)!==0&&Jt(e),W(e,(e.f&oe)!==0?U:be)),e.wv=Qn(),Cn(e,G),E!==null&&(E.f&U)!==0&&(E.f&(me|Te))===0&&(se===null?Ci([e]):se.push(e)),!r.is_fork&&Zt.size>0&&!An&&mi()}return t}function mi(){An=!1;var e=Ae;Ot(!0);const t=Array.from(Zt);try{for(const n of t)(n.f&U)!==0&&W(n,be),ct(n)&&dt(n)}finally{Ot(e)}Zt.clear()}function lt(e){J(e,e.v+1)}function Cn(e,t){var n=e.reactions;if(n!==null)for(var r=n.length,s=0;s<r;s++){var i=n[s],a=i.f,o=(a&G)===0;if(o&&W(i,t),(a&F)!==0){var l=i;ne?.delete(l),(a&Fe)===0&&(a&oe&&(i.f|=Fe),Cn(l,be))}else o&&((a&pe)!==0&&we!==null&&we.add(i),He(i))}}function et(e){if(typeof e!="object"||e===null||yt in e)return e;const t=dn(e);if(t!==Ir&&t!==Yr)return e;var n=new Map,r=Pr(e),s=ce(0),i=Ue,a=o=>{if(Ue===i)return o();var l=$,u=Ue;z(null),Kn(i);var p=o();return z(l),Kn(u),p};return r&&n.set("length",ce(e.length)),new Proxy(e,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Gr();var p=n.get(l);return p===void 0?p=a(()=>{var h=ce(u.value);return n.set(l,h),h}):J(p,u.value,!0),!0},deleteProperty(o,l){var u=n.get(l);if(u===void 0){if(l in o){const p=a(()=>ce(B));n.set(l,p),lt(s)}}else J(u,B),lt(s);return!0},get(o,l,u){if(l===yt)return e;var p=n.get(l),h=l in o;if(p===void 0&&(!h||Ie(o,l)?.writable)&&(p=a(()=>{var v=et(h?o[l]:B),x=ce(v);return x}),n.set(l,p)),p!==void 0){var f=N(p);return f===B?void 0:f}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var p=n.get(l);p&&(u.value=N(p))}else if(u===void 0){var h=n.get(l),f=h?.v;if(h!==void 0&&f!==B)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return u},has(o,l){if(l===yt)return!0;var u=n.get(l),p=u!==void 0&&u.v!==B||Reflect.has(o,l);if(u!==void 0||E!==null&&(!p||Ie(o,l)?.writable)){u===void 0&&(u=a(()=>{var f=p?et(o[l]):B,v=ce(f);return v}),n.set(l,u));var h=N(u);if(h===B)return!1}return p},set(o,l,u,p){var h=n.get(l),f=l in o;if(r&&l==="length")for(var v=u;v<h.v;v+=1){var x=n.get(v+"");x!==void 0?J(x,B):v in o&&(x=a(()=>ce(B)),n.set(v+"",x))}if(h===void 0)(!f||Ie(o,l)?.writable)&&(h=a(()=>ce(void 0)),J(h,et(u)),n.set(l,h));else{f=h.v!==B;var I=a(()=>et(u));J(h,I)}var q=Reflect.getOwnPropertyDescriptor(o,l);if(q?.set&&q.set.call(p,u),!f){if(r&&typeof l=="string"){var Pe=n.get("length"),m=Number(l);Number.isInteger(m)&&m>=Pe.v&&J(Pe,m+1)}lt(s)}return!0},ownKeys(o){N(s);var l=Reflect.ownKeys(o).filter(h=>{var f=n.get(h);return f===void 0||f.v!==B});for(var[u,p]of n)p.v!==B&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Kr()}})}var Pn,Ln,Rn,jn;function Gt(){if(Pn===void 0){Pn=window,Ln=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Rn=Ie(t,"firstChild").get,jn=Ie(t,"nextSibling").get,hn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),hn(n)&&(n.__t=void 0)}}function ue(e=""){return document.createTextNode(e)}function tt(e){return Rn.call(e)}function ye(e){return jn.call(e)}function S(e,t){if(!O)return tt(e);var n=tt(D);if(n===null)n=D.appendChild(ue());else if(t&&n.nodeType!==$t){var r=ue();return n?.before(r),ee(r),r}return ee(n),n}function bi(e,t=!1){if(!O){var n=tt(e);return n instanceof Comment&&n.data===""?ye(n):n}if(t&&D?.nodeType!==$t){var r=ue();return D?.before(r),ee(r),r}return D}function L(e,t=1,n=!1){let r=O?D:e;for(var s;t--;)s=r,r=ye(r);if(!O)return r;if(n&&r?.nodeType!==$t){var i=ue();return r===null?s?.after(i):r.before(i),ee(i),i}return ee(r),r}function gi(e){e.textContent=""}function wi(){return!1}function In(e){var t=$,n=E;z(null),ie(null);try{return e()}finally{z(t),ie(n)}}function yi(e){E===null&&($===null&&Wr(),zr()),Be&&Ur()}function $i(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function de(e,t,n){var r=E;r!==null&&(r.f&fe)!==0&&(e|=fe);var s={ctx:te,deps:null,nodes_start:null,nodes_end:null,f:e|G|oe,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{dt(s),s.f|=wt}catch(o){throw K(s),o}else t!==null&&He(s);var i=s;if(n&&i.deps===null&&i.teardown===null&&i.nodes_start===null&&i.first===i.last&&(i.f&Ye)===0&&(i=i.first,(e&pe)!==0&&(e&Ze)!==0&&i!==null&&(i.f|=Ze)),i!==null&&(i.parent=r,r!==null&&$i(i,r),$!==null&&($.f&F)!==0&&(e&Te)===0)){var a=$;(a.effects??=[]).push(i)}return s}function Dt(){return $!==null&&!he}function xi(e){const t=de(Ht,null,!1);return W(t,U),t.teardown=e,t}function Ei(e){yi();var t=E.f,n=!$&&(t&me)!==0&&(t&wt)===0;if(n){var r=te;(r.e??=[]).push(e)}else return Yn(e)}function Yn(e){return de(qt|qr,e,!1)}function ki(e){le.ensure();const t=de(Te|Ye,e,!0);return()=>{K(t)}}function Si(e){le.ensure();const t=de(Te|Ye,e,!0);return(n={})=>new Promise(r=>{n.outro?ut(t,()=>{K(t),r(void 0)}):(K(t),r(void 0))})}function Mi(e){return de(qt,e,!1)}function Ti(e){return de(Ut|Ye,e,!0)}function Fn(e,t=0){return de(Ht|t,e,!0)}function Kt(e,t=[],n=[],r=[]){ci(r,t,n,s=>{de(Ht,()=>e(...s.map(N)),!0)})}function qn(e,t=0){var n=de(pe|t,e,!0);return n}function $e(e){return de(me|Ye,e,!0)}function Hn(e){var t=e.teardown;if(t!==null){const n=Be,r=$;Jn(!0),z(null);try{t.call(null)}finally{Jn(n),z(r)}}}function Bn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&In(()=>{s.abort(Ge)});var r=n.next;(n.f&Te)!==0?n.parent=null:K(n,t),n=r}}function Di(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&me)===0&&K(t),t=n}}function K(e,t=!0){var n=!1;(t||(e.f&pn)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(Oi(e.nodes_start,e.nodes_end),n=!0),Bn(e,t&&!n),Nt(e,0),W(e,ge);var r=e.transitions;if(r!==null)for(const i of r)i.stop();Hn(e);var s=e.parent;s!==null&&s.first!==null&&Un(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function Oi(e,t){for(;e!==null;){var n=e===t?null:ye(e);e.remove(),e=n}}function Un(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function ut(e,t,n=!0){var r=[];zn(e,r,!0),Ni(r,()=>{n&&K(e),t&&t()})}function Ni(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var s of e)s.out(r)}else t()}function zn(e,t,n){if((e.f&fe)===0){if(e.f^=fe,e.transitions!==null)for(const a of e.transitions)(a.is_global||n)&&t.push(a);for(var r=e.first;r!==null;){var s=r.next,i=(r.f&Ze)!==0||(r.f&me)!==0&&(e.f&pe)!==0;zn(r,t,i?n:!1),r=s}}}function Ai(e){Wn(e,!0)}function Wn(e,t){if((e.f&fe)!==0){e.f^=fe,(e.f&U)===0&&(W(e,G),He(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Ze)!==0||(n.f&me)!==0;Wn(n,s?t:!1),n=r}if(e.transitions!==null)for(const i of e.transitions)(i.is_global||t)&&i.in()}}function Vn(e,t){for(var n=e.nodes_start,r=e.nodes_end;n!==null;){var s=n===r?null:ye(n);t.append(n),n=s}}let Ae=!1;function Ot(e){Ae=e}let Be=!1;function Jn(e){Be=e}let $=null,he=!1;function z(e){$=e}let E=null;function ie(e){E=e}let xe=null;function Zn(e){$!==null&&(xe===null?xe=[e]:xe.push(e))}let Z=null,X=0,se=null;function Ci(e){se=e}let Gn=1,ft=0,Ue=ft;function Kn(e){Ue=e}function Qn(){return++Gn}function ct(e){var t=e.f;if((t&G)!==0)return!0;if(t&F&&(e.f&=~Fe),(t&be)!==0){var n=e.deps;if(n!==null)for(var r=n.length,s=0;s<r;s++){var i=n[s];if(ct(i)&&Nn(i),i.wv>e.wv)return!0}(t&oe)!==0&&ne===null&&W(e,U)}return!1}function Xn(e,t,n=!0){var r=e.reactions;if(r!==null&&!xe?.includes(e))for(var s=0;s<r.length;s++){var i=r[s];(i.f&F)!==0?Xn(i,t,!1):t===i&&(n?W(i,G):(i.f&U)!==0&&W(i,be),He(i))}}function er(e){var t=Z,n=X,r=se,s=$,i=xe,a=te,o=he,l=Ue,u=e.f;Z=null,X=0,se=null,$=(u&(me|Te))===0?e:null,xe=null,Ke(e.ctx),he=!1,Ue=++ft,e.ac!==null&&(In(()=>{e.ac.abort(Ge)}),e.ac=null);try{e.f|=Bt;var p=e.fn,h=p(),f=e.deps;if(Z!==null){var v;if(Nt(e,X),f!==null&&X>0)for(f.length=X+Z.length,v=0;v<Z.length;v++)f[X+v]=Z[v];else e.deps=f=Z;if(Ae&&Dt()&&(e.f&oe)!==0)for(v=X;v<f.length;v++)(f[v].reactions??=[]).push(e)}else f!==null&&X<f.length&&(Nt(e,X),f.length=X);if(xn()&&se!==null&&!he&&f!==null&&(e.f&(F|be|G))===0)for(v=0;v<se.length;v++)Xn(se[v],e);return s!==null&&s!==e&&(ft++,se!==null&&(r===null?r=se:r.push(...se))),(e.f&De)!==0&&(e.f^=De),h}catch(x){return kn(x)}finally{e.f^=Bt,Z=t,X=n,se=r,$=s,xe=i,Ke(a),he=o,Ue=l}}function Pi(e,t){let n=t.reactions;if(n!==null){var r=Lr.call(n,e);if(r!==-1){var s=n.length-1;s===0?n=t.reactions=null:(n[r]=n[s],n.pop())}}n===null&&(t.f&F)!==0&&(Z===null||!Z.includes(t))&&(W(t,be),(t.f&oe)!==0&&(t.f^=oe,t.f&=~Fe),On(t),Nt(t,0))}function Nt(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Pi(e,n[r])}function dt(e){var t=e.f;if((t&ge)===0){W(e,U);var n=E,r=Ae;E=e,Ae=!0;try{(t&pe)!==0?Di(e):Bn(e),Hn(e);var s=er(e);e.teardown=typeof s=="function"?s:null,e.wv=Gn;var i;Ft&&ii&&(e.f&G)!==0&&e.deps}finally{Ae=r,E=n}}}function N(e){var t=e.f,n=(t&F)!==0;if($!==null&&!he){var r=E!==null&&(E.f&ge)!==0;if(!r&&!xe?.includes(e)){var s=$.deps;if(($.f&Bt)!==0)e.rv<ft&&(e.rv=ft,Z===null&&s!==null&&s[X]===e?X++:Z===null?Z=[e]:Z.includes(e)||Z.push(e));else{($.deps??=[]).push(e);var i=e.reactions;i===null?e.reactions=[$]:i.includes($)||i.push($)}}}if(Be){if(Ne.has(e))return Ne.get(e);if(n){var a=e,o=a.v;return((a.f&U)===0&&a.reactions!==null||nr(a))&&(o=Jt(a)),Ne.set(a,o),o}}else n&&!ne?.has(e)&&(a=e,ct(a)&&Nn(a),Ae&&Dt()&&(a.f&oe)===0&&tr(a));if(ne?.has(e))return ne.get(e);if((e.f&De)!==0)throw e.v;return e.v}function tr(e){if(e.deps!==null){e.f^=oe;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&F)!==0&&(t.f&oe)===0&&tr(t)}}function nr(e){if(e.v===B)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Ne.has(t)||(t.f&F)!==0&&nr(t))return!0;return!1}function rr(e){var t=he;try{return he=!0,e()}finally{he=t}}const Li=-7169;function W(e,t){e.f=e.f&Li|t}const ir=new Set,Qt=new Set;function Ri(e){for(var t=0;t<e.length;t++)ir.add(e[t]);for(var n of Qt)n(e)}let sr=null;function At(e){var t=this,n=t.ownerDocument,r=e.type,s=e.composedPath?.()||[],i=s[0]||e.target;sr=e;var a=0,o=sr===e&&e.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var u=s.indexOf(t);if(u===-1)return;l<=u&&(a=l)}if(i=s[a]||e.target,i!==t){bt(e,"currentTarget",{configurable:!0,get(){return i||n}});var p=$,h=E;z(null),ie(null);try{for(var f,v=[];i!==null;){var x=i.assignedSlot||i.parentNode||i.host||null;try{var I=i["__"+r];I!=null&&(!i.disabled||e.target===i)&&I.call(i,e)}catch(q){f?v.push(q):f=q}if(e.cancelBubble||x===t||x===null)break;i=x}if(f){for(let q of v)queueMicrotask(()=>{throw q});throw f}}finally{e.__root=t,delete e.currentTarget,z(p),ie(h)}}}function ji(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Ce(e,t){var n=E;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function ar(e,t){var n=(t&Nr)!==0,r=(t&Ar)!==0,s,i=!e.startsWith("<!>");return()=>{if(O)return Ce(D,null),D;s===void 0&&(s=ji(i?e:"<!>"+e),n||(s=tt(s)));var a=r||Ln?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=tt(a),l=a.lastChild;Ce(o,l)}else Ce(a,a);return a}}function Ii(e=""){if(!O){var t=ue(e+"");return Ce(t,t),t}var n=D;return n.nodeType!==$t&&(n.before(n=ue()),ee(n)),Ce(n,n),n}function Yi(){if(O)return Ce(D,null),D;var e=document.createDocumentFragment(),t=document.createComment(""),n=ue();return e.append(t,n),Ce(t,n),e}function ht(e,t){if(O){var n=E;((n.f&wt)===0||n.nodes_end===null)&&(n.nodes_end=D),zt();return}e!==null&&e.before(t)}const Fi=["touchstart","touchmove"];function qi(e){return Fi.includes(e)}function Q(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function or(e,t){return lr(e,t)}function Hi(e,t){Gt(),t.intro=t.intro??!1;const n=t.target,r=O,s=D;try{for(var i=tt(n);i&&(i.nodeType!==it||i.data!==fn);)i=ye(i);if(!i)throw Je;Oe(!0),ee(i);const a=lr(e,{...t,anchor:i});return Oe(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
- `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==Je&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Jr(),Gt(),gi(n),Oe(!1),or(e,t)}finally{Oe(r),ee(s)}}const nt=new Map;function lr(e,{target:t,anchor:n,props:r={},events:s,context:i,intro:a=!0}){Gt();var o=new Set,l=h=>{for(var f=0;f<h.length;f++){var v=h[f];if(!o.has(v)){o.add(v);var x=qi(v);t.addEventListener(v,At,{passive:x});var I=nt.get(v);I===void 0?(document.addEventListener(v,At,{passive:x}),nt.set(v,1)):nt.set(v,I+1)}}};l(Rr(ir)),Qt.add(l);var u=void 0,p=Si(()=>{var h=n??t.appendChild(ue());return ui(h,{pending:()=>{}},f=>{if(i){yn({});var v=te;v.c=i}if(s&&(r.$$events=s),O&&Ce(f,null),u=e(f,r)||{},O&&(E.nodes_end=D,D===null||D.nodeType!==it||D.data!==cn))throw xt(),Je;i&&$n()}),()=>{for(var f of o){t.removeEventListener(f,At);var v=nt.get(f);--v===0?(document.removeEventListener(f,At),nt.delete(f)):nt.set(f,v)}Qt.delete(l),h!==n&&h.parentNode?.removeChild(h)}});return Xt.set(u,p),u}let Xt=new WeakMap;function Bi(e,t){const n=Xt.get(e);return n?(Xt.delete(e),n(t)):Promise.resolve()}class Ui{anchor;#t=new Map;#e=new Map;#n=new Map;#r=new Set;#l=!0;constructor(t,n=!0){this.anchor=t,this.#l=n}#s=()=>{var t=C;if(this.#t.has(t)){var n=this.#t.get(t),r=this.#e.get(n);if(r)Ai(r),this.#r.delete(n);else{var s=this.#n.get(n);s&&(this.#e.set(n,s.effect),this.#n.delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[i,a]of this.#t){if(this.#t.delete(i),i===t)break;const o=this.#n.get(a);o&&(K(o.effect),this.#n.delete(a))}for(const[i,a]of this.#e){if(i===n||this.#r.has(i))continue;const o=()=>{if(Array.from(this.#t.values()).includes(i)){var u=document.createDocumentFragment();Vn(a,u),u.append(ue()),this.#n.set(i,{effect:a,fragment:u})}else K(a);this.#r.delete(i),this.#e.delete(i)};this.#l||!r?(this.#r.add(i),ut(a,o,!1)):o()}}};#i=t=>{this.#t.delete(t);const n=Array.from(this.#t.values());for(const[r,s]of this.#n)n.includes(r)||(K(s.effect),this.#n.delete(r))};ensure(t,n){var r=C,s=wi();if(n&&!this.#e.has(t)&&!this.#n.has(t))if(s){var i=document.createDocumentFragment(),a=ue();i.append(a),this.#n.set(t,{effect:$e(()=>n(a)),fragment:i})}else this.#e.set(t,$e(()=>n(this.anchor)));if(this.#t.set(r,t),s){for(const[o,l]of this.#e)o===t?r.skipped_effects.delete(l):r.skipped_effects.add(l);for(const[o,l]of this.#n)o===t?r.skipped_effects.delete(l.effect):r.skipped_effects.add(l.effect);r.oncommit(this.#s),r.ondiscard(this.#i)}else O&&(this.anchor=D),this.#s()}}function ur(e,t,n=!1){O&&zt();var r=new Ui(e),s=n?Ze:0;function i(a,o){if(O){const u=ni(e)===Yt;if(a===u){var l=bn();ee(l),r.anchor=l,Oe(!1),r.ensure(a,o),Oe(!0);return}}r.ensure(a,o)}qn(()=>{var a=!1;t((o,l=!0)=>{a=!0,i(l,o)}),a||i(!1,null)},s)}function zi(e,t){Mi(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const s=document.createElement("style");s.id=t.hash,s.textContent=t.code,r.appendChild(s)}})}function Wi(e,t,n){var r=""+e;return r}function Vi(e,t,n,r,s,i){var a=e.__className;if(O||a!==n||a===void 0){var o=Wi(n);(!O||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=n}return i}const Ji=Symbol("is custom element"),Zi=Symbol("is html");function fr(e,t,n,r){var s=Gi(e);O&&(s[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||s[t]!==(s[t]=n)&&(t==="loading"&&(e[Hr]=n),n==null?e.removeAttribute(t):typeof n!="string"&&cr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function en(e,t,n){var r=$,s=E;let i=O;O&&Oe(!1),z(null),ie(null);try{t!=="style"&&(tn.has(e.getAttribute("is")||e.nodeName)||!customElements||customElements.get(e.getAttribute("is")||e.tagName.toLowerCase())?cr(e).includes(t):n&&typeof n=="object")?e[t]=n:fr(e,t,n==null?n:String(n))}finally{z(r),ie(s),i&&Oe(!0)}}function Gi(e){return e.__attributes??={[Ji]:e.nodeName.includes("-"),[Zi]:e.namespaceURI===Cr}}var tn=new Map;function cr(e){var t=e.getAttribute("is")||e.nodeName,n=tn.get(t);if(n)return n;tn.set(t,n=[]);for(var r,s=e,i=Element.prototype;i!==s;){r=jr(s);for(var a in r)r[a].set&&n.push(a);s=dn(s)}return n}let Ct=!1;function Ki(e){var t=Ct;try{return Ct=!1,[e(),Ct]}finally{Ct=t}}function Pt(e,t,n,r){var s=(n&Dr)!==0,i=(n&Or)!==0,a=r,o=!0,l=()=>(o&&(o=!1,a=i?rr(r):r),a),u;if(s){var p=yt in e||mn in e;u=Ie(e,t)?.set??(p&&t in e?m=>e[t]=m:void 0)}var h,f=!1;s?[h,f]=Ki(()=>e[t]):h=e[t],h===void 0&&r!==void 0&&(h=l(),u&&(Zr(),u(h)));var v;if(v=()=>{var m=e[t];return m===void 0?l():(o=!0,m)},(n&Tr)===0)return v;if(u){var x=e.$$legacy;return(function(m,R){return arguments.length>0?((!R||x||f)&&u(R?v():m),m):v()})}var I=!1,q=((n&Mr)!==0?Mt:vi)(()=>(I=!1,v()));s&&N(q);var Pe=E;return(function(m,R){if(arguments.length>0){const Ee=R?N(q):s?et(m):m;return J(q,Ee),I=!0,a!==void 0&&(a=Ee),m}return Be&&I||(Pe.f&ge)!==0?q.v:N(q)})}function Qi(e){return new Xi(e)}class Xi{#t;#e;constructor(t){var n=new Map,r=(i,a)=>{var o=pi(a,!1,!1);return n.set(i,o),o};const s=new Proxy({...t.props||{},$$events:{}},{get(i,a){return N(n.get(a)??r(a,Reflect.get(i,a)))},has(i,a){return a===mn?!0:(N(n.get(a)??r(a,Reflect.get(i,a))),Reflect.has(i,a))},set(i,a,o){return J(n.get(a)??r(a,o),o),Reflect.set(i,a,o)}});this.#e=(t.hydrate?Hi:or)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&at(),this.#t=s.$$events;for(const i of Object.keys(this.#e))i==="$set"||i==="$destroy"||i==="$on"||bt(this,i,{get(){return this.#e[i]},set(a){this.#e[i]=a},enumerable:!0});this.#e.$set=i=>{Object.assign(s,i)},this.#e.$destroy=()=>{Bi(this.#e)}}$set(t){this.#e.$set(t)}$on(t,n){this.#t[t]=this.#t[t]||[];const r=(...s)=>n.call(this,...s);return this.#t[t].push(r),()=>{this.#t[t]=this.#t[t].filter(s=>s!==r)}}$destroy(){this.#e.$destroy()}}let dr;typeof HTMLElement=="function"&&(dr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(r){return s=>{const i=document.createElement("slot");r!=="default"&&(i.name=r),ht(s,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=es(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(const r of this.attributes){const s=this.$$g_p(r.name);s in this.$$d||(this.$$d[s]=Lt(s,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=Qi({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ki(()=>{Fn(()=>{this.$$r=!0;for(const r of mt(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const s=Lt(r,this.$$d[r],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,s)}this.$$r=!1})});for(const r in this.$$l)for(const s of this.$$l[r]){const i=this.$$c.$on(r,s);this.$$l_u.set(s,i)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Lt(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return mt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Lt(e,t,n,r){const s=n[e]?.type;if(t=s==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(s){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(s){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function es(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function ts(e,t,n,r,s,i){let a=class extends dr{constructor(){super(e,n,s),this.$$p_d=t}static get observedAttributes(){return mt(t).map(o=>(t[o].attribute||o).toLowerCase())}};return mt(t).forEach(o=>{bt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Lt(o,l,t),this.$$d[o]=l;var u=this.$$c;if(u){var p=Ie(u,o)?.get;p?u[o]=l:u.$set({[o]:l})}}})}),r.forEach(o=>{bt(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}function ns(e){const t=window.open("","PRINT","height=400,width=600");t.document.write("<html><head><title>"+document.title+"</title>"),t.document.write("</head><body >"),t.document.write(`<style>@page { size: auto; margin: 0mm; }</style><hb-page-invoice printer="yes" items='${JSON.stringify(e.items)}' headers='${JSON.stringify(e.headers)}'></hb-page-invoice>`),t.document.write("</body></html>");const n=document.createElement("script");n.id="hb-page-invoice-script",n.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-page-invoice@${e.version}/main.iife.js`,location.href.includes("localhost")&&(n.src="http://localhost:6006/webcomponents/page-invoice/main.iife.js"),t.document.head.appendChild(n),setTimeout(()=>{t.print(),t.close()},2e3)}function rs(e){const t=window.open("","PRINT","height=400,width=600");t.document.write("<html><head><title>"+document.title+"</title>"),t.document.write("</head><body >"),t.document.write(`<style>@page { size: auto; margin: 0mm; }</style><hb-page-invoice items='${JSON.stringify(e.items)}' headers='${JSON.stringify(e.headers)}'></hb-page-invoice>`),t.document.write("</body></html>");const n=document.createElement("script");n.id="hb-page-invoice-script",n.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-page-invoice@${e.version}/main.iife.js`,location.href.includes("localhost")&&(n.src="http://localhost:6006/webcomponents/page-invoice/main.iife.js"),t.document.head.appendChild(n)}const nn={version:"0.66.0"};function is(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rt={exports:{}},ss=Rt.exports,hr;function vr(){return hr||(hr=1,(function(e,t){(function(n,r){e.exports=r()})(ss,(function(){var n=1e3,r=6e4,s=36e5,i="millisecond",a="second",o="minute",l="hour",u="day",p="week",h="month",f="quarter",v="year",x="date",I="Invalid Date",q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Pe=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(g){var _=["th","st","nd","rd"],c=g%100;return"["+g+(_[(c-20)%10]||_[c]||_[0])+"]"}},R=function(g,_,c){var b=String(g);return!b||b.length>=_?g:""+Array(_+1-b.length).join(c)+g},Ee={s:R,z:function(g){var _=-g.utcOffset(),c=Math.abs(_),b=Math.floor(c/60),d=c%60;return(_<=0?"+":"-")+R(b,2,"0")+":"+R(d,2,"0")},m:function g(_,c){if(_.date()<c.date())return-g(c,_);var b=12*(c.year()-_.year())+(c.month()-_.month()),d=_.clone().add(b,h),w=c-d<0,y=_.clone().add(b+(w?-1:1),h);return+(-(b+(c-d)/(w?d-y:y-d))||0)},a:function(g){return g<0?Math.ceil(g)||0:Math.floor(g)},p:function(g){return{M:h,y:v,w:p,d:u,D:x,h:l,m:o,s:a,ms:i,Q:f}[g]||String(g||"").toLowerCase().replace(/s$/,"")},u:function(g){return g===void 0}},ke="en",ve={};ve[ke]=m;var vt="$isDayjsObject",_t=function(g){return g instanceof Le||!(!g||!g[vt])},We=function g(_,c,b){var d;if(!_)return ke;if(typeof _=="string"){var w=_.toLowerCase();ve[w]&&(d=w),c&&(ve[w]=c,d=w);var y=_.split("-");if(!d&&y.length>1)return g(y[0])}else{var T=_.name;ve[T]=_,d=T}return!b&&d&&(ke=d),d||!b&&ke},j=function(g,_){if(_t(g))return g.clone();var c=typeof _=="object"?_:{};return c.date=g,c.args=arguments,new Le(c)},M=Ee;M.l=We,M.i=_t,M.w=function(g,_){return j(g,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var Le=(function(){function g(c){this.$L=We(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[vt]=!0}var _=g.prototype;return _.parse=function(c){this.$d=(function(b){var d=b.date,w=b.utc;if(d===null)return new Date(NaN);if(M.u(d))return new Date;if(d instanceof Date)return new Date(d);if(typeof d=="string"&&!/Z$/i.test(d)){var y=d.match(q);if(y){var T=y[2]-1||0,A=(y[7]||"0").substring(0,3);return w?new Date(Date.UTC(y[1],T,y[3]||1,y[4]||0,y[5]||0,y[6]||0,A)):new Date(y[1],T,y[3]||1,y[4]||0,y[5]||0,y[6]||0,A)}}return new Date(d)})(c),this.init()},_.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},_.$utils=function(){return M},_.isValid=function(){return this.$d.toString()!==I},_.isSame=function(c,b){var d=j(c);return this.startOf(b)<=d&&d<=this.endOf(b)},_.isAfter=function(c,b){return j(c)<this.startOf(b)},_.isBefore=function(c,b){return this.endOf(b)<j(c)},_.$g=function(c,b,d){return M.u(c)?this[b]:this.set(d,c)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(c,b){var d=this,w=!!M.u(b)||b,y=M.p(c),T=function(Me,H){var ae=M.w(d.$u?Date.UTC(d.$y,H,Me):new Date(d.$y,H,Me),d);return w?ae:ae.endOf(u)},A=function(Me,H){return M.w(d.toDate()[Me].apply(d.toDate("s"),(w?[0,0,0,0]:[23,59,59,999]).slice(H)),d)},P=this.$W,Y=this.$M,V=this.$D,_e="set"+(this.$u?"UTC":"");switch(y){case v:return w?T(1,0):T(31,11);case h:return w?T(1,Y):T(0,Y+1);case p:var Se=this.$locale().weekStart||0,Re=(P<Se?P+7:P)-Se;return T(w?V-Re:V+(6-Re),Y);case u:case x:return A(_e+"Hours",0);case l:return A(_e+"Minutes",1);case o:return A(_e+"Seconds",2);case a:return A(_e+"Milliseconds",3);default:return this.clone()}},_.endOf=function(c){return this.startOf(c,!1)},_.$set=function(c,b){var d,w=M.p(c),y="set"+(this.$u?"UTC":""),T=(d={},d[u]=y+"Date",d[x]=y+"Date",d[h]=y+"Month",d[v]=y+"FullYear",d[l]=y+"Hours",d[o]=y+"Minutes",d[a]=y+"Seconds",d[i]=y+"Milliseconds",d)[w],A=w===u?this.$D+(b-this.$W):b;if(w===h||w===v){var P=this.clone().set(x,1);P.$d[T](A),P.init(),this.$d=P.set(x,Math.min(this.$D,P.daysInMonth())).$d}else T&&this.$d[T](A);return this.init(),this},_.set=function(c,b){return this.clone().$set(c,b)},_.get=function(c){return this[M.p(c)]()},_.add=function(c,b){var d,w=this;c=Number(c);var y=M.p(b),T=function(Y){var V=j(w);return M.w(V.date(V.date()+Math.round(Y*c)),w)};if(y===h)return this.set(h,this.$M+c);if(y===v)return this.set(v,this.$y+c);if(y===u)return T(1);if(y===p)return T(7);var A=(d={},d[o]=r,d[l]=s,d[a]=n,d)[y]||1,P=this.$d.getTime()+c*A;return M.w(P,this)},_.subtract=function(c,b){return this.add(-1*c,b)},_.format=function(c){var b=this,d=this.$locale();if(!this.isValid())return d.invalidDate||I;var w=c||"YYYY-MM-DDTHH:mm:ssZ",y=M.z(this),T=this.$H,A=this.$m,P=this.$M,Y=d.weekdays,V=d.months,_e=d.meridiem,Se=function(H,ae,Ve,je){return H&&(H[ae]||H(b,w))||Ve[ae].slice(0,je)},Re=function(H){return M.s(T%12||12,H,"0")},Me=_e||function(H,ae,Ve){var je=H<12?"AM":"PM";return Ve?je.toLowerCase():je};return w.replace(Pe,(function(H,ae){return ae||(function(Ve){switch(Ve){case"YY":return String(b.$y).slice(-2);case"YYYY":return M.s(b.$y,4,"0");case"M":return P+1;case"MM":return M.s(P+1,2,"0");case"MMM":return Se(d.monthsShort,P,V,3);case"MMMM":return Se(V,P);case"D":return b.$D;case"DD":return M.s(b.$D,2,"0");case"d":return String(b.$W);case"dd":return Se(d.weekdaysMin,b.$W,Y,2);case"ddd":return Se(d.weekdaysShort,b.$W,Y,3);case"dddd":return Y[b.$W];case"H":return String(T);case"HH":return M.s(T,2,"0");case"h":return Re(1);case"hh":return Re(2);case"a":return Me(T,A,!0);case"A":return Me(T,A,!1);case"m":return String(A);case"mm":return M.s(A,2,"0");case"s":return String(b.$s);case"ss":return M.s(b.$s,2,"0");case"SSS":return M.s(b.$ms,3,"0");case"Z":return y}return null})(H)||y.replace(":","")}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(c,b,d){var w,y=this,T=M.p(b),A=j(c),P=(A.utcOffset()-this.utcOffset())*r,Y=this-A,V=function(){return M.m(y,A)};switch(T){case v:w=V()/12;break;case h:w=V();break;case f:w=V()/3;break;case p:w=(Y-P)/6048e5;break;case u:w=(Y-P)/864e5;break;case l:w=Y/s;break;case o:w=Y/r;break;case a:w=Y/n;break;default:w=Y}return d?w:M.a(w)},_.daysInMonth=function(){return this.endOf(h).$D},_.$locale=function(){return ve[this.$L]},_.locale=function(c,b){if(!c)return this.$L;var d=this.clone(),w=We(c,b,!0);return w&&(d.$L=w),d},_.clone=function(){return M.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g})(),rt=Le.prototype;return j.prototype=rt,[["$ms",i],["$s",a],["$m",o],["$H",l],["$W",u],["$M",h],["$y",v],["$D",x]].forEach((function(g){rt[g[1]]=function(_){return this.$g(_,g[0],g[1])}})),j.extend=function(g,_){return g.$i||(g(_,Le,j),g.$i=!0),j},j.locale=We,j.isDayjs=_t,j.unix=function(g){return j(1e3*g)},j.en=ve[ke],j.Ls=ve,j.p={},j}))})(Rt)),Rt.exports}var as=vr();const os=is(as);function _r(e,t=100,n={}){if(typeof e!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(t<0)throw new RangeError("`wait` must not be negative.");if(typeof n=="boolean")throw new TypeError("The `options` parameter must be an object, not a boolean. Use `{immediate: true}` instead.");const{immediate:r}=n;let s,i,a,o,l;function u(){const f=s,v=i;return s=void 0,i=void 0,l=e.apply(f,v),l}function p(){const f=Date.now()-o;f<t&&f>=0?a=setTimeout(p,t-f):(a=void 0,r||(l=u()))}const h=function(...f){if(s&&this!==s&&Object.getPrototypeOf(this)===Object.getPrototypeOf(s))throw new Error("Debounced method called with different contexts of the same prototype.");s=this,i=f,o=Date.now();const v=r&&!a;if(a||(a=setTimeout(p,t)),v)return l=u(),l};return Object.defineProperty(h,"isPending",{get(){return a!==void 0}}),h.clear=()=>{a&&(clearTimeout(a),a=void 0,s=void 0,i=void 0)},h.flush=()=>{a&&h.trigger()},h.trigger=()=>{l=u(),h.clear()},h}var jt={exports:{}},ls=jt.exports,pr;function us(){return pr||(pr=1,(function(e,t){(function(n,r){e.exports=r(vr())})(ls,(function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var s=r(n),i={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(a){return a+"º"}};return s.default.locale(i,null,!0),i}))})(jt)),jt.exports}us();var ze={},mr;function fs(){if(mr)return ze;mr=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.LanguageTranslator=void 0,ze.getChildStyleToPass=e,ze.addComponent=t;function e(r,s){var i,a,o="";try{if(r&&s?.length&&(!((i=Object.keys(r))===null||i===void 0)&&i.length)&&(!((a=s?.filter(function(f){return Object.keys(r).includes(f.name)}))===null||a===void 0)&&a.length))for(var l=function(f){var v=s?.filter(function(x){return x.name===f&&x.defaultValue!==r[f]});v&&(o+="".concat(f,":").concat(r[f],";"))},u=0,p=Object.keys(r);u<p.length;u++){var h=p[u];l(h)}}catch(f){console.error("error getting child style to pass",f)}finally{return o}}function t(r){var s,i=((s=r?.repoName.split("/"))===null||s===void 0?void 0:s[1])||r?.repoName;if(!i)throw new Error("wrong componentPath "+r?.repoName);if(!r?.version)throw new Error("wrong version "+r?.version);var a=r?.iifePath||"main.iife.js";if(!document.getElementById(i+"-script"))try{var o=document.createElement("script");if(o.id=i+"-script",o.src="https://cdn.jsdelivr.net/npm/".concat(r.repoName,"@").concat(r.version,"/").concat(a),r?.local)o.src="".concat(r.local);else if(location.href.includes("localhost:6006")){var l=i.split("-")[0];o.src="http://localhost:6006/webcomponents/".concat(i.replace(l+"-",""),"/").concat(a)}document.head.appendChild(o)}catch(u){console.warn(u)}}var n=(function(){function r(s){if(this.lang="",!s?.dictionary)throw new Error("no dictionary provided");this.dictionary=s.dictionary,this.setLang(s?.lang)}return r.prototype.setLang=function(s){s||(s=r.getDefaultLang()),this.lang=s},r.prototype.translateWord=function(s,i){return r.getDictionaryWord(s,this.dictionary,i||this.lang)},r.prototype.translateDate=function(s,i,a){return r.formatDate(s,i,a||this.lang)},r.getDefaultLang=function(){var s,i,a,o="en";return navigator?.languages&&(!((a=(i=(s=navigator.languages[0])===null||s===void 0?void 0:s.split("-")[0])===null||i===void 0?void 0:i.toLowerCase())===null||a===void 0)&&a.length)&&(o=navigator.languages[0].split("-")[0].toLowerCase()),o},r.getDictionaryWord=function(s,i,a){var o;if(!s)throw new Error("no wordKey provided");if(!i)throw new Error("no dictionary provided");if(a&&(!((o=i[a])===null||o===void 0)&&o[s]))return i[a][s];var l="",u=r.getDefaultLang();if(!a||u!==a){var p=i?.[u];p?.[s]&&(l=p[s])}return l},r.formatDate=function(s,i,a){if(!s)throw new Error("no date provided");if(typeof s.getMonth!="function")throw new Error("wrong date format");var o=new Intl.DateTimeFormat(a||r.getDefaultLang(),i);return o.format(s)},r})();return ze.LanguageTranslator=n,ze}var cs=fs(),ds=ar('<div style="text-align:right;padding-right:60px" class="svelte-1694i3h"><button class="btn btn-default svelte-1694i3h"><i class="bi-printer-fill svelte-1694i3h"></i></button> <button class="btn btn-default svelte-1694i3h"><i class="bi-arrows-fullscreen svelte-1694i3h"></i></button></div>'),hs=ar('<div id="page" class="container svelte-1694i3h"><div class="row svelte-1694i3h" style="margin-top:20px"><div class="col svelte-1694i3h"><img style="height:80px;margin:0px 0px 0px 60px" alt="" class="svelte-1694i3h"/> <span style="margin:0px 40px 0px 40px" class="svelte-1694i3h"> </span></div> <div class="col svelte-1694i3h"><!></div></div> <div class="row svelte-1694i3h" style="margin-top:60px"><div class="col svelte-1694i3h"> </div> <div class="col svelte-1694i3h"></div> <div class="col svelte-1694i3h"> </div></div> <div class="row svelte-1694i3h" style="margin-top:40px"><div class="col svelte-1694i3h"><div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div></div> <div class="col svelte-1694i3h"><div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div></div> <div class="col svelte-1694i3h"><div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div></div></div> <div class="row svelte-1694i3h" style="margin-top:40px"><div class="col svelte-1694i3h"><hb-table></hb-table></div></div> <div class="row svelte-1694i3h" style="margin-top:40px"><div class="col svelte-1694i3h"><div style="width:300px;float:right" class="svelte-1694i3h"><div style="text-align:left;" class="svelte-1694i3h"><div style="line-height:25px" class="svelte-1694i3h"><span style="display:inline-block;min-width:200px;" class="svelte-1694i3h">SubTotale:</span> </div> <div style="line-height:25px" class="svelte-1694i3h"><span style="display:inline-block;min-width:200px;" class="svelte-1694i3h">Tasse:</span> </div> <div style="line-height:25px;font-weight:bold" class="svelte-1694i3h"><span style="display:inline-block;min-width:200px;" class="svelte-1694i3h">Totale:</span> </div></div></div></div></div></div>',2);const vs={hash:"svelte-1694i3h",code:`@charset "UTF-8";
1
+ (function(dn){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const Fr=1,Hr=4,qr=8,zr=16,Br=1,Ur=2,hn="[",vn="[!",_n="[?",pn="]",Ze={},B=Symbol(),mn="http://www.w3.org/1999/xhtml",Vr=!1;var Wr=Array.isArray,Jr=Array.prototype.indexOf,Ke=Array.prototype.includes,Gr=Array.from,yt=Object.keys,$t=Object.defineProperty,He=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyDescriptors,Kr=Object.prototype,Xr=Array.prototype,bn=Object.getPrototypeOf,gn=Object.isExtensible;const Qr=()=>{};function ei(e){for(var t=0;t<e.length;t++)e[t]()}function wn(){var e,t,n=new Promise((r,i)=>{e=r,t=i});return{promise:n,resolve:e,reject:t}}const q=2,Xe=4,xt=8,yn=1<<24,Me=16,de=32,De=64,Ft=128,te=512,H=1024,W=2048,he=4096,ve=8192,le=16384,Oe=32768,$n=1<<25,Qe=65536,xn=1<<17,ti=1<<18,qe=1<<19,ni=1<<20,ze=65536,Ht=1<<21,qt=1<<22,Ne=1<<23,Et=Symbol("$state"),En=Symbol("legacy props"),ri=Symbol(""),ge=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ii=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),lt=3,Tt=8;function si(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function ai(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function oi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function li(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ui(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function fi(){throw new Error("https://svelte.dev/e/hydration_failed")}function ci(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function di(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function hi(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function vi(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function _i(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function St(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function pi(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let N=!1;function Ae(e){N=e}let O;function ne(e){if(e===null)throw St(),Ze;return O=e}function zt(){return ne($e(O))}function S(e){if(N){if($e(O)!==null)throw St(),Ze;O=e}}function mi(e=1){if(N){for(var t=e,n=O;t--;)n=$e(n);O=n}}function Tn(e=!0){for(var t=0,n=O;;){if(n.nodeType===Tt){var r=n.data;if(r===pn){if(t===0)return n;t-=1}else(r===hn||r===vn||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=$e(n);e&&n.remove(),n=i}}function bi(e){if(!e||e.nodeType!==Tt)throw St(),Ze;return e.data}function Sn(e){return e===this.v}function gi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function kn(e){return!gi(e,this.v)}let wi=!1,re=null;function et(e){re=e}function Mn(e,t=!1,n){re={p:re,i:!1,c:null,e:null,s:e,x:null,r:E,l:null}}function Dn(e){var t=re,n=t.e;if(n!==null){t.e=null;for(var r of n)Kn(r)}return e!==void 0&&(t.x=e),t.i=!0,re=t.p,e??{}}function On(){return!0}let Be=[];function Nn(){var e=Be;Be=[],ei(e)}function tt(e){if(Be.length===0&&!ut){var t=Be;queueMicrotask(()=>{t===Be&&Nn()})}Be.push(e)}function yi(){for(;Be.length>0;)Nn()}function An(e){var t=E;if(t===null)return x.f|=Ne,e;if((t.f&Oe)===0&&(t.f&Xe)===0)throw e;Ce(e,t)}function Ce(e,t){for(;t!==null;){if((t.f&Ft)!==0){if((t.f&Oe)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const $i=-7169;function j(e,t){e.f=e.f&$i|t}function Bt(e){(e.f&te)!==0||e.deps===null?j(e,H):j(e,he)}function Cn(e){if(e!==null)for(const t of e)(t.f&q)===0||(t.f&ze)===0||(t.f^=ze,Cn(t.deps))}function Ln(e,t,n){(e.f&W)!==0?t.add(e):(e.f&he)!==0&&n.add(e),Cn(e.deps),j(e,H)}let kt=!1;function xi(e){var t=kt;try{return kt=!1,[e(),kt]}finally{kt=t}}const Le=new Set;let L=null,ue=null,Ut=null,ut=!1,Vt=!1,nt=null,Mt=null;var Pn=0;let Ei=1;class we{id=Ei++;current=new Map;previous=new Map;#e=new Set;#n=new Set;#t=new Map;#i=new Map;#s=null;#r=[];#a=new Set;#o=new Set;#l=new Map;is_fork=!1;#c=!1;#u=new Set;#d(){return this.is_fork||this.#i.size>0}#v(){for(const r of this.#u)for(const i of r.#i.keys()){for(var t=!1,n=i;n.parent!==null;){if(this.#l.has(n)){t=!0;break}n=n.parent}if(!t)return!0}return!1}skip_effect(t){this.#l.has(t)||this.#l.set(t,{d:[],m:[]})}unskip_effect(t){var n=this.#l.get(t);if(n){this.#l.delete(t);for(var r of n.d)j(r,W),this.schedule(r);for(r of n.m)j(r,he),this.schedule(r)}}#h(){if(Pn++>1e3&&(Le.delete(this),Ti()),!this.#d()){for(const o of this.#a)this.#o.delete(o),j(o,W),this.schedule(o);for(const o of this.#o)j(o,he),this.schedule(o)}const t=this.#r;this.#r=[],this.apply();var n=nt=[],r=[],i=Mt=[];for(const o of t)try{this.#f(o,n,r)}catch(u){throw Fn(o),u}if(L=null,i.length>0){var s=we.ensure();for(const o of i)s.schedule(o)}if(nt=null,Mt=null,this.#d()||this.#v()){this.#_(r),this.#_(n);for(const[o,u]of this.#l)Yn(o,u)}else{this.#t.size===0&&Le.delete(this),this.#a.clear(),this.#o.clear();for(const o of this.#e)o(this);this.#e.clear(),Rn(r),Rn(n),this.#s?.resolve()}var a=L;if(this.#r.length>0){const o=a??=this;o.#r.push(...this.#r.filter(u=>!o.#r.includes(u)))}a!==null&&(Le.add(a),a.#h()),Le.has(this)||this.#p()}#f(t,n,r){t.f^=H;for(var i=t.first;i!==null;){var s=i.f,a=(s&(de|De))!==0,o=a&&(s&H)!==0,u=o||(s&ve)!==0||this.#l.has(i);if(!u&&i.fn!==null){a?i.f^=H:(s&Xe)!==0?n.push(i):vt(i)&&((s&Me)!==0&&this.#o.add(i),at(i));var l=i.first;if(l!==null){i=l;continue}}for(;i!==null;){var f=i.next;if(f!==null){i=f;break}i=i.parent}}}#_(t){for(var n=0;n<t.length;n+=1)Ln(t[n],this.#a,this.#o)}capture(t,n,r=!1){n!==B&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&Ne)===0&&(this.current.set(t,[t.v,r]),ue?.set(t,t.v))}activate(){L=this}deactivate(){L=null,ue=null}flush(){try{Vt=!0,L=this,this.#h()}finally{Pn=0,Ut=null,nt=null,Mt=null,Vt=!1,L=null,ue=null,Pe.clear()}}discard(){for(const t of this.#n)t(this);this.#n.clear(),Le.delete(this)}#p(){for(const l of Le){var t=l.id<this.id,n=[];for(const[f,[h,c]]of this.current){if(l.current.has(f)){var r=l.current.get(f)[0];if(t&&h!==r)l.current.set(f,[h,c]);else continue}n.push(f)}var i=[...l.current.keys()].filter(f=>!this.current.has(f));if(i.length===0)t&&l.discard();else if(n.length>0){l.activate();var s=new Set,a=new Map;for(var o of n)In(o,i,s,a);if(l.#r.length>0){l.apply();for(var u of l.#r)l.#f(u,[],[]);l.#r=[]}l.deactivate()}}for(const l of Le)l.#u.has(this)&&(l.#u.delete(this),l.#u.size===0&&!l.#d()&&(l.activate(),l.#h()))}increment(t,n){let r=this.#t.get(n)??0;if(this.#t.set(n,r+1),t){let i=this.#i.get(n)??0;this.#i.set(n,i+1)}}decrement(t,n,r){let i=this.#t.get(n)??0;if(i===1?this.#t.delete(n):this.#t.set(n,i-1),t){let s=this.#i.get(n)??0;s===1?this.#i.delete(n):this.#i.set(n,s-1)}this.#c||r||(this.#c=!0,tt(()=>{this.#c=!1,this.flush()}))}transfer_effects(t,n){for(const r of t)this.#a.add(r);for(const r of n)this.#o.add(r);t.clear(),n.clear()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#n.add(t)}settled(){return(this.#s??=wn()).promise}static ensure(){if(L===null){const t=L=new we;Vt||(Le.add(L),ut||tt(()=>{L===t&&t.flush()}))}return L}apply(){{ue=null;return}}schedule(t){if(Ut=t,t.b?.is_pending&&(t.f&(Xe|xt|yn))!==0&&(t.f&Oe)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(nt!==null&&n===E&&(x===null||(x.f&q)===0))return;if((r&(De|de))!==0){if((r&H)===0)return;n.f^=H}}this.#r.push(n)}}function ft(e){var t=ut;ut=!0;try{for(var n;;){if(yi(),L===null)return n;L.flush()}}finally{ut=t}}function Ti(){try{ui()}catch(e){Ce(e,Ut)}}let ye=null;function Rn(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(le|ve))===0&&vt(r)&&(ye=new Set,at(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&tr(r),ye?.size>0)){Pe.clear();for(const i of ye){if((i.f&(le|ve))!==0)continue;const s=[i];let a=i.parent;for(;a!==null;)ye.has(a)&&(ye.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){const u=s[o];(u.f&(le|ve))===0&&at(u)}}ye.clear()}}ye=null}}function In(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&q)!==0?In(i,t,n,r):(s&(qt|Me))!==0&&(s&W)===0&&jn(i,t,r)&&(j(i,W),Wt(i))}}function jn(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(Ke.call(t,i))return!0;if((i.f&q)!==0&&jn(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function Wt(e){L.schedule(e)}function Yn(e,t){if(!((e.f&de)!==0&&(e.f&H)!==0)){(e.f&W)!==0?t.d.push(e):(e.f&he)!==0&&t.m.push(e),j(e,H);for(var n=e.first;n!==null;)Yn(n,t),n=n.next}}function Fn(e){j(e,H);for(var t=e.first;t!==null;)Fn(t),t=t.next}function Si(e){let t=0,n=ct(0),r;return()=>{Xt()&&(A(n),Xn(()=>(t===0&&(r=vr(()=>e(()=>dt(n)))),t+=1,()=>{tt(()=>{t-=1,t===0&&(r?.(),r=void 0,dt(n))})})))}}var ki=Qe|qe;function Mi(e,t,n,r){new Di(e,t,n,r)}class Di{parent;is_pending=!1;transform_error;#e;#n=N?O:null;#t;#i;#s;#r=null;#a=null;#o=null;#l=null;#c=0;#u=0;#d=!1;#v=new Set;#h=new Set;#f=null;#_=Si(()=>(this.#f=ct(this.#c),()=>{this.#f=null}));constructor(t,n,r,i){this.#e=t,this.#t=n,this.#i=s=>{var a=E;a.b=this,a.f|=Ft,r(s)},this.parent=E.b,this.transform_error=i??this.parent?.transform_error??(s=>s),this.#s=Qn(()=>{if(N){const s=this.#n;zt();const a=s.data===vn;if(s.data.startsWith(_n)){const u=JSON.parse(s.data.slice(_n.length));this.#y(u)}else a?this.#$():this.#p()}else this.#g()},ki),N&&(this.#e=O)}#p(){try{this.#r=xe(()=>this.#i(this.#e))}catch(t){this.error(t)}}#y(t){const n=this.#t.failed;n&&(this.#o=xe(()=>{n(this.#e,()=>t,()=>()=>{})}))}#$(){const t=this.#t.pending;t&&(this.is_pending=!0,this.#a=xe(()=>t(this.#e)),tt(()=>{var n=this.#l=document.createDocumentFragment(),r=fe();n.append(r),this.#r=this.#b(()=>xe(()=>this.#i(r))),this.#u===0&&(this.#e.before(n),this.#l=null,ht(this.#a,()=>{this.#a=null}),this.#m(L))}))}#g(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#c=0,this.#r=xe(()=>{this.#i(this.#e)}),this.#u>0){var t=this.#l=document.createDocumentFragment();ir(this.#r,t);const n=this.#t.pending;this.#a=xe(()=>n(this.#e))}else this.#m(L)}catch(n){this.error(n)}}#m(t){this.is_pending=!1,t.transfer_effects(this.#v,this.#h)}defer_effect(t){Ln(t,this.#v,this.#h)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#t.pending}#b(t){var n=E,r=x,i=re;ie(this.#s),K(this.#s),et(this.#s.ctx);try{return we.ensure(),t()}catch(s){return An(s),null}finally{ie(n),K(r),et(i)}}#w(t,n){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(t,n);return}this.#u+=t,this.#u===0&&(this.#m(n),this.#a&&ht(this.#a,()=>{this.#a=null}),this.#l&&(this.#e.before(this.#l),this.#l=null))}update_pending_count(t,n){this.#w(t,n),this.#c+=t,!(!this.#f||this.#d)&&(this.#d=!0,tt(()=>{this.#d=!1,this.#f&&Nt(this.#f,this.#c)}))}get_effect_pending(){return this.#_(),A(this.#f)}error(t){var n=this.#t.onerror;let r=this.#t.failed;if(!n&&!r)throw t;this.#r&&(Z(this.#r),this.#r=null),this.#a&&(Z(this.#a),this.#a=null),this.#o&&(Z(this.#o),this.#o=null),N&&(ne(this.#n),mi(),ne(Tn()));var i=!1,s=!1;const a=()=>{if(i){pi();return}i=!0,s&&_i(),this.#o!==null&&ht(this.#o,()=>{this.#o=null}),this.#b(()=>{this.#g()})},o=u=>{try{s=!0,n?.(u,a),s=!1}catch(l){Ce(l,this.#s&&this.#s.parent)}r&&(this.#o=this.#b(()=>{try{return xe(()=>{var l=E;l.b=this,l.f|=Ft,r(this.#e,()=>u,()=>a)})}catch(l){return Ce(l,this.#s.parent),null}}))};tt(()=>{var u;try{u=this.transform_error(t)}catch(l){Ce(l,this.#s&&this.#s.parent);return}u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(o,l=>Ce(l,this.#s&&this.#s.parent)):o(u)})}}function Oi(e,t,n,r){const i=Ot;var s=e.filter(c=>!c.settled);if(n.length===0&&s.length===0){r(t.map(i));return}var a=E,o=Ni(),u=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(c=>c.promise)):null;function l(c){o();try{r(c)}catch(m){(a.f&le)===0&&Ce(m,a)}Dt()}if(n.length===0){u.then(()=>l(t.map(i)));return}var f=Hn();function h(){Promise.all(n.map(c=>Ai(c))).then(c=>l([...t.map(i),...c])).catch(c=>Ce(c,a)).finally(()=>f())}u?u.then(()=>{o(),h(),Dt()}):h()}function Ni(){var e=E,t=x,n=re,r=L;return function(s=!0){ie(e),K(t),et(n),s&&(e.f&le)===0&&(r?.activate(),r?.apply())}}function Dt(e=!0){ie(null),K(null),et(null),e&&L?.deactivate()}function Hn(){var e=E,t=e.b,n=L,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function Ot(e){var t=q|W,n=x!==null&&(x.f&q)!==0?x:null;return E!==null&&(E.f|=qe),{ctx:re,deps:null,effects:null,equals:Sn,f:t,fn:e,reactions:null,rv:0,v:B,wv:0,parent:n??E,ac:null}}function Ai(e,t,n){let r=E;r===null&&si();var i=void 0,s=ct(B),a=!x,o=new Map;return Gi(()=>{var u=E,l=wn();i=l.promise;try{Promise.resolve(e()).then(l.resolve,l.reject).finally(Dt)}catch(m){l.reject(m),Dt()}var f=L;if(a){if((u.f&Oe)!==0)var h=Hn();if(r.b.is_rendered())o.get(f)?.reject(ge),o.delete(f);else{for(const m of o.values())m.reject(ge);o.clear()}o.set(f,l)}const c=(m,g=void 0)=>{if(h){var T=g===ge;h(T)}if(!(g===ge||(u.f&le)!==0)){if(f.activate(),g)s.f|=Ne,Nt(s,g);else{(s.f&Ne)!==0&&(s.f^=Ne),Nt(s,m);for(const[C,U]of o){if(o.delete(C),C===f)break;U.reject(ge)}}f.deactivate()}};l.promise.then(c,m=>c(null,m||"unknown"))}),Bi(()=>{for(const u of o.values())u.reject(ge)}),new Promise(u=>{function l(f){function h(){f===i?u(s):l(i)}f.then(h,h)}l(i)})}function rt(e){const t=Ot(e);return ar(t),t}function Ci(e){const t=Ot(e);return t.equals=kn,t}function Li(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Z(t[n])}}function Pi(e){for(var t=e.parent;t!==null;){if((t.f&q)===0)return(t.f&le)===0?t:null;t=t.parent}return null}function Jt(e){var t,n=E;ie(Pi(e));try{e.f&=~ze,Li(e),t=cr(e)}finally{ie(n)}return t}function qn(e){var t=e.v,n=Jt(e);if(!e.equals(n)&&(e.wv=ur(),(!L?.is_fork||e.deps===null)&&(e.v=n,L?.capture(e,t,!0),e.deps===null))){j(e,H);return}Re||(ue!==null?(Xt()||L?.is_fork)&&ue.set(e,n):Bt(e))}function Ri(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(ge),t.teardown=Qr,t.ac=null,_t(t,0),en(t))}function zn(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&at(t)}let Gt=new Set;const Pe=new Map;let Bn=!1;function ct(e,t){var n={f:0,v:e,reactions:null,equals:Sn,rv:0,wv:0};return n}function _e(e,t){const n=ct(e);return ar(n),n}function Ii(e,t=!1,n=!0){const r=ct(e);return t||(r.equals=kn),r}function G(e,t,n=!1){x!==null&&(!ce||(x.f&xn)!==0)&&On()&&(x.f&(q|Me|qt|xn))!==0&&(se===null||!Ke.call(se,e))&&vi();let r=n?it(t):t;return Nt(e,r,Mt)}function Nt(e,t,n=null){if(!e.equals(t)){var r=e.v;Re?Pe.set(e,t):Pe.set(e,r),e.v=t;var i=we.ensure();if(i.capture(e,r),(e.f&q)!==0){const s=e;(e.f&W)!==0&&Jt(s),ue===null&&Bt(s)}e.wv=ur(),Un(e,W,n),E!==null&&(E.f&H)!==0&&(E.f&(de|De))===0&&(ae===null?Qi([e]):ae.push(e)),!i.is_fork&&Gt.size>0&&!Bn&&ji()}return t}function ji(){Bn=!1;for(const e of Gt)(e.f&H)!==0&&j(e,he),vt(e)&&at(e);Gt.clear()}function dt(e){G(e,e.v+1)}function Un(e,t,n){var r=e.reactions;if(r!==null)for(var i=r.length,s=0;s<i;s++){var a=r[s],o=a.f,u=(o&W)===0;if(u&&j(a,t),(o&q)!==0){var l=a;ue?.delete(l),(o&ze)===0&&(o&te&&(a.f|=ze),Un(l,he,n))}else if(u){var f=a;(o&Me)!==0&&ye!==null&&ye.add(f),n!==null?n.push(f):Wt(f)}}}function it(e){if(typeof e!="object"||e===null||Et in e)return e;const t=bn(e);if(t!==Kr&&t!==Xr)return e;var n=new Map,r=Wr(e),i=_e(0),s=Ve,a=o=>{if(Ve===s)return o();var u=x,l=Ve;K(null),lr(s);var f=o();return K(u),lr(l),f};return r&&n.set("length",_e(e.length)),new Proxy(e,{defineProperty(o,u,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&di();var f=n.get(u);return f===void 0?a(()=>{var h=_e(l.value);return n.set(u,h),h}):G(f,l.value,!0),!0},deleteProperty(o,u){var l=n.get(u);if(l===void 0){if(u in o){const f=a(()=>_e(B));n.set(u,f),dt(i)}}else G(l,B),dt(i);return!0},get(o,u,l){if(u===Et)return e;var f=n.get(u),h=u in o;if(f===void 0&&(!h||He(o,u)?.writable)&&(f=a(()=>{var m=it(h?o[u]:B),g=_e(m);return g}),n.set(u,f)),f!==void 0){var c=A(f);return c===B?void 0:c}return Reflect.get(o,u,l)},getOwnPropertyDescriptor(o,u){var l=Reflect.getOwnPropertyDescriptor(o,u);if(l&&"value"in l){var f=n.get(u);f&&(l.value=A(f))}else if(l===void 0){var h=n.get(u),c=h?.v;if(h!==void 0&&c!==B)return{enumerable:!0,configurable:!0,value:c,writable:!0}}return l},has(o,u){if(u===Et)return!0;var l=n.get(u),f=l!==void 0&&l.v!==B||Reflect.has(o,u);if(l!==void 0||E!==null&&(!f||He(o,u)?.writable)){l===void 0&&(l=a(()=>{var c=f?it(o[u]):B,m=_e(c);return m}),n.set(u,l));var h=A(l);if(h===B)return!1}return f},set(o,u,l,f){var h=n.get(u),c=u in o;if(r&&u==="length")for(var m=l;m<h.v;m+=1){var g=n.get(m+"");g!==void 0?G(g,B):m in o&&(g=a(()=>_e(B)),n.set(m+"",g))}if(h===void 0)(!c||He(o,u)?.writable)&&(h=a(()=>_e(void 0)),G(h,it(l)),n.set(u,h));else{c=h.v!==B;var T=a(()=>it(l));G(h,T)}var C=Reflect.getOwnPropertyDescriptor(o,u);if(C?.set&&C.set.call(f,l),!c){if(r&&typeof u=="string"){var U=n.get("length"),p=Number(u);Number.isInteger(p)&&p>=U.v&&G(U,p+1)}dt(i)}return!0},ownKeys(o){A(i);var u=Reflect.ownKeys(o).filter(h=>{var c=n.get(h);return c===void 0||c.v!==B});for(var[l,f]of n)f.v!==B&&!(l in o)&&u.push(l);return u},setPrototypeOf(){hi()}})}var Vn,Wn,Jn,Gn;function Zt(){if(Vn===void 0){Vn=window,Wn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Jn=He(t,"firstChild").get,Gn=He(t,"nextSibling").get,gn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),gn(n)&&(n.__t=void 0)}}function fe(e=""){return document.createTextNode(e)}function st(e){return Jn.call(e)}function $e(e){return Gn.call(e)}function k(e,t){if(!N)return st(e);var n=st(O);if(n===null)n=O.appendChild(fe());else if(t&&n.nodeType!==lt){var r=fe();return n?.before(r),ne(r),r}return t&&At(n),ne(n),n}function Yi(e,t=!1){if(!N){var n=st(e);return n instanceof Comment&&n.data===""?$e(n):n}if(t){if(O?.nodeType!==lt){var r=fe();return O?.before(r),ne(r),r}At(O)}return O}function Y(e,t=1,n=!1){let r=N?O:e;for(var i;t--;)i=r,r=$e(r);if(!N)return r;if(n){if(r?.nodeType!==lt){var s=fe();return r===null?i?.after(s):r.before(s),ne(s),s}At(r)}return ne(r),r}function Fi(e){e.textContent=""}function Hi(){return!1}function Kt(e,t,n){return document.createElementNS(mn,e,void 0)}function At(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===lt;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Zn(e){var t=x,n=E;K(null),ie(null);try{return e()}finally{K(t),ie(n)}}function qi(e){E===null&&(x===null&&li(),oi()),Re&&ai()}function zi(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function pe(e,t){var n=E;n!==null&&(n.f&ve)!==0&&(e|=ve);var r={ctx:re,deps:null,nodes:null,f:e|W|te,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if((e&Xe)!==0)nt!==null?nt.push(r):we.ensure().schedule(r);else if(t!==null){try{at(r)}catch(a){throw Z(r),a}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&qe)===0&&(i=i.first,(e&Me)!==0&&(e&Qe)!==0&&i!==null&&(i.f|=Qe))}if(i!==null&&(i.parent=n,n!==null&&zi(i,n),x!==null&&(x.f&q)!==0&&(e&De)===0)){var s=x;(s.effects??=[]).push(i)}return r}function Xt(){return x!==null&&!ce}function Bi(e){const t=pe(xt,null);return j(t,H),t.teardown=e,t}function Ui(e){qi();var t=E.f,n=!x&&(t&de)!==0&&(t&Oe)===0;if(n){var r=re;(r.e??=[]).push(e)}else return Kn(e)}function Kn(e){return pe(Xe|ni,e)}function Vi(e){we.ensure();const t=pe(De|qe,e);return()=>{Z(t)}}function Wi(e){we.ensure();const t=pe(De|qe,e);return(n={})=>new Promise(r=>{n.outro?ht(t,()=>{Z(t),r(void 0)}):(Z(t),r(void 0))})}function Ji(e){return pe(Xe,e)}function Gi(e){return pe(qt|qe,e)}function Xn(e,t=0){return pe(xt|t,e)}function Qt(e,t=[],n=[],r=[]){Oi(r,t,n,i=>{pe(xt,()=>e(...i.map(A)))})}function Qn(e,t=0){var n=pe(Me|t,e);return n}function xe(e){return pe(de|qe,e)}function er(e){var t=e.teardown;if(t!==null){const n=Re,r=x;sr(!0),K(null);try{t.call(null)}finally{sr(n),K(r)}}}function en(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&Zn(()=>{i.abort(ge)});var r=n.next;(n.f&De)!==0?n.parent=null:Z(n,t),n=r}}function Zi(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&de)===0&&Z(t),t=n}}function Z(e,t=!0){var n=!1;(t||(e.f&ti)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Ki(e.nodes.start,e.nodes.end),n=!0),j(e,$n),en(e,t&&!n),_t(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const s of r)s.stop();er(e),e.f^=$n,e.f|=le;var i=e.parent;i!==null&&i.first!==null&&tr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ki(e,t){for(;e!==null;){var n=e===t?null:$e(e);e.remove(),e=n}}function tr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function ht(e,t,n=!0){var r=[];nr(e,r,!0);var i=()=>{n&&Z(e),t&&t()},s=r.length;if(s>0){var a=()=>--s||i();for(var o of r)o.out(a)}else i()}function nr(e,t,n){if((e.f&ve)===0){e.f^=ve;var r=e.nodes&&e.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&t.push(o);for(var i=e.first;i!==null;){var s=i.next,a=(i.f&Qe)!==0||(i.f&de)!==0&&(e.f&Me)!==0;nr(i,t,a?n:!1),i=s}}}function Xi(e){rr(e,!0)}function rr(e,t){if((e.f&ve)!==0){e.f^=ve,(e.f&H)===0&&(j(e,W),we.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&Qe)!==0||(n.f&de)!==0;rr(n,i?t:!1),n=r}var s=e.nodes&&e.nodes.t;if(s!==null)for(const a of s)(a.is_global||t)&&a.in()}}function ir(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:$e(n);t.append(n),n=i}}let Ct=!1,Re=!1;function sr(e){Re=e}let x=null,ce=!1;function K(e){x=e}let E=null;function ie(e){E=e}let se=null;function ar(e){x!==null&&(se===null?se=[e]:se.push(e))}let X=null,ee=0,ae=null;function Qi(e){ae=e}let or=1,Ue=0,Ve=Ue;function lr(e){Ve=e}function ur(){return++or}function vt(e){var t=e.f;if((t&W)!==0)return!0;if(t&q&&(e.f&=~ze),(t&he)!==0){for(var n=e.deps,r=n.length,i=0;i<r;i++){var s=n[i];if(vt(s)&&qn(s),s.wv>e.wv)return!0}(t&te)!==0&&ue===null&&j(e,H)}return!1}function fr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(se!==null&&Ke.call(se,e)))for(var i=0;i<r.length;i++){var s=r[i];(s.f&q)!==0?fr(s,t,!1):t===s&&(n?j(s,W):(s.f&H)!==0&&j(s,he),Wt(s))}}function cr(e){var t=X,n=ee,r=ae,i=x,s=se,a=re,o=ce,u=Ve,l=e.f;X=null,ee=0,ae=null,x=(l&(de|De))===0?e:null,se=null,et(e.ctx),ce=!1,Ve=++Ue,e.ac!==null&&(Zn(()=>{e.ac.abort(ge)}),e.ac=null);try{e.f|=Ht;var f=e.fn,h=f();e.f|=Oe;var c=e.deps,m=L?.is_fork;if(X!==null){var g;if(m||_t(e,ee),c!==null&&ee>0)for(c.length=ee+X.length,g=0;g<X.length;g++)c[ee+g]=X[g];else e.deps=c=X;if(Xt()&&(e.f&te)!==0)for(g=ee;g<c.length;g++)(c[g].reactions??=[]).push(e)}else!m&&c!==null&&ee<c.length&&(_t(e,ee),c.length=ee);if(On()&&ae!==null&&!ce&&c!==null&&(e.f&(q|he|W))===0)for(g=0;g<ae.length;g++)fr(ae[g],e);if(i!==null&&i!==e){if(Ue++,i.deps!==null)for(let T=0;T<n;T+=1)i.deps[T].rv=Ue;if(t!==null)for(const T of t)T.rv=Ue;ae!==null&&(r===null?r=ae:r.push(...ae))}return(e.f&Ne)!==0&&(e.f^=Ne),h}catch(T){return An(T)}finally{e.f^=Ht,X=t,ee=n,ae=r,x=i,se=s,et(a),ce=o,Ve=u}}function es(e,t){let n=t.reactions;if(n!==null){var r=Jr.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&(t.f&q)!==0&&(X===null||!Ke.call(X,t))){var s=t;(s.f&te)!==0&&(s.f^=te,s.f&=~ze),Bt(s),Ri(s),_t(s,0)}}function _t(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)es(e,n[r])}function at(e){var t=e.f;if((t&le)===0){j(e,H);var n=E,r=Ct;E=e,Ct=!0;try{(t&(Me|yn))!==0?Zi(e):en(e),er(e);var i=cr(e);e.teardown=typeof i=="function"?i:null,e.wv=or;var s;Vr&&wi&&(e.f&W)!==0&&e.deps}finally{Ct=r,E=n}}}function A(e){var t=e.f,n=(t&q)!==0;if(x!==null&&!ce){var r=E!==null&&(E.f&le)!==0;if(!r&&(se===null||!Ke.call(se,e))){var i=x.deps;if((x.f&Ht)!==0)e.rv<Ue&&(e.rv=Ue,X===null&&i!==null&&i[ee]===e?ee++:X===null?X=[e]:X.push(e));else{(x.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[x]:Ke.call(s,x)||s.push(x)}}}if(Re&&Pe.has(e))return Pe.get(e);if(n){var a=e;if(Re){var o=a.v;return((a.f&H)===0&&a.reactions!==null||hr(a))&&(o=Jt(a)),Pe.set(a,o),o}var u=(a.f&te)===0&&!ce&&x!==null&&(Ct||(x.f&te)!==0),l=(a.f&Oe)===0;vt(a)&&(u&&(a.f|=te),qn(a)),u&&!l&&(zn(a),dr(a))}if(ue?.has(e))return ue.get(e);if((e.f&Ne)!==0)throw e.v;return e.v}function dr(e){if(e.f|=te,e.deps!==null)for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&q)!==0&&(t.f&te)===0&&(zn(t),dr(t))}function hr(e){if(e.v===B)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Pe.has(t)||(t.f&q)!==0&&hr(t))return!0;return!1}function vr(e){var t=ce;try{return ce=!0,e()}finally{ce=t}}const pt=Symbol("events"),_r=new Set,tn=new Set;function pr(e,t,n){(t[pt]??={})[e]=n}function ts(e){for(var t=0;t<e.length;t++)_r.add(e[t]);for(var n of tn)n(e)}let mr=null;function br(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],s=i[0]||e.target;mr=e;var a=0,o=mr===e&&e[pt];if(o){var u=i.indexOf(o);if(u!==-1&&(t===document||t===window)){e[pt]=t;return}var l=i.indexOf(t);if(l===-1)return;u<=l&&(a=u)}if(s=i[a]||e.target,s!==t){$t(e,"currentTarget",{configurable:!0,get(){return s||n}});var f=x,h=E;K(null),ie(null);try{for(var c,m=[];s!==null;){var g=s.assignedSlot||s.parentNode||s.host||null;try{var T=s[pt]?.[r];T!=null&&(!s.disabled||e.target===s)&&T.call(s,e)}catch(C){c?m.push(C):c=C}if(e.cancelBubble||g===t||g===null)break;s=g}if(c){for(let C of m)queueMicrotask(()=>{throw C});throw c}}finally{e[pt]=t,delete e.currentTarget,K(f),ie(h)}}}const ns=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function rs(e){return ns?.createHTML(e)??e}function is(e){var t=Kt("template");return t.innerHTML=rs(e.replaceAll("<!>","<!---->")),t.content}function Ie(e,t){var n=E;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function gr(e,t){var n=(t&Br)!==0,r=(t&Ur)!==0,i,s=!e.startsWith("<!>");return()=>{if(N)return Ie(O,null),O;i===void 0&&(i=is(s?e:"<!>"+e),n||(i=st(i)));var a=r||Wn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=st(a),u=a.lastChild;Ie(o,u)}else Ie(a,a);return a}}function ss(e=""){if(!N){var t=fe(e+"");return Ie(t,t),t}var n=O;return n.nodeType!==lt?(n.before(n=fe()),ne(n)):At(n),Ie(n,n),n}function as(){if(N)return Ie(O,null),O;var e=document.createDocumentFragment(),t=document.createComment(""),n=fe();return e.append(t,n),Ie(t,n),e}function mt(e,t){if(N){var n=E;((n.f&Oe)===0||n.nodes.end===null)&&(n.nodes.end=O),zt();return}e!==null&&e.before(t)}const os=["touchstart","touchmove"];function ls(e){return os.includes(e)}function Q(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function wr(e,t){return yr(e,t)}function us(e,t){Zt(),t.intro=t.intro??!1;const n=t.target,r=N,i=O;try{for(var s=st(n);s&&(s.nodeType!==Tt||s.data!==hn);)s=$e(s);if(!s)throw Ze;Ae(!0),ne(s);const a=yr(e,{...t,anchor:s});return Ae(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
+ `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==Ze&&console.warn("Failed to hydrate: ",a),t.recover===!1&&fi(),Zt(),Fi(n),Ae(!1),wr(e,t)}finally{Ae(r),ne(i)}}const Lt=new Map;function yr(e,{target:t,anchor:n,props:r={},events:i,context:s,intro:a=!0,transformError:o}){Zt();var u=void 0,l=Wi(()=>{var f=n??t.appendChild(fe());Mi(f,{pending:()=>{}},m=>{Mn({});var g=re;if(s&&(g.c=s),i&&(r.$$events=i),N&&Ie(m,null),u=e(m,r)||{},N&&(E.nodes.end=O,O===null||O.nodeType!==Tt||O.data!==pn))throw St(),Ze;Dn()},o);var h=new Set,c=m=>{for(var g=0;g<m.length;g++){var T=m[g];if(!h.has(T)){h.add(T);var C=ls(T);for(const P of[t,document]){var U=Lt.get(P);U===void 0&&(U=new Map,Lt.set(P,U));var p=U.get(T);p===void 0?(P.addEventListener(T,br,{passive:C}),U.set(T,1)):U.set(T,p+1)}}}};return c(Gr(_r)),tn.add(c),()=>{for(var m of h)for(const C of[t,document]){var g=Lt.get(C),T=g.get(m);--T==0?(C.removeEventListener(m,br),g.delete(m),g.size===0&&Lt.delete(C)):g.set(m,T)}tn.delete(c),f!==n&&f.parentNode?.removeChild(f)}});return nn.set(u,l),u}let nn=new WeakMap;function fs(e,t){const n=nn.get(e);return n?(nn.delete(e),n(t)):Promise.resolve()}class cs{anchor;#e=new Map;#n=new Map;#t=new Map;#i=new Set;#s=!0;constructor(t,n=!0){this.anchor=t,this.#s=n}#r=t=>{if(this.#e.has(t)){var n=this.#e.get(t),r=this.#n.get(n);if(r)Xi(r),this.#i.delete(n);else{var i=this.#t.get(n);i&&(this.#n.set(n,i.effect),this.#t.delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[s,a]of this.#e){if(this.#e.delete(s),s===t)break;const o=this.#t.get(a);o&&(Z(o.effect),this.#t.delete(a))}for(const[s,a]of this.#n){if(s===n||this.#i.has(s))continue;const o=()=>{if(Array.from(this.#e.values()).includes(s)){var l=document.createDocumentFragment();ir(a,l),l.append(fe()),this.#t.set(s,{effect:a,fragment:l})}else Z(a);this.#i.delete(s),this.#n.delete(s)};this.#s||!r?(this.#i.add(s),ht(a,o,!1)):o()}}};#a=t=>{this.#e.delete(t);const n=Array.from(this.#e.values());for(const[r,i]of this.#t)n.includes(r)||(Z(i.effect),this.#t.delete(r))};ensure(t,n){var r=L,i=Hi();if(n&&!this.#n.has(t)&&!this.#t.has(t))if(i){var s=document.createDocumentFragment(),a=fe();s.append(a),this.#t.set(t,{effect:xe(()=>n(a)),fragment:s})}else this.#n.set(t,xe(()=>n(this.anchor)));if(this.#e.set(r,t),i){for(const[o,u]of this.#n)o===t?r.unskip_effect(u):r.skip_effect(u);for(const[o,u]of this.#t)o===t?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(this.#r),r.ondiscard(this.#a)}else N&&(this.anchor=O),this.#r(r)}}function $r(e,t,n=!1){var r;N&&(r=O,zt());var i=new cs(e),s=n?Qe:0;function a(o,u){if(N){var l=bi(r);if(o!==parseInt(l.substring(1))){var f=Tn();ne(f),i.anchor=f,Ae(!1),i.ensure(o,u),Ae(!0);return}}i.ensure(o,u)}Qn(()=>{var o=!1;t((u,l=0)=>{o=!0,a(l,u)}),o||a(-1,null)},s)}function ds(e,t){Ji(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const i=Kt("style");i.id=t.hash,i.textContent=t.code,r.appendChild(i)}})}function hs(e,t,n){var r=""+e;return r}function vs(e,t,n,r,i,s){var a=e.__className;if(N||a!==n||a===void 0){var o=hs(n);(!N||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=n}return s}const _s=Symbol("is custom element"),ps=Symbol("is html"),ms=ii?"link":"LINK";function xr(e,t,n,r){var i=bs(e);N&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===ms)||i[t]!==(i[t]=n)&&(t==="loading"&&(e[ri]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Er(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function rn(e,t,n){var r=x,i=E;let s=N;N&&Ae(!1),K(null),ie(null);try{t!=="style"&&(sn.has(e.getAttribute("is")||e.nodeName)||!customElements||customElements.get(e.getAttribute("is")||e.nodeName.toLowerCase())?Er(e).includes(t):n&&typeof n=="object")?e[t]=n:xr(e,t,n==null?n:String(n))}finally{K(r),ie(i),s&&Ae(!0)}}function bs(e){return e.__attributes??={[_s]:e.nodeName.includes("-"),[ps]:e.namespaceURI===mn}}var sn=new Map;function Er(e){var t=e.getAttribute("is")||e.nodeName,n=sn.get(t);if(n)return n;sn.set(t,n=[]);for(var r,i=e,s=Element.prototype;s!==i;){r=Zr(i);for(var a in r)r[a].set&&n.push(a);i=bn(i)}return n}function Pt(e,t,n,r){var i=(n&qr)!==0,s=(n&zr)!==0,a=r,o=!0,u=()=>(o&&(o=!1,a=s?vr(r):r),a);let l;if(i){var f=Et in e||En in e;l=He(e,t)?.set??(f&&t in e?p=>e[t]=p:void 0)}var h,c=!1;i?[h,c]=xi(()=>e[t]):h=e[t],h===void 0&&r!==void 0&&(h=u(),l&&(ci(),l(h)));var m;if(m=()=>{var p=e[t];return p===void 0?u():(o=!0,p)},(n&Hr)===0)return m;if(l){var g=e.$$legacy;return(function(p,P){return arguments.length>0?((!P||g||c)&&l(P?m():p),p):m()})}var T=!1,C=((n&Fr)!==0?Ot:Ci)(()=>(T=!1,m()));i&&A(C);var U=E;return(function(p,P){if(arguments.length>0){const Ee=P?A(C):i?it(p):p;return G(C,Ee),T=!0,a!==void 0&&(a=Ee),p}return Re&&T||(U.f&le)!==0?C.v:A(C)})}function gs(e){return new ws(e)}class ws{#e;#n;constructor(t){var n=new Map,r=(s,a)=>{var o=Ii(a,!1,!1);return n.set(s,o),o};const i=new Proxy({...t.props||{},$$events:{}},{get(s,a){return A(n.get(a)??r(a,Reflect.get(s,a)))},has(s,a){return a===En?!0:(A(n.get(a)??r(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,o){return G(n.get(a)??r(a,o),o),Reflect.set(s,a,o)}});this.#n=(t.hydrate?us:wr)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&ft(),this.#e=i.$$events;for(const s of Object.keys(this.#n))s==="$set"||s==="$destroy"||s==="$on"||$t(this,s,{get(){return this.#n[s]},set(a){this.#n[s]=a},enumerable:!0});this.#n.$set=s=>{Object.assign(i,s)},this.#n.$destroy=()=>{fs(this.#n)}}$set(t){this.#n.$set(t)}$on(t,n){this.#e[t]=this.#e[t]||[];const r=(...i)=>n.call(this,...i);return this.#e[t].push(r),()=>{this.#e[t]=this.#e[t].filter(i=>i!==r)}}$destroy(){this.#n.$destroy()}}let Tr;typeof HTMLElement=="function"&&(Tr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(r){return i=>{const s=Kt("slot");r!=="default"&&(s.name=r),mt(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=ys(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(const r of this.attributes){const i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=Rt(i,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=gs({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Vi(()=>{Xn(()=>{this.$$r=!0;for(const r of yt(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const i=Rt(r,this.$$d[r],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,i)}this.$$r=!1})});for(const r in this.$$l)for(const i of this.$$l[r]){const s=this.$$c.$on(r,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Rt(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return yt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Rt(e,t,n,r){const i=n[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(i){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(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function ys(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function $s(e,t,n,r,i,s){let a=class extends Tr{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return yt(t).map(o=>(t[o].attribute||o).toLowerCase())}};return yt(t).forEach(o=>{$t(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(u){u=Rt(o,u,t),this.$$d[o]=u;var l=this.$$c;if(l){var f=He(l,o)?.get;f?l[o]=u:l.$set({[o]:u})}}})}),r.forEach(o=>{$t(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}function xs(e){const t=window.open("","PRINT","height=400,width=600");t.document.write("<html><head><title>"+document.title+"</title>"),t.document.write("</head><body >"),t.document.write(`<style>@page { size: auto; margin: 0mm; }</style><hb-page-invoice printer="yes" items='${JSON.stringify(e.items)}' headers='${JSON.stringify(e.headers)}'></hb-page-invoice>`),t.document.write("</body></html>");const n=document.createElement("script");n.id="hb-page-invoice-script",n.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-page-invoice@${e.version}/main.iife.js`,location.href.includes("localhost")&&(n.src="http://localhost:6006/webcomponents/page-invoice/main.iife.js"),t.document.head.appendChild(n),setTimeout(()=>{t.print(),t.close()},2e3)}function Es(e){const t=window.open("","PRINT","height=400,width=600");t.document.write("<html><head><title>"+document.title+"</title>"),t.document.write("</head><body >"),t.document.write(`<style>@page { size: auto; margin: 0mm; }</style><hb-page-invoice items='${JSON.stringify(e.items)}' headers='${JSON.stringify(e.headers)}'></hb-page-invoice>`),t.document.write("</body></html>");const n=document.createElement("script");n.id="hb-page-invoice-script",n.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-page-invoice@${e.version}/main.iife.js`,location.href.includes("localhost")&&(n.src="http://localhost:6006/webcomponents/page-invoice/main.iife.js"),t.document.head.appendChild(n)}const an={version:"0.66.2"};function Ts(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var It={exports:{}},Ss=It.exports,Sr;function kr(){return Sr||(Sr=1,(function(e,t){(function(n,r){e.exports=r()})(Ss,(function(){var n=1e3,r=6e4,i=36e5,s="millisecond",a="second",o="minute",u="hour",l="day",f="week",h="month",c="quarter",m="year",g="date",T="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,U=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(w){var _=["th","st","nd","rd"],d=w%100;return"["+w+(_[(d-20)%10]||_[d]||_[0])+"]"}},P=function(w,_,d){var b=String(w);return!b||b.length>=_?w:""+Array(_+1-b.length).join(d)+w},Ee={s:P,z:function(w){var _=-w.utcOffset(),d=Math.abs(_),b=Math.floor(d/60),v=d%60;return(_<=0?"+":"-")+P(b,2,"0")+":"+P(v,2,"0")},m:function w(_,d){if(_.date()<d.date())return-w(d,_);var b=12*(d.year()-_.year())+(d.month()-_.month()),v=_.clone().add(b,h),y=d-v<0,$=_.clone().add(b+(y?-1:1),h);return+(-(b+(d-v)/(y?v-$:$-v))||0)},a:function(w){return w<0?Math.ceil(w)||0:Math.floor(w)},p:function(w){return{M:h,y:m,w:f,d:l,D:g,h:u,m:o,s:a,ms:s,Q:c}[w]||String(w||"").toLowerCase().replace(/s$/,"")},u:function(w){return w===void 0}},Te="en",me={};me[Te]=p;var bt="$isDayjsObject",gt=function(w){return w instanceof je||!(!w||!w[bt])},Je=function w(_,d,b){var v;if(!_)return Te;if(typeof _=="string"){var y=_.toLowerCase();me[y]&&(v=y),d&&(me[y]=d,v=y);var $=_.split("-");if(!v&&$.length>1)return w($[0])}else{var D=_.name;me[D]=_,v=D}return!b&&v&&(Te=v),v||!b&&Te},F=function(w,_){if(gt(w))return w.clone();var d=typeof _=="object"?_:{};return d.date=w,d.args=arguments,new je(d)},M=Ee;M.l=Je,M.i=gt,M.w=function(w,_){return F(w,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var je=(function(){function w(d){this.$L=Je(d.locale,null,!0),this.parse(d),this.$x=this.$x||d.x||{},this[bt]=!0}var _=w.prototype;return _.parse=function(d){this.$d=(function(b){var v=b.date,y=b.utc;if(v===null)return new Date(NaN);if(M.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var $=v.match(C);if($){var D=$[2]-1||0,R=($[7]||"0").substring(0,3);return y?new Date(Date.UTC($[1],D,$[3]||1,$[4]||0,$[5]||0,$[6]||0,R)):new Date($[1],D,$[3]||1,$[4]||0,$[5]||0,$[6]||0,R)}}return new Date(v)})(d),this.init()},_.init=function(){var d=this.$d;this.$y=d.getFullYear(),this.$M=d.getMonth(),this.$D=d.getDate(),this.$W=d.getDay(),this.$H=d.getHours(),this.$m=d.getMinutes(),this.$s=d.getSeconds(),this.$ms=d.getMilliseconds()},_.$utils=function(){return M},_.isValid=function(){return this.$d.toString()!==T},_.isSame=function(d,b){var v=F(d);return this.startOf(b)<=v&&v<=this.endOf(b)},_.isAfter=function(d,b){return F(d)<this.startOf(b)},_.isBefore=function(d,b){return this.endOf(b)<F(d)},_.$g=function(d,b,v){return M.u(d)?this[b]:this.set(v,d)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(d,b){var v=this,y=!!M.u(b)||b,$=M.p(d),D=function(ke,V){var oe=M.w(v.$u?Date.UTC(v.$y,V,ke):new Date(v.$y,V,ke),v);return y?oe:oe.endOf(l)},R=function(ke,V){return M.w(v.toDate()[ke].apply(v.toDate("s"),(y?[0,0,0,0]:[23,59,59,999]).slice(V)),v)},I=this.$W,z=this.$M,J=this.$D,be="set"+(this.$u?"UTC":"");switch($){case m:return y?D(1,0):D(31,11);case h:return y?D(1,z):D(0,z+1);case f:var Se=this.$locale().weekStart||0,Ye=(I<Se?I+7:I)-Se;return D(y?J-Ye:J+(6-Ye),z);case l:case g:return R(be+"Hours",0);case u:return R(be+"Minutes",1);case o:return R(be+"Seconds",2);case a:return R(be+"Milliseconds",3);default:return this.clone()}},_.endOf=function(d){return this.startOf(d,!1)},_.$set=function(d,b){var v,y=M.p(d),$="set"+(this.$u?"UTC":""),D=(v={},v[l]=$+"Date",v[g]=$+"Date",v[h]=$+"Month",v[m]=$+"FullYear",v[u]=$+"Hours",v[o]=$+"Minutes",v[a]=$+"Seconds",v[s]=$+"Milliseconds",v)[y],R=y===l?this.$D+(b-this.$W):b;if(y===h||y===m){var I=this.clone().set(g,1);I.$d[D](R),I.init(),this.$d=I.set(g,Math.min(this.$D,I.daysInMonth())).$d}else D&&this.$d[D](R);return this.init(),this},_.set=function(d,b){return this.clone().$set(d,b)},_.get=function(d){return this[M.p(d)]()},_.add=function(d,b){var v,y=this;d=Number(d);var $=M.p(b),D=function(z){var J=F(y);return M.w(J.date(J.date()+Math.round(z*d)),y)};if($===h)return this.set(h,this.$M+d);if($===m)return this.set(m,this.$y+d);if($===l)return D(1);if($===f)return D(7);var R=(v={},v[o]=r,v[u]=i,v[a]=n,v)[$]||1,I=this.$d.getTime()+d*R;return M.w(I,this)},_.subtract=function(d,b){return this.add(-1*d,b)},_.format=function(d){var b=this,v=this.$locale();if(!this.isValid())return v.invalidDate||T;var y=d||"YYYY-MM-DDTHH:mm:ssZ",$=M.z(this),D=this.$H,R=this.$m,I=this.$M,z=v.weekdays,J=v.months,be=v.meridiem,Se=function(V,oe,Ge,Fe){return V&&(V[oe]||V(b,y))||Ge[oe].slice(0,Fe)},Ye=function(V){return M.s(D%12||12,V,"0")},ke=be||function(V,oe,Ge){var Fe=V<12?"AM":"PM";return Ge?Fe.toLowerCase():Fe};return y.replace(U,(function(V,oe){return oe||(function(Ge){switch(Ge){case"YY":return String(b.$y).slice(-2);case"YYYY":return M.s(b.$y,4,"0");case"M":return I+1;case"MM":return M.s(I+1,2,"0");case"MMM":return Se(v.monthsShort,I,J,3);case"MMMM":return Se(J,I);case"D":return b.$D;case"DD":return M.s(b.$D,2,"0");case"d":return String(b.$W);case"dd":return Se(v.weekdaysMin,b.$W,z,2);case"ddd":return Se(v.weekdaysShort,b.$W,z,3);case"dddd":return z[b.$W];case"H":return String(D);case"HH":return M.s(D,2,"0");case"h":return Ye(1);case"hh":return Ye(2);case"a":return ke(D,R,!0);case"A":return ke(D,R,!1);case"m":return String(R);case"mm":return M.s(R,2,"0");case"s":return String(b.$s);case"ss":return M.s(b.$s,2,"0");case"SSS":return M.s(b.$ms,3,"0");case"Z":return $}return null})(V)||$.replace(":","")}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(d,b,v){var y,$=this,D=M.p(b),R=F(d),I=(R.utcOffset()-this.utcOffset())*r,z=this-R,J=function(){return M.m($,R)};switch(D){case m:y=J()/12;break;case h:y=J();break;case c:y=J()/3;break;case f:y=(z-I)/6048e5;break;case l:y=(z-I)/864e5;break;case u:y=z/i;break;case o:y=z/r;break;case a:y=z/n;break;default:y=z}return v?y:M.a(y)},_.daysInMonth=function(){return this.endOf(h).$D},_.$locale=function(){return me[this.$L]},_.locale=function(d,b){if(!d)return this.$L;var v=this.clone(),y=Je(d,b,!0);return y&&(v.$L=y),v},_.clone=function(){return M.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},w})(),ot=je.prototype;return F.prototype=ot,[["$ms",s],["$s",a],["$m",o],["$H",u],["$W",l],["$M",h],["$y",m],["$D",g]].forEach((function(w){ot[w[1]]=function(_){return this.$g(_,w[0],w[1])}})),F.extend=function(w,_){return w.$i||(w(_,je,F),w.$i=!0),F},F.locale=Je,F.isDayjs=gt,F.unix=function(w){return F(1e3*w)},F.en=me[Te],F.Ls=me,F.p={},F}))})(It)),It.exports}var ks=kr();const Ms=Ts(ks);function Mr(e,t=100,n={}){if(typeof e!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(t<0)throw new RangeError("`wait` must not be negative.");if(typeof n=="boolean")throw new TypeError("The `options` parameter must be an object, not a boolean. Use `{immediate: true}` instead.");const{immediate:r}=n;let i,s,a,o,u;function l(){const c=i,m=s;return i=void 0,s=void 0,u=e.apply(c,m),u}function f(){const c=Date.now()-o;c<t&&c>=0?a=setTimeout(f,t-c):(a=void 0,r||(u=l()))}const h=function(...c){if(i&&this!==i&&Object.getPrototypeOf(this)===Object.getPrototypeOf(i))throw new Error("Debounced method called with different contexts of the same prototype.");i=this,s=c,o=Date.now();const m=r&&!a;if(a||(a=setTimeout(f,t)),m)return u=l(),u};return Object.defineProperty(h,"isPending",{get(){return a!==void 0}}),h.clear=()=>{a&&(clearTimeout(a),a=void 0,i=void 0,s=void 0)},h.flush=()=>{a&&h.trigger()},h.trigger=()=>{u=l(),h.clear()},h}var jt={exports:{}},Ds=jt.exports,Dr;function Os(){return Dr||(Dr=1,(function(e,t){(function(n,r){e.exports=r(kr())})(Ds,(function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var i=r(n),s={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(a){return a+"º"}};return i.default.locale(s,null,!0),s}))})(jt)),jt.exports}Os();var We={},Or;function Ns(){if(Or)return We;Or=1,Object.defineProperty(We,"__esModule",{value:!0}),We.LanguageTranslator=void 0,We.getChildStyleToPass=e,We.addComponent=t;function e(r,i){var s,a,o="";try{if(r&&i?.length&&(!((s=Object.keys(r))===null||s===void 0)&&s.length)&&(!((a=i?.filter(function(c){return Object.keys(r).includes(c.name)}))===null||a===void 0)&&a.length))for(var u=function(c){var m=i?.filter(function(g){return g.name===c&&g.defaultValue!==r[c]});m&&(o+="".concat(c,":").concat(r[c],";"))},l=0,f=Object.keys(r);l<f.length;l++){var h=f[l];u(h)}}catch(c){console.error("error getting child style to pass",c)}finally{return o}}function t(r){var i,s=((i=r?.repoName.split("/"))===null||i===void 0?void 0:i[1])||r?.repoName;if(!s)throw new Error("wrong componentPath "+r?.repoName);if(!r?.version)throw new Error("wrong version "+r?.version);var a=r?.iifePath||"main.iife.js";if(!document.getElementById(s+"-script"))try{var o=document.createElement("script");if(o.id=s+"-script",o.src="https://cdn.jsdelivr.net/npm/".concat(r.repoName,"@").concat(r.version,"/").concat(a),r?.local)o.src="".concat(r.local);else if(location.href.includes("localhost:6006")){var u=s.split("-")[0];o.src="http://localhost:6006/webcomponents/".concat(s.replace(u+"-",""),"/").concat(a)}document.head.appendChild(o)}catch(l){console.warn(l)}}var n=(function(){function r(i){if(this.lang="",!i?.dictionary)throw new Error("no dictionary provided");this.dictionary=i.dictionary,this.setLang(i?.lang)}return r.prototype.setLang=function(i){i||(i=r.getDefaultLang()),this.lang=i},r.prototype.translateWord=function(i,s){return r.getDictionaryWord(i,this.dictionary,s||this.lang)},r.prototype.translateDate=function(i,s,a){return r.formatDate(i,s,a||this.lang)},r.getDefaultLang=function(){var i,s,a,o="en";return navigator?.languages&&(!((a=(s=(i=navigator.languages[0])===null||i===void 0?void 0:i.split("-")[0])===null||s===void 0?void 0:s.toLowerCase())===null||a===void 0)&&a.length)&&(o=navigator.languages[0].split("-")[0].toLowerCase()),o},r.getDictionaryWord=function(i,s,a){var o;if(!i)throw new Error("no wordKey provided");if(!s)throw new Error("no dictionary provided");if(a&&(!((o=s[a])===null||o===void 0)&&o[i]))return s[a][i];var u="",l=r.getDefaultLang();if(!a||l!==a){var f=s?.[l];f?.[i]&&(u=f[i])}return u},r.formatDate=function(i,s,a){if(!i)throw new Error("no date provided");if(typeof i.getMonth!="function")throw new Error("wrong date format");var o=new Intl.DateTimeFormat(a||r.getDefaultLang(),s);return o.format(i)},r})();return We.LanguageTranslator=n,We}var As=Ns(),Cs=gr('<div style="text-align:right;padding-right:60px" class="svelte-1694i3h"><button class="btn btn-default svelte-1694i3h"><i class="bi-printer-fill svelte-1694i3h"></i></button> <button class="btn btn-default svelte-1694i3h"><i class="bi-arrows-fullscreen svelte-1694i3h"></i></button></div>'),Ls=gr('<div id="page" class="container svelte-1694i3h"><div class="row svelte-1694i3h" style="margin-top:20px"><div class="col svelte-1694i3h"><img style="height:80px;margin:0px 0px 0px 60px" alt="" class="svelte-1694i3h"/> <span style="margin:0px 40px 0px 40px" class="svelte-1694i3h"> </span></div> <div class="col svelte-1694i3h"><!></div></div> <div class="row svelte-1694i3h" style="margin-top:60px"><div class="col svelte-1694i3h"> </div> <div class="col svelte-1694i3h"></div> <div class="col svelte-1694i3h"> </div></div> <div class="row svelte-1694i3h" style="margin-top:40px"><div class="col svelte-1694i3h"><div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div></div> <div class="col svelte-1694i3h"><div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div></div> <div class="col svelte-1694i3h"><div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div> <div class="svelte-1694i3h"> </div></div></div> <div class="row svelte-1694i3h" style="margin-top:40px"><div class="col svelte-1694i3h"><hb-table></hb-table></div></div> <div class="row svelte-1694i3h" style="margin-top:40px"><div class="col svelte-1694i3h"><div style="width:300px;float:right" class="svelte-1694i3h"><div style="text-align:left;" class="svelte-1694i3h"><div style="line-height:25px" class="svelte-1694i3h"><span style="display:inline-block;min-width:200px;" class="svelte-1694i3h">SubTotale:</span> </div> <div style="line-height:25px" class="svelte-1694i3h"><span style="display:inline-block;min-width:200px;" class="svelte-1694i3h">Tasse:</span> </div> <div style="line-height:25px;font-weight:bold" class="svelte-1694i3h"><span style="display:inline-block;min-width:200px;" class="svelte-1694i3h">Totale:</span> </div></div></div></div></div></div>',2);const Ps={hash:"svelte-1694i3h",code:`@charset "UTF-8";
3
3
  @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");
4
4
  @import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");
5
5
  /*!
@@ -86,5 +86,5 @@ button.svelte-1694i3h {margin:0;font-family:inherit;font-size:inherit;line-heigh
86
86
  @media (min-width: 1200px) {
87
87
  }
88
88
  @media print {
89
- }:host {font-family:"Roboto", sans-serif;display:block;margin:40px 0px 40px 0px;}`};function br(e,t){yn(t,!0),zi(e,vs);let n=Pt(t,"id",7,""),r=Pt(t,"printer",7,"no"),s=Pt(t,"items",23,()=>[]),i=Pt(t,"headers",7),a=ce(""),o=ce("");const l=[{key:"desc",label:"descrizione",nosort:!0},{key:"price",label:"prezzo",nosort:!0},{key:"quantity",label:"quantità",nosort:!0},{key:"subtotal",label:"subtotal",nosort:!0},{key:"vat",label:"iva",nosort:!0},{key:"total",label:"totale",nosort:!0}];let u=Xe(()=>s()?.map(m=>m.unitaryPrice*(m.quantity||1)).reduce((m,R)=>m+R,0)),p=Xe(()=>Math.round(s().map(m=>m.unitaryPrice*(m.quantity||1)*m.taxPercentage*.01).reduce((m,R)=>m+R,0)*100)/100),h=Xe(()=>N(u)+N(p)),f=Xe(()=>s().map((m,R)=>({_id:R.toString(),price:m.unitaryPrice.toString()+N(o)+" / "+(m.unit?m.unit:"unità"),desc:m.desc,quantity:m.quantity?.toString?.()||"1",subtotal:(m.unitaryPrice*(m.quantity||1)).toString()+N(o),vat:`${(Math.round(m.taxPercentage*.01*m.unitaryPrice*(m.quantity||1)*100)/100).toString()} (${m.taxPercentage}%)`,total:(m.unitaryPrice*(m.quantity||1)+Math.round(m.taxPercentage*.01*m.unitaryPrice*(m.quantity||1)*100)/100).toString()+N(o)})));Ei(()=>{if(r()||r("no"),typeof s()=="string"&&s(JSON.parse(s())),typeof i()=="string")switch(i(JSON.parse(i())),i().date||(i().date=new Date),i().category||(i().category="items"),i().country||(i().country="it"),i().country){case"it":J(a,"euro"),J(o,"€");break;case"eu":J(a,"euro"),J(o,"€");break;case"us":J(a,"dollar"),J(o,"$");break}}),cs.addComponent({repoName:"@htmlbricks/hb-table",version:nn.version});var v={get id(){return n()},set id(m=""){n(m),at()},get printer(){return r()},set printer(m="no"){r(m),at()},get items(){return s()},set items(m=[]){s(m),at()},get headers(){return i()},set headers(m){i(m),at()}},x=Yi(),I=bi(x);{var q=m=>{var R=hs(),Ee=S(R),ke=S(Ee),ve=S(ke),vt=L(ve,2),_t=S(vt,!0);k(vt),k(ke);var We=L(ke,2),j=S(We);{var M=pt=>{var on=ds(),Sr=S(on),ws=Xe(()=>_r(()=>ns({headers:i(),items:s(),version:nn.version}),200));Sr.__click=function(...ln){N(ws)?.apply(this,ln)};var ys=L(Sr,2),$s=Xe(()=>_r(()=>rs({headers:i(),items:s(),version:nn.version}),200));ys.__click=function(...ln){N($s)?.apply(this,ln)},k(on),ht(pt,on)};ur(j,pt=>{r()!=="yes"&&pt(M)})}k(We),k(Ee);var Le=L(Ee,2),rt=S(Le),g=S(rt);k(rt);var _=L(rt,4),c=S(_);k(_),k(Le);var b=L(Le,2),d=S(b),w=S(d),y=S(w,!0);k(w);var T=L(w,2),A=S(T,!0);k(T);var P=L(T,2),Y=S(P,!0);k(P),k(d);var V=L(d,2),_e=S(V),Se=S(_e,!0);k(_e);var Re=L(_e,2),Me=S(Re,!0);k(Re),k(V);var H=L(V,2),ae=S(H),Ve=S(ae,!0);k(ae);var je=L(ae,2),_s=S(je,!0);k(je);var gr=L(je,2),ps=S(gr,!0);k(gr),k(H),k(b);var rn=L(b,2),wr=S(rn),It=S(wr);en(It,"disablepagination","yes"),Kt(()=>en(It,"rows",JSON.stringify(N(f)))),Kt(()=>en(It,"headers",JSON.stringify(l))),Vi(It,1,"svelte-1694i3h"),k(wr),k(rn);var yr=L(rn,2),$r=S(yr),xr=S($r),Er=S(xr),sn=S(Er),ms=L(S(sn));k(sn);var an=L(sn,2),bs=L(S(an));k(an);var kr=L(an,2),gs=L(S(kr));k(kr),k(Er),k(xr),k($r),k(yr),k(R),Kt(pt=>{fr(ve,"src",i().from.logo),Q(_t,i().from.shortName),Q(g,`Data: ${pt??""}`),Q(c,`Fattura numero: ${i().serial??""}`),Q(y,i().from.name),Q(A,i().from.address),Q(Y,i().from.piva),Q(Se,i().from.email),Q(Me,i().from.phone),Q(Ve,i().to.name),Q(_s,i().to.address),Q(ps,i().to.piva),Q(ms,` ${N(u)??""}${N(o)??""}`),Q(bs,` ${N(p)??""}${N(o)??""}`),Q(gs,` ${N(h)??""}${N(o)??""}`)},[()=>os(i().date).format("DD/MM/YY")]),ht(m,R)},Pe=m=>{var R=Ii("error");ht(m,R)};ur(I,m=>{i()?.from&&i().to?m(q):m(Pe,!1)})}return ht(e,x),$n(v)}Ri(["click"]),customElements.define("hb-page-invoice",ts(br,{id:{},printer:{},items:{},headers:{}},[],[],!0)),un.Component=br,Object.defineProperty(un,Symbol.toStringTag,{value:"Module"})})(this["page-invoice"]=this["page-invoice"]||{});
89
+ }:host {font-family:"Roboto", sans-serif;display:block;margin:40px 0px 40px 0px;}`};function Nr(e,t){Mn(t,!0),ds(e,Ps);let n=Pt(t,"id",7,""),r=Pt(t,"printer",7,"no"),i=Pt(t,"items",23,()=>[]),s=Pt(t,"headers",7),a=_e(""),o=_e("");const u=[{key:"desc",label:"descrizione",nosort:!0},{key:"price",label:"prezzo",nosort:!0},{key:"quantity",label:"quantità",nosort:!0},{key:"subtotal",label:"subtotal",nosort:!0},{key:"vat",label:"iva",nosort:!0},{key:"total",label:"totale",nosort:!0}];let l=rt(()=>i()?.map(p=>p.unitaryPrice*(p.quantity||1)).reduce((p,P)=>p+P,0)),f=rt(()=>Math.round(i().map(p=>p.unitaryPrice*(p.quantity||1)*p.taxPercentage*.01).reduce((p,P)=>p+P,0)*100)/100),h=rt(()=>A(l)+A(f)),c=rt(()=>i().map((p,P)=>({_id:P.toString(),price:p.unitaryPrice.toString()+A(o)+" / "+(p.unit?p.unit:"unità"),desc:p.desc,quantity:p.quantity?.toString?.()||"1",subtotal:(p.unitaryPrice*(p.quantity||1)).toString()+A(o),vat:`${(Math.round(p.taxPercentage*.01*p.unitaryPrice*(p.quantity||1)*100)/100).toString()} (${p.taxPercentage}%)`,total:(p.unitaryPrice*(p.quantity||1)+Math.round(p.taxPercentage*.01*p.unitaryPrice*(p.quantity||1)*100)/100).toString()+A(o)})));Ui(()=>{if(r()||r("no"),typeof i()=="string"&&i(JSON.parse(i())),typeof s()=="string")switch(s(JSON.parse(s())),s().date||(s().date=new Date),s().category||(s().category="items"),s().country||(s().country="it"),s().country){case"it":G(a,"euro"),G(o,"€");break;case"eu":G(a,"euro"),G(o,"€");break;case"us":G(a,"dollar"),G(o,"$");break}}),As.addComponent({repoName:"@htmlbricks/hb-table",version:an.version});var m={get id(){return n()},set id(p=""){n(p),ft()},get printer(){return r()},set printer(p="no"){r(p),ft()},get items(){return i()},set items(p=[]){i(p),ft()},get headers(){return s()},set headers(p){s(p),ft()}},g=as(),T=Yi(g);{var C=p=>{var P=Ls(),Ee=k(P),Te=k(Ee),me=k(Te),bt=Y(me,2),gt=k(bt,!0);S(bt),S(Te);var Je=Y(Te,2),F=k(Je);{var M=wt=>{var fn=Cs(),Yr=k(fn),Hs=rt(()=>Mr(()=>xs({headers:s(),items:i(),version:an.version}),200)),qs=Y(Yr,2),zs=rt(()=>Mr(()=>Es({headers:s(),items:i(),version:an.version}),200));S(fn),pr("click",Yr,function(...cn){A(Hs)?.apply(this,cn)}),pr("click",qs,function(...cn){A(zs)?.apply(this,cn)}),mt(wt,fn)};$r(F,wt=>{r()!=="yes"&&wt(M)})}S(Je),S(Ee);var je=Y(Ee,2),ot=k(je),w=k(ot);S(ot);var _=Y(ot,4),d=k(_);S(_),S(je);var b=Y(je,2),v=k(b),y=k(v),$=k(y,!0);S(y);var D=Y(y,2),R=k(D,!0);S(D);var I=Y(D,2),z=k(I,!0);S(I),S(v);var J=Y(v,2),be=k(J),Se=k(be,!0);S(be);var Ye=Y(be,2),ke=k(Ye,!0);S(Ye),S(J);var V=Y(J,2),oe=k(V),Ge=k(oe,!0);S(oe);var Fe=Y(oe,2),Rs=k(Fe,!0);S(Fe);var Ar=Y(Fe,2),Is=k(Ar,!0);S(Ar),S(V),S(b);var on=Y(b,2),Cr=k(on),Yt=k(Cr);rn(Yt,"disablepagination","yes"),Qt(()=>rn(Yt,"rows",JSON.stringify(A(c)))),Qt(()=>rn(Yt,"headers",JSON.stringify(u))),vs(Yt,1,"svelte-1694i3h"),S(Cr),S(on);var Lr=Y(on,2),Pr=k(Lr),Rr=k(Pr),Ir=k(Rr),ln=k(Ir),js=Y(k(ln));S(ln);var un=Y(ln,2),Ys=Y(k(un));S(un);var jr=Y(un,2),Fs=Y(k(jr));S(jr),S(Ir),S(Rr),S(Pr),S(Lr),S(P),Qt(wt=>{xr(me,"src",s().from.logo),Q(gt,s().from.shortName),Q(w,`Data: ${wt??""}`),Q(d,`Fattura numero: ${s().serial??""}`),Q($,s().from.name),Q(R,s().from.address),Q(z,s().from.piva),Q(Se,s().from.email),Q(ke,s().from.phone),Q(Ge,s().to.name),Q(Rs,s().to.address),Q(Is,s().to.piva),Q(js,` ${A(l)??""}${A(o)??""}`),Q(Ys,` ${A(f)??""}${A(o)??""}`),Q(Fs,` ${A(h)??""}${A(o)??""}`)},[()=>Ms(s().date).format("DD/MM/YY")]),mt(p,P)},U=p=>{var P=ss("error");mt(p,P)};$r(T,p=>{s()?.from&&s().to?p(C):p(U,-1)})}return mt(e,g),Dn(m)}ts(["click"]),customElements.define("hb-page-invoice",$s(Nr,{id:{},printer:{},items:{},headers:{}},[],[],{mode:"open"})),dn.Component=Nr,Object.defineProperty(dn,Symbol.toStringTag,{value:"Module"})})(this["page-invoice"]=this["page-invoice"]||{});
90
90
  //# sourceMappingURL=main.iife.js.map