@aim-packages/subtitle 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";var St=Object.defineProperty;var jt=(e,t,r)=>t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var v=(e,t,r)=>jt(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function U(e,t=2){return e.toString().padStart(t,"0")}function y(e){const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=e%3600%60,a=Math.floor(n%1*1e3),c=U(t),s=U(r),u=U(Math.floor(n)),i=U(a,3);return`${c}:${s}:${u}.${i}`}function A(e){if(!e)return 0;const t=e.split(":");try{let r=t[2].split(",");return r.length===1&&(r=t[2].split(".")),parseFloat(t[0])*3600+parseFloat(t[1])*60+parseFloat(r[0])+parseFloat("0."+r[1])}catch{return 0}}function Ve(e){return/[\u4E00-\u9FFF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/.test(e)}const $t=Object.freeze(Object.defineProperty({__proto__:null,containsCJKCharacters:Ve,convertToSeconds:A,formatTime:y,padNumber:U},Symbol.toStringTag,{value:"Module"}));/**
1
+ "use strict";var St=Object.defineProperty;var jt=(e,t,r)=>t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var v=(e,t,r)=>jt(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function G(e,t=2){return e.toString().padStart(t,"0")}function g(e){const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=e%3600%60,a=Math.floor(n%1*1e3),c=G(t),s=G(r),u=G(Math.floor(n)),i=G(a,3);return`${c}:${s}:${u}.${i}`}function A(e){if(!e)return 0;const t=e.split(":");try{let r=t[2].split(",");return r.length===1&&(r=t[2].split(".")),parseFloat(t[0])*3600+parseFloat(t[1])*60+parseFloat(r[0])+parseFloat("0."+r[1])}catch{return 0}}function Ve(e){return/[\u4E00-\u9FFF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/.test(e)}const xt=Object.freeze(Object.defineProperty({__proto__:null,containsCJKCharacters:Ve,convertToSeconds:A,formatTime:g,padNumber:G},Symbol.toStringTag,{value:"Module"}));/**
2
2
  * @name ass2vtt
3
3
  * @desc Converts ASS subtitle data into VTT format.
4
4
  * @author YuQian2015 (https://github.com/YuQian2015)
5
5
  * @license MIT
6
- */function xt(e){const t=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(n=""){return n.split(/[:.]/).map((a,c,s)=>{if(c===s.length-1){if(a.length===1)return"."+a+"00";if(a.length===2)return"."+a+"0"}else if(a.length===1)return(c===0?"0":":0")+a;return c===0?a:c===s.length-1?"."+a:":"+a}).join("")}return`WEBVTT
6
+ */function $t(e){const t=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(n=""){return n.split(/[:.]/).map((a,c,s)=>{if(c===s.length-1){if(a.length===1)return"."+a+"00";if(a.length===2)return"."+a+"0"}else if(a.length===1)return(c===0?"0":":0")+a;return c===0?a:c===s.length-1?"."+a:":"+a}).join("")}return`WEBVTT
7
7
 
8
8
  `+e.split(/\r?\n/).map(n=>{const a=n.match(t);return a?{start:r(a[1].trim()),end:r(a[2].trim()),text:a[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"<br />").trim().split(/\r?\n/).map(c=>c.trim()).join(`
9
9
  `)}:null}).filter(n=>n).map((n,a)=>n?n.start+" --> "+n.end+`
@@ -17,9 +17,9 @@
17
17
  * @author Newtopia Dev (http://www.newtopia.com)
18
18
  * @version 1.0.1
19
19
  * @license MIT
20
- */function Ot(e,t){let r=t;for(;!e[r];)r++;return r}function wt(e){let t=e.length-1;for(;t>=0&&!e[t];)t--;return t}function At(e="",t={propName:{}}){const r=[],n=e.split(/(?:\r\n|\r|\n)/gm).filter(f=>f.length>0),a=n.map((f,l)=>n[l+2]&&/\d{2}:\d{2}:\d{2}[,\.]\d{2,3}\s*-->\s*\d{2}:\d{2}:\d{2}[,\.]\d{2,3}/.test(n[l+2])?f+`\r
20
+ */function wt(e,t){let r=t;for(;!e[r];)r++;return r}function Ot(e){let t=e.length-1;for(;t>=0&&!e[t];)t--;return t}function At(e="",t={propName:{}}){const r=[],n=e.split(/(?:\r\n|\r|\n)/gm).filter(f=>f.length>0),a=n.map((f,l)=>n[l+2]&&/\d{2}:\d{2}:\d{2}[,\.]\d{2,3}\s*-->\s*\d{2}:\d{2}:\d{2}[,\.]\d{2,3}/.test(n[l+2])?f+`\r
21
21
  `:f).join(`
22
- `).split(/(?:\r\n|\r|\n)/gm),c=wt(a)+1;let s=0,u,i,o;for(let f=0;f<c;f++){for(o={},i=[],f=Ot(a,f),o.id=parseInt(a[f++],10),u=a[f++].split(/[\t ]*-->[\t ]*/),o[t.propName.start||"start"]=t.timeInText?u[0]:A(u[0]),s=u[1].indexOf(" "),s!==-1&&(u[1]=u[1].substr(0,s)),o[t.propName.end||"end"]=t.timeInText?u[1]:A(u[1]);f<c&&a[f];)i.push(a[f++]);const l=t.propName.text||"text";o[l]=i.join(t.keepMultiLine?`
22
+ `).split(/(?:\r\n|\r|\n)/gm),c=Ot(a)+1;let s=0,u,i,o;for(let f=0;f<c;f++){for(o={},i=[],f=wt(a,f),o.id=parseInt(a[f++],10),u=a[f++].split(/[\t ]*-->[\t ]*/),o[t.propName.start||"start"]=t.timeInText?u[0]:A(u[0]),s=u[1].indexOf(" "),s!==-1&&(u[1]=u[1].substr(0,s)),o[t.propName.end||"end"]=t.timeInText?u[1]:A(u[1]);f<c&&a[f];)i.push(a[f++]);const l=t.propName.text||"text";o[l]=i.join(t.keepMultiLine?`
23
23
  `:" ").replace(/\{(\\[\w]+\(?([\w\d]+,?)+\)?)+\}/gi,""),o[l]=o[l].replace(/</g,"&lt;").replace(/>/g,"&gt;"),o[l]=o[l].replace(/&lt;(\/?(font|b|u|i|s))((\s+(\w|\w[\w\-]*\w)(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)(\/?)&gt;/gi,"<$1$3$7>"),t.ignoreLineBreaks?o[l]=o[l].replace(/\\N/gi,""):o[l]=o[l].replace(/\\N/gi,"<br />"),r.push(o)}return r}function Pt(e,t){const r=/<\/?[^>]+(>|$)/g;return new Promise((n,a)=>{let c={};const s=[];let u=!1;const i=e.split(`
24
24
  `);i.forEach((f,l)=>{f.replace(r,"")===" "||f.replace(r,"")===""||(f.indexOf("-->")!==-1?(u=!0,typeof c.start=="number"&&c.start>=0&&s.push(se(c)),c={start:ae(f.split("-->")[0].trimRight().split(" ").pop()),end:ae(f.split("-->")[1].trimLeft().split(" ").shift()),part:""}):u&&(s.length!==0?(s[s.length-1].part.replace(r,""),f.replace(r,""),c.part.length===0?c.part=f:c.part=`${c.part}
25
- ${f}`,l===i.length-1&&s.push(se(c))):(c.part=f,s.push(se(c)),c.part="")))}),c=[];const o=/(<([0-9:.>]+)>)/ig;s.forEach(f=>{const _=f.part.split().map(function(g){return g.replace(o,function(p){return p.split("").reduce(function(S,N){return`==${p.replace("<","").replace(">","")}`},0)})})[0].replace(r,"").split(" "),b=[];_.forEach(function(g){if(g.indexOf("==")>-1){const p=g.split("=="),S=p[0];if(p[1],S==""||S=="##")return;b.push({word:$e(g.split("==")[0]),time:ae(g.split("==")[1])})}else b.push({word:$e(g),time:void 0})}),f.words=b,f.part=f.part.replace(r,"")}),n(s)})}function ae(e){const t=e.split(":"),r=t[t.length-3]?+t[t.length-3]:0,n=t[t.length-2]?+t[t.length-2]:0,a=+t[t.length-1];return r*3600+n*60+a}function $e(e){return e.replace(/[^0-9a-z'-]/gi,"").toLowerCase()}function se(e){if(e==null||typeof e!="object")return e;const t=e.constructor();for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function Et(e){return e.Transcription.Paragraphs.map(t=>{const r=t.Words.map(n=>({st:y(n.Start/1e3),et:y(n.End/1e3),text:n.Text,spk:t.SpeakerId}));return{st:y(t.Words[0].Start/1e3),et:y(t.Words[t.Words.length-1].End/1e3),text:r.map(n=>n.text).join(""),spk:t.SpeakerId,children:r}})}function Ct(e){const t=e.words.map(r=>({st:y(r.start),et:y(r.end),text:r.word}));return[{st:y(e.words[0].start),et:y(e.words[e.words.length-1].end),text:e.text,children:t}]}const ie={padding:[.4,0],maxGap:10,minGap:2,minStart:6};function Ft(e){let t,r,n,a,c,s,u,i,o;const f=!!(e&&e.vad&&e.vad.length>0),l="[--end--]",m="[--Single--]",T="[--Full--]",_=/\[(\d{2}:\d{2}:\d{2}\.\d{3}) --> (\d{2}:\d{2}:\d{2}\.\d{3})\]/;let b=!1,g=!1,p="";return S(),{feed:B,reset:S,end:N};function S(){t=!0,r="",n=!1,a="",c=!1,s=void 0,u=0,i=!1,o=0}function N(){if(i){console.log("whisper parser is already end");return}B(l)}function J($){b||(p+=$),!b&&!g&&Ve(p)&&(g=!0),!b&&p.length>50&&(b=!0)}function B($){var Te,_e,Se;J($);const w=[];r+=$,t&&((Te=e==null?void 0:e.onStart)==null||Te.call(e,{type:"event",event:"start",data:[]})),t&&It(r)&&(r=r.slice(qe.length)),t=!1;const Y=r.length;for(;u<Y;){const X=r[u];if(++u,c&&s&&X!=="["&&(s.text+=X),X==="["&&(n&&a.length&&s&&(s.text+=a),a="",n=!0,c=!1),n){if(a+=X,a===T&&(a=""),a===m&&(a="",f&&o++),a===l){s&&w.push(s),i=!0;break}if(_.test(a)){const I=_.exec(a),D=I==null?void 0:I[1],ne=I==null?void 0:I[2];if(s&&w.push(s),D&&ne){if(f&&(e!=null&&e.vad)&&e.vad.length>0){let Z=0;Z=e.vad[o].start-ie.padding[0]<0?0:e.vad[o].start-ie.padding[0];const _t=D==="00:00:00.000";let je=y(A(D)+Z);o>0&&_t&&(je=y(A(D)+Z+ie.padding[0])),s={st:je,et:y(A(ne)+Z),text:"",children:[]}}else s={st:D,et:ne,text:"",children:[]};c=!0,n=!1,a=""}}}}w.length&&((_e=e==null?void 0:e.onParse)==null||_e.call(e,{type:"event",event:"message",data:w})),i&&((Se=e==null?void 0:e.onEnd)==null||Se.call(e,{type:"event",event:"end",data:r}),S())}}const qe=[239,187,191];function It(e){return qe.every((t,r)=>e.charCodeAt(r)===t)}function Lt(e){let t,r,n,a,c,s,u,i;const o=/\[(\d+)\]/,f="[--end--]";return l(),{feed:T,reset:l,end:m};function l(){t=!0,r="",n=0,i=!1,s="",a=void 0,c=!1,u=!1}function m(){T(f)}function T(_){var p,S,N,J,B;const b=[];r+=_,t&&((p=e==null?void 0:e.onStart)==null||p.call(e,{type:"event",event:"start",data:[]})),t&&Mt(r)&&(r=r.slice(Je.length)),t=!1;const g=r.length;for(;n<g;){const $=r[n];if(++n,u&&a&&$!=="["&&(a.text+=$,(S=e==null?void 0:e.onProgress)==null||S.call(e,{type:"event",event:"message",data:[a]})),$==="["&&(c&&s.length&&a&&(a.text+=s,(N=e==null?void 0:e.onProgress)==null||N.call(e,{type:"event",event:"message",data:[a]})),s="",c=!0,u=!1),c){if(s+=$,s===f){a&&b.push(a),i=!0;break}if(o.test(s)){const w=o.exec(s),Y=w==null?void 0:w[1];a&&b.push(a),Y&&(a={index:Number(Y),text:""},u=!0,c=!1,s="")}}}b.length&&((J=e==null?void 0:e.onParse)==null||J.call(e,{type:"event",event:"message",data:b})),i&&((B=e==null?void 0:e.onEnd)==null||B.call(e,{type:"event",event:"end",data:r}),l())}}const Je=[239,187,191];function Mt(e){return Je.every((t,r)=>e.charCodeAt(r)===t)}async function zt(e){return At(e,{keepMultiLine:!0,propName:{}}).filter(n=>n.text).map(n=>({st:y(n.start),et:y(n.end),text:n.text}))}async function Ye(e){return(await Pt(e)).filter(n=>n.part).map(n=>({st:y(n.start),et:y(n.end),text:n.part}))}async function kt(e){return Ye(xt(e))}async function Nt(e){return Et(e)}async function Bt(e){return Ct(e)}const Dt=Object.freeze(Object.defineProperty({__proto__:null,assToAimSegments:kt,createTranslateStreamParser:Lt,createWhisperStreamParser:Ft,openaiToAimSegments:Bt,srtToAimSegments:zt,tingwuToAimSegments:Nt,vttToAimSegments:Ye},Symbol.toStringTag,{value:"Module"}));class Gt{constructor(t){v(this,"chains",{});v(this,"delimit","__replace__");v(this,"onFilter");v(this,"checked",!1);v(this,"checkedText","");v(this,"checkedLevel");v(this,"filteredText","");this.onFilter=t}add(t,r){typeof t!="string"&&(t=new TextDecoder().decode(t));const n=t;if(!n)return;let a=this.chains;for(let c=0;c<n.length;c++){if(n[c]in a)a=a[n[c]];else{if(!(a instanceof Object))break;let s,u;for(let i=c;i<n.length;i++)a[n[i]]={},[s,u]=[a,n[i]],a=a[n[i]];s&&u&&(s[u]={[this.delimit]:r||""});break}c===n.length-1&&(a[this.delimit]=r||"")}}parse(t){t.forEach(r=>{this.add(...r)})}reParse(t){this.chains={},t.forEach(r=>{this.add(r[0],r[1])})}feed(t){if(!this.checked&&!this.chains[t]){this.filteredText+=t,this.onFilter&&this.onFilter(t);return}if(!this.checked&&this.chains[t]){this.checked=!0,this.checkedLevel=this.chains[t],this.checkedText+=t;return}if(this.checked&&this.checkedLevel[t]){this.checkedLevel=this.checkedLevel[t],this.checkedText+=t;return}if(this.checked&&!this.checkedLevel[t]){const r=typeof this.checkedLevel[this.delimit]=="string"?this.checkedLevel[this.delimit]:this.checkedText;r&&r.length&&r.split("").forEach(n=>{this.filteredText+=n,this.onFilter&&this.onFilter(n)}),this.checked=!1,this.checkedText="",this.checkedLevel=void 0,this.chains[t]?(this.checked=!0,this.checkedLevel=this.chains[t],this.checkedText=t):(this.onFilter&&this.onFilter(t),this.filteredText+=t)}}feedAll(t){return t.length?(t.split("").forEach(n=>{this.feed(n)}),this.end()):""}end(){if(this.checked&&this.checkedText){const r=typeof this.checkedLevel[this.delimit]=="string"?this.checkedLevel[this.delimit]:this.checkedText;r&&r.length&&r.split("").forEach(n=>{this.onFilter&&this.onFilter(n),this.filteredText+=n}),this.checkedText="",this.checkedLevel=void 0,this.checked=!1}const t=this.filteredText;return this.filteredText="",t}}const Ut=Object.freeze(Object.defineProperty({__proto__:null,StreamFilter:Gt},Symbol.toStringTag,{value:"Module"}));var Xe=typeof global=="object"&&global&&global.Object===Object&&global,Rt=typeof self=="object"&&self&&self.Object===Object&&self,j=Xe||Rt||Function("return this")(),L=j.Symbol,Ze=Object.prototype,Ht=Ze.hasOwnProperty,Kt=Ze.toString,G=L?L.toStringTag:void 0;function Wt(e){var t=Ht.call(e,G),r=e[G];try{e[G]=void 0;var n=!0}catch{}var a=Kt.call(e);return n&&(t?e[G]=r:delete e[G]),a}var Vt=Object.prototype,qt=Vt.toString;function Jt(e){return qt.call(e)}var Yt="[object Null]",Xt="[object Undefined]",xe=L?L.toStringTag:void 0;function W(e){return e==null?e===void 0?Xt:Yt:xe&&xe in Object(e)?Wt(e):Jt(e)}function V(e){return e!=null&&typeof e=="object"}var de=Array.isArray;function q(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Zt="[object AsyncFunction]",Qt="[object Function]",er="[object GeneratorFunction]",tr="[object Proxy]";function Qe(e){if(!q(e))return!1;var t=W(e);return t==Qt||t==er||t==Zt||t==tr}var ce=j["__core-js_shared__"],Oe=function(){var e=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function rr(e){return!!Oe&&Oe in e}var nr=Function.prototype,ar=nr.toString;function C(e){if(e!=null){try{return ar.call(e)}catch{}try{return e+""}catch{}}return""}var sr=/[\\^$.*+?()[\]{}|]/g,ir=/^\[object .+?Constructor\]$/,cr=Function.prototype,or=Object.prototype,ur=cr.toString,fr=or.hasOwnProperty,lr=RegExp("^"+ur.call(fr).replace(sr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hr(e){if(!q(e)||rr(e))return!1;var t=Qe(e)?lr:ir;return t.test(C(e))}function dr(e,t){return e==null?void 0:e[t]}function F(e,t){var r=dr(e,t);return hr(r)?r:void 0}var ue=F(j,"WeakMap"),we=Object.create,gr=function(){function e(){}return function(t){if(!q(t))return{};if(we)return we(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function pr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Ae=function(){try{var e=F(Object,"defineProperty");return e({},"",{}),e}catch{}}();function br(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var yr=9007199254740991,vr=/^(?:0|[1-9]\d*)$/;function mr(e,t){var r=typeof e;return t=t??yr,!!t&&(r=="number"||r!="symbol"&&vr.test(e))&&e>-1&&e%1==0&&e<t}function et(e,t,r){t=="__proto__"&&Ae?Ae(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function tt(e,t){return e===t||e!==e&&t!==t}var Tr=Object.prototype,_r=Tr.hasOwnProperty;function rt(e,t,r){var n=e[t];(!(_r.call(e,t)&&tt(n,r))||r===void 0&&!(t in e))&&et(e,t,r)}function ee(e,t,r,n){var a=!r;r||(r={});for(var c=-1,s=t.length;++c<s;){var u=t[c],i=void 0;i===void 0&&(i=e[u]),a?et(r,u,i):rt(r,u,i)}return r}var Sr=9007199254740991;function nt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Sr}function at(e){return e!=null&&nt(e.length)&&!Qe(e)}var jr=Object.prototype;function ge(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||jr;return e===r}function $r(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var xr="[object Arguments]";function Pe(e){return V(e)&&W(e)==xr}var st=Object.prototype,Or=st.hasOwnProperty,wr=st.propertyIsEnumerable,Ar=Pe(function(){return arguments}())?Pe:function(e){return V(e)&&Or.call(e,"callee")&&!wr.call(e,"callee")};function Pr(){return!1}var it=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ee=it&&typeof module=="object"&&module&&!module.nodeType&&module,Er=Ee&&Ee.exports===it,Ce=Er?j.Buffer:void 0,Cr=Ce?Ce.isBuffer:void 0,ct=Cr||Pr,Fr="[object Arguments]",Ir="[object Array]",Lr="[object Boolean]",Mr="[object Date]",zr="[object Error]",kr="[object Function]",Nr="[object Map]",Br="[object Number]",Dr="[object Object]",Gr="[object RegExp]",Ur="[object Set]",Rr="[object String]",Hr="[object WeakMap]",Kr="[object ArrayBuffer]",Wr="[object DataView]",Vr="[object Float32Array]",qr="[object Float64Array]",Jr="[object Int8Array]",Yr="[object Int16Array]",Xr="[object Int32Array]",Zr="[object Uint8Array]",Qr="[object Uint8ClampedArray]",en="[object Uint16Array]",tn="[object Uint32Array]",d={};d[Vr]=d[qr]=d[Jr]=d[Yr]=d[Xr]=d[Zr]=d[Qr]=d[en]=d[tn]=!0;d[Fr]=d[Ir]=d[Kr]=d[Lr]=d[Wr]=d[Mr]=d[zr]=d[kr]=d[Nr]=d[Br]=d[Dr]=d[Gr]=d[Ur]=d[Rr]=d[Hr]=!1;function rn(e){return V(e)&&nt(e.length)&&!!d[W(e)]}function pe(e){return function(t){return e(t)}}var ot=typeof exports=="object"&&exports&&!exports.nodeType&&exports,R=ot&&typeof module=="object"&&module&&!module.nodeType&&module,nn=R&&R.exports===ot,oe=nn&&Xe.process,M=function(){try{var e=R&&R.require&&R.require("util").types;return e||oe&&oe.binding&&oe.binding("util")}catch{}}(),Fe=M&&M.isTypedArray,an=Fe?pe(Fe):rn,sn=Object.prototype,cn=sn.hasOwnProperty;function ut(e,t){var r=de(e),n=!r&&Ar(e),a=!r&&!n&&ct(e),c=!r&&!n&&!a&&an(e),s=r||n||a||c,u=s?$r(e.length,String):[],i=u.length;for(var o in e)(t||cn.call(e,o))&&!(s&&(o=="length"||a&&(o=="offset"||o=="parent")||c&&(o=="buffer"||o=="byteLength"||o=="byteOffset")||mr(o,i)))&&u.push(o);return u}function ft(e,t){return function(r){return e(t(r))}}var on=ft(Object.keys,Object),un=Object.prototype,fn=un.hasOwnProperty;function ln(e){if(!ge(e))return on(e);var t=[];for(var r in Object(e))fn.call(e,r)&&r!="constructor"&&t.push(r);return t}function be(e){return at(e)?ut(e):ln(e)}function hn(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var dn=Object.prototype,gn=dn.hasOwnProperty;function pn(e){if(!q(e))return hn(e);var t=ge(e),r=[];for(var n in e)n=="constructor"&&(t||!gn.call(e,n))||r.push(n);return r}function ye(e){return at(e)?ut(e,!0):pn(e)}var H=F(Object,"create");function bn(){this.__data__=H?H(null):{},this.size=0}function yn(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var vn="__lodash_hash_undefined__",mn=Object.prototype,Tn=mn.hasOwnProperty;function _n(e){var t=this.__data__;if(H){var r=t[e];return r===vn?void 0:r}return Tn.call(t,e)?t[e]:void 0}var Sn=Object.prototype,jn=Sn.hasOwnProperty;function $n(e){var t=this.__data__;return H?t[e]!==void 0:jn.call(t,e)}var xn="__lodash_hash_undefined__";function On(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=H&&t===void 0?xn:t,this}function E(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}E.prototype.clear=bn;E.prototype.delete=yn;E.prototype.get=_n;E.prototype.has=$n;E.prototype.set=On;function wn(){this.__data__=[],this.size=0}function te(e,t){for(var r=e.length;r--;)if(tt(e[r][0],t))return r;return-1}var An=Array.prototype,Pn=An.splice;function En(e){var t=this.__data__,r=te(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Pn.call(t,r,1),--this.size,!0}function Cn(e){var t=this.__data__,r=te(t,e);return r<0?void 0:t[r][1]}function Fn(e){return te(this.__data__,e)>-1}function In(e,t){var r=this.__data__,n=te(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function O(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}O.prototype.clear=wn;O.prototype.delete=En;O.prototype.get=Cn;O.prototype.has=Fn;O.prototype.set=In;var K=F(j,"Map");function Ln(){this.size=0,this.__data__={hash:new E,map:new(K||O),string:new E}}function Mn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function re(e,t){var r=e.__data__;return Mn(t)?r[typeof t=="string"?"string":"hash"]:r.map}function zn(e){var t=re(this,e).delete(e);return this.size-=t?1:0,t}function kn(e){return re(this,e).get(e)}function Nn(e){return re(this,e).has(e)}function Bn(e,t){var r=re(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function z(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}z.prototype.clear=Ln;z.prototype.delete=zn;z.prototype.get=kn;z.prototype.has=Nn;z.prototype.set=Bn;function lt(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var ht=ft(Object.getPrototypeOf,Object);function Dn(){this.__data__=new O,this.size=0}function Gn(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Un(e){return this.__data__.get(e)}function Rn(e){return this.__data__.has(e)}var Hn=200;function Kn(e,t){var r=this.__data__;if(r instanceof O){var n=r.__data__;if(!K||n.length<Hn-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new z(n)}return r.set(e,t),this.size=r.size,this}function k(e){var t=this.__data__=new O(e);this.size=t.size}k.prototype.clear=Dn;k.prototype.delete=Gn;k.prototype.get=Un;k.prototype.has=Rn;k.prototype.set=Kn;function Wn(e,t){return e&&ee(t,be(t),e)}function Vn(e,t){return e&&ee(t,ye(t),e)}var dt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ie=dt&&typeof module=="object"&&module&&!module.nodeType&&module,qn=Ie&&Ie.exports===dt,Le=qn?j.Buffer:void 0,Me=Le?Le.allocUnsafe:void 0;function Jn(e,t){if(t)return e.slice();var r=e.length,n=Me?Me(r):new e.constructor(r);return e.copy(n),n}function Yn(e,t){for(var r=-1,n=e==null?0:e.length,a=0,c=[];++r<n;){var s=e[r];t(s,r,e)&&(c[a++]=s)}return c}function gt(){return[]}var Xn=Object.prototype,Zn=Xn.propertyIsEnumerable,ze=Object.getOwnPropertySymbols,ve=ze?function(e){return e==null?[]:(e=Object(e),Yn(ze(e),function(t){return Zn.call(e,t)}))}:gt;function Qn(e,t){return ee(e,ve(e),t)}var ea=Object.getOwnPropertySymbols,pt=ea?function(e){for(var t=[];e;)lt(t,ve(e)),e=ht(e);return t}:gt;function ta(e,t){return ee(e,pt(e),t)}function bt(e,t,r){var n=t(e);return de(e)?n:lt(n,r(e))}function ra(e){return bt(e,be,ve)}function na(e){return bt(e,ye,pt)}var fe=F(j,"DataView"),le=F(j,"Promise"),he=F(j,"Set"),ke="[object Map]",aa="[object Object]",Ne="[object Promise]",Be="[object Set]",De="[object WeakMap]",Ge="[object DataView]",sa=C(fe),ia=C(K),ca=C(le),oa=C(he),ua=C(ue),x=W;(fe&&x(new fe(new ArrayBuffer(1)))!=Ge||K&&x(new K)!=ke||le&&x(le.resolve())!=Ne||he&&x(new he)!=Be||ue&&x(new ue)!=De)&&(x=function(e){var t=W(e),r=t==aa?e.constructor:void 0,n=r?C(r):"";if(n)switch(n){case sa:return Ge;case ia:return ke;case ca:return Ne;case oa:return Be;case ua:return De}return t});var fa=Object.prototype,la=fa.hasOwnProperty;function ha(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&la.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Ue=j.Uint8Array;function me(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function da(e,t){var r=t?me(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var ga=/\w*$/;function pa(e){var t=new e.constructor(e.source,ga.exec(e));return t.lastIndex=e.lastIndex,t}var Re=L?L.prototype:void 0,He=Re?Re.valueOf:void 0;function ba(e){return He?Object(He.call(e)):{}}function ya(e,t){var r=t?me(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var va="[object Boolean]",ma="[object Date]",Ta="[object Map]",_a="[object Number]",Sa="[object RegExp]",ja="[object Set]",$a="[object String]",xa="[object Symbol]",Oa="[object ArrayBuffer]",wa="[object DataView]",Aa="[object Float32Array]",Pa="[object Float64Array]",Ea="[object Int8Array]",Ca="[object Int16Array]",Fa="[object Int32Array]",Ia="[object Uint8Array]",La="[object Uint8ClampedArray]",Ma="[object Uint16Array]",za="[object Uint32Array]";function ka(e,t,r){var n=e.constructor;switch(t){case Oa:return me(e);case va:case ma:return new n(+e);case wa:return da(e,r);case Aa:case Pa:case Ea:case Ca:case Fa:case Ia:case La:case Ma:case za:return ya(e,r);case Ta:return new n;case _a:case $a:return new n(e);case Sa:return pa(e);case ja:return new n;case xa:return ba(e)}}function Na(e){return typeof e.constructor=="function"&&!ge(e)?gr(ht(e)):{}}var Ba="[object Map]";function Da(e){return V(e)&&x(e)==Ba}var Ke=M&&M.isMap,Ga=Ke?pe(Ke):Da,Ua="[object Set]";function Ra(e){return V(e)&&x(e)==Ua}var We=M&&M.isSet,Ha=We?pe(We):Ra,Ka=1,Wa=2,Va=4,yt="[object Arguments]",qa="[object Array]",Ja="[object Boolean]",Ya="[object Date]",Xa="[object Error]",vt="[object Function]",Za="[object GeneratorFunction]",Qa="[object Map]",es="[object Number]",mt="[object Object]",ts="[object RegExp]",rs="[object Set]",ns="[object String]",as="[object Symbol]",ss="[object WeakMap]",is="[object ArrayBuffer]",cs="[object DataView]",os="[object Float32Array]",us="[object Float64Array]",fs="[object Int8Array]",ls="[object Int16Array]",hs="[object Int32Array]",ds="[object Uint8Array]",gs="[object Uint8ClampedArray]",ps="[object Uint16Array]",bs="[object Uint32Array]",h={};h[yt]=h[qa]=h[is]=h[cs]=h[Ja]=h[Ya]=h[os]=h[us]=h[fs]=h[ls]=h[hs]=h[Qa]=h[es]=h[mt]=h[ts]=h[rs]=h[ns]=h[as]=h[ds]=h[gs]=h[ps]=h[bs]=!0;h[Xa]=h[vt]=h[ss]=!1;function Q(e,t,r,n,a,c){var s,u=t&Ka,i=t&Wa,o=t&Va;if(s!==void 0)return s;if(!q(e))return e;var f=de(e);if(f){if(s=ha(e),!u)return pr(e,s)}else{var l=x(e),m=l==vt||l==Za;if(ct(e))return Jn(e,u);if(l==mt||l==yt||m&&!a){if(s=i||m?{}:Na(e),!u)return i?ta(e,Vn(s,e)):Qn(e,Wn(s,e))}else{if(!h[l])return a?e:{};s=ka(e,l,u)}}c||(c=new k);var T=c.get(e);if(T)return T;c.set(e,s),Ha(e)?e.forEach(function(g){s.add(Q(g,t,r,g,e,c))}):Ga(e)&&e.forEach(function(g,p){s.set(p,Q(g,t,r,p,e,c))});var _=o?i?na:ra:i?ye:be,b=f?void 0:_(e);return br(b||e,function(g,p){b&&(p=g,g=e[p]),rt(s,p,Q(g,t,r,p,e,c))}),s}var ys=1,vs=4;function ms(e){return Q(e,ys|vs)}class Tt{constructor(t){v(this,"threshold",2);v(this,"hit",0);v(this,"prevSegment");v(this,"hitSegment");v(this,"hitSegmentList",[]);v(this,"options");this.options=t||{}}push(t){var r,n;this.hitSegment&&this.hitSegment.text!==t.text&&(this.hitSegmentList.push(this.hitSegment),this.reset()),this.prevSegment&&t.text===this.prevSegment.text?(this.hit++,this.hit===1&&(this.hitSegment=ms(this.prevSegment)),this.threshold<=this.hit&&this.hitSegment&&(this.hitSegment.et=t.et,this.hitSegment.hit=this.hit,(n=(r=this.options).onHit)==null||n.call(r,this.hitSegmentList))):this.hit=0,this.prevSegment=t}end(){var t,r;this.hitSegment&&(this.hitSegmentList.push(this.hitSegment),(r=(t=this.options).onHit)==null||r.call(t,this.hitSegmentList)),this.reset()}reset(){this.hit=0,this.prevSegment=void 0,this.hitSegment=void 0}}const P={punc:/[.,?!\],。!?…]{1}/,em:/[.?!\]。!?…]{1}/,space:/^\s+|\s+$|\s{2,}/g,ep:/[.,?!,。!?…]{1}\s*$/};function Ts(e,t){let r=[];const n=new Tt({onHit:i=>{r=i}}),a=i=>i.trim().length===0,c=i=>{const o=A(i.st),f=A(i.et);return o>=f},s={emt:[],ep:[],zf:[],punc:[],em:[],space:[]},u=[];return e.forEach((i,o)=>{const f=P.punc.test(i.text),l=P.em.test(i.text),m=P.space.test(i.text),T=a(i.text),_=c(i),b=P.ep.test(i.text);n.push(i),i.punc=f?1:0,f&&s.punc.push(o),i.em=l?1:0,l&&s.em.push(o),i.space=m?1:0,m&&(t!=null&&t.space?i.text=i.text.replace(P.space," ").trim():s.space.push(o)),i.emt=a(i.text)?1:0,T&&(t!=null&&t.emt||s.emt.push(o)),i.zf=c(i)?1:0,_&&(t!=null&&t.zf||s.zf.push(o)),i.ep=b?1:0,b&&(t!=null&&t.ep?i.text=i.text.replace(P.ep,""):s.ep.push(o)),!(t!=null&&t.zf&&i.zf)&&(t!=null&&t.emt&&i.emt||u.push(i))}),n.end(),{result:s,repeat:r,segments:u}}const _s=Object.freeze(Object.defineProperty({__proto__:null,RepeatCheck:Tt,subtitleOptimization:Ts,subtitleOptimizationRegExp:P},Symbol.toStringTag,{value:"Module"}));exports.filter=Ut;exports.parser=Dt;exports.tools=_s;exports.utils=$t;
25
+ ${f}`,l===i.length-1&&s.push(se(c))):(c.part=f,s.push(se(c)),c.part="")))}),c=[];const o=/(<([0-9:.>]+)>)/ig;s.forEach(f=>{const _=f.part.split().map(function(p){return p.replace(o,function(b){return b.split("").reduce(function(S,N){return`==${b.replace("<","").replace(">","")}`},0)})})[0].replace(r,"").split(" "),y=[];_.forEach(function(p){if(p.indexOf("==")>-1){const b=p.split("=="),S=b[0];if(b[1],S==""||S=="##")return;y.push({word:xe(p.split("==")[0]),time:ae(p.split("==")[1])})}else y.push({word:xe(p),time:void 0})}),f.words=y,f.part=f.part.replace(r,"")}),n(s)})}function ae(e){const t=e.split(":"),r=t[t.length-3]?+t[t.length-3]:0,n=t[t.length-2]?+t[t.length-2]:0,a=+t[t.length-1];return r*3600+n*60+a}function xe(e){return e.replace(/[^0-9a-z'-]/gi,"").toLowerCase()}function se(e){if(e==null||typeof e!="object")return e;const t=e.constructor();for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function Et(e){return e.Transcription.Paragraphs.map(t=>{const r=t.Words.map(n=>({st:g(n.Start/1e3),et:g(n.End/1e3),text:n.Text,spk:t.SpeakerId}));return{st:g(t.Words[0].Start/1e3),et:g(t.Words[t.Words.length-1].End/1e3),text:r.map(n=>n.text).join(""),spk:t.SpeakerId,children:r}})}function Ct(e){var t;if(e.segments){const r=e.segments.map(n=>({st:g(n.start),et:g(n.end),text:n.text}));if(e.words.length>0){const n=e.words;let a=0,c=0;for(;a<r.length;){const s=r[a];let u=s.text;for(let i=c;i<n.length;i++){const o=n[i];if(o&&u.startsWith(o.word))s.children=s.children||[],s.children.push({st:g(o.start),et:g(o.end),text:o.word}),u=u.substring(o.word.length);else if(o&&new RegExp(`^[\\s\\p{P}]*${o.word}`,"u").test(u)){s.children=s.children||[];const f=u.match(new RegExp(`^[\\s\\p{P}]*${o.word}`,"u"))[0];s.children.push({st:g(o.start),et:g(o.end),text:f}),u=u.substring(f.length)}else{c=i;break}}a++}return r}return r}else if(((t=e.words)==null?void 0:t.length)>=0){const r=e.words.map(n=>({st:g(n.start),et:g(n.end),text:n.word}));return[{st:g(e.words[0].start),et:g(e.words[e.words.length-1].end),text:e.text,children:r}]}else return[]}const ie={padding:[.4,0],maxGap:10,minGap:2,minStart:6};function Ft(e){let t,r,n,a,c,s,u,i,o;const f=!!(e&&e.vad&&e.vad.length>0),l="[--end--]",m="[--Single--]",T="[--Full--]",_=/\[(\d{2}:\d{2}:\d{2}\.\d{3}) --> (\d{2}:\d{2}:\d{2}\.\d{3})\]/;let y=!1,p=!1,b="";return S(),{feed:B,reset:S,end:N};function S(){t=!0,r="",n=!1,a="",c=!1,s=void 0,u=0,i=!1,o=0}function N(){if(i){console.log("whisper parser is already end");return}B(l)}function J(x){y||(b+=x),!y&&!p&&Ve(b)&&(p=!0),!y&&b.length>50&&(y=!0)}function B(x){var Te,_e,Se;J(x);const O=[];r+=x,t&&((Te=e==null?void 0:e.onStart)==null||Te.call(e,{type:"event",event:"start",data:[]})),t&&It(r)&&(r=r.slice(qe.length)),t=!1;const Y=r.length;for(;u<Y;){const X=r[u];if(++u,c&&s&&X!=="["&&(s.text+=X),X==="["&&(n&&a.length&&s&&(s.text+=a),a="",n=!0,c=!1),n){if(a+=X,a===T&&(a=""),a===m&&(a="",f&&o++),a===l){s&&O.push(s),i=!0;break}if(_.test(a)){const I=_.exec(a),D=I==null?void 0:I[1],ne=I==null?void 0:I[2];if(s&&O.push(s),D&&ne){if(f&&(e!=null&&e.vad)&&e.vad.length>0){let Z=0;Z=e.vad[o].start-ie.padding[0]<0?0:e.vad[o].start-ie.padding[0];const _t=D==="00:00:00.000";let je=g(A(D)+Z);o>0&&_t&&(je=g(A(D)+Z+ie.padding[0])),s={st:je,et:g(A(ne)+Z),text:"",children:[]}}else s={st:D,et:ne,text:"",children:[]};c=!0,n=!1,a=""}}}}O.length&&((_e=e==null?void 0:e.onParse)==null||_e.call(e,{type:"event",event:"message",data:O})),i&&((Se=e==null?void 0:e.onEnd)==null||Se.call(e,{type:"event",event:"end",data:r}),S())}}const qe=[239,187,191];function It(e){return qe.every((t,r)=>e.charCodeAt(r)===t)}function Lt(e){let t,r,n,a,c,s,u,i;const o=/\[(\d+)\]/,f="[--end--]";return l(),{feed:T,reset:l,end:m};function l(){t=!0,r="",n=0,i=!1,s="",a=void 0,c=!1,u=!1}function m(){T(f)}function T(_){var b,S,N,J,B;const y=[];r+=_,t&&((b=e==null?void 0:e.onStart)==null||b.call(e,{type:"event",event:"start",data:[]})),t&&Mt(r)&&(r=r.slice(Je.length)),t=!1;const p=r.length;for(;n<p;){const x=r[n];if(++n,u&&a&&x!=="["&&(a.text+=x,(S=e==null?void 0:e.onProgress)==null||S.call(e,{type:"event",event:"message",data:[a]})),x==="["&&(c&&s.length&&a&&(a.text+=s,(N=e==null?void 0:e.onProgress)==null||N.call(e,{type:"event",event:"message",data:[a]})),s="",c=!0,u=!1),c){if(s+=x,s===f){a&&y.push(a),i=!0;break}if(o.test(s)){const O=o.exec(s),Y=O==null?void 0:O[1];a&&y.push(a),Y&&(a={index:Number(Y),text:""},u=!0,c=!1,s="")}}}y.length&&((J=e==null?void 0:e.onParse)==null||J.call(e,{type:"event",event:"message",data:y})),i&&((B=e==null?void 0:e.onEnd)==null||B.call(e,{type:"event",event:"end",data:r}),l())}}const Je=[239,187,191];function Mt(e){return Je.every((t,r)=>e.charCodeAt(r)===t)}async function kt(e){return At(e,{keepMultiLine:!0,propName:{}}).filter(n=>n.text).map(n=>({st:g(n.start),et:g(n.end),text:n.text}))}async function Ye(e){return(await Pt(e)).filter(n=>n.part).map(n=>({st:g(n.start),et:g(n.end),text:n.part}))}async function zt(e){return Ye($t(e))}async function Nt(e){return Et(e)}async function Bt(e){return Ct(e)}const Dt=Object.freeze(Object.defineProperty({__proto__:null,assToAimSegments:zt,createTranslateStreamParser:Lt,createWhisperStreamParser:Ft,openaiToAimSegments:Bt,srtToAimSegments:kt,tingwuToAimSegments:Nt,vttToAimSegments:Ye},Symbol.toStringTag,{value:"Module"}));class Rt{constructor(t){v(this,"chains",{});v(this,"delimit","__replace__");v(this,"onFilter");v(this,"checked",!1);v(this,"checkedText","");v(this,"checkedLevel");v(this,"filteredText","");this.onFilter=t}add(t,r){typeof t!="string"&&(t=new TextDecoder().decode(t));const n=t;if(!n)return;let a=this.chains;for(let c=0;c<n.length;c++){if(n[c]in a)a=a[n[c]];else{if(!(a instanceof Object))break;let s,u;for(let i=c;i<n.length;i++)a[n[i]]={},[s,u]=[a,n[i]],a=a[n[i]];s&&u&&(s[u]={[this.delimit]:r||""});break}c===n.length-1&&(a[this.delimit]=r||"")}}parse(t){t.forEach(r=>{this.add(...r)})}reParse(t){this.chains={},t.forEach(r=>{this.add(r[0],r[1])})}feed(t){if(!this.checked&&!this.chains[t]){this.filteredText+=t,this.onFilter&&this.onFilter(t);return}if(!this.checked&&this.chains[t]){this.checked=!0,this.checkedLevel=this.chains[t],this.checkedText+=t;return}if(this.checked&&this.checkedLevel[t]){this.checkedLevel=this.checkedLevel[t],this.checkedText+=t;return}if(this.checked&&!this.checkedLevel[t]){const r=typeof this.checkedLevel[this.delimit]=="string"?this.checkedLevel[this.delimit]:this.checkedText;r&&r.length&&r.split("").forEach(n=>{this.filteredText+=n,this.onFilter&&this.onFilter(n)}),this.checked=!1,this.checkedText="",this.checkedLevel=void 0,this.chains[t]?(this.checked=!0,this.checkedLevel=this.chains[t],this.checkedText=t):(this.onFilter&&this.onFilter(t),this.filteredText+=t)}}feedAll(t){return t.length?(t.split("").forEach(n=>{this.feed(n)}),this.end()):""}end(){if(this.checked&&this.checkedText){const r=typeof this.checkedLevel[this.delimit]=="string"?this.checkedLevel[this.delimit]:this.checkedText;r&&r.length&&r.split("").forEach(n=>{this.onFilter&&this.onFilter(n),this.filteredText+=n}),this.checkedText="",this.checkedLevel=void 0,this.checked=!1}const t=this.filteredText;return this.filteredText="",t}}const Gt=Object.freeze(Object.defineProperty({__proto__:null,StreamFilter:Rt},Symbol.toStringTag,{value:"Module"}));var Xe=typeof global=="object"&&global&&global.Object===Object&&global,Ut=typeof self=="object"&&self&&self.Object===Object&&self,j=Xe||Ut||Function("return this")(),L=j.Symbol,Ze=Object.prototype,Ht=Ze.hasOwnProperty,Wt=Ze.toString,R=L?L.toStringTag:void 0;function Kt(e){var t=Ht.call(e,R),r=e[R];try{e[R]=void 0;var n=!0}catch{}var a=Wt.call(e);return n&&(t?e[R]=r:delete e[R]),a}var Vt=Object.prototype,qt=Vt.toString;function Jt(e){return qt.call(e)}var Yt="[object Null]",Xt="[object Undefined]",$e=L?L.toStringTag:void 0;function K(e){return e==null?e===void 0?Xt:Yt:$e&&$e in Object(e)?Kt(e):Jt(e)}function V(e){return e!=null&&typeof e=="object"}var de=Array.isArray;function q(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Zt="[object AsyncFunction]",Qt="[object Function]",er="[object GeneratorFunction]",tr="[object Proxy]";function Qe(e){if(!q(e))return!1;var t=K(e);return t==Qt||t==er||t==Zt||t==tr}var ce=j["__core-js_shared__"],we=function(){var e=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function rr(e){return!!we&&we in e}var nr=Function.prototype,ar=nr.toString;function C(e){if(e!=null){try{return ar.call(e)}catch{}try{return e+""}catch{}}return""}var sr=/[\\^$.*+?()[\]{}|]/g,ir=/^\[object .+?Constructor\]$/,cr=Function.prototype,or=Object.prototype,ur=cr.toString,fr=or.hasOwnProperty,lr=RegExp("^"+ur.call(fr).replace(sr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hr(e){if(!q(e)||rr(e))return!1;var t=Qe(e)?lr:ir;return t.test(C(e))}function dr(e,t){return e==null?void 0:e[t]}function F(e,t){var r=dr(e,t);return hr(r)?r:void 0}var ue=F(j,"WeakMap"),Oe=Object.create,gr=function(){function e(){}return function(t){if(!q(t))return{};if(Oe)return Oe(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function pr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Ae=function(){try{var e=F(Object,"defineProperty");return e({},"",{}),e}catch{}}();function br(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var yr=9007199254740991,vr=/^(?:0|[1-9]\d*)$/;function mr(e,t){var r=typeof e;return t=t??yr,!!t&&(r=="number"||r!="symbol"&&vr.test(e))&&e>-1&&e%1==0&&e<t}function et(e,t,r){t=="__proto__"&&Ae?Ae(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function tt(e,t){return e===t||e!==e&&t!==t}var Tr=Object.prototype,_r=Tr.hasOwnProperty;function rt(e,t,r){var n=e[t];(!(_r.call(e,t)&&tt(n,r))||r===void 0&&!(t in e))&&et(e,t,r)}function ee(e,t,r,n){var a=!r;r||(r={});for(var c=-1,s=t.length;++c<s;){var u=t[c],i=void 0;i===void 0&&(i=e[u]),a?et(r,u,i):rt(r,u,i)}return r}var Sr=9007199254740991;function nt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Sr}function at(e){return e!=null&&nt(e.length)&&!Qe(e)}var jr=Object.prototype;function ge(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||jr;return e===r}function xr(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var $r="[object Arguments]";function Pe(e){return V(e)&&K(e)==$r}var st=Object.prototype,wr=st.hasOwnProperty,Or=st.propertyIsEnumerable,Ar=Pe(function(){return arguments}())?Pe:function(e){return V(e)&&wr.call(e,"callee")&&!Or.call(e,"callee")};function Pr(){return!1}var it=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ee=it&&typeof module=="object"&&module&&!module.nodeType&&module,Er=Ee&&Ee.exports===it,Ce=Er?j.Buffer:void 0,Cr=Ce?Ce.isBuffer:void 0,ct=Cr||Pr,Fr="[object Arguments]",Ir="[object Array]",Lr="[object Boolean]",Mr="[object Date]",kr="[object Error]",zr="[object Function]",Nr="[object Map]",Br="[object Number]",Dr="[object Object]",Rr="[object RegExp]",Gr="[object Set]",Ur="[object String]",Hr="[object WeakMap]",Wr="[object ArrayBuffer]",Kr="[object DataView]",Vr="[object Float32Array]",qr="[object Float64Array]",Jr="[object Int8Array]",Yr="[object Int16Array]",Xr="[object Int32Array]",Zr="[object Uint8Array]",Qr="[object Uint8ClampedArray]",en="[object Uint16Array]",tn="[object Uint32Array]",d={};d[Vr]=d[qr]=d[Jr]=d[Yr]=d[Xr]=d[Zr]=d[Qr]=d[en]=d[tn]=!0;d[Fr]=d[Ir]=d[Wr]=d[Lr]=d[Kr]=d[Mr]=d[kr]=d[zr]=d[Nr]=d[Br]=d[Dr]=d[Rr]=d[Gr]=d[Ur]=d[Hr]=!1;function rn(e){return V(e)&&nt(e.length)&&!!d[K(e)]}function pe(e){return function(t){return e(t)}}var ot=typeof exports=="object"&&exports&&!exports.nodeType&&exports,U=ot&&typeof module=="object"&&module&&!module.nodeType&&module,nn=U&&U.exports===ot,oe=nn&&Xe.process,M=function(){try{var e=U&&U.require&&U.require("util").types;return e||oe&&oe.binding&&oe.binding("util")}catch{}}(),Fe=M&&M.isTypedArray,an=Fe?pe(Fe):rn,sn=Object.prototype,cn=sn.hasOwnProperty;function ut(e,t){var r=de(e),n=!r&&Ar(e),a=!r&&!n&&ct(e),c=!r&&!n&&!a&&an(e),s=r||n||a||c,u=s?xr(e.length,String):[],i=u.length;for(var o in e)(t||cn.call(e,o))&&!(s&&(o=="length"||a&&(o=="offset"||o=="parent")||c&&(o=="buffer"||o=="byteLength"||o=="byteOffset")||mr(o,i)))&&u.push(o);return u}function ft(e,t){return function(r){return e(t(r))}}var on=ft(Object.keys,Object),un=Object.prototype,fn=un.hasOwnProperty;function ln(e){if(!ge(e))return on(e);var t=[];for(var r in Object(e))fn.call(e,r)&&r!="constructor"&&t.push(r);return t}function be(e){return at(e)?ut(e):ln(e)}function hn(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var dn=Object.prototype,gn=dn.hasOwnProperty;function pn(e){if(!q(e))return hn(e);var t=ge(e),r=[];for(var n in e)n=="constructor"&&(t||!gn.call(e,n))||r.push(n);return r}function ye(e){return at(e)?ut(e,!0):pn(e)}var H=F(Object,"create");function bn(){this.__data__=H?H(null):{},this.size=0}function yn(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var vn="__lodash_hash_undefined__",mn=Object.prototype,Tn=mn.hasOwnProperty;function _n(e){var t=this.__data__;if(H){var r=t[e];return r===vn?void 0:r}return Tn.call(t,e)?t[e]:void 0}var Sn=Object.prototype,jn=Sn.hasOwnProperty;function xn(e){var t=this.__data__;return H?t[e]!==void 0:jn.call(t,e)}var $n="__lodash_hash_undefined__";function wn(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=H&&t===void 0?$n:t,this}function E(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}E.prototype.clear=bn;E.prototype.delete=yn;E.prototype.get=_n;E.prototype.has=xn;E.prototype.set=wn;function On(){this.__data__=[],this.size=0}function te(e,t){for(var r=e.length;r--;)if(tt(e[r][0],t))return r;return-1}var An=Array.prototype,Pn=An.splice;function En(e){var t=this.__data__,r=te(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Pn.call(t,r,1),--this.size,!0}function Cn(e){var t=this.__data__,r=te(t,e);return r<0?void 0:t[r][1]}function Fn(e){return te(this.__data__,e)>-1}function In(e,t){var r=this.__data__,n=te(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function w(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}w.prototype.clear=On;w.prototype.delete=En;w.prototype.get=Cn;w.prototype.has=Fn;w.prototype.set=In;var W=F(j,"Map");function Ln(){this.size=0,this.__data__={hash:new E,map:new(W||w),string:new E}}function Mn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function re(e,t){var r=e.__data__;return Mn(t)?r[typeof t=="string"?"string":"hash"]:r.map}function kn(e){var t=re(this,e).delete(e);return this.size-=t?1:0,t}function zn(e){return re(this,e).get(e)}function Nn(e){return re(this,e).has(e)}function Bn(e,t){var r=re(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function k(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}k.prototype.clear=Ln;k.prototype.delete=kn;k.prototype.get=zn;k.prototype.has=Nn;k.prototype.set=Bn;function lt(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var ht=ft(Object.getPrototypeOf,Object);function Dn(){this.__data__=new w,this.size=0}function Rn(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Gn(e){return this.__data__.get(e)}function Un(e){return this.__data__.has(e)}var Hn=200;function Wn(e,t){var r=this.__data__;if(r instanceof w){var n=r.__data__;if(!W||n.length<Hn-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new k(n)}return r.set(e,t),this.size=r.size,this}function z(e){var t=this.__data__=new w(e);this.size=t.size}z.prototype.clear=Dn;z.prototype.delete=Rn;z.prototype.get=Gn;z.prototype.has=Un;z.prototype.set=Wn;function Kn(e,t){return e&&ee(t,be(t),e)}function Vn(e,t){return e&&ee(t,ye(t),e)}var dt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ie=dt&&typeof module=="object"&&module&&!module.nodeType&&module,qn=Ie&&Ie.exports===dt,Le=qn?j.Buffer:void 0,Me=Le?Le.allocUnsafe:void 0;function Jn(e,t){if(t)return e.slice();var r=e.length,n=Me?Me(r):new e.constructor(r);return e.copy(n),n}function Yn(e,t){for(var r=-1,n=e==null?0:e.length,a=0,c=[];++r<n;){var s=e[r];t(s,r,e)&&(c[a++]=s)}return c}function gt(){return[]}var Xn=Object.prototype,Zn=Xn.propertyIsEnumerable,ke=Object.getOwnPropertySymbols,ve=ke?function(e){return e==null?[]:(e=Object(e),Yn(ke(e),function(t){return Zn.call(e,t)}))}:gt;function Qn(e,t){return ee(e,ve(e),t)}var ea=Object.getOwnPropertySymbols,pt=ea?function(e){for(var t=[];e;)lt(t,ve(e)),e=ht(e);return t}:gt;function ta(e,t){return ee(e,pt(e),t)}function bt(e,t,r){var n=t(e);return de(e)?n:lt(n,r(e))}function ra(e){return bt(e,be,ve)}function na(e){return bt(e,ye,pt)}var fe=F(j,"DataView"),le=F(j,"Promise"),he=F(j,"Set"),ze="[object Map]",aa="[object Object]",Ne="[object Promise]",Be="[object Set]",De="[object WeakMap]",Re="[object DataView]",sa=C(fe),ia=C(W),ca=C(le),oa=C(he),ua=C(ue),$=K;(fe&&$(new fe(new ArrayBuffer(1)))!=Re||W&&$(new W)!=ze||le&&$(le.resolve())!=Ne||he&&$(new he)!=Be||ue&&$(new ue)!=De)&&($=function(e){var t=K(e),r=t==aa?e.constructor:void 0,n=r?C(r):"";if(n)switch(n){case sa:return Re;case ia:return ze;case ca:return Ne;case oa:return Be;case ua:return De}return t});var fa=Object.prototype,la=fa.hasOwnProperty;function ha(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&la.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Ge=j.Uint8Array;function me(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function da(e,t){var r=t?me(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var ga=/\w*$/;function pa(e){var t=new e.constructor(e.source,ga.exec(e));return t.lastIndex=e.lastIndex,t}var Ue=L?L.prototype:void 0,He=Ue?Ue.valueOf:void 0;function ba(e){return He?Object(He.call(e)):{}}function ya(e,t){var r=t?me(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var va="[object Boolean]",ma="[object Date]",Ta="[object Map]",_a="[object Number]",Sa="[object RegExp]",ja="[object Set]",xa="[object String]",$a="[object Symbol]",wa="[object ArrayBuffer]",Oa="[object DataView]",Aa="[object Float32Array]",Pa="[object Float64Array]",Ea="[object Int8Array]",Ca="[object Int16Array]",Fa="[object Int32Array]",Ia="[object Uint8Array]",La="[object Uint8ClampedArray]",Ma="[object Uint16Array]",ka="[object Uint32Array]";function za(e,t,r){var n=e.constructor;switch(t){case wa:return me(e);case va:case ma:return new n(+e);case Oa:return da(e,r);case Aa:case Pa:case Ea:case Ca:case Fa:case Ia:case La:case Ma:case ka:return ya(e,r);case Ta:return new n;case _a:case xa:return new n(e);case Sa:return pa(e);case ja:return new n;case $a:return ba(e)}}function Na(e){return typeof e.constructor=="function"&&!ge(e)?gr(ht(e)):{}}var Ba="[object Map]";function Da(e){return V(e)&&$(e)==Ba}var We=M&&M.isMap,Ra=We?pe(We):Da,Ga="[object Set]";function Ua(e){return V(e)&&$(e)==Ga}var Ke=M&&M.isSet,Ha=Ke?pe(Ke):Ua,Wa=1,Ka=2,Va=4,yt="[object Arguments]",qa="[object Array]",Ja="[object Boolean]",Ya="[object Date]",Xa="[object Error]",vt="[object Function]",Za="[object GeneratorFunction]",Qa="[object Map]",es="[object Number]",mt="[object Object]",ts="[object RegExp]",rs="[object Set]",ns="[object String]",as="[object Symbol]",ss="[object WeakMap]",is="[object ArrayBuffer]",cs="[object DataView]",os="[object Float32Array]",us="[object Float64Array]",fs="[object Int8Array]",ls="[object Int16Array]",hs="[object Int32Array]",ds="[object Uint8Array]",gs="[object Uint8ClampedArray]",ps="[object Uint16Array]",bs="[object Uint32Array]",h={};h[yt]=h[qa]=h[is]=h[cs]=h[Ja]=h[Ya]=h[os]=h[us]=h[fs]=h[ls]=h[hs]=h[Qa]=h[es]=h[mt]=h[ts]=h[rs]=h[ns]=h[as]=h[ds]=h[gs]=h[ps]=h[bs]=!0;h[Xa]=h[vt]=h[ss]=!1;function Q(e,t,r,n,a,c){var s,u=t&Wa,i=t&Ka,o=t&Va;if(s!==void 0)return s;if(!q(e))return e;var f=de(e);if(f){if(s=ha(e),!u)return pr(e,s)}else{var l=$(e),m=l==vt||l==Za;if(ct(e))return Jn(e,u);if(l==mt||l==yt||m&&!a){if(s=i||m?{}:Na(e),!u)return i?ta(e,Vn(s,e)):Qn(e,Kn(s,e))}else{if(!h[l])return a?e:{};s=za(e,l,u)}}c||(c=new z);var T=c.get(e);if(T)return T;c.set(e,s),Ha(e)?e.forEach(function(p){s.add(Q(p,t,r,p,e,c))}):Ra(e)&&e.forEach(function(p,b){s.set(b,Q(p,t,r,b,e,c))});var _=o?i?na:ra:i?ye:be,y=f?void 0:_(e);return br(y||e,function(p,b){y&&(b=p,p=e[b]),rt(s,b,Q(p,t,r,b,e,c))}),s}var ys=1,vs=4;function ms(e){return Q(e,ys|vs)}class Tt{constructor(t){v(this,"threshold",2);v(this,"hit",0);v(this,"prevSegment");v(this,"hitSegment");v(this,"hitSegmentList",[]);v(this,"options");this.options=t||{}}push(t){var r,n;this.hitSegment&&this.hitSegment.text!==t.text&&(this.hitSegmentList.push(this.hitSegment),this.reset()),this.prevSegment&&t.text===this.prevSegment.text?(this.hit++,this.hit===1&&(this.hitSegment=ms(this.prevSegment)),this.threshold<=this.hit&&this.hitSegment&&(this.hitSegment.et=t.et,this.hitSegment.hit=this.hit,(n=(r=this.options).onHit)==null||n.call(r,this.hitSegmentList))):this.hit=0,this.prevSegment=t}end(){var t,r;this.hitSegment&&(this.hitSegmentList.push(this.hitSegment),(r=(t=this.options).onHit)==null||r.call(t,this.hitSegmentList)),this.reset()}reset(){this.hit=0,this.prevSegment=void 0,this.hitSegment=void 0}}const P={punc:/[.,?!\],。!?…]{1}/,em:/[.?!\]。!?…]{1}/,space:/^\s+|\s+$|\s{2,}/g,ep:/[.,?!,。!?…]{1}\s*$/};function Ts(e,t){let r=[];const n=new Tt({onHit:i=>{r=i}}),a=i=>i.trim().length===0,c=i=>{const o=A(i.st),f=A(i.et);return o>=f},s={emt:[],ep:[],zf:[],punc:[],em:[],space:[]},u=[];return e.forEach((i,o)=>{const f=P.punc.test(i.text),l=P.em.test(i.text),m=P.space.test(i.text),T=a(i.text),_=c(i),y=P.ep.test(i.text);n.push(i),i.punc=f?1:0,f&&s.punc.push(o),i.em=l?1:0,l&&s.em.push(o),i.space=m?1:0,m&&(t!=null&&t.space?i.text=i.text.replace(P.space," ").trim():s.space.push(o)),i.emt=a(i.text)?1:0,T&&(t!=null&&t.emt||s.emt.push(o)),i.zf=c(i)?1:0,_&&(t!=null&&t.zf||s.zf.push(o)),i.ep=y?1:0,y&&(t!=null&&t.ep?i.text=i.text.replace(P.ep,""):s.ep.push(o)),!(t!=null&&t.zf&&i.zf)&&(t!=null&&t.emt&&i.emt||u.push(i))}),n.end(),{result:s,repeat:r,segments:u}}const _s=Object.freeze(Object.defineProperty({__proto__:null,RepeatCheck:Tt,subtitleOptimization:Ts,subtitleOptimizationRegExp:P},Symbol.toStringTag,{value:"Module"}));exports.filter=Gt;exports.parser=Dt;exports.tools=_s;exports.utils=xt;
package/dist/index.d.ts CHANGED
@@ -123,6 +123,11 @@ declare interface OpenAIResult {
123
123
  start: number;
124
124
  end: number;
125
125
  }[];
126
+ segments: {
127
+ text: string;
128
+ start: number;
129
+ end: number;
130
+ }[];
126
131
  }
127
132
 
128
133
  declare function openaiToAimSegments(json: OpenAIResult): Promise<AimSegments[]>;
package/dist/index.es.js CHANGED
@@ -1,11 +1,11 @@
1
- var St = Object.defineProperty;
2
- var jt = (e, t, r) => t in e ? St(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var m = (e, t, r) => jt(e, typeof t != "symbol" ? t + "" : t, r);
4
- function U(e, t = 2) {
1
+ var xt = Object.defineProperty;
2
+ var St = (e, t, r) => t in e ? xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var m = (e, t, r) => St(e, typeof t != "symbol" ? t + "" : t, r);
4
+ function G(e, t = 2) {
5
5
  return e.toString().padStart(t, "0");
6
6
  }
7
- function y(e) {
8
- const t = Math.floor(e / 3600), r = Math.floor(e % 3600 / 60), n = e % 3600 % 60, a = Math.floor(n % 1 * 1e3), c = U(t), s = U(r), u = U(Math.floor(n)), i = U(a, 3);
7
+ function g(e) {
8
+ const t = Math.floor(e / 3600), r = Math.floor(e % 3600 / 60), n = e % 3600 % 60, a = Math.floor(n % 1 * 1e3), c = G(t), s = G(r), u = G(Math.floor(n)), i = G(a, 3);
9
9
  return `${c}:${s}:${u}.${i}`;
10
10
  }
11
11
  function A(e) {
@@ -26,8 +26,8 @@ const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26
26
  __proto__: null,
27
27
  containsCJKCharacters: Ve,
28
28
  convertToSeconds: A,
29
- formatTime: y,
30
- padNumber: U
29
+ formatTime: g,
30
+ padNumber: G
31
31
  }, Symbol.toStringTag, { value: "Module" }));
32
32
  /**
33
33
  * @name ass2vtt
@@ -35,7 +35,7 @@ const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
35
35
  * @author YuQian2015 (https://github.com/YuQian2015)
36
36
  * @license MIT
37
37
  */
38
- function xt(e) {
38
+ function jt(e) {
39
39
  const t = new RegExp(
40
40
  "Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$",
41
41
  "i"
@@ -89,16 +89,16 @@ function wt(e) {
89
89
  return t;
90
90
  }
91
91
  function Ot(e = "", t = { propName: {} }) {
92
- const r = [], n = e.split(/(?:\r\n|\r|\n)/gm).filter((f) => f.length > 0), a = n.map((f, l) => n[l + 2] && /\d{2}:\d{2}:\d{2}[,\.]\d{2,3}\s*-->\s*\d{2}:\d{2}:\d{2}[,\.]\d{2,3}/.test(n[l + 2]) ? f + `\r
93
- ` : f).join(`
92
+ const r = [], n = e.split(/(?:\r\n|\r|\n)/gm).filter((l) => l.length > 0), a = n.map((l, f) => n[f + 2] && /\d{2}:\d{2}:\d{2}[,\.]\d{2,3}\s*-->\s*\d{2}:\d{2}:\d{2}[,\.]\d{2,3}/.test(n[f + 2]) ? l + `\r
93
+ ` : l).join(`
94
94
  `).split(/(?:\r\n|\r|\n)/gm), c = wt(a) + 1;
95
95
  let s = 0, u, i, o;
96
- for (let f = 0; f < c; f++) {
97
- for (o = {}, i = [], f = $t(a, f), o.id = parseInt(a[f++], 10), u = a[f++].split(/[\t ]*-->[\t ]*/), o[t.propName.start || "start"] = t.timeInText ? u[0] : A(u[0]), s = u[1].indexOf(" "), s !== -1 && (u[1] = u[1].substr(0, s)), o[t.propName.end || "end"] = t.timeInText ? u[1] : A(u[1]); f < c && a[f]; )
98
- i.push(a[f++]);
99
- const l = t.propName.text || "text";
100
- o[l] = i.join(t.keepMultiLine ? `
101
- ` : " ").replace(/\{(\\[\w]+\(?([\w\d]+,?)+\)?)+\}/gi, ""), o[l] = o[l].replace(/</g, "&lt;").replace(/>/g, "&gt;"), o[l] = o[l].replace(/&lt;(\/?(font|b|u|i|s))((\s+(\w|\w[\w\-]*\w)(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)(\/?)&gt;/gi, "<$1$3$7>"), t.ignoreLineBreaks ? o[l] = o[l].replace(/\\N/gi, "") : o[l] = o[l].replace(/\\N/gi, "<br />"), r.push(o);
96
+ for (let l = 0; l < c; l++) {
97
+ for (o = {}, i = [], l = $t(a, l), o.id = parseInt(a[l++], 10), u = a[l++].split(/[\t ]*-->[\t ]*/), o[t.propName.start || "start"] = t.timeInText ? u[0] : A(u[0]), s = u[1].indexOf(" "), s !== -1 && (u[1] = u[1].substr(0, s)), o[t.propName.end || "end"] = t.timeInText ? u[1] : A(u[1]); l < c && a[l]; )
98
+ i.push(a[l++]);
99
+ const f = t.propName.text || "text";
100
+ o[f] = i.join(t.keepMultiLine ? `
101
+ ` : " ").replace(/\{(\\[\w]+\(?([\w\d]+,?)+\)?)+\}/gi, ""), o[f] = o[f].replace(/</g, "&lt;").replace(/>/g, "&gt;"), o[f] = o[f].replace(/&lt;(\/?(font|b|u|i|s))((\s+(\w|\w[\w\-]*\w)(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)(\/?)&gt;/gi, "<$1$3$7>"), t.ignoreLineBreaks ? o[f] = o[f].replace(/\\N/gi, "") : o[f] = o[f].replace(/\\N/gi, "<br />"), r.push(o);
102
102
  }
103
103
  return r;
104
104
  }
@@ -110,38 +110,38 @@ function At(e, t) {
110
110
  let u = !1;
111
111
  const i = e.split(`
112
112
  `);
113
- i.forEach((f, l) => {
114
- f.replace(r, "") === " " || f.replace(r, "") === "" || (f.indexOf("-->") !== -1 ? (u = !0, typeof c.start == "number" && c.start >= 0 && s.push(se(c)), c = {
115
- start: ae(f.split("-->")[0].trimRight().split(" ").pop()),
116
- end: ae(f.split("-->")[1].trimLeft().split(" ").shift()),
113
+ i.forEach((l, f) => {
114
+ l.replace(r, "") === " " || l.replace(r, "") === "" || (l.indexOf("-->") !== -1 ? (u = !0, typeof c.start == "number" && c.start >= 0 && s.push(se(c)), c = {
115
+ start: ae(l.split("-->")[0].trimRight().split(" ").pop()),
116
+ end: ae(l.split("-->")[1].trimLeft().split(" ").shift()),
117
117
  part: ""
118
- }) : u && (s.length !== 0 ? (s[s.length - 1].part.replace(r, ""), f.replace(r, ""), c.part.length === 0 ? c.part = f : c.part = `${c.part}
119
- ${f}`, l === i.length - 1 && s.push(se(c))) : (c.part = f, s.push(se(c)), c.part = "")));
118
+ }) : u && (s.length !== 0 ? (s[s.length - 1].part.replace(r, ""), l.replace(r, ""), c.part.length === 0 ? c.part = l : c.part = `${c.part}
119
+ ${l}`, f === i.length - 1 && s.push(se(c))) : (c.part = l, s.push(se(c)), c.part = "")));
120
120
  }), c = [];
121
121
  const o = /(<([0-9:.>]+)>)/ig;
122
- s.forEach((f) => {
123
- const _ = f.part.split().map(function(g) {
124
- return g.replace(o, function(p) {
125
- return p.split("").reduce(function(S, N) {
126
- return `==${p.replace("<", "").replace(">", "")}`;
122
+ s.forEach((l) => {
123
+ const _ = l.part.split().map(function(p) {
124
+ return p.replace(o, function(b) {
125
+ return b.split("").reduce(function(x, N) {
126
+ return `==${b.replace("<", "").replace(">", "")}`;
127
127
  }, 0);
128
128
  });
129
- })[0].replace(r, "").split(" "), b = [];
130
- _.forEach(function(g) {
131
- if (g.indexOf("==") > -1) {
132
- const p = g.split("=="), S = p[0];
133
- if (p[1], S == "" || S == "##")
129
+ })[0].replace(r, "").split(" "), y = [];
130
+ _.forEach(function(p) {
131
+ if (p.indexOf("==") > -1) {
132
+ const b = p.split("=="), x = b[0];
133
+ if (b[1], x == "" || x == "##")
134
134
  return;
135
- b.push({
136
- word: xe(g.split("==")[0]),
137
- time: ae(g.split("==")[1])
135
+ y.push({
136
+ word: je(p.split("==")[0]),
137
+ time: ae(p.split("==")[1])
138
138
  });
139
139
  } else
140
- b.push({
141
- word: xe(g),
140
+ y.push({
141
+ word: je(p),
142
142
  time: void 0
143
143
  });
144
- }), f.words = b, f.part = f.part.replace(r, "");
144
+ }), l.words = y, l.part = l.part.replace(r, "");
145
145
  }), n(s);
146
146
  });
147
147
  }
@@ -149,7 +149,7 @@ function ae(e) {
149
149
  const t = e.split(":"), r = t[t.length - 3] ? +t[t.length - 3] : 0, n = t[t.length - 2] ? +t[t.length - 2] : 0, a = +t[t.length - 1];
150
150
  return r * 3600 + n * 60 + a;
151
151
  }
152
- function xe(e) {
152
+ function je(e) {
153
153
  return e.replace(/[^0-9a-z'-]/gi, "").toLowerCase();
154
154
  }
155
155
  function se(e) {
@@ -163,14 +163,14 @@ function se(e) {
163
163
  function Pt(e) {
164
164
  return e.Transcription.Paragraphs.map((t) => {
165
165
  const r = t.Words.map((n) => ({
166
- st: y(n.Start / 1e3),
167
- et: y(n.End / 1e3),
166
+ st: g(n.Start / 1e3),
167
+ et: g(n.End / 1e3),
168
168
  text: n.Text,
169
169
  spk: t.SpeakerId
170
170
  }));
171
171
  return {
172
- st: y(t.Words[0].Start / 1e3),
173
- et: y(t.Words[t.Words.length - 1].End / 1e3),
172
+ st: g(t.Words[0].Start / 1e3),
173
+ et: g(t.Words[t.Words.length - 1].End / 1e3),
174
174
  text: r.map((n) => n.text).join(""),
175
175
  spk: t.SpeakerId,
176
176
  children: r
@@ -178,17 +178,59 @@ function Pt(e) {
178
178
  });
179
179
  }
180
180
  function Et(e) {
181
- const t = e.words.map((r) => ({
182
- st: y(r.start),
183
- et: y(r.end),
184
- text: r.word
185
- }));
186
- return [{
187
- st: y(e.words[0].start),
188
- et: y(e.words[e.words.length - 1].end),
189
- text: e.text,
190
- children: t
191
- }];
181
+ var t;
182
+ if (e.segments) {
183
+ const r = e.segments.map((n) => ({
184
+ st: g(n.start),
185
+ et: g(n.end),
186
+ text: n.text
187
+ }));
188
+ if (e.words.length > 0) {
189
+ const n = e.words;
190
+ let a = 0, c = 0;
191
+ for (; a < r.length; ) {
192
+ const s = r[a];
193
+ let u = s.text;
194
+ for (let i = c; i < n.length; i++) {
195
+ const o = n[i];
196
+ if (o && u.startsWith(o.word))
197
+ s.children = s.children || [], s.children.push({
198
+ st: g(o.start),
199
+ et: g(o.end),
200
+ text: o.word
201
+ }), u = u.substring(o.word.length);
202
+ else if (o && new RegExp(`^[\\s\\p{P}]*${o.word}`, "u").test(u)) {
203
+ s.children = s.children || [];
204
+ const l = u.match(new RegExp(`^[\\s\\p{P}]*${o.word}`, "u"))[0];
205
+ s.children.push({
206
+ st: g(o.start),
207
+ et: g(o.end),
208
+ text: l
209
+ }), u = u.substring(l.length);
210
+ } else {
211
+ c = i;
212
+ break;
213
+ }
214
+ }
215
+ a++;
216
+ }
217
+ return r;
218
+ }
219
+ return r;
220
+ } else if (((t = e.words) == null ? void 0 : t.length) >= 0) {
221
+ const r = e.words.map((n) => ({
222
+ st: g(n.start),
223
+ et: g(n.end),
224
+ text: n.word
225
+ }));
226
+ return [{
227
+ st: g(e.words[0].start),
228
+ et: g(e.words[e.words.length - 1].end),
229
+ text: e.text,
230
+ children: r
231
+ }];
232
+ } else
233
+ return [];
192
234
  }
193
235
  const ie = {
194
236
  padding: [0.4, 0],
@@ -202,10 +244,10 @@ const ie = {
202
244
  };
203
245
  function Ct(e) {
204
246
  let t, r, n, a, c, s, u, i, o;
205
- const f = !!(e && e.vad && e.vad.length > 0), l = "[--end--]", v = "[--Single--]", T = "[--Full--]", _ = /\[(\d{2}:\d{2}:\d{2}\.\d{3}) --> (\d{2}:\d{2}:\d{2}\.\d{3})\]/;
206
- let b = !1, g = !1, p = "";
207
- return S(), { feed: B, reset: S, end: N };
208
- function S() {
247
+ const l = !!(e && e.vad && e.vad.length > 0), f = "[--end--]", v = "[--Single--]", T = "[--Full--]", _ = /\[(\d{2}:\d{2}:\d{2}\.\d{3}) --> (\d{2}:\d{2}:\d{2}\.\d{3})\]/;
248
+ let y = !1, p = !1, b = "";
249
+ return x(), { feed: B, reset: x, end: N };
250
+ function x() {
209
251
  t = !0, r = "", n = !1, a = "", c = !1, s = void 0, u = 0, i = !1, o = 0;
210
252
  }
211
253
  function N() {
@@ -213,16 +255,16 @@ function Ct(e) {
213
255
  console.log("whisper parser is already end");
214
256
  return;
215
257
  }
216
- B(l);
258
+ B(f);
217
259
  }
218
- function J(x) {
219
- b || (p += x), !b && !g && Ve(p) && (g = !0), !b && p.length > 50 && (b = !0);
260
+ function J(j) {
261
+ y || (b += j), !y && !p && Ve(b) && (p = !0), !y && b.length > 50 && (y = !0);
220
262
  }
221
- function B(x) {
222
- var Te, _e, Se;
223
- J(x);
263
+ function B(j) {
264
+ var Te, _e, xe;
265
+ J(j);
224
266
  const O = [];
225
- r += x, t && ((Te = e == null ? void 0 : e.onStart) == null || Te.call(e, {
267
+ r += j, t && ((Te = e == null ? void 0 : e.onStart) == null || Te.call(e, {
226
268
  type: "event",
227
269
  event: "start",
228
270
  data: []
@@ -231,21 +273,21 @@ function Ct(e) {
231
273
  for (; u < Y; ) {
232
274
  const X = r[u];
233
275
  if (++u, c && s && X !== "[" && (s.text += X), X === "[" && (n && a.length && s && (s.text += a), a = "", n = !0, c = !1), n) {
234
- if (a += X, a === T && (a = ""), a === v && (a = "", f && o++), a === l) {
276
+ if (a += X, a === T && (a = ""), a === v && (a = "", l && o++), a === f) {
235
277
  s && O.push(s), i = !0;
236
278
  break;
237
279
  }
238
280
  if (_.test(a)) {
239
281
  const I = _.exec(a), D = I == null ? void 0 : I[1], ne = I == null ? void 0 : I[2];
240
282
  if (s && O.push(s), D && ne) {
241
- if (f && (e != null && e.vad) && e.vad.length > 0) {
283
+ if (l && (e != null && e.vad) && e.vad.length > 0) {
242
284
  let Z = 0;
243
285
  Z = e.vad[o].start - ie.padding[0] < 0 ? 0 : e.vad[o].start - ie.padding[0];
244
286
  const _t = D === "00:00:00.000";
245
- let je = y(A(D) + Z);
246
- o > 0 && _t && (je = y(A(D) + Z + ie.padding[0])), s = {
247
- st: je,
248
- et: y(A(ne) + Z),
287
+ let Se = g(A(D) + Z);
288
+ o > 0 && _t && (Se = g(A(D) + Z + ie.padding[0])), s = {
289
+ st: Se,
290
+ et: g(A(ne) + Z),
249
291
  text: "",
250
292
  children: []
251
293
  };
@@ -265,11 +307,11 @@ function Ct(e) {
265
307
  type: "event",
266
308
  event: "message",
267
309
  data: O
268
- })), i && ((Se = e == null ? void 0 : e.onEnd) == null || Se.call(e, {
310
+ })), i && ((xe = e == null ? void 0 : e.onEnd) == null || xe.call(e, {
269
311
  type: "event",
270
312
  event: "end",
271
313
  data: r
272
- }), S());
314
+ }), x());
273
315
  }
274
316
  }
275
317
  const qe = [239, 187, 191];
@@ -278,56 +320,56 @@ function Ft(e) {
278
320
  }
279
321
  function It(e) {
280
322
  let t, r, n, a, c, s, u, i;
281
- const o = /\[(\d+)\]/, f = "[--end--]";
282
- return l(), { feed: T, reset: l, end: v };
283
- function l() {
323
+ const o = /\[(\d+)\]/, l = "[--end--]";
324
+ return f(), { feed: T, reset: f, end: v };
325
+ function f() {
284
326
  t = !0, r = "", n = 0, i = !1, s = "", a = void 0, c = !1, u = !1;
285
327
  }
286
328
  function v() {
287
- T(f);
329
+ T(l);
288
330
  }
289
331
  function T(_) {
290
- var p, S, N, J, B;
291
- const b = [];
292
- r += _, t && ((p = e == null ? void 0 : e.onStart) == null || p.call(e, {
332
+ var b, x, N, J, B;
333
+ const y = [];
334
+ r += _, t && ((b = e == null ? void 0 : e.onStart) == null || b.call(e, {
293
335
  type: "event",
294
336
  event: "start",
295
337
  data: []
296
338
  })), t && Lt(r) && (r = r.slice(Je.length)), t = !1;
297
- const g = r.length;
298
- for (; n < g; ) {
299
- const x = r[n];
300
- if (++n, u && a && x !== "[" && (a.text += x, (S = e == null ? void 0 : e.onProgress) == null || S.call(e, {
339
+ const p = r.length;
340
+ for (; n < p; ) {
341
+ const j = r[n];
342
+ if (++n, u && a && j !== "[" && (a.text += j, (x = e == null ? void 0 : e.onProgress) == null || x.call(e, {
301
343
  type: "event",
302
344
  event: "message",
303
345
  data: [a]
304
- })), x === "[" && (c && s.length && a && (a.text += s, (N = e == null ? void 0 : e.onProgress) == null || N.call(e, {
346
+ })), j === "[" && (c && s.length && a && (a.text += s, (N = e == null ? void 0 : e.onProgress) == null || N.call(e, {
305
347
  type: "event",
306
348
  event: "message",
307
349
  data: [a]
308
350
  })), s = "", c = !0, u = !1), c) {
309
- if (s += x, s === f) {
310
- a && b.push(a), i = !0;
351
+ if (s += j, s === l) {
352
+ a && y.push(a), i = !0;
311
353
  break;
312
354
  }
313
355
  if (o.test(s)) {
314
356
  const O = o.exec(s), Y = O == null ? void 0 : O[1];
315
- a && b.push(a), Y && (a = {
357
+ a && y.push(a), Y && (a = {
316
358
  index: Number(Y),
317
359
  text: ""
318
360
  }, u = !0, c = !1, s = "");
319
361
  }
320
362
  }
321
363
  }
322
- b.length && ((J = e == null ? void 0 : e.onParse) == null || J.call(e, {
364
+ y.length && ((J = e == null ? void 0 : e.onParse) == null || J.call(e, {
323
365
  type: "event",
324
366
  event: "message",
325
- data: b
367
+ data: y
326
368
  })), i && ((B = e == null ? void 0 : e.onEnd) == null || B.call(e, {
327
369
  type: "event",
328
370
  event: "end",
329
371
  data: r
330
- }), l());
372
+ }), f());
331
373
  }
332
374
  }
333
375
  const Je = [239, 187, 191];
@@ -339,22 +381,22 @@ async function Mt(e) {
339
381
  keepMultiLine: !0,
340
382
  propName: {}
341
383
  }).filter((n) => n.text).map((n) => ({
342
- st: y(n.start),
343
- et: y(n.end),
384
+ st: g(n.start),
385
+ et: g(n.end),
344
386
  text: n.text
345
387
  }));
346
388
  }
347
389
  async function Ye(e) {
348
390
  return (await At(e)).filter((n) => n.part).map((n) => ({
349
- st: y(n.start),
350
- et: y(n.end),
391
+ st: g(n.start),
392
+ et: g(n.end),
351
393
  text: n.part
352
394
  }));
353
395
  }
354
- async function zt(e) {
355
- return Ye(xt(e));
356
- }
357
396
  async function kt(e) {
397
+ return Ye(jt(e));
398
+ }
399
+ async function zt(e) {
358
400
  return Pt(e);
359
401
  }
360
402
  async function Nt(e) {
@@ -362,12 +404,12 @@ async function Nt(e) {
362
404
  }
363
405
  const Ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
364
406
  __proto__: null,
365
- assToAimSegments: zt,
407
+ assToAimSegments: kt,
366
408
  createTranslateStreamParser: It,
367
409
  createWhisperStreamParser: Ct,
368
410
  openaiToAimSegments: Nt,
369
411
  srtToAimSegments: Mt,
370
- tingwuToAimSegments: kt,
412
+ tingwuToAimSegments: zt,
371
413
  vttToAimSegments: Ye
372
414
  }, Symbol.toStringTag, { value: "Module" }));
373
415
  class Bt {
@@ -452,24 +494,24 @@ const _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
452
494
  __proto__: null,
453
495
  StreamFilter: Bt
454
496
  }, Symbol.toStringTag, { value: "Module" }));
455
- var Xe = typeof global == "object" && global && global.Object === Object && global, Dt = typeof self == "object" && self && self.Object === Object && self, j = Xe || Dt || Function("return this")(), L = j.Symbol, Ze = Object.prototype, Gt = Ze.hasOwnProperty, Ut = Ze.toString, G = L ? L.toStringTag : void 0;
456
- function Rt(e) {
457
- var t = Gt.call(e, G), r = e[G];
497
+ var Xe = typeof global == "object" && global && global.Object === Object && global, Dt = typeof self == "object" && self && self.Object === Object && self, S = Xe || Dt || Function("return this")(), L = S.Symbol, Ze = Object.prototype, Rt = Ze.hasOwnProperty, Gt = Ze.toString, R = L ? L.toStringTag : void 0;
498
+ function Ut(e) {
499
+ var t = Rt.call(e, R), r = e[R];
458
500
  try {
459
- e[G] = void 0;
501
+ e[R] = void 0;
460
502
  var n = !0;
461
503
  } catch {
462
504
  }
463
- var a = Ut.call(e);
464
- return n && (t ? e[G] = r : delete e[G]), a;
505
+ var a = Gt.call(e);
506
+ return n && (t ? e[R] = r : delete e[R]), a;
465
507
  }
466
- var Ht = Object.prototype, Kt = Ht.toString;
467
- function Wt(e) {
468
- return Kt.call(e);
508
+ var Ht = Object.prototype, Wt = Ht.toString;
509
+ function Kt(e) {
510
+ return Wt.call(e);
469
511
  }
470
512
  var Vt = "[object Null]", qt = "[object Undefined]", $e = L ? L.toStringTag : void 0;
471
- function W(e) {
472
- return e == null ? e === void 0 ? qt : Vt : $e && $e in Object(e) ? Rt(e) : Wt(e);
513
+ function K(e) {
514
+ return e == null ? e === void 0 ? qt : Vt : $e && $e in Object(e) ? Ut(e) : Kt(e);
473
515
  }
474
516
  function V(e) {
475
517
  return e != null && typeof e == "object";
@@ -483,10 +525,10 @@ var Jt = "[object AsyncFunction]", Yt = "[object Function]", Xt = "[object Gener
483
525
  function Qe(e) {
484
526
  if (!q(e))
485
527
  return !1;
486
- var t = W(e);
528
+ var t = K(e);
487
529
  return t == Yt || t == Xt || t == Jt || t == Zt;
488
530
  }
489
- var ce = j["__core-js_shared__"], we = function() {
531
+ var ce = S["__core-js_shared__"], we = function() {
490
532
  var e = /[^.]+$/.exec(ce && ce.keys && ce.keys.IE_PROTO || "");
491
533
  return e ? "Symbol(src)_1." + e : "";
492
534
  }();
@@ -516,14 +558,14 @@ function ur(e) {
516
558
  var t = Qe(e) ? or : nr;
517
559
  return t.test(C(e));
518
560
  }
519
- function fr(e, t) {
561
+ function lr(e, t) {
520
562
  return e == null ? void 0 : e[t];
521
563
  }
522
564
  function F(e, t) {
523
- var r = fr(e, t);
565
+ var r = lr(e, t);
524
566
  return ur(r) ? r : void 0;
525
567
  }
526
- var ue = F(j, "WeakMap"), Oe = Object.create, lr = /* @__PURE__ */ function() {
568
+ var ue = F(S, "WeakMap"), Oe = Object.create, fr = /* @__PURE__ */ function() {
527
569
  function e() {
528
570
  }
529
571
  return function(t) {
@@ -601,32 +643,32 @@ function _r(e, t) {
601
643
  n[r] = t(r);
602
644
  return n;
603
645
  }
604
- var Sr = "[object Arguments]";
646
+ var xr = "[object Arguments]";
605
647
  function Pe(e) {
606
- return V(e) && W(e) == Sr;
648
+ return V(e) && K(e) == xr;
607
649
  }
608
- var st = Object.prototype, jr = st.hasOwnProperty, xr = st.propertyIsEnumerable, $r = Pe(/* @__PURE__ */ function() {
650
+ var st = Object.prototype, Sr = st.hasOwnProperty, jr = st.propertyIsEnumerable, $r = Pe(/* @__PURE__ */ function() {
609
651
  return arguments;
610
652
  }()) ? Pe : function(e) {
611
- return V(e) && jr.call(e, "callee") && !xr.call(e, "callee");
653
+ return V(e) && Sr.call(e, "callee") && !jr.call(e, "callee");
612
654
  };
613
655
  function wr() {
614
656
  return !1;
615
657
  }
616
- var it = typeof exports == "object" && exports && !exports.nodeType && exports, Ee = it && typeof module == "object" && module && !module.nodeType && module, Or = Ee && Ee.exports === it, Ce = Or ? j.Buffer : void 0, Ar = Ce ? Ce.isBuffer : void 0, ct = Ar || wr, Pr = "[object Arguments]", Er = "[object Array]", Cr = "[object Boolean]", Fr = "[object Date]", Ir = "[object Error]", Lr = "[object Function]", Mr = "[object Map]", zr = "[object Number]", kr = "[object Object]", Nr = "[object RegExp]", Br = "[object Set]", Dr = "[object String]", Gr = "[object WeakMap]", Ur = "[object ArrayBuffer]", Rr = "[object DataView]", Hr = "[object Float32Array]", Kr = "[object Float64Array]", Wr = "[object Int8Array]", Vr = "[object Int16Array]", qr = "[object Int32Array]", Jr = "[object Uint8Array]", Yr = "[object Uint8ClampedArray]", Xr = "[object Uint16Array]", Zr = "[object Uint32Array]", d = {};
617
- d[Hr] = d[Kr] = d[Wr] = d[Vr] = d[qr] = d[Jr] = d[Yr] = d[Xr] = d[Zr] = !0;
618
- d[Pr] = d[Er] = d[Ur] = d[Cr] = d[Rr] = d[Fr] = d[Ir] = d[Lr] = d[Mr] = d[zr] = d[kr] = d[Nr] = d[Br] = d[Dr] = d[Gr] = !1;
658
+ var it = typeof exports == "object" && exports && !exports.nodeType && exports, Ee = it && typeof module == "object" && module && !module.nodeType && module, Or = Ee && Ee.exports === it, Ce = Or ? S.Buffer : void 0, Ar = Ce ? Ce.isBuffer : void 0, ct = Ar || wr, Pr = "[object Arguments]", Er = "[object Array]", Cr = "[object Boolean]", Fr = "[object Date]", Ir = "[object Error]", Lr = "[object Function]", Mr = "[object Map]", kr = "[object Number]", zr = "[object Object]", Nr = "[object RegExp]", Br = "[object Set]", Dr = "[object String]", Rr = "[object WeakMap]", Gr = "[object ArrayBuffer]", Ur = "[object DataView]", Hr = "[object Float32Array]", Wr = "[object Float64Array]", Kr = "[object Int8Array]", Vr = "[object Int16Array]", qr = "[object Int32Array]", Jr = "[object Uint8Array]", Yr = "[object Uint8ClampedArray]", Xr = "[object Uint16Array]", Zr = "[object Uint32Array]", d = {};
659
+ d[Hr] = d[Wr] = d[Kr] = d[Vr] = d[qr] = d[Jr] = d[Yr] = d[Xr] = d[Zr] = !0;
660
+ d[Pr] = d[Er] = d[Gr] = d[Cr] = d[Ur] = d[Fr] = d[Ir] = d[Lr] = d[Mr] = d[kr] = d[zr] = d[Nr] = d[Br] = d[Dr] = d[Rr] = !1;
619
661
  function Qr(e) {
620
- return V(e) && nt(e.length) && !!d[W(e)];
662
+ return V(e) && nt(e.length) && !!d[K(e)];
621
663
  }
622
664
  function pe(e) {
623
665
  return function(t) {
624
666
  return e(t);
625
667
  };
626
668
  }
627
- var ot = typeof exports == "object" && exports && !exports.nodeType && exports, R = ot && typeof module == "object" && module && !module.nodeType && module, en = R && R.exports === ot, oe = en && Xe.process, M = function() {
669
+ var ot = typeof exports == "object" && exports && !exports.nodeType && exports, U = ot && typeof module == "object" && module && !module.nodeType && module, en = U && U.exports === ot, oe = en && Xe.process, M = function() {
628
670
  try {
629
- var e = R && R.require && R.require("util").types;
671
+ var e = U && U.require && U.require("util").types;
630
672
  return e || oe && oe.binding && oe.binding("util");
631
673
  } catch {
632
674
  }
@@ -641,12 +683,12 @@ function ut(e, t) {
641
683
  br(o, i))) && u.push(o);
642
684
  return u;
643
685
  }
644
- function ft(e, t) {
686
+ function lt(e, t) {
645
687
  return function(r) {
646
688
  return e(t(r));
647
689
  };
648
690
  }
649
- var an = ft(Object.keys, Object), sn = Object.prototype, cn = sn.hasOwnProperty;
691
+ var an = lt(Object.keys, Object), sn = Object.prototype, cn = sn.hasOwnProperty;
650
692
  function on(e) {
651
693
  if (!ge(e))
652
694
  return an(e);
@@ -665,13 +707,13 @@ function un(e) {
665
707
  t.push(r);
666
708
  return t;
667
709
  }
668
- var fn = Object.prototype, ln = fn.hasOwnProperty;
710
+ var ln = Object.prototype, fn = ln.hasOwnProperty;
669
711
  function hn(e) {
670
712
  if (!q(e))
671
713
  return un(e);
672
714
  var t = ge(e), r = [];
673
715
  for (var n in e)
674
- n == "constructor" && (t || !ln.call(e, n)) || r.push(n);
716
+ n == "constructor" && (t || !fn.call(e, n)) || r.push(n);
675
717
  return r;
676
718
  }
677
719
  function ye(e) {
@@ -699,10 +741,10 @@ function _n(e) {
699
741
  var t = this.__data__;
700
742
  return H ? t[e] !== void 0 : Tn.call(t, e);
701
743
  }
702
- var Sn = "__lodash_hash_undefined__";
703
- function jn(e, t) {
744
+ var xn = "__lodash_hash_undefined__";
745
+ function Sn(e, t) {
704
746
  var r = this.__data__;
705
- return this.size += this.has(e) ? 0 : 1, r[e] = H && t === void 0 ? Sn : t, this;
747
+ return this.size += this.has(e) ? 0 : 1, r[e] = H && t === void 0 ? xn : t, this;
706
748
  }
707
749
  function E(e) {
708
750
  var t = -1, r = e == null ? 0 : e.length;
@@ -715,8 +757,8 @@ E.prototype.clear = dn;
715
757
  E.prototype.delete = gn;
716
758
  E.prototype.get = mn;
717
759
  E.prototype.has = _n;
718
- E.prototype.set = jn;
719
- function xn() {
760
+ E.prototype.set = Sn;
761
+ function jn() {
720
762
  this.__data__ = [], this.size = 0;
721
763
  }
722
764
  function te(e, t) {
@@ -751,16 +793,16 @@ function w(e) {
751
793
  this.set(n[0], n[1]);
752
794
  }
753
795
  }
754
- w.prototype.clear = xn;
796
+ w.prototype.clear = jn;
755
797
  w.prototype.delete = On;
756
798
  w.prototype.get = An;
757
799
  w.prototype.has = Pn;
758
800
  w.prototype.set = En;
759
- var K = F(j, "Map");
801
+ var W = F(S, "Map");
760
802
  function Cn() {
761
803
  this.size = 0, this.__data__ = {
762
804
  hash: new E(),
763
- map: new (K || w)(),
805
+ map: new (W || w)(),
764
806
  string: new E()
765
807
  };
766
808
  }
@@ -782,29 +824,29 @@ function Ln(e) {
782
824
  function Mn(e) {
783
825
  return re(this, e).has(e);
784
826
  }
785
- function zn(e, t) {
827
+ function kn(e, t) {
786
828
  var r = re(this, e), n = r.size;
787
829
  return r.set(e, t), this.size += r.size == n ? 0 : 1, this;
788
830
  }
789
- function z(e) {
831
+ function k(e) {
790
832
  var t = -1, r = e == null ? 0 : e.length;
791
833
  for (this.clear(); ++t < r; ) {
792
834
  var n = e[t];
793
835
  this.set(n[0], n[1]);
794
836
  }
795
837
  }
796
- z.prototype.clear = Cn;
797
- z.prototype.delete = In;
798
- z.prototype.get = Ln;
799
- z.prototype.has = Mn;
800
- z.prototype.set = zn;
801
- function lt(e, t) {
838
+ k.prototype.clear = Cn;
839
+ k.prototype.delete = In;
840
+ k.prototype.get = Ln;
841
+ k.prototype.has = Mn;
842
+ k.prototype.set = kn;
843
+ function ft(e, t) {
802
844
  for (var r = -1, n = t.length, a = e.length; ++r < n; )
803
845
  e[a + r] = t[r];
804
846
  return e;
805
847
  }
806
- var ht = ft(Object.getPrototypeOf, Object);
807
- function kn() {
848
+ var ht = lt(Object.getPrototypeOf, Object);
849
+ function zn() {
808
850
  this.__data__ = new w(), this.size = 0;
809
851
  }
810
852
  function Nn(e) {
@@ -817,34 +859,34 @@ function Bn(e) {
817
859
  function Dn(e) {
818
860
  return this.__data__.has(e);
819
861
  }
820
- var Gn = 200;
821
- function Un(e, t) {
862
+ var Rn = 200;
863
+ function Gn(e, t) {
822
864
  var r = this.__data__;
823
865
  if (r instanceof w) {
824
866
  var n = r.__data__;
825
- if (!K || n.length < Gn - 1)
867
+ if (!W || n.length < Rn - 1)
826
868
  return n.push([e, t]), this.size = ++r.size, this;
827
- r = this.__data__ = new z(n);
869
+ r = this.__data__ = new k(n);
828
870
  }
829
871
  return r.set(e, t), this.size = r.size, this;
830
872
  }
831
- function k(e) {
873
+ function z(e) {
832
874
  var t = this.__data__ = new w(e);
833
875
  this.size = t.size;
834
876
  }
835
- k.prototype.clear = kn;
836
- k.prototype.delete = Nn;
837
- k.prototype.get = Bn;
838
- k.prototype.has = Dn;
839
- k.prototype.set = Un;
840
- function Rn(e, t) {
877
+ z.prototype.clear = zn;
878
+ z.prototype.delete = Nn;
879
+ z.prototype.get = Bn;
880
+ z.prototype.has = Dn;
881
+ z.prototype.set = Gn;
882
+ function Un(e, t) {
841
883
  return e && ee(t, be(t), e);
842
884
  }
843
885
  function Hn(e, t) {
844
886
  return e && ee(t, ye(t), e);
845
887
  }
846
- var dt = typeof exports == "object" && exports && !exports.nodeType && exports, Ie = dt && typeof module == "object" && module && !module.nodeType && module, Kn = Ie && Ie.exports === dt, Le = Kn ? j.Buffer : void 0, Me = Le ? Le.allocUnsafe : void 0;
847
- function Wn(e, t) {
888
+ var dt = typeof exports == "object" && exports && !exports.nodeType && exports, Ie = dt && typeof module == "object" && module && !module.nodeType && module, Wn = Ie && Ie.exports === dt, Le = Wn ? S.Buffer : void 0, Me = Le ? Le.allocUnsafe : void 0;
889
+ function Kn(e, t) {
848
890
  if (t)
849
891
  return e.slice();
850
892
  var r = e.length, n = Me ? Me(r) : new e.constructor(r);
@@ -860,8 +902,8 @@ function Vn(e, t) {
860
902
  function gt() {
861
903
  return [];
862
904
  }
863
- var qn = Object.prototype, Jn = qn.propertyIsEnumerable, ze = Object.getOwnPropertySymbols, me = ze ? function(e) {
864
- return e == null ? [] : (e = Object(e), Vn(ze(e), function(t) {
905
+ var qn = Object.prototype, Jn = qn.propertyIsEnumerable, ke = Object.getOwnPropertySymbols, me = ke ? function(e) {
906
+ return e == null ? [] : (e = Object(e), Vn(ke(e), function(t) {
865
907
  return Jn.call(e, t);
866
908
  }));
867
909
  } : gt;
@@ -870,7 +912,7 @@ function Yn(e, t) {
870
912
  }
871
913
  var Xn = Object.getOwnPropertySymbols, pt = Xn ? function(e) {
872
914
  for (var t = []; e; )
873
- lt(t, me(e)), e = ht(e);
915
+ ft(t, me(e)), e = ht(e);
874
916
  return t;
875
917
  } : gt;
876
918
  function Zn(e, t) {
@@ -878,7 +920,7 @@ function Zn(e, t) {
878
920
  }
879
921
  function bt(e, t, r) {
880
922
  var n = t(e);
881
- return de(e) ? n : lt(n, r(e));
923
+ return de(e) ? n : ft(n, r(e));
882
924
  }
883
925
  function Qn(e) {
884
926
  return bt(e, be, me);
@@ -886,15 +928,15 @@ function Qn(e) {
886
928
  function ea(e) {
887
929
  return bt(e, ye, pt);
888
930
  }
889
- var fe = F(j, "DataView"), le = F(j, "Promise"), he = F(j, "Set"), ke = "[object Map]", ta = "[object Object]", Ne = "[object Promise]", Be = "[object Set]", De = "[object WeakMap]", Ge = "[object DataView]", ra = C(fe), na = C(K), aa = C(le), sa = C(he), ia = C(ue), $ = W;
890
- (fe && $(new fe(new ArrayBuffer(1))) != Ge || K && $(new K()) != ke || le && $(le.resolve()) != Ne || he && $(new he()) != Be || ue && $(new ue()) != De) && ($ = function(e) {
891
- var t = W(e), r = t == ta ? e.constructor : void 0, n = r ? C(r) : "";
931
+ var le = F(S, "DataView"), fe = F(S, "Promise"), he = F(S, "Set"), ze = "[object Map]", ta = "[object Object]", Ne = "[object Promise]", Be = "[object Set]", De = "[object WeakMap]", Re = "[object DataView]", ra = C(le), na = C(W), aa = C(fe), sa = C(he), ia = C(ue), $ = K;
932
+ (le && $(new le(new ArrayBuffer(1))) != Re || W && $(new W()) != ze || fe && $(fe.resolve()) != Ne || he && $(new he()) != Be || ue && $(new ue()) != De) && ($ = function(e) {
933
+ var t = K(e), r = t == ta ? e.constructor : void 0, n = r ? C(r) : "";
892
934
  if (n)
893
935
  switch (n) {
894
936
  case ra:
895
- return Ge;
937
+ return Re;
896
938
  case na:
897
- return ke;
939
+ return ze;
898
940
  case aa:
899
941
  return Ne;
900
942
  case sa:
@@ -909,21 +951,21 @@ function ua(e) {
909
951
  var t = e.length, r = new e.constructor(t);
910
952
  return t && typeof e[0] == "string" && oa.call(e, "index") && (r.index = e.index, r.input = e.input), r;
911
953
  }
912
- var Ue = j.Uint8Array;
954
+ var Ge = S.Uint8Array;
913
955
  function ve(e) {
914
956
  var t = new e.constructor(e.byteLength);
915
- return new Ue(t).set(new Ue(e)), t;
957
+ return new Ge(t).set(new Ge(e)), t;
916
958
  }
917
- function fa(e, t) {
959
+ function la(e, t) {
918
960
  var r = t ? ve(e.buffer) : e.buffer;
919
961
  return new e.constructor(r, e.byteOffset, e.byteLength);
920
962
  }
921
- var la = /\w*$/;
963
+ var fa = /\w*$/;
922
964
  function ha(e) {
923
- var t = new e.constructor(e.source, la.exec(e));
965
+ var t = new e.constructor(e.source, fa.exec(e));
924
966
  return t.lastIndex = e.lastIndex, t;
925
967
  }
926
- var Re = L ? L.prototype : void 0, He = Re ? Re.valueOf : void 0;
968
+ var Ue = L ? L.prototype : void 0, He = Ue ? Ue.valueOf : void 0;
927
969
  function da(e) {
928
970
  return He ? Object(He.call(e)) : {};
929
971
  }
@@ -931,17 +973,17 @@ function ga(e, t) {
931
973
  var r = t ? ve(e.buffer) : e.buffer;
932
974
  return new e.constructor(r, e.byteOffset, e.length);
933
975
  }
934
- var pa = "[object Boolean]", ba = "[object Date]", ya = "[object Map]", ma = "[object Number]", va = "[object RegExp]", Ta = "[object Set]", _a = "[object String]", Sa = "[object Symbol]", ja = "[object ArrayBuffer]", xa = "[object DataView]", $a = "[object Float32Array]", wa = "[object Float64Array]", Oa = "[object Int8Array]", Aa = "[object Int16Array]", Pa = "[object Int32Array]", Ea = "[object Uint8Array]", Ca = "[object Uint8ClampedArray]", Fa = "[object Uint16Array]", Ia = "[object Uint32Array]";
976
+ var pa = "[object Boolean]", ba = "[object Date]", ya = "[object Map]", ma = "[object Number]", va = "[object RegExp]", Ta = "[object Set]", _a = "[object String]", xa = "[object Symbol]", Sa = "[object ArrayBuffer]", ja = "[object DataView]", $a = "[object Float32Array]", wa = "[object Float64Array]", Oa = "[object Int8Array]", Aa = "[object Int16Array]", Pa = "[object Int32Array]", Ea = "[object Uint8Array]", Ca = "[object Uint8ClampedArray]", Fa = "[object Uint16Array]", Ia = "[object Uint32Array]";
935
977
  function La(e, t, r) {
936
978
  var n = e.constructor;
937
979
  switch (t) {
938
- case ja:
980
+ case Sa:
939
981
  return ve(e);
940
982
  case pa:
941
983
  case ba:
942
984
  return new n(+e);
943
- case xa:
944
- return fa(e, r);
985
+ case ja:
986
+ return la(e, r);
945
987
  case $a:
946
988
  case wa:
947
989
  case Oa:
@@ -961,59 +1003,59 @@ function La(e, t, r) {
961
1003
  return ha(e);
962
1004
  case Ta:
963
1005
  return new n();
964
- case Sa:
1006
+ case xa:
965
1007
  return da(e);
966
1008
  }
967
1009
  }
968
1010
  function Ma(e) {
969
- return typeof e.constructor == "function" && !ge(e) ? lr(ht(e)) : {};
1011
+ return typeof e.constructor == "function" && !ge(e) ? fr(ht(e)) : {};
970
1012
  }
971
- var za = "[object Map]";
972
- function ka(e) {
973
- return V(e) && $(e) == za;
1013
+ var ka = "[object Map]";
1014
+ function za(e) {
1015
+ return V(e) && $(e) == ka;
974
1016
  }
975
- var Ke = M && M.isMap, Na = Ke ? pe(Ke) : ka, Ba = "[object Set]";
1017
+ var We = M && M.isMap, Na = We ? pe(We) : za, Ba = "[object Set]";
976
1018
  function Da(e) {
977
1019
  return V(e) && $(e) == Ba;
978
1020
  }
979
- var We = M && M.isSet, Ga = We ? pe(We) : Da, Ua = 1, Ra = 2, Ha = 4, yt = "[object Arguments]", Ka = "[object Array]", Wa = "[object Boolean]", Va = "[object Date]", qa = "[object Error]", mt = "[object Function]", Ja = "[object GeneratorFunction]", Ya = "[object Map]", Xa = "[object Number]", vt = "[object Object]", Za = "[object RegExp]", Qa = "[object Set]", es = "[object String]", ts = "[object Symbol]", rs = "[object WeakMap]", ns = "[object ArrayBuffer]", as = "[object DataView]", ss = "[object Float32Array]", is = "[object Float64Array]", cs = "[object Int8Array]", os = "[object Int16Array]", us = "[object Int32Array]", fs = "[object Uint8Array]", ls = "[object Uint8ClampedArray]", hs = "[object Uint16Array]", ds = "[object Uint32Array]", h = {};
980
- h[yt] = h[Ka] = h[ns] = h[as] = h[Wa] = h[Va] = h[ss] = h[is] = h[cs] = h[os] = h[us] = h[Ya] = h[Xa] = h[vt] = h[Za] = h[Qa] = h[es] = h[ts] = h[fs] = h[ls] = h[hs] = h[ds] = !0;
1021
+ var Ke = M && M.isSet, Ra = Ke ? pe(Ke) : Da, Ga = 1, Ua = 2, Ha = 4, yt = "[object Arguments]", Wa = "[object Array]", Ka = "[object Boolean]", Va = "[object Date]", qa = "[object Error]", mt = "[object Function]", Ja = "[object GeneratorFunction]", Ya = "[object Map]", Xa = "[object Number]", vt = "[object Object]", Za = "[object RegExp]", Qa = "[object Set]", es = "[object String]", ts = "[object Symbol]", rs = "[object WeakMap]", ns = "[object ArrayBuffer]", as = "[object DataView]", ss = "[object Float32Array]", is = "[object Float64Array]", cs = "[object Int8Array]", os = "[object Int16Array]", us = "[object Int32Array]", ls = "[object Uint8Array]", fs = "[object Uint8ClampedArray]", hs = "[object Uint16Array]", ds = "[object Uint32Array]", h = {};
1022
+ h[yt] = h[Wa] = h[ns] = h[as] = h[Ka] = h[Va] = h[ss] = h[is] = h[cs] = h[os] = h[us] = h[Ya] = h[Xa] = h[vt] = h[Za] = h[Qa] = h[es] = h[ts] = h[ls] = h[fs] = h[hs] = h[ds] = !0;
981
1023
  h[qa] = h[mt] = h[rs] = !1;
982
1024
  function Q(e, t, r, n, a, c) {
983
- var s, u = t & Ua, i = t & Ra, o = t & Ha;
1025
+ var s, u = t & Ga, i = t & Ua, o = t & Ha;
984
1026
  if (s !== void 0)
985
1027
  return s;
986
1028
  if (!q(e))
987
1029
  return e;
988
- var f = de(e);
989
- if (f) {
1030
+ var l = de(e);
1031
+ if (l) {
990
1032
  if (s = ua(e), !u)
991
1033
  return hr(e, s);
992
1034
  } else {
993
- var l = $(e), v = l == mt || l == Ja;
1035
+ var f = $(e), v = f == mt || f == Ja;
994
1036
  if (ct(e))
995
- return Wn(e, u);
996
- if (l == vt || l == yt || v && !a) {
1037
+ return Kn(e, u);
1038
+ if (f == vt || f == yt || v && !a) {
997
1039
  if (s = i || v ? {} : Ma(e), !u)
998
- return i ? Zn(e, Hn(s, e)) : Yn(e, Rn(s, e));
1040
+ return i ? Zn(e, Hn(s, e)) : Yn(e, Un(s, e));
999
1041
  } else {
1000
- if (!h[l])
1042
+ if (!h[f])
1001
1043
  return a ? e : {};
1002
- s = La(e, l, u);
1044
+ s = La(e, f, u);
1003
1045
  }
1004
1046
  }
1005
- c || (c = new k());
1047
+ c || (c = new z());
1006
1048
  var T = c.get(e);
1007
1049
  if (T)
1008
1050
  return T;
1009
- c.set(e, s), Ga(e) ? e.forEach(function(g) {
1010
- s.add(Q(g, t, r, g, e, c));
1011
- }) : Na(e) && e.forEach(function(g, p) {
1012
- s.set(p, Q(g, t, r, p, e, c));
1051
+ c.set(e, s), Ra(e) ? e.forEach(function(p) {
1052
+ s.add(Q(p, t, r, p, e, c));
1053
+ }) : Na(e) && e.forEach(function(p, b) {
1054
+ s.set(b, Q(p, t, r, b, e, c));
1013
1055
  });
1014
- var _ = o ? i ? ea : Qn : i ? ye : be, b = f ? void 0 : _(e);
1015
- return dr(b || e, function(g, p) {
1016
- b && (p = g, g = e[p]), rt(s, p, Q(g, t, r, p, e, c));
1056
+ var _ = o ? i ? ea : Qn : i ? ye : be, y = l ? void 0 : _(e);
1057
+ return dr(y || e, function(p, b) {
1058
+ y && (b = p, p = e[b]), rt(s, b, Q(p, t, r, b, e, c));
1017
1059
  }), s;
1018
1060
  }
1019
1061
  var gs = 1, ps = 4;
@@ -1059,8 +1101,8 @@ function ys(e, t) {
1059
1101
  r = i;
1060
1102
  }
1061
1103
  }), a = (i) => i.trim().length === 0, c = (i) => {
1062
- const o = A(i.st), f = A(i.et);
1063
- return o >= f;
1104
+ const o = A(i.st), l = A(i.et);
1105
+ return o >= l;
1064
1106
  }, s = {
1065
1107
  emt: [],
1066
1108
  ep: [],
@@ -1070,15 +1112,15 @@ function ys(e, t) {
1070
1112
  space: []
1071
1113
  }, u = [];
1072
1114
  return e.forEach((i, o) => {
1073
- const f = P.punc.test(i.text), l = P.em.test(i.text), v = P.space.test(i.text), T = a(i.text), _ = c(i), b = P.ep.test(i.text);
1074
- n.push(i), i.punc = f ? 1 : 0, f && s.punc.push(o), i.em = l ? 1 : 0, l && s.em.push(o), i.space = v ? 1 : 0, v && (t != null && t.space ? i.text = i.text.replace(P.space, " ").trim() : s.space.push(o)), i.emt = a(i.text) ? 1 : 0, T && (t != null && t.emt || s.emt.push(o)), i.zf = c(i) ? 1 : 0, _ && (t != null && t.zf || s.zf.push(o)), i.ep = b ? 1 : 0, b && (t != null && t.ep ? i.text = i.text.replace(P.ep, "") : s.ep.push(o)), !(t != null && t.zf && i.zf) && (t != null && t.emt && i.emt || u.push(i));
1115
+ const l = P.punc.test(i.text), f = P.em.test(i.text), v = P.space.test(i.text), T = a(i.text), _ = c(i), y = P.ep.test(i.text);
1116
+ n.push(i), i.punc = l ? 1 : 0, l && s.punc.push(o), i.em = f ? 1 : 0, f && s.em.push(o), i.space = v ? 1 : 0, v && (t != null && t.space ? i.text = i.text.replace(P.space, " ").trim() : s.space.push(o)), i.emt = a(i.text) ? 1 : 0, T && (t != null && t.emt || s.emt.push(o)), i.zf = c(i) ? 1 : 0, _ && (t != null && t.zf || s.zf.push(o)), i.ep = y ? 1 : 0, y && (t != null && t.ep ? i.text = i.text.replace(P.ep, "") : s.ep.push(o)), !(t != null && t.zf && i.zf) && (t != null && t.emt && i.emt || u.push(i));
1075
1117
  }), n.end(), {
1076
1118
  result: s,
1077
1119
  repeat: r,
1078
1120
  segments: u
1079
1121
  };
1080
1122
  }
1081
- const Ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1123
+ const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1082
1124
  __proto__: null,
1083
1125
  RepeatCheck: Tt,
1084
1126
  subtitleOptimization: ys,
@@ -1087,6 +1129,6 @@ const Ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1087
1129
  export {
1088
1130
  _s as filter,
1089
1131
  Ts as parser,
1090
- Ss as tools,
1132
+ xs as tools,
1091
1133
  vs as utils
1092
1134
  };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@aim-packages/subtitle",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "main": "dist/index.cjs.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "build": "tsc && vite build",
9
- "preview": "vite preview"
9
+ "preview": "vite preview",
10
+ "release": "pnpm build && npm publish --registry=https://registry.npmjs.org/ --access public"
10
11
  },
11
12
  "devDependencies": {
12
13
  "@types/lodash-es": "^4.17.12",