@speechly/browser-ui
Advanced tools
Comparing version 1.3.6 to 1.3.7
@@ -1,2 +0,2 @@ | ||
!function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function i(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e}function s(t){return 0===Object.keys(t).length}let a=!1;const l=new Set;function u(t,e){a&&l.delete(e),e.parentNode!==t&&t.appendChild(e)}function d(t,e,n){a&&l.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function f(t){a?l.add(t):t.parentNode&&t.parentNode.removeChild(t)}function p(t){return document.createElement(t)}function h(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function g(){return t=" ",document.createTextNode(t);var t}function m(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function $(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function w(t){const e={};for(const n of t)e[n.name]=n.value;return e}let b;function y(t){b=t}function x(){if(!b)throw new Error("Function called outside component initialization");return b}const C=[],k=[],N=[],S=[],E=Promise.resolve();let M=!1;function _(t){N.push(t)}let z=!1;const B=new Set;function D(){if(!z){z=!0;do{for(let t=0;t<C.length;t+=1){const e=C[t];y(e),L(e.$$)}for(y(null),C.length=0;k.length;)k.pop()();for(let t=0;t<N.length;t+=1){const e=N[t];B.has(e)||(B.add(e),e())}N.length=0}while(C.length);for(;S.length;)S.pop()();M=!1,z=!1,B.clear()}}function L(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(_)}}const P=new Set;function F(t,e){t&&t.i&&(P.delete(t),t.i(e))}function A(t,e,n,o){if(t&&t.o){if(P.has(t))return;P.add(t),undefined.c.push((()=>{P.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const R="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function I(t){t&&t.c()}function H(t,n,r,c){const{fragment:s,on_mount:a,on_destroy:l,after_update:u}=t.$$;s&&s.m(n,r),c||_((()=>{const n=a.map(e).filter(i);l?l.push(...n):o(n),t.$$.on_mount=[]})),u.forEach(_)}function T(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function V(t,e){-1===t.$$.dirty[0]&&(C.push(t),M||(M=!0,E.then(D)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function j(e,i,r,c,s,u,d=[-1]){const p=b;y(e);const h=e.$$={fragment:null,ctx:null,props:u,update:t,not_equal:s,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(p?p.$$.context:i.context||[]),callbacks:n(),dirty:d,skip_bound:!1};let g=!1;if(h.ctx=r?r(e,i.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return h.ctx&&s(h.ctx[t],h.ctx[t]=i)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](i),g&&V(e,t)),n})):[],h.update(),g=!0,o(h.before_update),h.fragment=!!c&&c(h.ctx),i.target){if(i.hydrate){a=!0;const t=function(t){return Array.from(t.childNodes)}(i.target);h.fragment&&h.fragment.l(t),t.forEach(f)}else h.fragment&&h.fragment.c();i.intro&&F(e.$$.fragment),H(e,i.target,i.anchor,i.customElement),function(){a=!1;for(const t of l)t.parentNode.removeChild(t);l.clear()}(),D()}y(p)}let O;"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){T(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!s(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class G{$destroy(){T(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!s(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function q(e){let n,o,i,r,c,s,a,l;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),c=h("stop"),s=h("g"),a=h("path"),l=h("path"),$(r,"stop-color","var(--gradient-stop1)"),$(r,"offset","0%"),$(c,"stop-color","var(--gradient-stop2)"),$(c,"offset","100%"),$(i,"x1","50%"),$(i,"y1","0%"),$(i,"x2","50%"),$(i,"y2","100%"),$(i,"id","a"),$(a,"d","M46 3.119c23.683 0 42.881 19.198 42.881 42.881S69.683 88.881 46 88.881 3.119 69.683 3.119 46 22.317 3.119 46 3.119z"),$(a,"fill","#FFF"),$(l,"d","M46 0C20.595 0 0 20.595 0 46s20.595 46 46 46 46-20.595 46-46S71.405 0 46 0zm0 3.119c23.683 0 42.881 19.198 42.881 42.881S69.683 88.881 46 88.881 3.119 69.683 3.119 46 22.317 3.119 46 3.119z"),$(l,"fill","url(#a)"),$(s,"fill","none"),$(s,"fillrule","nonzero"),$(n,"class","buttonFrameEl"),$(n,"viewBox","0 0 92 92"),$(n,"xmlns","http://www.w3.org/2000/svg"),v(n,"position","absolute"),v(n,"width","100%"),v(n,"height","100%"),v(n,"pointer-events","none"),v(n,"user-select","none"),v(n,"transform","rotate(var(--fx-rotation))")},m(t,e){d(t,n,e),u(n,o),u(o,i),u(i,r),u(i,c),u(n,s),u(s,a),u(s,l)},p:t,i:t,o:t,d(t){t&&f(n)}}}class U extends G{constructor(t){super(),j(this,t,null,q,r,{})}}var J,K,Q,W,X,Y=(function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),(n=e.ClientState||(e.ClientState={}))[n.Failed=0]="Failed",n[n.NoBrowserSupport=1]="NoBrowserSupport",n[n.NoAudioConsent=2]="NoAudioConsent",n[n.Disconnected=3]="Disconnected",n[n.Disconnecting=4]="Disconnecting",n[n.Connecting=5]="Connecting",n[n.Connected=6]="Connected",n[n.Starting=7]="Starting",n[n.Stopping=8]="Stopping",n[n.Recording=9]="Recording"}(J={exports:{}},J.exports),J.exports);!function(t){t.Failed="Failed",t.NoBrowserSupport="NoBrowserSupport",t.NoAudioConsent="NoAudioConsent",t.Idle="Idle",t.Connecting="Connecting",t.Ready="Ready",t.Recording="Recording",t.Loading="Loading"}(K||(K={})),function(t){t.Poweron="poweron",t.Mic="mic",t.Error="error",t.Denied="denied"}(Q||(Q={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(W||(W={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(X||(X={}));const Z={[Y.ClientState.Disconnected]:{icon:Q.Poweron,behaviour:W.Click,effect:X.None},[Y.ClientState.Disconnecting]:{icon:Q.Poweron,behaviour:W.Noninteractive,effect:X.Connecting},[Y.ClientState.Connecting]:{icon:Q.Poweron,behaviour:W.Noninteractive,effect:X.Connecting},[Y.ClientState.Connected]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[Y.ClientState.Starting]:{icon:Q.Mic,behaviour:W.Hold,effect:X.Connecting},[Y.ClientState.Recording]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[Y.ClientState.Stopping]:{icon:Q.Mic,behaviour:W.Noninteractive,effect:X.Busy},[Y.ClientState.Failed]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[Y.ClientState.NoBrowserSupport]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[Y.ClientState.NoAudioConsent]:{icon:Q.Denied,behaviour:W.Click,effect:X.None},[K.Idle]:{icon:Q.Poweron,behaviour:W.Click,effect:X.None},[K.Connecting]:{icon:Q.Poweron,behaviour:W.Noninteractive,effect:X.Connecting},[K.Ready]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[K.Recording]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[K.Loading]:{icon:Q.Mic,behaviour:W.Noninteractive,effect:X.Busy},[K.Failed]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[K.NoBrowserSupport]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[K.NoAudioConsent]:{icon:Q.Denied,behaviour:W.Click,effect:X.None}};function tt(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("rect"),$(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),$(i,"x","20"),$(i,"y","1"),$(i,"width","16"),$(i,"height","37"),$(i,"rx","8"),$(n,"fill","#000"),$(n,"fill-rule","evenodd"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function et(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),$(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),$(o,"fill-rule","nonzero"),$(i,"d","M37 13.081V31a8 8 0 11-16 0v-1.919l16-16zM26 1a8 8 0 018 8v1.319L18 26.318V9a8 8 0 018-8zM37.969 7.932l3.74-7.35 3.018 2.625zM39.654 10.608l7.531-3.359.695 3.94z"),$(n,"fill","#000"),$(n,"fill-rule","evenodd"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function nt(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),$(o,"d","M36 14.828V30a8 8 0 01-15.961.79l15.96-15.962zM28 1a8 8 0 018 8v.172L20 25.173V9a8 8 0 018-8z"),$(i,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),$(n,"fill","#000"),$(n,"fill-rule","nonzero"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function ot(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("rect"),$(o,"d","M52 28c0 13.255-10.745 24-24 24S4 41.255 4 28c0-8.921 4.867-16.705 12.091-20.842l1.984 3.474C12.055 14.08 8 20.566 8 28c0 11.046 8.954 20 20 20s20-8.954 20-20c0-7.434-4.056-13.92-10.075-17.368L39.91 7.16C47.133 11.296 52 19.079 52 28z"),$(o,"fill-rule","nonzero"),$(i,"x","24"),$(i,"y","1"),$(i,"width","8"),$(i,"height","23"),$(i,"rx","4"),$(n,"fill","#000"),$(n,"fill-rule","evenodd"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function it(e){let n,o,i,r,c=e[0]===Q.Mic&&tt(),s=e[0]===Q.Error&&et(),a=e[0]===Q.Denied&&nt(),l=e[0]===Q.Poweron&&ot();return{c(){n=p("div"),c&&c.c(),o=g(),s&&s.c(),i=g(),a&&a.c(),r=g(),l&&l.c(),v(n,"position","absolute"),v(n,"width","60%"),v(n,"height","60%"),v(n,"top","50%"),v(n,"left","50%"),v(n,"transform","translate(-50%, -50%)"),v(n,"pointer-events","none"),v(n,"transition","0.25s"),v(n,"opacity","var(--icon-opacity)")},m(t,e){d(t,n,e),c&&c.m(n,null),u(n,o),s&&s.m(n,null),u(n,i),a&&a.m(n,null),u(n,r),l&&l.m(n,null)},p(t,[e]){t[0]===Q.Mic?c||(c=tt(),c.c(),c.m(n,o)):c&&(c.d(1),c=null),t[0]===Q.Error?s||(s=et(),s.c(),s.m(n,i)):s&&(s.d(1),s=null),t[0]===Q.Denied?a||(a=nt(),a.c(),a.m(n,r)):a&&(a.d(1),a=null),t[0]===Q.Poweron?l||(l=ot(),l.c(),l.m(n,null)):l&&(l.d(1),l=null)},i:t,o:t,d(t){t&&f(n),c&&c.d(),s&&s.d(),a&&a.d(),l&&l.d()}}}function rt(t,e,n){let{icon:o=Q.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]}class ct extends G{constructor(t){super(),j(this,t,rt,it,r,{icon:0})}}function st(e){let n,o,i,r,c,s,a,l;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),c=h("stop"),s=h("filter"),a=h("feGaussianBlur"),l=h("circle"),$(r,"stop-color","var(--gradient-stop1)"),$(r,"offset","0%"),$(c,"stop-color","var(--gradient-stop2)"),$(c,"offset","100%"),$(i,"x1","50%"),$(i,"y1","10%"),$(i,"x2","50%"),$(i,"y2","100%"),$(i,"id","a"),$(a,"stdDeviation","18"),$(a,"in","SourceGraphic"),$(s,"x","-35%"),$(s,"y","-35%"),$(s,"width","170%"),$(s,"height","170%"),$(s,"filterUnits","objectBoundingBox"),$(s,"id","b"),$(l,"filter","url(#b)"),$(l,"cx","124"),$(l,"cy","124"),$(l,"r","79"),$(l,"fill","url(#a)"),$(l,"fillrule","evenodd"),$(n,"viewBox","0 0 246 246"),$(n,"xmlns","http://www.w3.org/2000/svg"),v(n,"top","-75%"),v(n,"left","-75%"),v(n,"height","250%"),v(n,"width","250%"),v(n,"position","absolute"),v(n,"pointer-events","none"),v(n,"opacity","var(--fx-opacity)"),v(n,"transform","rotate(var(--fx-rotation))")},m(t,e){d(t,n,e),u(n,o),u(o,i),u(i,r),u(i,c),u(o,s),u(s,a),u(n,l)},p:t,i:t,o:t,d(t){t&&f(n)}}}class at extends G{constructor(t){super(),j(this,t,null,st,r,{})}}const{window:lt}=R;function ut(e){let n,i,r,c,s,a,l,h,w,b,y,x;return r=new at({}),s=new U({}),l=new ct({props:{icon:e[7].icon}}),{c(){n=p("main"),i=p("div"),I(r.$$.fragment),c=g(),I(s.$$.fragment),a=g(),I(l.$$.fragment),h=g(),w=p("slot"),this.c=t,$(i,"class","ButtonComponents"),v(i,"transform","scale("+e[4][1]+")"),v(n,"width",e[0]),v(n,"height",e[0]),v(n,"--gradient-stop1",e[1]),v(n,"--gradient-stop2",e[2]),v(n,"--fx-rotation",e[3][1]+"deg"),v(n,"--fx-opacity",e[6][1]),v(n,"--icon-opacity",e[5][1])},m(t,o){d(t,n,o),u(n,i),H(r,i,null),u(i,c),H(s,i,null),u(i,a),H(l,i,null),u(n,h),u(n,w),b=!0,y||(x=[m(lt,"mouseup",e[9]),m(lt,"keydown",e[10]),m(lt,"keyup",e[11]),m(n,"mousedown",e[8]),m(n,"touchstart",e[8]),m(n,"dragstart",e[8]),m(n,"mouseup",e[9]),m(n,"touchend",e[9],{passive:!0}),m(n,"dragend",e[9])],y=!0)},p(t,[e]){const o={};128&e&&(o.icon=t[7].icon),l.$set(o),(!b||16&e)&&v(i,"transform","scale("+t[4][1]+")"),(!b||1&e)&&v(n,"width",t[0]),(!b||1&e)&&v(n,"height",t[0]),(!b||2&e)&&v(n,"--gradient-stop1",t[1]),(!b||4&e)&&v(n,"--gradient-stop2",t[2]),(!b||8&e)&&v(n,"--fx-rotation",t[3][1]+"deg"),(!b||64&e)&&v(n,"--fx-opacity",t[6][1]),(!b||32&e)&&v(n,"--icon-opacity",t[5][1])},i(t){b||(F(r.$$.fragment,t),F(s.$$.fragment,t),F(l.$$.fragment,t),b=!0)},o(t){A(r.$$.fragment,t),A(s.$$.fragment,t),A(l.$$.fragment,t),b=!1},d(t){t&&f(n),T(r),T(s),T(l),y=!1,o(x)}}}function dt(t,e,n){let o,{icon:i=K.Idle}=e,{capturekey:r=" "}=e,{size:c="6rem"}=e,{gradientstop1:s="#15e8b5"}=e,{gradientstop2:a="#4fa1f9"}=e,{hide:l}=e;let u=!1,d=0,f=[0,0],p=[0,0],h=[1,1],g=[0,0],m=Z[i],$=null,v=0,w=0;const b=x(),y=(t,e)=>{b.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))};!function(t){x().$$.on_mount.push(t)}((()=>{n(4,p=[1,0]);let t=null;const e=()=>{v=w,w=(new Date).getTime();const i=w-(v||w);m.effect===X.Connecting&&n(5,h[0]=.25*Math.cos(w/2500*Math.PI*2)+.25,h),m.effect===X.Busy&&n(5,h[0]=.25*Math.cos(w/1e3*Math.PI*2)+.25,h),n(4,p=[p[0],N(p[1],o?p[0]:0,.2,i)]),n(5,h=[h[0],N(h[1],h[0],.08,i)]),n(6,g=[g[0],N(g[1],g[0],.08,i)]),n(3,f=[f[0]+2.5,N(f[1],f[0],.05,i)]),t=requestAnimationFrame(e)};return e(),()=>cancelAnimationFrame(t)}));const C=t=>{t.preventDefault(),t.stopPropagation(),o&&!u&&(n(16,u=!0),d=Date.now(),n(4,p[0]=1.35,p),n(6,g[0]=1,g),S(),m.behaviour===W.Click&&(n(3,f[0]+=720,f),null===$&&($=window.setTimeout((()=>{n(6,g[0]=0,g),$=null}),500))),b.onholdstart&&b.onholdstart(),y("holdstart"))},k=()=>{if(u){n(4,p[0]=1,p),n(6,g[0]=0,g),n(16,u=!1);const t={timeMs:Date.now()-d};S(),null!==$&&window.clearTimeout($),b.onholdend&&b.onholdend(t),y("holdend",t)}},N=(t,e,n,o)=>t*(1-(n=Math.pow(n,1e3/60/o)))+e*n,S=(t=5)=>{void 0!==navigator.vibrate&&navigator.vibrate(t)};return t.$$set=t=>{"icon"in t&&n(12,i=t.icon),"capturekey"in t&&n(13,r=t.capturekey),"size"in t&&n(0,c=t.size),"gradientstop1"in t&&n(1,s=t.gradientstop1),"gradientstop2"in t&&n(2,a=t.gradientstop2),"hide"in t&&n(14,l=t.hide)},t.$$.update=()=>{16384&t.$$.dirty&&(o=void 0===l||"false"===l),69632&t.$$.dirty&&(u||(t=>{if(m!==t)switch(n(7,m=t),t.icon){case Q.Mic:case Q.Denied:case Q.Error:n(5,h[0]=1,h)}})(Z[i]))},[c,s,a,f,p,h,g,m,C,k,t=>{r&&(t.key===r&&(document.hasFocus()&&document.activeElement!==document.body&&document.activeElement!==document.documentElement&&document.activeElement||null||(t.repeat?(t.preventDefault(),t.stopPropagation()):C(t))))},t=>{t.key===r&&k()},i,r,l,()=>u,u]}class ft extends O{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{position:relative;pointer-events:auto;cursor:pointer;border-radius:50%;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none !important;-webkit-user-select:none !important}.ButtonComponents{width:100%;height:100%}</style>",j(this,{target:this.shadowRoot,props:w(this.attributes),customElement:!0},dt,ut,c,{icon:12,capturekey:13,size:0,gradientstop1:1,gradientstop2:2,hide:14,isbuttonpressed:15}),t&&(t.target&&d(t.target,this,t.anchor),t.props&&(this.$set(t.props),D()))}static get observedAttributes(){return["icon","capturekey","size","gradientstop1","gradientstop2","hide","isbuttonpressed"]}get icon(){return this.$$.ctx[12]}set icon(t){this.$set({icon:t}),D()}get capturekey(){return this.$$.ctx[13]}set capturekey(t){this.$set({capturekey:t}),D()}get size(){return this.$$.ctx[0]}set size(t){this.$set({size:t}),D()}get gradientstop1(){return this.$$.ctx[1]}set gradientstop1(t){this.$set({gradientstop1:t}),D()}get gradientstop2(){return this.$$.ctx[2]}set gradientstop2(t){this.$set({gradientstop2:t}),D()}get hide(){return this.$$.ctx[14]}set hide(t){this.$set({hide:t}),D()}get isbuttonpressed(){return this.$$.ctx[15]}}customElements.get("holdable-button")?console.warn("Skipping re-defining customElement holdable-button"):customElements.define("holdable-button",ft)}(); | ||
!function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(n)}function s(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e}const i="undefined"!=typeof window;let c=i?()=>window.performance.now():()=>Date.now(),l=i?t=>requestAnimationFrame(t):t;const u=new Set;function d(t){u.forEach((e=>{e.c(t)||(u.delete(e),e.f())})),0!==u.size&&l(d)}function f(t){let e;return 0===u.size&&l(d),{promise:new Promise((n=>{u.add(e={c:t,f:n})})),abort(){u.delete(e)}}}let h=!1;const m=new Set;function p(t,e){h&&m.delete(e),e.parentNode!==t&&t.appendChild(e)}function g(t,e,n){h&&m.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function $(t){h?m.add(t):t.parentNode&&t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function b(){return t=" ",document.createTextNode(t);var t}function y(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function w(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function x(t){const e={};for(const n of t)e[n.name]=n.value;return e}const k=new Set;let z,E=0;function C(t,e,n,o,r,s,a,i=0){const c=16.666/o;let l="{\n";for(let t=0;t<=1;t+=c){const o=e+(n-e)*s(t);l+=100*t+`%{${a(o,1-o)}}\n`}const u=l+`100% {${a(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${i}`,f=t.ownerDocument;k.add(f);const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=f.head.appendChild(v("style")).sheet),m=f.__svelte_rules||(f.__svelte_rules={});m[d]||(m[d]=!0,h.insertRule(`@keyframes ${d} ${u}`,h.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${d} ${o}ms linear ${r}ms 1 both`,E+=1,d}function S(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),E-=r,E||l((()=>{E||(k.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),k.clear())})))}function D(t){z=t}const A=[],L=[],N=[],O=[],P=Promise.resolve();let M=!1;function R(t){N.push(t)}let T=!1;const j=new Set;function H(){if(!T){T=!0;do{for(let t=0;t<A.length;t+=1){const e=A[t];D(e),q(e.$$)}for(D(null),A.length=0;L.length;)L.pop()();for(let t=0;t<N.length;t+=1){const e=N[t];j.has(e)||(j.add(e),e())}N.length=0}while(A.length);for(;O.length;)O.pop()();M=!1,T=!1,j.clear()}}function q(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(R)}}let B;function F(){return B||(B=Promise.resolve(),B.then((()=>{B=null}))),B}function G(t,e,n){t.dispatchEvent(function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(`${e?"intro":"outro"}${n}`))}const I=new Set;let J;function K(t,e){t&&t.i&&(I.delete(t),t.i(e))}function Q(t,e,n,o){if(t&&t.o){if(I.has(t))return;I.add(t),J.c.push((()=>{I.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const U={duration:0};function V(t,e){-1===t.$$.dirty[0]&&(A.push(t),M||(M=!0,P.then(H)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function W(e,a,i,c,l,u,d=[-1]){const f=z;D(e);const p=e.$$={fragment:null,ctx:null,props:u,update:t,not_equal:l,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(f?f.$$.context:a.context||[]),callbacks:o(),dirty:d,skip_bound:!1};let g=!1;if(p.ctx=i?i(e,a.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return p.ctx&&l(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),g&&V(e,t)),n})):[],p.update(),g=!0,r(p.before_update),p.fragment=!!c&&c(p.ctx),a.target){if(a.hydrate){h=!0;const t=function(t){return Array.from(t.childNodes)}(a.target);p.fragment&&p.fragment.l(t),t.forEach($)}else p.fragment&&p.fragment.c();a.intro&&K(e.$$.fragment),function(t,e,o,a){const{fragment:i,on_mount:c,on_destroy:l,after_update:u}=t.$$;i&&i.m(e,o),a||R((()=>{const e=c.map(n).filter(s);l?l.push(...e):r(e),t.$$.on_mount=[]})),u.forEach(R)}(e,a.target,a.anchor,a.customElement),function(){h=!1;for(const t of m)t.parentNode.removeChild(t);m.clear()}(),H()}D(f)}let X;function Y(n){let o,a,i,l,u,d,h,m,x,k;return{c(){o=v("div"),a=v("div"),a.innerHTML="<slot></slot>",i=b(),l=v("div"),u=b(),w(a,"class","CalloutDiv"),function(t,e,n){t.classList[n?"add":"remove"](e)}(a,"useShadow",tt),w(l,"class","ArrowDiv"),_(l,"--ax","50%"),_(l,"--ay","100%"),w(o,"class","CalloutContainerDiv")},m(t,e){g(t,o,e),p(o,a),p(o,i),p(o,l),p(o,u),m=!0,x||(k=[y(o,"mousedown",n[7]),y(o,"touchstart",n[7]),y(o,"dragstart",n[7])],x=!0)},p:t,i(r){m||(R((()=>{h&&h.end(1),d||(d=function(n,o,r){let a,i,l=o(n,r),u=!1,d=0;function h(){a&&S(n,a)}function m(){const{delay:o=0,duration:r=300,easing:s=e,tick:m=t,css:p}=l||U;p&&(a=C(n,0,1,r,o,s,p,d++)),m(0,1);const g=c()+o,$=g+r;i&&i.abort(),u=!0,R((()=>G(n,!0,"start"))),i=f((t=>{if(u){if(t>=$)return m(1,0),G(n,!0,"end"),h(),u=!1;if(t>=g){const e=s((t-g)/r);m(e,1-e)}}return u}))}let p=!1;return{start(){p||(S(n),s(l)?(l=l(),F().then(m)):m())},invalidate(){p=!1},end(){u&&(h(),u=!1)}}}(o,n[6],{})),d.start()})),m=!0)},o(a){d&&d.invalidate(),h=function(n,o,a){let i,l=o(n,a),u=!0;const d=J;function h(){const{delay:o=0,duration:s=300,easing:a=e,tick:h=t,css:m}=l||U;m&&(i=C(n,1,0,s,o,a,m));const p=c()+o,g=p+s;R((()=>G(n,!1,"start"))),f((t=>{if(u){if(t>=g)return h(0,1),G(n,!1,"end"),--d.r||r(d.c),!1;if(t>=p){const e=a((t-p)/s);h(1-e,e)}}return u}))}return d.r+=1,s(l)?F().then((()=>{l=l(),h()})):h(),{end(t){t&&l.tick&&l.tick(1,0),u&&(i&&S(n,i),u=!1)}}}(o,n[6],{}),m=!1},d(t){t&&$(o),t&&h&&h.end(),x=!1,r(k)}}}function Z(e){let n,o,s,a,i=e[2]&&Y(e);return{c(){n=v("main"),i&&i.c(),o=b(),s=v("link"),this.c=t,_(n,"--ax",e[3].x),_(n,"--ay",e[3].y),_(n,"--halign",e[4].x),_(n,"--valign",e[4].y),_(n,"--borderradius",et),_(n,"--arrowpad",`${e[5].value}${e[5].unit}`),_(n,"--backgroundcolor",e[1]),_(n,"--size",`${e[5].value*Math.sqrt(2)}${e[5].unit}`),_(n,"--fontsize",e[0]),_(n,"--offsetx","0rem"),_(n,"--offsety",`${e[5].value}${e[5].unit}`),w(s,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),w(s,"rel","stylesheet")},m(t,e){g(t,n,e),i&&i.m(n,null),g(t,o,e),p(document.head,s),a=!0},p(t,[e]){t[2]?i?(i.p(t,e),4&e&&K(i,1)):(i=Y(t),i.c(),K(i,1),i.m(n,null)):i&&(J={r:0,c:[],p:J},Q(i,1,1,(()=>{i=null})),J.r||r(J.c),J=J.p),(!a||2&e)&&_(n,"--backgroundcolor",t[1]),(!a||1&e)&&_(n,"--fontsize",t[0])},i(t){a||(K(i),a=!0)},o(t){Q(i),a=!1},d(t){t&&$(n),i&&i.d(),t&&$(o),$(s)}}}"function"==typeof HTMLElement&&(X=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.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)}});let tt=!1,et="0rem";function nt(t,e,n){let o,{show:r}=e,{fontsize:s="1.2rem"}=e,{backgroundcolor:a="#202020"}=e;const i=(c=(t,{duration:e=250})=>({duration:e,css:t=>`\n clip-path: circle(${100*t}% at center);\n `}),function(t,e){if(!t.hasOwnProperty("ownerDocument")){Object.defineProperty(t,"ownerDocument",{get:function(){return t.parentElement}});let e=t;for(;e.parentElement;)e=e.parentElement;t.parentElement.head=e}return c(t,e)});var c;return t.$$set=t=>{"show"in t&&n(8,r=t.show),"fontsize"in t&&n(0,s=t.fontsize),"backgroundcolor"in t&&n(1,a=t.backgroundcolor)},t.$$.update=()=>{256&t.$$.dirty&&n(2,o=void 0!==r&&"false"!==r)},[s,a,o,{x:"50%",y:"10%"},{x:"50%",y:"100%"},{value:.55,unit:"rem"},i,t=>{t.preventDefault(),t.stopPropagation(),n(2,o=!1)},r]}class ot extends X{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{margin:0;padding:0}.CalloutContainerDiv{position:absolute;left:var(--ax);top:var(--ay);transform:translate(calc(-1 * var(--halign)), calc(-1 * var(--valign)));padding:var(--arrowpad);z-index:10;pointer-events:auto}.CalloutDiv{position:relative;box-sizing:border-box;min-width:8rem;border-radius:var(--borderradius);padding:0.50rem 1rem;background-color:var(--backgroundcolor);text-align:center;user-select:none;z-index:10;color:#fff;font-family:'Saira Condensed', sans-serif;font-size:var(--fontsize);line-height:120%;text-transform:uppercase}.useShadow{box-shadow:0 0.2rem 0.5rem #00000040}.ArrowDiv{position:absolute;left:calc(var(--ax) - var(--offsetx));top:calc(var(--ay) - var(--offsety));transform:translate(-50%, -50%) rotate(45deg);width:var(--size);height:var(--size);background-color:var(--backgroundcolor);z-index:10}.ArrowShadowDiv{position:absolute;left:calc(var(--ax) - var(--offsetx));top:calc(var(--ay) - var(--offsety));transform:translate(-50%, -50%) rotate(45deg);width:var(--size);height:var(--size);background-color:var(--backgroundcolor);background-color:#00000000;box-shadow:0 0.2rem 0.5rem #00000040;z-index:9}</style>",W(this,{target:this.shadowRoot,props:x(this.attributes),customElement:!0},nt,Z,a,{show:8,fontsize:0,backgroundcolor:1}),t&&(t.target&&g(t.target,this,t.anchor),t.props&&(this.$set(t.props),H()))}static get observedAttributes(){return["show","fontsize","backgroundcolor"]}get show(){return this.$$.ctx[8]}set show(t){this.$set({show:t}),H()}get fontsize(){return this.$$.ctx[0]}set fontsize(t){this.$set({fontsize:t}),H()}get backgroundcolor(){return this.$$.ctx[1]}set backgroundcolor(t){this.$set({backgroundcolor:t}),H()}}customElements.get("call-out")?console.warn("Skipping re-defining customElement call-out"):customElements.define("call-out",ot)}(); | ||
//# sourceMappingURL=call-out.js.map |
{ | ||
"name": "@speechly/browser-ui", | ||
"version": "1.3.6", | ||
"version": "1.3.7", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "**/*" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
977723
805