Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

excel-mac-16.00.debug.js 643KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002
  1. /* Excel Mac-specific API library */
  2. /* Version: 16.0.7524.3000 */
  3. /* Office.js Version: 16.0.7526.1000 */
  4. /*
  5. Copyright (c) Microsoft Corporation. All rights reserved.
  6. */
  7. /*
  8. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  9. */
  10. /*
  11. * @overview es6-promise - a tiny implementation of Promises/A+.
  12. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  13. * @license Licensed under MIT license
  14. * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
  15. * @version 2.3.0
  16. */
  17. var __extends=(this && this.__extends) || function (d, b) {
  18. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  19. function __() { this.constructor=d; }
  20. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype, new __());
  21. };
  22. var OfficeExt;
  23. (function (OfficeExt) {
  24. var MicrosoftAjaxFactory=(function () {
  25. function MicrosoftAjaxFactory() {
  26. }
  27. MicrosoftAjaxFactory.prototype.isMsAjaxLoaded=function () {
  28. if (typeof (Sys) !=='undefined' && typeof (Type) !=='undefined' &&
  29. Sys.StringBuilder && typeof (Sys.StringBuilder)==="function" &&
  30. Type.registerNamespace && typeof (Type.registerNamespace)==="function" &&
  31. Type.registerClass && typeof (Type.registerClass)==="function" &&
  32. typeof (Function._validateParams)==="function" &&
  33. Sys.Serialization && Sys.Serialization.JavaScriptSerializer && typeof (Sys.Serialization.JavaScriptSerializer.serialize)==="function") {
  34. return true;
  35. }
  36. else {
  37. return false;
  38. }
  39. };
  40. MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function (callback) {
  41. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js';
  42. OSF.OUtil.loadScript(msAjaxCDNPath, callback);
  43. };
  44. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", {
  45. get: function () {
  46. if (this._msAjaxError==null && this.isMsAjaxLoaded()) {
  47. this._msAjaxError=Error;
  48. }
  49. return this._msAjaxError;
  50. },
  51. set: function (errorClass) {
  52. this._msAjaxError=errorClass;
  53. },
  54. enumerable: true,
  55. configurable: true
  56. });
  57. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", {
  58. get: function () {
  59. if (this._msAjaxString==null && this.isMsAjaxLoaded()) {
  60. this._msAjaxString=String;
  61. }
  62. return this._msAjaxString;
  63. },
  64. set: function (stringClass) {
  65. this._msAjaxString=stringClass;
  66. },
  67. enumerable: true,
  68. configurable: true
  69. });
  70. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", {
  71. get: function () {
  72. if (this._msAjaxDebug==null && this.isMsAjaxLoaded()) {
  73. this._msAjaxDebug=Sys.Debug;
  74. }
  75. return this._msAjaxDebug;
  76. },
  77. set: function (debugClass) {
  78. this._msAjaxDebug=debugClass;
  79. },
  80. enumerable: true,
  81. configurable: true
  82. });
  83. return MicrosoftAjaxFactory;
  84. })();
  85. OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory;
  86. })(OfficeExt || (OfficeExt={}));
  87. var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory();
  88. var OSF=OSF || {};
  89. var OfficeExt;
  90. (function (OfficeExt) {
  91. var SafeStorage=(function () {
  92. function SafeStorage(_internalStorage) {
  93. this._internalStorage=_internalStorage;
  94. }
  95. SafeStorage.prototype.getItem=function (key) {
  96. try {
  97. return this._internalStorage && this._internalStorage.getItem(key);
  98. }
  99. catch (e) {
  100. return null;
  101. }
  102. };
  103. SafeStorage.prototype.setItem=function (key, data) {
  104. try {
  105. this._internalStorage && this._internalStorage.setItem(key, data);
  106. }
  107. catch (e) {
  108. }
  109. };
  110. SafeStorage.prototype.clear=function () {
  111. try {
  112. this._internalStorage && this._internalStorage.clear();
  113. }
  114. catch (e) {
  115. }
  116. };
  117. SafeStorage.prototype.removeItem=function (key) {
  118. try {
  119. this._internalStorage && this._internalStorage.removeItem(key);
  120. }
  121. catch (e) {
  122. }
  123. };
  124. SafeStorage.prototype.getKeysWithPrefix=function (keyPrefix) {
  125. var keyList=[];
  126. try {
  127. var len=this._internalStorage && this._internalStorage.length || 0;
  128. for (var i=0; i < len; i++) {
  129. var key=this._internalStorage.key(i);
  130. if (key.indexOf(keyPrefix)===0) {
  131. keyList.push(key);
  132. }
  133. }
  134. }
  135. catch (e) {
  136. }
  137. return keyList;
  138. };
  139. return SafeStorage;
  140. })();
  141. OfficeExt.SafeStorage=SafeStorage;
  142. })(OfficeExt || (OfficeExt={}));
  143. OSF.XdmFieldName={
  144. ConversationUrl: "ConversationUrl",
  145. AppId: "AppId"
  146. };
  147. OSF.WindowNameItemKeys={
  148. BaseFrameName: "baseFrameName",
  149. HostInfo: "hostInfo",
  150. XdmInfo: "xdmInfo",
  151. SerializerVersion: "serializerVersion",
  152. AppContext: "appContext"
  153. };
  154. OSF.OUtil=(function () {
  155. var _uniqueId=-1;
  156. var _xdmInfoKey='&_xdm_Info=';
  157. var _serializerVersionKey='&_serializer_version=';
  158. var _xdmSessionKeyPrefix='_xdm_';
  159. var _serializerVersionKeyPrefix='_serializer_version=';
  160. var _fragmentSeparator='#';
  161. var _fragmentInfoDelimiter='&';
  162. var _classN="class";
  163. var _loadedScripts={};
  164. var _defaultScriptLoadingTimeout=30000;
  165. var _safeSessionStorage=null;
  166. var _safeLocalStorage=null;
  167. var _rndentropy=new Date().getTime();
  168. function _random() {
  169. var nextrand=0x7fffffff * (Math.random());
  170. nextrand ^=_rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10)));
  171. return nextrand.toString(16);
  172. }
  173. ;
  174. function _getSessionStorage() {
  175. if (!_safeSessionStorage) {
  176. try {
  177. var sessionStorage=window.sessionStorage;
  178. }
  179. catch (ex) {
  180. sessionStorage=null;
  181. }
  182. _safeSessionStorage=new OfficeExt.SafeStorage(sessionStorage);
  183. }
  184. return _safeSessionStorage;
  185. }
  186. ;
  187. function _reOrderTabbableElements(elements) {
  188. var bucket0=[];
  189. var bucketPositive=[];
  190. var i;
  191. var len=elements.length;
  192. var ele;
  193. for (i=0; i < len; i++) {
  194. ele=elements[i];
  195. if (ele.tabIndex) {
  196. if (ele.tabIndex > 0) {
  197. bucketPositive.push(ele);
  198. }
  199. else if (ele.tabIndex===0) {
  200. bucket0.push(ele);
  201. }
  202. }
  203. else {
  204. bucket0.push(ele);
  205. }
  206. }
  207. bucketPositive=bucketPositive.sort(function (left, right) {
  208. var diff=left.tabIndex - right.tabIndex;
  209. if (diff===0) {
  210. diff=bucketPositive.indexOf(left) - bucketPositive.indexOf(right);
  211. }
  212. return diff;
  213. });
  214. return [].concat(bucketPositive, bucket0);
  215. }
  216. ;
  217. return {
  218. set_entropy: function OSF_OUtil$set_entropy(entropy) {
  219. if (typeof entropy=="string") {
  220. for (var i=0; i < entropy.length; i+=4) {
  221. var temp=0;
  222. for (var j=0; j < 4 && i+j < entropy.length; j++) {
  223. temp=(temp << 8)+entropy.charCodeAt(i+j);
  224. }
  225. _rndentropy ^=temp;
  226. }
  227. }
  228. else if (typeof entropy=="number") {
  229. _rndentropy ^=entropy;
  230. }
  231. else {
  232. _rndentropy ^=0x7fffffff * Math.random();
  233. }
  234. _rndentropy &=0x7fffffff;
  235. },
  236. extend: function OSF_OUtil$extend(child, parent) {
  237. var F=function () { };
  238. F.prototype=parent.prototype;
  239. child.prototype=new F();
  240. child.prototype.constructor=child;
  241. child.uber=parent.prototype;
  242. if (parent.prototype.constructor===Object.prototype.constructor) {
  243. parent.prototype.constructor=parent;
  244. }
  245. },
  246. setNamespace: function OSF_OUtil$setNamespace(name, parent) {
  247. if (parent && name && !parent[name]) {
  248. parent[name]={};
  249. }
  250. },
  251. unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) {
  252. if (parent && name && parent[name]) {
  253. delete parent[name];
  254. }
  255. },
  256. loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) {
  257. if (url && callback) {
  258. var doc=window.document;
  259. var _loadedScriptEntry=_loadedScripts[url];
  260. if (!_loadedScriptEntry) {
  261. var script=doc.createElement("script");
  262. script.type="text/javascript";
  263. _loadedScriptEntry={ loaded: false, pendingCallbacks: [callback], timer: null };
  264. _loadedScripts[url]=_loadedScriptEntry;
  265. var onLoadCallback=function OSF_OUtil_loadScript$onLoadCallback() {
  266. if (_loadedScriptEntry.timer !=null) {
  267. clearTimeout(_loadedScriptEntry.timer);
  268. delete _loadedScriptEntry.timer;
  269. }
  270. _loadedScriptEntry.loaded=true;
  271. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  272. for (var i=0; i < pendingCallbackCount; i++) {
  273. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  274. currentCallback();
  275. }
  276. };
  277. var onLoadError=function OSF_OUtil_loadScript$onLoadError() {
  278. delete _loadedScripts[url];
  279. if (_loadedScriptEntry.timer !=null) {
  280. clearTimeout(_loadedScriptEntry.timer);
  281. delete _loadedScriptEntry.timer;
  282. }
  283. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  284. for (var i=0; i < pendingCallbackCount; i++) {
  285. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  286. currentCallback();
  287. }
  288. };
  289. if (script.readyState) {
  290. script.onreadystatechange=function () {
  291. if (script.readyState=="loaded" || script.readyState=="complete") {
  292. script.onreadystatechange=null;
  293. onLoadCallback();
  294. }
  295. };
  296. }
  297. else {
  298. script.onload=onLoadCallback;
  299. }
  300. script.onerror=onLoadError;
  301. timeoutInMs=timeoutInMs || _defaultScriptLoadingTimeout;
  302. _loadedScriptEntry.timer=setTimeout(onLoadError, timeoutInMs);
  303. script.src=url;
  304. doc.getElementsByTagName("head")[0].appendChild(script);
  305. }
  306. else if (_loadedScriptEntry.loaded) {
  307. callback();
  308. }
  309. else {
  310. _loadedScriptEntry.pendingCallbacks.push(callback);
  311. }
  312. }
  313. },
  314. loadCSS: function OSF_OUtil$loadCSS(url) {
  315. if (url) {
  316. var doc=window.document;
  317. var link=doc.createElement("link");
  318. link.type="text/css";
  319. link.rel="stylesheet";
  320. link.href=url;
  321. doc.getElementsByTagName("head")[0].appendChild(link);
  322. }
  323. },
  324. parseEnum: function OSF_OUtil$parseEnum(str, enumObject) {
  325. var parsed=enumObject[str.trim()];
  326. if (typeof (parsed)=='undefined') {
  327. OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+str);
  328. throw OsfMsAjaxFactory.msAjaxError.argument("str");
  329. }
  330. return parsed;
  331. },
  332. delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() {
  333. var obj={ calc: arguments[0] };
  334. return function () {
  335. if (obj.calc) {
  336. obj.val=obj.calc.apply(this, arguments);
  337. delete obj.calc;
  338. }
  339. return obj.val;
  340. };
  341. },
  342. getUniqueId: function OSF_OUtil$getUniqueId() {
  343. _uniqueId=_uniqueId+1;
  344. return _uniqueId.toString();
  345. },
  346. formatString: function OSF_OUtil$formatString() {
  347. var args=arguments;
  348. var source=args[0];
  349. return source.replace(/{(\d+)}/gm, function (match, number) {
  350. var index=parseInt(number, 10)+1;
  351. return args[index]===undefined ? '{'+number+'}' : args[index];
  352. });
  353. },
  354. generateConversationId: function OSF_OUtil$generateConversationId() {
  355. return [_random(), _random(), (new Date()).getTime().toString()].join('_');
  356. },
  357. getFrameName: function OSF_OUtil$getFrameName(cacheKey) {
  358. return _xdmSessionKeyPrefix+cacheKey+this.generateConversationId();
  359. },
  360. addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) {
  361. return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue, false);
  362. },
  363. addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) {
  364. return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion, true);
  365. },
  366. addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue, encodeInfo) {
  367. url=url.trim() || '';
  368. var urlParts=url.split(_fragmentSeparator);
  369. var urlWithoutFragment=urlParts.shift();
  370. var fragment=urlParts.join(_fragmentSeparator);
  371. var newFragment;
  372. if (encodeInfo) {
  373. newFragment=[keyName, encodeURIComponent(infoValue), fragment].join('');
  374. }
  375. else {
  376. newFragment=[fragment, keyName, infoValue].join('');
  377. }
  378. return [urlWithoutFragment, _fragmentSeparator, newFragment].join('');
  379. },
  380. parseHostInfoFromWindowName: function OSF_OUtil$parseHostInfoFromWindowName(skipSessionStorage, windowName) {
  381. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.HostInfo);
  382. },
  383. parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) {
  384. var xdmInfoValue=OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash);
  385. if (!xdmInfoValue) {
  386. xdmInfoValue=OSF.OUtil.parseXdmInfoFromWindowName(skipSessionStorage, window.name);
  387. }
  388. return xdmInfoValue;
  389. },
  390. parseXdmInfoFromWindowName: function OSF_OUtil$parseXdmInfoFromWindowName(skipSessionStorage, windowName) {
  391. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.XdmInfo);
  392. },
  393. parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) {
  394. return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, false, skipSessionStorage, fragment);
  395. },
  396. parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) {
  397. var serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash);
  398. if (isNaN(serializerVersion)) {
  399. serializerVersion=OSF.OUtil.parseSerializerVersionFromWindowName(skipSessionStorage, window.name);
  400. }
  401. return serializerVersion;
  402. },
  403. parseSerializerVersionFromWindowName: function OSF_OUtil$parseSerializerVersionFromWindowName(skipSessionStorage, windowName) {
  404. return parseInt(OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.SerializerVersion));
  405. },
  406. parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) {
  407. return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, true, skipSessionStorage, fragment));
  408. },
  409. parseInfoFromWindowName: function OSF_OUtil$parseInfoFromWindowName(skipSessionStorage, windowName, infoKey) {
  410. try {
  411. var windowNameObj=JSON.parse(windowName);
  412. var infoValue=windowNameObj !=null ? windowNameObj[infoKey] : null;
  413. var osfSessionStorage=_getSessionStorage();
  414. if (!skipSessionStorage && osfSessionStorage && windowNameObj !=null) {
  415. var sessionKey=windowNameObj[OSF.WindowNameItemKeys.BaseFrameName]+infoKey;
  416. if (infoValue) {
  417. osfSessionStorage.setItem(sessionKey, infoValue);
  418. }
  419. else {
  420. infoValue=osfSessionStorage.getItem(sessionKey);
  421. }
  422. }
  423. return infoValue;
  424. }
  425. catch (Exception) {
  426. return null;
  427. }
  428. },
  429. parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, decodeInfo, skipSessionStorage, fragment) {
  430. var fragmentParts=fragment.split(infoKey);
  431. var infoValue=fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null;
  432. if (decodeInfo && infoValue !=null) {
  433. if (infoValue.indexOf(_fragmentInfoDelimiter) >=0) {
  434. infoValue=infoValue.split(_fragmentInfoDelimiter)[0];
  435. }
  436. infoValue=decodeURIComponent(infoValue);
  437. }
  438. var osfSessionStorage=_getSessionStorage();
  439. if (!skipSessionStorage && osfSessionStorage) {
  440. var sessionKeyStart=window.name.indexOf(infoKeyPrefix);
  441. if (sessionKeyStart > -1) {
  442. var sessionKeyEnd=window.name.indexOf(";", sessionKeyStart);
  443. if (sessionKeyEnd==-1) {
  444. sessionKeyEnd=window.name.length;
  445. }
  446. var sessionKey=window.name.substring(sessionKeyStart, sessionKeyEnd);
  447. if (infoValue) {
  448. osfSessionStorage.setItem(sessionKey, infoValue);
  449. }
  450. else {
  451. infoValue=osfSessionStorage.getItem(sessionKey);
  452. }
  453. }
  454. }
  455. return infoValue;
  456. },
  457. getConversationId: function OSF_OUtil$getConversationId() {
  458. var searchString=window.location.search;
  459. var conversationId=null;
  460. if (searchString) {
  461. var index=searchString.indexOf("&");
  462. conversationId=index > 0 ? searchString.substring(1, index) : searchString.substr(1);
  463. if (conversationId && conversationId.charAt(conversationId.length - 1)==='=') {
  464. conversationId=conversationId.substring(0, conversationId.length - 1);
  465. if (conversationId) {
  466. conversationId=decodeURIComponent(conversationId);
  467. }
  468. }
  469. }
  470. return conversationId;
  471. },
  472. getInfoItems: function OSF_OUtil$getInfoItems(strInfo) {
  473. var items=strInfo.split("$");
  474. if (typeof items[1]=="undefined") {
  475. items=strInfo.split("|");
  476. }
  477. if (typeof items[1]=="undefined") {
  478. items=strInfo.split("%7C");
  479. }
  480. return items;
  481. },
  482. getXdmFieldValue: function OSF_OUtil$getXdmFieldValue(xdmFieldName, skipSessionStorage) {
  483. var fieldValue='';
  484. var xdmInfoValue=OSF.OUtil.parseXdmInfo(skipSessionStorage);
  485. if (xdmInfoValue) {
  486. var items=OSF.OUtil.getInfoItems(xdmInfoValue);
  487. if (items !=undefined && items.length >=3) {
  488. switch (xdmFieldName) {
  489. case OSF.XdmFieldName.ConversationUrl:
  490. fieldValue=items[2];
  491. break;
  492. case OSF.XdmFieldName.AppId:
  493. fieldValue=items[1];
  494. break;
  495. }
  496. }
  497. }
  498. return fieldValue;
  499. },
  500. validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) {
  501. var e=Function._validateParams(arguments, [{ name: "params", type: Object, mayBeNull: false },
  502. { name: "expectedProperties", type: Object, mayBeNull: false },
  503. { name: "callback", type: Function, mayBeNull: true }
  504. ]);
  505. if (e)
  506. throw e;
  507. for (var p in expectedProperties) {
  508. e=Function._validateParameter(params[p], expectedProperties[p], p);
  509. if (e)
  510. throw e;
  511. }
  512. },
  513. writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) {
  514. if (window.msWriteProfilerMark) {
  515. window.msWriteProfilerMark(text);
  516. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  517. }
  518. },
  519. outputDebug: function OSF_OUtil$outputDebug(text) {
  520. if (typeof (OsfMsAjaxFactory) !=='undefined' && OsfMsAjaxFactory.msAjaxDebug && OsfMsAjaxFactory.msAjaxDebug.trace) {
  521. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  522. }
  523. },
  524. defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) {
  525. descriptor=descriptor || {};
  526. for (var nd in attributes) {
  527. var attribute=attributes[nd];
  528. if (descriptor[attribute]==undefined) {
  529. descriptor[attribute]=true;
  530. }
  531. }
  532. Object.defineProperty(obj, prop, descriptor);
  533. return obj;
  534. },
  535. defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) {
  536. descriptors=descriptors || {};
  537. for (var prop in descriptors) {
  538. OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes);
  539. }
  540. return obj;
  541. },
  542. defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) {
  543. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]);
  544. },
  545. defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) {
  546. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]);
  547. },
  548. defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) {
  549. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]);
  550. },
  551. defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) {
  552. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]);
  553. },
  554. finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) {
  555. descriptor=descriptor || {};
  556. var props=Object.getOwnPropertyNames(obj);
  557. var propsLength=props.length;
  558. for (var i=0; i < propsLength; i++) {
  559. var prop=props[i];
  560. var desc=Object.getOwnPropertyDescriptor(obj, prop);
  561. if (!desc.get && !desc.set) {
  562. desc.writable=descriptor.writable || false;
  563. }
  564. desc.configurable=descriptor.configurable || false;
  565. desc.enumerable=descriptor.enumerable || true;
  566. Object.defineProperty(obj, prop, desc);
  567. }
  568. return obj;
  569. },
  570. mapList: function OSF_OUtil$MapList(list, mapFunction) {
  571. var ret=[];
  572. if (list) {
  573. for (var item in list) {
  574. ret.push(mapFunction(list[item]));
  575. }
  576. }
  577. return ret;
  578. },
  579. listContainsKey: function OSF_OUtil$listContainsKey(list, key) {
  580. for (var item in list) {
  581. if (key==item) {
  582. return true;
  583. }
  584. }
  585. return false;
  586. },
  587. listContainsValue: function OSF_OUtil$listContainsElement(list, value) {
  588. for (var item in list) {
  589. if (value==list[item]) {
  590. return true;
  591. }
  592. }
  593. return false;
  594. },
  595. augmentList: function OSF_OUtil$augmentList(list, addenda) {
  596. var add=list.push ? function (key, value) { list.push(value); } : function (key, value) { list[key]=value; };
  597. for (var key in addenda) {
  598. add(key, addenda[key]);
  599. }
  600. },
  601. redefineList: function OSF_Outil$redefineList(oldList, newList) {
  602. for (var key1 in oldList) {
  603. delete oldList[key1];
  604. }
  605. for (var key2 in newList) {
  606. oldList[key2]=newList[key2];
  607. }
  608. },
  609. isArray: function OSF_OUtil$isArray(obj) {
  610. return Object.prototype.toString.apply(obj)==="[object Array]";
  611. },
  612. isFunction: function OSF_OUtil$isFunction(obj) {
  613. return Object.prototype.toString.apply(obj)==="[object Function]";
  614. },
  615. isDate: function OSF_OUtil$isDate(obj) {
  616. return Object.prototype.toString.apply(obj)==="[object Date]";
  617. },
  618. addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) {
  619. if (element.addEventListener) {
  620. element.addEventListener(eventName, listener, false);
  621. }
  622. else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.attachEvent) {
  623. element.attachEvent("on"+eventName, listener);
  624. }
  625. else {
  626. element["on"+eventName]=listener;
  627. }
  628. },
  629. removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) {
  630. if (element.removeEventListener) {
  631. element.removeEventListener(eventName, listener, false);
  632. }
  633. else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.detachEvent) {
  634. element.detachEvent("on"+eventName, listener);
  635. }
  636. else {
  637. element["on"+eventName]=null;
  638. }
  639. },
  640. getCookieValue: function OSF_OUtil$getCookieValue(cookieName) {
  641. var tmpCookieString=RegExp(cookieName+"[^;]+").exec(document.cookie);
  642. return tmpCookieString.toString().replace(/^[^=]+./, "");
  643. },
  644. xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) {
  645. var xmlhttp;
  646. try {
  647. xmlhttp=new XMLHttpRequest();
  648. xmlhttp.onreadystatechange=function () {
  649. if (xmlhttp.readyState==4) {
  650. if (xmlhttp.status==200) {
  651. onSuccess(xmlhttp.responseText);
  652. }
  653. else {
  654. onError(xmlhttp.status);
  655. }
  656. }
  657. };
  658. xmlhttp.open("GET", url, true);
  659. xmlhttp.send();
  660. }
  661. catch (ex) {
  662. onError(ex);
  663. }
  664. },
  665. xhrGetFull: function OSF_OUtil$xhrGetFull(url, oneDriveFileName, onSuccess, onError) {
  666. var xmlhttp;
  667. var requestedFileName=oneDriveFileName;
  668. try {
  669. xmlhttp=new XMLHttpRequest();
  670. xmlhttp.onreadystatechange=function () {
  671. if (xmlhttp.readyState==4) {
  672. if (xmlhttp.status==200) {
  673. onSuccess(xmlhttp, requestedFileName);
  674. }
  675. else {
  676. onError(xmlhttp.status);
  677. }
  678. }
  679. };
  680. xmlhttp.open("GET", url, true);
  681. xmlhttp.send();
  682. }
  683. catch (ex) {
  684. onError(ex);
  685. }
  686. },
  687. encodeBase64: function OSF_Outil$encodeBase64(input) {
  688. if (!input)
  689. return input;
  690. var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/=";
  691. var output=[];
  692. var temp=[];
  693. var index=0;
  694. var c1, c2, c3, a, b, c;
  695. var i;
  696. var length=input.length;
  697. do {
  698. c1=input.charCodeAt(index++);
  699. c2=input.charCodeAt(index++);
  700. c3=input.charCodeAt(index++);
  701. i=0;
  702. a=c1 & 255;
  703. b=c1 >> 8;
  704. c=c2 & 255;
  705. temp[i++]=a >> 2;
  706. temp[i++]=((a & 3) << 4) | (b >> 4);
  707. temp[i++]=((b & 15) << 2) | (c >> 6);
  708. temp[i++]=c & 63;
  709. if (!isNaN(c2)) {
  710. a=c2 >> 8;
  711. b=c3 & 255;
  712. c=c3 >> 8;
  713. temp[i++]=a >> 2;
  714. temp[i++]=((a & 3) << 4) | (b >> 4);
  715. temp[i++]=((b & 15) << 2) | (c >> 6);
  716. temp[i++]=c & 63;
  717. }
  718. if (isNaN(c2)) {
  719. temp[i - 1]=64;
  720. }
  721. else if (isNaN(c3)) {
  722. temp[i - 2]=64;
  723. temp[i - 1]=64;
  724. }
  725. for (var t=0; t < i; t++) {
  726. output.push(codex.charAt(temp[t]));
  727. }
  728. } while (index < length);
  729. return output.join("");
  730. },
  731. getSessionStorage: function OSF_Outil$getSessionStorage() {
  732. return _getSessionStorage();
  733. },
  734. getLocalStorage: function OSF_Outil$getLocalStorage() {
  735. if (!_safeLocalStorage) {
  736. try {
  737. var localStorage=window.localStorage;
  738. }
  739. catch (ex) {
  740. localStorage=null;
  741. }
  742. _safeLocalStorage=new OfficeExt.SafeStorage(localStorage);
  743. }
  744. return _safeLocalStorage;
  745. },
  746. convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) {
  747. var hex="#"+(Number(val)+0x1000000).toString(16).slice(-6);
  748. return hex;
  749. },
  750. attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) {
  751. element.onclick=function (e) {
  752. handler();
  753. };
  754. element.ontouchend=function (e) {
  755. handler();
  756. e.preventDefault();
  757. };
  758. },
  759. getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) {
  760. var e=Function._validateParams(arguments, [{ name: "queryString", type: String, mayBeNull: false },
  761. { name: "paramName", type: String, mayBeNull: false }
  762. ]);
  763. if (e) {
  764. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null.");
  765. return "";
  766. }
  767. var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)", "i");
  768. if (!queryExp.test(queryString)) {
  769. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found.");
  770. return "";
  771. }
  772. return queryExp.exec(queryString)[1];
  773. },
  774. isiOS: function OSF_Outil$isiOS() {
  775. return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);
  776. },
  777. isChrome: function OSF_Outil$isChrome() {
  778. return (window.navigator.userAgent.indexOf("Chrome") > 0) && !OSF.OUtil.isEdge();
  779. },
  780. isEdge: function OSF_Outil$isEdge() {
  781. return window.navigator.userAgent.indexOf("Edge") > 0;
  782. },
  783. isIE: function OSF_Outil$isIE() {
  784. return window.navigator.userAgent.indexOf("Trident") > 0;
  785. },
  786. isFirefox: function OSF_Outil$isFirefox() {
  787. return window.navigator.userAgent.indexOf("Firefox") > 0;
  788. },
  789. shallowCopy: function OSF_Outil$shallowCopy(sourceObj) {
  790. var copyObj=sourceObj.constructor();
  791. for (var property in sourceObj) {
  792. if (sourceObj.hasOwnProperty(property)) {
  793. copyObj[property]=sourceObj[property];
  794. }
  795. }
  796. return copyObj;
  797. },
  798. createObject: function OSF_Outil$createObject(properties) {
  799. var obj=null;
  800. if (properties) {
  801. obj={};
  802. var len=properties.length;
  803. for (var i=0; i < len; i++) {
  804. obj[properties[i].name]=properties[i].value;
  805. }
  806. }
  807. return obj;
  808. },
  809. addClass: function OSF_OUtil$addClass(elmt, val) {
  810. if (!OSF.OUtil.hasClass(elmt, val)) {
  811. var className=elmt.getAttribute(_classN);
  812. if (className) {
  813. elmt.setAttribute(_classN, className+" "+val);
  814. }
  815. else {
  816. elmt.setAttribute(_classN, val);
  817. }
  818. }
  819. },
  820. hasClass: function OSF_OUtil$hasClass(elmt, clsName) {
  821. var className=elmt.getAttribute(_classN);
  822. return className && className.match(new RegExp('(\\s|^)'+clsName+'(\\s|$)'));
  823. },
  824. focusToFirstTabbable: function OSF_OUtil$focusToFirstTabbable(all, backward) {
  825. var next;
  826. var focused=false;
  827. var candidate;
  828. var setFlag=function (e) {
  829. focused=true;
  830. };
  831. var findNextPos=function (allLen, currPos, backward) {
  832. if (currPos < 0 || currPos > allLen) {
  833. return -1;
  834. }
  835. else if (currPos===0 && backward) {
  836. return -1;
  837. }
  838. else if (currPos===allLen - 1 && !backward) {
  839. return -1;
  840. }
  841. if (backward) {
  842. return currPos - 1;
  843. }
  844. else {
  845. return currPos+1;
  846. }
  847. };
  848. all=_reOrderTabbableElements(all);
  849. next=backward ? all.length - 1 : 0;
  850. if (all.length===0) {
  851. return null;
  852. }
  853. while (!focused && next >=0 && next < all.length) {
  854. candidate=all[next];
  855. window.focus();
  856. candidate.addEventListener('focus', setFlag);
  857. candidate.focus();
  858. candidate.removeEventListener('focus', setFlag);
  859. next=findNextPos(all.length, next, backward);
  860. if (!focused && candidate===document.activeElement) {
  861. focused=true;
  862. }
  863. }
  864. if (focused) {
  865. return candidate;
  866. }
  867. else {
  868. return null;
  869. }
  870. },
  871. focusToNextTabbable: function OSF_OUtil$focusToNextTabbable(all, curr, shift) {
  872. var currPos;
  873. var next;
  874. var focused=false;
  875. var candidate;
  876. var setFlag=function (e) {
  877. focused=true;
  878. };
  879. var findCurrPos=function (all, curr) {
  880. var i=0;
  881. for (; i < all.length; i++) {
  882. if (all[i]===curr) {
  883. return i;
  884. }
  885. }
  886. return -1;
  887. };
  888. var findNextPos=function (allLen, currPos, shift) {
  889. if (currPos < 0 || currPos > allLen) {
  890. return -1;
  891. }
  892. else if (currPos===0 && shift) {
  893. return -1;
  894. }
  895. else if (currPos===allLen - 1 && !shift) {
  896. return -1;
  897. }
  898. if (shift) {
  899. return currPos - 1;
  900. }
  901. else {
  902. return currPos+1;
  903. }
  904. };
  905. all=_reOrderTabbableElements(all);
  906. currPos=findCurrPos(all, curr);
  907. next=findNextPos(all.length, currPos, shift);
  908. if (next < 0) {
  909. return null;
  910. }
  911. while (!focused && next >=0 && next < all.length) {
  912. candidate=all[next];
  913. candidate.addEventListener('focus', setFlag);
  914. candidate.focus();
  915. candidate.removeEventListener('focus', setFlag);
  916. next=findNextPos(all.length, next, shift);
  917. if (!focused && candidate===document.activeElement) {
  918. focused=true;
  919. }
  920. }
  921. if (focused) {
  922. return candidate;
  923. }
  924. else {
  925. return null;
  926. }
  927. }
  928. };
  929. })();
  930. OSF.OUtil.Guid=(function () {
  931. var hexCode=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
  932. return {
  933. generateNewGuid: function OSF_Outil_Guid$generateNewGuid() {
  934. var result="";
  935. var tick=(new Date()).getTime();
  936. var index=0;
  937. for (; index < 32 && tick > 0; index++) {
  938. if (index==8 || index==12 || index==16 || index==20) {
  939. result+="-";
  940. }
  941. result+=hexCode[tick % 16];
  942. tick=Math.floor(tick / 16);
  943. }
  944. for (; index < 32; index++) {
  945. if (index==8 || index==12 || index==16 || index==20) {
  946. result+="-";
  947. }
  948. result+=hexCode[Math.floor(Math.random() * 16)];
  949. }
  950. return result;
  951. }
  952. };
  953. })();
  954. window.OSF=OSF;
  955. OSF.OUtil.setNamespace("OSF", window);
  956. OSF.AppName={
  957. Unsupported: 0,
  958. Excel: 1,
  959. Word: 2,
  960. PowerPoint: 4,
  961. Outlook: 8,
  962. ExcelWebApp: 16,
  963. WordWebApp: 32,
  964. OutlookWebApp: 64,
  965. Project: 128,
  966. AccessWebApp: 256,
  967. PowerpointWebApp: 512,
  968. ExcelIOS: 1024,
  969. Sway: 2048,
  970. WordIOS: 4096,
  971. PowerPointIOS: 8192,
  972. Access: 16384,
  973. Lync: 32768,
  974. OutlookIOS: 65536,
  975. OneNoteWebApp: 131072,
  976. OneNote: 262144,
  977. ExcelWinRT: 524288,
  978. WordWinRT: 1048576,
  979. PowerpointWinRT: 2097152,
  980. OutlookAndroid: 4194304,
  981. OneNoteWinRT: 8388608,
  982. ExcelAndroid: 8388609,
  983. VisioWebApp: 8388610
  984. };
  985. OSF.InternalPerfMarker={
  986. DataCoercionBegin: "Agave.HostCall.CoerceDataStart",
  987. DataCoercionEnd: "Agave.HostCall.CoerceDataEnd"
  988. };
  989. OSF.HostCallPerfMarker={
  990. IssueCall: "Agave.HostCall.IssueCall",
  991. ReceiveResponse: "Agave.HostCall.ReceiveResponse",
  992. RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised"
  993. };
  994. OSF.AgaveHostAction={
  995. "Select": 0,
  996. "UnSelect": 1,
  997. "CancelDialog": 2,
  998. "InsertAgave": 3,
  999. "CtrlF6In": 4,
  1000. "CtrlF6Exit": 5,
  1001. "CtrlF6ExitShift": 6,
  1002. "SelectWithError": 7,
  1003. "NotifyHostError": 8,
  1004. "RefreshAddinCommands": 9,
  1005. "PageIsReady": 10,
  1006. "TabIn": 11,
  1007. "TabInShift": 12,
  1008. "TabExit": 13,
  1009. "TabExitShift": 14,
  1010. "EscExit": 15,
  1011. "F2Exit": 16,
  1012. "ExitNoFocusable": 17,
  1013. "ExitNoFocusableShift": 18
  1014. };
  1015. OSF.SharedConstants={
  1016. "NotificationConversationIdSuffix": '_ntf'
  1017. };
  1018. OSF.DialogMessageType={
  1019. DialogMessageReceived: 0,
  1020. DialogParentMessageReceived: 1,
  1021. DialogClosed: 12006
  1022. };
  1023. OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix, hostCustomMessage, hostFullVersion, clientWindowHeight, clientWindowWidth, addinName, appDomains, dialogRequirementMatrix) {
  1024. this._id=id;
  1025. this._appName=appName;
  1026. this._appVersion=appVersion;
  1027. this._appUILocale=appUILocale;
  1028. this._dataLocale=dataLocale;
  1029. this._docUrl=docUrl;
  1030. this._clientMode=clientMode;
  1031. this._settings=settings;
  1032. this._reason=reason;
  1033. this._osfControlType=osfControlType;
  1034. this._eToken=eToken;
  1035. this._correlationId=correlationId;
  1036. this._appInstanceId=appInstanceId;
  1037. this._touchEnabled=touchEnabled;
  1038. this._commerceAllowed=commerceAllowed;
  1039. this._appMinorVersion=appMinorVersion;
  1040. this._requirementMatrix=requirementMatrix;
  1041. this._hostCustomMessage=hostCustomMessage;
  1042. this._hostFullVersion=hostFullVersion;
  1043. this._isDialog=false;
  1044. this._clientWindowHeight=clientWindowHeight;
  1045. this._clientWindowWidth=clientWindowWidth;
  1046. this._addinName=addinName;
  1047. this._appDomains=appDomains;
  1048. this._dialogRequirementMatrix=dialogRequirementMatrix;
  1049. this.get_id=function get_id() { return this._id; };
  1050. this.get_appName=function get_appName() { return this._appName; };
  1051. this.get_appVersion=function get_appVersion() { return this._appVersion; };
  1052. this.get_appUILocale=function get_appUILocale() { return this._appUILocale; };
  1053. this.get_dataLocale=function get_dataLocale() { return this._dataLocale; };
  1054. this.get_docUrl=function get_docUrl() { return this._docUrl; };
  1055. this.get_clientMode=function get_clientMode() { return this._clientMode; };
  1056. this.get_bindings=function get_bindings() { return this._bindings; };
  1057. this.get_settings=function get_settings() { return this._settings; };
  1058. this.get_reason=function get_reason() { return this._reason; };
  1059. this.get_osfControlType=function get_osfControlType() { return this._osfControlType; };
  1060. this.get_eToken=function get_eToken() { return this._eToken; };
  1061. this.get_correlationId=function get_correlationId() { return this._correlationId; };
  1062. this.get_appInstanceId=function get_appInstanceId() { return this._appInstanceId; };
  1063. this.get_touchEnabled=function get_touchEnabled() { return this._touchEnabled; };
  1064. this.get_commerceAllowed=function get_commerceAllowed() { return this._commerceAllowed; };
  1065. this.get_appMinorVersion=function get_appMinorVersion() { return this._appMinorVersion; };
  1066. this.get_requirementMatrix=function get_requirementMatrix() { return this._requirementMatrix; };
  1067. this.get_dialogRequirementMatrix=function get_dialogRequirementMatrix() { return this._dialogRequirementMatrix; };
  1068. this.get_hostCustomMessage=function get_hostCustomMessage() { return this._hostCustomMessage; };
  1069. this.get_hostFullVersion=function get_hostFullVersion() { return this._hostFullVersion; };
  1070. this.get_isDialog=function get_isDialog() { return this._isDialog; };
  1071. this.get_clientWindowHeight=function get_clientWindowHeight() { return this._clientWindowHeight; };
  1072. this.get_clientWindowWidth=function get_clientWindowWidth() { return this._clientWindowWidth; };
  1073. this.get_addinName=function get_addinName() { return this._addinName; };
  1074. this.get_appDomains=function get_appDomains() { return this._appDomains; };
  1075. };
  1076. OSF.OsfControlType={
  1077. DocumentLevel: 0,
  1078. ContainerLevel: 1
  1079. };
  1080. OSF.ClientMode={
  1081. ReadOnly: 0,
  1082. ReadWrite: 1
  1083. };
  1084. OSF.OUtil.setNamespace("Microsoft", window);
  1085. OSF.OUtil.setNamespace("Office", Microsoft);
  1086. OSF.OUtil.setNamespace("Client", Microsoft.Office);
  1087. OSF.OUtil.setNamespace("WebExtension", Microsoft.Office);
  1088. Microsoft.Office.WebExtension.InitializationReason={
  1089. Inserted: "inserted",
  1090. DocumentOpened: "documentOpened"
  1091. };
  1092. Microsoft.Office.WebExtension.ValueFormat={
  1093. Unformatted: "unformatted",
  1094. Formatted: "formatted"
  1095. };
  1096. Microsoft.Office.WebExtension.FilterType={
  1097. All: "all"
  1098. };
  1099. Microsoft.Office.WebExtension.Parameters={
  1100. BindingType: "bindingType",
  1101. CoercionType: "coercionType",
  1102. ValueFormat: "valueFormat",
  1103. FilterType: "filterType",
  1104. Columns: "columns",
  1105. SampleData: "sampleData",
  1106. GoToType: "goToType",
  1107. SelectionMode: "selectionMode",
  1108. Id: "id",
  1109. PromptText: "promptText",
  1110. ItemName: "itemName",
  1111. FailOnCollision: "failOnCollision",
  1112. StartRow: "startRow",
  1113. StartColumn: "startColumn",
  1114. RowCount: "rowCount",
  1115. ColumnCount: "columnCount",
  1116. Callback: "callback",
  1117. AsyncContext: "asyncContext",
  1118. Data: "data",
  1119. Rows: "rows",
  1120. OverwriteIfStale: "overwriteIfStale",
  1121. FileType: "fileType",
  1122. EventType: "eventType",
  1123. Handler: "handler",
  1124. SliceSize: "sliceSize",
  1125. SliceIndex: "sliceIndex",
  1126. ActiveView: "activeView",
  1127. Status: "status",
  1128. Xml: "xml",
  1129. Namespace: "namespace",
  1130. Prefix: "prefix",
  1131. XPath: "xPath",
  1132. Text: "text",
  1133. ImageLeft: "imageLeft",
  1134. ImageTop: "imageTop",
  1135. ImageWidth: "imageWidth",
  1136. ImageHeight: "imageHeight",
  1137. TaskId: "taskId",
  1138. FieldId: "fieldId",
  1139. FieldValue: "fieldValue",
  1140. ServerUrl: "serverUrl",
  1141. ListName: "listName",
  1142. ResourceId: "resourceId",
  1143. ViewType: "viewType",
  1144. ViewName: "viewName",
  1145. GetRawValue: "getRawValue",
  1146. CellFormat: "cellFormat",
  1147. TableOptions: "tableOptions",
  1148. TaskIndex: "taskIndex",
  1149. ResourceIndex: "resourceIndex",
  1150. CustomFieldId: "customFieldId",
  1151. Url: "url",
  1152. MessageHandler: "messageHandler",
  1153. Width: "width",
  1154. Height: "height",
  1155. RequireHTTPs: "requireHTTPS",
  1156. MessageToParent: "messageToParent",
  1157. DisplayInIframe: "displayInIframe",
  1158. MessageContent: "messageContent"
  1159. };
  1160. OSF.OUtil.setNamespace("DDA", OSF);
  1161. OSF.DDA.DocumentMode={
  1162. ReadOnly: 1,
  1163. ReadWrite: 0
  1164. };
  1165. OSF.DDA.PropertyDescriptors={
  1166. AsyncResultStatus: "AsyncResultStatus"
  1167. };
  1168. OSF.DDA.EventDescriptors={};
  1169. OSF.DDA.ListDescriptors={};
  1170. OSF.DDA.UI={};
  1171. OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(id, eventType) {
  1172. if (eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged ||
  1173. eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged ||
  1174. eventType==Microsoft.Office.WebExtension.EventType.DataNodeDeleted ||
  1175. eventType==Microsoft.Office.WebExtension.EventType.DataNodeInserted ||
  1176. eventType==Microsoft.Office.WebExtension.EventType.DataNodeReplaced) {
  1177. return id+"_"+eventType;
  1178. }
  1179. else {
  1180. return eventType;
  1181. }
  1182. };
  1183. OSF.DDA.MethodDispId={
  1184. dispidMethodMin: 64,
  1185. dispidGetSelectedDataMethod: 64,
  1186. dispidSetSelectedDataMethod: 65,
  1187. dispidAddBindingFromSelectionMethod: 66,
  1188. dispidAddBindingFromPromptMethod: 67,
  1189. dispidGetBindingMethod: 68,
  1190. dispidReleaseBindingMethod: 69,
  1191. dispidGetBindingDataMethod: 70,
  1192. dispidSetBindingDataMethod: 71,
  1193. dispidAddRowsMethod: 72,
  1194. dispidClearAllRowsMethod: 73,
  1195. dispidGetAllBindingsMethod: 74,
  1196. dispidLoadSettingsMethod: 75,
  1197. dispidSaveSettingsMethod: 76,
  1198. dispidGetDocumentCopyMethod: 77,
  1199. dispidAddBindingFromNamedItemMethod: 78,
  1200. dispidAddColumnsMethod: 79,
  1201. dispidGetDocumentCopyChunkMethod: 80,
  1202. dispidReleaseDocumentCopyMethod: 81,
  1203. dispidNavigateToMethod: 82,
  1204. dispidGetActiveViewMethod: 83,
  1205. dispidGetDocumentThemeMethod: 84,
  1206. dispidGetOfficeThemeMethod: 85,
  1207. dispidGetFilePropertiesMethod: 86,
  1208. dispidClearFormatsMethod: 87,
  1209. dispidSetTableOptionsMethod: 88,
  1210. dispidSetFormatsMethod: 89,
  1211. dispidExecuteRichApiRequestMethod: 93,
  1212. dispidAppCommandInvocationCompletedMethod: 94,
  1213. dispidCloseContainerMethod: 97,
  1214. dispidGetSelectedTaskMethod: 110,
  1215. dispidGetSelectedResourceMethod: 111,
  1216. dispidGetTaskMethod: 112,
  1217. dispidGetResourceFieldMethod: 113,
  1218. dispidGetWSSUrlMethod: 114,
  1219. dispidGetTaskFieldMethod: 115,
  1220. dispidGetProjectFieldMethod: 116,
  1221. dispidGetSelectedViewMethod: 117,
  1222. dispidGetTaskByIndexMethod: 118,
  1223. dispidGetResourceByIndexMethod: 119,
  1224. dispidSetTaskFieldMethod: 120,
  1225. dispidSetResourceFieldMethod: 121,
  1226. dispidGetMaxTaskIndexMethod: 122,
  1227. dispidGetMaxResourceIndexMethod: 123,
  1228. dispidCreateTaskMethod: 124,
  1229. dispidAddDataPartMethod: 128,
  1230. dispidGetDataPartByIdMethod: 129,
  1231. dispidGetDataPartsByNamespaceMethod: 130,
  1232. dispidGetDataPartXmlMethod: 131,
  1233. dispidGetDataPartNodesMethod: 132,
  1234. dispidDeleteDataPartMethod: 133,
  1235. dispidGetDataNodeValueMethod: 134,
  1236. dispidGetDataNodeXmlMethod: 135,
  1237. dispidGetDataNodesMethod: 136,
  1238. dispidSetDataNodeValueMethod: 137,
  1239. dispidSetDataNodeXmlMethod: 138,
  1240. dispidAddDataNamespaceMethod: 139,
  1241. dispidGetDataUriByPrefixMethod: 140,
  1242. dispidGetDataPrefixByUriMethod: 141,
  1243. dispidGetDataNodeTextMethod: 142,
  1244. dispidSetDataNodeTextMethod: 143,
  1245. dispidMessageParentMethod: 144,
  1246. dispidSendMessageMethod: 145,
  1247. dispidMethodMax: 145
  1248. };
  1249. OSF.DDA.EventDispId={
  1250. dispidEventMin: 0,
  1251. dispidInitializeEvent: 0,
  1252. dispidSettingsChangedEvent: 1,
  1253. dispidDocumentSelectionChangedEvent: 2,
  1254. dispidBindingSelectionChangedEvent: 3,
  1255. dispidBindingDataChangedEvent: 4,
  1256. dispidDocumentOpenEvent: 5,
  1257. dispidDocumentCloseEvent: 6,
  1258. dispidActiveViewChangedEvent: 7,
  1259. dispidDocumentThemeChangedEvent: 8,
  1260. dispidOfficeThemeChangedEvent: 9,
  1261. dispidDialogMessageReceivedEvent: 10,
  1262. dispidDialogNotificationShownInAddinEvent: 11,
  1263. dispidDialogParentMessageReceivedEvent: 12,
  1264. dispidActivationStatusChangedEvent: 32,
  1265. dispidAppCommandInvokedEvent: 39,
  1266. dispidOlkItemSelectedChangedEvent: 46,
  1267. dispidTaskSelectionChangedEvent: 56,
  1268. dispidResourceSelectionChangedEvent: 57,
  1269. dispidViewSelectionChangedEvent: 58,
  1270. dispidDataNodeAddedEvent: 60,
  1271. dispidDataNodeReplacedEvent: 61,
  1272. dispidDataNodeDeletedEvent: 62,
  1273. dispidEventMax: 63
  1274. };
  1275. OSF.DDA.ErrorCodeManager=(function () {
  1276. var _errorMappings={};
  1277. return {
  1278. getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) {
  1279. var errorArgs=_errorMappings[errorCode];
  1280. if (!errorArgs) {
  1281. errorArgs=_errorMappings[this.errorCodes.ooeInternalError];
  1282. }
  1283. else {
  1284. if (!errorArgs.name) {
  1285. errorArgs.name=_errorMappings[this.errorCodes.ooeInternalError].name;
  1286. }
  1287. if (!errorArgs.message) {
  1288. errorArgs.message=_errorMappings[this.errorCodes.ooeInternalError].message;
  1289. }
  1290. }
  1291. return errorArgs;
  1292. },
  1293. addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) {
  1294. _errorMappings[errorCode]=errorNameMessage;
  1295. },
  1296. errorCodes: {
  1297. ooeSuccess: 0,
  1298. ooeChunkResult: 1,
  1299. ooeCoercionTypeNotSupported: 1000,
  1300. ooeGetSelectionNotMatchDataType: 1001,
  1301. ooeCoercionTypeNotMatchBinding: 1002,
  1302. ooeInvalidGetRowColumnCounts: 1003,
  1303. ooeSelectionNotSupportCoercionType: 1004,
  1304. ooeInvalidGetStartRowColumn: 1005,
  1305. ooeNonUniformPartialGetNotSupported: 1006,
  1306. ooeGetDataIsTooLarge: 1008,
  1307. ooeFileTypeNotSupported: 1009,
  1308. ooeGetDataParametersConflict: 1010,
  1309. ooeInvalidGetColumns: 1011,
  1310. ooeInvalidGetRows: 1012,
  1311. ooeInvalidReadForBlankRow: 1013,
  1312. ooeUnsupportedDataObject: 2000,
  1313. ooeCannotWriteToSelection: 2001,
  1314. ooeDataNotMatchSelection: 2002,
  1315. ooeOverwriteWorksheetData: 2003,
  1316. ooeDataNotMatchBindingSize: 2004,
  1317. ooeInvalidSetStartRowColumn: 2005,
  1318. ooeInvalidDataFormat: 2006,
  1319. ooeDataNotMatchCoercionType: 2007,
  1320. ooeDataNotMatchBindingType: 2008,
  1321. ooeSetDataIsTooLarge: 2009,
  1322. ooeNonUniformPartialSetNotSupported: 2010,
  1323. ooeInvalidSetColumns: 2011,
  1324. ooeInvalidSetRows: 2012,
  1325. ooeSetDataParametersConflict: 2013,
  1326. ooeCellDataAmountBeyondLimits: 2014,
  1327. ooeSelectionCannotBound: 3000,
  1328. ooeBindingNotExist: 3002,
  1329. ooeBindingToMultipleSelection: 3003,
  1330. ooeInvalidSelectionForBindingType: 3004,
  1331. ooeOperationNotSupportedOnThisBindingType: 3005,
  1332. ooeNamedItemNotFound: 3006,
  1333. ooeMultipleNamedItemFound: 3007,
  1334. ooeInvalidNamedItemForBindingType: 3008,
  1335. ooeUnknownBindingType: 3009,
  1336. ooeOperationNotSupportedOnMatrixData: 3010,
  1337. ooeInvalidColumnsForBinding: 3011,
  1338. ooeSettingNameNotExist: 4000,
  1339. ooeSettingsCannotSave: 4001,
  1340. ooeSettingsAreStale: 4002,
  1341. ooeOperationNotSupported: 5000,
  1342. ooeInternalError: 5001,
  1343. ooeDocumentReadOnly: 5002,
  1344. ooeEventHandlerNotExist: 5003,
  1345. ooeInvalidApiCallInContext: 5004,
  1346. ooeShuttingDown: 5005,
  1347. ooeUnsupportedEnumeration: 5007,
  1348. ooeIndexOutOfRange: 5008,
  1349. ooeBrowserAPINotSupported: 5009,
  1350. ooeInvalidParam: 5010,
  1351. ooeRequestTimeout: 5011,
  1352. ooeTooManyIncompleteRequests: 5100,
  1353. ooeRequestTokenUnavailable: 5101,
  1354. ooeActivityLimitReached: 5102,
  1355. ooeCustomXmlNodeNotFound: 6000,
  1356. ooeCustomXmlError: 6100,
  1357. ooeCustomXmlExceedQuota: 6101,
  1358. ooeCustomXmlOutOfDate: 6102,
  1359. ooeNoCapability: 7000,
  1360. ooeCannotNavTo: 7001,
  1361. ooeSpecifiedIdNotExist: 7002,
  1362. ooeNavOutOfBound: 7004,
  1363. ooeElementMissing: 8000,
  1364. ooeProtectedError: 8001,
  1365. ooeInvalidCellsValue: 8010,
  1366. ooeInvalidTableOptionValue: 8011,
  1367. ooeInvalidFormatValue: 8012,
  1368. ooeRowIndexOutOfRange: 8020,
  1369. ooeColIndexOutOfRange: 8021,
  1370. ooeFormatValueOutOfRange: 8022,
  1371. ooeCellFormatAmountBeyondLimits: 8023,
  1372. ooeMemoryFileLimit: 11000,
  1373. ooeNetworkProblemRetrieveFile: 11001,
  1374. ooeInvalidSliceSize: 11002,
  1375. ooeInvalidCallback: 11101,
  1376. ooeInvalidWidth: 12000,
  1377. ooeInvalidHeight: 12001,
  1378. ooeNavigationError: 12002,
  1379. ooeInvalidScheme: 12003,
  1380. ooeAppDomains: 12004,
  1381. ooeRequireHTTPS: 12005,
  1382. ooeWebDialogClosed: 12006,
  1383. ooeDialogAlreadyOpened: 12007,
  1384. ooeEndUserAllow: 12008,
  1385. ooeEndUserIgnore: 12009,
  1386. ooeNotUILessDialog: 12010,
  1387. ooeCrossZone: 12011
  1388. },
  1389. initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) {
  1390. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported };
  1391. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported };
  1392. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding };
  1393. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts };
  1394. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType };
  1395. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn };
  1396. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported };
  1397. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge };
  1398. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported };
  1399. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict };
  1400. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns };
  1401. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows };
  1402. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow };
  1403. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject };
  1404. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection };
  1405. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection };
  1406. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData };
  1407. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize };
  1408. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn };
  1409. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat };
  1410. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType };
  1411. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType };
  1412. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge };
  1413. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported };
  1414. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns };
  1415. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows };
  1416. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict };
  1417. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound };
  1418. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist };
  1419. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection };
  1420. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType };
  1421. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType };
  1422. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound };
  1423. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound };
  1424. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType };
  1425. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType };
  1426. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData };
  1427. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding };
  1428. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist };
  1429. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave };
  1430. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale };
  1431. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported };
  1432. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription };
  1433. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly };
  1434. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist };
  1435. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext };
  1436. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown };
  1437. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage };
  1438. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1439. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported };
  1440. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout };
  1441. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests };
  1442. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable };
  1443. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={ name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached };
  1444. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound };
  1445. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1446. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={ name: stringNS.L_CustomXmlExceedQuotaName, message: stringNS.L_CustomXmlExceedQuotaMessage };
  1447. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={ name: stringNS.L_CustomXmlOutOfDateName, message: stringNS.L_CustomXmlOutOfDateMessage };
  1448. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1449. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo };
  1450. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist };
  1451. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound };
  1452. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits };
  1453. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing };
  1454. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1455. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue };
  1456. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue };
  1457. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue };
  1458. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange };
  1459. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange };
  1460. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange };
  1461. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits };
  1462. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve };
  1463. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile };
  1464. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported };
  1465. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAlreadyOpened };
  1466. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidWidth]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1467. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidHeight]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1468. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavigationError]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_NetworkProblem };
  1469. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme]={ name: stringNS.L_DialogNavigateError, message: stringNS.L_DialogAddressNotTrusted };
  1470. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAddressNotTrusted };
  1471. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAddressNotTrusted };
  1472. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_UserClickIgnore };
  1473. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_NewWindowCrossZoneErrorString };
  1474. }
  1475. };
  1476. })();
  1477. var OfficeExt;
  1478. (function (OfficeExt) {
  1479. var Requirement;
  1480. (function (Requirement) {
  1481. var RequirementMatrix=(function () {
  1482. function RequirementMatrix(_setMap) {
  1483. this.isSetSupported=function _isSetSupported(name, minVersion) {
  1484. if (name==undefined) {
  1485. return false;
  1486. }
  1487. if (minVersion==undefined) {
  1488. minVersion=0;
  1489. }
  1490. var setSupportArray=this._setMap;
  1491. var sets=setSupportArray._sets;
  1492. if (sets.hasOwnProperty(name.toLowerCase())) {
  1493. var setMaxVersion=sets[name.toLowerCase()];
  1494. return setMaxVersion > 0 && setMaxVersion >=minVersion;
  1495. }
  1496. else {
  1497. return false;
  1498. }
  1499. };
  1500. this._setMap=_setMap;
  1501. this.isSetSupported=this.isSetSupported.bind(this);
  1502. }
  1503. return RequirementMatrix;
  1504. })();
  1505. Requirement.RequirementMatrix=RequirementMatrix;
  1506. var DefaultSetRequirement=(function () {
  1507. function DefaultSetRequirement(setMap) {
  1508. this._addSetMap=function DefaultSetRequirement_addSetMap(addedSet) {
  1509. for (var name in addedSet) {
  1510. this._sets[name]=addedSet[name];
  1511. }
  1512. };
  1513. this._sets=setMap;
  1514. }
  1515. return DefaultSetRequirement;
  1516. })();
  1517. Requirement.DefaultSetRequirement=DefaultSetRequirement;
  1518. var DefaultDialogSetRequirement=(function (_super) {
  1519. __extends(DefaultDialogSetRequirement, _super);
  1520. function DefaultDialogSetRequirement() {
  1521. _super.call(this, {
  1522. "dialogapi": 1.1
  1523. });
  1524. }
  1525. return DefaultDialogSetRequirement;
  1526. })(DefaultSetRequirement);
  1527. Requirement.DefaultDialogSetRequirement=DefaultDialogSetRequirement;
  1528. var ExcelClientDefaultSetRequirement=(function (_super) {
  1529. __extends(ExcelClientDefaultSetRequirement, _super);
  1530. function ExcelClientDefaultSetRequirement() {
  1531. _super.call(this, {
  1532. "bindingevents": 1.1,
  1533. "documentevents": 1.1,
  1534. "excelapi": 1.1,
  1535. "matrixbindings": 1.1,
  1536. "matrixcoercion": 1.1,
  1537. "selection": 1.1,
  1538. "settings": 1.1,
  1539. "tablebindings": 1.1,
  1540. "tablecoercion": 1.1,
  1541. "textbindings": 1.1,
  1542. "textcoercion": 1.1
  1543. });
  1544. }
  1545. return ExcelClientDefaultSetRequirement;
  1546. })(DefaultSetRequirement);
  1547. Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement;
  1548. var ExcelClientV1DefaultSetRequirement=(function (_super) {
  1549. __extends(ExcelClientV1DefaultSetRequirement, _super);
  1550. function ExcelClientV1DefaultSetRequirement() {
  1551. _super.call(this);
  1552. this._addSetMap({
  1553. "imagecoercion": 1.1
  1554. });
  1555. }
  1556. return ExcelClientV1DefaultSetRequirement;
  1557. })(ExcelClientDefaultSetRequirement);
  1558. Requirement.ExcelClientV1DefaultSetRequirement=ExcelClientV1DefaultSetRequirement;
  1559. var OutlookClientDefaultSetRequirement=(function (_super) {
  1560. __extends(OutlookClientDefaultSetRequirement, _super);
  1561. function OutlookClientDefaultSetRequirement() {
  1562. _super.call(this, {
  1563. "mailbox": 1.3
  1564. });
  1565. }
  1566. return OutlookClientDefaultSetRequirement;
  1567. })(DefaultSetRequirement);
  1568. Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement;
  1569. var WordClientDefaultSetRequirement=(function (_super) {
  1570. __extends(WordClientDefaultSetRequirement, _super);
  1571. function WordClientDefaultSetRequirement() {
  1572. _super.call(this, {
  1573. "bindingevents": 1.1,
  1574. "compressedfile": 1.1,
  1575. "customxmlparts": 1.1,
  1576. "documentevents": 1.1,
  1577. "file": 1.1,
  1578. "htmlcoercion": 1.1,
  1579. "matrixbindings": 1.1,
  1580. "matrixcoercion": 1.1,
  1581. "ooxmlcoercion": 1.1,
  1582. "pdffile": 1.1,
  1583. "selection": 1.1,
  1584. "settings": 1.1,
  1585. "tablebindings": 1.1,
  1586. "tablecoercion": 1.1,
  1587. "textbindings": 1.1,
  1588. "textcoercion": 1.1,
  1589. "textfile": 1.1,
  1590. "wordapi": 1.1
  1591. });
  1592. }
  1593. return WordClientDefaultSetRequirement;
  1594. })(DefaultSetRequirement);
  1595. Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement;
  1596. var WordClientV1DefaultSetRequirement=(function (_super) {
  1597. __extends(WordClientV1DefaultSetRequirement, _super);
  1598. function WordClientV1DefaultSetRequirement() {
  1599. _super.call(this);
  1600. this._addSetMap({
  1601. "customxmlparts": 1.2,
  1602. "wordapi": 1.2,
  1603. "imagecoercion": 1.1
  1604. });
  1605. }
  1606. return WordClientV1DefaultSetRequirement;
  1607. })(WordClientDefaultSetRequirement);
  1608. Requirement.WordClientV1DefaultSetRequirement=WordClientV1DefaultSetRequirement;
  1609. var PowerpointClientDefaultSetRequirement=(function (_super) {
  1610. __extends(PowerpointClientDefaultSetRequirement, _super);
  1611. function PowerpointClientDefaultSetRequirement() {
  1612. _super.call(this, {
  1613. "activeview": 1.1,
  1614. "compressedfile": 1.1,
  1615. "documentevents": 1.1,
  1616. "file": 1.1,
  1617. "pdffile": 1.1,
  1618. "selection": 1.1,
  1619. "settings": 1.1,
  1620. "textcoercion": 1.1
  1621. });
  1622. }
  1623. return PowerpointClientDefaultSetRequirement;
  1624. })(DefaultSetRequirement);
  1625. Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement;
  1626. var PowerpointClientV1DefaultSetRequirement=(function (_super) {
  1627. __extends(PowerpointClientV1DefaultSetRequirement, _super);
  1628. function PowerpointClientV1DefaultSetRequirement() {
  1629. _super.call(this);
  1630. this._addSetMap({
  1631. "imagecoercion": 1.1
  1632. });
  1633. }
  1634. return PowerpointClientV1DefaultSetRequirement;
  1635. })(PowerpointClientDefaultSetRequirement);
  1636. Requirement.PowerpointClientV1DefaultSetRequirement=PowerpointClientV1DefaultSetRequirement;
  1637. var ProjectClientDefaultSetRequirement=(function (_super) {
  1638. __extends(ProjectClientDefaultSetRequirement, _super);
  1639. function ProjectClientDefaultSetRequirement() {
  1640. _super.call(this, {
  1641. "selection": 1.1,
  1642. "textcoercion": 1.1
  1643. });
  1644. }
  1645. return ProjectClientDefaultSetRequirement;
  1646. })(DefaultSetRequirement);
  1647. Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement;
  1648. var ExcelWebDefaultSetRequirement=(function (_super) {
  1649. __extends(ExcelWebDefaultSetRequirement, _super);
  1650. function ExcelWebDefaultSetRequirement() {
  1651. _super.call(this, {
  1652. "bindingevents": 1.1,
  1653. "documentevents": 1.1,
  1654. "matrixbindings": 1.1,
  1655. "matrixcoercion": 1.1,
  1656. "selection": 1.1,
  1657. "settings": 1.1,
  1658. "tablebindings": 1.1,
  1659. "tablecoercion": 1.1,
  1660. "textbindings": 1.1,
  1661. "textcoercion": 1.1,
  1662. "file": 1.1
  1663. });
  1664. }
  1665. return ExcelWebDefaultSetRequirement;
  1666. })(DefaultSetRequirement);
  1667. Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement;
  1668. var WordWebDefaultSetRequirement=(function (_super) {
  1669. __extends(WordWebDefaultSetRequirement, _super);
  1670. function WordWebDefaultSetRequirement() {
  1671. _super.call(this, {
  1672. "compressedfile": 1.1,
  1673. "documentevents": 1.1,
  1674. "file": 1.1,
  1675. "imagecoercion": 1.1,
  1676. "matrixcoercion": 1.1,
  1677. "ooxmlcoercion": 1.1,
  1678. "pdffile": 1.1,
  1679. "selection": 1.1,
  1680. "settings": 1.1,
  1681. "tablecoercion": 1.1,
  1682. "textcoercion": 1.1,
  1683. "textfile": 1.1
  1684. });
  1685. }
  1686. return WordWebDefaultSetRequirement;
  1687. })(DefaultSetRequirement);
  1688. Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement;
  1689. var PowerpointWebDefaultSetRequirement=(function (_super) {
  1690. __extends(PowerpointWebDefaultSetRequirement, _super);
  1691. function PowerpointWebDefaultSetRequirement() {
  1692. _super.call(this, {
  1693. "activeview": 1.1,
  1694. "settings": 1.1
  1695. });
  1696. }
  1697. return PowerpointWebDefaultSetRequirement;
  1698. })(DefaultSetRequirement);
  1699. Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement;
  1700. var OutlookWebDefaultSetRequirement=(function (_super) {
  1701. __extends(OutlookWebDefaultSetRequirement, _super);
  1702. function OutlookWebDefaultSetRequirement() {
  1703. _super.call(this, {
  1704. "mailbox": 1.3
  1705. });
  1706. }
  1707. return OutlookWebDefaultSetRequirement;
  1708. })(DefaultSetRequirement);
  1709. Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement;
  1710. var SwayWebDefaultSetRequirement=(function (_super) {
  1711. __extends(SwayWebDefaultSetRequirement, _super);
  1712. function SwayWebDefaultSetRequirement() {
  1713. _super.call(this, {
  1714. "activeview": 1.1,
  1715. "documentevents": 1.1,
  1716. "selection": 1.1,
  1717. "settings": 1.1,
  1718. "textcoercion": 1.1
  1719. });
  1720. }
  1721. return SwayWebDefaultSetRequirement;
  1722. })(DefaultSetRequirement);
  1723. Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement;
  1724. var AccessWebDefaultSetRequirement=(function (_super) {
  1725. __extends(AccessWebDefaultSetRequirement, _super);
  1726. function AccessWebDefaultSetRequirement() {
  1727. _super.call(this, {
  1728. "bindingevents": 1.1,
  1729. "partialtablebindings": 1.1,
  1730. "settings": 1.1,
  1731. "tablebindings": 1.1,
  1732. "tablecoercion": 1.1
  1733. });
  1734. }
  1735. return AccessWebDefaultSetRequirement;
  1736. })(DefaultSetRequirement);
  1737. Requirement.AccessWebDefaultSetRequirement=AccessWebDefaultSetRequirement;
  1738. var ExcelIOSDefaultSetRequirement=(function (_super) {
  1739. __extends(ExcelIOSDefaultSetRequirement, _super);
  1740. function ExcelIOSDefaultSetRequirement() {
  1741. _super.call(this, {
  1742. "bindingevents": 1.1,
  1743. "documentevents": 1.1,
  1744. "matrixbindings": 1.1,
  1745. "matrixcoercion": 1.1,
  1746. "selection": 1.1,
  1747. "settings": 1.1,
  1748. "tablebindings": 1.1,
  1749. "tablecoercion": 1.1,
  1750. "textbindings": 1.1,
  1751. "textcoercion": 1.1
  1752. });
  1753. }
  1754. return ExcelIOSDefaultSetRequirement;
  1755. })(DefaultSetRequirement);
  1756. Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement;
  1757. var WordIOSDefaultSetRequirement=(function (_super) {
  1758. __extends(WordIOSDefaultSetRequirement, _super);
  1759. function WordIOSDefaultSetRequirement() {
  1760. _super.call(this, {
  1761. "bindingevents": 1.1,
  1762. "compressedfile": 1.1,
  1763. "customxmlparts": 1.1,
  1764. "documentevents": 1.1,
  1765. "file": 1.1,
  1766. "htmlcoercion": 1.1,
  1767. "matrixbindings": 1.1,
  1768. "matrixcoercion": 1.1,
  1769. "ooxmlcoercion": 1.1,
  1770. "pdffile": 1.1,
  1771. "selection": 1.1,
  1772. "settings": 1.1,
  1773. "tablebindings": 1.1,
  1774. "tablecoercion": 1.1,
  1775. "textbindings": 1.1,
  1776. "textcoercion": 1.1,
  1777. "textfile": 1.1
  1778. });
  1779. }
  1780. return WordIOSDefaultSetRequirement;
  1781. })(DefaultSetRequirement);
  1782. Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement;
  1783. var WordIOSV1DefaultSetRequirement=(function (_super) {
  1784. __extends(WordIOSV1DefaultSetRequirement, _super);
  1785. function WordIOSV1DefaultSetRequirement() {
  1786. _super.call(this);
  1787. this._addSetMap({
  1788. "customxmlparts": 1.2,
  1789. "wordapi": 1.2
  1790. });
  1791. }
  1792. return WordIOSV1DefaultSetRequirement;
  1793. })(WordIOSDefaultSetRequirement);
  1794. Requirement.WordIOSV1DefaultSetRequirement=WordIOSV1DefaultSetRequirement;
  1795. var PowerpointIOSDefaultSetRequirement=(function (_super) {
  1796. __extends(PowerpointIOSDefaultSetRequirement, _super);
  1797. function PowerpointIOSDefaultSetRequirement() {
  1798. _super.call(this, {
  1799. "activeview": 1.1,
  1800. "compressedfile": 1.1,
  1801. "documentevents": 1.1,
  1802. "file": 1.1,
  1803. "pdffile": 1.1,
  1804. "selection": 1.1,
  1805. "settings": 1.1,
  1806. "textcoercion": 1.1
  1807. });
  1808. }
  1809. return PowerpointIOSDefaultSetRequirement;
  1810. })(DefaultSetRequirement);
  1811. Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement;
  1812. var OutlookIOSDefaultSetRequirement=(function (_super) {
  1813. __extends(OutlookIOSDefaultSetRequirement, _super);
  1814. function OutlookIOSDefaultSetRequirement() {
  1815. _super.call(this, {
  1816. "mailbox": 1.1
  1817. });
  1818. }
  1819. return OutlookIOSDefaultSetRequirement;
  1820. })(DefaultSetRequirement);
  1821. Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement;
  1822. var RequirementsMatrixFactory=(function () {
  1823. function RequirementsMatrixFactory() {
  1824. }
  1825. RequirementsMatrixFactory.initializeOsfDda=function () {
  1826. OSF.OUtil.setNamespace("Requirement", OSF.DDA);
  1827. };
  1828. RequirementsMatrixFactory.getDefaultRequirementMatrix=function (appContext) {
  1829. this.initializeDefaultSetMatrix();
  1830. var defaultRequirementMatrix=undefined;
  1831. var clientRequirement=appContext.get_requirementMatrix();
  1832. if (clientRequirement !=undefined && clientRequirement.length > 0 && typeof (JSON) !=="undefined") {
  1833. var matrixItem=JSON.parse(appContext.get_requirementMatrix().toLowerCase());
  1834. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem));
  1835. }
  1836. else {
  1837. var appLocator=RequirementsMatrixFactory.getClientFullVersionString(appContext);
  1838. if (RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined) {
  1839. defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]);
  1840. }
  1841. else {
  1842. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({}));
  1843. }
  1844. }
  1845. return defaultRequirementMatrix;
  1846. };
  1847. RequirementsMatrixFactory.getDefaultDialogRequirementMatrix=function (appContext) {
  1848. var defaultRequirementMatrix=undefined;
  1849. var clientRequirement=appContext.get_dialogRequirementMatrix();
  1850. if (clientRequirement !=undefined && clientRequirement.length > 0 && typeof (JSON) !=="undefined") {
  1851. var matrixItem=JSON.parse(appContext.get_requirementMatrix().toLowerCase());
  1852. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem));
  1853. }
  1854. else {
  1855. defaultRequirementMatrix=new RequirementMatrix(new DefaultDialogSetRequirement());
  1856. }
  1857. return defaultRequirementMatrix;
  1858. };
  1859. RequirementsMatrixFactory.getClientFullVersionString=function (appContext) {
  1860. var appMinorVersion=appContext.get_appMinorVersion();
  1861. var appMinorVersionString="";
  1862. var appFullVersion="";
  1863. var appName=appContext.get_appName();
  1864. var isIOSClient=appName==1024 ||
  1865. appName==4096 ||
  1866. appName==8192 ||
  1867. appName==65536;
  1868. if (isIOSClient && appContext.get_appVersion()==1) {
  1869. if (appName==4096 && appMinorVersion >=15) {
  1870. appFullVersion="16.00.01";
  1871. }
  1872. else {
  1873. appFullVersion="16.00";
  1874. }
  1875. }
  1876. else if (appContext.get_appName()==64) {
  1877. appFullVersion=appContext.get_appVersion();
  1878. }
  1879. else {
  1880. if (appMinorVersion < 10) {
  1881. appMinorVersionString="0"+appMinorVersion;
  1882. }
  1883. else {
  1884. appMinorVersionString=""+appMinorVersion;
  1885. }
  1886. appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString;
  1887. }
  1888. return appContext.get_appName()+"-"+appFullVersion;
  1889. };
  1890. RequirementsMatrixFactory.initializeDefaultSetMatrix=function () {
  1891. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement();
  1892. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement();
  1893. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement();
  1894. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1601]=new ExcelClientV1DefaultSetRequirement();
  1895. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1601]=new WordClientV1DefaultSetRequirement();
  1896. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1601]=new PowerpointClientV1DefaultSetRequirement();
  1897. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement();
  1898. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement();
  1899. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement();
  1900. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement();
  1901. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement();
  1902. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement();
  1903. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement();
  1904. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement();
  1905. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement();
  1906. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement();
  1907. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement();
  1908. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_16001]=new WordIOSV1DefaultSetRequirement();
  1909. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement();
  1910. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement();
  1911. };
  1912. RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00";
  1913. RequirementsMatrixFactory.Excel_RCLIENT_1601="1-16.01";
  1914. RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00";
  1915. RequirementsMatrixFactory.Word_RCLIENT_1601="2-16.01";
  1916. RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00";
  1917. RequirementsMatrixFactory.PowerPoint_RCLIENT_1601="4-16.01";
  1918. RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00";
  1919. RequirementsMatrixFactory.Excel_WAC_1600="16-16.00";
  1920. RequirementsMatrixFactory.Word_WAC_1600="32-16.00";
  1921. RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00";
  1922. RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01";
  1923. RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00";
  1924. RequirementsMatrixFactory.Access_WAC_1600="256-16.00";
  1925. RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00";
  1926. RequirementsMatrixFactory.Excel_IOS_1600="1024-16.00";
  1927. RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00";
  1928. RequirementsMatrixFactory.Word_IOS_1600="4096-16.00";
  1929. RequirementsMatrixFactory.Word_IOS_16001="4096-16.00.01";
  1930. RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00";
  1931. RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00";
  1932. RequirementsMatrixFactory.DefaultSetArrayMatrix={};
  1933. return RequirementsMatrixFactory;
  1934. })();
  1935. Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory;
  1936. })(Requirement=OfficeExt.Requirement || (OfficeExt.Requirement={}));
  1937. })(OfficeExt || (OfficeExt={}));
  1938. OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();
  1939. Microsoft.Office.WebExtension.ApplicationMode={
  1940. WebEditor: "webEditor",
  1941. WebViewer: "webViewer",
  1942. Client: "client"
  1943. };
  1944. Microsoft.Office.WebExtension.DocumentMode={
  1945. ReadOnly: "readOnly",
  1946. ReadWrite: "readWrite"
  1947. };
  1948. OSF.NamespaceManager=(function OSF_NamespaceManager() {
  1949. var _userOffice;
  1950. var _useShortcut=false;
  1951. return {
  1952. enableShortcut: function OSF_NamespaceManager$enableShortcut() {
  1953. if (!_useShortcut) {
  1954. if (window.Office) {
  1955. _userOffice=window.Office;
  1956. }
  1957. else {
  1958. OSF.OUtil.setNamespace("Office", window);
  1959. }
  1960. window.Office=Microsoft.Office.WebExtension;
  1961. _useShortcut=true;
  1962. }
  1963. },
  1964. disableShortcut: function OSF_NamespaceManager$disableShortcut() {
  1965. if (_useShortcut) {
  1966. if (_userOffice) {
  1967. window.Office=_userOffice;
  1968. }
  1969. else {
  1970. OSF.OUtil.unsetNamespace("Office", window);
  1971. }
  1972. _useShortcut=false;
  1973. }
  1974. }
  1975. };
  1976. })();
  1977. OSF.NamespaceManager.enableShortcut();
  1978. Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) {
  1979. if (useShortcut) {
  1980. OSF.NamespaceManager.enableShortcut();
  1981. }
  1982. else {
  1983. OSF.NamespaceManager.disableShortcut();
  1984. }
  1985. };
  1986. Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) {
  1987. var promise;
  1988. if (str && typeof str=="string") {
  1989. var index=str.indexOf("#");
  1990. if (index !=-1) {
  1991. var op=str.substring(0, index);
  1992. var target=str.substring(index+1);
  1993. switch (op) {
  1994. case "binding":
  1995. case "bindings":
  1996. if (target) {
  1997. promise=new OSF.DDA.BindingPromise(target);
  1998. }
  1999. break;
  2000. }
  2001. }
  2002. }
  2003. if (!promise) {
  2004. if (errorCallback) {
  2005. var callbackType=typeof errorCallback;
  2006. if (callbackType=="function") {
  2007. var callArgs={};
  2008. callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback;
  2009. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext));
  2010. }
  2011. else {
  2012. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType);
  2013. }
  2014. }
  2015. }
  2016. else {
  2017. promise.onFail=errorCallback;
  2018. return promise;
  2019. }
  2020. };
  2021. OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) {
  2022. OSF.OUtil.defineEnumerableProperties(this, {
  2023. "contentLanguage": {
  2024. value: officeAppContext.get_dataLocale()
  2025. },
  2026. "displayLanguage": {
  2027. value: officeAppContext.get_appUILocale()
  2028. },
  2029. "touchEnabled": {
  2030. value: officeAppContext.get_touchEnabled()
  2031. },
  2032. "commerceAllowed": {
  2033. value: officeAppContext.get_commerceAllowed()
  2034. }
  2035. });
  2036. if (license) {
  2037. OSF.OUtil.defineEnumerableProperty(this, "license", {
  2038. value: license
  2039. });
  2040. }
  2041. if (officeAppContext.ui) {
  2042. OSF.OUtil.defineEnumerableProperty(this, "ui", {
  2043. value: officeAppContext.ui
  2044. });
  2045. }
  2046. if (officeAppContext.get_isDialog()) {
  2047. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultDialogRequirementMatrix(officeAppContext);
  2048. OSF.OUtil.defineEnumerableProperty(this, "requirements", {
  2049. value: requirements
  2050. });
  2051. }
  2052. else {
  2053. if (document) {
  2054. OSF.OUtil.defineEnumerableProperty(this, "document", {
  2055. value: document
  2056. });
  2057. }
  2058. if (appOM) {
  2059. var displayName=appOM.displayName || "appOM";
  2060. delete appOM.displayName;
  2061. OSF.OUtil.defineEnumerableProperty(this, displayName, {
  2062. value: appOM
  2063. });
  2064. }
  2065. if (getOfficeTheme) {
  2066. OSF.OUtil.defineEnumerableProperty(this, "officeTheme", {
  2067. get: function () {
  2068. return getOfficeTheme();
  2069. }
  2070. });
  2071. }
  2072. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext);
  2073. OSF.OUtil.defineEnumerableProperty(this, "requirements", {
  2074. value: requirements
  2075. });
  2076. }
  2077. };
  2078. OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) {
  2079. OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme);
  2080. if (settings) {
  2081. OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", {
  2082. value: settings
  2083. });
  2084. }
  2085. };
  2086. OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context);
  2087. OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady) { };
  2088. OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) {
  2089. var mode;
  2090. switch (officeAppContext.get_clientMode()) {
  2091. case OSF.ClientMode.ReadOnly:
  2092. mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;
  2093. break;
  2094. case OSF.ClientMode.ReadWrite:
  2095. mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite;
  2096. break;
  2097. }
  2098. ;
  2099. if (settings) {
  2100. OSF.OUtil.defineEnumerableProperty(this, "settings", {
  2101. value: settings
  2102. });
  2103. }
  2104. ;
  2105. OSF.OUtil.defineMutableProperties(this, {
  2106. "mode": {
  2107. value: mode
  2108. },
  2109. "url": {
  2110. value: officeAppContext.get_docUrl()
  2111. }
  2112. });
  2113. };
  2114. OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) {
  2115. OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings);
  2116. if (bindingFacade) {
  2117. OSF.OUtil.defineEnumerableProperty(this, "bindings", {
  2118. get: function OSF_DDA_Document$GetBindings() { return bindingFacade; }
  2119. });
  2120. }
  2121. var am=OSF.DDA.AsyncMethodNames;
  2122. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  2123. am.GetSelectedDataAsync,
  2124. am.SetSelectedDataAsync
  2125. ]);
  2126. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]));
  2127. };
  2128. OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document);
  2129. OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", {
  2130. get: function Microsoft_Office_WebExtension$GetContext() {
  2131. var context;
  2132. if (OSF && OSF._OfficeAppFactory) {
  2133. context=OSF._OfficeAppFactory.getContext();
  2134. }
  2135. return context;
  2136. }
  2137. });
  2138. OSF.DDA.License=function OSF_DDA_License(eToken) {
  2139. OSF.OUtil.defineEnumerableProperty(this, "value", {
  2140. value: eToken
  2141. });
  2142. };
  2143. OSF.DDA.ApiMethodCall=function OSF_DDA_ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName) {
  2144. var requiredCount=requiredParameters.length;
  2145. var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function () {
  2146. return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName);
  2147. });
  2148. this.verifyArguments=function OSF_DDA_ApiMethodCall$VerifyArguments(params, args) {
  2149. for (var name in params) {
  2150. var param=params[name];
  2151. var arg=args[name];
  2152. if (param["enum"]) {
  2153. switch (typeof arg) {
  2154. case "string":
  2155. if (OSF.OUtil.listContainsValue(param["enum"], arg)) {
  2156. break;
  2157. }
  2158. case "undefined":
  2159. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;
  2160. default:
  2161. throw getInvalidParameterString();
  2162. }
  2163. }
  2164. if (param["types"]) {
  2165. if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) {
  2166. throw getInvalidParameterString();
  2167. }
  2168. }
  2169. }
  2170. };
  2171. this.extractRequiredArguments=function OSF_DDA_ApiMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) {
  2172. if (userArgs.length < requiredCount) {
  2173. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments);
  2174. }
  2175. var requiredArgs=[];
  2176. var index;
  2177. for (index=0; index < requiredCount; index++) {
  2178. requiredArgs.push(userArgs[index]);
  2179. }
  2180. this.verifyArguments(requiredParameters, requiredArgs);
  2181. var ret={};
  2182. for (index=0; index < requiredCount; index++) {
  2183. var param=requiredParameters[index];
  2184. var arg=requiredArgs[index];
  2185. if (param.verify) {
  2186. var isValid=param.verify(arg, caller, stateInfo);
  2187. if (!isValid) {
  2188. throw getInvalidParameterString();
  2189. }
  2190. }
  2191. ret[param.name]=arg;
  2192. }
  2193. return ret;
  2194. },
  2195. this.fillOptions=function OSF_DDA_ApiMethodCall$FillOptions(options, requiredArgs, caller, stateInfo) {
  2196. options=options || {};
  2197. for (var optionName in supportedOptions) {
  2198. if (!OSF.OUtil.listContainsKey(options, optionName)) {
  2199. var value=undefined;
  2200. var option=supportedOptions[optionName];
  2201. if (option.calculate && requiredArgs) {
  2202. value=option.calculate(requiredArgs, caller, stateInfo);
  2203. }
  2204. if (!value && option.defaultValue !==undefined) {
  2205. value=option.defaultValue;
  2206. }
  2207. options[optionName]=value;
  2208. }
  2209. }
  2210. return options;
  2211. };
  2212. this.constructCallArgs=function OSF_DAA_ApiMethodCall$ConstructCallArgs(required, options, caller, stateInfo) {
  2213. var callArgs={};
  2214. for (var r in required) {
  2215. callArgs[r]=required[r];
  2216. }
  2217. for (var o in options) {
  2218. callArgs[o]=options[o];
  2219. }
  2220. for (var s in privateStateCallbacks) {
  2221. callArgs[s]=privateStateCallbacks[s](caller, stateInfo);
  2222. }
  2223. if (checkCallArgs) {
  2224. callArgs=checkCallArgs(callArgs, caller, stateInfo);
  2225. }
  2226. return callArgs;
  2227. };
  2228. };
  2229. OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA);
  2230. OSF.DDA.AsyncResultEnum.Properties={
  2231. Context: "Context",
  2232. Value: "Value",
  2233. Status: "Status",
  2234. Error: "Error"
  2235. };
  2236. Microsoft.Office.WebExtension.AsyncResultStatus={
  2237. Succeeded: "succeeded",
  2238. Failed: "failed"
  2239. };
  2240. OSF.DDA.AsyncResultEnum.ErrorCode={
  2241. Success: 0,
  2242. Failed: 1
  2243. };
  2244. OSF.DDA.AsyncResultEnum.ErrorProperties={
  2245. Name: "Name",
  2246. Message: "Message",
  2247. Code: "Code"
  2248. };
  2249. OSF.DDA.AsyncMethodNames={};
  2250. OSF.DDA.AsyncMethodNames.addNames=function (methodNames) {
  2251. for (var entry in methodNames) {
  2252. var am={};
  2253. OSF.OUtil.defineEnumerableProperties(am, {
  2254. "id": {
  2255. value: entry
  2256. },
  2257. "displayName": {
  2258. value: methodNames[entry]
  2259. }
  2260. });
  2261. OSF.DDA.AsyncMethodNames[entry]=am;
  2262. }
  2263. };
  2264. OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) {
  2265. var requiredCount=requiredParameters.length;
  2266. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName);
  2267. function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  2268. if (userArgs.length > requiredCount+2) {
  2269. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2270. }
  2271. var options, parameterCallback;
  2272. for (var i=userArgs.length - 1; i >=requiredCount; i--) {
  2273. var argument=userArgs[i];
  2274. switch (typeof argument) {
  2275. case "object":
  2276. if (options) {
  2277. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2278. }
  2279. else {
  2280. options=argument;
  2281. }
  2282. break;
  2283. case "function":
  2284. if (parameterCallback) {
  2285. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);
  2286. }
  2287. else {
  2288. parameterCallback=argument;
  2289. }
  2290. break;
  2291. default:
  2292. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2293. break;
  2294. }
  2295. }
  2296. options=apiMethods.fillOptions(options, requiredArgs, caller, stateInfo);
  2297. if (parameterCallback) {
  2298. if (options[Microsoft.Office.WebExtension.Parameters.Callback]) {
  2299. throw Strings.OfficeOM.L_RedundantCallbackSpecification;
  2300. }
  2301. else {
  2302. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2303. }
  2304. }
  2305. apiMethods.verifyArguments(supportedOptions, options);
  2306. return options;
  2307. }
  2308. ;
  2309. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  2310. var required=apiMethods.extractRequiredArguments(userArgs, caller, stateInfo);
  2311. var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  2312. var callArgs=apiMethods.constructCallArgs(required, options, caller, stateInfo);
  2313. return callArgs;
  2314. };
  2315. this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) {
  2316. var payload;
  2317. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2318. if (onSucceeded) {
  2319. payload=onSucceeded(response, caller, callArgs);
  2320. }
  2321. else {
  2322. payload=response;
  2323. }
  2324. }
  2325. else {
  2326. if (onFailed) {
  2327. payload=onFailed(status, response);
  2328. }
  2329. else {
  2330. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2331. }
  2332. }
  2333. return payload;
  2334. };
  2335. this.getCallArgs=function (suppliedArgs) {
  2336. var options, parameterCallback;
  2337. for (var i=suppliedArgs.length - 1; i >=requiredCount; i--) {
  2338. var argument=suppliedArgs[i];
  2339. switch (typeof argument) {
  2340. case "object":
  2341. options=argument;
  2342. break;
  2343. case "function":
  2344. parameterCallback=argument;
  2345. break;
  2346. }
  2347. }
  2348. options=options || {};
  2349. if (parameterCallback) {
  2350. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2351. }
  2352. return options;
  2353. };
  2354. };
  2355. OSF.DDA.AsyncMethodCallFactory=(function () {
  2356. return {
  2357. manufacture: function (params) {
  2358. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2359. var privateStateCallbacks=params.privateStateCallbacks ? OSF.OUtil.createObject(params.privateStateCallbacks) : [];
  2360. return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName);
  2361. }
  2362. };
  2363. })();
  2364. OSF.DDA.AsyncMethodCalls={};
  2365. OSF.DDA.AsyncMethodCalls.define=function (callDefinition) {
  2366. OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition);
  2367. };
  2368. OSF.DDA.Error=function OSF_DDA_Error(name, message, code) {
  2369. OSF.OUtil.defineEnumerableProperties(this, {
  2370. "name": {
  2371. value: name
  2372. },
  2373. "message": {
  2374. value: message
  2375. },
  2376. "code": {
  2377. value: code
  2378. }
  2379. });
  2380. };
  2381. OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) {
  2382. OSF.OUtil.defineEnumerableProperties(this, {
  2383. "value": {
  2384. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]
  2385. },
  2386. "status": {
  2387. value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded
  2388. }
  2389. });
  2390. if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) {
  2391. OSF.OUtil.defineEnumerableProperty(this, "asyncContext", {
  2392. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]
  2393. });
  2394. }
  2395. if (errorArgs) {
  2396. OSF.OUtil.defineEnumerableProperty(this, "error", {
  2397. value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])
  2398. });
  2399. }
  2400. };
  2401. OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) {
  2402. var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback];
  2403. if (callback) {
  2404. var asyncInitArgs={};
  2405. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext];
  2406. var errorArgs;
  2407. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2408. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload;
  2409. }
  2410. else {
  2411. errorArgs={};
  2412. payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  2413. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2414. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  2415. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  2416. }
  2417. callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs));
  2418. }
  2419. };
  2420. OSF.DDA.SyncMethodNames={};
  2421. OSF.DDA.SyncMethodNames.addNames=function (methodNames) {
  2422. for (var entry in methodNames) {
  2423. var am={};
  2424. OSF.OUtil.defineEnumerableProperties(am, {
  2425. "id": {
  2426. value: entry
  2427. },
  2428. "displayName": {
  2429. value: methodNames[entry]
  2430. }
  2431. });
  2432. OSF.DDA.SyncMethodNames[entry]=am;
  2433. }
  2434. };
  2435. OSF.DDA.SyncMethodCall=function OSF_DDA_SyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName) {
  2436. var requiredCount=requiredParameters.length;
  2437. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName);
  2438. function OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  2439. if (userArgs.length > requiredCount+1) {
  2440. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2441. }
  2442. var options, parameterCallback;
  2443. for (var i=userArgs.length - 1; i >=requiredCount; i--) {
  2444. var argument=userArgs[i];
  2445. switch (typeof argument) {
  2446. case "object":
  2447. if (options) {
  2448. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2449. }
  2450. else {
  2451. options=argument;
  2452. }
  2453. break;
  2454. default:
  2455. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2456. break;
  2457. }
  2458. }
  2459. options=apiMethods.fillOptions(options, requiredArgs, caller, stateInfo);
  2460. apiMethods.verifyArguments(supportedOptions, options);
  2461. return options;
  2462. }
  2463. ;
  2464. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  2465. var required=apiMethods.extractRequiredArguments(userArgs, caller, stateInfo);
  2466. var options=OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  2467. var callArgs=apiMethods.constructCallArgs(required, options, caller, stateInfo);
  2468. return callArgs;
  2469. };
  2470. };
  2471. OSF.DDA.SyncMethodCallFactory=(function () {
  2472. return {
  2473. manufacture: function (params) {
  2474. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2475. return new OSF.DDA.SyncMethodCall(params.requiredArguments || [], supportedOptions, params.privateStateCallbacks, params.checkCallArgs, params.method.displayName);
  2476. }
  2477. };
  2478. })();
  2479. OSF.DDA.SyncMethodCalls={};
  2480. OSF.DDA.SyncMethodCalls.define=function (callDefinition) {
  2481. OSF.DDA.SyncMethodCalls[callDefinition.method.id]=OSF.DDA.SyncMethodCallFactory.manufacture(callDefinition);
  2482. };
  2483. OSF.DDA.ListType=(function () {
  2484. var listTypes={};
  2485. return {
  2486. setListType: function OSF_DDA_ListType$AddListType(t, prop) { listTypes[t]=prop; },
  2487. isListType: function OSF_DDA_ListType$IsListType(t) { return OSF.OUtil.listContainsKey(listTypes, t); },
  2488. getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { return listTypes[t]; }
  2489. };
  2490. })();
  2491. OSF.DDA.HostParameterMap=function (specialProcessor, mappings) {
  2492. var toHostMap="toHost";
  2493. var fromHostMap="fromHost";
  2494. var sourceData="sourceData";
  2495. var self="self";
  2496. var dynamicTypes={};
  2497. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={
  2498. toHost: function (data) {
  2499. if (data !=null && data.rows !==undefined) {
  2500. var tableData={};
  2501. tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows;
  2502. tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers;
  2503. data=tableData;
  2504. }
  2505. return data;
  2506. },
  2507. fromHost: function (args) {
  2508. return args;
  2509. }
  2510. };
  2511. dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data];
  2512. function mapValues(preimageSet, mapping) {
  2513. var ret=preimageSet ? {} : undefined;
  2514. for (var entry in preimageSet) {
  2515. var preimage=preimageSet[entry];
  2516. var image;
  2517. if (OSF.DDA.ListType.isListType(entry)) {
  2518. image=[];
  2519. for (var subEntry in preimage) {
  2520. image.push(mapValues(preimage[subEntry], mapping));
  2521. }
  2522. }
  2523. else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) {
  2524. image=dynamicTypes[entry][mapping](preimage);
  2525. }
  2526. else if (mapping==fromHostMap && specialProcessor.preserveNesting(entry)) {
  2527. image=mapValues(preimage, mapping);
  2528. }
  2529. else {
  2530. var maps=mappings[entry];
  2531. if (maps) {
  2532. var map=maps[mapping];
  2533. if (map) {
  2534. image=map[preimage];
  2535. if (image===undefined) {
  2536. image=preimage;
  2537. }
  2538. }
  2539. }
  2540. else {
  2541. image=preimage;
  2542. }
  2543. }
  2544. ret[entry]=image;
  2545. }
  2546. return ret;
  2547. }
  2548. ;
  2549. function generateArguments(imageSet, parameters) {
  2550. var ret;
  2551. for (var param in parameters) {
  2552. var arg;
  2553. if (specialProcessor.isComplexType(param)) {
  2554. arg=generateArguments(imageSet, mappings[param][toHostMap]);
  2555. }
  2556. else {
  2557. arg=imageSet[param];
  2558. }
  2559. if (arg !=undefined) {
  2560. if (!ret) {
  2561. ret={};
  2562. }
  2563. var index=parameters[param];
  2564. if (index==self) {
  2565. index=param;
  2566. }
  2567. ret[index]=specialProcessor.pack(param, arg);
  2568. }
  2569. }
  2570. return ret;
  2571. }
  2572. ;
  2573. function extractArguments(source, parameters, extracted) {
  2574. if (!extracted) {
  2575. extracted={};
  2576. }
  2577. for (var param in parameters) {
  2578. var index=parameters[param];
  2579. var value;
  2580. if (index==self) {
  2581. value=source;
  2582. }
  2583. else if (index==sourceData) {
  2584. extracted[param]=source.toArray();
  2585. continue;
  2586. }
  2587. else {
  2588. value=source[index];
  2589. }
  2590. if (value===null || value===undefined) {
  2591. extracted[param]=undefined;
  2592. }
  2593. else {
  2594. value=specialProcessor.unpack(param, value);
  2595. var map;
  2596. if (specialProcessor.isComplexType(param)) {
  2597. map=mappings[param][fromHostMap];
  2598. if (specialProcessor.preserveNesting(param)) {
  2599. extracted[param]=extractArguments(value, map);
  2600. }
  2601. else {
  2602. extractArguments(value, map, extracted);
  2603. }
  2604. }
  2605. else {
  2606. if (OSF.DDA.ListType.isListType(param)) {
  2607. map={};
  2608. var entryDescriptor=OSF.DDA.ListType.getDescriptor(param);
  2609. map[entryDescriptor]=self;
  2610. var extractedValues=new Array(value.length);
  2611. for (var item in value) {
  2612. extractedValues[item]=extractArguments(value[item], map);
  2613. }
  2614. extracted[param]=extractedValues;
  2615. }
  2616. else {
  2617. extracted[param]=value;
  2618. }
  2619. }
  2620. }
  2621. }
  2622. return extracted;
  2623. }
  2624. ;
  2625. function applyMap(mapName, preimage, mapping) {
  2626. var parameters=mappings[mapName][mapping];
  2627. var image;
  2628. if (mapping=="toHost") {
  2629. var imageSet=mapValues(preimage, mapping);
  2630. image=generateArguments(imageSet, parameters);
  2631. }
  2632. else if (mapping=="fromHost") {
  2633. var argumentSet=extractArguments(preimage, parameters);
  2634. image=mapValues(argumentSet, mapping);
  2635. }
  2636. return image;
  2637. }
  2638. ;
  2639. if (!mappings) {
  2640. mappings={};
  2641. }
  2642. this.addMapping=function (mapName, description) {
  2643. var toHost, fromHost;
  2644. if (description.map) {
  2645. toHost=description.map;
  2646. fromHost={};
  2647. for (var preimage in toHost) {
  2648. var image=toHost[preimage];
  2649. if (image==self) {
  2650. image=preimage;
  2651. }
  2652. fromHost[image]=preimage;
  2653. }
  2654. }
  2655. else {
  2656. toHost=description.toHost;
  2657. fromHost=description.fromHost;
  2658. }
  2659. var pair=mappings[mapName];
  2660. if (pair) {
  2661. var currMap=pair[toHostMap];
  2662. for (var th in currMap)
  2663. toHost[th]=currMap[th];
  2664. currMap=pair[fromHostMap];
  2665. for (var fh in currMap)
  2666. fromHost[fh]=currMap[fh];
  2667. }
  2668. else {
  2669. pair=mappings[mapName]={};
  2670. }
  2671. pair[toHostMap]=toHost;
  2672. pair[fromHostMap]=fromHost;
  2673. };
  2674. this.toHost=function (mapName, preimage) { return applyMap(mapName, preimage, toHostMap); };
  2675. this.fromHost=function (mapName, image) { return applyMap(mapName, image, fromHostMap); };
  2676. this.self=self;
  2677. this.sourceData=sourceData;
  2678. this.addComplexType=function (ct) { specialProcessor.addComplexType(ct); };
  2679. this.getDynamicType=function (dt) { return specialProcessor.getDynamicType(dt); };
  2680. this.setDynamicType=function (dt, handler) { specialProcessor.setDynamicType(dt, handler); };
  2681. this.dynamicTypes=dynamicTypes;
  2682. this.doMapValues=function (preimageSet, mapping) { return mapValues(preimageSet, mapping); };
  2683. };
  2684. OSF.DDA.SpecialProcessor=function (complexTypes, dynamicTypes) {
  2685. this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) {
  2686. complexTypes.push(ct);
  2687. };
  2688. this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) {
  2689. return dynamicTypes[dt];
  2690. };
  2691. this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) {
  2692. dynamicTypes[dt]=handler;
  2693. };
  2694. this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) {
  2695. return OSF.OUtil.listContainsValue(complexTypes, t);
  2696. };
  2697. this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) {
  2698. return OSF.OUtil.listContainsKey(dynamicTypes, p);
  2699. };
  2700. this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) {
  2701. var pn=[];
  2702. if (OSF.DDA.PropertyDescriptors)
  2703. pn.push(OSF.DDA.PropertyDescriptors.Subset);
  2704. if (OSF.DDA.DataNodeEventProperties) {
  2705. pn=pn.concat([
  2706. OSF.DDA.DataNodeEventProperties.OldNode,
  2707. OSF.DDA.DataNodeEventProperties.NewNode,
  2708. OSF.DDA.DataNodeEventProperties.NextSiblingNode
  2709. ]);
  2710. }
  2711. return OSF.OUtil.listContainsValue(pn, p);
  2712. };
  2713. this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) {
  2714. var value;
  2715. if (this.isDynamicType(param)) {
  2716. value=dynamicTypes[param].toHost(arg);
  2717. }
  2718. else {
  2719. value=arg;
  2720. }
  2721. return value;
  2722. };
  2723. this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) {
  2724. var value;
  2725. if (this.isDynamicType(param)) {
  2726. value=dynamicTypes[param].fromHost(arg);
  2727. }
  2728. else {
  2729. value=arg;
  2730. }
  2731. return value;
  2732. };
  2733. };
  2734. OSF.DDA.getDecoratedParameterMap=function (specialProcessor, initialDefs) {
  2735. var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor);
  2736. var self=parameterMap.self;
  2737. function createObject(properties) {
  2738. var obj=null;
  2739. if (properties) {
  2740. obj={};
  2741. var len=properties.length;
  2742. for (var i=0; i < len; i++) {
  2743. obj[properties[i].name]=properties[i].value;
  2744. }
  2745. }
  2746. return obj;
  2747. }
  2748. parameterMap.define=function define(definition) {
  2749. var args={};
  2750. var toHost=createObject(definition.toHost);
  2751. if (definition.invertible) {
  2752. args.map=toHost;
  2753. }
  2754. else if (definition.canonical) {
  2755. args.toHost=args.fromHost=toHost;
  2756. }
  2757. else {
  2758. args.toHost=toHost;
  2759. args.fromHost=createObject(definition.fromHost);
  2760. }
  2761. parameterMap.addMapping(definition.type, args);
  2762. if (definition.isComplexType)
  2763. parameterMap.addComplexType(definition.type);
  2764. };
  2765. for (var id in initialDefs)
  2766. parameterMap.define(initialDefs[id]);
  2767. return parameterMap;
  2768. };
  2769. OSF.OUtil.setNamespace("DispIdHost", OSF.DDA);
  2770. OSF.DDA.DispIdHost.Methods={
  2771. InvokeMethod: "invokeMethod",
  2772. AddEventHandler: "addEventHandler",
  2773. RemoveEventHandler: "removeEventHandler",
  2774. OpenDialog: "openDialog",
  2775. CloseDialog: "closeDialog",
  2776. MessageParent: "messageParent",
  2777. SendMessage: "sendMessage"
  2778. };
  2779. OSF.DDA.DispIdHost.Delegates={
  2780. ExecuteAsync: "executeAsync",
  2781. RegisterEventAsync: "registerEventAsync",
  2782. UnregisterEventAsync: "unregisterEventAsync",
  2783. ParameterMap: "parameterMap",
  2784. OpenDialog: "openDialog",
  2785. CloseDialog: "closeDialog",
  2786. MessageParent: "messageParent",
  2787. SendMessage: "sendMessage"
  2788. };
  2789. OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) {
  2790. var dispIdMap={};
  2791. var jsom=OSF.DDA.AsyncMethodNames;
  2792. var did=OSF.DDA.MethodDispId;
  2793. var methodMap={
  2794. "GoToByIdAsync": did.dispidNavigateToMethod,
  2795. "GetSelectedDataAsync": did.dispidGetSelectedDataMethod,
  2796. "SetSelectedDataAsync": did.dispidSetSelectedDataMethod,
  2797. "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod,
  2798. "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod,
  2799. "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod,
  2800. "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod,
  2801. "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod,
  2802. "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod,
  2803. "GetAllAsync": did.dispidGetAllBindingsMethod,
  2804. "GetByIdAsync": did.dispidGetBindingMethod,
  2805. "ReleaseByIdAsync": did.dispidReleaseBindingMethod,
  2806. "GetDataAsync": did.dispidGetBindingDataMethod,
  2807. "SetDataAsync": did.dispidSetBindingDataMethod,
  2808. "AddRowsAsync": did.dispidAddRowsMethod,
  2809. "AddColumnsAsync": did.dispidAddColumnsMethod,
  2810. "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod,
  2811. "RefreshAsync": did.dispidLoadSettingsMethod,
  2812. "SaveAsync": did.dispidSaveSettingsMethod,
  2813. "GetActiveViewAsync": did.dispidGetActiveViewMethod,
  2814. "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod,
  2815. "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod,
  2816. "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod,
  2817. "ClearFormatsAsync": did.dispidClearFormatsMethod,
  2818. "SetTableOptionsAsync": did.dispidSetTableOptionsMethod,
  2819. "SetFormatsAsync": did.dispidSetFormatsMethod,
  2820. "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod,
  2821. "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod,
  2822. "CloseContainerAsync": did.dispidCloseContainerMethod,
  2823. "AddDataPartAsync": did.dispidAddDataPartMethod,
  2824. "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod,
  2825. "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod,
  2826. "GetPartXmlAsync": did.dispidGetDataPartXmlMethod,
  2827. "GetPartNodesAsync": did.dispidGetDataPartNodesMethod,
  2828. "DeleteDataPartAsync": did.dispidDeleteDataPartMethod,
  2829. "GetNodeValueAsync": did.dispidGetDataNodeValueMethod,
  2830. "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod,
  2831. "GetRelativeNodesAsync": did.dispidGetDataNodesMethod,
  2832. "SetNodeValueAsync": did.dispidSetDataNodeValueMethod,
  2833. "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod,
  2834. "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod,
  2835. "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod,
  2836. "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod,
  2837. "GetNodeTextAsync": did.dispidGetDataNodeTextMethod,
  2838. "SetNodeTextAsync": did.dispidSetDataNodeTextMethod,
  2839. "GetSelectedTask": did.dispidGetSelectedTaskMethod,
  2840. "GetTask": did.dispidGetTaskMethod,
  2841. "GetWSSUrl": did.dispidGetWSSUrlMethod,
  2842. "GetTaskField": did.dispidGetTaskFieldMethod,
  2843. "GetSelectedResource": did.dispidGetSelectedResourceMethod,
  2844. "GetResourceField": did.dispidGetResourceFieldMethod,
  2845. "GetProjectField": did.dispidGetProjectFieldMethod,
  2846. "GetSelectedView": did.dispidGetSelectedViewMethod,
  2847. "GetTaskByIndex": did.dispidGetTaskByIndexMethod,
  2848. "GetResourceByIndex": did.dispidGetResourceByIndexMethod,
  2849. "SetTaskField": did.dispidSetTaskFieldMethod,
  2850. "SetResourceField": did.dispidSetResourceFieldMethod,
  2851. "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod,
  2852. "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod,
  2853. "CreateTask": did.dispidCreateTaskMethod
  2854. };
  2855. for (var method in methodMap) {
  2856. if (jsom[method]) {
  2857. dispIdMap[jsom[method].id]=methodMap[method];
  2858. }
  2859. }
  2860. jsom=OSF.DDA.SyncMethodNames;
  2861. did=OSF.DDA.MethodDispId;
  2862. var asyncMethodMap={
  2863. "MessageParent": did.dispidMessageParentMethod,
  2864. "SendMessage": did.dispidSendMessageMethod
  2865. };
  2866. for (var method in asyncMethodMap) {
  2867. if (jsom[method]) {
  2868. dispIdMap[jsom[method].id]=asyncMethodMap[method];
  2869. }
  2870. }
  2871. jsom=Microsoft.Office.WebExtension.EventType;
  2872. did=OSF.DDA.EventDispId;
  2873. var eventMap={
  2874. "SettingsChanged": did.dispidSettingsChangedEvent,
  2875. "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent,
  2876. "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent,
  2877. "BindingDataChanged": did.dispidBindingDataChangedEvent,
  2878. "ActiveViewChanged": did.dispidActiveViewChangedEvent,
  2879. "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent,
  2880. "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent,
  2881. "AppCommandInvoked": did.dispidAppCommandInvokedEvent,
  2882. "DialogMessageReceived": did.dispidDialogMessageReceivedEvent,
  2883. "DialogParentMessageReceived": did.dispidDialogParentMessageReceivedEvent,
  2884. "ItemChanged": did.dispidOlkItemSelectedChangedEvent,
  2885. "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent,
  2886. "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent,
  2887. "ViewSelectionChanged": did.dispidViewSelectionChangedEvent,
  2888. "DataNodeInserted": did.dispidDataNodeAddedEvent,
  2889. "DataNodeReplaced": did.dispidDataNodeReplacedEvent,
  2890. "DataNodeDeleted": did.dispidDataNodeDeletedEvent
  2891. };
  2892. for (var event in eventMap) {
  2893. if (jsom[event]) {
  2894. dispIdMap[jsom[event]]=eventMap[event];
  2895. }
  2896. }
  2897. function onException(ex, asyncMethodCall, suppliedArgs, callArgs) {
  2898. if (typeof ex=="number") {
  2899. if (!callArgs) {
  2900. callArgs=asyncMethodCall.getCallArgs(suppliedArgs);
  2901. }
  2902. OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex));
  2903. }
  2904. else {
  2905. throw ex;
  2906. }
  2907. }
  2908. ;
  2909. this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) {
  2910. var callArgs;
  2911. try {
  2912. var methodName=method.id;
  2913. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName];
  2914. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState);
  2915. var dispId=dispIdMap[methodName];
  2916. var delegate=getDelegateMethods(methodName);
  2917. var richApiInExcelMethodSubstitution=null;
  2918. if (window.Excel && window.Office.context.requirements.isSetSupported("RedirectV1Api")) {
  2919. window.Excel._RedirectV1APIs=true;
  2920. }
  2921. if (window.Excel && window.Excel._RedirectV1APIs && (richApiInExcelMethodSubstitution=window.Excel._V1APIMap[methodName])) {
  2922. if (richApiInExcelMethodSubstitution.preprocess) {
  2923. callArgs=richApiInExcelMethodSubstitution.preprocess(callArgs);
  2924. }
  2925. var ctx=new window.Excel.RequestContext();
  2926. var result=richApiInExcelMethodSubstitution.call(ctx, callArgs);
  2927. ctx.sync()
  2928. .then(function () {
  2929. var response=result.value;
  2930. var status=response.status;
  2931. delete response["status"];
  2932. delete response["@odata.type"];
  2933. if (richApiInExcelMethodSubstitution.postprocess) {
  2934. response=richApiInExcelMethodSubstitution.postprocess(response, callArgs);
  2935. }
  2936. if (status !=0) {
  2937. response=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2938. }
  2939. OSF.DDA.issueAsyncResult(callArgs, status, response);
  2940. })["catch"](function (error) {
  2941. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeFailure, null);
  2942. });
  2943. }
  2944. else {
  2945. var hostCallArgs;
  2946. if (parameterMap.toHost) {
  2947. hostCallArgs=parameterMap.toHost(dispId, callArgs);
  2948. }
  2949. else {
  2950. hostCallArgs=callArgs;
  2951. }
  2952. delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({
  2953. "dispId": dispId,
  2954. "hostCallArgs": hostCallArgs,
  2955. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { },
  2956. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { },
  2957. "onComplete": function (status, hostResponseArgs) {
  2958. var responseArgs;
  2959. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2960. if (parameterMap.fromHost) {
  2961. responseArgs=parameterMap.fromHost(dispId, hostResponseArgs);
  2962. }
  2963. else {
  2964. responseArgs=hostResponseArgs;
  2965. }
  2966. }
  2967. else {
  2968. responseArgs=hostResponseArgs;
  2969. }
  2970. var payload=asyncMethodCall.processResponse(status, responseArgs, caller, callArgs);
  2971. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  2972. }
  2973. });
  2974. }
  2975. }
  2976. catch (ex) {
  2977. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2978. }
  2979. };
  2980. this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) {
  2981. var callArgs;
  2982. var eventType, handler;
  2983. function onEnsureRegistration(status) {
  2984. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2985. var added=eventDispatch.addEventHandler(eventType, handler);
  2986. if (!added) {
  2987. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed;
  2988. }
  2989. }
  2990. var error;
  2991. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2992. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2993. }
  2994. OSF.DDA.issueAsyncResult(callArgs, status, error);
  2995. }
  2996. try {
  2997. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];
  2998. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  2999. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3000. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3001. if (eventDispatch.getEventHandlerCount(eventType)==0) {
  3002. var dispId=dispIdMap[eventType];
  3003. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3004. invoker({
  3005. "eventType": eventType,
  3006. "dispId": dispId,
  3007. "targetId": caller.id || "",
  3008. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3009. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3010. "onComplete": onEnsureRegistration,
  3011. "onEvent": function handleEvent(hostArgs) {
  3012. var args=parameterMap.fromHost(dispId, hostArgs);
  3013. eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args));
  3014. }
  3015. });
  3016. }
  3017. else {
  3018. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  3019. }
  3020. }
  3021. catch (ex) {
  3022. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3023. }
  3024. };
  3025. this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) {
  3026. var callArgs;
  3027. var eventType, handler;
  3028. function onEnsureRegistration(status) {
  3029. var error;
  3030. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3031. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3032. }
  3033. OSF.DDA.issueAsyncResult(callArgs, status, error);
  3034. }
  3035. try {
  3036. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];
  3037. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3038. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3039. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3040. var status, removeSuccess;
  3041. if (handler===null) {
  3042. removeSuccess=eventDispatch.clearEventHandlers(eventType);
  3043. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  3044. }
  3045. else {
  3046. removeSuccess=eventDispatch.removeEventHandler(eventType, handler);
  3047. status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist;
  3048. }
  3049. if (removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) {
  3050. var dispId=dispIdMap[eventType];
  3051. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3052. invoker({
  3053. "eventType": eventType,
  3054. "dispId": dispId,
  3055. "targetId": caller.id || "",
  3056. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3057. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3058. "onComplete": onEnsureRegistration
  3059. });
  3060. }
  3061. else {
  3062. onEnsureRegistration(status);
  3063. }
  3064. }
  3065. catch (ex) {
  3066. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3067. }
  3068. };
  3069. this[OSF.DDA.DispIdHost.Methods.OpenDialog]=function OSF_DDA_DispIdHost_Facade$OpenDialog(suppliedArguments, eventDispatch, caller) {
  3070. var callArgs;
  3071. var targetId;
  3072. var dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3073. var dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3074. function onEnsureRegistration(status) {
  3075. var payload;
  3076. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3077. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3078. }
  3079. else {
  3080. var onSucceedArgs={};
  3081. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Id]=targetId;
  3082. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Data]=eventDispatch;
  3083. var payload=asyncMethodCall.processResponse(status, onSucceedArgs, caller, callArgs);
  3084. OSF.DialogShownStatus.hasDialogShown=true;
  3085. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3086. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3087. }
  3088. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  3089. }
  3090. try {
  3091. if (dialogMessageEvent==undefined || dialogOtherEvent==undefined) {
  3092. onEnsureRegistration(OSF.DDA.ErrorCodeManager.ooeOperationNotSupported);
  3093. }
  3094. if (OSF.DDA.AsyncMethodNames.DisplayDialogAsync==null) {
  3095. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3096. return;
  3097. }
  3098. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.DisplayDialogAsync.id];
  3099. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3100. var dispId=dispIdMap[dialogMessageEvent];
  3101. var delegateMethods=getDelegateMethods(dialogMessageEvent);
  3102. var invoker=delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog] !=undefined ?
  3103. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog] :
  3104. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3105. targetId=JSON.stringify(callArgs);
  3106. invoker({
  3107. "eventType": dialogMessageEvent,
  3108. "dispId": dispId,
  3109. "targetId": targetId,
  3110. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3111. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3112. "onComplete": onEnsureRegistration,
  3113. "onEvent": function handleEvent(hostArgs) {
  3114. var args=parameterMap.fromHost(dispId, hostArgs);
  3115. var event=OSF.DDA.OMFactory.manufactureEventArgs(dialogMessageEvent, caller, args);
  3116. if (event.type==dialogOtherEvent) {
  3117. var payload=OSF.DDA.ErrorCodeManager.getErrorArgs(event.error);
  3118. var errorArgs={};
  3119. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3120. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  3121. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  3122. event.error=new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]);
  3123. }
  3124. eventDispatch.fireOrQueueEvent(event);
  3125. if (args[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogClosed) {
  3126. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3127. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3128. eventDispatch.clearEventHandlers(Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived);
  3129. OSF.DialogShownStatus.hasDialogShown=false;
  3130. }
  3131. }
  3132. });
  3133. }
  3134. catch (ex) {
  3135. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3136. }
  3137. };
  3138. this[OSF.DDA.DispIdHost.Methods.CloseDialog]=function OSF_DDA_DispIdHost_Facade$CloseDialog(suppliedArguments, targetId, eventDispatch, caller) {
  3139. var callArgs;
  3140. var dialogMessageEvent, dialogOtherEvent;
  3141. var closeStatus=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  3142. function closeCallback(status) {
  3143. closeStatus=status;
  3144. OSF.DialogShownStatus.hasDialogShown=false;
  3145. }
  3146. try {
  3147. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.CloseAsync.id];
  3148. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3149. dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3150. dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3151. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3152. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3153. var dispId=dispIdMap[dialogMessageEvent];
  3154. var delegateMethods=getDelegateMethods(dialogMessageEvent);
  3155. var invoker=delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog] !=undefined ?
  3156. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog] :
  3157. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3158. invoker({
  3159. "eventType": dialogMessageEvent,
  3160. "dispId": dispId,
  3161. "targetId": targetId,
  3162. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3163. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3164. "onComplete": closeCallback
  3165. });
  3166. }
  3167. catch (ex) {
  3168. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3169. }
  3170. if (closeStatus !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3171. throw OSF.OUtil.formatString(Strings.OfficeOM.L_FunctionCallFailed, OSF.DDA.AsyncMethodNames.CloseAsync.displayName, closeStatus);
  3172. }
  3173. };
  3174. this[OSF.DDA.DispIdHost.Methods.MessageParent]=function OSF_DDA_DispIdHost_Facade$MessageParent(suppliedArguments, caller) {
  3175. var stateInfo={};
  3176. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.MessageParent.id];
  3177. var callArgs=syncMethodCall.verifyAndExtractCall(suppliedArguments, caller, stateInfo);
  3178. var delegate=getDelegateMethods(OSF.DDA.SyncMethodNames.MessageParent.id);
  3179. var invoker=delegate[OSF.DDA.DispIdHost.Delegates.MessageParent];
  3180. var dispId=dispIdMap[OSF.DDA.SyncMethodNames.MessageParent.id];
  3181. return invoker({
  3182. "dispId": dispId,
  3183. "hostCallArgs": callArgs,
  3184. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3185. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }
  3186. });
  3187. };
  3188. this[OSF.DDA.DispIdHost.Methods.SendMessage]=function OSF_DDA_DispIdHost_Facade$SendMessage(suppliedArguments, eventDispatch, caller) {
  3189. var stateInfo={};
  3190. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.SendMessage.id];
  3191. var callArgs=syncMethodCall.verifyAndExtractCall(suppliedArguments, caller, stateInfo);
  3192. var delegate=getDelegateMethods(OSF.DDA.SyncMethodNames.SendMessage.id);
  3193. var invoker=delegate[OSF.DDA.DispIdHost.Delegates.SendMessage];
  3194. var dispId=dispIdMap[OSF.DDA.SyncMethodNames.SendMessage.id];
  3195. return invoker({
  3196. "dispId": dispId,
  3197. "hostCallArgs": callArgs,
  3198. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3199. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }
  3200. });
  3201. };
  3202. };
  3203. OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) {
  3204. for (var entry in asyncMethodNames) {
  3205. var method=asyncMethodNames[entry];
  3206. var name=method.displayName;
  3207. if (!target[name]) {
  3208. OSF.OUtil.defineEnumerableProperty(target, name, {
  3209. value: (function (asyncMethod) {
  3210. return function () {
  3211. var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];
  3212. invokeMethod(asyncMethod, arguments, target, privateState);
  3213. };
  3214. })(method)
  3215. });
  3216. }
  3217. }
  3218. };
  3219. OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) {
  3220. var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName;
  3221. var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;
  3222. if (!target[add]) {
  3223. OSF.OUtil.defineEnumerableProperty(target, add, {
  3224. value: function () {
  3225. var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];
  3226. addEventHandler(arguments, eventDispatch, target);
  3227. }
  3228. });
  3229. }
  3230. if (!target[remove]) {
  3231. OSF.OUtil.defineEnumerableProperty(target, remove, {
  3232. value: function () {
  3233. var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];
  3234. removeEventHandler(arguments, eventDispatch, target);
  3235. }
  3236. });
  3237. }
  3238. };
  3239. var OfficeExt;
  3240. (function (OfficeExt) {
  3241. var MsAjaxTypeHelper=(function () {
  3242. function MsAjaxTypeHelper() {
  3243. }
  3244. MsAjaxTypeHelper.isInstanceOfType=function (type, instance) {
  3245. if (typeof (instance)==="undefined" || instance===null)
  3246. return false;
  3247. if (instance instanceof type)
  3248. return true;
  3249. var instanceType=instance.constructor;
  3250. if (!instanceType || (typeof (instanceType) !=="function") || !instanceType.__typeName || instanceType.__typeName==='Object') {
  3251. instanceType=Object;
  3252. }
  3253. return !!(instanceType===type) ||
  3254. (instanceType.__typeName && type.__typeName && instanceType.__typeName===type.__typeName);
  3255. };
  3256. return MsAjaxTypeHelper;
  3257. })();
  3258. OfficeExt.MsAjaxTypeHelper=MsAjaxTypeHelper;
  3259. var MsAjaxError=(function () {
  3260. function MsAjaxError() {
  3261. }
  3262. MsAjaxError.create=function (message, errorInfo) {
  3263. var err=new Error(message);
  3264. err.message=message;
  3265. if (errorInfo) {
  3266. for (var v in errorInfo) {
  3267. err[v]=errorInfo[v];
  3268. }
  3269. }
  3270. err.popStackFrame();
  3271. return err;
  3272. };
  3273. MsAjaxError.parameterCount=function (message) {
  3274. var displayMessage="Sys.ParameterCountException: "+(message ? message : "Parameter count mismatch.");
  3275. var err=MsAjaxError.create(displayMessage, { name: 'Sys.ParameterCountException' });
  3276. err.popStackFrame();
  3277. return err;
  3278. };
  3279. MsAjaxError.argument=function (paramName, message) {
  3280. var displayMessage="Sys.ArgumentException: "+(message ? message : "Value does not fall within the expected range.");
  3281. if (paramName) {
  3282. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3283. }
  3284. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName });
  3285. err.popStackFrame();
  3286. return err;
  3287. };
  3288. MsAjaxError.argumentNull=function (paramName, message) {
  3289. var displayMessage="Sys.ArgumentNullException: "+(message ? message : "Value cannot be null.");
  3290. if (paramName) {
  3291. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3292. }
  3293. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName });
  3294. err.popStackFrame();
  3295. return err;
  3296. };
  3297. MsAjaxError.argumentOutOfRange=function (paramName, actualValue, message) {
  3298. var displayMessage="Sys.ArgumentOutOfRangeException: "+(message ? message : "Specified argument was out of the range of valid values.");
  3299. if (paramName) {
  3300. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3301. }
  3302. if (typeof (actualValue) !=="undefined" && actualValue !==null) {
  3303. displayMessage+="\n"+MsAjaxString.format("Actual value was {0}.", actualValue);
  3304. }
  3305. var err=MsAjaxError.create(displayMessage, {
  3306. name: "Sys.ArgumentOutOfRangeException",
  3307. paramName: paramName,
  3308. actualValue: actualValue
  3309. });
  3310. err.popStackFrame();
  3311. return err;
  3312. };
  3313. MsAjaxError.argumentType=function (paramName, actualType, expectedType, message) {
  3314. var displayMessage="Sys.ArgumentTypeException: ";
  3315. if (message) {
  3316. displayMessage+=message;
  3317. }
  3318. else if (actualType && expectedType) {
  3319. displayMessage+=MsAjaxString.format("Object of type '{0}' cannot be converted to type '{1}'.", actualType.getName ? actualType.getName() : actualType, expectedType.getName ? expectedType.getName() : expectedType);
  3320. }
  3321. else {
  3322. displayMessage+="Object cannot be converted to the required type.";
  3323. }
  3324. if (paramName) {
  3325. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3326. }
  3327. var err=MsAjaxError.create(displayMessage, {
  3328. name: "Sys.ArgumentTypeException",
  3329. paramName: paramName,
  3330. actualType: actualType,
  3331. expectedType: expectedType
  3332. });
  3333. err.popStackFrame();
  3334. return err;
  3335. };
  3336. MsAjaxError.argumentUndefined=function (paramName, message) {
  3337. var displayMessage="Sys.ArgumentUndefinedException: "+(message ? message : "Value cannot be undefined.");
  3338. if (paramName) {
  3339. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3340. }
  3341. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName });
  3342. err.popStackFrame();
  3343. return err;
  3344. };
  3345. MsAjaxError.invalidOperation=function (message) {
  3346. var displayMessage="Sys.InvalidOperationException: "+(message ? message : "Operation is not valid due to the current state of the object.");
  3347. var err=MsAjaxError.create(displayMessage, { name: 'Sys.InvalidOperationException' });
  3348. err.popStackFrame();
  3349. return err;
  3350. };
  3351. return MsAjaxError;
  3352. })();
  3353. OfficeExt.MsAjaxError=MsAjaxError;
  3354. var MsAjaxString=(function () {
  3355. function MsAjaxString() {
  3356. }
  3357. MsAjaxString.format=function (format) {
  3358. var args=[];
  3359. for (var _i=1; _i < arguments.length; _i++) {
  3360. args[_i - 1]=arguments[_i];
  3361. }
  3362. var source=format;
  3363. return source.replace(/{(\d+)}/gm, function (match, number) {
  3364. var index=parseInt(number, 10);
  3365. return args[index]===undefined ? '{'+number+'}' : args[index];
  3366. });
  3367. };
  3368. MsAjaxString.startsWith=function (str, prefix) {
  3369. return (str.substr(0, prefix.length)===prefix);
  3370. };
  3371. return MsAjaxString;
  3372. })();
  3373. OfficeExt.MsAjaxString=MsAjaxString;
  3374. var MsAjaxDebug=(function () {
  3375. function MsAjaxDebug() {
  3376. }
  3377. MsAjaxDebug.trace=function (text) {
  3378. if (typeof Debug !=="undefined" && Debug.writeln)
  3379. Debug.writeln(text);
  3380. if (window.console && window.console.log)
  3381. window.console.log(text);
  3382. if (window.opera && window.opera.postError)
  3383. window.opera.postError(text);
  3384. if (window.debugService && window.debugService.trace)
  3385. window.debugService.trace(text);
  3386. var a=document.getElementById("TraceConsole");
  3387. if (a && a.tagName.toUpperCase()==="TEXTAREA") {
  3388. a.innerHTML+=text+"\n";
  3389. }
  3390. };
  3391. return MsAjaxDebug;
  3392. })();
  3393. OfficeExt.MsAjaxDebug=MsAjaxDebug;
  3394. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  3395. var registerTypeInternal=function registerTypeInternal(type, name, isClass) {
  3396. if (type.__typeName===undefined) {
  3397. type.__typeName=name;
  3398. }
  3399. if (type.__class===undefined) {
  3400. type.__class=isClass;
  3401. }
  3402. };
  3403. registerTypeInternal(Function, "Function", true);
  3404. registerTypeInternal(Error, "Error", true);
  3405. registerTypeInternal(Object, "Object", true);
  3406. registerTypeInternal(String, "String", true);
  3407. registerTypeInternal(Boolean, "Boolean", true);
  3408. registerTypeInternal(Date, "Date", true);
  3409. registerTypeInternal(Number, "Number", true);
  3410. registerTypeInternal(RegExp, "RegExp", true);
  3411. registerTypeInternal(Array, "Array", true);
  3412. if (!Function.createCallback) {
  3413. Function.createCallback=function Function$createCallback(method, context) {
  3414. var e=Function._validateParams(arguments, [
  3415. { name: "method", type: Function },
  3416. { name: "context", mayBeNull: true }
  3417. ]);
  3418. if (e)
  3419. throw e;
  3420. return function () {
  3421. var l=arguments.length;
  3422. if (l > 0) {
  3423. var args=[];
  3424. for (var i=0; i < l; i++) {
  3425. args[i]=arguments[i];
  3426. }
  3427. args[l]=context;
  3428. return method.apply(this, args);
  3429. }
  3430. return method.call(this, context);
  3431. };
  3432. };
  3433. }
  3434. if (!Function.createDelegate) {
  3435. Function.createDelegate=function Function$createDelegate(instance, method) {
  3436. var e=Function._validateParams(arguments, [
  3437. { name: "instance", mayBeNull: true },
  3438. { name: "method", type: Function }
  3439. ]);
  3440. if (e)
  3441. throw e;
  3442. return function () {
  3443. return method.apply(instance, arguments);
  3444. };
  3445. };
  3446. }
  3447. if (!Function._validateParams) {
  3448. Function._validateParams=function (params, expectedParams, validateParameterCount) {
  3449. var e, expectedLength=expectedParams.length;
  3450. validateParameterCount=validateParameterCount || (typeof (validateParameterCount)==="undefined");
  3451. e=Function._validateParameterCount(params, expectedParams, validateParameterCount);
  3452. if (e) {
  3453. e.popStackFrame();
  3454. return e;
  3455. }
  3456. for (var i=0, l=params.length; i < l; i++) {
  3457. var expectedParam=expectedParams[Math.min(i, expectedLength - 1)], paramName=expectedParam.name;
  3458. if (expectedParam.parameterArray) {
  3459. paramName+="["+(i - expectedLength+1)+"]";
  3460. }
  3461. else if (!validateParameterCount && (i >=expectedLength)) {
  3462. break;
  3463. }
  3464. e=Function._validateParameter(params[i], expectedParam, paramName);
  3465. if (e) {
  3466. e.popStackFrame();
  3467. return e;
  3468. }
  3469. }
  3470. return null;
  3471. };
  3472. }
  3473. if (!Function._validateParameterCount) {
  3474. Function._validateParameterCount=function (params, expectedParams, validateParameterCount) {
  3475. var i, error, expectedLen=expectedParams.length, actualLen=params.length;
  3476. if (actualLen < expectedLen) {
  3477. var minParams=expectedLen;
  3478. for (i=0; i < expectedLen; i++) {
  3479. var param=expectedParams[i];
  3480. if (param.optional || param.parameterArray) {
  3481. minParams--;
  3482. }
  3483. }
  3484. if (actualLen < minParams) {
  3485. error=true;
  3486. }
  3487. }
  3488. else if (validateParameterCount && (actualLen > expectedLen)) {
  3489. error=true;
  3490. for (i=0; i < expectedLen; i++) {
  3491. if (expectedParams[i].parameterArray) {
  3492. error=false;
  3493. break;
  3494. }
  3495. }
  3496. }
  3497. if (error) {
  3498. var e=MsAjaxError.parameterCount();
  3499. e.popStackFrame();
  3500. return e;
  3501. }
  3502. return null;
  3503. };
  3504. }
  3505. if (!Function._validateParameter) {
  3506. Function._validateParameter=function (param, expectedParam, paramName) {
  3507. var e, expectedType=expectedParam.type, expectedInteger=!!expectedParam.integer, expectedDomElement=!!expectedParam.domElement, mayBeNull=!!expectedParam.mayBeNull;
  3508. e=Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName);
  3509. if (e) {
  3510. e.popStackFrame();
  3511. return e;
  3512. }
  3513. var expectedElementType=expectedParam.elementType, elementMayBeNull=!!expectedParam.elementMayBeNull;
  3514. if (expectedType===Array && typeof (param) !=="undefined" && param !==null &&
  3515. (expectedElementType || !elementMayBeNull)) {
  3516. var expectedElementInteger=!!expectedParam.elementInteger, expectedElementDomElement=!!expectedParam.elementDomElement;
  3517. for (var i=0; i < param.length; i++) {
  3518. var elem=param[i];
  3519. e=Function._validateParameterType(elem, expectedElementType, expectedElementInteger, expectedElementDomElement, elementMayBeNull, paramName+"["+i+"]");
  3520. if (e) {
  3521. e.popStackFrame();
  3522. return e;
  3523. }
  3524. }
  3525. }
  3526. return null;
  3527. };
  3528. }
  3529. if (!Function._validateParameterType) {
  3530. Function._validateParameterType=function (param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) {
  3531. var e, i;
  3532. if (typeof (param)==="undefined") {
  3533. if (mayBeNull) {
  3534. return null;
  3535. }
  3536. else {
  3537. e=OfficeExt.MsAjaxError.argumentUndefined(paramName);
  3538. e.popStackFrame();
  3539. return e;
  3540. }
  3541. }
  3542. if (param===null) {
  3543. if (mayBeNull) {
  3544. return null;
  3545. }
  3546. else {
  3547. e=OfficeExt.MsAjaxError.argumentNull(paramName);
  3548. e.popStackFrame();
  3549. return e;
  3550. }
  3551. }
  3552. if (expectedType && !OfficeExt.MsAjaxTypeHelper.isInstanceOfType(expectedType, param)) {
  3553. e=OfficeExt.MsAjaxError.argumentType(paramName, typeof (param), expectedType);
  3554. e.popStackFrame();
  3555. return e;
  3556. }
  3557. return null;
  3558. };
  3559. }
  3560. if (!window.Type) {
  3561. window.Type=Function;
  3562. }
  3563. if (!Type.registerNamespace) {
  3564. Type.registerNamespace=function (ns) {
  3565. var namespaceParts=ns.split('.');
  3566. var currentNamespace=window;
  3567. for (var i=0; i < namespaceParts.length; i++) {
  3568. currentNamespace[namespaceParts[i]]=currentNamespace[namespaceParts[i]] || {};
  3569. currentNamespace=currentNamespace[namespaceParts[i]];
  3570. }
  3571. };
  3572. }
  3573. if (!Type.prototype.registerClass) {
  3574. Type.prototype.registerClass=function (cls) { cls={}; };
  3575. }
  3576. if (typeof (Sys)==="undefined") {
  3577. Type.registerNamespace('Sys');
  3578. }
  3579. if (!Error.prototype.popStackFrame) {
  3580. Error.prototype.popStackFrame=function () {
  3581. if (arguments.length !==0)
  3582. throw MsAjaxError.parameterCount();
  3583. if (typeof (this.stack)==="undefined" || this.stack===null ||
  3584. typeof (this.fileName)==="undefined" || this.fileName===null ||
  3585. typeof (this.lineNumber)==="undefined" || this.lineNumber===null) {
  3586. return;
  3587. }
  3588. var stackFrames=this.stack.split("\n");
  3589. var currentFrame=stackFrames[0];
  3590. var pattern=this.fileName+":"+this.lineNumber;
  3591. while (typeof (currentFrame) !=="undefined" &&
  3592. currentFrame !==null &&
  3593. currentFrame.indexOf(pattern)===-1) {
  3594. stackFrames.shift();
  3595. currentFrame=stackFrames[0];
  3596. }
  3597. var nextFrame=stackFrames[1];
  3598. if (typeof (nextFrame)==="undefined" || nextFrame===null) {
  3599. return;
  3600. }
  3601. var nextFrameParts=nextFrame.match(/@(.*):(\d+)$/);
  3602. if (typeof (nextFrameParts)==="undefined" || nextFrameParts===null) {
  3603. return;
  3604. }
  3605. this.fileName=nextFrameParts[1];
  3606. this.lineNumber=parseInt(nextFrameParts[2]);
  3607. stackFrames.shift();
  3608. this.stack=stackFrames.join("\n");
  3609. };
  3610. }
  3611. OsfMsAjaxFactory.msAjaxError=MsAjaxError;
  3612. OsfMsAjaxFactory.msAjaxString=MsAjaxString;
  3613. OsfMsAjaxFactory.msAjaxDebug=MsAjaxDebug;
  3614. }
  3615. })(OfficeExt || (OfficeExt={}));
  3616. OSF.OUtil.setNamespace("SafeArray", OSF.DDA);
  3617. OSF.DDA.SafeArray.Response={
  3618. Status: 0,
  3619. Payload: 1
  3620. };
  3621. OSF.DDA.SafeArray.UniqueArguments={
  3622. Offset: "offset",
  3623. Run: "run",
  3624. BindingSpecificData: "bindingSpecificData",
  3625. MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}"
  3626. };
  3627. OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray);
  3628. OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) {
  3629. var status;
  3630. var statusNumber=ex.number;
  3631. if (statusNumber) {
  3632. switch (statusNumber) {
  3633. case -2146828218:
  3634. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3635. break;
  3636. case -2147467259:
  3637. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened;
  3638. break;
  3639. case -2146828283:
  3640. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidParam;
  3641. break;
  3642. case -2147209089:
  3643. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidParam;
  3644. break;
  3645. case -2146827850:
  3646. default:
  3647. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3648. break;
  3649. }
  3650. }
  3651. if (args.onComplete) {
  3652. args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3653. }
  3654. };
  3655. OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod=function OSF_DDA_SafeArray_Delegate$OnExceptionSyncMethod(ex, args) {
  3656. var status;
  3657. var number=ex.number;
  3658. if (number) {
  3659. switch (number) {
  3660. case -2146828218:
  3661. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3662. break;
  3663. case -2146827850:
  3664. default:
  3665. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3666. break;
  3667. }
  3668. }
  3669. return status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3670. };
  3671. OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() {
  3672. function _2DVBArrayToJaggedArray(vbArr) {
  3673. var ret;
  3674. try {
  3675. var rows=vbArr.ubound(1);
  3676. var cols=vbArr.ubound(2);
  3677. vbArr=vbArr.toArray();
  3678. if (rows==1 && cols==1) {
  3679. ret=[vbArr];
  3680. }
  3681. else {
  3682. ret=[];
  3683. for (var row=0; row < rows; row++) {
  3684. var rowArr=[];
  3685. for (var col=0; col < cols; col++) {
  3686. var datum=vbArr[row * cols+col];
  3687. if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) {
  3688. rowArr.push(datum);
  3689. }
  3690. }
  3691. if (rowArr.length > 0) {
  3692. ret.push(rowArr);
  3693. }
  3694. }
  3695. }
  3696. }
  3697. catch (ex) {
  3698. }
  3699. return ret;
  3700. }
  3701. var complexTypes=[];
  3702. var dynamicTypes={};
  3703. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () {
  3704. var tableRows=0;
  3705. var tableHeaders=1;
  3706. return {
  3707. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) {
  3708. if (OSF.DDA.TableDataProperties && typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) {
  3709. var tableData=[];
  3710. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  3711. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  3712. data=tableData;
  3713. }
  3714. return data;
  3715. },
  3716. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) {
  3717. var ret;
  3718. if (hostArgs.toArray) {
  3719. var dimensions=hostArgs.dimensions();
  3720. if (dimensions===2) {
  3721. ret=_2DVBArrayToJaggedArray(hostArgs);
  3722. }
  3723. else {
  3724. var array=hostArgs.toArray();
  3725. if (array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) {
  3726. ret={};
  3727. ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]);
  3728. ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]);
  3729. }
  3730. else {
  3731. ret=array;
  3732. }
  3733. }
  3734. }
  3735. else {
  3736. ret=hostArgs;
  3737. }
  3738. return ret;
  3739. }
  3740. };
  3741. })();
  3742. OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes);
  3743. this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) {
  3744. var value;
  3745. if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) {
  3746. var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray;
  3747. value=toArraySupported ? arg.toArray() : arg || {};
  3748. }
  3749. else if (this.isDynamicType(param)) {
  3750. value=dynamicTypes[param].fromHost(arg);
  3751. }
  3752. else {
  3753. value=arg;
  3754. }
  3755. return value;
  3756. };
  3757. };
  3758. OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor);
  3759. OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [
  3760. {
  3761. type: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  3762. toHost: [
  3763. { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 },
  3764. { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 }
  3765. ]
  3766. },
  3767. {
  3768. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  3769. toHost: [
  3770. { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 }
  3771. ]
  3772. }
  3773. ]);
  3774. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  3775. type: OSF.DDA.PropertyDescriptors.AsyncResultStatus,
  3776. fromHost: [
  3777. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 },
  3778. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 }
  3779. ]
  3780. });
  3781. OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) {
  3782. function toArray(args) {
  3783. var arrArgs=args;
  3784. if (OSF.OUtil.isArray(args)) {
  3785. var len=arrArgs.length;
  3786. for (var i=0; i < len; i++) {
  3787. arrArgs[i]=toArray(arrArgs[i]);
  3788. }
  3789. }
  3790. else if (OSF.OUtil.isDate(args)) {
  3791. arrArgs=args.getVarDate();
  3792. }
  3793. else if (typeof args==="object" && !OSF.OUtil.isArray(args)) {
  3794. arrArgs=[];
  3795. for (var index in args) {
  3796. if (!OSF.OUtil.isFunction(args[index])) {
  3797. arrArgs[index]=toArray(args[index]);
  3798. }
  3799. }
  3800. }
  3801. return arrArgs;
  3802. }
  3803. function fromSafeArray(value) {
  3804. var ret=value;
  3805. if (value !=null && value.toArray) {
  3806. var arrayResult=value.toArray();
  3807. ret=new Array(arrayResult.length);
  3808. for (var i=0; i < arrayResult.length; i++) {
  3809. ret[i]=fromSafeArray(arrayResult[i]);
  3810. }
  3811. }
  3812. return ret;
  3813. }
  3814. try {
  3815. if (args.onCalling) {
  3816. args.onCalling();
  3817. }
  3818. var startTime=(new Date()).getTime();
  3819. OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs, resultCode) {
  3820. var result=hostResponseArgs.toArray();
  3821. var status=result[OSF.DDA.SafeArray.Response.Status];
  3822. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) {
  3823. var payload=result[OSF.DDA.SafeArray.Response.Payload];
  3824. payload=fromSafeArray(payload);
  3825. if (payload !=null) {
  3826. if (!args._chunkResultData) {
  3827. args._chunkResultData=new Array();
  3828. }
  3829. args._chunkResultData[payload[0]]=payload[1];
  3830. }
  3831. return false;
  3832. }
  3833. if (args.onReceiving) {
  3834. args.onReceiving();
  3835. }
  3836. if (args.onComplete) {
  3837. var payload;
  3838. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3839. if (result.length > 2) {
  3840. payload=[];
  3841. for (var i=1; i < result.length; i++)
  3842. payload[i - 1]=result[i];
  3843. }
  3844. else {
  3845. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3846. }
  3847. if (args._chunkResultData) {
  3848. payload=fromSafeArray(payload);
  3849. if (payload !=null) {
  3850. var expectedChunkCount=payload[payload.length - 1];
  3851. if (args._chunkResultData.length==expectedChunkCount) {
  3852. payload[payload.length - 1]=args._chunkResultData;
  3853. }
  3854. else {
  3855. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3856. }
  3857. }
  3858. }
  3859. }
  3860. else {
  3861. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3862. }
  3863. args.onComplete(status, payload);
  3864. }
  3865. if (OSF.AppTelemetry) {
  3866. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status);
  3867. }
  3868. return true;
  3869. });
  3870. }
  3871. catch (ex) {
  3872. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3873. }
  3874. };
  3875. OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) {
  3876. var startTime=(new Date()).getTime();
  3877. return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) {
  3878. if (args.onReceiving) {
  3879. args.onReceiving();
  3880. }
  3881. var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs;
  3882. if (args.onComplete) {
  3883. args.onComplete(status);
  3884. }
  3885. if (OSF.AppTelemetry) {
  3886. OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status);
  3887. }
  3888. };
  3889. };
  3890. OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) {
  3891. if (args.onCalling) {
  3892. args.onCalling();
  3893. }
  3894. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  3895. try {
  3896. OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  3897. if (args.onEvent) {
  3898. args.onEvent(payload);
  3899. }
  3900. if (OSF.AppTelemetry) {
  3901. OSF.AppTelemetry.onEventDone(args.dispId);
  3902. }
  3903. }, callback);
  3904. }
  3905. catch (ex) {
  3906. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3907. }
  3908. };
  3909. OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) {
  3910. if (args.onCalling) {
  3911. args.onCalling();
  3912. }
  3913. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  3914. try {
  3915. OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback);
  3916. }
  3917. catch (ex) {
  3918. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3919. }
  3920. };
  3921. OSF.ClientMode={
  3922. ReadWrite: 0,
  3923. ReadOnly: 1
  3924. };
  3925. OSF.DDA.RichInitializationReason={
  3926. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  3927. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  3928. };
  3929. OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) {
  3930. this._hostInfo=hostInfo;
  3931. this._webAppState=webAppState;
  3932. this._context=context;
  3933. this._settings=settings;
  3934. this._hostFacade=hostFacade;
  3935. this._initializeSettings=this.initializeSettings;
  3936. };
  3937. OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) {
  3938. var settings;
  3939. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  3940. if (osfSessionStorage) {
  3941. var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  3942. if (storageSettings) {
  3943. serializedSettings=JSON.parse(storageSettings);
  3944. }
  3945. else {
  3946. storageSettings=JSON.stringify(serializedSettings);
  3947. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  3948. }
  3949. }
  3950. var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  3951. if (refreshSupported) {
  3952. settings=new OSF.DDA.RefreshableSettings(deserializedSettings);
  3953. }
  3954. else {
  3955. settings=new OSF.DDA.Settings(deserializedSettings);
  3956. }
  3957. return settings;
  3958. };
  3959. OSF.InitializationHelper.prototype.saveAndSetDialogInfo=function OSF_InitializationHelper$saveAndSetDialogInfo(hostInfoValue) {
  3960. };
  3961. OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() {
  3962. };
  3963. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) {
  3964. this.prepareApiSurface(appContext);
  3965. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext));
  3966. };
  3967. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) {
  3968. var license=new OSF.DDA.License(appContext.get_eToken());
  3969. var getOfficeThemeHandler=(OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null;
  3970. if (appContext.get_isDialog()) {
  3971. if (OSF.DDA.UI.ChildUI) {
  3972. appContext.ui=new OSF.DDA.UI.ChildUI();
  3973. }
  3974. }
  3975. else {
  3976. if (OSF.DDA.UI.ParentUI) {
  3977. appContext.ui=new OSF.DDA.UI.ParentUI();
  3978. if (OfficeExt.Container) {
  3979. OSF.DDA.DispIdHost.addAsyncMethods(appContext.ui, [OSF.DDA.AsyncMethodNames.CloseContainerAsync]);
  3980. }
  3981. }
  3982. }
  3983. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler));
  3984. var getDelegateMethods, parameterMap;
  3985. getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods;
  3986. parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  3987. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap));
  3988. };
  3989. OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) { return OSF.DDA.RichInitializationReason[appContext.get_reason()]; };
  3990. OSF.DDA.DispIdHost.getClientDelegateMethods=function (actionId) {
  3991. var delegateMethods={};
  3992. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  3993. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  3994. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  3995. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog]=OSF.DDA.SafeArray.Delegate.openDialog;
  3996. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog]=OSF.DDA.SafeArray.Delegate.closeDialog;
  3997. delegateMethods[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.SafeArray.Delegate.messageParent;
  3998. if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id) {
  3999. var readSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  4000. return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving);
  4001. };
  4002. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings);
  4003. }
  4004. if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id) {
  4005. var writeSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  4006. return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving);
  4007. };
  4008. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings);
  4009. }
  4010. return delegateMethods;
  4011. };
  4012. var OfficeExt;
  4013. (function (OfficeExt) {
  4014. var MacRichClientHostController=(function () {
  4015. function MacRichClientHostController() {
  4016. }
  4017. MacRichClientHostController.prototype.execute=function (id, params, callback) {
  4018. setTimeout(function () {
  4019. window.external.Execute(id, params, callback);
  4020. }, 0);
  4021. };
  4022. MacRichClientHostController.prototype.registerEvent=function (id, targetId, handler, callback) {
  4023. setTimeout(function () {
  4024. window.external.RegisterEvent(id, targetId, handler, callback);
  4025. }, 0);
  4026. };
  4027. MacRichClientHostController.prototype.unregisterEvent=function (id, targetId, callback) {
  4028. setTimeout(function () {
  4029. window.external.UnregisterEvent(id, targetId, callback);
  4030. }, 0);
  4031. };
  4032. MacRichClientHostController.prototype.openDialog=function (id, targetId, handler, callback) {
  4033. var magicWord="action=displayDialog";
  4034. var fragmentSeparator='#';
  4035. var callArgs=JSON.parse(targetId);
  4036. var callUrl=callArgs.url;
  4037. if (!callUrl) {
  4038. return;
  4039. }
  4040. var urlParts=callUrl.split(fragmentSeparator);
  4041. var seperator="?";
  4042. if (urlParts[0].indexOf("?") > -1) {
  4043. seperator="&";
  4044. }
  4045. var width=screen.width * callArgs.width / 100;
  4046. var height=screen.height * callArgs.height / 100;
  4047. var params="width="+width+", height="+height;
  4048. urlParts[0]=urlParts[0].concat(seperator).concat(magicWord);
  4049. var openUrl=urlParts.join(fragmentSeparator);
  4050. MacRichClientHostController.popup=window.open(openUrl, "", params);
  4051. function receiveMessage(event) {
  4052. if (event.source==MacRichClientHostController.popup) {
  4053. try {
  4054. var messageObj=JSON.parse(event.data);
  4055. if (messageObj.dialogMessage) {
  4056. handler(id, [OSF.DialogMessageType.DialogMessageReceived, messageObj.dialogMessage.messageContent]);
  4057. }
  4058. }
  4059. catch (e) {
  4060. OsfMsAjaxFactory.msAjaxDebug.trace("messages received cannot be handlered. Message:"+event.data);
  4061. }
  4062. }
  4063. }
  4064. window.addEventListener("message", receiveMessage);
  4065. var interval;
  4066. function checkWindowClose() {
  4067. try {
  4068. if (MacRichClientHostController.popup==null || MacRichClientHostController.popup.closed) {
  4069. window.clearInterval(interval);
  4070. window.removeEventListener("message", receiveMessage);
  4071. handler(id, [OSF.DialogMessageType.DialogClosed]);
  4072. }
  4073. }
  4074. catch (e) {
  4075. OsfMsAjaxFactory.msAjaxDebug.trace("Error happened when popup window closed.");
  4076. }
  4077. }
  4078. interval=window.setInterval(checkWindowClose, 1000);
  4079. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  4080. };
  4081. MacRichClientHostController.prototype.messageParent=function (params) {
  4082. var message=params[Microsoft.Office.WebExtension.Parameters.MessageToParent];
  4083. var messageObj={ dialogMessage: { messageType: OSF.DialogMessageType.DialogMessageReceived, messageContent: message } };
  4084. window.opener.postMessage(JSON.stringify(messageObj), window.location.origin);
  4085. };
  4086. MacRichClientHostController.prototype.closeDialog=function (id, targetId, callback) {
  4087. if (MacRichClientHostController.popup) {
  4088. MacRichClientHostController.popup.close();
  4089. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  4090. }
  4091. else {
  4092. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  4093. }
  4094. };
  4095. return MacRichClientHostController;
  4096. })();
  4097. OfficeExt.MacRichClientHostController=MacRichClientHostController;
  4098. })(OfficeExt || (OfficeExt={}));
  4099. OSF.ClientHostController=new OfficeExt.MacRichClientHostController();
  4100. var OfficeExt;
  4101. (function (OfficeExt) {
  4102. var OfficeTheme;
  4103. (function (OfficeTheme) {
  4104. var OfficeThemeManager=(function () {
  4105. function OfficeThemeManager() {
  4106. this._osfOfficeTheme=null;
  4107. this._osfOfficeThemeTimeStamp=null;
  4108. }
  4109. OfficeThemeManager.prototype.getOfficeTheme=function () {
  4110. if (OSF.DDA._OsfControlContext) {
  4111. if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) {
  4112. if (OSF.AppTelemetry) {
  4113. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0);
  4114. }
  4115. }
  4116. else {
  4117. var startTime=(new Date()).getTime();
  4118. var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo();
  4119. var endTime=(new Date()).getTime();
  4120. if (OSF.AppTelemetry) {
  4121. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", Math.abs(endTime - startTime));
  4122. }
  4123. this._osfOfficeTheme=JSON.parse(osfOfficeTheme);
  4124. for (var color in this._osfOfficeTheme) {
  4125. this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]);
  4126. }
  4127. this._osfOfficeThemeTimeStamp=endTime;
  4128. }
  4129. return this._osfOfficeTheme;
  4130. }
  4131. };
  4132. OfficeThemeManager.instance=function () {
  4133. if (OfficeThemeManager._instance==null) {
  4134. OfficeThemeManager._instance=new OfficeThemeManager();
  4135. }
  4136. return OfficeThemeManager._instance;
  4137. };
  4138. OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5000;
  4139. OfficeThemeManager._instance=null;
  4140. return OfficeThemeManager;
  4141. })();
  4142. OfficeTheme.OfficeThemeManager=OfficeThemeManager;
  4143. OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA);
  4144. OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme;
  4145. })(OfficeTheme=OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={}));
  4146. })(OfficeExt || (OfficeExt={}));
  4147. OSF.DDA.ClientSettingsManager={
  4148. getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) {
  4149. return function (args) {
  4150. var status, response;
  4151. try {
  4152. response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving);
  4153. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  4154. }
  4155. catch (ex) {
  4156. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4157. response={ name: Strings.OfficeOM.L_InternalError, message: ex };
  4158. }
  4159. if (args.onComplete) {
  4160. args.onComplete(status, response);
  4161. }
  4162. };
  4163. },
  4164. read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) {
  4165. var keys=[];
  4166. var values=[];
  4167. if (onCalling) {
  4168. onCalling();
  4169. }
  4170. OSF.DDA._OsfControlContext.GetSettings().Read(keys, values);
  4171. if (onReceiving) {
  4172. onReceiving();
  4173. }
  4174. var serializedSettings={};
  4175. for (var index=0; index < keys.length; index++) {
  4176. serializedSettings[keys[index]]=values[index];
  4177. }
  4178. return serializedSettings;
  4179. },
  4180. write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) {
  4181. var keys=[];
  4182. var values=[];
  4183. for (var key in serializedSettings) {
  4184. keys.push(key);
  4185. values.push(serializedSettings[key]);
  4186. }
  4187. if (onCalling) {
  4188. onCalling();
  4189. }
  4190. OSF.DDA._OsfControlContext.GetSettings().Write(keys, values);
  4191. if (onReceiving) {
  4192. onReceiving();
  4193. }
  4194. }
  4195. };
  4196. OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(refreshSupported) {
  4197. var serializedSettings=OSF.DDA.ClientSettingsManager.read();
  4198. var settings=this.deserializeSettings(serializedSettings, refreshSupported);
  4199. return settings;
  4200. };
  4201. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) {
  4202. var returnedContext;
  4203. var context;
  4204. var warningText="Warning: Office.js is loaded outside of Office client";
  4205. try {
  4206. if (window.external && typeof window.external.GetContext !=='undefined') {
  4207. context=OSF.DDA._OsfControlContext=window.external.GetContext();
  4208. }
  4209. else {
  4210. OsfMsAjaxFactory.msAjaxDebug.trace(warningText);
  4211. return;
  4212. }
  4213. }
  4214. catch (e) {
  4215. OsfMsAjaxFactory.msAjaxDebug.trace(warningText);
  4216. return;
  4217. }
  4218. var appType=context.GetAppType();
  4219. var id=context.GetSolutionRef();
  4220. var version=context.GetAppVersionMajor();
  4221. var minorVersion=context.GetAppVersionMinor();
  4222. var UILocale=context.GetAppUILocale();
  4223. var dataLocale=context.GetAppDataLocale();
  4224. var docUrl=context.GetDocUrl();
  4225. var clientMode=context.GetAppCapabilities();
  4226. var reason=context.GetActivationMode();
  4227. var osfControlType=context.GetControlIntegrationLevel();
  4228. var settings=[];
  4229. var eToken;
  4230. try {
  4231. eToken=context.GetSolutionToken();
  4232. }
  4233. catch (ex) {
  4234. }
  4235. var correlationId;
  4236. if (typeof context.GetCorrelationId !=="undefined") {
  4237. correlationId=context.GetCorrelationId();
  4238. }
  4239. var appInstanceId;
  4240. if (typeof context.GetInstanceId !=="undefined") {
  4241. appInstanceId=context.GetInstanceId();
  4242. }
  4243. var touchEnabled;
  4244. if (typeof context.GetTouchEnabled !=="undefined") {
  4245. touchEnabled=context.GetTouchEnabled();
  4246. }
  4247. var commerceAllowed;
  4248. if (typeof context.GetCommerceAllowed !=="undefined") {
  4249. commerceAllowed=context.GetCommerceAllowed();
  4250. }
  4251. var requirementMatrix;
  4252. if (typeof context.GetSupportedMatrix !=="undefined") {
  4253. requirementMatrix=context.GetSupportedMatrix();
  4254. }
  4255. var hostCustomMessage;
  4256. if (typeof context.GetHostCustomMessage !=="undefined") {
  4257. hostCustomMessage=context.GetHostCustomMessage();
  4258. }
  4259. var hostFullVersion;
  4260. if (typeof context.GetHostFullVersion !=="undefined") {
  4261. hostFullVersion=context.GetHostFullVersion();
  4262. }
  4263. var dialogRequirementMatrix;
  4264. if (typeof context.GetDialogRequirementMatrix !="undefined") {
  4265. dialogRequirementMatrix=context.GetDialogRequirementMatrix();
  4266. }
  4267. eToken=eToken ? eToken.toString() : "";
  4268. returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix, hostCustomMessage, hostFullVersion, undefined, undefined, undefined, dialogRequirementMatrix);
  4269. if (OSF.AppTelemetry) {
  4270. OSF.AppTelemetry.initialize(returnedContext);
  4271. }
  4272. gotAppContext(returnedContext);
  4273. };
  4274. var OSFLog;
  4275. (function (OSFLog) {
  4276. var BaseUsageData=(function () {
  4277. function BaseUsageData(table) {
  4278. this._table=table;
  4279. this._fields={};
  4280. }
  4281. Object.defineProperty(BaseUsageData.prototype, "Fields", {
  4282. get: function () {
  4283. return this._fields;
  4284. },
  4285. enumerable: true,
  4286. configurable: true
  4287. });
  4288. Object.defineProperty(BaseUsageData.prototype, "Table", {
  4289. get: function () {
  4290. return this._table;
  4291. },
  4292. enumerable: true,
  4293. configurable: true
  4294. });
  4295. BaseUsageData.prototype.SerializeFields=function () {
  4296. };
  4297. BaseUsageData.prototype.SetSerializedField=function (key, value) {
  4298. if (typeof (value) !=="undefined" && value !==null) {
  4299. this._serializedFields[key]=value.toString();
  4300. }
  4301. };
  4302. BaseUsageData.prototype.SerializeRow=function () {
  4303. this._serializedFields={};
  4304. this.SetSerializedField("Table", this._table);
  4305. this.SerializeFields();
  4306. return JSON.stringify(this._serializedFields);
  4307. };
  4308. return BaseUsageData;
  4309. })();
  4310. OSFLog.BaseUsageData=BaseUsageData;
  4311. var AppActivatedUsageData=(function (_super) {
  4312. __extends(AppActivatedUsageData, _super);
  4313. function AppActivatedUsageData() {
  4314. _super.call(this, "AppActivated");
  4315. }
  4316. Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", {
  4317. get: function () { return this.Fields["CorrelationId"]; },
  4318. set: function (value) { this.Fields["CorrelationId"]=value; },
  4319. enumerable: true,
  4320. configurable: true
  4321. });
  4322. Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", {
  4323. get: function () { return this.Fields["SessionId"]; },
  4324. set: function (value) { this.Fields["SessionId"]=value; },
  4325. enumerable: true,
  4326. configurable: true
  4327. });
  4328. Object.defineProperty(AppActivatedUsageData.prototype, "AppId", {
  4329. get: function () { return this.Fields["AppId"]; },
  4330. set: function (value) { this.Fields["AppId"]=value; },
  4331. enumerable: true,
  4332. configurable: true
  4333. });
  4334. Object.defineProperty(AppActivatedUsageData.prototype, "AppInstanceId", {
  4335. get: function () { return this.Fields["AppInstanceId"]; },
  4336. set: function (value) { this.Fields["AppInstanceId"]=value; },
  4337. enumerable: true,
  4338. configurable: true
  4339. });
  4340. Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", {
  4341. get: function () { return this.Fields["AppURL"]; },
  4342. set: function (value) { this.Fields["AppURL"]=value; },
  4343. enumerable: true,
  4344. configurable: true
  4345. });
  4346. Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", {
  4347. get: function () { return this.Fields["AssetId"]; },
  4348. set: function (value) { this.Fields["AssetId"]=value; },
  4349. enumerable: true,
  4350. configurable: true
  4351. });
  4352. Object.defineProperty(AppActivatedUsageData.prototype, "Browser", {
  4353. get: function () { return this.Fields["Browser"]; },
  4354. set: function (value) { this.Fields["Browser"]=value; },
  4355. enumerable: true,
  4356. configurable: true
  4357. });
  4358. Object.defineProperty(AppActivatedUsageData.prototype, "UserId", {
  4359. get: function () { return this.Fields["UserId"]; },
  4360. set: function (value) { this.Fields["UserId"]=value; },
  4361. enumerable: true,
  4362. configurable: true
  4363. });
  4364. Object.defineProperty(AppActivatedUsageData.prototype, "Host", {
  4365. get: function () { return this.Fields["Host"]; },
  4366. set: function (value) { this.Fields["Host"]=value; },
  4367. enumerable: true,
  4368. configurable: true
  4369. });
  4370. Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", {
  4371. get: function () { return this.Fields["HostVersion"]; },
  4372. set: function (value) { this.Fields["HostVersion"]=value; },
  4373. enumerable: true,
  4374. configurable: true
  4375. });
  4376. Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", {
  4377. get: function () { return this.Fields["ClientId"]; },
  4378. set: function (value) { this.Fields["ClientId"]=value; },
  4379. enumerable: true,
  4380. configurable: true
  4381. });
  4382. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", {
  4383. get: function () { return this.Fields["AppSizeWidth"]; },
  4384. set: function (value) { this.Fields["AppSizeWidth"]=value; },
  4385. enumerable: true,
  4386. configurable: true
  4387. });
  4388. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", {
  4389. get: function () { return this.Fields["AppSizeHeight"]; },
  4390. set: function (value) { this.Fields["AppSizeHeight"]=value; },
  4391. enumerable: true,
  4392. configurable: true
  4393. });
  4394. Object.defineProperty(AppActivatedUsageData.prototype, "Message", {
  4395. get: function () { return this.Fields["Message"]; },
  4396. set: function (value) { this.Fields["Message"]=value; },
  4397. enumerable: true,
  4398. configurable: true
  4399. });
  4400. Object.defineProperty(AppActivatedUsageData.prototype, "DocUrl", {
  4401. get: function () { return this.Fields["DocUrl"]; },
  4402. set: function (value) { this.Fields["DocUrl"]=value; },
  4403. enumerable: true,
  4404. configurable: true
  4405. });
  4406. Object.defineProperty(AppActivatedUsageData.prototype, "OfficeJSVersion", {
  4407. get: function () { return this.Fields["OfficeJSVersion"]; },
  4408. set: function (value) { this.Fields["OfficeJSVersion"]=value; },
  4409. enumerable: true,
  4410. configurable: true
  4411. });
  4412. Object.defineProperty(AppActivatedUsageData.prototype, "HostJSVersion", {
  4413. get: function () { return this.Fields["HostJSVersion"]; },
  4414. set: function (value) { this.Fields["HostJSVersion"]=value; },
  4415. enumerable: true,
  4416. configurable: true
  4417. });
  4418. AppActivatedUsageData.prototype.SerializeFields=function () {
  4419. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4420. this.SetSerializedField("SessionId", this.SessionId);
  4421. this.SetSerializedField("AppId", this.AppId);
  4422. this.SetSerializedField("AppInstanceId", this.AppInstanceId);
  4423. this.SetSerializedField("AppURL", this.AppURL);
  4424. this.SetSerializedField("AssetId", this.AssetId);
  4425. this.SetSerializedField("Browser", this.Browser);
  4426. this.SetSerializedField("UserId", this.UserId);
  4427. this.SetSerializedField("Host", this.Host);
  4428. this.SetSerializedField("HostVersion", this.HostVersion);
  4429. this.SetSerializedField("ClientId", this.ClientId);
  4430. this.SetSerializedField("AppSizeWidth", this.AppSizeWidth);
  4431. this.SetSerializedField("AppSizeHeight", this.AppSizeHeight);
  4432. this.SetSerializedField("Message", this.Message);
  4433. this.SetSerializedField("DocUrl", this.DocUrl);
  4434. this.SetSerializedField("OfficeJSVersion", this.OfficeJSVersion);
  4435. this.SetSerializedField("HostJSVersion", this.HostJSVersion);
  4436. };
  4437. return AppActivatedUsageData;
  4438. })(BaseUsageData);
  4439. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  4440. var ScriptLoadUsageData=(function (_super) {
  4441. __extends(ScriptLoadUsageData, _super);
  4442. function ScriptLoadUsageData() {
  4443. _super.call(this, "ScriptLoad");
  4444. }
  4445. Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", {
  4446. get: function () { return this.Fields["CorrelationId"]; },
  4447. set: function (value) { this.Fields["CorrelationId"]=value; },
  4448. enumerable: true,
  4449. configurable: true
  4450. });
  4451. Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", {
  4452. get: function () { return this.Fields["SessionId"]; },
  4453. set: function (value) { this.Fields["SessionId"]=value; },
  4454. enumerable: true,
  4455. configurable: true
  4456. });
  4457. Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", {
  4458. get: function () { return this.Fields["ScriptId"]; },
  4459. set: function (value) { this.Fields["ScriptId"]=value; },
  4460. enumerable: true,
  4461. configurable: true
  4462. });
  4463. Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", {
  4464. get: function () { return this.Fields["StartTime"]; },
  4465. set: function (value) { this.Fields["StartTime"]=value; },
  4466. enumerable: true,
  4467. configurable: true
  4468. });
  4469. Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", {
  4470. get: function () { return this.Fields["ResponseTime"]; },
  4471. set: function (value) { this.Fields["ResponseTime"]=value; },
  4472. enumerable: true,
  4473. configurable: true
  4474. });
  4475. ScriptLoadUsageData.prototype.SerializeFields=function () {
  4476. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4477. this.SetSerializedField("SessionId", this.SessionId);
  4478. this.SetSerializedField("ScriptId", this.ScriptId);
  4479. this.SetSerializedField("StartTime", this.StartTime);
  4480. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4481. };
  4482. return ScriptLoadUsageData;
  4483. })(BaseUsageData);
  4484. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  4485. var AppClosedUsageData=(function (_super) {
  4486. __extends(AppClosedUsageData, _super);
  4487. function AppClosedUsageData() {
  4488. _super.call(this, "AppClosed");
  4489. }
  4490. Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", {
  4491. get: function () { return this.Fields["CorrelationId"]; },
  4492. set: function (value) { this.Fields["CorrelationId"]=value; },
  4493. enumerable: true,
  4494. configurable: true
  4495. });
  4496. Object.defineProperty(AppClosedUsageData.prototype, "SessionId", {
  4497. get: function () { return this.Fields["SessionId"]; },
  4498. set: function (value) { this.Fields["SessionId"]=value; },
  4499. enumerable: true,
  4500. configurable: true
  4501. });
  4502. Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", {
  4503. get: function () { return this.Fields["FocusTime"]; },
  4504. set: function (value) { this.Fields["FocusTime"]=value; },
  4505. enumerable: true,
  4506. configurable: true
  4507. });
  4508. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", {
  4509. get: function () { return this.Fields["AppSizeFinalWidth"]; },
  4510. set: function (value) { this.Fields["AppSizeFinalWidth"]=value; },
  4511. enumerable: true,
  4512. configurable: true
  4513. });
  4514. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", {
  4515. get: function () { return this.Fields["AppSizeFinalHeight"]; },
  4516. set: function (value) { this.Fields["AppSizeFinalHeight"]=value; },
  4517. enumerable: true,
  4518. configurable: true
  4519. });
  4520. Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", {
  4521. get: function () { return this.Fields["OpenTime"]; },
  4522. set: function (value) { this.Fields["OpenTime"]=value; },
  4523. enumerable: true,
  4524. configurable: true
  4525. });
  4526. Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", {
  4527. get: function () { return this.Fields["CloseMethod"]; },
  4528. set: function (value) { this.Fields["CloseMethod"]=value; },
  4529. enumerable: true,
  4530. configurable: true
  4531. });
  4532. AppClosedUsageData.prototype.SerializeFields=function () {
  4533. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4534. this.SetSerializedField("SessionId", this.SessionId);
  4535. this.SetSerializedField("FocusTime", this.FocusTime);
  4536. this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth);
  4537. this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight);
  4538. this.SetSerializedField("OpenTime", this.OpenTime);
  4539. this.SetSerializedField("CloseMethod", this.CloseMethod);
  4540. };
  4541. return AppClosedUsageData;
  4542. })(BaseUsageData);
  4543. OSFLog.AppClosedUsageData=AppClosedUsageData;
  4544. var APIUsageUsageData=(function (_super) {
  4545. __extends(APIUsageUsageData, _super);
  4546. function APIUsageUsageData() {
  4547. _super.call(this, "APIUsage");
  4548. }
  4549. Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", {
  4550. get: function () { return this.Fields["CorrelationId"]; },
  4551. set: function (value) { this.Fields["CorrelationId"]=value; },
  4552. enumerable: true,
  4553. configurable: true
  4554. });
  4555. Object.defineProperty(APIUsageUsageData.prototype, "SessionId", {
  4556. get: function () { return this.Fields["SessionId"]; },
  4557. set: function (value) { this.Fields["SessionId"]=value; },
  4558. enumerable: true,
  4559. configurable: true
  4560. });
  4561. Object.defineProperty(APIUsageUsageData.prototype, "APIType", {
  4562. get: function () { return this.Fields["APIType"]; },
  4563. set: function (value) { this.Fields["APIType"]=value; },
  4564. enumerable: true,
  4565. configurable: true
  4566. });
  4567. Object.defineProperty(APIUsageUsageData.prototype, "APIID", {
  4568. get: function () { return this.Fields["APIID"]; },
  4569. set: function (value) { this.Fields["APIID"]=value; },
  4570. enumerable: true,
  4571. configurable: true
  4572. });
  4573. Object.defineProperty(APIUsageUsageData.prototype, "Parameters", {
  4574. get: function () { return this.Fields["Parameters"]; },
  4575. set: function (value) { this.Fields["Parameters"]=value; },
  4576. enumerable: true,
  4577. configurable: true
  4578. });
  4579. Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", {
  4580. get: function () { return this.Fields["ResponseTime"]; },
  4581. set: function (value) { this.Fields["ResponseTime"]=value; },
  4582. enumerable: true,
  4583. configurable: true
  4584. });
  4585. Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", {
  4586. get: function () { return this.Fields["ErrorType"]; },
  4587. set: function (value) { this.Fields["ErrorType"]=value; },
  4588. enumerable: true,
  4589. configurable: true
  4590. });
  4591. APIUsageUsageData.prototype.SerializeFields=function () {
  4592. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4593. this.SetSerializedField("SessionId", this.SessionId);
  4594. this.SetSerializedField("APIType", this.APIType);
  4595. this.SetSerializedField("APIID", this.APIID);
  4596. this.SetSerializedField("Parameters", this.Parameters);
  4597. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4598. this.SetSerializedField("ErrorType", this.ErrorType);
  4599. };
  4600. return APIUsageUsageData;
  4601. })(BaseUsageData);
  4602. OSFLog.APIUsageUsageData=APIUsageUsageData;
  4603. var AppInitializationUsageData=(function (_super) {
  4604. __extends(AppInitializationUsageData, _super);
  4605. function AppInitializationUsageData() {
  4606. _super.call(this, "AppInitialization");
  4607. }
  4608. Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", {
  4609. get: function () { return this.Fields["CorrelationId"]; },
  4610. set: function (value) { this.Fields["CorrelationId"]=value; },
  4611. enumerable: true,
  4612. configurable: true
  4613. });
  4614. Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", {
  4615. get: function () { return this.Fields["SessionId"]; },
  4616. set: function (value) { this.Fields["SessionId"]=value; },
  4617. enumerable: true,
  4618. configurable: true
  4619. });
  4620. Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", {
  4621. get: function () { return this.Fields["SuccessCode"]; },
  4622. set: function (value) { this.Fields["SuccessCode"]=value; },
  4623. enumerable: true,
  4624. configurable: true
  4625. });
  4626. Object.defineProperty(AppInitializationUsageData.prototype, "Message", {
  4627. get: function () { return this.Fields["Message"]; },
  4628. set: function (value) { this.Fields["Message"]=value; },
  4629. enumerable: true,
  4630. configurable: true
  4631. });
  4632. AppInitializationUsageData.prototype.SerializeFields=function () {
  4633. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4634. this.SetSerializedField("SessionId", this.SessionId);
  4635. this.SetSerializedField("SuccessCode", this.SuccessCode);
  4636. this.SetSerializedField("Message", this.Message);
  4637. };
  4638. return AppInitializationUsageData;
  4639. })(BaseUsageData);
  4640. OSFLog.AppInitializationUsageData=AppInitializationUsageData;
  4641. })(OSFLog || (OSFLog={}));
  4642. var Logger;
  4643. (function (Logger) {
  4644. "use strict";
  4645. (function (TraceLevel) {
  4646. TraceLevel[TraceLevel["info"]=0]="info";
  4647. TraceLevel[TraceLevel["warning"]=1]="warning";
  4648. TraceLevel[TraceLevel["error"]=2]="error";
  4649. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  4650. var TraceLevel=Logger.TraceLevel;
  4651. (function (SendFlag) {
  4652. SendFlag[SendFlag["none"]=0]="none";
  4653. SendFlag[SendFlag["flush"]=1]="flush";
  4654. })(Logger.SendFlag || (Logger.SendFlag={}));
  4655. var SendFlag=Logger.SendFlag;
  4656. function allowUploadingData() {
  4657. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4658. OSF.Logger.ulsEndpoint.loadProxyFrame();
  4659. }
  4660. }
  4661. Logger.allowUploadingData=allowUploadingData;
  4662. function sendLog(traceLevel, message, flag) {
  4663. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4664. var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true };
  4665. var logs=JSON.stringify(jsonObj);
  4666. OSF.Logger.ulsEndpoint.writeLog(logs);
  4667. }
  4668. }
  4669. Logger.sendLog=sendLog;
  4670. function creatULSEndpoint() {
  4671. try {
  4672. return new ULSEndpointProxy();
  4673. }
  4674. catch (e) {
  4675. return null;
  4676. }
  4677. }
  4678. var ULSEndpointProxy=(function () {
  4679. function ULSEndpointProxy() {
  4680. var _this=this;
  4681. this.proxyFrame=null;
  4682. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  4683. this.buffer=[];
  4684. this.proxyFrameReady=false;
  4685. OSF.OUtil.addEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4686. setTimeout(function () {
  4687. _this.loadProxyFrame();
  4688. }, 3000);
  4689. }
  4690. ULSEndpointProxy.prototype.writeLog=function (log) {
  4691. if (this.proxyFrameReady===true) {
  4692. this.proxyFrame.contentWindow.postMessage(log, ULSEndpointProxy.telemetryOrigin);
  4693. }
  4694. else {
  4695. if (this.buffer.length < 128) {
  4696. this.buffer.push(log);
  4697. }
  4698. }
  4699. };
  4700. ULSEndpointProxy.prototype.loadProxyFrame=function () {
  4701. if (this.proxyFrame==null) {
  4702. this.proxyFrame=document.createElement("iframe");
  4703. this.proxyFrame.setAttribute("style", "display:none");
  4704. this.proxyFrame.setAttribute("src", this.telemetryEndPoint);
  4705. document.head.appendChild(this.proxyFrame);
  4706. }
  4707. };
  4708. ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) {
  4709. var _this=this;
  4710. if (e.data==="ProxyFrameReadyToLog") {
  4711. this.proxyFrameReady=true;
  4712. for (var i=0; i < this.buffer.length; i++) {
  4713. this.writeLog(this.buffer[i]);
  4714. }
  4715. this.buffer.length=0;
  4716. OSF.OUtil.removeEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4717. }
  4718. else if (e.data==="ProxyFrameReadyToInit") {
  4719. var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() };
  4720. var initStr=JSON.stringify(initJson);
  4721. this.proxyFrame.contentWindow.postMessage(initStr, ULSEndpointProxy.telemetryOrigin);
  4722. }
  4723. };
  4724. ULSEndpointProxy.telemetryOrigin="https://telemetryservice.firstpartyapps.oaspapps.com";
  4725. return ULSEndpointProxy;
  4726. })();
  4727. if (!OSF.Logger) {
  4728. OSF.Logger=Logger;
  4729. }
  4730. Logger.ulsEndpoint=creatULSEndpoint();
  4731. })(Logger || (Logger={}));
  4732. var OSFAppTelemetry;
  4733. (function (OSFAppTelemetry) {
  4734. "use strict";
  4735. var appInfo;
  4736. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  4737. var osfControlAppCorrelationId="";
  4738. var omexDomainRegex=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/", "i");
  4739. ;
  4740. var AppInfo=(function () {
  4741. function AppInfo() {
  4742. }
  4743. return AppInfo;
  4744. })();
  4745. var Event=(function () {
  4746. function Event(name, handler) {
  4747. this.name=name;
  4748. this.handler=handler;
  4749. }
  4750. return Event;
  4751. })();
  4752. var AppStorage=(function () {
  4753. function AppStorage() {
  4754. this.clientIDKey="Office API client";
  4755. this.logIdSetKey="Office App Log Id Set";
  4756. }
  4757. AppStorage.prototype.getClientId=function () {
  4758. var clientId=this.getValue(this.clientIDKey);
  4759. if (!clientId || clientId.length <=0 || clientId.length > 40) {
  4760. clientId=OSF.OUtil.Guid.generateNewGuid();
  4761. this.setValue(this.clientIDKey, clientId);
  4762. }
  4763. return clientId;
  4764. };
  4765. AppStorage.prototype.saveLog=function (logId, log) {
  4766. var logIdSet=this.getValue(this.logIdSetKey);
  4767. logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId;
  4768. this.setValue(this.logIdSetKey, logIdSet);
  4769. this.setValue(logId, log);
  4770. };
  4771. AppStorage.prototype.enumerateLog=function (callback, clean) {
  4772. var logIdSet=this.getValue(this.logIdSetKey);
  4773. if (logIdSet) {
  4774. var ids=logIdSet.split(";");
  4775. for (var id in ids) {
  4776. var logId=ids[id];
  4777. var log=this.getValue(logId);
  4778. if (log) {
  4779. if (callback) {
  4780. callback(logId, log);
  4781. }
  4782. if (clean) {
  4783. this.remove(logId);
  4784. }
  4785. }
  4786. }
  4787. if (clean) {
  4788. this.remove(this.logIdSetKey);
  4789. }
  4790. }
  4791. };
  4792. AppStorage.prototype.getValue=function (key) {
  4793. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  4794. var value="";
  4795. if (osfLocalStorage) {
  4796. value=osfLocalStorage.getItem(key);
  4797. }
  4798. return value;
  4799. };
  4800. AppStorage.prototype.setValue=function (key, value) {
  4801. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  4802. if (osfLocalStorage) {
  4803. osfLocalStorage.setItem(key, value);
  4804. }
  4805. };
  4806. AppStorage.prototype.remove=function (key) {
  4807. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  4808. if (osfLocalStorage) {
  4809. try {
  4810. osfLocalStorage.removeItem(key);
  4811. }
  4812. catch (ex) {
  4813. }
  4814. }
  4815. };
  4816. return AppStorage;
  4817. })();
  4818. var AppLogger=(function () {
  4819. function AppLogger() {
  4820. }
  4821. AppLogger.prototype.LogData=function (data) {
  4822. if (!OSF.Logger) {
  4823. return;
  4824. }
  4825. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none);
  4826. };
  4827. AppLogger.prototype.LogRawData=function (log) {
  4828. if (!OSF.Logger) {
  4829. return;
  4830. }
  4831. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none);
  4832. };
  4833. return AppLogger;
  4834. })();
  4835. function initialize(context) {
  4836. if (!OSF.Logger) {
  4837. return;
  4838. }
  4839. if (appInfo) {
  4840. return;
  4841. }
  4842. appInfo=new AppInfo();
  4843. if (context.get_hostFullVersion()) {
  4844. appInfo.hostVersion=context.get_hostFullVersion();
  4845. }
  4846. else {
  4847. appInfo.hostVersion=context.get_appVersion();
  4848. }
  4849. appInfo.appId=context.get_id();
  4850. appInfo.host=context.get_appName();
  4851. appInfo.browser=window.navigator.userAgent;
  4852. appInfo.correlationId=context.get_correlationId();
  4853. appInfo.clientId=(new AppStorage()).getClientId();
  4854. appInfo.appInstanceId=context.get_appInstanceId();
  4855. if (appInfo.appInstanceId) {
  4856. appInfo.appInstanceId=appInfo.appInstanceId.replace(/[{}]/g, "").toLowerCase();
  4857. }
  4858. appInfo.message=context.get_hostCustomMessage();
  4859. appInfo.officeJSVersion=OSF.ConstantNames.FileVersion;
  4860. appInfo.hostJSVersion="16.0.7526.1000";
  4861. var docUrl=context.get_docUrl();
  4862. appInfo.docUrl=omexDomainRegex.test(docUrl) ? docUrl : "";
  4863. var url=location.href;
  4864. if (url) {
  4865. url=url.split("?")[0].split("#")[0];
  4866. }
  4867. appInfo.appURL=url;
  4868. (function getUserIdAndAssetIdFromToken(token, appInfo) {
  4869. var xmlContent;
  4870. var parser;
  4871. var xmlDoc;
  4872. appInfo.assetId="";
  4873. appInfo.userId="";
  4874. try {
  4875. xmlContent=decodeURIComponent(token);
  4876. parser=new DOMParser();
  4877. xmlDoc=parser.parseFromString(xmlContent, "text/xml");
  4878. var cidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid");
  4879. var oidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("oid");
  4880. if (cidNode && cidNode.nodeValue) {
  4881. appInfo.userId=cidNode.nodeValue;
  4882. }
  4883. else if (oidNode && oidNode.nodeValue) {
  4884. appInfo.userId=oidNode.nodeValue;
  4885. }
  4886. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue;
  4887. }
  4888. catch (e) {
  4889. }
  4890. finally {
  4891. xmlContent=null;
  4892. xmlDoc=null;
  4893. parser=null;
  4894. }
  4895. })(context.get_eToken(), appInfo);
  4896. (function handleLifecycle() {
  4897. var startTime=new Date();
  4898. var lastFocus=null;
  4899. var focusTime=0;
  4900. var finished=false;
  4901. var adjustFocusTime=function () {
  4902. if (document.hasFocus()) {
  4903. if (lastFocus==null) {
  4904. lastFocus=new Date();
  4905. }
  4906. }
  4907. else if (lastFocus) {
  4908. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  4909. lastFocus=null;
  4910. }
  4911. };
  4912. var eventList=[];
  4913. eventList.push(new Event("focus", adjustFocusTime));
  4914. eventList.push(new Event("blur", adjustFocusTime));
  4915. eventList.push(new Event("focusout", adjustFocusTime));
  4916. eventList.push(new Event("focusin", adjustFocusTime));
  4917. var exitFunction=function () {
  4918. for (var i=0; i < eventList.length; i++) {
  4919. OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler);
  4920. }
  4921. eventList.length=0;
  4922. if (!finished) {
  4923. if (document.hasFocus() && lastFocus) {
  4924. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  4925. lastFocus=null;
  4926. }
  4927. OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime);
  4928. finished=true;
  4929. }
  4930. };
  4931. eventList.push(new Event("beforeunload", exitFunction));
  4932. eventList.push(new Event("unload", exitFunction));
  4933. for (var i=0; i < eventList.length; i++) {
  4934. OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler);
  4935. }
  4936. adjustFocusTime();
  4937. })();
  4938. OSFAppTelemetry.onAppActivated();
  4939. }
  4940. OSFAppTelemetry.initialize=initialize;
  4941. function onAppActivated() {
  4942. if (!appInfo) {
  4943. return;
  4944. }
  4945. (new AppStorage()).enumerateLog(function (id, log) { return (new AppLogger()).LogRawData(log); }, true);
  4946. var data=new OSFLog.AppActivatedUsageData();
  4947. data.SessionId=sessionId;
  4948. data.AppId=appInfo.appId;
  4949. data.AssetId=appInfo.assetId;
  4950. data.AppURL=appInfo.appURL;
  4951. data.UserId=appInfo.userId;
  4952. data.ClientId=appInfo.clientId;
  4953. data.Browser=appInfo.browser;
  4954. data.Host=appInfo.host;
  4955. data.HostVersion=appInfo.hostVersion;
  4956. data.CorrelationId=appInfo.correlationId;
  4957. data.AppSizeWidth=window.innerWidth;
  4958. data.AppSizeHeight=window.innerHeight;
  4959. data.AppInstanceId=appInfo.appInstanceId;
  4960. data.Message=appInfo.message;
  4961. data.DocUrl=appInfo.docUrl;
  4962. data.OfficeJSVersion=appInfo.officeJSVersion;
  4963. data.HostJSVersion=appInfo.hostJSVersion;
  4964. (new AppLogger()).LogData(data);
  4965. setTimeout(function () {
  4966. if (!OSF.Logger) {
  4967. return;
  4968. }
  4969. OSF.Logger.allowUploadingData();
  4970. }, 100);
  4971. }
  4972. OSFAppTelemetry.onAppActivated=onAppActivated;
  4973. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) {
  4974. var data=new OSFLog.ScriptLoadUsageData();
  4975. data.CorrelationId=appCorrelationId;
  4976. data.SessionId=sessionId;
  4977. data.ScriptId=scriptId;
  4978. data.StartTime=msStartTime;
  4979. data.ResponseTime=msResponseTime;
  4980. (new AppLogger()).LogData(data);
  4981. }
  4982. OSFAppTelemetry.onScriptDone=onScriptDone;
  4983. function onCallDone(apiType, id, parameters, msResponseTime, errorType) {
  4984. if (!appInfo) {
  4985. return;
  4986. }
  4987. var data=new OSFLog.APIUsageUsageData();
  4988. data.CorrelationId=osfControlAppCorrelationId;
  4989. data.SessionId=sessionId;
  4990. data.APIType=apiType;
  4991. data.APIID=id;
  4992. data.Parameters=parameters;
  4993. data.ResponseTime=msResponseTime;
  4994. data.ErrorType=errorType;
  4995. (new AppLogger()).LogData(data);
  4996. }
  4997. OSFAppTelemetry.onCallDone=onCallDone;
  4998. ;
  4999. function onMethodDone(id, args, msResponseTime, errorType) {
  5000. var parameters=null;
  5001. if (args) {
  5002. if (typeof args=="number") {
  5003. parameters=String(args);
  5004. }
  5005. else if (typeof args==="object") {
  5006. for (var index in args) {
  5007. if (parameters !==null) {
  5008. parameters+=",";
  5009. }
  5010. else {
  5011. parameters="";
  5012. }
  5013. if (typeof args[index]=="number") {
  5014. parameters+=String(args[index]);
  5015. }
  5016. }
  5017. }
  5018. else {
  5019. parameters="";
  5020. }
  5021. }
  5022. OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType);
  5023. }
  5024. OSFAppTelemetry.onMethodDone=onMethodDone;
  5025. function onPropertyDone(propertyName, msResponseTime) {
  5026. OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime);
  5027. }
  5028. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  5029. function onEventDone(id, errorType) {
  5030. OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType);
  5031. }
  5032. OSFAppTelemetry.onEventDone=onEventDone;
  5033. function onRegisterDone(register, id, msResponseTime, errorType) {
  5034. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType);
  5035. }
  5036. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  5037. function onAppClosed(openTime, focusTime) {
  5038. if (!appInfo) {
  5039. return;
  5040. }
  5041. var data=new OSFLog.AppClosedUsageData();
  5042. data.CorrelationId=osfControlAppCorrelationId;
  5043. data.SessionId=sessionId;
  5044. data.FocusTime=focusTime;
  5045. data.OpenTime=openTime;
  5046. data.AppSizeFinalWidth=window.innerWidth;
  5047. data.AppSizeFinalHeight=window.innerHeight;
  5048. (new AppStorage()).saveLog(sessionId, data.SerializeRow());
  5049. }
  5050. OSFAppTelemetry.onAppClosed=onAppClosed;
  5051. function setOsfControlAppCorrelationId(correlationId) {
  5052. osfControlAppCorrelationId=correlationId;
  5053. }
  5054. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  5055. function doAppInitializationLogging(isException, message) {
  5056. var data=new OSFLog.AppInitializationUsageData();
  5057. data.CorrelationId=osfControlAppCorrelationId;
  5058. data.SessionId=sessionId;
  5059. data.SuccessCode=isException ? 1 : 0;
  5060. data.Message=message;
  5061. (new AppLogger()).LogData(data);
  5062. }
  5063. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  5064. function logAppCommonMessage(message) {
  5065. doAppInitializationLogging(false, message);
  5066. }
  5067. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  5068. function logAppException(errorMessage) {
  5069. doAppInitializationLogging(true, errorMessage);
  5070. }
  5071. OSFAppTelemetry.logAppException=logAppException;
  5072. OSF.AppTelemetry=OSFAppTelemetry;
  5073. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  5074. Microsoft.Office.WebExtension.EventType={};
  5075. OSF.EventDispatch=function OSF_EventDispatch(eventTypes) {
  5076. this._eventHandlers={};
  5077. this._queuedEventsArgs={};
  5078. for (var entry in eventTypes) {
  5079. var eventType=eventTypes[entry];
  5080. this._eventHandlers[eventType]=[];
  5081. this._queuedEventsArgs[eventType]=[];
  5082. }
  5083. };
  5084. OSF.EventDispatch.prototype={
  5085. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() {
  5086. var events=[];
  5087. for (var eventName in this._eventHandlers)
  5088. events.push(eventName);
  5089. return events;
  5090. },
  5091. supportsEvent: function OSF_EventDispatch$supportsEvent(event) {
  5092. var isSupported=false;
  5093. for (var eventName in this._eventHandlers) {
  5094. if (event==eventName) {
  5095. isSupported=true;
  5096. break;
  5097. }
  5098. }
  5099. return isSupported;
  5100. },
  5101. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) {
  5102. var handlers=this._eventHandlers[eventType];
  5103. if (handlers && handlers.length > 0) {
  5104. for (var h in handlers) {
  5105. if (handlers[h]===handler)
  5106. return true;
  5107. }
  5108. }
  5109. return false;
  5110. },
  5111. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) {
  5112. if (typeof handler !="function") {
  5113. return false;
  5114. }
  5115. var handlers=this._eventHandlers[eventType];
  5116. if (handlers && !this.hasEventHandler(eventType, handler)) {
  5117. handlers.push(handler);
  5118. return true;
  5119. }
  5120. else {
  5121. return false;
  5122. }
  5123. },
  5124. addEventHandlerAndFireQueuedEvent: function OSF_EventDispatch$addEventHandlerAndFireQueuedEvent(eventType, handler) {
  5125. var handlers=this._eventHandlers[eventType];
  5126. var isFirstHandler=handlers.length==0;
  5127. var succeed=this.addEventHandler(eventType, handler);
  5128. if (isFirstHandler && succeed) {
  5129. this.fireQueuedEvent(eventType);
  5130. }
  5131. return succeed;
  5132. },
  5133. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) {
  5134. var handlers=this._eventHandlers[eventType];
  5135. if (handlers && handlers.length > 0) {
  5136. for (var index=0; index < handlers.length; index++) {
  5137. if (handlers[index]===handler) {
  5138. handlers.splice(index, 1);
  5139. return true;
  5140. }
  5141. }
  5142. }
  5143. return false;
  5144. },
  5145. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) {
  5146. if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) {
  5147. this._eventHandlers[eventType]=[];
  5148. return true;
  5149. }
  5150. return false;
  5151. },
  5152. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) {
  5153. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1;
  5154. },
  5155. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) {
  5156. if (eventArgs.type==undefined)
  5157. return false;
  5158. var eventType=eventArgs.type;
  5159. if (eventType && this._eventHandlers[eventType]) {
  5160. var eventHandlers=this._eventHandlers[eventType];
  5161. for (var handler in eventHandlers)
  5162. eventHandlers[handler](eventArgs);
  5163. return true;
  5164. }
  5165. else {
  5166. return false;
  5167. }
  5168. },
  5169. fireOrQueueEvent: function OSF_EventDispatch$fireOrQueueEvent(eventArgs) {
  5170. var eventType=eventArgs.type;
  5171. if (eventType && this._eventHandlers[eventType]) {
  5172. var eventHandlers=this._eventHandlers[eventType];
  5173. var queuedEvents=this._queuedEventsArgs[eventType];
  5174. if (eventHandlers.length==0) {
  5175. queuedEvents.push(eventArgs);
  5176. }
  5177. else {
  5178. this.fireEvent(eventArgs);
  5179. }
  5180. return true;
  5181. }
  5182. else {
  5183. return false;
  5184. }
  5185. },
  5186. fireQueuedEvent: function OSF_EventDispatch$queueEvent(eventType) {
  5187. if (eventType && this._eventHandlers[eventType]) {
  5188. var eventHandlers=this._eventHandlers[eventType];
  5189. var queuedEvents=this._queuedEventsArgs[eventType];
  5190. if (eventHandlers.length > 0) {
  5191. var eventHandler=eventHandlers[0];
  5192. while (queuedEvents.length > 0) {
  5193. var eventArgs=queuedEvents.shift();
  5194. eventHandler(eventArgs);
  5195. }
  5196. return true;
  5197. }
  5198. }
  5199. return false;
  5200. }
  5201. };
  5202. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5203. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) {
  5204. var args;
  5205. switch (eventType) {
  5206. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  5207. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  5208. break;
  5209. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  5210. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  5211. break;
  5212. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  5213. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document));
  5214. break;
  5215. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  5216. args=new OSF.DDA.SettingsChangedEventArgs(target);
  5217. break;
  5218. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  5219. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  5220. break;
  5221. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  5222. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  5223. break;
  5224. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  5225. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  5226. break;
  5227. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  5228. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  5229. break;
  5230. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  5231. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5232. break;
  5233. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  5234. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5235. break;
  5236. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  5237. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5238. break;
  5239. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  5240. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  5241. break;
  5242. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  5243. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  5244. break;
  5245. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  5246. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  5247. break;
  5248. case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:
  5249. args=new OSF.DDA.DialogEventArgs(eventProperties);
  5250. break;
  5251. case Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived:
  5252. args=new OSF.DDA.DialogParentEventArgs(eventProperties);
  5253. break;
  5254. case Microsoft.Office.WebExtension.EventType.ItemChanged:
  5255. if (OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlook" || OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlookwebapp") {
  5256. args=new OSF.DDA.OlkItemSelectedChangedEventArgs(eventProperties);
  5257. target.initialize(args["initialData"]);
  5258. target.setCurrentItemNumber(args["itemNumber"].itemNumber);
  5259. }
  5260. else {
  5261. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  5262. }
  5263. break;
  5264. default:
  5265. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  5266. }
  5267. return args;
  5268. };
  5269. OSF.DDA.AsyncMethodNames.addNames({
  5270. AddHandlerAsync: "addHandlerAsync",
  5271. RemoveHandlerAsync: "removeHandlerAsync"
  5272. });
  5273. OSF.DDA.AsyncMethodCalls.define({
  5274. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  5275. requiredArguments: [{
  5276. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5277. "enum": Microsoft.Office.WebExtension.EventType,
  5278. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5279. },
  5280. {
  5281. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5282. "types": ["function"]
  5283. }
  5284. ],
  5285. supportedOptions: [],
  5286. privateStateCallbacks: []
  5287. });
  5288. OSF.DDA.AsyncMethodCalls.define({
  5289. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  5290. requiredArguments: [
  5291. {
  5292. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5293. "enum": Microsoft.Office.WebExtension.EventType,
  5294. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5295. }
  5296. ],
  5297. supportedOptions: [
  5298. {
  5299. name: Microsoft.Office.WebExtension.Parameters.Handler,
  5300. value: {
  5301. "types": ["function", "object"],
  5302. "defaultValue": null
  5303. }
  5304. }
  5305. ],
  5306. privateStateCallbacks: []
  5307. });
  5308. OSF.DialogShownStatus={ hasDialogShown: false, isWindowDialog: false };
  5309. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  5310. DialogMessageReceivedEvent: "DialogMessageReceivedEvent"
  5311. });
  5312. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5313. DialogMessageReceived: "dialogMessageReceived",
  5314. DialogEventReceived: "dialogEventReceived"
  5315. });
  5316. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  5317. MessageType: "messageType",
  5318. MessageContent: "messageContent"
  5319. });
  5320. OSF.DDA.DialogEventType={};
  5321. OSF.OUtil.augmentList(OSF.DDA.DialogEventType, {
  5322. DialogClosed: "dialogClosed",
  5323. NavigationFailed: "naviationFailed"
  5324. });
  5325. OSF.DDA.AsyncMethodNames.addNames({
  5326. DisplayDialogAsync: "displayDialogAsync",
  5327. CloseAsync: "close"
  5328. });
  5329. OSF.DDA.SyncMethodNames.addNames({
  5330. MessageParent: "messageParent",
  5331. AddMessageHandler: "addEventHandler",
  5332. SendMessage: "sendMessage"
  5333. });
  5334. OSF.DDA.UI.ParentUI=function OSF_DDA_ParentUI() {
  5335. var eventDispatch=new OSF.EventDispatch([
  5336. Microsoft.Office.WebExtension.EventType.DialogMessageReceived,
  5337. Microsoft.Office.WebExtension.EventType.DialogEventReceived,
  5338. Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  5339. ]);
  5340. var openDialogName=OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName;
  5341. var target=this;
  5342. if (!target[openDialogName]) {
  5343. OSF.OUtil.defineEnumerableProperty(target, openDialogName, {
  5344. value: function () {
  5345. var openDialog=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];
  5346. openDialog(arguments, eventDispatch, target);
  5347. }
  5348. });
  5349. }
  5350. OSF.OUtil.finalizeProperties(this);
  5351. };
  5352. OSF.DDA.UI.ChildUI=function OSF_DDA_ChildUI() {
  5353. var messageParentName=OSF.DDA.SyncMethodNames.MessageParent.displayName;
  5354. var target=this;
  5355. if (!target[messageParentName]) {
  5356. OSF.OUtil.defineEnumerableProperty(target, messageParentName, {
  5357. value: function () {
  5358. var messageParent=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];
  5359. return messageParent(arguments, target);
  5360. }
  5361. });
  5362. }
  5363. var addEventHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  5364. if (!target[addEventHandler] && typeof OSF.DialogParentMessageEventDispatch !="undefined") {
  5365. OSF.DDA.DispIdHost.addEventSupport(target, OSF.DialogParentMessageEventDispatch);
  5366. }
  5367. OSF.OUtil.finalizeProperties(this);
  5368. };
  5369. OSF.DialogHandler=function OSF_DialogHandler() { };
  5370. OSF.DDA.DialogEventArgs=function OSF_DDA_DialogEventArgs(message) {
  5371. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogMessageReceived) {
  5372. OSF.OUtil.defineEnumerableProperties(this, {
  5373. "type": {
  5374. value: Microsoft.Office.WebExtension.EventType.DialogMessageReceived
  5375. },
  5376. "message": {
  5377. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  5378. }
  5379. });
  5380. }
  5381. else {
  5382. OSF.OUtil.defineEnumerableProperties(this, {
  5383. "type": {
  5384. value: Microsoft.Office.WebExtension.EventType.DialogEventReceived
  5385. },
  5386. "error": {
  5387. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  5388. }
  5389. });
  5390. }
  5391. };
  5392. OSF.DDA.DialogParentEventArgs=function OSF_DDA_DialogParentEventArgs(message) {
  5393. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogParentMessageReceived) {
  5394. OSF.OUtil.defineEnumerableProperties(this, {
  5395. "type": {
  5396. value: Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  5397. },
  5398. "message": {
  5399. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  5400. }
  5401. });
  5402. }
  5403. else {
  5404. OSF.OUtil.defineEnumerableProperties(this, {
  5405. "type": {
  5406. value: Microsoft.Office.WebExtension.EventType.DialogParentEventReceived
  5407. },
  5408. "error": {
  5409. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  5410. }
  5411. });
  5412. }
  5413. };
  5414. OSF.DDA.AsyncMethodCalls.define({
  5415. method: OSF.DDA.AsyncMethodNames.DisplayDialogAsync,
  5416. requiredArguments: [
  5417. {
  5418. "name": Microsoft.Office.WebExtension.Parameters.Url,
  5419. "types": ["string"]
  5420. }
  5421. ],
  5422. supportedOptions: [
  5423. {
  5424. name: Microsoft.Office.WebExtension.Parameters.Width,
  5425. value: {
  5426. "types": ["number"],
  5427. "defaultValue": 99
  5428. }
  5429. },
  5430. {
  5431. name: Microsoft.Office.WebExtension.Parameters.Height,
  5432. value: {
  5433. "types": ["number"],
  5434. "defaultValue": 99
  5435. }
  5436. },
  5437. {
  5438. name: Microsoft.Office.WebExtension.Parameters.RequireHTTPs,
  5439. value: {
  5440. "types": ["boolean"],
  5441. "defaultValue": true
  5442. }
  5443. },
  5444. {
  5445. name: Microsoft.Office.WebExtension.Parameters.DisplayInIframe,
  5446. value: {
  5447. "types": ["boolean"],
  5448. "defaultValue": false
  5449. }
  5450. }
  5451. ],
  5452. privateStateCallbacks: [],
  5453. onSucceeded: function (args, caller, callArgs) {
  5454. var targetId=args[Microsoft.Office.WebExtension.Parameters.Id];
  5455. var eventDispatch=args[Microsoft.Office.WebExtension.Parameters.Data];
  5456. var dialog=new OSF.DialogHandler();
  5457. var closeDialog=OSF.DDA.AsyncMethodNames.CloseAsync.displayName;
  5458. OSF.OUtil.defineEnumerableProperty(dialog, closeDialog, {
  5459. value: function () {
  5460. var closeDialogfunction=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];
  5461. closeDialogfunction(arguments, targetId, eventDispatch, dialog);
  5462. }
  5463. });
  5464. var addHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  5465. OSF.OUtil.defineEnumerableProperty(dialog, addHandler, {
  5466. value: function () {
  5467. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id];
  5468. var callArgs=syncMethodCall.verifyAndExtractCall(arguments, dialog, eventDispatch);
  5469. var eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  5470. var handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  5471. return eventDispatch.addEventHandlerAndFireQueuedEvent(eventType, handler);
  5472. }
  5473. });
  5474. var sendMessage=OSF.DDA.SyncMethodNames.SendMessage.displayName;
  5475. OSF.OUtil.defineEnumerableProperty(dialog, sendMessage, {
  5476. value: function () {
  5477. var execute=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.SendMessage];
  5478. return execute(arguments, eventDispatch, dialog);
  5479. }
  5480. });
  5481. return dialog;
  5482. },
  5483. checkCallArgs: function (callArgs, caller, stateInfo) {
  5484. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] <=0) {
  5485. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=1;
  5486. }
  5487. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] > 100) {
  5488. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=99;
  5489. }
  5490. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] <=0) {
  5491. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=1;
  5492. }
  5493. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] > 100) {
  5494. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=99;
  5495. }
  5496. if (!callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]) {
  5497. callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]=true;
  5498. }
  5499. return callArgs;
  5500. }
  5501. });
  5502. OSF.DDA.AsyncMethodCalls.define({
  5503. method: OSF.DDA.AsyncMethodNames.CloseAsync,
  5504. requiredArguments: [],
  5505. supportedOptions: [],
  5506. privateStateCallbacks: []
  5507. });
  5508. OSF.DDA.SyncMethodCalls.define({
  5509. method: OSF.DDA.SyncMethodNames.MessageParent,
  5510. requiredArguments: [
  5511. {
  5512. "name": Microsoft.Office.WebExtension.Parameters.MessageToParent,
  5513. "types": ["string", "number", "boolean"]
  5514. }
  5515. ],
  5516. supportedOptions: []
  5517. });
  5518. OSF.DDA.SyncMethodCalls.define({
  5519. method: OSF.DDA.SyncMethodNames.AddMessageHandler,
  5520. requiredArguments: [
  5521. {
  5522. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5523. "enum": Microsoft.Office.WebExtension.EventType,
  5524. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5525. },
  5526. {
  5527. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5528. "types": ["function"]
  5529. }
  5530. ],
  5531. supportedOptions: []
  5532. });
  5533. OSF.DDA.SyncMethodCalls.define({
  5534. method: OSF.DDA.SyncMethodNames.SendMessage,
  5535. requiredArguments: [
  5536. {
  5537. "name": Microsoft.Office.WebExtension.Parameters.MessageContent,
  5538. "types": ["string"]
  5539. }
  5540. ],
  5541. supportedOptions: [],
  5542. privateStateCallbacks: []
  5543. });
  5544. OSF.DDA.SafeArray.Delegate.openDialog=function OSF_DDA_SafeArray_Delegate$OpenDialog(args) {
  5545. try {
  5546. if (args.onCalling) {
  5547. args.onCalling();
  5548. }
  5549. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  5550. OSF.ClientHostController.openDialog(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  5551. if (args.onEvent) {
  5552. args.onEvent(payload);
  5553. }
  5554. if (OSF.AppTelemetry) {
  5555. OSF.AppTelemetry.onEventDone(args.dispId);
  5556. }
  5557. }, callback);
  5558. }
  5559. catch (ex) {
  5560. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5561. }
  5562. };
  5563. OSF.DDA.SafeArray.Delegate.closeDialog=function OSF_DDA_SafeArray_Delegate$CloseDialog(args) {
  5564. if (args.onCalling) {
  5565. args.onCalling();
  5566. }
  5567. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  5568. try {
  5569. OSF.ClientHostController.closeDialog(args.dispId, args.targetId, callback);
  5570. }
  5571. catch (ex) {
  5572. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5573. }
  5574. };
  5575. OSF.DDA.SafeArray.Delegate.messageParent=function OSF_DDA_SafeArray_Delegate$MessageParent(args) {
  5576. try {
  5577. if (args.onCalling) {
  5578. args.onCalling();
  5579. }
  5580. var startTime=(new Date()).getTime();
  5581. var result=OSF.ClientHostController.messageParent(args.hostCallArgs);
  5582. if (args.onReceiving) {
  5583. args.onReceiving();
  5584. }
  5585. if (OSF.AppTelemetry) {
  5586. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), result);
  5587. }
  5588. return result;
  5589. }
  5590. catch (ex) {
  5591. return OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod(ex);
  5592. }
  5593. };
  5594. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5595. type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,
  5596. fromHost: [
  5597. { name: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5598. ],
  5599. isComplexType: true
  5600. });
  5601. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5602. type: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  5603. fromHost: [
  5604. { name: OSF.DDA.PropertyDescriptors.MessageType, value: 0 },
  5605. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: 1 }
  5606. ],
  5607. isComplexType: true
  5608. });
  5609. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5610. type: OSF.DDA.EventDispId.dispidDialogParentMessageReceivedEvent,
  5611. fromHost: [
  5612. { name: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5613. ],
  5614. isComplexType: true
  5615. });
  5616. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5617. type: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,
  5618. fromHost: [
  5619. { name: OSF.DDA.PropertyDescriptors.MessageType, value: 0 },
  5620. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: 1 }
  5621. ],
  5622. isComplexType: true
  5623. });
  5624. Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) {
  5625. function fixData(data) {
  5626. if (data==null || data==undefined) {
  5627. return null;
  5628. }
  5629. try {
  5630. for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) {
  5631. data=[data];
  5632. }
  5633. return data;
  5634. }
  5635. catch (ex) {
  5636. }
  5637. }
  5638. ;
  5639. OSF.OUtil.defineEnumerableProperties(this, {
  5640. "headers": {
  5641. get: function () { return headers; },
  5642. set: function (value) {
  5643. headers=fixData(value);
  5644. }
  5645. },
  5646. "rows": {
  5647. get: function () { return rows; },
  5648. set: function (value) {
  5649. rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ?
  5650. [] :
  5651. fixData(value);
  5652. }
  5653. }
  5654. });
  5655. this.headers=headers;
  5656. this.rows=rows;
  5657. };
  5658. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5659. OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) {
  5660. return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]);
  5661. };
  5662. Microsoft.Office.WebExtension.CoercionType={
  5663. Text: "text",
  5664. Matrix: "matrix",
  5665. Table: "table"
  5666. };
  5667. OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() {
  5668. return {
  5669. findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) {
  5670. if (OSF.OUtil.isArray(obj)) {
  5671. var dim=0;
  5672. for (var index=0; index < obj.length; index++) {
  5673. dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index]));
  5674. }
  5675. return dim+1;
  5676. }
  5677. else {
  5678. return 0;
  5679. }
  5680. },
  5681. getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) {
  5682. switch (bindingType) {
  5683. case Microsoft.Office.WebExtension.BindingType.Matrix: return Microsoft.Office.WebExtension.CoercionType.Matrix;
  5684. case Microsoft.Office.WebExtension.BindingType.Table: return Microsoft.Office.WebExtension.CoercionType.Table;
  5685. case Microsoft.Office.WebExtension.BindingType.Text:
  5686. default:
  5687. return Microsoft.Office.WebExtension.CoercionType.Text;
  5688. }
  5689. },
  5690. getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) {
  5691. switch (coercionType) {
  5692. case Microsoft.Office.WebExtension.CoercionType.Matrix: return Microsoft.Office.WebExtension.BindingType.Matrix;
  5693. case Microsoft.Office.WebExtension.CoercionType.Table: return Microsoft.Office.WebExtension.BindingType.Table;
  5694. case Microsoft.Office.WebExtension.CoercionType.Text:
  5695. case Microsoft.Office.WebExtension.CoercionType.Html:
  5696. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5697. default:
  5698. return Microsoft.Office.WebExtension.BindingType.Text;
  5699. }
  5700. },
  5701. determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) {
  5702. if (data==null || data==undefined)
  5703. return null;
  5704. var sourceType=null;
  5705. var runtimeType=typeof data;
  5706. if (data.rows !==undefined) {
  5707. sourceType=Microsoft.Office.WebExtension.CoercionType.Table;
  5708. }
  5709. else if (OSF.OUtil.isArray(data)) {
  5710. sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix;
  5711. }
  5712. else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) {
  5713. sourceType=Microsoft.Office.WebExtension.CoercionType.Text;
  5714. }
  5715. else {
  5716. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject;
  5717. }
  5718. return sourceType;
  5719. },
  5720. coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) {
  5721. sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data);
  5722. if (sourceType && sourceType !=destinationType) {
  5723. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin);
  5724. data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType));
  5725. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd);
  5726. }
  5727. return data;
  5728. },
  5729. _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) {
  5730. if (matrix.length==1 && matrix[0].length==1)
  5731. return ""+matrix[0][0];
  5732. var val="";
  5733. for (var i=0; i < matrix.length; i++) {
  5734. val+=matrix[i].join("\t")+"\n";
  5735. }
  5736. return val.substring(0, val.length - 1);
  5737. },
  5738. _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) {
  5739. var ret=text.split("\n");
  5740. for (var i=0; i < ret.length; i++)
  5741. ret[i]=ret[i].split("\t");
  5742. return ret;
  5743. },
  5744. _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) {
  5745. var headers="";
  5746. if (table.headers !=null) {
  5747. headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n";
  5748. }
  5749. var rows=OSF.DDA.DataCoercion._matrixToText(table.rows);
  5750. if (rows=="") {
  5751. headers=headers.substring(0, headers.length - 1);
  5752. }
  5753. return headers+rows;
  5754. },
  5755. _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) {
  5756. var matrix=table.rows;
  5757. if (table.headers !=null) {
  5758. matrix.unshift(table.headers);
  5759. }
  5760. return matrix;
  5761. },
  5762. _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) {
  5763. var value;
  5764. switch (coercionType) {
  5765. case Microsoft.Office.WebExtension.CoercionType.Table:
  5766. value=table;
  5767. break;
  5768. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5769. value=OSF.DDA.DataCoercion._tableToMatrix(table);
  5770. break;
  5771. case Microsoft.Office.WebExtension.CoercionType.SlideRange:
  5772. value=null;
  5773. if (OSF.DDA.OMFactory.manufactureSlideRange) {
  5774. value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table));
  5775. }
  5776. if (value==null) {
  5777. value=OSF.DDA.DataCoercion._tableToText(table);
  5778. }
  5779. break;
  5780. case Microsoft.Office.WebExtension.CoercionType.Text:
  5781. case Microsoft.Office.WebExtension.CoercionType.Html:
  5782. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5783. default:
  5784. value=OSF.DDA.DataCoercion._tableToText(table);
  5785. break;
  5786. }
  5787. return value;
  5788. },
  5789. _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) {
  5790. if (sourceType==undefined) {
  5791. sourceType=OSF.DDA.DataCoercion.determineCoercionType(data);
  5792. }
  5793. var value;
  5794. switch (sourceType) {
  5795. case Microsoft.Office.WebExtension.CoercionType.Table:
  5796. value=data;
  5797. break;
  5798. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5799. value=new Microsoft.Office.WebExtension.TableData(data);
  5800. break;
  5801. case Microsoft.Office.WebExtension.CoercionType.Text:
  5802. case Microsoft.Office.WebExtension.CoercionType.Html:
  5803. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5804. default:
  5805. value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data));
  5806. break;
  5807. }
  5808. return value;
  5809. }
  5810. };
  5811. })();
  5812. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5813. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5814. toHost: [
  5815. { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 },
  5816. { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 },
  5817. { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 }
  5818. ]
  5819. });
  5820. OSF.DDA.AsyncMethodNames.addNames({
  5821. GetSelectedDataAsync: "getSelectedDataAsync",
  5822. SetSelectedDataAsync: "setSelectedDataAsync"
  5823. });
  5824. (function () {
  5825. function processData(dataDescriptor, caller, callArgs) {
  5826. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  5827. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  5828. data=OSF.DDA.OMFactory.manufactureTableData(data);
  5829. }
  5830. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  5831. return data==undefined ? null : data;
  5832. }
  5833. OSF.DDA.AsyncMethodCalls.define({
  5834. method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,
  5835. requiredArguments: [
  5836. {
  5837. "name": Microsoft.Office.WebExtension.Parameters.CoercionType,
  5838. "enum": Microsoft.Office.WebExtension.CoercionType
  5839. }
  5840. ],
  5841. supportedOptions: [
  5842. {
  5843. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  5844. value: {
  5845. "enum": Microsoft.Office.WebExtension.ValueFormat,
  5846. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  5847. }
  5848. },
  5849. {
  5850. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  5851. value: {
  5852. "enum": Microsoft.Office.WebExtension.FilterType,
  5853. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  5854. }
  5855. }
  5856. ],
  5857. privateStateCallbacks: [],
  5858. onSucceeded: processData
  5859. });
  5860. OSF.DDA.AsyncMethodCalls.define({
  5861. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  5862. requiredArguments: [
  5863. {
  5864. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5865. "types": ["string", "object", "number", "boolean"]
  5866. }
  5867. ],
  5868. supportedOptions: [
  5869. {
  5870. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5871. value: {
  5872. "enum": Microsoft.Office.WebExtension.CoercionType,
  5873. "calculate": function (requiredArgs) {
  5874. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  5875. }
  5876. }
  5877. },
  5878. {
  5879. name: Microsoft.Office.WebExtension.Parameters.ImageLeft,
  5880. value: {
  5881. "types": ["number", "boolean"],
  5882. "defaultValue": false
  5883. }
  5884. },
  5885. {
  5886. name: Microsoft.Office.WebExtension.Parameters.ImageTop,
  5887. value: {
  5888. "types": ["number", "boolean"],
  5889. "defaultValue": false
  5890. }
  5891. },
  5892. {
  5893. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  5894. value: {
  5895. "types": ["number", "boolean"],
  5896. "defaultValue": false
  5897. }
  5898. },
  5899. {
  5900. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  5901. value: {
  5902. "types": ["number", "boolean"],
  5903. "defaultValue": false
  5904. }
  5905. }
  5906. ],
  5907. privateStateCallbacks: []
  5908. });
  5909. })();
  5910. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5911. type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,
  5912. fromHost: [
  5913. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5914. ],
  5915. toHost: [
  5916. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  5917. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 },
  5918. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 }
  5919. ]
  5920. });
  5921. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5922. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  5923. toHost: [
  5924. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  5925. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  5926. { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: 2 },
  5927. { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: 3 },
  5928. { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: 4 },
  5929. { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: 5 },
  5930. ]
  5931. });
  5932. OSF.DDA.SettingsManager={
  5933. SerializedSettings: "serializedSettings",
  5934. RefreshingSettings: "refreshingSettings",
  5935. DateJSONPrefix: "Date(",
  5936. DataJSONSuffix: ")",
  5937. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) {
  5938. var ret={};
  5939. for (var key in settingsCollection) {
  5940. var value=settingsCollection[key];
  5941. try {
  5942. if (JSON) {
  5943. value=JSON.stringify(value, function dateReplacer(k, v) {
  5944. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v;
  5945. });
  5946. }
  5947. else {
  5948. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  5949. }
  5950. ret[key]=value;
  5951. }
  5952. catch (ex) {
  5953. }
  5954. }
  5955. return ret;
  5956. },
  5957. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) {
  5958. var ret={};
  5959. serializedSettings=serializedSettings || {};
  5960. for (var key in serializedSettings) {
  5961. var value=serializedSettings[key];
  5962. try {
  5963. if (JSON) {
  5964. value=JSON.parse(value, function dateReviver(k, v) {
  5965. var d;
  5966. if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) {
  5967. d=new Date(parseInt(v.slice(5, -1)));
  5968. if (d) {
  5969. return d;
  5970. }
  5971. }
  5972. return v;
  5973. });
  5974. }
  5975. else {
  5976. value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true);
  5977. }
  5978. ret[key]=value;
  5979. }
  5980. catch (ex) {
  5981. }
  5982. }
  5983. return ret;
  5984. }
  5985. };
  5986. OSF.DDA.Settings=function OSF_DDA_Settings(settings) {
  5987. settings=settings || {};
  5988. var cacheSessionSettings=function (settings) {
  5989. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  5990. if (osfSessionStorage) {
  5991. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings);
  5992. var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings);
  5993. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  5994. }
  5995. };
  5996. OSF.OUtil.defineEnumerableProperties(this, {
  5997. "get": {
  5998. value: function OSF_DDA_Settings$get(name) {
  5999. var e=Function._validateParams(arguments, [
  6000. { name: "name", type: String, mayBeNull: false }
  6001. ]);
  6002. if (e)
  6003. throw e;
  6004. var setting=settings[name];
  6005. return typeof (setting)==='undefined' ? null : setting;
  6006. }
  6007. },
  6008. "set": {
  6009. value: function OSF_DDA_Settings$set(name, value) {
  6010. var e=Function._validateParams(arguments, [
  6011. { name: "name", type: String, mayBeNull: false },
  6012. { name: "value", mayBeNull: true }
  6013. ]);
  6014. if (e)
  6015. throw e;
  6016. settings[name]=value;
  6017. cacheSessionSettings(settings);
  6018. }
  6019. },
  6020. "remove": {
  6021. value: function OSF_DDA_Settings$remove(name) {
  6022. var e=Function._validateParams(arguments, [
  6023. { name: "name", type: String, mayBeNull: false }
  6024. ]);
  6025. if (e)
  6026. throw e;
  6027. delete settings[name];
  6028. cacheSessionSettings(settings);
  6029. }
  6030. }
  6031. });
  6032. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings);
  6033. };
  6034. OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) {
  6035. OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings);
  6036. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings);
  6037. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]));
  6038. };
  6039. OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings);
  6040. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  6041. SettingsChanged: "settingsChanged"
  6042. });
  6043. OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) {
  6044. OSF.OUtil.defineEnumerableProperties(this, {
  6045. "type": {
  6046. value: Microsoft.Office.WebExtension.EventType.SettingsChanged
  6047. },
  6048. "settings": {
  6049. value: settingsInstance
  6050. }
  6051. });
  6052. };
  6053. OSF.DDA.AsyncMethodNames.addNames({
  6054. RefreshAsync: "refreshAsync",
  6055. SaveAsync: "saveAsync"
  6056. });
  6057. OSF.DDA.AsyncMethodCalls.define({
  6058. method: OSF.DDA.AsyncMethodNames.RefreshAsync,
  6059. requiredArguments: [],
  6060. supportedOptions: [],
  6061. privateStateCallbacks: [
  6062. {
  6063. name: OSF.DDA.SettingsManager.RefreshingSettings,
  6064. value: function getRefreshingSettings(settingsInstance, settingsCollection) {
  6065. return settingsCollection;
  6066. }
  6067. }
  6068. ],
  6069. onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings, refreshingSettingsArgs) {
  6070. var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings];
  6071. var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  6072. var oldSettings=refreshingSettingsArgs[OSF.DDA.SettingsManager.RefreshingSettings];
  6073. for (var setting in oldSettings) {
  6074. refreshingSettings.remove(setting);
  6075. }
  6076. for (var setting in newSettings) {
  6077. refreshingSettings.set(setting, newSettings[setting]);
  6078. }
  6079. return refreshingSettings;
  6080. }
  6081. });
  6082. OSF.DDA.AsyncMethodCalls.define({
  6083. method: OSF.DDA.AsyncMethodNames.SaveAsync,
  6084. requiredArguments: [],
  6085. supportedOptions: [
  6086. {
  6087. name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,
  6088. value: {
  6089. "types": ["boolean"],
  6090. "defaultValue": true
  6091. }
  6092. }
  6093. ],
  6094. privateStateCallbacks: [
  6095. {
  6096. name: OSF.DDA.SettingsManager.SerializedSettings,
  6097. value: function serializeSettings(settingsInstance, settingsCollection) {
  6098. return OSF.DDA.SettingsManager.serializeSettings(settingsCollection);
  6099. }
  6100. }
  6101. ]
  6102. });
  6103. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6104. type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod,
  6105. fromHost: [
  6106. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6107. ]
  6108. });
  6109. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6110. type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod,
  6111. toHost: [
  6112. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings },
  6113. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale }
  6114. ]
  6115. });
  6116. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent });
  6117. Microsoft.Office.WebExtension.BindingType={
  6118. Table: "table",
  6119. Text: "text",
  6120. Matrix: "matrix"
  6121. };
  6122. OSF.DDA.BindingProperties={
  6123. Id: "BindingId",
  6124. Type: Microsoft.Office.WebExtension.Parameters.BindingType
  6125. };
  6126. OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" });
  6127. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  6128. Subset: "subset",
  6129. BindingProperties: "BindingProperties"
  6130. });
  6131. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties);
  6132. OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) {
  6133. this._id=bindingId;
  6134. OSF.OUtil.defineEnumerableProperty(this, "onFail", {
  6135. get: function () {
  6136. return errorCallback;
  6137. },
  6138. set: function (onError) {
  6139. var t=typeof onError;
  6140. if (t !="undefined" && t !="function") {
  6141. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t);
  6142. }
  6143. errorCallback=onError;
  6144. }
  6145. });
  6146. };
  6147. OSF.DDA.BindingPromise.prototype={
  6148. _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) {
  6149. if (this.binding) {
  6150. if (onComplete)
  6151. onComplete(this.binding);
  6152. }
  6153. else {
  6154. if (!this._binding) {
  6155. var me=this;
  6156. Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) {
  6157. if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) {
  6158. OSF.OUtil.defineEnumerableProperty(me, "binding", {
  6159. value: asyncResult.value
  6160. });
  6161. if (onComplete)
  6162. onComplete(me.binding);
  6163. }
  6164. else {
  6165. if (me.onFail)
  6166. me.onFail(asyncResult);
  6167. }
  6168. });
  6169. }
  6170. }
  6171. return this;
  6172. },
  6173. getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() {
  6174. var args=arguments;
  6175. this._fetch(function onComplete(binding) { binding.getDataAsync.apply(binding, args); });
  6176. return this;
  6177. },
  6178. setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() {
  6179. var args=arguments;
  6180. this._fetch(function onComplete(binding) { binding.setDataAsync.apply(binding, args); });
  6181. return this;
  6182. },
  6183. addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() {
  6184. var args=arguments;
  6185. this._fetch(function onComplete(binding) { binding.addHandlerAsync.apply(binding, args); });
  6186. return this;
  6187. },
  6188. removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() {
  6189. var args=arguments;
  6190. this._fetch(function onComplete(binding) { binding.removeHandlerAsync.apply(binding, args); });
  6191. return this;
  6192. }
  6193. };
  6194. OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) {
  6195. this._eventDispatches=[];
  6196. OSF.OUtil.defineEnumerableProperty(this, "document", {
  6197. value: docInstance
  6198. });
  6199. var am=OSF.DDA.AsyncMethodNames;
  6200. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6201. am.AddFromSelectionAsync,
  6202. am.AddFromNamedItemAsync,
  6203. am.GetAllAsync,
  6204. am.GetByIdAsync,
  6205. am.ReleaseByIdAsync
  6206. ]);
  6207. };
  6208. OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) {
  6209. OSF.OUtil.defineEnumerableProperties(this, {
  6210. "document": { value: docInstance },
  6211. "id": { value: id }
  6212. });
  6213. };
  6214. OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) {
  6215. OSF.OUtil.defineEnumerableProperties(this, {
  6216. "document": {
  6217. value: docInstance
  6218. },
  6219. "id": {
  6220. value: id
  6221. }
  6222. });
  6223. var am=OSF.DDA.AsyncMethodNames;
  6224. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6225. am.GetDataAsync,
  6226. am.SetDataAsync
  6227. ]);
  6228. var et=Microsoft.Office.WebExtension.EventType;
  6229. var bindingEventDispatches=docInstance.bindings._eventDispatches;
  6230. if (!bindingEventDispatches[id]) {
  6231. bindingEventDispatches[id]=new OSF.EventDispatch([
  6232. et.BindingSelectionChanged,
  6233. et.BindingDataChanged
  6234. ]);
  6235. }
  6236. var eventDispatch=bindingEventDispatches[id];
  6237. OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch);
  6238. };
  6239. OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() {
  6240. return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime();
  6241. };
  6242. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6243. OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) {
  6244. var id=bindingProperties[OSF.DDA.BindingProperties.Id];
  6245. var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount];
  6246. var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount];
  6247. var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders];
  6248. var binding;
  6249. switch (bindingProperties[OSF.DDA.BindingProperties.Type]) {
  6250. case Microsoft.Office.WebExtension.BindingType.Text:
  6251. binding=new OSF.DDA.TextBinding(id, containingDocument);
  6252. break;
  6253. case Microsoft.Office.WebExtension.BindingType.Matrix:
  6254. binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols);
  6255. break;
  6256. case Microsoft.Office.WebExtension.BindingType.Table:
  6257. var isExcelApp=function () {
  6258. return (OSF.DDA.ExcelDocument)
  6259. && (Microsoft.Office.WebExtension.context.document)
  6260. && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument);
  6261. };
  6262. var tableBindingObject;
  6263. if (isExcelApp() && OSF.DDA.ExcelTableBinding) {
  6264. tableBindingObject=OSF.DDA.ExcelTableBinding;
  6265. }
  6266. else {
  6267. tableBindingObject=OSF.DDA.TableBinding;
  6268. }
  6269. binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders);
  6270. break;
  6271. default:
  6272. binding=new OSF.DDA.UnknownBinding(id, containingDocument);
  6273. }
  6274. return binding;
  6275. };
  6276. OSF.DDA.AsyncMethodNames.addNames({
  6277. AddFromSelectionAsync: "addFromSelectionAsync",
  6278. AddFromNamedItemAsync: "addFromNamedItemAsync",
  6279. GetAllAsync: "getAllAsync",
  6280. GetByIdAsync: "getByIdAsync",
  6281. ReleaseByIdAsync: "releaseByIdAsync",
  6282. GetDataAsync: "getDataAsync",
  6283. SetDataAsync: "setDataAsync"
  6284. });
  6285. (function () {
  6286. function processBinding(bindingDescriptor) {
  6287. return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document);
  6288. }
  6289. function getObjectId(obj) { return obj.id; }
  6290. function processData(dataDescriptor, caller, callArgs) {
  6291. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  6292. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  6293. data=OSF.DDA.OMFactory.manufactureTableData(data);
  6294. }
  6295. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  6296. return data==undefined ? null : data;
  6297. }
  6298. OSF.DDA.AsyncMethodCalls.define({
  6299. method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,
  6300. requiredArguments: [
  6301. {
  6302. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6303. "enum": Microsoft.Office.WebExtension.BindingType
  6304. }
  6305. ],
  6306. supportedOptions: [{
  6307. name: Microsoft.Office.WebExtension.Parameters.Id,
  6308. value: {
  6309. "types": ["string"],
  6310. "calculate": OSF.DDA.generateBindingId
  6311. }
  6312. },
  6313. {
  6314. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6315. value: {
  6316. "types": ["object"],
  6317. "defaultValue": null
  6318. }
  6319. }
  6320. ],
  6321. privateStateCallbacks: [],
  6322. onSucceeded: processBinding
  6323. });
  6324. OSF.DDA.AsyncMethodCalls.define({
  6325. method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,
  6326. requiredArguments: [{
  6327. "name": Microsoft.Office.WebExtension.Parameters.ItemName,
  6328. "types": ["string"]
  6329. },
  6330. {
  6331. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6332. "enum": Microsoft.Office.WebExtension.BindingType
  6333. }
  6334. ],
  6335. supportedOptions: [{
  6336. name: Microsoft.Office.WebExtension.Parameters.Id,
  6337. value: {
  6338. "types": ["string"],
  6339. "calculate": OSF.DDA.generateBindingId
  6340. }
  6341. },
  6342. {
  6343. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6344. value: {
  6345. "types": ["object"],
  6346. "defaultValue": null
  6347. }
  6348. }
  6349. ],
  6350. privateStateCallbacks: [
  6351. {
  6352. name: Microsoft.Office.WebExtension.Parameters.FailOnCollision,
  6353. value: function () { return true; }
  6354. }
  6355. ],
  6356. onSucceeded: processBinding
  6357. });
  6358. OSF.DDA.AsyncMethodCalls.define({
  6359. method: OSF.DDA.AsyncMethodNames.GetAllAsync,
  6360. requiredArguments: [],
  6361. supportedOptions: [],
  6362. privateStateCallbacks: [],
  6363. onSucceeded: function (response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); }
  6364. });
  6365. OSF.DDA.AsyncMethodCalls.define({
  6366. method: OSF.DDA.AsyncMethodNames.GetByIdAsync,
  6367. requiredArguments: [
  6368. {
  6369. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6370. "types": ["string"]
  6371. }
  6372. ],
  6373. supportedOptions: [],
  6374. privateStateCallbacks: [],
  6375. onSucceeded: processBinding
  6376. });
  6377. OSF.DDA.AsyncMethodCalls.define({
  6378. method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,
  6379. requiredArguments: [
  6380. {
  6381. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6382. "types": ["string"]
  6383. }
  6384. ],
  6385. supportedOptions: [],
  6386. privateStateCallbacks: [],
  6387. onSucceeded: function (response, caller, callArgs) {
  6388. var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id];
  6389. delete caller._eventDispatches[id];
  6390. }
  6391. });
  6392. OSF.DDA.AsyncMethodCalls.define({
  6393. method: OSF.DDA.AsyncMethodNames.GetDataAsync,
  6394. requiredArguments: [],
  6395. supportedOptions: [{
  6396. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6397. value: {
  6398. "enum": Microsoft.Office.WebExtension.CoercionType,
  6399. "calculate": function (requiredArgs, binding) { return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); }
  6400. }
  6401. },
  6402. {
  6403. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  6404. value: {
  6405. "enum": Microsoft.Office.WebExtension.ValueFormat,
  6406. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  6407. }
  6408. },
  6409. {
  6410. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  6411. value: {
  6412. "enum": Microsoft.Office.WebExtension.FilterType,
  6413. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  6414. }
  6415. },
  6416. {
  6417. name: Microsoft.Office.WebExtension.Parameters.Rows,
  6418. value: {
  6419. "types": ["object", "string"],
  6420. "defaultValue": null
  6421. }
  6422. },
  6423. {
  6424. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6425. value: {
  6426. "types": ["object"],
  6427. "defaultValue": null
  6428. }
  6429. },
  6430. {
  6431. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  6432. value: {
  6433. "types": ["number"],
  6434. "defaultValue": 0
  6435. }
  6436. },
  6437. {
  6438. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  6439. value: {
  6440. "types": ["number"],
  6441. "defaultValue": 0
  6442. }
  6443. },
  6444. {
  6445. name: Microsoft.Office.WebExtension.Parameters.RowCount,
  6446. value: {
  6447. "types": ["number"],
  6448. "defaultValue": 0
  6449. }
  6450. },
  6451. {
  6452. name: Microsoft.Office.WebExtension.Parameters.ColumnCount,
  6453. value: {
  6454. "types": ["number"],
  6455. "defaultValue": 0
  6456. }
  6457. }
  6458. ],
  6459. checkCallArgs: function (callArgs, caller, stateInfo) {
  6460. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  6461. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 &&
  6462. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 &&
  6463. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) {
  6464. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  6465. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  6466. delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount];
  6467. delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount];
  6468. }
  6469. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  6470. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  6471. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] ||
  6472. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] ||
  6473. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) {
  6474. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  6475. }
  6476. return callArgs;
  6477. },
  6478. privateStateCallbacks: [
  6479. {
  6480. name: Microsoft.Office.WebExtension.Parameters.Id,
  6481. value: getObjectId
  6482. }
  6483. ],
  6484. onSucceeded: processData
  6485. });
  6486. OSF.DDA.AsyncMethodCalls.define({
  6487. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  6488. requiredArguments: [
  6489. {
  6490. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6491. "types": ["string", "object", "number", "boolean"]
  6492. }
  6493. ],
  6494. supportedOptions: [{
  6495. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6496. value: {
  6497. "enum": Microsoft.Office.WebExtension.CoercionType,
  6498. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  6499. }
  6500. },
  6501. {
  6502. name: Microsoft.Office.WebExtension.Parameters.Rows,
  6503. value: {
  6504. "types": ["object", "string"],
  6505. "defaultValue": null
  6506. }
  6507. },
  6508. {
  6509. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6510. value: {
  6511. "types": ["object"],
  6512. "defaultValue": null
  6513. }
  6514. },
  6515. {
  6516. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  6517. value: {
  6518. "types": ["number"],
  6519. "defaultValue": 0
  6520. }
  6521. },
  6522. {
  6523. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  6524. value: {
  6525. "types": ["number"],
  6526. "defaultValue": 0
  6527. }
  6528. }
  6529. ],
  6530. checkCallArgs: function (callArgs, caller, stateInfo) {
  6531. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  6532. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) {
  6533. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  6534. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  6535. }
  6536. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  6537. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  6538. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) {
  6539. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  6540. }
  6541. return callArgs;
  6542. },
  6543. privateStateCallbacks: [
  6544. {
  6545. name: Microsoft.Office.WebExtension.Parameters.Id,
  6546. value: getObjectId
  6547. }
  6548. ]
  6549. });
  6550. })();
  6551. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  6552. RowCount: "BindingRowCount",
  6553. ColumnCount: "BindingColumnCount",
  6554. HasHeaders: "HasHeaders"
  6555. });
  6556. OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) {
  6557. OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance);
  6558. OSF.OUtil.defineEnumerableProperties(this, {
  6559. "type": {
  6560. value: Microsoft.Office.WebExtension.BindingType.Matrix
  6561. },
  6562. "rowCount": {
  6563. value: rows ? rows : 0
  6564. },
  6565. "columnCount": {
  6566. value: cols ? cols : 0
  6567. }
  6568. });
  6569. };
  6570. OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding);
  6571. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6572. type: OSF.DDA.PropertyDescriptors.BindingProperties,
  6573. fromHost: [
  6574. { name: OSF.DDA.BindingProperties.Id, value: 0 },
  6575. { name: OSF.DDA.BindingProperties.Type, value: 1 },
  6576. { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 }
  6577. ],
  6578. isComplexType: true
  6579. });
  6580. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6581. type: Microsoft.Office.WebExtension.Parameters.BindingType,
  6582. toHost: [
  6583. { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 },
  6584. { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 },
  6585. { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 }
  6586. ],
  6587. invertible: true
  6588. });
  6589. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6590. type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,
  6591. fromHost: [
  6592. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6593. ],
  6594. toHost: [
  6595. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6596. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 }
  6597. ]
  6598. });
  6599. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6600. type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,
  6601. fromHost: [
  6602. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6603. ],
  6604. toHost: [
  6605. { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 },
  6606. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 },
  6607. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 },
  6608. { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 }
  6609. ]
  6610. });
  6611. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6612. type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod,
  6613. toHost: [
  6614. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6615. ]
  6616. });
  6617. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6618. type: OSF.DDA.MethodDispId.dispidGetBindingMethod,
  6619. fromHost: [
  6620. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6621. ],
  6622. toHost: [
  6623. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6624. ]
  6625. });
  6626. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6627. type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,
  6628. fromHost: [
  6629. { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6630. ]
  6631. });
  6632. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6633. type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod,
  6634. fromHost: [
  6635. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6636. ],
  6637. toHost: [
  6638. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6639. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  6640. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 },
  6641. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 },
  6642. { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 }
  6643. ]
  6644. });
  6645. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6646. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  6647. toHost: [
  6648. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6649. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  6650. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  6651. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }
  6652. ]
  6653. });
  6654. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6655. type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,
  6656. fromHost: [
  6657. { name: OSF.DDA.BindingProperties.RowCount, value: 0 },
  6658. { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 },
  6659. { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 }
  6660. ],
  6661. isComplexType: true
  6662. });
  6663. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6664. type: OSF.DDA.PropertyDescriptors.Subset,
  6665. toHost: [
  6666. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 },
  6667. { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 }
  6668. ],
  6669. canonical: true,
  6670. isComplexType: true
  6671. });
  6672. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6673. type: OSF.DDA.SafeArray.UniqueArguments.Offset,
  6674. toHost: [
  6675. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 },
  6676. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 }
  6677. ],
  6678. canonical: true,
  6679. isComplexType: true
  6680. });
  6681. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6682. type: OSF.DDA.SafeArray.UniqueArguments.Run,
  6683. toHost: [
  6684. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 },
  6685. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 }
  6686. ],
  6687. canonical: true,
  6688. isComplexType: true
  6689. });
  6690. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6691. type: OSF.DDA.MethodDispId.dispidAddRowsMethod,
  6692. toHost: [
  6693. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6694. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  6695. ]
  6696. });
  6697. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6698. type: OSF.DDA.MethodDispId.dispidAddColumnsMethod,
  6699. toHost: [
  6700. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6701. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  6702. ]
  6703. });
  6704. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6705. type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod,
  6706. toHost: [
  6707. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6708. ]
  6709. });
  6710. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" });
  6711. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  6712. RowCount: "BindingRowCount",
  6713. ColumnCount: "BindingColumnCount",
  6714. HasHeaders: "HasHeaders"
  6715. });
  6716. OSF.DDA.TableDataProperties={
  6717. TableRows: "TableRows",
  6718. TableHeaders: "TableHeaders"
  6719. };
  6720. OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) {
  6721. OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance);
  6722. OSF.OUtil.defineEnumerableProperties(this, {
  6723. "type": {
  6724. value: Microsoft.Office.WebExtension.BindingType.Table
  6725. },
  6726. "rowCount": {
  6727. value: rows ? rows : 0
  6728. },
  6729. "columnCount": {
  6730. value: cols ? cols : 0
  6731. },
  6732. "hasHeaders": {
  6733. value: hasHeaders ? hasHeaders : false
  6734. }
  6735. });
  6736. var am=OSF.DDA.AsyncMethodNames;
  6737. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6738. am.AddRowsAsync,
  6739. am.AddColumnsAsync,
  6740. am.DeleteAllDataValuesAsync
  6741. ]);
  6742. };
  6743. OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding);
  6744. OSF.DDA.AsyncMethodNames.addNames({
  6745. AddRowsAsync: "addRowsAsync",
  6746. AddColumnsAsync: "addColumnsAsync",
  6747. DeleteAllDataValuesAsync: "deleteAllDataValuesAsync"
  6748. });
  6749. (function () {
  6750. function getObjectId(obj) { return obj.id; }
  6751. OSF.DDA.AsyncMethodCalls.define({
  6752. method: OSF.DDA.AsyncMethodNames.AddRowsAsync,
  6753. requiredArguments: [
  6754. {
  6755. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6756. "types": ["object"]
  6757. }
  6758. ],
  6759. supportedOptions: [],
  6760. privateStateCallbacks: [
  6761. {
  6762. name: Microsoft.Office.WebExtension.Parameters.Id,
  6763. value: getObjectId
  6764. }
  6765. ]
  6766. });
  6767. OSF.DDA.AsyncMethodCalls.define({
  6768. method: OSF.DDA.AsyncMethodNames.AddColumnsAsync,
  6769. requiredArguments: [
  6770. {
  6771. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6772. "types": ["object"]
  6773. }
  6774. ],
  6775. supportedOptions: [],
  6776. privateStateCallbacks: [
  6777. {
  6778. name: Microsoft.Office.WebExtension.Parameters.Id,
  6779. value: getObjectId
  6780. }
  6781. ]
  6782. });
  6783. OSF.DDA.AsyncMethodCalls.define({
  6784. method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,
  6785. requiredArguments: [],
  6786. supportedOptions: [],
  6787. privateStateCallbacks: [
  6788. {
  6789. name: Microsoft.Office.WebExtension.Parameters.Id,
  6790. value: getObjectId
  6791. }
  6792. ]
  6793. });
  6794. })();
  6795. OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) {
  6796. OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance);
  6797. OSF.OUtil.defineEnumerableProperty(this, "type", {
  6798. value: Microsoft.Office.WebExtension.BindingType.Text
  6799. });
  6800. };
  6801. OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding);
  6802. OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" });
  6803. OSF.DDA.AsyncMethodCalls.define({
  6804. method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync,
  6805. requiredArguments: [
  6806. {
  6807. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6808. "enum": Microsoft.Office.WebExtension.BindingType
  6809. }
  6810. ],
  6811. supportedOptions: [{
  6812. name: Microsoft.Office.WebExtension.Parameters.Id,
  6813. value: {
  6814. "types": ["string"],
  6815. "calculate": OSF.DDA.generateBindingId
  6816. }
  6817. },
  6818. {
  6819. name: Microsoft.Office.WebExtension.Parameters.PromptText,
  6820. value: {
  6821. "types": ["string"],
  6822. "calculate": function () { return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; }
  6823. }
  6824. },
  6825. {
  6826. name: Microsoft.Office.WebExtension.Parameters.SampleData,
  6827. value: {
  6828. "types": ["object"],
  6829. "defaultValue": null
  6830. }
  6831. }
  6832. ],
  6833. privateStateCallbacks: [],
  6834. onSucceeded: function (bindingDescriptor) { return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); }
  6835. });
  6836. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6837. type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,
  6838. fromHost: [
  6839. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6840. ],
  6841. toHost: [
  6842. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6843. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 },
  6844. { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: 2 }
  6845. ]
  6846. });
  6847. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" });
  6848. OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) {
  6849. OSF.OUtil.defineEnumerableProperties(this, {
  6850. "type": {
  6851. value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged
  6852. },
  6853. "document": {
  6854. value: docInstance
  6855. }
  6856. });
  6857. };
  6858. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent });
  6859. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  6860. BindingSelectionChanged: "bindingSelectionChanged",
  6861. BindingDataChanged: "bindingDataChanged"
  6862. });
  6863. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" });
  6864. OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) {
  6865. OSF.OUtil.defineEnumerableProperties(this, {
  6866. "type": {
  6867. value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged
  6868. },
  6869. "binding": {
  6870. value: bindingInstance
  6871. }
  6872. });
  6873. for (var prop in subset) {
  6874. OSF.OUtil.defineEnumerableProperty(this, prop, {
  6875. value: subset[prop]
  6876. });
  6877. }
  6878. };
  6879. OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) {
  6880. OSF.OUtil.defineEnumerableProperties(this, {
  6881. "type": {
  6882. value: Microsoft.Office.WebExtension.EventType.BindingDataChanged
  6883. },
  6884. "binding": {
  6885. value: bindingInstance
  6886. }
  6887. });
  6888. };
  6889. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6890. type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  6891. fromHost: [
  6892. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 },
  6893. { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 }
  6894. ],
  6895. isComplexType: true
  6896. });
  6897. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6898. type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,
  6899. fromHost: [
  6900. { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6901. ],
  6902. isComplexType: true
  6903. });
  6904. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6905. type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent,
  6906. fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }]
  6907. });
  6908. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" });
  6909. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6910. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  6911. toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }]
  6912. });
  6913. Microsoft.Office.WebExtension.GoToType={
  6914. Binding: "binding",
  6915. NamedItem: "namedItem",
  6916. Slide: "slide",
  6917. Index: "index"
  6918. };
  6919. Microsoft.Office.WebExtension.SelectionMode={
  6920. Default: "default",
  6921. Selected: "selected",
  6922. None: "none"
  6923. };
  6924. Microsoft.Office.WebExtension.Index={
  6925. First: "first",
  6926. Last: "last",
  6927. Next: "next",
  6928. Previous: "previous"
  6929. };
  6930. OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" });
  6931. OSF.DDA.AsyncMethodCalls.define({
  6932. method: OSF.DDA.AsyncMethodNames.GoToByIdAsync,
  6933. requiredArguments: [{
  6934. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6935. "types": ["string", "number"]
  6936. },
  6937. {
  6938. "name": Microsoft.Office.WebExtension.Parameters.GoToType,
  6939. "enum": Microsoft.Office.WebExtension.GoToType
  6940. }
  6941. ],
  6942. supportedOptions: [
  6943. {
  6944. name: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  6945. value: {
  6946. "enum": Microsoft.Office.WebExtension.SelectionMode,
  6947. "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default
  6948. }
  6949. }
  6950. ]
  6951. });
  6952. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6953. type: Microsoft.Office.WebExtension.Parameters.GoToType,
  6954. toHost: [
  6955. { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 },
  6956. { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 },
  6957. { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 },
  6958. { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 }
  6959. ]
  6960. });
  6961. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6962. type: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  6963. toHost: [
  6964. { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 },
  6965. { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 },
  6966. { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 }
  6967. ]
  6968. });
  6969. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6970. type: OSF.DDA.MethodDispId.dispidNavigateToMethod,
  6971. toHost: [
  6972. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6973. { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 },
  6974. { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 }
  6975. ]
  6976. });
  6977. OSF.DDA.AsyncMethodNames.addNames({
  6978. ExecuteRichApiRequestAsync: "executeRichApiRequestAsync"
  6979. });
  6980. OSF.DDA.AsyncMethodCalls.define({
  6981. method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,
  6982. requiredArguments: [
  6983. {
  6984. name: Microsoft.Office.WebExtension.Parameters.Data,
  6985. types: ["object"]
  6986. }
  6987. ],
  6988. supportedOptions: []
  6989. });
  6990. OSF.OUtil.setNamespace("RichApi", OSF.DDA);
  6991. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6992. type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,
  6993. toHost: [
  6994. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }
  6995. ],
  6996. fromHost: [
  6997. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6998. ]
  6999. });
  7000. OSF.DDA.FilePropertiesDescriptor={
  7001. Url: "Url"
  7002. };
  7003. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  7004. FilePropertiesDescriptor: "FilePropertiesDescriptor"
  7005. });
  7006. Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) {
  7007. OSF.OUtil.defineEnumerableProperties(this, {
  7008. "url": {
  7009. value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url]
  7010. }
  7011. });
  7012. };
  7013. OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" });
  7014. OSF.DDA.AsyncMethodCalls.define({
  7015. method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,
  7016. fromHost: [
  7017. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 }
  7018. ],
  7019. requiredArguments: [],
  7020. supportedOptions: [],
  7021. onSucceeded: function (filePropertiesDescriptor, caller, callArgs) {
  7022. return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor);
  7023. }
  7024. });
  7025. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7026. type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,
  7027. fromHost: [
  7028. { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 }
  7029. ],
  7030. isComplexType: true
  7031. });
  7032. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7033. type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,
  7034. fromHost: [
  7035. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  7036. ]
  7037. });
  7038. OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) {
  7039. var am=OSF.DDA.AsyncMethodNames;
  7040. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  7041. am.ClearFormatsAsync,
  7042. am.SetTableOptionsAsync,
  7043. am.SetFormatsAsync
  7044. ]);
  7045. OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders);
  7046. OSF.OUtil.finalizeProperties(this);
  7047. };
  7048. OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding);
  7049. (function () {
  7050. OSF.DDA.AsyncMethodCalls.define({
  7051. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7052. requiredArguments: [
  7053. {
  7054. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7055. "types": ["string", "object", "number", "boolean"]
  7056. }
  7057. ],
  7058. supportedOptions: [{
  7059. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7060. value: {
  7061. "enum": Microsoft.Office.WebExtension.CoercionType,
  7062. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7063. }
  7064. },
  7065. {
  7066. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7067. value: {
  7068. "types": ["object"],
  7069. "defaultValue": []
  7070. }
  7071. },
  7072. {
  7073. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7074. value: {
  7075. "types": ["object"],
  7076. "defaultValue": []
  7077. }
  7078. }
  7079. ],
  7080. privateStateCallbacks: []
  7081. });
  7082. OSF.DDA.AsyncMethodCalls.define({
  7083. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  7084. requiredArguments: [
  7085. {
  7086. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7087. "types": ["string", "object", "number", "boolean"]
  7088. }
  7089. ],
  7090. supportedOptions: [{
  7091. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7092. value: {
  7093. "enum": Microsoft.Office.WebExtension.CoercionType,
  7094. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7095. }
  7096. },
  7097. {
  7098. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7099. value: {
  7100. "types": ["object", "string"],
  7101. "defaultValue": null
  7102. }
  7103. },
  7104. {
  7105. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7106. value: {
  7107. "types": ["object"],
  7108. "defaultValue": null
  7109. }
  7110. },
  7111. {
  7112. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7113. value: {
  7114. "types": ["number"],
  7115. "defaultValue": 0
  7116. }
  7117. },
  7118. {
  7119. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7120. value: {
  7121. "types": ["number"],
  7122. "defaultValue": 0
  7123. }
  7124. },
  7125. {
  7126. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7127. value: {
  7128. "types": ["object"],
  7129. "defaultValue": []
  7130. }
  7131. },
  7132. {
  7133. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7134. value: {
  7135. "types": ["object"],
  7136. "defaultValue": []
  7137. }
  7138. }
  7139. ],
  7140. checkCallArgs: function (callArgs, caller, stateInfo) {
  7141. var Parameters=Microsoft.Office.WebExtension.Parameters;
  7142. if (callArgs[Parameters.StartRow]==0 &&
  7143. callArgs[Parameters.StartColumn]==0 &&
  7144. OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 &&
  7145. OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) {
  7146. delete callArgs[Parameters.StartRow];
  7147. delete callArgs[Parameters.StartColumn];
  7148. delete callArgs[Parameters.CellFormat];
  7149. delete callArgs[Parameters.TableOptions];
  7150. }
  7151. if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7152. ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) ||
  7153. (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) ||
  7154. callArgs[Parameters.CellFormat] ||
  7155. callArgs[Parameters.TableOptions])) {
  7156. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7157. }
  7158. return callArgs;
  7159. },
  7160. privateStateCallbacks: [
  7161. {
  7162. name: Microsoft.Office.WebExtension.Parameters.Id,
  7163. value: function (obj) { return obj.id; }
  7164. }
  7165. ]
  7166. });
  7167. OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function OSF_DDA_BindingPromise$setTableOptionsAsync() {
  7168. var args=arguments;
  7169. this._fetch(function onComplete(binding) { binding.setTableOptionsAsync.apply(binding, args); });
  7170. return this;
  7171. },
  7172. OSF.DDA.BindingPromise.prototype.setFormatsAsync=function OSF_DDA_BindingPromise$setFormatsAsync() {
  7173. var args=arguments;
  7174. this._fetch(function onComplete(binding) { binding.setFormatsAsync.apply(binding, args); });
  7175. return this;
  7176. },
  7177. OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function OSF_DDA_BindingPromise$clearFormatsAsync() {
  7178. var args=arguments;
  7179. this._fetch(function onComplete(binding) { binding.clearFormatsAsync.apply(binding, args); });
  7180. return this;
  7181. };
  7182. })();
  7183. (function () {
  7184. function getObjectId(obj) { return obj.id; }
  7185. OSF.DDA.AsyncMethodNames.addNames({
  7186. ClearFormatsAsync: "clearFormatsAsync",
  7187. SetTableOptionsAsync: "setTableOptionsAsync",
  7188. SetFormatsAsync: "setFormatsAsync"
  7189. });
  7190. OSF.DDA.AsyncMethodCalls.define({
  7191. method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync,
  7192. requiredArguments: [],
  7193. supportedOptions: [],
  7194. privateStateCallbacks: [
  7195. {
  7196. name: Microsoft.Office.WebExtension.Parameters.Id,
  7197. value: getObjectId
  7198. }
  7199. ]
  7200. });
  7201. OSF.DDA.AsyncMethodCalls.define({
  7202. method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,
  7203. requiredArguments: [
  7204. {
  7205. "name": Microsoft.Office.WebExtension.Parameters.TableOptions,
  7206. "defaultValue": []
  7207. }
  7208. ],
  7209. privateStateCallbacks: [
  7210. {
  7211. name: Microsoft.Office.WebExtension.Parameters.Id,
  7212. value: getObjectId
  7213. }
  7214. ]
  7215. });
  7216. OSF.DDA.AsyncMethodCalls.define({
  7217. method: OSF.DDA.AsyncMethodNames.SetFormatsAsync,
  7218. requiredArguments: [
  7219. {
  7220. "name": Microsoft.Office.WebExtension.Parameters.CellFormat,
  7221. "defaultValue": []
  7222. }
  7223. ],
  7224. privateStateCallbacks: [
  7225. {
  7226. name: Microsoft.Office.WebExtension.Parameters.Id,
  7227. value: getObjectId
  7228. }
  7229. ]
  7230. });
  7231. })();
  7232. Microsoft.Office.WebExtension.Table={
  7233. All: 0,
  7234. Data: 1,
  7235. Headers: 2
  7236. };
  7237. (function () {
  7238. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7239. type: OSF.DDA.MethodDispId.dispidClearFormatsMethod,
  7240. toHost: [
  7241. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  7242. ]
  7243. });
  7244. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7245. type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,
  7246. toHost: [
  7247. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7248. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 1 },
  7249. ]
  7250. });
  7251. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7252. type: OSF.DDA.MethodDispId.dispidSetFormatsMethod,
  7253. toHost: [
  7254. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7255. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 1 },
  7256. ]
  7257. });
  7258. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7259. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  7260. toHost: [
  7261. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  7262. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  7263. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 2 },
  7264. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 3 }
  7265. ]
  7266. });
  7267. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7268. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  7269. toHost: [
  7270. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7271. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  7272. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  7273. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 },
  7274. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 4 },
  7275. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 5 }
  7276. ]
  7277. });
  7278. var tableOptionProperties={
  7279. headerRow: 0,
  7280. bandedRows: 1,
  7281. firstColumn: 2,
  7282. lastColumn: 3,
  7283. bandedColumns: 4,
  7284. filterButton: 5,
  7285. style: 6,
  7286. totalRow: 7
  7287. };
  7288. var cellProperties={
  7289. row: 0,
  7290. column: 1
  7291. };
  7292. var formatProperties={
  7293. alignHorizontal: { text: "alignHorizontal", type: 1 },
  7294. alignVertical: { text: "alignVertical", type: 2 },
  7295. backgroundColor: { text: "backgroundColor", type: 101 },
  7296. borderStyle: { text: "borderStyle", type: 201 },
  7297. borderColor: { text: "borderColor", type: 202 },
  7298. borderTopStyle: { text: "borderTopStyle", type: 203 },
  7299. borderTopColor: { text: "borderTopColor", type: 204 },
  7300. borderBottomStyle: { text: "borderBottomStyle", type: 205 },
  7301. borderBottomColor: { text: "borderBottomColor", type: 206 },
  7302. borderLeftStyle: { text: "borderLeftStyle", type: 207 },
  7303. borderLeftColor: { text: "borderLeftColor", type: 208 },
  7304. borderRightStyle: { text: "borderRightStyle", type: 209 },
  7305. borderRightColor: { text: "borderRightColor", type: 210 },
  7306. borderOutlineStyle: { text: "borderOutlineStyle", type: 211 },
  7307. borderOutlineColor: { text: "borderOutlineColor", type: 212 },
  7308. borderInlineStyle: { text: "borderInlineStyle", type: 213 },
  7309. borderInlineColor: { text: "borderInlineColor", type: 214 },
  7310. fontFamily: { text: "fontFamily", type: 301 },
  7311. fontStyle: { text: "fontStyle", type: 302 },
  7312. fontSize: { text: "fontSize", type: 303 },
  7313. fontUnderlineStyle: { text: "fontUnderlineStyle", type: 304 },
  7314. fontColor: { text: "fontColor", type: 305 },
  7315. fontDirection: { text: "fontDirection", type: 306 },
  7316. fontStrikethrough: { text: "fontStrikethrough", type: 307 },
  7317. fontSuperscript: { text: "fontSuperscript", type: 308 },
  7318. fontSubscript: { text: "fontSubscript", type: 309 },
  7319. fontNormal: { text: "fontNormal", type: 310 },
  7320. indentLeft: { text: "indentLeft", type: 401 },
  7321. indentRight: { text: "indentRight", type: 402 },
  7322. numberFormat: { text: "numberFormat", type: 501 },
  7323. width: { text: "width", type: 701 },
  7324. height: { text: "height", type: 702 },
  7325. wrapping: { text: "wrapping", type: 703 }
  7326. };
  7327. var borderStyleSet=[
  7328. { name: "none", value: 0 },
  7329. { name: "thin", value: 1 },
  7330. { name: "medium", value: 2 },
  7331. { name: "dashed", value: 3 },
  7332. { name: "dotted", value: 4 },
  7333. { name: "thick", value: 5 },
  7334. { name: "double", value: 6 },
  7335. { name: "hair", value: 7 },
  7336. { name: "medium dashed", value: 8 },
  7337. { name: "dash dot", value: 9 },
  7338. { name: "medium dash dot", value: 10 },
  7339. { name: "dash dot dot", value: 11 },
  7340. { name: "medium dash dot dot", value: 12 },
  7341. { name: "slant dash dot", value: 13 },
  7342. ];
  7343. var colorSet=[
  7344. { name: "none", value: 0 },
  7345. { name: "black", value: 1 },
  7346. { name: "blue", value: 2 },
  7347. { name: "gray", value: 3 },
  7348. { name: "green", value: 4 },
  7349. { name: "orange", value: 5 },
  7350. { name: "pink", value: 6 },
  7351. { name: "purple", value: 7 },
  7352. { name: "red", value: 8 },
  7353. { name: "teal", value: 9 },
  7354. { name: "turquoise", value: 10 },
  7355. { name: "violet", value: 11 },
  7356. { name: "white", value: 12 },
  7357. { name: "yellow", value: 13 },
  7358. { name: "automatic", value: 14 },
  7359. ];
  7360. var ns=OSF.DDA.SafeArray.Delegate.ParameterMap;
  7361. ns.define({
  7362. type: formatProperties.alignHorizontal.text,
  7363. toHost: [
  7364. { name: "general", value: 0 },
  7365. { name: "left", value: 1 },
  7366. { name: "center", value: 2 },
  7367. { name: "right", value: 3 },
  7368. { name: "fill", value: 4 },
  7369. { name: "justify", value: 5 },
  7370. { name: "center across selection", value: 6 },
  7371. { name: "distributed", value: 7 },
  7372. ] });
  7373. ns.define({
  7374. type: formatProperties.alignVertical.text,
  7375. toHost: [
  7376. { name: "top", value: 0 },
  7377. { name: "center", value: 1 },
  7378. { name: "bottom", value: 2 },
  7379. { name: "justify", value: 3 },
  7380. { name: "distributed", value: 4 },
  7381. ] });
  7382. ns.define({
  7383. type: formatProperties.backgroundColor.text,
  7384. toHost: colorSet
  7385. });
  7386. ns.define({
  7387. type: formatProperties.borderStyle.text,
  7388. toHost: borderStyleSet
  7389. });
  7390. ns.define({
  7391. type: formatProperties.borderColor.text,
  7392. toHost: colorSet
  7393. });
  7394. ns.define({
  7395. type: formatProperties.borderTopStyle.text,
  7396. toHost: borderStyleSet
  7397. });
  7398. ns.define({
  7399. type: formatProperties.borderTopColor.text,
  7400. toHost: colorSet
  7401. });
  7402. ns.define({
  7403. type: formatProperties.borderBottomStyle.text,
  7404. toHost: borderStyleSet
  7405. });
  7406. ns.define({
  7407. type: formatProperties.borderBottomColor.text,
  7408. toHost: colorSet
  7409. });
  7410. ns.define({
  7411. type: formatProperties.borderLeftStyle.text,
  7412. toHost: borderStyleSet
  7413. });
  7414. ns.define({
  7415. type: formatProperties.borderLeftColor.text,
  7416. toHost: colorSet
  7417. });
  7418. ns.define({
  7419. type: formatProperties.borderRightStyle.text,
  7420. toHost: borderStyleSet
  7421. });
  7422. ns.define({
  7423. type: formatProperties.borderRightColor.text,
  7424. toHost: colorSet
  7425. });
  7426. ns.define({
  7427. type: formatProperties.borderOutlineStyle.text,
  7428. toHost: borderStyleSet
  7429. });
  7430. ns.define({
  7431. type: formatProperties.borderOutlineColor.text,
  7432. toHost: colorSet
  7433. });
  7434. ns.define({
  7435. type: formatProperties.borderInlineStyle.text,
  7436. toHost: borderStyleSet
  7437. });
  7438. ns.define({
  7439. type: formatProperties.borderInlineColor.text,
  7440. toHost: colorSet
  7441. });
  7442. ns.define({
  7443. type: formatProperties.fontStyle.text,
  7444. toHost: [
  7445. { name: "regular", value: 0 },
  7446. { name: "italic", value: 1 },
  7447. { name: "bold", value: 2 },
  7448. { name: "bold italic", value: 3 },
  7449. ] });
  7450. ns.define({
  7451. type: formatProperties.fontUnderlineStyle.text,
  7452. toHost: [
  7453. { name: "none", value: 0 },
  7454. { name: "single", value: 1 },
  7455. { name: "double", value: 2 },
  7456. { name: "single accounting", value: 3 },
  7457. { name: "double accounting", value: 4 },
  7458. ] });
  7459. ns.define({
  7460. type: formatProperties.fontColor.text,
  7461. toHost: colorSet
  7462. });
  7463. ns.define({
  7464. type: formatProperties.fontDirection.text,
  7465. toHost: [
  7466. { name: "context", value: 0 },
  7467. { name: "left-to-right", value: 1 },
  7468. { name: "right-to-left", value: 2 },
  7469. ] });
  7470. ns.define({
  7471. type: formatProperties.width.text,
  7472. toHost: [
  7473. { name: "auto fit", value: -1 },
  7474. ] });
  7475. ns.define({
  7476. type: formatProperties.height.text,
  7477. toHost: [
  7478. { name: "auto fit", value: -1 },
  7479. ] });
  7480. ns.define({
  7481. type: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7482. toHost: [
  7483. { name: "headerRow", value: 0 },
  7484. { name: "bandedRows", value: 1 },
  7485. { name: "firstColumn", value: 2 },
  7486. { name: "lastColumn", value: 3 },
  7487. { name: "bandedColumns", value: 4 },
  7488. { name: "filterButton", value: 5 },
  7489. { name: "style", value: 6 },
  7490. { name: "totalRow", value: 7 }
  7491. ] });
  7492. ns.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={
  7493. toHost: function (data) {
  7494. for (var entry in data) {
  7495. if (data[entry].format) {
  7496. data[entry].format=ns.doMapValues(data[entry].format, "toHost");
  7497. }
  7498. }
  7499. return data;
  7500. },
  7501. fromHost: function (args) {
  7502. return args;
  7503. }
  7504. };
  7505. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.CellFormat, {
  7506. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) {
  7507. var textCells="cells";
  7508. var textFormat="format";
  7509. var posCells=0;
  7510. var posFormat=1;
  7511. var ret=[];
  7512. for (var index in cellFormats) {
  7513. var cfOld=cellFormats[index];
  7514. var cfNew=[];
  7515. if (typeof (cfOld[textCells]) !=='undefined') {
  7516. var cellsOld=cfOld[textCells];
  7517. var cellsNew;
  7518. if (typeof cfOld[textCells]==="object") {
  7519. cellsNew=[];
  7520. for (var entry in cellsOld) {
  7521. if (typeof (cellProperties[entry]) !=='undefined') {
  7522. cellsNew[cellProperties[entry]]=cellsOld[entry];
  7523. }
  7524. }
  7525. }
  7526. else {
  7527. cellsNew=cellsOld;
  7528. }
  7529. cfNew[posCells]=cellsNew;
  7530. }
  7531. if (cfOld[textFormat]) {
  7532. var formatOld=cfOld[textFormat];
  7533. var formatNew=[];
  7534. for (var entry2 in formatOld) {
  7535. if (typeof (formatProperties[entry2]) !=='undefined') {
  7536. formatNew.push([
  7537. formatProperties[entry2].type,
  7538. formatOld[entry2]
  7539. ]);
  7540. }
  7541. }
  7542. cfNew[posFormat]=formatNew;
  7543. }
  7544. ret[index]=cfNew;
  7545. }
  7546. return ret;
  7547. },
  7548. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) {
  7549. return hostArgs;
  7550. }
  7551. });
  7552. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.TableOptions, {
  7553. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) {
  7554. var ret=[];
  7555. for (var entry in tableOptions) {
  7556. if (typeof (tableOptionProperties[entry]) !=='undefined') {
  7557. ret[tableOptionProperties[entry]]=tableOptions[entry];
  7558. }
  7559. }
  7560. return ret;
  7561. },
  7562. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) {
  7563. return hostArgs;
  7564. }
  7565. });
  7566. })();
  7567. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Image: "image" });
  7568. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7569. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7570. toHost: [
  7571. { name: Microsoft.Office.WebExtension.CoercionType.Image, value: 8 }
  7572. ]
  7573. });
  7574. OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) {
  7575. var bf=new OSF.DDA.BindingFacade(this);
  7576. OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);
  7577. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]);
  7578. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);
  7579. OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings);
  7580. OSF.OUtil.finalizeProperties(this);
  7581. };
  7582. OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument);
  7583. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) {
  7584. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  7585. appContext.doc=new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(true));
  7586. OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);
  7587. appReady();
  7588. };
  7589. (function () {
  7590. OSF.DDA.AsyncMethodCalls.define({
  7591. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7592. requiredArguments: [
  7593. {
  7594. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7595. "types": ["string", "object", "number", "boolean"]
  7596. }
  7597. ],
  7598. supportedOptions: [{
  7599. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7600. value: {
  7601. "enum": Microsoft.Office.WebExtension.CoercionType,
  7602. "calculate": function (requiredArgs) {
  7603. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  7604. }
  7605. }
  7606. },
  7607. {
  7608. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7609. value: {
  7610. "types": ["number", "object"],
  7611. "defaultValue": []
  7612. }
  7613. },
  7614. {
  7615. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7616. value: {
  7617. "types": ["number", "object"],
  7618. "defaultValue": []
  7619. }
  7620. },
  7621. {
  7622. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  7623. value: {
  7624. "types": ["number", "boolean"],
  7625. "defaultValue": false
  7626. }
  7627. },
  7628. {
  7629. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  7630. value: {
  7631. "types": ["number", "boolean"],
  7632. "defaultValue": false
  7633. }
  7634. }
  7635. ],
  7636. privateStateCallbacks: []
  7637. });
  7638. })();
  7639. var OfficeExtension;
  7640. (function (OfficeExtension) {
  7641. var Action=(function () {
  7642. function Action(actionInfo, isWriteOperation) {
  7643. this.m_actionInfo=actionInfo;
  7644. this.m_isWriteOperation=isWriteOperation;
  7645. }
  7646. Object.defineProperty(Action.prototype, "actionInfo", {
  7647. get: function () {
  7648. return this.m_actionInfo;
  7649. },
  7650. enumerable: true,
  7651. configurable: true
  7652. });
  7653. Object.defineProperty(Action.prototype, "isWriteOperation", {
  7654. get: function () {
  7655. return this.m_isWriteOperation;
  7656. },
  7657. enumerable: true,
  7658. configurable: true
  7659. });
  7660. return Action;
  7661. })();
  7662. OfficeExtension.Action=Action;
  7663. })(OfficeExtension || (OfficeExtension={}));
  7664. var OfficeExtension;
  7665. (function (OfficeExtension) {
  7666. var ActionFactory=(function () {
  7667. function ActionFactory() {
  7668. }
  7669. ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) {
  7670. OfficeExtension.Utility.validateObjectPath(parent);
  7671. var actionInfo={
  7672. Id: context._nextId(),
  7673. ActionType: 4 ,
  7674. Name: propertyName,
  7675. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7676. ArgumentInfo: {}
  7677. };
  7678. var args=[value];
  7679. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  7680. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  7681. var ret=new OfficeExtension.Action(actionInfo, true);
  7682. context._pendingRequest.addAction(ret);
  7683. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7684. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  7685. return ret;
  7686. };
  7687. ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) {
  7688. OfficeExtension.Utility.validateObjectPath(parent);
  7689. var actionInfo={
  7690. Id: context._nextId(),
  7691. ActionType: 3 ,
  7692. Name: methodName,
  7693. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7694. ArgumentInfo: {}
  7695. };
  7696. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  7697. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  7698. var isWriteOperation=operationType !=1 ;
  7699. var ret=new OfficeExtension.Action(actionInfo, isWriteOperation);
  7700. context._pendingRequest.addAction(ret);
  7701. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7702. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  7703. return ret;
  7704. };
  7705. ActionFactory.createQueryAction=function (context, parent, queryOption) {
  7706. OfficeExtension.Utility.validateObjectPath(parent);
  7707. var actionInfo={
  7708. Id: context._nextId(),
  7709. ActionType: 2 ,
  7710. Name: "",
  7711. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7712. };
  7713. actionInfo.QueryInfo=queryOption;
  7714. var ret=new OfficeExtension.Action(actionInfo, false);
  7715. context._pendingRequest.addAction(ret);
  7716. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7717. return ret;
  7718. };
  7719. ActionFactory.createRecursiveQueryAction=function (context, parent, query) {
  7720. OfficeExtension.Utility.validateObjectPath(parent);
  7721. var actionInfo={
  7722. Id: context._nextId(),
  7723. ActionType: 6 ,
  7724. Name: "",
  7725. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7726. RecursiveQueryInfo: query
  7727. };
  7728. var ret=new OfficeExtension.Action(actionInfo, false);
  7729. context._pendingRequest.addAction(ret);
  7730. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7731. return ret;
  7732. };
  7733. ActionFactory.createInstantiateAction=function (context, obj) {
  7734. OfficeExtension.Utility.validateObjectPath(obj);
  7735. var actionInfo={
  7736. Id: context._nextId(),
  7737. ActionType: 1 ,
  7738. Name: "",
  7739. ObjectPathId: obj._objectPath.objectPathInfo.Id
  7740. };
  7741. var ret=new OfficeExtension.Action(actionInfo, false);
  7742. context._pendingRequest.addAction(ret);
  7743. context._pendingRequest.addReferencedObjectPath(obj._objectPath);
  7744. context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj));
  7745. return ret;
  7746. };
  7747. ActionFactory.createTraceAction=function (context, message, addTraceMessage) {
  7748. var actionInfo={
  7749. Id: context._nextId(),
  7750. ActionType: 5 ,
  7751. Name: "Trace",
  7752. ObjectPathId: 0
  7753. };
  7754. var ret=new OfficeExtension.Action(actionInfo, false);
  7755. context._pendingRequest.addAction(ret);
  7756. if (addTraceMessage) {
  7757. context._pendingRequest.addTrace(actionInfo.Id, message);
  7758. }
  7759. return ret;
  7760. };
  7761. return ActionFactory;
  7762. })();
  7763. OfficeExtension.ActionFactory=ActionFactory;
  7764. })(OfficeExtension || (OfficeExtension={}));
  7765. var OfficeExtension;
  7766. (function (OfficeExtension) {
  7767. var ClientObject=(function () {
  7768. function ClientObject(context, objectPath) {
  7769. OfficeExtension.Utility.checkArgumentNull(context, "context");
  7770. this.m_context=context;
  7771. this.m_objectPath=objectPath;
  7772. if (this.m_objectPath) {
  7773. if (!context._processingResult) {
  7774. OfficeExtension.ActionFactory.createInstantiateAction(context, this);
  7775. if ((context._autoCleanup) && (this._KeepReference)) {
  7776. context.trackedObjects._autoAdd(this);
  7777. }
  7778. }
  7779. }
  7780. }
  7781. Object.defineProperty(ClientObject.prototype, "context", {
  7782. get: function () {
  7783. return this.m_context;
  7784. },
  7785. enumerable: true,
  7786. configurable: true
  7787. });
  7788. Object.defineProperty(ClientObject.prototype, "_objectPath", {
  7789. get: function () {
  7790. return this.m_objectPath;
  7791. },
  7792. set: function (value) {
  7793. this.m_objectPath=value;
  7794. },
  7795. enumerable: true,
  7796. configurable: true
  7797. });
  7798. Object.defineProperty(ClientObject.prototype, "isNull", {
  7799. get: function () {
  7800. OfficeExtension.Utility.throwIfNotLoaded("isNull", this._isNull, null, this._isNull);
  7801. return this._isNull;
  7802. },
  7803. enumerable: true,
  7804. configurable: true
  7805. });
  7806. Object.defineProperty(ClientObject.prototype, "isNullObject", {
  7807. get: function () {
  7808. OfficeExtension.Utility.throwIfNotLoaded("isNullObject", this._isNull, null, this._isNull);
  7809. return this._isNull;
  7810. },
  7811. enumerable: true,
  7812. configurable: true
  7813. });
  7814. Object.defineProperty(ClientObject.prototype, "_isNull", {
  7815. get: function () {
  7816. return this.m_isNull;
  7817. },
  7818. set: function (value) {
  7819. this.m_isNull=value;
  7820. if (value && this.m_objectPath) {
  7821. this.m_objectPath._updateAsNullObject();
  7822. }
  7823. },
  7824. enumerable: true,
  7825. configurable: true
  7826. });
  7827. ClientObject.prototype._handleResult=function (value) {
  7828. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  7829. };
  7830. ClientObject.prototype._handleIdResult=function (value) {
  7831. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  7832. OfficeExtension.Utility.fixObjectPathIfNecessary(this, value);
  7833. if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this._initReferenceId) {
  7834. this._initReferenceId(value[OfficeExtension.Constants.referenceId]);
  7835. }
  7836. };
  7837. return ClientObject;
  7838. })();
  7839. OfficeExtension.ClientObject=ClientObject;
  7840. })(OfficeExtension || (OfficeExtension={}));
  7841. var OfficeExtension;
  7842. (function (OfficeExtension) {
  7843. var ClientRequest=(function () {
  7844. function ClientRequest(context) {
  7845. this.m_context=context;
  7846. this.m_actions=[];
  7847. this.m_actionResultHandler={};
  7848. this.m_referencedObjectPaths={};
  7849. this.m_flags=0 ;
  7850. this.m_traceInfos={};
  7851. this.m_pendingProcessEventHandlers=[];
  7852. this.m_pendingEventHandlerActions={};
  7853. this.m_responseTraceIds={};
  7854. this.m_responseTraceMessages=[];
  7855. }
  7856. Object.defineProperty(ClientRequest.prototype, "flags", {
  7857. get: function () {
  7858. return this.m_flags;
  7859. },
  7860. enumerable: true,
  7861. configurable: true
  7862. });
  7863. Object.defineProperty(ClientRequest.prototype, "traceInfos", {
  7864. get: function () {
  7865. return this.m_traceInfos;
  7866. },
  7867. enumerable: true,
  7868. configurable: true
  7869. });
  7870. Object.defineProperty(ClientRequest.prototype, "_responseTraceMessages", {
  7871. get: function () {
  7872. return this.m_responseTraceMessages;
  7873. },
  7874. enumerable: true,
  7875. configurable: true
  7876. });
  7877. Object.defineProperty(ClientRequest.prototype, "_responseTraceIds", {
  7878. get: function () {
  7879. return this.m_responseTraceIds;
  7880. },
  7881. enumerable: true,
  7882. configurable: true
  7883. });
  7884. ClientRequest.prototype._setResponseTraceIds=function (value) {
  7885. if (value) {
  7886. for (var i=0; i < value.length; i++) {
  7887. var traceId=value[i];
  7888. this.m_responseTraceIds[traceId]=traceId;
  7889. var message=this.m_traceInfos[traceId];
  7890. if (!OfficeExtension.Utility.isNullOrUndefined(message)) {
  7891. this.m_responseTraceMessages.push(message);
  7892. }
  7893. }
  7894. }
  7895. };
  7896. ClientRequest.prototype.addAction=function (action) {
  7897. if (action.isWriteOperation) {
  7898. this.m_flags=this.m_flags | 1 ;
  7899. }
  7900. this.m_actions.push(action);
  7901. };
  7902. Object.defineProperty(ClientRequest.prototype, "hasActions", {
  7903. get: function () {
  7904. return this.m_actions.length > 0;
  7905. },
  7906. enumerable: true,
  7907. configurable: true
  7908. });
  7909. ClientRequest.prototype.addTrace=function (actionId, message) {
  7910. this.m_traceInfos[actionId]=message;
  7911. };
  7912. ClientRequest.prototype.addReferencedObjectPath=function (objectPath) {
  7913. if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) {
  7914. return;
  7915. }
  7916. if (!objectPath.isValid) {
  7917. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath));
  7918. }
  7919. while (objectPath) {
  7920. if (objectPath.isWriteOperation) {
  7921. this.m_flags=this.m_flags | 1 ;
  7922. }
  7923. this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath;
  7924. if (objectPath.objectPathInfo.ObjectPathType==3 ) {
  7925. this.addReferencedObjectPaths(objectPath.argumentObjectPaths);
  7926. }
  7927. objectPath=objectPath.parentObjectPath;
  7928. }
  7929. };
  7930. ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) {
  7931. if (objectPaths) {
  7932. for (var i=0; i < objectPaths.length; i++) {
  7933. this.addReferencedObjectPath(objectPaths[i]);
  7934. }
  7935. }
  7936. };
  7937. ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) {
  7938. this.m_actionResultHandler[action.actionInfo.Id]=resultHandler;
  7939. };
  7940. ClientRequest.prototype.buildRequestMessageBody=function () {
  7941. var objectPaths={};
  7942. for (var i in this.m_referencedObjectPaths) {
  7943. objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo;
  7944. }
  7945. var actions=[];
  7946. for (var index=0; index < this.m_actions.length; index++) {
  7947. actions.push(this.m_actions[index].actionInfo);
  7948. }
  7949. var ret={
  7950. Actions: actions,
  7951. ObjectPaths: objectPaths
  7952. };
  7953. return ret;
  7954. };
  7955. ClientRequest.prototype.processResponse=function (msg) {
  7956. if (msg && msg.Results) {
  7957. for (var i=0; i < msg.Results.length; i++) {
  7958. var actionResult=msg.Results[i];
  7959. var handler=this.m_actionResultHandler[actionResult.ActionId];
  7960. if (handler) {
  7961. handler._handleResult(actionResult.Value);
  7962. }
  7963. }
  7964. }
  7965. };
  7966. ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () {
  7967. for (var i in this.m_referencedObjectPaths) {
  7968. if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) {
  7969. this.m_referencedObjectPaths[i].isValid=false;
  7970. }
  7971. }
  7972. };
  7973. ClientRequest.prototype._addPendingEventHandlerAction=function (eventHandlers, action) {
  7974. if (!this.m_pendingEventHandlerActions[eventHandlers._id]) {
  7975. this.m_pendingEventHandlerActions[eventHandlers._id]=[];
  7976. this.m_pendingProcessEventHandlers.push(eventHandlers);
  7977. }
  7978. this.m_pendingEventHandlerActions[eventHandlers._id].push(action);
  7979. };
  7980. Object.defineProperty(ClientRequest.prototype, "_pendingProcessEventHandlers", {
  7981. get: function () {
  7982. return this.m_pendingProcessEventHandlers;
  7983. },
  7984. enumerable: true,
  7985. configurable: true
  7986. });
  7987. ClientRequest.prototype._getPendingEventHandlerActions=function (eventHandlers) {
  7988. return this.m_pendingEventHandlerActions[eventHandlers._id];
  7989. };
  7990. return ClientRequest;
  7991. })();
  7992. OfficeExtension.ClientRequest=ClientRequest;
  7993. })(OfficeExtension || (OfficeExtension={}));
  7994. var OfficeExtension;
  7995. (function (OfficeExtension) {
  7996. var _requestExecutorFactory;
  7997. function _setRequestExecutorFactory(reqExecFactory) {
  7998. _requestExecutorFactory=reqExecFactory;
  7999. }
  8000. OfficeExtension._setRequestExecutorFactory=_setRequestExecutorFactory;
  8001. var ClientRequestContext=(function () {
  8002. function ClientRequestContext(url) {
  8003. this.m_requestHeaders={};
  8004. this._onRunFinishedNotifiers=[];
  8005. this.m_nextId=0;
  8006. if (OfficeExtension.Utility.isNullOrUndefined(url) || typeof (url)==="string" && url.length===0) {
  8007. var defaultUrlAndHeaders=ClientRequestContext.defaultRequestUrlAndHeaders;
  8008. if (defaultUrlAndHeaders && !OfficeExtension.Utility.isNullOrEmptyString(defaultUrlAndHeaders.url)) {
  8009. this.m_url=defaultUrlAndHeaders.url;
  8010. if (defaultUrlAndHeaders.headers) {
  8011. for (var key in defaultUrlAndHeaders.headers) {
  8012. this.m_requestHeaders[key]=defaultUrlAndHeaders.headers[key];
  8013. }
  8014. }
  8015. }
  8016. else {
  8017. this.m_url=OfficeExtension.Constants.localDocument;
  8018. }
  8019. }
  8020. else if (typeof (url)==="string") {
  8021. this.m_url=url;
  8022. }
  8023. else {
  8024. var requestInfo=url;
  8025. if (OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url)) {
  8026. throw OfficeExtension.Utility.createInvalidArgumentException("url");
  8027. }
  8028. this.m_url=requestInfo.url;
  8029. if (requestInfo.headers) {
  8030. for (var key in requestInfo.headers) {
  8031. this.m_requestHeaders[key]=requestInfo.headers[key];
  8032. }
  8033. }
  8034. }
  8035. this._processingResult=false;
  8036. this._customData=OfficeExtension.Constants.iterativeExecutor;
  8037. if (_requestExecutorFactory) {
  8038. this._requestExecutor=_requestExecutorFactory();
  8039. }
  8040. else {
  8041. if (OfficeExtension.Utility._isLocalDocumentUrl(this.m_url)) {
  8042. this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  8043. }
  8044. else {
  8045. this._requestExecutor=new OfficeExtension.HttpRequestExecutor();
  8046. }
  8047. }
  8048. this.sync=this.sync.bind(this);
  8049. }
  8050. Object.defineProperty(ClientRequestContext.prototype, "_url", {
  8051. get: function () {
  8052. return this.m_url;
  8053. },
  8054. enumerable: true,
  8055. configurable: true
  8056. });
  8057. Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", {
  8058. get: function () {
  8059. if (this.m_pendingRequest==null) {
  8060. this.m_pendingRequest=new OfficeExtension.ClientRequest(this);
  8061. }
  8062. return this.m_pendingRequest;
  8063. },
  8064. enumerable: true,
  8065. configurable: true
  8066. });
  8067. Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", {
  8068. get: function () {
  8069. if (!this.m_trackedObjects) {
  8070. this.m_trackedObjects=new OfficeExtension.TrackedObjects(this);
  8071. }
  8072. return this.m_trackedObjects;
  8073. },
  8074. enumerable: true,
  8075. configurable: true
  8076. });
  8077. Object.defineProperty(ClientRequestContext.prototype, "requestHeaders", {
  8078. get: function () {
  8079. return this.m_requestHeaders;
  8080. },
  8081. enumerable: true,
  8082. configurable: true
  8083. });
  8084. ClientRequestContext.prototype.load=function (clientObj, option) {
  8085. OfficeExtension.Utility.validateContext(this, clientObj);
  8086. var queryOption=ClientRequestContext.parseQueryOption(option);
  8087. var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption);
  8088. this._pendingRequest.addActionResultHandler(action, clientObj);
  8089. };
  8090. ClientRequestContext.parseQueryOption=function (option) {
  8091. var queryOption={};
  8092. if (typeof (option)=="string") {
  8093. var select=option;
  8094. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(select);
  8095. }
  8096. else if (Array.isArray(option)) {
  8097. queryOption.Select=option;
  8098. }
  8099. else if (typeof (option)=="object") {
  8100. var loadOption=option;
  8101. if (typeof (loadOption.select)=="string") {
  8102. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(loadOption.select);
  8103. }
  8104. else if (Array.isArray(loadOption.select)) {
  8105. queryOption.Select=loadOption.select;
  8106. }
  8107. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) {
  8108. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select");
  8109. }
  8110. if (typeof (loadOption.expand)=="string") {
  8111. queryOption.Expand=OfficeExtension.Utility._parseSelectExpand(loadOption.expand);
  8112. }
  8113. else if (Array.isArray(loadOption.expand)) {
  8114. queryOption.Expand=loadOption.expand;
  8115. }
  8116. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) {
  8117. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand");
  8118. }
  8119. if (typeof (loadOption.top)=="number") {
  8120. queryOption.Top=loadOption.top;
  8121. }
  8122. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) {
  8123. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top");
  8124. }
  8125. if (typeof (loadOption.skip)=="number") {
  8126. queryOption.Skip=loadOption.skip;
  8127. }
  8128. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) {
  8129. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip");
  8130. }
  8131. }
  8132. else if (!OfficeExtension.Utility.isNullOrUndefined(option)) {
  8133. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option");
  8134. }
  8135. return queryOption;
  8136. };
  8137. ClientRequestContext.prototype.loadRecursive=function (clientObj, options, maxDepth) {
  8138. if (!OfficeExtension.Utility.isPlainJsonObject(options)) {
  8139. throw OfficeExtension.Utility.createInvalidArgumentException("options");
  8140. }
  8141. var quries={};
  8142. for (var key in options) {
  8143. quries[key]=ClientRequestContext.parseQueryOption(options[key]);
  8144. }
  8145. var action=OfficeExtension.ActionFactory.createRecursiveQueryAction(this, clientObj, { Queries: quries, MaxDepth: maxDepth });
  8146. this._pendingRequest.addActionResultHandler(action, clientObj);
  8147. };
  8148. ClientRequestContext.prototype.trace=function (message) {
  8149. OfficeExtension.ActionFactory.createTraceAction(this, message, true);
  8150. };
  8151. ClientRequestContext.prototype.syncPrivate=function () {
  8152. var _this=this;
  8153. var req=this._pendingRequest;
  8154. this.m_pendingRequest=null;
  8155. if (!req.hasActions) {
  8156. return this.processPendingEventHandlers(req);
  8157. }
  8158. var msgBody=req.buildRequestMessageBody();
  8159. var requestFlags=req.flags;
  8160. var requestExecutor=this._requestExecutor;
  8161. if (!requestExecutor) {
  8162. requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  8163. }
  8164. var requestExecutorRequestMessage={
  8165. Url: this.m_url,
  8166. Headers: this.m_requestHeaders,
  8167. Body: msgBody
  8168. };
  8169. req.invalidatePendingInvalidObjectPaths();
  8170. var errorFromResponse=null;
  8171. var errorFromProcessEventHandlers=null;
  8172. return requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage).then(function (response) {
  8173. errorFromResponse=_this.processRequestExecutorResponseMessage(req, response);
  8174. return _this.processPendingEventHandlers(req).catch(function (ex) {
  8175. OfficeExtension.Utility.log("Error in processPendingEventHandlers");
  8176. OfficeExtension.Utility.log(JSON.stringify(ex));
  8177. errorFromProcessEventHandlers=ex;
  8178. });
  8179. }).then(function () {
  8180. if (errorFromResponse) {
  8181. OfficeExtension.Utility.log("Throw error from response: "+JSON.stringify(errorFromResponse));
  8182. throw errorFromResponse;
  8183. }
  8184. if (errorFromProcessEventHandlers) {
  8185. OfficeExtension.Utility.log("Throw error from ProcessEventHandler: "+JSON.stringify(errorFromProcessEventHandlers));
  8186. var transformedError=null;
  8187. if (errorFromProcessEventHandlers instanceof OfficeExtension.Error) {
  8188. transformedError=errorFromProcessEventHandlers;
  8189. transformedError.traceMessages=req._responseTraceMessages;
  8190. }
  8191. else {
  8192. var message=null;
  8193. if (typeof (errorFromProcessEventHandlers)==="string") {
  8194. message=errorFromProcessEventHandlers;
  8195. }
  8196. else {
  8197. message=errorFromProcessEventHandlers.message;
  8198. }
  8199. if (OfficeExtension.Utility.isNullOrEmptyString(message)) {
  8200. message=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.cannotRegisterEvent);
  8201. }
  8202. transformedError=new OfficeExtension._Internal.RuntimeError(OfficeExtension.ErrorCodes.cannotRegisterEvent, message, req._responseTraceMessages, {});
  8203. }
  8204. throw transformedError;
  8205. }
  8206. });
  8207. };
  8208. ClientRequestContext.prototype.processRequestExecutorResponseMessage=function (req, response) {
  8209. if (response.Body && response.Body.TraceIds) {
  8210. req._setResponseTraceIds(response.Body.TraceIds);
  8211. }
  8212. var traceMessages=req._responseTraceMessages;
  8213. if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) {
  8214. return new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {});
  8215. }
  8216. else if (response.Body && response.Body.Error) {
  8217. return new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, {
  8218. errorLocation: response.Body.Error.Location
  8219. });
  8220. }
  8221. this._processingResult=true;
  8222. try {
  8223. req.processResponse(response.Body);
  8224. }
  8225. finally {
  8226. this._processingResult=false;
  8227. }
  8228. return null;
  8229. };
  8230. ClientRequestContext.prototype.processPendingEventHandlers=function (req) {
  8231. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  8232. for (var i=0; i < req._pendingProcessEventHandlers.length; i++) {
  8233. var eventHandlers=req._pendingProcessEventHandlers[i];
  8234. ret=ret.then(this.createProcessOneEventHandlersFunc(eventHandlers, req));
  8235. }
  8236. return ret;
  8237. };
  8238. ClientRequestContext.prototype.createProcessOneEventHandlersFunc=function (eventHandlers, req) {
  8239. return function () { return eventHandlers._processRegistration(req); };
  8240. };
  8241. ClientRequestContext.prototype.sync=function (passThroughValue) {
  8242. return this.syncPrivate().then(function () { return passThroughValue; });
  8243. };
  8244. ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8245. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  8246. if (retryDelay===void 0) { retryDelay=5000; }
  8247. return ClientRequestContext._runCommon("run", null, ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  8248. };
  8249. ClientRequestContext._runBatch=function (functionName, receivedRunArgs, ctxInitializer, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8250. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  8251. if (retryDelay===void 0) { retryDelay=5000; }
  8252. var ctxRetriever;
  8253. var batch;
  8254. var requestInfo=null;
  8255. var argOffset=0;
  8256. if (receivedRunArgs.length > 0 && typeof (receivedRunArgs[0])==="object" && receivedRunArgs[0] !==null && Object.getPrototypeOf(receivedRunArgs[0])===Object.getPrototypeOf({}) && !OfficeExtension.Utility.isNullOrUndefined(receivedRunArgs[0].url)) {
  8257. requestInfo=receivedRunArgs[0];
  8258. argOffset=1;
  8259. }
  8260. if (receivedRunArgs.length==argOffset+1) {
  8261. ctxRetriever=ctxInitializer;
  8262. batch=receivedRunArgs[argOffset+0];
  8263. }
  8264. else if (receivedRunArgs.length==argOffset+2) {
  8265. if (receivedRunArgs[argOffset+0] instanceof OfficeExtension.ClientObject) {
  8266. ctxRetriever=function () { return receivedRunArgs[argOffset+0].context; };
  8267. }
  8268. else if (Array.isArray(receivedRunArgs[argOffset+0])) {
  8269. var array=receivedRunArgs[argOffset+0];
  8270. if (array.length==0) {
  8271. return ClientRequestContext.createErrorPromise(functionName);
  8272. }
  8273. for (var i=0; i < array.length; i++) {
  8274. if (!(array[i] instanceof OfficeExtension.ClientObject)) {
  8275. return ClientRequestContext.createErrorPromise(functionName);
  8276. }
  8277. if (array[i].context !=array[0].context) {
  8278. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ResourceStrings.invalidRequestContext);
  8279. }
  8280. }
  8281. ctxRetriever=function () { return array[0].context; };
  8282. }
  8283. else {
  8284. return ClientRequestContext.createErrorPromise(functionName);
  8285. }
  8286. batch=receivedRunArgs[argOffset+1];
  8287. }
  8288. else {
  8289. return ClientRequestContext.createErrorPromise(functionName);
  8290. }
  8291. return ClientRequestContext._runCommon(functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  8292. };
  8293. ClientRequestContext.createErrorPromise=function (functionName, code) {
  8294. if (code===void 0) { code=OfficeExtension.ResourceStrings.invalidArgument; }
  8295. return OfficeExtension.Promise.reject(OfficeExtension.Utility.createRuntimeError(code, OfficeExtension.Utility._getResourceString(code), functionName));
  8296. };
  8297. ClientRequestContext._runCommon=function (functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8298. var starterPromise=new OfficeExtension.Promise(function (resolve, reject) {
  8299. resolve();
  8300. });
  8301. var ctx;
  8302. var succeeded=false;
  8303. var resultOrError;
  8304. return starterPromise.then(function () {
  8305. ctx=ctxRetriever(requestInfo);
  8306. if (requestInfo && !OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url) && requestInfo.url !==ctx.m_url) {
  8307. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ErrorCodes.invalidRequestContext);
  8308. }
  8309. if (ctx._autoCleanup) {
  8310. return new OfficeExtension.Promise(function (resolve, reject) {
  8311. ctx._onRunFinishedNotifiers.push(function () {
  8312. ctx._autoCleanup=true;
  8313. resolve();
  8314. });
  8315. });
  8316. }
  8317. else {
  8318. ctx._autoCleanup=true;
  8319. }
  8320. }).then(function () {
  8321. if (typeof batch !=='function') {
  8322. return ClientRequestContext.createErrorPromise(functionName);
  8323. }
  8324. var batchResult=batch(ctx);
  8325. if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) {
  8326. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise);
  8327. }
  8328. return batchResult;
  8329. }).then(function (batchResult) {
  8330. return ctx.sync(batchResult);
  8331. }).then(function (result) {
  8332. succeeded=true;
  8333. resultOrError=result;
  8334. }).catch(function (error) {
  8335. resultOrError=error;
  8336. }).then(function () {
  8337. var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList();
  8338. ctx._autoCleanup=false;
  8339. for (var key in itemsToRemove) {
  8340. itemsToRemove[key]._objectPath.isValid=false;
  8341. }
  8342. var cleanupCounter=0;
  8343. attemptCleanup();
  8344. function attemptCleanup() {
  8345. cleanupCounter++;
  8346. for (var key in itemsToRemove) {
  8347. ctx.trackedObjects.remove(itemsToRemove[key]);
  8348. }
  8349. ctx.sync().then(function () {
  8350. if (onCleanupSuccess) {
  8351. onCleanupSuccess(cleanupCounter);
  8352. }
  8353. }).catch(function () {
  8354. if (onCleanupFailure) {
  8355. onCleanupFailure(cleanupCounter);
  8356. }
  8357. if (cleanupCounter < numCleanupAttempts) {
  8358. setTimeout(function () {
  8359. attemptCleanup();
  8360. }, retryDelay);
  8361. }
  8362. });
  8363. }
  8364. }).then(function () {
  8365. if (ctx._onRunFinishedNotifiers && ctx._onRunFinishedNotifiers.length > 0) {
  8366. var func=ctx._onRunFinishedNotifiers.shift();
  8367. func();
  8368. }
  8369. if (succeeded) {
  8370. return resultOrError;
  8371. }
  8372. else {
  8373. throw resultOrError;
  8374. }
  8375. });
  8376. };
  8377. ClientRequestContext.prototype._nextId=function () {
  8378. return++this.m_nextId;
  8379. };
  8380. return ClientRequestContext;
  8381. })();
  8382. OfficeExtension.ClientRequestContext=ClientRequestContext;
  8383. })(OfficeExtension || (OfficeExtension={}));
  8384. var OfficeExtension;
  8385. (function (OfficeExtension) {
  8386. (function (ClientRequestFlags) {
  8387. ClientRequestFlags[ClientRequestFlags["None"]=0]="None";
  8388. ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation";
  8389. })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={}));
  8390. var ClientRequestFlags=OfficeExtension.ClientRequestFlags;
  8391. })(OfficeExtension || (OfficeExtension={}));
  8392. var OfficeExtension;
  8393. (function (OfficeExtension) {
  8394. (function (ClientResultProcessingType) {
  8395. ClientResultProcessingType[ClientResultProcessingType["none"]=0]="none";
  8396. ClientResultProcessingType[ClientResultProcessingType["date"]=1]="date";
  8397. })(OfficeExtension.ClientResultProcessingType || (OfficeExtension.ClientResultProcessingType={}));
  8398. var ClientResultProcessingType=OfficeExtension.ClientResultProcessingType;
  8399. var ClientResult=(function () {
  8400. function ClientResult(type) {
  8401. this.m_type=type;
  8402. }
  8403. Object.defineProperty(ClientResult.prototype, "value", {
  8404. get: function () {
  8405. if (!this.m_isLoaded) {
  8406. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.valueNotLoaded);
  8407. }
  8408. return this.m_value;
  8409. },
  8410. enumerable: true,
  8411. configurable: true
  8412. });
  8413. ClientResult.prototype._handleResult=function (value) {
  8414. this.m_isLoaded=true;
  8415. if (typeof (value)==="object" && value && value._IsNull) {
  8416. return;
  8417. }
  8418. if (this.m_type===1 ) {
  8419. this.m_value=OfficeExtension.Utility.adjustToDateTime(value);
  8420. }
  8421. else {
  8422. this.m_value=value;
  8423. }
  8424. };
  8425. return ClientResult;
  8426. })();
  8427. OfficeExtension.ClientResult=ClientResult;
  8428. })(OfficeExtension || (OfficeExtension={}));
  8429. var OfficeExtension;
  8430. (function (OfficeExtension) {
  8431. var Constants=(function () {
  8432. function Constants() {
  8433. }
  8434. Constants.getItemAt="GetItemAt";
  8435. Constants.id="Id";
  8436. Constants.idPrivate="_Id";
  8437. Constants.index="_Index";
  8438. Constants.items="_Items";
  8439. Constants.iterativeExecutor="IterativeExecutor";
  8440. Constants.localDocument="http://document.localhost/";
  8441. Constants.localDocumentApiPrefix="http://document.localhost/_api/";
  8442. Constants.referenceId="_ReferenceId";
  8443. Constants.isTracked="_IsTracked";
  8444. Constants.sourceLibHeader="SdkVersion";
  8445. Constants.requestInfoHeader="Office-RequestInfo";
  8446. return Constants;
  8447. })();
  8448. OfficeExtension.Constants=Constants;
  8449. })(OfficeExtension || (OfficeExtension={}));
  8450. var OfficeExtension;
  8451. (function (OfficeExtension) {
  8452. var EmbedRequestExecutor=(function () {
  8453. function EmbedRequestExecutor() {
  8454. }
  8455. EmbedRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  8456. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, EmbedRequestExecutor.SourceLibHeaderValue);
  8457. return new OfficeExtension.Promise(function (resolve, reject) {
  8458. var endpoint=OfficeExtension.Embedded && OfficeExtension.Embedded._getEndpoint();
  8459. if (!endpoint) {
  8460. resolve(OfficeExtension.RichApiMessageUtility.buildResponseOnError(OfficeExtension.Embedded.EmbeddedApiStatus.InternalError, ""));
  8461. return;
  8462. }
  8463. endpoint.invoke("executeMethod", function (status, result) {
  8464. OfficeExtension.Utility.log("Response:");
  8465. OfficeExtension.Utility.log(JSON.stringify(result));
  8466. var response;
  8467. if (status==OfficeExtension.Embedded.EmbeddedApiStatus.Success) {
  8468. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBodyFromSafeArray(result.Data), OfficeExtension.RichApiMessageUtility.getResponseHeadersFromSafeArray(result.Data));
  8469. }
  8470. else {
  8471. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.Code, result.error.Message);
  8472. }
  8473. resolve(response);
  8474. }, EmbedRequestExecutor._transformMessageArrayIntoParams(messageSafearray));
  8475. });
  8476. };
  8477. EmbedRequestExecutor._transformMessageArrayIntoParams=function (msgArray) {
  8478. return {
  8479. ArrayData: msgArray,
  8480. DdaMethod: {
  8481. DispatchId: EmbedRequestExecutor.DispidExecuteRichApiRequestMethod
  8482. }
  8483. };
  8484. };
  8485. EmbedRequestExecutor.DispidExecuteRichApiRequestMethod=93;
  8486. EmbedRequestExecutor.SourceLibHeaderValue="Embedded";
  8487. return EmbedRequestExecutor;
  8488. })();
  8489. OfficeExtension.EmbedRequestExecutor=EmbedRequestExecutor;
  8490. })(OfficeExtension || (OfficeExtension={}));
  8491. var __extends=this.__extends || function (d, b) {
  8492. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  8493. function __() { this.constructor=d; }
  8494. __.prototype=b.prototype;
  8495. d.prototype=new __();
  8496. };
  8497. var OfficeExtension;
  8498. (function (OfficeExtension) {
  8499. var _Internal;
  8500. (function (_Internal) {
  8501. var RuntimeError=(function (_super) {
  8502. __extends(RuntimeError, _super);
  8503. function RuntimeError(code, message, traceMessages, debugInfo) {
  8504. _super.call(this, message);
  8505. this.name="OfficeExtension.Error";
  8506. this.code=code;
  8507. this.message=message;
  8508. this.traceMessages=traceMessages;
  8509. this.debugInfo=debugInfo;
  8510. }
  8511. RuntimeError.prototype.toString=function () {
  8512. return this.code+': '+this.message;
  8513. };
  8514. return RuntimeError;
  8515. })(Error);
  8516. _Internal.RuntimeError=RuntimeError;
  8517. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  8518. OfficeExtension.Error=OfficeExtension._Internal.RuntimeError;
  8519. })(OfficeExtension || (OfficeExtension={}));
  8520. var OfficeExtension;
  8521. (function (OfficeExtension) {
  8522. var ErrorCodes=(function () {
  8523. function ErrorCodes() {
  8524. }
  8525. ErrorCodes.accessDenied="AccessDenied";
  8526. ErrorCodes.generalException="GeneralException";
  8527. ErrorCodes.activityLimitReached="ActivityLimitReached";
  8528. ErrorCodes.invalidObjectPath="InvalidObjectPath";
  8529. ErrorCodes.propertyNotLoaded="PropertyNotLoaded";
  8530. ErrorCodes.valueNotLoaded="ValueNotLoaded";
  8531. ErrorCodes.invalidRequestContext="InvalidRequestContext";
  8532. ErrorCodes.invalidArgument="InvalidArgument";
  8533. ErrorCodes.runMustReturnPromise="RunMustReturnPromise";
  8534. ErrorCodes.cannotRegisterEvent="CannotRegisterEvent";
  8535. ErrorCodes.apiNotFound="ApiNotFound";
  8536. ErrorCodes.connectionFailure="ConnectionFailure";
  8537. return ErrorCodes;
  8538. })();
  8539. OfficeExtension.ErrorCodes=ErrorCodes;
  8540. })(OfficeExtension || (OfficeExtension={}));
  8541. var OfficeExtension;
  8542. (function (OfficeExtension) {
  8543. var _Internal;
  8544. (function (_Internal) {
  8545. (function (EventHandlerActionType) {
  8546. EventHandlerActionType[EventHandlerActionType["add"]=0]="add";
  8547. EventHandlerActionType[EventHandlerActionType["remove"]=1]="remove";
  8548. EventHandlerActionType[EventHandlerActionType["removeAll"]=2]="removeAll";
  8549. })(_Internal.EventHandlerActionType || (_Internal.EventHandlerActionType={}));
  8550. var EventHandlerActionType=_Internal.EventHandlerActionType;
  8551. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  8552. })(OfficeExtension || (OfficeExtension={}));
  8553. var OfficeExtension;
  8554. (function (OfficeExtension) {
  8555. var EventHandlers=(function () {
  8556. function EventHandlers(context, parentObject, name, eventInfo) {
  8557. var _this=this;
  8558. this.m_id=context._nextId();
  8559. this.m_context=context;
  8560. this.m_name=name;
  8561. this.m_handlers=[];
  8562. this.m_registered=false;
  8563. this.m_eventInfo=eventInfo;
  8564. this.m_callback=function (args) {
  8565. _this.m_eventInfo.eventArgsTransformFunc(args).then(function (newArgs) { return _this.fireEvent(newArgs); });
  8566. };
  8567. }
  8568. Object.defineProperty(EventHandlers.prototype, "_registered", {
  8569. get: function () {
  8570. return this.m_registered;
  8571. },
  8572. enumerable: true,
  8573. configurable: true
  8574. });
  8575. Object.defineProperty(EventHandlers.prototype, "_id", {
  8576. get: function () {
  8577. return this.m_id;
  8578. },
  8579. enumerable: true,
  8580. configurable: true
  8581. });
  8582. Object.defineProperty(EventHandlers.prototype, "_handlers", {
  8583. get: function () {
  8584. return this.m_handlers;
  8585. },
  8586. enumerable: true,
  8587. configurable: true
  8588. });
  8589. EventHandlers.prototype.add=function (handler) {
  8590. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8591. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 0 });
  8592. return new OfficeExtension.EventHandlerResult(this.m_context, this, handler);
  8593. };
  8594. EventHandlers.prototype.remove=function (handler) {
  8595. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8596. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 1 });
  8597. };
  8598. EventHandlers.prototype.removeAll=function () {
  8599. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8600. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: null, operation: 2 });
  8601. };
  8602. EventHandlers.prototype._processRegistration=function (req) {
  8603. var _this=this;
  8604. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  8605. var actions=req._getPendingEventHandlerActions(this);
  8606. if (!actions) {
  8607. return ret;
  8608. }
  8609. var handlersResult=[];
  8610. for (var i=0; i < this.m_handlers.length; i++) {
  8611. handlersResult.push(this.m_handlers[i]);
  8612. }
  8613. var hasChange=false;
  8614. for (var i=0; i < actions.length; i++) {
  8615. if (req._responseTraceIds[actions[i].id]) {
  8616. hasChange=true;
  8617. switch (actions[i].operation) {
  8618. case 0 :
  8619. handlersResult.push(actions[i].handler);
  8620. break;
  8621. case 1 :
  8622. for (var index=handlersResult.length - 1; index >=0; index--) {
  8623. if (handlersResult[index]===actions[i].handler) {
  8624. handlersResult.splice(index, 1);
  8625. break;
  8626. }
  8627. }
  8628. break;
  8629. case 2 :
  8630. handlersResult=[];
  8631. break;
  8632. }
  8633. }
  8634. }
  8635. if (hasChange) {
  8636. if (!this.m_registered && handlersResult.length > 0) {
  8637. ret=ret.then(function () { return _this.m_eventInfo.registerFunc(_this.m_callback); }).then(function () { return (_this.m_registered=true); });
  8638. }
  8639. else if (this.m_registered && handlersResult.length==0) {
  8640. ret=ret.then(function () { return _this.m_eventInfo.unregisterFunc(_this.m_callback); }).catch(function (ex) {
  8641. OfficeExtension.Utility.log("Error when unregister event: "+JSON.stringify(ex));
  8642. }).then(function () { return (_this.m_registered=false); });
  8643. }
  8644. ret=ret.then(function () { return (_this.m_handlers=handlersResult); });
  8645. }
  8646. return ret;
  8647. };
  8648. EventHandlers.prototype.fireEvent=function (args) {
  8649. var promises=[];
  8650. for (var i=0; i < this.m_handlers.length; i++) {
  8651. var handler=this.m_handlers[i];
  8652. var p=OfficeExtension.Utility._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(handler, args)).catch(function (ex) {
  8653. OfficeExtension.Utility.log("Error when invoke handler: "+JSON.stringify(ex));
  8654. });
  8655. promises.push(p);
  8656. }
  8657. OfficeExtension.Promise.all(promises);
  8658. };
  8659. EventHandlers.prototype.createFireOneEventHandlerFunc=function (handler, args) {
  8660. return function () { return handler(args); };
  8661. };
  8662. return EventHandlers;
  8663. })();
  8664. OfficeExtension.EventHandlers=EventHandlers;
  8665. })(OfficeExtension || (OfficeExtension={}));
  8666. var OfficeExtension;
  8667. (function (OfficeExtension) {
  8668. var EventHandlerResult=(function () {
  8669. function EventHandlerResult(context, handlers, handler) {
  8670. this.m_context=context;
  8671. this.m_allHandlers=handlers;
  8672. this.m_handler=handler;
  8673. }
  8674. EventHandlerResult.prototype.remove=function () {
  8675. if (this.m_allHandlers && this.m_handler) {
  8676. this.m_allHandlers.remove(this.m_handler);
  8677. this.m_allHandlers=null;
  8678. this.m_handler=null;
  8679. }
  8680. };
  8681. return EventHandlerResult;
  8682. })();
  8683. OfficeExtension.EventHandlerResult=EventHandlerResult;
  8684. })(OfficeExtension || (OfficeExtension={}));
  8685. var OfficeExtension;
  8686. (function (OfficeExtension) {
  8687. var HttpRequestExecutor=(function () {
  8688. function HttpRequestExecutor() {
  8689. }
  8690. HttpRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  8691. var requestMessageText=JSON.stringify(requestMessage.Body);
  8692. OfficeExtension.Utility.log("Request:");
  8693. OfficeExtension.Utility.log(requestMessageText);
  8694. var url=requestMessage.Url;
  8695. if (url.charAt(url.length - 1) !="/") {
  8696. url=url+"/";
  8697. }
  8698. url=url+"ProcessQuery";
  8699. var requestInfo={
  8700. method: "POST",
  8701. url: url,
  8702. headers: {},
  8703. body: requestMessageText
  8704. };
  8705. requestInfo.headers[OfficeExtension.Constants.sourceLibHeader]=HttpRequestExecutor.SourceLibHeaderValue;
  8706. requestInfo.headers[OfficeExtension.Constants.requestInfoHeader]="flags="+requestFlags.toString();
  8707. requestInfo.headers["CONTENT-TYPE"]="application/json";
  8708. if (requestMessage.Headers) {
  8709. for (var key in requestMessage.Headers) {
  8710. requestInfo.headers[key]=requestMessage.Headers[key];
  8711. }
  8712. }
  8713. return OfficeExtension.HttpUtility.sendRequest(requestInfo).then(function (responseInfo) {
  8714. var response;
  8715. if (responseInfo.statusCode===200) {
  8716. response={ ErrorCode: null, ErrorMessage: null, Headers: responseInfo.headers, Body: JSON.parse(responseInfo.body) };
  8717. }
  8718. else {
  8719. var errorObj=null;
  8720. OfficeExtension.Utility.log("Error Response:"+responseInfo.body);
  8721. if (!OfficeExtension.Utility.isNullOrEmptyString(responseInfo.body)) {
  8722. var errorResponseBody=OfficeExtension.Utility.trim(responseInfo.body);
  8723. try {
  8724. errorObj=JSON.parse(errorResponseBody);
  8725. }
  8726. catch (e) {
  8727. OfficeExtension.Utility.log("Error when parse "+errorResponseBody);
  8728. }
  8729. }
  8730. var errorMessage;
  8731. var errorCode;
  8732. if (!OfficeExtension.Utility.isNullOrUndefined(errorObj) && typeof (errorObj)==="object" && errorObj.error) {
  8733. errorCode=errorObj.error.code;
  8734. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithDetails, [responseInfo.statusCode.toString(), errorObj.error.code, errorObj.error.message]);
  8735. }
  8736. else {
  8737. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, responseInfo.statusCode.toString());
  8738. }
  8739. if (OfficeExtension.Utility.isNullOrEmptyString(errorCode)) {
  8740. errorCode=OfficeExtension.ErrorCodes.connectionFailure;
  8741. }
  8742. response={
  8743. ErrorCode: errorCode,
  8744. ErrorMessage: errorMessage,
  8745. Headers: responseInfo.headers,
  8746. Body: null
  8747. };
  8748. }
  8749. return response;
  8750. });
  8751. };
  8752. HttpRequestExecutor.SourceLibHeaderValue="officejs-rest";
  8753. return HttpRequestExecutor;
  8754. })();
  8755. OfficeExtension.HttpRequestExecutor=HttpRequestExecutor;
  8756. })(OfficeExtension || (OfficeExtension={}));
  8757. var OfficeExtension;
  8758. (function (OfficeExtension) {
  8759. var HttpUtility=(function () {
  8760. function HttpUtility() {
  8761. }
  8762. HttpUtility.setCustomSendRequestFunc=function (func) {
  8763. HttpUtility.s_customSendRequestFunc=func;
  8764. };
  8765. HttpUtility.xhrSendRequestFunc=function (request) {
  8766. return new OfficeExtension.Promise(function (resolve, reject) {
  8767. var xhr=new XMLHttpRequest();
  8768. xhr.open(request.method, request.url);
  8769. xhr.onload=function () {
  8770. var resp={
  8771. statusCode: xhr.status,
  8772. headers: OfficeExtension.Utility._parseHttpResponseHeaders(xhr.getAllResponseHeaders()),
  8773. body: xhr.responseText
  8774. };
  8775. resolve(resp);
  8776. };
  8777. xhr.onerror=function () {
  8778. reject(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.connectionFailure, OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, xhr.statusText), null));
  8779. };
  8780. if (request.headers) {
  8781. for (var key in request.headers) {
  8782. xhr.setRequestHeader(key, request.headers[key]);
  8783. }
  8784. }
  8785. xhr.send(request.body);
  8786. });
  8787. };
  8788. HttpUtility.sendRequest=function (request) {
  8789. HttpUtility.validateAndNormalizeRequest(request);
  8790. var func;
  8791. func=HttpUtility.s_customSendRequestFunc || HttpUtility.xhrSendRequestFunc;
  8792. return func(request);
  8793. };
  8794. HttpUtility.setCustomSendLocalDocumentRequestFunc=function (func) {
  8795. HttpUtility.s_customSendLocalDocumentRequestFunc=func;
  8796. };
  8797. HttpUtility.sendLocalDocumentRequest=function (request) {
  8798. HttpUtility.validateAndNormalizeRequest(request);
  8799. var func;
  8800. func=HttpUtility.s_customSendLocalDocumentRequestFunc || HttpUtility.officeJsSendLocalDocumentRequestFunc;
  8801. return func(request);
  8802. };
  8803. HttpUtility.officeJsSendLocalDocumentRequestFunc=function (request) {
  8804. request=OfficeExtension.Utility._validateLocalDocumentRequest(request);
  8805. var requestSafeArray=OfficeExtension.Utility._buildRequestMessageSafeArray(request);
  8806. return new OfficeExtension.Promise(function (resolve, reject) {
  8807. OSF.DDA.RichApi.executeRichApiRequestAsync(requestSafeArray, function (asyncResult) {
  8808. var response;
  8809. if (asyncResult.status=="succeeded") {
  8810. response={
  8811. statusCode: OfficeExtension.RichApiMessageUtility.getResponseStatusCode(asyncResult),
  8812. headers: OfficeExtension.RichApiMessageUtility.getResponseHeaders(asyncResult),
  8813. body: OfficeExtension.RichApiMessageUtility.getResponseBody(asyncResult)
  8814. };
  8815. }
  8816. else {
  8817. response=OfficeExtension.RichApiMessageUtility.buildHttpResponseFromOfficeJsError(asyncResult.error.code, asyncResult.error.message);
  8818. }
  8819. OfficeExtension.Utility.log(JSON.stringify(response));
  8820. resolve(response);
  8821. });
  8822. });
  8823. };
  8824. HttpUtility.validateAndNormalizeRequest=function (request) {
  8825. if (OfficeExtension.Utility.isNullOrUndefined(request)) {
  8826. throw OfficeExtension.Utility.createInvalidArgumentException("request");
  8827. }
  8828. if (OfficeExtension.Utility.isNullOrEmptyString(request.method)) {
  8829. request.method="GET";
  8830. }
  8831. request.method=request.method.toUpperCase();
  8832. };
  8833. return HttpUtility;
  8834. })();
  8835. OfficeExtension.HttpUtility=HttpUtility;
  8836. })(OfficeExtension || (OfficeExtension={}));
  8837. var OfficeExtension;
  8838. (function (OfficeExtension) {
  8839. var InstantiateActionResultHandler=(function () {
  8840. function InstantiateActionResultHandler(clientObject) {
  8841. this.m_clientObject=clientObject;
  8842. }
  8843. InstantiateActionResultHandler.prototype._handleResult=function (value) {
  8844. this.m_clientObject._handleIdResult(value);
  8845. };
  8846. return InstantiateActionResultHandler;
  8847. })();
  8848. OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler;
  8849. })(OfficeExtension || (OfficeExtension={}));
  8850. var OfficeExtension;
  8851. (function (OfficeExtension) {
  8852. })(OfficeExtension || (OfficeExtension={}));
  8853. var OfficeExtension;
  8854. (function (OfficeExtension) {
  8855. (function (RichApiRequestMessageIndex) {
  8856. RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData";
  8857. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method";
  8858. RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery";
  8859. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers";
  8860. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body";
  8861. RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission";
  8862. RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags";
  8863. })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={}));
  8864. var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex;
  8865. (function (RichApiResponseMessageIndex) {
  8866. RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode";
  8867. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers";
  8868. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body";
  8869. })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={}));
  8870. var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex;
  8871. ;
  8872. (function (ActionType) {
  8873. ActionType[ActionType["Instantiate"]=1]="Instantiate";
  8874. ActionType[ActionType["Query"]=2]="Query";
  8875. ActionType[ActionType["Method"]=3]="Method";
  8876. ActionType[ActionType["SetProperty"]=4]="SetProperty";
  8877. ActionType[ActionType["Trace"]=5]="Trace";
  8878. ActionType[ActionType["RecursiveQuery"]=6]="RecursiveQuery";
  8879. })(OfficeExtension.ActionType || (OfficeExtension.ActionType={}));
  8880. var ActionType=OfficeExtension.ActionType;
  8881. (function (ObjectPathType) {
  8882. ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject";
  8883. ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject";
  8884. ObjectPathType[ObjectPathType["Method"]=3]="Method";
  8885. ObjectPathType[ObjectPathType["Property"]=4]="Property";
  8886. ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer";
  8887. ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId";
  8888. ObjectPathType[ObjectPathType["NullObject"]=7]="NullObject";
  8889. })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={}));
  8890. var ObjectPathType=OfficeExtension.ObjectPathType;
  8891. })(OfficeExtension || (OfficeExtension={}));
  8892. var OfficeExtension;
  8893. (function (OfficeExtension) {
  8894. var ObjectPath=(function () {
  8895. function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) {
  8896. this.m_objectPathInfo=objectPathInfo;
  8897. this.m_parentObjectPath=parentObjectPath;
  8898. this.m_isWriteOperation=false;
  8899. this.m_isCollection=isCollection;
  8900. this.m_isInvalidAfterRequest=isInvalidAfterRequest;
  8901. this.m_isValid=true;
  8902. }
  8903. Object.defineProperty(ObjectPath.prototype, "objectPathInfo", {
  8904. get: function () {
  8905. return this.m_objectPathInfo;
  8906. },
  8907. enumerable: true,
  8908. configurable: true
  8909. });
  8910. Object.defineProperty(ObjectPath.prototype, "isWriteOperation", {
  8911. get: function () {
  8912. return this.m_isWriteOperation;
  8913. },
  8914. set: function (value) {
  8915. this.m_isWriteOperation=value;
  8916. },
  8917. enumerable: true,
  8918. configurable: true
  8919. });
  8920. Object.defineProperty(ObjectPath.prototype, "isCollection", {
  8921. get: function () {
  8922. return this.m_isCollection;
  8923. },
  8924. enumerable: true,
  8925. configurable: true
  8926. });
  8927. Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", {
  8928. get: function () {
  8929. return this.m_isInvalidAfterRequest;
  8930. },
  8931. enumerable: true,
  8932. configurable: true
  8933. });
  8934. Object.defineProperty(ObjectPath.prototype, "parentObjectPath", {
  8935. get: function () {
  8936. return this.m_parentObjectPath;
  8937. },
  8938. enumerable: true,
  8939. configurable: true
  8940. });
  8941. Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", {
  8942. get: function () {
  8943. return this.m_argumentObjectPaths;
  8944. },
  8945. set: function (value) {
  8946. this.m_argumentObjectPaths=value;
  8947. },
  8948. enumerable: true,
  8949. configurable: true
  8950. });
  8951. Object.defineProperty(ObjectPath.prototype, "isValid", {
  8952. get: function () {
  8953. return this.m_isValid;
  8954. },
  8955. set: function (value) {
  8956. this.m_isValid=value;
  8957. },
  8958. enumerable: true,
  8959. configurable: true
  8960. });
  8961. Object.defineProperty(ObjectPath.prototype, "getByIdMethodName", {
  8962. get: function () {
  8963. return this.m_getByIdMethodName;
  8964. },
  8965. set: function (value) {
  8966. this.m_getByIdMethodName=value;
  8967. },
  8968. enumerable: true,
  8969. configurable: true
  8970. });
  8971. ObjectPath.prototype._updateAsNullObject=function () {
  8972. this.m_isInvalidAfterRequest=false;
  8973. this.m_isValid=true;
  8974. this.m_objectPathInfo.ObjectPathType=7 ;
  8975. this.m_objectPathInfo.Name="";
  8976. this.m_objectPathInfo.ArgumentInfo={};
  8977. this.m_parentObjectPath=null;
  8978. this.m_argumentObjectPaths=null;
  8979. };
  8980. ObjectPath.prototype.updateUsingObjectData=function (value) {
  8981. var referenceId=value[OfficeExtension.Constants.referenceId];
  8982. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  8983. this.m_isInvalidAfterRequest=false;
  8984. this.m_isValid=true;
  8985. this.m_objectPathInfo.ObjectPathType=6 ;
  8986. this.m_objectPathInfo.Name=referenceId;
  8987. this.m_objectPathInfo.ArgumentInfo={};
  8988. this.m_parentObjectPath=null;
  8989. this.m_argumentObjectPaths=null;
  8990. return;
  8991. }
  8992. var parentIsCollection=this.parentObjectPath && this.parentObjectPath.isCollection;
  8993. var getByIdMethodName=this.getByIdMethodName;
  8994. if (parentIsCollection || !OfficeExtension.Utility.isNullOrEmptyString(getByIdMethodName)) {
  8995. var id=value[OfficeExtension.Constants.id];
  8996. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  8997. id=value[OfficeExtension.Constants.idPrivate];
  8998. }
  8999. if (!OfficeExtension.Utility.isNullOrUndefined(id)) {
  9000. this.m_isInvalidAfterRequest=false;
  9001. this.m_isValid=true;
  9002. if (parentIsCollection) {
  9003. this.m_objectPathInfo.ObjectPathType=5 ;
  9004. this.m_objectPathInfo.Name="";
  9005. }
  9006. else {
  9007. this.m_objectPathInfo.ObjectPathType=3 ;
  9008. this.m_objectPathInfo.Name=getByIdMethodName;
  9009. this.m_getByIdMethodName=null;
  9010. }
  9011. this.isWriteOperation=false;
  9012. this.m_objectPathInfo.ArgumentInfo={};
  9013. this.m_objectPathInfo.ArgumentInfo.Arguments=[id];
  9014. this.m_argumentObjectPaths=null;
  9015. return;
  9016. }
  9017. }
  9018. };
  9019. return ObjectPath;
  9020. })();
  9021. OfficeExtension.ObjectPath=ObjectPath;
  9022. })(OfficeExtension || (OfficeExtension={}));
  9023. var OfficeExtension;
  9024. (function (OfficeExtension) {
  9025. var ObjectPathFactory=(function () {
  9026. function ObjectPathFactory() {
  9027. }
  9028. ObjectPathFactory.createGlobalObjectObjectPath=function (context) {
  9029. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" };
  9030. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  9031. };
  9032. ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) {
  9033. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName };
  9034. return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false);
  9035. };
  9036. ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) {
  9037. var objectPathInfo={
  9038. Id: context._nextId(),
  9039. ObjectPathType: 4 ,
  9040. Name: propertyName,
  9041. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9042. };
  9043. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  9044. };
  9045. ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) {
  9046. var objectPathInfo={
  9047. Id: context._nextId(),
  9048. ObjectPathType: 5 ,
  9049. Name: "",
  9050. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9051. ArgumentInfo: {}
  9052. };
  9053. objectPathInfo.ArgumentInfo.Arguments=args;
  9054. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9055. };
  9056. ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) {
  9057. var objectPathInfo={
  9058. Id: context._nextId(),
  9059. ObjectPathType: 5 ,
  9060. Name: "",
  9061. ParentObjectPathId: parentObjectPath.objectPathInfo.Id,
  9062. ArgumentInfo: {}
  9063. };
  9064. objectPathInfo.ArgumentInfo.Arguments=args;
  9065. return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false);
  9066. };
  9067. ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest, getByIdMethodName) {
  9068. var objectPathInfo={
  9069. Id: context._nextId(),
  9070. ObjectPathType: 3 ,
  9071. Name: methodName,
  9072. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9073. ArgumentInfo: {}
  9074. };
  9075. var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args);
  9076. var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  9077. ret.argumentObjectPaths=argumentObjectPaths;
  9078. ret.isWriteOperation=(operationType !=1 );
  9079. ret.getByIdMethodName=getByIdMethodName;
  9080. return ret;
  9081. };
  9082. ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt=function (hasIndexerMethod, context, parent, childItem, index) {
  9083. var id=childItem[OfficeExtension.Constants.id];
  9084. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9085. id=childItem[OfficeExtension.Constants.idPrivate];
  9086. }
  9087. if (hasIndexerMethod && !OfficeExtension.Utility.isNullOrUndefined(id)) {
  9088. return ObjectPathFactory.createChildItemObjectPathUsingIndexer(context, parent, childItem);
  9089. }
  9090. else {
  9091. return ObjectPathFactory.createChildItemObjectPathUsingGetItemAt(context, parent, childItem, index);
  9092. }
  9093. };
  9094. ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) {
  9095. var id=childItem[OfficeExtension.Constants.id];
  9096. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9097. id=childItem[OfficeExtension.Constants.idPrivate];
  9098. }
  9099. var objectPathInfo=objectPathInfo={
  9100. Id: context._nextId(),
  9101. ObjectPathType: 5 ,
  9102. Name: "",
  9103. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9104. ArgumentInfo: {}
  9105. };
  9106. objectPathInfo.ArgumentInfo.Arguments=[id];
  9107. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9108. };
  9109. ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) {
  9110. var indexFromServer=childItem[OfficeExtension.Constants.index];
  9111. if (indexFromServer) {
  9112. index=indexFromServer;
  9113. }
  9114. var objectPathInfo={
  9115. Id: context._nextId(),
  9116. ObjectPathType: 3 ,
  9117. Name: OfficeExtension.Constants.getItemAt,
  9118. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9119. ArgumentInfo: {}
  9120. };
  9121. objectPathInfo.ArgumentInfo.Arguments=[index];
  9122. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9123. };
  9124. return ObjectPathFactory;
  9125. })();
  9126. OfficeExtension.ObjectPathFactory=ObjectPathFactory;
  9127. })(OfficeExtension || (OfficeExtension={}));
  9128. var OfficeExtension;
  9129. (function (OfficeExtension) {
  9130. var OfficeJsRequestExecutor=(function () {
  9131. function OfficeJsRequestExecutor() {
  9132. }
  9133. OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  9134. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, OfficeJsRequestExecutor.SourceLibHeaderValue);
  9135. return new OfficeExtension.Promise(function (resolve, reject) {
  9136. OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) {
  9137. OfficeExtension.Utility.log("Response:");
  9138. OfficeExtension.Utility.log(JSON.stringify(result));
  9139. var response;
  9140. if (result.status=="succeeded") {
  9141. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBody(result), OfficeExtension.RichApiMessageUtility.getResponseHeaders(result));
  9142. }
  9143. else {
  9144. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.code, result.error.message);
  9145. }
  9146. resolve(response);
  9147. });
  9148. });
  9149. };
  9150. OfficeJsRequestExecutor.SourceLibHeaderValue="officejs";
  9151. return OfficeJsRequestExecutor;
  9152. })();
  9153. OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor;
  9154. })(OfficeExtension || (OfficeExtension={}));
  9155. var OfficeExtension;
  9156. (function (OfficeExtension) {
  9157. var _Internal;
  9158. (function (_Internal) {
  9159. var PromiseImpl;
  9160. (function (PromiseImpl) {
  9161. function Init() {
  9162. (function () {
  9163. "use strict";
  9164. function lib$es6$promise$utils$$objectOrFunction(x) {
  9165. return typeof x==='function' || (typeof x==='object' && x !==null);
  9166. }
  9167. function lib$es6$promise$utils$$isFunction(x) {
  9168. return typeof x==='function';
  9169. }
  9170. function lib$es6$promise$utils$$isMaybeThenable(x) {
  9171. return typeof x==='object' && x !==null;
  9172. }
  9173. var lib$es6$promise$utils$$_isArray;
  9174. if (!Array.isArray) {
  9175. lib$es6$promise$utils$$_isArray=function (x) {
  9176. return Object.prototype.toString.call(x)==='[object Array]';
  9177. };
  9178. }
  9179. else {
  9180. lib$es6$promise$utils$$_isArray=Array.isArray;
  9181. }
  9182. var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;
  9183. var lib$es6$promise$asap$$len=0;
  9184. var lib$es6$promise$asap$$toString={}.toString;
  9185. var lib$es6$promise$asap$$vertxNext;
  9186. var lib$es6$promise$asap$$customSchedulerFn;
  9187. var lib$es6$promise$asap$$asap=function asap(callback, arg) {
  9188. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;
  9189. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;
  9190. lib$es6$promise$asap$$len+=2;
  9191. if (lib$es6$promise$asap$$len===2) {
  9192. if (lib$es6$promise$asap$$customSchedulerFn) {
  9193. lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
  9194. }
  9195. else {
  9196. lib$es6$promise$asap$$scheduleFlush();
  9197. }
  9198. }
  9199. };
  9200. function lib$es6$promise$asap$$setScheduler(scheduleFn) {
  9201. lib$es6$promise$asap$$customSchedulerFn=scheduleFn;
  9202. }
  9203. function lib$es6$promise$asap$$setAsap(asapFn) {
  9204. lib$es6$promise$asap$$asap=asapFn;
  9205. }
  9206. var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined;
  9207. var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {};
  9208. var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
  9209. var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]';
  9210. var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined';
  9211. function lib$es6$promise$asap$$useNextTick() {
  9212. var nextTick=process.nextTick;
  9213. var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
  9214. if (Array.isArray(version) && version[1]==='0' && version[2]==='10') {
  9215. nextTick=setImmediate;
  9216. }
  9217. return function () {
  9218. nextTick(lib$es6$promise$asap$$flush);
  9219. };
  9220. }
  9221. function lib$es6$promise$asap$$useVertxTimer() {
  9222. return function () {
  9223. lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
  9224. };
  9225. }
  9226. function lib$es6$promise$asap$$useMutationObserver() {
  9227. var iterations=0;
  9228. var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
  9229. var node=document.createTextNode('');
  9230. observer.observe(node, { characterData: true });
  9231. return function () {
  9232. node.data=(iterations=++iterations % 2);
  9233. };
  9234. }
  9235. function lib$es6$promise$asap$$useMessageChannel() {
  9236. var channel=new MessageChannel();
  9237. channel.port1.onmessage=lib$es6$promise$asap$$flush;
  9238. return function () {
  9239. channel.port2.postMessage(0);
  9240. };
  9241. }
  9242. function lib$es6$promise$asap$$useSetTimeout() {
  9243. return function () {
  9244. setTimeout(lib$es6$promise$asap$$flush, 1);
  9245. };
  9246. }
  9247. var lib$es6$promise$asap$$queue=new Array(1000);
  9248. function lib$es6$promise$asap$$flush() {
  9249. for (var i=0; i < lib$es6$promise$asap$$len; i+=2) {
  9250. var callback=lib$es6$promise$asap$$queue[i];
  9251. var arg=lib$es6$promise$asap$$queue[i+1];
  9252. callback(arg);
  9253. lib$es6$promise$asap$$queue[i]=undefined;
  9254. lib$es6$promise$asap$$queue[i+1]=undefined;
  9255. }
  9256. lib$es6$promise$asap$$len=0;
  9257. }
  9258. function lib$es6$promise$asap$$attemptVertex() {
  9259. try {
  9260. var r=require;
  9261. var vertx=r('vertx');
  9262. lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext;
  9263. return lib$es6$promise$asap$$useVertxTimer();
  9264. }
  9265. catch (e) {
  9266. return lib$es6$promise$asap$$useSetTimeout();
  9267. }
  9268. }
  9269. var lib$es6$promise$asap$$scheduleFlush;
  9270. if (lib$es6$promise$asap$$isNode) {
  9271. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick();
  9272. }
  9273. else if (lib$es6$promise$asap$$BrowserMutationObserver) {
  9274. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver();
  9275. }
  9276. else if (lib$es6$promise$asap$$isWorker) {
  9277. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel();
  9278. }
  9279. else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') {
  9280. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex();
  9281. }
  9282. else {
  9283. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout();
  9284. }
  9285. function lib$es6$promise$$internal$$noop() {
  9286. }
  9287. var lib$es6$promise$$internal$$PENDING=void 0;
  9288. var lib$es6$promise$$internal$$FULFILLED=1;
  9289. var lib$es6$promise$$internal$$REJECTED=2;
  9290. var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  9291. function lib$es6$promise$$internal$$selfFullfillment() {
  9292. return new TypeError("You cannot resolve a promise with itself");
  9293. }
  9294. function lib$es6$promise$$internal$$cannotReturnOwn() {
  9295. return new TypeError('A promises callback cannot return that same promise.');
  9296. }
  9297. function lib$es6$promise$$internal$$getThen(promise) {
  9298. try {
  9299. return promise.then;
  9300. }
  9301. catch (error) {
  9302. lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;
  9303. return lib$es6$promise$$internal$$GET_THEN_ERROR;
  9304. }
  9305. }
  9306. function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
  9307. try {
  9308. then.call(value, fulfillmentHandler, rejectionHandler);
  9309. }
  9310. catch (e) {
  9311. return e;
  9312. }
  9313. }
  9314. function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
  9315. lib$es6$promise$asap$$asap(function (promise) {
  9316. var sealed=false;
  9317. var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) {
  9318. if (sealed) {
  9319. return;
  9320. }
  9321. sealed=true;
  9322. if (thenable !==value) {
  9323. lib$es6$promise$$internal$$resolve(promise, value);
  9324. }
  9325. else {
  9326. lib$es6$promise$$internal$$fulfill(promise, value);
  9327. }
  9328. }, function (reason) {
  9329. if (sealed) {
  9330. return;
  9331. }
  9332. sealed=true;
  9333. lib$es6$promise$$internal$$reject(promise, reason);
  9334. }, 'Settle: '+(promise._label || ' unknown promise'));
  9335. if (!sealed && error) {
  9336. sealed=true;
  9337. lib$es6$promise$$internal$$reject(promise, error);
  9338. }
  9339. }, promise);
  9340. }
  9341. function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
  9342. if (thenable._state===lib$es6$promise$$internal$$FULFILLED) {
  9343. lib$es6$promise$$internal$$fulfill(promise, thenable._result);
  9344. }
  9345. else if (thenable._state===lib$es6$promise$$internal$$REJECTED) {
  9346. lib$es6$promise$$internal$$reject(promise, thenable._result);
  9347. }
  9348. else {
  9349. lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) {
  9350. lib$es6$promise$$internal$$resolve(promise, value);
  9351. }, function (reason) {
  9352. lib$es6$promise$$internal$$reject(promise, reason);
  9353. });
  9354. }
  9355. }
  9356. function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
  9357. if (maybeThenable.constructor===promise.constructor) {
  9358. lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
  9359. }
  9360. else {
  9361. var then=lib$es6$promise$$internal$$getThen(maybeThenable);
  9362. if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) {
  9363. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
  9364. }
  9365. else if (then===undefined) {
  9366. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  9367. }
  9368. else if (lib$es6$promise$utils$$isFunction(then)) {
  9369. lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
  9370. }
  9371. else {
  9372. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  9373. }
  9374. }
  9375. }
  9376. function lib$es6$promise$$internal$$resolve(promise, value) {
  9377. if (promise===value) {
  9378. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment());
  9379. }
  9380. else if (lib$es6$promise$utils$$objectOrFunction(value)) {
  9381. lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
  9382. }
  9383. else {
  9384. lib$es6$promise$$internal$$fulfill(promise, value);
  9385. }
  9386. }
  9387. function lib$es6$promise$$internal$$publishRejection(promise) {
  9388. if (promise._onerror) {
  9389. promise._onerror(promise._result);
  9390. }
  9391. lib$es6$promise$$internal$$publish(promise);
  9392. }
  9393. function lib$es6$promise$$internal$$fulfill(promise, value) {
  9394. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9395. return;
  9396. }
  9397. promise._result=value;
  9398. promise._state=lib$es6$promise$$internal$$FULFILLED;
  9399. if (promise._subscribers.length !==0) {
  9400. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
  9401. }
  9402. }
  9403. function lib$es6$promise$$internal$$reject(promise, reason) {
  9404. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9405. return;
  9406. }
  9407. promise._state=lib$es6$promise$$internal$$REJECTED;
  9408. promise._result=reason;
  9409. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
  9410. }
  9411. function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
  9412. var subscribers=parent._subscribers;
  9413. var length=subscribers.length;
  9414. parent._onerror=null;
  9415. subscribers[length]=child;
  9416. subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment;
  9417. subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection;
  9418. if (length===0 && parent._state) {
  9419. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
  9420. }
  9421. }
  9422. function lib$es6$promise$$internal$$publish(promise) {
  9423. var subscribers=promise._subscribers;
  9424. var settled=promise._state;
  9425. if (subscribers.length===0) {
  9426. return;
  9427. }
  9428. var child, callback, detail=promise._result;
  9429. for (var i=0; i < subscribers.length; i+=3) {
  9430. child=subscribers[i];
  9431. callback=subscribers[i+settled];
  9432. if (child) {
  9433. lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
  9434. }
  9435. else {
  9436. callback(detail);
  9437. }
  9438. }
  9439. promise._subscribers.length=0;
  9440. }
  9441. function lib$es6$promise$$internal$$ErrorObject() {
  9442. this.error=null;
  9443. }
  9444. var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  9445. function lib$es6$promise$$internal$$tryCatch(callback, detail) {
  9446. try {
  9447. return callback(detail);
  9448. }
  9449. catch (e) {
  9450. lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e;
  9451. return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
  9452. }
  9453. }
  9454. function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
  9455. var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed;
  9456. if (hasCallback) {
  9457. value=lib$es6$promise$$internal$$tryCatch(callback, detail);
  9458. if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
  9459. failed=true;
  9460. error=value.error;
  9461. value=null;
  9462. }
  9463. else {
  9464. succeeded=true;
  9465. }
  9466. if (promise===value) {
  9467. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
  9468. return;
  9469. }
  9470. }
  9471. else {
  9472. value=detail;
  9473. succeeded=true;
  9474. }
  9475. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9476. }
  9477. else if (hasCallback && succeeded) {
  9478. lib$es6$promise$$internal$$resolve(promise, value);
  9479. }
  9480. else if (failed) {
  9481. lib$es6$promise$$internal$$reject(promise, error);
  9482. }
  9483. else if (settled===lib$es6$promise$$internal$$FULFILLED) {
  9484. lib$es6$promise$$internal$$fulfill(promise, value);
  9485. }
  9486. else if (settled===lib$es6$promise$$internal$$REJECTED) {
  9487. lib$es6$promise$$internal$$reject(promise, value);
  9488. }
  9489. }
  9490. function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
  9491. try {
  9492. resolver(function resolvePromise(value) {
  9493. lib$es6$promise$$internal$$resolve(promise, value);
  9494. }, function rejectPromise(reason) {
  9495. lib$es6$promise$$internal$$reject(promise, reason);
  9496. });
  9497. }
  9498. catch (e) {
  9499. lib$es6$promise$$internal$$reject(promise, e);
  9500. }
  9501. }
  9502. function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
  9503. var enumerator=this;
  9504. enumerator._instanceConstructor=Constructor;
  9505. enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop);
  9506. if (enumerator._validateInput(input)) {
  9507. enumerator._input=input;
  9508. enumerator.length=input.length;
  9509. enumerator._remaining=input.length;
  9510. enumerator._init();
  9511. if (enumerator.length===0) {
  9512. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  9513. }
  9514. else {
  9515. enumerator.length=enumerator.length || 0;
  9516. enumerator._enumerate();
  9517. if (enumerator._remaining===0) {
  9518. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  9519. }
  9520. }
  9521. }
  9522. else {
  9523. lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
  9524. }
  9525. }
  9526. lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) {
  9527. return lib$es6$promise$utils$$isArray(input);
  9528. };
  9529. lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () {
  9530. return new _Internal.Error('Array Methods must be provided an Array');
  9531. };
  9532. lib$es6$promise$enumerator$$Enumerator.prototype._init=function () {
  9533. this._result=new Array(this.length);
  9534. };
  9535. var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;
  9536. lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () {
  9537. var enumerator=this;
  9538. var length=enumerator.length;
  9539. var promise=enumerator.promise;
  9540. var input=enumerator._input;
  9541. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  9542. enumerator._eachEntry(input[i], i);
  9543. }
  9544. };
  9545. lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) {
  9546. var enumerator=this;
  9547. var c=enumerator._instanceConstructor;
  9548. if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
  9549. if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) {
  9550. entry._onerror=null;
  9551. enumerator._settledAt(entry._state, i, entry._result);
  9552. }
  9553. else {
  9554. enumerator._willSettleAt(c.resolve(entry), i);
  9555. }
  9556. }
  9557. else {
  9558. enumerator._remaining--;
  9559. enumerator._result[i]=entry;
  9560. }
  9561. };
  9562. lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) {
  9563. var enumerator=this;
  9564. var promise=enumerator.promise;
  9565. if (promise._state===lib$es6$promise$$internal$$PENDING) {
  9566. enumerator._remaining--;
  9567. if (state===lib$es6$promise$$internal$$REJECTED) {
  9568. lib$es6$promise$$internal$$reject(promise, value);
  9569. }
  9570. else {
  9571. enumerator._result[i]=value;
  9572. }
  9573. }
  9574. if (enumerator._remaining===0) {
  9575. lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
  9576. }
  9577. };
  9578. lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) {
  9579. var enumerator=this;
  9580. lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) {
  9581. enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
  9582. }, function (reason) {
  9583. enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
  9584. });
  9585. };
  9586. function lib$es6$promise$promise$all$$all(entries) {
  9587. return new lib$es6$promise$enumerator$$default(this, entries).promise;
  9588. }
  9589. var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all;
  9590. function lib$es6$promise$promise$race$$race(entries) {
  9591. var Constructor=this;
  9592. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9593. if (!lib$es6$promise$utils$$isArray(entries)) {
  9594. lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
  9595. return promise;
  9596. }
  9597. var length=entries.length;
  9598. function onFulfillment(value) {
  9599. lib$es6$promise$$internal$$resolve(promise, value);
  9600. }
  9601. function onRejection(reason) {
  9602. lib$es6$promise$$internal$$reject(promise, reason);
  9603. }
  9604. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  9605. lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
  9606. }
  9607. return promise;
  9608. }
  9609. var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race;
  9610. function lib$es6$promise$promise$resolve$$resolve(object) {
  9611. var Constructor=this;
  9612. if (object && typeof object==='object' && object.constructor===Constructor) {
  9613. return object;
  9614. }
  9615. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9616. lib$es6$promise$$internal$$resolve(promise, object);
  9617. return promise;
  9618. }
  9619. var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve;
  9620. function lib$es6$promise$promise$reject$$reject(reason) {
  9621. var Constructor=this;
  9622. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9623. lib$es6$promise$$internal$$reject(promise, reason);
  9624. return promise;
  9625. }
  9626. var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject;
  9627. var lib$es6$promise$promise$$counter=0;
  9628. function lib$es6$promise$promise$$needsResolver() {
  9629. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  9630. }
  9631. function lib$es6$promise$promise$$needsNew() {
  9632. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  9633. }
  9634. var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;
  9635. function lib$es6$promise$promise$$Promise(resolver) {
  9636. this._id=lib$es6$promise$promise$$counter++;
  9637. this._state=undefined;
  9638. this._result=undefined;
  9639. this._subscribers=[];
  9640. if (lib$es6$promise$$internal$$noop !==resolver) {
  9641. if (!lib$es6$promise$utils$$isFunction(resolver)) {
  9642. lib$es6$promise$promise$$needsResolver();
  9643. }
  9644. if (!(this instanceof lib$es6$promise$promise$$Promise)) {
  9645. lib$es6$promise$promise$$needsNew();
  9646. }
  9647. lib$es6$promise$$internal$$initializePromise(this, resolver);
  9648. }
  9649. }
  9650. lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default;
  9651. lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default;
  9652. lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default;
  9653. lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default;
  9654. lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler;
  9655. lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap;
  9656. lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap;
  9657. lib$es6$promise$promise$$Promise.prototype={
  9658. constructor: lib$es6$promise$promise$$Promise,
  9659. then: function (onFulfillment, onRejection) {
  9660. var parent=this;
  9661. var state=parent._state;
  9662. if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) {
  9663. return this;
  9664. }
  9665. var child=new this.constructor(lib$es6$promise$$internal$$noop);
  9666. var result=parent._result;
  9667. if (state) {
  9668. var callback=arguments[state - 1];
  9669. lib$es6$promise$asap$$asap(function () {
  9670. lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
  9671. });
  9672. }
  9673. else {
  9674. lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
  9675. }
  9676. return child;
  9677. },
  9678. 'catch': function (onRejection) {
  9679. return this.then(null, onRejection);
  9680. }
  9681. };
  9682. OfficeExtension.Promise=lib$es6$promise$promise$$default;
  9683. }).call(this);
  9684. }
  9685. PromiseImpl.Init=Init;
  9686. })(PromiseImpl=_Internal.PromiseImpl || (_Internal.PromiseImpl={}));
  9687. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  9688. if (!OfficeExtension["Promise"]) {
  9689. if (typeof (window) !=="undefined" && window.Promise) {
  9690. if (IsEdgeLessThan14()) {
  9691. _Internal.PromiseImpl.Init();
  9692. }
  9693. else {
  9694. OfficeExtension.Promise=window.Promise;
  9695. }
  9696. }
  9697. else {
  9698. _Internal.PromiseImpl.Init();
  9699. }
  9700. }
  9701. })(OfficeExtension || (OfficeExtension={}));
  9702. function IsEdgeLessThan14() {
  9703. var userAgent=window.navigator.userAgent;
  9704. var versionIdx=userAgent.indexOf("Edge/");
  9705. if (versionIdx >=0) {
  9706. userAgent=userAgent.substring(versionIdx+5, userAgent.length);
  9707. if (userAgent < "14.14393")
  9708. return true;
  9709. else
  9710. return false;
  9711. }
  9712. return false;
  9713. }
  9714. var OfficeExtension;
  9715. (function (OfficeExtension) {
  9716. (function (OperationType) {
  9717. OperationType[OperationType["Default"]=0]="Default";
  9718. OperationType[OperationType["Read"]=1]="Read";
  9719. })(OfficeExtension.OperationType || (OfficeExtension.OperationType={}));
  9720. var OperationType=OfficeExtension.OperationType;
  9721. })(OfficeExtension || (OfficeExtension={}));
  9722. var OfficeExtension;
  9723. (function (OfficeExtension) {
  9724. var TrackedObjects=(function () {
  9725. function TrackedObjects(context) {
  9726. this._autoCleanupList={};
  9727. this.m_context=context;
  9728. }
  9729. TrackedObjects.prototype.add=function (param) {
  9730. var _this=this;
  9731. if (Array.isArray(param)) {
  9732. param.forEach(function (item) { return _this._addCommon(item, true); });
  9733. }
  9734. else {
  9735. this._addCommon(param, true);
  9736. }
  9737. };
  9738. TrackedObjects.prototype._autoAdd=function (object) {
  9739. this._addCommon(object, false);
  9740. this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object;
  9741. };
  9742. TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) {
  9743. if (object[OfficeExtension.Constants.isTracked]) {
  9744. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  9745. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  9746. }
  9747. return;
  9748. }
  9749. var referenceId=object[OfficeExtension.Constants.referenceId];
  9750. if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) {
  9751. object._KeepReference();
  9752. OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object);
  9753. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  9754. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  9755. }
  9756. object[OfficeExtension.Constants.isTracked]=true;
  9757. }
  9758. };
  9759. TrackedObjects.prototype.remove=function (param) {
  9760. var _this=this;
  9761. if (Array.isArray(param)) {
  9762. param.forEach(function (item) { return _this._removeCommon(item); });
  9763. }
  9764. else {
  9765. this._removeCommon(param);
  9766. }
  9767. };
  9768. TrackedObjects.prototype._removeCommon=function (object) {
  9769. var referenceId=object[OfficeExtension.Constants.referenceId];
  9770. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  9771. var rootObject=this.m_context._rootObject;
  9772. if (rootObject._RemoveReference) {
  9773. rootObject._RemoveReference(referenceId);
  9774. }
  9775. delete object[OfficeExtension.Constants.isTracked];
  9776. }
  9777. };
  9778. TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () {
  9779. var list=this._autoCleanupList;
  9780. this._autoCleanupList={};
  9781. return list;
  9782. };
  9783. return TrackedObjects;
  9784. })();
  9785. OfficeExtension.TrackedObjects=TrackedObjects;
  9786. })(OfficeExtension || (OfficeExtension={}));
  9787. var OfficeExtension;
  9788. (function (OfficeExtension) {
  9789. var ResourceStrings=(function () {
  9790. function ResourceStrings() {
  9791. }
  9792. ResourceStrings.invalidObjectPath="InvalidObjectPath";
  9793. ResourceStrings.propertyNotLoaded="PropertyNotLoaded";
  9794. ResourceStrings.valueNotLoaded="ValueNotLoaded";
  9795. ResourceStrings.invalidRequestContext="InvalidRequestContext";
  9796. ResourceStrings.invalidArgument="InvalidArgument";
  9797. ResourceStrings.runMustReturnPromise="RunMustReturnPromise";
  9798. ResourceStrings.cannotRegisterEvent="CannotRegisterEvent";
  9799. ResourceStrings.connectionFailureWithStatus="ConnectionFailureWithStatus";
  9800. ResourceStrings.connectionFailureWithDetails="ConnectionFailureWithDetails";
  9801. return ResourceStrings;
  9802. })();
  9803. OfficeExtension.ResourceStrings=ResourceStrings;
  9804. })(OfficeExtension || (OfficeExtension={}));
  9805. var OfficeExtension;
  9806. (function (OfficeExtension) {
  9807. var RichApiMessageUtility=(function () {
  9808. function RichApiMessageUtility() {
  9809. }
  9810. RichApiMessageUtility.buildMessageArrayForIRequestExecutor=function (customData, requestFlags, requestMessage, sourceLibHeaderValue) {
  9811. var requestMessageText=JSON.stringify(requestMessage.Body);
  9812. OfficeExtension.Utility.log("Request:");
  9813. OfficeExtension.Utility.log(requestMessageText);
  9814. var headers={};
  9815. headers[OfficeExtension.Constants.sourceLibHeader]=sourceLibHeaderValue;
  9816. var messageSafearray=RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", headers, requestMessageText);
  9817. return messageSafearray;
  9818. };
  9819. RichApiMessageUtility.buildResponseOnSuccess=function (responseBody, responseHeaders) {
  9820. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  9821. response.Body=JSON.parse(responseBody);
  9822. response.Headers=responseHeaders;
  9823. return response;
  9824. };
  9825. RichApiMessageUtility.buildResponseOnError=function (errorCode, message) {
  9826. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  9827. response.ErrorCode=OfficeExtension.ErrorCodes.generalException;
  9828. if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  9829. response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied;
  9830. }
  9831. else if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  9832. response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached;
  9833. }
  9834. response.ErrorMessage=message;
  9835. return response;
  9836. };
  9837. RichApiMessageUtility.buildHttpResponseFromOfficeJsError=function (errorCode, message) {
  9838. var statusCode=500;
  9839. var errorBody={};
  9840. errorBody["error"]={};
  9841. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.generalException;
  9842. errorBody["error"]["message"]=message;
  9843. if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  9844. statusCode=403;
  9845. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.accessDenied;
  9846. }
  9847. else if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  9848. statusCode=429;
  9849. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.activityLimitReached;
  9850. }
  9851. return { statusCode: statusCode, headers: {}, body: JSON.stringify(errorBody) };
  9852. };
  9853. RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) {
  9854. var headerArray=[];
  9855. if (headers) {
  9856. for (var headerName in headers) {
  9857. headerArray.push(headerName);
  9858. headerArray.push(headers[headerName]);
  9859. }
  9860. }
  9861. var appPermission=0;
  9862. var solutionId="";
  9863. var instanceId="";
  9864. var marketplaceType="";
  9865. return [
  9866. customData,
  9867. method,
  9868. path,
  9869. headerArray,
  9870. body,
  9871. appPermission,
  9872. requestFlags,
  9873. solutionId,
  9874. instanceId,
  9875. marketplaceType
  9876. ];
  9877. };
  9878. RichApiMessageUtility.getResponseBody=function (result) {
  9879. return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data);
  9880. };
  9881. RichApiMessageUtility.getResponseHeaders=function (result) {
  9882. return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data);
  9883. };
  9884. RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) {
  9885. var ret=data[2 ];
  9886. if (typeof (ret)==="string") {
  9887. return ret;
  9888. }
  9889. var arr=ret;
  9890. return arr.join("");
  9891. };
  9892. RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) {
  9893. var arrayHeader=data[1 ];
  9894. if (!arrayHeader) {
  9895. return null;
  9896. }
  9897. var headers={};
  9898. for (var i=0; i < arrayHeader.length - 1; i+=2) {
  9899. headers[arrayHeader[i]]=arrayHeader[i+1];
  9900. }
  9901. return headers;
  9902. };
  9903. RichApiMessageUtility.getResponseStatusCode=function (result) {
  9904. return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data);
  9905. };
  9906. RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) {
  9907. return data[0 ];
  9908. };
  9909. RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability=7000;
  9910. RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached=5102;
  9911. return RichApiMessageUtility;
  9912. })();
  9913. OfficeExtension.RichApiMessageUtility=RichApiMessageUtility;
  9914. })(OfficeExtension || (OfficeExtension={}));
  9915. var OfficeExtension;
  9916. (function (OfficeExtension) {
  9917. var Utility=(function () {
  9918. function Utility() {
  9919. }
  9920. Utility.checkArgumentNull=function (value, name) {
  9921. if (Utility.isNullOrUndefined(value)) {
  9922. Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, name);
  9923. }
  9924. };
  9925. Utility.isNullOrUndefined=function (value) {
  9926. if (value===null) {
  9927. return true;
  9928. }
  9929. if (typeof (value)==="undefined") {
  9930. return true;
  9931. }
  9932. return false;
  9933. };
  9934. Utility.isUndefined=function (value) {
  9935. if (typeof (value)==="undefined") {
  9936. return true;
  9937. }
  9938. return false;
  9939. };
  9940. Utility.isNullOrEmptyString=function (value) {
  9941. if (value===null) {
  9942. return true;
  9943. }
  9944. if (typeof (value)==="undefined") {
  9945. return true;
  9946. }
  9947. if (value.length==0) {
  9948. return true;
  9949. }
  9950. return false;
  9951. };
  9952. Utility.isPlainJsonObject=function (value) {
  9953. if (Utility.isNullOrUndefined(value)) {
  9954. return false;
  9955. }
  9956. if (typeof (value) !=="object") {
  9957. return false;
  9958. }
  9959. return Object.getPrototypeOf(value)===Object.getPrototypeOf({});
  9960. };
  9961. Utility.trim=function (str) {
  9962. return str.replace(new RegExp("^\\s+|\\s+$", "g"), "");
  9963. };
  9964. Utility.caseInsensitiveCompareString=function (str1, str2) {
  9965. if (Utility.isNullOrUndefined(str1)) {
  9966. return Utility.isNullOrUndefined(str2);
  9967. }
  9968. else {
  9969. if (Utility.isNullOrUndefined(str2)) {
  9970. return false;
  9971. }
  9972. else {
  9973. return str1.toUpperCase()==str2.toUpperCase();
  9974. }
  9975. }
  9976. };
  9977. Utility.adjustToDateTime=function (value) {
  9978. if (Utility.isNullOrUndefined(value)) {
  9979. return null;
  9980. }
  9981. if (typeof (value)==="string") {
  9982. return new Date(value);
  9983. }
  9984. if (Array.isArray(value)) {
  9985. var arr=value;
  9986. for (var i=0; i < arr.length; i++) {
  9987. arr[i]=Utility.adjustToDateTime(arr[i]);
  9988. }
  9989. return arr;
  9990. }
  9991. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "date"), null);
  9992. };
  9993. Utility.isReadonlyRestRequest=function (method) {
  9994. return Utility.caseInsensitiveCompareString(method, "GET");
  9995. };
  9996. Utility.setMethodArguments=function (context, argumentInfo, args) {
  9997. if (Utility.isNullOrUndefined(args)) {
  9998. return null;
  9999. }
  10000. var referencedObjectPaths=new Array();
  10001. var referencedObjectPathIds=new Array();
  10002. var hasOne=Utility.collectObjectPathInfos(context, args, referencedObjectPaths, referencedObjectPathIds);
  10003. argumentInfo.Arguments=args;
  10004. if (hasOne) {
  10005. argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds;
  10006. return referencedObjectPaths;
  10007. }
  10008. return null;
  10009. };
  10010. Utility.collectObjectPathInfos=function (context, args, referencedObjectPaths, referencedObjectPathIds) {
  10011. var hasOne=false;
  10012. for (var i=0; i < args.length; i++) {
  10013. if (args[i] instanceof OfficeExtension.ClientObject) {
  10014. var clientObject=args[i];
  10015. Utility.validateContext(context, clientObject);
  10016. args[i]=clientObject._objectPath.objectPathInfo.Id;
  10017. referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id);
  10018. referencedObjectPaths.push(clientObject._objectPath);
  10019. hasOne=true;
  10020. }
  10021. else if (Array.isArray(args[i])) {
  10022. var childArrayObjectPathIds=new Array();
  10023. var childArrayHasOne=Utility.collectObjectPathInfos(context, args[i], referencedObjectPaths, childArrayObjectPathIds);
  10024. if (childArrayHasOne) {
  10025. referencedObjectPathIds.push(childArrayObjectPathIds);
  10026. hasOne=true;
  10027. }
  10028. else {
  10029. referencedObjectPathIds.push(0);
  10030. }
  10031. }
  10032. else {
  10033. referencedObjectPathIds.push(0);
  10034. }
  10035. }
  10036. return hasOne;
  10037. };
  10038. Utility.fixObjectPathIfNecessary=function (clientObject, value) {
  10039. if (clientObject && clientObject._objectPath && value) {
  10040. clientObject._objectPath.updateUsingObjectData(value);
  10041. }
  10042. };
  10043. Utility.validateObjectPath=function (clientObject) {
  10044. var objectPath=clientObject._objectPath;
  10045. while (objectPath) {
  10046. if (!objectPath.isValid) {
  10047. var pathExpression=Utility.getObjectPathExpression(objectPath);
  10048. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  10049. }
  10050. objectPath=objectPath.parentObjectPath;
  10051. }
  10052. };
  10053. Utility.validateReferencedObjectPaths=function (objectPaths) {
  10054. if (objectPaths) {
  10055. for (var i=0; i < objectPaths.length; i++) {
  10056. var objectPath=objectPaths[i];
  10057. while (objectPath) {
  10058. if (!objectPath.isValid) {
  10059. var pathExpression=Utility.getObjectPathExpression(objectPath);
  10060. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  10061. }
  10062. objectPath=objectPath.parentObjectPath;
  10063. }
  10064. }
  10065. }
  10066. };
  10067. Utility.validateContext=function (context, obj) {
  10068. if (obj && obj.context !==context) {
  10069. Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext);
  10070. }
  10071. };
  10072. Utility.log=function (message) {
  10073. if (Utility._logEnabled && typeof (console) !=="undefined" && console.log) {
  10074. console.log(message);
  10075. }
  10076. };
  10077. Utility.load=function (clientObj, option) {
  10078. clientObj.context.load(clientObj, option);
  10079. };
  10080. Utility._parseSelectExpand=function (select) {
  10081. var args=[];
  10082. if (!Utility.isNullOrEmptyString(select)) {
  10083. var propertyNames=select.split(",");
  10084. for (var i=0; i < propertyNames.length; i++) {
  10085. var propertyName=propertyNames[i];
  10086. propertyName=sanitizeForAnyItemsSlash(propertyName.trim());
  10087. if (propertyName.length > 0) {
  10088. args.push(propertyName);
  10089. }
  10090. }
  10091. }
  10092. return args;
  10093. function sanitizeForAnyItemsSlash(propertyName) {
  10094. var propertyNameLower=propertyName.toLowerCase();
  10095. if (propertyNameLower==="items" || propertyNameLower==="items/") {
  10096. return '*';
  10097. }
  10098. var itemsSlashLength=6;
  10099. if (propertyNameLower.substr(0, itemsSlashLength)==="items/") {
  10100. propertyName=propertyName.substr(itemsSlashLength);
  10101. }
  10102. return propertyName.replace(new RegExp("\/items\/", "gi"), "/");
  10103. }
  10104. };
  10105. Utility.throwError=function (resourceId, arg, errorLocation) {
  10106. throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), errorLocation ? { errorLocation: errorLocation } : {});
  10107. };
  10108. Utility.createRuntimeError=function (code, message, location) {
  10109. return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location });
  10110. };
  10111. Utility.createInvalidArgumentException=function (name, errorLocation) {
  10112. return Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, name), errorLocation);
  10113. };
  10114. Utility._getResourceString=function (resourceId, arg) {
  10115. var ret=resourceId;
  10116. if (typeof (window) !=="undefined" && window.Strings && window.Strings.OfficeOM) {
  10117. var stringName="L_"+resourceId;
  10118. var stringValue=window.Strings.OfficeOM[stringName];
  10119. if (stringValue) {
  10120. ret=stringValue;
  10121. }
  10122. }
  10123. if (!Utility.isNullOrUndefined(arg)) {
  10124. if (Array.isArray(arg)) {
  10125. var arrArg=arg;
  10126. ret=Utility._formatString(ret, arrArg);
  10127. }
  10128. else {
  10129. ret=ret.replace("{0}", arg);
  10130. }
  10131. }
  10132. return ret;
  10133. };
  10134. Utility._formatString=function (format, arrArg) {
  10135. return format.replace(/\{\d\}/g, function (v) {
  10136. var position=parseInt(v.substr(1, v.length - 2));
  10137. if (position < arrArg.length) {
  10138. return arrArg[position];
  10139. }
  10140. else {
  10141. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "format"), null);
  10142. }
  10143. return "";
  10144. });
  10145. };
  10146. Utility.throwIfNotLoaded=function (propertyName, fieldValue, entityName, isNull) {
  10147. if (!isNull && Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) {
  10148. Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName, (entityName ? entityName+"."+propertyName : null));
  10149. }
  10150. };
  10151. Utility.getObjectPathExpression=function (objectPath) {
  10152. var ret="";
  10153. while (objectPath) {
  10154. switch (objectPath.objectPathInfo.ObjectPathType) {
  10155. case 1 :
  10156. ret=ret;
  10157. break;
  10158. case 2 :
  10159. ret="new()"+(ret.length > 0 ? "." : "")+ret;
  10160. break;
  10161. case 3 :
  10162. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret;
  10163. break;
  10164. case 4 :
  10165. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret;
  10166. break;
  10167. case 5 :
  10168. ret="getItem()"+(ret.length > 0 ? "." : "")+ret;
  10169. break;
  10170. case 6 :
  10171. ret="_reference()"+(ret.length > 0 ? "." : "")+ret;
  10172. break;
  10173. }
  10174. objectPath=objectPath.parentObjectPath;
  10175. }
  10176. return ret;
  10177. };
  10178. Utility._createPromiseFromResult=function (value) {
  10179. return new OfficeExtension.Promise(function (resolve, reject) {
  10180. resolve(value);
  10181. });
  10182. };
  10183. Utility._createTimeoutPromise=function (timeout) {
  10184. return new OfficeExtension.Promise(function (resolve, reject) {
  10185. setTimeout(function () {
  10186. resolve(null);
  10187. }, timeout);
  10188. });
  10189. };
  10190. Utility.promisify=function (action) {
  10191. return new OfficeExtension.Promise(function (resolve, reject) {
  10192. var callback=function (result) {
  10193. if (result.status=="failed") {
  10194. reject(result.error);
  10195. }
  10196. else {
  10197. resolve(result.value);
  10198. }
  10199. };
  10200. action(callback);
  10201. });
  10202. };
  10203. Utility._addActionResultHandler=function (clientObj, action, resultHandler) {
  10204. clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler);
  10205. };
  10206. Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) {
  10207. for (var i=0; i < propertyNames.length - 1; i+=2) {
  10208. if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) {
  10209. clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]);
  10210. }
  10211. }
  10212. };
  10213. Utility.normalizeName=function (name) {
  10214. return name.substr(0, 1).toLowerCase()+name.substr(1);
  10215. };
  10216. Utility._isLocalDocumentUrl=function (url) {
  10217. return Utility._getLocalDocumentUrlPrefixLength(url) > 0;
  10218. };
  10219. Utility._getLocalDocumentUrlPrefixLength=function (url) {
  10220. var localDocumentPrefixes=["http://document.localhost", "https://document.localhost", "//document.localhost"];
  10221. var urlLower=url.toLowerCase().trim();
  10222. for (var i=0; i < localDocumentPrefixes.length; i++) {
  10223. if (urlLower===localDocumentPrefixes[i]) {
  10224. return localDocumentPrefixes[i].length;
  10225. }
  10226. else if (urlLower.substr(0, localDocumentPrefixes[i].length+1)===localDocumentPrefixes[i]+"/") {
  10227. return localDocumentPrefixes[i].length+1;
  10228. }
  10229. }
  10230. return 0;
  10231. };
  10232. Utility._validateLocalDocumentRequest=function (request) {
  10233. var index=Utility._getLocalDocumentUrlPrefixLength(request.url);
  10234. if (index <=0) {
  10235. throw Utility.createInvalidArgumentException("request");
  10236. }
  10237. var path=request.url.substr(index);
  10238. var pathLower=path.toLowerCase();
  10239. if (pathLower==="_api") {
  10240. path="";
  10241. }
  10242. else if (pathLower.substr(0, "_api/".length)==="_api/") {
  10243. path=path.substr("_api/".length);
  10244. }
  10245. return {
  10246. method: request.method,
  10247. url: path,
  10248. headers: request.headers,
  10249. body: request.body
  10250. };
  10251. };
  10252. Utility._buildRequestMessageSafeArray=function (request) {
  10253. var requestFlags=0 ;
  10254. if (!Utility.isReadonlyRestRequest(request.method)) {
  10255. requestFlags=1 ;
  10256. }
  10257. var requestInfo="";
  10258. if (request.headers) {
  10259. requestInfo=request.headers[OfficeExtension.Constants.requestInfoHeader];
  10260. if (!Utility.isNullOrEmptyString(requestInfo)) {
  10261. var parts=requestInfo.split("&");
  10262. for (var i=0; i < parts.length; i++) {
  10263. var keyvalue=parts[i].split("=");
  10264. if (keyvalue[0]=="flags") {
  10265. var flags=parseInt(keyvalue[1]);
  10266. requestFlags=flags;
  10267. break;
  10268. }
  10269. }
  10270. }
  10271. }
  10272. return OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray("", requestFlags, request.method, request.url, request.headers, request.body);
  10273. };
  10274. Utility._parseHttpResponseHeaders=function (allResponseHeaders) {
  10275. var responseHeaders={};
  10276. if (!Utility.isNullOrEmptyString(allResponseHeaders)) {
  10277. var regex=new RegExp("\r?\n");
  10278. var entries=allResponseHeaders.split(regex);
  10279. for (var i=0; i < entries.length; i++) {
  10280. var entry=entries[i];
  10281. if (entry !=null) {
  10282. var index=entry.indexOf(':');
  10283. if (index > 0) {
  10284. var key=entry.substr(0, index);
  10285. var value=entry.substr(index+1);
  10286. key=Utility.trim(key);
  10287. value=Utility.trim(value);
  10288. responseHeaders[key.toUpperCase()]=value;
  10289. }
  10290. }
  10291. }
  10292. }
  10293. return responseHeaders;
  10294. };
  10295. Utility._logEnabled=false;
  10296. Utility.s_underscoreCharCode="_".charCodeAt(0);
  10297. return Utility;
  10298. })();
  10299. OfficeExtension.Utility=Utility;
  10300. })(OfficeExtension || (OfficeExtension={}));
  10301. var __extends=(this && this.__extends) || function (d, b) {
  10302. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  10303. function __() { this.constructor=d; }
  10304. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype, new __());
  10305. };
  10306. var Excel;
  10307. (function (Excel) {
  10308. function lowerCaseFirst(str) {
  10309. return str[0].toLowerCase()+str.slice(1);
  10310. }
  10311. var iconSets=["ThreeArrows",
  10312. "ThreeArrowsGray",
  10313. "ThreeFlags",
  10314. "ThreeTrafficLights1",
  10315. "ThreeTrafficLights2",
  10316. "ThreeSigns",
  10317. "ThreeSymbols",
  10318. "ThreeSymbols2",
  10319. "FourArrows",
  10320. "FourArrowsGray",
  10321. "FourRedToBlack",
  10322. "FourRating",
  10323. "FourTrafficLights",
  10324. "FiveArrows",
  10325. "FiveArrowsGray",
  10326. "FiveRating",
  10327. "FiveQuarters",
  10328. "ThreeStars",
  10329. "ThreeTriangles",
  10330. "FiveBoxes"];
  10331. var iconNames=[["RedDownArrow", "YellowSideArrow", "GreenUpArrow"],
  10332. ["GrayDownArrow", "GraySideArrow", "GrayUpArrow"],
  10333. ["RedFlag", "YellowFlag", "GreenFlag"],
  10334. ["RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  10335. ["RedTrafficLight", "YellowTrafficLight", "GreenTrafficLight"],
  10336. ["RedDiamond", "YellowTriangle", "GreenCircle"],
  10337. ["RedCrossSymbol", "YellowExclamationSymbol", "GreenCheckSymbol"],
  10338. ["RedCross", "YellowExclamation", "GreenCheck"],
  10339. ["RedDownArrow", "YellowDownInclineArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  10340. ["GrayDownArrow", "GrayDownInclineArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  10341. ["BlackCircle", "GrayCircle", "PinkCircle", "RedCircle"],
  10342. ["OneBar", "TwoBars", "ThreeBars", "FourBars"],
  10343. ["BlackCircleWithBorder", "RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  10344. ["RedDownArrow", "YellowDownInclineArrow", "YellowSideArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  10345. ["GrayDownArrow", "GrayDownInclineArrow", "GraySideArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  10346. ["NoBars", "OneBar", "TwoBars", "ThreeBars", "FourBars"],
  10347. ["WhiteCircleAllWhiteQuarters", "CircleWithThreeWhiteQuarters", "CircleWithTwoWhiteQuarters", "CircleWithOneWhiteQuarter", "BlackCircle"],
  10348. ["SilverStar", "HalfGoldStar", "GoldStar"],
  10349. ["RedDownTriangle", "YellowDash", "GreenUpTriangle"],
  10350. ["NoFilledBoxes", "OneFilledBox", "TwoFilledBoxes", "ThreeFilledBoxes", "FourFilledBoxes"],];
  10351. Excel.icons={};
  10352. iconSets.map(function (title, i) {
  10353. var camelTitle=lowerCaseFirst(title);
  10354. Excel.icons[camelTitle]=[];
  10355. iconNames[i].map(function (iconName, j) {
  10356. iconName=lowerCaseFirst(iconName);
  10357. var obj={ set: title, index: j };
  10358. Excel.icons[camelTitle].push(obj);
  10359. Excel.icons[camelTitle][iconName]=obj;
  10360. });
  10361. });
  10362. function setRangePropertiesInBulk(range, propertyName, values) {
  10363. var maxCellCount=1500;
  10364. if (Array.isArray(values) && values.length > 0 && Array.isArray(values[0]) && (values.length * values[0].length > maxCellCount) && isExcel1_3OrAbove()) {
  10365. var maxRowCount=Math.max(1, Math.round(maxCellCount / values[0].length));
  10366. range._ValidateArraySize(values.length, values[0].length);
  10367. for (var startRowIndex=0; startRowIndex < values.length; startRowIndex+=maxRowCount) {
  10368. var rowCount=maxRowCount;
  10369. if (startRowIndex+rowCount > values.length) {
  10370. rowCount=values.length - startRowIndex;
  10371. }
  10372. var chunk=range.getRow(startRowIndex).getBoundingRect(range.getRow(startRowIndex+rowCount - 1));
  10373. var valueSlice=values.slice(startRowIndex, startRowIndex+rowCount);
  10374. _createSetPropertyAction(chunk.context, chunk, propertyName, valueSlice);
  10375. }
  10376. return true;
  10377. }
  10378. return false;
  10379. }
  10380. function isExcel1_3OrAbove() {
  10381. if (typeof (window) !=="undefined" && window.Office && window.Office.context && window.Office.context.requirements) {
  10382. return window.Office.context.requirements.isSetSupported("ExcelApi", 1.3);
  10383. }
  10384. else {
  10385. return true;
  10386. }
  10387. }
  10388. var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath;
  10389. var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath;
  10390. var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath;
  10391. var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath;
  10392. var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer;
  10393. var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt;
  10394. var _createChildItemObjectPathUsingIndexerOrGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt;
  10395. var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction;
  10396. var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction;
  10397. var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined;
  10398. var _isUndefined=OfficeExtension.Utility.isUndefined;
  10399. var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded;
  10400. var _load=OfficeExtension.Utility.load;
  10401. var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary;
  10402. var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler;
  10403. var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults;
  10404. var _adjustToDateTime=OfficeExtension.Utility.adjustToDateTime;
  10405. var Application=(function (_super) {
  10406. __extends(Application, _super);
  10407. function Application() {
  10408. _super.apply(this, arguments);
  10409. }
  10410. Object.defineProperty(Application.prototype, "calculationMode", {
  10411. get: function () {
  10412. _throwIfNotLoaded("calculationMode", this.m_calculationMode, "Application", this._isNull);
  10413. return this.m_calculationMode;
  10414. },
  10415. enumerable: true,
  10416. configurable: true
  10417. });
  10418. Application.prototype.calculate=function (calculationType) {
  10419. _createMethodAction(this.context, this, "Calculate", OfficeExtension.OperationType.Default, [calculationType]);
  10420. };
  10421. Application.prototype._handleResult=function (value) {
  10422. _super.prototype._handleResult.call(this, value);
  10423. if (_isNullOrUndefined(value))
  10424. return;
  10425. var obj=value;
  10426. _fixObjectPathIfNecessary(this, obj);
  10427. if (!_isUndefined(obj["CalculationMode"])) {
  10428. this.m_calculationMode=obj["CalculationMode"];
  10429. }
  10430. };
  10431. Application.prototype.load=function (option) {
  10432. _load(this, option);
  10433. return this;
  10434. };
  10435. Application.prototype.toJSON=function () {
  10436. return {
  10437. "calculationMode": this.m_calculationMode
  10438. };
  10439. };
  10440. return Application;
  10441. }(OfficeExtension.ClientObject));
  10442. Excel.Application=Application;
  10443. var Workbook=(function (_super) {
  10444. __extends(Workbook, _super);
  10445. function Workbook() {
  10446. _super.apply(this, arguments);
  10447. }
  10448. Object.defineProperty(Workbook.prototype, "application", {
  10449. get: function () {
  10450. if (!this.m_application) {
  10451. this.m_application=new Excel.Application(this.context, _createPropertyObjectPath(this.context, this, "Application", false, false));
  10452. }
  10453. return this.m_application;
  10454. },
  10455. enumerable: true,
  10456. configurable: true
  10457. });
  10458. Object.defineProperty(Workbook.prototype, "bindings", {
  10459. get: function () {
  10460. if (!this.m_bindings) {
  10461. this.m_bindings=new Excel.BindingCollection(this.context, _createPropertyObjectPath(this.context, this, "Bindings", true, false));
  10462. }
  10463. return this.m_bindings;
  10464. },
  10465. enumerable: true,
  10466. configurable: true
  10467. });
  10468. Object.defineProperty(Workbook.prototype, "functions", {
  10469. get: function () {
  10470. if (!this.m_functions) {
  10471. this.m_functions=new Excel.Functions(this.context, _createPropertyObjectPath(this.context, this, "Functions", false, false));
  10472. }
  10473. return this.m_functions;
  10474. },
  10475. enumerable: true,
  10476. configurable: true
  10477. });
  10478. Object.defineProperty(Workbook.prototype, "names", {
  10479. get: function () {
  10480. if (!this.m_names) {
  10481. this.m_names=new Excel.NamedItemCollection(this.context, _createPropertyObjectPath(this.context, this, "Names", true, false));
  10482. }
  10483. return this.m_names;
  10484. },
  10485. enumerable: true,
  10486. configurable: true
  10487. });
  10488. Object.defineProperty(Workbook.prototype, "pivotTables", {
  10489. get: function () {
  10490. if (!this.m_pivotTables) {
  10491. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  10492. }
  10493. return this.m_pivotTables;
  10494. },
  10495. enumerable: true,
  10496. configurable: true
  10497. });
  10498. Object.defineProperty(Workbook.prototype, "tables", {
  10499. get: function () {
  10500. if (!this.m_tables) {
  10501. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  10502. }
  10503. return this.m_tables;
  10504. },
  10505. enumerable: true,
  10506. configurable: true
  10507. });
  10508. Object.defineProperty(Workbook.prototype, "worksheets", {
  10509. get: function () {
  10510. if (!this.m_worksheets) {
  10511. this.m_worksheets=new Excel.WorksheetCollection(this.context, _createPropertyObjectPath(this.context, this, "Worksheets", true, false));
  10512. }
  10513. return this.m_worksheets;
  10514. },
  10515. enumerable: true,
  10516. configurable: true
  10517. });
  10518. Object.defineProperty(Workbook.prototype, "_V1Api", {
  10519. get: function () {
  10520. if (!this.m__V1Api) {
  10521. this.m__V1Api=new Excel._V1Api(this.context, _createPropertyObjectPath(this.context, this, "_V1Api", false, false));
  10522. }
  10523. return this.m__V1Api;
  10524. },
  10525. enumerable: true,
  10526. configurable: true
  10527. });
  10528. Workbook.prototype.getSelectedRange=function () {
  10529. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelectedRange", OfficeExtension.OperationType.Read, [], false, true, null));
  10530. };
  10531. Workbook.prototype._GetObjectByReferenceId=function (bstrReferenceId) {
  10532. var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10533. var ret=new OfficeExtension.ClientResult();
  10534. _addActionResultHandler(this, action, ret);
  10535. return ret;
  10536. };
  10537. Workbook.prototype._GetObjectTypeNameByReferenceId=function (bstrReferenceId) {
  10538. var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10539. var ret=new OfficeExtension.ClientResult();
  10540. _addActionResultHandler(this, action, ret);
  10541. return ret;
  10542. };
  10543. Workbook.prototype._GetReferenceCount=function () {
  10544. var action=_createMethodAction(this.context, this, "_GetReferenceCount", OfficeExtension.OperationType.Read, []);
  10545. var ret=new OfficeExtension.ClientResult();
  10546. _addActionResultHandler(this, action, ret);
  10547. return ret;
  10548. };
  10549. Workbook.prototype._RemoveAllReferences=function () {
  10550. _createMethodAction(this.context, this, "_RemoveAllReferences", OfficeExtension.OperationType.Read, []);
  10551. };
  10552. Workbook.prototype._RemoveReference=function (bstrReferenceId) {
  10553. _createMethodAction(this.context, this, "_RemoveReference", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10554. };
  10555. Workbook.prototype._handleResult=function (value) {
  10556. _super.prototype._handleResult.call(this, value);
  10557. if (_isNullOrUndefined(value))
  10558. return;
  10559. var obj=value;
  10560. _fixObjectPathIfNecessary(this, obj);
  10561. _handleNavigationPropertyResults(this, obj, ["application", "Application", "bindings", "Bindings", "functions", "Functions", "names", "Names", "pivotTables", "PivotTables", "tables", "Tables", "worksheets", "Worksheets", "_V1Api", "_V1Api"]);
  10562. };
  10563. Workbook.prototype.load=function (option) {
  10564. _load(this, option);
  10565. return this;
  10566. };
  10567. Object.defineProperty(Workbook.prototype, "onSelectionChanged", {
  10568. get: function () {
  10569. var _this=this;
  10570. if (!this.m_selectionChanged) {
  10571. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  10572. registerFunc: function (handlerCallback) {
  10573. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, handlerCallback, callback); });
  10574. },
  10575. unregisterFunc: function (handlerCallback) {
  10576. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged, { handler: handlerCallback }, callback); });
  10577. },
  10578. eventArgsTransformFunc: function (args) {
  10579. return OfficeExtension.Utility._createPromiseFromResult({ workbook: _this });
  10580. }
  10581. });
  10582. }
  10583. return this.m_selectionChanged;
  10584. },
  10585. enumerable: true,
  10586. configurable: true
  10587. });
  10588. Workbook.prototype.toJSON=function () {
  10589. return {};
  10590. };
  10591. return Workbook;
  10592. }(OfficeExtension.ClientObject));
  10593. Excel.Workbook=Workbook;
  10594. var Worksheet=(function (_super) {
  10595. __extends(Worksheet, _super);
  10596. function Worksheet() {
  10597. _super.apply(this, arguments);
  10598. }
  10599. Object.defineProperty(Worksheet.prototype, "charts", {
  10600. get: function () {
  10601. if (!this.m_charts) {
  10602. this.m_charts=new Excel.ChartCollection(this.context, _createPropertyObjectPath(this.context, this, "Charts", true, false));
  10603. }
  10604. return this.m_charts;
  10605. },
  10606. enumerable: true,
  10607. configurable: true
  10608. });
  10609. Object.defineProperty(Worksheet.prototype, "pivotTables", {
  10610. get: function () {
  10611. if (!this.m_pivotTables) {
  10612. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  10613. }
  10614. return this.m_pivotTables;
  10615. },
  10616. enumerable: true,
  10617. configurable: true
  10618. });
  10619. Object.defineProperty(Worksheet.prototype, "protection", {
  10620. get: function () {
  10621. if (!this.m_protection) {
  10622. this.m_protection=new Excel.WorksheetProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  10623. }
  10624. return this.m_protection;
  10625. },
  10626. enumerable: true,
  10627. configurable: true
  10628. });
  10629. Object.defineProperty(Worksheet.prototype, "tables", {
  10630. get: function () {
  10631. if (!this.m_tables) {
  10632. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  10633. }
  10634. return this.m_tables;
  10635. },
  10636. enumerable: true,
  10637. configurable: true
  10638. });
  10639. Object.defineProperty(Worksheet.prototype, "id", {
  10640. get: function () {
  10641. _throwIfNotLoaded("id", this.m_id, "Worksheet", this._isNull);
  10642. return this.m_id;
  10643. },
  10644. enumerable: true,
  10645. configurable: true
  10646. });
  10647. Object.defineProperty(Worksheet.prototype, "name", {
  10648. get: function () {
  10649. _throwIfNotLoaded("name", this.m_name, "Worksheet", this._isNull);
  10650. return this.m_name;
  10651. },
  10652. set: function (value) {
  10653. this.m_name=value;
  10654. _createSetPropertyAction(this.context, this, "Name", value);
  10655. },
  10656. enumerable: true,
  10657. configurable: true
  10658. });
  10659. Object.defineProperty(Worksheet.prototype, "position", {
  10660. get: function () {
  10661. _throwIfNotLoaded("position", this.m_position, "Worksheet", this._isNull);
  10662. return this.m_position;
  10663. },
  10664. set: function (value) {
  10665. this.m_position=value;
  10666. _createSetPropertyAction(this.context, this, "Position", value);
  10667. },
  10668. enumerable: true,
  10669. configurable: true
  10670. });
  10671. Object.defineProperty(Worksheet.prototype, "visibility", {
  10672. get: function () {
  10673. _throwIfNotLoaded("visibility", this.m_visibility, "Worksheet", this._isNull);
  10674. return this.m_visibility;
  10675. },
  10676. set: function (value) {
  10677. this.m_visibility=value;
  10678. _createSetPropertyAction(this.context, this, "Visibility", value);
  10679. },
  10680. enumerable: true,
  10681. configurable: true
  10682. });
  10683. Worksheet.prototype.activate=function () {
  10684. _createMethodAction(this.context, this, "Activate", OfficeExtension.OperationType.Read, []);
  10685. };
  10686. Worksheet.prototype.delete=function () {
  10687. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  10688. };
  10689. Worksheet.prototype.getCell=function (row, column) {
  10690. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  10691. };
  10692. Worksheet.prototype.getRange=function (address) {
  10693. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [address], false, true, null));
  10694. };
  10695. Worksheet.prototype.getUsedRange=function (valuesOnly) {
  10696. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  10697. };
  10698. Worksheet.prototype._handleResult=function (value) {
  10699. _super.prototype._handleResult.call(this, value);
  10700. if (_isNullOrUndefined(value))
  10701. return;
  10702. var obj=value;
  10703. _fixObjectPathIfNecessary(this, obj);
  10704. if (!_isUndefined(obj["Id"])) {
  10705. this.m_id=obj["Id"];
  10706. }
  10707. if (!_isUndefined(obj["Name"])) {
  10708. this.m_name=obj["Name"];
  10709. }
  10710. if (!_isUndefined(obj["Position"])) {
  10711. this.m_position=obj["Position"];
  10712. }
  10713. if (!_isUndefined(obj["Visibility"])) {
  10714. this.m_visibility=obj["Visibility"];
  10715. }
  10716. _handleNavigationPropertyResults(this, obj, ["charts", "Charts", "pivotTables", "PivotTables", "protection", "Protection", "tables", "Tables"]);
  10717. };
  10718. Worksheet.prototype.load=function (option) {
  10719. _load(this, option);
  10720. return this;
  10721. };
  10722. Worksheet.prototype._handleIdResult=function (value) {
  10723. _super.prototype._handleIdResult.call(this, value);
  10724. if (_isNullOrUndefined(value)) {
  10725. return;
  10726. }
  10727. if (!_isUndefined(value["Id"])) {
  10728. this.m_id=value["Id"];
  10729. }
  10730. };
  10731. Worksheet.prototype.toJSON=function () {
  10732. return {
  10733. "id": this.m_id,
  10734. "name": this.m_name,
  10735. "position": this.m_position,
  10736. "protection": this.m_protection,
  10737. "visibility": this.m_visibility
  10738. };
  10739. };
  10740. return Worksheet;
  10741. }(OfficeExtension.ClientObject));
  10742. Excel.Worksheet=Worksheet;
  10743. var WorksheetCollection=(function (_super) {
  10744. __extends(WorksheetCollection, _super);
  10745. function WorksheetCollection() {
  10746. _super.apply(this, arguments);
  10747. }
  10748. Object.defineProperty(WorksheetCollection.prototype, "items", {
  10749. get: function () {
  10750. _throwIfNotLoaded("items", this.m__items, "WorksheetCollection", this._isNull);
  10751. return this.m__items;
  10752. },
  10753. enumerable: true,
  10754. configurable: true
  10755. });
  10756. WorksheetCollection.prototype.add=function (name) {
  10757. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [name], false, true, null));
  10758. };
  10759. WorksheetCollection.prototype.getActiveWorksheet=function () {
  10760. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "GetActiveWorksheet", OfficeExtension.OperationType.Read, [], false, false, null));
  10761. };
  10762. WorksheetCollection.prototype.getItem=function (key) {
  10763. return new Excel.Worksheet(this.context, _createIndexerObjectPath(this.context, this, [key]));
  10764. };
  10765. WorksheetCollection.prototype._handleResult=function (value) {
  10766. _super.prototype._handleResult.call(this, value);
  10767. if (_isNullOrUndefined(value))
  10768. return;
  10769. var obj=value;
  10770. _fixObjectPathIfNecessary(this, obj);
  10771. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  10772. this.m__items=[];
  10773. var _data=obj[OfficeExtension.Constants.items];
  10774. for (var i=0; i < _data.length; i++) {
  10775. var _item=new Excel.Worksheet(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  10776. _item._handleResult(_data[i]);
  10777. this.m__items.push(_item);
  10778. }
  10779. }
  10780. };
  10781. WorksheetCollection.prototype.load=function (option) {
  10782. _load(this, option);
  10783. return this;
  10784. };
  10785. WorksheetCollection.prototype.toJSON=function () {
  10786. return {};
  10787. };
  10788. return WorksheetCollection;
  10789. }(OfficeExtension.ClientObject));
  10790. Excel.WorksheetCollection=WorksheetCollection;
  10791. var WorksheetProtection=(function (_super) {
  10792. __extends(WorksheetProtection, _super);
  10793. function WorksheetProtection() {
  10794. _super.apply(this, arguments);
  10795. }
  10796. Object.defineProperty(WorksheetProtection.prototype, "options", {
  10797. get: function () {
  10798. _throwIfNotLoaded("options", this.m_options, "WorksheetProtection", this._isNull);
  10799. return this.m_options;
  10800. },
  10801. enumerable: true,
  10802. configurable: true
  10803. });
  10804. Object.defineProperty(WorksheetProtection.prototype, "protected", {
  10805. get: function () {
  10806. _throwIfNotLoaded("protected", this.m_protected, "WorksheetProtection", this._isNull);
  10807. return this.m_protected;
  10808. },
  10809. enumerable: true,
  10810. configurable: true
  10811. });
  10812. WorksheetProtection.prototype.protect=function (options) {
  10813. _createMethodAction(this.context, this, "Protect", OfficeExtension.OperationType.Default, [options]);
  10814. };
  10815. WorksheetProtection.prototype.unprotect=function () {
  10816. _createMethodAction(this.context, this, "Unprotect", OfficeExtension.OperationType.Default, []);
  10817. };
  10818. WorksheetProtection.prototype._handleResult=function (value) {
  10819. _super.prototype._handleResult.call(this, value);
  10820. if (_isNullOrUndefined(value))
  10821. return;
  10822. var obj=value;
  10823. _fixObjectPathIfNecessary(this, obj);
  10824. if (!_isUndefined(obj["Options"])) {
  10825. this.m_options=obj["Options"];
  10826. }
  10827. if (!_isUndefined(obj["Protected"])) {
  10828. this.m_protected=obj["Protected"];
  10829. }
  10830. };
  10831. WorksheetProtection.prototype.load=function (option) {
  10832. _load(this, option);
  10833. return this;
  10834. };
  10835. WorksheetProtection.prototype.toJSON=function () {
  10836. return {
  10837. "options": this.m_options,
  10838. "protected": this.m_protected
  10839. };
  10840. };
  10841. return WorksheetProtection;
  10842. }(OfficeExtension.ClientObject));
  10843. Excel.WorksheetProtection=WorksheetProtection;
  10844. var Range=(function (_super) {
  10845. __extends(Range, _super);
  10846. function Range() {
  10847. _super.apply(this, arguments);
  10848. }
  10849. Range.prototype._ensureInteger=function (num, methodName) {
  10850. if (!(typeof num==="number" && isFinite(num) && Math.floor(num)===num)) {
  10851. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, num, methodName);
  10852. }
  10853. };
  10854. Range.prototype._getAdjacentRange=function (functionName, count, referenceRange, rowDirection, columnDirection) {
  10855. if (count==null) {
  10856. count=1;
  10857. }
  10858. this._ensureInteger(count, functionName);
  10859. var startRange;
  10860. var rowOffset=0;
  10861. var columnOffset=0;
  10862. if (count > 0) {
  10863. startRange=referenceRange.getOffsetRange(rowDirection, columnDirection);
  10864. }
  10865. else {
  10866. startRange=referenceRange;
  10867. rowOffset=rowDirection;
  10868. columnOffset=columnDirection;
  10869. }
  10870. if (Math.abs(count)==1) {
  10871. return startRange;
  10872. }
  10873. return startRange.getBoundingRect(referenceRange.getOffsetRange(rowDirection * count+rowOffset, columnDirection * count+columnOffset));
  10874. };
  10875. Object.defineProperty(Range.prototype, "format", {
  10876. get: function () {
  10877. if (!this.m_format) {
  10878. this.m_format=new Excel.RangeFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  10879. }
  10880. return this.m_format;
  10881. },
  10882. enumerable: true,
  10883. configurable: true
  10884. });
  10885. Object.defineProperty(Range.prototype, "sort", {
  10886. get: function () {
  10887. if (!this.m_sort) {
  10888. this.m_sort=new Excel.RangeSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  10889. }
  10890. return this.m_sort;
  10891. },
  10892. enumerable: true,
  10893. configurable: true
  10894. });
  10895. Object.defineProperty(Range.prototype, "worksheet", {
  10896. get: function () {
  10897. if (!this.m_worksheet) {
  10898. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  10899. }
  10900. return this.m_worksheet;
  10901. },
  10902. enumerable: true,
  10903. configurable: true
  10904. });
  10905. Object.defineProperty(Range.prototype, "address", {
  10906. get: function () {
  10907. _throwIfNotLoaded("address", this.m_address, "Range", this._isNull);
  10908. return this.m_address;
  10909. },
  10910. enumerable: true,
  10911. configurable: true
  10912. });
  10913. Object.defineProperty(Range.prototype, "addressLocal", {
  10914. get: function () {
  10915. _throwIfNotLoaded("addressLocal", this.m_addressLocal, "Range", this._isNull);
  10916. return this.m_addressLocal;
  10917. },
  10918. enumerable: true,
  10919. configurable: true
  10920. });
  10921. Object.defineProperty(Range.prototype, "cellCount", {
  10922. get: function () {
  10923. _throwIfNotLoaded("cellCount", this.m_cellCount, "Range", this._isNull);
  10924. return this.m_cellCount;
  10925. },
  10926. enumerable: true,
  10927. configurable: true
  10928. });
  10929. Object.defineProperty(Range.prototype, "columnCount", {
  10930. get: function () {
  10931. _throwIfNotLoaded("columnCount", this.m_columnCount, "Range", this._isNull);
  10932. return this.m_columnCount;
  10933. },
  10934. enumerable: true,
  10935. configurable: true
  10936. });
  10937. Object.defineProperty(Range.prototype, "columnHidden", {
  10938. get: function () {
  10939. _throwIfNotLoaded("columnHidden", this.m_columnHidden, "Range", this._isNull);
  10940. return this.m_columnHidden;
  10941. },
  10942. set: function (value) {
  10943. this.m_columnHidden=value;
  10944. _createSetPropertyAction(this.context, this, "ColumnHidden", value);
  10945. },
  10946. enumerable: true,
  10947. configurable: true
  10948. });
  10949. Object.defineProperty(Range.prototype, "columnIndex", {
  10950. get: function () {
  10951. _throwIfNotLoaded("columnIndex", this.m_columnIndex, "Range", this._isNull);
  10952. return this.m_columnIndex;
  10953. },
  10954. enumerable: true,
  10955. configurable: true
  10956. });
  10957. Object.defineProperty(Range.prototype, "formulas", {
  10958. get: function () {
  10959. _throwIfNotLoaded("formulas", this.m_formulas, "Range", this._isNull);
  10960. return this.m_formulas;
  10961. },
  10962. set: function (value) {
  10963. this.m_formulas=value;
  10964. if (setRangePropertiesInBulk(this, "Formulas", value)) {
  10965. return;
  10966. }
  10967. this.m_formulas=value;
  10968. _createSetPropertyAction(this.context, this, "Formulas", value);
  10969. },
  10970. enumerable: true,
  10971. configurable: true
  10972. });
  10973. Object.defineProperty(Range.prototype, "formulasLocal", {
  10974. get: function () {
  10975. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "Range", this._isNull);
  10976. return this.m_formulasLocal;
  10977. },
  10978. set: function (value) {
  10979. this.m_formulasLocal=value;
  10980. if (setRangePropertiesInBulk(this, "FormulasLocal", value)) {
  10981. return;
  10982. }
  10983. this.m_formulasLocal=value;
  10984. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  10985. },
  10986. enumerable: true,
  10987. configurable: true
  10988. });
  10989. Object.defineProperty(Range.prototype, "formulasR1C1", {
  10990. get: function () {
  10991. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "Range", this._isNull);
  10992. return this.m_formulasR1C1;
  10993. },
  10994. set: function (value) {
  10995. this.m_formulasR1C1=value;
  10996. if (setRangePropertiesInBulk(this, "FormulasR1C1", value)) {
  10997. return;
  10998. }
  10999. this.m_formulasR1C1=value;
  11000. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  11001. },
  11002. enumerable: true,
  11003. configurable: true
  11004. });
  11005. Object.defineProperty(Range.prototype, "hidden", {
  11006. get: function () {
  11007. _throwIfNotLoaded("hidden", this.m_hidden, "Range", this._isNull);
  11008. return this.m_hidden;
  11009. },
  11010. enumerable: true,
  11011. configurable: true
  11012. });
  11013. Object.defineProperty(Range.prototype, "numberFormat", {
  11014. get: function () {
  11015. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "Range", this._isNull);
  11016. return this.m_numberFormat;
  11017. },
  11018. set: function (value) {
  11019. this.m_numberFormat=value;
  11020. if (setRangePropertiesInBulk(this, "NumberFormat", value)) {
  11021. return;
  11022. }
  11023. this.m_numberFormat=value;
  11024. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  11025. },
  11026. enumerable: true,
  11027. configurable: true
  11028. });
  11029. Object.defineProperty(Range.prototype, "rowCount", {
  11030. get: function () {
  11031. _throwIfNotLoaded("rowCount", this.m_rowCount, "Range", this._isNull);
  11032. return this.m_rowCount;
  11033. },
  11034. enumerable: true,
  11035. configurable: true
  11036. });
  11037. Object.defineProperty(Range.prototype, "rowHidden", {
  11038. get: function () {
  11039. _throwIfNotLoaded("rowHidden", this.m_rowHidden, "Range", this._isNull);
  11040. return this.m_rowHidden;
  11041. },
  11042. set: function (value) {
  11043. this.m_rowHidden=value;
  11044. _createSetPropertyAction(this.context, this, "RowHidden", value);
  11045. },
  11046. enumerable: true,
  11047. configurable: true
  11048. });
  11049. Object.defineProperty(Range.prototype, "rowIndex", {
  11050. get: function () {
  11051. _throwIfNotLoaded("rowIndex", this.m_rowIndex, "Range", this._isNull);
  11052. return this.m_rowIndex;
  11053. },
  11054. enumerable: true,
  11055. configurable: true
  11056. });
  11057. Object.defineProperty(Range.prototype, "text", {
  11058. get: function () {
  11059. _throwIfNotLoaded("text", this.m_text, "Range", this._isNull);
  11060. return this.m_text;
  11061. },
  11062. enumerable: true,
  11063. configurable: true
  11064. });
  11065. Object.defineProperty(Range.prototype, "valueTypes", {
  11066. get: function () {
  11067. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "Range", this._isNull);
  11068. return this.m_valueTypes;
  11069. },
  11070. enumerable: true,
  11071. configurable: true
  11072. });
  11073. Object.defineProperty(Range.prototype, "values", {
  11074. get: function () {
  11075. _throwIfNotLoaded("values", this.m_values, "Range", this._isNull);
  11076. return this.m_values;
  11077. },
  11078. set: function (value) {
  11079. this.m_values=value;
  11080. if (setRangePropertiesInBulk(this, "Values", value)) {
  11081. return;
  11082. }
  11083. this.m_values=value;
  11084. _createSetPropertyAction(this.context, this, "Values", value);
  11085. },
  11086. enumerable: true,
  11087. configurable: true
  11088. });
  11089. Object.defineProperty(Range.prototype, "_ReferenceId", {
  11090. get: function () {
  11091. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId, "Range", this._isNull);
  11092. return this.m__ReferenceId;
  11093. },
  11094. enumerable: true,
  11095. configurable: true
  11096. });
  11097. Range.prototype.clear=function (applyTo) {
  11098. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, [applyTo]);
  11099. };
  11100. Range.prototype.delete=function (shift) {
  11101. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, [shift]);
  11102. };
  11103. Range.prototype.getBoundingRect=function (anotherRange) {
  11104. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetBoundingRect", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  11105. };
  11106. Range.prototype.getCell=function (row, column) {
  11107. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  11108. };
  11109. Range.prototype.getColumn=function (column) {
  11110. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumn", OfficeExtension.OperationType.Read, [column], false, true, null));
  11111. };
  11112. Range.prototype.getColumnsAfter=function (count) {
  11113. if (!isExcel1_3OrAbove()) {
  11114. if (count==null) {
  11115. count=1;
  11116. }
  11117. this._ensureInteger(count, "RowsAbove");
  11118. if (count==0) {
  11119. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11120. }
  11121. return this._getAdjacentRange("getColumnsAfter", count, this.getLastColumn(), 0, 1);
  11122. }
  11123. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsAfter", OfficeExtension.OperationType.Read, [count], false, true, null));
  11124. };
  11125. Range.prototype.getColumnsBefore=function (count) {
  11126. if (!isExcel1_3OrAbove()) {
  11127. if (count==null) {
  11128. count=1;
  11129. }
  11130. this._ensureInteger(count, "RowsAbove");
  11131. if (count==0) {
  11132. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11133. }
  11134. return this._getAdjacentRange("getColumnsBefore", count, this.getColumn(0), 0, -1);
  11135. }
  11136. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsBefore", OfficeExtension.OperationType.Read, [count], false, true, null));
  11137. };
  11138. Range.prototype.getEntireColumn=function () {
  11139. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  11140. };
  11141. Range.prototype.getEntireRow=function () {
  11142. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireRow", OfficeExtension.OperationType.Read, [], false, true, null));
  11143. };
  11144. Range.prototype.getIntersection=function (anotherRange) {
  11145. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetIntersection", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  11146. };
  11147. Range.prototype.getLastCell=function () {
  11148. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastCell", OfficeExtension.OperationType.Read, [], false, true, null));
  11149. };
  11150. Range.prototype.getLastColumn=function () {
  11151. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  11152. };
  11153. Range.prototype.getLastRow=function () {
  11154. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastRow", OfficeExtension.OperationType.Read, [], false, true, null));
  11155. };
  11156. Range.prototype.getOffsetRange=function (rowOffset, columnOffset) {
  11157. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetOffsetRange", OfficeExtension.OperationType.Read, [rowOffset, columnOffset], false, true, null));
  11158. };
  11159. Range.prototype.getResizedRange=function (deltaRows, deltaColumns) {
  11160. if (!isExcel1_3OrAbove()) {
  11161. this._ensureInteger(deltaRows, "getResizedRange");
  11162. this._ensureInteger(deltaColumns, "getResizedRange");
  11163. var referenceRange=(deltaRows >=0 && deltaColumns >=0) ? this : this.getCell(0, 0);
  11164. return referenceRange.getBoundingRect(this.getLastCell().getOffsetRange(deltaRows, deltaColumns));
  11165. }
  11166. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetResizedRange", OfficeExtension.OperationType.Read, [deltaRows, deltaColumns], false, true, null));
  11167. };
  11168. Range.prototype.getRow=function (row) {
  11169. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRow", OfficeExtension.OperationType.Read, [row], false, true, null));
  11170. };
  11171. Range.prototype.getRowsAbove=function (count) {
  11172. if (!isExcel1_3OrAbove()) {
  11173. if (count==null) {
  11174. count=1;
  11175. }
  11176. this._ensureInteger(count, "RowsAbove");
  11177. if (count==0) {
  11178. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11179. }
  11180. return this._getAdjacentRange("getRowsAbove", count, this.getRow(0), -1, 0);
  11181. }
  11182. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsAbove", OfficeExtension.OperationType.Read, [count], false, true, null));
  11183. };
  11184. Range.prototype.getRowsBelow=function (count) {
  11185. if (!isExcel1_3OrAbove()) {
  11186. if (count==null) {
  11187. count=1;
  11188. }
  11189. this._ensureInteger(count, "RowsAbove");
  11190. if (count==0) {
  11191. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11192. }
  11193. return this._getAdjacentRange("getRowsBelow", count, this.getLastRow(), 1, 0);
  11194. }
  11195. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsBelow", OfficeExtension.OperationType.Read, [count], false, true, null));
  11196. };
  11197. Range.prototype.getUsedRange=function (valuesOnly) {
  11198. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  11199. };
  11200. Range.prototype.getVisibleView=function () {
  11201. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetVisibleView", OfficeExtension.OperationType.Read, [], false, false, null));
  11202. };
  11203. Range.prototype.insert=function (shift) {
  11204. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "Insert", OfficeExtension.OperationType.Default, [shift], false, true, null));
  11205. };
  11206. Range.prototype.merge=function (across) {
  11207. _createMethodAction(this.context, this, "Merge", OfficeExtension.OperationType.Default, [across]);
  11208. };
  11209. Range.prototype.select=function () {
  11210. _createMethodAction(this.context, this, "Select", OfficeExtension.OperationType.Read, []);
  11211. };
  11212. Range.prototype.unmerge=function () {
  11213. _createMethodAction(this.context, this, "Unmerge", OfficeExtension.OperationType.Default, []);
  11214. };
  11215. Range.prototype._KeepReference=function () {
  11216. _createMethodAction(this.context, this, "_KeepReference", OfficeExtension.OperationType.Read, []);
  11217. };
  11218. Range.prototype._ValidateArraySize=function (rows, columns) {
  11219. _createMethodAction(this.context, this, "_ValidateArraySize", OfficeExtension.OperationType.Read, [rows, columns]);
  11220. };
  11221. Range.prototype._handleResult=function (value) {
  11222. _super.prototype._handleResult.call(this, value);
  11223. if (_isNullOrUndefined(value))
  11224. return;
  11225. var obj=value;
  11226. _fixObjectPathIfNecessary(this, obj);
  11227. if (!_isUndefined(obj["Address"])) {
  11228. this.m_address=obj["Address"];
  11229. }
  11230. if (!_isUndefined(obj["AddressLocal"])) {
  11231. this.m_addressLocal=obj["AddressLocal"];
  11232. }
  11233. if (!_isUndefined(obj["CellCount"])) {
  11234. this.m_cellCount=obj["CellCount"];
  11235. }
  11236. if (!_isUndefined(obj["ColumnCount"])) {
  11237. this.m_columnCount=obj["ColumnCount"];
  11238. }
  11239. if (!_isUndefined(obj["ColumnHidden"])) {
  11240. this.m_columnHidden=obj["ColumnHidden"];
  11241. }
  11242. if (!_isUndefined(obj["ColumnIndex"])) {
  11243. this.m_columnIndex=obj["ColumnIndex"];
  11244. }
  11245. if (!_isUndefined(obj["Formulas"])) {
  11246. this.m_formulas=obj["Formulas"];
  11247. }
  11248. if (!_isUndefined(obj["FormulasLocal"])) {
  11249. this.m_formulasLocal=obj["FormulasLocal"];
  11250. }
  11251. if (!_isUndefined(obj["FormulasR1C1"])) {
  11252. this.m_formulasR1C1=obj["FormulasR1C1"];
  11253. }
  11254. if (!_isUndefined(obj["Hidden"])) {
  11255. this.m_hidden=obj["Hidden"];
  11256. }
  11257. if (!_isUndefined(obj["NumberFormat"])) {
  11258. this.m_numberFormat=obj["NumberFormat"];
  11259. }
  11260. if (!_isUndefined(obj["RowCount"])) {
  11261. this.m_rowCount=obj["RowCount"];
  11262. }
  11263. if (!_isUndefined(obj["RowHidden"])) {
  11264. this.m_rowHidden=obj["RowHidden"];
  11265. }
  11266. if (!_isUndefined(obj["RowIndex"])) {
  11267. this.m_rowIndex=obj["RowIndex"];
  11268. }
  11269. if (!_isUndefined(obj["Text"])) {
  11270. this.m_text=obj["Text"];
  11271. }
  11272. if (!_isUndefined(obj["ValueTypes"])) {
  11273. this.m_valueTypes=obj["ValueTypes"];
  11274. }
  11275. if (!_isUndefined(obj["Values"])) {
  11276. this.m_values=obj["Values"];
  11277. }
  11278. if (!_isUndefined(obj["_ReferenceId"])) {
  11279. this.m__ReferenceId=obj["_ReferenceId"];
  11280. }
  11281. _handleNavigationPropertyResults(this, obj, ["format", "Format", "sort", "Sort", "worksheet", "Worksheet"]);
  11282. };
  11283. Range.prototype.load=function (option) {
  11284. _load(this, option);
  11285. return this;
  11286. };
  11287. Range.prototype._handleIdResult=function (value) {
  11288. _super.prototype._handleIdResult.call(this, value);
  11289. if (_isNullOrUndefined(value)) {
  11290. return;
  11291. }
  11292. if (!_isUndefined(value["_ReferenceId"])) {
  11293. this.m__ReferenceId=value["_ReferenceId"];
  11294. }
  11295. };
  11296. Range.prototype.track=function () {
  11297. this.context.trackedObjects.add(this);
  11298. return this;
  11299. };
  11300. Range.prototype.untrack=function () {
  11301. this.context.trackedObjects.remove(this);
  11302. return this;
  11303. };
  11304. Range.prototype.toJSON=function () {
  11305. return {
  11306. "address": this.m_address,
  11307. "addressLocal": this.m_addressLocal,
  11308. "cellCount": this.m_cellCount,
  11309. "columnCount": this.m_columnCount,
  11310. "columnHidden": this.m_columnHidden,
  11311. "columnIndex": this.m_columnIndex,
  11312. "format": this.m_format,
  11313. "formulas": this.m_formulas,
  11314. "formulasLocal": this.m_formulasLocal,
  11315. "formulasR1C1": this.m_formulasR1C1,
  11316. "hidden": this.m_hidden,
  11317. "numberFormat": this.m_numberFormat,
  11318. "rowCount": this.m_rowCount,
  11319. "rowHidden": this.m_rowHidden,
  11320. "rowIndex": this.m_rowIndex,
  11321. "text": this.m_text,
  11322. "values": this.m_values,
  11323. "valueTypes": this.m_valueTypes
  11324. };
  11325. };
  11326. return Range;
  11327. }(OfficeExtension.ClientObject));
  11328. Excel.Range=Range;
  11329. var RangeView=(function (_super) {
  11330. __extends(RangeView, _super);
  11331. function RangeView() {
  11332. _super.apply(this, arguments);
  11333. }
  11334. Object.defineProperty(RangeView.prototype, "rows", {
  11335. get: function () {
  11336. if (!this.m_rows) {
  11337. this.m_rows=new Excel.RangeViewCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  11338. }
  11339. return this.m_rows;
  11340. },
  11341. enumerable: true,
  11342. configurable: true
  11343. });
  11344. Object.defineProperty(RangeView.prototype, "cellAddresses", {
  11345. get: function () {
  11346. _throwIfNotLoaded("cellAddresses", this.m_cellAddresses, "RangeView", this._isNull);
  11347. return this.m_cellAddresses;
  11348. },
  11349. enumerable: true,
  11350. configurable: true
  11351. });
  11352. Object.defineProperty(RangeView.prototype, "columnCount", {
  11353. get: function () {
  11354. _throwIfNotLoaded("columnCount", this.m_columnCount, "RangeView", this._isNull);
  11355. return this.m_columnCount;
  11356. },
  11357. enumerable: true,
  11358. configurable: true
  11359. });
  11360. Object.defineProperty(RangeView.prototype, "formulas", {
  11361. get: function () {
  11362. _throwIfNotLoaded("formulas", this.m_formulas, "RangeView", this._isNull);
  11363. return this.m_formulas;
  11364. },
  11365. set: function (value) {
  11366. this.m_formulas=value;
  11367. _createSetPropertyAction(this.context, this, "Formulas", value);
  11368. },
  11369. enumerable: true,
  11370. configurable: true
  11371. });
  11372. Object.defineProperty(RangeView.prototype, "formulasLocal", {
  11373. get: function () {
  11374. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "RangeView", this._isNull);
  11375. return this.m_formulasLocal;
  11376. },
  11377. set: function (value) {
  11378. this.m_formulasLocal=value;
  11379. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  11380. },
  11381. enumerable: true,
  11382. configurable: true
  11383. });
  11384. Object.defineProperty(RangeView.prototype, "formulasR1C1", {
  11385. get: function () {
  11386. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "RangeView", this._isNull);
  11387. return this.m_formulasR1C1;
  11388. },
  11389. set: function (value) {
  11390. this.m_formulasR1C1=value;
  11391. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  11392. },
  11393. enumerable: true,
  11394. configurable: true
  11395. });
  11396. Object.defineProperty(RangeView.prototype, "index", {
  11397. get: function () {
  11398. _throwIfNotLoaded("index", this.m_index, "RangeView", this._isNull);
  11399. return this.m_index;
  11400. },
  11401. enumerable: true,
  11402. configurable: true
  11403. });
  11404. Object.defineProperty(RangeView.prototype, "numberFormat", {
  11405. get: function () {
  11406. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "RangeView", this._isNull);
  11407. return this.m_numberFormat;
  11408. },
  11409. set: function (value) {
  11410. this.m_numberFormat=value;
  11411. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  11412. },
  11413. enumerable: true,
  11414. configurable: true
  11415. });
  11416. Object.defineProperty(RangeView.prototype, "rowCount", {
  11417. get: function () {
  11418. _throwIfNotLoaded("rowCount", this.m_rowCount, "RangeView", this._isNull);
  11419. return this.m_rowCount;
  11420. },
  11421. enumerable: true,
  11422. configurable: true
  11423. });
  11424. Object.defineProperty(RangeView.prototype, "text", {
  11425. get: function () {
  11426. _throwIfNotLoaded("text", this.m_text, "RangeView", this._isNull);
  11427. return this.m_text;
  11428. },
  11429. enumerable: true,
  11430. configurable: true
  11431. });
  11432. Object.defineProperty(RangeView.prototype, "valueTypes", {
  11433. get: function () {
  11434. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "RangeView", this._isNull);
  11435. return this.m_valueTypes;
  11436. },
  11437. enumerable: true,
  11438. configurable: true
  11439. });
  11440. Object.defineProperty(RangeView.prototype, "values", {
  11441. get: function () {
  11442. _throwIfNotLoaded("values", this.m_values, "RangeView", this._isNull);
  11443. return this.m_values;
  11444. },
  11445. set: function (value) {
  11446. this.m_values=value;
  11447. _createSetPropertyAction(this.context, this, "Values", value);
  11448. },
  11449. enumerable: true,
  11450. configurable: true
  11451. });
  11452. RangeView.prototype.getRange=function () {
  11453. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  11454. };
  11455. RangeView.prototype._handleResult=function (value) {
  11456. _super.prototype._handleResult.call(this, value);
  11457. if (_isNullOrUndefined(value))
  11458. return;
  11459. var obj=value;
  11460. _fixObjectPathIfNecessary(this, obj);
  11461. if (!_isUndefined(obj["CellAddresses"])) {
  11462. this.m_cellAddresses=obj["CellAddresses"];
  11463. }
  11464. if (!_isUndefined(obj["ColumnCount"])) {
  11465. this.m_columnCount=obj["ColumnCount"];
  11466. }
  11467. if (!_isUndefined(obj["Formulas"])) {
  11468. this.m_formulas=obj["Formulas"];
  11469. }
  11470. if (!_isUndefined(obj["FormulasLocal"])) {
  11471. this.m_formulasLocal=obj["FormulasLocal"];
  11472. }
  11473. if (!_isUndefined(obj["FormulasR1C1"])) {
  11474. this.m_formulasR1C1=obj["FormulasR1C1"];
  11475. }
  11476. if (!_isUndefined(obj["Index"])) {
  11477. this.m_index=obj["Index"];
  11478. }
  11479. if (!_isUndefined(obj["NumberFormat"])) {
  11480. this.m_numberFormat=obj["NumberFormat"];
  11481. }
  11482. if (!_isUndefined(obj["RowCount"])) {
  11483. this.m_rowCount=obj["RowCount"];
  11484. }
  11485. if (!_isUndefined(obj["Text"])) {
  11486. this.m_text=obj["Text"];
  11487. }
  11488. if (!_isUndefined(obj["ValueTypes"])) {
  11489. this.m_valueTypes=obj["ValueTypes"];
  11490. }
  11491. if (!_isUndefined(obj["Values"])) {
  11492. this.m_values=obj["Values"];
  11493. }
  11494. _handleNavigationPropertyResults(this, obj, ["rows", "Rows"]);
  11495. };
  11496. RangeView.prototype.load=function (option) {
  11497. _load(this, option);
  11498. return this;
  11499. };
  11500. RangeView.prototype.toJSON=function () {
  11501. return {
  11502. "cellAddresses": this.m_cellAddresses,
  11503. "columnCount": this.m_columnCount,
  11504. "formulas": this.m_formulas,
  11505. "formulasLocal": this.m_formulasLocal,
  11506. "formulasR1C1": this.m_formulasR1C1,
  11507. "index": this.m_index,
  11508. "numberFormat": this.m_numberFormat,
  11509. "rowCount": this.m_rowCount,
  11510. "text": this.m_text,
  11511. "values": this.m_values,
  11512. "valueTypes": this.m_valueTypes
  11513. };
  11514. };
  11515. return RangeView;
  11516. }(OfficeExtension.ClientObject));
  11517. Excel.RangeView=RangeView;
  11518. var RangeViewCollection=(function (_super) {
  11519. __extends(RangeViewCollection, _super);
  11520. function RangeViewCollection() {
  11521. _super.apply(this, arguments);
  11522. }
  11523. Object.defineProperty(RangeViewCollection.prototype, "items", {
  11524. get: function () {
  11525. _throwIfNotLoaded("items", this.m__items, "RangeViewCollection", this._isNull);
  11526. return this.m__items;
  11527. },
  11528. enumerable: true,
  11529. configurable: true
  11530. });
  11531. RangeViewCollection.prototype.getItemAt=function (index) {
  11532. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  11533. };
  11534. RangeViewCollection.prototype._handleResult=function (value) {
  11535. _super.prototype._handleResult.call(this, value);
  11536. if (_isNullOrUndefined(value))
  11537. return;
  11538. var obj=value;
  11539. _fixObjectPathIfNecessary(this, obj);
  11540. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11541. this.m__items=[];
  11542. var _data=obj[OfficeExtension.Constants.items];
  11543. for (var i=0; i < _data.length; i++) {
  11544. var _item=new Excel.RangeView(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  11545. _item._handleResult(_data[i]);
  11546. this.m__items.push(_item);
  11547. }
  11548. }
  11549. };
  11550. RangeViewCollection.prototype.load=function (option) {
  11551. _load(this, option);
  11552. return this;
  11553. };
  11554. RangeViewCollection.prototype.toJSON=function () {
  11555. return {};
  11556. };
  11557. return RangeViewCollection;
  11558. }(OfficeExtension.ClientObject));
  11559. Excel.RangeViewCollection=RangeViewCollection;
  11560. var Setting=(function (_super) {
  11561. __extends(Setting, _super);
  11562. function Setting() {
  11563. _super.apply(this, arguments);
  11564. }
  11565. Object.defineProperty(Setting.prototype, "value", {
  11566. get: function () {
  11567. return JSON.parse(this._Value);
  11568. },
  11569. set: function (value) {
  11570. this._Value=JSON.stringify(value);
  11571. },
  11572. enumerable: true,
  11573. configurable: true
  11574. });
  11575. Object.defineProperty(Setting.prototype, "key", {
  11576. get: function () {
  11577. _throwIfNotLoaded("key", this.m_key, "Setting", this._isNull);
  11578. return this.m_key;
  11579. },
  11580. enumerable: true,
  11581. configurable: true
  11582. });
  11583. Object.defineProperty(Setting.prototype, "_Value", {
  11584. get: function () {
  11585. _throwIfNotLoaded("_Value", this.m__Value, "Setting", this._isNull);
  11586. return this.m__Value;
  11587. },
  11588. set: function (value) {
  11589. this.m__Value=value;
  11590. _createSetPropertyAction(this.context, this, "_Value", value);
  11591. },
  11592. enumerable: true,
  11593. configurable: true
  11594. });
  11595. Setting.prototype.delete=function () {
  11596. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  11597. };
  11598. Setting.prototype._handleResult=function (value) {
  11599. _super.prototype._handleResult.call(this, value);
  11600. if (_isNullOrUndefined(value))
  11601. return;
  11602. var obj=value;
  11603. _fixObjectPathIfNecessary(this, obj);
  11604. if (!_isUndefined(obj["Key"])) {
  11605. this.m_key=obj["Key"];
  11606. }
  11607. if (!_isUndefined(obj["_Value"])) {
  11608. this.m__Value=obj["_Value"];
  11609. }
  11610. };
  11611. Setting.prototype.load=function (option) {
  11612. _load(this, option);
  11613. return this;
  11614. };
  11615. Setting.prototype.toJSON=function () {
  11616. return {
  11617. "key": this.m_key
  11618. };
  11619. };
  11620. return Setting;
  11621. }(OfficeExtension.ClientObject));
  11622. Excel.Setting=Setting;
  11623. var NamedItemCollection=(function (_super) {
  11624. __extends(NamedItemCollection, _super);
  11625. function NamedItemCollection() {
  11626. _super.apply(this, arguments);
  11627. }
  11628. Object.defineProperty(NamedItemCollection.prototype, "items", {
  11629. get: function () {
  11630. _throwIfNotLoaded("items", this.m__items, "NamedItemCollection", this._isNull);
  11631. return this.m__items;
  11632. },
  11633. enumerable: true,
  11634. configurable: true
  11635. });
  11636. NamedItemCollection.prototype.getItem=function (name) {
  11637. return new Excel.NamedItem(this.context, _createIndexerObjectPath(this.context, this, [name]));
  11638. };
  11639. NamedItemCollection.prototype._handleResult=function (value) {
  11640. _super.prototype._handleResult.call(this, value);
  11641. if (_isNullOrUndefined(value))
  11642. return;
  11643. var obj=value;
  11644. _fixObjectPathIfNecessary(this, obj);
  11645. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11646. this.m__items=[];
  11647. var _data=obj[OfficeExtension.Constants.items];
  11648. for (var i=0; i < _data.length; i++) {
  11649. var _item=new Excel.NamedItem(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  11650. _item._handleResult(_data[i]);
  11651. this.m__items.push(_item);
  11652. }
  11653. }
  11654. };
  11655. NamedItemCollection.prototype.load=function (option) {
  11656. _load(this, option);
  11657. return this;
  11658. };
  11659. NamedItemCollection.prototype.toJSON=function () {
  11660. return {};
  11661. };
  11662. return NamedItemCollection;
  11663. }(OfficeExtension.ClientObject));
  11664. Excel.NamedItemCollection=NamedItemCollection;
  11665. var NamedItem=(function (_super) {
  11666. __extends(NamedItem, _super);
  11667. function NamedItem() {
  11668. _super.apply(this, arguments);
  11669. }
  11670. Object.defineProperty(NamedItem.prototype, "name", {
  11671. get: function () {
  11672. _throwIfNotLoaded("name", this.m_name, "NamedItem", this._isNull);
  11673. return this.m_name;
  11674. },
  11675. enumerable: true,
  11676. configurable: true
  11677. });
  11678. Object.defineProperty(NamedItem.prototype, "type", {
  11679. get: function () {
  11680. _throwIfNotLoaded("type", this.m_type, "NamedItem", this._isNull);
  11681. return this.m_type;
  11682. },
  11683. enumerable: true,
  11684. configurable: true
  11685. });
  11686. Object.defineProperty(NamedItem.prototype, "value", {
  11687. get: function () {
  11688. _throwIfNotLoaded("value", this.m_value, "NamedItem", this._isNull);
  11689. return this.m_value;
  11690. },
  11691. enumerable: true,
  11692. configurable: true
  11693. });
  11694. Object.defineProperty(NamedItem.prototype, "visible", {
  11695. get: function () {
  11696. _throwIfNotLoaded("visible", this.m_visible, "NamedItem", this._isNull);
  11697. return this.m_visible;
  11698. },
  11699. set: function (value) {
  11700. this.m_visible=value;
  11701. _createSetPropertyAction(this.context, this, "Visible", value);
  11702. },
  11703. enumerable: true,
  11704. configurable: true
  11705. });
  11706. Object.defineProperty(NamedItem.prototype, "_Id", {
  11707. get: function () {
  11708. _throwIfNotLoaded("_Id", this.m__Id, "NamedItem", this._isNull);
  11709. return this.m__Id;
  11710. },
  11711. enumerable: true,
  11712. configurable: true
  11713. });
  11714. NamedItem.prototype.getRange=function () {
  11715. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  11716. };
  11717. NamedItem.prototype._handleResult=function (value) {
  11718. _super.prototype._handleResult.call(this, value);
  11719. if (_isNullOrUndefined(value))
  11720. return;
  11721. var obj=value;
  11722. _fixObjectPathIfNecessary(this, obj);
  11723. if (!_isUndefined(obj["Name"])) {
  11724. this.m_name=obj["Name"];
  11725. }
  11726. if (!_isUndefined(obj["Type"])) {
  11727. this.m_type=obj["Type"];
  11728. }
  11729. if (!_isUndefined(obj["Value"])) {
  11730. this.m_value=obj["Value"];
  11731. }
  11732. if (!_isUndefined(obj["Visible"])) {
  11733. this.m_visible=obj["Visible"];
  11734. }
  11735. if (!_isUndefined(obj["_Id"])) {
  11736. this.m__Id=obj["_Id"];
  11737. }
  11738. };
  11739. NamedItem.prototype.load=function (option) {
  11740. _load(this, option);
  11741. return this;
  11742. };
  11743. NamedItem.prototype._handleIdResult=function (value) {
  11744. _super.prototype._handleIdResult.call(this, value);
  11745. if (_isNullOrUndefined(value)) {
  11746. return;
  11747. }
  11748. if (!_isUndefined(value["_Id"])) {
  11749. this.m__Id=value["_Id"];
  11750. }
  11751. };
  11752. NamedItem.prototype.toJSON=function () {
  11753. return {
  11754. "name": this.m_name,
  11755. "type": this.m_type,
  11756. "value": this.m_value,
  11757. "visible": this.m_visible
  11758. };
  11759. };
  11760. return NamedItem;
  11761. }(OfficeExtension.ClientObject));
  11762. Excel.NamedItem=NamedItem;
  11763. var Binding=(function (_super) {
  11764. __extends(Binding, _super);
  11765. function Binding() {
  11766. _super.apply(this, arguments);
  11767. }
  11768. Object.defineProperty(Binding.prototype, "id", {
  11769. get: function () {
  11770. _throwIfNotLoaded("id", this.m_id, "Binding", this._isNull);
  11771. return this.m_id;
  11772. },
  11773. enumerable: true,
  11774. configurable: true
  11775. });
  11776. Object.defineProperty(Binding.prototype, "type", {
  11777. get: function () {
  11778. _throwIfNotLoaded("type", this.m_type, "Binding", this._isNull);
  11779. return this.m_type;
  11780. },
  11781. enumerable: true,
  11782. configurable: true
  11783. });
  11784. Binding.prototype.delete=function () {
  11785. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  11786. };
  11787. Binding.prototype.getRange=function () {
  11788. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, false, null));
  11789. };
  11790. Binding.prototype.getTable=function () {
  11791. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetTable", OfficeExtension.OperationType.Read, [], false, false, null));
  11792. };
  11793. Binding.prototype.getText=function () {
  11794. var action=_createMethodAction(this.context, this, "GetText", OfficeExtension.OperationType.Read, []);
  11795. var ret=new OfficeExtension.ClientResult();
  11796. _addActionResultHandler(this, action, ret);
  11797. return ret;
  11798. };
  11799. Binding.prototype._handleResult=function (value) {
  11800. _super.prototype._handleResult.call(this, value);
  11801. if (_isNullOrUndefined(value))
  11802. return;
  11803. var obj=value;
  11804. _fixObjectPathIfNecessary(this, obj);
  11805. if (!_isUndefined(obj["Id"])) {
  11806. this.m_id=obj["Id"];
  11807. }
  11808. if (!_isUndefined(obj["Type"])) {
  11809. this.m_type=obj["Type"];
  11810. }
  11811. };
  11812. Binding.prototype.load=function (option) {
  11813. _load(this, option);
  11814. return this;
  11815. };
  11816. Binding.prototype._handleIdResult=function (value) {
  11817. _super.prototype._handleIdResult.call(this, value);
  11818. if (_isNullOrUndefined(value)) {
  11819. return;
  11820. }
  11821. if (!_isUndefined(value["Id"])) {
  11822. this.m_id=value["Id"];
  11823. }
  11824. };
  11825. Object.defineProperty(Binding.prototype, "onDataChanged", {
  11826. get: function () {
  11827. var _this=this;
  11828. if (!this.m_dataChanged) {
  11829. this.m_dataChanged=new OfficeExtension.EventHandlers(this.context, this, "DataChanged", {
  11830. registerFunc: function (handlerCallback) {
  11831. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  11832. .then(function (officeBinding) {
  11833. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingDataChanged, handlerCallback, callback); });
  11834. });
  11835. },
  11836. unregisterFunc: function (handlerCallback) {
  11837. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  11838. .then(function (officeBinding) {
  11839. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingDataChanged, { handler: handlerCallback }, callback); });
  11840. });
  11841. },
  11842. eventArgsTransformFunc: function (args) {
  11843. var evt={
  11844. binding: _this
  11845. };
  11846. return OfficeExtension.Utility._createPromiseFromResult(evt);
  11847. }
  11848. });
  11849. }
  11850. return this.m_dataChanged;
  11851. },
  11852. enumerable: true,
  11853. configurable: true
  11854. });
  11855. Object.defineProperty(Binding.prototype, "onSelectionChanged", {
  11856. get: function () {
  11857. var _this=this;
  11858. if (!this.m_selectionChanged) {
  11859. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  11860. registerFunc: function (handlerCallback) {
  11861. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  11862. .then(function (officeBinding) {
  11863. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingSelectionChanged, handlerCallback, callback); });
  11864. });
  11865. },
  11866. unregisterFunc: function (handlerCallback) {
  11867. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  11868. .then(function (officeBinding) {
  11869. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingSelectionChanged, { handler: handlerCallback }, callback); });
  11870. });
  11871. },
  11872. eventArgsTransformFunc: function (args) {
  11873. var evt={
  11874. binding: _this,
  11875. columnCount: args.columnCount,
  11876. rowCount: args.rowCount,
  11877. startColumn: args.startColumn,
  11878. startRow: args.startRow
  11879. };
  11880. return OfficeExtension.Utility._createPromiseFromResult(evt);
  11881. }
  11882. });
  11883. }
  11884. return this.m_selectionChanged;
  11885. },
  11886. enumerable: true,
  11887. configurable: true
  11888. });
  11889. Binding.prototype.toJSON=function () {
  11890. return {
  11891. "id": this.m_id,
  11892. "type": this.m_type
  11893. };
  11894. };
  11895. return Binding;
  11896. }(OfficeExtension.ClientObject));
  11897. Excel.Binding=Binding;
  11898. var BindingCollection=(function (_super) {
  11899. __extends(BindingCollection, _super);
  11900. function BindingCollection() {
  11901. _super.apply(this, arguments);
  11902. }
  11903. Object.defineProperty(BindingCollection.prototype, "items", {
  11904. get: function () {
  11905. _throwIfNotLoaded("items", this.m__items, "BindingCollection", this._isNull);
  11906. return this.m__items;
  11907. },
  11908. enumerable: true,
  11909. configurable: true
  11910. });
  11911. Object.defineProperty(BindingCollection.prototype, "count", {
  11912. get: function () {
  11913. _throwIfNotLoaded("count", this.m_count, "BindingCollection", this._isNull);
  11914. return this.m_count;
  11915. },
  11916. enumerable: true,
  11917. configurable: true
  11918. });
  11919. BindingCollection.prototype.add=function (range, bindingType, id) {
  11920. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [range, bindingType, id], false, true, null));
  11921. };
  11922. BindingCollection.prototype.addFromNamedItem=function (name, bindingType, id) {
  11923. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromNamedItem", OfficeExtension.OperationType.Default, [name, bindingType, id], false, false, null));
  11924. };
  11925. BindingCollection.prototype.addFromSelection=function (bindingType, id) {
  11926. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromSelection", OfficeExtension.OperationType.Default, [bindingType, id], false, false, null));
  11927. };
  11928. BindingCollection.prototype.getItem=function (id) {
  11929. return new Excel.Binding(this.context, _createIndexerObjectPath(this.context, this, [id]));
  11930. };
  11931. BindingCollection.prototype.getItemAt=function (index) {
  11932. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  11933. };
  11934. BindingCollection.prototype._handleResult=function (value) {
  11935. _super.prototype._handleResult.call(this, value);
  11936. if (_isNullOrUndefined(value))
  11937. return;
  11938. var obj=value;
  11939. _fixObjectPathIfNecessary(this, obj);
  11940. if (!_isUndefined(obj["Count"])) {
  11941. this.m_count=obj["Count"];
  11942. }
  11943. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11944. this.m__items=[];
  11945. var _data=obj[OfficeExtension.Constants.items];
  11946. for (var i=0; i < _data.length; i++) {
  11947. var _item=new Excel.Binding(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  11948. _item._handleResult(_data[i]);
  11949. this.m__items.push(_item);
  11950. }
  11951. }
  11952. };
  11953. BindingCollection.prototype.load=function (option) {
  11954. _load(this, option);
  11955. return this;
  11956. };
  11957. BindingCollection.prototype.toJSON=function () {
  11958. return {
  11959. "count": this.m_count
  11960. };
  11961. };
  11962. return BindingCollection;
  11963. }(OfficeExtension.ClientObject));
  11964. Excel.BindingCollection=BindingCollection;
  11965. var TableCollection=(function (_super) {
  11966. __extends(TableCollection, _super);
  11967. function TableCollection() {
  11968. _super.apply(this, arguments);
  11969. }
  11970. Object.defineProperty(TableCollection.prototype, "items", {
  11971. get: function () {
  11972. _throwIfNotLoaded("items", this.m__items, "TableCollection", this._isNull);
  11973. return this.m__items;
  11974. },
  11975. enumerable: true,
  11976. configurable: true
  11977. });
  11978. Object.defineProperty(TableCollection.prototype, "count", {
  11979. get: function () {
  11980. _throwIfNotLoaded("count", this.m_count, "TableCollection", this._isNull);
  11981. return this.m_count;
  11982. },
  11983. enumerable: true,
  11984. configurable: true
  11985. });
  11986. TableCollection.prototype.add=function (address, hasHeaders) {
  11987. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [address, hasHeaders], false, true, null));
  11988. };
  11989. TableCollection.prototype.getItem=function (key) {
  11990. return new Excel.Table(this.context, _createIndexerObjectPath(this.context, this, [key]));
  11991. };
  11992. TableCollection.prototype.getItemAt=function (index) {
  11993. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  11994. };
  11995. TableCollection.prototype._handleResult=function (value) {
  11996. _super.prototype._handleResult.call(this, value);
  11997. if (_isNullOrUndefined(value))
  11998. return;
  11999. var obj=value;
  12000. _fixObjectPathIfNecessary(this, obj);
  12001. if (!_isUndefined(obj["Count"])) {
  12002. this.m_count=obj["Count"];
  12003. }
  12004. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12005. this.m__items=[];
  12006. var _data=obj[OfficeExtension.Constants.items];
  12007. for (var i=0; i < _data.length; i++) {
  12008. var _item=new Excel.Table(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12009. _item._handleResult(_data[i]);
  12010. this.m__items.push(_item);
  12011. }
  12012. }
  12013. };
  12014. TableCollection.prototype.load=function (option) {
  12015. _load(this, option);
  12016. return this;
  12017. };
  12018. TableCollection.prototype.toJSON=function () {
  12019. return {
  12020. "count": this.m_count
  12021. };
  12022. };
  12023. return TableCollection;
  12024. }(OfficeExtension.ClientObject));
  12025. Excel.TableCollection=TableCollection;
  12026. var Table=(function (_super) {
  12027. __extends(Table, _super);
  12028. function Table() {
  12029. _super.apply(this, arguments);
  12030. }
  12031. Object.defineProperty(Table.prototype, "columns", {
  12032. get: function () {
  12033. if (!this.m_columns) {
  12034. this.m_columns=new Excel.TableColumnCollection(this.context, _createPropertyObjectPath(this.context, this, "Columns", true, false));
  12035. }
  12036. return this.m_columns;
  12037. },
  12038. enumerable: true,
  12039. configurable: true
  12040. });
  12041. Object.defineProperty(Table.prototype, "rows", {
  12042. get: function () {
  12043. if (!this.m_rows) {
  12044. this.m_rows=new Excel.TableRowCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  12045. }
  12046. return this.m_rows;
  12047. },
  12048. enumerable: true,
  12049. configurable: true
  12050. });
  12051. Object.defineProperty(Table.prototype, "sort", {
  12052. get: function () {
  12053. if (!this.m_sort) {
  12054. this.m_sort=new Excel.TableSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  12055. }
  12056. return this.m_sort;
  12057. },
  12058. enumerable: true,
  12059. configurable: true
  12060. });
  12061. Object.defineProperty(Table.prototype, "worksheet", {
  12062. get: function () {
  12063. if (!this.m_worksheet) {
  12064. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  12065. }
  12066. return this.m_worksheet;
  12067. },
  12068. enumerable: true,
  12069. configurable: true
  12070. });
  12071. Object.defineProperty(Table.prototype, "highlightFirstColumn", {
  12072. get: function () {
  12073. _throwIfNotLoaded("highlightFirstColumn", this.m_highlightFirstColumn, "Table", this._isNull);
  12074. return this.m_highlightFirstColumn;
  12075. },
  12076. set: function (value) {
  12077. this.m_highlightFirstColumn=value;
  12078. _createSetPropertyAction(this.context, this, "HighlightFirstColumn", value);
  12079. },
  12080. enumerable: true,
  12081. configurable: true
  12082. });
  12083. Object.defineProperty(Table.prototype, "highlightLastColumn", {
  12084. get: function () {
  12085. _throwIfNotLoaded("highlightLastColumn", this.m_highlightLastColumn, "Table", this._isNull);
  12086. return this.m_highlightLastColumn;
  12087. },
  12088. set: function (value) {
  12089. this.m_highlightLastColumn=value;
  12090. _createSetPropertyAction(this.context, this, "HighlightLastColumn", value);
  12091. },
  12092. enumerable: true,
  12093. configurable: true
  12094. });
  12095. Object.defineProperty(Table.prototype, "id", {
  12096. get: function () {
  12097. _throwIfNotLoaded("id", this.m_id, "Table", this._isNull);
  12098. return this.m_id;
  12099. },
  12100. enumerable: true,
  12101. configurable: true
  12102. });
  12103. Object.defineProperty(Table.prototype, "name", {
  12104. get: function () {
  12105. _throwIfNotLoaded("name", this.m_name, "Table", this._isNull);
  12106. return this.m_name;
  12107. },
  12108. set: function (value) {
  12109. this.m_name=value;
  12110. _createSetPropertyAction(this.context, this, "Name", value);
  12111. },
  12112. enumerable: true,
  12113. configurable: true
  12114. });
  12115. Object.defineProperty(Table.prototype, "showBandedColumns", {
  12116. get: function () {
  12117. _throwIfNotLoaded("showBandedColumns", this.m_showBandedColumns, "Table", this._isNull);
  12118. return this.m_showBandedColumns;
  12119. },
  12120. set: function (value) {
  12121. this.m_showBandedColumns=value;
  12122. _createSetPropertyAction(this.context, this, "ShowBandedColumns", value);
  12123. },
  12124. enumerable: true,
  12125. configurable: true
  12126. });
  12127. Object.defineProperty(Table.prototype, "showBandedRows", {
  12128. get: function () {
  12129. _throwIfNotLoaded("showBandedRows", this.m_showBandedRows, "Table", this._isNull);
  12130. return this.m_showBandedRows;
  12131. },
  12132. set: function (value) {
  12133. this.m_showBandedRows=value;
  12134. _createSetPropertyAction(this.context, this, "ShowBandedRows", value);
  12135. },
  12136. enumerable: true,
  12137. configurable: true
  12138. });
  12139. Object.defineProperty(Table.prototype, "showFilterButton", {
  12140. get: function () {
  12141. _throwIfNotLoaded("showFilterButton", this.m_showFilterButton, "Table", this._isNull);
  12142. return this.m_showFilterButton;
  12143. },
  12144. set: function (value) {
  12145. this.m_showFilterButton=value;
  12146. _createSetPropertyAction(this.context, this, "ShowFilterButton", value);
  12147. },
  12148. enumerable: true,
  12149. configurable: true
  12150. });
  12151. Object.defineProperty(Table.prototype, "showHeaders", {
  12152. get: function () {
  12153. _throwIfNotLoaded("showHeaders", this.m_showHeaders, "Table", this._isNull);
  12154. return this.m_showHeaders;
  12155. },
  12156. set: function (value) {
  12157. this.m_showHeaders=value;
  12158. _createSetPropertyAction(this.context, this, "ShowHeaders", value);
  12159. },
  12160. enumerable: true,
  12161. configurable: true
  12162. });
  12163. Object.defineProperty(Table.prototype, "showTotals", {
  12164. get: function () {
  12165. _throwIfNotLoaded("showTotals", this.m_showTotals, "Table", this._isNull);
  12166. return this.m_showTotals;
  12167. },
  12168. set: function (value) {
  12169. this.m_showTotals=value;
  12170. _createSetPropertyAction(this.context, this, "ShowTotals", value);
  12171. },
  12172. enumerable: true,
  12173. configurable: true
  12174. });
  12175. Object.defineProperty(Table.prototype, "style", {
  12176. get: function () {
  12177. _throwIfNotLoaded("style", this.m_style, "Table", this._isNull);
  12178. return this.m_style;
  12179. },
  12180. set: function (value) {
  12181. this.m_style=value;
  12182. _createSetPropertyAction(this.context, this, "Style", value);
  12183. },
  12184. enumerable: true,
  12185. configurable: true
  12186. });
  12187. Table.prototype.clearFilters=function () {
  12188. _createMethodAction(this.context, this, "ClearFilters", OfficeExtension.OperationType.Default, []);
  12189. };
  12190. Table.prototype.convertToRange=function () {
  12191. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "ConvertToRange", OfficeExtension.OperationType.Default, [], false, true, null));
  12192. };
  12193. Table.prototype.delete=function () {
  12194. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12195. };
  12196. Table.prototype.getDataBodyRange=function () {
  12197. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12198. };
  12199. Table.prototype.getHeaderRowRange=function () {
  12200. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12201. };
  12202. Table.prototype.getRange=function () {
  12203. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12204. };
  12205. Table.prototype.getTotalRowRange=function () {
  12206. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12207. };
  12208. Table.prototype.reapplyFilters=function () {
  12209. _createMethodAction(this.context, this, "ReapplyFilters", OfficeExtension.OperationType.Default, []);
  12210. };
  12211. Table.prototype._handleResult=function (value) {
  12212. _super.prototype._handleResult.call(this, value);
  12213. if (_isNullOrUndefined(value))
  12214. return;
  12215. var obj=value;
  12216. _fixObjectPathIfNecessary(this, obj);
  12217. if (!_isUndefined(obj["HighlightFirstColumn"])) {
  12218. this.m_highlightFirstColumn=obj["HighlightFirstColumn"];
  12219. }
  12220. if (!_isUndefined(obj["HighlightLastColumn"])) {
  12221. this.m_highlightLastColumn=obj["HighlightLastColumn"];
  12222. }
  12223. if (!_isUndefined(obj["Id"])) {
  12224. this.m_id=obj["Id"];
  12225. }
  12226. if (!_isUndefined(obj["Name"])) {
  12227. this.m_name=obj["Name"];
  12228. }
  12229. if (!_isUndefined(obj["ShowBandedColumns"])) {
  12230. this.m_showBandedColumns=obj["ShowBandedColumns"];
  12231. }
  12232. if (!_isUndefined(obj["ShowBandedRows"])) {
  12233. this.m_showBandedRows=obj["ShowBandedRows"];
  12234. }
  12235. if (!_isUndefined(obj["ShowFilterButton"])) {
  12236. this.m_showFilterButton=obj["ShowFilterButton"];
  12237. }
  12238. if (!_isUndefined(obj["ShowHeaders"])) {
  12239. this.m_showHeaders=obj["ShowHeaders"];
  12240. }
  12241. if (!_isUndefined(obj["ShowTotals"])) {
  12242. this.m_showTotals=obj["ShowTotals"];
  12243. }
  12244. if (!_isUndefined(obj["Style"])) {
  12245. this.m_style=obj["Style"];
  12246. }
  12247. _handleNavigationPropertyResults(this, obj, ["columns", "Columns", "rows", "Rows", "sort", "Sort", "worksheet", "Worksheet"]);
  12248. };
  12249. Table.prototype.load=function (option) {
  12250. _load(this, option);
  12251. return this;
  12252. };
  12253. Table.prototype._handleIdResult=function (value) {
  12254. _super.prototype._handleIdResult.call(this, value);
  12255. if (_isNullOrUndefined(value)) {
  12256. return;
  12257. }
  12258. if (!_isUndefined(value["Id"])) {
  12259. this.m_id=value["Id"];
  12260. }
  12261. };
  12262. Table.prototype.toJSON=function () {
  12263. return {
  12264. "highlightFirstColumn": this.m_highlightFirstColumn,
  12265. "highlightLastColumn": this.m_highlightLastColumn,
  12266. "id": this.m_id,
  12267. "name": this.m_name,
  12268. "showBandedColumns": this.m_showBandedColumns,
  12269. "showBandedRows": this.m_showBandedRows,
  12270. "showFilterButton": this.m_showFilterButton,
  12271. "showHeaders": this.m_showHeaders,
  12272. "showTotals": this.m_showTotals,
  12273. "style": this.m_style
  12274. };
  12275. };
  12276. return Table;
  12277. }(OfficeExtension.ClientObject));
  12278. Excel.Table=Table;
  12279. var TableColumnCollection=(function (_super) {
  12280. __extends(TableColumnCollection, _super);
  12281. function TableColumnCollection() {
  12282. _super.apply(this, arguments);
  12283. }
  12284. Object.defineProperty(TableColumnCollection.prototype, "items", {
  12285. get: function () {
  12286. _throwIfNotLoaded("items", this.m__items, "TableColumnCollection", this._isNull);
  12287. return this.m__items;
  12288. },
  12289. enumerable: true,
  12290. configurable: true
  12291. });
  12292. Object.defineProperty(TableColumnCollection.prototype, "count", {
  12293. get: function () {
  12294. _throwIfNotLoaded("count", this.m_count, "TableColumnCollection", this._isNull);
  12295. return this.m_count;
  12296. },
  12297. enumerable: true,
  12298. configurable: true
  12299. });
  12300. TableColumnCollection.prototype.add=function (index, values) {
  12301. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  12302. };
  12303. TableColumnCollection.prototype.getItem=function (key) {
  12304. return new Excel.TableColumn(this.context, _createIndexerObjectPath(this.context, this, [key]));
  12305. };
  12306. TableColumnCollection.prototype.getItemAt=function (index) {
  12307. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12308. };
  12309. TableColumnCollection.prototype._handleResult=function (value) {
  12310. _super.prototype._handleResult.call(this, value);
  12311. if (_isNullOrUndefined(value))
  12312. return;
  12313. var obj=value;
  12314. _fixObjectPathIfNecessary(this, obj);
  12315. if (!_isUndefined(obj["Count"])) {
  12316. this.m_count=obj["Count"];
  12317. }
  12318. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12319. this.m__items=[];
  12320. var _data=obj[OfficeExtension.Constants.items];
  12321. for (var i=0; i < _data.length; i++) {
  12322. var _item=new Excel.TableColumn(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12323. _item._handleResult(_data[i]);
  12324. this.m__items.push(_item);
  12325. }
  12326. }
  12327. };
  12328. TableColumnCollection.prototype.load=function (option) {
  12329. _load(this, option);
  12330. return this;
  12331. };
  12332. TableColumnCollection.prototype.toJSON=function () {
  12333. return {
  12334. "count": this.m_count
  12335. };
  12336. };
  12337. return TableColumnCollection;
  12338. }(OfficeExtension.ClientObject));
  12339. Excel.TableColumnCollection=TableColumnCollection;
  12340. var TableColumn=(function (_super) {
  12341. __extends(TableColumn, _super);
  12342. function TableColumn() {
  12343. _super.apply(this, arguments);
  12344. }
  12345. Object.defineProperty(TableColumn.prototype, "filter", {
  12346. get: function () {
  12347. if (!this.m_filter) {
  12348. this.m_filter=new Excel.Filter(this.context, _createPropertyObjectPath(this.context, this, "Filter", false, false));
  12349. }
  12350. return this.m_filter;
  12351. },
  12352. enumerable: true,
  12353. configurable: true
  12354. });
  12355. Object.defineProperty(TableColumn.prototype, "id", {
  12356. get: function () {
  12357. _throwIfNotLoaded("id", this.m_id, "TableColumn", this._isNull);
  12358. return this.m_id;
  12359. },
  12360. enumerable: true,
  12361. configurable: true
  12362. });
  12363. Object.defineProperty(TableColumn.prototype, "index", {
  12364. get: function () {
  12365. _throwIfNotLoaded("index", this.m_index, "TableColumn", this._isNull);
  12366. return this.m_index;
  12367. },
  12368. enumerable: true,
  12369. configurable: true
  12370. });
  12371. Object.defineProperty(TableColumn.prototype, "name", {
  12372. get: function () {
  12373. _throwIfNotLoaded("name", this.m_name, "TableColumn", this._isNull);
  12374. return this.m_name;
  12375. },
  12376. enumerable: true,
  12377. configurable: true
  12378. });
  12379. Object.defineProperty(TableColumn.prototype, "values", {
  12380. get: function () {
  12381. _throwIfNotLoaded("values", this.m_values, "TableColumn", this._isNull);
  12382. return this.m_values;
  12383. },
  12384. set: function (value) {
  12385. this.m_values=value;
  12386. _createSetPropertyAction(this.context, this, "Values", value);
  12387. },
  12388. enumerable: true,
  12389. configurable: true
  12390. });
  12391. TableColumn.prototype.delete=function () {
  12392. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12393. };
  12394. TableColumn.prototype.getDataBodyRange=function () {
  12395. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12396. };
  12397. TableColumn.prototype.getHeaderRowRange=function () {
  12398. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12399. };
  12400. TableColumn.prototype.getRange=function () {
  12401. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12402. };
  12403. TableColumn.prototype.getTotalRowRange=function () {
  12404. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12405. };
  12406. TableColumn.prototype._handleResult=function (value) {
  12407. _super.prototype._handleResult.call(this, value);
  12408. if (_isNullOrUndefined(value))
  12409. return;
  12410. var obj=value;
  12411. _fixObjectPathIfNecessary(this, obj);
  12412. if (!_isUndefined(obj["Id"])) {
  12413. this.m_id=obj["Id"];
  12414. }
  12415. if (!_isUndefined(obj["Index"])) {
  12416. this.m_index=obj["Index"];
  12417. }
  12418. if (!_isUndefined(obj["Name"])) {
  12419. this.m_name=obj["Name"];
  12420. }
  12421. if (!_isUndefined(obj["Values"])) {
  12422. this.m_values=obj["Values"];
  12423. }
  12424. _handleNavigationPropertyResults(this, obj, ["filter", "Filter"]);
  12425. };
  12426. TableColumn.prototype.load=function (option) {
  12427. _load(this, option);
  12428. return this;
  12429. };
  12430. TableColumn.prototype._handleIdResult=function (value) {
  12431. _super.prototype._handleIdResult.call(this, value);
  12432. if (_isNullOrUndefined(value)) {
  12433. return;
  12434. }
  12435. if (!_isUndefined(value["Id"])) {
  12436. this.m_id=value["Id"];
  12437. }
  12438. };
  12439. TableColumn.prototype.toJSON=function () {
  12440. return {
  12441. "id": this.m_id,
  12442. "index": this.m_index,
  12443. "name": this.m_name,
  12444. "values": this.m_values
  12445. };
  12446. };
  12447. return TableColumn;
  12448. }(OfficeExtension.ClientObject));
  12449. Excel.TableColumn=TableColumn;
  12450. var TableRowCollection=(function (_super) {
  12451. __extends(TableRowCollection, _super);
  12452. function TableRowCollection() {
  12453. _super.apply(this, arguments);
  12454. }
  12455. Object.defineProperty(TableRowCollection.prototype, "items", {
  12456. get: function () {
  12457. _throwIfNotLoaded("items", this.m__items, "TableRowCollection", this._isNull);
  12458. return this.m__items;
  12459. },
  12460. enumerable: true,
  12461. configurable: true
  12462. });
  12463. Object.defineProperty(TableRowCollection.prototype, "count", {
  12464. get: function () {
  12465. _throwIfNotLoaded("count", this.m_count, "TableRowCollection", this._isNull);
  12466. return this.m_count;
  12467. },
  12468. enumerable: true,
  12469. configurable: true
  12470. });
  12471. TableRowCollection.prototype.add=function (index, values) {
  12472. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  12473. };
  12474. TableRowCollection.prototype.getItemAt=function (index) {
  12475. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12476. };
  12477. TableRowCollection.prototype._handleResult=function (value) {
  12478. _super.prototype._handleResult.call(this, value);
  12479. if (_isNullOrUndefined(value))
  12480. return;
  12481. var obj=value;
  12482. _fixObjectPathIfNecessary(this, obj);
  12483. if (!_isUndefined(obj["Count"])) {
  12484. this.m_count=obj["Count"];
  12485. }
  12486. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12487. this.m__items=[];
  12488. var _data=obj[OfficeExtension.Constants.items];
  12489. for (var i=0; i < _data.length; i++) {
  12490. var _item=new Excel.TableRow(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  12491. _item._handleResult(_data[i]);
  12492. this.m__items.push(_item);
  12493. }
  12494. }
  12495. };
  12496. TableRowCollection.prototype.load=function (option) {
  12497. _load(this, option);
  12498. return this;
  12499. };
  12500. TableRowCollection.prototype.toJSON=function () {
  12501. return {
  12502. "count": this.m_count
  12503. };
  12504. };
  12505. return TableRowCollection;
  12506. }(OfficeExtension.ClientObject));
  12507. Excel.TableRowCollection=TableRowCollection;
  12508. var TableRow=(function (_super) {
  12509. __extends(TableRow, _super);
  12510. function TableRow() {
  12511. _super.apply(this, arguments);
  12512. }
  12513. Object.defineProperty(TableRow.prototype, "index", {
  12514. get: function () {
  12515. _throwIfNotLoaded("index", this.m_index, "TableRow", this._isNull);
  12516. return this.m_index;
  12517. },
  12518. enumerable: true,
  12519. configurable: true
  12520. });
  12521. Object.defineProperty(TableRow.prototype, "values", {
  12522. get: function () {
  12523. _throwIfNotLoaded("values", this.m_values, "TableRow", this._isNull);
  12524. return this.m_values;
  12525. },
  12526. set: function (value) {
  12527. this.m_values=value;
  12528. _createSetPropertyAction(this.context, this, "Values", value);
  12529. },
  12530. enumerable: true,
  12531. configurable: true
  12532. });
  12533. TableRow.prototype.delete=function () {
  12534. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12535. };
  12536. TableRow.prototype.getRange=function () {
  12537. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12538. };
  12539. TableRow.prototype._handleResult=function (value) {
  12540. _super.prototype._handleResult.call(this, value);
  12541. if (_isNullOrUndefined(value))
  12542. return;
  12543. var obj=value;
  12544. _fixObjectPathIfNecessary(this, obj);
  12545. if (!_isUndefined(obj["Index"])) {
  12546. this.m_index=obj["Index"];
  12547. }
  12548. if (!_isUndefined(obj["Values"])) {
  12549. this.m_values=obj["Values"];
  12550. }
  12551. };
  12552. TableRow.prototype.load=function (option) {
  12553. _load(this, option);
  12554. return this;
  12555. };
  12556. TableRow.prototype.toJSON=function () {
  12557. return {
  12558. "index": this.m_index,
  12559. "values": this.m_values
  12560. };
  12561. };
  12562. return TableRow;
  12563. }(OfficeExtension.ClientObject));
  12564. Excel.TableRow=TableRow;
  12565. var RangeFormat=(function (_super) {
  12566. __extends(RangeFormat, _super);
  12567. function RangeFormat() {
  12568. _super.apply(this, arguments);
  12569. }
  12570. Object.defineProperty(RangeFormat.prototype, "borders", {
  12571. get: function () {
  12572. if (!this.m_borders) {
  12573. this.m_borders=new Excel.RangeBorderCollection(this.context, _createPropertyObjectPath(this.context, this, "Borders", true, false));
  12574. }
  12575. return this.m_borders;
  12576. },
  12577. enumerable: true,
  12578. configurable: true
  12579. });
  12580. Object.defineProperty(RangeFormat.prototype, "fill", {
  12581. get: function () {
  12582. if (!this.m_fill) {
  12583. this.m_fill=new Excel.RangeFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  12584. }
  12585. return this.m_fill;
  12586. },
  12587. enumerable: true,
  12588. configurable: true
  12589. });
  12590. Object.defineProperty(RangeFormat.prototype, "font", {
  12591. get: function () {
  12592. if (!this.m_font) {
  12593. this.m_font=new Excel.RangeFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  12594. }
  12595. return this.m_font;
  12596. },
  12597. enumerable: true,
  12598. configurable: true
  12599. });
  12600. Object.defineProperty(RangeFormat.prototype, "protection", {
  12601. get: function () {
  12602. if (!this.m_protection) {
  12603. this.m_protection=new Excel.FormatProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  12604. }
  12605. return this.m_protection;
  12606. },
  12607. enumerable: true,
  12608. configurable: true
  12609. });
  12610. Object.defineProperty(RangeFormat.prototype, "columnWidth", {
  12611. get: function () {
  12612. _throwIfNotLoaded("columnWidth", this.m_columnWidth, "RangeFormat", this._isNull);
  12613. return this.m_columnWidth;
  12614. },
  12615. set: function (value) {
  12616. this.m_columnWidth=value;
  12617. _createSetPropertyAction(this.context, this, "ColumnWidth", value);
  12618. },
  12619. enumerable: true,
  12620. configurable: true
  12621. });
  12622. Object.defineProperty(RangeFormat.prototype, "horizontalAlignment", {
  12623. get: function () {
  12624. _throwIfNotLoaded("horizontalAlignment", this.m_horizontalAlignment, "RangeFormat", this._isNull);
  12625. return this.m_horizontalAlignment;
  12626. },
  12627. set: function (value) {
  12628. this.m_horizontalAlignment=value;
  12629. _createSetPropertyAction(this.context, this, "HorizontalAlignment", value);
  12630. },
  12631. enumerable: true,
  12632. configurable: true
  12633. });
  12634. Object.defineProperty(RangeFormat.prototype, "rowHeight", {
  12635. get: function () {
  12636. _throwIfNotLoaded("rowHeight", this.m_rowHeight, "RangeFormat", this._isNull);
  12637. return this.m_rowHeight;
  12638. },
  12639. set: function (value) {
  12640. this.m_rowHeight=value;
  12641. _createSetPropertyAction(this.context, this, "RowHeight", value);
  12642. },
  12643. enumerable: true,
  12644. configurable: true
  12645. });
  12646. Object.defineProperty(RangeFormat.prototype, "verticalAlignment", {
  12647. get: function () {
  12648. _throwIfNotLoaded("verticalAlignment", this.m_verticalAlignment, "RangeFormat", this._isNull);
  12649. return this.m_verticalAlignment;
  12650. },
  12651. set: function (value) {
  12652. this.m_verticalAlignment=value;
  12653. _createSetPropertyAction(this.context, this, "VerticalAlignment", value);
  12654. },
  12655. enumerable: true,
  12656. configurable: true
  12657. });
  12658. Object.defineProperty(RangeFormat.prototype, "wrapText", {
  12659. get: function () {
  12660. _throwIfNotLoaded("wrapText", this.m_wrapText, "RangeFormat", this._isNull);
  12661. return this.m_wrapText;
  12662. },
  12663. set: function (value) {
  12664. this.m_wrapText=value;
  12665. _createSetPropertyAction(this.context, this, "WrapText", value);
  12666. },
  12667. enumerable: true,
  12668. configurable: true
  12669. });
  12670. RangeFormat.prototype.autofitColumns=function () {
  12671. _createMethodAction(this.context, this, "AutofitColumns", OfficeExtension.OperationType.Default, []);
  12672. };
  12673. RangeFormat.prototype.autofitRows=function () {
  12674. _createMethodAction(this.context, this, "AutofitRows", OfficeExtension.OperationType.Default, []);
  12675. };
  12676. RangeFormat.prototype._handleResult=function (value) {
  12677. _super.prototype._handleResult.call(this, value);
  12678. if (_isNullOrUndefined(value))
  12679. return;
  12680. var obj=value;
  12681. _fixObjectPathIfNecessary(this, obj);
  12682. if (!_isUndefined(obj["ColumnWidth"])) {
  12683. this.m_columnWidth=obj["ColumnWidth"];
  12684. }
  12685. if (!_isUndefined(obj["HorizontalAlignment"])) {
  12686. this.m_horizontalAlignment=obj["HorizontalAlignment"];
  12687. }
  12688. if (!_isUndefined(obj["RowHeight"])) {
  12689. this.m_rowHeight=obj["RowHeight"];
  12690. }
  12691. if (!_isUndefined(obj["VerticalAlignment"])) {
  12692. this.m_verticalAlignment=obj["VerticalAlignment"];
  12693. }
  12694. if (!_isUndefined(obj["WrapText"])) {
  12695. this.m_wrapText=obj["WrapText"];
  12696. }
  12697. _handleNavigationPropertyResults(this, obj, ["borders", "Borders", "fill", "Fill", "font", "Font", "protection", "Protection"]);
  12698. };
  12699. RangeFormat.prototype.load=function (option) {
  12700. _load(this, option);
  12701. return this;
  12702. };
  12703. RangeFormat.prototype.toJSON=function () {
  12704. return {
  12705. "columnWidth": this.m_columnWidth,
  12706. "fill": this.m_fill,
  12707. "font": this.m_font,
  12708. "horizontalAlignment": this.m_horizontalAlignment,
  12709. "protection": this.m_protection,
  12710. "rowHeight": this.m_rowHeight,
  12711. "verticalAlignment": this.m_verticalAlignment,
  12712. "wrapText": this.m_wrapText
  12713. };
  12714. };
  12715. return RangeFormat;
  12716. }(OfficeExtension.ClientObject));
  12717. Excel.RangeFormat=RangeFormat;
  12718. var FormatProtection=(function (_super) {
  12719. __extends(FormatProtection, _super);
  12720. function FormatProtection() {
  12721. _super.apply(this, arguments);
  12722. }
  12723. Object.defineProperty(FormatProtection.prototype, "formulaHidden", {
  12724. get: function () {
  12725. _throwIfNotLoaded("formulaHidden", this.m_formulaHidden, "FormatProtection", this._isNull);
  12726. return this.m_formulaHidden;
  12727. },
  12728. set: function (value) {
  12729. this.m_formulaHidden=value;
  12730. _createSetPropertyAction(this.context, this, "FormulaHidden", value);
  12731. },
  12732. enumerable: true,
  12733. configurable: true
  12734. });
  12735. Object.defineProperty(FormatProtection.prototype, "locked", {
  12736. get: function () {
  12737. _throwIfNotLoaded("locked", this.m_locked, "FormatProtection", this._isNull);
  12738. return this.m_locked;
  12739. },
  12740. set: function (value) {
  12741. this.m_locked=value;
  12742. _createSetPropertyAction(this.context, this, "Locked", value);
  12743. },
  12744. enumerable: true,
  12745. configurable: true
  12746. });
  12747. FormatProtection.prototype._handleResult=function (value) {
  12748. _super.prototype._handleResult.call(this, value);
  12749. if (_isNullOrUndefined(value))
  12750. return;
  12751. var obj=value;
  12752. _fixObjectPathIfNecessary(this, obj);
  12753. if (!_isUndefined(obj["FormulaHidden"])) {
  12754. this.m_formulaHidden=obj["FormulaHidden"];
  12755. }
  12756. if (!_isUndefined(obj["Locked"])) {
  12757. this.m_locked=obj["Locked"];
  12758. }
  12759. };
  12760. FormatProtection.prototype.load=function (option) {
  12761. _load(this, option);
  12762. return this;
  12763. };
  12764. FormatProtection.prototype.toJSON=function () {
  12765. return {
  12766. "formulaHidden": this.m_formulaHidden,
  12767. "locked": this.m_locked
  12768. };
  12769. };
  12770. return FormatProtection;
  12771. }(OfficeExtension.ClientObject));
  12772. Excel.FormatProtection=FormatProtection;
  12773. var RangeFill=(function (_super) {
  12774. __extends(RangeFill, _super);
  12775. function RangeFill() {
  12776. _super.apply(this, arguments);
  12777. }
  12778. Object.defineProperty(RangeFill.prototype, "color", {
  12779. get: function () {
  12780. _throwIfNotLoaded("color", this.m_color, "RangeFill", this._isNull);
  12781. return this.m_color;
  12782. },
  12783. set: function (value) {
  12784. this.m_color=value;
  12785. _createSetPropertyAction(this.context, this, "Color", value);
  12786. },
  12787. enumerable: true,
  12788. configurable: true
  12789. });
  12790. RangeFill.prototype.clear=function () {
  12791. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  12792. };
  12793. RangeFill.prototype._handleResult=function (value) {
  12794. _super.prototype._handleResult.call(this, value);
  12795. if (_isNullOrUndefined(value))
  12796. return;
  12797. var obj=value;
  12798. _fixObjectPathIfNecessary(this, obj);
  12799. if (!_isUndefined(obj["Color"])) {
  12800. this.m_color=obj["Color"];
  12801. }
  12802. };
  12803. RangeFill.prototype.load=function (option) {
  12804. _load(this, option);
  12805. return this;
  12806. };
  12807. RangeFill.prototype.toJSON=function () {
  12808. return {
  12809. "color": this.m_color
  12810. };
  12811. };
  12812. return RangeFill;
  12813. }(OfficeExtension.ClientObject));
  12814. Excel.RangeFill=RangeFill;
  12815. var RangeBorder=(function (_super) {
  12816. __extends(RangeBorder, _super);
  12817. function RangeBorder() {
  12818. _super.apply(this, arguments);
  12819. }
  12820. Object.defineProperty(RangeBorder.prototype, "color", {
  12821. get: function () {
  12822. _throwIfNotLoaded("color", this.m_color, "RangeBorder", this._isNull);
  12823. return this.m_color;
  12824. },
  12825. set: function (value) {
  12826. this.m_color=value;
  12827. _createSetPropertyAction(this.context, this, "Color", value);
  12828. },
  12829. enumerable: true,
  12830. configurable: true
  12831. });
  12832. Object.defineProperty(RangeBorder.prototype, "sideIndex", {
  12833. get: function () {
  12834. _throwIfNotLoaded("sideIndex", this.m_sideIndex, "RangeBorder", this._isNull);
  12835. return this.m_sideIndex;
  12836. },
  12837. enumerable: true,
  12838. configurable: true
  12839. });
  12840. Object.defineProperty(RangeBorder.prototype, "style", {
  12841. get: function () {
  12842. _throwIfNotLoaded("style", this.m_style, "RangeBorder", this._isNull);
  12843. return this.m_style;
  12844. },
  12845. set: function (value) {
  12846. this.m_style=value;
  12847. _createSetPropertyAction(this.context, this, "Style", value);
  12848. },
  12849. enumerable: true,
  12850. configurable: true
  12851. });
  12852. Object.defineProperty(RangeBorder.prototype, "weight", {
  12853. get: function () {
  12854. _throwIfNotLoaded("weight", this.m_weight, "RangeBorder", this._isNull);
  12855. return this.m_weight;
  12856. },
  12857. set: function (value) {
  12858. this.m_weight=value;
  12859. _createSetPropertyAction(this.context, this, "Weight", value);
  12860. },
  12861. enumerable: true,
  12862. configurable: true
  12863. });
  12864. RangeBorder.prototype._handleResult=function (value) {
  12865. _super.prototype._handleResult.call(this, value);
  12866. if (_isNullOrUndefined(value))
  12867. return;
  12868. var obj=value;
  12869. _fixObjectPathIfNecessary(this, obj);
  12870. if (!_isUndefined(obj["Color"])) {
  12871. this.m_color=obj["Color"];
  12872. }
  12873. if (!_isUndefined(obj["SideIndex"])) {
  12874. this.m_sideIndex=obj["SideIndex"];
  12875. }
  12876. if (!_isUndefined(obj["Style"])) {
  12877. this.m_style=obj["Style"];
  12878. }
  12879. if (!_isUndefined(obj["Weight"])) {
  12880. this.m_weight=obj["Weight"];
  12881. }
  12882. };
  12883. RangeBorder.prototype.load=function (option) {
  12884. _load(this, option);
  12885. return this;
  12886. };
  12887. RangeBorder.prototype.toJSON=function () {
  12888. return {
  12889. "color": this.m_color,
  12890. "sideIndex": this.m_sideIndex,
  12891. "style": this.m_style,
  12892. "weight": this.m_weight
  12893. };
  12894. };
  12895. return RangeBorder;
  12896. }(OfficeExtension.ClientObject));
  12897. Excel.RangeBorder=RangeBorder;
  12898. var RangeBorderCollection=(function (_super) {
  12899. __extends(RangeBorderCollection, _super);
  12900. function RangeBorderCollection() {
  12901. _super.apply(this, arguments);
  12902. }
  12903. Object.defineProperty(RangeBorderCollection.prototype, "items", {
  12904. get: function () {
  12905. _throwIfNotLoaded("items", this.m__items, "RangeBorderCollection", this._isNull);
  12906. return this.m__items;
  12907. },
  12908. enumerable: true,
  12909. configurable: true
  12910. });
  12911. Object.defineProperty(RangeBorderCollection.prototype, "count", {
  12912. get: function () {
  12913. _throwIfNotLoaded("count", this.m_count, "RangeBorderCollection", this._isNull);
  12914. return this.m_count;
  12915. },
  12916. enumerable: true,
  12917. configurable: true
  12918. });
  12919. RangeBorderCollection.prototype.getItem=function (index) {
  12920. return new Excel.RangeBorder(this.context, _createIndexerObjectPath(this.context, this, [index]));
  12921. };
  12922. RangeBorderCollection.prototype.getItemAt=function (index) {
  12923. return new Excel.RangeBorder(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12924. };
  12925. RangeBorderCollection.prototype._handleResult=function (value) {
  12926. _super.prototype._handleResult.call(this, value);
  12927. if (_isNullOrUndefined(value))
  12928. return;
  12929. var obj=value;
  12930. _fixObjectPathIfNecessary(this, obj);
  12931. if (!_isUndefined(obj["Count"])) {
  12932. this.m_count=obj["Count"];
  12933. }
  12934. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12935. this.m__items=[];
  12936. var _data=obj[OfficeExtension.Constants.items];
  12937. for (var i=0; i < _data.length; i++) {
  12938. var _item=new Excel.RangeBorder(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12939. _item._handleResult(_data[i]);
  12940. this.m__items.push(_item);
  12941. }
  12942. }
  12943. };
  12944. RangeBorderCollection.prototype.load=function (option) {
  12945. _load(this, option);
  12946. return this;
  12947. };
  12948. RangeBorderCollection.prototype.toJSON=function () {
  12949. return {
  12950. "count": this.m_count
  12951. };
  12952. };
  12953. return RangeBorderCollection;
  12954. }(OfficeExtension.ClientObject));
  12955. Excel.RangeBorderCollection=RangeBorderCollection;
  12956. var RangeFont=(function (_super) {
  12957. __extends(RangeFont, _super);
  12958. function RangeFont() {
  12959. _super.apply(this, arguments);
  12960. }
  12961. Object.defineProperty(RangeFont.prototype, "bold", {
  12962. get: function () {
  12963. _throwIfNotLoaded("bold", this.m_bold, "RangeFont", this._isNull);
  12964. return this.m_bold;
  12965. },
  12966. set: function (value) {
  12967. this.m_bold=value;
  12968. _createSetPropertyAction(this.context, this, "Bold", value);
  12969. },
  12970. enumerable: true,
  12971. configurable: true
  12972. });
  12973. Object.defineProperty(RangeFont.prototype, "color", {
  12974. get: function () {
  12975. _throwIfNotLoaded("color", this.m_color, "RangeFont", this._isNull);
  12976. return this.m_color;
  12977. },
  12978. set: function (value) {
  12979. this.m_color=value;
  12980. _createSetPropertyAction(this.context, this, "Color", value);
  12981. },
  12982. enumerable: true,
  12983. configurable: true
  12984. });
  12985. Object.defineProperty(RangeFont.prototype, "italic", {
  12986. get: function () {
  12987. _throwIfNotLoaded("italic", this.m_italic, "RangeFont", this._isNull);
  12988. return this.m_italic;
  12989. },
  12990. set: function (value) {
  12991. this.m_italic=value;
  12992. _createSetPropertyAction(this.context, this, "Italic", value);
  12993. },
  12994. enumerable: true,
  12995. configurable: true
  12996. });
  12997. Object.defineProperty(RangeFont.prototype, "name", {
  12998. get: function () {
  12999. _throwIfNotLoaded("name", this.m_name, "RangeFont", this._isNull);
  13000. return this.m_name;
  13001. },
  13002. set: function (value) {
  13003. this.m_name=value;
  13004. _createSetPropertyAction(this.context, this, "Name", value);
  13005. },
  13006. enumerable: true,
  13007. configurable: true
  13008. });
  13009. Object.defineProperty(RangeFont.prototype, "size", {
  13010. get: function () {
  13011. _throwIfNotLoaded("size", this.m_size, "RangeFont", this._isNull);
  13012. return this.m_size;
  13013. },
  13014. set: function (value) {
  13015. this.m_size=value;
  13016. _createSetPropertyAction(this.context, this, "Size", value);
  13017. },
  13018. enumerable: true,
  13019. configurable: true
  13020. });
  13021. Object.defineProperty(RangeFont.prototype, "underline", {
  13022. get: function () {
  13023. _throwIfNotLoaded("underline", this.m_underline, "RangeFont", this._isNull);
  13024. return this.m_underline;
  13025. },
  13026. set: function (value) {
  13027. this.m_underline=value;
  13028. _createSetPropertyAction(this.context, this, "Underline", value);
  13029. },
  13030. enumerable: true,
  13031. configurable: true
  13032. });
  13033. RangeFont.prototype._handleResult=function (value) {
  13034. _super.prototype._handleResult.call(this, value);
  13035. if (_isNullOrUndefined(value))
  13036. return;
  13037. var obj=value;
  13038. _fixObjectPathIfNecessary(this, obj);
  13039. if (!_isUndefined(obj["Bold"])) {
  13040. this.m_bold=obj["Bold"];
  13041. }
  13042. if (!_isUndefined(obj["Color"])) {
  13043. this.m_color=obj["Color"];
  13044. }
  13045. if (!_isUndefined(obj["Italic"])) {
  13046. this.m_italic=obj["Italic"];
  13047. }
  13048. if (!_isUndefined(obj["Name"])) {
  13049. this.m_name=obj["Name"];
  13050. }
  13051. if (!_isUndefined(obj["Size"])) {
  13052. this.m_size=obj["Size"];
  13053. }
  13054. if (!_isUndefined(obj["Underline"])) {
  13055. this.m_underline=obj["Underline"];
  13056. }
  13057. };
  13058. RangeFont.prototype.load=function (option) {
  13059. _load(this, option);
  13060. return this;
  13061. };
  13062. RangeFont.prototype.toJSON=function () {
  13063. return {
  13064. "bold": this.m_bold,
  13065. "color": this.m_color,
  13066. "italic": this.m_italic,
  13067. "name": this.m_name,
  13068. "size": this.m_size,
  13069. "underline": this.m_underline
  13070. };
  13071. };
  13072. return RangeFont;
  13073. }(OfficeExtension.ClientObject));
  13074. Excel.RangeFont=RangeFont;
  13075. var ChartCollection=(function (_super) {
  13076. __extends(ChartCollection, _super);
  13077. function ChartCollection() {
  13078. _super.apply(this, arguments);
  13079. }
  13080. Object.defineProperty(ChartCollection.prototype, "items", {
  13081. get: function () {
  13082. _throwIfNotLoaded("items", this.m__items, "ChartCollection", this._isNull);
  13083. return this.m__items;
  13084. },
  13085. enumerable: true,
  13086. configurable: true
  13087. });
  13088. Object.defineProperty(ChartCollection.prototype, "count", {
  13089. get: function () {
  13090. _throwIfNotLoaded("count", this.m_count, "ChartCollection", this._isNull);
  13091. return this.m_count;
  13092. },
  13093. enumerable: true,
  13094. configurable: true
  13095. });
  13096. ChartCollection.prototype.add=function (type, sourceData, seriesBy) {
  13097. if (!(sourceData instanceof Range)) {
  13098. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Charts.Add");
  13099. }
  13100. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [type, sourceData, seriesBy], false, true, null));
  13101. };
  13102. ChartCollection.prototype.getItem=function (name) {
  13103. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItem", OfficeExtension.OperationType.Read, [name], false, false, null));
  13104. };
  13105. ChartCollection.prototype.getItemAt=function (index) {
  13106. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13107. };
  13108. ChartCollection.prototype._GetItem=function (key) {
  13109. return new Excel.Chart(this.context, _createIndexerObjectPath(this.context, this, [key]));
  13110. };
  13111. ChartCollection.prototype._handleResult=function (value) {
  13112. _super.prototype._handleResult.call(this, value);
  13113. if (_isNullOrUndefined(value))
  13114. return;
  13115. var obj=value;
  13116. _fixObjectPathIfNecessary(this, obj);
  13117. if (!_isUndefined(obj["Count"])) {
  13118. this.m_count=obj["Count"];
  13119. }
  13120. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13121. this.m__items=[];
  13122. var _data=obj[OfficeExtension.Constants.items];
  13123. for (var i=0; i < _data.length; i++) {
  13124. var _item=new Excel.Chart(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  13125. _item._handleResult(_data[i]);
  13126. this.m__items.push(_item);
  13127. }
  13128. }
  13129. };
  13130. ChartCollection.prototype.load=function (option) {
  13131. _load(this, option);
  13132. return this;
  13133. };
  13134. ChartCollection.prototype.toJSON=function () {
  13135. return {
  13136. "count": this.m_count
  13137. };
  13138. };
  13139. return ChartCollection;
  13140. }(OfficeExtension.ClientObject));
  13141. Excel.ChartCollection=ChartCollection;
  13142. var Chart=(function (_super) {
  13143. __extends(Chart, _super);
  13144. function Chart() {
  13145. _super.apply(this, arguments);
  13146. }
  13147. Object.defineProperty(Chart.prototype, "axes", {
  13148. get: function () {
  13149. if (!this.m_axes) {
  13150. this.m_axes=new Excel.ChartAxes(this.context, _createPropertyObjectPath(this.context, this, "Axes", false, false));
  13151. }
  13152. return this.m_axes;
  13153. },
  13154. enumerable: true,
  13155. configurable: true
  13156. });
  13157. Object.defineProperty(Chart.prototype, "dataLabels", {
  13158. get: function () {
  13159. if (!this.m_dataLabels) {
  13160. this.m_dataLabels=new Excel.ChartDataLabels(this.context, _createPropertyObjectPath(this.context, this, "DataLabels", false, false));
  13161. }
  13162. return this.m_dataLabels;
  13163. },
  13164. enumerable: true,
  13165. configurable: true
  13166. });
  13167. Object.defineProperty(Chart.prototype, "format", {
  13168. get: function () {
  13169. if (!this.m_format) {
  13170. this.m_format=new Excel.ChartAreaFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13171. }
  13172. return this.m_format;
  13173. },
  13174. enumerable: true,
  13175. configurable: true
  13176. });
  13177. Object.defineProperty(Chart.prototype, "legend", {
  13178. get: function () {
  13179. if (!this.m_legend) {
  13180. this.m_legend=new Excel.ChartLegend(this.context, _createPropertyObjectPath(this.context, this, "Legend", false, false));
  13181. }
  13182. return this.m_legend;
  13183. },
  13184. enumerable: true,
  13185. configurable: true
  13186. });
  13187. Object.defineProperty(Chart.prototype, "series", {
  13188. get: function () {
  13189. if (!this.m_series) {
  13190. this.m_series=new Excel.ChartSeriesCollection(this.context, _createPropertyObjectPath(this.context, this, "Series", true, false));
  13191. }
  13192. return this.m_series;
  13193. },
  13194. enumerable: true,
  13195. configurable: true
  13196. });
  13197. Object.defineProperty(Chart.prototype, "title", {
  13198. get: function () {
  13199. if (!this.m_title) {
  13200. this.m_title=new Excel.ChartTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  13201. }
  13202. return this.m_title;
  13203. },
  13204. enumerable: true,
  13205. configurable: true
  13206. });
  13207. Object.defineProperty(Chart.prototype, "worksheet", {
  13208. get: function () {
  13209. if (!this.m_worksheet) {
  13210. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  13211. }
  13212. return this.m_worksheet;
  13213. },
  13214. enumerable: true,
  13215. configurable: true
  13216. });
  13217. Object.defineProperty(Chart.prototype, "height", {
  13218. get: function () {
  13219. _throwIfNotLoaded("height", this.m_height, "Chart", this._isNull);
  13220. return this.m_height;
  13221. },
  13222. set: function (value) {
  13223. this.m_height=value;
  13224. _createSetPropertyAction(this.context, this, "Height", value);
  13225. },
  13226. enumerable: true,
  13227. configurable: true
  13228. });
  13229. Object.defineProperty(Chart.prototype, "left", {
  13230. get: function () {
  13231. _throwIfNotLoaded("left", this.m_left, "Chart", this._isNull);
  13232. return this.m_left;
  13233. },
  13234. set: function (value) {
  13235. this.m_left=value;
  13236. _createSetPropertyAction(this.context, this, "Left", value);
  13237. },
  13238. enumerable: true,
  13239. configurable: true
  13240. });
  13241. Object.defineProperty(Chart.prototype, "name", {
  13242. get: function () {
  13243. _throwIfNotLoaded("name", this.m_name, "Chart", this._isNull);
  13244. return this.m_name;
  13245. },
  13246. set: function (value) {
  13247. this.m_name=value;
  13248. _createSetPropertyAction(this.context, this, "Name", value);
  13249. },
  13250. enumerable: true,
  13251. configurable: true
  13252. });
  13253. Object.defineProperty(Chart.prototype, "top", {
  13254. get: function () {
  13255. _throwIfNotLoaded("top", this.m_top, "Chart", this._isNull);
  13256. return this.m_top;
  13257. },
  13258. set: function (value) {
  13259. this.m_top=value;
  13260. _createSetPropertyAction(this.context, this, "Top", value);
  13261. },
  13262. enumerable: true,
  13263. configurable: true
  13264. });
  13265. Object.defineProperty(Chart.prototype, "width", {
  13266. get: function () {
  13267. _throwIfNotLoaded("width", this.m_width, "Chart", this._isNull);
  13268. return this.m_width;
  13269. },
  13270. set: function (value) {
  13271. this.m_width=value;
  13272. _createSetPropertyAction(this.context, this, "Width", value);
  13273. },
  13274. enumerable: true,
  13275. configurable: true
  13276. });
  13277. Chart.prototype.delete=function () {
  13278. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  13279. };
  13280. Chart.prototype.getImage=function (width, height, fittingMode) {
  13281. var action=_createMethodAction(this.context, this, "GetImage", OfficeExtension.OperationType.Read, [width, height, fittingMode]);
  13282. var ret=new OfficeExtension.ClientResult();
  13283. _addActionResultHandler(this, action, ret);
  13284. return ret;
  13285. };
  13286. Chart.prototype.setData=function (sourceData, seriesBy) {
  13287. if (!(sourceData instanceof Range)) {
  13288. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Chart.setData");
  13289. }
  13290. _createMethodAction(this.context, this, "SetData", OfficeExtension.OperationType.Default, [sourceData, seriesBy]);
  13291. };
  13292. Chart.prototype.setPosition=function (startCell, endCell) {
  13293. _createMethodAction(this.context, this, "SetPosition", OfficeExtension.OperationType.Default, [startCell, endCell]);
  13294. };
  13295. Chart.prototype._handleResult=function (value) {
  13296. _super.prototype._handleResult.call(this, value);
  13297. if (_isNullOrUndefined(value))
  13298. return;
  13299. var obj=value;
  13300. _fixObjectPathIfNecessary(this, obj);
  13301. if (!_isUndefined(obj["Height"])) {
  13302. this.m_height=obj["Height"];
  13303. }
  13304. if (!_isUndefined(obj["Left"])) {
  13305. this.m_left=obj["Left"];
  13306. }
  13307. if (!_isUndefined(obj["Name"])) {
  13308. this.m_name=obj["Name"];
  13309. }
  13310. if (!_isUndefined(obj["Top"])) {
  13311. this.m_top=obj["Top"];
  13312. }
  13313. if (!_isUndefined(obj["Width"])) {
  13314. this.m_width=obj["Width"];
  13315. }
  13316. _handleNavigationPropertyResults(this, obj, ["axes", "Axes", "dataLabels", "DataLabels", "format", "Format", "legend", "Legend", "series", "Series", "title", "Title", "worksheet", "Worksheet"]);
  13317. };
  13318. Chart.prototype.load=function (option) {
  13319. _load(this, option);
  13320. return this;
  13321. };
  13322. Chart.prototype.toJSON=function () {
  13323. return {
  13324. "axes": this.m_axes,
  13325. "dataLabels": this.m_dataLabels,
  13326. "format": this.m_format,
  13327. "height": this.m_height,
  13328. "left": this.m_left,
  13329. "legend": this.m_legend,
  13330. "name": this.m_name,
  13331. "title": this.m_title,
  13332. "top": this.m_top,
  13333. "width": this.m_width
  13334. };
  13335. };
  13336. return Chart;
  13337. }(OfficeExtension.ClientObject));
  13338. Excel.Chart=Chart;
  13339. var ChartAreaFormat=(function (_super) {
  13340. __extends(ChartAreaFormat, _super);
  13341. function ChartAreaFormat() {
  13342. _super.apply(this, arguments);
  13343. }
  13344. Object.defineProperty(ChartAreaFormat.prototype, "fill", {
  13345. get: function () {
  13346. if (!this.m_fill) {
  13347. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13348. }
  13349. return this.m_fill;
  13350. },
  13351. enumerable: true,
  13352. configurable: true
  13353. });
  13354. Object.defineProperty(ChartAreaFormat.prototype, "font", {
  13355. get: function () {
  13356. if (!this.m_font) {
  13357. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  13358. }
  13359. return this.m_font;
  13360. },
  13361. enumerable: true,
  13362. configurable: true
  13363. });
  13364. ChartAreaFormat.prototype._handleResult=function (value) {
  13365. _super.prototype._handleResult.call(this, value);
  13366. if (_isNullOrUndefined(value))
  13367. return;
  13368. var obj=value;
  13369. _fixObjectPathIfNecessary(this, obj);
  13370. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  13371. };
  13372. ChartAreaFormat.prototype.load=function (option) {
  13373. _load(this, option);
  13374. return this;
  13375. };
  13376. ChartAreaFormat.prototype.toJSON=function () {
  13377. return {
  13378. "fill": this.m_fill,
  13379. "font": this.m_font
  13380. };
  13381. };
  13382. return ChartAreaFormat;
  13383. }(OfficeExtension.ClientObject));
  13384. Excel.ChartAreaFormat=ChartAreaFormat;
  13385. var ChartSeriesCollection=(function (_super) {
  13386. __extends(ChartSeriesCollection, _super);
  13387. function ChartSeriesCollection() {
  13388. _super.apply(this, arguments);
  13389. }
  13390. Object.defineProperty(ChartSeriesCollection.prototype, "items", {
  13391. get: function () {
  13392. _throwIfNotLoaded("items", this.m__items, "ChartSeriesCollection", this._isNull);
  13393. return this.m__items;
  13394. },
  13395. enumerable: true,
  13396. configurable: true
  13397. });
  13398. Object.defineProperty(ChartSeriesCollection.prototype, "count", {
  13399. get: function () {
  13400. _throwIfNotLoaded("count", this.m_count, "ChartSeriesCollection", this._isNull);
  13401. return this.m_count;
  13402. },
  13403. enumerable: true,
  13404. configurable: true
  13405. });
  13406. ChartSeriesCollection.prototype.getItemAt=function (index) {
  13407. return new Excel.ChartSeries(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13408. };
  13409. ChartSeriesCollection.prototype._handleResult=function (value) {
  13410. _super.prototype._handleResult.call(this, value);
  13411. if (_isNullOrUndefined(value))
  13412. return;
  13413. var obj=value;
  13414. _fixObjectPathIfNecessary(this, obj);
  13415. if (!_isUndefined(obj["Count"])) {
  13416. this.m_count=obj["Count"];
  13417. }
  13418. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13419. this.m__items=[];
  13420. var _data=obj[OfficeExtension.Constants.items];
  13421. for (var i=0; i < _data.length; i++) {
  13422. var _item=new Excel.ChartSeries(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13423. _item._handleResult(_data[i]);
  13424. this.m__items.push(_item);
  13425. }
  13426. }
  13427. };
  13428. ChartSeriesCollection.prototype.load=function (option) {
  13429. _load(this, option);
  13430. return this;
  13431. };
  13432. ChartSeriesCollection.prototype.toJSON=function () {
  13433. return {
  13434. "count": this.m_count
  13435. };
  13436. };
  13437. return ChartSeriesCollection;
  13438. }(OfficeExtension.ClientObject));
  13439. Excel.ChartSeriesCollection=ChartSeriesCollection;
  13440. var ChartSeries=(function (_super) {
  13441. __extends(ChartSeries, _super);
  13442. function ChartSeries() {
  13443. _super.apply(this, arguments);
  13444. }
  13445. Object.defineProperty(ChartSeries.prototype, "format", {
  13446. get: function () {
  13447. if (!this.m_format) {
  13448. this.m_format=new Excel.ChartSeriesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13449. }
  13450. return this.m_format;
  13451. },
  13452. enumerable: true,
  13453. configurable: true
  13454. });
  13455. Object.defineProperty(ChartSeries.prototype, "points", {
  13456. get: function () {
  13457. if (!this.m_points) {
  13458. this.m_points=new Excel.ChartPointsCollection(this.context, _createPropertyObjectPath(this.context, this, "Points", true, false));
  13459. }
  13460. return this.m_points;
  13461. },
  13462. enumerable: true,
  13463. configurable: true
  13464. });
  13465. Object.defineProperty(ChartSeries.prototype, "name", {
  13466. get: function () {
  13467. _throwIfNotLoaded("name", this.m_name, "ChartSeries", this._isNull);
  13468. return this.m_name;
  13469. },
  13470. set: function (value) {
  13471. this.m_name=value;
  13472. _createSetPropertyAction(this.context, this, "Name", value);
  13473. },
  13474. enumerable: true,
  13475. configurable: true
  13476. });
  13477. ChartSeries.prototype._handleResult=function (value) {
  13478. _super.prototype._handleResult.call(this, value);
  13479. if (_isNullOrUndefined(value))
  13480. return;
  13481. var obj=value;
  13482. _fixObjectPathIfNecessary(this, obj);
  13483. if (!_isUndefined(obj["Name"])) {
  13484. this.m_name=obj["Name"];
  13485. }
  13486. _handleNavigationPropertyResults(this, obj, ["format", "Format", "points", "Points"]);
  13487. };
  13488. ChartSeries.prototype.load=function (option) {
  13489. _load(this, option);
  13490. return this;
  13491. };
  13492. ChartSeries.prototype.toJSON=function () {
  13493. return {
  13494. "format": this.m_format,
  13495. "name": this.m_name
  13496. };
  13497. };
  13498. return ChartSeries;
  13499. }(OfficeExtension.ClientObject));
  13500. Excel.ChartSeries=ChartSeries;
  13501. var ChartSeriesFormat=(function (_super) {
  13502. __extends(ChartSeriesFormat, _super);
  13503. function ChartSeriesFormat() {
  13504. _super.apply(this, arguments);
  13505. }
  13506. Object.defineProperty(ChartSeriesFormat.prototype, "fill", {
  13507. get: function () {
  13508. if (!this.m_fill) {
  13509. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13510. }
  13511. return this.m_fill;
  13512. },
  13513. enumerable: true,
  13514. configurable: true
  13515. });
  13516. Object.defineProperty(ChartSeriesFormat.prototype, "line", {
  13517. get: function () {
  13518. if (!this.m_line) {
  13519. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  13520. }
  13521. return this.m_line;
  13522. },
  13523. enumerable: true,
  13524. configurable: true
  13525. });
  13526. ChartSeriesFormat.prototype._handleResult=function (value) {
  13527. _super.prototype._handleResult.call(this, value);
  13528. if (_isNullOrUndefined(value))
  13529. return;
  13530. var obj=value;
  13531. _fixObjectPathIfNecessary(this, obj);
  13532. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "line", "Line"]);
  13533. };
  13534. ChartSeriesFormat.prototype.load=function (option) {
  13535. _load(this, option);
  13536. return this;
  13537. };
  13538. ChartSeriesFormat.prototype.toJSON=function () {
  13539. return {
  13540. "fill": this.m_fill,
  13541. "line": this.m_line
  13542. };
  13543. };
  13544. return ChartSeriesFormat;
  13545. }(OfficeExtension.ClientObject));
  13546. Excel.ChartSeriesFormat=ChartSeriesFormat;
  13547. var ChartPointsCollection=(function (_super) {
  13548. __extends(ChartPointsCollection, _super);
  13549. function ChartPointsCollection() {
  13550. _super.apply(this, arguments);
  13551. }
  13552. Object.defineProperty(ChartPointsCollection.prototype, "items", {
  13553. get: function () {
  13554. _throwIfNotLoaded("items", this.m__items, "ChartPointsCollection", this._isNull);
  13555. return this.m__items;
  13556. },
  13557. enumerable: true,
  13558. configurable: true
  13559. });
  13560. Object.defineProperty(ChartPointsCollection.prototype, "count", {
  13561. get: function () {
  13562. _throwIfNotLoaded("count", this.m_count, "ChartPointsCollection", this._isNull);
  13563. return this.m_count;
  13564. },
  13565. enumerable: true,
  13566. configurable: true
  13567. });
  13568. ChartPointsCollection.prototype.getItemAt=function (index) {
  13569. return new Excel.ChartPoint(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13570. };
  13571. ChartPointsCollection.prototype._handleResult=function (value) {
  13572. _super.prototype._handleResult.call(this, value);
  13573. if (_isNullOrUndefined(value))
  13574. return;
  13575. var obj=value;
  13576. _fixObjectPathIfNecessary(this, obj);
  13577. if (!_isUndefined(obj["Count"])) {
  13578. this.m_count=obj["Count"];
  13579. }
  13580. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13581. this.m__items=[];
  13582. var _data=obj[OfficeExtension.Constants.items];
  13583. for (var i=0; i < _data.length; i++) {
  13584. var _item=new Excel.ChartPoint(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13585. _item._handleResult(_data[i]);
  13586. this.m__items.push(_item);
  13587. }
  13588. }
  13589. };
  13590. ChartPointsCollection.prototype.load=function (option) {
  13591. _load(this, option);
  13592. return this;
  13593. };
  13594. ChartPointsCollection.prototype.toJSON=function () {
  13595. return {
  13596. "count": this.m_count
  13597. };
  13598. };
  13599. return ChartPointsCollection;
  13600. }(OfficeExtension.ClientObject));
  13601. Excel.ChartPointsCollection=ChartPointsCollection;
  13602. var ChartPoint=(function (_super) {
  13603. __extends(ChartPoint, _super);
  13604. function ChartPoint() {
  13605. _super.apply(this, arguments);
  13606. }
  13607. Object.defineProperty(ChartPoint.prototype, "format", {
  13608. get: function () {
  13609. if (!this.m_format) {
  13610. this.m_format=new Excel.ChartPointFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13611. }
  13612. return this.m_format;
  13613. },
  13614. enumerable: true,
  13615. configurable: true
  13616. });
  13617. Object.defineProperty(ChartPoint.prototype, "value", {
  13618. get: function () {
  13619. _throwIfNotLoaded("value", this.m_value, "ChartPoint", this._isNull);
  13620. return this.m_value;
  13621. },
  13622. enumerable: true,
  13623. configurable: true
  13624. });
  13625. ChartPoint.prototype._handleResult=function (value) {
  13626. _super.prototype._handleResult.call(this, value);
  13627. if (_isNullOrUndefined(value))
  13628. return;
  13629. var obj=value;
  13630. _fixObjectPathIfNecessary(this, obj);
  13631. if (!_isUndefined(obj["Value"])) {
  13632. this.m_value=obj["Value"];
  13633. }
  13634. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  13635. };
  13636. ChartPoint.prototype.load=function (option) {
  13637. _load(this, option);
  13638. return this;
  13639. };
  13640. ChartPoint.prototype.toJSON=function () {
  13641. return {
  13642. "format": this.m_format,
  13643. "value": this.m_value
  13644. };
  13645. };
  13646. return ChartPoint;
  13647. }(OfficeExtension.ClientObject));
  13648. Excel.ChartPoint=ChartPoint;
  13649. var ChartPointFormat=(function (_super) {
  13650. __extends(ChartPointFormat, _super);
  13651. function ChartPointFormat() {
  13652. _super.apply(this, arguments);
  13653. }
  13654. Object.defineProperty(ChartPointFormat.prototype, "fill", {
  13655. get: function () {
  13656. if (!this.m_fill) {
  13657. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13658. }
  13659. return this.m_fill;
  13660. },
  13661. enumerable: true,
  13662. configurable: true
  13663. });
  13664. ChartPointFormat.prototype._handleResult=function (value) {
  13665. _super.prototype._handleResult.call(this, value);
  13666. if (_isNullOrUndefined(value))
  13667. return;
  13668. var obj=value;
  13669. _fixObjectPathIfNecessary(this, obj);
  13670. _handleNavigationPropertyResults(this, obj, ["fill", "Fill"]);
  13671. };
  13672. ChartPointFormat.prototype.load=function (option) {
  13673. _load(this, option);
  13674. return this;
  13675. };
  13676. ChartPointFormat.prototype.toJSON=function () {
  13677. return {
  13678. "fill": this.m_fill
  13679. };
  13680. };
  13681. return ChartPointFormat;
  13682. }(OfficeExtension.ClientObject));
  13683. Excel.ChartPointFormat=ChartPointFormat;
  13684. var ChartAxes=(function (_super) {
  13685. __extends(ChartAxes, _super);
  13686. function ChartAxes() {
  13687. _super.apply(this, arguments);
  13688. }
  13689. Object.defineProperty(ChartAxes.prototype, "categoryAxis", {
  13690. get: function () {
  13691. if (!this.m_categoryAxis) {
  13692. this.m_categoryAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "CategoryAxis", false, false));
  13693. }
  13694. return this.m_categoryAxis;
  13695. },
  13696. enumerable: true,
  13697. configurable: true
  13698. });
  13699. Object.defineProperty(ChartAxes.prototype, "seriesAxis", {
  13700. get: function () {
  13701. if (!this.m_seriesAxis) {
  13702. this.m_seriesAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "SeriesAxis", false, false));
  13703. }
  13704. return this.m_seriesAxis;
  13705. },
  13706. enumerable: true,
  13707. configurable: true
  13708. });
  13709. Object.defineProperty(ChartAxes.prototype, "valueAxis", {
  13710. get: function () {
  13711. if (!this.m_valueAxis) {
  13712. this.m_valueAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "ValueAxis", false, false));
  13713. }
  13714. return this.m_valueAxis;
  13715. },
  13716. enumerable: true,
  13717. configurable: true
  13718. });
  13719. ChartAxes.prototype._handleResult=function (value) {
  13720. _super.prototype._handleResult.call(this, value);
  13721. if (_isNullOrUndefined(value))
  13722. return;
  13723. var obj=value;
  13724. _fixObjectPathIfNecessary(this, obj);
  13725. _handleNavigationPropertyResults(this, obj, ["categoryAxis", "CategoryAxis", "seriesAxis", "SeriesAxis", "valueAxis", "ValueAxis"]);
  13726. };
  13727. ChartAxes.prototype.load=function (option) {
  13728. _load(this, option);
  13729. return this;
  13730. };
  13731. ChartAxes.prototype.toJSON=function () {
  13732. return {
  13733. "categoryAxis": this.m_categoryAxis,
  13734. "seriesAxis": this.m_seriesAxis,
  13735. "valueAxis": this.m_valueAxis
  13736. };
  13737. };
  13738. return ChartAxes;
  13739. }(OfficeExtension.ClientObject));
  13740. Excel.ChartAxes=ChartAxes;
  13741. var ChartAxis=(function (_super) {
  13742. __extends(ChartAxis, _super);
  13743. function ChartAxis() {
  13744. _super.apply(this, arguments);
  13745. }
  13746. Object.defineProperty(ChartAxis.prototype, "format", {
  13747. get: function () {
  13748. if (!this.m_format) {
  13749. this.m_format=new Excel.ChartAxisFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13750. }
  13751. return this.m_format;
  13752. },
  13753. enumerable: true,
  13754. configurable: true
  13755. });
  13756. Object.defineProperty(ChartAxis.prototype, "majorGridlines", {
  13757. get: function () {
  13758. if (!this.m_majorGridlines) {
  13759. this.m_majorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MajorGridlines", false, false));
  13760. }
  13761. return this.m_majorGridlines;
  13762. },
  13763. enumerable: true,
  13764. configurable: true
  13765. });
  13766. Object.defineProperty(ChartAxis.prototype, "minorGridlines", {
  13767. get: function () {
  13768. if (!this.m_minorGridlines) {
  13769. this.m_minorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MinorGridlines", false, false));
  13770. }
  13771. return this.m_minorGridlines;
  13772. },
  13773. enumerable: true,
  13774. configurable: true
  13775. });
  13776. Object.defineProperty(ChartAxis.prototype, "title", {
  13777. get: function () {
  13778. if (!this.m_title) {
  13779. this.m_title=new Excel.ChartAxisTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  13780. }
  13781. return this.m_title;
  13782. },
  13783. enumerable: true,
  13784. configurable: true
  13785. });
  13786. Object.defineProperty(ChartAxis.prototype, "majorUnit", {
  13787. get: function () {
  13788. _throwIfNotLoaded("majorUnit", this.m_majorUnit, "ChartAxis", this._isNull);
  13789. return this.m_majorUnit;
  13790. },
  13791. set: function (value) {
  13792. this.m_majorUnit=value;
  13793. _createSetPropertyAction(this.context, this, "MajorUnit", value);
  13794. },
  13795. enumerable: true,
  13796. configurable: true
  13797. });
  13798. Object.defineProperty(ChartAxis.prototype, "maximum", {
  13799. get: function () {
  13800. _throwIfNotLoaded("maximum", this.m_maximum, "ChartAxis", this._isNull);
  13801. return this.m_maximum;
  13802. },
  13803. set: function (value) {
  13804. this.m_maximum=value;
  13805. _createSetPropertyAction(this.context, this, "Maximum", value);
  13806. },
  13807. enumerable: true,
  13808. configurable: true
  13809. });
  13810. Object.defineProperty(ChartAxis.prototype, "minimum", {
  13811. get: function () {
  13812. _throwIfNotLoaded("minimum", this.m_minimum, "ChartAxis", this._isNull);
  13813. return this.m_minimum;
  13814. },
  13815. set: function (value) {
  13816. this.m_minimum=value;
  13817. _createSetPropertyAction(this.context, this, "Minimum", value);
  13818. },
  13819. enumerable: true,
  13820. configurable: true
  13821. });
  13822. Object.defineProperty(ChartAxis.prototype, "minorUnit", {
  13823. get: function () {
  13824. _throwIfNotLoaded("minorUnit", this.m_minorUnit, "ChartAxis", this._isNull);
  13825. return this.m_minorUnit;
  13826. },
  13827. set: function (value) {
  13828. this.m_minorUnit=value;
  13829. _createSetPropertyAction(this.context, this, "MinorUnit", value);
  13830. },
  13831. enumerable: true,
  13832. configurable: true
  13833. });
  13834. ChartAxis.prototype._handleResult=function (value) {
  13835. _super.prototype._handleResult.call(this, value);
  13836. if (_isNullOrUndefined(value))
  13837. return;
  13838. var obj=value;
  13839. _fixObjectPathIfNecessary(this, obj);
  13840. if (!_isUndefined(obj["MajorUnit"])) {
  13841. this.m_majorUnit=obj["MajorUnit"];
  13842. }
  13843. if (!_isUndefined(obj["Maximum"])) {
  13844. this.m_maximum=obj["Maximum"];
  13845. }
  13846. if (!_isUndefined(obj["Minimum"])) {
  13847. this.m_minimum=obj["Minimum"];
  13848. }
  13849. if (!_isUndefined(obj["MinorUnit"])) {
  13850. this.m_minorUnit=obj["MinorUnit"];
  13851. }
  13852. _handleNavigationPropertyResults(this, obj, ["format", "Format", "majorGridlines", "MajorGridlines", "minorGridlines", "MinorGridlines", "title", "Title"]);
  13853. };
  13854. ChartAxis.prototype.load=function (option) {
  13855. _load(this, option);
  13856. return this;
  13857. };
  13858. ChartAxis.prototype.toJSON=function () {
  13859. return {
  13860. "format": this.m_format,
  13861. "majorGridlines": this.m_majorGridlines,
  13862. "majorUnit": this.m_majorUnit,
  13863. "maximum": this.m_maximum,
  13864. "minimum": this.m_minimum,
  13865. "minorGridlines": this.m_minorGridlines,
  13866. "minorUnit": this.m_minorUnit,
  13867. "title": this.m_title
  13868. };
  13869. };
  13870. return ChartAxis;
  13871. }(OfficeExtension.ClientObject));
  13872. Excel.ChartAxis=ChartAxis;
  13873. var ChartAxisFormat=(function (_super) {
  13874. __extends(ChartAxisFormat, _super);
  13875. function ChartAxisFormat() {
  13876. _super.apply(this, arguments);
  13877. }
  13878. Object.defineProperty(ChartAxisFormat.prototype, "font", {
  13879. get: function () {
  13880. if (!this.m_font) {
  13881. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  13882. }
  13883. return this.m_font;
  13884. },
  13885. enumerable: true,
  13886. configurable: true
  13887. });
  13888. Object.defineProperty(ChartAxisFormat.prototype, "line", {
  13889. get: function () {
  13890. if (!this.m_line) {
  13891. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  13892. }
  13893. return this.m_line;
  13894. },
  13895. enumerable: true,
  13896. configurable: true
  13897. });
  13898. ChartAxisFormat.prototype._handleResult=function (value) {
  13899. _super.prototype._handleResult.call(this, value);
  13900. if (_isNullOrUndefined(value))
  13901. return;
  13902. var obj=value;
  13903. _fixObjectPathIfNecessary(this, obj);
  13904. _handleNavigationPropertyResults(this, obj, ["font", "Font", "line", "Line"]);
  13905. };
  13906. ChartAxisFormat.prototype.load=function (option) {
  13907. _load(this, option);
  13908. return this;
  13909. };
  13910. ChartAxisFormat.prototype.toJSON=function () {
  13911. return {
  13912. "font": this.m_font,
  13913. "line": this.m_line
  13914. };
  13915. };
  13916. return ChartAxisFormat;
  13917. }(OfficeExtension.ClientObject));
  13918. Excel.ChartAxisFormat=ChartAxisFormat;
  13919. var ChartAxisTitle=(function (_super) {
  13920. __extends(ChartAxisTitle, _super);
  13921. function ChartAxisTitle() {
  13922. _super.apply(this, arguments);
  13923. }
  13924. Object.defineProperty(ChartAxisTitle.prototype, "format", {
  13925. get: function () {
  13926. if (!this.m_format) {
  13927. this.m_format=new Excel.ChartAxisTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13928. }
  13929. return this.m_format;
  13930. },
  13931. enumerable: true,
  13932. configurable: true
  13933. });
  13934. Object.defineProperty(ChartAxisTitle.prototype, "text", {
  13935. get: function () {
  13936. _throwIfNotLoaded("text", this.m_text, "ChartAxisTitle", this._isNull);
  13937. return this.m_text;
  13938. },
  13939. set: function (value) {
  13940. this.m_text=value;
  13941. _createSetPropertyAction(this.context, this, "Text", value);
  13942. },
  13943. enumerable: true,
  13944. configurable: true
  13945. });
  13946. Object.defineProperty(ChartAxisTitle.prototype, "visible", {
  13947. get: function () {
  13948. _throwIfNotLoaded("visible", this.m_visible, "ChartAxisTitle", this._isNull);
  13949. return this.m_visible;
  13950. },
  13951. set: function (value) {
  13952. this.m_visible=value;
  13953. _createSetPropertyAction(this.context, this, "Visible", value);
  13954. },
  13955. enumerable: true,
  13956. configurable: true
  13957. });
  13958. ChartAxisTitle.prototype._handleResult=function (value) {
  13959. _super.prototype._handleResult.call(this, value);
  13960. if (_isNullOrUndefined(value))
  13961. return;
  13962. var obj=value;
  13963. _fixObjectPathIfNecessary(this, obj);
  13964. if (!_isUndefined(obj["Text"])) {
  13965. this.m_text=obj["Text"];
  13966. }
  13967. if (!_isUndefined(obj["Visible"])) {
  13968. this.m_visible=obj["Visible"];
  13969. }
  13970. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  13971. };
  13972. ChartAxisTitle.prototype.load=function (option) {
  13973. _load(this, option);
  13974. return this;
  13975. };
  13976. ChartAxisTitle.prototype.toJSON=function () {
  13977. return {
  13978. "format": this.m_format,
  13979. "text": this.m_text,
  13980. "visible": this.m_visible
  13981. };
  13982. };
  13983. return ChartAxisTitle;
  13984. }(OfficeExtension.ClientObject));
  13985. Excel.ChartAxisTitle=ChartAxisTitle;
  13986. var ChartAxisTitleFormat=(function (_super) {
  13987. __extends(ChartAxisTitleFormat, _super);
  13988. function ChartAxisTitleFormat() {
  13989. _super.apply(this, arguments);
  13990. }
  13991. Object.defineProperty(ChartAxisTitleFormat.prototype, "font", {
  13992. get: function () {
  13993. if (!this.m_font) {
  13994. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  13995. }
  13996. return this.m_font;
  13997. },
  13998. enumerable: true,
  13999. configurable: true
  14000. });
  14001. ChartAxisTitleFormat.prototype._handleResult=function (value) {
  14002. _super.prototype._handleResult.call(this, value);
  14003. if (_isNullOrUndefined(value))
  14004. return;
  14005. var obj=value;
  14006. _fixObjectPathIfNecessary(this, obj);
  14007. _handleNavigationPropertyResults(this, obj, ["font", "Font"]);
  14008. };
  14009. ChartAxisTitleFormat.prototype.load=function (option) {
  14010. _load(this, option);
  14011. return this;
  14012. };
  14013. ChartAxisTitleFormat.prototype.toJSON=function () {
  14014. return {
  14015. "font": this.m_font
  14016. };
  14017. };
  14018. return ChartAxisTitleFormat;
  14019. }(OfficeExtension.ClientObject));
  14020. Excel.ChartAxisTitleFormat=ChartAxisTitleFormat;
  14021. var ChartDataLabels=(function (_super) {
  14022. __extends(ChartDataLabels, _super);
  14023. function ChartDataLabels() {
  14024. _super.apply(this, arguments);
  14025. }
  14026. Object.defineProperty(ChartDataLabels.prototype, "format", {
  14027. get: function () {
  14028. if (!this.m_format) {
  14029. this.m_format=new Excel.ChartDataLabelFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14030. }
  14031. return this.m_format;
  14032. },
  14033. enumerable: true,
  14034. configurable: true
  14035. });
  14036. Object.defineProperty(ChartDataLabels.prototype, "position", {
  14037. get: function () {
  14038. _throwIfNotLoaded("position", this.m_position, "ChartDataLabels", this._isNull);
  14039. return this.m_position;
  14040. },
  14041. set: function (value) {
  14042. this.m_position=value;
  14043. _createSetPropertyAction(this.context, this, "Position", value);
  14044. },
  14045. enumerable: true,
  14046. configurable: true
  14047. });
  14048. Object.defineProperty(ChartDataLabels.prototype, "separator", {
  14049. get: function () {
  14050. _throwIfNotLoaded("separator", this.m_separator, "ChartDataLabels", this._isNull);
  14051. return this.m_separator;
  14052. },
  14053. set: function (value) {
  14054. this.m_separator=value;
  14055. _createSetPropertyAction(this.context, this, "Separator", value);
  14056. },
  14057. enumerable: true,
  14058. configurable: true
  14059. });
  14060. Object.defineProperty(ChartDataLabels.prototype, "showBubbleSize", {
  14061. get: function () {
  14062. _throwIfNotLoaded("showBubbleSize", this.m_showBubbleSize, "ChartDataLabels", this._isNull);
  14063. return this.m_showBubbleSize;
  14064. },
  14065. set: function (value) {
  14066. this.m_showBubbleSize=value;
  14067. _createSetPropertyAction(this.context, this, "ShowBubbleSize", value);
  14068. },
  14069. enumerable: true,
  14070. configurable: true
  14071. });
  14072. Object.defineProperty(ChartDataLabels.prototype, "showCategoryName", {
  14073. get: function () {
  14074. _throwIfNotLoaded("showCategoryName", this.m_showCategoryName, "ChartDataLabels", this._isNull);
  14075. return this.m_showCategoryName;
  14076. },
  14077. set: function (value) {
  14078. this.m_showCategoryName=value;
  14079. _createSetPropertyAction(this.context, this, "ShowCategoryName", value);
  14080. },
  14081. enumerable: true,
  14082. configurable: true
  14083. });
  14084. Object.defineProperty(ChartDataLabels.prototype, "showLegendKey", {
  14085. get: function () {
  14086. _throwIfNotLoaded("showLegendKey", this.m_showLegendKey, "ChartDataLabels", this._isNull);
  14087. return this.m_showLegendKey;
  14088. },
  14089. set: function (value) {
  14090. this.m_showLegendKey=value;
  14091. _createSetPropertyAction(this.context, this, "ShowLegendKey", value);
  14092. },
  14093. enumerable: true,
  14094. configurable: true
  14095. });
  14096. Object.defineProperty(ChartDataLabels.prototype, "showPercentage", {
  14097. get: function () {
  14098. _throwIfNotLoaded("showPercentage", this.m_showPercentage, "ChartDataLabels", this._isNull);
  14099. return this.m_showPercentage;
  14100. },
  14101. set: function (value) {
  14102. this.m_showPercentage=value;
  14103. _createSetPropertyAction(this.context, this, "ShowPercentage", value);
  14104. },
  14105. enumerable: true,
  14106. configurable: true
  14107. });
  14108. Object.defineProperty(ChartDataLabels.prototype, "showSeriesName", {
  14109. get: function () {
  14110. _throwIfNotLoaded("showSeriesName", this.m_showSeriesName, "ChartDataLabels", this._isNull);
  14111. return this.m_showSeriesName;
  14112. },
  14113. set: function (value) {
  14114. this.m_showSeriesName=value;
  14115. _createSetPropertyAction(this.context, this, "ShowSeriesName", value);
  14116. },
  14117. enumerable: true,
  14118. configurable: true
  14119. });
  14120. Object.defineProperty(ChartDataLabels.prototype, "showValue", {
  14121. get: function () {
  14122. _throwIfNotLoaded("showValue", this.m_showValue, "ChartDataLabels", this._isNull);
  14123. return this.m_showValue;
  14124. },
  14125. set: function (value) {
  14126. this.m_showValue=value;
  14127. _createSetPropertyAction(this.context, this, "ShowValue", value);
  14128. },
  14129. enumerable: true,
  14130. configurable: true
  14131. });
  14132. ChartDataLabels.prototype._handleResult=function (value) {
  14133. _super.prototype._handleResult.call(this, value);
  14134. if (_isNullOrUndefined(value))
  14135. return;
  14136. var obj=value;
  14137. _fixObjectPathIfNecessary(this, obj);
  14138. if (!_isUndefined(obj["Position"])) {
  14139. this.m_position=obj["Position"];
  14140. }
  14141. if (!_isUndefined(obj["Separator"])) {
  14142. this.m_separator=obj["Separator"];
  14143. }
  14144. if (!_isUndefined(obj["ShowBubbleSize"])) {
  14145. this.m_showBubbleSize=obj["ShowBubbleSize"];
  14146. }
  14147. if (!_isUndefined(obj["ShowCategoryName"])) {
  14148. this.m_showCategoryName=obj["ShowCategoryName"];
  14149. }
  14150. if (!_isUndefined(obj["ShowLegendKey"])) {
  14151. this.m_showLegendKey=obj["ShowLegendKey"];
  14152. }
  14153. if (!_isUndefined(obj["ShowPercentage"])) {
  14154. this.m_showPercentage=obj["ShowPercentage"];
  14155. }
  14156. if (!_isUndefined(obj["ShowSeriesName"])) {
  14157. this.m_showSeriesName=obj["ShowSeriesName"];
  14158. }
  14159. if (!_isUndefined(obj["ShowValue"])) {
  14160. this.m_showValue=obj["ShowValue"];
  14161. }
  14162. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14163. };
  14164. ChartDataLabels.prototype.load=function (option) {
  14165. _load(this, option);
  14166. return this;
  14167. };
  14168. ChartDataLabels.prototype.toJSON=function () {
  14169. return {
  14170. "format": this.m_format,
  14171. "position": this.m_position,
  14172. "separator": this.m_separator,
  14173. "showBubbleSize": this.m_showBubbleSize,
  14174. "showCategoryName": this.m_showCategoryName,
  14175. "showLegendKey": this.m_showLegendKey,
  14176. "showPercentage": this.m_showPercentage,
  14177. "showSeriesName": this.m_showSeriesName,
  14178. "showValue": this.m_showValue
  14179. };
  14180. };
  14181. return ChartDataLabels;
  14182. }(OfficeExtension.ClientObject));
  14183. Excel.ChartDataLabels=ChartDataLabels;
  14184. var ChartDataLabelFormat=(function (_super) {
  14185. __extends(ChartDataLabelFormat, _super);
  14186. function ChartDataLabelFormat() {
  14187. _super.apply(this, arguments);
  14188. }
  14189. Object.defineProperty(ChartDataLabelFormat.prototype, "fill", {
  14190. get: function () {
  14191. if (!this.m_fill) {
  14192. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14193. }
  14194. return this.m_fill;
  14195. },
  14196. enumerable: true,
  14197. configurable: true
  14198. });
  14199. Object.defineProperty(ChartDataLabelFormat.prototype, "font", {
  14200. get: function () {
  14201. if (!this.m_font) {
  14202. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14203. }
  14204. return this.m_font;
  14205. },
  14206. enumerable: true,
  14207. configurable: true
  14208. });
  14209. ChartDataLabelFormat.prototype._handleResult=function (value) {
  14210. _super.prototype._handleResult.call(this, value);
  14211. if (_isNullOrUndefined(value))
  14212. return;
  14213. var obj=value;
  14214. _fixObjectPathIfNecessary(this, obj);
  14215. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14216. };
  14217. ChartDataLabelFormat.prototype.load=function (option) {
  14218. _load(this, option);
  14219. return this;
  14220. };
  14221. ChartDataLabelFormat.prototype.toJSON=function () {
  14222. return {
  14223. "fill": this.m_fill,
  14224. "font": this.m_font
  14225. };
  14226. };
  14227. return ChartDataLabelFormat;
  14228. }(OfficeExtension.ClientObject));
  14229. Excel.ChartDataLabelFormat=ChartDataLabelFormat;
  14230. var ChartGridlines=(function (_super) {
  14231. __extends(ChartGridlines, _super);
  14232. function ChartGridlines() {
  14233. _super.apply(this, arguments);
  14234. }
  14235. Object.defineProperty(ChartGridlines.prototype, "format", {
  14236. get: function () {
  14237. if (!this.m_format) {
  14238. this.m_format=new Excel.ChartGridlinesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14239. }
  14240. return this.m_format;
  14241. },
  14242. enumerable: true,
  14243. configurable: true
  14244. });
  14245. Object.defineProperty(ChartGridlines.prototype, "visible", {
  14246. get: function () {
  14247. _throwIfNotLoaded("visible", this.m_visible, "ChartGridlines", this._isNull);
  14248. return this.m_visible;
  14249. },
  14250. set: function (value) {
  14251. this.m_visible=value;
  14252. _createSetPropertyAction(this.context, this, "Visible", value);
  14253. },
  14254. enumerable: true,
  14255. configurable: true
  14256. });
  14257. ChartGridlines.prototype._handleResult=function (value) {
  14258. _super.prototype._handleResult.call(this, value);
  14259. if (_isNullOrUndefined(value))
  14260. return;
  14261. var obj=value;
  14262. _fixObjectPathIfNecessary(this, obj);
  14263. if (!_isUndefined(obj["Visible"])) {
  14264. this.m_visible=obj["Visible"];
  14265. }
  14266. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14267. };
  14268. ChartGridlines.prototype.load=function (option) {
  14269. _load(this, option);
  14270. return this;
  14271. };
  14272. ChartGridlines.prototype.toJSON=function () {
  14273. return {
  14274. "format": this.m_format,
  14275. "visible": this.m_visible
  14276. };
  14277. };
  14278. return ChartGridlines;
  14279. }(OfficeExtension.ClientObject));
  14280. Excel.ChartGridlines=ChartGridlines;
  14281. var ChartGridlinesFormat=(function (_super) {
  14282. __extends(ChartGridlinesFormat, _super);
  14283. function ChartGridlinesFormat() {
  14284. _super.apply(this, arguments);
  14285. }
  14286. Object.defineProperty(ChartGridlinesFormat.prototype, "line", {
  14287. get: function () {
  14288. if (!this.m_line) {
  14289. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  14290. }
  14291. return this.m_line;
  14292. },
  14293. enumerable: true,
  14294. configurable: true
  14295. });
  14296. ChartGridlinesFormat.prototype._handleResult=function (value) {
  14297. _super.prototype._handleResult.call(this, value);
  14298. if (_isNullOrUndefined(value))
  14299. return;
  14300. var obj=value;
  14301. _fixObjectPathIfNecessary(this, obj);
  14302. _handleNavigationPropertyResults(this, obj, ["line", "Line"]);
  14303. };
  14304. ChartGridlinesFormat.prototype.load=function (option) {
  14305. _load(this, option);
  14306. return this;
  14307. };
  14308. ChartGridlinesFormat.prototype.toJSON=function () {
  14309. return {
  14310. "line": this.m_line
  14311. };
  14312. };
  14313. return ChartGridlinesFormat;
  14314. }(OfficeExtension.ClientObject));
  14315. Excel.ChartGridlinesFormat=ChartGridlinesFormat;
  14316. var ChartLegend=(function (_super) {
  14317. __extends(ChartLegend, _super);
  14318. function ChartLegend() {
  14319. _super.apply(this, arguments);
  14320. }
  14321. Object.defineProperty(ChartLegend.prototype, "format", {
  14322. get: function () {
  14323. if (!this.m_format) {
  14324. this.m_format=new Excel.ChartLegendFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14325. }
  14326. return this.m_format;
  14327. },
  14328. enumerable: true,
  14329. configurable: true
  14330. });
  14331. Object.defineProperty(ChartLegend.prototype, "overlay", {
  14332. get: function () {
  14333. _throwIfNotLoaded("overlay", this.m_overlay, "ChartLegend", this._isNull);
  14334. return this.m_overlay;
  14335. },
  14336. set: function (value) {
  14337. this.m_overlay=value;
  14338. _createSetPropertyAction(this.context, this, "Overlay", value);
  14339. },
  14340. enumerable: true,
  14341. configurable: true
  14342. });
  14343. Object.defineProperty(ChartLegend.prototype, "position", {
  14344. get: function () {
  14345. _throwIfNotLoaded("position", this.m_position, "ChartLegend", this._isNull);
  14346. return this.m_position;
  14347. },
  14348. set: function (value) {
  14349. this.m_position=value;
  14350. _createSetPropertyAction(this.context, this, "Position", value);
  14351. },
  14352. enumerable: true,
  14353. configurable: true
  14354. });
  14355. Object.defineProperty(ChartLegend.prototype, "visible", {
  14356. get: function () {
  14357. _throwIfNotLoaded("visible", this.m_visible, "ChartLegend", this._isNull);
  14358. return this.m_visible;
  14359. },
  14360. set: function (value) {
  14361. this.m_visible=value;
  14362. _createSetPropertyAction(this.context, this, "Visible", value);
  14363. },
  14364. enumerable: true,
  14365. configurable: true
  14366. });
  14367. ChartLegend.prototype._handleResult=function (value) {
  14368. _super.prototype._handleResult.call(this, value);
  14369. if (_isNullOrUndefined(value))
  14370. return;
  14371. var obj=value;
  14372. _fixObjectPathIfNecessary(this, obj);
  14373. if (!_isUndefined(obj["Overlay"])) {
  14374. this.m_overlay=obj["Overlay"];
  14375. }
  14376. if (!_isUndefined(obj["Position"])) {
  14377. this.m_position=obj["Position"];
  14378. }
  14379. if (!_isUndefined(obj["Visible"])) {
  14380. this.m_visible=obj["Visible"];
  14381. }
  14382. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14383. };
  14384. ChartLegend.prototype.load=function (option) {
  14385. _load(this, option);
  14386. return this;
  14387. };
  14388. ChartLegend.prototype.toJSON=function () {
  14389. return {
  14390. "format": this.m_format,
  14391. "overlay": this.m_overlay,
  14392. "position": this.m_position,
  14393. "visible": this.m_visible
  14394. };
  14395. };
  14396. return ChartLegend;
  14397. }(OfficeExtension.ClientObject));
  14398. Excel.ChartLegend=ChartLegend;
  14399. var ChartLegendFormat=(function (_super) {
  14400. __extends(ChartLegendFormat, _super);
  14401. function ChartLegendFormat() {
  14402. _super.apply(this, arguments);
  14403. }
  14404. Object.defineProperty(ChartLegendFormat.prototype, "fill", {
  14405. get: function () {
  14406. if (!this.m_fill) {
  14407. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14408. }
  14409. return this.m_fill;
  14410. },
  14411. enumerable: true,
  14412. configurable: true
  14413. });
  14414. Object.defineProperty(ChartLegendFormat.prototype, "font", {
  14415. get: function () {
  14416. if (!this.m_font) {
  14417. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14418. }
  14419. return this.m_font;
  14420. },
  14421. enumerable: true,
  14422. configurable: true
  14423. });
  14424. ChartLegendFormat.prototype._handleResult=function (value) {
  14425. _super.prototype._handleResult.call(this, value);
  14426. if (_isNullOrUndefined(value))
  14427. return;
  14428. var obj=value;
  14429. _fixObjectPathIfNecessary(this, obj);
  14430. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14431. };
  14432. ChartLegendFormat.prototype.load=function (option) {
  14433. _load(this, option);
  14434. return this;
  14435. };
  14436. ChartLegendFormat.prototype.toJSON=function () {
  14437. return {
  14438. "fill": this.m_fill,
  14439. "font": this.m_font
  14440. };
  14441. };
  14442. return ChartLegendFormat;
  14443. }(OfficeExtension.ClientObject));
  14444. Excel.ChartLegendFormat=ChartLegendFormat;
  14445. var ChartTitle=(function (_super) {
  14446. __extends(ChartTitle, _super);
  14447. function ChartTitle() {
  14448. _super.apply(this, arguments);
  14449. }
  14450. Object.defineProperty(ChartTitle.prototype, "format", {
  14451. get: function () {
  14452. if (!this.m_format) {
  14453. this.m_format=new Excel.ChartTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14454. }
  14455. return this.m_format;
  14456. },
  14457. enumerable: true,
  14458. configurable: true
  14459. });
  14460. Object.defineProperty(ChartTitle.prototype, "overlay", {
  14461. get: function () {
  14462. _throwIfNotLoaded("overlay", this.m_overlay, "ChartTitle", this._isNull);
  14463. return this.m_overlay;
  14464. },
  14465. set: function (value) {
  14466. this.m_overlay=value;
  14467. _createSetPropertyAction(this.context, this, "Overlay", value);
  14468. },
  14469. enumerable: true,
  14470. configurable: true
  14471. });
  14472. Object.defineProperty(ChartTitle.prototype, "text", {
  14473. get: function () {
  14474. _throwIfNotLoaded("text", this.m_text, "ChartTitle", this._isNull);
  14475. return this.m_text;
  14476. },
  14477. set: function (value) {
  14478. this.m_text=value;
  14479. _createSetPropertyAction(this.context, this, "Text", value);
  14480. },
  14481. enumerable: true,
  14482. configurable: true
  14483. });
  14484. Object.defineProperty(ChartTitle.prototype, "visible", {
  14485. get: function () {
  14486. _throwIfNotLoaded("visible", this.m_visible, "ChartTitle", this._isNull);
  14487. return this.m_visible;
  14488. },
  14489. set: function (value) {
  14490. this.m_visible=value;
  14491. _createSetPropertyAction(this.context, this, "Visible", value);
  14492. },
  14493. enumerable: true,
  14494. configurable: true
  14495. });
  14496. ChartTitle.prototype._handleResult=function (value) {
  14497. _super.prototype._handleResult.call(this, value);
  14498. if (_isNullOrUndefined(value))
  14499. return;
  14500. var obj=value;
  14501. _fixObjectPathIfNecessary(this, obj);
  14502. if (!_isUndefined(obj["Overlay"])) {
  14503. this.m_overlay=obj["Overlay"];
  14504. }
  14505. if (!_isUndefined(obj["Text"])) {
  14506. this.m_text=obj["Text"];
  14507. }
  14508. if (!_isUndefined(obj["Visible"])) {
  14509. this.m_visible=obj["Visible"];
  14510. }
  14511. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14512. };
  14513. ChartTitle.prototype.load=function (option) {
  14514. _load(this, option);
  14515. return this;
  14516. };
  14517. ChartTitle.prototype.toJSON=function () {
  14518. return {
  14519. "format": this.m_format,
  14520. "overlay": this.m_overlay,
  14521. "text": this.m_text,
  14522. "visible": this.m_visible
  14523. };
  14524. };
  14525. return ChartTitle;
  14526. }(OfficeExtension.ClientObject));
  14527. Excel.ChartTitle=ChartTitle;
  14528. var ChartTitleFormat=(function (_super) {
  14529. __extends(ChartTitleFormat, _super);
  14530. function ChartTitleFormat() {
  14531. _super.apply(this, arguments);
  14532. }
  14533. Object.defineProperty(ChartTitleFormat.prototype, "fill", {
  14534. get: function () {
  14535. if (!this.m_fill) {
  14536. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14537. }
  14538. return this.m_fill;
  14539. },
  14540. enumerable: true,
  14541. configurable: true
  14542. });
  14543. Object.defineProperty(ChartTitleFormat.prototype, "font", {
  14544. get: function () {
  14545. if (!this.m_font) {
  14546. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14547. }
  14548. return this.m_font;
  14549. },
  14550. enumerable: true,
  14551. configurable: true
  14552. });
  14553. ChartTitleFormat.prototype._handleResult=function (value) {
  14554. _super.prototype._handleResult.call(this, value);
  14555. if (_isNullOrUndefined(value))
  14556. return;
  14557. var obj=value;
  14558. _fixObjectPathIfNecessary(this, obj);
  14559. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14560. };
  14561. ChartTitleFormat.prototype.load=function (option) {
  14562. _load(this, option);
  14563. return this;
  14564. };
  14565. ChartTitleFormat.prototype.toJSON=function () {
  14566. return {
  14567. "fill": this.m_fill,
  14568. "font": this.m_font
  14569. };
  14570. };
  14571. return ChartTitleFormat;
  14572. }(OfficeExtension.ClientObject));
  14573. Excel.ChartTitleFormat=ChartTitleFormat;
  14574. var ChartFill=(function (_super) {
  14575. __extends(ChartFill, _super);
  14576. function ChartFill() {
  14577. _super.apply(this, arguments);
  14578. }
  14579. ChartFill.prototype.load=function (option) {
  14580. _load(this, option);
  14581. return this;
  14582. };
  14583. ChartFill.prototype.clear=function () {
  14584. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14585. };
  14586. ChartFill.prototype.setSolidColor=function (color) {
  14587. _createMethodAction(this.context, this, "SetSolidColor", OfficeExtension.OperationType.Default, [color]);
  14588. };
  14589. ChartFill.prototype._handleResult=function (value) {
  14590. _super.prototype._handleResult.call(this, value);
  14591. if (_isNullOrUndefined(value))
  14592. return;
  14593. var obj=value;
  14594. _fixObjectPathIfNecessary(this, obj);
  14595. };
  14596. ChartFill.prototype.toJSON=function () {
  14597. return {};
  14598. };
  14599. return ChartFill;
  14600. }(OfficeExtension.ClientObject));
  14601. Excel.ChartFill=ChartFill;
  14602. var ChartLineFormat=(function (_super) {
  14603. __extends(ChartLineFormat, _super);
  14604. function ChartLineFormat() {
  14605. _super.apply(this, arguments);
  14606. }
  14607. Object.defineProperty(ChartLineFormat.prototype, "color", {
  14608. get: function () {
  14609. _throwIfNotLoaded("color", this.m_color, "ChartLineFormat", this._isNull);
  14610. return this.m_color;
  14611. },
  14612. set: function (value) {
  14613. this.m_color=value;
  14614. _createSetPropertyAction(this.context, this, "Color", value);
  14615. },
  14616. enumerable: true,
  14617. configurable: true
  14618. });
  14619. ChartLineFormat.prototype.clear=function () {
  14620. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14621. };
  14622. ChartLineFormat.prototype._handleResult=function (value) {
  14623. _super.prototype._handleResult.call(this, value);
  14624. if (_isNullOrUndefined(value))
  14625. return;
  14626. var obj=value;
  14627. _fixObjectPathIfNecessary(this, obj);
  14628. if (!_isUndefined(obj["Color"])) {
  14629. this.m_color=obj["Color"];
  14630. }
  14631. };
  14632. ChartLineFormat.prototype.load=function (option) {
  14633. _load(this, option);
  14634. return this;
  14635. };
  14636. ChartLineFormat.prototype.toJSON=function () {
  14637. return {
  14638. "color": this.m_color
  14639. };
  14640. };
  14641. return ChartLineFormat;
  14642. }(OfficeExtension.ClientObject));
  14643. Excel.ChartLineFormat=ChartLineFormat;
  14644. var ChartFont=(function (_super) {
  14645. __extends(ChartFont, _super);
  14646. function ChartFont() {
  14647. _super.apply(this, arguments);
  14648. }
  14649. Object.defineProperty(ChartFont.prototype, "bold", {
  14650. get: function () {
  14651. _throwIfNotLoaded("bold", this.m_bold, "ChartFont", this._isNull);
  14652. return this.m_bold;
  14653. },
  14654. set: function (value) {
  14655. this.m_bold=value;
  14656. _createSetPropertyAction(this.context, this, "Bold", value);
  14657. },
  14658. enumerable: true,
  14659. configurable: true
  14660. });
  14661. Object.defineProperty(ChartFont.prototype, "color", {
  14662. get: function () {
  14663. _throwIfNotLoaded("color", this.m_color, "ChartFont", this._isNull);
  14664. return this.m_color;
  14665. },
  14666. set: function (value) {
  14667. this.m_color=value;
  14668. _createSetPropertyAction(this.context, this, "Color", value);
  14669. },
  14670. enumerable: true,
  14671. configurable: true
  14672. });
  14673. Object.defineProperty(ChartFont.prototype, "italic", {
  14674. get: function () {
  14675. _throwIfNotLoaded("italic", this.m_italic, "ChartFont", this._isNull);
  14676. return this.m_italic;
  14677. },
  14678. set: function (value) {
  14679. this.m_italic=value;
  14680. _createSetPropertyAction(this.context, this, "Italic", value);
  14681. },
  14682. enumerable: true,
  14683. configurable: true
  14684. });
  14685. Object.defineProperty(ChartFont.prototype, "name", {
  14686. get: function () {
  14687. _throwIfNotLoaded("name", this.m_name, "ChartFont", this._isNull);
  14688. return this.m_name;
  14689. },
  14690. set: function (value) {
  14691. this.m_name=value;
  14692. _createSetPropertyAction(this.context, this, "Name", value);
  14693. },
  14694. enumerable: true,
  14695. configurable: true
  14696. });
  14697. Object.defineProperty(ChartFont.prototype, "size", {
  14698. get: function () {
  14699. _throwIfNotLoaded("size", this.m_size, "ChartFont", this._isNull);
  14700. return this.m_size;
  14701. },
  14702. set: function (value) {
  14703. this.m_size=value;
  14704. _createSetPropertyAction(this.context, this, "Size", value);
  14705. },
  14706. enumerable: true,
  14707. configurable: true
  14708. });
  14709. Object.defineProperty(ChartFont.prototype, "underline", {
  14710. get: function () {
  14711. _throwIfNotLoaded("underline", this.m_underline, "ChartFont", this._isNull);
  14712. return this.m_underline;
  14713. },
  14714. set: function (value) {
  14715. this.m_underline=value;
  14716. _createSetPropertyAction(this.context, this, "Underline", value);
  14717. },
  14718. enumerable: true,
  14719. configurable: true
  14720. });
  14721. ChartFont.prototype._handleResult=function (value) {
  14722. _super.prototype._handleResult.call(this, value);
  14723. if (_isNullOrUndefined(value))
  14724. return;
  14725. var obj=value;
  14726. _fixObjectPathIfNecessary(this, obj);
  14727. if (!_isUndefined(obj["Bold"])) {
  14728. this.m_bold=obj["Bold"];
  14729. }
  14730. if (!_isUndefined(obj["Color"])) {
  14731. this.m_color=obj["Color"];
  14732. }
  14733. if (!_isUndefined(obj["Italic"])) {
  14734. this.m_italic=obj["Italic"];
  14735. }
  14736. if (!_isUndefined(obj["Name"])) {
  14737. this.m_name=obj["Name"];
  14738. }
  14739. if (!_isUndefined(obj["Size"])) {
  14740. this.m_size=obj["Size"];
  14741. }
  14742. if (!_isUndefined(obj["Underline"])) {
  14743. this.m_underline=obj["Underline"];
  14744. }
  14745. };
  14746. ChartFont.prototype.load=function (option) {
  14747. _load(this, option);
  14748. return this;
  14749. };
  14750. ChartFont.prototype.toJSON=function () {
  14751. return {
  14752. "bold": this.m_bold,
  14753. "color": this.m_color,
  14754. "italic": this.m_italic,
  14755. "name": this.m_name,
  14756. "size": this.m_size,
  14757. "underline": this.m_underline
  14758. };
  14759. };
  14760. return ChartFont;
  14761. }(OfficeExtension.ClientObject));
  14762. Excel.ChartFont=ChartFont;
  14763. var RangeSort=(function (_super) {
  14764. __extends(RangeSort, _super);
  14765. function RangeSort() {
  14766. _super.apply(this, arguments);
  14767. }
  14768. RangeSort.prototype.apply=function (fields, matchCase, hasHeaders, orientation, method) {
  14769. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, hasHeaders, orientation, method]);
  14770. };
  14771. RangeSort.prototype._handleResult=function (value) {
  14772. _super.prototype._handleResult.call(this, value);
  14773. if (_isNullOrUndefined(value))
  14774. return;
  14775. var obj=value;
  14776. _fixObjectPathIfNecessary(this, obj);
  14777. };
  14778. RangeSort.prototype.toJSON=function () {
  14779. return {};
  14780. };
  14781. return RangeSort;
  14782. }(OfficeExtension.ClientObject));
  14783. Excel.RangeSort=RangeSort;
  14784. var TableSort=(function (_super) {
  14785. __extends(TableSort, _super);
  14786. function TableSort() {
  14787. _super.apply(this, arguments);
  14788. }
  14789. Object.defineProperty(TableSort.prototype, "fields", {
  14790. get: function () {
  14791. _throwIfNotLoaded("fields", this.m_fields, "TableSort", this._isNull);
  14792. return this.m_fields;
  14793. },
  14794. enumerable: true,
  14795. configurable: true
  14796. });
  14797. Object.defineProperty(TableSort.prototype, "matchCase", {
  14798. get: function () {
  14799. _throwIfNotLoaded("matchCase", this.m_matchCase, "TableSort", this._isNull);
  14800. return this.m_matchCase;
  14801. },
  14802. enumerable: true,
  14803. configurable: true
  14804. });
  14805. Object.defineProperty(TableSort.prototype, "method", {
  14806. get: function () {
  14807. _throwIfNotLoaded("method", this.m_method, "TableSort", this._isNull);
  14808. return this.m_method;
  14809. },
  14810. enumerable: true,
  14811. configurable: true
  14812. });
  14813. TableSort.prototype.apply=function (fields, matchCase, method) {
  14814. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, method]);
  14815. };
  14816. TableSort.prototype.clear=function () {
  14817. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14818. };
  14819. TableSort.prototype.reapply=function () {
  14820. _createMethodAction(this.context, this, "Reapply", OfficeExtension.OperationType.Default, []);
  14821. };
  14822. TableSort.prototype._handleResult=function (value) {
  14823. _super.prototype._handleResult.call(this, value);
  14824. if (_isNullOrUndefined(value))
  14825. return;
  14826. var obj=value;
  14827. _fixObjectPathIfNecessary(this, obj);
  14828. if (!_isUndefined(obj["Fields"])) {
  14829. this.m_fields=obj["Fields"];
  14830. }
  14831. if (!_isUndefined(obj["MatchCase"])) {
  14832. this.m_matchCase=obj["MatchCase"];
  14833. }
  14834. if (!_isUndefined(obj["Method"])) {
  14835. this.m_method=obj["Method"];
  14836. }
  14837. };
  14838. TableSort.prototype.load=function (option) {
  14839. _load(this, option);
  14840. return this;
  14841. };
  14842. TableSort.prototype.toJSON=function () {
  14843. return {
  14844. "fields": this.m_fields,
  14845. "matchCase": this.m_matchCase,
  14846. "method": this.m_method
  14847. };
  14848. };
  14849. return TableSort;
  14850. }(OfficeExtension.ClientObject));
  14851. Excel.TableSort=TableSort;
  14852. var Filter=(function (_super) {
  14853. __extends(Filter, _super);
  14854. function Filter() {
  14855. _super.apply(this, arguments);
  14856. }
  14857. Object.defineProperty(Filter.prototype, "criteria", {
  14858. get: function () {
  14859. _throwIfNotLoaded("criteria", this.m_criteria, "Filter", this._isNull);
  14860. return this.m_criteria;
  14861. },
  14862. enumerable: true,
  14863. configurable: true
  14864. });
  14865. Filter.prototype.apply=function (criteria) {
  14866. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [criteria]);
  14867. };
  14868. Filter.prototype.applyBottomItemsFilter=function (count) {
  14869. _createMethodAction(this.context, this, "ApplyBottomItemsFilter", OfficeExtension.OperationType.Default, [count]);
  14870. };
  14871. Filter.prototype.applyBottomPercentFilter=function (percent) {
  14872. _createMethodAction(this.context, this, "ApplyBottomPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  14873. };
  14874. Filter.prototype.applyCellColorFilter=function (color) {
  14875. _createMethodAction(this.context, this, "ApplyCellColorFilter", OfficeExtension.OperationType.Default, [color]);
  14876. };
  14877. Filter.prototype.applyCustomFilter=function (criteria1, criteria2, oper) {
  14878. _createMethodAction(this.context, this, "ApplyCustomFilter", OfficeExtension.OperationType.Default, [criteria1, criteria2, oper]);
  14879. };
  14880. Filter.prototype.applyDynamicFilter=function (criteria) {
  14881. _createMethodAction(this.context, this, "ApplyDynamicFilter", OfficeExtension.OperationType.Default, [criteria]);
  14882. };
  14883. Filter.prototype.applyFontColorFilter=function (color) {
  14884. _createMethodAction(this.context, this, "ApplyFontColorFilter", OfficeExtension.OperationType.Default, [color]);
  14885. };
  14886. Filter.prototype.applyIconFilter=function (icon) {
  14887. _createMethodAction(this.context, this, "ApplyIconFilter", OfficeExtension.OperationType.Default, [icon]);
  14888. };
  14889. Filter.prototype.applyTopItemsFilter=function (count) {
  14890. _createMethodAction(this.context, this, "ApplyTopItemsFilter", OfficeExtension.OperationType.Default, [count]);
  14891. };
  14892. Filter.prototype.applyTopPercentFilter=function (percent) {
  14893. _createMethodAction(this.context, this, "ApplyTopPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  14894. };
  14895. Filter.prototype.applyValuesFilter=function (values) {
  14896. _createMethodAction(this.context, this, "ApplyValuesFilter", OfficeExtension.OperationType.Default, [values]);
  14897. };
  14898. Filter.prototype.clear=function () {
  14899. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14900. };
  14901. Filter.prototype._handleResult=function (value) {
  14902. _super.prototype._handleResult.call(this, value);
  14903. if (_isNullOrUndefined(value))
  14904. return;
  14905. var obj=value;
  14906. _fixObjectPathIfNecessary(this, obj);
  14907. if (!_isUndefined(obj["Criteria"])) {
  14908. this.m_criteria=obj["Criteria"];
  14909. }
  14910. };
  14911. Filter.prototype.load=function (option) {
  14912. _load(this, option);
  14913. return this;
  14914. };
  14915. Filter.prototype.toJSON=function () {
  14916. return {
  14917. "criteria": this.m_criteria
  14918. };
  14919. };
  14920. return Filter;
  14921. }(OfficeExtension.ClientObject));
  14922. Excel.Filter=Filter;
  14923. var _V1Api=(function (_super) {
  14924. __extends(_V1Api, _super);
  14925. function _V1Api() {
  14926. _super.apply(this, arguments);
  14927. }
  14928. _V1Api.prototype.bindingAddColumns=function (input) {
  14929. var action=_createMethodAction(this.context, this, "BindingAddColumns", OfficeExtension.OperationType.Default, [input]);
  14930. var ret=new OfficeExtension.ClientResult();
  14931. _addActionResultHandler(this, action, ret);
  14932. return ret;
  14933. };
  14934. _V1Api.prototype.bindingAddFromNamedItem=function (input) {
  14935. var action=_createMethodAction(this.context, this, "BindingAddFromNamedItem", OfficeExtension.OperationType.Read, [input]);
  14936. var ret=new OfficeExtension.ClientResult();
  14937. _addActionResultHandler(this, action, ret);
  14938. return ret;
  14939. };
  14940. _V1Api.prototype.bindingAddFromPrompt=function (input) {
  14941. var action=_createMethodAction(this.context, this, "BindingAddFromPrompt", OfficeExtension.OperationType.Read, [input]);
  14942. var ret=new OfficeExtension.ClientResult();
  14943. _addActionResultHandler(this, action, ret);
  14944. return ret;
  14945. };
  14946. _V1Api.prototype.bindingAddFromSelection=function (input) {
  14947. var action=_createMethodAction(this.context, this, "BindingAddFromSelection", OfficeExtension.OperationType.Read, [input]);
  14948. var ret=new OfficeExtension.ClientResult();
  14949. _addActionResultHandler(this, action, ret);
  14950. return ret;
  14951. };
  14952. _V1Api.prototype.bindingAddRows=function (input) {
  14953. var action=_createMethodAction(this.context, this, "BindingAddRows", OfficeExtension.OperationType.Default, [input]);
  14954. var ret=new OfficeExtension.ClientResult();
  14955. _addActionResultHandler(this, action, ret);
  14956. return ret;
  14957. };
  14958. _V1Api.prototype.bindingClearFormats=function (input) {
  14959. var action=_createMethodAction(this.context, this, "BindingClearFormats", OfficeExtension.OperationType.Default, [input]);
  14960. var ret=new OfficeExtension.ClientResult();
  14961. _addActionResultHandler(this, action, ret);
  14962. return ret;
  14963. };
  14964. _V1Api.prototype.bindingDeleteAllDataValues=function (input) {
  14965. var action=_createMethodAction(this.context, this, "BindingDeleteAllDataValues", OfficeExtension.OperationType.Default, [input]);
  14966. var ret=new OfficeExtension.ClientResult();
  14967. _addActionResultHandler(this, action, ret);
  14968. return ret;
  14969. };
  14970. _V1Api.prototype.bindingGetAll=function () {
  14971. var action=_createMethodAction(this.context, this, "BindingGetAll", OfficeExtension.OperationType.Read, []);
  14972. var ret=new OfficeExtension.ClientResult();
  14973. _addActionResultHandler(this, action, ret);
  14974. return ret;
  14975. };
  14976. _V1Api.prototype.bindingGetById=function (input) {
  14977. var action=_createMethodAction(this.context, this, "BindingGetById", OfficeExtension.OperationType.Read, [input]);
  14978. var ret=new OfficeExtension.ClientResult();
  14979. _addActionResultHandler(this, action, ret);
  14980. return ret;
  14981. };
  14982. _V1Api.prototype.bindingGetData=function (input) {
  14983. var action=_createMethodAction(this.context, this, "BindingGetData", OfficeExtension.OperationType.Read, [input]);
  14984. var ret=new OfficeExtension.ClientResult();
  14985. _addActionResultHandler(this, action, ret);
  14986. return ret;
  14987. };
  14988. _V1Api.prototype.bindingReleaseById=function (input) {
  14989. var action=_createMethodAction(this.context, this, "BindingReleaseById", OfficeExtension.OperationType.Read, [input]);
  14990. var ret=new OfficeExtension.ClientResult();
  14991. _addActionResultHandler(this, action, ret);
  14992. return ret;
  14993. };
  14994. _V1Api.prototype.bindingSetData=function (input) {
  14995. var action=_createMethodAction(this.context, this, "BindingSetData", OfficeExtension.OperationType.Default, [input]);
  14996. var ret=new OfficeExtension.ClientResult();
  14997. _addActionResultHandler(this, action, ret);
  14998. return ret;
  14999. };
  15000. _V1Api.prototype.bindingSetFormats=function (input) {
  15001. var action=_createMethodAction(this.context, this, "BindingSetFormats", OfficeExtension.OperationType.Default, [input]);
  15002. var ret=new OfficeExtension.ClientResult();
  15003. _addActionResultHandler(this, action, ret);
  15004. return ret;
  15005. };
  15006. _V1Api.prototype.bindingSetTableOptions=function (input) {
  15007. var action=_createMethodAction(this.context, this, "BindingSetTableOptions", OfficeExtension.OperationType.Default, [input]);
  15008. var ret=new OfficeExtension.ClientResult();
  15009. _addActionResultHandler(this, action, ret);
  15010. return ret;
  15011. };
  15012. _V1Api.prototype.getSelectedData=function (input) {
  15013. var action=_createMethodAction(this.context, this, "GetSelectedData", OfficeExtension.OperationType.Read, [input]);
  15014. var ret=new OfficeExtension.ClientResult();
  15015. _addActionResultHandler(this, action, ret);
  15016. return ret;
  15017. };
  15018. _V1Api.prototype.gotoById=function (input) {
  15019. var action=_createMethodAction(this.context, this, "GotoById", OfficeExtension.OperationType.Read, [input]);
  15020. var ret=new OfficeExtension.ClientResult();
  15021. _addActionResultHandler(this, action, ret);
  15022. return ret;
  15023. };
  15024. _V1Api.prototype.setSelectedData=function (input) {
  15025. var action=_createMethodAction(this.context, this, "SetSelectedData", OfficeExtension.OperationType.Default, [input]);
  15026. var ret=new OfficeExtension.ClientResult();
  15027. _addActionResultHandler(this, action, ret);
  15028. return ret;
  15029. };
  15030. _V1Api.prototype._handleResult=function (value) {
  15031. _super.prototype._handleResult.call(this, value);
  15032. if (_isNullOrUndefined(value))
  15033. return;
  15034. var obj=value;
  15035. _fixObjectPathIfNecessary(this, obj);
  15036. };
  15037. _V1Api.prototype.toJSON=function () {
  15038. return {};
  15039. };
  15040. return _V1Api;
  15041. }(OfficeExtension.ClientObject));
  15042. Excel._V1Api=_V1Api;
  15043. var PivotTableCollection=(function (_super) {
  15044. __extends(PivotTableCollection, _super);
  15045. function PivotTableCollection() {
  15046. _super.apply(this, arguments);
  15047. }
  15048. Object.defineProperty(PivotTableCollection.prototype, "items", {
  15049. get: function () {
  15050. _throwIfNotLoaded("items", this.m__items, "PivotTableCollection", this._isNull);
  15051. return this.m__items;
  15052. },
  15053. enumerable: true,
  15054. configurable: true
  15055. });
  15056. PivotTableCollection.prototype.getItem=function (name) {
  15057. return new Excel.PivotTable(this.context, _createIndexerObjectPath(this.context, this, [name]));
  15058. };
  15059. PivotTableCollection.prototype.refreshAll=function () {
  15060. _createMethodAction(this.context, this, "RefreshAll", OfficeExtension.OperationType.Default, []);
  15061. };
  15062. PivotTableCollection.prototype._handleResult=function (value) {
  15063. _super.prototype._handleResult.call(this, value);
  15064. if (_isNullOrUndefined(value))
  15065. return;
  15066. var obj=value;
  15067. _fixObjectPathIfNecessary(this, obj);
  15068. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15069. this.m__items=[];
  15070. var _data=obj[OfficeExtension.Constants.items];
  15071. for (var i=0; i < _data.length; i++) {
  15072. var _item=new Excel.PivotTable(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  15073. _item._handleResult(_data[i]);
  15074. this.m__items.push(_item);
  15075. }
  15076. }
  15077. };
  15078. PivotTableCollection.prototype.load=function (option) {
  15079. _load(this, option);
  15080. return this;
  15081. };
  15082. PivotTableCollection.prototype.toJSON=function () {
  15083. return {};
  15084. };
  15085. return PivotTableCollection;
  15086. }(OfficeExtension.ClientObject));
  15087. Excel.PivotTableCollection=PivotTableCollection;
  15088. var PivotTable=(function (_super) {
  15089. __extends(PivotTable, _super);
  15090. function PivotTable() {
  15091. _super.apply(this, arguments);
  15092. }
  15093. Object.defineProperty(PivotTable.prototype, "worksheet", {
  15094. get: function () {
  15095. if (!this.m_worksheet) {
  15096. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  15097. }
  15098. return this.m_worksheet;
  15099. },
  15100. enumerable: true,
  15101. configurable: true
  15102. });
  15103. Object.defineProperty(PivotTable.prototype, "name", {
  15104. get: function () {
  15105. _throwIfNotLoaded("name", this.m_name, "PivotTable", this._isNull);
  15106. return this.m_name;
  15107. },
  15108. set: function (value) {
  15109. this.m_name=value;
  15110. _createSetPropertyAction(this.context, this, "Name", value);
  15111. },
  15112. enumerable: true,
  15113. configurable: true
  15114. });
  15115. PivotTable.prototype.refresh=function () {
  15116. _createMethodAction(this.context, this, "Refresh", OfficeExtension.OperationType.Default, []);
  15117. };
  15118. PivotTable.prototype._handleResult=function (value) {
  15119. _super.prototype._handleResult.call(this, value);
  15120. if (_isNullOrUndefined(value))
  15121. return;
  15122. var obj=value;
  15123. _fixObjectPathIfNecessary(this, obj);
  15124. if (!_isUndefined(obj["Name"])) {
  15125. this.m_name=obj["Name"];
  15126. }
  15127. _handleNavigationPropertyResults(this, obj, ["worksheet", "Worksheet"]);
  15128. };
  15129. PivotTable.prototype.load=function (option) {
  15130. _load(this, option);
  15131. return this;
  15132. };
  15133. PivotTable.prototype.toJSON=function () {
  15134. return {
  15135. "name": this.m_name
  15136. };
  15137. };
  15138. return PivotTable;
  15139. }(OfficeExtension.ClientObject));
  15140. Excel.PivotTable=PivotTable;
  15141. var BindingType;
  15142. (function (BindingType) {
  15143. BindingType.range="Range";
  15144. BindingType.table="Table";
  15145. BindingType.text="Text";
  15146. })(BindingType=Excel.BindingType || (Excel.BindingType={}));
  15147. var BorderIndex;
  15148. (function (BorderIndex) {
  15149. BorderIndex.edgeTop="EdgeTop";
  15150. BorderIndex.edgeBottom="EdgeBottom";
  15151. BorderIndex.edgeLeft="EdgeLeft";
  15152. BorderIndex.edgeRight="EdgeRight";
  15153. BorderIndex.insideVertical="InsideVertical";
  15154. BorderIndex.insideHorizontal="InsideHorizontal";
  15155. BorderIndex.diagonalDown="DiagonalDown";
  15156. BorderIndex.diagonalUp="DiagonalUp";
  15157. })(BorderIndex=Excel.BorderIndex || (Excel.BorderIndex={}));
  15158. var BorderLineStyle;
  15159. (function (BorderLineStyle) {
  15160. BorderLineStyle.none="None";
  15161. BorderLineStyle.continuous="Continuous";
  15162. BorderLineStyle.dash="Dash";
  15163. BorderLineStyle.dashDot="DashDot";
  15164. BorderLineStyle.dashDotDot="DashDotDot";
  15165. BorderLineStyle.dot="Dot";
  15166. BorderLineStyle.double="Double";
  15167. BorderLineStyle.slantDashDot="SlantDashDot";
  15168. })(BorderLineStyle=Excel.BorderLineStyle || (Excel.BorderLineStyle={}));
  15169. var BorderWeight;
  15170. (function (BorderWeight) {
  15171. BorderWeight.hairline="Hairline";
  15172. BorderWeight.thin="Thin";
  15173. BorderWeight.medium="Medium";
  15174. BorderWeight.thick="Thick";
  15175. })(BorderWeight=Excel.BorderWeight || (Excel.BorderWeight={}));
  15176. var CalculationMode;
  15177. (function (CalculationMode) {
  15178. CalculationMode.automatic="Automatic";
  15179. CalculationMode.automaticExceptTables="AutomaticExceptTables";
  15180. CalculationMode.manual="Manual";
  15181. })(CalculationMode=Excel.CalculationMode || (Excel.CalculationMode={}));
  15182. var CalculationType;
  15183. (function (CalculationType) {
  15184. CalculationType.recalculate="Recalculate";
  15185. CalculationType.full="Full";
  15186. CalculationType.fullRebuild="FullRebuild";
  15187. })(CalculationType=Excel.CalculationType || (Excel.CalculationType={}));
  15188. var ClearApplyTo;
  15189. (function (ClearApplyTo) {
  15190. ClearApplyTo.all="All";
  15191. ClearApplyTo.formats="Formats";
  15192. ClearApplyTo.contents="Contents";
  15193. })(ClearApplyTo=Excel.ClearApplyTo || (Excel.ClearApplyTo={}));
  15194. var ChartDataLabelPosition;
  15195. (function (ChartDataLabelPosition) {
  15196. ChartDataLabelPosition.invalid="Invalid";
  15197. ChartDataLabelPosition.none="None";
  15198. ChartDataLabelPosition.center="Center";
  15199. ChartDataLabelPosition.insideEnd="InsideEnd";
  15200. ChartDataLabelPosition.insideBase="InsideBase";
  15201. ChartDataLabelPosition.outsideEnd="OutsideEnd";
  15202. ChartDataLabelPosition.left="Left";
  15203. ChartDataLabelPosition.right="Right";
  15204. ChartDataLabelPosition.top="Top";
  15205. ChartDataLabelPosition.bottom="Bottom";
  15206. ChartDataLabelPosition.bestFit="BestFit";
  15207. ChartDataLabelPosition.callout="Callout";
  15208. })(ChartDataLabelPosition=Excel.ChartDataLabelPosition || (Excel.ChartDataLabelPosition={}));
  15209. var ChartLegendPosition;
  15210. (function (ChartLegendPosition) {
  15211. ChartLegendPosition.invalid="Invalid";
  15212. ChartLegendPosition.top="Top";
  15213. ChartLegendPosition.bottom="Bottom";
  15214. ChartLegendPosition.left="Left";
  15215. ChartLegendPosition.right="Right";
  15216. ChartLegendPosition.corner="Corner";
  15217. ChartLegendPosition.custom="Custom";
  15218. })(ChartLegendPosition=Excel.ChartLegendPosition || (Excel.ChartLegendPosition={}));
  15219. var ChartSeriesBy;
  15220. (function (ChartSeriesBy) {
  15221. ChartSeriesBy.auto="Auto";
  15222. ChartSeriesBy.columns="Columns";
  15223. ChartSeriesBy.rows="Rows";
  15224. })(ChartSeriesBy=Excel.ChartSeriesBy || (Excel.ChartSeriesBy={}));
  15225. var ChartType;
  15226. (function (ChartType) {
  15227. ChartType.invalid="Invalid";
  15228. ChartType.columnClustered="ColumnClustered";
  15229. ChartType.columnStacked="ColumnStacked";
  15230. ChartType.columnStacked100="ColumnStacked100";
  15231. ChartType._3DColumnClustered="3DColumnClustered";
  15232. ChartType._3DColumnStacked="3DColumnStacked";
  15233. ChartType._3DColumnStacked100="3DColumnStacked100";
  15234. ChartType.barClustered="BarClustered";
  15235. ChartType.barStacked="BarStacked";
  15236. ChartType.barStacked100="BarStacked100";
  15237. ChartType._3DBarClustered="3DBarClustered";
  15238. ChartType._3DBarStacked="3DBarStacked";
  15239. ChartType._3DBarStacked100="3DBarStacked100";
  15240. ChartType.lineStacked="LineStacked";
  15241. ChartType.lineStacked100="LineStacked100";
  15242. ChartType.lineMarkers="LineMarkers";
  15243. ChartType.lineMarkersStacked="LineMarkersStacked";
  15244. ChartType.lineMarkersStacked100="LineMarkersStacked100";
  15245. ChartType.pieOfPie="PieOfPie";
  15246. ChartType.pieExploded="PieExploded";
  15247. ChartType._3DPieExploded="3DPieExploded";
  15248. ChartType.barOfPie="BarOfPie";
  15249. ChartType.xyscatterSmooth="XYScatterSmooth";
  15250. ChartType.xyscatterSmoothNoMarkers="XYScatterSmoothNoMarkers";
  15251. ChartType.xyscatterLines="XYScatterLines";
  15252. ChartType.xyscatterLinesNoMarkers="XYScatterLinesNoMarkers";
  15253. ChartType.areaStacked="AreaStacked";
  15254. ChartType.areaStacked100="AreaStacked100";
  15255. ChartType._3DAreaStacked="3DAreaStacked";
  15256. ChartType._3DAreaStacked100="3DAreaStacked100";
  15257. ChartType.doughnutExploded="DoughnutExploded";
  15258. ChartType.radarMarkers="RadarMarkers";
  15259. ChartType.radarFilled="RadarFilled";
  15260. ChartType.surface="Surface";
  15261. ChartType.surfaceWireframe="SurfaceWireframe";
  15262. ChartType.surfaceTopView="SurfaceTopView";
  15263. ChartType.surfaceTopViewWireframe="SurfaceTopViewWireframe";
  15264. ChartType.bubble="Bubble";
  15265. ChartType.bubble3DEffect="Bubble3DEffect";
  15266. ChartType.stockHLC="StockHLC";
  15267. ChartType.stockOHLC="StockOHLC";
  15268. ChartType.stockVHLC="StockVHLC";
  15269. ChartType.stockVOHLC="StockVOHLC";
  15270. ChartType.cylinderColClustered="CylinderColClustered";
  15271. ChartType.cylinderColStacked="CylinderColStacked";
  15272. ChartType.cylinderColStacked100="CylinderColStacked100";
  15273. ChartType.cylinderBarClustered="CylinderBarClustered";
  15274. ChartType.cylinderBarStacked="CylinderBarStacked";
  15275. ChartType.cylinderBarStacked100="CylinderBarStacked100";
  15276. ChartType.cylinderCol="CylinderCol";
  15277. ChartType.coneColClustered="ConeColClustered";
  15278. ChartType.coneColStacked="ConeColStacked";
  15279. ChartType.coneColStacked100="ConeColStacked100";
  15280. ChartType.coneBarClustered="ConeBarClustered";
  15281. ChartType.coneBarStacked="ConeBarStacked";
  15282. ChartType.coneBarStacked100="ConeBarStacked100";
  15283. ChartType.coneCol="ConeCol";
  15284. ChartType.pyramidColClustered="PyramidColClustered";
  15285. ChartType.pyramidColStacked="PyramidColStacked";
  15286. ChartType.pyramidColStacked100="PyramidColStacked100";
  15287. ChartType.pyramidBarClustered="PyramidBarClustered";
  15288. ChartType.pyramidBarStacked="PyramidBarStacked";
  15289. ChartType.pyramidBarStacked100="PyramidBarStacked100";
  15290. ChartType.pyramidCol="PyramidCol";
  15291. ChartType._3DColumn="3DColumn";
  15292. ChartType.line="Line";
  15293. ChartType._3DLine="3DLine";
  15294. ChartType._3DPie="3DPie";
  15295. ChartType.pie="Pie";
  15296. ChartType.xyscatter="XYScatter";
  15297. ChartType._3DArea="3DArea";
  15298. ChartType.area="Area";
  15299. ChartType.doughnut="Doughnut";
  15300. ChartType.radar="Radar";
  15301. })(ChartType=Excel.ChartType || (Excel.ChartType={}));
  15302. var ChartUnderlineStyle;
  15303. (function (ChartUnderlineStyle) {
  15304. ChartUnderlineStyle.none="None";
  15305. ChartUnderlineStyle.single="Single";
  15306. })(ChartUnderlineStyle=Excel.ChartUnderlineStyle || (Excel.ChartUnderlineStyle={}));
  15307. var DeleteShiftDirection;
  15308. (function (DeleteShiftDirection) {
  15309. DeleteShiftDirection.up="Up";
  15310. DeleteShiftDirection.left="Left";
  15311. })(DeleteShiftDirection=Excel.DeleteShiftDirection || (Excel.DeleteShiftDirection={}));
  15312. var DynamicFilterCriteria;
  15313. (function (DynamicFilterCriteria) {
  15314. DynamicFilterCriteria.unknown="Unknown";
  15315. DynamicFilterCriteria.aboveAverage="AboveAverage";
  15316. DynamicFilterCriteria.allDatesInPeriodApril="AllDatesInPeriodApril";
  15317. DynamicFilterCriteria.allDatesInPeriodAugust="AllDatesInPeriodAugust";
  15318. DynamicFilterCriteria.allDatesInPeriodDecember="AllDatesInPeriodDecember";
  15319. DynamicFilterCriteria.allDatesInPeriodFebruray="AllDatesInPeriodFebruray";
  15320. DynamicFilterCriteria.allDatesInPeriodJanuary="AllDatesInPeriodJanuary";
  15321. DynamicFilterCriteria.allDatesInPeriodJuly="AllDatesInPeriodJuly";
  15322. DynamicFilterCriteria.allDatesInPeriodJune="AllDatesInPeriodJune";
  15323. DynamicFilterCriteria.allDatesInPeriodMarch="AllDatesInPeriodMarch";
  15324. DynamicFilterCriteria.allDatesInPeriodMay="AllDatesInPeriodMay";
  15325. DynamicFilterCriteria.allDatesInPeriodNovember="AllDatesInPeriodNovember";
  15326. DynamicFilterCriteria.allDatesInPeriodOctober="AllDatesInPeriodOctober";
  15327. DynamicFilterCriteria.allDatesInPeriodQuarter1="AllDatesInPeriodQuarter1";
  15328. DynamicFilterCriteria.allDatesInPeriodQuarter2="AllDatesInPeriodQuarter2";
  15329. DynamicFilterCriteria.allDatesInPeriodQuarter3="AllDatesInPeriodQuarter3";
  15330. DynamicFilterCriteria.allDatesInPeriodQuarter4="AllDatesInPeriodQuarter4";
  15331. DynamicFilterCriteria.allDatesInPeriodSeptember="AllDatesInPeriodSeptember";
  15332. DynamicFilterCriteria.belowAverage="BelowAverage";
  15333. DynamicFilterCriteria.lastMonth="LastMonth";
  15334. DynamicFilterCriteria.lastQuarter="LastQuarter";
  15335. DynamicFilterCriteria.lastWeek="LastWeek";
  15336. DynamicFilterCriteria.lastYear="LastYear";
  15337. DynamicFilterCriteria.nextMonth="NextMonth";
  15338. DynamicFilterCriteria.nextQuarter="NextQuarter";
  15339. DynamicFilterCriteria.nextWeek="NextWeek";
  15340. DynamicFilterCriteria.nextYear="NextYear";
  15341. DynamicFilterCriteria.thisMonth="ThisMonth";
  15342. DynamicFilterCriteria.thisQuarter="ThisQuarter";
  15343. DynamicFilterCriteria.thisWeek="ThisWeek";
  15344. DynamicFilterCriteria.thisYear="ThisYear";
  15345. DynamicFilterCriteria.today="Today";
  15346. DynamicFilterCriteria.tomorrow="Tomorrow";
  15347. DynamicFilterCriteria.yearToDate="YearToDate";
  15348. DynamicFilterCriteria.yesterday="Yesterday";
  15349. })(DynamicFilterCriteria=Excel.DynamicFilterCriteria || (Excel.DynamicFilterCriteria={}));
  15350. var FilterDatetimeSpecificity;
  15351. (function (FilterDatetimeSpecificity) {
  15352. FilterDatetimeSpecificity.year="Year";
  15353. FilterDatetimeSpecificity.month="Month";
  15354. FilterDatetimeSpecificity.day="Day";
  15355. FilterDatetimeSpecificity.hour="Hour";
  15356. FilterDatetimeSpecificity.minute="Minute";
  15357. FilterDatetimeSpecificity.second="Second";
  15358. })(FilterDatetimeSpecificity=Excel.FilterDatetimeSpecificity || (Excel.FilterDatetimeSpecificity={}));
  15359. var FilterOn;
  15360. (function (FilterOn) {
  15361. FilterOn.bottomItems="BottomItems";
  15362. FilterOn.bottomPercent="BottomPercent";
  15363. FilterOn.cellColor="CellColor";
  15364. FilterOn.dynamic="Dynamic";
  15365. FilterOn.fontColor="FontColor";
  15366. FilterOn.values="Values";
  15367. FilterOn.topItems="TopItems";
  15368. FilterOn.topPercent="TopPercent";
  15369. FilterOn.icon="Icon";
  15370. FilterOn.custom="Custom";
  15371. })(FilterOn=Excel.FilterOn || (Excel.FilterOn={}));
  15372. var FilterOperator;
  15373. (function (FilterOperator) {
  15374. FilterOperator.and="And";
  15375. FilterOperator.or="Or";
  15376. })(FilterOperator=Excel.FilterOperator || (Excel.FilterOperator={}));
  15377. var HorizontalAlignment;
  15378. (function (HorizontalAlignment) {
  15379. HorizontalAlignment.general="General";
  15380. HorizontalAlignment.left="Left";
  15381. HorizontalAlignment.center="Center";
  15382. HorizontalAlignment.right="Right";
  15383. HorizontalAlignment.fill="Fill";
  15384. HorizontalAlignment.justify="Justify";
  15385. HorizontalAlignment.centerAcrossSelection="CenterAcrossSelection";
  15386. HorizontalAlignment.distributed="Distributed";
  15387. })(HorizontalAlignment=Excel.HorizontalAlignment || (Excel.HorizontalAlignment={}));
  15388. var IconSet;
  15389. (function (IconSet) {
  15390. IconSet.invalid="Invalid";
  15391. IconSet.threeArrows="ThreeArrows";
  15392. IconSet.threeArrowsGray="ThreeArrowsGray";
  15393. IconSet.threeFlags="ThreeFlags";
  15394. IconSet.threeTrafficLights1="ThreeTrafficLights1";
  15395. IconSet.threeTrafficLights2="ThreeTrafficLights2";
  15396. IconSet.threeSigns="ThreeSigns";
  15397. IconSet.threeSymbols="ThreeSymbols";
  15398. IconSet.threeSymbols2="ThreeSymbols2";
  15399. IconSet.fourArrows="FourArrows";
  15400. IconSet.fourArrowsGray="FourArrowsGray";
  15401. IconSet.fourRedToBlack="FourRedToBlack";
  15402. IconSet.fourRating="FourRating";
  15403. IconSet.fourTrafficLights="FourTrafficLights";
  15404. IconSet.fiveArrows="FiveArrows";
  15405. IconSet.fiveArrowsGray="FiveArrowsGray";
  15406. IconSet.fiveRating="FiveRating";
  15407. IconSet.fiveQuarters="FiveQuarters";
  15408. IconSet.threeStars="ThreeStars";
  15409. IconSet.threeTriangles="ThreeTriangles";
  15410. IconSet.fiveBoxes="FiveBoxes";
  15411. })(IconSet=Excel.IconSet || (Excel.IconSet={}));
  15412. var ImageFittingMode;
  15413. (function (ImageFittingMode) {
  15414. ImageFittingMode.fit="Fit";
  15415. ImageFittingMode.fitAndCenter="FitAndCenter";
  15416. ImageFittingMode.fill="Fill";
  15417. })(ImageFittingMode=Excel.ImageFittingMode || (Excel.ImageFittingMode={}));
  15418. var InsertShiftDirection;
  15419. (function (InsertShiftDirection) {
  15420. InsertShiftDirection.down="Down";
  15421. InsertShiftDirection.right="Right";
  15422. })(InsertShiftDirection=Excel.InsertShiftDirection || (Excel.InsertShiftDirection={}));
  15423. var NamedItemType;
  15424. (function (NamedItemType) {
  15425. NamedItemType.string="String";
  15426. NamedItemType.integer="Integer";
  15427. NamedItemType.double="Double";
  15428. NamedItemType.boolean="Boolean";
  15429. NamedItemType.range="Range";
  15430. })(NamedItemType=Excel.NamedItemType || (Excel.NamedItemType={}));
  15431. var RangeUnderlineStyle;
  15432. (function (RangeUnderlineStyle) {
  15433. RangeUnderlineStyle.none="None";
  15434. RangeUnderlineStyle.single="Single";
  15435. RangeUnderlineStyle.double="Double";
  15436. RangeUnderlineStyle.singleAccountant="SingleAccountant";
  15437. RangeUnderlineStyle.doubleAccountant="DoubleAccountant";
  15438. })(RangeUnderlineStyle=Excel.RangeUnderlineStyle || (Excel.RangeUnderlineStyle={}));
  15439. var SheetVisibility;
  15440. (function (SheetVisibility) {
  15441. SheetVisibility.visible="Visible";
  15442. SheetVisibility.hidden="Hidden";
  15443. SheetVisibility.veryHidden="VeryHidden";
  15444. })(SheetVisibility=Excel.SheetVisibility || (Excel.SheetVisibility={}));
  15445. var RangeValueType;
  15446. (function (RangeValueType) {
  15447. RangeValueType.unknown="Unknown";
  15448. RangeValueType.empty="Empty";
  15449. RangeValueType.string="String";
  15450. RangeValueType.integer="Integer";
  15451. RangeValueType.double="Double";
  15452. RangeValueType.boolean="Boolean";
  15453. RangeValueType.error="Error";
  15454. })(RangeValueType=Excel.RangeValueType || (Excel.RangeValueType={}));
  15455. var SortOrientation;
  15456. (function (SortOrientation) {
  15457. SortOrientation.rows="Rows";
  15458. SortOrientation.columns="Columns";
  15459. })(SortOrientation=Excel.SortOrientation || (Excel.SortOrientation={}));
  15460. var SortOn;
  15461. (function (SortOn) {
  15462. SortOn.value="Value";
  15463. SortOn.cellColor="CellColor";
  15464. SortOn.fontColor="FontColor";
  15465. SortOn.icon="Icon";
  15466. })(SortOn=Excel.SortOn || (Excel.SortOn={}));
  15467. var SortDataOption;
  15468. (function (SortDataOption) {
  15469. SortDataOption.normal="Normal";
  15470. SortDataOption.textAsNumber="TextAsNumber";
  15471. })(SortDataOption=Excel.SortDataOption || (Excel.SortDataOption={}));
  15472. var SortMethod;
  15473. (function (SortMethod) {
  15474. SortMethod.pinYin="PinYin";
  15475. SortMethod.strokeCount="StrokeCount";
  15476. })(SortMethod=Excel.SortMethod || (Excel.SortMethod={}));
  15477. var VerticalAlignment;
  15478. (function (VerticalAlignment) {
  15479. VerticalAlignment.top="Top";
  15480. VerticalAlignment.center="Center";
  15481. VerticalAlignment.bottom="Bottom";
  15482. VerticalAlignment.justify="Justify";
  15483. VerticalAlignment.distributed="Distributed";
  15484. })(VerticalAlignment=Excel.VerticalAlignment || (Excel.VerticalAlignment={}));
  15485. var FunctionResult=(function (_super) {
  15486. __extends(FunctionResult, _super);
  15487. function FunctionResult() {
  15488. _super.apply(this, arguments);
  15489. }
  15490. Object.defineProperty(FunctionResult.prototype, "error", {
  15491. get: function () {
  15492. _throwIfNotLoaded("error", this.m_error, "FunctionResult", this._isNull);
  15493. return this.m_error;
  15494. },
  15495. enumerable: true,
  15496. configurable: true
  15497. });
  15498. Object.defineProperty(FunctionResult.prototype, "value", {
  15499. get: function () {
  15500. _throwIfNotLoaded("value", this.m_value, "FunctionResult", this._isNull);
  15501. return this.m_value;
  15502. },
  15503. enumerable: true,
  15504. configurable: true
  15505. });
  15506. FunctionResult.prototype._handleResult=function (value) {
  15507. _super.prototype._handleResult.call(this, value);
  15508. if (_isNullOrUndefined(value))
  15509. return;
  15510. var obj=value;
  15511. _fixObjectPathIfNecessary(this, obj);
  15512. if (!_isUndefined(obj["Error"])) {
  15513. this.m_error=obj["Error"];
  15514. }
  15515. if (!_isUndefined(obj["Value"])) {
  15516. this.m_value=obj["Value"];
  15517. }
  15518. };
  15519. FunctionResult.prototype.load=function (option) {
  15520. _load(this, option);
  15521. return this;
  15522. };
  15523. FunctionResult.prototype.toJSON=function () {
  15524. return {
  15525. "error": this.m_error,
  15526. "value": this.m_value
  15527. };
  15528. };
  15529. return FunctionResult;
  15530. }(OfficeExtension.ClientObject));
  15531. Excel.FunctionResult=FunctionResult;
  15532. var Functions=(function (_super) {
  15533. __extends(Functions, _super);
  15534. function Functions() {
  15535. _super.apply(this, arguments);
  15536. }
  15537. Functions.prototype.abs=function (number) {
  15538. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Abs", OfficeExtension.OperationType.Default, [number], false, true, null));
  15539. };
  15540. Functions.prototype.accrInt=function (issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod) {
  15541. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrInt", OfficeExtension.OperationType.Default, [issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod], false, true, null));
  15542. };
  15543. Functions.prototype.accrIntM=function (issue, settlement, rate, par, basis) {
  15544. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrIntM", OfficeExtension.OperationType.Default, [issue, settlement, rate, par, basis], false, true, null));
  15545. };
  15546. Functions.prototype.acos=function (number) {
  15547. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acos", OfficeExtension.OperationType.Default, [number], false, true, null));
  15548. };
  15549. Functions.prototype.acosh=function (number) {
  15550. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15551. };
  15552. Functions.prototype.acot=function (number) {
  15553. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acot", OfficeExtension.OperationType.Default, [number], false, true, null));
  15554. };
  15555. Functions.prototype.acoth=function (number) {
  15556. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acoth", OfficeExtension.OperationType.Default, [number], false, true, null));
  15557. };
  15558. Functions.prototype.amorDegrc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  15559. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorDegrc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  15560. };
  15561. Functions.prototype.amorLinc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  15562. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorLinc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  15563. };
  15564. Functions.prototype.and=function () {
  15565. var values=[];
  15566. for (var _i=0; _i < arguments.length; _i++) {
  15567. values[_i - 0]=arguments[_i];
  15568. }
  15569. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "And", OfficeExtension.OperationType.Default, [values], false, true, null));
  15570. };
  15571. Functions.prototype.arabic=function (text) {
  15572. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Arabic", OfficeExtension.OperationType.Default, [text], false, true, null));
  15573. };
  15574. Functions.prototype.areas=function (reference) {
  15575. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Areas", OfficeExtension.OperationType.Default, [reference], false, true, null));
  15576. };
  15577. Functions.prototype.asc=function (text) {
  15578. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asc", OfficeExtension.OperationType.Default, [text], false, true, null));
  15579. };
  15580. Functions.prototype.asin=function (number) {
  15581. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asin", OfficeExtension.OperationType.Default, [number], false, true, null));
  15582. };
  15583. Functions.prototype.asinh=function (number) {
  15584. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15585. };
  15586. Functions.prototype.atan=function (number) {
  15587. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan", OfficeExtension.OperationType.Default, [number], false, true, null));
  15588. };
  15589. Functions.prototype.atan2=function (xNum, yNum) {
  15590. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan2", OfficeExtension.OperationType.Default, [xNum, yNum], false, true, null));
  15591. };
  15592. Functions.prototype.atanh=function (number) {
  15593. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15594. };
  15595. Functions.prototype.aveDev=function () {
  15596. var values=[];
  15597. for (var _i=0; _i < arguments.length; _i++) {
  15598. values[_i - 0]=arguments[_i];
  15599. }
  15600. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AveDev", OfficeExtension.OperationType.Default, [values], false, true, null));
  15601. };
  15602. Functions.prototype.average=function () {
  15603. var values=[];
  15604. for (var _i=0; _i < arguments.length; _i++) {
  15605. values[_i - 0]=arguments[_i];
  15606. }
  15607. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Average", OfficeExtension.OperationType.Default, [values], false, true, null));
  15608. };
  15609. Functions.prototype.averageA=function () {
  15610. var values=[];
  15611. for (var _i=0; _i < arguments.length; _i++) {
  15612. values[_i - 0]=arguments[_i];
  15613. }
  15614. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageA", OfficeExtension.OperationType.Default, [values], false, true, null));
  15615. };
  15616. Functions.prototype.averageIf=function (range, criteria, averageRange) {
  15617. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIf", OfficeExtension.OperationType.Default, [range, criteria, averageRange], false, true, null));
  15618. };
  15619. Functions.prototype.averageIfs=function (averageRange) {
  15620. var values=[];
  15621. for (var _i=1; _i < arguments.length; _i++) {
  15622. values[_i - 1]=arguments[_i];
  15623. }
  15624. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIfs", OfficeExtension.OperationType.Default, [averageRange, values], false, true, null));
  15625. };
  15626. Functions.prototype.bahtText=function (number) {
  15627. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BahtText", OfficeExtension.OperationType.Default, [number], false, true, null));
  15628. };
  15629. Functions.prototype.base=function (number, radix, minLength) {
  15630. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Base", OfficeExtension.OperationType.Default, [number, radix, minLength], false, true, null));
  15631. };
  15632. Functions.prototype.besselI=function (x, n) {
  15633. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselI", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15634. };
  15635. Functions.prototype.besselJ=function (x, n) {
  15636. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselJ", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15637. };
  15638. Functions.prototype.besselK=function (x, n) {
  15639. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselK", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15640. };
  15641. Functions.prototype.besselY=function (x, n) {
  15642. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselY", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15643. };
  15644. Functions.prototype.beta_Dist=function (x, alpha, beta, cumulative, A, B) {
  15645. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative, A, B], false, true, null));
  15646. };
  15647. Functions.prototype.beta_Inv=function (probability, alpha, beta, A, B) {
  15648. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta, A, B], false, true, null));
  15649. };
  15650. Functions.prototype.bin2Dec=function (number) {
  15651. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  15652. };
  15653. Functions.prototype.bin2Hex=function (number, places) {
  15654. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15655. };
  15656. Functions.prototype.bin2Oct=function (number, places) {
  15657. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15658. };
  15659. Functions.prototype.binom_Dist=function (numberS, trials, probabilityS, cumulative) {
  15660. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist", OfficeExtension.OperationType.Default, [numberS, trials, probabilityS, cumulative], false, true, null));
  15661. };
  15662. Functions.prototype.binom_Dist_Range=function (trials, probabilityS, numberS, numberS2) {
  15663. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist_Range", OfficeExtension.OperationType.Default, [trials, probabilityS, numberS, numberS2], false, true, null));
  15664. };
  15665. Functions.prototype.binom_Inv=function (trials, probabilityS, alpha) {
  15666. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Inv", OfficeExtension.OperationType.Default, [trials, probabilityS, alpha], false, true, null));
  15667. };
  15668. Functions.prototype.bitand=function (number1, number2) {
  15669. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitand", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15670. };
  15671. Functions.prototype.bitlshift=function (number, shiftAmount) {
  15672. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitlshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  15673. };
  15674. Functions.prototype.bitor=function (number1, number2) {
  15675. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15676. };
  15677. Functions.prototype.bitrshift=function (number, shiftAmount) {
  15678. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitrshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  15679. };
  15680. Functions.prototype.bitxor=function (number1, number2) {
  15681. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitxor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15682. };
  15683. Functions.prototype.ceiling_Math=function (number, significance, mode) {
  15684. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  15685. };
  15686. Functions.prototype.ceiling_Precise=function (number, significance) {
  15687. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  15688. };
  15689. Functions.prototype.char=function (number) {
  15690. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Char", OfficeExtension.OperationType.Default, [number], false, true, null));
  15691. };
  15692. Functions.prototype.chiSq_Dist=function (x, degFreedom, cumulative) {
  15693. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  15694. };
  15695. Functions.prototype.chiSq_Dist_RT=function (x, degFreedom) {
  15696. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  15697. };
  15698. Functions.prototype.chiSq_Inv=function (probability, degFreedom) {
  15699. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  15700. };
  15701. Functions.prototype.chiSq_Inv_RT=function (probability, degFreedom) {
  15702. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  15703. };
  15704. Functions.prototype.choose=function (indexNum) {
  15705. var values=[];
  15706. for (var _i=1; _i < arguments.length; _i++) {
  15707. values[_i - 1]=arguments[_i];
  15708. }
  15709. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Choose", OfficeExtension.OperationType.Default, [indexNum, values], false, true, null));
  15710. };
  15711. Functions.prototype.clean=function (text) {
  15712. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Clean", OfficeExtension.OperationType.Default, [text], false, true, null));
  15713. };
  15714. Functions.prototype.code=function (text) {
  15715. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Code", OfficeExtension.OperationType.Default, [text], false, true, null));
  15716. };
  15717. Functions.prototype.columns=function (array) {
  15718. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Columns", OfficeExtension.OperationType.Default, [array], false, true, null));
  15719. };
  15720. Functions.prototype.combin=function (number, numberChosen) {
  15721. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combin", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  15722. };
  15723. Functions.prototype.combina=function (number, numberChosen) {
  15724. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combina", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  15725. };
  15726. Functions.prototype.complex=function (realNum, iNum, suffix) {
  15727. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Complex", OfficeExtension.OperationType.Default, [realNum, iNum, suffix], false, true, null));
  15728. };
  15729. Functions.prototype.concatenate=function () {
  15730. var values=[];
  15731. for (var _i=0; _i < arguments.length; _i++) {
  15732. values[_i - 0]=arguments[_i];
  15733. }
  15734. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Concatenate", OfficeExtension.OperationType.Default, [values], false, true, null));
  15735. };
  15736. Functions.prototype.confidence_Norm=function (alpha, standardDev, size) {
  15737. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_Norm", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  15738. };
  15739. Functions.prototype.confidence_T=function (alpha, standardDev, size) {
  15740. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_T", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  15741. };
  15742. Functions.prototype.convert=function (number, fromUnit, toUnit) {
  15743. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Convert", OfficeExtension.OperationType.Default, [number, fromUnit, toUnit], false, true, null));
  15744. };
  15745. Functions.prototype.cos=function (number) {
  15746. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cos", OfficeExtension.OperationType.Default, [number], false, true, null));
  15747. };
  15748. Functions.prototype.cosh=function (number) {
  15749. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15750. };
  15751. Functions.prototype.cot=function (number) {
  15752. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cot", OfficeExtension.OperationType.Default, [number], false, true, null));
  15753. };
  15754. Functions.prototype.coth=function (number) {
  15755. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Coth", OfficeExtension.OperationType.Default, [number], false, true, null));
  15756. };
  15757. Functions.prototype.count=function () {
  15758. var values=[];
  15759. for (var _i=0; _i < arguments.length; _i++) {
  15760. values[_i - 0]=arguments[_i];
  15761. }
  15762. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Count", OfficeExtension.OperationType.Default, [values], false, true, null));
  15763. };
  15764. Functions.prototype.countA=function () {
  15765. var values=[];
  15766. for (var _i=0; _i < arguments.length; _i++) {
  15767. values[_i - 0]=arguments[_i];
  15768. }
  15769. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountA", OfficeExtension.OperationType.Default, [values], false, true, null));
  15770. };
  15771. Functions.prototype.countBlank=function (range) {
  15772. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountBlank", OfficeExtension.OperationType.Default, [range], false, true, null));
  15773. };
  15774. Functions.prototype.countIf=function (range, criteria) {
  15775. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIf", OfficeExtension.OperationType.Default, [range, criteria], false, true, null));
  15776. };
  15777. Functions.prototype.countIfs=function () {
  15778. var values=[];
  15779. for (var _i=0; _i < arguments.length; _i++) {
  15780. values[_i - 0]=arguments[_i];
  15781. }
  15782. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIfs", OfficeExtension.OperationType.Default, [values], false, true, null));
  15783. };
  15784. Functions.prototype.coupDayBs=function (settlement, maturity, frequency, basis) {
  15785. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDayBs", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15786. };
  15787. Functions.prototype.coupDays=function (settlement, maturity, frequency, basis) {
  15788. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDays", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15789. };
  15790. Functions.prototype.coupDaysNc=function (settlement, maturity, frequency, basis) {
  15791. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDaysNc", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15792. };
  15793. Functions.prototype.coupNcd=function (settlement, maturity, frequency, basis) {
  15794. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15795. };
  15796. Functions.prototype.coupNum=function (settlement, maturity, frequency, basis) {
  15797. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNum", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15798. };
  15799. Functions.prototype.coupPcd=function (settlement, maturity, frequency, basis) {
  15800. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupPcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15801. };
  15802. Functions.prototype.csc=function (number) {
  15803. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csc", OfficeExtension.OperationType.Default, [number], false, true, null));
  15804. };
  15805. Functions.prototype.csch=function (number) {
  15806. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csch", OfficeExtension.OperationType.Default, [number], false, true, null));
  15807. };
  15808. Functions.prototype.cumIPmt=function (rate, nper, pv, startPeriod, endPeriod, type) {
  15809. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumIPmt", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  15810. };
  15811. Functions.prototype.cumPrinc=function (rate, nper, pv, startPeriod, endPeriod, type) {
  15812. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumPrinc", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  15813. };
  15814. Functions.prototype.daverage=function (database, field, criteria) {
  15815. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DAverage", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15816. };
  15817. Functions.prototype.dcount=function (database, field, criteria) {
  15818. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCount", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15819. };
  15820. Functions.prototype.dcountA=function (database, field, criteria) {
  15821. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCountA", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15822. };
  15823. Functions.prototype.dget=function (database, field, criteria) {
  15824. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DGet", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15825. };
  15826. Functions.prototype.dmax=function (database, field, criteria) {
  15827. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMax", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15828. };
  15829. Functions.prototype.dmin=function (database, field, criteria) {
  15830. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMin", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15831. };
  15832. Functions.prototype.dproduct=function (database, field, criteria) {
  15833. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DProduct", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15834. };
  15835. Functions.prototype.dstDev=function (database, field, criteria) {
  15836. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDev", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15837. };
  15838. Functions.prototype.dstDevP=function (database, field, criteria) {
  15839. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDevP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15840. };
  15841. Functions.prototype.dsum=function (database, field, criteria) {
  15842. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DSum", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15843. };
  15844. Functions.prototype.dvar=function (database, field, criteria) {
  15845. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVar", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15846. };
  15847. Functions.prototype.dvarP=function (database, field, criteria) {
  15848. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVarP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  15849. };
  15850. Functions.prototype.date=function (year, month, day) {
  15851. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Date", OfficeExtension.OperationType.Default, [year, month, day], false, true, null));
  15852. };
  15853. Functions.prototype.datevalue=function (dateText) {
  15854. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Datevalue", OfficeExtension.OperationType.Default, [dateText], false, true, null));
  15855. };
  15856. Functions.prototype.day=function (serialNumber) {
  15857. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Day", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  15858. };
  15859. Functions.prototype.days=function (endDate, startDate) {
  15860. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days", OfficeExtension.OperationType.Default, [endDate, startDate], false, true, null));
  15861. };
  15862. Functions.prototype.days360=function (startDate, endDate, method) {
  15863. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days360", OfficeExtension.OperationType.Default, [startDate, endDate, method], false, true, null));
  15864. };
  15865. Functions.prototype.db=function (cost, salvage, life, period, month) {
  15866. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Db", OfficeExtension.OperationType.Default, [cost, salvage, life, period, month], false, true, null));
  15867. };
  15868. Functions.prototype.dbcs=function (text) {
  15869. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dbcs", OfficeExtension.OperationType.Default, [text], false, true, null));
  15870. };
  15871. Functions.prototype.ddb=function (cost, salvage, life, period, factor) {
  15872. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ddb", OfficeExtension.OperationType.Default, [cost, salvage, life, period, factor], false, true, null));
  15873. };
  15874. Functions.prototype.dec2Bin=function (number, places) {
  15875. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15876. };
  15877. Functions.prototype.dec2Hex=function (number, places) {
  15878. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15879. };
  15880. Functions.prototype.dec2Oct=function (number, places) {
  15881. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15882. };
  15883. Functions.prototype.decimal=function (number, radix) {
  15884. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Decimal", OfficeExtension.OperationType.Default, [number, radix], false, true, null));
  15885. };
  15886. Functions.prototype.degrees=function (angle) {
  15887. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Degrees", OfficeExtension.OperationType.Default, [angle], false, true, null));
  15888. };
  15889. Functions.prototype.delta=function (number1, number2) {
  15890. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Delta", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15891. };
  15892. Functions.prototype.devSq=function () {
  15893. var values=[];
  15894. for (var _i=0; _i < arguments.length; _i++) {
  15895. values[_i - 0]=arguments[_i];
  15896. }
  15897. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DevSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  15898. };
  15899. Functions.prototype.disc=function (settlement, maturity, pr, redemption, basis) {
  15900. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Disc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  15901. };
  15902. Functions.prototype.dollar=function (number, decimals) {
  15903. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  15904. };
  15905. Functions.prototype.dollarDe=function (fractionalDollar, fraction) {
  15906. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarDe", OfficeExtension.OperationType.Default, [fractionalDollar, fraction], false, true, null));
  15907. };
  15908. Functions.prototype.dollarFr=function (decimalDollar, fraction) {
  15909. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarFr", OfficeExtension.OperationType.Default, [decimalDollar, fraction], false, true, null));
  15910. };
  15911. Functions.prototype.duration=function (settlement, maturity, coupon, yld, frequency, basis) {
  15912. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Duration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  15913. };
  15914. Functions.prototype.ecma_Ceiling=function (number, significance) {
  15915. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ECMA_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  15916. };
  15917. Functions.prototype.edate=function (startDate, months) {
  15918. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EDate", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  15919. };
  15920. Functions.prototype.effect=function (nominalRate, npery) {
  15921. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Effect", OfficeExtension.OperationType.Default, [nominalRate, npery], false, true, null));
  15922. };
  15923. Functions.prototype.eoMonth=function (startDate, months) {
  15924. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EoMonth", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  15925. };
  15926. Functions.prototype.erf=function (lowerLimit, upperLimit) {
  15927. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf", OfficeExtension.OperationType.Default, [lowerLimit, upperLimit], false, true, null));
  15928. };
  15929. Functions.prototype.erfC=function (x) {
  15930. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC", OfficeExtension.OperationType.Default, [x], false, true, null));
  15931. };
  15932. Functions.prototype.erfC_Precise=function (X) {
  15933. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  15934. };
  15935. Functions.prototype.erf_Precise=function (X) {
  15936. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  15937. };
  15938. Functions.prototype.error_Type=function (errorVal) {
  15939. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Error_Type", OfficeExtension.OperationType.Default, [errorVal], false, true, null));
  15940. };
  15941. Functions.prototype.even=function (number) {
  15942. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Even", OfficeExtension.OperationType.Default, [number], false, true, null));
  15943. };
  15944. Functions.prototype.exact=function (text1, text2) {
  15945. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exact", OfficeExtension.OperationType.Default, [text1, text2], false, true, null));
  15946. };
  15947. Functions.prototype.exp=function (number) {
  15948. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exp", OfficeExtension.OperationType.Default, [number], false, true, null));
  15949. };
  15950. Functions.prototype.expon_Dist=function (x, lambda, cumulative) {
  15951. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Expon_Dist", OfficeExtension.OperationType.Default, [x, lambda, cumulative], false, true, null));
  15952. };
  15953. Functions.prototype.fvschedule=function (principal, schedule) {
  15954. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FVSchedule", OfficeExtension.OperationType.Default, [principal, schedule], false, true, null));
  15955. };
  15956. Functions.prototype.f_Dist=function (x, degFreedom1, degFreedom2, cumulative) {
  15957. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2, cumulative], false, true, null));
  15958. };
  15959. Functions.prototype.f_Dist_RT=function (x, degFreedom1, degFreedom2) {
  15960. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2], false, true, null));
  15961. };
  15962. Functions.prototype.f_Inv=function (probability, degFreedom1, degFreedom2) {
  15963. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  15964. };
  15965. Functions.prototype.f_Inv_RT=function (probability, degFreedom1, degFreedom2) {
  15966. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  15967. };
  15968. Functions.prototype.fact=function (number) {
  15969. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fact", OfficeExtension.OperationType.Default, [number], false, true, null));
  15970. };
  15971. Functions.prototype.factDouble=function (number) {
  15972. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FactDouble", OfficeExtension.OperationType.Default, [number], false, true, null));
  15973. };
  15974. Functions.prototype.false=function () {
  15975. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "False", OfficeExtension.OperationType.Default, [], false, true, null));
  15976. };
  15977. Functions.prototype.find=function (findText, withinText, startNum) {
  15978. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Find", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  15979. };
  15980. Functions.prototype.findB=function (findText, withinText, startNum) {
  15981. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FindB", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  15982. };
  15983. Functions.prototype.fisher=function (x) {
  15984. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fisher", OfficeExtension.OperationType.Default, [x], false, true, null));
  15985. };
  15986. Functions.prototype.fisherInv=function (y) {
  15987. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FisherInv", OfficeExtension.OperationType.Default, [y], false, true, null));
  15988. };
  15989. Functions.prototype.fixed=function (number, decimals, noCommas) {
  15990. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fixed", OfficeExtension.OperationType.Default, [number, decimals, noCommas], false, true, null));
  15991. };
  15992. Functions.prototype.floor_Math=function (number, significance, mode) {
  15993. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  15994. };
  15995. Functions.prototype.floor_Precise=function (number, significance) {
  15996. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  15997. };
  15998. Functions.prototype.fv=function (rate, nper, pmt, pv, type) {
  15999. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fv", OfficeExtension.OperationType.Default, [rate, nper, pmt, pv, type], false, true, null));
  16000. };
  16001. Functions.prototype.gamma=function (x) {
  16002. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma", OfficeExtension.OperationType.Default, [x], false, true, null));
  16003. };
  16004. Functions.prototype.gammaLn=function (x) {
  16005. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn", OfficeExtension.OperationType.Default, [x], false, true, null));
  16006. };
  16007. Functions.prototype.gammaLn_Precise=function (x) {
  16008. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn_Precise", OfficeExtension.OperationType.Default, [x], false, true, null));
  16009. };
  16010. Functions.prototype.gamma_Dist=function (x, alpha, beta, cumulative) {
  16011. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  16012. };
  16013. Functions.prototype.gamma_Inv=function (probability, alpha, beta) {
  16014. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta], false, true, null));
  16015. };
  16016. Functions.prototype.gauss=function (x) {
  16017. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gauss", OfficeExtension.OperationType.Default, [x], false, true, null));
  16018. };
  16019. Functions.prototype.gcd=function () {
  16020. var values=[];
  16021. for (var _i=0; _i < arguments.length; _i++) {
  16022. values[_i - 0]=arguments[_i];
  16023. }
  16024. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gcd", OfficeExtension.OperationType.Default, [values], false, true, null));
  16025. };
  16026. Functions.prototype.geStep=function (number, step) {
  16027. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeStep", OfficeExtension.OperationType.Default, [number, step], false, true, null));
  16028. };
  16029. Functions.prototype.geoMean=function () {
  16030. var values=[];
  16031. for (var _i=0; _i < arguments.length; _i++) {
  16032. values[_i - 0]=arguments[_i];
  16033. }
  16034. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeoMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  16035. };
  16036. Functions.prototype.hlookup=function (lookupValue, tableArray, rowIndexNum, rangeLookup) {
  16037. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, rowIndexNum, rangeLookup], false, true, null));
  16038. };
  16039. Functions.prototype.harMean=function () {
  16040. var values=[];
  16041. for (var _i=0; _i < arguments.length; _i++) {
  16042. values[_i - 0]=arguments[_i];
  16043. }
  16044. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HarMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  16045. };
  16046. Functions.prototype.hex2Bin=function (number, places) {
  16047. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16048. };
  16049. Functions.prototype.hex2Dec=function (number) {
  16050. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16051. };
  16052. Functions.prototype.hex2Oct=function (number, places) {
  16053. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16054. };
  16055. Functions.prototype.hour=function (serialNumber) {
  16056. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hour", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16057. };
  16058. Functions.prototype.hypGeom_Dist=function (sampleS, numberSample, populationS, numberPop, cumulative) {
  16059. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HypGeom_Dist", OfficeExtension.OperationType.Default, [sampleS, numberSample, populationS, numberPop, cumulative], false, true, null));
  16060. };
  16061. Functions.prototype.hyperlink=function (linkLocation, friendlyName) {
  16062. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hyperlink", OfficeExtension.OperationType.Default, [linkLocation, friendlyName], false, true, null));
  16063. };
  16064. Functions.prototype.iso_Ceiling=function (number, significance) {
  16065. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ISO_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16066. };
  16067. Functions.prototype.if=function (logicalTest, valueIfTrue, valueIfFalse) {
  16068. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "If", OfficeExtension.OperationType.Default, [logicalTest, valueIfTrue, valueIfFalse], false, true, null));
  16069. };
  16070. Functions.prototype.imAbs=function (inumber) {
  16071. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImAbs", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16072. };
  16073. Functions.prototype.imArgument=function (inumber) {
  16074. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImArgument", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16075. };
  16076. Functions.prototype.imConjugate=function (inumber) {
  16077. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImConjugate", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16078. };
  16079. Functions.prototype.imCos=function (inumber) {
  16080. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCos", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16081. };
  16082. Functions.prototype.imCosh=function (inumber) {
  16083. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCosh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16084. };
  16085. Functions.prototype.imCot=function (inumber) {
  16086. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCot", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16087. };
  16088. Functions.prototype.imCsc=function (inumber) {
  16089. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsc", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16090. };
  16091. Functions.prototype.imCsch=function (inumber) {
  16092. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsch", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16093. };
  16094. Functions.prototype.imDiv=function (inumber1, inumber2) {
  16095. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImDiv", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  16096. };
  16097. Functions.prototype.imExp=function (inumber) {
  16098. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImExp", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16099. };
  16100. Functions.prototype.imLn=function (inumber) {
  16101. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLn", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16102. };
  16103. Functions.prototype.imLog10=function (inumber) {
  16104. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog10", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16105. };
  16106. Functions.prototype.imLog2=function (inumber) {
  16107. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog2", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16108. };
  16109. Functions.prototype.imPower=function (inumber, number) {
  16110. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImPower", OfficeExtension.OperationType.Default, [inumber, number], false, true, null));
  16111. };
  16112. Functions.prototype.imProduct=function () {
  16113. var values=[];
  16114. for (var _i=0; _i < arguments.length; _i++) {
  16115. values[_i - 0]=arguments[_i];
  16116. }
  16117. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImProduct", OfficeExtension.OperationType.Default, [values], false, true, null));
  16118. };
  16119. Functions.prototype.imReal=function (inumber) {
  16120. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImReal", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16121. };
  16122. Functions.prototype.imSec=function (inumber) {
  16123. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSec", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16124. };
  16125. Functions.prototype.imSech=function (inumber) {
  16126. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSech", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16127. };
  16128. Functions.prototype.imSin=function (inumber) {
  16129. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSin", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16130. };
  16131. Functions.prototype.imSinh=function (inumber) {
  16132. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSinh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16133. };
  16134. Functions.prototype.imSqrt=function (inumber) {
  16135. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSqrt", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16136. };
  16137. Functions.prototype.imSub=function (inumber1, inumber2) {
  16138. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSub", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  16139. };
  16140. Functions.prototype.imSum=function () {
  16141. var values=[];
  16142. for (var _i=0; _i < arguments.length; _i++) {
  16143. values[_i - 0]=arguments[_i];
  16144. }
  16145. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSum", OfficeExtension.OperationType.Default, [values], false, true, null));
  16146. };
  16147. Functions.prototype.imTan=function (inumber) {
  16148. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImTan", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16149. };
  16150. Functions.prototype.imaginary=function (inumber) {
  16151. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Imaginary", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16152. };
  16153. Functions.prototype.int=function (number) {
  16154. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Int", OfficeExtension.OperationType.Default, [number], false, true, null));
  16155. };
  16156. Functions.prototype.intRate=function (settlement, maturity, investment, redemption, basis) {
  16157. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IntRate", OfficeExtension.OperationType.Default, [settlement, maturity, investment, redemption, basis], false, true, null));
  16158. };
  16159. Functions.prototype.ipmt=function (rate, per, nper, pv, fv, type) {
  16160. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ipmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  16161. };
  16162. Functions.prototype.irr=function (values, guess) {
  16163. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Irr", OfficeExtension.OperationType.Default, [values, guess], false, true, null));
  16164. };
  16165. Functions.prototype.isErr=function (value) {
  16166. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsErr", OfficeExtension.OperationType.Default, [value], false, true, null));
  16167. };
  16168. Functions.prototype.isError=function (value) {
  16169. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsError", OfficeExtension.OperationType.Default, [value], false, true, null));
  16170. };
  16171. Functions.prototype.isEven=function (number) {
  16172. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsEven", OfficeExtension.OperationType.Default, [number], false, true, null));
  16173. };
  16174. Functions.prototype.isFormula=function (reference) {
  16175. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsFormula", OfficeExtension.OperationType.Default, [reference], false, true, null));
  16176. };
  16177. Functions.prototype.isLogical=function (value) {
  16178. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsLogical", OfficeExtension.OperationType.Default, [value], false, true, null));
  16179. };
  16180. Functions.prototype.isNA=function (value) {
  16181. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNA", OfficeExtension.OperationType.Default, [value], false, true, null));
  16182. };
  16183. Functions.prototype.isNonText=function (value) {
  16184. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNonText", OfficeExtension.OperationType.Default, [value], false, true, null));
  16185. };
  16186. Functions.prototype.isNumber=function (value) {
  16187. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNumber", OfficeExtension.OperationType.Default, [value], false, true, null));
  16188. };
  16189. Functions.prototype.isOdd=function (number) {
  16190. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsOdd", OfficeExtension.OperationType.Default, [number], false, true, null));
  16191. };
  16192. Functions.prototype.isText=function (value) {
  16193. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsText", OfficeExtension.OperationType.Default, [value], false, true, null));
  16194. };
  16195. Functions.prototype.isoWeekNum=function (date) {
  16196. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsoWeekNum", OfficeExtension.OperationType.Default, [date], false, true, null));
  16197. };
  16198. Functions.prototype.ispmt=function (rate, per, nper, pv) {
  16199. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ispmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv], false, true, null));
  16200. };
  16201. Functions.prototype.isref=function (value) {
  16202. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Isref", OfficeExtension.OperationType.Default, [value], false, true, null));
  16203. };
  16204. Functions.prototype.kurt=function () {
  16205. var values=[];
  16206. for (var _i=0; _i < arguments.length; _i++) {
  16207. values[_i - 0]=arguments[_i];
  16208. }
  16209. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Kurt", OfficeExtension.OperationType.Default, [values], false, true, null));
  16210. };
  16211. Functions.prototype.large=function (array, k) {
  16212. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Large", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16213. };
  16214. Functions.prototype.lcm=function () {
  16215. var values=[];
  16216. for (var _i=0; _i < arguments.length; _i++) {
  16217. values[_i - 0]=arguments[_i];
  16218. }
  16219. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lcm", OfficeExtension.OperationType.Default, [values], false, true, null));
  16220. };
  16221. Functions.prototype.left=function (text, numChars) {
  16222. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Left", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  16223. };
  16224. Functions.prototype.leftb=function (text, numBytes) {
  16225. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Leftb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  16226. };
  16227. Functions.prototype.len=function (text) {
  16228. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Len", OfficeExtension.OperationType.Default, [text], false, true, null));
  16229. };
  16230. Functions.prototype.lenb=function (text) {
  16231. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lenb", OfficeExtension.OperationType.Default, [text], false, true, null));
  16232. };
  16233. Functions.prototype.ln=function (number) {
  16234. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ln", OfficeExtension.OperationType.Default, [number], false, true, null));
  16235. };
  16236. Functions.prototype.log=function (number, base) {
  16237. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log", OfficeExtension.OperationType.Default, [number, base], false, true, null));
  16238. };
  16239. Functions.prototype.log10=function (number) {
  16240. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log10", OfficeExtension.OperationType.Default, [number], false, true, null));
  16241. };
  16242. Functions.prototype.logNorm_Dist=function (x, mean, standardDev, cumulative) {
  16243. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  16244. };
  16245. Functions.prototype.logNorm_Inv=function (probability, mean, standardDev) {
  16246. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  16247. };
  16248. Functions.prototype.lookup=function (lookupValue, lookupVector, resultVector) {
  16249. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lookup", OfficeExtension.OperationType.Default, [lookupValue, lookupVector, resultVector], false, true, null));
  16250. };
  16251. Functions.prototype.lower=function (text) {
  16252. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lower", OfficeExtension.OperationType.Default, [text], false, true, null));
  16253. };
  16254. Functions.prototype.mduration=function (settlement, maturity, coupon, yld, frequency, basis) {
  16255. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MDuration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  16256. };
  16257. Functions.prototype.mirr=function (values, financeRate, reinvestRate) {
  16258. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MIrr", OfficeExtension.OperationType.Default, [values, financeRate, reinvestRate], false, true, null));
  16259. };
  16260. Functions.prototype.mround=function (number, multiple) {
  16261. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MRound", OfficeExtension.OperationType.Default, [number, multiple], false, true, null));
  16262. };
  16263. Functions.prototype.match=function (lookupValue, lookupArray, matchType) {
  16264. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Match", OfficeExtension.OperationType.Default, [lookupValue, lookupArray, matchType], false, true, null));
  16265. };
  16266. Functions.prototype.max=function () {
  16267. var values=[];
  16268. for (var _i=0; _i < arguments.length; _i++) {
  16269. values[_i - 0]=arguments[_i];
  16270. }
  16271. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Max", OfficeExtension.OperationType.Default, [values], false, true, null));
  16272. };
  16273. Functions.prototype.maxA=function () {
  16274. var values=[];
  16275. for (var _i=0; _i < arguments.length; _i++) {
  16276. values[_i - 0]=arguments[_i];
  16277. }
  16278. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MaxA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16279. };
  16280. Functions.prototype.median=function () {
  16281. var values=[];
  16282. for (var _i=0; _i < arguments.length; _i++) {
  16283. values[_i - 0]=arguments[_i];
  16284. }
  16285. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Median", OfficeExtension.OperationType.Default, [values], false, true, null));
  16286. };
  16287. Functions.prototype.mid=function (text, startNum, numChars) {
  16288. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mid", OfficeExtension.OperationType.Default, [text, startNum, numChars], false, true, null));
  16289. };
  16290. Functions.prototype.midb=function (text, startNum, numBytes) {
  16291. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Midb", OfficeExtension.OperationType.Default, [text, startNum, numBytes], false, true, null));
  16292. };
  16293. Functions.prototype.min=function () {
  16294. var values=[];
  16295. for (var _i=0; _i < arguments.length; _i++) {
  16296. values[_i - 0]=arguments[_i];
  16297. }
  16298. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Min", OfficeExtension.OperationType.Default, [values], false, true, null));
  16299. };
  16300. Functions.prototype.minA=function () {
  16301. var values=[];
  16302. for (var _i=0; _i < arguments.length; _i++) {
  16303. values[_i - 0]=arguments[_i];
  16304. }
  16305. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MinA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16306. };
  16307. Functions.prototype.minute=function (serialNumber) {
  16308. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Minute", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16309. };
  16310. Functions.prototype.mod=function (number, divisor) {
  16311. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mod", OfficeExtension.OperationType.Default, [number, divisor], false, true, null));
  16312. };
  16313. Functions.prototype.month=function (serialNumber) {
  16314. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Month", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16315. };
  16316. Functions.prototype.multiNomial=function () {
  16317. var values=[];
  16318. for (var _i=0; _i < arguments.length; _i++) {
  16319. values[_i - 0]=arguments[_i];
  16320. }
  16321. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MultiNomial", OfficeExtension.OperationType.Default, [values], false, true, null));
  16322. };
  16323. Functions.prototype.n=function (value) {
  16324. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "N", OfficeExtension.OperationType.Default, [value], false, true, null));
  16325. };
  16326. Functions.prototype.nper=function (rate, pmt, pv, fv, type) {
  16327. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NPer", OfficeExtension.OperationType.Default, [rate, pmt, pv, fv, type], false, true, null));
  16328. };
  16329. Functions.prototype.na=function () {
  16330. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Na", OfficeExtension.OperationType.Default, [], false, true, null));
  16331. };
  16332. Functions.prototype.negBinom_Dist=function (numberF, numberS, probabilityS, cumulative) {
  16333. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NegBinom_Dist", OfficeExtension.OperationType.Default, [numberF, numberS, probabilityS, cumulative], false, true, null));
  16334. };
  16335. Functions.prototype.networkDays=function (startDate, endDate, holidays) {
  16336. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays", OfficeExtension.OperationType.Default, [startDate, endDate, holidays], false, true, null));
  16337. };
  16338. Functions.prototype.networkDays_Intl=function (startDate, endDate, weekend, holidays) {
  16339. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays_Intl", OfficeExtension.OperationType.Default, [startDate, endDate, weekend, holidays], false, true, null));
  16340. };
  16341. Functions.prototype.nominal=function (effectRate, npery) {
  16342. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Nominal", OfficeExtension.OperationType.Default, [effectRate, npery], false, true, null));
  16343. };
  16344. Functions.prototype.norm_Dist=function (x, mean, standardDev, cumulative) {
  16345. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  16346. };
  16347. Functions.prototype.norm_Inv=function (probability, mean, standardDev) {
  16348. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  16349. };
  16350. Functions.prototype.norm_S_Dist=function (z, cumulative) {
  16351. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Dist", OfficeExtension.OperationType.Default, [z, cumulative], false, true, null));
  16352. };
  16353. Functions.prototype.norm_S_Inv=function (probability) {
  16354. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Inv", OfficeExtension.OperationType.Default, [probability], false, true, null));
  16355. };
  16356. Functions.prototype.not=function (logical) {
  16357. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Not", OfficeExtension.OperationType.Default, [logical], false, true, null));
  16358. };
  16359. Functions.prototype.now=function () {
  16360. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Now", OfficeExtension.OperationType.Default, [], false, true, null));
  16361. };
  16362. Functions.prototype.npv=function (rate) {
  16363. var values=[];
  16364. for (var _i=1; _i < arguments.length; _i++) {
  16365. values[_i - 1]=arguments[_i];
  16366. }
  16367. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Npv", OfficeExtension.OperationType.Default, [rate, values], false, true, null));
  16368. };
  16369. Functions.prototype.numberValue=function (text, decimalSeparator, groupSeparator) {
  16370. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NumberValue", OfficeExtension.OperationType.Default, [text, decimalSeparator, groupSeparator], false, true, null));
  16371. };
  16372. Functions.prototype.oct2Bin=function (number, places) {
  16373. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16374. };
  16375. Functions.prototype.oct2Dec=function (number) {
  16376. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16377. };
  16378. Functions.prototype.oct2Hex=function (number, places) {
  16379. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16380. };
  16381. Functions.prototype.odd=function (number) {
  16382. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Odd", OfficeExtension.OperationType.Default, [number], false, true, null));
  16383. };
  16384. Functions.prototype.oddFPrice=function (settlement, maturity, issue, firstCoupon, rate, yld, redemption, frequency, basis) {
  16385. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddFPrice", OfficeExtension.OperationType.Default, [settlement, maturity, issue, firstCoupon, rate, yld, redemption, frequency, basis], false, true, null));
  16386. };
  16387. Functions.prototype.oddFYield=function (settlement, maturity, issue, firstCoupon, rate, pr, redemption, frequency, basis) {
  16388. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddFYield", OfficeExtension.OperationType.Default, [settlement, maturity, issue, firstCoupon, rate, pr, redemption, frequency, basis], false, true, null));
  16389. };
  16390. Functions.prototype.oddLPrice=function (settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis) {
  16391. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLPrice", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis], false, true, null));
  16392. };
  16393. Functions.prototype.oddLYield=function (settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis) {
  16394. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLYield", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis], false, true, null));
  16395. };
  16396. Functions.prototype.or=function () {
  16397. var values=[];
  16398. for (var _i=0; _i < arguments.length; _i++) {
  16399. values[_i - 0]=arguments[_i];
  16400. }
  16401. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Or", OfficeExtension.OperationType.Default, [values], false, true, null));
  16402. };
  16403. Functions.prototype.pduration=function (rate, pv, fv) {
  16404. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PDuration", OfficeExtension.OperationType.Default, [rate, pv, fv], false, true, null));
  16405. };
  16406. Functions.prototype.percentRank_Exc=function (array, x, significance) {
  16407. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Exc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  16408. };
  16409. Functions.prototype.percentRank_Inc=function (array, x, significance) {
  16410. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Inc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  16411. };
  16412. Functions.prototype.percentile_Exc=function (array, k) {
  16413. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Exc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16414. };
  16415. Functions.prototype.percentile_Inc=function (array, k) {
  16416. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Inc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16417. };
  16418. Functions.prototype.permut=function (number, numberChosen) {
  16419. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permut", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  16420. };
  16421. Functions.prototype.permutationa=function (number, numberChosen) {
  16422. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permutationa", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  16423. };
  16424. Functions.prototype.phi=function (x) {
  16425. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Phi", OfficeExtension.OperationType.Default, [x], false, true, null));
  16426. };
  16427. Functions.prototype.pi=function () {
  16428. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pi", OfficeExtension.OperationType.Default, [], false, true, null));
  16429. };
  16430. Functions.prototype.pmt=function (rate, nper, pv, fv, type) {
  16431. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pmt", OfficeExtension.OperationType.Default, [rate, nper, pv, fv, type], false, true, null));
  16432. };
  16433. Functions.prototype.poisson_Dist=function (x, mean, cumulative) {
  16434. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Poisson_Dist", OfficeExtension.OperationType.Default, [x, mean, cumulative], false, true, null));
  16435. };
  16436. Functions.prototype.power=function (number, power) {
  16437. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Power", OfficeExtension.OperationType.Default, [number, power], false, true, null));
  16438. };
  16439. Functions.prototype.ppmt=function (rate, per, nper, pv, fv, type) {
  16440. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ppmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  16441. };
  16442. Functions.prototype.price=function (settlement, maturity, rate, yld, redemption, frequency, basis) {
  16443. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Price", OfficeExtension.OperationType.Default, [settlement, maturity, rate, yld, redemption, frequency, basis], false, true, null));
  16444. };
  16445. Functions.prototype.priceDisc=function (settlement, maturity, discount, redemption, basis) {
  16446. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceDisc", OfficeExtension.OperationType.Default, [settlement, maturity, discount, redemption, basis], false, true, null));
  16447. };
  16448. Functions.prototype.priceMat=function (settlement, maturity, issue, rate, yld, basis) {
  16449. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, yld, basis], false, true, null));
  16450. };
  16451. Functions.prototype.product=function () {
  16452. var values=[];
  16453. for (var _i=0; _i < arguments.length; _i++) {
  16454. values[_i - 0]=arguments[_i];
  16455. }
  16456. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Product", OfficeExtension.OperationType.Default, [values], false, true, null));
  16457. };
  16458. Functions.prototype.proper=function (text) {
  16459. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Proper", OfficeExtension.OperationType.Default, [text], false, true, null));
  16460. };
  16461. Functions.prototype.pv=function (rate, nper, pmt, fv, type) {
  16462. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pv", OfficeExtension.OperationType.Default, [rate, nper, pmt, fv, type], false, true, null));
  16463. };
  16464. Functions.prototype.quartile_Exc=function (array, quart) {
  16465. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Exc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  16466. };
  16467. Functions.prototype.quartile_Inc=function (array, quart) {
  16468. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Inc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  16469. };
  16470. Functions.prototype.quotient=function (numerator, denominator) {
  16471. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quotient", OfficeExtension.OperationType.Default, [numerator, denominator], false, true, null));
  16472. };
  16473. Functions.prototype.radians=function (angle) {
  16474. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Radians", OfficeExtension.OperationType.Default, [angle], false, true, null));
  16475. };
  16476. Functions.prototype.rand=function () {
  16477. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rand", OfficeExtension.OperationType.Default, [], false, true, null));
  16478. };
  16479. Functions.prototype.randBetween=function (bottom, top) {
  16480. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RandBetween", OfficeExtension.OperationType.Default, [bottom, top], false, true, null));
  16481. };
  16482. Functions.prototype.rank_Avg=function (number, ref, order) {
  16483. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Avg", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  16484. };
  16485. Functions.prototype.rank_Eq=function (number, ref, order) {
  16486. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Eq", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  16487. };
  16488. Functions.prototype.rate=function (nper, pmt, pv, fv, type, guess) {
  16489. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rate", OfficeExtension.OperationType.Default, [nper, pmt, pv, fv, type, guess], false, true, null));
  16490. };
  16491. Functions.prototype.received=function (settlement, maturity, investment, discount, basis) {
  16492. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Received", OfficeExtension.OperationType.Default, [settlement, maturity, investment, discount, basis], false, true, null));
  16493. };
  16494. Functions.prototype.replace=function (oldText, startNum, numChars, newText) {
  16495. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Replace", OfficeExtension.OperationType.Default, [oldText, startNum, numChars, newText], false, true, null));
  16496. };
  16497. Functions.prototype.replaceB=function (oldText, startNum, numBytes, newText) {
  16498. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ReplaceB", OfficeExtension.OperationType.Default, [oldText, startNum, numBytes, newText], false, true, null));
  16499. };
  16500. Functions.prototype.rept=function (text, numberTimes) {
  16501. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rept", OfficeExtension.OperationType.Default, [text, numberTimes], false, true, null));
  16502. };
  16503. Functions.prototype.right=function (text, numChars) {
  16504. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Right", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  16505. };
  16506. Functions.prototype.rightb=function (text, numBytes) {
  16507. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rightb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  16508. };
  16509. Functions.prototype.roman=function (number, form) {
  16510. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Roman", OfficeExtension.OperationType.Default, [number, form], false, true, null));
  16511. };
  16512. Functions.prototype.round=function (number, numDigits) {
  16513. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Round", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16514. };
  16515. Functions.prototype.roundDown=function (number, numDigits) {
  16516. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundDown", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16517. };
  16518. Functions.prototype.roundUp=function (number, numDigits) {
  16519. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundUp", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16520. };
  16521. Functions.prototype.rows=function (array) {
  16522. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rows", OfficeExtension.OperationType.Default, [array], false, true, null));
  16523. };
  16524. Functions.prototype.rri=function (nper, pv, fv) {
  16525. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rri", OfficeExtension.OperationType.Default, [nper, pv, fv], false, true, null));
  16526. };
  16527. Functions.prototype.sec=function (number) {
  16528. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16529. };
  16530. Functions.prototype.sech=function (number) {
  16531. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sech", OfficeExtension.OperationType.Default, [number], false, true, null));
  16532. };
  16533. Functions.prototype.second=function (serialNumber) {
  16534. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Second", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16535. };
  16536. Functions.prototype.seriesSum=function (x, n, m, coefficients) {
  16537. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SeriesSum", OfficeExtension.OperationType.Default, [x, n, m, coefficients], false, true, null));
  16538. };
  16539. Functions.prototype.sheet=function (value) {
  16540. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheet", OfficeExtension.OperationType.Default, [value], false, true, null));
  16541. };
  16542. Functions.prototype.sheets=function (reference) {
  16543. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheets", OfficeExtension.OperationType.Default, [reference], false, true, null));
  16544. };
  16545. Functions.prototype.sign=function (number) {
  16546. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sign", OfficeExtension.OperationType.Default, [number], false, true, null));
  16547. };
  16548. Functions.prototype.sin=function (number) {
  16549. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sin", OfficeExtension.OperationType.Default, [number], false, true, null));
  16550. };
  16551. Functions.prototype.sinh=function (number) {
  16552. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  16553. };
  16554. Functions.prototype.skew=function () {
  16555. var values=[];
  16556. for (var _i=0; _i < arguments.length; _i++) {
  16557. values[_i - 0]=arguments[_i];
  16558. }
  16559. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew", OfficeExtension.OperationType.Default, [values], false, true, null));
  16560. };
  16561. Functions.prototype.skew_p=function () {
  16562. var values=[];
  16563. for (var _i=0; _i < arguments.length; _i++) {
  16564. values[_i - 0]=arguments[_i];
  16565. }
  16566. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew_p", OfficeExtension.OperationType.Default, [values], false, true, null));
  16567. };
  16568. Functions.prototype.sln=function (cost, salvage, life) {
  16569. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sln", OfficeExtension.OperationType.Default, [cost, salvage, life], false, true, null));
  16570. };
  16571. Functions.prototype.small=function (array, k) {
  16572. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Small", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16573. };
  16574. Functions.prototype.sqrt=function (number) {
  16575. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sqrt", OfficeExtension.OperationType.Default, [number], false, true, null));
  16576. };
  16577. Functions.prototype.sqrtPi=function (number) {
  16578. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SqrtPi", OfficeExtension.OperationType.Default, [number], false, true, null));
  16579. };
  16580. Functions.prototype.stDevA=function () {
  16581. var values=[];
  16582. for (var _i=0; _i < arguments.length; _i++) {
  16583. values[_i - 0]=arguments[_i];
  16584. }
  16585. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16586. };
  16587. Functions.prototype.stDevPA=function () {
  16588. var values=[];
  16589. for (var _i=0; _i < arguments.length; _i++) {
  16590. values[_i - 0]=arguments[_i];
  16591. }
  16592. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16593. };
  16594. Functions.prototype.stDev_P=function () {
  16595. var values=[];
  16596. for (var _i=0; _i < arguments.length; _i++) {
  16597. values[_i - 0]=arguments[_i];
  16598. }
  16599. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  16600. };
  16601. Functions.prototype.stDev_S=function () {
  16602. var values=[];
  16603. for (var _i=0; _i < arguments.length; _i++) {
  16604. values[_i - 0]=arguments[_i];
  16605. }
  16606. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  16607. };
  16608. Functions.prototype.standardize=function (x, mean, standardDev) {
  16609. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Standardize", OfficeExtension.OperationType.Default, [x, mean, standardDev], false, true, null));
  16610. };
  16611. Functions.prototype.substitute=function (text, oldText, newText, instanceNum) {
  16612. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Substitute", OfficeExtension.OperationType.Default, [text, oldText, newText, instanceNum], false, true, null));
  16613. };
  16614. Functions.prototype.subtotal=function (functionNum) {
  16615. var values=[];
  16616. for (var _i=1; _i < arguments.length; _i++) {
  16617. values[_i - 1]=arguments[_i];
  16618. }
  16619. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Subtotal", OfficeExtension.OperationType.Default, [functionNum, values], false, true, null));
  16620. };
  16621. Functions.prototype.sum=function () {
  16622. var values=[];
  16623. for (var _i=0; _i < arguments.length; _i++) {
  16624. values[_i - 0]=arguments[_i];
  16625. }
  16626. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sum", OfficeExtension.OperationType.Default, [values], false, true, null));
  16627. };
  16628. Functions.prototype.sumIf=function (range, criteria, sumRange) {
  16629. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIf", OfficeExtension.OperationType.Default, [range, criteria, sumRange], false, true, null));
  16630. };
  16631. Functions.prototype.sumIfs=function (sumRange) {
  16632. var values=[];
  16633. for (var _i=1; _i < arguments.length; _i++) {
  16634. values[_i - 1]=arguments[_i];
  16635. }
  16636. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIfs", OfficeExtension.OperationType.Default, [sumRange, values], false, true, null));
  16637. };
  16638. Functions.prototype.sumSq=function () {
  16639. var values=[];
  16640. for (var _i=0; _i < arguments.length; _i++) {
  16641. values[_i - 0]=arguments[_i];
  16642. }
  16643. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  16644. };
  16645. Functions.prototype.syd=function (cost, salvage, life, per) {
  16646. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Syd", OfficeExtension.OperationType.Default, [cost, salvage, life, per], false, true, null));
  16647. };
  16648. Functions.prototype.t=function (value) {
  16649. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T", OfficeExtension.OperationType.Default, [value], false, true, null));
  16650. };
  16651. Functions.prototype.tbillEq=function (settlement, maturity, discount) {
  16652. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillEq", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  16653. };
  16654. Functions.prototype.tbillPrice=function (settlement, maturity, discount) {
  16655. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillPrice", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  16656. };
  16657. Functions.prototype.tbillYield=function (settlement, maturity, pr) {
  16658. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillYield", OfficeExtension.OperationType.Default, [settlement, maturity, pr], false, true, null));
  16659. };
  16660. Functions.prototype.t_Dist=function (x, degFreedom, cumulative) {
  16661. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  16662. };
  16663. Functions.prototype.t_Dist_2T=function (x, degFreedom) {
  16664. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_2T", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  16665. };
  16666. Functions.prototype.t_Dist_RT=function (x, degFreedom) {
  16667. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  16668. };
  16669. Functions.prototype.t_Inv=function (probability, degFreedom) {
  16670. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  16671. };
  16672. Functions.prototype.t_Inv_2T=function (probability, degFreedom) {
  16673. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv_2T", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  16674. };
  16675. Functions.prototype.tan=function (number) {
  16676. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tan", OfficeExtension.OperationType.Default, [number], false, true, null));
  16677. };
  16678. Functions.prototype.tanh=function (number) {
  16679. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  16680. };
  16681. Functions.prototype.text=function (value, formatText) {
  16682. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Text", OfficeExtension.OperationType.Default, [value, formatText], false, true, null));
  16683. };
  16684. Functions.prototype.time=function (hour, minute, second) {
  16685. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Time", OfficeExtension.OperationType.Default, [hour, minute, second], false, true, null));
  16686. };
  16687. Functions.prototype.timevalue=function (timeText) {
  16688. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Timevalue", OfficeExtension.OperationType.Default, [timeText], false, true, null));
  16689. };
  16690. Functions.prototype.today=function () {
  16691. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Today", OfficeExtension.OperationType.Default, [], false, true, null));
  16692. };
  16693. Functions.prototype.trim=function (text) {
  16694. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trim", OfficeExtension.OperationType.Default, [text], false, true, null));
  16695. };
  16696. Functions.prototype.trimMean=function (array, percent) {
  16697. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TrimMean", OfficeExtension.OperationType.Default, [array, percent], false, true, null));
  16698. };
  16699. Functions.prototype.true=function () {
  16700. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "True", OfficeExtension.OperationType.Default, [], false, true, null));
  16701. };
  16702. Functions.prototype.trunc=function (number, numDigits) {
  16703. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trunc", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16704. };
  16705. Functions.prototype.type=function (value) {
  16706. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Type", OfficeExtension.OperationType.Default, [value], false, true, null));
  16707. };
  16708. Functions.prototype.usdollar=function (number, decimals) {
  16709. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "USDollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  16710. };
  16711. Functions.prototype.unichar=function (number) {
  16712. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unichar", OfficeExtension.OperationType.Default, [number], false, true, null));
  16713. };
  16714. Functions.prototype.unicode=function (text) {
  16715. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unicode", OfficeExtension.OperationType.Default, [text], false, true, null));
  16716. };
  16717. Functions.prototype.upper=function (text) {
  16718. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Upper", OfficeExtension.OperationType.Default, [text], false, true, null));
  16719. };
  16720. Functions.prototype.vlookup=function (lookupValue, tableArray, colIndexNum, rangeLookup) {
  16721. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, colIndexNum, rangeLookup], false, true, null));
  16722. };
  16723. Functions.prototype.value=function (text) {
  16724. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Value", OfficeExtension.OperationType.Default, [text], false, true, null));
  16725. };
  16726. Functions.prototype.varA=function () {
  16727. var values=[];
  16728. for (var _i=0; _i < arguments.length; _i++) {
  16729. values[_i - 0]=arguments[_i];
  16730. }
  16731. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16732. };
  16733. Functions.prototype.varPA=function () {
  16734. var values=[];
  16735. for (var _i=0; _i < arguments.length; _i++) {
  16736. values[_i - 0]=arguments[_i];
  16737. }
  16738. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16739. };
  16740. Functions.prototype.var_P=function () {
  16741. var values=[];
  16742. for (var _i=0; _i < arguments.length; _i++) {
  16743. values[_i - 0]=arguments[_i];
  16744. }
  16745. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  16746. };
  16747. Functions.prototype.var_S=function () {
  16748. var values=[];
  16749. for (var _i=0; _i < arguments.length; _i++) {
  16750. values[_i - 0]=arguments[_i];
  16751. }
  16752. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  16753. };
  16754. Functions.prototype.vdb=function (cost, salvage, life, startPeriod, endPeriod, factor, noSwitch) {
  16755. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Vdb", OfficeExtension.OperationType.Default, [cost, salvage, life, startPeriod, endPeriod, factor, noSwitch], false, true, null));
  16756. };
  16757. Functions.prototype.weekNum=function (serialNumber, returnType) {
  16758. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WeekNum", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  16759. };
  16760. Functions.prototype.weekday=function (serialNumber, returnType) {
  16761. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weekday", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  16762. };
  16763. Functions.prototype.weibull_Dist=function (x, alpha, beta, cumulative) {
  16764. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weibull_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  16765. };
  16766. Functions.prototype.workDay=function (startDate, days, holidays) {
  16767. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay", OfficeExtension.OperationType.Default, [startDate, days, holidays], false, true, null));
  16768. };
  16769. Functions.prototype.workDay_Intl=function (startDate, days, weekend, holidays) {
  16770. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay_Intl", OfficeExtension.OperationType.Default, [startDate, days, weekend, holidays], false, true, null));
  16771. };
  16772. Functions.prototype.xirr=function (values, dates, guess) {
  16773. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xirr", OfficeExtension.OperationType.Default, [values, dates, guess], false, true, null));
  16774. };
  16775. Functions.prototype.xnpv=function (rate, values, dates) {
  16776. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xnpv", OfficeExtension.OperationType.Default, [rate, values, dates], false, true, null));
  16777. };
  16778. Functions.prototype.xor=function () {
  16779. var values=[];
  16780. for (var _i=0; _i < arguments.length; _i++) {
  16781. values[_i - 0]=arguments[_i];
  16782. }
  16783. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xor", OfficeExtension.OperationType.Default, [values], false, true, null));
  16784. };
  16785. Functions.prototype.year=function (serialNumber) {
  16786. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Year", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16787. };
  16788. Functions.prototype.yearFrac=function (startDate, endDate, basis) {
  16789. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YearFrac", OfficeExtension.OperationType.Default, [startDate, endDate, basis], false, true, null));
  16790. };
  16791. Functions.prototype.yield=function (settlement, maturity, rate, pr, redemption, frequency, basis) {
  16792. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Yield", OfficeExtension.OperationType.Default, [settlement, maturity, rate, pr, redemption, frequency, basis], false, true, null));
  16793. };
  16794. Functions.prototype.yieldDisc=function (settlement, maturity, pr, redemption, basis) {
  16795. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldDisc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  16796. };
  16797. Functions.prototype.yieldMat=function (settlement, maturity, issue, rate, pr, basis) {
  16798. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, pr, basis], false, true, null));
  16799. };
  16800. Functions.prototype.z_Test=function (array, x, sigma) {
  16801. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Z_Test", OfficeExtension.OperationType.Default, [array, x, sigma], false, true, null));
  16802. };
  16803. Functions.prototype._handleResult=function (value) {
  16804. _super.prototype._handleResult.call(this, value);
  16805. if (_isNullOrUndefined(value))
  16806. return;
  16807. var obj=value;
  16808. _fixObjectPathIfNecessary(this, obj);
  16809. };
  16810. Functions.prototype.toJSON=function () {
  16811. return {};
  16812. };
  16813. return Functions;
  16814. }(OfficeExtension.ClientObject));
  16815. Excel.Functions=Functions;
  16816. var ErrorCodes;
  16817. (function (ErrorCodes) {
  16818. ErrorCodes.accessDenied="AccessDenied";
  16819. ErrorCodes.apiNotFound="ApiNotFound";
  16820. ErrorCodes.generalException="GeneralException";
  16821. ErrorCodes.insertDeleteConflict="InsertDeleteConflict";
  16822. ErrorCodes.invalidArgument="InvalidArgument";
  16823. ErrorCodes.invalidBinding="InvalidBinding";
  16824. ErrorCodes.invalidOperation="InvalidOperation";
  16825. ErrorCodes.invalidReference="InvalidReference";
  16826. ErrorCodes.invalidSelection="InvalidSelection";
  16827. ErrorCodes.itemAlreadyExists="ItemAlreadyExists";
  16828. ErrorCodes.itemNotFound="ItemNotFound";
  16829. ErrorCodes.notImplemented="NotImplemented";
  16830. ErrorCodes.unsupportedOperation="UnsupportedOperation";
  16831. })(ErrorCodes=Excel.ErrorCodes || (Excel.ErrorCodes={}));
  16832. })(Excel || (Excel={}));
  16833. var Excel;
  16834. (function (Excel) {
  16835. var RequestContext=(function (_super) {
  16836. __extends(RequestContext, _super);
  16837. function RequestContext(url) {
  16838. _super.call(this, url);
  16839. this.m_workbook=new Excel.Workbook(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this));
  16840. this._rootObject=this.m_workbook;
  16841. }
  16842. Object.defineProperty(RequestContext.prototype, "workbook", {
  16843. get: function () {
  16844. return this.m_workbook;
  16845. },
  16846. enumerable: true,
  16847. configurable: true
  16848. });
  16849. return RequestContext;
  16850. }(OfficeExtension.ClientRequestContext));
  16851. Excel.RequestContext=RequestContext;
  16852. function run(arg1, arg2, arg3) {
  16853. return OfficeExtension.ClientRequestContext._runBatch("Excel.run", arguments, function (requestInfo) {
  16854. var ret=new Excel.RequestContext(requestInfo ? requestInfo.url : null);
  16855. if (requestInfo && requestInfo.headers) {
  16856. for (var name in requestInfo.headers) {
  16857. ret.requestHeaders[name]=requestInfo.headers[name];
  16858. }
  16859. }
  16860. return ret;
  16861. });
  16862. }
  16863. Excel.run=run;
  16864. })(Excel || (Excel={}));
  16865. var Excel;
  16866. (function (Excel) {
  16867. Excel._RedirectV1APIs=false;
  16868. Excel._V1APIMap={
  16869. "GetDataAsync": {
  16870. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetData(callArgs); },
  16871. postprocess: getDataCommonPostprocess
  16872. },
  16873. "GetSelectedDataAsync": {
  16874. call: function (ctx, callArgs) { return ctx.workbook._V1Api.getSelectedData(callArgs); },
  16875. postprocess: getDataCommonPostprocess
  16876. },
  16877. "GoToByIdAsync": {
  16878. call: function (ctx, callArgs) { return ctx.workbook._V1Api.gotoById(callArgs); }
  16879. },
  16880. "AddColumnsAsync": {
  16881. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddColumns(callArgs); }
  16882. },
  16883. "AddFromSelectionAsync": {
  16884. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromSelection(callArgs); },
  16885. postprocess: postprocessBindingDescriptor
  16886. },
  16887. "AddFromNamedItemAsync": {
  16888. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromNamedItem(callArgs); },
  16889. postprocess: postprocessBindingDescriptor
  16890. },
  16891. "AddFromPromptAsync": {
  16892. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromPrompt(callArgs); },
  16893. postprocess: postprocessBindingDescriptor
  16894. },
  16895. "AddRowsAsync": {
  16896. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddRows(callArgs); }
  16897. },
  16898. "GetByIdAsync": {
  16899. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetById(callArgs); },
  16900. postprocess: postprocessBindingDescriptor
  16901. },
  16902. "ReleaseByIdAsync": {
  16903. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingReleaseById(callArgs); }
  16904. },
  16905. "GetAllAsync": {
  16906. call: function (ctx) { return ctx.workbook._V1Api.bindingGetAll(); },
  16907. postprocess: function (response) {
  16908. return response.bindings.map(function (descriptor) { return postprocessBindingDescriptor(descriptor); });
  16909. }
  16910. },
  16911. "DeleteAllDataValuesAsync": {
  16912. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingDeleteAllDataValues(callArgs); }
  16913. },
  16914. "SetSelectedDataAsync": {
  16915. preprocess: function (callArgs) {
  16916. var preimage=callArgs["cellFormat"];
  16917. if (window.OSF.DDA.SafeArray) {
  16918. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  16919. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  16920. }
  16921. }
  16922. else if (window.OSF.DDA.WAC) {
  16923. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  16924. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  16925. }
  16926. }
  16927. return callArgs;
  16928. },
  16929. call: function (ctx, callArgs) { return ctx.workbook._V1Api.setSelectedData(callArgs); }
  16930. },
  16931. "SetDataAsync": {
  16932. preprocess: function (callArgs) {
  16933. var preimage=callArgs["cellFormat"];
  16934. if (window.OSF.DDA.SafeArray) {
  16935. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  16936. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  16937. }
  16938. }
  16939. else if (window.OSF.DDA.WAC) {
  16940. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  16941. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  16942. }
  16943. }
  16944. return callArgs;
  16945. },
  16946. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetData(callArgs); }
  16947. },
  16948. "SetFormatsAsync": {
  16949. preprocess: function (callArgs) {
  16950. var preimage=callArgs["cellFormat"];
  16951. if (window.OSF.DDA.SafeArray) {
  16952. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  16953. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  16954. }
  16955. }
  16956. else if (window.OSF.DDA.WAC) {
  16957. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  16958. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  16959. }
  16960. }
  16961. return callArgs;
  16962. },
  16963. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetFormats(callArgs); }
  16964. },
  16965. "SetTableOptionsAsync": {
  16966. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetTableOptions(callArgs); }
  16967. },
  16968. "ClearFormatsAsync": {
  16969. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingClearFormats(callArgs); }
  16970. },
  16971. };
  16972. function postprocessBindingDescriptor(response) {
  16973. var bindingDescriptor={
  16974. BindingColumnCount: response.bindingColumnCount,
  16975. BindingId: response.bindingId,
  16976. BindingRowCount: response.bindingRowCount,
  16977. bindingType: response.bindingType,
  16978. HasHeaders: response.hasHeaders
  16979. };
  16980. return window.OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, window.Microsoft.Office.WebExtension.context.document);
  16981. }
  16982. function getDataCommonPostprocess(response, callArgs) {
  16983. var isPlainData=response.headers==null;
  16984. var data;
  16985. if (isPlainData) {
  16986. data=response.rows;
  16987. }
  16988. else {
  16989. data=response;
  16990. }
  16991. data=window.OSF.DDA.DataCoercion.coerceData(data, callArgs[window.Microsoft.Office.WebExtension.Parameters.CoercionType]);
  16992. return data==undefined ? null : data;
  16993. }
  16994. })(Excel || (Excel={}));