@seams/voiceid 0.24.0 → 0.25.0

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.
@@ -1,606 +0,0 @@
1
- import{WorkerDeferred as e,createCspStylesheetManager as t,getDefaultCspNonce as n}from"../voiceid-host.js";var r=class extends Error{constructor(e){super(e.noise===`high`?`Your voice did not match. Background noise is high. Move closer and try again.`:`Your voice did not match. Read the next sentence naturally and try again.`),this.name=`VoiceSpeakerMismatchError`}};async function i(){try{return await caches.open(`seams-voiceid-models-v1`)}catch{return null}}var a=class{pending=null;progress={kind:`checking_cache`};listeners=new Set;constructor(e){this.asset=e}get size(){return this.asset.bytes}async download(e){e&&(this.listeners.add(e),e(this.progress));try{this.pending||=this.bytes().catch(this.failed);let e=await this.pending;return this.publish({kind:`ready`}),e}finally{e&&this.listeners.delete(e)}}failed=e=>{throw this.pending=null,this.progress={kind:`checking_cache`},e};publish(e){this.progress=e;for(let t of this.listeners)t(e)}async valid(e){if(e.byteLength!==this.asset.bytes)return!1;let t=new Uint8Array(await crypto.subtle.digest(`SHA-256`,e)),n=``;for(let e of t)n+=e.toString(16).padStart(2,`0`);return n===this.asset.sha256}async bytes(){let{label:e,path:t,sha256:n}=this.asset;this.publish({kind:`checking_cache`});let r=await i(),a=new URL(`${t}?sha256=${n}`,location.origin).href;try{let e=await r?.match(a);if(e){let t=await e.arrayBuffer();if(await this.valid(t))return t;await r?.delete(a)}}catch{}this.publish({kind:`downloading`,received:0});let o=await fetch(t,{credentials:`omit`,cache:`force-cache`});if(!o.ok||!o.body)throw Error(`${e} is unavailable from this Wallet.`);let s=o.body.getReader(),c=new Uint8Array(this.asset.bytes),l=0;try{for(;;){let t=await s.read();if(t.done)break;if(l+t.value.length>c.length)throw Error(`${e} size is invalid.`);c.set(t.value,l),l+=t.value.length,this.publish({kind:`downloading`,received:l})}}finally{await s.cancel(),s.releaseLock()}if(!await this.valid(c.buffer))throw Error(`${e} integrity check failed.`);if(r)try{await r.put(a,new Response(c,{headers:{"Content-Type":`application/octet-stream`}}))}catch{}return c.buffer}};const o=new a({path:`/sdk/voiceid/ort-wasm-simd-threaded.wasm`,sha256:`3398c10d07d229bd91b364548e130e0e51a8e5704b88c7c083ebbeb78842dee2`,bytes:14239897,label:`VoiceID engine`});var s=class{asset;session=null;constructor(e){this.asset=new a(e)}prepare(){return this.session||=this.load().catch(this.failed),this.session}failed=e=>{throw this.session=null,e};async load(){let e=await import(`./ort.wasm.bundle.min-7y-hlRN8.js`);e.env.wasm.numThreads=1,e.env.wasm.wasmPaths=new URL(`/sdk/voiceid/`,location.origin).href,e.env.wasm.wasmBinary=await o.download();let t=await this.asset.download();return await e.InferenceSession.create(t,{executionProviders:[`wasm`]})}};const c=[`please sign this trade now`,`confirm my order for today`,`i review every order carefully`,`dump on them slowly`,`send this order to market`,`i'm here for the tech`,`keep this trade on track`,`the order book looks busy`,`if you panic panic early`,`i check the latest quote`,`exit liquidity for all passengers`,`no crying in the casino`,`this trade fits my plan`,`approve this transfer at once`,`check the price before trading`,`let this trade go through`],l=`.<unk>.▁t.he.▁a.▁the.in.▁s.▁w.▁o.re.nd.▁b.▁h.er.▁m.▁i.ou.▁c.▁f.at.ed.▁and.en.▁to.▁of.on.is.▁d.ing.▁th.▁p.▁he.or.▁l.es.▁in.ll.it.ar.as.an.▁n.▁g.om.▁be.▁ha.▁e.le.ot.▁y.ut.ow.ic.▁wh.▁it.ld.ve.▁that.ly.▁was.id.se.st.▁on.gh.ent.▁re.▁you.im.ce.▁u.ver.ion.▁as.et.▁for.ay.▁we.▁his.ith.al.ir.▁r.▁with.▁st.ad.ur.ght.▁an.▁her.▁not.▁had.▁is.ter.her.ac.am.▁at.oo.▁but.ould.▁she.▁k.▁se.▁sa.▁sh.▁fr.▁him.▁so.ill.▁me.ain.▁su.ight.ch.red.ct.all.ro.ke.ess.il.ore.▁de.▁they.▁my.▁whe.▁all.ich.▁ne.ri.▁by.▁have.ome.pp.▁this.▁li.▁do.▁con.us.▁which.▁ch.ul.qu.▁j.▁up.▁said.▁from.ard.ge.▁or.▁v.▁one.th.▁no.▁ex.▁were.▁there.pe.and.est.▁man.▁who.ble.ant.ie.▁al.res.ous.ust.very.ation.▁fe.▁them.lf.▁when.ind.nt.ame.ra.▁go.ers.ast.fe.ood.▁kn.▁int.ist.art.▁are.out.▁would.▁le.os.▁their.ong.▁what.our.▁if.ound.▁com.▁ab.▁out.▁wor.em.▁will.ak.▁mis.ate.ol.um.un.itt.ough.ked.ap.ig.one.▁been.own.ive.▁then.▁br.ven.if.▁ar.▁tr.self.▁.e.t.a.o.n.i.h.s.r.d.l.u.m.c.w.f.g.y.p.b.v.k.'.x.j.q.z`.split(`.`),u=new s({path:`/sdk/voiceid/aurora-int8.onnx`,sha256:`83ed6f3856458cd96d49a70d8c5175aeec18ba8c184e5367e089cd424eebefd6`,bytes:1342384,label:`Phrase recognition`});let d=null;function f(e){let t=new Uint32Array(1),n;do crypto.getRandomValues(t),n=c[t[0]%c.length];while(n===e||n===d);return d=n,n}const p=new Map([[`sea`,`see`],[`here`,`hear`],[`meat`,`meet`],[`whether`,`weather`],[`son`,`sun`],[`wood`,`would`],[`two`,`to`],[`too`,`to`],[`eye`,`i`]]),m=new Set([`no`,`not`,`never`,`cannot`,`can't`,`don't`,`doesn't`,`isn't`,`aren't`,`wasn't`,`weren't`,`won't`,`wouldn't`,`shouldn't`,`without`]);function h(e){return e.toLowerCase().replace(/’/g,`'`).match(/[a-z0-9]+(?:'[a-z]+)?/g)??[]}function g(e){return e!==`a`&&e!==`an`&&e!==`the`}function _(e){return p.get(e)??e}function v(e){return e.filter(g).map(_).join(` `)}function y(e){return m.has(e)}function b(e,t){let n=Array.from({length:t.length+1},x);for(let r=0;r<e.length;r+=1){let i=[r+1];for(let a=0;a<t.length;a+=1)i.push(Math.min(i[a]+1,n[a+1]+1,n[a]+(e[r]===t[a]?0:1)));n=i}return n[t.length]}function x(e,t){return t}function S(e){let t=h(e),n=v(t);if(!n)return{kind:`empty`};let r=c[0],i=1/0,a=1/0;for(let e of c){let t=v(h(e)),o=b(n,t)/Math.max(n.length,t.length);o<i?(a=i,i=o,r=e):a=Math.min(a,o)}let o=a-i;if(t.filter(y).join(` `)!==h(r).filter(y).join(` `))return{kind:`uncertain`,candidate:r,difference:i,margin:o,decodedText:e,reason:`negated`};let s=h(r).length;return i>.3||Math.abs(t.length-s)>2?{kind:`uncertain`,candidate:r,difference:i,margin:o,decodedText:e,reason:`different`}:o<.1?{kind:`uncertain`,candidate:r,difference:i,margin:o,decodedText:e,reason:`ambiguous`}:{kind:`recognized`,phrase:r,difference:i,margin:o,decodedText:e}}var C=class extends Error{constructor(){super(`The phrase was not clear. Try the new phrase at your normal pace.`),this.name=`VoicePhraseMismatchError`}};function w(e,t){let n=[],r=-1;for(let i=0;i<t;i+=1){let t=i*257,a=-1/0,o=0;for(let n=0;n<257;n+=1){let r=e[t+n];if(!Number.isFinite(r))throw Error(`Phrase model returned invalid scores.`);r>a&&(a=r,o=n)}o!==0&&o!==r&&n.push(o),r=o}return n.length===0?{kind:`empty`}:S(n.map(T).join(``).replace(/▁/g,` `).trim().replace(/\s+/g,` `))}function T(e){return l[e]}async function E(e,t){let n=await u.prepare(),r=new(await(import(`./ort.wasm.bundle.min-7y-hlRN8.js`))).Tensor(`float32`,e,[1,e.length]);try{let e=await n.run({samples:r});try{let n=e.logits;if(!n||!(n.data instanceof Float32Array)||n.dims.length!==3||n.dims[0]!==1||n.dims[2]!==257||n.data.length!==n.dims[1]*257)throw Error(`Phrase model returned an invalid result.`);let r=w(n.data,n.dims[1]);return r.kind===`recognized`&&r.phrase===t?{kind:`matched`,recognition:r}:{kind:`mismatch`,recognition:r}}finally{for(let t of Object.values(e))t.dispose()}}finally{r.dispose()}}const ee=new s({path:`/sdk/voiceid/silero-vad.onnx`,sha256:`2623a2953f6ff3d2c1e61740c6cdb7168133479b267dfef114a4a3cc5bdd788f`,bytes:2327524,label:`Speech detection`});async function te(){return new D(await ee.prepare(),await import(`./ort.wasm.bundle.min-7y-hlRN8.js`))}var D=class{state=new Float32Array(256);context=new Float32Array(64);constructor(e,t){this.session=e,this.ort=t}async probability(e){if(e.length!==512)throw Error(`Speech detection requires a 512-sample frame.`);let t=new Float32Array(576);t.set(this.context),t.set(e,64);let n=new this.ort.Tensor(`float32`,t,[1,576]),r=new this.ort.Tensor(`float32`,this.state,[2,1,128]),i=new this.ort.Tensor(`int64`,BigInt64Array.of(16000n),[]);try{let t=await this.session.run({input:n,state:r,sr:i});try{let n=t.output?.data,r=t.stateN?.data;if(!(n instanceof Float32Array)||n.length!==1||!Number.isFinite(n[0])||n[0]<0||n[0]>1||!(r instanceof Float32Array)||r.length!==256)throw Error(`Speech detection returned an invalid result.`);return this.state.set(r),this.context.set(e.subarray(448)),n[0]}finally{for(let e of Object.values(t))e.dispose()}}finally{n.dispose(),r.dispose(),i.dispose(),t.fill(0)}}clear(){this.state.fill(0),this.context.fill(0)}};function O(e){return e.noise===`high`?`Background noise is high. Move closer to the microphone and try again.`:`Audio too brief or quiet: ${(e.voicedMs/1e3).toFixed(2)} of ${(e.requiredVoicedMs/1e3).toFixed(2)} seconds detected.`}var k=class extends Error{constructor(e){super(O(e)),this.quality=e,this.name=`InsufficientVoiceAudioError`}};const A=16e3,j=.006,M=8e3;function ne(){if(re(),!navigator.userActivation.isActive)throw Error(`Open the Wallet and select Record to use VoiceID.`)}function re(){if(document.visibilityState!==`visible`||!document.hasFocus())throw Error(`Keep the Wallet open and focused to use VoiceID.`)}async function N(e,t){if(e.aborted)throw Error(`VoiceID recording was cancelled.`);let n=crypto.randomUUID(),r=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1});try{if(e.aborted)throw Error(`VoiceID recording was cancelled.`);let i=await new P(r,e,t).result.finally(t.bind(null,{kind:`processing`}));if(e.aborted)throw Error(`VoiceID recording was cancelled.`);let a=await new OfflineAudioContext(1,A,A).decodeAudioData(i.bytes),o=new OfflineAudioContext(1,Math.ceil(a.duration*A),A),s=o.createBufferSource();s.buffer=a,s.connect(o.destination),s.start();try{let a=await o.startRendering();try{if(e.aborted)throw Error(`VoiceID recording was cancelled.`);let o=a.getChannelData(0),s=await F(o,e),c=r.getAudioTracks()[0]?.getSettings(),l={attemptId:n,capturedAtMs:Date.now(),durationMs:a.duration*1e3,recordingMs:i.recordingMs,endedBy:i.endedBy,voicedMs:s.voicedMs,peakFrameRms:s.peakFrameRms,levelThreshold:j,requiredVoicedMs:600,microphone:r.getAudioTracks()[0]?.label||`Default microphone`,processing:{noiseSuppression:c?.noiseSuppression??null,echoCancellation:c?.echoCancellation??null,autoGainControl:c?.autoGainControl??null,sampleRate:c?.sampleRate??null},backgroundRms:s.backgroundRms,speechToBackgroundDb:s.speechToBackgroundDb,noise:s.noise};return t({kind:`measured`,quality:l}),s.kind===`insufficient_audio`?{kind:`insufficient_audio`,quality:l}:{kind:`captured`,samples:o.slice(Math.max(0,s.first-3200),Math.min(o.length,s.last+3200)),quality:l}}finally{ie(a)}}finally{ie(a)}}finally{for(let e of r.getTracks())e.stop()}}var P=class{recorder;chunks=[];timer=null;completion=new e;startedAtMs=performance.now();ended=null;activity={kind:`waiting`,activeMs:0};audioContext=null;worklet=null;detector=null;pending=Promise.resolve();queuedFrames=0;closed=!1;result=this.completion.promise;constructor(e,t,n){this.stream=e,this.signal=t,this.onCapture=n,this.recorder=new MediaRecorder(e),this.recorder.addEventListener(`dataavailable`,this.data),this.recorder.addEventListener(`stop`,this.stopped),this.recorder.addEventListener(`error`,this.failed),t.addEventListener(`abort`,this.cancelled,{once:!0}),this.timer=setTimeout(this.startupFailed,M),this.start()}async start(){try{if(await this.startPauseDetection(),this.signal.throwIfAborted(),this.startedAtMs=performance.now(),this.closed)return;this.recorder.start(),this.timer!==null&&clearTimeout(this.timer),this.timer=setTimeout(this.stop.bind(this,`limit`),M),this.onCapture({kind:`listening`})}catch(e){this.cleanup(),this.completion.reject(e instanceof Error?e:Error(`Speech detection could not start.`))}}data=e=>{this.chunks.push(e.data)};stop=e=>{this.recorder.state!==`inactive`&&(this.ended={endedBy:e,recordingMs:performance.now()-this.startedAtMs},this.recorder.stop(),this.stopTracks())};cancelled=()=>{if(this.recorder.state===`inactive`){this.cleanup(),this.completion.reject(Error(`VoiceID recording was cancelled.`));return}this.stop(`stream_ended`)};startupFailed=()=>{this.cleanup(),this.completion.reject(Error(`Speech detection startup timed out. Please try again.`))};detectorFailed=e=>{this.cleanup(),this.completion.reject(e instanceof Error?e:Error(`Speech detection failed.`))};failed=()=>{this.cleanup(),this.completion.reject(Error(`VoiceID could not record this microphone.`))};stopped=()=>{if(this.cleanup(),this.signal.aborted){this.completion.reject(Error(`VoiceID recording was cancelled.`));return}new Blob(this.chunks,{type:this.recorder.mimeType}).arrayBuffer().then(this.complete,this.completion.reject.bind(this.completion))};complete=e=>{if(this.signal.aborted){this.completion.reject(Error(`VoiceID recording was cancelled.`));return}let t=this.ended??{endedBy:`stream_ended`,recordingMs:performance.now()-this.startedAtMs};this.completion.resolve({bytes:e,recordingMs:t.recordingMs,endedBy:t.endedBy})};async startPauseDetection(){let e=new AudioContext({sampleRate:A});this.audioContext=e;let t=e.resume();if(this.detector=await te(),this.signal.throwIfAborted(),e.sampleRate!==A)throw Error(`Speech detection requires 16 kHz audio.`);await e.audioWorklet.addModule(`/sdk/voiceid/voice-activity-worklet.js`),this.signal.throwIfAborted();let n=new AudioWorkletNode(e,`voice-activity-frames`);this.worklet=n,n.port.onmessage=this.receiveFrame,e.createMediaStreamSource(this.stream).connect(n),n.connect(e.destination),await t}receiveFrame=e=>{if(!(e.data instanceof Float32Array)||e.data.length!==512){this.failed();return}if(this.closed||this.recorder.state!==`recording`){e.data.fill(0);return}if(++this.queuedFrames>32){e.data.fill(0),this.failed();return}this.pending=this.pending.then(this.processFrame.bind(this,e.data)).catch(this.detectorFailed)};async processFrame(e){let t=this.detector;try{if(this.closed||!t)return;let n=await t.probability(e);if(this.closed){t.clear();return}let r=0;for(let t of e)r+=t*t;let i=Math.sqrt(r/e.length),a=n>=.5&&i>=j;this.updateActivity(a),this.onCapture({kind:`activity`,rms:i,speech:a})}finally{e.fill(0),--this.queuedFrames}}updateActivity(e){let t=performance.now();switch(this.activity.kind){case`waiting`:{let n=e?this.activity.activeMs+32:0;this.activity=n>=100?{kind:`speaking`,lastSoundAtMs:t}:{kind:`waiting`,activeMs:n};return}case`speaking`:e?this.activity={kind:`speaking`,lastSoundAtMs:t}:t-this.activity.lastSoundAtMs>=1500&&this.stop(`pause`);return;default:return oe(this.activity)}}stopPauseDetection=()=>{this.closed=!0,this.worklet&&(this.worklet.port.onmessage=null,this.worklet.port.close(),this.worklet.disconnect()),this.worklet=null,this.detector?.clear(),this.detector=null;let e=this.audioContext;this.audioContext=null,e&&e.close().catch(ae)};stopTracks(){for(let e of this.stream.getTracks())e.stop()}cleanup(){this.stopPauseDetection(),this.stopTracks(),this.timer!==null&&clearTimeout(this.timer),this.signal.removeEventListener(`abort`,this.cancelled),this.recorder.removeEventListener(`dataavailable`,this.data),this.recorder.removeEventListener(`stop`,this.stopped),this.recorder.removeEventListener(`error`,this.failed)}};async function F(e,t){let n=await te(),r=-1,i=0,a=0,o=0,s=0,c=0,l=0,u=new Float32Array(512);try{for(let d=0;d<e.length;d+=u.length){t.throwIfAborted(),u.fill(0);let f=Math.min(u.length,e.length-d);u.set(e.subarray(d,d+f));let p=0;for(let e of u)p+=e*e;let m=Math.sqrt(p/f);if(o=Math.max(o,m),!(await n.probability(u)>=.5&&m>=j)){s+=p,c+=f;continue}r<0&&(r=d),i=d+f,a+=f,l+=p}}finally{u.fill(0),n.clear()}let d=Math.sqrt(s/Math.max(1,c)),f=Math.sqrt(l/Math.max(1,a)),p=a&&c?20*Math.log10(Math.max(f,1e-8)/Math.max(d,1e-8)):null,m={backgroundRms:d,speechToBackgroundDb:p,noise:d>=j&&(p===null||p<10)?`high`:c?`normal`:`unknown`},h=a/A*1e3;return r<0||h<600?{kind:`insufficient_audio`,voicedMs:h,peakFrameRms:o,...m}:{kind:`captured`,first:r,last:i,voicedMs:h,peakFrameRms:o,...m}}function ie(e){for(let t=0;t<e.numberOfChannels;t+=1)e.getChannelData(t).fill(0)}function ae(){}function oe(e){throw Error(`Unexpected speech activity: ${String(e)}`)}var I,L,se,R,ce,le,ue,de,fe,pe,me,he,ge,_e,ve={},ye=[],be=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,z=Array.isArray;function B(e,t){for(var n in t)e[n]=t[n];return e}function xe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Se(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?I.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return Ce(e,o,r,i,null)}function Ce(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++se,__i:-1,__u:0};return i==null&&L.vnode!=null&&L.vnode(a),a}function we(e){return e.children}function V(e,t){this.props=e,this.context=t}function Te(e,t){if(t==null)return e.__?Te(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?Te(e):null}function Ee(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=B({},t);a.__v=t.__v+1,L.vnode&&L.vnode(a),H(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??Te(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,ze(r,a,i),t.__e=t.__=null,a.__e!=n&&De(a)}}function De(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),De(e)}function Oe(e){(!e.__d&&(e.__d=!0)&&R.push(e)&&!ke.__r++||ce!=L.debounceRendering)&&((ce=L.debounceRendering)||le)(ke)}function ke(){try{for(var e,t=1;R.length;)R.length>t&&R.sort(ue),e=R.shift(),t=R.length,Ee(e)}finally{R.length=ke.__r=0}}function Ae(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_=r&&r.__k||ye,v=t.length;for(c=je(n,t,_,c,v),d=0;d<v;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&_[p.__i]||ve,p.__i=d,g=H(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&Be(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),4&p.__u?(c=Me(p,c,e),f.__e&&=null):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function je(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=Ce(null,o,null,null,null):z(o)?o=e.__k[a]=Ce(we,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=Ce(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=Pe(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Te(s)),Ve(s,s));return r}function Me(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=Me(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=Te(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ne(e,t){return t||=[],e==null||typeof e==`boolean`||(z(e)?e.some(function(e){Ne(e,t)}):t.push(e)),t}function Pe(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Fe(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||be.test(t)?n:n+`px`}function Ie(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Fe(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Fe(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(me,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[pe]=r[pe]:(n[pe]=he,e.addEventListener(t,a?_e:ge,a)):e.removeEventListener(t,a?_e:ge,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function Le(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[fe]==null)t[fe]=he++;else if(t[fe]<n[pe])return;return n(L.event?L.event(t):t)}}}function H(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=L.__b)&&u(t);n:if(typeof E==`function`){d=o.length;try{if(v=t.props,y=E.prototype&&E.prototype.render,b=(u=E.contextType)&&r[u.__c],x=u?b?b.props.value:u.__:r,n.__c?_=(f=t.__c=n.__c).__=f.__E:(y?t.__c=f=new E(v,x):(t.__c=f=new V(v,x),f.constructor=E,f.render=He),b&&b.sub(f),f.state||={},f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&E.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=B({},f.__s)),B(f.__s,E.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&E.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&E.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),t.__v==n.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)){t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),ye.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f),s=Te(n);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__e=!1,S=L.__r,C=0,y)f.state=f.__s,f.__d=!1,S&&S(t),u=f.render(f.props,f.state,f.context),ye.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,S&&S(t),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++C<25);f.state=f.__s,f.getChildContext!=null&&(r=B(B({},r),f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),w=u!=null&&u.type===we&&u.key==null?U(u.props.children):u,s=Ae(e,z(w)?w:[w],t,n,r,i,a,o,s,c,l),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__E=f.__=null)}catch(e){if(o.length=d,t.__v=null,c||a!=null){if(e.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a!=null&&(a[a.indexOf(s)]=null),t.__e=s}else if(a!=null)for(T=a.length;T--;)xe(a[T])}else t.__e=n.__e;t.__k??=n.__k||[],e.then||Re(t),L.__e(e,t,n)}}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=W(n.__e,t,n,r,i,a,o,c,l);return(u=L.diffed)&&u(t),128&t.__u?void 0:s}function Re(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Re))}function ze(e,t,n){for(var r=0;r<n.length;r++)Be(n[r],n[++r],n[++r]);L.__c&&L.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){L.__e(e,t.__v)}})}function U(e){return typeof e!=`object`||!e||e.__b>0?e:z(e)?e.map(U):e.constructor===void 0?B({},e):null}function W(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props||ve,_=t.props,v=t.type;if(v==`svg`?i=`http://www.w3.org/2000/svg`:v==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName==v:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(i,v,_.is&&_),s&&=(L.__m&&L.__m(t,a),!1),a=null}if(v==null)g===_||s&&e.data==_||(e.data=_);else{if(a=v==`textarea`&&_.defaultValue!=null?null:a&&I.call(e.childNodes),!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`dangerouslySetInnerHTML`?d=p:l==`children`||l in _||l==`value`&&`defaultValue`in _||l==`checked`&&`defaultChecked`in _||Ie(e,l,null,p,i);for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:s&&typeof p!=`function`||g[l]===p||Ie(e,l,p,g[l],i);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),Ae(t.type==`template`?e.content:e,z(f)?f:[f],t,n,r,v==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&Te(n,0),s,c),a!=null)for(l=a.length;l--;)xe(a[l]);s&&v!=`textarea`||(l=`value`,v==`progress`&&m==null?e.removeAttribute(`value`):m!=null&&(m!==e[l]||v==`progress`&&!m||v==`option`&&m!=g[l])&&Ie(e,l,m,g[l],i),l=`checked`,h!=null&&h!=e[l]&&Ie(e,l,h,g[l],i))}return e}function Be(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){L.__e(e,n)}}function Ve(e,t,n){var r,i;if(L.unmount&&L.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Be(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){L.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Ve(r[i],t,n||typeof e.type!=`function`);n||xe(e.__e),e.__c=e.__=e.__e=void 0}function He(e,t,n){return this.constructor(e,n)}function Ue(e,t,n){var r,i,a,o;t==document&&(t=document.documentElement),L.__&&L.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,a=[],o=[],H(t,e=(!r&&n||t).__k=Se(we,null,[e]),i||ve,ve,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?I.call(t.childNodes):null,a,!r&&n?n:i?i.__e:t.firstChild,r,o),ze(a,e,o),e.props.children=null}I=ye.slice,L={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},se=0,V.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=B({},this.state);typeof e==`function`&&(e=e(B({},n),this.props)),e&&B(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Oe(this))},V.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Oe(this))},V.prototype.render=we,R=[],le=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ue=function(e,t){return e.__v.__b-t.__v.__b},ke.__r=0,de=Math.random().toString(8),fe=`__d`+de,pe=`__a`+de,me=/(PointerCapture)$|Capture$/i,he=0,ge=Le(!1),_e=Le(!0);var We,G,Ge,Ke,qe=0,Je=[],K=L,Ye=K.__b,Xe=K.__r,Ze=K.diffed,Qe=K.__c,$e=K.unmount,et=K.__;function tt(e,t){K.__h&&K.__h(G,e,qe||t),qe=0;var n=G.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function nt(e){return qe=1,rt(ht,e)}function rt(e,t,n){var r=tt(We++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ht(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=G,!G.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};G.__f=!0;var a=G.shouldComponentUpdate,o=G.componentWillUpdate;G.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},G.shouldComponentUpdate=i}return r.__N||r.__}function it(e,t){var n=tt(We++,3);!K.__s&&mt(n.__H,t)&&(n.__=e,n.u=t,G.__H.__h.push(n))}function at(e){return qe=5,ot(function(){return{current:e}},[])}function ot(e,t){var n=tt(We++,7);return mt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function st(e,t){return qe=8,ot(function(){return e},t)}function ct(){var e=tt(We++,11);if(!e.__){for(var t=G.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||=[0,0];e.__=`P`+n[0]+`-`+ n[1]++}return e.__}function lt(){for(var e;e=Je.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ft),t.__h.some(pt),t.__h=[]}catch(n){t.__h=[],K.__e(n,e.__v)}}}K.__b=function(e){G=null,Ye&&Ye(e)},K.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),et&&et(e,t)},K.__r=function(e){Xe&&Xe(e),We=0;var t=(G=e.__c).__H;t&&(Ge===G?(t.__h=[],G.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(ft),t.__h.some(pt),t.__h=[],We=0)),Ge=G},K.diffed=function(e){Ze&&Ze(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Je.push(t)!==1&&Ke===K.requestAnimationFrame||((Ke=K.requestAnimationFrame)||dt)(lt)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),Ge=G=null},K.__c=function(e,t){t.some(function(e){try{e.__h.some(ft),e.__h=e.__h.filter(function(e){return!e.__||pt(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],K.__e(n,e.__v)}}),Qe&&Qe(e,t)},K.unmount=function(e){$e&&$e(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{ft(e)}catch(e){t=e}}),n.__H=void 0,t&&K.__e(t,n.__v))};var ut=typeof requestAnimationFrame==`function`;function dt(e){var t,n=function(){clearTimeout(r),ut&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ut&&(t=requestAnimationFrame(n))}function ft(e){var t=G,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),G=t}function pt(e){var t=G;e.__c=e.__(),G=t}function mt(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function ht(e,t){return typeof t==`function`?t(e):t}function gt(e,t){for(var n in t)e[n]=t[n];return e}function _t(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function vt(e,t){this.props=e,this.context=t}(vt.prototype=new V).isPureReactComponent=!0,vt.prototype.shouldComponentUpdate=function(e,t){return _t(this.props,e)||_t(this.state,t)};var yt=L.__b;L.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),yt&&yt(e)};var bt=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.forward_ref`)||3911;function xt(e){function t(t){var n=gt({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=bt,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName=`ForwardRef(`+(e.displayName||e.name)+`)`,t}var St=L.__e;L.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k||[]),i.__c(e,t)}St(e,t,n,r)};var Ct=L.unmount;function wt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=gt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return wt(e,t,n)})),e}function Tt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Tt(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Et(){this.__u=0,this.o=null,this.__b=null}function Dt(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Ot(){this.i=null,this.l=null}L.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ct&&Ct(e)},(Et.prototype=new V).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=Dt(r.__v),a=!1,o=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=o;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Tt(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},Et.prototype.componentWillUnmount=function(){this.o=[]},Et.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=wt(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&Se(we,null,e.fallback);return i&&(i.__u&=-33),[Se(we,null,t.__a?null:e.children),i]};var kt=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Ot.prototype=new V).__a=function(e){var t=this,n=Dt(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),kt(t,e,r)):i()};n?n(a):a()}},Ot.prototype.render=function(e){this.i=null,this.l=new Map;var t=Ne(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ot.prototype.componentDidUpdate=Ot.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){kt(e,n,t)})};var At=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,jt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Mt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Nt=/[A-Z0-9]/g,Pt=typeof document<`u`,Ft=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};V.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(V.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var It=L.event;L.event=function(e){return It&&(e=It(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Lt={configurable:!0,get:function(){return this.class}},Rt=L.vnode;L.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)==-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||Pt&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){var s=a.toLowerCase();a===`defaultValue`&&`value`in t&&t.value==null?a=`value`:a===`download`&&!0===o?o=``:s===`translate`&&o===`no`?o=!1:s[0]===`o`&&s[1]===`n`?s===`ondoubleclick`?a=`ondblclick`:s!==`onchange`||n!==`input`&&n!==`textarea`||Ft(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Mt.test(a)&&(a=s):s=a=`oninput`:i&&jt.test(a)?a=a.replace(Nt,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=Ne(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=Ne(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,`className`,Lt)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=At,Rt&&Rt(e)};var zt=L.__r;L.__r=function(e){zt&&zt(e),e.__c};var Bt=L.diffed;L.diffed=function(e){Bt&&Bt(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value)};var Vt=0;Array.isArray;function q(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Vt,__i:-1,__u:0,__source:i,__self:a};if(typeof e==`function`&&(o=e.defaultProps))for(s in o)c[s]===void 0&&(c[s]=o[s]);return L.vnode&&L.vnode(l),l}function Ht(e){let t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(n){let e=n[1].length===3?n[1].split(``).map(e=>e+e).join(``):n[1];return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}let r=t.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i);return r?[Math.round(+r[1]),Math.round(+r[2]),Math.round(+r[3])]:null}function Ut(e){let t=Ht(e);return t?`rgb(${t[0]}, ${t[1]}, ${t[2]})`:null}function Wt(e){let t=Ht(e);return t?`${t[0]}, ${t[1]}, ${t[2]}`:null}const Gt={dark:{strokeOpacity:1.16,innerOpacity:.47,bloomOpacity:.89,innerShadow:`rgba(255, 255, 255, 0.1)`,saturation:1.2,brightness:1.1},light:{strokeOpacity:1.2,innerOpacity:.85,bloomOpacity:.5,innerShadow:`rgba(0, 0, 0, 0.08)`,saturation:1.6,brightness:.95,hueRange:40,hueDuration:8.5,hueBase:5,strength:.8,bandStrength:1.7}},Kt=[{x:0,w:74,h:46,band:0},{x:-36,w:54,h:40,band:1},{x:36,w:54,h:40,band:1},{x:-72,w:48,h:32,band:2},{x:72,w:48,h:32,band:2},{x:-108,w:42,h:26,band:1},{x:108,w:42,h:26,band:1}],qt=36*Kt.length,Jt={colorful:{dark:[`rgb(255, 70, 120)`,`rgb(60, 190, 255)`,`rgb(175, 70, 255)`,`rgb(60, 220, 130)`,`rgb(255, 150, 40)`,`rgb(90, 100, 255)`,`rgb(40, 200, 190)`],light:[`rgb(255, 201, 21)`,`rgb(126, 196, 255)`,`rgb(180, 40, 230)`,`rgb(235, 100, 160)`,`rgb(255, 176, 122)`,`rgb(154, 160, 255)`,`rgb(127, 217, 238)`]},mono:{dark:[`rgb(215, 215, 215)`,`rgb(180, 180, 180)`,`rgb(190, 190, 190)`,`rgb(160, 160, 160)`,`rgb(170, 170, 170)`,`rgb(150, 150, 150)`,`rgb(155, 155, 155)`],light:[`rgb(60, 60, 60)`,`rgb(90, 90, 90)`,`rgb(85, 85, 85)`,`rgb(110, 110, 110)`,`rgb(105, 105, 105)`,`rgb(125, 125, 125)`,`rgb(120, 120, 120)`]},ocean:{dark:[`rgb(80, 140, 255)`,`rgb(40, 200, 230)`,`rgb(120, 90, 255)`,`rgb(30, 170, 210)`,`rgb(160, 80, 240)`,`rgb(60, 110, 255)`,`rgb(40, 190, 180)`],light:[`rgb(40, 100, 240)`,`rgb(20, 160, 200)`,`rgb(90, 60, 230)`,`rgb(20, 130, 180)`,`rgb(130, 50, 220)`,`rgb(40, 80, 230)`,`rgb(20, 150, 150)`]},sunset:{dark:[`rgb(255, 110, 60)`,`rgb(255, 180, 40)`,`rgb(255, 60, 90)`,`rgb(255, 210, 80)`,`rgb(240, 70, 140)`,`rgb(255, 140, 50)`,`rgb(230, 50, 110)`],light:[`rgb(235, 80, 30)`,`rgb(230, 150, 10)`,`rgb(230, 30, 70)`,`rgb(225, 175, 30)`,`rgb(215, 40, 110)`,`rgb(235, 110, 20)`,`rgb(205, 30, 90)`]},forest:{dark:[`rgb(70, 220, 120)`,`rgb(40, 200, 180)`,`rgb(140, 230, 80)`,`rgb(30, 170, 140)`,`rgb(190, 235, 70)`,`rgb(50, 190, 110)`,`rgb(30, 150, 120)`],light:[`rgb(30, 170, 80)`,`rgb(20, 150, 130)`,`rgb(90, 180, 30)`,`rgb(20, 130, 100)`,`rgb(130, 180, 20)`,`rgb(30, 150, 80)`,`rgb(20, 120, 90)`]},candy:{dark:[`rgb(255, 90, 170)`,`rgb(255, 120, 220)`,`rgb(210, 80, 255)`,`rgb(255, 150, 190)`,`rgb(180, 110, 255)`,`rgb(255, 70, 140)`,`rgb(230, 100, 240)`],light:[`rgb(235, 40, 140)`,`rgb(230, 70, 190)`,`rgb(180, 40, 230)`,`rgb(235, 100, 160)`,`rgb(150, 70, 230)`,`rgb(230, 30, 110)`,`rgb(200, 60, 210)`]},ice:{dark:[`rgb(150, 230, 255)`,`rgb(90, 200, 255)`,`rgb(190, 240, 255)`,`rgb(120, 190, 255)`,`rgb(160, 220, 250)`,`rgb(80, 170, 255)`,`rgb(200, 235, 255)`],light:[`rgb(30, 160, 220)`,`rgb(20, 130, 210)`,`rgb(60, 180, 230)`,`rgb(40, 120, 220)`,`rgb(50, 160, 220)`,`rgb(20, 110, 220)`,`rgb(70, 170, 230)`]},gold:{dark:[`rgb(255, 200, 70)`,`rgb(255, 170, 40)`,`rgb(255, 220, 110)`,`rgb(240, 150, 30)`,`rgb(255, 235, 140)`,`rgb(230, 160, 40)`,`rgb(250, 210, 90)`],light:[`rgb(200, 140, 10)`,`rgb(190, 120, 0)`,`rgb(210, 160, 30)`,`rgb(180, 110, 0)`,`rgb(205, 170, 40)`,`rgb(175, 115, 5)`,`rgb(195, 150, 20)`]}};function J(e,t){let n=e.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);return n?`rgba(${n[1]}, ${n[2]}, ${n[3]}, ${t.toFixed(2)})`:e}function Yt(e,t=1){return Math.max(.5,Math.round(e*t*100)/100)}function Xt(e,t){return`calc(50% + (var(--vb-cx-${t}) + var(--vb-x${e}-${t})) * var(--vb-w-${t}) * var(--vb-z-${t}, 1))`}function Zt({id:e,colors:t,alpha:n,sw:r,sh:i,y:a,fade:o,count:s}){return(s?Kt.slice(0,s):Kt).map((s,c)=>{let l=n>=1?t[c%t.length]:J(t[c%t.length],n),u=`calc(${Math.round(s.w*r)}px * var(--vb-w-${e}) * var(--vb-z-${e}, 1))`,d=`calc(${Math.round(s.h*i)}px * var(--vb-h-${e}) * var(--vb-l${c}-${e}) * var(--vb-z-${e}, 1))`,f=`calc(100% + (${a}px + var(--vb-y${c}-${e})) * var(--vb-z-${e}, 1))`;return`radial-gradient(ellipse ${u} ${d} at ${Xt(c,e)} ${f}, ${l} 0%, transparent ${o}%)`}).join(`,
2
- `)}function Qt(e){let{id:t,borderRadius:n,borderWidth:r,strokeOpacity:i,innerOpacity:a,bloomOpacity:o,innerShadow:s,colorVariant:c,colors:l,brightness:u,saturation:d,theme:f,hueBase:p=0,glowSize:m=1,glowWidth:h=1,glowHeight:g=1,strokeScale:_=1,innerScale:v=1,innerHeight:y=1,bloomScale:b=1,bloomHeight:x=1,coreSize:S=1,coreLight:C=0,coreLightWidth:w=1,coreLightHeight:T=1,rangeWidth:E=1,rangeHeight:ee=1,softness:te=1,distortion:D=!1,scale:O=1}=e,k=Math.round(28*O*10)/10,A=Math.round(9*O*10)/10,j=Math.max(0,n-r),M=Math.round(Math.max(40,Math.min(95,70*te))),ne=e=>h*e,re=e=>g*e,N=e=>Math.round(e*10)/10,P=`var(--vb-z-${t}, 1)`,F=e=>`calc(${N(e)}px * ${P})`,ie=f===`dark`,ae=Jt[c][ie?`dark`:`light`].map((e,t)=>{let n=l?.[t];return n&&Ut(n)||e}),oe=c===`mono`?.6:1,I=(i*oe).toFixed(2),L=(a*oe).toFixed(2),se=(o*oe).toFixed(2),R=u.toFixed(2),ce=d.toFixed(2),le=`hue-rotate(calc(var(--voice-hue-base, ${p}deg) + var(--vb-hue-${t})))`,ue=D?` url(#vb-distort-${t})`:``,de=`filter: ${le} brightness(${R}) saturate(${ce});`,fe=`filter: ${le} brightness(${R}) saturate(${ce})${ue};`,pe=`filter: blur(${F(Yt(10,m))}) ${le} brightness(${R}) saturate(${ce});`,me=`filter: blur(${F(Yt(10,m))}) ${le} brightness(${R}) saturate(${ce})${ue};`,he=`calc(50% + var(--vb-cx-${t}) * var(--vb-w-${t}) * ${P})`,ge=`calc(100% + (2px + var(--vb-cy-${t})) * ${P})`,_e=ie?`radial-gradient(ellipse calc(${N(30*S)}px * var(--vb-w-${t}) * ${P}) calc(${N(30*S)}px * var(--vb-h-${t}) * ${P}) at ${he} ${ge}, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.14) 30%, transparent 65%)`:`radial-gradient(ellipse calc(${N(40*S)}px * var(--vb-w-${t}) * ${P}) calc(${N(30*S)}px * var(--vb-h-${t}) * ${P}) at ${he} ${ge}, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.22) 35%, transparent 70%)`,ve=Zt({id:t,colors:ae,alpha:1,sw:ne(_),sh:re(_),y:2,fade:M}),ye=Zt({id:t,colors:ae,alpha:.46,sw:ne(.9*v),sh:re(.9*v*y),y:0,fade:M}),be=Zt({id:t,colors:ae,alpha:ie?.9:.7,sw:ne(1.15*b),sh:re(1.5*b*x),y:0,fade:Math.min(95,M+2)}),z=(e,n,r,i=0)=>`radial-gradient(ellipse calc(${N(e*E)}px * var(--vb-w-${t}) * var(--vb-mw-${t}) * ${P}) calc((${N(n*ee)}px * var(--vb-h-${t}) + var(--vb-bh-${t})) * ${P}) at ${he} calc(100% + var(--vb-cy-${t}) * ${P}), white 0%, rgba(255, 255, 255, 0.5) ${r}%${i>0?`, rgba(255, 255, 255, ${i}) 85%`:``}, transparent 100%)`,B=(e,n)=>`opacity: calc(var(--vb-opacity-${t}, 1) * var(--vb-glow-${t}) * ${n} * var(--voice-${e}-opacity, 1) * var(--voice-strength, 1));`,xe=(e,t,r,i)=>`${e} {
3
- ${t}
4
- position: absolute;
5
- inset: 0;
6
- border-radius: ${F(n)};
7
- background: ${ye};
8
- box-shadow: inset 0 0 ${F(A)} 1px ${s};
9
- -webkit-mask-image:
10
- ${z(170,64,45,.3)},
11
- linear-gradient(white, transparent ${F(k)}, transparent calc(100% - ${k}px * ${P}), white),
12
- linear-gradient(to right, white, transparent ${F(k)}, transparent calc(100% - ${k}px * ${P}), white);
13
- -webkit-mask-composite: source-in, source-over;
14
- mask-image:
15
- ${z(170,64,45,.3)},
16
- linear-gradient(white, transparent ${F(k)}, transparent calc(100% - ${k}px * ${P}), white),
17
- linear-gradient(to right, white, transparent ${F(k)}, transparent calc(100% - ${k}px * ${P}), white);
18
- mask-composite: intersect, add;
19
- pointer-events: none;
20
- /* Its own compositing layer: WebKit otherwise re-rasterizes the
21
- filtered layer into the parent every frame on the CPU (a phone-sized
22
- host runs at a sixth of the frame rate without this). */
23
- will-change: transform;
24
- z-index: 1;
25
- ${r}
26
- ${B(`inner`,L)}
27
- ${i}
28
- }`;return`
29
- @property --vb-opacity-${t} {
30
- syntax: "<number>";
31
- initial-value: 0;
32
- inherits: true;
33
- }
34
-
35
- [data-voice-beam="${t}"] {
36
- position: relative;
37
- border-radius: ${n}px;
38
- overflow: hidden;
39
- --vb-h-${t}: 0.8;
40
- --vb-w-${t}: 1;
41
- ${Kt.map((e,n)=>` --vb-x${n}-${t}: ${e.x}px;
42
- --vb-l${n}-${t}: 1;
43
- --vb-y${n}-${t}: 0px;`).join(`
44
- `)}
45
- --vb-glow-${t}: 0.4;
46
- --vb-z-${t}: 1;
47
- --vb-cx-${t}: 0px;
48
- --vb-cy-${t}: 0px;
49
- --vb-bh-${t}: 0px;
50
- --vb-bendA-${t}: 0;
51
- --vb-mw-${t}: 1;
52
- --vb-hue-${t}: 0deg;
53
- --vb-level-${t}: 0;
54
- }
55
-
56
- [data-voice-beam="${t}"][data-active] {
57
- animation: vb-fade-in-${t} 0.6s ease forwards;
58
- }
59
-
60
- [data-voice-beam="${t}"][data-fading] {
61
- animation: vb-fade-out-${t} 0.5s ease forwards;
62
- }
63
-
64
- /* Stroke — the colours painted into the 1px edge ring, masked to the centred ellipse. */
65
- [data-voice-beam="${t}"][data-active]::after,
66
- [data-voice-beam="${t}"][data-fading]::after {
67
- content: "";
68
- position: absolute;
69
- inset: 0;
70
- border-radius: ${F(j)};
71
- padding: ${F(r)};
72
- clip-path: inset(0 round ${F(n)});
73
- background:
74
- ${_e},
75
- ${ve};
76
- -webkit-mask:
77
- ${z(170,64,45)},
78
- linear-gradient(#fff 0 0) content-box,
79
- linear-gradient(#fff 0 0);
80
- -webkit-mask-composite: source-in, xor;
81
- mask:
82
- ${z(170,64,45)},
83
- linear-gradient(#fff 0 0) content-box,
84
- linear-gradient(#fff 0 0);
85
- mask-composite: intersect, exclude;
86
- pointer-events: none;
87
- /* Its own compositing layer: WebKit otherwise re-rasterizes the
88
- filtered layer into the parent every frame on the CPU (a phone-sized
89
- host runs at a sixth of the frame rate without this). */
90
- will-change: transform;
91
- z-index: 2;
92
- ${B(`stroke`,I)}
93
- ${de}
94
- }
95
-
96
- /* Inner glow — soft light inside the element, faded off at the corners.
97
- With distortion on, this copy is clipped to ABOVE the band line (the
98
- polygon the driver writes each frame) and a mirror layer below carries
99
- the displacement filter, so only the glow under the line warps. */
100
- ${xe(`[data-voice-beam="${t}"][data-active]::before,
101
- [data-voice-beam="${t}"][data-fading]::before`,`content: "";`,D?`clip-path: var(--vb-clip-above-${t}, inset(0 round ${n}px));`:`clip-path: inset(0 round ${n}px);`,de)}
102
- ${D?xe(`[data-voice-beam="${t}"][data-active] [data-voice-beam-warp="inner"],
103
- [data-voice-beam="${t}"][data-fading] [data-voice-beam-warp="inner"]`,`display: block;`,`clip-path: var(--vb-clip-below-${t}, inset(0 round ${n}px));`,fe):``}
104
-
105
- /* Bloom — the blurred halo, tallest of the three, above the content. */
106
- [data-voice-beam="${t}"] [data-voice-beam-bloom],
107
- [data-voice-beam="${t}"] [data-voice-beam-warp] {
108
- display: none;
109
- position: absolute;
110
- inset: 0;
111
- border-radius: ${F(j)};
112
- pointer-events: none;
113
- /* Its own compositing layer: WebKit otherwise re-rasterizes the
114
- filtered layer into the parent every frame on the CPU (a phone-sized
115
- host runs at a sixth of the frame rate without this). */
116
- will-change: transform;
117
- opacity: 0;
118
- }
119
-
120
- [data-voice-beam="${t}"] [data-voice-beam-bloom],
121
- [data-voice-beam="${t}"] [data-voice-beam-warp="bloom"] {
122
- -webkit-mask: ${z(200,130,35)};
123
- mask: ${z(200,130,35)};
124
- background: ${be};
125
- z-index: 3;
126
- }
127
-
128
- [data-voice-beam="${t}"][data-active] [data-voice-beam-bloom],
129
- [data-voice-beam="${t}"][data-fading] [data-voice-beam-bloom] {
130
- display: block;
131
- clip-path: ${D?`var(--vb-clip-above-${t}, inset(0 round ${n}px))`:`inset(0 round ${n}px)`};
132
- ${B(`bloom`,se)}
133
- ${pe}
134
- }
135
- ${D?`
136
- [data-voice-beam="${t}"][data-active] [data-voice-beam-warp="bloom"],
137
- [data-voice-beam="${t}"][data-fading] [data-voice-beam-warp="bloom"] {
138
- display: block;
139
- clip-path: var(--vb-clip-below-${t}, inset(0 round ${n}px));
140
- ${B(`bloom`,se)}
141
- ${me}
142
- }
143
-
144
- /* Processing drops the distortion: the driver marks the wrapper once the
145
- warp has faded out, the warp layers leave the paint and the base layers
146
- give up their split at the band line. */
147
- [data-voice-beam="${t}"][data-voice-warp="off"]::before,
148
- [data-voice-beam="${t}"][data-voice-warp="off"] [data-voice-beam-bloom] {
149
- clip-path: inset(0 round ${n}px);
150
- }
151
-
152
- [data-voice-beam="${t}"][data-voice-warp="off"] [data-voice-beam-warp] {
153
- display: none;
154
- }`:``}
155
-
156
- /* Epicentre — a soft white wash at the source, under the band line (the
157
- driver's clip; unclipped when no line is drawn), sitting above every
158
- glow layer and the band's halo so the centre reads lighter than the
159
- band (same z as the band canvases, painted after them). Sized by the voice like the
160
- other layers; off unless \`coreLight\` is set (the light theme sets it).
161
- Up to 1 it is the wash's opacity; past 1 the solid white core widens
162
- too, for a centre that stays lighter than a strong band. It follows the
163
- glow's presence but not \`strength\`, which would only dim it. */
164
- ${C>0?(()=>{let e=Math.max(0,Math.min(2,C-1)),n=Math.min(1,e),r=Math.max(0,e-1),i=1+.3*e,a=N(45*n+27*r),o=N(40+25*n+15*r),s=Math.min(1,.55+.35*n+.1*r).toFixed(2),c=N(72+14*n+8*r);return`[data-voice-beam="${t}"] [data-voice-beam-core] {
165
- display: none;
166
- position: absolute;
167
- inset: 0;
168
- border-radius: ${F(j)};
169
- overflow: hidden;
170
- pointer-events: none;
171
- /* Its own compositing layer: WebKit otherwise re-rasterizes the
172
- filtered layer into the parent every frame on the CPU (a phone-sized
173
- host runs at a sixth of the frame rate without this). */
174
- will-change: transform;
175
- /* The blur sits on this wrapper and the band-line clip on the child,
176
- so the cut edge is blurred too rather than left hard. */
177
- filter: blur(${F(Yt(8,m))});
178
- z-index: 4;
179
- }
180
-
181
- [data-voice-beam="${t}"] [data-voice-beam-core] > div {
182
- position: absolute;
183
- inset: 0;
184
- background: radial-gradient(ellipse calc(${N(120*w*i*O)}px * var(--vb-w-${t}) * ${P}) calc((${N(70*T*i*O)}px * var(--vb-h-${t}) + var(--vb-bh-${t})) * ${P}) at ${he} calc(100% + var(--vb-cy-${t}) * ${P}), white 0%, white ${a}%, rgba(255, 255, 255, ${s}) ${o}%, transparent ${c}%);
185
- clip-path: var(--vb-clip-below-${t}, none);
186
- }
187
-
188
- [data-voice-beam="${t}"][data-active] [data-voice-beam-core],
189
- [data-voice-beam="${t}"][data-fading] [data-voice-beam-core] {
190
- display: block;
191
- opacity: calc(var(--vb-opacity-${t}, 1) * min(1, var(--vb-glow-${t}) * ${Math.min(1,C).toFixed(2)} * ${(1.6+1.4*e).toFixed(2)}) * var(--voice-core-light-opacity, 1));
192
- }
193
- `})():``}
194
- /* Band — the canvas the driver draws the bend's contour on: an organic
195
- bell with chromatic fringes. Fades with the root, follows the strength
196
- and turns with the hue drift like the other layers. */
197
- [data-voice-beam="${t}"] [data-voice-beam-band],
198
- [data-voice-beam="${t}"] [data-voice-beam-band-halo] {
199
- display: none;
200
- position: absolute;
201
- inset: 0;
202
- width: 100%;
203
- height: 100%;
204
- pointer-events: none;
205
- /* Its own compositing layer: WebKit otherwise re-rasterizes the
206
- filtered layer into the parent every frame on the CPU (a phone-sized
207
- host runs at a sixth of the frame rate without this). */
208
- will-change: transform;
209
- z-index: 4;
210
- }
211
-
212
- [data-voice-beam="${t}"][data-active] [data-voice-beam-band],
213
- [data-voice-beam="${t}"][data-fading] [data-voice-beam-band],
214
- [data-voice-beam="${t}"][data-active] [data-voice-beam-band-halo],
215
- [data-voice-beam="${t}"][data-fading] [data-voice-beam-band-halo] {
216
- display: block;
217
- opacity: calc(var(--vb-opacity-${t}, 1) * var(--voice-band-opacity, 1) * var(--voice-strength, 1));
218
- /* The blur vars are 0 where the canvas blurs its own strokes; where the
219
- 2D context has no filter (WebKit) the driver sets them and the layers
220
- are blurred here instead — the ridge on the band canvas, its wider
221
- halo on the canvas beneath. */
222
- filter: blur(var(--vb-band-blur-${t}, 0px)) ${le} brightness(${R}) saturate(${ce});
223
- }
224
-
225
- [data-voice-beam="${t}"][data-active] [data-voice-beam-band-halo],
226
- [data-voice-beam="${t}"][data-fading] [data-voice-beam-band-halo] {
227
- filter: blur(var(--vb-band-halo-blur-${t}, 0px)) ${le} brightness(${R}) saturate(${ce});
228
- }
229
-
230
- /* Resolution. The soft layers — inner light and its warp mirror, bloom and
231
- its mirror, the epicentre — are rastered at half size and scaled back
232
- up by the compositor: the box is halved, every length inside rides the
233
- layer's factor \`--vb-z\` at 0.5 (the driver also writes the band-line
234
- clips at half scale), and the will-change transform is rastered
235
- pre-scale where the engine does that (Chromium, Safari 18). For blurred
236
- gradients that is the same picture at a quarter of the raster and
237
- filter work, which is what a phone at 3x runs out of. The 1px stroke
238
- stays full-res on every screen: at half size it is half a CSS pixel,
239
- which a 3x phone rasters into a faint smear instead of the hairline,
240
- and the layer is cheap (no blur). The component sets
241
- \`data-voice-halfres\`. */
242
- [data-voice-beam="${t}"][data-voice-halfres]::before,
243
- [data-voice-beam="${t}"][data-voice-halfres] [data-voice-beam-warp],
244
- [data-voice-beam="${t}"][data-voice-halfres] [data-voice-beam-bloom],
245
- [data-voice-beam="${t}"][data-voice-halfres] [data-voice-beam-core] {
246
- --vb-z-${t}: 0.5;
247
- inset: auto;
248
- left: 0;
249
- top: 0;
250
- width: 50%;
251
- height: 50%;
252
- transform: translateZ(0) scale(2);
253
- transform-origin: 0 0;
254
- }
255
- ${D?`[data-voice-beam="${t}"][data-voice-halfres][data-active]::before,
256
- [data-voice-beam="${t}"][data-voice-halfres][data-fading]::before,
257
- [data-voice-beam="${t}"][data-voice-halfres][data-active] [data-voice-beam-bloom],
258
- [data-voice-beam="${t}"][data-voice-halfres][data-fading] [data-voice-beam-bloom] {
259
- clip-path: var(--vb-clip-above-z-${t}, inset(0 round ${F(n)}));
260
- }
261
- [data-voice-beam="${t}"][data-voice-halfres][data-active] [data-voice-beam-warp],
262
- [data-voice-beam="${t}"][data-voice-halfres][data-fading] [data-voice-beam-warp] {
263
- clip-path: var(--vb-clip-below-z-${t}, inset(0 round ${F(n)}));
264
- }
265
- /* Processing (warp off): the mirrors are gone, so the base layers paint
266
- the whole box again — this must outweigh the split above. */
267
- [data-voice-beam="${t}"][data-voice-halfres][data-voice-warp="off"]::before,
268
- [data-voice-beam="${t}"][data-voice-halfres][data-voice-warp="off"] [data-voice-beam-bloom] {
269
- clip-path: inset(0 round ${F(n)});
270
- }`:`[data-voice-beam="${t}"][data-voice-halfres][data-active]::before,
271
- [data-voice-beam="${t}"][data-voice-halfres][data-fading]::before,
272
- [data-voice-beam="${t}"][data-voice-halfres][data-active] [data-voice-beam-bloom],
273
- [data-voice-beam="${t}"][data-voice-halfres][data-fading] [data-voice-beam-bloom] {
274
- clip-path: inset(0 round ${F(n)});
275
- }`}
276
- [data-voice-beam="${t}"][data-voice-halfres] [data-voice-beam-core] > div {
277
- clip-path: var(--vb-clip-below-z-${t}, none);
278
- }
279
- @keyframes vb-fade-in-${t} {
280
- to { --vb-opacity-${t}: 1; }
281
- }
282
-
283
- @keyframes vb-fade-out-${t} {
284
- from { --vb-opacity-${t}: 1; }
285
- to { --vb-opacity-${t}: 0; }
286
- }
287
-
288
- [data-voice-beam="${t}"][data-paused],
289
- [data-voice-beam="${t}"][data-paused]::after,
290
- [data-voice-beam="${t}"][data-paused]::before,
291
- [data-voice-beam="${t}"][data-paused] [data-voice-beam-bloom] {
292
- animation-play-state: paused !important;
293
- }
294
- `}let $t=null;function en(){if(typeof window>`u`)return null;let e=window;return e.AudioContext??e.webkitAudioContext??null}function tn(){let e=en();return e?($t||=new e,$t.state===`suspended`&&$t.resume().catch(()=>{}),$t):null}const nn=new WeakMap;function rn(e){let t=tn();if(!t||e.getAudioTracks().length===0)return null;let n=nn.get(e);n||(n={node:t.createMediaStreamSource(e),refs:0},nn.set(e,n)),n.refs+=1;let r=t.createAnalyser();r.fftSize=1024,r.smoothingTimeConstant=.5,n.node.connect(r);let i=!1;return{analyser:r,release:()=>{if(!i){i=!0;try{n.node.disconnect(r)}catch{}if(--n.refs,n.refs<=0){try{n.node.disconnect()}catch{}nn.delete(e)}}}}}const an=new WeakMap;function on(e){let t=an.get(e);return t||(t={level:0,bands:[0,0,0],phase:0,scanA:0,scanT:0,t:0,lastTs:0,warp:1},an.set(e,t)),t}const sn=new Set;let cn=null,ln=0,un=0,dn=!1,fn=!1,pn=0,mn=0;const hn=Math.PI*2,gn=[[80,300],[300,2e3],[2e3,6e3]];function _n(e){return e<0?0:e>1?1:e}function vn(e,t){let n=t/2;return((e+n)%t+t)%t-n}function yn(e,t){let n=e/(t/2+4);return Math.max(0,1-n*n)}function bn(e,t){if(e<=t)return 0;let n=(e-t)/Math.max(.001,1-t);return _n((1-Math.exp(-3*n))/(1-Math.exp(-3)))}function xn(e,t,n,r,i){let a=t>e?r:i,o=1-Math.exp(-n/Math.max(.001,a));return e+(t-e)*o}const Sn=!(typeof navigator<`u`&&/AppleWebKit/.test(navigator.userAgent)&&!/Chrome\/|Chromium\/|Edg\/|OPR\//.test(navigator.userAgent)),Cn=.05,wn=.1;function Tn(e,t,n,r){let i=e<0?1-r:1+r,a=Math.max(.05,n*i),o=Math.exp(-((Math.abs(e)/a)**+t)),s=Math.exp(-((1/a)**t));return Math.max(0,(o-s)/(1-s))}function En(e,t,n,r,i){if(n<=0||t<=0)return 0;let a=t*Math.max(0,Math.min(.98,r));return e<=a?0:n*Math.min(1,(e-a)/Math.max(1,t-a))**+Math.max(.5,i)}function Dn(e,t,n){return Math.max(0,Math.min(e,t/2,n/2))}function On(e,t,n,r=0){if(n<=0)return 0;let i=Math.min(e,t-e)-r;if(i>=n)return 0;if(i<=0)return n;let a=n-i;return n-Math.sqrt(Math.max(0,n*n-a*a))}function kn(e,t,n,r){let i=n/2+t.cx*t.w,a=170*e.rangeWidth*t.w*t.mw,o=r*.82*Math.min(1,e.scale),s=Math.min(o,(64*e.rangeHeight*t.h+t.lift)*e.bandPosition),c=r-e.bandOffset,l=Math.min(1,t.corner*4),u=e.bandTail*(1-l*l*(3-2*l)),d=u>.001,f=d?e.bandTailOverflow:0,p=d?-f:i-a,m=d?n+f:i+a,h=[];for(let o=0;o<=56;o++){let l=p+(m-p)*o/56,d=Math.max(-1,Math.min(1,(l-i)/Math.max(1,a))),g=(l<i?i:n-i)+f,_=Tn(d,e.bandCurve,e.bandSpread,e.bandSkew)+En(Math.abs(l-i),g,u,e.bandTailPosition,e.bandTailCurve),v=t.corner>0?On(l,n,Dn(e.radius,n,r))*t.corner:0;h.push([l,c-s*_-v])}return h}function An(e,t,n,r,i){for(let[a,o]of[[``,1],[`-z`,.5]]){let s=e=>(e*o).toFixed(1)+`px`,c=n.map(([e,t])=>`${s(e)} ${s(t)}`),l=`polygon(0 ${s(i)}, ${c.join(`, `)}, ${s(r)} ${s(i)})`,u=`polygon(0 0, ${s(r)} 0, ${s(r)} ${s(i)}, ${c.slice().reverse().join(`, `)}, 0 ${s(i)})`;e.style.setProperty(`--vb-clip-below${a}-${t}`,l),e.style.setProperty(`--vb-clip-above${a}-${t}`,u)}}function jn(e,t,n){let r=n;for(let e=0;e<t.length;e++)t[e][1]<r&&(r=t[e][1]);let i=Math.max(0,Math.min(.9,Math.floor((r-6)/n/Cn)*Cn));if(i===e.filterTop)return;e.filterTop=i;let a=1+Math.max(.1,12/n),o=e.filter;o.setAttribute(`x`,`${-wn*100}%`),o.setAttribute(`width`,`${(1+2*wn)*100}%`),o.setAttribute(`y`,`${(i*100).toFixed(0)}%`),o.setAttribute(`height`,`${((a-i)*100).toFixed(1)}%`)}function Mn(e,t,n){let{canvas:r,ctx:i,el:a,config:o}=e;if(!r||!i)return;let s=a.clientWidth,c=a.clientHeight;if(!s||!c)return;let l=Math.min(2,typeof window<`u`&&window.devicePixelRatio||1),u=Math.round(s*l),d=Math.round(c*l);(r.width!==u||r.height!==d)&&(r.width=u,r.height=d),i.setTransform(l,0,0,l,0,0),i.clearRect(0,0,s,c);let f=e.haloCanvas,p=e.haloCtx;f&&p&&((f.width!==u||f.height!==d)&&(f.width=u,f.height=d),p.setTransform(l,0,0,l,0,0),p.clearRect(0,0,s,c));let m=Math.min(1,.6*o.bandStrength*t.strength);if(m<.005||o.bandWidth<=0)return;let h=o.theme===`dark`,g=o.bandWidth*(1+.35*t.level),_=o.bandAberration*(.35+.65*t.level),v=(4+12*_)*o.scale,y=4*_*o.scale,b=(e,t)=>{i.beginPath(),i.moveTo(n[0][0]+e,n[0][1]+t);for(let r=1;r<n.length;r++)i.lineTo(n[r][0]+e,n[r][1]+t)},x={r:o.bandColors.above,g:o.bandColors.mid,c:o.bandColors.core,b:o.bandColors.below},S=(h?.42:.4)*m,C=14*g,w=3.5*o.bandWidth/2,T=w*l,E=typeof i.filter==`string`,ee=E?`0px`:`${w.toFixed(2)}px`;e.cssBlur!==ee&&(a.style.setProperty(`--vb-band-blur-${o.id}`,ee),a.style.setProperty(`--vb-band-halo-blur-${o.id}`,E?`0px`:`${(w*3).toFixed(2)}px`),e.cssBlur=ee);let te=[[1,.16],[.72,.2],[.46,.26],[.22,.34]],D=[{rgb:x.r,a:1,ox:y,oy:-v},{rgb:x.g,a:.55,ox:y*.35,oy:-v*.35},{rgb:x.b,a:1,ox:-y,oy:v},{rgb:x.c,a:.9,ox:0,oy:0}];i.lineCap=`round`,i.lineJoin=`round`,i.globalCompositeOperation=`source-over`;let O=n[0][0],k=n[n.length-1][0],A=(e,t)=>{let n=i.createLinearGradient(O,0,k,0),r=o.bandTail>0?.015:.18;return n.addColorStop(0,`rgba(${e}, 0)`),n.addColorStop(r,`rgba(${e}, ${t.toFixed(3)})`),n.addColorStop(1-r,`rgba(${e}, ${t.toFixed(3)})`),n.addColorStop(1,`rgba(${e}, 0)`),n},j=!E&&p?p:i;E&&(i.filter=`blur(${(T*3).toFixed(1)}px)`),j.lineCap=`round`,j.lineJoin=`round`,j.strokeStyle=A(x.c,S*.3),j.lineWidth=C*2.2,j.beginPath(),j.moveTo(n[0][0],n[0][1]);for(let e=1;e<n.length;e++)j.lineTo(n[e][0],n[e][1]);j.stroke(),E&&(i.filter=`blur(${T.toFixed(1)}px)`);for(let e of D)for(let[t,n]of te)i.strokeStyle=A(e.rgb,S*e.a*n),i.lineWidth=Math.max(.6,C*t),b(e.ox,e.oy),i.stroke();E&&(i.filter=`none`),i.globalCompositeOperation=`source-over`}function Nn(e){return(1-Math.cos(hn*e))/2}function Pn(e,t){let n=e.analyser,r=e.time,i=e.freq;n.getFloatTimeDomainData(r);let a=0;for(let e=0;e<r.length;e++)a+=r[e]*r[e];t.level=Math.sqrt(a/r.length)*5*e.config.sensitivity,n.getByteFrequencyData(i);let o=n.context.sampleRate/n.fftSize;for(let n=0;n<3;n++){let[r,a]=gn[n],s=Math.max(0,Math.floor(r/o)),c=Math.min(i.length-1,Math.ceil(a/o)),l=0;for(let e=s;e<=c;e++)l+=i[e];let u=c>=s?l/(c-s+1)/255:0;t.bands[n]=u*1.7*e.config.sensitivity}}const Fn={level:0,bands:[0,0,0]};function In(e){cn=requestAnimationFrame(In);let t=un?e-un:0;if(un=e,dn){if(fn=!fn,fn)return;e>=mn&&(dn=!1,pn=0)}else t>22?pn?e-pn>500&&(dn=!0,fn=!1,mn=e+4e3):pn=e:pn=0;e-ln<14.666666666666668||(ln=e,sn.forEach(t=>{var n;let{el:r,config:i,source:a,s:o}=t,s=i.paused;if(s&&t.paintedConfig===i)return;let c=s?0:o.lastTs?Math.min(.05,(e-o.lastTs)/1e3):1/60;o.lastTs=e,o.t+=c;let l=o.t;if(!s)if(t.analyser)Pn(t,Fn);else{let e=a.getLevel?_n(a.getLevel()):0;Fn.level=e,Fn.bands[0]=e,Fn.bands[1]=e*(.72+.28*Math.sin(l*9.1)),Fn.bands[2]=e*(.6+.4*Math.sin(l*13.7+2))}let u=bn(Fn.level,i.threshold);o.level=xn(o.level,u,c,i.attack,i.release);for(let e=0;e<3;e++){let t=bn(Fn.bands[e],i.threshold*.6);o.bands[e]=xn(o.bands[e],t,c,i.attack,i.release*1.15)}let d=qt*i.lobeSpacing;i.processing&&o.scanA<.001&&o.scanT===0&&(o.scanT=Math.max(.05,i.processingDuration)/2);let f=Math.max(.05,i.processingEase);o.scanA=xn(o.scanA,i.processing?1:0,c,f*.9,f*.8),i.processing?o.scanT+=c:o.scanA<.001&&(o.scanT=0);let p=o.scanA*o.scanA*(3-2*o.scanA),m=r.clientWidth,h=r.clientHeight,g=d/2*i.processingTravel,_=o.scanT/Math.max(.05,i.processingDuration),v=Math.floor(_),y=_-v,b=Math.max(1,i.processingCurve),x=y<.5?.5*(2*y)**b:1-.5*(2-2*y)**b,S=i.reducedMotion?0:v%2==0?2*x-1:1-2*x,C=p*g*S,w=1-p*.6,T=1-p*.45,E=1+p*.3*(1-S*S),ee=i.reducedMotion?.5:.5+.5*Math.sin(hn*l/i.breatheDuration),te=o.level+(1-o.level)*i.idle*ee,D=Math.max(0,Math.min(1,(p-.25)/.75)),O=D*D*(3-2*D),k=Math.max(te,i.processingLevel*O),A=.15+.85*k,j=.5+i.reach*k,M=(.85+i.spread*k)*E;i.flow!==0&&!i.reducedMotion&&(o.phase=((o.phase+i.flow*k*c)%d+d)%d),r.style.setProperty(`--vb-level-${i.id}`,o.level.toFixed(3)),r.style.setProperty(`--vb-cx-${i.id}`,`${C.toFixed(1)}px`),r.style.setProperty(`--vb-mw-${i.id}`,T.toFixed(3));let ne=i.bend*k;r.style.setProperty(`--vb-bh-${i.id}`,`${Math.max(0,ne).toFixed(1)}px`);let re=i.bend>0?Math.min(1,ne/i.bend):0;r.style.setProperty(`--vb-bendA-${i.id}`,re.toFixed(3));let N={cx:C,w:M,h:j,mw:T,lift:ne,strength:re,level:o.level,corner:p},P=m/2+C*M,F=30*i.scale*M,ie=Dn(i.radius,m,h),ae=p*i.cornerFollow;r.style.setProperty(`--vb-cy-${i.id}`,`${(-On(P,m,ie,F*1.4)*ae).toFixed(1)}px`),o.warp=xn(o.warp,i.processing?0:1,c,.35,.06);let oe=o.warp,I=t.displace!=null&&oe<.03;if(I!==t.warpOff&&(t.warpOff=I,I?r.setAttribute(`data-voice-warp`,`off`):r.removeAttribute(`data-voice-warp`)),m&&h&&(t.ctx||t.displace)){let e=kn(i,N,m,h);(t.displace&&!I||i.coreLight>0)&&An(r,i.id,e,m,h),t.filter&&!I&&Sn&&jn(t,e,h),t.ctx&&Mn(t,N,e)}if(t.displace&&!I){let e=i.reducedMotion?0:i.distortion*120*i.scale*(.15+.85*k)*oe;t.displace.scale.baseVal=e,t.noiseShift&&(t.noiseShift.dx.baseVal=8*i.scale*Math.sin(l*.9),t.noiseShift.dy.baseVal=4*i.scale*Math.sin(l*.6+1.3))}r.style.setProperty(`--vb-glow-${i.id}`,A.toFixed(3)),r.style.setProperty(`--vb-h-${i.id}`,j.toFixed(3)),r.style.setProperty(`--vb-w-${i.id}`,M.toFixed(3));for(let e=0;e<Kt.length;e++){let t=Kt[e],n=vn(t.x*i.lobeSpacing+o.phase,d),a=i.bands?.6+.7*o.bands[t.band]:1;r.style.setProperty(`--vb-x${e}-${i.id}`,`${(n*w).toFixed(1)}px`),r.style.setProperty(`--vb-l${e}-${i.id}`,(a*yn(n,d)).toFixed(3));let s=m/2+(C+n*w)*M;r.style.setProperty(`--vb-y${e}-${i.id}`,`${(-On(s,m,ie,F)*ae).toFixed(1)}px`)}let L=i.staticColors||i.reducedMotion||i.hueRange===0?0:-i.hueRange+2*i.hueRange*Nn(l/i.hueDuration);r.style.setProperty(`--vb-hue-${i.id}`,`${L.toFixed(2)}deg`),(n=t.onLevel)==null||n.call(t,o.level),t.paintedConfig=i}))}function Ln(){cn??=(ln=0,un=0,pn=0,requestAnimationFrame(In))}function Rn(){sn.size===0&&cn!=null&&(cancelAnimationFrame(cn),cn=null)}function zn(e,t,n,r){let i={el:e,config:t,source:n,onLevel:r,analyser:null,releaseAnalyser:null,time:null,freq:null,canvas:null,ctx:null,haloCanvas:null,haloCtx:null,displace:null,noiseShift:null,filter:null,filterTop:-1,s:on(e),paintedConfig:null,cssBlur:null,warpOff:e.hasAttribute(`data-voice-warp`)};t.distortion>0&&(i.displace=e.querySelector(`:scope > svg feDisplacementMap`),i.noiseShift=e.querySelector(`:scope > svg feOffset`),i.filter=e.querySelector(`:scope > svg filter`));let a=e.querySelector(`:scope > [data-voice-beam-band]`);if(a){i.canvas=a,i.ctx=a.getContext(`2d`);let t=e.querySelector(`:scope > [data-voice-beam-band-halo]`);t&&(i.haloCanvas=t,i.haloCtx=t.getContext(`2d`))}if(i.s.lastTs=0,n.stream){let e=rn(n.stream);e&&(i.analyser=e.analyser,i.releaseAnalyser=e.release,i.time=new Float32Array(e.analyser.fftSize),i.freq=new Uint8Array(e.analyser.frequencyBinCount))}return sn.add(i),Ln(),()=>{var e;sn.delete(i),(e=i.releaseAnalyser)==null||e.call(i),Rn()}}const Bn={scale:1,glowSize:1,processingDuration:1.1,processingLevel:.55,processingTravel:1.55,processingCurve:2.1,cornerFollow:.45,strokeOpacity:1,innerOpacity:1,bloomOpacity:1,idle:.18,reach:1.2,spread:1.05,flow:48,bend:60,bandStrength:1.55,bandWidth:2.15,bandPosition:.35,bandCurve:1.75,bandSpread:.87,bandSkew:.12,bandOffset:-27,bandTail:.59,bandTailPosition:.67,bandTailCurve:2.4,bandTailOverflow:15,bandAberration:.89,distortion:.62,distortionDetail:2.3,glowWidth:.65,glowHeight:1.25,lobeSpacing:.85,rangeWidth:.75,rangeHeight:1,softness:1.07,coreSize:1,coreLight:0,coreLightWidth:1,coreLightHeight:1,strokeScale:1,innerScale:1,innerHeight:1,bloomScale:1,bloomHeight:1},Vn={default:{},pill:{scale:.45,glowSize:.95,strokeOpacity:1.2,innerOpacity:.85,reach:1.35,spread:1.1,flow:0,bend:23,bandStrength:1.55,bandWidth:1.85,bandCurve:1.95,bandSpread:.38,bandOffset:-16,bandTail:0,processingTravel:2,cornerFollow:0,distortion:.45,distortionDetail:3,glowWidth:.65,glowHeight:.95,lobeSpacing:.45,rangeWidth:.8,rangeHeight:.7,softness:.88,coreSize:.25,strokeScale:1.25,innerScale:.95,bloomScale:1.05,bloomHeight:2.25},mobile:{scale:1.25,spread:.45,reach:3,flow:60,bend:70,bandWidth:2.4,bandCurve:1.55,bandSpread:.9,bandOffset:-50,bandTail:.62,bandTailPosition:.42,bandTailCurve:2.7,bandTailOverflow:22,processingDuration:1.05,processingLevel:.35,processingTravel:1,cornerFollow:.4,bandStrength:1.8,distortionDetail:2,glowWidth:1.15,glowHeight:2.1,lobeSpacing:1.35,rangeWidth:1.25,rangeHeight:1.2,softness:1.1}},Hn={default:{brightness:1.15},pill:{brightness:1.35,saturation:1.5},mobile:{strength:1,brightness:1.2,saturation:1.5}},Un={default:{},pill:{},mobile:{strength:1}};function Wn(e=`default`,t=`dark`){return(t===`light`?Un[e]:void 0)??Hn[e]}const Gn={default:{bandStrength:1.7},pill:{bandStrength:2},mobile:{bandStrength:1.7}};function Kn(e=`default`,t=`dark`){let n=Vn[e],r={};return t===`light`&&(n.reach===void 0&&(r.reach=1.8),n.spread===void 0&&(r.spread=.8),n.coreLight===void 0&&(r.coreLight=1.8)),{...Bn,...r,...n,...t===`light`?Gn[e]:void 0}}const qn={dark:{core:`255, 255, 255`,above:`255, 70, 80`,mid:`90, 255, 150`,below:`80, 140, 255`},light:{core:`197, 139, 255`,above:`255, 122, 182`,mid:`126, 196, 255`,below:`45, 255, 171`}},Jn=typeof navigator<`u`&&/AppleWebKit/.test(navigator.userAgent)&&!/Chrome\/|Chromium\/|Edg\/|OPR\//.test(navigator.userAgent),Yn=(()=>{if(typeof document>`u`)return!0;let e=document.createElement(`canvas`).getContext(`2d`);return!!e&&typeof e.filter==`string`})();function Xn(){let[e,t]=nt(()=>typeof window>`u`||window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`);return it(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=e=>t(e.matches?`dark`:`light`);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Zn(){let[e,t]=nt(()=>typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);return it(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Qn(e,t){return e===`auto`?t:e}const $n=xt(function({children:e,type:t=`default`,scale:n,stream:r=null,level:i=0,sensitivity:a=3.1,threshold:o=.015,attack:s=.325,release:c=.86,idle:l,breatheDuration:u=5.2,reach:d,spread:f,bands:p=!0,flow:m,processing:h=!1,processingDuration:g,processingLevel:_,processingTravel:v,processingCurve:y,cornerFollow:b,processingEase:x=.6,colorVariant:S=`colorful`,colors:C,bandColors:w,theme:T=`dark`,staticColors:E=!1,hueRange:ee,hueDuration:te,active:D=!0,paused:O=!1,borderRadius:k,brightness:A,saturation:j,glowSize:M,strokeOpacity:ne,innerOpacity:re,bloomOpacity:N,bend:P,bandStrength:F,bandWidth:ie,bandPosition:ae,bandCurve:oe,bandSpread:I,bandSkew:L,bandOffset:se,bandTail:R,bandTailPosition:ce,bandTailCurve:le,bandTailOverflow:ue,bandAberration:de,distortion:fe,distortionDetail:pe,glowWidth:me,glowHeight:he,lobeSpacing:ge,rangeWidth:_e,rangeHeight:ve,softness:ye,coreSize:be,coreLight:z,coreLightWidth:B,coreLightHeight:xe,strokeScale:Se,innerScale:Ce,innerHeight:V,bloomScale:Te,bloomHeight:Ee,strength:De,className:Oe,style:ke,css:Ae,onLevel:je,onActivate:Me,onDeactivate:Ne,onAnimationEnd:Pe,...Fe},Ie){let Le=ct().replace(/:/g,`-`),H=Qn(T,Xn()),Re=C?C.join(`|`):``,ze=w?[w.core,w.above,w.mid,w.below].join(`|`):``,U=Kn(t,H),W=Math.max(.05,n??U.scale),Be=M??U.glowSize,Ve=ne??U.strokeOpacity,He=re??U.innerOpacity,Ue=N??U.bloomOpacity,We=g??U.processingDuration,G=_??U.processingLevel,Ge=v??U.processingTravel,Ke=y??U.processingCurve,qe=b??U.cornerFollow,Je=l??U.idle,K=d??U.reach,Ye=f??U.spread,Xe=(m??U.flow)*W,Ze=(P??U.bend)*W,Qe=F??U.bandStrength,$e=(ie??U.bandWidth)*W,et=ae??U.bandPosition,tt=oe??U.bandCurve,rt=I??U.bandSpread,lt=L??U.bandSkew,ut=(se??U.bandOffset)*W,dt=R??U.bandTail,ft=ce??U.bandTailPosition,pt=le??U.bandTailCurve,mt=(ue??U.bandTailOverflow)*W,ht=de??U.bandAberration,gt=fe??U.distortion,_t=(pe??U.distortionDetail)/W,vt=(me??U.glowWidth)*W,yt=(he??U.glowHeight)*W,bt=(ge??U.lobeSpacing)*W,xt=(_e??U.rangeWidth)*W,St=(ve??U.rangeHeight)*W,Ct=ye??U.softness,wt=(be??U.coreSize)*W,Tt=Math.max(0,Math.min(3,z??U.coreLight)),Et=B??U.coreLightWidth,Dt=xe??U.coreLightHeight,Ot=Se??U.strokeScale,kt=Ce??U.innerScale,At=V??U.innerHeight,jt=Te??U.bloomScale,Mt=Ee??U.bloomHeight,Nt=Zn(),Pt=at(null),[Ft,It]=nt(D),[Lt,Rt]=nt(!1),[zt,Bt]=nt(!0),[Vt,Ht]=nt(null),[Ut,Kt]=nt(0);it(()=>{if(!Jn)return;let e=Pt.current;if(!e)return;let t=()=>Kt(e.clientWidth*e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let qt=Jn&&Ut>6e4?0:gt;it(()=>{if(k!=null)return;let e=Pt.current;if(!e)return;let t=()=>{let t=e.firstElementChild;if(!t)return;let n=getComputedStyle(t),r=parseFloat(n.borderTopLeftRadius);!isNaN(r)&&r>0&&Ht(r)};t();let n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!1}),()=>n.disconnect()},[k,e]),it(()=>{D&&!Ft&&!Lt?It(!0):!D&&Ft&&!Lt&&Rt(!0)},[D,Ft,Lt]),it(()=>{let e=Pt.current;if(!e||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(e=>{for(let t of e)Bt(t.isIntersecting)},{rootMargin:`256px`});return t.observe(e),()=>t.disconnect()},[]);let Jt=st(e=>{let t=e.animationName;t.includes(`fade-out`)?(It(!1),Rt(!1),Ne?.()):t.includes(`fade-in`)&&Me?.(),Pe?.(e)},[Me,Ne,Pe]),J=Gt[H],Yt=k??Vt??16,Xt=Wn(t,H),Zt=De??Xt.strength??J.strength??1,$t=ee??J.hueRange??24,en=te??J.hueDuration??12,tn=A??Xt.brightness??J.brightness,nn=j??Xt.saturation??J.saturation,rn=ot(()=>Qt({id:Le,borderRadius:Yt,borderWidth:1,strokeOpacity:J.strokeOpacity*Ve,innerOpacity:J.innerOpacity*He,bloomOpacity:J.bloomOpacity*Ue,innerShadow:J.innerShadow,colorVariant:S,colors:C,brightness:tn,saturation:nn,theme:H,hueBase:J.hueBase??0,glowSize:Be*W,glowWidth:vt,glowHeight:yt,strokeScale:Ot,innerScale:kt,innerHeight:At,bloomScale:jt,bloomHeight:Mt,coreSize:wt,coreLight:Tt,coreLightWidth:Et,coreLightHeight:Dt,rangeWidth:xt,rangeHeight:St,softness:Ct,distortion:qt>0,scale:W}),[Le,Yt,J,S,Re,tn,nn,H,U,Be,Ve,He,Ue,W,vt,yt,Ot,kt,At,jt,Mt,wt,Tt,Et,Dt,xt,St,Ct,qt>0]),an=ot(()=>({id:Le,sensitivity:Math.max(0,a),threshold:Math.max(0,Math.min(.95,o)),attack:Math.max(0,s),release:Math.max(0,c),idle:Math.max(0,Math.min(1,Je)),breatheDuration:Math.max(.2,u),reach:Math.max(0,K),spread:Math.max(0,Ye),bands:p,flow:Xe,lobeSpacing:Math.max(.1,bt),bend:Math.max(0,Ze),bandStrength:Math.max(0,Qe),bandWidth:Math.max(0,$e),bandPosition:Math.max(0,et),bandCurve:Math.max(.3,tt),bandSpread:Math.max(.05,rt),bandSkew:Math.max(-.9,Math.min(.9,lt)),bandOffset:ut,bandTail:Math.max(0,Math.min(1.5,dt)),bandTailPosition:Math.max(0,Math.min(.98,ft)),bandTailCurve:Math.max(.5,pt),bandTailOverflow:Math.max(0,mt),bandAberration:Math.max(0,Math.min(1,ht)),rangeWidth:xt,rangeHeight:St,theme:H,bandColors:{core:w?.core&&Wt(w.core)||qn[H].core,above:w?.above&&Wt(w.above)||qn[H].above,mid:w?.mid&&Wt(w.mid)||qn[H].mid,below:w?.below&&Wt(w.below)||qn[H].below},distortion:Math.max(0,Math.min(1,qt)),coreLight:Tt,scale:W,radius:Yt,processing:h,processingDuration:Math.max(.05,We),processingLevel:Math.max(0,Math.min(1,G)),processingEase:Math.max(.05,x),processingTravel:Math.max(0,Ge),processingCurve:Math.max(1,Ke),cornerFollow:Math.max(0,Math.min(1,qe)),hueRange:Math.max(0,$t),hueDuration:Math.max(.5,en),staticColors:S===`mono`?!0:E,reducedMotion:Nt,paused:O}),[Le,a,o,s,c,Je,u,K,Ye,p,Xe,bt,Ze,Qe,$e,et,tt,rt,lt,ut,dt,ft,pt,mt,ht,xt,St,H,ze,qt,Tt,W,Yt,h,We,G,x,Ge,Ke,qe,$t,en,E,S,Nt,O]),on=at(i);on.current=i;let sn=at(je);sn.current=je,it(()=>{if(!(Ft||Lt)||!zt)return;let e=Pt.current;return e?zn(e,an,{stream:r,getLevel:()=>{let e=on.current;return typeof e==`function`?e():e}},e=>sn.current?.call(sn,e)):void 0},[an,r,Ft,Lt,zt]);let cn=st(e=>{Pt.current=e,typeof Ie==`function`?Ie(e):Ie&&(Ie.current=e)},[Ie]),ln={...ke??{},"--voice-strength":Math.max(0,Math.min(1,Zt))};return q(we,{children:[q(`style`,{children:Ae?`${rn}
295
- ${Ae.split(`{id}`).join(Le)}`:rn}),q(`div`,{...Fe,ref:cn,"data-voice-beam":Le,"data-voice-type":t,"data-voice-halfres":``,"data-active":Ft&&!Lt?``:void 0,"data-fading":Lt?``:void 0,"data-paused":Ft&&!Lt&&(!zt||O)?``:void 0,"data-listening":r?``:void 0,"data-processing":h?``:void 0,className:Oe,style:ln,onAnimationEnd:Jt,children:[e,q(`div`,{"data-voice-beam-bloom":!0}),qt>0&&q(we,{children:[q(`div`,{"data-voice-beam-warp":`inner`}),q(`div`,{"data-voice-beam-warp":`bloom`})]}),!Yn&&q(`canvas`,{"data-voice-beam-band-halo":!0,"aria-hidden":`true`}),q(`canvas`,{"data-voice-beam-band":!0,"aria-hidden":`true`}),Tt>0&&q(`div`,{"data-voice-beam-core":!0,children:q(`div`,{})}),qt>0&&q(`svg`,{"aria-hidden":`true`,width:`0`,height:`0`,style:{position:`absolute`,pointerEvents:`none`},children:q(`filter`,{id:`vb-distort-${Le}`,x:`-20%`,y:`-20%`,width:`140%`,height:`140%`,colorInterpolationFilters:`sRGB`,children:[q(`feTurbulence`,{type:`fractalNoise`,baseFrequency:`${(.012*_t).toFixed(4)} ${(.05*_t).toFixed(4)}`,numOctaves:2,seed:7,result:`noise`}),q(`feOffset`,{in:`noise`,dx:`0`,dy:`0`,result:`moved`}),q(`feColorMatrix`,{in:`moved`,type:`matrix`,values:`1 0 0 0 0 0 0 0 0 0.5 0 0 0 0 0 0 0 0 0 1`,result:`map`}),q(`feDisplacementMap`,{in:`SourceGraphic`,in2:`map`,scale:0,xChannelSelector:`R`,yChannelSelector:`G`})]})})]})]})}),er=`http://www.w3.org/2000/svg`,Y=Math.PI*2,X=21.5,tr=Math.sqrt(12)*X,nr=154-tr,Z=gr(),rr=nr+Z.length,ir=.56*Y*X/2,ar=.75,or=.35,sr=.55,cr=22.5,lr=yr(.65,0,.35,1),ur=yr(.4,0,.2,1),dr=yr(.34,1.56,.64,1),fr=yr(.2,0,0,1);var pr=class{element;lines=[];ripple;track;middle;top;bottom;seal;check;motion=matchMedia(`(prefers-reduced-motion: reduce)`);phase=`idle`;stage={kind:`line`};settleSuccess=null;successBegun=null;frame=0;previousTime=0;position=0;target=0;level=0;stopped=!1;constructor(e,t=`ring`){this.checking=t,this.element=e.createElementNS(er,`svg`),this.element.classList.add(`seams-voiceid-ribbon`),this.element.setAttribute(`viewBox`,`0 0 308 64`),this.element.setAttribute(`aria-hidden`,`true`),this.ripple=this.append(e,`circle`,`1.5`),this.track=this.append(e,`circle`,`2`),this.middle=this.append(e,`path`,`1`),this.top=this.append(e,`path`,`2`),this.bottom=this.append(e,`path`,`2`),this.seal=this.append(e,`circle`,`0`),this.seal.setAttribute(`fill`,`currentColor`),this.seal.setAttribute(`stroke`,`none`),this.check=this.append(e,`path`,`2.6`),this.check.classList.add(`seams-voiceid-ribbon-check`),this.check.setAttribute(`d`,`M161 26.8 151.4 36.3 147.1 32`),this.check.setAttribute(`stroke-linejoin`,`round`),this.check.setAttribute(`pathLength`,`1`),this.check.setAttribute(`stroke-dasharray`,`1`);for(let e of[this.ripple,this.track,this.seal])e.setAttribute(`cx`,`154`),e.setAttribute(`cy`,`32`);if(this.track.setAttribute(`r`,`21.5`),t===`segments`){this.element.dataset.seamsProgressLine=``;for(let[e,t]of[this.top,this.middle,this.bottom].entries())t.dataset.seamsProgressSegment=String(e)}for(let t=3;t>=0;--t)this.lines.push(this.append(e,`path`,t===0?`1`:`0.65`));this.paint(performance.now())}readLevel=()=>this.level;setPhase(e){if(e===`processing`&&this.stage.kind===`line`){let e=Math.max(this.level,this.idleAmplitude(performance.now()));this.stage={kind:this.checking===`segments`?`segments`:`capture`,startedAt:performance.now(),amplitude:e}}else e!==`processing`&&(this.stage={kind:`line`},this.settle());this.phase=e,this.target=0,this.element.dataset.phase=e,this.wake()}succeed(e){if(this.stopped||this.stage.kind===`sealed`)return Promise.resolve();this.stage.kind===`line`&&this.setPhase(`processing`);let t=new Promise(this.awaitSuccess);return this.successBegun=e,this.stage.kind===`spin`&&this.beginSuccess(performance.now()),this.wake(),t}add(e){if(this.phase!==`listening`||this.stopped)return;let t=Math.max(0,e.rms-.003);this.target=(t/(t+.055))**.65*(e.speech?1:.15),this.element.dataset.speech=String(e.speech),this.wake()}dispose(){this.stopped=!0,cancelAnimationFrame(this.frame),this.frame=0,this.level=0,this.target=0,this.settle()}awaitSuccess=e=>{this.settle(),this.settleSuccess=e};settle(){let e=this.settleSuccess;this.settleSuccess=null,this.successBegun=null,e?.()}append(e,t,n){let r=e.createElementNS(er,t);return r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,n),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`vector-effect`,`non-scaling-stroke`),r.setAttribute(`opacity`,`0`),this.element.append(r),r}wake(){!this.stopped&&this.frame===0&&(this.previousTime=performance.now(),this.frame=requestAnimationFrame(this.draw))}draw=e=>{if(this.frame=0,this.stopped)return;let t=Math.min(50,Math.max(0,e-this.previousTime));this.previousTime=e,this.level+=(this.target-this.level)*(1-Math.exp(-t/(this.target>this.level?55:200))),this.motion.matches||(this.position+=t*(.0012+this.level*.003)),this.paint(e),!this.element.isConnected||this.stage.kind===`sealed`||this.stage.kind===`line`&&this.phase===`idle`&&this.level<=.001||(this.frame=requestAnimationFrame(this.draw))};idleAmplitude(e){return this.phase!==`listening`||this.motion.matches?0:.085*(.72+.28*Math.sin(e/2600*Y))}paint(e){for(let e of[this.ripple,this.track,this.middle,this.top,this.bottom,this.seal,this.check])e.setAttribute(`opacity`,`0`);for(let e of this.lines)e.setAttribute(`opacity`,`0`);switch(this.stage.kind){case`line`:this.paintLine(Math.max(this.level,this.idleAmplitude(e)));return;case`capture`:this.paintCapture(e,this.stage);return;case`segments`:this.paintSegments(e,this.stage);return;case`spin`:this.paintArc(this.spinnerArc(e,this.stage),1);return;case`success`:this.paintSuccess(e,this.stage);return;case`sealed`:this.paintSeal({start:0,sweep:Y},1,1);return}}paintLine(e){for(let t=0;t<this.lines.length;t+=1){let n=3-t;this.lines[t].setAttribute(`d`,this.linePath(n,e,0,308,1)),this.lines[t].setAttribute(`opacity`,String(n===0?sr+e*.4:.1+e*.1))}}paintSegments(e,t){let n=e-t.startedAt;if(!this.motion.matches&&n<200){this.paintLine(t.amplitude*(1-fr(n/200)));return}let r=n-200,i=8*(this.motion.matches?1:fr(Q(r/200))),a=(308-2*i)/3;for(let[e,t]of[this.top,this.middle,this.bottom].entries()){let n=e*(a+i);t.setAttribute(`d`,`M${n.toFixed(2)} 32H${(n+a).toFixed(2)}`),t.setAttribute(`stroke-width`,`1`),t.setAttribute(`opacity`,this.segmentOpacity(r,e))}}segmentOpacity(e,t){if(this.motion.matches)return`0.8`;let n=.5+.5*Math.cos(Y*(e-t*150)/900);return $(sr,or+(1-or)*n,fr(Q(e/200))).toFixed(3)}paintCapture(e,t){let n=this.motion.matches?920:e-t.startedAt;if(n>=560){this.paintJoin(e,Math.min(n-560,360));return}let r=t.amplitude,i=n/560,a=1-fr(Q(n/150)),o=lr(Q(i/.6)),s=mr(!1)*X*560,c=vr(i,rr,s),l=nr+vr(i,rr+ir-nr,s),u=sr+r*.4;for(let[e,t]of[[this.top,!1],[this.bottom,!0]])e.setAttribute(`d`,this.halfPath(c,l,t,r,a)),e.setAttribute(`stroke-width`,$(1,2,o).toFixed(2)),e.setAttribute(`opacity`,$(u,1,o).toFixed(3));this.middle.setAttribute(`d`,this.linePath(0,r,nr,308-nr,a)),this.middle.setAttribute(`opacity`,(u*(1-fr(Q(n/180)))).toFixed(3));for(let e=0;e<3;e+=1){let t=3-e;this.lines[e].setAttribute(`d`,this.linePath(t,r,0,308,a)),this.lines[e].setAttribute(`opacity`,((.1+r*.1)*(1-Q(n/200))).toFixed(3))}this.track.setAttribute(`opacity`,(.1*Q((i-.4)/.6)).toFixed(3))}paintJoin(e,t){let n=(1-Math.cos(Math.PI*t/360))/2,r=-Math.PI/2+mr(!1)*t,i=ir/X,a=Math.PI-i,o=this.motion.matches?-Math.PI/2:r+ar*a*n;if(this.motion.matches||t>=360){this.stage={kind:`spin`,startedAt:e,base:o-Y*.14},this.settleSuccess&&this.beginSuccess(e),this.paint(e);return}this.track.setAttribute(`opacity`,`0.1`);for(let[e,t]of[[this.top,o],[this.bottom,r+Math.PI-(1-ar)*a*n]])e.setAttribute(`d`,_r({start:t,sweep:i})),e.setAttribute(`stroke-width`,`2`),e.setAttribute(`opacity`,`1`)}spinnerArc(e,t){let n=e-t.startedAt,r=this.motion.matches?2600:1500,i=(n+r/2)%r/r,a=i<.5,o=ur(a?i/.5:(i-.5)/.5),s=a?$(1,56,o):$(56,1,o),c=a?$(0,-14,o):$(-14,-99,o);return{start:t.base+mr(this.motion.matches)*n-Y*c/100,sweep:Y*s/100}}beginSuccess(e){if(this.stage.kind!==`spin`)return;this.stage={kind:`success`,startedAt:e,from:this.spinnerArc(e,this.stage)};let t=this.successBegun;this.successBegun=null,t?.()}paintSuccess(e,t){let n=e-t.startedAt;if(n>=1140){this.stage={kind:`sealed`},this.settle(),this.paint(e);return}let r=Q(n/650),i=this.motion.matches?0:mr(!1)*650*(r-r*r/2),a=lr(Q((n-150)/500));this.paintSeal({start:t.from.start+i,sweep:$(t.from.sweep,Y,a)},dr(Q((n-600)/420)),lr(Q((n-820)/320)));let o=Q((n-700)/700);if(!this.motion.matches&&o>0&&o<1){let e=fr(o);this.ripple.setAttribute(`r`,$(cr,34,e).toFixed(2)),this.ripple.setAttribute(`opacity`,((1-e)*.45).toFixed(3))}}paintSeal(e,t,n){this.paintArc(e,1),this.seal.setAttribute(`r`,(cr*Math.max(0,t)).toFixed(2)),this.seal.setAttribute(`opacity`,t>0?`1`:`0`),this.check.setAttribute(`stroke-dashoffset`,(1-n).toFixed(3)),this.check.setAttribute(`opacity`,n>0?`1`:`0`)}paintArc(e,t){this.track.setAttribute(`opacity`,String(.1*t)),this.top.setAttribute(`d`,_r(e)),this.top.setAttribute(`stroke-width`,`2`),this.top.setAttribute(`opacity`,`1`)}displacement(e,t,n){let r=n/308,i=Math.sin(Math.PI*r)**1.7;if(this.motion.matches)return t*5*i;let a=Math.sin(r*Math.PI*4-this.position+e*.5)*.7+Math.sin(r*Math.PI*7+this.position*.7+e)*.3;return t*(26-e*4)*i*a}linePath(e,t,n,r,i){let a=``,o=Math.max(2,Math.ceil((r-n)/2));for(let s=0;s<=o;s+=1){let c=n+(r-n)*s/o,l=32+this.displacement(e,t,c)*i;a+=`${s===0?`M`:`L`}${c.toFixed(2)},${l.toFixed(2)} `}return a}halfPath(e,t,n,r,i){let a=``,o=Math.max(2,Math.ceil((t-e)/1.5));for(let s=0;s<=o;s+=1){let c=hr(e+(t-e)*s/o),l=n?308-c.x:c.x,u=n?64-c.y:c.y;c.onLine&&(u+=this.displacement(0,r,l)*i),a+=`${s===0?`M`:`L`}${l.toFixed(2)},${u.toFixed(2)} `}return a}};function mr(e){return Y/(e?3200:1800)}function hr(e){if(e<=nr)return{x:e,y:32,onLine:!0};if(e<rr){let t=e-nr,n=0,r=Z.lengths.length-1;for(;r-n>1;){let e=n+r>>1;Z.lengths[e]<t?n=e:r=e}let i=(t-Z.lengths[n])/(Z.lengths[r]-Z.lengths[n]||1);return{x:$(Z.points[n][0],Z.points[r][0],i),y:$(Z.points[n][1],Z.points[r][1],i),onLine:!1}}let t=-Math.PI/2+(e-rr)/X;return{x:154+X*Math.cos(t),y:32+X*Math.sin(t),onLine:!1}}function gr(){let e=[[nr,32]],t=[0],n=0;for(let r=1;r<=240;r+=1){let i=r/240,a=[nr+tr*i,32-X*(4*i**3-3*i**4)],o=e[e.length-1];n+=Math.hypot(a[0]-o[0],a[1]-o[1]),e.push(a),t.push(n)}return{points:e,lengths:t,length:n}}function _r(e){let t=Math.max(2,Math.ceil(80*e.sweep/Y)),n=``;for(let r=0;r<=t;r+=1){let i=e.start+e.sweep*r/t,a=154+X*Math.cos(i),o=32+X*Math.sin(i);n+=`${r===0?`M`:`L`}${a.toFixed(2)},${o.toFixed(2)} `}return n}function vr(e,t,n){let r=e*e;return t*(3*r-2*r*e)+n*(r*e-r)}function yr(e,t,n,r){let i=(e,t,n)=>((1-3*n+3*t)*e+(3*n-6*t))*e*e+3*t*e,a=(e,t,n)=>3*(1-3*n+3*t)*e*e+2*(3*n-6*t)*e+3*t;return o=>{if(o<=0)return 0;if(o>=1)return 1;let s=o;for(let t=0;t<6;t+=1){let t=a(s,e,n);if(t===0)break;s-=(i(s,e,n)-o)/t}return i(Q(s),t,r)}}function Q(e){return e<0?0:e>1?1:e}function $(e,t,n){return e+(t-e)*n}const br=$n;var xr=class{element;glow;ribbon;prompt;themeObserver;phase=`idle`;disposed=!1;constructor(e,t,r){this.prompt=t,this.ribbon=new pr(e,r),this.element=this.ribbon.element,this.glow=e.createElement(`div`),this.glow.className=`seams-voiceid-glow`,this.glow.setAttribute(`aria-hidden`,`true`),this.render();let i=n();if(i)for(let e of this.glow.querySelectorAll(`style`))e.nonce=i;this.themeObserver=new MutationObserver(this.render),this.themeObserver.observe(e.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),this.themeObserver.observe(e.body,{attributes:!0,attributeFilter:[`data-theme`]})}listen(){this.setPhase(`listening`)}add(e){this.ribbon.add(e)}checking(){this.setPhase(`processing`)}accept(){this.setPhase(`idle`)}ready(){this.setPhase(`idle`)}succeed(e){return this.disposed?Promise.resolve():(this.phase=`idle`,this.render(),this.ribbon.succeed(e))}stop(){this.disposed||(this.disposed=!0,this.themeObserver.disconnect(),this.ribbon.dispose(),Ue(null,this.glow))}setPhase(e){this.disposed||(this.phase=e,this.ribbon.setPhase(e),this.render())}render=()=>{this.disposed||Ue(Se(br,{className:`seams-voiceid-beam`,theme:(this.prompt.closest(`[data-theme]`)?.getAttribute(`data-theme`)??this.prompt.ownerDocument.documentElement.getAttribute(`data-theme`))===`light`?`light`:`dark`,level:this.ribbon.readLevel,processing:this.phase===`processing`,active:this.phase!==`idle`,staticColors:!0,colorVariant:`ocean`,borderRadius:Number.parseFloat(getComputedStyle(this.prompt).borderRadius)||16,children:null}),this.glow)}};const Sr=new WeakMap;var Cr=class{element;title;phrase;status;record;cancel;progress;visual;disposed=!1;constructor(e,r,i,a=`ring`){let o=Sr.get(e);o||(o=t({doc:e,baseCss:`
296
- .seams-voiceid-activation-surface { width: min(100%, 26.25rem); margin: 0 auto; background: transparent; }
297
-
298
- .seams-voiceid-prompt {
299
- box-sizing: border-box;
300
- position: relative;
301
- width: min(100%, 26.25rem);
302
- margin: 0 auto;
303
- padding: 3.5rem 1.5rem 1.5rem;
304
- display: grid;
305
- grid-template-rows: auto minmax(6rem, auto) 5rem minmax(3.375rem, auto) 5rem;
306
- border: 1px solid var(--seams-colors-borderPrimary, #303b41);
307
- border-radius: var(--seams-shape-card, 16px);
308
- background: var(--seams-colors-colorBackground, #192024);
309
- color: var(--seams-colors-textPrimary, #eff2f3);
310
- text-align: center;
311
- font-family: var(--seams-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
312
- -webkit-font-smoothing: antialiased;
313
- }
314
- .seams-voiceid-prompt {
315
- transition: opacity 180ms var(--seams-ease-out, cubic-bezier(0.23, 1, 0.32, 1)), transform 180ms var(--seams-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
316
- }
317
- @starting-style {
318
- .seams-voiceid-prompt { opacity: 0; transform: translateY(4px); }
319
- }
320
- .seams-voiceid-progress-slot { grid-row: 5; grid-column: 1; min-width: 0; align-self: center; }
321
- .seams-voiceid-progress-slot:empty { visibility: hidden; }
322
- .seams-voiceid-activation-surface[data-preparation="loading"] .seams-voiceid-record-slot { visibility: hidden; }
323
- @media (prefers-reduced-motion: reduce) {
324
- .seams-voiceid-prompt { transform: none; transition: opacity 150ms ease; }
325
- @starting-style { .seams-voiceid-prompt { transform: none; } }
326
- .seams-voiceid-ribbon { transition: none !important; }
327
- }
328
- .seams-voiceid-prompt h2 {
329
- font-size: 0.85rem;
330
- line-height: 1.4;
331
- font-weight: 500;
332
- color: var(--seams-colors-textSecondary, #9cabb3);
333
- margin: 0.5rem 0 1rem;
334
- }
335
- .seams-voiceid-prompt.seams-voiceid-management {
336
- display: flex;
337
- flex-direction: column;
338
- gap: 0.75rem;
339
- padding: 1.25rem 1.25rem 1.375rem;
340
- border-radius: var(--seams-shape-card, 1.5rem);
341
- text-align: start;
342
- font-size: 0.875rem;
343
- line-height: 1.5;
344
- }
345
- .seams-voiceid-management-header {
346
- display: flex;
347
- align-items: center;
348
- gap: 0.25rem;
349
- margin-inline-start: -0.5rem;
350
- }
351
- .seams-voiceid-management h2 {
352
- margin: 0;
353
- color: var(--seams-colors-textPrimary, #eff2f3);
354
- font-size: 1.375rem;
355
- font-weight: 600;
356
- letter-spacing: -0.02em;
357
- line-height: 1.25;
358
- }
359
- .seams-voiceid-management .seams-voiceid-management-intro {
360
- margin: -0.125rem 0 0.25rem;
361
- color: var(--seams-colors-textSecondary, #9cabb3);
362
- }
363
- .seams-voiceid-management button {
364
- appearance: none;
365
- margin: 0;
366
- color: var(--seams-colors-textPrimary, #eff2f3);
367
- font: inherit;
368
- transition: background-color 140ms ease;
369
- }
370
- .seams-voiceid-management button:disabled { opacity: 0.5; cursor: default; }
371
- .seams-voiceid-management .seams-voiceid-management-back {
372
- display: grid;
373
- place-items: center;
374
- width: 2.25rem;
375
- height: 2.25rem;
376
- padding: 0;
377
- border: 0;
378
- border-radius: var(--seams-shape-control, 10px);
379
- background: transparent;
380
- }
381
- .seams-voiceid-management-enrollment {
382
- display: grid;
383
- grid-template-columns: minmax(0, 1fr) auto;
384
- align-items: center;
385
- gap: 0.125rem 0.75rem;
386
- padding: 0.75rem 0.875rem;
387
- border-radius: 0.75rem;
388
- background: var(--seams-colors-surface, #202b31);
389
- color: var(--seams-colors-textSecondary, #9cabb3);
390
- }
391
- .seams-voiceid-management-summary { text-align: end; }
392
- .seams-voiceid-management-value { color: var(--seams-colors-textPrimary, #eff2f3); font-weight: 500; }
393
- .seams-voiceid-management-enrollment-detail:not(:empty)::before { content: ' · '; }
394
- .seams-voiceid-management-enrollment[data-enrollment="adapted"] > .seams-voiceid-management-summary {
395
- grid-area: 2 / 1;
396
- text-align: start;
397
- font-size: 0.8125rem;
398
- }
399
- .seams-voiceid-management-enrollment > .seams-voiceid-management-reset { grid-area: 1 / 2 / 3; }
400
- .seams-voiceid-management-enrollment[data-state] .seams-voiceid-management-value { display: none; }
401
- .seams-voiceid-management-enrollment[data-state] .seams-voiceid-management-enrollment-detail::before { content: none; }
402
- .seams-voiceid-management .seams-voiceid-management-reset {
403
- padding: 0.375rem 0.75rem;
404
- border: 1px solid var(--seams-colors-borderPrimary, #303b41);
405
- border-radius: var(--seams-shape-control, 10px);
406
- background: transparent;
407
- font-size: 0.8125rem;
408
- font-weight: 600;
409
- }
410
- .seams-voiceid-management .seams-voiceid-management-action {
411
- display: grid;
412
- grid-template-columns: minmax(0, 1fr) auto;
413
- align-items: center;
414
- gap: 0.75rem;
415
- width: 100%;
416
- min-height: 44px;
417
- padding: 0.75rem 0.875rem;
418
- border: 1px solid var(--seams-colors-borderPrimary, #303b41);
419
- border-radius: 0.75rem;
420
- background: transparent;
421
- text-align: start;
422
- }
423
- .seams-voiceid-management-action > svg { color: var(--seams-colors-textSecondary, #9cabb3); }
424
- .seams-voiceid-management-action-heading {
425
- display: flex;
426
- flex-wrap: wrap;
427
- align-items: center;
428
- gap: 0.25rem 0.5rem;
429
- font-weight: 600;
430
- }
431
- .seams-voiceid-management-chip {
432
- padding: 0.125rem 0.5rem;
433
- border-radius: 6px;
434
- background: color-mix(in srgb, var(--seams-colors-textPrimary, #eff2f3), transparent 93%);
435
- font-size: 0.75rem;
436
- font-weight: 500;
437
- }
438
- .seams-voiceid-management-action-detail {
439
- display: block;
440
- margin-top: 0.125rem;
441
- color: var(--seams-colors-textSecondary, #9cabb3);
442
- font-size: 0.8125rem;
443
- }
444
- .seams-voiceid-management .seams-voiceid-management-action[data-state="pending"] {
445
- opacity: 1;
446
- border-color: var(--seams-colors-borderHover, #46545b);
447
- background: var(--seams-colors-surface, #202b31);
448
- }
449
- .seams-voiceid-management-action[data-state="pending"] > svg { visibility: hidden; }
450
- .seams-voiceid-management [data-state="pending"] .seams-voiceid-management-action-detail,
451
- .seams-voiceid-management [data-state="pending"] .seams-voiceid-management-enrollment-detail {
452
- color: var(--seams-colors-textPrimary, #eff2f3);
453
- }
454
- .seams-voiceid-management [data-state="error"] .seams-voiceid-management-action-detail,
455
- .seams-voiceid-management [data-state="error"] .seams-voiceid-management-enrollment-detail {
456
- color: var(--seams-colors-error, oklch(0.74 0.166 19));
457
- }
458
- .seams-voiceid-management .seams-voiceid-management-section {
459
- margin: 0.5rem 0 -0.25rem;
460
- padding-inline-start: 0.125rem;
461
- color: var(--seams-colors-textSecondary, #9cabb3);
462
- font-size: 0.6875rem;
463
- font-weight: 600;
464
- letter-spacing: 0.08em;
465
- text-transform: uppercase;
466
- }
467
- /* The status line is read by assistive technology; a message for a hidden row is also shown. */
468
- .seams-voiceid-prompt.seams-voiceid-management > [role="status"] {
469
- position: absolute;
470
- width: 1px;
471
- height: 1px;
472
- margin: -1px;
473
- overflow: hidden;
474
- clip-path: inset(50%);
475
- white-space: nowrap;
476
- }
477
- .seams-voiceid-prompt.seams-voiceid-management > [role="status"][data-placement="dialog"] {
478
- position: relative;
479
- width: auto;
480
- height: auto;
481
- margin: 0;
482
- overflow: visible;
483
- clip-path: none;
484
- white-space: normal;
485
- color: var(--seams-colors-error, oklch(0.74 0.166 19));
486
- font-size: 0.8125rem;
487
- overflow-wrap: anywhere;
488
- }
489
- [dir='rtl'] .seams-voiceid-management svg { transform: scaleX(-1); }
490
- @media (hover: hover) {
491
- .seams-voiceid-management button:hover:not(:disabled) {
492
- background: var(--seams-colors-surface2, var(--seams-colors-surface, #202b31));
493
- }
494
- }
495
- .seams-voiceid-prompt .seams-voiceid-phrase {
496
- font-size: clamp(1.75rem, 6vw, 2.25rem);
497
- font-weight: 600;
498
- line-height: 1.17;
499
- letter-spacing: -0.035em;
500
- text-wrap: balance;
501
- max-width: 21rem;
502
- align-self: center;
503
- margin: 0 auto;
504
- }
505
- .seams-voiceid-ribbon {
506
- display: block;
507
- width: 308px;
508
- max-width: 100%;
509
- height: 64px;
510
- margin: auto;
511
- overflow: visible;
512
- }
513
- .seams-voiceid-ribbon .seams-voiceid-ribbon-check { stroke: var(--seams-colors-colorBackground, #192024); }
514
- .seams-voiceid-prompt .seams-voiceid-phrase.seams-voiceid-success-headline {
515
- display: grid;
516
- align-content: end;
517
- font-size: 18px;
518
- letter-spacing: normal;
519
- line-height: 1.4;
520
- }
521
- .seams-voiceid-prompt .seams-voiceid-status.seams-voiceid-success-message { font-size: 0.8125rem; }
522
- /* The glow is decorative and cannot intercept record, retry or cancel controls. */
523
- .seams-voiceid-glow { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 0; }
524
- .seams-voiceid-beam { width: 100%; height: 100%; border-radius: inherit; }
525
- .seams-voiceid-prompt > :not(.seams-voiceid-glow) { position: relative; z-index: 1; }
526
- .seams-voiceid-prompt > .seams-voiceid-close { position: absolute; }
527
- .seams-voiceid-prompt .seams-voiceid-status {
528
- font-size: 0.75rem;
529
- line-height: 1.5;
530
- min-height: 3.375rem;
531
- color: var(--seams-colors-textSecondary, #9cabb3);
532
- margin: 0;
533
- }
534
- .seams-voiceid-prompt button {
535
- font: inherit;
536
- cursor: pointer;
537
- touch-action: manipulation;
538
- }
539
- .seams-voiceid-prompt button:focus-visible {
540
- outline: 2px solid currentColor;
541
- outline-offset: 2px;
542
- }
543
- .seams-voiceid-prompt .seams-voiceid-close {
544
- position: absolute;
545
- right: 0.75rem;
546
- top: 0.75rem;
547
- width: 2.5rem;
548
- height: 2.5rem;
549
- background: transparent;
550
- border: 0;
551
- border-radius: var(--seams-shape-control, 10px);
552
- color: inherit;
553
- display: grid;
554
- place-items: center;
555
- color: var(--seams-colors-textSecondary, #9cabb3);
556
- }
557
- .seams-voiceid-prompt .seams-voiceid-record-slot {
558
- grid-row: 5;
559
- grid-column: 1;
560
- align-self: center;
561
- width: 100%;
562
- box-sizing: border-box;
563
- }
564
- .seams-voiceid-prompt .seams-voiceid-primary {
565
- width: 100%;
566
- min-height: var(--seams-shape-controlHeight, 44px);
567
- padding: 0.75rem 1rem;
568
- font-size: 0.875rem;
569
- font-weight: 500;
570
- border: 0;
571
- border-radius: var(--seams-shape-control, 10px);
572
- background: var(--seams-colors-textPrimary, #eff2f3);
573
- color: var(--seams-colors-colorBackground, #192024);
574
- }
575
- .seams-voiceid-prompt .seams-voiceid-primary:disabled {
576
- opacity: 0.5;
577
- cursor: wait;
578
- }
579
- .seams-voiceid-prompt button[hidden],
580
- .seams-voiceid-prompt [hidden] {
581
- display: none !important;
582
- }
583
- .seams-voiceid-prompt .seams-voiceid-model-download {
584
- font-size: 0.75rem;
585
- line-height: 1.5;
586
- }
587
- .seams-voiceid-prompt .seams-voiceid-model-download progress {
588
- appearance: none;
589
- display: block;
590
- width: 100%;
591
- height: 4px;
592
- border: 0;
593
- border-radius: 2px;
594
- overflow: hidden;
595
- background: var(--seams-colors-surface, #202b31);
596
- accent-color: var(--seams-colors-textPrimary, #eff2f3);
597
- }
598
- .seams-voiceid-model-download p { margin: 0 0 0.75rem; color: var(--seams-colors-textSecondary, #9cabb3); font-variant-numeric: tabular-nums; }
599
- .seams-voiceid-model-download progress::-webkit-progress-bar { background: var(--seams-colors-surface, #202b31); }
600
- .seams-voiceid-model-download progress::-webkit-progress-value { background: var(--seams-colors-textPrimary, #eff2f3); border-radius: 2px; }
601
- .seams-voiceid-model-download progress::-moz-progress-bar { background: var(--seams-colors-textPrimary, #eff2f3); }
602
- @media (hover: hover) and (pointer: fine) {
603
- .seams-voiceid-close:hover { background: var(--seams-colors-surface, #202b31); }
604
- .seams-voiceid-primary:hover:not(:disabled) { opacity: 0.9; }
605
- }
606
- `,nonce:n}),Sr.set(e,o)),o.ensureBase(),this.element=e.createElement(`section`),this.element.className=`seams-voiceid-prompt`,this.element.setAttribute(`aria-label`,r),this.title=e.createElement(`h2`),this.title.textContent=`Read aloud`,this.phrase=e.createElement(`p`),this.phrase.className=`seams-voiceid-phrase`,this.phrase.dataset.voiceidPhrase=``,this.phrase.setAttribute(`aria-live`,`polite`),this.setPhrase(i),this.visual=new xr(e,this.element,a),this.status=e.createElement(`p`),this.status.className=`seams-voiceid-status`,this.status.setAttribute(`role`,`status`),this.record=e.createElement(`button`),this.record.type=`button`,this.record.className=`seams-voiceid-primary`,this.record.textContent=`Record`,this.cancel=e.createElement(`button`),this.cancel.type=`button`,this.cancel.className=`seams-voiceid-close`;let s=e.createElementNS(`http://www.w3.org/2000/svg`,`svg`);s.setAttribute(`viewBox`,`0 0 24 24`),s.setAttribute(`width`,`20`),s.setAttribute(`height`,`20`),s.setAttribute(`aria-hidden`,`true`);let c=e.createElementNS(`http://www.w3.org/2000/svg`,`path`);c.setAttribute(`d`,`M6 6l12 12M18 6L6 18`),c.setAttribute(`fill`,`none`),c.setAttribute(`stroke`,`currentColor`),c.setAttribute(`stroke-width`,`1.75`),c.setAttribute(`stroke-linecap`,`round`),s.append(c),this.cancel.append(s),this.cancel.setAttribute(`aria-label`,`Cancel`),this.progress=e.createElement(`div`),this.progress.className=`seams-voiceid-progress-slot`;let l=e.createElement(`div`);l.className=`seams-voiceid-record-slot`,l.append(this.record),this.element.append(this.visual.glow,this.cancel,this.title,this.phrase,this.visual.element,this.status,l,this.progress)}setPhrase(e){let t=e===`if you panic panic early`?`if you panic, panic early`:e;this.phrase.textContent=t.charAt(0).toUpperCase()+t.slice(1)+`.`,this.phrase.dataset.voiceidPhrase=e}capture=e=>{if(!this.disposed)switch(e.kind){case`listening`:delete this.status.dataset.voiceCaptureQuality,this.element.dataset.capture=`listening`,this.record.hidden=!0,this.status.textContent=`Listening`,this.visual.listen();return;case`activity`:this.visual.add(e);return;case`measured`:{let t=e.quality;this.status.dataset.voiceCaptureQuality=JSON.stringify(t),t.noise===`high`&&(this.status.textContent=`Background noise is high. Move closer to the microphone.`);return}case`processing`:this.element.dataset.capture=`processing`,this.lockLayout(),this.visual.checking(),this.status.textContent=`Checking your voice…`;return;default:return kr(e)}};accepted(){this.visual.accept()}async succeed(e,t,n=this.element.getBoundingClientRect()){this.disposed||(this.element.dataset.capture=`succeeded`,this.record.hidden=!0,await this.visual.succeed(this.beginSuccess.bind(this,e,t,n)))}ready(e){this.unlockLayout(),this.visual.ready(),this.element.dataset.capture=`ready`,this.status.textContent=e,this.record.hidden=!1,this.record.disabled=!1}dispose(){this.disposed=!0,this.visual.stop()}lockLayout(){for(let e of[this.element,this.phrase,this.status])e.style.minHeight=`${e.getBoundingClientRect().height}px`;this.element.style.height=this.element.style.minHeight}async beginSuccess(e,t,n){if(this.disposed)return;let r=this.visual.element.getBoundingClientRect(),i=(n.top+n.bottom-r.top-r.bottom)/2;if(this.visual.element.animate([{translate:`0 0`},{translate:`0 ${i}px`}],{duration:600,easing:`cubic-bezier(0.2, 0, 0, 1)`,fill:`forwards`}),await Promise.all([this.title,this.phrase,this.status].map(Dr)),this.disposed)return;this.phrase.textContent=e,this.phrase.classList.add(`seams-voiceid-success-headline`),this.status.textContent=t,this.status.classList.add(`seams-voiceid-success-message`);let a=matchMedia(`(prefers-reduced-motion: reduce)`).matches;for(let[e,t]of[this.phrase,this.status].entries())t.style.translate=`0 ${i}px`,Or(t,a,Tr-wr+e*Er)}unlockLayout(){for(let e of[this.element,this.phrase,this.status])e.style.minHeight=``;this.element.style.height=``}};const wr=150,Tr=450,Er=40;function Dr(e){return e.animate([{opacity:1},{opacity:0}],{duration:150,easing:`ease-in`,fill:`forwards`}).finished}function Or(e,t,n){e.animate([{opacity:0,transform:t?`none`:`translateY(4px)`},{opacity:1,transform:`none`}],{delay:n,duration:300,easing:`cubic-bezier(0.2, 0, 0, 1)`,fill:`both`})}function kr(e){throw Error(`Unexpected capture event: ${String(e)}`)}export{N as a,O as c,E as d,f,r as g,o as h,k as i,ee as l,s as m,Ue as n,re as o,u as p,Se as r,ne as s,Cr as t,C as u};