@hoosei/voxweave-react
Version:
A customizable and interactive voice UI component for React applications
3 lines (2 loc) • 1.03 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var $=1,x=.9,y=.8,A=.17,v=.1,d=.999,M=.9999,T=.99,k=/[\\\/_+.#"@\[\(\{&]/,B=/[\\\/_+.#"@\[\(\{&]/g,D=/[\s-]/,j=/[\s-]/g;function m(t,h,a,i,n,o,u){if(o===h.length)return n===t.length?$:T;var g=`${n},${o}`;if(u[g]!==void 0)return u[g];for(var w=i.charAt(o),e=a.indexOf(w,n),l=0,r,s,c,p;e>=0;)r=m(t,h,a,i,e+1,o+1,u),r>l&&(e===n?r*=$:k.test(t.charAt(e-1))?(r*=y,c=t.slice(n,e-1).match(B),c&&n>0&&(r*=Math.pow(d,c.length))):D.test(t.charAt(e-1))?(r*=x,p=t.slice(n,e-1).match(j),p&&n>0&&(r*=Math.pow(d,p.length))):(r*=A,n>0&&(r*=Math.pow(d,e-n))),t.charAt(e)!==h.charAt(o)&&(r*=M)),(r<v&&a.charAt(e-1)===i.charAt(o+1)||i.charAt(o+1)===i.charAt(o)&&a.charAt(e-1)!==i.charAt(o))&&(s=m(t,h,a,i,e+1,o+2,u),s*v>r&&(r=s*v)),r>l&&(l=r),e=a.indexOf(w,e+1);return u[g]=l,l}function b(t){return t.toLowerCase().replace(j," ")}function G(t,h,a){return t=a&&a.length>0?`${t+" "+a.join(" ")}`:t,m(t,h,b(t),b(h),0,0,{})}exports.a=G;
//# sourceMappingURL=index98.js.map