UNPKG

@bitjson/qr-code

Version:

QR Code Web Component

5 lines 28.9 kB
/*! * QrCode: Core, ES5 * Built with http://stenciljs.com */ function n(n,t){var e="data-"+n.n;return t&&t!==T?e+"-"+t:e}function t(n){return{t:n[0],e:n[1],r:!!n[2],i:!!n[3],o:!!n[4]}}function e(n,t){if(S(t)&&"object"!=typeof t&&"function"!=typeof t){if(n===Boolean||3===n)return"false"!==t&&(""===t||!!t);if(n===Number||4===n)return parseFloat(t);if(n===String||2===n)return t.toString()}return t}function r(n,t,e,r){var i=n.u.get(t);i&&((r=i["s-ld"]||i.$activeLoading)&&((e=r.indexOf(t))>-1&&r.splice(e,1),r.length||(i["s-init"]&&i["s-init"](),i.$initLoad&&i.$initLoad())),n.u.delete(t))}function i(n,t){for(var e,r,i=null,o=!1,u=!1,f=arguments.length;f-- >2;)L.push(arguments[f]);for(;L.length>0;){var c=L.pop();if(c&&void 0!==c.pop)for(f=c.length;f--;)L.push(c[f]);else"boolean"==typeof c&&(c=null),(u="function"!=typeof n)&&(null==c?c="":"number"==typeof c?c=String(c):"string"!=typeof c&&(u=!1)),u&&o?i[i.length-1].f+=c:null===i?i=[u?{f:c}:c]:i.push(u?{f:c}:c),o=u}if(null!=t){if(t.className&&(t.class=t.className),"object"==typeof t.class){for(f in t.class)t.class[f]&&L.push(f);t.class=L.join(" "),L.length=0}null!=t.key&&(e=t.key),null!=t.name&&(r=t.name)}return"function"==typeof n?n(Object.assign({},t,{children:i}),R):{c:n,a:i,f:void 0,s:t,l:e,v:r,d:void 0,p:!1}}function o(n,t,e,r){t.split(" ").forEach(function(t){n[t]=!0,e&&(n[t+"-"+e]=!0,r&&(n[t+"-"+e+"-"+r]=n[t+"-"+r]=!0))})}function u(n,t){n.y.has(t)||(n.y.set(t,!0),n.m?n.queue.write(function(){return f(n,t)}):n.queue.tick(function(){return f(n,t)}))}function f(n,t,e,r,i,o){if(n.y.delete(t),!n.b.has(t)){if(r=n.w.get(t),e=!r){if((i=n.u.get(t))&&i.$rendered&&(i["s-rn"]=!0),i&&!i["s-rn"])return(i["s-rc"]=i["s-rc"]||[]).push(function(){f(n,t)}),void(i.$onRender=i["s-rc"]);r=function u(n,t,e,r,i,o,f){try{(function c(n,t,e,r,i,o,u){for(u in n.g.set(r,e),n.M.has(e)||n.M.set(e,{}),(o=Object.assign({color:{type:String}},t.properties)).mode={type:String},o)a(n,o[u],e,r,u,i)})(n,i=n.k(t).j,t,r=new i,e),function s(n,t,e){if(t){var r=n.g.get(e);t.forEach(function(t){e[t.method]={emit:function(e){n.A(r,t.name,{bubbles:t.bubbles,composed:t.composed,cancelable:t.cancelable,detail:e})}}})}}(n,i.events,r);try{if(o=n.O.get(t)){for(f=0;f<o.length;f+=2)r[o[f]](o[f+1]);n.O.delete(t)}}catch(e){n.C(e,2,t)}}catch(e){r={},n.C(e,7,t,!0)}return n.w.set(t,r),r}(n,t,n.P.get(t));try{r.componentWillLoad&&(o=r.componentWillLoad())}catch(e){n.C(e,3,t)}}else try{r.componentWillUpdate&&(o=r.componentWillUpdate())}catch(e){n.C(e,5,t)}o&&o.then?o.then(function(){return c(n,t,r,e)}):c(n,t,r,e)}}function c(n,t,e,r){(function u(n,t,e,r){try{var u,f,c=t.j.host,a=t.j.encapsulation,s="shadow"===a&&n._.T;if(u=function l(n,t,e){return n&&Object.keys(n).forEach(function(r){n[r].reflectToAttr&&((e=e||{})[r]=t[r])}),e}(t.j.properties,r),f=s?e.shadowRoot:e,!e["s-rn"]){n.N(n,n._,t,e);var v=e["s-sc"];v&&(n._.S(e,function d(n){return n+"-host"}(v),""),r.render||n._.S(e,function p(n){return n+"-slot"}(v),""))}if(r.render||r.hostData||c||u){n.x=!0;var h=r.render&&r.render(),y=void 0;if((y=r.hostData&&r.hostData())&&t.W){var m=Object.keys(y).reduce(function(n,e){return t.W[e]?n.concat(e):t.W[W(e)]?n.concat(W(e)):n},[]);if(m.length>0)throw new Error("The following keys were attempted to be set with hostData() from the "+t.n+" component: "+m.join(", ")+". If you would like to modify these please set @Prop({ mutable: true, reflectToAttr: true}) on the @Prop() decorator.")}u&&(y=y?Object.assign(y,u):u),n.x=!1,c&&(y=function b(n,t,e){return n=n||{},Object.keys(t).forEach(function(r){"theme"===r?o(n.class=n.class||{},t[r],e.mode,e.color):"class"===r?o(n[r]=n[r]||{},t[r]):n[r]=t[r]}),n}(y,c,r));var w=n.D.get(e)||{};w.d=f;var g=i(null,y,h);g.p=!0,n.D.set(e,n.render(e,w,g,s,a))}n.L&&n.L.R(e),e["s-rn"]=!0,e.$onRender&&(e["s-rc"]=e.$onRender),e["s-rc"]&&(e["s-rc"].forEach(function(n){return n()}),e["s-rc"]=null)}catch(t){n.x=!1,n.C(t,8,e,!0)}})(n,n.k(t),t,e);try{r?t["s-init"]():(e.componentDidUpdate&&e.componentDidUpdate(),w(n.D.get(t))),t["s-hmr-load"]&&t["s-hmr-load"]()}catch(e){n.C(e,6,t,!0)}}function a(n,t,r,i,o,u,f,c){if(t.type||t.state){var a=n.M.get(r);t.state||(!t.attr||void 0!==a[o]&&""!==a[o]||(f=u&&u.F)&&S(c=f[t.attr])&&(a[o]=e(t.type,c)),r.hasOwnProperty(o)&&(void 0===a[o]&&(a[o]=e(t.type,r[o])),"mode"!==o&&delete r[o])),i.hasOwnProperty(o)&&void 0===a[o]&&(a[o]=i[o]),t.watchCallbacks&&(a[F+o]=t.watchCallbacks.slice()),v(i,o,function d(t){return(t=n.M.get(n.g.get(this)))&&t[o]},function p(e,r){(r=n.g.get(this))&&(t.state||t.mutable)&&s(n,r,o,e)})}else if(t.elementRef)l(i,o,r);else if(t.method)l(r,o,i[o].bind(i));else if(t.context){var h=n.H(t.context);void 0!==h&&l(i,o,h.q&&h.q(r)||h)}else t.connect&&l(i,o,n.I(t.connect))}function s(n,t,e,r,i,o,f){(i=n.M.get(t))||n.M.set(t,i={});var c=i[e];if(r!==c&&(i[e]=r,o=n.w.get(t))){if(f=i[F+e])for(var a=0;a<f.length;a++)try{o[f[a]].call(o,r,c,e)}catch(n){}!n.x&&t["s-rn"]&&u(n,t)}}function l(n,t,e){Object.defineProperty(n,t,{configurable:!0,value:e})}function v(n,t,e,r){Object.defineProperty(n,t,{configurable:!0,get:e,set:r})}function d(n,t,e,r,i){var o=t!==(t=t.replace(/^xlink\:?/,"")),u=H[t]||r;u&&(!e||"false"===e)||i?o?n.removeAttributeNS(q,x(t)):n.removeAttribute(t):"function"!=typeof e&&(u&&(e=""),o?n.setAttributeNS(q,x(t),e):n.setAttribute(t,e))}function p(n,t,e,r,i,o,u){if("class"!==e||o)if("style"===e){for(var f in r)i&&null!=i[f]||t.style.B(f);for(var f in i)r&&i[f]===r[f]||t.style.setProperty(f,i[f])}else if("o"!==e[0]||"n"!==e[1]||!/[A-Z]/.test(e[2])||e in t)if("list"!==e&&"type"!==e&&!o&&(e in t||-1!==["object","function"].indexOf(typeof i)&&null!==i)){var c=n.k(t);c&&c.W&&c.W[e]?(y(t,e,i),u&&c.W[e].U&&d(t,c.W[e].z,i,3===c.W[e].Q,null==i)):"ref"!==e&&(y(t,e,null==i?"":i),null!=i&&!1!==i||n._.Y(t,e))}else null!=i&&"key"!==e?d(t,e,i):(o||n._.Z(t,e)&&(null==i||!1===i))&&n._.Y(t,e);else e=x(e)in t?x(e.substring(2)):x(e[2])+e.substring(3),i?i!==r&&n._.G(t,e,i):n._.J(t,e);else if(r!==i){var a=h(r),s=h(i),l=a.filter(function(n){return!s.includes(n)}),v=h(t.className).filter(function(n){return!l.includes(n)}),p=s.filter(function(n){return!a.includes(n)&&!v.includes(n)});v.push.apply(v,p),t.className=v.join(" ")}}function h(n){return null==n||""===n?[]:n.trim().split(/\s+/)}function y(n,t,e){try{n[t]=e}catch(n){}}function m(n,t,e,r,i){var o=11===e.d.nodeType&&e.d.host?e.d.host:e.d,u=t&&t.s||_,f=e.s||_;for(i in u)f&&null!=f[i]||null==u[i]||p(n,o,i,u[i],void 0,r,e.p);for(i in f)i in u&&f[i]===("value"===i||"checked"===i?o[i]:u[i])||p(n,o,i,u[i],f[i],r,e.p)}function b(n,t){function e(i,o,u,f,c,v,y,b,w){if(b=o.a[u],a||(d=!0,"slot"===b.c&&(l&&t.S(f,l+"-slot",""),b.a?b.K=!0:b.V=!0)),S(b.f))b.d=t.X(b.f);else if(b.V)b.d=t.X("");else{if(v=b.d=I||"svg"===b.c?t.nn("http://www.w3.org/2000/svg",b.c):t.tn(b.K?"slot-fb":b.c),I="svg"===b.c||"foreignObject"!==b.c&&I,m(n,null,b,I),S(l)&&v["s-si"]!==l&&t.S(v,v["s-si"]=l,""),S(s)&&t.S(v,P,s+"."+u+(function n(t){if(t)for(var e=0;e<t.length;e++)if("slot"!==t[e].c||n(t[e].a))return!0;return!1}(b.a)?"":".")),b.a)for(c=0;c<b.a.length;++c)(y=e(i,b,c,v))&&(S(s)&&3===y.nodeType&&!y["s-cr"]&&t.en(v,t.rn("s."+s+"."+c)),t.en(v,y),S(s)&&3===y.nodeType&&!y["s-cr"]&&(t.en(v,t.rn("/")),t.en(v,t.X(" "))));"svg"===b.c&&(I=!1)}return b.d["s-hn"]=p,(b.K||b.V)&&(b.d["s-sr"]=!0,b.d["s-cr"]=h,b.d["s-sn"]=b.v||"",(w=i&&i.a&&i.a[u])&&w.c===b.c&&i.d&&r(i.d)),b.d}function r(e,i,o,u){n.in=!0;var a=t.on(e);for(o=a.length-1;o>=0;o--)(u=a[o])["s-hn"]!==p&&u["s-ol"]&&(t.un(u),t.fn(c(u),u,f(u)),t.un(u["s-ol"]),u["s-ol"]=null,d=!0),i&&r(u,i);n.in=!1}function i(n,r,i,o,u,c,a,s){var l=n["s-cr"]||n.$defaultHolder;for((a=l&&t.cn(l)||n).shadowRoot&&t.an(a)===p&&(a=a.shadowRoot);u<=c;++u)o[u]&&(s=S(o[u].f)?t.X(o[u].f):e(null,i,u,n))&&(o[u].d=s,t.fn(a,s,f(r)))}function o(n,e,i,o){for(;e<=i;++e)S(n[e])&&(o=n[e].d,v=!0,o["s-ol"]?t.un(o["s-ol"]):r(o,!0),t.un(o))}function u(n,t){return n.c===t.c&&n.l===t.l&&("slot"!==n.c||n.v===t.v)}function f(n){return n&&n["s-ol"]?n["s-ol"]:n}function c(n){return t.cn(n["s-ol"]?n["s-ol"]:n)}var a,s,l,v,d,p,h,y=[];return function b(w,g,M,j,k,A,$,E,O,P,T,_){if(p=t.an(w),h=w["s-cr"],a=j,s="shadow"!==k?A:null,l=w["s-sc"],d=v=!1,function a(s,l,v){var d=l.d=s.d,p=s.a,h=l.a;I=l.d&&S(t.sn(l.d))&&void 0!==l.d.ownerSVGElement,I="svg"===l.c||"foreignObject"!==l.c&&I,S(l.f)?(v=d["s-cr"]||d.$defaultHolder)?t.ln(t.cn(v),l.f):s.f!==l.f&&t.ln(d,l.f):("slot"!==l.c&&m(n,s,l,I),S(p)&&S(h)?function y(n,s,l,v,d,p,h,m){for(var b=0,w=0,g=s.length-1,M=s[0],j=s[g],k=v.length-1,A=v[0],$=v[k];b<=g&&w<=k;)if(null==M)M=s[++b];else if(null==j)j=s[--g];else if(null==A)A=v[++w];else if(null==$)$=v[--k];else if(u(M,A))a(M,A),M=s[++b],A=v[++w];else if(u(j,$))a(j,$),j=s[--g],$=v[--k];else if(u(M,$))"slot"!==M.c&&"slot"!==$.c||r(t.cn(M.d)),a(M,$),t.fn(n,M.d,t.vn(j.d)),M=s[++b],$=v[--k];else if(u(j,A))"slot"!==M.c&&"slot"!==$.c||r(t.cn(j.d)),a(j,A),t.fn(n,j.d,M.d),j=s[--g],A=v[++w];else{for(d=null,p=b;p<=g;++p)if(s[p]&&S(s[p].l)&&s[p].l===A.l){d=p;break}S(d)?((m=s[d]).c!==A.c?h=e(s&&s[w],l,d,n):(a(m,A),s[d]=void 0,h=m.d),A=v[++w]):(h=e(s&&s[w],l,w,n),A=v[++w]),h&&t.fn(c(M.d),h,f(M.d))}b>g?i(n,null==v[k+1]?null:v[k+1].d,l,v,w,k):w>k&&o(s,b,g)}(d,p,l,h):S(h)?(S(s.f)&&t.ln(d,""),i(d,null,l,h,0,h.length-1)):S(p)&&o(p,0,p.length-1)),I&&"svg"===l.c&&(I=!1)}(g,M),S(s)&&t.S(g.d,C,s),d){for(function n(e,r,i,o,u,f,c,a,s,l){for(u=0,f=(r=t.on(e)).length;u<f;u++){if((i=r[u])["s-sr"]&&(o=i["s-cr"]))for(a=t.on(t.cn(o)),s=i["s-sn"],c=a.length-1;c>=0;c--)(o=a[c])["s-cn"]||o["s-nr"]||o["s-hn"]===i["s-hn"]||((3===(l=t.dn(o))||8===l)&&""===s||1===l&&null===t.pn(o,"slot")&&""===s||1===l&&t.pn(o,"slot")===s)&&(y.some(function(n){return n.hn===o})||(v=!0,o["s-sn"]=s,y.push({yn:i,hn:o})));1===t.dn(i)&&n(i)}}(M.d),$=0;$<y.length;$++)(E=y[$]).hn["s-ol"]||((O=t.X(""))["s-nr"]=E.hn,t.fn(t.cn(E.hn),E.hn["s-ol"]=O,E.hn));for(n.in=!0,$=0;$<y.length;$++){for(E=y[$],T=t.cn(E.yn),_=t.vn(E.yn),O=E.hn["s-ol"];O=t.mn(O);)if((P=O["s-nr"])&&P&&P["s-sn"]===E.hn["s-sn"]&&T===t.cn(P)&&(P=t.vn(P))&&P&&!P["s-nr"]){_=P;break}(!_&&T!==t.cn(E.hn)||t.vn(E.hn)!==_)&&E.hn!==_&&(t.un(E.hn),t.fn(T,E.hn,_))}n.in=!1}return v&&function n(e,r,i,o,u,f,c,a){for(o=0,u=(i=t.on(e)).length;o<u;o++)if(r=i[o],1===t.dn(r)){if(r["s-sr"])for(c=r["s-sn"],r.hidden=!1,f=0;f<u;f++)if(i[f]["s-hn"]!==r["s-hn"])if(a=t.dn(i[f]),""!==c){if(1===a&&c===t.pn(i[f],"slot")){r.hidden=!0;break}}else if(1===a||3===a&&""!==t.bn(i[f]).trim()){r.hidden=!0;break}n(r)}}(M.d),y.length=0,M}}function w(n,t){n&&(n.s&&n.s.ref&&n.s.ref(t?null:n.d),n.a&&n.a.forEach(function(n){w(n,t)}))}function g(n,t){var e=n.k(t);e.wn&&e.wn.forEach(function(e){e.r||n._.G(t,e.t,function r(n,t,e,i){return function(r){(i=n.w.get(t))?i[e](r):((i=n.O.get(t)||[]).push(e,r),n.O.set(t,i))}}(n,t,e.e),e.o,e.i)})}function M(n,t){var e={nodeName:t},r=n.k(e);if(!r||!r.j)return Promise.resolve(null);var i=r.j,o=function u(n){return Object.keys(n).reduce(function(t,e){var r,i=n[e],o={name:e};if(i.state)r="states",o.gn=i.watchCallbacks||[];else if(i.elementRef)r="elements";else if(i.method)r="methods";else{r="props";var u="any";i.type&&(u=i.type,"function"==typeof i.type&&(u=i.type.name)),o.type=u.toLowerCase(),o.mutable=i.mutable||!1,o.connect=i.connect||"-",o.context=i.connect||"-",o.gn=i.watchCallbacks||[]}return t[r].push(o),t},{Mn:[],jn:[],kn:[],An:[]})}(i.properties||{}),f=(r.wn||[]).map(function(n){return{$n:n.t,capture:n.o,disabled:n.r,passive:n.i,method:n.e}}),c=i.events||[],a=Object.assign({En:i.is,On:r.Cn||"unknown",encapsulation:i.encapsulation||"none"},o,{events:{Pn:c,listeners:f}});return Promise.resolve(a)}function j(n,t,e,r,i){return e.mode||(e.mode=n.Tn(e)),e["s-cr"]||n.pn(e,C)||n.T&&1===t.encapsulation||(e["s-cr"]=n.X(""),e["s-cr"]["s-cn"]=!0,n.fn(e,e["s-cr"],n.on(e)[0])),n.T||1!==t.encapsulation||"shadowRoot"in HTMLElement.prototype||(e.shadowRoot=e),1===t.encapsulation&&n.T&&!e.shadowRoot&&n._n(e,{mode:"open"}),r={Nn:e["s-id"],F:{}},t.W&&Object.keys(t.W).forEach(function(o){(i=t.W[o].z)&&(r.F[i]=n.pn(e,i))}),r}function k(n,t,i,o){i.connectedCallback=function(){(function e(n,t,r){n.Sn.has(r)||(n.Sn.set(r,!0),g(n,r)),n.b.delete(r),n.xn.has(r)||(n.xn.set(r,!0),r["s-id"]||(r["s-id"]=n.Wn()),function i(n,t,e){for(e=t;e=n._.sn(e);)if(n.Dn(e)){n.Ln.has(t)||(n.u.set(t,e),e.$activeLoading&&(e["s-ld"]=e.$activeLoading),(e["s-ld"]=e["s-ld"]||[]).push(t));break}}(n,r),n.queue.tick(function(){n.P.set(r,j(n._,t,r)),n.Rn(t,r)}))})(n,t,this)},i.attributeChangedCallback=function(n,r,i){(function o(n,t,r,i,u,f,c){if(n&&i!==u)for(f in n)if((c=n[f]).z&&x(c.z)===x(r)){t[f]=e(c.Q,u);break}})(t.W,this,n,r,i)},i.disconnectedCallback=function(){(function t(n,e){if(!n.in&&function i(n,t){for(;t;){if(!n.cn(t))return 9!==n.dn(t);t=n.cn(t)}}(n._,e)){n.b.set(e,!0),r(n,e),w(n.D.get(e),!0),n._.J(e),n.Sn.delete(e);var o=n.w.get(e);o&&o.componentDidUnload&&o.componentDidUnload(),n.L&&n.L.Fn(e),[n.u,n.Hn,n.P].forEach(function(n){return n.delete(e)})}})(n,this)},i["s-init"]=function(){(function t(n,e,i,o,u){if(!n.Ln.has(e)&&(o=n.w.get(e))&&!n.b.has(e)&&(!e["s-ld"]||!e["s-ld"].length)){delete e["s-ld"],n.Ln.set(e,!0);try{w(n.D.get(e)),(u=n.Hn.get(e))&&(u.forEach(function(n){return n(e)}),n.Hn.delete(e)),o.componentDidLoad&&o.componentDidLoad()}catch(t){n.C(t,4,e)}e.classList.add(i),r(n,e)}})(n,this,o)},i["s-hmr"]=function(e){(function r(n,t,e,i){t.j=null;var o=n.w.get(e);o&&(n.g.delete(o),n.w.delete(e)),n._.J(e),n.Sn.delete(e),t.wn=null,e["s-hmr-load"]=function(){delete e["s-hmr-load"],function r(n,t,e){n.Sn.has(e)||(n.Sn.set(e,!0),t.j&&t.j.listeners&&(t.wn=t.j.listeners.map(function(n){return{e:n.method,t:n.name,o:!!n.capture,i:!!n.passive,r:!!n.disabled}}),g(n,e)))}(n,t,e)},n.P.set(e,j(n._,t,e)),n.Rn(t,e,i)})(n,t,this,e)},i.forceUpdate=function(){u(n,this)},function f(n,t,r){t&&Object.keys(t).forEach(function(i){var o=t[i],u=o.qn;1===u||2===u?v(r,i,function t(){return(n.M.get(this)||{})[i]},function t(r){s(n,this,i,e(o.Q,r))}):6===u&&l(r,i,D)})}(n,t.W,i)}function A(n,t,e,r){return function(){var i=arguments;return function o(n,t,e){var r=t[e],i=n.In.body;return i?(r||(r=i.querySelector(e)),r||(r=t[e]=n.tn(e),n.en(i,r)),r.componentOnReady()):Promise.resolve()}(n,t,e).then(function(n){return n[r].apply(n,i)})}}function $(t,e,r,o,f,c){var a={html:{}},s={},l=r[t]=r[t]||{},v=function d(n,t,e){n.Bn||(n.Bn=function(n,t,e,r){return n.addEventListener(t,e,r)},n.Un=function(n,t,e,r){return n.removeEventListener(t,e,r)});var r=new WeakMap,i={In:e,zn:!1,dn:function(n){return n.nodeType},tn:function(n){return e.createElement(n)},nn:function(n,t){return e.createElementNS(n,t)},X:function(n){return e.createTextNode(n)},rn:function(n){return e.createComment(n)},fn:function(n,t,e){return n.insertBefore(t,e)},un:function(n){return n.remove()},en:function(n,t){return n.appendChild(t)},on:function(n){return n.childNodes},cn:function(n){return n.parentNode},vn:function(n){return n.nextSibling},mn:function(n){return n.previousSibling},an:function(n){return x(n.nodeName)},bn:function(n){return n.textContent},ln:function(n,t){return n.textContent=t},pn:function(n,t){return n.getAttribute(t)},S:function(n,t,e){return n.setAttribute(t,e)},Qn:function(n,t,e,r){return n.setAttributeNS(t,e,r)},Y:function(n,t){return n.removeAttribute(t)},Z:function(n,t){return n.hasAttribute(t)},Tn:function(t){return t.getAttribute("mode")||(n.Context||{}).mode},Yn:function(n,r){return"child"===r?n.firstElementChild:"parent"===r?i.sn(n):"body"===r?e.body:"document"===r?e:"window"===r?t:n},G:function(t,e,o,u,f,c,a,s){var l=e,v=t,d=r.get(t);if(d&&d[l]&&d[l](),"string"==typeof c?v=i.Yn(t,c):"object"==typeof c?v=c:(s=e.split(":")).length>1&&(v=i.Yn(t,s[0]),e=s[1]),v){var p=o;(s=e.split(".")).length>1&&(e=s[0],p=function(n){n.keyCode===N[s[1]]&&o(n)}),a=i.zn?{capture:!!u,passive:!!f}:!!u,n.Bn(v,e,p,a),d||r.set(t,d={}),d[l]=function(){v&&n.Un(v,e,p,a),d[l]=null}}},J:function(n,t){var e=r.get(n);e&&(t?e[t]&&e[t]():Object.keys(e).forEach(function(n){e[n]&&e[n]()}))},_n:function(n,t){return n.attachShadow(t)}};i.T=!!i.In.documentElement.attachShadow,t.location.search.indexOf("shadow=false")>0&&(i.T=!1),"function"!=typeof t.CustomEvent&&(t.CustomEvent=function(n,t,r){return(r=e.createEvent("CustomEvent")).initCustomEvent(n,t.bubbles,t.cancelable,t.detail),r},t.CustomEvent.prototype=t.Event.prototype),i.Zn=function(n,e,r){return n&&n.dispatchEvent(new t.CustomEvent(e,r))};try{t.addEventListener("e",null,Object.defineProperty({},"passive",{get:function(){return i.zn=!0}}))}catch(n){}return i.sn=function(n,t){return(t=i.cn(n))&&11===i.dn(t)?t.host:t},i}(l,r,o);e.isServer=e.isPrerender=!(e.isClient=!0),e.window=r,e.location=r.location,e.document=o,e.resourcesUrl=e.publicPath=f,e.enableListener=function(n,t,e,r,i){return function o(n,t,e,r,i,u){if(t){var f=n.g.get(t),c=n.k(f);if(c&&c.wn)if(r){var a=c.wn.find(function(n){return n.t===e});a&&n._.G(f,e,function(n){return t[a.e](n)},a.o,void 0===u?a.i:!!u,i)}else n._.J(f,e)}}(y,n,t,e,r,i)},e.emit=function(n,t,r){return v.Zn(n,e.eventNameFn?e.eventNameFn(t):t,r)},l.h=i,l.Context=e;var p=r["s-defined"]=r.$definedCmps=r["s-defined"]||r.$definedCmps||{},h=0,y={_:v,Gn:function m(n,t){if(!r.customElements.get(n.n)){k(y,a[n.n]=n,t.prototype,c);var e=t.observedAttributes=[];for(var i in n.W)n.W[i].z&&e.push(n.W[i].z);r.customElements.define(n.n,t)}},A:e.emit,k:function(n){return a[v.an(n)]},H:function(n){return e[n]},isClient:!0,Dn:function(n){return!(!p[v.an(n)]&&!y.k(n))},Wn:function(){return t+h++},C:function(n,t,e){},I:function(n){return function t(n,e,r){return{create:A(n,e,r,"create"),componentOnReady:A(n,e,r,"componentOnReady")}}(v,s,n)},queue:e.queue=function w(n,t){function e(n){for(var t=0;t<n.length;t++)try{n[t]()}catch(n){}n.length=0}function r(n,t){for(var e=0;e<n.length&&o()<t;)try{n[e++]()}catch(n){}e===n.length?n.length=0:0!==e&&n.splice(0,e)}function i(){l++,e(c);var t=o()+7*Math.ceil(l*(1/22));r(a,t),r(s,t),a.length>0&&(s.push.apply(s,a),a.length=0),(v=c.length+a.length+s.length>0)?n.raf(i):l=0}var o=function(){return t.performance.now()},u=Promise.resolve(),f=[],c=[],a=[],s=[],l=0,v=!1;return n.raf||(n.raf=t.requestAnimationFrame.bind(t)),{tick:function(n){f.push(n),1===f.length&&u.then(function(){return e(f)})},read:function(t){c.push(t),v||(v=!0,n.raf(i))},write:function(t){a.push(t),v||(v=!0,n.raf(i))}}}(l,r),Rn:function g(n,t,e){if(n.j)u(y,t);else{var r={mode:t.mode,scoped:2===n.encapsulation||1===n.encapsulation&&!v.T};n.Cn(r).then(function(e){try{n.j=e,function r(n,t,e,i,o){if(i){var u=t.n+(o||T);t[u]||(t[u]=i)}}(0,n,n.encapsulation,e.style,e.styleMode)}catch(t){n.j=function i(){}}u(y,t)})}},u:new WeakMap,Jn:new WeakMap,xn:new WeakMap,Sn:new WeakMap,Ln:new WeakMap,g:new WeakMap,P:new WeakMap,w:new WeakMap,b:new WeakMap,y:new WeakMap,Hn:new WeakMap,O:new WeakMap,D:new WeakMap,M:new WeakMap};y.render=b(y,v);var j=v.In.documentElement;return j["s-ld"]=[],j["s-rn"]=!0,j["s-init"]=function(){y.Ln.set(j,l.loaded=y.m=!0),v.Zn(r,"appload",{detail:{namespace:t}})},y.N=function(t,e,r,i){(function o(t,e,r,i){var o=r.encapsulation,u=2===o||1===o&&!t._.T,f=r.n+i.mode,c=r[f];if(u&&(i["s-sc"]=n(r,i.mode)),c||(c=r[f=r.n+T],u&&(i["s-sc"]=n(r))),c){var a=e.In.head;if(e.T)if(1===o)a=i.shadowRoot;else for(var s=i;s=e.cn(s);)if(s.host&&s.host.shadowRoot){a=s.host.shadowRoot;break}var l=t.Jn.get(a);if(l||t.Jn.set(a,l={}),!l[f]){var v=void 0;if(t.L?v=t.L.Kn(i,f,c):((v=e.tn("style")).innerHTML=c,l[f]=!0),v){e.S(v,"data-style-tag",r.n),i.mode&&e.S(v,"data-style-mode",r.n),i["s-sc"]&&e.S(v,"data-style-scoped","true");var d=a.querySelectorAll("[data-styles]");e.fn(a,v,d.length&&d[d.length-1].nextSibling||a.firstChild)}}}})(t,e,r,i)},function $(n,t,e,r){var i=e.Vn=e.Vn||{};return i.Xn=i.Xn||[],i.Xn.push(function o(n,t,e){return{namespace:t,nt:function(n){return n&&n.tagName?Promise.all([M(e,n.tagName),function t(n,e){return Promise.resolve(n.w.get(e))}(e,n)]).then(function(n){return n[0]&&n[1]?{tt:n[0],et:n[1]}:null}):Promise.resolve(null)},rt:function(n){return M(e,n)},it:function(){return Promise.all(n.components.map(function(n){return M(e,n[0])})).then(function(n){return n.filter(function(n){return n})})}}}(n,t,r)),i.nt||(i.nt=function(n){return Promise.all(i.Xn.map(function(t){return t.nt(n)})).then(function(n){return n.find(function(n){return!!n})})}),i.it||(i.it=function(){var n=[];return i.Xn.forEach(function(t){n.push(t.it())}),Promise.all(n).then(function(n){var t=[];return n.forEach(function(n){n.forEach(function(n){t.push(n)})}),t})}),i}(l,t,r,y),function E(n,t,e,r,i,o){if(t.componentOnReady=function(t,e){if(!t.nodeName.includes("-"))return e(null),!1;var r=n.k(t);if(r)if(n.Ln.has(t))e(t);else{var i=n.Hn.get(t)||[];i.push(e),n.Hn.set(t,i)}return!!r},i){for(o=i.length-1;o>=0;o--)t.componentOnReady(i[o][0],i[o][1])&&i.splice(o,1);for(o=0;o<r.length;o++)if(!e[r[o]].componentOnReady)return;for(o=0;o<i.length;o++)i[o][1](null);i.length=0}}(y,l,r,r["s-apps"],r["s-cr"]),l.initialized=!0,y}function E(n,e,r){void 0===r&&(r={}),e=Array.isArray(e)?e:[e];var i=n.document,o=r.hydratedCssClass||"hydrated",u=e.filter(function(n){return n[2]}).map(function(n){return n[0]});if(u.length){var f=i.createElement("style");f.innerHTML=u.join()+"{visibility:hidden}."+o+"{visibility:inherit}",f.setAttribute("data-styles",""),i.head.insertBefore(f,i.head.firstChild)}var c=r.namespace||"QrCode";U||(U=!0,function a(n,t,e){(n["s-apps"]=n["s-apps"]||[]).push(t),e.componentOnReady||(e.componentOnReady=function t(){function e(t){if(r.nodeName.indexOf("-")>0){for(var e=n["s-apps"],i=0,o=0;o<e.length;o++)if(n[e[o]].componentOnReady){if(n[e[o]].componentOnReady(r,t))return;i++}if(i<e.length)return void(n["s-cr"]=n["s-cr"]||[]).push([r,t])}t(null)}var r=this;return n.Promise?new n.Promise(e):{then:e}})}(n,c,n.HTMLElement.prototype)),applyPolyfills(n,function(){if(!B[c]){var u={},f=r.resourcesUrl||"./";O(c,u,n,i,f,o),B[c]=$(c,u,n,i,f,o)}e.forEach(function(e){var r;!function i(n){return/\{\s*\[native code\]\s*\}/.test(""+n)}(n.customElements.define)?(r=function(t){return n.HTMLElement.call(this,t)}).prototype=Object.create(n.HTMLElement.prototype,{constructor:{value:r,configurable:!0}}):r=new Function("w","return class extends w.HTMLElement{}")(n),B[c].Gn(function o(n,e,r){var i={n:n[0],W:{color:{z:"color"}}};i.Cn=n[1];var o=n[3];if(o)for(e=0;e<o.length;e++)r=o[e],i.W[r[0]]={qn:r[1],U:!!r[2],z:"string"==typeof r[3]?r[3]:r[3]?r[0]:0,Q:r[4]};return i.encapsulation=n[4],n[5]&&(i.wn=n[5].map(t)),i}(e),r)})})}this&&this.ot||(Object.setPrototypeOf||Array);var O=function(){};function applyPolyfills(n,t){n.ut=function(){function t(){var n=setTimeout;return function(){return n(e,1)}}function e(){for(var n=0;n<b;n+=2)(0,C[n])(C[n+1]),C[n]=void 0,C[n+1]=void 0;b=0}function r(n,t){var e=this,r=new this.constructor(o);void 0===r[T]&&h(r);var i=e.ft;if(i){var u=arguments[i-1];M(function(){return p(i,r,u,e.ct)})}else v(e,r,n,t);return r}function i(n){if(n&&"object"==typeof n&&n.constructor===this)return n;var t=new this(o);return c(t,n),t}function o(){}function u(n){try{return n.then}catch(n){return x.error=n,x}}function f(n,t,e){t.constructor===n.constructor&&e===r&&t.constructor.resolve===i?function(n,t){t.ft===N?s(n,t.ct):t.ft===S?l(n,t.ct):v(t,void 0,function(t){return c(n,t)},function(t){return l(n,t)})}(n,t):e===x?(l(n,x.error),x.error=null):void 0===e?s(n,t):"function"==typeof e?function(n,t,e){M(function(n){var r=!1,i=function(n,t,e,r){try{n.call(t,e,r)}catch(n){return n}}(e,t,function(e){r||(r=!0,t!==e?c(n,e):s(n,e))},function(t){r||(r=!0,l(n,t))},n.st);!r&&i&&(r=!0,l(n,i))},n)}(n,t,e):s(n,t)}function c(n,t){if(n===t)l(n,new TypeError("cannot resolve promise w/ itself"));else{var e=typeof t;null===t||"object"!==e&&"function"!==e?s(n,t):f(n,t,u(t))}}function a(n){n.lt&&n.lt(n.ct),d(n)}function s(n,t){n.ft===_&&(n.ct=t,n.ft=N,0!==n.vt.length&&M(d,n))}function l(n,t){n.ft===_&&(n.ft=S,n.ct=t,M(a,n))}function v(n,t,e,r){var i=n.vt,o=i.length;n.lt=null,i[o]=t,i[o+N]=e,i[o+S]=r,0===o&&n.ft&&M(d,n)}function d(n){var t=n.vt,e=n.ft;if(0!==t.length){for(var r,i,o=n.ct,u=0;u<t.length;u+=3)r=t[u],i=t[u+e],r?p(e,r,i,o):i(o);n.vt.length=0}}function p(n,t,e,r){var i="function"==typeof e,o=void 0,u=void 0,f=void 0,a=void 0;if(i){try{o=e(r)}catch(n){x.error=n,o=x}if(o===x?(a=!0,u=o.error,o.error=null):f=!0,t===o)return void l(t,new TypeError("Cannot return same promise"))}else o=r,f=!0;t.ft===_&&(i&&f?c(t,o):a?l(t,u):n===N?s(t,o):n===S&&l(t,o))}function h(n){n[T]=W++,n.ft=void 0,n.ct=void 0,n.vt=[]}var y,m=Array.isArray?Array.isArray:function(n){return"[object Array]"===Object.prototype.toString.call(n)},b=0,w=void 0,g=void 0,M=function(n,t){C[b]=n,C[b+1]=t,2===(b+=2)&&(g?g(e):P())},j=(y=void 0!==n?n:void 0)||{},k=j.dt||j.pt;j="undefined"==typeof self;var A,$,E,O="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,C=Array(1e3),P=void 0;P=k?(A=0,$=new k(e),E=document.createTextNode(""),$.observe(E,{characterData:!0}),function(){E.data=A=++A%2}):O?function(){var n=new MessageChannel;return n.ht.onmessage=e,function(){return n.yt.postMessage(0)}}():void 0===y&&"function"==typeof require?function(){try{var n=Function("return this")().mt("vertx");return void 0!==(w=n.bt||n.wt)?function(){w(e)}:t()}catch(n){return t()}}():t();var T=Math.random().toString(36).substring(2),_=void 0,N=1,S=2,x={error:null},W=0,D=function(){function n(n,t){this.gt=n,this.Mt=new n(o),this.Mt[T]||h(this.Mt),m(t)?(this.jt=this.length=t.length,this.ct=Array(this.length),0===this.length?s(this.Mt,this.ct):(this.length=this.length||0,this.kt(t),0===this.jt&&s(this.Mt,this.ct))):l(this.Mt,Error("Array Methods must be provided an Array"))}return n.prototype.kt=function(n){for(var t=0;this.ft===_&&t<n.length;t++)this.At(n[t],t)},n.prototype.At=function(n,t){var e=this.gt,c=e.resolve;c===i?(c=u(n))===r&&n.ft!==_?this.$t(n.ft,t,n.ct):"function"!=typeof c?(this.jt--,this.ct[t]=n):e===L?(f(e=new e(o),n,c),this.Et(e,t)):this.Et(new e(function(t){return t(n)}),t):this.Et(c(n),t)},n.prototype.$t=function(n,t,e){var r=this.Mt;r.ft===_&&(this.jt--,n===S?l(r,e):this.ct[t]=e),0===this.jt&&s(r,this.ct)},n.prototype.Et=function(n,t){var e=this;v(n,void 0,function(n){return e.$t(N,t,n)},function(n){return e.$t(S,t,n)})},n}(),L=function(){function n(t){if(this[T]=W++,this.ct=this.ft=void 0,this.vt=[],o!==t){if("function"!=typeof t)throw new TypeError("Must pass a resolver fn as 1st arg");if(!(this instanceof n))throw new TypeError("Failed to construct 'Promise': Use the 'new' operator.");!function(n,t){try{t(function(t){c(n,t)},function(t){l(n,t)})}catch(t){l(n,t)}}(this,t)}}return n.prototype.catch=function(n){return this.then(null,n)},n.prototype.finally=function(n){var t=this.constructor;return this.then(function(e){return t.resolve(n()).then(function(){return e})},function(e){return t.resolve(n()).then(function(){throw e})})},n}();return L.prototype.then=r,L.all=function(n){return new D(this,n).Mt},L.race=function(n){var t=this;return m(n)?new t(function(e,r){for(var i=n.length,o=0;o<i;o++)t.resolve(n[o]).then(e,r)}):new t(function(n,t){return t(new TypeError("Must pass array to race"))})},L.resolve=i,L.reject=function(n){var t=new this(o);return l(t,n),t},L.Ot=function(n){g=n},L.Ct=function(n){M=n},L.Pt=M,L.Tt=function(){var n=void 0;if("undefined"!=typeof global)n=global;else if("undefined"!=typeof self)n=self;else try{n=Function("return this")()}catch(n){throw Error("polyfill failed")}var t=n.Promise;if(t){var e=null;try{e=Object.prototype.toString.call(t.resolve())}catch(n){}if("[object Promise]"===e&&!t._t)return}n.Promise=L},L.Promise=L,L.Tt(),L}();var e=[];n.customElements&&(!n.Element||n.Element.prototype.closest&&n.Element.prototype.matches&&n.Element.prototype.remove)||e.push(import("./polyfills/dom.js")),"function"==typeof Object.assign&&Object.entries||e.push(import("./polyfills/object.js")),Array.prototype.find&&Array.prototype.includes||e.push(import("./polyfills/array.js")),String.prototype.startsWith&&String.prototype.endsWith||e.push(import("./polyfills/string.js")),n.fetch||e.push(import("./polyfills/fetch.js")),Promise.all(e).then(function(e){e.forEach(function(t){t.applyPolyfill(n,n.document)}),t()})};var C="data-ssrv",P="data-ssrc",T="$",_={},N={enter:13,escape:27,space:32,tab:9,left:37,up:38,right:39,down:40},S=function(n){return null!=n},x=function(n){return n.toLowerCase()},W=function(n){return x(n).split("-").map(function(n){return n.charAt(0).toUpperCase()+n.slice(1)}).join("")},D=function(){},L=[],R={getTag:function(n){return n.c},getChildren:function(n){return n.a},getText:function(n){return n.f},getAttributes:function(n){return n.s},replaceAttributes:function(n,t){return n.s=t}},F="wc-",H={allowfullscreen:1,async:1,autofocus:1,autoplay:1,checked:1,controls:1,disabled:1,enabled:1,formnovalidate:1,hidden:1,multiple:1,noresize:1,readonly:1,required:1,selected:1,spellcheck:1},q="http://www.w3.org/1999/xlink",I=!1,B={},U=!1;export{E as defineCustomElement,i as h};