easyproctor-hml 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- "use strict";(()=>{var Xd=Object.create;var Kc=Object.defineProperty;var Kd=Object.getOwnPropertyDescriptor;var Wd=Object.getOwnPropertyNames;var Yd=Object.getPrototypeOf,$d=Object.prototype.hasOwnProperty;var Wc=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Zd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Wd(e))!$d.call(t,i)&&i!==r&&Kc(t,i,{get:()=>e[i],enumerable:!(n=Kd(e,i))||n.enumerable});return t};var Qd=(t,e,r)=>(r=t!=null?Xd(Yd(t)):{},Zd(e||!t||!t.__esModule?Kc(r,"default",{value:t,enumerable:!0}):r,t));var i1=Wc((Wm,n1)=>{n1.exports=typeof self=="object"?self.FormData:window.FormData});var kf=Wc((gc,bc)=>{"use strict";(function(t,e){typeof gc=="object"&&typeof bc<"u"?bc.exports=e():typeof define=="function"&&define.amd?define(e):t.MicRecorder=e()})(gc,function(){function t(C){return new Int8Array(C)}function e(C){return new Int16Array(C)}function r(C){return new Int32Array(C)}function n(C){return new Float32Array(C)}function i(C){return new Float64Array(C)}function a(C){if(C.length==1)return n(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(a(C));return ie}function s(C){if(C.length==1)return r(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(s(C));return ie}function v(C){if(C.length==1)return e(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(v(C));return ie}function d(C){if(C.length==1)return new Array(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(d(C));return ie}var p={};p.fill=function(C,$,ie,Z){if(arguments.length==2)for(var ye=0;ye<C.length;ye++)C[ye]=arguments[1];else for(var ye=$;ye<ie;ye++)C[ye]=Z};var B={};B.arraycopy=function(C,$,ie,Z,ye){for(var Q=$+ye;$<Q;)ie[Z++]=C[$++]};var z={};z.SQRT2=1.4142135623730951,z.FAST_LOG10=function(C){return Math.log10(C)},z.FAST_LOG10_X=function(C,$){return Math.log10(C)*$};function ee(C){this.ordinal=C}ee.short_block_allowed=new ee(0),ee.short_block_coupled=new ee(1),ee.short_block_dispensed=new ee(2),ee.short_block_forced=new ee(3);var te={};te.MAX_VALUE=34028235e31;function D(C){this.ordinal=C}D.vbr_off=new D(0),D.vbr_mt=new D(1),D.vbr_rh=new D(2),D.vbr_abr=new D(3),D.vbr_mtrh=new D(4),D.vbr_default=D.vbr_mtrh;var ce=function(C){},P={System:B,VbrMode:D,Float:te,ShortBlock:ee,Util:z,Arrays:p,new_array_n:d,new_byte:t,new_double:i,new_float:n,new_float_n:a,new_int:r,new_int_n:s,new_short:e,new_short_n:v,assert:ce},oe=P.System,se=P.Util,xe=P.Arrays,Ge=P.new_float;function lt(){var C=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152,321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375,-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.7960341867115,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542,355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463,-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965,29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006,.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487,26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164,.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184,23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734,.04912684976946725,1.990369453344394,.035780907*se.SQRT2*.5/2384e-9,.017876148*se.SQRT2*.5/2384e-9,.003134727*se.SQRT2*.5/2384e-9,.002457142*se.SQRT2*.5/2384e-9,971317e-9*se.SQRT2*.5/2384e-9,218868e-9*se.SQRT2*.5/2384e-9,101566e-9*se.SQRT2*.5/2384e-9,13828e-9*se.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],$=12,ie=36,Z=[[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,940084909404969e-27,6423305872147839e-28,2382191739347918e-28,5456116108943412e-27,4878985199565852e-27,4240448995017367e-27,3559909094758252e-27,2858043359288075e-27,2156177623817898e-27,1475637723558783e-27,8371015190102974e-28,2599706096327376e-28,-5456116108943412e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758252e-27,-2858043359288076e-27,-2156177623817898e-27,-1475637723558783e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347923e-28,-6423305872147843e-28,-9400849094049696e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049694e-28,-642330587214784e-27,-2382191739347918e-28],[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,9400849094049688e-28,6423305872147841e-28,2382191739347918e-28,5456116108943413e-27,4878985199565852e-27,4240448995017367e-27,3559909094758253e-27,2858043359288075e-27,2156177623817898e-27,1475637723558782e-27,8371015190102975e-28,2599706096327376e-28,-5461314069809755e-27,-4921085770524055e-27,-4343405037091838e-27,-3732668368707687e-27,-3093523840190885e-27,-2430835727329465e-27,-1734679010007751e-27,-974825365660928e-27,-2797435120168326e-28,0,0,0,0,0,0,-2283748241799531e-28,-4037858874020686e-28,-2146547464825323e-28],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212,4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.9955178160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2283748241799531e-28,4037858874020686e-28,2146547464825323e-28,5461314069809755e-27,4921085770524055e-27,4343405037091838e-27,3732668368707687e-27,3093523840190885e-27,2430835727329466e-27,1734679010007751e-27,974825365660928e-27,2797435120168326e-28,-5456116108943413e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758253e-27,-2858043359288075e-27,-2156177623817898e-27,-1475637723558782e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347913e-28,-6423305872147834e-28,-9400849094049688e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049688e-28,-6423305872147841e-28,-2382191739347918e-28]],ye=Z[T.SHORT_TYPE],Q=Z[T.SHORT_TYPE],me=Z[T.SHORT_TYPE],Ne=Z[T.SHORT_TYPE],ke=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];function G(M,K,o){for(var I=10,H=K+238-14-286,O=-15;O<0;O++){var g,_,k;g=C[I+-10],_=M[H+-224]*g,k=M[K+224]*g,g=C[I+-9],_+=M[H+-160]*g,k+=M[K+160]*g,g=C[I+-8],_+=M[H+-96]*g,k+=M[K+96]*g,g=C[I+-7],_+=M[H+-32]*g,k+=M[K+32]*g,g=C[I+-6],_+=M[H+32]*g,k+=M[K+-32]*g,g=C[I+-5],_+=M[H+96]*g,k+=M[K+-96]*g,g=C[I+-4],_+=M[H+160]*g,k+=M[K+-160]*g,g=C[I+-3],_+=M[H+224]*g,k+=M[K+-224]*g,g=C[I+-2],_+=M[K+-256]*g,k-=M[H+256]*g,g=C[I+-1],_+=M[K+-192]*g,k-=M[H+192]*g,g=C[I+0],_+=M[K+-128]*g,k-=M[H+128]*g,g=C[I+1],_+=M[K+-64]*g,k-=M[H+64]*g,g=C[I+2],_+=M[K+0]*g,k-=M[H+0]*g,g=C[I+3],_+=M[K+64]*g,k-=M[H+-64]*g,g=C[I+4],_+=M[K+128]*g,k-=M[H+-128]*g,g=C[I+5],_+=M[K+192]*g,k-=M[H+-192]*g,_*=C[I+6],g=k-_,o[30+O*2]=k+_,o[31+O*2]=C[I+7]*g,I+=18,K--,H++}{var _,k,q,w;k=M[K+-16]*C[I+-10],_=M[K+-32]*C[I+-2],k+=(M[K+-48]-M[K+16])*C[I+-9],_+=M[K+-96]*C[I+-1],k+=(M[K+-80]+M[K+48])*C[I+-8],_+=M[K+-160]*C[I+0],k+=(M[K+-112]-M[K+80])*C[I+-7],_+=M[K+-224]*C[I+1],k+=(M[K+-144]+M[K+112])*C[I+-6],_-=M[K+32]*C[I+2],k+=(M[K+-176]-M[K+144])*C[I+-5],_-=M[K+96]*C[I+3],k+=(M[K+-208]+M[K+176])*C[I+-4],_-=M[K+160]*C[I+4],k+=(M[K+-240]-M[K+208])*C[I+-3],_-=M[K+224],q=_-k,w=_+k,k=o[14],_=o[15]-k,o[31]=w+k,o[30]=q+_,o[15]=q-_,o[14]=w-k}{var c;c=o[28]-o[0],o[0]+=o[28],o[28]=c*C[I+-2*18+7],c=o[29]-o[1],o[1]+=o[29],o[29]=c*C[I+-2*18+7],c=o[26]-o[2],o[2]+=o[26],o[26]=c*C[I+-4*18+7],c=o[27]-o[3],o[3]+=o[27],o[27]=c*C[I+-4*18+7],c=o[24]-o[4],o[4]+=o[24],o[24]=c*C[I+-6*18+7],c=o[25]-o[5],o[5]+=o[25],o[25]=c*C[I+-6*18+7],c=o[22]-o[6],o[6]+=o[22],o[22]=c*se.SQRT2,c=o[23]-o[7],o[7]+=o[23],o[23]=c*se.SQRT2-o[7],o[7]-=o[6],o[22]-=o[7],o[23]-=o[22],c=o[6],o[6]=o[31]-c,o[31]=o[31]+c,c=o[7],o[7]=o[30]-c,o[30]=o[30]+c,c=o[22],o[22]=o[15]-c,o[15]=o[15]+c,c=o[23],o[23]=o[14]-c,o[14]=o[14]+c,c=o[20]-o[8],o[8]+=o[20],o[20]=c*C[I+-10*18+7],c=o[21]-o[9],o[9]+=o[21],o[21]=c*C[I+-10*18+7],c=o[18]-o[10],o[10]+=o[18],o[18]=c*C[I+-12*18+7],c=o[19]-o[11],o[11]+=o[19],o[19]=c*C[I+-12*18+7],c=o[16]-o[12],o[12]+=o[16],o[16]=c*C[I+-14*18+7],c=o[17]-o[13],o[13]+=o[17],o[17]=c*C[I+-14*18+7],c=-o[20]+o[24],o[20]+=o[24],o[24]=c*C[I+-12*18+7],c=-o[21]+o[25],o[21]+=o[25],o[25]=c*C[I+-12*18+7],c=o[4]-o[8],o[4]+=o[8],o[8]=c*C[I+-12*18+7],c=o[5]-o[9],o[5]+=o[9],o[9]=c*C[I+-12*18+7],c=o[0]-o[12],o[0]+=o[12],o[12]=c*C[I+-4*18+7],c=o[1]-o[13],o[1]+=o[13],o[13]=c*C[I+-4*18+7],c=o[16]-o[28],o[16]+=o[28],o[28]=c*C[I+-4*18+7],c=-o[17]+o[29],o[17]+=o[29],o[29]=c*C[I+-4*18+7],c=se.SQRT2*(o[2]-o[10]),o[2]+=o[10],o[10]=c,c=se.SQRT2*(o[3]-o[11]),o[3]+=o[11],o[11]=c,c=se.SQRT2*(-o[18]+o[26]),o[18]+=o[26],o[26]=c-o[18],c=se.SQRT2*(-o[19]+o[27]),o[19]+=o[27],o[27]=c-o[19],c=o[2],o[19]-=o[3],o[3]-=c,o[2]=o[31]-c,o[31]+=c,c=o[3],o[11]-=o[19],o[18]-=c,o[3]=o[30]-c,o[30]+=c,c=o[18],o[27]-=o[11],o[19]-=c,o[18]=o[15]-c,o[15]+=c,c=o[19],o[10]-=c,o[19]=o[14]-c,o[14]+=c,c=o[10],o[11]-=c,o[10]=o[23]-c,o[23]+=c,c=o[11],o[26]-=c,o[11]=o[22]-c,o[22]+=c,c=o[26],o[27]-=c,o[26]=o[7]-c,o[7]+=c,c=o[27],o[27]=o[6]-c,o[6]+=c,c=se.SQRT2*(o[0]-o[4]),o[0]+=o[4],o[4]=c,c=se.SQRT2*(o[1]-o[5]),o[1]+=o[5],o[5]=c,c=se.SQRT2*(o[16]-o[20]),o[16]+=o[20],o[20]=c,c=se.SQRT2*(o[17]-o[21]),o[17]+=o[21],o[21]=c,c=-se.SQRT2*(o[8]-o[12]),o[8]+=o[12],o[12]=c-o[8],c=-se.SQRT2*(o[9]-o[13]),o[9]+=o[13],o[13]=c-o[9],c=-se.SQRT2*(o[25]-o[29]),o[25]+=o[29],o[29]=c-o[25],c=-se.SQRT2*(o[24]+o[28]),o[24]-=o[28],o[28]=c-o[24],c=o[24]-o[16],o[24]=c,c=o[20]-c,o[20]=c,c=o[28]-c,o[28]=c,c=o[25]-o[17],o[25]=c,c=o[21]-c,o[21]=c,c=o[29]-c,o[29]=c,c=o[17]-o[1],o[17]=c,c=o[9]-c,o[9]=c,c=o[25]-c,o[25]=c,c=o[5]-c,o[5]=c,c=o[21]-c,o[21]=c,c=o[13]-c,o[13]=c,c=o[29]-c,o[29]=c,c=o[1]-o[0],o[1]=c,c=o[16]-c,o[16]=c,c=o[17]-c,o[17]=c,c=o[8]-c,o[8]=c,c=o[9]-c,o[9]=c,c=o[24]-c,o[24]=c,c=o[25]-c,o[25]=c,c=o[4]-c,o[4]=c,c=o[5]-c,o[5]=c,c=o[20]-c,o[20]=c,c=o[21]-c,o[21]=c,c=o[12]-c,o[12]=c,c=o[13]-c,o[13]=c,c=o[28]-c,o[28]=c,c=o[29]-c,o[29]=c,c=o[0],o[0]+=o[31],o[31]-=c,c=o[1],o[1]+=o[30],o[30]-=c,c=o[16],o[16]+=o[15],o[15]-=c,c=o[17],o[17]+=o[14],o[14]-=c,c=o[8],o[8]+=o[23],o[23]-=c,c=o[9],o[9]+=o[22],o[22]-=c,c=o[24],o[24]+=o[7],o[7]-=c,c=o[25],o[25]+=o[6],o[6]-=c,c=o[4],o[4]+=o[27],o[27]-=c,c=o[5],o[5]+=o[26],o[26]-=c,c=o[20],o[20]+=o[11],o[11]-=c,c=o[21],o[21]+=o[10],o[10]-=c,c=o[12],o[12]+=o[19],o[19]-=c,c=o[13],o[13]+=o[18],o[18]-=c,c=o[28],o[28]+=o[3],o[3]-=c,c=o[29],o[29]+=o[2],o[2]-=c}}function de(M,K){for(var o=0;o<3;o++){var I,H,O,g,_,k;g=M[K+2*3]*Z[T.SHORT_TYPE][0]-M[K+5*3],I=M[K+0*3]*Z[T.SHORT_TYPE][2]-M[K+3*3],H=g+I,O=g-I,g=M[K+5*3]*Z[T.SHORT_TYPE][0]+M[K+2*3],I=M[K+3*3]*Z[T.SHORT_TYPE][2]+M[K+0*3],_=g+I,k=-g+I,I=(M[K+1*3]*Z[T.SHORT_TYPE][1]-M[K+4*3])*2069978111953089e-26,g=(M[K+4*3]*Z[T.SHORT_TYPE][1]+M[K+1*3])*2069978111953089e-26,M[K+3*0]=H*190752519173728e-25+I,M[K+3*5]=-_*190752519173728e-25+g,O=O*.8660254037844387*1907525191737281e-26,_=_*.5*1907525191737281e-26+g,M[K+3*1]=O-_,M[K+3*2]=O+_,H=H*.5*1907525191737281e-26-I,k=k*.8660254037844387*1907525191737281e-26,M[K+3*3]=H+k,M[K+3*4]=H-k,K++}}function he(M,K,o){var I,H;{var O,g,_,k,q,w,c,L;O=o[17]-o[9],_=o[15]-o[11],k=o[14]-o[12],q=o[0]+o[8],w=o[1]+o[7],c=o[2]+o[6],L=o[3]+o[5],M[K+17]=q+c-L-(w-o[4]),H=(q+c-L)*Q[12+7]+(w-o[4]),I=(O-_-k)*Q[12+6],M[K+5]=I+H,M[K+6]=I-H,g=(o[16]-o[10])*Q[12+6],w=w*Q[12+7]+o[4],I=O*Q[12+0]+g+_*Q[12+1]+k*Q[12+2],H=-q*Q[12+4]+w-c*Q[12+5]+L*Q[12+3],M[K+1]=I+H,M[K+2]=I-H,I=O*Q[12+1]-g-_*Q[12+2]+k*Q[12+0],H=-q*Q[12+5]+w-c*Q[12+3]+L*Q[12+4],M[K+9]=I+H,M[K+10]=I-H,I=O*Q[12+2]-g+_*Q[12+0]-k*Q[12+1],H=q*Q[12+3]-w+c*Q[12+4]-L*Q[12+5],M[K+13]=I+H,M[K+14]=I-H}{var y,u,m,b,l,h,x,E;y=o[8]-o[0],m=o[6]-o[2],b=o[5]-o[3],l=o[17]+o[9],h=o[16]+o[10],x=o[15]+o[11],E=o[14]+o[12],M[K+0]=l+x+E+(h+o[13]),I=(l+x+E)*Q[12+7]-(h+o[13]),H=(y-m+b)*Q[12+6],M[K+11]=I+H,M[K+12]=I-H,u=(o[7]-o[1])*Q[12+6],h=o[13]-h*Q[12+7],I=l*Q[12+3]-h+x*Q[12+4]+E*Q[12+5],H=y*Q[12+2]+u+m*Q[12+0]+b*Q[12+1],M[K+3]=I+H,M[K+4]=I-H,I=-l*Q[12+5]+h-x*Q[12+3]-E*Q[12+4],H=y*Q[12+1]+u-m*Q[12+2]-b*Q[12+0],M[K+7]=I+H,M[K+8]=I-H,I=-l*Q[12+4]+h-x*Q[12+5]-E*Q[12+3],H=y*Q[12+0]-u+m*Q[12+1]-b*Q[12+2],M[K+15]=I+H,M[K+16]=I-H}}this.mdct_sub48=function(M,K,o){for(var I=K,H=286,O=0;O<M.channels_out;O++){for(var g=0;g<M.mode_gr;g++){for(var _,k=M.l3_side.tt[g][O],q=k.xr,w=0,c=M.sb_sample[O][1-g],L=0,y=0;y<18/2;y++)for(G(I,H,c[L]),G(I,H+32,c[L+1]),L+=2,H+=64,_=1;_<32;_+=2)c[L-1][_]*=-1;for(_=0;_<32;_++,w+=18){var u=k.block_type,m=M.sb_sample[O][g],b=M.sb_sample[O][1-g];if(k.mixed_block_flag!=0&&_<2&&(u=0),M.amp_filter[_]<1e-12)xe.fill(q,w+0,w+18,0);else{if(M.amp_filter[_]<1)for(var y=0;y<18;y++)b[y][ke[_]]*=M.amp_filter[_];if(u==T.SHORT_TYPE){for(var y=-$/4;y<0;y++){var l=Z[T.SHORT_TYPE][y+3];q[w+y*3+9]=m[9+y][ke[_]]*l-m[8-y][ke[_]],q[w+y*3+18]=m[14-y][ke[_]]*l+m[15+y][ke[_]],q[w+y*3+10]=m[15+y][ke[_]]*l-m[14-y][ke[_]],q[w+y*3+19]=b[2-y][ke[_]]*l+b[3+y][ke[_]],q[w+y*3+11]=b[3+y][ke[_]]*l-b[2-y][ke[_]],q[w+y*3+20]=b[8-y][ke[_]]*l+b[9+y][ke[_]]}de(q,w)}else{for(var h=Ge(18),y=-ie/4;y<0;y++){var x,E;x=Z[u][y+27]*b[y+9][ke[_]]+Z[u][y+36]*b[8-y][ke[_]],E=Z[u][y+9]*m[y+9][ke[_]]-Z[u][y+18]*m[8-y][ke[_]],h[y+9]=x-E*ye[3+y+9],h[y+18]=x*ye[3+y+9]+E}he(q,w,h)}}if(u!=T.SHORT_TYPE&&_!=0)for(var y=7;y>=0;--y){var X,U;X=q[w+y]*me[20+y]+q[w+-1-y]*Ne[28+y],U=q[w+y]*Ne[28+y]-q[w+-1-y]*me[20+y],q[w+-1-y]=X,q[w+y]=U}}}if(I=o,H=286,M.mode_gr==1)for(var j=0;j<18;j++)oe.arraycopy(M.sb_sample[O][1][j],0,M.sb_sample[O][0][j],0,32)}}}var ft=lt,st=P.System,yt=P.new_float,Xt=P.new_float_n;function tr(){this.l=yt(T.SBMAX_l),this.s=Xt([T.SBMAX_s,3]);var C=this;this.assign=function($){st.arraycopy($.l,0,C.l,0,T.SBMAX_l);for(var ie=0;ie<T.SBMAX_s;ie++)for(var Z=0;Z<3;Z++)C.s[ie][Z]=$.s[ie][Z]}}var sr=tr;function an(){this.thm=new sr,this.en=new sr}var Tr=an,hr=P.System,gr=P.VbrMode,$t=P.new_array_n,St=P.new_float,kt=P.new_float_n,Nt=P.new_int,It=P.assert;Qe.ENCDELAY=576,Qe.POSTDELAY=1152,Qe.MDCTDELAY=48,Qe.FFTOFFSET=224+Qe.MDCTDELAY,Qe.DECDELAY=528,Qe.SBLIMIT=32,Qe.CBANDS=64,Qe.SBPSY_l=21,Qe.SBPSY_s=12,Qe.SBMAX_l=22,Qe.SBMAX_s=13,Qe.PSFB21=6,Qe.PSFB12=6,Qe.BLKSIZE=1024,Qe.HBLKSIZE=Qe.BLKSIZE/2+1,Qe.BLKSIZE_s=256,Qe.HBLKSIZE_s=Qe.BLKSIZE_s/2+1,Qe.NORM_TYPE=0,Qe.START_TYPE=1,Qe.SHORT_TYPE=2,Qe.STOP_TYPE=3,Qe.MPG_MD_LR_LR=0,Qe.MPG_MD_LR_I=1,Qe.MPG_MD_MS_LR=2,Qe.MPG_MD_MS_I=3,Qe.fircoef=[-.0207887*5,-.0378413*5,-.0432472*5,-.031183*5,779609e-23*5,.0467745*5,.10091*5,.151365*5,.187098*5];function Qe(){var C=ft,$=Tr,ie=Qe.FFTOFFSET,Z=Qe.MPG_MD_MS_LR,ye=null;this.psy=null;var Q=null,me=null,Ne=null;this.setModules=function(M,K,o,I){ye=M,this.psy=K,Q=K,me=I,Ne=o};var ke=new C;function G(M){var K,o;if(M.ATH.useAdjust==0){M.ATH.adjust=1;return}if(o=M.loudness_sq[0][0],K=M.loudness_sq[1][0],M.channels_out==2?(o+=M.loudness_sq[0][1],K+=M.loudness_sq[1][1]):(o+=o,K+=K),M.mode_gr==2&&(o=Math.max(o,K)),o*=.5,o*=M.ATH.aaSensitivityP,o>.03125)M.ATH.adjust>=1?M.ATH.adjust=1:M.ATH.adjust<M.ATH.adjustLimit&&(M.ATH.adjust=M.ATH.adjustLimit),M.ATH.adjustLimit=1;else{var I=31.98*o+625e-6;M.ATH.adjust>=I?(M.ATH.adjust*=I*.075+.925,M.ATH.adjust<I&&(M.ATH.adjust=I)):M.ATH.adjustLimit>=I?M.ATH.adjust=I:M.ATH.adjust<M.ATH.adjustLimit&&(M.ATH.adjust=M.ATH.adjustLimit),M.ATH.adjustLimit=I}}function de(M){var K,o;for(It(0<=M.bitrate_index&&M.bitrate_index<16),It(0<=M.mode_ext&&M.mode_ext<4),M.bitrate_stereoMode_Hist[M.bitrate_index][4]++,M.bitrate_stereoMode_Hist[15][4]++,M.channels_out==2&&(M.bitrate_stereoMode_Hist[M.bitrate_index][M.mode_ext]++,M.bitrate_stereoMode_Hist[15][M.mode_ext]++),K=0;K<M.mode_gr;++K)for(o=0;o<M.channels_out;++o){var I=M.l3_side.tt[K][o].block_type|0;M.l3_side.tt[K][o].mixed_block_flag!=0&&(I=4),M.bitrate_blockType_Hist[M.bitrate_index][I]++,M.bitrate_blockType_Hist[M.bitrate_index][5]++,M.bitrate_blockType_Hist[15][I]++,M.bitrate_blockType_Hist[15][5]++}}function he(M,K){var o=M.internal_flags,I,H;if(o.lame_encode_frame_init==0){var O,g,_=St(2014),k=St(286+1152+576);for(o.lame_encode_frame_init=1,O=0,g=0;O<286+576*(1+o.mode_gr);++O)O<576*o.mode_gr?(_[O]=0,o.channels_out==2&&(k[O]=0)):(_[O]=K[0][g],o.channels_out==2&&(k[O]=K[1][g]),++g);for(H=0;H<o.mode_gr;H++)for(I=0;I<o.channels_out;I++)o.l3_side.tt[H][I].block_type=Qe.SHORT_TYPE;ke.mdct_sub48(o,_,k),It(576>=Qe.FFTOFFSET),It(o.mf_size>=Qe.BLKSIZE+M.framesize-Qe.FFTOFFSET),It(o.mf_size>=512+M.framesize-32)}}this.lame_encode_mp3_frame=function(M,K,o,I,H,O){var g,_=$t([2,2]);_[0][0]=new $,_[0][1]=new $,_[1][0]=new $,_[1][1]=new $;var k=$t([2,2]);k[0][0]=new $,k[0][1]=new $,k[1][0]=new $,k[1][1]=new $;var q,w=[null,null],c=M.internal_flags,L=kt([2,4]),y=[.5,.5],u=[[0,0],[0,0]],m=[[0,0],[0,0]],b,l,h;if(w[0]=K,w[1]=o,c.lame_encode_frame_init==0&&he(M,w),c.padding=0,(c.slot_lag-=c.frac_SpF)<0&&(c.slot_lag+=M.out_samplerate,c.padding=1),c.psymodel!=0){var x,E=[null,null],X=0,U=Nt(2);for(h=0;h<c.mode_gr;h++){for(l=0;l<c.channels_out;l++)E[l]=w[l],X=576+h*576-Qe.FFTOFFSET;if(M.VBR==gr.vbr_mtrh||M.VBR==gr.vbr_mt?x=Q.L3psycho_anal_vbr(M,E,X,h,_,k,u[h],m[h],L[h],U):x=Q.L3psycho_anal_ns(M,E,X,h,_,k,u[h],m[h],L[h],U),x!=0)return-4;for(M.mode==nr.JOINT_STEREO&&(y[h]=L[h][2]+L[h][3],y[h]>0&&(y[h]=L[h][3]/y[h])),l=0;l<c.channels_out;l++){var j=c.l3_side.tt[h][l];j.block_type=U[l],j.mixed_block_flag=0}}}else for(h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)c.l3_side.tt[h][l].block_type=Qe.NORM_TYPE,c.l3_side.tt[h][l].mixed_block_flag=0,m[h][l]=u[h][l]=700;if(G(c),ke.mdct_sub48(c,w[0],w[1]),c.mode_ext=Qe.MPG_MD_LR_LR,M.force_ms)c.mode_ext=Qe.MPG_MD_MS_LR;else if(M.mode==nr.JOINT_STEREO){var Se=0,f=0;for(h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)Se+=m[h][l],f+=u[h][l];if(Se<=1*f){var S=c.l3_side.tt[0],fe=c.l3_side.tt[c.mode_gr-1];S[0].block_type==S[1].block_type&&fe[0].block_type==fe[1].block_type&&(c.mode_ext=Qe.MPG_MD_MS_LR)}}if(c.mode_ext==Z?(q=k,b=m):(q=_,b=u),M.analysis&&c.pinfo!=null)for(h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)c.pinfo.ms_ratio[h]=c.ms_ratio[h],c.pinfo.ms_ener_ratio[h]=y[h],c.pinfo.blocktype[h][l]=c.l3_side.tt[h][l].block_type,c.pinfo.pe[h][l]=b[h][l],hr.arraycopy(c.l3_side.tt[h][l].xr,0,c.pinfo.xr[h][l],0,576),c.mode_ext==Z&&(c.pinfo.ers[h][l]=c.pinfo.ers[h][l+2],hr.arraycopy(c.pinfo.energy[h][l+2],0,c.pinfo.energy[h][l],0,c.pinfo.energy[h][l].length));if(M.VBR==gr.vbr_off||M.VBR==gr.vbr_abr){var _e,Oe;for(_e=0;_e<18;_e++)c.nsPsy.pefirbuf[_e]=c.nsPsy.pefirbuf[_e+1];for(Oe=0,h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)Oe+=b[h][l];for(c.nsPsy.pefirbuf[18]=Oe,Oe=c.nsPsy.pefirbuf[9],_e=0;_e<9;_e++)Oe+=(c.nsPsy.pefirbuf[_e]+c.nsPsy.pefirbuf[18-_e])*Qe.fircoef[_e];for(Oe=670*5*c.mode_gr*c.channels_out/Oe,h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)b[h][l]*=Oe}if(c.iteration_loop.iteration_loop(M,b,y,q),ye.format_bitstream(M),g=ye.copy_buffer(c,I,H,O,1),M.bWriteVbrTag&&me.addVbrFrame(M),M.analysis&&c.pinfo!=null){for(l=0;l<c.channels_out;l++){var Ue;for(Ue=0;Ue<ie;Ue++)c.pinfo.pcmdata[l][Ue]=c.pinfo.pcmdata[l][Ue+M.framesize];for(Ue=ie;Ue<1600;Ue++)c.pinfo.pcmdata[l][Ue]=w[l][Ue-ie]}Ne.set_frame_pinfo(M,q)}return de(c),g}}var T=Qe,le=P.Util,Le=P.new_float;function $e(){var C=Le(T.BLKSIZE),$=Le(T.BLKSIZE_s/2),ie=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function Z(Q,me,Ne){var ke=0,G,de,he;Ne<<=1;var M=me+Ne;G=4;do{var K,o,I,H,O,g,_;_=G>>1,H=G,O=G<<1,g=O+H,G=O<<1,de=me,he=de+_;do{var k,q,w,c;q=Q[de+0]-Q[de+H],k=Q[de+0]+Q[de+H],c=Q[de+O]-Q[de+g],w=Q[de+O]+Q[de+g],Q[de+O]=k-w,Q[de+0]=k+w,Q[de+g]=q-c,Q[de+H]=q+c,q=Q[he+0]-Q[he+H],k=Q[he+0]+Q[he+H],c=le.SQRT2*Q[he+g],w=le.SQRT2*Q[he+O],Q[he+O]=k-w,Q[he+0]=k+w,Q[he+g]=q-c,Q[he+H]=q+c,he+=G,de+=G}while(de<M);for(o=ie[ke+0],K=ie[ke+1],I=1;I<_;I++){var L,y;L=1-2*K*K,y=2*K*o,de=me+I,he=me+H-I;do{var u,m,b,k,q,l,w,h,c,x;m=y*Q[de+H]-L*Q[he+H],u=L*Q[de+H]+y*Q[he+H],q=Q[de+0]-u,k=Q[de+0]+u,l=Q[he+0]-m,b=Q[he+0]+m,m=y*Q[de+g]-L*Q[he+g],u=L*Q[de+g]+y*Q[he+g],c=Q[de+O]-u,w=Q[de+O]+u,x=Q[he+O]-m,h=Q[he+O]+m,m=K*w-o*x,u=o*w+K*x,Q[de+O]=k-u,Q[de+0]=k+u,Q[he+g]=l-m,Q[he+H]=l+m,m=o*h-K*c,u=K*h+o*c,Q[he+O]=b-u,Q[he+0]=b+u,Q[de+g]=q-m,Q[de+H]=q+m,he+=G,de+=G}while(de<M);L=o,o=L*ie[ke+0]-K*ie[ke+1],K=L*ie[ke+1]+K*ie[ke+0]}ke+=2}while(G<Ne)}var ye=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254];this.fft_short=function(Q,me,Ne,ke,G){for(var de=0;de<3;de++){var he=T.BLKSIZE_s/2,M=65535&576/3*(de+1),K=T.BLKSIZE_s/8-1;do{var o,I,H,O,g,_=ye[K<<2]&255;o=$[_]*ke[Ne][G+_+M],g=$[127-_]*ke[Ne][G+_+M+128],I=o-g,o=o+g,H=$[_+64]*ke[Ne][G+_+M+64],g=$[63-_]*ke[Ne][G+_+M+192],O=H-g,H=H+g,he-=4,me[de][he+0]=o+H,me[de][he+2]=o-H,me[de][he+1]=I+O,me[de][he+3]=I-O,o=$[_+1]*ke[Ne][G+_+M+1],g=$[126-_]*ke[Ne][G+_+M+129],I=o-g,o=o+g,H=$[_+65]*ke[Ne][G+_+M+65],g=$[62-_]*ke[Ne][G+_+M+193],O=H-g,H=H+g,me[de][he+T.BLKSIZE_s/2+0]=o+H,me[de][he+T.BLKSIZE_s/2+2]=o-H,me[de][he+T.BLKSIZE_s/2+1]=I+O,me[de][he+T.BLKSIZE_s/2+3]=I-O}while(--K>=0);Z(me[de],he,T.BLKSIZE_s/2)}},this.fft_long=function(Q,me,Ne,ke,G){var de=T.BLKSIZE/8-1,he=T.BLKSIZE/2;do{var M,K,o,I,H,O=ye[de]&255;M=C[O]*ke[Ne][G+O],H=C[O+512]*ke[Ne][G+O+512],K=M-H,M=M+H,o=C[O+256]*ke[Ne][G+O+256],H=C[O+768]*ke[Ne][G+O+768],I=o-H,o=o+H,he-=4,me[he+0]=M+o,me[he+2]=M-o,me[he+1]=K+I,me[he+3]=K-I,M=C[O+1]*ke[Ne][G+O+1],H=C[O+513]*ke[Ne][G+O+513],K=M-H,M=M+H,o=C[O+257]*ke[Ne][G+O+257],H=C[O+769]*ke[Ne][G+O+769],I=o-H,o=o+H,me[he+T.BLKSIZE/2+0]=M+o,me[he+T.BLKSIZE/2+2]=M-o,me[he+T.BLKSIZE/2+1]=K+I,me[he+T.BLKSIZE/2+3]=K-I}while(--de>=0);Z(me,he,T.BLKSIZE/2)},this.init_fft=function(Q){for(var me=0;me<T.BLKSIZE;me++)C[me]=.42-.5*Math.cos(2*Math.PI*(me+.5)/T.BLKSIZE)+.08*Math.cos(4*Math.PI*(me+.5)/T.BLKSIZE);for(var me=0;me<T.BLKSIZE_s/2;me++)$[me]=.5*(1-Math.cos(2*Math.PI*(me+.5)/T.BLKSIZE_s))}}var ae=$e,be=P.VbrMode,Ie=P.Float,Ce=P.ShortBlock,Be=P.Util,Ye=P.Arrays,Fe=P.new_float,ot=P.new_float_n,mt=P.new_int,Ee=P.assert;function br(){var C=new ae,$=2.302585092994046,ie=2,Z=16,ye=2,Q=16,me=.34,Ne=1/(14752*14752)/(T.BLKSIZE/2),ke=.01,G=.8,de=.6,he=.3,M=3.5,K=4.4,o=25,I=21,H=.2302585093;function O(R){return R}function g(R,A){for(var F=0,V=0;V<T.BLKSIZE/2;++V)F+=R[V]*A.ATH.eql_w[V];return F*=Ne,F}function _(R,A,F,V,J,N,Y,re,W,ve,ne){var pe=R.internal_flags;if(W<2)C.fft_long(pe,V[J],W,ve,ne),C.fft_short(pe,N[Y],W,ve,ne);else if(W==2){for(var He=T.BLKSIZE-1;He>=0;--He){var rt=V[J+0][He],Re=V[J+1][He];V[J+0][He]=(rt+Re)*Be.SQRT2*.5,V[J+1][He]=(rt-Re)*Be.SQRT2*.5}for(var Ze=2;Ze>=0;--Ze)for(var He=T.BLKSIZE_s-1;He>=0;--He){var rt=N[Y+0][Ze][He],Re=N[Y+1][Ze][He];N[Y+0][Ze][He]=(rt+Re)*Be.SQRT2*.5,N[Y+1][Ze][He]=(rt-Re)*Be.SQRT2*.5}}A[0]=V[J+0][0],A[0]*=A[0];for(var He=T.BLKSIZE/2-1;He>=0;--He){var ue=V[J+0][T.BLKSIZE/2-He],Xe=V[J+0][T.BLKSIZE/2+He];A[T.BLKSIZE/2-He]=(ue*ue+Xe*Xe)*.5}for(var Ze=2;Ze>=0;--Ze){F[Ze][0]=N[Y+0][Ze][0],F[Ze][0]*=F[Ze][0];for(var He=T.BLKSIZE_s/2-1;He>=0;--He){var ue=N[Y+0][Ze][T.BLKSIZE_s/2-He],Xe=N[Y+0][Ze][T.BLKSIZE_s/2+He];F[Ze][T.BLKSIZE_s/2-He]=(ue*ue+Xe*Xe)*.5}}{for(var vt=0,He=11;He<T.HBLKSIZE;He++)vt+=A[He];pe.tot_ener[W]=vt}if(R.analysis){for(var He=0;He<T.HBLKSIZE;He++)pe.pinfo.energy[re][W][He]=pe.pinfo.energy_save[W][He],pe.pinfo.energy_save[W][He]=A[He];pe.pinfo.pe[re][W]=pe.pe[W]}R.athaa_loudapprox==2&&W<2&&(pe.loudness_sq[re][W]=pe.loudness_sq_save[W],pe.loudness_sq_save[W]=g(A,pe))}var k=8,q=23,w=15,c,L,y,u=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749];function m(){c=Math.pow(10,(k+1)/16),L=Math.pow(10,(q+1)/16),y=Math.pow(10,w/10)}var b=[3.3246*3.3246,3.23837*3.23837,3.15437*3.15437,3.00412*3.00412,2.86103*2.86103,2.65407*2.65407,2.46209*2.46209,2.284*2.284,2.11879*2.11879,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,1.56911*1.56911,1.46658*1.46658,1.37074*1.37074,1.31036*1.31036,1.25264*1.25264,1.20648*1.20648,1.16203*1.16203,1.12765*1.12765,1.09428*1.09428,1.0659*1.0659,1.03826*1.03826,1.01895*1.01895,1],l=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1],h=[2.35364*2.35364,2.29259*2.29259,2.23313*2.23313,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,1.49999*1.49999,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.11084*1.11084,1.03826*1.03826];function x(R,A,F,V,J,N){var Y;if(A>R)if(A<R*L)Y=A/R;else return R+A;else{if(R>=A*L)return R+A;Y=R/A}if(Ee(R>=0),Ee(A>=0),R+=A,V+3<=3+3){if(Y>=c)return R;var re=0|Be.FAST_LOG10_X(Y,16);return R*l[re]}var re=0|Be.FAST_LOG10_X(Y,16);if(N!=0?A=J.ATH.cb_s[F]*J.ATH.adjust:A=J.ATH.cb_l[F]*J.ATH.adjust,Ee(A>=0),R<y*A){if(R>A){var W,ve;return W=1,re<=13&&(W=h[re]),ve=Be.FAST_LOG10_X(R/A,10/15),R*((b[re]-W)*ve+W)}return re>13?R:R*h[re]}return R*b[re]}var E=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1];function X(R,A,F){var V;if(R<0&&(R=0),A<0&&(A=0),R<=0)return A;if(A<=0)return R;if(A>R?V=A/R:V=R/A,-2<=F&&F<=2){if(V>=c)return R+A;var J=0|Be.FAST_LOG10_X(V,16);return(R+A)*E[J]}return V<L?R+A:(R<A&&(R=A),R)}function U(R,A){var F=R.internal_flags;if(F.channels_out>1){for(var V=0;V<T.SBMAX_l;V++){var J=F.thm[0].l[V],N=F.thm[1].l[V];F.thm[0].l[V]+=N*A,F.thm[1].l[V]+=J*A}for(var V=0;V<T.SBMAX_s;V++)for(var Y=0;Y<3;Y++){var J=F.thm[0].s[V][Y],N=F.thm[1].s[V][Y];F.thm[0].s[V][Y]+=N*A,F.thm[1].s[V][Y]+=J*A}}}function j(R){for(var A=0;A<T.SBMAX_l;A++)if(!(R.thm[0].l[A]>1.58*R.thm[1].l[A]||R.thm[1].l[A]>1.58*R.thm[0].l[A])){var F=R.mld_l[A]*R.en[3].l[A],V=Math.max(R.thm[2].l[A],Math.min(R.thm[3].l[A],F));F=R.mld_l[A]*R.en[2].l[A];var J=Math.max(R.thm[3].l[A],Math.min(R.thm[2].l[A],F));R.thm[2].l[A]=V,R.thm[3].l[A]=J}for(var A=0;A<T.SBMAX_s;A++)for(var N=0;N<3;N++)if(!(R.thm[0].s[A][N]>1.58*R.thm[1].s[A][N]||R.thm[1].s[A][N]>1.58*R.thm[0].s[A][N])){var F=R.mld_s[A]*R.en[3].s[A][N],V=Math.max(R.thm[2].s[A][N],Math.min(R.thm[3].s[A][N],F));F=R.mld_s[A]*R.en[2].s[A][N];var J=Math.max(R.thm[3].s[A][N],Math.min(R.thm[2].s[A][N],F));R.thm[2].s[A][N]=V,R.thm[3].s[A][N]=J}}function Se(R,A,F){var V=A,J=Math.pow(10,F);A*=2,V*=2;for(var N=0;N<T.SBMAX_l;N++){var Y,re,W,ve;if(ve=R.ATH.cb_l[R.bm_l[N]]*J,Y=Math.min(Math.max(R.thm[0].l[N],ve),Math.max(R.thm[1].l[N],ve)),re=Math.max(R.thm[2].l[N],ve),W=Math.max(R.thm[3].l[N],ve),Y*A<re+W){var ne=Y*V/(re+W);re*=ne,W*=ne,Ee(re+W>0)}R.thm[2].l[N]=Math.min(re,R.thm[2].l[N]),R.thm[3].l[N]=Math.min(W,R.thm[3].l[N])}J*=T.BLKSIZE_s/T.BLKSIZE;for(var N=0;N<T.SBMAX_s;N++)for(var pe=0;pe<3;pe++){var Y,re,W,ve;if(ve=R.ATH.cb_s[R.bm_s[N]]*J,Y=Math.min(Math.max(R.thm[0].s[N][pe],ve),Math.max(R.thm[1].s[N][pe],ve)),re=Math.max(R.thm[2].s[N][pe],ve),W=Math.max(R.thm[3].s[N][pe],ve),Y*A<re+W){var ne=Y*A/(re+W);re*=ne,W*=ne,Ee(re+W>0)}R.thm[2].s[N][pe]=Math.min(R.thm[2].s[N][pe],re),R.thm[3].s[N][pe]=Math.min(R.thm[3].s[N][pe],W)}}function f(R,A,F,V,J){var N,Y,re=0,W=0;for(N=Y=0;N<T.SBMAX_s;++Y,++N){for(var ve=R.bo_s[N],ne=R.npart_s,pe=ve<ne?ve:ne;Y<pe;)Ee(A[Y]>=0),Ee(F[Y]>=0),re+=A[Y],W+=F[Y],Y++;if(R.en[V].s[N][J]=re,R.thm[V].s[N][J]=W,Y>=ne){++N;break}Ee(A[Y]>=0),Ee(F[Y]>=0);{var He=R.PSY.bo_s_weight[N],rt=1-He;re=He*A[Y],W=He*F[Y],R.en[V].s[N][J]+=re,R.thm[V].s[N][J]+=W,re=rt*A[Y],W=rt*F[Y]}}for(;N<T.SBMAX_s;++N)R.en[V].s[N][J]=0,R.thm[V].s[N][J]=0}function S(R,A,F,V){var J,N,Y=0,re=0;for(J=N=0;J<T.SBMAX_l;++N,++J){for(var W=R.bo_l[J],ve=R.npart_l,ne=W<ve?W:ve;N<ne;)Ee(A[N]>=0),Ee(F[N]>=0),Y+=A[N],re+=F[N],N++;if(R.en[V].l[J]=Y,R.thm[V].l[J]=re,N>=ve){++J;break}Ee(A[N]>=0),Ee(F[N]>=0);{var pe=R.PSY.bo_l_weight[J],He=1-pe;Y=pe*A[N],re=pe*F[N],R.en[V].l[J]+=Y,R.thm[V].l[J]+=re,Y=He*A[N],re=He*F[N]}}for(;J<T.SBMAX_l;++J)R.en[V].l[J]=0,R.thm[V].l[J]=0}function fe(R,A,F,V,J,N){var Y=R.internal_flags,re,W;for(W=re=0;W<Y.npart_s;++W){for(var ve=0,ne=0,pe=Y.numlines_s[W],He=0;He<pe;++He,++re){var rt=A[N][re];ve+=rt,ne<rt&&(ne=rt)}F[W]=ve}for(Ee(W==Y.npart_s),Ee(re==129),re=W=0;W<Y.npart_s;W++){var Re=Y.s3ind_s[W][0],Ze=Y.s3_ss[re++]*F[Re];for(++Re;Re<=Y.s3ind_s[W][1];)Ze+=Y.s3_ss[re]*F[Re],++re,++Re;{var ue=ye*Y.nb_s1[J][W];V[W]=Math.min(Ze,ue)}if(Y.blocktype_old[J&1]==T.SHORT_TYPE){var ue=Q*Y.nb_s2[J][W],Xe=V[W];V[W]=Math.min(ue,Xe)}Y.nb_s2[J][W]=Y.nb_s1[J][W],Y.nb_s1[J][W]=Ze,Ee(V[W]>=0)}for(;W<=T.CBANDS;++W)F[W]=0,V[W]=0}function _e(R,A,F,V){var J=R.internal_flags;R.short_blocks==Ce.short_block_coupled&&!(A[0]!=0&&A[1]!=0)&&(A[0]=A[1]=0);for(var N=0;N<J.channels_out;N++)V[N]=T.NORM_TYPE,R.short_blocks==Ce.short_block_dispensed&&(A[N]=1),R.short_blocks==Ce.short_block_forced&&(A[N]=0),A[N]!=0?(Ee(J.blocktype_old[N]!=T.START_TYPE),J.blocktype_old[N]==T.SHORT_TYPE&&(V[N]=T.STOP_TYPE)):(V[N]=T.SHORT_TYPE,J.blocktype_old[N]==T.NORM_TYPE&&(J.blocktype_old[N]=T.START_TYPE),J.blocktype_old[N]==T.STOP_TYPE&&(J.blocktype_old[N]=T.SHORT_TYPE)),F[N]=J.blocktype_old[N],J.blocktype_old[N]=V[N]}function Oe(R,A,F){return F>=1?R:F<=0?A:A>0?Math.pow(R/A,F)*A:0}var Ue=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function je(R,A){for(var F=309.07,V=0;V<T.SBMAX_s-1;V++)for(var J=0;J<3;J++){var N=R.thm.s[V][J];if(Ee(V<Ue.length),N>0){var Y=N*A,re=R.en.s[V][J];re>Y&&(re>Y*1e10?F+=Ue[V]*(10*$):(Ee(Y>0),F+=Ue[V]*Be.FAST_LOG10(re/Y)))}}return F}var ze=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function nt(R,A){for(var F=281.0575,V=0;V<T.SBMAX_l-1;V++){var J=R.thm.l[V];if(Ee(V<ze.length),J>0){var N=J*A,Y=R.en.l[V];Y>N&&(Y>N*1e10?F+=ze[V]*(10*$):(Ee(N>0),F+=ze[V]*Be.FAST_LOG10(Y/N)))}}return F}function Ke(R,A,F,V,J){var N,Y;for(N=Y=0;N<R.npart_l;++N){var re=0,W=0,ve;for(ve=0;ve<R.numlines_l[N];++ve,++Y){var ne=A[Y];Ee(ne>=0),re+=ne,W<ne&&(W=ne)}F[N]=re,V[N]=W,J[N]=re*R.rnumlines_l[N],Ee(R.rnumlines_l[N]>=0),Ee(re>=0),Ee(F[N]>=0),Ee(V[N]>=0),Ee(J[N]>=0)}}function Ve(R,A,F,V){var J=u.length-1,N=0,Y=F[N]+F[N+1];if(Ee(Y>=0),Y>0){var re=A[N];re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_l[N]+R.numlines_l[N+1]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_l[N]+R.numlines_l[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;for(N=1;N<R.npart_l-1;N++)if(Y=F[N-1]+F[N]+F[N+1],Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_l[N-1]+R.numlines_l[N]+R.numlines_l[N+1]-1>0),Y=20*(re*3-Y)/(Y*(R.numlines_l[N-1]+R.numlines_l[N]+R.numlines_l[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;if(Ee(N>0),Ee(N==R.npart_l-1),Y=F[N-1]+F[N],Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),Ee(R.numlines_l[N-1]+R.numlines_l[N]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_l[N-1]+R.numlines_l[N]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;Ee(N==R.npart_l-1)}var xt=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];this.L3psycho_anal_ns=function(R,A,F,V,J,N,Y,re,W,ve){var ne=R.internal_flags,pe=ot([2,T.BLKSIZE]),He=ot([2,3,T.BLKSIZE_s]),rt=Fe(T.CBANDS+1),Re=Fe(T.CBANDS+1),Ze=Fe(T.CBANDS+2),ue=mt(2),Xe=mt(2),vt,Ae,We,Te,Je,Ft,qe,ct,pt=ot([2,576]),Vt,Xr=mt(T.CBANDS+2),Zt=mt(T.CBANDS+2);for(Ye.fill(Zt,0),vt=ne.channels_out,R.mode==nr.JOINT_STEREO&&(vt=4),R.VBR==be.vbr_off?Vt=ne.ResvMax==0?0:ne.ResvSize/ne.ResvMax*.5:R.VBR==be.vbr_rh||R.VBR==be.vbr_mtrh||R.VBR==be.vbr_mt?Vt=.6:Vt=1,Ae=0;Ae<ne.channels_out;Ae++){var Ht=A[Ae],Ur=F+576-350-I+192;for(Ee(xt.length==(I-1)/2),Te=0;Te<576;Te++){var Kr,Wr;for(Kr=Ht[Ur+Te+10],Wr=0,Je=0;Je<(I-1)/2-1;Je+=2)Kr+=xt[Je]*(Ht[Ur+Te+Je]+Ht[Ur+Te+I-Je]),Wr+=xt[Je+1]*(Ht[Ur+Te+Je+1]+Ht[Ur+Te+I-Je-1]);pt[Ae][Te]=Kr+Wr}J[V][Ae].en.assign(ne.en[Ae]),J[V][Ae].thm.assign(ne.thm[Ae]),vt>2&&(N[V][Ae].en.assign(ne.en[Ae+2]),N[V][Ae].thm.assign(ne.thm[Ae+2]))}for(Ae=0;Ae<vt;Ae++){var gn,bn,Er=Fe(12),Fn=[0,0,0,0],ia=Fe(12),m0=1,Vc,qc=Fe(T.CBANDS),zc=Fe(T.CBANDS),qt=[0,0,0,0],jc=Fe(T.HBLKSIZE),Gc=ot([3,T.HBLKSIZE_s]);for(Ee(ne.npart_s<=T.CBANDS),Ee(ne.npart_l<=T.CBANDS),Te=0;Te<3;Te++)Er[Te]=ne.nsPsy.last_en_subshort[Ae][Te+6],Ee(ne.nsPsy.last_en_subshort[Ae][Te+4]>0),ia[Te]=Er[Te]/ne.nsPsy.last_en_subshort[Ae][Te+4],Fn[0]+=Er[Te];if(Ae==2)for(Te=0;Te<576;Te++){var p0,h0;p0=pt[0][Te],h0=pt[1][Te],pt[0][Te]=p0+h0,pt[1][Te]=p0-h0}{var Xc=pt[Ae&1],Wa=0;for(Te=0;Te<9;Te++){for(var Gd=Wa+64,lr=1;Wa<Gd;Wa++)lr<Math.abs(Xc[Wa])&&(lr=Math.abs(Xc[Wa]));ne.nsPsy.last_en_subshort[Ae][Te]=Er[Te+3]=lr,Fn[1+Te/3]+=lr,lr>Er[Te+3-2]?(Ee(Er[Te+3-2]>0),lr=lr/Er[Te+3-2]):Er[Te+3-2]>lr*10?(Ee(lr>0),lr=Er[Te+3-2]/(lr*10)):lr=0,ia[Te+3]=lr}}if(R.analysis){var _0=ia[0];for(Te=1;Te<12;Te++)_0<ia[Te]&&(_0=ia[Te]);ne.pinfo.ers[V][Ae]=ne.pinfo.ers_save[Ae],ne.pinfo.ers_save[Ae]=_0}for(Vc=Ae==3?ne.nsPsy.attackthre_s:ne.nsPsy.attackthre,Te=0;Te<12;Te++)qt[Te/3]==0&&ia[Te]>Vc&&(qt[Te/3]=Te%3+1);for(Te=1;Te<4;Te++){var S0;Fn[Te-1]>Fn[Te]?(Ee(Fn[Te]>0),S0=Fn[Te-1]/Fn[Te]):(Ee(Fn[Te-1]>0),S0=Fn[Te]/Fn[Te-1]),S0<1.7&&(qt[Te]=0,Te==1&&(qt[0]=0))}for(qt[0]!=0&&ne.nsPsy.lastAttacks[Ae]!=0&&(qt[0]=0),(ne.nsPsy.lastAttacks[Ae]==3||qt[0]+qt[1]+qt[2]+qt[3]!=0)&&(m0=0,qt[1]!=0&&qt[0]!=0&&(qt[1]=0),qt[2]!=0&&qt[1]!=0&&(qt[2]=0),qt[3]!=0&&qt[2]!=0&&(qt[3]=0)),Ae<2?Xe[Ae]=m0:m0==0&&(Xe[0]=Xe[1]=0),W[Ae]=ne.tot_ener[Ae],bn=He,gn=pe,_(R,jc,Gc,gn,Ae&1,bn,Ae&1,V,Ae,A,F),Ke(ne,jc,rt,qc,zc),Ve(ne,qc,zc,Xr),ct=0;ct<3;ct++){var g0,Hr;for(fe(R,Gc,Re,Ze,Ae,ct),f(ne,Re,Ze,Ae,ct),qe=0;qe<T.SBMAX_s;qe++){if(Hr=ne.thm[Ae].s[qe][ct],Hr*=G,qt[ct]>=2||qt[ct+1]==1){var Ya=ct!=0?ct-1:2,lr=Oe(ne.thm[Ae].s[qe][Ya],Hr,de*Vt);Hr=Math.min(Hr,lr)}if(qt[ct]==1){var Ya=ct!=0?ct-1:2,lr=Oe(ne.thm[Ae].s[qe][Ya],Hr,he*Vt);Hr=Math.min(Hr,lr)}else if(ct!=0&&qt[ct-1]==3||ct==0&&ne.nsPsy.lastAttacks[Ae]==3){var Ya=ct!=2?ct+1:0,lr=Oe(ne.thm[Ae].s[qe][Ya],Hr,he*Vt);Hr=Math.min(Hr,lr)}g0=Er[ct*3+3]+Er[ct*3+4]+Er[ct*3+5],Er[ct*3+5]*6<g0&&(Hr*=.5,Er[ct*3+4]*6<g0&&(Hr*=.5)),ne.thm[Ae].s[qe][ct]=Hr}}for(ne.nsPsy.lastAttacks[Ae]=qt[2],Ft=0,We=0;We<ne.npart_l;We++){for(var Mi=ne.s3ind[We][0],b0=rt[Mi]*u[Xr[Mi]],Pi=ne.s3_ll[Ft++]*b0;++Mi<=ne.s3ind[We][1];)b0=rt[Mi]*u[Xr[Mi]],Pi=x(Pi,ne.s3_ll[Ft++]*b0,Mi,Mi-We,ne,0);Pi*=.158489319246111,ne.blocktype_old[Ae&1]==T.SHORT_TYPE?Ze[We]=Pi:Ze[We]=Oe(Math.min(Pi,Math.min(ie*ne.nb_1[Ae][We],Z*ne.nb_2[Ae][We])),Pi,Vt),ne.nb_2[Ae][We]=ne.nb_1[Ae][We],ne.nb_1[Ae][We]=Pi}for(;We<=T.CBANDS;++We)rt[We]=0,Ze[We]=0;S(ne,rt,Ze,Ae)}if((R.mode==nr.STEREO||R.mode==nr.JOINT_STEREO)&&R.interChRatio>0&&U(R,R.interChRatio),R.mode==nr.JOINT_STEREO){var x0;j(ne),x0=R.msfix,Math.abs(x0)>0&&Se(ne,x0,R.ATHlower*ne.ATH.adjust)}for(_e(R,Xe,ve,ue),Ae=0;Ae<vt;Ae++){var $a,Za=0,Go,Xo;Ae>1?($a=re,Za=-2,Go=T.NORM_TYPE,(ve[0]==T.SHORT_TYPE||ve[1]==T.SHORT_TYPE)&&(Go=T.SHORT_TYPE),Xo=N[V][Ae-2]):($a=Y,Za=0,Go=ve[Ae],Xo=J[V][Ae]),Go==T.SHORT_TYPE?$a[Za+Ae]=je(Xo,ne.masking_lower):$a[Za+Ae]=nt(Xo,ne.masking_lower),R.analysis&&(ne.pinfo.pe[V][Ae]=$a[Za+Ae])}return 0};function Ot(R,A,F,V,J,N,Y,re){var W=R.internal_flags;if(V<2)C.fft_long(W,Y[re],V,A,F);else if(V==2)for(var ve=T.BLKSIZE-1;ve>=0;--ve){var ne=Y[re+0][ve],pe=Y[re+1][ve];Y[re+0][ve]=(ne+pe)*Be.SQRT2*.5,Y[re+1][ve]=(ne-pe)*Be.SQRT2*.5}N[0]=Y[re+0][0],N[0]*=N[0];for(var ve=T.BLKSIZE/2-1;ve>=0;--ve){var He=Y[re+0][T.BLKSIZE/2-ve],rt=Y[re+0][T.BLKSIZE/2+ve];N[T.BLKSIZE/2-ve]=(He*He+rt*rt)*.5}{for(var Re=0,ve=11;ve<T.HBLKSIZE;ve++)Re+=N[ve];W.tot_ener[V]=Re}if(R.analysis){for(var ve=0;ve<T.HBLKSIZE;ve++)W.pinfo.energy[J][V][ve]=W.pinfo.energy_save[V][ve],W.pinfo.energy_save[V][ve]=N[ve];W.pinfo.pe[J][V]=W.pe[V]}}function Rt(R,A,F,V,J,N,Y,re){var W=R.internal_flags;if(J==0&&V<2&&C.fft_short(W,Y[re],V,A,F),V==2)for(var ve=T.BLKSIZE_s-1;ve>=0;--ve){var ne=Y[re+0][J][ve],pe=Y[re+1][J][ve];Y[re+0][J][ve]=(ne+pe)*Be.SQRT2*.5,Y[re+1][J][ve]=(ne-pe)*Be.SQRT2*.5}N[J][0]=Y[re+0][J][0],N[J][0]*=N[J][0];for(var ve=T.BLKSIZE_s/2-1;ve>=0;--ve){var He=Y[re+0][J][T.BLKSIZE_s/2-ve],rt=Y[re+0][J][T.BLKSIZE_s/2+ve];N[J][T.BLKSIZE_s/2-ve]=(He*He+rt*rt)*.5}}function Lt(R,A,F,V){var J=R.internal_flags;R.athaa_loudapprox==2&&F<2&&(J.loudness_sq[A][F]=J.loudness_sq_save[F],J.loudness_sq_save[F]=g(V,J))}var jt=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];function Kt(R,A,F,V,J,N,Y,re,W,ve){for(var ne=ot([2,576]),pe=R.internal_flags,He=pe.channels_out,rt=R.mode==nr.JOINT_STEREO?4:He,Re=0;Re<He;Re++){firbuf=A[Re];var Ze=F+576-350-I+192;Ee(jt.length==(I-1)/2);for(var ue=0;ue<576;ue++){var Xe,vt;Xe=firbuf[Ze+ue+10],vt=0;for(var Ae=0;Ae<(I-1)/2-1;Ae+=2)Xe+=jt[Ae]*(firbuf[Ze+ue+Ae]+firbuf[Ze+ue+I-Ae]),vt+=jt[Ae+1]*(firbuf[Ze+ue+Ae+1]+firbuf[Ze+ue+I-Ae-1]);ne[Re][ue]=Xe+vt}J[V][Re].en.assign(pe.en[Re]),J[V][Re].thm.assign(pe.thm[Re]),rt>2&&(N[V][Re].en.assign(pe.en[Re+2]),N[V][Re].thm.assign(pe.thm[Re+2]))}for(var Re=0;Re<rt;Re++){var We=Fe(12),Te=Fe(12),Je=[0,0,0,0],Ft=ne[Re&1],qe=0,ct=Re==3?pe.nsPsy.attackthre_s:pe.nsPsy.attackthre,pt=1;if(Re==2)for(var ue=0,Ae=576;Ae>0;++ue,--Ae){var Vt=ne[0][ue],Xr=ne[1][ue];ne[0][ue]=Vt+Xr,ne[1][ue]=Vt-Xr}for(var ue=0;ue<3;ue++)Te[ue]=pe.nsPsy.last_en_subshort[Re][ue+6],Ee(pe.nsPsy.last_en_subshort[Re][ue+4]>0),We[ue]=Te[ue]/pe.nsPsy.last_en_subshort[Re][ue+4],Je[0]+=Te[ue];for(var ue=0;ue<9;ue++){for(var Zt=qe+64,Ht=1;qe<Zt;qe++)Ht<Math.abs(Ft[qe])&&(Ht=Math.abs(Ft[qe]));pe.nsPsy.last_en_subshort[Re][ue]=Te[ue+3]=Ht,Je[1+ue/3]+=Ht,Ht>Te[ue+3-2]?(Ee(Te[ue+3-2]>0),Ht=Ht/Te[ue+3-2]):Te[ue+3-2]>Ht*10?(Ee(Ht>0),Ht=Te[ue+3-2]/(Ht*10)):Ht=0,We[ue+3]=Ht}for(var ue=0;ue<3;++ue){var Ur=Te[ue*3+3]+Te[ue*3+4]+Te[ue*3+5],Kr=1;Te[ue*3+5]*6<Ur&&(Kr*=.5,Te[ue*3+4]*6<Ur&&(Kr*=.5)),re[Re][ue]=Kr}if(R.analysis){for(var Wr=We[0],ue=1;ue<12;ue++)Wr<We[ue]&&(Wr=We[ue]);pe.pinfo.ers[V][Re]=pe.pinfo.ers_save[Re],pe.pinfo.ers_save[Re]=Wr}for(var ue=0;ue<12;ue++)W[Re][ue/3]==0&&We[ue]>ct&&(W[Re][ue/3]=ue%3+1);for(var ue=1;ue<4;ue++){var gn=Je[ue-1],bn=Je[ue],Er=Math.max(gn,bn);Er<4e4&&gn<1.7*bn&&bn<1.7*gn&&(ue==1&&W[Re][0]<=W[Re][ue]&&(W[Re][0]=0),W[Re][ue]=0)}W[Re][0]<=pe.nsPsy.lastAttacks[Re]&&(W[Re][0]=0),(pe.nsPsy.lastAttacks[Re]==3||W[Re][0]+W[Re][1]+W[Re][2]+W[Re][3]!=0)&&(pt=0,W[Re][1]!=0&&W[Re][0]!=0&&(W[Re][1]=0),W[Re][2]!=0&&W[Re][1]!=0&&(W[Re][2]=0),W[Re][3]!=0&&W[Re][2]!=0&&(W[Re][3]=0)),Re<2?ve[Re]=pt:pt==0&&(ve[0]=ve[1]=0),Y[Re]=pe.tot_ener[Re]}}function _r(R,A,F){if(F==0)for(var V=0;V<R.npart_s;V++)R.nb_s2[A][V]=R.nb_s1[A][V],R.nb_s1[A][V]=0}function Ln(R,A){for(var F=0;F<R.npart_l;F++)R.nb_2[A][F]=R.nb_1[A][F],R.nb_1[A][F]=0}function Lr(R,A,F,V){var J=u.length-1,N=0,Y=F[N]+F[N+1];if(Ee(Y>=0),Y>0){var re=A[N];re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_s[N]+R.numlines_s[N+1]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_s[N]+R.numlines_s[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;for(N=1;N<R.npart_s-1;N++)if(Y=F[N-1]+F[N]+F[N+1],Ee(N+1<R.npart_s),Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_s[N-1]+R.numlines_s[N]+R.numlines_s[N+1]-1>0),Y=20*(re*3-Y)/(Y*(R.numlines_s[N-1]+R.numlines_s[N]+R.numlines_s[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;if(Ee(N>0),Ee(N==R.npart_s-1),Y=F[N-1]+F[N],Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),Ee(R.numlines_s[N-1]+R.numlines_s[N]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_s[N-1]+R.numlines_s[N]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;Ee(N==R.npart_s-1)}function Fr(R,A,F,V,J,N){var Y=R.internal_flags,re=new float[T.CBANDS],W=Fe(T.CBANDS),ve,ne,pe,He=new int[T.CBANDS];for(pe=ne=0;pe<Y.npart_s;++pe){var rt=0,Re=0,Ze=Y.numlines_s[pe];for(ve=0;ve<Ze;++ve,++ne){var ue=A[N][ne];rt+=ue,Re<ue&&(Re=ue)}F[pe]=rt,Ee(rt>=0),re[pe]=Re,Ee(Ze>0),W[pe]=rt/Ze,Ee(W[pe]>=0)}for(Ee(pe==Y.npart_s),Ee(ne==129);pe<T.CBANDS;++pe)re[pe]=0,W[pe]=0;for(Lr(Y,re,W,He),ne=pe=0;pe<Y.npart_s;pe++){var Xe=Y.s3ind_s[pe][0],vt=Y.s3ind_s[pe][1],Ae,We,Te,Je,Ft;for(Ae=He[Xe],We=1,Je=Y.s3_ss[ne]*F[Xe]*u[He[Xe]],++ne,++Xe;Xe<=vt;)Ae+=He[Xe],We+=1,Te=Y.s3_ss[ne]*F[Xe]*u[He[Xe]],Je=X(Je,Te,Xe-pe),++ne,++Xe;Ae=(1+2*Ae)/(2*We),Ft=u[Ae]*.5,Je*=Ft,V[pe]=Je,Y.nb_s2[J][pe]=Y.nb_s1[J][pe],Y.nb_s1[J][pe]=Je,Te=re[pe],Te*=Y.minval_s[pe],Te*=Ft,V[pe]>Te&&(V[pe]=Te),Y.masking_lower>1&&(V[pe]*=Y.masking_lower),V[pe]>F[pe]&&(V[pe]=F[pe]),Y.masking_lower<1&&(V[pe]*=Y.masking_lower),Ee(V[pe]>=0)}for(;pe<T.CBANDS;++pe)F[pe]=0,V[pe]=0}function _n(R,A,F,V,J){var N=Fe(T.CBANDS),Y=Fe(T.CBANDS),re=mt(T.CBANDS+2),W;Ke(R,A,F,N,Y),Ve(R,N,Y,re);var ve=0;for(W=0;W<R.npart_l;W++){var ne,pe,He,rt,Re=R.s3ind[W][0],Ze=R.s3ind[W][1],ue=0,Xe=0;for(ue=re[Re],Xe+=1,pe=R.s3_ll[ve]*F[Re]*u[re[Re]],++ve,++Re;Re<=Ze;)ue+=re[Re],Xe+=1,ne=R.s3_ll[ve]*F[Re]*u[re[Re]],rt=X(pe,ne,Re-W),pe=rt,++ve,++Re;if(ue=(1+2*ue)/(2*Xe),He=u[ue]*.5,pe*=He,R.blocktype_old[J&1]==T.SHORT_TYPE){var vt=ie*R.nb_1[J][W];vt>0?V[W]=Math.min(pe,vt):V[W]=Math.min(pe,F[W]*he)}else{var Ae=Z*R.nb_2[J][W],We=ie*R.nb_1[J][W],vt;Ae<=0&&(Ae=pe),We<=0&&(We=pe),R.blocktype_old[J&1]==T.NORM_TYPE?vt=Math.min(We,Ae):vt=We,V[W]=Math.min(pe,vt)}R.nb_2[J][W]=R.nb_1[J][W],R.nb_1[J][W]=pe,ne=N[W],ne*=R.minval_l[W],ne*=He,V[W]>ne&&(V[W]=ne),R.masking_lower>1&&(V[W]*=R.masking_lower),V[W]>F[W]&&(V[W]=F[W]),R.masking_lower<1&&(V[W]*=R.masking_lower),Ee(V[W]>=0)}for(;W<T.CBANDS;++W)F[W]=0,V[W]=0}function Ii(R,A){var F=R.internal_flags;R.short_blocks==Ce.short_block_coupled&&!(A[0]!=0&&A[1]!=0)&&(A[0]=A[1]=0);for(var V=0;V<F.channels_out;V++)R.short_blocks==Ce.short_block_dispensed&&(A[V]=1),R.short_blocks==Ce.short_block_forced&&(A[V]=0)}function Ci(R,A,F){for(var V=R.internal_flags,J=0;J<V.channels_out;J++){var N=T.NORM_TYPE;A[J]!=0?(Ee(V.blocktype_old[J]!=T.START_TYPE),V.blocktype_old[J]==T.SHORT_TYPE&&(N=T.STOP_TYPE)):(N=T.SHORT_TYPE,V.blocktype_old[J]==T.NORM_TYPE&&(V.blocktype_old[J]=T.START_TYPE),V.blocktype_old[J]==T.STOP_TYPE&&(V.blocktype_old[J]=T.SHORT_TYPE)),F[J]=V.blocktype_old[J],V.blocktype_old[J]=N}}function Sn(R,A,F,V,J,N,Y){for(var re=N*2,W=N>0?Math.pow(10,J):1,ve,ne,pe=0;pe<Y;++pe){var He=R[2][pe],rt=R[3][pe],Re=A[0][pe],Ze=A[1][pe],ue=A[2][pe],Xe=A[3][pe];if(Re<=1.58*Ze&&Ze<=1.58*Re){var vt=F[pe]*rt,Ae=F[pe]*He;ne=Math.max(ue,Math.min(Xe,vt)),ve=Math.max(Xe,Math.min(ue,Ae))}else ne=ue,ve=Xe;if(N>0){var We,Te,Je=V[pe]*W;if(We=Math.min(Math.max(Re,Je),Math.max(Ze,Je)),ue=Math.max(ne,Je),Xe=Math.max(ve,Je),Te=ue+Xe,Te>0&&We*re<Te){var Ft=We*re/Te;ue*=Ft,Xe*=Ft,Ee(Te>0)}ne=Math.min(ue,ne),ve=Math.min(Xe,ve)}ne>He&&(ne=He),ve>rt&&(ve=rt),A[2][pe]=ne,A[3][pe]=ve}}this.L3psycho_anal_vbr=function(R,A,F,V,J,N,Y,re,W,ve){var ne=R.internal_flags,pe,He,rt=Fe(T.HBLKSIZE),Re=ot([3,T.HBLKSIZE_s]),Ze=ot([2,T.BLKSIZE]),ue=ot([2,3,T.BLKSIZE_s]),Xe=ot([4,T.CBANDS]),vt=ot([4,T.CBANDS]),Ae=ot([4,3]),We=.6,Te=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],Je=mt(2),Ft=R.mode==nr.JOINT_STEREO?4:ne.channels_out;Kt(R,A,F,V,J,N,W,Ae,Te,Je),Ii(R,Je);{for(var qe=0;qe<Ft;qe++){var ct=qe&1;pe=Ze,Ot(R,A,F,qe,V,rt,pe,ct),Lt(R,V,qe,rt),Je[ct]!=0?_n(ne,rt,Xe[qe],vt[qe],qe):Ln(ne,qe)}Je[0]+Je[1]==2&&R.mode==nr.JOINT_STEREO&&Sn(Xe,vt,ne.mld_cb_l,ne.ATH.cb_l,R.ATHlower*ne.ATH.adjust,R.msfix,ne.npart_l);for(var qe=0;qe<Ft;qe++){var ct=qe&1;Je[ct]!=0&&S(ne,Xe[qe],vt[qe],qe)}}{for(var pt=0;pt<3;pt++){for(var qe=0;qe<Ft;++qe){var ct=qe&1;Je[ct]!=0?_r(ne,qe,pt):(He=ue,Rt(R,A,F,qe,pt,Re,He,ct),Fr(R,Re,Xe[qe],vt[qe],qe,pt))}Je[0]+Je[1]==0&&R.mode==nr.JOINT_STEREO&&Sn(Xe,vt,ne.mld_cb_s,ne.ATH.cb_s,R.ATHlower*ne.ATH.adjust,R.msfix,ne.npart_s);for(var qe=0;qe<Ft;++qe){var ct=qe&1;Je[ct]==0&&f(ne,Xe[qe],vt[qe],qe,pt)}}for(var qe=0;qe<Ft;qe++){var ct=qe&1;if(Je[ct]==0)for(var Vt=0;Vt<T.SBMAX_s;Vt++){for(var Xr=Fe(3),pt=0;pt<3;pt++){var Zt=ne.thm[qe].s[Vt][pt];if(Zt*=G,Te[qe][pt]>=2||Te[qe][pt+1]==1){var Ht=pt!=0?pt-1:2,Ur=Oe(ne.thm[qe].s[Vt][Ht],Zt,de*We);Zt=Math.min(Zt,Ur)}else if(Te[qe][pt]==1){var Ht=pt!=0?pt-1:2,Ur=Oe(ne.thm[qe].s[Vt][Ht],Zt,he*We);Zt=Math.min(Zt,Ur)}else if(pt!=0&&Te[qe][pt-1]==3||pt==0&&ne.nsPsy.lastAttacks[qe]==3){var Ht=pt!=2?pt+1:0,Ur=Oe(ne.thm[qe].s[Vt][Ht],Zt,he*We);Zt=Math.min(Zt,Ur)}Zt*=Ae[qe][pt],Xr[pt]=Zt}for(var pt=0;pt<3;pt++)ne.thm[qe].s[Vt][pt]=Xr[pt]}}}for(var qe=0;qe<Ft;qe++)ne.nsPsy.lastAttacks[qe]=Te[qe][2];Ci(R,Je,ve);for(var qe=0;qe<Ft;qe++){var Kr,Wr,gn,bn;qe>1?(Kr=re,Wr=-2,gn=T.NORM_TYPE,(ve[0]==T.SHORT_TYPE||ve[1]==T.SHORT_TYPE)&&(gn=T.SHORT_TYPE),bn=N[V][qe-2]):(Kr=Y,Wr=0,gn=ve[qe],bn=J[V][qe]),gn==T.SHORT_TYPE?Kr[Wr+qe]=je(bn,ne.masking_lower):Kr[Wr+qe]=nt(bn,ne.masking_lower),R.analysis&&(ne.pinfo.pe[V][qe]=Kr[Wr+qe])}return 0};function Cr(R,A){var F=R,V;return F>=0?V=-F*27:V=F*A,V<=-72?0:Math.exp(V*H)}function ii(R){var A=0,F=0;{var V=0,J,N;for(V=0;Cr(V,R)>1e-20;V-=1);for(J=V,N=0;Math.abs(N-J)>1e-12;)V=(N+J)/2,Cr(V,R)>0?N=V:J=V;A=J}{var V=0,J,N;for(V=0;Cr(V,R)>1e-20;V+=1);for(J=0,N=V;Math.abs(N-J)>1e-12;)V=(N+J)/2,Cr(V,R)>0?J=V:N=V;F=N}{var Y=0,re=1e3,W;for(W=0;W<=re;++W){var V=A+W*(F-A)/re,ve=Cr(V,R);Y+=ve}{var ne=(re+1)/(Y*(F-A));return ne}}}function Ka(R){var A,F,V,J;return A=R,A>=0?A*=3:A*=1.5,A>=.5&&A<=2.5?(J=A-.5,F=8*(J*J-2*J)):F=0,A+=.474,V=15.811389+7.5*A-17.5*Math.sqrt(1+A*A),V<=-60?0:(A=Math.exp((F+V)*H),A/=.6609193,A)}function ai(R){return R<0&&(R=0),R=R*.001,13*Math.atan(.76*R)+3.5*Math.atan(R*R/(7.5*7.5))}function Fc(R,A,F,V,J,N,Y,re,W,ve,ne,pe){var He=Fe(T.CBANDS+1),rt=re/(pe>15?2*576:2*192),Re=mt(T.HBLKSIZE),Ze;re/=W;var ue=0,Xe=0;for(Ze=0;Ze<T.CBANDS;Ze++){var vt,Ae;for(vt=ai(re*ue),He[Ze]=re*ue,Ae=ue;ai(re*Ae)-vt<me&&Ae<=W/2;Ae++);for(R[Ze]=Ae-ue,Xe=Ze+1;ue<Ae;)Ee(ue<T.HBLKSIZE),Re[ue++]=Ze;if(ue>W/2){ue=W/2,++Ze;break}}Ee(Ze<T.CBANDS),He[Ze]=re*ue;for(var We=0;We<pe;We++){var Te,Je,Ft,qe,ct;Ft=ve[We],qe=ve[We+1],Te=0|Math.floor(.5+ne*(Ft-.5)),Te<0&&(Te=0),Je=0|Math.floor(.5+ne*(qe-.5)),Je>W/2&&(Je=W/2),F[We]=(Re[Te]+Re[Je])/2,A[We]=Re[Je];var pt=rt*qe;Y[We]=(pt-He[A[We]])/(He[A[We]+1]-He[A[We]]),Y[We]<0?Y[We]=0:Y[We]>1&&(Y[We]=1),ct=ai(re*ve[We]*ne),ct=Math.min(ct,15.5)/15.5,N[We]=Math.pow(10,1.25*(1-Math.cos(Math.PI*ct))-2.5)}ue=0;for(var Vt=0;Vt<Xe;Vt++){var Xr=R[Vt],vt,Zt;vt=ai(re*ue),Zt=ai(re*(ue+Xr-1)),V[Vt]=.5*(vt+Zt),vt=ai(re*(ue-.5)),Zt=ai(re*(ue+Xr-.5)),J[Vt]=Zt-vt,ue+=Xr}return Xe}function Uc(R,A,F,V,J,N){var Y=ot([T.CBANDS,T.CBANDS]),re,W=0;if(N)for(var ve=0;ve<A;ve++)for(re=0;re<A;re++){var ne=Ka(F[ve]-F[re])*V[re];Y[ve][re]=ne*J[ve]}else for(re=0;re<A;re++)for(var pe=15+Math.min(21/F[re],12),He=ii(pe),ve=0;ve<A;ve++){var ne=He*Cr(F[ve]-F[re],pe)*V[re];Y[ve][re]=ne*J[ve]}for(var ve=0;ve<A;ve++){for(re=0;re<A&&!(Y[ve][re]>0);re++);for(R[ve][0]=re,re=A-1;re>0&&!(Y[ve][re]>0);re--);R[ve][1]=re,W+=R[ve][1]-R[ve][0]+1}for(var rt=Fe(W),Re=0,ve=0;ve<A;ve++)for(re=R[ve][0];re<=R[ve][1];re++)rt[Re++]=Y[ve][re];return rt}function Hc(R){var A=ai(R);return A=Math.min(A,15.5)/15.5,Math.pow(10,1.25*(1-Math.cos(Math.PI*A))-2.5)}this.psymodel_init=function(R){var A=R.internal_flags,F,V=!0,J=13,N=24,Y=0,re=0,W=-8.25,ve=-4.5,ne=Fe(T.CBANDS),pe=Fe(T.CBANDS),He=Fe(T.CBANDS),rt=R.out_samplerate;switch(R.experimentalZ){default:case 0:V=!0;break;case 1:V=!(R.VBR==be.vbr_mtrh||R.VBR==be.vbr_mt);break;case 2:V=!1;break;case 3:J=8,Y=-1.75,re=-.0125,W=-8.25,ve=-2.25;break}for(A.ms_ener_ratio_old=.25,A.blocktype_old[0]=A.blocktype_old[1]=T.NORM_TYPE,F=0;F<4;++F){for(var ue=0;ue<T.CBANDS;++ue)A.nb_1[F][ue]=1e20,A.nb_2[F][ue]=1e20,A.nb_s1[F][ue]=A.nb_s2[F][ue]=1;for(var Re=0;Re<T.SBMAX_l;Re++)A.en[F].l[Re]=1e20,A.thm[F].l[Re]=1e20;for(var ue=0;ue<3;++ue){for(var Re=0;Re<T.SBMAX_s;Re++)A.en[F].s[Re][ue]=1e20,A.thm[F].s[Re][ue]=1e20;A.nsPsy.lastAttacks[F]=0}for(var ue=0;ue<9;ue++)A.nsPsy.last_en_subshort[F][ue]=10}for(A.loudness_sq_save[0]=A.loudness_sq_save[1]=0,A.npart_l=Fc(A.numlines_l,A.bo_l,A.bm_l,ne,pe,A.mld_l,A.PSY.bo_l_weight,rt,T.BLKSIZE,A.scalefac_band.l,T.BLKSIZE/(2*576),T.SBMAX_l),Ee(A.npart_l<T.CBANDS),F=0;F<A.npart_l;F++){var Ze=Y;ne[F]>=J&&(Ze=re*(ne[F]-J)/(N-J)+Y*(N-ne[F])/(N-J)),He[F]=Math.pow(10,Ze/10),A.numlines_l[F]>0?A.rnumlines_l[F]=1/A.numlines_l[F]:A.rnumlines_l[F]=0}A.s3_ll=Uc(A.s3ind,A.npart_l,ne,pe,He,V);var ue=0;for(F=0;F<A.npart_l;F++){var Xe;Xe=Ie.MAX_VALUE;for(var vt=0;vt<A.numlines_l[F];vt++,ue++){var Ae=rt*ue/(1e3*T.BLKSIZE),We;We=this.ATHformula(Ae*1e3,R)-20,We=Math.pow(10,.1*We),We*=A.numlines_l[F],Xe>We&&(Xe=We)}A.ATH.cb_l[F]=Xe,Xe=-20+ne[F]*20/10,Xe>6&&(Xe=100),Xe<-15&&(Xe=-15),Xe-=8,A.minval_l[F]=Math.pow(10,Xe/10)*A.numlines_l[F]}for(A.npart_s=Fc(A.numlines_s,A.bo_s,A.bm_s,ne,pe,A.mld_s,A.PSY.bo_s_weight,rt,T.BLKSIZE_s,A.scalefac_band.s,T.BLKSIZE_s/(2*192),T.SBMAX_s),Ee(A.npart_s<T.CBANDS),ue=0,F=0;F<A.npart_s;F++){var Xe,Ze=W;ne[F]>=J&&(Ze=ve*(ne[F]-J)/(N-J)+W*(N-ne[F])/(N-J)),He[F]=Math.pow(10,Ze/10),Xe=Ie.MAX_VALUE;for(var vt=0;vt<A.numlines_s[F];vt++,ue++){var Ae=rt*ue/(1e3*T.BLKSIZE_s),We;We=this.ATHformula(Ae*1e3,R)-20,We=Math.pow(10,.1*We),We*=A.numlines_s[F],Xe>We&&(Xe=We)}A.ATH.cb_s[F]=Xe,Xe=-7+ne[F]*7/12,ne[F]>12&&(Xe*=1+Math.log(1+Xe)*3.1),ne[F]<12&&(Xe*=1+Math.log(1-Xe)*2.3),Xe<-15&&(Xe=-15),Xe-=8,A.minval_s[F]=Math.pow(10,Xe/10)*A.numlines_s[F]}A.s3_ss=Uc(A.s3ind_s,A.npart_s,ne,pe,He,V),m(),C.init_fft(A),A.decay=Math.exp(-1*$/(ke*rt/192));{var Te;Te=M,(R.exp_nspsytune&2)!=0&&(Te=1),Math.abs(R.msfix)>0&&(Te=R.msfix),R.msfix=Te;for(var Je=0;Je<A.npart_l;Je++)A.s3ind[Je][1]>A.npart_l-1&&(A.s3ind[Je][1]=A.npart_l-1)}var Ft=576*A.mode_gr/rt;if(A.ATH.decay=Math.pow(10,-12/10*Ft),A.ATH.adjust=.01,A.ATH.adjustLimit=1,Ee(A.bo_l[T.SBMAX_l-1]<=A.npart_l),Ee(A.bo_s[T.SBMAX_s-1]<=A.npart_s),R.ATHtype!=-1){var Ae,qe=R.out_samplerate/T.BLKSIZE,ct=0;for(Ae=0,F=0;F<T.BLKSIZE/2;++F)Ae+=qe,A.ATH.eql_w[F]=1/Math.pow(10,this.ATHformula(Ae,R)/10),ct+=A.ATH.eql_w[F];for(ct=1/ct,F=T.BLKSIZE/2;--F>=0;)A.ATH.eql_w[F]*=ct}{for(var Je=ue=0;Je<A.npart_s;++Je)for(F=0;F<A.numlines_s[Je];++F)++ue;Ee(ue==129);for(var Je=ue=0;Je<A.npart_l;++Je)for(F=0;F<A.numlines_l[Je];++F)++ue;Ee(ue==513)}for(ue=0,F=0;F<A.npart_l;F++){var Ae=rt*(ue+A.numlines_l[F]/2)/(1*T.BLKSIZE);A.mld_cb_l[F]=Hc(Ae),ue+=A.numlines_l[F]}for(;F<T.CBANDS;++F)A.mld_cb_l[F]=1;for(ue=0,F=0;F<A.npart_s;F++){var Ae=rt*(ue+A.numlines_s[F]/2)/(1*T.BLKSIZE_s);A.mld_cb_s[F]=Hc(Ae),ue+=A.numlines_s[F]}for(;F<T.CBANDS;++F)A.mld_cb_s[F]=1;return 0};function na(R,A){R<-.3&&(R=3410),R/=1e3,R=Math.max(.1,R);var F=3.64*Math.pow(R,-.8)-6.8*Math.exp(-.6*Math.pow(R-3.4,2))+6*Math.exp(-.15*Math.pow(R-8.7,2))+(.6+.04*A)*.001*Math.pow(R,4);return F}this.ATHformula=function(R,A){var F;switch(A.ATHtype){case 0:F=na(R,9);break;case 1:F=na(R,-1);break;case 2:F=na(R,0);break;case 3:F=na(R,1)+6;break;case 4:F=na(R,A.ATHcurve);break;default:F=na(R,0);break}return F}}var Ar=br;function yr(C){var $=C;this.ordinal=function(){return $}}yr.STEREO=new yr(0),yr.JOINT_STEREO=new yr(1),yr.DUAL_CHANNEL=new yr(2),yr.MONO=new yr(3),yr.NOT_SET=new yr(4);var ea=yr;function pn(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=ea.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}var a0=pn,Ec={};Ec.SFBMAX=T.SBMAX_s*3;var xi=Ec,Lf=P.new_float,yi=P.new_int;function Ff(){this.xr=Lf(576),this.l3_enc=yi(576),this.scalefac=yi(xi.SFBMAX),this.xrpow_max=0,this.part2_3_length=0,this.big_values=0,this.count1=0,this.global_gain=0,this.scalefac_compress=0,this.block_type=0,this.mixed_block_flag=0,this.table_select=yi(3),this.subblock_gain=yi(3+1),this.region0_count=0,this.region1_count=0,this.preflag=0,this.scalefac_scale=0,this.count1table_select=0,this.part2_length=0,this.sfb_lmax=0,this.sfb_smin=0,this.psy_lmax=0,this.sfbmax=0,this.psymax=0,this.sfbdivide=0,this.width=yi(xi.SFBMAX),this.window=yi(xi.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=yi(4),this.max_nonzero_coeff=0;var C=this;function $(Z){return new Int32Array(Z)}function ie(Z){return new Float32Array(Z)}this.assign=function(Z){C.xr=ie(Z.xr),C.l3_enc=$(Z.l3_enc),C.scalefac=$(Z.scalefac),C.xrpow_max=Z.xrpow_max,C.part2_3_length=Z.part2_3_length,C.big_values=Z.big_values,C.count1=Z.count1,C.global_gain=Z.global_gain,C.scalefac_compress=Z.scalefac_compress,C.block_type=Z.block_type,C.mixed_block_flag=Z.mixed_block_flag,C.table_select=$(Z.table_select),C.subblock_gain=$(Z.subblock_gain),C.region0_count=Z.region0_count,C.region1_count=Z.region1_count,C.preflag=Z.preflag,C.scalefac_scale=Z.scalefac_scale,C.count1table_select=Z.count1table_select,C.part2_length=Z.part2_length,C.sfb_lmax=Z.sfb_lmax,C.sfb_smin=Z.sfb_smin,C.psy_lmax=Z.psy_lmax,C.sfbmax=Z.sfbmax,C.psymax=Z.psymax,C.sfbdivide=Z.sfbdivide,C.width=$(Z.width),C.window=$(Z.window),C.count1bits=Z.count1bits,C.sfb_partition_table=Z.sfb_partition_table.slice(0),C.slen=$(Z.slen),C.max_nonzero_coeff=Z.max_nonzero_coeff}}var Oo=Ff,wc=P.new_int;function Uf(){this.tt=[[null,null],[null,null]],this.main_data_begin=0,this.private_bits=0,this.resvDrain_pre=0,this.resvDrain_post=0,this.scfsi=[wc(4),wc(4)];for(var C=0;C<2;C++)for(var $=0;$<2;$++)this.tt[C][$]=new Oo}var Hf=Uf,Lo=P.System,Fo=P.new_int;function Vf(C,$,ie,Z){this.l=Fo(1+T.SBMAX_l),this.s=Fo(1+T.SBMAX_s),this.psfb21=Fo(1+T.PSFB21),this.psfb12=Fo(1+T.PSFB12);var ye=this.l,Q=this.s;arguments.length==4&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],Lo.arraycopy(this.arrL,0,ye,0,Math.min(this.arrL.length,this.l.length)),Lo.arraycopy(this.arrS,0,Q,0,Math.min(this.arrS.length,this.s.length)),Lo.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),Lo.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}var Nn=Vf,o0=P.new_float,qf=P.new_float_n,zf=P.new_int;function jf(){this.last_en_subshort=qf([4,9]),this.lastAttacks=zf(4),this.pefirbuf=o0(19),this.longfact=o0(T.SBMAX_l),this.shortfact=o0(T.SBMAX_s),this.attackthre=0,this.attackthre_s=0}var Gf=jf;function Xf(){this.sum=0,this.seen=0,this.want=0,this.pos=0,this.size=0,this.bag=null,this.nVbrNumFrames=0,this.nBytesWritten=0,this.TotalFrameSize=0}var Kf=Xf,Wf=P.new_byte,Yf=P.new_double,on=P.new_float,Ei=P.new_float_n,hn=P.new_int,Uo=P.new_int_n;jn.MFSIZE=3*1152+T.ENCDELAY-T.MDCTDELAY,jn.MAX_HEADER_BUF=256,jn.MAX_BITS_PER_CHANNEL=4095,jn.MAX_BITS_PER_GRANULE=7680,jn.BPC=320;function jn(){var C=40;this.Class_ID=0,this.lame_encode_frame_init=0,this.iteration_init_init=0,this.fill_buffer_resample_init=0,this.mfbuf=Ei([2,jn.MFSIZE]),this.mode_gr=0,this.channels_in=0,this.channels_out=0,this.resample_ratio=0,this.mf_samples_to_encode=0,this.mf_size=0,this.VBR_min_bitrate=0,this.VBR_max_bitrate=0,this.bitrate_index=0,this.samplerate_index=0,this.mode_ext=0,this.lowpass1=0,this.lowpass2=0,this.highpass1=0,this.highpass2=0,this.noise_shaping=0,this.noise_shaping_amp=0,this.substep_shaping=0,this.psymodel=0,this.noise_shaping_stop=0,this.subblock_gain=0,this.use_best_huffman=0,this.full_outer_loop=0,this.l3_side=new Hf,this.ms_ratio=on(2),this.padding=0,this.frac_SpF=0,this.slot_lag=0,this.tag_spec=null,this.nMusicCRC=0,this.OldValue=hn(2),this.CurrentStep=hn(2),this.masking_lower=0,this.bv_scf=hn(576),this.pseudohalf=hn(xi.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*jn.BPC+1),this.itime=Yf(2),this.sideinfo_len=0,this.sb_sample=Ei([2,2,18,T.SBLIMIT]),this.amp_filter=on(32);function $(){this.write_timing=0,this.ptr=0,this.buf=Wf(C)}this.header=new Array(jn.MAX_HEADER_BUF),this.h_ptr=0,this.w_ptr=0,this.ancillary_flag=0,this.ResvSize=0,this.ResvMax=0,this.scalefac_band=new Nn,this.minval_l=on(T.CBANDS),this.minval_s=on(T.CBANDS),this.nb_1=Ei([4,T.CBANDS]),this.nb_2=Ei([4,T.CBANDS]),this.nb_s1=Ei([4,T.CBANDS]),this.nb_s2=Ei([4,T.CBANDS]),this.s3_ss=null,this.s3_ll=null,this.decay=0,this.thm=new Array(4),this.en=new Array(4),this.tot_ener=on(4),this.loudness_sq=Ei([2,2]),this.loudness_sq_save=on(2),this.mld_l=on(T.SBMAX_l),this.mld_s=on(T.SBMAX_s),this.bm_l=hn(T.SBMAX_l),this.bo_l=hn(T.SBMAX_l),this.bm_s=hn(T.SBMAX_s),this.bo_s=hn(T.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=Uo([T.CBANDS,2]),this.s3ind_s=Uo([T.CBANDS,2]),this.numlines_s=hn(T.CBANDS),this.numlines_l=hn(T.CBANDS),this.rnumlines_l=on(T.CBANDS),this.mld_cb_l=on(T.CBANDS),this.mld_cb_s=on(T.CBANDS),this.numlines_s_num1=0,this.numlines_l_num1=0,this.pe=on(4),this.ms_ratio_s_old=0,this.ms_ratio_l_old=0,this.ms_ener_ratio_old=0,this.blocktype_old=hn(2),this.nsPsy=new Gf,this.VBR_seek_table=new Kf,this.ATH=null,this.PSY=null,this.nogap_total=0,this.nogap_current=0,this.decode_on_the_fly=!0,this.findReplayGain=!0,this.findPeakSample=!0,this.PeakSample=0,this.RadioGain=0,this.AudiophileGain=0,this.rgdata=null,this.noclipGainChange=0,this.noclipScale=0,this.bitrate_stereoMode_Hist=Uo([16,4+1]),this.bitrate_blockType_Hist=Uo([16,4+1+1]),this.pinfo=null,this.hip=null,this.in_buffer_nsamples=0,this.in_buffer_0=null,this.in_buffer_1=null,this.iteration_loop=null;for(var ie=0;ie<this.en.length;ie++)this.en[ie]=new sr;for(var ie=0;ie<this.thm.length;ie++)this.thm[ie]=new sr;for(var ie=0;ie<this.header.length;ie++)this.header[ie]=new $}var Bt=jn,wi=P.new_float;function $f(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=wi(T.SBMAX_l),this.s=wi(T.SBMAX_s),this.psfb21=wi(T.PSFB21),this.psfb12=wi(T.PSFB12),this.cb_l=wi(T.CBANDS),this.cb_s=wi(T.CBANDS),this.eql_w=wi(T.BLKSIZE/2)}var Zf=$f,Or=P.System,Rc=P.Arrays;Ut.STEPS_per_dB=100,Ut.MAX_dB=120,Ut.GAIN_NOT_ENOUGH_SAMPLES=-24601,Ut.GAIN_ANALYSIS_ERROR=0,Ut.GAIN_ANALYSIS_OK=1,Ut.INIT_GAIN_ANALYSIS_ERROR=0,Ut.INIT_GAIN_ANALYSIS_OK=1,Ut.YULE_ORDER=10,Ut.MAX_ORDER=Ut.YULE_ORDER,Ut.MAX_SAMP_FREQ=48e3,Ut.RMS_WINDOW_TIME_NUMERATOR=1,Ut.RMS_WINDOW_TIME_DENOMINATOR=20,Ut.MAX_SAMPLES_PER_WINDOW=Ut.MAX_SAMP_FREQ*Ut.RMS_WINDOW_TIME_NUMERATOR/Ut.RMS_WINDOW_TIME_DENOMINATOR+1;function Ut(){var C=64.82,$=Ut.YULE_ORDER,ie=.95,Z=Ut.MAX_SAMP_FREQ,ye=Ut.RMS_WINDOW_TIME_NUMERATOR,Q=Ut.RMS_WINDOW_TIME_DENOMINATOR,me=Ut.MAX_SAMPLES_PER_WINDOW,Ne=[[.038575994352,-3.84664617118067,-.02160367184185,7.81501653005538,-.00123395316851,-11.34170355132042,-9291677959e-14,13.05504219327545,-.01655260341619,-12.28759895145294,.02161526843274,9.4829380631979,-.02074045215285,-5.87257861775999,.00594298065125,2.75465861874613,.00306428023191,-.86984376593551,.00012025322027,.13919314567432,.00288463683916],[.0541865640643,-3.47845948550071,-.02911007808948,6.36317777566148,-.00848709379851,-8.54751527471874,-.00851165645469,9.4769360780128,-.00834990904936,-8.81498681370155,.02245293253339,6.85401540936998,-.02596338512915,-4.39470996079559,.01624864962975,2.19611684890774,-.00240879051584,-.75104302451432,.00674613682247,.13149317958808,-.00187763777362],[.15457299681924,-2.37898834973084,-.09331049056315,2.84868151156327,-.06247880153653,-2.64577170229825,.02163541888798,2.23697657451713,-.05588393329856,-1.67148153367602,.04781476674921,1.00595954808547,.00222312597743,-.45953458054983,.03174092540049,.16378164858596,-.01390589421898,-.05032077717131,.00651420667831,.0234789740702,-.00881362733839],[.30296907319327,-1.61273165137247,-.22613988682123,1.0797749225997,-.08587323730772,-.2565625775407,.03282930172664,-.1627671912044,-.00915702933434,-.22638893773906,-.02364141202522,.39120800788284,-.00584456039913,-.22138138954925,.06276101321749,.04500235387352,-828086748e-14,.02005851806501,.00205861885564,.00302439095741,-.02950134983287],[.33642304856132,-1.49858979367799,-.2557224142557,.87350271418188,-.11828570177555,.12205022308084,.11921148675203,-.80774944671438,-.07834489609479,.47854794562326,-.0046997791438,-.12453458140019,-.0058950022444,-.04067510197014,.05724228140351,.08333755284107,.00832043980773,-.04237348025746,-.0163538138454,.02977207319925,-.0176017656815],[.4491525660845,-.62820619233671,-.14351757464547,.29661783706366,-.22784394429749,-.372563729424,-.01419140100551,.00213767857124,.04078262797139,-.42029820170918,-.12398163381748,.22199650564824,.04097565135648,.00613424350682,.10478503600251,.06747620744683,-.01863887810927,.05784820375801,-.03193428438915,.03222754072173,.00541907748707],[.56619470757641,-1.04800335126349,-.75464456939302,.29156311971249,.1624213774223,-.26806001042947,.16744243493672,.00819999645858,-.18901604199609,.45054734505008,.3093178284183,-.33032403314006,-.27562961986224,.0673936833311,.00647310677246,-.04784254229033,.08647503780351,.01639907836189,-.0378898455484,.01807364323573,-.00588215443421],[.58100494960553,-.51035327095184,-.53174909058578,-.31863563325245,-.14289799034253,-.20256413484477,.17520704835522,.1472815413433,.02377945217615,.38952639978999,.15558449135573,-.23313271880868,-.25344790059353,-.05246019024463,.01628462406333,-.02505961724053,.06920467763959,.02442357316099,-.03721611395801,.01818801111503,-.00749618797172],[.53648789255105,-.2504987195602,-.42163034350696,-.43193942311114,-.00275953611929,-.03424681017675,.04267842219415,-.04678328784242,-.10214864179676,.26408300200955,.14590772289388,.15113130533216,-.02459864859345,-.17556493366449,-.11202315195388,-.18823009262115,-.04060034127,.05477720428674,.0478866554818,.0470440968812,-.02217936801134]],ke=[[.98621192462708,-1.97223372919527,-1.97242384925416,.97261396931306,.98621192462708],[.98500175787242,-1.96977855582618,-1.97000351574484,.9702284756635,.98500175787242],[.97938932735214,-1.95835380975398,-1.95877865470428,.95920349965459,.97938932735214],[.97531843204928,-1.95002759149878,-1.95063686409857,.95124613669835,.97531843204928],[.97316523498161,-1.94561023566527,-1.94633046996323,.94705070426118,.97316523498161],[.96454515552826,-1.92783286977036,-1.92909031105652,.93034775234268,.96454515552826],[.96009142950541,-1.91858953033784,-1.92018285901082,.92177618768381,.96009142950541],[.95856916599601,-1.9154210807478,-1.91713833199203,.91885558323625,.95856916599601],[.94597685600279,-1.88903307939452,-1.89195371200558,.89487434461664,.94597685600279]];function G(o,I,H,O,g,_){for(;g--!=0;)H[O]=1e-10+o[I+0]*_[0]-H[O-1]*_[1]+o[I-1]*_[2]-H[O-2]*_[3]+o[I-2]*_[4]-H[O-3]*_[5]+o[I-3]*_[6]-H[O-4]*_[7]+o[I-4]*_[8]-H[O-5]*_[9]+o[I-5]*_[10]-H[O-6]*_[11]+o[I-6]*_[12]-H[O-7]*_[13]+o[I-7]*_[14]-H[O-8]*_[15]+o[I-8]*_[16]-H[O-9]*_[17]+o[I-9]*_[18]-H[O-10]*_[19]+o[I-10]*_[20],++O,++I}function de(o,I,H,O,g,_){for(;g--!=0;)H[O]=o[I+0]*_[0]-H[O-1]*_[1]+o[I-1]*_[2]-H[O-2]*_[3]+o[I-2]*_[4],++O,++I}function he(o,I){for(var H=0;H<MAX_ORDER;H++)o.linprebuf[H]=o.lstepbuf[H]=o.loutbuf[H]=o.rinprebuf[H]=o.rstepbuf[H]=o.routbuf[H]=0;switch(0|I){case 48e3:o.reqindex=0;break;case 44100:o.reqindex=1;break;case 32e3:o.reqindex=2;break;case 24e3:o.reqindex=3;break;case 22050:o.reqindex=4;break;case 16e3:o.reqindex=5;break;case 12e3:o.reqindex=6;break;case 11025:o.reqindex=7;break;case 8e3:o.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return o.sampleWindow=0|(I*ye+Q-1)/Q,o.lsum=0,o.rsum=0,o.totsamp=0,Rc.ill(o.A,0),INIT_GAIN_ANALYSIS_OK}this.InitGainAnalysis=function(o,I){return he(o,I)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(o.linpre=MAX_ORDER,o.rinpre=MAX_ORDER,o.lstep=MAX_ORDER,o.rstep=MAX_ORDER,o.lout=MAX_ORDER,o.rout=MAX_ORDER,Rc.fill(o.B,0),INIT_GAIN_ANALYSIS_OK)};function M(o){return o*o}this.AnalyzeSamples=function(o,I,H,O,g,_,k){var q,w,c,L,y,u,m;if(_==0)return GAIN_ANALYSIS_OK;switch(m=0,y=_,k){case 1:O=I,g=H;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(_<MAX_ORDER?(Or.arraycopy(I,H,o.linprebuf,MAX_ORDER,_),Or.arraycopy(O,g,o.rinprebuf,MAX_ORDER,_)):(Or.arraycopy(I,H,o.linprebuf,MAX_ORDER,MAX_ORDER),Or.arraycopy(O,g,o.rinprebuf,MAX_ORDER,MAX_ORDER));y>0;){u=y>o.sampleWindow-o.totsamp?o.sampleWindow-o.totsamp:y,m<MAX_ORDER?(q=o.linpre+m,w=o.linprebuf,c=o.rinpre+m,L=o.rinprebuf,u>MAX_ORDER-m&&(u=MAX_ORDER-m)):(q=H+m,w=I,c=g+m,L=O),G(w,q,o.lstepbuf,o.lstep+o.totsamp,u,Ne[o.reqindex]),G(L,c,o.rstepbuf,o.rstep+o.totsamp,u,Ne[o.reqindex]),de(o.lstepbuf,o.lstep+o.totsamp,o.loutbuf,o.lout+o.totsamp,u,ke[o.reqindex]),de(o.rstepbuf,o.rstep+o.totsamp,o.routbuf,o.rout+o.totsamp,u,ke[o.reqindex]),q=o.lout+o.totsamp,w=o.loutbuf,c=o.rout+o.totsamp,L=o.routbuf;for(var b=u%8;b--!=0;)o.lsum+=M(w[q++]),o.rsum+=M(L[c++]);for(b=u/8;b--!=0;)o.lsum+=M(w[q+0])+M(w[q+1])+M(w[q+2])+M(w[q+3])+M(w[q+4])+M(w[q+5])+M(w[q+6])+M(w[q+7]),q+=8,o.rsum+=M(L[c+0])+M(L[c+1])+M(L[c+2])+M(L[c+3])+M(L[c+4])+M(L[c+5])+M(L[c+6])+M(L[c+7]),c+=8;if(y-=u,m+=u,o.totsamp+=u,o.totsamp==o.sampleWindow){var l=Ut.STEPS_per_dB*10*Math.log10((o.lsum+o.rsum)/o.totsamp*.5+1e-37),h=l<=0?0:0|l;h>=o.A.length&&(h=o.A.length-1),o.A[h]++,o.lsum=o.rsum=0,Or.arraycopy(o.loutbuf,o.totsamp,o.loutbuf,0,MAX_ORDER),Or.arraycopy(o.routbuf,o.totsamp,o.routbuf,0,MAX_ORDER),Or.arraycopy(o.lstepbuf,o.totsamp,o.lstepbuf,0,MAX_ORDER),Or.arraycopy(o.rstepbuf,o.totsamp,o.rstepbuf,0,MAX_ORDER),o.totsamp=0}if(o.totsamp>o.sampleWindow)return GAIN_ANALYSIS_ERROR}return _<MAX_ORDER?(Or.arraycopy(o.linprebuf,_,o.linprebuf,0,MAX_ORDER-_),Or.arraycopy(o.rinprebuf,_,o.rinprebuf,0,MAX_ORDER-_),Or.arraycopy(I,H,o.linprebuf,MAX_ORDER-_,_),Or.arraycopy(O,g,o.rinprebuf,MAX_ORDER-_,_)):(Or.arraycopy(I,H+_-MAX_ORDER,o.linprebuf,0,MAX_ORDER),Or.arraycopy(O,g+_-MAX_ORDER,o.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK};function K(o,I){var H,O=0;for(H=0;H<I;H++)O+=o[H];if(O==0)return GAIN_NOT_ENOUGH_SAMPLES;var g=0|Math.ceil(O*(1-ie));for(H=I;H-- >0&&!((g-=o[H])<=0););return C-H/Ut.STEPS_per_dB}this.GetTitleGain=function(o){for(var I=K(o.A,o.A.length),H=0;H<o.A.length;H++)o.B[H]+=o.A[H],o.A[H]=0;for(var H=0;H<MAX_ORDER;H++)o.linprebuf[H]=o.lstepbuf[H]=o.loutbuf[H]=o.rinprebuf[H]=o.rstepbuf[H]=o.routbuf[H]=0;return o.totsamp=0,o.lsum=o.rsum=0,I}}var Ir=Ut,ta=P.new_float,Tc=P.new_int;function Qf(){this.linprebuf=ta(Ir.MAX_ORDER*2),this.linpre=0,this.lstepbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.lstep=0,this.loutbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.lout=0,this.rinprebuf=ta(Ir.MAX_ORDER*2),this.rinpre=0,this.rstepbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.rstep=0,this.routbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.rout=0,this.sampleWindow=0,this.totsamp=0,this.lsum=0,this.rsum=0,this.freqindex=0,this.first=0,this.A=Tc(0|Ir.STEPS_per_dB*Ir.MAX_dB),this.B=Tc(0|Ir.STEPS_per_dB*Ir.MAX_dB)}var Jf=Qf;function ed(C){this.bits=C}var Ac=ed,Ic=P.new_float,td=P.new_int,Cc=P.assert;function rd(C){var $=C;this.quantize=$,this.iteration_loop=function(ie,Z,ye,Q){var me=ie.internal_flags,Ne=Ic(xi.SFBMAX),ke=Ic(576),G=td(2),de=0,he,M=me.l3_side,K=new Ac(de);this.quantize.rv.ResvFrameBegin(ie,K),de=K.bits;for(var o=0;o<me.mode_gr;o++){he=this.quantize.qupvt.on_pe(ie,Z,G,de,o,o),me.mode_ext==T.MPG_MD_MS_LR&&(this.quantize.ms_convert(me.l3_side,o),this.quantize.qupvt.reduce_side(G,ye[o],de,he));for(var I=0;I<me.channels_out;I++){var H,O,g=M.tt[o][I];g.block_type!=T.SHORT_TYPE?(H=0,O=me.PSY.mask_adjust-H):(H=0,O=me.PSY.mask_adjust_short-H),me.masking_lower=Math.pow(10,O*.1),this.quantize.init_outer_loop(me,g),this.quantize.init_xrpow(me,g,ke)&&(this.quantize.qupvt.calc_xmin(ie,Q[o][I],g,Ne),this.quantize.outer_loop(ie,g,Ne,ke,I,G[I])),this.quantize.iteration_finish_one(me,o,I),Cc(g.part2_3_length<=Bt.MAX_BITS_PER_CHANNEL),Cc(g.part2_3_length<=G[I])}}this.quantize.rv.ResvFrameEnd(me,de)}}var nd=rd;function Et(C,$,ie,Z){this.xlen=C,this.linmax=$,this.table=ie,this.hlen=Z}var Me={};Me.t1HB=[1,1,1,0],Me.t2HB=[1,2,1,3,1,1,3,2,0],Me.t3HB=[3,2,1,1,1,1,3,2,0],Me.t5HB=[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],Me.t6HB=[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],Me.t7HB=[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],Me.t8HB=[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],Me.t9HB=[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],Me.t10HB=[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],Me.t11HB=[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],Me.t12HB=[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],Me.t13HB=[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],Me.t15HB=[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],Me.t16HB=[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],Me.t24HB=[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],Me.t32HB=[1<<0,5<<1,4<<1,5<<2,6<<1,5<<2,4<<2,4<<3,7<<1,3<<2,6<<2,0<<3,7<<2,2<<3,3<<3,1<<4],Me.t33HB=[15<<0,14<<1,13<<1,12<<2,11<<1,10<<2,9<<2,8<<3,7<<1,6<<2,5<<2,4<<3,3<<2,2<<3,1<<3,0<<4],Me.t1l=[1,4,3,5],Me.t2l=[1,4,7,4,5,7,6,7,8],Me.t3l=[2,3,7,4,4,7,6,7,8],Me.t5l=[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],Me.t6l=[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],Me.t7l=[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],Me.t8l=[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],Me.t9l=[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],Me.t10l=[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],Me.t11l=[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],Me.t12l=[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],Me.t13l=[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],Me.t15l=[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],Me.t16_5l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],Me.t16l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],Me.t24l=[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],Me.t32l=[1+0,4+1,4+1,5+2,4+1,6+2,5+2,6+3,4+1,5+2,5+2,6+3,5+2,6+3,6+3,6+4],Me.t33l=[4+0,4+1,4+1,4+2,4+1,4+2,4+2,4+3,4+1,4+2,4+2,4+3,4+2,4+3,4+3,4+4],Me.ht=[new Et(0,0,null,null),new Et(2,0,Me.t1HB,Me.t1l),new Et(3,0,Me.t2HB,Me.t2l),new Et(3,0,Me.t3HB,Me.t3l),new Et(0,0,null,null),new Et(4,0,Me.t5HB,Me.t5l),new Et(4,0,Me.t6HB,Me.t6l),new Et(6,0,Me.t7HB,Me.t7l),new Et(6,0,Me.t8HB,Me.t8l),new Et(6,0,Me.t9HB,Me.t9l),new Et(8,0,Me.t10HB,Me.t10l),new Et(8,0,Me.t11HB,Me.t11l),new Et(8,0,Me.t12HB,Me.t12l),new Et(16,0,Me.t13HB,Me.t13l),new Et(0,0,null,Me.t16_5l),new Et(16,0,Me.t15HB,Me.t15l),new Et(1,1,Me.t16HB,Me.t16l),new Et(2,3,Me.t16HB,Me.t16l),new Et(3,7,Me.t16HB,Me.t16l),new Et(4,15,Me.t16HB,Me.t16l),new Et(6,63,Me.t16HB,Me.t16l),new Et(8,255,Me.t16HB,Me.t16l),new Et(10,1023,Me.t16HB,Me.t16l),new Et(13,8191,Me.t16HB,Me.t16l),new Et(4,15,Me.t24HB,Me.t24l),new Et(5,31,Me.t24HB,Me.t24l),new Et(6,63,Me.t24HB,Me.t24l),new Et(7,127,Me.t24HB,Me.t24l),new Et(8,255,Me.t24HB,Me.t24l),new Et(9,511,Me.t24HB,Me.t24l),new Et(11,2047,Me.t24HB,Me.t24l),new Et(13,8191,Me.t24HB,Me.t24l),new Et(0,0,Me.t32HB,Me.t32l),new Et(0,0,Me.t33HB,Me.t33l)],Me.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],Me.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],Me.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],Me.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],Me.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],Me.scfsi_band=[0,6,11,16,21];var bt=Me,Ri=P.VbrMode,Ho=P.Float,s0=P.Util,Ti=P.new_float,id=P.new_int,Gn=P.assert;jr.Q_MAX=256+1,jr.Q_MAX2=116,jr.LARGE_BITS=1e5,jr.IXMAX_VAL=8206;function jr(){var C=null,$=null,ie=null;this.setModules=function(_,k,q){C=_,$=k,ie=q};function Z(_){return Gn(0<=_+jr.Q_MAX2&&_<jr.Q_MAX),M[_+jr.Q_MAX2]}this.IPOW20=function(_){return Gn(0<=_&&_<jr.Q_MAX),K[_]};var ye=2220446049250313e-31,Q=jr.IXMAX_VAL,me=Q+2,Ne=jr.Q_MAX,ke=jr.Q_MAX2,G=jr.LARGE_BITS,de=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var he=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=he,this.sfBandIndex=[new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0/3,24/3,48/3,72/3,108/3,156/3,216/3,288/3,372/3,480/3,486/3,492/3,498/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var M=Ti(Ne+ke+1),K=Ti(Ne),o=Ti(me),I=Ti(me);this.adj43=I;function H(_,k){var q=ie.ATHformula(k,_);return q-=de,q=Math.pow(10,q/10+_.ATHlower),q}function O(_){for(var k=_.internal_flags.ATH.l,q=_.internal_flags.ATH.psfb21,w=_.internal_flags.ATH.s,c=_.internal_flags.ATH.psfb12,L=_.internal_flags,y=_.out_samplerate,u=0;u<T.SBMAX_l;u++){var m=L.scalefac_band.l[u],b=L.scalefac_band.l[u+1];k[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/1152,x=H(_,h);k[u]=Math.min(k[u],x)}}for(var u=0;u<T.PSFB21;u++){var m=L.scalefac_band.psfb21[u],b=L.scalefac_band.psfb21[u+1];q[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/1152,x=H(_,h);q[u]=Math.min(q[u],x)}}for(var u=0;u<T.SBMAX_s;u++){var m=L.scalefac_band.s[u],b=L.scalefac_band.s[u+1];w[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/384,x=H(_,h);w[u]=Math.min(w[u],x)}w[u]*=L.scalefac_band.s[u+1]-L.scalefac_band.s[u]}for(var u=0;u<T.PSFB12;u++){var m=L.scalefac_band.psfb12[u],b=L.scalefac_band.psfb12[u+1];c[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/384,x=H(_,h);c[u]=Math.min(c[u],x)}c[u]*=L.scalefac_band.s[13]-L.scalefac_band.s[12]}if(_.noATH){for(var u=0;u<T.SBMAX_l;u++)k[u]=1e-20;for(var u=0;u<T.PSFB21;u++)q[u]=1e-20;for(var u=0;u<T.SBMAX_s;u++)w[u]=1e-20;for(var u=0;u<T.PSFB12;u++)c[u]=1e-20}L.ATH.floor=10*Math.log10(H(_,-1))}this.iteration_init=function(_){var k=_.internal_flags,q=k.l3_side,w;if(k.iteration_init_init==0){for(k.iteration_init_init=1,q.main_data_begin=0,O(_),o[0]=0,w=1;w<me;w++)o[w]=Math.pow(w,4/3);for(w=0;w<me-1;w++)I[w]=w+1-Math.pow(.5*(o[w]+o[w+1]),.75);for(I[w]=.5,w=0;w<Ne;w++)K[w]=Math.pow(2,(w-210)*-.1875);for(w=0;w<=Ne+ke;w++)M[w]=Math.pow(2,(w-210-ke)*.25);C.huffman_init(k);{var c,L,y,u;for(w=_.exp_nspsytune>>2&63,w>=32&&(w-=64),c=Math.pow(10,w/4/10),w=_.exp_nspsytune>>8&63,w>=32&&(w-=64),L=Math.pow(10,w/4/10),w=_.exp_nspsytune>>14&63,w>=32&&(w-=64),y=Math.pow(10,w/4/10),w=_.exp_nspsytune>>20&63,w>=32&&(w-=64),u=y*Math.pow(10,w/4/10),w=0;w<T.SBMAX_l;w++){var m;w<=6?m=c:w<=13?m=L:w<=20?m=y:m=u,k.nsPsy.longfact[w]=m}for(w=0;w<T.SBMAX_s;w++){var m;w<=5?m=c:w<=10?m=L:w<=11?m=y:m=u,k.nsPsy.shortfact[w]=m}}}},this.on_pe=function(_,k,q,w,c,L){var y=_.internal_flags,u=0,m,b=id(2),l,h=new Ac(u),x=$.ResvMaxBits(_,w,h,L);u=h.bits;var E=u+x;for(E>Bt.MAX_BITS_PER_GRANULE&&(E=Bt.MAX_BITS_PER_GRANULE),m=0,l=0;l<y.channels_out;++l)q[l]=Math.min(Bt.MAX_BITS_PER_CHANNEL,u/y.channels_out),b[l]=0|q[l]*k[c][l]/700-q[l],b[l]>w*3/4&&(b[l]=w*3/4),b[l]<0&&(b[l]=0),b[l]+q[l]>Bt.MAX_BITS_PER_CHANNEL&&(b[l]=Math.max(0,Bt.MAX_BITS_PER_CHANNEL-q[l])),m+=b[l];if(m>x)for(l=0;l<y.channels_out;++l)b[l]=x*b[l]/m;for(l=0;l<y.channels_out;++l)q[l]+=b[l],x-=b[l];for(m=0,l=0;l<y.channels_out;++l)m+=q[l];if(m>Bt.MAX_BITS_PER_GRANULE){var X=0;for(l=0;l<y.channels_out;++l)q[l]*=Bt.MAX_BITS_PER_GRANULE,q[l]/=m,X+=q[l];Gn(X<=Bt.MAX_BITS_PER_GRANULE)}return E},this.reduce_side=function(_,k,q,w){Gn(w<=Bt.MAX_BITS_PER_GRANULE),Gn(_[0]+_[1]<=Bt.MAX_BITS_PER_GRANULE);var c=.33*(.5-k)/.5;c<0&&(c=0),c>.5&&(c=.5);var L=0|c*.5*(_[0]+_[1]);L>Bt.MAX_BITS_PER_CHANNEL-_[0]&&(L=Bt.MAX_BITS_PER_CHANNEL-_[0]),L<0&&(L=0),_[1]>=125&&(_[1]-L>125?(_[0]<q&&(_[0]+=L),_[1]-=L):(_[0]+=_[1]-125,_[1]=125)),L=_[0]+_[1],L>w&&(_[0]=w*_[0]/L,_[1]=w*_[1]/L),Gn(_[0]<=Bt.MAX_BITS_PER_CHANNEL),Gn(_[1]<=Bt.MAX_BITS_PER_CHANNEL),Gn(_[0]+_[1]<=Bt.MAX_BITS_PER_GRANULE)},this.athAdjust=function(_,k,q){var w=90.30873362,c=94.82444863,L=s0.FAST_LOG10_X(k,10),y=_*_,u=0;return L-=q,y>1e-20&&(u=1+s0.FAST_LOG10_X(y,10/w)),u<0&&(u=0),L*=u,L+=q+w-c,Math.pow(10,.1*L)},this.calc_xmin=function(_,k,q,w){var c=0,L=_.internal_flags,y,u=0,m=0,b=L.ATH,l=q.xr,h=_.VBR==Ri.vbr_mtrh?1:0,x=L.masking_lower;for((_.VBR==Ri.vbr_mtrh||_.VBR==Ri.vbr_mt)&&(x=1),y=0;y<q.psy_lmax;y++){var E,X,U,j,Se,f;_.VBR==Ri.vbr_rh||_.VBR==Ri.vbr_mtrh?X=athAdjust(b.adjust,b.l[y],b.floor):X=b.adjust*b.l[y],Se=q.width[y],U=X/Se,j=ye,f=Se>>1,E=0;do{var S,fe;S=l[u]*l[u],E+=S,j+=S<U?S:U,u++,fe=l[u]*l[u],E+=fe,j+=fe<U?fe:U,u++}while(--f>0);if(E>X&&m++,y==T.SBPSY_l){var _e=X*L.nsPsy.longfact[y];j<_e&&(j=_e)}if(h!=0&&(X=j),!_.ATHonly){var Oe=k.en.l[y];if(Oe>0){var _e;_e=E*k.thm.l[y]*x/Oe,h!=0&&(_e*=L.nsPsy.longfact[y]),X<_e&&(X=_e)}}h!=0?w[c++]=X:w[c++]=X*L.nsPsy.longfact[y]}var Ue=575;if(q.block_type!=T.SHORT_TYPE)for(var je=576;je--!=0&&Xn.EQ(l[je],0);)Ue=je;q.max_nonzero_coeff=Ue;for(var ze=q.sfb_smin;y<q.psymax;ze++,y+=3){var Se,nt,Ke;for(_.VBR==Ri.vbr_rh||_.VBR==Ri.vbr_mtrh?Ke=athAdjust(b.adjust,b.s[ze],b.floor):Ke=b.adjust*b.s[ze],Se=q.width[y],nt=0;nt<3;nt++){var E=0,X,U,j,f=Se>>1;U=Ke/Se,j=ye;do{var S,fe;S=l[u]*l[u],E+=S,j+=S<U?S:U,u++,fe=l[u]*l[u],E+=fe,j+=fe<U?fe:U,u++}while(--f>0);if(E>Ke&&m++,ze==T.SBPSY_s){var _e=Ke*L.nsPsy.shortfact[ze];j<_e&&(j=_e)}if(h!=0?X=j:X=Ke,!_.ATHonly&&!_.ATHshort){var Oe=k.en.s[ze][nt];if(Oe>0){var _e;_e=E*k.thm.s[ze][nt]*x/Oe,h!=0&&(_e*=L.nsPsy.shortfact[ze]),X<_e&&(X=_e)}}h!=0?w[c++]=X:w[c++]=X*L.nsPsy.shortfact[ze]}_.useTemporal&&(w[c-3]>w[c-3+1]&&(w[c-3+1]+=(w[c-3]-w[c-3+1])*L.decay),w[c-3+1]>w[c-3+2]&&(w[c-3+2]+=(w[c-3+1]-w[c-3+2])*L.decay))}return m};function g(_){this.s=_}this.calc_noise_core=function(_,k,q,w){var c=0,L=k.s,y=_.l3_enc;if(L>_.count1)for(;q--!=0;){var u;u=_.xr[L],L++,c+=u*u,u=_.xr[L],L++,c+=u*u}else if(L>_.big_values){var m=Ti(2);for(m[0]=0,m[1]=w;q--!=0;){var u;u=Math.abs(_.xr[L])-m[y[L]],L++,c+=u*u,u=Math.abs(_.xr[L])-m[y[L]],L++,c+=u*u}}else for(;q--!=0;){var u;u=Math.abs(_.xr[L])-o[y[L]]*w,L++,c+=u*u,u=Math.abs(_.xr[L])-o[y[L]]*w,L++,c+=u*u}return k.s=L,c},this.calc_noise=function(_,k,q,w,c){var L=0,y=0,u,m,b=0,l=0,h=0,x=-20,E=0,X=_.scalefac,U=0;for(w.over_SSD=0,u=0;u<_.psymax;u++){var j=_.global_gain-(X[U++]+(_.preflag!=0?he[u]:0)<<_.scalefac_scale+1)-_.subblock_gain[_.window[u]]*8,Se=0;if(c!=null&&c.step[u]==j)Se=c.noise[u],E+=_.width[u],q[L++]=Se/k[y++],Se=c.noise_log[u];else{var f=Z(j);if(m=_.width[u]>>1,E+_.width[u]>_.max_nonzero_coeff){var S;S=_.max_nonzero_coeff-E+1,S>0?m=S>>1:m=0}var fe=new g(E);Se=this.calc_noise_core(_,fe,m,f),E=fe.s,c!=null&&(c.step[u]=j,c.noise[u]=Se),Se=q[L++]=Se/k[y++],Se=s0.FAST_LOG10(Math.max(Se,1e-20)),c!=null&&(c.noise_log[u]=Se)}if(c!=null&&(c.global_gain=_.global_gain),h+=Se,Se>0){var _e;_e=Math.max(0|Se*10+.5,1),w.over_SSD+=_e*_e,b++,l+=Se}x=Math.max(x,Se)}return w.over_count=b,w.tot_noise=h,w.over_noise=l,w.max_noise=x,b},this.set_pinfo=function(_,k,q,w,c){var L=_.internal_flags,y,u,m,b,l,h=k.scalefac_scale==0?.5:1,x=k.scalefac,E=Ti(L3Side.SFBMAX),X=Ti(L3Side.SFBMAX),U=new CalcNoiseResult;calc_xmin(_,q,k,E),calc_noise(k,E,X,U,null);var j=0;for(u=k.sfb_lmax,k.block_type!=T.SHORT_TYPE&&k.mixed_block_flag==0&&(u=22),y=0;y<u;y++){var Se=L.scalefac_band.l[y],f=L.scalefac_band.l[y+1],S=f-Se;for(b=0;j<f;j++)b+=k.xr[j]*k.xr[j];b/=S,l=1e15,L.pinfo.en[w][c][y]=l*b,L.pinfo.xfsf[w][c][y]=l*E[y]*X[y]/S,q.en.l[y]>0&&!_.ATHonly?b=b/q.en.l[y]:b=0,L.pinfo.thr[w][c][y]=l*Math.max(b*q.thm.l[y],L.ATH.l[y]),L.pinfo.LAMEsfb[w][c][y]=0,k.preflag!=0&&y>=11&&(L.pinfo.LAMEsfb[w][c][y]=-h*he[y]),y<T.SBPSY_l&&(Gn(x[y]>=0),L.pinfo.LAMEsfb[w][c][y]-=h*x[y])}if(k.block_type==T.SHORT_TYPE)for(u=y,y=k.sfb_smin;y<T.SBMAX_s;y++)for(var Se=L.scalefac_band.s[y],f=L.scalefac_band.s[y+1],S=f-Se,fe=0;fe<3;fe++){for(b=0,m=Se;m<f;m++)b+=k.xr[j]*k.xr[j],j++;b=Math.max(b/S,1e-20),l=1e15,L.pinfo.en_s[w][c][3*y+fe]=l*b,L.pinfo.xfsf_s[w][c][3*y+fe]=l*E[u]*X[u]/S,q.en.s[y][fe]>0?b=b/q.en.s[y][fe]:b=0,(_.ATHonly||_.ATHshort)&&(b=0),L.pinfo.thr_s[w][c][3*y+fe]=l*Math.max(b*q.thm.s[y][fe],L.ATH.s[y]),L.pinfo.LAMEsfb_s[w][c][3*y+fe]=-2*k.subblock_gain[fe],y<T.SBPSY_s&&(L.pinfo.LAMEsfb_s[w][c][3*y+fe]-=h*x[u]),u++}L.pinfo.LAMEqss[w][c]=k.global_gain,L.pinfo.LAMEmainbits[w][c]=k.part2_3_length+k.part2_length,L.pinfo.LAMEsfbits[w][c]=k.part2_length,L.pinfo.over[w][c]=U.over_count,L.pinfo.max_noise[w][c]=U.max_noise*10,L.pinfo.over_noise[w][c]=U.over_noise*10,L.pinfo.tot_noise[w][c]=U.tot_noise*10,L.pinfo.over_SSD[w][c]=U.over_SSD}}var ti=jr,ad=P.System,od=P.Arrays,za=P.new_int,sn=P.assert;function l0(){var C=null;this.qupvt=null,this.setModules=function(u){this.qupvt=u,C=u};function $(u){this.bits=0|u}var ie=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]];function Z(u,m,b,l,h,x){var E=.5946/m;for(sn(u>0),u=u>>1;u--!=0;)h[x++]=E>b[l++]?0:1,h[x++]=E>b[l++]?0:1}function ye(u,m,b,l,h,x){sn(u>0),u=u>>1;var E=u%2;for(u=u>>1;u--!=0;){var X,U,j,Se,f,S,fe,_e;X=b[l++]*m,U=b[l++]*m,f=0|X,j=b[l++]*m,S=0|U,Se=b[l++]*m,fe=0|j,X+=C.adj43[f],_e=0|Se,U+=C.adj43[S],h[x++]=0|X,j+=C.adj43[fe],h[x++]=0|U,Se+=C.adj43[_e],h[x++]=0|j,h[x++]=0|Se}if(E!=0){var X,U,f,S;X=b[l++]*m,U=b[l++]*m,f=0|X,S=0|U,X+=C.adj43[f],U+=C.adj43[S],h[x++]=0|X,h[x++]=0|U}}function Q(u,m,b,l,h){var x,E,X=0,U,j=0,Se=0,f=0,S=m,fe=0,_e=S,Oe=0,Ue=u,je=0;for(U=h!=null&&l.global_gain==h.global_gain,l.block_type==T.SHORT_TYPE?E=38:E=21,x=0;x<=E;x++){var ze=-1;if((U||l.block_type==T.NORM_TYPE)&&(ze=l.global_gain-(l.scalefac[x]+(l.preflag!=0?C.pretab[x]:0)<<l.scalefac_scale+1)-l.subblock_gain[l.window[x]]*8),sn(l.width[x]>=0),U&&h.step[x]==ze)j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0),Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0);else{var nt=l.width[x];if(X+l.width[x]>l.max_nonzero_coeff){var Ke;Ke=l.max_nonzero_coeff-X+1,od.fill(m,l.max_nonzero_coeff,576,0),nt=Ke,nt<0&&(nt=0),x=E+1}if(j==0&&Se==0&&(_e=S,Oe=fe,Ue=u,je=f),h!=null&&h.sfb_count1>0&&x>=h.sfb_count1&&h.step[x]>0&&ze>=h.step[x]?(j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0,_e=S,Oe=fe,Ue=u,je=f),Se+=nt):(Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0,_e=S,Oe=fe,Ue=u,je=f),j+=nt),nt<=0){Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0),j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0);break}}x<=E&&(fe+=l.width[x],f+=l.width[x],X+=l.width[x])}j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0),Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0)}function me(u,m,b){var l=0,h=0;do{var x=u[m++],E=u[m++];l<x&&(l=x),h<E&&(h=E)}while(m<b);return l<h&&(l=h),l}function Ne(u,m,b,l,h,x){var E=bt.ht[l].xlen*65536+bt.ht[h].xlen,X=0,U;do{var j=u[m++],Se=u[m++];j!=0&&(j>14&&(j=15,X+=E),j*=16),Se!=0&&(Se>14&&(Se=15,X+=E),j+=Se),X+=bt.largetbl[j]}while(m<b);return U=X&65535,X>>=16,X>U&&(X=U,l=h),x.bits+=X,l}function ke(u,m,b,l){var h=0,x=bt.ht[1].hlen;do{var E=u[m+0]*2+u[m+1];m+=2,h+=x[E]}while(m<b);return l.bits+=h,1}function G(u,m,b,l,h){var x=0,E,X=bt.ht[l].xlen,U;l==2?U=bt.table23:U=bt.table56;do{var j=u[m+0]*X+u[m+1];m+=2,x+=U[j]}while(m<b);return E=x&65535,x>>=16,x>E&&(x=E,l++),h.bits+=x,l}function de(u,m,b,l,h){var x=0,E=0,X=0,U=bt.ht[l].xlen,j=bt.ht[l].hlen,Se=bt.ht[l+1].hlen,f=bt.ht[l+2].hlen;do{var S=u[m+0]*U+u[m+1];m+=2,x+=j[S],E+=Se[S],X+=f[S]}while(m<b);var fe=l;return x>E&&(x=E,fe++),x>X&&(x=X,fe=l+2),h.bits+=x,fe}var he=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function M(u,m,b,l){var h=me(u,m,b);switch(h){case 0:return h;case 1:return ke(u,m,b,l);case 2:case 3:return G(u,m,b,he[h-1],l);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return de(u,m,b,he[h-1],l);default:if(h>ti.IXMAX_VAL)return l.bits=ti.LARGE_BITS,-1;h-=15;var x;for(x=24;x<32&&!(bt.ht[x].linmax>=h);x++);var E;for(E=x-8;E<24&&!(bt.ht[E].linmax>=h);E++);return Ne(u,m,b,E,x,l)}}this.noquant_count_bits=function(u,m,b){var l=m.l3_enc,h=Math.min(576,m.max_nonzero_coeff+2>>1<<1);for(b!=null&&(b.sfb_count1=0);h>1&&(l[h-1]|l[h-2])==0;h-=2);m.count1=h;for(var x=0,E=0;h>3;h-=4){var X;if(((l[h-1]|l[h-2]|l[h-3]|l[h-4])&2147483647)>1)break;X=((l[h-4]*2+l[h-3])*2+l[h-2])*2+l[h-1],x+=bt.t32l[X],E+=bt.t33l[X]}var U=x;if(m.count1table_select=0,x>E&&(U=E,m.count1table_select=1),m.count1bits=U,m.big_values=h,h==0)return U;if(m.block_type==T.SHORT_TYPE)x=3*u.scalefac_band.s[3],x>m.big_values&&(x=m.big_values),E=m.big_values;else if(m.block_type==T.NORM_TYPE){if(sn(h<=576),x=m.region0_count=u.bv_scf[h-2],E=m.region1_count=u.bv_scf[h-1],sn(x+E+2<T.SBPSY_l),E=u.scalefac_band.l[x+E+2],x=u.scalefac_band.l[x+1],E<h){var j=new $(U);m.table_select[2]=M(l,E,h,j),U=j.bits}}else m.region0_count=7,m.region1_count=T.SBMAX_l-1-7-1,x=u.scalefac_band.l[7+1],E=h,x>E&&(x=E);if(x=Math.min(x,h),E=Math.min(E,h),sn(x>=0),sn(E>=0),0<x){var j=new $(U);m.table_select[0]=M(l,0,x,j),U=j.bits}if(x<E){var j=new $(U);m.table_select[1]=M(l,x,E,j),U=j.bits}if(u.use_best_huffman==2&&(m.part2_3_length=U,best_huffman_divide(u,m),U=m.part2_3_length),b!=null&&m.block_type==T.NORM_TYPE){for(var Se=0;u.scalefac_band.l[Se]<m.big_values;)Se++;b.sfb_count1=Se}return U},this.count_bits=function(u,m,b,l){var h=b.l3_enc,x=ti.IXMAX_VAL/C.IPOW20(b.global_gain);if(b.xrpow_max>x)return ti.LARGE_BITS;if(Q(m,h,C.IPOW20(b.global_gain),b,l),(u.substep_shaping&2)!=0)for(var E=0,X=b.global_gain+b.scalefac_scale,U=.634521682242439/C.IPOW20(X),j=0;j<b.sfbmax;j++){var Se=b.width[j];if(sn(Se>=0),u.pseudohalf[j]==0)E+=Se;else{var f;for(f=E,E+=Se;f<E;++f)h[f]=m[f]>=U?h[f]:0}}return this.noquant_count_bits(u,b,l)};function K(u,m,b,l,h,x,E){for(var X=m.big_values,U=0;U<=7+15;U++)l[U]=ti.LARGE_BITS;for(var U=0;U<16;U++){var j=u.scalefac_band.l[U+1];if(j>=X)break;var Se=0,f=new $(Se),S=M(b,0,j,f);Se=f.bits;for(var fe=0;fe<8;fe++){var _e=u.scalefac_band.l[U+fe+2];if(_e>=X)break;var Oe=Se;f=new $(Oe);var Ue=M(b,j,_e,f);Oe=f.bits,l[U+fe]>Oe&&(l[U+fe]=Oe,h[U+fe]=U,x[U+fe]=S,E[U+fe]=Ue)}}}function o(u,m,b,l,h,x,E,X){for(var U=m.big_values,j=2;j<T.SBMAX_l+1;j++){var Se=u.scalefac_band.l[j];if(Se>=U)break;var f=h[j-2]+m.count1bits;if(b.part2_3_length<=f)break;var S=new $(f),fe=M(l,Se,U,S);f=S.bits,!(b.part2_3_length<=f)&&(b.assign(m),b.part2_3_length=f,b.region0_count=x[j-2],b.region1_count=j-2-x[j-2],b.table_select[0]=E[j-2],b.table_select[1]=X[j-2],b.table_select[2]=fe)}}this.best_huffman_divide=function(u,m){var b=new Oo,l=m.l3_enc,h=za(7+15+1),x=za(7+15+1),E=za(7+15+1),X=za(7+15+1);if(!(m.block_type==T.SHORT_TYPE&&u.mode_gr==1)){b.assign(m),m.block_type==T.NORM_TYPE&&(K(u,m,l,h,x,E,X),o(u,b,m,l,h,x,E,X));var U=b.big_values;if(!(U==0||(l[U-2]|l[U-1])>1)&&(U=m.count1+2,!(U>576))){b.assign(m),b.count1=U;var j=0,Se=0;for(sn(U<=576);U>b.big_values;U-=4){var f=((l[U-4]*2+l[U-3])*2+l[U-2])*2+l[U-1];j+=bt.t32l[f],Se+=bt.t33l[f]}if(b.big_values=U,b.count1table_select=0,j>Se&&(j=Se,b.count1table_select=1),b.count1bits=j,b.block_type==T.NORM_TYPE)o(u,b,m,l,h,x,E,X);else{if(b.part2_3_length=j,j=u.scalefac_band.l[7+1],j>U&&(j=U),j>0){var S=new $(b.part2_3_length);b.table_select[0]=M(l,0,j,S),b.part2_3_length=S.bits}if(U>j){var S=new $(b.part2_3_length);b.table_select[1]=M(l,j,U,S),b.part2_3_length=S.bits}m.part2_3_length>b.part2_3_length&&m.assign(b)}}}};var I=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],H=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],O=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],g=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];l0.slen1_tab=O,l0.slen2_tab=g;function _(u,m){for(var b,l=m.tt[1][u],h=m.tt[0][u],x=0;x<bt.scfsi_band.length-1;x++){for(b=bt.scfsi_band[x];b<bt.scfsi_band[x+1]&&!(h.scalefac[b]!=l.scalefac[b]&&l.scalefac[b]>=0);b++);if(b==bt.scfsi_band[x+1]){for(b=bt.scfsi_band[x];b<bt.scfsi_band[x+1];b++)l.scalefac[b]=-1;m.scfsi[u][x]=1}}var E=0,X=0;for(b=0;b<11;b++)l.scalefac[b]!=-1&&(X++,E<l.scalefac[b]&&(E=l.scalefac[b]));for(var U=0,j=0;b<T.SBPSY_l;b++)l.scalefac[b]!=-1&&(j++,U<l.scalefac[b]&&(U=l.scalefac[b]));for(var x=0;x<16;x++)if(E<I[x]&&U<H[x]){var Se=O[x]*X+g[x]*j;l.part2_length>Se&&(l.part2_length=Se,l.scalefac_compress=x)}}this.best_scalefac_store=function(u,m,b,l){var h=l.tt[m][b],x,E,X,U,j=0;for(X=0,x=0;x<h.sfbmax;x++){var Se=h.width[x];for(sn(Se>=0),X+=Se,U=-Se;U<0&&h.l3_enc[U+X]==0;U++);U==0&&(h.scalefac[x]=j=-2)}if(h.scalefac_scale==0&&h.preflag==0){var f=0;for(x=0;x<h.sfbmax;x++)h.scalefac[x]>0&&(f|=h.scalefac[x]);if((f&1)==0&&f!=0){for(x=0;x<h.sfbmax;x++)h.scalefac[x]>0&&(h.scalefac[x]>>=1);h.scalefac_scale=j=1}}if(h.preflag==0&&h.block_type!=T.SHORT_TYPE&&u.mode_gr==2){for(x=11;x<T.SBPSY_l&&!(h.scalefac[x]<C.pretab[x]&&h.scalefac[x]!=-2);x++);if(x==T.SBPSY_l){for(x=11;x<T.SBPSY_l;x++)h.scalefac[x]>0&&(h.scalefac[x]-=C.pretab[x]);h.preflag=j=1}}for(E=0;E<4;E++)l.scfsi[b][E]=0;for(u.mode_gr==2&&m==1&&l.tt[0][b].block_type!=T.SHORT_TYPE&&l.tt[1][b].block_type!=T.SHORT_TYPE&&(_(b,l),j=0),x=0;x<h.sfbmax;x++)h.scalefac[x]==-2&&(h.scalefac[x]=0);j!=0&&(u.mode_gr==2?this.scale_bitcount(h):this.scale_bitcount_lsf(u,h))};function k(u,m){for(var b=0;b<m;++b)if(u[b]<0)return!1;return!0}var q=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],w=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],c=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(u){var m,b,l=0,h=0,x,E=u.scalefac;if(sn(k(E,u.sfbmax)),u.block_type==T.SHORT_TYPE)x=q,u.mixed_block_flag!=0&&(x=w);else if(x=c,u.preflag==0){for(b=11;b<T.SBPSY_l&&!(E[b]<C.pretab[b]);b++);if(b==T.SBPSY_l)for(u.preflag=1,b=11;b<T.SBPSY_l;b++)E[b]-=C.pretab[b]}for(b=0;b<u.sfbdivide;b++)l<E[b]&&(l=E[b]);for(;b<u.sfbmax;b++)h<E[b]&&(h=E[b]);for(u.part2_length=ti.LARGE_BITS,m=0;m<16;m++)l<I[m]&&h<H[m]&&u.part2_length>x[m]&&(u.part2_length=x[m],u.scalefac_compress=m);return u.part2_length==ti.LARGE_BITS};var L=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(u,m){var b,l,h,x,E,X,U,j,Se=za(4),f=m.scalefac;for(m.preflag!=0?b=2:b=0,U=0;U<4;U++)Se[U]=0;if(m.block_type==T.SHORT_TYPE){l=1;var S=C.nr_of_sfb_block[b][l];for(j=0,h=0;h<4;h++)for(x=S[h]/3,U=0;U<x;U++,j++)for(E=0;E<3;E++)f[j*3+E]>Se[h]&&(Se[h]=f[j*3+E])}else{l=0;var S=C.nr_of_sfb_block[b][l];for(j=0,h=0;h<4;h++)for(x=S[h],U=0;U<x;U++,j++)f[j]>Se[h]&&(Se[h]=f[j])}for(X=!1,h=0;h<4;h++)Se[h]>L[b][h]&&(X=!0);if(!X){var fe,_e,Oe,Ue;for(m.sfb_partition_table=C.nr_of_sfb_block[b][l],h=0;h<4;h++)m.slen[h]=y[Se[h]];switch(fe=m.slen[0],_e=m.slen[1],Oe=m.slen[2],Ue=m.slen[3],b){case 0:m.scalefac_compress=(fe*5+_e<<4)+(Oe<<2)+Ue;break;case 1:m.scalefac_compress=400+(fe*5+_e<<2)+Oe;break;case 2:m.scalefac_compress=500+fe*3+_e;break;default:ad.err.printf(`intensity stereo not implemented yet
2
- `);break}}if(!X)for(sn(m.sfb_partition_table!=null),m.part2_length=0,h=0;h<4;h++)m.part2_length+=m.slen[h]*m.sfb_partition_table[h];return X};var y=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(u){for(var m=2;m<=576;m+=2){for(var b=0,l;u.scalefac_band.l[++b]<m;);for(l=ie[b][0];u.scalefac_band.l[l+1]>m;)l--;for(l<0&&(l=ie[b][0]),u.bv_scf[m-2]=l,l=ie[b][1];u.scalefac_band.l[l+u.bv_scf[m-2]+2]>m;)l--;l<0&&(l=ie[b][1]),u.bv_scf[m-1]=l}}}var c0=l0,Dn=P.System,sd=P.Arrays,ld=P.new_byte,cd=P.new_float_n,ud=P.new_int,dt=P.assert;Vo.EQ=function(C,$){return Math.abs(C)>Math.abs($)?Math.abs(C-$)<=Math.abs(C)*1e-6:Math.abs(C-$)<=Math.abs($)*1e-6},Vo.NEQ=function(C,$){return!Vo.EQ(C,$)};function Vo(){var C=this,$=32773,ie=32,Z=null,ye=null,Q=null,me=null;this.setModules=function(y,u,m,b){Z=y,ye=u,Q=m,me=b};var Ne=null,ke=0,G=0,de=0;this.getframebits=function(y){var u=y.internal_flags,m;u.bitrate_index!=0?m=bt.bitrate_table[y.version][u.bitrate_index]:m=y.brate,dt(8<=m&&m<=640);var b=0|(y.version+1)*72e3*m/y.out_samplerate+u.padding;return 8*b};function he(y){Dn.arraycopy(y.header[y.w_ptr].buf,0,Ne,G,y.sideinfo_len),G+=y.sideinfo_len,ke+=y.sideinfo_len*8,y.w_ptr=y.w_ptr+1&Bt.MAX_HEADER_BUF-1}function M(y,u,m){for(dt(m<ie-2);m>0;){var b;de==0&&(de=8,G++,dt(G<At.LAME_MAXMP3BUFFER),dt(y.header[y.w_ptr].write_timing>=ke),y.header[y.w_ptr].write_timing==ke&&he(y),Ne[G]=0),b=Math.min(m,de),m-=b,de-=b,dt(m<ie),dt(de<ie),Ne[G]|=u>>m<<de,ke+=b}}function K(y,u,m){for(dt(m<ie-2);m>0;){var b;de==0&&(de=8,G++,dt(G<At.LAME_MAXMP3BUFFER),Ne[G]=0),b=Math.min(m,de),m-=b,de-=b,dt(m<ie),dt(de<ie),Ne[G]|=u>>m<<de,ke+=b}}function o(y,u){var m=y.internal_flags,b;if(dt(u>=0),u>=8&&(M(m,76,8),u-=8),u>=8&&(M(m,65,8),u-=8),u>=8&&(M(m,77,8),u-=8),u>=8&&(M(m,69,8),u-=8),u>=32){var l=Q.getLameShortVersion();if(u>=32)for(b=0;b<l.length&&u>=8;++b)u-=8,M(m,l.charAt(b),8)}for(;u>=1;u-=1)M(m,m.ancillary_flag,1),m.ancillary_flag^=y.disable_reservoir?0:1;dt(u==0)}function I(y,u,m){for(var b=y.header[y.h_ptr].ptr;m>0;){var l=Math.min(m,8-(b&7));m-=l,dt(m<ie),y.header[y.h_ptr].buf[b>>3]|=u>>m<<8-(b&7)-l,b+=l}y.header[y.h_ptr].ptr=b}function H(y,u){y<<=8;for(var m=0;m<8;m++)y<<=1,u<<=1,((u^y)&65536)!=0&&(u^=$);return u}this.CRC_writeheader=function(y,u){var m=65535;m=H(u[2]&255,m),m=H(u[3]&255,m);for(var b=6;b<y.sideinfo_len;b++)m=H(u[b]&255,m);u[4]=byte(m>>8),u[5]=byte(m&255)};function O(y,u){var m=y.internal_flags,b,l,h;if(b=m.l3_side,m.header[m.h_ptr].ptr=0,sd.fill(m.header[m.h_ptr].buf,0,m.sideinfo_len,0),y.out_samplerate<16e3?I(m,4094,12):I(m,4095,12),I(m,y.version,1),I(m,4-3,2),I(m,y.error_protection?0:1,1),I(m,m.bitrate_index,4),I(m,m.samplerate_index,2),I(m,m.padding,1),I(m,y.extension,1),I(m,y.mode.ordinal(),2),I(m,m.mode_ext,2),I(m,y.copyright,1),I(m,y.original,1),I(m,y.emphasis,2),y.error_protection&&I(m,0,16),y.version==1){for(dt(b.main_data_begin>=0),I(m,b.main_data_begin,9),m.channels_out==2?I(m,b.private_bits,3):I(m,b.private_bits,5),h=0;h<m.channels_out;h++){var x;for(x=0;x<4;x++)I(m,b.scfsi[h][x],1)}for(l=0;l<2;l++)for(h=0;h<m.channels_out;h++){var E=b.tt[l][h];I(m,E.part2_3_length+E.part2_length,12),I(m,E.big_values/2,9),I(m,E.global_gain,8),I(m,E.scalefac_compress,4),E.block_type!=T.NORM_TYPE?(I(m,1,1),I(m,E.block_type,2),I(m,E.mixed_block_flag,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),I(m,E.subblock_gain[0],3),I(m,E.subblock_gain[1],3),I(m,E.subblock_gain[2],3)):(I(m,0,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),E.table_select[2]==14&&(E.table_select[2]=16),I(m,E.table_select[2],5),dt(0<=E.region0_count&&E.region0_count<16),dt(0<=E.region1_count&&E.region1_count<8),I(m,E.region0_count,4),I(m,E.region1_count,3)),I(m,E.preflag,1),I(m,E.scalefac_scale,1),I(m,E.count1table_select,1)}}else for(dt(b.main_data_begin>=0),I(m,b.main_data_begin,8),I(m,b.private_bits,m.channels_out),l=0,h=0;h<m.channels_out;h++){var E=b.tt[l][h];I(m,E.part2_3_length+E.part2_length,12),I(m,E.big_values/2,9),I(m,E.global_gain,8),I(m,E.scalefac_compress,9),E.block_type!=T.NORM_TYPE?(I(m,1,1),I(m,E.block_type,2),I(m,E.mixed_block_flag,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),I(m,E.subblock_gain[0],3),I(m,E.subblock_gain[1],3),I(m,E.subblock_gain[2],3)):(I(m,0,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),E.table_select[2]==14&&(E.table_select[2]=16),I(m,E.table_select[2],5),dt(0<=E.region0_count&&E.region0_count<16),dt(0<=E.region1_count&&E.region1_count<8),I(m,E.region0_count,4),I(m,E.region1_count,3)),I(m,E.scalefac_scale,1),I(m,E.count1table_select,1)}y.error_protection&&CRC_writeheader(m,m.header[m.h_ptr].buf);{var X=m.h_ptr;dt(m.header[X].ptr==m.sideinfo_len*8),m.h_ptr=X+1&Bt.MAX_HEADER_BUF-1,m.header[m.h_ptr].write_timing=m.header[X].write_timing+u,m.h_ptr==m.w_ptr&&Dn.err.println(`Error: MAX_HEADER_BUF too small in bitstream.c
3
- `)}}function g(y,u){var m=bt.ht[u.count1table_select+32],b,l=0,h=u.big_values,x=u.big_values;for(dt(u.count1table_select<2),b=(u.count1-u.big_values)/4;b>0;--b){var E=0,X=0,U;U=u.l3_enc[h+0],U!=0&&(X+=8,u.xr[x+0]<0&&E++,dt(U<=1)),U=u.l3_enc[h+1],U!=0&&(X+=4,E*=2,u.xr[x+1]<0&&E++,dt(U<=1)),U=u.l3_enc[h+2],U!=0&&(X+=2,E*=2,u.xr[x+2]<0&&E++,dt(U<=1)),U=u.l3_enc[h+3],U!=0&&(X++,E*=2,u.xr[x+3]<0&&E++,dt(U<=1)),h+=4,x+=4,M(y,E+m.table[X],m.hlen[X]),l+=m.hlen[X]}return l}function _(y,u,m,b,l){var h=bt.ht[u],x=0;if(dt(u<32),u==0)return x;for(var E=m;E<b;E+=2){var X=0,U=0,j=h.xlen,Se=h.xlen,f=0,S=l.l3_enc[E],fe=l.l3_enc[E+1];if(S!=0&&(l.xr[E]<0&&f++,X--),u>15){if(S>14){var _e=S-15;dt(_e<=h.linmax),f|=_e<<1,U=j,S=15}if(fe>14){var Oe=fe-15;dt(Oe<=h.linmax),f<<=j,f|=Oe,U+=j,fe=15}Se=16}fe!=0&&(f<<=1,l.xr[E+1]<0&&f++,X--),dt((S|fe)<16),S=S*Se+fe,U-=X,X+=h.hlen[S],dt(X<=ie),dt(U<=ie),M(y,h.table[S],X),M(y,f,U),x+=X+U}return x}function k(y,u){var m=3*y.scalefac_band.s[3];m>u.big_values&&(m=u.big_values);var b=_(y,u.table_select[0],0,m,u);return b+=_(y,u.table_select[1],m,u.big_values,u),b}function q(y,u){var m,b,l,h;m=u.big_values,dt(0<=m&&m<=576);var x=u.region0_count+1;return dt(0<=x),dt(x<y.scalefac_band.l.length),l=y.scalefac_band.l[x],x+=u.region1_count+1,dt(0<=x),dt(x<y.scalefac_band.l.length),h=y.scalefac_band.l[x],l>m&&(l=m),h>m&&(h=m),b=_(y,u.table_select[0],0,l,u),b+=_(y,u.table_select[1],l,h,u),b+=_(y,u.table_select[2],h,m,u),b}function w(y){var u,m,b,l,h=0,x=y.internal_flags,E=x.l3_side;if(y.version==1)for(u=0;u<2;u++)for(m=0;m<x.channels_out;m++){var X=E.tt[u][m],U=c0.slen1_tab[X.scalefac_compress],j=c0.slen2_tab[X.scalefac_compress];for(l=0,b=0;b<X.sfbdivide;b++)X.scalefac[b]!=-1&&(M(x,X.scalefac[b],U),l+=U);for(;b<X.sfbmax;b++)X.scalefac[b]!=-1&&(M(x,X.scalefac[b],j),l+=j);dt(l==X.part2_length),X.block_type==T.SHORT_TYPE?l+=k(x,X):l+=q(x,X),l+=g(x,X),dt(l==X.part2_3_length+X.part2_length),h+=l}else for(u=0,m=0;m<x.channels_out;m++){var X=E.tt[u][m],Se,f,S=0;if(dt(X.sfb_partition_table!=null),l=0,b=0,f=0,X.block_type==T.SHORT_TYPE){for(;f<4;f++){var fe=X.sfb_partition_table[f]/3,_e=X.slen[f];for(Se=0;Se<fe;Se++,b++)M(x,Math.max(X.scalefac[b*3+0],0),_e),M(x,Math.max(X.scalefac[b*3+1],0),_e),M(x,Math.max(X.scalefac[b*3+2],0),_e),S+=3*_e}l+=k(x,X)}else{for(;f<4;f++){var fe=X.sfb_partition_table[f],_e=X.slen[f];for(Se=0;Se<fe;Se++,b++)M(x,Math.max(X.scalefac[b],0),_e),S+=_e}l+=q(x,X)}l+=g(x,X),dt(l==X.part2_3_length),dt(S==X.part2_length),h+=S+l}return h}function c(){this.total=0}function L(y,u){var m=y.internal_flags,b,l,h,x,E;return E=m.w_ptr,x=m.h_ptr-1,x==-1&&(x=Bt.MAX_HEADER_BUF-1),b=m.header[x].write_timing-ke,u.total=b,b>=0&&(l=1+x-E,x<E&&(l=1+x-E+Bt.MAX_HEADER_BUF),b-=l*8*m.sideinfo_len),h=C.getframebits(y),b+=h,u.total+=h,u.total%8!=0?u.total=1+u.total/8:u.total=u.total/8,u.total+=G+1,b<0&&Dn.err.println(`strange error flushing buffer ...
4
- `),b}this.flush_bitstream=function(y){var u=y.internal_flags,m,b,l=u.h_ptr-1;if(l==-1&&(l=Bt.MAX_HEADER_BUF-1),m=u.l3_side,!((b=L(y,new c))<0)){if(o(y,b),dt(u.header[l].write_timing+this.getframebits(y)==ke),u.ResvSize=0,m.main_data_begin=0,u.findReplayGain){var h=Z.GetTitleGain(u.rgdata);dt(NEQ(h,Xa.GAIN_NOT_ENOUGH_SAMPLES)),u.RadioGain=Math.floor(h*10+.5)|0}u.findPeakSample&&(u.noclipGainChange=Math.ceil(Math.log10(u.PeakSample/32767)*20*10)|0,u.noclipGainChange>0&&(EQ(y.scale,1)||EQ(y.scale,0))?u.noclipScale=Math.floor(32767/u.PeakSample*100)/100:u.noclipScale=-1)}},this.add_dummy_byte=function(y,u,m){for(var b=y.internal_flags,l;m-- >0;)for(K(b,u,8),l=0;l<Bt.MAX_HEADER_BUF;++l)b.header[l].write_timing+=8},this.format_bitstream=function(y){var u=y.internal_flags,m;m=u.l3_side;var b=this.getframebits(y);o(y,m.resvDrain_pre),O(y,b);var l=8*u.sideinfo_len;if(l+=w(y),o(y,m.resvDrain_post),l+=m.resvDrain_post,m.main_data_begin+=(b-l)/8,L(y,new c)!=u.ResvSize&&Dn.err.println("Internal buffer inconsistency. flushbits <> ResvSize"),m.main_data_begin*8!=u.ResvSize&&(Dn.err.printf(`bit reservoir error:
1
+ "use strict";(()=>{var Cm=Object.create;var xu=Object.defineProperty;var Im=Object.getOwnPropertyDescriptor;var Mm=Object.getOwnPropertyNames;var Pm=Object.getPrototypeOf,Bm=Object.prototype.hasOwnProperty;var G0=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var km=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Mm(e))!Bm.call(t,i)&&i!==r&&xu(t,i,{get:()=>e[i],enumerable:!(n=Im(e,i))||n.enumerable});return t};var wu=(t,e,r)=>(r=t!=null?Cm(Pm(t)):{},km(e||!t||!t.__esModule?xu(r,"default",{value:t,enumerable:!0}):r,t));var Mu=G0((Ep,vo)=>{"use strict";function ft(t,e){if(!t)throw"First parameter is required.";e=e||{type:"video"},e=new Ru(t,e);var r=this;function n(z){return e.disableLogs||console.log("RecordRTC version: ",r.version),z&&(e=new Ru(t,z)),e.disableLogs||console.log("started recording "+e.type+" stream."),x?(x.clearRecordedData(),x.record(),k("recording"),r.recordingDuration&&w(),r):(i(function(){r.recordingDuration&&w()}),r)}function i(z){z&&(e.initCallback=function(){z(),z=e.initCallback=null});var U=new Dm(t,e);x=new U(t,e),x.record(),k("recording"),e.disableLogs||console.log("Initialized recorderType:",x.constructor.name,"for output-type:",e.type)}function a(z){if(z=z||function(){},!x){V();return}if(r.state==="paused"){r.resumeRecording(),setTimeout(function(){a(z)},1);return}r.state!=="recording"&&!e.disableLogs&&console.warn('Recording state should be: "recording", however current state is: ',r.state),e.disableLogs||console.log("Stopped recording "+e.type+" stream."),e.type!=="gif"?x.stop(U):(x.stop(),U()),k("stopped");function U(J){if(!x){typeof z.call=="function"?z.call(r,""):z("");return}Object.keys(x).forEach(function(Ce){typeof x[Ce]!="function"&&(r[Ce]=x[Ce])});var Z=x.blob;if(!Z)if(J)x.blob=Z=J;else throw"Recording failed.";if(Z&&!e.disableLogs&&console.log(Z.type,"->",$0(Z.size)),z){var se;try{se=Cr.createObjectURL(Z)}catch{}typeof z.call=="function"?z.call(r,se):z(se)}!e.autoWriteToDisk||d(function(Ce){var Ee={};Ee[e.type+"Blob"]=Ce,Xn.Store(Ee)})}}function o(){if(!x){V();return}if(r.state!=="recording"){e.disableLogs||console.warn("Unable to pause the recording. Recording state: ",r.state);return}k("paused"),x.pause(),e.disableLogs||console.log("Paused recording.")}function l(){if(!x){V();return}if(r.state!=="paused"){e.disableLogs||console.warn("Unable to resume the recording. Recording state: ",r.state);return}k("recording"),x.resume(),e.disableLogs||console.log("Resumed recording.")}function c(z){postMessage(new FileReaderSync().readAsDataURL(z))}function d(z,U){if(!z)throw"Pass a callback function over getDataURL.";var J=U?U.blob:(x||{}).blob;if(!J){e.disableLogs||console.warn("Blob encoder did not finish its job yet."),setTimeout(function(){d(z,U)},1e3);return}if(typeof Worker<"u"&&!navigator.mozGetUserMedia){var Z=Ce(c);Z.onmessage=function(Ee){z(Ee.data)},Z.postMessage(J)}else{var se=new FileReader;se.readAsDataURL(J),se.onload=function(Ee){z(Ee.target.result)}}function Ce(Ee){try{var rt=Cr.createObjectURL(new Blob([Ee.toString(),"this.onmessage = function (eee) {"+Ee.name+"(eee.data);}"],{type:"application/javascript"})),tt=new Worker(rt);return Cr.revokeObjectURL(rt),tt}catch{}}}function w(z){if(z=z||0,r.state==="paused"){setTimeout(function(){w(z)},1e3);return}if(r.state!=="stopped"){if(z>=r.recordingDuration){a(r.onRecordingStopped);return}z+=1e3,setTimeout(function(){w(z)},1e3)}}function k(z){!r||(r.state=z,typeof r.onStateChanged.call=="function"?r.onStateChanged.call(r,z):r.onStateChanged(z))}var H='It seems that recorder is destroyed or "startRecording" is not invoked for '+e.type+" recorder.";function V(){e.disableLogs!==!0&&console.warn(H)}var x,K={startRecording:n,stopRecording:a,pauseRecording:o,resumeRecording:l,initRecorder:i,setRecordingDuration:function(z,U){if(typeof z>"u")throw"recordingDuration is required.";if(typeof z!="number")throw"recordingDuration must be a number.";return r.recordingDuration=z,r.onRecordingStopped=U||function(){},{onRecordingStopped:function(J){r.onRecordingStopped=J}}},clearRecordedData:function(){if(!x){V();return}x.clearRecordedData(),e.disableLogs||console.log("Cleared old recorded data.")},getBlob:function(){if(!x){V();return}return x.blob},getDataURL:d,toURL:function(){if(!x){V();return}return Cr.createObjectURL(x.blob)},getInternalRecorder:function(){return x},save:function(z){if(!x){V();return}Eu(x.blob,z)},getFromDisk:function(z){if(!x){V();return}ft.getFromDisk(e.type,z)},setAdvertisementArray:function(z){e.advertisement=[];for(var U=z.length,J=0;J<U;J++)e.advertisement.push({duration:J,image:z[J]})},blob:null,bufferSize:0,sampleRate:0,buffer:null,reset:function(){r.state==="recording"&&!e.disableLogs&&console.warn("Stop an active recorder."),x&&typeof x.clearRecordedData=="function"&&x.clearRecordedData(),x=null,k("inactive"),r.blob=null},onStateChanged:function(z){e.disableLogs||console.log("Recorder state changed:",z)},state:"inactive",getState:function(){return r.state},destroy:function(){var z=e.disableLogs;e={disableLogs:!0},r.reset(),k("destroyed"),K=r=null,_a.AudioContextConstructor&&(_a.AudioContextConstructor.close(),_a.AudioContextConstructor=null),e.disableLogs=z,e.disableLogs||console.log("RecordRTC is destroyed.")},version:"5.6.2"};if(!this)return r=K,K;for(var E in K)this[E]=K[E];return r=this,K}ft.version="5.6.2";typeof vo<"u"&&(vo.exports=ft);typeof define=="function"&&define.amd&&define("RecordRTC",[],function(){return ft});ft.getFromDisk=function(t,e){if(!e)throw"callback is mandatory.";console.log("Getting recorded "+(t==="all"?"blobs":t+" blob ")+" from disk!"),Xn.Fetch(function(r,n){t!=="all"&&n===t+"Blob"&&e&&e(r),t==="all"&&e&&e(r,n.replace("Blob",""))})};ft.writeToDisk=function(t){console.log("Writing recorded blob(s) to disk!"),t=t||{},t.audio&&t.video&&t.gif?t.audio.getDataURL(function(e){t.video.getDataURL(function(r){t.gif.getDataURL(function(n){Xn.Store({audioBlob:e,videoBlob:r,gifBlob:n})})})}):t.audio&&t.video?t.audio.getDataURL(function(e){t.video.getDataURL(function(r){Xn.Store({audioBlob:e,videoBlob:r})})}):t.audio&&t.gif?t.audio.getDataURL(function(e){t.gif.getDataURL(function(r){Xn.Store({audioBlob:e,gifBlob:r})})}):t.video&&t.gif?t.video.getDataURL(function(e){t.gif.getDataURL(function(r){Xn.Store({videoBlob:e,gifBlob:r})})}):t.audio?t.audio.getDataURL(function(e){Xn.Store({audioBlob:e})}):t.video?t.video.getDataURL(function(e){Xn.Store({videoBlob:e})}):t.gif&&t.gif.getDataURL(function(e){Xn.Store({gifBlob:e})})};function Ru(t,e){return!e.recorderType&&!e.type&&(!!e.audio&&!!e.video?e.type="video":!!e.audio&&!e.video&&(e.type="audio")),e.recorderType&&!e.type&&(e.recorderType===ps||e.recorderType===ms||typeof mo<"u"&&e.recorderType===mo?e.type="video":e.recorderType===vs?e.type="gif":e.recorderType===hs?e.type="audio":e.recorderType===vn&&(hr(t,"audio").length&&hr(t,"video").length||!hr(t,"audio").length&&hr(t,"video").length?e.type="video":hr(t,"audio").length&&!hr(t,"video").length&&(e.type="audio"))),typeof vn<"u"&&typeof MediaRecorder<"u"&&"requestData"in MediaRecorder.prototype&&(e.mimeType||(e.mimeType="video/webm"),e.type||(e.type=e.mimeType.split("/")[0]),e.bitsPerSecond),e.type||(e.mimeType&&(e.type=e.mimeType.split("/")[0]),e.type||(e.type="audio")),e}function Dm(t,e){var r;return(_i||Y0||ds)&&(r=hs),typeof MediaRecorder<"u"&&"requestData"in MediaRecorder.prototype&&!_i&&(r=vn),e.type==="video"&&(_i||ds)&&(r=ps,typeof mo<"u"&&typeof ReadableStream<"u"&&(r=mo)),e.type==="gif"&&(r=vs),e.type==="canvas"&&(r=ms),Gi()&&r!==ms&&r!==vs&&typeof MediaRecorder<"u"&&"requestData"in MediaRecorder.prototype&&(hr(t,"video").length||hr(t,"audio").length)&&(e.type==="audio"?typeof MediaRecorder.isTypeSupported=="function"&&MediaRecorder.isTypeSupported("audio/webm")&&(r=vn):typeof MediaRecorder.isTypeSupported=="function"&&MediaRecorder.isTypeSupported("video/webm")&&(r=vn)),t instanceof Array&&t.length&&(r=Iu),e.recorderType&&(r=e.recorderType),!e.disableLogs&&!!r&&!!r.name&&console.log("Using recorderType:",r.name||r.constructor.name),!r&&fs&&(r=vn),r}function K0(t){this.addStream=function(e){e&&(t=e)},this.mediaType={audio:!0,video:!0},this.startRecording=function(){var e=this.mediaType,r,n=this.mimeType||{audio:null,video:null,gif:null};if(typeof e.audio!="function"&&Gi()&&!hr(t,"audio").length&&(e.audio=!1),typeof e.video!="function"&&Gi()&&!hr(t,"video").length&&(e.video=!1),typeof e.gif!="function"&&Gi()&&!hr(t,"video").length&&(e.gif=!1),!e.audio&&!e.video&&!e.gif)throw"MediaStream must have either audio or video tracks.";if(e.audio&&(r=null,typeof e.audio=="function"&&(r=e.audio),this.audioRecorder=new ft(t,{type:"audio",bufferSize:this.bufferSize,sampleRate:this.sampleRate,numberOfAudioChannels:this.numberOfAudioChannels||2,disableLogs:this.disableLogs,recorderType:r,mimeType:n.audio,timeSlice:this.timeSlice,onTimeStamp:this.onTimeStamp}),e.video||this.audioRecorder.startRecording()),e.video){r=null,typeof e.video=="function"&&(r=e.video);var i=t;if(Gi()&&!!e.audio&&typeof e.audio=="function"){var a=hr(t,"video")[0];Tu?(i=new Wn,i.addTrack(a),r&&r===ps&&(r=vn)):(i=new Wn,i.addTrack(a))}this.videoRecorder=new ft(i,{type:"video",video:this.video,canvas:this.canvas,frameInterval:this.frameInterval||10,disableLogs:this.disableLogs,recorderType:r,mimeType:n.video,timeSlice:this.timeSlice,onTimeStamp:this.onTimeStamp,workerPath:this.workerPath,webAssemblyPath:this.webAssemblyPath,frameRate:this.frameRate,bitrate:this.bitrate}),e.audio||this.videoRecorder.startRecording()}if(!!e.audio&&!!e.video){var o=this,l=Gi()===!0;(e.audio instanceof hs&&!!e.video||e.audio!==!0&&e.video!==!0&&e.audio!==e.video)&&(l=!1),l===!0?(o.audioRecorder=null,o.videoRecorder.startRecording()):o.videoRecorder.initRecorder(function(){o.audioRecorder.initRecorder(function(){o.videoRecorder.startRecording(),o.audioRecorder.startRecording()})})}e.gif&&(r=null,typeof e.gif=="function"&&(r=e.gif),this.gifRecorder=new ft(t,{type:"gif",frameRate:this.frameRate||200,quality:this.quality||10,disableLogs:this.disableLogs,recorderType:r,mimeType:n.gif}),this.gifRecorder.startRecording())},this.stopRecording=function(e){e=e||function(){},this.audioRecorder&&this.audioRecorder.stopRecording(function(r){e(r,"audio")}),this.videoRecorder&&this.videoRecorder.stopRecording(function(r){e(r,"video")}),this.gifRecorder&&this.gifRecorder.stopRecording(function(r){e(r,"gif")})},this.pauseRecording=function(){this.audioRecorder&&this.audioRecorder.pauseRecording(),this.videoRecorder&&this.videoRecorder.pauseRecording(),this.gifRecorder&&this.gifRecorder.pauseRecording()},this.resumeRecording=function(){this.audioRecorder&&this.audioRecorder.resumeRecording(),this.videoRecorder&&this.videoRecorder.resumeRecording(),this.gifRecorder&&this.gifRecorder.resumeRecording()},this.getBlob=function(e){var r={};return this.audioRecorder&&(r.audio=this.audioRecorder.getBlob()),this.videoRecorder&&(r.video=this.videoRecorder.getBlob()),this.gifRecorder&&(r.gif=this.gifRecorder.getBlob()),e&&e(r),r},this.destroy=function(){this.audioRecorder&&(this.audioRecorder.destroy(),this.audioRecorder=null),this.videoRecorder&&(this.videoRecorder.destroy(),this.videoRecorder=null),this.gifRecorder&&(this.gifRecorder.destroy(),this.gifRecorder=null)},this.getDataURL=function(e){this.getBlob(function(i){i.audio&&i.video?r(i.audio,function(a){r(i.video,function(o){e({audio:a,video:o})})}):i.audio?r(i.audio,function(a){e({audio:a})}):i.video&&r(i.video,function(a){e({video:a})})});function r(i,a){if(typeof Worker<"u"){var o=n(function(d){postMessage(new FileReaderSync().readAsDataURL(d))});o.onmessage=function(c){a(c.data)},o.postMessage(i)}else{var l=new FileReader;l.readAsDataURL(i),l.onload=function(c){a(c.target.result)}}}function n(i){var a=Cr.createObjectURL(new Blob([i.toString(),"this.onmessage = function (eee) {"+i.name+"(eee.data);}"],{type:"application/javascript"})),o=new Worker(a),l;if(typeof Cr<"u")l=Cr;else if(typeof webkitURL<"u")l=webkitURL;else throw"Neither URL nor webkitURL detected.";return l.revokeObjectURL(a),o}},this.writeToDisk=function(){ft.writeToDisk({audio:this.audioRecorder,video:this.videoRecorder,gif:this.gifRecorder})},this.save=function(e){e=e||{audio:!0,video:!0,gif:!0},!!e.audio&&this.audioRecorder&&this.audioRecorder.save(typeof e.audio=="string"?e.audio:""),!!e.video&&this.videoRecorder&&this.videoRecorder.save(typeof e.video=="string"?e.video:""),!!e.gif&&this.gifRecorder&&this.gifRecorder.save(typeof e.gif=="string"?e.gif:"")}}K0.getFromDisk=ft.getFromDisk;K0.writeToDisk=ft.writeToDisk;typeof ft<"u"&&(ft.MRecordRTC=K0);var Lm="Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45";(function(t){!t||typeof window<"u"||typeof global>"u"||(global.navigator={userAgent:Lm,getUserMedia:function(){}},global.console||(global.console={}),(typeof global.console.log>"u"||typeof global.console.error>"u")&&(global.console.error=global.console.log=global.console.log||function(){console.log(arguments)}),typeof document>"u"&&(t.document={documentElement:{appendChild:function(){return""}}},document.createElement=document.captureStream=document.mozCaptureStream=function(){var e={getContext:function(){return e},play:function(){},pause:function(){},drawImage:function(){},toDataURL:function(){return""},style:{}};return e},t.HTMLVideoElement=function(){}),typeof location>"u"&&(t.location={protocol:"file:",href:"",hash:""}),typeof screen>"u"&&(t.screen={width:0,height:0}),typeof Cr>"u"&&(t.URL={createObjectURL:function(){return""},revokeObjectURL:function(){return""}}),t.window=global)})(typeof global<"u"?global:null);var pi=window.requestAnimationFrame;typeof pi>"u"&&(typeof webkitRequestAnimationFrame<"u"?pi=webkitRequestAnimationFrame:typeof mozRequestAnimationFrame<"u"?pi=mozRequestAnimationFrame:typeof msRequestAnimationFrame<"u"?pi=msRequestAnimationFrame:typeof pi>"u"&&(X0=0,pi=function(t,e){var r=new Date().getTime(),n=Math.max(0,16-(r-X0)),i=setTimeout(function(){t(r+n)},n);return X0=r+n,i}));var X0,ji=window.cancelAnimationFrame;typeof ji>"u"&&(typeof webkitCancelAnimationFrame<"u"?ji=webkitCancelAnimationFrame:typeof mozCancelAnimationFrame<"u"?ji=mozCancelAnimationFrame:typeof msCancelAnimationFrame<"u"?ji=msCancelAnimationFrame:typeof ji>"u"&&(ji=function(t){clearTimeout(t)}));var fo=window.AudioContext;typeof fo>"u"&&(typeof webkitAudioContext<"u"&&(fo=webkitAudioContext),typeof mozAudioContext<"u"&&(fo=mozAudioContext));var Cr=window.URL;typeof Cr>"u"&&typeof webkitURL<"u"&&(Cr=webkitURL);typeof navigator<"u"&&typeof navigator.getUserMedia>"u"&&(typeof navigator.webkitGetUserMedia<"u"&&(navigator.getUserMedia=navigator.webkitGetUserMedia),typeof navigator.mozGetUserMedia<"u"&&(navigator.getUserMedia=navigator.mozGetUserMedia));var Y0=navigator.userAgent.indexOf("Edge")!==-1&&(!!navigator.msSaveBlob||!!navigator.msSaveOrOpenBlob),ds=!!window.opera||navigator.userAgent.indexOf("OPR/")!==-1,Tu=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&"netscape"in window&&/ rv:/.test(navigator.userAgent),_i=!ds&&!Y0&&!!navigator.webkitGetUserMedia||Au()||navigator.userAgent.toLowerCase().indexOf("chrome/")!==-1,fs=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);fs&&!_i&&navigator.userAgent.indexOf("CriOS")!==-1&&(fs=!1,_i=!0);var Wn=window.MediaStream;typeof Wn>"u"&&typeof webkitMediaStream<"u"&&(Wn=webkitMediaStream);typeof Wn<"u"&&typeof Wn.prototype.stop>"u"&&(Wn.prototype.stop=function(){this.getTracks().forEach(function(t){t.stop()})});function $0(t){var e=1e3,r=["Bytes","KB","MB","GB","TB"];if(t===0)return"0 Bytes";var n=parseInt(Math.floor(Math.log(t)/Math.log(e)),10);return(t/Math.pow(e,n)).toPrecision(3)+" "+r[n]}function Eu(t,e){if(!t)throw"Blob object is required.";if(!t.type)try{t.type="video/webm"}catch{}var r=(t.type||"video/webm").split("/")[1];if(r.indexOf(";")!==-1&&(r=r.split(";")[0]),e&&e.indexOf(".")!==-1){var n=e.split(".");e=n[0],r=n[1]}var i=(e||Math.round(Math.random()*9999999999)+888888888)+"."+r;if(typeof navigator.msSaveOrOpenBlob<"u")return navigator.msSaveOrOpenBlob(t,i);if(typeof navigator.msSaveBlob<"u")return navigator.msSaveBlob(t,i);var a=document.createElement("a");a.href=Cr.createObjectURL(t),a.download=i,a.style="display:none;opacity:0;color:transparent;",(document.body||document.documentElement).appendChild(a),typeof a.click=="function"?a.click():(a.target="_blank",a.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))),Cr.revokeObjectURL(a.href)}function Au(){return typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&!!process.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0}function hr(t,e){return!t||!t.getTracks?[]:t.getTracks().filter(function(r){return r.kind===(e||"audio")})}function Cu(t,e){"srcObject"in e?e.srcObject=t:"mozSrcObject"in e?e.mozSrcObject=t:e.srcObject=t}function Nm(t,e){if(typeof EBML>"u")throw new Error("Please link: https://www.webrtc-experiment.com/EBML.js");var r=new EBML.Reader,n=new EBML.Decoder,i=EBML.tools,a=new FileReader;a.onload=function(o){var l=n.decode(this.result);l.forEach(function(k){r.read(k)}),r.stop();var c=i.makeMetadataSeekable(r.metadatas,r.duration,r.cues),d=this.result.slice(r.metadataSize),w=new Blob([c,d],{type:"video/webm"});e(w)},a.readAsArrayBuffer(t)}typeof ft<"u"&&(ft.invokeSaveAsDialog=Eu,ft.getTracks=hr,ft.getSeekableBlob=Nm,ft.bytesToSize=$0,ft.isElectron=Au);var _a={};typeof fo<"u"?_a.AudioContext=fo:typeof webkitAudioContext<"u"&&(_a.AudioContext=webkitAudioContext);typeof ft<"u"&&(ft.Storage=_a);function Gi(){if(Tu||fs||Y0)return!0;var t=navigator.appVersion,e=navigator.userAgent,r=""+parseFloat(navigator.appVersion),n=parseInt(navigator.appVersion,10),i,a,o;return(_i||ds)&&(a=e.indexOf("Chrome"),r=e.substring(a+7)),(o=r.indexOf(";"))!==-1&&(r=r.substring(0,o)),(o=r.indexOf(" "))!==-1&&(r=r.substring(0,o)),n=parseInt(""+r,10),isNaN(n)&&(r=""+parseFloat(navigator.appVersion),n=parseInt(navigator.appVersion,10)),n>=49}function vn(t,e){var w=this;if(typeof t>"u")throw'First argument "MediaStream" is required.';if(typeof MediaRecorder>"u")throw"Your browser does not support the Media Recorder API. Please try other modules e.g. WhammyRecorder or StereoAudioRecorder.";if(e=e||{mimeType:"video/webm"},e.type==="audio"){if(hr(t,"video").length&&hr(t,"audio").length){var r;navigator.mozGetUserMedia?(r=new Wn,r.addTrack(hr(t,"audio")[0])):r=new Wn(hr(t,"audio")),t=r}(!e.mimeType||e.mimeType.toString().toLowerCase().indexOf("audio")===-1)&&(e.mimeType=_i?"audio/webm":"audio/ogg"),e.mimeType&&e.mimeType.toString().toLowerCase()!=="audio/ogg"&&!!navigator.mozGetUserMedia&&(e.mimeType="audio/ogg")}var n=[];this.getArrayOfBlobs=function(){return n},this.record=function(){w.blob=null,w.clearRecordedData(),w.timestamps=[],d=[],n=[];var k=e;e.disableLogs||console.log("Passing following config over MediaRecorder API.",k),l&&(l=null),_i&&!Gi()&&(k="video/vp8"),typeof MediaRecorder.isTypeSupported=="function"&&k.mimeType&&(MediaRecorder.isTypeSupported(k.mimeType)||(e.disableLogs||console.warn("MediaRecorder API seems unable to record mimeType:",k.mimeType),k.mimeType=e.type==="audio"?"audio/webm":"video/webm"));try{l=new MediaRecorder(t,k),e.mimeType=k.mimeType}catch{l=new MediaRecorder(t)}k.mimeType&&!MediaRecorder.isTypeSupported&&"canRecordMimeType"in l&&l.canRecordMimeType(k.mimeType)===!1&&(e.disableLogs||console.warn("MediaRecorder API seems unable to record mimeType:",k.mimeType)),l.ondataavailable=function(H){if(H.data&&d.push("ondataavailable: "+$0(H.data.size)),typeof e.timeSlice=="number"){if(H.data&&H.data.size&&(n.push(H.data),i(),typeof e.ondataavailable=="function")){var V=e.getNativeBlob?H.data:new Blob([H.data],{type:a(k)});e.ondataavailable(V)}return}if(!H.data||!H.data.size||H.data.size<100||w.blob){w.recordingCallback&&(w.recordingCallback(new Blob([],{type:a(k)})),w.recordingCallback=null);return}w.blob=e.getNativeBlob?H.data:new Blob([H.data],{type:a(k)}),w.recordingCallback&&(w.recordingCallback(w.blob),w.recordingCallback=null)},l.onstart=function(){d.push("started")},l.onpause=function(){d.push("paused")},l.onresume=function(){d.push("resumed")},l.onstop=function(){d.push("stopped")},l.onerror=function(H){!H||(H.name||(H.name="UnknownError"),d.push("error: "+H),e.disableLogs||(H.name.toString().toLowerCase().indexOf("invalidstate")!==-1?console.error("The MediaRecorder is not in a state in which the proposed operation is allowed to be executed.",H):H.name.toString().toLowerCase().indexOf("notsupported")!==-1?console.error("MIME type (",k.mimeType,") is not supported.",H):H.name.toString().toLowerCase().indexOf("security")!==-1?console.error("MediaRecorder security error",H):H.name==="OutOfMemory"?console.error("The UA has exhaused the available memory. User agents SHOULD provide as much additional information as possible in the message attribute.",H):H.name==="IllegalStreamModification"?console.error("A modification to the stream has occurred that makes it impossible to continue recording. An example would be the addition of a Track while recording is occurring. User agents SHOULD provide as much additional information as possible in the message attribute.",H):H.name==="OtherRecordingError"?console.error("Used for an fatal error other than those listed above. User agents SHOULD provide as much additional information as possible in the message attribute.",H):H.name==="GenericError"?console.error("The UA cannot provide the codec or recording option that has been requested.",H):console.error("MediaRecorder Error",H)),function(V){if(!w.manuallyStopped&&l&&l.state==="inactive"){delete e.timeslice,l.start(10*60*1e3);return}setTimeout(V,1e3)}(),l.state!=="inactive"&&l.state!=="stopped"&&l.stop())},typeof e.timeSlice=="number"?(i(),l.start(e.timeSlice)):l.start(36e5),e.initCallback&&e.initCallback()},this.timestamps=[];function i(){w.timestamps.push(new Date().getTime()),typeof e.onTimeStamp=="function"&&e.onTimeStamp(w.timestamps[w.timestamps.length-1],w.timestamps)}function a(k){return l&&l.mimeType?l.mimeType:k.mimeType||"video/webm"}this.stop=function(k){k=k||function(){},w.manuallyStopped=!0,l&&(this.recordingCallback=k,l.state==="recording"&&l.stop(),typeof e.timeSlice=="number"&&setTimeout(function(){w.blob=new Blob(n,{type:a(e)}),w.recordingCallback(w.blob)},100))},this.pause=function(){!l||l.state==="recording"&&l.pause()},this.resume=function(){!l||l.state==="paused"&&l.resume()},this.clearRecordedData=function(){l&&l.state==="recording"&&w.stop(o),o()};function o(){n=[],l=null,w.timestamps=[]}var l;this.getInternalRecorder=function(){return l};function c(){if("active"in t){if(!t.active)return!1}else if("ended"in t&&t.ended)return!1;return!0}this.blob=null,this.getState=function(){return l&&l.state||"inactive"};var d=[];this.getAllStates=function(){return d},typeof e.checkForInactiveTracks>"u"&&(e.checkForInactiveTracks=!1);var w=this;(function k(){if(!(!l||e.checkForInactiveTracks===!1)){if(c()===!1){e.disableLogs||console.log("MediaStream seems stopped."),w.stop();return}setTimeout(k,1e3)}})(),this.name="MediaStreamRecorder",this.toString=function(){return this.name}}typeof ft<"u"&&(ft.MediaStreamRecorder=vn);function hs(t,e){if(!hr(t,"audio").length)throw"Your stream has no audio tracks.";e=e||{};var r=this,n=[],i=[],a=!1,o=0,l,c=2,d=e.desiredSampRate;e.leftChannel===!0&&(c=1),e.numberOfAudioChannels===1&&(c=1),(!c||c<1)&&(c=2),e.disableLogs||console.log("StereoAudioRecorder is set to record number of channels: "+c),typeof e.checkForInactiveTracks>"u"&&(e.checkForInactiveTracks=!0);function w(){if(e.checkForInactiveTracks===!1)return!0;if("active"in t){if(!t.active)return!1}else if("ended"in t&&t.ended)return!1;return!0}this.record=function(){if(w()===!1)throw"Please make sure MediaStream is active.";J(),se=U=!1,a=!0,typeof e.timeSlice<"u"&&rt()};function k(tt,Rt){function yt(Pt,Yt){var Vt=Pt.numberOfAudioChannels,Ct=Pt.leftBuffers.slice(0),vt=Pt.rightBuffers.slice(0),Et=Pt.sampleRate,At=Pt.internalInterleavedLength,bt=Pt.desiredSampRate;Vt===2&&(Ct=de(Ct,At),vt=de(vt,At),bt&&(Ct=et(Ct,bt,Et),vt=et(vt,bt,Et))),Vt===1&&(Ct=de(Ct,At),bt&&(Ct=et(Ct,bt,Et))),bt&&(Et=bt);function et(Se,qt,zt){var Ft=Math.round(Se.length*(qt/zt)),ir=[],lr=Number((Se.length-1)/(Ft-1));ir[0]=Se[0];for(var yn=1;yn<Ft-1;yn++){var fa=yn*lr,Un=Number(Math.floor(fa)).toFixed(),C0=Number(Math.ceil(fa)).toFixed(),Jn=fa-Un;ir[yn]=A(Se[Un],Se[C0],Jn)}return ir[Ft-1]=Se[Se.length-1],ir}function A(Se,qt,zt){return Se+(qt-Se)*zt}function de(Se,qt){for(var zt=new Float64Array(qt),Ft=0,ir=Se.length,lr=0;lr<ir;lr++){var yn=Se[lr];zt.set(yn,Ft),Ft+=yn.length}return zt}function Ve(Se,qt){for(var zt=Se.length+qt.length,Ft=new Float64Array(zt),ir=0,lr=0;lr<zt;)Ft[lr++]=Se[ir],Ft[lr++]=qt[ir],ir++;return Ft}function $e(Se,qt,zt){for(var Ft=zt.length,ir=0;ir<Ft;ir++)Se.setUint8(qt+ir,zt.charCodeAt(ir))}var ce;Vt===2&&(ce=Ve(Ct,vt)),Vt===1&&(ce=Ct);var xe=ce.length,ke=44+xe*2,Me=new ArrayBuffer(ke),Te=new DataView(Me);$e(Te,0,"RIFF"),Te.setUint32(4,36+xe*2,!0),$e(Te,8,"WAVE"),$e(Te,12,"fmt "),Te.setUint32(16,16,!0),Te.setUint16(20,1,!0),Te.setUint16(22,Vt,!0),Te.setUint32(24,Et,!0),Te.setUint32(28,Et*Vt*2,!0),Te.setUint16(32,Vt*2,!0),Te.setUint16(34,16,!0),$e(Te,36,"data"),Te.setUint32(40,xe*2,!0);for(var Je=xe,qe=44,ut=1,ht=0;ht<Je;ht++)Te.setInt16(qe,ce[ht]*(32767*ut),!0),qe+=2;if(Yt)return Yt({buffer:Me,view:Te});postMessage({buffer:Me,view:Te})}if(tt.noWorker){yt(tt,function(Pt){Rt(Pt.buffer,Pt.view)});return}var sr=H(yt);sr.onmessage=function(Pt){Rt(Pt.data.buffer,Pt.data.view),Cr.revokeObjectURL(sr.workerURL),sr.terminate()},sr.postMessage(tt)}function H(tt){var Rt=Cr.createObjectURL(new Blob([tt.toString(),";this.onmessage = function (eee) {"+tt.name+"(eee.data);}"],{type:"application/javascript"})),yt=new Worker(Rt);return yt.workerURL=Rt,yt}this.stop=function(tt){tt=tt||function(){},a=!1,k({desiredSampRate:d,sampleRate:z,numberOfAudioChannels:c,internalInterleavedLength:o,leftBuffers:n,rightBuffers:c===1?[]:i,noWorker:e.noWorker},function(Rt,yt){r.blob=new Blob([yt],{type:"audio/wav"}),r.buffer=new ArrayBuffer(yt.buffer.byteLength),r.view=yt,r.sampleRate=d||z,r.bufferSize=E,r.length=o,se=!1,tt&&tt(r.blob)})},typeof ft.Storage>"u"&&(ft.Storage={AudioContextConstructor:null,AudioContext:window.AudioContext||window.webkitAudioContext}),(!ft.Storage.AudioContextConstructor||ft.Storage.AudioContextConstructor.state==="closed")&&(ft.Storage.AudioContextConstructor=new ft.Storage.AudioContext);var V=ft.Storage.AudioContextConstructor,x=V.createMediaStreamSource(t),K=[0,256,512,1024,2048,4096,8192,16384],E=typeof e.bufferSize>"u"?4096:e.bufferSize;if(K.indexOf(E)===-1&&(e.disableLogs||console.log("Legal values for buffer-size are "+JSON.stringify(K,null," "))),V.createJavaScriptNode)l=V.createJavaScriptNode(E,c,c);else if(V.createScriptProcessor)l=V.createScriptProcessor(E,c,c);else throw"WebAudio API has no support on this browser.";x.connect(l),e.bufferSize||(E=l.bufferSize);var z=typeof e.sampleRate<"u"?e.sampleRate:V.sampleRate||44100;(z<22050||z>96e3)&&(e.disableLogs||console.log("sample-rate must be under range 22050 and 96000.")),e.disableLogs||e.desiredSampRate&&console.log("Desired sample-rate: "+e.desiredSampRate);var U=!1;this.pause=function(){U=!0},this.resume=function(){if(w()===!1)throw"Please make sure MediaStream is active.";if(!a){e.disableLogs||console.log("Seems recording has been restarted."),this.record();return}U=!1},this.clearRecordedData=function(){e.checkForInactiveTracks=!1,a&&this.stop(Z),Z()};function J(){n=[],i=[],o=0,se=!1,a=!1,U=!1,V=null,r.leftchannel=n,r.rightchannel=i,r.numberOfAudioChannels=c,r.desiredSampRate=d,r.sampleRate=z,r.recordingLength=o,Ee={left:[],right:[],recordingLength:0}}function Z(){l&&(l.onaudioprocess=null,l.disconnect(),l=null),x&&(x.disconnect(),x=null),J()}this.name="StereoAudioRecorder",this.toString=function(){return this.name};var se=!1;function Ce(tt){if(!U){if(w()===!1&&(e.disableLogs||console.log("MediaStream seems stopped."),l.disconnect(),a=!1),!a){x&&(x.disconnect(),x=null);return}se||(se=!0,e.onAudioProcessStarted&&e.onAudioProcessStarted(),e.initCallback&&e.initCallback());var Rt=tt.inputBuffer.getChannelData(0),yt=new Float32Array(Rt);if(n.push(yt),c===2){var sr=tt.inputBuffer.getChannelData(1),Pt=new Float32Array(sr);i.push(Pt)}o+=E,r.recordingLength=o,typeof e.timeSlice<"u"&&(Ee.recordingLength+=E,Ee.left.push(yt),c===2&&Ee.right.push(Pt))}}l.onaudioprocess=Ce,V.createMediaStreamDestination?l.connect(V.createMediaStreamDestination()):l.connect(V.destination),this.leftchannel=n,this.rightchannel=i,this.numberOfAudioChannels=c,this.desiredSampRate=d,this.sampleRate=z,r.recordingLength=o;var Ee={left:[],right:[],recordingLength:0};function rt(){!a||typeof e.ondataavailable!="function"||typeof e.timeSlice>"u"||(Ee.left.length?(k({desiredSampRate:d,sampleRate:z,numberOfAudioChannels:c,internalInterleavedLength:Ee.recordingLength,leftBuffers:Ee.left,rightBuffers:c===1?[]:Ee.right},function(tt,Rt){var yt=new Blob([Rt],{type:"audio/wav"});e.ondataavailable(yt),setTimeout(rt,e.timeSlice)}),Ee={left:[],right:[],recordingLength:0}):setTimeout(rt,e.timeSlice))}}typeof ft<"u"&&(ft.StereoAudioRecorder=hs);function ms(t,e){if(typeof html2canvas>"u")throw"Please link: https://www.webrtc-experiment.com/screenshot.js";e=e||{},e.frameInterval||(e.frameInterval=10);var r=!1;["captureStream","mozCaptureStream","webkitCaptureStream"].forEach(function(K){K in document.createElement("canvas")&&(r=!0)});var n=(!!window.webkitRTCPeerConnection||!!window.webkitGetUserMedia)&&!!window.chrome,i=50,a=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);n&&a&&a[2]&&(i=parseInt(a[2],10)),n&&i<52&&(r=!1),e.useWhammyRecorder&&(r=!1);var o,l;if(r)if(e.disableLogs||console.log("Your browser supports both MediRecorder API and canvas.captureStream!"),t instanceof HTMLCanvasElement)o=t;else if(t instanceof CanvasRenderingContext2D)o=t.canvas;else throw"Please pass either HTMLCanvasElement or CanvasRenderingContext2D.";else navigator.mozGetUserMedia&&(e.disableLogs||console.error("Canvas recording is NOT supported in Firefox."));var c;this.record=function(){if(c=!0,r&&!e.useWhammyRecorder){var K;"captureStream"in o?K=o.captureStream(25):"mozCaptureStream"in o?K=o.mozCaptureStream(25):"webkitCaptureStream"in o&&(K=o.webkitCaptureStream(25));try{var E=new Wn;E.addTrack(hr(K,"video")[0]),K=E}catch{}if(!K)throw"captureStream API are NOT available.";l=new vn(K,{mimeType:e.mimeType||"video/webm"}),l.record()}else x.frames=[],V=new Date().getTime(),H();e.initCallback&&e.initCallback()},this.getWebPImages=function(K){if(t.nodeName.toLowerCase()!=="canvas"){K();return}var E=x.frames.length;x.frames.forEach(function(z,U){var J=E-U;e.disableLogs||console.log(J+"/"+E+" frames remaining"),e.onEncodingCallback&&e.onEncodingCallback(J,E);var Z=z.image.toDataURL("image/webp",1);x.frames[U].image=Z}),e.disableLogs||console.log("Generating WebM"),K()},this.stop=function(K){c=!1;var E=this;if(r&&l){l.stop(K);return}this.getWebPImages(function(){x.compile(function(z){e.disableLogs||console.log("Recording finished!"),E.blob=z,E.blob.forEach&&(E.blob=new Blob([],{type:"video/webm"})),K&&K(E.blob),x.frames=[]})})};var d=!1;this.pause=function(){if(d=!0,l instanceof vn){l.pause();return}},this.resume=function(){if(d=!1,l instanceof vn){l.resume();return}c||this.record()},this.clearRecordedData=function(){c&&this.stop(w),w()};function w(){x.frames=[],c=!1,d=!1}this.name="CanvasRecorder",this.toString=function(){return this.name};function k(){var K=document.createElement("canvas"),E=K.getContext("2d");return K.width=t.width,K.height=t.height,E.drawImage(t,0,0),K}function H(){if(d)return V=new Date().getTime(),setTimeout(H,500);if(t.nodeName.toLowerCase()==="canvas"){var K=new Date().getTime()-V;V=new Date().getTime(),x.frames.push({image:k(),duration:K}),c&&setTimeout(H,e.frameInterval);return}html2canvas(t,{grabMouse:typeof e.showMousePointer>"u"||e.showMousePointer,onrendered:function(E){var z=new Date().getTime()-V;if(!z)return setTimeout(H,e.frameInterval);V=new Date().getTime(),x.frames.push({image:E.toDataURL("image/webp",1),duration:z}),c&&setTimeout(H,e.frameInterval)}})}var V=new Date().getTime(),x=new Z0.Video(100)}typeof ft<"u"&&(ft.CanvasRecorder=ms);function ps(t,e){e=e||{},e.frameInterval||(e.frameInterval=10),e.disableLogs||console.log("Using frames-interval:",e.frameInterval),this.record=function(){e.width||(e.width=320),e.height||(e.height=240),e.video||(e.video={width:e.width,height:e.height}),e.canvas||(e.canvas={width:e.width,height:e.height}),c.width=e.canvas.width||320,c.height=e.canvas.height||240,d=c.getContext("2d"),e.video&&e.video instanceof HTMLVideoElement?(w=e.video.cloneNode(),e.initCallback&&e.initCallback()):(w=document.createElement("video"),Cu(t,w),w.onloadedmetadata=function(){e.initCallback&&e.initCallback()},w.width=e.video.width,w.height=e.video.height),w.muted=!0,w.play(),k=new Date().getTime(),H=new Z0.Video,e.disableLogs||(console.log("canvas resolutions",c.width,"*",c.height),console.log("video width/height",w.width||c.width,"*",w.height||c.height)),r(e.frameInterval)};function r(V){V=typeof V<"u"?V:10;var x=new Date().getTime()-k;if(!x)return setTimeout(r,V,V);if(o)return k=new Date().getTime(),setTimeout(r,100);k=new Date().getTime(),w.paused&&w.play(),d.drawImage(w,0,0,c.width,c.height),H.frames.push({duration:x,image:c.toDataURL("image/webp")}),a||setTimeout(r,V,V)}function n(V){var x=-1,K=V.length;(function E(){if(x++,x===K){V.callback();return}setTimeout(function(){V.functionToLoop(E,x)},1)})()}function i(V,x,K,E,z){var U=document.createElement("canvas");U.width=c.width,U.height=c.height;var J=U.getContext("2d"),Z=[],se=x===-1,Ce=x&&x>0&&x<=V.length?x:V.length,Ee={r:0,g:0,b:0},rt=Math.sqrt(Math.pow(255,2)+Math.pow(255,2)+Math.pow(255,2)),tt=K&&K>=0&&K<=1?K:0,Rt=E&&E>=0&&E<=1?E:0,yt=!1;n({length:Ce,functionToLoop:function(sr,Pt){var Yt,Vt,Ct,vt=function(){!yt&&Ct-Yt<=Ct*Rt||(se&&(yt=!0),Z.push(V[Pt])),sr()};if(yt)vt();else{var Et=new Image;Et.onload=function(){J.drawImage(Et,0,0,c.width,c.height);var At=J.getImageData(0,0,c.width,c.height);Yt=0,Vt=At.data.length,Ct=At.data.length/4;for(var bt=0;bt<Vt;bt+=4){var et={r:At.data[bt],g:At.data[bt+1],b:At.data[bt+2]},A=Math.sqrt(Math.pow(et.r-Ee.r,2)+Math.pow(et.g-Ee.g,2)+Math.pow(et.b-Ee.b,2));A<=rt*tt&&Yt++}vt()},Et.src=V[Pt].image}},callback:function(){Z=Z.concat(V.slice(Ce)),Z.length<=0&&Z.push(V[V.length-1]),z(Z)}})}var a=!1;this.stop=function(V){V=V||function(){},a=!0;var x=this;setTimeout(function(){i(H.frames,-1,null,null,function(K){H.frames=K,e.advertisement&&e.advertisement.length&&(H.frames=e.advertisement.concat(H.frames)),H.compile(function(E){x.blob=E,x.blob.forEach&&(x.blob=new Blob([],{type:"video/webm"})),V&&V(x.blob)})})},10)};var o=!1;this.pause=function(){o=!0},this.resume=function(){o=!1,a&&this.record()},this.clearRecordedData=function(){a||this.stop(l),l()};function l(){H.frames=[],a=!0,o=!1}this.name="WhammyRecorder",this.toString=function(){return this.name};var c=document.createElement("canvas"),d=c.getContext("2d"),w,k,H}typeof ft<"u"&&(ft.WhammyRecorder=ps);var Z0=function(){function t(n){this.frames=[],this.duration=n||1,this.quality=.8}t.prototype.add=function(n,i){if("canvas"in n&&(n=n.canvas),"toDataURL"in n&&(n=n.toDataURL("image/webp",this.quality)),!/^data:image\/webp;base64,/ig.test(n))throw"Input must be formatted properly as a base64 encoded DataURI of type image/webp";this.frames.push({image:n,duration:i||this.duration})};function e(n){var i=Cr.createObjectURL(new Blob([n.toString(),"this.onmessage = function (eee) {"+n.name+"(eee.data);}"],{type:"application/javascript"})),a=new Worker(i);return Cr.revokeObjectURL(i),a}function r(n){function i(U){var J=o(U);if(!J)return[];for(var Z=3e4,se=[{id:440786851,data:[{data:1,id:17030},{data:1,id:17143},{data:4,id:17138},{data:8,id:17139},{data:"webm",id:17026},{data:2,id:17031},{data:2,id:17029}]},{id:408125543,data:[{id:357149030,data:[{data:1e6,id:2807729},{data:"whammy",id:19840},{data:"whammy",id:22337},{data:E(J.duration),id:17545}]},{id:374648427,data:[{id:174,data:[{data:1,id:215},{data:1,id:29637},{data:0,id:156},{data:"und",id:2274716},{data:"V_VP8",id:134},{data:"VP8",id:2459272},{data:1,id:131},{id:224,data:[{data:J.width,id:176},{data:J.height,id:186}]}]}]}]}],Ce=0,Ee=0;Ce<U.length;){var rt=[],tt=0;do rt.push(U[Ce]),tt+=U[Ce].duration,Ce++;while(Ce<U.length&&tt<Z);var Rt=0,yt={id:524531317,data:a(Ee,Rt,rt)};se[1].data.push(yt),Ee+=tt}return w(se)}function a(U,J,Z){return[{data:U,id:231}].concat(Z.map(function(se){var Ce=H({discardable:0,frame:se.data.slice(4),invisible:0,keyframe:1,lacing:0,trackNum:1,timecode:Math.round(J)});return J+=se.duration,{data:Ce,id:163}}))}function o(U){if(!U[0]){postMessage({error:"Something went wrong. Maybe WebP format is not supported in the current browser."});return}for(var J=U[0].width,Z=U[0].height,se=U[0].duration,Ce=1;Ce<U.length;Ce++)se+=U[Ce].duration;return{duration:se,width:J,height:Z}}function l(U){for(var J=[];U>0;)J.push(U&255),U=U>>8;return new Uint8Array(J.reverse())}function c(U){return new Uint8Array(U.split("").map(function(J){return J.charCodeAt(0)}))}function d(U){var J=[],Z=U.length%8?new Array(9-U.length%8).join("0"):"";U=Z+U;for(var se=0;se<U.length;se+=8)J.push(parseInt(U.substr(se,8),2));return new Uint8Array(J)}function w(U){for(var J=[],Z=0;Z<U.length;Z++){var se=U[Z].data;typeof se=="object"&&(se=w(se)),typeof se=="number"&&(se=d(se.toString(2))),typeof se=="string"&&(se=c(se));var Ce=se.size||se.byteLength||se.length,Ee=Math.ceil(Math.ceil(Math.log(Ce)/Math.log(2))/8),rt=Ce.toString(2),tt=new Array(Ee*7+7+1-rt.length).join("0")+rt,Rt=new Array(Ee).join("0")+"1"+tt;J.push(l(U[Z].id)),J.push(d(Rt)),J.push(se)}return new Blob(J,{type:"video/webm"})}function k(U){var J="",Z=U.length%8?new Array(9-U.length%8).join("0"):"";U=Z+U;for(var se=0;se<U.length;se+=8)J+=String.fromCharCode(parseInt(U.substr(se,8),2));return J}function H(U){var J=0;if(U.keyframe&&(J|=128),U.invisible&&(J|=8),U.lacing&&(J|=U.lacing<<1),U.discardable&&(J|=1),U.trackNum>127)throw"TrackNumber > 127 not supported";var Z=[U.trackNum|128,U.timecode>>8,U.timecode&255,J].map(function(se){return String.fromCharCode(se)}).join("")+U.frame;return Z}function V(U){for(var J=U.RIFF[0].WEBP[0],Z=J.indexOf("\x9D*"),se=0,Ce=[];se<4;se++)Ce[se]=J.charCodeAt(Z+3+se);var Ee,rt,tt;return tt=Ce[1]<<8|Ce[0],Ee=tt&16383,tt=Ce[3]<<8|Ce[2],rt=tt&16383,{width:Ee,height:rt,data:J,riff:U}}function x(U,J){return parseInt(U.substr(J+4,4).split("").map(function(Z){var se=Z.charCodeAt(0).toString(2);return new Array(8-se.length+1).join("0")+se}).join(""),2)}function K(U){for(var J=0,Z={};J<U.length;){var se=U.substr(J,4),Ce=x(U,J),Ee=U.substr(J+4+4,Ce);J+=4+4+Ce,Z[se]=Z[se]||[],se==="RIFF"||se==="LIST"?Z[se].push(K(Ee)):Z[se].push(Ee)}return Z}function E(U){return[].slice.call(new Uint8Array(new Float64Array([U]).buffer),0).map(function(J){return String.fromCharCode(J)}).reverse().join("")}var z=new i(n.map(function(U){var J=V(K(atob(U.image.slice(23))));return J.duration=U.duration,J}));postMessage(z)}return t.prototype.compile=function(n){var i=e(r);i.onmessage=function(a){if(a.data.error){console.error(a.data.error);return}n(a.data)},i.postMessage(this.frames)},{Video:t}}();typeof ft<"u"&&(ft.Whammy=Z0);var Xn={init:function(){var t=this;if(typeof indexedDB>"u"||typeof indexedDB.open>"u"){console.error("IndexedDB API are not available in this browser.");return}var e=1,r=this.dbName||location.href.replace(/\/|:|#|%|\.|\[|\]/g,""),n,i=indexedDB.open(r,e);function a(l){l.createObjectStore(t.dataStoreName)}function o(){var l=n.transaction([t.dataStoreName],"readwrite");t.videoBlob&&l.objectStore(t.dataStoreName).put(t.videoBlob,"videoBlob"),t.gifBlob&&l.objectStore(t.dataStoreName).put(t.gifBlob,"gifBlob"),t.audioBlob&&l.objectStore(t.dataStoreName).put(t.audioBlob,"audioBlob");function c(d){l.objectStore(t.dataStoreName).get(d).onsuccess=function(w){t.callback&&t.callback(w.target.result,d)}}c("audioBlob"),c("videoBlob"),c("gifBlob")}i.onerror=t.onError,i.onsuccess=function(){if(n=i.result,n.onerror=t.onError,n.setVersion)if(n.version!==e){var l=n.setVersion(e);l.onsuccess=function(){a(n),o()}}else o();else o()},i.onupgradeneeded=function(l){a(l.target.result)}},Fetch:function(t){return this.callback=t,this.init(),this},Store:function(t){return this.audioBlob=t.audioBlob,this.videoBlob=t.videoBlob,this.gifBlob=t.gifBlob,this.init(),this},onError:function(t){console.error(JSON.stringify(t,null," "))},dataStoreName:"recordRTC",dbName:null};typeof ft<"u"&&(ft.DiskStorage=Xn);function vs(t,e){if(typeof GIFEncoder>"u"){var r=document.createElement("script");r.src="https://www.webrtc-experiment.com/gif-recorder.js",(document.body||document.documentElement).appendChild(r)}e=e||{};var n=t instanceof CanvasRenderingContext2D||t instanceof HTMLCanvasElement;this.record=function(){if(typeof GIFEncoder>"u"){setTimeout(K.record,1e3);return}if(!c){setTimeout(K.record,1e3);return}n||(e.width||(e.width=d.offsetWidth||320),e.height||(e.height=d.offsetHeight||240),e.video||(e.video={width:e.width,height:e.height}),e.canvas||(e.canvas={width:e.width,height:e.height}),o.width=e.canvas.width||320,o.height=e.canvas.height||240,d.width=e.video.width||320,d.height=e.video.height||240),x=new GIFEncoder,x.setRepeat(0),x.setDelay(e.frameRate||200),x.setQuality(e.quality||10),x.start(),typeof e.onGifRecordingStarted=="function"&&e.onGifRecordingStarted(),k=Date.now();function E(z){if(K.clearedRecordedData!==!0){if(i)return setTimeout(function(){E(z)},100);w=pi(E),typeof V===void 0&&(V=z),!(z-V<90)&&(!n&&d.paused&&d.play(),n||l.drawImage(d,0,0,o.width,o.height),e.onGifPreview&&e.onGifPreview(o.toDataURL("image/png")),x.addFrame(l),V=z)}}w=pi(E),e.initCallback&&e.initCallback()},this.stop=function(E){E=E||function(){},w&&ji(w),H=Date.now(),this.blob=new Blob([new Uint8Array(x.stream().bin)],{type:"image/gif"}),E(this.blob),x.stream().bin=[]};var i=!1;this.pause=function(){i=!0},this.resume=function(){i=!1},this.clearRecordedData=function(){K.clearedRecordedData=!0,a()};function a(){x&&(x.stream().bin=[])}this.name="GifRecorder",this.toString=function(){return this.name};var o=document.createElement("canvas"),l=o.getContext("2d");n&&(t instanceof CanvasRenderingContext2D?(l=t,o=l.canvas):t instanceof HTMLCanvasElement&&(l=t.getContext("2d"),o=t));var c=!0;if(!n){var d=document.createElement("video");d.muted=!0,d.autoplay=!0,d.playsInline=!0,c=!1,d.onloadedmetadata=function(){c=!0},Cu(t,d),d.play()}var w=null,k,H,V,x,K=this}typeof ft<"u"&&(ft.GifRecorder=vs);function W0(t,e){var r="Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45";(function(Z){typeof ft<"u"||!Z||typeof window<"u"||typeof global>"u"||(global.navigator={userAgent:r,getUserMedia:function(){}},global.console||(global.console={}),(typeof global.console.log>"u"||typeof global.console.error>"u")&&(global.console.error=global.console.log=global.console.log||function(){console.log(arguments)}),typeof document>"u"&&(Z.document={documentElement:{appendChild:function(){return""}}},document.createElement=document.captureStream=document.mozCaptureStream=function(){var se={getContext:function(){return se},play:function(){},pause:function(){},drawImage:function(){},toDataURL:function(){return""},style:{}};return se},Z.HTMLVideoElement=function(){}),typeof location>"u"&&(Z.location={protocol:"file:",href:"",hash:""}),typeof screen>"u"&&(Z.screen={width:0,height:0}),typeof d>"u"&&(Z.URL={createObjectURL:function(){return""},revokeObjectURL:function(){return""}}),Z.window=global)})(typeof global<"u"?global:null),e=e||"multi-streams-mixer";var n=[],i=!1,a=document.createElement("canvas"),o=a.getContext("2d");a.style.opacity=0,a.style.position="absolute",a.style.zIndex=-1,a.style.top="-1000em",a.style.left="-1000em",a.className=e,(document.body||document.documentElement).appendChild(a),this.disableLogs=!1,this.frameInterval=10,this.width=360,this.height=240,this.useGainNode=!0;var l=this,c=window.AudioContext;typeof c>"u"&&(typeof webkitAudioContext<"u"&&(c=webkitAudioContext),typeof mozAudioContext<"u"&&(c=mozAudioContext));var d=window.URL;typeof d>"u"&&typeof webkitURL<"u"&&(d=webkitURL),typeof navigator<"u"&&typeof navigator.getUserMedia>"u"&&(typeof navigator.webkitGetUserMedia<"u"&&(navigator.getUserMedia=navigator.webkitGetUserMedia),typeof navigator.mozGetUserMedia<"u"&&(navigator.getUserMedia=navigator.mozGetUserMedia));var w=window.MediaStream;typeof w>"u"&&typeof webkitMediaStream<"u"&&(w=webkitMediaStream),typeof w<"u"&&typeof w.prototype.stop>"u"&&(w.prototype.stop=function(){this.getTracks().forEach(function(Z){Z.stop()})});var k={};typeof c<"u"?k.AudioContext=c:typeof webkitAudioContext<"u"&&(k.AudioContext=webkitAudioContext);function H(Z,se){"srcObject"in se?se.srcObject=Z:"mozSrcObject"in se?se.mozSrcObject=Z:se.srcObject=Z}this.startDrawingFrames=function(){V()};function V(){if(!i){var Z=n.length,se=!1,Ce=[];if(n.forEach(function(rt){rt.stream||(rt.stream={}),rt.stream.fullcanvas?se=rt:Ce.push(rt)}),se)a.width=se.stream.width,a.height=se.stream.height;else if(Ce.length){a.width=Z>1?Ce[0].width*2:Ce[0].width;var Ee=1;(Z===3||Z===4)&&(Ee=2),(Z===5||Z===6)&&(Ee=3),(Z===7||Z===8)&&(Ee=4),(Z===9||Z===10)&&(Ee=5),a.height=Ce[0].height*Ee}else a.width=l.width||360,a.height=l.height||240;se&&se instanceof HTMLVideoElement&&x(se),Ce.forEach(function(rt,tt){x(rt,tt)}),setTimeout(V,l.frameInterval)}}function x(Z,se){if(!i){var Ce=0,Ee=0,rt=Z.width,tt=Z.height;se===1&&(Ce=Z.width),se===2&&(Ee=Z.height),se===3&&(Ce=Z.width,Ee=Z.height),se===4&&(Ee=Z.height*2),se===5&&(Ce=Z.width,Ee=Z.height*2),se===6&&(Ee=Z.height*3),se===7&&(Ce=Z.width,Ee=Z.height*3),typeof Z.stream.left<"u"&&(Ce=Z.stream.left),typeof Z.stream.top<"u"&&(Ee=Z.stream.top),typeof Z.stream.width<"u"&&(rt=Z.stream.width),typeof Z.stream.height<"u"&&(tt=Z.stream.height),o.drawImage(Z,Ce,Ee,rt,tt),typeof Z.stream.onRender=="function"&&Z.stream.onRender(o,Ce,Ee,rt,tt,se)}}function K(){i=!1;var Z=E(),se=z();se&&se.getTracks().filter(function(Ee){return Ee.kind==="audio"}).forEach(function(Ee){Z.addTrack(Ee)});var Ce;return t.forEach(function(Ee){Ee.fullcanvas&&(Ce=!0)}),Z}function E(){J();var Z;"captureStream"in a?Z=a.captureStream():"mozCaptureStream"in a?Z=a.mozCaptureStream():l.disableLogs||console.error("Upgrade to latest Chrome or otherwise enable this flag: chrome://flags/#enable-experimental-web-platform-features");var se=new w;return Z.getTracks().filter(function(Ce){return Ce.kind==="video"}).forEach(function(Ce){se.addTrack(Ce)}),a.stream=se,se}function z(){k.AudioContextConstructor||(k.AudioContextConstructor=new k.AudioContext),l.audioContext=k.AudioContextConstructor,l.audioSources=[],l.useGainNode===!0&&(l.gainNode=l.audioContext.createGain(),l.gainNode.connect(l.audioContext.destination),l.gainNode.gain.value=0);var Z=0;if(t.forEach(function(se){if(!!se.getTracks().filter(function(Ee){return Ee.kind==="audio"}).length){Z++;var Ce=l.audioContext.createMediaStreamSource(se);l.useGainNode===!0&&Ce.connect(l.gainNode),l.audioSources.push(Ce)}}),!!Z)return l.audioDestination=l.audioContext.createMediaStreamDestination(),l.audioSources.forEach(function(se){se.connect(l.audioDestination)}),l.audioDestination.stream}function U(Z){var se=document.createElement("video");return H(Z,se),se.className=e,se.muted=!0,se.volume=0,se.width=Z.width||l.width||360,se.height=Z.height||l.height||240,se.play(),se}this.appendStreams=function(Z){if(!Z)throw"First parameter is required.";Z instanceof Array||(Z=[Z]),Z.forEach(function(se){var Ce=new w;if(se.getTracks().filter(function(tt){return tt.kind==="video"}).length){var Ee=U(se);Ee.stream=se,n.push(Ee),Ce.addTrack(se.getTracks().filter(function(tt){return tt.kind==="video"})[0])}if(se.getTracks().filter(function(tt){return tt.kind==="audio"}).length){var rt=l.audioContext.createMediaStreamSource(se);l.audioDestination=l.audioContext.createMediaStreamDestination(),rt.connect(l.audioDestination),Ce.addTrack(l.audioDestination.stream.getTracks().filter(function(tt){return tt.kind==="audio"})[0])}t.push(Ce)})},this.releaseStreams=function(){n=[],i=!0,l.gainNode&&(l.gainNode.disconnect(),l.gainNode=null),l.audioSources.length&&(l.audioSources.forEach(function(Z){Z.disconnect()}),l.audioSources=[]),l.audioDestination&&(l.audioDestination.disconnect(),l.audioDestination=null),l.audioContext&&l.audioContext.close(),l.audioContext=null,o.clearRect(0,0,a.width,a.height),a.stream&&(a.stream.stop(),a.stream=null)},this.resetVideoStreams=function(Z){Z&&!(Z instanceof Array)&&(Z=[Z]),J(Z)};function J(Z){n=[],Z=Z||t,Z.forEach(function(se){if(!!se.getTracks().filter(function(Ee){return Ee.kind==="video"}).length){var Ce=U(se);Ce.stream=se,n.push(Ce)}})}this.name="MultiStreamsMixer",this.toString=function(){return this.name},this.getMixedStream=K}typeof ft>"u"&&(typeof vo<"u"&&(vo.exports=W0),typeof define=="function"&&define.amd&&define("MultiStreamsMixer",[],function(){return W0}));function Iu(t,e){t=t||[];var r=this,n,i;e=e||{elementClass:"multi-streams-mixer",mimeType:"video/webm",video:{width:360,height:240}},e.frameInterval||(e.frameInterval=10),e.video||(e.video={}),e.video.width||(e.video.width=360),e.video.height||(e.video.height=240),this.record=function(){n=new W0(t,e.elementClass||"multi-streams-mixer"),a().length&&(n.frameInterval=e.frameInterval||10,n.width=e.video.width||360,n.height=e.video.height||240,n.startDrawingFrames()),e.previewStream&&typeof e.previewStream=="function"&&e.previewStream(n.getMixedStream()),i=new vn(n.getMixedStream(),e),i.record()};function a(){var o=[];return t.forEach(function(l){hr(l,"video").forEach(function(c){o.push(c)})}),o}this.stop=function(o){!i||i.stop(function(l){r.blob=l,o(l),r.clearRecordedData()})},this.pause=function(){i&&i.pause()},this.resume=function(){i&&i.resume()},this.clearRecordedData=function(){i&&(i.clearRecordedData(),i=null),n&&(n.releaseStreams(),n=null)},this.addStreams=function(o){if(!o)throw"First parameter is required.";o instanceof Array||(o=[o]),t.concat(o),!(!i||!n)&&(n.appendStreams(o),e.previewStream&&typeof e.previewStream=="function"&&e.previewStream(n.getMixedStream()))},this.resetVideoStreams=function(o){!n||(o&&!(o instanceof Array)&&(o=[o]),n.resetVideoStreams(o))},this.getMixer=function(){return n},this.name="MultiStreamRecorder",this.toString=function(){return this.name}}typeof ft<"u"&&(ft.MultiStreamRecorder=Iu);function Fm(t,e){if(!this)throw'Use "new RecordRTCPromisesHandler()"';if(typeof t>"u")throw'First argument "MediaStream" is required.';var r=this;r.recordRTC=new ft(t,e),this.startRecording=function(){return new Promise(function(n,i){try{r.recordRTC.startRecording(),n()}catch(a){i(a)}})},this.stopRecording=function(){return new Promise(function(n,i){try{r.recordRTC.stopRecording(function(a){if(r.blob=r.recordRTC.getBlob(),!r.blob||!r.blob.size){i("Empty blob.",r.blob);return}n(a)})}catch(a){i(a)}})},this.pauseRecording=function(){return new Promise(function(n,i){try{r.recordRTC.pauseRecording(),n()}catch(a){i(a)}})},this.resumeRecording=function(){return new Promise(function(n,i){try{r.recordRTC.resumeRecording(),n()}catch(a){i(a)}})},this.getDataURL=function(n){return new Promise(function(i,a){try{r.recordRTC.getDataURL(function(o){i(o)})}catch(o){a(o)}})},this.getBlob=function(){return new Promise(function(n,i){try{n(r.recordRTC.getBlob())}catch(a){i(a)}})},this.getInternalRecorder=function(){return new Promise(function(n,i){try{n(r.recordRTC.getInternalRecorder())}catch(a){i(a)}})},this.reset=function(){return new Promise(function(n,i){try{n(r.recordRTC.reset())}catch(a){i(a)}})},this.destroy=function(){return new Promise(function(n,i){try{n(r.recordRTC.destroy())}catch(a){i(a)}})},this.getState=function(){return new Promise(function(n,i){try{n(r.recordRTC.getState())}catch(a){i(a)}})},this.blob=null,this.version="5.6.2"}typeof ft<"u"&&(ft.RecordRTCPromisesHandler=Fm);function mo(t,e){(typeof ReadableStream>"u"||typeof WritableStream>"u")&&console.error("Following polyfill is strongly recommended: https://unpkg.com/@mattiasbuelens/web-streams-polyfill/dist/polyfill.min.js"),e=e||{},e.width=e.width||640,e.height=e.height||480,e.frameRate=e.frameRate||30,e.bitrate=e.bitrate||1200,e.realtime=e.realtime||!0;function r(w,k){return Cr.createObjectURL(new Blob([w],{type:k||""}))}var n;function i(){return new ReadableStream({start:function(w){var k=document.createElement("canvas"),H=document.createElement("video"),V=!0;H.srcObject=t,H.muted=!0,H.height=e.height,H.width=e.width,H.volume=0,H.onplaying=function(){k.width=e.width,k.height=e.height;var x=k.getContext("2d"),K=1e3/e.frameRate,E=setInterval(function(){if(n&&(clearInterval(E),w.close()),V&&(V=!1,e.onVideoProcessStarted&&e.onVideoProcessStarted()),x.drawImage(H,0,0),w._controlledReadableStream.state!=="closed")try{w.enqueue(x.getImageData(0,0,e.width,e.height))}catch{}},K)},H.play()}})}var a;function o(w,k){if(!e.workerPath&&!k){n=!1,fetch("https://unpkg.com/webm-wasm@latest/dist/webm-worker.js").then(function(V){V.arrayBuffer().then(function(x){o(w,x)})});return}if(!e.workerPath&&k instanceof ArrayBuffer){var H=new Blob([k],{type:"text/javascript"});e.workerPath=Cr.createObjectURL(H)}e.workerPath||console.error("workerPath parameter is missing."),a=new Worker(e.workerPath),a.postMessage(e.webAssemblyPath||"https://unpkg.com/webm-wasm@latest/dist/webm-wasm.wasm"),a.addEventListener("message",function(V){V.data==="READY"?(a.postMessage({width:e.width,height:e.height,bitrate:e.bitrate||1200,timebaseDen:e.frameRate||30,realtime:e.realtime}),i().pipeTo(new WritableStream({write:function(x){if(n){console.error("Got image, but recorder is finished!");return}a.postMessage(x.data.buffer,[x.data.buffer])}}))):V.data&&(l||d.push(V.data))})}this.record=function(){d=[],l=!1,this.blob=null,o(t),typeof e.initCallback=="function"&&e.initCallback()};var l;this.pause=function(){l=!0},this.resume=function(){l=!1};function c(w){if(!a){w&&w();return}a.addEventListener("message",function(k){k.data===null&&(a.terminate(),a=null,w&&w())}),a.postMessage(null)}var d=[];this.stop=function(w){n=!0;var k=this;c(function(){k.blob=new Blob(d,{type:"video/webm"}),w(k.blob)})},this.name="WebAssemblyRecorder",this.toString=function(){return this.name},this.clearRecordedData=function(){d=[],l=!1,this.blob=null},this.blob=null}typeof ft<"u"&&(ft.WebAssemblyRecorder=mo)});var Vu=G0((Lp,Hu)=>{Hu.exports=typeof self=="object"?self.FormData:window.FormData});var gf=G0((Yc,$c)=>{"use strict";(function(t,e){typeof Yc=="object"&&typeof $c<"u"?$c.exports=e():typeof define=="function"&&define.amd?define(e):t.MicRecorder=e()})(Yc,function(){function t(B){return new Int8Array(B)}function e(B){return new Int16Array(B)}function r(B){return new Int32Array(B)}function n(B){return new Float32Array(B)}function i(B){return new Float64Array(B)}function a(B){if(B.length==1)return n(B[0]);var ne=B[0];B=B.slice(1);for(var fe=[],ie=0;ie<ne;ie++)fe.push(a(B));return fe}function o(B){if(B.length==1)return r(B[0]);var ne=B[0];B=B.slice(1);for(var fe=[],ie=0;ie<ne;ie++)fe.push(o(B));return fe}function l(B){if(B.length==1)return e(B[0]);var ne=B[0];B=B.slice(1);for(var fe=[],ie=0;ie<ne;ie++)fe.push(l(B));return fe}function c(B){if(B.length==1)return new Array(B[0]);var ne=B[0];B=B.slice(1);for(var fe=[],ie=0;ie<ne;ie++)fe.push(c(B));return fe}var d={};d.fill=function(B,ne,fe,ie){if(arguments.length==2)for(var Ae=0;Ae<B.length;Ae++)B[Ae]=arguments[1];else for(var Ae=ne;Ae<fe;Ae++)B[Ae]=ie};var w={};w.arraycopy=function(B,ne,fe,ie,Ae){for(var ae=ne+Ae;ne<ae;)fe[ie++]=B[ne++]};var k={};k.SQRT2=1.4142135623730951,k.FAST_LOG10=function(B){return Math.log10(B)},k.FAST_LOG10_X=function(B,ne){return Math.log10(B)*ne};function H(B){this.ordinal=B}H.short_block_allowed=new H(0),H.short_block_coupled=new H(1),H.short_block_dispensed=new H(2),H.short_block_forced=new H(3);var V={};V.MAX_VALUE=34028235e31;function x(B){this.ordinal=B}x.vbr_off=new x(0),x.vbr_mt=new x(1),x.vbr_rh=new x(2),x.vbr_abr=new x(3),x.vbr_mtrh=new x(4),x.vbr_default=x.vbr_mtrh;var K=function(B){},E={System:w,VbrMode:x,Float:V,ShortBlock:H,Util:k,Arrays:d,new_array_n:c,new_byte:t,new_double:i,new_float:n,new_float_n:a,new_int:r,new_int_n:o,new_short:e,new_short_n:l,assert:K},z=E.System,U=E.Util,J=E.Arrays,Z=E.new_float;function se(){var B=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152,321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375,-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.7960341867115,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542,355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463,-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965,29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006,.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487,26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164,.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184,23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734,.04912684976946725,1.990369453344394,.035780907*U.SQRT2*.5/2384e-9,.017876148*U.SQRT2*.5/2384e-9,.003134727*U.SQRT2*.5/2384e-9,.002457142*U.SQRT2*.5/2384e-9,971317e-9*U.SQRT2*.5/2384e-9,218868e-9*U.SQRT2*.5/2384e-9,101566e-9*U.SQRT2*.5/2384e-9,13828e-9*U.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],ne=12,fe=36,ie=[[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,940084909404969e-27,6423305872147839e-28,2382191739347918e-28,5456116108943412e-27,4878985199565852e-27,4240448995017367e-27,3559909094758252e-27,2858043359288075e-27,2156177623817898e-27,1475637723558783e-27,8371015190102974e-28,2599706096327376e-28,-5456116108943412e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758252e-27,-2858043359288076e-27,-2156177623817898e-27,-1475637723558783e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347923e-28,-6423305872147843e-28,-9400849094049696e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049694e-28,-642330587214784e-27,-2382191739347918e-28],[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,9400849094049688e-28,6423305872147841e-28,2382191739347918e-28,5456116108943413e-27,4878985199565852e-27,4240448995017367e-27,3559909094758253e-27,2858043359288075e-27,2156177623817898e-27,1475637723558782e-27,8371015190102975e-28,2599706096327376e-28,-5461314069809755e-27,-4921085770524055e-27,-4343405037091838e-27,-3732668368707687e-27,-3093523840190885e-27,-2430835727329465e-27,-1734679010007751e-27,-974825365660928e-27,-2797435120168326e-28,0,0,0,0,0,0,-2283748241799531e-28,-4037858874020686e-28,-2146547464825323e-28],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212,4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.9955178160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2283748241799531e-28,4037858874020686e-28,2146547464825323e-28,5461314069809755e-27,4921085770524055e-27,4343405037091838e-27,3732668368707687e-27,3093523840190885e-27,2430835727329466e-27,1734679010007751e-27,974825365660928e-27,2797435120168326e-28,-5456116108943413e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758253e-27,-2858043359288075e-27,-2156177623817898e-27,-1475637723558782e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347913e-28,-6423305872147834e-28,-9400849094049688e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049688e-28,-6423305872147841e-28,-2382191739347918e-28]],Ae=ie[A.SHORT_TYPE],ae=ie[A.SHORT_TYPE],_e=ie[A.SHORT_TYPE],Fe=ie[A.SHORT_TYPE],Ue=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];function $(D,ee,s){for(var P=10,G=ee+238-14-286,F=-15;F<0;F++){var b,_,N;b=B[P+-10],_=D[G+-224]*b,N=D[ee+224]*b,b=B[P+-9],_+=D[G+-160]*b,N+=D[ee+160]*b,b=B[P+-8],_+=D[G+-96]*b,N+=D[ee+96]*b,b=B[P+-7],_+=D[G+-32]*b,N+=D[ee+32]*b,b=B[P+-6],_+=D[G+32]*b,N+=D[ee+-32]*b,b=B[P+-5],_+=D[G+96]*b,N+=D[ee+-96]*b,b=B[P+-4],_+=D[G+160]*b,N+=D[ee+-160]*b,b=B[P+-3],_+=D[G+224]*b,N+=D[ee+-224]*b,b=B[P+-2],_+=D[ee+-256]*b,N-=D[G+256]*b,b=B[P+-1],_+=D[ee+-192]*b,N-=D[G+192]*b,b=B[P+0],_+=D[ee+-128]*b,N-=D[G+128]*b,b=B[P+1],_+=D[ee+-64]*b,N-=D[G+64]*b,b=B[P+2],_+=D[ee+0]*b,N-=D[G+0]*b,b=B[P+3],_+=D[ee+64]*b,N-=D[G+-64]*b,b=B[P+4],_+=D[ee+128]*b,N-=D[G+-128]*b,b=B[P+5],_+=D[ee+192]*b,N-=D[G+-192]*b,_*=B[P+6],b=N-_,s[30+F*2]=N+_,s[31+F*2]=B[P+7]*b,P+=18,ee--,G++}{var _,N,W,C;N=D[ee+-16]*B[P+-10],_=D[ee+-32]*B[P+-2],N+=(D[ee+-48]-D[ee+16])*B[P+-9],_+=D[ee+-96]*B[P+-1],N+=(D[ee+-80]+D[ee+48])*B[P+-8],_+=D[ee+-160]*B[P+0],N+=(D[ee+-112]-D[ee+80])*B[P+-7],_+=D[ee+-224]*B[P+1],N+=(D[ee+-144]+D[ee+112])*B[P+-6],_-=D[ee+32]*B[P+2],N+=(D[ee+-176]-D[ee+144])*B[P+-5],_-=D[ee+96]*B[P+3],N+=(D[ee+-208]+D[ee+176])*B[P+-4],_-=D[ee+160]*B[P+4],N+=(D[ee+-240]-D[ee+208])*B[P+-3],_-=D[ee+224],W=_-N,C=_+N,N=s[14],_=s[15]-N,s[31]=C+N,s[30]=W+_,s[15]=W-_,s[14]=C-N}{var f;f=s[28]-s[0],s[0]+=s[28],s[28]=f*B[P+-2*18+7],f=s[29]-s[1],s[1]+=s[29],s[29]=f*B[P+-2*18+7],f=s[26]-s[2],s[2]+=s[26],s[26]=f*B[P+-4*18+7],f=s[27]-s[3],s[3]+=s[27],s[27]=f*B[P+-4*18+7],f=s[24]-s[4],s[4]+=s[24],s[24]=f*B[P+-6*18+7],f=s[25]-s[5],s[5]+=s[25],s[25]=f*B[P+-6*18+7],f=s[22]-s[6],s[6]+=s[22],s[22]=f*U.SQRT2,f=s[23]-s[7],s[7]+=s[23],s[23]=f*U.SQRT2-s[7],s[7]-=s[6],s[22]-=s[7],s[23]-=s[22],f=s[6],s[6]=s[31]-f,s[31]=s[31]+f,f=s[7],s[7]=s[30]-f,s[30]=s[30]+f,f=s[22],s[22]=s[15]-f,s[15]=s[15]+f,f=s[23],s[23]=s[14]-f,s[14]=s[14]+f,f=s[20]-s[8],s[8]+=s[20],s[20]=f*B[P+-10*18+7],f=s[21]-s[9],s[9]+=s[21],s[21]=f*B[P+-10*18+7],f=s[18]-s[10],s[10]+=s[18],s[18]=f*B[P+-12*18+7],f=s[19]-s[11],s[11]+=s[19],s[19]=f*B[P+-12*18+7],f=s[16]-s[12],s[12]+=s[16],s[16]=f*B[P+-14*18+7],f=s[17]-s[13],s[13]+=s[17],s[17]=f*B[P+-14*18+7],f=-s[20]+s[24],s[20]+=s[24],s[24]=f*B[P+-12*18+7],f=-s[21]+s[25],s[21]+=s[25],s[25]=f*B[P+-12*18+7],f=s[4]-s[8],s[4]+=s[8],s[8]=f*B[P+-12*18+7],f=s[5]-s[9],s[5]+=s[9],s[9]=f*B[P+-12*18+7],f=s[0]-s[12],s[0]+=s[12],s[12]=f*B[P+-4*18+7],f=s[1]-s[13],s[1]+=s[13],s[13]=f*B[P+-4*18+7],f=s[16]-s[28],s[16]+=s[28],s[28]=f*B[P+-4*18+7],f=-s[17]+s[29],s[17]+=s[29],s[29]=f*B[P+-4*18+7],f=U.SQRT2*(s[2]-s[10]),s[2]+=s[10],s[10]=f,f=U.SQRT2*(s[3]-s[11]),s[3]+=s[11],s[11]=f,f=U.SQRT2*(-s[18]+s[26]),s[18]+=s[26],s[26]=f-s[18],f=U.SQRT2*(-s[19]+s[27]),s[19]+=s[27],s[27]=f-s[19],f=s[2],s[19]-=s[3],s[3]-=f,s[2]=s[31]-f,s[31]+=f,f=s[3],s[11]-=s[19],s[18]-=f,s[3]=s[30]-f,s[30]+=f,f=s[18],s[27]-=s[11],s[19]-=f,s[18]=s[15]-f,s[15]+=f,f=s[19],s[10]-=f,s[19]=s[14]-f,s[14]+=f,f=s[10],s[11]-=f,s[10]=s[23]-f,s[23]+=f,f=s[11],s[26]-=f,s[11]=s[22]-f,s[22]+=f,f=s[26],s[27]-=f,s[26]=s[7]-f,s[7]+=f,f=s[27],s[27]=s[6]-f,s[6]+=f,f=U.SQRT2*(s[0]-s[4]),s[0]+=s[4],s[4]=f,f=U.SQRT2*(s[1]-s[5]),s[1]+=s[5],s[5]=f,f=U.SQRT2*(s[16]-s[20]),s[16]+=s[20],s[20]=f,f=U.SQRT2*(s[17]-s[21]),s[17]+=s[21],s[21]=f,f=-U.SQRT2*(s[8]-s[12]),s[8]+=s[12],s[12]=f-s[8],f=-U.SQRT2*(s[9]-s[13]),s[9]+=s[13],s[13]=f-s[9],f=-U.SQRT2*(s[25]-s[29]),s[25]+=s[29],s[29]=f-s[25],f=-U.SQRT2*(s[24]+s[28]),s[24]-=s[28],s[28]=f-s[24],f=s[24]-s[16],s[24]=f,f=s[20]-f,s[20]=f,f=s[28]-f,s[28]=f,f=s[25]-s[17],s[25]=f,f=s[21]-f,s[21]=f,f=s[29]-f,s[29]=f,f=s[17]-s[1],s[17]=f,f=s[9]-f,s[9]=f,f=s[25]-f,s[25]=f,f=s[5]-f,s[5]=f,f=s[21]-f,s[21]=f,f=s[13]-f,s[13]=f,f=s[29]-f,s[29]=f,f=s[1]-s[0],s[1]=f,f=s[16]-f,s[16]=f,f=s[17]-f,s[17]=f,f=s[8]-f,s[8]=f,f=s[9]-f,s[9]=f,f=s[24]-f,s[24]=f,f=s[25]-f,s[25]=f,f=s[4]-f,s[4]=f,f=s[5]-f,s[5]=f,f=s[20]-f,s[20]=f,f=s[21]-f,s[21]=f,f=s[12]-f,s[12]=f,f=s[13]-f,s[13]=f,f=s[28]-f,s[28]=f,f=s[29]-f,s[29]=f,f=s[0],s[0]+=s[31],s[31]-=f,f=s[1],s[1]+=s[30],s[30]-=f,f=s[16],s[16]+=s[15],s[15]-=f,f=s[17],s[17]+=s[14],s[14]-=f,f=s[8],s[8]+=s[23],s[23]-=f,f=s[9],s[9]+=s[22],s[22]-=f,f=s[24],s[24]+=s[7],s[7]-=f,f=s[25],s[25]+=s[6],s[6]-=f,f=s[4],s[4]+=s[27],s[27]-=f,f=s[5],s[5]+=s[26],s[26]-=f,f=s[20],s[20]+=s[11],s[11]-=f,f=s[21],s[21]+=s[10],s[10]-=f,f=s[12],s[12]+=s[19],s[19]-=f,f=s[13],s[13]+=s[18],s[18]-=f,f=s[28],s[28]+=s[3],s[3]-=f,f=s[29],s[29]+=s[2],s[2]-=f}}function he(D,ee){for(var s=0;s<3;s++){var P,G,F,b,_,N;b=D[ee+2*3]*ie[A.SHORT_TYPE][0]-D[ee+5*3],P=D[ee+0*3]*ie[A.SHORT_TYPE][2]-D[ee+3*3],G=b+P,F=b-P,b=D[ee+5*3]*ie[A.SHORT_TYPE][0]+D[ee+2*3],P=D[ee+3*3]*ie[A.SHORT_TYPE][2]+D[ee+0*3],_=b+P,N=-b+P,P=(D[ee+1*3]*ie[A.SHORT_TYPE][1]-D[ee+4*3])*2069978111953089e-26,b=(D[ee+4*3]*ie[A.SHORT_TYPE][1]+D[ee+1*3])*2069978111953089e-26,D[ee+3*0]=G*190752519173728e-25+P,D[ee+3*5]=-_*190752519173728e-25+b,F=F*.8660254037844387*1907525191737281e-26,_=_*.5*1907525191737281e-26+b,D[ee+3*1]=F-_,D[ee+3*2]=F+_,G=G*.5*1907525191737281e-26-P,N=N*.8660254037844387*1907525191737281e-26,D[ee+3*3]=G+N,D[ee+3*4]=G-N,ee++}}function be(D,ee,s){var P,G;{var F,b,_,N,W,C,f,O;F=s[17]-s[9],_=s[15]-s[11],N=s[14]-s[12],W=s[0]+s[8],C=s[1]+s[7],f=s[2]+s[6],O=s[3]+s[5],D[ee+17]=W+f-O-(C-s[4]),G=(W+f-O)*ae[12+7]+(C-s[4]),P=(F-_-N)*ae[12+6],D[ee+5]=P+G,D[ee+6]=P-G,b=(s[16]-s[10])*ae[12+6],C=C*ae[12+7]+s[4],P=F*ae[12+0]+b+_*ae[12+1]+N*ae[12+2],G=-W*ae[12+4]+C-f*ae[12+5]+O*ae[12+3],D[ee+1]=P+G,D[ee+2]=P-G,P=F*ae[12+1]-b-_*ae[12+2]+N*ae[12+0],G=-W*ae[12+5]+C-f*ae[12+3]+O*ae[12+4],D[ee+9]=P+G,D[ee+10]=P-G,P=F*ae[12+2]-b+_*ae[12+0]-N*ae[12+1],G=W*ae[12+3]-C+f*ae[12+4]-O*ae[12+5],D[ee+13]=P+G,D[ee+14]=P-G}{var R,m,h,S,u,p,y,T;R=s[8]-s[0],h=s[6]-s[2],S=s[5]-s[3],u=s[17]+s[9],p=s[16]+s[10],y=s[15]+s[11],T=s[14]+s[12],D[ee+0]=u+y+T+(p+s[13]),P=(u+y+T)*ae[12+7]-(p+s[13]),G=(R-h+S)*ae[12+6],D[ee+11]=P+G,D[ee+12]=P-G,m=(s[7]-s[1])*ae[12+6],p=s[13]-p*ae[12+7],P=u*ae[12+3]-p+y*ae[12+4]+T*ae[12+5],G=R*ae[12+2]+m+h*ae[12+0]+S*ae[12+1],D[ee+3]=P+G,D[ee+4]=P-G,P=-u*ae[12+5]+p-y*ae[12+3]-T*ae[12+4],G=R*ae[12+1]+m-h*ae[12+2]-S*ae[12+0],D[ee+7]=P+G,D[ee+8]=P-G,P=-u*ae[12+4]+p-y*ae[12+5]-T*ae[12+3],G=R*ae[12+0]-m+h*ae[12+1]-S*ae[12+2],D[ee+15]=P+G,D[ee+16]=P-G}}this.mdct_sub48=function(D,ee,s){for(var P=ee,G=286,F=0;F<D.channels_out;F++){for(var b=0;b<D.mode_gr;b++){for(var _,N=D.l3_side.tt[b][F],W=N.xr,C=0,f=D.sb_sample[F][1-b],O=0,R=0;R<18/2;R++)for($(P,G,f[O]),$(P,G+32,f[O+1]),O+=2,G+=64,_=1;_<32;_+=2)f[O-1][_]*=-1;for(_=0;_<32;_++,C+=18){var m=N.block_type,h=D.sb_sample[F][b],S=D.sb_sample[F][1-b];if(N.mixed_block_flag!=0&&_<2&&(m=0),D.amp_filter[_]<1e-12)J.fill(W,C+0,C+18,0);else{if(D.amp_filter[_]<1)for(var R=0;R<18;R++)S[R][Ue[_]]*=D.amp_filter[_];if(m==A.SHORT_TYPE){for(var R=-ne/4;R<0;R++){var u=ie[A.SHORT_TYPE][R+3];W[C+R*3+9]=h[9+R][Ue[_]]*u-h[8-R][Ue[_]],W[C+R*3+18]=h[14-R][Ue[_]]*u+h[15+R][Ue[_]],W[C+R*3+10]=h[15+R][Ue[_]]*u-h[14-R][Ue[_]],W[C+R*3+19]=S[2-R][Ue[_]]*u+S[3+R][Ue[_]],W[C+R*3+11]=S[3+R][Ue[_]]*u-S[2-R][Ue[_]],W[C+R*3+20]=S[8-R][Ue[_]]*u+S[9+R][Ue[_]]}he(W,C)}else{for(var p=Z(18),R=-fe/4;R<0;R++){var y,T;y=ie[m][R+27]*S[R+9][Ue[_]]+ie[m][R+36]*S[8-R][Ue[_]],T=ie[m][R+9]*h[R+9][Ue[_]]-ie[m][R+18]*h[8-R][Ue[_]],p[R+9]=y-T*Ae[3+R+9],p[R+18]=y*Ae[3+R+9]+T}be(W,C,p)}}if(m!=A.SHORT_TYPE&&_!=0)for(var R=7;R>=0;--R){var Q,j;Q=W[C+R]*_e[20+R]+W[C+-1-R]*Fe[28+R],j=W[C+R]*Fe[28+R]-W[C+-1-R]*_e[20+R],W[C+-1-R]=Q,W[C+R]=j}}}if(P=s,G=286,D.mode_gr==1)for(var Y=0;Y<18;Y++)z.arraycopy(D.sb_sample[F][1][Y],0,D.sb_sample[F][0][Y],0,32)}}}var Ce=se,Ee=E.System,rt=E.new_float,tt=E.new_float_n;function Rt(){this.l=rt(A.SBMAX_l),this.s=tt([A.SBMAX_s,3]);var B=this;this.assign=function(ne){Ee.arraycopy(ne.l,0,B.l,0,A.SBMAX_l);for(var fe=0;fe<A.SBMAX_s;fe++)for(var ie=0;ie<3;ie++)B.s[fe][ie]=ne.s[fe][ie]}}var yt=Rt;function sr(){this.thm=new yt,this.en=new yt}var Pt=sr,Yt=E.System,Vt=E.VbrMode,Ct=E.new_array_n,vt=E.new_float,Et=E.new_float_n,At=E.new_int,bt=E.assert;et.ENCDELAY=576,et.POSTDELAY=1152,et.MDCTDELAY=48,et.FFTOFFSET=224+et.MDCTDELAY,et.DECDELAY=528,et.SBLIMIT=32,et.CBANDS=64,et.SBPSY_l=21,et.SBPSY_s=12,et.SBMAX_l=22,et.SBMAX_s=13,et.PSFB21=6,et.PSFB12=6,et.BLKSIZE=1024,et.HBLKSIZE=et.BLKSIZE/2+1,et.BLKSIZE_s=256,et.HBLKSIZE_s=et.BLKSIZE_s/2+1,et.NORM_TYPE=0,et.START_TYPE=1,et.SHORT_TYPE=2,et.STOP_TYPE=3,et.MPG_MD_LR_LR=0,et.MPG_MD_LR_I=1,et.MPG_MD_MS_LR=2,et.MPG_MD_MS_I=3,et.fircoef=[-.0207887*5,-.0378413*5,-.0432472*5,-.031183*5,779609e-23*5,.0467745*5,.10091*5,.151365*5,.187098*5];function et(){var B=Ce,ne=Pt,fe=et.FFTOFFSET,ie=et.MPG_MD_MS_LR,Ae=null;this.psy=null;var ae=null,_e=null,Fe=null;this.setModules=function(D,ee,s,P){Ae=D,this.psy=ee,ae=ee,_e=P,Fe=s};var Ue=new B;function $(D){var ee,s;if(D.ATH.useAdjust==0){D.ATH.adjust=1;return}if(s=D.loudness_sq[0][0],ee=D.loudness_sq[1][0],D.channels_out==2?(s+=D.loudness_sq[0][1],ee+=D.loudness_sq[1][1]):(s+=s,ee+=ee),D.mode_gr==2&&(s=Math.max(s,ee)),s*=.5,s*=D.ATH.aaSensitivityP,s>.03125)D.ATH.adjust>=1?D.ATH.adjust=1:D.ATH.adjust<D.ATH.adjustLimit&&(D.ATH.adjust=D.ATH.adjustLimit),D.ATH.adjustLimit=1;else{var P=31.98*s+625e-6;D.ATH.adjust>=P?(D.ATH.adjust*=P*.075+.925,D.ATH.adjust<P&&(D.ATH.adjust=P)):D.ATH.adjustLimit>=P?D.ATH.adjust=P:D.ATH.adjust<D.ATH.adjustLimit&&(D.ATH.adjust=D.ATH.adjustLimit),D.ATH.adjustLimit=P}}function he(D){var ee,s;for(bt(0<=D.bitrate_index&&D.bitrate_index<16),bt(0<=D.mode_ext&&D.mode_ext<4),D.bitrate_stereoMode_Hist[D.bitrate_index][4]++,D.bitrate_stereoMode_Hist[15][4]++,D.channels_out==2&&(D.bitrate_stereoMode_Hist[D.bitrate_index][D.mode_ext]++,D.bitrate_stereoMode_Hist[15][D.mode_ext]++),ee=0;ee<D.mode_gr;++ee)for(s=0;s<D.channels_out;++s){var P=D.l3_side.tt[ee][s].block_type|0;D.l3_side.tt[ee][s].mixed_block_flag!=0&&(P=4),D.bitrate_blockType_Hist[D.bitrate_index][P]++,D.bitrate_blockType_Hist[D.bitrate_index][5]++,D.bitrate_blockType_Hist[15][P]++,D.bitrate_blockType_Hist[15][5]++}}function be(D,ee){var s=D.internal_flags,P,G;if(s.lame_encode_frame_init==0){var F,b,_=vt(2014),N=vt(286+1152+576);for(s.lame_encode_frame_init=1,F=0,b=0;F<286+576*(1+s.mode_gr);++F)F<576*s.mode_gr?(_[F]=0,s.channels_out==2&&(N[F]=0)):(_[F]=ee[0][b],s.channels_out==2&&(N[F]=ee[1][b]),++b);for(G=0;G<s.mode_gr;G++)for(P=0;P<s.channels_out;P++)s.l3_side.tt[G][P].block_type=et.SHORT_TYPE;Ue.mdct_sub48(s,_,N),bt(576>=et.FFTOFFSET),bt(s.mf_size>=et.BLKSIZE+D.framesize-et.FFTOFFSET),bt(s.mf_size>=512+D.framesize-32)}}this.lame_encode_mp3_frame=function(D,ee,s,P,G,F){var b,_=Ct([2,2]);_[0][0]=new ne,_[0][1]=new ne,_[1][0]=new ne,_[1][1]=new ne;var N=Ct([2,2]);N[0][0]=new ne,N[0][1]=new ne,N[1][0]=new ne,N[1][1]=new ne;var W,C=[null,null],f=D.internal_flags,O=Et([2,4]),R=[.5,.5],m=[[0,0],[0,0]],h=[[0,0],[0,0]],S,u,p;if(C[0]=ee,C[1]=s,f.lame_encode_frame_init==0&&be(D,C),f.padding=0,(f.slot_lag-=f.frac_SpF)<0&&(f.slot_lag+=D.out_samplerate,f.padding=1),f.psymodel!=0){var y,T=[null,null],Q=0,j=At(2);for(p=0;p<f.mode_gr;p++){for(u=0;u<f.channels_out;u++)T[u]=C[u],Q=576+p*576-et.FFTOFFSET;if(D.VBR==Vt.vbr_mtrh||D.VBR==Vt.vbr_mt?y=ae.L3psycho_anal_vbr(D,T,Q,p,_,N,m[p],h[p],O[p],j):y=ae.L3psycho_anal_ns(D,T,Q,p,_,N,m[p],h[p],O[p],j),y!=0)return-4;for(D.mode==vr.JOINT_STEREO&&(R[p]=O[p][2]+O[p][3],R[p]>0&&(R[p]=O[p][3]/R[p])),u=0;u<f.channels_out;u++){var Y=f.l3_side.tt[p][u];Y.block_type=j[u],Y.mixed_block_flag=0}}}else for(p=0;p<f.mode_gr;p++)for(u=0;u<f.channels_out;u++)f.l3_side.tt[p][u].block_type=et.NORM_TYPE,f.l3_side.tt[p][u].mixed_block_flag=0,h[p][u]=m[p][u]=700;if($(f),Ue.mdct_sub48(f,C[0],C[1]),f.mode_ext=et.MPG_MD_LR_LR,D.force_ms)f.mode_ext=et.MPG_MD_MS_LR;else if(D.mode==vr.JOINT_STEREO){var we=0,v=0;for(p=0;p<f.mode_gr;p++)for(u=0;u<f.channels_out;u++)we+=h[p][u],v+=m[p][u];if(we<=1*v){var g=f.l3_side.tt[0],ve=f.l3_side.tt[f.mode_gr-1];g[0].block_type==g[1].block_type&&ve[0].block_type==ve[1].block_type&&(f.mode_ext=et.MPG_MD_MS_LR)}}if(f.mode_ext==ie?(W=N,S=h):(W=_,S=m),D.analysis&&f.pinfo!=null)for(p=0;p<f.mode_gr;p++)for(u=0;u<f.channels_out;u++)f.pinfo.ms_ratio[p]=f.ms_ratio[p],f.pinfo.ms_ener_ratio[p]=R[p],f.pinfo.blocktype[p][u]=f.l3_side.tt[p][u].block_type,f.pinfo.pe[p][u]=S[p][u],Yt.arraycopy(f.l3_side.tt[p][u].xr,0,f.pinfo.xr[p][u],0,576),f.mode_ext==ie&&(f.pinfo.ers[p][u]=f.pinfo.ers[p][u+2],Yt.arraycopy(f.pinfo.energy[p][u+2],0,f.pinfo.energy[p][u],0,f.pinfo.energy[p][u].length));if(D.VBR==Vt.vbr_off||D.VBR==Vt.vbr_abr){var ye,He;for(ye=0;ye<18;ye++)f.nsPsy.pefirbuf[ye]=f.nsPsy.pefirbuf[ye+1];for(He=0,p=0;p<f.mode_gr;p++)for(u=0;u<f.channels_out;u++)He+=S[p][u];for(f.nsPsy.pefirbuf[18]=He,He=f.nsPsy.pefirbuf[9],ye=0;ye<9;ye++)He+=(f.nsPsy.pefirbuf[ye]+f.nsPsy.pefirbuf[18-ye])*et.fircoef[ye];for(He=670*5*f.mode_gr*f.channels_out/He,p=0;p<f.mode_gr;p++)for(u=0;u<f.channels_out;u++)S[p][u]*=He}if(f.iteration_loop.iteration_loop(D,S,R,W),Ae.format_bitstream(D),b=Ae.copy_buffer(f,P,G,F,1),D.bWriteVbrTag&&_e.addVbrFrame(D),D.analysis&&f.pinfo!=null){for(u=0;u<f.channels_out;u++){var ze;for(ze=0;ze<fe;ze++)f.pinfo.pcmdata[u][ze]=f.pinfo.pcmdata[u][ze+D.framesize];for(ze=fe;ze<1600;ze++)f.pinfo.pcmdata[u][ze]=C[u][ze-fe]}Fe.set_frame_pinfo(D,W)}return he(f),b}}var A=et,de=E.Util,Ve=E.new_float;function $e(){var B=Ve(A.BLKSIZE),ne=Ve(A.BLKSIZE_s/2),fe=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function ie(ae,_e,Fe){var Ue=0,$,he,be;Fe<<=1;var D=_e+Fe;$=4;do{var ee,s,P,G,F,b,_;_=$>>1,G=$,F=$<<1,b=F+G,$=F<<1,he=_e,be=he+_;do{var N,W,C,f;W=ae[he+0]-ae[he+G],N=ae[he+0]+ae[he+G],f=ae[he+F]-ae[he+b],C=ae[he+F]+ae[he+b],ae[he+F]=N-C,ae[he+0]=N+C,ae[he+b]=W-f,ae[he+G]=W+f,W=ae[be+0]-ae[be+G],N=ae[be+0]+ae[be+G],f=de.SQRT2*ae[be+b],C=de.SQRT2*ae[be+F],ae[be+F]=N-C,ae[be+0]=N+C,ae[be+b]=W-f,ae[be+G]=W+f,be+=$,he+=$}while(he<D);for(s=fe[Ue+0],ee=fe[Ue+1],P=1;P<_;P++){var O,R;O=1-2*ee*ee,R=2*ee*s,he=_e+P,be=_e+G-P;do{var m,h,S,N,W,u,C,p,f,y;h=R*ae[he+G]-O*ae[be+G],m=O*ae[he+G]+R*ae[be+G],W=ae[he+0]-m,N=ae[he+0]+m,u=ae[be+0]-h,S=ae[be+0]+h,h=R*ae[he+b]-O*ae[be+b],m=O*ae[he+b]+R*ae[be+b],f=ae[he+F]-m,C=ae[he+F]+m,y=ae[be+F]-h,p=ae[be+F]+h,h=ee*C-s*y,m=s*C+ee*y,ae[he+F]=N-m,ae[he+0]=N+m,ae[be+b]=u-h,ae[be+G]=u+h,h=s*p-ee*f,m=ee*p+s*f,ae[be+F]=S-m,ae[be+0]=S+m,ae[he+b]=W-h,ae[he+G]=W+h,be+=$,he+=$}while(he<D);O=s,s=O*fe[Ue+0]-ee*fe[Ue+1],ee=O*fe[Ue+1]+ee*fe[Ue+0]}Ue+=2}while($<Fe)}var Ae=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254];this.fft_short=function(ae,_e,Fe,Ue,$){for(var he=0;he<3;he++){var be=A.BLKSIZE_s/2,D=65535&576/3*(he+1),ee=A.BLKSIZE_s/8-1;do{var s,P,G,F,b,_=Ae[ee<<2]&255;s=ne[_]*Ue[Fe][$+_+D],b=ne[127-_]*Ue[Fe][$+_+D+128],P=s-b,s=s+b,G=ne[_+64]*Ue[Fe][$+_+D+64],b=ne[63-_]*Ue[Fe][$+_+D+192],F=G-b,G=G+b,be-=4,_e[he][be+0]=s+G,_e[he][be+2]=s-G,_e[he][be+1]=P+F,_e[he][be+3]=P-F,s=ne[_+1]*Ue[Fe][$+_+D+1],b=ne[126-_]*Ue[Fe][$+_+D+129],P=s-b,s=s+b,G=ne[_+65]*Ue[Fe][$+_+D+65],b=ne[62-_]*Ue[Fe][$+_+D+193],F=G-b,G=G+b,_e[he][be+A.BLKSIZE_s/2+0]=s+G,_e[he][be+A.BLKSIZE_s/2+2]=s-G,_e[he][be+A.BLKSIZE_s/2+1]=P+F,_e[he][be+A.BLKSIZE_s/2+3]=P-F}while(--ee>=0);ie(_e[he],be,A.BLKSIZE_s/2)}},this.fft_long=function(ae,_e,Fe,Ue,$){var he=A.BLKSIZE/8-1,be=A.BLKSIZE/2;do{var D,ee,s,P,G,F=Ae[he]&255;D=B[F]*Ue[Fe][$+F],G=B[F+512]*Ue[Fe][$+F+512],ee=D-G,D=D+G,s=B[F+256]*Ue[Fe][$+F+256],G=B[F+768]*Ue[Fe][$+F+768],P=s-G,s=s+G,be-=4,_e[be+0]=D+s,_e[be+2]=D-s,_e[be+1]=ee+P,_e[be+3]=ee-P,D=B[F+1]*Ue[Fe][$+F+1],G=B[F+513]*Ue[Fe][$+F+513],ee=D-G,D=D+G,s=B[F+257]*Ue[Fe][$+F+257],G=B[F+769]*Ue[Fe][$+F+769],P=s-G,s=s+G,_e[be+A.BLKSIZE/2+0]=D+s,_e[be+A.BLKSIZE/2+2]=D-s,_e[be+A.BLKSIZE/2+1]=ee+P,_e[be+A.BLKSIZE/2+3]=ee-P}while(--he>=0);ie(_e,be,A.BLKSIZE/2)},this.init_fft=function(ae){for(var _e=0;_e<A.BLKSIZE;_e++)B[_e]=.42-.5*Math.cos(2*Math.PI*(_e+.5)/A.BLKSIZE)+.08*Math.cos(4*Math.PI*(_e+.5)/A.BLKSIZE);for(var _e=0;_e<A.BLKSIZE_s/2;_e++)ne[_e]=.5*(1-Math.cos(2*Math.PI*(_e+.5)/A.BLKSIZE_s))}}var ce=$e,xe=E.VbrMode,ke=E.Float,Me=E.ShortBlock,Te=E.Util,Je=E.Arrays,qe=E.new_float,ut=E.new_float_n,ht=E.new_int,Se=E.assert;function qt(){var B=new ce,ne=2.302585092994046,fe=2,ie=16,Ae=2,ae=16,_e=.34,Fe=1/(14752*14752)/(A.BLKSIZE/2),Ue=.01,$=.8,he=.6,be=.3,D=3.5,ee=4.4,s=25,P=21,G=.2302585093;function F(I){return I}function b(I,M){for(var q=0,X=0;X<A.BLKSIZE/2;++X)q+=I[X]*M.ATH.eql_w[X];return q*=Fe,q}function _(I,M,q,X,oe,L,re,le,te,pe,ue){var ge=I.internal_flags;if(te<2)B.fft_long(ge,X[oe],te,pe,ue),B.fft_short(ge,L[re],te,pe,ue);else if(te==2){for(var je=A.BLKSIZE-1;je>=0;--je){var st=X[oe+0][je],Pe=X[oe+1][je];X[oe+0][je]=(st+Pe)*Te.SQRT2*.5,X[oe+1][je]=(st-Pe)*Te.SQRT2*.5}for(var nt=2;nt>=0;--nt)for(var je=A.BLKSIZE_s-1;je>=0;--je){var st=L[re+0][nt][je],Pe=L[re+1][nt][je];L[re+0][nt][je]=(st+Pe)*Te.SQRT2*.5,L[re+1][nt][je]=(st-Pe)*Te.SQRT2*.5}}M[0]=X[oe+0][0],M[0]*=M[0];for(var je=A.BLKSIZE/2-1;je>=0;--je){var me=X[oe+0][A.BLKSIZE/2-je],Ye=X[oe+0][A.BLKSIZE/2+je];M[A.BLKSIZE/2-je]=(me*me+Ye*Ye)*.5}for(var nt=2;nt>=0;--nt){q[nt][0]=L[re+0][nt][0],q[nt][0]*=q[nt][0];for(var je=A.BLKSIZE_s/2-1;je>=0;--je){var me=L[re+0][nt][A.BLKSIZE_s/2-je],Ye=L[re+0][nt][A.BLKSIZE_s/2+je];q[nt][A.BLKSIZE_s/2-je]=(me*me+Ye*Ye)*.5}}{for(var gt=0,je=11;je<A.HBLKSIZE;je++)gt+=M[je];ge.tot_ener[te]=gt}if(I.analysis){for(var je=0;je<A.HBLKSIZE;je++)ge.pinfo.energy[le][te][je]=ge.pinfo.energy_save[te][je],ge.pinfo.energy_save[te][je]=M[je];ge.pinfo.pe[le][te]=ge.pe[te]}I.athaa_loudapprox==2&&te<2&&(ge.loudness_sq[le][te]=ge.loudness_sq_save[te],ge.loudness_sq_save[te]=b(M,ge))}var N=8,W=23,C=15,f,O,R,m=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749];function h(){f=Math.pow(10,(N+1)/16),O=Math.pow(10,(W+1)/16),R=Math.pow(10,C/10)}var S=[3.3246*3.3246,3.23837*3.23837,3.15437*3.15437,3.00412*3.00412,2.86103*2.86103,2.65407*2.65407,2.46209*2.46209,2.284*2.284,2.11879*2.11879,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,1.56911*1.56911,1.46658*1.46658,1.37074*1.37074,1.31036*1.31036,1.25264*1.25264,1.20648*1.20648,1.16203*1.16203,1.12765*1.12765,1.09428*1.09428,1.0659*1.0659,1.03826*1.03826,1.01895*1.01895,1],u=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1],p=[2.35364*2.35364,2.29259*2.29259,2.23313*2.23313,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,1.49999*1.49999,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.11084*1.11084,1.03826*1.03826];function y(I,M,q,X,oe,L){var re;if(M>I)if(M<I*O)re=M/I;else return I+M;else{if(I>=M*O)return I+M;re=I/M}if(Se(I>=0),Se(M>=0),I+=M,X+3<=3+3){if(re>=f)return I;var le=0|Te.FAST_LOG10_X(re,16);return I*u[le]}var le=0|Te.FAST_LOG10_X(re,16);if(L!=0?M=oe.ATH.cb_s[q]*oe.ATH.adjust:M=oe.ATH.cb_l[q]*oe.ATH.adjust,Se(M>=0),I<R*M){if(I>M){var te,pe;return te=1,le<=13&&(te=p[le]),pe=Te.FAST_LOG10_X(I/M,10/15),I*((S[le]-te)*pe+te)}return le>13?I:I*p[le]}return I*S[le]}var T=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1];function Q(I,M,q){var X;if(I<0&&(I=0),M<0&&(M=0),I<=0)return M;if(M<=0)return I;if(M>I?X=M/I:X=I/M,-2<=q&&q<=2){if(X>=f)return I+M;var oe=0|Te.FAST_LOG10_X(X,16);return(I+M)*T[oe]}return X<O?I+M:(I<M&&(I=M),I)}function j(I,M){var q=I.internal_flags;if(q.channels_out>1){for(var X=0;X<A.SBMAX_l;X++){var oe=q.thm[0].l[X],L=q.thm[1].l[X];q.thm[0].l[X]+=L*M,q.thm[1].l[X]+=oe*M}for(var X=0;X<A.SBMAX_s;X++)for(var re=0;re<3;re++){var oe=q.thm[0].s[X][re],L=q.thm[1].s[X][re];q.thm[0].s[X][re]+=L*M,q.thm[1].s[X][re]+=oe*M}}}function Y(I){for(var M=0;M<A.SBMAX_l;M++)if(!(I.thm[0].l[M]>1.58*I.thm[1].l[M]||I.thm[1].l[M]>1.58*I.thm[0].l[M])){var q=I.mld_l[M]*I.en[3].l[M],X=Math.max(I.thm[2].l[M],Math.min(I.thm[3].l[M],q));q=I.mld_l[M]*I.en[2].l[M];var oe=Math.max(I.thm[3].l[M],Math.min(I.thm[2].l[M],q));I.thm[2].l[M]=X,I.thm[3].l[M]=oe}for(var M=0;M<A.SBMAX_s;M++)for(var L=0;L<3;L++)if(!(I.thm[0].s[M][L]>1.58*I.thm[1].s[M][L]||I.thm[1].s[M][L]>1.58*I.thm[0].s[M][L])){var q=I.mld_s[M]*I.en[3].s[M][L],X=Math.max(I.thm[2].s[M][L],Math.min(I.thm[3].s[M][L],q));q=I.mld_s[M]*I.en[2].s[M][L];var oe=Math.max(I.thm[3].s[M][L],Math.min(I.thm[2].s[M][L],q));I.thm[2].s[M][L]=X,I.thm[3].s[M][L]=oe}}function we(I,M,q){var X=M,oe=Math.pow(10,q);M*=2,X*=2;for(var L=0;L<A.SBMAX_l;L++){var re,le,te,pe;if(pe=I.ATH.cb_l[I.bm_l[L]]*oe,re=Math.min(Math.max(I.thm[0].l[L],pe),Math.max(I.thm[1].l[L],pe)),le=Math.max(I.thm[2].l[L],pe),te=Math.max(I.thm[3].l[L],pe),re*M<le+te){var ue=re*X/(le+te);le*=ue,te*=ue,Se(le+te>0)}I.thm[2].l[L]=Math.min(le,I.thm[2].l[L]),I.thm[3].l[L]=Math.min(te,I.thm[3].l[L])}oe*=A.BLKSIZE_s/A.BLKSIZE;for(var L=0;L<A.SBMAX_s;L++)for(var ge=0;ge<3;ge++){var re,le,te,pe;if(pe=I.ATH.cb_s[I.bm_s[L]]*oe,re=Math.min(Math.max(I.thm[0].s[L][ge],pe),Math.max(I.thm[1].s[L][ge],pe)),le=Math.max(I.thm[2].s[L][ge],pe),te=Math.max(I.thm[3].s[L][ge],pe),re*M<le+te){var ue=re*M/(le+te);le*=ue,te*=ue,Se(le+te>0)}I.thm[2].s[L][ge]=Math.min(I.thm[2].s[L][ge],le),I.thm[3].s[L][ge]=Math.min(I.thm[3].s[L][ge],te)}}function v(I,M,q,X,oe){var L,re,le=0,te=0;for(L=re=0;L<A.SBMAX_s;++re,++L){for(var pe=I.bo_s[L],ue=I.npart_s,ge=pe<ue?pe:ue;re<ge;)Se(M[re]>=0),Se(q[re]>=0),le+=M[re],te+=q[re],re++;if(I.en[X].s[L][oe]=le,I.thm[X].s[L][oe]=te,re>=ue){++L;break}Se(M[re]>=0),Se(q[re]>=0);{var je=I.PSY.bo_s_weight[L],st=1-je;le=je*M[re],te=je*q[re],I.en[X].s[L][oe]+=le,I.thm[X].s[L][oe]+=te,le=st*M[re],te=st*q[re]}}for(;L<A.SBMAX_s;++L)I.en[X].s[L][oe]=0,I.thm[X].s[L][oe]=0}function g(I,M,q,X){var oe,L,re=0,le=0;for(oe=L=0;oe<A.SBMAX_l;++L,++oe){for(var te=I.bo_l[oe],pe=I.npart_l,ue=te<pe?te:pe;L<ue;)Se(M[L]>=0),Se(q[L]>=0),re+=M[L],le+=q[L],L++;if(I.en[X].l[oe]=re,I.thm[X].l[oe]=le,L>=pe){++oe;break}Se(M[L]>=0),Se(q[L]>=0);{var ge=I.PSY.bo_l_weight[oe],je=1-ge;re=ge*M[L],le=ge*q[L],I.en[X].l[oe]+=re,I.thm[X].l[oe]+=le,re=je*M[L],le=je*q[L]}}for(;oe<A.SBMAX_l;++oe)I.en[X].l[oe]=0,I.thm[X].l[oe]=0}function ve(I,M,q,X,oe,L){var re=I.internal_flags,le,te;for(te=le=0;te<re.npart_s;++te){for(var pe=0,ue=0,ge=re.numlines_s[te],je=0;je<ge;++je,++le){var st=M[L][le];pe+=st,ue<st&&(ue=st)}q[te]=pe}for(Se(te==re.npart_s),Se(le==129),le=te=0;te<re.npart_s;te++){var Pe=re.s3ind_s[te][0],nt=re.s3_ss[le++]*q[Pe];for(++Pe;Pe<=re.s3ind_s[te][1];)nt+=re.s3_ss[le]*q[Pe],++le,++Pe;{var me=Ae*re.nb_s1[oe][te];X[te]=Math.min(nt,me)}if(re.blocktype_old[oe&1]==A.SHORT_TYPE){var me=ae*re.nb_s2[oe][te],Ye=X[te];X[te]=Math.min(me,Ye)}re.nb_s2[oe][te]=re.nb_s1[oe][te],re.nb_s1[oe][te]=nt,Se(X[te]>=0)}for(;te<=A.CBANDS;++te)q[te]=0,X[te]=0}function ye(I,M,q,X){var oe=I.internal_flags;I.short_blocks==Me.short_block_coupled&&!(M[0]!=0&&M[1]!=0)&&(M[0]=M[1]=0);for(var L=0;L<oe.channels_out;L++)X[L]=A.NORM_TYPE,I.short_blocks==Me.short_block_dispensed&&(M[L]=1),I.short_blocks==Me.short_block_forced&&(M[L]=0),M[L]!=0?(Se(oe.blocktype_old[L]!=A.START_TYPE),oe.blocktype_old[L]==A.SHORT_TYPE&&(X[L]=A.STOP_TYPE)):(X[L]=A.SHORT_TYPE,oe.blocktype_old[L]==A.NORM_TYPE&&(oe.blocktype_old[L]=A.START_TYPE),oe.blocktype_old[L]==A.STOP_TYPE&&(oe.blocktype_old[L]=A.SHORT_TYPE)),q[L]=oe.blocktype_old[L],oe.blocktype_old[L]=X[L]}function He(I,M,q){return q>=1?I:q<=0?M:M>0?Math.pow(I/M,q)*M:0}var ze=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function Ke(I,M){for(var q=309.07,X=0;X<A.SBMAX_s-1;X++)for(var oe=0;oe<3;oe++){var L=I.thm.s[X][oe];if(Se(X<ze.length),L>0){var re=L*M,le=I.en.s[X][oe];le>re&&(le>re*1e10?q+=ze[X]*(10*ne):(Se(re>0),q+=ze[X]*Te.FAST_LOG10(le/re)))}}return q}var We=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function lt(I,M){for(var q=281.0575,X=0;X<A.SBMAX_l-1;X++){var oe=I.thm.l[X];if(Se(X<We.length),oe>0){var L=oe*M,re=I.en.l[X];re>L&&(re>L*1e10?q+=We[X]*(10*ne):(Se(L>0),q+=We[X]*Te.FAST_LOG10(re/L)))}}return q}function Ze(I,M,q,X,oe){var L,re;for(L=re=0;L<I.npart_l;++L){var le=0,te=0,pe;for(pe=0;pe<I.numlines_l[L];++pe,++re){var ue=M[re];Se(ue>=0),le+=ue,te<ue&&(te=ue)}q[L]=le,X[L]=te,oe[L]=le*I.rnumlines_l[L],Se(I.rnumlines_l[L]>=0),Se(le>=0),Se(q[L]>=0),Se(X[L]>=0),Se(oe[L]>=0)}}function Ge(I,M,q,X){var oe=m.length-1,L=0,re=q[L]+q[L+1];if(Se(re>=0),re>0){var le=M[L];le<M[L+1]&&(le=M[L+1]),Se(I.numlines_l[L]+I.numlines_l[L+1]-1>0),re=20*(le*2-re)/(re*(I.numlines_l[L]+I.numlines_l[L+1]-1));var te=0|re;te>oe&&(te=oe),X[L]=te}else X[L]=0;for(L=1;L<I.npart_l-1;L++)if(re=q[L-1]+q[L]+q[L+1],Se(re>=0),re>0){var le=M[L-1];le<M[L]&&(le=M[L]),le<M[L+1]&&(le=M[L+1]),Se(I.numlines_l[L-1]+I.numlines_l[L]+I.numlines_l[L+1]-1>0),re=20*(le*3-re)/(re*(I.numlines_l[L-1]+I.numlines_l[L]+I.numlines_l[L+1]-1));var te=0|re;te>oe&&(te=oe),X[L]=te}else X[L]=0;if(Se(L>0),Se(L==I.npart_l-1),re=q[L-1]+q[L],Se(re>=0),re>0){var le=M[L-1];le<M[L]&&(le=M[L]),Se(I.numlines_l[L-1]+I.numlines_l[L]-1>0),re=20*(le*2-re)/(re*(I.numlines_l[L-1]+I.numlines_l[L]-1));var te=0|re;te>oe&&(te=oe),X[L]=te}else X[L]=0;Se(L==I.npart_l-1)}var Mt=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];this.L3psycho_anal_ns=function(I,M,q,X,oe,L,re,le,te,pe){var ue=I.internal_flags,ge=ut([2,A.BLKSIZE]),je=ut([2,3,A.BLKSIZE_s]),st=qe(A.CBANDS+1),Pe=qe(A.CBANDS+1),nt=qe(A.CBANDS+2),me=ht(2),Ye=ht(2),gt,De,Qe,Be,it,Kt,Xe,mt,St=ut([2,576]),Jt,Qr=ht(A.CBANDS+2),cr=ht(A.CBANDS+2);for(Je.fill(cr,0),gt=ue.channels_out,I.mode==vr.JOINT_STEREO&&(gt=4),I.VBR==xe.vbr_off?Jt=ue.ResvMax==0?0:ue.ResvSize/ue.ResvMax*.5:I.VBR==xe.vbr_rh||I.VBR==xe.vbr_mtrh||I.VBR==xe.vbr_mt?Jt=.6:Jt=1,De=0;De<ue.channels_out;De++){var Zt=M[De],Gr=q+576-350-P+192;for(Se(Mt.length==(P-1)/2),Be=0;Be<576;Be++){var Jr,en;for(Jr=Zt[Gr+Be+10],en=0,it=0;it<(P-1)/2-1;it+=2)Jr+=Mt[it]*(Zt[Gr+Be+it]+Zt[Gr+Be+P-it]),en+=Mt[it+1]*(Zt[Gr+Be+it+1]+Zt[Gr+Be+P-it-1]);St[De][Be]=Jr+en}oe[X][De].en.assign(ue.en[De]),oe[X][De].thm.assign(ue.thm[De]),gt>2&&(L[X][De].en.assign(ue.en[De+2]),L[X][De].thm.assign(ue.thm[De+2]))}for(De=0;De<gt;De++){var Tn,En,Pr=qe(12),Gn=[0,0,0,0],pa=qe(12),F0=1,pu,_u=qe(A.CBANDS),gu=qe(A.CBANDS),er=[0,0,0,0],bu=qe(A.HBLKSIZE),Su=ut([3,A.HBLKSIZE_s]);for(Se(ue.npart_s<=A.CBANDS),Se(ue.npart_l<=A.CBANDS),Be=0;Be<3;Be++)Pr[Be]=ue.nsPsy.last_en_subshort[De][Be+6],Se(ue.nsPsy.last_en_subshort[De][Be+4]>0),pa[Be]=Pr[Be]/ue.nsPsy.last_en_subshort[De][Be+4],Gn[0]+=Pr[Be];if(De==2)for(Be=0;Be<576;Be++){var O0,U0;O0=St[0][Be],U0=St[1][Be],St[0][Be]=O0+U0,St[1][Be]=O0-U0}{var yu=St[De&1],so=0;for(Be=0;Be<9;Be++){for(var Am=so+64,br=1;so<Am;so++)br<Math.abs(yu[so])&&(br=Math.abs(yu[so]));ue.nsPsy.last_en_subshort[De][Be]=Pr[Be+3]=br,Gn[1+Be/3]+=br,br>Pr[Be+3-2]?(Se(Pr[Be+3-2]>0),br=br/Pr[Be+3-2]):Pr[Be+3-2]>br*10?(Se(br>0),br=Pr[Be+3-2]/(br*10)):br=0,pa[Be+3]=br}}if(I.analysis){var H0=pa[0];for(Be=1;Be<12;Be++)H0<pa[Be]&&(H0=pa[Be]);ue.pinfo.ers[X][De]=ue.pinfo.ers_save[De],ue.pinfo.ers_save[De]=H0}for(pu=De==3?ue.nsPsy.attackthre_s:ue.nsPsy.attackthre,Be=0;Be<12;Be++)er[Be/3]==0&&pa[Be]>pu&&(er[Be/3]=Be%3+1);for(Be=1;Be<4;Be++){var V0;Gn[Be-1]>Gn[Be]?(Se(Gn[Be]>0),V0=Gn[Be-1]/Gn[Be]):(Se(Gn[Be-1]>0),V0=Gn[Be]/Gn[Be-1]),V0<1.7&&(er[Be]=0,Be==1&&(er[0]=0))}for(er[0]!=0&&ue.nsPsy.lastAttacks[De]!=0&&(er[0]=0),(ue.nsPsy.lastAttacks[De]==3||er[0]+er[1]+er[2]+er[3]!=0)&&(F0=0,er[1]!=0&&er[0]!=0&&(er[1]=0),er[2]!=0&&er[1]!=0&&(er[2]=0),er[3]!=0&&er[2]!=0&&(er[3]=0)),De<2?Ye[De]=F0:F0==0&&(Ye[0]=Ye[1]=0),te[De]=ue.tot_ener[De],En=je,Tn=ge,_(I,bu,Su,Tn,De&1,En,De&1,X,De,M,q),Ze(ue,bu,st,_u,gu),Ge(ue,_u,gu,Qr),mt=0;mt<3;mt++){var q0,Xr;for(ve(I,Su,Pe,nt,De,mt),v(ue,Pe,nt,De,mt),Xe=0;Xe<A.SBMAX_s;Xe++){if(Xr=ue.thm[De].s[Xe][mt],Xr*=$,er[mt]>=2||er[mt+1]==1){var lo=mt!=0?mt-1:2,br=He(ue.thm[De].s[Xe][lo],Xr,he*Jt);Xr=Math.min(Xr,br)}if(er[mt]==1){var lo=mt!=0?mt-1:2,br=He(ue.thm[De].s[Xe][lo],Xr,be*Jt);Xr=Math.min(Xr,br)}else if(mt!=0&&er[mt-1]==3||mt==0&&ue.nsPsy.lastAttacks[De]==3){var lo=mt!=2?mt+1:0,br=He(ue.thm[De].s[Xe][lo],Xr,be*Jt);Xr=Math.min(Xr,br)}q0=Pr[mt*3+3]+Pr[mt*3+4]+Pr[mt*3+5],Pr[mt*3+5]*6<q0&&(Xr*=.5,Pr[mt*3+4]*6<q0&&(Xr*=.5)),ue.thm[De].s[Xe][mt]=Xr}}for(ue.nsPsy.lastAttacks[De]=er[2],Kt=0,Qe=0;Qe<ue.npart_l;Qe++){for(var qi=ue.s3ind[Qe][0],z0=st[qi]*m[Qr[qi]],zi=ue.s3_ll[Kt++]*z0;++qi<=ue.s3ind[Qe][1];)z0=st[qi]*m[Qr[qi]],zi=y(zi,ue.s3_ll[Kt++]*z0,qi,qi-Qe,ue,0);zi*=.158489319246111,ue.blocktype_old[De&1]==A.SHORT_TYPE?nt[Qe]=zi:nt[Qe]=He(Math.min(zi,Math.min(fe*ue.nb_1[De][Qe],ie*ue.nb_2[De][Qe])),zi,Jt),ue.nb_2[De][Qe]=ue.nb_1[De][Qe],ue.nb_1[De][Qe]=zi}for(;Qe<=A.CBANDS;++Qe)st[Qe]=0,nt[Qe]=0;g(ue,st,nt,De)}if((I.mode==vr.STEREO||I.mode==vr.JOINT_STEREO)&&I.interChRatio>0&&j(I,I.interChRatio),I.mode==vr.JOINT_STEREO){var j0;Y(ue),j0=I.msfix,Math.abs(j0)>0&&we(ue,j0,I.ATHlower*ue.ATH.adjust)}for(ye(I,Ye,pe,me),De=0;De<gt;De++){var co,uo=0,ss,ls;De>1?(co=le,uo=-2,ss=A.NORM_TYPE,(pe[0]==A.SHORT_TYPE||pe[1]==A.SHORT_TYPE)&&(ss=A.SHORT_TYPE),ls=L[X][De-2]):(co=re,uo=0,ss=pe[De],ls=oe[X][De]),ss==A.SHORT_TYPE?co[uo+De]=Ke(ls,ue.masking_lower):co[uo+De]=lt(ls,ue.masking_lower),I.analysis&&(ue.pinfo.pe[X][De]=co[uo+De])}return 0};function Xt(I,M,q,X,oe,L,re,le){var te=I.internal_flags;if(X<2)B.fft_long(te,re[le],X,M,q);else if(X==2)for(var pe=A.BLKSIZE-1;pe>=0;--pe){var ue=re[le+0][pe],ge=re[le+1][pe];re[le+0][pe]=(ue+ge)*Te.SQRT2*.5,re[le+1][pe]=(ue-ge)*Te.SQRT2*.5}L[0]=re[le+0][0],L[0]*=L[0];for(var pe=A.BLKSIZE/2-1;pe>=0;--pe){var je=re[le+0][A.BLKSIZE/2-pe],st=re[le+0][A.BLKSIZE/2+pe];L[A.BLKSIZE/2-pe]=(je*je+st*st)*.5}{for(var Pe=0,pe=11;pe<A.HBLKSIZE;pe++)Pe+=L[pe];te.tot_ener[X]=Pe}if(I.analysis){for(var pe=0;pe<A.HBLKSIZE;pe++)te.pinfo.energy[oe][X][pe]=te.pinfo.energy_save[X][pe],te.pinfo.energy_save[X][pe]=L[pe];te.pinfo.pe[oe][X]=te.pe[X]}}function Dt(I,M,q,X,oe,L,re,le){var te=I.internal_flags;if(oe==0&&X<2&&B.fft_short(te,re[le],X,M,q),X==2)for(var pe=A.BLKSIZE_s-1;pe>=0;--pe){var ue=re[le+0][oe][pe],ge=re[le+1][oe][pe];re[le+0][oe][pe]=(ue+ge)*Te.SQRT2*.5,re[le+1][oe][pe]=(ue-ge)*Te.SQRT2*.5}L[oe][0]=re[le+0][oe][0],L[oe][0]*=L[oe][0];for(var pe=A.BLKSIZE_s/2-1;pe>=0;--pe){var je=re[le+0][oe][A.BLKSIZE_s/2-pe],st=re[le+0][oe][A.BLKSIZE_s/2+pe];L[oe][A.BLKSIZE_s/2-pe]=(je*je+st*st)*.5}}function Wt(I,M,q,X){var oe=I.internal_flags;I.athaa_loudapprox==2&&q<2&&(oe.loudness_sq[M][q]=oe.loudness_sq_save[q],oe.loudness_sq_save[q]=b(X,oe))}var rr=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];function ar(I,M,q,X,oe,L,re,le,te,pe){for(var ue=ut([2,576]),ge=I.internal_flags,je=ge.channels_out,st=I.mode==vr.JOINT_STEREO?4:je,Pe=0;Pe<je;Pe++){firbuf=M[Pe];var nt=q+576-350-P+192;Se(rr.length==(P-1)/2);for(var me=0;me<576;me++){var Ye,gt;Ye=firbuf[nt+me+10],gt=0;for(var De=0;De<(P-1)/2-1;De+=2)Ye+=rr[De]*(firbuf[nt+me+De]+firbuf[nt+me+P-De]),gt+=rr[De+1]*(firbuf[nt+me+De+1]+firbuf[nt+me+P-De-1]);ue[Pe][me]=Ye+gt}oe[X][Pe].en.assign(ge.en[Pe]),oe[X][Pe].thm.assign(ge.thm[Pe]),st>2&&(L[X][Pe].en.assign(ge.en[Pe+2]),L[X][Pe].thm.assign(ge.thm[Pe+2]))}for(var Pe=0;Pe<st;Pe++){var Qe=qe(12),Be=qe(12),it=[0,0,0,0],Kt=ue[Pe&1],Xe=0,mt=Pe==3?ge.nsPsy.attackthre_s:ge.nsPsy.attackthre,St=1;if(Pe==2)for(var me=0,De=576;De>0;++me,--De){var Jt=ue[0][me],Qr=ue[1][me];ue[0][me]=Jt+Qr,ue[1][me]=Jt-Qr}for(var me=0;me<3;me++)Be[me]=ge.nsPsy.last_en_subshort[Pe][me+6],Se(ge.nsPsy.last_en_subshort[Pe][me+4]>0),Qe[me]=Be[me]/ge.nsPsy.last_en_subshort[Pe][me+4],it[0]+=Be[me];for(var me=0;me<9;me++){for(var cr=Xe+64,Zt=1;Xe<cr;Xe++)Zt<Math.abs(Kt[Xe])&&(Zt=Math.abs(Kt[Xe]));ge.nsPsy.last_en_subshort[Pe][me]=Be[me+3]=Zt,it[1+me/3]+=Zt,Zt>Be[me+3-2]?(Se(Be[me+3-2]>0),Zt=Zt/Be[me+3-2]):Be[me+3-2]>Zt*10?(Se(Zt>0),Zt=Be[me+3-2]/(Zt*10)):Zt=0,Qe[me+3]=Zt}for(var me=0;me<3;++me){var Gr=Be[me*3+3]+Be[me*3+4]+Be[me*3+5],Jr=1;Be[me*3+5]*6<Gr&&(Jr*=.5,Be[me*3+4]*6<Gr&&(Jr*=.5)),le[Pe][me]=Jr}if(I.analysis){for(var en=Qe[0],me=1;me<12;me++)en<Qe[me]&&(en=Qe[me]);ge.pinfo.ers[X][Pe]=ge.pinfo.ers_save[Pe],ge.pinfo.ers_save[Pe]=en}for(var me=0;me<12;me++)te[Pe][me/3]==0&&Qe[me]>mt&&(te[Pe][me/3]=me%3+1);for(var me=1;me<4;me++){var Tn=it[me-1],En=it[me],Pr=Math.max(Tn,En);Pr<4e4&&Tn<1.7*En&&En<1.7*Tn&&(me==1&&te[Pe][0]<=te[Pe][me]&&(te[Pe][0]=0),te[Pe][me]=0)}te[Pe][0]<=ge.nsPsy.lastAttacks[Pe]&&(te[Pe][0]=0),(ge.nsPsy.lastAttacks[Pe]==3||te[Pe][0]+te[Pe][1]+te[Pe][2]+te[Pe][3]!=0)&&(St=0,te[Pe][1]!=0&&te[Pe][0]!=0&&(te[Pe][1]=0),te[Pe][2]!=0&&te[Pe][1]!=0&&(te[Pe][2]=0),te[Pe][3]!=0&&te[Pe][2]!=0&&(te[Pe][3]=0)),Pe<2?pe[Pe]=St:St==0&&(pe[0]=pe[1]=0),re[Pe]=ge.tot_ener[Pe]}}function Ar(I,M,q){if(q==0)for(var X=0;X<I.npart_s;X++)I.nb_s2[M][X]=I.nb_s1[M][X],I.nb_s1[M][X]=0}function jn(I,M){for(var q=0;q<I.npart_l;q++)I.nb_2[M][q]=I.nb_1[M][q],I.nb_1[M][q]=0}function zr(I,M,q,X){var oe=m.length-1,L=0,re=q[L]+q[L+1];if(Se(re>=0),re>0){var le=M[L];le<M[L+1]&&(le=M[L+1]),Se(I.numlines_s[L]+I.numlines_s[L+1]-1>0),re=20*(le*2-re)/(re*(I.numlines_s[L]+I.numlines_s[L+1]-1));var te=0|re;te>oe&&(te=oe),X[L]=te}else X[L]=0;for(L=1;L<I.npart_s-1;L++)if(re=q[L-1]+q[L]+q[L+1],Se(L+1<I.npart_s),Se(re>=0),re>0){var le=M[L-1];le<M[L]&&(le=M[L]),le<M[L+1]&&(le=M[L+1]),Se(I.numlines_s[L-1]+I.numlines_s[L]+I.numlines_s[L+1]-1>0),re=20*(le*3-re)/(re*(I.numlines_s[L-1]+I.numlines_s[L]+I.numlines_s[L+1]-1));var te=0|re;te>oe&&(te=oe),X[L]=te}else X[L]=0;if(Se(L>0),Se(L==I.npart_s-1),re=q[L-1]+q[L],Se(re>=0),re>0){var le=M[L-1];le<M[L]&&(le=M[L]),Se(I.numlines_s[L-1]+I.numlines_s[L]-1>0),re=20*(le*2-re)/(re*(I.numlines_s[L-1]+I.numlines_s[L]-1));var te=0|re;te>oe&&(te=oe),X[L]=te}else X[L]=0;Se(L==I.npart_s-1)}function jr(I,M,q,X,oe,L){var re=I.internal_flags,le=new float[A.CBANDS],te=qe(A.CBANDS),pe,ue,ge,je=new int[A.CBANDS];for(ge=ue=0;ge<re.npart_s;++ge){var st=0,Pe=0,nt=re.numlines_s[ge];for(pe=0;pe<nt;++pe,++ue){var me=M[L][ue];st+=me,Pe<me&&(Pe=me)}q[ge]=st,Se(st>=0),le[ge]=Pe,Se(nt>0),te[ge]=st/nt,Se(te[ge]>=0)}for(Se(ge==re.npart_s),Se(ue==129);ge<A.CBANDS;++ge)le[ge]=0,te[ge]=0;for(zr(re,le,te,je),ue=ge=0;ge<re.npart_s;ge++){var Ye=re.s3ind_s[ge][0],gt=re.s3ind_s[ge][1],De,Qe,Be,it,Kt;for(De=je[Ye],Qe=1,it=re.s3_ss[ue]*q[Ye]*m[je[Ye]],++ue,++Ye;Ye<=gt;)De+=je[Ye],Qe+=1,Be=re.s3_ss[ue]*q[Ye]*m[je[Ye]],it=Q(it,Be,Ye-ge),++ue,++Ye;De=(1+2*De)/(2*Qe),Kt=m[De]*.5,it*=Kt,X[ge]=it,re.nb_s2[oe][ge]=re.nb_s1[oe][ge],re.nb_s1[oe][ge]=it,Be=le[ge],Be*=re.minval_s[ge],Be*=Kt,X[ge]>Be&&(X[ge]=Be),re.masking_lower>1&&(X[ge]*=re.masking_lower),X[ge]>q[ge]&&(X[ge]=q[ge]),re.masking_lower<1&&(X[ge]*=re.masking_lower),Se(X[ge]>=0)}for(;ge<A.CBANDS;++ge)q[ge]=0,X[ge]=0}function wn(I,M,q,X,oe){var L=qe(A.CBANDS),re=qe(A.CBANDS),le=ht(A.CBANDS+2),te;Ze(I,M,q,L,re),Ge(I,L,re,le);var pe=0;for(te=0;te<I.npart_l;te++){var ue,ge,je,st,Pe=I.s3ind[te][0],nt=I.s3ind[te][1],me=0,Ye=0;for(me=le[Pe],Ye+=1,ge=I.s3_ll[pe]*q[Pe]*m[le[Pe]],++pe,++Pe;Pe<=nt;)me+=le[Pe],Ye+=1,ue=I.s3_ll[pe]*q[Pe]*m[le[Pe]],st=Q(ge,ue,Pe-te),ge=st,++pe,++Pe;if(me=(1+2*me)/(2*Ye),je=m[me]*.5,ge*=je,I.blocktype_old[oe&1]==A.SHORT_TYPE){var gt=fe*I.nb_1[oe][te];gt>0?X[te]=Math.min(ge,gt):X[te]=Math.min(ge,q[te]*be)}else{var De=ie*I.nb_2[oe][te],Qe=fe*I.nb_1[oe][te],gt;De<=0&&(De=ge),Qe<=0&&(Qe=ge),I.blocktype_old[oe&1]==A.NORM_TYPE?gt=Math.min(Qe,De):gt=Qe,X[te]=Math.min(ge,gt)}I.nb_2[oe][te]=I.nb_1[oe][te],I.nb_1[oe][te]=ge,ue=L[te],ue*=I.minval_l[te],ue*=je,X[te]>ue&&(X[te]=ue),I.masking_lower>1&&(X[te]*=I.masking_lower),X[te]>q[te]&&(X[te]=q[te]),I.masking_lower<1&&(X[te]*=I.masking_lower),Se(X[te]>=0)}for(;te<A.CBANDS;++te)q[te]=0,X[te]=0}function Hi(I,M){var q=I.internal_flags;I.short_blocks==Me.short_block_coupled&&!(M[0]!=0&&M[1]!=0)&&(M[0]=M[1]=0);for(var X=0;X<q.channels_out;X++)I.short_blocks==Me.short_block_dispensed&&(M[X]=1),I.short_blocks==Me.short_block_forced&&(M[X]=0)}function Vi(I,M,q){for(var X=I.internal_flags,oe=0;oe<X.channels_out;oe++){var L=A.NORM_TYPE;M[oe]!=0?(Se(X.blocktype_old[oe]!=A.START_TYPE),X.blocktype_old[oe]==A.SHORT_TYPE&&(L=A.STOP_TYPE)):(L=A.SHORT_TYPE,X.blocktype_old[oe]==A.NORM_TYPE&&(X.blocktype_old[oe]=A.START_TYPE),X.blocktype_old[oe]==A.STOP_TYPE&&(X.blocktype_old[oe]=A.SHORT_TYPE)),q[oe]=X.blocktype_old[oe],X.blocktype_old[oe]=L}}function Rn(I,M,q,X,oe,L,re){for(var le=L*2,te=L>0?Math.pow(10,oe):1,pe,ue,ge=0;ge<re;++ge){var je=I[2][ge],st=I[3][ge],Pe=M[0][ge],nt=M[1][ge],me=M[2][ge],Ye=M[3][ge];if(Pe<=1.58*nt&&nt<=1.58*Pe){var gt=q[ge]*st,De=q[ge]*je;ue=Math.max(me,Math.min(Ye,gt)),pe=Math.max(Ye,Math.min(me,De))}else ue=me,pe=Ye;if(L>0){var Qe,Be,it=X[ge]*te;if(Qe=Math.min(Math.max(Pe,it),Math.max(nt,it)),me=Math.max(ue,it),Ye=Math.max(pe,it),Be=me+Ye,Be>0&&Qe*le<Be){var Kt=Qe*le/Be;me*=Kt,Ye*=Kt,Se(Be>0)}ue=Math.min(me,ue),pe=Math.min(Ye,pe)}ue>je&&(ue=je),pe>st&&(pe=st),M[2][ge]=ue,M[3][ge]=pe}}this.L3psycho_anal_vbr=function(I,M,q,X,oe,L,re,le,te,pe){var ue=I.internal_flags,ge,je,st=qe(A.HBLKSIZE),Pe=ut([3,A.HBLKSIZE_s]),nt=ut([2,A.BLKSIZE]),me=ut([2,3,A.BLKSIZE_s]),Ye=ut([4,A.CBANDS]),gt=ut([4,A.CBANDS]),De=ut([4,3]),Qe=.6,Be=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],it=ht(2),Kt=I.mode==vr.JOINT_STEREO?4:ue.channels_out;ar(I,M,q,X,oe,L,te,De,Be,it),Hi(I,it);{for(var Xe=0;Xe<Kt;Xe++){var mt=Xe&1;ge=nt,Xt(I,M,q,Xe,X,st,ge,mt),Wt(I,X,Xe,st),it[mt]!=0?wn(ue,st,Ye[Xe],gt[Xe],Xe):jn(ue,Xe)}it[0]+it[1]==2&&I.mode==vr.JOINT_STEREO&&Rn(Ye,gt,ue.mld_cb_l,ue.ATH.cb_l,I.ATHlower*ue.ATH.adjust,I.msfix,ue.npart_l);for(var Xe=0;Xe<Kt;Xe++){var mt=Xe&1;it[mt]!=0&&g(ue,Ye[Xe],gt[Xe],Xe)}}{for(var St=0;St<3;St++){for(var Xe=0;Xe<Kt;++Xe){var mt=Xe&1;it[mt]!=0?Ar(ue,Xe,St):(je=me,Dt(I,M,q,Xe,St,Pe,je,mt),jr(I,Pe,Ye[Xe],gt[Xe],Xe,St))}it[0]+it[1]==0&&I.mode==vr.JOINT_STEREO&&Rn(Ye,gt,ue.mld_cb_s,ue.ATH.cb_s,I.ATHlower*ue.ATH.adjust,I.msfix,ue.npart_s);for(var Xe=0;Xe<Kt;++Xe){var mt=Xe&1;it[mt]==0&&v(ue,Ye[Xe],gt[Xe],Xe,St)}}for(var Xe=0;Xe<Kt;Xe++){var mt=Xe&1;if(it[mt]==0)for(var Jt=0;Jt<A.SBMAX_s;Jt++){for(var Qr=qe(3),St=0;St<3;St++){var cr=ue.thm[Xe].s[Jt][St];if(cr*=$,Be[Xe][St]>=2||Be[Xe][St+1]==1){var Zt=St!=0?St-1:2,Gr=He(ue.thm[Xe].s[Jt][Zt],cr,he*Qe);cr=Math.min(cr,Gr)}else if(Be[Xe][St]==1){var Zt=St!=0?St-1:2,Gr=He(ue.thm[Xe].s[Jt][Zt],cr,be*Qe);cr=Math.min(cr,Gr)}else if(St!=0&&Be[Xe][St-1]==3||St==0&&ue.nsPsy.lastAttacks[Xe]==3){var Zt=St!=2?St+1:0,Gr=He(ue.thm[Xe].s[Jt][Zt],cr,be*Qe);cr=Math.min(cr,Gr)}cr*=De[Xe][St],Qr[St]=cr}for(var St=0;St<3;St++)ue.thm[Xe].s[Jt][St]=Qr[St]}}}for(var Xe=0;Xe<Kt;Xe++)ue.nsPsy.lastAttacks[Xe]=Be[Xe][2];Vi(I,it,pe);for(var Xe=0;Xe<Kt;Xe++){var Jr,en,Tn,En;Xe>1?(Jr=le,en=-2,Tn=A.NORM_TYPE,(pe[0]==A.SHORT_TYPE||pe[1]==A.SHORT_TYPE)&&(Tn=A.SHORT_TYPE),En=L[X][Xe-2]):(Jr=re,en=0,Tn=pe[Xe],En=oe[X][Xe]),Tn==A.SHORT_TYPE?Jr[en+Xe]=Ke(En,ue.masking_lower):Jr[en+Xe]=lt(En,ue.masking_lower),I.analysis&&(ue.pinfo.pe[X][Xe]=Jr[en+Xe])}return 0};function Lr(I,M){var q=I,X;return q>=0?X=-q*27:X=q*M,X<=-72?0:Math.exp(X*G)}function vi(I){var M=0,q=0;{var X=0,oe,L;for(X=0;Lr(X,I)>1e-20;X-=1);for(oe=X,L=0;Math.abs(L-oe)>1e-12;)X=(L+oe)/2,Lr(X,I)>0?L=X:oe=X;M=oe}{var X=0,oe,L;for(X=0;Lr(X,I)>1e-20;X+=1);for(oe=0,L=X;Math.abs(L-oe)>1e-12;)X=(L+oe)/2,Lr(X,I)>0?oe=X:L=X;q=L}{var re=0,le=1e3,te;for(te=0;te<=le;++te){var X=M+te*(q-M)/le,pe=Lr(X,I);re+=pe}{var ue=(le+1)/(re*(q-M));return ue}}}function oo(I){var M,q,X,oe;return M=I,M>=0?M*=3:M*=1.5,M>=.5&&M<=2.5?(oe=M-.5,q=8*(oe*oe-2*oe)):q=0,M+=.474,X=15.811389+7.5*M-17.5*Math.sqrt(1+M*M),X<=-60?0:(M=Math.exp((q+X)*G),M/=.6609193,M)}function hi(I){return I<0&&(I=0),I=I*.001,13*Math.atan(.76*I)+3.5*Math.atan(I*I/(7.5*7.5))}function mu(I,M,q,X,oe,L,re,le,te,pe,ue,ge){var je=qe(A.CBANDS+1),st=le/(ge>15?2*576:2*192),Pe=ht(A.HBLKSIZE),nt;le/=te;var me=0,Ye=0;for(nt=0;nt<A.CBANDS;nt++){var gt,De;for(gt=hi(le*me),je[nt]=le*me,De=me;hi(le*De)-gt<_e&&De<=te/2;De++);for(I[nt]=De-me,Ye=nt+1;me<De;)Se(me<A.HBLKSIZE),Pe[me++]=nt;if(me>te/2){me=te/2,++nt;break}}Se(nt<A.CBANDS),je[nt]=le*me;for(var Qe=0;Qe<ge;Qe++){var Be,it,Kt,Xe,mt;Kt=pe[Qe],Xe=pe[Qe+1],Be=0|Math.floor(.5+ue*(Kt-.5)),Be<0&&(Be=0),it=0|Math.floor(.5+ue*(Xe-.5)),it>te/2&&(it=te/2),q[Qe]=(Pe[Be]+Pe[it])/2,M[Qe]=Pe[it];var St=st*Xe;re[Qe]=(St-je[M[Qe]])/(je[M[Qe]+1]-je[M[Qe]]),re[Qe]<0?re[Qe]=0:re[Qe]>1&&(re[Qe]=1),mt=hi(le*pe[Qe]*ue),mt=Math.min(mt,15.5)/15.5,L[Qe]=Math.pow(10,1.25*(1-Math.cos(Math.PI*mt))-2.5)}me=0;for(var Jt=0;Jt<Ye;Jt++){var Qr=I[Jt],gt,cr;gt=hi(le*me),cr=hi(le*(me+Qr-1)),X[Jt]=.5*(gt+cr),gt=hi(le*(me-.5)),cr=hi(le*(me+Qr-.5)),oe[Jt]=cr-gt,me+=Qr}return Ye}function vu(I,M,q,X,oe,L){var re=ut([A.CBANDS,A.CBANDS]),le,te=0;if(L)for(var pe=0;pe<M;pe++)for(le=0;le<M;le++){var ue=oo(q[pe]-q[le])*X[le];re[pe][le]=ue*oe[pe]}else for(le=0;le<M;le++)for(var ge=15+Math.min(21/q[le],12),je=vi(ge),pe=0;pe<M;pe++){var ue=je*Lr(q[pe]-q[le],ge)*X[le];re[pe][le]=ue*oe[pe]}for(var pe=0;pe<M;pe++){for(le=0;le<M&&!(re[pe][le]>0);le++);for(I[pe][0]=le,le=M-1;le>0&&!(re[pe][le]>0);le--);I[pe][1]=le,te+=I[pe][1]-I[pe][0]+1}for(var st=qe(te),Pe=0,pe=0;pe<M;pe++)for(le=I[pe][0];le<=I[pe][1];le++)st[Pe++]=re[pe][le];return st}function hu(I){var M=hi(I);return M=Math.min(M,15.5)/15.5,Math.pow(10,1.25*(1-Math.cos(Math.PI*M))-2.5)}this.psymodel_init=function(I){var M=I.internal_flags,q,X=!0,oe=13,L=24,re=0,le=0,te=-8.25,pe=-4.5,ue=qe(A.CBANDS),ge=qe(A.CBANDS),je=qe(A.CBANDS),st=I.out_samplerate;switch(I.experimentalZ){default:case 0:X=!0;break;case 1:X=!(I.VBR==xe.vbr_mtrh||I.VBR==xe.vbr_mt);break;case 2:X=!1;break;case 3:oe=8,re=-1.75,le=-.0125,te=-8.25,pe=-2.25;break}for(M.ms_ener_ratio_old=.25,M.blocktype_old[0]=M.blocktype_old[1]=A.NORM_TYPE,q=0;q<4;++q){for(var me=0;me<A.CBANDS;++me)M.nb_1[q][me]=1e20,M.nb_2[q][me]=1e20,M.nb_s1[q][me]=M.nb_s2[q][me]=1;for(var Pe=0;Pe<A.SBMAX_l;Pe++)M.en[q].l[Pe]=1e20,M.thm[q].l[Pe]=1e20;for(var me=0;me<3;++me){for(var Pe=0;Pe<A.SBMAX_s;Pe++)M.en[q].s[Pe][me]=1e20,M.thm[q].s[Pe][me]=1e20;M.nsPsy.lastAttacks[q]=0}for(var me=0;me<9;me++)M.nsPsy.last_en_subshort[q][me]=10}for(M.loudness_sq_save[0]=M.loudness_sq_save[1]=0,M.npart_l=mu(M.numlines_l,M.bo_l,M.bm_l,ue,ge,M.mld_l,M.PSY.bo_l_weight,st,A.BLKSIZE,M.scalefac_band.l,A.BLKSIZE/(2*576),A.SBMAX_l),Se(M.npart_l<A.CBANDS),q=0;q<M.npart_l;q++){var nt=re;ue[q]>=oe&&(nt=le*(ue[q]-oe)/(L-oe)+re*(L-ue[q])/(L-oe)),je[q]=Math.pow(10,nt/10),M.numlines_l[q]>0?M.rnumlines_l[q]=1/M.numlines_l[q]:M.rnumlines_l[q]=0}M.s3_ll=vu(M.s3ind,M.npart_l,ue,ge,je,X);var me=0;for(q=0;q<M.npart_l;q++){var Ye;Ye=ke.MAX_VALUE;for(var gt=0;gt<M.numlines_l[q];gt++,me++){var De=st*me/(1e3*A.BLKSIZE),Qe;Qe=this.ATHformula(De*1e3,I)-20,Qe=Math.pow(10,.1*Qe),Qe*=M.numlines_l[q],Ye>Qe&&(Ye=Qe)}M.ATH.cb_l[q]=Ye,Ye=-20+ue[q]*20/10,Ye>6&&(Ye=100),Ye<-15&&(Ye=-15),Ye-=8,M.minval_l[q]=Math.pow(10,Ye/10)*M.numlines_l[q]}for(M.npart_s=mu(M.numlines_s,M.bo_s,M.bm_s,ue,ge,M.mld_s,M.PSY.bo_s_weight,st,A.BLKSIZE_s,M.scalefac_band.s,A.BLKSIZE_s/(2*192),A.SBMAX_s),Se(M.npart_s<A.CBANDS),me=0,q=0;q<M.npart_s;q++){var Ye,nt=te;ue[q]>=oe&&(nt=pe*(ue[q]-oe)/(L-oe)+te*(L-ue[q])/(L-oe)),je[q]=Math.pow(10,nt/10),Ye=ke.MAX_VALUE;for(var gt=0;gt<M.numlines_s[q];gt++,me++){var De=st*me/(1e3*A.BLKSIZE_s),Qe;Qe=this.ATHformula(De*1e3,I)-20,Qe=Math.pow(10,.1*Qe),Qe*=M.numlines_s[q],Ye>Qe&&(Ye=Qe)}M.ATH.cb_s[q]=Ye,Ye=-7+ue[q]*7/12,ue[q]>12&&(Ye*=1+Math.log(1+Ye)*3.1),ue[q]<12&&(Ye*=1+Math.log(1-Ye)*2.3),Ye<-15&&(Ye=-15),Ye-=8,M.minval_s[q]=Math.pow(10,Ye/10)*M.numlines_s[q]}M.s3_ss=vu(M.s3ind_s,M.npart_s,ue,ge,je,X),h(),B.init_fft(M),M.decay=Math.exp(-1*ne/(Ue*st/192));{var Be;Be=D,(I.exp_nspsytune&2)!=0&&(Be=1),Math.abs(I.msfix)>0&&(Be=I.msfix),I.msfix=Be;for(var it=0;it<M.npart_l;it++)M.s3ind[it][1]>M.npart_l-1&&(M.s3ind[it][1]=M.npart_l-1)}var Kt=576*M.mode_gr/st;if(M.ATH.decay=Math.pow(10,-12/10*Kt),M.ATH.adjust=.01,M.ATH.adjustLimit=1,Se(M.bo_l[A.SBMAX_l-1]<=M.npart_l),Se(M.bo_s[A.SBMAX_s-1]<=M.npart_s),I.ATHtype!=-1){var De,Xe=I.out_samplerate/A.BLKSIZE,mt=0;for(De=0,q=0;q<A.BLKSIZE/2;++q)De+=Xe,M.ATH.eql_w[q]=1/Math.pow(10,this.ATHformula(De,I)/10),mt+=M.ATH.eql_w[q];for(mt=1/mt,q=A.BLKSIZE/2;--q>=0;)M.ATH.eql_w[q]*=mt}{for(var it=me=0;it<M.npart_s;++it)for(q=0;q<M.numlines_s[it];++q)++me;Se(me==129);for(var it=me=0;it<M.npart_l;++it)for(q=0;q<M.numlines_l[it];++q)++me;Se(me==513)}for(me=0,q=0;q<M.npart_l;q++){var De=st*(me+M.numlines_l[q]/2)/(1*A.BLKSIZE);M.mld_cb_l[q]=hu(De),me+=M.numlines_l[q]}for(;q<A.CBANDS;++q)M.mld_cb_l[q]=1;for(me=0,q=0;q<M.npart_s;q++){var De=st*(me+M.numlines_s[q]/2)/(1*A.BLKSIZE_s);M.mld_cb_s[q]=hu(De),me+=M.numlines_s[q]}for(;q<A.CBANDS;++q)M.mld_cb_s[q]=1;return 0};function ha(I,M){I<-.3&&(I=3410),I/=1e3,I=Math.max(.1,I);var q=3.64*Math.pow(I,-.8)-6.8*Math.exp(-.6*Math.pow(I-3.4,2))+6*Math.exp(-.15*Math.pow(I-8.7,2))+(.6+.04*M)*.001*Math.pow(I,4);return q}this.ATHformula=function(I,M){var q;switch(M.ATHtype){case 0:q=ha(I,9);break;case 1:q=ha(I,-1);break;case 2:q=ha(I,0);break;case 3:q=ha(I,1)+6;break;case 4:q=ha(I,M.ATHcurve);break;default:q=ha(I,0);break}return q}}var zt=qt;function Ft(B){var ne=B;this.ordinal=function(){return ne}}Ft.STEREO=new Ft(0),Ft.JOINT_STEREO=new Ft(1),Ft.DUAL_CHANNEL=new Ft(2),Ft.MONO=new Ft(3),Ft.NOT_SET=new Ft(4);var ir=Ft;function lr(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=ir.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}var yn=lr,fa={};fa.SFBMAX=A.SBMAX_s*3;var Un=fa,C0=E.new_float,Jn=E.new_int;function Sf(){this.xr=C0(576),this.l3_enc=Jn(576),this.scalefac=Jn(Un.SFBMAX),this.xrpow_max=0,this.part2_3_length=0,this.big_values=0,this.count1=0,this.global_gain=0,this.scalefac_compress=0,this.block_type=0,this.mixed_block_flag=0,this.table_select=Jn(3),this.subblock_gain=Jn(3+1),this.region0_count=0,this.region1_count=0,this.preflag=0,this.scalefac_scale=0,this.count1table_select=0,this.part2_length=0,this.sfb_lmax=0,this.sfb_smin=0,this.psy_lmax=0,this.sfbmax=0,this.psymax=0,this.sfbdivide=0,this.width=Jn(Un.SFBMAX),this.window=Jn(Un.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=Jn(4),this.max_nonzero_coeff=0;var B=this;function ne(ie){return new Int32Array(ie)}function fe(ie){return new Float32Array(ie)}this.assign=function(ie){B.xr=fe(ie.xr),B.l3_enc=ne(ie.l3_enc),B.scalefac=ne(ie.scalefac),B.xrpow_max=ie.xrpow_max,B.part2_3_length=ie.part2_3_length,B.big_values=ie.big_values,B.count1=ie.count1,B.global_gain=ie.global_gain,B.scalefac_compress=ie.scalefac_compress,B.block_type=ie.block_type,B.mixed_block_flag=ie.mixed_block_flag,B.table_select=ne(ie.table_select),B.subblock_gain=ne(ie.subblock_gain),B.region0_count=ie.region0_count,B.region1_count=ie.region1_count,B.preflag=ie.preflag,B.scalefac_scale=ie.scalefac_scale,B.count1table_select=ie.count1table_select,B.part2_length=ie.part2_length,B.sfb_lmax=ie.sfb_lmax,B.sfb_smin=ie.sfb_smin,B.psy_lmax=ie.psy_lmax,B.sfbmax=ie.sfbmax,B.psymax=ie.psymax,B.sfbdivide=ie.sfbdivide,B.width=ne(ie.width),B.window=ne(ie.window),B.count1bits=ie.count1bits,B.sfb_partition_table=ie.sfb_partition_table.slice(0),B.slen=ne(ie.slen),B.max_nonzero_coeff=ie.max_nonzero_coeff}}var Qo=Sf,Jc=E.new_int;function yf(){this.tt=[[null,null],[null,null]],this.main_data_begin=0,this.private_bits=0,this.resvDrain_pre=0,this.resvDrain_post=0,this.scfsi=[Jc(4),Jc(4)];for(var B=0;B<2;B++)for(var ne=0;ne<2;ne++)this.tt[B][ne]=new Qo}var xf=yf,Jo=E.System,es=E.new_int;function wf(B,ne,fe,ie){this.l=es(1+A.SBMAX_l),this.s=es(1+A.SBMAX_s),this.psfb21=es(1+A.PSFB21),this.psfb12=es(1+A.PSFB12);var Ae=this.l,ae=this.s;arguments.length==4&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],Jo.arraycopy(this.arrL,0,Ae,0,Math.min(this.arrL.length,this.l.length)),Jo.arraycopy(this.arrS,0,ae,0,Math.min(this.arrS.length,this.s.length)),Jo.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),Jo.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}var Hn=wf,I0=E.new_float,Rf=E.new_float_n,Tf=E.new_int;function Ef(){this.last_en_subshort=Rf([4,9]),this.lastAttacks=Tf(4),this.pefirbuf=I0(19),this.longfact=I0(A.SBMAX_l),this.shortfact=I0(A.SBMAX_s),this.attackthre=0,this.attackthre_s=0}var Af=Ef;function Cf(){this.sum=0,this.seen=0,this.want=0,this.pos=0,this.size=0,this.bag=null,this.nVbrNumFrames=0,this.nBytesWritten=0,this.TotalFrameSize=0}var If=Cf,Mf=E.new_byte,Pf=E.new_double,dn=E.new_float,Li=E.new_float_n,xn=E.new_int,ts=E.new_int_n;ei.MFSIZE=3*1152+A.ENCDELAY-A.MDCTDELAY,ei.MAX_HEADER_BUF=256,ei.MAX_BITS_PER_CHANNEL=4095,ei.MAX_BITS_PER_GRANULE=7680,ei.BPC=320;function ei(){var B=40;this.Class_ID=0,this.lame_encode_frame_init=0,this.iteration_init_init=0,this.fill_buffer_resample_init=0,this.mfbuf=Li([2,ei.MFSIZE]),this.mode_gr=0,this.channels_in=0,this.channels_out=0,this.resample_ratio=0,this.mf_samples_to_encode=0,this.mf_size=0,this.VBR_min_bitrate=0,this.VBR_max_bitrate=0,this.bitrate_index=0,this.samplerate_index=0,this.mode_ext=0,this.lowpass1=0,this.lowpass2=0,this.highpass1=0,this.highpass2=0,this.noise_shaping=0,this.noise_shaping_amp=0,this.substep_shaping=0,this.psymodel=0,this.noise_shaping_stop=0,this.subblock_gain=0,this.use_best_huffman=0,this.full_outer_loop=0,this.l3_side=new xf,this.ms_ratio=dn(2),this.padding=0,this.frac_SpF=0,this.slot_lag=0,this.tag_spec=null,this.nMusicCRC=0,this.OldValue=xn(2),this.CurrentStep=xn(2),this.masking_lower=0,this.bv_scf=xn(576),this.pseudohalf=xn(Un.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*ei.BPC+1),this.itime=Pf(2),this.sideinfo_len=0,this.sb_sample=Li([2,2,18,A.SBLIMIT]),this.amp_filter=dn(32);function ne(){this.write_timing=0,this.ptr=0,this.buf=Mf(B)}this.header=new Array(ei.MAX_HEADER_BUF),this.h_ptr=0,this.w_ptr=0,this.ancillary_flag=0,this.ResvSize=0,this.ResvMax=0,this.scalefac_band=new Hn,this.minval_l=dn(A.CBANDS),this.minval_s=dn(A.CBANDS),this.nb_1=Li([4,A.CBANDS]),this.nb_2=Li([4,A.CBANDS]),this.nb_s1=Li([4,A.CBANDS]),this.nb_s2=Li([4,A.CBANDS]),this.s3_ss=null,this.s3_ll=null,this.decay=0,this.thm=new Array(4),this.en=new Array(4),this.tot_ener=dn(4),this.loudness_sq=Li([2,2]),this.loudness_sq_save=dn(2),this.mld_l=dn(A.SBMAX_l),this.mld_s=dn(A.SBMAX_s),this.bm_l=xn(A.SBMAX_l),this.bo_l=xn(A.SBMAX_l),this.bm_s=xn(A.SBMAX_s),this.bo_s=xn(A.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=ts([A.CBANDS,2]),this.s3ind_s=ts([A.CBANDS,2]),this.numlines_s=xn(A.CBANDS),this.numlines_l=xn(A.CBANDS),this.rnumlines_l=dn(A.CBANDS),this.mld_cb_l=dn(A.CBANDS),this.mld_cb_s=dn(A.CBANDS),this.numlines_s_num1=0,this.numlines_l_num1=0,this.pe=dn(4),this.ms_ratio_s_old=0,this.ms_ratio_l_old=0,this.ms_ener_ratio_old=0,this.blocktype_old=xn(2),this.nsPsy=new Af,this.VBR_seek_table=new If,this.ATH=null,this.PSY=null,this.nogap_total=0,this.nogap_current=0,this.decode_on_the_fly=!0,this.findReplayGain=!0,this.findPeakSample=!0,this.PeakSample=0,this.RadioGain=0,this.AudiophileGain=0,this.rgdata=null,this.noclipGainChange=0,this.noclipScale=0,this.bitrate_stereoMode_Hist=ts([16,4+1]),this.bitrate_blockType_Hist=ts([16,4+1+1]),this.pinfo=null,this.hip=null,this.in_buffer_nsamples=0,this.in_buffer_0=null,this.in_buffer_1=null,this.iteration_loop=null;for(var fe=0;fe<this.en.length;fe++)this.en[fe]=new yt;for(var fe=0;fe<this.thm.length;fe++)this.thm[fe]=new yt;for(var fe=0;fe<this.header.length;fe++)this.header[fe]=new ne}var jt=ei,Ni=E.new_float;function Bf(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=Ni(A.SBMAX_l),this.s=Ni(A.SBMAX_s),this.psfb21=Ni(A.PSFB21),this.psfb12=Ni(A.PSFB12),this.cb_l=Ni(A.CBANDS),this.cb_s=Ni(A.CBANDS),this.eql_w=Ni(A.BLKSIZE/2)}var kf=Bf,qr=E.System,eu=E.Arrays;$t.STEPS_per_dB=100,$t.MAX_dB=120,$t.GAIN_NOT_ENOUGH_SAMPLES=-24601,$t.GAIN_ANALYSIS_ERROR=0,$t.GAIN_ANALYSIS_OK=1,$t.INIT_GAIN_ANALYSIS_ERROR=0,$t.INIT_GAIN_ANALYSIS_OK=1,$t.YULE_ORDER=10,$t.MAX_ORDER=$t.YULE_ORDER,$t.MAX_SAMP_FREQ=48e3,$t.RMS_WINDOW_TIME_NUMERATOR=1,$t.RMS_WINDOW_TIME_DENOMINATOR=20,$t.MAX_SAMPLES_PER_WINDOW=$t.MAX_SAMP_FREQ*$t.RMS_WINDOW_TIME_NUMERATOR/$t.RMS_WINDOW_TIME_DENOMINATOR+1;function $t(){var B=64.82,ne=$t.YULE_ORDER,fe=.95,ie=$t.MAX_SAMP_FREQ,Ae=$t.RMS_WINDOW_TIME_NUMERATOR,ae=$t.RMS_WINDOW_TIME_DENOMINATOR,_e=$t.MAX_SAMPLES_PER_WINDOW,Fe=[[.038575994352,-3.84664617118067,-.02160367184185,7.81501653005538,-.00123395316851,-11.34170355132042,-9291677959e-14,13.05504219327545,-.01655260341619,-12.28759895145294,.02161526843274,9.4829380631979,-.02074045215285,-5.87257861775999,.00594298065125,2.75465861874613,.00306428023191,-.86984376593551,.00012025322027,.13919314567432,.00288463683916],[.0541865640643,-3.47845948550071,-.02911007808948,6.36317777566148,-.00848709379851,-8.54751527471874,-.00851165645469,9.4769360780128,-.00834990904936,-8.81498681370155,.02245293253339,6.85401540936998,-.02596338512915,-4.39470996079559,.01624864962975,2.19611684890774,-.00240879051584,-.75104302451432,.00674613682247,.13149317958808,-.00187763777362],[.15457299681924,-2.37898834973084,-.09331049056315,2.84868151156327,-.06247880153653,-2.64577170229825,.02163541888798,2.23697657451713,-.05588393329856,-1.67148153367602,.04781476674921,1.00595954808547,.00222312597743,-.45953458054983,.03174092540049,.16378164858596,-.01390589421898,-.05032077717131,.00651420667831,.0234789740702,-.00881362733839],[.30296907319327,-1.61273165137247,-.22613988682123,1.0797749225997,-.08587323730772,-.2565625775407,.03282930172664,-.1627671912044,-.00915702933434,-.22638893773906,-.02364141202522,.39120800788284,-.00584456039913,-.22138138954925,.06276101321749,.04500235387352,-828086748e-14,.02005851806501,.00205861885564,.00302439095741,-.02950134983287],[.33642304856132,-1.49858979367799,-.2557224142557,.87350271418188,-.11828570177555,.12205022308084,.11921148675203,-.80774944671438,-.07834489609479,.47854794562326,-.0046997791438,-.12453458140019,-.0058950022444,-.04067510197014,.05724228140351,.08333755284107,.00832043980773,-.04237348025746,-.0163538138454,.02977207319925,-.0176017656815],[.4491525660845,-.62820619233671,-.14351757464547,.29661783706366,-.22784394429749,-.372563729424,-.01419140100551,.00213767857124,.04078262797139,-.42029820170918,-.12398163381748,.22199650564824,.04097565135648,.00613424350682,.10478503600251,.06747620744683,-.01863887810927,.05784820375801,-.03193428438915,.03222754072173,.00541907748707],[.56619470757641,-1.04800335126349,-.75464456939302,.29156311971249,.1624213774223,-.26806001042947,.16744243493672,.00819999645858,-.18901604199609,.45054734505008,.3093178284183,-.33032403314006,-.27562961986224,.0673936833311,.00647310677246,-.04784254229033,.08647503780351,.01639907836189,-.0378898455484,.01807364323573,-.00588215443421],[.58100494960553,-.51035327095184,-.53174909058578,-.31863563325245,-.14289799034253,-.20256413484477,.17520704835522,.1472815413433,.02377945217615,.38952639978999,.15558449135573,-.23313271880868,-.25344790059353,-.05246019024463,.01628462406333,-.02505961724053,.06920467763959,.02442357316099,-.03721611395801,.01818801111503,-.00749618797172],[.53648789255105,-.2504987195602,-.42163034350696,-.43193942311114,-.00275953611929,-.03424681017675,.04267842219415,-.04678328784242,-.10214864179676,.26408300200955,.14590772289388,.15113130533216,-.02459864859345,-.17556493366449,-.11202315195388,-.18823009262115,-.04060034127,.05477720428674,.0478866554818,.0470440968812,-.02217936801134]],Ue=[[.98621192462708,-1.97223372919527,-1.97242384925416,.97261396931306,.98621192462708],[.98500175787242,-1.96977855582618,-1.97000351574484,.9702284756635,.98500175787242],[.97938932735214,-1.95835380975398,-1.95877865470428,.95920349965459,.97938932735214],[.97531843204928,-1.95002759149878,-1.95063686409857,.95124613669835,.97531843204928],[.97316523498161,-1.94561023566527,-1.94633046996323,.94705070426118,.97316523498161],[.96454515552826,-1.92783286977036,-1.92909031105652,.93034775234268,.96454515552826],[.96009142950541,-1.91858953033784,-1.92018285901082,.92177618768381,.96009142950541],[.95856916599601,-1.9154210807478,-1.91713833199203,.91885558323625,.95856916599601],[.94597685600279,-1.88903307939452,-1.89195371200558,.89487434461664,.94597685600279]];function $(s,P,G,F,b,_){for(;b--!=0;)G[F]=1e-10+s[P+0]*_[0]-G[F-1]*_[1]+s[P-1]*_[2]-G[F-2]*_[3]+s[P-2]*_[4]-G[F-3]*_[5]+s[P-3]*_[6]-G[F-4]*_[7]+s[P-4]*_[8]-G[F-5]*_[9]+s[P-5]*_[10]-G[F-6]*_[11]+s[P-6]*_[12]-G[F-7]*_[13]+s[P-7]*_[14]-G[F-8]*_[15]+s[P-8]*_[16]-G[F-9]*_[17]+s[P-9]*_[18]-G[F-10]*_[19]+s[P-10]*_[20],++F,++P}function he(s,P,G,F,b,_){for(;b--!=0;)G[F]=s[P+0]*_[0]-G[F-1]*_[1]+s[P-1]*_[2]-G[F-2]*_[3]+s[P-2]*_[4],++F,++P}function be(s,P){for(var G=0;G<MAX_ORDER;G++)s.linprebuf[G]=s.lstepbuf[G]=s.loutbuf[G]=s.rinprebuf[G]=s.rstepbuf[G]=s.routbuf[G]=0;switch(0|P){case 48e3:s.reqindex=0;break;case 44100:s.reqindex=1;break;case 32e3:s.reqindex=2;break;case 24e3:s.reqindex=3;break;case 22050:s.reqindex=4;break;case 16e3:s.reqindex=5;break;case 12e3:s.reqindex=6;break;case 11025:s.reqindex=7;break;case 8e3:s.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return s.sampleWindow=0|(P*Ae+ae-1)/ae,s.lsum=0,s.rsum=0,s.totsamp=0,eu.ill(s.A,0),INIT_GAIN_ANALYSIS_OK}this.InitGainAnalysis=function(s,P){return be(s,P)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(s.linpre=MAX_ORDER,s.rinpre=MAX_ORDER,s.lstep=MAX_ORDER,s.rstep=MAX_ORDER,s.lout=MAX_ORDER,s.rout=MAX_ORDER,eu.fill(s.B,0),INIT_GAIN_ANALYSIS_OK)};function D(s){return s*s}this.AnalyzeSamples=function(s,P,G,F,b,_,N){var W,C,f,O,R,m,h;if(_==0)return GAIN_ANALYSIS_OK;switch(h=0,R=_,N){case 1:F=P,b=G;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(_<MAX_ORDER?(qr.arraycopy(P,G,s.linprebuf,MAX_ORDER,_),qr.arraycopy(F,b,s.rinprebuf,MAX_ORDER,_)):(qr.arraycopy(P,G,s.linprebuf,MAX_ORDER,MAX_ORDER),qr.arraycopy(F,b,s.rinprebuf,MAX_ORDER,MAX_ORDER));R>0;){m=R>s.sampleWindow-s.totsamp?s.sampleWindow-s.totsamp:R,h<MAX_ORDER?(W=s.linpre+h,C=s.linprebuf,f=s.rinpre+h,O=s.rinprebuf,m>MAX_ORDER-h&&(m=MAX_ORDER-h)):(W=G+h,C=P,f=b+h,O=F),$(C,W,s.lstepbuf,s.lstep+s.totsamp,m,Fe[s.reqindex]),$(O,f,s.rstepbuf,s.rstep+s.totsamp,m,Fe[s.reqindex]),he(s.lstepbuf,s.lstep+s.totsamp,s.loutbuf,s.lout+s.totsamp,m,Ue[s.reqindex]),he(s.rstepbuf,s.rstep+s.totsamp,s.routbuf,s.rout+s.totsamp,m,Ue[s.reqindex]),W=s.lout+s.totsamp,C=s.loutbuf,f=s.rout+s.totsamp,O=s.routbuf;for(var S=m%8;S--!=0;)s.lsum+=D(C[W++]),s.rsum+=D(O[f++]);for(S=m/8;S--!=0;)s.lsum+=D(C[W+0])+D(C[W+1])+D(C[W+2])+D(C[W+3])+D(C[W+4])+D(C[W+5])+D(C[W+6])+D(C[W+7]),W+=8,s.rsum+=D(O[f+0])+D(O[f+1])+D(O[f+2])+D(O[f+3])+D(O[f+4])+D(O[f+5])+D(O[f+6])+D(O[f+7]),f+=8;if(R-=m,h+=m,s.totsamp+=m,s.totsamp==s.sampleWindow){var u=$t.STEPS_per_dB*10*Math.log10((s.lsum+s.rsum)/s.totsamp*.5+1e-37),p=u<=0?0:0|u;p>=s.A.length&&(p=s.A.length-1),s.A[p]++,s.lsum=s.rsum=0,qr.arraycopy(s.loutbuf,s.totsamp,s.loutbuf,0,MAX_ORDER),qr.arraycopy(s.routbuf,s.totsamp,s.routbuf,0,MAX_ORDER),qr.arraycopy(s.lstepbuf,s.totsamp,s.lstepbuf,0,MAX_ORDER),qr.arraycopy(s.rstepbuf,s.totsamp,s.rstepbuf,0,MAX_ORDER),s.totsamp=0}if(s.totsamp>s.sampleWindow)return GAIN_ANALYSIS_ERROR}return _<MAX_ORDER?(qr.arraycopy(s.linprebuf,_,s.linprebuf,0,MAX_ORDER-_),qr.arraycopy(s.rinprebuf,_,s.rinprebuf,0,MAX_ORDER-_),qr.arraycopy(P,G,s.linprebuf,MAX_ORDER-_,_),qr.arraycopy(F,b,s.rinprebuf,MAX_ORDER-_,_)):(qr.arraycopy(P,G+_-MAX_ORDER,s.linprebuf,0,MAX_ORDER),qr.arraycopy(F,b+_-MAX_ORDER,s.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK};function ee(s,P){var G,F=0;for(G=0;G<P;G++)F+=s[G];if(F==0)return GAIN_NOT_ENOUGH_SAMPLES;var b=0|Math.ceil(F*(1-fe));for(G=P;G-- >0&&!((b-=s[G])<=0););return B-G/$t.STEPS_per_dB}this.GetTitleGain=function(s){for(var P=ee(s.A,s.A.length),G=0;G<s.A.length;G++)s.B[G]+=s.A[G],s.A[G]=0;for(var G=0;G<MAX_ORDER;G++)s.linprebuf[G]=s.lstepbuf[G]=s.loutbuf[G]=s.rinprebuf[G]=s.rstepbuf[G]=s.routbuf[G]=0;return s.totsamp=0,s.lsum=s.rsum=0,P}}var Dr=$t,ma=E.new_float,tu=E.new_int;function Df(){this.linprebuf=ma(Dr.MAX_ORDER*2),this.linpre=0,this.lstepbuf=ma(Dr.MAX_SAMPLES_PER_WINDOW+Dr.MAX_ORDER),this.lstep=0,this.loutbuf=ma(Dr.MAX_SAMPLES_PER_WINDOW+Dr.MAX_ORDER),this.lout=0,this.rinprebuf=ma(Dr.MAX_ORDER*2),this.rinpre=0,this.rstepbuf=ma(Dr.MAX_SAMPLES_PER_WINDOW+Dr.MAX_ORDER),this.rstep=0,this.routbuf=ma(Dr.MAX_SAMPLES_PER_WINDOW+Dr.MAX_ORDER),this.rout=0,this.sampleWindow=0,this.totsamp=0,this.lsum=0,this.rsum=0,this.freqindex=0,this.first=0,this.A=tu(0|Dr.STEPS_per_dB*Dr.MAX_dB),this.B=tu(0|Dr.STEPS_per_dB*Dr.MAX_dB)}var Lf=Df;function Nf(B){this.bits=B}var ru=Nf,nu=E.new_float,Ff=E.new_int,iu=E.assert;function Of(B){var ne=B;this.quantize=ne,this.iteration_loop=function(fe,ie,Ae,ae){var _e=fe.internal_flags,Fe=nu(Un.SFBMAX),Ue=nu(576),$=Ff(2),he=0,be,D=_e.l3_side,ee=new ru(he);this.quantize.rv.ResvFrameBegin(fe,ee),he=ee.bits;for(var s=0;s<_e.mode_gr;s++){be=this.quantize.qupvt.on_pe(fe,ie,$,he,s,s),_e.mode_ext==A.MPG_MD_MS_LR&&(this.quantize.ms_convert(_e.l3_side,s),this.quantize.qupvt.reduce_side($,Ae[s],he,be));for(var P=0;P<_e.channels_out;P++){var G,F,b=D.tt[s][P];b.block_type!=A.SHORT_TYPE?(G=0,F=_e.PSY.mask_adjust-G):(G=0,F=_e.PSY.mask_adjust_short-G),_e.masking_lower=Math.pow(10,F*.1),this.quantize.init_outer_loop(_e,b),this.quantize.init_xrpow(_e,b,Ue)&&(this.quantize.qupvt.calc_xmin(fe,ae[s][P],b,Fe),this.quantize.outer_loop(fe,b,Fe,Ue,P,$[P])),this.quantize.iteration_finish_one(_e,s,P),iu(b.part2_3_length<=jt.MAX_BITS_PER_CHANNEL),iu(b.part2_3_length<=$[P])}}this.quantize.rv.ResvFrameEnd(_e,he)}}var Uf=Of;function Bt(B,ne,fe,ie){this.xlen=B,this.linmax=ne,this.table=fe,this.hlen=ie}var Le={};Le.t1HB=[1,1,1,0],Le.t2HB=[1,2,1,3,1,1,3,2,0],Le.t3HB=[3,2,1,1,1,1,3,2,0],Le.t5HB=[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],Le.t6HB=[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],Le.t7HB=[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],Le.t8HB=[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],Le.t9HB=[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],Le.t10HB=[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],Le.t11HB=[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],Le.t12HB=[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],Le.t13HB=[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],Le.t15HB=[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],Le.t16HB=[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],Le.t24HB=[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],Le.t32HB=[1<<0,5<<1,4<<1,5<<2,6<<1,5<<2,4<<2,4<<3,7<<1,3<<2,6<<2,0<<3,7<<2,2<<3,3<<3,1<<4],Le.t33HB=[15<<0,14<<1,13<<1,12<<2,11<<1,10<<2,9<<2,8<<3,7<<1,6<<2,5<<2,4<<3,3<<2,2<<3,1<<3,0<<4],Le.t1l=[1,4,3,5],Le.t2l=[1,4,7,4,5,7,6,7,8],Le.t3l=[2,3,7,4,4,7,6,7,8],Le.t5l=[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],Le.t6l=[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],Le.t7l=[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],Le.t8l=[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],Le.t9l=[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],Le.t10l=[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],Le.t11l=[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],Le.t12l=[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],Le.t13l=[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],Le.t15l=[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],Le.t16_5l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],Le.t16l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],Le.t24l=[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],Le.t32l=[1+0,4+1,4+1,5+2,4+1,6+2,5+2,6+3,4+1,5+2,5+2,6+3,5+2,6+3,6+3,6+4],Le.t33l=[4+0,4+1,4+1,4+2,4+1,4+2,4+2,4+3,4+1,4+2,4+2,4+3,4+2,4+3,4+3,4+4],Le.ht=[new Bt(0,0,null,null),new Bt(2,0,Le.t1HB,Le.t1l),new Bt(3,0,Le.t2HB,Le.t2l),new Bt(3,0,Le.t3HB,Le.t3l),new Bt(0,0,null,null),new Bt(4,0,Le.t5HB,Le.t5l),new Bt(4,0,Le.t6HB,Le.t6l),new Bt(6,0,Le.t7HB,Le.t7l),new Bt(6,0,Le.t8HB,Le.t8l),new Bt(6,0,Le.t9HB,Le.t9l),new Bt(8,0,Le.t10HB,Le.t10l),new Bt(8,0,Le.t11HB,Le.t11l),new Bt(8,0,Le.t12HB,Le.t12l),new Bt(16,0,Le.t13HB,Le.t13l),new Bt(0,0,null,Le.t16_5l),new Bt(16,0,Le.t15HB,Le.t15l),new Bt(1,1,Le.t16HB,Le.t16l),new Bt(2,3,Le.t16HB,Le.t16l),new Bt(3,7,Le.t16HB,Le.t16l),new Bt(4,15,Le.t16HB,Le.t16l),new Bt(6,63,Le.t16HB,Le.t16l),new Bt(8,255,Le.t16HB,Le.t16l),new Bt(10,1023,Le.t16HB,Le.t16l),new Bt(13,8191,Le.t16HB,Le.t16l),new Bt(4,15,Le.t24HB,Le.t24l),new Bt(5,31,Le.t24HB,Le.t24l),new Bt(6,63,Le.t24HB,Le.t24l),new Bt(7,127,Le.t24HB,Le.t24l),new Bt(8,255,Le.t24HB,Le.t24l),new Bt(9,511,Le.t24HB,Le.t24l),new Bt(11,2047,Le.t24HB,Le.t24l),new Bt(13,8191,Le.t24HB,Le.t24l),new Bt(0,0,Le.t32HB,Le.t32l),new Bt(0,0,Le.t33HB,Le.t33l)],Le.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],Le.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],Le.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],Le.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],Le.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],Le.scfsi_band=[0,6,11,16,21];var It=Le,Fi=E.VbrMode,rs=E.Float,M0=E.Util,Oi=E.new_float,Hf=E.new_int,ti=E.assert;$r.Q_MAX=256+1,$r.Q_MAX2=116,$r.LARGE_BITS=1e5,$r.IXMAX_VAL=8206;function $r(){var B=null,ne=null,fe=null;this.setModules=function(_,N,W){B=_,ne=N,fe=W};function ie(_){return ti(0<=_+$r.Q_MAX2&&_<$r.Q_MAX),D[_+$r.Q_MAX2]}this.IPOW20=function(_){return ti(0<=_&&_<$r.Q_MAX),ee[_]};var Ae=2220446049250313e-31,ae=$r.IXMAX_VAL,_e=ae+2,Fe=$r.Q_MAX,Ue=$r.Q_MAX2,$=$r.LARGE_BITS,he=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var be=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=be,this.sfBandIndex=[new Hn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Hn([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Hn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Hn([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Hn([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Hn([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Hn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Hn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Hn([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0/3,24/3,48/3,72/3,108/3,156/3,216/3,288/3,372/3,480/3,486/3,492/3,498/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var D=Oi(Fe+Ue+1),ee=Oi(Fe),s=Oi(_e),P=Oi(_e);this.adj43=P;function G(_,N){var W=fe.ATHformula(N,_);return W-=he,W=Math.pow(10,W/10+_.ATHlower),W}function F(_){for(var N=_.internal_flags.ATH.l,W=_.internal_flags.ATH.psfb21,C=_.internal_flags.ATH.s,f=_.internal_flags.ATH.psfb12,O=_.internal_flags,R=_.out_samplerate,m=0;m<A.SBMAX_l;m++){var h=O.scalefac_band.l[m],S=O.scalefac_band.l[m+1];N[m]=rs.MAX_VALUE;for(var u=h;u<S;u++){var p=u*R/1152,y=G(_,p);N[m]=Math.min(N[m],y)}}for(var m=0;m<A.PSFB21;m++){var h=O.scalefac_band.psfb21[m],S=O.scalefac_band.psfb21[m+1];W[m]=rs.MAX_VALUE;for(var u=h;u<S;u++){var p=u*R/1152,y=G(_,p);W[m]=Math.min(W[m],y)}}for(var m=0;m<A.SBMAX_s;m++){var h=O.scalefac_band.s[m],S=O.scalefac_band.s[m+1];C[m]=rs.MAX_VALUE;for(var u=h;u<S;u++){var p=u*R/384,y=G(_,p);C[m]=Math.min(C[m],y)}C[m]*=O.scalefac_band.s[m+1]-O.scalefac_band.s[m]}for(var m=0;m<A.PSFB12;m++){var h=O.scalefac_band.psfb12[m],S=O.scalefac_band.psfb12[m+1];f[m]=rs.MAX_VALUE;for(var u=h;u<S;u++){var p=u*R/384,y=G(_,p);f[m]=Math.min(f[m],y)}f[m]*=O.scalefac_band.s[13]-O.scalefac_band.s[12]}if(_.noATH){for(var m=0;m<A.SBMAX_l;m++)N[m]=1e-20;for(var m=0;m<A.PSFB21;m++)W[m]=1e-20;for(var m=0;m<A.SBMAX_s;m++)C[m]=1e-20;for(var m=0;m<A.PSFB12;m++)f[m]=1e-20}O.ATH.floor=10*Math.log10(G(_,-1))}this.iteration_init=function(_){var N=_.internal_flags,W=N.l3_side,C;if(N.iteration_init_init==0){for(N.iteration_init_init=1,W.main_data_begin=0,F(_),s[0]=0,C=1;C<_e;C++)s[C]=Math.pow(C,4/3);for(C=0;C<_e-1;C++)P[C]=C+1-Math.pow(.5*(s[C]+s[C+1]),.75);for(P[C]=.5,C=0;C<Fe;C++)ee[C]=Math.pow(2,(C-210)*-.1875);for(C=0;C<=Fe+Ue;C++)D[C]=Math.pow(2,(C-210-Ue)*.25);B.huffman_init(N);{var f,O,R,m;for(C=_.exp_nspsytune>>2&63,C>=32&&(C-=64),f=Math.pow(10,C/4/10),C=_.exp_nspsytune>>8&63,C>=32&&(C-=64),O=Math.pow(10,C/4/10),C=_.exp_nspsytune>>14&63,C>=32&&(C-=64),R=Math.pow(10,C/4/10),C=_.exp_nspsytune>>20&63,C>=32&&(C-=64),m=R*Math.pow(10,C/4/10),C=0;C<A.SBMAX_l;C++){var h;C<=6?h=f:C<=13?h=O:C<=20?h=R:h=m,N.nsPsy.longfact[C]=h}for(C=0;C<A.SBMAX_s;C++){var h;C<=5?h=f:C<=10?h=O:C<=11?h=R:h=m,N.nsPsy.shortfact[C]=h}}}},this.on_pe=function(_,N,W,C,f,O){var R=_.internal_flags,m=0,h,S=Hf(2),u,p=new ru(m),y=ne.ResvMaxBits(_,C,p,O);m=p.bits;var T=m+y;for(T>jt.MAX_BITS_PER_GRANULE&&(T=jt.MAX_BITS_PER_GRANULE),h=0,u=0;u<R.channels_out;++u)W[u]=Math.min(jt.MAX_BITS_PER_CHANNEL,m/R.channels_out),S[u]=0|W[u]*N[f][u]/700-W[u],S[u]>C*3/4&&(S[u]=C*3/4),S[u]<0&&(S[u]=0),S[u]+W[u]>jt.MAX_BITS_PER_CHANNEL&&(S[u]=Math.max(0,jt.MAX_BITS_PER_CHANNEL-W[u])),h+=S[u];if(h>y)for(u=0;u<R.channels_out;++u)S[u]=y*S[u]/h;for(u=0;u<R.channels_out;++u)W[u]+=S[u],y-=S[u];for(h=0,u=0;u<R.channels_out;++u)h+=W[u];if(h>jt.MAX_BITS_PER_GRANULE){var Q=0;for(u=0;u<R.channels_out;++u)W[u]*=jt.MAX_BITS_PER_GRANULE,W[u]/=h,Q+=W[u];ti(Q<=jt.MAX_BITS_PER_GRANULE)}return T},this.reduce_side=function(_,N,W,C){ti(C<=jt.MAX_BITS_PER_GRANULE),ti(_[0]+_[1]<=jt.MAX_BITS_PER_GRANULE);var f=.33*(.5-N)/.5;f<0&&(f=0),f>.5&&(f=.5);var O=0|f*.5*(_[0]+_[1]);O>jt.MAX_BITS_PER_CHANNEL-_[0]&&(O=jt.MAX_BITS_PER_CHANNEL-_[0]),O<0&&(O=0),_[1]>=125&&(_[1]-O>125?(_[0]<W&&(_[0]+=O),_[1]-=O):(_[0]+=_[1]-125,_[1]=125)),O=_[0]+_[1],O>C&&(_[0]=C*_[0]/O,_[1]=C*_[1]/O),ti(_[0]<=jt.MAX_BITS_PER_CHANNEL),ti(_[1]<=jt.MAX_BITS_PER_CHANNEL),ti(_[0]+_[1]<=jt.MAX_BITS_PER_GRANULE)},this.athAdjust=function(_,N,W){var C=90.30873362,f=94.82444863,O=M0.FAST_LOG10_X(N,10),R=_*_,m=0;return O-=W,R>1e-20&&(m=1+M0.FAST_LOG10_X(R,10/C)),m<0&&(m=0),O*=m,O+=W+C-f,Math.pow(10,.1*O)},this.calc_xmin=function(_,N,W,C){var f=0,O=_.internal_flags,R,m=0,h=0,S=O.ATH,u=W.xr,p=_.VBR==Fi.vbr_mtrh?1:0,y=O.masking_lower;for((_.VBR==Fi.vbr_mtrh||_.VBR==Fi.vbr_mt)&&(y=1),R=0;R<W.psy_lmax;R++){var T,Q,j,Y,we,v;_.VBR==Fi.vbr_rh||_.VBR==Fi.vbr_mtrh?Q=athAdjust(S.adjust,S.l[R],S.floor):Q=S.adjust*S.l[R],we=W.width[R],j=Q/we,Y=Ae,v=we>>1,T=0;do{var g,ve;g=u[m]*u[m],T+=g,Y+=g<j?g:j,m++,ve=u[m]*u[m],T+=ve,Y+=ve<j?ve:j,m++}while(--v>0);if(T>Q&&h++,R==A.SBPSY_l){var ye=Q*O.nsPsy.longfact[R];Y<ye&&(Y=ye)}if(p!=0&&(Q=Y),!_.ATHonly){var He=N.en.l[R];if(He>0){var ye;ye=T*N.thm.l[R]*y/He,p!=0&&(ye*=O.nsPsy.longfact[R]),Q<ye&&(Q=ye)}}p!=0?C[f++]=Q:C[f++]=Q*O.nsPsy.longfact[R]}var ze=575;if(W.block_type!=A.SHORT_TYPE)for(var Ke=576;Ke--!=0&&ri.EQ(u[Ke],0);)ze=Ke;W.max_nonzero_coeff=ze;for(var We=W.sfb_smin;R<W.psymax;We++,R+=3){var we,lt,Ze;for(_.VBR==Fi.vbr_rh||_.VBR==Fi.vbr_mtrh?Ze=athAdjust(S.adjust,S.s[We],S.floor):Ze=S.adjust*S.s[We],we=W.width[R],lt=0;lt<3;lt++){var T=0,Q,j,Y,v=we>>1;j=Ze/we,Y=Ae;do{var g,ve;g=u[m]*u[m],T+=g,Y+=g<j?g:j,m++,ve=u[m]*u[m],T+=ve,Y+=ve<j?ve:j,m++}while(--v>0);if(T>Ze&&h++,We==A.SBPSY_s){var ye=Ze*O.nsPsy.shortfact[We];Y<ye&&(Y=ye)}if(p!=0?Q=Y:Q=Ze,!_.ATHonly&&!_.ATHshort){var He=N.en.s[We][lt];if(He>0){var ye;ye=T*N.thm.s[We][lt]*y/He,p!=0&&(ye*=O.nsPsy.shortfact[We]),Q<ye&&(Q=ye)}}p!=0?C[f++]=Q:C[f++]=Q*O.nsPsy.shortfact[We]}_.useTemporal&&(C[f-3]>C[f-3+1]&&(C[f-3+1]+=(C[f-3]-C[f-3+1])*O.decay),C[f-3+1]>C[f-3+2]&&(C[f-3+2]+=(C[f-3+1]-C[f-3+2])*O.decay))}return h};function b(_){this.s=_}this.calc_noise_core=function(_,N,W,C){var f=0,O=N.s,R=_.l3_enc;if(O>_.count1)for(;W--!=0;){var m;m=_.xr[O],O++,f+=m*m,m=_.xr[O],O++,f+=m*m}else if(O>_.big_values){var h=Oi(2);for(h[0]=0,h[1]=C;W--!=0;){var m;m=Math.abs(_.xr[O])-h[R[O]],O++,f+=m*m,m=Math.abs(_.xr[O])-h[R[O]],O++,f+=m*m}}else for(;W--!=0;){var m;m=Math.abs(_.xr[O])-s[R[O]]*C,O++,f+=m*m,m=Math.abs(_.xr[O])-s[R[O]]*C,O++,f+=m*m}return N.s=O,f},this.calc_noise=function(_,N,W,C,f){var O=0,R=0,m,h,S=0,u=0,p=0,y=-20,T=0,Q=_.scalefac,j=0;for(C.over_SSD=0,m=0;m<_.psymax;m++){var Y=_.global_gain-(Q[j++]+(_.preflag!=0?be[m]:0)<<_.scalefac_scale+1)-_.subblock_gain[_.window[m]]*8,we=0;if(f!=null&&f.step[m]==Y)we=f.noise[m],T+=_.width[m],W[O++]=we/N[R++],we=f.noise_log[m];else{var v=ie(Y);if(h=_.width[m]>>1,T+_.width[m]>_.max_nonzero_coeff){var g;g=_.max_nonzero_coeff-T+1,g>0?h=g>>1:h=0}var ve=new b(T);we=this.calc_noise_core(_,ve,h,v),T=ve.s,f!=null&&(f.step[m]=Y,f.noise[m]=we),we=W[O++]=we/N[R++],we=M0.FAST_LOG10(Math.max(we,1e-20)),f!=null&&(f.noise_log[m]=we)}if(f!=null&&(f.global_gain=_.global_gain),p+=we,we>0){var ye;ye=Math.max(0|we*10+.5,1),C.over_SSD+=ye*ye,S++,u+=we}y=Math.max(y,we)}return C.over_count=S,C.tot_noise=p,C.over_noise=u,C.max_noise=y,S},this.set_pinfo=function(_,N,W,C,f){var O=_.internal_flags,R,m,h,S,u,p=N.scalefac_scale==0?.5:1,y=N.scalefac,T=Oi(L3Side.SFBMAX),Q=Oi(L3Side.SFBMAX),j=new CalcNoiseResult;calc_xmin(_,W,N,T),calc_noise(N,T,Q,j,null);var Y=0;for(m=N.sfb_lmax,N.block_type!=A.SHORT_TYPE&&N.mixed_block_flag==0&&(m=22),R=0;R<m;R++){var we=O.scalefac_band.l[R],v=O.scalefac_band.l[R+1],g=v-we;for(S=0;Y<v;Y++)S+=N.xr[Y]*N.xr[Y];S/=g,u=1e15,O.pinfo.en[C][f][R]=u*S,O.pinfo.xfsf[C][f][R]=u*T[R]*Q[R]/g,W.en.l[R]>0&&!_.ATHonly?S=S/W.en.l[R]:S=0,O.pinfo.thr[C][f][R]=u*Math.max(S*W.thm.l[R],O.ATH.l[R]),O.pinfo.LAMEsfb[C][f][R]=0,N.preflag!=0&&R>=11&&(O.pinfo.LAMEsfb[C][f][R]=-p*be[R]),R<A.SBPSY_l&&(ti(y[R]>=0),O.pinfo.LAMEsfb[C][f][R]-=p*y[R])}if(N.block_type==A.SHORT_TYPE)for(m=R,R=N.sfb_smin;R<A.SBMAX_s;R++)for(var we=O.scalefac_band.s[R],v=O.scalefac_band.s[R+1],g=v-we,ve=0;ve<3;ve++){for(S=0,h=we;h<v;h++)S+=N.xr[Y]*N.xr[Y],Y++;S=Math.max(S/g,1e-20),u=1e15,O.pinfo.en_s[C][f][3*R+ve]=u*S,O.pinfo.xfsf_s[C][f][3*R+ve]=u*T[m]*Q[m]/g,W.en.s[R][ve]>0?S=S/W.en.s[R][ve]:S=0,(_.ATHonly||_.ATHshort)&&(S=0),O.pinfo.thr_s[C][f][3*R+ve]=u*Math.max(S*W.thm.s[R][ve],O.ATH.s[R]),O.pinfo.LAMEsfb_s[C][f][3*R+ve]=-2*N.subblock_gain[ve],R<A.SBPSY_s&&(O.pinfo.LAMEsfb_s[C][f][3*R+ve]-=p*y[m]),m++}O.pinfo.LAMEqss[C][f]=N.global_gain,O.pinfo.LAMEmainbits[C][f]=N.part2_3_length+N.part2_length,O.pinfo.LAMEsfbits[C][f]=N.part2_length,O.pinfo.over[C][f]=j.over_count,O.pinfo.max_noise[C][f]=j.max_noise*10,O.pinfo.over_noise[C][f]=j.over_noise*10,O.pinfo.tot_noise[C][f]=j.tot_noise*10,O.pinfo.over_SSD[C][f]=j.over_SSD}}var di=$r,Vf=E.System,qf=E.Arrays,ro=E.new_int,fn=E.assert;function P0(){var B=null;this.qupvt=null,this.setModules=function(m){this.qupvt=m,B=m};function ne(m){this.bits=0|m}var fe=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]];function ie(m,h,S,u,p,y){var T=.5946/h;for(fn(m>0),m=m>>1;m--!=0;)p[y++]=T>S[u++]?0:1,p[y++]=T>S[u++]?0:1}function Ae(m,h,S,u,p,y){fn(m>0),m=m>>1;var T=m%2;for(m=m>>1;m--!=0;){var Q,j,Y,we,v,g,ve,ye;Q=S[u++]*h,j=S[u++]*h,v=0|Q,Y=S[u++]*h,g=0|j,we=S[u++]*h,ve=0|Y,Q+=B.adj43[v],ye=0|we,j+=B.adj43[g],p[y++]=0|Q,Y+=B.adj43[ve],p[y++]=0|j,we+=B.adj43[ye],p[y++]=0|Y,p[y++]=0|we}if(T!=0){var Q,j,v,g;Q=S[u++]*h,j=S[u++]*h,v=0|Q,g=0|j,Q+=B.adj43[v],j+=B.adj43[g],p[y++]=0|Q,p[y++]=0|j}}function ae(m,h,S,u,p){var y,T,Q=0,j,Y=0,we=0,v=0,g=h,ve=0,ye=g,He=0,ze=m,Ke=0;for(j=p!=null&&u.global_gain==p.global_gain,u.block_type==A.SHORT_TYPE?T=38:T=21,y=0;y<=T;y++){var We=-1;if((j||u.block_type==A.NORM_TYPE)&&(We=u.global_gain-(u.scalefac[y]+(u.preflag!=0?B.pretab[y]:0)<<u.scalefac_scale+1)-u.subblock_gain[u.window[y]]*8),fn(u.width[y]>=0),j&&p.step[y]==We)Y!=0&&(Ae(Y,S,ze,Ke,ye,He),Y=0),we!=0&&(ie(we,S,ze,Ke,ye,He),we=0);else{var lt=u.width[y];if(Q+u.width[y]>u.max_nonzero_coeff){var Ze;Ze=u.max_nonzero_coeff-Q+1,qf.fill(h,u.max_nonzero_coeff,576,0),lt=Ze,lt<0&&(lt=0),y=T+1}if(Y==0&&we==0&&(ye=g,He=ve,ze=m,Ke=v),p!=null&&p.sfb_count1>0&&y>=p.sfb_count1&&p.step[y]>0&&We>=p.step[y]?(Y!=0&&(Ae(Y,S,ze,Ke,ye,He),Y=0,ye=g,He=ve,ze=m,Ke=v),we+=lt):(we!=0&&(ie(we,S,ze,Ke,ye,He),we=0,ye=g,He=ve,ze=m,Ke=v),Y+=lt),lt<=0){we!=0&&(ie(we,S,ze,Ke,ye,He),we=0),Y!=0&&(Ae(Y,S,ze,Ke,ye,He),Y=0);break}}y<=T&&(ve+=u.width[y],v+=u.width[y],Q+=u.width[y])}Y!=0&&(Ae(Y,S,ze,Ke,ye,He),Y=0),we!=0&&(ie(we,S,ze,Ke,ye,He),we=0)}function _e(m,h,S){var u=0,p=0;do{var y=m[h++],T=m[h++];u<y&&(u=y),p<T&&(p=T)}while(h<S);return u<p&&(u=p),u}function Fe(m,h,S,u,p,y){var T=It.ht[u].xlen*65536+It.ht[p].xlen,Q=0,j;do{var Y=m[h++],we=m[h++];Y!=0&&(Y>14&&(Y=15,Q+=T),Y*=16),we!=0&&(we>14&&(we=15,Q+=T),Y+=we),Q+=It.largetbl[Y]}while(h<S);return j=Q&65535,Q>>=16,Q>j&&(Q=j,u=p),y.bits+=Q,u}function Ue(m,h,S,u){var p=0,y=It.ht[1].hlen;do{var T=m[h+0]*2+m[h+1];h+=2,p+=y[T]}while(h<S);return u.bits+=p,1}function $(m,h,S,u,p){var y=0,T,Q=It.ht[u].xlen,j;u==2?j=It.table23:j=It.table56;do{var Y=m[h+0]*Q+m[h+1];h+=2,y+=j[Y]}while(h<S);return T=y&65535,y>>=16,y>T&&(y=T,u++),p.bits+=y,u}function he(m,h,S,u,p){var y=0,T=0,Q=0,j=It.ht[u].xlen,Y=It.ht[u].hlen,we=It.ht[u+1].hlen,v=It.ht[u+2].hlen;do{var g=m[h+0]*j+m[h+1];h+=2,y+=Y[g],T+=we[g],Q+=v[g]}while(h<S);var ve=u;return y>T&&(y=T,ve++),y>Q&&(y=Q,ve=u+2),p.bits+=y,ve}var be=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function D(m,h,S,u){var p=_e(m,h,S);switch(p){case 0:return p;case 1:return Ue(m,h,S,u);case 2:case 3:return $(m,h,S,be[p-1],u);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return he(m,h,S,be[p-1],u);default:if(p>di.IXMAX_VAL)return u.bits=di.LARGE_BITS,-1;p-=15;var y;for(y=24;y<32&&!(It.ht[y].linmax>=p);y++);var T;for(T=y-8;T<24&&!(It.ht[T].linmax>=p);T++);return Fe(m,h,S,T,y,u)}}this.noquant_count_bits=function(m,h,S){var u=h.l3_enc,p=Math.min(576,h.max_nonzero_coeff+2>>1<<1);for(S!=null&&(S.sfb_count1=0);p>1&&(u[p-1]|u[p-2])==0;p-=2);h.count1=p;for(var y=0,T=0;p>3;p-=4){var Q;if(((u[p-1]|u[p-2]|u[p-3]|u[p-4])&2147483647)>1)break;Q=((u[p-4]*2+u[p-3])*2+u[p-2])*2+u[p-1],y+=It.t32l[Q],T+=It.t33l[Q]}var j=y;if(h.count1table_select=0,y>T&&(j=T,h.count1table_select=1),h.count1bits=j,h.big_values=p,p==0)return j;if(h.block_type==A.SHORT_TYPE)y=3*m.scalefac_band.s[3],y>h.big_values&&(y=h.big_values),T=h.big_values;else if(h.block_type==A.NORM_TYPE){if(fn(p<=576),y=h.region0_count=m.bv_scf[p-2],T=h.region1_count=m.bv_scf[p-1],fn(y+T+2<A.SBPSY_l),T=m.scalefac_band.l[y+T+2],y=m.scalefac_band.l[y+1],T<p){var Y=new ne(j);h.table_select[2]=D(u,T,p,Y),j=Y.bits}}else h.region0_count=7,h.region1_count=A.SBMAX_l-1-7-1,y=m.scalefac_band.l[7+1],T=p,y>T&&(y=T);if(y=Math.min(y,p),T=Math.min(T,p),fn(y>=0),fn(T>=0),0<y){var Y=new ne(j);h.table_select[0]=D(u,0,y,Y),j=Y.bits}if(y<T){var Y=new ne(j);h.table_select[1]=D(u,y,T,Y),j=Y.bits}if(m.use_best_huffman==2&&(h.part2_3_length=j,best_huffman_divide(m,h),j=h.part2_3_length),S!=null&&h.block_type==A.NORM_TYPE){for(var we=0;m.scalefac_band.l[we]<h.big_values;)we++;S.sfb_count1=we}return j},this.count_bits=function(m,h,S,u){var p=S.l3_enc,y=di.IXMAX_VAL/B.IPOW20(S.global_gain);if(S.xrpow_max>y)return di.LARGE_BITS;if(ae(h,p,B.IPOW20(S.global_gain),S,u),(m.substep_shaping&2)!=0)for(var T=0,Q=S.global_gain+S.scalefac_scale,j=.634521682242439/B.IPOW20(Q),Y=0;Y<S.sfbmax;Y++){var we=S.width[Y];if(fn(we>=0),m.pseudohalf[Y]==0)T+=we;else{var v;for(v=T,T+=we;v<T;++v)p[v]=h[v]>=j?p[v]:0}}return this.noquant_count_bits(m,S,u)};function ee(m,h,S,u,p,y,T){for(var Q=h.big_values,j=0;j<=7+15;j++)u[j]=di.LARGE_BITS;for(var j=0;j<16;j++){var Y=m.scalefac_band.l[j+1];if(Y>=Q)break;var we=0,v=new ne(we),g=D(S,0,Y,v);we=v.bits;for(var ve=0;ve<8;ve++){var ye=m.scalefac_band.l[j+ve+2];if(ye>=Q)break;var He=we;v=new ne(He);var ze=D(S,Y,ye,v);He=v.bits,u[j+ve]>He&&(u[j+ve]=He,p[j+ve]=j,y[j+ve]=g,T[j+ve]=ze)}}}function s(m,h,S,u,p,y,T,Q){for(var j=h.big_values,Y=2;Y<A.SBMAX_l+1;Y++){var we=m.scalefac_band.l[Y];if(we>=j)break;var v=p[Y-2]+h.count1bits;if(S.part2_3_length<=v)break;var g=new ne(v),ve=D(u,we,j,g);v=g.bits,!(S.part2_3_length<=v)&&(S.assign(h),S.part2_3_length=v,S.region0_count=y[Y-2],S.region1_count=Y-2-y[Y-2],S.table_select[0]=T[Y-2],S.table_select[1]=Q[Y-2],S.table_select[2]=ve)}}this.best_huffman_divide=function(m,h){var S=new Qo,u=h.l3_enc,p=ro(7+15+1),y=ro(7+15+1),T=ro(7+15+1),Q=ro(7+15+1);if(!(h.block_type==A.SHORT_TYPE&&m.mode_gr==1)){S.assign(h),h.block_type==A.NORM_TYPE&&(ee(m,h,u,p,y,T,Q),s(m,S,h,u,p,y,T,Q));var j=S.big_values;if(!(j==0||(u[j-2]|u[j-1])>1)&&(j=h.count1+2,!(j>576))){S.assign(h),S.count1=j;var Y=0,we=0;for(fn(j<=576);j>S.big_values;j-=4){var v=((u[j-4]*2+u[j-3])*2+u[j-2])*2+u[j-1];Y+=It.t32l[v],we+=It.t33l[v]}if(S.big_values=j,S.count1table_select=0,Y>we&&(Y=we,S.count1table_select=1),S.count1bits=Y,S.block_type==A.NORM_TYPE)s(m,S,h,u,p,y,T,Q);else{if(S.part2_3_length=Y,Y=m.scalefac_band.l[7+1],Y>j&&(Y=j),Y>0){var g=new ne(S.part2_3_length);S.table_select[0]=D(u,0,Y,g),S.part2_3_length=g.bits}if(j>Y){var g=new ne(S.part2_3_length);S.table_select[1]=D(u,Y,j,g),S.part2_3_length=g.bits}h.part2_3_length>S.part2_3_length&&h.assign(S)}}}};var P=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],G=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],F=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],b=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];P0.slen1_tab=F,P0.slen2_tab=b;function _(m,h){for(var S,u=h.tt[1][m],p=h.tt[0][m],y=0;y<It.scfsi_band.length-1;y++){for(S=It.scfsi_band[y];S<It.scfsi_band[y+1]&&!(p.scalefac[S]!=u.scalefac[S]&&u.scalefac[S]>=0);S++);if(S==It.scfsi_band[y+1]){for(S=It.scfsi_band[y];S<It.scfsi_band[y+1];S++)u.scalefac[S]=-1;h.scfsi[m][y]=1}}var T=0,Q=0;for(S=0;S<11;S++)u.scalefac[S]!=-1&&(Q++,T<u.scalefac[S]&&(T=u.scalefac[S]));for(var j=0,Y=0;S<A.SBPSY_l;S++)u.scalefac[S]!=-1&&(Y++,j<u.scalefac[S]&&(j=u.scalefac[S]));for(var y=0;y<16;y++)if(T<P[y]&&j<G[y]){var we=F[y]*Q+b[y]*Y;u.part2_length>we&&(u.part2_length=we,u.scalefac_compress=y)}}this.best_scalefac_store=function(m,h,S,u){var p=u.tt[h][S],y,T,Q,j,Y=0;for(Q=0,y=0;y<p.sfbmax;y++){var we=p.width[y];for(fn(we>=0),Q+=we,j=-we;j<0&&p.l3_enc[j+Q]==0;j++);j==0&&(p.scalefac[y]=Y=-2)}if(p.scalefac_scale==0&&p.preflag==0){var v=0;for(y=0;y<p.sfbmax;y++)p.scalefac[y]>0&&(v|=p.scalefac[y]);if((v&1)==0&&v!=0){for(y=0;y<p.sfbmax;y++)p.scalefac[y]>0&&(p.scalefac[y]>>=1);p.scalefac_scale=Y=1}}if(p.preflag==0&&p.block_type!=A.SHORT_TYPE&&m.mode_gr==2){for(y=11;y<A.SBPSY_l&&!(p.scalefac[y]<B.pretab[y]&&p.scalefac[y]!=-2);y++);if(y==A.SBPSY_l){for(y=11;y<A.SBPSY_l;y++)p.scalefac[y]>0&&(p.scalefac[y]-=B.pretab[y]);p.preflag=Y=1}}for(T=0;T<4;T++)u.scfsi[S][T]=0;for(m.mode_gr==2&&h==1&&u.tt[0][S].block_type!=A.SHORT_TYPE&&u.tt[1][S].block_type!=A.SHORT_TYPE&&(_(S,u),Y=0),y=0;y<p.sfbmax;y++)p.scalefac[y]==-2&&(p.scalefac[y]=0);Y!=0&&(m.mode_gr==2?this.scale_bitcount(p):this.scale_bitcount_lsf(m,p))};function N(m,h){for(var S=0;S<h;++S)if(m[S]<0)return!1;return!0}var W=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],C=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],f=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(m){var h,S,u=0,p=0,y,T=m.scalefac;if(fn(N(T,m.sfbmax)),m.block_type==A.SHORT_TYPE)y=W,m.mixed_block_flag!=0&&(y=C);else if(y=f,m.preflag==0){for(S=11;S<A.SBPSY_l&&!(T[S]<B.pretab[S]);S++);if(S==A.SBPSY_l)for(m.preflag=1,S=11;S<A.SBPSY_l;S++)T[S]-=B.pretab[S]}for(S=0;S<m.sfbdivide;S++)u<T[S]&&(u=T[S]);for(;S<m.sfbmax;S++)p<T[S]&&(p=T[S]);for(m.part2_length=di.LARGE_BITS,h=0;h<16;h++)u<P[h]&&p<G[h]&&m.part2_length>y[h]&&(m.part2_length=y[h],m.scalefac_compress=h);return m.part2_length==di.LARGE_BITS};var O=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(m,h){var S,u,p,y,T,Q,j,Y,we=ro(4),v=h.scalefac;for(h.preflag!=0?S=2:S=0,j=0;j<4;j++)we[j]=0;if(h.block_type==A.SHORT_TYPE){u=1;var g=B.nr_of_sfb_block[S][u];for(Y=0,p=0;p<4;p++)for(y=g[p]/3,j=0;j<y;j++,Y++)for(T=0;T<3;T++)v[Y*3+T]>we[p]&&(we[p]=v[Y*3+T])}else{u=0;var g=B.nr_of_sfb_block[S][u];for(Y=0,p=0;p<4;p++)for(y=g[p],j=0;j<y;j++,Y++)v[Y]>we[p]&&(we[p]=v[Y])}for(Q=!1,p=0;p<4;p++)we[p]>O[S][p]&&(Q=!0);if(!Q){var ve,ye,He,ze;for(h.sfb_partition_table=B.nr_of_sfb_block[S][u],p=0;p<4;p++)h.slen[p]=R[we[p]];switch(ve=h.slen[0],ye=h.slen[1],He=h.slen[2],ze=h.slen[3],S){case 0:h.scalefac_compress=(ve*5+ye<<4)+(He<<2)+ze;break;case 1:h.scalefac_compress=400+(ve*5+ye<<2)+He;break;case 2:h.scalefac_compress=500+ve*3+ye;break;default:Vf.err.printf(`intensity stereo not implemented yet
2
+ `);break}}if(!Q)for(fn(h.sfb_partition_table!=null),h.part2_length=0,p=0;p<4;p++)h.part2_length+=h.slen[p]*h.sfb_partition_table[p];return Q};var R=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(m){for(var h=2;h<=576;h+=2){for(var S=0,u;m.scalefac_band.l[++S]<h;);for(u=fe[S][0];m.scalefac_band.l[u+1]>h;)u--;for(u<0&&(u=fe[S][0]),m.bv_scf[h-2]=u,u=fe[S][1];m.scalefac_band.l[u+m.bv_scf[h-2]+2]>h;)u--;u<0&&(u=fe[S][1]),m.bv_scf[h-1]=u}}}var B0=P0,Vn=E.System,zf=E.Arrays,jf=E.new_byte,Gf=E.new_float_n,Xf=E.new_int,_t=E.assert;ns.EQ=function(B,ne){return Math.abs(B)>Math.abs(ne)?Math.abs(B-ne)<=Math.abs(B)*1e-6:Math.abs(B-ne)<=Math.abs(ne)*1e-6},ns.NEQ=function(B,ne){return!ns.EQ(B,ne)};function ns(){var B=this,ne=32773,fe=32,ie=null,Ae=null,ae=null,_e=null;this.setModules=function(R,m,h,S){ie=R,Ae=m,ae=h,_e=S};var Fe=null,Ue=0,$=0,he=0;this.getframebits=function(R){var m=R.internal_flags,h;m.bitrate_index!=0?h=It.bitrate_table[R.version][m.bitrate_index]:h=R.brate,_t(8<=h&&h<=640);var S=0|(R.version+1)*72e3*h/R.out_samplerate+m.padding;return 8*S};function be(R){Vn.arraycopy(R.header[R.w_ptr].buf,0,Fe,$,R.sideinfo_len),$+=R.sideinfo_len,Ue+=R.sideinfo_len*8,R.w_ptr=R.w_ptr+1&jt.MAX_HEADER_BUF-1}function D(R,m,h){for(_t(h<fe-2);h>0;){var S;he==0&&(he=8,$++,_t($<Nt.LAME_MAXMP3BUFFER),_t(R.header[R.w_ptr].write_timing>=Ue),R.header[R.w_ptr].write_timing==Ue&&be(R),Fe[$]=0),S=Math.min(h,he),h-=S,he-=S,_t(h<fe),_t(he<fe),Fe[$]|=m>>h<<he,Ue+=S}}function ee(R,m,h){for(_t(h<fe-2);h>0;){var S;he==0&&(he=8,$++,_t($<Nt.LAME_MAXMP3BUFFER),Fe[$]=0),S=Math.min(h,he),h-=S,he-=S,_t(h<fe),_t(he<fe),Fe[$]|=m>>h<<he,Ue+=S}}function s(R,m){var h=R.internal_flags,S;if(_t(m>=0),m>=8&&(D(h,76,8),m-=8),m>=8&&(D(h,65,8),m-=8),m>=8&&(D(h,77,8),m-=8),m>=8&&(D(h,69,8),m-=8),m>=32){var u=ae.getLameShortVersion();if(m>=32)for(S=0;S<u.length&&m>=8;++S)m-=8,D(h,u.charAt(S),8)}for(;m>=1;m-=1)D(h,h.ancillary_flag,1),h.ancillary_flag^=R.disable_reservoir?0:1;_t(m==0)}function P(R,m,h){for(var S=R.header[R.h_ptr].ptr;h>0;){var u=Math.min(h,8-(S&7));h-=u,_t(h<fe),R.header[R.h_ptr].buf[S>>3]|=m>>h<<8-(S&7)-u,S+=u}R.header[R.h_ptr].ptr=S}function G(R,m){R<<=8;for(var h=0;h<8;h++)R<<=1,m<<=1,((m^R)&65536)!=0&&(m^=ne);return m}this.CRC_writeheader=function(R,m){var h=65535;h=G(m[2]&255,h),h=G(m[3]&255,h);for(var S=6;S<R.sideinfo_len;S++)h=G(m[S]&255,h);m[4]=byte(h>>8),m[5]=byte(h&255)};function F(R,m){var h=R.internal_flags,S,u,p;if(S=h.l3_side,h.header[h.h_ptr].ptr=0,zf.fill(h.header[h.h_ptr].buf,0,h.sideinfo_len,0),R.out_samplerate<16e3?P(h,4094,12):P(h,4095,12),P(h,R.version,1),P(h,4-3,2),P(h,R.error_protection?0:1,1),P(h,h.bitrate_index,4),P(h,h.samplerate_index,2),P(h,h.padding,1),P(h,R.extension,1),P(h,R.mode.ordinal(),2),P(h,h.mode_ext,2),P(h,R.copyright,1),P(h,R.original,1),P(h,R.emphasis,2),R.error_protection&&P(h,0,16),R.version==1){for(_t(S.main_data_begin>=0),P(h,S.main_data_begin,9),h.channels_out==2?P(h,S.private_bits,3):P(h,S.private_bits,5),p=0;p<h.channels_out;p++){var y;for(y=0;y<4;y++)P(h,S.scfsi[p][y],1)}for(u=0;u<2;u++)for(p=0;p<h.channels_out;p++){var T=S.tt[u][p];P(h,T.part2_3_length+T.part2_length,12),P(h,T.big_values/2,9),P(h,T.global_gain,8),P(h,T.scalefac_compress,4),T.block_type!=A.NORM_TYPE?(P(h,1,1),P(h,T.block_type,2),P(h,T.mixed_block_flag,1),T.table_select[0]==14&&(T.table_select[0]=16),P(h,T.table_select[0],5),T.table_select[1]==14&&(T.table_select[1]=16),P(h,T.table_select[1],5),P(h,T.subblock_gain[0],3),P(h,T.subblock_gain[1],3),P(h,T.subblock_gain[2],3)):(P(h,0,1),T.table_select[0]==14&&(T.table_select[0]=16),P(h,T.table_select[0],5),T.table_select[1]==14&&(T.table_select[1]=16),P(h,T.table_select[1],5),T.table_select[2]==14&&(T.table_select[2]=16),P(h,T.table_select[2],5),_t(0<=T.region0_count&&T.region0_count<16),_t(0<=T.region1_count&&T.region1_count<8),P(h,T.region0_count,4),P(h,T.region1_count,3)),P(h,T.preflag,1),P(h,T.scalefac_scale,1),P(h,T.count1table_select,1)}}else for(_t(S.main_data_begin>=0),P(h,S.main_data_begin,8),P(h,S.private_bits,h.channels_out),u=0,p=0;p<h.channels_out;p++){var T=S.tt[u][p];P(h,T.part2_3_length+T.part2_length,12),P(h,T.big_values/2,9),P(h,T.global_gain,8),P(h,T.scalefac_compress,9),T.block_type!=A.NORM_TYPE?(P(h,1,1),P(h,T.block_type,2),P(h,T.mixed_block_flag,1),T.table_select[0]==14&&(T.table_select[0]=16),P(h,T.table_select[0],5),T.table_select[1]==14&&(T.table_select[1]=16),P(h,T.table_select[1],5),P(h,T.subblock_gain[0],3),P(h,T.subblock_gain[1],3),P(h,T.subblock_gain[2],3)):(P(h,0,1),T.table_select[0]==14&&(T.table_select[0]=16),P(h,T.table_select[0],5),T.table_select[1]==14&&(T.table_select[1]=16),P(h,T.table_select[1],5),T.table_select[2]==14&&(T.table_select[2]=16),P(h,T.table_select[2],5),_t(0<=T.region0_count&&T.region0_count<16),_t(0<=T.region1_count&&T.region1_count<8),P(h,T.region0_count,4),P(h,T.region1_count,3)),P(h,T.scalefac_scale,1),P(h,T.count1table_select,1)}R.error_protection&&CRC_writeheader(h,h.header[h.h_ptr].buf);{var Q=h.h_ptr;_t(h.header[Q].ptr==h.sideinfo_len*8),h.h_ptr=Q+1&jt.MAX_HEADER_BUF-1,h.header[h.h_ptr].write_timing=h.header[Q].write_timing+m,h.h_ptr==h.w_ptr&&Vn.err.println(`Error: MAX_HEADER_BUF too small in bitstream.c
3
+ `)}}function b(R,m){var h=It.ht[m.count1table_select+32],S,u=0,p=m.big_values,y=m.big_values;for(_t(m.count1table_select<2),S=(m.count1-m.big_values)/4;S>0;--S){var T=0,Q=0,j;j=m.l3_enc[p+0],j!=0&&(Q+=8,m.xr[y+0]<0&&T++,_t(j<=1)),j=m.l3_enc[p+1],j!=0&&(Q+=4,T*=2,m.xr[y+1]<0&&T++,_t(j<=1)),j=m.l3_enc[p+2],j!=0&&(Q+=2,T*=2,m.xr[y+2]<0&&T++,_t(j<=1)),j=m.l3_enc[p+3],j!=0&&(Q++,T*=2,m.xr[y+3]<0&&T++,_t(j<=1)),p+=4,y+=4,D(R,T+h.table[Q],h.hlen[Q]),u+=h.hlen[Q]}return u}function _(R,m,h,S,u){var p=It.ht[m],y=0;if(_t(m<32),m==0)return y;for(var T=h;T<S;T+=2){var Q=0,j=0,Y=p.xlen,we=p.xlen,v=0,g=u.l3_enc[T],ve=u.l3_enc[T+1];if(g!=0&&(u.xr[T]<0&&v++,Q--),m>15){if(g>14){var ye=g-15;_t(ye<=p.linmax),v|=ye<<1,j=Y,g=15}if(ve>14){var He=ve-15;_t(He<=p.linmax),v<<=Y,v|=He,j+=Y,ve=15}we=16}ve!=0&&(v<<=1,u.xr[T+1]<0&&v++,Q--),_t((g|ve)<16),g=g*we+ve,j-=Q,Q+=p.hlen[g],_t(Q<=fe),_t(j<=fe),D(R,p.table[g],Q),D(R,v,j),y+=Q+j}return y}function N(R,m){var h=3*R.scalefac_band.s[3];h>m.big_values&&(h=m.big_values);var S=_(R,m.table_select[0],0,h,m);return S+=_(R,m.table_select[1],h,m.big_values,m),S}function W(R,m){var h,S,u,p;h=m.big_values,_t(0<=h&&h<=576);var y=m.region0_count+1;return _t(0<=y),_t(y<R.scalefac_band.l.length),u=R.scalefac_band.l[y],y+=m.region1_count+1,_t(0<=y),_t(y<R.scalefac_band.l.length),p=R.scalefac_band.l[y],u>h&&(u=h),p>h&&(p=h),S=_(R,m.table_select[0],0,u,m),S+=_(R,m.table_select[1],u,p,m),S+=_(R,m.table_select[2],p,h,m),S}function C(R){var m,h,S,u,p=0,y=R.internal_flags,T=y.l3_side;if(R.version==1)for(m=0;m<2;m++)for(h=0;h<y.channels_out;h++){var Q=T.tt[m][h],j=B0.slen1_tab[Q.scalefac_compress],Y=B0.slen2_tab[Q.scalefac_compress];for(u=0,S=0;S<Q.sfbdivide;S++)Q.scalefac[S]!=-1&&(D(y,Q.scalefac[S],j),u+=j);for(;S<Q.sfbmax;S++)Q.scalefac[S]!=-1&&(D(y,Q.scalefac[S],Y),u+=Y);_t(u==Q.part2_length),Q.block_type==A.SHORT_TYPE?u+=N(y,Q):u+=W(y,Q),u+=b(y,Q),_t(u==Q.part2_3_length+Q.part2_length),p+=u}else for(m=0,h=0;h<y.channels_out;h++){var Q=T.tt[m][h],we,v,g=0;if(_t(Q.sfb_partition_table!=null),u=0,S=0,v=0,Q.block_type==A.SHORT_TYPE){for(;v<4;v++){var ve=Q.sfb_partition_table[v]/3,ye=Q.slen[v];for(we=0;we<ve;we++,S++)D(y,Math.max(Q.scalefac[S*3+0],0),ye),D(y,Math.max(Q.scalefac[S*3+1],0),ye),D(y,Math.max(Q.scalefac[S*3+2],0),ye),g+=3*ye}u+=N(y,Q)}else{for(;v<4;v++){var ve=Q.sfb_partition_table[v],ye=Q.slen[v];for(we=0;we<ve;we++,S++)D(y,Math.max(Q.scalefac[S],0),ye),g+=ye}u+=W(y,Q)}u+=b(y,Q),_t(u==Q.part2_3_length),_t(g==Q.part2_length),p+=g+u}return p}function f(){this.total=0}function O(R,m){var h=R.internal_flags,S,u,p,y,T;return T=h.w_ptr,y=h.h_ptr-1,y==-1&&(y=jt.MAX_HEADER_BUF-1),S=h.header[y].write_timing-Ue,m.total=S,S>=0&&(u=1+y-T,y<T&&(u=1+y-T+jt.MAX_HEADER_BUF),S-=u*8*h.sideinfo_len),p=B.getframebits(R),S+=p,m.total+=p,m.total%8!=0?m.total=1+m.total/8:m.total=m.total/8,m.total+=$+1,S<0&&Vn.err.println(`strange error flushing buffer ...
4
+ `),S}this.flush_bitstream=function(R){var m=R.internal_flags,h,S,u=m.h_ptr-1;if(u==-1&&(u=jt.MAX_HEADER_BUF-1),h=m.l3_side,!((S=O(R,new f))<0)){if(s(R,S),_t(m.header[u].write_timing+this.getframebits(R)==Ue),m.ResvSize=0,h.main_data_begin=0,m.findReplayGain){var p=ie.GetTitleGain(m.rgdata);_t(NEQ(p,ao.GAIN_NOT_ENOUGH_SAMPLES)),m.RadioGain=Math.floor(p*10+.5)|0}m.findPeakSample&&(m.noclipGainChange=Math.ceil(Math.log10(m.PeakSample/32767)*20*10)|0,m.noclipGainChange>0&&(EQ(R.scale,1)||EQ(R.scale,0))?m.noclipScale=Math.floor(32767/m.PeakSample*100)/100:m.noclipScale=-1)}},this.add_dummy_byte=function(R,m,h){for(var S=R.internal_flags,u;h-- >0;)for(ee(S,m,8),u=0;u<jt.MAX_HEADER_BUF;++u)S.header[u].write_timing+=8},this.format_bitstream=function(R){var m=R.internal_flags,h;h=m.l3_side;var S=this.getframebits(R);s(R,h.resvDrain_pre),F(R,S);var u=8*m.sideinfo_len;if(u+=C(R),s(R,h.resvDrain_post),u+=h.resvDrain_post,h.main_data_begin+=(S-u)/8,O(R,new f)!=m.ResvSize&&Vn.err.println("Internal buffer inconsistency. flushbits <> ResvSize"),h.main_data_begin*8!=m.ResvSize&&(Vn.err.printf(`bit reservoir error:
5
5
  l3_side.main_data_begin: %d
6
6
  Resvoir size: %d
7
7
  resv drain (post) %d
@@ -10,29 +10,29 @@ header and sideinfo: %d
10
10
  data bits: %d
11
11
  total bits: %d (remainder: %d)
12
12
  bitsperframe: %d
13
- `,8*m.main_data_begin,u.ResvSize,m.resvDrain_post,m.resvDrain_pre,8*u.sideinfo_len,l-m.resvDrain_post-8*u.sideinfo_len,l,l%8,b),Dn.err.println("This is a fatal error. It has several possible causes:"),Dn.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),Dn.err.println(" 9%% Your system is overclocked"),Dn.err.println(" 1%% bug in LAME encoding library"),u.ResvSize=m.main_data_begin*8),dt(ke%8==0),ke>1e9){var h;for(h=0;h<Bt.MAX_HEADER_BUF;++h)u.header[h].write_timing-=ke;ke=0}return 0},this.copy_buffer=function(y,u,m,b,l){var h=G+1;if(h<=0)return 0;if(b!=0&&h>b)return-1;if(Dn.arraycopy(Ne,0,u,m,h),G=-1,de=0,l!=0){var x=ud(1);if(x[0]=y.nMusicCRC,me.updateMusicCRC(x,u,m,h),y.nMusicCRC=x[0],h>0&&(y.VBR_seek_table.nBytesWritten+=h),y.decode_on_the_fly){for(var E=cd([2,1152]),X=h,U=-1,j;U!=0;)if(U=ye.hip_decode1_unclipped(y.hip,u,m,X,E[0],E[1]),X=0,U==-1&&(U=0),U>0){if(dt(U<=1152),y.findPeakSample){for(j=0;j<U;j++)E[0][j]>y.PeakSample?y.PeakSample=E[0][j]:-E[0][j]>y.PeakSample&&(y.PeakSample=-E[0][j]);if(y.channels_out>1)for(j=0;j<U;j++)E[1][j]>y.PeakSample?y.PeakSample=E[1][j]:-E[1][j]>y.PeakSample&&(y.PeakSample=-E[1][j])}if(y.findReplayGain&&Z.AnalyzeSamples(y.rgdata,E[0],0,E[1],0,U,y.channels_out)==Xa.GAIN_ANALYSIS_ERROR)return-6}}}return h},this.init_bit_stream_w=function(y){Ne=ld(At.LAME_MAXMP3BUFFER),y.h_ptr=y.w_ptr=0,y.header[y.h_ptr].write_timing=0,G=-1,de=0,ke=0}}var ri=Vo,fd=P.System,Dt=P.VbrMode,u0=P.ShortBlock,Ai=P.new_float,Mc=P.new_int_n,dd=P.new_short_n,Gr=P.assert;function rr(){var C=this,$=128*1024;rr.V9=410,rr.V8=420,rr.V7=430,rr.V6=440,rr.V5=450,rr.V4=460,rr.V3=470,rr.V2=480,rr.V1=490,rr.V0=500,rr.R3MIX=1e3,rr.STANDARD=1001,rr.EXTREME=1002,rr.INSANE=1003,rr.STANDARD_FAST=1004,rr.EXTREME_FAST=1005,rr.MEDIUM=1006,rr.MEDIUM_FAST=1007;var ie=16384+$;rr.LAME_MAXMP3BUFFER=ie;var Z,ye,Q,me,Ne,ke=new Ar,G,de,he,M;this.enc=new T,this.setModules=function(f,S,fe,_e,Oe,Ue,je,ze,nt){Z=f,ye=S,Q=fe,me=_e,Ne=Oe,G=Ue,de=je,he=ze,M=nt,this.enc.setModules(ye,ke,me,G)};function K(){this.mask_adjust=0,this.mask_adjust_short=0,this.bo_l_weight=Ai(T.SBMAX_l),this.bo_s_weight=Ai(T.SBMAX_s)}function o(){this.lowerlimit=0}function I(f,S){this.lowpass=S}var H=4294479419;function O(f){var S;return f.class_id=H,S=f.internal_flags=new Bt,f.mode=nr.NOT_SET,f.original=1,f.in_samplerate=44100,f.num_channels=2,f.num_samples=-1,f.bWriteVbrTag=!0,f.quality=-1,f.short_blocks=null,S.subblock_gain=-1,f.lowpassfreq=0,f.highpassfreq=0,f.lowpasswidth=-1,f.highpasswidth=-1,f.VBR=Dt.vbr_off,f.VBR_q=4,f.ATHcurve=-1,f.VBR_mean_bitrate_kbps=128,f.VBR_min_bitrate_kbps=0,f.VBR_max_bitrate_kbps=0,f.VBR_hard_min=0,S.VBR_min_bitrate=1,S.VBR_max_bitrate=13,f.quant_comp=-1,f.quant_comp_short=-1,f.msfix=-1,S.resample_ratio=1,S.OldValue[0]=180,S.OldValue[1]=180,S.CurrentStep[0]=4,S.CurrentStep[1]=4,S.masking_lower=1,S.nsPsy.attackthre=-1,S.nsPsy.attackthre_s=-1,f.scale=-1,f.athaa_type=-1,f.ATHtype=-1,f.athaa_loudapprox=-1,f.athaa_sensitivity=0,f.useTemporal=null,f.interChRatio=-1,S.mf_samples_to_encode=T.ENCDELAY+T.POSTDELAY,f.encoder_padding=0,S.mf_size=T.ENCDELAY-T.MDCTDELAY,f.findReplayGain=!1,f.decode_on_the_fly=!1,S.decode_on_the_fly=!1,S.findReplayGain=!1,S.findPeakSample=!1,S.RadioGain=0,S.AudiophileGain=0,S.noclipGainChange=0,S.noclipScale=-1,f.preset=0,f.write_id3tag_automatic=!0,0}this.lame_init=function(){var f=new a0,S=O(f);return S!=0?null:(f.lame_allocated_gfp=1,f)};function g(f){return f>1?0:f<=0?1:Math.cos(Math.PI/2*f)}this.nearestBitrateFullIndex=function(f){var S=[8,16,24,32,40,48,56,64,80,96,112,128,160,192,224,256,320],fe=0,_e=0,Oe=0,Ue=0;Ue=S[16],Oe=16,_e=S[16],fe=16;for(var je=0;je<16;je++)if(Math.max(f,S[je+1])!=f){Ue=S[je+1],Oe=je+1,_e=S[je],fe=je;break}return Ue-f>f-_e?fe:Oe};function _(f,S){var fe=44100;return S>=48e3?fe=48e3:S>=44100?fe=44100:S>=32e3?fe=32e3:S>=24e3?fe=24e3:S>=22050?fe=22050:S>=16e3?fe=16e3:S>=12e3?fe=12e3:S>=11025?fe=11025:S>=8e3&&(fe=8e3),f==-1?fe:(f<=15960&&(fe=44100),f<=15250&&(fe=32e3),f<=11220&&(fe=24e3),f<=9970&&(fe=22050),f<=7230&&(fe=16e3),f<=5420&&(fe=12e3),f<=4510&&(fe=11025),f<=3970&&(fe=8e3),S<fe?S>44100?48e3:S>32e3?44100:S>24e3?32e3:S>22050?24e3:S>16e3?22050:S>12e3?16e3:S>11025?12e3:S>8e3?11025:8e3:fe)}function k(f,S){switch(f){case 44100:return S.version=1,0;case 48e3:return S.version=1,1;case 32e3:return S.version=1,2;case 22050:return S.version=0,0;case 24e3:return S.version=0,1;case 16e3:return S.version=0,2;case 11025:return S.version=0,0;case 12e3:return S.version=0,1;case 8e3:return S.version=0,2;default:return S.version=0,-1}}function q(f,S,fe){fe<16e3&&(S=2);for(var _e=bt.bitrate_table[S][1],Oe=2;Oe<=14;Oe++)bt.bitrate_table[S][Oe]>0&&Math.abs(bt.bitrate_table[S][Oe]-f)<Math.abs(_e-f)&&(_e=bt.bitrate_table[S][Oe]);return _e}function w(f,S,fe){fe<16e3&&(S=2);for(var _e=0;_e<=14;_e++)if(bt.bitrate_table[S][_e]>0&&bt.bitrate_table[S][_e]==f)return _e;return-1}function c(f,S){var fe=[new I(8,2e3),new I(16,3700),new I(24,3900),new I(32,5500),new I(40,7e3),new I(48,7500),new I(56,1e4),new I(64,11e3),new I(80,13500),new I(96,15100),new I(112,15600),new I(128,17e3),new I(160,17500),new I(192,18600),new I(224,19400),new I(256,19700),new I(320,20500)],_e=C.nearestBitrateFullIndex(S);f.lowerlimit=fe[_e].lowpass}function L(f){var S=f.internal_flags,fe=32,_e=-1;if(S.lowpass1>0){for(var Oe=999,Ue=0;Ue<=31;Ue++){var je=Ue/31;je>=S.lowpass2&&(fe=Math.min(fe,Ue)),S.lowpass1<je&&je<S.lowpass2&&(Oe=Math.min(Oe,Ue))}Oe==999?S.lowpass1=(fe-.75)/31:S.lowpass1=(Oe-.75)/31,S.lowpass2=fe/31}if(S.highpass2>0&&S.highpass2<.9*(.75/31)&&(S.highpass1=0,S.highpass2=0,fd.err.println(`Warning: highpass filter disabled. highpass frequency too small
14
- `)),S.highpass2>0){for(var ze=-1,Ue=0;Ue<=31;Ue++){var je=Ue/31;je<=S.highpass1&&(_e=Math.max(_e,Ue)),S.highpass1<je&&je<S.highpass2&&(ze=Math.max(ze,Ue))}S.highpass1=_e/31,ze==-1?S.highpass2=(_e+.75)/31:S.highpass2=(ze+.75)/31}for(var Ue=0;Ue<32;Ue++){var nt,Ke,je=Ue/31;S.highpass2>S.highpass1?nt=g((S.highpass2-je)/(S.highpass2-S.highpass1+1e-20)):nt=1,S.lowpass2>S.lowpass1?Ke=g((je-S.lowpass1)/(S.lowpass2-S.lowpass1+1e-20)):Ke=1,S.amp_filter[Ue]=nt*Ke}}function y(f){var S=f.internal_flags;switch(f.quality){default:case 9:S.psymodel=0,S.noise_shaping=0,S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.use_best_huffman=0,S.full_outer_loop=0;break;case 8:f.quality=7;case 7:S.psymodel=1,S.noise_shaping=0,S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.use_best_huffman=0,S.full_outer_loop=0;break;case 6:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=0,S.full_outer_loop=0;break;case 5:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=0,S.full_outer_loop=0;break;case 4:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 3:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=1,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 2:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.substep_shaping==0&&(S.substep_shaping=2),S.noise_shaping_amp=1,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 1:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.substep_shaping==0&&(S.substep_shaping=2),S.noise_shaping_amp=2,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 0:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.substep_shaping==0&&(S.substep_shaping=2),S.noise_shaping_amp=2,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break}}function u(f){var S=f.internal_flags;f.frameNum=0,f.write_id3tag_automatic&&he.id3tag_write_v2(f),S.bitrate_stereoMode_Hist=Mc([16,4+1]),S.bitrate_blockType_Hist=Mc([16,4+1+1]),S.PeakSample=0,f.bWriteVbrTag&&G.InitVbrTag(f)}this.lame_init_params=function(f){var S=f.internal_flags;if(S.Class_ID=0,S.ATH==null&&(S.ATH=new Zf),S.PSY==null&&(S.PSY=new K),S.rgdata==null&&(S.rgdata=new Jf),S.channels_in=f.num_channels,S.channels_in==1&&(f.mode=nr.MONO),S.channels_out=f.mode==nr.MONO?1:2,S.mode_ext=T.MPG_MD_MS_LR,f.mode==nr.MONO&&(f.force_ms=!1),f.VBR==Dt.vbr_off&&f.VBR_mean_bitrate_kbps!=128&&f.brate==0&&(f.brate=f.VBR_mean_bitrate_kbps),f.VBR==Dt.vbr_off||f.VBR==Dt.vbr_mtrh||f.VBR==Dt.vbr_mt||(f.free_format=!1),f.VBR==Dt.vbr_off&&f.brate==0&&ri.EQ(f.compression_ratio,0)&&(f.compression_ratio=11.025),f.VBR==Dt.vbr_off&&f.compression_ratio>0&&(f.out_samplerate==0&&(f.out_samplerate=map2MP3Frequency(int(.97*f.in_samplerate))),f.brate=0|f.out_samplerate*16*S.channels_out/(1e3*f.compression_ratio),S.samplerate_index=k(f.out_samplerate,f),f.free_format||(f.brate=q(f.brate,f.version,f.out_samplerate))),f.out_samplerate!=0&&(f.out_samplerate<16e3?(f.VBR_mean_bitrate_kbps=Math.max(f.VBR_mean_bitrate_kbps,8),f.VBR_mean_bitrate_kbps=Math.min(f.VBR_mean_bitrate_kbps,64)):f.out_samplerate<32e3?(f.VBR_mean_bitrate_kbps=Math.max(f.VBR_mean_bitrate_kbps,8),f.VBR_mean_bitrate_kbps=Math.min(f.VBR_mean_bitrate_kbps,160)):(f.VBR_mean_bitrate_kbps=Math.max(f.VBR_mean_bitrate_kbps,32),f.VBR_mean_bitrate_kbps=Math.min(f.VBR_mean_bitrate_kbps,320))),f.lowpassfreq==0){var fe=16e3;switch(f.VBR){case Dt.vbr_off:{var _e=new o;c(_e,f.brate),fe=_e.lowerlimit;break}case Dt.vbr_abr:{var _e=new o;c(_e,f.VBR_mean_bitrate_kbps),fe=_e.lowerlimit;break}case Dt.vbr_rh:{var Oe=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=f.VBR_q&&f.VBR_q<=9){var Ue=Oe[f.VBR_q],je=Oe[f.VBR_q+1],ze=f.VBR_q_frac;fe=linear_int(Ue,je,ze)}else fe=19500;break}default:{var Oe=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=f.VBR_q&&f.VBR_q<=9){var Ue=Oe[f.VBR_q],je=Oe[f.VBR_q+1],ze=f.VBR_q_frac;fe=linear_int(Ue,je,ze)}else fe=19500}}f.mode==nr.MONO&&(f.VBR==Dt.vbr_off||f.VBR==Dt.vbr_abr)&&(fe*=1.5),f.lowpassfreq=fe|0}if(f.out_samplerate==0&&(2*f.lowpassfreq>f.in_samplerate&&(f.lowpassfreq=f.in_samplerate/2),f.out_samplerate=_(f.lowpassfreq|0,f.in_samplerate)),f.lowpassfreq=Math.min(20500,f.lowpassfreq),f.lowpassfreq=Math.min(f.out_samplerate/2,f.lowpassfreq),f.VBR==Dt.vbr_off&&(f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.brate)),f.VBR==Dt.vbr_abr&&(f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.VBR_mean_bitrate_kbps)),f.bWriteVbrTag||(f.findReplayGain=!1,f.decode_on_the_fly=!1,S.findPeakSample=!1),S.findReplayGain=f.findReplayGain,S.decode_on_the_fly=f.decode_on_the_fly,S.decode_on_the_fly&&(S.findPeakSample=!0),S.findReplayGain&&Z.InitGainAnalysis(S.rgdata,f.out_samplerate)==Xa.INIT_GAIN_ANALYSIS_ERROR)return f.internal_flags=null,-6;switch(S.decode_on_the_fly&&!f.decode_only&&(S.hip!=null&&M.hip_decode_exit(S.hip),S.hip=M.hip_decode_init()),S.mode_gr=f.out_samplerate<=24e3?1:2,f.framesize=576*S.mode_gr,f.encoder_delay=T.ENCDELAY,S.resample_ratio=f.in_samplerate/f.out_samplerate,f.VBR){case Dt.vbr_mt:case Dt.vbr_rh:case Dt.vbr_mtrh:{var nt=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5];f.compression_ratio=nt[f.VBR_q]}break;case Dt.vbr_abr:f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.VBR_mean_bitrate_kbps);break;default:f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.brate);break}if(f.mode==nr.NOT_SET&&(f.mode=nr.JOINT_STEREO),f.highpassfreq>0?(S.highpass1=2*f.highpassfreq,f.highpasswidth>=0?S.highpass2=2*(f.highpassfreq+f.highpasswidth):S.highpass2=(1+0)*2*f.highpassfreq,S.highpass1/=f.out_samplerate,S.highpass2/=f.out_samplerate):(S.highpass1=0,S.highpass2=0),f.lowpassfreq>0?(S.lowpass2=2*f.lowpassfreq,f.lowpasswidth>=0?(S.lowpass1=2*(f.lowpassfreq-f.lowpasswidth),S.lowpass1<0&&(S.lowpass1=0)):S.lowpass1=(1-0)*2*f.lowpassfreq,S.lowpass1/=f.out_samplerate,S.lowpass2/=f.out_samplerate):(S.lowpass1=0,S.lowpass2=0),L(f),S.samplerate_index=k(f.out_samplerate,f),S.samplerate_index<0)return f.internal_flags=null,-1;if(f.VBR==Dt.vbr_off){if(f.free_format)S.bitrate_index=0;else if(f.brate=q(f.brate,f.version,f.out_samplerate),S.bitrate_index=w(f.brate,f.version,f.out_samplerate),S.bitrate_index<=0)return f.internal_flags=null,-1}else S.bitrate_index=1;f.analysis&&(f.bWriteVbrTag=!1),S.pinfo!=null&&(f.bWriteVbrTag=!1),ye.init_bit_stream_w(S);for(var Ke=S.samplerate_index+3*f.version+6*(f.out_samplerate<16e3?1:0),Ve=0;Ve<T.SBMAX_l+1;Ve++)S.scalefac_band.l[Ve]=me.sfBandIndex[Ke].l[Ve];for(var Ve=0;Ve<T.PSFB21+1;Ve++){var xt=(S.scalefac_band.l[22]-S.scalefac_band.l[21])/T.PSFB21,Ot=S.scalefac_band.l[21]+Ve*xt;S.scalefac_band.psfb21[Ve]=Ot}S.scalefac_band.psfb21[T.PSFB21]=576;for(var Ve=0;Ve<T.SBMAX_s+1;Ve++)S.scalefac_band.s[Ve]=me.sfBandIndex[Ke].s[Ve];for(var Ve=0;Ve<T.PSFB12+1;Ve++){var xt=(S.scalefac_band.s[13]-S.scalefac_band.s[12])/T.PSFB12,Ot=S.scalefac_band.s[12]+Ve*xt;S.scalefac_band.psfb12[Ve]=Ot}S.scalefac_band.psfb12[T.PSFB12]=192,f.version==1?S.sideinfo_len=S.channels_out==1?4+17:4+32:S.sideinfo_len=S.channels_out==1?4+9:4+17,f.error_protection&&(S.sideinfo_len+=2),u(f),S.Class_ID=H;{var Rt;for(Rt=0;Rt<19;Rt++)S.nsPsy.pefirbuf[Rt]=700*S.mode_gr*S.channels_out;f.ATHtype==-1&&(f.ATHtype=4)}switch(Gr(f.VBR_q<=9),Gr(f.VBR_q>=0),f.VBR){case Dt.vbr_mt:f.VBR=Dt.vbr_mtrh;case Dt.vbr_mtrh:{f.useTemporal==null&&(f.useTemporal=!1),Q.apply_preset(f,500-f.VBR_q*10,0),f.quality<0&&(f.quality=LAME_DEFAULT_QUALITY),f.quality<5&&(f.quality=0),f.quality>5&&(f.quality=5),S.PSY.mask_adjust=f.maskingadjust,S.PSY.mask_adjust_short=f.maskingadjust_short,f.experimentalY?S.sfb21_extra=!1:S.sfb21_extra=f.out_samplerate>44e3,S.iteration_loop=new VBRNewIterationLoop(Ne);break}case Dt.vbr_rh:{Q.apply_preset(f,500-f.VBR_q*10,0),S.PSY.mask_adjust=f.maskingadjust,S.PSY.mask_adjust_short=f.maskingadjust_short,f.experimentalY?S.sfb21_extra=!1:S.sfb21_extra=f.out_samplerate>44e3,f.quality>6&&(f.quality=6),f.quality<0&&(f.quality=LAME_DEFAULT_QUALITY),S.iteration_loop=new VBROldIterationLoop(Ne);break}default:{var Lt;S.sfb21_extra=!1,f.quality<0&&(f.quality=LAME_DEFAULT_QUALITY),Lt=f.VBR,Lt==Dt.vbr_off&&(f.VBR_mean_bitrate_kbps=f.brate),Q.apply_preset(f,f.VBR_mean_bitrate_kbps,0),f.VBR=Lt,S.PSY.mask_adjust=f.maskingadjust,S.PSY.mask_adjust_short=f.maskingadjust_short,Lt==Dt.vbr_off?S.iteration_loop=new nd(Ne):S.iteration_loop=new ABRIterationLoop(Ne);break}}if(Gr(f.scale>=0),f.VBR!=Dt.vbr_off){if(S.VBR_min_bitrate=1,S.VBR_max_bitrate=14,f.out_samplerate<16e3&&(S.VBR_max_bitrate=8),f.VBR_min_bitrate_kbps!=0&&(f.VBR_min_bitrate_kbps=q(f.VBR_min_bitrate_kbps,f.version,f.out_samplerate),S.VBR_min_bitrate=w(f.VBR_min_bitrate_kbps,f.version,f.out_samplerate),S.VBR_min_bitrate<0)||f.VBR_max_bitrate_kbps!=0&&(f.VBR_max_bitrate_kbps=q(f.VBR_max_bitrate_kbps,f.version,f.out_samplerate),S.VBR_max_bitrate=w(f.VBR_max_bitrate_kbps,f.version,f.out_samplerate),S.VBR_max_bitrate<0))return-1;f.VBR_min_bitrate_kbps=bt.bitrate_table[f.version][S.VBR_min_bitrate],f.VBR_max_bitrate_kbps=bt.bitrate_table[f.version][S.VBR_max_bitrate],f.VBR_mean_bitrate_kbps=Math.min(bt.bitrate_table[f.version][S.VBR_max_bitrate],f.VBR_mean_bitrate_kbps),f.VBR_mean_bitrate_kbps=Math.max(bt.bitrate_table[f.version][S.VBR_min_bitrate],f.VBR_mean_bitrate_kbps)}return f.tune&&(S.PSY.mask_adjust+=f.tune_value_a,S.PSY.mask_adjust_short+=f.tune_value_a),y(f),Gr(f.scale>=0),f.athaa_type<0?S.ATH.useAdjust=3:S.ATH.useAdjust=f.athaa_type,S.ATH.aaSensitivityP=Math.pow(10,f.athaa_sensitivity/-10),f.short_blocks==null&&(f.short_blocks=u0.short_block_allowed),f.short_blocks==u0.short_block_allowed&&(f.mode==nr.JOINT_STEREO||f.mode==nr.STEREO)&&(f.short_blocks=u0.short_block_coupled),f.quant_comp<0&&(f.quant_comp=1),f.quant_comp_short<0&&(f.quant_comp_short=0),f.msfix<0&&(f.msfix=0),f.exp_nspsytune=f.exp_nspsytune|1,f.internal_flags.nsPsy.attackthre<0&&(f.internal_flags.nsPsy.attackthre=Ar.NSATTACKTHRE),f.internal_flags.nsPsy.attackthre_s<0&&(f.internal_flags.nsPsy.attackthre_s=Ar.NSATTACKTHRE_S),Gr(f.scale>=0),f.scale<0&&(f.scale=1),f.ATHtype<0&&(f.ATHtype=4),f.ATHcurve<0&&(f.ATHcurve=4),f.athaa_loudapprox<0&&(f.athaa_loudapprox=2),f.interChRatio<0&&(f.interChRatio=0),f.useTemporal==null&&(f.useTemporal=!0),S.slot_lag=S.frac_SpF=0,f.VBR==Dt.vbr_off&&(S.slot_lag=S.frac_SpF=(f.version+1)*72e3*f.brate%f.out_samplerate|0),me.iteration_init(f),ke.psymodel_init(f),Gr(f.scale>=0),0};function m(f,S){(f.in_buffer_0==null||f.in_buffer_nsamples<S)&&(f.in_buffer_0=Ai(S),f.in_buffer_1=Ai(S),f.in_buffer_nsamples=S)}this.lame_encode_flush=function(f,S,fe,_e){var Oe=f.internal_flags,Ue=dd([2,1152]),je=0,ze,nt,Ke,Ve,xt=Oe.mf_samples_to_encode-T.POSTDELAY,Ot=b(f);if(Oe.mf_samples_to_encode<1)return 0;for(ze=0,f.in_samplerate!=f.out_samplerate&&(xt+=16*f.out_samplerate/f.in_samplerate),Ke=f.framesize-xt%f.framesize,Ke<576&&(Ke+=f.framesize),f.encoder_padding=Ke,Ve=(xt+Ke)/f.framesize;Ve>0&&je>=0;){var Rt=Ot-Oe.mf_size,Lt=f.frameNum;Rt*=f.in_samplerate,Rt/=f.out_samplerate,Rt>1152&&(Rt=1152),Rt<1&&(Rt=1),nt=_e-ze,_e==0&&(nt=0),je=this.lame_encode_buffer(f,Ue[0],Ue[1],Rt,S,fe,nt),fe+=je,ze+=je,Ve-=Lt!=f.frameNum?1:0}if(Oe.mf_samples_to_encode=0,je<0||(nt=_e-ze,_e==0&&(nt=0),ye.flush_bitstream(f),je=ye.copy_buffer(Oe,S,fe,nt,1),je<0))return je;if(fe+=je,ze+=je,nt=_e-ze,_e==0&&(nt=0),f.write_id3tag_automatic){if(he.id3tag_write_v1(f),je=ye.copy_buffer(Oe,S,fe,nt,0),je<0)return je;ze+=je}return ze},this.lame_encode_buffer=function(f,S,fe,_e,Oe,Ue,je){var ze=f.internal_flags,nt=[null,null];if(ze.Class_ID!=H)return-3;if(_e==0)return 0;m(ze,_e),nt[0]=ze.in_buffer_0,nt[1]=ze.in_buffer_1;for(var Ke=0;Ke<_e;Ke++)nt[0][Ke]=S[Ke],ze.channels_in>1&&(nt[1][Ke]=fe[Ke]);return l(f,nt[0],nt[1],_e,Oe,Ue,je)};function b(f){var S=T.BLKSIZE+f.framesize-T.FFTOFFSET;return S=Math.max(S,512+f.framesize-32),Gr(Bt.MFSIZE>=S),S}function l(f,S,fe,_e,Oe,Ue,je){var ze=f.internal_flags,nt=0,Ke,Ve,xt,Ot,Rt,Lt=[null,null],jt=[null,null];if(ze.Class_ID!=H)return-3;if(_e==0)return 0;if(Rt=ye.copy_buffer(ze,Oe,Ue,je,0),Rt<0)return Rt;if(Ue+=Rt,nt+=Rt,jt[0]=S,jt[1]=fe,ri.NEQ(f.scale,0)&&ri.NEQ(f.scale,1))for(Ve=0;Ve<_e;++Ve)jt[0][Ve]*=f.scale,ze.channels_out==2&&(jt[1][Ve]*=f.scale);if(ri.NEQ(f.scale_left,0)&&ri.NEQ(f.scale_left,1))for(Ve=0;Ve<_e;++Ve)jt[0][Ve]*=f.scale_left;if(ri.NEQ(f.scale_right,0)&&ri.NEQ(f.scale_right,1))for(Ve=0;Ve<_e;++Ve)jt[1][Ve]*=f.scale_right;if(f.num_channels==2&&ze.channels_out==1)for(Ve=0;Ve<_e;++Ve)jt[0][Ve]=.5*(jt[0][Ve]+jt[1][Ve]),jt[1][Ve]=0;Ot=b(f),Lt[0]=ze.mfbuf[0],Lt[1]=ze.mfbuf[1];for(var Kt=0;_e>0;){var _r=[null,null],Ln=0,Lr=0;_r[0]=jt[0],_r[1]=jt[1];var Fr=new x;if(Se(f,Lt,_r,Kt,_e,Fr),Ln=Fr.n_in,Lr=Fr.n_out,ze.findReplayGain&&!ze.decode_on_the_fly&&Z.AnalyzeSamples(ze.rgdata,Lt[0],ze.mf_size,Lt[1],ze.mf_size,Lr,ze.channels_out)==Xa.GAIN_ANALYSIS_ERROR)return-6;if(_e-=Ln,Kt+=Ln,ze.channels_out==2,ze.mf_size+=Lr,Gr(ze.mf_size<=Bt.MFSIZE),ze.mf_samples_to_encode<1&&(ze.mf_samples_to_encode=T.ENCDELAY+T.POSTDELAY),ze.mf_samples_to_encode+=Lr,ze.mf_size>=Ot){var _n=je-nt;if(je==0&&(_n=0),Ke=h(f,Lt[0],Lt[1],Oe,Ue,_n),Ke<0)return Ke;for(Ue+=Ke,nt+=Ke,ze.mf_size-=f.framesize,ze.mf_samples_to_encode-=f.framesize,xt=0;xt<ze.channels_out;xt++)for(Ve=0;Ve<ze.mf_size;Ve++)Lt[xt][Ve]=Lt[xt][Ve+f.framesize]}}return Gr(_e==0),nt}function h(f,S,fe,_e,Oe,Ue){var je=C.enc.lame_encode_mp3_frame(f,S,fe,_e,Oe,Ue);return f.frameNum++,je}function x(){this.n_in=0,this.n_out=0}function E(){this.num_used=0}function X(f,S){return S!=0?X(S,f%S):f}function U(f,S,fe){var _e=Math.PI*S;f/=fe,f<0&&(f=0),f>1&&(f=1);var Oe=f-.5,Ue=.42-.5*Math.cos(2*f*Math.PI)+.08*Math.cos(4*f*Math.PI);return Math.abs(Oe)<1e-9?_e/Math.PI:Ue*Math.sin(fe*_e*Oe)/(Math.PI*fe*Oe)}function j(f,S,fe,_e,Oe,Ue,je,ze,nt){var Ke=f.internal_flags,Ve,xt=0,Ot,Rt=f.out_samplerate/X(f.out_samplerate,f.in_samplerate);Rt>Bt.BPC&&(Rt=Bt.BPC);var Lt=Math.abs(Ke.resample_ratio-Math.floor(.5+Ke.resample_ratio))<1e-4?1:0,jt=1/Ke.resample_ratio;jt>1&&(jt=1);var Kt=31;Kt%2==0&&--Kt,Kt+=Lt;var _r=Kt+1;if(Ke.fill_buffer_resample_init==0){for(Ke.inbuf_old[0]=Ai(_r),Ke.inbuf_old[1]=Ai(_r),Ve=0;Ve<=2*Rt;++Ve)Ke.blackfilt[Ve]=Ai(_r);for(Ke.itime[0]=0,Ke.itime[1]=0,xt=0;xt<=2*Rt;xt++){var Ln=0,Lr=(xt-Rt)/(2*Rt);for(Ve=0;Ve<=Kt;Ve++)Ln+=Ke.blackfilt[xt][Ve]=U(Ve-Lr,jt,Kt);for(Ve=0;Ve<=Kt;Ve++)Ke.blackfilt[xt][Ve]/=Ln}Ke.fill_buffer_resample_init=1}var Fr=Ke.inbuf_old[nt];for(Ot=0;Ot<_e;Ot++){var _n,Ii;if(_n=Ot*Ke.resample_ratio,xt=0|Math.floor(_n-Ke.itime[nt]),Kt+xt-Kt/2>=je)break;var Lr=_n-Ke.itime[nt]-(xt+.5*(Kt%2));Gr(Math.abs(Lr)<=.501),Ii=0|Math.floor(Lr*2*Rt+Rt+.5);var Ci=0;for(Ve=0;Ve<=Kt;++Ve){var Sn=Ve+xt-Kt/2,Cr;Gr(Sn<je),Gr(Sn+_r>=0),Cr=Sn<0?Fr[_r+Sn]:Oe[Ue+Sn],Ci+=Cr*Ke.blackfilt[Ii][Ve]}S[fe+Ot]=Ci}if(ze.num_used=Math.min(je,Kt+xt-Kt/2),Ke.itime[nt]+=ze.num_used-Ot*Ke.resample_ratio,ze.num_used>=_r)for(Ve=0;Ve<_r;Ve++)Fr[Ve]=Oe[Ue+ze.num_used+Ve-_r];else{var ii=_r-ze.num_used;for(Ve=0;Ve<ii;++Ve)Fr[Ve]=Fr[Ve+ze.num_used];for(xt=0;Ve<_r;++Ve,++xt)Fr[Ve]=Oe[Ue+xt];Gr(xt==ze.num_used)}return Ot}function Se(f,S,fe,_e,Oe,Ue){var je=f.internal_flags;if(je.resample_ratio<.9999||je.resample_ratio>1.0001)for(var ze=0;ze<je.channels_out;ze++){var nt=new E;Ue.n_out=j(f,S[ze],je.mf_size,f.framesize,fe[ze],_e,Oe,nt,ze),Ue.n_in=nt.num_used}else{Ue.n_out=Math.min(f.framesize,Oe),Ue.n_in=Ue.n_out;for(var Ke=0;Ke<Ue.n_out;++Ke)S[0][je.mf_size+Ke]=fe[0][_e+Ke],je.channels_out==2&&(S[1][je.mf_size+Ke]=fe[1][_e+Ke])}}}var vd=rr,kn=P.VbrMode;function md(){function C(G,de,he,M,K,o,I,H,O,g,_,k,q,w,c){this.vbr_q=G,this.quant_comp=de,this.quant_comp_s=he,this.expY=M,this.st_lrm=K,this.st_s=o,this.masking_adj=I,this.masking_adj_short=H,this.ath_lower=O,this.ath_curve=g,this.ath_sensitivity=_,this.interch=k,this.safejoint=q,this.sfb21mod=w,this.msfix=c}function $(G,de,he,M,K,o,I,H,O,g,_,k,q,w){this.quant_comp=de,this.quant_comp_s=he,this.safejoint=M,this.nsmsfix=K,this.st_lrm=o,this.st_s=I,this.nsbass=H,this.scale=O,this.masking_adj=g,this.ath_lower=_,this.ath_curve=k,this.interch=q,this.sfscale=w}var ie;this.setModules=function(G){ie=G};var Z=[new C(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new C(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new C(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new C(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new C(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new C(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new C(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new C(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new C(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new C(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new C(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],ye=[new C(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new C(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new C(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new C(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new C(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new C(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new C(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new C(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new C(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new C(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new C(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function Q(G,de,he){var M=G.VBR==kn.vbr_rh?Z:ye,K=G.VBR_q_frac,o=M[de],I=M[de+1],H=o;o.st_lrm=o.st_lrm+K*(I.st_lrm-o.st_lrm),o.st_s=o.st_s+K*(I.st_s-o.st_s),o.masking_adj=o.masking_adj+K*(I.masking_adj-o.masking_adj),o.masking_adj_short=o.masking_adj_short+K*(I.masking_adj_short-o.masking_adj_short),o.ath_lower=o.ath_lower+K*(I.ath_lower-o.ath_lower),o.ath_curve=o.ath_curve+K*(I.ath_curve-o.ath_curve),o.ath_sensitivity=o.ath_sensitivity+K*(I.ath_sensitivity-o.ath_sensitivity),o.interch=o.interch+K*(I.interch-o.interch),o.msfix=o.msfix+K*(I.msfix-o.msfix),ke(G,H.vbr_q),he!=0?G.quant_comp=H.quant_comp:Math.abs(G.quant_comp- -1)>0||(G.quant_comp=H.quant_comp),he!=0?G.quant_comp_short=H.quant_comp_s:Math.abs(G.quant_comp_short- -1)>0||(G.quant_comp_short=H.quant_comp_s),H.expY!=0&&(G.experimentalY=H.expY!=0),he!=0?G.internal_flags.nsPsy.attackthre=H.st_lrm:Math.abs(G.internal_flags.nsPsy.attackthre- -1)>0||(G.internal_flags.nsPsy.attackthre=H.st_lrm),he!=0?G.internal_flags.nsPsy.attackthre_s=H.st_s:Math.abs(G.internal_flags.nsPsy.attackthre_s- -1)>0||(G.internal_flags.nsPsy.attackthre_s=H.st_s),he!=0?G.maskingadjust=H.masking_adj:Math.abs(G.maskingadjust-0)>0||(G.maskingadjust=H.masking_adj),he!=0?G.maskingadjust_short=H.masking_adj_short:Math.abs(G.maskingadjust_short-0)>0||(G.maskingadjust_short=H.masking_adj_short),he!=0?G.ATHlower=-H.ath_lower/10:Math.abs(-G.ATHlower*10-0)>0||(G.ATHlower=-H.ath_lower/10),he!=0?G.ATHcurve=H.ath_curve:Math.abs(G.ATHcurve- -1)>0||(G.ATHcurve=H.ath_curve),he!=0?G.athaa_sensitivity=H.ath_sensitivity:Math.abs(G.athaa_sensitivity- -1)>0||(G.athaa_sensitivity=H.ath_sensitivity),H.interch>0&&(he!=0?G.interChRatio=H.interch:Math.abs(G.interChRatio- -1)>0||(G.interChRatio=H.interch)),H.safejoint>0&&(G.exp_nspsytune=G.exp_nspsytune|H.safejoint),H.sfb21mod>0&&(G.exp_nspsytune=G.exp_nspsytune|H.sfb21mod<<20),he!=0?G.msfix=H.msfix:Math.abs(G.msfix- -1)>0||(G.msfix=H.msfix),he==0&&(G.VBR_q=de,G.VBR_q_frac=K)}var me=[new $(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new $(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new $(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new $(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new $(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new $(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new $(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new $(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new $(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new $(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new $(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new $(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new $(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new $(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new $(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new $(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new $(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function Ne(G,de,he){var M=de,K=ie.nearestBitrateFullIndex(de);if(G.VBR=kn.vbr_abr,G.VBR_mean_bitrate_kbps=M,G.VBR_mean_bitrate_kbps=Math.min(G.VBR_mean_bitrate_kbps,320),G.VBR_mean_bitrate_kbps=Math.max(G.VBR_mean_bitrate_kbps,8),G.brate=G.VBR_mean_bitrate_kbps,G.VBR_mean_bitrate_kbps>320&&(G.disable_reservoir=!0),me[K].safejoint>0&&(G.exp_nspsytune=G.exp_nspsytune|2),me[K].sfscale>0&&(G.internal_flags.noise_shaping=2),Math.abs(me[K].nsbass)>0){var o=int(me[K].nsbass*4);o<0&&(o+=64),G.exp_nspsytune=G.exp_nspsytune|o<<2}return he!=0?G.quant_comp=me[K].quant_comp:Math.abs(G.quant_comp- -1)>0||(G.quant_comp=me[K].quant_comp),he!=0?G.quant_comp_short=me[K].quant_comp_s:Math.abs(G.quant_comp_short- -1)>0||(G.quant_comp_short=me[K].quant_comp_s),he!=0?G.msfix=me[K].nsmsfix:Math.abs(G.msfix- -1)>0||(G.msfix=me[K].nsmsfix),he!=0?G.internal_flags.nsPsy.attackthre=me[K].st_lrm:Math.abs(G.internal_flags.nsPsy.attackthre- -1)>0||(G.internal_flags.nsPsy.attackthre=me[K].st_lrm),he!=0?G.internal_flags.nsPsy.attackthre_s=me[K].st_s:Math.abs(G.internal_flags.nsPsy.attackthre_s- -1)>0||(G.internal_flags.nsPsy.attackthre_s=me[K].st_s),he!=0?G.scale=me[K].scale:Math.abs(G.scale- -1)>0||(G.scale=me[K].scale),he!=0?G.maskingadjust=me[K].masking_adj:Math.abs(G.maskingadjust-0)>0||(G.maskingadjust=me[K].masking_adj),me[K].masking_adj>0?he!=0?G.maskingadjust_short=me[K].masking_adj*.9:Math.abs(G.maskingadjust_short-0)>0||(G.maskingadjust_short=me[K].masking_adj*.9):he!=0?G.maskingadjust_short=me[K].masking_adj*1.1:Math.abs(G.maskingadjust_short-0)>0||(G.maskingadjust_short=me[K].masking_adj*1.1),he!=0?G.ATHlower=-me[K].ath_lower/10:Math.abs(-G.ATHlower*10-0)>0||(G.ATHlower=-me[K].ath_lower/10),he!=0?G.ATHcurve=me[K].ath_curve:Math.abs(G.ATHcurve- -1)>0||(G.ATHcurve=me[K].ath_curve),he!=0?G.interChRatio=me[K].interch:Math.abs(G.interChRatio- -1)>0||(G.interChRatio=me[K].interch),de}this.apply_preset=function(G,de,he){switch(de){case At.R3MIX:{de=At.V3,G.VBR=kn.vbr_mtrh;break}case At.MEDIUM:{de=At.V4,G.VBR=kn.vbr_rh;break}case At.MEDIUM_FAST:{de=At.V4,G.VBR=kn.vbr_mtrh;break}case At.STANDARD:{de=At.V2,G.VBR=kn.vbr_rh;break}case At.STANDARD_FAST:{de=At.V2,G.VBR=kn.vbr_mtrh;break}case At.EXTREME:{de=At.V0,G.VBR=kn.vbr_rh;break}case At.EXTREME_FAST:{de=At.V0,G.VBR=kn.vbr_mtrh;break}case At.INSANE:return de=320,G.preset=de,Ne(G,de,he),G.VBR=kn.vbr_off,de}switch(G.preset=de,de){case At.V9:return Q(G,9,he),de;case At.V8:return Q(G,8,he),de;case At.V7:return Q(G,7,he),de;case At.V6:return Q(G,6,he),de;case At.V5:return Q(G,5,he),de;case At.V4:return Q(G,4,he),de;case At.V3:return Q(G,3,he),de;case At.V2:return Q(G,2,he),de;case At.V1:return Q(G,1,he),de;case At.V0:return Q(G,0,he),de;default:break}return 8<=de&&de<=320?Ne(G,de,he):(G.preset=0,de)};function ke(G,de){var he=0;return 0>de&&(he=-1,de=0),9<de&&(he=-1,de=9),G.VBR_q=de,G.VBR_q_frac=0,he}}var pd=md;function hd(){var C,$;this.setModules=function(ie,Z){C=ie,$=Z}}var _d=hd;function Sd(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}var f0=Sd,Pc=P.new_float,gd=P.new_int;function bd(){this.global_gain=0,this.sfb_count1=0,this.step=gd(39),this.noise=Pc(39),this.noise_log=Pc(39)}var xd=bd,ni=P.System,Bc=P.VbrMode,d0=P.Util,ra=P.Arrays,ja=P.new_float,ln=P.assert;function yd(){var C;this.rv=null;var $;this.qupvt=null;var ie,Z=new _d,ye;this.setModules=function(O,g,_,k){C=O,$=g,this.rv=g,ie=_,this.qupvt=_,ye=k,Z.setModules(ie,ye)},this.ms_convert=function(O,g){for(var _=0;_<576;++_){var k=O.tt[g][0].xr[_],q=O.tt[g][1].xr[_];O.tt[g][0].xr[_]=(k+q)*(d0.SQRT2*.5),O.tt[g][1].xr[_]=(k-q)*(d0.SQRT2*.5)}};function Q(O,g,_,k){k=0;for(var q=0;q<=_;++q){var w=Math.abs(O.xr[q]);k+=w,g[q]=Math.sqrt(w*Math.sqrt(w)),g[q]>O.xrpow_max&&(O.xrpow_max=g[q])}return k}this.init_xrpow=function(O,g,_){var k=0,q=0|g.max_nonzero_coeff;if(ln(_!=null),g.xrpow_max=0,ln(0<=q&&q<=575),ra.fill(_,q,576,0),k=Q(g,_,q,k),k>1e-20){var w=0;(O.substep_shaping&2)!=0&&(w=1);for(var c=0;c<g.psymax;c++)O.pseudohalf[c]=w;return!0}return ra.fill(g.l3_enc,0,576,0),!1};function me(O,g){var _=O.ATH,k=g.xr;if(g.block_type!=T.SHORT_TYPE)for(var q=!1,w=T.PSFB21-1;w>=0&&!q;w--){var c=O.scalefac_band.psfb21[w],L=O.scalefac_band.psfb21[w+1],y=ie.athAdjust(_.adjust,_.psfb21[w],_.floor);O.nsPsy.longfact[21]>1e-12&&(y*=O.nsPsy.longfact[21]);for(var u=L-1;u>=c;u--)if(Math.abs(k[u])<y)k[u]=0;else{q=!0;break}}else for(var m=0;m<3;m++)for(var q=!1,w=T.PSFB12-1;w>=0&&!q;w--){var c=O.scalefac_band.s[12]*3+(O.scalefac_band.s[13]-O.scalefac_band.s[12])*m+(O.scalefac_band.psfb12[w]-O.scalefac_band.psfb12[0]),L=c+(O.scalefac_band.psfb12[w+1]-O.scalefac_band.psfb12[w]),b=ie.athAdjust(_.adjust,_.psfb12[w],_.floor);O.nsPsy.shortfact[12]>1e-12&&(b*=O.nsPsy.shortfact[12]);for(var u=L-1;u>=c;u--)if(Math.abs(k[u])<b)k[u]=0;else{q=!0;break}}}this.init_outer_loop=function(O,g){g.part2_3_length=0,g.big_values=0,g.count1=0,g.global_gain=210,g.scalefac_compress=0,g.table_select[0]=0,g.table_select[1]=0,g.table_select[2]=0,g.subblock_gain[0]=0,g.subblock_gain[1]=0,g.subblock_gain[2]=0,g.subblock_gain[3]=0,g.region0_count=0,g.region1_count=0,g.preflag=0,g.scalefac_scale=0,g.count1table_select=0,g.part2_length=0,g.sfb_lmax=T.SBPSY_l,g.sfb_smin=T.SBPSY_s,g.psy_lmax=O.sfb21_extra?T.SBMAX_l:T.SBPSY_l,g.psymax=g.psy_lmax,g.sfbmax=g.sfb_lmax,g.sfbdivide=11;for(var _=0;_<T.SBMAX_l;_++)g.width[_]=O.scalefac_band.l[_+1]-O.scalefac_band.l[_],g.window[_]=3;if(g.block_type==T.SHORT_TYPE){var k=ja(576);g.sfb_smin=0,g.sfb_lmax=0,g.mixed_block_flag!=0&&(g.sfb_smin=3,g.sfb_lmax=O.mode_gr*2+4),g.psymax=g.sfb_lmax+3*((O.sfb21_extra?T.SBMAX_s:T.SBPSY_s)-g.sfb_smin),g.sfbmax=g.sfb_lmax+3*(T.SBPSY_s-g.sfb_smin),g.sfbdivide=g.sfbmax-18,g.psy_lmax=g.sfb_lmax;var q=O.scalefac_band.l[g.sfb_lmax];ni.arraycopy(g.xr,0,k,0,576);for(var _=g.sfb_smin;_<T.SBMAX_s;_++)for(var w=O.scalefac_band.s[_],c=O.scalefac_band.s[_+1],L=0;L<3;L++)for(var y=w;y<c;y++)g.xr[q++]=k[3*y+L];for(var u=g.sfb_lmax,_=g.sfb_smin;_<T.SBMAX_s;_++)g.width[u]=g.width[u+1]=g.width[u+2]=O.scalefac_band.s[_+1]-O.scalefac_band.s[_],g.window[u]=0,g.window[u+1]=1,g.window[u+2]=2,u+=3}g.count1bits=0,g.sfb_partition_table=ie.nr_of_sfb_block[0][0],g.slen[0]=0,g.slen[1]=0,g.slen[2]=0,g.slen[3]=0,g.max_nonzero_coeff=575,ra.fill(g.scalefac,0),me(O,g)};function Ne(O){this.ordinal=O}Ne.BINSEARCH_NONE=new Ne(0),Ne.BINSEARCH_UP=new Ne(1),Ne.BINSEARCH_DOWN=new Ne(2);function ke(O,g,_,k,q){var w,c=O.CurrentStep[k],L=!1,y=O.OldValue[k],u=Ne.BINSEARCH_NONE;for(g.global_gain=y,_-=g.part2_length,ln(c!=0);;){var m;if(w=ye.count_bits(O,q,g,null),c==1||w==_)break;w>_?(u==Ne.BINSEARCH_DOWN&&(L=!0),L&&(c/=2),u=Ne.BINSEARCH_UP,m=c):(u==Ne.BINSEARCH_UP&&(L=!0),L&&(c/=2),u=Ne.BINSEARCH_DOWN,m=-c),g.global_gain+=m,g.global_gain<0&&(g.global_gain=0,L=!0),g.global_gain>255&&(g.global_gain=255,L=!0)}for(ln(g.global_gain>=0),ln(g.global_gain<256);w>_&&g.global_gain<255;)g.global_gain++,w=ye.count_bits(O,q,g,null);return O.CurrentStep[k]=y-g.global_gain>=4?4:2,O.OldValue[k]=g.global_gain,g.part2_3_length=w,w}this.trancate_smallspectrums=function(O,g,_,k){var q=ja(xi.SFBMAX);if(!((O.substep_shaping&4)==0&&g.block_type==T.SHORT_TYPE||(O.substep_shaping&128)!=0)){ie.calc_noise(g,_,q,new f0,null);for(var c=0;c<576;c++){var w=0;g.l3_enc[c]!=0&&(w=Math.abs(g.xr[c])),k[c]=w}var c=0,L=8;g.block_type==T.SHORT_TYPE&&(L=6);do{var y,u,m,b,l=g.width[L];if(c+=l,!(q[L]>=1)&&(ra.sort(k,c-l,l),!Xn.EQ(k[c-1],0))){y=(1-q[L])*_[L],u=0,b=0;do{var h;for(m=1;b+m<l&&!Xn.NEQ(k[b+c-l],k[b+c+m-l]);m++);if(h=k[b+c-l]*k[b+c-l]*m,y<h){b!=0&&(u=k[b+c-l-1]);break}y-=h,b+=m}while(b<l);if(!Xn.EQ(u,0))do Math.abs(g.xr[c-l])<=u&&(g.l3_enc[c-l]=0);while(--l>0)}}while(++L<g.psymax);g.part2_3_length=ye.noquant_count_bits(O,g,null)}};function G(O){for(var g=0;g<O.sfbmax;g++)if(O.scalefac[g]+O.subblock_gain[O.window[g]]==0)return!1;return!0}function de(O){return d0.FAST_LOG10(.368+.632*O*O*O)}function he(O,g){for(var _=1e-37,k=0;k<g.psymax;k++)_+=de(O[k]);return Math.max(1e-20,_)}function M(O,g,_,k,q){var w;switch(O){default:case 9:{g.over_count>0?(w=_.over_SSD<=g.over_SSD,_.over_SSD==g.over_SSD&&(w=_.bits<g.bits)):w=_.max_noise<0&&_.max_noise*10+_.bits<=g.max_noise*10+g.bits;break}case 0:w=_.over_count<g.over_count||_.over_count==g.over_count&&_.over_noise<g.over_noise||_.over_count==g.over_count&&Xn.EQ(_.over_noise,g.over_noise)&&_.tot_noise<g.tot_noise;break;case 8:_.max_noise=he(q,k);case 1:w=_.max_noise<g.max_noise;break;case 2:w=_.tot_noise<g.tot_noise;break;case 3:w=_.tot_noise<g.tot_noise&&_.max_noise<g.max_noise;break;case 4:w=_.max_noise<=0&&g.max_noise>.2||_.max_noise<=0&&g.max_noise<0&&g.max_noise>_.max_noise-.2&&_.tot_noise<g.tot_noise||_.max_noise<=0&&g.max_noise>0&&g.max_noise>_.max_noise-.2&&_.tot_noise<g.tot_noise+g.over_noise||_.max_noise>0&&g.max_noise>-.05&&g.max_noise>_.max_noise-.1&&_.tot_noise+_.over_noise<g.tot_noise+g.over_noise||_.max_noise>0&&g.max_noise>-.1&&g.max_noise>_.max_noise-.15&&_.tot_noise+_.over_noise+_.over_noise<g.tot_noise+g.over_noise+g.over_noise;break;case 5:w=_.over_noise<g.over_noise||Xn.EQ(_.over_noise,g.over_noise)&&_.tot_noise<g.tot_noise;break;case 6:w=_.over_noise<g.over_noise||Xn.EQ(_.over_noise,g.over_noise)&&(_.max_noise<g.max_noise||Xn.EQ(_.max_noise,g.max_noise)&&_.tot_noise<=g.tot_noise);break;case 7:w=_.over_count<g.over_count||_.over_noise<g.over_noise;break}return g.over_count==0&&(w=w&&_.bits<g.bits),w}function K(O,g,_,k,q){var w=O.internal_flags,c;g.scalefac_scale==0?c=1.2968395546510096:c=1.6817928305074292;for(var L=0,y=0;y<g.sfbmax;y++)L<_[y]&&(L=_[y]);var u=w.noise_shaping_amp;switch(u==3&&(q?u=2:u=1),u){case 2:break;case 1:L>1?L=Math.pow(L,.5):L*=.95;break;case 0:default:L>1?L=1:L*=.95;break}for(var m=0,y=0;y<g.sfbmax;y++){var b=g.width[y],l;if(m+=b,!(_[y]<L)){if((w.substep_shaping&2)!=0&&(w.pseudohalf[y]=w.pseudohalf[y]==0?1:0,w.pseudohalf[y]==0&&w.noise_shaping_amp==2))return;for(g.scalefac[y]++,l=-b;l<0;l++)k[m+l]*=c,k[m+l]>g.xrpow_max&&(g.xrpow_max=k[m+l]);if(w.noise_shaping_amp==2)return}}}function o(O,g){for(var _=1.2968395546510096,k=0,q=0;q<O.sfbmax;q++){var w=O.width[q],c=O.scalefac[q];if(O.preflag!=0&&(c+=ie.pretab[q]),k+=w,(c&1)!=0){c++;for(var L=-w;L<0;L++)g[k+L]*=_,g[k+L]>O.xrpow_max&&(O.xrpow_max=g[k+L])}O.scalefac[q]=c>>1}O.preflag=0,O.scalefac_scale=1}function I(O,g,_){var k,q=g.scalefac;for(k=0;k<g.sfb_lmax;k++)if(q[k]>=16)return!0;for(var w=0;w<3;w++){var c=0,L=0;for(k=g.sfb_lmax+w;k<g.sfbdivide;k+=3)c<q[k]&&(c=q[k]);for(;k<g.sfbmax;k+=3)L<q[k]&&(L=q[k]);if(!(c<16&&L<8)){if(g.subblock_gain[w]>=7)return!0;g.subblock_gain[w]++;var y=O.scalefac_band.l[g.sfb_lmax];for(k=g.sfb_lmax+w;k<g.sfbmax;k+=3){var u,m=g.width[k],b=q[k];if(ln(b>=0),b=b-(4>>g.scalefac_scale),b>=0){q[k]=b,y+=m*3;continue}q[k]=0;{var l=210+(b<<g.scalefac_scale+1);u=ie.IPOW20(l)}y+=m*(w+1);for(var h=-m;h<0;h++)_[y+h]*=u,_[y+h]>g.xrpow_max&&(g.xrpow_max=_[y+h]);y+=m*(3-w-1)}{var u=ie.IPOW20(202);y+=g.width[k]*(w+1);for(var h=-g.width[k];h<0;h++)_[y+h]*=u,_[y+h]>g.xrpow_max&&(g.xrpow_max=_[y+h])}}}return!1}function H(O,g,_,k,q){var w=O.internal_flags;K(O,g,_,k,q);var c=G(g);return c?!1:(w.mode_gr==2?c=ye.scale_bitcount(g):c=ye.scale_bitcount_lsf(w,g),c?(w.noise_shaping>1&&(ra.fill(w.pseudohalf,0),g.scalefac_scale==0?(o(g,k),c=!1):g.block_type==T.SHORT_TYPE&&w.subblock_gain>0&&(c=I(w,g,k)||G(g))),c||(w.mode_gr==2?c=ye.scale_bitcount(g):c=ye.scale_bitcount_lsf(w,g)),!c):!0)}this.outer_loop=function(O,g,_,k,q,w){var c=O.internal_flags,L=new Oo,y=ja(576),u=ja(xi.SFBMAX),m=new f0,b,l=new xd,h=9999999,x=!1,E=!1,X=0;if(ke(c,g,w,q,k),c.noise_shaping==0)return 100;ie.calc_noise(g,_,u,m,l),m.bits=g.part2_3_length,L.assign(g);var U=0;for(ni.arraycopy(k,0,y,0,576);!x;){do{var j=new f0,Se,f=255;if((c.substep_shaping&2)!=0?Se=20:Se=3,c.sfb21_extra&&(u[L.sfbmax]>1||L.block_type==T.SHORT_TYPE&&(u[L.sfbmax+1]>1||u[L.sfbmax+2]>1))||!H(O,L,u,k,E))break;L.scalefac_scale!=0&&(f=254);var S=w-L.part2_length;if(S<=0)break;for(;(L.part2_3_length=ye.count_bits(c,k,L,l))>S&&L.global_gain<=f;)L.global_gain++;if(L.global_gain>f)break;if(m.over_count==0){for(;(L.part2_3_length=ye.count_bits(c,k,L,l))>h&&L.global_gain<=f;)L.global_gain++;if(L.global_gain>f)break}if(ie.calc_noise(L,_,u,j,l),j.bits=L.part2_3_length,g.block_type!=T.SHORT_TYPE?b=O.quant_comp:b=O.quant_comp_short,b=M(b,m,j,L,u)?1:0,b!=0)h=g.part2_3_length,m=j,g.assign(L),U=0,ni.arraycopy(k,0,y,0,576);else if(c.full_outer_loop==0&&(++U>Se&&m.over_count==0||c.noise_shaping_amp==3&&E&&U>30||c.noise_shaping_amp==3&&E&&L.global_gain-X>15))break}while(L.global_gain+L.scalefac_scale<255);c.noise_shaping_amp==3?E?x=!0:(L.assign(g),ni.arraycopy(y,0,k,0,576),U=0,X=L.global_gain,E=!0):x=!0}return ln(g.global_gain+g.scalefac_scale<=255),O.VBR==Bc.vbr_rh||O.VBR==Bc.vbr_mtrh?ni.arraycopy(y,0,k,0,576):(c.substep_shaping&1)!=0&&trancate_smallspectrums(c,g,_,k),m.over_count},this.iteration_finish_one=function(O,g,_){var k=O.l3_side,q=k.tt[g][_];ye.best_scalefac_store(O,g,_,k),O.use_best_huffman==1&&ye.best_huffman_divide(O,q),$.ResvAdjust(O,q)},this.VBR_encode_granule=function(O,g,_,k,q,w,c){var L=O.internal_flags,y=new Oo,u=ja(576),m=c,b=c+1,l=(c+w)/2,h,x,E=0,X=L.sfb21_extra;ln(m<=LameInternalFlags.MAX_BITS_PER_CHANNEL),ra.fill(y.l3_enc,0);do ln(l>=w),ln(l<=c),ln(w<=c),l>m-42?L.sfb21_extra=!1:L.sfb21_extra=X,x=outer_loop(O,g,_,k,q,l),x<=0?(E=1,b=g.part2_3_length,y.assign(g),ni.arraycopy(k,0,u,0,576),c=b-32,h=c-w,l=(c+w)/2):(w=l+32,h=c-w,l=(c+w)/2,E!=0&&(E=2,g.assign(y),ni.arraycopy(u,0,k,0,576)));while(h>12);L.sfb21_extra=X,E==2&&ni.arraycopy(y.l3_enc,0,g.l3_enc,0,576),ln(g.part2_3_length<=m)},this.get_framebits=function(O,g){var _=O.internal_flags;_.bitrate_index=_.VBR_min_bitrate;var k=C.getframebits(O);_.bitrate_index=1,k=C.getframebits(O);for(var q=1;q<=_.VBR_max_bitrate;q++){_.bitrate_index=q;var w=new MeanBits(k);g[q]=$.ResvFrameBegin(O,w),k=w.bits}},this.VBR_old_prepare=function(O,g,_,k,q,w,c,L,y){var u=O.internal_flags,m,b=0,l=1,h=0;u.bitrate_index=u.VBR_max_bitrate;var x=$.ResvFrameBegin(O,new MeanBits(0))/u.mode_gr;get_framebits(O,w);for(var E=0;E<u.mode_gr;E++){var X=ie.on_pe(O,g,L[E],x,E,0);u.mode_ext==T.MPG_MD_MS_LR&&(ms_convert(u.l3_side,E),ie.reduce_side(L[E],_[E],x,X));for(var U=0;U<u.channels_out;++U){var j=u.l3_side.tt[E][U];j.block_type!=T.SHORT_TYPE?(b=1.28/(1+Math.exp(3.5-g[E][U]/300))-.05,m=u.PSY.mask_adjust-b):(b=2.56/(1+Math.exp(3.5-g[E][U]/300))-.14,m=u.PSY.mask_adjust_short-b),u.masking_lower=Math.pow(10,m*.1),init_outer_loop(u,j),y[E][U]=ie.calc_xmin(O,k[E][U],j,q[E][U]),y[E][U]!=0&&(l=0),c[E][U]=126,h+=L[E][U]}}for(var E=0;E<u.mode_gr;E++)for(var U=0;U<u.channels_out;U++)h>w[u.VBR_max_bitrate]&&(L[E][U]*=w[u.VBR_max_bitrate],L[E][U]/=h),c[E][U]>L[E][U]&&(c[E][U]=L[E][U]);return l},this.bitpressure_strategy=function(O,g,_,k){for(var q=0;q<O.mode_gr;q++)for(var w=0;w<O.channels_out;w++){for(var c=O.l3_side.tt[q][w],L=g[q][w],y=0,u=0;u<c.psy_lmax;u++)L[y++]*=1+.029*u*u/T.SBMAX_l/T.SBMAX_l;if(c.block_type==T.SHORT_TYPE)for(var u=c.sfb_smin;u<T.SBMAX_s;u++)L[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s,L[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s,L[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s;k[q][w]=0|Math.max(_[q][w],.9*k[q][w])}},this.VBR_new_prepare=function(O,g,_,k,q,w){var c=O.internal_flags,L=1,y=0,u=0,m;if(O.free_format){c.bitrate_index=0;var b=new MeanBits(y);m=$.ResvFrameBegin(O,b),y=b.bits,q[0]=m}else{c.bitrate_index=c.VBR_max_bitrate;var b=new MeanBits(y);$.ResvFrameBegin(O,b),y=b.bits,get_framebits(O,q),m=q[c.VBR_max_bitrate]}for(var l=0;l<c.mode_gr;l++){ie.on_pe(O,g,w[l],y,l,0),c.mode_ext==T.MPG_MD_MS_LR&&ms_convert(c.l3_side,l);for(var h=0;h<c.channels_out;++h){var x=c.l3_side.tt[l][h];c.masking_lower=Math.pow(10,c.PSY.mask_adjust*.1),init_outer_loop(c,x),ie.calc_xmin(O,_[l][h],x,k[l][h])!=0&&(L=0),u+=w[l][h]}}for(var l=0;l<c.mode_gr;l++)for(var h=0;h<c.channels_out;h++)u>m&&(w[l][h]*=m,w[l][h]/=u);return L},this.calc_target_bits=function(O,g,_,k,q,w){var c=O.internal_flags,L=c.l3_side,y,u,m,b,l=0;c.bitrate_index=c.VBR_max_bitrate;var h=new MeanBits(l);for(w[0]=$.ResvFrameBegin(O,h),l=h.bits,c.bitrate_index=1,l=C.getframebits(O)-c.sideinfo_len*8,q[0]=l/(c.mode_gr*c.channels_out),l=O.VBR_mean_bitrate_kbps*O.framesize*1e3,(c.substep_shaping&1)!=0&&(l*=1.09),l/=O.out_samplerate,l-=c.sideinfo_len*8,l/=c.mode_gr*c.channels_out,y=.93+.07*(11-O.compression_ratio)/(11-5.5),y<.9&&(y=.9),y>1&&(y=1),u=0;u<c.mode_gr;u++){var x=0;for(m=0;m<c.channels_out;m++){if(k[u][m]=int(y*l),g[u][m]>700){var E=int((g[u][m]-700)/1.4),X=L.tt[u][m];k[u][m]=int(y*l),X.block_type==T.SHORT_TYPE&&E<l/2&&(E=l/2),E>l*3/2?E=l*3/2:E<0&&(E=0),k[u][m]+=E}k[u][m]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(k[u][m]=LameInternalFlags.MAX_BITS_PER_CHANNEL),x+=k[u][m]}if(x>LameInternalFlags.MAX_BITS_PER_GRANULE)for(m=0;m<c.channels_out;++m)k[u][m]*=LameInternalFlags.MAX_BITS_PER_GRANULE,k[u][m]/=x}if(c.mode_ext==T.MPG_MD_MS_LR)for(u=0;u<c.mode_gr;u++)ie.reduce_side(k[u],_[u],l*c.channels_out,LameInternalFlags.MAX_BITS_PER_GRANULE);for(b=0,u=0;u<c.mode_gr;u++)for(m=0;m<c.channels_out;m++)k[u][m]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(k[u][m]=LameInternalFlags.MAX_BITS_PER_CHANNEL),b+=k[u][m];if(b>w[0])for(u=0;u<c.mode_gr;u++)for(m=0;m<c.channels_out;m++)k[u][m]*=w[0],k[u][m]/=b}}var Ed=yd,qo=P.assert;function wd(){var C;this.setModules=function($){C=$},this.ResvFrameBegin=function($,ie){var Z=$.internal_flags,ye,Q=Z.l3_side,me=C.getframebits($);ie.bits=(me-Z.sideinfo_len*8)/Z.mode_gr;var Ne=8*256*Z.mode_gr-8;$.brate>320?ye=8*int($.brate*1e3/($.out_samplerate/1152)/8+.5):(ye=8*1440,$.strict_ISO&&(ye=8*int(32e4/($.out_samplerate/1152)/8+.5))),Z.ResvMax=ye-me,Z.ResvMax>Ne&&(Z.ResvMax=Ne),(Z.ResvMax<0||$.disable_reservoir)&&(Z.ResvMax=0);var ke=ie.bits*Z.mode_gr+Math.min(Z.ResvSize,Z.ResvMax);return ke>ye&&(ke=ye),qo(Z.ResvMax%8==0),qo(Z.ResvMax>=0),Q.resvDrain_pre=0,Z.pinfo!=null&&(Z.pinfo.mean_bits=ie.bits/2,Z.pinfo.resvsize=Z.ResvSize),ke},this.ResvMaxBits=function($,ie,Z,ye){var Q=$.internal_flags,me,Ne=Q.ResvSize,ke=Q.ResvMax;ye!=0&&(Ne+=ie),(Q.substep_shaping&1)!=0&&(ke*=.9),Z.bits=ie,Ne*10>ke*9?(me=Ne-ke*9/10,Z.bits+=me,Q.substep_shaping|=128):(me=0,Q.substep_shaping&=127,!$.disable_reservoir&&(Q.substep_shaping&1)==0&&(Z.bits-=.1*ie));var G=Ne<Q.ResvMax*6/10?Ne:Q.ResvMax*6/10;return G-=me,G<0&&(G=0),G},this.ResvAdjust=function($,ie){$.ResvSize-=ie.part2_3_length+ie.part2_length},this.ResvFrameEnd=function($,ie){var Z,ye=$.l3_side;$.ResvSize+=ie*$.mode_gr;var Q=0;ye.resvDrain_post=0,ye.resvDrain_pre=0,(Z=$.ResvSize%8)!=0&&(Q+=Z),Z=$.ResvSize-Q-$.ResvMax,Z>0&&(qo(Z%8==0),qo(Z>=0),Q+=Z);{var me=Math.min(ye.main_data_begin*8,Q)/8;ye.resvDrain_pre+=8*me,Q-=8*me,$.ResvSize-=8*me,ye.main_data_begin-=me}ye.resvDrain_post+=Q,$.ResvSize-=Q}}var Rd=wd;function Td(){var C="http://www.mp3dev.org/",$=3,ie=98,Z=4,ye=0,Q=93;this.getLameVersion=function(){return $+"."+ie+"."+Z},this.getLameShortVersion=function(){return $+"."+ie+"."+Z},this.getLameVeryShortVersion=function(){return"LAME"+$+"."+ie+"r"},this.getPsyVersion=function(){return ye+"."+Q},this.getLameUrl=function(){return C},this.getLameOsBitness=function(){return"32bits"}}var Ad=Td,Id=P.System,v0=P.VbrMode,Nc=P.ShortBlock,Cd=P.Arrays,zo=P.new_byte,Md=P.assert;Ga.NUMTOCENTRIES=100,Ga.MAXFRAMESIZE=2880;function Ga(){var C,$,ie;this.setModules=function(l,h,x){C=l,$=h,ie=x};var Z=1,ye=2,Q=4,me=8,Ne=Ga.NUMTOCENTRIES,ke=Ga.MAXFRAMESIZE,G=Ne+4+4+4+4+4,de=G+9+1+1+8+1+1+3+1+1+2+4+2+2,he=128,M=64,K=32,o=null,I="Xing",H="Info",O=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function g(l,h){if(l.nVbrNumFrames++,l.sum+=h,l.seen++,!(l.seen<l.want)&&(l.pos<l.size&&(l.bag[l.pos]=l.sum,l.pos++,l.seen=0),l.pos==l.size)){for(var x=1;x<l.size;x+=2)l.bag[x/2]=l.bag[x];l.want*=2,l.pos/=2}}function _(l,h){if(!(l.pos<=0))for(var x=1;x<Ne;++x){var E=x/Ne,X,U,j=0|Math.floor(E*l.pos);j>l.pos-1&&(j=l.pos-1),X=l.bag[j],U=l.sum;var Se=0|256*X/U;Se>255&&(Se=255),h[x]=255&Se}}this.addVbrFrame=function(l){var h=l.internal_flags,x=Tables.bitrate_table[l.version][h.bitrate_index];Md(h.VBR_seek_table.bag!=null),g(h.VBR_seek_table,x)};function k(l,h){var x=l[h+0]&255;return x<<=8,x|=l[h+1]&255,x<<=8,x|=l[h+2]&255,x<<=8,x|=l[h+3]&255,x}function q(l,h,x){l[h+0]=255&(x>>24&255),l[h+1]=255&(x>>16&255),l[h+2]=255&(x>>8&255),l[h+3]=255&(x&255)}function w(l,h,x){l[h+0]=255&(x>>8&255),l[h+1]=255&(x&255)}function c(l,h){return new String(l,h,I.length(),o).equals(I)||new String(l,h,H.length(),o).equals(H)}function L(l,h,x){return 255&(l<<h|x&~(-1<<h))}function y(l,h){var x=l.internal_flags;h[0]=L(h[0],8,255),h[1]=L(h[1],3,7),h[1]=L(h[1],1,l.out_samplerate<16e3?0:1),h[1]=L(h[1],1,l.version),h[1]=L(h[1],2,4-3),h[1]=L(h[1],1,l.error_protection?0:1),h[2]=L(h[2],4,x.bitrate_index),h[2]=L(h[2],2,x.samplerate_index),h[2]=L(h[2],1,0),h[2]=L(h[2],1,l.extension),h[3]=L(h[3],2,l.mode.ordinal()),h[3]=L(h[3],2,x.mode_ext),h[3]=L(h[3],1,l.copyright),h[3]=L(h[3],1,l.original),h[3]=L(h[3],2,l.emphasis),h[0]=255;var E=255&(h[1]&241),X;l.version==1?X=he:l.out_samplerate<16e3?X=K:X=M,l.VBR==v0.vbr_off&&(X=l.brate);var U;l.free_format?U=0:U=255&16*C.BitrateIndex(X,l.version,l.out_samplerate),l.version==1?(h[1]=255&(E|10),E=255&(h[2]&13),h[2]=255&(U|E)):(h[1]=255&(E|2),E=255&(h[2]&13),h[2]=255&(U|E))}this.getVbrTag=function(l){var h=new VBRTagData,x=0;h.flags=0;var E=l[x+1]>>3&1,X=l[x+2]>>2&3,U=l[x+3]>>6&3,j=l[x+2]>>4&15;if(j=Tables.bitrate_table[E][j],l[x+1]>>4==14?h.samprate=Tables.samplerate_table[2][X]:h.samprate=Tables.samplerate_table[E][X],E!=0?U!=3?x+=32+4:x+=17+4:U!=3?x+=17+4:x+=9+4,!c(l,x))return null;x+=4,h.hId=E;var Se=h.flags=k(l,x);if(x+=4,(Se&Z)!=0&&(h.frames=k(l,x),x+=4),(Se&ye)!=0&&(h.bytes=k(l,x),x+=4),(Se&Q)!=0){if(h.toc!=null)for(var f=0;f<Ne;f++)h.toc[f]=l[x+f];x+=Ne}h.vbrScale=-1,(Se&me)!=0&&(h.vbrScale=k(l,x),x+=4),h.headersize=(E+1)*72e3*j/h.samprate,x+=21;var S=l[x+0]<<4;S+=l[x+1]>>4;var fe=(l[x+1]&15)<<8;return fe+=l[x+2]&255,(S<0||S>3e3)&&(S=-1),(fe<0||fe>3e3)&&(fe=-1),h.encDelay=S,h.encPadding=fe,h},this.InitVbrTag=function(l){var h=l.internal_flags,x;l.version==1?x=he:l.out_samplerate<16e3?x=K:x=M,l.VBR==v0.vbr_off&&(x=l.brate);var E=(l.version+1)*72e3*x/l.out_samplerate,X=h.sideinfo_len+de;if(h.VBR_seek_table.TotalFrameSize=E,E<X||E>ke){l.bWriteVbrTag=!1;return}h.VBR_seek_table.nVbrNumFrames=0,h.VBR_seek_table.nBytesWritten=0,h.VBR_seek_table.sum=0,h.VBR_seek_table.seen=0,h.VBR_seek_table.want=1,h.VBR_seek_table.pos=0,h.VBR_seek_table.bag==null&&(h.VBR_seek_table.bag=new int[400],h.VBR_seek_table.size=400);var U=zo(ke);y(l,U);for(var j=h.VBR_seek_table.TotalFrameSize,Se=0;Se<j;++Se)$.add_dummy_byte(l,U[Se]&255,1)};function u(l,h){var x=h^l;return h=h>>8^O[x&255],h}this.updateMusicCRC=function(l,h,x,E){for(var X=0;X<E;++X)l[0]=u(h[x+X],l[0])};function m(l,h,x,E,X){var U=l.internal_flags,j=0,Se=l.encoder_delay,f=l.encoder_padding,S=100-10*l.VBR_q-l.quality,fe=ie.getLameVeryShortVersion(),_e,Oe=0,Ue,je=[1,5,3,2,4,0,3],ze=0|(l.lowpassfreq/100+.5>255?255:l.lowpassfreq/100+.5),nt=0,Ke=0,Ve=0,xt=l.internal_flags.noise_shaping,Ot=0,Rt=0,Lt=0,jt=0,Kt=0,_r=(l.exp_nspsytune&1)!=0,Ln=(l.exp_nspsytune&2)!=0,Lr=!1,Fr=!1,_n=l.internal_flags.nogap_total,Ii=l.internal_flags.nogap_current,Ci=l.ATHtype,Sn=0,Cr;switch(l.VBR){case vbr_abr:Cr=l.VBR_mean_bitrate_kbps;break;case vbr_off:Cr=l.brate;break;default:Cr=l.VBR_min_bitrate_kbps}switch(l.VBR.ordinal()<je.length?_e=je[l.VBR.ordinal()]:_e=0,Ue=16*Oe+_e,U.findReplayGain&&(U.RadioGain>510&&(U.RadioGain=510),U.RadioGain<-510&&(U.RadioGain=-510),Ke=8192,Ke|=3072,U.RadioGain>=0?Ke|=U.RadioGain:(Ke|=512,Ke|=-U.RadioGain)),U.findPeakSample&&(nt=Math.abs(0|U.PeakSample/32767*Math.pow(2,23)+.5)),_n!=-1&&(Ii>0&&(Fr=!0),Ii<_n-1&&(Lr=!0)),Sn=Ci+((_r?1:0)<<4)+((Ln?1:0)<<5)+((Lr?1:0)<<6)+((Fr?1:0)<<7),S<0&&(S=0),l.mode){case MONO:Ot=0;break;case STEREO:Ot=1;break;case DUAL_CHANNEL:Ot=2;break;case JOINT_STEREO:l.force_ms?Ot=4:Ot=3;break;case NOT_SET:default:Ot=7;break}l.in_samplerate<=32e3?Lt=0:l.in_samplerate==48e3?Lt=2:l.in_samplerate>48e3?Lt=3:Lt=1,(l.short_blocks==Nc.short_block_forced||l.short_blocks==Nc.short_block_dispensed||l.lowpassfreq==-1&&l.highpassfreq==-1||l.scale_left<l.scale_right||l.scale_left>l.scale_right||l.disable_reservoir&&l.brate<320||l.noATH||l.ATHonly||Ci==0||l.in_samplerate<=32e3)&&(Rt=1),jt=xt+(Ot<<2)+(Rt<<5)+(Lt<<6),Kt=U.nMusicCRC,q(x,E+j,S),j+=4;for(var ii=0;ii<9;ii++)x[E+j+ii]=255&fe.charAt(ii);j+=9,x[E+j]=255&Ue,j++,x[E+j]=255&ze,j++,q(x,E+j,nt),j+=4,w(x,E+j,Ke),j+=2,w(x,E+j,Ve),j+=2,x[E+j]=255&Sn,j++,Cr>=255?x[E+j]=255:x[E+j]=255&Cr,j++,x[E+j]=255&Se>>4,x[E+j+1]=255&(Se<<4)+(f>>8),x[E+j+2]=255&f,j+=3,x[E+j]=255&jt,j++,x[E+j++]=0,w(x,E+j,l.preset),j+=2,q(x,E+j,h),j+=4,w(x,E+j,Kt),j+=2;for(var Ka=0;Ka<j;Ka++)X=u(x[E+Ka],X);return w(x,E+j,X),j+=2,j}function b(l){l.seek(0);var h=zo(10);l.readFully(h);var x;return new String(h,"ISO-8859-1").startsWith("ID3")?x=0:x=((h[6]&127)<<21|(h[7]&127)<<14|(h[8]&127)<<7|h[9]&127)+h.length,x}this.getLameTagFrame=function(l,h){var x=l.internal_flags;if(!l.bWriteVbrTag||x.Class_ID!=At.LAME_ID||x.VBR_seek_table.pos<=0)return 0;if(h.length<x.VBR_seek_table.TotalFrameSize)return x.VBR_seek_table.TotalFrameSize;Cd.fill(h,0,x.VBR_seek_table.TotalFrameSize,0),y(l,h);var E=zo(Ne);if(l.free_format)for(var X=1;X<Ne;++X)E[X]=255&255*X/100;else _(x.VBR_seek_table,E);var U=x.sideinfo_len;l.error_protection&&(U-=2),l.VBR==v0.vbr_off?(h[U++]=255&H.charAt(0),h[U++]=255&H.charAt(1),h[U++]=255&H.charAt(2),h[U++]=255&H.charAt(3)):(h[U++]=255&I.charAt(0),h[U++]=255&I.charAt(1),h[U++]=255&I.charAt(2),h[U++]=255&I.charAt(3)),q(h,U,Z+ye+Q+me),U+=4,q(h,U,x.VBR_seek_table.nVbrNumFrames),U+=4;var j=x.VBR_seek_table.nBytesWritten+x.VBR_seek_table.TotalFrameSize;q(h,U,0|j),U+=4,Id.arraycopy(E,0,h,U,E.length),U+=E.length,l.error_protection&&$.CRC_writeheader(x,h);for(var Se=0,X=0;X<U;X++)Se=u(h[X],Se);return U+=m(l,j,h,U,Se),x.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(l,h){var x=l.internal_flags;if(x.VBR_seek_table.pos<=0||(h.seek(h.length()),h.length()==0))return-1;var E=b(h);h.seek(E);var X=zo(ke),U=getLameTagFrame(l,X);return U>X.length?-1:(U<1||h.write(X,0,U),0)}}var Pd=Ga,Dc=P.new_byte,kc=P.assert,At=vd,Bd=pd,Xa=Ir,Nd=ti,Dd=Ed,kd=c0,Od=Rd,nr=ea,Xn=ri;function Ld(){var C,$;this.setModules=function(ie,Z){C=ie,$=Z}}function Fd(){var C,$,ie;this.setModules=function(Z,ye,Q){C=Z,$=ye,ie=Q}}function Ud(){}function Hd(){var C,$;this.setModules=function(ie,Z){C=ie,$=Z}}function Vd(C,$,ie){arguments.length!=3&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),C=1,$=44100,ie=128);var Z=new At,ye=new Ld,Q=new Xa,me=new Xn,Ne=new Bd,ke=new Nd,G=new Dd,de=new Pd,he=new Ad,M=new Hd,K=new Od,o=new kd,I=new Fd,H=new Ud;Z.setModules(Q,me,Ne,ke,G,de,he,M,H),me.setModules(Q,H,he,de),M.setModules(me,he),Ne.setModules(Z),G.setModules(me,K,ke,o),ke.setModules(o,K,Z.enc.psy),K.setModules(me),o.setModules(ke),de.setModules(Z,me,he),ye.setModules(I,H),I.setModules(he,M,Ne);var O=Z.lame_init();O.num_channels=C,O.in_samplerate=$,O.brate=ie,O.mode=nr.STEREO,O.quality=3,O.bWriteVbrTag=!1,O.disable_reservoir=!0,O.write_id3tag_automatic=!1;var g=Z.lame_init_params(O);kc(g==0);var _=1152,k=0|1.25*_+7200,q=Dc(k);this.encodeBuffer=function(w,c){C==1&&(c=w),kc(w.length==c.length),w.length>_&&(_=w.length,k=0|1.25*_+7200,q=Dc(k));var L=Z.lame_encode_buffer(O,w,c,w.length,q,0,k);return new Int8Array(q.subarray(0,L))},this.flush=function(){var w=Z.lame_encode_flush(O,q,0,k);return new Int8Array(q.subarray(0,w))}}function On(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function jo(C){return C.charCodeAt(0)<<24|C.charCodeAt(1)<<16|C.charCodeAt(2)<<8|C.charCodeAt(3)}On.RIFF=jo("RIFF"),On.WAVE=jo("WAVE"),On.fmt_=jo("fmt "),On.data=jo("data"),On.readHeader=function(C){var $=new On,ie=C.getUint32(0,!1);if(On.RIFF==ie){var Z=C.getUint32(4,!0);if(On.WAVE==C.getUint32(8,!1)&&On.fmt_==C.getUint32(12,!1)){var ye=C.getUint32(16,!0),Q=16+4;switch(ye){case 16:case 18:$.channels=C.getUint16(Q+2,!0),$.sampleRate=C.getUint32(Q+4,!0);break;default:throw"extended fmt chunk not implemented"}Q+=ye;for(var me=On.data,Ne=0;me!=ie&&(ie=C.getUint32(Q,!1),Ne=C.getUint32(Q+4,!0),me!=ie);)Q+=Ne+8;return $.dataLen=Ne,$.dataOffset=Q+8,$}}};var qd=Vd,Oc=function(C,$){if(!(C instanceof $))throw new TypeError("Cannot call a class as a function")},Lc=function(){function C($,ie){for(var Z=0;Z<ie.length;Z++){var ye=ie[Z];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty($,ye.key,ye)}}return function($,ie,Z){return ie&&C($.prototype,ie),Z&&C($,Z),$}}(),zd=function(){function C($){Oc(this,C),this.config={sampleRate:44100,bitRate:128},Object.assign(this.config,$),this.mp3Encoder=new qd(1,this.config.sampleRate,this.config.bitRate),this.maxSamples=1152,this.samplesMono=null,this.clearBuffer()}return Lc(C,[{key:"clearBuffer",value:function(){this.dataBuffer=[]}},{key:"appendToBuffer",value:function(ie){this.dataBuffer.push(new Int8Array(ie))}},{key:"floatTo16BitPCM",value:function(ie,Z){for(var ye=0;ye<ie.length;ye++){var Q=Math.max(-1,Math.min(1,ie[ye]));Z[ye]=Q<0?Q*32768:Q*32767}}},{key:"convertBuffer",value:function(ie){var Z=new Float32Array(ie),ye=new Int16Array(ie.length);return this.floatTo16BitPCM(Z,ye),ye}},{key:"encode",value:function(ie){this.samplesMono=this.convertBuffer(ie);for(var Z=this.samplesMono.length,ye=0;Z>=0;ye+=this.maxSamples){var Q=this.samplesMono.subarray(ye,ye+this.maxSamples),me=this.mp3Encoder.encodeBuffer(Q);this.appendToBuffer(me),Z-=this.maxSamples}}},{key:"finish",value:function(){return this.appendToBuffer(this.mp3Encoder.flush()),this.dataBuffer}}]),C}(),jd=function(){function C($){Oc(this,C),this.config={bitRate:128,startRecordingAt:300,deviceId:null},this.activeStream=null,this.context=null,this.microphone=null,this.processor=null,this.startTime=0,Object.assign(this.config,$)}return Lc(C,[{key:"addMicrophoneListener",value:function(ie){var Z=this;this.activeStream=ie,this.timerToStart=setTimeout(function(){delete Z.timerToStart},this.config.startRecordingAt),this.microphone=this.context.createMediaStreamSource(ie),this.processor=this.context.createScriptProcessor(0,1,1),this.processor.onaudioprocess=function(ye){Z.timerToStart||Z.lameEncoder.encode(ye.inputBuffer.getChannelData(0))},this.microphone.connect(this.processor),this.processor.connect(this.context.destination)}},{key:"stop",value:function(){return this.processor&&this.microphone&&(this.microphone.disconnect(),this.processor.disconnect(),this.context&&this.context.state!=="closed"&&this.context.close(),this.processor.onaudioprocess=null,this.activeStream.getAudioTracks().forEach(function(ie){return ie.stop()})),this}},{key:"start",value:function(){var ie=this,Z=window.AudioContext||window.webkitAudioContext;this.context=new Z,this.config.sampleRate=this.context.sampleRate,this.lameEncoder=new zd(this.config);var ye=this.config.deviceId?{deviceId:{exact:this.config.deviceId}}:!0;return new Promise(function(Q,me){navigator.mediaDevices.getUserMedia({audio:ye}).then(function(Ne){ie.addMicrophoneListener(Ne),Q(Ne)}).catch(function(Ne){me(Ne)})})}},{key:"getMp3",value:function(){var ie=this,Z=this.lameEncoder.finish();return new Promise(function(ye,Q){Z.length===0?Q(new Error("No buffer to send")):(ye([Z,new Blob(Z,{type:"audio/mp3"})]),ie.lameEncoder.clearBuffer())})}}]),C}();return jd})});async function Ko(){try{let t={audio:!0,video:!0};return(await navigator.mediaDevices.getUserMedia(t)).getTracks().forEach(r=>{r.stop()}),!0}catch{return!1}}async function Wo(){return new Promise((t,e)=>{typeof PresentationRequest>"u"&&t(!1),new PresentationRequest("receiver.html").getAvailability().then(n=>{let i=n.value;n.addEventListener("change",function(){i=n.value}),setTimeout(()=>{t(i)},1e3)}).catch(n=>e(n))})}async function xn(){let t=await navigator.mediaDevices.enumerateDevices();return{cameras:t.filter(r=>r.kind=="videoinput"&&r.deviceId).map(r=>({label:r.label||"Generic Device",id:r.deviceId})),microphones:t.filter(r=>r.kind=="audioinput"&&r.deviceId).map(r=>({label:r.label||"Generic Device",id:r.deviceId}))}}var Yo=class{constructor(e){this.sessionDuration=0;this.id=e,this.state="Created",this.startedAt=new Date,this.alerts=[],this.recordings=[]}get hasSomethingToUpload(){for(let e of this.recordings)if(!e.upload)return!0;return!1}start(){this.state="Recording",this.startedAt=new Date(Date.now())}pause(){this.state="Paused"}resume(){this.state="Recording"}stop(){this.state="Ended",this.sessionDuration=Date.now()-this.startedAt.getTime()}setEndConfirmed(){this.state="EndConfirmed"}setUploaded(){this.state="Uploaded"}setUploadConfirmed(){this.state="UploadConfirmed"}addAlert(e){this.alerts.push(e)}addRecording(e){this.recordings.push(e)}};function Qa(t,e,r=!1){let n,i={mimeType:"video/webm;codecs=vp9",videoBitsPerSecond:128e3,audioBitsPerSecond:64e3};r&&(i={mimeType:"audio/webm",audioBitsPerSecond:64*1e3});let a=new MediaRecorder(t,i);a.ondataavailable=B=>{B.data.size>0&&e.push(B.data),r&&a.state=="inactive"&&(e=[new Blob(e,{type:"audio/mpeg-3"})]),n&&n()};function s(){return new Promise(B=>{n=B,a.start()})}function v(){return new Promise(B=>{a.state=="recording"?(n=B,a.stop(),t.getTracks().forEach(z=>{z.stop()})):B()})}function d(){return new Promise(B=>{a.state=="recording"&&a.pause(),B()})}function p(){return new Promise(B=>{a.state=="paused"&&a.resume(),B()})}return{startRecording:s,stopRecording:v,pauseRecording:d,resumeRecording:p}}function Ja(t,e){return function(){return t.apply(e,arguments)}}var{toString:$c}=Object.prototype,{getPrototypeOf:w0}=Object,R0=(t=>e=>{let r=$c.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Kn=t=>(t=t.toLowerCase(),e=>R0(e)===t),Zo=t=>e=>typeof e===t,{isArray:eo}=Array,y0=Zo("undefined");function Jd(t){return t!==null&&!y0(t)&&t.constructor!==null&&!y0(t.constructor)&&aa(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var Zc=Kn("ArrayBuffer");function e2(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Zc(t.buffer),e}var t2=Zo("string"),aa=Zo("function"),Qc=Zo("number"),Jc=t=>t!==null&&typeof t=="object",r2=t=>t===!0||t===!1,$o=t=>{if(R0(t)!=="object")return!1;let e=w0(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},n2=Kn("Date"),i2=Kn("File"),a2=Kn("Blob"),o2=Kn("FileList"),s2=t=>Jc(t)&&aa(t.pipe),l2=t=>{let e="[object FormData]";return t&&(typeof FormData=="function"&&t instanceof FormData||$c.call(t)===e||aa(t.toString)&&t.toString()===e)},c2=Kn("URLSearchParams"),u2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qo(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),eo(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{let a=r?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length,v;for(n=0;n<s;n++)v=a[n],e.call(null,t[v],v,t)}}function E0(){let t={},e=(r,n)=>{$o(t[n])&&$o(r)?t[n]=E0(t[n],r):$o(r)?t[n]=E0({},r):eo(r)?t[n]=r.slice():t[n]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&Qo(arguments[r],e);return t}var f2=(t,e,r,{allOwnKeys:n}={})=>(Qo(e,(i,a)=>{r&&aa(i)?t[a]=Ja(i,r):t[a]=i},{allOwnKeys:n}),t),d2=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),v2=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},m2=(t,e,r,n)=>{let i,a,s,v={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)s=i[a],(!n||n(s,t,e))&&!v[s]&&(e[s]=t[s],v[s]=!0);t=r!==!1&&w0(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},p2=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},h2=t=>{if(!t)return null;if(eo(t))return t;let e=t.length;if(!Qc(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},_2=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&w0(Uint8Array)),S2=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let a=i.value;e.call(t,a[0],a[1])}},g2=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},b2=Kn("HTMLFormElement"),x2=t=>t.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Yc=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),y2=Kn("RegExp"),e1=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};Qo(r,(i,a)=>{e(i,a,t)!==!1&&(n[a]=i)}),Object.defineProperties(t,n)},E2=t=>{e1(t,(e,r)=>{let n=t[r];if(!!aa(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not read-only method '"+r+"'")})}})},w2=(t,e)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return eo(t)?n(t):n(String(t).split(e)),r},R2=()=>{},T2=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ge={isArray:eo,isArrayBuffer:Zc,isBuffer:Jd,isFormData:l2,isArrayBufferView:e2,isString:t2,isNumber:Qc,isBoolean:r2,isObject:Jc,isPlainObject:$o,isUndefined:y0,isDate:n2,isFile:i2,isBlob:a2,isRegExp:y2,isFunction:aa,isStream:s2,isURLSearchParams:c2,isTypedArray:_2,isFileList:o2,forEach:Qo,merge:E0,extend:f2,trim:u2,stripBOM:d2,inherits:v2,toFlatObject:m2,kindOf:R0,kindOfTest:Kn,endsWith:p2,toArray:h2,forEachEntry:S2,matchAll:g2,isHTMLForm:b2,hasOwnProperty:Yc,hasOwnProp:Yc,reduceDescriptors:e1,freezeMethods:E2,toObjectSet:w2,toCamelCase:x2,noop:R2,toFiniteNumber:T2};function oa(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}ge.inherits(oa,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var t1=oa.prototype,r1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{r1[t]={value:t}});Object.defineProperties(oa,r1);Object.defineProperty(t1,"isAxiosError",{value:!0});oa.from=(t,e,r,n,i,a)=>{let s=Object.create(t1);return ge.toFlatObject(t,s,function(d){return d!==Error.prototype},v=>v!=="isAxiosError"),oa.call(s,t.message,e,r,n,i),s.cause=t,s.name=t.name,a&&Object.assign(s,a),s};var wt=oa;var a1=Qd(i1(),1),o1=a1.default;function T0(t){return ge.isPlainObject(t)||ge.isArray(t)}function l1(t){return ge.endsWith(t,"[]")?t.slice(0,-2):t}function s1(t,e,r){return t?t.concat(e).map(function(i,a){return i=l1(i),!r&&a?"["+i+"]":i}).join(r?".":""):e}function A2(t){return ge.isArray(t)&&!t.some(T0)}var I2=ge.toFlatObject(ge,{},null,function(e){return/^is[A-Z]/.test(e)});function C2(t){return t&&ge.isFunction(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator]}function M2(t,e,r){if(!ge.isObject(t))throw new TypeError("target must be an object");e=e||new(o1||FormData),r=ge.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ce,P){return!ge.isUndefined(P[ce])});let n=r.metaTokens,i=r.visitor||B,a=r.dots,s=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&C2(e);if(!ge.isFunction(i))throw new TypeError("visitor must be a function");function p(D){if(D===null)return"";if(ge.isDate(D))return D.toISOString();if(!d&&ge.isBlob(D))throw new wt("Blob is not supported. Use a Buffer instead.");return ge.isArrayBuffer(D)||ge.isTypedArray(D)?d&&typeof Blob=="function"?new Blob([D]):Buffer.from(D):D}function B(D,ce,P){let oe=D;if(D&&!P&&typeof D=="object"){if(ge.endsWith(ce,"{}"))ce=n?ce:ce.slice(0,-2),D=JSON.stringify(D);else if(ge.isArray(D)&&A2(D)||ge.isFileList(D)||ge.endsWith(ce,"[]")&&(oe=ge.toArray(D)))return ce=l1(ce),oe.forEach(function(xe,Ge){!(ge.isUndefined(xe)||xe===null)&&e.append(s===!0?s1([ce],Ge,a):s===null?ce:ce+"[]",p(xe))}),!1}return T0(D)?!0:(e.append(s1(P,ce,a),p(D)),!1)}let z=[],ee=Object.assign(I2,{defaultVisitor:B,convertValue:p,isVisitable:T0});function te(D,ce){if(!ge.isUndefined(D)){if(z.indexOf(D)!==-1)throw Error("Circular reference detected in "+ce.join("."));z.push(D),ge.forEach(D,function(oe,se){(!(ge.isUndefined(oe)||oe===null)&&i.call(e,oe,ge.isString(se)?se.trim():se,ce,ee))===!0&&te(oe,ce?ce.concat(se):[se])}),z.pop()}}if(!ge.isObject(t))throw new TypeError("data must be an object");return te(t),e}var oi=M2;function c1(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function u1(t,e){this._pairs=[],t&&oi(t,this,e)}var f1=u1.prototype;f1.append=function(e,r){this._pairs.push([e,r])};f1.toString=function(e){let r=e?function(n){return e.call(this,n,c1)}:c1;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var Jo=u1;function P2(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function to(t,e,r){if(!e)return t;let n=r&&r.encode||P2,i=r&&r.serialize,a;if(i?a=i(e,r):a=ge.isURLSearchParams(e)?e.toString():new Jo(e,r).toString(n),a){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}var A0=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ge.forEach(this.handlers,function(n){n!==null&&e(n)})}},I0=A0;var es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var d1=typeof URLSearchParams<"u"?URLSearchParams:Jo;var v1=FormData;var B2=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Mr={isBrowser:!0,classes:{URLSearchParams:d1,FormData:v1,Blob},isStandardBrowserEnv:B2,protocols:["http","https","file","blob","url","data"]};function C0(t,e){return oi(t,new Mr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Mr.isNode&&ge.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function N2(t){return ge.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function D2(t){let e={},r=Object.keys(t),n,i=r.length,a;for(n=0;n<i;n++)a=r[n],e[a]=t[a];return e}function k2(t){function e(r,n,i,a){let s=r[a++],v=Number.isFinite(+s),d=a>=r.length;return s=!s&&ge.isArray(i)?i.length:s,d?(ge.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!v):((!i[s]||!ge.isObject(i[s]))&&(i[s]=[]),e(r,n,i[s],a)&&ge.isArray(i[s])&&(i[s]=D2(i[s])),!v)}if(ge.isFormData(t)&&ge.isFunction(t.entries)){let r={};return ge.forEachEntry(t,(n,i)=>{e(N2(n),i,r,0)}),r}return null}var ts=k2;function M0(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new wt("Request failed with status code "+r.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}var m1=Mr.isStandardBrowserEnv?function(){return{write:function(r,n,i,a,s,v){let d=[];d.push(r+"="+encodeURIComponent(n)),ge.isNumber(i)&&d.push("expires="+new Date(i).toGMTString()),ge.isString(a)&&d.push("path="+a),ge.isString(s)&&d.push("domain="+s),v===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(r){let n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function P0(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function B0(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function ro(t,e){return t&&!P0(e)?B0(t,e):e}var p1=Mr.isStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function i(a){let s=a;return e&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(s){let v=ge.isString(s)?i(s):s;return v.protocol===n.protocol&&v.host===n.host}}():function(){return function(){return!0}}();function h1(t,e,r){wt.call(this,t??"canceled",wt.ERR_CANCELED,e,r),this.name="CanceledError"}ge.inherits(h1,wt,{__CANCEL__:!0});var si=h1;function N0(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var O2=ge.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_1=t=>{let e={},r,n,i;return t&&t.split(`
15
- `).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||e[r]&&O2[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e};var S1=Symbol("internals"),b1=Symbol("defaults");function io(t){return t&&String(t).trim().toLowerCase()}function rs(t){return t===!1||t==null?t:ge.isArray(t)?t.map(rs):String(t)}function L2(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}function g1(t,e,r,n){if(ge.isFunction(n))return n.call(this,e,r);if(!!ge.isString(e)){if(ge.isString(n))return e.indexOf(n)!==-1;if(ge.isRegExp(n))return n.test(e)}}function F2(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function U2(t,e){let r=ge.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,a,s){return this[n].call(this,e,i,a,s)},configurable:!0})})}function no(t,e){e=e.toLowerCase();let r=Object.keys(t),n=r.length,i;for(;n-- >0;)if(i=r[n],e===i.toLowerCase())return i;return null}function sa(t,e){t&&this.set(t),this[b1]=e||null}Object.assign(sa.prototype,{set:function(t,e,r){let n=this;function i(a,s,v){let d=io(s);if(!d)throw new Error("header name must be a non-empty string");let p=no(n,d);p&&v!==!0&&(n[p]===!1||v===!1)||(n[p||s]=rs(a))}return ge.isPlainObject(t)?ge.forEach(t,(a,s)=>{i(a,s,e)}):i(e,t,r),this},get:function(t,e){if(t=io(t),!t)return;let r=no(this,t);if(r){let n=this[r];if(!e)return n;if(e===!0)return L2(n);if(ge.isFunction(e))return e.call(this,n,r);if(ge.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}},has:function(t,e){if(t=io(t),t){let r=no(this,t);return!!(r&&(!e||g1(this,this[r],r,e)))}return!1},delete:function(t,e){let r=this,n=!1;function i(a){if(a=io(a),a){let s=no(r,a);s&&(!e||g1(r,r[s],s,e))&&(delete r[s],n=!0)}}return ge.isArray(t)?t.forEach(i):i(t),n},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(t){let e=this,r={};return ge.forEach(this,(n,i)=>{let a=no(r,i);if(a){e[a]=rs(n),delete e[i];return}let s=t?F2(i):String(i).trim();s!==i&&delete e[i],e[s]=rs(n),r[s]=!0}),this},toJSON:function(t){let e=Object.create(null);return ge.forEach(Object.assign({},this[b1]||null,this),(r,n)=>{r==null||r===!1||(e[n]=t&&ge.isArray(r)?r.join(", "):r)}),e}});Object.assign(sa,{from:function(t){return ge.isString(t)?new this(_1(t)):t instanceof this?t:new this(t)},accessor:function(t){let r=(this[S1]=this[S1]={accessors:{}}).accessors,n=this.prototype;function i(a){let s=io(a);r[s]||(U2(n,a),r[s]=!0)}return ge.isArray(t)?t.forEach(i):i(t),this}});sa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]);ge.freezeMethods(sa.prototype);ge.freezeMethods(sa);var yn=sa;function H2(t,e){t=t||10;let r=new Array(t),n=new Array(t),i=0,a=0,s;return e=e!==void 0?e:1e3,function(d){let p=Date.now(),B=n[a];s||(s=p),r[i]=d,n[i]=p;let z=a,ee=0;for(;z!==i;)ee+=r[z++],z=z%t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),p-s<e)return;let te=B&&p-B;return te?Math.round(ee*1e3/te):void 0}}var x1=H2;function y1(t,e){let r=0,n=x1(50,250);return i=>{let a=i.loaded,s=i.lengthComputable?i.total:void 0,v=a-r,d=n(v),p=a<=s;r=a;let B={loaded:a,total:s,progress:s?a/s:void 0,bytes:v,rate:d||void 0,estimated:d&&s&&p?(s-a)/d:void 0};B[e?"download":"upload"]=!0,t(B)}}function ao(t){return new Promise(function(r,n){let i=t.data,a=yn.from(t.headers).normalize(),s=t.responseType,v;function d(){t.cancelToken&&t.cancelToken.unsubscribe(v),t.signal&&t.signal.removeEventListener("abort",v)}ge.isFormData(i)&&Mr.isStandardBrowserEnv&&a.setContentType(!1);let p=new XMLHttpRequest;if(t.auth){let te=t.auth.username||"",D=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(te+":"+D))}let B=ro(t.baseURL,t.url);p.open(t.method.toUpperCase(),to(B,t.params,t.paramsSerializer),!0),p.timeout=t.timeout;function z(){if(!p)return;let te=yn.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),ce={data:!s||s==="text"||s==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:te,config:t,request:p};M0(function(oe){r(oe),d()},function(oe){n(oe),d()},ce),p=null}if("onloadend"in p?p.onloadend=z:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(z)},p.onabort=function(){!p||(n(new wt("Request aborted",wt.ECONNABORTED,t,p)),p=null)},p.onerror=function(){n(new wt("Network Error",wt.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let D=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",ce=t.transitional||es;t.timeoutErrorMessage&&(D=t.timeoutErrorMessage),n(new wt(D,ce.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,t,p)),p=null},Mr.isStandardBrowserEnv){let te=(t.withCredentials||p1(B))&&t.xsrfCookieName&&m1.read(t.xsrfCookieName);te&&a.set(t.xsrfHeaderName,te)}i===void 0&&a.setContentType(null),"setRequestHeader"in p&&ge.forEach(a.toJSON(),function(D,ce){p.setRequestHeader(ce,D)}),ge.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),s&&s!=="json"&&(p.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&p.addEventListener("progress",y1(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",y1(t.onUploadProgress)),(t.cancelToken||t.signal)&&(v=te=>{!p||(n(!te||te.type?new si(null,t,p):te),p.abort(),p=null)},t.cancelToken&&t.cancelToken.subscribe(v),t.signal&&(t.signal.aborted?v():t.signal.addEventListener("abort",v)));let ee=N0(B);if(ee&&Mr.protocols.indexOf(ee)===-1){n(new wt("Unsupported protocol "+ee+":",wt.ERR_BAD_REQUEST,t));return}p.send(i||null)})}var E1={http:ao,xhr:ao},D0={getAdapter:t=>{if(ge.isString(t)){let e=E1[t];if(!t)throw Error(ge.hasOwnProp(t)?`Adapter '${t}' is not available in the build`:`Can not resolve adapter '${t}'`);return e}if(!ge.isFunction(t))throw new TypeError("adapter is not a function");return t},adapters:E1};var V2={"Content-Type":"application/x-www-form-urlencoded"};function q2(){let t;return typeof XMLHttpRequest<"u"?t=D0.getAdapter("xhr"):typeof process<"u"&&ge.kindOf(process)==="process"&&(t=D0.getAdapter("http")),t}function z2(t,e,r){if(ge.isString(t))try{return(e||JSON.parse)(t),ge.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var ns={transitional:es,adapter:q2(),transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=ge.isObject(e);if(a&&ge.isHTMLForm(e)&&(e=new FormData(e)),ge.isFormData(e))return i&&i?JSON.stringify(ts(e)):e;if(ge.isArrayBuffer(e)||ge.isBuffer(e)||ge.isStream(e)||ge.isFile(e)||ge.isBlob(e))return e;if(ge.isArrayBufferView(e))return e.buffer;if(ge.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let v;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return C0(e,this.formSerializer).toString();if((v=ge.isFileList(e))||n.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return oi(v?{"files[]":e}:e,d&&new d,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),z2(e)):e}],transformResponse:[function(e){let r=this.transitional||ns.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&ge.isString(e)&&(n&&!this.responseType||i)){let s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(v){if(s)throw v.name==="SyntaxError"?wt.from(v,wt.ERR_BAD_RESPONSE,this,null,this.response):v}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mr.classes.FormData,Blob:Mr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};ge.forEach(["delete","get","head"],function(e){ns.headers[e]={}});ge.forEach(["post","put","patch"],function(e){ns.headers[e]=ge.merge(V2)});var la=ns;function oo(t,e){let r=this||la,n=e||r,i=yn.from(n.headers),a=n.data;return ge.forEach(t,function(v){a=v.call(r,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function so(t){return!!(t&&t.__CANCEL__)}function k0(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new si}function is(t){return k0(t),t.headers=yn.from(t.headers),t.data=oo.call(t,t.transformRequest),(t.adapter||la.adapter)(t).then(function(n){return k0(t),n.data=oo.call(t,t.transformResponse,n),n.headers=yn.from(n.headers),n},function(n){return so(n)||(k0(t),n&&n.response&&(n.response.data=oo.call(t,t.transformResponse,n.response),n.response.headers=yn.from(n.response.headers))),Promise.reject(n)})}function li(t,e){e=e||{};let r={};function n(p,B){return ge.isPlainObject(p)&&ge.isPlainObject(B)?ge.merge(p,B):ge.isPlainObject(B)?ge.merge({},B):ge.isArray(B)?B.slice():B}function i(p){if(ge.isUndefined(e[p])){if(!ge.isUndefined(t[p]))return n(void 0,t[p])}else return n(t[p],e[p])}function a(p){if(!ge.isUndefined(e[p]))return n(void 0,e[p])}function s(p){if(ge.isUndefined(e[p])){if(!ge.isUndefined(t[p]))return n(void 0,t[p])}else return n(void 0,e[p])}function v(p){if(p in e)return n(t[p],e[p]);if(p in t)return n(void 0,t[p])}let d={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:v};return ge.forEach(Object.keys(t).concat(Object.keys(e)),function(B){let z=d[B]||i,ee=z(B);ge.isUndefined(ee)&&z!==v||(r[B]=ee)}),r}var as="1.1.3";var O0={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{O0[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var w1={};O0.transitional=function(e,r,n){function i(a,s){return"[Axios v"+as+"] Transitional option '"+a+"'"+s+(n?". "+n:"")}return(a,s,v)=>{if(e===!1)throw new wt(i(s," has been removed"+(r?" in "+r:"")),wt.ERR_DEPRECATED);return r&&!w1[s]&&(w1[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,s,v):!0}};function j2(t,e,r){if(typeof t!="object")throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),i=n.length;for(;i-- >0;){let a=n[i],s=e[a];if(s){let v=t[a],d=v===void 0||s(v,a,t);if(d!==!0)throw new wt("option "+a+" must be "+d,wt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new wt("Unknown option "+a,wt.ERR_BAD_OPTION)}}var os={assertOptions:j2,validators:O0};var ci=os.validators,ca=class{constructor(e){this.defaults=e,this.interceptors={request:new I0,response:new I0}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=li(this.defaults,r);let{transitional:n,paramsSerializer:i}=r;n!==void 0&&os.assertOptions(n,{silentJSONParsing:ci.transitional(ci.boolean),forcedJSONParsing:ci.transitional(ci.boolean),clarifyTimeoutError:ci.transitional(ci.boolean)},!1),i!==void 0&&os.assertOptions(i,{encode:ci.function,serialize:ci.function},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=r.headers&&ge.merge(r.headers.common,r.headers[r.method]);a&&ge.forEach(["delete","get","head","post","put","patch","common"],function(D){delete r.headers[D]}),r.headers=new yn(r.headers,a);let s=[],v=!0;this.interceptors.request.forEach(function(D){typeof D.runWhen=="function"&&D.runWhen(r)===!1||(v=v&&D.synchronous,s.unshift(D.fulfilled,D.rejected))});let d=[];this.interceptors.response.forEach(function(D){d.push(D.fulfilled,D.rejected)});let p,B=0,z;if(!v){let te=[is.bind(this),void 0];for(te.unshift.apply(te,s),te.push.apply(te,d),z=te.length,p=Promise.resolve(r);B<z;)p=p.then(te[B++],te[B++]);return p}z=s.length;let ee=r;for(B=0;B<z;){let te=s[B++],D=s[B++];try{ee=te(ee)}catch(ce){D.call(this,ce);break}}try{p=is.call(this,ee)}catch(te){return Promise.reject(te)}for(B=0,z=d.length;B<z;)p=p.then(d[B++],d[B++]);return p}getUri(e){e=li(this.defaults,e);let r=ro(e.baseURL,e.url);return to(r,e.params,e.paramsSerializer)}};ge.forEach(["delete","get","head","options"],function(e){ca.prototype[e]=function(r,n){return this.request(li(n||{},{method:e,url:r,data:(n||{}).data}))}});ge.forEach(["post","put","patch"],function(e){function r(n){return function(a,s,v){return this.request(li(v||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}ca.prototype[e]=r(),ca.prototype[e+"Form"]=r(!0)});var lo=ca;var co=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});let n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a,s=new Promise(v=>{n.subscribe(v),a=v}).then(i);return s.cancel=function(){n.unsubscribe(a)},s},e(function(a,s,v){n.reason||(n.reason=new si(a,s,v),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new co(function(i){e=i}),cancel:e}}},R1=co;function L0(t){return function(r){return t.apply(null,r)}}function F0(t){return ge.isObject(t)&&t.isAxiosError===!0}function T1(t){let e=new lo(t),r=Ja(lo.prototype.request,e);return ge.extend(r,lo.prototype,e,{allOwnKeys:!0}),ge.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return T1(li(t,i))},r}var Vr=T1(la);Vr.Axios=lo;Vr.CanceledError=si;Vr.CancelToken=R1;Vr.isCancel=so;Vr.VERSION=as;Vr.toFormData=oi;Vr.AxiosError=wt;Vr.Cancel=Vr.CanceledError;Vr.all=function(e){return Promise.all(e)};Vr.spread=L0;Vr.isAxiosError=F0;Vr.formToJSON=t=>ts(ge.isHTMLForm(t)?new FormData(t):t);var U0=Vr;var{Axios:f_,AxiosError:d_,CanceledError:v_,isCancel:m_,CancelToken:p_,VERSION:h_,all:__,Cancel:S_,isAxiosError:g_,spread:b_,toFormData:x_}=U0,ua=U0;var A1={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5};var En="function",qr="object",wn="undefined",Gt="prototype",uo="hasOwnProperty";var Yr=Object,fa=Yr[Gt],da=Yr.assign,ss=Yr.create,ls=Yr.defineProperty,ui=fa[uo];var va=null;function cn(t){return t===void 0&&(t=!0),(!va||!t)&&(typeof globalThis!==wn&&globalThis&&(va=globalThis),typeof self!==wn&&self&&(va=self),typeof window!==wn&&window&&(va=window),typeof global!==wn&&global&&(va=global)),va}function ma(t){throw new TypeError(t)}function pa(t){var e=ss;if(e)return e(t);if(t==null)return{};var r=typeof t;r!==qr&&r!==En&&ma("Object prototype may only be an Object:"+t);function n(){}return n[Gt]=t,new n}var C_=(cn()||{}).Symbol,M_=(cn()||{}).Reflect;var X2=function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)fa[uo].call(e,i)&&(t[i]=e[i])}return t},Qt=da||X2,H0=function(t,e){return H0=Yr.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n[uo](i)&&(r[i]=n[i])},H0(t,e)};function ut(t,e){typeof e!==En&&e!==null&&ma("Class extends value "+String(e)+" is not a constructor or null"),H0(t,e);function r(){this.constructor=t}t[Gt]=e===null?pa(e):(r[Gt]=e[Gt],new r)}function cs(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t}var us="constructor",Wn="prototype",fs="function",ds="_dynInstFuncs",z0="_isDynProxy",ha="_dynClass",K2="_dynCls$",j0="_dynInstChk",fo=j0,P1="_dfOpts",I1="_unknown_",W2="__proto__",V0="useBaseInst",C1="setInstFuncs",ps=Object,vo=ps.getPrototypeOf,M1=0;function fi(t,e){return t&&ps[Wn].hasOwnProperty.call(t,e)}function B1(t){return t&&(t===ps[Wn]||t===Array[Wn])}function G0(t){return B1(t)||t===Function[Wn]}function Bi(t){if(t){if(vo)return vo(t);var e=t[W2]||t[Wn]||(t[us]?t[us][Wn]:null);if(e)return e}return null}function vs(t,e){var r=[],n=ps.getOwnPropertyNames;if(n)r=n(t);else for(var i in t)typeof i=="string"&&fi(t,i)&&r.push(i);if(r&&r.length>0)for(var a=0;a<r.length;a++)e(r[a])}function X0(t,e,r){return e!==us&&typeof t[e]===fs&&(r||fi(t,e))}function ms(t){throw new TypeError("DynamicProto: "+t)}function Y2(t){var e={};return vs(t,function(r){!e[r]&&X0(t,r,!1)&&(e[r]=t[r])}),e}function K0(t,e){for(var r=t.length-1;r>=0;r--)if(t[r]===e)return!0;return!1}function $2(t,e,r,n){function i(d,p,B){var z=p[B];if(z[z0]&&n){var ee=d[ds]||{};ee[fo]!==!1&&(z=(ee[p[ha]]||{})[B]||z)}return function(){return z.apply(d,arguments)}}var a={};vs(r,function(d){a[d]=i(e,r,d)});for(var s=Bi(t),v=[];s&&!G0(s)&&!K0(v,s);)vs(s,function(d){!a[d]&&X0(s,d,!vo)&&(a[d]=i(e,s,d))}),v.push(s),s=Bi(s);return a}function Z2(t,e,r,n){var i=null;if(t&&fi(r,ha)){var a=t[ds]||{};if(i=(a[r[ha]]||{})[e],i||ms("Missing ["+e+"] "+fs),!i[j0]&&a[fo]!==!1){for(var s=!fi(t,e),v=Bi(t),d=[];s&&v&&!G0(v)&&!K0(d,v);){var p=v[e];if(p){s=p===n;break}d.push(v),v=Bi(v)}try{s&&(t[e]=i),i[j0]=1}catch{a[fo]=!1}}}return i}function Q2(t,e,r){var n=e[t];return n===r&&(n=Bi(e)[t]),typeof n!==fs&&ms("["+t+"] is not a "+fs),n}function J2(t,e,r,n,i){function a(d,p){var B=function(){var z=Z2(this,p,d,B)||Q2(p,d,B);return z.apply(this,arguments)};return B[z0]=1,B}if(!B1(t)){var s=r[ds]=r[ds]||{},v=s[e]=s[e]||{};s[fo]!==!1&&(s[fo]=!!i),vs(r,function(d){X0(r,d,!1)&&r[d]!==n[d]&&(v[d]=r[d],delete r[d],(!fi(t,d)||t[d]&&!t[d][z0])&&(t[d]=a(t,d)))})}}function ev(t,e){if(vo)for(var r=[],n=Bi(e);n&&!G0(n)&&!K0(r,n);){if(n===t)return!0;r.push(n),n=Bi(n)}return!1}function q0(t,e){return fi(t,Wn)?t.name||e||I1:((t||{})[us]||{}).name||e||I1}function W0(t,e,r,n){fi(t,Wn)||ms("theClass is an invalid class definition.");var i=t[Wn];ev(i,e)||ms("["+q0(t)+"] is not in class hierarchy of ["+q0(e)+"]");var a=null;fi(i,ha)?a=i[ha]:(a=K2+q0(t,"_")+"$"+M1,M1++,i[ha]=a);var s=W0[P1],v=!!s[V0];v&&n&&n[V0]!==void 0&&(v=!!n[V0]);var d=Y2(e),p=$2(i,e,d,v);r(e,p);var B=!!vo&&!!s[C1];B&&n&&(B=!!n[C1]),J2(i,a,e,d,B!==!1)}var tv={setInstFuncs:!0,useBaseInst:!0};W0[P1]=tv;var gt=W0;var Pe;(function(t){t[t.CRITICAL=1]="CRITICAL",t[t.WARNING=2]="WARNING"})(Pe||(Pe={}));var we={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105};var rv="on",N1="attachEvent",D1="addEventListener";var q1="toISOString",z1="endsWith",nv="startsWith",k1="indexOf",O1="map",L1="reduce",$0="trim",j1="toString",iv="__proto__",av="constructor",F1=ls,e3=Yr.freeze,t3=Yr.seal,U1=Yr.keys,Z0=String[Gt],ov=Z0[$0],sv=Z0[z1],r3=Z0[nv],lv=Date[Gt],cv=lv[q1],uv=Array.isArray,G1=fa[j1],fv=ui[j1],n3=fv.call(Yr),dv=/-([a-z])/g,vv=/([^\w\d_$])/g,mv=/^(\d+[\w\d_$])/,H1=Object.getPrototypeOf;function X1(t){if(t){if(H1)return H1(t);var e=t[iv]||t[Gt]||t[av];if(e)return e}return null}function Wt(t){return t===void 0||typeof t===wn}function De(t){return t===null||Wt(t)}function Q0(t){return!De(t)}function mo(t,e){return!!(t&&ui.call(t,e))}function Rn(t){return!!(t&&typeof t===qr)}function at(t){return!!(t&&typeof t===En)}function Tn(t,e,r,n){n===void 0&&(n=!1);var i=!1;if(!De(t))try{De(t[D1])?De(t[N1])||(t[N1](rv+e,r),i=!0):(t[D1](e,r,n),i=!0)}catch{}return i}function J0(t){var e=t;return e&&et(e)&&(e=e.replace(dv,function(r,n){return n.toUpperCase()}),e=e.replace(vv,"_"),e=e.replace(mv,function(r,n){return"_"+n})),e}function Tt(t,e){if(t)for(var r in t)ui.call(t,r)&&e.call(t,r,t[r])}function el(t,e){var r=!1;return t&&e&&!(r=t===e)&&(r=sv?t[z1](e):pv(t,e)),r}function pv(t,e){var r=!1,n=e?e.length:0,i=t?t.length:0;if(n&&i&&i>=n&&!(r=t===e)){for(var a=i-1,s=n-1;s>=0;s--){if(t[a]!=e[s])return!1;a--}r=!0}return r}function cr(t,e){return t&&e?t.indexOf(e)!==-1:!1}var ur=uv||hv;function hv(t){return!!(t&&G1.call(t)==="[object Array]")}function _a(t){return!!(t&&G1.call(t)==="[object Error]")}function et(t){return typeof t=="string"}function Sa(t){return typeof t=="number"}function Pr(t){if(t)return cv?t[q1]():_v(t)}function _v(t){if(t&&t.getUTCFullYear){var e=function(r){var n=String(r);return n.length===1&&(n="0"+n),n};return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"."+String((t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}function tt(t,e,r){var n=t.length;try{for(var i=0;i<n&&!(i in t&&e.call(r||t,t[i],i,t)===-1);i++);}catch{}}function Un(t,e,r){if(t){if(t[k1])return t[k1](e,r);var n=t.length,i=r||0;try{for(var a=Math.max(i>=0?i:n-Math.abs(i),0);a<n;a++)if(a in t&&t[a]===e)return a}catch{}}return-1}function Ni(t,e,r){var n;if(t){if(t[O1])return t[O1](e,r);var i=t.length,a=r||t;n=new Array(i);try{for(var s=0;s<i;s++)s in t&&(n[s]=e.call(a,t[s],t))}catch{}}return n}function hs(t,e,r){var n;if(t){if(t[L1])return t[L1](e,r);var i=t.length,a=0;if(arguments.length>=3)n=arguments[2];else{for(;a<i&&!(a in t);)a++;n=t[a++]}for(;a<i;)a in t&&(n=e(n,t[a],a,t)),a++}return n}function Jt(t){return t&&(t=ov&&t[$0]?t[$0]():t.replace?t.replace(/^\s+|\s+$/g,""):t),t}var V1=!{toString:null}.propertyIsEnumerable("toString"),Y0=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function un(t){var e=typeof t;if(e!==En&&(e!==qr||t===null)&&ma("objKeys called on non-object"),!V1&&U1)return U1(t);var r=[];for(var n in t)t&&ui.call(t,n)&&r.push(n);if(V1)for(var i=Y0.length,a=0;a<i;a++)t&&ui.call(t,Y0[a])&&r.push(Y0[a]);return r}function di(t,e,r,n){if(F1)try{var i={enumerable:!0,configurable:!0};return r&&(i.get=r),n&&(i.set=n),F1(t,e,i),!0}catch{}return!1}function fr(){var t=Date;return t.now?t.now():new t().getTime()}function _t(t){return _a(t)?t.name:""}function ht(t,e,r,n,i){var a=r;return t&&(a=t[e],a!==r&&(!i||i(a))&&(!n||n(r))&&(a=r,t[e]=a)),a}function dr(t,e,r){var n;return t?(n=t[e],!n&&De(n)&&(n=Wt(r)?{}:r,t[e]=n)):n=Wt(r)?{}:r,n}function _s(t){return!t}function ga(t){return!!t}function wr(t){throw new Error(t)}function tl(t,e,r){if(t&&e&&t!==e&&Rn(t)&&Rn(e)){var n=function(a){if(et(a)){var s=e[a];at(s)?(!r||r(a,!0,e,t))&&(t[a]=function(v){return function(){var d=arguments;return e[v].apply(e,d)}}(a)):(!r||r(a,!1,e,t))&&(mo(t,a)&&delete t[a],di(t,a,function(){return e[a]},function(v){e[a]=v})||(t[a]=s))}};for(var i in e)n(i)}return t}function rl(t){return function(){function e(){var r=this;t&&Tt(t,function(n,i){r[n]=i})}return e}()}function Ss(t){return t&&da&&(t=Yr(da({},t))),t}var K1="window",Sv="document",gv="documentMode",bv="navigator",xv="history",yv="location",Ev="console",wv="performance",W1="JSON",Rv="crypto",Tv="msCrypto",Av="ReactNative",ol="msie",sl="trident/",nl=null,il=null,Iv=!1,ba=null,al=null;function Y1(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[Gt];n&&(r=e in n)}}catch{}if(!r)try{var i=new t;r=!Wt(i[e])}catch{}}return r}function er(t){var e=cn();return e&&e[t]?e[t]:t===K1&&Di()?window:null}function Di(){return Boolean(typeof window===qr&&window)}function Hn(){return Di()?window:er(K1)}function gs(){return Boolean(typeof document===qr&&document)}function ir(){return gs()?document:er(Sv)}function ll(){return Boolean(typeof navigator===qr&&navigator)}function Rr(){return ll()?navigator:er(bv)}function $1(){return Boolean(typeof history===qr&&history)}function cl(){return $1()?history:er(xv)}function $r(t){if(t&&Iv){var e=er("__mockLocation");if(e)return e}return typeof location===qr&&location?location:er(yv)}function ul(){return typeof console!==wn?console:er(Ev)}function Zr(){return er(wv)}function An(){return Boolean(typeof JSON===qr&&JSON||er(W1)!==null)}function vr(){return An()?JSON||er(W1):null}function fl(){return er(Rv)}function dl(){return er(Tv)}function vl(){var t=Rr();return t&&t.product?t.product===Av:!1}function ki(){var t=Rr();if(t&&(t.userAgent!==il||nl===null)){il=t.userAgent;var e=(il||"").toLowerCase();nl=cr(e,ol)||cr(e,sl)}return nl}function xa(t){if(t===void 0&&(t=null),!t){var e=Rr()||{};t=e?(e.userAgent||"").toLowerCase():""}var r=(t||"").toLowerCase();if(cr(r,ol)){var n=ir()||{};return Math.max(parseInt(r.split(ol)[1]),n[gv]||0)}else if(cr(r,sl)){var i=parseInt(r.split(sl)[1]);if(i)return i+4}return null}function it(t){var e=Object[Gt].toString.call(t),r="";return e==="[object Error]"?r="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t.name+"'":An()&&(r=vr().stringify(t)),e+r}function Oi(){return al===null&&(al=ll()&&Boolean(Rr().sendBeacon)),al}function bs(t){var e=!1;try{var r=er("fetch");e=!!r;var n=er("Request");e&&t&&n&&(e=Y1(n,"keepalive"))}catch{}return e}function xs(){return ba===null&&(ba=typeof XDomainRequest<"u",ba&&Li()&&(ba=ba&&!Y1(er("XMLHttpRequest"),"withCredentials"))),ba}function Li(){var t=!1;try{var e=er("XMLHttpRequest");t=!!e}catch{}return t}var ml=["eventsSent","eventsDiscarded","eventsSendRequest","perfEvent"],Es=null,ys;function Cv(t,e){return function(){var r=arguments,n=pl(e);if(n){var i=n.listener;i&&i[t]&&i[t].apply(i,r)}}}function Mv(){var t=er("Microsoft");return t&&(Es=t.ApplicationInsights),Es}function pl(t){var e=Es;return!e&&t.disableDbgExt!==!0&&(e=Es||Mv()),e?e.ChromeDbgExt:null}function Z1(t){if(!ys){ys={};for(var e=0;e<ml.length;e++)ys[ml[e]]=Cv(ml[e],t)}return ys}var Pv="AI (Internal): ",Bv="AI: ",Nv="AITR_",Dv="errorToConsole",kv="warnToConsole";function Q1(t){return t?'"'+t.replace(/\"/g,"")+'"':""}function J1(t,e){var r=ul();if(r){var n="log";r[t]&&(n=t),at(r[n])&&r[n](e)}}var Yn=function(){function t(e,r,n,i){n===void 0&&(n=!1);var a=this;a.messageId=e,a.message=(n?Bv:Pv)+e;var s="";An()&&(s=vr().stringify(i));var v=(r?" message:"+Q1(r):"")+(i?" props:"+Q1(s):"");a.message+=v}return t.dataType="MessageData",t}();function $n(t,e){return(t||{}).logger||new ya(e)}var ya=function(){function t(e){this.identifier="DiagnosticLogger",this.queue=[];var r=0,n={};gt(t,this,function(i){De(e)&&(e={}),i.consoleLoggingLevel=function(){return a("loggingLevelConsole",0)},i.telemetryLoggingLevel=function(){return a("loggingLevelTelemetry",1)},i.maxInternalMessageLimit=function(){return a("maxMessageLimit",25)},i.enableDebugExceptions=function(){return a("enableDebugExceptions",!1)},i.throwInternal=function(d,p,B,z,ee){ee===void 0&&(ee=!1);var te=new Yn(p,B,ee,z);if(i.enableDebugExceptions())throw te;var D=d===Pe.CRITICAL?Dv:kv;if(Wt(te.message))v("throw"+(d===Pe.CRITICAL?"Critical":"Warning"),te);else{var ce=i.consoleLoggingLevel();if(ee){var P=+te.messageId;!n[P]&&ce>=d&&(i[D](te.message),n[P]=!0)}else ce>=d&&i[D](te.message);i.logInternalMessage(d,te)}},i.warnToConsole=function(d){J1("warn",d),v("warning",d)},i.errorToConsole=function(d){J1("error",d),v("error",d)},i.resetInternalMessageCount=function(){r=0,n={}},i.logInternalMessage=function(d,p){if(!s()){var B=!0,z=Nv+p.messageId;if(n[z]?B=!1:n[z]=!0,B&&(d<=i.telemetryLoggingLevel()&&(i.queue.push(p),r++,v(d===Pe.CRITICAL?"error":"warn",p)),r===i.maxInternalMessageLimit())){var ee="Internal events throttle limit per PageView reached for this app.",te=new Yn(we.MessageLimitPerPVExceeded,ee,!1);i.queue.push(te),d===Pe.CRITICAL?i.errorToConsole(ee):i.warnToConsole(ee)}}};function a(d,p){var B=e[d];return De(B)?p:B}function s(){return r>=i.maxInternalMessageLimit()}function v(d,p){var B=pl(e);B&&B.diagLog&&B.diagLog(d,p)}})}return t}();var Ea="ctx",Ov=null,po=function(){function t(e,r,n){var i=this,a=!1;if(i.start=fr(),i.name=e,i.isAsync=n,i.isChildEvt=function(){return!1},at(r)){var s;a=di(i,"payload",function(){return!s&&at(r)&&(s=r(),r=null),s})}i.getCtx=function(v){return v?v===t.ParentContextKey||v===t.ChildrenContextKey?i[v]:(i[Ea]||{})[v]:null},i.setCtx=function(v,d){if(v)if(v===t.ParentContextKey)i[v]||(i.isChildEvt=function(){return!0}),i[v]=d;else if(v===t.ChildrenContextKey)i[v]=d;else{var p=i[Ea]=i[Ea]||{};p[v]=d}},i.complete=function(){var v=0,d=i.getCtx(t.ChildrenContextKey);if(ur(d))for(var p=0;p<d.length;p++){var B=d[p];B&&(v+=B.time)}i.time=fr()-i.start,i.exTime=i.time-v,i.complete=function(){},!a&&at(r)&&(i.payload=r())}}return t.ParentContextKey="parent",t.ChildrenContextKey="childEvts",t}();var _l=function(){function t(e){this.ctx={},gt(t,this,function(r){r.create=function(n,i,a){return new po(n,i,a)},r.fire=function(n){n&&(n.complete(),e&&at(e.perfEvent)&&e.perfEvent(n))},r.setCtx=function(n,i){if(n){var a=r[Ea]=r[Ea]||{};a[n]=i}},r.getCtx=function(n){return(r[Ea]||{})[n]}})}return t}();var hl="CoreUtils.doPerf";function Vn(t,e,r,n,i){if(t){var a=t;if(at(a.getPerfMgr)&&(a=a.getPerfMgr()),a){var s=void 0,v=a.getCtx(hl);try{if(s=a.create(e(),n,i),s){if(v&&s.setCtx&&(s.setCtx(po.ParentContextKey,v),v.getCtx&&v.setCtx)){var d=v.getCtx(po.ChildrenContextKey);d||(d=[],v.setCtx(po.ChildrenContextKey,d)),d.push(s)}return a.setCtx(hl,s),r(s)}}catch(p){s&&s.setCtx&&s.setCtx("exception",p)}finally{s&&a.fire(s),a.setCtx(hl,v)}}}return r()}function Sl(){return Ov}var eu=function(){function t(e,r){var n=this,i=null,a=at(e.processTelemetry),s=at(e.setNextPlugin);n._hasRun=!1,n.getPlugin=function(){return e},n.getNext=function(){return i},n.setNext=function(v){i=v},n.processTelemetry=function(v,d){d||(d=r);var p=e?e.identifier:"TelemetryPluginChain";Vn(d?d.core():null,function(){return p+":processTelemetry"},function(){if(e&&a){n._hasRun=!0;try{d.setNext(i),s&&e.setNextPlugin(i),i&&(i._hasRun=!1),e.processTelemetry(v,d)}catch(z){var B=i&&i._hasRun;(!i||!B)&&d.diagLog().throwInternal(Pe.CRITICAL,we.PluginException,"Plugin ["+e.identifier+"] failed during processTelemetry - "+it(z)),i&&!B&&i.processTelemetry(v,d)}}else i&&(n._hasRun=!0,i.processTelemetry(v,d))},function(){return{item:v}},!v.sync)}}return t}();function gl(t,e){var r=[];if(t&&t.length>0)for(var n=null,i=0;i<t.length;i++){var a=t[i];if(a&&at(a.processTelemetry)){var s=new eu(a,e);r.push(s),n&&n.setNext(s),n=s}}return r.length>0?r[0]:null}function Lv(t,e,r){var n=[],i=!r;if(t)for(;t;){var a=t.getPlugin();(i||a===r)&&(i=!0,n.push(a)),t=t.getNext()}return i||n.push(r),gl(n,e)}function Fv(t,e,r){var n=t,i=!1;return r&&t&&(n=[],tt(t,function(a){(i||a===r)&&(i=!0,n.push(a))})),r&&!i&&(n||(n=[]),n.push(r)),gl(n,e)}var Zn=function(){function t(e,r,n,i){var a=this,s=null;i!==null&&(e&&at(e.getPlugin)?s=Lv(e,a,i||e.getPlugin()):i?s=Fv(e,a,i):Wt(i)&&(s=gl(e,a))),a.core=function(){return n},a.diagLog=function(){return $n(n,r)},a.getCfg=function(){return r},a.getExtCfg=function(v,d){d===void 0&&(d={});var p;if(r){var B=r.extensionConfig;B&&v&&(p=B[v])}return p||d},a.getConfig=function(v,d,p){p===void 0&&(p=!1);var B,z=a.getExtCfg(v,null);return z&&!De(z[d])?B=z[d]:r&&!De(r[d])&&(B=r[d]),De(B)?p:B},a.hasNext=function(){return s!=null},a.getNext=function(){return s},a.setNext=function(v){s=v},a.processNext=function(v){var d=s;d&&(s=d.getNext(),d.processTelemetry(v,a))},a.createNew=function(v,d){return v===void 0&&(v=null),new t(v||s,r,n,d)}}return t}();var tu="iKey",ws="extensionConfig";var Rs="getPlugin",In=function(){function t(){var e=this,r=!1,n=null,i=null;e.core=null,e.diagLog=function(a){return e._getTelCtx(a).diagLog()},e.isInitialized=function(){return r},e.setInitialized=function(a){r=a},e.setNextPlugin=function(a){i=a},e.processNext=function(a,s){s?s.processNext(a):i&&at(i.processTelemetry)&&i.processTelemetry(a,null)},e._getTelCtx=function(a){a===void 0&&(a=null);var s=a;if(!s){var v=n||new Zn(null,{},e.core);i&&i[Rs]?s=v.createNew(null,i[Rs]):s=v.createNew(null,i)}return s},e._baseTelInit=function(a,s,v,d){a&&ht(a,ws,[],null,De),!d&&s&&(d=s.getProcessTelContext().getNext());var p=i;i&&i[Rs]&&(p=i[Rs]()),e.core=s,n=new Zn(d,a,s,p),r=!0}}return t.prototype.initialize=function(e,r,n,i){this._baseTelInit(e,r,n,i)},t}();var bl="processTelemetry",ru="priority",nu="setNextPlugin",iu="isInitialized";function ho(t,e){for(var r=[],n=null,i=t.getNext();i;){var a=i.getPlugin();a&&(n&&at(n[nu])&&at(a[bl])&&n[nu](a),(!at(a[iu])||!a[iu]())&&r.push(a),n=a,i=i.getNext())}tt(r,function(s){s.initialize(t.getCfg(),t.core(),e,t.getNext())})}function xl(t){return t.sort(function(e,r){var n=0,i=at(r[bl]);return at(e[bl])?n=i?e[ru]-r[ru]:1:i&&(n=-1),n})}var yl=500,Uv="Channel has invalid priority",au=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=yl;var n;gt(e,r,function(v,d){v.setNextPlugin=function(p){},v.processTelemetry=function(p,B){n&&tt(n,function(z){if(z.length>0){var ee=r._getTelCtx(B).createNew(z);ee.processNext(p)}})},v.getChannelControls=function(){return n},v.initialize=function(p,B,z){v.isInitialized()||(d.initialize(p,B,z),s((p||{}).channels,z),tt(n,function(ee){return ho(new Zn(ee,p,B),z)}))}});function i(v){tt(v,function(d){d.priority<yl&&wr(Uv+d.identifier)})}function a(v){v&&v.length>0&&(v=v.sort(function(d,p){return d.priority-p.priority}),i(v),n.push(v))}function s(v,d){if(n=[],v&&tt(v,function(B){return a(B)}),d){var p=[];tt(d,function(B){B.priority>yl&&p.push(B)}),a(p)}}return r}return e._staticInit=function(){var r=e.prototype;di(r,"ChannelControls",r.getChannelControls),di(r,"channelQueue",r.getChannelControls)}(),e}(In);var ou="toGMTString",su="toUTCString",Al="cookie",El="expires",Rl="enabled",lu="isCookieUseDisabled",cu="disableCookiesUsage",vi="_ckMgr",Cn="",Ts=null,wl=null,uu=null,_o=ir(),fu={},Is={};function Hv(t,e){var r=Fi[vi]||Is[vi];return r||(r=Fi[vi]=Fi(t,e),Is[vi]=r),r}function As(t){return t?t.isEnabled():!0}function Vv(t){var e=t.cookieCfg=t.cookieCfg||{};if(ht(e,"domain",t.cookieDomain,Q0,De),ht(e,"path",t.cookiePath||"/",null,De),De(e[Rl])){var r=void 0;Wt(t[lu])||(r=!t[lu]),Wt(t[cu])||(r=!t[cu]),e[Rl]=r}return e}function Ui(t,e){var r;if(t)r=t.getCookieMgr();else if(e){var n=e.cookieCfg;n[vi]?r=n[vi]:r=Fi(e)}return r||(r=Hv(e,(t||{}).logger)),r}function Fi(t,e){var r=Vv(t||Is),n=r.path||"/",i=r.domain,a=r[Rl]!==!1,s={isEnabled:function(){var v=a&&Tl(e),d=Is[vi];return v&&d&&s!==d&&(v=As(d)),v},setEnabled:function(v){a=v!==!1},set:function(v,d,p,B,z){var ee=!1;if(As(s)){var te={},D=Jt(d||Cn),ce=D.indexOf(";");if(ce!==-1&&(D=Jt(d.substring(0,ce)),te=pu(d.substring(ce+1))),ht(te,"domain",B||i,ga,Wt),!De(p)){var P=ki();if(Wt(te[El])){var oe=fr(),se=oe+p*1e3;if(se>0){var xe=new Date;xe.setTime(se),ht(te,El,du(xe,P?ou:su)||du(xe,P?ou:su)||Cn,ga)}}P||ht(te,"max-age",Cn+p,null,Wt)}var Ge=$r();Ge&&Ge.protocol==="https:"&&(ht(te,"secure",null,null,Wt),wl===null&&(wl=!Il((Rr()||{}).userAgent)),wl&&ht(te,"SameSite","None",null,Wt)),ht(te,"path",z||n,null,Wt);var lt=r.setCookie||mu;lt(v,vu(D,te)),ee=!0}return ee},get:function(v){var d=Cn;return As(s)&&(d=(r.getCookie||qv)(v)),d},del:function(v,d){var p=!1;return As(s)&&(p=s.purge(v,d)),p},purge:function(v,d){var p,B=!1;if(Tl(e)){var z=(p={},p.path=d||"/",p[El]="Thu, 01 Jan 1970 00:00:01 GMT",p);ki()||(z["max-age"]="0");var ee=r.delCookie||mu;ee(v,vu(Cn,z)),B=!0}return B}};return s[vi]=s,s}function Tl(t){if(Ts===null){Ts=!1;try{var e=_o||{};Ts=e[Al]!==void 0}catch(r){t&&t.throwInternal(Pe.WARNING,we.CannotAccessCookie,"Cannot access document.cookie - "+_t(r),{exception:it(r)})}}return Ts}function pu(t){var e={};if(t&&t.length){var r=Jt(t).split(";");tt(r,function(n){if(n=Jt(n||Cn),n){var i=n.indexOf("=");i===-1?e[n]=null:e[Jt(n.substring(0,i))]=Jt(n.substring(i+1))}})}return e}function du(t,e){return at(t[e])?t[e]():null}function vu(t,e){var r=t||Cn;return Tt(e,function(n,i){r+="; "+n+(De(i)?Cn:"="+i)}),r}function qv(t){var e=Cn;if(_o){var r=_o[Al]||Cn;uu!==r&&(fu=pu(r),uu=r),e=Jt(fu[t]||Cn)}return e}function mu(t,e){_o&&(_o[Al]=t+"="+e)}function Il(t){return et(t)?!!(cr(t,"CPU iPhone OS 12")||cr(t,"iPad; CPU OS 12")||cr(t,"Macintosh; Intel Mac OS X 10_14")&&cr(t,"Version/")&&cr(t,"Safari")||cr(t,"Macintosh; Intel Mac OS X 10_14")&&el(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||cr(t,"Chrome/5")||cr(t,"Chrome/6")||cr(t,"UnrealEngine")&&!cr(t,"Chrome")||cr(t,"UCBrowser/12")||cr(t,"UCBrowser/11")):!1}var zv="Extensions must provide callback to initialize",hu="_notificationManager";function jv(t,e){return new _l(e)}var _u=function(){function t(){var e=!1,r,n,i,a,s;gt(t,this,function(v){v._extensions=new Array,n=new au,v.logger=new ya({loggingLevelConsole:Pe.CRITICAL}),r=[],v.isInitialized=function(){return e},v.initialize=function(d,p,B,z){v.isInitialized()&&wr("Core should not be initialized more than once"),(!d||De(d.instrumentationKey))&&wr("Please provide instrumentation key"),i=z,v[hu]=z,v.config=d||{},z&&v.config.disableDbgExt!==!0&&z.addNotificationListener(Z1(d)),v.config.enablePerfMgr&&ht(v.config,"createPerfMgr",jv),d.extensions=De(d.extensions)?[]:d.extensions;var ee=dr(d,ws);ee.NotificationManager=z,B&&(v.logger=B);var te=[];te.push.apply(te,cs(cs([],p,!1),d.extensions,!1)),te=xl(te);var D=[],ce=[],P={};tt(te,function(oe){(De(oe)||De(oe.initialize))&&wr(zv);var se=oe.priority,xe=oe.identifier;oe&&se&&(De(P[se])?P[se]=xe:B.warnToConsole("Two extensions have same priority #"+se+" - "+P[se]+", "+xe)),!se||se<n.priority?D.push(oe):ce.push(oe)}),te.push(n),D.push(n),te=xl(te),v._extensions=te,ho(new Zn([n],d,v),te),ho(new Zn(D,d,v),te),v._extensions=D,v.getTransmissionControls().length===0&&wr("No channels available"),e=!0,v.releaseQueue()},v.getTransmissionControls=function(){return n.getChannelControls()},v.track=function(d){ht(d,tu,v.config.instrumentationKey,null,_s),ht(d,"time",Pr(new Date),null,_s),ht(d,"ver","4.0",null,De),v.isInitialized()?v.getProcessTelContext().processNext(d):r.push(d)},v.getProcessTelContext=function(){var d=v._extensions,p=d;return(!d||d.length===0)&&(p=[n]),new Zn(p,v.config,v)},v.getNotifyMgr=function(){return i||(i=pa({addNotificationListener:function(d){},removeNotificationListener:function(d){},eventsSent:function(d){},eventsDiscarded:function(d,p){},eventsSendRequest:function(d,p){}}),v[hu]=i),i},v.getCookieMgr=function(){return s||(s=Fi(v.config,v.logger)),s},v.setCookieMgr=function(d){s=d},v.getPerfMgr=function(){return a||v.config&&v.config.enablePerfMgr&&at(v.config.createPerfMgr)&&(a=v.config.createPerfMgr(v,v.getNotifyMgr())),a||Sl()},v.setPerfMgr=function(d){a=d},v.eventCnt=function(){return r.length},v.releaseQueue=function(){r.length>0&&(tt(r,function(d){v.getProcessTelContext().processNext(d)}),r=[])}})}return t}();var Su=function(){function t(e){this.listeners=[];var r=!!(e||{}).perfEvtsSendAll;gt(t,this,function(n){n.addNotificationListener=function(i){n.listeners.push(i)},n.removeNotificationListener=function(i){for(var a=Un(n.listeners,i);a>-1;)n.listeners.splice(a,1),a=Un(n.listeners,i)},n.eventsSent=function(i){tt(n.listeners,function(a){a&&a.eventsSent&&setTimeout(function(){return a.eventsSent(i)},0)})},n.eventsDiscarded=function(i,a){tt(n.listeners,function(s){s&&s.eventsDiscarded&&setTimeout(function(){return s.eventsDiscarded(i,a)},0)})},n.eventsSendRequest=function(i,a){tt(n.listeners,function(s){if(s&&s.eventsSendRequest)if(a)setTimeout(function(){return s.eventsSendRequest(i,a)},0);else try{s.eventsSendRequest(i,a)}catch{}})},n.perfEvent=function(i){i&&(r||!i.isChildEvt())&&tt(n.listeners,function(a){if(a&&a.perfEvent)if(i.isAsync)setTimeout(function(){return a.perfEvent(i)},0);else try{a.perfEvent(i)}catch{}})}})}return t}();var Cl=function(t){ut(e,t);function e(){var r=t.call(this)||this,n=0;return gt(e,r,function(i,a){i.initialize=function(d,p,B,z){a.initialize(d,p,B||new ya(d),z||new Su(d))},i.track=function(d){Vn(i.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){d===null&&(v(d),wr("Invalid telemetry item")),s(d),a.track(d)},function(){return{item:d}},!d.sync)},i.addNotificationListener=function(d){var p=i.getNotifyMgr();p&&p.addNotificationListener(d)},i.removeNotificationListener=function(d){var p=i.getNotifyMgr();p&&p.removeNotificationListener(d)},i.pollInternalLogs=function(d){var p=i.config.diagnosticLogInterval;return(!p||!(p>0))&&(p=1e4),n&&i.stopPollingInternalLogs(),n=setInterval(function(){var B=i.logger?i.logger.queue:[];tt(B,function(z){var ee={name:d||"InternalMessageId: "+z.messageId,iKey:i.config.instrumentationKey,time:Pr(new Date),baseType:Yn.dataType,baseData:{message:z.message}};i.track(ee)}),B.length=0},p),n},i.stopPollingInternalLogs=function(){!n||(clearInterval(n),n=0)};function s(d){if(De(d.name))throw v(d),Error("telemetry name required")}function v(d){var p=i.getNotifyMgr();p&&p.eventsDiscarded([d],A1.InvalidEvent)}}),r}return e}(_u);var gu=4294967296,Hi=4294967295,bu=!1,So=123456789,go=987654321;function Gv(t){t<0&&(t>>>=0),So=123456789+t&Hi,go=987654321-t&Hi,bu=!0}function Xv(){try{var t=fr()&2147483647;Gv((Math.random()*gu^t)+t)}catch{}}function wa(t){var e,r=fl()||dl();return r&&r.getRandomValues?e=r.getRandomValues(new Uint32Array(1))[0]&Hi:ki()?(bu||Xv(),e=xu()&Hi):e=Math.floor(gu*Math.random()|0),t||(e>>>=0),e}function xu(t){go=36969*(go&65535)+(go>>16)&Hi,So=18e3*(So&65535)+(So>>16)&Hi;var e=(go<<16)+(So&65535)>>>0&Hi|0;return t||(e>>>=0),e}var yu="visibilitychange",Eu="pagehide";function Cs(t,e){var r=!1,n=Hn();n&&(r=Tn(n,t,e),r=Tn(n.body,t,e)||r);var i=ir();return i&&(r=Tn(i,t,e)||r),r}function Ml(t,e,r){var n=!1;if(e&&t&&ur(t)){var i=[];tt(t,function(a){et(a)&&(!r||Un(r,a)===-1?n=Cs(a,e)||n:i.push(a))}),!n&&i.length>0&&(n=Ml(i,e))}return n}function Pl(t,e){return Ml(["beforeunload","unload","pagehide"],t,e)}function bo(t,e){function r(i){var a=ir();t&&a&&a.visibilityState==="hidden"&&t(i)}var n=!1;return(!e||Un(e,Eu)===-1)&&(n=Cs(Eu,t)),(!e||Un(e,yu)===-1)&&(n=Cs(yu,r)||n),!n&&e&&(n=bo(t)),n}function Ra(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=wa()>>>0,n=0,i="";i.length<t;)n++,i+=e.charAt(r&63),r>>>=6,n===5&&(r=(wa()<<2&4294967295|r&3)>>>0,n=0);return i}function zr(){for(var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],e="",r,n=0;n<4;n++)r=wa(),e+=t[r&15]+t[r>>4&15]+t[r>>8&15]+t[r>>12&15]+t[r>>16&15]+t[r>>20&15]+t[r>>24&15]+t[r>>28&15];var i=t[8+(wa()&3)|0];return e.substr(0,8)+e.substr(9,4)+"4"+e.substr(13,3)+i+e.substr(16,3)+e.substr(19,12)}var Ru="_aiHooks",Tu=["req","rsp","hkErr","fnErr"];function Nl(t,e){if(t)for(var r=0;r<t.length&&!e(t[r],r);r++);}function Bl(t,e,r,n,i){i>=0&&i<=2&&Nl(t,function(a,s){var v=a.cbks,d=v[Tu[i]];if(d){e.ctx=function(){var z=n[s]=n[s]||{};return z};try{d.apply(e.inst,r)}catch(z){var p=e.err;try{var B=v[Tu[2]];B&&(e.err=z,B.apply(e.inst,r))}catch{}finally{e.err=p}}}})}function $v(t){return function(){var e=this,r=arguments,n=t.h,i={name:t.n,inst:e,ctx:null,set:d},a=[],s=v([i],r);function v(B,z){return Nl(z,function(ee){B.push(ee)}),B}function d(B,z){r=v([],r),r[B]=z,s=v([i],r)}Bl(n,i,s,a,0);var p=t.f;try{i.rslt=p.apply(e,r)}catch(B){throw i.err=B,Bl(n,i,s,a,3),B}return Bl(n,i,s,a,1),i.rslt}}function Au(t,e,r){var n=null;return t&&(mo(t,e)?n=t:r&&(n=Au(X1(t),e,!1))),n}function Dl(t,e,r){return t?xo(t[Gt],e,r,!1):null}function xo(t,e,r,n){if(n===void 0&&(n=!0),t&&e&&r){var i=Au(t,e,n);if(i){var a=i[e];if(typeof a===En){var s=a[Ru];if(!s){s={i:0,n:e,f:a,h:[]};var v=$v(s);v[Ru]=s,i[e]=v}var d={id:s.i,cbks:r,rm:function(){var p=this.id;Nl(s.h,function(B,z){if(B.id===p)return s.h.splice(z,1),1})}};return s.i++,s.h.push(d),d}}}return null}var Ct={requestContextHeader:"Request-Context",requestContextTargetKey:"appId",requestContextAppIdFormat:"appId=cid-v1:",requestIdHeader:"Request-Id",traceParentHeader:"traceparent",traceStateHeader:"tracestate",sdkContextHeader:"Sdk-Context",sdkContextHeaderAppIdRequest:"appId",requestContextHeaderLowerCase:"request-context"};function kl(t,e,r){var n=e.length,i=Iu(t,e);if(i.length!==n){for(var a=0,s=i;r[s]!==void 0;)a++,s=i.substring(0,150-3)+Cu(a);i=s}return i}function Iu(t,e){var r;return e&&(e=Jt(e.toString()),e.length>150&&(r=e.substring(0,150),t&&t.throwInternal(Pe.WARNING,we.NameTooLong,"name is too long. It has been truncated to "+150+" characters.",{name:e},!0))),r||e}function Mt(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Jt(e),e.toString().length>r&&(n=e.toString().substring(0,r),t&&t.throwInternal(Pe.WARNING,we.StringValueTooLong,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}function Qn(t,e){return Fl(t,e,2048,we.UrlTooLong)}function yo(t,e){var r;return e&&e.length>32768&&(r=e.substring(0,32768),t&&t.throwInternal(Pe.WARNING,we.MessageTruncated,"message is too long, it has been truncated to "+32768+" characters.",{message:e},!0)),r||e}function Ol(t,e){var r;if(e){var n=""+e;n.length>32768&&(r=n.substring(0,32768),t&&t.throwInternal(Pe.WARNING,we.ExceptionTruncated,"exception is too long, it has been truncated to "+32768+" characters.",{exception:e},!0))}return r||e}function Br(t,e){if(e){var r={};Tt(e,function(n,i){if(Rn(i)&&An())try{i=vr().stringify(i)}catch(a){t&&t.throwInternal(Pe.WARNING,we.CannotSerializeObjectNonSerializable,"custom property is not valid",{exception:a},!0)}i=Mt(t,i,8192),n=kl(t,n,r),r[n]=i}),e=r}return e}function Nr(t,e){if(e){var r={};Tt(e,function(n,i){n=kl(t,n,r),r[n]=i}),e=r}return e}function Ll(t,e){return e&&Fl(t,e,128,we.IdTooLong).toString()}function Fl(t,e,r,n){var i;return e&&(e=Jt(e),e.length>r&&(i=e.substring(0,r),t&&t.throwInternal(Pe.WARNING,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),i||e}function Cu(t){var e="00"+t;return e.substr(e.length-3)}function Vi(t){var e=null;if(at(Event))e=new Event(t);else{var r=ir();r&&r.createEvent&&(e=r.createEvent("Event"),e.initEvent(t,!0,!0))}return e}function fn(t,e){return e===void 0&&(e=!1),t==null?e:t.toString().toLowerCase()==="true"}function Qr(t){(isNaN(t)||t<0)&&(t=0),t=Math.round(t);var e=""+t%1e3,r=""+Math.floor(t/1e3)%60,n=""+Math.floor(t/(1e3*60))%60,i=""+Math.floor(t/(1e3*60*60))%24,a=Math.floor(t/(1e3*60*60*24));return e=e.length===1?"00"+e:e.length===2?"0"+e:e,r=r.length<2?"0"+r:r,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(a>0?a+".":"")+i+":"+n+":"+r+"."+e}function Ul(t,e){var r=null;return tt(t,function(n){if(n.identifier===e)return r=n,-1}),r}function Hl(t,e,r,n,i){return!i&&et(t)&&(t==="Script error."||t==="Script error")}var Mn="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Ta="sampleRate",Aa="ProcessLegacy",Eo="http.method",Ms="https://dc.services.visualstudio.com",ar="not_specified",Ps="iKey";var mi;(function(t){t[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage"})(mi||(mi={}));var dn;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C",t[t.W3C=2]="W3C"})(dn||(dn={}));var qi=void 0,zi=void 0;function Vl(){return Ns()?Bs(mi.LocalStorage):null}function Bs(t){try{if(De(cn()))return null;var e=new Date,r=er(t===mi.LocalStorage?"localStorage":"sessionStorage");r.setItem(e.toString(),e.toString());var n=r.getItem(e.toString())!==e.toString();if(r.removeItem(e.toString()),!n)return r}catch{}return null}function ql(){return ji()?Bs(mi.SessionStorage):null}function zl(){qi=!1,zi=!1}function Ns(){return qi===void 0&&(qi=!!Bs(mi.LocalStorage)),qi}function jl(t,e){var r=Vl();if(r!==null)try{return r.getItem(e)}catch(n){qi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotReadLocalStorage,"Browser failed read of local storage. "+_t(n),{exception:it(n)})}return null}function Gl(t,e,r){var n=Vl();if(n!==null)try{return n.setItem(e,r),!0}catch(i){qi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotWriteLocalStorage,"Browser failed write to local storage. "+_t(i),{exception:it(i)})}return!1}function Xl(t,e){var r=Vl();if(r!==null)try{return r.removeItem(e),!0}catch(n){qi=!1,t.throwInternal(Pe.WARNING,we.BrowserFailedRemovalFromLocalStorage,"Browser failed removal of local storage item. "+_t(n),{exception:it(n)})}return!1}function ji(){return zi===void 0&&(zi=!!Bs(mi.SessionStorage)),zi}function Ia(t,e){var r=ql();if(r!==null)try{return r.getItem(e)}catch(n){zi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotReadSessionStorage,"Browser failed read of session storage. "+_t(n),{exception:it(n)})}return null}function Ca(t,e,r){var n=ql();if(n!==null)try{return n.setItem(e,r),!0}catch(i){zi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotWriteSessionStorage,"Browser failed write to session storage. "+_t(i),{exception:it(i)})}return!1}function Kl(t,e){var r=ql();if(r!==null)try{return r.removeItem(e),!0}catch(n){zi=!1,t.throwInternal(Pe.WARNING,we.BrowserFailedRemovalFromSessionStorage,"Browser failed removal of session storage item. "+_t(n),{exception:it(n)})}return!1}var Mu=ir()||{},Pu=0,rm=[null,null,null,null,null];function wo(t){var e=Pu,r=rm,n=r[e];return Mu.createElement?r[e]||(n=r[e]=Mu.createElement("a")):n={host:Wl(t,!0)},n.href=t,e++,e>=r.length&&(e=0),Pu=e,n}function Ds(t){var e,r=wo(t);return r&&(e=r.href),e}function ks(t,e){return t?t.toUpperCase()+" "+e:e}function Wl(t,e){var r=Os(t,e)||"";if(r){var n=r.match(/(www[0-9]?\.)?(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>3&&et(n[2])&&n[2].length>0)return n[2]+(n[3]||"")}return r}function Os(t,e){var r=null;if(t){var n=t.match(/(\w*):\/\/(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>2&&et(n[2])&&n[2].length>0&&(r=n[2]||"",e&&n.length>2)){var i=(n[1]||"").toLowerCase(),a=n[3]||"";(i==="http"&&a===":80"||i==="https"&&a===":443")&&(a=""),r+=a}}return r}var im=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"];function Gi(t){return im.indexOf(t.toLowerCase())!==-1}var Jn={correlationIdPrefix:"cid-v1:",canIncludeCorrelationHeader:function(t,e,r){if(!e||t&&t.disableCorrelationHeaders)return!1;if(t&&t.correlationHeaderExcludePatterns){for(var n=0;n<t.correlationHeaderExcludePatterns.length;n++)if(t.correlationHeaderExcludePatterns[n].test(e))return!1}var i=wo(e).host.toLowerCase();if(i&&(i.indexOf(":443")!==-1||i.indexOf(":80")!==-1)&&(i=(Os(e,!0)||"").toLowerCase()),(!t||!t.enableCorsCorrelation)&&i&&i!==r)return!1;var a=t&&t.correlationHeaderDomains;if(a){var s;if(tt(a,function(p){var B=new RegExp(p.toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));s=s||B.test(i)}),!s)return!1}var v=t&&t.correlationHeaderExcludedDomains;if(!v||v.length===0)return!0;for(var n=0;n<v.length;n++){var d=new RegExp(v[n].toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));if(d.test(i))return!1}return i&&i.length>0},getCorrelationContext:function(t){if(t){var e=Jn.getCorrelationContextValue(t,Ct.requestContextTargetKey);if(e&&e!==Jn.correlationIdPrefix)return e}},getCorrelationContextValue:function(t,e){if(t)for(var r=t.split(","),n=0;n<r.length;++n){var i=r[n].split("=");if(i.length===2&&i[0]===e)return i[1]}}};function Bu(t,e,r,n){var i,a=n,s=n;if(e&&e.length>0){var v=wo(e);if(i=v.host,!a)if(v.pathname!=null){var d=v.pathname.length===0?"/":v.pathname;d.charAt(0)!=="/"&&(d="/"+d),s=v.pathname,a=Mt(t,r?r+" "+d:d)}else a=Mt(t,e)}else i=n,a=n;return{target:i,name:a,data:s}}function Ma(){var t=Zr();if(t&&t.now&&t.timing){var e=t.now()+t.timing.navigationStart;if(e>0)return e}return fr()}function mr(t,e){var r=null;return t!==0&&e!==0&&!De(t)&&!De(e)&&(r=e-t),r}var am=";",om="=";function Yl(t){if(!t)return{};var e=t.split(am),r=hs(e,function(i,a){var s=a.split(om);if(s.length===2){var v=s[0].toLowerCase(),d=s[1];i[v]=d}return i},{});if(un(r).length>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r.ingestionendpoint=r.ingestionendpoint||"https://"+n+"dc."+r.endpointsuffix}r.ingestionendpoint=r.ingestionendpoint||Ms}return r}var $l=function(){function t(){}return t}();var Zl=function(t){ut(e,t);function e(){return t.call(this)||this}return e}($l);var Nu=function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return t}();var Ls=function(t){ut(e,t);function e(r,n,i){var a=t.call(this)||this;return a.name=Mt(r,i)||ar,a.data=n,a.time=Pr(new Date),a.aiDataContract={time:1,iKey:1,name:1,sampleRate:function(){return a.sampleRate===100?4:1},tags:1,data:1},a}return e}(Nu);var Fs=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var Jr=function(t){ut(e,t);function e(r,n,i,a){var s=t.call(this)||this;return s.aiDataContract={ver:1,name:1,properties:0,measurements:0},s.name=Mt(r,n)||ar,s.properties=Br(r,i),s.measurements=Nr(r,a),s}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(Fs);var Du=function(){function t(){}return t}();var ku=function(){function t(){this.ver=2,this.exceptions=[],this.properties={},this.measurements={}}return t}();var Ou=function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return t}();var sm="<no_method>",Ba="error",vn="stack",Jl="stackDetails",Lu="errorSrc",ec="message",Hu="description";function tc(t,e){var r=t;return r&&!et(r)&&(JSON&&JSON.stringify?(r=JSON.stringify(t),e&&(!r||r==="{}")&&(at(t.toString)?r=t.toString():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}function Vu(t,e){var r=t;return t&&(r&&!et(r)&&(r=t[ec]||t[Hu]||r),r&&!et(r)&&(r=tc(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&(r||"").indexOf(e)===-1&&(r=e+": "+r),r||""}function lm(t){try{if(Rn(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}function cm(t){try{if(Rn(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}function Fu(t){return t&&t.src&&et(t.src)&&t.obj&&ur(t.obj)}function Pa(t){var e=t||"";et(e)||(et(e[vn])?e=e[vn]:e=""+e);var r=e.split(`
16
- `);return{src:e,obj:r}}function um(t){for(var e=[],r=t.split(`
17
- `),n=0;n<r.length;n++){var i=r[n];r[n+1]&&(i+="@"+r[n+1],n++),e.push(i)}return{src:t,obj:e}}function qu(t){var e=null;if(t)try{if(t[vn])e=Pa(t[vn]);else if(t[Ba]&&t[Ba][vn])e=Pa(t[Ba][vn]);else if(t.exception&&t.exception[vn])e=Pa(t.exception[vn]);else if(Fu(t))e=t;else if(Fu(t[Jl]))e=t[Jl];else if(window&&window.opera&&t[ec])e=um(t.message);else if(et(t))e=Pa(t);else{var r=t[ec]||t[Hu]||"";et(t[Lu])&&(r&&(r+=`
18
- `),r+=" from "+t[Lu]),r&&(e=Pa(r))}}catch(n){e=Pa(n)}return e||{src:"",obj:null}}function fm(t){var e="";return t&&(t.obj?tt(t.obj,function(r){e+=r+`
19
- `}):e=t.src||""),e}function dm(t){var e,r=t.obj;if(r&&r.length>0){e=[];var n=0,i=0;tt(r,function(D){var ce=D.toString();if(rc.regex.test(ce)){var P=new rc(ce,n++);i+=P.sizeInBytes,e.push(P)}});var a=32*1024;if(i>a)for(var s=0,v=e.length-1,d=0,p=s,B=v;s<v;){var z=e[s].sizeInBytes,ee=e[v].sizeInBytes;if(d+=z+ee,d>a){var te=B-p+1;e.splice(p,te);break}p=s,B=v,s++,v--}}return e}function Us(t){var e="";if(t&&(e=t.typeName||t.name||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor.toString());e=n&&n.length>1?n[1]:""}catch{}return e}function Ql(t){if(t)try{if(!et(t)){var e=Us(t),r=tc(t,!1);return(!r||r==="{}")&&(t[Ba]&&(t=t[Ba],e=Us(t)),r=tc(t,!0)),r.indexOf(e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}var xr=function(t){ut(e,t);function e(r,n,i,a,s,v){var d=t.call(this)||this;return d.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0},cm(n)?(d.exceptions=n.exceptions,d.properties=n.properties,d.measurements=n.measurements,n.severityLevel&&(d.severityLevel=n.severityLevel),n.id&&(d.id=n.id),n.problemGroup&&(d.problemGroup=n.problemGroup),d.ver=2,De(n.isManual)||(d.isManual=n.isManual)):(i||(i={}),d.exceptions=[new Uu(r,n,i)],d.properties=Br(r,i),d.measurements=Nr(r,a),s&&(d.severityLevel=s),v&&(d.id=v)),d}return e.CreateAutoException=function(r,n,i,a,s,v,d,p){var B=Us(s||v||r);return{message:Vu(r,B),url:n,lineNumber:i,columnNumber:a,error:Ql(s||v||r),evt:Ql(v||r),typeName:B,stackDetails:qu(d||s||v),errorSrc:p}},e.CreateFromInterface=function(r,n,i,a){var s=n.exceptions&&Ni(n.exceptions,function(d){return Uu.CreateFromInterface(r,d)}),v=new e(r,Qt(Qt({},n),{exceptions:s}),i,a);return v},e.prototype.toInterface=function(){var r=this,n=r.exceptions,i=r.properties,a=r.measurements,s=r.severityLevel,v=r.problemGroup,d=r.id,p=r.isManual,B=n instanceof Array&&Ni(n,function(z){return z.toInterface()})||void 0;return{ver:"4.0",exceptions:B,severityLevel:s,properties:i,measurements:a,problemGroup:v,id:d,isManual:p}},e.CreateSimpleException=function(r,n,i,a,s,v){return{exceptions:[{hasFullStack:!0,message:r,stack:s,typeName:n}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e.formatError=Ql,e}(ku);var Uu=function(t){ut(e,t);function e(r,n,i){var a=t.call(this)||this;if(a.aiDataContract={id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2},lm(n))a.typeName=n.typeName,a.message=n.message,a[vn]=n[vn],a.parsedStack=n.parsedStack,a.hasFullStack=n.hasFullStack;else{var s=n,v=s&&s.evt;_a(s)||(s=s[Ba]||v||s),a.typeName=Mt(r,Us(s))||ar,a.message=yo(r,Vu(n||s,a.typeName))||ar;var d=n[Jl]||qu(n);a.parsedStack=dm(d),a[vn]=Ol(r,fm(d)),a.hasFullStack=ur(a.parsedStack)&&a.parsedStack.length>0,i&&(i.typeName=i.typeName||a.typeName)}return a}return e.prototype.toInterface=function(){var r=this.parsedStack instanceof Array&&Ni(this.parsedStack,function(i){return i.toInterface()}),n={id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this[vn],parsedStack:r||void 0};return n},e.CreateFromInterface=function(r,n){var i=n.parsedStack instanceof Array&&Ni(n.parsedStack,function(s){return rc.CreateFromInterface(s)})||n.parsedStack,a=new e(r,Qt(Qt({},n),{parsedStack:i}));return a},e}(Ou);var rc=function(t){ut(e,t);function e(r,n){var i=t.call(this)||this;if(i.sizeInBytes=0,i.aiDataContract={level:1,method:1,assembly:0,fileName:0,line:0},typeof r=="string"){var a=r;i.level=n,i.method=sm,i.assembly=Jt(a),i.fileName="",i.line=0;var s=a.match(e.regex);s&&s.length>=5&&(i.method=Jt(s[2])||i.method,i.fileName=Jt(s[4]),i.line=parseInt(s[5])||0)}else i.level=r.level,i.method=r.method,i.assembly=r.assembly,i.fileName=r.fileName,i.line=r.line,i.sizeInBytes=0;return i.sizeInBytes+=i.method.length,i.sizeInBytes+=i.fileName.length,i.sizeInBytes+=i.assembly.length,i.sizeInBytes+=e.baseSize,i.sizeInBytes+=i.level.toString().length,i.sizeInBytes+=i.line.toString().length,i}return e.CreateFromInterface=function(r){return new e(r,null)},e.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},e.regex=/^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/,e.baseSize=58,e}(Du);var zu=function(){function t(){this.ver=2,this.metrics=[],this.properties={},this.measurements={}}return t}();var Hs;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(Hs||(Hs={}));var ju=function(){function t(){this.kind=Hs.Measurement}return t}();var Gu=function(t){ut(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},r}return e}(ju);var en=function(t){ut(e,t);function e(r,n,i,a,s,v,d,p,B){var z=t.call(this)||this;z.aiDataContract={ver:1,metrics:1,properties:0};var ee=new Gu;return ee.count=a>0?a:void 0,ee.max=isNaN(v)||v===null?void 0:v,ee.min=isNaN(s)||s===null?void 0:s,ee.name=Mt(r,n)||ar,ee.value=i,ee.stdDev=isNaN(d)||d===null?void 0:d,z.metrics=[ee],z.properties=Br(r,p),z.measurements=Nr(r,B),z}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(zu);var Ro=function(t){ut(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(Fs);var Dr=function(t){ut(e,t);function e(r,n,i,a,s,v,d){var p=t.call(this)||this;return p.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0},p.id=Ll(r,d),p.url=Qn(r,i),p.name=Mt(r,n)||ar,isNaN(a)||(p.duration=Qr(a)),p.properties=Br(r,s),p.measurements=Nr(r,v),p}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(Ro);var Xu=function(){function t(){this.ver=2,this.success=!0,this.properties={},this.measurements={}}return t}();var tn=function(t){ut(e,t);function e(r,n,i,a,s,v,d,p,B,z,ee,te){B===void 0&&(B="Ajax");var D=t.call(this)||this;D.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0},D.id=n,D.duration=Qr(s),D.success=v,D.resultCode=d+"",D.type=Mt(r,B);var ce=Bu(r,i,p,a);return D.data=Qn(r,a)||ce.data,D.target=Mt(r,ce.target),z&&(D.target="".concat(D.target," | ").concat(z)),D.name=Mt(r,ce.name),D.properties=Br(r,ee),D.measurements=Nr(r,te),D}return e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(Xu);var Ku=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var Pn=function(t){ut(e,t);function e(r,n,i,a,s){var v=t.call(this)||this;return v.aiDataContract={ver:1,message:1,severityLevel:0,properties:0},n=n||ar,v.message=yo(r,n),v.properties=Br(r,a),v.measurements=Nr(r,s),i&&(v.severityLevel=i),v}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(Ku);var Wu=function(t){ut(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(Ro);var Bn=function(t){ut(e,t);function e(r,n,i,a,s,v,d){var p=t.call(this)||this;return p.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0},p.url=Qn(r,i),p.name=Mt(r,n)||ar,p.properties=Br(r,s),p.measurements=Nr(r,v),d&&(p.domProcessing=d.domProcessing,p.duration=d.duration,p.networkConnect=d.networkConnect,p.perfTotal=d.perfTotal,p.receivedResponse=d.receivedResponse,p.sentRequest=d.sentRequest),p}return e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(Wu);var qn=function(t){ut(e,t);function e(r,n){var i=t.call(this)||this;return i.aiDataContract={baseType:1,baseData:1},i.baseType=r,i.baseData=n,i}return e}(Zl);var Na;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(Na||(Na={}));function hi(t){var e="ai."+t+".";return function(r){return e+r}}var To=hi("application"),pr=hi("device"),Vs=hi("location"),Da=hi("operation"),nc=hi("session"),pi=hi("user"),Xi=hi("cloud"),Ao=hi("internal"),ka=function(t){ut(e,t);function e(){return t.call(this)||this}return e}(rl({applicationVersion:To("ver"),applicationBuild:To("build"),applicationTypeId:To("typeId"),applicationId:To("applicationId"),applicationLayer:To("layer"),deviceId:pr("id"),deviceIp:pr("ip"),deviceLanguage:pr("language"),deviceLocale:pr("locale"),deviceModel:pr("model"),deviceFriendlyName:pr("friendlyName"),deviceNetwork:pr("network"),deviceNetworkName:pr("networkName"),deviceOEMName:pr("oemName"),deviceOS:pr("os"),deviceOSVersion:pr("osVersion"),deviceRoleInstance:pr("roleInstance"),deviceRoleName:pr("roleName"),deviceScreenResolution:pr("screenResolution"),deviceType:pr("type"),deviceMachineName:pr("machineName"),deviceVMName:pr("vmName"),deviceBrowser:pr("browser"),deviceBrowserVersion:pr("browserVersion"),locationIp:Vs("ip"),locationCountry:Vs("country"),locationProvince:Vs("province"),locationCity:Vs("city"),operationId:Da("id"),operationName:Da("name"),operationParentId:Da("parentId"),operationRootId:Da("rootId"),operationSyntheticSource:Da("syntheticSource"),operationCorrelationVector:Da("correlationVector"),sessionId:nc("id"),sessionIsFirst:nc("isFirst"),sessionIsNew:nc("isNew"),userAccountAcquisitionDate:pi("accountAcquisitionDate"),userAccountId:pi("accountId"),userAgent:pi("userAgent"),userId:pi("id"),userStoreRegion:pi("storeRegion"),userAuthUserId:pi("authUserId"),userAnonymousUserAcquisitionDate:pi("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:pi("authUserAcquisitionDate"),cloudName:Xi("name"),cloudRole:Xi("role"),cloudRoleVer:Xi("roleVer"),cloudRoleInstance:Xi("roleInstance"),cloudEnvironment:Xi("environment"),cloudLocation:Xi("location"),cloudDeploymentUnit:Xi("deploymentUnit"),internalNodeName:Ao("nodeName"),internalSdkVersion:Ao("sdkVersion"),internalAgentVersion:Ao("agentVersion"),internalSnippet:Ao("snippet"),internalSdkSrc:Ao("sdkSrc")}));var mn=function(){function t(){}return t.create=function(e,r,n,i,a,s){if(n=Mt(i,n)||ar,De(e)||De(r)||De(n))throw Error("Input doesn't contain all required fields");var v="";e[Ps]&&(v=e[Ps],delete e[Ps]);var d={name:n,time:Pr(new Date),iKey:v,ext:s||{},tags:[],data:{},baseType:r,baseData:e};return De(a)||Tt(a,function(p,B){d.data[p]=B}),d},t}();var kr={UserExt:"user",DeviceExt:"device",TraceExt:"trace",WebExt:"web",AppExt:"app",OSExt:"os",SessionExt:"ses",SDKExt:"sdk"},Pt=new ka;var _i="AppInsightsPropertiesPlugin",Io="AppInsightsChannelPlugin",ic="ApplicationInsightsAnalytics";var Yu=function(){function t(e,r,n,i){gt(t,this,function(a){var s=null,v=[],d=!1,p;n&&(p=n.logger);function B(){n&&tt(n.getTransmissionControls(),function(ee){tt(ee,function(te){return te.flush(!0)})})}function z(ee){v.push(ee),s||(s=setInterval(function(){var te=v.slice(0),D=!1;v=[],tt(te,function(ce){ce()?D=!0:v.push(ce)}),v.length===0&&(clearInterval(s),s=null),D&&B()},100))}a.trackPageView=function(ee,te){var D=ee.name;if(De(D)||typeof D!="string"){var ce=ir();D=ee.name=ce&&ce.title||""}var P=ee.uri;if(De(P)||typeof P!="string"){var oe=$r();P=ee.uri=oe&&oe.href||""}if(!i.isPerformanceTimingSupported()){e.sendPageViewInternal(ee,te),B(),p.throwInternal(Pe.WARNING,we.NavigationTimingNotSupported,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");return}var se=!1,xe,Ge=i.getPerformanceTiming().navigationStart;Ge>0&&(xe=mr(Ge,+new Date),i.shouldCollectDuration(xe)||(xe=void 0));var lt;!De(te)&&!De(te.duration)&&(lt=te.duration),(r||!isNaN(lt))&&(isNaN(lt)&&(te||(te={}),te.duration=xe),e.sendPageViewInternal(ee,te),B(),se=!0);var ft=6e4;te||(te={}),z(function(){var st=!1;try{if(i.isPerformanceTimingDataReady()){st=!0;var yt={name:D,uri:P};i.populatePageViewPerformanceEvent(yt),!yt.isValid&&!se?(te.duration=xe,e.sendPageViewInternal(ee,te)):(se||(te.duration=yt.durationMs,e.sendPageViewInternal(ee,te)),d||(e.sendPageViewPerformanceInternal(yt,te),d=!0))}else Ge>0&&mr(Ge,+new Date)>ft&&(st=!0,se||(te.duration=ft,e.sendPageViewInternal(ee,te)))}catch(Xt){p.throwInternal(Pe.CRITICAL,we.TrackPVFailedCalc,"trackPageView failed on page load calculation: "+_t(Xt),{exception:it(Xt)})}return st})}})}return t}();var $u=function(){function t(e,r){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=r,this._logger=e}return t.prototype.trackPreviousPageVisit=function(e,r){try{var n=this.restartPageVisitTimer(e,r);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(i){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+it(i))}},t.prototype.restartPageVisitTimer=function(e,r){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,r),n}catch(i){return this._logger.warnToConsole("Call to restart failed: "+it(i)),null}},t.prototype.startPageVisitTimer=function(e,r){try{if(ji()){Ia(this._logger,this.prevPageVisitDataKeyName)!=null&&wr("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new Sm(e,r),i=vr().stringify(n);Ca(this._logger,this.prevPageVisitDataKeyName,i)}}catch(a){this._logger.warnToConsole("Call to start failed: "+it(a))}},t.prototype.stopPageVisitTimer=function(){try{if(ji()){var e=fr(),r=Ia(this._logger,this.prevPageVisitDataKeyName);if(r&&An()){var n=vr().parse(r);return n.pageVisitTime=e-n.pageVisitStartTime,Kl(this._logger,this.prevPageVisitDataKeyName),n}else return null}return null}catch(i){return this._logger.warnToConsole("Stop page visit timer failed: "+it(i)),null}},t}();var Sm=function(){function t(e,r){this.pageVisitStartTime=fr(),this.pageName=e,this.pageUrl=r}return t}();var Zu=function(){function t(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}return t.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var r=this.getPerformanceNavigationTiming(),n=this.getPerformanceTiming(),i=0,a=0,s=0,v=0,d=0;(r||n)&&(r?(i=r.duration,a=r.startTime===0?r.connectEnd:mr(r.startTime,r.connectEnd),s=mr(r.requestStart,r.responseStart),v=mr(r.responseStart,r.responseEnd),d=mr(r.responseEnd,r.loadEventEnd)):(i=mr(n.navigationStart,n.loadEventEnd),a=mr(n.navigationStart,n.connectEnd),s=mr(n.requestStart,n.responseStart),v=mr(n.responseStart,n.responseEnd),d=mr(n.responseEnd,n.loadEventEnd)),i===0?this._logger.throwInternal(Pe.WARNING,we.ErrorPVCalc,"error calculating page view performance.",{total:i,network:a,request:s,response:v,dom:d}):this.shouldCollectDuration(i,a,s,v,d)?i<Math.floor(a)+Math.floor(s)+Math.floor(v)+Math.floor(d)?this._logger.throwInternal(Pe.WARNING,we.ClientPerformanceMathError,"client performance math error.",{total:i,network:a,request:s,response:v,dom:d}):(e.durationMs=i,e.perfTotal=e.duration=Qr(i),e.networkConnect=Qr(a),e.sentRequest=Qr(s),e.receivedResponse=Qr(v),e.domProcessing=Qr(d),e.isValid=!0):this._logger.throwInternal(Pe.WARNING,we.InvalidDurationValue,"Invalid page load duration value. Browser perf data won't be sent.",{total:i,network:a,request:s,response:v,dom:d}))},t.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?Zr().timing:null},t.prototype.getPerformanceNavigationTiming=function(){return this.isPerformanceNavigationTimingSupported()?Zr().getEntriesByType("navigation")[0]:null},t.prototype.isPerformanceNavigationTimingSupported=function(){var e=Zr();return e&&e.getEntriesByType&&e.getEntriesByType("navigation").length>0},t.prototype.isPerformanceTimingSupported=function(){var e=Zr();return e&&e.timing},t.prototype.isPerformanceTimingDataReady=function(){var e=Zr(),r=e?e.timing:0;return r&&r.domainLookupStart>0&&r.navigationStart>0&&r.responseStart>0&&r.requestStart>0&&r.loadEventEnd>0&&r.responseEnd>0&&r.connectEnd>0&&r.domLoading>0},t.prototype.shouldCollectDuration=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=Rr()||{},i=["googlebot","adsbot-google","apis-google","mediapartners-google"],a=n.userAgent,s=!1;if(a)for(var v=0;v<i.length;v++)s=s||a.toLowerCase().indexOf(i[v])!==-1;if(s)return!1;for(var v=0;v<e.length;v++)if(e[v]<0||e[v]>=this.MAX_DURATION_ALLOWED)return!1;return!0},t}();var Qu="duration",ac="event";function Co(t,e){t&&t.dispatchEvent&&e&&t.dispatchEvent(e)}function gm(t){if(t&&t.reason){var e=t.reason;return!et(e)&&at(e.toString)?e.toString():it(e)}return t||""}var oc=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier=ic,r.priority=180,r.autoRoutePVDelay=500;var n,i,a,s=0,v,d;return gt(e,r,function(p,B){var z=$r(!0);v=z&&z.href||"",p.getCookieMgr=function(){return Ui(p.core)},p.processTelemetry=function(P,oe){Vn(p.core,function(){return p.identifier+":processTelemetry"},function(){var se=!1,xe=p._telemetryInitializers.length;oe=p._getTelCtx(oe);for(var Ge=0;Ge<xe;++Ge){var lt=p._telemetryInitializers[Ge];if(lt)try{if(lt.apply(null,[P])===!1){se=!0;break}}catch(ft){oe.diagLog().throwInternal(Pe.CRITICAL,we.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+_t(ft),{exception:it(ft)},!0)}}se||p.processNext(P,oe)},function(){return{item:P}},!P.sync)},p.trackEvent=function(P,oe){try{var se=mn.create(P,Jr.dataType,Jr.envelopeType,p.diagLog(),oe);p.core.track(se)}catch(xe){p.diagLog().throwInternal(Pe.WARNING,we.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+_t(xe),{exception:it(xe)})}},p.startTrackEvent=function(P){try{n.start(P)}catch(oe){p.diagLog().throwInternal(Pe.CRITICAL,we.StartTrackEventFailed,"startTrackEvent failed, event will not be collected: "+_t(oe),{exception:it(oe)})}},p.stopTrackEvent=function(P,oe,se){try{n.stop(P,void 0,oe)}catch(xe){p.diagLog().throwInternal(Pe.CRITICAL,we.StopTrackEventFailed,"stopTrackEvent failed, event will not be collected: "+_t(xe),{exception:it(xe)})}},p.trackTrace=function(P,oe){try{var se=mn.create(P,Pn.dataType,Pn.envelopeType,p.diagLog(),oe);p.core.track(se)}catch(xe){p.diagLog().throwInternal(Pe.WARNING,we.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+_t(xe),{exception:it(xe)})}},p.trackMetric=function(P,oe){try{var se=mn.create(P,en.dataType,en.envelopeType,p.diagLog(),oe);p.core.track(se)}catch(xe){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackMetricFailed,"trackMetric failed, metric will not be collected: "+_t(xe),{exception:it(xe)})}},p.trackPageView=function(P,oe){try{var se=P||{};p._pageViewManager.trackPageView(se,Qt(Qt(Qt({},se.properties),se.measurements),oe)),p.config.autoTrackPageVisitTime&&p._pageVisitTimeManager.trackPreviousPageVisit(se.name,se.uri)}catch(xe){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackPVFailed,"trackPageView failed, page view will not be collected: "+_t(xe),{exception:it(xe)})}},p.sendPageViewInternal=function(P,oe,se){var xe=ir();xe&&(P.refUri=P.refUri===void 0?xe.referrer:P.refUri);var Ge=mn.create(P,Dr.dataType,Dr.envelopeType,p.diagLog(),oe,se);p.core.track(Ge),s=0},p.sendPageViewPerformanceInternal=function(P,oe,se){var xe=mn.create(P,Bn.dataType,Bn.envelopeType,p.diagLog(),oe,se);p.core.track(xe)},p.trackPageViewPerformance=function(P,oe){try{p._pageViewPerformanceManager.populatePageViewPerformanceEvent(P),p.sendPageViewPerformanceInternal(P,oe)}catch(se){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackPVFailed,"trackPageViewPerformance failed, page view will not be collected: "+_t(se),{exception:it(se)})}},p.startTrackPage=function(P){try{if(typeof P!="string"){var oe=ir();P=oe&&oe.title||""}i.start(P)}catch(se){p.diagLog().throwInternal(Pe.CRITICAL,we.StartTrackFailed,"startTrackPage failed, page view may not be collected: "+_t(se),{exception:it(se)})}},p.stopTrackPage=function(P,oe,se,xe){try{if(typeof P!="string"){var Ge=ir();P=Ge&&Ge.title||""}if(typeof oe!="string"){var lt=$r();oe=lt&&lt.href||""}i.stop(P,oe,se,xe),p.config.autoTrackPageVisitTime&&p._pageVisitTimeManager.trackPreviousPageVisit(P,oe)}catch(ft){p.diagLog().throwInternal(Pe.CRITICAL,we.StopTrackFailed,"stopTrackPage failed, page view will not be collected: "+_t(ft),{exception:it(ft)})}},p.sendExceptionInternal=function(P,oe,se){var xe=P.exception||P.error||new Error(ar),Ge=new xr(p.diagLog(),xe,P.properties||oe,P.measurements,P.severityLevel,P.id).toInterface(),lt=mn.create(Ge,xr.dataType,xr.envelopeType,p.diagLog(),oe,se);p.core.track(lt)},p.trackException=function(P,oe){try{p.sendExceptionInternal(P,oe)}catch(se){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackExceptionFailed,"trackException failed, exception will not be collected: "+_t(se),{exception:it(se)})}},p._onerror=function(P){var oe=P&&P.error,se=P&&P.evt;try{if(!se){var xe=Hn();xe&&(se=xe[ac])}var Ge=P&&P.url||(ir()||{}).URL,lt=P.errorSrc||"window.onerror@"+Ge+":"+(P.lineNumber||0)+":"+(P.columnNumber||0),ft={errorSrc:lt,url:Ge,lineNumber:P.lineNumber||0,columnNumber:P.columnNumber||0,message:P.message};Hl(P.message,P.url,P.lineNumber,P.columnNumber,P.error)?ce(xr.CreateAutoException("Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",Ge,P.lineNumber||0,P.columnNumber||0,oe,se,null,lt),ft):(P.errorSrc||(P.errorSrc=lt),p.trackException({exception:P,severityLevel:Na.Error},ft))}catch(yt){var st=oe?oe.name+", "+oe.message:"null";p.diagLog().throwInternal(Pe.CRITICAL,we.ExceptionWhileLoggingError,"_onError threw exception while logging error, error will not be collected: "+_t(yt),{exception:it(yt),errorString:st})}},p.addTelemetryInitializer=function(P){p._telemetryInitializers.push(P)},p.initialize=function(P,oe,se,xe){if(!p.isInitialized()){if(De(oe))throw Error("Error initializing");B.initialize(P,oe,se,xe),p.setInitialized(!1);var Ge=p._getTelCtx(),lt=p.identifier;p.config=Ge.getExtCfg(lt);var ft=e.getDefaultConfig(P);ft!==void 0&&Tt(ft,function(St,kt){p.config[St]=Ge.getConfig(lt,St,kt),p.config[St]===void 0&&(p.config[St]=kt)}),p.config.isStorageUseDisabled&&zl();var st={instrumentationKey:function(){return P.instrumentationKey},accountId:function(){return p.config.accountId||P.accountId},sessionRenewalMs:function(){return p.config.sessionRenewalMs||P.sessionRenewalMs},sessionExpirationMs:function(){return p.config.sessionExpirationMs||P.sessionExpirationMs},sampleRate:function(){return p.config.samplingPercentage||P.samplingPercentage},sdkExtension:function(){return p.config.sdkExtension||P.sdkExtension},isBrowserLinkTrackingEnabled:function(){return p.config.isBrowserLinkTrackingEnabled||P.isBrowserLinkTrackingEnabled},appId:function(){return p.config.appId||P.appId}};p._pageViewPerformanceManager=new Zu(p.core),p._pageViewManager=new Yu(r,p.config.overridePageViewDuration,p.core,p._pageViewPerformanceManager),p._pageVisitTimeManager=new $u(p.diagLog(),function(St,kt,Nt){return ee(St,kt,Nt)}),p._telemetryInitializers=p._telemetryInitializers||[],te(st),n=new Ju(p.diagLog(),"trackEvent"),n.action=function(St,kt,Nt,It){It||(It={}),It[Qu]=Nt.toString(),p.trackEvent({name:St,properties:It})},i=new Ju(p.diagLog(),"trackPageView"),i.action=function(St,kt,Nt,It,Qe){De(It)&&(It={}),It[Qu]=Nt.toString();var T={name:St,uri:kt,properties:It,measurements:Qe};p.sendPageViewInternal(T,It)};var yt=Hn(),Xt=cl(),tr=$r(!0),sr=r;if(p.config.disableExceptionTracking===!1&&!p.config.autoExceptionInstrumented&&yt){var an="onerror",Tr=yt[an];yt.onerror=function(St,kt,Nt,It,Qe){var T=yt[ac],le=Tr&&Tr(St,kt,Nt,It,Qe);return le!==!0&&sr._onerror(xr.CreateAutoException(St,kt,Nt,It,Qe,T)),le},p.config.autoExceptionInstrumented=!0}if(p.config.disableExceptionTracking===!1&&p.config.enableUnhandledPromiseRejectionTracking===!0&&!p.config.autoUnhandledPromiseInstrumented&&yt){var hr="onunhandledrejection",gr=yt[hr];yt[hr]=function(St){var kt=yt[ac],Nt=gr&&gr.call(yt,St);return Nt!==!0&&sr._onerror(xr.CreateAutoException(gm(St),tr?tr.href:"",0,0,St,kt)),Nt},p.config.autoUnhandledPromiseInstrumented=!0}if(p.config.enableAutoRouteTracking===!0&&Xt&&at(Xt.pushState)&&at(Xt.replaceState)&&yt&&typeof Event<"u"){var $t=r;tt(se,function(St){St.identifier===_i&&(a=St)}),Xt.pushState=function(St){return function(){var Nt=St.apply(this,arguments);return Co(yt,Vi($t.config.namePrefix+"pushState")),Co(yt,Vi($t.config.namePrefix+"locationchange")),Nt}}(Xt.pushState),Xt.replaceState=function(St){return function(){var Nt=St.apply(this,arguments);return Co(yt,Vi($t.config.namePrefix+"replaceState")),Co(yt,Vi($t.config.namePrefix+"locationchange")),Nt}}(Xt.replaceState),yt.addEventListener&&(yt.addEventListener($t.config.namePrefix+"popstate",function(){Co(yt,Vi($t.config.namePrefix+"locationchange"))}),yt.addEventListener($t.config.namePrefix+"locationchange",function(){if(a&&a.context&&a.context.telemetryTrace){a.context.telemetryTrace.traceID=zr();var St="_unknown_";tr&&tr.pathname&&(St=tr.pathname+(tr.hash||"")),a.context.telemetryTrace.name=Mt($t.diagLog(),St)}d&&(v=d),d=tr&&tr.href||"",setTimeout(function(kt){$t.trackPageView({refUri:kt,properties:{duration:0}})}.bind(r,v),$t.autoRoutePVDelay)}))}p.setInitialized(!0)}};function ee(P,oe,se){var xe={PageName:P,PageUrl:oe};p.trackMetric({name:"PageVisitTime",average:se,max:se,min:se,sampleCount:1},xe)}function te(P){if(!P.isBrowserLinkTrackingEnabled()){var oe=["/browserLinkSignalR/","/__browserLink/"],se=function(xe){if(xe.baseType===tn.dataType){var Ge=xe.baseData;if(Ge){for(var lt=0;lt<oe.length;lt++)if(Ge.target&&Ge.target.indexOf(oe[lt])>=0)return!1}}return!0};D(se)}}function D(P){p._telemetryInitializers.push(P)}function ce(P,oe){var se=mn.create(P,xr.dataType,xr.envelopeType,p.diagLog(),oe);p.core.track(se)}}),r}return e.getDefaultConfig=function(r){return r||(r={}),r.sessionRenewalMs=30*60*1e3,r.sessionExpirationMs=24*60*60*1e3,r.disableExceptionTracking=fn(r.disableExceptionTracking),r.autoTrackPageVisitTime=fn(r.autoTrackPageVisitTime),r.overridePageViewDuration=fn(r.overridePageViewDuration),r.enableUnhandledPromiseRejectionTracking=fn(r.enableUnhandledPromiseRejectionTracking),(isNaN(r.samplingPercentage)||r.samplingPercentage<=0||r.samplingPercentage>=100)&&(r.samplingPercentage=100),r.isStorageUseDisabled=fn(r.isStorageUseDisabled),r.isBrowserLinkTrackingEnabled=fn(r.isBrowserLinkTrackingEnabled),r.enableAutoRouteTracking=fn(r.enableAutoRouteTracking),r.namePrefix=r.namePrefix||"",r.enableDebug=fn(r.enableDebug),r.disableFlushOnBeforeUnload=fn(r.disableFlushOnBeforeUnload),r.disableFlushOnUnload=fn(r.disableFlushOnUnload,r.disableFlushOnBeforeUnload),r},e.Version="2.7.4",e}(In);var Ju=function(){function t(e,r){var n=this,i={};n.start=function(a){typeof i[a]<"u"&&e.throwInternal(Pe.WARNING,we.StartCalledMoreThanOnce,"start was called more than once for this event without calling stop.",{name:a,key:a},!0),i[a]=+new Date},n.stop=function(a,s,v,d){var p=i[a];if(isNaN(p))e.throwInternal(Pe.WARNING,we.StopCalledWithoutStart,"stop was called without a corresponding start.",{name:a,key:a},!0);else{var B=+new Date,z=mr(p,B);n.action(a,s,z,v,d)}delete i[a],i[a]=void 0}}return t}();var ef=function(){function t(e,r){var n=[],i=!1;this._get=function(){return n},this._set=function(a){return n=a,n},gt(t,this,function(a){a.enqueue=function(s){if(a.count()>=r.eventsLimitInMem()){i||(e.throwInternal(Pe.WARNING,we.InMemoryStorageBufferFull,"Maximum in-memory buffer size reached: "+a.count(),!0),i=!0);return}n.push(s)},a.count=function(){return n.length},a.size=function(){for(var s=n.length,v=0;v<n.length;v++)s+=n[v].length;return r.emitLineDelimitedJson()||(s+=2),s},a.clear=function(){n=[],i=!1},a.getItems=function(){return n.slice(0)},a.batchPayloads=function(s){if(s&&s.length>0){var v=r.emitLineDelimitedJson()?s.join(`
20
- `):"["+s.join(",")+"]";return v}return null}})}return t}(),tf=function(t){ut(e,t);function e(r,n){var i=t.call(this,r,n)||this;return gt(e,i,function(a,s){a.markAsSent=function(v){s.clear()},a.clearSent=function(v){}}),i}return e}(ef);var rf=function(t){ut(e,t);function e(r,n){var i=t.call(this,r,n)||this,a=!1;return gt(e,i,function(s,v){var d=ee(e.BUFFER_KEY),p=ee(e.SENT_BUFFER_KEY),B=s._set(d.concat(p));B.length>e.MAX_BUFFER_SIZE&&(B.length=e.MAX_BUFFER_SIZE),te(e.SENT_BUFFER_KEY,[]),te(e.BUFFER_KEY,B),s.enqueue=function(D){if(s.count()>=e.MAX_BUFFER_SIZE){a||(r.throwInternal(Pe.WARNING,we.SessionStorageBufferFull,"Maximum buffer size reached: "+s.count(),!0),a=!0);return}v.enqueue(D),te(e.BUFFER_KEY,s._get())},s.clear=function(){v.clear(),te(e.BUFFER_KEY,s._get()),te(e.SENT_BUFFER_KEY,[]),a=!1},s.markAsSent=function(D){te(e.BUFFER_KEY,s._set(z(D,s._get())));var ce=ee(e.SENT_BUFFER_KEY);ce instanceof Array&&D instanceof Array&&(ce=ce.concat(D),ce.length>e.MAX_BUFFER_SIZE&&(r.throwInternal(Pe.CRITICAL,we.SessionStorageBufferFull,"Sent buffer reached its maximum size: "+ce.length,!0),ce.length=e.MAX_BUFFER_SIZE),te(e.SENT_BUFFER_KEY,ce))},s.clearSent=function(D){var ce=ee(e.SENT_BUFFER_KEY);ce=z(D,ce),te(e.SENT_BUFFER_KEY,ce)};function z(D,ce){var P=[];return tt(ce,function(oe){!at(oe)&&Un(D,oe)===-1&&P.push(oe)}),P}function ee(D){var ce=D;try{ce=n.namePrefix&&n.namePrefix()?n.namePrefix()+"_"+ce:ce;var P=Ia(r,ce);if(P){var oe=vr().parse(P);if(et(oe)&&(oe=vr().parse(oe)),oe&&ur(oe))return oe}}catch(se){r.throwInternal(Pe.CRITICAL,we.FailedToRestoreStorageBuffer," storage key: "+ce+", "+_t(se),{exception:it(se)})}return[]}function te(D,ce){var P=D;try{P=n.namePrefix&&n.namePrefix()?n.namePrefix()+"_"+P:P;var oe=JSON.stringify(ce);Ca(r,P,oe)}catch(se){Ca(r,P,JSON.stringify([])),r.throwInternal(Pe.WARNING,we.FailedToSetStorageBuffer," storage key: "+P+", "+_t(se)+". Buffer cleared",{exception:it(se)})}}}),i}return e.BUFFER_KEY="AI_buffer",e.SENT_BUFFER_KEY="AI_sentBuffer",e.MAX_BUFFER_SIZE=2e3,e}(ef);var sc="baseType",zt="baseData",Sr="properties",nf="true";function or(t,e,r){return ht(t,e,r,ga)}function bm(t,e,r){var n=r.tags=r.tags||{},i=e.ext=e.ext||{},a=e.tags=e.tags||[],s=i.user;s&&(or(n,Pt.userAuthUserId,s.authId),or(n,Pt.userId,s.id||s.localId));var v=i.app;v&&or(n,Pt.sessionId,v.sesId);var d=i.device;d&&(or(n,Pt.deviceId,d.id||d.localId),or(n,Pt.deviceType,d.deviceClass),or(n,Pt.deviceIp,d.ip),or(n,Pt.deviceModel,d.model),or(n,Pt.deviceType,d.deviceType));var p=e.ext.web;if(p){or(n,Pt.deviceLanguage,p.browserLang),or(n,Pt.deviceBrowserVersion,p.browserVer),or(n,Pt.deviceBrowser,p.browser);var B=r.data=r.data||{},z=B[zt]=B[zt]||{},ee=z[Sr]=z[Sr]||{};or(ee,"domain",p.domain),or(ee,"isManual",p.isManual?nf:null),or(ee,"screenRes",p.screenRes),or(ee,"userConsent",p.userConsent?nf:null)}var te=i.os;te&&or(n,Pt.deviceOS,te.name);var D=i.trace;D&&(or(n,Pt.operationParentId,D.parentID),or(n,Pt.operationName,Mt(t,D.name)),or(n,Pt.operationId,D.traceID));for(var ce={},P=a.length-1;P>=0;P--){var oe=a[P];Tt(oe,function(xe,Ge){ce[xe]=Ge}),a.splice(P,1)}Tt(a,function(xe,Ge){ce[xe]=Ge});var se=Qt(Qt({},n),ce);se[Pt.internalSdkVersion]||(se[Pt.internalSdkVersion]="javascript:".concat(xm.Version)),r.tags=Ss(se)}function Si(t,e,r){De(t)||Tt(t,function(n,i){Sa(i)?r[n]=i:et(i)?e[n]=i:An()&&(e[n]=vr().stringify(i))})}function Ki(t,e){De(t)||Tt(t,function(r,n){t[r]=n||e})}function Wi(t,e,r,n){var i=new Ls(t,n,e);or(i,"sampleRate",r[Ta]),(r[zt]||{}).startTime&&(i.time=Pr(r[zt].startTime)),i.iKey=r.iKey;var a=r.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),bm(t,r,i),r.tags=r.tags||[],Ss(i)}function Yi(t,e){De(e[zt])&&t.throwInternal(Pe.CRITICAL,we.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.")}var xm={Version:"2.7.4"};function af(t,e,r){Yi(t,e);var n=e[zt].measurements||{},i=e[zt][Sr]||{};Si(e.data,i,n),De(r)||Ki(i,r);var a=e[zt];if(De(a))return t.warnToConsole("Invalid input for dependency data"),null;var s=a[Sr]&&a[Sr][Eo]?a[Sr][Eo]:"GET",v=new tn(t,a.id,a.target,a.name,a.duration,a.success,a.responseCode,s,a.type,a.correlationContext,i,n),d=new qn(tn.dataType,v);return Wi(t,tn.envelopeType,e,d)}function lc(t,e,r){Yi(t,e);var n={},i={};e[sc]!==Jr.dataType&&(n.baseTypeSource=e[sc]),e[sc]===Jr.dataType?(n=e[zt][Sr]||{},i=e[zt].measurements||{}):e[zt]&&Si(e[zt],n,i),Si(e.data,n,i),De(r)||Ki(n,r);var a=e[zt].name,s=new Jr(t,a,n,i),v=new qn(Jr.dataType,s);return Wi(t,Jr.envelopeType,e,v)}function of(t,e,r){Yi(t,e);var n=e[zt].measurements||{},i=e[zt][Sr]||{};Si(e.data,i,n),De(r)||Ki(i,r);var a=e[zt],s=xr.CreateFromInterface(t,a,i,n),v=new qn(xr.dataType,s);return Wi(t,xr.envelopeType,e,v)}function sf(t,e,r){Yi(t,e);var n=e[zt],i=n[Sr]||{},a=n.measurements||{};Si(e.data,i,a),De(r)||Ki(i,r);var s=new en(t,n.name,n.average,n.sampleCount,n.min,n.max,n.stdDev,i,a),v=new qn(en.dataType,s);return Wi(t,en.envelopeType,e,v)}function lf(t,e,r){Yi(t,e);var n="duration",i,a=e[zt];!De(a)&&!De(a[Sr])&&!De(a[Sr][n])?(i=a[Sr][n],delete a[Sr][n]):!De(e.data)&&!De(e.data[n])&&(i=e.data[n],delete e.data[n]);var s=e[zt],v;((e.ext||{}).trace||{}).traceID&&(v=e.ext.trace.traceID);var d=s.id||v,p=s.name,B=s.uri,z=s[Sr]||{},ee=s.measurements||{};if(De(s.refUri)||(z.refUri=s.refUri),De(s.pageType)||(z.pageType=s.pageType),De(s.isLoggedIn)||(z.isLoggedIn=s.isLoggedIn.toString()),!De(s[Sr])){var te=s[Sr];Tt(te,function(P,oe){z[P]=oe})}Si(e.data,z,ee),De(r)||Ki(z,r);var D=new Dr(t,p,B,i,z,ee,d),ce=new qn(Dr.dataType,D);return Wi(t,Dr.envelopeType,e,ce)}function cf(t,e,r){Yi(t,e);var n=e[zt],i=n.name,a=n.uri||n.url,s=n[Sr]||{},v=n.measurements||{};Si(e.data,s,v),De(r)||Ki(s,r);var d=new Bn(t,i,a,void 0,s,v,n),p=new qn(Bn.dataType,d);return Wi(t,Bn.envelopeType,e,p)}function uf(t,e,r){Yi(t,e);var n=e[zt].message,i=e[zt].severityLevel,a=e[zt][Sr]||{},s=e[zt].measurements||{};Si(e.data,a,s),De(r)||Ki(a,r);var v=new Pn(t,n,i,a,s),d=new qn(Pn.dataType,v);return Wi(t,Pn.envelopeType,e,d)}var ff=function(){function t(e){gt(t,this,function(r){r.serialize=function(s){var v=n(s,"root");try{return vr().stringify(v)}catch(d){e.throwInternal(Pe.CRITICAL,we.CannotSerializeObject,d&&at(d.toString)?d.toString():"Error serializing object",null,!0)}};function n(s,v){var d="__aiCircularRefCheck",p={};if(!s)return e.throwInternal(Pe.CRITICAL,we.CannotSerializeObject,"cannot serialize object because it is null or undefined",{name:v},!0),p;if(s[d])return e.throwInternal(Pe.WARNING,we.CircularReferenceDetected,"Circular reference detected while serializing object",{name:v},!0),p;if(!s.aiDataContract){if(v==="measurements")p=a(s,"number",v);else if(v==="properties")p=a(s,"string",v);else if(v==="tags")p=a(s,"string",v);else if(ur(s))p=i(s,v);else{e.throwInternal(Pe.WARNING,we.CannotSerializeObjectNonSerializable,"Attempting to serialize an object which does not implement ISerializable",{name:v},!0);try{vr().stringify(s),p=s}catch(B){e.throwInternal(Pe.CRITICAL,we.CannotSerializeObject,B&&at(B.toString)?B.toString():"Error serializing object",null,!0)}}return p}return s[d]=!0,Tt(s.aiDataContract,function(B,z){var ee=at(z)?z()&1:z&1,te=at(z)?z()&4:z&4,D=z&2,ce=s[B]!==void 0,P=Rn(s[B])&&s[B]!==null;if(ee&&!ce&&!D)e.throwInternal(Pe.CRITICAL,we.MissingRequiredFieldSpecification,"Missing required field specification. The field is required but not present on source",{field:B,name:v});else if(!te){var oe=void 0;P?D?oe=i(s[B],B):oe=n(s[B],B):oe=s[B],oe!==void 0&&(p[B]=oe)}}),delete s[d],p}function i(s,v){var d;if(s)if(!ur(s))e.throwInternal(Pe.CRITICAL,we.ItemNotInArray,`This field was specified as an array in the contract but the item is not an array.\r
21
- `,{name:v},!0);else{d=[];for(var p=0;p<s.length;p++){var B=s[p],z=n(B,v+"["+p+"]");d.push(z)}}return d}function a(s,v,d){var p;return s&&(p={},Tt(s,function(B,z){if(v==="string")z===void 0?p[B]="undefined":z===null?p[B]="null":z.toString?p[B]=z.toString():p[B]="invalid field: toString() is not defined.";else if(v==="number")if(z===void 0)p[B]="undefined";else if(z===null)p[B]="null";else{var ee=parseFloat(z);isNaN(ee)?p[B]="NaN":p[B]=ee}else p[B]="invalid field: "+d+" is of unknown type.",e.throwInternal(Pe.CRITICAL,p[B],null,!0)})),p}})}return t}();var ym=function(){function t(){var e=Hn(),r=ir(),n=!1,i=!0;gt(t,this,function(a){try{if(e&&Tn(e,"online",d)&&(Tn(e,"offline",p),n=!0),r){var s=r.body||r;Wt(s.ononline)||(s.ononline=d,s.onoffline=p,n=!0)}if(n){var v=Rr();v&&!De(v.onLine)&&(i=v.onLine)}}catch{n=!1}a.isListening=n,a.isOnline=function(){var B=!0,z=Rr();return n?B=i:z&&!De(z.onLine)&&(B=z.onLine),B},a.isOffline=function(){return!a.isOnline()};function d(){i=!0}function p(){i=!1}})}return t.Offline=new t,t}();var cc=ym.Offline;var Em=8,df=function(){function t(){}return t.prototype.getHashCodeScore=function(e){var r=this.getHashCode(e)/t.INT_MAX_VALUE;return r*100},t.prototype.getHashCode=function(e){if(e==="")return 0;for(;e.length<Em;)e=e.concat(e);for(var r=5381,n=0;n<e.length;++n)r=(r<<5)+r+e.charCodeAt(n),r=r&r;return Math.abs(r)},t.INT_MAX_VALUE=2147483647,t}();var vf=function(){function t(){var e=this,r=new df,n=new ka;e.getSamplingScore=function(i){var a=0;return i.tags&&i.tags[n.userId]?a=r.getHashCodeScore(i.tags[n.userId]):i.ext&&i.ext.user&&i.ext.user.id?a=r.getHashCodeScore(i.ext.user.id):i.tags&&i.tags[n.operationId]?a=r.getHashCodeScore(i.tags[n.operationId]):i.ext&&i.ext.telemetryTrace&&i.ext.telemetryTrace.traceID?a=r.getHashCodeScore(i.ext.telemetryTrace.traceID):a=Math.random()*100,a}}return t}();var mf=function(){function t(e,r){this.INT_MAX_VALUE=2147483647;var n=r||$n(null);(e>100||e<0)&&(n.throwInternal(Pe.WARNING,we.SampleRateOutOfRange,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this.sampleRate=e,this.samplingScoreGenerator=new vf}return t.prototype.isSampledIn=function(e){var r=this.sampleRate,n=!1;return r==null||r>=100||e.baseType===en.dataType?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)<r,n)},t}();var ei,wm=65e3;function qs(t){try{return t.responseText}catch{}return null}function pf(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},disableXhr:function(){return!1},onunloadDisableFetch:function(){return!1},onunloadDisableBeacon:function(){return!1},instrumentationKey:function(){},namePrefix:function(){},samplingPercentage:function(){return 100},customHeaders:function(){},convertUndefined:function(){},eventsLimitInMem:function(){return 1e4}}}var Rm=(ei={},ei[Jr.dataType]=lc,ei[Pn.dataType]=uf,ei[Dr.dataType]=lf,ei[Bn.dataType]=cf,ei[xr.dataType]=of,ei[en.dataType]=sf,ei[tn.dataType]=af,ei),uc=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=Io;var n,i,a,s=!1,v,d,p,B={},z=0,ee,te;return r._senderConfig=pf(),gt(e,r,function(D,ce){function P(){wr("Method not implemented.")}D.pause=function(){gr(),s=!0},D.resume=function(){s&&(s=!1,i=null,D._buffer.size()>D._senderConfig.maxBatchSizeInBytes()&&D.triggerSend(!0,null,10),hr())},D.flush=function(){if(!s){gr();try{D.triggerSend(!0,null,1)}catch(le){D.diagLog().throwInternal(Pe.CRITICAL,we.FlushFailed,"flush failed, telemetry will not be collected: "+_t(le),{exception:it(le)})}}},D.onunloadFlush=function(){if(!s)if((D._senderConfig.onunloadDisableBeacon()===!1||D._senderConfig.isBeaconApiDisabled()===!1)&&Oi())try{D.triggerSend(!0,Ge,2)}catch(le){D.diagLog().throwInternal(Pe.CRITICAL,we.FailedToSendQueuedTelemetry,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+_t(le),{exception:it(le)})}else D.flush()},D.teardown=P,D.addHeader=function(le,Le){B[le]=Le},D.initialize=function(le,Le,$e,ae){ce.initialize(le,Le,$e,ae);var be=D._getTelCtx(),Ie=D.identifier;d=new ff(Le.logger),n=0,i=null,a=0,D._sender=null,p=0;var Ce=D.diagLog(),Be=pf();Tt(Be,function(ot,mt){D._senderConfig[ot]=function(){return be.getConfig(Ie,ot,mt())}}),D._buffer=D._senderConfig.enableSessionStorageBuffer()&&ji()?new rf(Ce,D._senderConfig):new tf(Ce,D._senderConfig),D._sample=new mf(D._senderConfig.samplingPercentage(),Ce),T(le)||Ce.throwInternal(Pe.CRITICAL,we.InvalidInstrumentationKey,"Invalid Instrumentation key "+le.instrumentationKey),!Gi(D._senderConfig.endpointUrl())&&D._senderConfig.customHeaders()&&D._senderConfig.customHeaders().length>0&&tt(D._senderConfig.customHeaders(),function(ot){r.addHeader(ot.header,ot.value)});var Ye=D._senderConfig,Fe=null;!Ye.disableXhr()&&xs()?Fe=kt:!Ye.disableXhr()&&Li()&&(Fe=st),!Fe&&bs()&&(Fe=Xt),ee=Fe||st,!Ye.isBeaconApiDisabled()&&Oi()&&(Fe=ft),D._sender=Fe||st,!Ye.onunloadDisableFetch()&&bs(!0)?te=yt:Oi()?te=ft:!Ye.disableXhr()&&xs()?te=kt:!Ye.disableXhr()&&Li()?te=st:te=ee},D.processTelemetry=function(le,Le){Le=D._getTelCtx(Le);try{if(D._senderConfig.disableTelemetry())return;if(!le){Le.diagLog().throwInternal(Pe.CRITICAL,we.CannotSendEmptyTelemetry,"Cannot send empty telemetry");return}if(le.baseData&&!le.baseType){Le.diagLog().throwInternal(Pe.CRITICAL,we.InvalidEvent,"Cannot send telemetry without baseData and baseType");return}if(le.baseType||(le.baseType="EventData"),!D._sender){Le.diagLog().throwInternal(Pe.CRITICAL,we.SenderNotInitialized,"Sender was not initialized");return}if(oe(le))le[Ta]=D._sample.sampleRate;else{Le.diagLog().throwInternal(Pe.WARNING,we.TelemetrySampledAndNotSent,"Telemetry item was sampled out and not sent",{SampleRate:D._sample.sampleRate});return}var $e=D._senderConfig.convertUndefined()||void 0,ae=le.iKey||D._senderConfig.instrumentationKey(),be=e.constructEnvelope(le,ae,Le.diagLog(),$e);if(!be){Le.diagLog().throwInternal(Pe.CRITICAL,we.CreateEnvelopeError,"Unable to create an AppInsights envelope");return}var Ie=!1;if(le.tags&&le.tags[Aa]&&(tt(le.tags[Aa],function(Fe){try{Fe&&Fe(be)===!1&&(Ie=!0,Le.diagLog().warnToConsole("Telemetry processor check returns false"))}catch(ot){Le.diagLog().throwInternal(Pe.CRITICAL,we.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+_t(ot),{exception:it(ot)},!0)}}),delete le.tags[Aa]),Ie)return;var Ce=d.serialize(be),Be=D._buffer,Ye=Be.size();Ye+Ce.length>D._senderConfig.maxBatchSizeInBytes()&&D.triggerSend(!0,null,10),Be.enqueue(Ce),hr()}catch(Fe){Le.diagLog().throwInternal(Pe.WARNING,we.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+_t(Fe),{exception:it(Fe)})}D.processNext(le,Le)},D._xhrReadyStateChange=function(le,Le,$e){le.readyState===4&&se(le.status,Le,le.responseURL,$e,St(le),qs(le)||le.response)},D.triggerSend=function(le,Le,$e){if(le===void 0&&(le=!0),!s)try{var ae=D._buffer;if(D._senderConfig.disableTelemetry())ae.clear();else{if(ae.count()>0){var be=ae.getItems();Qe($e||0,le),Le?Le.call(r,be,le):D._sender(be,le)}a=+new Date}gr()}catch(Ce){var Ie=xa();(!Ie||Ie>9)&&D.diagLog().throwInternal(Pe.CRITICAL,we.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+_t(Ce),{exception:it(Ce)})}},D._onError=function(le,Le,$e){D.diagLog().throwInternal(Pe.WARNING,we.OnError,"Failed to send telemetry.",{message:Le}),D._buffer.clearSent(le)},D._onPartialSuccess=function(le,Le){for(var $e=[],ae=[],be=Le.errors.reverse(),Ie=0,Ce=be;Ie<Ce.length;Ie++){var Be=Ce[Ie],Ye=le.splice(Be.index,1)[0];$t(Be.statusCode)?ae.push(Ye):$e.push(Ye)}le.length>0&&D._onSuccess(le,Le.itemsAccepted),$e.length>0&&D._onError($e,St(null,["partial success",Le.itemsAccepted,"of",Le.itemsReceived].join(" "))),ae.length>0&&(an(ae),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,"Partial success. Delivered: "+le.length+", Failed: "+$e.length+". Will retry to send "+ae.length+" our of "+Le.itemsReceived+" items"))},D._onSuccess=function(le,Le){D._buffer.clearSent(le)},D._xdrOnLoad=function(le,Le){var $e=qs(le);if(le&&($e+""=="200"||$e===""))n=0,D._onSuccess(Le,0);else{var ae=sr($e);ae&&ae.itemsReceived&&ae.itemsReceived>ae.itemsAccepted&&!D._senderConfig.isRetryDisabled()?D._onPartialSuccess(Le,ae):D._onError(Le,Nt(le))}};function oe(le){return D._sample.isSampledIn(le)}function se(le,Le,$e,ae,be,Ie){var Ce=null;if(D._appId||(Ce=sr(Ie),Ce&&Ce.appId&&(D._appId=Ce.appId)),(le<200||le>=300)&&le!==0){if((le===301||le===307||le===308)&&!xe($e)){D._onError(Le,be);return}!D._senderConfig.isRetryDisabled()&&$t(le)?(an(Le),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Response code "+le+". Will retry to send "+Le.length+" items.")):D._onError(Le,be)}else if(cc.isOffline()){if(!D._senderConfig.isRetryDisabled()){var Be=10;an(Le,Be),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Offline - Response Code: ".concat(le,". Offline status: ").concat(cc.isOffline(),". Will retry to send ").concat(Le.length," items."))}}else xe($e),le===206?(Ce||(Ce=sr(Ie)),Ce&&!D._senderConfig.isRetryDisabled()?D._onPartialSuccess(Le,Ce):D._onError(Le,be)):(n=0,D._onSuccess(Le,ae))}function xe(le){return p>=10?!1:!De(le)&&le!==""&&le!==D._senderConfig.endpointUrl()?(D._senderConfig.endpointUrl=function(){return le},++p,!0):!1}function Ge(le,Le){te?te(le,!1):ft(le,Le)}function lt(le){var Le=Rr(),$e=D._buffer,ae=D._senderConfig.endpointUrl(),be=D._buffer.batchPayloads(le),Ie=new Blob([be],{type:"text/plain;charset=UTF-8"}),Ce=Le.sendBeacon(ae,Ie);return Ce&&($e.markAsSent(le),D._onSuccess(le,le.length)),Ce}function ft(le,Le){if(ur(le)&&le.length>0&&!lt(le)){for(var $e=[],ae=0;ae<le.length;ae++){var be=le[ae];lt([be])||$e.push(be)}$e.length>0&&(ee($e,!0),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with normal sender."))}}function st(le,Le){var $e=new XMLHttpRequest,ae=D._senderConfig.endpointUrl();try{$e[Mn]=!0}catch{}$e.open("POST",ae,Le),$e.setRequestHeader("Content-type","application/json"),Gi(ae)&&$e.setRequestHeader(Ct.sdkContextHeader,Ct.sdkContextHeaderAppIdRequest),tt(un(B),function(Ie){$e.setRequestHeader(Ie,B[Ie])}),$e.onreadystatechange=function(){return D._xhrReadyStateChange($e,le,le.length)},$e.onerror=function(Ie){return D._onError(le,St($e),Ie)};var be=D._buffer.batchPayloads(le);$e.send(be),D._buffer.markAsSent(le)}function yt(le,Le){if(ur(le)){for(var $e=le.length,ae=0;ae<le.length;ae++)$e+=le[ae].length;z+$e<=wm?tr(le,!1):Oi()?ft(le,Le):(ee&&ee(le,!0),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with xhrSender."))}}function Xt(le,Le){tr(le,!0)}function tr(le,Le){var $e,ae=D._senderConfig.endpointUrl(),be=D._buffer.batchPayloads(le),Ie=new Blob([be],{type:"application/json"}),Ce=new Headers,Be=be.length,Ye=!1,Fe=!1;Gi(ae)&&Ce.append(Ct.sdkContextHeader,Ct.sdkContextHeaderAppIdRequest),tt(un(B),function(Ee){Ce.append(Ee,B[Ee])});var ot=($e={method:"POST",headers:Ce,body:Ie},$e[Mn]=!0,$e);Le||(ot.keepalive=!0,Ye=!0,z+=Be);var mt=new Request(ae,ot);try{mt[Mn]=!0}catch{}D._buffer.markAsSent(le);try{fetch(mt).then(function(Ee){Le||(z-=Be,Be=0),Fe||(Fe=!0,Ee.ok?Ee.text().then(function(br){se(Ee.status,le,Ee.url,le.length,Ee.statusText,br)}):D._onError(le,Ee.statusText))}).catch(function(Ee){Le||(z-=Be,Be=0),Fe||(Fe=!0,D._onError(le,Ee.message))})}catch(Ee){Fe||D._onError(le,it(Ee))}Ye&&!Fe&&(Fe=!0,D._onSuccess(le,le.length))}function sr(le){try{if(le&&le!==""){var Le=vr().parse(le);if(Le&&Le.itemsReceived&&Le.itemsReceived>=Le.itemsAccepted&&Le.itemsReceived-Le.itemsAccepted===Le.errors.length)return Le}}catch($e){D.diagLog().throwInternal(Pe.CRITICAL,we.InvalidBackendResponse,"Cannot parse the response. "+_t($e),{response:le})}return null}function an(le,Le){if(Le===void 0&&(Le=1),!(!le||le.length===0)){var $e=D._buffer;$e.clearSent(le),n++;for(var ae=0,be=le;ae<be.length;ae++){var Ie=be[ae];$e.enqueue(Ie)}Tr(Le),hr()}}function Tr(le){var Le=10,$e;if(n<=1)$e=Le;else{var ae=(Math.pow(2,n)-1)/2,be=Math.floor(Math.random()*ae*Le)+1;be=le*be,$e=Math.max(Math.min(be,3600),Le)}var Ie=fr()+$e*1e3;i=Ie}function hr(){if(!v&&!s){var le=i?Math.max(0,i-fr()):0,Le=Math.max(D._senderConfig.maxBatchInterval(),le);v=setTimeout(function(){v=null,D.triggerSend(!0,null,1)},Le)}}function gr(){clearTimeout(v),v=null,i=null}function $t(le){return le===408||le===429||le===500||le===503}function St(le,Le){return le?"XMLHttpRequest,Status:"+le.status+",Response:"+qs(le)||le.response||"":Le}function kt(le,Le){var $e=D._buffer,ae=Hn(),be=new XDomainRequest;be.onload=function(){return D._xdrOnLoad(be,le)},be.onerror=function(Ye){return D._onError(le,Nt(be),Ye)};var Ie=ae&&ae.location&&ae.location.protocol||"";if(D._senderConfig.endpointUrl().lastIndexOf(Ie,0)!==0){D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),$e.clear();return}var Ce=D._senderConfig.endpointUrl().replace(/^(https?:)/,"");be.open("POST",Ce);var Be=$e.batchPayloads(le);be.send(Be),$e.markAsSent(le)}function Nt(le,Le){return le?"XDomainRequest,Response:"+qs(le)||"":Le}function It(){var le="getNotifyMgr";return D.core[le]?D.core[le]():D.core._notificationManager}function Qe(le,Le){var $e=It();if($e&&$e.eventsSendRequest)try{$e.eventsSendRequest(le,Le)}catch(ae){D.diagLog().throwInternal(Pe.CRITICAL,we.NotificationException,"send request notification failed: "+_t(ae),{exception:it(ae)})}}function T(le){var Le=De(le.disableInstrumentationKeyValidation)?!1:le.disableInstrumentationKeyValidation;if(Le)return!0;var $e="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",ae=new RegExp($e);return ae.test(le.instrumentationKey)}}),r}return e.constructEnvelope=function(r,n,i,a){var s;n!==r.iKey&&!De(n)?s=Qt(Qt({},r),{iKey:n}):s=r;var v=Rm[s.baseType]||lc;return v(i,s,a)},e}(In);var Tm="ai_session",fc=function(){function t(){}return t}();var hf=function(){function t(e,r){var n=this,i,a,s=$n(r),v=Ui(r);gt(t,n,function(d){e||(e={}),at(e.sessionExpirationMs)||(e.sessionExpirationMs=function(){return t.acquisitionSpan}),at(e.sessionRenewalMs)||(e.sessionRenewalMs=function(){return t.renewalSpan}),d.config=e;var p=d.config.sessionCookiePostfix&&d.config.sessionCookiePostfix()?d.config.sessionCookiePostfix():d.config.namePrefix&&d.config.namePrefix()?d.config.namePrefix():"";i=function(){return Tm+p},d.automaticSession=new fc,d.update=function(){var ce=fr(),P=!1,oe=d.automaticSession;oe.id||(P=!B(oe,ce));var se=d.config.sessionExpirationMs();if(!P&&se>0){var xe=d.config.sessionRenewalMs(),Ge=ce-oe.acquisitionDate,lt=ce-oe.renewalDate;P=Ge<0||lt<0,P=P||Ge>se,P=P||lt>xe}P?ee(ce):(!a||ce-a>t.cookieUpdateInterval)&&te(oe,ce)},d.backup=function(){var ce=d.automaticSession;D(ce.id,ce.acquisitionDate,ce.renewalDate)};function B(ce,P){var oe=!1,se=v.get(i());if(se&&at(se.split))oe=z(ce,se);else{var xe=jl(s,i());xe&&(oe=z(ce,xe))}return oe||!!ce.id}function z(ce,P){var oe=!1,se=", session will be reset",xe=P.split("|");if(xe.length>=2)try{var Ge=+xe[1]||0,lt=+xe[2]||0;isNaN(Ge)||Ge<=0?s.throwInternal(Pe.WARNING,we.SessionRenewalDateIsZero,"AI session acquisition date is 0"+se):isNaN(lt)||lt<=0?s.throwInternal(Pe.WARNING,we.SessionRenewalDateIsZero,"AI session renewal date is 0"+se):xe[0]&&(ce.id=xe[0],ce.acquisitionDate=Ge,ce.renewalDate=lt,oe=!0)}catch(ft){s.throwInternal(Pe.CRITICAL,we.ErrorParsingAISessionCookie,"Error parsing ai_session value ["+(P||"")+"]"+se+" - "+_t(ft),{exception:it(ft)})}return oe}function ee(ce){var P=d.config||{},oe=(P.getNewId?P.getNewId():null)||Ra;d.automaticSession.id=oe(P.idLength?P.idLength():22),d.automaticSession.acquisitionDate=ce,te(d.automaticSession,ce),Ns()||s.throwInternal(Pe.WARNING,we.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")}function te(ce,P){var oe=ce.acquisitionDate;ce.renewalDate=P;var se=d.config,xe=se.sessionRenewalMs(),Ge=oe+se.sessionExpirationMs()-P,lt=[ce.id,oe,P],ft=0;Ge<xe?ft=Ge/1e3:ft=xe/1e3;var st=se.cookieDomain?se.cookieDomain():null;v.set(i(),lt.join("|"),se.sessionExpirationMs()>0?ft:null,st),a=P}function D(ce,P,oe){Gl(s,i(),[ce,P,oe].join("|"))}})}return t.acquisitionSpan=864e5,t.renewalSpan=18e5,t.cookieUpdateInterval=6e4,t}();var _f=function(){function t(){}return t}();var Sf=function(){function t(){this.id="browser",this.deviceClass="Browser"}return t}();var Am="2.7.4",gf=function(){function t(e){this.sdkVersion=(e.sdkExtension&&e.sdkExtension()?e.sdkExtension()+"_":"")+"javascript:"+Am}return t}();function bf(t){return!(typeof t!="string"||!t||t.match(/,|;|=| |\|/))}var xf=function(){function t(e,r){this.isNewUser=!1,this.isUserCookieSet=!1;var n=$n(r),i=Ui(r),a;gt(t,this,function(s){s.config=e;var v=s.config.userCookiePostfix&&s.config.userCookiePostfix()?s.config.userCookiePostfix():"";a=function(){return t.userCookieName+v};var d=i.get(a());if(d){s.isNewUser=!1;var p=d.split(t.cookieSeparator);p.length>0&&(s.id=p[0],s.isUserCookieSet=!!s.id)}function B(){var oe=e||{},se=(oe.getNewId?oe.getNewId():null)||Ra,xe=se(oe.idLength?e.idLength():22);return xe}function z(oe){var se=Pr(new Date);s.accountAcquisitionDate=se,s.isNewUser=!0;var xe=[oe,se];return xe}function ee(oe){var se=31536e3;s.isUserCookieSet=i.set(a(),oe,se)}if(!s.id){s.id=B();var te=z(s.id);ee(te.join(t.cookieSeparator));var D=e.namePrefix&&e.namePrefix()?e.namePrefix()+"ai_session":"ai_session";Xl(n,D)}s.accountId=e.accountId?e.accountId():void 0;var ce=i.get(t.authUserCookieName);if(ce){ce=decodeURI(ce);var P=ce.split(t.cookieSeparator);P[0]&&(s.authenticatedId=P[0]),P.length>1&&P[1]&&(s.accountId=P[1])}s.setAuthenticatedUserContext=function(oe,se,xe){xe===void 0&&(xe=!1);var Ge=!bf(oe)||se&&!bf(se);if(Ge){n.throwInternal(Pe.WARNING,we.SetAuthContextFailedAccountName,"Setting auth user context failed. User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.",!0);return}s.authenticatedId=oe;var lt=s.authenticatedId;se&&(s.accountId=se,lt=[s.authenticatedId,s.accountId].join(t.cookieSeparator)),xe&&i.set(t.authUserCookieName,encodeURI(lt))},s.clearAuthenticatedUserContext=function(){s.authenticatedId=null,s.accountId=null,i.del(t.authUserCookieName)},s.update=function(oe){if(s.id!==oe||!s.isUserCookieSet){var se=oe||B(),xe=z(se);ee(xe.join(t.cookieSeparator))}}})}return t.cookieSeparator="|",t.userCookieName="ai_user",t.authUserCookieName="ai_authUser",t}();var yf=function(){function t(){}return t}();var Ef=function(){function t(e,r,n,i){var a=this;a.traceID=e||zr(),a.parentID=r,a.name=n;var s=$r();!n&&s&&s.pathname&&(a.name=s.pathname),a.name=Mt(i,a.name)}return t}();var zs="ext",js="tags";function Oa(t,e){t&&t[e]&&un(t[e]).length===0&&delete t[e]}var wf=function(){function t(e,r){var n=this,i=e.logger;this.appId=function(){return null},this.getSessionId=function(){return null},gt(t,this,function(a){a.application=new _f,a.internal=new gf(r),Di()&&(a.sessionManager=new hf(r,e),a.device=new Sf,a.location=new yf,a.user=new xf(r,e),a.telemetryTrace=new Ef(void 0,void 0,void 0,i),a.session=new fc),a.getSessionId=function(){var s=a.session,v=null;if(s&&et(s.id))v=s.id;else{var d=(a.sessionManager||{}).automaticSession;v=d&&et(d.id)?d.id:null}return v},a.applySessionContext=function(s,v){ht(dr(s.ext,kr.AppExt),"sesId",a.getSessionId(),et)},a.applyOperatingSystemContxt=function(s,v){ht(s.ext,kr.OSExt,a.os)},a.applyApplicationContext=function(s,v){var d=a.application;if(d){var p=dr(s,js);ht(p,Pt.applicationVersion,d.ver,et),ht(p,Pt.applicationBuild,d.build,et)}},a.applyDeviceContext=function(s,v){var d=a.device;if(d){var p=dr(dr(s,zs),kr.DeviceExt);ht(p,"localId",d.id,et),ht(p,"ip",d.ip,et),ht(p,"model",d.model,et),ht(p,"deviceClass",d.deviceClass,et)}},a.applyInternalContext=function(s,v){var d=a.internal;if(d){var p=dr(s,js);ht(p,Pt.internalAgentVersion,d.agentVersion,et),ht(p,Pt.internalSdkVersion,d.sdkVersion,et),(s.baseType===Yn.dataType||s.baseType===Dr.dataType)&&(ht(p,Pt.internalSnippet,d.snippetVer,et),ht(p,Pt.internalSdkSrc,d.sdkSrc,et))}},a.applyLocationContext=function(s,v){var d=n.location;d&&ht(dr(s,js,[]),Pt.locationIp,d.ip,et)},a.applyOperationContext=function(s,v){var d=a.telemetryTrace;if(d){var p=dr(dr(s,zs),kr.TraceExt,{traceID:void 0,parentID:void 0});ht(p,"traceID",d.traceID,et),ht(p,"name",d.name,et),ht(p,"parentID",d.parentID,et)}},a.applyWebContext=function(s,v){var d=n.web;d&&ht(dr(s,zs),kr.WebExt,d)},a.applyUserContext=function(s,v){var d=a.user;if(d){var p=dr(s,js,[]);ht(p,Pt.userAccountId,d.accountId,et);var B=dr(dr(s,zs),kr.UserExt);ht(B,"id",d.id,et),ht(B,"authId",d.authenticatedId,et)}},a.cleanUp=function(s,v){var d=s.ext;d&&(Oa(d,kr.DeviceExt),Oa(d,kr.UserExt),Oa(d,kr.WebExt),Oa(d,kr.OSExt),Oa(d,kr.AppExt),Oa(d,kr.TraceExt))}})}return t}();var Im=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.priority=110,r.identifier=_i;var n,i;return gt(e,r,function(a,s){a.initialize=function(d,p,B,z){s.initialize(d,p,B,z);var ee=a._getTelCtx(),te=a.identifier,D=e.getDefaultConfig();i=i||{},Tt(D,function(ce,P){i[ce]=function(){return ee.getConfig(te,ce,P())}}),a.context=new wf(p,i),n=Ul(B,Io),a.context.appId=function(){return n?n._appId:null},a._extConfig=i},a.processTelemetry=function(d,p){if(!De(d)){p=a._getTelCtx(p),d.name===Dr.envelopeType&&p.diagLog().resetInternalMessageCount();var B=a.context||{};B.session&&typeof a.context.session.id!="string"&&B.sessionManager&&B.sessionManager.update();var z=B.user;if(z&&!z.isUserCookieSet&&z.update(B.user.id),v(d,p),z&&z.isNewUser){z.isNewUser=!1;var ee=new Yn(we.SendBrowserInfoOnUserInit,(Rr()||{}).userAgent||"");p.diagLog().logInternalMessage(Pe.CRITICAL,ee)}a.processNext(d,p)}};function v(d,p){dr(d,"tags",[]),dr(d,"ext",{});var B=a.context;B.applySessionContext(d,p),B.applyApplicationContext(d,p),B.applyDeviceContext(d,p),B.applyOperationContext(d,p),B.applyUserContext(d,p),B.applyOperatingSystemContxt(d,p),B.applyWebContext(d,p),B.applyLocationContext(d,p),B.applyInternalContext(d,p),B.cleanUp(d,p)}}),r}return e.getDefaultConfig=function(){var r={instrumentationKey:function(){},accountId:function(){return null},sessionRenewalMs:function(){return 18e5},samplingPercentage:function(){return 100},sessionExpirationMs:function(){return 864e5},cookieDomain:function(){return null},sdkExtension:function(){return null},isBrowserLinkTrackingEnabled:function(){return!1},appId:function(){return null},getSessionId:function(){return null},namePrefix:function(){},sessionCookiePostfix:function(){},userCookiePostfix:function(){},idLength:function(){return 22},getNewId:function(){return null}};return r},e}(In),dc=Im;var rn="properties";function Rf(t,e,r){var n=0,i=t[e],a=t[r];return i&&a&&(n=mr(i,a)),n}function $i(t,e,r,n,i){var a=0,s=Rf(r,n,i);return s&&(a=gi(t,e,Qr(s))),a}function gi(t,e,r){var n="ajaxPerf",i=0;if(t&&e&&r){var a=t[n]=t[n]||{};a[e]=r,i=1}return i}function Cm(t,e){var r=t.perfTiming,n=e[rn]||{},i=0,a="name",s="Start",v="End",d="domainLookup",p="connect",B="redirect",z="request",ee="response",te="duration",D="startTime",ce=d+s,P=d+v,oe=p+s,se=p+v,xe=z+s,Ge=z+v,lt=ee+s,ft=ee+v,st=B+s,yt=B=v,Xt="transferSize",tr="encodedBodySize",sr="decodedBodySize",an="serverTiming";if(r){i|=$i(n,B,r,st,yt),i|=$i(n,d,r,ce,P),i|=$i(n,p,r,oe,se),i|=$i(n,z,r,xe,Ge),i|=$i(n,ee,r,lt,ft),i|=$i(n,"networkConnect",r,D,se),i|=$i(n,"sentRequest",r,xe,ft);var Tr=r[te];Tr||(Tr=Rf(r,D,ft)||0),i|=gi(n,te,Tr),i|=gi(n,"perfTotal",Tr);var hr=r[an];if(hr){var gr={};tt(hr,function($t,St){var kt=J0($t[a]||""+St),Nt=gr[kt]||{};Tt($t,function(It,Qe){(It!==a&&et(Qe)||Sa(Qe))&&(Nt[It]&&(Qe=Nt[It]+";"+Qe),(Qe||!et(Qe))&&(Nt[It]=Qe))}),gr[kt]=Nt}),i|=gi(n,an,gr)}i|=gi(n,Xt,r[Xt]),i|=gi(n,tr,r[tr]),i|=gi(n,sr,r[sr])}else t.perfMark&&(i|=gi(n,"missing",t.perfAttempts));i&&(e[rn]=n)}var Mm=function(){function t(){var e=this;e.openDone=!1,e.setRequestHeaderDone=!1,e.sendDone=!1,e.abortDone=!1,e.stateChangeAttached=!1}return t}();var vc=function(){function t(e,r,n){var i=this,a=n,s="responseText";i.perfMark=null,i.completed=!1,i.requestHeadersSize=null,i.requestHeaders=null,i.responseReceivingDuration=null,i.callbackDuration=null,i.ajaxTotalDuration=null,i.aborted=0,i.pageUrl=null,i.requestUrl=null,i.requestSize=0,i.method=null,i.status=null,i.requestSentTime=null,i.responseStartedTime=null,i.responseFinishedTime=null,i.callbackFinishedTime=null,i.endTime=null,i.xhrMonitoringState=new Mm,i.clientFailure=0,i.traceID=e,i.spanID=r,gt(t,i,function(v){v.getAbsoluteUrl=function(){return v.requestUrl?Ds(v.requestUrl):null},v.getPathName=function(){return v.requestUrl?Qn(a,ks(v.method,v.requestUrl)):null},v.CreateTrackItem=function(d,p,B){var z;if(v.ajaxTotalDuration=Math.round(mr(v.requestSentTime,v.responseFinishedTime)*1e3)/1e3,v.ajaxTotalDuration<0)return null;var ee=(z={id:"|"+v.traceID+"."+v.spanID,target:v.getAbsoluteUrl(),name:v.getPathName(),type:d,startTime:null,duration:v.ajaxTotalDuration,success:+v.status>=200&&+v.status<400,responseCode:+v.status,method:v.method},z[rn]={HttpMethod:v.method},z);if(v.requestSentTime&&(ee.startTime=new Date,ee.startTime.setTime(v.requestSentTime)),Cm(v,ee),p&&un(v.requestHeaders).length>0&&(ee[rn]=ee[rn]||{},ee[rn].requestHeaders=v.requestHeaders),B){var te=B();if(te){var D=te.correlationContext;if(D&&(ee.correlationContext=D),te.headerMap&&un(te.headerMap).length>0&&(ee[rn]=ee[rn]||{},ee[rn].responseHeaders=te.headerMap),v.errorStatusText&&v.status>=400){var ce=te.type;ee[rn]=ee[rn]||{},(ce===""||ce==="text")&&(ee[rn][s]=te[s]?te.statusText+" - "+te[s]:te.statusText),ce==="json"&&(ee[rn][s]=te.response?te.statusText+" - "+JSON.stringify(te.response):te.statusText)}}}return ee}})}return t}();var mc=function(){function t(e,r){var n=this;n.traceFlag=t.DEFAULT_TRACE_FLAG,n.version=t.DEFAULT_VERSION,e&&t.isValidTraceId(e)?n.traceId=e:n.traceId=zr(),r&&t.isValidSpanId(r)?n.spanId=r:n.spanId=zr().substr(0,16)}return t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.prototype.toString=function(){var e=this;return"".concat(e.version,"-").concat(e.traceId,"-").concat(e.spanId,"-").concat(e.traceFlag)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t}();var Tf="ai.ajxmn.",Po="diagLog",nn="ajaxData",If="throwInternal",Bo="fetch",Af=0;function Pm(){var t=cn();return!t||De(t.Request)||De(t.Request[Gt])||De(t[Bo])?null:t[Bo]}function Bm(t){var e=!1;if(Li()){var r=XMLHttpRequest[Gt];e=!De(r)&&!De(r.open)&&!De(r.send)&&!De(r.abort)}var n=xa();if(n&&n<9&&(e=!1),e)try{var i=new XMLHttpRequest;i[nn]={};var a=XMLHttpRequest[Gt].open;XMLHttpRequest[Gt].open=a}catch(s){e=!1,No(t,we.FailedMonitorAjaxOpen,"Failed to enable XMLHttpRequest monitoring, extension is not supported",{exception:it(s)})}return e}function Gs(t){var e="";try{!De(t)&&!De(t[nn])&&!De(t[nn].requestUrl)&&(e+="(url: '"+t[nn].requestUrl+"')")}catch{}return e}function No(t,e,r,n,i){t[Po]()[If](Pe.CRITICAL,e,r,n,i)}function La(t,e,r,n,i){t[Po]()[If](Pe.WARNING,e,r,n,i)}function Mo(t,e,r){return function(n){No(t,e,r,{ajaxDiagnosticsMessage:Gs(n.inst),exception:it(n.err)})}}function Fa(t,e){return t&&e?t.indexOf(e):-1}var pc=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier=e.identifier,r.priority=120;var n="trackDependencyDataInternal",i=$r(),a=!1,s=!1,v=i&&i.host&&i.host.toLowerCase(),d=e.getEmptyConfig(),p=!1,B=!1,z=0,ee,te,D,ce,P=!1,oe=0,se=!1,xe=[],Ge={},lt,ft;return gt(e,r,function(st,yt){st.initialize=function(ae,be,Ie,Ce){if(!st.isInitialized()){yt.initialize(ae,be,Ie,Ce);var Be=st._getTelCtx(),Ye=e.getDefaultConfig();Tt(Ye,function(br,Ar){d[br]=Be.getConfig(e.identifier,br,Ar)});var Fe=d.distributedTracingMode;if(p=d.enableRequestHeaderTracking,B=d.enableAjaxErrorStatusText,P=d.enableAjaxPerfTracking,oe=d.maxAjaxCallsPerView,se=d.enableResponseHeaderTracking,lt=d.excludeRequestFromAutoTrackingPatterns,ft=d.addRequestContext,D=Fe===dn.AI||Fe===dn.AI_AND_W3C,te=Fe===dn.AI_AND_W3C||Fe===dn.W3C,P){var ot=ae.instrumentationKey||"unkwn";ot.length>5?ce=Tf+ot.substring(ot.length-5)+".":ce=Tf+ot+"."}if(d.disableAjaxTracking===!1&&an(),tr(),Ie.length>0&&Ie){for(var mt=void 0,Ee=0;!mt&&Ee<Ie.length;)Ie[Ee]&&Ie[Ee].identifier===_i&&(mt=Ie[Ee]),Ee++;mt&&(ee=mt.context)}}},st.teardown=function(){tt(xe,function(ae){ae.rm()}),xe=[],a=!1,s=!1,st.setInitialized(!1)},st.trackDependencyData=function(ae,be){st[n](ae,be)},st.includeCorrelationHeaders=function(ae,be,Ie,Ce){var Be=st._currentWindowHost||v;if(be){if(Jn.canIncludeCorrelationHeader(d,ae.getAbsoluteUrl(),Be)){if(Ie||(Ie={}),Ie.headers=new Headers(Ie.headers||(be instanceof Request?be.headers||{}:{})),D){var Ye="|"+ae.traceID+"."+ae.spanID;Ie.headers.set(Ct.requestIdHeader,Ye),p&&(ae.requestHeaders[Ct.requestIdHeader]=Ye)}var Fe=d.appId||ee&&ee.appId();if(Fe&&(Ie.headers.set(Ct.requestContextHeader,Ct.requestContextAppIdFormat+Fe),p&&(ae.requestHeaders[Ct.requestContextHeader]=Ct.requestContextAppIdFormat+Fe)),te){var ot=new mc(ae.traceID,ae.spanID);Ie.headers.set(Ct.traceParentHeader,ot.toString()),p&&(ae.requestHeaders[Ct.traceParentHeader]=ot.toString())}}return Ie}else if(Ce){if(Jn.canIncludeCorrelationHeader(d,ae.getAbsoluteUrl(),Be)){if(D){var Ye="|"+ae.traceID+"."+ae.spanID;Ce.setRequestHeader(Ct.requestIdHeader,Ye),p&&(ae.requestHeaders[Ct.requestIdHeader]=Ye)}var Fe=d.appId||ee&&ee.appId();if(Fe&&(Ce.setRequestHeader(Ct.requestContextHeader,Ct.requestContextAppIdFormat+Fe),p&&(ae.requestHeaders[Ct.requestContextHeader]=Ct.requestContextAppIdFormat+Fe)),te){var ot=new mc(ae.traceID,ae.spanID);Ce.setRequestHeader(Ct.traceParentHeader,ot.toString()),p&&(ae.requestHeaders[Ct.traceParentHeader]=ot.toString())}}return Ce}},st[n]=function(ae,be,Ie){if(oe===-1||z<oe){(d.distributedTracingMode===dn.W3C||d.distributedTracingMode===dn.AI_AND_W3C)&&typeof ae.id=="string"&&ae.id[ae.id.length-1]!=="."&&(ae.id+="."),De(ae.startTime)&&(ae.startTime=new Date);var Ce=mn.create(ae,tn.dataType,tn.envelopeType,st[Po](),be,Ie);st.core.track(Ce)}else z===oe&&No(st,we.MaxAjaxPerPVExceeded,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++z};function Xt(ae){var be=!0;return(ae||d.ignoreHeaders)&&tt(d.ignoreHeaders,function(Ie){if(Ie.toLowerCase()===ae.toLowerCase())return be=!1,-1}),be}function tr(){var ae=Pm();if(!!ae){var be=cn(),Ie=ae.polyfill;d.disableFetchTracking===!1?(xe.push(xo(be,Bo,{req:function(Ce,Be,Ye){var Fe;if(a&&!Tr(null,Be,Ye)&&!(Ie&&s)){var ot=Ce.ctx();Fe=T(Be,Ye);var mt=st.includeCorrelationHeaders(Fe,Be,Ye);mt!==Ye&&Ce.set(1,mt),ot.data=Fe}},rsp:function(Ce,Be){var Ye=Ce.ctx().data;Ye&&(Ce.rslt=Ce.rslt.then(function(Fe){return Le(Ce,(Fe||{}).status,Be,Fe,Ye,function(){var ot={statusText:Fe.statusText,headerMap:null,correlationContext:$e(Fe)};if(se){var mt={};Fe.headers.forEach(function(Ee,br){Xt(br)&&(mt[br]=Ee)}),ot.headerMap=mt}return ot}),Fe}).catch(function(Fe){throw Le(Ce,0,Be,null,Ye,null,{error:Fe.message}),Fe}))},hkErr:Mo(st,we.FailedMonitorAjaxOpen,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.")})),a=!0):Ie&&xe.push(xo(be,Bo,{req:function(Ce,Be,Ye){Tr(null,Be,Ye)}})),Ie&&(be[Bo].polyfill=Ie)}}function sr(ae,be,Ie){xe.push(Dl(ae,be,Ie))}function an(){Bm(st)&&!s&&(sr(XMLHttpRequest,"open",{req:function(ae,be,Ie,Ce){var Be=ae.inst,Ye=Be[nn];!Tr(Be,Ie)&&hr(Be,!0)&&((!Ye||!Ye.xhrMonitoringState.openDone)&&gr(Be,be,Ie,Ce),$t(Be))},hkErr:Mo(st,we.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")}),sr(XMLHttpRequest,"send",{req:function(ae,be){var Ie=ae.inst,Ce=Ie[nn];hr(Ie)&&!Ce.xhrMonitoringState.sendDone&&(It("xhr",Ce),Ce.requestSentTime=Ma(),st.includeCorrelationHeaders(Ce,void 0,void 0,Ie),Ce.xhrMonitoringState.sendDone=!0)},hkErr:Mo(st,we.FailedMonitorAjaxSend,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")}),sr(XMLHttpRequest,"abort",{req:function(ae){var be=ae.inst,Ie=be[nn];hr(be)&&!Ie.xhrMonitoringState.abortDone&&(Ie.aborted=1,Ie.xhrMonitoringState.abortDone=!0)},hkErr:Mo(st,we.FailedMonitorAjaxAbort,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")}),p&&sr(XMLHttpRequest,"setRequestHeader",{req:function(ae,be,Ie){var Ce=ae.inst;hr(Ce)&&Xt(be)&&(Ce[nn].requestHeaders[be]=Ie)},hkErr:Mo(st,we.FailedMonitorAjaxSetRequestHeader,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")}),s=!0)}function Tr(ae,be,Ie){var Ce=!1,Be=((et(be)?be:(be||{}).url||"")||"").toLowerCase();if(tt(lt,function(ot){var mt=ot;et(ot)&&(mt=new RegExp(ot)),Ce||(Ce=mt.test(Be))}),Ce)return Ce;var Ye=Fa(Be,"?"),Fe=Fa(Be,"#");return(Ye===-1||Fe!==-1&&Fe<Ye)&&(Ye=Fe),Ye!==-1&&(Be=Be.substring(0,Ye)),De(ae)?De(be)||(Ce=(typeof be=="object"?be[Mn]===!0:!1)||(Ie?Ie[Mn]===!0:!1)):Ce=ae[Mn]===!0||Be[Mn]===!0,!Ce&&Be&&Gi(Be)&&(Ce=!0),Ce?Ge[Be]||(Ge[Be]=1):Ge[Be]&&(Ce=!0),Ce}function hr(ae,be){var Ie=!0,Ce=s;return De(ae)||(Ie=be===!0||!De(ae[nn])),Ce&&Ie}function gr(ae,be,Ie,Ce){var Be=ee&&ee.telemetryTrace&&ee.telemetryTrace.traceID||zr(),Ye=zr().substr(0,16),Fe=new vc(Be,Ye,st[Po]());Fe.method=be,Fe.requestUrl=Ie,Fe.xhrMonitoringState.openDone=!0,Fe.requestHeaders={},Fe.async=Ce,Fe.errorStatusText=B,ae[nn]=Fe}function $t(ae){ae[nn].xhrMonitoringState.stateChangeAttached=Tn(ae,"readystatechange",function(){try{ae&&ae.readyState===4&&hr(ae)&&kt(ae)}catch(Ie){var be=it(Ie);(!be||Fa(be.toLowerCase(),"c00c023f")===-1)&&No(st,we.FailedMonitorAjaxRSC,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:Gs(ae),exception:be})}})}function St(ae){try{var be=ae.responseType;if(be===""||be==="text")return ae.responseText}catch{}return null}function kt(ae){var be=ae[nn];be.responseFinishedTime=Ma(),be.status=ae.status;function Ie(Ce,Be){var Ye=Be||{};Ye.ajaxDiagnosticsMessage=Gs(ae),Ce&&(Ye.exception=it(Ce)),La(st,we.FailedMonitorAjaxDur,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",Ye)}Qe("xmlhttprequest",be,function(){try{var Ce=be.CreateTrackItem("Ajax",p,function(){var Ye={statusText:ae.statusText,headerMap:null,correlationContext:Nt(ae),type:ae.responseType,responseText:St(ae),response:ae.response};if(se){var Fe=ae.getAllResponseHeaders();if(Fe){var ot=Jt(Fe).split(/[\r\n]+/),mt={};tt(ot,function(Ee){var br=Ee.split(": "),Ar=br.shift(),yr=br.join(": ");Xt(Ar)&&(mt[Ar]=yr)}),Ye.headerMap=mt}}return Ye}),Be=void 0;try{ft&&(Be=ft({status:ae.status,xhr:ae}))}catch{La(st,we.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}Ce?(Be!==void 0&&(Ce.properties=Qt(Qt({},Ce.properties),Be)),st[n](Ce)):Ie(null,{requestSentTime:be.requestSentTime,responseFinishedTime:be.responseFinishedTime})}finally{try{ae[nn]=null}catch{}}},function(Ce){Ie(Ce,null)})}function Nt(ae){try{var be=ae.getAllResponseHeaders();if(be!==null){var Ie=Fa(be.toLowerCase(),Ct.requestContextHeaderLowerCase);if(Ie!==-1){var Ce=ae.getResponseHeader(Ct.requestContextHeader);return Jn.getCorrelationContext(Ce)}}}catch(Be){La(st,we.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:Gs(ae),exception:it(Be)})}}function It(ae,be){if(be.requestUrl&&ce&&P){var Ie=Zr();if(Ie&&at(Ie.mark)){Af++;var Ce=ce+ae+"#"+Af;Ie.mark(Ce);var Be=Ie.getEntriesByName(Ce);Be&&Be.length===1&&(be.perfMark=Be[0])}}}function Qe(ae,be,Ie,Ce){var Be=be.perfMark,Ye=Zr(),Fe=d.maxAjaxPerfLookupAttempts,ot=d.ajaxPerfLookupDelay,mt=be.requestUrl,Ee=0;(function br(){try{if(Ye&&Be){Ee++;for(var Ar=null,yr=Ye.getEntries(),ea=yr.length-1;ea>=0;ea--){var pn=yr[ea];if(pn){if(pn.entryType==="resource")pn.initiatorType===ae&&(Fa(pn.name,mt)!==-1||Fa(mt,pn.name)!==-1)&&(Ar=pn);else if(pn.entryType==="mark"&&pn.name===Be.name){be.perfTiming=Ar;break}if(pn.startTime<Be.startTime-1e3)break}}}!Be||be.perfTiming||Ee>=Fe||be.async===!1?(Be&&at(Ye.clearMarks)&&Ye.clearMarks(Be.name),be.perfAttempts=Ee,Ie()):setTimeout(br,ot)}catch(a0){Ce(a0)}})()}function T(ae,be){var Ie=ee&&ee.telemetryTrace&&ee.telemetryTrace.traceID||zr(),Ce=zr().substr(0,16),Be=new vc(Ie,Ce,st[Po]());Be.requestSentTime=Ma(),Be.errorStatusText=B,ae instanceof Request?Be.requestUrl=ae?ae.url:"":Be.requestUrl=ae;var Ye="GET";be&&be.method?Ye=be.method:ae&&ae instanceof Request&&(Ye=ae.method),Be.method=Ye;var Fe={};if(p){var ot=new Headers((be?be.headers:0)||(ae instanceof Request?ae.headers||{}:{}));ot.forEach(function(mt,Ee){Xt(Ee)&&(Fe[Ee]=mt)})}return Be.requestHeaders=Fe,It("fetch",Be),Be}function le(ae){var be="";try{De(ae)||(typeof ae=="string"?be+="(url: '".concat(ae,"')"):be+="(url: '".concat(ae.url,"')"))}catch(Ie){No(st,we.FailedMonitorAjaxOpen,"Failed to grab failed fetch diagnostics message",{exception:it(Ie)})}return be}function Le(ae,be,Ie,Ce,Be,Ye,Fe){if(!Be)return;function ot(mt,Ee,br){var Ar=br||{};Ar.fetchDiagnosticsMessage=le(Ie),Ee&&(Ar.exception=it(Ee)),La(st,mt,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",Ar)}Be.responseFinishedTime=Ma(),Be.status=be,Qe("fetch",Be,function(){var mt=Be.CreateTrackItem("Fetch",p,Ye),Ee;try{ft&&(Ee=ft({status:be,request:Ie,response:Ce}))}catch{La(st,we.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}mt?(Ee!==void 0&&(mt.properties=Qt(Qt({},mt.properties),Ee)),st[n](mt)):ot(we.FailedMonitorAjaxDur,null,{requestSentTime:Be.requestSentTime,responseFinishedTime:Be.responseFinishedTime})},function(mt){ot(we.FailedMonitorAjaxGetCorrelationHeader,mt,null)})}function $e(ae){if(ae&&ae.headers)try{var be=ae.headers.get(Ct.requestContextHeader);return Jn.getCorrelationContext(be)}catch(Ie){La(st,we.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:le(ae),exception:it(Ie)})}}}),r}return e.getDefaultConfig=function(){var r={maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,excludeRequestFromAutoTrackingPatterns:void 0,disableCorrelationHeaders:!1,distributedTracingMode:dn.AI_AND_W3C,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:void 0,correlationHeaderExcludePatterns:void 0,appId:void 0,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1,enableAjaxErrorStatusText:!1,enableAjaxPerfTracking:!1,maxAjaxPerfLookupAttempts:3,ajaxPerfLookupDelay:25,ignoreHeaders:["Authorization","X-API-Key","WWW-Authenticate"],addRequestContext:void 0};return r},e.getEmptyConfig=function(){var r=this.getDefaultConfig();return Tt(r,function(n){r[n]=void 0}),r},e.prototype.processTelemetry=function(r,n){this.processNext(r,n)},e.identifier="AjaxDependencyPlugin",e}(In);var hc,Cf=["snippet","dependencies","properties","_snippetVersion","appInsightsNew","getSKUDefaults"];var _c=function(){function t(e){var r=this;r._snippetVersion=""+(e.sv||e.version||""),e.queue=e.queue||[],e.version=e.version||2;var n=e.config||{};if(n.connectionString){var i=Yl(n.connectionString),a=i.ingestionendpoint;n.endpointUrl=a?"".concat(a,"/v2/track"):n.endpointUrl,n.instrumentationKey=i.instrumentationkey||n.instrumentationKey}r.appInsights=new oc,r.properties=new dc,r.dependencies=new pc,r.core=new Cl,r._sender=new uc,r.snippet=e,r.config=n,r.getSKUDefaults()}return t.prototype.getCookieMgr=function(){return this.appInsights.getCookieMgr()},t.prototype.trackEvent=function(e,r){this.appInsights.trackEvent(e,r)},t.prototype.trackPageView=function(e){var r=e||{};this.appInsights.trackPageView(r)},t.prototype.trackPageViewPerformance=function(e){var r=e||{};this.appInsights.trackPageViewPerformance(r)},t.prototype.trackException=function(e,r){e&&!e.exception&&e.error&&(e.exception=e.error),this.appInsights.trackException(e,r)},t.prototype._onerror=function(e){this.appInsights._onerror(e)},t.prototype.trackTrace=function(e,r){this.appInsights.trackTrace(e,r)},t.prototype.trackMetric=function(e,r){this.appInsights.trackMetric(e,r)},t.prototype.startTrackPage=function(e){this.appInsights.startTrackPage(e)},t.prototype.stopTrackPage=function(e,r,n,i){this.appInsights.stopTrackPage(e,r,n,i)},t.prototype.startTrackEvent=function(e){this.appInsights.startTrackEvent(e)},t.prototype.stopTrackEvent=function(e,r,n){this.appInsights.stopTrackEvent(e,r,n)},t.prototype.addTelemetryInitializer=function(e){return this.appInsights.addTelemetryInitializer(e)},t.prototype.setAuthenticatedUserContext=function(e,r,n){n===void 0&&(n=!1),this.properties.context.user.setAuthenticatedUserContext(e,r,n)},t.prototype.clearAuthenticatedUserContext=function(){this.properties.context.user.clearAuthenticatedUserContext()},t.prototype.trackDependencyData=function(e){this.dependencies.trackDependencyData(e)},t.prototype.flush=function(e){var r=this;e===void 0&&(e=!0),Vn(this.core,function(){return"AISKU.flush"},function(){tt(r.core.getTransmissionControls(),function(n){tt(n,function(i){i.flush(e)})})},null,e)},t.prototype.onunloadFlush=function(e){e===void 0&&(e=!0),tt(this.core.getTransmissionControls(),function(r){tt(r,function(n){n.onunloadFlush?n.onunloadFlush():n.flush(e)})})},t.prototype.loadAppInsights=function(e,r,n){var i=this;e===void 0&&(e=!1);var a=this;function s(v){if(v){var d="";De(a._snippetVersion)||(d+=a._snippetVersion),e&&(d+=".lg"),a.context&&a.context.internal&&(a.context.internal.snippetVer=d||"-"),Tt(a,function(p,B){et(p)&&!at(B)&&p&&p[0]!=="_"&&Cf.indexOf(p)===-1&&(v[p]=B)})}}return e&&a.config.extensions&&a.config.extensions.length>0&&wr("Extensions not allowed in legacy mode"),Vn(a.core,function(){return"AISKU.loadAppInsights"},function(){var v=[];v.push(a._sender),v.push(a.properties),v.push(a.dependencies),v.push(a.appInsights),a.core.initialize(a.config,v,r,n),a.context=a.properties.context,hc&&a.context&&(a.context.internal.sdkSrc=hc),s(a.snippet),a.emptyQueue(),a.pollInternalLogs(),a.addHousekeepingBeforeUnload(i)}),a},t.prototype.updateSnippetDefinitions=function(e){tl(e,this,function(r){return r&&Cf.indexOf(r)===-1})},t.prototype.emptyQueue=function(){var e=this;try{if(ur(e.snippet.queue)){for(var r=e.snippet.queue.length,n=0;n<r;n++){var i=e.snippet.queue[n];i()}e.snippet.queue=void 0,delete e.snippet.queue}}catch(s){var a={};s&&at(s.toString)&&(a.exception=s.toString())}},t.prototype.pollInternalLogs=function(){this.core.pollInternalLogs()},t.prototype.stopPollingInternalLogs=function(){this.core.stopPollingInternalLogs()},t.prototype.addHousekeepingBeforeUnload=function(e){if(Di()||gs()){var r=function(){e.onunloadFlush(!1),tt(e.appInsights.core._extensions,function(a){if(a.identifier===_i)return a&&a.context&&a.context._sessionManager&&a.context._sessionManager.backup(),-1})},n=!1,i=e.appInsights.config.disablePageUnloadEvents;e.appInsights.config.disableFlushOnBeforeUnload||(n=Pl(r,i),n=bo(r,i)||n,!n&&!vl()&&e.appInsights.core.logger.throwInternal(Pe.CRITICAL,we.FailedToAddHandlerForOnBeforeUnload,"Could not add handler for beforeunload and pagehide")),!n&&!e.appInsights.config.disableFlushOnUnload&&bo(r,i)}},t.prototype.getSender=function(){return this._sender},t.prototype.getSKUDefaults=function(){var e=this;e.config.diagnosticLogInterval=e.config.diagnosticLogInterval&&e.config.diagnosticLogInterval>0?e.config.diagnosticLogInterval:1e4},t}();(function(){var t=null,e=!1,r=["://js.monitor.azure.com/","://az416426.vo.msecnd.net/"];try{var n=(document||{}).currentScript;n&&(t=n.src)}catch{}if(t)try{var i=t.toLowerCase();if(i){for(var a="",s=0;s<r.length;s++)if(i.indexOf(r[s])!==-1){a="cdn"+(s+1),i.indexOf("/scripts/")===-1&&(i.indexOf("/next/")!==-1?a+="-next":i.indexOf("/beta/")!==-1&&(a+="-beta")),hc=a+(e?".mod":"");break}}}catch{}})();var Ua,Mf=t=>(Ua=new _c({config:{instrumentationKey:t}}),Ua.loadAppInsights(),Ua),Zi={START:"start",FINISH:"finish",ERROR:"error",UPLOAD_VIDEO:"upload_video"},Nm=t=>Ua.trackException({exception:t}),Qi=(t,e)=>Ua.trackEvent({name:t,properties:e}),Dm=(t,e,r)=>Ua.trackPageView({name:t,uri:e,properties:r}),Yt={trackPage:Dm,trackError:Nm,registerStart:(t,e,r)=>Qi(Zi.START,{proctoringId:t,success:e,description:r}),registerFinish:(t,e,r)=>Qi(Zi.FINISH,{proctoringId:t,success:e,description:r}),registerError:(t,e)=>Qi(Zi.ERROR,{proctoringId:t,description:e}),registerUpload:(t,e,r,n,i)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,success:e,description:r,serviceType:n,uploadTime:i}),registerUploadFile:(t,e,r)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,description:e,fileType:r}),registerChangeDevice:(t,e,r)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,inOrOut:e,devicesChanged:r}),registerStopSharingScreen:(t,e)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,description:e})};var Ji=class{constructor(e,r){this.backend=r;this.proctoringId=e}async upload(e,r){let{file:n,onProgress:i}=e;try{let a=d=>{let p=d.loadedBytes/n.size*100;i&&i(Math.round(p))},s=await this.backend.getAzureSignedUrl(r,n,this.proctoringId),v=await ua.request({url:s,method:"PUT",headers:{"x-ms-blob-type":"BlockBlob"},data:n,onUploadProgress:d=>{a({loadedBytes:d.loaded})}}).then(()=>!0).catch(()=>!1);return{storage:"AzureBlob",url:s,uploaded:v}}catch{throw Yt.registerError(this.proctoringId,`Failed to upload to Azure
13
+ `,8*h.main_data_begin,m.ResvSize,h.resvDrain_post,h.resvDrain_pre,8*m.sideinfo_len,u-h.resvDrain_post-8*m.sideinfo_len,u,u%8,S),Vn.err.println("This is a fatal error. It has several possible causes:"),Vn.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),Vn.err.println(" 9%% Your system is overclocked"),Vn.err.println(" 1%% bug in LAME encoding library"),m.ResvSize=h.main_data_begin*8),_t(Ue%8==0),Ue>1e9){var p;for(p=0;p<jt.MAX_HEADER_BUF;++p)m.header[p].write_timing-=Ue;Ue=0}return 0},this.copy_buffer=function(R,m,h,S,u){var p=$+1;if(p<=0)return 0;if(S!=0&&p>S)return-1;if(Vn.arraycopy(Fe,0,m,h,p),$=-1,he=0,u!=0){var y=Xf(1);if(y[0]=R.nMusicCRC,_e.updateMusicCRC(y,m,h,p),R.nMusicCRC=y[0],p>0&&(R.VBR_seek_table.nBytesWritten+=p),R.decode_on_the_fly){for(var T=Gf([2,1152]),Q=p,j=-1,Y;j!=0;)if(j=Ae.hip_decode1_unclipped(R.hip,m,h,Q,T[0],T[1]),Q=0,j==-1&&(j=0),j>0){if(_t(j<=1152),R.findPeakSample){for(Y=0;Y<j;Y++)T[0][Y]>R.PeakSample?R.PeakSample=T[0][Y]:-T[0][Y]>R.PeakSample&&(R.PeakSample=-T[0][Y]);if(R.channels_out>1)for(Y=0;Y<j;Y++)T[1][Y]>R.PeakSample?R.PeakSample=T[1][Y]:-T[1][Y]>R.PeakSample&&(R.PeakSample=-T[1][Y])}if(R.findReplayGain&&ie.AnalyzeSamples(R.rgdata,T[0],0,T[1],0,j,R.channels_out)==ao.GAIN_ANALYSIS_ERROR)return-6}}}return p},this.init_bit_stream_w=function(R){Fe=jf(Nt.LAME_MAXMP3BUFFER),R.h_ptr=R.w_ptr=0,R.header[R.h_ptr].write_timing=0,$=-1,he=0,Ue=0}}var fi=ns,Wf=E.System,Gt=E.VbrMode,k0=E.ShortBlock,Ui=E.new_float,au=E.new_int_n,Kf=E.new_short_n,Zr=E.assert;function mr(){var B=this,ne=128*1024;mr.V9=410,mr.V8=420,mr.V7=430,mr.V6=440,mr.V5=450,mr.V4=460,mr.V3=470,mr.V2=480,mr.V1=490,mr.V0=500,mr.R3MIX=1e3,mr.STANDARD=1001,mr.EXTREME=1002,mr.INSANE=1003,mr.STANDARD_FAST=1004,mr.EXTREME_FAST=1005,mr.MEDIUM=1006,mr.MEDIUM_FAST=1007;var fe=16384+ne;mr.LAME_MAXMP3BUFFER=fe;var ie,Ae,ae,_e,Fe,Ue=new zt,$,he,be,D;this.enc=new A,this.setModules=function(v,g,ve,ye,He,ze,Ke,We,lt){ie=v,Ae=g,ae=ve,_e=ye,Fe=He,$=ze,he=Ke,be=We,D=lt,this.enc.setModules(Ae,Ue,_e,$)};function ee(){this.mask_adjust=0,this.mask_adjust_short=0,this.bo_l_weight=Ui(A.SBMAX_l),this.bo_s_weight=Ui(A.SBMAX_s)}function s(){this.lowerlimit=0}function P(v,g){this.lowpass=g}var G=4294479419;function F(v){var g;return v.class_id=G,g=v.internal_flags=new jt,v.mode=vr.NOT_SET,v.original=1,v.in_samplerate=44100,v.num_channels=2,v.num_samples=-1,v.bWriteVbrTag=!0,v.quality=-1,v.short_blocks=null,g.subblock_gain=-1,v.lowpassfreq=0,v.highpassfreq=0,v.lowpasswidth=-1,v.highpasswidth=-1,v.VBR=Gt.vbr_off,v.VBR_q=4,v.ATHcurve=-1,v.VBR_mean_bitrate_kbps=128,v.VBR_min_bitrate_kbps=0,v.VBR_max_bitrate_kbps=0,v.VBR_hard_min=0,g.VBR_min_bitrate=1,g.VBR_max_bitrate=13,v.quant_comp=-1,v.quant_comp_short=-1,v.msfix=-1,g.resample_ratio=1,g.OldValue[0]=180,g.OldValue[1]=180,g.CurrentStep[0]=4,g.CurrentStep[1]=4,g.masking_lower=1,g.nsPsy.attackthre=-1,g.nsPsy.attackthre_s=-1,v.scale=-1,v.athaa_type=-1,v.ATHtype=-1,v.athaa_loudapprox=-1,v.athaa_sensitivity=0,v.useTemporal=null,v.interChRatio=-1,g.mf_samples_to_encode=A.ENCDELAY+A.POSTDELAY,v.encoder_padding=0,g.mf_size=A.ENCDELAY-A.MDCTDELAY,v.findReplayGain=!1,v.decode_on_the_fly=!1,g.decode_on_the_fly=!1,g.findReplayGain=!1,g.findPeakSample=!1,g.RadioGain=0,g.AudiophileGain=0,g.noclipGainChange=0,g.noclipScale=-1,v.preset=0,v.write_id3tag_automatic=!0,0}this.lame_init=function(){var v=new yn,g=F(v);return g!=0?null:(v.lame_allocated_gfp=1,v)};function b(v){return v>1?0:v<=0?1:Math.cos(Math.PI/2*v)}this.nearestBitrateFullIndex=function(v){var g=[8,16,24,32,40,48,56,64,80,96,112,128,160,192,224,256,320],ve=0,ye=0,He=0,ze=0;ze=g[16],He=16,ye=g[16],ve=16;for(var Ke=0;Ke<16;Ke++)if(Math.max(v,g[Ke+1])!=v){ze=g[Ke+1],He=Ke+1,ye=g[Ke],ve=Ke;break}return ze-v>v-ye?ve:He};function _(v,g){var ve=44100;return g>=48e3?ve=48e3:g>=44100?ve=44100:g>=32e3?ve=32e3:g>=24e3?ve=24e3:g>=22050?ve=22050:g>=16e3?ve=16e3:g>=12e3?ve=12e3:g>=11025?ve=11025:g>=8e3&&(ve=8e3),v==-1?ve:(v<=15960&&(ve=44100),v<=15250&&(ve=32e3),v<=11220&&(ve=24e3),v<=9970&&(ve=22050),v<=7230&&(ve=16e3),v<=5420&&(ve=12e3),v<=4510&&(ve=11025),v<=3970&&(ve=8e3),g<ve?g>44100?48e3:g>32e3?44100:g>24e3?32e3:g>22050?24e3:g>16e3?22050:g>12e3?16e3:g>11025?12e3:g>8e3?11025:8e3:ve)}function N(v,g){switch(v){case 44100:return g.version=1,0;case 48e3:return g.version=1,1;case 32e3:return g.version=1,2;case 22050:return g.version=0,0;case 24e3:return g.version=0,1;case 16e3:return g.version=0,2;case 11025:return g.version=0,0;case 12e3:return g.version=0,1;case 8e3:return g.version=0,2;default:return g.version=0,-1}}function W(v,g,ve){ve<16e3&&(g=2);for(var ye=It.bitrate_table[g][1],He=2;He<=14;He++)It.bitrate_table[g][He]>0&&Math.abs(It.bitrate_table[g][He]-v)<Math.abs(ye-v)&&(ye=It.bitrate_table[g][He]);return ye}function C(v,g,ve){ve<16e3&&(g=2);for(var ye=0;ye<=14;ye++)if(It.bitrate_table[g][ye]>0&&It.bitrate_table[g][ye]==v)return ye;return-1}function f(v,g){var ve=[new P(8,2e3),new P(16,3700),new P(24,3900),new P(32,5500),new P(40,7e3),new P(48,7500),new P(56,1e4),new P(64,11e3),new P(80,13500),new P(96,15100),new P(112,15600),new P(128,17e3),new P(160,17500),new P(192,18600),new P(224,19400),new P(256,19700),new P(320,20500)],ye=B.nearestBitrateFullIndex(g);v.lowerlimit=ve[ye].lowpass}function O(v){var g=v.internal_flags,ve=32,ye=-1;if(g.lowpass1>0){for(var He=999,ze=0;ze<=31;ze++){var Ke=ze/31;Ke>=g.lowpass2&&(ve=Math.min(ve,ze)),g.lowpass1<Ke&&Ke<g.lowpass2&&(He=Math.min(He,ze))}He==999?g.lowpass1=(ve-.75)/31:g.lowpass1=(He-.75)/31,g.lowpass2=ve/31}if(g.highpass2>0&&g.highpass2<.9*(.75/31)&&(g.highpass1=0,g.highpass2=0,Wf.err.println(`Warning: highpass filter disabled. highpass frequency too small
14
+ `)),g.highpass2>0){for(var We=-1,ze=0;ze<=31;ze++){var Ke=ze/31;Ke<=g.highpass1&&(ye=Math.max(ye,ze)),g.highpass1<Ke&&Ke<g.highpass2&&(We=Math.max(We,ze))}g.highpass1=ye/31,We==-1?g.highpass2=(ye+.75)/31:g.highpass2=(We+.75)/31}for(var ze=0;ze<32;ze++){var lt,Ze,Ke=ze/31;g.highpass2>g.highpass1?lt=b((g.highpass2-Ke)/(g.highpass2-g.highpass1+1e-20)):lt=1,g.lowpass2>g.lowpass1?Ze=b((Ke-g.lowpass1)/(g.lowpass2-g.lowpass1+1e-20)):Ze=1,g.amp_filter[ze]=lt*Ze}}function R(v){var g=v.internal_flags;switch(v.quality){default:case 9:g.psymodel=0,g.noise_shaping=0,g.noise_shaping_amp=0,g.noise_shaping_stop=0,g.use_best_huffman=0,g.full_outer_loop=0;break;case 8:v.quality=7;case 7:g.psymodel=1,g.noise_shaping=0,g.noise_shaping_amp=0,g.noise_shaping_stop=0,g.use_best_huffman=0,g.full_outer_loop=0;break;case 6:g.psymodel=1,g.noise_shaping==0&&(g.noise_shaping=1),g.noise_shaping_amp=0,g.noise_shaping_stop=0,g.subblock_gain==-1&&(g.subblock_gain=1),g.use_best_huffman=0,g.full_outer_loop=0;break;case 5:g.psymodel=1,g.noise_shaping==0&&(g.noise_shaping=1),g.noise_shaping_amp=0,g.noise_shaping_stop=0,g.subblock_gain==-1&&(g.subblock_gain=1),g.use_best_huffman=0,g.full_outer_loop=0;break;case 4:g.psymodel=1,g.noise_shaping==0&&(g.noise_shaping=1),g.noise_shaping_amp=0,g.noise_shaping_stop=0,g.subblock_gain==-1&&(g.subblock_gain=1),g.use_best_huffman=1,g.full_outer_loop=0;break;case 3:g.psymodel=1,g.noise_shaping==0&&(g.noise_shaping=1),g.noise_shaping_amp=1,g.noise_shaping_stop=1,g.subblock_gain==-1&&(g.subblock_gain=1),g.use_best_huffman=1,g.full_outer_loop=0;break;case 2:g.psymodel=1,g.noise_shaping==0&&(g.noise_shaping=1),g.substep_shaping==0&&(g.substep_shaping=2),g.noise_shaping_amp=1,g.noise_shaping_stop=1,g.subblock_gain==-1&&(g.subblock_gain=1),g.use_best_huffman=1,g.full_outer_loop=0;break;case 1:g.psymodel=1,g.noise_shaping==0&&(g.noise_shaping=1),g.substep_shaping==0&&(g.substep_shaping=2),g.noise_shaping_amp=2,g.noise_shaping_stop=1,g.subblock_gain==-1&&(g.subblock_gain=1),g.use_best_huffman=1,g.full_outer_loop=0;break;case 0:g.psymodel=1,g.noise_shaping==0&&(g.noise_shaping=1),g.substep_shaping==0&&(g.substep_shaping=2),g.noise_shaping_amp=2,g.noise_shaping_stop=1,g.subblock_gain==-1&&(g.subblock_gain=1),g.use_best_huffman=1,g.full_outer_loop=0;break}}function m(v){var g=v.internal_flags;v.frameNum=0,v.write_id3tag_automatic&&be.id3tag_write_v2(v),g.bitrate_stereoMode_Hist=au([16,4+1]),g.bitrate_blockType_Hist=au([16,4+1+1]),g.PeakSample=0,v.bWriteVbrTag&&$.InitVbrTag(v)}this.lame_init_params=function(v){var g=v.internal_flags;if(g.Class_ID=0,g.ATH==null&&(g.ATH=new kf),g.PSY==null&&(g.PSY=new ee),g.rgdata==null&&(g.rgdata=new Lf),g.channels_in=v.num_channels,g.channels_in==1&&(v.mode=vr.MONO),g.channels_out=v.mode==vr.MONO?1:2,g.mode_ext=A.MPG_MD_MS_LR,v.mode==vr.MONO&&(v.force_ms=!1),v.VBR==Gt.vbr_off&&v.VBR_mean_bitrate_kbps!=128&&v.brate==0&&(v.brate=v.VBR_mean_bitrate_kbps),v.VBR==Gt.vbr_off||v.VBR==Gt.vbr_mtrh||v.VBR==Gt.vbr_mt||(v.free_format=!1),v.VBR==Gt.vbr_off&&v.brate==0&&fi.EQ(v.compression_ratio,0)&&(v.compression_ratio=11.025),v.VBR==Gt.vbr_off&&v.compression_ratio>0&&(v.out_samplerate==0&&(v.out_samplerate=map2MP3Frequency(int(.97*v.in_samplerate))),v.brate=0|v.out_samplerate*16*g.channels_out/(1e3*v.compression_ratio),g.samplerate_index=N(v.out_samplerate,v),v.free_format||(v.brate=W(v.brate,v.version,v.out_samplerate))),v.out_samplerate!=0&&(v.out_samplerate<16e3?(v.VBR_mean_bitrate_kbps=Math.max(v.VBR_mean_bitrate_kbps,8),v.VBR_mean_bitrate_kbps=Math.min(v.VBR_mean_bitrate_kbps,64)):v.out_samplerate<32e3?(v.VBR_mean_bitrate_kbps=Math.max(v.VBR_mean_bitrate_kbps,8),v.VBR_mean_bitrate_kbps=Math.min(v.VBR_mean_bitrate_kbps,160)):(v.VBR_mean_bitrate_kbps=Math.max(v.VBR_mean_bitrate_kbps,32),v.VBR_mean_bitrate_kbps=Math.min(v.VBR_mean_bitrate_kbps,320))),v.lowpassfreq==0){var ve=16e3;switch(v.VBR){case Gt.vbr_off:{var ye=new s;f(ye,v.brate),ve=ye.lowerlimit;break}case Gt.vbr_abr:{var ye=new s;f(ye,v.VBR_mean_bitrate_kbps),ve=ye.lowerlimit;break}case Gt.vbr_rh:{var He=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=v.VBR_q&&v.VBR_q<=9){var ze=He[v.VBR_q],Ke=He[v.VBR_q+1],We=v.VBR_q_frac;ve=linear_int(ze,Ke,We)}else ve=19500;break}default:{var He=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=v.VBR_q&&v.VBR_q<=9){var ze=He[v.VBR_q],Ke=He[v.VBR_q+1],We=v.VBR_q_frac;ve=linear_int(ze,Ke,We)}else ve=19500}}v.mode==vr.MONO&&(v.VBR==Gt.vbr_off||v.VBR==Gt.vbr_abr)&&(ve*=1.5),v.lowpassfreq=ve|0}if(v.out_samplerate==0&&(2*v.lowpassfreq>v.in_samplerate&&(v.lowpassfreq=v.in_samplerate/2),v.out_samplerate=_(v.lowpassfreq|0,v.in_samplerate)),v.lowpassfreq=Math.min(20500,v.lowpassfreq),v.lowpassfreq=Math.min(v.out_samplerate/2,v.lowpassfreq),v.VBR==Gt.vbr_off&&(v.compression_ratio=v.out_samplerate*16*g.channels_out/(1e3*v.brate)),v.VBR==Gt.vbr_abr&&(v.compression_ratio=v.out_samplerate*16*g.channels_out/(1e3*v.VBR_mean_bitrate_kbps)),v.bWriteVbrTag||(v.findReplayGain=!1,v.decode_on_the_fly=!1,g.findPeakSample=!1),g.findReplayGain=v.findReplayGain,g.decode_on_the_fly=v.decode_on_the_fly,g.decode_on_the_fly&&(g.findPeakSample=!0),g.findReplayGain&&ie.InitGainAnalysis(g.rgdata,v.out_samplerate)==ao.INIT_GAIN_ANALYSIS_ERROR)return v.internal_flags=null,-6;switch(g.decode_on_the_fly&&!v.decode_only&&(g.hip!=null&&D.hip_decode_exit(g.hip),g.hip=D.hip_decode_init()),g.mode_gr=v.out_samplerate<=24e3?1:2,v.framesize=576*g.mode_gr,v.encoder_delay=A.ENCDELAY,g.resample_ratio=v.in_samplerate/v.out_samplerate,v.VBR){case Gt.vbr_mt:case Gt.vbr_rh:case Gt.vbr_mtrh:{var lt=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5];v.compression_ratio=lt[v.VBR_q]}break;case Gt.vbr_abr:v.compression_ratio=v.out_samplerate*16*g.channels_out/(1e3*v.VBR_mean_bitrate_kbps);break;default:v.compression_ratio=v.out_samplerate*16*g.channels_out/(1e3*v.brate);break}if(v.mode==vr.NOT_SET&&(v.mode=vr.JOINT_STEREO),v.highpassfreq>0?(g.highpass1=2*v.highpassfreq,v.highpasswidth>=0?g.highpass2=2*(v.highpassfreq+v.highpasswidth):g.highpass2=(1+0)*2*v.highpassfreq,g.highpass1/=v.out_samplerate,g.highpass2/=v.out_samplerate):(g.highpass1=0,g.highpass2=0),v.lowpassfreq>0?(g.lowpass2=2*v.lowpassfreq,v.lowpasswidth>=0?(g.lowpass1=2*(v.lowpassfreq-v.lowpasswidth),g.lowpass1<0&&(g.lowpass1=0)):g.lowpass1=(1-0)*2*v.lowpassfreq,g.lowpass1/=v.out_samplerate,g.lowpass2/=v.out_samplerate):(g.lowpass1=0,g.lowpass2=0),O(v),g.samplerate_index=N(v.out_samplerate,v),g.samplerate_index<0)return v.internal_flags=null,-1;if(v.VBR==Gt.vbr_off){if(v.free_format)g.bitrate_index=0;else if(v.brate=W(v.brate,v.version,v.out_samplerate),g.bitrate_index=C(v.brate,v.version,v.out_samplerate),g.bitrate_index<=0)return v.internal_flags=null,-1}else g.bitrate_index=1;v.analysis&&(v.bWriteVbrTag=!1),g.pinfo!=null&&(v.bWriteVbrTag=!1),Ae.init_bit_stream_w(g);for(var Ze=g.samplerate_index+3*v.version+6*(v.out_samplerate<16e3?1:0),Ge=0;Ge<A.SBMAX_l+1;Ge++)g.scalefac_band.l[Ge]=_e.sfBandIndex[Ze].l[Ge];for(var Ge=0;Ge<A.PSFB21+1;Ge++){var Mt=(g.scalefac_band.l[22]-g.scalefac_band.l[21])/A.PSFB21,Xt=g.scalefac_band.l[21]+Ge*Mt;g.scalefac_band.psfb21[Ge]=Xt}g.scalefac_band.psfb21[A.PSFB21]=576;for(var Ge=0;Ge<A.SBMAX_s+1;Ge++)g.scalefac_band.s[Ge]=_e.sfBandIndex[Ze].s[Ge];for(var Ge=0;Ge<A.PSFB12+1;Ge++){var Mt=(g.scalefac_band.s[13]-g.scalefac_band.s[12])/A.PSFB12,Xt=g.scalefac_band.s[12]+Ge*Mt;g.scalefac_band.psfb12[Ge]=Xt}g.scalefac_band.psfb12[A.PSFB12]=192,v.version==1?g.sideinfo_len=g.channels_out==1?4+17:4+32:g.sideinfo_len=g.channels_out==1?4+9:4+17,v.error_protection&&(g.sideinfo_len+=2),m(v),g.Class_ID=G;{var Dt;for(Dt=0;Dt<19;Dt++)g.nsPsy.pefirbuf[Dt]=700*g.mode_gr*g.channels_out;v.ATHtype==-1&&(v.ATHtype=4)}switch(Zr(v.VBR_q<=9),Zr(v.VBR_q>=0),v.VBR){case Gt.vbr_mt:v.VBR=Gt.vbr_mtrh;case Gt.vbr_mtrh:{v.useTemporal==null&&(v.useTemporal=!1),ae.apply_preset(v,500-v.VBR_q*10,0),v.quality<0&&(v.quality=LAME_DEFAULT_QUALITY),v.quality<5&&(v.quality=0),v.quality>5&&(v.quality=5),g.PSY.mask_adjust=v.maskingadjust,g.PSY.mask_adjust_short=v.maskingadjust_short,v.experimentalY?g.sfb21_extra=!1:g.sfb21_extra=v.out_samplerate>44e3,g.iteration_loop=new VBRNewIterationLoop(Fe);break}case Gt.vbr_rh:{ae.apply_preset(v,500-v.VBR_q*10,0),g.PSY.mask_adjust=v.maskingadjust,g.PSY.mask_adjust_short=v.maskingadjust_short,v.experimentalY?g.sfb21_extra=!1:g.sfb21_extra=v.out_samplerate>44e3,v.quality>6&&(v.quality=6),v.quality<0&&(v.quality=LAME_DEFAULT_QUALITY),g.iteration_loop=new VBROldIterationLoop(Fe);break}default:{var Wt;g.sfb21_extra=!1,v.quality<0&&(v.quality=LAME_DEFAULT_QUALITY),Wt=v.VBR,Wt==Gt.vbr_off&&(v.VBR_mean_bitrate_kbps=v.brate),ae.apply_preset(v,v.VBR_mean_bitrate_kbps,0),v.VBR=Wt,g.PSY.mask_adjust=v.maskingadjust,g.PSY.mask_adjust_short=v.maskingadjust_short,Wt==Gt.vbr_off?g.iteration_loop=new Uf(Fe):g.iteration_loop=new ABRIterationLoop(Fe);break}}if(Zr(v.scale>=0),v.VBR!=Gt.vbr_off){if(g.VBR_min_bitrate=1,g.VBR_max_bitrate=14,v.out_samplerate<16e3&&(g.VBR_max_bitrate=8),v.VBR_min_bitrate_kbps!=0&&(v.VBR_min_bitrate_kbps=W(v.VBR_min_bitrate_kbps,v.version,v.out_samplerate),g.VBR_min_bitrate=C(v.VBR_min_bitrate_kbps,v.version,v.out_samplerate),g.VBR_min_bitrate<0)||v.VBR_max_bitrate_kbps!=0&&(v.VBR_max_bitrate_kbps=W(v.VBR_max_bitrate_kbps,v.version,v.out_samplerate),g.VBR_max_bitrate=C(v.VBR_max_bitrate_kbps,v.version,v.out_samplerate),g.VBR_max_bitrate<0))return-1;v.VBR_min_bitrate_kbps=It.bitrate_table[v.version][g.VBR_min_bitrate],v.VBR_max_bitrate_kbps=It.bitrate_table[v.version][g.VBR_max_bitrate],v.VBR_mean_bitrate_kbps=Math.min(It.bitrate_table[v.version][g.VBR_max_bitrate],v.VBR_mean_bitrate_kbps),v.VBR_mean_bitrate_kbps=Math.max(It.bitrate_table[v.version][g.VBR_min_bitrate],v.VBR_mean_bitrate_kbps)}return v.tune&&(g.PSY.mask_adjust+=v.tune_value_a,g.PSY.mask_adjust_short+=v.tune_value_a),R(v),Zr(v.scale>=0),v.athaa_type<0?g.ATH.useAdjust=3:g.ATH.useAdjust=v.athaa_type,g.ATH.aaSensitivityP=Math.pow(10,v.athaa_sensitivity/-10),v.short_blocks==null&&(v.short_blocks=k0.short_block_allowed),v.short_blocks==k0.short_block_allowed&&(v.mode==vr.JOINT_STEREO||v.mode==vr.STEREO)&&(v.short_blocks=k0.short_block_coupled),v.quant_comp<0&&(v.quant_comp=1),v.quant_comp_short<0&&(v.quant_comp_short=0),v.msfix<0&&(v.msfix=0),v.exp_nspsytune=v.exp_nspsytune|1,v.internal_flags.nsPsy.attackthre<0&&(v.internal_flags.nsPsy.attackthre=zt.NSATTACKTHRE),v.internal_flags.nsPsy.attackthre_s<0&&(v.internal_flags.nsPsy.attackthre_s=zt.NSATTACKTHRE_S),Zr(v.scale>=0),v.scale<0&&(v.scale=1),v.ATHtype<0&&(v.ATHtype=4),v.ATHcurve<0&&(v.ATHcurve=4),v.athaa_loudapprox<0&&(v.athaa_loudapprox=2),v.interChRatio<0&&(v.interChRatio=0),v.useTemporal==null&&(v.useTemporal=!0),g.slot_lag=g.frac_SpF=0,v.VBR==Gt.vbr_off&&(g.slot_lag=g.frac_SpF=(v.version+1)*72e3*v.brate%v.out_samplerate|0),_e.iteration_init(v),Ue.psymodel_init(v),Zr(v.scale>=0),0};function h(v,g){(v.in_buffer_0==null||v.in_buffer_nsamples<g)&&(v.in_buffer_0=Ui(g),v.in_buffer_1=Ui(g),v.in_buffer_nsamples=g)}this.lame_encode_flush=function(v,g,ve,ye){var He=v.internal_flags,ze=Kf([2,1152]),Ke=0,We,lt,Ze,Ge,Mt=He.mf_samples_to_encode-A.POSTDELAY,Xt=S(v);if(He.mf_samples_to_encode<1)return 0;for(We=0,v.in_samplerate!=v.out_samplerate&&(Mt+=16*v.out_samplerate/v.in_samplerate),Ze=v.framesize-Mt%v.framesize,Ze<576&&(Ze+=v.framesize),v.encoder_padding=Ze,Ge=(Mt+Ze)/v.framesize;Ge>0&&Ke>=0;){var Dt=Xt-He.mf_size,Wt=v.frameNum;Dt*=v.in_samplerate,Dt/=v.out_samplerate,Dt>1152&&(Dt=1152),Dt<1&&(Dt=1),lt=ye-We,ye==0&&(lt=0),Ke=this.lame_encode_buffer(v,ze[0],ze[1],Dt,g,ve,lt),ve+=Ke,We+=Ke,Ge-=Wt!=v.frameNum?1:0}if(He.mf_samples_to_encode=0,Ke<0||(lt=ye-We,ye==0&&(lt=0),Ae.flush_bitstream(v),Ke=Ae.copy_buffer(He,g,ve,lt,1),Ke<0))return Ke;if(ve+=Ke,We+=Ke,lt=ye-We,ye==0&&(lt=0),v.write_id3tag_automatic){if(be.id3tag_write_v1(v),Ke=Ae.copy_buffer(He,g,ve,lt,0),Ke<0)return Ke;We+=Ke}return We},this.lame_encode_buffer=function(v,g,ve,ye,He,ze,Ke){var We=v.internal_flags,lt=[null,null];if(We.Class_ID!=G)return-3;if(ye==0)return 0;h(We,ye),lt[0]=We.in_buffer_0,lt[1]=We.in_buffer_1;for(var Ze=0;Ze<ye;Ze++)lt[0][Ze]=g[Ze],We.channels_in>1&&(lt[1][Ze]=ve[Ze]);return u(v,lt[0],lt[1],ye,He,ze,Ke)};function S(v){var g=A.BLKSIZE+v.framesize-A.FFTOFFSET;return g=Math.max(g,512+v.framesize-32),Zr(jt.MFSIZE>=g),g}function u(v,g,ve,ye,He,ze,Ke){var We=v.internal_flags,lt=0,Ze,Ge,Mt,Xt,Dt,Wt=[null,null],rr=[null,null];if(We.Class_ID!=G)return-3;if(ye==0)return 0;if(Dt=Ae.copy_buffer(We,He,ze,Ke,0),Dt<0)return Dt;if(ze+=Dt,lt+=Dt,rr[0]=g,rr[1]=ve,fi.NEQ(v.scale,0)&&fi.NEQ(v.scale,1))for(Ge=0;Ge<ye;++Ge)rr[0][Ge]*=v.scale,We.channels_out==2&&(rr[1][Ge]*=v.scale);if(fi.NEQ(v.scale_left,0)&&fi.NEQ(v.scale_left,1))for(Ge=0;Ge<ye;++Ge)rr[0][Ge]*=v.scale_left;if(fi.NEQ(v.scale_right,0)&&fi.NEQ(v.scale_right,1))for(Ge=0;Ge<ye;++Ge)rr[1][Ge]*=v.scale_right;if(v.num_channels==2&&We.channels_out==1)for(Ge=0;Ge<ye;++Ge)rr[0][Ge]=.5*(rr[0][Ge]+rr[1][Ge]),rr[1][Ge]=0;Xt=S(v),Wt[0]=We.mfbuf[0],Wt[1]=We.mfbuf[1];for(var ar=0;ye>0;){var Ar=[null,null],jn=0,zr=0;Ar[0]=rr[0],Ar[1]=rr[1];var jr=new y;if(we(v,Wt,Ar,ar,ye,jr),jn=jr.n_in,zr=jr.n_out,We.findReplayGain&&!We.decode_on_the_fly&&ie.AnalyzeSamples(We.rgdata,Wt[0],We.mf_size,Wt[1],We.mf_size,zr,We.channels_out)==ao.GAIN_ANALYSIS_ERROR)return-6;if(ye-=jn,ar+=jn,We.channels_out==2,We.mf_size+=zr,Zr(We.mf_size<=jt.MFSIZE),We.mf_samples_to_encode<1&&(We.mf_samples_to_encode=A.ENCDELAY+A.POSTDELAY),We.mf_samples_to_encode+=zr,We.mf_size>=Xt){var wn=Ke-lt;if(Ke==0&&(wn=0),Ze=p(v,Wt[0],Wt[1],He,ze,wn),Ze<0)return Ze;for(ze+=Ze,lt+=Ze,We.mf_size-=v.framesize,We.mf_samples_to_encode-=v.framesize,Mt=0;Mt<We.channels_out;Mt++)for(Ge=0;Ge<We.mf_size;Ge++)Wt[Mt][Ge]=Wt[Mt][Ge+v.framesize]}}return Zr(ye==0),lt}function p(v,g,ve,ye,He,ze){var Ke=B.enc.lame_encode_mp3_frame(v,g,ve,ye,He,ze);return v.frameNum++,Ke}function y(){this.n_in=0,this.n_out=0}function T(){this.num_used=0}function Q(v,g){return g!=0?Q(g,v%g):v}function j(v,g,ve){var ye=Math.PI*g;v/=ve,v<0&&(v=0),v>1&&(v=1);var He=v-.5,ze=.42-.5*Math.cos(2*v*Math.PI)+.08*Math.cos(4*v*Math.PI);return Math.abs(He)<1e-9?ye/Math.PI:ze*Math.sin(ve*ye*He)/(Math.PI*ve*He)}function Y(v,g,ve,ye,He,ze,Ke,We,lt){var Ze=v.internal_flags,Ge,Mt=0,Xt,Dt=v.out_samplerate/Q(v.out_samplerate,v.in_samplerate);Dt>jt.BPC&&(Dt=jt.BPC);var Wt=Math.abs(Ze.resample_ratio-Math.floor(.5+Ze.resample_ratio))<1e-4?1:0,rr=1/Ze.resample_ratio;rr>1&&(rr=1);var ar=31;ar%2==0&&--ar,ar+=Wt;var Ar=ar+1;if(Ze.fill_buffer_resample_init==0){for(Ze.inbuf_old[0]=Ui(Ar),Ze.inbuf_old[1]=Ui(Ar),Ge=0;Ge<=2*Dt;++Ge)Ze.blackfilt[Ge]=Ui(Ar);for(Ze.itime[0]=0,Ze.itime[1]=0,Mt=0;Mt<=2*Dt;Mt++){var jn=0,zr=(Mt-Dt)/(2*Dt);for(Ge=0;Ge<=ar;Ge++)jn+=Ze.blackfilt[Mt][Ge]=j(Ge-zr,rr,ar);for(Ge=0;Ge<=ar;Ge++)Ze.blackfilt[Mt][Ge]/=jn}Ze.fill_buffer_resample_init=1}var jr=Ze.inbuf_old[lt];for(Xt=0;Xt<ye;Xt++){var wn,Hi;if(wn=Xt*Ze.resample_ratio,Mt=0|Math.floor(wn-Ze.itime[lt]),ar+Mt-ar/2>=Ke)break;var zr=wn-Ze.itime[lt]-(Mt+.5*(ar%2));Zr(Math.abs(zr)<=.501),Hi=0|Math.floor(zr*2*Dt+Dt+.5);var Vi=0;for(Ge=0;Ge<=ar;++Ge){var Rn=Ge+Mt-ar/2,Lr;Zr(Rn<Ke),Zr(Rn+Ar>=0),Lr=Rn<0?jr[Ar+Rn]:He[ze+Rn],Vi+=Lr*Ze.blackfilt[Hi][Ge]}g[ve+Xt]=Vi}if(We.num_used=Math.min(Ke,ar+Mt-ar/2),Ze.itime[lt]+=We.num_used-Xt*Ze.resample_ratio,We.num_used>=Ar)for(Ge=0;Ge<Ar;Ge++)jr[Ge]=He[ze+We.num_used+Ge-Ar];else{var vi=Ar-We.num_used;for(Ge=0;Ge<vi;++Ge)jr[Ge]=jr[Ge+We.num_used];for(Mt=0;Ge<Ar;++Ge,++Mt)jr[Ge]=He[ze+Mt];Zr(Mt==We.num_used)}return Xt}function we(v,g,ve,ye,He,ze){var Ke=v.internal_flags;if(Ke.resample_ratio<.9999||Ke.resample_ratio>1.0001)for(var We=0;We<Ke.channels_out;We++){var lt=new T;ze.n_out=Y(v,g[We],Ke.mf_size,v.framesize,ve[We],ye,He,lt,We),ze.n_in=lt.num_used}else{ze.n_out=Math.min(v.framesize,He),ze.n_in=ze.n_out;for(var Ze=0;Ze<ze.n_out;++Ze)g[0][Ke.mf_size+Ze]=ve[0][ye+Ze],Ke.channels_out==2&&(g[1][Ke.mf_size+Ze]=ve[1][ye+Ze])}}}var Yf=mr,qn=E.VbrMode;function $f(){function B($,he,be,D,ee,s,P,G,F,b,_,N,W,C,f){this.vbr_q=$,this.quant_comp=he,this.quant_comp_s=be,this.expY=D,this.st_lrm=ee,this.st_s=s,this.masking_adj=P,this.masking_adj_short=G,this.ath_lower=F,this.ath_curve=b,this.ath_sensitivity=_,this.interch=N,this.safejoint=W,this.sfb21mod=C,this.msfix=f}function ne($,he,be,D,ee,s,P,G,F,b,_,N,W,C){this.quant_comp=he,this.quant_comp_s=be,this.safejoint=D,this.nsmsfix=ee,this.st_lrm=s,this.st_s=P,this.nsbass=G,this.scale=F,this.masking_adj=b,this.ath_lower=_,this.ath_curve=N,this.interch=W,this.sfscale=C}var fe;this.setModules=function($){fe=$};var ie=[new B(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new B(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new B(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new B(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new B(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new B(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new B(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new B(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new B(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new B(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new B(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],Ae=[new B(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new B(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new B(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new B(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new B(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new B(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new B(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new B(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new B(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new B(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new B(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function ae($,he,be){var D=$.VBR==qn.vbr_rh?ie:Ae,ee=$.VBR_q_frac,s=D[he],P=D[he+1],G=s;s.st_lrm=s.st_lrm+ee*(P.st_lrm-s.st_lrm),s.st_s=s.st_s+ee*(P.st_s-s.st_s),s.masking_adj=s.masking_adj+ee*(P.masking_adj-s.masking_adj),s.masking_adj_short=s.masking_adj_short+ee*(P.masking_adj_short-s.masking_adj_short),s.ath_lower=s.ath_lower+ee*(P.ath_lower-s.ath_lower),s.ath_curve=s.ath_curve+ee*(P.ath_curve-s.ath_curve),s.ath_sensitivity=s.ath_sensitivity+ee*(P.ath_sensitivity-s.ath_sensitivity),s.interch=s.interch+ee*(P.interch-s.interch),s.msfix=s.msfix+ee*(P.msfix-s.msfix),Ue($,G.vbr_q),be!=0?$.quant_comp=G.quant_comp:Math.abs($.quant_comp- -1)>0||($.quant_comp=G.quant_comp),be!=0?$.quant_comp_short=G.quant_comp_s:Math.abs($.quant_comp_short- -1)>0||($.quant_comp_short=G.quant_comp_s),G.expY!=0&&($.experimentalY=G.expY!=0),be!=0?$.internal_flags.nsPsy.attackthre=G.st_lrm:Math.abs($.internal_flags.nsPsy.attackthre- -1)>0||($.internal_flags.nsPsy.attackthre=G.st_lrm),be!=0?$.internal_flags.nsPsy.attackthre_s=G.st_s:Math.abs($.internal_flags.nsPsy.attackthre_s- -1)>0||($.internal_flags.nsPsy.attackthre_s=G.st_s),be!=0?$.maskingadjust=G.masking_adj:Math.abs($.maskingadjust-0)>0||($.maskingadjust=G.masking_adj),be!=0?$.maskingadjust_short=G.masking_adj_short:Math.abs($.maskingadjust_short-0)>0||($.maskingadjust_short=G.masking_adj_short),be!=0?$.ATHlower=-G.ath_lower/10:Math.abs(-$.ATHlower*10-0)>0||($.ATHlower=-G.ath_lower/10),be!=0?$.ATHcurve=G.ath_curve:Math.abs($.ATHcurve- -1)>0||($.ATHcurve=G.ath_curve),be!=0?$.athaa_sensitivity=G.ath_sensitivity:Math.abs($.athaa_sensitivity- -1)>0||($.athaa_sensitivity=G.ath_sensitivity),G.interch>0&&(be!=0?$.interChRatio=G.interch:Math.abs($.interChRatio- -1)>0||($.interChRatio=G.interch)),G.safejoint>0&&($.exp_nspsytune=$.exp_nspsytune|G.safejoint),G.sfb21mod>0&&($.exp_nspsytune=$.exp_nspsytune|G.sfb21mod<<20),be!=0?$.msfix=G.msfix:Math.abs($.msfix- -1)>0||($.msfix=G.msfix),be==0&&($.VBR_q=he,$.VBR_q_frac=ee)}var _e=[new ne(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new ne(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new ne(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new ne(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new ne(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new ne(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new ne(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new ne(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new ne(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new ne(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new ne(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new ne(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new ne(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new ne(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new ne(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new ne(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new ne(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function Fe($,he,be){var D=he,ee=fe.nearestBitrateFullIndex(he);if($.VBR=qn.vbr_abr,$.VBR_mean_bitrate_kbps=D,$.VBR_mean_bitrate_kbps=Math.min($.VBR_mean_bitrate_kbps,320),$.VBR_mean_bitrate_kbps=Math.max($.VBR_mean_bitrate_kbps,8),$.brate=$.VBR_mean_bitrate_kbps,$.VBR_mean_bitrate_kbps>320&&($.disable_reservoir=!0),_e[ee].safejoint>0&&($.exp_nspsytune=$.exp_nspsytune|2),_e[ee].sfscale>0&&($.internal_flags.noise_shaping=2),Math.abs(_e[ee].nsbass)>0){var s=int(_e[ee].nsbass*4);s<0&&(s+=64),$.exp_nspsytune=$.exp_nspsytune|s<<2}return be!=0?$.quant_comp=_e[ee].quant_comp:Math.abs($.quant_comp- -1)>0||($.quant_comp=_e[ee].quant_comp),be!=0?$.quant_comp_short=_e[ee].quant_comp_s:Math.abs($.quant_comp_short- -1)>0||($.quant_comp_short=_e[ee].quant_comp_s),be!=0?$.msfix=_e[ee].nsmsfix:Math.abs($.msfix- -1)>0||($.msfix=_e[ee].nsmsfix),be!=0?$.internal_flags.nsPsy.attackthre=_e[ee].st_lrm:Math.abs($.internal_flags.nsPsy.attackthre- -1)>0||($.internal_flags.nsPsy.attackthre=_e[ee].st_lrm),be!=0?$.internal_flags.nsPsy.attackthre_s=_e[ee].st_s:Math.abs($.internal_flags.nsPsy.attackthre_s- -1)>0||($.internal_flags.nsPsy.attackthre_s=_e[ee].st_s),be!=0?$.scale=_e[ee].scale:Math.abs($.scale- -1)>0||($.scale=_e[ee].scale),be!=0?$.maskingadjust=_e[ee].masking_adj:Math.abs($.maskingadjust-0)>0||($.maskingadjust=_e[ee].masking_adj),_e[ee].masking_adj>0?be!=0?$.maskingadjust_short=_e[ee].masking_adj*.9:Math.abs($.maskingadjust_short-0)>0||($.maskingadjust_short=_e[ee].masking_adj*.9):be!=0?$.maskingadjust_short=_e[ee].masking_adj*1.1:Math.abs($.maskingadjust_short-0)>0||($.maskingadjust_short=_e[ee].masking_adj*1.1),be!=0?$.ATHlower=-_e[ee].ath_lower/10:Math.abs(-$.ATHlower*10-0)>0||($.ATHlower=-_e[ee].ath_lower/10),be!=0?$.ATHcurve=_e[ee].ath_curve:Math.abs($.ATHcurve- -1)>0||($.ATHcurve=_e[ee].ath_curve),be!=0?$.interChRatio=_e[ee].interch:Math.abs($.interChRatio- -1)>0||($.interChRatio=_e[ee].interch),he}this.apply_preset=function($,he,be){switch(he){case Nt.R3MIX:{he=Nt.V3,$.VBR=qn.vbr_mtrh;break}case Nt.MEDIUM:{he=Nt.V4,$.VBR=qn.vbr_rh;break}case Nt.MEDIUM_FAST:{he=Nt.V4,$.VBR=qn.vbr_mtrh;break}case Nt.STANDARD:{he=Nt.V2,$.VBR=qn.vbr_rh;break}case Nt.STANDARD_FAST:{he=Nt.V2,$.VBR=qn.vbr_mtrh;break}case Nt.EXTREME:{he=Nt.V0,$.VBR=qn.vbr_rh;break}case Nt.EXTREME_FAST:{he=Nt.V0,$.VBR=qn.vbr_mtrh;break}case Nt.INSANE:return he=320,$.preset=he,Fe($,he,be),$.VBR=qn.vbr_off,he}switch($.preset=he,he){case Nt.V9:return ae($,9,be),he;case Nt.V8:return ae($,8,be),he;case Nt.V7:return ae($,7,be),he;case Nt.V6:return ae($,6,be),he;case Nt.V5:return ae($,5,be),he;case Nt.V4:return ae($,4,be),he;case Nt.V3:return ae($,3,be),he;case Nt.V2:return ae($,2,be),he;case Nt.V1:return ae($,1,be),he;case Nt.V0:return ae($,0,be),he;default:break}return 8<=he&&he<=320?Fe($,he,be):($.preset=0,he)};function Ue($,he){var be=0;return 0>he&&(be=-1,he=0),9<he&&(be=-1,he=9),$.VBR_q=he,$.VBR_q_frac=0,be}}var Zf=$f;function Qf(){var B,ne;this.setModules=function(fe,ie){B=fe,ne=ie}}var Jf=Qf;function em(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}var D0=em,ou=E.new_float,tm=E.new_int;function rm(){this.global_gain=0,this.sfb_count1=0,this.step=tm(39),this.noise=ou(39),this.noise_log=ou(39)}var nm=rm,mi=E.System,su=E.VbrMode,L0=E.Util,va=E.Arrays,no=E.new_float,mn=E.assert;function im(){var B;this.rv=null;var ne;this.qupvt=null;var fe,ie=new Jf,Ae;this.setModules=function(F,b,_,N){B=F,ne=b,this.rv=b,fe=_,this.qupvt=_,Ae=N,ie.setModules(fe,Ae)},this.ms_convert=function(F,b){for(var _=0;_<576;++_){var N=F.tt[b][0].xr[_],W=F.tt[b][1].xr[_];F.tt[b][0].xr[_]=(N+W)*(L0.SQRT2*.5),F.tt[b][1].xr[_]=(N-W)*(L0.SQRT2*.5)}};function ae(F,b,_,N){N=0;for(var W=0;W<=_;++W){var C=Math.abs(F.xr[W]);N+=C,b[W]=Math.sqrt(C*Math.sqrt(C)),b[W]>F.xrpow_max&&(F.xrpow_max=b[W])}return N}this.init_xrpow=function(F,b,_){var N=0,W=0|b.max_nonzero_coeff;if(mn(_!=null),b.xrpow_max=0,mn(0<=W&&W<=575),va.fill(_,W,576,0),N=ae(b,_,W,N),N>1e-20){var C=0;(F.substep_shaping&2)!=0&&(C=1);for(var f=0;f<b.psymax;f++)F.pseudohalf[f]=C;return!0}return va.fill(b.l3_enc,0,576,0),!1};function _e(F,b){var _=F.ATH,N=b.xr;if(b.block_type!=A.SHORT_TYPE)for(var W=!1,C=A.PSFB21-1;C>=0&&!W;C--){var f=F.scalefac_band.psfb21[C],O=F.scalefac_band.psfb21[C+1],R=fe.athAdjust(_.adjust,_.psfb21[C],_.floor);F.nsPsy.longfact[21]>1e-12&&(R*=F.nsPsy.longfact[21]);for(var m=O-1;m>=f;m--)if(Math.abs(N[m])<R)N[m]=0;else{W=!0;break}}else for(var h=0;h<3;h++)for(var W=!1,C=A.PSFB12-1;C>=0&&!W;C--){var f=F.scalefac_band.s[12]*3+(F.scalefac_band.s[13]-F.scalefac_band.s[12])*h+(F.scalefac_band.psfb12[C]-F.scalefac_band.psfb12[0]),O=f+(F.scalefac_band.psfb12[C+1]-F.scalefac_band.psfb12[C]),S=fe.athAdjust(_.adjust,_.psfb12[C],_.floor);F.nsPsy.shortfact[12]>1e-12&&(S*=F.nsPsy.shortfact[12]);for(var m=O-1;m>=f;m--)if(Math.abs(N[m])<S)N[m]=0;else{W=!0;break}}}this.init_outer_loop=function(F,b){b.part2_3_length=0,b.big_values=0,b.count1=0,b.global_gain=210,b.scalefac_compress=0,b.table_select[0]=0,b.table_select[1]=0,b.table_select[2]=0,b.subblock_gain[0]=0,b.subblock_gain[1]=0,b.subblock_gain[2]=0,b.subblock_gain[3]=0,b.region0_count=0,b.region1_count=0,b.preflag=0,b.scalefac_scale=0,b.count1table_select=0,b.part2_length=0,b.sfb_lmax=A.SBPSY_l,b.sfb_smin=A.SBPSY_s,b.psy_lmax=F.sfb21_extra?A.SBMAX_l:A.SBPSY_l,b.psymax=b.psy_lmax,b.sfbmax=b.sfb_lmax,b.sfbdivide=11;for(var _=0;_<A.SBMAX_l;_++)b.width[_]=F.scalefac_band.l[_+1]-F.scalefac_band.l[_],b.window[_]=3;if(b.block_type==A.SHORT_TYPE){var N=no(576);b.sfb_smin=0,b.sfb_lmax=0,b.mixed_block_flag!=0&&(b.sfb_smin=3,b.sfb_lmax=F.mode_gr*2+4),b.psymax=b.sfb_lmax+3*((F.sfb21_extra?A.SBMAX_s:A.SBPSY_s)-b.sfb_smin),b.sfbmax=b.sfb_lmax+3*(A.SBPSY_s-b.sfb_smin),b.sfbdivide=b.sfbmax-18,b.psy_lmax=b.sfb_lmax;var W=F.scalefac_band.l[b.sfb_lmax];mi.arraycopy(b.xr,0,N,0,576);for(var _=b.sfb_smin;_<A.SBMAX_s;_++)for(var C=F.scalefac_band.s[_],f=F.scalefac_band.s[_+1],O=0;O<3;O++)for(var R=C;R<f;R++)b.xr[W++]=N[3*R+O];for(var m=b.sfb_lmax,_=b.sfb_smin;_<A.SBMAX_s;_++)b.width[m]=b.width[m+1]=b.width[m+2]=F.scalefac_band.s[_+1]-F.scalefac_band.s[_],b.window[m]=0,b.window[m+1]=1,b.window[m+2]=2,m+=3}b.count1bits=0,b.sfb_partition_table=fe.nr_of_sfb_block[0][0],b.slen[0]=0,b.slen[1]=0,b.slen[2]=0,b.slen[3]=0,b.max_nonzero_coeff=575,va.fill(b.scalefac,0),_e(F,b)};function Fe(F){this.ordinal=F}Fe.BINSEARCH_NONE=new Fe(0),Fe.BINSEARCH_UP=new Fe(1),Fe.BINSEARCH_DOWN=new Fe(2);function Ue(F,b,_,N,W){var C,f=F.CurrentStep[N],O=!1,R=F.OldValue[N],m=Fe.BINSEARCH_NONE;for(b.global_gain=R,_-=b.part2_length,mn(f!=0);;){var h;if(C=Ae.count_bits(F,W,b,null),f==1||C==_)break;C>_?(m==Fe.BINSEARCH_DOWN&&(O=!0),O&&(f/=2),m=Fe.BINSEARCH_UP,h=f):(m==Fe.BINSEARCH_UP&&(O=!0),O&&(f/=2),m=Fe.BINSEARCH_DOWN,h=-f),b.global_gain+=h,b.global_gain<0&&(b.global_gain=0,O=!0),b.global_gain>255&&(b.global_gain=255,O=!0)}for(mn(b.global_gain>=0),mn(b.global_gain<256);C>_&&b.global_gain<255;)b.global_gain++,C=Ae.count_bits(F,W,b,null);return F.CurrentStep[N]=R-b.global_gain>=4?4:2,F.OldValue[N]=b.global_gain,b.part2_3_length=C,C}this.trancate_smallspectrums=function(F,b,_,N){var W=no(Un.SFBMAX);if(!((F.substep_shaping&4)==0&&b.block_type==A.SHORT_TYPE||(F.substep_shaping&128)!=0)){fe.calc_noise(b,_,W,new D0,null);for(var f=0;f<576;f++){var C=0;b.l3_enc[f]!=0&&(C=Math.abs(b.xr[f])),N[f]=C}var f=0,O=8;b.block_type==A.SHORT_TYPE&&(O=6);do{var R,m,h,S,u=b.width[O];if(f+=u,!(W[O]>=1)&&(va.sort(N,f-u,u),!ri.EQ(N[f-1],0))){R=(1-W[O])*_[O],m=0,S=0;do{var p;for(h=1;S+h<u&&!ri.NEQ(N[S+f-u],N[S+f+h-u]);h++);if(p=N[S+f-u]*N[S+f-u]*h,R<p){S!=0&&(m=N[S+f-u-1]);break}R-=p,S+=h}while(S<u);if(!ri.EQ(m,0))do Math.abs(b.xr[f-u])<=m&&(b.l3_enc[f-u]=0);while(--u>0)}}while(++O<b.psymax);b.part2_3_length=Ae.noquant_count_bits(F,b,null)}};function $(F){for(var b=0;b<F.sfbmax;b++)if(F.scalefac[b]+F.subblock_gain[F.window[b]]==0)return!1;return!0}function he(F){return L0.FAST_LOG10(.368+.632*F*F*F)}function be(F,b){for(var _=1e-37,N=0;N<b.psymax;N++)_+=he(F[N]);return Math.max(1e-20,_)}function D(F,b,_,N,W){var C;switch(F){default:case 9:{b.over_count>0?(C=_.over_SSD<=b.over_SSD,_.over_SSD==b.over_SSD&&(C=_.bits<b.bits)):C=_.max_noise<0&&_.max_noise*10+_.bits<=b.max_noise*10+b.bits;break}case 0:C=_.over_count<b.over_count||_.over_count==b.over_count&&_.over_noise<b.over_noise||_.over_count==b.over_count&&ri.EQ(_.over_noise,b.over_noise)&&_.tot_noise<b.tot_noise;break;case 8:_.max_noise=be(W,N);case 1:C=_.max_noise<b.max_noise;break;case 2:C=_.tot_noise<b.tot_noise;break;case 3:C=_.tot_noise<b.tot_noise&&_.max_noise<b.max_noise;break;case 4:C=_.max_noise<=0&&b.max_noise>.2||_.max_noise<=0&&b.max_noise<0&&b.max_noise>_.max_noise-.2&&_.tot_noise<b.tot_noise||_.max_noise<=0&&b.max_noise>0&&b.max_noise>_.max_noise-.2&&_.tot_noise<b.tot_noise+b.over_noise||_.max_noise>0&&b.max_noise>-.05&&b.max_noise>_.max_noise-.1&&_.tot_noise+_.over_noise<b.tot_noise+b.over_noise||_.max_noise>0&&b.max_noise>-.1&&b.max_noise>_.max_noise-.15&&_.tot_noise+_.over_noise+_.over_noise<b.tot_noise+b.over_noise+b.over_noise;break;case 5:C=_.over_noise<b.over_noise||ri.EQ(_.over_noise,b.over_noise)&&_.tot_noise<b.tot_noise;break;case 6:C=_.over_noise<b.over_noise||ri.EQ(_.over_noise,b.over_noise)&&(_.max_noise<b.max_noise||ri.EQ(_.max_noise,b.max_noise)&&_.tot_noise<=b.tot_noise);break;case 7:C=_.over_count<b.over_count||_.over_noise<b.over_noise;break}return b.over_count==0&&(C=C&&_.bits<b.bits),C}function ee(F,b,_,N,W){var C=F.internal_flags,f;b.scalefac_scale==0?f=1.2968395546510096:f=1.6817928305074292;for(var O=0,R=0;R<b.sfbmax;R++)O<_[R]&&(O=_[R]);var m=C.noise_shaping_amp;switch(m==3&&(W?m=2:m=1),m){case 2:break;case 1:O>1?O=Math.pow(O,.5):O*=.95;break;case 0:default:O>1?O=1:O*=.95;break}for(var h=0,R=0;R<b.sfbmax;R++){var S=b.width[R],u;if(h+=S,!(_[R]<O)){if((C.substep_shaping&2)!=0&&(C.pseudohalf[R]=C.pseudohalf[R]==0?1:0,C.pseudohalf[R]==0&&C.noise_shaping_amp==2))return;for(b.scalefac[R]++,u=-S;u<0;u++)N[h+u]*=f,N[h+u]>b.xrpow_max&&(b.xrpow_max=N[h+u]);if(C.noise_shaping_amp==2)return}}}function s(F,b){for(var _=1.2968395546510096,N=0,W=0;W<F.sfbmax;W++){var C=F.width[W],f=F.scalefac[W];if(F.preflag!=0&&(f+=fe.pretab[W]),N+=C,(f&1)!=0){f++;for(var O=-C;O<0;O++)b[N+O]*=_,b[N+O]>F.xrpow_max&&(F.xrpow_max=b[N+O])}F.scalefac[W]=f>>1}F.preflag=0,F.scalefac_scale=1}function P(F,b,_){var N,W=b.scalefac;for(N=0;N<b.sfb_lmax;N++)if(W[N]>=16)return!0;for(var C=0;C<3;C++){var f=0,O=0;for(N=b.sfb_lmax+C;N<b.sfbdivide;N+=3)f<W[N]&&(f=W[N]);for(;N<b.sfbmax;N+=3)O<W[N]&&(O=W[N]);if(!(f<16&&O<8)){if(b.subblock_gain[C]>=7)return!0;b.subblock_gain[C]++;var R=F.scalefac_band.l[b.sfb_lmax];for(N=b.sfb_lmax+C;N<b.sfbmax;N+=3){var m,h=b.width[N],S=W[N];if(mn(S>=0),S=S-(4>>b.scalefac_scale),S>=0){W[N]=S,R+=h*3;continue}W[N]=0;{var u=210+(S<<b.scalefac_scale+1);m=fe.IPOW20(u)}R+=h*(C+1);for(var p=-h;p<0;p++)_[R+p]*=m,_[R+p]>b.xrpow_max&&(b.xrpow_max=_[R+p]);R+=h*(3-C-1)}{var m=fe.IPOW20(202);R+=b.width[N]*(C+1);for(var p=-b.width[N];p<0;p++)_[R+p]*=m,_[R+p]>b.xrpow_max&&(b.xrpow_max=_[R+p])}}}return!1}function G(F,b,_,N,W){var C=F.internal_flags;ee(F,b,_,N,W);var f=$(b);return f?!1:(C.mode_gr==2?f=Ae.scale_bitcount(b):f=Ae.scale_bitcount_lsf(C,b),f?(C.noise_shaping>1&&(va.fill(C.pseudohalf,0),b.scalefac_scale==0?(s(b,N),f=!1):b.block_type==A.SHORT_TYPE&&C.subblock_gain>0&&(f=P(C,b,N)||$(b))),f||(C.mode_gr==2?f=Ae.scale_bitcount(b):f=Ae.scale_bitcount_lsf(C,b)),!f):!0)}this.outer_loop=function(F,b,_,N,W,C){var f=F.internal_flags,O=new Qo,R=no(576),m=no(Un.SFBMAX),h=new D0,S,u=new nm,p=9999999,y=!1,T=!1,Q=0;if(Ue(f,b,C,W,N),f.noise_shaping==0)return 100;fe.calc_noise(b,_,m,h,u),h.bits=b.part2_3_length,O.assign(b);var j=0;for(mi.arraycopy(N,0,R,0,576);!y;){do{var Y=new D0,we,v=255;if((f.substep_shaping&2)!=0?we=20:we=3,f.sfb21_extra&&(m[O.sfbmax]>1||O.block_type==A.SHORT_TYPE&&(m[O.sfbmax+1]>1||m[O.sfbmax+2]>1))||!G(F,O,m,N,T))break;O.scalefac_scale!=0&&(v=254);var g=C-O.part2_length;if(g<=0)break;for(;(O.part2_3_length=Ae.count_bits(f,N,O,u))>g&&O.global_gain<=v;)O.global_gain++;if(O.global_gain>v)break;if(h.over_count==0){for(;(O.part2_3_length=Ae.count_bits(f,N,O,u))>p&&O.global_gain<=v;)O.global_gain++;if(O.global_gain>v)break}if(fe.calc_noise(O,_,m,Y,u),Y.bits=O.part2_3_length,b.block_type!=A.SHORT_TYPE?S=F.quant_comp:S=F.quant_comp_short,S=D(S,h,Y,O,m)?1:0,S!=0)p=b.part2_3_length,h=Y,b.assign(O),j=0,mi.arraycopy(N,0,R,0,576);else if(f.full_outer_loop==0&&(++j>we&&h.over_count==0||f.noise_shaping_amp==3&&T&&j>30||f.noise_shaping_amp==3&&T&&O.global_gain-Q>15))break}while(O.global_gain+O.scalefac_scale<255);f.noise_shaping_amp==3?T?y=!0:(O.assign(b),mi.arraycopy(R,0,N,0,576),j=0,Q=O.global_gain,T=!0):y=!0}return mn(b.global_gain+b.scalefac_scale<=255),F.VBR==su.vbr_rh||F.VBR==su.vbr_mtrh?mi.arraycopy(R,0,N,0,576):(f.substep_shaping&1)!=0&&trancate_smallspectrums(f,b,_,N),h.over_count},this.iteration_finish_one=function(F,b,_){var N=F.l3_side,W=N.tt[b][_];Ae.best_scalefac_store(F,b,_,N),F.use_best_huffman==1&&Ae.best_huffman_divide(F,W),ne.ResvAdjust(F,W)},this.VBR_encode_granule=function(F,b,_,N,W,C,f){var O=F.internal_flags,R=new Qo,m=no(576),h=f,S=f+1,u=(f+C)/2,p,y,T=0,Q=O.sfb21_extra;mn(h<=LameInternalFlags.MAX_BITS_PER_CHANNEL),va.fill(R.l3_enc,0);do mn(u>=C),mn(u<=f),mn(C<=f),u>h-42?O.sfb21_extra=!1:O.sfb21_extra=Q,y=outer_loop(F,b,_,N,W,u),y<=0?(T=1,S=b.part2_3_length,R.assign(b),mi.arraycopy(N,0,m,0,576),f=S-32,p=f-C,u=(f+C)/2):(C=u+32,p=f-C,u=(f+C)/2,T!=0&&(T=2,b.assign(R),mi.arraycopy(m,0,N,0,576)));while(p>12);O.sfb21_extra=Q,T==2&&mi.arraycopy(R.l3_enc,0,b.l3_enc,0,576),mn(b.part2_3_length<=h)},this.get_framebits=function(F,b){var _=F.internal_flags;_.bitrate_index=_.VBR_min_bitrate;var N=B.getframebits(F);_.bitrate_index=1,N=B.getframebits(F);for(var W=1;W<=_.VBR_max_bitrate;W++){_.bitrate_index=W;var C=new MeanBits(N);b[W]=ne.ResvFrameBegin(F,C),N=C.bits}},this.VBR_old_prepare=function(F,b,_,N,W,C,f,O,R){var m=F.internal_flags,h,S=0,u=1,p=0;m.bitrate_index=m.VBR_max_bitrate;var y=ne.ResvFrameBegin(F,new MeanBits(0))/m.mode_gr;get_framebits(F,C);for(var T=0;T<m.mode_gr;T++){var Q=fe.on_pe(F,b,O[T],y,T,0);m.mode_ext==A.MPG_MD_MS_LR&&(ms_convert(m.l3_side,T),fe.reduce_side(O[T],_[T],y,Q));for(var j=0;j<m.channels_out;++j){var Y=m.l3_side.tt[T][j];Y.block_type!=A.SHORT_TYPE?(S=1.28/(1+Math.exp(3.5-b[T][j]/300))-.05,h=m.PSY.mask_adjust-S):(S=2.56/(1+Math.exp(3.5-b[T][j]/300))-.14,h=m.PSY.mask_adjust_short-S),m.masking_lower=Math.pow(10,h*.1),init_outer_loop(m,Y),R[T][j]=fe.calc_xmin(F,N[T][j],Y,W[T][j]),R[T][j]!=0&&(u=0),f[T][j]=126,p+=O[T][j]}}for(var T=0;T<m.mode_gr;T++)for(var j=0;j<m.channels_out;j++)p>C[m.VBR_max_bitrate]&&(O[T][j]*=C[m.VBR_max_bitrate],O[T][j]/=p),f[T][j]>O[T][j]&&(f[T][j]=O[T][j]);return u},this.bitpressure_strategy=function(F,b,_,N){for(var W=0;W<F.mode_gr;W++)for(var C=0;C<F.channels_out;C++){for(var f=F.l3_side.tt[W][C],O=b[W][C],R=0,m=0;m<f.psy_lmax;m++)O[R++]*=1+.029*m*m/A.SBMAX_l/A.SBMAX_l;if(f.block_type==A.SHORT_TYPE)for(var m=f.sfb_smin;m<A.SBMAX_s;m++)O[R++]*=1+.029*m*m/A.SBMAX_s/A.SBMAX_s,O[R++]*=1+.029*m*m/A.SBMAX_s/A.SBMAX_s,O[R++]*=1+.029*m*m/A.SBMAX_s/A.SBMAX_s;N[W][C]=0|Math.max(_[W][C],.9*N[W][C])}},this.VBR_new_prepare=function(F,b,_,N,W,C){var f=F.internal_flags,O=1,R=0,m=0,h;if(F.free_format){f.bitrate_index=0;var S=new MeanBits(R);h=ne.ResvFrameBegin(F,S),R=S.bits,W[0]=h}else{f.bitrate_index=f.VBR_max_bitrate;var S=new MeanBits(R);ne.ResvFrameBegin(F,S),R=S.bits,get_framebits(F,W),h=W[f.VBR_max_bitrate]}for(var u=0;u<f.mode_gr;u++){fe.on_pe(F,b,C[u],R,u,0),f.mode_ext==A.MPG_MD_MS_LR&&ms_convert(f.l3_side,u);for(var p=0;p<f.channels_out;++p){var y=f.l3_side.tt[u][p];f.masking_lower=Math.pow(10,f.PSY.mask_adjust*.1),init_outer_loop(f,y),fe.calc_xmin(F,_[u][p],y,N[u][p])!=0&&(O=0),m+=C[u][p]}}for(var u=0;u<f.mode_gr;u++)for(var p=0;p<f.channels_out;p++)m>h&&(C[u][p]*=h,C[u][p]/=m);return O},this.calc_target_bits=function(F,b,_,N,W,C){var f=F.internal_flags,O=f.l3_side,R,m,h,S,u=0;f.bitrate_index=f.VBR_max_bitrate;var p=new MeanBits(u);for(C[0]=ne.ResvFrameBegin(F,p),u=p.bits,f.bitrate_index=1,u=B.getframebits(F)-f.sideinfo_len*8,W[0]=u/(f.mode_gr*f.channels_out),u=F.VBR_mean_bitrate_kbps*F.framesize*1e3,(f.substep_shaping&1)!=0&&(u*=1.09),u/=F.out_samplerate,u-=f.sideinfo_len*8,u/=f.mode_gr*f.channels_out,R=.93+.07*(11-F.compression_ratio)/(11-5.5),R<.9&&(R=.9),R>1&&(R=1),m=0;m<f.mode_gr;m++){var y=0;for(h=0;h<f.channels_out;h++){if(N[m][h]=int(R*u),b[m][h]>700){var T=int((b[m][h]-700)/1.4),Q=O.tt[m][h];N[m][h]=int(R*u),Q.block_type==A.SHORT_TYPE&&T<u/2&&(T=u/2),T>u*3/2?T=u*3/2:T<0&&(T=0),N[m][h]+=T}N[m][h]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(N[m][h]=LameInternalFlags.MAX_BITS_PER_CHANNEL),y+=N[m][h]}if(y>LameInternalFlags.MAX_BITS_PER_GRANULE)for(h=0;h<f.channels_out;++h)N[m][h]*=LameInternalFlags.MAX_BITS_PER_GRANULE,N[m][h]/=y}if(f.mode_ext==A.MPG_MD_MS_LR)for(m=0;m<f.mode_gr;m++)fe.reduce_side(N[m],_[m],u*f.channels_out,LameInternalFlags.MAX_BITS_PER_GRANULE);for(S=0,m=0;m<f.mode_gr;m++)for(h=0;h<f.channels_out;h++)N[m][h]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(N[m][h]=LameInternalFlags.MAX_BITS_PER_CHANNEL),S+=N[m][h];if(S>C[0])for(m=0;m<f.mode_gr;m++)for(h=0;h<f.channels_out;h++)N[m][h]*=C[0],N[m][h]/=S}}var am=im,is=E.assert;function om(){var B;this.setModules=function(ne){B=ne},this.ResvFrameBegin=function(ne,fe){var ie=ne.internal_flags,Ae,ae=ie.l3_side,_e=B.getframebits(ne);fe.bits=(_e-ie.sideinfo_len*8)/ie.mode_gr;var Fe=8*256*ie.mode_gr-8;ne.brate>320?Ae=8*int(ne.brate*1e3/(ne.out_samplerate/1152)/8+.5):(Ae=8*1440,ne.strict_ISO&&(Ae=8*int(32e4/(ne.out_samplerate/1152)/8+.5))),ie.ResvMax=Ae-_e,ie.ResvMax>Fe&&(ie.ResvMax=Fe),(ie.ResvMax<0||ne.disable_reservoir)&&(ie.ResvMax=0);var Ue=fe.bits*ie.mode_gr+Math.min(ie.ResvSize,ie.ResvMax);return Ue>Ae&&(Ue=Ae),is(ie.ResvMax%8==0),is(ie.ResvMax>=0),ae.resvDrain_pre=0,ie.pinfo!=null&&(ie.pinfo.mean_bits=fe.bits/2,ie.pinfo.resvsize=ie.ResvSize),Ue},this.ResvMaxBits=function(ne,fe,ie,Ae){var ae=ne.internal_flags,_e,Fe=ae.ResvSize,Ue=ae.ResvMax;Ae!=0&&(Fe+=fe),(ae.substep_shaping&1)!=0&&(Ue*=.9),ie.bits=fe,Fe*10>Ue*9?(_e=Fe-Ue*9/10,ie.bits+=_e,ae.substep_shaping|=128):(_e=0,ae.substep_shaping&=127,!ne.disable_reservoir&&(ae.substep_shaping&1)==0&&(ie.bits-=.1*fe));var $=Fe<ae.ResvMax*6/10?Fe:ae.ResvMax*6/10;return $-=_e,$<0&&($=0),$},this.ResvAdjust=function(ne,fe){ne.ResvSize-=fe.part2_3_length+fe.part2_length},this.ResvFrameEnd=function(ne,fe){var ie,Ae=ne.l3_side;ne.ResvSize+=fe*ne.mode_gr;var ae=0;Ae.resvDrain_post=0,Ae.resvDrain_pre=0,(ie=ne.ResvSize%8)!=0&&(ae+=ie),ie=ne.ResvSize-ae-ne.ResvMax,ie>0&&(is(ie%8==0),is(ie>=0),ae+=ie);{var _e=Math.min(Ae.main_data_begin*8,ae)/8;Ae.resvDrain_pre+=8*_e,ae-=8*_e,ne.ResvSize-=8*_e,Ae.main_data_begin-=_e}Ae.resvDrain_post+=ae,ne.ResvSize-=ae}}var sm=om;function lm(){var B="http://www.mp3dev.org/",ne=3,fe=98,ie=4,Ae=0,ae=93;this.getLameVersion=function(){return ne+"."+fe+"."+ie},this.getLameShortVersion=function(){return ne+"."+fe+"."+ie},this.getLameVeryShortVersion=function(){return"LAME"+ne+"."+fe+"r"},this.getPsyVersion=function(){return Ae+"."+ae},this.getLameUrl=function(){return B},this.getLameOsBitness=function(){return"32bits"}}var cm=lm,um=E.System,N0=E.VbrMode,lu=E.ShortBlock,dm=E.Arrays,as=E.new_byte,fm=E.assert;io.NUMTOCENTRIES=100,io.MAXFRAMESIZE=2880;function io(){var B,ne,fe;this.setModules=function(u,p,y){B=u,ne=p,fe=y};var ie=1,Ae=2,ae=4,_e=8,Fe=io.NUMTOCENTRIES,Ue=io.MAXFRAMESIZE,$=Fe+4+4+4+4+4,he=$+9+1+1+8+1+1+3+1+1+2+4+2+2,be=128,D=64,ee=32,s=null,P="Xing",G="Info",F=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function b(u,p){if(u.nVbrNumFrames++,u.sum+=p,u.seen++,!(u.seen<u.want)&&(u.pos<u.size&&(u.bag[u.pos]=u.sum,u.pos++,u.seen=0),u.pos==u.size)){for(var y=1;y<u.size;y+=2)u.bag[y/2]=u.bag[y];u.want*=2,u.pos/=2}}function _(u,p){if(!(u.pos<=0))for(var y=1;y<Fe;++y){var T=y/Fe,Q,j,Y=0|Math.floor(T*u.pos);Y>u.pos-1&&(Y=u.pos-1),Q=u.bag[Y],j=u.sum;var we=0|256*Q/j;we>255&&(we=255),p[y]=255&we}}this.addVbrFrame=function(u){var p=u.internal_flags,y=Tables.bitrate_table[u.version][p.bitrate_index];fm(p.VBR_seek_table.bag!=null),b(p.VBR_seek_table,y)};function N(u,p){var y=u[p+0]&255;return y<<=8,y|=u[p+1]&255,y<<=8,y|=u[p+2]&255,y<<=8,y|=u[p+3]&255,y}function W(u,p,y){u[p+0]=255&(y>>24&255),u[p+1]=255&(y>>16&255),u[p+2]=255&(y>>8&255),u[p+3]=255&(y&255)}function C(u,p,y){u[p+0]=255&(y>>8&255),u[p+1]=255&(y&255)}function f(u,p){return new String(u,p,P.length(),s).equals(P)||new String(u,p,G.length(),s).equals(G)}function O(u,p,y){return 255&(u<<p|y&~(-1<<p))}function R(u,p){var y=u.internal_flags;p[0]=O(p[0],8,255),p[1]=O(p[1],3,7),p[1]=O(p[1],1,u.out_samplerate<16e3?0:1),p[1]=O(p[1],1,u.version),p[1]=O(p[1],2,4-3),p[1]=O(p[1],1,u.error_protection?0:1),p[2]=O(p[2],4,y.bitrate_index),p[2]=O(p[2],2,y.samplerate_index),p[2]=O(p[2],1,0),p[2]=O(p[2],1,u.extension),p[3]=O(p[3],2,u.mode.ordinal()),p[3]=O(p[3],2,y.mode_ext),p[3]=O(p[3],1,u.copyright),p[3]=O(p[3],1,u.original),p[3]=O(p[3],2,u.emphasis),p[0]=255;var T=255&(p[1]&241),Q;u.version==1?Q=be:u.out_samplerate<16e3?Q=ee:Q=D,u.VBR==N0.vbr_off&&(Q=u.brate);var j;u.free_format?j=0:j=255&16*B.BitrateIndex(Q,u.version,u.out_samplerate),u.version==1?(p[1]=255&(T|10),T=255&(p[2]&13),p[2]=255&(j|T)):(p[1]=255&(T|2),T=255&(p[2]&13),p[2]=255&(j|T))}this.getVbrTag=function(u){var p=new VBRTagData,y=0;p.flags=0;var T=u[y+1]>>3&1,Q=u[y+2]>>2&3,j=u[y+3]>>6&3,Y=u[y+2]>>4&15;if(Y=Tables.bitrate_table[T][Y],u[y+1]>>4==14?p.samprate=Tables.samplerate_table[2][Q]:p.samprate=Tables.samplerate_table[T][Q],T!=0?j!=3?y+=32+4:y+=17+4:j!=3?y+=17+4:y+=9+4,!f(u,y))return null;y+=4,p.hId=T;var we=p.flags=N(u,y);if(y+=4,(we&ie)!=0&&(p.frames=N(u,y),y+=4),(we&Ae)!=0&&(p.bytes=N(u,y),y+=4),(we&ae)!=0){if(p.toc!=null)for(var v=0;v<Fe;v++)p.toc[v]=u[y+v];y+=Fe}p.vbrScale=-1,(we&_e)!=0&&(p.vbrScale=N(u,y),y+=4),p.headersize=(T+1)*72e3*Y/p.samprate,y+=21;var g=u[y+0]<<4;g+=u[y+1]>>4;var ve=(u[y+1]&15)<<8;return ve+=u[y+2]&255,(g<0||g>3e3)&&(g=-1),(ve<0||ve>3e3)&&(ve=-1),p.encDelay=g,p.encPadding=ve,p},this.InitVbrTag=function(u){var p=u.internal_flags,y;u.version==1?y=be:u.out_samplerate<16e3?y=ee:y=D,u.VBR==N0.vbr_off&&(y=u.brate);var T=(u.version+1)*72e3*y/u.out_samplerate,Q=p.sideinfo_len+he;if(p.VBR_seek_table.TotalFrameSize=T,T<Q||T>Ue){u.bWriteVbrTag=!1;return}p.VBR_seek_table.nVbrNumFrames=0,p.VBR_seek_table.nBytesWritten=0,p.VBR_seek_table.sum=0,p.VBR_seek_table.seen=0,p.VBR_seek_table.want=1,p.VBR_seek_table.pos=0,p.VBR_seek_table.bag==null&&(p.VBR_seek_table.bag=new int[400],p.VBR_seek_table.size=400);var j=as(Ue);R(u,j);for(var Y=p.VBR_seek_table.TotalFrameSize,we=0;we<Y;++we)ne.add_dummy_byte(u,j[we]&255,1)};function m(u,p){var y=p^u;return p=p>>8^F[y&255],p}this.updateMusicCRC=function(u,p,y,T){for(var Q=0;Q<T;++Q)u[0]=m(p[y+Q],u[0])};function h(u,p,y,T,Q){var j=u.internal_flags,Y=0,we=u.encoder_delay,v=u.encoder_padding,g=100-10*u.VBR_q-u.quality,ve=fe.getLameVeryShortVersion(),ye,He=0,ze,Ke=[1,5,3,2,4,0,3],We=0|(u.lowpassfreq/100+.5>255?255:u.lowpassfreq/100+.5),lt=0,Ze=0,Ge=0,Mt=u.internal_flags.noise_shaping,Xt=0,Dt=0,Wt=0,rr=0,ar=0,Ar=(u.exp_nspsytune&1)!=0,jn=(u.exp_nspsytune&2)!=0,zr=!1,jr=!1,wn=u.internal_flags.nogap_total,Hi=u.internal_flags.nogap_current,Vi=u.ATHtype,Rn=0,Lr;switch(u.VBR){case vbr_abr:Lr=u.VBR_mean_bitrate_kbps;break;case vbr_off:Lr=u.brate;break;default:Lr=u.VBR_min_bitrate_kbps}switch(u.VBR.ordinal()<Ke.length?ye=Ke[u.VBR.ordinal()]:ye=0,ze=16*He+ye,j.findReplayGain&&(j.RadioGain>510&&(j.RadioGain=510),j.RadioGain<-510&&(j.RadioGain=-510),Ze=8192,Ze|=3072,j.RadioGain>=0?Ze|=j.RadioGain:(Ze|=512,Ze|=-j.RadioGain)),j.findPeakSample&&(lt=Math.abs(0|j.PeakSample/32767*Math.pow(2,23)+.5)),wn!=-1&&(Hi>0&&(jr=!0),Hi<wn-1&&(zr=!0)),Rn=Vi+((Ar?1:0)<<4)+((jn?1:0)<<5)+((zr?1:0)<<6)+((jr?1:0)<<7),g<0&&(g=0),u.mode){case MONO:Xt=0;break;case STEREO:Xt=1;break;case DUAL_CHANNEL:Xt=2;break;case JOINT_STEREO:u.force_ms?Xt=4:Xt=3;break;case NOT_SET:default:Xt=7;break}u.in_samplerate<=32e3?Wt=0:u.in_samplerate==48e3?Wt=2:u.in_samplerate>48e3?Wt=3:Wt=1,(u.short_blocks==lu.short_block_forced||u.short_blocks==lu.short_block_dispensed||u.lowpassfreq==-1&&u.highpassfreq==-1||u.scale_left<u.scale_right||u.scale_left>u.scale_right||u.disable_reservoir&&u.brate<320||u.noATH||u.ATHonly||Vi==0||u.in_samplerate<=32e3)&&(Dt=1),rr=Mt+(Xt<<2)+(Dt<<5)+(Wt<<6),ar=j.nMusicCRC,W(y,T+Y,g),Y+=4;for(var vi=0;vi<9;vi++)y[T+Y+vi]=255&ve.charAt(vi);Y+=9,y[T+Y]=255&ze,Y++,y[T+Y]=255&We,Y++,W(y,T+Y,lt),Y+=4,C(y,T+Y,Ze),Y+=2,C(y,T+Y,Ge),Y+=2,y[T+Y]=255&Rn,Y++,Lr>=255?y[T+Y]=255:y[T+Y]=255&Lr,Y++,y[T+Y]=255&we>>4,y[T+Y+1]=255&(we<<4)+(v>>8),y[T+Y+2]=255&v,Y+=3,y[T+Y]=255&rr,Y++,y[T+Y++]=0,C(y,T+Y,u.preset),Y+=2,W(y,T+Y,p),Y+=4,C(y,T+Y,ar),Y+=2;for(var oo=0;oo<Y;oo++)Q=m(y[T+oo],Q);return C(y,T+Y,Q),Y+=2,Y}function S(u){u.seek(0);var p=as(10);u.readFully(p);var y;return new String(p,"ISO-8859-1").startsWith("ID3")?y=0:y=((p[6]&127)<<21|(p[7]&127)<<14|(p[8]&127)<<7|p[9]&127)+p.length,y}this.getLameTagFrame=function(u,p){var y=u.internal_flags;if(!u.bWriteVbrTag||y.Class_ID!=Nt.LAME_ID||y.VBR_seek_table.pos<=0)return 0;if(p.length<y.VBR_seek_table.TotalFrameSize)return y.VBR_seek_table.TotalFrameSize;dm.fill(p,0,y.VBR_seek_table.TotalFrameSize,0),R(u,p);var T=as(Fe);if(u.free_format)for(var Q=1;Q<Fe;++Q)T[Q]=255&255*Q/100;else _(y.VBR_seek_table,T);var j=y.sideinfo_len;u.error_protection&&(j-=2),u.VBR==N0.vbr_off?(p[j++]=255&G.charAt(0),p[j++]=255&G.charAt(1),p[j++]=255&G.charAt(2),p[j++]=255&G.charAt(3)):(p[j++]=255&P.charAt(0),p[j++]=255&P.charAt(1),p[j++]=255&P.charAt(2),p[j++]=255&P.charAt(3)),W(p,j,ie+Ae+ae+_e),j+=4,W(p,j,y.VBR_seek_table.nVbrNumFrames),j+=4;var Y=y.VBR_seek_table.nBytesWritten+y.VBR_seek_table.TotalFrameSize;W(p,j,0|Y),j+=4,um.arraycopy(T,0,p,j,T.length),j+=T.length,u.error_protection&&ne.CRC_writeheader(y,p);for(var we=0,Q=0;Q<j;Q++)we=m(p[Q],we);return j+=h(u,Y,p,j,we),y.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(u,p){var y=u.internal_flags;if(y.VBR_seek_table.pos<=0||(p.seek(p.length()),p.length()==0))return-1;var T=S(p);p.seek(T);var Q=as(Ue),j=getLameTagFrame(u,Q);return j>Q.length?-1:(j<1||p.write(Q,0,j),0)}}var mm=io,cu=E.new_byte,uu=E.assert,Nt=Yf,vm=Zf,ao=Dr,hm=di,pm=am,_m=B0,gm=sm,vr=ir,ri=fi;function bm(){var B,ne;this.setModules=function(fe,ie){B=fe,ne=ie}}function Sm(){var B,ne,fe;this.setModules=function(ie,Ae,ae){B=ie,ne=Ae,fe=ae}}function ym(){}function xm(){var B,ne;this.setModules=function(fe,ie){B=fe,ne=ie}}function wm(B,ne,fe){arguments.length!=3&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),B=1,ne=44100,fe=128);var ie=new Nt,Ae=new bm,ae=new ao,_e=new ri,Fe=new vm,Ue=new hm,$=new pm,he=new mm,be=new cm,D=new xm,ee=new gm,s=new _m,P=new Sm,G=new ym;ie.setModules(ae,_e,Fe,Ue,$,he,be,D,G),_e.setModules(ae,G,be,he),D.setModules(_e,be),Fe.setModules(ie),$.setModules(_e,ee,Ue,s),Ue.setModules(s,ee,ie.enc.psy),ee.setModules(_e),s.setModules(Ue),he.setModules(ie,_e,be),Ae.setModules(P,G),P.setModules(be,D,Fe);var F=ie.lame_init();F.num_channels=B,F.in_samplerate=ne,F.brate=fe,F.mode=vr.STEREO,F.quality=3,F.bWriteVbrTag=!1,F.disable_reservoir=!0,F.write_id3tag_automatic=!1;var b=ie.lame_init_params(F);uu(b==0);var _=1152,N=0|1.25*_+7200,W=cu(N);this.encodeBuffer=function(C,f){B==1&&(f=C),uu(C.length==f.length),C.length>_&&(_=C.length,N=0|1.25*_+7200,W=cu(N));var O=ie.lame_encode_buffer(F,C,f,C.length,W,0,N);return new Int8Array(W.subarray(0,O))},this.flush=function(){var C=ie.lame_encode_flush(F,W,0,N);return new Int8Array(W.subarray(0,C))}}function zn(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function os(B){return B.charCodeAt(0)<<24|B.charCodeAt(1)<<16|B.charCodeAt(2)<<8|B.charCodeAt(3)}zn.RIFF=os("RIFF"),zn.WAVE=os("WAVE"),zn.fmt_=os("fmt "),zn.data=os("data"),zn.readHeader=function(B){var ne=new zn,fe=B.getUint32(0,!1);if(zn.RIFF==fe){var ie=B.getUint32(4,!0);if(zn.WAVE==B.getUint32(8,!1)&&zn.fmt_==B.getUint32(12,!1)){var Ae=B.getUint32(16,!0),ae=16+4;switch(Ae){case 16:case 18:ne.channels=B.getUint16(ae+2,!0),ne.sampleRate=B.getUint32(ae+4,!0);break;default:throw"extended fmt chunk not implemented"}ae+=Ae;for(var _e=zn.data,Fe=0;_e!=fe&&(fe=B.getUint32(ae,!1),Fe=B.getUint32(ae+4,!0),_e!=fe);)ae+=Fe+8;return ne.dataLen=Fe,ne.dataOffset=ae+8,ne}}};var Rm=wm,du=function(B,ne){if(!(B instanceof ne))throw new TypeError("Cannot call a class as a function")},fu=function(){function B(ne,fe){for(var ie=0;ie<fe.length;ie++){var Ae=fe[ie];Ae.enumerable=Ae.enumerable||!1,Ae.configurable=!0,"value"in Ae&&(Ae.writable=!0),Object.defineProperty(ne,Ae.key,Ae)}}return function(ne,fe,ie){return fe&&B(ne.prototype,fe),ie&&B(ne,ie),ne}}(),Tm=function(){function B(ne){du(this,B),this.config={sampleRate:44100,bitRate:128},Object.assign(this.config,ne),this.mp3Encoder=new Rm(1,this.config.sampleRate,this.config.bitRate),this.maxSamples=1152,this.samplesMono=null,this.clearBuffer()}return fu(B,[{key:"clearBuffer",value:function(){this.dataBuffer=[]}},{key:"appendToBuffer",value:function(fe){this.dataBuffer.push(new Int8Array(fe))}},{key:"floatTo16BitPCM",value:function(fe,ie){for(var Ae=0;Ae<fe.length;Ae++){var ae=Math.max(-1,Math.min(1,fe[Ae]));ie[Ae]=ae<0?ae*32768:ae*32767}}},{key:"convertBuffer",value:function(fe){var ie=new Float32Array(fe),Ae=new Int16Array(fe.length);return this.floatTo16BitPCM(ie,Ae),Ae}},{key:"encode",value:function(fe){this.samplesMono=this.convertBuffer(fe);for(var ie=this.samplesMono.length,Ae=0;ie>=0;Ae+=this.maxSamples){var ae=this.samplesMono.subarray(Ae,Ae+this.maxSamples),_e=this.mp3Encoder.encodeBuffer(ae);this.appendToBuffer(_e),ie-=this.maxSamples}}},{key:"finish",value:function(){return this.appendToBuffer(this.mp3Encoder.flush()),this.dataBuffer}}]),B}(),Em=function(){function B(ne){du(this,B),this.config={bitRate:128,startRecordingAt:300,deviceId:null},this.activeStream=null,this.context=null,this.microphone=null,this.processor=null,this.startTime=0,Object.assign(this.config,ne)}return fu(B,[{key:"addMicrophoneListener",value:function(fe){var ie=this;this.activeStream=fe,this.timerToStart=setTimeout(function(){delete ie.timerToStart},this.config.startRecordingAt),this.microphone=this.context.createMediaStreamSource(fe),this.processor=this.context.createScriptProcessor(0,1,1),this.processor.onaudioprocess=function(Ae){ie.timerToStart||ie.lameEncoder.encode(Ae.inputBuffer.getChannelData(0))},this.microphone.connect(this.processor),this.processor.connect(this.context.destination)}},{key:"stop",value:function(){return this.processor&&this.microphone&&(this.microphone.disconnect(),this.processor.disconnect(),this.context&&this.context.state!=="closed"&&this.context.close(),this.processor.onaudioprocess=null,this.activeStream.getAudioTracks().forEach(function(fe){return fe.stop()})),this}},{key:"start",value:function(){var fe=this,ie=window.AudioContext||window.webkitAudioContext;this.context=new ie,this.config.sampleRate=this.context.sampleRate,this.lameEncoder=new Tm(this.config);var Ae=this.config.deviceId?{deviceId:{exact:this.config.deviceId}}:!0;return new Promise(function(ae,_e){navigator.mediaDevices.getUserMedia({audio:Ae}).then(function(Fe){fe.addMicrophoneListener(Fe),ae(Fe)}).catch(function(Fe){_e(Fe)})})}},{key:"getMp3",value:function(){var fe=this,ie=this.lameEncoder.finish();return new Promise(function(Ae,ae){ie.length===0?ae(new Error("No buffer to send")):(Ae([ie,new Blob(ie,{type:"audio/mp3"})]),fe.lameEncoder.clearBuffer())})}}]),B}();return Em})});async function cs(){try{let t={audio:!0,video:!0};return(await navigator.mediaDevices.getUserMedia(t)).getTracks().forEach(r=>{r.stop()}),!0}catch{return!1}}async function us(){return new Promise((t,e)=>{typeof PresentationRequest>"u"&&t(!1),new PresentationRequest("receiver.html").getAvailability().then(n=>{let i=n.value;n.addEventListener("change",function(){i=n.value}),setTimeout(()=>{t(i)},1e3)}).catch(n=>e(n))})}async function An(){let t=await navigator.mediaDevices.enumerateDevices();return{cameras:t.filter(r=>r.kind=="videoinput"&&r.deviceId).map(r=>({label:r.label||"Generic Device",id:r.deviceId})),microphones:t.filter(r=>r.kind=="audioinput"&&r.deviceId).map(r=>({label:r.label||"Generic Device",id:r.deviceId}))}}var v0=wu(Mu());function Pu(t,e=100){return new Promise(r=>{function n(){t()?r():setTimeout(n,e)}n()})}var _s=class{constructor(e){this.sessionDuration=0;this.id=e,this.state="Created",this.startedAt=new Date,this.alerts=[],this.recordings=[]}get hasSomethingToUpload(){for(let e of this.recordings)if(!e.upload)return!0;return!1}start(){this.state="Recording",this.startedAt=new Date(Date.now())}pause(){this.state="Paused"}resume(){this.state="Recording"}stop(){this.state="Ended",this.sessionDuration=Date.now()-this.startedAt.getTime()}setEndConfirmed(){this.state="EndConfirmed"}setUploaded(){this.state="Uploaded"}setUploadConfirmed(){this.state="UploadConfirmed"}addAlert(e){this.alerts.push(e)}addRecording(e){this.recordings.push(e)}};function ho(t,e,r=!1){let n,i={mimeType:"video/webm;codecs=vp9",videoBitsPerSecond:128e3,audioBitsPerSecond:64e3};r&&(i={mimeType:"audio/webm",audioBitsPerSecond:64*1e3});let a=new MediaRecorder(t,i);a.ondataavailable=w=>{w.data.size>0&&e.push(w.data),r&&a.state=="inactive"&&(e=[new Blob(e,{type:"audio/mpeg-3"})]),n&&n()};function o(){return new Promise(w=>{n=w,a.start()})}function l(){return new Promise(w=>{a.state=="recording"?(n=w,a.stop(),t.getTracks().forEach(k=>{k.stop()})):w()})}function c(){return new Promise(w=>{a.state=="recording"&&a.pause(),w()})}function d(){return new Promise(w=>{a.state=="paused"&&a.resume(),w()})}return{startRecording:o,stopRecording:l,pauseRecording:c,resumeRecording:d}}function po(t,e){return function(){return t.apply(e,arguments)}}var{toString:ku}=Object.prototype,{getPrototypeOf:el}=Object,tl=(t=>e=>{let r=ku.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ni=t=>(t=t.toLowerCase(),e=>tl(e)===t),bs=t=>e=>typeof e===t,{isArray:_o}=Array,Q0=bs("undefined");function Om(t){return t!==null&&!Q0(t)&&t.constructor!==null&&!Q0(t.constructor)&&ga(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var Du=ni("ArrayBuffer");function Um(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Du(t.buffer),e}var Hm=bs("string"),ga=bs("function"),Lu=bs("number"),Nu=t=>t!==null&&typeof t=="object",Vm=t=>t===!0||t===!1,gs=t=>{if(tl(t)!=="object")return!1;let e=el(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},qm=ni("Date"),zm=ni("File"),jm=ni("Blob"),Gm=ni("FileList"),Xm=t=>Nu(t)&&ga(t.pipe),Wm=t=>{let e="[object FormData]";return t&&(typeof FormData=="function"&&t instanceof FormData||ku.call(t)===e||ga(t.toString)&&t.toString()===e)},Km=ni("URLSearchParams"),Ym=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ss(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),_o(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{let a=r?Object.getOwnPropertyNames(t):Object.keys(t),o=a.length,l;for(n=0;n<o;n++)l=a[n],e.call(null,t[l],l,t)}}function J0(){let t={},e=(r,n)=>{gs(t[n])&&gs(r)?t[n]=J0(t[n],r):gs(r)?t[n]=J0({},r):_o(r)?t[n]=r.slice():t[n]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&Ss(arguments[r],e);return t}var $m=(t,e,r,{allOwnKeys:n}={})=>(Ss(e,(i,a)=>{r&&ga(i)?t[a]=po(i,r):t[a]=i},{allOwnKeys:n}),t),Zm=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Qm=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},Jm=(t,e,r,n)=>{let i,a,o,l={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)o=i[a],(!n||n(o,t,e))&&!l[o]&&(e[o]=t[o],l[o]=!0);t=r!==!1&&el(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},ev=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},tv=t=>{if(!t)return null;if(_o(t))return t;let e=t.length;if(!Lu(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},rv=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&el(Uint8Array)),nv=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let a=i.value;e.call(t,a[0],a[1])}},iv=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},av=ni("HTMLFormElement"),ov=t=>t.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Bu=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),sv=ni("RegExp"),Fu=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};Ss(r,(i,a)=>{e(i,a,t)!==!1&&(n[a]=i)}),Object.defineProperties(t,n)},lv=t=>{Fu(t,(e,r)=>{let n=t[r];if(!!ga(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not read-only method '"+r+"'")})}})},cv=(t,e)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return _o(t)?n(t):n(String(t).split(e)),r},uv=()=>{},dv=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Re={isArray:_o,isArrayBuffer:Du,isBuffer:Om,isFormData:Wm,isArrayBufferView:Um,isString:Hm,isNumber:Lu,isBoolean:Vm,isObject:Nu,isPlainObject:gs,isUndefined:Q0,isDate:qm,isFile:zm,isBlob:jm,isRegExp:sv,isFunction:ga,isStream:Xm,isURLSearchParams:Km,isTypedArray:rv,isFileList:Gm,forEach:Ss,merge:J0,extend:$m,trim:Ym,stripBOM:Zm,inherits:Qm,toFlatObject:Jm,kindOf:tl,kindOfTest:ni,endsWith:ev,toArray:tv,forEachEntry:nv,matchAll:iv,isHTMLForm:av,hasOwnProperty:Bu,hasOwnProp:Bu,reduceDescriptors:Fu,freezeMethods:lv,toObjectSet:cv,toCamelCase:ov,noop:uv,toFiniteNumber:dv};function ba(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Re.inherits(ba,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Ou=ba.prototype,Uu={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Uu[t]={value:t}});Object.defineProperties(ba,Uu);Object.defineProperty(Ou,"isAxiosError",{value:!0});ba.from=(t,e,r,n,i,a)=>{let o=Object.create(Ou);return Re.toFlatObject(t,o,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),ba.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,a&&Object.assign(o,a),o};var kt=ba;var qu=wu(Vu(),1),zu=qu.default;function rl(t){return Re.isPlainObject(t)||Re.isArray(t)}function Gu(t){return Re.endsWith(t,"[]")?t.slice(0,-2):t}function ju(t,e,r){return t?t.concat(e).map(function(i,a){return i=Gu(i),!r&&a?"["+i+"]":i}).join(r?".":""):e}function fv(t){return Re.isArray(t)&&!t.some(rl)}var mv=Re.toFlatObject(Re,{},null,function(e){return/^is[A-Z]/.test(e)});function vv(t){return t&&Re.isFunction(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator]}function hv(t,e,r){if(!Re.isObject(t))throw new TypeError("target must be an object");e=e||new(zu||FormData),r=Re.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(K,E){return!Re.isUndefined(E[K])});let n=r.metaTokens,i=r.visitor||w,a=r.dots,o=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&vv(e);if(!Re.isFunction(i))throw new TypeError("visitor must be a function");function d(x){if(x===null)return"";if(Re.isDate(x))return x.toISOString();if(!c&&Re.isBlob(x))throw new kt("Blob is not supported. Use a Buffer instead.");return Re.isArrayBuffer(x)||Re.isTypedArray(x)?c&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function w(x,K,E){let z=x;if(x&&!E&&typeof x=="object"){if(Re.endsWith(K,"{}"))K=n?K:K.slice(0,-2),x=JSON.stringify(x);else if(Re.isArray(x)&&fv(x)||Re.isFileList(x)||Re.endsWith(K,"[]")&&(z=Re.toArray(x)))return K=Gu(K),z.forEach(function(J,Z){!(Re.isUndefined(J)||J===null)&&e.append(o===!0?ju([K],Z,a):o===null?K:K+"[]",d(J))}),!1}return rl(x)?!0:(e.append(ju(E,K,a),d(x)),!1)}let k=[],H=Object.assign(mv,{defaultVisitor:w,convertValue:d,isVisitable:rl});function V(x,K){if(!Re.isUndefined(x)){if(k.indexOf(x)!==-1)throw Error("Circular reference detected in "+K.join("."));k.push(x),Re.forEach(x,function(z,U){(!(Re.isUndefined(z)||z===null)&&i.call(e,z,Re.isString(U)?U.trim():U,K,H))===!0&&V(z,K?K.concat(U):[U])}),k.pop()}}if(!Re.isObject(t))throw new TypeError("data must be an object");return V(t),e}var gi=hv;function Xu(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Wu(t,e){this._pairs=[],t&&gi(t,this,e)}var Ku=Wu.prototype;Ku.append=function(e,r){this._pairs.push([e,r])};Ku.toString=function(e){let r=e?function(n){return e.call(this,n,Xu)}:Xu;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var ys=Wu;function pv(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function go(t,e,r){if(!e)return t;let n=r&&r.encode||pv,i=r&&r.serialize,a;if(i?a=i(e,r):a=Re.isURLSearchParams(e)?e.toString():new ys(e,r).toString(n),a){let o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}var nl=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Re.forEach(this.handlers,function(n){n!==null&&e(n)})}},il=nl;var xs={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Yu=typeof URLSearchParams<"u"?URLSearchParams:ys;var $u=FormData;var _v=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Nr={isBrowser:!0,classes:{URLSearchParams:Yu,FormData:$u,Blob},isStandardBrowserEnv:_v,protocols:["http","https","file","blob","url","data"]};function al(t,e){return gi(t,new Nr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Nr.isNode&&Re.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function gv(t){return Re.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function bv(t){let e={},r=Object.keys(t),n,i=r.length,a;for(n=0;n<i;n++)a=r[n],e[a]=t[a];return e}function Sv(t){function e(r,n,i,a){let o=r[a++],l=Number.isFinite(+o),c=a>=r.length;return o=!o&&Re.isArray(i)?i.length:o,c?(Re.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!l):((!i[o]||!Re.isObject(i[o]))&&(i[o]=[]),e(r,n,i[o],a)&&Re.isArray(i[o])&&(i[o]=bv(i[o])),!l)}if(Re.isFormData(t)&&Re.isFunction(t.entries)){let r={};return Re.forEachEntry(t,(n,i)=>{e(gv(n),i,r,0)}),r}return null}var ws=Sv;function ol(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new kt("Request failed with status code "+r.status,[kt.ERR_BAD_REQUEST,kt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}var Zu=Nr.isStandardBrowserEnv?function(){return{write:function(r,n,i,a,o,l){let c=[];c.push(r+"="+encodeURIComponent(n)),Re.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),Re.isString(a)&&c.push("path="+a),Re.isString(o)&&c.push("domain="+o),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){let n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function sl(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function ll(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function bo(t,e){return t&&!sl(e)?ll(t,e):e}var Qu=Nr.isStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function i(a){let o=a;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(o){let l=Re.isString(o)?i(o):o;return l.protocol===n.protocol&&l.host===n.host}}():function(){return function(){return!0}}();function Ju(t,e,r){kt.call(this,t??"canceled",kt.ERR_CANCELED,e,r),this.name="CanceledError"}Re.inherits(Ju,kt,{__CANCEL__:!0});var bi=Ju;function cl(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var yv=Re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),e1=t=>{let e={},r,n,i;return t&&t.split(`
15
+ `).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||e[r]&&yv[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e};var t1=Symbol("internals"),n1=Symbol("defaults");function yo(t){return t&&String(t).trim().toLowerCase()}function Rs(t){return t===!1||t==null?t:Re.isArray(t)?t.map(Rs):String(t)}function xv(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}function r1(t,e,r,n){if(Re.isFunction(n))return n.call(this,e,r);if(!!Re.isString(e)){if(Re.isString(n))return e.indexOf(n)!==-1;if(Re.isRegExp(n))return n.test(e)}}function wv(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Rv(t,e){let r=Re.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,a,o){return this[n].call(this,e,i,a,o)},configurable:!0})})}function So(t,e){e=e.toLowerCase();let r=Object.keys(t),n=r.length,i;for(;n-- >0;)if(i=r[n],e===i.toLowerCase())return i;return null}function Sa(t,e){t&&this.set(t),this[n1]=e||null}Object.assign(Sa.prototype,{set:function(t,e,r){let n=this;function i(a,o,l){let c=yo(o);if(!c)throw new Error("header name must be a non-empty string");let d=So(n,c);d&&l!==!0&&(n[d]===!1||l===!1)||(n[d||o]=Rs(a))}return Re.isPlainObject(t)?Re.forEach(t,(a,o)=>{i(a,o,e)}):i(e,t,r),this},get:function(t,e){if(t=yo(t),!t)return;let r=So(this,t);if(r){let n=this[r];if(!e)return n;if(e===!0)return xv(n);if(Re.isFunction(e))return e.call(this,n,r);if(Re.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}},has:function(t,e){if(t=yo(t),t){let r=So(this,t);return!!(r&&(!e||r1(this,this[r],r,e)))}return!1},delete:function(t,e){let r=this,n=!1;function i(a){if(a=yo(a),a){let o=So(r,a);o&&(!e||r1(r,r[o],o,e))&&(delete r[o],n=!0)}}return Re.isArray(t)?t.forEach(i):i(t),n},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(t){let e=this,r={};return Re.forEach(this,(n,i)=>{let a=So(r,i);if(a){e[a]=Rs(n),delete e[i];return}let o=t?wv(i):String(i).trim();o!==i&&delete e[i],e[o]=Rs(n),r[o]=!0}),this},toJSON:function(t){let e=Object.create(null);return Re.forEach(Object.assign({},this[n1]||null,this),(r,n)=>{r==null||r===!1||(e[n]=t&&Re.isArray(r)?r.join(", "):r)}),e}});Object.assign(Sa,{from:function(t){return Re.isString(t)?new this(e1(t)):t instanceof this?t:new this(t)},accessor:function(t){let r=(this[t1]=this[t1]={accessors:{}}).accessors,n=this.prototype;function i(a){let o=yo(a);r[o]||(Rv(n,a),r[o]=!0)}return Re.isArray(t)?t.forEach(i):i(t),this}});Sa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]);Re.freezeMethods(Sa.prototype);Re.freezeMethods(Sa);var Cn=Sa;function Tv(t,e){t=t||10;let r=new Array(t),n=new Array(t),i=0,a=0,o;return e=e!==void 0?e:1e3,function(c){let d=Date.now(),w=n[a];o||(o=d),r[i]=c,n[i]=d;let k=a,H=0;for(;k!==i;)H+=r[k++],k=k%t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),d-o<e)return;let V=w&&d-w;return V?Math.round(H*1e3/V):void 0}}var i1=Tv;function a1(t,e){let r=0,n=i1(50,250);return i=>{let a=i.loaded,o=i.lengthComputable?i.total:void 0,l=a-r,c=n(l),d=a<=o;r=a;let w={loaded:a,total:o,progress:o?a/o:void 0,bytes:l,rate:c||void 0,estimated:c&&o&&d?(o-a)/c:void 0};w[e?"download":"upload"]=!0,t(w)}}function xo(t){return new Promise(function(r,n){let i=t.data,a=Cn.from(t.headers).normalize(),o=t.responseType,l;function c(){t.cancelToken&&t.cancelToken.unsubscribe(l),t.signal&&t.signal.removeEventListener("abort",l)}Re.isFormData(i)&&Nr.isStandardBrowserEnv&&a.setContentType(!1);let d=new XMLHttpRequest;if(t.auth){let V=t.auth.username||"",x=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(V+":"+x))}let w=bo(t.baseURL,t.url);d.open(t.method.toUpperCase(),go(w,t.params,t.paramsSerializer),!0),d.timeout=t.timeout;function k(){if(!d)return;let V=Cn.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),K={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:V,config:t,request:d};ol(function(z){r(z),c()},function(z){n(z),c()},K),d=null}if("onloadend"in d?d.onloadend=k:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(k)},d.onabort=function(){!d||(n(new kt("Request aborted",kt.ECONNABORTED,t,d)),d=null)},d.onerror=function(){n(new kt("Network Error",kt.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let x=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",K=t.transitional||xs;t.timeoutErrorMessage&&(x=t.timeoutErrorMessage),n(new kt(x,K.clarifyTimeoutError?kt.ETIMEDOUT:kt.ECONNABORTED,t,d)),d=null},Nr.isStandardBrowserEnv){let V=(t.withCredentials||Qu(w))&&t.xsrfCookieName&&Zu.read(t.xsrfCookieName);V&&a.set(t.xsrfHeaderName,V)}i===void 0&&a.setContentType(null),"setRequestHeader"in d&&Re.forEach(a.toJSON(),function(x,K){d.setRequestHeader(K,x)}),Re.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),o&&o!=="json"&&(d.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&d.addEventListener("progress",a1(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",a1(t.onUploadProgress)),(t.cancelToken||t.signal)&&(l=V=>{!d||(n(!V||V.type?new bi(null,t,d):V),d.abort(),d=null)},t.cancelToken&&t.cancelToken.subscribe(l),t.signal&&(t.signal.aborted?l():t.signal.addEventListener("abort",l)));let H=cl(w);if(H&&Nr.protocols.indexOf(H)===-1){n(new kt("Unsupported protocol "+H+":",kt.ERR_BAD_REQUEST,t));return}d.send(i||null)})}var o1={http:xo,xhr:xo},ul={getAdapter:t=>{if(Re.isString(t)){let e=o1[t];if(!t)throw Error(Re.hasOwnProp(t)?`Adapter '${t}' is not available in the build`:`Can not resolve adapter '${t}'`);return e}if(!Re.isFunction(t))throw new TypeError("adapter is not a function");return t},adapters:o1};var Ev={"Content-Type":"application/x-www-form-urlencoded"};function Av(){let t;return typeof XMLHttpRequest<"u"?t=ul.getAdapter("xhr"):typeof process<"u"&&Re.kindOf(process)==="process"&&(t=ul.getAdapter("http")),t}function Cv(t,e,r){if(Re.isString(t))try{return(e||JSON.parse)(t),Re.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var Ts={transitional:xs,adapter:Av(),transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=Re.isObject(e);if(a&&Re.isHTMLForm(e)&&(e=new FormData(e)),Re.isFormData(e))return i&&i?JSON.stringify(ws(e)):e;if(Re.isArrayBuffer(e)||Re.isBuffer(e)||Re.isStream(e)||Re.isFile(e)||Re.isBlob(e))return e;if(Re.isArrayBufferView(e))return e.buffer;if(Re.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return al(e,this.formSerializer).toString();if((l=Re.isFileList(e))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return gi(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),Cv(e)):e}],transformResponse:[function(e){let r=this.transitional||Ts.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&Re.isString(e)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(l){if(o)throw l.name==="SyntaxError"?kt.from(l,kt.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Nr.classes.FormData,Blob:Nr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Re.forEach(["delete","get","head"],function(e){Ts.headers[e]={}});Re.forEach(["post","put","patch"],function(e){Ts.headers[e]=Re.merge(Ev)});var ya=Ts;function wo(t,e){let r=this||ya,n=e||r,i=Cn.from(n.headers),a=n.data;return Re.forEach(t,function(l){a=l.call(r,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function Ro(t){return!!(t&&t.__CANCEL__)}function dl(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new bi}function Es(t){return dl(t),t.headers=Cn.from(t.headers),t.data=wo.call(t,t.transformRequest),(t.adapter||ya.adapter)(t).then(function(n){return dl(t),n.data=wo.call(t,t.transformResponse,n),n.headers=Cn.from(n.headers),n},function(n){return Ro(n)||(dl(t),n&&n.response&&(n.response.data=wo.call(t,t.transformResponse,n.response),n.response.headers=Cn.from(n.response.headers))),Promise.reject(n)})}function Si(t,e){e=e||{};let r={};function n(d,w){return Re.isPlainObject(d)&&Re.isPlainObject(w)?Re.merge(d,w):Re.isPlainObject(w)?Re.merge({},w):Re.isArray(w)?w.slice():w}function i(d){if(Re.isUndefined(e[d])){if(!Re.isUndefined(t[d]))return n(void 0,t[d])}else return n(t[d],e[d])}function a(d){if(!Re.isUndefined(e[d]))return n(void 0,e[d])}function o(d){if(Re.isUndefined(e[d])){if(!Re.isUndefined(t[d]))return n(void 0,t[d])}else return n(void 0,e[d])}function l(d){if(d in e)return n(t[d],e[d]);if(d in t)return n(void 0,t[d])}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l};return Re.forEach(Object.keys(t).concat(Object.keys(e)),function(w){let k=c[w]||i,H=k(w);Re.isUndefined(H)&&k!==l||(r[w]=H)}),r}var As="1.1.3";var fl={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{fl[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var s1={};fl.transitional=function(e,r,n){function i(a,o){return"[Axios v"+As+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,l)=>{if(e===!1)throw new kt(i(o," has been removed"+(r?" in "+r:"")),kt.ERR_DEPRECATED);return r&&!s1[o]&&(s1[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,o,l):!0}};function Iv(t,e,r){if(typeof t!="object")throw new kt("options must be an object",kt.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),i=n.length;for(;i-- >0;){let a=n[i],o=e[a];if(o){let l=t[a],c=l===void 0||o(l,a,t);if(c!==!0)throw new kt("option "+a+" must be "+c,kt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new kt("Unknown option "+a,kt.ERR_BAD_OPTION)}}var Cs={assertOptions:Iv,validators:fl};var yi=Cs.validators,xa=class{constructor(e){this.defaults=e,this.interceptors={request:new il,response:new il}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=Si(this.defaults,r);let{transitional:n,paramsSerializer:i}=r;n!==void 0&&Cs.assertOptions(n,{silentJSONParsing:yi.transitional(yi.boolean),forcedJSONParsing:yi.transitional(yi.boolean),clarifyTimeoutError:yi.transitional(yi.boolean)},!1),i!==void 0&&Cs.assertOptions(i,{encode:yi.function,serialize:yi.function},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=r.headers&&Re.merge(r.headers.common,r.headers[r.method]);a&&Re.forEach(["delete","get","head","post","put","patch","common"],function(x){delete r.headers[x]}),r.headers=new Cn(r.headers,a);let o=[],l=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(l=l&&x.synchronous,o.unshift(x.fulfilled,x.rejected))});let c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let d,w=0,k;if(!l){let V=[Es.bind(this),void 0];for(V.unshift.apply(V,o),V.push.apply(V,c),k=V.length,d=Promise.resolve(r);w<k;)d=d.then(V[w++],V[w++]);return d}k=o.length;let H=r;for(w=0;w<k;){let V=o[w++],x=o[w++];try{H=V(H)}catch(K){x.call(this,K);break}}try{d=Es.call(this,H)}catch(V){return Promise.reject(V)}for(w=0,k=c.length;w<k;)d=d.then(c[w++],c[w++]);return d}getUri(e){e=Si(this.defaults,e);let r=bo(e.baseURL,e.url);return go(r,e.params,e.paramsSerializer)}};Re.forEach(["delete","get","head","options"],function(e){xa.prototype[e]=function(r,n){return this.request(Si(n||{},{method:e,url:r,data:(n||{}).data}))}});Re.forEach(["post","put","patch"],function(e){function r(n){return function(a,o,l){return this.request(Si(l||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}xa.prototype[e]=r(),xa.prototype[e+"Form"]=r(!0)});var To=xa;var Eo=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});let n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a,o=new Promise(l=>{n.subscribe(l),a=l}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},e(function(a,o,l){n.reason||(n.reason=new bi(a,o,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new Eo(function(i){e=i}),cancel:e}}},l1=Eo;function ml(t){return function(r){return t.apply(null,r)}}function vl(t){return Re.isObject(t)&&t.isAxiosError===!0}function c1(t){let e=new To(t),r=po(To.prototype.request,e);return Re.extend(r,To.prototype,e,{allOwnKeys:!0}),Re.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return c1(Si(t,i))},r}var Wr=c1(ya);Wr.Axios=To;Wr.CanceledError=bi;Wr.CancelToken=l1;Wr.isCancel=Ro;Wr.VERSION=As;Wr.toFormData=gi;Wr.AxiosError=kt;Wr.Cancel=Wr.CanceledError;Wr.all=function(e){return Promise.all(e)};Wr.spread=ml;Wr.isAxiosError=vl;Wr.formToJSON=t=>ws(Re.isHTMLForm(t)?new FormData(t):t);var hl=Wr;var{Axios:Q_,AxiosError:J_,CanceledError:e3,isCancel:t3,CancelToken:r3,VERSION:n3,all:i3,Cancel:a3,isAxiosError:o3,spread:s3,toFormData:l3}=hl,wa=hl;var u1={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5};var In="function",Kr="object",Mn="undefined",nr="prototype",Ao="hasOwnProperty";var tn=Object,Ra=tn[nr],Ta=tn.assign,Is=tn.create,Ms=tn.defineProperty,xi=Ra[Ao];var Ea=null;function hn(t){return t===void 0&&(t=!0),(!Ea||!t)&&(typeof globalThis!==Mn&&globalThis&&(Ea=globalThis),typeof self!==Mn&&self&&(Ea=self),typeof window!==Mn&&window&&(Ea=window),typeof global!==Mn&&global&&(Ea=global)),Ea}function Aa(t){throw new TypeError(t)}function Ca(t){var e=Is;if(e)return e(t);if(t==null)return{};var r=typeof t;r!==Kr&&r!==In&&Aa("Object prototype may only be an Object:"+t);function n(){}return n[nr]=t,new n}var p3=(hn()||{}).Symbol,_3=(hn()||{}).Reflect;var Pv=function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Ra[Ao].call(e,i)&&(t[i]=e[i])}return t},ur=Ta||Pv,pl=function(t,e){return pl=tn.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n[Ao](i)&&(r[i]=n[i])},pl(t,e)};function pt(t,e){typeof e!==In&&e!==null&&Aa("Class extends value "+String(e)+" is not a constructor or null"),pl(t,e);function r(){this.constructor=t}t[nr]=e===null?Ca(e):(r[nr]=e[nr],new r)}function Ps(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t}var Bs="constructor",ii="prototype",ks="function",Ds="_dynInstFuncs",bl="_isDynProxy",Ia="_dynClass",Bv="_dynCls$",Sl="_dynInstChk",Co=Sl,v1="_dfOpts",d1="_unknown_",kv="__proto__",_l="useBaseInst",f1="setInstFuncs",Fs=Object,Io=Fs.getPrototypeOf,m1=0;function wi(t,e){return t&&Fs[ii].hasOwnProperty.call(t,e)}function h1(t){return t&&(t===Fs[ii]||t===Array[ii])}function yl(t){return h1(t)||t===Function[ii]}function Xi(t){if(t){if(Io)return Io(t);var e=t[kv]||t[ii]||(t[Bs]?t[Bs][ii]:null);if(e)return e}return null}function Ls(t,e){var r=[],n=Fs.getOwnPropertyNames;if(n)r=n(t);else for(var i in t)typeof i=="string"&&wi(t,i)&&r.push(i);if(r&&r.length>0)for(var a=0;a<r.length;a++)e(r[a])}function xl(t,e,r){return e!==Bs&&typeof t[e]===ks&&(r||wi(t,e))}function Ns(t){throw new TypeError("DynamicProto: "+t)}function Dv(t){var e={};return Ls(t,function(r){!e[r]&&xl(t,r,!1)&&(e[r]=t[r])}),e}function wl(t,e){for(var r=t.length-1;r>=0;r--)if(t[r]===e)return!0;return!1}function Lv(t,e,r,n){function i(c,d,w){var k=d[w];if(k[bl]&&n){var H=c[Ds]||{};H[Co]!==!1&&(k=(H[d[Ia]]||{})[w]||k)}return function(){return k.apply(c,arguments)}}var a={};Ls(r,function(c){a[c]=i(e,r,c)});for(var o=Xi(t),l=[];o&&!yl(o)&&!wl(l,o);)Ls(o,function(c){!a[c]&&xl(o,c,!Io)&&(a[c]=i(e,o,c))}),l.push(o),o=Xi(o);return a}function Nv(t,e,r,n){var i=null;if(t&&wi(r,Ia)){var a=t[Ds]||{};if(i=(a[r[Ia]]||{})[e],i||Ns("Missing ["+e+"] "+ks),!i[Sl]&&a[Co]!==!1){for(var o=!wi(t,e),l=Xi(t),c=[];o&&l&&!yl(l)&&!wl(c,l);){var d=l[e];if(d){o=d===n;break}c.push(l),l=Xi(l)}try{o&&(t[e]=i),i[Sl]=1}catch{a[Co]=!1}}}return i}function Fv(t,e,r){var n=e[t];return n===r&&(n=Xi(e)[t]),typeof n!==ks&&Ns("["+t+"] is not a "+ks),n}function Ov(t,e,r,n,i){function a(c,d){var w=function(){var k=Nv(this,d,c,w)||Fv(d,c,w);return k.apply(this,arguments)};return w[bl]=1,w}if(!h1(t)){var o=r[Ds]=r[Ds]||{},l=o[e]=o[e]||{};o[Co]!==!1&&(o[Co]=!!i),Ls(r,function(c){xl(r,c,!1)&&r[c]!==n[c]&&(l[c]=r[c],delete r[c],(!wi(t,c)||t[c]&&!t[c][bl])&&(t[c]=a(t,c)))})}}function Uv(t,e){if(Io)for(var r=[],n=Xi(e);n&&!yl(n)&&!wl(r,n);){if(n===t)return!0;r.push(n),n=Xi(n)}return!1}function gl(t,e){return wi(t,ii)?t.name||e||d1:((t||{})[Bs]||{}).name||e||d1}function Rl(t,e,r,n){wi(t,ii)||Ns("theClass is an invalid class definition.");var i=t[ii];Uv(i,e)||Ns("["+gl(t)+"] is not in class hierarchy of ["+gl(e)+"]");var a=null;wi(i,Ia)?a=i[Ia]:(a=Bv+gl(t,"_")+"$"+m1,m1++,i[Ia]=a);var o=Rl[v1],l=!!o[_l];l&&n&&n[_l]!==void 0&&(l=!!n[_l]);var c=Dv(e),d=Lv(i,e,c,l);r(e,d);var w=!!Io&&!!o[f1];w&&n&&(w=!!n[f1]),Ov(i,a,e,c,w!==!1)}var Hv={setInstFuncs:!0,useBaseInst:!0};Rl[v1]=Hv;var Tt=Rl;var Ne;(function(t){t[t.CRITICAL=1]="CRITICAL",t[t.WARNING=2]="WARNING"})(Ne||(Ne={}));var Ie={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105};var Vv="on",p1="attachEvent",_1="addEventListener";var T1="toISOString",E1="endsWith",qv="startsWith",g1="indexOf",b1="map",S1="reduce",El="trim",A1="toString",zv="__proto__",jv="constructor",y1=Ms,V3=tn.freeze,q3=tn.seal,x1=tn.keys,Al=String[nr],Gv=Al[El],Xv=Al[E1],z3=Al[qv],Wv=Date[nr],Kv=Wv[T1],Yv=Array.isArray,C1=Ra[A1],$v=xi[A1],j3=$v.call(tn),Zv=/-([a-z])/g,Qv=/([^\w\d_$])/g,Jv=/^(\d+[\w\d_$])/,w1=Object.getPrototypeOf;function I1(t){if(t){if(w1)return w1(t);var e=t[zv]||t[nr]||t[jv];if(e)return e}return null}function or(t){return t===void 0||typeof t===Mn}function Oe(t){return t===null||or(t)}function Cl(t){return!Oe(t)}function Mo(t,e){return!!(t&&xi.call(t,e))}function Pn(t){return!!(t&&typeof t===Kr)}function dt(t){return!!(t&&typeof t===In)}function Bn(t,e,r,n){n===void 0&&(n=!1);var i=!1;if(!Oe(t))try{Oe(t[_1])?Oe(t[p1])||(t[p1](Vv+e,r),i=!0):(t[_1](e,r,n),i=!0)}catch{}return i}function Il(t){var e=t;return e&&at(e)&&(e=e.replace(Zv,function(r,n){return n.toUpperCase()}),e=e.replace(Qv,"_"),e=e.replace(Jv,function(r,n){return"_"+n})),e}function Lt(t,e){if(t)for(var r in t)xi.call(t,r)&&e.call(t,r,t[r])}function Ml(t,e){var r=!1;return t&&e&&!(r=t===e)&&(r=Xv?t[E1](e):eh(t,e)),r}function eh(t,e){var r=!1,n=e?e.length:0,i=t?t.length:0;if(n&&i&&i>=n&&!(r=t===e)){for(var a=i-1,o=n-1;o>=0;o--){if(t[a]!=e[o])return!1;a--}r=!0}return r}function Sr(t,e){return t&&e?t.indexOf(e)!==-1:!1}var yr=Yv||th;function th(t){return!!(t&&C1.call(t)==="[object Array]")}function Ma(t){return!!(t&&C1.call(t)==="[object Error]")}function at(t){return typeof t=="string"}function Pa(t){return typeof t=="number"}function Fr(t){if(t)return Kv?t[T1]():rh(t)}function rh(t){if(t&&t.getUTCFullYear){var e=function(r){var n=String(r);return n.length===1&&(n="0"+n),n};return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"."+String((t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}function ot(t,e,r){var n=t.length;try{for(var i=0;i<n&&!(i in t&&e.call(r||t,t[i],i,t)===-1);i++);}catch{}}function Kn(t,e,r){if(t){if(t[g1])return t[g1](e,r);var n=t.length,i=r||0;try{for(var a=Math.max(i>=0?i:n-Math.abs(i),0);a<n;a++)if(a in t&&t[a]===e)return a}catch{}}return-1}function Wi(t,e,r){var n;if(t){if(t[b1])return t[b1](e,r);var i=t.length,a=r||t;n=new Array(i);try{for(var o=0;o<i;o++)o in t&&(n[o]=e.call(a,t[o],t))}catch{}}return n}function Os(t,e,r){var n;if(t){if(t[S1])return t[S1](e,r);var i=t.length,a=0;if(arguments.length>=3)n=arguments[2];else{for(;a<i&&!(a in t);)a++;n=t[a++]}for(;a<i;)a in t&&(n=e(n,t[a],a,t)),a++}return n}function dr(t){return t&&(t=Gv&&t[El]?t[El]():t.replace?t.replace(/^\s+|\s+$/g,""):t),t}var R1=!{toString:null}.propertyIsEnumerable("toString"),Tl=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function pn(t){var e=typeof t;if(e!==In&&(e!==Kr||t===null)&&Aa("objKeys called on non-object"),!R1&&x1)return x1(t);var r=[];for(var n in t)t&&xi.call(t,n)&&r.push(n);if(R1)for(var i=Tl.length,a=0;a<i;a++)t&&xi.call(t,Tl[a])&&r.push(Tl[a]);return r}function Ri(t,e,r,n){if(y1)try{var i={enumerable:!0,configurable:!0};return r&&(i.get=r),n&&(i.set=n),y1(t,e,i),!0}catch{}return!1}function xr(){var t=Date;return t.now?t.now():new t().getTime()}function wt(t){return Ma(t)?t.name:""}function xt(t,e,r,n,i){var a=r;return t&&(a=t[e],a!==r&&(!i||i(a))&&(!n||n(r))&&(a=r,t[e]=a)),a}function wr(t,e,r){var n;return t?(n=t[e],!n&&Oe(n)&&(n=or(r)?{}:r,t[e]=n)):n=or(r)?{}:r,n}function Us(t){return!t}function Ba(t){return!!t}function Br(t){throw new Error(t)}function Pl(t,e,r){if(t&&e&&t!==e&&Pn(t)&&Pn(e)){var n=function(a){if(at(a)){var o=e[a];dt(o)?(!r||r(a,!0,e,t))&&(t[a]=function(l){return function(){var c=arguments;return e[l].apply(e,c)}}(a)):(!r||r(a,!1,e,t))&&(Mo(t,a)&&delete t[a],Ri(t,a,function(){return e[a]},function(l){e[a]=l})||(t[a]=o))}};for(var i in e)n(i)}return t}function Bl(t){return function(){function e(){var r=this;t&&Lt(t,function(n,i){r[n]=i})}return e}()}function Hs(t){return t&&Ta&&(t=tn(Ta({},t))),t}var M1="window",nh="document",ih="documentMode",ah="navigator",oh="history",sh="location",lh="console",ch="performance",P1="JSON",uh="crypto",dh="msCrypto",fh="ReactNative",Nl="msie",Fl="trident/",kl=null,Dl=null,mh=!1,ka=null,Ll=null;function B1(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[nr];n&&(r=e in n)}}catch{}if(!r)try{var i=new t;r=!or(i[e])}catch{}}return r}function fr(t){var e=hn();return e&&e[t]?e[t]:t===M1&&Ki()?window:null}function Ki(){return Boolean(typeof window===Kr&&window)}function Yn(){return Ki()?window:fr(M1)}function Vs(){return Boolean(typeof document===Kr&&document)}function pr(){return Vs()?document:fr(nh)}function Ol(){return Boolean(typeof navigator===Kr&&navigator)}function kr(){return Ol()?navigator:fr(ah)}function k1(){return Boolean(typeof history===Kr&&history)}function Ul(){return k1()?history:fr(oh)}function rn(t){if(t&&mh){var e=fr("__mockLocation");if(e)return e}return typeof location===Kr&&location?location:fr(sh)}function Hl(){return typeof console!==Mn?console:fr(lh)}function nn(){return fr(ch)}function kn(){return Boolean(typeof JSON===Kr&&JSON||fr(P1)!==null)}function Rr(){return kn()?JSON||fr(P1):null}function Vl(){return fr(uh)}function ql(){return fr(dh)}function zl(){var t=kr();return t&&t.product?t.product===fh:!1}function Yi(){var t=kr();if(t&&(t.userAgent!==Dl||kl===null)){Dl=t.userAgent;var e=(Dl||"").toLowerCase();kl=Sr(e,Nl)||Sr(e,Fl)}return kl}function Da(t){if(t===void 0&&(t=null),!t){var e=kr()||{};t=e?(e.userAgent||"").toLowerCase():""}var r=(t||"").toLowerCase();if(Sr(r,Nl)){var n=pr()||{};return Math.max(parseInt(r.split(Nl)[1]),n[ih]||0)}else if(Sr(r,Fl)){var i=parseInt(r.split(Fl)[1]);if(i)return i+4}return null}function ct(t){var e=Object[nr].toString.call(t),r="";return e==="[object Error]"?r="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t.name+"'":kn()&&(r=Rr().stringify(t)),e+r}function $i(){return Ll===null&&(Ll=Ol()&&Boolean(kr().sendBeacon)),Ll}function qs(t){var e=!1;try{var r=fr("fetch");e=!!r;var n=fr("Request");e&&t&&n&&(e=B1(n,"keepalive"))}catch{}return e}function zs(){return ka===null&&(ka=typeof XDomainRequest<"u",ka&&Zi()&&(ka=ka&&!B1(fr("XMLHttpRequest"),"withCredentials"))),ka}function Zi(){var t=!1;try{var e=fr("XMLHttpRequest");t=!!e}catch{}return t}var jl=["eventsSent","eventsDiscarded","eventsSendRequest","perfEvent"],Gs=null,js;function vh(t,e){return function(){var r=arguments,n=Gl(e);if(n){var i=n.listener;i&&i[t]&&i[t].apply(i,r)}}}function hh(){var t=fr("Microsoft");return t&&(Gs=t.ApplicationInsights),Gs}function Gl(t){var e=Gs;return!e&&t.disableDbgExt!==!0&&(e=Gs||hh()),e?e.ChromeDbgExt:null}function D1(t){if(!js){js={};for(var e=0;e<jl.length;e++)js[jl[e]]=vh(jl[e],t)}return js}var ph="AI (Internal): ",_h="AI: ",gh="AITR_",bh="errorToConsole",Sh="warnToConsole";function L1(t){return t?'"'+t.replace(/\"/g,"")+'"':""}function N1(t,e){var r=Hl();if(r){var n="log";r[t]&&(n=t),dt(r[n])&&r[n](e)}}var ai=function(){function t(e,r,n,i){n===void 0&&(n=!1);var a=this;a.messageId=e,a.message=(n?_h:ph)+e;var o="";kn()&&(o=Rr().stringify(i));var l=(r?" message:"+L1(r):"")+(i?" props:"+L1(o):"");a.message+=l}return t.dataType="MessageData",t}();function oi(t,e){return(t||{}).logger||new La(e)}var La=function(){function t(e){this.identifier="DiagnosticLogger",this.queue=[];var r=0,n={};Tt(t,this,function(i){Oe(e)&&(e={}),i.consoleLoggingLevel=function(){return a("loggingLevelConsole",0)},i.telemetryLoggingLevel=function(){return a("loggingLevelTelemetry",1)},i.maxInternalMessageLimit=function(){return a("maxMessageLimit",25)},i.enableDebugExceptions=function(){return a("enableDebugExceptions",!1)},i.throwInternal=function(c,d,w,k,H){H===void 0&&(H=!1);var V=new ai(d,w,H,k);if(i.enableDebugExceptions())throw V;var x=c===Ne.CRITICAL?bh:Sh;if(or(V.message))l("throw"+(c===Ne.CRITICAL?"Critical":"Warning"),V);else{var K=i.consoleLoggingLevel();if(H){var E=+V.messageId;!n[E]&&K>=c&&(i[x](V.message),n[E]=!0)}else K>=c&&i[x](V.message);i.logInternalMessage(c,V)}},i.warnToConsole=function(c){N1("warn",c),l("warning",c)},i.errorToConsole=function(c){N1("error",c),l("error",c)},i.resetInternalMessageCount=function(){r=0,n={}},i.logInternalMessage=function(c,d){if(!o()){var w=!0,k=gh+d.messageId;if(n[k]?w=!1:n[k]=!0,w&&(c<=i.telemetryLoggingLevel()&&(i.queue.push(d),r++,l(c===Ne.CRITICAL?"error":"warn",d)),r===i.maxInternalMessageLimit())){var H="Internal events throttle limit per PageView reached for this app.",V=new ai(Ie.MessageLimitPerPVExceeded,H,!1);i.queue.push(V),c===Ne.CRITICAL?i.errorToConsole(H):i.warnToConsole(H)}}};function a(c,d){var w=e[c];return Oe(w)?d:w}function o(){return r>=i.maxInternalMessageLimit()}function l(c,d){var w=Gl(e);w&&w.diagLog&&w.diagLog(c,d)}})}return t}();var Na="ctx",yh=null,Po=function(){function t(e,r,n){var i=this,a=!1;if(i.start=xr(),i.name=e,i.isAsync=n,i.isChildEvt=function(){return!1},dt(r)){var o;a=Ri(i,"payload",function(){return!o&&dt(r)&&(o=r(),r=null),o})}i.getCtx=function(l){return l?l===t.ParentContextKey||l===t.ChildrenContextKey?i[l]:(i[Na]||{})[l]:null},i.setCtx=function(l,c){if(l)if(l===t.ParentContextKey)i[l]||(i.isChildEvt=function(){return!0}),i[l]=c;else if(l===t.ChildrenContextKey)i[l]=c;else{var d=i[Na]=i[Na]||{};d[l]=c}},i.complete=function(){var l=0,c=i.getCtx(t.ChildrenContextKey);if(yr(c))for(var d=0;d<c.length;d++){var w=c[d];w&&(l+=w.time)}i.time=xr()-i.start,i.exTime=i.time-l,i.complete=function(){},!a&&dt(r)&&(i.payload=r())}}return t.ParentContextKey="parent",t.ChildrenContextKey="childEvts",t}();var Wl=function(){function t(e){this.ctx={},Tt(t,this,function(r){r.create=function(n,i,a){return new Po(n,i,a)},r.fire=function(n){n&&(n.complete(),e&&dt(e.perfEvent)&&e.perfEvent(n))},r.setCtx=function(n,i){if(n){var a=r[Na]=r[Na]||{};a[n]=i}},r.getCtx=function(n){return(r[Na]||{})[n]}})}return t}();var Xl="CoreUtils.doPerf";function $n(t,e,r,n,i){if(t){var a=t;if(dt(a.getPerfMgr)&&(a=a.getPerfMgr()),a){var o=void 0,l=a.getCtx(Xl);try{if(o=a.create(e(),n,i),o){if(l&&o.setCtx&&(o.setCtx(Po.ParentContextKey,l),l.getCtx&&l.setCtx)){var c=l.getCtx(Po.ChildrenContextKey);c||(c=[],l.setCtx(Po.ChildrenContextKey,c)),c.push(o)}return a.setCtx(Xl,o),r(o)}}catch(d){o&&o.setCtx&&o.setCtx("exception",d)}finally{o&&a.fire(o),a.setCtx(Xl,l)}}}return r()}function Kl(){return yh}var F1=function(){function t(e,r){var n=this,i=null,a=dt(e.processTelemetry),o=dt(e.setNextPlugin);n._hasRun=!1,n.getPlugin=function(){return e},n.getNext=function(){return i},n.setNext=function(l){i=l},n.processTelemetry=function(l,c){c||(c=r);var d=e?e.identifier:"TelemetryPluginChain";$n(c?c.core():null,function(){return d+":processTelemetry"},function(){if(e&&a){n._hasRun=!0;try{c.setNext(i),o&&e.setNextPlugin(i),i&&(i._hasRun=!1),e.processTelemetry(l,c)}catch(k){var w=i&&i._hasRun;(!i||!w)&&c.diagLog().throwInternal(Ne.CRITICAL,Ie.PluginException,"Plugin ["+e.identifier+"] failed during processTelemetry - "+ct(k)),i&&!w&&i.processTelemetry(l,c)}}else i&&(n._hasRun=!0,i.processTelemetry(l,c))},function(){return{item:l}},!l.sync)}}return t}();function Yl(t,e){var r=[];if(t&&t.length>0)for(var n=null,i=0;i<t.length;i++){var a=t[i];if(a&&dt(a.processTelemetry)){var o=new F1(a,e);r.push(o),n&&n.setNext(o),n=o}}return r.length>0?r[0]:null}function xh(t,e,r){var n=[],i=!r;if(t)for(;t;){var a=t.getPlugin();(i||a===r)&&(i=!0,n.push(a)),t=t.getNext()}return i||n.push(r),Yl(n,e)}function wh(t,e,r){var n=t,i=!1;return r&&t&&(n=[],ot(t,function(a){(i||a===r)&&(i=!0,n.push(a))})),r&&!i&&(n||(n=[]),n.push(r)),Yl(n,e)}var si=function(){function t(e,r,n,i){var a=this,o=null;i!==null&&(e&&dt(e.getPlugin)?o=xh(e,a,i||e.getPlugin()):i?o=wh(e,a,i):or(i)&&(o=Yl(e,a))),a.core=function(){return n},a.diagLog=function(){return oi(n,r)},a.getCfg=function(){return r},a.getExtCfg=function(l,c){c===void 0&&(c={});var d;if(r){var w=r.extensionConfig;w&&l&&(d=w[l])}return d||c},a.getConfig=function(l,c,d){d===void 0&&(d=!1);var w,k=a.getExtCfg(l,null);return k&&!Oe(k[c])?w=k[c]:r&&!Oe(r[c])&&(w=r[c]),Oe(w)?d:w},a.hasNext=function(){return o!=null},a.getNext=function(){return o},a.setNext=function(l){o=l},a.processNext=function(l){var c=o;c&&(o=c.getNext(),c.processTelemetry(l,a))},a.createNew=function(l,c){return l===void 0&&(l=null),new t(l||o,r,n,c)}}return t}();var O1="iKey",Xs="extensionConfig";var Ws="getPlugin",Dn=function(){function t(){var e=this,r=!1,n=null,i=null;e.core=null,e.diagLog=function(a){return e._getTelCtx(a).diagLog()},e.isInitialized=function(){return r},e.setInitialized=function(a){r=a},e.setNextPlugin=function(a){i=a},e.processNext=function(a,o){o?o.processNext(a):i&&dt(i.processTelemetry)&&i.processTelemetry(a,null)},e._getTelCtx=function(a){a===void 0&&(a=null);var o=a;if(!o){var l=n||new si(null,{},e.core);i&&i[Ws]?o=l.createNew(null,i[Ws]):o=l.createNew(null,i)}return o},e._baseTelInit=function(a,o,l,c){a&&xt(a,Xs,[],null,Oe),!c&&o&&(c=o.getProcessTelContext().getNext());var d=i;i&&i[Ws]&&(d=i[Ws]()),e.core=o,n=new si(c,a,o,d),r=!0}}return t.prototype.initialize=function(e,r,n,i){this._baseTelInit(e,r,n,i)},t}();var $l="processTelemetry",U1="priority",H1="setNextPlugin",V1="isInitialized";function Bo(t,e){for(var r=[],n=null,i=t.getNext();i;){var a=i.getPlugin();a&&(n&&dt(n[H1])&&dt(a[$l])&&n[H1](a),(!dt(a[V1])||!a[V1]())&&r.push(a),n=a,i=i.getNext())}ot(r,function(o){o.initialize(t.getCfg(),t.core(),e,t.getNext())})}function Zl(t){return t.sort(function(e,r){var n=0,i=dt(r[$l]);return dt(e[$l])?n=i?e[U1]-r[U1]:1:i&&(n=-1),n})}var Ql=500,Rh="Channel has invalid priority",q1=function(t){pt(e,t);function e(){var r=t.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=Ql;var n;Tt(e,r,function(l,c){l.setNextPlugin=function(d){},l.processTelemetry=function(d,w){n&&ot(n,function(k){if(k.length>0){var H=r._getTelCtx(w).createNew(k);H.processNext(d)}})},l.getChannelControls=function(){return n},l.initialize=function(d,w,k){l.isInitialized()||(c.initialize(d,w,k),o((d||{}).channels,k),ot(n,function(H){return Bo(new si(H,d,w),k)}))}});function i(l){ot(l,function(c){c.priority<Ql&&Br(Rh+c.identifier)})}function a(l){l&&l.length>0&&(l=l.sort(function(c,d){return c.priority-d.priority}),i(l),n.push(l))}function o(l,c){if(n=[],l&&ot(l,function(w){return a(w)}),c){var d=[];ot(c,function(w){w.priority>Ql&&d.push(w)}),a(d)}}return r}return e._staticInit=function(){var r=e.prototype;Ri(r,"ChannelControls",r.getChannelControls),Ri(r,"channelQueue",r.getChannelControls)}(),e}(Dn);var z1="toGMTString",j1="toUTCString",nc="cookie",Jl="expires",tc="enabled",G1="isCookieUseDisabled",X1="disableCookiesUsage",Ti="_ckMgr",Ln="",Ks=null,ec=null,W1=null,ko=pr(),K1={},$s={};function Th(t,e){var r=Qi[Ti]||$s[Ti];return r||(r=Qi[Ti]=Qi(t,e),$s[Ti]=r),r}function Ys(t){return t?t.isEnabled():!0}function Eh(t){var e=t.cookieCfg=t.cookieCfg||{};if(xt(e,"domain",t.cookieDomain,Cl,Oe),xt(e,"path",t.cookiePath||"/",null,Oe),Oe(e[tc])){var r=void 0;or(t[G1])||(r=!t[G1]),or(t[X1])||(r=!t[X1]),e[tc]=r}return e}function Ji(t,e){var r;if(t)r=t.getCookieMgr();else if(e){var n=e.cookieCfg;n[Ti]?r=n[Ti]:r=Qi(e)}return r||(r=Th(e,(t||{}).logger)),r}function Qi(t,e){var r=Eh(t||$s),n=r.path||"/",i=r.domain,a=r[tc]!==!1,o={isEnabled:function(){var l=a&&rc(e),c=$s[Ti];return l&&c&&o!==c&&(l=Ys(c)),l},setEnabled:function(l){a=l!==!1},set:function(l,c,d,w,k){var H=!1;if(Ys(o)){var V={},x=dr(c||Ln),K=x.indexOf(";");if(K!==-1&&(x=dr(c.substring(0,K)),V=Q1(c.substring(K+1))),xt(V,"domain",w||i,Ba,or),!Oe(d)){var E=Yi();if(or(V[Jl])){var z=xr(),U=z+d*1e3;if(U>0){var J=new Date;J.setTime(U),xt(V,Jl,Y1(J,E?z1:j1)||Y1(J,E?z1:j1)||Ln,Ba)}}E||xt(V,"max-age",Ln+d,null,or)}var Z=rn();Z&&Z.protocol==="https:"&&(xt(V,"secure",null,null,or),ec===null&&(ec=!ic((kr()||{}).userAgent)),ec&&xt(V,"SameSite","None",null,or)),xt(V,"path",k||n,null,or);var se=r.setCookie||Z1;se(l,$1(x,V)),H=!0}return H},get:function(l){var c=Ln;return Ys(o)&&(c=(r.getCookie||Ah)(l)),c},del:function(l,c){var d=!1;return Ys(o)&&(d=o.purge(l,c)),d},purge:function(l,c){var d,w=!1;if(rc(e)){var k=(d={},d.path=c||"/",d[Jl]="Thu, 01 Jan 1970 00:00:01 GMT",d);Yi()||(k["max-age"]="0");var H=r.delCookie||Z1;H(l,$1(Ln,k)),w=!0}return w}};return o[Ti]=o,o}function rc(t){if(Ks===null){Ks=!1;try{var e=ko||{};Ks=e[nc]!==void 0}catch(r){t&&t.throwInternal(Ne.WARNING,Ie.CannotAccessCookie,"Cannot access document.cookie - "+wt(r),{exception:ct(r)})}}return Ks}function Q1(t){var e={};if(t&&t.length){var r=dr(t).split(";");ot(r,function(n){if(n=dr(n||Ln),n){var i=n.indexOf("=");i===-1?e[n]=null:e[dr(n.substring(0,i))]=dr(n.substring(i+1))}})}return e}function Y1(t,e){return dt(t[e])?t[e]():null}function $1(t,e){var r=t||Ln;return Lt(e,function(n,i){r+="; "+n+(Oe(i)?Ln:"="+i)}),r}function Ah(t){var e=Ln;if(ko){var r=ko[nc]||Ln;W1!==r&&(K1=Q1(r),W1=r),e=dr(K1[t]||Ln)}return e}function Z1(t,e){ko&&(ko[nc]=t+"="+e)}function ic(t){return at(t)?!!(Sr(t,"CPU iPhone OS 12")||Sr(t,"iPad; CPU OS 12")||Sr(t,"Macintosh; Intel Mac OS X 10_14")&&Sr(t,"Version/")&&Sr(t,"Safari")||Sr(t,"Macintosh; Intel Mac OS X 10_14")&&Ml(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Sr(t,"Chrome/5")||Sr(t,"Chrome/6")||Sr(t,"UnrealEngine")&&!Sr(t,"Chrome")||Sr(t,"UCBrowser/12")||Sr(t,"UCBrowser/11")):!1}var Ch="Extensions must provide callback to initialize",J1="_notificationManager";function Ih(t,e){return new Wl(e)}var ed=function(){function t(){var e=!1,r,n,i,a,o;Tt(t,this,function(l){l._extensions=new Array,n=new q1,l.logger=new La({loggingLevelConsole:Ne.CRITICAL}),r=[],l.isInitialized=function(){return e},l.initialize=function(c,d,w,k){l.isInitialized()&&Br("Core should not be initialized more than once"),(!c||Oe(c.instrumentationKey))&&Br("Please provide instrumentation key"),i=k,l[J1]=k,l.config=c||{},k&&l.config.disableDbgExt!==!0&&k.addNotificationListener(D1(c)),l.config.enablePerfMgr&&xt(l.config,"createPerfMgr",Ih),c.extensions=Oe(c.extensions)?[]:c.extensions;var H=wr(c,Xs);H.NotificationManager=k,w&&(l.logger=w);var V=[];V.push.apply(V,Ps(Ps([],d,!1),c.extensions,!1)),V=Zl(V);var x=[],K=[],E={};ot(V,function(z){(Oe(z)||Oe(z.initialize))&&Br(Ch);var U=z.priority,J=z.identifier;z&&U&&(Oe(E[U])?E[U]=J:w.warnToConsole("Two extensions have same priority #"+U+" - "+E[U]+", "+J)),!U||U<n.priority?x.push(z):K.push(z)}),V.push(n),x.push(n),V=Zl(V),l._extensions=V,Bo(new si([n],c,l),V),Bo(new si(x,c,l),V),l._extensions=x,l.getTransmissionControls().length===0&&Br("No channels available"),e=!0,l.releaseQueue()},l.getTransmissionControls=function(){return n.getChannelControls()},l.track=function(c){xt(c,O1,l.config.instrumentationKey,null,Us),xt(c,"time",Fr(new Date),null,Us),xt(c,"ver","4.0",null,Oe),l.isInitialized()?l.getProcessTelContext().processNext(c):r.push(c)},l.getProcessTelContext=function(){var c=l._extensions,d=c;return(!c||c.length===0)&&(d=[n]),new si(d,l.config,l)},l.getNotifyMgr=function(){return i||(i=Ca({addNotificationListener:function(c){},removeNotificationListener:function(c){},eventsSent:function(c){},eventsDiscarded:function(c,d){},eventsSendRequest:function(c,d){}}),l[J1]=i),i},l.getCookieMgr=function(){return o||(o=Qi(l.config,l.logger)),o},l.setCookieMgr=function(c){o=c},l.getPerfMgr=function(){return a||l.config&&l.config.enablePerfMgr&&dt(l.config.createPerfMgr)&&(a=l.config.createPerfMgr(l,l.getNotifyMgr())),a||Kl()},l.setPerfMgr=function(c){a=c},l.eventCnt=function(){return r.length},l.releaseQueue=function(){r.length>0&&(ot(r,function(c){l.getProcessTelContext().processNext(c)}),r=[])}})}return t}();var td=function(){function t(e){this.listeners=[];var r=!!(e||{}).perfEvtsSendAll;Tt(t,this,function(n){n.addNotificationListener=function(i){n.listeners.push(i)},n.removeNotificationListener=function(i){for(var a=Kn(n.listeners,i);a>-1;)n.listeners.splice(a,1),a=Kn(n.listeners,i)},n.eventsSent=function(i){ot(n.listeners,function(a){a&&a.eventsSent&&setTimeout(function(){return a.eventsSent(i)},0)})},n.eventsDiscarded=function(i,a){ot(n.listeners,function(o){o&&o.eventsDiscarded&&setTimeout(function(){return o.eventsDiscarded(i,a)},0)})},n.eventsSendRequest=function(i,a){ot(n.listeners,function(o){if(o&&o.eventsSendRequest)if(a)setTimeout(function(){return o.eventsSendRequest(i,a)},0);else try{o.eventsSendRequest(i,a)}catch{}})},n.perfEvent=function(i){i&&(r||!i.isChildEvt())&&ot(n.listeners,function(a){if(a&&a.perfEvent)if(i.isAsync)setTimeout(function(){return a.perfEvent(i)},0);else try{a.perfEvent(i)}catch{}})}})}return t}();var ac=function(t){pt(e,t);function e(){var r=t.call(this)||this,n=0;return Tt(e,r,function(i,a){i.initialize=function(c,d,w,k){a.initialize(c,d,w||new La(c),k||new td(c))},i.track=function(c){$n(i.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){c===null&&(l(c),Br("Invalid telemetry item")),o(c),a.track(c)},function(){return{item:c}},!c.sync)},i.addNotificationListener=function(c){var d=i.getNotifyMgr();d&&d.addNotificationListener(c)},i.removeNotificationListener=function(c){var d=i.getNotifyMgr();d&&d.removeNotificationListener(c)},i.pollInternalLogs=function(c){var d=i.config.diagnosticLogInterval;return(!d||!(d>0))&&(d=1e4),n&&i.stopPollingInternalLogs(),n=setInterval(function(){var w=i.logger?i.logger.queue:[];ot(w,function(k){var H={name:c||"InternalMessageId: "+k.messageId,iKey:i.config.instrumentationKey,time:Fr(new Date),baseType:ai.dataType,baseData:{message:k.message}};i.track(H)}),w.length=0},d),n},i.stopPollingInternalLogs=function(){!n||(clearInterval(n),n=0)};function o(c){if(Oe(c.name))throw l(c),Error("telemetry name required")}function l(c){var d=i.getNotifyMgr();d&&d.eventsDiscarded([c],u1.InvalidEvent)}}),r}return e}(ed);var rd=4294967296,ea=4294967295,nd=!1,Do=123456789,Lo=987654321;function Mh(t){t<0&&(t>>>=0),Do=123456789+t&ea,Lo=987654321-t&ea,nd=!0}function Ph(){try{var t=xr()&2147483647;Mh((Math.random()*rd^t)+t)}catch{}}function Fa(t){var e,r=Vl()||ql();return r&&r.getRandomValues?e=r.getRandomValues(new Uint32Array(1))[0]&ea:Yi()?(nd||Ph(),e=id()&ea):e=Math.floor(rd*Math.random()|0),t||(e>>>=0),e}function id(t){Lo=36969*(Lo&65535)+(Lo>>16)&ea,Do=18e3*(Do&65535)+(Do>>16)&ea;var e=(Lo<<16)+(Do&65535)>>>0&ea|0;return t||(e>>>=0),e}var ad="visibilitychange",od="pagehide";function Zs(t,e){var r=!1,n=Yn();n&&(r=Bn(n,t,e),r=Bn(n.body,t,e)||r);var i=pr();return i&&(r=Bn(i,t,e)||r),r}function oc(t,e,r){var n=!1;if(e&&t&&yr(t)){var i=[];ot(t,function(a){at(a)&&(!r||Kn(r,a)===-1?n=Zs(a,e)||n:i.push(a))}),!n&&i.length>0&&(n=oc(i,e))}return n}function sc(t,e){return oc(["beforeunload","unload","pagehide"],t,e)}function No(t,e){function r(i){var a=pr();t&&a&&a.visibilityState==="hidden"&&t(i)}var n=!1;return(!e||Kn(e,od)===-1)&&(n=Zs(od,t)),(!e||Kn(e,ad)===-1)&&(n=Zs(ad,r)||n),!n&&e&&(n=No(t)),n}function Oa(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=Fa()>>>0,n=0,i="";i.length<t;)n++,i+=e.charAt(r&63),r>>>=6,n===5&&(r=(Fa()<<2&4294967295|r&3)>>>0,n=0);return i}function Yr(){for(var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],e="",r,n=0;n<4;n++)r=Fa(),e+=t[r&15]+t[r>>4&15]+t[r>>8&15]+t[r>>12&15]+t[r>>16&15]+t[r>>20&15]+t[r>>24&15]+t[r>>28&15];var i=t[8+(Fa()&3)|0];return e.substr(0,8)+e.substr(9,4)+"4"+e.substr(13,3)+i+e.substr(16,3)+e.substr(19,12)}var ld="_aiHooks",cd=["req","rsp","hkErr","fnErr"];function cc(t,e){if(t)for(var r=0;r<t.length&&!e(t[r],r);r++);}function lc(t,e,r,n,i){i>=0&&i<=2&&cc(t,function(a,o){var l=a.cbks,c=l[cd[i]];if(c){e.ctx=function(){var k=n[o]=n[o]||{};return k};try{c.apply(e.inst,r)}catch(k){var d=e.err;try{var w=l[cd[2]];w&&(e.err=k,w.apply(e.inst,r))}catch{}finally{e.err=d}}}})}function Lh(t){return function(){var e=this,r=arguments,n=t.h,i={name:t.n,inst:e,ctx:null,set:c},a=[],o=l([i],r);function l(w,k){return cc(k,function(H){w.push(H)}),w}function c(w,k){r=l([],r),r[w]=k,o=l([i],r)}lc(n,i,o,a,0);var d=t.f;try{i.rslt=d.apply(e,r)}catch(w){throw i.err=w,lc(n,i,o,a,3),w}return lc(n,i,o,a,1),i.rslt}}function ud(t,e,r){var n=null;return t&&(Mo(t,e)?n=t:r&&(n=ud(I1(t),e,!1))),n}function uc(t,e,r){return t?Fo(t[nr],e,r,!1):null}function Fo(t,e,r,n){if(n===void 0&&(n=!0),t&&e&&r){var i=ud(t,e,n);if(i){var a=i[e];if(typeof a===In){var o=a[ld];if(!o){o={i:0,n:e,f:a,h:[]};var l=Lh(o);l[ld]=o,i[e]=l}var c={id:o.i,cbks:r,rm:function(){var d=this.id;cc(o.h,function(w,k){if(w.id===d)return o.h.splice(k,1),1})}};return o.i++,o.h.push(c),c}}}return null}var Ot={requestContextHeader:"Request-Context",requestContextTargetKey:"appId",requestContextAppIdFormat:"appId=cid-v1:",requestIdHeader:"Request-Id",traceParentHeader:"traceparent",traceStateHeader:"tracestate",sdkContextHeader:"Sdk-Context",sdkContextHeaderAppIdRequest:"appId",requestContextHeaderLowerCase:"request-context"};function dc(t,e,r){var n=e.length,i=dd(t,e);if(i.length!==n){for(var a=0,o=i;r[o]!==void 0;)a++,o=i.substring(0,150-3)+fd(a);i=o}return i}function dd(t,e){var r;return e&&(e=dr(e.toString()),e.length>150&&(r=e.substring(0,150),t&&t.throwInternal(Ne.WARNING,Ie.NameTooLong,"name is too long. It has been truncated to "+150+" characters.",{name:e},!0))),r||e}function Ut(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=dr(e),e.toString().length>r&&(n=e.toString().substring(0,r),t&&t.throwInternal(Ne.WARNING,Ie.StringValueTooLong,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}function li(t,e){return vc(t,e,2048,Ie.UrlTooLong)}function Oo(t,e){var r;return e&&e.length>32768&&(r=e.substring(0,32768),t&&t.throwInternal(Ne.WARNING,Ie.MessageTruncated,"message is too long, it has been truncated to "+32768+" characters.",{message:e},!0)),r||e}function fc(t,e){var r;if(e){var n=""+e;n.length>32768&&(r=n.substring(0,32768),t&&t.throwInternal(Ne.WARNING,Ie.ExceptionTruncated,"exception is too long, it has been truncated to "+32768+" characters.",{exception:e},!0))}return r||e}function Or(t,e){if(e){var r={};Lt(e,function(n,i){if(Pn(i)&&kn())try{i=Rr().stringify(i)}catch(a){t&&t.throwInternal(Ne.WARNING,Ie.CannotSerializeObjectNonSerializable,"custom property is not valid",{exception:a},!0)}i=Ut(t,i,8192),n=dc(t,n,r),r[n]=i}),e=r}return e}function Ur(t,e){if(e){var r={};Lt(e,function(n,i){n=dc(t,n,r),r[n]=i}),e=r}return e}function mc(t,e){return e&&vc(t,e,128,Ie.IdTooLong).toString()}function vc(t,e,r,n){var i;return e&&(e=dr(e),e.length>r&&(i=e.substring(0,r),t&&t.throwInternal(Ne.WARNING,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),i||e}function fd(t){var e="00"+t;return e.substr(e.length-3)}function ta(t){var e=null;if(dt(Event))e=new Event(t);else{var r=pr();r&&r.createEvent&&(e=r.createEvent("Event"),e.initEvent(t,!0,!0))}return e}function _n(t,e){return e===void 0&&(e=!1),t==null?e:t.toString().toLowerCase()==="true"}function an(t){(isNaN(t)||t<0)&&(t=0),t=Math.round(t);var e=""+t%1e3,r=""+Math.floor(t/1e3)%60,n=""+Math.floor(t/(1e3*60))%60,i=""+Math.floor(t/(1e3*60*60))%24,a=Math.floor(t/(1e3*60*60*24));return e=e.length===1?"00"+e:e.length===2?"0"+e:e,r=r.length<2?"0"+r:r,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(a>0?a+".":"")+i+":"+n+":"+r+"."+e}function hc(t,e){var r=null;return ot(t,function(n){if(n.identifier===e)return r=n,-1}),r}function pc(t,e,r,n,i){return!i&&at(t)&&(t==="Script error."||t==="Script error")}var Nn="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Ua="sampleRate",Ha="ProcessLegacy",Uo="http.method",Qs="https://dc.services.visualstudio.com",_r="not_specified",Js="iKey";var Ei;(function(t){t[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage"})(Ei||(Ei={}));var gn;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C",t[t.W3C=2]="W3C"})(gn||(gn={}));var ra=void 0,na=void 0;function _c(){return t0()?e0(Ei.LocalStorage):null}function e0(t){try{if(Oe(hn()))return null;var e=new Date,r=fr(t===Ei.LocalStorage?"localStorage":"sessionStorage");r.setItem(e.toString(),e.toString());var n=r.getItem(e.toString())!==e.toString();if(r.removeItem(e.toString()),!n)return r}catch{}return null}function gc(){return ia()?e0(Ei.SessionStorage):null}function bc(){ra=!1,na=!1}function t0(){return ra===void 0&&(ra=!!e0(Ei.LocalStorage)),ra}function Sc(t,e){var r=_c();if(r!==null)try{return r.getItem(e)}catch(n){ra=!1,t.throwInternal(Ne.WARNING,Ie.BrowserCannotReadLocalStorage,"Browser failed read of local storage. "+wt(n),{exception:ct(n)})}return null}function yc(t,e,r){var n=_c();if(n!==null)try{return n.setItem(e,r),!0}catch(i){ra=!1,t.throwInternal(Ne.WARNING,Ie.BrowserCannotWriteLocalStorage,"Browser failed write to local storage. "+wt(i),{exception:ct(i)})}return!1}function xc(t,e){var r=_c();if(r!==null)try{return r.removeItem(e),!0}catch(n){ra=!1,t.throwInternal(Ne.WARNING,Ie.BrowserFailedRemovalFromLocalStorage,"Browser failed removal of local storage item. "+wt(n),{exception:ct(n)})}return!1}function ia(){return na===void 0&&(na=!!e0(Ei.SessionStorage)),na}function Va(t,e){var r=gc();if(r!==null)try{return r.getItem(e)}catch(n){na=!1,t.throwInternal(Ne.WARNING,Ie.BrowserCannotReadSessionStorage,"Browser failed read of session storage. "+wt(n),{exception:ct(n)})}return null}function qa(t,e,r){var n=gc();if(n!==null)try{return n.setItem(e,r),!0}catch(i){na=!1,t.throwInternal(Ne.WARNING,Ie.BrowserCannotWriteSessionStorage,"Browser failed write to session storage. "+wt(i),{exception:ct(i)})}return!1}function wc(t,e){var r=gc();if(r!==null)try{return r.removeItem(e),!0}catch(n){na=!1,t.throwInternal(Ne.WARNING,Ie.BrowserFailedRemovalFromSessionStorage,"Browser failed removal of session storage item. "+wt(n),{exception:ct(n)})}return!1}var md=pr()||{},vd=0,Vh=[null,null,null,null,null];function Ho(t){var e=vd,r=Vh,n=r[e];return md.createElement?r[e]||(n=r[e]=md.createElement("a")):n={host:Rc(t,!0)},n.href=t,e++,e>=r.length&&(e=0),vd=e,n}function r0(t){var e,r=Ho(t);return r&&(e=r.href),e}function n0(t,e){return t?t.toUpperCase()+" "+e:e}function Rc(t,e){var r=i0(t,e)||"";if(r){var n=r.match(/(www[0-9]?\.)?(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>3&&at(n[2])&&n[2].length>0)return n[2]+(n[3]||"")}return r}function i0(t,e){var r=null;if(t){var n=t.match(/(\w*):\/\/(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>2&&at(n[2])&&n[2].length>0&&(r=n[2]||"",e&&n.length>2)){var i=(n[1]||"").toLowerCase(),a=n[3]||"";(i==="http"&&a===":80"||i==="https"&&a===":443")&&(a=""),r+=a}}return r}var zh=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"];function aa(t){return zh.indexOf(t.toLowerCase())!==-1}var ci={correlationIdPrefix:"cid-v1:",canIncludeCorrelationHeader:function(t,e,r){if(!e||t&&t.disableCorrelationHeaders)return!1;if(t&&t.correlationHeaderExcludePatterns){for(var n=0;n<t.correlationHeaderExcludePatterns.length;n++)if(t.correlationHeaderExcludePatterns[n].test(e))return!1}var i=Ho(e).host.toLowerCase();if(i&&(i.indexOf(":443")!==-1||i.indexOf(":80")!==-1)&&(i=(i0(e,!0)||"").toLowerCase()),(!t||!t.enableCorsCorrelation)&&i&&i!==r)return!1;var a=t&&t.correlationHeaderDomains;if(a){var o;if(ot(a,function(d){var w=new RegExp(d.toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));o=o||w.test(i)}),!o)return!1}var l=t&&t.correlationHeaderExcludedDomains;if(!l||l.length===0)return!0;for(var n=0;n<l.length;n++){var c=new RegExp(l[n].toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));if(c.test(i))return!1}return i&&i.length>0},getCorrelationContext:function(t){if(t){var e=ci.getCorrelationContextValue(t,Ot.requestContextTargetKey);if(e&&e!==ci.correlationIdPrefix)return e}},getCorrelationContextValue:function(t,e){if(t)for(var r=t.split(","),n=0;n<r.length;++n){var i=r[n].split("=");if(i.length===2&&i[0]===e)return i[1]}}};function hd(t,e,r,n){var i,a=n,o=n;if(e&&e.length>0){var l=Ho(e);if(i=l.host,!a)if(l.pathname!=null){var c=l.pathname.length===0?"/":l.pathname;c.charAt(0)!=="/"&&(c="/"+c),o=l.pathname,a=Ut(t,r?r+" "+c:c)}else a=Ut(t,e)}else i=n,a=n;return{target:i,name:a,data:o}}function za(){var t=nn();if(t&&t.now&&t.timing){var e=t.now()+t.timing.navigationStart;if(e>0)return e}return xr()}function Tr(t,e){var r=null;return t!==0&&e!==0&&!Oe(t)&&!Oe(e)&&(r=e-t),r}var jh=";",Gh="=";function Tc(t){if(!t)return{};var e=t.split(jh),r=Os(e,function(i,a){var o=a.split(Gh);if(o.length===2){var l=o[0].toLowerCase(),c=o[1];i[l]=c}return i},{});if(pn(r).length>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r.ingestionendpoint=r.ingestionendpoint||"https://"+n+"dc."+r.endpointsuffix}r.ingestionendpoint=r.ingestionendpoint||Qs}return r}var Ec=function(){function t(){}return t}();var Ac=function(t){pt(e,t);function e(){return t.call(this)||this}return e}(Ec);var pd=function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return t}();var a0=function(t){pt(e,t);function e(r,n,i){var a=t.call(this)||this;return a.name=Ut(r,i)||_r,a.data=n,a.time=Fr(new Date),a.aiDataContract={time:1,iKey:1,name:1,sampleRate:function(){return a.sampleRate===100?4:1},tags:1,data:1},a}return e}(pd);var o0=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var on=function(t){pt(e,t);function e(r,n,i,a){var o=t.call(this)||this;return o.aiDataContract={ver:1,name:1,properties:0,measurements:0},o.name=Ut(r,n)||_r,o.properties=Or(r,i),o.measurements=Ur(r,a),o}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(o0);var _d=function(){function t(){}return t}();var gd=function(){function t(){this.ver=2,this.exceptions=[],this.properties={},this.measurements={}}return t}();var bd=function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return t}();var Xh="<no_method>",Ga="error",bn="stack",Ic="stackDetails",Sd="errorSrc",Mc="message",wd="description";function Pc(t,e){var r=t;return r&&!at(r)&&(JSON&&JSON.stringify?(r=JSON.stringify(t),e&&(!r||r==="{}")&&(dt(t.toString)?r=t.toString():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}function Rd(t,e){var r=t;return t&&(r&&!at(r)&&(r=t[Mc]||t[wd]||r),r&&!at(r)&&(r=Pc(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&(r||"").indexOf(e)===-1&&(r=e+": "+r),r||""}function Wh(t){try{if(Pn(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}function Kh(t){try{if(Pn(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}function yd(t){return t&&t.src&&at(t.src)&&t.obj&&yr(t.obj)}function ja(t){var e=t||"";at(e)||(at(e[bn])?e=e[bn]:e=""+e);var r=e.split(`
16
+ `);return{src:e,obj:r}}function Yh(t){for(var e=[],r=t.split(`
17
+ `),n=0;n<r.length;n++){var i=r[n];r[n+1]&&(i+="@"+r[n+1],n++),e.push(i)}return{src:t,obj:e}}function Td(t){var e=null;if(t)try{if(t[bn])e=ja(t[bn]);else if(t[Ga]&&t[Ga][bn])e=ja(t[Ga][bn]);else if(t.exception&&t.exception[bn])e=ja(t.exception[bn]);else if(yd(t))e=t;else if(yd(t[Ic]))e=t[Ic];else if(window&&window.opera&&t[Mc])e=Yh(t.message);else if(at(t))e=ja(t);else{var r=t[Mc]||t[wd]||"";at(t[Sd])&&(r&&(r+=`
18
+ `),r+=" from "+t[Sd]),r&&(e=ja(r))}}catch(n){e=ja(n)}return e||{src:"",obj:null}}function $h(t){var e="";return t&&(t.obj?ot(t.obj,function(r){e+=r+`
19
+ `}):e=t.src||""),e}function Zh(t){var e,r=t.obj;if(r&&r.length>0){e=[];var n=0,i=0;ot(r,function(x){var K=x.toString();if(Bc.regex.test(K)){var E=new Bc(K,n++);i+=E.sizeInBytes,e.push(E)}});var a=32*1024;if(i>a)for(var o=0,l=e.length-1,c=0,d=o,w=l;o<l;){var k=e[o].sizeInBytes,H=e[l].sizeInBytes;if(c+=k+H,c>a){var V=w-d+1;e.splice(d,V);break}d=o,w=l,o++,l--}}return e}function s0(t){var e="";if(t&&(e=t.typeName||t.name||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor.toString());e=n&&n.length>1?n[1]:""}catch{}return e}function Cc(t){if(t)try{if(!at(t)){var e=s0(t),r=Pc(t,!1);return(!r||r==="{}")&&(t[Ga]&&(t=t[Ga],e=s0(t)),r=Pc(t,!0)),r.indexOf(e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}var Mr=function(t){pt(e,t);function e(r,n,i,a,o,l){var c=t.call(this)||this;return c.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0},Kh(n)?(c.exceptions=n.exceptions,c.properties=n.properties,c.measurements=n.measurements,n.severityLevel&&(c.severityLevel=n.severityLevel),n.id&&(c.id=n.id),n.problemGroup&&(c.problemGroup=n.problemGroup),c.ver=2,Oe(n.isManual)||(c.isManual=n.isManual)):(i||(i={}),c.exceptions=[new xd(r,n,i)],c.properties=Or(r,i),c.measurements=Ur(r,a),o&&(c.severityLevel=o),l&&(c.id=l)),c}return e.CreateAutoException=function(r,n,i,a,o,l,c,d){var w=s0(o||l||r);return{message:Rd(r,w),url:n,lineNumber:i,columnNumber:a,error:Cc(o||l||r),evt:Cc(l||r),typeName:w,stackDetails:Td(c||o||l),errorSrc:d}},e.CreateFromInterface=function(r,n,i,a){var o=n.exceptions&&Wi(n.exceptions,function(c){return xd.CreateFromInterface(r,c)}),l=new e(r,ur(ur({},n),{exceptions:o}),i,a);return l},e.prototype.toInterface=function(){var r=this,n=r.exceptions,i=r.properties,a=r.measurements,o=r.severityLevel,l=r.problemGroup,c=r.id,d=r.isManual,w=n instanceof Array&&Wi(n,function(k){return k.toInterface()})||void 0;return{ver:"4.0",exceptions:w,severityLevel:o,properties:i,measurements:a,problemGroup:l,id:c,isManual:d}},e.CreateSimpleException=function(r,n,i,a,o,l){return{exceptions:[{hasFullStack:!0,message:r,stack:o,typeName:n}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e.formatError=Cc,e}(gd);var xd=function(t){pt(e,t);function e(r,n,i){var a=t.call(this)||this;if(a.aiDataContract={id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2},Wh(n))a.typeName=n.typeName,a.message=n.message,a[bn]=n[bn],a.parsedStack=n.parsedStack,a.hasFullStack=n.hasFullStack;else{var o=n,l=o&&o.evt;Ma(o)||(o=o[Ga]||l||o),a.typeName=Ut(r,s0(o))||_r,a.message=Oo(r,Rd(n||o,a.typeName))||_r;var c=n[Ic]||Td(n);a.parsedStack=Zh(c),a[bn]=fc(r,$h(c)),a.hasFullStack=yr(a.parsedStack)&&a.parsedStack.length>0,i&&(i.typeName=i.typeName||a.typeName)}return a}return e.prototype.toInterface=function(){var r=this.parsedStack instanceof Array&&Wi(this.parsedStack,function(i){return i.toInterface()}),n={id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this[bn],parsedStack:r||void 0};return n},e.CreateFromInterface=function(r,n){var i=n.parsedStack instanceof Array&&Wi(n.parsedStack,function(o){return Bc.CreateFromInterface(o)})||n.parsedStack,a=new e(r,ur(ur({},n),{parsedStack:i}));return a},e}(bd);var Bc=function(t){pt(e,t);function e(r,n){var i=t.call(this)||this;if(i.sizeInBytes=0,i.aiDataContract={level:1,method:1,assembly:0,fileName:0,line:0},typeof r=="string"){var a=r;i.level=n,i.method=Xh,i.assembly=dr(a),i.fileName="",i.line=0;var o=a.match(e.regex);o&&o.length>=5&&(i.method=dr(o[2])||i.method,i.fileName=dr(o[4]),i.line=parseInt(o[5])||0)}else i.level=r.level,i.method=r.method,i.assembly=r.assembly,i.fileName=r.fileName,i.line=r.line,i.sizeInBytes=0;return i.sizeInBytes+=i.method.length,i.sizeInBytes+=i.fileName.length,i.sizeInBytes+=i.assembly.length,i.sizeInBytes+=e.baseSize,i.sizeInBytes+=i.level.toString().length,i.sizeInBytes+=i.line.toString().length,i}return e.CreateFromInterface=function(r){return new e(r,null)},e.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},e.regex=/^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/,e.baseSize=58,e}(_d);var Ed=function(){function t(){this.ver=2,this.metrics=[],this.properties={},this.measurements={}}return t}();var l0;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(l0||(l0={}));var Ad=function(){function t(){this.kind=l0.Measurement}return t}();var Cd=function(t){pt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},r}return e}(Ad);var sn=function(t){pt(e,t);function e(r,n,i,a,o,l,c,d,w){var k=t.call(this)||this;k.aiDataContract={ver:1,metrics:1,properties:0};var H=new Cd;return H.count=a>0?a:void 0,H.max=isNaN(l)||l===null?void 0:l,H.min=isNaN(o)||o===null?void 0:o,H.name=Ut(r,n)||_r,H.value=i,H.stdDev=isNaN(c)||c===null?void 0:c,k.metrics=[H],k.properties=Or(r,d),k.measurements=Ur(r,w),k}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(Ed);var Vo=function(t){pt(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(o0);var Hr=function(t){pt(e,t);function e(r,n,i,a,o,l,c){var d=t.call(this)||this;return d.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0},d.id=mc(r,c),d.url=li(r,i),d.name=Ut(r,n)||_r,isNaN(a)||(d.duration=an(a)),d.properties=Or(r,o),d.measurements=Ur(r,l),d}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(Vo);var Id=function(){function t(){this.ver=2,this.success=!0,this.properties={},this.measurements={}}return t}();var ln=function(t){pt(e,t);function e(r,n,i,a,o,l,c,d,w,k,H,V){w===void 0&&(w="Ajax");var x=t.call(this)||this;x.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0},x.id=n,x.duration=an(o),x.success=l,x.resultCode=c+"",x.type=Ut(r,w);var K=hd(r,i,d,a);return x.data=li(r,a)||K.data,x.target=Ut(r,K.target),k&&(x.target="".concat(x.target," | ").concat(k)),x.name=Ut(r,K.name),x.properties=Or(r,H),x.measurements=Ur(r,V),x}return e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(Id);var Md=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var Fn=function(t){pt(e,t);function e(r,n,i,a,o){var l=t.call(this)||this;return l.aiDataContract={ver:1,message:1,severityLevel:0,properties:0},n=n||_r,l.message=Oo(r,n),l.properties=Or(r,a),l.measurements=Ur(r,o),i&&(l.severityLevel=i),l}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(Md);var Pd=function(t){pt(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(Vo);var On=function(t){pt(e,t);function e(r,n,i,a,o,l,c){var d=t.call(this)||this;return d.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0},d.url=li(r,i),d.name=Ut(r,n)||_r,d.properties=Or(r,o),d.measurements=Ur(r,l),c&&(d.domProcessing=c.domProcessing,d.duration=c.duration,d.networkConnect=c.networkConnect,d.perfTotal=c.perfTotal,d.receivedResponse=c.receivedResponse,d.sentRequest=c.sentRequest),d}return e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(Pd);var Zn=function(t){pt(e,t);function e(r,n){var i=t.call(this)||this;return i.aiDataContract={baseType:1,baseData:1},i.baseType=r,i.baseData=n,i}return e}(Ac);var Xa;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(Xa||(Xa={}));function Ci(t){var e="ai."+t+".";return function(r){return e+r}}var qo=Ci("application"),Er=Ci("device"),c0=Ci("location"),Wa=Ci("operation"),kc=Ci("session"),Ai=Ci("user"),oa=Ci("cloud"),zo=Ci("internal"),Ka=function(t){pt(e,t);function e(){return t.call(this)||this}return e}(Bl({applicationVersion:qo("ver"),applicationBuild:qo("build"),applicationTypeId:qo("typeId"),applicationId:qo("applicationId"),applicationLayer:qo("layer"),deviceId:Er("id"),deviceIp:Er("ip"),deviceLanguage:Er("language"),deviceLocale:Er("locale"),deviceModel:Er("model"),deviceFriendlyName:Er("friendlyName"),deviceNetwork:Er("network"),deviceNetworkName:Er("networkName"),deviceOEMName:Er("oemName"),deviceOS:Er("os"),deviceOSVersion:Er("osVersion"),deviceRoleInstance:Er("roleInstance"),deviceRoleName:Er("roleName"),deviceScreenResolution:Er("screenResolution"),deviceType:Er("type"),deviceMachineName:Er("machineName"),deviceVMName:Er("vmName"),deviceBrowser:Er("browser"),deviceBrowserVersion:Er("browserVersion"),locationIp:c0("ip"),locationCountry:c0("country"),locationProvince:c0("province"),locationCity:c0("city"),operationId:Wa("id"),operationName:Wa("name"),operationParentId:Wa("parentId"),operationRootId:Wa("rootId"),operationSyntheticSource:Wa("syntheticSource"),operationCorrelationVector:Wa("correlationVector"),sessionId:kc("id"),sessionIsFirst:kc("isFirst"),sessionIsNew:kc("isNew"),userAccountAcquisitionDate:Ai("accountAcquisitionDate"),userAccountId:Ai("accountId"),userAgent:Ai("userAgent"),userId:Ai("id"),userStoreRegion:Ai("storeRegion"),userAuthUserId:Ai("authUserId"),userAnonymousUserAcquisitionDate:Ai("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:Ai("authUserAcquisitionDate"),cloudName:oa("name"),cloudRole:oa("role"),cloudRoleVer:oa("roleVer"),cloudRoleInstance:oa("roleInstance"),cloudEnvironment:oa("environment"),cloudLocation:oa("location"),cloudDeploymentUnit:oa("deploymentUnit"),internalNodeName:zo("nodeName"),internalSdkVersion:zo("sdkVersion"),internalAgentVersion:zo("agentVersion"),internalSnippet:zo("snippet"),internalSdkSrc:zo("sdkSrc")}));var Sn=function(){function t(){}return t.create=function(e,r,n,i,a,o){if(n=Ut(i,n)||_r,Oe(e)||Oe(r)||Oe(n))throw Error("Input doesn't contain all required fields");var l="";e[Js]&&(l=e[Js],delete e[Js]);var c={name:n,time:Fr(new Date),iKey:l,ext:o||{},tags:[],data:{},baseType:r,baseData:e};return Oe(a)||Lt(a,function(d,w){c.data[d]=w}),c},t}();var Vr={UserExt:"user",DeviceExt:"device",TraceExt:"trace",WebExt:"web",AppExt:"app",OSExt:"os",SessionExt:"ses",SDKExt:"sdk"},Ht=new Ka;var Ii="AppInsightsPropertiesPlugin",jo="AppInsightsChannelPlugin",Dc="ApplicationInsightsAnalytics";var Bd=function(){function t(e,r,n,i){Tt(t,this,function(a){var o=null,l=[],c=!1,d;n&&(d=n.logger);function w(){n&&ot(n.getTransmissionControls(),function(H){ot(H,function(V){return V.flush(!0)})})}function k(H){l.push(H),o||(o=setInterval(function(){var V=l.slice(0),x=!1;l=[],ot(V,function(K){K()?x=!0:l.push(K)}),l.length===0&&(clearInterval(o),o=null),x&&w()},100))}a.trackPageView=function(H,V){var x=H.name;if(Oe(x)||typeof x!="string"){var K=pr();x=H.name=K&&K.title||""}var E=H.uri;if(Oe(E)||typeof E!="string"){var z=rn();E=H.uri=z&&z.href||""}if(!i.isPerformanceTimingSupported()){e.sendPageViewInternal(H,V),w(),d.throwInternal(Ne.WARNING,Ie.NavigationTimingNotSupported,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");return}var U=!1,J,Z=i.getPerformanceTiming().navigationStart;Z>0&&(J=Tr(Z,+new Date),i.shouldCollectDuration(J)||(J=void 0));var se;!Oe(V)&&!Oe(V.duration)&&(se=V.duration),(r||!isNaN(se))&&(isNaN(se)&&(V||(V={}),V.duration=J),e.sendPageViewInternal(H,V),w(),U=!0);var Ce=6e4;V||(V={}),k(function(){var Ee=!1;try{if(i.isPerformanceTimingDataReady()){Ee=!0;var rt={name:x,uri:E};i.populatePageViewPerformanceEvent(rt),!rt.isValid&&!U?(V.duration=J,e.sendPageViewInternal(H,V)):(U||(V.duration=rt.durationMs,e.sendPageViewInternal(H,V)),c||(e.sendPageViewPerformanceInternal(rt,V),c=!0))}else Z>0&&Tr(Z,+new Date)>Ce&&(Ee=!0,U||(V.duration=Ce,e.sendPageViewInternal(H,V)))}catch(tt){d.throwInternal(Ne.CRITICAL,Ie.TrackPVFailedCalc,"trackPageView failed on page load calculation: "+wt(tt),{exception:ct(tt)})}return Ee})}})}return t}();var kd=function(){function t(e,r){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=r,this._logger=e}return t.prototype.trackPreviousPageVisit=function(e,r){try{var n=this.restartPageVisitTimer(e,r);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(i){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+ct(i))}},t.prototype.restartPageVisitTimer=function(e,r){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,r),n}catch(i){return this._logger.warnToConsole("Call to restart failed: "+ct(i)),null}},t.prototype.startPageVisitTimer=function(e,r){try{if(ia()){Va(this._logger,this.prevPageVisitDataKeyName)!=null&&Br("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new np(e,r),i=Rr().stringify(n);qa(this._logger,this.prevPageVisitDataKeyName,i)}}catch(a){this._logger.warnToConsole("Call to start failed: "+ct(a))}},t.prototype.stopPageVisitTimer=function(){try{if(ia()){var e=xr(),r=Va(this._logger,this.prevPageVisitDataKeyName);if(r&&kn()){var n=Rr().parse(r);return n.pageVisitTime=e-n.pageVisitStartTime,wc(this._logger,this.prevPageVisitDataKeyName),n}else return null}return null}catch(i){return this._logger.warnToConsole("Stop page visit timer failed: "+ct(i)),null}},t}();var np=function(){function t(e,r){this.pageVisitStartTime=xr(),this.pageName=e,this.pageUrl=r}return t}();var Dd=function(){function t(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}return t.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var r=this.getPerformanceNavigationTiming(),n=this.getPerformanceTiming(),i=0,a=0,o=0,l=0,c=0;(r||n)&&(r?(i=r.duration,a=r.startTime===0?r.connectEnd:Tr(r.startTime,r.connectEnd),o=Tr(r.requestStart,r.responseStart),l=Tr(r.responseStart,r.responseEnd),c=Tr(r.responseEnd,r.loadEventEnd)):(i=Tr(n.navigationStart,n.loadEventEnd),a=Tr(n.navigationStart,n.connectEnd),o=Tr(n.requestStart,n.responseStart),l=Tr(n.responseStart,n.responseEnd),c=Tr(n.responseEnd,n.loadEventEnd)),i===0?this._logger.throwInternal(Ne.WARNING,Ie.ErrorPVCalc,"error calculating page view performance.",{total:i,network:a,request:o,response:l,dom:c}):this.shouldCollectDuration(i,a,o,l,c)?i<Math.floor(a)+Math.floor(o)+Math.floor(l)+Math.floor(c)?this._logger.throwInternal(Ne.WARNING,Ie.ClientPerformanceMathError,"client performance math error.",{total:i,network:a,request:o,response:l,dom:c}):(e.durationMs=i,e.perfTotal=e.duration=an(i),e.networkConnect=an(a),e.sentRequest=an(o),e.receivedResponse=an(l),e.domProcessing=an(c),e.isValid=!0):this._logger.throwInternal(Ne.WARNING,Ie.InvalidDurationValue,"Invalid page load duration value. Browser perf data won't be sent.",{total:i,network:a,request:o,response:l,dom:c}))},t.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?nn().timing:null},t.prototype.getPerformanceNavigationTiming=function(){return this.isPerformanceNavigationTimingSupported()?nn().getEntriesByType("navigation")[0]:null},t.prototype.isPerformanceNavigationTimingSupported=function(){var e=nn();return e&&e.getEntriesByType&&e.getEntriesByType("navigation").length>0},t.prototype.isPerformanceTimingSupported=function(){var e=nn();return e&&e.timing},t.prototype.isPerformanceTimingDataReady=function(){var e=nn(),r=e?e.timing:0;return r&&r.domainLookupStart>0&&r.navigationStart>0&&r.responseStart>0&&r.requestStart>0&&r.loadEventEnd>0&&r.responseEnd>0&&r.connectEnd>0&&r.domLoading>0},t.prototype.shouldCollectDuration=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=kr()||{},i=["googlebot","adsbot-google","apis-google","mediapartners-google"],a=n.userAgent,o=!1;if(a)for(var l=0;l<i.length;l++)o=o||a.toLowerCase().indexOf(i[l])!==-1;if(o)return!1;for(var l=0;l<e.length;l++)if(e[l]<0||e[l]>=this.MAX_DURATION_ALLOWED)return!1;return!0},t}();var Ld="duration",Lc="event";function Go(t,e){t&&t.dispatchEvent&&e&&t.dispatchEvent(e)}function ip(t){if(t&&t.reason){var e=t.reason;return!at(e)&&dt(e.toString)?e.toString():ct(e)}return t||""}var Nc=function(t){pt(e,t);function e(){var r=t.call(this)||this;r.identifier=Dc,r.priority=180,r.autoRoutePVDelay=500;var n,i,a,o=0,l,c;return Tt(e,r,function(d,w){var k=rn(!0);l=k&&k.href||"",d.getCookieMgr=function(){return Ji(d.core)},d.processTelemetry=function(E,z){$n(d.core,function(){return d.identifier+":processTelemetry"},function(){var U=!1,J=d._telemetryInitializers.length;z=d._getTelCtx(z);for(var Z=0;Z<J;++Z){var se=d._telemetryInitializers[Z];if(se)try{if(se.apply(null,[E])===!1){U=!0;break}}catch(Ce){z.diagLog().throwInternal(Ne.CRITICAL,Ie.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+wt(Ce),{exception:ct(Ce)},!0)}}U||d.processNext(E,z)},function(){return{item:E}},!E.sync)},d.trackEvent=function(E,z){try{var U=Sn.create(E,on.dataType,on.envelopeType,d.diagLog(),z);d.core.track(U)}catch(J){d.diagLog().throwInternal(Ne.WARNING,Ie.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+wt(J),{exception:ct(J)})}},d.startTrackEvent=function(E){try{n.start(E)}catch(z){d.diagLog().throwInternal(Ne.CRITICAL,Ie.StartTrackEventFailed,"startTrackEvent failed, event will not be collected: "+wt(z),{exception:ct(z)})}},d.stopTrackEvent=function(E,z,U){try{n.stop(E,void 0,z)}catch(J){d.diagLog().throwInternal(Ne.CRITICAL,Ie.StopTrackEventFailed,"stopTrackEvent failed, event will not be collected: "+wt(J),{exception:ct(J)})}},d.trackTrace=function(E,z){try{var U=Sn.create(E,Fn.dataType,Fn.envelopeType,d.diagLog(),z);d.core.track(U)}catch(J){d.diagLog().throwInternal(Ne.WARNING,Ie.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+wt(J),{exception:ct(J)})}},d.trackMetric=function(E,z){try{var U=Sn.create(E,sn.dataType,sn.envelopeType,d.diagLog(),z);d.core.track(U)}catch(J){d.diagLog().throwInternal(Ne.CRITICAL,Ie.TrackMetricFailed,"trackMetric failed, metric will not be collected: "+wt(J),{exception:ct(J)})}},d.trackPageView=function(E,z){try{var U=E||{};d._pageViewManager.trackPageView(U,ur(ur(ur({},U.properties),U.measurements),z)),d.config.autoTrackPageVisitTime&&d._pageVisitTimeManager.trackPreviousPageVisit(U.name,U.uri)}catch(J){d.diagLog().throwInternal(Ne.CRITICAL,Ie.TrackPVFailed,"trackPageView failed, page view will not be collected: "+wt(J),{exception:ct(J)})}},d.sendPageViewInternal=function(E,z,U){var J=pr();J&&(E.refUri=E.refUri===void 0?J.referrer:E.refUri);var Z=Sn.create(E,Hr.dataType,Hr.envelopeType,d.diagLog(),z,U);d.core.track(Z),o=0},d.sendPageViewPerformanceInternal=function(E,z,U){var J=Sn.create(E,On.dataType,On.envelopeType,d.diagLog(),z,U);d.core.track(J)},d.trackPageViewPerformance=function(E,z){try{d._pageViewPerformanceManager.populatePageViewPerformanceEvent(E),d.sendPageViewPerformanceInternal(E,z)}catch(U){d.diagLog().throwInternal(Ne.CRITICAL,Ie.TrackPVFailed,"trackPageViewPerformance failed, page view will not be collected: "+wt(U),{exception:ct(U)})}},d.startTrackPage=function(E){try{if(typeof E!="string"){var z=pr();E=z&&z.title||""}i.start(E)}catch(U){d.diagLog().throwInternal(Ne.CRITICAL,Ie.StartTrackFailed,"startTrackPage failed, page view may not be collected: "+wt(U),{exception:ct(U)})}},d.stopTrackPage=function(E,z,U,J){try{if(typeof E!="string"){var Z=pr();E=Z&&Z.title||""}if(typeof z!="string"){var se=rn();z=se&&se.href||""}i.stop(E,z,U,J),d.config.autoTrackPageVisitTime&&d._pageVisitTimeManager.trackPreviousPageVisit(E,z)}catch(Ce){d.diagLog().throwInternal(Ne.CRITICAL,Ie.StopTrackFailed,"stopTrackPage failed, page view will not be collected: "+wt(Ce),{exception:ct(Ce)})}},d.sendExceptionInternal=function(E,z,U){var J=E.exception||E.error||new Error(_r),Z=new Mr(d.diagLog(),J,E.properties||z,E.measurements,E.severityLevel,E.id).toInterface(),se=Sn.create(Z,Mr.dataType,Mr.envelopeType,d.diagLog(),z,U);d.core.track(se)},d.trackException=function(E,z){try{d.sendExceptionInternal(E,z)}catch(U){d.diagLog().throwInternal(Ne.CRITICAL,Ie.TrackExceptionFailed,"trackException failed, exception will not be collected: "+wt(U),{exception:ct(U)})}},d._onerror=function(E){var z=E&&E.error,U=E&&E.evt;try{if(!U){var J=Yn();J&&(U=J[Lc])}var Z=E&&E.url||(pr()||{}).URL,se=E.errorSrc||"window.onerror@"+Z+":"+(E.lineNumber||0)+":"+(E.columnNumber||0),Ce={errorSrc:se,url:Z,lineNumber:E.lineNumber||0,columnNumber:E.columnNumber||0,message:E.message};pc(E.message,E.url,E.lineNumber,E.columnNumber,E.error)?K(Mr.CreateAutoException("Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",Z,E.lineNumber||0,E.columnNumber||0,z,U,null,se),Ce):(E.errorSrc||(E.errorSrc=se),d.trackException({exception:E,severityLevel:Xa.Error},Ce))}catch(rt){var Ee=z?z.name+", "+z.message:"null";d.diagLog().throwInternal(Ne.CRITICAL,Ie.ExceptionWhileLoggingError,"_onError threw exception while logging error, error will not be collected: "+wt(rt),{exception:ct(rt),errorString:Ee})}},d.addTelemetryInitializer=function(E){d._telemetryInitializers.push(E)},d.initialize=function(E,z,U,J){if(!d.isInitialized()){if(Oe(z))throw Error("Error initializing");w.initialize(E,z,U,J),d.setInitialized(!1);var Z=d._getTelCtx(),se=d.identifier;d.config=Z.getExtCfg(se);var Ce=e.getDefaultConfig(E);Ce!==void 0&&Lt(Ce,function(vt,Et){d.config[vt]=Z.getConfig(se,vt,Et),d.config[vt]===void 0&&(d.config[vt]=Et)}),d.config.isStorageUseDisabled&&bc();var Ee={instrumentationKey:function(){return E.instrumentationKey},accountId:function(){return d.config.accountId||E.accountId},sessionRenewalMs:function(){return d.config.sessionRenewalMs||E.sessionRenewalMs},sessionExpirationMs:function(){return d.config.sessionExpirationMs||E.sessionExpirationMs},sampleRate:function(){return d.config.samplingPercentage||E.samplingPercentage},sdkExtension:function(){return d.config.sdkExtension||E.sdkExtension},isBrowserLinkTrackingEnabled:function(){return d.config.isBrowserLinkTrackingEnabled||E.isBrowserLinkTrackingEnabled},appId:function(){return d.config.appId||E.appId}};d._pageViewPerformanceManager=new Dd(d.core),d._pageViewManager=new Bd(r,d.config.overridePageViewDuration,d.core,d._pageViewPerformanceManager),d._pageVisitTimeManager=new kd(d.diagLog(),function(vt,Et,At){return H(vt,Et,At)}),d._telemetryInitializers=d._telemetryInitializers||[],V(Ee),n=new Nd(d.diagLog(),"trackEvent"),n.action=function(vt,Et,At,bt){bt||(bt={}),bt[Ld]=At.toString(),d.trackEvent({name:vt,properties:bt})},i=new Nd(d.diagLog(),"trackPageView"),i.action=function(vt,Et,At,bt,et){Oe(bt)&&(bt={}),bt[Ld]=At.toString();var A={name:vt,uri:Et,properties:bt,measurements:et};d.sendPageViewInternal(A,bt)};var rt=Yn(),tt=Ul(),Rt=rn(!0),yt=r;if(d.config.disableExceptionTracking===!1&&!d.config.autoExceptionInstrumented&&rt){var sr="onerror",Pt=rt[sr];rt.onerror=function(vt,Et,At,bt,et){var A=rt[Lc],de=Pt&&Pt(vt,Et,At,bt,et);return de!==!0&&yt._onerror(Mr.CreateAutoException(vt,Et,At,bt,et,A)),de},d.config.autoExceptionInstrumented=!0}if(d.config.disableExceptionTracking===!1&&d.config.enableUnhandledPromiseRejectionTracking===!0&&!d.config.autoUnhandledPromiseInstrumented&&rt){var Yt="onunhandledrejection",Vt=rt[Yt];rt[Yt]=function(vt){var Et=rt[Lc],At=Vt&&Vt.call(rt,vt);return At!==!0&&yt._onerror(Mr.CreateAutoException(ip(vt),Rt?Rt.href:"",0,0,vt,Et)),At},d.config.autoUnhandledPromiseInstrumented=!0}if(d.config.enableAutoRouteTracking===!0&&tt&&dt(tt.pushState)&&dt(tt.replaceState)&&rt&&typeof Event<"u"){var Ct=r;ot(U,function(vt){vt.identifier===Ii&&(a=vt)}),tt.pushState=function(vt){return function(){var At=vt.apply(this,arguments);return Go(rt,ta(Ct.config.namePrefix+"pushState")),Go(rt,ta(Ct.config.namePrefix+"locationchange")),At}}(tt.pushState),tt.replaceState=function(vt){return function(){var At=vt.apply(this,arguments);return Go(rt,ta(Ct.config.namePrefix+"replaceState")),Go(rt,ta(Ct.config.namePrefix+"locationchange")),At}}(tt.replaceState),rt.addEventListener&&(rt.addEventListener(Ct.config.namePrefix+"popstate",function(){Go(rt,ta(Ct.config.namePrefix+"locationchange"))}),rt.addEventListener(Ct.config.namePrefix+"locationchange",function(){if(a&&a.context&&a.context.telemetryTrace){a.context.telemetryTrace.traceID=Yr();var vt="_unknown_";Rt&&Rt.pathname&&(vt=Rt.pathname+(Rt.hash||"")),a.context.telemetryTrace.name=Ut(Ct.diagLog(),vt)}c&&(l=c),c=Rt&&Rt.href||"",setTimeout(function(Et){Ct.trackPageView({refUri:Et,properties:{duration:0}})}.bind(r,l),Ct.autoRoutePVDelay)}))}d.setInitialized(!0)}};function H(E,z,U){var J={PageName:E,PageUrl:z};d.trackMetric({name:"PageVisitTime",average:U,max:U,min:U,sampleCount:1},J)}function V(E){if(!E.isBrowserLinkTrackingEnabled()){var z=["/browserLinkSignalR/","/__browserLink/"],U=function(J){if(J.baseType===ln.dataType){var Z=J.baseData;if(Z){for(var se=0;se<z.length;se++)if(Z.target&&Z.target.indexOf(z[se])>=0)return!1}}return!0};x(U)}}function x(E){d._telemetryInitializers.push(E)}function K(E,z){var U=Sn.create(E,Mr.dataType,Mr.envelopeType,d.diagLog(),z);d.core.track(U)}}),r}return e.getDefaultConfig=function(r){return r||(r={}),r.sessionRenewalMs=30*60*1e3,r.sessionExpirationMs=24*60*60*1e3,r.disableExceptionTracking=_n(r.disableExceptionTracking),r.autoTrackPageVisitTime=_n(r.autoTrackPageVisitTime),r.overridePageViewDuration=_n(r.overridePageViewDuration),r.enableUnhandledPromiseRejectionTracking=_n(r.enableUnhandledPromiseRejectionTracking),(isNaN(r.samplingPercentage)||r.samplingPercentage<=0||r.samplingPercentage>=100)&&(r.samplingPercentage=100),r.isStorageUseDisabled=_n(r.isStorageUseDisabled),r.isBrowserLinkTrackingEnabled=_n(r.isBrowserLinkTrackingEnabled),r.enableAutoRouteTracking=_n(r.enableAutoRouteTracking),r.namePrefix=r.namePrefix||"",r.enableDebug=_n(r.enableDebug),r.disableFlushOnBeforeUnload=_n(r.disableFlushOnBeforeUnload),r.disableFlushOnUnload=_n(r.disableFlushOnUnload,r.disableFlushOnBeforeUnload),r},e.Version="2.7.4",e}(Dn);var Nd=function(){function t(e,r){var n=this,i={};n.start=function(a){typeof i[a]<"u"&&e.throwInternal(Ne.WARNING,Ie.StartCalledMoreThanOnce,"start was called more than once for this event without calling stop.",{name:a,key:a},!0),i[a]=+new Date},n.stop=function(a,o,l,c){var d=i[a];if(isNaN(d))e.throwInternal(Ne.WARNING,Ie.StopCalledWithoutStart,"stop was called without a corresponding start.",{name:a,key:a},!0);else{var w=+new Date,k=Tr(d,w);n.action(a,o,k,l,c)}delete i[a],i[a]=void 0}}return t}();var Fd=function(){function t(e,r){var n=[],i=!1;this._get=function(){return n},this._set=function(a){return n=a,n},Tt(t,this,function(a){a.enqueue=function(o){if(a.count()>=r.eventsLimitInMem()){i||(e.throwInternal(Ne.WARNING,Ie.InMemoryStorageBufferFull,"Maximum in-memory buffer size reached: "+a.count(),!0),i=!0);return}n.push(o)},a.count=function(){return n.length},a.size=function(){for(var o=n.length,l=0;l<n.length;l++)o+=n[l].length;return r.emitLineDelimitedJson()||(o+=2),o},a.clear=function(){n=[],i=!1},a.getItems=function(){return n.slice(0)},a.batchPayloads=function(o){if(o&&o.length>0){var l=r.emitLineDelimitedJson()?o.join(`
20
+ `):"["+o.join(",")+"]";return l}return null}})}return t}(),Od=function(t){pt(e,t);function e(r,n){var i=t.call(this,r,n)||this;return Tt(e,i,function(a,o){a.markAsSent=function(l){o.clear()},a.clearSent=function(l){}}),i}return e}(Fd);var Ud=function(t){pt(e,t);function e(r,n){var i=t.call(this,r,n)||this,a=!1;return Tt(e,i,function(o,l){var c=H(e.BUFFER_KEY),d=H(e.SENT_BUFFER_KEY),w=o._set(c.concat(d));w.length>e.MAX_BUFFER_SIZE&&(w.length=e.MAX_BUFFER_SIZE),V(e.SENT_BUFFER_KEY,[]),V(e.BUFFER_KEY,w),o.enqueue=function(x){if(o.count()>=e.MAX_BUFFER_SIZE){a||(r.throwInternal(Ne.WARNING,Ie.SessionStorageBufferFull,"Maximum buffer size reached: "+o.count(),!0),a=!0);return}l.enqueue(x),V(e.BUFFER_KEY,o._get())},o.clear=function(){l.clear(),V(e.BUFFER_KEY,o._get()),V(e.SENT_BUFFER_KEY,[]),a=!1},o.markAsSent=function(x){V(e.BUFFER_KEY,o._set(k(x,o._get())));var K=H(e.SENT_BUFFER_KEY);K instanceof Array&&x instanceof Array&&(K=K.concat(x),K.length>e.MAX_BUFFER_SIZE&&(r.throwInternal(Ne.CRITICAL,Ie.SessionStorageBufferFull,"Sent buffer reached its maximum size: "+K.length,!0),K.length=e.MAX_BUFFER_SIZE),V(e.SENT_BUFFER_KEY,K))},o.clearSent=function(x){var K=H(e.SENT_BUFFER_KEY);K=k(x,K),V(e.SENT_BUFFER_KEY,K)};function k(x,K){var E=[];return ot(K,function(z){!dt(z)&&Kn(x,z)===-1&&E.push(z)}),E}function H(x){var K=x;try{K=n.namePrefix&&n.namePrefix()?n.namePrefix()+"_"+K:K;var E=Va(r,K);if(E){var z=Rr().parse(E);if(at(z)&&(z=Rr().parse(z)),z&&yr(z))return z}}catch(U){r.throwInternal(Ne.CRITICAL,Ie.FailedToRestoreStorageBuffer," storage key: "+K+", "+wt(U),{exception:ct(U)})}return[]}function V(x,K){var E=x;try{E=n.namePrefix&&n.namePrefix()?n.namePrefix()+"_"+E:E;var z=JSON.stringify(K);qa(r,E,z)}catch(U){qa(r,E,JSON.stringify([])),r.throwInternal(Ne.WARNING,Ie.FailedToSetStorageBuffer," storage key: "+E+", "+wt(U)+". Buffer cleared",{exception:ct(U)})}}}),i}return e.BUFFER_KEY="AI_buffer",e.SENT_BUFFER_KEY="AI_sentBuffer",e.MAX_BUFFER_SIZE=2e3,e}(Fd);var Fc="baseType",tr="baseData",Ir="properties",Hd="true";function gr(t,e,r){return xt(t,e,r,Ba)}function ap(t,e,r){var n=r.tags=r.tags||{},i=e.ext=e.ext||{},a=e.tags=e.tags||[],o=i.user;o&&(gr(n,Ht.userAuthUserId,o.authId),gr(n,Ht.userId,o.id||o.localId));var l=i.app;l&&gr(n,Ht.sessionId,l.sesId);var c=i.device;c&&(gr(n,Ht.deviceId,c.id||c.localId),gr(n,Ht.deviceType,c.deviceClass),gr(n,Ht.deviceIp,c.ip),gr(n,Ht.deviceModel,c.model),gr(n,Ht.deviceType,c.deviceType));var d=e.ext.web;if(d){gr(n,Ht.deviceLanguage,d.browserLang),gr(n,Ht.deviceBrowserVersion,d.browserVer),gr(n,Ht.deviceBrowser,d.browser);var w=r.data=r.data||{},k=w[tr]=w[tr]||{},H=k[Ir]=k[Ir]||{};gr(H,"domain",d.domain),gr(H,"isManual",d.isManual?Hd:null),gr(H,"screenRes",d.screenRes),gr(H,"userConsent",d.userConsent?Hd:null)}var V=i.os;V&&gr(n,Ht.deviceOS,V.name);var x=i.trace;x&&(gr(n,Ht.operationParentId,x.parentID),gr(n,Ht.operationName,Ut(t,x.name)),gr(n,Ht.operationId,x.traceID));for(var K={},E=a.length-1;E>=0;E--){var z=a[E];Lt(z,function(J,Z){K[J]=Z}),a.splice(E,1)}Lt(a,function(J,Z){K[J]=Z});var U=ur(ur({},n),K);U[Ht.internalSdkVersion]||(U[Ht.internalSdkVersion]="javascript:".concat(op.Version)),r.tags=Hs(U)}function Mi(t,e,r){Oe(t)||Lt(t,function(n,i){Pa(i)?r[n]=i:at(i)?e[n]=i:kn()&&(e[n]=Rr().stringify(i))})}function sa(t,e){Oe(t)||Lt(t,function(r,n){t[r]=n||e})}function la(t,e,r,n){var i=new a0(t,n,e);gr(i,"sampleRate",r[Ua]),(r[tr]||{}).startTime&&(i.time=Fr(r[tr].startTime)),i.iKey=r.iKey;var a=r.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),ap(t,r,i),r.tags=r.tags||[],Hs(i)}function ca(t,e){Oe(e[tr])&&t.throwInternal(Ne.CRITICAL,Ie.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.")}var op={Version:"2.7.4"};function Vd(t,e,r){ca(t,e);var n=e[tr].measurements||{},i=e[tr][Ir]||{};Mi(e.data,i,n),Oe(r)||sa(i,r);var a=e[tr];if(Oe(a))return t.warnToConsole("Invalid input for dependency data"),null;var o=a[Ir]&&a[Ir][Uo]?a[Ir][Uo]:"GET",l=new ln(t,a.id,a.target,a.name,a.duration,a.success,a.responseCode,o,a.type,a.correlationContext,i,n),c=new Zn(ln.dataType,l);return la(t,ln.envelopeType,e,c)}function Oc(t,e,r){ca(t,e);var n={},i={};e[Fc]!==on.dataType&&(n.baseTypeSource=e[Fc]),e[Fc]===on.dataType?(n=e[tr][Ir]||{},i=e[tr].measurements||{}):e[tr]&&Mi(e[tr],n,i),Mi(e.data,n,i),Oe(r)||sa(n,r);var a=e[tr].name,o=new on(t,a,n,i),l=new Zn(on.dataType,o);return la(t,on.envelopeType,e,l)}function qd(t,e,r){ca(t,e);var n=e[tr].measurements||{},i=e[tr][Ir]||{};Mi(e.data,i,n),Oe(r)||sa(i,r);var a=e[tr],o=Mr.CreateFromInterface(t,a,i,n),l=new Zn(Mr.dataType,o);return la(t,Mr.envelopeType,e,l)}function zd(t,e,r){ca(t,e);var n=e[tr],i=n[Ir]||{},a=n.measurements||{};Mi(e.data,i,a),Oe(r)||sa(i,r);var o=new sn(t,n.name,n.average,n.sampleCount,n.min,n.max,n.stdDev,i,a),l=new Zn(sn.dataType,o);return la(t,sn.envelopeType,e,l)}function jd(t,e,r){ca(t,e);var n="duration",i,a=e[tr];!Oe(a)&&!Oe(a[Ir])&&!Oe(a[Ir][n])?(i=a[Ir][n],delete a[Ir][n]):!Oe(e.data)&&!Oe(e.data[n])&&(i=e.data[n],delete e.data[n]);var o=e[tr],l;((e.ext||{}).trace||{}).traceID&&(l=e.ext.trace.traceID);var c=o.id||l,d=o.name,w=o.uri,k=o[Ir]||{},H=o.measurements||{};if(Oe(o.refUri)||(k.refUri=o.refUri),Oe(o.pageType)||(k.pageType=o.pageType),Oe(o.isLoggedIn)||(k.isLoggedIn=o.isLoggedIn.toString()),!Oe(o[Ir])){var V=o[Ir];Lt(V,function(E,z){k[E]=z})}Mi(e.data,k,H),Oe(r)||sa(k,r);var x=new Hr(t,d,w,i,k,H,c),K=new Zn(Hr.dataType,x);return la(t,Hr.envelopeType,e,K)}function Gd(t,e,r){ca(t,e);var n=e[tr],i=n.name,a=n.uri||n.url,o=n[Ir]||{},l=n.measurements||{};Mi(e.data,o,l),Oe(r)||sa(o,r);var c=new On(t,i,a,void 0,o,l,n),d=new Zn(On.dataType,c);return la(t,On.envelopeType,e,d)}function Xd(t,e,r){ca(t,e);var n=e[tr].message,i=e[tr].severityLevel,a=e[tr][Ir]||{},o=e[tr].measurements||{};Mi(e.data,a,o),Oe(r)||sa(a,r);var l=new Fn(t,n,i,a,o),c=new Zn(Fn.dataType,l);return la(t,Fn.envelopeType,e,c)}var Wd=function(){function t(e){Tt(t,this,function(r){r.serialize=function(o){var l=n(o,"root");try{return Rr().stringify(l)}catch(c){e.throwInternal(Ne.CRITICAL,Ie.CannotSerializeObject,c&&dt(c.toString)?c.toString():"Error serializing object",null,!0)}};function n(o,l){var c="__aiCircularRefCheck",d={};if(!o)return e.throwInternal(Ne.CRITICAL,Ie.CannotSerializeObject,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(o[c])return e.throwInternal(Ne.WARNING,Ie.CircularReferenceDetected,"Circular reference detected while serializing object",{name:l},!0),d;if(!o.aiDataContract){if(l==="measurements")d=a(o,"number",l);else if(l==="properties")d=a(o,"string",l);else if(l==="tags")d=a(o,"string",l);else if(yr(o))d=i(o,l);else{e.throwInternal(Ne.WARNING,Ie.CannotSerializeObjectNonSerializable,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{Rr().stringify(o),d=o}catch(w){e.throwInternal(Ne.CRITICAL,Ie.CannotSerializeObject,w&&dt(w.toString)?w.toString():"Error serializing object",null,!0)}}return d}return o[c]=!0,Lt(o.aiDataContract,function(w,k){var H=dt(k)?k()&1:k&1,V=dt(k)?k()&4:k&4,x=k&2,K=o[w]!==void 0,E=Pn(o[w])&&o[w]!==null;if(H&&!K&&!x)e.throwInternal(Ne.CRITICAL,Ie.MissingRequiredFieldSpecification,"Missing required field specification. The field is required but not present on source",{field:w,name:l});else if(!V){var z=void 0;E?x?z=i(o[w],w):z=n(o[w],w):z=o[w],z!==void 0&&(d[w]=z)}}),delete o[c],d}function i(o,l){var c;if(o)if(!yr(o))e.throwInternal(Ne.CRITICAL,Ie.ItemNotInArray,`This field was specified as an array in the contract but the item is not an array.\r
21
+ `,{name:l},!0);else{c=[];for(var d=0;d<o.length;d++){var w=o[d],k=n(w,l+"["+d+"]");c.push(k)}}return c}function a(o,l,c){var d;return o&&(d={},Lt(o,function(w,k){if(l==="string")k===void 0?d[w]="undefined":k===null?d[w]="null":k.toString?d[w]=k.toString():d[w]="invalid field: toString() is not defined.";else if(l==="number")if(k===void 0)d[w]="undefined";else if(k===null)d[w]="null";else{var H=parseFloat(k);isNaN(H)?d[w]="NaN":d[w]=H}else d[w]="invalid field: "+c+" is of unknown type.",e.throwInternal(Ne.CRITICAL,d[w],null,!0)})),d}})}return t}();var sp=function(){function t(){var e=Yn(),r=pr(),n=!1,i=!0;Tt(t,this,function(a){try{if(e&&Bn(e,"online",c)&&(Bn(e,"offline",d),n=!0),r){var o=r.body||r;or(o.ononline)||(o.ononline=c,o.onoffline=d,n=!0)}if(n){var l=kr();l&&!Oe(l.onLine)&&(i=l.onLine)}}catch{n=!1}a.isListening=n,a.isOnline=function(){var w=!0,k=kr();return n?w=i:k&&!Oe(k.onLine)&&(w=k.onLine),w},a.isOffline=function(){return!a.isOnline()};function c(){i=!0}function d(){i=!1}})}return t.Offline=new t,t}();var Uc=sp.Offline;var lp=8,Kd=function(){function t(){}return t.prototype.getHashCodeScore=function(e){var r=this.getHashCode(e)/t.INT_MAX_VALUE;return r*100},t.prototype.getHashCode=function(e){if(e==="")return 0;for(;e.length<lp;)e=e.concat(e);for(var r=5381,n=0;n<e.length;++n)r=(r<<5)+r+e.charCodeAt(n),r=r&r;return Math.abs(r)},t.INT_MAX_VALUE=2147483647,t}();var Yd=function(){function t(){var e=this,r=new Kd,n=new Ka;e.getSamplingScore=function(i){var a=0;return i.tags&&i.tags[n.userId]?a=r.getHashCodeScore(i.tags[n.userId]):i.ext&&i.ext.user&&i.ext.user.id?a=r.getHashCodeScore(i.ext.user.id):i.tags&&i.tags[n.operationId]?a=r.getHashCodeScore(i.tags[n.operationId]):i.ext&&i.ext.telemetryTrace&&i.ext.telemetryTrace.traceID?a=r.getHashCodeScore(i.ext.telemetryTrace.traceID):a=Math.random()*100,a}}return t}();var $d=function(){function t(e,r){this.INT_MAX_VALUE=2147483647;var n=r||oi(null);(e>100||e<0)&&(n.throwInternal(Ne.WARNING,Ie.SampleRateOutOfRange,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this.sampleRate=e,this.samplingScoreGenerator=new Yd}return t.prototype.isSampledIn=function(e){var r=this.sampleRate,n=!1;return r==null||r>=100||e.baseType===sn.dataType?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)<r,n)},t}();var ui,cp=65e3;function u0(t){try{return t.responseText}catch{}return null}function Zd(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},disableXhr:function(){return!1},onunloadDisableFetch:function(){return!1},onunloadDisableBeacon:function(){return!1},instrumentationKey:function(){},namePrefix:function(){},samplingPercentage:function(){return 100},customHeaders:function(){},convertUndefined:function(){},eventsLimitInMem:function(){return 1e4}}}var up=(ui={},ui[on.dataType]=Oc,ui[Fn.dataType]=Xd,ui[Hr.dataType]=jd,ui[On.dataType]=Gd,ui[Mr.dataType]=qd,ui[sn.dataType]=zd,ui[ln.dataType]=Vd,ui),Hc=function(t){pt(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=jo;var n,i,a,o=!1,l,c,d,w={},k=0,H,V;return r._senderConfig=Zd(),Tt(e,r,function(x,K){function E(){Br("Method not implemented.")}x.pause=function(){Vt(),o=!0},x.resume=function(){o&&(o=!1,i=null,x._buffer.size()>x._senderConfig.maxBatchSizeInBytes()&&x.triggerSend(!0,null,10),Yt())},x.flush=function(){if(!o){Vt();try{x.triggerSend(!0,null,1)}catch(de){x.diagLog().throwInternal(Ne.CRITICAL,Ie.FlushFailed,"flush failed, telemetry will not be collected: "+wt(de),{exception:ct(de)})}}},x.onunloadFlush=function(){if(!o)if((x._senderConfig.onunloadDisableBeacon()===!1||x._senderConfig.isBeaconApiDisabled()===!1)&&$i())try{x.triggerSend(!0,Z,2)}catch(de){x.diagLog().throwInternal(Ne.CRITICAL,Ie.FailedToSendQueuedTelemetry,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+wt(de),{exception:ct(de)})}else x.flush()},x.teardown=E,x.addHeader=function(de,Ve){w[de]=Ve},x.initialize=function(de,Ve,$e,ce){K.initialize(de,Ve,$e,ce);var xe=x._getTelCtx(),ke=x.identifier;c=new Wd(Ve.logger),n=0,i=null,a=0,x._sender=null,d=0;var Me=x.diagLog(),Te=Zd();Lt(Te,function(ut,ht){x._senderConfig[ut]=function(){return xe.getConfig(ke,ut,ht())}}),x._buffer=x._senderConfig.enableSessionStorageBuffer()&&ia()?new Ud(Me,x._senderConfig):new Od(Me,x._senderConfig),x._sample=new $d(x._senderConfig.samplingPercentage(),Me),A(de)||Me.throwInternal(Ne.CRITICAL,Ie.InvalidInstrumentationKey,"Invalid Instrumentation key "+de.instrumentationKey),!aa(x._senderConfig.endpointUrl())&&x._senderConfig.customHeaders()&&x._senderConfig.customHeaders().length>0&&ot(x._senderConfig.customHeaders(),function(ut){r.addHeader(ut.header,ut.value)});var Je=x._senderConfig,qe=null;!Je.disableXhr()&&zs()?qe=Et:!Je.disableXhr()&&Zi()&&(qe=Ee),!qe&&qs()&&(qe=tt),H=qe||Ee,!Je.isBeaconApiDisabled()&&$i()&&(qe=Ce),x._sender=qe||Ee,!Je.onunloadDisableFetch()&&qs(!0)?V=rt:$i()?V=Ce:!Je.disableXhr()&&zs()?V=Et:!Je.disableXhr()&&Zi()?V=Ee:V=H},x.processTelemetry=function(de,Ve){Ve=x._getTelCtx(Ve);try{if(x._senderConfig.disableTelemetry())return;if(!de){Ve.diagLog().throwInternal(Ne.CRITICAL,Ie.CannotSendEmptyTelemetry,"Cannot send empty telemetry");return}if(de.baseData&&!de.baseType){Ve.diagLog().throwInternal(Ne.CRITICAL,Ie.InvalidEvent,"Cannot send telemetry without baseData and baseType");return}if(de.baseType||(de.baseType="EventData"),!x._sender){Ve.diagLog().throwInternal(Ne.CRITICAL,Ie.SenderNotInitialized,"Sender was not initialized");return}if(z(de))de[Ua]=x._sample.sampleRate;else{Ve.diagLog().throwInternal(Ne.WARNING,Ie.TelemetrySampledAndNotSent,"Telemetry item was sampled out and not sent",{SampleRate:x._sample.sampleRate});return}var $e=x._senderConfig.convertUndefined()||void 0,ce=de.iKey||x._senderConfig.instrumentationKey(),xe=e.constructEnvelope(de,ce,Ve.diagLog(),$e);if(!xe){Ve.diagLog().throwInternal(Ne.CRITICAL,Ie.CreateEnvelopeError,"Unable to create an AppInsights envelope");return}var ke=!1;if(de.tags&&de.tags[Ha]&&(ot(de.tags[Ha],function(qe){try{qe&&qe(xe)===!1&&(ke=!0,Ve.diagLog().warnToConsole("Telemetry processor check returns false"))}catch(ut){Ve.diagLog().throwInternal(Ne.CRITICAL,Ie.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+wt(ut),{exception:ct(ut)},!0)}}),delete de.tags[Ha]),ke)return;var Me=c.serialize(xe),Te=x._buffer,Je=Te.size();Je+Me.length>x._senderConfig.maxBatchSizeInBytes()&&x.triggerSend(!0,null,10),Te.enqueue(Me),Yt()}catch(qe){Ve.diagLog().throwInternal(Ne.WARNING,Ie.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+wt(qe),{exception:ct(qe)})}x.processNext(de,Ve)},x._xhrReadyStateChange=function(de,Ve,$e){de.readyState===4&&U(de.status,Ve,de.responseURL,$e,vt(de),u0(de)||de.response)},x.triggerSend=function(de,Ve,$e){if(de===void 0&&(de=!0),!o)try{var ce=x._buffer;if(x._senderConfig.disableTelemetry())ce.clear();else{if(ce.count()>0){var xe=ce.getItems();et($e||0,de),Ve?Ve.call(r,xe,de):x._sender(xe,de)}a=+new Date}Vt()}catch(Me){var ke=Da();(!ke||ke>9)&&x.diagLog().throwInternal(Ne.CRITICAL,Ie.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+wt(Me),{exception:ct(Me)})}},x._onError=function(de,Ve,$e){x.diagLog().throwInternal(Ne.WARNING,Ie.OnError,"Failed to send telemetry.",{message:Ve}),x._buffer.clearSent(de)},x._onPartialSuccess=function(de,Ve){for(var $e=[],ce=[],xe=Ve.errors.reverse(),ke=0,Me=xe;ke<Me.length;ke++){var Te=Me[ke],Je=de.splice(Te.index,1)[0];Ct(Te.statusCode)?ce.push(Je):$e.push(Je)}de.length>0&&x._onSuccess(de,Ve.itemsAccepted),$e.length>0&&x._onError($e,vt(null,["partial success",Ve.itemsAccepted,"of",Ve.itemsReceived].join(" "))),ce.length>0&&(sr(ce),x.diagLog().throwInternal(Ne.WARNING,Ie.TransmissionFailed,"Partial success. Delivered: "+de.length+", Failed: "+$e.length+". Will retry to send "+ce.length+" our of "+Ve.itemsReceived+" items"))},x._onSuccess=function(de,Ve){x._buffer.clearSent(de)},x._xdrOnLoad=function(de,Ve){var $e=u0(de);if(de&&($e+""=="200"||$e===""))n=0,x._onSuccess(Ve,0);else{var ce=yt($e);ce&&ce.itemsReceived&&ce.itemsReceived>ce.itemsAccepted&&!x._senderConfig.isRetryDisabled()?x._onPartialSuccess(Ve,ce):x._onError(Ve,At(de))}};function z(de){return x._sample.isSampledIn(de)}function U(de,Ve,$e,ce,xe,ke){var Me=null;if(x._appId||(Me=yt(ke),Me&&Me.appId&&(x._appId=Me.appId)),(de<200||de>=300)&&de!==0){if((de===301||de===307||de===308)&&!J($e)){x._onError(Ve,xe);return}!x._senderConfig.isRetryDisabled()&&Ct(de)?(sr(Ve),x.diagLog().throwInternal(Ne.WARNING,Ie.TransmissionFailed,". Response code "+de+". Will retry to send "+Ve.length+" items.")):x._onError(Ve,xe)}else if(Uc.isOffline()){if(!x._senderConfig.isRetryDisabled()){var Te=10;sr(Ve,Te),x.diagLog().throwInternal(Ne.WARNING,Ie.TransmissionFailed,". Offline - Response Code: ".concat(de,". Offline status: ").concat(Uc.isOffline(),". Will retry to send ").concat(Ve.length," items."))}}else J($e),de===206?(Me||(Me=yt(ke)),Me&&!x._senderConfig.isRetryDisabled()?x._onPartialSuccess(Ve,Me):x._onError(Ve,xe)):(n=0,x._onSuccess(Ve,ce))}function J(de){return d>=10?!1:!Oe(de)&&de!==""&&de!==x._senderConfig.endpointUrl()?(x._senderConfig.endpointUrl=function(){return de},++d,!0):!1}function Z(de,Ve){V?V(de,!1):Ce(de,Ve)}function se(de){var Ve=kr(),$e=x._buffer,ce=x._senderConfig.endpointUrl(),xe=x._buffer.batchPayloads(de),ke=new Blob([xe],{type:"text/plain;charset=UTF-8"}),Me=Ve.sendBeacon(ce,ke);return Me&&($e.markAsSent(de),x._onSuccess(de,de.length)),Me}function Ce(de,Ve){if(yr(de)&&de.length>0&&!se(de)){for(var $e=[],ce=0;ce<de.length;ce++){var xe=de[ce];se([xe])||$e.push(xe)}$e.length>0&&(H($e,!0),x.diagLog().throwInternal(Ne.WARNING,Ie.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with normal sender."))}}function Ee(de,Ve){var $e=new XMLHttpRequest,ce=x._senderConfig.endpointUrl();try{$e[Nn]=!0}catch{}$e.open("POST",ce,Ve),$e.setRequestHeader("Content-type","application/json"),aa(ce)&&$e.setRequestHeader(Ot.sdkContextHeader,Ot.sdkContextHeaderAppIdRequest),ot(pn(w),function(ke){$e.setRequestHeader(ke,w[ke])}),$e.onreadystatechange=function(){return x._xhrReadyStateChange($e,de,de.length)},$e.onerror=function(ke){return x._onError(de,vt($e),ke)};var xe=x._buffer.batchPayloads(de);$e.send(xe),x._buffer.markAsSent(de)}function rt(de,Ve){if(yr(de)){for(var $e=de.length,ce=0;ce<de.length;ce++)$e+=de[ce].length;k+$e<=cp?Rt(de,!1):$i()?Ce(de,Ve):(H&&H(de,!0),x.diagLog().throwInternal(Ne.WARNING,Ie.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with xhrSender."))}}function tt(de,Ve){Rt(de,!0)}function Rt(de,Ve){var $e,ce=x._senderConfig.endpointUrl(),xe=x._buffer.batchPayloads(de),ke=new Blob([xe],{type:"application/json"}),Me=new Headers,Te=xe.length,Je=!1,qe=!1;aa(ce)&&Me.append(Ot.sdkContextHeader,Ot.sdkContextHeaderAppIdRequest),ot(pn(w),function(Se){Me.append(Se,w[Se])});var ut=($e={method:"POST",headers:Me,body:ke},$e[Nn]=!0,$e);Ve||(ut.keepalive=!0,Je=!0,k+=Te);var ht=new Request(ce,ut);try{ht[Nn]=!0}catch{}x._buffer.markAsSent(de);try{fetch(ht).then(function(Se){Ve||(k-=Te,Te=0),qe||(qe=!0,Se.ok?Se.text().then(function(qt){U(Se.status,de,Se.url,de.length,Se.statusText,qt)}):x._onError(de,Se.statusText))}).catch(function(Se){Ve||(k-=Te,Te=0),qe||(qe=!0,x._onError(de,Se.message))})}catch(Se){qe||x._onError(de,ct(Se))}Je&&!qe&&(qe=!0,x._onSuccess(de,de.length))}function yt(de){try{if(de&&de!==""){var Ve=Rr().parse(de);if(Ve&&Ve.itemsReceived&&Ve.itemsReceived>=Ve.itemsAccepted&&Ve.itemsReceived-Ve.itemsAccepted===Ve.errors.length)return Ve}}catch($e){x.diagLog().throwInternal(Ne.CRITICAL,Ie.InvalidBackendResponse,"Cannot parse the response. "+wt($e),{response:de})}return null}function sr(de,Ve){if(Ve===void 0&&(Ve=1),!(!de||de.length===0)){var $e=x._buffer;$e.clearSent(de),n++;for(var ce=0,xe=de;ce<xe.length;ce++){var ke=xe[ce];$e.enqueue(ke)}Pt(Ve),Yt()}}function Pt(de){var Ve=10,$e;if(n<=1)$e=Ve;else{var ce=(Math.pow(2,n)-1)/2,xe=Math.floor(Math.random()*ce*Ve)+1;xe=de*xe,$e=Math.max(Math.min(xe,3600),Ve)}var ke=xr()+$e*1e3;i=ke}function Yt(){if(!l&&!o){var de=i?Math.max(0,i-xr()):0,Ve=Math.max(x._senderConfig.maxBatchInterval(),de);l=setTimeout(function(){l=null,x.triggerSend(!0,null,1)},Ve)}}function Vt(){clearTimeout(l),l=null,i=null}function Ct(de){return de===408||de===429||de===500||de===503}function vt(de,Ve){return de?"XMLHttpRequest,Status:"+de.status+",Response:"+u0(de)||de.response||"":Ve}function Et(de,Ve){var $e=x._buffer,ce=Yn(),xe=new XDomainRequest;xe.onload=function(){return x._xdrOnLoad(xe,de)},xe.onerror=function(Je){return x._onError(de,At(xe),Je)};var ke=ce&&ce.location&&ce.location.protocol||"";if(x._senderConfig.endpointUrl().lastIndexOf(ke,0)!==0){x.diagLog().throwInternal(Ne.WARNING,Ie.TransmissionFailed,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),$e.clear();return}var Me=x._senderConfig.endpointUrl().replace(/^(https?:)/,"");xe.open("POST",Me);var Te=$e.batchPayloads(de);xe.send(Te),$e.markAsSent(de)}function At(de,Ve){return de?"XDomainRequest,Response:"+u0(de)||"":Ve}function bt(){var de="getNotifyMgr";return x.core[de]?x.core[de]():x.core._notificationManager}function et(de,Ve){var $e=bt();if($e&&$e.eventsSendRequest)try{$e.eventsSendRequest(de,Ve)}catch(ce){x.diagLog().throwInternal(Ne.CRITICAL,Ie.NotificationException,"send request notification failed: "+wt(ce),{exception:ct(ce)})}}function A(de){var Ve=Oe(de.disableInstrumentationKeyValidation)?!1:de.disableInstrumentationKeyValidation;if(Ve)return!0;var $e="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",ce=new RegExp($e);return ce.test(de.instrumentationKey)}}),r}return e.constructEnvelope=function(r,n,i,a){var o;n!==r.iKey&&!Oe(n)?o=ur(ur({},r),{iKey:n}):o=r;var l=up[o.baseType]||Oc;return l(i,o,a)},e}(Dn);var dp="ai_session",Vc=function(){function t(){}return t}();var Qd=function(){function t(e,r){var n=this,i,a,o=oi(r),l=Ji(r);Tt(t,n,function(c){e||(e={}),dt(e.sessionExpirationMs)||(e.sessionExpirationMs=function(){return t.acquisitionSpan}),dt(e.sessionRenewalMs)||(e.sessionRenewalMs=function(){return t.renewalSpan}),c.config=e;var d=c.config.sessionCookiePostfix&&c.config.sessionCookiePostfix()?c.config.sessionCookiePostfix():c.config.namePrefix&&c.config.namePrefix()?c.config.namePrefix():"";i=function(){return dp+d},c.automaticSession=new Vc,c.update=function(){var K=xr(),E=!1,z=c.automaticSession;z.id||(E=!w(z,K));var U=c.config.sessionExpirationMs();if(!E&&U>0){var J=c.config.sessionRenewalMs(),Z=K-z.acquisitionDate,se=K-z.renewalDate;E=Z<0||se<0,E=E||Z>U,E=E||se>J}E?H(K):(!a||K-a>t.cookieUpdateInterval)&&V(z,K)},c.backup=function(){var K=c.automaticSession;x(K.id,K.acquisitionDate,K.renewalDate)};function w(K,E){var z=!1,U=l.get(i());if(U&&dt(U.split))z=k(K,U);else{var J=Sc(o,i());J&&(z=k(K,J))}return z||!!K.id}function k(K,E){var z=!1,U=", session will be reset",J=E.split("|");if(J.length>=2)try{var Z=+J[1]||0,se=+J[2]||0;isNaN(Z)||Z<=0?o.throwInternal(Ne.WARNING,Ie.SessionRenewalDateIsZero,"AI session acquisition date is 0"+U):isNaN(se)||se<=0?o.throwInternal(Ne.WARNING,Ie.SessionRenewalDateIsZero,"AI session renewal date is 0"+U):J[0]&&(K.id=J[0],K.acquisitionDate=Z,K.renewalDate=se,z=!0)}catch(Ce){o.throwInternal(Ne.CRITICAL,Ie.ErrorParsingAISessionCookie,"Error parsing ai_session value ["+(E||"")+"]"+U+" - "+wt(Ce),{exception:ct(Ce)})}return z}function H(K){var E=c.config||{},z=(E.getNewId?E.getNewId():null)||Oa;c.automaticSession.id=z(E.idLength?E.idLength():22),c.automaticSession.acquisitionDate=K,V(c.automaticSession,K),t0()||o.throwInternal(Ne.WARNING,Ie.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")}function V(K,E){var z=K.acquisitionDate;K.renewalDate=E;var U=c.config,J=U.sessionRenewalMs(),Z=z+U.sessionExpirationMs()-E,se=[K.id,z,E],Ce=0;Z<J?Ce=Z/1e3:Ce=J/1e3;var Ee=U.cookieDomain?U.cookieDomain():null;l.set(i(),se.join("|"),U.sessionExpirationMs()>0?Ce:null,Ee),a=E}function x(K,E,z){yc(o,i(),[K,E,z].join("|"))}})}return t.acquisitionSpan=864e5,t.renewalSpan=18e5,t.cookieUpdateInterval=6e4,t}();var Jd=function(){function t(){}return t}();var ef=function(){function t(){this.id="browser",this.deviceClass="Browser"}return t}();var fp="2.7.4",tf=function(){function t(e){this.sdkVersion=(e.sdkExtension&&e.sdkExtension()?e.sdkExtension()+"_":"")+"javascript:"+fp}return t}();function rf(t){return!(typeof t!="string"||!t||t.match(/,|;|=| |\|/))}var nf=function(){function t(e,r){this.isNewUser=!1,this.isUserCookieSet=!1;var n=oi(r),i=Ji(r),a;Tt(t,this,function(o){o.config=e;var l=o.config.userCookiePostfix&&o.config.userCookiePostfix()?o.config.userCookiePostfix():"";a=function(){return t.userCookieName+l};var c=i.get(a());if(c){o.isNewUser=!1;var d=c.split(t.cookieSeparator);d.length>0&&(o.id=d[0],o.isUserCookieSet=!!o.id)}function w(){var z=e||{},U=(z.getNewId?z.getNewId():null)||Oa,J=U(z.idLength?e.idLength():22);return J}function k(z){var U=Fr(new Date);o.accountAcquisitionDate=U,o.isNewUser=!0;var J=[z,U];return J}function H(z){var U=31536e3;o.isUserCookieSet=i.set(a(),z,U)}if(!o.id){o.id=w();var V=k(o.id);H(V.join(t.cookieSeparator));var x=e.namePrefix&&e.namePrefix()?e.namePrefix()+"ai_session":"ai_session";xc(n,x)}o.accountId=e.accountId?e.accountId():void 0;var K=i.get(t.authUserCookieName);if(K){K=decodeURI(K);var E=K.split(t.cookieSeparator);E[0]&&(o.authenticatedId=E[0]),E.length>1&&E[1]&&(o.accountId=E[1])}o.setAuthenticatedUserContext=function(z,U,J){J===void 0&&(J=!1);var Z=!rf(z)||U&&!rf(U);if(Z){n.throwInternal(Ne.WARNING,Ie.SetAuthContextFailedAccountName,"Setting auth user context failed. User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.",!0);return}o.authenticatedId=z;var se=o.authenticatedId;U&&(o.accountId=U,se=[o.authenticatedId,o.accountId].join(t.cookieSeparator)),J&&i.set(t.authUserCookieName,encodeURI(se))},o.clearAuthenticatedUserContext=function(){o.authenticatedId=null,o.accountId=null,i.del(t.authUserCookieName)},o.update=function(z){if(o.id!==z||!o.isUserCookieSet){var U=z||w(),J=k(U);H(J.join(t.cookieSeparator))}}})}return t.cookieSeparator="|",t.userCookieName="ai_user",t.authUserCookieName="ai_authUser",t}();var af=function(){function t(){}return t}();var of=function(){function t(e,r,n,i){var a=this;a.traceID=e||Yr(),a.parentID=r,a.name=n;var o=rn();!n&&o&&o.pathname&&(a.name=o.pathname),a.name=Ut(i,a.name)}return t}();var d0="ext",f0="tags";function Ya(t,e){t&&t[e]&&pn(t[e]).length===0&&delete t[e]}var sf=function(){function t(e,r){var n=this,i=e.logger;this.appId=function(){return null},this.getSessionId=function(){return null},Tt(t,this,function(a){a.application=new Jd,a.internal=new tf(r),Ki()&&(a.sessionManager=new Qd(r,e),a.device=new ef,a.location=new af,a.user=new nf(r,e),a.telemetryTrace=new of(void 0,void 0,void 0,i),a.session=new Vc),a.getSessionId=function(){var o=a.session,l=null;if(o&&at(o.id))l=o.id;else{var c=(a.sessionManager||{}).automaticSession;l=c&&at(c.id)?c.id:null}return l},a.applySessionContext=function(o,l){xt(wr(o.ext,Vr.AppExt),"sesId",a.getSessionId(),at)},a.applyOperatingSystemContxt=function(o,l){xt(o.ext,Vr.OSExt,a.os)},a.applyApplicationContext=function(o,l){var c=a.application;if(c){var d=wr(o,f0);xt(d,Ht.applicationVersion,c.ver,at),xt(d,Ht.applicationBuild,c.build,at)}},a.applyDeviceContext=function(o,l){var c=a.device;if(c){var d=wr(wr(o,d0),Vr.DeviceExt);xt(d,"localId",c.id,at),xt(d,"ip",c.ip,at),xt(d,"model",c.model,at),xt(d,"deviceClass",c.deviceClass,at)}},a.applyInternalContext=function(o,l){var c=a.internal;if(c){var d=wr(o,f0);xt(d,Ht.internalAgentVersion,c.agentVersion,at),xt(d,Ht.internalSdkVersion,c.sdkVersion,at),(o.baseType===ai.dataType||o.baseType===Hr.dataType)&&(xt(d,Ht.internalSnippet,c.snippetVer,at),xt(d,Ht.internalSdkSrc,c.sdkSrc,at))}},a.applyLocationContext=function(o,l){var c=n.location;c&&xt(wr(o,f0,[]),Ht.locationIp,c.ip,at)},a.applyOperationContext=function(o,l){var c=a.telemetryTrace;if(c){var d=wr(wr(o,d0),Vr.TraceExt,{traceID:void 0,parentID:void 0});xt(d,"traceID",c.traceID,at),xt(d,"name",c.name,at),xt(d,"parentID",c.parentID,at)}},a.applyWebContext=function(o,l){var c=n.web;c&&xt(wr(o,d0),Vr.WebExt,c)},a.applyUserContext=function(o,l){var c=a.user;if(c){var d=wr(o,f0,[]);xt(d,Ht.userAccountId,c.accountId,at);var w=wr(wr(o,d0),Vr.UserExt);xt(w,"id",c.id,at),xt(w,"authId",c.authenticatedId,at)}},a.cleanUp=function(o,l){var c=o.ext;c&&(Ya(c,Vr.DeviceExt),Ya(c,Vr.UserExt),Ya(c,Vr.WebExt),Ya(c,Vr.OSExt),Ya(c,Vr.AppExt),Ya(c,Vr.TraceExt))}})}return t}();var mp=function(t){pt(e,t);function e(){var r=t.call(this)||this;r.priority=110,r.identifier=Ii;var n,i;return Tt(e,r,function(a,o){a.initialize=function(c,d,w,k){o.initialize(c,d,w,k);var H=a._getTelCtx(),V=a.identifier,x=e.getDefaultConfig();i=i||{},Lt(x,function(K,E){i[K]=function(){return H.getConfig(V,K,E())}}),a.context=new sf(d,i),n=hc(w,jo),a.context.appId=function(){return n?n._appId:null},a._extConfig=i},a.processTelemetry=function(c,d){if(!Oe(c)){d=a._getTelCtx(d),c.name===Hr.envelopeType&&d.diagLog().resetInternalMessageCount();var w=a.context||{};w.session&&typeof a.context.session.id!="string"&&w.sessionManager&&w.sessionManager.update();var k=w.user;if(k&&!k.isUserCookieSet&&k.update(w.user.id),l(c,d),k&&k.isNewUser){k.isNewUser=!1;var H=new ai(Ie.SendBrowserInfoOnUserInit,(kr()||{}).userAgent||"");d.diagLog().logInternalMessage(Ne.CRITICAL,H)}a.processNext(c,d)}};function l(c,d){wr(c,"tags",[]),wr(c,"ext",{});var w=a.context;w.applySessionContext(c,d),w.applyApplicationContext(c,d),w.applyDeviceContext(c,d),w.applyOperationContext(c,d),w.applyUserContext(c,d),w.applyOperatingSystemContxt(c,d),w.applyWebContext(c,d),w.applyLocationContext(c,d),w.applyInternalContext(c,d),w.cleanUp(c,d)}}),r}return e.getDefaultConfig=function(){var r={instrumentationKey:function(){},accountId:function(){return null},sessionRenewalMs:function(){return 18e5},samplingPercentage:function(){return 100},sessionExpirationMs:function(){return 864e5},cookieDomain:function(){return null},sdkExtension:function(){return null},isBrowserLinkTrackingEnabled:function(){return!1},appId:function(){return null},getSessionId:function(){return null},namePrefix:function(){},sessionCookiePostfix:function(){},userCookiePostfix:function(){},idLength:function(){return 22},getNewId:function(){return null}};return r},e}(Dn),qc=mp;var cn="properties";function lf(t,e,r){var n=0,i=t[e],a=t[r];return i&&a&&(n=Tr(i,a)),n}function ua(t,e,r,n,i){var a=0,o=lf(r,n,i);return o&&(a=Pi(t,e,an(o))),a}function Pi(t,e,r){var n="ajaxPerf",i=0;if(t&&e&&r){var a=t[n]=t[n]||{};a[e]=r,i=1}return i}function vp(t,e){var r=t.perfTiming,n=e[cn]||{},i=0,a="name",o="Start",l="End",c="domainLookup",d="connect",w="redirect",k="request",H="response",V="duration",x="startTime",K=c+o,E=c+l,z=d+o,U=d+l,J=k+o,Z=k+l,se=H+o,Ce=H+l,Ee=w+o,rt=w=l,tt="transferSize",Rt="encodedBodySize",yt="decodedBodySize",sr="serverTiming";if(r){i|=ua(n,w,r,Ee,rt),i|=ua(n,c,r,K,E),i|=ua(n,d,r,z,U),i|=ua(n,k,r,J,Z),i|=ua(n,H,r,se,Ce),i|=ua(n,"networkConnect",r,x,U),i|=ua(n,"sentRequest",r,J,Ce);var Pt=r[V];Pt||(Pt=lf(r,x,Ce)||0),i|=Pi(n,V,Pt),i|=Pi(n,"perfTotal",Pt);var Yt=r[sr];if(Yt){var Vt={};ot(Yt,function(Ct,vt){var Et=Il(Ct[a]||""+vt),At=Vt[Et]||{};Lt(Ct,function(bt,et){(bt!==a&&at(et)||Pa(et))&&(At[bt]&&(et=At[bt]+";"+et),(et||!at(et))&&(At[bt]=et))}),Vt[Et]=At}),i|=Pi(n,sr,Vt)}i|=Pi(n,tt,r[tt]),i|=Pi(n,Rt,r[Rt]),i|=Pi(n,yt,r[yt])}else t.perfMark&&(i|=Pi(n,"missing",t.perfAttempts));i&&(e[cn]=n)}var hp=function(){function t(){var e=this;e.openDone=!1,e.setRequestHeaderDone=!1,e.sendDone=!1,e.abortDone=!1,e.stateChangeAttached=!1}return t}();var zc=function(){function t(e,r,n){var i=this,a=n,o="responseText";i.perfMark=null,i.completed=!1,i.requestHeadersSize=null,i.requestHeaders=null,i.responseReceivingDuration=null,i.callbackDuration=null,i.ajaxTotalDuration=null,i.aborted=0,i.pageUrl=null,i.requestUrl=null,i.requestSize=0,i.method=null,i.status=null,i.requestSentTime=null,i.responseStartedTime=null,i.responseFinishedTime=null,i.callbackFinishedTime=null,i.endTime=null,i.xhrMonitoringState=new hp,i.clientFailure=0,i.traceID=e,i.spanID=r,Tt(t,i,function(l){l.getAbsoluteUrl=function(){return l.requestUrl?r0(l.requestUrl):null},l.getPathName=function(){return l.requestUrl?li(a,n0(l.method,l.requestUrl)):null},l.CreateTrackItem=function(c,d,w){var k;if(l.ajaxTotalDuration=Math.round(Tr(l.requestSentTime,l.responseFinishedTime)*1e3)/1e3,l.ajaxTotalDuration<0)return null;var H=(k={id:"|"+l.traceID+"."+l.spanID,target:l.getAbsoluteUrl(),name:l.getPathName(),type:c,startTime:null,duration:l.ajaxTotalDuration,success:+l.status>=200&&+l.status<400,responseCode:+l.status,method:l.method},k[cn]={HttpMethod:l.method},k);if(l.requestSentTime&&(H.startTime=new Date,H.startTime.setTime(l.requestSentTime)),vp(l,H),d&&pn(l.requestHeaders).length>0&&(H[cn]=H[cn]||{},H[cn].requestHeaders=l.requestHeaders),w){var V=w();if(V){var x=V.correlationContext;if(x&&(H.correlationContext=x),V.headerMap&&pn(V.headerMap).length>0&&(H[cn]=H[cn]||{},H[cn].responseHeaders=V.headerMap),l.errorStatusText&&l.status>=400){var K=V.type;H[cn]=H[cn]||{},(K===""||K==="text")&&(H[cn][o]=V[o]?V.statusText+" - "+V[o]:V.statusText),K==="json"&&(H[cn][o]=V.response?V.statusText+" - "+JSON.stringify(V.response):V.statusText)}}}return H}})}return t}();var jc=function(){function t(e,r){var n=this;n.traceFlag=t.DEFAULT_TRACE_FLAG,n.version=t.DEFAULT_VERSION,e&&t.isValidTraceId(e)?n.traceId=e:n.traceId=Yr(),r&&t.isValidSpanId(r)?n.spanId=r:n.spanId=Yr().substr(0,16)}return t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.prototype.toString=function(){var e=this;return"".concat(e.version,"-").concat(e.traceId,"-").concat(e.spanId,"-").concat(e.traceFlag)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t}();var cf="ai.ajxmn.",Wo="diagLog",un="ajaxData",df="throwInternal",Ko="fetch",uf=0;function pp(){var t=hn();return!t||Oe(t.Request)||Oe(t.Request[nr])||Oe(t[Ko])?null:t[Ko]}function _p(t){var e=!1;if(Zi()){var r=XMLHttpRequest[nr];e=!Oe(r)&&!Oe(r.open)&&!Oe(r.send)&&!Oe(r.abort)}var n=Da();if(n&&n<9&&(e=!1),e)try{var i=new XMLHttpRequest;i[un]={};var a=XMLHttpRequest[nr].open;XMLHttpRequest[nr].open=a}catch(o){e=!1,Yo(t,Ie.FailedMonitorAjaxOpen,"Failed to enable XMLHttpRequest monitoring, extension is not supported",{exception:ct(o)})}return e}function m0(t){var e="";try{!Oe(t)&&!Oe(t[un])&&!Oe(t[un].requestUrl)&&(e+="(url: '"+t[un].requestUrl+"')")}catch{}return e}function Yo(t,e,r,n,i){t[Wo]()[df](Ne.CRITICAL,e,r,n,i)}function $a(t,e,r,n,i){t[Wo]()[df](Ne.WARNING,e,r,n,i)}function Xo(t,e,r){return function(n){Yo(t,e,r,{ajaxDiagnosticsMessage:m0(n.inst),exception:ct(n.err)})}}function Za(t,e){return t&&e?t.indexOf(e):-1}var Gc=function(t){pt(e,t);function e(){var r=t.call(this)||this;r.identifier=e.identifier,r.priority=120;var n="trackDependencyDataInternal",i=rn(),a=!1,o=!1,l=i&&i.host&&i.host.toLowerCase(),c=e.getEmptyConfig(),d=!1,w=!1,k=0,H,V,x,K,E=!1,z=0,U=!1,J=[],Z={},se,Ce;return Tt(e,r,function(Ee,rt){Ee.initialize=function(ce,xe,ke,Me){if(!Ee.isInitialized()){rt.initialize(ce,xe,ke,Me);var Te=Ee._getTelCtx(),Je=e.getDefaultConfig();Lt(Je,function(qt,zt){c[qt]=Te.getConfig(e.identifier,qt,zt)});var qe=c.distributedTracingMode;if(d=c.enableRequestHeaderTracking,w=c.enableAjaxErrorStatusText,E=c.enableAjaxPerfTracking,z=c.maxAjaxCallsPerView,U=c.enableResponseHeaderTracking,se=c.excludeRequestFromAutoTrackingPatterns,Ce=c.addRequestContext,x=qe===gn.AI||qe===gn.AI_AND_W3C,V=qe===gn.AI_AND_W3C||qe===gn.W3C,E){var ut=ce.instrumentationKey||"unkwn";ut.length>5?K=cf+ut.substring(ut.length-5)+".":K=cf+ut+"."}if(c.disableAjaxTracking===!1&&sr(),Rt(),ke.length>0&&ke){for(var ht=void 0,Se=0;!ht&&Se<ke.length;)ke[Se]&&ke[Se].identifier===Ii&&(ht=ke[Se]),Se++;ht&&(H=ht.context)}}},Ee.teardown=function(){ot(J,function(ce){ce.rm()}),J=[],a=!1,o=!1,Ee.setInitialized(!1)},Ee.trackDependencyData=function(ce,xe){Ee[n](ce,xe)},Ee.includeCorrelationHeaders=function(ce,xe,ke,Me){var Te=Ee._currentWindowHost||l;if(xe){if(ci.canIncludeCorrelationHeader(c,ce.getAbsoluteUrl(),Te)){if(ke||(ke={}),ke.headers=new Headers(ke.headers||(xe instanceof Request?xe.headers||{}:{})),x){var Je="|"+ce.traceID+"."+ce.spanID;ke.headers.set(Ot.requestIdHeader,Je),d&&(ce.requestHeaders[Ot.requestIdHeader]=Je)}var qe=c.appId||H&&H.appId();if(qe&&(ke.headers.set(Ot.requestContextHeader,Ot.requestContextAppIdFormat+qe),d&&(ce.requestHeaders[Ot.requestContextHeader]=Ot.requestContextAppIdFormat+qe)),V){var ut=new jc(ce.traceID,ce.spanID);ke.headers.set(Ot.traceParentHeader,ut.toString()),d&&(ce.requestHeaders[Ot.traceParentHeader]=ut.toString())}}return ke}else if(Me){if(ci.canIncludeCorrelationHeader(c,ce.getAbsoluteUrl(),Te)){if(x){var Je="|"+ce.traceID+"."+ce.spanID;Me.setRequestHeader(Ot.requestIdHeader,Je),d&&(ce.requestHeaders[Ot.requestIdHeader]=Je)}var qe=c.appId||H&&H.appId();if(qe&&(Me.setRequestHeader(Ot.requestContextHeader,Ot.requestContextAppIdFormat+qe),d&&(ce.requestHeaders[Ot.requestContextHeader]=Ot.requestContextAppIdFormat+qe)),V){var ut=new jc(ce.traceID,ce.spanID);Me.setRequestHeader(Ot.traceParentHeader,ut.toString()),d&&(ce.requestHeaders[Ot.traceParentHeader]=ut.toString())}}return Me}},Ee[n]=function(ce,xe,ke){if(z===-1||k<z){(c.distributedTracingMode===gn.W3C||c.distributedTracingMode===gn.AI_AND_W3C)&&typeof ce.id=="string"&&ce.id[ce.id.length-1]!=="."&&(ce.id+="."),Oe(ce.startTime)&&(ce.startTime=new Date);var Me=Sn.create(ce,ln.dataType,ln.envelopeType,Ee[Wo](),xe,ke);Ee.core.track(Me)}else k===z&&Yo(Ee,Ie.MaxAjaxPerPVExceeded,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++k};function tt(ce){var xe=!0;return(ce||c.ignoreHeaders)&&ot(c.ignoreHeaders,function(ke){if(ke.toLowerCase()===ce.toLowerCase())return xe=!1,-1}),xe}function Rt(){var ce=pp();if(!!ce){var xe=hn(),ke=ce.polyfill;c.disableFetchTracking===!1?(J.push(Fo(xe,Ko,{req:function(Me,Te,Je){var qe;if(a&&!Pt(null,Te,Je)&&!(ke&&o)){var ut=Me.ctx();qe=A(Te,Je);var ht=Ee.includeCorrelationHeaders(qe,Te,Je);ht!==Je&&Me.set(1,ht),ut.data=qe}},rsp:function(Me,Te){var Je=Me.ctx().data;Je&&(Me.rslt=Me.rslt.then(function(qe){return Ve(Me,(qe||{}).status,Te,qe,Je,function(){var ut={statusText:qe.statusText,headerMap:null,correlationContext:$e(qe)};if(U){var ht={};qe.headers.forEach(function(Se,qt){tt(qt)&&(ht[qt]=Se)}),ut.headerMap=ht}return ut}),qe}).catch(function(qe){throw Ve(Me,0,Te,null,Je,null,{error:qe.message}),qe}))},hkErr:Xo(Ee,Ie.FailedMonitorAjaxOpen,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.")})),a=!0):ke&&J.push(Fo(xe,Ko,{req:function(Me,Te,Je){Pt(null,Te,Je)}})),ke&&(xe[Ko].polyfill=ke)}}function yt(ce,xe,ke){J.push(uc(ce,xe,ke))}function sr(){_p(Ee)&&!o&&(yt(XMLHttpRequest,"open",{req:function(ce,xe,ke,Me){var Te=ce.inst,Je=Te[un];!Pt(Te,ke)&&Yt(Te,!0)&&((!Je||!Je.xhrMonitoringState.openDone)&&Vt(Te,xe,ke,Me),Ct(Te))},hkErr:Xo(Ee,Ie.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")}),yt(XMLHttpRequest,"send",{req:function(ce,xe){var ke=ce.inst,Me=ke[un];Yt(ke)&&!Me.xhrMonitoringState.sendDone&&(bt("xhr",Me),Me.requestSentTime=za(),Ee.includeCorrelationHeaders(Me,void 0,void 0,ke),Me.xhrMonitoringState.sendDone=!0)},hkErr:Xo(Ee,Ie.FailedMonitorAjaxSend,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")}),yt(XMLHttpRequest,"abort",{req:function(ce){var xe=ce.inst,ke=xe[un];Yt(xe)&&!ke.xhrMonitoringState.abortDone&&(ke.aborted=1,ke.xhrMonitoringState.abortDone=!0)},hkErr:Xo(Ee,Ie.FailedMonitorAjaxAbort,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")}),d&&yt(XMLHttpRequest,"setRequestHeader",{req:function(ce,xe,ke){var Me=ce.inst;Yt(Me)&&tt(xe)&&(Me[un].requestHeaders[xe]=ke)},hkErr:Xo(Ee,Ie.FailedMonitorAjaxSetRequestHeader,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")}),o=!0)}function Pt(ce,xe,ke){var Me=!1,Te=((at(xe)?xe:(xe||{}).url||"")||"").toLowerCase();if(ot(se,function(ut){var ht=ut;at(ut)&&(ht=new RegExp(ut)),Me||(Me=ht.test(Te))}),Me)return Me;var Je=Za(Te,"?"),qe=Za(Te,"#");return(Je===-1||qe!==-1&&qe<Je)&&(Je=qe),Je!==-1&&(Te=Te.substring(0,Je)),Oe(ce)?Oe(xe)||(Me=(typeof xe=="object"?xe[Nn]===!0:!1)||(ke?ke[Nn]===!0:!1)):Me=ce[Nn]===!0||Te[Nn]===!0,!Me&&Te&&aa(Te)&&(Me=!0),Me?Z[Te]||(Z[Te]=1):Z[Te]&&(Me=!0),Me}function Yt(ce,xe){var ke=!0,Me=o;return Oe(ce)||(ke=xe===!0||!Oe(ce[un])),Me&&ke}function Vt(ce,xe,ke,Me){var Te=H&&H.telemetryTrace&&H.telemetryTrace.traceID||Yr(),Je=Yr().substr(0,16),qe=new zc(Te,Je,Ee[Wo]());qe.method=xe,qe.requestUrl=ke,qe.xhrMonitoringState.openDone=!0,qe.requestHeaders={},qe.async=Me,qe.errorStatusText=w,ce[un]=qe}function Ct(ce){ce[un].xhrMonitoringState.stateChangeAttached=Bn(ce,"readystatechange",function(){try{ce&&ce.readyState===4&&Yt(ce)&&Et(ce)}catch(ke){var xe=ct(ke);(!xe||Za(xe.toLowerCase(),"c00c023f")===-1)&&Yo(Ee,Ie.FailedMonitorAjaxRSC,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:m0(ce),exception:xe})}})}function vt(ce){try{var xe=ce.responseType;if(xe===""||xe==="text")return ce.responseText}catch{}return null}function Et(ce){var xe=ce[un];xe.responseFinishedTime=za(),xe.status=ce.status;function ke(Me,Te){var Je=Te||{};Je.ajaxDiagnosticsMessage=m0(ce),Me&&(Je.exception=ct(Me)),$a(Ee,Ie.FailedMonitorAjaxDur,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",Je)}et("xmlhttprequest",xe,function(){try{var Me=xe.CreateTrackItem("Ajax",d,function(){var Je={statusText:ce.statusText,headerMap:null,correlationContext:At(ce),type:ce.responseType,responseText:vt(ce),response:ce.response};if(U){var qe=ce.getAllResponseHeaders();if(qe){var ut=dr(qe).split(/[\r\n]+/),ht={};ot(ut,function(Se){var qt=Se.split(": "),zt=qt.shift(),Ft=qt.join(": ");tt(zt)&&(ht[zt]=Ft)}),Je.headerMap=ht}}return Je}),Te=void 0;try{Ce&&(Te=Ce({status:ce.status,xhr:ce}))}catch{$a(Ee,Ie.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}Me?(Te!==void 0&&(Me.properties=ur(ur({},Me.properties),Te)),Ee[n](Me)):ke(null,{requestSentTime:xe.requestSentTime,responseFinishedTime:xe.responseFinishedTime})}finally{try{ce[un]=null}catch{}}},function(Me){ke(Me,null)})}function At(ce){try{var xe=ce.getAllResponseHeaders();if(xe!==null){var ke=Za(xe.toLowerCase(),Ot.requestContextHeaderLowerCase);if(ke!==-1){var Me=ce.getResponseHeader(Ot.requestContextHeader);return ci.getCorrelationContext(Me)}}}catch(Te){$a(Ee,Ie.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:m0(ce),exception:ct(Te)})}}function bt(ce,xe){if(xe.requestUrl&&K&&E){var ke=nn();if(ke&&dt(ke.mark)){uf++;var Me=K+ce+"#"+uf;ke.mark(Me);var Te=ke.getEntriesByName(Me);Te&&Te.length===1&&(xe.perfMark=Te[0])}}}function et(ce,xe,ke,Me){var Te=xe.perfMark,Je=nn(),qe=c.maxAjaxPerfLookupAttempts,ut=c.ajaxPerfLookupDelay,ht=xe.requestUrl,Se=0;(function qt(){try{if(Je&&Te){Se++;for(var zt=null,Ft=Je.getEntries(),ir=Ft.length-1;ir>=0;ir--){var lr=Ft[ir];if(lr){if(lr.entryType==="resource")lr.initiatorType===ce&&(Za(lr.name,ht)!==-1||Za(ht,lr.name)!==-1)&&(zt=lr);else if(lr.entryType==="mark"&&lr.name===Te.name){xe.perfTiming=zt;break}if(lr.startTime<Te.startTime-1e3)break}}}!Te||xe.perfTiming||Se>=qe||xe.async===!1?(Te&&dt(Je.clearMarks)&&Je.clearMarks(Te.name),xe.perfAttempts=Se,ke()):setTimeout(qt,ut)}catch(yn){Me(yn)}})()}function A(ce,xe){var ke=H&&H.telemetryTrace&&H.telemetryTrace.traceID||Yr(),Me=Yr().substr(0,16),Te=new zc(ke,Me,Ee[Wo]());Te.requestSentTime=za(),Te.errorStatusText=w,ce instanceof Request?Te.requestUrl=ce?ce.url:"":Te.requestUrl=ce;var Je="GET";xe&&xe.method?Je=xe.method:ce&&ce instanceof Request&&(Je=ce.method),Te.method=Je;var qe={};if(d){var ut=new Headers((xe?xe.headers:0)||(ce instanceof Request?ce.headers||{}:{}));ut.forEach(function(ht,Se){tt(Se)&&(qe[Se]=ht)})}return Te.requestHeaders=qe,bt("fetch",Te),Te}function de(ce){var xe="";try{Oe(ce)||(typeof ce=="string"?xe+="(url: '".concat(ce,"')"):xe+="(url: '".concat(ce.url,"')"))}catch(ke){Yo(Ee,Ie.FailedMonitorAjaxOpen,"Failed to grab failed fetch diagnostics message",{exception:ct(ke)})}return xe}function Ve(ce,xe,ke,Me,Te,Je,qe){if(!Te)return;function ut(ht,Se,qt){var zt=qt||{};zt.fetchDiagnosticsMessage=de(ke),Se&&(zt.exception=ct(Se)),$a(Ee,ht,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",zt)}Te.responseFinishedTime=za(),Te.status=xe,et("fetch",Te,function(){var ht=Te.CreateTrackItem("Fetch",d,Je),Se;try{Ce&&(Se=Ce({status:xe,request:ke,response:Me}))}catch{$a(Ee,Ie.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}ht?(Se!==void 0&&(ht.properties=ur(ur({},ht.properties),Se)),Ee[n](ht)):ut(Ie.FailedMonitorAjaxDur,null,{requestSentTime:Te.requestSentTime,responseFinishedTime:Te.responseFinishedTime})},function(ht){ut(Ie.FailedMonitorAjaxGetCorrelationHeader,ht,null)})}function $e(ce){if(ce&&ce.headers)try{var xe=ce.headers.get(Ot.requestContextHeader);return ci.getCorrelationContext(xe)}catch(ke){$a(Ee,Ie.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:de(ce),exception:ct(ke)})}}}),r}return e.getDefaultConfig=function(){var r={maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,excludeRequestFromAutoTrackingPatterns:void 0,disableCorrelationHeaders:!1,distributedTracingMode:gn.AI_AND_W3C,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:void 0,correlationHeaderExcludePatterns:void 0,appId:void 0,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1,enableAjaxErrorStatusText:!1,enableAjaxPerfTracking:!1,maxAjaxPerfLookupAttempts:3,ajaxPerfLookupDelay:25,ignoreHeaders:["Authorization","X-API-Key","WWW-Authenticate"],addRequestContext:void 0};return r},e.getEmptyConfig=function(){var r=this.getDefaultConfig();return Lt(r,function(n){r[n]=void 0}),r},e.prototype.processTelemetry=function(r,n){this.processNext(r,n)},e.identifier="AjaxDependencyPlugin",e}(Dn);var Xc,ff=["snippet","dependencies","properties","_snippetVersion","appInsightsNew","getSKUDefaults"];var Wc=function(){function t(e){var r=this;r._snippetVersion=""+(e.sv||e.version||""),e.queue=e.queue||[],e.version=e.version||2;var n=e.config||{};if(n.connectionString){var i=Tc(n.connectionString),a=i.ingestionendpoint;n.endpointUrl=a?"".concat(a,"/v2/track"):n.endpointUrl,n.instrumentationKey=i.instrumentationkey||n.instrumentationKey}r.appInsights=new Nc,r.properties=new qc,r.dependencies=new Gc,r.core=new ac,r._sender=new Hc,r.snippet=e,r.config=n,r.getSKUDefaults()}return t.prototype.getCookieMgr=function(){return this.appInsights.getCookieMgr()},t.prototype.trackEvent=function(e,r){this.appInsights.trackEvent(e,r)},t.prototype.trackPageView=function(e){var r=e||{};this.appInsights.trackPageView(r)},t.prototype.trackPageViewPerformance=function(e){var r=e||{};this.appInsights.trackPageViewPerformance(r)},t.prototype.trackException=function(e,r){e&&!e.exception&&e.error&&(e.exception=e.error),this.appInsights.trackException(e,r)},t.prototype._onerror=function(e){this.appInsights._onerror(e)},t.prototype.trackTrace=function(e,r){this.appInsights.trackTrace(e,r)},t.prototype.trackMetric=function(e,r){this.appInsights.trackMetric(e,r)},t.prototype.startTrackPage=function(e){this.appInsights.startTrackPage(e)},t.prototype.stopTrackPage=function(e,r,n,i){this.appInsights.stopTrackPage(e,r,n,i)},t.prototype.startTrackEvent=function(e){this.appInsights.startTrackEvent(e)},t.prototype.stopTrackEvent=function(e,r,n){this.appInsights.stopTrackEvent(e,r,n)},t.prototype.addTelemetryInitializer=function(e){return this.appInsights.addTelemetryInitializer(e)},t.prototype.setAuthenticatedUserContext=function(e,r,n){n===void 0&&(n=!1),this.properties.context.user.setAuthenticatedUserContext(e,r,n)},t.prototype.clearAuthenticatedUserContext=function(){this.properties.context.user.clearAuthenticatedUserContext()},t.prototype.trackDependencyData=function(e){this.dependencies.trackDependencyData(e)},t.prototype.flush=function(e){var r=this;e===void 0&&(e=!0),$n(this.core,function(){return"AISKU.flush"},function(){ot(r.core.getTransmissionControls(),function(n){ot(n,function(i){i.flush(e)})})},null,e)},t.prototype.onunloadFlush=function(e){e===void 0&&(e=!0),ot(this.core.getTransmissionControls(),function(r){ot(r,function(n){n.onunloadFlush?n.onunloadFlush():n.flush(e)})})},t.prototype.loadAppInsights=function(e,r,n){var i=this;e===void 0&&(e=!1);var a=this;function o(l){if(l){var c="";Oe(a._snippetVersion)||(c+=a._snippetVersion),e&&(c+=".lg"),a.context&&a.context.internal&&(a.context.internal.snippetVer=c||"-"),Lt(a,function(d,w){at(d)&&!dt(w)&&d&&d[0]!=="_"&&ff.indexOf(d)===-1&&(l[d]=w)})}}return e&&a.config.extensions&&a.config.extensions.length>0&&Br("Extensions not allowed in legacy mode"),$n(a.core,function(){return"AISKU.loadAppInsights"},function(){var l=[];l.push(a._sender),l.push(a.properties),l.push(a.dependencies),l.push(a.appInsights),a.core.initialize(a.config,l,r,n),a.context=a.properties.context,Xc&&a.context&&(a.context.internal.sdkSrc=Xc),o(a.snippet),a.emptyQueue(),a.pollInternalLogs(),a.addHousekeepingBeforeUnload(i)}),a},t.prototype.updateSnippetDefinitions=function(e){Pl(e,this,function(r){return r&&ff.indexOf(r)===-1})},t.prototype.emptyQueue=function(){var e=this;try{if(yr(e.snippet.queue)){for(var r=e.snippet.queue.length,n=0;n<r;n++){var i=e.snippet.queue[n];i()}e.snippet.queue=void 0,delete e.snippet.queue}}catch(o){var a={};o&&dt(o.toString)&&(a.exception=o.toString())}},t.prototype.pollInternalLogs=function(){this.core.pollInternalLogs()},t.prototype.stopPollingInternalLogs=function(){this.core.stopPollingInternalLogs()},t.prototype.addHousekeepingBeforeUnload=function(e){if(Ki()||Vs()){var r=function(){e.onunloadFlush(!1),ot(e.appInsights.core._extensions,function(a){if(a.identifier===Ii)return a&&a.context&&a.context._sessionManager&&a.context._sessionManager.backup(),-1})},n=!1,i=e.appInsights.config.disablePageUnloadEvents;e.appInsights.config.disableFlushOnBeforeUnload||(n=sc(r,i),n=No(r,i)||n,!n&&!zl()&&e.appInsights.core.logger.throwInternal(Ne.CRITICAL,Ie.FailedToAddHandlerForOnBeforeUnload,"Could not add handler for beforeunload and pagehide")),!n&&!e.appInsights.config.disableFlushOnUnload&&No(r,i)}},t.prototype.getSender=function(){return this._sender},t.prototype.getSKUDefaults=function(){var e=this;e.config.diagnosticLogInterval=e.config.diagnosticLogInterval&&e.config.diagnosticLogInterval>0?e.config.diagnosticLogInterval:1e4},t}();(function(){var t=null,e=!1,r=["://js.monitor.azure.com/","://az416426.vo.msecnd.net/"];try{var n=(document||{}).currentScript;n&&(t=n.src)}catch{}if(t)try{var i=t.toLowerCase();if(i){for(var a="",o=0;o<r.length;o++)if(i.indexOf(r[o])!==-1){a="cdn"+(o+1),i.indexOf("/scripts/")===-1&&(i.indexOf("/next/")!==-1?a+="-next":i.indexOf("/beta/")!==-1&&(a+="-beta")),Xc=a+(e?".mod":"");break}}}catch{}})();var Qa,mf=t=>(Qa=new Wc({config:{instrumentationKey:t}}),Qa.loadAppInsights(),Qa),Bi={START:"start",FINISH:"finish",ERROR:"error",UPLOAD_VIDEO:"upload_video"},gp=t=>Qa.trackException({exception:t}),ki=(t,e)=>Qa.trackEvent({name:t,properties:e}),bp=(t,e,r)=>Qa.trackPageView({name:t,uri:e,properties:r}),Qt={trackPage:bp,trackError:gp,registerStart:(t,e,r)=>ki(Bi.START,{proctoringId:t,success:e,description:r}),registerFinish:(t,e,r)=>ki(Bi.FINISH,{proctoringId:t,success:e,description:r}),registerError:(t,e)=>ki(Bi.ERROR,{proctoringId:t,description:e}),registerUpload:(t,e,r,n,i)=>ki(Bi.UPLOAD_VIDEO,{proctoringId:t,success:e,description:r,serviceType:n,uploadTime:i}),registerUploadFile:(t,e,r)=>ki(Bi.UPLOAD_VIDEO,{proctoringId:t,description:e,fileType:r}),registerChangeDevice:(t,e,r)=>ki(Bi.UPLOAD_VIDEO,{proctoringId:t,inOrOut:e,devicesChanged:r}),registerStopSharingScreen:(t,e)=>ki(Bi.UPLOAD_VIDEO,{proctoringId:t,description:e}),registerErrorRecorderRTC:(t,e)=>ki(Bi.UPLOAD_VIDEO,{proctoringId:t,description:e})};var da=class{constructor(e,r){this.backend=r;this.proctoringId=e}async upload(e,r){let{file:n,onProgress:i}=e;try{let a=c=>{let d=c.loadedBytes/n.size*100;i&&i(Math.round(d))},o=await this.backend.getAzureSignedUrl(r,n,this.proctoringId),l=await wa.request({url:o,method:"PUT",headers:{"x-ms-blob-type":"BlockBlob"},data:n,onUploadProgress:c=>{a({loadedBytes:c.loaded})}}).then(()=>!0).catch(()=>!1);return{storage:"AzureBlob",url:o,uploaded:l}}catch{throw Qt.registerError(this.proctoringId,`Failed to upload to Azure
22
22
  File name: ${n.name}
23
23
  File type: ${n.type}
24
- File size: ${n.size}`),new Error("Failed to upload to azure")}}};var zn=class{constructor(e,r,n,i,a){this.blobs=[];this.options={cameraId:void 0,microphoneId:void 0};this.videoOptions={width:640,height:480};this.imageCount=0;this.options=e,this.videoOptions=r,this.backend=n,this.backendToken=i,this.proctoringId=a,this.proctoringId&&this.backend&&(this.azureUpload=new Ji(this.proctoringId,this.backend))}async startRecording(){let{cameraId:e,microphoneId:r}=this.options,n={audio:{deviceId:r},video:{deviceId:e,width:this.videoOptions.width,height:this.videoOptions.height,frameRate:15}};this.cameraStream=await navigator.mediaDevices.getUserMedia(n);let{startRecording:i,stopRecording:a,pauseRecording:s,resumeRecording:v}=Qa(this.cameraStream,this.blobs);this.recordingStart=i,this.recordingStop=a,this.recordingPause=s,this.recordingResume=v,this.recordingStart(),this.photoShotsCycle()}async stopRecording(){await this.recordingStop(),clearInterval(this.imageInterval)}async pauseRecording(){await this.recordingPause()}async resumeRecording(){await this.recordingResume()}photoShotsCycle(){let e=this.cameraStream.getVideoTracks()[0];this.imageCapture=new ImageCapture(e),this.imageInterval=setInterval(()=>{this.imageCapture.takePhoto().then(r=>createImageBitmap(r)).then(async r=>{let n=document.createElement("canvas");n.width=1280,n.height=720,n.getContext("bitmaprenderer").transferFromImageBitmap(r);let a=await new Promise(s=>n.toBlob(s));a instanceof Blob&&this.azureUpload&&this.backendToken&&(this.azureUpload.upload({file:new File([a],`EP_${this.proctoringId}_image_${this.imageCount}.jpg`,{type:"image/jpeg"})},this.backendToken),this.imageCount++)}).catch(r=>console.log(r))},15e3)}async saveOnSession(e){let r=this.cameraStream.getVideoTracks()[0].getSettings(),n=this.cameraStream.getAudioTracks()[0].getSettings();e.addRecording({device:`Audio
24
+ File size: ${n.size}`),new Error("Failed to upload to azure")}}};var Qn=class{constructor(e,r,n,i,a){this.blobs=[];this.options={cameraId:void 0,microphoneId:void 0};this.videoOptions={width:640,height:480};this.blobsRTC=[];this.imageCount=0;this.options=e,this.videoOptions=r,this.backend=n,this.backendToken=i,this.proctoringId=a,this.proctoringId&&this.backend&&(this.azureUpload=new da(this.proctoringId,this.backend))}async startRecording(){let{cameraId:e,microphoneId:r}=this.options,n={audio:{deviceId:r},video:{deviceId:e,width:this.videoOptions.width,height:this.videoOptions.height,frameRate:15}};try{this.cameraStream=await navigator.mediaDevices.getUserMedia(n)}catch(c){throw c.toString()=="NotReadableError: Could not start video source"?"N\xE3o foi poss\xEDvel conectar a camera, ela pode estar sendo utilizada por outro programa":c}try{this.recorder=new v0.RecordRTCPromisesHandler(this.cameraStream,{type:"video"}),this.recorder.startRecording()}catch(c){Qt.registerErrorRecorderRTC(this.proctoringId,`Error on start Recorder RTC: ${c}`)}let{startRecording:i,stopRecording:a,pauseRecording:o,resumeRecording:l}=ho(this.cameraStream,this.blobs);this.recordingStart=i,this.recordingStop=a,this.recordingPause=o,this.recordingResume=l,this.recordingStart(),this.photoShotsCycle()}async stopRecording(){this.recordingStop&&await this.recordingStop(),clearInterval(this.imageInterval);try{await this.recorder.stopRecording();let e=await this.recorder.getBlob(),r=!1;(0,v0.getSeekableBlob)(e,n=>{this.recorder.destroy(),this.blobsRTC.push(n),console.log(this.blobsRTC),this.cameraStream.getTracks().forEach(i=>{i.stop()}),r=!0}),await Pu(()=>r)}catch(e){Qt.registerErrorRecorderRTC(this.proctoringId,`Error on finish Recorder RTC: ${e}`)}}async pauseRecording(){await this.recordingPause()}async resumeRecording(){await this.recordingResume()}photoShotsCycle(){let e=this.cameraStream.getVideoTracks()[0];this.imageCapture=new ImageCapture(e),this.imageInterval=setInterval(()=>{this.imageCapture.takePhoto().then(r=>createImageBitmap(r)).then(async r=>{let n=document.createElement("canvas");n.width=1280,n.height=720,n.getContext("bitmaprenderer").transferFromImageBitmap(r);let a=await new Promise(o=>n.toBlob(o));a instanceof Blob&&this.azureUpload&&this.backendToken&&(this.azureUpload.upload({file:new File([a],`EP_${this.proctoringId}_image_${this.imageCount}.jpg`,{type:"image/jpeg"})},this.backendToken),this.imageCount++)}).catch(r=>console.log(r))},15e3)}async saveOnSession(e){let r=this.cameraStream.getVideoTracks()[0].getSettings(),n=this.cameraStream.getAudioTracks()[0].getSettings();e.addRecording({device:`Audio
25
25
  Sample Rate: ${n.sampleRate}
26
- Sample Size: ${n.sampleSize}`,file:new File(this.blobs,`EP_${e.id}_camera_0.webm`,{type:"video/webm"}),origin:"Camera"})}};var Xs=class{constructor(){}async takePicture(e,r){return console.log("take picture"),await this.takePictureInterface(e,r)}async startCapture(e="default"){let r=document.querySelector("#cameraStream"),n={audio:!1,video:{facingMode:"user",aspectRatio:1.777777778,width:{min:640,ideal:640,max:1920},height:{min:400,ideal:480},deviceId:e}};this.cameraRecorder=new zn({cameraId:e},{width:640,height:480}),await this.cameraRecorder.startRecording(),r.srcObject=this.cameraRecorder.cameraStream,r.play()}shot(){console.log("shot");let e=document.querySelector("#cameraStream"),r=document.querySelector("#canvas"),n=document.querySelector("#image");r.width=e.videoWidth,r.height=e.videoHeight,r.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),n.src=r.toDataURL("image/jpg"),this.base64=r.toDataURL("image/jpg")}takePictureInterface(e,r){return new Promise(n=>{let i=document.createElement("div");i.setAttribute("id","authPhoto"),i.style.backgroundColor="rgba(0,0,0,0.4)",i.style.zIndex="1000",i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.height="100vh",i.style.width="100%",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center";let a=document.createElement("div");a.style.backgroundColor="#fff",a.style.zIndex="1001",a.style.width="800px",a.style.maxHeight="95vh",a.style.borderRadius="10px",a.style.display="flex",a.style.flexDirection="column",a.style.alignItems="center",a.style.boxSizing="border-box";let s=document.createElement("h3");s.innerText=e||"Biometria Facial",s.style.color="rgba(0, 0, 0, .7)",s.style.fontWeight="bold",s.style.fontSize="20px",s.style.marginBottom="15px",s.style.padding="20px 0px 0px",s.style.width="100%",s.style.textAlign="center",a.appendChild(s);let v=document.createElement("p");v.innerText=r||"Encaixe seu rosto no formato e clique no bot\xE3o abaixo",v.style.color="rgba(0, 0, 0, .7)",v.style.fontWeight="normal",v.style.fontSize="16px",v.style.marginBottom="15px",v.style.padding="0px 0px 20px",v.style.borderBottom="2px solid rgba(0, 0, 0, .1)",v.style.width="100%",v.style.textAlign="center",a.appendChild(v);let d=document.createElement("div"),p=document.createElement("h3"),B=document.createElement("select");B.setAttribute("id","cameraSelect"),d.style.padding="0 20px",d.style.width="100%",d.style.display="flex",d.style.justifyContent="space-between",d.style.marginBottom="15px",p.innerText="C\xE2mera",p.style.color="rgba(0, 0, 0, .75)",p.style.fontWeight="bold",p.style.fontSize="16px",d.appendChild(p),d.appendChild(B),a.appendChild(d);let z=document.createElement("div"),ee=document.createElement("video");ee.setAttribute("id","cameraStream"),ee.muted=!0,z.style.width="100%",z.style.height="50vh",z.style.display="flex",z.style.justifyContent="center",z.style.position="relative",ee.style.backgroundColor="#000",ee.style.borderRadius="10px",ee.style.width="auto",ee.style.height="auto",ee.style.minHeight="100%",z.appendChild(ee);let te=document.createElement("canvas");te.setAttribute("id","canvas"),te.style.display="none",te.style.width="100%",te.style.height="100%";let D=document.createElement("img");D.setAttribute("id","image"),D.style.objectFit="contain",D.style.display="none",D.style.borderRadius="8px",z.appendChild(te),z.appendChild(D);let ce=document.createElement("div");ce.setAttribute("class","facial-biometry__mask"),ce.style.width="100%",ce.style.height="100%",ce.style.position="absolute",ce.style.top="0px",ce.style.left="0px",ce.style.backgroundColor="#fff",ce.style.opacity="0.6";let P=document.createElement("div");P.setAttribute("class","biometry__frame"),P.style.width="100%",P.style.height="100%",P.style.position="absolute",P.style.top="0px",P.style.left="0px",P.style.zIndex="10",z.appendChild(ce),z.appendChild(P),a.appendChild(z),this.addStyleMask();let oe=document.createElement("button"),se=document.createElement("div");oe.setAttribute("id","confirmBtn"),se.style.width="100%",se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",oe.style.background="url('https://iarisprod.blob.core.windows.net/imagens/camera.svg') no-repeat center",oe.style.width="70px",oe.style.height="70px",oe.style.borderRadius="70px",oe.style.border="none",oe.style.backgroundColor="#16a34a",oe.style.margin="20px 0",se.appendChild(oe),a.appendChild(se);let xe=document.createElement("button");xe.style.background="url('https://iarisprod.blob.core.windows.net/imagens/close.svg') no-repeat center",xe.style.width="70px",xe.style.height="70px",xe.style.borderRadius="70px",xe.style.border="none",xe.style.backgroundColor="#e74141",xe.style.margin="20px 20px";let Ge=document.createElement("button");Ge.style.background="url('https://iarisprod.blob.core.windows.net/imagens/check.svg') no-repeat center",Ge.style.width="70px",Ge.style.height="70px",Ge.style.borderRadius="70px",Ge.style.border="none",Ge.style.backgroundColor="#16a34a",Ge.style.margin="20px 20px",i.appendChild(a),document.body.appendChild(i),this.setSelectOption(),this.startCapture(),oe.addEventListener("click",()=>{se.removeChild(oe),se.appendChild(xe),se.appendChild(Ge),this.shot(),ee.style.display="none",D.style.display="block"}),xe.addEventListener("click",()=>{se.appendChild(oe),se.removeChild(xe),se.removeChild(Ge),ee.style.display="block",D.style.display="none"}),Ge.addEventListener("click",()=>{this.closeInterface(),n({base64:this.base64})})})}async setSelectOption(){let e=document.querySelector("#cameraSelect"),r=await xn();e&&(e.value="default");let n=(i,a)=>{let s=document.createElement("option");return s.setAttribute("value",a),s.innerHTML=i,s};r.cameras.forEach(i=>{let a=n(i.label,i.id);e?.appendChild(a)}),this.onSelectOptionChange()}async onSelectOptionChange(){let e=document.querySelector("#cameraSelect");e?.addEventListener("change",async()=>{this.startCapture(e?.value)})}async closeInterface(){await this.cameraRecorder.stopRecording(),document.querySelector("#authPhoto")?.remove()}async addStyleMask(){let e=`
26
+ Sample Size: ${n.sampleSize}`,file:new File(this.blobs,`EP_${e.id}_camera_0.webm`,{type:"video/webm"}),origin:"Camera"}),e.addRecording({device:"",file:new File(this.blobsRTC,`EP_${e.id}_camera_0_seekable.webm`,{type:"video/webm"}),origin:"Camera"})}};var h0=class{constructor(){}async takePicture(e,r){return console.log("take picture"),await this.takePictureInterface(e,r)}async startCapture(e="default"){let r=document.querySelector("#cameraStream"),n={audio:!1,video:{facingMode:"user",aspectRatio:1.777777778,width:{min:640,ideal:640,max:1920},height:{min:400,ideal:480},deviceId:e}};this.cameraRecorder=new Qn({cameraId:e},{width:640,height:480}),await this.cameraRecorder.startRecording(),r.srcObject=this.cameraRecorder.cameraStream,r.play()}shot(){console.log("shot");let e=document.querySelector("#cameraStream"),r=document.querySelector("#canvas"),n=document.querySelector("#image");r.width=e.videoWidth,r.height=e.videoHeight,r.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),n.src=r.toDataURL("image/jpg"),this.base64=r.toDataURL("image/jpg")}takePictureInterface(e,r){return new Promise(n=>{let i=document.createElement("div");i.setAttribute("id","authPhoto"),i.style.backgroundColor="rgba(0,0,0,0.4)",i.style.zIndex="1000",i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.height="100vh",i.style.width="100%",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center";let a=document.createElement("div");a.style.backgroundColor="#fff",a.style.zIndex="1001",a.style.width="800px",a.style.maxHeight="95vh",a.style.borderRadius="10px",a.style.display="flex",a.style.flexDirection="column",a.style.alignItems="center",a.style.boxSizing="border-box";let o=document.createElement("h3");o.innerText=e||"Biometria Facial",o.style.color="rgba(0, 0, 0, .7)",o.style.fontWeight="bold",o.style.fontSize="20px",o.style.marginBottom="15px",o.style.padding="20px 0px 0px",o.style.width="100%",o.style.textAlign="center",a.appendChild(o);let l=document.createElement("p");l.innerText=r||"Encaixe seu rosto no formato e clique no bot\xE3o abaixo",l.style.color="rgba(0, 0, 0, .7)",l.style.fontWeight="normal",l.style.fontSize="16px",l.style.marginBottom="15px",l.style.padding="0px 0px 20px",l.style.borderBottom="2px solid rgba(0, 0, 0, .1)",l.style.width="100%",l.style.textAlign="center",a.appendChild(l);let c=document.createElement("div"),d=document.createElement("h3"),w=document.createElement("select");w.setAttribute("id","cameraSelect"),c.style.padding="0 20px",c.style.width="100%",c.style.display="flex",c.style.justifyContent="space-between",c.style.marginBottom="15px",d.innerText="C\xE2mera",d.style.color="rgba(0, 0, 0, .75)",d.style.fontWeight="bold",d.style.fontSize="16px",c.appendChild(d),c.appendChild(w),a.appendChild(c);let k=document.createElement("div"),H=document.createElement("video");H.setAttribute("id","cameraStream"),H.muted=!0,k.style.width="100%",k.style.height="50vh",k.style.display="flex",k.style.justifyContent="center",k.style.position="relative",H.style.backgroundColor="#000",H.style.borderRadius="10px",H.style.width="auto",H.style.height="auto",H.style.minHeight="100%",k.appendChild(H);let V=document.createElement("canvas");V.setAttribute("id","canvas"),V.style.display="none",V.style.width="100%",V.style.height="100%";let x=document.createElement("img");x.setAttribute("id","image"),x.style.objectFit="contain",x.style.display="none",x.style.borderRadius="8px",k.appendChild(V),k.appendChild(x);let K=document.createElement("div");K.setAttribute("class","facial-biometry__mask"),K.style.width="100%",K.style.height="100%",K.style.position="absolute",K.style.top="0px",K.style.left="0px",K.style.backgroundColor="#fff",K.style.opacity="0.6";let E=document.createElement("div");E.setAttribute("class","biometry__frame"),E.style.width="100%",E.style.height="100%",E.style.position="absolute",E.style.top="0px",E.style.left="0px",E.style.zIndex="10",k.appendChild(K),k.appendChild(E),a.appendChild(k),this.addStyleMask();let z=document.createElement("button"),U=document.createElement("div");z.setAttribute("id","confirmBtn"),U.style.width="100%",U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="center",z.style.background="url('https://iarisprod.blob.core.windows.net/imagens/camera.svg') no-repeat center",z.style.width="70px",z.style.height="70px",z.style.borderRadius="70px",z.style.border="none",z.style.backgroundColor="#16a34a",z.style.margin="20px 0",U.appendChild(z),a.appendChild(U);let J=document.createElement("button");J.style.background="url('https://iarisprod.blob.core.windows.net/imagens/close.svg') no-repeat center",J.style.width="70px",J.style.height="70px",J.style.borderRadius="70px",J.style.border="none",J.style.backgroundColor="#e74141",J.style.margin="20px 20px";let Z=document.createElement("button");Z.style.background="url('https://iarisprod.blob.core.windows.net/imagens/check.svg') no-repeat center",Z.style.width="70px",Z.style.height="70px",Z.style.borderRadius="70px",Z.style.border="none",Z.style.backgroundColor="#16a34a",Z.style.margin="20px 20px",i.appendChild(a),document.body.appendChild(i),this.setSelectOption(),this.startCapture(),z.addEventListener("click",()=>{U.removeChild(z),U.appendChild(J),U.appendChild(Z),this.shot(),H.style.display="none",x.style.display="block"}),J.addEventListener("click",()=>{U.appendChild(z),U.removeChild(J),U.removeChild(Z),H.style.display="block",x.style.display="none"}),Z.addEventListener("click",()=>{this.closeInterface(),n({base64:this.base64})})})}async setSelectOption(){let e=document.querySelector("#cameraSelect"),r=await An();e&&(e.value="default");let n=(i,a)=>{let o=document.createElement("option");return o.setAttribute("value",a),o.innerHTML=i,o};r.cameras.forEach(i=>{let a=n(i.label,i.id);e?.appendChild(a)}),this.onSelectOptionChange()}async onSelectOptionChange(){let e=document.querySelector("#cameraSelect");e?.addEventListener("change",async()=>{this.startCapture(e?.value)})}async closeInterface(){await this.cameraRecorder.stopRecording(),document.querySelector("#authPhoto")?.remove()}async addStyleMask(){let e=`
27
27
  .facial-biometry__mask {
28
28
  mask-image: url('https://iarisprod.blob.core.windows.net/imagens/square.svg'), url('https://iarisprod.blob.core.windows.net/imagens/face-mask.svg');
29
- mask-size: cover, auto 60%;
29
+ mask-size: cover, auto 100%;
30
30
  mask-repeat: no-repeat;
31
31
  mask-position: center, center;
32
32
  mask-composite: subtract;
33
33
 
34
34
  -webkit-mask-image: url('https://iarisprod.blob.core.windows.net/imagens/square.svg'), url('https://iarisprod.blob.core.windows.net/imagens/face-mask.svg');
35
- -webkit-mask-size: cover, auto 60%;
35
+ -webkit-mask-size: cover, auto 100%;
36
36
  -webkit-mask-repeat: no-repeat;
37
37
  -webkit-mask-position: center, center;
38
38
  -webkit-mask-composite: source-out;
@@ -40,24 +40,314 @@ bitsperframe: %d
40
40
 
41
41
  .biometry__frame {
42
42
  background: url("https://iarisprod.blob.core.windows.net/imagens/face-frame.svg") no-repeat center;
43
- background-size: 78% 62%;
43
+ background-size: auto 100%;
44
+
45
+ // mask-image: url("https://iarisprod.blob.core.windows.net/imagens/face-frame.svg");
46
+ // mask-size: auto 100%;
47
+ // mask-position: center;
48
+ // mask-repeat: no-repeat;
49
+
50
+ // -webkit-mask-image: url("https://iarisprod.blob.core.windows.net/imagens/face-frame.svg");
51
+ // -webkit-mask-size: auto 100%;
52
+ // -webkit-mask-position: center;
53
+ // -webkit-mask-repeat: no-repeat;
44
54
  }
45
- `,r=document.createElement("style");r.innerHTML=e,document.head.appendChild(r)}};var Ha=class{constructor(e){this.stream=e}start(e={}){return new Promise((r,n)=>{try{let i=new AudioContext,a=i.createAnalyser(),s=i.createMediaStreamSource(this.stream);this.scriptProcessor=i.createScriptProcessor(2048,1,1),a.smoothingTimeConstant=.8,a.fftSize=1024,s.connect(a),a.connect(this.scriptProcessor),this.scriptProcessor.connect(i.destination);let v=this;this.scriptProcessor.onaudioprocess=function(){let d=new Uint8Array(a.frequencyBinCount);a.getByteFrequencyData(d);let B=d.reduce((z,ee)=>z+ee,0)/d.length;v.setVolume(B),e.setVolume&&e.setVolume(B)},r(!0)}catch(i){this.stop(),n(`Error: ${i}`)}})}stop(){this.scriptProcessor&&this.scriptProcessor.disconnect()}getVolume(){return this.volume}setVolume(e){this.volume=e}};var bi={cameraId:void 0,microphoneId:void 0,allowMultipleMonitors:!1,allowOnlyFirstMonitor:!0,captureScreen:!0,noiseLimit:40,proctoringType:"IMAGE",insights:""};function Ks(t){return!!t.width&&!!t.height?{width:t.width,height:t.height}:{width:640,height:480}}var Ws=class{constructor(){this.volumeMedia=0;this.volumeSum=0;this.volumeCounter=0}async checkDevices(e=bi,r={width:1080,height:720}){this.options={...bi,...e,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},this.videoOptions=r;let{cameraId:n,microphoneId:i}=await this.checkDevicesInterface();return new Promise(a=>{a({cameraId:n,microphoneId:i,volumeRange:this.volumeMedia})})}checkDevicesInterface(){return new Promise(e=>{let r=document.createElement("div");r.setAttribute("id","checkDevices"),r.style.backgroundColor="rgba(0,0,0,0.4)",r.style.zIndex="1000",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.height="100vh",r.style.width="100%",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center";let n=document.createElement("div");n.style.backgroundColor="#fff",n.style.zIndex="1001",n.style.width="600px",n.style.borderRadius="10px",n.style.display="flex",n.style.flexDirection="column",n.style.alignItems="center";let i=document.createElement("h3");i.innerText="Para iniciar configure a c\xE2mera e o microfone",i.style.color="rgba(0, 0, 0, .7)",i.style.fontWeight="bold",i.style.fontSize="20px",i.style.marginBottom="15px",i.style.padding="20px 0px",i.style.borderBottom="2px solid rgba(0, 0, 0, .1)",i.style.width="100%",i.style.textAlign="center",n.appendChild(i);let a=document.createElement("div"),s=document.createElement("h3"),v=document.createElement("select");v.setAttribute("id","cameraSelect"),a.style.padding="0 20px",a.style.width="100%",a.style.display="flex",a.style.justifyContent="space-between",a.style.marginBottom="15px",s.innerText="C\xE2mera",s.style.color="rgba(0, 0, 0, .75)",s.style.fontWeight="bold",s.style.fontSize="16px",v.style.maxWidth="400px",a.appendChild(s),a.appendChild(v),n.appendChild(a);let d=document.createElement("div"),p=document.createElement("video");p.setAttribute("id","cameraStream"),p.muted=!0,d.style.width="calc(100% - 40px)",d.style.display="flex",d.style.justifyContent="space-between",d.style.borderBottom="2px solid rgba(0, 0, 0, .1)",d.style.paddingBottom="15px",p.style.width="20rem",p.style.backgroundColor="#000",p.style.borderRadius="10px",p.style.marginBottom="15px",d.appendChild(p),n.appendChild(d);let B=document.createElement("div"),z=document.createElement("h3"),ee=document.createElement("select");ee.setAttribute("id","micSelect"),B.style.padding="0 20px",B.style.width="100%",B.style.display="flex",B.style.justifyContent="space-between",B.style.margin="15px 0",z.innerText="C\xE2mera",z.style.color="rgba(0, 0, 0, .7)",z.style.fontWeight="bold",z.style.fontSize="16px",ee.style.maxWidth="400px",B.appendChild(z),B.appendChild(ee),n.appendChild(B);let te=document.createElement("div");te.style.width="calc(100% - 40px)",te.style.display="flex",te.style.flexDirection="column",te.style.justifyContent="space-between",te.style.paddingBottom="15px";let D=document.createElement("div");D.setAttribute("id","audioStream"),D.style.display="flex",D.style.marginBottom="15px";for(let lt=0;lt<25;lt++){let ft=document.createElement("div");ft.style.height="16px",ft.style.width="5px",ft.style.marginRight="5px",ft.style.borderRadius="10px",ft.style.backgroundColor="rgba(0, 0, 0, .3)",D.appendChild(ft)}let ce=document.createElement("div"),P=document.createElement("p"),oe=document.createElement("p"),se=document.createElement("p");ce.style.width="250px",ce.style.display="flex",ce.style.justifyContent="space-between",P.innerText="0",oe.innerText="50",se.innerText="100",ce.appendChild(P),ce.appendChild(oe),ce.appendChild(se),te.appendChild(D),te.appendChild(ce),n.appendChild(te);let xe=document.createElement("button"),Ge=document.createElement("div");xe.setAttribute("id","confirmBtn"),Ge.style.width="100%",Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.justifyContent="center",Ge.style.borderTop="2px solid rgba(0, 0, 0, .1)",xe.innerText="Continuar",xe.style.width="100%",xe.style.height="70px",xe.style.backgroundColor="#FFF",xe.style.border="none",xe.style.color="rgba(0, 0, 0, .7)",xe.style.fontWeight="bold",xe.style.borderRadius="10px",xe.style.paddingTop="5px",xe.style.paddingBottom="5px",xe.addEventListener("click",()=>{this.closeCheckDevices(),e({cameraId:v?.value,microphoneId:ee?.value})}),Ge.appendChild(xe),n.appendChild(Ge),r.appendChild(n),document.body.appendChild(r),this.startCheckDevices(this.options,this.videoOptions)})}videoDeviceInterface(e){let r=document.querySelector("#cameraStream");r&&(r.srcObject=e,r.play())}audioDeviceInterface(e){let n=document.querySelector("#audioStream")?.querySelectorAll("div"),i=document.querySelector("#audioText");this.volumeMeter=new Ha(this.cameraRecorder.cameraStream),this.volumeMeter.start({setVolume:a=>{this.volumeCounter++,this.volumeSum+=a;let s=a/4;n?.forEach((v,d)=>{d<Math.ceil(s)?v.style.backgroundColor="rgb(22, 163, 74)":v.style.backgroundColor="rgba(0, 0, 0, .3)"}),i&&(i.innerText=a.toFixed(0).toString())}}).catch(a=>{console.log(a),this.volumeMeter=void 0})}async setSelectOption(e){let r=document.querySelector("#cameraSelect"),n=document.querySelector("#micSelect"),i=await xn();r&&(r.value=e.cameraId||"default"),n&&(n.value=e.microphoneId||"default");let a=(s,v)=>{let d=document.createElement("option");return d.setAttribute("value",v),d.innerHTML=s,d};i.cameras.forEach(s=>{let v=a(s.label,s.id);r?.appendChild(v)}),i.microphones.forEach(s=>{let v=a(s.label,s.id);n?.appendChild(v)}),this.onSelectOptionChange()}async onSelectOptionChange(){let e=document.querySelector("#cameraSelect"),r=document.querySelector("#micSelect");e?.addEventListener("change",async()=>{await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new zn({cameraId:e?.value,microphoneId:r?.value},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)}),r?.addEventListener("change",async()=>{await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new zn({cameraId:e?.value,microphoneId:r?.value},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)})}async startCheckDevices(e=bi,r){return this.setSelectOption(e),this.videoOptions=Ks(r),await Ko(),this.cameraRecorder=new zn({cameraId:e.cameraId,microphoneId:e.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream),{cameraStream:this.cameraRecorder.cameraStream}}async closeCheckDevices(){document.querySelector("#checkDevices")?.remove(),this.volumeMeter?.stop(),this.volumeMedia=Math.ceil(this.volumeSum/this.volumeCounter),await this.cameraRecorder.stopRecording()}};var Bf="not_shared_first_screen",Ys="multiple_monitors_detected",Nf="proctoring_already_started",$s="proctoring_not_started";var Zs=class{constructor(){this.hasExtension=!1;this.tryes=0;this.responseStart=!1}start(){let e;return new Promise((r,n)=>{window.postMessage({type:"easyproctor",func:"startExtensionEasyproctor"},"*"),e=setInterval(()=>{this.tryes>10&&(clearInterval(e),n(new Error("N\xE3o foi poss\xEDvel se conectar com a extens\xE3o"))),this.responseStart&&(clearInterval(e),r(this.responseStart)),this.tryes++},1e3)})}sendVerifyMsg(e,r){window.postMessage({type:"easyproctor",func:"verifyExtensionEasyproctor",url:e,token:r},"*")}verify(e){return e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="progress"&&this.options.onProgress&&this.options.onProgress(100),e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="start"&&(this.responseStart=!0),new Promise((r,n)=>{e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="version"&&(this.hasExtension=!0,r(this.hasExtension))})}addEventListener(){window.addEventListener("message",e=>this.verify(e))}};var Qs=class{constructor(e,r){this.repositoryDevices=e,this.proctoringId=r}startRecording(e){navigator.mediaDevices.ondevicechange=()=>{this.onChangeDevices(e)}}async onChangeDevices(e){let r=await xn(),n=(z,ee)=>z.label===ee.label&&z.id===ee.id,i=(z,ee,te)=>z.filter(D=>!ee.some(ce=>te(D,ce))),a=await this.repositoryDevices.getDevices("devices"),s={label:"",id:""},v={cameras:a?.cameras||[s],microphones:a?.microphones||[s]},d,p;r.cameras.length!=v?.cameras.length&&(d=r.cameras.length>v?.cameras.length?i(r.cameras,v?.cameras,n):i(v?.cameras,r.cameras,n),d=d.filter(z=>z.id!="default")),r.microphones.length!=v?.microphones.length&&(p=r.microphones.length>v?.microphones.length?i(r.microphones,v?.microphones,n):i(v?.microphones,r.microphones,n),p=p.filter(z=>z.id!="default"&&z.id!="communications"));let B={cameras:d||[],microphones:p||[],status:r.cameras.length>v?.cameras.length||r.microphones.length>v?.microphones.length?"in":"out"};await this.repositoryDevices.save({...r,id:"devices",status:r.cameras.length>v?.cameras.length||r.microphones.length>v?.microphones.length?"in":"out"}),e.status&&(B.cameras.length!=0||B.microphones.length!=0)&&(Yt.registerChangeDevice(this.proctoringId,B.status,B),e.status(B))}};var km="https://proctoring-api-dev.easyproctor.tech/api",Om="https://proctoring-api-hml.easyproctor.tech/api",Df="https://proctoring-api.easyproctor.tech/api",Js=class{constructor(e){this.options=e;this.baseUrl=this.selectBaseUrl(e.type)}selectBaseUrl(e){return e==="dev"?km:e==="homol"?Om:Df}async confirmStart(e,r){return await this.makeRequest({path:`/proctoring/start/${e.examId}`,method:"POST",body:{clientId:e.clientId,proctoringType:r},jwt:e.token})}async getInsights(e){return(await this.makeRequestAxios({path:"/AzureKey/getInsights",method:"GET",jwt:e.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getAzureBlobUrl(e){return(await this.makeRequestAxios({path:"/AzureKey/get-blob-url",method:"GET",jwt:e.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getAzureSignedUrl(e,r,n){return(await this.makeRequestAxios({path:"/AzureKey/signed-url",method:"POST",jwt:e,body:{objectName:r.type==="image/jpeg"&&n?`${n}/${r.name}`:r.name,contentType:r.type}})).data}async getAzureSignedUrlImage(e,r){return(await this.makeRequestAxios({path:"/AzureKey/signed-url",method:"POST",jwt:e,body:{objectName:r.name,contentType:r.type}})).data}async getAwsSignedUrl(e,r){return(await this.makeRequestAxios({path:"/AwsKey/signed-url",method:"POST",jwt:e,body:{objectName:r.name,contentType:r.type}})).data}async sendAwsToAzure(e,r){await this.makeRequest({path:"/Proctoring/aws-to-azure",method:"POST",jwt:e,body:{objectName:`${r.name}`}})}async saveScreenAlerts(e,r){await this.makeRequest({path:"/proctoring/save-screen",method:"POST",jwt:e.token,body:{proctoringId:r.id,alerts:r.alerts}})}async finishAndSendUrls(e,r){let n=new Date().toISOString(),i=r.recordings.find(z=>z.origin==="Camera")?.upload,a=r.recordings.find(z=>z.origin==="Mic")?.upload,s=r.recordings.find(z=>z.origin==="Screen")?.upload,v=z=>z?z.substring(0,z.indexOf("?")):void 0,d=v(i?.azureUrl),p=v(a?.azureUrl),B=v(s?.azureUrl);if(!d||!p||!B){let z=await this.getAzureBlobUrl(e);!d&&(d=`${z}/${r.recordings.find(ee=>ee.origin==="Camera")?.file.name}`),!p&&(p=`${z}/${r.recordings.find(ee=>ee.origin==="Mic")?.file.name}`),!B&&r.recordings.find(ee=>ee.origin==="Screen")&&(B=`${z}/${r.recordings.find(ee=>ee.origin==="Screen")?.file.name}`)}await this.makeRequest({path:`/proctoring/finish/${e.examId}`,method:"POST",body:{endDate:n,videoCameraUrl:d,audioCameraUrl:p,videoScreenUrl:B},jwt:e.token})}async getServerHour(e){return await this.makeRequest({path:"/Proctoring/server-hour",method:"GET",jwt:e})}async makeRequest(e){let{path:r,method:n,body:i,jwt:a}=e,s=await fetch(this.baseUrl+r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let v=s.headers.get("content-type");return(v?v.includes("application/json"):!1)?await s.json():null}async makeRequestAxios(e){let{path:r,method:n,body:i,jwt:a}=e,s=await ua.request({url:this.baseUrl+r,method:n,headers:{Authorization:`Bearer ${a}`,"Access-Control-Allow-Origin":"*"},data:i});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";return s}async makeRequestPUT(e){let{url:r,method:n,body:i,jwt:a}=e,s=await fetch(r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Accept:"*/*","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive","aeg-event-type":"Notification","Content-Type":"application/json","Cache-Control":"no-cache","x-ms-blob-type":"BlockBlob"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let v=s.headers.get("content-type");return(v?v.includes("application/json"):!1)?await s.json():null}};var Va=class{constructor(e){this.loadingBoolean=!0;this.proctoringId=e}async upload(e,r){try{let{file:n,onProgress:i}=e,a=URL.createObjectURL(n),s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=a,s.download=n.name,s.click(),window.URL.revokeObjectURL(a),this.loadingBoolean=!1,clearInterval(this.loadingInterval),i&&i(Math.round(100))}catch{throw new Error("Error on machine download")}}};var e0=class{constructor(e,r){this.session=e;this.recorders=r}async startAll(){this.session.start();let e=this.recorders.map(r=>r.startRecording());await Promise.all(e)}async pauseAll(){this.session.pause();let e=this.recorders.map(r=>r.pauseRecording());await Promise.all(e)}async resumeAll(){this.session.resume();let e=this.recorders.map(r=>r.resumeRecording());await Promise.all(e)}async stopAll(){let e=this.recorders.map(r=>r.stopRecording());await Promise.all(e),this.session.stop()}async saveAllOnSession(){let e=this.recorders.map(r=>{r.saveOnSession(this.session)});await Promise.all(e)}};var qa=class{constructor(e,r,n){this.session=e;this.proctoringId=r;this.uploadServices=n}async upload(e,r){await this.uploadRecordings(e,r)}async uploadRecordings(e,r){await this.uploadAllFiles(e,r),this.session.hasSomethingToUpload||this.session.setUploaded()}async uploadAllFiles(e,r){for(let n=0;n<this.session.recordings.length;n++){let i=this.session.recordings[n];if(i.upload)continue;let a=v=>{let d=(n*100+v)/this.session.recordings.length;r&&r(d)},s=await this.uploadFile(i,e,a).catch(()=>{});s&&(i.upload||(i.upload={storage:"AzureBlob",awsUrl:"",azureUrl:""}),s.uploaded&&(i.upload.storage=s.storage),s.storage==="AzureBlob"?i.upload.azureUrl=s.url:i.upload.awsUrl=s.url)}r&&r(100)}async uploadFile(e,r,n){for await(let i of this.uploadServices){let a=await i.upload({file:e.file,onProgress:s=>{n&&n(s)}},r);if(a){let s="";return e.file.name.search("camera")!==-1?s="Camera":e.file.name.search("screen")!==-1?s="Screen":e.file.name.search("audio")!==-1&&(s="Audio"),Yt.registerUploadFile(this.proctoringId,`Upload File
55
+ `,r=document.createElement("style");r.innerHTML=e,document.head.appendChild(r)}};var Ja=class{constructor(e){this.stream=e}start(e={}){return new Promise((r,n)=>{try{let i=new AudioContext,a=i.createAnalyser(),o=i.createMediaStreamSource(this.stream);this.scriptProcessor=i.createScriptProcessor(2048,1,1),a.smoothingTimeConstant=.8,a.fftSize=1024,o.connect(a),a.connect(this.scriptProcessor),this.scriptProcessor.connect(i.destination);let l=this;this.scriptProcessor.onaudioprocess=function(){let c=new Uint8Array(a.frequencyBinCount);a.getByteFrequencyData(c);let w=c.reduce((k,H)=>k+H,0)/c.length;l.setVolume(w),e.setVolume&&e.setVolume(w)},r(!0)}catch(i){this.stop(),n(`Error: ${i}`)}})}stop(){this.scriptProcessor&&this.scriptProcessor.disconnect()}getVolume(){return this.volume}setVolume(e){this.volume=e}};var Di={cameraId:void 0,microphoneId:void 0,allowMultipleMonitors:!1,allowOnlyFirstMonitor:!0,captureScreen:!0,noiseLimit:40,proctoringType:"IMAGE",insights:""};function p0(t){return!!t.width&&!!t.height?{width:t.width,height:t.height}:{width:640,height:480}}var _0=class{constructor(){this.volumeMedia=0;this.volumeSum=0;this.volumeCounter=0}async checkDevices(e=Di,r={width:1080,height:720}){this.options={...Di,...e,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},this.videoOptions=r;let{cameraId:n,microphoneId:i}=await this.checkDevicesInterface();return new Promise(a=>{a({cameraId:n,microphoneId:i,volumeRange:this.volumeMedia})})}checkDevicesInterface(){return new Promise(e=>{let r=document.createElement("div");r.setAttribute("id","checkDevices"),r.style.backgroundColor="rgba(0,0,0,0.4)",r.style.zIndex="1000",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.height="100vh",r.style.width="100%",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center";let n=document.createElement("div");n.style.backgroundColor="#fff",n.style.zIndex="1001",n.style.width="600px",n.style.borderRadius="10px",n.style.display="flex",n.style.flexDirection="column",n.style.alignItems="center";let i=document.createElement("h3");i.innerText="Para iniciar configure a c\xE2mera e o microfone",i.style.color="rgba(0, 0, 0, .7)",i.style.fontWeight="bold",i.style.fontSize="20px",i.style.marginBottom="15px",i.style.padding="20px 0px",i.style.borderBottom="2px solid rgba(0, 0, 0, .1)",i.style.width="100%",i.style.textAlign="center",n.appendChild(i);let a=document.createElement("div"),o=document.createElement("h3"),l=document.createElement("select");l.setAttribute("id","cameraSelect"),a.style.padding="0 20px",a.style.width="100%",a.style.display="flex",a.style.justifyContent="space-between",a.style.marginBottom="15px",o.innerText="C\xE2mera",o.style.color="rgba(0, 0, 0, .75)",o.style.fontWeight="bold",o.style.fontSize="16px",l.style.maxWidth="400px",a.appendChild(o),a.appendChild(l),n.appendChild(a);let c=document.createElement("div"),d=document.createElement("video");d.setAttribute("id","cameraStream"),d.muted=!0,c.style.width="calc(100% - 40px)",c.style.display="flex",c.style.justifyContent="space-between",c.style.borderBottom="2px solid rgba(0, 0, 0, .1)",c.style.paddingBottom="15px",d.style.width="20rem",d.style.backgroundColor="#000",d.style.borderRadius="10px",d.style.marginBottom="15px",c.appendChild(d),n.appendChild(c);let w=document.createElement("div"),k=document.createElement("h3"),H=document.createElement("select");H.setAttribute("id","micSelect"),w.style.padding="0 20px",w.style.width="100%",w.style.display="flex",w.style.justifyContent="space-between",w.style.margin="15px 0",k.innerText="C\xE2mera",k.style.color="rgba(0, 0, 0, .7)",k.style.fontWeight="bold",k.style.fontSize="16px",H.style.maxWidth="400px",w.appendChild(k),w.appendChild(H),n.appendChild(w);let V=document.createElement("div");V.style.width="calc(100% - 40px)",V.style.display="flex",V.style.flexDirection="column",V.style.justifyContent="space-between",V.style.paddingBottom="15px";let x=document.createElement("div");x.setAttribute("id","audioStream"),x.style.display="flex",x.style.marginBottom="15px";for(let se=0;se<25;se++){let Ce=document.createElement("div");Ce.style.height="16px",Ce.style.width="5px",Ce.style.marginRight="5px",Ce.style.borderRadius="10px",Ce.style.backgroundColor="rgba(0, 0, 0, .3)",x.appendChild(Ce)}let K=document.createElement("div"),E=document.createElement("p"),z=document.createElement("p"),U=document.createElement("p");K.style.width="250px",K.style.display="flex",K.style.justifyContent="space-between",E.innerText="0",z.innerText="50",U.innerText="100",K.appendChild(E),K.appendChild(z),K.appendChild(U),V.appendChild(x),V.appendChild(K),n.appendChild(V);let J=document.createElement("button"),Z=document.createElement("div");J.setAttribute("id","confirmBtn"),Z.style.width="100%",Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="center",Z.style.borderTop="2px solid rgba(0, 0, 0, .1)",J.innerText="Continuar",J.style.width="100%",J.style.height="70px",J.style.backgroundColor="#FFF",J.style.border="none",J.style.color="rgba(0, 0, 0, .7)",J.style.fontWeight="bold",J.style.borderRadius="10px",J.style.paddingTop="5px",J.style.paddingBottom="5px",J.addEventListener("click",()=>{this.closeCheckDevices(),e({cameraId:l?.value,microphoneId:H?.value})}),Z.appendChild(J),n.appendChild(Z),r.appendChild(n),document.body.appendChild(r),this.startCheckDevices(this.options,this.videoOptions)})}videoDeviceInterface(e){let r=document.querySelector("#cameraStream");r&&(r.srcObject=e,r.play())}audioDeviceInterface(e){let n=document.querySelector("#audioStream")?.querySelectorAll("div"),i=document.querySelector("#audioText");this.volumeMeter=new Ja(this.cameraRecorder.cameraStream),this.volumeMeter.start({setVolume:a=>{this.volumeCounter++,this.volumeSum+=a;let o=a/4;n?.forEach((l,c)=>{c<Math.ceil(o)?l.style.backgroundColor="rgb(22, 163, 74)":l.style.backgroundColor="rgba(0, 0, 0, .3)"}),i&&(i.innerText=a.toFixed(0).toString())}}).catch(a=>{console.log(a),this.volumeMeter=void 0})}async setSelectOption(e){let r=document.querySelector("#cameraSelect"),n=document.querySelector("#micSelect"),i=await An();r&&(r.value=e.cameraId||"default"),n&&(n.value=e.microphoneId||"default");let a=(o,l)=>{let c=document.createElement("option");return c.setAttribute("value",l),c.innerHTML=o,c};i.cameras.forEach(o=>{let l=a(o.label,o.id);r?.appendChild(l)}),i.microphones.forEach(o=>{let l=a(o.label,o.id);n?.appendChild(l)}),this.onSelectOptionChange()}async onSelectOptionChange(){let e=document.querySelector("#cameraSelect"),r=document.querySelector("#micSelect");e?.addEventListener("change",async()=>{await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new Qn({cameraId:e?.value,microphoneId:r?.value},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)}),r?.addEventListener("change",async()=>{await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new Qn({cameraId:e?.value,microphoneId:r?.value},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)})}async startCheckDevices(e=Di,r){return this.setSelectOption(e),this.videoOptions=p0(r),await cs(),this.cameraRecorder=new Qn({cameraId:e.cameraId,microphoneId:e.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream),{cameraStream:this.cameraRecorder.cameraStream}}async closeCheckDevices(){document.querySelector("#checkDevices")?.remove(),this.volumeMeter?.stop(),this.volumeMedia=Math.ceil(this.volumeSum/this.volumeCounter),await this.cameraRecorder.stopRecording()}};var hf="not_shared_first_screen",g0="multiple_monitors_detected",pf="proctoring_already_started",b0="proctoring_not_started";var S0=class{constructor(){this.hasExtension=!1;this.tryes=0;this.responseStart=!1}start(){let e;return new Promise((r,n)=>{window.postMessage({type:"easyproctor",func:"startExtensionEasyproctor"},"*"),e=setInterval(()=>{this.tryes>10&&(clearInterval(e),n(new Error("N\xE3o foi poss\xEDvel se conectar com a extens\xE3o"))),this.responseStart&&(clearInterval(e),r(this.responseStart)),this.tryes++},1e3)})}sendVerifyMsg(e,r){window.postMessage({type:"easyproctor",func:"verifyExtensionEasyproctor",url:e,token:r},"*")}verify(e){return e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="progress"&&this.options.onProgress&&this.options.onProgress(100),e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="start"&&(this.responseStart=!0),new Promise((r,n)=>{e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="version"&&(this.hasExtension=!0,r(this.hasExtension))})}addEventListener(){window.addEventListener("message",e=>this.verify(e))}};var y0=class{constructor(e,r){this.repositoryDevices=e,this.proctoringId=r}startRecording(e){navigator.mediaDevices.ondevicechange=()=>{this.onChangeDevices(e)}}async onChangeDevices(e){let r=await An(),n=(k,H)=>k.label===H.label&&k.id===H.id,i=(k,H,V)=>k.filter(x=>!H.some(K=>V(x,K))),a=await this.repositoryDevices.getDevices("devices"),o={label:"",id:""},l={cameras:a?.cameras||[o],microphones:a?.microphones||[o]},c,d;r.cameras.length!=l?.cameras.length&&(c=r.cameras.length>l?.cameras.length?i(r.cameras,l?.cameras,n):i(l?.cameras,r.cameras,n),c=c.filter(k=>k.id!="default")),r.microphones.length!=l?.microphones.length&&(d=r.microphones.length>l?.microphones.length?i(r.microphones,l?.microphones,n):i(l?.microphones,r.microphones,n),d=d.filter(k=>k.id!="default"&&k.id!="communications"));let w={cameras:c||[],microphones:d||[],status:r.cameras.length>l?.cameras.length||r.microphones.length>l?.microphones.length?"in":"out"};await this.repositoryDevices.save({...r,id:"devices",status:r.cameras.length>l?.cameras.length||r.microphones.length>l?.microphones.length?"in":"out"}),e.status&&(w.cameras.length!=0||w.microphones.length!=0)&&(Qt.registerChangeDevice(this.proctoringId,w.status,w),e.status(w))}};var Sp="https://proctoring-api-dev.easyproctor.tech/api",yp="https://proctoring-api-hml.easyproctor.tech/api",_f="https://proctoring-api.easyproctor.tech/api",x0=class{constructor(e){this.options=e;this.baseUrl=this.selectBaseUrl(e.type)}selectBaseUrl(e){return e==="dev"?Sp:e==="homol"?yp:_f}async confirmStart(e,r){return await this.makeRequest({path:`/proctoring/start/${e.examId}`,method:"POST",body:{clientId:e.clientId,proctoringType:r},jwt:e.token})}async getInsights(e){return(await this.makeRequestAxios({path:"/AzureKey/getInsights",method:"GET",jwt:e.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getAzureBlobUrl(e){return(await this.makeRequestAxios({path:"/AzureKey/get-blob-url",method:"GET",jwt:e.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getAzureSignedUrl(e,r,n){return(await this.makeRequestAxios({path:"/AzureKey/signed-url",method:"POST",jwt:e,body:{objectName:r.type==="image/jpeg"&&n?`${n}/${r.name}`:r.name,contentType:r.type}})).data}async getAzureSignedUrlImage(e,r){return(await this.makeRequestAxios({path:"/AzureKey/signed-url",method:"POST",jwt:e,body:{objectName:r.name,contentType:r.type}})).data}async getAwsSignedUrl(e,r){return(await this.makeRequestAxios({path:"/AwsKey/signed-url",method:"POST",jwt:e,body:{objectName:r.name,contentType:r.type}})).data}async sendAwsToAzure(e,r){await this.makeRequest({path:"/Proctoring/aws-to-azure",method:"POST",jwt:e,body:{objectName:`${r.name}`}})}async saveScreenAlerts(e,r){await this.makeRequest({path:"/proctoring/save-screen",method:"POST",jwt:e.token,body:{proctoringId:r.id,alerts:r.alerts}})}async finishAndSendUrls(e,r){let n=new Date().toISOString(),i=r.recordings.find(k=>k.origin==="Camera")?.upload,a=r.recordings.find(k=>k.origin==="Mic")?.upload,o=r.recordings.find(k=>k.origin==="Screen")?.upload,l=k=>k?k.substring(0,k.indexOf("?")):void 0,c=l(i?.azureUrl),d=l(a?.azureUrl),w=l(o?.azureUrl);if(!c||!d||!w){let k=await this.getAzureBlobUrl(e);!c&&(c=`${k}/${r.recordings.find(H=>H.origin==="Camera")?.file.name}`),!d&&(d=`${k}/${r.recordings.find(H=>H.origin==="Mic")?.file.name}`),!w&&r.recordings.find(H=>H.origin==="Screen")&&(w=`${k}/${r.recordings.find(H=>H.origin==="Screen")?.file.name}`)}await this.makeRequest({path:`/proctoring/finish/${e.examId}`,method:"POST",body:{endDate:n,videoCameraUrl:c,audioCameraUrl:d,videoScreenUrl:w},jwt:e.token})}async getServerHour(e){return await this.makeRequest({path:"/Proctoring/server-hour",method:"GET",jwt:e})}async makeRequest(e){let{path:r,method:n,body:i,jwt:a}=e,o=await fetch(this.baseUrl+r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}});if(o.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let l=o.headers.get("content-type");return(l?l.includes("application/json"):!1)?await o.json():null}async makeRequestAxios(e){let{path:r,method:n,body:i,jwt:a}=e,o=await wa.request({url:this.baseUrl+r,method:n,headers:{Authorization:`Bearer ${a}`,"Access-Control-Allow-Origin":"*"},data:i});if(o.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";return o}async makeRequestPUT(e){let{url:r,method:n,body:i,jwt:a}=e,o=await fetch(r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Accept:"*/*","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive","aeg-event-type":"Notification","Content-Type":"application/json","Cache-Control":"no-cache","x-ms-blob-type":"BlockBlob"}});if(o.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let l=o.headers.get("content-type");return(l?l.includes("application/json"):!1)?await o.json():null}};var eo=class{constructor(e){this.loadingBoolean=!0;this.proctoringId=e}async upload(e,r){try{let{file:n,onProgress:i}=e,a=URL.createObjectURL(n),o=document.createElement("a");document.body.appendChild(o),o.style.display="none",o.href=a,o.download=n.name,o.click(),window.URL.revokeObjectURL(a),this.loadingBoolean=!1,clearInterval(this.loadingInterval),i&&i(Math.round(100))}catch{throw new Error("Error on machine download")}}};var w0=class{constructor(e,r){this.session=e;this.recorders=r}async startAll(){this.session.start();let e=this.recorders.map(r=>r.startRecording());await Promise.allSettled(e).then(r=>{r.map(n=>{if(n.status==="rejected")throw new Error(n.reason)})})}async pauseAll(){this.session.pause();let e=this.recorders.map(r=>r.pauseRecording());await Promise.all(e)}async resumeAll(){this.session.resume();let e=this.recorders.map(r=>r.resumeRecording());await Promise.all(e)}async stopAll(){let e=this.recorders.map(r=>r.stopRecording());await Promise.all(e),this.session.stop()}async saveAllOnSession(){let e=this.recorders.map(r=>{r.saveOnSession(this.session)});await Promise.all(e)}};var to=class{constructor(e,r,n){this.session=e;this.proctoringId=r;this.uploadServices=n}async upload(e,r){await this.uploadRecordings(e,r)}async uploadRecordings(e,r){await this.uploadAllFiles(e,r),this.session.hasSomethingToUpload||this.session.setUploaded()}async uploadAllFiles(e,r){for(let n=0;n<this.session.recordings.length;n++){let i=this.session.recordings[n];if(i.upload)continue;let a=l=>{let c=(n*100+l)/this.session.recordings.length;r&&r(c)},o=await this.uploadFile(i,e,a).catch(()=>{});o&&(i.upload||(i.upload={storage:"AzureBlob",awsUrl:"",azureUrl:""}),o.uploaded&&(i.upload.storage=o.storage),o.storage==="AzureBlob"?i.upload.azureUrl=o.url:i.upload.awsUrl=o.url)}r&&r(100)}async uploadFile(e,r,n){for await(let i of this.uploadServices){let a=await i.upload({file:e.file,onProgress:o=>{n&&n(o)}},r);if(a){let o="";return e.file.name.search("camera")!==-1?o="Camera":e.file.name.search("screen")!==-1?o="Screen":e.file.name.search("audio")!==-1&&(o="Audio"),Qt.registerUploadFile(this.proctoringId,`Upload File
46
56
  Name: ${e.file.name}
47
57
  Type: ${e.file.type}
48
- Size: ${e.file.size}`,s),a}}throw new Error("Could not upload")}};var t0=class{constructor(e,r,n){this.alerts=[];this.onLostFocusCallback=e.onLostFocusCallback,this.onFocusCallback=e.onFocusCallback,this.onNoiseDetectedCallback=e.onNoiseDetectedCallback,this.optionsProctoring=r,this.cameraRecorder=n}async startRecording(){this.startTime=new Date(Date.now()),this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetected(),500),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()))}async pauseRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus()),window.removeEventListener("focus",()=>this.onNoiseDetected()),this.volumeMeter.stop(),clearInterval(this.intervalNoiseDetection)}async resumeRecording(){this.volumeMeter=void 0,this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetected(),500),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()),window.addEventListener("focus",()=>this.onNoiseDetected()))}async stopRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus()),window.removeEventListener("focus",()=>this.onNoiseDetected()),this.volumeMeter.stop(),clearInterval(this.intervalNoiseDetection)}async saveOnSession(e){this.alerts.forEach(r=>{e.addAlert(r)})}onLostFocus(){Date.now()-this.startTime?.getTime()>1e4&&(this.onLostFocusCallback(),this.alerts.push({begin:Date.now()-this.startTime.getTime(),end:0,alert:25}))}onReturnFocus(){let e=this.alerts[this.alerts.length-1];e&&(this.onFocusCallback(),e.end=Date.now()-this.startTime.getTime())}onNoiseDetected(){!this.volumeMeter&&this.cameraRecorder.cameraStream&&(this.volumeMeter=new Ha(this.cameraRecorder.cameraStream),this.volumeMeter.start().catch(e=>{console.log(e),this.volumeMeter=void 0})),this.volumeMeter?.getVolume()>=(this.optionsProctoring.noiseLimit||40)&&this.onNoiseDetectedCallback()}};var Lm=kf();function Of(t){return new Lm(t)}var r0=class{constructor(){this.blobs=[]}async startRecording(){this.recorder=Of({bitRate:128}),this.recorder.start().catch(e=>{throw new Error("Error on Audio to Start Recording")})}async pauseRecording(){}async resumeRecording(){}async stopRecording(){if(!this.recorder)return;let e=await this.recorder.stop().getMp3().then(async([r,n])=>({buffer:r,blob:n})).catch(r=>{alert("We could not retrieve your message")});e&&this.blobs.push(e.blob)}async saveOnSession(e){e.addRecording({device:"",file:new File(this.blobs,`EP_${e.id}_audio_0.mp3`,{type:"audio/mp3"}),origin:"Mic"})}};var n0=class{constructor(e){this.blobs=[];this.blobsFinal=[];this.options=e}async startRecording(){this.startTime=new Date(Date.now());let{allowOnlyFirstMonitor:e,onStopSharingScreenCallback:r}=this.options,n={video:{cursor:"always"},audio:!1};this.screenStream=await navigator.mediaDevices.getDisplayMedia(n);let i=this.screenStream.getVideoTracks();if(i[0].onended=r,navigator.userAgent.indexOf("Firefox")>-1&&!i.find(B=>B.label=="Primary Monitor")&&e)throw Ys;if(!(i.find(p=>["screen:0:0","Primary Monitor"].includes(p.label))!=null)&&e)throw i.forEach(p=>{p.stop()}),Bf;let{startRecording:v,stopRecording:d}=Qa(this.screenStream,this.blobs);this.recordingStart=v,this.recordingStop=d,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){await this.recordingStop()}async saveOnSession(e){e.addRecording({device:"",file:new File(this.blobs,`EP_${e.id}_screen_0.webm`,{type:"video/webm"}),origin:"Screen"})}};var Do=class{constructor(e,r){this.dbName="EasyProctorDb";this.dbVersion=2;this.storeName="exams2";this.dbName=e,this.storeName=r}async save(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.put(e),r).then(()=>{})}async delete(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.delete(e),r)}async get(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(e),r).catch(()=>{})}async getDevices(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(e),r).catch(()=>{})}async list(){let{transaction:e,store:r}=await this.connectToStore("readonly");return this.processRequest(r.getAll(),e)}async clear(){let{transaction:e,store:r}=await this.connectToStore("readwrite");return this.processRequest(r.clear(),e)}async processRequest(e,r){return new Promise((n,i)=>{e.onerror=a=>{i(e.error?.message)},e.onsuccess=a=>{r.commit(),n(e.result)}})}async hasSessions(){return(await this.list()).length>0}async connectToStore(e){let i=(await this.connect()).result.transaction(this.storeName,e),a=i.objectStore(this.storeName);return{transaction:i,store:a}}async connect(){return this.connection?this.connection:new Promise((e,r)=>{let n=window.indexedDB.open(this.dbName,this.dbVersion);n.onerror=i=>{r("Can't connect to IndexedDB")},n.onupgradeneeded=i=>{let a=n.result;a.onerror=s=>{},a.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=i=>{this.connection=n,e(n)}})}};var ko=class{constructor(e,r){this.backend=r;this.proctoringId=e}async upload(e,r){let{file:n,onProgress:i}=e;try{let a=d=>{let p=d.loadedBytes/n.size*100;i&&i(Math.round(p))},s=await this.backend.getAwsSignedUrl(r,n),v=await ua.request({url:s,method:"PUT",headers:{"Content-Type":n.type},data:n,onUploadProgress:d=>{a({loadedBytes:d.loaded})}}).then(()=>!0).catch(()=>!1);return await this.backend.sendAwsToAzure(r,n),{storage:"AwsS3",url:s,uploaded:v}}catch{throw Yt.registerError(this.proctoringId,`Failed to upload to AWS
58
+ Size: ${e.file.size}`,o),a}}throw new Error("Could not upload")}};var R0=class{constructor(e,r,n){this.alerts=[];this.onLostFocusCallback=e.onLostFocusCallback,this.onFocusCallback=e.onFocusCallback,this.onNoiseDetectedCallback=e.onNoiseDetectedCallback,this.optionsProctoring=r,this.cameraRecorder=n}async startRecording(){this.startTime=new Date(Date.now()),this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetected(),500),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()))}async pauseRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus()),window.removeEventListener("focus",()=>this.onNoiseDetected()),this.volumeMeter.stop(),clearInterval(this.intervalNoiseDetection)}async resumeRecording(){this.volumeMeter=void 0,this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetected(),500),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()),window.addEventListener("focus",()=>this.onNoiseDetected()))}async stopRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus()),window.removeEventListener("focus",()=>this.onNoiseDetected()),this.volumeMeter&&this.volumeMeter.stop(),clearInterval(this.intervalNoiseDetection)}async saveOnSession(e){this.alerts.forEach(r=>{e.addAlert(r)})}onLostFocus(){Date.now()-this.startTime?.getTime()>1e4&&(this.onLostFocusCallback(),this.alerts.push({begin:Date.now()-this.startTime.getTime(),end:0,alert:25}))}onReturnFocus(){let e=this.alerts[this.alerts.length-1];e&&(this.onFocusCallback(),e.end=Date.now()-this.startTime.getTime())}onNoiseDetected(){!this.volumeMeter&&this.cameraRecorder.cameraStream&&(this.volumeMeter=new Ja(this.cameraRecorder.cameraStream),this.volumeMeter.start().catch(e=>{console.log(e),this.volumeMeter=void 0})),this.volumeMeter?.getVolume()>=(this.optionsProctoring.noiseLimit||40)&&this.onNoiseDetectedCallback()}};var xp=gf();function bf(t){return new xp(t)}var T0=class{constructor(){this.blobs=[]}async startRecording(){this.recorder=bf({bitRate:128}),this.recorder.start().catch(e=>{throw new Error("Error on Audio to Start Recording")})}async pauseRecording(){}async resumeRecording(){}async stopRecording(){if(!this.recorder)return;let e=await this.recorder.stop().getMp3().then(async([r,n])=>({buffer:r,blob:n})).catch(r=>{alert("We could not retrieve your message")});e&&this.blobs.push(e.blob)}async saveOnSession(e){e.addRecording({device:"",file:new File(this.blobs,`EP_${e.id}_audio_0.mp3`,{type:"audio/mp3"}),origin:"Mic"})}};var E0=class{constructor(e){this.blobs=[];this.blobsFinal=[];this.options=e}async startRecording(){this.startTime=new Date(Date.now());let{allowOnlyFirstMonitor:e,onStopSharingScreenCallback:r}=this.options,n={video:{cursor:"always"},audio:!1};this.screenStream=await navigator.mediaDevices.getDisplayMedia(n);let i=this.screenStream.getVideoTracks();if(i[0].onended=r,navigator.userAgent.indexOf("Firefox")>-1&&!i.find(w=>w.label=="Primary Monitor")&&e)throw g0;if(!(i.find(d=>["screen:0:0","Primary Monitor"].includes(d.label))!=null)&&e)throw i.forEach(d=>{d.stop()}),hf;let{startRecording:l,stopRecording:c}=ho(this.screenStream,this.blobs);this.recordingStart=l,this.recordingStop=c,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){await this.recordingStop()}async saveOnSession(e){e.addRecording({device:"",file:new File(this.blobs,`EP_${e.id}_screen_0.webm`,{type:"video/webm"}),origin:"Screen"})}};var $o=class{constructor(e,r){this.dbName="EasyProctorDb";this.dbVersion=2;this.storeName="exams2";this.dbName=e,this.storeName=r}async save(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.put(e),r).then(()=>{})}async delete(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.delete(e),r)}async get(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(e),r).catch(()=>{})}async getDevices(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(e),r).catch(()=>{})}async list(){let{transaction:e,store:r}=await this.connectToStore("readonly");return this.processRequest(r.getAll(),e)}async clear(){let{transaction:e,store:r}=await this.connectToStore("readwrite");return this.processRequest(r.clear(),e)}async processRequest(e,r){return new Promise((n,i)=>{e.onerror=a=>{i(e.error?.message)},e.onsuccess=a=>{r.commit(),n(e.result)}})}async hasSessions(){return(await this.list()).length>0}async connectToStore(e){let i=(await this.connect()).result.transaction(this.storeName,e),a=i.objectStore(this.storeName);return{transaction:i,store:a}}async connect(){return this.connection?this.connection:new Promise((e,r)=>{let n=window.indexedDB.open(this.dbName,this.dbVersion);n.onerror=i=>{r("Can't connect to IndexedDB")},n.onupgradeneeded=i=>{let a=n.result;a.onerror=o=>{},a.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=i=>{this.connection=n,e(n)}})}};var Zo=class{constructor(e,r){this.backend=r;this.proctoringId=e}async upload(e,r){let{file:n,onProgress:i}=e;try{let a=c=>{let d=c.loadedBytes/n.size*100;i&&i(Math.round(d))},o=await this.backend.getAwsSignedUrl(r,n),l=await wa.request({url:o,method:"PUT",headers:{"Content-Type":n.type},data:n,onUploadProgress:c=>{a({loadedBytes:c.loaded})}}).then(()=>!0).catch(()=>!1);return await this.backend.sendAwsToAzure(r,n),{storage:"AwsS3",url:o,uploaded:l}}catch{throw Qt.registerError(this.proctoringId,`Failed to upload to AWS
49
59
  File name: ${n.name}
50
60
  File type: ${n.type}
51
- File size: ${n.size}`),new Error("Failed to upload to AWS")}}};function xc(){let t=window.navigator.userAgent.split("SEB/");return t.length>1?t[1]:"1.0.0.0"}var i0=class{constructor(e){this.context=e;this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{console.log("Stop sharing screen"),Yt.registerStopSharingScreen(this.proctoringId,"Stop sharing screen")};this.onLostFocusCallback=()=>{};this.onFocusCallback=()=>{};this.onNoiseDetectedCallback=()=>{};this.backend=new Js({type:e.type}),this.repository=new Do("EasyProctorDb","exams2"),this.repositoryDevices=new Do("EasyProctorDbDevices","devices")}setOnStopSharingScreenCallback(e){this.onStopSharingScreenCallback=()=>e()}setOnLostFocusCallback(e){this.onLostFocusCallback=()=>e()}setOnFocusCallback(e){this.onFocusCallback=()=>e()}setOnNoiseDetectedCallback(e){this.onNoiseDetectedCallback=()=>e()}async onChangeDevices(e={}){new Qs(this.repositoryDevices,this.proctoringId).startRecording(e)}createRecorders(e=bi){let r=new zn({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height},this.backend,this.context.token,this.proctoringId),n=new r0,i=this.sessionOptions.captureScreen?new n0({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback()}):void 0,a=new t0({onFocusCallback:()=>this.onFocusCallback(),onLostFocusCallback:()=>this.onLostFocusCallback(),onNoiseDetectedCallback:()=>this.onNoiseDetectedCallback()},e,r);this.onChangeDevices();let s=[r,n,i,a].filter(Boolean);return this.recorder=new e0(this.proctoringSession,s),{cameraRecorder:r,audioRecorder:n,screenRecorder:i,alertRecorder:a}}async start(e=bi,r={}){this.extension=new Zs,this.extension.addEventListener();let n=this.backend.selectBaseUrl(this.context.type),i=await xn();if(await this.repositoryDevices.save({...i,id:"devices"}),this.sessionOptions={...bi,...e},this.videoOptions=Ks(r),this.state!="Stop")throw Nf;this.state="Starting",await this.initConfig(),await this.verifyMultipleMonitors(this.sessionOptions),await this.repository.hasSessions()&&await this.repository.clear();try{let a=await this.backend.confirmStart({clientId:this.context.clientId,examId:this.context.examId,token:this.context.token},this.sessionOptions.proctoringType);return this.proctoringId=a.id,this.proctoringSession=new Yo(this.proctoringId),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),await this.repository.save(this.proctoringSession),Yt.registerStart(this.proctoringId,!0,""),a.cameraStream=this.allRecorders.cameraRecorder.cameraStream,this.allRecorders.screenRecorder&&(a.screenStream=this.allRecorders.screenRecorder.screenStream),this.state="Recording",a}catch(a){throw await this.cancel(),Yt.registerStart(this.proctoringId,!1,`Token: ${this.context.token}
52
- Error: `+a),this.state="Stop",a}}async cancel(){this.state==="Recording"&&await this.recorder.stopAll(),this.state="Stop"}async finish(e={}){if(this.extension.options=e,this.state!=="Recording")throw $s;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession);let r,n;xc()!=="1.0.0.0"?(r=new qa(this.proctoringSession,this.proctoringId,[new Va(this.proctoringId)]),n="Download",this.serviceType="Download"):(r=new qa(this.proctoringSession,this.proctoringId,[new Ji(this.proctoringId,this.backend),new ko(this.proctoringId,this.backend),new Va(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload");let i=!1;this.extension.hasExtension&&await this.extension.start().then(a=>{i=a}).catch(a=>{i=!1}),(!i||!this.extension.hasExtension)&&(await r.upload(this.context.token,e.onProgress).catch(async a=>{Yt.registerUpload(this.proctoringSession.id,!1,`upload error: ${a}
61
+ File size: ${n.size}`),new Error("Failed to upload to AWS")}}};function Zc(){let t=window.navigator.userAgent.split("SEB/");return t.length>1?t[1]:"1.0.0.0"}var A0=class{constructor(e){this.context=e;this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{console.log("Stop sharing screen"),Qt.registerStopSharingScreen(this.proctoringId,"Stop sharing screen")};this.onLostFocusCallback=()=>{};this.onFocusCallback=()=>{};this.onNoiseDetectedCallback=()=>{};this.backend=new x0({type:e.type}),this.repository=new $o("EasyProctorDb","exams2"),this.repositoryDevices=new $o("EasyProctorDbDevices","devices")}setOnStopSharingScreenCallback(e){this.onStopSharingScreenCallback=()=>e()}setOnLostFocusCallback(e){this.onLostFocusCallback=()=>e()}setOnFocusCallback(e){this.onFocusCallback=()=>e()}setOnNoiseDetectedCallback(e){this.onNoiseDetectedCallback=()=>e()}async onChangeDevices(e={}){new y0(this.repositoryDevices,this.proctoringId).startRecording(e)}createRecorders(e=Di){let r=new Qn({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height},this.backend,this.context.token,this.proctoringId),n=new T0,i=this.sessionOptions.captureScreen?new E0({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback()}):void 0,a=new R0({onFocusCallback:()=>this.onFocusCallback(),onLostFocusCallback:()=>this.onLostFocusCallback(),onNoiseDetectedCallback:()=>this.onNoiseDetectedCallback()},e,r);this.onChangeDevices();let o=[r,n,i,a].filter(Boolean);return this.recorder=new w0(this.proctoringSession,o),{cameraRecorder:r,audioRecorder:n,screenRecorder:i,alertRecorder:a}}async start(e=Di,r={}){this.extension=new S0,this.extension.addEventListener();let n=this.backend.selectBaseUrl(this.context.type),i=await An();if(await this.repositoryDevices.save({...i,id:"devices"}),this.sessionOptions={...Di,...e},this.videoOptions=p0(r),await this.initConfig(),await this.verifyMultipleMonitors(this.sessionOptions),this.state!="Stop")throw pf;this.state="Starting",await this.repository.hasSessions()&&await this.repository.clear();try{let a=await this.backend.confirmStart({clientId:this.context.clientId,examId:this.context.examId,token:this.context.token},this.sessionOptions.proctoringType);return this.proctoringId=a.id,this.proctoringSession=new _s(this.proctoringId),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),await this.repository.save(this.proctoringSession),Qt.registerStart(this.proctoringId,!0,""),a.cameraStream=this.allRecorders.cameraRecorder.cameraStream,this.allRecorders.screenRecorder&&(a.screenStream=this.allRecorders.screenRecorder.screenStream),this.state="Recording",a}catch(a){throw await this.cancel(),Qt.registerStart(this.proctoringId,!1,`Token: ${this.context.token}
62
+ Error: `+a),this.state="Stop",a}}async cancel(){(this.state==="Recording"||this.state==="Starting")&&await this.recorder.stopAll(),this.state="Stop"}async finish(e={}){if(this.extension.options=e,this.state!=="Recording")throw b0;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession);let r,n;Zc()!=="1.0.0.0"?(r=new to(this.proctoringSession,this.proctoringId,[new eo(this.proctoringId)]),n="Download",this.serviceType="Download"):(r=new to(this.proctoringSession,this.proctoringId,[new da(this.proctoringId,this.backend),new Zo(this.proctoringId,this.backend),new eo(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload");let i=!1;this.extension.hasExtension&&await this.extension.start().then(a=>{i=a}).catch(a=>{i=!1}),(!i||!this.extension.hasExtension)&&(await r.upload(this.context.token,e.onProgress).catch(async a=>{Qt.registerUpload(this.proctoringSession.id,!1,`upload error: ${a}
53
63
 
54
- Upload Services: ${n}`,this.serviceType),xc()!=="1.0.0.0"&&(r=new qa(this.proctoringSession,this.proctoringId,[new Ji(this.proctoringId,this.backend),new ko(this.proctoringId,this.backend),new Va(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload",await r.upload(this.context.token,e.onProgress).catch(s=>{Yt.registerUpload(this.proctoringSession.id,!1,`upload backup error: ${s}
64
+ Upload Services: ${n}`,this.serviceType),Zc()!=="1.0.0.0"&&(r=new to(this.proctoringSession,this.proctoringId,[new da(this.proctoringId,this.backend),new Zo(this.proctoringId,this.backend),new eo(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload",await r.upload(this.context.token,e.onProgress).catch(o=>{Qt.registerUpload(this.proctoringSession.id,!1,`upload backup error: ${o}
55
65
 
56
66
  Upload Services: ${n}
57
- Upload backup for Safe Browser`,this.serviceType)}))}),Yt.registerUpload(this.proctoringSession.id,!0,`upload success
67
+ Upload backup for Safe Browser`,this.serviceType)}))}),Qt.registerUpload(this.proctoringSession.id,!0,`upload success
58
68
 
59
- Upload Services: ${n}`,this.serviceType)),await this.backend.saveScreenAlerts(this.context,this.proctoringSession).catch(a=>{Yt.registerFinish(this.proctoringSession.id,!1,"save-screen error: "+a)}),await this.backend.finishAndSendUrls(this.context,this.proctoringSession).then(()=>{Yt.registerFinish(this.proctoringSession.id,!0,"")}).catch(a=>{Yt.registerFinish(this.proctoringSession.id,!1,"finish error: "+a)}),this.state="Stop"}async verifyMultipleMonitors(e){if(!e.allowMultipleMonitors&&await Wo())throw Yt.registerError(this.proctoringId,"Multiplas telas detectadas!"),Ys}async initConfig(){try{this.insights=await this.backend.getInsights(this.context),this.insights&&Mf(this.insights)}catch(e){throw Yt.registerError(this.proctoringId,"Erro no initConfig!"),await this.cancel(),e}}async getServerDate(){let e=await this.backend.getServerHour(this.context.token).catch(n=>{Yt.registerError(this.proctoringId,"N\xE3o foi poss\xEDvel requisitar a data do servidor!")});return e?new Date(e.toString()):new Date}async pause(){if(this.state!=="Recording")throw Yt.registerError(this.proctoringId,"Proctoring n\xE3o iniciado!"),$s;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession),this.state="Paused"}async resume(){if(this.state!="Paused")throw $s;return await this.verifyMultipleMonitors(this.sessionOptions),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),this.proctoringSession.recordings=[],await this.repository.save(this.proctoringSession),this.state="Recording",{cameraStream:this.allRecorders.cameraRecorder.cameraStream,_screenStream:this.allRecorders.screenRecorder?.screenStream}}};function yc(t,e="prod"){let r=new i0({type:e,clientId:t.clientId,examId:t.examId,token:t.token}),n=new Ws,i=new Xs,a=r.start.bind(r),s=r.finish.bind(r),v=r.pause.bind(r),d=r.resume.bind(r),p=r.setOnFocusCallback.bind(r),B=r.setOnLostFocusCallback.bind(r),z=r.setOnNoiseDetectedCallback.bind(r),ee=r.onChangeDevices.bind(r),te=r.setOnStopSharingScreenCallback.bind(r),D=n.checkDevices.bind(n),ce=i.takePicture.bind(i);return{start:a,finish:s,onFocus:p,onLostFocus:B,onNoiseDetected:z,onChangeDevices:ee,checkDevices:D,capturePhoto:ce,pause:v,resume:d,enumarateDevices:xn,checkPermissions:Ko,checkIfhasMultipleMonitors:Wo,onStopSharingScreen:te}}typeof window<"u"&&(window.useProctoring=yc);})();
69
+ Upload Services: ${n}`,this.serviceType)),await this.backend.saveScreenAlerts(this.context,this.proctoringSession).catch(a=>{Qt.registerFinish(this.proctoringSession.id,!1,"save-screen error: "+a)}),await this.backend.finishAndSendUrls(this.context,this.proctoringSession).then(()=>{Qt.registerFinish(this.proctoringSession.id,!0,"")}).catch(a=>{Qt.registerFinish(this.proctoringSession.id,!1,"finish error: "+a)}),this.state="Stop"}async verifyMultipleMonitors(e){if(!e.allowMultipleMonitors&&await us())throw Qt.registerError(this.proctoringId,"Multiplas telas detectadas!"),g0}async initConfig(){try{this.insights=await this.backend.getInsights(this.context),this.insights&&mf(this.insights)}catch(e){throw Qt.registerError(this.proctoringId,"Erro no initConfig!"),await this.cancel(),e}}async getServerDate(){let e=await this.backend.getServerHour(this.context.token).catch(n=>{Qt.registerError(this.proctoringId,"N\xE3o foi poss\xEDvel requisitar a data do servidor!")});return e?new Date(e.toString()):new Date}async pause(){if(this.state!=="Recording")throw Qt.registerError(this.proctoringId,"Proctoring n\xE3o iniciado!"),b0;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession),this.state="Paused"}async resume(){if(this.state!="Paused")throw b0;return await this.verifyMultipleMonitors(this.sessionOptions),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),this.proctoringSession.recordings=[],await this.repository.save(this.proctoringSession),this.state="Recording",{cameraStream:this.allRecorders.cameraRecorder.cameraStream,_screenStream:this.allRecorders.screenRecorder?.screenStream}}};function Qc(t,e="prod"){let r=new A0({type:e,clientId:t.clientId,examId:t.examId,token:t.token}),n=new _0,i=new h0,a=r.start.bind(r),o=r.finish.bind(r),l=r.pause.bind(r),c=r.resume.bind(r),d=r.setOnFocusCallback.bind(r),w=r.setOnLostFocusCallback.bind(r),k=r.setOnNoiseDetectedCallback.bind(r),H=r.onChangeDevices.bind(r),V=r.setOnStopSharingScreenCallback.bind(r),x=n.checkDevices.bind(n),K=i.takePicture.bind(i);return{start:a,finish:o,onFocus:d,onLostFocus:w,onNoiseDetected:k,onChangeDevices:H,checkDevices:x,capturePhoto:K,pause:l,resume:c,enumarateDevices:An,checkPermissions:cs,checkIfhasMultipleMonitors:us,onStopSharingScreen:V}}document.write('<script src="https://www.webrtc-experiment.com/EBML.js"><\/script>');typeof window<"u"&&(window.useProctoring=Qc);})();
60
70
  /*!
61
71
  * Microsoft Dynamic Proto Utility, 1.1.4
62
72
  * Copyright (c) Microsoft and contributors. All rights reserved.
63
73
  */
74
+ /**
75
+ * CanvasRecorder is a standalone class used by {@link RecordRTC} to bring HTML5-Canvas recording into video WebM. It uses HTML2Canvas library and runs top over {@link Whammy}.
76
+ * @summary HTML2Canvas recording into video WebM.
77
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
78
+ * @author {@link https://MuazKhan.com|Muaz Khan}
79
+ * @typedef CanvasRecorder
80
+ * @class
81
+ * @example
82
+ * var recorder = new CanvasRecorder(htmlElement, { disableLogs: true, useWhammyRecorder: true });
83
+ * recorder.record();
84
+ * recorder.stop(function(blob) {
85
+ * video.src = URL.createObjectURL(blob);
86
+ * });
87
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
88
+ * @param {HTMLElement} htmlElement - querySelector/getElementById/getElementsByTagName[0]/etc.
89
+ * @param {object} config - {disableLogs:true, initCallback: function}
90
+ */
91
+ /**
92
+ * DiskStorage is a standalone object used by {@link RecordRTC} to store recorded blobs in IndexedDB storage.
93
+ * @summary Writing blobs into IndexedDB.
94
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
95
+ * @author {@link https://MuazKhan.com|Muaz Khan}
96
+ * @example
97
+ * DiskStorage.Store({
98
+ * audioBlob: yourAudioBlob,
99
+ * videoBlob: yourVideoBlob,
100
+ * gifBlob : yourGifBlob
101
+ * });
102
+ * DiskStorage.Fetch(function(dataURL, type) {
103
+ * if(type === 'audioBlob') { }
104
+ * if(type === 'videoBlob') { }
105
+ * if(type === 'gifBlob') { }
106
+ * });
107
+ * // DiskStorage.dataStoreName = 'recordRTC';
108
+ * // DiskStorage.onError = function(error) { };
109
+ * @property {function} init - This method must be called once to initialize IndexedDB ObjectStore. Though, it is auto-used internally.
110
+ * @property {function} Fetch - This method fetches stored blobs from IndexedDB.
111
+ * @property {function} Store - This method stores blobs in IndexedDB.
112
+ * @property {function} onError - This function is invoked for any known/unknown error.
113
+ * @property {string} dataStoreName - Name of the ObjectStore created in IndexedDB storage.
114
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
115
+ */
116
+ /**
117
+ * GifRecorder is standalone calss used by {@link RecordRTC} to record video or canvas into animated gif.
118
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
119
+ * @author {@link https://MuazKhan.com|Muaz Khan}
120
+ * @typedef GifRecorder
121
+ * @class
122
+ * @example
123
+ * var recorder = new GifRecorder(mediaStream || canvas || context, { onGifPreview: function, onGifRecordingStarted: function, width: 1280, height: 720, frameRate: 200, quality: 10 });
124
+ * recorder.record();
125
+ * recorder.stop(function(blob) {
126
+ * img.src = URL.createObjectURL(blob);
127
+ * });
128
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
129
+ * @param {MediaStream} mediaStream - MediaStream object or HTMLCanvasElement or CanvasRenderingContext2D.
130
+ * @param {object} config - {disableLogs:true, initCallback: function, width: 320, height: 240, frameRate: 200, quality: 10}
131
+ */
132
+ /**
133
+ * MRecordRTC runs on top of {@link RecordRTC} to bring multiple recordings in a single place, by providing simple API.
134
+ * @summary MRecordRTC stands for "Multiple-RecordRTC".
135
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
136
+ * @author {@link https://MuazKhan.com|Muaz Khan}
137
+ * @typedef MRecordRTC
138
+ * @class
139
+ * @example
140
+ * var recorder = new MRecordRTC();
141
+ * recorder.addStream(MediaStream);
142
+ * recorder.mediaType = {
143
+ * audio: true, // or StereoAudioRecorder or MediaStreamRecorder
144
+ * video: true, // or WhammyRecorder or MediaStreamRecorder or WebAssemblyRecorder or CanvasRecorder
145
+ * gif: true // or GifRecorder
146
+ * };
147
+ * // mimeType is optional and should be set only in advance cases.
148
+ * recorder.mimeType = {
149
+ * audio: 'audio/wav',
150
+ * video: 'video/webm',
151
+ * gif: 'image/gif'
152
+ * };
153
+ * recorder.startRecording();
154
+ * @see For further information:
155
+ * @see {@link https://github.com/muaz-khan/RecordRTC/tree/master/MRecordRTC|MRecordRTC Source Code}
156
+ * @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
157
+ * @requires {@link RecordRTC}
158
+ */
159
+ /**
160
+ * MediaStreamRecorder is an abstraction layer for {@link https://w3c.github.io/mediacapture-record/MediaRecorder.html|MediaRecorder API}. It is used by {@link RecordRTC} to record MediaStream(s) in both Chrome and Firefox.
161
+ * @summary Runs top over {@link https://w3c.github.io/mediacapture-record/MediaRecorder.html|MediaRecorder API}.
162
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
163
+ * @author {@link https://github.com/muaz-khan|Muaz Khan}
164
+ * @typedef MediaStreamRecorder
165
+ * @class
166
+ * @example
167
+ * var config = {
168
+ * mimeType: 'video/webm', // vp8, vp9, h264, mkv, opus/vorbis
169
+ * audioBitsPerSecond : 256 * 8 * 1024,
170
+ * videoBitsPerSecond : 256 * 8 * 1024,
171
+ * bitsPerSecond: 256 * 8 * 1024, // if this is provided, skip above two
172
+ * checkForInactiveTracks: true,
173
+ * timeSlice: 1000, // concatenate intervals based blobs
174
+ * ondataavailable: function() {} // get intervals based blobs
175
+ * }
176
+ * var recorder = new MediaStreamRecorder(mediaStream, config);
177
+ * recorder.record();
178
+ * recorder.stop(function(blob) {
179
+ * video.src = URL.createObjectURL(blob);
180
+ *
181
+ * // or
182
+ * var blob = recorder.blob;
183
+ * });
184
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
185
+ * @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
186
+ * @param {object} config - {disableLogs:true, initCallback: function, mimeType: "video/webm", timeSlice: 1000}
187
+ * @throws Will throw an error if first argument "MediaStream" is missing. Also throws error if "MediaRecorder API" are not supported by the browser.
188
+ */
189
+ /**
190
+ * MultiStreamRecorder can record multiple videos in single container.
191
+ * @summary Multi-videos recorder.
192
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
193
+ * @author {@link https://MuazKhan.com|Muaz Khan}
194
+ * @typedef MultiStreamRecorder
195
+ * @class
196
+ * @example
197
+ * var options = {
198
+ * mimeType: 'video/webm'
199
+ * }
200
+ * var recorder = new MultiStreamRecorder(ArrayOfMediaStreams, options);
201
+ * recorder.record();
202
+ * recorder.stop(function(blob) {
203
+ * video.src = URL.createObjectURL(blob);
204
+ *
205
+ * // or
206
+ * var blob = recorder.blob;
207
+ * });
208
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
209
+ * @param {MediaStreams} mediaStreams - Array of MediaStreams.
210
+ * @param {object} config - {disableLogs:true, frameInterval: 1, mimeType: "video/webm"}
211
+ */
212
+ /**
213
+ * RecordRTCPromisesHandler adds promises support in {@link RecordRTC}. Try a {@link https://github.com/muaz-khan/RecordRTC/blob/master/simple-demos/RecordRTCPromisesHandler.html|demo here}
214
+ * @summary Promises for {@link RecordRTC}
215
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
216
+ * @author {@link https://MuazKhan.com|Muaz Khan}
217
+ * @typedef RecordRTCPromisesHandler
218
+ * @class
219
+ * @example
220
+ * var recorder = new RecordRTCPromisesHandler(mediaStream, options);
221
+ * recorder.startRecording()
222
+ * .then(successCB)
223
+ * .catch(errorCB);
224
+ * // Note: You can access all RecordRTC API using "recorder.recordRTC" e.g.
225
+ * recorder.recordRTC.onStateChanged = function(state) {};
226
+ * recorder.recordRTC.setRecordingDuration(5000);
227
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
228
+ * @param {MediaStream} mediaStream - Single media-stream object, array of media-streams, html-canvas-element, etc.
229
+ * @param {object} config - {type:"video", recorderType: MediaStreamRecorder, disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, video: HTMLVideoElement, etc.}
230
+ * @throws Will throw an error if "new" keyword is not used to initiate "RecordRTCPromisesHandler". Also throws error if first argument "MediaStream" is missing.
231
+ * @requires {@link RecordRTC}
232
+ */
233
+ /**
234
+ * StereoAudioRecorder is a standalone class used by {@link RecordRTC} to bring "stereo" audio-recording in chrome.
235
+ * @summary JavaScript standalone object for stereo audio recording.
236
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
237
+ * @author {@link https://MuazKhan.com|Muaz Khan}
238
+ * @typedef StereoAudioRecorder
239
+ * @class
240
+ * @example
241
+ * var recorder = new StereoAudioRecorder(MediaStream, {
242
+ * sampleRate: 44100,
243
+ * bufferSize: 4096
244
+ * });
245
+ * recorder.record();
246
+ * recorder.stop(function(blob) {
247
+ * video.src = URL.createObjectURL(blob);
248
+ * });
249
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
250
+ * @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
251
+ * @param {object} config - {sampleRate: 44100, bufferSize: 4096, numberOfAudioChannels: 1, etc.}
252
+ */
253
+ /**
254
+ * Storage is a standalone object used by {@link RecordRTC} to store reusable objects e.g. "new AudioContext".
255
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
256
+ * @author {@link https://MuazKhan.com|Muaz Khan}
257
+ * @example
258
+ * Storage.AudioContext === webkitAudioContext
259
+ * @property {webkitAudioContext} AudioContext - Keeps a reference to AudioContext object.
260
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
261
+ */
262
+ /**
263
+ * WebAssemblyRecorder lets you create webm videos in JavaScript via WebAssembly. The library consumes raw RGBA32 buffers (4 bytes per pixel) and turns them into a webm video with the given framerate and quality. This makes it compatible out-of-the-box with ImageData from a CANVAS. With realtime mode you can also use webm-wasm for streaming webm videos.
264
+ * @summary Video recording feature in Chrome, Firefox and maybe Edge.
265
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
266
+ * @author {@link https://MuazKhan.com|Muaz Khan}
267
+ * @typedef WebAssemblyRecorder
268
+ * @class
269
+ * @example
270
+ * var recorder = new WebAssemblyRecorder(mediaStream);
271
+ * recorder.record();
272
+ * recorder.stop(function(blob) {
273
+ * video.src = URL.createObjectURL(blob);
274
+ * });
275
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
276
+ * @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
277
+ * @param {object} config - {webAssemblyPath:'webm-wasm.wasm',workerPath: 'webm-worker.js', frameRate: 30, width: 1920, height: 1080, bitrate: 1024, realtime: true}
278
+ */
279
+ /**
280
+ * Whammy is a standalone class used by {@link RecordRTC} to bring video recording in Chrome. It is written by {@link https://github.com/antimatter15|antimatter15}
281
+ * @summary A real time javascript webm encoder based on a canvas hack.
282
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
283
+ * @author {@link https://MuazKhan.com|Muaz Khan}
284
+ * @typedef Whammy
285
+ * @class
286
+ * @example
287
+ * var recorder = new Whammy().Video(15);
288
+ * recorder.add(context || canvas || dataURL);
289
+ * var output = recorder.compile();
290
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
291
+ */
292
+ /**
293
+ * WhammyRecorder is a standalone class used by {@link RecordRTC} to bring video recording in Chrome. It runs top over {@link Whammy}.
294
+ * @summary Video recording feature in Chrome.
295
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
296
+ * @author {@link https://MuazKhan.com|Muaz Khan}
297
+ * @typedef WhammyRecorder
298
+ * @class
299
+ * @example
300
+ * var recorder = new WhammyRecorder(mediaStream);
301
+ * recorder.record();
302
+ * recorder.stop(function(blob) {
303
+ * video.src = URL.createObjectURL(blob);
304
+ * });
305
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
306
+ * @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
307
+ * @param {object} config - {disableLogs: true, initCallback: function, video: HTMLVideoElement, etc.}
308
+ */
309
+ /**
310
+ * {@link GetRecorderType} is an inner/private helper for {@link RecordRTC}.
311
+ * @summary It returns best recorder-type available for your browser.
312
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
313
+ * @author {@link https://MuazKhan.com|Muaz Khan}
314
+ * @typedef GetRecorderType
315
+ * @class
316
+ * @example
317
+ * var RecorderType = GetRecorderType(options);
318
+ * var recorder = new RecorderType(options);
319
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
320
+ * @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
321
+ * @param {object} config - {type:"video", disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, video: HTMLVideoElement, etc.}
322
+ */
323
+ /**
324
+ * {@link RecordRTCConfiguration} is an inner/private helper for {@link RecordRTC}.
325
+ * @summary It configures the 2nd parameter passed over {@link RecordRTC} and returns a valid "config" object.
326
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
327
+ * @author {@link https://MuazKhan.com|Muaz Khan}
328
+ * @typedef RecordRTCConfiguration
329
+ * @class
330
+ * @example
331
+ * var options = RecordRTCConfiguration(mediaStream, options);
332
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
333
+ * @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
334
+ * @param {object} config - {type:"video", disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, video: HTMLVideoElement, getNativeBlob:true, etc.}
335
+ */
336
+ /**
337
+ * {@link https://github.com/muaz-khan/RecordRTC|RecordRTC} is a WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.
338
+ * @summary Record audio, video or screen inside the browser.
339
+ * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
340
+ * @author {@link https://MuazKhan.com|Muaz Khan}
341
+ * @typedef RecordRTC
342
+ * @class
343
+ * @example
344
+ * var recorder = RecordRTC(mediaStream or [arrayOfMediaStream], {
345
+ * type: 'video', // audio or video or gif or canvas
346
+ * recorderType: MediaStreamRecorder || CanvasRecorder || StereoAudioRecorder || Etc
347
+ * });
348
+ * recorder.startRecording();
349
+ * @see For further information:
350
+ * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
351
+ * @param {MediaStream} mediaStream - Single media-stream object, array of media-streams, html-canvas-element, etc.
352
+ * @param {object} config - {type:"video", recorderType: MediaStreamRecorder, disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, desiredSampRate: 16000, video: HTMLVideoElement, etc.}
353
+ */