easyproctor-hml 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -6
- package/esm/index.js +10046 -9515
- package/index.js +25762 -25231
- package/new-flow/backend/BackendService.d.ts +2 -1
- package/new-flow/recorders/CameraRecorder.d.ts +12 -1
- package/new-flow/recorders/VolumeMeter.d.ts +4 -1
- package/package.json +2 -1
- package/proctoring/CapturePhoto.d.ts +16 -0
- package/proctoring/DeviceChecker.d.ts +16 -5
- package/proctoring/useProctoring.d.ts +2 -1
- package/unpkg/easyproctor.min.js +44 -19
package/unpkg/easyproctor.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";(()=>{var qd=Object.create;var z1=Object.defineProperty;var zd=Object.getOwnPropertyDescriptor;var jd=Object.getOwnPropertyNames;var Gd=Object.getPrototypeOf,Xd=Object.prototype.hasOwnProperty;var j1=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Kd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jd(e))!Xd.call(t,i)&&i!==r&&z1(t,i,{get:()=>e[i],enumerable:!(n=zd(e,i))||n.enumerable});return t};var Wd=(t,e,r)=>(r=t!=null?qd(Gd(t)):{},Kd(e||!t||!t.__esModule?z1(r,"default",{value:t,enumerable:!0}):r,t));var G1=j1((S0,x0)=>{"use strict";(function(t,e){typeof S0=="object"&&typeof x0<"u"?x0.exports=e():typeof define=="function"&&define.amd?define(e):t.MicRecorder=e()})(S0,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 o(C){if(C.length==1)return n(C[0]);var $=C[0];C=C.slice(1);for(var re=[],Z=0;Z<$;Z++)re.push(o(C));return re}function s(C){if(C.length==1)return r(C[0]);var $=C[0];C=C.slice(1);for(var re=[],Z=0;Z<$;Z++)re.push(s(C));return re}function d(C){if(C.length==1)return e(C[0]);var $=C[0];C=C.slice(1);for(var re=[],Z=0;Z<$;Z++)re.push(d(C));return re}function h(C){if(C.length==1)return new Array(C[0]);var $=C[0];C=C.slice(1);for(var re=[],Z=0;Z<$;Z++)re.push(h(C));return re}var p={};p.fill=function(C,$,re,Z){if(arguments.length==2)for(var ge=0;ge<C.length;ge++)C[ge]=arguments[1];else for(var ge=$;ge<re;ge++)C[ge]=Z};var O={};O.arraycopy=function(C,$,re,Z,ge){for(var Q=$+ge;$<Q;)re[Z++]=C[$++]};var G={};G.SQRT2=1.4142135623730951,G.FAST_LOG10=function(C){return Math.log10(C)},G.FAST_LOG10_X=function(C,$){return Math.log10(C)*$};function ie(C){this.ordinal=C}ie.short_block_allowed=new ie(0),ie.short_block_coupled=new ie(1),ie.short_block_dispensed=new ie(2),ie.short_block_forced=new ie(3);var oe={};oe.MAX_VALUE=34028235e31;function L(C){this.ordinal=C}L.vbr_off=new L(0),L.vbr_mt=new L(1),L.vbr_rh=new L(2),L.vbr_abr=new L(3),L.vbr_mtrh=new L(4),L.vbr_default=L.vbr_mtrh;var pe=function(C){},N={System:O,VbrMode:L,Float:oe,ShortBlock:ie,Util:G,Arrays:p,new_array_n:h,new_byte:t,new_double:i,new_float:n,new_float_n:o,new_int:r,new_int_n:s,new_short:e,new_short_n:d,assert:pe},le=N.System,ue=N.Util,Fe=N.Arrays,tt=N.new_float;function ct(){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*ue.SQRT2*.5/2384e-9,.017876148*ue.SQRT2*.5/2384e-9,.003134727*ue.SQRT2*.5/2384e-9,.002457142*ue.SQRT2*.5/2384e-9,971317e-9*ue.SQRT2*.5/2384e-9,218868e-9*ue.SQRT2*.5/2384e-9,101566e-9*ue.SQRT2*.5/2384e-9,13828e-9*ue.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],$=12,re=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]],ge=Z[T.SHORT_TYPE],Q=Z[T.SHORT_TYPE],ve=Z[T.SHORT_TYPE],Be=Z[T.SHORT_TYPE],De=[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 j(M,K,a){for(var I=10,H=K+238-14-286,D=-15;D<0;D++){var x,_,B;x=C[I+-10],_=M[H+-224]*x,B=M[K+224]*x,x=C[I+-9],_+=M[H+-160]*x,B+=M[K+160]*x,x=C[I+-8],_+=M[H+-96]*x,B+=M[K+96]*x,x=C[I+-7],_+=M[H+-32]*x,B+=M[K+32]*x,x=C[I+-6],_+=M[H+32]*x,B+=M[K+-32]*x,x=C[I+-5],_+=M[H+96]*x,B+=M[K+-96]*x,x=C[I+-4],_+=M[H+160]*x,B+=M[K+-160]*x,x=C[I+-3],_+=M[H+224]*x,B+=M[K+-224]*x,x=C[I+-2],_+=M[K+-256]*x,B-=M[H+256]*x,x=C[I+-1],_+=M[K+-192]*x,B-=M[H+192]*x,x=C[I+0],_+=M[K+-128]*x,B-=M[H+128]*x,x=C[I+1],_+=M[K+-64]*x,B-=M[H+64]*x,x=C[I+2],_+=M[K+0]*x,B-=M[H+0]*x,x=C[I+3],_+=M[K+64]*x,B-=M[H+-64]*x,x=C[I+4],_+=M[K+128]*x,B-=M[H+-128]*x,x=C[I+5],_+=M[K+192]*x,B-=M[H+-192]*x,_*=C[I+6],x=B-_,a[30+D*2]=B+_,a[31+D*2]=C[I+7]*x,I+=18,K--,H++}{var _,B,q,w;B=M[K+-16]*C[I+-10],_=M[K+-32]*C[I+-2],B+=(M[K+-48]-M[K+16])*C[I+-9],_+=M[K+-96]*C[I+-1],B+=(M[K+-80]+M[K+48])*C[I+-8],_+=M[K+-160]*C[I+0],B+=(M[K+-112]-M[K+80])*C[I+-7],_+=M[K+-224]*C[I+1],B+=(M[K+-144]+M[K+112])*C[I+-6],_-=M[K+32]*C[I+2],B+=(M[K+-176]-M[K+144])*C[I+-5],_-=M[K+96]*C[I+3],B+=(M[K+-208]+M[K+176])*C[I+-4],_-=M[K+160]*C[I+4],B+=(M[K+-240]-M[K+208])*C[I+-3],_-=M[K+224],q=_-B,w=_+B,B=a[14],_=a[15]-B,a[31]=w+B,a[30]=q+_,a[15]=q-_,a[14]=w-B}{var c;c=a[28]-a[0],a[0]+=a[28],a[28]=c*C[I+-2*18+7],c=a[29]-a[1],a[1]+=a[29],a[29]=c*C[I+-2*18+7],c=a[26]-a[2],a[2]+=a[26],a[26]=c*C[I+-4*18+7],c=a[27]-a[3],a[3]+=a[27],a[27]=c*C[I+-4*18+7],c=a[24]-a[4],a[4]+=a[24],a[24]=c*C[I+-6*18+7],c=a[25]-a[5],a[5]+=a[25],a[25]=c*C[I+-6*18+7],c=a[22]-a[6],a[6]+=a[22],a[22]=c*ue.SQRT2,c=a[23]-a[7],a[7]+=a[23],a[23]=c*ue.SQRT2-a[7],a[7]-=a[6],a[22]-=a[7],a[23]-=a[22],c=a[6],a[6]=a[31]-c,a[31]=a[31]+c,c=a[7],a[7]=a[30]-c,a[30]=a[30]+c,c=a[22],a[22]=a[15]-c,a[15]=a[15]+c,c=a[23],a[23]=a[14]-c,a[14]=a[14]+c,c=a[20]-a[8],a[8]+=a[20],a[20]=c*C[I+-10*18+7],c=a[21]-a[9],a[9]+=a[21],a[21]=c*C[I+-10*18+7],c=a[18]-a[10],a[10]+=a[18],a[18]=c*C[I+-12*18+7],c=a[19]-a[11],a[11]+=a[19],a[19]=c*C[I+-12*18+7],c=a[16]-a[12],a[12]+=a[16],a[16]=c*C[I+-14*18+7],c=a[17]-a[13],a[13]+=a[17],a[17]=c*C[I+-14*18+7],c=-a[20]+a[24],a[20]+=a[24],a[24]=c*C[I+-12*18+7],c=-a[21]+a[25],a[21]+=a[25],a[25]=c*C[I+-12*18+7],c=a[4]-a[8],a[4]+=a[8],a[8]=c*C[I+-12*18+7],c=a[5]-a[9],a[5]+=a[9],a[9]=c*C[I+-12*18+7],c=a[0]-a[12],a[0]+=a[12],a[12]=c*C[I+-4*18+7],c=a[1]-a[13],a[1]+=a[13],a[13]=c*C[I+-4*18+7],c=a[16]-a[28],a[16]+=a[28],a[28]=c*C[I+-4*18+7],c=-a[17]+a[29],a[17]+=a[29],a[29]=c*C[I+-4*18+7],c=ue.SQRT2*(a[2]-a[10]),a[2]+=a[10],a[10]=c,c=ue.SQRT2*(a[3]-a[11]),a[3]+=a[11],a[11]=c,c=ue.SQRT2*(-a[18]+a[26]),a[18]+=a[26],a[26]=c-a[18],c=ue.SQRT2*(-a[19]+a[27]),a[19]+=a[27],a[27]=c-a[19],c=a[2],a[19]-=a[3],a[3]-=c,a[2]=a[31]-c,a[31]+=c,c=a[3],a[11]-=a[19],a[18]-=c,a[3]=a[30]-c,a[30]+=c,c=a[18],a[27]-=a[11],a[19]-=c,a[18]=a[15]-c,a[15]+=c,c=a[19],a[10]-=c,a[19]=a[14]-c,a[14]+=c,c=a[10],a[11]-=c,a[10]=a[23]-c,a[23]+=c,c=a[11],a[26]-=c,a[11]=a[22]-c,a[22]+=c,c=a[26],a[27]-=c,a[26]=a[7]-c,a[7]+=c,c=a[27],a[27]=a[6]-c,a[6]+=c,c=ue.SQRT2*(a[0]-a[4]),a[0]+=a[4],a[4]=c,c=ue.SQRT2*(a[1]-a[5]),a[1]+=a[5],a[5]=c,c=ue.SQRT2*(a[16]-a[20]),a[16]+=a[20],a[20]=c,c=ue.SQRT2*(a[17]-a[21]),a[17]+=a[21],a[21]=c,c=-ue.SQRT2*(a[8]-a[12]),a[8]+=a[12],a[12]=c-a[8],c=-ue.SQRT2*(a[9]-a[13]),a[9]+=a[13],a[13]=c-a[9],c=-ue.SQRT2*(a[25]-a[29]),a[25]+=a[29],a[29]=c-a[25],c=-ue.SQRT2*(a[24]+a[28]),a[24]-=a[28],a[28]=c-a[24],c=a[24]-a[16],a[24]=c,c=a[20]-c,a[20]=c,c=a[28]-c,a[28]=c,c=a[25]-a[17],a[25]=c,c=a[21]-c,a[21]=c,c=a[29]-c,a[29]=c,c=a[17]-a[1],a[17]=c,c=a[9]-c,a[9]=c,c=a[25]-c,a[25]=c,c=a[5]-c,a[5]=c,c=a[21]-c,a[21]=c,c=a[13]-c,a[13]=c,c=a[29]-c,a[29]=c,c=a[1]-a[0],a[1]=c,c=a[16]-c,a[16]=c,c=a[17]-c,a[17]=c,c=a[8]-c,a[8]=c,c=a[9]-c,a[9]=c,c=a[24]-c,a[24]=c,c=a[25]-c,a[25]=c,c=a[4]-c,a[4]=c,c=a[5]-c,a[5]=c,c=a[20]-c,a[20]=c,c=a[21]-c,a[21]=c,c=a[12]-c,a[12]=c,c=a[13]-c,a[13]=c,c=a[28]-c,a[28]=c,c=a[29]-c,a[29]=c,c=a[0],a[0]+=a[31],a[31]-=c,c=a[1],a[1]+=a[30],a[30]-=c,c=a[16],a[16]+=a[15],a[15]-=c,c=a[17],a[17]+=a[14],a[14]-=c,c=a[8],a[8]+=a[23],a[23]-=c,c=a[9],a[9]+=a[22],a[22]-=c,c=a[24],a[24]+=a[7],a[7]-=c,c=a[25],a[25]+=a[6],a[6]-=c,c=a[4],a[4]+=a[27],a[27]-=c,c=a[5],a[5]+=a[26],a[26]-=c,c=a[20],a[20]+=a[11],a[11]-=c,c=a[21],a[21]+=a[10],a[10]-=c,c=a[12],a[12]+=a[19],a[19]-=c,c=a[13],a[13]+=a[18],a[18]-=c,c=a[28],a[28]+=a[3],a[3]-=c,c=a[29],a[29]+=a[2],a[2]-=c}}function fe(M,K){for(var a=0;a<3;a++){var I,H,D,x,_,B;x=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=x+I,D=x-I,x=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],_=x+I,B=-x+I,I=(M[K+1*3]*Z[T.SHORT_TYPE][1]-M[K+4*3])*2069978111953089e-26,x=(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+x,D=D*.8660254037844387*1907525191737281e-26,_=_*.5*1907525191737281e-26+x,M[K+3*1]=D-_,M[K+3*2]=D+_,H=H*.5*1907525191737281e-26-I,B=B*.8660254037844387*1907525191737281e-26,M[K+3*3]=H+B,M[K+3*4]=H-B,K++}}function he(M,K,a){var I,H;{var D,x,_,B,q,w,c,F;D=a[17]-a[9],_=a[15]-a[11],B=a[14]-a[12],q=a[0]+a[8],w=a[1]+a[7],c=a[2]+a[6],F=a[3]+a[5],M[K+17]=q+c-F-(w-a[4]),H=(q+c-F)*Q[12+7]+(w-a[4]),I=(D-_-B)*Q[12+6],M[K+5]=I+H,M[K+6]=I-H,x=(a[16]-a[10])*Q[12+6],w=w*Q[12+7]+a[4],I=D*Q[12+0]+x+_*Q[12+1]+B*Q[12+2],H=-q*Q[12+4]+w-c*Q[12+5]+F*Q[12+3],M[K+1]=I+H,M[K+2]=I-H,I=D*Q[12+1]-x-_*Q[12+2]+B*Q[12+0],H=-q*Q[12+5]+w-c*Q[12+3]+F*Q[12+4],M[K+9]=I+H,M[K+10]=I-H,I=D*Q[12+2]-x+_*Q[12+0]-B*Q[12+1],H=q*Q[12+3]-w+c*Q[12+4]-F*Q[12+5],M[K+13]=I+H,M[K+14]=I-H}{var y,u,v,b,l,m,g,E;y=a[8]-a[0],v=a[6]-a[2],b=a[5]-a[3],l=a[17]+a[9],m=a[16]+a[10],g=a[15]+a[11],E=a[14]+a[12],M[K+0]=l+g+E+(m+a[13]),I=(l+g+E)*Q[12+7]-(m+a[13]),H=(y-v+b)*Q[12+6],M[K+11]=I+H,M[K+12]=I-H,u=(a[7]-a[1])*Q[12+6],m=a[13]-m*Q[12+7],I=l*Q[12+3]-m+g*Q[12+4]+E*Q[12+5],H=y*Q[12+2]+u+v*Q[12+0]+b*Q[12+1],M[K+3]=I+H,M[K+4]=I-H,I=-l*Q[12+5]+m-g*Q[12+3]-E*Q[12+4],H=y*Q[12+1]+u-v*Q[12+2]-b*Q[12+0],M[K+7]=I+H,M[K+8]=I-H,I=-l*Q[12+4]+m-g*Q[12+5]-E*Q[12+3],H=y*Q[12+0]-u+v*Q[12+1]-b*Q[12+2],M[K+15]=I+H,M[K+16]=I-H}}this.mdct_sub48=function(M,K,a){for(var I=K,H=286,D=0;D<M.channels_out;D++){for(var x=0;x<M.mode_gr;x++){for(var _,B=M.l3_side.tt[x][D],q=B.xr,w=0,c=M.sb_sample[D][1-x],F=0,y=0;y<18/2;y++)for(j(I,H,c[F]),j(I,H+32,c[F+1]),F+=2,H+=64,_=1;_<32;_+=2)c[F-1][_]*=-1;for(_=0;_<32;_++,w+=18){var u=B.block_type,v=M.sb_sample[D][x],b=M.sb_sample[D][1-x];if(B.mixed_block_flag!=0&&_<2&&(u=0),M.amp_filter[_]<1e-12)Fe.fill(q,w+0,w+18,0);else{if(M.amp_filter[_]<1)for(var y=0;y<18;y++)b[y][De[_]]*=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]=v[9+y][De[_]]*l-v[8-y][De[_]],q[w+y*3+18]=v[14-y][De[_]]*l+v[15+y][De[_]],q[w+y*3+10]=v[15+y][De[_]]*l-v[14-y][De[_]],q[w+y*3+19]=b[2-y][De[_]]*l+b[3+y][De[_]],q[w+y*3+11]=b[3+y][De[_]]*l-b[2-y][De[_]],q[w+y*3+20]=b[8-y][De[_]]*l+b[9+y][De[_]]}fe(q,w)}else{for(var m=tt(18),y=-re/4;y<0;y++){var g,E;g=Z[u][y+27]*b[y+9][De[_]]+Z[u][y+36]*b[8-y][De[_]],E=Z[u][y+9]*v[y+9][De[_]]-Z[u][y+18]*v[8-y][De[_]],m[y+9]=g-E*ge[3+y+9],m[y+18]=g*ge[3+y+9]+E}he(q,w,m)}}if(u!=T.SHORT_TYPE&&_!=0)for(var y=7;y>=0;--y){var X,U;X=q[w+y]*ve[20+y]+q[w+-1-y]*Be[28+y],U=q[w+y]*Be[28+y]-q[w+-1-y]*ve[20+y],q[w+-1-y]=X,q[w+y]=U}}}if(I=a,H=286,M.mode_gr==1)for(var z=0;z<18;z++)le.arraycopy(M.sb_sample[D][1][z],0,M.sb_sample[D][0][z],0,32)}}}var _t=ct,st=N.System,yt=N.new_float,Xt=N.new_float_n;function er(){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 re=0;re<T.SBMAX_s;re++)for(var Z=0;Z<3;Z++)C.s[re][Z]=$.s[re][Z]}}var or=er;function an(){this.thm=new or,this.en=new or}var Tr=an,hr=N.System,xr=N.VbrMode,Yt=N.new_array_n,St=N.new_float,Ot=N.new_float_n,Nt=N.new_int,It=N.assert;Ze.ENCDELAY=576,Ze.POSTDELAY=1152,Ze.MDCTDELAY=48,Ze.FFTOFFSET=224+Ze.MDCTDELAY,Ze.DECDELAY=528,Ze.SBLIMIT=32,Ze.CBANDS=64,Ze.SBPSY_l=21,Ze.SBPSY_s=12,Ze.SBMAX_l=22,Ze.SBMAX_s=13,Ze.PSFB21=6,Ze.PSFB12=6,Ze.BLKSIZE=1024,Ze.HBLKSIZE=Ze.BLKSIZE/2+1,Ze.BLKSIZE_s=256,Ze.HBLKSIZE_s=Ze.BLKSIZE_s/2+1,Ze.NORM_TYPE=0,Ze.START_TYPE=1,Ze.SHORT_TYPE=2,Ze.STOP_TYPE=3,Ze.MPG_MD_LR_LR=0,Ze.MPG_MD_LR_I=1,Ze.MPG_MD_MS_LR=2,Ze.MPG_MD_MS_I=3,Ze.fircoef=[-.0207887*5,-.0378413*5,-.0432472*5,-.031183*5,779609e-23*5,.0467745*5,.10091*5,.151365*5,.187098*5];function Ze(){var C=_t,$=Tr,re=Ze.FFTOFFSET,Z=Ze.MPG_MD_MS_LR,ge=null;this.psy=null;var Q=null,ve=null,Be=null;this.setModules=function(M,K,a,I){ge=M,this.psy=K,Q=K,ve=I,Be=a};var De=new C;function j(M){var K,a;if(M.ATH.useAdjust==0){M.ATH.adjust=1;return}if(a=M.loudness_sq[0][0],K=M.loudness_sq[1][0],M.channels_out==2?(a+=M.loudness_sq[0][1],K+=M.loudness_sq[1][1]):(a+=a,K+=K),M.mode_gr==2&&(a=Math.max(a,K)),a*=.5,a*=M.ATH.aaSensitivityP,a>.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*a+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 fe(M){var K,a;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(a=0;a<M.channels_out;++a){var I=M.l3_side.tt[K][a].block_type|0;M.l3_side.tt[K][a].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 a=M.internal_flags,I,H;if(a.lame_encode_frame_init==0){var D,x,_=St(2014),B=St(286+1152+576);for(a.lame_encode_frame_init=1,D=0,x=0;D<286+576*(1+a.mode_gr);++D)D<576*a.mode_gr?(_[D]=0,a.channels_out==2&&(B[D]=0)):(_[D]=K[0][x],a.channels_out==2&&(B[D]=K[1][x]),++x);for(H=0;H<a.mode_gr;H++)for(I=0;I<a.channels_out;I++)a.l3_side.tt[H][I].block_type=Ze.SHORT_TYPE;De.mdct_sub48(a,_,B),It(576>=Ze.FFTOFFSET),It(a.mf_size>=Ze.BLKSIZE+M.framesize-Ze.FFTOFFSET),It(a.mf_size>=512+M.framesize-32)}}this.lame_encode_mp3_frame=function(M,K,a,I,H,D){var x,_=Yt([2,2]);_[0][0]=new $,_[0][1]=new $,_[1][0]=new $,_[1][1]=new $;var B=Yt([2,2]);B[0][0]=new $,B[0][1]=new $,B[1][0]=new $,B[1][1]=new $;var q,w=[null,null],c=M.internal_flags,F=Ot([2,4]),y=[.5,.5],u=[[0,0],[0,0]],v=[[0,0],[0,0]],b,l,m;if(w[0]=K,w[1]=a,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 g,E=[null,null],X=0,U=Nt(2);for(m=0;m<c.mode_gr;m++){for(l=0;l<c.channels_out;l++)E[l]=w[l],X=576+m*576-Ze.FFTOFFSET;if(M.VBR==xr.vbr_mtrh||M.VBR==xr.vbr_mt?g=Q.L3psycho_anal_vbr(M,E,X,m,_,B,u[m],v[m],F[m],U):g=Q.L3psycho_anal_ns(M,E,X,m,_,B,u[m],v[m],F[m],U),g!=0)return-4;for(M.mode==rr.JOINT_STEREO&&(y[m]=F[m][2]+F[m][3],y[m]>0&&(y[m]=F[m][3]/y[m])),l=0;l<c.channels_out;l++){var z=c.l3_side.tt[m][l];z.block_type=U[l],z.mixed_block_flag=0}}}else for(m=0;m<c.mode_gr;m++)for(l=0;l<c.channels_out;l++)c.l3_side.tt[m][l].block_type=Ze.NORM_TYPE,c.l3_side.tt[m][l].mixed_block_flag=0,v[m][l]=u[m][l]=700;if(j(c),De.mdct_sub48(c,w[0],w[1]),c.mode_ext=Ze.MPG_MD_LR_LR,M.force_ms)c.mode_ext=Ze.MPG_MD_MS_LR;else if(M.mode==rr.JOINT_STEREO){var Se=0,f=0;for(m=0;m<c.mode_gr;m++)for(l=0;l<c.channels_out;l++)Se+=v[m][l],f+=u[m][l];if(Se<=1*f){var S=c.l3_side.tt[0],ce=c.l3_side.tt[c.mode_gr-1];S[0].block_type==S[1].block_type&&ce[0].block_type==ce[1].block_type&&(c.mode_ext=Ze.MPG_MD_MS_LR)}}if(c.mode_ext==Z?(q=B,b=v):(q=_,b=u),M.analysis&&c.pinfo!=null)for(m=0;m<c.mode_gr;m++)for(l=0;l<c.channels_out;l++)c.pinfo.ms_ratio[m]=c.ms_ratio[m],c.pinfo.ms_ener_ratio[m]=y[m],c.pinfo.blocktype[m][l]=c.l3_side.tt[m][l].block_type,c.pinfo.pe[m][l]=b[m][l],hr.arraycopy(c.l3_side.tt[m][l].xr,0,c.pinfo.xr[m][l],0,576),c.mode_ext==Z&&(c.pinfo.ers[m][l]=c.pinfo.ers[m][l+2],hr.arraycopy(c.pinfo.energy[m][l+2],0,c.pinfo.energy[m][l],0,c.pinfo.energy[m][l].length));if(M.VBR==xr.vbr_off||M.VBR==xr.vbr_abr){var _e,Oe;for(_e=0;_e<18;_e++)c.nsPsy.pefirbuf[_e]=c.nsPsy.pefirbuf[_e+1];for(Oe=0,m=0;m<c.mode_gr;m++)for(l=0;l<c.channels_out;l++)Oe+=b[m][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])*Ze.fircoef[_e];for(Oe=670*5*c.mode_gr*c.channels_out/Oe,m=0;m<c.mode_gr;m++)for(l=0;l<c.channels_out;l++)b[m][l]*=Oe}if(c.iteration_loop.iteration_loop(M,b,y,q),ge.format_bitstream(M),x=ge.copy_buffer(c,I,H,D,1),M.bWriteVbrTag&&ve.addVbrFrame(M),M.analysis&&c.pinfo!=null){for(l=0;l<c.channels_out;l++){var Ue;for(Ue=0;Ue<re;Ue++)c.pinfo.pcmdata[l][Ue]=c.pinfo.pcmdata[l][Ue+M.framesize];for(Ue=re;Ue<1600;Ue++)c.pinfo.pcmdata[l][Ue]=w[l][Ue-re]}Be.set_frame_pinfo(M,q)}return fe(c),x}}var T=Ze,ae=N.Util,Le=N.new_float;function Ye(){var C=Le(T.BLKSIZE),$=Le(T.BLKSIZE_s/2),re=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function Z(Q,ve,Be){var De=0,j,fe,he;Be<<=1;var M=ve+Be;j=4;do{var K,a,I,H,D,x,_;_=j>>1,H=j,D=j<<1,x=D+H,j=D<<1,fe=ve,he=fe+_;do{var B,q,w,c;q=Q[fe+0]-Q[fe+H],B=Q[fe+0]+Q[fe+H],c=Q[fe+D]-Q[fe+x],w=Q[fe+D]+Q[fe+x],Q[fe+D]=B-w,Q[fe+0]=B+w,Q[fe+x]=q-c,Q[fe+H]=q+c,q=Q[he+0]-Q[he+H],B=Q[he+0]+Q[he+H],c=ae.SQRT2*Q[he+x],w=ae.SQRT2*Q[he+D],Q[he+D]=B-w,Q[he+0]=B+w,Q[he+x]=q-c,Q[he+H]=q+c,he+=j,fe+=j}while(fe<M);for(a=re[De+0],K=re[De+1],I=1;I<_;I++){var F,y;F=1-2*K*K,y=2*K*a,fe=ve+I,he=ve+H-I;do{var u,v,b,B,q,l,w,m,c,g;v=y*Q[fe+H]-F*Q[he+H],u=F*Q[fe+H]+y*Q[he+H],q=Q[fe+0]-u,B=Q[fe+0]+u,l=Q[he+0]-v,b=Q[he+0]+v,v=y*Q[fe+x]-F*Q[he+x],u=F*Q[fe+x]+y*Q[he+x],c=Q[fe+D]-u,w=Q[fe+D]+u,g=Q[he+D]-v,m=Q[he+D]+v,v=K*w-a*g,u=a*w+K*g,Q[fe+D]=B-u,Q[fe+0]=B+u,Q[he+x]=l-v,Q[he+H]=l+v,v=a*m-K*c,u=K*m+a*c,Q[he+D]=b-u,Q[he+0]=b+u,Q[fe+x]=q-v,Q[fe+H]=q+v,he+=j,fe+=j}while(fe<M);F=a,a=F*re[De+0]-K*re[De+1],K=F*re[De+1]+K*re[De+0]}De+=2}while(j<Be)}var ge=[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,ve,Be,De,j){for(var fe=0;fe<3;fe++){var he=T.BLKSIZE_s/2,M=65535&576/3*(fe+1),K=T.BLKSIZE_s/8-1;do{var a,I,H,D,x,_=ge[K<<2]&255;a=$[_]*De[Be][j+_+M],x=$[127-_]*De[Be][j+_+M+128],I=a-x,a=a+x,H=$[_+64]*De[Be][j+_+M+64],x=$[63-_]*De[Be][j+_+M+192],D=H-x,H=H+x,he-=4,ve[fe][he+0]=a+H,ve[fe][he+2]=a-H,ve[fe][he+1]=I+D,ve[fe][he+3]=I-D,a=$[_+1]*De[Be][j+_+M+1],x=$[126-_]*De[Be][j+_+M+129],I=a-x,a=a+x,H=$[_+65]*De[Be][j+_+M+65],x=$[62-_]*De[Be][j+_+M+193],D=H-x,H=H+x,ve[fe][he+T.BLKSIZE_s/2+0]=a+H,ve[fe][he+T.BLKSIZE_s/2+2]=a-H,ve[fe][he+T.BLKSIZE_s/2+1]=I+D,ve[fe][he+T.BLKSIZE_s/2+3]=I-D}while(--K>=0);Z(ve[fe],he,T.BLKSIZE_s/2)}},this.fft_long=function(Q,ve,Be,De,j){var fe=T.BLKSIZE/8-1,he=T.BLKSIZE/2;do{var M,K,a,I,H,D=ge[fe]&255;M=C[D]*De[Be][j+D],H=C[D+512]*De[Be][j+D+512],K=M-H,M=M+H,a=C[D+256]*De[Be][j+D+256],H=C[D+768]*De[Be][j+D+768],I=a-H,a=a+H,he-=4,ve[he+0]=M+a,ve[he+2]=M-a,ve[he+1]=K+I,ve[he+3]=K-I,M=C[D+1]*De[Be][j+D+1],H=C[D+513]*De[Be][j+D+513],K=M-H,M=M+H,a=C[D+257]*De[Be][j+D+257],H=C[D+769]*De[Be][j+D+769],I=a-H,a=a+H,ve[he+T.BLKSIZE/2+0]=M+a,ve[he+T.BLKSIZE/2+2]=M-a,ve[he+T.BLKSIZE/2+1]=K+I,ve[he+T.BLKSIZE/2+3]=K-I}while(--fe>=0);Z(ve,he,T.BLKSIZE/2)},this.init_fft=function(Q){for(var ve=0;ve<T.BLKSIZE;ve++)C[ve]=.42-.5*Math.cos(2*Math.PI*(ve+.5)/T.BLKSIZE)+.08*Math.cos(4*Math.PI*(ve+.5)/T.BLKSIZE);for(var ve=0;ve<T.BLKSIZE_s/2;ve++)$[ve]=.5*(1-Math.cos(2*Math.PI*(ve+.5)/T.BLKSIZE_s))}}var ne=Ye,be=N.VbrMode,Ae=N.Float,Ie=N.ShortBlock,Pe=N.Util,We=N.Arrays,ke=N.new_float,ot=N.new_float_n,vt=N.new_int,ye=N.assert;function br(){var C=new ne,$=2.302585092994046,re=2,Z=16,ge=2,Q=16,ve=.34,Be=1/(14752*14752)/(T.BLKSIZE/2),De=.01,j=.8,fe=.6,he=.3,M=3.5,K=4.4,a=25,I=21,H=.2302585093;function D(R){return R}function x(R,A){for(var k=0,V=0;V<T.BLKSIZE/2;++V)k+=R[V]*A.ATH.eql_w[V];return k*=Be,k}function _(R,A,k,V,J,P,Y,ee,W,de,te){var me=R.internal_flags;if(W<2)C.fft_long(me,V[J],W,de,te),C.fft_short(me,P[Y],W,de,te);else if(W==2){for(var He=T.BLKSIZE-1;He>=0;--He){var rt=V[J+0][He],we=V[J+1][He];V[J+0][He]=(rt+we)*Pe.SQRT2*.5,V[J+1][He]=(rt-we)*Pe.SQRT2*.5}for(var $e=2;$e>=0;--$e)for(var He=T.BLKSIZE_s-1;He>=0;--He){var rt=P[Y+0][$e][He],we=P[Y+1][$e][He];P[Y+0][$e][He]=(rt+we)*Pe.SQRT2*.5,P[Y+1][$e][He]=(rt-we)*Pe.SQRT2*.5}}A[0]=V[J+0][0],A[0]*=A[0];for(var He=T.BLKSIZE/2-1;He>=0;--He){var se=V[J+0][T.BLKSIZE/2-He],Ge=V[J+0][T.BLKSIZE/2+He];A[T.BLKSIZE/2-He]=(se*se+Ge*Ge)*.5}for(var $e=2;$e>=0;--$e){k[$e][0]=P[Y+0][$e][0],k[$e][0]*=k[$e][0];for(var He=T.BLKSIZE_s/2-1;He>=0;--He){var se=P[Y+0][$e][T.BLKSIZE_s/2-He],Ge=P[Y+0][$e][T.BLKSIZE_s/2+He];k[$e][T.BLKSIZE_s/2-He]=(se*se+Ge*Ge)*.5}}{for(var dt=0,He=11;He<T.HBLKSIZE;He++)dt+=A[He];me.tot_ener[W]=dt}if(R.analysis){for(var He=0;He<T.HBLKSIZE;He++)me.pinfo.energy[ee][W][He]=me.pinfo.energy_save[W][He],me.pinfo.energy_save[W][He]=A[He];me.pinfo.pe[ee][W]=me.pe[W]}R.athaa_loudapprox==2&&W<2&&(me.loudness_sq[ee][W]=me.loudness_sq_save[W],me.loudness_sq_save[W]=x(A,me))}var B=8,q=23,w=15,c,F,y,u=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749];function v(){c=Math.pow(10,(B+1)/16),F=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],m=[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 g(R,A,k,V,J,P){var Y;if(A>R)if(A<R*F)Y=A/R;else return R+A;else{if(R>=A*F)return R+A;Y=R/A}if(ye(R>=0),ye(A>=0),R+=A,V+3<=3+3){if(Y>=c)return R;var ee=0|Pe.FAST_LOG10_X(Y,16);return R*l[ee]}var ee=0|Pe.FAST_LOG10_X(Y,16);if(P!=0?A=J.ATH.cb_s[k]*J.ATH.adjust:A=J.ATH.cb_l[k]*J.ATH.adjust,ye(A>=0),R<y*A){if(R>A){var W,de;return W=1,ee<=13&&(W=m[ee]),de=Pe.FAST_LOG10_X(R/A,10/15),R*((b[ee]-W)*de+W)}return ee>13?R:R*m[ee]}return R*b[ee]}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,k){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<=k&&k<=2){if(V>=c)return R+A;var J=0|Pe.FAST_LOG10_X(V,16);return(R+A)*E[J]}return V<F?R+A:(R<A&&(R=A),R)}function U(R,A){var k=R.internal_flags;if(k.channels_out>1){for(var V=0;V<T.SBMAX_l;V++){var J=k.thm[0].l[V],P=k.thm[1].l[V];k.thm[0].l[V]+=P*A,k.thm[1].l[V]+=J*A}for(var V=0;V<T.SBMAX_s;V++)for(var Y=0;Y<3;Y++){var J=k.thm[0].s[V][Y],P=k.thm[1].s[V][Y];k.thm[0].s[V][Y]+=P*A,k.thm[1].s[V][Y]+=J*A}}}function z(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 k=R.mld_l[A]*R.en[3].l[A],V=Math.max(R.thm[2].l[A],Math.min(R.thm[3].l[A],k));k=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],k));R.thm[2].l[A]=V,R.thm[3].l[A]=J}for(var A=0;A<T.SBMAX_s;A++)for(var P=0;P<3;P++)if(!(R.thm[0].s[A][P]>1.58*R.thm[1].s[A][P]||R.thm[1].s[A][P]>1.58*R.thm[0].s[A][P])){var k=R.mld_s[A]*R.en[3].s[A][P],V=Math.max(R.thm[2].s[A][P],Math.min(R.thm[3].s[A][P],k));k=R.mld_s[A]*R.en[2].s[A][P];var J=Math.max(R.thm[3].s[A][P],Math.min(R.thm[2].s[A][P],k));R.thm[2].s[A][P]=V,R.thm[3].s[A][P]=J}}function Se(R,A,k){var V=A,J=Math.pow(10,k);A*=2,V*=2;for(var P=0;P<T.SBMAX_l;P++){var Y,ee,W,de;if(de=R.ATH.cb_l[R.bm_l[P]]*J,Y=Math.min(Math.max(R.thm[0].l[P],de),Math.max(R.thm[1].l[P],de)),ee=Math.max(R.thm[2].l[P],de),W=Math.max(R.thm[3].l[P],de),Y*A<ee+W){var te=Y*V/(ee+W);ee*=te,W*=te,ye(ee+W>0)}R.thm[2].l[P]=Math.min(ee,R.thm[2].l[P]),R.thm[3].l[P]=Math.min(W,R.thm[3].l[P])}J*=T.BLKSIZE_s/T.BLKSIZE;for(var P=0;P<T.SBMAX_s;P++)for(var me=0;me<3;me++){var Y,ee,W,de;if(de=R.ATH.cb_s[R.bm_s[P]]*J,Y=Math.min(Math.max(R.thm[0].s[P][me],de),Math.max(R.thm[1].s[P][me],de)),ee=Math.max(R.thm[2].s[P][me],de),W=Math.max(R.thm[3].s[P][me],de),Y*A<ee+W){var te=Y*A/(ee+W);ee*=te,W*=te,ye(ee+W>0)}R.thm[2].s[P][me]=Math.min(R.thm[2].s[P][me],ee),R.thm[3].s[P][me]=Math.min(R.thm[3].s[P][me],W)}}function f(R,A,k,V,J){var P,Y,ee=0,W=0;for(P=Y=0;P<T.SBMAX_s;++Y,++P){for(var de=R.bo_s[P],te=R.npart_s,me=de<te?de:te;Y<me;)ye(A[Y]>=0),ye(k[Y]>=0),ee+=A[Y],W+=k[Y],Y++;if(R.en[V].s[P][J]=ee,R.thm[V].s[P][J]=W,Y>=te){++P;break}ye(A[Y]>=0),ye(k[Y]>=0);{var He=R.PSY.bo_s_weight[P],rt=1-He;ee=He*A[Y],W=He*k[Y],R.en[V].s[P][J]+=ee,R.thm[V].s[P][J]+=W,ee=rt*A[Y],W=rt*k[Y]}}for(;P<T.SBMAX_s;++P)R.en[V].s[P][J]=0,R.thm[V].s[P][J]=0}function S(R,A,k,V){var J,P,Y=0,ee=0;for(J=P=0;J<T.SBMAX_l;++P,++J){for(var W=R.bo_l[J],de=R.npart_l,te=W<de?W:de;P<te;)ye(A[P]>=0),ye(k[P]>=0),Y+=A[P],ee+=k[P],P++;if(R.en[V].l[J]=Y,R.thm[V].l[J]=ee,P>=de){++J;break}ye(A[P]>=0),ye(k[P]>=0);{var me=R.PSY.bo_l_weight[J],He=1-me;Y=me*A[P],ee=me*k[P],R.en[V].l[J]+=Y,R.thm[V].l[J]+=ee,Y=He*A[P],ee=He*k[P]}}for(;J<T.SBMAX_l;++J)R.en[V].l[J]=0,R.thm[V].l[J]=0}function ce(R,A,k,V,J,P){var Y=R.internal_flags,ee,W;for(W=ee=0;W<Y.npart_s;++W){for(var de=0,te=0,me=Y.numlines_s[W],He=0;He<me;++He,++ee){var rt=A[P][ee];de+=rt,te<rt&&(te=rt)}k[W]=de}for(ye(W==Y.npart_s),ye(ee==129),ee=W=0;W<Y.npart_s;W++){var we=Y.s3ind_s[W][0],$e=Y.s3_ss[ee++]*k[we];for(++we;we<=Y.s3ind_s[W][1];)$e+=Y.s3_ss[ee]*k[we],++ee,++we;{var se=ge*Y.nb_s1[J][W];V[W]=Math.min($e,se)}if(Y.blocktype_old[J&1]==T.SHORT_TYPE){var se=Q*Y.nb_s2[J][W],Ge=V[W];V[W]=Math.min(se,Ge)}Y.nb_s2[J][W]=Y.nb_s1[J][W],Y.nb_s1[J][W]=$e,ye(V[W]>=0)}for(;W<=T.CBANDS;++W)k[W]=0,V[W]=0}function _e(R,A,k,V){var J=R.internal_flags;R.short_blocks==Ie.short_block_coupled&&!(A[0]!=0&&A[1]!=0)&&(A[0]=A[1]=0);for(var P=0;P<J.channels_out;P++)V[P]=T.NORM_TYPE,R.short_blocks==Ie.short_block_dispensed&&(A[P]=1),R.short_blocks==Ie.short_block_forced&&(A[P]=0),A[P]!=0?(ye(J.blocktype_old[P]!=T.START_TYPE),J.blocktype_old[P]==T.SHORT_TYPE&&(V[P]=T.STOP_TYPE)):(V[P]=T.SHORT_TYPE,J.blocktype_old[P]==T.NORM_TYPE&&(J.blocktype_old[P]=T.START_TYPE),J.blocktype_old[P]==T.STOP_TYPE&&(J.blocktype_old[P]=T.SHORT_TYPE)),k[P]=J.blocktype_old[P],J.blocktype_old[P]=V[P]}function Oe(R,A,k){return k>=1?R:k<=0?A:A>0?Math.pow(R/A,k)*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 k=309.07,V=0;V<T.SBMAX_s-1;V++)for(var J=0;J<3;J++){var P=R.thm.s[V][J];if(ye(V<Ue.length),P>0){var Y=P*A,ee=R.en.s[V][J];ee>Y&&(ee>Y*1e10?k+=Ue[V]*(10*$):(ye(Y>0),k+=Ue[V]*Pe.FAST_LOG10(ee/Y)))}}return k}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 k=281.0575,V=0;V<T.SBMAX_l-1;V++){var J=R.thm.l[V];if(ye(V<ze.length),J>0){var P=J*A,Y=R.en.l[V];Y>P&&(Y>P*1e10?k+=ze[V]*(10*$):(ye(P>0),k+=ze[V]*Pe.FAST_LOG10(Y/P)))}}return k}function Xe(R,A,k,V,J){var P,Y;for(P=Y=0;P<R.npart_l;++P){var ee=0,W=0,de;for(de=0;de<R.numlines_l[P];++de,++Y){var te=A[Y];ye(te>=0),ee+=te,W<te&&(W=te)}k[P]=ee,V[P]=W,J[P]=ee*R.rnumlines_l[P],ye(R.rnumlines_l[P]>=0),ye(ee>=0),ye(k[P]>=0),ye(V[P]>=0),ye(J[P]>=0)}}function Ve(R,A,k,V){var J=u.length-1,P=0,Y=k[P]+k[P+1];if(ye(Y>=0),Y>0){var ee=A[P];ee<A[P+1]&&(ee=A[P+1]),ye(R.numlines_l[P]+R.numlines_l[P+1]-1>0),Y=20*(ee*2-Y)/(Y*(R.numlines_l[P]+R.numlines_l[P+1]-1));var W=0|Y;W>J&&(W=J),V[P]=W}else V[P]=0;for(P=1;P<R.npart_l-1;P++)if(Y=k[P-1]+k[P]+k[P+1],ye(Y>=0),Y>0){var ee=A[P-1];ee<A[P]&&(ee=A[P]),ee<A[P+1]&&(ee=A[P+1]),ye(R.numlines_l[P-1]+R.numlines_l[P]+R.numlines_l[P+1]-1>0),Y=20*(ee*3-Y)/(Y*(R.numlines_l[P-1]+R.numlines_l[P]+R.numlines_l[P+1]-1));var W=0|Y;W>J&&(W=J),V[P]=W}else V[P]=0;if(ye(P>0),ye(P==R.npart_l-1),Y=k[P-1]+k[P],ye(Y>=0),Y>0){var ee=A[P-1];ee<A[P]&&(ee=A[P]),ye(R.numlines_l[P-1]+R.numlines_l[P]-1>0),Y=20*(ee*2-Y)/(Y*(R.numlines_l[P-1]+R.numlines_l[P]-1));var W=0|Y;W>J&&(W=J),V[P]=W}else V[P]=0;ye(P==R.npart_l-1)}var gt=[-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,k,V,J,P,Y,ee,W,de){var te=R.internal_flags,me=ot([2,T.BLKSIZE]),He=ot([2,3,T.BLKSIZE_s]),rt=ke(T.CBANDS+1),we=ke(T.CBANDS+1),$e=ke(T.CBANDS+2),se=vt(2),Ge=vt(2),dt,Te,Ke,Re,Qe,kt,qe,lt,mt=ot([2,576]),Vt,Xr=vt(T.CBANDS+2),$t=vt(T.CBANDS+2);for(We.fill($t,0),dt=te.channels_out,R.mode==rr.JOINT_STEREO&&(dt=4),R.VBR==be.vbr_off?Vt=te.ResvMax==0?0:te.ResvSize/te.ResvMax*.5:R.VBR==be.vbr_rh||R.VBR==be.vbr_mtrh||R.VBR==be.vbr_mt?Vt=.6:Vt=1,Te=0;Te<te.channels_out;Te++){var Ht=A[Te],Ur=k+576-350-I+192;for(ye(gt.length==(I-1)/2),Re=0;Re<576;Re++){var Kr,Wr;for(Kr=Ht[Ur+Re+10],Wr=0,Qe=0;Qe<(I-1)/2-1;Qe+=2)Kr+=gt[Qe]*(Ht[Ur+Re+Qe]+Ht[Ur+Re+I-Qe]),Wr+=gt[Qe+1]*(Ht[Ur+Re+Qe+1]+Ht[Ur+Re+I-Qe-1]);mt[Te][Re]=Kr+Wr}J[V][Te].en.assign(te.en[Te]),J[V][Te].thm.assign(te.thm[Te]),dt>2&&(P[V][Te].en.assign(te.en[Te+2]),P[V][Te].thm.assign(te.thm[Te+2]))}for(Te=0;Te<dt;Te++){var xn,bn,Er=ke(12),Ln=[0,0,0,0],ra=ke(12),u0=1,L1,k1=ke(T.CBANDS),U1=ke(T.CBANDS),qt=[0,0,0,0],H1=ke(T.HBLKSIZE),V1=ot([3,T.HBLKSIZE_s]);for(ye(te.npart_s<=T.CBANDS),ye(te.npart_l<=T.CBANDS),Re=0;Re<3;Re++)Er[Re]=te.nsPsy.last_en_subshort[Te][Re+6],ye(te.nsPsy.last_en_subshort[Te][Re+4]>0),ra[Re]=Er[Re]/te.nsPsy.last_en_subshort[Te][Re+4],Ln[0]+=Er[Re];if(Te==2)for(Re=0;Re<576;Re++){var f0,d0;f0=mt[0][Re],d0=mt[1][Re],mt[0][Re]=f0+d0,mt[1][Re]=f0-d0}{var q1=mt[Te&1],Ka=0;for(Re=0;Re<9;Re++){for(var Vd=Ka+64,sr=1;Ka<Vd;Ka++)sr<Math.abs(q1[Ka])&&(sr=Math.abs(q1[Ka]));te.nsPsy.last_en_subshort[Te][Re]=Er[Re+3]=sr,Ln[1+Re/3]+=sr,sr>Er[Re+3-2]?(ye(Er[Re+3-2]>0),sr=sr/Er[Re+3-2]):Er[Re+3-2]>sr*10?(ye(sr>0),sr=Er[Re+3-2]/(sr*10)):sr=0,ra[Re+3]=sr}}if(R.analysis){var v0=ra[0];for(Re=1;Re<12;Re++)v0<ra[Re]&&(v0=ra[Re]);te.pinfo.ers[V][Te]=te.pinfo.ers_save[Te],te.pinfo.ers_save[Te]=v0}for(L1=Te==3?te.nsPsy.attackthre_s:te.nsPsy.attackthre,Re=0;Re<12;Re++)qt[Re/3]==0&&ra[Re]>L1&&(qt[Re/3]=Re%3+1);for(Re=1;Re<4;Re++){var m0;Ln[Re-1]>Ln[Re]?(ye(Ln[Re]>0),m0=Ln[Re-1]/Ln[Re]):(ye(Ln[Re-1]>0),m0=Ln[Re]/Ln[Re-1]),m0<1.7&&(qt[Re]=0,Re==1&&(qt[0]=0))}for(qt[0]!=0&&te.nsPsy.lastAttacks[Te]!=0&&(qt[0]=0),(te.nsPsy.lastAttacks[Te]==3||qt[0]+qt[1]+qt[2]+qt[3]!=0)&&(u0=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)),Te<2?Ge[Te]=u0:u0==0&&(Ge[0]=Ge[1]=0),W[Te]=te.tot_ener[Te],bn=He,xn=me,_(R,H1,V1,xn,Te&1,bn,Te&1,V,Te,A,k),Xe(te,H1,rt,k1,U1),Ve(te,k1,U1,Xr),lt=0;lt<3;lt++){var h0,Hr;for(ce(R,V1,we,$e,Te,lt),f(te,we,$e,Te,lt),qe=0;qe<T.SBMAX_s;qe++){if(Hr=te.thm[Te].s[qe][lt],Hr*=j,qt[lt]>=2||qt[lt+1]==1){var Wa=lt!=0?lt-1:2,sr=Oe(te.thm[Te].s[qe][Wa],Hr,fe*Vt);Hr=Math.min(Hr,sr)}if(qt[lt]==1){var Wa=lt!=0?lt-1:2,sr=Oe(te.thm[Te].s[qe][Wa],Hr,he*Vt);Hr=Math.min(Hr,sr)}else if(lt!=0&&qt[lt-1]==3||lt==0&&te.nsPsy.lastAttacks[Te]==3){var Wa=lt!=2?lt+1:0,sr=Oe(te.thm[Te].s[qe][Wa],Hr,he*Vt);Hr=Math.min(Hr,sr)}h0=Er[lt*3+3]+Er[lt*3+4]+Er[lt*3+5],Er[lt*3+5]*6<h0&&(Hr*=.5,Er[lt*3+4]*6<h0&&(Hr*=.5)),te.thm[Te].s[qe][lt]=Hr}}for(te.nsPsy.lastAttacks[Te]=qt[2],kt=0,Ke=0;Ke<te.npart_l;Ke++){for(var Ii=te.s3ind[Ke][0],p0=rt[Ii]*u[Xr[Ii]],Ci=te.s3_ll[kt++]*p0;++Ii<=te.s3ind[Ke][1];)p0=rt[Ii]*u[Xr[Ii]],Ci=g(Ci,te.s3_ll[kt++]*p0,Ii,Ii-Ke,te,0);Ci*=.158489319246111,te.blocktype_old[Te&1]==T.SHORT_TYPE?$e[Ke]=Ci:$e[Ke]=Oe(Math.min(Ci,Math.min(re*te.nb_1[Te][Ke],Z*te.nb_2[Te][Ke])),Ci,Vt),te.nb_2[Te][Ke]=te.nb_1[Te][Ke],te.nb_1[Te][Ke]=Ci}for(;Ke<=T.CBANDS;++Ke)rt[Ke]=0,$e[Ke]=0;S(te,rt,$e,Te)}if((R.mode==rr.STEREO||R.mode==rr.JOINT_STEREO)&&R.interChRatio>0&&U(R,R.interChRatio),R.mode==rr.JOINT_STEREO){var _0;z(te),_0=R.msfix,Math.abs(_0)>0&&Se(te,_0,R.ATHlower*te.ATH.adjust)}for(_e(R,Ge,de,se),Te=0;Te<dt;Te++){var Ya,$a=0,zo,jo;Te>1?(Ya=ee,$a=-2,zo=T.NORM_TYPE,(de[0]==T.SHORT_TYPE||de[1]==T.SHORT_TYPE)&&(zo=T.SHORT_TYPE),jo=P[V][Te-2]):(Ya=Y,$a=0,zo=de[Te],jo=J[V][Te]),zo==T.SHORT_TYPE?Ya[$a+Te]=je(jo,te.masking_lower):Ya[$a+Te]=nt(jo,te.masking_lower),R.analysis&&(te.pinfo.pe[V][Te]=Ya[$a+Te])}return 0};function Ft(R,A,k,V,J,P,Y,ee){var W=R.internal_flags;if(V<2)C.fft_long(W,Y[ee],V,A,k);else if(V==2)for(var de=T.BLKSIZE-1;de>=0;--de){var te=Y[ee+0][de],me=Y[ee+1][de];Y[ee+0][de]=(te+me)*Pe.SQRT2*.5,Y[ee+1][de]=(te-me)*Pe.SQRT2*.5}P[0]=Y[ee+0][0],P[0]*=P[0];for(var de=T.BLKSIZE/2-1;de>=0;--de){var He=Y[ee+0][T.BLKSIZE/2-de],rt=Y[ee+0][T.BLKSIZE/2+de];P[T.BLKSIZE/2-de]=(He*He+rt*rt)*.5}{for(var we=0,de=11;de<T.HBLKSIZE;de++)we+=P[de];W.tot_ener[V]=we}if(R.analysis){for(var de=0;de<T.HBLKSIZE;de++)W.pinfo.energy[J][V][de]=W.pinfo.energy_save[V][de],W.pinfo.energy_save[V][de]=P[de];W.pinfo.pe[J][V]=W.pe[V]}}function Rt(R,A,k,V,J,P,Y,ee){var W=R.internal_flags;if(J==0&&V<2&&C.fft_short(W,Y[ee],V,A,k),V==2)for(var de=T.BLKSIZE_s-1;de>=0;--de){var te=Y[ee+0][J][de],me=Y[ee+1][J][de];Y[ee+0][J][de]=(te+me)*Pe.SQRT2*.5,Y[ee+1][J][de]=(te-me)*Pe.SQRT2*.5}P[J][0]=Y[ee+0][J][0],P[J][0]*=P[J][0];for(var de=T.BLKSIZE_s/2-1;de>=0;--de){var He=Y[ee+0][J][T.BLKSIZE_s/2-de],rt=Y[ee+0][J][T.BLKSIZE_s/2+de];P[J][T.BLKSIZE_s/2-de]=(He*He+rt*rt)*.5}}function Lt(R,A,k,V){var J=R.internal_flags;R.athaa_loudapprox==2&&k<2&&(J.loudness_sq[A][k]=J.loudness_sq_save[k],J.loudness_sq_save[k]=x(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,k,V,J,P,Y,ee,W,de){for(var te=ot([2,576]),me=R.internal_flags,He=me.channels_out,rt=R.mode==rr.JOINT_STEREO?4:He,we=0;we<He;we++){firbuf=A[we];var $e=k+576-350-I+192;ye(jt.length==(I-1)/2);for(var se=0;se<576;se++){var Ge,dt;Ge=firbuf[$e+se+10],dt=0;for(var Te=0;Te<(I-1)/2-1;Te+=2)Ge+=jt[Te]*(firbuf[$e+se+Te]+firbuf[$e+se+I-Te]),dt+=jt[Te+1]*(firbuf[$e+se+Te+1]+firbuf[$e+se+I-Te-1]);te[we][se]=Ge+dt}J[V][we].en.assign(me.en[we]),J[V][we].thm.assign(me.thm[we]),rt>2&&(P[V][we].en.assign(me.en[we+2]),P[V][we].thm.assign(me.thm[we+2]))}for(var we=0;we<rt;we++){var Ke=ke(12),Re=ke(12),Qe=[0,0,0,0],kt=te[we&1],qe=0,lt=we==3?me.nsPsy.attackthre_s:me.nsPsy.attackthre,mt=1;if(we==2)for(var se=0,Te=576;Te>0;++se,--Te){var Vt=te[0][se],Xr=te[1][se];te[0][se]=Vt+Xr,te[1][se]=Vt-Xr}for(var se=0;se<3;se++)Re[se]=me.nsPsy.last_en_subshort[we][se+6],ye(me.nsPsy.last_en_subshort[we][se+4]>0),Ke[se]=Re[se]/me.nsPsy.last_en_subshort[we][se+4],Qe[0]+=Re[se];for(var se=0;se<9;se++){for(var $t=qe+64,Ht=1;qe<$t;qe++)Ht<Math.abs(kt[qe])&&(Ht=Math.abs(kt[qe]));me.nsPsy.last_en_subshort[we][se]=Re[se+3]=Ht,Qe[1+se/3]+=Ht,Ht>Re[se+3-2]?(ye(Re[se+3-2]>0),Ht=Ht/Re[se+3-2]):Re[se+3-2]>Ht*10?(ye(Ht>0),Ht=Re[se+3-2]/(Ht*10)):Ht=0,Ke[se+3]=Ht}for(var se=0;se<3;++se){var Ur=Re[se*3+3]+Re[se*3+4]+Re[se*3+5],Kr=1;Re[se*3+5]*6<Ur&&(Kr*=.5,Re[se*3+4]*6<Ur&&(Kr*=.5)),ee[we][se]=Kr}if(R.analysis){for(var Wr=Ke[0],se=1;se<12;se++)Wr<Ke[se]&&(Wr=Ke[se]);me.pinfo.ers[V][we]=me.pinfo.ers_save[we],me.pinfo.ers_save[we]=Wr}for(var se=0;se<12;se++)W[we][se/3]==0&&Ke[se]>lt&&(W[we][se/3]=se%3+1);for(var se=1;se<4;se++){var xn=Qe[se-1],bn=Qe[se],Er=Math.max(xn,bn);Er<4e4&&xn<1.7*bn&&bn<1.7*xn&&(se==1&&W[we][0]<=W[we][se]&&(W[we][0]=0),W[we][se]=0)}W[we][0]<=me.nsPsy.lastAttacks[we]&&(W[we][0]=0),(me.nsPsy.lastAttacks[we]==3||W[we][0]+W[we][1]+W[we][2]+W[we][3]!=0)&&(mt=0,W[we][1]!=0&&W[we][0]!=0&&(W[we][1]=0),W[we][2]!=0&&W[we][1]!=0&&(W[we][2]=0),W[we][3]!=0&&W[we][2]!=0&&(W[we][3]=0)),we<2?de[we]=mt:mt==0&&(de[0]=de[1]=0),Y[we]=me.tot_ener[we]}}function pr(R,A,k){if(k==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 Fn(R,A){for(var k=0;k<R.npart_l;k++)R.nb_2[A][k]=R.nb_1[A][k],R.nb_1[A][k]=0}function Lr(R,A,k,V){var J=u.length-1,P=0,Y=k[P]+k[P+1];if(ye(Y>=0),Y>0){var ee=A[P];ee<A[P+1]&&(ee=A[P+1]),ye(R.numlines_s[P]+R.numlines_s[P+1]-1>0),Y=20*(ee*2-Y)/(Y*(R.numlines_s[P]+R.numlines_s[P+1]-1));var W=0|Y;W>J&&(W=J),V[P]=W}else V[P]=0;for(P=1;P<R.npart_s-1;P++)if(Y=k[P-1]+k[P]+k[P+1],ye(P+1<R.npart_s),ye(Y>=0),Y>0){var ee=A[P-1];ee<A[P]&&(ee=A[P]),ee<A[P+1]&&(ee=A[P+1]),ye(R.numlines_s[P-1]+R.numlines_s[P]+R.numlines_s[P+1]-1>0),Y=20*(ee*3-Y)/(Y*(R.numlines_s[P-1]+R.numlines_s[P]+R.numlines_s[P+1]-1));var W=0|Y;W>J&&(W=J),V[P]=W}else V[P]=0;if(ye(P>0),ye(P==R.npart_s-1),Y=k[P-1]+k[P],ye(Y>=0),Y>0){var ee=A[P-1];ee<A[P]&&(ee=A[P]),ye(R.numlines_s[P-1]+R.numlines_s[P]-1>0),Y=20*(ee*2-Y)/(Y*(R.numlines_s[P-1]+R.numlines_s[P]-1));var W=0|Y;W>J&&(W=J),V[P]=W}else V[P]=0;ye(P==R.npart_s-1)}function kr(R,A,k,V,J,P){var Y=R.internal_flags,ee=new float[T.CBANDS],W=ke(T.CBANDS),de,te,me,He=new int[T.CBANDS];for(me=te=0;me<Y.npart_s;++me){var rt=0,we=0,$e=Y.numlines_s[me];for(de=0;de<$e;++de,++te){var se=A[P][te];rt+=se,we<se&&(we=se)}k[me]=rt,ye(rt>=0),ee[me]=we,ye($e>0),W[me]=rt/$e,ye(W[me]>=0)}for(ye(me==Y.npart_s),ye(te==129);me<T.CBANDS;++me)ee[me]=0,W[me]=0;for(Lr(Y,ee,W,He),te=me=0;me<Y.npart_s;me++){var Ge=Y.s3ind_s[me][0],dt=Y.s3ind_s[me][1],Te,Ke,Re,Qe,kt;for(Te=He[Ge],Ke=1,Qe=Y.s3_ss[te]*k[Ge]*u[He[Ge]],++te,++Ge;Ge<=dt;)Te+=He[Ge],Ke+=1,Re=Y.s3_ss[te]*k[Ge]*u[He[Ge]],Qe=X(Qe,Re,Ge-me),++te,++Ge;Te=(1+2*Te)/(2*Ke),kt=u[Te]*.5,Qe*=kt,V[me]=Qe,Y.nb_s2[J][me]=Y.nb_s1[J][me],Y.nb_s1[J][me]=Qe,Re=ee[me],Re*=Y.minval_s[me],Re*=kt,V[me]>Re&&(V[me]=Re),Y.masking_lower>1&&(V[me]*=Y.masking_lower),V[me]>k[me]&&(V[me]=k[me]),Y.masking_lower<1&&(V[me]*=Y.masking_lower),ye(V[me]>=0)}for(;me<T.CBANDS;++me)k[me]=0,V[me]=0}function _n(R,A,k,V,J){var P=ke(T.CBANDS),Y=ke(T.CBANDS),ee=vt(T.CBANDS+2),W;Xe(R,A,k,P,Y),Ve(R,P,Y,ee);var de=0;for(W=0;W<R.npart_l;W++){var te,me,He,rt,we=R.s3ind[W][0],$e=R.s3ind[W][1],se=0,Ge=0;for(se=ee[we],Ge+=1,me=R.s3_ll[de]*k[we]*u[ee[we]],++de,++we;we<=$e;)se+=ee[we],Ge+=1,te=R.s3_ll[de]*k[we]*u[ee[we]],rt=X(me,te,we-W),me=rt,++de,++we;if(se=(1+2*se)/(2*Ge),He=u[se]*.5,me*=He,R.blocktype_old[J&1]==T.SHORT_TYPE){var dt=re*R.nb_1[J][W];dt>0?V[W]=Math.min(me,dt):V[W]=Math.min(me,k[W]*he)}else{var Te=Z*R.nb_2[J][W],Ke=re*R.nb_1[J][W],dt;Te<=0&&(Te=me),Ke<=0&&(Ke=me),R.blocktype_old[J&1]==T.NORM_TYPE?dt=Math.min(Ke,Te):dt=Ke,V[W]=Math.min(me,dt)}R.nb_2[J][W]=R.nb_1[J][W],R.nb_1[J][W]=me,te=P[W],te*=R.minval_l[W],te*=He,V[W]>te&&(V[W]=te),R.masking_lower>1&&(V[W]*=R.masking_lower),V[W]>k[W]&&(V[W]=k[W]),R.masking_lower<1&&(V[W]*=R.masking_lower),ye(V[W]>=0)}for(;W<T.CBANDS;++W)k[W]=0,V[W]=0}function Ti(R,A){var k=R.internal_flags;R.short_blocks==Ie.short_block_coupled&&!(A[0]!=0&&A[1]!=0)&&(A[0]=A[1]=0);for(var V=0;V<k.channels_out;V++)R.short_blocks==Ie.short_block_dispensed&&(A[V]=1),R.short_blocks==Ie.short_block_forced&&(A[V]=0)}function Ai(R,A,k){for(var V=R.internal_flags,J=0;J<V.channels_out;J++){var P=T.NORM_TYPE;A[J]!=0?(ye(V.blocktype_old[J]!=T.START_TYPE),V.blocktype_old[J]==T.SHORT_TYPE&&(P=T.STOP_TYPE)):(P=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)),k[J]=V.blocktype_old[J],V.blocktype_old[J]=P}}function Sn(R,A,k,V,J,P,Y){for(var ee=P*2,W=P>0?Math.pow(10,J):1,de,te,me=0;me<Y;++me){var He=R[2][me],rt=R[3][me],we=A[0][me],$e=A[1][me],se=A[2][me],Ge=A[3][me];if(we<=1.58*$e&&$e<=1.58*we){var dt=k[me]*rt,Te=k[me]*He;te=Math.max(se,Math.min(Ge,dt)),de=Math.max(Ge,Math.min(se,Te))}else te=se,de=Ge;if(P>0){var Ke,Re,Qe=V[me]*W;if(Ke=Math.min(Math.max(we,Qe),Math.max($e,Qe)),se=Math.max(te,Qe),Ge=Math.max(de,Qe),Re=se+Ge,Re>0&&Ke*ee<Re){var kt=Ke*ee/Re;se*=kt,Ge*=kt,ye(Re>0)}te=Math.min(se,te),de=Math.min(Ge,de)}te>He&&(te=He),de>rt&&(de=rt),A[2][me]=te,A[3][me]=de}}this.L3psycho_anal_vbr=function(R,A,k,V,J,P,Y,ee,W,de){var te=R.internal_flags,me,He,rt=ke(T.HBLKSIZE),we=ot([3,T.HBLKSIZE_s]),$e=ot([2,T.BLKSIZE]),se=ot([2,3,T.BLKSIZE_s]),Ge=ot([4,T.CBANDS]),dt=ot([4,T.CBANDS]),Te=ot([4,3]),Ke=.6,Re=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],Qe=vt(2),kt=R.mode==rr.JOINT_STEREO?4:te.channels_out;Kt(R,A,k,V,J,P,W,Te,Re,Qe),Ti(R,Qe);{for(var qe=0;qe<kt;qe++){var lt=qe&1;me=$e,Ft(R,A,k,qe,V,rt,me,lt),Lt(R,V,qe,rt),Qe[lt]!=0?_n(te,rt,Ge[qe],dt[qe],qe):Fn(te,qe)}Qe[0]+Qe[1]==2&&R.mode==rr.JOINT_STEREO&&Sn(Ge,dt,te.mld_cb_l,te.ATH.cb_l,R.ATHlower*te.ATH.adjust,R.msfix,te.npart_l);for(var qe=0;qe<kt;qe++){var lt=qe&1;Qe[lt]!=0&&S(te,Ge[qe],dt[qe],qe)}}{for(var mt=0;mt<3;mt++){for(var qe=0;qe<kt;++qe){var lt=qe&1;Qe[lt]!=0?pr(te,qe,mt):(He=se,Rt(R,A,k,qe,mt,we,He,lt),kr(R,we,Ge[qe],dt[qe],qe,mt))}Qe[0]+Qe[1]==0&&R.mode==rr.JOINT_STEREO&&Sn(Ge,dt,te.mld_cb_s,te.ATH.cb_s,R.ATHlower*te.ATH.adjust,R.msfix,te.npart_s);for(var qe=0;qe<kt;++qe){var lt=qe&1;Qe[lt]==0&&f(te,Ge[qe],dt[qe],qe,mt)}}for(var qe=0;qe<kt;qe++){var lt=qe&1;if(Qe[lt]==0)for(var Vt=0;Vt<T.SBMAX_s;Vt++){for(var Xr=ke(3),mt=0;mt<3;mt++){var $t=te.thm[qe].s[Vt][mt];if($t*=j,Re[qe][mt]>=2||Re[qe][mt+1]==1){var Ht=mt!=0?mt-1:2,Ur=Oe(te.thm[qe].s[Vt][Ht],$t,fe*Ke);$t=Math.min($t,Ur)}else if(Re[qe][mt]==1){var Ht=mt!=0?mt-1:2,Ur=Oe(te.thm[qe].s[Vt][Ht],$t,he*Ke);$t=Math.min($t,Ur)}else if(mt!=0&&Re[qe][mt-1]==3||mt==0&&te.nsPsy.lastAttacks[qe]==3){var Ht=mt!=2?mt+1:0,Ur=Oe(te.thm[qe].s[Vt][Ht],$t,he*Ke);$t=Math.min($t,Ur)}$t*=Te[qe][mt],Xr[mt]=$t}for(var mt=0;mt<3;mt++)te.thm[qe].s[Vt][mt]=Xr[mt]}}}for(var qe=0;qe<kt;qe++)te.nsPsy.lastAttacks[qe]=Re[qe][2];Ai(R,Qe,de);for(var qe=0;qe<kt;qe++){var Kr,Wr,xn,bn;qe>1?(Kr=ee,Wr=-2,xn=T.NORM_TYPE,(de[0]==T.SHORT_TYPE||de[1]==T.SHORT_TYPE)&&(xn=T.SHORT_TYPE),bn=P[V][qe-2]):(Kr=Y,Wr=0,xn=de[qe],bn=J[V][qe]),xn==T.SHORT_TYPE?Kr[Wr+qe]=je(bn,te.masking_lower):Kr[Wr+qe]=nt(bn,te.masking_lower),R.analysis&&(te.pinfo.pe[V][qe]=Kr[Wr+qe])}return 0};function Cr(R,A){var k=R,V;return k>=0?V=-k*27:V=k*A,V<=-72?0:Math.exp(V*H)}function ri(R){var A=0,k=0;{var V=0,J,P;for(V=0;Cr(V,R)>1e-20;V-=1);for(J=V,P=0;Math.abs(P-J)>1e-12;)V=(P+J)/2,Cr(V,R)>0?P=V:J=V;A=J}{var V=0,J,P;for(V=0;Cr(V,R)>1e-20;V+=1);for(J=0,P=V;Math.abs(P-J)>1e-12;)V=(P+J)/2,Cr(V,R)>0?J=V:P=V;k=P}{var Y=0,ee=1e3,W;for(W=0;W<=ee;++W){var V=A+W*(k-A)/ee,de=Cr(V,R);Y+=de}{var te=(ee+1)/(Y*(k-A));return te}}}function Xa(R){var A,k,V,J;return A=R,A>=0?A*=3:A*=1.5,A>=.5&&A<=2.5?(J=A-.5,k=8*(J*J-2*J)):k=0,A+=.474,V=15.811389+7.5*A-17.5*Math.sqrt(1+A*A),V<=-60?0:(A=Math.exp((k+V)*H),A/=.6609193,A)}function ni(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 D1(R,A,k,V,J,P,Y,ee,W,de,te,me){var He=ke(T.CBANDS+1),rt=ee/(me>15?2*576:2*192),we=vt(T.HBLKSIZE),$e;ee/=W;var se=0,Ge=0;for($e=0;$e<T.CBANDS;$e++){var dt,Te;for(dt=ni(ee*se),He[$e]=ee*se,Te=se;ni(ee*Te)-dt<ve&&Te<=W/2;Te++);for(R[$e]=Te-se,Ge=$e+1;se<Te;)ye(se<T.HBLKSIZE),we[se++]=$e;if(se>W/2){se=W/2,++$e;break}}ye($e<T.CBANDS),He[$e]=ee*se;for(var Ke=0;Ke<me;Ke++){var Re,Qe,kt,qe,lt;kt=de[Ke],qe=de[Ke+1],Re=0|Math.floor(.5+te*(kt-.5)),Re<0&&(Re=0),Qe=0|Math.floor(.5+te*(qe-.5)),Qe>W/2&&(Qe=W/2),k[Ke]=(we[Re]+we[Qe])/2,A[Ke]=we[Qe];var mt=rt*qe;Y[Ke]=(mt-He[A[Ke]])/(He[A[Ke]+1]-He[A[Ke]]),Y[Ke]<0?Y[Ke]=0:Y[Ke]>1&&(Y[Ke]=1),lt=ni(ee*de[Ke]*te),lt=Math.min(lt,15.5)/15.5,P[Ke]=Math.pow(10,1.25*(1-Math.cos(Math.PI*lt))-2.5)}se=0;for(var Vt=0;Vt<Ge;Vt++){var Xr=R[Vt],dt,$t;dt=ni(ee*se),$t=ni(ee*(se+Xr-1)),V[Vt]=.5*(dt+$t),dt=ni(ee*(se-.5)),$t=ni(ee*(se+Xr-.5)),J[Vt]=$t-dt,se+=Xr}return Ge}function O1(R,A,k,V,J,P){var Y=ot([T.CBANDS,T.CBANDS]),ee,W=0;if(P)for(var de=0;de<A;de++)for(ee=0;ee<A;ee++){var te=Xa(k[de]-k[ee])*V[ee];Y[de][ee]=te*J[de]}else for(ee=0;ee<A;ee++)for(var me=15+Math.min(21/k[ee],12),He=ri(me),de=0;de<A;de++){var te=He*Cr(k[de]-k[ee],me)*V[ee];Y[de][ee]=te*J[de]}for(var de=0;de<A;de++){for(ee=0;ee<A&&!(Y[de][ee]>0);ee++);for(R[de][0]=ee,ee=A-1;ee>0&&!(Y[de][ee]>0);ee--);R[de][1]=ee,W+=R[de][1]-R[de][0]+1}for(var rt=ke(W),we=0,de=0;de<A;de++)for(ee=R[de][0];ee<=R[de][1];ee++)rt[we++]=Y[de][ee];return rt}function F1(R){var A=ni(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,k,V=!0,J=13,P=24,Y=0,ee=0,W=-8.25,de=-4.5,te=ke(T.CBANDS),me=ke(T.CBANDS),He=ke(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,ee=-.0125,W=-8.25,de=-2.25;break}for(A.ms_ener_ratio_old=.25,A.blocktype_old[0]=A.blocktype_old[1]=T.NORM_TYPE,k=0;k<4;++k){for(var se=0;se<T.CBANDS;++se)A.nb_1[k][se]=1e20,A.nb_2[k][se]=1e20,A.nb_s1[k][se]=A.nb_s2[k][se]=1;for(var we=0;we<T.SBMAX_l;we++)A.en[k].l[we]=1e20,A.thm[k].l[we]=1e20;for(var se=0;se<3;++se){for(var we=0;we<T.SBMAX_s;we++)A.en[k].s[we][se]=1e20,A.thm[k].s[we][se]=1e20;A.nsPsy.lastAttacks[k]=0}for(var se=0;se<9;se++)A.nsPsy.last_en_subshort[k][se]=10}for(A.loudness_sq_save[0]=A.loudness_sq_save[1]=0,A.npart_l=D1(A.numlines_l,A.bo_l,A.bm_l,te,me,A.mld_l,A.PSY.bo_l_weight,rt,T.BLKSIZE,A.scalefac_band.l,T.BLKSIZE/(2*576),T.SBMAX_l),ye(A.npart_l<T.CBANDS),k=0;k<A.npart_l;k++){var $e=Y;te[k]>=J&&($e=ee*(te[k]-J)/(P-J)+Y*(P-te[k])/(P-J)),He[k]=Math.pow(10,$e/10),A.numlines_l[k]>0?A.rnumlines_l[k]=1/A.numlines_l[k]:A.rnumlines_l[k]=0}A.s3_ll=O1(A.s3ind,A.npart_l,te,me,He,V);var se=0;for(k=0;k<A.npart_l;k++){var Ge;Ge=Ae.MAX_VALUE;for(var dt=0;dt<A.numlines_l[k];dt++,se++){var Te=rt*se/(1e3*T.BLKSIZE),Ke;Ke=this.ATHformula(Te*1e3,R)-20,Ke=Math.pow(10,.1*Ke),Ke*=A.numlines_l[k],Ge>Ke&&(Ge=Ke)}A.ATH.cb_l[k]=Ge,Ge=-20+te[k]*20/10,Ge>6&&(Ge=100),Ge<-15&&(Ge=-15),Ge-=8,A.minval_l[k]=Math.pow(10,Ge/10)*A.numlines_l[k]}for(A.npart_s=D1(A.numlines_s,A.bo_s,A.bm_s,te,me,A.mld_s,A.PSY.bo_s_weight,rt,T.BLKSIZE_s,A.scalefac_band.s,T.BLKSIZE_s/(2*192),T.SBMAX_s),ye(A.npart_s<T.CBANDS),se=0,k=0;k<A.npart_s;k++){var Ge,$e=W;te[k]>=J&&($e=de*(te[k]-J)/(P-J)+W*(P-te[k])/(P-J)),He[k]=Math.pow(10,$e/10),Ge=Ae.MAX_VALUE;for(var dt=0;dt<A.numlines_s[k];dt++,se++){var Te=rt*se/(1e3*T.BLKSIZE_s),Ke;Ke=this.ATHformula(Te*1e3,R)-20,Ke=Math.pow(10,.1*Ke),Ke*=A.numlines_s[k],Ge>Ke&&(Ge=Ke)}A.ATH.cb_s[k]=Ge,Ge=-7+te[k]*7/12,te[k]>12&&(Ge*=1+Math.log(1+Ge)*3.1),te[k]<12&&(Ge*=1+Math.log(1-Ge)*2.3),Ge<-15&&(Ge=-15),Ge-=8,A.minval_s[k]=Math.pow(10,Ge/10)*A.numlines_s[k]}A.s3_ss=O1(A.s3ind_s,A.npart_s,te,me,He,V),v(),C.init_fft(A),A.decay=Math.exp(-1*$/(De*rt/192));{var Re;Re=M,(R.exp_nspsytune&2)!=0&&(Re=1),Math.abs(R.msfix)>0&&(Re=R.msfix),R.msfix=Re;for(var Qe=0;Qe<A.npart_l;Qe++)A.s3ind[Qe][1]>A.npart_l-1&&(A.s3ind[Qe][1]=A.npart_l-1)}var kt=576*A.mode_gr/rt;if(A.ATH.decay=Math.pow(10,-12/10*kt),A.ATH.adjust=.01,A.ATH.adjustLimit=1,ye(A.bo_l[T.SBMAX_l-1]<=A.npart_l),ye(A.bo_s[T.SBMAX_s-1]<=A.npart_s),R.ATHtype!=-1){var Te,qe=R.out_samplerate/T.BLKSIZE,lt=0;for(Te=0,k=0;k<T.BLKSIZE/2;++k)Te+=qe,A.ATH.eql_w[k]=1/Math.pow(10,this.ATHformula(Te,R)/10),lt+=A.ATH.eql_w[k];for(lt=1/lt,k=T.BLKSIZE/2;--k>=0;)A.ATH.eql_w[k]*=lt}{for(var Qe=se=0;Qe<A.npart_s;++Qe)for(k=0;k<A.numlines_s[Qe];++k)++se;ye(se==129);for(var Qe=se=0;Qe<A.npart_l;++Qe)for(k=0;k<A.numlines_l[Qe];++k)++se;ye(se==513)}for(se=0,k=0;k<A.npart_l;k++){var Te=rt*(se+A.numlines_l[k]/2)/(1*T.BLKSIZE);A.mld_cb_l[k]=F1(Te),se+=A.numlines_l[k]}for(;k<T.CBANDS;++k)A.mld_cb_l[k]=1;for(se=0,k=0;k<A.npart_s;k++){var Te=rt*(se+A.numlines_s[k]/2)/(1*T.BLKSIZE_s);A.mld_cb_s[k]=F1(Te),se+=A.numlines_s[k]}for(;k<T.CBANDS;++k)A.mld_cb_s[k]=1;return 0};function ta(R,A){R<-.3&&(R=3410),R/=1e3,R=Math.max(.1,R);var k=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 k}this.ATHformula=function(R,A){var k;switch(A.ATHtype){case 0:k=ta(R,9);break;case 1:k=ta(R,-1);break;case 2:k=ta(R,0);break;case 3:k=ta(R,1)+6;break;case 4:k=ta(R,A.ATHcurve);break;default:k=ta(R,0);break}return k}}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 Qi=yr;function hn(){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=Qi.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 t0=hn,x1={};x1.SFBMAX=T.SBMAX_s*3;var xi=x1,Nf=N.new_float,bi=N.new_int;function Df(){this.xr=Nf(576),this.l3_enc=bi(576),this.scalefac=bi(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=bi(3),this.subblock_gain=bi(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=bi(xi.SFBMAX),this.window=bi(xi.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=bi(4),this.max_nonzero_coeff=0;var C=this;function $(Z){return new Int32Array(Z)}function re(Z){return new Float32Array(Z)}this.assign=function(Z){C.xr=re(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 Do=Df,b1=N.new_int;function Of(){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=[b1(4),b1(4)];for(var C=0;C<2;C++)for(var $=0;$<2;$++)this.tt[C][$]=new Do}var Ff=Of,Oo=N.System,Fo=N.new_int;function Lf(C,$,re,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 ge=this.l,Q=this.s;arguments.length==4&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],Oo.arraycopy(this.arrL,0,ge,0,Math.min(this.arrL.length,this.l.length)),Oo.arraycopy(this.arrS,0,Q,0,Math.min(this.arrS.length,this.s.length)),Oo.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),Oo.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}var Bn=Lf,r0=N.new_float,kf=N.new_float_n,Uf=N.new_int;function Hf(){this.last_en_subshort=kf([4,9]),this.lastAttacks=Uf(4),this.pefirbuf=r0(19),this.longfact=r0(T.SBMAX_l),this.shortfact=r0(T.SBMAX_s),this.attackthre=0,this.attackthre_s=0}var Vf=Hf;function qf(){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 zf=qf,jf=N.new_byte,Gf=N.new_double,on=N.new_float,gi=N.new_float_n,pn=N.new_int,Lo=N.new_int_n;qn.MFSIZE=3*1152+T.ENCDELAY-T.MDCTDELAY,qn.MAX_HEADER_BUF=256,qn.MAX_BITS_PER_CHANNEL=4095,qn.MAX_BITS_PER_GRANULE=7680,qn.BPC=320;function qn(){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=gi([2,qn.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 Ff,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=pn(2),this.CurrentStep=pn(2),this.masking_lower=0,this.bv_scf=pn(576),this.pseudohalf=pn(xi.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*qn.BPC+1),this.itime=Gf(2),this.sideinfo_len=0,this.sb_sample=gi([2,2,18,T.SBLIMIT]),this.amp_filter=on(32);function $(){this.write_timing=0,this.ptr=0,this.buf=jf(C)}this.header=new Array(qn.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 Bn,this.minval_l=on(T.CBANDS),this.minval_s=on(T.CBANDS),this.nb_1=gi([4,T.CBANDS]),this.nb_2=gi([4,T.CBANDS]),this.nb_s1=gi([4,T.CBANDS]),this.nb_s2=gi([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=gi([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=pn(T.SBMAX_l),this.bo_l=pn(T.SBMAX_l),this.bm_s=pn(T.SBMAX_s),this.bo_s=pn(T.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=Lo([T.CBANDS,2]),this.s3ind_s=Lo([T.CBANDS,2]),this.numlines_s=pn(T.CBANDS),this.numlines_l=pn(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=pn(2),this.nsPsy=new Vf,this.VBR_seek_table=new zf,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=Lo([16,4+1]),this.bitrate_blockType_Hist=Lo([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 re=0;re<this.en.length;re++)this.en[re]=new or;for(var re=0;re<this.thm.length;re++)this.thm[re]=new or;for(var re=0;re<this.header.length;re++)this.header[re]=new $}var Bt=qn,yi=N.new_float;function Xf(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=yi(T.SBMAX_l),this.s=yi(T.SBMAX_s),this.psfb21=yi(T.PSFB21),this.psfb12=yi(T.PSFB12),this.cb_l=yi(T.CBANDS),this.cb_s=yi(T.CBANDS),this.eql_w=yi(T.BLKSIZE/2)}var Kf=Xf,Fr=N.System,g1=N.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,re=.95,Z=Ut.MAX_SAMP_FREQ,ge=Ut.RMS_WINDOW_TIME_NUMERATOR,Q=Ut.RMS_WINDOW_TIME_DENOMINATOR,ve=Ut.MAX_SAMPLES_PER_WINDOW,Be=[[.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]],De=[[.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 j(a,I,H,D,x,_){for(;x--!=0;)H[D]=1e-10+a[I+0]*_[0]-H[D-1]*_[1]+a[I-1]*_[2]-H[D-2]*_[3]+a[I-2]*_[4]-H[D-3]*_[5]+a[I-3]*_[6]-H[D-4]*_[7]+a[I-4]*_[8]-H[D-5]*_[9]+a[I-5]*_[10]-H[D-6]*_[11]+a[I-6]*_[12]-H[D-7]*_[13]+a[I-7]*_[14]-H[D-8]*_[15]+a[I-8]*_[16]-H[D-9]*_[17]+a[I-9]*_[18]-H[D-10]*_[19]+a[I-10]*_[20],++D,++I}function fe(a,I,H,D,x,_){for(;x--!=0;)H[D]=a[I+0]*_[0]-H[D-1]*_[1]+a[I-1]*_[2]-H[D-2]*_[3]+a[I-2]*_[4],++D,++I}function he(a,I){for(var H=0;H<MAX_ORDER;H++)a.linprebuf[H]=a.lstepbuf[H]=a.loutbuf[H]=a.rinprebuf[H]=a.rstepbuf[H]=a.routbuf[H]=0;switch(0|I){case 48e3:a.reqindex=0;break;case 44100:a.reqindex=1;break;case 32e3:a.reqindex=2;break;case 24e3:a.reqindex=3;break;case 22050:a.reqindex=4;break;case 16e3:a.reqindex=5;break;case 12e3:a.reqindex=6;break;case 11025:a.reqindex=7;break;case 8e3:a.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return a.sampleWindow=0|(I*ge+Q-1)/Q,a.lsum=0,a.rsum=0,a.totsamp=0,g1.ill(a.A,0),INIT_GAIN_ANALYSIS_OK}this.InitGainAnalysis=function(a,I){return he(a,I)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(a.linpre=MAX_ORDER,a.rinpre=MAX_ORDER,a.lstep=MAX_ORDER,a.rstep=MAX_ORDER,a.lout=MAX_ORDER,a.rout=MAX_ORDER,g1.fill(a.B,0),INIT_GAIN_ANALYSIS_OK)};function M(a){return a*a}this.AnalyzeSamples=function(a,I,H,D,x,_,B){var q,w,c,F,y,u,v;if(_==0)return GAIN_ANALYSIS_OK;switch(v=0,y=_,B){case 1:D=I,x=H;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(_<MAX_ORDER?(Fr.arraycopy(I,H,a.linprebuf,MAX_ORDER,_),Fr.arraycopy(D,x,a.rinprebuf,MAX_ORDER,_)):(Fr.arraycopy(I,H,a.linprebuf,MAX_ORDER,MAX_ORDER),Fr.arraycopy(D,x,a.rinprebuf,MAX_ORDER,MAX_ORDER));y>0;){u=y>a.sampleWindow-a.totsamp?a.sampleWindow-a.totsamp:y,v<MAX_ORDER?(q=a.linpre+v,w=a.linprebuf,c=a.rinpre+v,F=a.rinprebuf,u>MAX_ORDER-v&&(u=MAX_ORDER-v)):(q=H+v,w=I,c=x+v,F=D),j(w,q,a.lstepbuf,a.lstep+a.totsamp,u,Be[a.reqindex]),j(F,c,a.rstepbuf,a.rstep+a.totsamp,u,Be[a.reqindex]),fe(a.lstepbuf,a.lstep+a.totsamp,a.loutbuf,a.lout+a.totsamp,u,De[a.reqindex]),fe(a.rstepbuf,a.rstep+a.totsamp,a.routbuf,a.rout+a.totsamp,u,De[a.reqindex]),q=a.lout+a.totsamp,w=a.loutbuf,c=a.rout+a.totsamp,F=a.routbuf;for(var b=u%8;b--!=0;)a.lsum+=M(w[q++]),a.rsum+=M(F[c++]);for(b=u/8;b--!=0;)a.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,a.rsum+=M(F[c+0])+M(F[c+1])+M(F[c+2])+M(F[c+3])+M(F[c+4])+M(F[c+5])+M(F[c+6])+M(F[c+7]),c+=8;if(y-=u,v+=u,a.totsamp+=u,a.totsamp==a.sampleWindow){var l=Ut.STEPS_per_dB*10*Math.log10((a.lsum+a.rsum)/a.totsamp*.5+1e-37),m=l<=0?0:0|l;m>=a.A.length&&(m=a.A.length-1),a.A[m]++,a.lsum=a.rsum=0,Fr.arraycopy(a.loutbuf,a.totsamp,a.loutbuf,0,MAX_ORDER),Fr.arraycopy(a.routbuf,a.totsamp,a.routbuf,0,MAX_ORDER),Fr.arraycopy(a.lstepbuf,a.totsamp,a.lstepbuf,0,MAX_ORDER),Fr.arraycopy(a.rstepbuf,a.totsamp,a.rstepbuf,0,MAX_ORDER),a.totsamp=0}if(a.totsamp>a.sampleWindow)return GAIN_ANALYSIS_ERROR}return _<MAX_ORDER?(Fr.arraycopy(a.linprebuf,_,a.linprebuf,0,MAX_ORDER-_),Fr.arraycopy(a.rinprebuf,_,a.rinprebuf,0,MAX_ORDER-_),Fr.arraycopy(I,H,a.linprebuf,MAX_ORDER-_,_),Fr.arraycopy(D,x,a.rinprebuf,MAX_ORDER-_,_)):(Fr.arraycopy(I,H+_-MAX_ORDER,a.linprebuf,0,MAX_ORDER),Fr.arraycopy(D,x+_-MAX_ORDER,a.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK};function K(a,I){var H,D=0;for(H=0;H<I;H++)D+=a[H];if(D==0)return GAIN_NOT_ENOUGH_SAMPLES;var x=0|Math.ceil(D*(1-re));for(H=I;H-- >0&&!((x-=a[H])<=0););return C-H/Ut.STEPS_per_dB}this.GetTitleGain=function(a){for(var I=K(a.A,a.A.length),H=0;H<a.A.length;H++)a.B[H]+=a.A[H],a.A[H]=0;for(var H=0;H<MAX_ORDER;H++)a.linprebuf[H]=a.lstepbuf[H]=a.loutbuf[H]=a.rinprebuf[H]=a.rstepbuf[H]=a.routbuf[H]=0;return a.totsamp=0,a.lsum=a.rsum=0,I}}var Ir=Ut,Ji=N.new_float,y1=N.new_int;function Wf(){this.linprebuf=Ji(Ir.MAX_ORDER*2),this.linpre=0,this.lstepbuf=Ji(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.lstep=0,this.loutbuf=Ji(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.lout=0,this.rinprebuf=Ji(Ir.MAX_ORDER*2),this.rinpre=0,this.rstepbuf=Ji(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.rstep=0,this.routbuf=Ji(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=y1(0|Ir.STEPS_per_dB*Ir.MAX_dB),this.B=y1(0|Ir.STEPS_per_dB*Ir.MAX_dB)}var Yf=Wf;function $f(C){this.bits=C}var E1=$f,w1=N.new_float,Zf=N.new_int,R1=N.assert;function Qf(C){var $=C;this.quantize=$,this.iteration_loop=function(re,Z,ge,Q){var ve=re.internal_flags,Be=w1(xi.SFBMAX),De=w1(576),j=Zf(2),fe=0,he,M=ve.l3_side,K=new E1(fe);this.quantize.rv.ResvFrameBegin(re,K),fe=K.bits;for(var a=0;a<ve.mode_gr;a++){he=this.quantize.qupvt.on_pe(re,Z,j,fe,a,a),ve.mode_ext==T.MPG_MD_MS_LR&&(this.quantize.ms_convert(ve.l3_side,a),this.quantize.qupvt.reduce_side(j,ge[a],fe,he));for(var I=0;I<ve.channels_out;I++){var H,D,x=M.tt[a][I];x.block_type!=T.SHORT_TYPE?(H=0,D=ve.PSY.mask_adjust-H):(H=0,D=ve.PSY.mask_adjust_short-H),ve.masking_lower=Math.pow(10,D*.1),this.quantize.init_outer_loop(ve,x),this.quantize.init_xrpow(ve,x,De)&&(this.quantize.qupvt.calc_xmin(re,Q[a][I],x,Be),this.quantize.outer_loop(re,x,Be,De,I,j[I])),this.quantize.iteration_finish_one(ve,a,I),R1(x.part2_3_length<=Bt.MAX_BITS_PER_CHANNEL),R1(x.part2_3_length<=j[I])}}this.quantize.rv.ResvFrameEnd(ve,fe)}}var Jf=Qf;function Et(C,$,re,Z){this.xlen=C,this.linmax=$,this.table=re,this.hlen=Z}var Ce={};Ce.t1HB=[1,1,1,0],Ce.t2HB=[1,2,1,3,1,1,3,2,0],Ce.t3HB=[3,2,1,1,1,1,3,2,0],Ce.t5HB=[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],Ce.t6HB=[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.t1l=[1,4,3,5],Ce.t2l=[1,4,7,4,5,7,6,7,8],Ce.t3l=[2,3,7,4,4,7,6,7,8],Ce.t5l=[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],Ce.t6l=[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.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],Ce.ht=[new Et(0,0,null,null),new Et(2,0,Ce.t1HB,Ce.t1l),new Et(3,0,Ce.t2HB,Ce.t2l),new Et(3,0,Ce.t3HB,Ce.t3l),new Et(0,0,null,null),new Et(4,0,Ce.t5HB,Ce.t5l),new Et(4,0,Ce.t6HB,Ce.t6l),new Et(6,0,Ce.t7HB,Ce.t7l),new Et(6,0,Ce.t8HB,Ce.t8l),new Et(6,0,Ce.t9HB,Ce.t9l),new Et(8,0,Ce.t10HB,Ce.t10l),new Et(8,0,Ce.t11HB,Ce.t11l),new Et(8,0,Ce.t12HB,Ce.t12l),new Et(16,0,Ce.t13HB,Ce.t13l),new Et(0,0,null,Ce.t16_5l),new Et(16,0,Ce.t15HB,Ce.t15l),new Et(1,1,Ce.t16HB,Ce.t16l),new Et(2,3,Ce.t16HB,Ce.t16l),new Et(3,7,Ce.t16HB,Ce.t16l),new Et(4,15,Ce.t16HB,Ce.t16l),new Et(6,63,Ce.t16HB,Ce.t16l),new Et(8,255,Ce.t16HB,Ce.t16l),new Et(10,1023,Ce.t16HB,Ce.t16l),new Et(13,8191,Ce.t16HB,Ce.t16l),new Et(4,15,Ce.t24HB,Ce.t24l),new Et(5,31,Ce.t24HB,Ce.t24l),new Et(6,63,Ce.t24HB,Ce.t24l),new Et(7,127,Ce.t24HB,Ce.t24l),new Et(8,255,Ce.t24HB,Ce.t24l),new Et(9,511,Ce.t24HB,Ce.t24l),new Et(11,2047,Ce.t24HB,Ce.t24l),new Et(13,8191,Ce.t24HB,Ce.t24l),new Et(0,0,Ce.t32HB,Ce.t32l),new Et(0,0,Ce.t33HB,Ce.t33l)],Ce.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],Ce.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],Ce.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],Ce.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]],Ce.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],Ce.scfsi_band=[0,6,11,16,21];var bt=Ce,Ei=N.VbrMode,ko=N.Float,n0=N.Util,wi=N.new_float,ed=N.new_int,zn=N.assert;jr.Q_MAX=256+1,jr.Q_MAX2=116,jr.LARGE_BITS=1e5,jr.IXMAX_VAL=8206;function jr(){var C=null,$=null,re=null;this.setModules=function(_,B,q){C=_,$=B,re=q};function Z(_){return zn(0<=_+jr.Q_MAX2&&_<jr.Q_MAX),M[_+jr.Q_MAX2]}this.IPOW20=function(_){return zn(0<=_&&_<jr.Q_MAX),K[_]};var ge=2220446049250313e-31,Q=jr.IXMAX_VAL,ve=Q+2,Be=jr.Q_MAX,De=jr.Q_MAX2,j=jr.LARGE_BITS,fe=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 Bn([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 Bn([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 Bn([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 Bn([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 Bn([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 Bn([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 Bn([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 Bn([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 Bn([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=wi(Be+De+1),K=wi(Be),a=wi(ve),I=wi(ve);this.adj43=I;function H(_,B){var q=re.ATHformula(B,_);return q-=fe,q=Math.pow(10,q/10+_.ATHlower),q}function D(_){for(var B=_.internal_flags.ATH.l,q=_.internal_flags.ATH.psfb21,w=_.internal_flags.ATH.s,c=_.internal_flags.ATH.psfb12,F=_.internal_flags,y=_.out_samplerate,u=0;u<T.SBMAX_l;u++){var v=F.scalefac_band.l[u],b=F.scalefac_band.l[u+1];B[u]=ko.MAX_VALUE;for(var l=v;l<b;l++){var m=l*y/1152,g=H(_,m);B[u]=Math.min(B[u],g)}}for(var u=0;u<T.PSFB21;u++){var v=F.scalefac_band.psfb21[u],b=F.scalefac_band.psfb21[u+1];q[u]=ko.MAX_VALUE;for(var l=v;l<b;l++){var m=l*y/1152,g=H(_,m);q[u]=Math.min(q[u],g)}}for(var u=0;u<T.SBMAX_s;u++){var v=F.scalefac_band.s[u],b=F.scalefac_band.s[u+1];w[u]=ko.MAX_VALUE;for(var l=v;l<b;l++){var m=l*y/384,g=H(_,m);w[u]=Math.min(w[u],g)}w[u]*=F.scalefac_band.s[u+1]-F.scalefac_band.s[u]}for(var u=0;u<T.PSFB12;u++){var v=F.scalefac_band.psfb12[u],b=F.scalefac_band.psfb12[u+1];c[u]=ko.MAX_VALUE;for(var l=v;l<b;l++){var m=l*y/384,g=H(_,m);c[u]=Math.min(c[u],g)}c[u]*=F.scalefac_band.s[13]-F.scalefac_band.s[12]}if(_.noATH){for(var u=0;u<T.SBMAX_l;u++)B[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}F.ATH.floor=10*Math.log10(H(_,-1))}this.iteration_init=function(_){var B=_.internal_flags,q=B.l3_side,w;if(B.iteration_init_init==0){for(B.iteration_init_init=1,q.main_data_begin=0,D(_),a[0]=0,w=1;w<ve;w++)a[w]=Math.pow(w,4/3);for(w=0;w<ve-1;w++)I[w]=w+1-Math.pow(.5*(a[w]+a[w+1]),.75);for(I[w]=.5,w=0;w<Be;w++)K[w]=Math.pow(2,(w-210)*-.1875);for(w=0;w<=Be+De;w++)M[w]=Math.pow(2,(w-210-De)*.25);C.huffman_init(B);{var c,F,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),F=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 v;w<=6?v=c:w<=13?v=F:w<=20?v=y:v=u,B.nsPsy.longfact[w]=v}for(w=0;w<T.SBMAX_s;w++){var v;w<=5?v=c:w<=10?v=F:w<=11?v=y:v=u,B.nsPsy.shortfact[w]=v}}}},this.on_pe=function(_,B,q,w,c,F){var y=_.internal_flags,u=0,v,b=ed(2),l,m=new E1(u),g=$.ResvMaxBits(_,w,m,F);u=m.bits;var E=u+g;for(E>Bt.MAX_BITS_PER_GRANULE&&(E=Bt.MAX_BITS_PER_GRANULE),v=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]*B[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])),v+=b[l];if(v>g)for(l=0;l<y.channels_out;++l)b[l]=g*b[l]/v;for(l=0;l<y.channels_out;++l)q[l]+=b[l],g-=b[l];for(v=0,l=0;l<y.channels_out;++l)v+=q[l];if(v>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]/=v,X+=q[l];zn(X<=Bt.MAX_BITS_PER_GRANULE)}return E},this.reduce_side=function(_,B,q,w){zn(w<=Bt.MAX_BITS_PER_GRANULE),zn(_[0]+_[1]<=Bt.MAX_BITS_PER_GRANULE);var c=.33*(.5-B)/.5;c<0&&(c=0),c>.5&&(c=.5);var F=0|c*.5*(_[0]+_[1]);F>Bt.MAX_BITS_PER_CHANNEL-_[0]&&(F=Bt.MAX_BITS_PER_CHANNEL-_[0]),F<0&&(F=0),_[1]>=125&&(_[1]-F>125?(_[0]<q&&(_[0]+=F),_[1]-=F):(_[0]+=_[1]-125,_[1]=125)),F=_[0]+_[1],F>w&&(_[0]=w*_[0]/F,_[1]=w*_[1]/F),zn(_[0]<=Bt.MAX_BITS_PER_CHANNEL),zn(_[1]<=Bt.MAX_BITS_PER_CHANNEL),zn(_[0]+_[1]<=Bt.MAX_BITS_PER_GRANULE)},this.athAdjust=function(_,B,q){var w=90.30873362,c=94.82444863,F=n0.FAST_LOG10_X(B,10),y=_*_,u=0;return F-=q,y>1e-20&&(u=1+n0.FAST_LOG10_X(y,10/w)),u<0&&(u=0),F*=u,F+=q+w-c,Math.pow(10,.1*F)},this.calc_xmin=function(_,B,q,w){var c=0,F=_.internal_flags,y,u=0,v=0,b=F.ATH,l=q.xr,m=_.VBR==Ei.vbr_mtrh?1:0,g=F.masking_lower;for((_.VBR==Ei.vbr_mtrh||_.VBR==Ei.vbr_mt)&&(g=1),y=0;y<q.psy_lmax;y++){var E,X,U,z,Se,f;_.VBR==Ei.vbr_rh||_.VBR==Ei.vbr_mtrh?X=athAdjust(b.adjust,b.l[y],b.floor):X=b.adjust*b.l[y],Se=q.width[y],U=X/Se,z=ge,f=Se>>1,E=0;do{var S,ce;S=l[u]*l[u],E+=S,z+=S<U?S:U,u++,ce=l[u]*l[u],E+=ce,z+=ce<U?ce:U,u++}while(--f>0);if(E>X&&v++,y==T.SBPSY_l){var _e=X*F.nsPsy.longfact[y];z<_e&&(z=_e)}if(m!=0&&(X=z),!_.ATHonly){var Oe=B.en.l[y];if(Oe>0){var _e;_e=E*B.thm.l[y]*g/Oe,m!=0&&(_e*=F.nsPsy.longfact[y]),X<_e&&(X=_e)}}m!=0?w[c++]=X:w[c++]=X*F.nsPsy.longfact[y]}var Ue=575;if(q.block_type!=T.SHORT_TYPE)for(var je=576;je--!=0&&jn.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,Xe;for(_.VBR==Ei.vbr_rh||_.VBR==Ei.vbr_mtrh?Xe=athAdjust(b.adjust,b.s[ze],b.floor):Xe=b.adjust*b.s[ze],Se=q.width[y],nt=0;nt<3;nt++){var E=0,X,U,z,f=Se>>1;U=Xe/Se,z=ge;do{var S,ce;S=l[u]*l[u],E+=S,z+=S<U?S:U,u++,ce=l[u]*l[u],E+=ce,z+=ce<U?ce:U,u++}while(--f>0);if(E>Xe&&v++,ze==T.SBPSY_s){var _e=Xe*F.nsPsy.shortfact[ze];z<_e&&(z=_e)}if(m!=0?X=z:X=Xe,!_.ATHonly&&!_.ATHshort){var Oe=B.en.s[ze][nt];if(Oe>0){var _e;_e=E*B.thm.s[ze][nt]*g/Oe,m!=0&&(_e*=F.nsPsy.shortfact[ze]),X<_e&&(X=_e)}}m!=0?w[c++]=X:w[c++]=X*F.nsPsy.shortfact[ze]}_.useTemporal&&(w[c-3]>w[c-3+1]&&(w[c-3+1]+=(w[c-3]-w[c-3+1])*F.decay),w[c-3+1]>w[c-3+2]&&(w[c-3+2]+=(w[c-3+1]-w[c-3+2])*F.decay))}return v};function x(_){this.s=_}this.calc_noise_core=function(_,B,q,w){var c=0,F=B.s,y=_.l3_enc;if(F>_.count1)for(;q--!=0;){var u;u=_.xr[F],F++,c+=u*u,u=_.xr[F],F++,c+=u*u}else if(F>_.big_values){var v=wi(2);for(v[0]=0,v[1]=w;q--!=0;){var u;u=Math.abs(_.xr[F])-v[y[F]],F++,c+=u*u,u=Math.abs(_.xr[F])-v[y[F]],F++,c+=u*u}}else for(;q--!=0;){var u;u=Math.abs(_.xr[F])-a[y[F]]*w,F++,c+=u*u,u=Math.abs(_.xr[F])-a[y[F]]*w,F++,c+=u*u}return B.s=F,c},this.calc_noise=function(_,B,q,w,c){var F=0,y=0,u,v,b=0,l=0,m=0,g=-20,E=0,X=_.scalefac,U=0;for(w.over_SSD=0,u=0;u<_.psymax;u++){var z=_.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]==z)Se=c.noise[u],E+=_.width[u],q[F++]=Se/B[y++],Se=c.noise_log[u];else{var f=Z(z);if(v=_.width[u]>>1,E+_.width[u]>_.max_nonzero_coeff){var S;S=_.max_nonzero_coeff-E+1,S>0?v=S>>1:v=0}var ce=new x(E);Se=this.calc_noise_core(_,ce,v,f),E=ce.s,c!=null&&(c.step[u]=z,c.noise[u]=Se),Se=q[F++]=Se/B[y++],Se=n0.FAST_LOG10(Math.max(Se,1e-20)),c!=null&&(c.noise_log[u]=Se)}if(c!=null&&(c.global_gain=_.global_gain),m+=Se,Se>0){var _e;_e=Math.max(0|Se*10+.5,1),w.over_SSD+=_e*_e,b++,l+=Se}g=Math.max(g,Se)}return w.over_count=b,w.tot_noise=m,w.over_noise=l,w.max_noise=g,b},this.set_pinfo=function(_,B,q,w,c){var F=_.internal_flags,y,u,v,b,l,m=B.scalefac_scale==0?.5:1,g=B.scalefac,E=wi(L3Side.SFBMAX),X=wi(L3Side.SFBMAX),U=new CalcNoiseResult;calc_xmin(_,q,B,E),calc_noise(B,E,X,U,null);var z=0;for(u=B.sfb_lmax,B.block_type!=T.SHORT_TYPE&&B.mixed_block_flag==0&&(u=22),y=0;y<u;y++){var Se=F.scalefac_band.l[y],f=F.scalefac_band.l[y+1],S=f-Se;for(b=0;z<f;z++)b+=B.xr[z]*B.xr[z];b/=S,l=1e15,F.pinfo.en[w][c][y]=l*b,F.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,F.pinfo.thr[w][c][y]=l*Math.max(b*q.thm.l[y],F.ATH.l[y]),F.pinfo.LAMEsfb[w][c][y]=0,B.preflag!=0&&y>=11&&(F.pinfo.LAMEsfb[w][c][y]=-m*he[y]),y<T.SBPSY_l&&(zn(g[y]>=0),F.pinfo.LAMEsfb[w][c][y]-=m*g[y])}if(B.block_type==T.SHORT_TYPE)for(u=y,y=B.sfb_smin;y<T.SBMAX_s;y++)for(var Se=F.scalefac_band.s[y],f=F.scalefac_band.s[y+1],S=f-Se,ce=0;ce<3;ce++){for(b=0,v=Se;v<f;v++)b+=B.xr[z]*B.xr[z],z++;b=Math.max(b/S,1e-20),l=1e15,F.pinfo.en_s[w][c][3*y+ce]=l*b,F.pinfo.xfsf_s[w][c][3*y+ce]=l*E[u]*X[u]/S,q.en.s[y][ce]>0?b=b/q.en.s[y][ce]:b=0,(_.ATHonly||_.ATHshort)&&(b=0),F.pinfo.thr_s[w][c][3*y+ce]=l*Math.max(b*q.thm.s[y][ce],F.ATH.s[y]),F.pinfo.LAMEsfb_s[w][c][3*y+ce]=-2*B.subblock_gain[ce],y<T.SBPSY_s&&(F.pinfo.LAMEsfb_s[w][c][3*y+ce]-=m*g[u]),u++}F.pinfo.LAMEqss[w][c]=B.global_gain,F.pinfo.LAMEmainbits[w][c]=B.part2_3_length+B.part2_length,F.pinfo.LAMEsfbits[w][c]=B.part2_length,F.pinfo.over[w][c]=U.over_count,F.pinfo.max_noise[w][c]=U.max_noise*10,F.pinfo.over_noise[w][c]=U.over_noise*10,F.pinfo.tot_noise[w][c]=U.tot_noise*10,F.pinfo.over_SSD[w][c]=U.over_SSD}}var Jn=jr,td=N.System,rd=N.Arrays,qa=N.new_int,sn=N.assert;function i0(){var C=null;this.qupvt=null,this.setModules=function(u){this.qupvt=u,C=u};function $(u){this.bits=0|u}var re=[[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,v,b,l,m,g){var E=.5946/v;for(sn(u>0),u=u>>1;u--!=0;)m[g++]=E>b[l++]?0:1,m[g++]=E>b[l++]?0:1}function ge(u,v,b,l,m,g){sn(u>0),u=u>>1;var E=u%2;for(u=u>>1;u--!=0;){var X,U,z,Se,f,S,ce,_e;X=b[l++]*v,U=b[l++]*v,f=0|X,z=b[l++]*v,S=0|U,Se=b[l++]*v,ce=0|z,X+=C.adj43[f],_e=0|Se,U+=C.adj43[S],m[g++]=0|X,z+=C.adj43[ce],m[g++]=0|U,Se+=C.adj43[_e],m[g++]=0|z,m[g++]=0|Se}if(E!=0){var X,U,f,S;X=b[l++]*v,U=b[l++]*v,f=0|X,S=0|U,X+=C.adj43[f],U+=C.adj43[S],m[g++]=0|X,m[g++]=0|U}}function Q(u,v,b,l,m){var g,E,X=0,U,z=0,Se=0,f=0,S=v,ce=0,_e=S,Oe=0,Ue=u,je=0;for(U=m!=null&&l.global_gain==m.global_gain,l.block_type==T.SHORT_TYPE?E=38:E=21,g=0;g<=E;g++){var ze=-1;if((U||l.block_type==T.NORM_TYPE)&&(ze=l.global_gain-(l.scalefac[g]+(l.preflag!=0?C.pretab[g]:0)<<l.scalefac_scale+1)-l.subblock_gain[l.window[g]]*8),sn(l.width[g]>=0),U&&m.step[g]==ze)z!=0&&(ge(z,b,Ue,je,_e,Oe),z=0),Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0);else{var nt=l.width[g];if(X+l.width[g]>l.max_nonzero_coeff){var Xe;Xe=l.max_nonzero_coeff-X+1,rd.fill(v,l.max_nonzero_coeff,576,0),nt=Xe,nt<0&&(nt=0),g=E+1}if(z==0&&Se==0&&(_e=S,Oe=ce,Ue=u,je=f),m!=null&&m.sfb_count1>0&&g>=m.sfb_count1&&m.step[g]>0&&ze>=m.step[g]?(z!=0&&(ge(z,b,Ue,je,_e,Oe),z=0,_e=S,Oe=ce,Ue=u,je=f),Se+=nt):(Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0,_e=S,Oe=ce,Ue=u,je=f),z+=nt),nt<=0){Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0),z!=0&&(ge(z,b,Ue,je,_e,Oe),z=0);break}}g<=E&&(ce+=l.width[g],f+=l.width[g],X+=l.width[g])}z!=0&&(ge(z,b,Ue,je,_e,Oe),z=0),Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0)}function ve(u,v,b){var l=0,m=0;do{var g=u[v++],E=u[v++];l<g&&(l=g),m<E&&(m=E)}while(v<b);return l<m&&(l=m),l}function Be(u,v,b,l,m,g){var E=bt.ht[l].xlen*65536+bt.ht[m].xlen,X=0,U;do{var z=u[v++],Se=u[v++];z!=0&&(z>14&&(z=15,X+=E),z*=16),Se!=0&&(Se>14&&(Se=15,X+=E),z+=Se),X+=bt.largetbl[z]}while(v<b);return U=X&65535,X>>=16,X>U&&(X=U,l=m),g.bits+=X,l}function De(u,v,b,l){var m=0,g=bt.ht[1].hlen;do{var E=u[v+0]*2+u[v+1];v+=2,m+=g[E]}while(v<b);return l.bits+=m,1}function j(u,v,b,l,m){var g=0,E,X=bt.ht[l].xlen,U;l==2?U=bt.table23:U=bt.table56;do{var z=u[v+0]*X+u[v+1];v+=2,g+=U[z]}while(v<b);return E=g&65535,g>>=16,g>E&&(g=E,l++),m.bits+=g,l}function fe(u,v,b,l,m){var g=0,E=0,X=0,U=bt.ht[l].xlen,z=bt.ht[l].hlen,Se=bt.ht[l+1].hlen,f=bt.ht[l+2].hlen;do{var S=u[v+0]*U+u[v+1];v+=2,g+=z[S],E+=Se[S],X+=f[S]}while(v<b);var ce=l;return g>E&&(g=E,ce++),g>X&&(g=X,ce=l+2),m.bits+=g,ce}var he=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function M(u,v,b,l){var m=ve(u,v,b);switch(m){case 0:return m;case 1:return De(u,v,b,l);case 2:case 3:return j(u,v,b,he[m-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 fe(u,v,b,he[m-1],l);default:if(m>Jn.IXMAX_VAL)return l.bits=Jn.LARGE_BITS,-1;m-=15;var g;for(g=24;g<32&&!(bt.ht[g].linmax>=m);g++);var E;for(E=g-8;E<24&&!(bt.ht[E].linmax>=m);E++);return Be(u,v,b,E,g,l)}}this.noquant_count_bits=function(u,v,b){var l=v.l3_enc,m=Math.min(576,v.max_nonzero_coeff+2>>1<<1);for(b!=null&&(b.sfb_count1=0);m>1&&(l[m-1]|l[m-2])==0;m-=2);v.count1=m;for(var g=0,E=0;m>3;m-=4){var X;if(((l[m-1]|l[m-2]|l[m-3]|l[m-4])&2147483647)>1)break;X=((l[m-4]*2+l[m-3])*2+l[m-2])*2+l[m-1],g+=bt.t32l[X],E+=bt.t33l[X]}var U=g;if(v.count1table_select=0,g>E&&(U=E,v.count1table_select=1),v.count1bits=U,v.big_values=m,m==0)return U;if(v.block_type==T.SHORT_TYPE)g=3*u.scalefac_band.s[3],g>v.big_values&&(g=v.big_values),E=v.big_values;else if(v.block_type==T.NORM_TYPE){if(sn(m<=576),g=v.region0_count=u.bv_scf[m-2],E=v.region1_count=u.bv_scf[m-1],sn(g+E+2<T.SBPSY_l),E=u.scalefac_band.l[g+E+2],g=u.scalefac_band.l[g+1],E<m){var z=new $(U);v.table_select[2]=M(l,E,m,z),U=z.bits}}else v.region0_count=7,v.region1_count=T.SBMAX_l-1-7-1,g=u.scalefac_band.l[7+1],E=m,g>E&&(g=E);if(g=Math.min(g,m),E=Math.min(E,m),sn(g>=0),sn(E>=0),0<g){var z=new $(U);v.table_select[0]=M(l,0,g,z),U=z.bits}if(g<E){var z=new $(U);v.table_select[1]=M(l,g,E,z),U=z.bits}if(u.use_best_huffman==2&&(v.part2_3_length=U,best_huffman_divide(u,v),U=v.part2_3_length),b!=null&&v.block_type==T.NORM_TYPE){for(var Se=0;u.scalefac_band.l[Se]<v.big_values;)Se++;b.sfb_count1=Se}return U},this.count_bits=function(u,v,b,l){var m=b.l3_enc,g=Jn.IXMAX_VAL/C.IPOW20(b.global_gain);if(b.xrpow_max>g)return Jn.LARGE_BITS;if(Q(v,m,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),z=0;z<b.sfbmax;z++){var Se=b.width[z];if(sn(Se>=0),u.pseudohalf[z]==0)E+=Se;else{var f;for(f=E,E+=Se;f<E;++f)m[f]=v[f]>=U?m[f]:0}}return this.noquant_count_bits(u,b,l)};function K(u,v,b,l,m,g,E){for(var X=v.big_values,U=0;U<=7+15;U++)l[U]=Jn.LARGE_BITS;for(var U=0;U<16;U++){var z=u.scalefac_band.l[U+1];if(z>=X)break;var Se=0,f=new $(Se),S=M(b,0,z,f);Se=f.bits;for(var ce=0;ce<8;ce++){var _e=u.scalefac_band.l[U+ce+2];if(_e>=X)break;var Oe=Se;f=new $(Oe);var Ue=M(b,z,_e,f);Oe=f.bits,l[U+ce]>Oe&&(l[U+ce]=Oe,m[U+ce]=U,g[U+ce]=S,E[U+ce]=Ue)}}}function a(u,v,b,l,m,g,E,X){for(var U=v.big_values,z=2;z<T.SBMAX_l+1;z++){var Se=u.scalefac_band.l[z];if(Se>=U)break;var f=m[z-2]+v.count1bits;if(b.part2_3_length<=f)break;var S=new $(f),ce=M(l,Se,U,S);f=S.bits,!(b.part2_3_length<=f)&&(b.assign(v),b.part2_3_length=f,b.region0_count=g[z-2],b.region1_count=z-2-g[z-2],b.table_select[0]=E[z-2],b.table_select[1]=X[z-2],b.table_select[2]=ce)}}this.best_huffman_divide=function(u,v){var b=new Do,l=v.l3_enc,m=qa(7+15+1),g=qa(7+15+1),E=qa(7+15+1),X=qa(7+15+1);if(!(v.block_type==T.SHORT_TYPE&&u.mode_gr==1)){b.assign(v),v.block_type==T.NORM_TYPE&&(K(u,v,l,m,g,E,X),a(u,b,v,l,m,g,E,X));var U=b.big_values;if(!(U==0||(l[U-2]|l[U-1])>1)&&(U=v.count1+2,!(U>576))){b.assign(v),b.count1=U;var z=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];z+=bt.t32l[f],Se+=bt.t33l[f]}if(b.big_values=U,b.count1table_select=0,z>Se&&(z=Se,b.count1table_select=1),b.count1bits=z,b.block_type==T.NORM_TYPE)a(u,b,v,l,m,g,E,X);else{if(b.part2_3_length=z,z=u.scalefac_band.l[7+1],z>U&&(z=U),z>0){var S=new $(b.part2_3_length);b.table_select[0]=M(l,0,z,S),b.part2_3_length=S.bits}if(U>z){var S=new $(b.part2_3_length);b.table_select[1]=M(l,z,U,S),b.part2_3_length=S.bits}v.part2_3_length>b.part2_3_length&&v.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],D=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],x=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];i0.slen1_tab=D,i0.slen2_tab=x;function _(u,v){for(var b,l=v.tt[1][u],m=v.tt[0][u],g=0;g<bt.scfsi_band.length-1;g++){for(b=bt.scfsi_band[g];b<bt.scfsi_band[g+1]&&!(m.scalefac[b]!=l.scalefac[b]&&l.scalefac[b]>=0);b++);if(b==bt.scfsi_band[g+1]){for(b=bt.scfsi_band[g];b<bt.scfsi_band[g+1];b++)l.scalefac[b]=-1;v.scfsi[u][g]=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,z=0;b<T.SBPSY_l;b++)l.scalefac[b]!=-1&&(z++,U<l.scalefac[b]&&(U=l.scalefac[b]));for(var g=0;g<16;g++)if(E<I[g]&&U<H[g]){var Se=D[g]*X+x[g]*z;l.part2_length>Se&&(l.part2_length=Se,l.scalefac_compress=g)}}this.best_scalefac_store=function(u,v,b,l){var m=l.tt[v][b],g,E,X,U,z=0;for(X=0,g=0;g<m.sfbmax;g++){var Se=m.width[g];for(sn(Se>=0),X+=Se,U=-Se;U<0&&m.l3_enc[U+X]==0;U++);U==0&&(m.scalefac[g]=z=-2)}if(m.scalefac_scale==0&&m.preflag==0){var f=0;for(g=0;g<m.sfbmax;g++)m.scalefac[g]>0&&(f|=m.scalefac[g]);if((f&1)==0&&f!=0){for(g=0;g<m.sfbmax;g++)m.scalefac[g]>0&&(m.scalefac[g]>>=1);m.scalefac_scale=z=1}}if(m.preflag==0&&m.block_type!=T.SHORT_TYPE&&u.mode_gr==2){for(g=11;g<T.SBPSY_l&&!(m.scalefac[g]<C.pretab[g]&&m.scalefac[g]!=-2);g++);if(g==T.SBPSY_l){for(g=11;g<T.SBPSY_l;g++)m.scalefac[g]>0&&(m.scalefac[g]-=C.pretab[g]);m.preflag=z=1}}for(E=0;E<4;E++)l.scfsi[b][E]=0;for(u.mode_gr==2&&v==1&&l.tt[0][b].block_type!=T.SHORT_TYPE&&l.tt[1][b].block_type!=T.SHORT_TYPE&&(_(b,l),z=0),g=0;g<m.sfbmax;g++)m.scalefac[g]==-2&&(m.scalefac[g]=0);z!=0&&(u.mode_gr==2?this.scale_bitcount(m):this.scale_bitcount_lsf(u,m))};function B(u,v){for(var b=0;b<v;++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 v,b,l=0,m=0,g,E=u.scalefac;if(sn(B(E,u.sfbmax)),u.block_type==T.SHORT_TYPE)g=q,u.mixed_block_flag!=0&&(g=w);else if(g=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++)m<E[b]&&(m=E[b]);for(u.part2_length=Jn.LARGE_BITS,v=0;v<16;v++)l<I[v]&&m<H[v]&&u.part2_length>g[v]&&(u.part2_length=g[v],u.scalefac_compress=v);return u.part2_length==Jn.LARGE_BITS};var F=[[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,v){var b,l,m,g,E,X,U,z,Se=qa(4),f=v.scalefac;for(v.preflag!=0?b=2:b=0,U=0;U<4;U++)Se[U]=0;if(v.block_type==T.SHORT_TYPE){l=1;var S=C.nr_of_sfb_block[b][l];for(z=0,m=0;m<4;m++)for(g=S[m]/3,U=0;U<g;U++,z++)for(E=0;E<3;E++)f[z*3+E]>Se[m]&&(Se[m]=f[z*3+E])}else{l=0;var S=C.nr_of_sfb_block[b][l];for(z=0,m=0;m<4;m++)for(g=S[m],U=0;U<g;U++,z++)f[z]>Se[m]&&(Se[m]=f[z])}for(X=!1,m=0;m<4;m++)Se[m]>F[b][m]&&(X=!0);if(!X){var ce,_e,Oe,Ue;for(v.sfb_partition_table=C.nr_of_sfb_block[b][l],m=0;m<4;m++)v.slen[m]=y[Se[m]];switch(ce=v.slen[0],_e=v.slen[1],Oe=v.slen[2],Ue=v.slen[3],b){case 0:v.scalefac_compress=(ce*5+_e<<4)+(Oe<<2)+Ue;break;case 1:v.scalefac_compress=400+(ce*5+_e<<2)+Oe;break;case 2:v.scalefac_compress=500+ce*3+_e;break;default:td.err.printf(`intensity stereo not implemented yet
|
|
2
|
-
`);break}}if(!X)for(sn(
|
|
3
|
-
`)}}function
|
|
4
|
-
`),b}this.flush_bitstream=function(y){var u=y.internal_flags,
|
|
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:
|
|
5
5
|
l3_side.main_data_begin: %d
|
|
6
6
|
Resvoir size: %d
|
|
7
7
|
resv drain (post) %d
|
|
@@ -10,28 +10,53 @@ header and sideinfo: %d
|
|
|
10
10
|
data bits: %d
|
|
11
11
|
total bits: %d (remainder: %d)
|
|
12
12
|
bitsperframe: %d
|
|
13
|
-
`,8*
|
|
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,Xe,je=Ue/31;S.highpass2>S.highpass1?nt=x((S.highpass2-je)/(S.highpass2-S.highpass1+1e-20)):nt=1,S.lowpass2>S.lowpass1?Xe=x((je-S.lowpass1)/(S.lowpass2-S.lowpass1+1e-20)):Xe=1,S.amp_filter[Ue]=nt*Xe}}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=T1([16,4+1]),S.bitrate_blockType_Hist=T1([16,4+1+1]),S.PeakSample=0,f.bWriteVbrTag&&j.InitVbrTag(f)}this.lame_init_params=function(f){var S=f.internal_flags;if(S.Class_ID=0,S.ATH==null&&(S.ATH=new Kf),S.PSY==null&&(S.PSY=new K),S.rgdata==null&&(S.rgdata=new Yf),S.channels_in=f.num_channels,S.channels_in==1&&(f.mode=rr.MONO),S.channels_out=f.mode==rr.MONO?1:2,S.mode_ext=T.MPG_MD_MS_LR,f.mode==rr.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&&ei.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=B(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 ce=16e3;switch(f.VBR){case Dt.vbr_off:{var _e=new a;c(_e,f.brate),ce=_e.lowerlimit;break}case Dt.vbr_abr:{var _e=new a;c(_e,f.VBR_mean_bitrate_kbps),ce=_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;ce=linear_int(Ue,je,ze)}else ce=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;ce=linear_int(Ue,je,ze)}else ce=19500}}f.mode==rr.MONO&&(f.VBR==Dt.vbr_off||f.VBR==Dt.vbr_abr)&&(ce*=1.5),f.lowpassfreq=ce|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)==Ga.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==rr.NOT_SET&&(f.mode=rr.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),F(f),S.samplerate_index=B(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),ge.init_bit_stream_w(S);for(var Xe=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]=ve.sfBandIndex[Xe].l[Ve];for(var Ve=0;Ve<T.PSFB21+1;Ve++){var gt=(S.scalefac_band.l[22]-S.scalefac_band.l[21])/T.PSFB21,Ft=S.scalefac_band.l[21]+Ve*gt;S.scalefac_band.psfb21[Ve]=Ft}S.scalefac_band.psfb21[T.PSFB21]=576;for(var Ve=0;Ve<T.SBMAX_s+1;Ve++)S.scalefac_band.s[Ve]=ve.sfBandIndex[Xe].s[Ve];for(var Ve=0;Ve<T.PSFB12+1;Ve++){var gt=(S.scalefac_band.s[13]-S.scalefac_band.s[12])/T.PSFB12,Ft=S.scalefac_band.s[12]+Ve*gt;S.scalefac_band.psfb12[Ve]=Ft}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(Be);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(Be);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 Jf(Be):S.iteration_loop=new ABRIterationLoop(Be);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=o0.short_block_allowed),f.short_blocks==o0.short_block_allowed&&(f.mode==rr.JOINT_STEREO||f.mode==rr.STEREO)&&(f.short_blocks=o0.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),ve.iteration_init(f),De.psymodel_init(f),Gr(f.scale>=0),0};function v(f,S){(f.in_buffer_0==null||f.in_buffer_nsamples<S)&&(f.in_buffer_0=Ri(S),f.in_buffer_1=Ri(S),f.in_buffer_nsamples=S)}this.lame_encode_flush=function(f,S,ce,_e){var Oe=f.internal_flags,Ue=ld([2,1152]),je=0,ze,nt,Xe,Ve,gt=Oe.mf_samples_to_encode-T.POSTDELAY,Ft=b(f);if(Oe.mf_samples_to_encode<1)return 0;for(ze=0,f.in_samplerate!=f.out_samplerate&&(gt+=16*f.out_samplerate/f.in_samplerate),Xe=f.framesize-gt%f.framesize,Xe<576&&(Xe+=f.framesize),f.encoder_padding=Xe,Ve=(gt+Xe)/f.framesize;Ve>0&&je>=0;){var Rt=Ft-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,ce,nt),ce+=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),ge.flush_bitstream(f),je=ge.copy_buffer(Oe,S,ce,nt,1),je<0))return je;if(ce+=je,ze+=je,nt=_e-ze,_e==0&&(nt=0),f.write_id3tag_automatic){if(he.id3tag_write_v1(f),je=ge.copy_buffer(Oe,S,ce,nt,0),je<0)return je;ze+=je}return ze},this.lame_encode_buffer=function(f,S,ce,_e,Oe,Ue,je){var ze=f.internal_flags,nt=[null,null];if(ze.Class_ID!=H)return-3;if(_e==0)return 0;v(ze,_e),nt[0]=ze.in_buffer_0,nt[1]=ze.in_buffer_1;for(var Xe=0;Xe<_e;Xe++)nt[0][Xe]=S[Xe],ze.channels_in>1&&(nt[1][Xe]=ce[Xe]);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,ce,_e,Oe,Ue,je){var ze=f.internal_flags,nt=0,Xe,Ve,gt,Ft,Rt,Lt=[null,null],jt=[null,null];if(ze.Class_ID!=H)return-3;if(_e==0)return 0;if(Rt=ge.copy_buffer(ze,Oe,Ue,je,0),Rt<0)return Rt;if(Ue+=Rt,nt+=Rt,jt[0]=S,jt[1]=ce,ei.NEQ(f.scale,0)&&ei.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(ei.NEQ(f.scale_left,0)&&ei.NEQ(f.scale_left,1))for(Ve=0;Ve<_e;++Ve)jt[0][Ve]*=f.scale_left;if(ei.NEQ(f.scale_right,0)&&ei.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;Ft=b(f),Lt[0]=ze.mfbuf[0],Lt[1]=ze.mfbuf[1];for(var Kt=0;_e>0;){var pr=[null,null],Fn=0,Lr=0;pr[0]=jt[0],pr[1]=jt[1];var kr=new g;if(Se(f,Lt,pr,Kt,_e,kr),Fn=kr.n_in,Lr=kr.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)==Ga.GAIN_ANALYSIS_ERROR)return-6;if(_e-=Fn,Kt+=Fn,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>=Ft){var _n=je-nt;if(je==0&&(_n=0),Xe=m(f,Lt[0],Lt[1],Oe,Ue,_n),Xe<0)return Xe;for(Ue+=Xe,nt+=Xe,ze.mf_size-=f.framesize,ze.mf_samples_to_encode-=f.framesize,gt=0;gt<ze.channels_out;gt++)for(Ve=0;Ve<ze.mf_size;Ve++)Lt[gt][Ve]=Lt[gt][Ve+f.framesize]}}return Gr(_e==0),nt}function m(f,S,ce,_e,Oe,Ue){var je=C.enc.lame_encode_mp3_frame(f,S,ce,_e,Oe,Ue);return f.frameNum++,je}function g(){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,ce){var _e=Math.PI*S;f/=ce,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(ce*_e*Oe)/(Math.PI*ce*Oe)}function z(f,S,ce,_e,Oe,Ue,je,ze,nt){var Xe=f.internal_flags,Ve,gt=0,Ft,Rt=f.out_samplerate/X(f.out_samplerate,f.in_samplerate);Rt>Bt.BPC&&(Rt=Bt.BPC);var Lt=Math.abs(Xe.resample_ratio-Math.floor(.5+Xe.resample_ratio))<1e-4?1:0,jt=1/Xe.resample_ratio;jt>1&&(jt=1);var Kt=31;Kt%2==0&&--Kt,Kt+=Lt;var pr=Kt+1;if(Xe.fill_buffer_resample_init==0){for(Xe.inbuf_old[0]=Ri(pr),Xe.inbuf_old[1]=Ri(pr),Ve=0;Ve<=2*Rt;++Ve)Xe.blackfilt[Ve]=Ri(pr);for(Xe.itime[0]=0,Xe.itime[1]=0,gt=0;gt<=2*Rt;gt++){var Fn=0,Lr=(gt-Rt)/(2*Rt);for(Ve=0;Ve<=Kt;Ve++)Fn+=Xe.blackfilt[gt][Ve]=U(Ve-Lr,jt,Kt);for(Ve=0;Ve<=Kt;Ve++)Xe.blackfilt[gt][Ve]/=Fn}Xe.fill_buffer_resample_init=1}var kr=Xe.inbuf_old[nt];for(Ft=0;Ft<_e;Ft++){var _n,Ti;if(_n=Ft*Xe.resample_ratio,gt=0|Math.floor(_n-Xe.itime[nt]),Kt+gt-Kt/2>=je)break;var Lr=_n-Xe.itime[nt]-(gt+.5*(Kt%2));Gr(Math.abs(Lr)<=.501),Ti=0|Math.floor(Lr*2*Rt+Rt+.5);var Ai=0;for(Ve=0;Ve<=Kt;++Ve){var Sn=Ve+gt-Kt/2,Cr;Gr(Sn<je),Gr(Sn+pr>=0),Cr=Sn<0?kr[pr+Sn]:Oe[Ue+Sn],Ai+=Cr*Xe.blackfilt[Ti][Ve]}S[ce+Ft]=Ai}if(ze.num_used=Math.min(je,Kt+gt-Kt/2),Xe.itime[nt]+=ze.num_used-Ft*Xe.resample_ratio,ze.num_used>=pr)for(Ve=0;Ve<pr;Ve++)kr[Ve]=Oe[Ue+ze.num_used+Ve-pr];else{var ri=pr-ze.num_used;for(Ve=0;Ve<ri;++Ve)kr[Ve]=kr[Ve+ze.num_used];for(gt=0;Ve<pr;++Ve,++gt)kr[Ve]=Oe[Ue+gt];Gr(gt==ze.num_used)}return Ft}function Se(f,S,ce,_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=z(f,S[ze],je.mf_size,f.framesize,ce[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 Xe=0;Xe<Ue.n_out;++Xe)S[0][je.mf_size+Xe]=ce[0][_e+Xe],je.channels_out==2&&(S[1][je.mf_size+Xe]=ce[1][_e+Xe])}}}var cd=tr,Dn=N.VbrMode;function ud(){function C(j,fe,he,M,K,a,I,H,D,x,_,B,q,w,c){this.vbr_q=j,this.quant_comp=fe,this.quant_comp_s=he,this.expY=M,this.st_lrm=K,this.st_s=a,this.masking_adj=I,this.masking_adj_short=H,this.ath_lower=D,this.ath_curve=x,this.ath_sensitivity=_,this.interch=B,this.safejoint=q,this.sfb21mod=w,this.msfix=c}function $(j,fe,he,M,K,a,I,H,D,x,_,B,q,w){this.quant_comp=fe,this.quant_comp_s=he,this.safejoint=M,this.nsmsfix=K,this.st_lrm=a,this.st_s=I,this.nsbass=H,this.scale=D,this.masking_adj=x,this.ath_lower=_,this.ath_curve=B,this.interch=q,this.sfscale=w}var re;this.setModules=function(j){re=j};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)],ge=[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(j,fe,he){var M=j.VBR==Dn.vbr_rh?Z:ge,K=j.VBR_q_frac,a=M[fe],I=M[fe+1],H=a;a.st_lrm=a.st_lrm+K*(I.st_lrm-a.st_lrm),a.st_s=a.st_s+K*(I.st_s-a.st_s),a.masking_adj=a.masking_adj+K*(I.masking_adj-a.masking_adj),a.masking_adj_short=a.masking_adj_short+K*(I.masking_adj_short-a.masking_adj_short),a.ath_lower=a.ath_lower+K*(I.ath_lower-a.ath_lower),a.ath_curve=a.ath_curve+K*(I.ath_curve-a.ath_curve),a.ath_sensitivity=a.ath_sensitivity+K*(I.ath_sensitivity-a.ath_sensitivity),a.interch=a.interch+K*(I.interch-a.interch),a.msfix=a.msfix+K*(I.msfix-a.msfix),De(j,H.vbr_q),he!=0?j.quant_comp=H.quant_comp:Math.abs(j.quant_comp- -1)>0||(j.quant_comp=H.quant_comp),he!=0?j.quant_comp_short=H.quant_comp_s:Math.abs(j.quant_comp_short- -1)>0||(j.quant_comp_short=H.quant_comp_s),H.expY!=0&&(j.experimentalY=H.expY!=0),he!=0?j.internal_flags.nsPsy.attackthre=H.st_lrm:Math.abs(j.internal_flags.nsPsy.attackthre- -1)>0||(j.internal_flags.nsPsy.attackthre=H.st_lrm),he!=0?j.internal_flags.nsPsy.attackthre_s=H.st_s:Math.abs(j.internal_flags.nsPsy.attackthre_s- -1)>0||(j.internal_flags.nsPsy.attackthre_s=H.st_s),he!=0?j.maskingadjust=H.masking_adj:Math.abs(j.maskingadjust-0)>0||(j.maskingadjust=H.masking_adj),he!=0?j.maskingadjust_short=H.masking_adj_short:Math.abs(j.maskingadjust_short-0)>0||(j.maskingadjust_short=H.masking_adj_short),he!=0?j.ATHlower=-H.ath_lower/10:Math.abs(-j.ATHlower*10-0)>0||(j.ATHlower=-H.ath_lower/10),he!=0?j.ATHcurve=H.ath_curve:Math.abs(j.ATHcurve- -1)>0||(j.ATHcurve=H.ath_curve),he!=0?j.athaa_sensitivity=H.ath_sensitivity:Math.abs(j.athaa_sensitivity- -1)>0||(j.athaa_sensitivity=H.ath_sensitivity),H.interch>0&&(he!=0?j.interChRatio=H.interch:Math.abs(j.interChRatio- -1)>0||(j.interChRatio=H.interch)),H.safejoint>0&&(j.exp_nspsytune=j.exp_nspsytune|H.safejoint),H.sfb21mod>0&&(j.exp_nspsytune=j.exp_nspsytune|H.sfb21mod<<20),he!=0?j.msfix=H.msfix:Math.abs(j.msfix- -1)>0||(j.msfix=H.msfix),he==0&&(j.VBR_q=fe,j.VBR_q_frac=K)}var ve=[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 Be(j,fe,he){var M=fe,K=re.nearestBitrateFullIndex(fe);if(j.VBR=Dn.vbr_abr,j.VBR_mean_bitrate_kbps=M,j.VBR_mean_bitrate_kbps=Math.min(j.VBR_mean_bitrate_kbps,320),j.VBR_mean_bitrate_kbps=Math.max(j.VBR_mean_bitrate_kbps,8),j.brate=j.VBR_mean_bitrate_kbps,j.VBR_mean_bitrate_kbps>320&&(j.disable_reservoir=!0),ve[K].safejoint>0&&(j.exp_nspsytune=j.exp_nspsytune|2),ve[K].sfscale>0&&(j.internal_flags.noise_shaping=2),Math.abs(ve[K].nsbass)>0){var a=int(ve[K].nsbass*4);a<0&&(a+=64),j.exp_nspsytune=j.exp_nspsytune|a<<2}return he!=0?j.quant_comp=ve[K].quant_comp:Math.abs(j.quant_comp- -1)>0||(j.quant_comp=ve[K].quant_comp),he!=0?j.quant_comp_short=ve[K].quant_comp_s:Math.abs(j.quant_comp_short- -1)>0||(j.quant_comp_short=ve[K].quant_comp_s),he!=0?j.msfix=ve[K].nsmsfix:Math.abs(j.msfix- -1)>0||(j.msfix=ve[K].nsmsfix),he!=0?j.internal_flags.nsPsy.attackthre=ve[K].st_lrm:Math.abs(j.internal_flags.nsPsy.attackthre- -1)>0||(j.internal_flags.nsPsy.attackthre=ve[K].st_lrm),he!=0?j.internal_flags.nsPsy.attackthre_s=ve[K].st_s:Math.abs(j.internal_flags.nsPsy.attackthre_s- -1)>0||(j.internal_flags.nsPsy.attackthre_s=ve[K].st_s),he!=0?j.scale=ve[K].scale:Math.abs(j.scale- -1)>0||(j.scale=ve[K].scale),he!=0?j.maskingadjust=ve[K].masking_adj:Math.abs(j.maskingadjust-0)>0||(j.maskingadjust=ve[K].masking_adj),ve[K].masking_adj>0?he!=0?j.maskingadjust_short=ve[K].masking_adj*.9:Math.abs(j.maskingadjust_short-0)>0||(j.maskingadjust_short=ve[K].masking_adj*.9):he!=0?j.maskingadjust_short=ve[K].masking_adj*1.1:Math.abs(j.maskingadjust_short-0)>0||(j.maskingadjust_short=ve[K].masking_adj*1.1),he!=0?j.ATHlower=-ve[K].ath_lower/10:Math.abs(-j.ATHlower*10-0)>0||(j.ATHlower=-ve[K].ath_lower/10),he!=0?j.ATHcurve=ve[K].ath_curve:Math.abs(j.ATHcurve- -1)>0||(j.ATHcurve=ve[K].ath_curve),he!=0?j.interChRatio=ve[K].interch:Math.abs(j.interChRatio- -1)>0||(j.interChRatio=ve[K].interch),fe}this.apply_preset=function(j,fe,he){switch(fe){case At.R3MIX:{fe=At.V3,j.VBR=Dn.vbr_mtrh;break}case At.MEDIUM:{fe=At.V4,j.VBR=Dn.vbr_rh;break}case At.MEDIUM_FAST:{fe=At.V4,j.VBR=Dn.vbr_mtrh;break}case At.STANDARD:{fe=At.V2,j.VBR=Dn.vbr_rh;break}case At.STANDARD_FAST:{fe=At.V2,j.VBR=Dn.vbr_mtrh;break}case At.EXTREME:{fe=At.V0,j.VBR=Dn.vbr_rh;break}case At.EXTREME_FAST:{fe=At.V0,j.VBR=Dn.vbr_mtrh;break}case At.INSANE:return fe=320,j.preset=fe,Be(j,fe,he),j.VBR=Dn.vbr_off,fe}switch(j.preset=fe,fe){case At.V9:return Q(j,9,he),fe;case At.V8:return Q(j,8,he),fe;case At.V7:return Q(j,7,he),fe;case At.V6:return Q(j,6,he),fe;case At.V5:return Q(j,5,he),fe;case At.V4:return Q(j,4,he),fe;case At.V3:return Q(j,3,he),fe;case At.V2:return Q(j,2,he),fe;case At.V1:return Q(j,1,he),fe;case At.V0:return Q(j,0,he),fe;default:break}return 8<=fe&&fe<=320?Be(j,fe,he):(j.preset=0,fe)};function De(j,fe){var he=0;return 0>fe&&(he=-1,fe=0),9<fe&&(he=-1,fe=9),j.VBR_q=fe,j.VBR_q_frac=0,he}}var fd=ud;function dd(){var C,$;this.setModules=function(re,Z){C=re,$=Z}}var vd=dd;function md(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}var s0=md,A1=N.new_float,hd=N.new_int;function pd(){this.global_gain=0,this.sfb_count1=0,this.step=hd(39),this.noise=A1(39),this.noise_log=A1(39)}var _d=pd,ti=N.System,I1=N.VbrMode,l0=N.Util,ea=N.Arrays,za=N.new_float,ln=N.assert;function Sd(){var C;this.rv=null;var $;this.qupvt=null;var re,Z=new vd,ge;this.setModules=function(D,x,_,B){C=D,$=x,this.rv=x,re=_,this.qupvt=_,ge=B,Z.setModules(re,ge)},this.ms_convert=function(D,x){for(var _=0;_<576;++_){var B=D.tt[x][0].xr[_],q=D.tt[x][1].xr[_];D.tt[x][0].xr[_]=(B+q)*(l0.SQRT2*.5),D.tt[x][1].xr[_]=(B-q)*(l0.SQRT2*.5)}};function Q(D,x,_,B){B=0;for(var q=0;q<=_;++q){var w=Math.abs(D.xr[q]);B+=w,x[q]=Math.sqrt(w*Math.sqrt(w)),x[q]>D.xrpow_max&&(D.xrpow_max=x[q])}return B}this.init_xrpow=function(D,x,_){var B=0,q=0|x.max_nonzero_coeff;if(ln(_!=null),x.xrpow_max=0,ln(0<=q&&q<=575),ea.fill(_,q,576,0),B=Q(x,_,q,B),B>1e-20){var w=0;(D.substep_shaping&2)!=0&&(w=1);for(var c=0;c<x.psymax;c++)D.pseudohalf[c]=w;return!0}return ea.fill(x.l3_enc,0,576,0),!1};function ve(D,x){var _=D.ATH,B=x.xr;if(x.block_type!=T.SHORT_TYPE)for(var q=!1,w=T.PSFB21-1;w>=0&&!q;w--){var c=D.scalefac_band.psfb21[w],F=D.scalefac_band.psfb21[w+1],y=re.athAdjust(_.adjust,_.psfb21[w],_.floor);D.nsPsy.longfact[21]>1e-12&&(y*=D.nsPsy.longfact[21]);for(var u=F-1;u>=c;u--)if(Math.abs(B[u])<y)B[u]=0;else{q=!0;break}}else for(var v=0;v<3;v++)for(var q=!1,w=T.PSFB12-1;w>=0&&!q;w--){var c=D.scalefac_band.s[12]*3+(D.scalefac_band.s[13]-D.scalefac_band.s[12])*v+(D.scalefac_band.psfb12[w]-D.scalefac_band.psfb12[0]),F=c+(D.scalefac_band.psfb12[w+1]-D.scalefac_band.psfb12[w]),b=re.athAdjust(_.adjust,_.psfb12[w],_.floor);D.nsPsy.shortfact[12]>1e-12&&(b*=D.nsPsy.shortfact[12]);for(var u=F-1;u>=c;u--)if(Math.abs(B[u])<b)B[u]=0;else{q=!0;break}}}this.init_outer_loop=function(D,x){x.part2_3_length=0,x.big_values=0,x.count1=0,x.global_gain=210,x.scalefac_compress=0,x.table_select[0]=0,x.table_select[1]=0,x.table_select[2]=0,x.subblock_gain[0]=0,x.subblock_gain[1]=0,x.subblock_gain[2]=0,x.subblock_gain[3]=0,x.region0_count=0,x.region1_count=0,x.preflag=0,x.scalefac_scale=0,x.count1table_select=0,x.part2_length=0,x.sfb_lmax=T.SBPSY_l,x.sfb_smin=T.SBPSY_s,x.psy_lmax=D.sfb21_extra?T.SBMAX_l:T.SBPSY_l,x.psymax=x.psy_lmax,x.sfbmax=x.sfb_lmax,x.sfbdivide=11;for(var _=0;_<T.SBMAX_l;_++)x.width[_]=D.scalefac_band.l[_+1]-D.scalefac_band.l[_],x.window[_]=3;if(x.block_type==T.SHORT_TYPE){var B=za(576);x.sfb_smin=0,x.sfb_lmax=0,x.mixed_block_flag!=0&&(x.sfb_smin=3,x.sfb_lmax=D.mode_gr*2+4),x.psymax=x.sfb_lmax+3*((D.sfb21_extra?T.SBMAX_s:T.SBPSY_s)-x.sfb_smin),x.sfbmax=x.sfb_lmax+3*(T.SBPSY_s-x.sfb_smin),x.sfbdivide=x.sfbmax-18,x.psy_lmax=x.sfb_lmax;var q=D.scalefac_band.l[x.sfb_lmax];ti.arraycopy(x.xr,0,B,0,576);for(var _=x.sfb_smin;_<T.SBMAX_s;_++)for(var w=D.scalefac_band.s[_],c=D.scalefac_band.s[_+1],F=0;F<3;F++)for(var y=w;y<c;y++)x.xr[q++]=B[3*y+F];for(var u=x.sfb_lmax,_=x.sfb_smin;_<T.SBMAX_s;_++)x.width[u]=x.width[u+1]=x.width[u+2]=D.scalefac_band.s[_+1]-D.scalefac_band.s[_],x.window[u]=0,x.window[u+1]=1,x.window[u+2]=2,u+=3}x.count1bits=0,x.sfb_partition_table=re.nr_of_sfb_block[0][0],x.slen[0]=0,x.slen[1]=0,x.slen[2]=0,x.slen[3]=0,x.max_nonzero_coeff=575,ea.fill(x.scalefac,0),ve(D,x)};function Be(D){this.ordinal=D}Be.BINSEARCH_NONE=new Be(0),Be.BINSEARCH_UP=new Be(1),Be.BINSEARCH_DOWN=new Be(2);function De(D,x,_,B,q){var w,c=D.CurrentStep[B],F=!1,y=D.OldValue[B],u=Be.BINSEARCH_NONE;for(x.global_gain=y,_-=x.part2_length,ln(c!=0);;){var v;if(w=ge.count_bits(D,q,x,null),c==1||w==_)break;w>_?(u==Be.BINSEARCH_DOWN&&(F=!0),F&&(c/=2),u=Be.BINSEARCH_UP,v=c):(u==Be.BINSEARCH_UP&&(F=!0),F&&(c/=2),u=Be.BINSEARCH_DOWN,v=-c),x.global_gain+=v,x.global_gain<0&&(x.global_gain=0,F=!0),x.global_gain>255&&(x.global_gain=255,F=!0)}for(ln(x.global_gain>=0),ln(x.global_gain<256);w>_&&x.global_gain<255;)x.global_gain++,w=ge.count_bits(D,q,x,null);return D.CurrentStep[B]=y-x.global_gain>=4?4:2,D.OldValue[B]=x.global_gain,x.part2_3_length=w,w}this.trancate_smallspectrums=function(D,x,_,B){var q=za(xi.SFBMAX);if(!((D.substep_shaping&4)==0&&x.block_type==T.SHORT_TYPE||(D.substep_shaping&128)!=0)){re.calc_noise(x,_,q,new s0,null);for(var c=0;c<576;c++){var w=0;x.l3_enc[c]!=0&&(w=Math.abs(x.xr[c])),B[c]=w}var c=0,F=8;x.block_type==T.SHORT_TYPE&&(F=6);do{var y,u,v,b,l=x.width[F];if(c+=l,!(q[F]>=1)&&(ea.sort(B,c-l,l),!jn.EQ(B[c-1],0))){y=(1-q[F])*_[F],u=0,b=0;do{var m;for(v=1;b+v<l&&!jn.NEQ(B[b+c-l],B[b+c+v-l]);v++);if(m=B[b+c-l]*B[b+c-l]*v,y<m){b!=0&&(u=B[b+c-l-1]);break}y-=m,b+=v}while(b<l);if(!jn.EQ(u,0))do Math.abs(x.xr[c-l])<=u&&(x.l3_enc[c-l]=0);while(--l>0)}}while(++F<x.psymax);x.part2_3_length=ge.noquant_count_bits(D,x,null)}};function j(D){for(var x=0;x<D.sfbmax;x++)if(D.scalefac[x]+D.subblock_gain[D.window[x]]==0)return!1;return!0}function fe(D){return l0.FAST_LOG10(.368+.632*D*D*D)}function he(D,x){for(var _=1e-37,B=0;B<x.psymax;B++)_+=fe(D[B]);return Math.max(1e-20,_)}function M(D,x,_,B,q){var w;switch(D){default:case 9:{x.over_count>0?(w=_.over_SSD<=x.over_SSD,_.over_SSD==x.over_SSD&&(w=_.bits<x.bits)):w=_.max_noise<0&&_.max_noise*10+_.bits<=x.max_noise*10+x.bits;break}case 0:w=_.over_count<x.over_count||_.over_count==x.over_count&&_.over_noise<x.over_noise||_.over_count==x.over_count&&jn.EQ(_.over_noise,x.over_noise)&&_.tot_noise<x.tot_noise;break;case 8:_.max_noise=he(q,B);case 1:w=_.max_noise<x.max_noise;break;case 2:w=_.tot_noise<x.tot_noise;break;case 3:w=_.tot_noise<x.tot_noise&&_.max_noise<x.max_noise;break;case 4:w=_.max_noise<=0&&x.max_noise>.2||_.max_noise<=0&&x.max_noise<0&&x.max_noise>_.max_noise-.2&&_.tot_noise<x.tot_noise||_.max_noise<=0&&x.max_noise>0&&x.max_noise>_.max_noise-.2&&_.tot_noise<x.tot_noise+x.over_noise||_.max_noise>0&&x.max_noise>-.05&&x.max_noise>_.max_noise-.1&&_.tot_noise+_.over_noise<x.tot_noise+x.over_noise||_.max_noise>0&&x.max_noise>-.1&&x.max_noise>_.max_noise-.15&&_.tot_noise+_.over_noise+_.over_noise<x.tot_noise+x.over_noise+x.over_noise;break;case 5:w=_.over_noise<x.over_noise||jn.EQ(_.over_noise,x.over_noise)&&_.tot_noise<x.tot_noise;break;case 6:w=_.over_noise<x.over_noise||jn.EQ(_.over_noise,x.over_noise)&&(_.max_noise<x.max_noise||jn.EQ(_.max_noise,x.max_noise)&&_.tot_noise<=x.tot_noise);break;case 7:w=_.over_count<x.over_count||_.over_noise<x.over_noise;break}return x.over_count==0&&(w=w&&_.bits<x.bits),w}function K(D,x,_,B,q){var w=D.internal_flags,c;x.scalefac_scale==0?c=1.2968395546510096:c=1.6817928305074292;for(var F=0,y=0;y<x.sfbmax;y++)F<_[y]&&(F=_[y]);var u=w.noise_shaping_amp;switch(u==3&&(q?u=2:u=1),u){case 2:break;case 1:F>1?F=Math.pow(F,.5):F*=.95;break;case 0:default:F>1?F=1:F*=.95;break}for(var v=0,y=0;y<x.sfbmax;y++){var b=x.width[y],l;if(v+=b,!(_[y]<F)){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(x.scalefac[y]++,l=-b;l<0;l++)B[v+l]*=c,B[v+l]>x.xrpow_max&&(x.xrpow_max=B[v+l]);if(w.noise_shaping_amp==2)return}}}function a(D,x){for(var _=1.2968395546510096,B=0,q=0;q<D.sfbmax;q++){var w=D.width[q],c=D.scalefac[q];if(D.preflag!=0&&(c+=re.pretab[q]),B+=w,(c&1)!=0){c++;for(var F=-w;F<0;F++)x[B+F]*=_,x[B+F]>D.xrpow_max&&(D.xrpow_max=x[B+F])}D.scalefac[q]=c>>1}D.preflag=0,D.scalefac_scale=1}function I(D,x,_){var B,q=x.scalefac;for(B=0;B<x.sfb_lmax;B++)if(q[B]>=16)return!0;for(var w=0;w<3;w++){var c=0,F=0;for(B=x.sfb_lmax+w;B<x.sfbdivide;B+=3)c<q[B]&&(c=q[B]);for(;B<x.sfbmax;B+=3)F<q[B]&&(F=q[B]);if(!(c<16&&F<8)){if(x.subblock_gain[w]>=7)return!0;x.subblock_gain[w]++;var y=D.scalefac_band.l[x.sfb_lmax];for(B=x.sfb_lmax+w;B<x.sfbmax;B+=3){var u,v=x.width[B],b=q[B];if(ln(b>=0),b=b-(4>>x.scalefac_scale),b>=0){q[B]=b,y+=v*3;continue}q[B]=0;{var l=210+(b<<x.scalefac_scale+1);u=re.IPOW20(l)}y+=v*(w+1);for(var m=-v;m<0;m++)_[y+m]*=u,_[y+m]>x.xrpow_max&&(x.xrpow_max=_[y+m]);y+=v*(3-w-1)}{var u=re.IPOW20(202);y+=x.width[B]*(w+1);for(var m=-x.width[B];m<0;m++)_[y+m]*=u,_[y+m]>x.xrpow_max&&(x.xrpow_max=_[y+m])}}}return!1}function H(D,x,_,B,q){var w=D.internal_flags;K(D,x,_,B,q);var c=j(x);return c?!1:(w.mode_gr==2?c=ge.scale_bitcount(x):c=ge.scale_bitcount_lsf(w,x),c?(w.noise_shaping>1&&(ea.fill(w.pseudohalf,0),x.scalefac_scale==0?(a(x,B),c=!1):x.block_type==T.SHORT_TYPE&&w.subblock_gain>0&&(c=I(w,x,B)||j(x))),c||(w.mode_gr==2?c=ge.scale_bitcount(x):c=ge.scale_bitcount_lsf(w,x)),!c):!0)}this.outer_loop=function(D,x,_,B,q,w){var c=D.internal_flags,F=new Do,y=za(576),u=za(xi.SFBMAX),v=new s0,b,l=new _d,m=9999999,g=!1,E=!1,X=0;if(De(c,x,w,q,B),c.noise_shaping==0)return 100;re.calc_noise(x,_,u,v,l),v.bits=x.part2_3_length,F.assign(x);var U=0;for(ti.arraycopy(B,0,y,0,576);!g;){do{var z=new s0,Se,f=255;if((c.substep_shaping&2)!=0?Se=20:Se=3,c.sfb21_extra&&(u[F.sfbmax]>1||F.block_type==T.SHORT_TYPE&&(u[F.sfbmax+1]>1||u[F.sfbmax+2]>1))||!H(D,F,u,B,E))break;F.scalefac_scale!=0&&(f=254);var S=w-F.part2_length;if(S<=0)break;for(;(F.part2_3_length=ge.count_bits(c,B,F,l))>S&&F.global_gain<=f;)F.global_gain++;if(F.global_gain>f)break;if(v.over_count==0){for(;(F.part2_3_length=ge.count_bits(c,B,F,l))>m&&F.global_gain<=f;)F.global_gain++;if(F.global_gain>f)break}if(re.calc_noise(F,_,u,z,l),z.bits=F.part2_3_length,x.block_type!=T.SHORT_TYPE?b=D.quant_comp:b=D.quant_comp_short,b=M(b,v,z,F,u)?1:0,b!=0)m=x.part2_3_length,v=z,x.assign(F),U=0,ti.arraycopy(B,0,y,0,576);else if(c.full_outer_loop==0&&(++U>Se&&v.over_count==0||c.noise_shaping_amp==3&&E&&U>30||c.noise_shaping_amp==3&&E&&F.global_gain-X>15))break}while(F.global_gain+F.scalefac_scale<255);c.noise_shaping_amp==3?E?g=!0:(F.assign(x),ti.arraycopy(y,0,B,0,576),U=0,X=F.global_gain,E=!0):g=!0}return ln(x.global_gain+x.scalefac_scale<=255),D.VBR==I1.vbr_rh||D.VBR==I1.vbr_mtrh?ti.arraycopy(y,0,B,0,576):(c.substep_shaping&1)!=0&&trancate_smallspectrums(c,x,_,B),v.over_count},this.iteration_finish_one=function(D,x,_){var B=D.l3_side,q=B.tt[x][_];ge.best_scalefac_store(D,x,_,B),D.use_best_huffman==1&&ge.best_huffman_divide(D,q),$.ResvAdjust(D,q)},this.VBR_encode_granule=function(D,x,_,B,q,w,c){var F=D.internal_flags,y=new Do,u=za(576),v=c,b=c+1,l=(c+w)/2,m,g,E=0,X=F.sfb21_extra;ln(v<=LameInternalFlags.MAX_BITS_PER_CHANNEL),ea.fill(y.l3_enc,0);do ln(l>=w),ln(l<=c),ln(w<=c),l>v-42?F.sfb21_extra=!1:F.sfb21_extra=X,g=outer_loop(D,x,_,B,q,l),g<=0?(E=1,b=x.part2_3_length,y.assign(x),ti.arraycopy(B,0,u,0,576),c=b-32,m=c-w,l=(c+w)/2):(w=l+32,m=c-w,l=(c+w)/2,E!=0&&(E=2,x.assign(y),ti.arraycopy(u,0,B,0,576)));while(m>12);F.sfb21_extra=X,E==2&&ti.arraycopy(y.l3_enc,0,x.l3_enc,0,576),ln(x.part2_3_length<=v)},this.get_framebits=function(D,x){var _=D.internal_flags;_.bitrate_index=_.VBR_min_bitrate;var B=C.getframebits(D);_.bitrate_index=1,B=C.getframebits(D);for(var q=1;q<=_.VBR_max_bitrate;q++){_.bitrate_index=q;var w=new MeanBits(B);x[q]=$.ResvFrameBegin(D,w),B=w.bits}},this.VBR_old_prepare=function(D,x,_,B,q,w,c,F,y){var u=D.internal_flags,v,b=0,l=1,m=0;u.bitrate_index=u.VBR_max_bitrate;var g=$.ResvFrameBegin(D,new MeanBits(0))/u.mode_gr;get_framebits(D,w);for(var E=0;E<u.mode_gr;E++){var X=re.on_pe(D,x,F[E],g,E,0);u.mode_ext==T.MPG_MD_MS_LR&&(ms_convert(u.l3_side,E),re.reduce_side(F[E],_[E],g,X));for(var U=0;U<u.channels_out;++U){var z=u.l3_side.tt[E][U];z.block_type!=T.SHORT_TYPE?(b=1.28/(1+Math.exp(3.5-x[E][U]/300))-.05,v=u.PSY.mask_adjust-b):(b=2.56/(1+Math.exp(3.5-x[E][U]/300))-.14,v=u.PSY.mask_adjust_short-b),u.masking_lower=Math.pow(10,v*.1),init_outer_loop(u,z),y[E][U]=re.calc_xmin(D,B[E][U],z,q[E][U]),y[E][U]!=0&&(l=0),c[E][U]=126,m+=F[E][U]}}for(var E=0;E<u.mode_gr;E++)for(var U=0;U<u.channels_out;U++)m>w[u.VBR_max_bitrate]&&(F[E][U]*=w[u.VBR_max_bitrate],F[E][U]/=m),c[E][U]>F[E][U]&&(c[E][U]=F[E][U]);return l},this.bitpressure_strategy=function(D,x,_,B){for(var q=0;q<D.mode_gr;q++)for(var w=0;w<D.channels_out;w++){for(var c=D.l3_side.tt[q][w],F=x[q][w],y=0,u=0;u<c.psy_lmax;u++)F[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++)F[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s,F[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s,F[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s;B[q][w]=0|Math.max(_[q][w],.9*B[q][w])}},this.VBR_new_prepare=function(D,x,_,B,q,w){var c=D.internal_flags,F=1,y=0,u=0,v;if(D.free_format){c.bitrate_index=0;var b=new MeanBits(y);v=$.ResvFrameBegin(D,b),y=b.bits,q[0]=v}else{c.bitrate_index=c.VBR_max_bitrate;var b=new MeanBits(y);$.ResvFrameBegin(D,b),y=b.bits,get_framebits(D,q),v=q[c.VBR_max_bitrate]}for(var l=0;l<c.mode_gr;l++){re.on_pe(D,x,w[l],y,l,0),c.mode_ext==T.MPG_MD_MS_LR&&ms_convert(c.l3_side,l);for(var m=0;m<c.channels_out;++m){var g=c.l3_side.tt[l][m];c.masking_lower=Math.pow(10,c.PSY.mask_adjust*.1),init_outer_loop(c,g),re.calc_xmin(D,_[l][m],g,B[l][m])!=0&&(F=0),u+=w[l][m]}}for(var l=0;l<c.mode_gr;l++)for(var m=0;m<c.channels_out;m++)u>v&&(w[l][m]*=v,w[l][m]/=u);return F},this.calc_target_bits=function(D,x,_,B,q,w){var c=D.internal_flags,F=c.l3_side,y,u,v,b,l=0;c.bitrate_index=c.VBR_max_bitrate;var m=new MeanBits(l);for(w[0]=$.ResvFrameBegin(D,m),l=m.bits,c.bitrate_index=1,l=C.getframebits(D)-c.sideinfo_len*8,q[0]=l/(c.mode_gr*c.channels_out),l=D.VBR_mean_bitrate_kbps*D.framesize*1e3,(c.substep_shaping&1)!=0&&(l*=1.09),l/=D.out_samplerate,l-=c.sideinfo_len*8,l/=c.mode_gr*c.channels_out,y=.93+.07*(11-D.compression_ratio)/(11-5.5),y<.9&&(y=.9),y>1&&(y=1),u=0;u<c.mode_gr;u++){var g=0;for(v=0;v<c.channels_out;v++){if(B[u][v]=int(y*l),x[u][v]>700){var E=int((x[u][v]-700)/1.4),X=F.tt[u][v];B[u][v]=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),B[u][v]+=E}B[u][v]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(B[u][v]=LameInternalFlags.MAX_BITS_PER_CHANNEL),g+=B[u][v]}if(g>LameInternalFlags.MAX_BITS_PER_GRANULE)for(v=0;v<c.channels_out;++v)B[u][v]*=LameInternalFlags.MAX_BITS_PER_GRANULE,B[u][v]/=g}if(c.mode_ext==T.MPG_MD_MS_LR)for(u=0;u<c.mode_gr;u++)re.reduce_side(B[u],_[u],l*c.channels_out,LameInternalFlags.MAX_BITS_PER_GRANULE);for(b=0,u=0;u<c.mode_gr;u++)for(v=0;v<c.channels_out;v++)B[u][v]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(B[u][v]=LameInternalFlags.MAX_BITS_PER_CHANNEL),b+=B[u][v];if(b>w[0])for(u=0;u<c.mode_gr;u++)for(v=0;v<c.channels_out;v++)B[u][v]*=w[0],B[u][v]/=b}}var xd=Sd,Ho=N.assert;function bd(){var C;this.setModules=function($){C=$},this.ResvFrameBegin=function($,re){var Z=$.internal_flags,ge,Q=Z.l3_side,ve=C.getframebits($);re.bits=(ve-Z.sideinfo_len*8)/Z.mode_gr;var Be=8*256*Z.mode_gr-8;$.brate>320?ge=8*int($.brate*1e3/($.out_samplerate/1152)/8+.5):(ge=8*1440,$.strict_ISO&&(ge=8*int(32e4/($.out_samplerate/1152)/8+.5))),Z.ResvMax=ge-ve,Z.ResvMax>Be&&(Z.ResvMax=Be),(Z.ResvMax<0||$.disable_reservoir)&&(Z.ResvMax=0);var De=re.bits*Z.mode_gr+Math.min(Z.ResvSize,Z.ResvMax);return De>ge&&(De=ge),Ho(Z.ResvMax%8==0),Ho(Z.ResvMax>=0),Q.resvDrain_pre=0,Z.pinfo!=null&&(Z.pinfo.mean_bits=re.bits/2,Z.pinfo.resvsize=Z.ResvSize),De},this.ResvMaxBits=function($,re,Z,ge){var Q=$.internal_flags,ve,Be=Q.ResvSize,De=Q.ResvMax;ge!=0&&(Be+=re),(Q.substep_shaping&1)!=0&&(De*=.9),Z.bits=re,Be*10>De*9?(ve=Be-De*9/10,Z.bits+=ve,Q.substep_shaping|=128):(ve=0,Q.substep_shaping&=127,!$.disable_reservoir&&(Q.substep_shaping&1)==0&&(Z.bits-=.1*re));var j=Be<Q.ResvMax*6/10?Be:Q.ResvMax*6/10;return j-=ve,j<0&&(j=0),j},this.ResvAdjust=function($,re){$.ResvSize-=re.part2_3_length+re.part2_length},this.ResvFrameEnd=function($,re){var Z,ge=$.l3_side;$.ResvSize+=re*$.mode_gr;var Q=0;ge.resvDrain_post=0,ge.resvDrain_pre=0,(Z=$.ResvSize%8)!=0&&(Q+=Z),Z=$.ResvSize-Q-$.ResvMax,Z>0&&(Ho(Z%8==0),Ho(Z>=0),Q+=Z);{var ve=Math.min(ge.main_data_begin*8,Q)/8;ge.resvDrain_pre+=8*ve,Q-=8*ve,$.ResvSize-=8*ve,ge.main_data_begin-=ve}ge.resvDrain_post+=Q,$.ResvSize-=Q}}var gd=bd;function yd(){var C="http://www.mp3dev.org/",$=3,re=98,Z=4,ge=0,Q=93;this.getLameVersion=function(){return $+"."+re+"."+Z},this.getLameShortVersion=function(){return $+"."+re+"."+Z},this.getLameVeryShortVersion=function(){return"LAME"+$+"."+re+"r"},this.getPsyVersion=function(){return ge+"."+Q},this.getLameUrl=function(){return C},this.getLameOsBitness=function(){return"32bits"}}var Ed=yd,wd=N.System,c0=N.VbrMode,C1=N.ShortBlock,Rd=N.Arrays,Vo=N.new_byte,Td=N.assert;ja.NUMTOCENTRIES=100,ja.MAXFRAMESIZE=2880;function ja(){var C,$,re;this.setModules=function(l,m,g){C=l,$=m,re=g};var Z=1,ge=2,Q=4,ve=8,Be=ja.NUMTOCENTRIES,De=ja.MAXFRAMESIZE,j=Be+4+4+4+4+4,fe=j+9+1+1+8+1+1+3+1+1+2+4+2+2,he=128,M=64,K=32,a=null,I="Xing",H="Info",D=[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 x(l,m){if(l.nVbrNumFrames++,l.sum+=m,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 g=1;g<l.size;g+=2)l.bag[g/2]=l.bag[g];l.want*=2,l.pos/=2}}function _(l,m){if(!(l.pos<=0))for(var g=1;g<Be;++g){var E=g/Be,X,U,z=0|Math.floor(E*l.pos);z>l.pos-1&&(z=l.pos-1),X=l.bag[z],U=l.sum;var Se=0|256*X/U;Se>255&&(Se=255),m[g]=255&Se}}this.addVbrFrame=function(l){var m=l.internal_flags,g=Tables.bitrate_table[l.version][m.bitrate_index];Td(m.VBR_seek_table.bag!=null),x(m.VBR_seek_table,g)};function B(l,m){var g=l[m+0]&255;return g<<=8,g|=l[m+1]&255,g<<=8,g|=l[m+2]&255,g<<=8,g|=l[m+3]&255,g}function q(l,m,g){l[m+0]=255&(g>>24&255),l[m+1]=255&(g>>16&255),l[m+2]=255&(g>>8&255),l[m+3]=255&(g&255)}function w(l,m,g){l[m+0]=255&(g>>8&255),l[m+1]=255&(g&255)}function c(l,m){return new String(l,m,I.length(),a).equals(I)||new String(l,m,H.length(),a).equals(H)}function F(l,m,g){return 255&(l<<m|g&~(-1<<m))}function y(l,m){var g=l.internal_flags;m[0]=F(m[0],8,255),m[1]=F(m[1],3,7),m[1]=F(m[1],1,l.out_samplerate<16e3?0:1),m[1]=F(m[1],1,l.version),m[1]=F(m[1],2,4-3),m[1]=F(m[1],1,l.error_protection?0:1),m[2]=F(m[2],4,g.bitrate_index),m[2]=F(m[2],2,g.samplerate_index),m[2]=F(m[2],1,0),m[2]=F(m[2],1,l.extension),m[3]=F(m[3],2,l.mode.ordinal()),m[3]=F(m[3],2,g.mode_ext),m[3]=F(m[3],1,l.copyright),m[3]=F(m[3],1,l.original),m[3]=F(m[3],2,l.emphasis),m[0]=255;var E=255&(m[1]&241),X;l.version==1?X=he:l.out_samplerate<16e3?X=K:X=M,l.VBR==c0.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?(m[1]=255&(E|10),E=255&(m[2]&13),m[2]=255&(U|E)):(m[1]=255&(E|2),E=255&(m[2]&13),m[2]=255&(U|E))}this.getVbrTag=function(l){var m=new VBRTagData,g=0;m.flags=0;var E=l[g+1]>>3&1,X=l[g+2]>>2&3,U=l[g+3]>>6&3,z=l[g+2]>>4&15;if(z=Tables.bitrate_table[E][z],l[g+1]>>4==14?m.samprate=Tables.samplerate_table[2][X]:m.samprate=Tables.samplerate_table[E][X],E!=0?U!=3?g+=32+4:g+=17+4:U!=3?g+=17+4:g+=9+4,!c(l,g))return null;g+=4,m.hId=E;var Se=m.flags=B(l,g);if(g+=4,(Se&Z)!=0&&(m.frames=B(l,g),g+=4),(Se&ge)!=0&&(m.bytes=B(l,g),g+=4),(Se&Q)!=0){if(m.toc!=null)for(var f=0;f<Be;f++)m.toc[f]=l[g+f];g+=Be}m.vbrScale=-1,(Se&ve)!=0&&(m.vbrScale=B(l,g),g+=4),m.headersize=(E+1)*72e3*z/m.samprate,g+=21;var S=l[g+0]<<4;S+=l[g+1]>>4;var ce=(l[g+1]&15)<<8;return ce+=l[g+2]&255,(S<0||S>3e3)&&(S=-1),(ce<0||ce>3e3)&&(ce=-1),m.encDelay=S,m.encPadding=ce,m},this.InitVbrTag=function(l){var m=l.internal_flags,g;l.version==1?g=he:l.out_samplerate<16e3?g=K:g=M,l.VBR==c0.vbr_off&&(g=l.brate);var E=(l.version+1)*72e3*g/l.out_samplerate,X=m.sideinfo_len+fe;if(m.VBR_seek_table.TotalFrameSize=E,E<X||E>De){l.bWriteVbrTag=!1;return}m.VBR_seek_table.nVbrNumFrames=0,m.VBR_seek_table.nBytesWritten=0,m.VBR_seek_table.sum=0,m.VBR_seek_table.seen=0,m.VBR_seek_table.want=1,m.VBR_seek_table.pos=0,m.VBR_seek_table.bag==null&&(m.VBR_seek_table.bag=new int[400],m.VBR_seek_table.size=400);var U=Vo(De);y(l,U);for(var z=m.VBR_seek_table.TotalFrameSize,Se=0;Se<z;++Se)$.add_dummy_byte(l,U[Se]&255,1)};function u(l,m){var g=m^l;return m=m>>8^D[g&255],m}this.updateMusicCRC=function(l,m,g,E){for(var X=0;X<E;++X)l[0]=u(m[g+X],l[0])};function v(l,m,g,E,X){var U=l.internal_flags,z=0,Se=l.encoder_delay,f=l.encoder_padding,S=100-10*l.VBR_q-l.quality,ce=re.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,Xe=0,Ve=0,gt=l.internal_flags.noise_shaping,Ft=0,Rt=0,Lt=0,jt=0,Kt=0,pr=(l.exp_nspsytune&1)!=0,Fn=(l.exp_nspsytune&2)!=0,Lr=!1,kr=!1,_n=l.internal_flags.nogap_total,Ti=l.internal_flags.nogap_current,Ai=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),Xe=8192,Xe|=3072,U.RadioGain>=0?Xe|=U.RadioGain:(Xe|=512,Xe|=-U.RadioGain)),U.findPeakSample&&(nt=Math.abs(0|U.PeakSample/32767*Math.pow(2,23)+.5)),_n!=-1&&(Ti>0&&(kr=!0),Ti<_n-1&&(Lr=!0)),Sn=Ai+((pr?1:0)<<4)+((Fn?1:0)<<5)+((Lr?1:0)<<6)+((kr?1:0)<<7),S<0&&(S=0),l.mode){case MONO:Ft=0;break;case STEREO:Ft=1;break;case DUAL_CHANNEL:Ft=2;break;case JOINT_STEREO:l.force_ms?Ft=4:Ft=3;break;case NOT_SET:default:Ft=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==C1.short_block_forced||l.short_blocks==C1.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||Ai==0||l.in_samplerate<=32e3)&&(Rt=1),jt=gt+(Ft<<2)+(Rt<<5)+(Lt<<6),Kt=U.nMusicCRC,q(g,E+z,S),z+=4;for(var ri=0;ri<9;ri++)g[E+z+ri]=255&ce.charAt(ri);z+=9,g[E+z]=255&Ue,z++,g[E+z]=255&ze,z++,q(g,E+z,nt),z+=4,w(g,E+z,Xe),z+=2,w(g,E+z,Ve),z+=2,g[E+z]=255&Sn,z++,Cr>=255?g[E+z]=255:g[E+z]=255&Cr,z++,g[E+z]=255&Se>>4,g[E+z+1]=255&(Se<<4)+(f>>8),g[E+z+2]=255&f,z+=3,g[E+z]=255&jt,z++,g[E+z++]=0,w(g,E+z,l.preset),z+=2,q(g,E+z,m),z+=4,w(g,E+z,Kt),z+=2;for(var Xa=0;Xa<z;Xa++)X=u(g[E+Xa],X);return w(g,E+z,X),z+=2,z}function b(l){l.seek(0);var m=Vo(10);l.readFully(m);var g;return new String(m,"ISO-8859-1").startsWith("ID3")?g=0:g=((m[6]&127)<<21|(m[7]&127)<<14|(m[8]&127)<<7|m[9]&127)+m.length,g}this.getLameTagFrame=function(l,m){var g=l.internal_flags;if(!l.bWriteVbrTag||g.Class_ID!=At.LAME_ID||g.VBR_seek_table.pos<=0)return 0;if(m.length<g.VBR_seek_table.TotalFrameSize)return g.VBR_seek_table.TotalFrameSize;Rd.fill(m,0,g.VBR_seek_table.TotalFrameSize,0),y(l,m);var E=Vo(Be);if(l.free_format)for(var X=1;X<Be;++X)E[X]=255&255*X/100;else _(g.VBR_seek_table,E);var U=g.sideinfo_len;l.error_protection&&(U-=2),l.VBR==c0.vbr_off?(m[U++]=255&H.charAt(0),m[U++]=255&H.charAt(1),m[U++]=255&H.charAt(2),m[U++]=255&H.charAt(3)):(m[U++]=255&I.charAt(0),m[U++]=255&I.charAt(1),m[U++]=255&I.charAt(2),m[U++]=255&I.charAt(3)),q(m,U,Z+ge+Q+ve),U+=4,q(m,U,g.VBR_seek_table.nVbrNumFrames),U+=4;var z=g.VBR_seek_table.nBytesWritten+g.VBR_seek_table.TotalFrameSize;q(m,U,0|z),U+=4,wd.arraycopy(E,0,m,U,E.length),U+=E.length,l.error_protection&&$.CRC_writeheader(g,m);for(var Se=0,X=0;X<U;X++)Se=u(m[X],Se);return U+=v(l,z,m,U,Se),g.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(l,m){var g=l.internal_flags;if(g.VBR_seek_table.pos<=0||(m.seek(m.length()),m.length()==0))return-1;var E=b(m);m.seek(E);var X=Vo(De),U=getLameTagFrame(l,X);return U>X.length?-1:(U<1||m.write(X,0,U),0)}}var Ad=ja,M1=N.new_byte,P1=N.assert,At=cd,Id=fd,Ga=Ir,Cd=Jn,Md=xd,Pd=a0,Bd=gd,rr=Qi,jn=ei;function Nd(){var C,$;this.setModules=function(re,Z){C=re,$=Z}}function Dd(){var C,$,re;this.setModules=function(Z,ge,Q){C=Z,$=ge,re=Q}}function Od(){}function Fd(){var C,$;this.setModules=function(re,Z){C=re,$=Z}}function Ld(C,$,re){arguments.length!=3&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),C=1,$=44100,re=128);var Z=new At,ge=new Nd,Q=new Ga,ve=new jn,Be=new Id,De=new Cd,j=new Md,fe=new Ad,he=new Ed,M=new Fd,K=new Bd,a=new Pd,I=new Dd,H=new Od;Z.setModules(Q,ve,Be,De,j,fe,he,M,H),ve.setModules(Q,H,he,fe),M.setModules(ve,he),Be.setModules(Z),j.setModules(ve,K,De,a),De.setModules(a,K,Z.enc.psy),K.setModules(ve),a.setModules(De),fe.setModules(Z,ve,he),ge.setModules(I,H),I.setModules(he,M,Be);var D=Z.lame_init();D.num_channels=C,D.in_samplerate=$,D.brate=re,D.mode=rr.STEREO,D.quality=3,D.bWriteVbrTag=!1,D.disable_reservoir=!0,D.write_id3tag_automatic=!1;var x=Z.lame_init_params(D);P1(x==0);var _=1152,B=0|1.25*_+7200,q=M1(B);this.encodeBuffer=function(w,c){C==1&&(c=w),P1(w.length==c.length),w.length>_&&(_=w.length,B=0|1.25*_+7200,q=M1(B));var F=Z.lame_encode_buffer(D,w,c,w.length,q,0,B);return new Int8Array(q.subarray(0,F))},this.flush=function(){var w=Z.lame_encode_flush(D,q,0,B);return new Int8Array(q.subarray(0,w))}}function On(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function qo(C){return C.charCodeAt(0)<<24|C.charCodeAt(1)<<16|C.charCodeAt(2)<<8|C.charCodeAt(3)}On.RIFF=qo("RIFF"),On.WAVE=qo("WAVE"),On.fmt_=qo("fmt "),On.data=qo("data"),On.readHeader=function(C){var $=new On,re=C.getUint32(0,!1);if(On.RIFF==re){var Z=C.getUint32(4,!0);if(On.WAVE==C.getUint32(8,!1)&&On.fmt_==C.getUint32(12,!1)){var ge=C.getUint32(16,!0),Q=16+4;switch(ge){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+=ge;for(var ve=On.data,Be=0;ve!=re&&(re=C.getUint32(Q,!1),Be=C.getUint32(Q+4,!0),ve!=re);)Q+=Be+8;return $.dataLen=Be,$.dataOffset=Q+8,$}}};var kd=Ld,B1=function(C,$){if(!(C instanceof $))throw new TypeError("Cannot call a class as a function")},N1=function(){function C($,re){for(var Z=0;Z<re.length;Z++){var ge=re[Z];ge.enumerable=ge.enumerable||!1,ge.configurable=!0,"value"in ge&&(ge.writable=!0),Object.defineProperty($,ge.key,ge)}}return function($,re,Z){return re&&C($.prototype,re),Z&&C($,Z),$}}(),Ud=function(){function C($){B1(this,C),this.config={sampleRate:44100,bitRate:128},Object.assign(this.config,$),this.mp3Encoder=new kd(1,this.config.sampleRate,this.config.bitRate),this.maxSamples=1152,this.samplesMono=null,this.clearBuffer()}return N1(C,[{key:"clearBuffer",value:function(){this.dataBuffer=[]}},{key:"appendToBuffer",value:function(re){this.dataBuffer.push(new Int8Array(re))}},{key:"floatTo16BitPCM",value:function(re,Z){for(var ge=0;ge<re.length;ge++){var Q=Math.max(-1,Math.min(1,re[ge]));Z[ge]=Q<0?Q*32768:Q*32767}}},{key:"convertBuffer",value:function(re){var Z=new Float32Array(re),ge=new Int16Array(re.length);return this.floatTo16BitPCM(Z,ge),ge}},{key:"encode",value:function(re){this.samplesMono=this.convertBuffer(re);for(var Z=this.samplesMono.length,ge=0;Z>=0;ge+=this.maxSamples){var Q=this.samplesMono.subarray(ge,ge+this.maxSamples),ve=this.mp3Encoder.encodeBuffer(Q);this.appendToBuffer(ve),Z-=this.maxSamples}}},{key:"finish",value:function(){return this.appendToBuffer(this.mp3Encoder.flush()),this.dataBuffer}}]),C}(),Hd=function(){function C($){B1(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 N1(C,[{key:"addMicrophoneListener",value:function(re){var Z=this;this.activeStream=re,this.timerToStart=setTimeout(function(){delete Z.timerToStart},this.config.startRecordingAt),this.microphone=this.context.createMediaStreamSource(re),this.processor=this.context.createScriptProcessor(0,1,1),this.processor.onaudioprocess=function(ge){Z.timerToStart||Z.lameEncoder.encode(ge.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(re){return re.stop()})),this}},{key:"start",value:function(){var re=this,Z=window.AudioContext||window.webkitAudioContext;this.context=new Z,this.config.sampleRate=this.context.sampleRate,this.lameEncoder=new Ud(this.config);var ge=this.config.deviceId?{deviceId:{exact:this.config.deviceId}}:!0;return new Promise(function(Q,ve){navigator.mediaDevices.getUserMedia({audio:ge}).then(function(Be){re.addMicrophoneListener(Be),Q(Be)}).catch(function(Be){ve(Be)})})}},{key:"getMp3",value:function(){var re=this,Z=this.lameEncoder.finish();return new Promise(function(ge,Q){Z.length===0?Q(new Error("No buffer to send")):(ge([Z,new Blob(Z,{type:"audio/mp3"})]),re.lameEncoder.clearBuffer())})}}]),C}();return Hd})});var lf=j1((O8,sf)=>{sf.exports=typeof self=="object"?self.FormData:window.FormData});async function Go(){try{let t={audio:!0,video:!0};return(await navigator.mediaDevices.getUserMedia(t)).getTracks().forEach(r=>{r.stop()}),!0}catch{return!1}}async function Xo(){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 Mi(){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 Yd=G1();function X1(t){return new Yd(t)}var Ko=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)}};var na=class{constructor(){this.blobs=[]}async startRecording(){this.recorder=X1({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"})}};function Za(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 o=new MediaRecorder(t,i);o.ondataavailable=O=>{O.data.size>0&&e.push(O.data),r&&o.state=="inactive"&&(e=[new Blob(e,{type:"audio/mpeg-3"})]),n&&n()};function s(){return new Promise(O=>{n=O,o.start()})}function d(){return new Promise(O=>{o.state=="recording"?(n=O,o.stop(),t.getTracks().forEach(G=>{G.stop()})):O()})}function h(){return new Promise(O=>{o.state=="recording"&&o.pause(),O()})}function p(){return new Promise(O=>{o.state=="paused"&&o.resume(),O()})}return{startRecording:s,stopRecording:d,pauseRecording:h,resumeRecording:p}}var ia=class{constructor(e,r){this.blobs=[];this.options={cameraId:void 0,microphoneId:void 0};this.videoOptions={width:640,height:480};this.options=e,this.videoOptions=r}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:o,pauseRecording:s,resumeRecording:d}=Za(this.cameraStream,this.blobs);this.recordingStart=i,this.recordingStop=o,this.recordingPause=s,this.recordingResume=d,this.recordingStart()}async stopRecording(){await this.recordingStop()}async pauseRecording(){await this.recordingPause()}async resumeRecording(){await this.recordingResume()}async saveOnSession(e){let r=this.cameraStream.getVideoTracks()[0].getSettings(),n=this.cameraStream.getAudioTracks()[0].getSettings();e.addRecording({device:`Audio
|
|
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&<.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
|
|
22
|
+
File name: ${n.name}
|
|
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
|
|
15
25
|
Sample Rate: ${n.sampleRate}
|
|
16
|
-
Sample Size: ${n.sampleSize}`,file:new File(this.blobs,`EP_${e.id}_camera_0.webm`,{type:"video/webm"}),origin:"Camera"})}};var K1="not_shared_first_screen",Wo="multiple_monitors_detected",W1="proctoring_already_started",Yo="proctoring_not_started";var aa=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(O=>O.label=="Primary Monitor")&&e)throw Wo;if(!(i.find(p=>["screen:0:0","Primary Monitor"].includes(p.label))!=null)&&e)throw i.forEach(p=>{p.stop()}),K1;let{startRecording:d,stopRecording:h}=Za(this.screenStream,this.blobs);this.recordingStart=d,this.recordingStop=h,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 ii={cameraId:void 0,microphoneId:void 0,allowMultipleMonitors:!1,allowOnlyFirstMonitor:!0,captureScreen:!0,noiseLimit:40,proctoringType:"IMAGE",insights:""};function $o(t){return!!t.width&&!!t.height?{width:t.width,height:t.height}:{width:640,height:480}}var Zo=class{constructor(){}async checkDevices(e=ii,r={width:1080,height:720}){return this.options={...ii,...e,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},this.videoOptions=r,this.checkDevicesInterface()}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="absolute",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="400px",n.style.borderRadius="10px",n.style.padding="20px 10px",n.style.display="flex",n.style.flexDirection="column",n.style.alignItems="center";let i=document.createElement("h3");i.innerText="Verificar dispositivos",i.style.color="rgb(22, 163, 74)",i.style.fontWeight="bold",i.style.fontSize="26px",i.style.marginBottom="15px",n.appendChild(i);let o=document.createElement("video");o.setAttribute("id","cameraStream"),o.style.width="20rem",o.style.backgroundColor="#000",o.style.borderRadius="10px",o.style.marginBottom="15px",n.appendChild(o);let s=document.createElement("meter");s.setAttribute("id","audioStream"),s.setAttribute("high","0.25"),s.setAttribute("max","1"),s.style.width="20rem",s.style.borderRadius="10px",s.style.marginBottom="15px",n.appendChild(s);let d=document.createElement("button");d.setAttribute("id","confirmBtn"),d.innerText="Confirmar",d.style.width="200px",d.style.height="50px",d.style.backgroundColor="rgb(22, 163, 74)",d.style.color="#fff",d.style.borderRadius="10px",d.addEventListener("click",()=>{this.closeCheckDevices(),e("Complete")}),n.appendChild(d),r.appendChild(n),document.body.appendChild(r),this.startCheckDevices(this.options,this.videoOptions)})}async startDevice(){let{cameraStream:e,_screenStream:r}=await this.startCheckDevices(this.options,this.videoOptions)}videoDeviceInterface(e){let r=document.querySelector("#cameraStream");r&&(r.srcObject=e,r.play())}audioDeviceInterface(e){let r=document.querySelector("#audioStream"),n=new AudioContext,i=n.createMediaStreamSource(e),o=n.createAnalyser();i.connect(o);let s=new Float32Array(o.fftSize),d=()=>{o.getFloatTimeDomainData(s);let h=0;for(let p of s)h+=p*p;r.value=Math.sqrt(h/s.length),window.requestAnimationFrame(d)};window.requestAnimationFrame(d)}async startCheckDevices(e=ii,r){return this.videoOptions=$o(r),await Go(),this.cameraRecorder=new ia({cameraId:e.cameraId,microphoneId:e.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height}),this.audioRecorder=new na,this.screenRecorder=e.captureScreen?new aa({allowOnlyFirstMonitor:!!(e.allowOnlyFirstMonitor||e.allowOnlyFirstMonitor==null),onStopSharingScreenCallback:()=>{}}):void 0,await this.cameraRecorder.startRecording(),await this.audioRecorder.startRecording(),this.screenRecorder&&await this.screenRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream),{cameraStream:this.cameraRecorder.cameraStream,_screenStream:this.screenRecorder?.screenStream}}async closeCheckDevices(){document.querySelector("#checkDevices")?.remove(),await this.cameraRecorder.stopRecording(),await this.audioRecorder.stopRecording(),this.screenRecorder&&await this.screenRecorder.stopRecording()}};var Qo=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 Y1={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5};var gn="function",Vr="object",yn="undefined",Gt="prototype",Qa="hasOwnProperty";var Yr=Object,oa=Yr[Gt],sa=Yr.assign,Jo=Yr.create,es=Yr.defineProperty,ai=oa[Qa];var la=null;function cn(t){return t===void 0&&(t=!0),(!la||!t)&&(typeof globalThis!==yn&&globalThis&&(la=globalThis),typeof self!==yn&&self&&(la=self),typeof window!==yn&&window&&(la=window),typeof global!==yn&&global&&(la=global)),la}function ca(t){throw new TypeError(t)}function ua(t){var e=Jo;if(e)return e(t);if(t==null)return{};var r=typeof t;r!==Vr&&r!==gn&&ca("Object prototype may only be an Object:"+t);function n(){}return n[Gt]=t,new n}var xh=(cn()||{}).Symbol,bh=(cn()||{}).Reflect;var Zd=function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)oa[Qa].call(e,i)&&(t[i]=e[i])}return t},Zt=sa||Zd,g0=function(t,e){return g0=Yr.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n[Qa](i)&&(r[i]=n[i])},g0(t,e)};function ut(t,e){typeof e!==gn&&e!==null&&ca("Class extends value "+String(e)+" is not a constructor or null"),g0(t,e);function r(){this.constructor=t}t[Gt]=e===null?ua(e):(r[Gt]=e[Gt],new r)}function ts(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t}var rs="constructor",Gn="prototype",ns="function",is="_dynInstFuncs",w0="_isDynProxy",fa="_dynClass",Qd="_dynCls$",R0="_dynInstChk",Ja=R0,J1="_dfOpts",$1="_unknown_",Jd="__proto__",y0="useBaseInst",Z1="setInstFuncs",ss=Object,eo=ss.getPrototypeOf,Q1=0;function oi(t,e){return t&&ss[Gn].hasOwnProperty.call(t,e)}function ec(t){return t&&(t===ss[Gn]||t===Array[Gn])}function T0(t){return ec(t)||t===Function[Gn]}function Pi(t){if(t){if(eo)return eo(t);var e=t[Jd]||t[Gn]||(t[rs]?t[rs][Gn]:null);if(e)return e}return null}function as(t,e){var r=[],n=ss.getOwnPropertyNames;if(n)r=n(t);else for(var i in t)typeof i=="string"&&oi(t,i)&&r.push(i);if(r&&r.length>0)for(var o=0;o<r.length;o++)e(r[o])}function A0(t,e,r){return e!==rs&&typeof t[e]===ns&&(r||oi(t,e))}function os(t){throw new TypeError("DynamicProto: "+t)}function e2(t){var e={};return as(t,function(r){!e[r]&&A0(t,r,!1)&&(e[r]=t[r])}),e}function I0(t,e){for(var r=t.length-1;r>=0;r--)if(t[r]===e)return!0;return!1}function t2(t,e,r,n){function i(h,p,O){var G=p[O];if(G[w0]&&n){var ie=h[is]||{};ie[Ja]!==!1&&(G=(ie[p[fa]]||{})[O]||G)}return function(){return G.apply(h,arguments)}}var o={};as(r,function(h){o[h]=i(e,r,h)});for(var s=Pi(t),d=[];s&&!T0(s)&&!I0(d,s);)as(s,function(h){!o[h]&&A0(s,h,!eo)&&(o[h]=i(e,s,h))}),d.push(s),s=Pi(s);return o}function r2(t,e,r,n){var i=null;if(t&&oi(r,fa)){var o=t[is]||{};if(i=(o[r[fa]]||{})[e],i||os("Missing ["+e+"] "+ns),!i[R0]&&o[Ja]!==!1){for(var s=!oi(t,e),d=Pi(t),h=[];s&&d&&!T0(d)&&!I0(h,d);){var p=d[e];if(p){s=p===n;break}h.push(d),d=Pi(d)}try{s&&(t[e]=i),i[R0]=1}catch{o[Ja]=!1}}}return i}function n2(t,e,r){var n=e[t];return n===r&&(n=Pi(e)[t]),typeof n!==ns&&os("["+t+"] is not a "+ns),n}function i2(t,e,r,n,i){function o(h,p){var O=function(){var G=r2(this,p,h,O)||n2(p,h,O);return G.apply(this,arguments)};return O[w0]=1,O}if(!ec(t)){var s=r[is]=r[is]||{},d=s[e]=s[e]||{};s[Ja]!==!1&&(s[Ja]=!!i),as(r,function(h){A0(r,h,!1)&&r[h]!==n[h]&&(d[h]=r[h],delete r[h],(!oi(t,h)||t[h]&&!t[h][w0])&&(t[h]=o(t,h)))})}}function a2(t,e){if(eo)for(var r=[],n=Pi(e);n&&!T0(n)&&!I0(r,n);){if(n===t)return!0;r.push(n),n=Pi(n)}return!1}function E0(t,e){return oi(t,Gn)?t.name||e||$1:((t||{})[rs]||{}).name||e||$1}function C0(t,e,r,n){oi(t,Gn)||os("theClass is an invalid class definition.");var i=t[Gn];a2(i,e)||os("["+E0(t)+"] is not in class hierarchy of ["+E0(e)+"]");var o=null;oi(i,fa)?o=i[fa]:(o=Qd+E0(t,"_")+"$"+Q1,Q1++,i[fa]=o);var s=C0[J1],d=!!s[y0];d&&n&&n[y0]!==void 0&&(d=!!n[y0]);var h=e2(e),p=t2(i,e,h,d);r(e,p);var O=!!eo&&!!s[Z1];O&&n&&(O=!!n[Z1]),i2(i,o,e,h,O!==!1)}var o2={setInstFuncs:!0,useBaseInst:!0};C0[J1]=o2;var xt=C0;var Me;(function(t){t[t.CRITICAL=1]="CRITICAL",t[t.WARNING=2]="WARNING"})(Me||(Me={}));var Ee={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 s2="on",tc="attachEvent",rc="addEventListener";var uc="toISOString",fc="endsWith",l2="startsWith",nc="indexOf",ic="map",ac="reduce",P0="trim",dc="toString",c2="__proto__",u2="constructor",oc=es,jh=Yr.freeze,Gh=Yr.seal,sc=Yr.keys,B0=String[Gt],f2=B0[P0],d2=B0[fc],Xh=B0[l2],v2=Date[Gt],m2=v2[uc],h2=Array.isArray,vc=oa[dc],p2=ai[dc],Kh=p2.call(Yr),_2=/-([a-z])/g,S2=/([^\w\d_$])/g,x2=/^(\d+[\w\d_$])/,lc=Object.getPrototypeOf;function mc(t){if(t){if(lc)return lc(t);var e=t[c2]||t[Gt]||t[u2];if(e)return e}return null}function Wt(t){return t===void 0||typeof t===yn}function Ne(t){return t===null||Wt(t)}function N0(t){return!Ne(t)}function to(t,e){return!!(t&&ai.call(t,e))}function En(t){return!!(t&&typeof t===Vr)}function at(t){return!!(t&&typeof t===gn)}function wn(t,e,r,n){n===void 0&&(n=!1);var i=!1;if(!Ne(t))try{Ne(t[rc])?Ne(t[tc])||(t[tc](s2+e,r),i=!0):(t[rc](e,r,n),i=!0)}catch{}return i}function D0(t){var e=t;return e&&Je(e)&&(e=e.replace(_2,function(r,n){return n.toUpperCase()}),e=e.replace(S2,"_"),e=e.replace(x2,function(r,n){return"_"+n})),e}function Tt(t,e){if(t)for(var r in t)ai.call(t,r)&&e.call(t,r,t[r])}function O0(t,e){var r=!1;return t&&e&&!(r=t===e)&&(r=d2?t[fc](e):b2(t,e)),r}function b2(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 o=i-1,s=n-1;s>=0;s--){if(t[o]!=e[s])return!1;o--}r=!0}return r}function lr(t,e){return t&&e?t.indexOf(e)!==-1:!1}var cr=h2||g2;function g2(t){return!!(t&&vc.call(t)==="[object Array]")}function da(t){return!!(t&&vc.call(t)==="[object Error]")}function Je(t){return typeof t=="string"}function va(t){return typeof t=="number"}function Mr(t){if(t)return m2?t[uc]():y2(t)}function y2(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 et(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[nc])return t[nc](e,r);var n=t.length,i=r||0;try{for(var o=Math.max(i>=0?i:n-Math.abs(i),0);o<n;o++)if(o in t&&t[o]===e)return o}catch{}}return-1}function Bi(t,e,r){var n;if(t){if(t[ic])return t[ic](e,r);var i=t.length,o=r||t;n=new Array(i);try{for(var s=0;s<i;s++)s in t&&(n[s]=e.call(o,t[s],t))}catch{}}return n}function ls(t,e,r){var n;if(t){if(t[ac])return t[ac](e,r);var i=t.length,o=0;if(arguments.length>=3)n=arguments[2];else{for(;o<i&&!(o in t);)o++;n=t[o++]}for(;o<i;)o in t&&(n=e(n,t[o],o,t)),o++}return n}function Qt(t){return t&&(t=f2&&t[P0]?t[P0]():t.replace?t.replace(/^\s+|\s+$/g,""):t),t}var cc=!{toString:null}.propertyIsEnumerable("toString"),M0=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function un(t){var e=typeof t;if(e!==gn&&(e!==Vr||t===null)&&ca("objKeys called on non-object"),!cc&&sc)return sc(t);var r=[];for(var n in t)t&&ai.call(t,n)&&r.push(n);if(cc)for(var i=M0.length,o=0;o<i;o++)t&&ai.call(t,M0[o])&&r.push(M0[o]);return r}function si(t,e,r,n){if(oc)try{var i={enumerable:!0,configurable:!0};return r&&(i.get=r),n&&(i.set=n),oc(t,e,i),!0}catch{}return!1}function ur(){var t=Date;return t.now?t.now():new t().getTime()}function pt(t){return da(t)?t.name:""}function ht(t,e,r,n,i){var o=r;return t&&(o=t[e],o!==r&&(!i||i(o))&&(!n||n(r))&&(o=r,t[e]=o)),o}function fr(t,e,r){var n;return t?(n=t[e],!n&&Ne(n)&&(n=Wt(r)?{}:r,t[e]=n)):n=Wt(r)?{}:r,n}function cs(t){return!t}function ma(t){return!!t}function wr(t){throw new Error(t)}function F0(t,e,r){if(t&&e&&t!==e&&En(t)&&En(e)){var n=function(o){if(Je(o)){var s=e[o];at(s)?(!r||r(o,!0,e,t))&&(t[o]=function(d){return function(){var h=arguments;return e[d].apply(e,h)}}(o)):(!r||r(o,!1,e,t))&&(to(t,o)&&delete t[o],si(t,o,function(){return e[o]},function(d){e[o]=d})||(t[o]=s))}};for(var i in e)n(i)}return t}function L0(t){return function(){function e(){var r=this;t&&Tt(t,function(n,i){r[n]=i})}return e}()}function us(t){return t&&sa&&(t=Yr(sa({},t))),t}var hc="window",E2="document",w2="documentMode",R2="navigator",T2="history",A2="location",I2="console",C2="performance",pc="JSON",M2="crypto",P2="msCrypto",B2="ReactNative",V0="msie",q0="trident/",k0=null,U0=null,N2=!1,ha=null,H0=null;function _c(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 Jt(t){var e=cn();return e&&e[t]?e[t]:t===hc&&Ni()?window:null}function Ni(){return Boolean(typeof window===Vr&&window)}function Un(){return Ni()?window:Jt(hc)}function fs(){return Boolean(typeof document===Vr&&document)}function nr(){return fs()?document:Jt(E2)}function z0(){return Boolean(typeof navigator===Vr&&navigator)}function Rr(){return z0()?navigator:Jt(R2)}function Sc(){return Boolean(typeof history===Vr&&history)}function j0(){return Sc()?history:Jt(T2)}function $r(t){if(t&&N2){var e=Jt("__mockLocation");if(e)return e}return typeof location===Vr&&location?location:Jt(A2)}function G0(){return typeof console!==yn?console:Jt(I2)}function Zr(){return Jt(C2)}function Rn(){return Boolean(typeof JSON===Vr&&JSON||Jt(pc)!==null)}function dr(){return Rn()?JSON||Jt(pc):null}function X0(){return Jt(M2)}function K0(){return Jt(P2)}function W0(){var t=Rr();return t&&t.product?t.product===B2:!1}function Di(){var t=Rr();if(t&&(t.userAgent!==U0||k0===null)){U0=t.userAgent;var e=(U0||"").toLowerCase();k0=lr(e,V0)||lr(e,q0)}return k0}function pa(t){if(t===void 0&&(t=null),!t){var e=Rr()||{};t=e?(e.userAgent||"").toLowerCase():""}var r=(t||"").toLowerCase();if(lr(r,V0)){var n=nr()||{};return Math.max(parseInt(r.split(V0)[1]),n[w2]||0)}else if(lr(r,q0)){var i=parseInt(r.split(q0)[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+"'":Rn()&&(r=dr().stringify(t)),e+r}function Oi(){return H0===null&&(H0=z0()&&Boolean(Rr().sendBeacon)),H0}function ds(t){var e=!1;try{var r=Jt("fetch");e=!!r;var n=Jt("Request");e&&t&&n&&(e=_c(n,"keepalive"))}catch{}return e}function vs(){return ha===null&&(ha=typeof XDomainRequest<"u",ha&&Fi()&&(ha=ha&&!_c(Jt("XMLHttpRequest"),"withCredentials"))),ha}function Fi(){var t=!1;try{var e=Jt("XMLHttpRequest");t=!!e}catch{}return t}var Y0=["eventsSent","eventsDiscarded","eventsSendRequest","perfEvent"],hs=null,ms;function D2(t,e){return function(){var r=arguments,n=$0(e);if(n){var i=n.listener;i&&i[t]&&i[t].apply(i,r)}}}function O2(){var t=Jt("Microsoft");return t&&(hs=t.ApplicationInsights),hs}function $0(t){var e=hs;return!e&&t.disableDbgExt!==!0&&(e=hs||O2()),e?e.ChromeDbgExt:null}function xc(t){if(!ms){ms={};for(var e=0;e<Y0.length;e++)ms[Y0[e]]=D2(Y0[e],t)}return ms}var F2="AI (Internal): ",L2="AI: ",k2="AITR_",U2="errorToConsole",H2="warnToConsole";function bc(t){return t?'"'+t.replace(/\"/g,"")+'"':""}function gc(t,e){var r=G0();if(r){var n="log";r[t]&&(n=t),at(r[n])&&r[n](e)}}var Xn=function(){function t(e,r,n,i){n===void 0&&(n=!1);var o=this;o.messageId=e,o.message=(n?L2:F2)+e;var s="";Rn()&&(s=dr().stringify(i));var d=(r?" message:"+bc(r):"")+(i?" props:"+bc(s):"");o.message+=d}return t.dataType="MessageData",t}();function Kn(t,e){return(t||{}).logger||new _a(e)}var _a=function(){function t(e){this.identifier="DiagnosticLogger",this.queue=[];var r=0,n={};xt(t,this,function(i){Ne(e)&&(e={}),i.consoleLoggingLevel=function(){return o("loggingLevelConsole",0)},i.telemetryLoggingLevel=function(){return o("loggingLevelTelemetry",1)},i.maxInternalMessageLimit=function(){return o("maxMessageLimit",25)},i.enableDebugExceptions=function(){return o("enableDebugExceptions",!1)},i.throwInternal=function(h,p,O,G,ie){ie===void 0&&(ie=!1);var oe=new Xn(p,O,ie,G);if(i.enableDebugExceptions())throw oe;var L=h===Me.CRITICAL?U2:H2;if(Wt(oe.message))d("throw"+(h===Me.CRITICAL?"Critical":"Warning"),oe);else{var pe=i.consoleLoggingLevel();if(ie){var N=+oe.messageId;!n[N]&&pe>=h&&(i[L](oe.message),n[N]=!0)}else pe>=h&&i[L](oe.message);i.logInternalMessage(h,oe)}},i.warnToConsole=function(h){gc("warn",h),d("warning",h)},i.errorToConsole=function(h){gc("error",h),d("error",h)},i.resetInternalMessageCount=function(){r=0,n={}},i.logInternalMessage=function(h,p){if(!s()){var O=!0,G=k2+p.messageId;if(n[G]?O=!1:n[G]=!0,O&&(h<=i.telemetryLoggingLevel()&&(i.queue.push(p),r++,d(h===Me.CRITICAL?"error":"warn",p)),r===i.maxInternalMessageLimit())){var ie="Internal events throttle limit per PageView reached for this app.",oe=new Xn(Ee.MessageLimitPerPVExceeded,ie,!1);i.queue.push(oe),h===Me.CRITICAL?i.errorToConsole(ie):i.warnToConsole(ie)}}};function o(h,p){var O=e[h];return Ne(O)?p:O}function s(){return r>=i.maxInternalMessageLimit()}function d(h,p){var O=$0(e);O&&O.diagLog&&O.diagLog(h,p)}})}return t}();var Sa="ctx",V2=null,ro=function(){function t(e,r,n){var i=this,o=!1;if(i.start=ur(),i.name=e,i.isAsync=n,i.isChildEvt=function(){return!1},at(r)){var s;o=si(i,"payload",function(){return!s&&at(r)&&(s=r(),r=null),s})}i.getCtx=function(d){return d?d===t.ParentContextKey||d===t.ChildrenContextKey?i[d]:(i[Sa]||{})[d]:null},i.setCtx=function(d,h){if(d)if(d===t.ParentContextKey)i[d]||(i.isChildEvt=function(){return!0}),i[d]=h;else if(d===t.ChildrenContextKey)i[d]=h;else{var p=i[Sa]=i[Sa]||{};p[d]=h}},i.complete=function(){var d=0,h=i.getCtx(t.ChildrenContextKey);if(cr(h))for(var p=0;p<h.length;p++){var O=h[p];O&&(d+=O.time)}i.time=ur()-i.start,i.exTime=i.time-d,i.complete=function(){},!o&&at(r)&&(i.payload=r())}}return t.ParentContextKey="parent",t.ChildrenContextKey="childEvts",t}();var Q0=function(){function t(e){this.ctx={},xt(t,this,function(r){r.create=function(n,i,o){return new ro(n,i,o)},r.fire=function(n){n&&(n.complete(),e&&at(e.perfEvent)&&e.perfEvent(n))},r.setCtx=function(n,i){if(n){var o=r[Sa]=r[Sa]||{};o[n]=i}},r.getCtx=function(n){return(r[Sa]||{})[n]}})}return t}();var Z0="CoreUtils.doPerf";function Hn(t,e,r,n,i){if(t){var o=t;if(at(o.getPerfMgr)&&(o=o.getPerfMgr()),o){var s=void 0,d=o.getCtx(Z0);try{if(s=o.create(e(),n,i),s){if(d&&s.setCtx&&(s.setCtx(ro.ParentContextKey,d),d.getCtx&&d.setCtx)){var h=d.getCtx(ro.ChildrenContextKey);h||(h=[],d.setCtx(ro.ChildrenContextKey,h)),h.push(s)}return o.setCtx(Z0,s),r(s)}}catch(p){s&&s.setCtx&&s.setCtx("exception",p)}finally{s&&o.fire(s),o.setCtx(Z0,d)}}}return r()}function J0(){return V2}var yc=function(){function t(e,r){var n=this,i=null,o=at(e.processTelemetry),s=at(e.setNextPlugin);n._hasRun=!1,n.getPlugin=function(){return e},n.getNext=function(){return i},n.setNext=function(d){i=d},n.processTelemetry=function(d,h){h||(h=r);var p=e?e.identifier:"TelemetryPluginChain";Hn(h?h.core():null,function(){return p+":processTelemetry"},function(){if(e&&o){n._hasRun=!0;try{h.setNext(i),s&&e.setNextPlugin(i),i&&(i._hasRun=!1),e.processTelemetry(d,h)}catch(G){var O=i&&i._hasRun;(!i||!O)&&h.diagLog().throwInternal(Me.CRITICAL,Ee.PluginException,"Plugin ["+e.identifier+"] failed during processTelemetry - "+it(G)),i&&!O&&i.processTelemetry(d,h)}}else i&&(n._hasRun=!0,i.processTelemetry(d,h))},function(){return{item:d}},!d.sync)}}return t}();function el(t,e){var r=[];if(t&&t.length>0)for(var n=null,i=0;i<t.length;i++){var o=t[i];if(o&&at(o.processTelemetry)){var s=new yc(o,e);r.push(s),n&&n.setNext(s),n=s}}return r.length>0?r[0]:null}function q2(t,e,r){var n=[],i=!r;if(t)for(;t;){var o=t.getPlugin();(i||o===r)&&(i=!0,n.push(o)),t=t.getNext()}return i||n.push(r),el(n,e)}function z2(t,e,r){var n=t,i=!1;return r&&t&&(n=[],et(t,function(o){(i||o===r)&&(i=!0,n.push(o))})),r&&!i&&(n||(n=[]),n.push(r)),el(n,e)}var Wn=function(){function t(e,r,n,i){var o=this,s=null;i!==null&&(e&&at(e.getPlugin)?s=q2(e,o,i||e.getPlugin()):i?s=z2(e,o,i):Wt(i)&&(s=el(e,o))),o.core=function(){return n},o.diagLog=function(){return Kn(n,r)},o.getCfg=function(){return r},o.getExtCfg=function(d,h){h===void 0&&(h={});var p;if(r){var O=r.extensionConfig;O&&d&&(p=O[d])}return p||h},o.getConfig=function(d,h,p){p===void 0&&(p=!1);var O,G=o.getExtCfg(d,null);return G&&!Ne(G[h])?O=G[h]:r&&!Ne(r[h])&&(O=r[h]),Ne(O)?p:O},o.hasNext=function(){return s!=null},o.getNext=function(){return s},o.setNext=function(d){s=d},o.processNext=function(d){var h=s;h&&(s=h.getNext(),h.processTelemetry(d,o))},o.createNew=function(d,h){return d===void 0&&(d=null),new t(d||s,r,n,h)}}return t}();var Ec="iKey",ps="extensionConfig";var _s="getPlugin",Tn=function(){function t(){var e=this,r=!1,n=null,i=null;e.core=null,e.diagLog=function(o){return e._getTelCtx(o).diagLog()},e.isInitialized=function(){return r},e.setInitialized=function(o){r=o},e.setNextPlugin=function(o){i=o},e.processNext=function(o,s){s?s.processNext(o):i&&at(i.processTelemetry)&&i.processTelemetry(o,null)},e._getTelCtx=function(o){o===void 0&&(o=null);var s=o;if(!s){var d=n||new Wn(null,{},e.core);i&&i[_s]?s=d.createNew(null,i[_s]):s=d.createNew(null,i)}return s},e._baseTelInit=function(o,s,d,h){o&&ht(o,ps,[],null,Ne),!h&&s&&(h=s.getProcessTelContext().getNext());var p=i;i&&i[_s]&&(p=i[_s]()),e.core=s,n=new Wn(h,o,s,p),r=!0}}return t.prototype.initialize=function(e,r,n,i){this._baseTelInit(e,r,n,i)},t}();var tl="processTelemetry",wc="priority",Rc="setNextPlugin",Tc="isInitialized";function no(t,e){for(var r=[],n=null,i=t.getNext();i;){var o=i.getPlugin();o&&(n&&at(n[Rc])&&at(o[tl])&&n[Rc](o),(!at(o[Tc])||!o[Tc]())&&r.push(o),n=o,i=i.getNext())}et(r,function(s){s.initialize(t.getCfg(),t.core(),e,t.getNext())})}function rl(t){return t.sort(function(e,r){var n=0,i=at(r[tl]);return at(e[tl])?n=i?e[wc]-r[wc]:1:i&&(n=-1),n})}var nl=500,j2="Channel has invalid priority",Ac=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=nl;var n;xt(e,r,function(d,h){d.setNextPlugin=function(p){},d.processTelemetry=function(p,O){n&&et(n,function(G){if(G.length>0){var ie=r._getTelCtx(O).createNew(G);ie.processNext(p)}})},d.getChannelControls=function(){return n},d.initialize=function(p,O,G){d.isInitialized()||(h.initialize(p,O,G),s((p||{}).channels,G),et(n,function(ie){return no(new Wn(ie,p,O),G)}))}});function i(d){et(d,function(h){h.priority<nl&&wr(j2+h.identifier)})}function o(d){d&&d.length>0&&(d=d.sort(function(h,p){return h.priority-p.priority}),i(d),n.push(d))}function s(d,h){if(n=[],d&&et(d,function(O){return o(O)}),h){var p=[];et(h,function(O){O.priority>nl&&p.push(O)}),o(p)}}return r}return e._staticInit=function(){var r=e.prototype;si(r,"ChannelControls",r.getChannelControls),si(r,"channelQueue",r.getChannelControls)}(),e}(Tn);var Ic="toGMTString",Cc="toUTCString",ll="cookie",il="expires",ol="enabled",Mc="isCookieUseDisabled",Pc="disableCookiesUsage",li="_ckMgr",An="",Ss=null,al=null,Bc=null,io=nr(),Nc={},bs={};function G2(t,e){var r=Li[li]||bs[li];return r||(r=Li[li]=Li(t,e),bs[li]=r),r}function xs(t){return t?t.isEnabled():!0}function X2(t){var e=t.cookieCfg=t.cookieCfg||{};if(ht(e,"domain",t.cookieDomain,N0,Ne),ht(e,"path",t.cookiePath||"/",null,Ne),Ne(e[ol])){var r=void 0;Wt(t[Mc])||(r=!t[Mc]),Wt(t[Pc])||(r=!t[Pc]),e[ol]=r}return e}function ki(t,e){var r;if(t)r=t.getCookieMgr();else if(e){var n=e.cookieCfg;n[li]?r=n[li]:r=Li(e)}return r||(r=G2(e,(t||{}).logger)),r}function Li(t,e){var r=X2(t||bs),n=r.path||"/",i=r.domain,o=r[ol]!==!1,s={isEnabled:function(){var d=o&&sl(e),h=bs[li];return d&&h&&s!==h&&(d=xs(h)),d},setEnabled:function(d){o=d!==!1},set:function(d,h,p,O,G){var ie=!1;if(xs(s)){var oe={},L=Qt(h||An),pe=L.indexOf(";");if(pe!==-1&&(L=Qt(h.substring(0,pe)),oe=Lc(h.substring(pe+1))),ht(oe,"domain",O||i,ma,Wt),!Ne(p)){var N=Di();if(Wt(oe[il])){var le=ur(),ue=le+p*1e3;if(ue>0){var Fe=new Date;Fe.setTime(ue),ht(oe,il,Dc(Fe,N?Ic:Cc)||Dc(Fe,N?Ic:Cc)||An,ma)}}N||ht(oe,"max-age",An+p,null,Wt)}var tt=$r();tt&&tt.protocol==="https:"&&(ht(oe,"secure",null,null,Wt),al===null&&(al=!cl((Rr()||{}).userAgent)),al&&ht(oe,"SameSite","None",null,Wt)),ht(oe,"path",G||n,null,Wt);var ct=r.setCookie||Fc;ct(d,Oc(L,oe)),ie=!0}return ie},get:function(d){var h=An;return xs(s)&&(h=(r.getCookie||K2)(d)),h},del:function(d,h){var p=!1;return xs(s)&&(p=s.purge(d,h)),p},purge:function(d,h){var p,O=!1;if(sl(e)){var G=(p={},p.path=h||"/",p[il]="Thu, 01 Jan 1970 00:00:01 GMT",p);Di()||(G["max-age"]="0");var ie=r.delCookie||Fc;ie(d,Oc(An,G)),O=!0}return O}};return s[li]=s,s}function sl(t){if(Ss===null){Ss=!1;try{var e=io||{};Ss=e[ll]!==void 0}catch(r){t&&t.throwInternal(Me.WARNING,Ee.CannotAccessCookie,"Cannot access document.cookie - "+pt(r),{exception:it(r)})}}return Ss}function Lc(t){var e={};if(t&&t.length){var r=Qt(t).split(";");et(r,function(n){if(n=Qt(n||An),n){var i=n.indexOf("=");i===-1?e[n]=null:e[Qt(n.substring(0,i))]=Qt(n.substring(i+1))}})}return e}function Dc(t,e){return at(t[e])?t[e]():null}function Oc(t,e){var r=t||An;return Tt(e,function(n,i){r+="; "+n+(Ne(i)?An:"="+i)}),r}function K2(t){var e=An;if(io){var r=io[ll]||An;Bc!==r&&(Nc=Lc(r),Bc=r),e=Qt(Nc[t]||An)}return e}function Fc(t,e){io&&(io[ll]=t+"="+e)}function cl(t){return Je(t)?!!(lr(t,"CPU iPhone OS 12")||lr(t,"iPad; CPU OS 12")||lr(t,"Macintosh; Intel Mac OS X 10_14")&&lr(t,"Version/")&&lr(t,"Safari")||lr(t,"Macintosh; Intel Mac OS X 10_14")&&O0(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||lr(t,"Chrome/5")||lr(t,"Chrome/6")||lr(t,"UnrealEngine")&&!lr(t,"Chrome")||lr(t,"UCBrowser/12")||lr(t,"UCBrowser/11")):!1}var W2="Extensions must provide callback to initialize",kc="_notificationManager";function Y2(t,e){return new Q0(e)}var Uc=function(){function t(){var e=!1,r,n,i,o,s;xt(t,this,function(d){d._extensions=new Array,n=new Ac,d.logger=new _a({loggingLevelConsole:Me.CRITICAL}),r=[],d.isInitialized=function(){return e},d.initialize=function(h,p,O,G){d.isInitialized()&&wr("Core should not be initialized more than once"),(!h||Ne(h.instrumentationKey))&&wr("Please provide instrumentation key"),i=G,d[kc]=G,d.config=h||{},G&&d.config.disableDbgExt!==!0&&G.addNotificationListener(xc(h)),d.config.enablePerfMgr&&ht(d.config,"createPerfMgr",Y2),h.extensions=Ne(h.extensions)?[]:h.extensions;var ie=fr(h,ps);ie.NotificationManager=G,O&&(d.logger=O);var oe=[];oe.push.apply(oe,ts(ts([],p,!1),h.extensions,!1)),oe=rl(oe);var L=[],pe=[],N={};et(oe,function(le){(Ne(le)||Ne(le.initialize))&&wr(W2);var ue=le.priority,Fe=le.identifier;le&&ue&&(Ne(N[ue])?N[ue]=Fe:O.warnToConsole("Two extensions have same priority #"+ue+" - "+N[ue]+", "+Fe)),!ue||ue<n.priority?L.push(le):pe.push(le)}),oe.push(n),L.push(n),oe=rl(oe),d._extensions=oe,no(new Wn([n],h,d),oe),no(new Wn(L,h,d),oe),d._extensions=L,d.getTransmissionControls().length===0&&wr("No channels available"),e=!0,d.releaseQueue()},d.getTransmissionControls=function(){return n.getChannelControls()},d.track=function(h){ht(h,Ec,d.config.instrumentationKey,null,cs),ht(h,"time",Mr(new Date),null,cs),ht(h,"ver","4.0",null,Ne),d.isInitialized()?d.getProcessTelContext().processNext(h):r.push(h)},d.getProcessTelContext=function(){var h=d._extensions,p=h;return(!h||h.length===0)&&(p=[n]),new Wn(p,d.config,d)},d.getNotifyMgr=function(){return i||(i=ua({addNotificationListener:function(h){},removeNotificationListener:function(h){},eventsSent:function(h){},eventsDiscarded:function(h,p){},eventsSendRequest:function(h,p){}}),d[kc]=i),i},d.getCookieMgr=function(){return s||(s=Li(d.config,d.logger)),s},d.setCookieMgr=function(h){s=h},d.getPerfMgr=function(){return o||d.config&&d.config.enablePerfMgr&&at(d.config.createPerfMgr)&&(o=d.config.createPerfMgr(d,d.getNotifyMgr())),o||J0()},d.setPerfMgr=function(h){o=h},d.eventCnt=function(){return r.length},d.releaseQueue=function(){r.length>0&&(et(r,function(h){d.getProcessTelContext().processNext(h)}),r=[])}})}return t}();var Hc=function(){function t(e){this.listeners=[];var r=!!(e||{}).perfEvtsSendAll;xt(t,this,function(n){n.addNotificationListener=function(i){n.listeners.push(i)},n.removeNotificationListener=function(i){for(var o=kn(n.listeners,i);o>-1;)n.listeners.splice(o,1),o=kn(n.listeners,i)},n.eventsSent=function(i){et(n.listeners,function(o){o&&o.eventsSent&&setTimeout(function(){return o.eventsSent(i)},0)})},n.eventsDiscarded=function(i,o){et(n.listeners,function(s){s&&s.eventsDiscarded&&setTimeout(function(){return s.eventsDiscarded(i,o)},0)})},n.eventsSendRequest=function(i,o){et(n.listeners,function(s){if(s&&s.eventsSendRequest)if(o)setTimeout(function(){return s.eventsSendRequest(i,o)},0);else try{s.eventsSendRequest(i,o)}catch{}})},n.perfEvent=function(i){i&&(r||!i.isChildEvt())&&et(n.listeners,function(o){if(o&&o.perfEvent)if(i.isAsync)setTimeout(function(){return o.perfEvent(i)},0);else try{o.perfEvent(i)}catch{}})}})}return t}();var ul=function(t){ut(e,t);function e(){var r=t.call(this)||this,n=0;return xt(e,r,function(i,o){i.initialize=function(h,p,O,G){o.initialize(h,p,O||new _a(h),G||new Hc(h))},i.track=function(h){Hn(i.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){h===null&&(d(h),wr("Invalid telemetry item")),s(h),o.track(h)},function(){return{item:h}},!h.sync)},i.addNotificationListener=function(h){var p=i.getNotifyMgr();p&&p.addNotificationListener(h)},i.removeNotificationListener=function(h){var p=i.getNotifyMgr();p&&p.removeNotificationListener(h)},i.pollInternalLogs=function(h){var p=i.config.diagnosticLogInterval;return(!p||!(p>0))&&(p=1e4),n&&i.stopPollingInternalLogs(),n=setInterval(function(){var O=i.logger?i.logger.queue:[];et(O,function(G){var ie={name:h||"InternalMessageId: "+G.messageId,iKey:i.config.instrumentationKey,time:Mr(new Date),baseType:Xn.dataType,baseData:{message:G.message}};i.track(ie)}),O.length=0},p),n},i.stopPollingInternalLogs=function(){!n||(clearInterval(n),n=0)};function s(h){if(Ne(h.name))throw d(h),Error("telemetry name required")}function d(h){var p=i.getNotifyMgr();p&&p.eventsDiscarded([h],Y1.InvalidEvent)}}),r}return e}(Uc);var Vc=4294967296,Ui=4294967295,qc=!1,ao=123456789,oo=987654321;function $2(t){t<0&&(t>>>=0),ao=123456789+t&Ui,oo=987654321-t&Ui,qc=!0}function Z2(){try{var t=ur()&2147483647;$2((Math.random()*Vc^t)+t)}catch{}}function xa(t){var e,r=X0()||K0();return r&&r.getRandomValues?e=r.getRandomValues(new Uint32Array(1))[0]&Ui:Di()?(qc||Z2(),e=zc()&Ui):e=Math.floor(Vc*Math.random()|0),t||(e>>>=0),e}function zc(t){oo=36969*(oo&65535)+(oo>>16)&Ui,ao=18e3*(ao&65535)+(ao>>16)&Ui;var e=(oo<<16)+(ao&65535)>>>0&Ui|0;return t||(e>>>=0),e}var jc="visibilitychange",Gc="pagehide";function gs(t,e){var r=!1,n=Un();n&&(r=wn(n,t,e),r=wn(n.body,t,e)||r);var i=nr();return i&&(r=wn(i,t,e)||r),r}function fl(t,e,r){var n=!1;if(e&&t&&cr(t)){var i=[];et(t,function(o){Je(o)&&(!r||kn(r,o)===-1?n=gs(o,e)||n:i.push(o))}),!n&&i.length>0&&(n=fl(i,e))}return n}function dl(t,e){return fl(["beforeunload","unload","pagehide"],t,e)}function so(t,e){function r(i){var o=nr();t&&o&&o.visibilityState==="hidden"&&t(i)}var n=!1;return(!e||kn(e,Gc)===-1)&&(n=gs(Gc,t)),(!e||kn(e,jc)===-1)&&(n=gs(jc,r)||n),!n&&e&&(n=so(t)),n}function ba(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=xa()>>>0,n=0,i="";i.length<t;)n++,i+=e.charAt(r&63),r>>>=6,n===5&&(r=(xa()<<2&4294967295|r&3)>>>0,n=0);return i}function qr(){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=xa(),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+(xa()&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 Kc="_aiHooks",Wc=["req","rsp","hkErr","fnErr"];function ml(t,e){if(t)for(var r=0;r<t.length&&!e(t[r],r);r++);}function vl(t,e,r,n,i){i>=0&&i<=2&&ml(t,function(o,s){var d=o.cbks,h=d[Wc[i]];if(h){e.ctx=function(){var G=n[s]=n[s]||{};return G};try{h.apply(e.inst,r)}catch(G){var p=e.err;try{var O=d[Wc[2]];O&&(e.err=G,O.apply(e.inst,r))}catch{}finally{e.err=p}}}})}function tv(t){return function(){var e=this,r=arguments,n=t.h,i={name:t.n,inst:e,ctx:null,set:h},o=[],s=d([i],r);function d(O,G){return ml(G,function(ie){O.push(ie)}),O}function h(O,G){r=d([],r),r[O]=G,s=d([i],r)}vl(n,i,s,o,0);var p=t.f;try{i.rslt=p.apply(e,r)}catch(O){throw i.err=O,vl(n,i,s,o,3),O}return vl(n,i,s,o,1),i.rslt}}function Yc(t,e,r){var n=null;return t&&(to(t,e)?n=t:r&&(n=Yc(mc(t),e,!1))),n}function hl(t,e,r){return t?lo(t[Gt],e,r,!1):null}function lo(t,e,r,n){if(n===void 0&&(n=!0),t&&e&&r){var i=Yc(t,e,n);if(i){var o=i[e];if(typeof o===gn){var s=o[Kc];if(!s){s={i:0,n:e,f:o,h:[]};var d=tv(s);d[Kc]=s,i[e]=d}var h={id:s.i,cbks:r,rm:function(){var p=this.id;ml(s.h,function(O,G){if(O.id===p)return s.h.splice(G,1),1})}};return s.i++,s.h.push(h),h}}}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 pl(t,e,r){var n=e.length,i=$c(t,e);if(i.length!==n){for(var o=0,s=i;r[s]!==void 0;)o++,s=i.substring(0,150-3)+Zc(o);i=s}return i}function $c(t,e){var r;return e&&(e=Qt(e.toString()),e.length>150&&(r=e.substring(0,150),t&&t.throwInternal(Me.WARNING,Ee.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=Qt(e),e.toString().length>r&&(n=e.toString().substring(0,r),t&&t.throwInternal(Me.WARNING,Ee.StringValueTooLong,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}function Yn(t,e){return xl(t,e,2048,Ee.UrlTooLong)}function co(t,e){var r;return e&&e.length>32768&&(r=e.substring(0,32768),t&&t.throwInternal(Me.WARNING,Ee.MessageTruncated,"message is too long, it has been truncated to "+32768+" characters.",{message:e},!0)),r||e}function _l(t,e){var r;if(e){var n=""+e;n.length>32768&&(r=n.substring(0,32768),t&&t.throwInternal(Me.WARNING,Ee.ExceptionTruncated,"exception is too long, it has been truncated to "+32768+" characters.",{exception:e},!0))}return r||e}function Pr(t,e){if(e){var r={};Tt(e,function(n,i){if(En(i)&&Rn())try{i=dr().stringify(i)}catch(o){t&&t.throwInternal(Me.WARNING,Ee.CannotSerializeObjectNonSerializable,"custom property is not valid",{exception:o},!0)}i=Mt(t,i,8192),n=pl(t,n,r),r[n]=i}),e=r}return e}function Br(t,e){if(e){var r={};Tt(e,function(n,i){n=pl(t,n,r),r[n]=i}),e=r}return e}function Sl(t,e){return e&&xl(t,e,128,Ee.IdTooLong).toString()}function xl(t,e,r,n){var i;return e&&(e=Qt(e),e.length>r&&(i=e.substring(0,r),t&&t.throwInternal(Me.WARNING,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),i||e}function Zc(t){var e="00"+t;return e.substr(e.length-3)}function Hi(t){var e=null;if(at(Event))e=new Event(t);else{var r=nr();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,o=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,(o>0?o+".":"")+i+":"+n+":"+r+"."+e}function bl(t,e){var r=null;return et(t,function(n){if(n.identifier===e)return r=n,-1}),r}function gl(t,e,r,n,i){return!i&&Je(t)&&(t==="Script error."||t==="Script error")}var In="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",ga="sampleRate",ya="ProcessLegacy",uo="http.method",ys="https://dc.services.visualstudio.com",ir="not_specified",Es="iKey";var ci;(function(t){t[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage"})(ci||(ci={}));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 Vi=void 0,qi=void 0;function yl(){return Rs()?ws(ci.LocalStorage):null}function ws(t){try{if(Ne(cn()))return null;var e=new Date,r=Jt(t===ci.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 El(){return zi()?ws(ci.SessionStorage):null}function wl(){Vi=!1,qi=!1}function Rs(){return Vi===void 0&&(Vi=!!ws(ci.LocalStorage)),Vi}function Rl(t,e){var r=yl();if(r!==null)try{return r.getItem(e)}catch(n){Vi=!1,t.throwInternal(Me.WARNING,Ee.BrowserCannotReadLocalStorage,"Browser failed read of local storage. "+pt(n),{exception:it(n)})}return null}function Tl(t,e,r){var n=yl();if(n!==null)try{return n.setItem(e,r),!0}catch(i){Vi=!1,t.throwInternal(Me.WARNING,Ee.BrowserCannotWriteLocalStorage,"Browser failed write to local storage. "+pt(i),{exception:it(i)})}return!1}function Al(t,e){var r=yl();if(r!==null)try{return r.removeItem(e),!0}catch(n){Vi=!1,t.throwInternal(Me.WARNING,Ee.BrowserFailedRemovalFromLocalStorage,"Browser failed removal of local storage item. "+pt(n),{exception:it(n)})}return!1}function zi(){return qi===void 0&&(qi=!!ws(ci.SessionStorage)),qi}function Ea(t,e){var r=El();if(r!==null)try{return r.getItem(e)}catch(n){qi=!1,t.throwInternal(Me.WARNING,Ee.BrowserCannotReadSessionStorage,"Browser failed read of session storage. "+pt(n),{exception:it(n)})}return null}function wa(t,e,r){var n=El();if(n!==null)try{return n.setItem(e,r),!0}catch(i){qi=!1,t.throwInternal(Me.WARNING,Ee.BrowserCannotWriteSessionStorage,"Browser failed write to session storage. "+pt(i),{exception:it(i)})}return!1}function Il(t,e){var r=El();if(r!==null)try{return r.removeItem(e),!0}catch(n){qi=!1,t.throwInternal(Me.WARNING,Ee.BrowserFailedRemovalFromSessionStorage,"Browser failed removal of session storage item. "+pt(n),{exception:it(n)})}return!1}var Qc=nr()||{},Jc=0,sv=[null,null,null,null,null];function fo(t){var e=Jc,r=sv,n=r[e];return Qc.createElement?r[e]||(n=r[e]=Qc.createElement("a")):n={host:Cl(t,!0)},n.href=t,e++,e>=r.length&&(e=0),Jc=e,n}function Ts(t){var e,r=fo(t);return r&&(e=r.href),e}function As(t,e){return t?t.toUpperCase()+" "+e:e}function Cl(t,e){var r=Is(t,e)||"";if(r){var n=r.match(/(www[0-9]?\.)?(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>3&&Je(n[2])&&n[2].length>0)return n[2]+(n[3]||"")}return r}function Is(t,e){var r=null;if(t){var n=t.match(/(\w*):\/\/(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>2&&Je(n[2])&&n[2].length>0&&(r=n[2]||"",e&&n.length>2)){var i=(n[1]||"").toLowerCase(),o=n[3]||"";(i==="http"&&o===":80"||i==="https"&&o===":443")&&(o=""),r+=o}}return r}var cv=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"];function ji(t){return cv.indexOf(t.toLowerCase())!==-1}var $n={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=fo(e).host.toLowerCase();if(i&&(i.indexOf(":443")!==-1||i.indexOf(":80")!==-1)&&(i=(Is(e,!0)||"").toLowerCase()),(!t||!t.enableCorsCorrelation)&&i&&i!==r)return!1;var o=t&&t.correlationHeaderDomains;if(o){var s;if(et(o,function(p){var O=new RegExp(p.toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));s=s||O.test(i)}),!s)return!1}var d=t&&t.correlationHeaderExcludedDomains;if(!d||d.length===0)return!0;for(var n=0;n<d.length;n++){var h=new RegExp(d[n].toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));if(h.test(i))return!1}return i&&i.length>0},getCorrelationContext:function(t){if(t){var e=$n.getCorrelationContextValue(t,Ct.requestContextTargetKey);if(e&&e!==$n.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 eu(t,e,r,n){var i,o=n,s=n;if(e&&e.length>0){var d=fo(e);if(i=d.host,!o)if(d.pathname!=null){var h=d.pathname.length===0?"/":d.pathname;h.charAt(0)!=="/"&&(h="/"+h),s=d.pathname,o=Mt(t,r?r+" "+h:h)}else o=Mt(t,e)}else i=n,o=n;return{target:i,name:o,data:s}}function Ra(){var t=Zr();if(t&&t.now&&t.timing){var e=t.now()+t.timing.navigationStart;if(e>0)return e}return ur()}function vr(t,e){var r=null;return t!==0&&e!==0&&!Ne(t)&&!Ne(e)&&(r=e-t),r}var uv=";",fv="=";function Ml(t){if(!t)return{};var e=t.split(uv),r=ls(e,function(i,o){var s=o.split(fv);if(s.length===2){var d=s[0].toLowerCase(),h=s[1];i[d]=h}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||ys}return r}var Pl=function(){function t(){}return t}();var Bl=function(t){ut(e,t);function e(){return t.call(this)||this}return e}(Pl);var tu=function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return t}();var Cs=function(t){ut(e,t);function e(r,n,i){var o=t.call(this)||this;return o.name=Mt(r,i)||ir,o.data=n,o.time=Mr(new Date),o.aiDataContract={time:1,iKey:1,name:1,sampleRate:function(){return o.sampleRate===100?4:1},tags:1,data:1},o}return e}(tu);var Ms=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var Jr=function(t){ut(e,t);function e(r,n,i,o){var s=t.call(this)||this;return s.aiDataContract={ver:1,name:1,properties:0,measurements:0},s.name=Mt(r,n)||ir,s.properties=Pr(r,i),s.measurements=Br(r,o),s}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(Ms);var ru=function(){function t(){}return t}();var nu=function(){function t(){this.ver=2,this.exceptions=[],this.properties={},this.measurements={}}return t}();var iu=function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return t}();var dv="<no_method>",Aa="error",vn="stack",Dl="stackDetails",au="errorSrc",Ol="message",lu="description";function Fl(t,e){var r=t;return r&&!Je(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 cu(t,e){var r=t;return t&&(r&&!Je(r)&&(r=t[Ol]||t[lu]||r),r&&!Je(r)&&(r=Fl(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 vv(t){try{if(En(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}function mv(t){try{if(En(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}function ou(t){return t&&t.src&&Je(t.src)&&t.obj&&cr(t.obj)}function Ta(t){var e=t||"";Je(e)||(Je(e[vn])?e=e[vn]:e=""+e);var r=e.split(`
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`}):e=t.src||""),e}function _v(t){var e,r=t.obj;if(r&&r.length>0){e=[];var n=0,i=0;et(r,function(L){var pe=L.toString();if(Ll.regex.test(pe)){var N=new Ll(pe,n++);i+=N.sizeInBytes,e.push(N)}});var o=32*1024;if(i>o)for(var s=0,d=e.length-1,h=0,p=s,O=d;s<d;){var G=e[s].sizeInBytes,ie=e[d].sizeInBytes;if(h+=G+ie,h>o){var oe=O-p+1;e.splice(p,oe);break}p=s,O=d,s++,d--}}return e}function Ps(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 Nl(t){if(t)try{if(!Je(t)){var e=Ps(t),r=Fl(t,!1);return(!r||r==="{}")&&(t[Aa]&&(t=t[Aa],e=Ps(t)),r=Fl(t,!0)),r.indexOf(e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}var gr=function(t){ut(e,t);function e(r,n,i,o,s,d){var h=t.call(this)||this;return h.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0},mv(n)?(h.exceptions=n.exceptions,h.properties=n.properties,h.measurements=n.measurements,n.severityLevel&&(h.severityLevel=n.severityLevel),n.id&&(h.id=n.id),n.problemGroup&&(h.problemGroup=n.problemGroup),h.ver=2,Ne(n.isManual)||(h.isManual=n.isManual)):(i||(i={}),h.exceptions=[new su(r,n,i)],h.properties=Pr(r,i),h.measurements=Br(r,o),s&&(h.severityLevel=s),d&&(h.id=d)),h}return e.CreateAutoException=function(r,n,i,o,s,d,h,p){var O=Ps(s||d||r);return{message:cu(r,O),url:n,lineNumber:i,columnNumber:o,error:Nl(s||d||r),evt:Nl(d||r),typeName:O,stackDetails:uu(h||s||d),errorSrc:p}},e.CreateFromInterface=function(r,n,i,o){var s=n.exceptions&&Bi(n.exceptions,function(h){return su.CreateFromInterface(r,h)}),d=new e(r,Zt(Zt({},n),{exceptions:s}),i,o);return d},e.prototype.toInterface=function(){var r=this,n=r.exceptions,i=r.properties,o=r.measurements,s=r.severityLevel,d=r.problemGroup,h=r.id,p=r.isManual,O=n instanceof Array&&Bi(n,function(G){return G.toInterface()})||void 0;return{ver:"4.0",exceptions:O,severityLevel:s,properties:i,measurements:o,problemGroup:d,id:h,isManual:p}},e.CreateSimpleException=function(r,n,i,o,s,d){return{exceptions:[{hasFullStack:!0,message:r,stack:s,typeName:n}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e.formatError=Nl,e}(nu);var su=function(t){ut(e,t);function e(r,n,i){var o=t.call(this)||this;if(o.aiDataContract={id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2},vv(n))o.typeName=n.typeName,o.message=n.message,o[vn]=n[vn],o.parsedStack=n.parsedStack,o.hasFullStack=n.hasFullStack;else{var s=n,d=s&&s.evt;da(s)||(s=s[Aa]||d||s),o.typeName=Mt(r,Ps(s))||ir,o.message=co(r,cu(n||s,o.typeName))||ir;var h=n[Dl]||uu(n);o.parsedStack=_v(h),o[vn]=_l(r,pv(h)),o.hasFullStack=cr(o.parsedStack)&&o.parsedStack.length>0,i&&(i.typeName=i.typeName||o.typeName)}return o}return e.prototype.toInterface=function(){var r=this.parsedStack instanceof Array&&Bi(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&&Bi(n.parsedStack,function(s){return Ll.CreateFromInterface(s)})||n.parsedStack,o=new e(r,Zt(Zt({},n),{parsedStack:i}));return o},e}(iu);var Ll=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 o=r;i.level=n,i.method=dv,i.assembly=Qt(o),i.fileName="",i.line=0;var s=o.match(e.regex);s&&s.length>=5&&(i.method=Qt(s[2])||i.method,i.fileName=Qt(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}(ru);var fu=function(){function t(){this.ver=2,this.metrics=[],this.properties={},this.measurements={}}return t}();var Bs;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(Bs||(Bs={}));var du=function(){function t(){this.kind=Bs.Measurement}return t}();var vu=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}(du);var en=function(t){ut(e,t);function e(r,n,i,o,s,d,h,p,O){var G=t.call(this)||this;G.aiDataContract={ver:1,metrics:1,properties:0};var ie=new vu;return ie.count=o>0?o:void 0,ie.max=isNaN(d)||d===null?void 0:d,ie.min=isNaN(s)||s===null?void 0:s,ie.name=Mt(r,n)||ir,ie.value=i,ie.stdDev=isNaN(h)||h===null?void 0:h,G.metrics=[ie],G.properties=Pr(r,p),G.measurements=Br(r,O),G}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(fu);var vo=function(t){ut(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(Ms);var Nr=function(t){ut(e,t);function e(r,n,i,o,s,d,h){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=Sl(r,h),p.url=Yn(r,i),p.name=Mt(r,n)||ir,isNaN(o)||(p.duration=Qr(o)),p.properties=Pr(r,s),p.measurements=Br(r,d),p}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(vo);var mu=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,o,s,d,h,p,O,G,ie,oe){O===void 0&&(O="Ajax");var L=t.call(this)||this;L.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},L.id=n,L.duration=Qr(s),L.success=d,L.resultCode=h+"",L.type=Mt(r,O);var pe=eu(r,i,p,o);return L.data=Yn(r,o)||pe.data,L.target=Mt(r,pe.target),G&&(L.target="".concat(L.target," | ").concat(G)),L.name=Mt(r,pe.name),L.properties=Pr(r,ie),L.measurements=Br(r,oe),L}return e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(mu);var hu=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var Cn=function(t){ut(e,t);function e(r,n,i,o,s){var d=t.call(this)||this;return d.aiDataContract={ver:1,message:1,severityLevel:0,properties:0},n=n||ir,d.message=co(r,n),d.properties=Pr(r,o),d.measurements=Br(r,s),i&&(d.severityLevel=i),d}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(hu);var pu=function(t){ut(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(vo);var Mn=function(t){ut(e,t);function e(r,n,i,o,s,d,h){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=Yn(r,i),p.name=Mt(r,n)||ir,p.properties=Pr(r,s),p.measurements=Br(r,d),h&&(p.domProcessing=h.domProcessing,p.duration=h.duration,p.networkConnect=h.networkConnect,p.perfTotal=h.perfTotal,p.receivedResponse=h.receivedResponse,p.sentRequest=h.sentRequest),p}return e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(pu);var Vn=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}(Bl);var Ia;(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"})(Ia||(Ia={}));function fi(t){var e="ai."+t+".";return function(r){return e+r}}var mo=fi("application"),mr=fi("device"),Ns=fi("location"),Ca=fi("operation"),kl=fi("session"),ui=fi("user"),Gi=fi("cloud"),ho=fi("internal"),Ma=function(t){ut(e,t);function e(){return t.call(this)||this}return e}(L0({applicationVersion:mo("ver"),applicationBuild:mo("build"),applicationTypeId:mo("typeId"),applicationId:mo("applicationId"),applicationLayer:mo("layer"),deviceId:mr("id"),deviceIp:mr("ip"),deviceLanguage:mr("language"),deviceLocale:mr("locale"),deviceModel:mr("model"),deviceFriendlyName:mr("friendlyName"),deviceNetwork:mr("network"),deviceNetworkName:mr("networkName"),deviceOEMName:mr("oemName"),deviceOS:mr("os"),deviceOSVersion:mr("osVersion"),deviceRoleInstance:mr("roleInstance"),deviceRoleName:mr("roleName"),deviceScreenResolution:mr("screenResolution"),deviceType:mr("type"),deviceMachineName:mr("machineName"),deviceVMName:mr("vmName"),deviceBrowser:mr("browser"),deviceBrowserVersion:mr("browserVersion"),locationIp:Ns("ip"),locationCountry:Ns("country"),locationProvince:Ns("province"),locationCity:Ns("city"),operationId:Ca("id"),operationName:Ca("name"),operationParentId:Ca("parentId"),operationRootId:Ca("rootId"),operationSyntheticSource:Ca("syntheticSource"),operationCorrelationVector:Ca("correlationVector"),sessionId:kl("id"),sessionIsFirst:kl("isFirst"),sessionIsNew:kl("isNew"),userAccountAcquisitionDate:ui("accountAcquisitionDate"),userAccountId:ui("accountId"),userAgent:ui("userAgent"),userId:ui("id"),userStoreRegion:ui("storeRegion"),userAuthUserId:ui("authUserId"),userAnonymousUserAcquisitionDate:ui("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:ui("authUserAcquisitionDate"),cloudName:Gi("name"),cloudRole:Gi("role"),cloudRoleVer:Gi("roleVer"),cloudRoleInstance:Gi("roleInstance"),cloudEnvironment:Gi("environment"),cloudLocation:Gi("location"),cloudDeploymentUnit:Gi("deploymentUnit"),internalNodeName:ho("nodeName"),internalSdkVersion:ho("sdkVersion"),internalAgentVersion:ho("agentVersion"),internalSnippet:ho("snippet"),internalSdkSrc:ho("sdkSrc")}));var mn=function(){function t(){}return t.create=function(e,r,n,i,o,s){if(n=Mt(i,n)||ir,Ne(e)||Ne(r)||Ne(n))throw Error("Input doesn't contain all required fields");var d="";e[Es]&&(d=e[Es],delete e[Es]);var h={name:n,time:Mr(new Date),iKey:d,ext:s||{},tags:[],data:{},baseType:r,baseData:e};return Ne(o)||Tt(o,function(p,O){h.data[p]=O}),h},t}();var Dr={UserExt:"user",DeviceExt:"device",TraceExt:"trace",WebExt:"web",AppExt:"app",OSExt:"os",SessionExt:"ses",SDKExt:"sdk"},Pt=new Ma;var di="AppInsightsPropertiesPlugin",po="AppInsightsChannelPlugin",Ul="ApplicationInsightsAnalytics";var _u=function(){function t(e,r,n,i){xt(t,this,function(o){var s=null,d=[],h=!1,p;n&&(p=n.logger);function O(){n&&et(n.getTransmissionControls(),function(ie){et(ie,function(oe){return oe.flush(!0)})})}function G(ie){d.push(ie),s||(s=setInterval(function(){var oe=d.slice(0),L=!1;d=[],et(oe,function(pe){pe()?L=!0:d.push(pe)}),d.length===0&&(clearInterval(s),s=null),L&&O()},100))}o.trackPageView=function(ie,oe){var L=ie.name;if(Ne(L)||typeof L!="string"){var pe=nr();L=ie.name=pe&&pe.title||""}var N=ie.uri;if(Ne(N)||typeof N!="string"){var le=$r();N=ie.uri=le&&le.href||""}if(!i.isPerformanceTimingSupported()){e.sendPageViewInternal(ie,oe),O(),p.throwInternal(Me.WARNING,Ee.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 ue=!1,Fe,tt=i.getPerformanceTiming().navigationStart;tt>0&&(Fe=vr(tt,+new Date),i.shouldCollectDuration(Fe)||(Fe=void 0));var ct;!Ne(oe)&&!Ne(oe.duration)&&(ct=oe.duration),(r||!isNaN(ct))&&(isNaN(ct)&&(oe||(oe={}),oe.duration=Fe),e.sendPageViewInternal(ie,oe),O(),ue=!0);var _t=6e4;oe||(oe={}),G(function(){var st=!1;try{if(i.isPerformanceTimingDataReady()){st=!0;var yt={name:L,uri:N};i.populatePageViewPerformanceEvent(yt),!yt.isValid&&!ue?(oe.duration=Fe,e.sendPageViewInternal(ie,oe)):(ue||(oe.duration=yt.durationMs,e.sendPageViewInternal(ie,oe)),h||(e.sendPageViewPerformanceInternal(yt,oe),h=!0))}else tt>0&&vr(tt,+new Date)>_t&&(st=!0,ue||(oe.duration=_t,e.sendPageViewInternal(ie,oe)))}catch(Xt){p.throwInternal(Me.CRITICAL,Ee.TrackPVFailedCalc,"trackPageView failed on page load calculation: "+pt(Xt),{exception:it(Xt)})}return st})}})}return t}();var Su=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(zi()){Ea(this._logger,this.prevPageVisitDataKeyName)!=null&&wr("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new Ev(e,r),i=dr().stringify(n);wa(this._logger,this.prevPageVisitDataKeyName,i)}}catch(o){this._logger.warnToConsole("Call to start failed: "+it(o))}},t.prototype.stopPageVisitTimer=function(){try{if(zi()){var e=ur(),r=Ea(this._logger,this.prevPageVisitDataKeyName);if(r&&Rn()){var n=dr().parse(r);return n.pageVisitTime=e-n.pageVisitStartTime,Il(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 Ev=function(){function t(e,r){this.pageVisitStartTime=ur(),this.pageName=e,this.pageUrl=r}return t}();var xu=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,o=0,s=0,d=0,h=0;(r||n)&&(r?(i=r.duration,o=r.startTime===0?r.connectEnd:vr(r.startTime,r.connectEnd),s=vr(r.requestStart,r.responseStart),d=vr(r.responseStart,r.responseEnd),h=vr(r.responseEnd,r.loadEventEnd)):(i=vr(n.navigationStart,n.loadEventEnd),o=vr(n.navigationStart,n.connectEnd),s=vr(n.requestStart,n.responseStart),d=vr(n.responseStart,n.responseEnd),h=vr(n.responseEnd,n.loadEventEnd)),i===0?this._logger.throwInternal(Me.WARNING,Ee.ErrorPVCalc,"error calculating page view performance.",{total:i,network:o,request:s,response:d,dom:h}):this.shouldCollectDuration(i,o,s,d,h)?i<Math.floor(o)+Math.floor(s)+Math.floor(d)+Math.floor(h)?this._logger.throwInternal(Me.WARNING,Ee.ClientPerformanceMathError,"client performance math error.",{total:i,network:o,request:s,response:d,dom:h}):(e.durationMs=i,e.perfTotal=e.duration=Qr(i),e.networkConnect=Qr(o),e.sentRequest=Qr(s),e.receivedResponse=Qr(d),e.domProcessing=Qr(h),e.isValid=!0):this._logger.throwInternal(Me.WARNING,Ee.InvalidDurationValue,"Invalid page load duration value. Browser perf data won't be sent.",{total:i,network:o,request:s,response:d,dom:h}))},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"],o=n.userAgent,s=!1;if(o)for(var d=0;d<i.length;d++)s=s||o.toLowerCase().indexOf(i[d])!==-1;if(s)return!1;for(var d=0;d<e.length;d++)if(e[d]<0||e[d]>=this.MAX_DURATION_ALLOWED)return!1;return!0},t}();var bu="duration",Hl="event";function _o(t,e){t&&t.dispatchEvent&&e&&t.dispatchEvent(e)}function wv(t){if(t&&t.reason){var e=t.reason;return!Je(e)&&at(e.toString)?e.toString():it(e)}return t||""}var Vl=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier=Ul,r.priority=180,r.autoRoutePVDelay=500;var n,i,o,s=0,d,h;return xt(e,r,function(p,O){var G=$r(!0);d=G&&G.href||"",p.getCookieMgr=function(){return ki(p.core)},p.processTelemetry=function(N,le){Hn(p.core,function(){return p.identifier+":processTelemetry"},function(){var ue=!1,Fe=p._telemetryInitializers.length;le=p._getTelCtx(le);for(var tt=0;tt<Fe;++tt){var ct=p._telemetryInitializers[tt];if(ct)try{if(ct.apply(null,[N])===!1){ue=!0;break}}catch(_t){le.diagLog().throwInternal(Me.CRITICAL,Ee.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+pt(_t),{exception:it(_t)},!0)}}ue||p.processNext(N,le)},function(){return{item:N}},!N.sync)},p.trackEvent=function(N,le){try{var ue=mn.create(N,Jr.dataType,Jr.envelopeType,p.diagLog(),le);p.core.track(ue)}catch(Fe){p.diagLog().throwInternal(Me.WARNING,Ee.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+pt(Fe),{exception:it(Fe)})}},p.startTrackEvent=function(N){try{n.start(N)}catch(le){p.diagLog().throwInternal(Me.CRITICAL,Ee.StartTrackEventFailed,"startTrackEvent failed, event will not be collected: "+pt(le),{exception:it(le)})}},p.stopTrackEvent=function(N,le,ue){try{n.stop(N,void 0,le)}catch(Fe){p.diagLog().throwInternal(Me.CRITICAL,Ee.StopTrackEventFailed,"stopTrackEvent failed, event will not be collected: "+pt(Fe),{exception:it(Fe)})}},p.trackTrace=function(N,le){try{var ue=mn.create(N,Cn.dataType,Cn.envelopeType,p.diagLog(),le);p.core.track(ue)}catch(Fe){p.diagLog().throwInternal(Me.WARNING,Ee.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+pt(Fe),{exception:it(Fe)})}},p.trackMetric=function(N,le){try{var ue=mn.create(N,en.dataType,en.envelopeType,p.diagLog(),le);p.core.track(ue)}catch(Fe){p.diagLog().throwInternal(Me.CRITICAL,Ee.TrackMetricFailed,"trackMetric failed, metric will not be collected: "+pt(Fe),{exception:it(Fe)})}},p.trackPageView=function(N,le){try{var ue=N||{};p._pageViewManager.trackPageView(ue,Zt(Zt(Zt({},ue.properties),ue.measurements),le)),p.config.autoTrackPageVisitTime&&p._pageVisitTimeManager.trackPreviousPageVisit(ue.name,ue.uri)}catch(Fe){p.diagLog().throwInternal(Me.CRITICAL,Ee.TrackPVFailed,"trackPageView failed, page view will not be collected: "+pt(Fe),{exception:it(Fe)})}},p.sendPageViewInternal=function(N,le,ue){var Fe=nr();Fe&&(N.refUri=N.refUri===void 0?Fe.referrer:N.refUri);var tt=mn.create(N,Nr.dataType,Nr.envelopeType,p.diagLog(),le,ue);p.core.track(tt),s=0},p.sendPageViewPerformanceInternal=function(N,le,ue){var Fe=mn.create(N,Mn.dataType,Mn.envelopeType,p.diagLog(),le,ue);p.core.track(Fe)},p.trackPageViewPerformance=function(N,le){try{p._pageViewPerformanceManager.populatePageViewPerformanceEvent(N),p.sendPageViewPerformanceInternal(N,le)}catch(ue){p.diagLog().throwInternal(Me.CRITICAL,Ee.TrackPVFailed,"trackPageViewPerformance failed, page view will not be collected: "+pt(ue),{exception:it(ue)})}},p.startTrackPage=function(N){try{if(typeof N!="string"){var le=nr();N=le&&le.title||""}i.start(N)}catch(ue){p.diagLog().throwInternal(Me.CRITICAL,Ee.StartTrackFailed,"startTrackPage failed, page view may not be collected: "+pt(ue),{exception:it(ue)})}},p.stopTrackPage=function(N,le,ue,Fe){try{if(typeof N!="string"){var tt=nr();N=tt&&tt.title||""}if(typeof le!="string"){var ct=$r();le=ct&&ct.href||""}i.stop(N,le,ue,Fe),p.config.autoTrackPageVisitTime&&p._pageVisitTimeManager.trackPreviousPageVisit(N,le)}catch(_t){p.diagLog().throwInternal(Me.CRITICAL,Ee.StopTrackFailed,"stopTrackPage failed, page view will not be collected: "+pt(_t),{exception:it(_t)})}},p.sendExceptionInternal=function(N,le,ue){var Fe=N.exception||N.error||new Error(ir),tt=new gr(p.diagLog(),Fe,N.properties||le,N.measurements,N.severityLevel,N.id).toInterface(),ct=mn.create(tt,gr.dataType,gr.envelopeType,p.diagLog(),le,ue);p.core.track(ct)},p.trackException=function(N,le){try{p.sendExceptionInternal(N,le)}catch(ue){p.diagLog().throwInternal(Me.CRITICAL,Ee.TrackExceptionFailed,"trackException failed, exception will not be collected: "+pt(ue),{exception:it(ue)})}},p._onerror=function(N){var le=N&&N.error,ue=N&&N.evt;try{if(!ue){var Fe=Un();Fe&&(ue=Fe[Hl])}var tt=N&&N.url||(nr()||{}).URL,ct=N.errorSrc||"window.onerror@"+tt+":"+(N.lineNumber||0)+":"+(N.columnNumber||0),_t={errorSrc:ct,url:tt,lineNumber:N.lineNumber||0,columnNumber:N.columnNumber||0,message:N.message};gl(N.message,N.url,N.lineNumber,N.columnNumber,N.error)?pe(gr.CreateAutoException("Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",tt,N.lineNumber||0,N.columnNumber||0,le,ue,null,ct),_t):(N.errorSrc||(N.errorSrc=ct),p.trackException({exception:N,severityLevel:Ia.Error},_t))}catch(yt){var st=le?le.name+", "+le.message:"null";p.diagLog().throwInternal(Me.CRITICAL,Ee.ExceptionWhileLoggingError,"_onError threw exception while logging error, error will not be collected: "+pt(yt),{exception:it(yt),errorString:st})}},p.addTelemetryInitializer=function(N){p._telemetryInitializers.push(N)},p.initialize=function(N,le,ue,Fe){if(!p.isInitialized()){if(Ne(le))throw Error("Error initializing");O.initialize(N,le,ue,Fe),p.setInitialized(!1);var tt=p._getTelCtx(),ct=p.identifier;p.config=tt.getExtCfg(ct);var _t=e.getDefaultConfig(N);_t!==void 0&&Tt(_t,function(St,Ot){p.config[St]=tt.getConfig(ct,St,Ot),p.config[St]===void 0&&(p.config[St]=Ot)}),p.config.isStorageUseDisabled&&wl();var st={instrumentationKey:function(){return N.instrumentationKey},accountId:function(){return p.config.accountId||N.accountId},sessionRenewalMs:function(){return p.config.sessionRenewalMs||N.sessionRenewalMs},sessionExpirationMs:function(){return p.config.sessionExpirationMs||N.sessionExpirationMs},sampleRate:function(){return p.config.samplingPercentage||N.samplingPercentage},sdkExtension:function(){return p.config.sdkExtension||N.sdkExtension},isBrowserLinkTrackingEnabled:function(){return p.config.isBrowserLinkTrackingEnabled||N.isBrowserLinkTrackingEnabled},appId:function(){return p.config.appId||N.appId}};p._pageViewPerformanceManager=new xu(p.core),p._pageViewManager=new _u(r,p.config.overridePageViewDuration,p.core,p._pageViewPerformanceManager),p._pageVisitTimeManager=new Su(p.diagLog(),function(St,Ot,Nt){return ie(St,Ot,Nt)}),p._telemetryInitializers=p._telemetryInitializers||[],oe(st),n=new gu(p.diagLog(),"trackEvent"),n.action=function(St,Ot,Nt,It){It||(It={}),It[bu]=Nt.toString(),p.trackEvent({name:St,properties:It})},i=new gu(p.diagLog(),"trackPageView"),i.action=function(St,Ot,Nt,It,Ze){Ne(It)&&(It={}),It[bu]=Nt.toString();var T={name:St,uri:Ot,properties:It,measurements:Ze};p.sendPageViewInternal(T,It)};var yt=Un(),Xt=j0(),er=$r(!0),or=r;if(p.config.disableExceptionTracking===!1&&!p.config.autoExceptionInstrumented&&yt){var an="onerror",Tr=yt[an];yt.onerror=function(St,Ot,Nt,It,Ze){var T=yt[Hl],ae=Tr&&Tr(St,Ot,Nt,It,Ze);return ae!==!0&&or._onerror(gr.CreateAutoException(St,Ot,Nt,It,Ze,T)),ae},p.config.autoExceptionInstrumented=!0}if(p.config.disableExceptionTracking===!1&&p.config.enableUnhandledPromiseRejectionTracking===!0&&!p.config.autoUnhandledPromiseInstrumented&&yt){var hr="onunhandledrejection",xr=yt[hr];yt[hr]=function(St){var Ot=yt[Hl],Nt=xr&&xr.call(yt,St);return Nt!==!0&&or._onerror(gr.CreateAutoException(wv(St),er?er.href:"",0,0,St,Ot)),Nt},p.config.autoUnhandledPromiseInstrumented=!0}if(p.config.enableAutoRouteTracking===!0&&Xt&&at(Xt.pushState)&&at(Xt.replaceState)&&yt&&typeof Event<"u"){var Yt=r;et(ue,function(St){St.identifier===di&&(o=St)}),Xt.pushState=function(St){return function(){var Nt=St.apply(this,arguments);return _o(yt,Hi(Yt.config.namePrefix+"pushState")),_o(yt,Hi(Yt.config.namePrefix+"locationchange")),Nt}}(Xt.pushState),Xt.replaceState=function(St){return function(){var Nt=St.apply(this,arguments);return _o(yt,Hi(Yt.config.namePrefix+"replaceState")),_o(yt,Hi(Yt.config.namePrefix+"locationchange")),Nt}}(Xt.replaceState),yt.addEventListener&&(yt.addEventListener(Yt.config.namePrefix+"popstate",function(){_o(yt,Hi(Yt.config.namePrefix+"locationchange"))}),yt.addEventListener(Yt.config.namePrefix+"locationchange",function(){if(o&&o.context&&o.context.telemetryTrace){o.context.telemetryTrace.traceID=qr();var St="_unknown_";er&&er.pathname&&(St=er.pathname+(er.hash||"")),o.context.telemetryTrace.name=Mt(Yt.diagLog(),St)}h&&(d=h),h=er&&er.href||"",setTimeout(function(Ot){Yt.trackPageView({refUri:Ot,properties:{duration:0}})}.bind(r,d),Yt.autoRoutePVDelay)}))}p.setInitialized(!0)}};function ie(N,le,ue){var Fe={PageName:N,PageUrl:le};p.trackMetric({name:"PageVisitTime",average:ue,max:ue,min:ue,sampleCount:1},Fe)}function oe(N){if(!N.isBrowserLinkTrackingEnabled()){var le=["/browserLinkSignalR/","/__browserLink/"],ue=function(Fe){if(Fe.baseType===tn.dataType){var tt=Fe.baseData;if(tt){for(var ct=0;ct<le.length;ct++)if(tt.target&&tt.target.indexOf(le[ct])>=0)return!1}}return!0};L(ue)}}function L(N){p._telemetryInitializers.push(N)}function pe(N,le){var ue=mn.create(N,gr.dataType,gr.envelopeType,p.diagLog(),le);p.core.track(ue)}}),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}(Tn);var gu=function(){function t(e,r){var n=this,i={};n.start=function(o){typeof i[o]<"u"&&e.throwInternal(Me.WARNING,Ee.StartCalledMoreThanOnce,"start was called more than once for this event without calling stop.",{name:o,key:o},!0),i[o]=+new Date},n.stop=function(o,s,d,h){var p=i[o];if(isNaN(p))e.throwInternal(Me.WARNING,Ee.StopCalledWithoutStart,"stop was called without a corresponding start.",{name:o,key:o},!0);else{var O=+new Date,G=vr(p,O);n.action(o,s,G,d,h)}delete i[o],i[o]=void 0}}return t}();var yu=function(){function t(e,r){var n=[],i=!1;this._get=function(){return n},this._set=function(o){return n=o,n},xt(t,this,function(o){o.enqueue=function(s){if(o.count()>=r.eventsLimitInMem()){i||(e.throwInternal(Me.WARNING,Ee.InMemoryStorageBufferFull,"Maximum in-memory buffer size reached: "+o.count(),!0),i=!0);return}n.push(s)},o.count=function(){return n.length},o.size=function(){for(var s=n.length,d=0;d<n.length;d++)s+=n[d].length;return r.emitLineDelimitedJson()||(s+=2),s},o.clear=function(){n=[],i=!1},o.getItems=function(){return n.slice(0)},o.batchPayloads=function(s){if(s&&s.length>0){var d=r.emitLineDelimitedJson()?s.join(`
|
|
21
|
-
|
|
22
|
-
`,{name:d},!0);else{h=[];for(var p=0;p<s.length;p++){var O=s[p],G=n(O,d+"["+p+"]");h.push(G)}}return h}function o(s,d,h){var p;return s&&(p={},Tt(s,function(O,G){if(d==="string")G===void 0?p[O]="undefined":G===null?p[O]="null":G.toString?p[O]=G.toString():p[O]="invalid field: toString() is not defined.";else if(d==="number")if(G===void 0)p[O]="undefined";else if(G===null)p[O]="null";else{var ie=parseFloat(G);isNaN(ie)?p[O]="NaN":p[O]=ie}else p[O]="invalid field: "+h+" is of unknown type.",e.throwInternal(Me.CRITICAL,p[O],null,!0)})),p}})}return t}();var Av=function(){function t(){var e=Un(),r=nr(),n=!1,i=!0;xt(t,this,function(o){try{if(e&&wn(e,"online",h)&&(wn(e,"offline",p),n=!0),r){var s=r.body||r;Wt(s.ononline)||(s.ononline=h,s.onoffline=p,n=!0)}if(n){var d=Rr();d&&!Ne(d.onLine)&&(i=d.onLine)}}catch{n=!1}o.isListening=n,o.isOnline=function(){var O=!0,G=Rr();return n?O=i:G&&!Ne(G.onLine)&&(O=G.onLine),O},o.isOffline=function(){return!o.isOnline()};function h(){i=!0}function p(){i=!1}})}return t.Offline=new t,t}();var jl=Av.Offline;var Iv=8,Nu=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<Iv;)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 Du=function(){function t(){var e=this,r=new Nu,n=new Ma;e.getSamplingScore=function(i){var o=0;return i.tags&&i.tags[n.userId]?o=r.getHashCodeScore(i.tags[n.userId]):i.ext&&i.ext.user&&i.ext.user.id?o=r.getHashCodeScore(i.ext.user.id):i.tags&&i.tags[n.operationId]?o=r.getHashCodeScore(i.tags[n.operationId]):i.ext&&i.ext.telemetryTrace&&i.ext.telemetryTrace.traceID?o=r.getHashCodeScore(i.ext.telemetryTrace.traceID):o=Math.random()*100,o}}return t}();var Ou=function(){function t(e,r){this.INT_MAX_VALUE=2147483647;var n=r||Kn(null);(e>100||e<0)&&(n.throwInternal(Me.WARNING,Ee.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 Du}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 Zn,Cv=65e3;function Ds(t){try{return t.responseText}catch{}return null}function Fu(){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 Mv=(Zn={},Zn[Jr.dataType]=zl,Zn[Cn.dataType]=Pu,Zn[Nr.dataType]=Cu,Zn[Mn.dataType]=Mu,Zn[gr.dataType]=Au,Zn[en.dataType]=Iu,Zn[tn.dataType]=Tu,Zn),Gl=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=po;var n,i,o,s=!1,d,h,p,O={},G=0,ie,oe;return r._senderConfig=Fu(),xt(e,r,function(L,pe){function N(){wr("Method not implemented.")}L.pause=function(){xr(),s=!0},L.resume=function(){s&&(s=!1,i=null,L._buffer.size()>L._senderConfig.maxBatchSizeInBytes()&&L.triggerSend(!0,null,10),hr())},L.flush=function(){if(!s){xr();try{L.triggerSend(!0,null,1)}catch(ae){L.diagLog().throwInternal(Me.CRITICAL,Ee.FlushFailed,"flush failed, telemetry will not be collected: "+pt(ae),{exception:it(ae)})}}},L.onunloadFlush=function(){if(!s)if((L._senderConfig.onunloadDisableBeacon()===!1||L._senderConfig.isBeaconApiDisabled()===!1)&&Oi())try{L.triggerSend(!0,tt,2)}catch(ae){L.diagLog().throwInternal(Me.CRITICAL,Ee.FailedToSendQueuedTelemetry,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+pt(ae),{exception:it(ae)})}else L.flush()},L.teardown=N,L.addHeader=function(ae,Le){O[ae]=Le},L.initialize=function(ae,Le,Ye,ne){pe.initialize(ae,Le,Ye,ne);var be=L._getTelCtx(),Ae=L.identifier;h=new Bu(Le.logger),n=0,i=null,o=0,L._sender=null,p=0;var Ie=L.diagLog(),Pe=Fu();Tt(Pe,function(ot,vt){L._senderConfig[ot]=function(){return be.getConfig(Ae,ot,vt())}}),L._buffer=L._senderConfig.enableSessionStorageBuffer()&&zi()?new wu(Ie,L._senderConfig):new Eu(Ie,L._senderConfig),L._sample=new Ou(L._senderConfig.samplingPercentage(),Ie),T(ae)||Ie.throwInternal(Me.CRITICAL,Ee.InvalidInstrumentationKey,"Invalid Instrumentation key "+ae.instrumentationKey),!ji(L._senderConfig.endpointUrl())&&L._senderConfig.customHeaders()&&L._senderConfig.customHeaders().length>0&&et(L._senderConfig.customHeaders(),function(ot){r.addHeader(ot.header,ot.value)});var We=L._senderConfig,ke=null;!We.disableXhr()&&vs()?ke=Ot:!We.disableXhr()&&Fi()&&(ke=st),!ke&&ds()&&(ke=Xt),ie=ke||st,!We.isBeaconApiDisabled()&&Oi()&&(ke=_t),L._sender=ke||st,!We.onunloadDisableFetch()&&ds(!0)?oe=yt:Oi()?oe=_t:!We.disableXhr()&&vs()?oe=Ot:!We.disableXhr()&&Fi()?oe=st:oe=ie},L.processTelemetry=function(ae,Le){Le=L._getTelCtx(Le);try{if(L._senderConfig.disableTelemetry())return;if(!ae){Le.diagLog().throwInternal(Me.CRITICAL,Ee.CannotSendEmptyTelemetry,"Cannot send empty telemetry");return}if(ae.baseData&&!ae.baseType){Le.diagLog().throwInternal(Me.CRITICAL,Ee.InvalidEvent,"Cannot send telemetry without baseData and baseType");return}if(ae.baseType||(ae.baseType="EventData"),!L._sender){Le.diagLog().throwInternal(Me.CRITICAL,Ee.SenderNotInitialized,"Sender was not initialized");return}if(le(ae))ae[ga]=L._sample.sampleRate;else{Le.diagLog().throwInternal(Me.WARNING,Ee.TelemetrySampledAndNotSent,"Telemetry item was sampled out and not sent",{SampleRate:L._sample.sampleRate});return}var Ye=L._senderConfig.convertUndefined()||void 0,ne=ae.iKey||L._senderConfig.instrumentationKey(),be=e.constructEnvelope(ae,ne,Le.diagLog(),Ye);if(!be){Le.diagLog().throwInternal(Me.CRITICAL,Ee.CreateEnvelopeError,"Unable to create an AppInsights envelope");return}var Ae=!1;if(ae.tags&&ae.tags[ya]&&(et(ae.tags[ya],function(ke){try{ke&&ke(be)===!1&&(Ae=!0,Le.diagLog().warnToConsole("Telemetry processor check returns false"))}catch(ot){Le.diagLog().throwInternal(Me.CRITICAL,Ee.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+pt(ot),{exception:it(ot)},!0)}}),delete ae.tags[ya]),Ae)return;var Ie=h.serialize(be),Pe=L._buffer,We=Pe.size();We+Ie.length>L._senderConfig.maxBatchSizeInBytes()&&L.triggerSend(!0,null,10),Pe.enqueue(Ie),hr()}catch(ke){Le.diagLog().throwInternal(Me.WARNING,Ee.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+pt(ke),{exception:it(ke)})}L.processNext(ae,Le)},L._xhrReadyStateChange=function(ae,Le,Ye){ae.readyState===4&&ue(ae.status,Le,ae.responseURL,Ye,St(ae),Ds(ae)||ae.response)},L.triggerSend=function(ae,Le,Ye){if(ae===void 0&&(ae=!0),!s)try{var ne=L._buffer;if(L._senderConfig.disableTelemetry())ne.clear();else{if(ne.count()>0){var be=ne.getItems();Ze(Ye||0,ae),Le?Le.call(r,be,ae):L._sender(be,ae)}o=+new Date}xr()}catch(Ie){var Ae=pa();(!Ae||Ae>9)&&L.diagLog().throwInternal(Me.CRITICAL,Ee.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+pt(Ie),{exception:it(Ie)})}},L._onError=function(ae,Le,Ye){L.diagLog().throwInternal(Me.WARNING,Ee.OnError,"Failed to send telemetry.",{message:Le}),L._buffer.clearSent(ae)},L._onPartialSuccess=function(ae,Le){for(var Ye=[],ne=[],be=Le.errors.reverse(),Ae=0,Ie=be;Ae<Ie.length;Ae++){var Pe=Ie[Ae],We=ae.splice(Pe.index,1)[0];Yt(Pe.statusCode)?ne.push(We):Ye.push(We)}ae.length>0&&L._onSuccess(ae,Le.itemsAccepted),Ye.length>0&&L._onError(Ye,St(null,["partial success",Le.itemsAccepted,"of",Le.itemsReceived].join(" "))),ne.length>0&&(an(ne),L.diagLog().throwInternal(Me.WARNING,Ee.TransmissionFailed,"Partial success. Delivered: "+ae.length+", Failed: "+Ye.length+". Will retry to send "+ne.length+" our of "+Le.itemsReceived+" items"))},L._onSuccess=function(ae,Le){L._buffer.clearSent(ae)},L._xdrOnLoad=function(ae,Le){var Ye=Ds(ae);if(ae&&(Ye+""=="200"||Ye===""))n=0,L._onSuccess(Le,0);else{var ne=or(Ye);ne&&ne.itemsReceived&&ne.itemsReceived>ne.itemsAccepted&&!L._senderConfig.isRetryDisabled()?L._onPartialSuccess(Le,ne):L._onError(Le,Nt(ae))}};function le(ae){return L._sample.isSampledIn(ae)}function ue(ae,Le,Ye,ne,be,Ae){var Ie=null;if(L._appId||(Ie=or(Ae),Ie&&Ie.appId&&(L._appId=Ie.appId)),(ae<200||ae>=300)&&ae!==0){if((ae===301||ae===307||ae===308)&&!Fe(Ye)){L._onError(Le,be);return}!L._senderConfig.isRetryDisabled()&&Yt(ae)?(an(Le),L.diagLog().throwInternal(Me.WARNING,Ee.TransmissionFailed,". Response code "+ae+". Will retry to send "+Le.length+" items.")):L._onError(Le,be)}else if(jl.isOffline()){if(!L._senderConfig.isRetryDisabled()){var Pe=10;an(Le,Pe),L.diagLog().throwInternal(Me.WARNING,Ee.TransmissionFailed,". Offline - Response Code: ".concat(ae,". Offline status: ").concat(jl.isOffline(),". Will retry to send ").concat(Le.length," items."))}}else Fe(Ye),ae===206?(Ie||(Ie=or(Ae)),Ie&&!L._senderConfig.isRetryDisabled()?L._onPartialSuccess(Le,Ie):L._onError(Le,be)):(n=0,L._onSuccess(Le,ne))}function Fe(ae){return p>=10?!1:!Ne(ae)&&ae!==""&&ae!==L._senderConfig.endpointUrl()?(L._senderConfig.endpointUrl=function(){return ae},++p,!0):!1}function tt(ae,Le){oe?oe(ae,!1):_t(ae,Le)}function ct(ae){var Le=Rr(),Ye=L._buffer,ne=L._senderConfig.endpointUrl(),be=L._buffer.batchPayloads(ae),Ae=new Blob([be],{type:"text/plain;charset=UTF-8"}),Ie=Le.sendBeacon(ne,Ae);return Ie&&(Ye.markAsSent(ae),L._onSuccess(ae,ae.length)),Ie}function _t(ae,Le){if(cr(ae)&&ae.length>0&&!ct(ae)){for(var Ye=[],ne=0;ne<ae.length;ne++){var be=ae[ne];ct([be])||Ye.push(be)}Ye.length>0&&(ie(Ye,!0),L.diagLog().throwInternal(Me.WARNING,Ee.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with normal sender."))}}function st(ae,Le){var Ye=new XMLHttpRequest,ne=L._senderConfig.endpointUrl();try{Ye[In]=!0}catch{}Ye.open("POST",ne,Le),Ye.setRequestHeader("Content-type","application/json"),ji(ne)&&Ye.setRequestHeader(Ct.sdkContextHeader,Ct.sdkContextHeaderAppIdRequest),et(un(O),function(Ae){Ye.setRequestHeader(Ae,O[Ae])}),Ye.onreadystatechange=function(){return L._xhrReadyStateChange(Ye,ae,ae.length)},Ye.onerror=function(Ae){return L._onError(ae,St(Ye),Ae)};var be=L._buffer.batchPayloads(ae);Ye.send(be),L._buffer.markAsSent(ae)}function yt(ae,Le){if(cr(ae)){for(var Ye=ae.length,ne=0;ne<ae.length;ne++)Ye+=ae[ne].length;G+Ye<=Cv?er(ae,!1):Oi()?_t(ae,Le):(ie&&ie(ae,!0),L.diagLog().throwInternal(Me.WARNING,Ee.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with xhrSender."))}}function Xt(ae,Le){er(ae,!0)}function er(ae,Le){var Ye,ne=L._senderConfig.endpointUrl(),be=L._buffer.batchPayloads(ae),Ae=new Blob([be],{type:"application/json"}),Ie=new Headers,Pe=be.length,We=!1,ke=!1;ji(ne)&&Ie.append(Ct.sdkContextHeader,Ct.sdkContextHeaderAppIdRequest),et(un(O),function(ye){Ie.append(ye,O[ye])});var ot=(Ye={method:"POST",headers:Ie,body:Ae},Ye[In]=!0,Ye);Le||(ot.keepalive=!0,We=!0,G+=Pe);var vt=new Request(ne,ot);try{vt[In]=!0}catch{}L._buffer.markAsSent(ae);try{fetch(vt).then(function(ye){Le||(G-=Pe,Pe=0),ke||(ke=!0,ye.ok?ye.text().then(function(br){ue(ye.status,ae,ye.url,ae.length,ye.statusText,br)}):L._onError(ae,ye.statusText))}).catch(function(ye){Le||(G-=Pe,Pe=0),ke||(ke=!0,L._onError(ae,ye.message))})}catch(ye){ke||L._onError(ae,it(ye))}We&&!ke&&(ke=!0,L._onSuccess(ae,ae.length))}function or(ae){try{if(ae&&ae!==""){var Le=dr().parse(ae);if(Le&&Le.itemsReceived&&Le.itemsReceived>=Le.itemsAccepted&&Le.itemsReceived-Le.itemsAccepted===Le.errors.length)return Le}}catch(Ye){L.diagLog().throwInternal(Me.CRITICAL,Ee.InvalidBackendResponse,"Cannot parse the response. "+pt(Ye),{response:ae})}return null}function an(ae,Le){if(Le===void 0&&(Le=1),!(!ae||ae.length===0)){var Ye=L._buffer;Ye.clearSent(ae),n++;for(var ne=0,be=ae;ne<be.length;ne++){var Ae=be[ne];Ye.enqueue(Ae)}Tr(Le),hr()}}function Tr(ae){var Le=10,Ye;if(n<=1)Ye=Le;else{var ne=(Math.pow(2,n)-1)/2,be=Math.floor(Math.random()*ne*Le)+1;be=ae*be,Ye=Math.max(Math.min(be,3600),Le)}var Ae=ur()+Ye*1e3;i=Ae}function hr(){if(!d&&!s){var ae=i?Math.max(0,i-ur()):0,Le=Math.max(L._senderConfig.maxBatchInterval(),ae);d=setTimeout(function(){d=null,L.triggerSend(!0,null,1)},Le)}}function xr(){clearTimeout(d),d=null,i=null}function Yt(ae){return ae===408||ae===429||ae===500||ae===503}function St(ae,Le){return ae?"XMLHttpRequest,Status:"+ae.status+",Response:"+Ds(ae)||ae.response||"":Le}function Ot(ae,Le){var Ye=L._buffer,ne=Un(),be=new XDomainRequest;be.onload=function(){return L._xdrOnLoad(be,ae)},be.onerror=function(We){return L._onError(ae,Nt(be),We)};var Ae=ne&&ne.location&&ne.location.protocol||"";if(L._senderConfig.endpointUrl().lastIndexOf(Ae,0)!==0){L.diagLog().throwInternal(Me.WARNING,Ee.TransmissionFailed,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),Ye.clear();return}var Ie=L._senderConfig.endpointUrl().replace(/^(https?:)/,"");be.open("POST",Ie);var Pe=Ye.batchPayloads(ae);be.send(Pe),Ye.markAsSent(ae)}function Nt(ae,Le){return ae?"XDomainRequest,Response:"+Ds(ae)||"":Le}function It(){var ae="getNotifyMgr";return L.core[ae]?L.core[ae]():L.core._notificationManager}function Ze(ae,Le){var Ye=It();if(Ye&&Ye.eventsSendRequest)try{Ye.eventsSendRequest(ae,Le)}catch(ne){L.diagLog().throwInternal(Me.CRITICAL,Ee.NotificationException,"send request notification failed: "+pt(ne),{exception:it(ne)})}}function T(ae){var Le=Ne(ae.disableInstrumentationKeyValidation)?!1:ae.disableInstrumentationKeyValidation;if(Le)return!0;var Ye="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",ne=new RegExp(Ye);return ne.test(ae.instrumentationKey)}}),r}return e.constructEnvelope=function(r,n,i,o){var s;n!==r.iKey&&!Ne(n)?s=Zt(Zt({},r),{iKey:n}):s=r;var d=Mv[s.baseType]||zl;return d(i,s,o)},e}(Tn);var Pv="ai_session",Xl=function(){function t(){}return t}();var Lu=function(){function t(e,r){var n=this,i,o,s=Kn(r),d=ki(r);xt(t,n,function(h){e||(e={}),at(e.sessionExpirationMs)||(e.sessionExpirationMs=function(){return t.acquisitionSpan}),at(e.sessionRenewalMs)||(e.sessionRenewalMs=function(){return t.renewalSpan}),h.config=e;var p=h.config.sessionCookiePostfix&&h.config.sessionCookiePostfix()?h.config.sessionCookiePostfix():h.config.namePrefix&&h.config.namePrefix()?h.config.namePrefix():"";i=function(){return Pv+p},h.automaticSession=new Xl,h.update=function(){var pe=ur(),N=!1,le=h.automaticSession;le.id||(N=!O(le,pe));var ue=h.config.sessionExpirationMs();if(!N&&ue>0){var Fe=h.config.sessionRenewalMs(),tt=pe-le.acquisitionDate,ct=pe-le.renewalDate;N=tt<0||ct<0,N=N||tt>ue,N=N||ct>Fe}N?ie(pe):(!o||pe-o>t.cookieUpdateInterval)&&oe(le,pe)},h.backup=function(){var pe=h.automaticSession;L(pe.id,pe.acquisitionDate,pe.renewalDate)};function O(pe,N){var le=!1,ue=d.get(i());if(ue&&at(ue.split))le=G(pe,ue);else{var Fe=Rl(s,i());Fe&&(le=G(pe,Fe))}return le||!!pe.id}function G(pe,N){var le=!1,ue=", session will be reset",Fe=N.split("|");if(Fe.length>=2)try{var tt=+Fe[1]||0,ct=+Fe[2]||0;isNaN(tt)||tt<=0?s.throwInternal(Me.WARNING,Ee.SessionRenewalDateIsZero,"AI session acquisition date is 0"+ue):isNaN(ct)||ct<=0?s.throwInternal(Me.WARNING,Ee.SessionRenewalDateIsZero,"AI session renewal date is 0"+ue):Fe[0]&&(pe.id=Fe[0],pe.acquisitionDate=tt,pe.renewalDate=ct,le=!0)}catch(_t){s.throwInternal(Me.CRITICAL,Ee.ErrorParsingAISessionCookie,"Error parsing ai_session value ["+(N||"")+"]"+ue+" - "+pt(_t),{exception:it(_t)})}return le}function ie(pe){var N=h.config||{},le=(N.getNewId?N.getNewId():null)||ba;h.automaticSession.id=le(N.idLength?N.idLength():22),h.automaticSession.acquisitionDate=pe,oe(h.automaticSession,pe),Rs()||s.throwInternal(Me.WARNING,Ee.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")}function oe(pe,N){var le=pe.acquisitionDate;pe.renewalDate=N;var ue=h.config,Fe=ue.sessionRenewalMs(),tt=le+ue.sessionExpirationMs()-N,ct=[pe.id,le,N],_t=0;tt<Fe?_t=tt/1e3:_t=Fe/1e3;var st=ue.cookieDomain?ue.cookieDomain():null;d.set(i(),ct.join("|"),ue.sessionExpirationMs()>0?_t:null,st),o=N}function L(pe,N,le){Tl(s,i(),[pe,N,le].join("|"))}})}return t.acquisitionSpan=864e5,t.renewalSpan=18e5,t.cookieUpdateInterval=6e4,t}();var ku=function(){function t(){}return t}();var Uu=function(){function t(){this.id="browser",this.deviceClass="Browser"}return t}();var Bv="2.7.4",Hu=function(){function t(e){this.sdkVersion=(e.sdkExtension&&e.sdkExtension()?e.sdkExtension()+"_":"")+"javascript:"+Bv}return t}();function Vu(t){return!(typeof t!="string"||!t||t.match(/,|;|=| |\|/))}var qu=function(){function t(e,r){this.isNewUser=!1,this.isUserCookieSet=!1;var n=Kn(r),i=ki(r),o;xt(t,this,function(s){s.config=e;var d=s.config.userCookiePostfix&&s.config.userCookiePostfix()?s.config.userCookiePostfix():"";o=function(){return t.userCookieName+d};var h=i.get(o());if(h){s.isNewUser=!1;var p=h.split(t.cookieSeparator);p.length>0&&(s.id=p[0],s.isUserCookieSet=!!s.id)}function O(){var le=e||{},ue=(le.getNewId?le.getNewId():null)||ba,Fe=ue(le.idLength?e.idLength():22);return Fe}function G(le){var ue=Mr(new Date);s.accountAcquisitionDate=ue,s.isNewUser=!0;var Fe=[le,ue];return Fe}function ie(le){var ue=31536e3;s.isUserCookieSet=i.set(o(),le,ue)}if(!s.id){s.id=O();var oe=G(s.id);ie(oe.join(t.cookieSeparator));var L=e.namePrefix&&e.namePrefix()?e.namePrefix()+"ai_session":"ai_session";Al(n,L)}s.accountId=e.accountId?e.accountId():void 0;var pe=i.get(t.authUserCookieName);if(pe){pe=decodeURI(pe);var N=pe.split(t.cookieSeparator);N[0]&&(s.authenticatedId=N[0]),N.length>1&&N[1]&&(s.accountId=N[1])}s.setAuthenticatedUserContext=function(le,ue,Fe){Fe===void 0&&(Fe=!1);var tt=!Vu(le)||ue&&!Vu(ue);if(tt){n.throwInternal(Me.WARNING,Ee.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=le;var ct=s.authenticatedId;ue&&(s.accountId=ue,ct=[s.authenticatedId,s.accountId].join(t.cookieSeparator)),Fe&&i.set(t.authUserCookieName,encodeURI(ct))},s.clearAuthenticatedUserContext=function(){s.authenticatedId=null,s.accountId=null,i.del(t.authUserCookieName)},s.update=function(le){if(s.id!==le||!s.isUserCookieSet){var ue=le||O(),Fe=G(ue);ie(Fe.join(t.cookieSeparator))}}})}return t.cookieSeparator="|",t.userCookieName="ai_user",t.authUserCookieName="ai_authUser",t}();var zu=function(){function t(){}return t}();var ju=function(){function t(e,r,n,i){var o=this;o.traceID=e||qr(),o.parentID=r,o.name=n;var s=$r();!n&&s&&s.pathname&&(o.name=s.pathname),o.name=Mt(i,o.name)}return t}();var Os="ext",Fs="tags";function Pa(t,e){t&&t[e]&&un(t[e]).length===0&&delete t[e]}var Gu=function(){function t(e,r){var n=this,i=e.logger;this.appId=function(){return null},this.getSessionId=function(){return null},xt(t,this,function(o){o.application=new ku,o.internal=new Hu(r),Ni()&&(o.sessionManager=new Lu(r,e),o.device=new Uu,o.location=new zu,o.user=new qu(r,e),o.telemetryTrace=new ju(void 0,void 0,void 0,i),o.session=new Xl),o.getSessionId=function(){var s=o.session,d=null;if(s&&Je(s.id))d=s.id;else{var h=(o.sessionManager||{}).automaticSession;d=h&&Je(h.id)?h.id:null}return d},o.applySessionContext=function(s,d){ht(fr(s.ext,Dr.AppExt),"sesId",o.getSessionId(),Je)},o.applyOperatingSystemContxt=function(s,d){ht(s.ext,Dr.OSExt,o.os)},o.applyApplicationContext=function(s,d){var h=o.application;if(h){var p=fr(s,Fs);ht(p,Pt.applicationVersion,h.ver,Je),ht(p,Pt.applicationBuild,h.build,Je)}},o.applyDeviceContext=function(s,d){var h=o.device;if(h){var p=fr(fr(s,Os),Dr.DeviceExt);ht(p,"localId",h.id,Je),ht(p,"ip",h.ip,Je),ht(p,"model",h.model,Je),ht(p,"deviceClass",h.deviceClass,Je)}},o.applyInternalContext=function(s,d){var h=o.internal;if(h){var p=fr(s,Fs);ht(p,Pt.internalAgentVersion,h.agentVersion,Je),ht(p,Pt.internalSdkVersion,h.sdkVersion,Je),(s.baseType===Xn.dataType||s.baseType===Nr.dataType)&&(ht(p,Pt.internalSnippet,h.snippetVer,Je),ht(p,Pt.internalSdkSrc,h.sdkSrc,Je))}},o.applyLocationContext=function(s,d){var h=n.location;h&&ht(fr(s,Fs,[]),Pt.locationIp,h.ip,Je)},o.applyOperationContext=function(s,d){var h=o.telemetryTrace;if(h){var p=fr(fr(s,Os),Dr.TraceExt,{traceID:void 0,parentID:void 0});ht(p,"traceID",h.traceID,Je),ht(p,"name",h.name,Je),ht(p,"parentID",h.parentID,Je)}},o.applyWebContext=function(s,d){var h=n.web;h&&ht(fr(s,Os),Dr.WebExt,h)},o.applyUserContext=function(s,d){var h=o.user;if(h){var p=fr(s,Fs,[]);ht(p,Pt.userAccountId,h.accountId,Je);var O=fr(fr(s,Os),Dr.UserExt);ht(O,"id",h.id,Je),ht(O,"authId",h.authenticatedId,Je)}},o.cleanUp=function(s,d){var h=s.ext;h&&(Pa(h,Dr.DeviceExt),Pa(h,Dr.UserExt),Pa(h,Dr.WebExt),Pa(h,Dr.OSExt),Pa(h,Dr.AppExt),Pa(h,Dr.TraceExt))}})}return t}();var Nv=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.priority=110,r.identifier=di;var n,i;return xt(e,r,function(o,s){o.initialize=function(h,p,O,G){s.initialize(h,p,O,G);var ie=o._getTelCtx(),oe=o.identifier,L=e.getDefaultConfig();i=i||{},Tt(L,function(pe,N){i[pe]=function(){return ie.getConfig(oe,pe,N())}}),o.context=new Gu(p,i),n=bl(O,po),o.context.appId=function(){return n?n._appId:null},o._extConfig=i},o.processTelemetry=function(h,p){if(!Ne(h)){p=o._getTelCtx(p),h.name===Nr.envelopeType&&p.diagLog().resetInternalMessageCount();var O=o.context||{};O.session&&typeof o.context.session.id!="string"&&O.sessionManager&&O.sessionManager.update();var G=O.user;if(G&&!G.isUserCookieSet&&G.update(O.user.id),d(h,p),G&&G.isNewUser){G.isNewUser=!1;var ie=new Xn(Ee.SendBrowserInfoOnUserInit,(Rr()||{}).userAgent||"");p.diagLog().logInternalMessage(Me.CRITICAL,ie)}o.processNext(h,p)}};function d(h,p){fr(h,"tags",[]),fr(h,"ext",{});var O=o.context;O.applySessionContext(h,p),O.applyApplicationContext(h,p),O.applyDeviceContext(h,p),O.applyOperationContext(h,p),O.applyUserContext(h,p),O.applyOperatingSystemContxt(h,p),O.applyWebContext(h,p),O.applyLocationContext(h,p),O.applyInternalContext(h,p),O.cleanUp(h,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}(Tn),Kl=Nv;var rn="properties";function Xu(t,e,r){var n=0,i=t[e],o=t[r];return i&&o&&(n=vr(i,o)),n}function Yi(t,e,r,n,i){var o=0,s=Xu(r,n,i);return s&&(o=mi(t,e,Qr(s))),o}function mi(t,e,r){var n="ajaxPerf",i=0;if(t&&e&&r){var o=t[n]=t[n]||{};o[e]=r,i=1}return i}function Dv(t,e){var r=t.perfTiming,n=e[rn]||{},i=0,o="name",s="Start",d="End",h="domainLookup",p="connect",O="redirect",G="request",ie="response",oe="duration",L="startTime",pe=h+s,N=h+d,le=p+s,ue=p+d,Fe=G+s,tt=G+d,ct=ie+s,_t=ie+d,st=O+s,yt=O=d,Xt="transferSize",er="encodedBodySize",or="decodedBodySize",an="serverTiming";if(r){i|=Yi(n,O,r,st,yt),i|=Yi(n,h,r,pe,N),i|=Yi(n,p,r,le,ue),i|=Yi(n,G,r,Fe,tt),i|=Yi(n,ie,r,ct,_t),i|=Yi(n,"networkConnect",r,L,ue),i|=Yi(n,"sentRequest",r,Fe,_t);var Tr=r[oe];Tr||(Tr=Xu(r,L,_t)||0),i|=mi(n,oe,Tr),i|=mi(n,"perfTotal",Tr);var hr=r[an];if(hr){var xr={};et(hr,function(Yt,St){var Ot=D0(Yt[o]||""+St),Nt=xr[Ot]||{};Tt(Yt,function(It,Ze){(It!==o&&Je(Ze)||va(Ze))&&(Nt[It]&&(Ze=Nt[It]+";"+Ze),(Ze||!Je(Ze))&&(Nt[It]=Ze))}),xr[Ot]=Nt}),i|=mi(n,an,xr)}i|=mi(n,Xt,r[Xt]),i|=mi(n,er,r[er]),i|=mi(n,or,r[or])}else t.perfMark&&(i|=mi(n,"missing",t.perfAttempts));i&&(e[rn]=n)}var Ov=function(){function t(){var e=this;e.openDone=!1,e.setRequestHeaderDone=!1,e.sendDone=!1,e.abortDone=!1,e.stateChangeAttached=!1}return t}();var Wl=function(){function t(e,r,n){var i=this,o=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 Ov,i.clientFailure=0,i.traceID=e,i.spanID=r,xt(t,i,function(d){d.getAbsoluteUrl=function(){return d.requestUrl?Ts(d.requestUrl):null},d.getPathName=function(){return d.requestUrl?Yn(o,As(d.method,d.requestUrl)):null},d.CreateTrackItem=function(h,p,O){var G;if(d.ajaxTotalDuration=Math.round(vr(d.requestSentTime,d.responseFinishedTime)*1e3)/1e3,d.ajaxTotalDuration<0)return null;var ie=(G={id:"|"+d.traceID+"."+d.spanID,target:d.getAbsoluteUrl(),name:d.getPathName(),type:h,startTime:null,duration:d.ajaxTotalDuration,success:+d.status>=200&&+d.status<400,responseCode:+d.status,method:d.method},G[rn]={HttpMethod:d.method},G);if(d.requestSentTime&&(ie.startTime=new Date,ie.startTime.setTime(d.requestSentTime)),Dv(d,ie),p&&un(d.requestHeaders).length>0&&(ie[rn]=ie[rn]||{},ie[rn].requestHeaders=d.requestHeaders),O){var oe=O();if(oe){var L=oe.correlationContext;if(L&&(ie.correlationContext=L),oe.headerMap&&un(oe.headerMap).length>0&&(ie[rn]=ie[rn]||{},ie[rn].responseHeaders=oe.headerMap),d.errorStatusText&&d.status>=400){var pe=oe.type;ie[rn]=ie[rn]||{},(pe===""||pe==="text")&&(ie[rn][s]=oe[s]?oe.statusText+" - "+oe[s]:oe.statusText),pe==="json"&&(ie[rn][s]=oe.response?oe.statusText+" - "+JSON.stringify(oe.response):oe.statusText)}}}return ie}})}return t}();var Yl=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=qr(),r&&t.isValidSpanId(r)?n.spanId=r:n.spanId=qr().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 Ku="ai.ajxmn.",xo="diagLog",nn="ajaxData",Yu="throwInternal",bo="fetch",Wu=0;function Fv(){var t=cn();return!t||Ne(t.Request)||Ne(t.Request[Gt])||Ne(t[bo])?null:t[bo]}function Lv(t){var e=!1;if(Fi()){var r=XMLHttpRequest[Gt];e=!Ne(r)&&!Ne(r.open)&&!Ne(r.send)&&!Ne(r.abort)}var n=pa();if(n&&n<9&&(e=!1),e)try{var i=new XMLHttpRequest;i[nn]={};var o=XMLHttpRequest[Gt].open;XMLHttpRequest[Gt].open=o}catch(s){e=!1,go(t,Ee.FailedMonitorAjaxOpen,"Failed to enable XMLHttpRequest monitoring, extension is not supported",{exception:it(s)})}return e}function Ls(t){var e="";try{!Ne(t)&&!Ne(t[nn])&&!Ne(t[nn].requestUrl)&&(e+="(url: '"+t[nn].requestUrl+"')")}catch{}return e}function go(t,e,r,n,i){t[xo]()[Yu](Me.CRITICAL,e,r,n,i)}function Ba(t,e,r,n,i){t[xo]()[Yu](Me.WARNING,e,r,n,i)}function So(t,e,r){return function(n){go(t,e,r,{ajaxDiagnosticsMessage:Ls(n.inst),exception:it(n.err)})}}function Na(t,e){return t&&e?t.indexOf(e):-1}var $l=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(),o=!1,s=!1,d=i&&i.host&&i.host.toLowerCase(),h=e.getEmptyConfig(),p=!1,O=!1,G=0,ie,oe,L,pe,N=!1,le=0,ue=!1,Fe=[],tt={},ct,_t;return xt(e,r,function(st,yt){st.initialize=function(ne,be,Ae,Ie){if(!st.isInitialized()){yt.initialize(ne,be,Ae,Ie);var Pe=st._getTelCtx(),We=e.getDefaultConfig();Tt(We,function(br,Ar){h[br]=Pe.getConfig(e.identifier,br,Ar)});var ke=h.distributedTracingMode;if(p=h.enableRequestHeaderTracking,O=h.enableAjaxErrorStatusText,N=h.enableAjaxPerfTracking,le=h.maxAjaxCallsPerView,ue=h.enableResponseHeaderTracking,ct=h.excludeRequestFromAutoTrackingPatterns,_t=h.addRequestContext,L=ke===dn.AI||ke===dn.AI_AND_W3C,oe=ke===dn.AI_AND_W3C||ke===dn.W3C,N){var ot=ne.instrumentationKey||"unkwn";ot.length>5?pe=Ku+ot.substring(ot.length-5)+".":pe=Ku+ot+"."}if(h.disableAjaxTracking===!1&&an(),er(),Ae.length>0&&Ae){for(var vt=void 0,ye=0;!vt&&ye<Ae.length;)Ae[ye]&&Ae[ye].identifier===di&&(vt=Ae[ye]),ye++;vt&&(ie=vt.context)}}},st.teardown=function(){et(Fe,function(ne){ne.rm()}),Fe=[],o=!1,s=!1,st.setInitialized(!1)},st.trackDependencyData=function(ne,be){st[n](ne,be)},st.includeCorrelationHeaders=function(ne,be,Ae,Ie){var Pe=st._currentWindowHost||d;if(be){if($n.canIncludeCorrelationHeader(h,ne.getAbsoluteUrl(),Pe)){if(Ae||(Ae={}),Ae.headers=new Headers(Ae.headers||(be instanceof Request?be.headers||{}:{})),L){var We="|"+ne.traceID+"."+ne.spanID;Ae.headers.set(Ct.requestIdHeader,We),p&&(ne.requestHeaders[Ct.requestIdHeader]=We)}var ke=h.appId||ie&&ie.appId();if(ke&&(Ae.headers.set(Ct.requestContextHeader,Ct.requestContextAppIdFormat+ke),p&&(ne.requestHeaders[Ct.requestContextHeader]=Ct.requestContextAppIdFormat+ke)),oe){var ot=new Yl(ne.traceID,ne.spanID);Ae.headers.set(Ct.traceParentHeader,ot.toString()),p&&(ne.requestHeaders[Ct.traceParentHeader]=ot.toString())}}return Ae}else if(Ie){if($n.canIncludeCorrelationHeader(h,ne.getAbsoluteUrl(),Pe)){if(L){var We="|"+ne.traceID+"."+ne.spanID;Ie.setRequestHeader(Ct.requestIdHeader,We),p&&(ne.requestHeaders[Ct.requestIdHeader]=We)}var ke=h.appId||ie&&ie.appId();if(ke&&(Ie.setRequestHeader(Ct.requestContextHeader,Ct.requestContextAppIdFormat+ke),p&&(ne.requestHeaders[Ct.requestContextHeader]=Ct.requestContextAppIdFormat+ke)),oe){var ot=new Yl(ne.traceID,ne.spanID);Ie.setRequestHeader(Ct.traceParentHeader,ot.toString()),p&&(ne.requestHeaders[Ct.traceParentHeader]=ot.toString())}}return Ie}},st[n]=function(ne,be,Ae){if(le===-1||G<le){(h.distributedTracingMode===dn.W3C||h.distributedTracingMode===dn.AI_AND_W3C)&&typeof ne.id=="string"&&ne.id[ne.id.length-1]!=="."&&(ne.id+="."),Ne(ne.startTime)&&(ne.startTime=new Date);var Ie=mn.create(ne,tn.dataType,tn.envelopeType,st[xo](),be,Ae);st.core.track(Ie)}else G===le&&go(st,Ee.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);++G};function Xt(ne){var be=!0;return(ne||h.ignoreHeaders)&&et(h.ignoreHeaders,function(Ae){if(Ae.toLowerCase()===ne.toLowerCase())return be=!1,-1}),be}function er(){var ne=Fv();if(!!ne){var be=cn(),Ae=ne.polyfill;h.disableFetchTracking===!1?(Fe.push(lo(be,bo,{req:function(Ie,Pe,We){var ke;if(o&&!Tr(null,Pe,We)&&!(Ae&&s)){var ot=Ie.ctx();ke=T(Pe,We);var vt=st.includeCorrelationHeaders(ke,Pe,We);vt!==We&&Ie.set(1,vt),ot.data=ke}},rsp:function(Ie,Pe){var We=Ie.ctx().data;We&&(Ie.rslt=Ie.rslt.then(function(ke){return Le(Ie,(ke||{}).status,Pe,ke,We,function(){var ot={statusText:ke.statusText,headerMap:null,correlationContext:Ye(ke)};if(ue){var vt={};ke.headers.forEach(function(ye,br){Xt(br)&&(vt[br]=ye)}),ot.headerMap=vt}return ot}),ke}).catch(function(ke){throw Le(Ie,0,Pe,null,We,null,{error:ke.message}),ke}))},hkErr:So(st,Ee.FailedMonitorAjaxOpen,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.")})),o=!0):Ae&&Fe.push(lo(be,bo,{req:function(Ie,Pe,We){Tr(null,Pe,We)}})),Ae&&(be[bo].polyfill=Ae)}}function or(ne,be,Ae){Fe.push(hl(ne,be,Ae))}function an(){Lv(st)&&!s&&(or(XMLHttpRequest,"open",{req:function(ne,be,Ae,Ie){var Pe=ne.inst,We=Pe[nn];!Tr(Pe,Ae)&&hr(Pe,!0)&&((!We||!We.xhrMonitoringState.openDone)&&xr(Pe,be,Ae,Ie),Yt(Pe))},hkErr:So(st,Ee.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")}),or(XMLHttpRequest,"send",{req:function(ne,be){var Ae=ne.inst,Ie=Ae[nn];hr(Ae)&&!Ie.xhrMonitoringState.sendDone&&(It("xhr",Ie),Ie.requestSentTime=Ra(),st.includeCorrelationHeaders(Ie,void 0,void 0,Ae),Ie.xhrMonitoringState.sendDone=!0)},hkErr:So(st,Ee.FailedMonitorAjaxSend,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")}),or(XMLHttpRequest,"abort",{req:function(ne){var be=ne.inst,Ae=be[nn];hr(be)&&!Ae.xhrMonitoringState.abortDone&&(Ae.aborted=1,Ae.xhrMonitoringState.abortDone=!0)},hkErr:So(st,Ee.FailedMonitorAjaxAbort,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")}),p&&or(XMLHttpRequest,"setRequestHeader",{req:function(ne,be,Ae){var Ie=ne.inst;hr(Ie)&&Xt(be)&&(Ie[nn].requestHeaders[be]=Ae)},hkErr:So(st,Ee.FailedMonitorAjaxSetRequestHeader,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")}),s=!0)}function Tr(ne,be,Ae){var Ie=!1,Pe=((Je(be)?be:(be||{}).url||"")||"").toLowerCase();if(et(ct,function(ot){var vt=ot;Je(ot)&&(vt=new RegExp(ot)),Ie||(Ie=vt.test(Pe))}),Ie)return Ie;var We=Na(Pe,"?"),ke=Na(Pe,"#");return(We===-1||ke!==-1&&ke<We)&&(We=ke),We!==-1&&(Pe=Pe.substring(0,We)),Ne(ne)?Ne(be)||(Ie=(typeof be=="object"?be[In]===!0:!1)||(Ae?Ae[In]===!0:!1)):Ie=ne[In]===!0||Pe[In]===!0,!Ie&&Pe&&ji(Pe)&&(Ie=!0),Ie?tt[Pe]||(tt[Pe]=1):tt[Pe]&&(Ie=!0),Ie}function hr(ne,be){var Ae=!0,Ie=s;return Ne(ne)||(Ae=be===!0||!Ne(ne[nn])),Ie&&Ae}function xr(ne,be,Ae,Ie){var Pe=ie&&ie.telemetryTrace&&ie.telemetryTrace.traceID||qr(),We=qr().substr(0,16),ke=new Wl(Pe,We,st[xo]());ke.method=be,ke.requestUrl=Ae,ke.xhrMonitoringState.openDone=!0,ke.requestHeaders={},ke.async=Ie,ke.errorStatusText=O,ne[nn]=ke}function Yt(ne){ne[nn].xhrMonitoringState.stateChangeAttached=wn(ne,"readystatechange",function(){try{ne&&ne.readyState===4&&hr(ne)&&Ot(ne)}catch(Ae){var be=it(Ae);(!be||Na(be.toLowerCase(),"c00c023f")===-1)&&go(st,Ee.FailedMonitorAjaxRSC,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:Ls(ne),exception:be})}})}function St(ne){try{var be=ne.responseType;if(be===""||be==="text")return ne.responseText}catch{}return null}function Ot(ne){var be=ne[nn];be.responseFinishedTime=Ra(),be.status=ne.status;function Ae(Ie,Pe){var We=Pe||{};We.ajaxDiagnosticsMessage=Ls(ne),Ie&&(We.exception=it(Ie)),Ba(st,Ee.FailedMonitorAjaxDur,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",We)}Ze("xmlhttprequest",be,function(){try{var Ie=be.CreateTrackItem("Ajax",p,function(){var We={statusText:ne.statusText,headerMap:null,correlationContext:Nt(ne),type:ne.responseType,responseText:St(ne),response:ne.response};if(ue){var ke=ne.getAllResponseHeaders();if(ke){var ot=Qt(ke).split(/[\r\n]+/),vt={};et(ot,function(ye){var br=ye.split(": "),Ar=br.shift(),yr=br.join(": ");Xt(Ar)&&(vt[Ar]=yr)}),We.headerMap=vt}}return We}),Pe=void 0;try{_t&&(Pe=_t({status:ne.status,xhr:ne}))}catch{Ba(st,Ee.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}Ie?(Pe!==void 0&&(Ie.properties=Zt(Zt({},Ie.properties),Pe)),st[n](Ie)):Ae(null,{requestSentTime:be.requestSentTime,responseFinishedTime:be.responseFinishedTime})}finally{try{ne[nn]=null}catch{}}},function(Ie){Ae(Ie,null)})}function Nt(ne){try{var be=ne.getAllResponseHeaders();if(be!==null){var Ae=Na(be.toLowerCase(),Ct.requestContextHeaderLowerCase);if(Ae!==-1){var Ie=ne.getResponseHeader(Ct.requestContextHeader);return $n.getCorrelationContext(Ie)}}}catch(Pe){Ba(st,Ee.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:Ls(ne),exception:it(Pe)})}}function It(ne,be){if(be.requestUrl&&pe&&N){var Ae=Zr();if(Ae&&at(Ae.mark)){Wu++;var Ie=pe+ne+"#"+Wu;Ae.mark(Ie);var Pe=Ae.getEntriesByName(Ie);Pe&&Pe.length===1&&(be.perfMark=Pe[0])}}}function Ze(ne,be,Ae,Ie){var Pe=be.perfMark,We=Zr(),ke=h.maxAjaxPerfLookupAttempts,ot=h.ajaxPerfLookupDelay,vt=be.requestUrl,ye=0;(function br(){try{if(We&&Pe){ye++;for(var Ar=null,yr=We.getEntries(),Qi=yr.length-1;Qi>=0;Qi--){var hn=yr[Qi];if(hn){if(hn.entryType==="resource")hn.initiatorType===ne&&(Na(hn.name,vt)!==-1||Na(vt,hn.name)!==-1)&&(Ar=hn);else if(hn.entryType==="mark"&&hn.name===Pe.name){be.perfTiming=Ar;break}if(hn.startTime<Pe.startTime-1e3)break}}}!Pe||be.perfTiming||ye>=ke||be.async===!1?(Pe&&at(We.clearMarks)&&We.clearMarks(Pe.name),be.perfAttempts=ye,Ae()):setTimeout(br,ot)}catch(t0){Ie(t0)}})()}function T(ne,be){var Ae=ie&&ie.telemetryTrace&&ie.telemetryTrace.traceID||qr(),Ie=qr().substr(0,16),Pe=new Wl(Ae,Ie,st[xo]());Pe.requestSentTime=Ra(),Pe.errorStatusText=O,ne instanceof Request?Pe.requestUrl=ne?ne.url:"":Pe.requestUrl=ne;var We="GET";be&&be.method?We=be.method:ne&&ne instanceof Request&&(We=ne.method),Pe.method=We;var ke={};if(p){var ot=new Headers((be?be.headers:0)||(ne instanceof Request?ne.headers||{}:{}));ot.forEach(function(vt,ye){Xt(ye)&&(ke[ye]=vt)})}return Pe.requestHeaders=ke,It("fetch",Pe),Pe}function ae(ne){var be="";try{Ne(ne)||(typeof ne=="string"?be+="(url: '".concat(ne,"')"):be+="(url: '".concat(ne.url,"')"))}catch(Ae){go(st,Ee.FailedMonitorAjaxOpen,"Failed to grab failed fetch diagnostics message",{exception:it(Ae)})}return be}function Le(ne,be,Ae,Ie,Pe,We,ke){if(!Pe)return;function ot(vt,ye,br){var Ar=br||{};Ar.fetchDiagnosticsMessage=ae(Ae),ye&&(Ar.exception=it(ye)),Ba(st,vt,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",Ar)}Pe.responseFinishedTime=Ra(),Pe.status=be,Ze("fetch",Pe,function(){var vt=Pe.CreateTrackItem("Fetch",p,We),ye;try{_t&&(ye=_t({status:be,request:Ae,response:Ie}))}catch{Ba(st,Ee.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}vt?(ye!==void 0&&(vt.properties=Zt(Zt({},vt.properties),ye)),st[n](vt)):ot(Ee.FailedMonitorAjaxDur,null,{requestSentTime:Pe.requestSentTime,responseFinishedTime:Pe.responseFinishedTime})},function(vt){ot(Ee.FailedMonitorAjaxGetCorrelationHeader,vt,null)})}function Ye(ne){if(ne&&ne.headers)try{var be=ne.headers.get(Ct.requestContextHeader);return $n.getCorrelationContext(be)}catch(Ae){Ba(st,Ee.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:ae(ne),exception:it(Ae)})}}}),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}(Tn);var Zl,$u=["snippet","dependencies","properties","_snippetVersion","appInsightsNew","getSKUDefaults"];var Ql=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=Ml(n.connectionString),o=i.ingestionendpoint;n.endpointUrl=o?"".concat(o,"/v2/track"):n.endpointUrl,n.instrumentationKey=i.instrumentationkey||n.instrumentationKey}r.appInsights=new Vl,r.properties=new Kl,r.dependencies=new $l,r.core=new ul,r._sender=new Gl,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),Hn(this.core,function(){return"AISKU.flush"},function(){et(r.core.getTransmissionControls(),function(n){et(n,function(i){i.flush(e)})})},null,e)},t.prototype.onunloadFlush=function(e){e===void 0&&(e=!0),et(this.core.getTransmissionControls(),function(r){et(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 o=this;function s(d){if(d){var h="";Ne(o._snippetVersion)||(h+=o._snippetVersion),e&&(h+=".lg"),o.context&&o.context.internal&&(o.context.internal.snippetVer=h||"-"),Tt(o,function(p,O){Je(p)&&!at(O)&&p&&p[0]!=="_"&&$u.indexOf(p)===-1&&(d[p]=O)})}}return e&&o.config.extensions&&o.config.extensions.length>0&&wr("Extensions not allowed in legacy mode"),Hn(o.core,function(){return"AISKU.loadAppInsights"},function(){var d=[];d.push(o._sender),d.push(o.properties),d.push(o.dependencies),d.push(o.appInsights),o.core.initialize(o.config,d,r,n),o.context=o.properties.context,Zl&&o.context&&(o.context.internal.sdkSrc=Zl),s(o.snippet),o.emptyQueue(),o.pollInternalLogs(),o.addHousekeepingBeforeUnload(i)}),o},t.prototype.updateSnippetDefinitions=function(e){F0(e,this,function(r){return r&&$u.indexOf(r)===-1})},t.prototype.emptyQueue=function(){var e=this;try{if(cr(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 o={};s&&at(s.toString)&&(o.exception=s.toString())}},t.prototype.pollInternalLogs=function(){this.core.pollInternalLogs()},t.prototype.stopPollingInternalLogs=function(){this.core.stopPollingInternalLogs()},t.prototype.addHousekeepingBeforeUnload=function(e){if(Ni()||fs()){var r=function(){e.onunloadFlush(!1),et(e.appInsights.core._extensions,function(o){if(o.identifier===di)return o&&o.context&&o.context._sessionManager&&o.context._sessionManager.backup(),-1})},n=!1,i=e.appInsights.config.disablePageUnloadEvents;e.appInsights.config.disableFlushOnBeforeUnload||(n=dl(r,i),n=so(r,i)||n,!n&&!W0()&&e.appInsights.core.logger.throwInternal(Me.CRITICAL,Ee.FailedToAddHandlerForOnBeforeUnload,"Could not add handler for beforeunload and pagehide")),!n&&!e.appInsights.config.disableFlushOnUnload&&so(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 o="",s=0;s<r.length;s++)if(i.indexOf(r[s])!==-1){o="cdn"+(s+1),i.indexOf("/scripts/")===-1&&(i.indexOf("/next/")!==-1?o+="-next":i.indexOf("/beta/")!==-1&&(o+="-beta")),Zl=o+(e?".mod":"");break}}}catch{}})();var Da,Zu=t=>(Da=new Ql({config:{instrumentationKey:t}}),Da.loadAppInsights(),Da),$i={START:"start",FINISH:"finish",ERROR:"error",UPLOAD_VIDEO:"upload_video"},kv=t=>Da.trackException({exception:t}),Zi=(t,e)=>Da.trackEvent({name:t,properties:e}),Uv=(t,e,r)=>Da.trackPageView({name:t,uri:e,properties:r}),Sr={trackPage:Uv,trackError:kv,registerStart:(t,e,r)=>Zi($i.START,{proctoringId:t,success:e,description:r}),registerFinish:(t,e,r)=>Zi($i.FINISH,{proctoringId:t,success:e,description:r}),registerError:(t,e)=>Zi($i.ERROR,{proctoringId:t,description:e}),registerUpload:(t,e,r,n,i)=>Zi($i.UPLOAD_VIDEO,{proctoringId:t,success:e,description:r,serviceType:n,uploadTime:i}),registerUploadFile:(t,e,r)=>Zi($i.UPLOAD_VIDEO,{proctoringId:t,description:e,fileType:r}),registerChangeDevice:(t,e,r)=>Zi($i.UPLOAD_VIDEO,{proctoringId:t,inOrOut:e,devicesChanged:r}),registerStopSharingScreen:(t,e)=>Zi($i.UPLOAD_VIDEO,{proctoringId:t,description:e})};var ks=class{constructor(e,r){this.repositoryDevices=e,this.proctoringId=r}startRecording(e){navigator.mediaDevices.ondevicechange=()=>{this.onChangeDevices(e)}}async onChangeDevices(e){let r=await Mi(),n=(G,ie)=>G.label===ie.label&&G.id===ie.id,i=(G,ie,oe)=>G.filter(L=>!ie.some(pe=>oe(L,pe))),o=await this.repositoryDevices.getDevices("devices"),s={label:"",id:""},d={cameras:o?.cameras||[s],microphones:o?.microphones||[s]},h,p;r.cameras.length!=d?.cameras.length&&(h=r.cameras.length>d?.cameras.length?i(r.cameras,d?.cameras,n):i(d?.cameras,r.cameras,n),h=h.filter(G=>G.id!="default")),r.microphones.length!=d?.microphones.length&&(p=r.microphones.length>d?.microphones.length?i(r.microphones,d?.microphones,n):i(d?.microphones,r.microphones,n),p=p.filter(G=>G.id!="default"&&G.id!="communications"));let O={cameras:h||[],microphones:p||[],status:r.cameras.length>d?.cameras.length||r.microphones.length>d?.microphones.length?"in":"out"};await this.repositoryDevices.save({...r,id:"devices",status:r.cameras.length>d?.cameras.length||r.microphones.length>d?.microphones.length?"in":"out"}),e.status&&(O.cameras.length!=0||O.microphones.length!=0)&&(Sr.registerChangeDevice(this.proctoringId,O.status,O),e.status(O))}};function yo(t,e){return function(){return t.apply(e,arguments)}}var{toString:Ju}=Object.prototype,{getPrototypeOf:t1}=Object,r1=(t=>e=>{let r=Ju.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Qn=t=>(t=t.toLowerCase(),e=>r1(e)===t),Hs=t=>e=>typeof e===t,{isArray:Eo}=Array,Jl=Hs("undefined");function Hv(t){return t!==null&&!Jl(t)&&t.constructor!==null&&!Jl(t.constructor)&&Oa(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var ef=Qn("ArrayBuffer");function Vv(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ef(t.buffer),e}var qv=Hs("string"),Oa=Hs("function"),tf=Hs("number"),rf=t=>t!==null&&typeof t=="object",zv=t=>t===!0||t===!1,Us=t=>{if(r1(t)!=="object")return!1;let e=t1(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},jv=Qn("Date"),Gv=Qn("File"),Xv=Qn("Blob"),Kv=Qn("FileList"),Wv=t=>rf(t)&&Oa(t.pipe),Yv=t=>{let e="[object FormData]";return t&&(typeof FormData=="function"&&t instanceof FormData||Ju.call(t)===e||Oa(t.toString)&&t.toString()===e)},$v=Qn("URLSearchParams"),Zv=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Vs(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 o=r?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length,d;for(n=0;n<s;n++)d=o[n],e.call(null,t[d],d,t)}}function e1(){let t={},e=(r,n)=>{Us(t[n])&&Us(r)?t[n]=e1(t[n],r):Us(r)?t[n]=e1({},r):Eo(r)?t[n]=r.slice():t[n]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&Vs(arguments[r],e);return t}var Qv=(t,e,r,{allOwnKeys:n}={})=>(Vs(e,(i,o)=>{r&&Oa(i)?t[o]=yo(i,r):t[o]=i},{allOwnKeys:n}),t),Jv=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),em=(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)},tm=(t,e,r,n)=>{let i,o,s,d={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!n||n(s,t,e))&&!d[s]&&(e[s]=t[s],d[s]=!0);t=r!==!1&&t1(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},rm=(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},nm=t=>{if(!t)return null;if(Eo(t))return t;let e=t.length;if(!tf(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},im=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&t1(Uint8Array)),am=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let o=i.value;e.call(t,o[0],o[1])}},om=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},sm=Qn("HTMLFormElement"),lm=t=>t.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Qu=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),cm=Qn("RegExp"),nf=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};Vs(r,(i,o)=>{e(i,o,t)!==!1&&(n[o]=i)}),Object.defineProperties(t,n)},um=t=>{nf(t,(e,r)=>{let n=t[r];if(!!Oa(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not read-only method '"+r+"'")})}})},fm=(t,e)=>{let r={},n=i=>{i.forEach(o=>{r[o]=!0})};return Eo(t)?n(t):n(String(t).split(e)),r},dm=()=>{},vm=(t,e)=>(t=+t,Number.isFinite(t)?t:e),xe={isArray:Eo,isArrayBuffer:ef,isBuffer:Hv,isFormData:Yv,isArrayBufferView:Vv,isString:qv,isNumber:tf,isBoolean:zv,isObject:rf,isPlainObject:Us,isUndefined:Jl,isDate:jv,isFile:Gv,isBlob:Xv,isRegExp:cm,isFunction:Oa,isStream:Wv,isURLSearchParams:$v,isTypedArray:im,isFileList:Kv,forEach:Vs,merge:e1,extend:Qv,trim:Zv,stripBOM:Jv,inherits:em,toFlatObject:tm,kindOf:r1,kindOfTest:Qn,endsWith:rm,toArray:nm,forEachEntry:am,matchAll:om,isHTMLForm:sm,hasOwnProperty:Qu,hasOwnProp:Qu,reduceDescriptors:nf,freezeMethods:um,toObjectSet:fm,toCamelCase:lm,noop:dm,toFiniteNumber:vm};function Fa(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)}xe.inherits(Fa,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 af=Fa.prototype,of={};["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=>{of[t]={value:t}});Object.defineProperties(Fa,of);Object.defineProperty(af,"isAxiosError",{value:!0});Fa.from=(t,e,r,n,i,o)=>{let s=Object.create(af);return xe.toFlatObject(t,s,function(h){return h!==Error.prototype},d=>d!=="isAxiosError"),Fa.call(s,t.message,e,r,n,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};var wt=Fa;var cf=Wd(lf(),1),uf=cf.default;function n1(t){return xe.isPlainObject(t)||xe.isArray(t)}function df(t){return xe.endsWith(t,"[]")?t.slice(0,-2):t}function ff(t,e,r){return t?t.concat(e).map(function(i,o){return i=df(i),!r&&o?"["+i+"]":i}).join(r?".":""):e}function mm(t){return xe.isArray(t)&&!t.some(n1)}var hm=xe.toFlatObject(xe,{},null,function(e){return/^is[A-Z]/.test(e)});function pm(t){return t&&xe.isFunction(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator]}function _m(t,e,r){if(!xe.isObject(t))throw new TypeError("target must be an object");e=e||new(uf||FormData),r=xe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(pe,N){return!xe.isUndefined(N[pe])});let n=r.metaTokens,i=r.visitor||O,o=r.dots,s=r.indexes,h=(r.Blob||typeof Blob<"u"&&Blob)&&pm(e);if(!xe.isFunction(i))throw new TypeError("visitor must be a function");function p(L){if(L===null)return"";if(xe.isDate(L))return L.toISOString();if(!h&&xe.isBlob(L))throw new wt("Blob is not supported. Use a Buffer instead.");return xe.isArrayBuffer(L)||xe.isTypedArray(L)?h&&typeof Blob=="function"?new Blob([L]):Buffer.from(L):L}function O(L,pe,N){let le=L;if(L&&!N&&typeof L=="object"){if(xe.endsWith(pe,"{}"))pe=n?pe:pe.slice(0,-2),L=JSON.stringify(L);else if(xe.isArray(L)&&mm(L)||xe.isFileList(L)||xe.endsWith(pe,"[]")&&(le=xe.toArray(L)))return pe=df(pe),le.forEach(function(Fe,tt){!(xe.isUndefined(Fe)||Fe===null)&&e.append(s===!0?ff([pe],tt,o):s===null?pe:pe+"[]",p(Fe))}),!1}return n1(L)?!0:(e.append(ff(N,pe,o),p(L)),!1)}let G=[],ie=Object.assign(hm,{defaultVisitor:O,convertValue:p,isVisitable:n1});function oe(L,pe){if(!xe.isUndefined(L)){if(G.indexOf(L)!==-1)throw Error("Circular reference detected in "+pe.join("."));G.push(L),xe.forEach(L,function(le,ue){(!(xe.isUndefined(le)||le===null)&&i.call(e,le,xe.isString(ue)?ue.trim():ue,pe,ie))===!0&&oe(le,pe?pe.concat(ue):[ue])}),G.pop()}}if(!xe.isObject(t))throw new TypeError("data must be an object");return oe(t),e}var hi=_m;function vf(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function mf(t,e){this._pairs=[],t&&hi(t,this,e)}var hf=mf.prototype;hf.append=function(e,r){this._pairs.push([e,r])};hf.toString=function(e){let r=e?function(n){return e.call(this,n,vf)}:vf;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var qs=mf;function Sm(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wo(t,e,r){if(!e)return t;let n=r&&r.encode||Sm,i=r&&r.serialize,o;if(i?o=i(e,r):o=xe.isURLSearchParams(e)?e.toString():new qs(e,r).toString(n),o){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}var i1=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){xe.forEach(this.handlers,function(n){n!==null&&e(n)})}},a1=i1;var zs={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var pf=typeof URLSearchParams<"u"?URLSearchParams:qs;var _f=FormData;var xm=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Or={isBrowser:!0,classes:{URLSearchParams:pf,FormData:_f,Blob},isStandardBrowserEnv:xm,protocols:["http","https","file","blob","url","data"]};function o1(t,e){return hi(t,new Or.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return Or.isNode&&xe.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function bm(t){return xe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function gm(t){let e={},r=Object.keys(t),n,i=r.length,o;for(n=0;n<i;n++)o=r[n],e[o]=t[o];return e}function ym(t){function e(r,n,i,o){let s=r[o++],d=Number.isFinite(+s),h=o>=r.length;return s=!s&&xe.isArray(i)?i.length:s,h?(xe.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!d):((!i[s]||!xe.isObject(i[s]))&&(i[s]=[]),e(r,n,i[s],o)&&xe.isArray(i[s])&&(i[s]=gm(i[s])),!d)}if(xe.isFormData(t)&&xe.isFunction(t.entries)){let r={};return xe.forEachEntry(t,(n,i)=>{e(bm(n),i,r,0)}),r}return null}var js=ym;function s1(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 Sf=Or.isStandardBrowserEnv?function(){return{write:function(r,n,i,o,s,d){let h=[];h.push(r+"="+encodeURIComponent(n)),xe.isNumber(i)&&h.push("expires="+new Date(i).toGMTString()),xe.isString(o)&&h.push("path="+o),xe.isString(s)&&h.push("domain="+s),d===!0&&h.push("secure"),document.cookie=h.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 l1(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function c1(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Ro(t,e){return t&&!l1(e)?c1(t,e):e}var xf=Or.isStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function i(o){let s=o;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 d=xe.isString(s)?i(s):s;return d.protocol===n.protocol&&d.host===n.host}}():function(){return function(){return!0}}();function bf(t,e,r){wt.call(this,t??"canceled",wt.ERR_CANCELED,e,r),this.name="CanceledError"}xe.inherits(bf,wt,{__CANCEL__:!0});var pi=bf;function u1(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var Em=xe.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"]),gf=t=>{let e={},r,n,i;return t&&t.split(`
|
|
23
|
-
`).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||e[r]&&Em[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e};var yf=Symbol("internals"),wf=Symbol("defaults");function Ao(t){return t&&String(t).trim().toLowerCase()}function Gs(t){return t===!1||t==null?t:xe.isArray(t)?t.map(Gs):String(t)}function wm(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 Ef(t,e,r,n){if(xe.isFunction(n))return n.call(this,e,r);if(!!xe.isString(e)){if(xe.isString(n))return e.indexOf(n)!==-1;if(xe.isRegExp(n))return n.test(e)}}function Rm(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Tm(t,e){let r=xe.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,o,s){return this[n].call(this,e,i,o,s)},configurable:!0})})}function To(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 La(t,e){t&&this.set(t),this[wf]=e||null}Object.assign(La.prototype,{set:function(t,e,r){let n=this;function i(o,s,d){let h=Ao(s);if(!h)throw new Error("header name must be a non-empty string");let p=To(n,h);p&&d!==!0&&(n[p]===!1||d===!1)||(n[p||s]=Gs(o))}return xe.isPlainObject(t)?xe.forEach(t,(o,s)=>{i(o,s,e)}):i(e,t,r),this},get:function(t,e){if(t=Ao(t),!t)return;let r=To(this,t);if(r){let n=this[r];if(!e)return n;if(e===!0)return wm(n);if(xe.isFunction(e))return e.call(this,n,r);if(xe.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}},has:function(t,e){if(t=Ao(t),t){let r=To(this,t);return!!(r&&(!e||Ef(this,this[r],r,e)))}return!1},delete:function(t,e){let r=this,n=!1;function i(o){if(o=Ao(o),o){let s=To(r,o);s&&(!e||Ef(r,r[s],s,e))&&(delete r[s],n=!0)}}return xe.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 xe.forEach(this,(n,i)=>{let o=To(r,i);if(o){e[o]=Gs(n),delete e[i];return}let s=t?Rm(i):String(i).trim();s!==i&&delete e[i],e[s]=Gs(n),r[s]=!0}),this},toJSON:function(t){let e=Object.create(null);return xe.forEach(Object.assign({},this[wf]||null,this),(r,n)=>{r==null||r===!1||(e[n]=t&&xe.isArray(r)?r.join(", "):r)}),e}});Object.assign(La,{from:function(t){return xe.isString(t)?new this(gf(t)):t instanceof this?t:new this(t)},accessor:function(t){let r=(this[yf]=this[yf]={accessors:{}}).accessors,n=this.prototype;function i(o){let s=Ao(o);r[s]||(Tm(n,o),r[s]=!0)}return xe.isArray(t)?t.forEach(i):i(t),this}});La.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]);xe.freezeMethods(La.prototype);xe.freezeMethods(La);var Pn=La;function Am(t,e){t=t||10;let r=new Array(t),n=new Array(t),i=0,o=0,s;return e=e!==void 0?e:1e3,function(h){let p=Date.now(),O=n[o];s||(s=p),r[i]=h,n[i]=p;let G=o,ie=0;for(;G!==i;)ie+=r[G++],G=G%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),p-s<e)return;let oe=O&&p-O;return oe?Math.round(ie*1e3/oe):void 0}}var Rf=Am;function Tf(t,e){let r=0,n=Rf(50,250);return i=>{let o=i.loaded,s=i.lengthComputable?i.total:void 0,d=o-r,h=n(d),p=o<=s;r=o;let O={loaded:o,total:s,progress:s?o/s:void 0,bytes:d,rate:h||void 0,estimated:h&&s&&p?(s-o)/h:void 0};O[e?"download":"upload"]=!0,t(O)}}function Io(t){return new Promise(function(r,n){let i=t.data,o=Pn.from(t.headers).normalize(),s=t.responseType,d;function h(){t.cancelToken&&t.cancelToken.unsubscribe(d),t.signal&&t.signal.removeEventListener("abort",d)}xe.isFormData(i)&&Or.isStandardBrowserEnv&&o.setContentType(!1);let p=new XMLHttpRequest;if(t.auth){let oe=t.auth.username||"",L=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(oe+":"+L))}let O=Ro(t.baseURL,t.url);p.open(t.method.toUpperCase(),wo(O,t.params,t.paramsSerializer),!0),p.timeout=t.timeout;function G(){if(!p)return;let oe=Pn.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),pe={data:!s||s==="text"||s==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:oe,config:t,request:p};s1(function(le){r(le),h()},function(le){n(le),h()},pe),p=null}if("onloadend"in p?p.onloadend=G:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(G)},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 L=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",pe=t.transitional||zs;t.timeoutErrorMessage&&(L=t.timeoutErrorMessage),n(new wt(L,pe.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,t,p)),p=null},Or.isStandardBrowserEnv){let oe=(t.withCredentials||xf(O))&&t.xsrfCookieName&&Sf.read(t.xsrfCookieName);oe&&o.set(t.xsrfHeaderName,oe)}i===void 0&&o.setContentType(null),"setRequestHeader"in p&&xe.forEach(o.toJSON(),function(L,pe){p.setRequestHeader(pe,L)}),xe.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),s&&s!=="json"&&(p.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&p.addEventListener("progress",Tf(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",Tf(t.onUploadProgress)),(t.cancelToken||t.signal)&&(d=oe=>{!p||(n(!oe||oe.type?new pi(null,t,p):oe),p.abort(),p=null)},t.cancelToken&&t.cancelToken.subscribe(d),t.signal&&(t.signal.aborted?d():t.signal.addEventListener("abort",d)));let ie=u1(O);if(ie&&Or.protocols.indexOf(ie)===-1){n(new wt("Unsupported protocol "+ie+":",wt.ERR_BAD_REQUEST,t));return}p.send(i||null)})}var Af={http:Io,xhr:Io},f1={getAdapter:t=>{if(xe.isString(t)){let e=Af[t];if(!t)throw Error(xe.hasOwnProp(t)?`Adapter '${t}' is not available in the build`:`Can not resolve adapter '${t}'`);return e}if(!xe.isFunction(t))throw new TypeError("adapter is not a function");return t},adapters:Af};var Im={"Content-Type":"application/x-www-form-urlencoded"};function Cm(){let t;return typeof XMLHttpRequest<"u"?t=f1.getAdapter("xhr"):typeof process<"u"&&xe.kindOf(process)==="process"&&(t=f1.getAdapter("http")),t}function Mm(t,e,r){if(xe.isString(t))try{return(e||JSON.parse)(t),xe.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var Xs={transitional:zs,adapter:Cm(),transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=xe.isObject(e);if(o&&xe.isHTMLForm(e)&&(e=new FormData(e)),xe.isFormData(e))return i&&i?JSON.stringify(js(e)):e;if(xe.isArrayBuffer(e)||xe.isBuffer(e)||xe.isStream(e)||xe.isFile(e)||xe.isBlob(e))return e;if(xe.isArrayBufferView(e))return e.buffer;if(xe.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return o1(e,this.formSerializer).toString();if((d=xe.isFileList(e))||n.indexOf("multipart/form-data")>-1){let h=this.env&&this.env.FormData;return hi(d?{"files[]":e}:e,h&&new h,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),Mm(e)):e}],transformResponse:[function(e){let r=this.transitional||Xs.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&xe.isString(e)&&(n&&!this.responseType||i)){let s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(d){if(s)throw d.name==="SyntaxError"?wt.from(d,wt.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Or.classes.FormData,Blob:Or.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};xe.forEach(["delete","get","head"],function(e){Xs.headers[e]={}});xe.forEach(["post","put","patch"],function(e){Xs.headers[e]=xe.merge(Im)});var ka=Xs;function Co(t,e){let r=this||ka,n=e||r,i=Pn.from(n.headers),o=n.data;return xe.forEach(t,function(d){o=d.call(r,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function Mo(t){return!!(t&&t.__CANCEL__)}function d1(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new pi}function Ks(t){return d1(t),t.headers=Pn.from(t.headers),t.data=Co.call(t,t.transformRequest),(t.adapter||ka.adapter)(t).then(function(n){return d1(t),n.data=Co.call(t,t.transformResponse,n),n.headers=Pn.from(n.headers),n},function(n){return Mo(n)||(d1(t),n&&n.response&&(n.response.data=Co.call(t,t.transformResponse,n.response),n.response.headers=Pn.from(n.response.headers))),Promise.reject(n)})}function _i(t,e){e=e||{};let r={};function n(p,O){return xe.isPlainObject(p)&&xe.isPlainObject(O)?xe.merge(p,O):xe.isPlainObject(O)?xe.merge({},O):xe.isArray(O)?O.slice():O}function i(p){if(xe.isUndefined(e[p])){if(!xe.isUndefined(t[p]))return n(void 0,t[p])}else return n(t[p],e[p])}function o(p){if(!xe.isUndefined(e[p]))return n(void 0,e[p])}function s(p){if(xe.isUndefined(e[p])){if(!xe.isUndefined(t[p]))return n(void 0,t[p])}else return n(void 0,e[p])}function d(p){if(p in e)return n(t[p],e[p]);if(p in t)return n(void 0,t[p])}let h={url:o,method:o,data:o,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:d};return xe.forEach(Object.keys(t).concat(Object.keys(e)),function(O){let G=h[O]||i,ie=G(O);xe.isUndefined(ie)&&G!==d||(r[O]=ie)}),r}var Ws="1.1.3";var v1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{v1[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var If={};v1.transitional=function(e,r,n){function i(o,s){return"[Axios v"+Ws+"] Transitional option '"+o+"'"+s+(n?". "+n:"")}return(o,s,d)=>{if(e===!1)throw new wt(i(s," has been removed"+(r?" in "+r:"")),wt.ERR_DEPRECATED);return r&&!If[s]&&(If[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(o,s,d):!0}};function Pm(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 o=n[i],s=e[o];if(s){let d=t[o],h=d===void 0||s(d,o,t);if(h!==!0)throw new wt("option "+o+" must be "+h,wt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new wt("Unknown option "+o,wt.ERR_BAD_OPTION)}}var Ys={assertOptions:Pm,validators:v1};var Si=Ys.validators,Ua=class{constructor(e){this.defaults=e,this.interceptors={request:new a1,response:new a1}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=_i(this.defaults,r);let{transitional:n,paramsSerializer:i}=r;n!==void 0&&Ys.assertOptions(n,{silentJSONParsing:Si.transitional(Si.boolean),forcedJSONParsing:Si.transitional(Si.boolean),clarifyTimeoutError:Si.transitional(Si.boolean)},!1),i!==void 0&&Ys.assertOptions(i,{encode:Si.function,serialize:Si.function},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=r.headers&&xe.merge(r.headers.common,r.headers[r.method]);o&&xe.forEach(["delete","get","head","post","put","patch","common"],function(L){delete r.headers[L]}),r.headers=new Pn(r.headers,o);let s=[],d=!0;this.interceptors.request.forEach(function(L){typeof L.runWhen=="function"&&L.runWhen(r)===!1||(d=d&&L.synchronous,s.unshift(L.fulfilled,L.rejected))});let h=[];this.interceptors.response.forEach(function(L){h.push(L.fulfilled,L.rejected)});let p,O=0,G;if(!d){let oe=[Ks.bind(this),void 0];for(oe.unshift.apply(oe,s),oe.push.apply(oe,h),G=oe.length,p=Promise.resolve(r);O<G;)p=p.then(oe[O++],oe[O++]);return p}G=s.length;let ie=r;for(O=0;O<G;){let oe=s[O++],L=s[O++];try{ie=oe(ie)}catch(pe){L.call(this,pe);break}}try{p=Ks.call(this,ie)}catch(oe){return Promise.reject(oe)}for(O=0,G=h.length;O<G;)p=p.then(h[O++],h[O++]);return p}getUri(e){e=_i(this.defaults,e);let r=Ro(e.baseURL,e.url);return wo(r,e.params,e.paramsSerializer)}};xe.forEach(["delete","get","head","options"],function(e){Ua.prototype[e]=function(r,n){return this.request(_i(n||{},{method:e,url:r,data:(n||{}).data}))}});xe.forEach(["post","put","patch"],function(e){function r(n){return function(o,s,d){return this.request(_i(d||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Ua.prototype[e]=r(),Ua.prototype[e+"Form"]=r(!0)});var Po=Ua;var Bo=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});let n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o,s=new Promise(d=>{n.subscribe(d),o=d}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},e(function(o,s,d){n.reason||(n.reason=new pi(o,s,d),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 Bo(function(i){e=i}),cancel:e}}},Cf=Bo;function m1(t){return function(r){return t.apply(null,r)}}function h1(t){return xe.isObject(t)&&t.isAxiosError===!0}function Mf(t){let e=new Po(t),r=yo(Po.prototype.request,e);return xe.extend(r,Po.prototype,e,{allOwnKeys:!0}),xe.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return Mf(_i(t,i))},r}var zr=Mf(ka);zr.Axios=Po;zr.CanceledError=pi;zr.CancelToken=Cf;zr.isCancel=Mo;zr.VERSION=Ws;zr.toFormData=hi;zr.AxiosError=wt;zr.Cancel=zr.CanceledError;zr.all=function(e){return Promise.all(e)};zr.spread=m1;zr.isAxiosError=h1;zr.formToJSON=t=>js(xe.isHTMLForm(t)?new FormData(t):t);var p1=zr;var{Axios:Q9,AxiosError:J9,CanceledError:ex,isCancel:tx,CancelToken:rx,VERSION:nx,all:ix,Cancel:ax,isAxiosError:ox,spread:sx,toFormData:lx}=p1,Pf=p1;var Bm="https://proctoring-api-dev.easyproctor.tech/api",Nm="https://proctoring-api-hml.easyproctor.tech/api",Bf="https://proctoring-api.easyproctor.tech/api",$s=class{constructor(e){this.options=e;this.baseUrl=this.selectBaseUrl(e.type)}selectBaseUrl(e){return e==="dev"?Bm:e==="homol"?Nm:Bf}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){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(G=>G.origin==="Camera")?.upload,o=r.recordings.find(G=>G.origin==="Mic")?.upload,s=r.recordings.find(G=>G.origin==="Screen")?.upload,d=G=>G?G.substring(0,G.indexOf("?")):void 0,h=d(i?.azureUrl),p=d(o?.azureUrl),O=d(s?.azureUrl);if(!h||!p||!O){let G=await this.getAzureBlobUrl(e);!h&&(h=`${G}/${r.recordings.find(ie=>ie.origin==="Camera")?.file.name}`),!p&&(p=`${G}/${r.recordings.find(ie=>ie.origin==="Mic")?.file.name}`),!O&&r.recordings.find(ie=>ie.origin==="Screen")&&(O=`${G}/${r.recordings.find(ie=>ie.origin==="Screen")?.file.name}`)}await this.makeRequest({path:`/proctoring/finish/${e.examId}`,method:"POST",body:{endDate:n,videoCameraUrl:h,audioCameraUrl:p,videoScreenUrl:O},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:o}=e,s=await fetch(this.baseUrl+r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Authorization:`Bearer ${o}`,"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 d=s.headers.get("content-type");return(d?d.includes("application/json"):!1)?await s.json():null}async makeRequestAxios(e){let{path:r,method:n,body:i,jwt:o}=e,s=await Pf.request({url:this.baseUrl+r,method:n,headers:{Authorization:`Bearer ${o}`,"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:o}=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 d=s.headers.get("content-type");return(d?d.includes("application/json"):!1)?await s.json():null}};var Ha=class{constructor(e){this.loadingBoolean=!0;this.proctoringId=e}async upload(e,r){try{let{file:n,onProgress:i}=e,o=URL.createObjectURL(n),s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=o,s.download=n.name,s.click(),window.URL.revokeObjectURL(o),this.loadingBoolean=!1,clearInterval(this.loadingInterval),i&&i(Math.round(100))}catch{throw new Error("Error on machine download")}}};var Zs=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 Va=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 o=d=>{let h=(n*100+d)/this.session.recordings.length;r&&r(h)},s=await this.uploadFile(i,e,o).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 o=await i.upload({file:e.file,onProgress:s=>{n&&n(s)}},r);if(o){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"),Sr.registerUploadFile(this.proctoringId,`Upload File
|
|
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=`
|
|
27
|
+
.facial-biometry__mask {
|
|
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%;
|
|
30
|
+
mask-repeat: no-repeat;
|
|
31
|
+
mask-position: center, center;
|
|
32
|
+
mask-composite: subtract;
|
|
33
|
+
|
|
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%;
|
|
36
|
+
-webkit-mask-repeat: no-repeat;
|
|
37
|
+
-webkit-mask-position: center, center;
|
|
38
|
+
-webkit-mask-composite: source-out;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.biometry__frame {
|
|
42
|
+
background: url("https://iarisprod.blob.core.windows.net/imagens/face-frame.svg") no-repeat center;
|
|
43
|
+
background-size: 78% 62%;
|
|
44
|
+
}
|
|
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
|
|
24
46
|
Name: ${e.file.name}
|
|
25
47
|
Type: ${e.file.type}
|
|
26
|
-
Size: ${e.file.size}`,s),
|
|
27
|
-
|
|
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
|
|
49
|
+
File name: ${n.name}
|
|
50
|
+
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}
|
|
28
53
|
|
|
29
|
-
Upload Services: ${n}`,this.serviceType),
|
|
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}
|
|
30
55
|
|
|
31
56
|
Upload Services: ${n}
|
|
32
|
-
Upload backup for Safe Browser`,this.serviceType)}))}),
|
|
57
|
+
Upload backup for Safe Browser`,this.serviceType)}))}),Yt.registerUpload(this.proctoringSession.id,!0,`upload success
|
|
33
58
|
|
|
34
|
-
Upload Services: ${n}`,this.serviceType)),await this.backend.saveScreenAlerts(this.context,this.proctoringSession).catch(
|
|
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);})();
|
|
35
60
|
/*!
|
|
36
61
|
* Microsoft Dynamic Proto Utility, 1.1.4
|
|
37
62
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|