@speechly/browser-ui
Advanced tools
Comparing version 1.3.11 to 1.3.12
{ | ||
"name": "@speechly/browser-ui", | ||
"version": "1.3.11", | ||
"version": "1.3.12", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "**/*" |
@@ -1,2 +0,2 @@ | ||
!function(){"use strict";function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function i(){return Object.create(null)}function r(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}function d(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const h="undefined"!=typeof window;let u=h?()=>window.performance.now():()=>Date.now(),f=h?t=>requestAnimationFrame(t):t;const g=new Set;function p(t){g.forEach((e=>{e.c(t)||(g.delete(e),e.f())})),0!==g.size&&f(p)}function m(t){let e;return 0===g.size&&f(p),{promise:new Promise((n=>{g.add(e={c:t,f:n})})),abort(){g.delete(e)}}}let $=!1;const y=new Set;function b(t,e){$&&y.delete(e),e.parentNode!==t&&t.appendChild(e)}function x(t,e,n){$&&y.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function w(t){$?y.add(t):t.parentNode&&t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function C(t){return document.createTextNode(t)}function S(){return C(" ")}function _(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function E(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function z(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:E(t,e,n)}function N(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function T(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function P(t,e,n){t.classList[n?"add":"remove"](e)}function R(t){const e={};for(const n of t)e[n.name]=n.value;return e}const M=new Set;let D,A=0;function B(t,e,n,o,i,r,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*r(t);l+=100*t+`%{${s(o,1-o)}}\n`}const d=l+`100% {${s(n,1-n)}}\n}`,h=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(d)}_${c}`,u=t.ownerDocument;M.add(u);const f=u.__svelte_stylesheet||(u.__svelte_stylesheet=u.head.appendChild(v("style")).sheet),g=u.__svelte_rules||(u.__svelte_rules={});g[h]||(g[h]=!0,f.insertRule(`@keyframes ${h} ${d}`,f.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${h} ${o}ms linear ${i}ms 1 both`,A+=1,h}function F(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),A-=i,A||f((()=>{A||(M.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),M.clear())})))}function I(t){D=t}function O(){if(!D)throw new Error("Function called outside component initialization");return D}const j=[],L=[],H=[],V=[],q=Promise.resolve();let U=!1;function W(t){H.push(t)}let J=!1;const G=new Set;function K(){if(!J){J=!0;do{for(let t=0;t<j.length;t+=1){const e=j[t];I(e),Q(e.$$)}for(I(null),j.length=0;L.length;)L.pop()();for(let t=0;t<H.length;t+=1){const e=H[t];G.has(e)||(G.add(e),e())}H.length=0}while(j.length);for(;V.length;)V.pop()();U=!1,J=!1,G.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(W)}}let X;function Y(){return X||(X=Promise.resolve(),X.then((()=>{X=null}))),X}function Z(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 tt=new Set;let et;function nt(t,e){t&&t.i&&(tt.delete(t),t.i(e))}function ot(t,e,n,o){if(t&&t.o){if(tt.has(t))return;tt.add(t),et.c.push((()=>{tt.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const it={duration:0};function rt(n,o,i){let r,c,a=o(n,i),l=!1,d=0;function h(){r&&F(n,r)}function f(){const{delay:o=0,duration:i=300,easing:s=e,tick:f=t,css:g}=a||it;g&&(r=B(n,0,1,i,o,s,g,d++)),f(0,1);const p=u()+o,$=p+i;c&&c.abort(),l=!0,W((()=>Z(n,!0,"start"))),c=m((t=>{if(l){if(t>=$)return f(1,0),Z(n,!0,"end"),h(),l=!1;if(t>=p){const e=s((t-p)/i);f(e,1-e)}}return l}))}let g=!1;return{start(){g||(F(n),s(a)?(a=a(),Y().then(f)):f())},invalidate(){g=!1},end(){l&&(h(),l=!1)}}}const st="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ct(t,e,n,i){const{fragment:c,on_mount:a,on_destroy:l,after_update:d}=t.$$;c&&c.m(e,n),i||W((()=>{const e=a.map(o).filter(s);l?l.push(...e):r(e),t.$$.on_mount=[]})),d.forEach(W)}function at(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=[])}function lt(t,e){-1===t.$$.dirty[0]&&(j.push(t),U||(U=!0,q.then(K)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function dt(e,n,o,s,c,a,l=[-1]){const d=D;I(e);const h=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:n.context||[]),callbacks:i(),dirty:l,skip_bound:!1};let u=!1;if(h.ctx=o?o(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return h.ctx&&c(h.ctx[t],h.ctx[t]=i)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](i),u&<(e,t)),n})):[],h.update(),u=!0,r(h.before_update),h.fragment=!!s&&s(h.ctx),n.target){if(n.hydrate){$=!0;const t=function(t){return Array.from(t.childNodes)}(n.target);h.fragment&&h.fragment.l(t),t.forEach(w)}else h.fragment&&h.fragment.c();n.intro&&nt(e.$$.fragment),ct(e,n.target,n.anchor,n.customElement),function(){$=!1;for(const t of y)t.parentNode.removeChild(t);y.clear()}(),K()}I(d)}let ht;"function"==typeof HTMLElement&&(ht=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).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(){at(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&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});function ut(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function ft(t){return t*t*t}function gt(t){const e=t-1;return e*e*e+1}const pt=[];function mt(t){return"[object Date]"===Object.prototype.toString.call(t)}function $t(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>$t(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(mt(t)&&mt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=$t(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function yt(o,i={}){const r=function(e,n=t){let o;const i=[];function r(t){if(c(e,t)&&(e=t,o)){const t=!pt.length;for(let t=0;t<i.length;t+=1){const n=i[t];n[1](),pt.push(n,e)}if(t){for(let t=0;t<pt.length;t+=2)pt[t][0](pt[t+1]);pt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,c=t){const a=[s,c];return i.push(a),1===i.length&&(o=n(r)||t),s(e),()=>{const t=i.indexOf(a);-1!==t&&i.splice(t,1),0===i.length&&(o(),o=null)}}}}(o);let s,a=o;function l(t,c){if(null==o)return r.set(o=t),Promise.resolve();a=t;let l=s,d=!1,{delay:h=0,duration:f=400,easing:g=e,interpolate:p=$t}=n(n({},i),c);if(0===f)return l&&(l.abort(),l=null),r.set(o=a),Promise.resolve();const $=u()+h;let y;return s=m((e=>{if(e<$)return!0;d||(y=p(o,t),"function"==typeof f&&(f=f(o,t)),d=!0),l&&(l.abort(),l=null);const n=e-$;return n>f?(r.set(o=t),!1):(r.set(o=y(g(n/f))),!0)})),s.promise}return{set:l,update:(t,e)=>l(t(a,o),e),subscribe:r.subscribe}}var bt,xt,wt,vt,kt,Ct=(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"}(bt={exports:{}},bt.exports),bt.exports);function St(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function _t(t,{delay:e=0,speed:n,duration:o,easing:i=ut}={}){const r=t.getTotalLength();return void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}!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"}(xt||(xt={})),function(t){t.Poweron="poweron",t.Mic="mic",t.Error="error",t.Denied="denied"}(wt||(wt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(vt||(vt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(kt||(kt={})),Ct.ClientState.Disconnected,wt.Poweron,vt.Click,kt.None,Ct.ClientState.Disconnecting,wt.Poweron,vt.Noninteractive,kt.Connecting,Ct.ClientState.Connecting,wt.Poweron,vt.Noninteractive,kt.Connecting,Ct.ClientState.Connected,wt.Mic,vt.Hold,kt.None,Ct.ClientState.Starting,wt.Mic,vt.Hold,kt.Connecting,Ct.ClientState.Recording,wt.Mic,vt.Hold,kt.None,Ct.ClientState.Stopping,wt.Mic,vt.Noninteractive,kt.Busy,Ct.ClientState.Failed,wt.Error,vt.Click,kt.None,Ct.ClientState.NoBrowserSupport,wt.Error,vt.Click,kt.None,Ct.ClientState.NoAudioConsent,wt.Denied,vt.Click,kt.None,xt.Idle,wt.Poweron,vt.Click,kt.None,xt.Connecting,wt.Poweron,vt.Noninteractive,kt.Connecting,xt.Ready,wt.Mic,vt.Hold,kt.None,xt.Recording,wt.Mic,vt.Hold,kt.None,xt.Loading,wt.Mic,vt.Noninteractive,kt.Busy,xt.Failed,wt.Error,vt.Click,kt.None,xt.NoBrowserSupport,wt.Error,vt.Click,kt.None,xt.NoAudioConsent,wt.Denied,vt.Click,kt.None;const Et=[0,1];function zt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),c=Math.ceil(r),a=r-s;return(1-a)*t[s]+a*t[c]}function Nt(e){let n;return{c(){n=v("canvas"),T(n,"color",e[0]),T(n,"display","block"),T(n,"width","1.35rem"),T(n,"height","1.5rem"),T(n,"margin","0"),T(n,"padding","0 0.8rem 0 0rem"),T(n,"flex-grow","0"),T(n,"flex-shrink","0"),T(n,"flex-basis","1.35rem"),E(n,"class","svelte-1fz8oog")},m(t,o){x(t,n,o),e[3](n)},p(t,[e]){1&e&&T(n,"color",t[0])},i:t,o:t,d(t){t&&w(n),e[3](null)}}}function Tt(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let r,s=0,c=0,a=[0,0];const l=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};return function(t){O().$$.on_mount.push(t)}((()=>{let t;const e=2*(a.length-1)+1,o=3*e+1*(e-1),d=()=>{if(t=requestAnimationFrame(d),!r)return;const e=r.getContext("2d");if(!e)return;let i=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),h=Number.parseInt(getComputedStyle(r).getPropertyValue("width").slice(0,-2)),u=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=h*i,r),n(1,r.height=u*i,r),Date.now()<c?a[0]=.15*s+.85*a[0]:a[0]=.0625+.75*a[0];let f=1;for(;f<a.length;)a[f]=.25*a[f-1]+.5*a[f]+.0625,f++;e.clearRect(0,0,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",f=0;f<a.length;f++){const t=a[f]*r.height;t*r.height>2*g?l(e,.5*r.width-g+f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),f>0&&(t*r.height>2*g?l(e,.5*r.width-g-f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return d(),i(1,500),()=>{cancelAnimationFrame(t)}})),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){L[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class Pt extends class{$destroy(){at(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&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){var e;super(),document.getElementById("svelte-1fz8oog-style")||((e=v("style")).id="svelte-1fz8oog-style",e.textContent="canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}",b(document.head,e)),dt(this,t,Tt,Nt,c,{color:0,updateVU:2})}get updateVU(){return this.$$.ctx[2]}}const{window:Rt}=st;function Mt(t,e,n){const o=t.slice();return o[37]=e[n],o[39]=n,o}function Dt(n){let o,i,c,a,l,d,h,f,g,p,$,y,k=n[15]&&At(),C={color:n[5]};l=new Pt({props:C}),n[29](l);let _=n[14]&&Bt(n),z=n[10],N=[];for(let t=0;t<z.length;t+=1)N[t]=Ot(Mt(n,z,t));let T=n[13]&&jt(n);return{c(){var t;o=v("div"),i=v("div"),k&&k.c(),c=S(),a=v("div"),(t=l.$$.fragment)&&t.c(),d=S(),_&&_.c(),f=S();for(let t=0;t<N.length;t+=1)N[t].c();g=S(),T&&T.c(),E(a,"class","TransscriptItemContent"),E(i,"class","TranscriptItem"),E(o,"class","BigTranscript")},m(t,e){x(t,o,e),b(o,i),k&&k.m(i,null),b(i,c),b(i,a),ct(l,a,null),b(a,d),_&&_.m(a,null),b(o,f);for(let t=0;t<N.length;t+=1)N[t].m(o,null);b(o,g),T&&T.m(o,null),y=!0},p(t,e){t[15]?k||(k=At(),k.c(),k.m(i,c)):k&&(k.d(1),k=null);const n={};if(32&e[0]&&(n.color=t[5]),l.$set(n),t[14]?_?16384&e[0]&&nt(_,1):(_=Bt(t),_.c(),nt(_,1),_.m(a,null)):_&&(_.d(1),_=null),4236288&e[0]){let n;for(z=t[10],n=0;n<z.length;n+=1){const i=Mt(t,z,n);N[n]?(N[n].p(i,e),nt(N[n],1)):(N[n]=Ot(i),N[n].c(),nt(N[n],1),N[n].m(o,g))}for(;n<N.length;n+=1)N[n].d(1);N.length=z.length}t[13]?T?(T.p(t,e),8192&e[0]&&nt(T,1)):(T=jt(t),T.c(),nt(T,1),T.m(o,null)):T&&(T.d(1),T=null)},i(t){if(!y){nt(l.$$.fragment,t),nt(_),h||W((()=>{h=rt(i,n[20],{duration:200}),h.start()}));for(let t=0;t<z.length;t+=1)nt(N[t]);nt(T),W((()=>{$&&$.end(1),p||(p=rt(o,n[19],{})),p.start()})),y=!0}},o(i){ot(l.$$.fragment,i),p&&p.invalidate(),$=function(n,o,i){let c,a=o(n,i),l=!0;const d=et;function h(){const{delay:o=0,duration:i=300,easing:s=e,tick:h=t,css:f}=a||it;f&&(c=B(n,1,0,i,o,s,f));const g=u()+o,p=g+i;W((()=>Z(n,!1,"start"))),m((t=>{if(l){if(t>=p)return h(0,1),Z(n,!1,"end"),--d.r||r(d.c),!1;if(t>=g){const e=s((t-g)/i);h(1-e,e)}}return l}))}return d.r+=1,s(a)?Y().then((()=>{a=a(),h()})):h(),{end(t){t&&a.tick&&a.tick(1,0),l&&(c&&F(n,c),l=!1)}}}(o,n[19],{}),y=!1},d(t){t&&w(o),k&&k.d(),n[29](null),at(l),_&&_.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(N,t),T&&T.d(),t&&$&&$.end()}}}function At(t){let e;return{c(){e=v("div"),E(e,"class","TransscriptItemBgDiv")},m(t,n){x(t,e,n)},d(t){t&&w(e)}}}function Bt(e){let n,o;return{c(){n=v("div"),n.textContent="Listening...",E(n,"class","listening")},m(t,e){x(t,n,e)},i(t){o||W((()=>{o=rt(n,e[20],{duration:400}),o.start()}))},o:t,d(t){t&&w(n)}}}function Ft(e){let n,o;return{c(){n=v("div"),E(n,"class","TransscriptItemBgDiv")},m(t,e){x(t,n,e)},i(t){o||W((()=>{o=rt(n,e[20],{}),o.start()}))},o:t,d(t){t&&w(n)}}}function It(t){let e,n;return{c(){e=v("span"),E(e,"style",n=t[39]<t[10].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){x(t,e,n)},p(t,o){9216&o[0]&&n!==(n=t[39]<t[10].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&E(e,"style",n)},d(t){t&&w(e)}}}function Ot(e){let n,o,i,r,s,c,a,l=e[37].word+"",d=e[15]&&Ft(e),h=e[39]<e[10].length&&It(e);return{c(){n=v("div"),d&&d.c(),o=S(),i=v("div"),r=C(l),s=S(),h&&h.c(),E(i,"class","TransscriptItemContent"),E(n,"class",a="TranscriptItem "+e[22](e[37])),P(n,"Entity",null!==e[37].entityType),P(n,"Final",e[37].isFinal)},m(t,e){x(t,n,e),d&&d.m(n,null),b(n,o),b(n,i),b(i,r),b(i,s),h&&h.m(i,null)},p(t,e){t[15]?d?32768&e[0]&&nt(d,1):(d=Ft(t),d.c(),nt(d,1),d.m(n,o)):d&&(d.d(1),d=null),1024&e[0]&&l!==(l=t[37].word+"")&&N(r,l),t[39]<t[10].length?h?h.p(t,e):(h=It(t),h.c(),h.m(i,null)):h&&(h.d(1),h=null),1024&e[0]&&a!==(a="TranscriptItem "+t[22](t[37]))&&E(n,"class",a),1024&e[0]&&P(n,"Entity",null!==t[37].entityType),1024&e[0]&&P(n,"Final",t[37].isFinal)},i(t){nt(d),c||W((()=>{c=rt(i,e[20],{}),c.start()}))},o:t,d(t){t&&w(n),d&&d.d(),h&&h.d()}}}function jt(e){let n,o,i,r,s,c,a,l;return{c(){n=v("div"),o=v("div"),i=S(),r=v("div"),s=k("svg"),c=k("path"),E(o,"class","TransscriptItemBgDiv"),T(o,"background-color",e[5]),E(c,"stroke","currentColor"),E(c,"stroke-width","3"),E(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),E(c,"fill","none"),E(c,"fill-rule","evenodd"),T(s,"width","2rem"),T(s,"height","2rem"),T(s,"position","absolute"),T(s,"transform","translate(-0.6rem, -0.5rem)"),T(s,"stroke","#eee"),E(s,"viewBox","0 0 24 24"),E(s,"xmlns","http://www.w3.org/2000/svg"),T(r,"width","1.0rem"),T(r,"height","1rem"),T(r,"position","relative"),E(n,"class","TranscriptItem")},m(t,e){x(t,n,e),b(n,o),b(n,i),b(n,r),b(r,s),b(s,c)},p(t,e){32&e[0]&&T(o,"background-color",t[5])},i(t){a||W((()=>{a=rt(c,e[18],{duration:500}),a.start()})),l||W((()=>{l=rt(n,e[20],{duration:200,maxWidth:3}),l.start()}))},o:t,d(t){t&&w(n)}}}function Lt(e){let n,o,i,s,c,a,l=e[11]&&Dt(e);return{c(){n=v("main"),l&&l.c(),o=S(),i=v("link"),this.c=t,T(n,"--voffset",e[1]),T(n,"--hoffset",e[2]),T(n,"--fontsize",e[3]),T(n,"--color",e[4]),T(n,"--highlight-color",e[5]),T(n,"--text-bg-color",e[6]),T(n,"--gradient-stop1",e[7]),T(n,"--gradient-stop2",e[8]),T(n,"--marginbottom",e[9]),T(n,"--transition",e[16].transition),P(n,"placementTop","top"===e[0]),E(i,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),E(i,"rel","stylesheet")},m(t,r){x(t,n,r),l&&l.m(n,null),x(t,o,r),b(document.head,i),s=!0,c||(a=_(Rt,"message",e[21]),c=!0)},p(t,e){t[11]?l?(l.p(t,e),2048&e[0]&&nt(l,1)):(l=Dt(t),l.c(),nt(l,1),l.m(n,null)):l&&(et={r:0,c:[],p:et},ot(l,1,1,(()=>{l=null})),et.r||r(et.c),et=et.p),(!s||2&e[0])&&T(n,"--voffset",t[1]),(!s||4&e[0])&&T(n,"--hoffset",t[2]),(!s||8&e[0])&&T(n,"--fontsize",t[3]),(!s||16&e[0])&&T(n,"--color",t[4]),(!s||32&e[0])&&T(n,"--highlight-color",t[5]),(!s||64&e[0])&&T(n,"--text-bg-color",t[6]),(!s||128&e[0])&&T(n,"--gradient-stop1",t[7]),(!s||256&e[0])&&T(n,"--gradient-stop2",t[8]),(!s||512&e[0])&&T(n,"--marginbottom",t[9]),(!s||65536&e[0])&&T(n,"--transition",t[16].transition),1&e[0]&&P(n,"placementTop","top"===t[0])},i(t){s||(nt(l),s=!0)},o(t){ot(l),s=!1},d(t){t&&w(n),l&&l.d(),t&&w(o),w(i),c=!1,a()}}}function Ht(t,e,n){let o,i,r,s,c,{placement:a}=e,{voffset:l="3rem"}=e,{hoffset:h="2rem"}=e,{fontsize:u="1.5rem"}=e,{color:f="#ffffff"}=e,{highlightcolor:g="#15e8b5"}=e,{backgroundcolor:p="#202020"}=e,{gradientstop1:m="#ffffff88"}=e,{gradientstop2:$="#ffffffcc"}=e,{marginbottom:y="0rem"}=e,{formattext:b}=e,x=[],w=null,v=null,k=Ct.ClientState.Disconnected,C=!1,S=!1,_=!1,E=yt({transition:0},{duration:200});d(t,E,(t=>n(16,s=t)));const z=O(),N=St(_t),T=St(((t,{delay:e=0,duration:n=400})=>({delay:e,duration:n,easing:ut,css:t=>`\n opacity: ${zt(Et,t,0,1)};\n max-height: ${10*zt(Et,t,0,.6)}rem;\n `}))),P=St(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${zt(Et,t,0,1)*o}rem;\n `}))),R=t=>{n(13,_=_||t)},M=t=>{n(27,k=t),k===Ct.ClientState.Recording&&(n(13,_=!1),n(10,x=[]),v=null)},D=t=>{if(void 0===t)return;c&&k===Ct.ClientState.Recording&&c.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?A(x.length>0?2e3:0):x.length>0&&(C||n(28,C=!0),A(2e3));const e=`${t.contextId}/${t.id}`;null!==v?v!==e&&(n(13,_=!1),v=e):v=e,n(10,x=[]),t.words.forEach((t=>{n(10,x[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},x)})),r?t.entities.forEach((t=>{n(10,x[t.startPosition].word=t.value,x),n(10,x[t.startPosition].entityType=t.type,x),n(10,x[t.startPosition].isFinal=t.isFinal,x),n(10,x[t.startPosition].hide=!1,x);for(let e=t.startPosition+1;e<t.endPosition;e++)x[e]&&n(10,x[e].hide=!0,x)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)x[e]&&(n(10,x[e].entityType=t.type,x),n(10,x[e].isFinal=t.isFinal,x))})),n(10,x=x.filter((t=>!t.hide)))},A=(t=0)=>{B(),w=window.setTimeout((()=>{w=null,C&&n(28,C=!1)}),t)},B=()=>{null!==w&&(window.clearTimeout(w),w=null)};return t.$$set=t=>{"placement"in t&&n(0,a=t.placement),"voffset"in t&&n(1,l=t.voffset),"hoffset"in t&&n(2,h=t.hoffset),"fontsize"in t&&n(3,u=t.fontsize),"color"in t&&n(4,f=t.color),"highlightcolor"in t&&n(5,g=t.highlightcolor),"backgroundcolor"in t&&n(6,p=t.backgroundcolor),"gradientstop1"in t&&n(7,m=t.gradientstop1),"gradientstop2"in t&&n(8,$=t.gradientstop2),"marginbottom"in t&&n(9,y=t.marginbottom),"formattext"in t&&n(23,b=t.formattext)},t.$$.update=()=>{if(1024&t.$$.dirty[0]&&n(14,o=0===x.length),64&t.$$.dirty[0]&&n(15,i="none"!==p),8388608&t.$$.dirty[0]&&(r=void 0===b||"false"!==b),402655232&t.$$.dirty[0]){const t=k===Ct.ClientState.Recording||C;t!==S&&(e="visibilitychanged",s=t,z.dispatchEvent(new CustomEvent(e,{detail:s,composed:!0}))),n(11,S=t),E.set({transition:S?1:0})}var e,s},[a,l,h,u,f,g,p,m,$,y,x,S,c,_,o,i,s,E,N,T,P,t=>{switch(t.data.type){case"speechsegment":D(t.data.segment);break;case"speechhandled":R(t.data.success);break;case"speechstate":M(t.data.state)}},t=>t.entityType||"",b,R,M,D,k,C,function(t){L[t?"unshift":"push"]((()=>{c=t,n(12,c)}))}]}class Vt extends ht{constructor(t){super(),this.shadowRoot.innerHTML="<style>.BigTranscript{position:relative;user-select:none;font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition))}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",dt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},Ht,Lt,a,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:23,speechhandled:24,speechstate:25,speechsegment:26},[-1,-1]),t&&(t.target&&x(t.target,this,t.anchor),t.props&&(this.$set(t.props),K()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$set({placement:t}),K()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$set({voffset:t}),K()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$set({hoffset:t}),K()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$set({fontsize:t}),K()}get color(){return this.$$.ctx[4]}set color(t){this.$set({color:t}),K()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$set({highlightcolor:t}),K()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$set({backgroundcolor:t}),K()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$set({gradientstop1:t}),K()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$set({gradientstop2:t}),K()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$set({marginbottom:t}),K()}get formattext(){return this.$$.ctx[23]}set formattext(t){this.$set({formattext:t}),K()}get speechhandled(){return this.$$.ctx[24]}get speechstate(){return this.$$.ctx[25]}get speechsegment(){return this.$$.ctx[26]}}function qt(e){let n,o,i,s,c,a,l,d,h;return{c(){n=v("main"),o=v("div"),i=v("div"),s=v("big-transcript"),c=S(),a=v("div"),l=C(e[10]),this.c=t,z(s,"formattext",e[9]),z(s,"fontsize",e[1]),z(s,"color",e[3]),z(s,"backgroundcolor","none"),z(s,"highlightcolor",e[5]),z(s,"gradientstop1",e[7]),z(s,"gradientstop2",e[8]),E(a,"class","hint"),T(a,"opacity",e[14].opacity),E(i,"class","pad"),E(o,"class","drawer"),T(o,"background-color",e[6]),T(o,"opacity",e[12].opacity),T(o,"transform","translate(0px, "+e[13].y+"rem)"),E(n,"class","placementTop"),T(n,"--height",e[0]),T(n,"--smalltextcolor",e[4]),T(n,"--hintfontsize",e[2])},m(t,r){x(t,n,r),b(n,o),b(o,i),b(i,s),e[25](s),b(i,c),b(i,a),b(a,l),d||(h=[_(window,"message",e[19]),_(s,"visibilitychanged",e[18])],d=!0)},p(t,[e]){512&e&&z(s,"formattext",t[9]),2&e&&z(s,"fontsize",t[1]),8&e&&z(s,"color",t[3]),32&e&&z(s,"highlightcolor",t[5]),128&e&&z(s,"gradientstop1",t[7]),256&e&&z(s,"gradientstop2",t[8]),1024&e&&N(l,t[10]),16384&e&&T(a,"opacity",t[14].opacity),64&e&&T(o,"background-color",t[6]),4096&e&&T(o,"opacity",t[12].opacity),8192&e&&T(o,"transform","translate(0px, "+t[13].y+"rem)"),1&e&&T(n,"--height",t[0]),16&e&&T(n,"--smalltextcolor",t[4]),4&e&&T(n,"--hintfontsize",t[2])},i:t,o:t,d(t){t&&w(n),e[25](null),d=!1,r(h)}}}function Ut(t,n,o){let i,r,s,c,{height:a="8rem"}=n,{hint:l=""}=n,{fontsize:h="1.5rem"}=n,{hintfontsize:u="0.9rem"}=n,{color:f="#ffffff"}=n,{smalltextcolor:g="#ffffff70"}=n,{highlightcolor:p="#15e8b5"}=n,{backgroundcolor:m="#202020"}=n,{gradientstop1:$="#ffffff88"}=n,{gradientstop2:y="#ffffffcc"}=n,{formattext:b}=n,x=[],w=0,v="";const k=(t,e=!0)=>{E.set({opacity:0}),c&&e&&c.speechsegment(t),t.isFinal&&(w++,w<x.length?o(10,v=x[w]):o(10,v=x[Math.floor(Math.random()*x.length)]))},C=t=>{w=0,o(20,l=t),x=[];try{x=JSON.parse(l)}catch(t){x[0]=l||""}o(10,v=x[w])};let S=yt({y:-1},{duration:200});d(t,S,(t=>o(13,r=t)));let _=yt({opacity:0},{duration:200,easing:e});d(t,_,(t=>o(12,i=t)));let E=yt({opacity:0},{duration:200,delay:200,easing:e});d(t,E,(t=>o(14,s=t)));return t.$$set=t=>{"height"in t&&o(0,a=t.height),"hint"in t&&o(20,l=t.hint),"fontsize"in t&&o(1,h=t.fontsize),"hintfontsize"in t&&o(2,u=t.hintfontsize),"color"in t&&o(3,f=t.color),"smalltextcolor"in t&&o(4,g=t.smalltextcolor),"highlightcolor"in t&&o(5,p=t.highlightcolor),"backgroundcolor"in t&&o(6,m=t.backgroundcolor),"gradientstop1"in t&&o(7,$=t.gradientstop1),"gradientstop2"in t&&o(8,y=t.gradientstop2),"formattext"in t&&o(9,b=t.formattext)},t.$$.update=()=>{1048576&t.$$.dirty&&C(l)},[a,h,u,f,g,p,m,$,y,b,v,c,i,r,s,S,_,E,t=>{!1===t.detail?(S.set({y:-1},{easing:ft}),_.set({opacity:0}),E.set({opacity:0})):(S.set({y:0},{easing:gt}),_.set({opacity:1}),E.set({opacity:1}))},t=>{switch(t.data.type){case"speechsegment":k(t.data.segment,!1);break;case"hint":C(t.data.hint)}},l,t=>{c&&c.speechhandled(t)},t=>{c&&c.speechstate(t)},k,C,function(t){L[t?"unshift":"push"]((()=>{c=t,o(11,c)}))}]}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",Vt);class Wt extends ht{constructor(t){super(),this.shadowRoot.innerHTML="<style>.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:60;pointer-events:none}.drawer{width:100%;min-height:var(--height);display:flex;flex-direction:column;justify-content:flex-end;box-shadow:0 0 0.35rem #0004}.pad{position:relative;padding:2rem 2rem 0.65rem 1.5rem}.hint{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--smalltextcolor);font-size:var(--hintfontsize);line-height:135%;margin-top:0.15rem}</style>",dt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},Ut,qt,a,{height:0,hint:20,fontsize:1,hintfontsize:2,color:3,smalltextcolor:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,formattext:9,speechhandled:21,speechstate:22,speechsegment:23,sethint:24}),t&&(t.target&&x(t.target,this,t.anchor),t.props&&(this.$set(t.props),K()))}static get observedAttributes(){return["height","hint","fontsize","hintfontsize","color","smalltextcolor","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","formattext","speechhandled","speechstate","speechsegment","sethint"]}get height(){return this.$$.ctx[0]}set height(t){this.$set({height:t}),K()}get hint(){return this.$$.ctx[20]}set hint(t){this.$set({hint:t}),K()}get fontsize(){return this.$$.ctx[1]}set fontsize(t){this.$set({fontsize:t}),K()}get hintfontsize(){return this.$$.ctx[2]}set hintfontsize(t){this.$set({hintfontsize:t}),K()}get color(){return this.$$.ctx[3]}set color(t){this.$set({color:t}),K()}get smalltextcolor(){return this.$$.ctx[4]}set smalltextcolor(t){this.$set({smalltextcolor:t}),K()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$set({highlightcolor:t}),K()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$set({backgroundcolor:t}),K()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$set({gradientstop1:t}),K()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$set({gradientstop2:t}),K()}get formattext(){return this.$$.ctx[9]}set formattext(t){this.$set({formattext:t}),K()}get speechhandled(){return this.$$.ctx[21]}get speechstate(){return this.$$.ctx[22]}get speechsegment(){return this.$$.ctx[23]}get sethint(){return this.$$.ctx[24]}}customElements.get("transcript-drawer")?console.warn("Skipping re-defining customElement transcript-drawer"):customElements.define("transcript-drawer",Wt)}(); | ||
!function(){"use strict";function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function i(){return Object.create(null)}function r(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}function d(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const h="undefined"!=typeof window;let u=h?()=>window.performance.now():()=>Date.now(),f=h?t=>requestAnimationFrame(t):t;const g=new Set;function p(t){g.forEach((e=>{e.c(t)||(g.delete(e),e.f())})),0!==g.size&&f(p)}function m(t){let e;return 0===g.size&&f(p),{promise:new Promise((n=>{g.add(e={c:t,f:n})})),abort(){g.delete(e)}}}let $=!1;const y=new Set;function b(t,e){$&&y.delete(e),e.parentNode!==t&&t.appendChild(e)}function x(t,e,n){$&&y.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function w(t){$?y.add(t):t.parentNode&&t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function C(t){return document.createTextNode(t)}function S(){return C(" ")}function _(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function E(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function z(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:E(t,e,n)}function N(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function T(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function P(t,e,n){t.classList[n?"add":"remove"](e)}function R(t){const e={};for(const n of t)e[n.name]=n.value;return e}const M=new Set;let D,A=0;function B(t,e,n,o,i,r,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*r(t);l+=100*t+`%{${s(o,1-o)}}\n`}const d=l+`100% {${s(n,1-n)}}\n}`,h=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(d)}_${c}`,u=t.ownerDocument;M.add(u);const f=u.__svelte_stylesheet||(u.__svelte_stylesheet=u.head.appendChild(v("style")).sheet),g=u.__svelte_rules||(u.__svelte_rules={});g[h]||(g[h]=!0,f.insertRule(`@keyframes ${h} ${d}`,f.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${h} ${o}ms linear ${i}ms 1 both`,A+=1,h}function F(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),A-=i,A||f((()=>{A||(M.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),M.clear())})))}function I(t){D=t}function O(){if(!D)throw new Error("Function called outside component initialization");return D}const j=[],L=[],H=[],V=[],q=Promise.resolve();let U=!1;function W(t){H.push(t)}let J=!1;const G=new Set;function K(){if(!J){J=!0;do{for(let t=0;t<j.length;t+=1){const e=j[t];I(e),Q(e.$$)}for(I(null),j.length=0;L.length;)L.pop()();for(let t=0;t<H.length;t+=1){const e=H[t];G.has(e)||(G.add(e),e())}H.length=0}while(j.length);for(;V.length;)V.pop()();U=!1,J=!1,G.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(W)}}let X;function Y(){return X||(X=Promise.resolve(),X.then((()=>{X=null}))),X}function Z(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 tt=new Set;let et;function nt(t,e){t&&t.i&&(tt.delete(t),t.i(e))}function ot(t,e,n,o){if(t&&t.o){if(tt.has(t))return;tt.add(t),et.c.push((()=>{tt.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const it={duration:0};function rt(n,o,i){let r,c,a=o(n,i),l=!1,d=0;function h(){r&&F(n,r)}function f(){const{delay:o=0,duration:i=300,easing:s=e,tick:f=t,css:g}=a||it;g&&(r=B(n,0,1,i,o,s,g,d++)),f(0,1);const p=u()+o,$=p+i;c&&c.abort(),l=!0,W((()=>Z(n,!0,"start"))),c=m((t=>{if(l){if(t>=$)return f(1,0),Z(n,!0,"end"),h(),l=!1;if(t>=p){const e=s((t-p)/i);f(e,1-e)}}return l}))}let g=!1;return{start(){g||(F(n),s(a)?(a=a(),Y().then(f)):f())},invalidate(){g=!1},end(){l&&(h(),l=!1)}}}const st="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ct(t,e,n,i){const{fragment:c,on_mount:a,on_destroy:l,after_update:d}=t.$$;c&&c.m(e,n),i||W((()=>{const e=a.map(o).filter(s);l?l.push(...e):r(e),t.$$.on_mount=[]})),d.forEach(W)}function at(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=[])}function lt(t,e){-1===t.$$.dirty[0]&&(j.push(t),U||(U=!0,q.then(K)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function dt(e,n,o,s,c,a,l=[-1]){const d=D;I(e);const h=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:n.context||[]),callbacks:i(),dirty:l,skip_bound:!1};let u=!1;if(h.ctx=o?o(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return h.ctx&&c(h.ctx[t],h.ctx[t]=i)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](i),u&<(e,t)),n})):[],h.update(),u=!0,r(h.before_update),h.fragment=!!s&&s(h.ctx),n.target){if(n.hydrate){$=!0;const t=function(t){return Array.from(t.childNodes)}(n.target);h.fragment&&h.fragment.l(t),t.forEach(w)}else h.fragment&&h.fragment.c();n.intro&&nt(e.$$.fragment),ct(e,n.target,n.anchor,n.customElement),function(){$=!1;for(const t of y)t.parentNode.removeChild(t);y.clear()}(),K()}I(d)}let ht;"function"==typeof HTMLElement&&(ht=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).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(){at(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&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});function ut(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function ft(t){return t*t*t}function gt(t){const e=t-1;return e*e*e+1}const pt=[];function mt(t){return"[object Date]"===Object.prototype.toString.call(t)}function $t(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>$t(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(mt(t)&&mt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=$t(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function yt(o,i={}){const r=function(e,n=t){let o;const i=[];function r(t){if(c(e,t)&&(e=t,o)){const t=!pt.length;for(let t=0;t<i.length;t+=1){const n=i[t];n[1](),pt.push(n,e)}if(t){for(let t=0;t<pt.length;t+=2)pt[t][0](pt[t+1]);pt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,c=t){const a=[s,c];return i.push(a),1===i.length&&(o=n(r)||t),s(e),()=>{const t=i.indexOf(a);-1!==t&&i.splice(t,1),0===i.length&&(o(),o=null)}}}}(o);let s,a=o;function l(t,c){if(null==o)return r.set(o=t),Promise.resolve();a=t;let l=s,d=!1,{delay:h=0,duration:f=400,easing:g=e,interpolate:p=$t}=n(n({},i),c);if(0===f)return l&&(l.abort(),l=null),r.set(o=a),Promise.resolve();const $=u()+h;let y;return s=m((e=>{if(e<$)return!0;d||(y=p(o,t),"function"==typeof f&&(f=f(o,t)),d=!0),l&&(l.abort(),l=null);const n=e-$;return n>f?(r.set(o=t),!1):(r.set(o=y(g(n/f))),!0)})),s.promise}return{set:l,update:(t,e)=>l(t(a,o),e),subscribe:r.subscribe}}var bt,xt,wt,vt,kt,Ct=(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"}(bt={exports:{}},bt.exports),bt.exports);function St(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function _t(t,{delay:e=0,speed:n,duration:o,easing:i=ut}={}){const r=t.getTotalLength();return void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}!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"}(xt||(xt={})),function(t){t.Poweron="poweron",t.Mic="mic",t.Error="error",t.Denied="denied"}(wt||(wt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(vt||(vt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(kt||(kt={})),Ct.ClientState.Disconnected,wt.Poweron,vt.Click,kt.None,Ct.ClientState.Disconnecting,wt.Poweron,vt.Noninteractive,kt.Connecting,Ct.ClientState.Connecting,wt.Poweron,vt.Noninteractive,kt.Connecting,Ct.ClientState.Connected,wt.Mic,vt.Hold,kt.None,Ct.ClientState.Starting,wt.Mic,vt.Hold,kt.Connecting,Ct.ClientState.Recording,wt.Mic,vt.Hold,kt.None,Ct.ClientState.Stopping,wt.Mic,vt.Noninteractive,kt.Busy,Ct.ClientState.Failed,wt.Error,vt.Click,kt.None,Ct.ClientState.NoBrowserSupport,wt.Error,vt.Click,kt.None,Ct.ClientState.NoAudioConsent,wt.Denied,vt.Click,kt.None,xt.Idle,wt.Poweron,vt.Click,kt.None,xt.Connecting,wt.Poweron,vt.Noninteractive,kt.Connecting,xt.Ready,wt.Mic,vt.Hold,kt.None,xt.Recording,wt.Mic,vt.Hold,kt.None,xt.Loading,wt.Mic,vt.Noninteractive,kt.Busy,xt.Failed,wt.Error,vt.Click,kt.None,xt.NoBrowserSupport,wt.Error,vt.Click,kt.None,xt.NoAudioConsent,wt.Denied,vt.Click,kt.None;const Et=[0,1];function zt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),c=Math.ceil(r),a=r-s;return(1-a)*t[s]+a*t[c]}function Nt(e){let n;return{c(){n=v("canvas"),T(n,"color",e[0]),T(n,"display","block"),T(n,"width","1.35rem"),T(n,"height","1.5rem"),T(n,"margin","0"),T(n,"padding","0 0.8rem 0 0rem"),T(n,"flex-grow","0"),T(n,"flex-shrink","0"),T(n,"flex-basis","1.35rem"),E(n,"class","svelte-1fz8oog")},m(t,o){x(t,n,o),e[3](n)},p(t,[e]){1&e&&T(n,"color",t[0])},i:t,o:t,d(t){t&&w(n),e[3](null)}}}function Tt(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let r,s=0,c=0,a=[0,0];const l=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};return function(t){O().$$.on_mount.push(t)}((()=>{let t;const e=2*(a.length-1)+1,o=3*e+1*(e-1),d=()=>{if(t=requestAnimationFrame(d),!r)return;const e=r.getContext("2d");if(!e)return;let i=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),h=Number.parseInt(getComputedStyle(r).getPropertyValue("width").slice(0,-2)),u=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=h*i,r),n(1,r.height=u*i,r),Date.now()<c?a[0]=.15*s+.85*a[0]:a[0]=.0625+.75*a[0];let f=1;for(;f<a.length;)a[f]=.25*a[f-1]+.5*a[f]+.0625,f++;e.clearRect(0,0,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",f=0;f<a.length;f++){const t=a[f]*r.height;t*r.height>2*g?l(e,.5*r.width-g+f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),f>0&&(t*r.height>2*g?l(e,.5*r.width-g-f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return d(),i(1,500),()=>{cancelAnimationFrame(t)}})),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){L[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class Pt extends class{$destroy(){at(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&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){var e;super(),document.getElementById("svelte-1fz8oog-style")||((e=v("style")).id="svelte-1fz8oog-style",e.textContent="canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}",b(document.head,e)),dt(this,t,Tt,Nt,c,{color:0,updateVU:2})}get updateVU(){return this.$$.ctx[2]}}const{window:Rt}=st;function Mt(t,e,n){const o=t.slice();return o[37]=e[n],o[39]=n,o}function Dt(n){let o,i,c,a,l,d,h,f,g,p,$,y,k=n[15]&&At(),C={color:n[5]};l=new Pt({props:C}),n[29](l);let _=n[14]&&Bt(n),z=n[10],N=[];for(let t=0;t<z.length;t+=1)N[t]=Ot(Mt(n,z,t));let T=n[13]&&jt(n);return{c(){var t;o=v("div"),i=v("div"),k&&k.c(),c=S(),a=v("div"),(t=l.$$.fragment)&&t.c(),d=S(),_&&_.c(),f=S();for(let t=0;t<N.length;t+=1)N[t].c();g=S(),T&&T.c(),E(a,"class","TransscriptItemContent"),E(i,"class","TranscriptItem"),E(o,"class","BigTranscript")},m(t,e){x(t,o,e),b(o,i),k&&k.m(i,null),b(i,c),b(i,a),ct(l,a,null),b(a,d),_&&_.m(a,null),b(o,f);for(let t=0;t<N.length;t+=1)N[t].m(o,null);b(o,g),T&&T.m(o,null),y=!0},p(t,e){t[15]?k||(k=At(),k.c(),k.m(i,c)):k&&(k.d(1),k=null);const n={};if(32&e[0]&&(n.color=t[5]),l.$set(n),t[14]?_?16384&e[0]&&nt(_,1):(_=Bt(t),_.c(),nt(_,1),_.m(a,null)):_&&(_.d(1),_=null),4236288&e[0]){let n;for(z=t[10],n=0;n<z.length;n+=1){const i=Mt(t,z,n);N[n]?(N[n].p(i,e),nt(N[n],1)):(N[n]=Ot(i),N[n].c(),nt(N[n],1),N[n].m(o,g))}for(;n<N.length;n+=1)N[n].d(1);N.length=z.length}t[13]?T?(T.p(t,e),8192&e[0]&&nt(T,1)):(T=jt(t),T.c(),nt(T,1),T.m(o,null)):T&&(T.d(1),T=null)},i(t){if(!y){nt(l.$$.fragment,t),nt(_),h||W((()=>{h=rt(i,n[20],{duration:200}),h.start()}));for(let t=0;t<z.length;t+=1)nt(N[t]);nt(T),W((()=>{$&&$.end(1),p||(p=rt(o,n[19],{})),p.start()})),y=!0}},o(i){ot(l.$$.fragment,i),p&&p.invalidate(),$=function(n,o,i){let c,a=o(n,i),l=!0;const d=et;function h(){const{delay:o=0,duration:i=300,easing:s=e,tick:h=t,css:f}=a||it;f&&(c=B(n,1,0,i,o,s,f));const g=u()+o,p=g+i;W((()=>Z(n,!1,"start"))),m((t=>{if(l){if(t>=p)return h(0,1),Z(n,!1,"end"),--d.r||r(d.c),!1;if(t>=g){const e=s((t-g)/i);h(1-e,e)}}return l}))}return d.r+=1,s(a)?Y().then((()=>{a=a(),h()})):h(),{end(t){t&&a.tick&&a.tick(1,0),l&&(c&&F(n,c),l=!1)}}}(o,n[19],{}),y=!1},d(t){t&&w(o),k&&k.d(),n[29](null),at(l),_&&_.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(N,t),T&&T.d(),t&&$&&$.end()}}}function At(t){let e;return{c(){e=v("div"),E(e,"class","TransscriptItemBgDiv")},m(t,n){x(t,e,n)},d(t){t&&w(e)}}}function Bt(e){let n,o;return{c(){n=v("div"),n.textContent="Listening...",E(n,"class","listening")},m(t,e){x(t,n,e)},i(t){o||W((()=>{o=rt(n,e[20],{duration:400}),o.start()}))},o:t,d(t){t&&w(n)}}}function Ft(e){let n,o;return{c(){n=v("div"),E(n,"class","TransscriptItemBgDiv")},m(t,e){x(t,n,e)},i(t){o||W((()=>{o=rt(n,e[20],{}),o.start()}))},o:t,d(t){t&&w(n)}}}function It(t){let e,n;return{c(){e=v("span"),E(e,"style",n=t[39]<t[10].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){x(t,e,n)},p(t,o){9216&o[0]&&n!==(n=t[39]<t[10].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&E(e,"style",n)},d(t){t&&w(e)}}}function Ot(e){let n,o,i,r,s,c,a,l=e[37].word+"",d=e[15]&&Ft(e),h=e[39]<e[10].length&&It(e);return{c(){n=v("div"),d&&d.c(),o=S(),i=v("div"),r=C(l),s=S(),h&&h.c(),E(i,"class","TransscriptItemContent"),E(n,"class",a="TranscriptItem "+e[22](e[37])),P(n,"Entity",null!==e[37].entityType),P(n,"Final",e[37].isFinal)},m(t,e){x(t,n,e),d&&d.m(n,null),b(n,o),b(n,i),b(i,r),b(i,s),h&&h.m(i,null)},p(t,e){t[15]?d?32768&e[0]&&nt(d,1):(d=Ft(t),d.c(),nt(d,1),d.m(n,o)):d&&(d.d(1),d=null),1024&e[0]&&l!==(l=t[37].word+"")&&N(r,l),t[39]<t[10].length?h?h.p(t,e):(h=It(t),h.c(),h.m(i,null)):h&&(h.d(1),h=null),1024&e[0]&&a!==(a="TranscriptItem "+t[22](t[37]))&&E(n,"class",a),1024&e[0]&&P(n,"Entity",null!==t[37].entityType),1024&e[0]&&P(n,"Final",t[37].isFinal)},i(t){nt(d),c||W((()=>{c=rt(i,e[20],{}),c.start()}))},o:t,d(t){t&&w(n),d&&d.d(),h&&h.d()}}}function jt(e){let n,o,i,r,s,c,a,l;return{c(){n=v("div"),o=v("div"),i=S(),r=v("div"),s=k("svg"),c=k("path"),E(o,"class","TransscriptItemBgDiv"),T(o,"background-color",e[5]),E(c,"stroke","currentColor"),E(c,"stroke-width","3"),E(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),E(c,"fill","none"),E(c,"fill-rule","evenodd"),T(s,"width","2rem"),T(s,"height","2rem"),T(s,"position","absolute"),T(s,"transform","translate(-0.6rem, -0.5rem)"),T(s,"stroke","#eee"),E(s,"viewBox","0 0 24 24"),E(s,"xmlns","http://www.w3.org/2000/svg"),T(r,"width","1.0rem"),T(r,"height","1rem"),T(r,"position","relative"),E(n,"class","TranscriptItem")},m(t,e){x(t,n,e),b(n,o),b(n,i),b(n,r),b(r,s),b(s,c)},p(t,e){32&e[0]&&T(o,"background-color",t[5])},i(t){a||W((()=>{a=rt(c,e[18],{duration:500}),a.start()})),l||W((()=>{l=rt(n,e[20],{duration:200,maxWidth:3}),l.start()}))},o:t,d(t){t&&w(n)}}}function Lt(e){let n,o,i,s,c,a,l=e[11]&&Dt(e);return{c(){n=v("main"),l&&l.c(),o=S(),i=v("link"),this.c=t,T(n,"--voffset",e[1]),T(n,"--hoffset",e[2]),T(n,"--fontsize",e[3]),T(n,"--color",e[4]),T(n,"--highlight-color",e[5]),T(n,"--text-bg-color",e[6]),T(n,"--gradient-stop1",e[7]),T(n,"--gradient-stop2",e[8]),T(n,"--marginbottom",e[9]),T(n,"--transition",e[16].transition),P(n,"placementTop","top"===e[0]),E(i,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),E(i,"rel","stylesheet")},m(t,r){x(t,n,r),l&&l.m(n,null),x(t,o,r),b(document.head,i),s=!0,c||(a=_(Rt,"message",e[21]),c=!0)},p(t,e){t[11]?l?(l.p(t,e),2048&e[0]&&nt(l,1)):(l=Dt(t),l.c(),nt(l,1),l.m(n,null)):l&&(et={r:0,c:[],p:et},ot(l,1,1,(()=>{l=null})),et.r||r(et.c),et=et.p),(!s||2&e[0])&&T(n,"--voffset",t[1]),(!s||4&e[0])&&T(n,"--hoffset",t[2]),(!s||8&e[0])&&T(n,"--fontsize",t[3]),(!s||16&e[0])&&T(n,"--color",t[4]),(!s||32&e[0])&&T(n,"--highlight-color",t[5]),(!s||64&e[0])&&T(n,"--text-bg-color",t[6]),(!s||128&e[0])&&T(n,"--gradient-stop1",t[7]),(!s||256&e[0])&&T(n,"--gradient-stop2",t[8]),(!s||512&e[0])&&T(n,"--marginbottom",t[9]),(!s||65536&e[0])&&T(n,"--transition",t[16].transition),1&e[0]&&P(n,"placementTop","top"===t[0])},i(t){s||(nt(l),s=!0)},o(t){ot(l),s=!1},d(t){t&&w(n),l&&l.d(),t&&w(o),w(i),c=!1,a()}}}function Ht(t,e,n){let o,i,r,s,c,{placement:a}=e,{voffset:l="3rem"}=e,{hoffset:h="2rem"}=e,{fontsize:u="1.5rem"}=e,{color:f="#ffffff"}=e,{highlightcolor:g="#15e8b5"}=e,{backgroundcolor:p="#202020"}=e,{gradientstop1:m="#ffffff88"}=e,{gradientstop2:$="#ffffffcc"}=e,{marginbottom:y="0rem"}=e,{formattext:b}=e,x=[],w=null,v=null,k=Ct.ClientState.Disconnected,C=!1,S=!1,_=!1,E=yt({transition:0},{duration:200});d(t,E,(t=>n(16,s=t)));const z=O(),N=St(_t),T=St(((t,{delay:e=0,duration:n=400})=>({delay:e,duration:n,easing:ut,css:t=>`\n opacity: ${zt(Et,t,0,1)};\n max-height: ${10*zt(Et,t,0,.6)}rem;\n `}))),P=St(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${zt(Et,t,0,1)*o}rem;\n `}))),R=t=>{n(13,_=_||t)},M=t=>{n(27,k=t),k===Ct.ClientState.Recording&&(n(13,_=!1),n(10,x=[]),v=null)},D=t=>{if(void 0===t)return;c&&k===Ct.ClientState.Recording&&c.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?A(x.length>0?2e3:0):x.length>0&&(C||n(28,C=!0),A(2e3));const e=`${t.contextId}/${t.id}`;null!==v?v!==e&&(n(13,_=!1),v=e):v=e,n(10,x=[]),t.words.forEach((t=>{n(10,x[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},x)})),r?t.entities.forEach((t=>{n(10,x[t.startPosition].word=t.value,x),n(10,x[t.startPosition].entityType=t.type,x),n(10,x[t.startPosition].isFinal=t.isFinal,x),n(10,x[t.startPosition].hide=!1,x);for(let e=t.startPosition+1;e<t.endPosition;e++)x[e]&&n(10,x[e].hide=!0,x)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)x[e]&&(n(10,x[e].entityType=t.type,x),n(10,x[e].isFinal=t.isFinal,x))})),n(10,x=x.filter((t=>!t.hide)))},A=(t=0)=>{B(),w=window.setTimeout((()=>{w=null,C&&n(28,C=!1)}),t)},B=()=>{null!==w&&(window.clearTimeout(w),w=null)};return t.$$set=t=>{"placement"in t&&n(0,a=t.placement),"voffset"in t&&n(1,l=t.voffset),"hoffset"in t&&n(2,h=t.hoffset),"fontsize"in t&&n(3,u=t.fontsize),"color"in t&&n(4,f=t.color),"highlightcolor"in t&&n(5,g=t.highlightcolor),"backgroundcolor"in t&&n(6,p=t.backgroundcolor),"gradientstop1"in t&&n(7,m=t.gradientstop1),"gradientstop2"in t&&n(8,$=t.gradientstop2),"marginbottom"in t&&n(9,y=t.marginbottom),"formattext"in t&&n(23,b=t.formattext)},t.$$.update=()=>{if(1024&t.$$.dirty[0]&&n(14,o=0===x.length),64&t.$$.dirty[0]&&n(15,i="none"!==p),8388608&t.$$.dirty[0]&&(r=void 0===b||"false"!==b),402655232&t.$$.dirty[0]){const t=k===Ct.ClientState.Recording||C;t!==S&&(e="visibilitychanged",s=t,z.dispatchEvent(new CustomEvent(e,{detail:s,composed:!0}))),n(11,S=t),E.set({transition:S?1:0})}var e,s},[a,l,h,u,f,g,p,m,$,y,x,S,c,_,o,i,s,E,N,T,P,t=>{switch(t.data.type){case"speechsegment":D(t.data.segment);break;case"speechhandled":R(t.data.success);break;case"speechstate":M(t.data.state)}},t=>t.entityType||"",b,R,M,D,k,C,function(t){L[t?"unshift":"push"]((()=>{c=t,n(12,c)}))}]}class Vt extends ht{constructor(t){super(),this.shadowRoot.innerHTML="<style>.BigTranscript{position:relative;user-select:none;font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition))}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",dt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},Ht,Lt,a,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:23,speechhandled:24,speechstate:25,speechsegment:26},[-1,-1]),t&&(t.target&&x(t.target,this,t.anchor),t.props&&(this.$set(t.props),K()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$set({placement:t}),K()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$set({voffset:t}),K()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$set({hoffset:t}),K()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$set({fontsize:t}),K()}get color(){return this.$$.ctx[4]}set color(t){this.$set({color:t}),K()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$set({highlightcolor:t}),K()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$set({backgroundcolor:t}),K()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$set({gradientstop1:t}),K()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$set({gradientstop2:t}),K()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$set({marginbottom:t}),K()}get formattext(){return this.$$.ctx[23]}set formattext(t){this.$set({formattext:t}),K()}get speechhandled(){return this.$$.ctx[24]}get speechstate(){return this.$$.ctx[25]}get speechsegment(){return this.$$.ctx[26]}}function qt(e){let n,o,i,s,c,a,l,d,h;return{c(){n=v("main"),o=v("div"),i=v("div"),s=v("big-transcript"),c=S(),a=v("div"),l=C(e[10]),this.c=t,z(s,"formattext",e[9]),z(s,"fontsize",e[1]),z(s,"color",e[3]),z(s,"backgroundcolor","none"),z(s,"highlightcolor",e[5]),z(s,"gradientstop1",e[7]),z(s,"gradientstop2",e[8]),E(a,"class","hint"),T(a,"opacity",e[14].opacity),E(i,"class","pad"),E(o,"class","drawer"),T(o,"background-color",e[6]),T(o,"opacity",e[12].opacity),T(o,"transform","translate(0px, "+e[13].y+"rem)"),E(n,"class","placementTop"),T(n,"--height",e[0]),T(n,"--smalltextcolor",e[4]),T(n,"--hintfontsize",e[2])},m(t,r){x(t,n,r),b(n,o),b(o,i),b(i,s),e[25](s),b(i,c),b(i,a),b(a,l),d||(h=[_(window,"message",e[19]),_(s,"visibilitychanged",e[18])],d=!0)},p(t,[e]){512&e&&z(s,"formattext",t[9]),2&e&&z(s,"fontsize",t[1]),8&e&&z(s,"color",t[3]),32&e&&z(s,"highlightcolor",t[5]),128&e&&z(s,"gradientstop1",t[7]),256&e&&z(s,"gradientstop2",t[8]),1024&e&&N(l,t[10]),16384&e&&T(a,"opacity",t[14].opacity),64&e&&T(o,"background-color",t[6]),4096&e&&T(o,"opacity",t[12].opacity),8192&e&&T(o,"transform","translate(0px, "+t[13].y+"rem)"),1&e&&T(n,"--height",t[0]),16&e&&T(n,"--smalltextcolor",t[4]),4&e&&T(n,"--hintfontsize",t[2])},i:t,o:t,d(t){t&&w(n),e[25](null),d=!1,r(h)}}}function Ut(t,n,o){let i,r,s,c,{height:a="8rem"}=n,{hint:l=""}=n,{fontsize:h="1.5rem"}=n,{hintfontsize:u="0.9rem"}=n,{color:f="#ffffff"}=n,{smalltextcolor:g="#ffffff70"}=n,{highlightcolor:p="#15e8b5"}=n,{backgroundcolor:m="#202020"}=n,{gradientstop1:$="#ffffff88"}=n,{gradientstop2:y="#ffffffcc"}=n,{formattext:b}=n,x=[],w=0,v="";const k=(t,e=!0)=>{E.set({opacity:0}),c&&e&&c.speechsegment(t),t.isFinal&&(w++,w<x.length?o(10,v=x[w]):o(10,v=x[Math.floor(Math.random()*x.length)]))},C=t=>{w=0,o(20,l=t),x=[];try{x=JSON.parse(l),("string"==typeof x||x instanceof String)&&(x=[x])}catch(t){x[0]=l||""}o(10,v=x[w])};let S=yt({y:-1},{duration:200});d(t,S,(t=>o(13,r=t)));let _=yt({opacity:0},{duration:200,easing:e});d(t,_,(t=>o(12,i=t)));let E=yt({opacity:0},{duration:200,delay:200,easing:e});d(t,E,(t=>o(14,s=t)));return t.$$set=t=>{"height"in t&&o(0,a=t.height),"hint"in t&&o(20,l=t.hint),"fontsize"in t&&o(1,h=t.fontsize),"hintfontsize"in t&&o(2,u=t.hintfontsize),"color"in t&&o(3,f=t.color),"smalltextcolor"in t&&o(4,g=t.smalltextcolor),"highlightcolor"in t&&o(5,p=t.highlightcolor),"backgroundcolor"in t&&o(6,m=t.backgroundcolor),"gradientstop1"in t&&o(7,$=t.gradientstop1),"gradientstop2"in t&&o(8,y=t.gradientstop2),"formattext"in t&&o(9,b=t.formattext)},t.$$.update=()=>{1048576&t.$$.dirty&&C(l)},[a,h,u,f,g,p,m,$,y,b,v,c,i,r,s,S,_,E,t=>{!1===t.detail?(S.set({y:-1},{easing:ft}),_.set({opacity:0}),E.set({opacity:0})):(S.set({y:0},{easing:gt}),_.set({opacity:1}),E.set({opacity:1}))},t=>{switch(t.data.type){case"speechsegment":k(t.data.segment,!1);break;case"hint":C(t.data.hint)}},l,t=>{c&&c.speechhandled(t)},t=>{c&&c.speechstate(t)},k,C,function(t){L[t?"unshift":"push"]((()=>{c=t,o(11,c)}))}]}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",Vt);class Wt extends ht{constructor(t){super(),this.shadowRoot.innerHTML="<style>.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:60;pointer-events:none}.drawer{width:100%;min-height:var(--height);display:flex;flex-direction:column;justify-content:flex-end;box-shadow:0 0 0.35rem #0004}.pad{position:relative;padding:2rem 2rem 0.65rem 1.5rem}.hint{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--smalltextcolor);font-size:var(--hintfontsize);line-height:135%;margin-top:0.15rem}</style>",dt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},Ut,qt,a,{height:0,hint:20,fontsize:1,hintfontsize:2,color:3,smalltextcolor:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,formattext:9,speechhandled:21,speechstate:22,speechsegment:23,sethint:24}),t&&(t.target&&x(t.target,this,t.anchor),t.props&&(this.$set(t.props),K()))}static get observedAttributes(){return["height","hint","fontsize","hintfontsize","color","smalltextcolor","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","formattext","speechhandled","speechstate","speechsegment","sethint"]}get height(){return this.$$.ctx[0]}set height(t){this.$set({height:t}),K()}get hint(){return this.$$.ctx[20]}set hint(t){this.$set({hint:t}),K()}get fontsize(){return this.$$.ctx[1]}set fontsize(t){this.$set({fontsize:t}),K()}get hintfontsize(){return this.$$.ctx[2]}set hintfontsize(t){this.$set({hintfontsize:t}),K()}get color(){return this.$$.ctx[3]}set color(t){this.$set({color:t}),K()}get smalltextcolor(){return this.$$.ctx[4]}set smalltextcolor(t){this.$set({smalltextcolor:t}),K()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$set({highlightcolor:t}),K()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$set({backgroundcolor:t}),K()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$set({gradientstop1:t}),K()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$set({gradientstop2:t}),K()}get formattext(){return this.$$.ctx[9]}set formattext(t){this.$set({formattext:t}),K()}get speechhandled(){return this.$$.ctx[21]}get speechstate(){return this.$$.ctx[22]}get speechsegment(){return this.$$.ctx[23]}get sethint(){return this.$$.ctx[24]}}customElements.get("transcript-drawer")?console.warn("Skipping re-defining customElement transcript-drawer"):customElements.define("transcript-drawer",Wt)}(); | ||
//# sourceMappingURL=transcript-drawer.js.map |
Sorry, the diff of this file is not supported yet
984431