@htmlbricks/hb-downloader 0.20.16 → 0.20.18
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/package.json +3 -3
- package/release/manifest.json +1 -1
- package/release/release.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@htmlbricks/hb-downloader",
|
|
3
3
|
"displayName": "Svelte-Bootstrap Downloader WebComponent",
|
|
4
4
|
"description": "Svelte-Bootstrap Downloader WebComponent",
|
|
5
|
-
"version": "0.20.
|
|
5
|
+
"version": "0.20.18",
|
|
6
6
|
"main": "release/release.js",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"wc-js-utils": "^0.0.1"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@htmlbricks/hb-dialog": "^0.20.
|
|
73
|
+
"@htmlbricks/hb-dialog": "^0.20.18"
|
|
74
74
|
},
|
|
75
75
|
"keywords": [
|
|
76
76
|
"svelte",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"webcomponents"
|
|
79
79
|
],
|
|
80
80
|
"contributors": [],
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "89b0885aff646abbcaebdf63ab8602aa87d3e218"
|
|
82
82
|
}
|
package/release/manifest.json
CHANGED
package/release/release.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function i(t,e){t.appendChild(e)}function s(t,e,n){t.insertBefore(e,n||null)}function l(t){t.parentNode&&t.parentNode.removeChild(t)}function u(t){return document.createElement(t)}function c(t){return document.createTextNode(t)}function d(){return c(" ")}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function p(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:f(t,e,n)}function h(t,e){e=""+e,t.data!==e&&(t.data=e)}function m(t,e,n,o){null==n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function g(t){const e={};for(const n of t)e[n.name]=n.value;return e}let v;function y(t){v=t}function b(){if(!v)throw new Error("Function called outside component initialization");return v}function $(){const t=b();return(e,n,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[e];if(r){const a=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(e,n,{cancelable:o});return r.slice().forEach((e=>{e.call(t,a)})),!a.defaultPrevented}return!0}}const w=[],E=[];let x=[];const _=[],k=Promise.resolve();let C=!1;function T(t){x.push(t)}const L=new Set;let M=0;function j(){if(0!==M)return;const t=v;do{try{for(;M<w.length;){const t=w[M];M++,y(t),A(t.$$)}}catch(t){throw w.length=0,M=0,t}for(y(null),w.length=0,M=0;E.length;)E.pop()();for(let t=0;t<x.length;t+=1){const e=x[t];L.has(e)||(L.add(e),e())}x.length=0}while(w.length);for(;_.length;)_.pop()();C=!1,L.clear(),y(t)}function A(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const D=new Set;function O(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];x.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),x=e}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function N(t,e){-1===t.$$.dirty[0]&&(w.push(t),C||(C=!0,k.then(j)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function P(a,i,s,u,c,d,f,p=[-1]){const h=v;y(a);const m=a.$$={fragment:null,ctx:[],props:d,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(h?h.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:i.target||h.$$.root};f&&f(m.root);let g=!1;if(m.ctx=s?s(a,i.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return m.ctx&&c(m.ctx[t],m.ctx[t]=o)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](o),g&&N(a,t)),e})):[],m.update(),g=!0,o(m.before_update),m.fragment=!!u&&u(m.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);m.fragment&&m.fragment.l(t),t.forEach(l)}else m.fragment&&m.fragment.c();i.intro&&((b=a.$$.fragment)&&b.i&&(D.delete(b),b.i($))),function(t,n,a,i){const{fragment:s,after_update:l}=t.$$;s&&s.m(n,a),i||T((()=>{const n=t.$$.on_mount.map(e).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),l.forEach(T)}(a,i.target,i.anchor,i.customElement),j()}var b,$;y(h)}let R;"function"==typeof HTMLElement&&(R=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){O(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var S="0.20.16";var V,H=(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var a=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},i=0,s=Object.keys(t);i<s.length;i++)a(s[i]);return r},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var r=document.createElement("script");r.id=n+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,a="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(a=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),a},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var a="",i=t.getDefaultLang();if(!o||i!==o){var s=null==n?void 0:n[i];(null==s?void 0:s[e])&&(a=s[e])}return a},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n}(V={exports:{}},V.exports),V.exports),z=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,q=/\n/g,F=/^\s*/,I=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,U=/^:\s*/,W=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,B=/^[;\s]*/,G=/^\s+|\s+$/g,J="";function K(t){return t?t.replace(G,J):J}var X=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var r,a,i=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function r(t){var e=t.match(q);e&&(n+=e.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function a(){var t={line:n,column:o};return function(e){return e.position=new i(t),u(),e}}function i(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function s(r){var a=new Error(e.source+":"+n+":"+o+": "+r);if(a.reason=r,a.filename=e.source,a.line=n,a.column=o,a.source=t,!e.silent)throw a}function l(e){var n=e.exec(t);if(n){var o=n[0];return r(o),t=t.slice(o.length),n}}function u(){l(F)}function c(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=a();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;J!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,J===t.charAt(n-1))return s("End of comment missing");var i=t.slice(2,n-2);return o+=2,r(i),t=t.slice(n),o+=2,e({type:"comment",comment:i})}}function f(){var t=a(),e=l(I);if(e){if(d(),!l(U))return s("property missing ':'");var n=l(W),o=t({type:"declaration",property:K(e[0].replace(z,J)),value:n?K(n[0].replace(z,J)):J});return l(B),o}}return i.prototype.content=t,u(),function(){var t,e=[];for(c(e);t=f();)!1!==t&&(e.push(t),c(e));return e}()}(t),s="function"==typeof e,l=0,u=i.length;l<u;l++)r=(n=i[l]).property,a=n.value,s?e(r,a,n):a&&(o||(o={}),o[r]=a);return o},Q={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"},{name:"--hb-modal-max-width",valueType:"htmlsize",defaultValue:"500px"}],parts:[{name:"modal-dialog",description:"The modal dialog"}]};function Y(t){let e;return{c(){e=c(t[5])},m(t,n){s(t,e,n)},p(t,n){32&n&&h(e,t[5])},d(t){t&&l(e)}}}function Z(t){let e,n,o,r,a,d=Math.round(t[4]/t[3]*100)+"";return{c(){e=u("div"),n=u("div"),o=c(d),r=c("%"),f(n,"class","progress-bar"),m(n,"width",Math.round(t[4]/t[3]*100)+"%"),f(n,"role","progressbar"),f(n,"aria-valuenow",a=Math.round(t[4]/t[3]*100)),f(n,"aria-valuemin","0"),f(n,"aria-valuemax","100"),f(e,"class","progress")},m(t,a){s(t,e,a),i(e,n),i(n,o),i(n,r)},p(t,e){24&e&&d!==(d=Math.round(t[4]/t[3]*100)+"")&&h(o,d),24&e&&m(n,"width",Math.round(t[4]/t[3]*100)+"%"),24&e&&a!==(a=Math.round(t[4]/t[3]*100))&&f(n,"aria-valuenow",a)},d(t){t&&l(e)}}}function tt(e){let n;return{c(){n=u("div"),n.innerHTML='<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>',f(n,"class","progress")},m(t,e){s(t,n,e)},p:t,d(t){t&&l(n)}}}function et(e){let n,o,r,a,c,h,m,g,v;function y(t,e){return t[3]||t[5]?t[5]?t[5]?Y:void 0:Z:tt}let b=y(e),$=b&&b(e);return{c(){n=u("hb-dialog"),o=u("span"),o.innerHTML='<slot name="title">Downloading</slot>',r=d(),a=u("div"),$&&$.c(),c=d(),h=u("span"),this.c=t,f(o,"slot","title"),f(a,"slot","body-content"),f(h,"slot","modal-footer"),p(n,"style",e[2]),p(n,"id",e[0]),p(n,"show",m=e[1]?"yes":"no")},m(t,l){var u,d,f,p;s(t,n,l),i(n,o),i(n,r),i(n,a),$&&$.m(a,null),i(n,c),i(n,h),g||(u=n,d="modalShow",f=e[12],u.addEventListener(d,f,p),v=()=>u.removeEventListener(d,f,p),g=!0)},p(t,[e]){b===(b=y(t))&&$?$.p(t,e):($&&$.d(1),$=b&&b(t),$&&($.c(),$.m(a,null))),4&e&&p(n,"style",t[2]),1&e&&p(n,"id",t[0]),2&e&&m!==(m=t[1]?"yes":"no")&&p(n,"show",m)},i:t,o:t,d(t){t&&l(n),$&&$.d(),g=!1,v()}}}function nt(t,e,n){let o,{style:r}=e,a="";const i=b(),s=$();function l(t,e){s(t,e),i.dispatchEvent&&i.dispatchEvent(new CustomEvent(t,{detail:e}))}H.addComponent({repoName:"@htmlbricks/hb-dialog",version:S});let u,c,d,f,{downloadid:p}=e,{uri:h}=e,{headers:m}=e,{targetfilename:g}=e,v=0;function y(t){t.show?(n(0,p=t.id),function(){function t(t){console.error(t),t&&n(5,f=t),c=null,l("downloadError",{downloaded:d,id:p,error:t})}n(4,v=0),c=new XMLHttpRequest;try{if(c.open("GET",h,!0),m)for(const t of Object.keys(m))c.setRequestHeader(t,m[t]);c.responseType="blob",c.onload=function(){if(c.status&&(c.status>299||c.status<200))return t("request error");const e=(window.URL||window.webkitURL).createObjectURL(this.response),o=document.createElement("a");return o.href=e,o.target="_blank",o.download=g,document.body.appendChild(o),o.click(),document.body.removeChild(o),console.log("loadEnd"),n(0,p=""),n(1,h=""),c=null,n(11,d=!0),n(5,f=null),l("downloadComplete",{downloaded:d,id:p||"default"})},c.onerror=e=>t(e),c.onprogress=function(t){n(3,u=(null==t?void 0:t.total)||0),n(4,v=(null==t?void 0:t.loaded)||0)},c.onloadend=function(t){},c.send()}catch(e){return console.error("download err ",e),t(e)}}()):(n(1,h=""),n(0,p=""),n(5,f=null),c&&c.abort(),c=null),l("modalShow",t)}return t.$$set=t=>{"style"in t&&n(9,r=t.style),"downloadid"in t&&n(0,p=t.downloadid),"uri"in t&&n(1,h=t.uri),"headers"in t&&n(7,m=t.headers),"targetfilename"in t&&n(8,g=t.targetfilename)},t.$$.update=()=>{if(3971&t.$$.dirty){r&&(n(10,o=X(r)),n(2,a=H.getChildStyleToPass(o,null==Q?void 0:Q.vars))),p||n(0,p=""),d||n(11,d=!1),h||n(1,h="");try{m&&"string"==typeof m&&n(7,m=JSON.parse(m))}catch(t){}!g&&h&&n(8,g=h.split("/")[h.split("/").length-1].split("?")[0])}},[p,h,a,u,v,f,y,m,g,r,o,d,t=>y(t.detail)]}class ot extends R{constructor(t){super();const e=document.createElement("style");e.textContent='@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress{display:flex;height:1rem;overflow:hidden;font-size:0.75rem;background-color:#e9ecef;border-radius:0.25rem}.progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background-color:var(--bs-primary,#07689f);transition:width 0.6s ease}@media(prefers-reduced-motion: reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-size:1rem 1rem}.progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media(prefers-reduced-motion: reduce){.progress-bar-animated{animation:none}}:host{font-family:"Roboto", sans-serif}',this.shadowRoot.appendChild(e),P(this,{target:this.shadowRoot,props:g(this.attributes),customElement:!0},nt,et,a,{style:9,downloadid:0,uri:1,headers:7,targetfilename:8},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),j()))}static get observedAttributes(){return["style","downloadid","uri","headers","targetfilename"]}get style(){return this.$$.ctx[9]}set style(t){this.$$set({style:t}),j()}get downloadid(){return this.$$.ctx[0]}set downloadid(t){this.$$set({downloadid:t}),j()}get uri(){return this.$$.ctx[1]}set uri(t){this.$$set({uri:t}),j()}get headers(){return this.$$.ctx[7]}set headers(t){this.$$set({headers:t}),j()}get targetfilename(){return this.$$.ctx[8]}set targetfilename(t){this.$$set({targetfilename:t}),j()}}return customElements.define("hb-downloader",ot),ot}();
|
|
1
|
+
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function i(t,e){t.appendChild(e)}function s(t,e,n){t.insertBefore(e,n||null)}function l(t){t.parentNode&&t.parentNode.removeChild(t)}function u(t){return document.createElement(t)}function c(t){return document.createTextNode(t)}function d(){return c(" ")}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function p(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:f(t,e,n)}function h(t,e){e=""+e,t.data!==e&&(t.data=e)}function m(t,e,n,o){null==n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function g(t){const e={};for(const n of t)e[n.name]=n.value;return e}let v;function y(t){v=t}function b(){if(!v)throw new Error("Function called outside component initialization");return v}function $(){const t=b();return(e,n,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[e];if(r){const a=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(e,n,{cancelable:o});return r.slice().forEach((e=>{e.call(t,a)})),!a.defaultPrevented}return!0}}const w=[],E=[];let x=[];const _=[],k=Promise.resolve();let C=!1;function T(t){x.push(t)}const L=new Set;let M=0;function j(){if(0!==M)return;const t=v;do{try{for(;M<w.length;){const t=w[M];M++,y(t),A(t.$$)}}catch(t){throw w.length=0,M=0,t}for(y(null),w.length=0,M=0;E.length;)E.pop()();for(let t=0;t<x.length;t+=1){const e=x[t];L.has(e)||(L.add(e),e())}x.length=0}while(w.length);for(;_.length;)_.pop()();C=!1,L.clear(),y(t)}function A(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const D=new Set;function O(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];x.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),x=e}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function N(t,e){-1===t.$$.dirty[0]&&(w.push(t),C||(C=!0,k.then(j)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function P(a,i,s,u,c,d,f,p=[-1]){const h=v;y(a);const m=a.$$={fragment:null,ctx:[],props:d,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(h?h.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:i.target||h.$$.root};f&&f(m.root);let g=!1;if(m.ctx=s?s(a,i.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return m.ctx&&c(m.ctx[t],m.ctx[t]=o)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](o),g&&N(a,t)),e})):[],m.update(),g=!0,o(m.before_update),m.fragment=!!u&&u(m.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);m.fragment&&m.fragment.l(t),t.forEach(l)}else m.fragment&&m.fragment.c();i.intro&&((b=a.$$.fragment)&&b.i&&(D.delete(b),b.i($))),function(t,n,a,i){const{fragment:s,after_update:l}=t.$$;s&&s.m(n,a),i||T((()=>{const n=t.$$.on_mount.map(e).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),l.forEach(T)}(a,i.target,i.anchor,i.customElement),j()}var b,$;y(h)}let R;"function"==typeof HTMLElement&&(R=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){O(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var S="0.20.18";var V,H=(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var a=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},i=0,s=Object.keys(t);i<s.length;i++)a(s[i]);return r},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var r=document.createElement("script");r.id=n+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,a="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(a=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),a},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var a="",i=t.getDefaultLang();if(!o||i!==o){var s=null==n?void 0:n[i];(null==s?void 0:s[e])&&(a=s[e])}return a},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n}(V={exports:{}},V.exports),V.exports),z=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,q=/\n/g,F=/^\s*/,I=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,U=/^:\s*/,W=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,B=/^[;\s]*/,G=/^\s+|\s+$/g,J="";function K(t){return t?t.replace(G,J):J}var X=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var r,a,i=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function r(t){var e=t.match(q);e&&(n+=e.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function a(){var t={line:n,column:o};return function(e){return e.position=new i(t),u(),e}}function i(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function s(r){var a=new Error(e.source+":"+n+":"+o+": "+r);if(a.reason=r,a.filename=e.source,a.line=n,a.column=o,a.source=t,!e.silent)throw a}function l(e){var n=e.exec(t);if(n){var o=n[0];return r(o),t=t.slice(o.length),n}}function u(){l(F)}function c(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=a();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;J!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,J===t.charAt(n-1))return s("End of comment missing");var i=t.slice(2,n-2);return o+=2,r(i),t=t.slice(n),o+=2,e({type:"comment",comment:i})}}function f(){var t=a(),e=l(I);if(e){if(d(),!l(U))return s("property missing ':'");var n=l(W),o=t({type:"declaration",property:K(e[0].replace(z,J)),value:n?K(n[0].replace(z,J)):J});return l(B),o}}return i.prototype.content=t,u(),function(){var t,e=[];for(c(e);t=f();)!1!==t&&(e.push(t),c(e));return e}()}(t),s="function"==typeof e,l=0,u=i.length;l<u;l++)r=(n=i[l]).property,a=n.value,s?e(r,a,n):a&&(o||(o={}),o[r]=a);return o},Q={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"},{name:"--hb-modal-max-width",valueType:"htmlsize",defaultValue:"500px"}],parts:[{name:"modal-dialog",description:"The modal dialog"}]};function Y(t){let e;return{c(){e=c(t[5])},m(t,n){s(t,e,n)},p(t,n){32&n&&h(e,t[5])},d(t){t&&l(e)}}}function Z(t){let e,n,o,r,a,d=Math.round(t[4]/t[3]*100)+"";return{c(){e=u("div"),n=u("div"),o=c(d),r=c("%"),f(n,"class","progress-bar"),m(n,"width",Math.round(t[4]/t[3]*100)+"%"),f(n,"role","progressbar"),f(n,"aria-valuenow",a=Math.round(t[4]/t[3]*100)),f(n,"aria-valuemin","0"),f(n,"aria-valuemax","100"),f(e,"class","progress")},m(t,a){s(t,e,a),i(e,n),i(n,o),i(n,r)},p(t,e){24&e&&d!==(d=Math.round(t[4]/t[3]*100)+"")&&h(o,d),24&e&&m(n,"width",Math.round(t[4]/t[3]*100)+"%"),24&e&&a!==(a=Math.round(t[4]/t[3]*100))&&f(n,"aria-valuenow",a)},d(t){t&&l(e)}}}function tt(e){let n;return{c(){n=u("div"),n.innerHTML='<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>',f(n,"class","progress")},m(t,e){s(t,n,e)},p:t,d(t){t&&l(n)}}}function et(e){let n,o,r,a,c,h,m,g,v;function y(t,e){return t[3]||t[5]?t[5]?t[5]?Y:void 0:Z:tt}let b=y(e),$=b&&b(e);return{c(){n=u("hb-dialog"),o=u("span"),o.innerHTML='<slot name="title">Downloading</slot>',r=d(),a=u("div"),$&&$.c(),c=d(),h=u("span"),this.c=t,f(o,"slot","title"),f(a,"slot","body-content"),f(h,"slot","modal-footer"),p(n,"style",e[2]),p(n,"id",e[0]),p(n,"show",m=e[1]?"yes":"no")},m(t,l){var u,d,f,p;s(t,n,l),i(n,o),i(n,r),i(n,a),$&&$.m(a,null),i(n,c),i(n,h),g||(u=n,d="modalShow",f=e[12],u.addEventListener(d,f,p),v=()=>u.removeEventListener(d,f,p),g=!0)},p(t,[e]){b===(b=y(t))&&$?$.p(t,e):($&&$.d(1),$=b&&b(t),$&&($.c(),$.m(a,null))),4&e&&p(n,"style",t[2]),1&e&&p(n,"id",t[0]),2&e&&m!==(m=t[1]?"yes":"no")&&p(n,"show",m)},i:t,o:t,d(t){t&&l(n),$&&$.d(),g=!1,v()}}}function nt(t,e,n){let o,{style:r}=e,a="";const i=b(),s=$();function l(t,e){s(t,e),i.dispatchEvent&&i.dispatchEvent(new CustomEvent(t,{detail:e}))}H.addComponent({repoName:"@htmlbricks/hb-dialog",version:S});let u,c,d,f,{downloadid:p}=e,{uri:h}=e,{headers:m}=e,{targetfilename:g}=e,v=0;function y(t){t.show?(n(0,p=t.id),function(){function t(t){console.error(t),t&&n(5,f=t),c=null,l("downloadError",{downloaded:d,id:p,error:t})}n(4,v=0),c=new XMLHttpRequest;try{if(c.open("GET",h,!0),m)for(const t of Object.keys(m))c.setRequestHeader(t,m[t]);c.responseType="blob",c.onload=function(){if(c.status&&(c.status>299||c.status<200))return t("request error");const e=(window.URL||window.webkitURL).createObjectURL(this.response),o=document.createElement("a");return o.href=e,o.target="_blank",o.download=g,document.body.appendChild(o),o.click(),document.body.removeChild(o),console.log("loadEnd"),n(0,p=""),n(1,h=""),c=null,n(11,d=!0),n(5,f=null),l("downloadComplete",{downloaded:d,id:p||"default"})},c.onerror=e=>t(e),c.onprogress=function(t){n(3,u=(null==t?void 0:t.total)||0),n(4,v=(null==t?void 0:t.loaded)||0)},c.onloadend=function(t){},c.send()}catch(e){return console.error("download err ",e),t(e)}}()):(n(1,h=""),n(0,p=""),n(5,f=null),c&&c.abort(),c=null),l("modalShow",t)}return t.$$set=t=>{"style"in t&&n(9,r=t.style),"downloadid"in t&&n(0,p=t.downloadid),"uri"in t&&n(1,h=t.uri),"headers"in t&&n(7,m=t.headers),"targetfilename"in t&&n(8,g=t.targetfilename)},t.$$.update=()=>{if(3971&t.$$.dirty){r&&(n(10,o=X(r)),n(2,a=H.getChildStyleToPass(o,null==Q?void 0:Q.vars))),p||n(0,p=""),d||n(11,d=!1),h||n(1,h="");try{m&&"string"==typeof m&&n(7,m=JSON.parse(m))}catch(t){}!g&&h&&n(8,g=h.split("/")[h.split("/").length-1].split("?")[0])}},[p,h,a,u,v,f,y,m,g,r,o,d,t=>y(t.detail)]}class ot extends R{constructor(t){super();const e=document.createElement("style");e.textContent='@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress{display:flex;height:1rem;overflow:hidden;font-size:0.75rem;background-color:#e9ecef;border-radius:0.25rem}.progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background-color:var(--bs-primary,#07689f);transition:width 0.6s ease}@media(prefers-reduced-motion: reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-size:1rem 1rem}.progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media(prefers-reduced-motion: reduce){.progress-bar-animated{animation:none}}:host{font-family:"Roboto", sans-serif}',this.shadowRoot.appendChild(e),P(this,{target:this.shadowRoot,props:g(this.attributes),customElement:!0},nt,et,a,{style:9,downloadid:0,uri:1,headers:7,targetfilename:8},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),j()))}static get observedAttributes(){return["style","downloadid","uri","headers","targetfilename"]}get style(){return this.$$.ctx[9]}set style(t){this.$$set({style:t}),j()}get downloadid(){return this.$$.ctx[0]}set downloadid(t){this.$$set({downloadid:t}),j()}get uri(){return this.$$.ctx[1]}set uri(t){this.$$set({uri:t}),j()}get headers(){return this.$$.ctx[7]}set headers(t){this.$$set({headers:t}),j()}get targetfilename(){return this.$$.ctx[8]}set targetfilename(t){this.$$set({targetfilename:t}),j()}}return customElements.define("hb-downloader",ot),ot}();
|
|
2
2
|
//# sourceMappingURL=release.js.map
|